diff options
626 files changed, 8489 insertions, 6873 deletions
diff --git a/Documentation/Changes b/Documentation/Changes index b17580885273..07c75d18154e 100644 --- a/Documentation/Changes +++ b/Documentation/Changes | |||
@@ -196,13 +196,6 @@ chmod 0644 /dev/cpu/microcode | |||
196 | as root before you can use this. You'll probably also want to | 196 | as root before you can use this. You'll probably also want to |
197 | get the user-space microcode_ctl utility to use with this. | 197 | get the user-space microcode_ctl utility to use with this. |
198 | 198 | ||
199 | Powertweak | ||
200 | ---------- | ||
201 | |||
202 | If you are running v0.1.17 or earlier, you should upgrade to | ||
203 | version v0.99.0 or higher. Running old versions may cause problems | ||
204 | with programs using shared memory. | ||
205 | |||
206 | udev | 199 | udev |
207 | ---- | 200 | ---- |
208 | udev is a userspace application for populating /dev dynamically with | 201 | udev is a userspace application for populating /dev dynamically with |
@@ -366,10 +359,6 @@ Intel P6 microcode | |||
366 | ------------------ | 359 | ------------------ |
367 | o <http://www.urbanmyth.org/microcode/> | 360 | o <http://www.urbanmyth.org/microcode/> |
368 | 361 | ||
369 | Powertweak | ||
370 | ---------- | ||
371 | o <http://powertweak.sourceforge.net/> | ||
372 | |||
373 | udev | 362 | udev |
374 | ---- | 363 | ---- |
375 | o <http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html> | 364 | o <http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html> |
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl index 6c9d9d37c83a..f5170082bdb3 100644 --- a/Documentation/DocBook/device-drivers.tmpl +++ b/Documentation/DocBook/device-drivers.tmpl | |||
@@ -58,7 +58,7 @@ | |||
58 | </sect1> | 58 | </sect1> |
59 | <sect1><title>Wait queues and Wake events</title> | 59 | <sect1><title>Wait queues and Wake events</title> |
60 | !Iinclude/linux/wait.h | 60 | !Iinclude/linux/wait.h |
61 | !Ekernel/wait.c | 61 | !Ekernel/sched/wait.c |
62 | </sect1> | 62 | </sect1> |
63 | <sect1><title>High-resolution timers</title> | 63 | <sect1><title>High-resolution timers</title> |
64 | !Iinclude/linux/ktime.h | 64 | !Iinclude/linux/ktime.h |
diff --git a/Documentation/devicetree/bindings/arm/omap/mpu.txt b/Documentation/devicetree/bindings/arm/omap/mpu.txt index 1a5a42ce21bb..83f405bde138 100644 --- a/Documentation/devicetree/bindings/arm/omap/mpu.txt +++ b/Documentation/devicetree/bindings/arm/omap/mpu.txt | |||
@@ -7,10 +7,18 @@ The MPU contain CPUs, GIC, L2 cache and a local PRCM. | |||
7 | Required properties: | 7 | Required properties: |
8 | - compatible : Should be "ti,omap3-mpu" for OMAP3 | 8 | - compatible : Should be "ti,omap3-mpu" for OMAP3 |
9 | Should be "ti,omap4-mpu" for OMAP4 | 9 | Should be "ti,omap4-mpu" for OMAP4 |
10 | Should be "ti,omap5-mpu" for OMAP5 | ||
10 | - ti,hwmods: "mpu" | 11 | - ti,hwmods: "mpu" |
11 | 12 | ||
12 | Examples: | 13 | Examples: |
13 | 14 | ||
15 | - For an OMAP5 SMP system: | ||
16 | |||
17 | mpu { | ||
18 | compatible = "ti,omap5-mpu"; | ||
19 | ti,hwmods = "mpu" | ||
20 | }; | ||
21 | |||
14 | - For an OMAP4 SMP system: | 22 | - For an OMAP4 SMP system: |
15 | 23 | ||
16 | mpu { | 24 | mpu { |
diff --git a/Documentation/devicetree/bindings/arm/pmu.txt b/Documentation/devicetree/bindings/arm/pmu.txt index 343781b9f246..3e1e498fea96 100644 --- a/Documentation/devicetree/bindings/arm/pmu.txt +++ b/Documentation/devicetree/bindings/arm/pmu.txt | |||
@@ -7,6 +7,7 @@ representation in the device tree should be done as under:- | |||
7 | Required properties: | 7 | Required properties: |
8 | 8 | ||
9 | - compatible : should be one of | 9 | - compatible : should be one of |
10 | "arm,armv8-pmuv3" | ||
10 | "arm,cortex-a15-pmu" | 11 | "arm,cortex-a15-pmu" |
11 | "arm,cortex-a9-pmu" | 12 | "arm,cortex-a9-pmu" |
12 | "arm,cortex-a8-pmu" | 13 | "arm,cortex-a8-pmu" |
diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt index 47ada1dff216..5d49f2b37f68 100644 --- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt +++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt | |||
@@ -49,7 +49,7 @@ adc@12D10000 { | |||
49 | /* NTC thermistor is a hwmon device */ | 49 | /* NTC thermistor is a hwmon device */ |
50 | ncp15wb473@0 { | 50 | ncp15wb473@0 { |
51 | compatible = "ntc,ncp15wb473"; | 51 | compatible = "ntc,ncp15wb473"; |
52 | pullup-uV = <1800000>; | 52 | pullup-uv = <1800000>; |
53 | pullup-ohm = <47000>; | 53 | pullup-ohm = <47000>; |
54 | pulldown-ohm = <0>; | 54 | pulldown-ohm = <0>; |
55 | io-channels = <&adc 4>; | 55 | io-channels = <&adc 4>; |
diff --git a/Documentation/devicetree/bindings/clock/exynos4-clock.txt b/Documentation/devicetree/bindings/clock/exynos4-clock.txt index c6bf8a6c8f52..a2ac2d9ac71a 100644 --- a/Documentation/devicetree/bindings/clock/exynos4-clock.txt +++ b/Documentation/devicetree/bindings/clock/exynos4-clock.txt | |||
@@ -6,7 +6,7 @@ SoC's in the Exynos4 family. | |||
6 | 6 | ||
7 | Required Properties: | 7 | Required Properties: |
8 | 8 | ||
9 | - comptible: should be one of the following. | 9 | - compatible: should be one of the following. |
10 | - "samsung,exynos4210-clock" - controller compatible with Exynos4210 SoC. | 10 | - "samsung,exynos4210-clock" - controller compatible with Exynos4210 SoC. |
11 | - "samsung,exynos4412-clock" - controller compatible with Exynos4412 SoC. | 11 | - "samsung,exynos4412-clock" - controller compatible with Exynos4412 SoC. |
12 | 12 | ||
diff --git a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt index 24765c146e31..46f5c791ea0d 100644 --- a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt +++ b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt | |||
@@ -5,7 +5,7 @@ controllers within the Exynos5250 SoC. | |||
5 | 5 | ||
6 | Required Properties: | 6 | Required Properties: |
7 | 7 | ||
8 | - comptible: should be one of the following. | 8 | - compatible: should be one of the following. |
9 | - "samsung,exynos5250-clock" - controller compatible with Exynos5250 SoC. | 9 | - "samsung,exynos5250-clock" - controller compatible with Exynos5250 SoC. |
10 | 10 | ||
11 | - reg: physical base address of the controller and length of memory mapped | 11 | - reg: physical base address of the controller and length of memory mapped |
diff --git a/Documentation/devicetree/bindings/clock/exynos5420-clock.txt b/Documentation/devicetree/bindings/clock/exynos5420-clock.txt index 32aa34ecad36..458f34789e5d 100644 --- a/Documentation/devicetree/bindings/clock/exynos5420-clock.txt +++ b/Documentation/devicetree/bindings/clock/exynos5420-clock.txt | |||
@@ -5,7 +5,7 @@ controllers within the Exynos5420 SoC. | |||
5 | 5 | ||
6 | Required Properties: | 6 | Required Properties: |
7 | 7 | ||
8 | - comptible: should be one of the following. | 8 | - compatible: should be one of the following. |
9 | - "samsung,exynos5420-clock" - controller compatible with Exynos5420 SoC. | 9 | - "samsung,exynos5420-clock" - controller compatible with Exynos5420 SoC. |
10 | 10 | ||
11 | - reg: physical base address of the controller and length of memory mapped | 11 | - reg: physical base address of the controller and length of memory mapped |
diff --git a/Documentation/devicetree/bindings/clock/exynos5440-clock.txt b/Documentation/devicetree/bindings/clock/exynos5440-clock.txt index 4499e9966bc9..9955dc9c7d96 100644 --- a/Documentation/devicetree/bindings/clock/exynos5440-clock.txt +++ b/Documentation/devicetree/bindings/clock/exynos5440-clock.txt | |||
@@ -5,7 +5,7 @@ controllers within the Exynos5440 SoC. | |||
5 | 5 | ||
6 | Required Properties: | 6 | Required Properties: |
7 | 7 | ||
8 | - comptible: should be "samsung,exynos5440-clock". | 8 | - compatible: should be "samsung,exynos5440-clock". |
9 | 9 | ||
10 | - reg: physical base address of the controller and length of memory mapped | 10 | - reg: physical base address of the controller and length of memory mapped |
11 | region. | 11 | region. |
diff --git a/Documentation/devicetree/bindings/gpio/8xxx_gpio.txt b/Documentation/devicetree/bindings/gpio/8xxx_gpio.txt index b0019eb5330e..798cfc9d3839 100644 --- a/Documentation/devicetree/bindings/gpio/8xxx_gpio.txt +++ b/Documentation/devicetree/bindings/gpio/8xxx_gpio.txt | |||
@@ -5,16 +5,42 @@ This is for the non-QE/CPM/GUTs GPIO controllers as found on | |||
5 | 5 | ||
6 | Every GPIO controller node must have #gpio-cells property defined, | 6 | Every GPIO controller node must have #gpio-cells property defined, |
7 | this information will be used to translate gpio-specifiers. | 7 | this information will be used to translate gpio-specifiers. |
8 | See bindings/gpio/gpio.txt for details of how to specify GPIO | ||
9 | information for devices. | ||
10 | |||
11 | The GPIO module usually is connected to the SoC's internal interrupt | ||
12 | controller, see bindings/interrupt-controller/interrupts.txt (the | ||
13 | interrupt client nodes section) for details how to specify this GPIO | ||
14 | module's interrupt. | ||
15 | |||
16 | The GPIO module may serve as another interrupt controller (cascaded to | ||
17 | the SoC's internal interrupt controller). See the interrupt controller | ||
18 | nodes section in bindings/interrupt-controller/interrupts.txt for | ||
19 | details. | ||
8 | 20 | ||
9 | Required properties: | 21 | Required properties: |
10 | - compatible : "fsl,<CHIP>-gpio" followed by "fsl,mpc8349-gpio" for | 22 | - compatible: "fsl,<chip>-gpio" followed by "fsl,mpc8349-gpio" |
11 | 83xx, "fsl,mpc8572-gpio" for 85xx and "fsl,mpc8610-gpio" for 86xx. | 23 | for 83xx, "fsl,mpc8572-gpio" for 85xx, or |
12 | - #gpio-cells : Should be two. The first cell is the pin number and the | 24 | "fsl,mpc8610-gpio" for 86xx. |
13 | second cell is used to specify optional parameters (currently unused). | 25 | - #gpio-cells: Should be two. The first cell is the pin number |
14 | - interrupts : Interrupt mapping for GPIO IRQ. | 26 | and the second cell is used to specify optional |
15 | - interrupt-parent : Phandle for the interrupt controller that | 27 | parameters (currently unused). |
16 | services interrupts for this device. | 28 | - interrupt-parent: Phandle for the interrupt controller that |
17 | - gpio-controller : Marks the port as GPIO controller. | 29 | services interrupts for this device. |
30 | - interrupts: Interrupt mapping for GPIO IRQ. | ||
31 | - gpio-controller: Marks the port as GPIO controller. | ||
32 | |||
33 | Optional properties: | ||
34 | - interrupt-controller: Empty boolean property which marks the GPIO | ||
35 | module as an IRQ controller. | ||
36 | - #interrupt-cells: Should be two. Defines the number of integer | ||
37 | cells required to specify an interrupt within | ||
38 | this interrupt controller. The first cell | ||
39 | defines the pin number, the second cell | ||
40 | defines additional flags (trigger type, | ||
41 | trigger polarity). Note that the available | ||
42 | set of trigger conditions supported by the | ||
43 | GPIO module depends on the actual SoC. | ||
18 | 44 | ||
19 | Example of gpio-controller nodes for a MPC8347 SoC: | 45 | Example of gpio-controller nodes for a MPC8347 SoC: |
20 | 46 | ||
@@ -22,39 +48,27 @@ Example of gpio-controller nodes for a MPC8347 SoC: | |||
22 | #gpio-cells = <2>; | 48 | #gpio-cells = <2>; |
23 | compatible = "fsl,mpc8347-gpio", "fsl,mpc8349-gpio"; | 49 | compatible = "fsl,mpc8347-gpio", "fsl,mpc8349-gpio"; |
24 | reg = <0xc00 0x100>; | 50 | reg = <0xc00 0x100>; |
25 | interrupts = <74 0x8>; | ||
26 | interrupt-parent = <&ipic>; | 51 | interrupt-parent = <&ipic>; |
52 | interrupts = <74 0x8>; | ||
27 | gpio-controller; | 53 | gpio-controller; |
54 | interrupt-controller; | ||
55 | #interrupt-cells = <2>; | ||
28 | }; | 56 | }; |
29 | 57 | ||
30 | gpio2: gpio-controller@d00 { | 58 | gpio2: gpio-controller@d00 { |
31 | #gpio-cells = <2>; | 59 | #gpio-cells = <2>; |
32 | compatible = "fsl,mpc8347-gpio", "fsl,mpc8349-gpio"; | 60 | compatible = "fsl,mpc8347-gpio", "fsl,mpc8349-gpio"; |
33 | reg = <0xd00 0x100>; | 61 | reg = <0xd00 0x100>; |
34 | interrupts = <75 0x8>; | ||
35 | interrupt-parent = <&ipic>; | 62 | interrupt-parent = <&ipic>; |
63 | interrupts = <75 0x8>; | ||
36 | gpio-controller; | 64 | gpio-controller; |
37 | }; | 65 | }; |
38 | 66 | ||
39 | See booting-without-of.txt for details of how to specify GPIO | 67 | Example of a peripheral using the GPIO module as an IRQ controller: |
40 | information for devices. | ||
41 | |||
42 | To use GPIO pins as interrupt sources for peripherals, specify the | ||
43 | GPIO controller as the interrupt parent and define GPIO number + | ||
44 | trigger mode using the interrupts property, which is defined like | ||
45 | this: | ||
46 | |||
47 | interrupts = <number trigger>, where: | ||
48 | - number: GPIO pin (0..31) | ||
49 | - trigger: trigger mode: | ||
50 | 2 = trigger on falling edge | ||
51 | 3 = trigger on both edges | ||
52 | |||
53 | Example of device using this is: | ||
54 | 68 | ||
55 | funkyfpga@0 { | 69 | funkyfpga@0 { |
56 | compatible = "funky-fpga"; | 70 | compatible = "funky-fpga"; |
57 | ... | 71 | ... |
58 | interrupts = <4 3>; | ||
59 | interrupt-parent = <&gpio1>; | 72 | interrupt-parent = <&gpio1>; |
73 | interrupts = <4 3>; | ||
60 | }; | 74 | }; |
diff --git a/Documentation/devicetree/bindings/i2c/i2c-omap.txt b/Documentation/devicetree/bindings/i2c/i2c-omap.txt index 56564aa4b444..7e49839d4124 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-omap.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-omap.txt | |||
@@ -1,7 +1,8 @@ | |||
1 | I2C for OMAP platforms | 1 | I2C for OMAP platforms |
2 | 2 | ||
3 | Required properties : | 3 | Required properties : |
4 | - compatible : Must be "ti,omap3-i2c" or "ti,omap4-i2c" | 4 | - compatible : Must be "ti,omap2420-i2c", "ti,omap2430-i2c", "ti,omap3-i2c" |
5 | or "ti,omap4-i2c" | ||
5 | - ti,hwmods : Must be "i2c<n>", n being the instance number (1-based) | 6 | - ti,hwmods : Must be "i2c<n>", n being the instance number (1-based) |
6 | - #address-cells = <1>; | 7 | - #address-cells = <1>; |
7 | - #size-cells = <0>; | 8 | - #size-cells = <0>; |
diff --git a/Documentation/devicetree/bindings/mmc/ti-omap.txt b/Documentation/devicetree/bindings/mmc/ti-omap.txt new file mode 100644 index 000000000000..8de579969763 --- /dev/null +++ b/Documentation/devicetree/bindings/mmc/ti-omap.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | * TI MMC host controller for OMAP1 and 2420 | ||
2 | |||
3 | The MMC Host Controller on TI OMAP1 and 2420 family provides | ||
4 | an interface for MMC, SD, and SDIO types of memory cards. | ||
5 | |||
6 | This file documents differences between the core properties described | ||
7 | by mmc.txt and the properties used by the omap mmc driver. | ||
8 | |||
9 | Note that this driver will not work with omap2430 or later omaps, | ||
10 | please see the omap hsmmc driver for the current omaps. | ||
11 | |||
12 | Required properties: | ||
13 | - compatible: Must be "ti,omap2420-mmc", for OMAP2420 controllers | ||
14 | - ti,hwmods: For 2420, must be "msdi<n>", where n is controller | ||
15 | instance starting 1 | ||
16 | |||
17 | Examples: | ||
18 | |||
19 | msdi1: mmc@4809c000 { | ||
20 | compatible = "ti,omap2420-mmc"; | ||
21 | ti,hwmods = "msdi1"; | ||
22 | reg = <0x4809c000 0x80>; | ||
23 | interrupts = <83>; | ||
24 | dmas = <&sdma 61 &sdma 62>; | ||
25 | dma-names = "tx", "rx"; | ||
26 | }; | ||
27 | |||
28 | * TI MMC host controller for OMAP1 and 2420 | ||
29 | |||
30 | The MMC Host Controller on TI OMAP1 and 2420 family provides | ||
31 | an interface for MMC, SD, and SDIO types of memory cards. | ||
32 | |||
33 | This file documents differences between the core properties described | ||
34 | by mmc.txt and the properties used by the omap mmc driver. | ||
35 | |||
36 | Note that this driver will not work with omap2430 or later omaps, | ||
37 | please see the omap hsmmc driver for the current omaps. | ||
38 | |||
39 | Required properties: | ||
40 | - compatible: Must be "ti,omap2420-mmc", for OMAP2420 controllers | ||
41 | - ti,hwmods: For 2420, must be "msdi<n>", where n is controller | ||
42 | instance starting 1 | ||
43 | |||
44 | Examples: | ||
45 | |||
46 | msdi1: mmc@4809c000 { | ||
47 | compatible = "ti,omap2420-mmc"; | ||
48 | ti,hwmods = "msdi1"; | ||
49 | reg = <0x4809c000 0x80>; | ||
50 | interrupts = <83>; | ||
51 | dmas = <&sdma 61 &sdma 62>; | ||
52 | dma-names = "tx", "rx"; | ||
53 | }; | ||
54 | |||
diff --git a/Documentation/devicetree/bindings/net/fsl-fec.txt b/Documentation/devicetree/bindings/net/fsl-fec.txt index d53639221403..845ff848d895 100644 --- a/Documentation/devicetree/bindings/net/fsl-fec.txt +++ b/Documentation/devicetree/bindings/net/fsl-fec.txt | |||
@@ -15,6 +15,7 @@ Optional properties: | |||
15 | only if property "phy-reset-gpios" is available. Missing the property | 15 | only if property "phy-reset-gpios" is available. Missing the property |
16 | will have the duration be 1 millisecond. Numbers greater than 1000 are | 16 | will have the duration be 1 millisecond. Numbers greater than 1000 are |
17 | invalid and 1 millisecond will be used instead. | 17 | invalid and 1 millisecond will be used instead. |
18 | - phy-supply: regulator that powers the Ethernet PHY. | ||
18 | 19 | ||
19 | Example: | 20 | Example: |
20 | 21 | ||
@@ -25,4 +26,5 @@ ethernet@83fec000 { | |||
25 | phy-mode = "mii"; | 26 | phy-mode = "mii"; |
26 | phy-reset-gpios = <&gpio2 14 0>; /* GPIO2_14 */ | 27 | phy-reset-gpios = <&gpio2 14 0>; /* GPIO2_14 */ |
27 | local-mac-address = [00 04 9F 01 1B B9]; | 28 | local-mac-address = [00 04 9F 01 1B B9]; |
29 | phy-supply = <®_fec_supply>; | ||
28 | }; | 30 | }; |
diff --git a/Documentation/devicetree/bindings/rng/qcom,prng.txt b/Documentation/devicetree/bindings/rng/qcom,prng.txt new file mode 100644 index 000000000000..8e5853c2879b --- /dev/null +++ b/Documentation/devicetree/bindings/rng/qcom,prng.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | Qualcomm MSM pseudo random number generator. | ||
2 | |||
3 | Required properties: | ||
4 | |||
5 | - compatible : should be "qcom,prng" | ||
6 | - reg : specifies base physical address and size of the registers map | ||
7 | - clocks : phandle to clock-controller plus clock-specifier pair | ||
8 | - clock-names : "core" clocks all registers, FIFO and circuits in PRNG IP block | ||
9 | |||
10 | Example: | ||
11 | |||
12 | rng@f9bff000 { | ||
13 | compatible = "qcom,prng"; | ||
14 | reg = <0xf9bff000 0x200>; | ||
15 | clocks = <&clock GCC_PRNG_AHB_CLK>; | ||
16 | clock-names = "core"; | ||
17 | }; | ||
diff --git a/Documentation/devicetree/bindings/spi/nvidia,tegra20-spi.txt b/Documentation/devicetree/bindings/spi/nvidia,tegra20-spi.txt deleted file mode 100644 index 6b9e51896693..000000000000 --- a/Documentation/devicetree/bindings/spi/nvidia,tegra20-spi.txt +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | NVIDIA Tegra 2 SPI device | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : should be "nvidia,tegra20-spi". | ||
5 | - gpios : should specify GPIOs used for chipselect. | ||
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index ce95ed1c6d3e..edbb8d88c85e 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt | |||
@@ -32,12 +32,14 @@ est ESTeem Wireless Modems | |||
32 | fsl Freescale Semiconductor | 32 | fsl Freescale Semiconductor |
33 | GEFanuc GE Fanuc Intelligent Platforms Embedded Systems, Inc. | 33 | GEFanuc GE Fanuc Intelligent Platforms Embedded Systems, Inc. |
34 | gef GE Fanuc Intelligent Platforms Embedded Systems, Inc. | 34 | gef GE Fanuc Intelligent Platforms Embedded Systems, Inc. |
35 | gmt Global Mixed-mode Technology, Inc. | ||
35 | hisilicon Hisilicon Limited. | 36 | hisilicon Hisilicon Limited. |
36 | hp Hewlett Packard | 37 | hp Hewlett Packard |
37 | ibm International Business Machines (IBM) | 38 | ibm International Business Machines (IBM) |
38 | idt Integrated Device Technologies, Inc. | 39 | idt Integrated Device Technologies, Inc. |
39 | img Imagination Technologies Ltd. | 40 | img Imagination Technologies Ltd. |
40 | intercontrol Inter Control Group | 41 | intercontrol Inter Control Group |
42 | lg LG Corporation | ||
41 | linux Linux-specific binding | 43 | linux Linux-specific binding |
42 | lsi LSI Corp. (LSI Logic) | 44 | lsi LSI Corp. (LSI Logic) |
43 | marvell Marvell Technology Group Ltd. | 45 | marvell Marvell Technology Group Ltd. |
diff --git a/Documentation/gpio/00-INDEX b/Documentation/gpio/00-INDEX new file mode 100644 index 000000000000..1de43ae46ae6 --- /dev/null +++ b/Documentation/gpio/00-INDEX | |||
@@ -0,0 +1,14 @@ | |||
1 | 00-INDEX | ||
2 | - This file | ||
3 | gpio.txt | ||
4 | - Introduction to GPIOs and their kernel interfaces | ||
5 | consumer.txt | ||
6 | - How to obtain and use GPIOs in a driver | ||
7 | driver.txt | ||
8 | - How to write a GPIO driver | ||
9 | board.txt | ||
10 | - How to assign GPIOs to a consumer device and a function | ||
11 | sysfs.txt | ||
12 | - Information about the GPIO sysfs interface | ||
13 | gpio-legacy.txt | ||
14 | - Historical documentation of the deprecated GPIO integer interface | ||
diff --git a/Documentation/gpio/board.txt b/Documentation/gpio/board.txt new file mode 100644 index 000000000000..0d03506f2cc5 --- /dev/null +++ b/Documentation/gpio/board.txt | |||
@@ -0,0 +1,115 @@ | |||
1 | GPIO Mappings | ||
2 | ============= | ||
3 | |||
4 | This document explains how GPIOs can be assigned to given devices and functions. | ||
5 | Note that it only applies to the new descriptor-based interface. For a | ||
6 | description of the deprecated integer-based GPIO interface please refer to | ||
7 | gpio-legacy.txt (actually, there is no real mapping possible with the old | ||
8 | interface; you just fetch an integer from somewhere and request the | ||
9 | corresponding GPIO. | ||
10 | |||
11 | Platforms that make use of GPIOs must select ARCH_REQUIRE_GPIOLIB (if GPIO usage | ||
12 | is mandatory) or ARCH_WANT_OPTIONAL_GPIOLIB (if GPIO support can be omitted) in | ||
13 | their Kconfig. Then, how GPIOs are mapped depends on what the platform uses to | ||
14 | describe its hardware layout. Currently, mappings can be defined through device | ||
15 | tree, ACPI, and platform data. | ||
16 | |||
17 | Device Tree | ||
18 | ----------- | ||
19 | GPIOs can easily be mapped to devices and functions in the device tree. The | ||
20 | exact way to do it depends on the GPIO controller providing the GPIOs, see the | ||
21 | device tree bindings for your controller. | ||
22 | |||
23 | GPIOs mappings are defined in the consumer device's node, in a property named | ||
24 | <function>-gpios, where <function> is the function the driver will request | ||
25 | through gpiod_get(). For example: | ||
26 | |||
27 | foo_device { | ||
28 | compatible = "acme,foo"; | ||
29 | ... | ||
30 | led-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>, /* red */ | ||
31 | <&gpio 16 GPIO_ACTIVE_HIGH>, /* green */ | ||
32 | <&gpio 17 GPIO_ACTIVE_HIGH>; /* blue */ | ||
33 | |||
34 | power-gpio = <&gpio 1 GPIO_ACTIVE_LOW>; | ||
35 | }; | ||
36 | |||
37 | This property will make GPIOs 15, 16 and 17 available to the driver under the | ||
38 | "led" function, and GPIO 1 as the "power" GPIO: | ||
39 | |||
40 | struct gpio_desc *red, *green, *blue, *power; | ||
41 | |||
42 | red = gpiod_get_index(dev, "led", 0); | ||
43 | green = gpiod_get_index(dev, "led", 1); | ||
44 | blue = gpiod_get_index(dev, "led", 2); | ||
45 | |||
46 | power = gpiod_get(dev, "power"); | ||
47 | |||
48 | The led GPIOs will be active-high, while the power GPIO will be active-low (i.e. | ||
49 | gpiod_is_active_low(power) will be true). | ||
50 | |||
51 | ACPI | ||
52 | ---- | ||
53 | ACPI does not support function names for GPIOs. Therefore, only the "idx" | ||
54 | argument of gpiod_get_index() is useful to discriminate between GPIOs assigned | ||
55 | to a device. The "con_id" argument can still be set for debugging purposes (it | ||
56 | will appear under error messages as well as debug and sysfs nodes). | ||
57 | |||
58 | Platform Data | ||
59 | ------------- | ||
60 | Finally, GPIOs can be bound to devices and functions using platform data. Board | ||
61 | files that desire to do so need to include the following header: | ||
62 | |||
63 | #include <linux/gpio/driver.h> | ||
64 | |||
65 | GPIOs are mapped by the means of tables of lookups, containing instances of the | ||
66 | gpiod_lookup structure. Two macros are defined to help declaring such mappings: | ||
67 | |||
68 | GPIO_LOOKUP(chip_label, chip_hwnum, dev_id, con_id, flags) | ||
69 | GPIO_LOOKUP_IDX(chip_label, chip_hwnum, dev_id, con_id, idx, flags) | ||
70 | |||
71 | where | ||
72 | |||
73 | - chip_label is the label of the gpiod_chip instance providing the GPIO | ||
74 | - chip_hwnum is the hardware number of the GPIO within the chip | ||
75 | - dev_id is the identifier of the device that will make use of this GPIO. If | ||
76 | NULL, the GPIO will be available to all devices. | ||
77 | - con_id is the name of the GPIO function from the device point of view. It | ||
78 | can be NULL. | ||
79 | - idx is the index of the GPIO within the function. | ||
80 | - flags is defined to specify the following properties: | ||
81 | * GPIOF_ACTIVE_LOW - to configure the GPIO as active-low | ||
82 | * GPIOF_OPEN_DRAIN - GPIO pin is open drain type. | ||
83 | * GPIOF_OPEN_SOURCE - GPIO pin is open source type. | ||
84 | |||
85 | In the future, these flags might be extended to support more properties. | ||
86 | |||
87 | Note that GPIO_LOOKUP() is just a shortcut to GPIO_LOOKUP_IDX() where idx = 0. | ||
88 | |||
89 | A lookup table can then be defined as follows: | ||
90 | |||
91 | struct gpiod_lookup gpios_table[] = { | ||
92 | GPIO_LOOKUP_IDX("gpio.0", 15, "foo.0", "led", 0, GPIO_ACTIVE_HIGH), | ||
93 | GPIO_LOOKUP_IDX("gpio.0", 16, "foo.0", "led", 1, GPIO_ACTIVE_HIGH), | ||
94 | GPIO_LOOKUP_IDX("gpio.0", 17, "foo.0", "led", 2, GPIO_ACTIVE_HIGH), | ||
95 | GPIO_LOOKUP("gpio.0", 1, "foo.0", "power", GPIO_ACTIVE_LOW), | ||
96 | }; | ||
97 | |||
98 | And the table can be added by the board code as follows: | ||
99 | |||
100 | gpiod_add_table(gpios_table, ARRAY_SIZE(gpios_table)); | ||
101 | |||
102 | The driver controlling "foo.0" will then be able to obtain its GPIOs as follows: | ||
103 | |||
104 | struct gpio_desc *red, *green, *blue, *power; | ||
105 | |||
106 | red = gpiod_get_index(dev, "led", 0); | ||
107 | green = gpiod_get_index(dev, "led", 1); | ||
108 | blue = gpiod_get_index(dev, "led", 2); | ||
109 | |||
110 | power = gpiod_get(dev, "power"); | ||
111 | gpiod_direction_output(power, 1); | ||
112 | |||
113 | Since the "power" GPIO is mapped as active-low, its actual signal will be 0 | ||
114 | after this code. Contrary to the legacy integer GPIO interface, the active-low | ||
115 | property is handled during mapping and is thus transparent to GPIO consumers. | ||
diff --git a/Documentation/gpio/consumer.txt b/Documentation/gpio/consumer.txt new file mode 100644 index 000000000000..07c74a3765a0 --- /dev/null +++ b/Documentation/gpio/consumer.txt | |||
@@ -0,0 +1,197 @@ | |||
1 | GPIO Descriptor Consumer Interface | ||
2 | ================================== | ||
3 | |||
4 | This document describes the consumer interface of the GPIO framework. Note that | ||
5 | it describes the new descriptor-based interface. For a description of the | ||
6 | deprecated integer-based GPIO interface please refer to gpio-legacy.txt. | ||
7 | |||
8 | |||
9 | Guidelines for GPIOs consumers | ||
10 | ============================== | ||
11 | |||
12 | Drivers that can't work without standard GPIO calls should have Kconfig entries | ||
13 | that depend on GPIOLIB. The functions that allow a driver to obtain and use | ||
14 | GPIOs are available by including the following file: | ||
15 | |||
16 | #include <linux/gpio/consumer.h> | ||
17 | |||
18 | All the functions that work with the descriptor-based GPIO interface are | ||
19 | prefixed with gpiod_. The gpio_ prefix is used for the legacy interface. No | ||
20 | other function in the kernel should use these prefixes. | ||
21 | |||
22 | |||
23 | Obtaining and Disposing GPIOs | ||
24 | ============================= | ||
25 | |||
26 | With the descriptor-based interface, GPIOs are identified with an opaque, | ||
27 | non-forgeable handler that must be obtained through a call to one of the | ||
28 | gpiod_get() functions. Like many other kernel subsystems, gpiod_get() takes the | ||
29 | device that will use the GPIO and the function the requested GPIO is supposed to | ||
30 | fulfill: | ||
31 | |||
32 | struct gpio_desc *gpiod_get(struct device *dev, const char *con_id) | ||
33 | |||
34 | If a function is implemented by using several GPIOs together (e.g. a simple LED | ||
35 | device that displays digits), an additional index argument can be specified: | ||
36 | |||
37 | struct gpio_desc *gpiod_get_index(struct device *dev, | ||
38 | const char *con_id, unsigned int idx) | ||
39 | |||
40 | Both functions return either a valid GPIO descriptor, or an error code checkable | ||
41 | with IS_ERR(). They will never return a NULL pointer. | ||
42 | |||
43 | Device-managed variants of these functions are also defined: | ||
44 | |||
45 | struct gpio_desc *devm_gpiod_get(struct device *dev, const char *con_id) | ||
46 | |||
47 | struct gpio_desc *devm_gpiod_get_index(struct device *dev, | ||
48 | const char *con_id, | ||
49 | unsigned int idx) | ||
50 | |||
51 | A GPIO descriptor can be disposed of using the gpiod_put() function: | ||
52 | |||
53 | void gpiod_put(struct gpio_desc *desc) | ||
54 | |||
55 | It is strictly forbidden to use a descriptor after calling this function. The | ||
56 | device-managed variant is, unsurprisingly: | ||
57 | |||
58 | void devm_gpiod_put(struct device *dev, struct gpio_desc *desc) | ||
59 | |||
60 | |||
61 | Using GPIOs | ||
62 | =========== | ||
63 | |||
64 | Setting Direction | ||
65 | ----------------- | ||
66 | The first thing a driver must do with a GPIO is setting its direction. This is | ||
67 | done by invoking one of the gpiod_direction_*() functions: | ||
68 | |||
69 | int gpiod_direction_input(struct gpio_desc *desc) | ||
70 | int gpiod_direction_output(struct gpio_desc *desc, int value) | ||
71 | |||
72 | The return value is zero for success, else a negative errno. It should be | ||
73 | checked, since the get/set calls don't return errors and since misconfiguration | ||
74 | is possible. You should normally issue these calls from a task context. However, | ||
75 | for spinlock-safe GPIOs it is OK to use them before tasking is enabled, as part | ||
76 | of early board setup. | ||
77 | |||
78 | For output GPIOs, the value provided becomes the initial output value. This | ||
79 | helps avoid signal glitching during system startup. | ||
80 | |||
81 | A driver can also query the current direction of a GPIO: | ||
82 | |||
83 | int gpiod_get_direction(const struct gpio_desc *desc) | ||
84 | |||
85 | This function will return either GPIOF_DIR_IN or GPIOF_DIR_OUT. | ||
86 | |||
87 | Be aware that there is no default direction for GPIOs. Therefore, **using a GPIO | ||
88 | without setting its direction first is illegal and will result in undefined | ||
89 | behavior!** | ||
90 | |||
91 | |||
92 | Spinlock-Safe GPIO Access | ||
93 | ------------------------- | ||
94 | Most GPIO controllers can be accessed with memory read/write instructions. Those | ||
95 | don't need to sleep, and can safely be done from inside hard (non-threaded) IRQ | ||
96 | handlers and similar contexts. | ||
97 | |||
98 | Use the following calls to access GPIOs from an atomic context: | ||
99 | |||
100 | int gpiod_get_value(const struct gpio_desc *desc); | ||
101 | void gpiod_set_value(struct gpio_desc *desc, int value); | ||
102 | |||
103 | The values are boolean, zero for low, nonzero for high. When reading the value | ||
104 | of an output pin, the value returned should be what's seen on the pin. That | ||
105 | won't always match the specified output value, because of issues including | ||
106 | open-drain signaling and output latencies. | ||
107 | |||
108 | The get/set calls do not return errors because "invalid GPIO" should have been | ||
109 | reported earlier from gpiod_direction_*(). However, note that not all platforms | ||
110 | can read the value of output pins; those that can't should always return zero. | ||
111 | Also, using these calls for GPIOs that can't safely be accessed without sleeping | ||
112 | (see below) is an error. | ||
113 | |||
114 | |||
115 | GPIO Access That May Sleep | ||
116 | -------------------------- | ||
117 | Some GPIO controllers must be accessed using message based buses like I2C or | ||
118 | SPI. Commands to read or write those GPIO values require waiting to get to the | ||
119 | head of a queue to transmit a command and get its response. This requires | ||
120 | sleeping, which can't be done from inside IRQ handlers. | ||
121 | |||
122 | Platforms that support this type of GPIO distinguish them from other GPIOs by | ||
123 | returning nonzero from this call: | ||
124 | |||
125 | int gpiod_cansleep(const struct gpio_desc *desc) | ||
126 | |||
127 | To access such GPIOs, a different set of accessors is defined: | ||
128 | |||
129 | int gpiod_get_value_cansleep(const struct gpio_desc *desc) | ||
130 | void gpiod_set_value_cansleep(struct gpio_desc *desc, int value) | ||
131 | |||
132 | Accessing such GPIOs requires a context which may sleep, for example a threaded | ||
133 | IRQ handler, and those accessors must be used instead of spinlock-safe | ||
134 | accessors without the cansleep() name suffix. | ||
135 | |||
136 | Other than the fact that these accessors might sleep, and will work on GPIOs | ||
137 | that can't be accessed from hardIRQ handlers, these calls act the same as the | ||
138 | spinlock-safe calls. | ||
139 | |||
140 | |||
141 | Active-low State and Raw GPIO Values | ||
142 | ------------------------------------ | ||
143 | Device drivers like to manage the logical state of a GPIO, i.e. the value their | ||
144 | device will actually receive, no matter what lies between it and the GPIO line. | ||
145 | In some cases, it might make sense to control the actual GPIO line value. The | ||
146 | following set of calls ignore the active-low property of a GPIO and work on the | ||
147 | raw line value: | ||
148 | |||
149 | int gpiod_get_raw_value(const struct gpio_desc *desc) | ||
150 | void gpiod_set_raw_value(struct gpio_desc *desc, int value) | ||
151 | int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc) | ||
152 | void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value) | ||
153 | |||
154 | The active-low state of a GPIO can also be queried using the following call: | ||
155 | |||
156 | int gpiod_is_active_low(const struct gpio_desc *desc) | ||
157 | |||
158 | Note that these functions should only be used with great moderation ; a driver | ||
159 | should not have to care about the physical line level. | ||
160 | |||
161 | GPIOs mapped to IRQs | ||
162 | -------------------- | ||
163 | GPIO lines can quite often be used as IRQs. You can get the IRQ number | ||
164 | corresponding to a given GPIO using the following call: | ||
165 | |||
166 | int gpiod_to_irq(const struct gpio_desc *desc) | ||
167 | |||
168 | It will return an IRQ number, or an negative errno code if the mapping can't be | ||
169 | done (most likely because that particular GPIO cannot be used as IRQ). It is an | ||
170 | unchecked error to use a GPIO that wasn't set up as an input using | ||
171 | gpiod_direction_input(), or to use an IRQ number that didn't originally come | ||
172 | from gpiod_to_irq(). gpiod_to_irq() is not allowed to sleep. | ||
173 | |||
174 | Non-error values returned from gpiod_to_irq() can be passed to request_irq() or | ||
175 | free_irq(). They will often be stored into IRQ resources for platform devices, | ||
176 | by the board-specific initialization code. Note that IRQ trigger options are | ||
177 | part of the IRQ interface, e.g. IRQF_TRIGGER_FALLING, as are system wakeup | ||
178 | capabilities. | ||
179 | |||
180 | |||
181 | Interacting With the Legacy GPIO Subsystem | ||
182 | ========================================== | ||
183 | Many kernel subsystems still handle GPIOs using the legacy integer-based | ||
184 | interface. Although it is strongly encouraged to upgrade them to the safer | ||
185 | descriptor-based API, the following two functions allow you to convert a GPIO | ||
186 | descriptor into the GPIO integer namespace and vice-versa: | ||
187 | |||
188 | int desc_to_gpio(const struct gpio_desc *desc) | ||
189 | struct gpio_desc *gpio_to_desc(unsigned gpio) | ||
190 | |||
191 | The GPIO number returned by desc_to_gpio() can be safely used as long as the | ||
192 | GPIO descriptor has not been freed. All the same, a GPIO number passed to | ||
193 | gpio_to_desc() must have been properly acquired, and usage of the returned GPIO | ||
194 | descriptor is only possible after the GPIO number has been released. | ||
195 | |||
196 | Freeing a GPIO obtained by one API with the other API is forbidden and an | ||
197 | unchecked error. | ||
diff --git a/Documentation/gpio/driver.txt b/Documentation/gpio/driver.txt new file mode 100644 index 000000000000..9da0bfa74781 --- /dev/null +++ b/Documentation/gpio/driver.txt | |||
@@ -0,0 +1,75 @@ | |||
1 | GPIO Descriptor Driver Interface | ||
2 | ================================ | ||
3 | |||
4 | This document serves as a guide for GPIO chip drivers writers. Note that it | ||
5 | describes the new descriptor-based interface. For a description of the | ||
6 | deprecated integer-based GPIO interface please refer to gpio-legacy.txt. | ||
7 | |||
8 | Each GPIO controller driver needs to include the following header, which defines | ||
9 | the structures used to define a GPIO driver: | ||
10 | |||
11 | #include <linux/gpio/driver.h> | ||
12 | |||
13 | |||
14 | Internal Representation of GPIOs | ||
15 | ================================ | ||
16 | |||
17 | Inside a GPIO driver, individual GPIOs are identified by their hardware number, | ||
18 | which is a unique number between 0 and n, n being the number of GPIOs managed by | ||
19 | the chip. This number is purely internal: the hardware number of a particular | ||
20 | GPIO descriptor is never made visible outside of the driver. | ||
21 | |||
22 | On top of this internal number, each GPIO also need to have a global number in | ||
23 | the integer GPIO namespace so that it can be used with the legacy GPIO | ||
24 | interface. Each chip must thus have a "base" number (which can be automatically | ||
25 | assigned), and for each GPIO the global number will be (base + hardware number). | ||
26 | Although the integer representation is considered deprecated, it still has many | ||
27 | users and thus needs to be maintained. | ||
28 | |||
29 | So for example one platform could use numbers 32-159 for GPIOs, with a | ||
30 | controller defining 128 GPIOs at a "base" of 32 ; while another platform uses | ||
31 | numbers 0..63 with one set of GPIO controllers, 64-79 with another type of GPIO | ||
32 | controller, and on one particular board 80-95 with an FPGA. The numbers need not | ||
33 | be contiguous; either of those platforms could also use numbers 2000-2063 to | ||
34 | identify GPIOs in a bank of I2C GPIO expanders. | ||
35 | |||
36 | |||
37 | Controller Drivers: gpio_chip | ||
38 | ============================= | ||
39 | |||
40 | In the gpiolib framework each GPIO controller is packaged as a "struct | ||
41 | gpio_chip" (see linux/gpio/driver.h for its complete definition) with members | ||
42 | common to each controller of that type: | ||
43 | |||
44 | - methods to establish GPIO direction | ||
45 | - methods used to access GPIO values | ||
46 | - method to return the IRQ number associated to a given GPIO | ||
47 | - flag saying whether calls to its methods may sleep | ||
48 | - optional debugfs dump method (showing extra state like pullup config) | ||
49 | - optional base number (will be automatically assigned if omitted) | ||
50 | - label for diagnostics and GPIOs mapping using platform data | ||
51 | |||
52 | The code implementing a gpio_chip should support multiple instances of the | ||
53 | controller, possibly using the driver model. That code will configure each | ||
54 | gpio_chip and issue gpiochip_add(). Removing a GPIO controller should be rare; | ||
55 | use gpiochip_remove() when it is unavoidable. | ||
56 | |||
57 | Most often a gpio_chip is part of an instance-specific structure with state not | ||
58 | exposed by the GPIO interfaces, such as addressing, power management, and more. | ||
59 | Chips such as codecs will have complex non-GPIO state. | ||
60 | |||
61 | Any debugfs dump method should normally ignore signals which haven't been | ||
62 | requested as GPIOs. They can use gpiochip_is_requested(), which returns either | ||
63 | NULL or the label associated with that GPIO when it was requested. | ||
64 | |||
65 | Locking IRQ usage | ||
66 | ----------------- | ||
67 | Input GPIOs can be used as IRQ signals. When this happens, a driver is requested | ||
68 | to mark the GPIO as being used as an IRQ: | ||
69 | |||
70 | int gpiod_lock_as_irq(struct gpio_desc *desc) | ||
71 | |||
72 | This will prevent the use of non-irq related GPIO APIs until the GPIO IRQ lock | ||
73 | is released: | ||
74 | |||
75 | void gpiod_unlock_as_irq(struct gpio_desc *desc) | ||
diff --git a/Documentation/gpio.txt b/Documentation/gpio/gpio-legacy.txt index 6f83fa965b4b..6f83fa965b4b 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio/gpio-legacy.txt | |||
diff --git a/Documentation/gpio/gpio.txt b/Documentation/gpio/gpio.txt new file mode 100644 index 000000000000..cd9b356e88cd --- /dev/null +++ b/Documentation/gpio/gpio.txt | |||
@@ -0,0 +1,119 @@ | |||
1 | GPIO Interfaces | ||
2 | =============== | ||
3 | |||
4 | The documents in this directory give detailed instructions on how to access | ||
5 | GPIOs in drivers, and how to write a driver for a device that provides GPIOs | ||
6 | itself. | ||
7 | |||
8 | Due to the history of GPIO interfaces in the kernel, there are two different | ||
9 | ways to obtain and use GPIOs: | ||
10 | |||
11 | - The descriptor-based interface is the preferred way to manipulate GPIOs, | ||
12 | and is described by all the files in this directory excepted gpio-legacy.txt. | ||
13 | - The legacy integer-based interface which is considered deprecated (but still | ||
14 | usable for compatibility reasons) is documented in gpio-legacy.txt. | ||
15 | |||
16 | The remainder of this document applies to the new descriptor-based interface. | ||
17 | gpio-legacy.txt contains the same information applied to the legacy | ||
18 | integer-based interface. | ||
19 | |||
20 | |||
21 | What is a GPIO? | ||
22 | =============== | ||
23 | |||
24 | A "General Purpose Input/Output" (GPIO) is a flexible software-controlled | ||
25 | digital signal. They are provided from many kinds of chip, and are familiar | ||
26 | to Linux developers working with embedded and custom hardware. Each GPIO | ||
27 | represents a bit connected to a particular pin, or "ball" on Ball Grid Array | ||
28 | (BGA) packages. Board schematics show which external hardware connects to | ||
29 | which GPIOs. Drivers can be written generically, so that board setup code | ||
30 | passes such pin configuration data to drivers. | ||
31 | |||
32 | System-on-Chip (SOC) processors heavily rely on GPIOs. In some cases, every | ||
33 | non-dedicated pin can be configured as a GPIO; and most chips have at least | ||
34 | several dozen of them. Programmable logic devices (like FPGAs) can easily | ||
35 | provide GPIOs; multifunction chips like power managers, and audio codecs | ||
36 | often have a few such pins to help with pin scarcity on SOCs; and there are | ||
37 | also "GPIO Expander" chips that connect using the I2C or SPI serial buses. | ||
38 | Most PC southbridges have a few dozen GPIO-capable pins (with only the BIOS | ||
39 | firmware knowing how they're used). | ||
40 | |||
41 | The exact capabilities of GPIOs vary between systems. Common options: | ||
42 | |||
43 | - Output values are writable (high=1, low=0). Some chips also have | ||
44 | options about how that value is driven, so that for example only one | ||
45 | value might be driven, supporting "wire-OR" and similar schemes for the | ||
46 | other value (notably, "open drain" signaling). | ||
47 | |||
48 | - Input values are likewise readable (1, 0). Some chips support readback | ||
49 | of pins configured as "output", which is very useful in such "wire-OR" | ||
50 | cases (to support bidirectional signaling). GPIO controllers may have | ||
51 | input de-glitch/debounce logic, sometimes with software controls. | ||
52 | |||
53 | - Inputs can often be used as IRQ signals, often edge triggered but | ||
54 | sometimes level triggered. Such IRQs may be configurable as system | ||
55 | wakeup events, to wake the system from a low power state. | ||
56 | |||
57 | - Usually a GPIO will be configurable as either input or output, as needed | ||
58 | by different product boards; single direction ones exist too. | ||
59 | |||
60 | - Most GPIOs can be accessed while holding spinlocks, but those accessed | ||
61 | through a serial bus normally can't. Some systems support both types. | ||
62 | |||
63 | On a given board each GPIO is used for one specific purpose like monitoring | ||
64 | MMC/SD card insertion/removal, detecting card write-protect status, driving | ||
65 | a LED, configuring a transceiver, bit-banging a serial bus, poking a hardware | ||
66 | watchdog, sensing a switch, and so on. | ||
67 | |||
68 | |||
69 | Common GPIO Properties | ||
70 | ====================== | ||
71 | |||
72 | These properties are met through all the other documents of the GPIO interface | ||
73 | and it is useful to understand them, especially if you need to define GPIO | ||
74 | mappings. | ||
75 | |||
76 | Active-High and Active-Low | ||
77 | -------------------------- | ||
78 | It is natural to assume that a GPIO is "active" when its output signal is 1 | ||
79 | ("high"), and inactive when it is 0 ("low"). However in practice the signal of a | ||
80 | GPIO may be inverted before is reaches its destination, or a device could decide | ||
81 | to have different conventions about what "active" means. Such decisions should | ||
82 | be transparent to device drivers, therefore it is possible to define a GPIO as | ||
83 | being either active-high ("1" means "active", the default) or active-low ("0" | ||
84 | means "active") so that drivers only need to worry about the logical signal and | ||
85 | not about what happens at the line level. | ||
86 | |||
87 | Open Drain and Open Source | ||
88 | -------------------------- | ||
89 | Sometimes shared signals need to use "open drain" (where only the low signal | ||
90 | level is actually driven), or "open source" (where only the high signal level is | ||
91 | driven) signaling. That term applies to CMOS transistors; "open collector" is | ||
92 | used for TTL. A pullup or pulldown resistor causes the high or low signal level. | ||
93 | This is sometimes called a "wire-AND"; or more practically, from the negative | ||
94 | logic (low=true) perspective this is a "wire-OR". | ||
95 | |||
96 | One common example of an open drain signal is a shared active-low IRQ line. | ||
97 | Also, bidirectional data bus signals sometimes use open drain signals. | ||
98 | |||
99 | Some GPIO controllers directly support open drain and open source outputs; many | ||
100 | don't. When you need open drain signaling but your hardware doesn't directly | ||
101 | support it, there's a common idiom you can use to emulate it with any GPIO pin | ||
102 | that can be used as either an input or an output: | ||
103 | |||
104 | LOW: gpiod_direction_output(gpio, 0) ... this drives the signal and overrides | ||
105 | the pullup. | ||
106 | |||
107 | HIGH: gpiod_direction_input(gpio) ... this turns off the output, so the pullup | ||
108 | (or some other device) controls the signal. | ||
109 | |||
110 | The same logic can be applied to emulate open source signaling, by driving the | ||
111 | high signal and configuring the GPIO as input for low. This open drain/open | ||
112 | source emulation can be handled transparently by the GPIO framework. | ||
113 | |||
114 | If you are "driving" the signal high but gpiod_get_value(gpio) reports a low | ||
115 | value (after the appropriate rise time passes), you know some other component is | ||
116 | driving the shared signal low. That's not necessarily an error. As one common | ||
117 | example, that's how I2C clocks are stretched: a slave that needs a slower clock | ||
118 | delays the rising edge of SCK, and the I2C master adjusts its signaling rate | ||
119 | accordingly. | ||
diff --git a/Documentation/gpio/sysfs.txt b/Documentation/gpio/sysfs.txt new file mode 100644 index 000000000000..c2c3a97f8ff7 --- /dev/null +++ b/Documentation/gpio/sysfs.txt | |||
@@ -0,0 +1,155 @@ | |||
1 | GPIO Sysfs Interface for Userspace | ||
2 | ================================== | ||
3 | |||
4 | Platforms which use the "gpiolib" implementors framework may choose to | ||
5 | configure a sysfs user interface to GPIOs. This is different from the | ||
6 | debugfs interface, since it provides control over GPIO direction and | ||
7 | value instead of just showing a gpio state summary. Plus, it could be | ||
8 | present on production systems without debugging support. | ||
9 | |||
10 | Given appropriate hardware documentation for the system, userspace could | ||
11 | know for example that GPIO #23 controls the write protect line used to | ||
12 | protect boot loader segments in flash memory. System upgrade procedures | ||
13 | may need to temporarily remove that protection, first importing a GPIO, | ||
14 | then changing its output state, then updating the code before re-enabling | ||
15 | the write protection. In normal use, GPIO #23 would never be touched, | ||
16 | and the kernel would have no need to know about it. | ||
17 | |||
18 | Again depending on appropriate hardware documentation, on some systems | ||
19 | userspace GPIO can be used to determine system configuration data that | ||
20 | standard kernels won't know about. And for some tasks, simple userspace | ||
21 | GPIO drivers could be all that the system really needs. | ||
22 | |||
23 | Note that standard kernel drivers exist for common "LEDs and Buttons" | ||
24 | GPIO tasks: "leds-gpio" and "gpio_keys", respectively. Use those | ||
25 | instead of talking directly to the GPIOs; they integrate with kernel | ||
26 | frameworks better than your userspace code could. | ||
27 | |||
28 | |||
29 | Paths in Sysfs | ||
30 | -------------- | ||
31 | There are three kinds of entry in /sys/class/gpio: | ||
32 | |||
33 | - Control interfaces used to get userspace control over GPIOs; | ||
34 | |||
35 | - GPIOs themselves; and | ||
36 | |||
37 | - GPIO controllers ("gpio_chip" instances). | ||
38 | |||
39 | That's in addition to standard files including the "device" symlink. | ||
40 | |||
41 | The control interfaces are write-only: | ||
42 | |||
43 | /sys/class/gpio/ | ||
44 | |||
45 | "export" ... Userspace may ask the kernel to export control of | ||
46 | a GPIO to userspace by writing its number to this file. | ||
47 | |||
48 | Example: "echo 19 > export" will create a "gpio19" node | ||
49 | for GPIO #19, if that's not requested by kernel code. | ||
50 | |||
51 | "unexport" ... Reverses the effect of exporting to userspace. | ||
52 | |||
53 | Example: "echo 19 > unexport" will remove a "gpio19" | ||
54 | node exported using the "export" file. | ||
55 | |||
56 | GPIO signals have paths like /sys/class/gpio/gpio42/ (for GPIO #42) | ||
57 | and have the following read/write attributes: | ||
58 | |||
59 | /sys/class/gpio/gpioN/ | ||
60 | |||
61 | "direction" ... reads as either "in" or "out". This value may | ||
62 | normally be written. Writing as "out" defaults to | ||
63 | initializing the value as low. To ensure glitch free | ||
64 | operation, values "low" and "high" may be written to | ||
65 | configure the GPIO as an output with that initial value. | ||
66 | |||
67 | Note that this attribute *will not exist* if the kernel | ||
68 | doesn't support changing the direction of a GPIO, or | ||
69 | it was exported by kernel code that didn't explicitly | ||
70 | allow userspace to reconfigure this GPIO's direction. | ||
71 | |||
72 | "value" ... reads as either 0 (low) or 1 (high). If the GPIO | ||
73 | is configured as an output, this value may be written; | ||
74 | any nonzero value is treated as high. | ||
75 | |||
76 | If the pin can be configured as interrupt-generating interrupt | ||
77 | and if it has been configured to generate interrupts (see the | ||
78 | description of "edge"), you can poll(2) on that file and | ||
79 | poll(2) will return whenever the interrupt was triggered. If | ||
80 | you use poll(2), set the events POLLPRI and POLLERR. If you | ||
81 | use select(2), set the file descriptor in exceptfds. After | ||
82 | poll(2) returns, either lseek(2) to the beginning of the sysfs | ||
83 | file and read the new value or close the file and re-open it | ||
84 | to read the value. | ||
85 | |||
86 | "edge" ... reads as either "none", "rising", "falling", or | ||
87 | "both". Write these strings to select the signal edge(s) | ||
88 | that will make poll(2) on the "value" file return. | ||
89 | |||
90 | This file exists only if the pin can be configured as an | ||
91 | interrupt generating input pin. | ||
92 | |||
93 | "active_low" ... reads as either 0 (false) or 1 (true). Write | ||
94 | any nonzero value to invert the value attribute both | ||
95 | for reading and writing. Existing and subsequent | ||
96 | poll(2) support configuration via the edge attribute | ||
97 | for "rising" and "falling" edges will follow this | ||
98 | setting. | ||
99 | |||
100 | GPIO controllers have paths like /sys/class/gpio/gpiochip42/ (for the | ||
101 | controller implementing GPIOs starting at #42) and have the following | ||
102 | read-only attributes: | ||
103 | |||
104 | /sys/class/gpio/gpiochipN/ | ||
105 | |||
106 | "base" ... same as N, the first GPIO managed by this chip | ||
107 | |||
108 | "label" ... provided for diagnostics (not always unique) | ||
109 | |||
110 | "ngpio" ... how many GPIOs this manges (N to N + ngpio - 1) | ||
111 | |||
112 | Board documentation should in most cases cover what GPIOs are used for | ||
113 | what purposes. However, those numbers are not always stable; GPIOs on | ||
114 | a daughtercard might be different depending on the base board being used, | ||
115 | or other cards in the stack. In such cases, you may need to use the | ||
116 | gpiochip nodes (possibly in conjunction with schematics) to determine | ||
117 | the correct GPIO number to use for a given signal. | ||
118 | |||
119 | |||
120 | Exporting from Kernel code | ||
121 | -------------------------- | ||
122 | Kernel code can explicitly manage exports of GPIOs which have already been | ||
123 | requested using gpio_request(): | ||
124 | |||
125 | /* export the GPIO to userspace */ | ||
126 | int gpiod_export(struct gpio_desc *desc, bool direction_may_change); | ||
127 | |||
128 | /* reverse gpio_export() */ | ||
129 | void gpiod_unexport(struct gpio_desc *desc); | ||
130 | |||
131 | /* create a sysfs link to an exported GPIO node */ | ||
132 | int gpiod_export_link(struct device *dev, const char *name, | ||
133 | struct gpio_desc *desc); | ||
134 | |||
135 | /* change the polarity of a GPIO node in sysfs */ | ||
136 | int gpiod_sysfs_set_active_low(struct gpio_desc *desc, int value); | ||
137 | |||
138 | After a kernel driver requests a GPIO, it may only be made available in | ||
139 | the sysfs interface by gpiod_export(). The driver can control whether the | ||
140 | signal direction may change. This helps drivers prevent userspace code | ||
141 | from accidentally clobbering important system state. | ||
142 | |||
143 | This explicit exporting can help with debugging (by making some kinds | ||
144 | of experiments easier), or can provide an always-there interface that's | ||
145 | suitable for documenting as part of a board support package. | ||
146 | |||
147 | After the GPIO has been exported, gpiod_export_link() allows creating | ||
148 | symlinks from elsewhere in sysfs to the GPIO sysfs node. Drivers can | ||
149 | use this to provide the interface under their own device in sysfs with | ||
150 | a descriptive name. | ||
151 | |||
152 | Drivers can use gpiod_sysfs_set_active_low() to hide GPIO line polarity | ||
153 | differences between boards from user space. Polarity change can be done both | ||
154 | before and after gpiod_export(), and previously enabled poll(2) support for | ||
155 | either rising or falling edge will be reconfigured to follow this setting. | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 8285ed4676b6..13c15c83a46e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1934,7 +1934,8 @@ S: Maintained | |||
1934 | F: drivers/gpio/gpio-bt8xx.c | 1934 | F: drivers/gpio/gpio-bt8xx.c |
1935 | 1935 | ||
1936 | BTRFS FILE SYSTEM | 1936 | BTRFS FILE SYSTEM |
1937 | M: Chris Mason <chris.mason@fusionio.com> | 1937 | M: Chris Mason <clm@fb.com> |
1938 | M: Josef Bacik <jbacik@fb.com> | ||
1938 | L: linux-btrfs@vger.kernel.org | 1939 | L: linux-btrfs@vger.kernel.org |
1939 | W: http://btrfs.wiki.kernel.org/ | 1940 | W: http://btrfs.wiki.kernel.org/ |
1940 | Q: http://patchwork.kernel.org/project/linux-btrfs/list/ | 1941 | Q: http://patchwork.kernel.org/project/linux-btrfs/list/ |
@@ -2142,6 +2143,11 @@ L: linux-usb@vger.kernel.org | |||
2142 | S: Maintained | 2143 | S: Maintained |
2143 | F: drivers/usb/chipidea/ | 2144 | F: drivers/usb/chipidea/ |
2144 | 2145 | ||
2146 | CHROME HARDWARE PLATFORM SUPPORT | ||
2147 | M: Olof Johansson <olof@lixom.net> | ||
2148 | S: Maintained | ||
2149 | F: drivers/platform/chrome/ | ||
2150 | |||
2145 | CISCO VIC ETHERNET NIC DRIVER | 2151 | CISCO VIC ETHERNET NIC DRIVER |
2146 | M: Christian Benvenuti <benve@cisco.com> | 2152 | M: Christian Benvenuti <benve@cisco.com> |
2147 | M: Sujith Sankar <ssujith@cisco.com> | 2153 | M: Sujith Sankar <ssujith@cisco.com> |
@@ -4044,6 +4050,12 @@ W: http://www.pharscape.org | |||
4044 | S: Maintained | 4050 | S: Maintained |
4045 | F: drivers/net/usb/hso.c | 4051 | F: drivers/net/usb/hso.c |
4046 | 4052 | ||
4053 | HSR NETWORK PROTOCOL | ||
4054 | M: Arvid Brodin <arvid.brodin@alten.se> | ||
4055 | L: netdev@vger.kernel.org | ||
4056 | S: Maintained | ||
4057 | F: net/hsr/ | ||
4058 | |||
4047 | HTCPEN TOUCHSCREEN DRIVER | 4059 | HTCPEN TOUCHSCREEN DRIVER |
4048 | M: Pau Oliva Fora <pof@eslack.org> | 4060 | M: Pau Oliva Fora <pof@eslack.org> |
4049 | L: linux-input@vger.kernel.org | 4061 | L: linux-input@vger.kernel.org |
@@ -5256,7 +5268,7 @@ S: Maintained | |||
5256 | F: Documentation/lockdep*.txt | 5268 | F: Documentation/lockdep*.txt |
5257 | F: Documentation/lockstat.txt | 5269 | F: Documentation/lockstat.txt |
5258 | F: include/linux/lockdep.h | 5270 | F: include/linux/lockdep.h |
5259 | F: kernel/lockdep* | 5271 | F: kernel/locking/ |
5260 | 5272 | ||
5261 | LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks) | 5273 | LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks) |
5262 | M: "Richard Russon (FlatCap)" <ldm@flatcap.org> | 5274 | M: "Richard Russon (FlatCap)" <ldm@flatcap.org> |
@@ -5968,10 +5980,10 @@ F: drivers/nfc/ | |||
5968 | F: include/linux/platform_data/pn544.h | 5980 | F: include/linux/platform_data/pn544.h |
5969 | 5981 | ||
5970 | NFS, SUNRPC, AND LOCKD CLIENTS | 5982 | NFS, SUNRPC, AND LOCKD CLIENTS |
5971 | M: Trond Myklebust <Trond.Myklebust@netapp.com> | 5983 | M: Trond Myklebust <trond.myklebust@primarydata.com> |
5972 | L: linux-nfs@vger.kernel.org | 5984 | L: linux-nfs@vger.kernel.org |
5973 | W: http://client.linux-nfs.org | 5985 | W: http://client.linux-nfs.org |
5974 | T: git git://git.linux-nfs.org/pub/linux/nfs-2.6.git | 5986 | T: git git://git.linux-nfs.org/projects/trondmy/linux-nfs.git |
5975 | S: Maintained | 5987 | S: Maintained |
5976 | F: fs/lockd/ | 5988 | F: fs/lockd/ |
5977 | F: fs/nfs/ | 5989 | F: fs/nfs/ |
@@ -6238,8 +6250,8 @@ OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS | |||
6238 | M: Rob Herring <rob.herring@calxeda.com> | 6250 | M: Rob Herring <rob.herring@calxeda.com> |
6239 | M: Pawel Moll <pawel.moll@arm.com> | 6251 | M: Pawel Moll <pawel.moll@arm.com> |
6240 | M: Mark Rutland <mark.rutland@arm.com> | 6252 | M: Mark Rutland <mark.rutland@arm.com> |
6241 | M: Stephen Warren <swarren@wwwdotorg.org> | ||
6242 | M: Ian Campbell <ijc+devicetree@hellion.org.uk> | 6253 | M: Ian Campbell <ijc+devicetree@hellion.org.uk> |
6254 | M: Kumar Gala <galak@codeaurora.org> | ||
6243 | L: devicetree@vger.kernel.org | 6255 | L: devicetree@vger.kernel.org |
6244 | S: Maintained | 6256 | S: Maintained |
6245 | F: Documentation/devicetree/ | 6257 | F: Documentation/devicetree/ |
@@ -7380,7 +7392,6 @@ S: Maintained | |||
7380 | F: kernel/sched/ | 7392 | F: kernel/sched/ |
7381 | F: include/linux/sched.h | 7393 | F: include/linux/sched.h |
7382 | F: include/uapi/linux/sched.h | 7394 | F: include/uapi/linux/sched.h |
7383 | F: kernel/wait.c | ||
7384 | F: include/linux/wait.h | 7395 | F: include/linux/wait.h |
7385 | 7396 | ||
7386 | SCORE ARCHITECTURE | 7397 | SCORE ARCHITECTURE |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 3 | 1 | VERSION = 3 |
2 | PATCHLEVEL = 13 | 2 | PATCHLEVEL = 13 |
3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
4 | EXTRAVERSION = -rc1 | 4 | EXTRAVERSION = -rc3 |
5 | NAME = One Giant Leap for Frogkind | 5 | NAME = One Giant Leap for Frogkind |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index d57c1a65b24f..fc37bca0ccd3 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
@@ -173,12 +173,17 @@ dtb-$(CONFIG_ARCH_NSPIRE) += nspire-cx.dtb \ | |||
173 | nspire-tp.dtb \ | 173 | nspire-tp.dtb \ |
174 | nspire-clp.dtb | 174 | nspire-clp.dtb |
175 | dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ | 175 | dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ |
176 | omap2430-sdp.dtb \ | ||
177 | omap2420-n800.dtb \ | ||
178 | omap2420-n810.dtb \ | ||
179 | omap2420-n810-wimax.dtb \ | ||
176 | omap3430-sdp.dtb \ | 180 | omap3430-sdp.dtb \ |
177 | omap3-beagle.dtb \ | 181 | omap3-beagle.dtb \ |
178 | omap3-devkit8000.dtb \ | 182 | omap3-devkit8000.dtb \ |
179 | omap3-beagle-xm.dtb \ | 183 | omap3-beagle-xm.dtb \ |
180 | omap3-evm.dtb \ | 184 | omap3-evm.dtb \ |
181 | omap3-evm-37xx.dtb \ | 185 | omap3-evm-37xx.dtb \ |
186 | omap3-ldp.dtb \ | ||
182 | omap3-n900.dtb \ | 187 | omap3-n900.dtb \ |
183 | omap3-n9.dtb \ | 188 | omap3-n9.dtb \ |
184 | omap3-n950.dtb \ | 189 | omap3-n950.dtb \ |
diff --git a/arch/arm/boot/dts/am335x-base0033.dts b/arch/arm/boot/dts/am335x-base0033.dts index b4f95c2bbf74..72a9b3fc4251 100644 --- a/arch/arm/boot/dts/am335x-base0033.dts +++ b/arch/arm/boot/dts/am335x-base0033.dts | |||
@@ -13,4 +13,83 @@ | |||
13 | / { | 13 | / { |
14 | model = "IGEP COM AM335x on AQUILA Expansion"; | 14 | model = "IGEP COM AM335x on AQUILA Expansion"; |
15 | compatible = "isee,am335x-base0033", "isee,am335x-igep0033", "ti,am33xx"; | 15 | compatible = "isee,am335x-base0033", "isee,am335x-igep0033", "ti,am33xx"; |
16 | |||
17 | hdmi { | ||
18 | compatible = "ti,tilcdc,slave"; | ||
19 | i2c = <&i2c0>; | ||
20 | pinctrl-names = "default", "off"; | ||
21 | pinctrl-0 = <&nxp_hdmi_pins>; | ||
22 | pinctrl-1 = <&nxp_hdmi_off_pins>; | ||
23 | status = "okay"; | ||
24 | }; | ||
25 | |||
26 | leds_base { | ||
27 | pinctrl-names = "default"; | ||
28 | pinctrl-0 = <&leds_base_pins>; | ||
29 | |||
30 | compatible = "gpio-leds"; | ||
31 | |||
32 | led@0 { | ||
33 | label = "base:red:user"; | ||
34 | gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>; /* gpio1_21 */ | ||
35 | default-state = "off"; | ||
36 | }; | ||
37 | |||
38 | led@1 { | ||
39 | label = "base:green:user"; | ||
40 | gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>; /* gpio2_0 */ | ||
41 | default-state = "off"; | ||
42 | }; | ||
43 | }; | ||
44 | }; | ||
45 | |||
46 | &am33xx_pinmux { | ||
47 | nxp_hdmi_pins: pinmux_nxp_hdmi_pins { | ||
48 | pinctrl-single,pins = < | ||
49 | 0x1b0 (PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */ | ||
50 | 0xa0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data0 */ | ||
51 | 0xa4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data1 */ | ||
52 | 0xa8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data2 */ | ||
53 | 0xac (PIN_OUTPUT | MUX_MODE0) /* lcd_data3 */ | ||
54 | 0xb0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data4 */ | ||
55 | 0xb4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data5 */ | ||
56 | 0xb8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data6 */ | ||
57 | 0xbc (PIN_OUTPUT | MUX_MODE0) /* lcd_data7 */ | ||
58 | 0xc0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data8 */ | ||
59 | 0xc4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data9 */ | ||
60 | 0xc8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data10 */ | ||
61 | 0xcc (PIN_OUTPUT | MUX_MODE0) /* lcd_data11 */ | ||
62 | 0xd0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data12 */ | ||
63 | 0xd4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data13 */ | ||
64 | 0xd8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data14 */ | ||
65 | 0xdc (PIN_OUTPUT | MUX_MODE0) /* lcd_data15 */ | ||
66 | 0xe0 (PIN_OUTPUT | MUX_MODE0) /* lcd_vsync */ | ||
67 | 0xe4 (PIN_OUTPUT | MUX_MODE0) /* lcd_hsync */ | ||
68 | 0xe8 (PIN_OUTPUT | MUX_MODE0) /* lcd_pclk */ | ||
69 | 0xec (PIN_OUTPUT | MUX_MODE0) /* lcd_ac_bias_en */ | ||
70 | >; | ||
71 | }; | ||
72 | nxp_hdmi_off_pins: pinmux_nxp_hdmi_off_pins { | ||
73 | pinctrl-single,pins = < | ||
74 | 0x1b0 (PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */ | ||
75 | >; | ||
76 | }; | ||
77 | |||
78 | leds_base_pins: pinmux_leds_base_pins { | ||
79 | pinctrl-single,pins = < | ||
80 | 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */ | ||
81 | 0x88 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn3.gpio2_0 */ | ||
82 | >; | ||
83 | }; | ||
84 | }; | ||
85 | |||
86 | &lcdc { | ||
87 | status = "okay"; | ||
88 | }; | ||
89 | |||
90 | &i2c0 { | ||
91 | eeprom: eeprom@50 { | ||
92 | compatible = "at,24c256"; | ||
93 | reg = <0x50>; | ||
94 | }; | ||
16 | }; | 95 | }; |
diff --git a/arch/arm/boot/dts/am335x-igep0033.dtsi b/arch/arm/boot/dts/am335x-igep0033.dtsi index 619624479311..7063311a58d9 100644 --- a/arch/arm/boot/dts/am335x-igep0033.dtsi +++ b/arch/arm/boot/dts/am335x-igep0033.dtsi | |||
@@ -199,6 +199,35 @@ | |||
199 | pinctrl-0 = <&uart0_pins>; | 199 | pinctrl-0 = <&uart0_pins>; |
200 | }; | 200 | }; |
201 | 201 | ||
202 | &usb { | ||
203 | status = "okay"; | ||
204 | |||
205 | control@44e10000 { | ||
206 | status = "okay"; | ||
207 | }; | ||
208 | |||
209 | usb-phy@47401300 { | ||
210 | status = "okay"; | ||
211 | }; | ||
212 | |||
213 | usb-phy@47401b00 { | ||
214 | status = "okay"; | ||
215 | }; | ||
216 | |||
217 | usb@47401000 { | ||
218 | status = "okay"; | ||
219 | }; | ||
220 | |||
221 | usb@47401800 { | ||
222 | status = "okay"; | ||
223 | dr_mode = "host"; | ||
224 | }; | ||
225 | |||
226 | dma-controller@07402000 { | ||
227 | status = "okay"; | ||
228 | }; | ||
229 | }; | ||
230 | |||
202 | #include "tps65910.dtsi" | 231 | #include "tps65910.dtsi" |
203 | 232 | ||
204 | &tps { | 233 | &tps { |
diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts index e99dfaf70052..b4127c6493a2 100644 --- a/arch/arm/boot/dts/am3517-evm.dts +++ b/arch/arm/boot/dts/am3517-evm.dts | |||
@@ -7,16 +7,31 @@ | |||
7 | */ | 7 | */ |
8 | /dts-v1/; | 8 | /dts-v1/; |
9 | 9 | ||
10 | #include "omap34xx.dtsi" | 10 | #include "am3517.dtsi" |
11 | 11 | ||
12 | / { | 12 | / { |
13 | model = "TI AM3517 EVM (AM3517/05)"; | 13 | model = "TI AM3517 EVM (AM3517/05 TMDSEVM3517)"; |
14 | compatible = "ti,am3517-evm", "ti,omap3"; | 14 | compatible = "ti,am3517-evm", "ti,am3517", "ti,omap3"; |
15 | 15 | ||
16 | memory { | 16 | memory { |
17 | device_type = "memory"; | 17 | device_type = "memory"; |
18 | reg = <0x80000000 0x10000000>; /* 256 MB */ | 18 | reg = <0x80000000 0x10000000>; /* 256 MB */ |
19 | }; | 19 | }; |
20 | |||
21 | vmmc_fixed: vmmc { | ||
22 | compatible = "regulator-fixed"; | ||
23 | regulator-name = "vmmc_fixed"; | ||
24 | regulator-min-microvolt = <3300000>; | ||
25 | regulator-max-microvolt = <3300000>; | ||
26 | }; | ||
27 | }; | ||
28 | |||
29 | &davinci_emac { | ||
30 | status = "okay"; | ||
31 | }; | ||
32 | |||
33 | &davinci_mdio { | ||
34 | status = "okay"; | ||
20 | }; | 35 | }; |
21 | 36 | ||
22 | &i2c1 { | 37 | &i2c1 { |
@@ -30,3 +45,17 @@ | |||
30 | &i2c3 { | 45 | &i2c3 { |
31 | clock-frequency = <400000>; | 46 | clock-frequency = <400000>; |
32 | }; | 47 | }; |
48 | |||
49 | &mmc1 { | ||
50 | vmmc-supply = <&vmmc_fixed>; | ||
51 | bus-width = <4>; | ||
52 | }; | ||
53 | |||
54 | &mmc2 { | ||
55 | status = "disabled"; | ||
56 | }; | ||
57 | |||
58 | &mmc3 { | ||
59 | status = "disabled"; | ||
60 | }; | ||
61 | |||
diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi new file mode 100644 index 000000000000..2fbe02faa8b1 --- /dev/null +++ b/arch/arm/boot/dts/am3517.dtsi | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * Device Tree Source for am3517 SoC | ||
3 | * | ||
4 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public License | ||
7 | * version 2. This program is licensed "as is" without any warranty of any | ||
8 | * kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include "omap3.dtsi" | ||
12 | |||
13 | / { | ||
14 | aliases { | ||
15 | serial3 = &uart4; | ||
16 | }; | ||
17 | |||
18 | ocp { | ||
19 | am35x_otg_hs: am35x_otg_hs@5c040000 { | ||
20 | compatible = "ti,omap3-musb"; | ||
21 | ti,hwmods = "am35x_otg_hs"; | ||
22 | status = "disabled"; | ||
23 | reg = <0x5c040000 0x1000>; | ||
24 | interrupts = <71>; | ||
25 | interrupt-names = "mc"; | ||
26 | }; | ||
27 | |||
28 | davinci_emac: ethernet@0x5c000000 { | ||
29 | compatible = "ti,am3517-emac"; | ||
30 | ti,hwmods = "davinci_emac"; | ||
31 | status = "disabled"; | ||
32 | reg = <0x5c000000 0x30000>; | ||
33 | interrupts = <67 68 69 70>; | ||
34 | ti,davinci-ctrl-reg-offset = <0x10000>; | ||
35 | ti,davinci-ctrl-mod-reg-offset = <0>; | ||
36 | ti,davinci-ctrl-ram-offset = <0x20000>; | ||
37 | ti,davinci-ctrl-ram-size = <0x2000>; | ||
38 | ti,davinci-rmii-en = /bits/ 8 <1>; | ||
39 | local-mac-address = [ 00 00 00 00 00 00 ]; | ||
40 | }; | ||
41 | |||
42 | davinci_mdio: ethernet@0x5c030000 { | ||
43 | compatible = "ti,davinci_mdio"; | ||
44 | ti,hwmods = "davinci_mdio"; | ||
45 | status = "disabled"; | ||
46 | reg = <0x5c030000 0x1000>; | ||
47 | bus_freq = <1000000>; | ||
48 | #address-cells = <1>; | ||
49 | #size-cells = <0>; | ||
50 | }; | ||
51 | |||
52 | uart4: serial@4809e000 { | ||
53 | compatible = "ti,omap3-uart"; | ||
54 | ti,hwmods = "uart4"; | ||
55 | status = "disabled"; | ||
56 | reg = <0x4809e000 0x400>; | ||
57 | interrupts = <84>; | ||
58 | dmas = <&sdma 55 &sdma 54>; | ||
59 | dma-names = "tx", "rx"; | ||
60 | clock-frequency = <48000000>; | ||
61 | }; | ||
62 | }; | ||
63 | }; | ||
diff --git a/arch/arm/boot/dts/armada-370-db.dts b/arch/arm/boot/dts/armada-370-db.dts index 90ce29dbe119..08a56bcfc724 100644 --- a/arch/arm/boot/dts/armada-370-db.dts +++ b/arch/arm/boot/dts/armada-370-db.dts | |||
@@ -99,22 +99,22 @@ | |||
99 | spi-max-frequency = <50000000>; | 99 | spi-max-frequency = <50000000>; |
100 | }; | 100 | }; |
101 | }; | 101 | }; |
102 | }; | ||
102 | 103 | ||
103 | pcie-controller { | 104 | pcie-controller { |
105 | status = "okay"; | ||
106 | /* | ||
107 | * The two PCIe units are accessible through | ||
108 | * both standard PCIe slots and mini-PCIe | ||
109 | * slots on the board. | ||
110 | */ | ||
111 | pcie@1,0 { | ||
112 | /* Port 0, Lane 0 */ | ||
113 | status = "okay"; | ||
114 | }; | ||
115 | pcie@2,0 { | ||
116 | /* Port 1, Lane 0 */ | ||
104 | status = "okay"; | 117 | status = "okay"; |
105 | /* | ||
106 | * The two PCIe units are accessible through | ||
107 | * both standard PCIe slots and mini-PCIe | ||
108 | * slots on the board. | ||
109 | */ | ||
110 | pcie@1,0 { | ||
111 | /* Port 0, Lane 0 */ | ||
112 | status = "okay"; | ||
113 | }; | ||
114 | pcie@2,0 { | ||
115 | /* Port 1, Lane 0 */ | ||
116 | status = "okay"; | ||
117 | }; | ||
118 | }; | 118 | }; |
119 | }; | 119 | }; |
120 | }; | 120 | }; |
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi index 00d6a798c705..7f10f627ae5b 100644 --- a/arch/arm/boot/dts/armada-370-xp.dtsi +++ b/arch/arm/boot/dts/armada-370-xp.dtsi | |||
@@ -118,7 +118,7 @@ | |||
118 | 118 | ||
119 | coherency-fabric@20200 { | 119 | coherency-fabric@20200 { |
120 | compatible = "marvell,coherency-fabric"; | 120 | compatible = "marvell,coherency-fabric"; |
121 | reg = <0x20200 0xb0>, <0x21810 0x1c>; | 121 | reg = <0x20200 0xb0>, <0x21010 0x1c>; |
122 | }; | 122 | }; |
123 | 123 | ||
124 | serial@12000 { | 124 | serial@12000 { |
diff --git a/arch/arm/boot/dts/armada-xp-mv78230.dtsi b/arch/arm/boot/dts/armada-xp-mv78230.dtsi index 3f5e6121c730..98335fb34b7a 100644 --- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi +++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi | |||
@@ -47,7 +47,7 @@ | |||
47 | /* | 47 | /* |
48 | * MV78230 has 2 PCIe units Gen2.0: One unit can be | 48 | * MV78230 has 2 PCIe units Gen2.0: One unit can be |
49 | * configured as x4 or quad x1 lanes. One unit is | 49 | * configured as x4 or quad x1 lanes. One unit is |
50 | * x4/x1. | 50 | * x1 only. |
51 | */ | 51 | */ |
52 | pcie-controller { | 52 | pcie-controller { |
53 | compatible = "marvell,armada-xp-pcie"; | 53 | compatible = "marvell,armada-xp-pcie"; |
@@ -62,10 +62,10 @@ | |||
62 | 62 | ||
63 | ranges = | 63 | ranges = |
64 | <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */ | 64 | <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */ |
65 | 0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000 /* Port 2.0 registers */ | ||
66 | 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 /* Port 0.1 registers */ | 65 | 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 /* Port 0.1 registers */ |
67 | 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */ | 66 | 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */ |
68 | 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */ | 67 | 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */ |
68 | 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 /* Port 1.0 registers */ | ||
69 | 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */ | 69 | 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */ |
70 | 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */ | 70 | 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */ |
71 | 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */ | 71 | 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */ |
@@ -74,8 +74,8 @@ | |||
74 | 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */ | 74 | 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */ |
75 | 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */ | 75 | 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */ |
76 | 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */ | 76 | 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */ |
77 | 0x82000000 0x9 0 MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */ | 77 | 0x82000000 0x5 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */ |
78 | 0x81000000 0x9 0 MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO */>; | 78 | 0x81000000 0x5 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */>; |
79 | 79 | ||
80 | pcie@1,0 { | 80 | pcie@1,0 { |
81 | device_type = "pci"; | 81 | device_type = "pci"; |
@@ -145,20 +145,20 @@ | |||
145 | status = "disabled"; | 145 | status = "disabled"; |
146 | }; | 146 | }; |
147 | 147 | ||
148 | pcie@9,0 { | 148 | pcie@5,0 { |
149 | device_type = "pci"; | 149 | device_type = "pci"; |
150 | assigned-addresses = <0x82000800 0 0x42000 0 0x2000>; | 150 | assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; |
151 | reg = <0x4800 0 0 0 0>; | 151 | reg = <0x2800 0 0 0 0>; |
152 | #address-cells = <3>; | 152 | #address-cells = <3>; |
153 | #size-cells = <2>; | 153 | #size-cells = <2>; |
154 | #interrupt-cells = <1>; | 154 | #interrupt-cells = <1>; |
155 | ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0 | 155 | ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0 |
156 | 0x81000000 0 0 0x81000000 0x9 0 1 0>; | 156 | 0x81000000 0 0 0x81000000 0x5 0 1 0>; |
157 | interrupt-map-mask = <0 0 0 0>; | 157 | interrupt-map-mask = <0 0 0 0>; |
158 | interrupt-map = <0 0 0 0 &mpic 99>; | 158 | interrupt-map = <0 0 0 0 &mpic 62>; |
159 | marvell,pcie-port = <2>; | 159 | marvell,pcie-port = <1>; |
160 | marvell,pcie-lane = <0>; | 160 | marvell,pcie-lane = <0>; |
161 | clocks = <&gateclk 26>; | 161 | clocks = <&gateclk 9>; |
162 | status = "disabled"; | 162 | status = "disabled"; |
163 | }; | 163 | }; |
164 | }; | 164 | }; |
diff --git a/arch/arm/boot/dts/armada-xp-mv78260.dtsi b/arch/arm/boot/dts/armada-xp-mv78260.dtsi index 3e9fd1353f89..66609684d41b 100644 --- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi +++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi | |||
@@ -48,7 +48,7 @@ | |||
48 | /* | 48 | /* |
49 | * MV78260 has 3 PCIe units Gen2.0: Two units can be | 49 | * MV78260 has 3 PCIe units Gen2.0: Two units can be |
50 | * configured as x4 or quad x1 lanes. One unit is | 50 | * configured as x4 or quad x1 lanes. One unit is |
51 | * x4/x1. | 51 | * x4 only. |
52 | */ | 52 | */ |
53 | pcie-controller { | 53 | pcie-controller { |
54 | compatible = "marvell,armada-xp-pcie"; | 54 | compatible = "marvell,armada-xp-pcie"; |
@@ -68,7 +68,9 @@ | |||
68 | 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */ | 68 | 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */ |
69 | 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */ | 69 | 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */ |
70 | 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 /* Port 1.0 registers */ | 70 | 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 /* Port 1.0 registers */ |
71 | 0x82000000 0 0x82000 MBUS_ID(0xf0, 0x01) 0x82000 0 0x00002000 /* Port 3.0 registers */ | 71 | 0x82000000 0 0x84000 MBUS_ID(0xf0, 0x01) 0x84000 0 0x00002000 /* Port 1.1 registers */ |
72 | 0x82000000 0 0x88000 MBUS_ID(0xf0, 0x01) 0x88000 0 0x00002000 /* Port 1.2 registers */ | ||
73 | 0x82000000 0 0x8c000 MBUS_ID(0xf0, 0x01) 0x8c000 0 0x00002000 /* Port 1.3 registers */ | ||
72 | 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */ | 74 | 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */ |
73 | 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */ | 75 | 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */ |
74 | 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */ | 76 | 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */ |
@@ -77,10 +79,18 @@ | |||
77 | 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */ | 79 | 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */ |
78 | 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */ | 80 | 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */ |
79 | 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */ | 81 | 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */ |
80 | 0x82000000 0x9 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */ | 82 | |
81 | 0x81000000 0x9 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */ | 83 | 0x82000000 0x5 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */ |
82 | 0x82000000 0xa 0 MBUS_ID(0x08, 0xf8) 0 1 0 /* Port 3.0 MEM */ | 84 | 0x81000000 0x5 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */ |
83 | 0x81000000 0xa 0 MBUS_ID(0x08, 0xf0) 0 1 0 /* Port 3.0 IO */>; | 85 | 0x82000000 0x6 0 MBUS_ID(0x08, 0xd8) 0 1 0 /* Port 1.1 MEM */ |
86 | 0x81000000 0x6 0 MBUS_ID(0x08, 0xd0) 0 1 0 /* Port 1.1 IO */ | ||
87 | 0x82000000 0x7 0 MBUS_ID(0x08, 0xb8) 0 1 0 /* Port 1.2 MEM */ | ||
88 | 0x81000000 0x7 0 MBUS_ID(0x08, 0xb0) 0 1 0 /* Port 1.2 IO */ | ||
89 | 0x82000000 0x8 0 MBUS_ID(0x08, 0x78) 0 1 0 /* Port 1.3 MEM */ | ||
90 | 0x81000000 0x8 0 MBUS_ID(0x08, 0x70) 0 1 0 /* Port 1.3 IO */ | ||
91 | |||
92 | 0x82000000 0x9 0 MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */ | ||
93 | 0x81000000 0x9 0 MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO */>; | ||
84 | 94 | ||
85 | pcie@1,0 { | 95 | pcie@1,0 { |
86 | device_type = "pci"; | 96 | device_type = "pci"; |
@@ -106,8 +116,8 @@ | |||
106 | #address-cells = <3>; | 116 | #address-cells = <3>; |
107 | #size-cells = <2>; | 117 | #size-cells = <2>; |
108 | #interrupt-cells = <1>; | 118 | #interrupt-cells = <1>; |
109 | ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 | 119 | ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 |
110 | 0x81000000 0 0 0x81000000 0x2 0 1 0>; | 120 | 0x81000000 0 0 0x81000000 0x2 0 1 0>; |
111 | interrupt-map-mask = <0 0 0 0>; | 121 | interrupt-map-mask = <0 0 0 0>; |
112 | interrupt-map = <0 0 0 0 &mpic 59>; | 122 | interrupt-map = <0 0 0 0 &mpic 59>; |
113 | marvell,pcie-port = <0>; | 123 | marvell,pcie-port = <0>; |
@@ -150,37 +160,88 @@ | |||
150 | status = "disabled"; | 160 | status = "disabled"; |
151 | }; | 161 | }; |
152 | 162 | ||
153 | pcie@9,0 { | 163 | pcie@5,0 { |
154 | device_type = "pci"; | 164 | device_type = "pci"; |
155 | assigned-addresses = <0x82000800 0 0x42000 0 0x2000>; | 165 | assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; |
156 | reg = <0x4800 0 0 0 0>; | 166 | reg = <0x2800 0 0 0 0>; |
157 | #address-cells = <3>; | 167 | #address-cells = <3>; |
158 | #size-cells = <2>; | 168 | #size-cells = <2>; |
159 | #interrupt-cells = <1>; | 169 | #interrupt-cells = <1>; |
160 | ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0 | 170 | ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0 |
161 | 0x81000000 0 0 0x81000000 0x9 0 1 0>; | 171 | 0x81000000 0 0 0x81000000 0x5 0 1 0>; |
162 | interrupt-map-mask = <0 0 0 0>; | 172 | interrupt-map-mask = <0 0 0 0>; |
163 | interrupt-map = <0 0 0 0 &mpic 99>; | 173 | interrupt-map = <0 0 0 0 &mpic 62>; |
164 | marvell,pcie-port = <2>; | 174 | marvell,pcie-port = <1>; |
165 | marvell,pcie-lane = <0>; | 175 | marvell,pcie-lane = <0>; |
166 | clocks = <&gateclk 26>; | 176 | clocks = <&gateclk 9>; |
167 | status = "disabled"; | 177 | status = "disabled"; |
168 | }; | 178 | }; |
169 | 179 | ||
170 | pcie@10,0 { | 180 | pcie@6,0 { |
171 | device_type = "pci"; | 181 | device_type = "pci"; |
172 | assigned-addresses = <0x82000800 0 0x82000 0 0x2000>; | 182 | assigned-addresses = <0x82000800 0 0x84000 0 0x2000>; |
173 | reg = <0x5000 0 0 0 0>; | 183 | reg = <0x3000 0 0 0 0>; |
174 | #address-cells = <3>; | 184 | #address-cells = <3>; |
175 | #size-cells = <2>; | 185 | #size-cells = <2>; |
176 | #interrupt-cells = <1>; | 186 | #interrupt-cells = <1>; |
177 | ranges = <0x82000000 0 0 0x82000000 0xa 0 1 0 | 187 | ranges = <0x82000000 0 0 0x82000000 0x6 0 1 0 |
178 | 0x81000000 0 0 0x81000000 0xa 0 1 0>; | 188 | 0x81000000 0 0 0x81000000 0x6 0 1 0>; |
179 | interrupt-map-mask = <0 0 0 0>; | 189 | interrupt-map-mask = <0 0 0 0>; |
180 | interrupt-map = <0 0 0 0 &mpic 103>; | 190 | interrupt-map = <0 0 0 0 &mpic 63>; |
181 | marvell,pcie-port = <3>; | 191 | marvell,pcie-port = <1>; |
192 | marvell,pcie-lane = <1>; | ||
193 | clocks = <&gateclk 10>; | ||
194 | status = "disabled"; | ||
195 | }; | ||
196 | |||
197 | pcie@7,0 { | ||
198 | device_type = "pci"; | ||
199 | assigned-addresses = <0x82000800 0 0x88000 0 0x2000>; | ||
200 | reg = <0x3800 0 0 0 0>; | ||
201 | #address-cells = <3>; | ||
202 | #size-cells = <2>; | ||
203 | #interrupt-cells = <1>; | ||
204 | ranges = <0x82000000 0 0 0x82000000 0x7 0 1 0 | ||
205 | 0x81000000 0 0 0x81000000 0x7 0 1 0>; | ||
206 | interrupt-map-mask = <0 0 0 0>; | ||
207 | interrupt-map = <0 0 0 0 &mpic 64>; | ||
208 | marvell,pcie-port = <1>; | ||
209 | marvell,pcie-lane = <2>; | ||
210 | clocks = <&gateclk 11>; | ||
211 | status = "disabled"; | ||
212 | }; | ||
213 | |||
214 | pcie@8,0 { | ||
215 | device_type = "pci"; | ||
216 | assigned-addresses = <0x82000800 0 0x8c000 0 0x2000>; | ||
217 | reg = <0x4000 0 0 0 0>; | ||
218 | #address-cells = <3>; | ||
219 | #size-cells = <2>; | ||
220 | #interrupt-cells = <1>; | ||
221 | ranges = <0x82000000 0 0 0x82000000 0x8 0 1 0 | ||
222 | 0x81000000 0 0 0x81000000 0x8 0 1 0>; | ||
223 | interrupt-map-mask = <0 0 0 0>; | ||
224 | interrupt-map = <0 0 0 0 &mpic 65>; | ||
225 | marvell,pcie-port = <1>; | ||
226 | marvell,pcie-lane = <3>; | ||
227 | clocks = <&gateclk 12>; | ||
228 | status = "disabled"; | ||
229 | }; | ||
230 | |||
231 | pcie@9,0 { | ||
232 | device_type = "pci"; | ||
233 | assigned-addresses = <0x82000800 0 0x42000 0 0x2000>; | ||
234 | reg = <0x4800 0 0 0 0>; | ||
235 | #address-cells = <3>; | ||
236 | #size-cells = <2>; | ||
237 | #interrupt-cells = <1>; | ||
238 | ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0 | ||
239 | 0x81000000 0 0 0x81000000 0x9 0 1 0>; | ||
240 | interrupt-map-mask = <0 0 0 0>; | ||
241 | interrupt-map = <0 0 0 0 &mpic 99>; | ||
242 | marvell,pcie-port = <2>; | ||
182 | marvell,pcie-lane = <0>; | 243 | marvell,pcie-lane = <0>; |
183 | clocks = <&gateclk 27>; | 244 | clocks = <&gateclk 26>; |
184 | status = "disabled"; | 245 | status = "disabled"; |
185 | }; | 246 | }; |
186 | }; | 247 | }; |
diff --git a/arch/arm/boot/dts/at91sam9x5_usart3.dtsi b/arch/arm/boot/dts/at91sam9x5_usart3.dtsi index 2347e9563cef..6801106fa1f8 100644 --- a/arch/arm/boot/dts/at91sam9x5_usart3.dtsi +++ b/arch/arm/boot/dts/at91sam9x5_usart3.dtsi | |||
@@ -11,6 +11,10 @@ | |||
11 | #include <dt-bindings/interrupt-controller/irq.h> | 11 | #include <dt-bindings/interrupt-controller/irq.h> |
12 | 12 | ||
13 | / { | 13 | / { |
14 | aliases { | ||
15 | serial4 = &usart3; | ||
16 | }; | ||
17 | |||
14 | ahb { | 18 | ahb { |
15 | apb { | 19 | apb { |
16 | pinctrl@fffff400 { | 20 | pinctrl@fffff400 { |
diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi index 1e12aeff403b..aa537ed13f0a 100644 --- a/arch/arm/boot/dts/bcm2835.dtsi +++ b/arch/arm/boot/dts/bcm2835.dtsi | |||
@@ -85,6 +85,8 @@ | |||
85 | reg = <0x7e205000 0x1000>; | 85 | reg = <0x7e205000 0x1000>; |
86 | interrupts = <2 21>; | 86 | interrupts = <2 21>; |
87 | clocks = <&clk_i2c>; | 87 | clocks = <&clk_i2c>; |
88 | #address-cells = <1>; | ||
89 | #size-cells = <0>; | ||
88 | status = "disabled"; | 90 | status = "disabled"; |
89 | }; | 91 | }; |
90 | 92 | ||
@@ -93,6 +95,8 @@ | |||
93 | reg = <0x7e804000 0x1000>; | 95 | reg = <0x7e804000 0x1000>; |
94 | interrupts = <2 21>; | 96 | interrupts = <2 21>; |
95 | clocks = <&clk_i2c>; | 97 | clocks = <&clk_i2c>; |
98 | #address-cells = <1>; | ||
99 | #size-cells = <0>; | ||
96 | status = "disabled"; | 100 | status = "disabled"; |
97 | }; | 101 | }; |
98 | 102 | ||
diff --git a/arch/arm/boot/dts/cros5250-common.dtsi b/arch/arm/boot/dts/cros5250-common.dtsi index dc259e8b8a73..9b186ac06c8b 100644 --- a/arch/arm/boot/dts/cros5250-common.dtsi +++ b/arch/arm/boot/dts/cros5250-common.dtsi | |||
@@ -27,6 +27,13 @@ | |||
27 | i2c2_bus: i2c2-bus { | 27 | i2c2_bus: i2c2-bus { |
28 | samsung,pin-pud = <0>; | 28 | samsung,pin-pud = <0>; |
29 | }; | 29 | }; |
30 | |||
31 | max77686_irq: max77686-irq { | ||
32 | samsung,pins = "gpx3-2"; | ||
33 | samsung,pin-function = <0>; | ||
34 | samsung,pin-pud = <0>; | ||
35 | samsung,pin-drv = <0>; | ||
36 | }; | ||
30 | }; | 37 | }; |
31 | 38 | ||
32 | i2c@12C60000 { | 39 | i2c@12C60000 { |
@@ -35,6 +42,11 @@ | |||
35 | 42 | ||
36 | max77686@09 { | 43 | max77686@09 { |
37 | compatible = "maxim,max77686"; | 44 | compatible = "maxim,max77686"; |
45 | interrupt-parent = <&gpx3>; | ||
46 | interrupts = <2 0>; | ||
47 | pinctrl-names = "default"; | ||
48 | pinctrl-0 = <&max77686_irq>; | ||
49 | wakeup-source; | ||
38 | reg = <0x09>; | 50 | reg = <0x09>; |
39 | 51 | ||
40 | voltage-regulators { | 52 | voltage-regulators { |
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 59154dc15fe4..fb28b2ecb1db 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi | |||
@@ -161,7 +161,7 @@ | |||
161 | clocks = <&clks 197>, <&clks 3>, | 161 | clocks = <&clks 197>, <&clks 3>, |
162 | <&clks 197>, <&clks 107>, | 162 | <&clks 197>, <&clks 107>, |
163 | <&clks 0>, <&clks 118>, | 163 | <&clks 0>, <&clks 118>, |
164 | <&clks 62>, <&clks 139>, | 164 | <&clks 0>, <&clks 139>, |
165 | <&clks 0>; | 165 | <&clks 0>; |
166 | clock-names = "core", "rxtx0", | 166 | clock-names = "core", "rxtx0", |
167 | "rxtx1", "rxtx2", | 167 | "rxtx1", "rxtx2", |
diff --git a/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi b/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi index 9c18adf788f7..f577b7df9a29 100644 --- a/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi +++ b/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi | |||
@@ -44,8 +44,8 @@ | |||
44 | gpmc,wr-access-ns = <186>; | 44 | gpmc,wr-access-ns = <186>; |
45 | gpmc,cycle2cycle-samecsen; | 45 | gpmc,cycle2cycle-samecsen; |
46 | gpmc,cycle2cycle-diffcsen; | 46 | gpmc,cycle2cycle-diffcsen; |
47 | vmmc-supply = <&vddvario>; | 47 | vddvario-supply = <&vddvario>; |
48 | vmmc_aux-supply = <&vdd33a>; | 48 | vdd33a-supply = <&vdd33a>; |
49 | reg-io-width = <4>; | 49 | reg-io-width = <4>; |
50 | smsc,save-mac-address; | 50 | smsc,save-mac-address; |
51 | }; | 51 | }; |
diff --git a/arch/arm/boot/dts/omap-zoom-common.dtsi b/arch/arm/boot/dts/omap-zoom-common.dtsi index b0ee342598f0..68221fab978d 100644 --- a/arch/arm/boot/dts/omap-zoom-common.dtsi +++ b/arch/arm/boot/dts/omap-zoom-common.dtsi | |||
@@ -13,7 +13,7 @@ | |||
13 | * they probably share the same GPIO IRQ | 13 | * they probably share the same GPIO IRQ |
14 | * REVISIT: Add timing support from slls644g.pdf | 14 | * REVISIT: Add timing support from slls644g.pdf |
15 | */ | 15 | */ |
16 | 8250@3,0 { | 16 | uart@3,0 { |
17 | compatible = "ns16550a"; | 17 | compatible = "ns16550a"; |
18 | reg = <3 0 0x100>; | 18 | reg = <3 0 0x100>; |
19 | bank-width = <2>; | 19 | bank-width = <2>; |
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index a2bfcde858a6..d0c5b37e248c 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi | |||
@@ -9,6 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <dt-bindings/gpio/gpio.h> | 11 | #include <dt-bindings/gpio/gpio.h> |
12 | #include <dt-bindings/interrupt-controller/irq.h> | ||
12 | #include <dt-bindings/pinctrl/omap.h> | 13 | #include <dt-bindings/pinctrl/omap.h> |
13 | 14 | ||
14 | #include "skeleton.dtsi" | 15 | #include "skeleton.dtsi" |
@@ -21,6 +22,8 @@ | |||
21 | serial0 = &uart1; | 22 | serial0 = &uart1; |
22 | serial1 = &uart2; | 23 | serial1 = &uart2; |
23 | serial2 = &uart3; | 24 | serial2 = &uart3; |
25 | i2c0 = &i2c1; | ||
26 | i2c1 = &i2c2; | ||
24 | }; | 27 | }; |
25 | 28 | ||
26 | cpus { | 29 | cpus { |
@@ -53,6 +56,28 @@ | |||
53 | ranges; | 56 | ranges; |
54 | ti,hwmods = "l3_main"; | 57 | ti,hwmods = "l3_main"; |
55 | 58 | ||
59 | aes: aes@480a6000 { | ||
60 | compatible = "ti,omap2-aes"; | ||
61 | ti,hwmods = "aes"; | ||
62 | reg = <0x480a6000 0x50>; | ||
63 | dmas = <&sdma 9 &sdma 10>; | ||
64 | dma-names = "tx", "rx"; | ||
65 | }; | ||
66 | |||
67 | hdq1w: 1w@480b2000 { | ||
68 | compatible = "ti,omap2420-1w"; | ||
69 | ti,hwmods = "hdq1w"; | ||
70 | reg = <0x480b2000 0x1000>; | ||
71 | interrupts = <58>; | ||
72 | }; | ||
73 | |||
74 | mailbox: mailbox@48094000 { | ||
75 | compatible = "ti,omap2-mailbox"; | ||
76 | ti,hwmods = "mailbox"; | ||
77 | reg = <0x48094000 0x200>; | ||
78 | interrupts = <26>; | ||
79 | }; | ||
80 | |||
56 | intc: interrupt-controller@1 { | 81 | intc: interrupt-controller@1 { |
57 | compatible = "ti,omap2-intc"; | 82 | compatible = "ti,omap2-intc"; |
58 | interrupt-controller; | 83 | interrupt-controller; |
@@ -63,6 +88,7 @@ | |||
63 | 88 | ||
64 | sdma: dma-controller@48056000 { | 89 | sdma: dma-controller@48056000 { |
65 | compatible = "ti,omap2430-sdma", "ti,omap2420-sdma"; | 90 | compatible = "ti,omap2430-sdma", "ti,omap2420-sdma"; |
91 | ti,hwmods = "dma"; | ||
66 | reg = <0x48056000 0x1000>; | 92 | reg = <0x48056000 0x1000>; |
67 | interrupts = <12>, | 93 | interrupts = <12>, |
68 | <13>, | 94 | <13>, |
@@ -73,21 +99,91 @@ | |||
73 | #dma-requests = <64>; | 99 | #dma-requests = <64>; |
74 | }; | 100 | }; |
75 | 101 | ||
102 | i2c1: i2c@48070000 { | ||
103 | compatible = "ti,omap2-i2c"; | ||
104 | ti,hwmods = "i2c1"; | ||
105 | reg = <0x48070000 0x80>; | ||
106 | #address-cells = <1>; | ||
107 | #size-cells = <0>; | ||
108 | interrupts = <56>; | ||
109 | dmas = <&sdma 27 &sdma 28>; | ||
110 | dma-names = "tx", "rx"; | ||
111 | }; | ||
112 | |||
113 | i2c2: i2c@48072000 { | ||
114 | compatible = "ti,omap2-i2c"; | ||
115 | ti,hwmods = "i2c2"; | ||
116 | reg = <0x48072000 0x80>; | ||
117 | #address-cells = <1>; | ||
118 | #size-cells = <0>; | ||
119 | interrupts = <57>; | ||
120 | dmas = <&sdma 29 &sdma 30>; | ||
121 | dma-names = "tx", "rx"; | ||
122 | }; | ||
123 | |||
124 | mcspi1: mcspi@48098000 { | ||
125 | compatible = "ti,omap2-mcspi"; | ||
126 | ti,hwmods = "mcspi1"; | ||
127 | reg = <0x48098000 0x100>; | ||
128 | interrupts = <65>; | ||
129 | dmas = <&sdma 35 &sdma 36 &sdma 37 &sdma 38 | ||
130 | &sdma 39 &sdma 40 &sdma 41 &sdma 42>; | ||
131 | dma-names = "tx0", "rx0", "tx1", "rx1", | ||
132 | "tx2", "rx2", "tx3", "rx3"; | ||
133 | }; | ||
134 | |||
135 | mcspi2: mcspi@4809a000 { | ||
136 | compatible = "ti,omap2-mcspi"; | ||
137 | ti,hwmods = "mcspi2"; | ||
138 | reg = <0x4809a000 0x100>; | ||
139 | interrupts = <66>; | ||
140 | dmas = <&sdma 43 &sdma 44 &sdma 45 &sdma 46>; | ||
141 | dma-names = "tx0", "rx0", "tx1", "rx1"; | ||
142 | }; | ||
143 | |||
144 | rng: rng@480a0000 { | ||
145 | compatible = "ti,omap2-rng"; | ||
146 | ti,hwmods = "rng"; | ||
147 | reg = <0x480a0000 0x50>; | ||
148 | interrupts = <36>; | ||
149 | }; | ||
150 | |||
151 | sham: sham@480a4000 { | ||
152 | compatible = "ti,omap2-sham"; | ||
153 | ti,hwmods = "sham"; | ||
154 | reg = <0x480a4000 0x64>; | ||
155 | interrupts = <51>; | ||
156 | dmas = <&sdma 13>; | ||
157 | dma-names = "rx"; | ||
158 | }; | ||
159 | |||
76 | uart1: serial@4806a000 { | 160 | uart1: serial@4806a000 { |
77 | compatible = "ti,omap2-uart"; | 161 | compatible = "ti,omap2-uart"; |
78 | ti,hwmods = "uart1"; | 162 | ti,hwmods = "uart1"; |
163 | reg = <0x4806a000 0x2000>; | ||
164 | interrupts = <72>; | ||
165 | dmas = <&sdma 49 &sdma 50>; | ||
166 | dma-names = "tx", "rx"; | ||
79 | clock-frequency = <48000000>; | 167 | clock-frequency = <48000000>; |
80 | }; | 168 | }; |
81 | 169 | ||
82 | uart2: serial@4806c000 { | 170 | uart2: serial@4806c000 { |
83 | compatible = "ti,omap2-uart"; | 171 | compatible = "ti,omap2-uart"; |
84 | ti,hwmods = "uart2"; | 172 | ti,hwmods = "uart2"; |
173 | reg = <0x4806c000 0x400>; | ||
174 | interrupts = <73>; | ||
175 | dmas = <&sdma 51 &sdma 52>; | ||
176 | dma-names = "tx", "rx"; | ||
85 | clock-frequency = <48000000>; | 177 | clock-frequency = <48000000>; |
86 | }; | 178 | }; |
87 | 179 | ||
88 | uart3: serial@4806e000 { | 180 | uart3: serial@4806e000 { |
89 | compatible = "ti,omap2-uart"; | 181 | compatible = "ti,omap2-uart"; |
90 | ti,hwmods = "uart3"; | 182 | ti,hwmods = "uart3"; |
183 | reg = <0x4806e000 0x400>; | ||
184 | interrupts = <74>; | ||
185 | dmas = <&sdma 53 &sdma 54>; | ||
186 | dma-names = "tx", "rx"; | ||
91 | clock-frequency = <48000000>; | 187 | clock-frequency = <48000000>; |
92 | }; | 188 | }; |
93 | 189 | ||
diff --git a/arch/arm/boot/dts/omap2420-n800.dts b/arch/arm/boot/dts/omap2420-n800.dts new file mode 100644 index 000000000000..d8c1b423606a --- /dev/null +++ b/arch/arm/boot/dts/omap2420-n800.dts | |||
@@ -0,0 +1,8 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | #include "omap2420-n8x0-common.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "Nokia N800"; | ||
7 | compatible = "nokia,n800", "nokia,n8x0", "ti,omap2420", "ti,omap2"; | ||
8 | }; | ||
diff --git a/arch/arm/boot/dts/omap2420-n810-wimax.dts b/arch/arm/boot/dts/omap2420-n810-wimax.dts new file mode 100644 index 000000000000..6b25b0359ac9 --- /dev/null +++ b/arch/arm/boot/dts/omap2420-n810-wimax.dts | |||
@@ -0,0 +1,8 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | #include "omap2420-n8x0-common.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "Nokia N810 WiMax"; | ||
7 | compatible = "nokia,n810-wimax", "nokia,n8x0", "ti,omap2420", "ti,omap2"; | ||
8 | }; | ||
diff --git a/arch/arm/boot/dts/omap2420-n810.dts b/arch/arm/boot/dts/omap2420-n810.dts new file mode 100644 index 000000000000..21baec154b78 --- /dev/null +++ b/arch/arm/boot/dts/omap2420-n810.dts | |||
@@ -0,0 +1,8 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | #include "omap2420-n8x0-common.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "Nokia N810"; | ||
7 | compatible = "nokia,n810", "nokia,n8x0", "ti,omap2420", "ti,omap2"; | ||
8 | }; | ||
diff --git a/arch/arm/boot/dts/omap2420-n8x0-common.dtsi b/arch/arm/boot/dts/omap2420-n8x0-common.dtsi new file mode 100644 index 000000000000..89608b206519 --- /dev/null +++ b/arch/arm/boot/dts/omap2420-n8x0-common.dtsi | |||
@@ -0,0 +1,99 @@ | |||
1 | #include "omap2420.dtsi" | ||
2 | |||
3 | / { | ||
4 | memory { | ||
5 | device_type = "memory"; | ||
6 | reg = <0x80000000 0x8000000>; /* 128 MB */ | ||
7 | }; | ||
8 | |||
9 | ocp { | ||
10 | i2c@0 { | ||
11 | compatible = "i2c-cbus-gpio"; | ||
12 | gpios = <&gpio3 2 0 /* gpio66 clk */ | ||
13 | &gpio3 1 0 /* gpio65 dat */ | ||
14 | &gpio3 0 0 /* gpio64 sel */ | ||
15 | >; | ||
16 | #address-cells = <1>; | ||
17 | #size-cells = <0>; | ||
18 | retu_mfd: retu@1 { | ||
19 | compatible = "retu-mfd"; | ||
20 | interrupt-parent = <&gpio4>; | ||
21 | interrupts = <12 IRQ_TYPE_EDGE_RISING>; | ||
22 | reg = <0x1>; | ||
23 | }; | ||
24 | }; | ||
25 | }; | ||
26 | }; | ||
27 | |||
28 | &i2c1 { | ||
29 | clock-frequency = <400000>; | ||
30 | }; | ||
31 | |||
32 | &i2c2 { | ||
33 | clock-frequency = <400000>; | ||
34 | }; | ||
35 | |||
36 | &gpmc { | ||
37 | ranges = <0 0 0x04000000 0x10000000>; | ||
38 | |||
39 | /* gpio-irq for dma: 26 */ | ||
40 | |||
41 | onenand@0,0 { | ||
42 | #address-cells = <1>; | ||
43 | #size-cells = <1>; | ||
44 | reg = <0 0 0x10000000>; | ||
45 | |||
46 | gpmc,sync-read; | ||
47 | gpmc,burst-length = <16>; | ||
48 | gpmc,burst-read; | ||
49 | gpmc,burst-wrap; | ||
50 | gpmc,device-width = <2>; | ||
51 | gpmc,mux-add-data = <2>; | ||
52 | gpmc,cs-on-ns = <0>; | ||
53 | gpmc,cs-rd-off-ns = <127>; | ||
54 | gpmc,cs-wr-off-ns = <109>; | ||
55 | gpmc,adv-on-ns = <0>; | ||
56 | gpmc,adv-rd-off-ns = <18>; | ||
57 | gpmc,adv-wr-off-ns = <18>; | ||
58 | gpmc,oe-on-ns = <27>; | ||
59 | gpmc,oe-off-ns = <127>; | ||
60 | gpmc,we-on-ns = <27>; | ||
61 | gpmc,we-off-ns = <72>; | ||
62 | gpmc,rd-cycle-ns = <145>; | ||
63 | gpmc,wr-cycle-ns = <136>; | ||
64 | gpmc,access-ns = <118>; | ||
65 | gpmc,page-burst-access-ns = <27>; | ||
66 | gpmc,bus-turnaround-ns = <0>; | ||
67 | gpmc,cycle2cycle-delay-ns = <0>; | ||
68 | gpmc,wait-monitoring-ns = <0>; | ||
69 | gpmc,clk-activation-ns = <9>; | ||
70 | gpmc,sync-clk-ps = <27000>; | ||
71 | |||
72 | /* MTD partition table corresponding to old board-n8x0 file. */ | ||
73 | partition@0 { | ||
74 | label = "bootloader"; | ||
75 | reg = <0x00000000 0x00020000>; | ||
76 | read-only; | ||
77 | }; | ||
78 | partition@1 { | ||
79 | label = "config"; | ||
80 | reg = <0x00020000 0x00060000>; | ||
81 | }; | ||
82 | partition@2 { | ||
83 | label = "kernel"; | ||
84 | reg = <0x00080000 0x00200000>; | ||
85 | }; | ||
86 | partition@3 { | ||
87 | label = "initfs"; | ||
88 | reg = <0x00280000 0x00400000>; | ||
89 | }; | ||
90 | partition@4 { | ||
91 | label = "rootfs"; | ||
92 | reg = <0x00680000 0x0f980000>; | ||
93 | }; | ||
94 | partition@5 { | ||
95 | label = "omap2-onenand"; | ||
96 | reg = <0x00000000 0x10000000>; | ||
97 | }; | ||
98 | }; | ||
99 | }; | ||
diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi index c8f9c55169ea..60c605de22dd 100644 --- a/arch/arm/boot/dts/omap2420.dtsi +++ b/arch/arm/boot/dts/omap2420.dtsi | |||
@@ -114,6 +114,15 @@ | |||
114 | dma-names = "tx", "rx"; | 114 | dma-names = "tx", "rx"; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | msdi1: mmc@4809c000 { | ||
118 | compatible = "ti,omap2420-mmc"; | ||
119 | ti,hwmods = "msdi1"; | ||
120 | reg = <0x4809c000 0x80>; | ||
121 | interrupts = <83>; | ||
122 | dmas = <&sdma 61 &sdma 62>; | ||
123 | dma-names = "tx", "rx"; | ||
124 | }; | ||
125 | |||
117 | timer1: timer@48028000 { | 126 | timer1: timer@48028000 { |
118 | compatible = "ti,omap2420-timer"; | 127 | compatible = "ti,omap2420-timer"; |
119 | reg = <0x48028000 0x400>; | 128 | reg = <0x48028000 0x400>; |
@@ -121,5 +130,19 @@ | |||
121 | ti,hwmods = "timer1"; | 130 | ti,hwmods = "timer1"; |
122 | ti,timer-alwon; | 131 | ti,timer-alwon; |
123 | }; | 132 | }; |
133 | |||
134 | wd_timer2: wdt@48022000 { | ||
135 | compatible = "ti,omap2-wdt"; | ||
136 | ti,hwmods = "wd_timer2"; | ||
137 | reg = <0x48022000 0x80>; | ||
138 | }; | ||
124 | }; | 139 | }; |
125 | }; | 140 | }; |
141 | |||
142 | &i2c1 { | ||
143 | compatible = "ti,omap2420-i2c"; | ||
144 | }; | ||
145 | |||
146 | &i2c2 { | ||
147 | compatible = "ti,omap2420-i2c"; | ||
148 | }; | ||
diff --git a/arch/arm/boot/dts/omap2430-sdp.dts b/arch/arm/boot/dts/omap2430-sdp.dts new file mode 100644 index 000000000000..2c90d29b4cad --- /dev/null +++ b/arch/arm/boot/dts/omap2430-sdp.dts | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | /dts-v1/; | ||
9 | |||
10 | #include "omap2430.dtsi" | ||
11 | |||
12 | / { | ||
13 | model = "TI OMAP2430 SDP"; | ||
14 | compatible = "ti,omap2430-sdp", "ti,omap2430", "ti,omap2"; | ||
15 | |||
16 | memory { | ||
17 | device_type = "memory"; | ||
18 | reg = <0x80000000 0x8000000>; /* 128 MB */ | ||
19 | }; | ||
20 | }; | ||
21 | |||
22 | &i2c2 { | ||
23 | clock-frequency = <100000>; | ||
24 | |||
25 | twl: twl@48 { | ||
26 | reg = <0x48>; | ||
27 | interrupts = <7>; /* SYS_NIRQ cascaded to intc */ | ||
28 | }; | ||
29 | }; | ||
30 | |||
31 | #include "twl4030.dtsi" | ||
32 | |||
33 | &mmc1 { | ||
34 | vmmc-supply = <&vmmc1>; | ||
35 | bus-width = <4>; | ||
36 | }; | ||
37 | |||
38 | &gpmc { | ||
39 | ranges = <5 0 0x08000000 0x01000000>; | ||
40 | ethernet@gpmc { | ||
41 | compatible = "smsc,lan91c94"; | ||
42 | interrupt-parent = <&gpio5>; | ||
43 | interrupts = <21 IRQ_TYPE_LEVEL_LOW>; /* gpio149 */ | ||
44 | reg = <5 0x300 0xf>; | ||
45 | bank-width = <2>; | ||
46 | gpmc,mux-add-data; | ||
47 | }; | ||
48 | }; | ||
49 | |||
diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi index c535a5a2b27f..d624345666f5 100644 --- a/arch/arm/boot/dts/omap2430.dtsi +++ b/arch/arm/boot/dts/omap2430.dtsi | |||
@@ -175,6 +175,25 @@ | |||
175 | dma-names = "tx", "rx"; | 175 | dma-names = "tx", "rx"; |
176 | }; | 176 | }; |
177 | 177 | ||
178 | mmc1: mmc@4809c000 { | ||
179 | compatible = "ti,omap2-hsmmc"; | ||
180 | reg = <0x4809c000 0x200>; | ||
181 | interrupts = <83>; | ||
182 | ti,hwmods = "mmc1"; | ||
183 | ti,dual-volt; | ||
184 | dmas = <&sdma 61>, <&sdma 62>; | ||
185 | dma-names = "tx", "rx"; | ||
186 | }; | ||
187 | |||
188 | mmc2: mmc@480b4000 { | ||
189 | compatible = "ti,omap2-hsmmc"; | ||
190 | reg = <0x480b4000 0x200>; | ||
191 | interrupts = <86>; | ||
192 | ti,hwmods = "mmc2"; | ||
193 | dmas = <&sdma 47>, <&sdma 48>; | ||
194 | dma-names = "tx", "rx"; | ||
195 | }; | ||
196 | |||
178 | timer1: timer@49018000 { | 197 | timer1: timer@49018000 { |
179 | compatible = "ti,omap2420-timer"; | 198 | compatible = "ti,omap2420-timer"; |
180 | reg = <0x49018000 0x400>; | 199 | reg = <0x49018000 0x400>; |
@@ -182,5 +201,35 @@ | |||
182 | ti,hwmods = "timer1"; | 201 | ti,hwmods = "timer1"; |
183 | ti,timer-alwon; | 202 | ti,timer-alwon; |
184 | }; | 203 | }; |
204 | |||
205 | mcspi3: mcspi@480b8000 { | ||
206 | compatible = "ti,omap2-mcspi"; | ||
207 | ti,hwmods = "mcspi3"; | ||
208 | reg = <0x480b8000 0x100>; | ||
209 | interrupts = <91>; | ||
210 | dmas = <&sdma 15 &sdma 16 &sdma 23 &sdma 24>; | ||
211 | dma-names = "tx0", "rx0", "tx1", "rx1"; | ||
212 | }; | ||
213 | |||
214 | usb_otg_hs: usb_otg_hs@480ac000 { | ||
215 | compatible = "ti,omap2-musb"; | ||
216 | ti,hwmods = "usb_otg_hs"; | ||
217 | reg = <0x480ac000 0x1000>; | ||
218 | interrupts = <93>; | ||
219 | }; | ||
220 | |||
221 | wd_timer2: wdt@49016000 { | ||
222 | compatible = "ti,omap2-wdt"; | ||
223 | ti,hwmods = "wd_timer2"; | ||
224 | reg = <0x49016000 0x80>; | ||
225 | }; | ||
185 | }; | 226 | }; |
186 | }; | 227 | }; |
228 | |||
229 | &i2c1 { | ||
230 | compatible = "ti,omap2430-i2c"; | ||
231 | }; | ||
232 | |||
233 | &i2c2 { | ||
234 | compatible = "ti,omap2430-i2c"; | ||
235 | }; | ||
diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts index 31a632f7effb..df33a50bc070 100644 --- a/arch/arm/boot/dts/omap3-beagle-xm.dts +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts | |||
@@ -215,3 +215,10 @@ | |||
215 | &usbhsehci { | 215 | &usbhsehci { |
216 | phys = <0 &hsusb2_phy>; | 216 | phys = <0 &hsusb2_phy>; |
217 | }; | 217 | }; |
218 | |||
219 | &vaux2 { | ||
220 | regulator-name = "usb_1v8"; | ||
221 | regulator-min-microvolt = <1800000>; | ||
222 | regulator-max-microvolt = <1800000>; | ||
223 | regulator-always-on; | ||
224 | }; | ||
diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index fa532aaacc68..3ba4a625ea5b 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts | |||
@@ -61,6 +61,14 @@ | |||
61 | vcc-supply = <&hsusb2_power>; | 61 | vcc-supply = <&hsusb2_power>; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | sound { | ||
65 | compatible = "ti,omap-twl4030"; | ||
66 | ti,model = "omap3beagle"; | ||
67 | |||
68 | ti,mcbsp = <&mcbsp2>; | ||
69 | ti,codec = <&twl_audio>; | ||
70 | }; | ||
71 | |||
64 | gpio_keys { | 72 | gpio_keys { |
65 | compatible = "gpio-keys"; | 73 | compatible = "gpio-keys"; |
66 | 74 | ||
@@ -120,6 +128,12 @@ | |||
120 | reg = <0x48>; | 128 | reg = <0x48>; |
121 | interrupts = <7>; /* SYS_NIRQ cascaded to intc */ | 129 | interrupts = <7>; /* SYS_NIRQ cascaded to intc */ |
122 | interrupt-parent = <&intc>; | 130 | interrupt-parent = <&intc>; |
131 | |||
132 | twl_audio: audio { | ||
133 | compatible = "ti,twl4030-audio"; | ||
134 | codec { | ||
135 | }; | ||
136 | }; | ||
123 | }; | 137 | }; |
124 | }; | 138 | }; |
125 | 139 | ||
@@ -178,3 +192,10 @@ | |||
178 | mode = <3>; | 192 | mode = <3>; |
179 | power = <50>; | 193 | power = <50>; |
180 | }; | 194 | }; |
195 | |||
196 | &vaux2 { | ||
197 | regulator-name = "vdd_ehci"; | ||
198 | regulator-min-microvolt = <1800000>; | ||
199 | regulator-max-microvolt = <1800000>; | ||
200 | regulator-always-on; | ||
201 | }; | ||
diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi index ba1e58b7b7e3..165aaf7591ba 100644 --- a/arch/arm/boot/dts/omap3-igep.dtsi +++ b/arch/arm/boot/dts/omap3-igep.dtsi | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Device Tree Source for IGEP Technology devices | 2 | * Common device tree for IGEP boards based on AM/DM37x |
3 | * | 3 | * |
4 | * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk> | 4 | * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk> |
5 | * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com> | 5 | * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com> |
@@ -10,7 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | /dts-v1/; | 11 | /dts-v1/; |
12 | 12 | ||
13 | #include "omap34xx.dtsi" | 13 | #include "omap36xx.dtsi" |
14 | 14 | ||
15 | / { | 15 | / { |
16 | memory { | 16 | memory { |
@@ -24,6 +24,25 @@ | |||
24 | ti,mcbsp = <&mcbsp2>; | 24 | ti,mcbsp = <&mcbsp2>; |
25 | ti,codec = <&twl_audio>; | 25 | ti,codec = <&twl_audio>; |
26 | }; | 26 | }; |
27 | |||
28 | vdd33: regulator-vdd33 { | ||
29 | compatible = "regulator-fixed"; | ||
30 | regulator-name = "vdd33"; | ||
31 | regulator-always-on; | ||
32 | }; | ||
33 | |||
34 | lbee1usjyc_vmmc: lbee1usjyc_vmmc { | ||
35 | pinctrl-names = "default"; | ||
36 | pinctrl-0 = <&lbee1usjyc_pins>; | ||
37 | compatible = "regulator-fixed"; | ||
38 | regulator-name = "regulator-lbee1usjyc"; | ||
39 | regulator-min-microvolt = <3300000>; | ||
40 | regulator-max-microvolt = <3300000>; | ||
41 | gpio = <&gpio5 10 GPIO_ACTIVE_HIGH>; /* gpio_138 WIFI_PDN */ | ||
42 | startup-delay-us = <10000>; | ||
43 | enable-active-high; | ||
44 | vin-supply = <&vdd33>; | ||
45 | }; | ||
27 | }; | 46 | }; |
28 | 47 | ||
29 | &omap3_pmx_core { | 48 | &omap3_pmx_core { |
@@ -48,6 +67,15 @@ | |||
48 | >; | 67 | >; |
49 | }; | 68 | }; |
50 | 69 | ||
70 | /* WiFi/BT combo */ | ||
71 | lbee1usjyc_pins: pinmux_lbee1usjyc_pins { | ||
72 | pinctrl-single,pins = < | ||
73 | 0x136 (PIN_OUTPUT | MUX_MODE4) /* sdmmc2_dat5.gpio_137 */ | ||
74 | 0x138 (PIN_OUTPUT | MUX_MODE4) /* sdmmc2_dat6.gpio_138 */ | ||
75 | 0x13a (PIN_OUTPUT | MUX_MODE4) /* sdmmc2_dat7.gpio_139 */ | ||
76 | >; | ||
77 | }; | ||
78 | |||
51 | mcbsp2_pins: pinmux_mcbsp2_pins { | 79 | mcbsp2_pins: pinmux_mcbsp2_pins { |
52 | pinctrl-single,pins = < | 80 | pinctrl-single,pins = < |
53 | 0x10c (PIN_INPUT | MUX_MODE0) /* mcbsp2_fsx.mcbsp2_fsx */ | 81 | 0x10c (PIN_INPUT | MUX_MODE0) /* mcbsp2_fsx.mcbsp2_fsx */ |
@@ -65,10 +93,17 @@ | |||
65 | 0x11a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */ | 93 | 0x11a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */ |
66 | 0x11c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */ | 94 | 0x11c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */ |
67 | 0x11e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */ | 95 | 0x11e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */ |
68 | 0x120 (PIN_INPUT | MUX_MODE0) /* sdmmc1_dat4.sdmmc1_dat4 */ | 96 | >; |
69 | 0x122 (PIN_INPUT | MUX_MODE0) /* sdmmc1_dat5.sdmmc1_dat5 */ | 97 | }; |
70 | 0x124 (PIN_INPUT | MUX_MODE0) /* sdmmc1_dat6.sdmmc1_dat6 */ | 98 | |
71 | 0x126 (PIN_INPUT | MUX_MODE0) /* sdmmc1_dat7.sdmmc1_dat7 */ | 99 | mmc2_pins: pinmux_mmc2_pins { |
100 | pinctrl-single,pins = < | ||
101 | 0x128 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_clk.sdmmc2_clk */ | ||
102 | 0x12a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_cmd.sdmmc2_cmd */ | ||
103 | 0x12c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat0.sdmmc2_dat0 */ | ||
104 | 0x12e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat1.sdmmc2_dat1 */ | ||
105 | 0x130 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat2.sdmmc2_dat2 */ | ||
106 | 0x132 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3.sdmmc2_dat3 */ | ||
72 | >; | 107 | >; |
73 | }; | 108 | }; |
74 | 109 | ||
@@ -78,10 +113,33 @@ | |||
78 | >; | 113 | >; |
79 | }; | 114 | }; |
80 | 115 | ||
116 | i2c1_pins: pinmux_i2c1_pins { | ||
117 | pinctrl-single,pins = < | ||
118 | 0x18a (PIN_INPUT | MUX_MODE0) /* i2c1_scl.i2c1_scl */ | ||
119 | 0x18c (PIN_INPUT | MUX_MODE0) /* i2c1_sda.i2c1_sda */ | ||
120 | >; | ||
121 | }; | ||
122 | |||
123 | i2c2_pins: pinmux_i2c2_pins { | ||
124 | pinctrl-single,pins = < | ||
125 | 0x18e (PIN_INPUT | MUX_MODE0) /* i2c2_scl.i2c2_scl */ | ||
126 | 0x190 (PIN_INPUT | MUX_MODE0) /* i2c2_sda.i2c2_sda */ | ||
127 | >; | ||
128 | }; | ||
129 | |||
130 | i2c3_pins: pinmux_i2c3_pins { | ||
131 | pinctrl-single,pins = < | ||
132 | 0x192 (PIN_INPUT | MUX_MODE0) /* i2c3_scl.i2c3_scl */ | ||
133 | 0x194 (PIN_INPUT | MUX_MODE0) /* i2c3_sda.i2c3_sda */ | ||
134 | >; | ||
135 | }; | ||
136 | |||
81 | leds_pins: pinmux_leds_pins { }; | 137 | leds_pins: pinmux_leds_pins { }; |
82 | }; | 138 | }; |
83 | 139 | ||
84 | &i2c1 { | 140 | &i2c1 { |
141 | pinctrl-names = "default"; | ||
142 | pinctrl-0 = <&i2c1_pins>; | ||
85 | clock-frequency = <2600000>; | 143 | clock-frequency = <2600000>; |
86 | 144 | ||
87 | twl: twl@48 { | 145 | twl: twl@48 { |
@@ -101,9 +159,16 @@ | |||
101 | #include "twl4030_omap3.dtsi" | 159 | #include "twl4030_omap3.dtsi" |
102 | 160 | ||
103 | &i2c2 { | 161 | &i2c2 { |
162 | pinctrl-names = "default"; | ||
163 | pinctrl-0 = <&i2c2_pins>; | ||
104 | clock-frequency = <400000>; | 164 | clock-frequency = <400000>; |
105 | }; | 165 | }; |
106 | 166 | ||
167 | &i2c3 { | ||
168 | pinctrl-names = "default"; | ||
169 | pinctrl-0 = <&i2c3_pins>; | ||
170 | }; | ||
171 | |||
107 | &mcbsp2 { | 172 | &mcbsp2 { |
108 | pinctrl-names = "default"; | 173 | pinctrl-names = "default"; |
109 | pinctrl-0 = <&mcbsp2_pins>; | 174 | pinctrl-0 = <&mcbsp2_pins>; |
@@ -114,11 +179,15 @@ | |||
114 | pinctrl-0 = <&mmc1_pins>; | 179 | pinctrl-0 = <&mmc1_pins>; |
115 | vmmc-supply = <&vmmc1>; | 180 | vmmc-supply = <&vmmc1>; |
116 | vmmc_aux-supply = <&vsim>; | 181 | vmmc_aux-supply = <&vsim>; |
117 | bus-width = <8>; | 182 | bus-width = <4>; |
118 | }; | 183 | }; |
119 | 184 | ||
120 | &mmc2 { | 185 | &mmc2 { |
121 | status = "disabled"; | 186 | pinctrl-names = "default"; |
187 | pinctrl-0 = <&mmc2_pins>; | ||
188 | vmmc-supply = <&lbee1usjyc_vmmc>; | ||
189 | bus-width = <4>; | ||
190 | non-removable; | ||
122 | }; | 191 | }; |
123 | 192 | ||
124 | &mmc3 { | 193 | &mmc3 { |
diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts index d5cc79267250..1c7e74d2d2bc 100644 --- a/arch/arm/boot/dts/omap3-igep0020.dts +++ b/arch/arm/boot/dts/omap3-igep0020.dts | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Device Tree Source for IGEPv2 board | 2 | * Device Tree Source for IGEPv2 Rev. (TI OMAP AM/DM37x) |
3 | * | 3 | * |
4 | * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk> | 4 | * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk> |
5 | * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com> | 5 | * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com> |
@@ -13,7 +13,7 @@ | |||
13 | #include "omap-gpmc-smsc911x.dtsi" | 13 | #include "omap-gpmc-smsc911x.dtsi" |
14 | 14 | ||
15 | / { | 15 | / { |
16 | model = "IGEPv2"; | 16 | model = "IGEPv2 (TI OMAP AM/DM37x)"; |
17 | compatible = "isee,omap3-igep0020", "ti,omap3"; | 17 | compatible = "isee,omap3-igep0020", "ti,omap3"; |
18 | 18 | ||
19 | leds { | 19 | leds { |
@@ -67,6 +67,8 @@ | |||
67 | pinctrl-names = "default"; | 67 | pinctrl-names = "default"; |
68 | pinctrl-0 = < | 68 | pinctrl-0 = < |
69 | &hsusbb1_pins | 69 | &hsusbb1_pins |
70 | &tfp410_pins | ||
71 | &dss_pins | ||
70 | >; | 72 | >; |
71 | 73 | ||
72 | hsusbb1_pins: pinmux_hsusbb1_pins { | 74 | hsusbb1_pins: pinmux_hsusbb1_pins { |
@@ -85,6 +87,45 @@ | |||
85 | 0x5ba (PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d7.hsusb1_data3 */ | 87 | 0x5ba (PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d7.hsusb1_data3 */ |
86 | >; | 88 | >; |
87 | }; | 89 | }; |
90 | |||
91 | tfp410_pins: tfp410_dvi_pins { | ||
92 | pinctrl-single,pins = < | ||
93 | 0x196 (PIN_OUTPUT | MUX_MODE4) /* hdq_sio.gpio_170 */ | ||
94 | >; | ||
95 | }; | ||
96 | |||
97 | dss_pins: pinmux_dss_dvi_pins { | ||
98 | pinctrl-single,pins = < | ||
99 | 0x0a4 (PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */ | ||
100 | 0x0a6 (PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */ | ||
101 | 0x0a8 (PIN_OUTPUT | MUX_MODE0) /* dss_vsync.dss_vsync */ | ||
102 | 0x0aa (PIN_OUTPUT | MUX_MODE0) /* dss_acbias.dss_acbias */ | ||
103 | 0x0ac (PIN_OUTPUT | MUX_MODE0) /* dss_data0.dss_data0 */ | ||
104 | 0x0ae (PIN_OUTPUT | MUX_MODE0) /* dss_data1.dss_data1 */ | ||
105 | 0x0b0 (PIN_OUTPUT | MUX_MODE0) /* dss_data2.dss_data2 */ | ||
106 | 0x0b2 (PIN_OUTPUT | MUX_MODE0) /* dss_data3.dss_data3 */ | ||
107 | 0x0b4 (PIN_OUTPUT | MUX_MODE0) /* dss_data4.dss_data4 */ | ||
108 | 0x0b6 (PIN_OUTPUT | MUX_MODE0) /* dss_data5.dss_data5 */ | ||
109 | 0x0b8 (PIN_OUTPUT | MUX_MODE0) /* dss_data6.dss_data6 */ | ||
110 | 0x0ba (PIN_OUTPUT | MUX_MODE0) /* dss_data7.dss_data7 */ | ||
111 | 0x0bc (PIN_OUTPUT | MUX_MODE0) /* dss_data8.dss_data8 */ | ||
112 | 0x0be (PIN_OUTPUT | MUX_MODE0) /* dss_data9.dss_data9 */ | ||
113 | 0x0c0 (PIN_OUTPUT | MUX_MODE0) /* dss_data10.dss_data10 */ | ||
114 | 0x0c2 (PIN_OUTPUT | MUX_MODE0) /* dss_data11.dss_data11 */ | ||
115 | 0x0c4 (PIN_OUTPUT | MUX_MODE0) /* dss_data12.dss_data12 */ | ||
116 | 0x0c6 (PIN_OUTPUT | MUX_MODE0) /* dss_data13.dss_data13 */ | ||
117 | 0x0c8 (PIN_OUTPUT | MUX_MODE0) /* dss_data14.dss_data14 */ | ||
118 | 0x0ca (PIN_OUTPUT | MUX_MODE0) /* dss_data15.dss_data15 */ | ||
119 | 0x0cc (PIN_OUTPUT | MUX_MODE0) /* dss_data16.dss_data16 */ | ||
120 | 0x0ce (PIN_OUTPUT | MUX_MODE0) /* dss_data17.dss_data17 */ | ||
121 | 0x0d0 (PIN_OUTPUT | MUX_MODE0) /* dss_data18.dss_data18 */ | ||
122 | 0x0d2 (PIN_OUTPUT | MUX_MODE0) /* dss_data19.dss_data19 */ | ||
123 | 0x0d4 (PIN_OUTPUT | MUX_MODE0) /* dss_data20.dss_data20 */ | ||
124 | 0x0d6 (PIN_OUTPUT | MUX_MODE0) /* dss_data21.dss_data21 */ | ||
125 | 0x0d8 (PIN_OUTPUT | MUX_MODE0) /* dss_data22.dss_data22 */ | ||
126 | 0x0da (PIN_OUTPUT | MUX_MODE0) /* dss_data23.dss_data23 */ | ||
127 | >; | ||
128 | }; | ||
88 | }; | 129 | }; |
89 | 130 | ||
90 | &leds_pins { | 131 | &leds_pins { |
@@ -174,3 +215,8 @@ | |||
174 | &usbhsehci { | 215 | &usbhsehci { |
175 | phys = <&hsusb1_phy>; | 216 | phys = <&hsusb1_phy>; |
176 | }; | 217 | }; |
218 | |||
219 | &vpll2 { | ||
220 | /* Needed for DSS */ | ||
221 | regulator-name = "vdds_dsi"; | ||
222 | }; | ||
diff --git a/arch/arm/boot/dts/omap3-igep0030.dts b/arch/arm/boot/dts/omap3-igep0030.dts index 525e6d9b0978..02a23f8a3384 100644 --- a/arch/arm/boot/dts/omap3-igep0030.dts +++ b/arch/arm/boot/dts/omap3-igep0030.dts | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Device Tree Source for IGEP COM Module | 2 | * Device Tree Source for IGEP COM MODULE (TI OMAP AM/DM37x) |
3 | * | 3 | * |
4 | * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk> | 4 | * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk> |
5 | * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com> | 5 | * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com> |
@@ -12,7 +12,7 @@ | |||
12 | #include "omap3-igep.dtsi" | 12 | #include "omap3-igep.dtsi" |
13 | 13 | ||
14 | / { | 14 | / { |
15 | model = "IGEP COM Module"; | 15 | model = "IGEP COM MODULE (TI OMAP AM/DM37x)"; |
16 | compatible = "isee,omap3-igep0030", "ti,omap3"; | 16 | compatible = "isee,omap3-igep0030", "ti,omap3"; |
17 | 17 | ||
18 | leds { | 18 | leds { |
diff --git a/arch/arm/boot/dts/omap3-ldp.dts b/arch/arm/boot/dts/omap3-ldp.dts new file mode 100644 index 000000000000..ddce0d807f70 --- /dev/null +++ b/arch/arm/boot/dts/omap3-ldp.dts | |||
@@ -0,0 +1,231 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | /dts-v1/; | ||
9 | |||
10 | #include "omap34xx.dtsi" | ||
11 | #include "omap-gpmc-smsc911x.dtsi" | ||
12 | |||
13 | / { | ||
14 | model = "TI OMAP3430 LDP (Zoom1 Labrador)"; | ||
15 | compatible = "ti,omap3-ldp", "ti,omap3"; | ||
16 | |||
17 | memory { | ||
18 | device_type = "memory"; | ||
19 | reg = <0x80000000 0x8000000>; /* 128 MB */ | ||
20 | }; | ||
21 | |||
22 | cpus { | ||
23 | cpu@0 { | ||
24 | cpu0-supply = <&vcc>; | ||
25 | }; | ||
26 | }; | ||
27 | |||
28 | gpio_keys { | ||
29 | compatible = "gpio-keys"; | ||
30 | pinctrl-names = "default"; | ||
31 | pinctrl-0 = <&gpio_key_pins>; | ||
32 | |||
33 | key_enter { | ||
34 | label = "enter"; | ||
35 | gpios = <&gpio4 5 GPIO_ACTIVE_LOW>; /* gpio101 */ | ||
36 | linux,code = <0x0107001c>; /* KEY_ENTER */ | ||
37 | gpio-key,wakeup; | ||
38 | }; | ||
39 | |||
40 | key_f1 { | ||
41 | label = "f1"; | ||
42 | gpios = <&gpio4 6 GPIO_ACTIVE_LOW>; /* gpio102 */ | ||
43 | linux,code = <0x0303003b>; /* KEY_F1 */ | ||
44 | gpio-key,wakeup; | ||
45 | }; | ||
46 | |||
47 | key_f2 { | ||
48 | label = "f2"; | ||
49 | gpios = <&gpio4 7 GPIO_ACTIVE_LOW>; /* gpio103 */ | ||
50 | linux,code = <0x0403003c>; /* KEY_F2 */ | ||
51 | gpio-key,wakeup; | ||
52 | }; | ||
53 | |||
54 | key_f3 { | ||
55 | label = "f3"; | ||
56 | gpios = <&gpio4 8 GPIO_ACTIVE_LOW>; /* gpio104 */ | ||
57 | linux,code = <0x0503003d>; /* KEY_F3 */ | ||
58 | gpio-key,wakeup; | ||
59 | }; | ||
60 | |||
61 | key_f4 { | ||
62 | label = "f4"; | ||
63 | gpios = <&gpio4 9 GPIO_ACTIVE_LOW>; /* gpio105 */ | ||
64 | linux,code = <0x0704003e>; /* KEY_F4 */ | ||
65 | gpio-key,wakeup; | ||
66 | }; | ||
67 | |||
68 | key_left { | ||
69 | label = "left"; | ||
70 | gpios = <&gpio4 10 GPIO_ACTIVE_LOW>; /* gpio106 */ | ||
71 | linux,code = <0x04070069>; /* KEY_LEFT */ | ||
72 | gpio-key,wakeup; | ||
73 | }; | ||
74 | |||
75 | key_right { | ||
76 | label = "right"; | ||
77 | gpios = <&gpio4 11 GPIO_ACTIVE_LOW>; /* gpio107 */ | ||
78 | linux,code = <0x0507006a>; /* KEY_RIGHT */ | ||
79 | gpio-key,wakeup; | ||
80 | }; | ||
81 | |||
82 | key_up { | ||
83 | label = "up"; | ||
84 | gpios = <&gpio4 12 GPIO_ACTIVE_LOW>; /* gpio108 */ | ||
85 | linux,code = <0x06070067>; /* KEY_UP */ | ||
86 | gpio-key,wakeup; | ||
87 | }; | ||
88 | |||
89 | key_down { | ||
90 | label = "down"; | ||
91 | gpios = <&gpio4 13 GPIO_ACTIVE_LOW>; /* gpio109 */ | ||
92 | linux,code = <0x0707006c>; /* KEY_DOWN */ | ||
93 | gpio-key,wakeup; | ||
94 | }; | ||
95 | }; | ||
96 | }; | ||
97 | |||
98 | &gpmc { | ||
99 | ranges = <0 0 0x00000000 0x01000000>, | ||
100 | <1 0 0x08000000 0x01000000>; | ||
101 | |||
102 | nand@0,0 { | ||
103 | linux,mtd-name= "micron,nand"; | ||
104 | reg = <0 0 0>; | ||
105 | nand-bus-width = <16>; | ||
106 | ti,nand-ecc-opt = "bch8"; | ||
107 | |||
108 | gpmc,sync-clk-ps = <0>; | ||
109 | gpmc,cs-on-ns = <0>; | ||
110 | gpmc,cs-rd-off-ns = <44>; | ||
111 | gpmc,cs-wr-off-ns = <44>; | ||
112 | gpmc,adv-on-ns = <6>; | ||
113 | gpmc,adv-rd-off-ns = <34>; | ||
114 | gpmc,adv-wr-off-ns = <44>; | ||
115 | gpmc,we-off-ns = <40>; | ||
116 | gpmc,oe-off-ns = <54>; | ||
117 | gpmc,access-ns = <64>; | ||
118 | gpmc,rd-cycle-ns = <82>; | ||
119 | gpmc,wr-cycle-ns = <82>; | ||
120 | gpmc,wr-access-ns = <40>; | ||
121 | gpmc,wr-data-mux-bus-ns = <0>; | ||
122 | |||
123 | #address-cells = <1>; | ||
124 | #size-cells = <1>; | ||
125 | |||
126 | partition@0 { | ||
127 | label = "X-Loader"; | ||
128 | reg = <0 0x80000>; | ||
129 | }; | ||
130 | partition@80000 { | ||
131 | label = "U-Boot"; | ||
132 | reg = <0x80000 0x140000>; | ||
133 | }; | ||
134 | partition@1c0000 { | ||
135 | label = "Environment"; | ||
136 | reg = <0x1c0000 0x40000>; | ||
137 | }; | ||
138 | partition@200000 { | ||
139 | label = "Kernel"; | ||
140 | reg = <0x200000 0x1e00000>; | ||
141 | }; | ||
142 | partition@2000000 { | ||
143 | label = "Filesystem"; | ||
144 | reg = <0x2000000 0xe000000>; | ||
145 | }; | ||
146 | }; | ||
147 | |||
148 | ethernet@gpmc { | ||
149 | interrupt-parent = <&gpio5>; | ||
150 | interrupts = <24 IRQ_TYPE_LEVEL_LOW>; | ||
151 | reg = <1 0 0xff>; | ||
152 | }; | ||
153 | }; | ||
154 | |||
155 | &i2c1 { | ||
156 | clock-frequency = <2600000>; | ||
157 | |||
158 | twl: twl@48 { | ||
159 | reg = <0x48>; | ||
160 | interrupts = <7>; /* SYS_NIRQ cascaded to intc */ | ||
161 | interrupt-parent = <&intc>; | ||
162 | }; | ||
163 | }; | ||
164 | |||
165 | #include "twl4030.dtsi" | ||
166 | #include "twl4030_omap3.dtsi" | ||
167 | |||
168 | &i2c2 { | ||
169 | clock-frequency = <400000>; | ||
170 | }; | ||
171 | |||
172 | &i2c3 { | ||
173 | clock-frequency = <400000>; | ||
174 | }; | ||
175 | |||
176 | &mmc1 { | ||
177 | vmmc-supply = <&vmmc1>; | ||
178 | bus-width = <4>; | ||
179 | }; | ||
180 | |||
181 | &omap3_pmx_core { | ||
182 | gpio_key_pins: pinmux_gpio_key_pins { | ||
183 | pinctrl-single,pins = < | ||
184 | 0xea (PIN_INPUT | MUX_MODE4) /* cam_d2.gpio_101 */ | ||
185 | 0xec (PIN_INPUT | MUX_MODE4) /* cam_d3.gpio_102 */ | ||
186 | 0xee (PIN_INPUT | MUX_MODE4) /* cam_d4.gpio_103 */ | ||
187 | 0xf0 (PIN_INPUT | MUX_MODE4) /* cam_d5.gpio_104 */ | ||
188 | 0xf2 (PIN_INPUT | MUX_MODE4) /* cam_d6.gpio_105 */ | ||
189 | 0xf4 (PIN_INPUT | MUX_MODE4) /* cam_d7.gpio_106 */ | ||
190 | 0xf6 (PIN_INPUT | MUX_MODE4) /* cam_d8.gpio_107 */ | ||
191 | 0xf8 (PIN_INPUT | MUX_MODE4) /* cam_d9.gpio_108 */ | ||
192 | 0xfa (PIN_INPUT | MUX_MODE4) /* cam_d10.gpio_109 */ | ||
193 | >; | ||
194 | }; | ||
195 | |||
196 | musb_pins: pinmux_musb_pins { | ||
197 | pinctrl-single,pins = < | ||
198 | 0x172 (PIN_INPUT | MUX_MODE0) /* hsusb0_clk.hsusb0_clk */ | ||
199 | 0x17a (PIN_INPUT | MUX_MODE0) /* hsusb0_data0.hsusb0_data0 */ | ||
200 | 0x17c (PIN_INPUT | MUX_MODE0) /* hsusb0_data1.hsusb0_data1 */ | ||
201 | 0x17e (PIN_INPUT | MUX_MODE0) /* hsusb0_data2.hsusb0_data2 */ | ||
202 | 0x180 (PIN_INPUT | MUX_MODE0) /* hsusb0_data3.hsusb0_data3 */ | ||
203 | 0x182 (PIN_INPUT | MUX_MODE0) /* hsusb0_data4.hsusb0_data4 */ | ||
204 | 0x184 (PIN_INPUT | MUX_MODE0) /* hsusb0_data5.hsusb0_data5 */ | ||
205 | 0x186 (PIN_INPUT | MUX_MODE0) /* hsusb0_data6.hsusb0_data6 */ | ||
206 | 0x188 (PIN_INPUT | MUX_MODE0) /* hsusb0_data7.hsusb0_data7 */ | ||
207 | 0x176 (PIN_INPUT | MUX_MODE0) /* hsusb0_dir.hsusb0_dir */ | ||
208 | 0x178 (PIN_INPUT | MUX_MODE0) /* hsusb0_nxt.hsusb0_nxt */ | ||
209 | 0x174 (PIN_OUTPUT | MUX_MODE0) /* hsusb0_stp.hsusb0_stp */ | ||
210 | >; | ||
211 | }; | ||
212 | }; | ||
213 | |||
214 | &usb_otg_hs { | ||
215 | pinctrl-names = "default"; | ||
216 | pinctrl-0 = <&musb_pins>; | ||
217 | interface-type = <0>; | ||
218 | usb-phy = <&usb2_phy>; | ||
219 | mode = <3>; | ||
220 | power = <50>; | ||
221 | }; | ||
222 | |||
223 | &vaux1 { | ||
224 | /* Needed for ads7846 */ | ||
225 | regulator-name = "vcc"; | ||
226 | }; | ||
227 | |||
228 | &vpll2 { | ||
229 | /* Needed for DSS */ | ||
230 | regulator-name = "vdds_dsi"; | ||
231 | }; | ||
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts index c4f20bfe4cce..6fc85f963530 100644 --- a/arch/arm/boot/dts/omap3-n900.dts +++ b/arch/arm/boot/dts/omap3-n900.dts | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | /dts-v1/; | 10 | /dts-v1/; |
11 | 11 | ||
12 | #include "omap34xx.dtsi" | 12 | #include "omap34xx-hs.dtsi" |
13 | 13 | ||
14 | / { | 14 | / { |
15 | model = "Nokia N900"; | 15 | model = "Nokia N900"; |
@@ -125,6 +125,21 @@ | |||
125 | >; | 125 | >; |
126 | }; | 126 | }; |
127 | 127 | ||
128 | mmc2_pins: pinmux_mmc2_pins { | ||
129 | pinctrl-single,pins = < | ||
130 | 0x128 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_clk */ | ||
131 | 0x12a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_cmd */ | ||
132 | 0x12c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat0 */ | ||
133 | 0x12e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat1 */ | ||
134 | 0x130 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat2 */ | ||
135 | 0x132 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3 */ | ||
136 | 0x134 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat4 */ | ||
137 | 0x136 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat5 */ | ||
138 | 0x138 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat6 */ | ||
139 | 0x13a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat7 */ | ||
140 | >; | ||
141 | }; | ||
142 | |||
128 | display_pins: pinmux_display_pins { | 143 | display_pins: pinmux_display_pins { |
129 | pinctrl-single,pins = < | 144 | pinctrl-single,pins = < |
130 | 0x0d4 (PIN_OUTPUT | MUX_MODE4) /* RX51_LCD_RESET_GPIO */ | 145 | 0x0d4 (PIN_OUTPUT | MUX_MODE4) /* RX51_LCD_RESET_GPIO */ |
@@ -358,8 +373,14 @@ | |||
358 | cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */ | 373 | cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */ |
359 | }; | 374 | }; |
360 | 375 | ||
376 | /* most boards use vaux3, only some old versions use vmmc2 instead */ | ||
361 | &mmc2 { | 377 | &mmc2 { |
362 | status = "disabled"; | 378 | pinctrl-names = "default"; |
379 | pinctrl-0 = <&mmc2_pins>; | ||
380 | vmmc-supply = <&vaux3>; | ||
381 | vmmc_aux-supply = <&vsim>; | ||
382 | bus-width = <8>; | ||
383 | non-removable; | ||
363 | }; | 384 | }; |
364 | 385 | ||
365 | &mmc3 { | 386 | &mmc3 { |
diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi index 94eb77d3b9dd..5c26c184f2c1 100644 --- a/arch/arm/boot/dts/omap3-n950-n9.dtsi +++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi | |||
@@ -8,7 +8,7 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include "omap36xx.dtsi" | 11 | #include "omap36xx-hs.dtsi" |
12 | 12 | ||
13 | / { | 13 | / { |
14 | cpus { | 14 | cpus { |
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index f3a0c26ed0c2..daabf99d402a 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi | |||
@@ -82,6 +82,13 @@ | |||
82 | ranges; | 82 | ranges; |
83 | ti,hwmods = "l3_main"; | 83 | ti,hwmods = "l3_main"; |
84 | 84 | ||
85 | aes: aes@480c5000 { | ||
86 | compatible = "ti,omap3-aes"; | ||
87 | ti,hwmods = "aes"; | ||
88 | reg = <0x480c5000 0x50>; | ||
89 | interrupts = <0>; | ||
90 | }; | ||
91 | |||
85 | counter32k: counter@48320000 { | 92 | counter32k: counter@48320000 { |
86 | compatible = "ti,omap-counter32k"; | 93 | compatible = "ti,omap-counter32k"; |
87 | reg = <0x48320000 0x20>; | 94 | reg = <0x48320000 0x20>; |
@@ -260,6 +267,13 @@ | |||
260 | ti,hwmods = "i2c3"; | 267 | ti,hwmods = "i2c3"; |
261 | }; | 268 | }; |
262 | 269 | ||
270 | mailbox: mailbox@48094000 { | ||
271 | compatible = "ti,omap3-mailbox"; | ||
272 | ti,hwmods = "mailbox"; | ||
273 | reg = <0x48094000 0x200>; | ||
274 | interrupts = <26>; | ||
275 | }; | ||
276 | |||
263 | mcspi1: spi@48098000 { | 277 | mcspi1: spi@48098000 { |
264 | compatible = "ti,omap2-mcspi"; | 278 | compatible = "ti,omap2-mcspi"; |
265 | reg = <0x48098000 0x100>; | 279 | reg = <0x48098000 0x100>; |
@@ -357,6 +371,13 @@ | |||
357 | dma-names = "tx", "rx"; | 371 | dma-names = "tx", "rx"; |
358 | }; | 372 | }; |
359 | 373 | ||
374 | mmu_isp: mmu@480bd400 { | ||
375 | compatible = "ti,omap3-mmu-isp"; | ||
376 | ti,hwmods = "mmu_isp"; | ||
377 | reg = <0x480bd400 0x80>; | ||
378 | interrupts = <8>; | ||
379 | }; | ||
380 | |||
360 | wdt2: wdt@48314000 { | 381 | wdt2: wdt@48314000 { |
361 | compatible = "ti,omap3-wdt"; | 382 | compatible = "ti,omap3-wdt"; |
362 | reg = <0x48314000 0x80>; | 383 | reg = <0x48314000 0x80>; |
@@ -442,6 +463,27 @@ | |||
442 | dma-names = "tx", "rx"; | 463 | dma-names = "tx", "rx"; |
443 | }; | 464 | }; |
444 | 465 | ||
466 | sham: sham@480c3000 { | ||
467 | compatible = "ti,omap3-sham"; | ||
468 | ti,hwmods = "sham"; | ||
469 | reg = <0x480c3000 0x64>; | ||
470 | interrupts = <49>; | ||
471 | }; | ||
472 | |||
473 | smartreflex_core: smartreflex@480cb000 { | ||
474 | compatible = "ti,omap3-smartreflex-core"; | ||
475 | ti,hwmods = "smartreflex_core"; | ||
476 | reg = <0x480cb000 0x400>; | ||
477 | interrupts = <19>; | ||
478 | }; | ||
479 | |||
480 | smartreflex_mpu_iva: smartreflex@480c9000 { | ||
481 | compatible = "ti,omap3-smartreflex-iva"; | ||
482 | ti,hwmods = "smartreflex_mpu_iva"; | ||
483 | reg = <0x480c9000 0x400>; | ||
484 | interrupts = <18>; | ||
485 | }; | ||
486 | |||
445 | timer1: timer@48318000 { | 487 | timer1: timer@48318000 { |
446 | compatible = "ti,omap3430-timer"; | 488 | compatible = "ti,omap3430-timer"; |
447 | reg = <0x48318000 0x400>; | 489 | reg = <0x48318000 0x400>; |
diff --git a/arch/arm/boot/dts/omap34xx-hs.dtsi b/arch/arm/boot/dts/omap34xx-hs.dtsi new file mode 100644 index 000000000000..1ff626489546 --- /dev/null +++ b/arch/arm/boot/dts/omap34xx-hs.dtsi | |||
@@ -0,0 +1,16 @@ | |||
1 | /* Disabled modules for secure omaps */ | ||
2 | |||
3 | #include "omap34xx.dtsi" | ||
4 | |||
5 | /* Secure omaps have some devices inaccessible depending on the firmware */ | ||
6 | &aes { | ||
7 | status = "disabled"; | ||
8 | }; | ||
9 | |||
10 | &sham { | ||
11 | status = "disabled"; | ||
12 | }; | ||
13 | |||
14 | &timer12 { | ||
15 | status = "disabled"; | ||
16 | }; | ||
diff --git a/arch/arm/boot/dts/omap36xx-hs.dtsi b/arch/arm/boot/dts/omap36xx-hs.dtsi new file mode 100644 index 000000000000..2c7febb0e016 --- /dev/null +++ b/arch/arm/boot/dts/omap36xx-hs.dtsi | |||
@@ -0,0 +1,16 @@ | |||
1 | /* Disabled modules for secure omaps */ | ||
2 | |||
3 | #include "omap36xx.dtsi" | ||
4 | |||
5 | /* Secure omaps have some devices inaccessible depending on the firmware */ | ||
6 | &aes { | ||
7 | status = "disabled"; | ||
8 | }; | ||
9 | |||
10 | &sham { | ||
11 | status = "disabled"; | ||
12 | }; | ||
13 | |||
14 | &timer12 { | ||
15 | status = "disabled"; | ||
16 | }; | ||
diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi index 298e85020e1b..88c6a05cab41 100644 --- a/arch/arm/boot/dts/omap4-panda-common.dtsi +++ b/arch/arm/boot/dts/omap4-panda-common.dtsi | |||
@@ -246,15 +246,6 @@ | |||
246 | 0xf0 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c4_sda */ | 246 | 0xf0 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c4_sda */ |
247 | >; | 247 | >; |
248 | }; | 248 | }; |
249 | }; | ||
250 | |||
251 | &omap4_pmx_wkup { | ||
252 | led_wkgpio_pins: pinmux_leds_wkpins { | ||
253 | pinctrl-single,pins = < | ||
254 | 0x1a (PIN_OUTPUT | MUX_MODE3) /* gpio_wk7 */ | ||
255 | 0x1c (PIN_OUTPUT | MUX_MODE3) /* gpio_wk8 */ | ||
256 | >; | ||
257 | }; | ||
258 | 249 | ||
259 | /* | 250 | /* |
260 | * wl12xx GPIO outputs for WLAN_EN, BT_EN, FM_EN, BT_WAKEUP | 251 | * wl12xx GPIO outputs for WLAN_EN, BT_EN, FM_EN, BT_WAKEUP |
@@ -274,7 +265,7 @@ | |||
274 | pinctrl-single,pins = < | 265 | pinctrl-single,pins = < |
275 | 0x38 (PIN_INPUT | MUX_MODE3) /* gpmc_ncs2.gpio_52 */ | 266 | 0x38 (PIN_INPUT | MUX_MODE3) /* gpmc_ncs2.gpio_52 */ |
276 | 0x3a (PIN_INPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */ | 267 | 0x3a (PIN_INPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */ |
277 | 0x108 (PIN_OUTPUT | MUX_MODE0) /* sdmmc5_clk.sdmmc5_clk */ | 268 | 0x108 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_clk.sdmmc5_clk */ |
278 | 0x10a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_cmd.sdmmc5_cmd */ | 269 | 0x10a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_cmd.sdmmc5_cmd */ |
279 | 0x10c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat0.sdmmc5_dat0 */ | 270 | 0x10c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat0.sdmmc5_dat0 */ |
280 | 0x10e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat1.sdmmc5_dat1 */ | 271 | 0x10e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat1.sdmmc5_dat1 */ |
@@ -284,6 +275,15 @@ | |||
284 | }; | 275 | }; |
285 | }; | 276 | }; |
286 | 277 | ||
278 | &omap4_pmx_wkup { | ||
279 | led_wkgpio_pins: pinmux_leds_wkpins { | ||
280 | pinctrl-single,pins = < | ||
281 | 0x1a (PIN_OUTPUT | MUX_MODE3) /* gpio_wk7 */ | ||
282 | 0x1c (PIN_OUTPUT | MUX_MODE3) /* gpio_wk8 */ | ||
283 | >; | ||
284 | }; | ||
285 | }; | ||
286 | |||
287 | &i2c1 { | 287 | &i2c1 { |
288 | pinctrl-names = "default"; | 288 | pinctrl-names = "default"; |
289 | pinctrl-0 = <&i2c1_pins>; | 289 | pinctrl-0 = <&i2c1_pins>; |
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts index 5fc3f43c5a81..dbc81fb6ef03 100644 --- a/arch/arm/boot/dts/omap4-sdp.dts +++ b/arch/arm/boot/dts/omap4-sdp.dts | |||
@@ -300,12 +300,12 @@ | |||
300 | wl12xx_pins: pinmux_wl12xx_pins { | 300 | wl12xx_pins: pinmux_wl12xx_pins { |
301 | pinctrl-single,pins = < | 301 | pinctrl-single,pins = < |
302 | 0x3a (PIN_INPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */ | 302 | 0x3a (PIN_INPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */ |
303 | 0x108 (PIN_OUTPUT | MUX_MODE3) /* sdmmc5_clk.sdmmc5_clk */ | 303 | 0x108 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_clk.sdmmc5_clk */ |
304 | 0x10a (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_cmd.sdmmc5_cmd */ | 304 | 0x10a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_cmd.sdmmc5_cmd */ |
305 | 0x10c (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat0.sdmmc5_dat0 */ | 305 | 0x10c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat0.sdmmc5_dat0 */ |
306 | 0x10e (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat1.sdmmc5_dat1 */ | 306 | 0x10e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat1.sdmmc5_dat1 */ |
307 | 0x110 (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat2.sdmmc5_dat2 */ | 307 | 0x110 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat2.sdmmc5_dat2 */ |
308 | 0x112 (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat3.sdmmc5_dat3 */ | 308 | 0x112 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat3.sdmmc5_dat3 */ |
309 | >; | 309 | >; |
310 | }; | 310 | }; |
311 | }; | 311 | }; |
diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi index 6d09b8d42fdd..f936476c2753 100644 --- a/arch/arm/boot/dts/socfpga.dtsi +++ b/arch/arm/boot/dts/socfpga.dtsi | |||
@@ -245,14 +245,14 @@ | |||
245 | 245 | ||
246 | mpu_periph_clk: mpu_periph_clk { | 246 | mpu_periph_clk: mpu_periph_clk { |
247 | #clock-cells = <0>; | 247 | #clock-cells = <0>; |
248 | compatible = "altr,socfpga-gate-clk"; | 248 | compatible = "altr,socfpga-perip-clk"; |
249 | clocks = <&mpuclk>; | 249 | clocks = <&mpuclk>; |
250 | fixed-divider = <4>; | 250 | fixed-divider = <4>; |
251 | }; | 251 | }; |
252 | 252 | ||
253 | mpu_l2_ram_clk: mpu_l2_ram_clk { | 253 | mpu_l2_ram_clk: mpu_l2_ram_clk { |
254 | #clock-cells = <0>; | 254 | #clock-cells = <0>; |
255 | compatible = "altr,socfpga-gate-clk"; | 255 | compatible = "altr,socfpga-perip-clk"; |
256 | clocks = <&mpuclk>; | 256 | clocks = <&mpuclk>; |
257 | fixed-divider = <2>; | 257 | fixed-divider = <2>; |
258 | }; | 258 | }; |
@@ -266,8 +266,9 @@ | |||
266 | 266 | ||
267 | l3_main_clk: l3_main_clk { | 267 | l3_main_clk: l3_main_clk { |
268 | #clock-cells = <0>; | 268 | #clock-cells = <0>; |
269 | compatible = "altr,socfpga-gate-clk"; | 269 | compatible = "altr,socfpga-perip-clk"; |
270 | clocks = <&mainclk>; | 270 | clocks = <&mainclk>; |
271 | fixed-divider = <1>; | ||
271 | }; | 272 | }; |
272 | 273 | ||
273 | l3_mp_clk: l3_mp_clk { | 274 | l3_mp_clk: l3_mp_clk { |
diff --git a/arch/arm/configs/bockw_defconfig b/arch/arm/configs/bockw_defconfig index b38cd107f82d..8110d8a653f7 100644 --- a/arch/arm/configs/bockw_defconfig +++ b/arch/arm/configs/bockw_defconfig | |||
@@ -27,12 +27,12 @@ CONFIG_HIGHMEM=y | |||
27 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 27 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
28 | CONFIG_ZBOOT_ROM_BSS=0x0 | 28 | CONFIG_ZBOOT_ROM_BSS=0x0 |
29 | CONFIG_ARM_APPENDED_DTB=y | 29 | CONFIG_ARM_APPENDED_DTB=y |
30 | CONFIG_CMDLINE="console=ttySC0,115200 ignore_loglevel root=/dev/nfs ip=dhcp" | 30 | CONFIG_VFP=y |
31 | CONFIG_CMDLINE_FORCE=y | ||
32 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | 31 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set |
33 | # CONFIG_SUSPEND is not set | 32 | # CONFIG_SUSPEND is not set |
34 | CONFIG_PM_RUNTIME=y | 33 | CONFIG_PM_RUNTIME=y |
35 | CONFIG_NET=y | 34 | CONFIG_NET=y |
35 | CONFIG_PACKET=y | ||
36 | CONFIG_UNIX=y | 36 | CONFIG_UNIX=y |
37 | CONFIG_INET=y | 37 | CONFIG_INET=y |
38 | CONFIG_IP_PNP=y | 38 | CONFIG_IP_PNP=y |
@@ -44,8 +44,6 @@ CONFIG_IP_PNP_DHCP=y | |||
44 | # CONFIG_INET_DIAG is not set | 44 | # CONFIG_INET_DIAG is not set |
45 | # CONFIG_IPV6 is not set | 45 | # CONFIG_IPV6 is not set |
46 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 46 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
47 | CONFIG_DEVTMPFS=y | ||
48 | CONFIG_DEVTMPFS_MOUNT=y | ||
49 | # CONFIG_STANDALONE is not set | 47 | # CONFIG_STANDALONE is not set |
50 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | 48 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set |
51 | # CONFIG_FW_LOADER is not set | 49 | # CONFIG_FW_LOADER is not set |
@@ -82,6 +80,7 @@ CONFIG_SERIAL_SH_SCI_CONSOLE=y | |||
82 | # CONFIG_HWMON is not set | 80 | # CONFIG_HWMON is not set |
83 | CONFIG_I2C=y | 81 | CONFIG_I2C=y |
84 | CONFIG_I2C_RCAR=y | 82 | CONFIG_I2C_RCAR=y |
83 | CONFIG_REGULATOR=y | ||
85 | CONFIG_MEDIA_SUPPORT=y | 84 | CONFIG_MEDIA_SUPPORT=y |
86 | CONFIG_MEDIA_CAMERA_SUPPORT=y | 85 | CONFIG_MEDIA_CAMERA_SUPPORT=y |
87 | CONFIG_V4L_PLATFORM_DRIVERS=y | 86 | CONFIG_V4L_PLATFORM_DRIVERS=y |
@@ -108,11 +107,12 @@ CONFIG_MMC_SDHI=y | |||
108 | CONFIG_MMC_SH_MMCIF=y | 107 | CONFIG_MMC_SH_MMCIF=y |
109 | CONFIG_RTC_CLASS=y | 108 | CONFIG_RTC_CLASS=y |
110 | CONFIG_RTC_DRV_RX8581=y | 109 | CONFIG_RTC_DRV_RX8581=y |
110 | CONFIG_DMADEVICES=y | ||
111 | CONFIG_RCAR_HPB_DMAE=y | ||
111 | CONFIG_UIO=y | 112 | CONFIG_UIO=y |
112 | CONFIG_UIO_PDRV_GENIRQ=y | 113 | CONFIG_UIO_PDRV_GENIRQ=y |
113 | # CONFIG_IOMMU_SUPPORT is not set | 114 | # CONFIG_IOMMU_SUPPORT is not set |
114 | # CONFIG_DNOTIFY is not set | 115 | # CONFIG_DNOTIFY is not set |
115 | # CONFIG_INOTIFY_USER is not set | ||
116 | CONFIG_TMPFS=y | 116 | CONFIG_TMPFS=y |
117 | # CONFIG_MISC_FILESYSTEMS is not set | 117 | # CONFIG_MISC_FILESYSTEMS is not set |
118 | CONFIG_NFS_FS=y | 118 | CONFIG_NFS_FS=y |
diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig index ad7dfbbafa45..aec8a3ea1436 100644 --- a/arch/arm/configs/exynos_defconfig +++ b/arch/arm/configs/exynos_defconfig | |||
@@ -13,7 +13,7 @@ CONFIG_S3C24XX_PWM=y | |||
13 | CONFIG_ARCH_EXYNOS5=y | 13 | CONFIG_ARCH_EXYNOS5=y |
14 | CONFIG_MACH_EXYNOS4_DT=y | 14 | CONFIG_MACH_EXYNOS4_DT=y |
15 | CONFIG_SMP=y | 15 | CONFIG_SMP=y |
16 | CONFIG_NR_CPUS=2 | 16 | CONFIG_NR_CPUS=8 |
17 | CONFIG_PREEMPT=y | 17 | CONFIG_PREEMPT=y |
18 | CONFIG_AEABI=y | 18 | CONFIG_AEABI=y |
19 | CONFIG_HIGHMEM=y | 19 | CONFIG_HIGHMEM=y |
diff --git a/arch/arm/configs/genmai_defconfig b/arch/arm/configs/genmai_defconfig new file mode 100644 index 000000000000..69b1531a4c80 --- /dev/null +++ b/arch/arm/configs/genmai_defconfig | |||
@@ -0,0 +1,116 @@ | |||
1 | CONFIG_SYSVIPC=y | ||
2 | CONFIG_NO_HZ=y | ||
3 | CONFIG_IKCONFIG=y | ||
4 | CONFIG_IKCONFIG_PROC=y | ||
5 | CONFIG_LOG_BUF_SHIFT=16 | ||
6 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
7 | CONFIG_SYSCTL_SYSCALL=y | ||
8 | CONFIG_EMBEDDED=y | ||
9 | CONFIG_PERF_EVENTS=y | ||
10 | CONFIG_SLAB=y | ||
11 | # CONFIG_LBDAF is not set | ||
12 | # CONFIG_BLK_DEV_BSG is not set | ||
13 | # CONFIG_IOSCHED_DEADLINE is not set | ||
14 | # CONFIG_IOSCHED_CFQ is not set | ||
15 | CONFIG_ARCH_SHMOBILE=y | ||
16 | CONFIG_ARCH_R7S72100=y | ||
17 | CONFIG_MACH_GENMAI=y | ||
18 | # CONFIG_SH_TIMER_CMT is not set | ||
19 | # CONFIG_SH_TIMER_MTU2 is not set | ||
20 | # CONFIG_SH_TIMER_TMU is not set | ||
21 | # CONFIG_EM_TIMER_STI is not set | ||
22 | CONFIG_ARM_ERRATA_430973=y | ||
23 | CONFIG_ARM_ERRATA_458693=y | ||
24 | CONFIG_ARM_ERRATA_460075=y | ||
25 | CONFIG_ARM_ERRATA_743622=y | ||
26 | CONFIG_ARM_ERRATA_754322=y | ||
27 | CONFIG_AEABI=y | ||
28 | # CONFIG_OABI_COMPAT is not set | ||
29 | CONFIG_FORCE_MAX_ZONEORDER=13 | ||
30 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
31 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
32 | CONFIG_ARM_APPENDED_DTB=y | ||
33 | CONFIG_KEXEC=y | ||
34 | CONFIG_AUTO_ZRELADDR=y | ||
35 | CONFIG_VFP=y | ||
36 | CONFIG_NEON=y | ||
37 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
38 | CONFIG_PM_RUNTIME=y | ||
39 | CONFIG_NET=y | ||
40 | CONFIG_PACKET=y | ||
41 | CONFIG_UNIX=y | ||
42 | CONFIG_INET=y | ||
43 | CONFIG_IP_PNP=y | ||
44 | CONFIG_IP_PNP_DHCP=y | ||
45 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
46 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
47 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
48 | # CONFIG_INET_LRO is not set | ||
49 | # CONFIG_INET_DIAG is not set | ||
50 | # CONFIG_IPV6 is not set | ||
51 | # CONFIG_WIRELESS is not set | ||
52 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
53 | CONFIG_NETDEVICES=y | ||
54 | # CONFIG_NET_CORE is not set | ||
55 | # CONFIG_NET_VENDOR_ARC is not set | ||
56 | # CONFIG_NET_CADENCE is not set | ||
57 | # CONFIG_NET_VENDOR_BROADCOM is not set | ||
58 | # CONFIG_NET_VENDOR_CIRRUS is not set | ||
59 | # CONFIG_NET_VENDOR_FARADAY is not set | ||
60 | # CONFIG_NET_VENDOR_INTEL is not set | ||
61 | # CONFIG_NET_VENDOR_MARVELL is not set | ||
62 | # CONFIG_NET_VENDOR_MICREL is not set | ||
63 | # CONFIG_NET_VENDOR_NATSEMI is not set | ||
64 | CONFIG_SH_ETH=y | ||
65 | # CONFIG_NET_VENDOR_SEEQ is not set | ||
66 | # CONFIG_NET_VENDOR_SMSC is not set | ||
67 | # CONFIG_NET_VENDOR_STMICRO is not set | ||
68 | # CONFIG_NET_VENDOR_VIA is not set | ||
69 | # CONFIG_NET_VENDOR_WIZNET is not set | ||
70 | # CONFIG_WLAN is not set | ||
71 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
72 | CONFIG_INPUT_EVDEV=y | ||
73 | # CONFIG_KEYBOARD_ATKBD is not set | ||
74 | # CONFIG_INPUT_MOUSE is not set | ||
75 | # CONFIG_SERIO is not set | ||
76 | # CONFIG_LEGACY_PTYS is not set | ||
77 | CONFIG_SERIAL_SH_SCI=y | ||
78 | CONFIG_SERIAL_SH_SCI_NR_UARTS=10 | ||
79 | CONFIG_SERIAL_SH_SCI_CONSOLE=y | ||
80 | # CONFIG_HW_RANDOM is not set | ||
81 | CONFIG_I2C_SH_MOBILE=y | ||
82 | # CONFIG_HWMON is not set | ||
83 | CONFIG_THERMAL=y | ||
84 | CONFIG_RCAR_THERMAL=y | ||
85 | CONFIG_REGULATOR=y | ||
86 | CONFIG_REGULATOR_FIXED_VOLTAGE=y | ||
87 | CONFIG_DRM=y | ||
88 | CONFIG_DRM_RCAR_DU=y | ||
89 | # CONFIG_USB_SUPPORT is not set | ||
90 | CONFIG_MMC=y | ||
91 | CONFIG_MMC_SDHI=y | ||
92 | CONFIG_MMC_SH_MMCIF=y | ||
93 | CONFIG_NEW_LEDS=y | ||
94 | CONFIG_LEDS_CLASS=y | ||
95 | CONFIG_RTC_CLASS=y | ||
96 | CONFIG_DMADEVICES=y | ||
97 | CONFIG_SH_DMAE=y | ||
98 | # CONFIG_IOMMU_SUPPORT is not set | ||
99 | # CONFIG_DNOTIFY is not set | ||
100 | CONFIG_MSDOS_FS=y | ||
101 | CONFIG_VFAT_FS=y | ||
102 | CONFIG_TMPFS=y | ||
103 | CONFIG_CONFIGFS_FS=y | ||
104 | # CONFIG_MISC_FILESYSTEMS is not set | ||
105 | CONFIG_NFS_FS=y | ||
106 | CONFIG_NFS_V3_ACL=y | ||
107 | CONFIG_NFS_V4=y | ||
108 | CONFIG_NFS_V4_1=y | ||
109 | CONFIG_ROOT_NFS=y | ||
110 | CONFIG_NLS_CODEPAGE_437=y | ||
111 | CONFIG_NLS_ISO8859_1=y | ||
112 | # CONFIG_ENABLE_WARN_DEPRECATED is not set | ||
113 | # CONFIG_ENABLE_MUST_CHECK is not set | ||
114 | # CONFIG_ARM_UNWIND is not set | ||
115 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | ||
116 | # CONFIG_CRYPTO_HW is not set | ||
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig index 0ae0eaebf6b2..2e762d94e94b 100644 --- a/arch/arm/configs/kirkwood_defconfig +++ b/arch/arm/configs/kirkwood_defconfig | |||
@@ -27,6 +27,7 @@ CONFIG_PCI_MVEBU=y | |||
27 | CONFIG_PREEMPT=y | 27 | CONFIG_PREEMPT=y |
28 | CONFIG_AEABI=y | 28 | CONFIG_AEABI=y |
29 | # CONFIG_OABI_COMPAT is not set | 29 | # CONFIG_OABI_COMPAT is not set |
30 | CONFIG_HIGHMEM=y | ||
30 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 31 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
31 | CONFIG_ZBOOT_ROM_BSS=0x0 | 32 | CONFIG_ZBOOT_ROM_BSS=0x0 |
32 | CONFIG_CPU_FREQ=y | 33 | CONFIG_CPU_FREQ=y |
diff --git a/arch/arm/configs/kzm9d_defconfig b/arch/arm/configs/kzm9d_defconfig index 6c37f4a98eb8..e6aed23ac083 100644 --- a/arch/arm/configs/kzm9d_defconfig +++ b/arch/arm/configs/kzm9d_defconfig | |||
@@ -32,6 +32,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13 | |||
32 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 32 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
33 | CONFIG_ZBOOT_ROM_BSS=0x0 | 33 | CONFIG_ZBOOT_ROM_BSS=0x0 |
34 | CONFIG_ARM_APPENDED_DTB=y | 34 | CONFIG_ARM_APPENDED_DTB=y |
35 | CONFIG_AUTO_ZRELADDR=y | ||
35 | CONFIG_VFP=y | 36 | CONFIG_VFP=y |
36 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | 37 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set |
37 | CONFIG_PM_RUNTIME=y | 38 | CONFIG_PM_RUNTIME=y |
diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig index 5cc6360340b1..dd4aced59d3c 100644 --- a/arch/arm/configs/marzen_defconfig +++ b/arch/arm/configs/marzen_defconfig | |||
@@ -30,12 +30,12 @@ CONFIG_HIGHMEM=y | |||
30 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 30 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
31 | CONFIG_ZBOOT_ROM_BSS=0x0 | 31 | CONFIG_ZBOOT_ROM_BSS=0x0 |
32 | CONFIG_ARM_APPENDED_DTB=y | 32 | CONFIG_ARM_APPENDED_DTB=y |
33 | CONFIG_CMDLINE="console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on" | 33 | CONFIG_VFP=y |
34 | CONFIG_CMDLINE_FORCE=y | ||
35 | CONFIG_KEXEC=y | 34 | CONFIG_KEXEC=y |
36 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | 35 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set |
37 | CONFIG_PM_RUNTIME=y | 36 | CONFIG_PM_RUNTIME=y |
38 | CONFIG_NET=y | 37 | CONFIG_NET=y |
38 | CONFIG_PACKET=y | ||
39 | CONFIG_UNIX=y | 39 | CONFIG_UNIX=y |
40 | CONFIG_INET=y | 40 | CONFIG_INET=y |
41 | CONFIG_IP_PNP=y | 41 | CONFIG_IP_PNP=y |
@@ -43,8 +43,6 @@ CONFIG_IP_PNP_DHCP=y | |||
43 | # CONFIG_IPV6 is not set | 43 | # CONFIG_IPV6 is not set |
44 | # CONFIG_WIRELESS is not set | 44 | # CONFIG_WIRELESS is not set |
45 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 45 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
46 | CONFIG_DEVTMPFS=y | ||
47 | CONFIG_DEVTMPFS_MOUNT=y | ||
48 | # CONFIG_STANDALONE is not set | 46 | # CONFIG_STANDALONE is not set |
49 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | 47 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set |
50 | # CONFIG_FW_LOADER is not set | 48 | # CONFIG_FW_LOADER is not set |
@@ -61,7 +59,6 @@ CONFIG_NETDEVICES=y | |||
61 | # CONFIG_NET_VENDOR_MICREL is not set | 59 | # CONFIG_NET_VENDOR_MICREL is not set |
62 | # CONFIG_NET_VENDOR_NATSEMI is not set | 60 | # CONFIG_NET_VENDOR_NATSEMI is not set |
63 | # CONFIG_NET_VENDOR_SEEQ is not set | 61 | # CONFIG_NET_VENDOR_SEEQ is not set |
64 | CONFIG_SMC911X=y | ||
65 | CONFIG_SMSC911X=y | 62 | CONFIG_SMSC911X=y |
66 | # CONFIG_NET_VENDOR_STMICRO is not set | 63 | # CONFIG_NET_VENDOR_STMICRO is not set |
67 | # CONFIG_WLAN is not set | 64 | # CONFIG_WLAN is not set |
@@ -106,11 +103,12 @@ CONFIG_USB_STORAGE=y | |||
106 | CONFIG_NEW_LEDS=y | 103 | CONFIG_NEW_LEDS=y |
107 | CONFIG_LEDS_CLASS=y | 104 | CONFIG_LEDS_CLASS=y |
108 | CONFIG_LEDS_GPIO=y | 105 | CONFIG_LEDS_GPIO=y |
106 | CONFIG_DMADEVICES=y | ||
107 | CONFIG_RCAR_HPB_DMAE=y | ||
109 | CONFIG_UIO=y | 108 | CONFIG_UIO=y |
110 | CONFIG_UIO_PDRV_GENIRQ=y | 109 | CONFIG_UIO_PDRV_GENIRQ=y |
111 | # CONFIG_IOMMU_SUPPORT is not set | 110 | # CONFIG_IOMMU_SUPPORT is not set |
112 | # CONFIG_DNOTIFY is not set | 111 | # CONFIG_DNOTIFY is not set |
113 | # CONFIG_INOTIFY_USER is not set | ||
114 | CONFIG_TMPFS=y | 112 | CONFIG_TMPFS=y |
115 | # CONFIG_MISC_FILESYSTEMS is not set | 113 | # CONFIG_MISC_FILESYSTEMS is not set |
116 | CONFIG_NFS_FS=y | 114 | CONFIG_NFS_FS=y |
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 4a5903e04827..cdb85cb6b3b0 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig | |||
@@ -68,7 +68,9 @@ CONFIG_NET_CALXEDA_XGMAC=y | |||
68 | CONFIG_KS8851=y | 68 | CONFIG_KS8851=y |
69 | CONFIG_SMSC911X=y | 69 | CONFIG_SMSC911X=y |
70 | CONFIG_STMMAC_ETH=y | 70 | CONFIG_STMMAC_ETH=y |
71 | CONFIG_ICPLUS_PHY=y | ||
71 | CONFIG_MDIO_SUN4I=y | 72 | CONFIG_MDIO_SUN4I=y |
73 | CONFIG_TI_CPSW=y | ||
72 | CONFIG_KEYBOARD_SPEAR=y | 74 | CONFIG_KEYBOARD_SPEAR=y |
73 | CONFIG_SERIO_AMBAKMI=y | 75 | CONFIG_SERIO_AMBAKMI=y |
74 | CONFIG_SERIAL_8250=y | 76 | CONFIG_SERIAL_8250=y |
@@ -90,6 +92,8 @@ CONFIG_SERIAL_XILINX_PS_UART=y | |||
90 | CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y | 92 | CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y |
91 | CONFIG_SERIAL_FSL_LPUART=y | 93 | CONFIG_SERIAL_FSL_LPUART=y |
92 | CONFIG_SERIAL_FSL_LPUART_CONSOLE=y | 94 | CONFIG_SERIAL_FSL_LPUART_CONSOLE=y |
95 | CONFIG_SERIAL_ST_ASC=y | ||
96 | CONFIG_SERIAL_ST_ASC_CONSOLE=y | ||
93 | CONFIG_I2C_DESIGNWARE_PLATFORM=y | 97 | CONFIG_I2C_DESIGNWARE_PLATFORM=y |
94 | CONFIG_I2C_SIRF=y | 98 | CONFIG_I2C_SIRF=y |
95 | CONFIG_I2C_TEGRA=y | 99 | CONFIG_I2C_TEGRA=y |
@@ -133,12 +137,14 @@ CONFIG_USB_GPIO_VBUS=y | |||
133 | CONFIG_USB_ISP1301=y | 137 | CONFIG_USB_ISP1301=y |
134 | CONFIG_USB_MXS_PHY=y | 138 | CONFIG_USB_MXS_PHY=y |
135 | CONFIG_MMC=y | 139 | CONFIG_MMC=y |
140 | CONFIG_MMC_BLOCK_MINORS=16 | ||
136 | CONFIG_MMC_ARMMMCI=y | 141 | CONFIG_MMC_ARMMMCI=y |
137 | CONFIG_MMC_SDHCI=y | 142 | CONFIG_MMC_SDHCI=y |
138 | CONFIG_MMC_SDHCI_PLTFM=y | 143 | CONFIG_MMC_SDHCI_PLTFM=y |
139 | CONFIG_MMC_SDHCI_ESDHC_IMX=y | 144 | CONFIG_MMC_SDHCI_ESDHC_IMX=y |
140 | CONFIG_MMC_SDHCI_TEGRA=y | 145 | CONFIG_MMC_SDHCI_TEGRA=y |
141 | CONFIG_MMC_SDHCI_SPEAR=y | 146 | CONFIG_MMC_SDHCI_SPEAR=y |
147 | CONFIG_MMC_SDHCI_BCM_KONA=y | ||
142 | CONFIG_MMC_OMAP=y | 148 | CONFIG_MMC_OMAP=y |
143 | CONFIG_MMC_OMAP_HS=y | 149 | CONFIG_MMC_OMAP_HS=y |
144 | CONFIG_EDAC=y | 150 | CONFIG_EDAC=y |
diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_defconfig index 594d706b641f..0f4511d2849f 100644 --- a/arch/arm/configs/mvebu_defconfig +++ b/arch/arm/configs/mvebu_defconfig | |||
@@ -55,6 +55,8 @@ CONFIG_MTD_CFI_INTELEXT=y | |||
55 | CONFIG_MTD_CFI_AMDSTD=y | 55 | CONFIG_MTD_CFI_AMDSTD=y |
56 | CONFIG_MTD_CFI_STAA=y | 56 | CONFIG_MTD_CFI_STAA=y |
57 | CONFIG_MTD_PHYSMAP_OF=y | 57 | CONFIG_MTD_PHYSMAP_OF=y |
58 | CONFIG_MTD_NAND=y | ||
59 | CONFIG_MTD_NAND_PXA3xx=y | ||
58 | CONFIG_SERIAL_8250_DW=y | 60 | CONFIG_SERIAL_8250_DW=y |
59 | CONFIG_GPIOLIB=y | 61 | CONFIG_GPIOLIB=y |
60 | CONFIG_GPIO_SYSFS=y | 62 | CONFIG_GPIO_SYSFS=y |
@@ -69,6 +71,7 @@ CONFIG_USB_XHCI_HCD=y | |||
69 | CONFIG_MMC=y | 71 | CONFIG_MMC=y |
70 | CONFIG_MMC_MVSDIO=y | 72 | CONFIG_MMC_MVSDIO=y |
71 | CONFIG_NEW_LEDS=y | 73 | CONFIG_NEW_LEDS=y |
74 | CONFIG_LEDS_GPIO=y | ||
72 | CONFIG_LEDS_CLASS=m | 75 | CONFIG_LEDS_CLASS=m |
73 | CONFIG_LEDS_TRIGGERS=y | 76 | CONFIG_LEDS_TRIGGERS=y |
74 | CONFIG_LEDS_TRIGGER_TIMER=y | 77 | CONFIG_LEDS_TRIGGER_TIMER=y |
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig index 98a50c309b90..bfa80a11e8c7 100644 --- a/arch/arm/configs/omap2plus_defconfig +++ b/arch/arm/configs/omap2plus_defconfig | |||
@@ -173,6 +173,7 @@ CONFIG_MFD_PALMAS=y | |||
173 | CONFIG_MFD_TPS65217=y | 173 | CONFIG_MFD_TPS65217=y |
174 | CONFIG_MFD_TPS65910=y | 174 | CONFIG_MFD_TPS65910=y |
175 | CONFIG_TWL6040_CORE=y | 175 | CONFIG_TWL6040_CORE=y |
176 | CONFIG_REGULATOR_FIXED_VOLTAGE=y | ||
176 | CONFIG_REGULATOR_PALMAS=y | 177 | CONFIG_REGULATOR_PALMAS=y |
177 | CONFIG_REGULATOR_TPS65023=y | 178 | CONFIG_REGULATOR_TPS65023=y |
178 | CONFIG_REGULATOR_TPS6507X=y | 179 | CONFIG_REGULATOR_TPS6507X=y |
diff --git a/arch/arm/configs/sunxi_defconfig b/arch/arm/configs/sunxi_defconfig index d57a85badb5e..3e2259b60236 100644 --- a/arch/arm/configs/sunxi_defconfig +++ b/arch/arm/configs/sunxi_defconfig | |||
@@ -12,6 +12,9 @@ CONFIG_NET=y | |||
12 | CONFIG_PACKET=y | 12 | CONFIG_PACKET=y |
13 | CONFIG_UNIX=y | 13 | CONFIG_UNIX=y |
14 | CONFIG_INET=y | 14 | CONFIG_INET=y |
15 | CONFIG_IP_PNP=y | ||
16 | CONFIG_IP_PNP_DHCP=y | ||
17 | CONFIG_IP_PNP_BOOTP=y | ||
15 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | 18 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set |
16 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | 19 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set |
17 | # CONFIG_INET_XFRM_MODE_BEET is not set | 20 | # CONFIG_INET_XFRM_MODE_BEET is not set |
@@ -58,4 +61,8 @@ CONFIG_LEDS_TRIGGER_HEARTBEAT=y | |||
58 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | 61 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y |
59 | CONFIG_COMMON_CLK_DEBUG=y | 62 | CONFIG_COMMON_CLK_DEBUG=y |
60 | # CONFIG_IOMMU_SUPPORT is not set | 63 | # CONFIG_IOMMU_SUPPORT is not set |
64 | CONFIG_TMPFS=y | ||
65 | CONFIG_NFS_FS=y | ||
66 | CONFIG_ROOT_NFS=y | ||
61 | CONFIG_NLS=y | 67 | CONFIG_NLS=y |
68 | CONFIG_PRINTK_TIME=y | ||
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig index ac632cc38f24..c6ebc184bf68 100644 --- a/arch/arm/configs/u8500_defconfig +++ b/arch/arm/configs/u8500_defconfig | |||
@@ -22,6 +22,7 @@ CONFIG_CMDLINE="root=/dev/ram0 console=ttyAMA2,115200n8" | |||
22 | CONFIG_CPU_FREQ=y | 22 | CONFIG_CPU_FREQ=y |
23 | CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y | 23 | CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y |
24 | CONFIG_CPU_IDLE=y | 24 | CONFIG_CPU_IDLE=y |
25 | CONFIG_ARM_U8500_CPUIDLE=y | ||
25 | CONFIG_VFP=y | 26 | CONFIG_VFP=y |
26 | CONFIG_NEON=y | 27 | CONFIG_NEON=y |
27 | CONFIG_PM_RUNTIME=y | 28 | CONFIG_PM_RUNTIME=y |
@@ -109,6 +110,8 @@ CONFIG_EXT2_FS_SECURITY=y | |||
109 | CONFIG_EXT3_FS=y | 110 | CONFIG_EXT3_FS=y |
110 | CONFIG_EXT4_FS=y | 111 | CONFIG_EXT4_FS=y |
111 | CONFIG_VFAT_FS=y | 112 | CONFIG_VFAT_FS=y |
113 | CONFIG_DEVTMPFS=y | ||
114 | CONFIG_DEVTMPFS_MOUNT=y | ||
112 | CONFIG_TMPFS=y | 115 | CONFIG_TMPFS=y |
113 | CONFIG_TMPFS_POSIX_ACL=y | 116 | CONFIG_TMPFS_POSIX_ACL=y |
114 | # CONFIG_MISC_FILESYSTEMS is not set | 117 | # CONFIG_MISC_FILESYSTEMS is not set |
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index be956dbf6bae..1571d126e9dd 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
@@ -61,7 +61,7 @@ extern void __pgd_error(const char *file, int line, pgd_t); | |||
61 | * mapping to be mapped at. This is particularly important for | 61 | * mapping to be mapped at. This is particularly important for |
62 | * non-high vector CPUs. | 62 | * non-high vector CPUs. |
63 | */ | 63 | */ |
64 | #define FIRST_USER_ADDRESS PAGE_SIZE | 64 | #define FIRST_USER_ADDRESS (PAGE_SIZE * 2) |
65 | 65 | ||
66 | /* | 66 | /* |
67 | * Use TASK_SIZE as the ceiling argument for free_pgtables() and | 67 | * Use TASK_SIZE as the ceiling argument for free_pgtables() and |
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index 57221e349a7c..f0d180d8b29f 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c | |||
@@ -14,11 +14,12 @@ | |||
14 | #include <asm/pgalloc.h> | 14 | #include <asm/pgalloc.h> |
15 | #include <asm/mmu_context.h> | 15 | #include <asm/mmu_context.h> |
16 | #include <asm/cacheflush.h> | 16 | #include <asm/cacheflush.h> |
17 | #include <asm/fncpy.h> | ||
17 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
18 | #include <asm/smp_plat.h> | 19 | #include <asm/smp_plat.h> |
19 | #include <asm/system_misc.h> | 20 | #include <asm/system_misc.h> |
20 | 21 | ||
21 | extern const unsigned char relocate_new_kernel[]; | 22 | extern void relocate_new_kernel(void); |
22 | extern const unsigned int relocate_new_kernel_size; | 23 | extern const unsigned int relocate_new_kernel_size; |
23 | 24 | ||
24 | extern unsigned long kexec_start_address; | 25 | extern unsigned long kexec_start_address; |
@@ -142,6 +143,8 @@ void machine_kexec(struct kimage *image) | |||
142 | { | 143 | { |
143 | unsigned long page_list; | 144 | unsigned long page_list; |
144 | unsigned long reboot_code_buffer_phys; | 145 | unsigned long reboot_code_buffer_phys; |
146 | unsigned long reboot_entry = (unsigned long)relocate_new_kernel; | ||
147 | unsigned long reboot_entry_phys; | ||
145 | void *reboot_code_buffer; | 148 | void *reboot_code_buffer; |
146 | 149 | ||
147 | /* | 150 | /* |
@@ -168,16 +171,16 @@ void machine_kexec(struct kimage *image) | |||
168 | 171 | ||
169 | 172 | ||
170 | /* copy our kernel relocation code to the control code page */ | 173 | /* copy our kernel relocation code to the control code page */ |
171 | memcpy(reboot_code_buffer, | 174 | reboot_entry = fncpy(reboot_code_buffer, |
172 | relocate_new_kernel, relocate_new_kernel_size); | 175 | reboot_entry, |
176 | relocate_new_kernel_size); | ||
177 | reboot_entry_phys = (unsigned long)reboot_entry + | ||
178 | (reboot_code_buffer_phys - (unsigned long)reboot_code_buffer); | ||
173 | 179 | ||
174 | |||
175 | flush_icache_range((unsigned long) reboot_code_buffer, | ||
176 | (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); | ||
177 | printk(KERN_INFO "Bye!\n"); | 180 | printk(KERN_INFO "Bye!\n"); |
178 | 181 | ||
179 | if (kexec_reinit) | 182 | if (kexec_reinit) |
180 | kexec_reinit(); | 183 | kexec_reinit(); |
181 | 184 | ||
182 | soft_restart(reboot_code_buffer_phys); | 185 | soft_restart(reboot_entry_phys); |
183 | } | 186 | } |
diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S index d0cdedf4864d..95858966d84e 100644 --- a/arch/arm/kernel/relocate_kernel.S +++ b/arch/arm/kernel/relocate_kernel.S | |||
@@ -2,10 +2,12 @@ | |||
2 | * relocate_kernel.S - put the kernel image in place to boot | 2 | * relocate_kernel.S - put the kernel image in place to boot |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <linux/linkage.h> | ||
5 | #include <asm/kexec.h> | 6 | #include <asm/kexec.h> |
6 | 7 | ||
7 | .globl relocate_new_kernel | 8 | .align 3 /* not needed for this code, but keeps fncpy() happy */ |
8 | relocate_new_kernel: | 9 | |
10 | ENTRY(relocate_new_kernel) | ||
9 | 11 | ||
10 | ldr r0,kexec_indirection_page | 12 | ldr r0,kexec_indirection_page |
11 | ldr r1,kexec_start_address | 13 | ldr r1,kexec_start_address |
@@ -79,6 +81,8 @@ kexec_mach_type: | |||
79 | kexec_boot_atags: | 81 | kexec_boot_atags: |
80 | .long 0x0 | 82 | .long 0x0 |
81 | 83 | ||
84 | ENDPROC(relocate_new_kernel) | ||
85 | |||
82 | relocate_new_kernel_end: | 86 | relocate_new_kernel_end: |
83 | 87 | ||
84 | .globl relocate_new_kernel_size | 88 | .globl relocate_new_kernel_size |
diff --git a/arch/arm/kernel/sigreturn_codes.S b/arch/arm/kernel/sigreturn_codes.S index 3c5d0f2170fd..b84d0cb13682 100644 --- a/arch/arm/kernel/sigreturn_codes.S +++ b/arch/arm/kernel/sigreturn_codes.S | |||
@@ -30,6 +30,27 @@ | |||
30 | * snippets. | 30 | * snippets. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | /* | ||
34 | * In CPU_THUMBONLY case kernel arm opcodes are not allowed. | ||
35 | * Note in this case codes skips those instructions but it uses .org | ||
36 | * directive to keep correct layout of sigreturn_codes array. | ||
37 | */ | ||
38 | #ifndef CONFIG_CPU_THUMBONLY | ||
39 | #define ARM_OK(code...) code | ||
40 | #else | ||
41 | #define ARM_OK(code...) | ||
42 | #endif | ||
43 | |||
44 | .macro arm_slot n | ||
45 | .org sigreturn_codes + 12 * (\n) | ||
46 | ARM_OK( .arm ) | ||
47 | .endm | ||
48 | |||
49 | .macro thumb_slot n | ||
50 | .org sigreturn_codes + 12 * (\n) + 8 | ||
51 | .thumb | ||
52 | .endm | ||
53 | |||
33 | #if __LINUX_ARM_ARCH__ <= 4 | 54 | #if __LINUX_ARM_ARCH__ <= 4 |
34 | /* | 55 | /* |
35 | * Note we manually set minimally required arch that supports | 56 | * Note we manually set minimally required arch that supports |
@@ -45,26 +66,27 @@ | |||
45 | .global sigreturn_codes | 66 | .global sigreturn_codes |
46 | .type sigreturn_codes, #object | 67 | .type sigreturn_codes, #object |
47 | 68 | ||
48 | .arm | 69 | .align |
49 | 70 | ||
50 | sigreturn_codes: | 71 | sigreturn_codes: |
51 | 72 | ||
52 | /* ARM sigreturn syscall code snippet */ | 73 | /* ARM sigreturn syscall code snippet */ |
53 | mov r7, #(__NR_sigreturn - __NR_SYSCALL_BASE) | 74 | arm_slot 0 |
54 | swi #(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE) | 75 | ARM_OK( mov r7, #(__NR_sigreturn - __NR_SYSCALL_BASE) ) |
76 | ARM_OK( swi #(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE) ) | ||
55 | 77 | ||
56 | /* Thumb sigreturn syscall code snippet */ | 78 | /* Thumb sigreturn syscall code snippet */ |
57 | .thumb | 79 | thumb_slot 0 |
58 | movs r7, #(__NR_sigreturn - __NR_SYSCALL_BASE) | 80 | movs r7, #(__NR_sigreturn - __NR_SYSCALL_BASE) |
59 | swi #0 | 81 | swi #0 |
60 | 82 | ||
61 | /* ARM sigreturn_rt syscall code snippet */ | 83 | /* ARM sigreturn_rt syscall code snippet */ |
62 | .arm | 84 | arm_slot 1 |
63 | mov r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE) | 85 | ARM_OK( mov r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE) ) |
64 | swi #(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE) | 86 | ARM_OK( swi #(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE) ) |
65 | 87 | ||
66 | /* Thumb sigreturn_rt syscall code snippet */ | 88 | /* Thumb sigreturn_rt syscall code snippet */ |
67 | .thumb | 89 | thumb_slot 1 |
68 | movs r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE) | 90 | movs r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE) |
69 | swi #0 | 91 | swi #0 |
70 | 92 | ||
@@ -74,7 +96,7 @@ sigreturn_codes: | |||
74 | * it is thumb case or not, so we need additional | 96 | * it is thumb case or not, so we need additional |
75 | * word after real last entry. | 97 | * word after real last entry. |
76 | */ | 98 | */ |
77 | .arm | 99 | arm_slot 2 |
78 | .space 4 | 100 | .space 4 |
79 | 101 | ||
80 | .size sigreturn_codes, . - sigreturn_codes | 102 | .size sigreturn_codes, . - sigreturn_codes |
diff --git a/arch/arm/lib/delay-loop.S b/arch/arm/lib/delay-loop.S index 36b668d8e121..bc1033b897b4 100644 --- a/arch/arm/lib/delay-loop.S +++ b/arch/arm/lib/delay-loop.S | |||
@@ -40,6 +40,7 @@ ENTRY(__loop_const_udelay) @ 0 <= r0 <= 0x7fffff06 | |||
40 | /* | 40 | /* |
41 | * loops = r0 * HZ * loops_per_jiffy / 1000000 | 41 | * loops = r0 * HZ * loops_per_jiffy / 1000000 |
42 | */ | 42 | */ |
43 | .align 3 | ||
43 | 44 | ||
44 | @ Delay routine | 45 | @ Delay routine |
45 | ENTRY(__loop_delay) | 46 | ENTRY(__loop_delay) |
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c index f607deb40f4d..bc7b363a3083 100644 --- a/arch/arm/mach-at91/at91rm9200_time.c +++ b/arch/arm/mach-at91/at91rm9200_time.c | |||
@@ -174,7 +174,6 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev) | |||
174 | static struct clock_event_device clkevt = { | 174 | static struct clock_event_device clkevt = { |
175 | .name = "at91_tick", | 175 | .name = "at91_tick", |
176 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 176 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
177 | .shift = 32, | ||
178 | .rating = 150, | 177 | .rating = 150, |
179 | .set_next_event = clkevt32k_next_event, | 178 | .set_next_event = clkevt32k_next_event, |
180 | .set_mode = clkevt32k_mode, | 179 | .set_mode = clkevt32k_mode, |
@@ -265,11 +264,9 @@ void __init at91rm9200_timer_init(void) | |||
265 | at91_st_write(AT91_ST_RTMR, 1); | 264 | at91_st_write(AT91_ST_RTMR, 1); |
266 | 265 | ||
267 | /* Setup timer clockevent, with minimum of two ticks (important!!) */ | 266 | /* Setup timer clockevent, with minimum of two ticks (important!!) */ |
268 | clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift); | ||
269 | clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt); | ||
270 | clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1; | ||
271 | clkevt.cpumask = cpumask_of(0); | 267 | clkevt.cpumask = cpumask_of(0); |
272 | clockevents_register_device(&clkevt); | 268 | clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK, |
269 | 2, AT91_ST_ALMV); | ||
273 | 270 | ||
274 | /* register clocksource */ | 271 | /* register clocksource */ |
275 | clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); | 272 | clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); |
diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h index 3ed190ce062b..c5101dcb4fb0 100644 --- a/arch/arm/mach-at91/pm.h +++ b/arch/arm/mach-at91/pm.h | |||
@@ -16,7 +16,11 @@ | |||
16 | #include <mach/at91_ramc.h> | 16 | #include <mach/at91_ramc.h> |
17 | #include <mach/at91rm9200_sdramc.h> | 17 | #include <mach/at91rm9200_sdramc.h> |
18 | 18 | ||
19 | #ifdef CONFIG_PM | ||
19 | extern void at91_pm_set_standby(void (*at91_standby)(void)); | 20 | extern void at91_pm_set_standby(void (*at91_standby)(void)); |
21 | #else | ||
22 | static inline void at91_pm_set_standby(void (*at91_standby)(void)) { } | ||
23 | #endif | ||
20 | 24 | ||
21 | /* | 25 | /* |
22 | * The AT91RM9200 goes into self-refresh mode with this command, and will | 26 | * The AT91RM9200 goes into self-refresh mode with this command, and will |
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c index 3ea86428ee09..a28873fe3049 100644 --- a/arch/arm/mach-at91/sama5d3.c +++ b/arch/arm/mach-at91/sama5d3.c | |||
@@ -95,19 +95,19 @@ static struct clk twi0_clk = { | |||
95 | .name = "twi0_clk", | 95 | .name = "twi0_clk", |
96 | .pid = SAMA5D3_ID_TWI0, | 96 | .pid = SAMA5D3_ID_TWI0, |
97 | .type = CLK_TYPE_PERIPHERAL, | 97 | .type = CLK_TYPE_PERIPHERAL, |
98 | .div = AT91_PMC_PCR_DIV2, | 98 | .div = AT91_PMC_PCR_DIV8, |
99 | }; | 99 | }; |
100 | static struct clk twi1_clk = { | 100 | static struct clk twi1_clk = { |
101 | .name = "twi1_clk", | 101 | .name = "twi1_clk", |
102 | .pid = SAMA5D3_ID_TWI1, | 102 | .pid = SAMA5D3_ID_TWI1, |
103 | .type = CLK_TYPE_PERIPHERAL, | 103 | .type = CLK_TYPE_PERIPHERAL, |
104 | .div = AT91_PMC_PCR_DIV2, | 104 | .div = AT91_PMC_PCR_DIV8, |
105 | }; | 105 | }; |
106 | static struct clk twi2_clk = { | 106 | static struct clk twi2_clk = { |
107 | .name = "twi2_clk", | 107 | .name = "twi2_clk", |
108 | .pid = SAMA5D3_ID_TWI2, | 108 | .pid = SAMA5D3_ID_TWI2, |
109 | .type = CLK_TYPE_PERIPHERAL, | 109 | .type = CLK_TYPE_PERIPHERAL, |
110 | .div = AT91_PMC_PCR_DIV2, | 110 | .div = AT91_PMC_PCR_DIV8, |
111 | }; | 111 | }; |
112 | static struct clk mmc0_clk = { | 112 | static struct clk mmc0_clk = { |
113 | .name = "mci0_clk", | 113 | .name = "mci0_clk", |
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c index 2739ca2c1334..e0091685fd48 100644 --- a/arch/arm/mach-footbridge/common.c +++ b/arch/arm/mach-footbridge/common.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/spinlock.h> | 17 | #include <linux/spinlock.h> |
18 | #include <video/vga.h> | ||
18 | 19 | ||
19 | #include <asm/pgtable.h> | 20 | #include <asm/pgtable.h> |
20 | #include <asm/page.h> | 21 | #include <asm/page.h> |
@@ -196,6 +197,8 @@ void __init footbridge_map_io(void) | |||
196 | iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc)); | 197 | iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc)); |
197 | pci_map_io_early(__phys_to_pfn(DC21285_PCI_IO)); | 198 | pci_map_io_early(__phys_to_pfn(DC21285_PCI_IO)); |
198 | } | 199 | } |
200 | |||
201 | vga_base = PCIMEM_BASE; | ||
199 | } | 202 | } |
200 | 203 | ||
201 | void footbridge_restart(enum reboot_mode mode, const char *cmd) | 204 | void footbridge_restart(enum reboot_mode mode, const char *cmd) |
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index 3490a24f969e..7c2fdae9a38b 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/irq.h> | 18 | #include <linux/irq.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
21 | #include <video/vga.h> | ||
22 | 21 | ||
23 | #include <asm/irq.h> | 22 | #include <asm/irq.h> |
24 | #include <asm/mach/pci.h> | 23 | #include <asm/mach/pci.h> |
@@ -291,7 +290,6 @@ void __init dc21285_preinit(void) | |||
291 | int cfn_mode; | 290 | int cfn_mode; |
292 | 291 | ||
293 | pcibios_min_mem = 0x81000000; | 292 | pcibios_min_mem = 0x81000000; |
294 | vga_base = PCIMEM_BASE; | ||
295 | 293 | ||
296 | mem_size = (unsigned int)high_memory - PAGE_OFFSET; | 294 | mem_size = (unsigned int)high_memory - PAGE_OFFSET; |
297 | for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1) | 295 | for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1) |
diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c index b08243500e2e..1a7235fb52ac 100644 --- a/arch/arm/mach-footbridge/ebsa285.c +++ b/arch/arm/mach-footbridge/ebsa285.c | |||
@@ -30,21 +30,24 @@ static const struct { | |||
30 | const char *name; | 30 | const char *name; |
31 | const char *trigger; | 31 | const char *trigger; |
32 | } ebsa285_leds[] = { | 32 | } ebsa285_leds[] = { |
33 | { "ebsa285:amber", "heartbeat", }, | 33 | { "ebsa285:amber", "cpu0", }, |
34 | { "ebsa285:green", "cpu0", }, | 34 | { "ebsa285:green", "heartbeat", }, |
35 | { "ebsa285:red",}, | 35 | { "ebsa285:red",}, |
36 | }; | 36 | }; |
37 | 37 | ||
38 | static unsigned char hw_led_state; | ||
39 | |||
38 | static void ebsa285_led_set(struct led_classdev *cdev, | 40 | static void ebsa285_led_set(struct led_classdev *cdev, |
39 | enum led_brightness b) | 41 | enum led_brightness b) |
40 | { | 42 | { |
41 | struct ebsa285_led *led = container_of(cdev, | 43 | struct ebsa285_led *led = container_of(cdev, |
42 | struct ebsa285_led, cdev); | 44 | struct ebsa285_led, cdev); |
43 | 45 | ||
44 | if (b != LED_OFF) | 46 | if (b == LED_OFF) |
45 | *XBUS_LEDS |= led->mask; | 47 | hw_led_state |= led->mask; |
46 | else | 48 | else |
47 | *XBUS_LEDS &= ~led->mask; | 49 | hw_led_state &= ~led->mask; |
50 | *XBUS_LEDS = hw_led_state; | ||
48 | } | 51 | } |
49 | 52 | ||
50 | static enum led_brightness ebsa285_led_get(struct led_classdev *cdev) | 53 | static enum led_brightness ebsa285_led_get(struct led_classdev *cdev) |
@@ -52,18 +55,19 @@ static enum led_brightness ebsa285_led_get(struct led_classdev *cdev) | |||
52 | struct ebsa285_led *led = container_of(cdev, | 55 | struct ebsa285_led *led = container_of(cdev, |
53 | struct ebsa285_led, cdev); | 56 | struct ebsa285_led, cdev); |
54 | 57 | ||
55 | return (*XBUS_LEDS & led->mask) ? LED_FULL : LED_OFF; | 58 | return hw_led_state & led->mask ? LED_OFF : LED_FULL; |
56 | } | 59 | } |
57 | 60 | ||
58 | static int __init ebsa285_leds_init(void) | 61 | static int __init ebsa285_leds_init(void) |
59 | { | 62 | { |
60 | int i; | 63 | int i; |
61 | 64 | ||
62 | if (machine_is_ebsa285()) | 65 | if (!machine_is_ebsa285()) |
63 | return -ENODEV; | 66 | return -ENODEV; |
64 | 67 | ||
65 | /* 3 LEDS All ON */ | 68 | /* 3 LEDS all off */ |
66 | *XBUS_LEDS |= XBUS_LED_AMBER | XBUS_LED_GREEN | XBUS_LED_RED; | 69 | hw_led_state = XBUS_LED_AMBER | XBUS_LED_GREEN | XBUS_LED_RED; |
70 | *XBUS_LEDS = hw_led_state; | ||
67 | 71 | ||
68 | for (i = 0; i < ARRAY_SIZE(ebsa285_leds); i++) { | 72 | for (i = 0; i < ARRAY_SIZE(ebsa285_leds); i++) { |
69 | struct ebsa285_led *led; | 73 | struct ebsa285_led *led; |
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index dc21df166161..4191ae08f4c8 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -192,19 +192,6 @@ config MACH_OMAP2_TUSB6010 | |||
192 | depends on ARCH_OMAP2 && SOC_OMAP2420 | 192 | depends on ARCH_OMAP2 && SOC_OMAP2420 |
193 | default y if MACH_NOKIA_N8X0 | 193 | default y if MACH_NOKIA_N8X0 |
194 | 194 | ||
195 | config MACH_OMAP_H4 | ||
196 | bool "OMAP 2420 H4 board" | ||
197 | depends on SOC_OMAP2420 | ||
198 | default y | ||
199 | select OMAP_DEBUG_DEVICES | ||
200 | select OMAP_PACKAGE_ZAF | ||
201 | |||
202 | config MACH_OMAP_2430SDP | ||
203 | bool "OMAP 2430 SDP board" | ||
204 | depends on SOC_OMAP2430 | ||
205 | default y | ||
206 | select OMAP_PACKAGE_ZAC | ||
207 | |||
208 | config MACH_OMAP3_BEAGLE | 195 | config MACH_OMAP3_BEAGLE |
209 | bool "OMAP3 BEAGLE board" | 196 | bool "OMAP3 BEAGLE board" |
210 | depends on ARCH_OMAP3 | 197 | depends on ARCH_OMAP3 |
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 1f25f3e99c05..f78b177e8f4f 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -19,11 +19,11 @@ secure-common = omap-smc.o omap-secure.o | |||
19 | 19 | ||
20 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) | 20 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) |
21 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common) | 21 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common) |
22 | obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common) | 22 | obj-$(CONFIG_ARCH_OMAP4) += $(hwmod-common) $(secure-common) |
23 | obj-$(CONFIG_SOC_AM33XX) += irq.o $(hwmod-common) | 23 | obj-$(CONFIG_SOC_AM33XX) += irq.o $(hwmod-common) |
24 | obj-$(CONFIG_SOC_OMAP5) += prm44xx.o $(hwmod-common) $(secure-common) | 24 | obj-$(CONFIG_SOC_OMAP5) += $(hwmod-common) $(secure-common) |
25 | obj-$(CONFIG_SOC_AM43XX) += $(hwmod-common) $(secure-common) | 25 | obj-$(CONFIG_SOC_AM43XX) += $(hwmod-common) $(secure-common) |
26 | obj-$(CONFIG_SOC_DRA7XX) += prm44xx.o $(hwmod-common) $(secure-common) | 26 | obj-$(CONFIG_SOC_DRA7XX) += $(hwmod-common) $(secure-common) |
27 | 27 | ||
28 | ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),) | 28 | ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),) |
29 | obj-y += mcbsp.o | 29 | obj-y += mcbsp.o |
@@ -66,8 +66,6 @@ obj-$(CONFIG_SOC_OMAP5) += omap4-restart.o | |||
66 | obj-$(CONFIG_SOC_DRA7XX) += omap4-restart.o | 66 | obj-$(CONFIG_SOC_DRA7XX) += omap4-restart.o |
67 | 67 | ||
68 | # Pin multiplexing | 68 | # Pin multiplexing |
69 | obj-$(CONFIG_SOC_OMAP2420) += mux2420.o | ||
70 | obj-$(CONFIG_SOC_OMAP2430) += mux2430.o | ||
71 | obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o | 69 | obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o |
72 | 70 | ||
73 | # SMS/SDRC | 71 | # SMS/SDRC |
@@ -237,8 +235,6 @@ obj-$(CONFIG_SOC_OMAP2420) += msdi.o | |||
237 | 235 | ||
238 | # Specific board support | 236 | # Specific board support |
239 | obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o pdata-quirks.o | 237 | obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o pdata-quirks.o |
240 | obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o | ||
241 | obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o | ||
242 | obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o | 238 | obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o |
243 | obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o | 239 | obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o |
244 | obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o | 240 | obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o |
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c deleted file mode 100644 index c711ad6ac067..000000000000 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ /dev/null | |||
@@ -1,273 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap2/board-2430sdp.c | ||
3 | * | ||
4 | * Copyright (C) 2006 Texas Instruments | ||
5 | * | ||
6 | * Modified from mach-omap2/board-generic.c | ||
7 | * | ||
8 | * Initial Code : Based on a patch from Komal Shah and Richard Woodruff | ||
9 | * Updated the Code for 2430 SDP : Syed Mohammed Khasim | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | */ | ||
15 | |||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | #include <linux/mtd/mtd.h> | ||
20 | #include <linux/mtd/partitions.h> | ||
21 | #include <linux/mtd/physmap.h> | ||
22 | #include <linux/mmc/host.h> | ||
23 | #include <linux/delay.h> | ||
24 | #include <linux/i2c/twl.h> | ||
25 | #include <linux/regulator/machine.h> | ||
26 | #include <linux/err.h> | ||
27 | #include <linux/clk.h> | ||
28 | #include <linux/io.h> | ||
29 | #include <linux/gpio.h> | ||
30 | #include <linux/usb/phy.h> | ||
31 | |||
32 | #include <asm/mach-types.h> | ||
33 | #include <asm/mach/arch.h> | ||
34 | #include <asm/mach/map.h> | ||
35 | |||
36 | #include "common.h" | ||
37 | #include "gpmc.h" | ||
38 | #include "gpmc-smc91x.h" | ||
39 | |||
40 | #include <video/omapdss.h> | ||
41 | #include <video/omap-panel-data.h> | ||
42 | |||
43 | #include "mux.h" | ||
44 | #include "hsmmc.h" | ||
45 | #include "common-board-devices.h" | ||
46 | |||
47 | #define SDP2430_CS0_BASE 0x04000000 | ||
48 | #define SECONDARY_LCD_GPIO 147 | ||
49 | |||
50 | static struct mtd_partition sdp2430_partitions[] = { | ||
51 | /* bootloader (U-Boot, etc) in first sector */ | ||
52 | { | ||
53 | .name = "bootloader", | ||
54 | .offset = 0, | ||
55 | .size = SZ_256K, | ||
56 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
57 | }, | ||
58 | /* bootloader params in the next sector */ | ||
59 | { | ||
60 | .name = "params", | ||
61 | .offset = MTDPART_OFS_APPEND, | ||
62 | .size = SZ_128K, | ||
63 | .mask_flags = 0, | ||
64 | }, | ||
65 | /* kernel */ | ||
66 | { | ||
67 | .name = "kernel", | ||
68 | .offset = MTDPART_OFS_APPEND, | ||
69 | .size = SZ_2M, | ||
70 | .mask_flags = 0 | ||
71 | }, | ||
72 | /* file system */ | ||
73 | { | ||
74 | .name = "filesystem", | ||
75 | .offset = MTDPART_OFS_APPEND, | ||
76 | .size = MTDPART_SIZ_FULL, | ||
77 | .mask_flags = 0 | ||
78 | } | ||
79 | }; | ||
80 | |||
81 | static struct physmap_flash_data sdp2430_flash_data = { | ||
82 | .width = 2, | ||
83 | .parts = sdp2430_partitions, | ||
84 | .nr_parts = ARRAY_SIZE(sdp2430_partitions), | ||
85 | }; | ||
86 | |||
87 | static struct resource sdp2430_flash_resource = { | ||
88 | .start = SDP2430_CS0_BASE, | ||
89 | .end = SDP2430_CS0_BASE + SZ_64M - 1, | ||
90 | .flags = IORESOURCE_MEM, | ||
91 | }; | ||
92 | |||
93 | static struct platform_device sdp2430_flash_device = { | ||
94 | .name = "physmap-flash", | ||
95 | .id = 0, | ||
96 | .dev = { | ||
97 | .platform_data = &sdp2430_flash_data, | ||
98 | }, | ||
99 | .num_resources = 1, | ||
100 | .resource = &sdp2430_flash_resource, | ||
101 | }; | ||
102 | |||
103 | /* LCD */ | ||
104 | #define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91 | ||
105 | #define SDP2430_LCD_PANEL_ENABLE_GPIO 154 | ||
106 | |||
107 | static const struct display_timing sdp2430_lcd_videomode = { | ||
108 | .pixelclock = { 0, 5400000, 0 }, | ||
109 | |||
110 | .hactive = { 0, 240, 0 }, | ||
111 | .hfront_porch = { 0, 3, 0 }, | ||
112 | .hback_porch = { 0, 39, 0 }, | ||
113 | .hsync_len = { 0, 3, 0 }, | ||
114 | |||
115 | .vactive = { 0, 320, 0 }, | ||
116 | .vfront_porch = { 0, 2, 0 }, | ||
117 | .vback_porch = { 0, 7, 0 }, | ||
118 | .vsync_len = { 0, 1, 0 }, | ||
119 | |||
120 | .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW | | ||
121 | DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE, | ||
122 | }; | ||
123 | |||
124 | static struct panel_dpi_platform_data sdp2430_lcd_pdata = { | ||
125 | .name = "lcd", | ||
126 | .source = "dpi.0", | ||
127 | |||
128 | .data_lines = 16, | ||
129 | |||
130 | .display_timing = &sdp2430_lcd_videomode, | ||
131 | |||
132 | .enable_gpio = SDP2430_LCD_PANEL_ENABLE_GPIO, | ||
133 | .backlight_gpio = SDP2430_LCD_PANEL_BACKLIGHT_GPIO, | ||
134 | }; | ||
135 | |||
136 | static struct platform_device sdp2430_lcd_device = { | ||
137 | .name = "panel-dpi", | ||
138 | .id = 0, | ||
139 | .dev.platform_data = &sdp2430_lcd_pdata, | ||
140 | }; | ||
141 | |||
142 | static struct omap_dss_board_info sdp2430_dss_data = { | ||
143 | .default_display_name = "lcd", | ||
144 | }; | ||
145 | |||
146 | static struct platform_device *sdp2430_devices[] __initdata = { | ||
147 | &sdp2430_flash_device, | ||
148 | &sdp2430_lcd_device, | ||
149 | }; | ||
150 | |||
151 | #if IS_ENABLED(CONFIG_SMC91X) | ||
152 | |||
153 | static struct omap_smc91x_platform_data board_smc91x_data = { | ||
154 | .cs = 5, | ||
155 | .gpio_irq = 149, | ||
156 | .flags = GPMC_MUX_ADD_DATA | GPMC_TIMINGS_SMC91C96 | | ||
157 | IORESOURCE_IRQ_LOWLEVEL, | ||
158 | |||
159 | }; | ||
160 | |||
161 | static void __init board_smc91x_init(void) | ||
162 | { | ||
163 | omap_mux_init_gpio(149, OMAP_PIN_INPUT); | ||
164 | gpmc_smc91x_init(&board_smc91x_data); | ||
165 | } | ||
166 | |||
167 | #else | ||
168 | |||
169 | static inline void board_smc91x_init(void) | ||
170 | { | ||
171 | } | ||
172 | |||
173 | #endif | ||
174 | |||
175 | static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = { | ||
176 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), | ||
177 | }; | ||
178 | |||
179 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | ||
180 | static struct regulator_init_data sdp2430_vmmc1 = { | ||
181 | .constraints = { | ||
182 | .min_uV = 1850000, | ||
183 | .max_uV = 3150000, | ||
184 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
185 | | REGULATOR_MODE_STANDBY, | ||
186 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
187 | | REGULATOR_CHANGE_MODE | ||
188 | | REGULATOR_CHANGE_STATUS, | ||
189 | }, | ||
190 | .num_consumer_supplies = ARRAY_SIZE(sdp2430_vmmc1_supplies), | ||
191 | .consumer_supplies = &sdp2430_vmmc1_supplies[0], | ||
192 | }; | ||
193 | |||
194 | static struct twl4030_gpio_platform_data sdp2430_gpio_data = { | ||
195 | }; | ||
196 | |||
197 | static struct twl4030_platform_data sdp2430_twldata = { | ||
198 | /* platform_data for children goes here */ | ||
199 | .gpio = &sdp2430_gpio_data, | ||
200 | .vmmc1 = &sdp2430_vmmc1, | ||
201 | }; | ||
202 | |||
203 | static struct i2c_board_info __initdata sdp2430_i2c1_boardinfo[] = { | ||
204 | { | ||
205 | I2C_BOARD_INFO("isp1301_omap", 0x2D), | ||
206 | .flags = I2C_CLIENT_WAKE, | ||
207 | }, | ||
208 | }; | ||
209 | |||
210 | static int __init omap2430_i2c_init(void) | ||
211 | { | ||
212 | sdp2430_i2c1_boardinfo[0].irq = gpio_to_irq(78); | ||
213 | omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo, | ||
214 | ARRAY_SIZE(sdp2430_i2c1_boardinfo)); | ||
215 | omap_pmic_init(2, 100, "twl4030", 7 + OMAP_INTC_START, | ||
216 | &sdp2430_twldata); | ||
217 | return 0; | ||
218 | } | ||
219 | |||
220 | static struct omap2_hsmmc_info mmc[] __initdata = { | ||
221 | { | ||
222 | .mmc = 1, | ||
223 | .caps = MMC_CAP_4_BIT_DATA, | ||
224 | .gpio_cd = -EINVAL, | ||
225 | .gpio_wp = -EINVAL, | ||
226 | .ext_clock = 1, | ||
227 | }, | ||
228 | {} /* Terminator */ | ||
229 | }; | ||
230 | |||
231 | #ifdef CONFIG_OMAP_MUX | ||
232 | static struct omap_board_mux board_mux[] __initdata = { | ||
233 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
234 | }; | ||
235 | #endif | ||
236 | |||
237 | static void __init omap_2430sdp_init(void) | ||
238 | { | ||
239 | omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); | ||
240 | |||
241 | omap2430_i2c_init(); | ||
242 | |||
243 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); | ||
244 | omap_serial_init(); | ||
245 | omap_sdrc_init(NULL, NULL); | ||
246 | omap_hsmmc_init(mmc); | ||
247 | |||
248 | omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP); | ||
249 | usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); | ||
250 | usb_musb_init(NULL); | ||
251 | |||
252 | board_smc91x_init(); | ||
253 | |||
254 | /* Turn off secondary LCD backlight */ | ||
255 | gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW, | ||
256 | "Secondary LCD backlight"); | ||
257 | |||
258 | omap_display_init(&sdp2430_dss_data); | ||
259 | } | ||
260 | |||
261 | MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") | ||
262 | /* Maintainer: Syed Khasim - Texas Instruments Inc */ | ||
263 | .atag_offset = 0x100, | ||
264 | .reserve = omap_reserve, | ||
265 | .map_io = omap243x_map_io, | ||
266 | .init_early = omap2430_init_early, | ||
267 | .init_irq = omap2_init_irq, | ||
268 | .handle_irq = omap2_intc_handle_irq, | ||
269 | .init_machine = omap_2430sdp_init, | ||
270 | .init_late = omap2430_init_late, | ||
271 | .init_time = omap2_sync32k_timer_init, | ||
272 | .restart = omap2xxx_restart, | ||
273 | MACHINE_END | ||
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 19f1652e94cf..8d972ff18c56 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -131,6 +131,24 @@ DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)") | |||
131 | .dt_compat = omap3_gp_boards_compat, | 131 | .dt_compat = omap3_gp_boards_compat, |
132 | .restart = omap3xxx_restart, | 132 | .restart = omap3xxx_restart, |
133 | MACHINE_END | 133 | MACHINE_END |
134 | |||
135 | static const char *am3517_boards_compat[] __initdata = { | ||
136 | "ti,am3517", | ||
137 | NULL, | ||
138 | }; | ||
139 | |||
140 | DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)") | ||
141 | .reserve = omap_reserve, | ||
142 | .map_io = omap3_map_io, | ||
143 | .init_early = am35xx_init_early, | ||
144 | .init_irq = omap_intc_of_init, | ||
145 | .handle_irq = omap3_intc_handle_irq, | ||
146 | .init_machine = omap_generic_init, | ||
147 | .init_late = omap3_init_late, | ||
148 | .init_time = omap3_gptimer_timer_init, | ||
149 | .dt_compat = am3517_boards_compat, | ||
150 | .restart = omap3xxx_restart, | ||
151 | MACHINE_END | ||
134 | #endif | 152 | #endif |
135 | 153 | ||
136 | #ifdef CONFIG_SOC_AM33XX | 154 | #ifdef CONFIG_SOC_AM33XX |
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c deleted file mode 100644 index f7808349a734..000000000000 --- a/arch/arm/mach-omap2/board-h4.c +++ /dev/null | |||
@@ -1,365 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap2/board-h4.c | ||
3 | * | ||
4 | * Copyright (C) 2005 Nokia Corporation | ||
5 | * Author: Paul Mundt <paul.mundt@nokia.com> | ||
6 | * | ||
7 | * Modified from mach-omap/omap1/board-generic.c | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | #include <linux/gpio.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/mtd/mtd.h> | ||
18 | #include <linux/mtd/partitions.h> | ||
19 | #include <linux/mtd/physmap.h> | ||
20 | #include <linux/delay.h> | ||
21 | #include <linux/workqueue.h> | ||
22 | #include <linux/i2c.h> | ||
23 | #include <linux/platform_data/at24.h> | ||
24 | #include <linux/input.h> | ||
25 | #include <linux/err.h> | ||
26 | #include <linux/clk.h> | ||
27 | #include <linux/io.h> | ||
28 | #include <linux/input/matrix_keypad.h> | ||
29 | #include <linux/mfd/menelaus.h> | ||
30 | #include <linux/omap-dma.h> | ||
31 | |||
32 | #include <asm/mach-types.h> | ||
33 | #include <asm/mach/arch.h> | ||
34 | #include <asm/mach/map.h> | ||
35 | |||
36 | #include <video/omapdss.h> | ||
37 | #include <video/omap-panel-data.h> | ||
38 | |||
39 | #include "common.h" | ||
40 | #include "mux.h" | ||
41 | #include "control.h" | ||
42 | #include "gpmc.h" | ||
43 | #include "gpmc-smc91x.h" | ||
44 | |||
45 | #define H4_FLASH_CS 0 | ||
46 | |||
47 | #if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE) | ||
48 | static const uint32_t board_matrix_keys[] = { | ||
49 | KEY(0, 0, KEY_LEFT), | ||
50 | KEY(1, 0, KEY_RIGHT), | ||
51 | KEY(2, 0, KEY_A), | ||
52 | KEY(3, 0, KEY_B), | ||
53 | KEY(4, 0, KEY_C), | ||
54 | KEY(0, 1, KEY_DOWN), | ||
55 | KEY(1, 1, KEY_UP), | ||
56 | KEY(2, 1, KEY_E), | ||
57 | KEY(3, 1, KEY_F), | ||
58 | KEY(4, 1, KEY_G), | ||
59 | KEY(0, 2, KEY_ENTER), | ||
60 | KEY(1, 2, KEY_I), | ||
61 | KEY(2, 2, KEY_J), | ||
62 | KEY(3, 2, KEY_K), | ||
63 | KEY(4, 2, KEY_3), | ||
64 | KEY(0, 3, KEY_M), | ||
65 | KEY(1, 3, KEY_N), | ||
66 | KEY(2, 3, KEY_O), | ||
67 | KEY(3, 3, KEY_P), | ||
68 | KEY(4, 3, KEY_Q), | ||
69 | KEY(0, 4, KEY_R), | ||
70 | KEY(1, 4, KEY_4), | ||
71 | KEY(2, 4, KEY_T), | ||
72 | KEY(3, 4, KEY_U), | ||
73 | KEY(4, 4, KEY_ENTER), | ||
74 | KEY(0, 5, KEY_V), | ||
75 | KEY(1, 5, KEY_W), | ||
76 | KEY(2, 5, KEY_L), | ||
77 | KEY(3, 5, KEY_S), | ||
78 | KEY(4, 5, KEY_ENTER), | ||
79 | }; | ||
80 | |||
81 | static const struct matrix_keymap_data board_keymap_data = { | ||
82 | .keymap = board_matrix_keys, | ||
83 | .keymap_size = ARRAY_SIZE(board_matrix_keys), | ||
84 | }; | ||
85 | |||
86 | static unsigned int board_keypad_row_gpios[] = { | ||
87 | 88, 89, 124, 11, 6, 96 | ||
88 | }; | ||
89 | |||
90 | static unsigned int board_keypad_col_gpios[] = { | ||
91 | 90, 91, 100, 36, 12, 97, 98 | ||
92 | }; | ||
93 | |||
94 | static struct matrix_keypad_platform_data board_keypad_platform_data = { | ||
95 | .keymap_data = &board_keymap_data, | ||
96 | .row_gpios = board_keypad_row_gpios, | ||
97 | .num_row_gpios = ARRAY_SIZE(board_keypad_row_gpios), | ||
98 | .col_gpios = board_keypad_col_gpios, | ||
99 | .num_col_gpios = ARRAY_SIZE(board_keypad_col_gpios), | ||
100 | .active_low = 1, | ||
101 | |||
102 | .debounce_ms = 20, | ||
103 | .col_scan_delay_us = 5, | ||
104 | }; | ||
105 | |||
106 | static struct platform_device board_keyboard = { | ||
107 | .name = "matrix-keypad", | ||
108 | .id = -1, | ||
109 | .dev = { | ||
110 | .platform_data = &board_keypad_platform_data, | ||
111 | }, | ||
112 | }; | ||
113 | static void __init board_mkp_init(void) | ||
114 | { | ||
115 | omap_mux_init_gpio(88, OMAP_PULL_ENA | OMAP_PULL_UP); | ||
116 | omap_mux_init_gpio(89, OMAP_PULL_ENA | OMAP_PULL_UP); | ||
117 | omap_mux_init_gpio(124, OMAP_PULL_ENA | OMAP_PULL_UP); | ||
118 | omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP); | ||
119 | if (omap_has_menelaus()) { | ||
120 | omap_mux_init_signal("sdrc_a14.gpio0", | ||
121 | OMAP_PULL_ENA | OMAP_PULL_UP); | ||
122 | omap_mux_init_signal("vlynq_rx0.gpio_15", 0); | ||
123 | omap_mux_init_signal("gpio_98", 0); | ||
124 | board_keypad_row_gpios[5] = 0; | ||
125 | board_keypad_col_gpios[2] = 15; | ||
126 | board_keypad_col_gpios[6] = 18; | ||
127 | } else { | ||
128 | omap_mux_init_signal("gpio_96", OMAP_PULL_ENA | OMAP_PULL_UP); | ||
129 | omap_mux_init_signal("gpio_100", 0); | ||
130 | omap_mux_init_signal("gpio_98", 0); | ||
131 | } | ||
132 | omap_mux_init_signal("gpio_90", 0); | ||
133 | omap_mux_init_signal("gpio_91", 0); | ||
134 | omap_mux_init_signal("gpio_36", 0); | ||
135 | omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0); | ||
136 | omap_mux_init_signal("gpio_97", 0); | ||
137 | |||
138 | platform_device_register(&board_keyboard); | ||
139 | } | ||
140 | #else | ||
141 | static inline void board_mkp_init(void) | ||
142 | { | ||
143 | } | ||
144 | #endif | ||
145 | |||
146 | static struct mtd_partition h4_partitions[] = { | ||
147 | /* bootloader (U-Boot, etc) in first sector */ | ||
148 | { | ||
149 | .name = "bootloader", | ||
150 | .offset = 0, | ||
151 | .size = SZ_128K, | ||
152 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
153 | }, | ||
154 | /* bootloader params in the next sector */ | ||
155 | { | ||
156 | .name = "params", | ||
157 | .offset = MTDPART_OFS_APPEND, | ||
158 | .size = SZ_128K, | ||
159 | .mask_flags = 0, | ||
160 | }, | ||
161 | /* kernel */ | ||
162 | { | ||
163 | .name = "kernel", | ||
164 | .offset = MTDPART_OFS_APPEND, | ||
165 | .size = SZ_2M, | ||
166 | .mask_flags = 0 | ||
167 | }, | ||
168 | /* file system */ | ||
169 | { | ||
170 | .name = "filesystem", | ||
171 | .offset = MTDPART_OFS_APPEND, | ||
172 | .size = MTDPART_SIZ_FULL, | ||
173 | .mask_flags = 0 | ||
174 | } | ||
175 | }; | ||
176 | |||
177 | static struct physmap_flash_data h4_flash_data = { | ||
178 | .width = 2, | ||
179 | .parts = h4_partitions, | ||
180 | .nr_parts = ARRAY_SIZE(h4_partitions), | ||
181 | }; | ||
182 | |||
183 | static struct resource h4_flash_resource = { | ||
184 | .flags = IORESOURCE_MEM, | ||
185 | }; | ||
186 | |||
187 | static struct platform_device h4_flash_device = { | ||
188 | .name = "physmap-flash", | ||
189 | .id = 0, | ||
190 | .dev = { | ||
191 | .platform_data = &h4_flash_data, | ||
192 | }, | ||
193 | .num_resources = 1, | ||
194 | .resource = &h4_flash_resource, | ||
195 | }; | ||
196 | |||
197 | static const struct display_timing cm_t35_lcd_videomode = { | ||
198 | .pixelclock = { 0, 6250000, 0 }, | ||
199 | |||
200 | .hactive = { 0, 240, 0 }, | ||
201 | .hfront_porch = { 0, 15, 0 }, | ||
202 | .hback_porch = { 0, 60, 0 }, | ||
203 | .hsync_len = { 0, 15, 0 }, | ||
204 | |||
205 | .vactive = { 0, 320, 0 }, | ||
206 | .vfront_porch = { 0, 1, 0 }, | ||
207 | .vback_porch = { 0, 1, 0 }, | ||
208 | .vsync_len = { 0, 1, 0 }, | ||
209 | |||
210 | .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH | | ||
211 | DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE, | ||
212 | }; | ||
213 | |||
214 | static struct panel_dpi_platform_data cm_t35_lcd_pdata = { | ||
215 | .name = "lcd", | ||
216 | .source = "dpi.0", | ||
217 | |||
218 | .data_lines = 16, | ||
219 | |||
220 | .display_timing = &cm_t35_lcd_videomode, | ||
221 | |||
222 | .enable_gpio = -1, | ||
223 | .backlight_gpio = -1, | ||
224 | }; | ||
225 | |||
226 | static struct platform_device cm_t35_lcd_device = { | ||
227 | .name = "panel-dpi", | ||
228 | .id = 0, | ||
229 | .dev.platform_data = &cm_t35_lcd_pdata, | ||
230 | }; | ||
231 | |||
232 | static struct platform_device *h4_devices[] __initdata = { | ||
233 | &h4_flash_device, | ||
234 | &cm_t35_lcd_device, | ||
235 | }; | ||
236 | |||
237 | static struct omap_dss_board_info h4_dss_data = { | ||
238 | .default_display_name = "lcd", | ||
239 | }; | ||
240 | |||
241 | /* 2420 Sysboot setup (2430 is different) */ | ||
242 | static u32 get_sysboot_value(void) | ||
243 | { | ||
244 | return (omap_ctrl_readl(OMAP24XX_CONTROL_STATUS) & | ||
245 | (OMAP2_SYSBOOT_5_MASK | OMAP2_SYSBOOT_4_MASK | | ||
246 | OMAP2_SYSBOOT_3_MASK | OMAP2_SYSBOOT_2_MASK | | ||
247 | OMAP2_SYSBOOT_1_MASK | OMAP2_SYSBOOT_0_MASK)); | ||
248 | } | ||
249 | |||
250 | /* H4-2420's always used muxed mode, H4-2422's always use non-muxed | ||
251 | * | ||
252 | * Note: OMAP-GIT doesn't correctly do is_cpu_omap2422 and is_cpu_omap2423 | ||
253 | * correctly. The macro needs to look at production_id not just hawkeye. | ||
254 | */ | ||
255 | static u32 is_gpmc_muxed(void) | ||
256 | { | ||
257 | u32 mux; | ||
258 | mux = get_sysboot_value(); | ||
259 | if ((mux & 0xF) == 0xd) | ||
260 | return 1; /* NAND config (could be either) */ | ||
261 | if (mux & 0x2) /* if mux'ed */ | ||
262 | return 1; | ||
263 | else | ||
264 | return 0; | ||
265 | } | ||
266 | |||
267 | #if IS_ENABLED(CONFIG_SMC91X) | ||
268 | |||
269 | static struct omap_smc91x_platform_data board_smc91x_data = { | ||
270 | .cs = 1, | ||
271 | .gpio_irq = 92, | ||
272 | .flags = GPMC_TIMINGS_SMC91C96 | IORESOURCE_IRQ_LOWLEVEL, | ||
273 | }; | ||
274 | |||
275 | static void __init board_smc91x_init(void) | ||
276 | { | ||
277 | if (is_gpmc_muxed()) | ||
278 | board_smc91x_data.flags |= GPMC_MUX_ADD_DATA; | ||
279 | |||
280 | omap_mux_init_gpio(board_smc91x_data.gpio_irq, OMAP_PIN_INPUT); | ||
281 | gpmc_smc91x_init(&board_smc91x_data); | ||
282 | } | ||
283 | |||
284 | #else | ||
285 | |||
286 | static inline void board_smc91x_init(void) | ||
287 | { | ||
288 | } | ||
289 | |||
290 | #endif | ||
291 | |||
292 | static void __init h4_init_flash(void) | ||
293 | { | ||
294 | unsigned long base; | ||
295 | |||
296 | if (gpmc_cs_request(H4_FLASH_CS, SZ_64M, &base) < 0) { | ||
297 | printk("Can't request GPMC CS for flash\n"); | ||
298 | return; | ||
299 | } | ||
300 | h4_flash_resource.start = base; | ||
301 | h4_flash_resource.end = base + SZ_64M - 1; | ||
302 | } | ||
303 | |||
304 | static struct at24_platform_data m24c01 = { | ||
305 | .byte_len = SZ_1K / 8, | ||
306 | .page_size = 16, | ||
307 | }; | ||
308 | |||
309 | static struct i2c_board_info __initdata h4_i2c_board_info[] = { | ||
310 | { | ||
311 | I2C_BOARD_INFO("isp1301_omap", 0x2d), | ||
312 | }, | ||
313 | { /* EEPROM on mainboard */ | ||
314 | I2C_BOARD_INFO("24c01", 0x52), | ||
315 | .platform_data = &m24c01, | ||
316 | }, | ||
317 | { /* EEPROM on cpu card */ | ||
318 | I2C_BOARD_INFO("24c01", 0x57), | ||
319 | .platform_data = &m24c01, | ||
320 | }, | ||
321 | }; | ||
322 | |||
323 | #ifdef CONFIG_OMAP_MUX | ||
324 | static struct omap_board_mux board_mux[] __initdata = { | ||
325 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
326 | }; | ||
327 | #endif | ||
328 | |||
329 | static void __init omap_h4_init(void) | ||
330 | { | ||
331 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); | ||
332 | |||
333 | /* | ||
334 | * Make sure the serial ports are muxed on at this point. | ||
335 | * You have to mux them off in device drivers later on | ||
336 | * if not needed. | ||
337 | */ | ||
338 | |||
339 | board_mkp_init(); | ||
340 | h4_i2c_board_info[0].irq = gpio_to_irq(125); | ||
341 | i2c_register_board_info(1, h4_i2c_board_info, | ||
342 | ARRAY_SIZE(h4_i2c_board_info)); | ||
343 | |||
344 | platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); | ||
345 | omap_serial_init(); | ||
346 | omap_sdrc_init(NULL, NULL); | ||
347 | h4_init_flash(); | ||
348 | board_smc91x_init(); | ||
349 | |||
350 | omap_display_init(&h4_dss_data); | ||
351 | } | ||
352 | |||
353 | MACHINE_START(OMAP_H4, "OMAP2420 H4 board") | ||
354 | /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ | ||
355 | .atag_offset = 0x100, | ||
356 | .reserve = omap_reserve, | ||
357 | .map_io = omap242x_map_io, | ||
358 | .init_early = omap2420_init_early, | ||
359 | .init_irq = omap2_init_irq, | ||
360 | .handle_irq = omap2_intc_handle_irq, | ||
361 | .init_machine = omap_h4_init, | ||
362 | .init_late = omap2420_init_late, | ||
363 | .init_time = omap2_sync32k_timer_init, | ||
364 | .restart = omap2xxx_restart, | ||
365 | MACHINE_END | ||
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index 827d15009a86..aead77a4bc6d 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/i2c.h> | 21 | #include <linux/i2c.h> |
22 | #include <linux/spi/spi.h> | 22 | #include <linux/spi/spi.h> |
23 | #include <linux/usb/musb.h> | 23 | #include <linux/usb/musb.h> |
24 | #include <linux/platform_data/i2c-cbus-gpio.h> | ||
25 | #include <linux/platform_data/spi-omap2-mcspi.h> | 24 | #include <linux/platform_data/spi-omap2-mcspi.h> |
26 | #include <linux/platform_data/mtd-onenand-omap2.h> | 25 | #include <linux/platform_data/mtd-onenand-omap2.h> |
27 | #include <linux/mfd/menelaus.h> | 26 | #include <linux/mfd/menelaus.h> |
@@ -32,8 +31,7 @@ | |||
32 | 31 | ||
33 | #include "common.h" | 32 | #include "common.h" |
34 | #include "mmc.h" | 33 | #include "mmc.h" |
35 | 34 | #include "soc.h" | |
36 | #include "mux.h" | ||
37 | #include "gpmc-onenand.h" | 35 | #include "gpmc-onenand.h" |
38 | 36 | ||
39 | #define TUSB6010_ASYNC_CS 1 | 37 | #define TUSB6010_ASYNC_CS 1 |
@@ -42,44 +40,30 @@ | |||
42 | #define TUSB6010_GPIO_ENABLE 0 | 40 | #define TUSB6010_GPIO_ENABLE 0 |
43 | #define TUSB6010_DMACHAN 0x3f | 41 | #define TUSB6010_DMACHAN 0x3f |
44 | 42 | ||
45 | #if defined(CONFIG_I2C_CBUS_GPIO) || defined(CONFIG_I2C_CBUS_GPIO_MODULE) | 43 | #define NOKIA_N810_WIMAX (1 << 2) |
46 | static struct i2c_cbus_platform_data n8x0_cbus_data = { | 44 | #define NOKIA_N810 (1 << 1) |
47 | .clk_gpio = 66, | 45 | #define NOKIA_N800 (1 << 0) |
48 | .dat_gpio = 65, | ||
49 | .sel_gpio = 64, | ||
50 | }; | ||
51 | 46 | ||
52 | static struct platform_device n8x0_cbus_device = { | 47 | static u32 board_caps; |
53 | .name = "i2c-cbus-gpio", | ||
54 | .id = 3, | ||
55 | .dev = { | ||
56 | .platform_data = &n8x0_cbus_data, | ||
57 | }, | ||
58 | }; | ||
59 | 48 | ||
60 | static struct i2c_board_info n8x0_i2c_board_info_3[] __initdata = { | 49 | #define board_is_n800() (board_caps & NOKIA_N800) |
61 | { | 50 | #define board_is_n810() (board_caps & NOKIA_N810) |
62 | I2C_BOARD_INFO("retu-mfd", 0x01), | 51 | #define board_is_n810_wimax() (board_caps & NOKIA_N810_WIMAX) |
63 | }, | ||
64 | }; | ||
65 | 52 | ||
66 | static void __init n8x0_cbus_init(void) | 53 | static void board_check_revision(void) |
67 | { | 54 | { |
68 | const int retu_irq_gpio = 108; | 55 | if (of_have_populated_dt()) { |
56 | if (of_machine_is_compatible("nokia,n800")) | ||
57 | board_caps = NOKIA_N800; | ||
58 | else if (of_machine_is_compatible("nokia,n810")) | ||
59 | board_caps = NOKIA_N810; | ||
60 | else if (of_machine_is_compatible("nokia,n810-wimax")) | ||
61 | board_caps = NOKIA_N810_WIMAX; | ||
62 | } | ||
69 | 63 | ||
70 | if (gpio_request_one(retu_irq_gpio, GPIOF_IN, "Retu IRQ")) | 64 | if (!board_caps) |
71 | return; | 65 | pr_err("Unknown board\n"); |
72 | irq_set_irq_type(gpio_to_irq(retu_irq_gpio), IRQ_TYPE_EDGE_RISING); | ||
73 | n8x0_i2c_board_info_3[0].irq = gpio_to_irq(retu_irq_gpio); | ||
74 | i2c_register_board_info(3, n8x0_i2c_board_info_3, | ||
75 | ARRAY_SIZE(n8x0_i2c_board_info_3)); | ||
76 | platform_device_register(&n8x0_cbus_device); | ||
77 | } | ||
78 | #else /* CONFIG_I2C_CBUS_GPIO */ | ||
79 | static void __init n8x0_cbus_init(void) | ||
80 | { | ||
81 | } | 66 | } |
82 | #endif /* CONFIG_I2C_CBUS_GPIO */ | ||
83 | 67 | ||
84 | #if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE) | 68 | #if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE) |
85 | /* | 69 | /* |
@@ -178,49 +162,6 @@ static struct spi_board_info n800_spi_board_info[] __initdata = { | |||
178 | }, | 162 | }, |
179 | }; | 163 | }; |
180 | 164 | ||
181 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ | ||
182 | defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) | ||
183 | |||
184 | static struct mtd_partition onenand_partitions[] = { | ||
185 | { | ||
186 | .name = "bootloader", | ||
187 | .offset = 0, | ||
188 | .size = 0x20000, | ||
189 | .mask_flags = MTD_WRITEABLE, /* Force read-only */ | ||
190 | }, | ||
191 | { | ||
192 | .name = "config", | ||
193 | .offset = MTDPART_OFS_APPEND, | ||
194 | .size = 0x60000, | ||
195 | }, | ||
196 | { | ||
197 | .name = "kernel", | ||
198 | .offset = MTDPART_OFS_APPEND, | ||
199 | .size = 0x200000, | ||
200 | }, | ||
201 | { | ||
202 | .name = "initfs", | ||
203 | .offset = MTDPART_OFS_APPEND, | ||
204 | .size = 0x400000, | ||
205 | }, | ||
206 | { | ||
207 | .name = "rootfs", | ||
208 | .offset = MTDPART_OFS_APPEND, | ||
209 | .size = MTDPART_SIZ_FULL, | ||
210 | }, | ||
211 | }; | ||
212 | |||
213 | static struct omap_onenand_platform_data board_onenand_data[] = { | ||
214 | { | ||
215 | .cs = 0, | ||
216 | .gpio_irq = 26, | ||
217 | .parts = onenand_partitions, | ||
218 | .nr_parts = ARRAY_SIZE(onenand_partitions), | ||
219 | .flags = ONENAND_SYNC_READ, | ||
220 | } | ||
221 | }; | ||
222 | #endif | ||
223 | |||
224 | #if defined(CONFIG_MENELAUS) && \ | 165 | #if defined(CONFIG_MENELAUS) && \ |
225 | (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)) | 166 | (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)) |
226 | 167 | ||
@@ -342,7 +283,7 @@ static void n810_set_power_emmc(struct device *dev, | |||
342 | static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on, | 283 | static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on, |
343 | int vdd) | 284 | int vdd) |
344 | { | 285 | { |
345 | if (machine_is_nokia_n800() || slot == 0) | 286 | if (board_is_n800() || slot == 0) |
346 | return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd); | 287 | return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd); |
347 | 288 | ||
348 | n810_set_power_emmc(dev, power_on); | 289 | n810_set_power_emmc(dev, power_on); |
@@ -388,7 +329,7 @@ static void n8x0_mmc_callback(void *data, u8 card_mask) | |||
388 | { | 329 | { |
389 | int bit, *openp, index; | 330 | int bit, *openp, index; |
390 | 331 | ||
391 | if (machine_is_nokia_n800()) { | 332 | if (board_is_n800()) { |
392 | bit = 1 << 1; | 333 | bit = 1 << 1; |
393 | openp = &slot2_cover_open; | 334 | openp = &slot2_cover_open; |
394 | index = 1; | 335 | index = 1; |
@@ -421,7 +362,7 @@ static int n8x0_mmc_late_init(struct device *dev) | |||
421 | if (r < 0) | 362 | if (r < 0) |
422 | return r; | 363 | return r; |
423 | 364 | ||
424 | if (machine_is_nokia_n800()) | 365 | if (board_is_n800()) |
425 | vs2sel = 0; | 366 | vs2sel = 0; |
426 | else | 367 | else |
427 | vs2sel = 2; | 368 | vs2sel = 2; |
@@ -444,7 +385,7 @@ static int n8x0_mmc_late_init(struct device *dev) | |||
444 | if (r < 0) | 385 | if (r < 0) |
445 | return r; | 386 | return r; |
446 | 387 | ||
447 | if (machine_is_nokia_n800()) { | 388 | if (board_is_n800()) { |
448 | bit = 1 << 1; | 389 | bit = 1 << 1; |
449 | openp = &slot2_cover_open; | 390 | openp = &slot2_cover_open; |
450 | } else { | 391 | } else { |
@@ -471,7 +412,7 @@ static void n8x0_mmc_shutdown(struct device *dev) | |||
471 | { | 412 | { |
472 | int vs2sel; | 413 | int vs2sel; |
473 | 414 | ||
474 | if (machine_is_nokia_n800()) | 415 | if (board_is_n800()) |
475 | vs2sel = 0; | 416 | vs2sel = 0; |
476 | else | 417 | else |
477 | vs2sel = 2; | 418 | vs2sel = 2; |
@@ -486,7 +427,7 @@ static void n8x0_mmc_cleanup(struct device *dev) | |||
486 | 427 | ||
487 | gpio_free(N8X0_SLOT_SWITCH_GPIO); | 428 | gpio_free(N8X0_SLOT_SWITCH_GPIO); |
488 | 429 | ||
489 | if (machine_is_nokia_n810()) { | 430 | if (board_is_n810()) { |
490 | gpio_free(N810_EMMC_VSD_GPIO); | 431 | gpio_free(N810_EMMC_VSD_GPIO); |
491 | gpio_free(N810_EMMC_VIO_GPIO); | 432 | gpio_free(N810_EMMC_VIO_GPIO); |
492 | } | 433 | } |
@@ -497,7 +438,7 @@ static void n8x0_mmc_cleanup(struct device *dev) | |||
497 | * MMC controller2 is not in use. | 438 | * MMC controller2 is not in use. |
498 | */ | 439 | */ |
499 | static struct omap_mmc_platform_data mmc1_data = { | 440 | static struct omap_mmc_platform_data mmc1_data = { |
500 | .nr_slots = 2, | 441 | .nr_slots = 0, |
501 | .switch_slot = n8x0_mmc_switch_slot, | 442 | .switch_slot = n8x0_mmc_switch_slot, |
502 | .init = n8x0_mmc_late_init, | 443 | .init = n8x0_mmc_late_init, |
503 | .cleanup = n8x0_mmc_cleanup, | 444 | .cleanup = n8x0_mmc_cleanup, |
@@ -537,7 +478,7 @@ static void __init n8x0_mmc_init(void) | |||
537 | { | 478 | { |
538 | int err; | 479 | int err; |
539 | 480 | ||
540 | if (machine_is_nokia_n810()) { | 481 | if (board_is_n810()) { |
541 | mmc1_data.slots[0].name = "external"; | 482 | mmc1_data.slots[0].name = "external"; |
542 | 483 | ||
543 | /* | 484 | /* |
@@ -555,7 +496,7 @@ static void __init n8x0_mmc_init(void) | |||
555 | if (err) | 496 | if (err) |
556 | return; | 497 | return; |
557 | 498 | ||
558 | if (machine_is_nokia_n810()) { | 499 | if (board_is_n810()) { |
559 | err = gpio_request_array(n810_emmc_gpios, | 500 | err = gpio_request_array(n810_emmc_gpios, |
560 | ARRAY_SIZE(n810_emmc_gpios)); | 501 | ARRAY_SIZE(n810_emmc_gpios)); |
561 | if (err) { | 502 | if (err) { |
@@ -564,11 +505,11 @@ static void __init n8x0_mmc_init(void) | |||
564 | } | 505 | } |
565 | } | 506 | } |
566 | 507 | ||
508 | mmc1_data.nr_slots = 2; | ||
567 | mmc_data[0] = &mmc1_data; | 509 | mmc_data[0] = &mmc1_data; |
568 | omap242x_init_mmc(mmc_data); | ||
569 | } | 510 | } |
570 | #else | 511 | #else |
571 | 512 | static struct omap_mmc_platform_data mmc1_data; | |
572 | void __init n8x0_mmc_init(void) | 513 | void __init n8x0_mmc_init(void) |
573 | { | 514 | { |
574 | } | 515 | } |
@@ -650,109 +591,32 @@ static struct i2c_board_info n810_i2c_board_info_2[] __initdata = { | |||
650 | }, | 591 | }, |
651 | }; | 592 | }; |
652 | 593 | ||
653 | #ifdef CONFIG_OMAP_MUX | 594 | static int __init n8x0_late_initcall(void) |
654 | static struct omap_board_mux board_mux[] __initdata = { | ||
655 | /* I2S codec port pins for McBSP block */ | ||
656 | OMAP2420_MUX(EAC_AC_SCLK, OMAP_MUX_MODE1 | OMAP_PIN_INPUT), | ||
657 | OMAP2420_MUX(EAC_AC_FS, OMAP_MUX_MODE1 | OMAP_PIN_INPUT), | ||
658 | OMAP2420_MUX(EAC_AC_DIN, OMAP_MUX_MODE1 | OMAP_PIN_INPUT), | ||
659 | OMAP2420_MUX(EAC_AC_DOUT, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT), | ||
660 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
661 | }; | ||
662 | |||
663 | static struct omap_device_pad serial2_pads[] __initdata = { | ||
664 | { | ||
665 | .name = "uart3_rx_irrx.uart3_rx_irrx", | ||
666 | .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP, | ||
667 | .enable = OMAP_MUX_MODE0, | ||
668 | .idle = OMAP_MUX_MODE3 /* Mux as GPIO for idle */ | ||
669 | }, | ||
670 | }; | ||
671 | |||
672 | static inline void board_serial_init(void) | ||
673 | { | 595 | { |
674 | struct omap_board_data bdata; | 596 | if (!board_caps) |
675 | 597 | return -ENODEV; | |
676 | bdata.flags = 0; | ||
677 | bdata.pads = NULL; | ||
678 | bdata.pads_cnt = 0; | ||
679 | |||
680 | bdata.id = 0; | ||
681 | omap_serial_init_port(&bdata, NULL); | ||
682 | |||
683 | bdata.id = 1; | ||
684 | omap_serial_init_port(&bdata, NULL); | ||
685 | |||
686 | bdata.id = 2; | ||
687 | bdata.pads = serial2_pads; | ||
688 | bdata.pads_cnt = ARRAY_SIZE(serial2_pads); | ||
689 | omap_serial_init_port(&bdata, NULL); | ||
690 | } | ||
691 | 598 | ||
692 | #else | 599 | n8x0_mmc_init(); |
600 | n8x0_usb_init(); | ||
693 | 601 | ||
694 | static inline void board_serial_init(void) | 602 | return 0; |
695 | { | ||
696 | omap_serial_init(); | ||
697 | } | 603 | } |
604 | omap_late_initcall(n8x0_late_initcall); | ||
698 | 605 | ||
699 | #endif | 606 | /* |
700 | 607 | * Legacy init pdata init for n8x0. Note that we want to follow the | |
701 | static void __init n8x0_init_machine(void) | 608 | * I2C bus numbering starting at 0 for device tree like other omaps. |
609 | */ | ||
610 | void * __init n8x0_legacy_init(void) | ||
702 | { | 611 | { |
703 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); | 612 | board_check_revision(); |
704 | /* FIXME: add n810 spi devices */ | ||
705 | spi_register_board_info(n800_spi_board_info, | 613 | spi_register_board_info(n800_spi_board_info, |
706 | ARRAY_SIZE(n800_spi_board_info)); | 614 | ARRAY_SIZE(n800_spi_board_info)); |
707 | omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1, | 615 | i2c_register_board_info(0, n8x0_i2c_board_info_1, |
708 | ARRAY_SIZE(n8x0_i2c_board_info_1)); | 616 | ARRAY_SIZE(n8x0_i2c_board_info_1)); |
709 | omap_register_i2c_bus(2, 400, NULL, 0); | 617 | if (board_is_n810()) |
710 | if (machine_is_nokia_n810()) | 618 | i2c_register_board_info(1, n810_i2c_board_info_2, |
711 | i2c_register_board_info(2, n810_i2c_board_info_2, | ||
712 | ARRAY_SIZE(n810_i2c_board_info_2)); | 619 | ARRAY_SIZE(n810_i2c_board_info_2)); |
713 | board_serial_init(); | ||
714 | omap_sdrc_init(NULL, NULL); | ||
715 | gpmc_onenand_init(board_onenand_data); | ||
716 | n8x0_mmc_init(); | ||
717 | n8x0_usb_init(); | ||
718 | n8x0_cbus_init(); | ||
719 | } | ||
720 | 620 | ||
721 | MACHINE_START(NOKIA_N800, "Nokia N800") | 621 | return &mmc1_data; |
722 | .atag_offset = 0x100, | 622 | } |
723 | .reserve = omap_reserve, | ||
724 | .map_io = omap242x_map_io, | ||
725 | .init_early = omap2420_init_early, | ||
726 | .init_irq = omap2_init_irq, | ||
727 | .handle_irq = omap2_intc_handle_irq, | ||
728 | .init_machine = n8x0_init_machine, | ||
729 | .init_late = omap2420_init_late, | ||
730 | .init_time = omap2_sync32k_timer_init, | ||
731 | .restart = omap2xxx_restart, | ||
732 | MACHINE_END | ||
733 | |||
734 | MACHINE_START(NOKIA_N810, "Nokia N810") | ||
735 | .atag_offset = 0x100, | ||
736 | .reserve = omap_reserve, | ||
737 | .map_io = omap242x_map_io, | ||
738 | .init_early = omap2420_init_early, | ||
739 | .init_irq = omap2_init_irq, | ||
740 | .handle_irq = omap2_intc_handle_irq, | ||
741 | .init_machine = n8x0_init_machine, | ||
742 | .init_late = omap2420_init_late, | ||
743 | .init_time = omap2_sync32k_timer_init, | ||
744 | .restart = omap2xxx_restart, | ||
745 | MACHINE_END | ||
746 | |||
747 | MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") | ||
748 | .atag_offset = 0x100, | ||
749 | .reserve = omap_reserve, | ||
750 | .map_io = omap242x_map_io, | ||
751 | .init_early = omap2420_init_early, | ||
752 | .init_irq = omap2_init_irq, | ||
753 | .handle_irq = omap2_intc_handle_irq, | ||
754 | .init_machine = n8x0_init_machine, | ||
755 | .init_late = omap2420_init_late, | ||
756 | .init_time = omap2_sync32k_timer_init, | ||
757 | .restart = omap2xxx_restart, | ||
758 | MACHINE_END | ||
diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h index 72bb41b3fd25..f338177e6900 100644 --- a/arch/arm/mach-omap2/common-board-devices.h +++ b/arch/arm/mach-omap2/common-board-devices.h | |||
@@ -10,5 +10,6 @@ struct ads7846_platform_data; | |||
10 | 10 | ||
11 | void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, | 11 | void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, |
12 | struct ads7846_platform_data *board_pdata); | 12 | struct ads7846_platform_data *board_pdata); |
13 | void *n8x0_legacy_init(void); | ||
13 | 14 | ||
14 | #endif /* __OMAP_COMMON_BOARD_DEVICES__ */ | 15 | #endif /* __OMAP_COMMON_BOARD_DEVICES__ */ |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index f7644febee81..240db38f232c 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -293,13 +293,13 @@ static inline void omap4_cpu_resume(void) | |||
293 | #endif | 293 | #endif |
294 | 294 | ||
295 | void pdata_quirks_init(struct of_device_id *); | 295 | void pdata_quirks_init(struct of_device_id *); |
296 | void omap_auxdata_legacy_init(struct device *dev); | ||
296 | void omap_pcs_legacy_init(int irq, void (*rearm)(void)); | 297 | void omap_pcs_legacy_init(int irq, void (*rearm)(void)); |
297 | 298 | ||
298 | struct omap_sdrc_params; | 299 | struct omap_sdrc_params; |
299 | extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | 300 | extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, |
300 | struct omap_sdrc_params *sdrc_cs1); | 301 | struct omap_sdrc_params *sdrc_cs1); |
301 | struct omap2_hsmmc_info; | 302 | struct omap2_hsmmc_info; |
302 | extern int omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers); | ||
303 | extern void omap_reserve(void); | 303 | extern void omap_reserve(void); |
304 | 304 | ||
305 | struct omap_hwmod; | 305 | struct omap_hwmod; |
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index a4e536b11ec9..58347bb874a0 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c | |||
@@ -32,7 +32,6 @@ | |||
32 | 32 | ||
33 | #include "soc.h" | 33 | #include "soc.h" |
34 | #include "iomap.h" | 34 | #include "iomap.h" |
35 | #include "mux.h" | ||
36 | #include "control.h" | 35 | #include "control.h" |
37 | #include "display.h" | 36 | #include "display.h" |
38 | #include "prm.h" | 37 | #include "prm.h" |
@@ -102,90 +101,13 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initconst = { | |||
102 | { "dss_hdmi", "omapdss_hdmi", -1 }, | 101 | { "dss_hdmi", "omapdss_hdmi", -1 }, |
103 | }; | 102 | }; |
104 | 103 | ||
105 | static void __init omap4_tpd12s015_mux_pads(void) | ||
106 | { | ||
107 | omap_mux_init_signal("hdmi_cec", | ||
108 | OMAP_PIN_INPUT_PULLUP); | ||
109 | omap_mux_init_signal("hdmi_ddc_scl", | ||
110 | OMAP_PIN_INPUT_PULLUP); | ||
111 | omap_mux_init_signal("hdmi_ddc_sda", | ||
112 | OMAP_PIN_INPUT_PULLUP); | ||
113 | } | ||
114 | |||
115 | static void __init omap4_hdmi_mux_pads(enum omap_hdmi_flags flags) | ||
116 | { | ||
117 | u32 reg; | ||
118 | u16 control_i2c_1; | ||
119 | |||
120 | /* | ||
121 | * CONTROL_I2C_1: HDMI_DDC_SDA_PULLUPRESX (bit 28) and | ||
122 | * HDMI_DDC_SCL_PULLUPRESX (bit 24) are set to disable | ||
123 | * internal pull up resistor. | ||
124 | */ | ||
125 | if (flags & OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP) { | ||
126 | control_i2c_1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_I2C_1; | ||
127 | reg = omap4_ctrl_pad_readl(control_i2c_1); | ||
128 | reg |= (OMAP4_HDMI_DDC_SDA_PULLUPRESX_MASK | | ||
129 | OMAP4_HDMI_DDC_SCL_PULLUPRESX_MASK); | ||
130 | omap4_ctrl_pad_writel(reg, control_i2c_1); | ||
131 | } | ||
132 | } | ||
133 | |||
134 | static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) | ||
135 | { | ||
136 | u32 enable_mask, enable_shift; | ||
137 | u32 pipd_mask, pipd_shift; | ||
138 | u32 reg; | ||
139 | |||
140 | if (dsi_id == 0) { | ||
141 | enable_mask = OMAP4_DSI1_LANEENABLE_MASK; | ||
142 | enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT; | ||
143 | pipd_mask = OMAP4_DSI1_PIPD_MASK; | ||
144 | pipd_shift = OMAP4_DSI1_PIPD_SHIFT; | ||
145 | } else if (dsi_id == 1) { | ||
146 | enable_mask = OMAP4_DSI2_LANEENABLE_MASK; | ||
147 | enable_shift = OMAP4_DSI2_LANEENABLE_SHIFT; | ||
148 | pipd_mask = OMAP4_DSI2_PIPD_MASK; | ||
149 | pipd_shift = OMAP4_DSI2_PIPD_SHIFT; | ||
150 | } else { | ||
151 | return -ENODEV; | ||
152 | } | ||
153 | |||
154 | reg = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY); | ||
155 | |||
156 | reg &= ~enable_mask; | ||
157 | reg &= ~pipd_mask; | ||
158 | |||
159 | reg |= (lanes << enable_shift) & enable_mask; | ||
160 | reg |= (lanes << pipd_shift) & pipd_mask; | ||
161 | |||
162 | omap4_ctrl_pad_writel(reg, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY); | ||
163 | |||
164 | return 0; | ||
165 | } | ||
166 | |||
167 | int __init omap_hdmi_init(enum omap_hdmi_flags flags) | ||
168 | { | ||
169 | if (cpu_is_omap44xx()) { | ||
170 | omap4_hdmi_mux_pads(flags); | ||
171 | omap4_tpd12s015_mux_pads(); | ||
172 | } | ||
173 | |||
174 | return 0; | ||
175 | } | ||
176 | |||
177 | static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask) | 104 | static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask) |
178 | { | 105 | { |
179 | if (cpu_is_omap44xx()) | ||
180 | return omap4_dsi_mux_pads(dsi_id, lane_mask); | ||
181 | |||
182 | return 0; | 106 | return 0; |
183 | } | 107 | } |
184 | 108 | ||
185 | static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask) | 109 | static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask) |
186 | { | 110 | { |
187 | if (cpu_is_omap44xx()) | ||
188 | omap4_dsi_mux_pads(dsi_id, 0); | ||
189 | } | 111 | } |
190 | 112 | ||
191 | static int omap_dss_set_min_bus_tput(struct device *dev, unsigned long tput) | 113 | static int omap_dss_set_min_bus_tput(struct device *dev, unsigned long tput) |
diff --git a/arch/arm/mach-omap2/dss-common.c b/arch/arm/mach-omap2/dss-common.c index 365bfd3d9c68..dadccc91488c 100644 --- a/arch/arm/mach-omap2/dss-common.c +++ b/arch/arm/mach-omap2/dss-common.c | |||
@@ -223,7 +223,7 @@ void __init omap_4430sdp_display_init_of(void) | |||
223 | static struct connector_dvi_platform_data omap3_igep2_dvi_connector_pdata = { | 223 | static struct connector_dvi_platform_data omap3_igep2_dvi_connector_pdata = { |
224 | .name = "dvi", | 224 | .name = "dvi", |
225 | .source = "tfp410.0", | 225 | .source = "tfp410.0", |
226 | .i2c_bus_num = 3, | 226 | .i2c_bus_num = 2, |
227 | }; | 227 | }; |
228 | 228 | ||
229 | static struct platform_device omap3_igep2_dvi_connector_device = { | 229 | static struct platform_device omap3_igep2_dvi_connector_device = { |
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 81de56251955..d24926e6340f 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -1502,6 +1502,22 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, | |||
1502 | } | 1502 | } |
1503 | 1503 | ||
1504 | /* | 1504 | /* |
1505 | * For some GPMC devices we still need to rely on the bootloader | ||
1506 | * timings because the devices can be connected via FPGA. So far | ||
1507 | * the list is smc91x on the omap2 SDP boards, and 8250 on zooms. | ||
1508 | * REVISIT: Add timing support from slls644g.pdf and from the | ||
1509 | * lan91c96 manual. | ||
1510 | */ | ||
1511 | if (of_device_is_compatible(child, "ns16550a") || | ||
1512 | of_device_is_compatible(child, "smsc,lan91c94") || | ||
1513 | of_device_is_compatible(child, "smsc,lan91c111")) { | ||
1514 | dev_warn(&pdev->dev, | ||
1515 | "%s using bootloader timings on CS%d\n", | ||
1516 | child->name, cs); | ||
1517 | goto no_timings; | ||
1518 | } | ||
1519 | |||
1520 | /* | ||
1505 | * FIXME: gpmc_cs_request() will map the CS to an arbitary | 1521 | * FIXME: gpmc_cs_request() will map the CS to an arbitary |
1506 | * location in the gpmc address space. When booting with | 1522 | * location in the gpmc address space. When booting with |
1507 | * device-tree we want the NOR flash to be mapped to the | 1523 | * device-tree we want the NOR flash to be mapped to the |
@@ -1529,6 +1545,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, | |||
1529 | gpmc_read_timings_dt(child, &gpmc_t); | 1545 | gpmc_read_timings_dt(child, &gpmc_t); |
1530 | gpmc_cs_set_timings(cs, &gpmc_t); | 1546 | gpmc_cs_set_timings(cs, &gpmc_t); |
1531 | 1547 | ||
1548 | no_timings: | ||
1532 | if (of_platform_device_create(child, NULL, &pdev->dev)) | 1549 | if (of_platform_device_create(child, NULL, &pdev->dev)) |
1533 | return 0; | 1550 | return 0; |
1534 | 1551 | ||
@@ -1541,42 +1558,6 @@ err: | |||
1541 | return ret; | 1558 | return ret; |
1542 | } | 1559 | } |
1543 | 1560 | ||
1544 | /* | ||
1545 | * REVISIT: Add timing support from slls644g.pdf | ||
1546 | */ | ||
1547 | static int gpmc_probe_8250(struct platform_device *pdev, | ||
1548 | struct device_node *child) | ||
1549 | { | ||
1550 | struct resource res; | ||
1551 | unsigned long base; | ||
1552 | int ret, cs; | ||
1553 | |||
1554 | if (of_property_read_u32(child, "reg", &cs) < 0) { | ||
1555 | dev_err(&pdev->dev, "%s has no 'reg' property\n", | ||
1556 | child->full_name); | ||
1557 | return -ENODEV; | ||
1558 | } | ||
1559 | |||
1560 | if (of_address_to_resource(child, 0, &res) < 0) { | ||
1561 | dev_err(&pdev->dev, "%s has malformed 'reg' property\n", | ||
1562 | child->full_name); | ||
1563 | return -ENODEV; | ||
1564 | } | ||
1565 | |||
1566 | ret = gpmc_cs_request(cs, resource_size(&res), &base); | ||
1567 | if (ret < 0) { | ||
1568 | dev_err(&pdev->dev, "cannot request GPMC CS %d\n", cs); | ||
1569 | return ret; | ||
1570 | } | ||
1571 | |||
1572 | if (of_platform_device_create(child, NULL, &pdev->dev)) | ||
1573 | return 0; | ||
1574 | |||
1575 | dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name); | ||
1576 | |||
1577 | return -ENODEV; | ||
1578 | } | ||
1579 | |||
1580 | static int gpmc_probe_dt(struct platform_device *pdev) | 1561 | static int gpmc_probe_dt(struct platform_device *pdev) |
1581 | { | 1562 | { |
1582 | int ret; | 1563 | int ret; |
@@ -1618,10 +1599,9 @@ static int gpmc_probe_dt(struct platform_device *pdev) | |||
1618 | else if (of_node_cmp(child->name, "onenand") == 0) | 1599 | else if (of_node_cmp(child->name, "onenand") == 0) |
1619 | ret = gpmc_probe_onenand_child(pdev, child); | 1600 | ret = gpmc_probe_onenand_child(pdev, child); |
1620 | else if (of_node_cmp(child->name, "ethernet") == 0 || | 1601 | else if (of_node_cmp(child->name, "ethernet") == 0 || |
1621 | of_node_cmp(child->name, "nor") == 0) | 1602 | of_node_cmp(child->name, "nor") == 0 || |
1603 | of_node_cmp(child->name, "uart") == 0) | ||
1622 | ret = gpmc_probe_generic_child(pdev, child); | 1604 | ret = gpmc_probe_generic_child(pdev, child); |
1623 | else if (of_node_cmp(child->name, "8250") == 0) | ||
1624 | ret = gpmc_probe_8250(pdev, child); | ||
1625 | 1605 | ||
1626 | if (WARN(ret < 0, "%s: probing gpmc child %s failed\n", | 1606 | if (WARN(ret < 0, "%s: probing gpmc child %s failed\n", |
1627 | __func__, child->full_name)) | 1607 | __func__, child->full_name)) |
diff --git a/arch/arm/mach-omap2/msdi.c b/arch/arm/mach-omap2/msdi.c index c52d8b4a3e91..828e0db3d943 100644 --- a/arch/arm/mach-omap2/msdi.c +++ b/arch/arm/mach-omap2/msdi.c | |||
@@ -88,72 +88,3 @@ int omap_msdi_reset(struct omap_hwmod *oh) | |||
88 | 88 | ||
89 | return 0; | 89 | return 0; |
90 | } | 90 | } |
91 | |||
92 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) | ||
93 | |||
94 | static inline void omap242x_mmc_mux(struct omap_mmc_platform_data | ||
95 | *mmc_controller) | ||
96 | { | ||
97 | if ((mmc_controller->slots[0].switch_pin > 0) && \ | ||
98 | (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) | ||
99 | omap_mux_init_gpio(mmc_controller->slots[0].switch_pin, | ||
100 | OMAP_PIN_INPUT_PULLUP); | ||
101 | if ((mmc_controller->slots[0].gpio_wp > 0) && \ | ||
102 | (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES)) | ||
103 | omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, | ||
104 | OMAP_PIN_INPUT_PULLUP); | ||
105 | |||
106 | omap_mux_init_signal("sdmmc_cmd", 0); | ||
107 | omap_mux_init_signal("sdmmc_clki", 0); | ||
108 | omap_mux_init_signal("sdmmc_clko", 0); | ||
109 | omap_mux_init_signal("sdmmc_dat0", 0); | ||
110 | omap_mux_init_signal("sdmmc_dat_dir0", 0); | ||
111 | omap_mux_init_signal("sdmmc_cmd_dir", 0); | ||
112 | if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) { | ||
113 | omap_mux_init_signal("sdmmc_dat1", 0); | ||
114 | omap_mux_init_signal("sdmmc_dat2", 0); | ||
115 | omap_mux_init_signal("sdmmc_dat3", 0); | ||
116 | omap_mux_init_signal("sdmmc_dat_dir1", 0); | ||
117 | omap_mux_init_signal("sdmmc_dat_dir2", 0); | ||
118 | omap_mux_init_signal("sdmmc_dat_dir3", 0); | ||
119 | } | ||
120 | |||
121 | /* | ||
122 | * Use internal loop-back in MMC/SDIO Module Input Clock | ||
123 | * selection | ||
124 | */ | ||
125 | if (mmc_controller->slots[0].internal_clock) { | ||
126 | u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
127 | v |= (1 << 24); | ||
128 | omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0); | ||
129 | } | ||
130 | } | ||
131 | |||
132 | void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data) | ||
133 | { | ||
134 | struct platform_device *pdev; | ||
135 | struct omap_hwmod *oh; | ||
136 | int id = 0; | ||
137 | char *oh_name = "msdi1"; | ||
138 | char *dev_name = "mmci-omap"; | ||
139 | |||
140 | if (!mmc_data[0]) { | ||
141 | pr_err("%s fails: Incomplete platform data\n", __func__); | ||
142 | return; | ||
143 | } | ||
144 | |||
145 | omap242x_mmc_mux(mmc_data[0]); | ||
146 | |||
147 | oh = omap_hwmod_lookup(oh_name); | ||
148 | if (!oh) { | ||
149 | pr_err("Could not look up %s\n", oh_name); | ||
150 | return; | ||
151 | } | ||
152 | pdev = omap_device_build(dev_name, id, oh, mmc_data[0], | ||
153 | sizeof(struct omap_mmc_platform_data)); | ||
154 | if (IS_ERR(pdev)) | ||
155 | WARN(1, "Can'd build omap_device for %s:%s.\n", | ||
156 | dev_name, oh->name); | ||
157 | } | ||
158 | |||
159 | #endif | ||
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h index 16f78a990d04..a722330d4d53 100644 --- a/arch/arm/mach-omap2/mux.h +++ b/arch/arm/mach-omap2/mux.h | |||
@@ -7,8 +7,6 @@ | |||
7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "mux2420.h" | ||
11 | #include "mux2430.h" | ||
12 | #include "mux34xx.h" | 10 | #include "mux34xx.h" |
13 | 11 | ||
14 | #define OMAP_MUX_TERMINATOR 0xffff | 12 | #define OMAP_MUX_TERMINATOR 0xffff |
diff --git a/arch/arm/mach-omap2/mux2420.c b/arch/arm/mach-omap2/mux2420.c deleted file mode 100644 index cf6de0971c6c..000000000000 --- a/arch/arm/mach-omap2/mux2420.c +++ /dev/null | |||
@@ -1,690 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Nokia | ||
3 | * Copyright (C) 2010 Texas Instruments | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #include <linux/module.h> | ||
11 | #include <linux/init.h> | ||
12 | |||
13 | #include "mux.h" | ||
14 | |||
15 | #ifdef CONFIG_OMAP_MUX | ||
16 | |||
17 | #define _OMAP2420_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \ | ||
18 | { \ | ||
19 | .reg_offset = (OMAP2420_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
20 | .gpio = (g), \ | ||
21 | .muxnames = { m0, m1, m2, m3, m4, m5, m6, m7 }, \ | ||
22 | } | ||
23 | |||
24 | #else | ||
25 | |||
26 | #define _OMAP2420_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \ | ||
27 | { \ | ||
28 | .reg_offset = (OMAP2420_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
29 | .gpio = (g), \ | ||
30 | } | ||
31 | |||
32 | #endif | ||
33 | |||
34 | #define _OMAP2420_BALLENTRY(M0, bb, bt) \ | ||
35 | { \ | ||
36 | .reg_offset = (OMAP2420_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
37 | .balls = { bb, bt }, \ | ||
38 | } | ||
39 | |||
40 | /* | ||
41 | * Superset of all mux modes for omap2420 | ||
42 | */ | ||
43 | static struct omap_mux __initdata omap2420_muxmodes[] = { | ||
44 | _OMAP2420_MUXENTRY(CAM_D0, 54, | ||
45 | "cam_d0", "hw_dbg2", "sti_dout", "gpio_54", | ||
46 | NULL, NULL, "etk_d2", NULL), | ||
47 | _OMAP2420_MUXENTRY(CAM_D1, 53, | ||
48 | "cam_d1", "hw_dbg3", "sti_din", "gpio_53", | ||
49 | NULL, NULL, "etk_d3", NULL), | ||
50 | _OMAP2420_MUXENTRY(CAM_D2, 52, | ||
51 | "cam_d2", "hw_dbg4", "mcbsp1_clkx", "gpio_52", | ||
52 | NULL, NULL, "etk_d4", NULL), | ||
53 | _OMAP2420_MUXENTRY(CAM_D3, 51, | ||
54 | "cam_d3", "hw_dbg5", "mcbsp1_dr", "gpio_51", | ||
55 | NULL, NULL, "etk_d5", NULL), | ||
56 | _OMAP2420_MUXENTRY(CAM_D4, 50, | ||
57 | "cam_d4", "hw_dbg6", "mcbsp1_fsr", "gpio_50", | ||
58 | NULL, NULL, "etk_d6", NULL), | ||
59 | _OMAP2420_MUXENTRY(CAM_D5, 49, | ||
60 | "cam_d5", "hw_dbg7", "mcbsp1_clkr", "gpio_49", | ||
61 | NULL, NULL, "etk_d7", NULL), | ||
62 | _OMAP2420_MUXENTRY(CAM_D6, 0, | ||
63 | "cam_d6", "hw_dbg8", NULL, NULL, | ||
64 | NULL, NULL, "etk_d8", NULL), | ||
65 | _OMAP2420_MUXENTRY(CAM_D7, 0, | ||
66 | "cam_d7", "hw_dbg9", NULL, NULL, | ||
67 | NULL, NULL, "etk_d9", NULL), | ||
68 | _OMAP2420_MUXENTRY(CAM_D8, 54, | ||
69 | "cam_d8", "hw_dbg10", NULL, "gpio_54", | ||
70 | NULL, NULL, "etk_d10", NULL), | ||
71 | _OMAP2420_MUXENTRY(CAM_D9, 53, | ||
72 | "cam_d9", "hw_dbg11", NULL, "gpio_53", | ||
73 | NULL, NULL, "etk_d11", NULL), | ||
74 | _OMAP2420_MUXENTRY(CAM_HS, 55, | ||
75 | "cam_hs", "hw_dbg1", "mcbsp1_dx", "gpio_55", | ||
76 | NULL, NULL, "etk_d1", NULL), | ||
77 | _OMAP2420_MUXENTRY(CAM_LCLK, 57, | ||
78 | "cam_lclk", NULL, "mcbsp_clks", "gpio_57", | ||
79 | NULL, NULL, "etk_c1", NULL), | ||
80 | _OMAP2420_MUXENTRY(CAM_VS, 56, | ||
81 | "cam_vs", "hw_dbg0", "mcbsp1_fsx", "gpio_56", | ||
82 | NULL, NULL, "etk_d0", NULL), | ||
83 | _OMAP2420_MUXENTRY(CAM_XCLK, 0, | ||
84 | "cam_xclk", NULL, "sti_clk", NULL, | ||
85 | NULL, NULL, "etk_c2", NULL), | ||
86 | _OMAP2420_MUXENTRY(DSS_ACBIAS, 48, | ||
87 | "dss_acbias", NULL, "mcbsp2_fsx", "gpio_48", | ||
88 | NULL, NULL, NULL, NULL), | ||
89 | _OMAP2420_MUXENTRY(DSS_DATA10, 40, | ||
90 | "dss_data10", NULL, NULL, "gpio_40", | ||
91 | NULL, NULL, NULL, NULL), | ||
92 | _OMAP2420_MUXENTRY(DSS_DATA11, 41, | ||
93 | "dss_data11", NULL, NULL, "gpio_41", | ||
94 | NULL, NULL, NULL, NULL), | ||
95 | _OMAP2420_MUXENTRY(DSS_DATA12, 42, | ||
96 | "dss_data12", NULL, NULL, "gpio_42", | ||
97 | NULL, NULL, NULL, NULL), | ||
98 | _OMAP2420_MUXENTRY(DSS_DATA13, 43, | ||
99 | "dss_data13", NULL, NULL, "gpio_43", | ||
100 | NULL, NULL, NULL, NULL), | ||
101 | _OMAP2420_MUXENTRY(DSS_DATA14, 44, | ||
102 | "dss_data14", NULL, NULL, "gpio_44", | ||
103 | NULL, NULL, NULL, NULL), | ||
104 | _OMAP2420_MUXENTRY(DSS_DATA15, 45, | ||
105 | "dss_data15", NULL, NULL, "gpio_45", | ||
106 | NULL, NULL, NULL, NULL), | ||
107 | _OMAP2420_MUXENTRY(DSS_DATA16, 46, | ||
108 | "dss_data16", NULL, NULL, "gpio_46", | ||
109 | NULL, NULL, NULL, NULL), | ||
110 | _OMAP2420_MUXENTRY(DSS_DATA17, 47, | ||
111 | "dss_data17", NULL, NULL, "gpio_47", | ||
112 | NULL, NULL, NULL, NULL), | ||
113 | _OMAP2420_MUXENTRY(DSS_DATA8, 38, | ||
114 | "dss_data8", NULL, NULL, "gpio_38", | ||
115 | NULL, NULL, NULL, NULL), | ||
116 | _OMAP2420_MUXENTRY(DSS_DATA9, 39, | ||
117 | "dss_data9", NULL, NULL, "gpio_39", | ||
118 | NULL, NULL, NULL, NULL), | ||
119 | _OMAP2420_MUXENTRY(EAC_AC_DIN, 115, | ||
120 | "eac_ac_din", "mcbsp2_dr", NULL, "gpio_115", | ||
121 | NULL, NULL, NULL, NULL), | ||
122 | _OMAP2420_MUXENTRY(EAC_AC_DOUT, 116, | ||
123 | "eac_ac_dout", "mcbsp2_dx", NULL, "gpio_116", | ||
124 | NULL, NULL, NULL, NULL), | ||
125 | _OMAP2420_MUXENTRY(EAC_AC_FS, 114, | ||
126 | "eac_ac_fs", "mcbsp2_fsx", NULL, "gpio_114", | ||
127 | NULL, NULL, NULL, NULL), | ||
128 | _OMAP2420_MUXENTRY(EAC_AC_MCLK, 117, | ||
129 | "eac_ac_mclk", NULL, NULL, "gpio_117", | ||
130 | NULL, NULL, NULL, NULL), | ||
131 | _OMAP2420_MUXENTRY(EAC_AC_RST, 118, | ||
132 | "eac_ac_rst", "eac_bt_din", NULL, "gpio_118", | ||
133 | NULL, NULL, NULL, NULL), | ||
134 | _OMAP2420_MUXENTRY(EAC_AC_SCLK, 113, | ||
135 | "eac_ac_sclk", "mcbsp2_clkx", NULL, "gpio_113", | ||
136 | NULL, NULL, NULL, NULL), | ||
137 | _OMAP2420_MUXENTRY(EAC_BT_DIN, 73, | ||
138 | "eac_bt_din", NULL, NULL, "gpio_73", | ||
139 | NULL, NULL, "etk_d9", NULL), | ||
140 | _OMAP2420_MUXENTRY(EAC_BT_DOUT, 74, | ||
141 | "eac_bt_dout", NULL, "sti_clk", "gpio_74", | ||
142 | NULL, NULL, "etk_d8", NULL), | ||
143 | _OMAP2420_MUXENTRY(EAC_BT_FS, 72, | ||
144 | "eac_bt_fs", NULL, NULL, "gpio_72", | ||
145 | NULL, NULL, "etk_d10", NULL), | ||
146 | _OMAP2420_MUXENTRY(EAC_BT_SCLK, 71, | ||
147 | "eac_bt_sclk", NULL, NULL, "gpio_71", | ||
148 | NULL, NULL, "etk_d11", NULL), | ||
149 | _OMAP2420_MUXENTRY(GPIO_119, 119, | ||
150 | "gpio_119", NULL, "sti_din", "gpio_119", | ||
151 | NULL, "sys_boot0", "etk_d12", NULL), | ||
152 | _OMAP2420_MUXENTRY(GPIO_120, 120, | ||
153 | "gpio_120", NULL, "sti_dout", "gpio_120", | ||
154 | "cam_d9", "sys_boot1", "etk_d13", NULL), | ||
155 | _OMAP2420_MUXENTRY(GPIO_121, 121, | ||
156 | "gpio_121", NULL, NULL, "gpio_121", | ||
157 | "jtag_emu2", "sys_boot2", "etk_d14", NULL), | ||
158 | _OMAP2420_MUXENTRY(GPIO_122, 122, | ||
159 | "gpio_122", NULL, NULL, "gpio_122", | ||
160 | "jtag_emu3", "sys_boot3", "etk_d15", NULL), | ||
161 | _OMAP2420_MUXENTRY(GPIO_124, 124, | ||
162 | "gpio_124", NULL, NULL, "gpio_124", | ||
163 | NULL, "sys_boot5", NULL, NULL), | ||
164 | _OMAP2420_MUXENTRY(GPIO_125, 125, | ||
165 | "gpio_125", "sys_jtagsel1", "sys_jtagsel2", "gpio_125", | ||
166 | NULL, NULL, NULL, NULL), | ||
167 | _OMAP2420_MUXENTRY(GPIO_36, 36, | ||
168 | "gpio_36", NULL, NULL, "gpio_36", | ||
169 | NULL, "sys_boot4", NULL, NULL), | ||
170 | _OMAP2420_MUXENTRY(GPIO_62, 62, | ||
171 | "gpio_62", "uart1_rx", "usb1_dat", "gpio_62", | ||
172 | NULL, NULL, NULL, NULL), | ||
173 | _OMAP2420_MUXENTRY(GPIO_6, 6, | ||
174 | "gpio_6", "tv_detpulse", NULL, "gpio_6", | ||
175 | NULL, NULL, NULL, NULL), | ||
176 | _OMAP2420_MUXENTRY(GPMC_A10, 3, | ||
177 | "gpmc_a10", NULL, "sys_ndmareq5", "gpio_3", | ||
178 | NULL, NULL, NULL, NULL), | ||
179 | _OMAP2420_MUXENTRY(GPMC_A1, 12, | ||
180 | "gpmc_a1", "dss_data18", NULL, "gpio_12", | ||
181 | NULL, NULL, NULL, NULL), | ||
182 | _OMAP2420_MUXENTRY(GPMC_A2, 11, | ||
183 | "gpmc_a2", "dss_data19", NULL, "gpio_11", | ||
184 | NULL, NULL, NULL, NULL), | ||
185 | _OMAP2420_MUXENTRY(GPMC_A3, 10, | ||
186 | "gpmc_a3", "dss_data20", NULL, "gpio_10", | ||
187 | NULL, NULL, NULL, NULL), | ||
188 | _OMAP2420_MUXENTRY(GPMC_A4, 9, | ||
189 | "gpmc_a4", "dss_data21", NULL, "gpio_9", | ||
190 | NULL, NULL, NULL, NULL), | ||
191 | _OMAP2420_MUXENTRY(GPMC_A5, 8, | ||
192 | "gpmc_a5", "dss_data22", NULL, "gpio_8", | ||
193 | NULL, NULL, NULL, NULL), | ||
194 | _OMAP2420_MUXENTRY(GPMC_A6, 7, | ||
195 | "gpmc_a6", "dss_data23", NULL, "gpio_7", | ||
196 | NULL, NULL, NULL, NULL), | ||
197 | _OMAP2420_MUXENTRY(GPMC_A7, 6, | ||
198 | "gpmc_a7", NULL, "sys_ndmareq2", "gpio_6", | ||
199 | NULL, NULL, NULL, NULL), | ||
200 | _OMAP2420_MUXENTRY(GPMC_A8, 5, | ||
201 | "gpmc_a8", NULL, "sys_ndmareq3", "gpio_5", | ||
202 | NULL, NULL, NULL, NULL), | ||
203 | _OMAP2420_MUXENTRY(GPMC_A9, 4, | ||
204 | "gpmc_a9", NULL, "sys_ndmareq4", "gpio_4", | ||
205 | NULL, NULL, NULL, NULL), | ||
206 | _OMAP2420_MUXENTRY(GPMC_CLK, 21, | ||
207 | "gpmc_clk", NULL, NULL, "gpio_21", | ||
208 | NULL, NULL, NULL, NULL), | ||
209 | _OMAP2420_MUXENTRY(GPMC_D10, 18, | ||
210 | "gpmc_d10", "ssi2_rdy_rx", NULL, "gpio_18", | ||
211 | NULL, NULL, NULL, NULL), | ||
212 | _OMAP2420_MUXENTRY(GPMC_D11, 17, | ||
213 | "gpmc_d11", "ssi2_flag_rx", NULL, "gpio_17", | ||
214 | NULL, NULL, NULL, NULL), | ||
215 | _OMAP2420_MUXENTRY(GPMC_D12, 16, | ||
216 | "gpmc_d12", "ssi2_dat_rx", NULL, "gpio_16", | ||
217 | NULL, NULL, NULL, NULL), | ||
218 | _OMAP2420_MUXENTRY(GPMC_D13, 15, | ||
219 | "gpmc_d13", "ssi2_rdy_tx", NULL, "gpio_15", | ||
220 | NULL, NULL, NULL, NULL), | ||
221 | _OMAP2420_MUXENTRY(GPMC_D14, 14, | ||
222 | "gpmc_d14", "ssi2_flag_tx", NULL, "gpio_14", | ||
223 | NULL, NULL, NULL, NULL), | ||
224 | _OMAP2420_MUXENTRY(GPMC_D15, 13, | ||
225 | "gpmc_d15", "ssi2_dat_tx", NULL, "gpio_13", | ||
226 | NULL, NULL, NULL, NULL), | ||
227 | _OMAP2420_MUXENTRY(GPMC_D8, 20, | ||
228 | "gpmc_d8", NULL, NULL, "gpio_20", | ||
229 | NULL, NULL, NULL, NULL), | ||
230 | _OMAP2420_MUXENTRY(GPMC_D9, 19, | ||
231 | "gpmc_d9", "ssi2_wake", NULL, "gpio_19", | ||
232 | NULL, NULL, NULL, NULL), | ||
233 | _OMAP2420_MUXENTRY(GPMC_NBE0, 29, | ||
234 | "gpmc_nbe0", NULL, NULL, "gpio_29", | ||
235 | NULL, NULL, NULL, NULL), | ||
236 | _OMAP2420_MUXENTRY(GPMC_NBE1, 30, | ||
237 | "gpmc_nbe1", NULL, NULL, "gpio_30", | ||
238 | NULL, NULL, NULL, NULL), | ||
239 | _OMAP2420_MUXENTRY(GPMC_NCS1, 22, | ||
240 | "gpmc_ncs1", NULL, NULL, "gpio_22", | ||
241 | NULL, NULL, NULL, NULL), | ||
242 | _OMAP2420_MUXENTRY(GPMC_NCS2, 23, | ||
243 | "gpmc_ncs2", NULL, NULL, "gpio_23", | ||
244 | NULL, NULL, NULL, NULL), | ||
245 | _OMAP2420_MUXENTRY(GPMC_NCS3, 24, | ||
246 | "gpmc_ncs3", "gpmc_io_dir", NULL, "gpio_24", | ||
247 | NULL, NULL, NULL, NULL), | ||
248 | _OMAP2420_MUXENTRY(GPMC_NCS4, 25, | ||
249 | "gpmc_ncs4", NULL, NULL, "gpio_25", | ||
250 | NULL, NULL, NULL, NULL), | ||
251 | _OMAP2420_MUXENTRY(GPMC_NCS5, 26, | ||
252 | "gpmc_ncs5", NULL, NULL, "gpio_26", | ||
253 | NULL, NULL, NULL, NULL), | ||
254 | _OMAP2420_MUXENTRY(GPMC_NCS6, 27, | ||
255 | "gpmc_ncs6", NULL, NULL, "gpio_27", | ||
256 | NULL, NULL, NULL, NULL), | ||
257 | _OMAP2420_MUXENTRY(GPMC_NCS7, 28, | ||
258 | "gpmc_ncs7", "gpmc_io_dir", "gpio_28", NULL, | ||
259 | NULL, NULL, NULL, NULL), | ||
260 | _OMAP2420_MUXENTRY(GPMC_NWP, 31, | ||
261 | "gpmc_nwp", NULL, NULL, "gpio_31", | ||
262 | NULL, NULL, NULL, NULL), | ||
263 | _OMAP2420_MUXENTRY(GPMC_WAIT1, 33, | ||
264 | "gpmc_wait1", NULL, NULL, "gpio_33", | ||
265 | NULL, NULL, NULL, NULL), | ||
266 | _OMAP2420_MUXENTRY(GPMC_WAIT2, 34, | ||
267 | "gpmc_wait2", NULL, NULL, "gpio_34", | ||
268 | NULL, NULL, NULL, NULL), | ||
269 | _OMAP2420_MUXENTRY(GPMC_WAIT3, 35, | ||
270 | "gpmc_wait3", NULL, NULL, "gpio_35", | ||
271 | NULL, NULL, NULL, NULL), | ||
272 | _OMAP2420_MUXENTRY(HDQ_SIO, 101, | ||
273 | "hdq_sio", "usb2_tllse0", "sys_altclk", "gpio_101", | ||
274 | NULL, NULL, NULL, NULL), | ||
275 | _OMAP2420_MUXENTRY(I2C2_SCL, 99, | ||
276 | "i2c2_scl", NULL, "gpt9_pwm_evt", "gpio_99", | ||
277 | NULL, NULL, NULL, NULL), | ||
278 | _OMAP2420_MUXENTRY(I2C2_SDA, 100, | ||
279 | "i2c2_sda", NULL, "spi2_ncs1", "gpio_100", | ||
280 | NULL, NULL, NULL, NULL), | ||
281 | _OMAP2420_MUXENTRY(JTAG_EMU0, 127, | ||
282 | "jtag_emu0", NULL, NULL, "gpio_127", | ||
283 | NULL, NULL, NULL, NULL), | ||
284 | _OMAP2420_MUXENTRY(JTAG_EMU1, 126, | ||
285 | "jtag_emu1", NULL, NULL, "gpio_126", | ||
286 | NULL, NULL, NULL, NULL), | ||
287 | _OMAP2420_MUXENTRY(MCBSP1_CLKR, 92, | ||
288 | "mcbsp1_clkr", "ssi2_dat_tx", "vlynq_tx1", "gpio_92", | ||
289 | NULL, NULL, NULL, NULL), | ||
290 | _OMAP2420_MUXENTRY(MCBSP1_CLKX, 98, | ||
291 | "mcbsp1_clkx", "ssi2_wake", "vlynq_nla", "gpio_98", | ||
292 | NULL, NULL, NULL, NULL), | ||
293 | _OMAP2420_MUXENTRY(MCBSP1_DR, 95, | ||
294 | "mcbsp1_dr", "ssi2_dat_rx", "vlynq_rx1", "gpio_95", | ||
295 | NULL, NULL, NULL, NULL), | ||
296 | _OMAP2420_MUXENTRY(MCBSP1_DX, 94, | ||
297 | "mcbsp1_dx", "ssi2_rdy_tx", "vlynq_clk", "gpio_94", | ||
298 | NULL, NULL, NULL, NULL), | ||
299 | _OMAP2420_MUXENTRY(MCBSP1_FSR, 93, | ||
300 | "mcbsp1_fsr", "ssi2_flag_tx", "vlynq_tx0", "gpio_93", | ||
301 | "spi2_ncs1", NULL, NULL, NULL), | ||
302 | _OMAP2420_MUXENTRY(MCBSP1_FSX, 97, | ||
303 | "mcbsp1_fsx", "ssi2_rdy_rx", NULL, "gpio_97", | ||
304 | NULL, NULL, NULL, NULL), | ||
305 | _OMAP2420_MUXENTRY(MCBSP2_CLKX, 12, | ||
306 | "mcbsp2_clkx", NULL, "dss_data23", "gpio_12", | ||
307 | NULL, NULL, NULL, NULL), | ||
308 | _OMAP2420_MUXENTRY(MCBSP2_DR, 11, | ||
309 | "mcbsp2_dr", NULL, "dss_data22", "gpio_11", | ||
310 | NULL, NULL, NULL, NULL), | ||
311 | _OMAP2420_MUXENTRY(MCBSP_CLKS, 96, | ||
312 | "mcbsp_clks", "ssi2_flag_rx", "vlynq_rx0", "gpio_96", | ||
313 | NULL, NULL, NULL, NULL), | ||
314 | _OMAP2420_MUXENTRY(MMC_CLKI, 59, | ||
315 | "sdmmc_clki", "ms_clki", NULL, "gpio_59", | ||
316 | NULL, NULL, NULL, NULL), | ||
317 | _OMAP2420_MUXENTRY(MMC_CLKO, 0, | ||
318 | "sdmmc_clko", "ms_clko", NULL, NULL, | ||
319 | NULL, NULL, NULL, NULL), | ||
320 | _OMAP2420_MUXENTRY(MMC_CMD_DIR, 8, | ||
321 | "sdmmc_cmd_dir", NULL, NULL, "gpio_8", | ||
322 | NULL, NULL, NULL, NULL), | ||
323 | _OMAP2420_MUXENTRY(MMC_CMD, 0, | ||
324 | "sdmmc_cmd", "ms_bs", NULL, NULL, | ||
325 | NULL, NULL, NULL, NULL), | ||
326 | _OMAP2420_MUXENTRY(MMC_DAT_DIR0, 7, | ||
327 | "sdmmc_dat_dir0", "ms_dat0_dir", NULL, "gpio_7", | ||
328 | NULL, NULL, NULL, NULL), | ||
329 | _OMAP2420_MUXENTRY(MMC_DAT0, 0, | ||
330 | "sdmmc_dat0", "ms_dat0", NULL, NULL, | ||
331 | NULL, NULL, NULL, NULL), | ||
332 | _OMAP2420_MUXENTRY(MMC_DAT_DIR1, 78, | ||
333 | "sdmmc_dat_dir1", "ms_datu_dir", "uart2_rts", "gpio_78", | ||
334 | NULL, NULL, NULL, NULL), | ||
335 | _OMAP2420_MUXENTRY(MMC_DAT1, 75, | ||
336 | "sdmmc_dat1", "ms_dat1", NULL, "gpio_75", | ||
337 | NULL, NULL, NULL, NULL), | ||
338 | _OMAP2420_MUXENTRY(MMC_DAT_DIR2, 79, | ||
339 | "sdmmc_dat_dir2", "ms_datu_dir", "uart2_tx", "gpio_79", | ||
340 | NULL, NULL, NULL, NULL), | ||
341 | _OMAP2420_MUXENTRY(MMC_DAT2, 76, | ||
342 | "sdmmc_dat2", "ms_dat2", "uart2_cts", "gpio_76", | ||
343 | NULL, NULL, NULL, NULL), | ||
344 | _OMAP2420_MUXENTRY(MMC_DAT_DIR3, 80, | ||
345 | "sdmmc_dat_dir3", "ms_datu_dir", "uart2_rx", "gpio_80", | ||
346 | NULL, NULL, NULL, NULL), | ||
347 | _OMAP2420_MUXENTRY(MMC_DAT3, 77, | ||
348 | "sdmmc_dat3", "ms_dat3", NULL, "gpio_77", | ||
349 | NULL, NULL, NULL, NULL), | ||
350 | _OMAP2420_MUXENTRY(SDRC_A12, 2, | ||
351 | "sdrc_a12", NULL, NULL, "gpio_2", | ||
352 | NULL, NULL, NULL, NULL), | ||
353 | _OMAP2420_MUXENTRY(SDRC_A13, 1, | ||
354 | "sdrc_a13", NULL, NULL, "gpio_1", | ||
355 | NULL, NULL, NULL, NULL), | ||
356 | _OMAP2420_MUXENTRY(SDRC_A14, 0, | ||
357 | "sdrc_a14", NULL, NULL, "gpio_0", | ||
358 | NULL, NULL, NULL, NULL), | ||
359 | _OMAP2420_MUXENTRY(SDRC_CKE1, 38, | ||
360 | "sdrc_cke1", NULL, NULL, "gpio_38", | ||
361 | NULL, NULL, NULL, NULL), | ||
362 | _OMAP2420_MUXENTRY(SDRC_NCS1, 37, | ||
363 | "sdrc_ncs1", NULL, NULL, "gpio_37", | ||
364 | NULL, NULL, NULL, NULL), | ||
365 | _OMAP2420_MUXENTRY(SPI1_CLK, 81, | ||
366 | "spi1_clk", NULL, NULL, "gpio_81", | ||
367 | NULL, NULL, NULL, NULL), | ||
368 | _OMAP2420_MUXENTRY(SPI1_NCS0, 84, | ||
369 | "spi1_ncs0", NULL, NULL, "gpio_84", | ||
370 | NULL, NULL, NULL, NULL), | ||
371 | _OMAP2420_MUXENTRY(SPI1_NCS1, 85, | ||
372 | "spi1_ncs1", NULL, NULL, "gpio_85", | ||
373 | NULL, NULL, NULL, NULL), | ||
374 | _OMAP2420_MUXENTRY(SPI1_NCS2, 86, | ||
375 | "spi1_ncs2", NULL, NULL, "gpio_86", | ||
376 | NULL, NULL, NULL, NULL), | ||
377 | _OMAP2420_MUXENTRY(SPI1_NCS3, 87, | ||
378 | "spi1_ncs3", NULL, NULL, "gpio_87", | ||
379 | NULL, NULL, NULL, NULL), | ||
380 | _OMAP2420_MUXENTRY(SPI1_SIMO, 82, | ||
381 | "spi1_simo", NULL, NULL, "gpio_82", | ||
382 | NULL, NULL, NULL, NULL), | ||
383 | _OMAP2420_MUXENTRY(SPI1_SOMI, 83, | ||
384 | "spi1_somi", NULL, NULL, "gpio_83", | ||
385 | NULL, NULL, NULL, NULL), | ||
386 | _OMAP2420_MUXENTRY(SPI2_CLK, 88, | ||
387 | "spi2_clk", NULL, NULL, "gpio_88", | ||
388 | NULL, NULL, NULL, NULL), | ||
389 | _OMAP2420_MUXENTRY(SPI2_NCS0, 91, | ||
390 | "spi2_ncs0", "gpt12_pwm_evt", NULL, "gpio_91", | ||
391 | NULL, NULL, NULL, NULL), | ||
392 | _OMAP2420_MUXENTRY(SPI2_SIMO, 89, | ||
393 | "spi2_simo", "gpt10_pwm_evt", NULL, "gpio_89", | ||
394 | NULL, NULL, NULL, NULL), | ||
395 | _OMAP2420_MUXENTRY(SPI2_SOMI, 90, | ||
396 | "spi2_somi", "gpt11_pwm_evt", NULL, "gpio_90", | ||
397 | NULL, NULL, NULL, NULL), | ||
398 | _OMAP2420_MUXENTRY(SSI1_DAT_RX, 63, | ||
399 | "ssi1_dat_rx", "eac_md_sclk", NULL, "gpio_63", | ||
400 | NULL, NULL, NULL, NULL), | ||
401 | _OMAP2420_MUXENTRY(SSI1_DAT_TX, 59, | ||
402 | "ssi1_dat_tx", "uart1_tx", "usb1_se0", "gpio_59", | ||
403 | NULL, NULL, NULL, NULL), | ||
404 | _OMAP2420_MUXENTRY(SSI1_FLAG_RX, 64, | ||
405 | "ssi1_flag_rx", "eac_md_din", NULL, "gpio_64", | ||
406 | NULL, NULL, NULL, NULL), | ||
407 | _OMAP2420_MUXENTRY(SSI1_FLAG_TX, 25, | ||
408 | "ssi1_flag_tx", "uart1_rts", "usb1_rcv", "gpio_25", | ||
409 | NULL, NULL, NULL, NULL), | ||
410 | _OMAP2420_MUXENTRY(SSI1_RDY_RX, 65, | ||
411 | "ssi1_rdy_rx", "eac_md_dout", NULL, "gpio_65", | ||
412 | NULL, NULL, NULL, NULL), | ||
413 | _OMAP2420_MUXENTRY(SSI1_RDY_TX, 61, | ||
414 | "ssi1_rdy_tx", "uart1_cts", "usb1_txen", "gpio_61", | ||
415 | NULL, NULL, NULL, NULL), | ||
416 | _OMAP2420_MUXENTRY(SSI1_WAKE, 66, | ||
417 | "ssi1_wake", "eac_md_fs", NULL, "gpio_66", | ||
418 | NULL, NULL, NULL, NULL), | ||
419 | _OMAP2420_MUXENTRY(SYS_CLKOUT, 123, | ||
420 | "sys_clkout", NULL, NULL, "gpio_123", | ||
421 | NULL, NULL, NULL, NULL), | ||
422 | _OMAP2420_MUXENTRY(SYS_CLKREQ, 52, | ||
423 | "sys_clkreq", NULL, NULL, "gpio_52", | ||
424 | NULL, NULL, NULL, NULL), | ||
425 | _OMAP2420_MUXENTRY(SYS_NIRQ, 60, | ||
426 | "sys_nirq", NULL, NULL, "gpio_60", | ||
427 | NULL, NULL, NULL, NULL), | ||
428 | _OMAP2420_MUXENTRY(UART1_CTS, 32, | ||
429 | "uart1_cts", NULL, "dss_data18", "gpio_32", | ||
430 | NULL, NULL, NULL, NULL), | ||
431 | _OMAP2420_MUXENTRY(UART1_RTS, 8, | ||
432 | "uart1_rts", NULL, "dss_data19", "gpio_8", | ||
433 | NULL, NULL, NULL, NULL), | ||
434 | _OMAP2420_MUXENTRY(UART1_RX, 10, | ||
435 | "uart1_rx", NULL, "dss_data21", "gpio_10", | ||
436 | NULL, NULL, NULL, NULL), | ||
437 | _OMAP2420_MUXENTRY(UART1_TX, 9, | ||
438 | "uart1_tx", NULL, "dss_data20", "gpio_9", | ||
439 | NULL, NULL, NULL, NULL), | ||
440 | _OMAP2420_MUXENTRY(UART2_CTS, 67, | ||
441 | "uart2_cts", "usb1_rcv", "gpt9_pwm_evt", "gpio_67", | ||
442 | NULL, NULL, NULL, NULL), | ||
443 | _OMAP2420_MUXENTRY(UART2_RTS, 68, | ||
444 | "uart2_rts", "usb1_txen", "gpt10_pwm_evt", "gpio_68", | ||
445 | NULL, NULL, NULL, NULL), | ||
446 | _OMAP2420_MUXENTRY(UART2_RX, 70, | ||
447 | "uart2_rx", "usb1_dat", "gpt12_pwm_evt", "gpio_70", | ||
448 | NULL, NULL, NULL, NULL), | ||
449 | _OMAP2420_MUXENTRY(UART2_TX, 69, | ||
450 | "uart2_tx", "usb1_se0", "gpt11_pwm_evt", "gpio_69", | ||
451 | NULL, NULL, NULL, NULL), | ||
452 | _OMAP2420_MUXENTRY(UART3_CTS_RCTX, 102, | ||
453 | "uart3_cts_rctx", "uart3_rx_irrx", NULL, "gpio_102", | ||
454 | NULL, NULL, NULL, NULL), | ||
455 | _OMAP2420_MUXENTRY(UART3_RTS_SD, 103, | ||
456 | "uart3_rts_sd", "uart3_tx_irtx", NULL, "gpio_103", | ||
457 | NULL, NULL, NULL, NULL), | ||
458 | _OMAP2420_MUXENTRY(UART3_RX_IRRX, 105, | ||
459 | "uart3_rx_irrx", NULL, NULL, "gpio_105", | ||
460 | NULL, NULL, NULL, NULL), | ||
461 | _OMAP2420_MUXENTRY(UART3_TX_IRTX, 104, | ||
462 | "uart3_tx_irtx", "uart3_cts_rctx", NULL, "gpio_104", | ||
463 | NULL, NULL, NULL, NULL), | ||
464 | _OMAP2420_MUXENTRY(USB0_DAT, 112, | ||
465 | "usb0_dat", "uart3_rx_irrx", "uart2_rx", "gpio_112", | ||
466 | "uart2_tx", NULL, NULL, NULL), | ||
467 | _OMAP2420_MUXENTRY(USB0_PUEN, 106, | ||
468 | "usb0_puen", "mcbsp2_dx", NULL, "gpio_106", | ||
469 | NULL, NULL, NULL, NULL), | ||
470 | _OMAP2420_MUXENTRY(USB0_RCV, 109, | ||
471 | "usb0_rcv", "mcbsp2_fsx", NULL, "gpio_109", | ||
472 | "uart2_cts", NULL, NULL, NULL), | ||
473 | _OMAP2420_MUXENTRY(USB0_SE0, 111, | ||
474 | "usb0_se0", "uart3_tx_irtx", "uart2_tx", "gpio_111", | ||
475 | "uart2_rx", NULL, NULL, NULL), | ||
476 | _OMAP2420_MUXENTRY(USB0_TXEN, 110, | ||
477 | "usb0_txen", "uart3_cts_rctx", "uart2_cts", "gpio_110", | ||
478 | NULL, NULL, NULL, NULL), | ||
479 | _OMAP2420_MUXENTRY(USB0_VM, 108, | ||
480 | "usb0_vm", "mcbsp2_clkx", NULL, "gpio_108", | ||
481 | "uart2_rx", NULL, NULL, NULL), | ||
482 | _OMAP2420_MUXENTRY(USB0_VP, 107, | ||
483 | "usb0_vp", "mcbsp2_dr", NULL, "gpio_107", | ||
484 | NULL, NULL, NULL, NULL), | ||
485 | _OMAP2420_MUXENTRY(VLYNQ_CLK, 13, | ||
486 | "vlynq_clk", "usb2_se0", "sys_ndmareq0", "gpio_13", | ||
487 | NULL, NULL, NULL, NULL), | ||
488 | _OMAP2420_MUXENTRY(VLYNQ_NLA, 58, | ||
489 | "vlynq_nla", NULL, NULL, "gpio_58", | ||
490 | "cam_d6", NULL, NULL, NULL), | ||
491 | _OMAP2420_MUXENTRY(VLYNQ_RX0, 15, | ||
492 | "vlynq_rx0", "usb2_tllse0", NULL, "gpio_15", | ||
493 | "cam_d7", NULL, NULL, NULL), | ||
494 | _OMAP2420_MUXENTRY(VLYNQ_RX1, 14, | ||
495 | "vlynq_rx1", "usb2_rcv", "sys_ndmareq1", "gpio_14", | ||
496 | "cam_d8", NULL, NULL, NULL), | ||
497 | _OMAP2420_MUXENTRY(VLYNQ_TX0, 17, | ||
498 | "vlynq_tx0", "usb2_txen", NULL, "gpio_17", | ||
499 | NULL, NULL, NULL, NULL), | ||
500 | _OMAP2420_MUXENTRY(VLYNQ_TX1, 16, | ||
501 | "vlynq_tx1", "usb2_dat", "sys_clkout2", "gpio_16", | ||
502 | NULL, NULL, NULL, NULL), | ||
503 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
504 | }; | ||
505 | |||
506 | /* | ||
507 | * Balls for 447-pin POP package | ||
508 | */ | ||
509 | #ifdef CONFIG_DEBUG_FS | ||
510 | static struct omap_ball __initdata omap2420_pop_ball[] = { | ||
511 | _OMAP2420_BALLENTRY(CAM_D0, "y4", NULL), | ||
512 | _OMAP2420_BALLENTRY(CAM_D1, "y3", NULL), | ||
513 | _OMAP2420_BALLENTRY(CAM_D2, "u7", NULL), | ||
514 | _OMAP2420_BALLENTRY(CAM_D3, "ab3", NULL), | ||
515 | _OMAP2420_BALLENTRY(CAM_D4, "v2", NULL), | ||
516 | _OMAP2420_BALLENTRY(CAM_D5, "ad3", NULL), | ||
517 | _OMAP2420_BALLENTRY(CAM_D6, "aa4", NULL), | ||
518 | _OMAP2420_BALLENTRY(CAM_D7, "ab4", NULL), | ||
519 | _OMAP2420_BALLENTRY(CAM_D8, "ac6", NULL), | ||
520 | _OMAP2420_BALLENTRY(CAM_D9, "ac7", NULL), | ||
521 | _OMAP2420_BALLENTRY(CAM_HS, "v4", NULL), | ||
522 | _OMAP2420_BALLENTRY(CAM_LCLK, "ad6", NULL), | ||
523 | _OMAP2420_BALLENTRY(CAM_VS, "p7", NULL), | ||
524 | _OMAP2420_BALLENTRY(CAM_XCLK, "w4", NULL), | ||
525 | _OMAP2420_BALLENTRY(DSS_ACBIAS, "ae8", NULL), | ||
526 | _OMAP2420_BALLENTRY(DSS_DATA10, "ac12", NULL), | ||
527 | _OMAP2420_BALLENTRY(DSS_DATA11, "ae11", NULL), | ||
528 | _OMAP2420_BALLENTRY(DSS_DATA12, "ae13", NULL), | ||
529 | _OMAP2420_BALLENTRY(DSS_DATA13, "ad13", NULL), | ||
530 | _OMAP2420_BALLENTRY(DSS_DATA14, "ac13", NULL), | ||
531 | _OMAP2420_BALLENTRY(DSS_DATA15, "y12", NULL), | ||
532 | _OMAP2420_BALLENTRY(DSS_DATA16, "ad14", NULL), | ||
533 | _OMAP2420_BALLENTRY(DSS_DATA17, "y13", NULL), | ||
534 | _OMAP2420_BALLENTRY(DSS_DATA8, "ad11", NULL), | ||
535 | _OMAP2420_BALLENTRY(DSS_DATA9, "ad12", NULL), | ||
536 | _OMAP2420_BALLENTRY(EAC_AC_DIN, "ad19", NULL), | ||
537 | _OMAP2420_BALLENTRY(EAC_AC_DOUT, "af22", NULL), | ||
538 | _OMAP2420_BALLENTRY(EAC_AC_FS, "ad16", NULL), | ||
539 | _OMAP2420_BALLENTRY(EAC_AC_MCLK, "y17", NULL), | ||
540 | _OMAP2420_BALLENTRY(EAC_AC_RST, "ae22", NULL), | ||
541 | _OMAP2420_BALLENTRY(EAC_AC_SCLK, "ac18", NULL), | ||
542 | _OMAP2420_BALLENTRY(EAC_BT_DIN, "u8", NULL), | ||
543 | _OMAP2420_BALLENTRY(EAC_BT_DOUT, "ad5", NULL), | ||
544 | _OMAP2420_BALLENTRY(EAC_BT_FS, "w7", NULL), | ||
545 | _OMAP2420_BALLENTRY(EAC_BT_SCLK, "ad4", NULL), | ||
546 | _OMAP2420_BALLENTRY(GPIO_119, "af6", NULL), | ||
547 | _OMAP2420_BALLENTRY(GPIO_120, "af4", NULL), | ||
548 | _OMAP2420_BALLENTRY(GPIO_121, "ae6", NULL), | ||
549 | _OMAP2420_BALLENTRY(GPIO_122, "w3", NULL), | ||
550 | _OMAP2420_BALLENTRY(GPIO_124, "y19", NULL), | ||
551 | _OMAP2420_BALLENTRY(GPIO_125, "ae24", NULL), | ||
552 | _OMAP2420_BALLENTRY(GPIO_36, "y18", NULL), | ||
553 | _OMAP2420_BALLENTRY(GPIO_6, "d6", NULL), | ||
554 | _OMAP2420_BALLENTRY(GPIO_62, "ad18", NULL), | ||
555 | _OMAP2420_BALLENTRY(GPMC_A1, "m8", NULL), | ||
556 | _OMAP2420_BALLENTRY(GPMC_A10, "d5", NULL), | ||
557 | _OMAP2420_BALLENTRY(GPMC_A2, "w9", NULL), | ||
558 | _OMAP2420_BALLENTRY(GPMC_A3, "af10", NULL), | ||
559 | _OMAP2420_BALLENTRY(GPMC_A4, "w8", NULL), | ||
560 | _OMAP2420_BALLENTRY(GPMC_A5, "ae16", NULL), | ||
561 | _OMAP2420_BALLENTRY(GPMC_A6, "af9", NULL), | ||
562 | _OMAP2420_BALLENTRY(GPMC_A7, "e4", NULL), | ||
563 | _OMAP2420_BALLENTRY(GPMC_A8, "j7", NULL), | ||
564 | _OMAP2420_BALLENTRY(GPMC_A9, "ae18", NULL), | ||
565 | _OMAP2420_BALLENTRY(GPMC_CLK, "p1", "l1"), | ||
566 | _OMAP2420_BALLENTRY(GPMC_D10, "t1", "n1"), | ||
567 | _OMAP2420_BALLENTRY(GPMC_D11, "u2", "p2"), | ||
568 | _OMAP2420_BALLENTRY(GPMC_D12, "u1", "p1"), | ||
569 | _OMAP2420_BALLENTRY(GPMC_D13, "p2", "m1"), | ||
570 | _OMAP2420_BALLENTRY(GPMC_D14, "h2", "j2"), | ||
571 | _OMAP2420_BALLENTRY(GPMC_D15, "h1", "k2"), | ||
572 | _OMAP2420_BALLENTRY(GPMC_D8, "v1", "r1"), | ||
573 | _OMAP2420_BALLENTRY(GPMC_D9, "y1", "t1"), | ||
574 | _OMAP2420_BALLENTRY(GPMC_NBE0, "af12", "aa10"), | ||
575 | _OMAP2420_BALLENTRY(GPMC_NBE1, "u3", NULL), | ||
576 | _OMAP2420_BALLENTRY(GPMC_NCS1, "af14", "w1"), | ||
577 | _OMAP2420_BALLENTRY(GPMC_NCS2, "g4", NULL), | ||
578 | _OMAP2420_BALLENTRY(GPMC_NCS3, "t8", NULL), | ||
579 | _OMAP2420_BALLENTRY(GPMC_NCS4, "h8", NULL), | ||
580 | _OMAP2420_BALLENTRY(GPMC_NCS5, "k3", NULL), | ||
581 | _OMAP2420_BALLENTRY(GPMC_NCS6, "m7", NULL), | ||
582 | _OMAP2420_BALLENTRY(GPMC_NCS7, "p3", NULL), | ||
583 | _OMAP2420_BALLENTRY(GPMC_NWP, "ae15", "y5"), | ||
584 | _OMAP2420_BALLENTRY(GPMC_WAIT1, "ae20", "y8"), | ||
585 | _OMAP2420_BALLENTRY(GPMC_WAIT2, "n2", NULL), | ||
586 | _OMAP2420_BALLENTRY(GPMC_WAIT3, "t4", NULL), | ||
587 | _OMAP2420_BALLENTRY(HDQ_SIO, "t23", NULL), | ||
588 | _OMAP2420_BALLENTRY(I2C2_SCL, "l2", NULL), | ||
589 | _OMAP2420_BALLENTRY(I2C2_SDA, "k19", NULL), | ||
590 | _OMAP2420_BALLENTRY(JTAG_EMU0, "n24", NULL), | ||
591 | _OMAP2420_BALLENTRY(JTAG_EMU1, "ac22", NULL), | ||
592 | _OMAP2420_BALLENTRY(MCBSP1_CLKR, "y24", NULL), | ||
593 | _OMAP2420_BALLENTRY(MCBSP1_CLKX, "t19", NULL), | ||
594 | _OMAP2420_BALLENTRY(MCBSP1_DR, "u23", NULL), | ||
595 | _OMAP2420_BALLENTRY(MCBSP1_DX, "r24", NULL), | ||
596 | _OMAP2420_BALLENTRY(MCBSP1_FSR, "r20", NULL), | ||
597 | _OMAP2420_BALLENTRY(MCBSP1_FSX, "r23", NULL), | ||
598 | _OMAP2420_BALLENTRY(MCBSP2_CLKX, "t24", NULL), | ||
599 | _OMAP2420_BALLENTRY(MCBSP2_DR, "p20", NULL), | ||
600 | _OMAP2420_BALLENTRY(MCBSP_CLKS, "p23", NULL), | ||
601 | _OMAP2420_BALLENTRY(MMC_CLKI, "c23", NULL), | ||
602 | _OMAP2420_BALLENTRY(MMC_CLKO, "h23", NULL), | ||
603 | _OMAP2420_BALLENTRY(MMC_CMD, "j23", NULL), | ||
604 | _OMAP2420_BALLENTRY(MMC_CMD_DIR, "j24", NULL), | ||
605 | _OMAP2420_BALLENTRY(MMC_DAT0, "h17", NULL), | ||
606 | _OMAP2420_BALLENTRY(MMC_DAT_DIR0, "f23", NULL), | ||
607 | _OMAP2420_BALLENTRY(MMC_DAT1, "g19", NULL), | ||
608 | _OMAP2420_BALLENTRY(MMC_DAT_DIR1, "d23", NULL), | ||
609 | _OMAP2420_BALLENTRY(MMC_DAT2, "h20", NULL), | ||
610 | _OMAP2420_BALLENTRY(MMC_DAT_DIR2, "g23", NULL), | ||
611 | _OMAP2420_BALLENTRY(MMC_DAT3, "d24", NULL), | ||
612 | _OMAP2420_BALLENTRY(MMC_DAT_DIR3, "e23", NULL), | ||
613 | _OMAP2420_BALLENTRY(SDRC_A12, "w26", "r21"), | ||
614 | _OMAP2420_BALLENTRY(SDRC_A13, "w25", "aa15"), | ||
615 | _OMAP2420_BALLENTRY(SDRC_A14, "aa26", "y12"), | ||
616 | _OMAP2420_BALLENTRY(SDRC_CKE1, "ae25", "y13"), | ||
617 | _OMAP2420_BALLENTRY(SDRC_NCS1, "y25", "t20"), | ||
618 | _OMAP2420_BALLENTRY(SPI1_CLK, "y23", NULL), | ||
619 | _OMAP2420_BALLENTRY(SPI1_NCS0, "w24", NULL), | ||
620 | _OMAP2420_BALLENTRY(SPI1_NCS1, "w23", NULL), | ||
621 | _OMAP2420_BALLENTRY(SPI1_NCS2, "v23", NULL), | ||
622 | _OMAP2420_BALLENTRY(SPI1_NCS3, "u20", NULL), | ||
623 | _OMAP2420_BALLENTRY(SPI1_SIMO, "h10", NULL), | ||
624 | _OMAP2420_BALLENTRY(SPI1_SOMI, "v19", NULL), | ||
625 | _OMAP2420_BALLENTRY(SPI2_CLK, "v24", NULL), | ||
626 | _OMAP2420_BALLENTRY(SPI2_NCS0, "aa24", NULL), | ||
627 | _OMAP2420_BALLENTRY(SPI2_SIMO, "u24", NULL), | ||
628 | _OMAP2420_BALLENTRY(SPI2_SOMI, "v25", NULL), | ||
629 | _OMAP2420_BALLENTRY(SSI1_DAT_RX, "w15", NULL), | ||
630 | _OMAP2420_BALLENTRY(SSI1_DAT_TX, "w13", NULL), | ||
631 | _OMAP2420_BALLENTRY(SSI1_FLAG_RX, "af11", NULL), | ||
632 | _OMAP2420_BALLENTRY(SSI1_FLAG_TX, "ac15", NULL), | ||
633 | _OMAP2420_BALLENTRY(SSI1_RDY_RX, "ac16", NULL), | ||
634 | _OMAP2420_BALLENTRY(SSI1_RDY_TX, "af15", NULL), | ||
635 | _OMAP2420_BALLENTRY(SSI1_WAKE, "ad15", NULL), | ||
636 | _OMAP2420_BALLENTRY(SYS_CLKOUT, "ae19", NULL), | ||
637 | _OMAP2420_BALLENTRY(SYS_CLKREQ, "ad20", NULL), | ||
638 | _OMAP2420_BALLENTRY(SYS_NIRQ, "y20", NULL), | ||
639 | _OMAP2420_BALLENTRY(UART1_CTS, "g20", NULL), | ||
640 | _OMAP2420_BALLENTRY(UART1_RTS, "k20", NULL), | ||
641 | _OMAP2420_BALLENTRY(UART1_RX, "t20", NULL), | ||
642 | _OMAP2420_BALLENTRY(UART1_TX, "h12", NULL), | ||
643 | _OMAP2420_BALLENTRY(UART2_CTS, "ac24", NULL), | ||
644 | _OMAP2420_BALLENTRY(UART2_RTS, "w20", NULL), | ||
645 | _OMAP2420_BALLENTRY(UART2_RX, "ad24", NULL), | ||
646 | _OMAP2420_BALLENTRY(UART2_TX, "ab24", NULL), | ||
647 | _OMAP2420_BALLENTRY(UART3_CTS_RCTX, "k24", NULL), | ||
648 | _OMAP2420_BALLENTRY(UART3_RTS_SD, "m20", NULL), | ||
649 | _OMAP2420_BALLENTRY(UART3_RX_IRRX, "h24", NULL), | ||
650 | _OMAP2420_BALLENTRY(UART3_TX_IRTX, "g24", NULL), | ||
651 | _OMAP2420_BALLENTRY(USB0_DAT, "j25", NULL), | ||
652 | _OMAP2420_BALLENTRY(USB0_PUEN, "l23", NULL), | ||
653 | _OMAP2420_BALLENTRY(USB0_RCV, "k23", NULL), | ||
654 | _OMAP2420_BALLENTRY(USB0_SE0, "l24", NULL), | ||
655 | _OMAP2420_BALLENTRY(USB0_TXEN, "m24", NULL), | ||
656 | _OMAP2420_BALLENTRY(USB0_VM, "n23", NULL), | ||
657 | _OMAP2420_BALLENTRY(USB0_VP, "m23", NULL), | ||
658 | _OMAP2420_BALLENTRY(VLYNQ_CLK, "w12", NULL), | ||
659 | _OMAP2420_BALLENTRY(VLYNQ_NLA, "ae10", NULL), | ||
660 | _OMAP2420_BALLENTRY(VLYNQ_RX0, "ad7", NULL), | ||
661 | _OMAP2420_BALLENTRY(VLYNQ_RX1, "w10", NULL), | ||
662 | _OMAP2420_BALLENTRY(VLYNQ_TX0, "y15", NULL), | ||
663 | _OMAP2420_BALLENTRY(VLYNQ_TX1, "w14", NULL), | ||
664 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
665 | }; | ||
666 | #else | ||
667 | #define omap2420_pop_ball NULL | ||
668 | #endif | ||
669 | |||
670 | int __init omap2420_mux_init(struct omap_board_mux *board_subset, int flags) | ||
671 | { | ||
672 | struct omap_ball *package_balls = NULL; | ||
673 | |||
674 | switch (flags & OMAP_PACKAGE_MASK) { | ||
675 | case OMAP_PACKAGE_ZAC: | ||
676 | package_balls = omap2420_pop_ball; | ||
677 | break; | ||
678 | case OMAP_PACKAGE_ZAF: | ||
679 | /* REVISIT: Please add data */ | ||
680 | default: | ||
681 | pr_warning("%s: No ball data available for omap2420 package\n", | ||
682 | __func__); | ||
683 | } | ||
684 | |||
685 | return omap_mux_init("core", OMAP_MUX_REG_8BIT | OMAP_MUX_GPIO_IN_MODE3, | ||
686 | OMAP2420_CONTROL_PADCONF_MUX_PBASE, | ||
687 | OMAP2420_CONTROL_PADCONF_MUX_SIZE, | ||
688 | omap2420_muxmodes, NULL, board_subset, | ||
689 | package_balls); | ||
690 | } | ||
diff --git a/arch/arm/mach-omap2/mux2420.h b/arch/arm/mach-omap2/mux2420.h deleted file mode 100644 index 0f555aa847b5..000000000000 --- a/arch/arm/mach-omap2/mux2420.h +++ /dev/null | |||
@@ -1,282 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Nokia | ||
3 | * Copyright (C) 2009 Texas Instruments | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #define OMAP2420_CONTROL_PADCONF_MUX_PBASE 0x48000030LU | ||
11 | |||
12 | #define OMAP2420_MUX(mode0, mux_value) \ | ||
13 | { \ | ||
14 | .reg_offset = (OMAP2420_CONTROL_PADCONF_##mode0##_OFFSET), \ | ||
15 | .value = (mux_value), \ | ||
16 | } | ||
17 | |||
18 | /* | ||
19 | * OMAP2420 CONTROL_PADCONF* register offsets for pin-muxing | ||
20 | * | ||
21 | * Extracted from the TRM. Add 0x48000030 to these values to get the | ||
22 | * absolute addresses. The name in the macro is the mode-0 name of | ||
23 | * the pin. NOTE: These registers are 8-bits wide. | ||
24 | */ | ||
25 | #define OMAP2420_CONTROL_PADCONF_SDRC_A14_OFFSET 0x000 | ||
26 | #define OMAP2420_CONTROL_PADCONF_SDRC_A13_OFFSET 0x001 | ||
27 | #define OMAP2420_CONTROL_PADCONF_SDRC_A12_OFFSET 0x002 | ||
28 | #define OMAP2420_CONTROL_PADCONF_SDRC_BA1_OFFSET 0x003 | ||
29 | #define OMAP2420_CONTROL_PADCONF_SDRC_BA0_OFFSET 0x004 | ||
30 | #define OMAP2420_CONTROL_PADCONF_SDRC_A11_OFFSET 0x005 | ||
31 | #define OMAP2420_CONTROL_PADCONF_SDRC_A10_OFFSET 0x006 | ||
32 | #define OMAP2420_CONTROL_PADCONF_SDRC_A9_OFFSET 0x007 | ||
33 | #define OMAP2420_CONTROL_PADCONF_SDRC_A8_OFFSET 0x008 | ||
34 | #define OMAP2420_CONTROL_PADCONF_SDRC_A7_OFFSET 0x009 | ||
35 | #define OMAP2420_CONTROL_PADCONF_SDRC_A6_OFFSET 0x00a | ||
36 | #define OMAP2420_CONTROL_PADCONF_SDRC_A5_OFFSET 0x00b | ||
37 | #define OMAP2420_CONTROL_PADCONF_SDRC_A4_OFFSET 0x00c | ||
38 | #define OMAP2420_CONTROL_PADCONF_SDRC_A3_OFFSET 0x00d | ||
39 | #define OMAP2420_CONTROL_PADCONF_SDRC_A2_OFFSET 0x00e | ||
40 | #define OMAP2420_CONTROL_PADCONF_SDRC_A1_OFFSET 0x00f | ||
41 | #define OMAP2420_CONTROL_PADCONF_SDRC_A0_OFFSET 0x010 | ||
42 | #define OMAP2420_CONTROL_PADCONF_SDRC_D31_OFFSET 0x021 | ||
43 | #define OMAP2420_CONTROL_PADCONF_SDRC_D30_OFFSET 0x022 | ||
44 | #define OMAP2420_CONTROL_PADCONF_SDRC_D29_OFFSET 0x023 | ||
45 | #define OMAP2420_CONTROL_PADCONF_SDRC_D28_OFFSET 0x024 | ||
46 | #define OMAP2420_CONTROL_PADCONF_SDRC_D27_OFFSET 0x025 | ||
47 | #define OMAP2420_CONTROL_PADCONF_SDRC_D26_OFFSET 0x026 | ||
48 | #define OMAP2420_CONTROL_PADCONF_SDRC_D25_OFFSET 0x027 | ||
49 | #define OMAP2420_CONTROL_PADCONF_SDRC_D24_OFFSET 0x028 | ||
50 | #define OMAP2420_CONTROL_PADCONF_SDRC_D23_OFFSET 0x029 | ||
51 | #define OMAP2420_CONTROL_PADCONF_SDRC_D22_OFFSET 0x02a | ||
52 | #define OMAP2420_CONTROL_PADCONF_SDRC_D21_OFFSET 0x02b | ||
53 | #define OMAP2420_CONTROL_PADCONF_SDRC_D20_OFFSET 0x02c | ||
54 | #define OMAP2420_CONTROL_PADCONF_SDRC_D19_OFFSET 0x02d | ||
55 | #define OMAP2420_CONTROL_PADCONF_SDRC_D18_OFFSET 0x02e | ||
56 | #define OMAP2420_CONTROL_PADCONF_SDRC_D17_OFFSET 0x02f | ||
57 | #define OMAP2420_CONTROL_PADCONF_SDRC_D16_OFFSET 0x030 | ||
58 | #define OMAP2420_CONTROL_PADCONF_SDRC_D15_OFFSET 0x031 | ||
59 | #define OMAP2420_CONTROL_PADCONF_SDRC_D14_OFFSET 0x032 | ||
60 | #define OMAP2420_CONTROL_PADCONF_SDRC_D13_OFFSET 0x033 | ||
61 | #define OMAP2420_CONTROL_PADCONF_SDRC_D12_OFFSET 0x034 | ||
62 | #define OMAP2420_CONTROL_PADCONF_SDRC_D11_OFFSET 0x035 | ||
63 | #define OMAP2420_CONTROL_PADCONF_SDRC_D10_OFFSET 0x036 | ||
64 | #define OMAP2420_CONTROL_PADCONF_SDRC_D9_OFFSET 0x037 | ||
65 | #define OMAP2420_CONTROL_PADCONF_SDRC_D8_OFFSET 0x038 | ||
66 | #define OMAP2420_CONTROL_PADCONF_SDRC_D7_OFFSET 0x039 | ||
67 | #define OMAP2420_CONTROL_PADCONF_SDRC_D6_OFFSET 0x03a | ||
68 | #define OMAP2420_CONTROL_PADCONF_SDRC_D5_OFFSET 0x03b | ||
69 | #define OMAP2420_CONTROL_PADCONF_SDRC_D4_OFFSET 0x03c | ||
70 | #define OMAP2420_CONTROL_PADCONF_SDRC_D3_OFFSET 0x03d | ||
71 | #define OMAP2420_CONTROL_PADCONF_SDRC_D2_OFFSET 0x03e | ||
72 | #define OMAP2420_CONTROL_PADCONF_SDRC_D1_OFFSET 0x03f | ||
73 | #define OMAP2420_CONTROL_PADCONF_SDRC_D0_OFFSET 0x040 | ||
74 | #define OMAP2420_CONTROL_PADCONF_GPMC_A10_OFFSET 0x041 | ||
75 | #define OMAP2420_CONTROL_PADCONF_GPMC_A9_OFFSET 0x042 | ||
76 | #define OMAP2420_CONTROL_PADCONF_GPMC_A8_OFFSET 0x043 | ||
77 | #define OMAP2420_CONTROL_PADCONF_GPMC_A7_OFFSET 0x044 | ||
78 | #define OMAP2420_CONTROL_PADCONF_GPMC_A6_OFFSET 0x045 | ||
79 | #define OMAP2420_CONTROL_PADCONF_GPMC_A5_OFFSET 0x046 | ||
80 | #define OMAP2420_CONTROL_PADCONF_GPMC_A4_OFFSET 0x047 | ||
81 | #define OMAP2420_CONTROL_PADCONF_GPMC_A3_OFFSET 0x048 | ||
82 | #define OMAP2420_CONTROL_PADCONF_GPMC_A2_OFFSET 0x049 | ||
83 | #define OMAP2420_CONTROL_PADCONF_GPMC_A1_OFFSET 0x04a | ||
84 | #define OMAP2420_CONTROL_PADCONF_GPMC_D15_OFFSET 0x04b | ||
85 | #define OMAP2420_CONTROL_PADCONF_GPMC_D14_OFFSET 0x04c | ||
86 | #define OMAP2420_CONTROL_PADCONF_GPMC_D13_OFFSET 0x04d | ||
87 | #define OMAP2420_CONTROL_PADCONF_GPMC_D12_OFFSET 0x04e | ||
88 | #define OMAP2420_CONTROL_PADCONF_GPMC_D11_OFFSET 0x04f | ||
89 | #define OMAP2420_CONTROL_PADCONF_GPMC_D10_OFFSET 0x050 | ||
90 | #define OMAP2420_CONTROL_PADCONF_GPMC_D9_OFFSET 0x051 | ||
91 | #define OMAP2420_CONTROL_PADCONF_GPMC_D8_OFFSET 0x052 | ||
92 | #define OMAP2420_CONTROL_PADCONF_GPMC_D7_OFFSET 0x053 | ||
93 | #define OMAP2420_CONTROL_PADCONF_GPMC_D6_OFFSET 0x054 | ||
94 | #define OMAP2420_CONTROL_PADCONF_GPMC_D5_OFFSET 0x055 | ||
95 | #define OMAP2420_CONTROL_PADCONF_GPMC_D4_OFFSET 0x056 | ||
96 | #define OMAP2420_CONTROL_PADCONF_GPMC_D3_OFFSET 0x057 | ||
97 | #define OMAP2420_CONTROL_PADCONF_GPMC_D2_OFFSET 0x058 | ||
98 | #define OMAP2420_CONTROL_PADCONF_GPMC_D1_OFFSET 0x059 | ||
99 | #define OMAP2420_CONTROL_PADCONF_GPMC_D0_OFFSET 0x05a | ||
100 | #define OMAP2420_CONTROL_PADCONF_GPMC_CLK_OFFSET 0x05b | ||
101 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS0_OFFSET 0x05c | ||
102 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS1_OFFSET 0x05d | ||
103 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS2_OFFSET 0x05e | ||
104 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS3_OFFSET 0x05f | ||
105 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS4_OFFSET 0x060 | ||
106 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS5_OFFSET 0x061 | ||
107 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS6_OFFSET 0x062 | ||
108 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS7_OFFSET 0x063 | ||
109 | #define OMAP2420_CONTROL_PADCONF_GPMC_NALE_ALE_OFFSET 0x064 | ||
110 | #define OMAP2420_CONTROL_PADCONF_GPMC_NOE_OFFSET 0x065 | ||
111 | #define OMAP2420_CONTROL_PADCONF_GPMC_NWE_OFFSET 0x066 | ||
112 | #define OMAP2420_CONTROL_PADCONF_GPMC_NBE0_OFFSET 0x067 | ||
113 | #define OMAP2420_CONTROL_PADCONF_GPMC_NBE1_OFFSET 0x068 | ||
114 | #define OMAP2420_CONTROL_PADCONF_GPMC_NWP_OFFSET 0x069 | ||
115 | #define OMAP2420_CONTROL_PADCONF_GPMC_WAIT0_OFFSET 0x06a | ||
116 | #define OMAP2420_CONTROL_PADCONF_GPMC_WAIT1_OFFSET 0x06b | ||
117 | #define OMAP2420_CONTROL_PADCONF_GPMC_WAIT2_OFFSET 0x06c | ||
118 | #define OMAP2420_CONTROL_PADCONF_GPMC_WAIT3_OFFSET 0x06d | ||
119 | #define OMAP2420_CONTROL_PADCONF_SDRC_CLK_OFFSET 0x06e | ||
120 | #define OMAP2420_CONTROL_PADCONF_SDRC_NCLK_OFFSET 0x06f | ||
121 | #define OMAP2420_CONTROL_PADCONF_SDRC_NCS0_OFFSET 0x070 | ||
122 | #define OMAP2420_CONTROL_PADCONF_SDRC_NCS1_OFFSET 0x071 | ||
123 | #define OMAP2420_CONTROL_PADCONF_SDRC_CKE0_OFFSET 0x072 | ||
124 | #define OMAP2420_CONTROL_PADCONF_SDRC_CKE1_OFFSET 0x073 | ||
125 | #define OMAP2420_CONTROL_PADCONF_SDRC_NRAS_OFFSET 0x074 | ||
126 | #define OMAP2420_CONTROL_PADCONF_SDRC_NCAS_OFFSET 0x075 | ||
127 | #define OMAP2420_CONTROL_PADCONF_SDRC_NWE_OFFSET 0x076 | ||
128 | #define OMAP2420_CONTROL_PADCONF_SDRC_DM0_OFFSET 0x077 | ||
129 | #define OMAP2420_CONTROL_PADCONF_SDRC_DM1_OFFSET 0x078 | ||
130 | #define OMAP2420_CONTROL_PADCONF_SDRC_DM2_OFFSET 0x079 | ||
131 | #define OMAP2420_CONTROL_PADCONF_SDRC_DM3_OFFSET 0x07a | ||
132 | #define OMAP2420_CONTROL_PADCONF_SDRC_DQS0_OFFSET 0x07f | ||
133 | #define OMAP2420_CONTROL_PADCONF_SDRC_DQS1_OFFSET 0x080 | ||
134 | #define OMAP2420_CONTROL_PADCONF_SDRC_DQS2_OFFSET 0x081 | ||
135 | #define OMAP2420_CONTROL_PADCONF_SDRC_DQS3_OFFSET 0x082 | ||
136 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA0_OFFSET 0x083 | ||
137 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA1_OFFSET 0x084 | ||
138 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA2_OFFSET 0x085 | ||
139 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA3_OFFSET 0x086 | ||
140 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA4_OFFSET 0x087 | ||
141 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA5_OFFSET 0x088 | ||
142 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA6_OFFSET 0x089 | ||
143 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA7_OFFSET 0x08a | ||
144 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA8_OFFSET 0x08b | ||
145 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA9_OFFSET 0x08c | ||
146 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA10_OFFSET 0x08d | ||
147 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA11_OFFSET 0x08e | ||
148 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA12_OFFSET 0x08f | ||
149 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA13_OFFSET 0x090 | ||
150 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA14_OFFSET 0x091 | ||
151 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA15_OFFSET 0x092 | ||
152 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA16_OFFSET 0x093 | ||
153 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA17_OFFSET 0x094 | ||
154 | #define OMAP2420_CONTROL_PADCONF_UART1_CTS_OFFSET 0x095 | ||
155 | #define OMAP2420_CONTROL_PADCONF_UART1_RTS_OFFSET 0x096 | ||
156 | #define OMAP2420_CONTROL_PADCONF_UART1_TX_OFFSET 0x097 | ||
157 | #define OMAP2420_CONTROL_PADCONF_UART1_RX_OFFSET 0x098 | ||
158 | #define OMAP2420_CONTROL_PADCONF_MCBSP2_DR_OFFSET 0x099 | ||
159 | #define OMAP2420_CONTROL_PADCONF_MCBSP2_CLKX_OFFSET 0x09a | ||
160 | #define OMAP2420_CONTROL_PADCONF_DSS_PCL_OFFSET 0x09b | ||
161 | #define OMAP2420_CONTROL_PADCONF_DSS_VSYNC_OFFSET 0x09c | ||
162 | #define OMAP2420_CONTROL_PADCONF_DSS_HSYNC_OFFSET 0x09d | ||
163 | #define OMAP2420_CONTROL_PADCONF_DSS_ACBIAS_OFFSET 0x09e | ||
164 | #define OMAP2420_CONTROL_PADCONF_CAM_D9_OFFSET 0x09f | ||
165 | #define OMAP2420_CONTROL_PADCONF_CAM_D8_OFFSET 0x0a0 | ||
166 | #define OMAP2420_CONTROL_PADCONF_CAM_D7_OFFSET 0x0a1 | ||
167 | #define OMAP2420_CONTROL_PADCONF_CAM_D6_OFFSET 0x0a2 | ||
168 | #define OMAP2420_CONTROL_PADCONF_CAM_D5_OFFSET 0x0a3 | ||
169 | #define OMAP2420_CONTROL_PADCONF_CAM_D4_OFFSET 0x0a4 | ||
170 | #define OMAP2420_CONTROL_PADCONF_CAM_D3_OFFSET 0x0a5 | ||
171 | #define OMAP2420_CONTROL_PADCONF_CAM_D2_OFFSET 0x0a6 | ||
172 | #define OMAP2420_CONTROL_PADCONF_CAM_D1_OFFSET 0x0a7 | ||
173 | #define OMAP2420_CONTROL_PADCONF_CAM_D0_OFFSET 0x0a8 | ||
174 | #define OMAP2420_CONTROL_PADCONF_CAM_HS_OFFSET 0x0a9 | ||
175 | #define OMAP2420_CONTROL_PADCONF_CAM_VS_OFFSET 0x0aa | ||
176 | #define OMAP2420_CONTROL_PADCONF_CAM_LCLK_OFFSET 0x0ab | ||
177 | #define OMAP2420_CONTROL_PADCONF_CAM_XCLK_OFFSET 0x0ac | ||
178 | #define OMAP2420_CONTROL_PADCONF_SSI1_DAT_TX_OFFSET 0x0ad | ||
179 | #define OMAP2420_CONTROL_PADCONF_SSI1_FLAG_TX_OFFSET 0x0ae | ||
180 | #define OMAP2420_CONTROL_PADCONF_SSI1_RDY_TX_OFFSET 0x0af | ||
181 | #define OMAP2420_CONTROL_PADCONF_GPIO_62_OFFSET 0x0b0 | ||
182 | #define OMAP2420_CONTROL_PADCONF_SSI1_DAT_RX_OFFSET 0x0b1 | ||
183 | #define OMAP2420_CONTROL_PADCONF_SSI1_FLAG_RX_OFFSET 0x0b2 | ||
184 | #define OMAP2420_CONTROL_PADCONF_SSI1_RDY_RX_OFFSET 0x0b3 | ||
185 | #define OMAP2420_CONTROL_PADCONF_SSI1_WAKE_OFFSET 0x0b4 | ||
186 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_CLK_OFFSET 0x0b5 | ||
187 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_RX1_OFFSET 0x0b6 | ||
188 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_RX0_OFFSET 0x0b7 | ||
189 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_TX1_OFFSET 0x0b8 | ||
190 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_TX0_OFFSET 0x0b9 | ||
191 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_NLA_OFFSET 0x0ba | ||
192 | #define OMAP2420_CONTROL_PADCONF_UART2_CTS_OFFSET 0x0bb | ||
193 | #define OMAP2420_CONTROL_PADCONF_UART2_RTS_OFFSET 0x0bc | ||
194 | #define OMAP2420_CONTROL_PADCONF_UART2_TX_OFFSET 0x0bd | ||
195 | #define OMAP2420_CONTROL_PADCONF_UART2_RX_OFFSET 0x0be | ||
196 | #define OMAP2420_CONTROL_PADCONF_EAC_BT_SCLK_OFFSET 0x0bf | ||
197 | #define OMAP2420_CONTROL_PADCONF_EAC_BT_FS_OFFSET 0x0c0 | ||
198 | #define OMAP2420_CONTROL_PADCONF_EAC_BT_DIN_OFFSET 0x0c1 | ||
199 | #define OMAP2420_CONTROL_PADCONF_EAC_BT_DOUT_OFFSET 0x0c2 | ||
200 | #define OMAP2420_CONTROL_PADCONF_MMC_CLKO_OFFSET 0x0c3 | ||
201 | #define OMAP2420_CONTROL_PADCONF_MMC_CMD_OFFSET 0x0c4 | ||
202 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT0_OFFSET 0x0c5 | ||
203 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT1_OFFSET 0x0c6 | ||
204 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT2_OFFSET 0x0c7 | ||
205 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT3_OFFSET 0x0c8 | ||
206 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT_DIR0_OFFSET 0x0c9 | ||
207 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT_DIR1_OFFSET 0x0ca | ||
208 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT_DIR2_OFFSET 0x0cb | ||
209 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT_DIR3_OFFSET 0x0cc | ||
210 | #define OMAP2420_CONTROL_PADCONF_MMC_CMD_DIR_OFFSET 0x0cd | ||
211 | #define OMAP2420_CONTROL_PADCONF_MMC_CLKI_OFFSET 0x0ce | ||
212 | #define OMAP2420_CONTROL_PADCONF_SPI1_CLK_OFFSET 0x0cf | ||
213 | #define OMAP2420_CONTROL_PADCONF_SPI1_SIMO_OFFSET 0x0d0 | ||
214 | #define OMAP2420_CONTROL_PADCONF_SPI1_SOMI_OFFSET 0x0d1 | ||
215 | #define OMAP2420_CONTROL_PADCONF_SPI1_NCS0_OFFSET 0x0d2 | ||
216 | #define OMAP2420_CONTROL_PADCONF_SPI1_NCS1_OFFSET 0x0d3 | ||
217 | #define OMAP2420_CONTROL_PADCONF_SPI1_NCS2_OFFSET 0x0d4 | ||
218 | #define OMAP2420_CONTROL_PADCONF_SPI1_NCS3_OFFSET 0x0d5 | ||
219 | #define OMAP2420_CONTROL_PADCONF_SPI2_CLK_OFFSET 0x0d6 | ||
220 | #define OMAP2420_CONTROL_PADCONF_SPI2_SIMO_OFFSET 0x0d7 | ||
221 | #define OMAP2420_CONTROL_PADCONF_SPI2_SOMI_OFFSET 0x0d8 | ||
222 | #define OMAP2420_CONTROL_PADCONF_SPI2_NCS0_OFFSET 0x0d9 | ||
223 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_CLKR_OFFSET 0x0da | ||
224 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_FSR_OFFSET 0x0db | ||
225 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_DX_OFFSET 0x0dc | ||
226 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_DR_OFFSET 0x0dd | ||
227 | #define OMAP2420_CONTROL_PADCONF_MCBSP_CLKS_OFFSET 0x0de | ||
228 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_FSX_OFFSET 0x0df | ||
229 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_CLKX_OFFSET 0x0e0 | ||
230 | #define OMAP2420_CONTROL_PADCONF_I2C1_SCL_OFFSET 0x0e1 | ||
231 | #define OMAP2420_CONTROL_PADCONF_I2C1_SDA_OFFSET 0x0e2 | ||
232 | #define OMAP2420_CONTROL_PADCONF_I2C2_SCL_OFFSET 0x0e3 | ||
233 | #define OMAP2420_CONTROL_PADCONF_I2C2_SDA_OFFSET 0x0e4 | ||
234 | #define OMAP2420_CONTROL_PADCONF_HDQ_SIO_OFFSET 0x0e5 | ||
235 | #define OMAP2420_CONTROL_PADCONF_UART3_CTS_RCTX_OFFSET 0x0e6 | ||
236 | #define OMAP2420_CONTROL_PADCONF_UART3_RTS_SD_OFFSET 0x0e7 | ||
237 | #define OMAP2420_CONTROL_PADCONF_UART3_TX_IRTX_OFFSET 0x0e8 | ||
238 | #define OMAP2420_CONTROL_PADCONF_UART3_RX_IRRX_OFFSET 0x0e9 | ||
239 | #define OMAP2420_CONTROL_PADCONF_TV_CVBS_OFFSET 0x0ea | ||
240 | #define OMAP2420_CONTROL_PADCONF_TV_VREF_OFFSET 0x0eb | ||
241 | #define OMAP2420_CONTROL_PADCONF_TV_RREF_OFFSET 0x0ec | ||
242 | #define OMAP2420_CONTROL_PADCONF_USB0_PUEN_OFFSET 0x0ed | ||
243 | #define OMAP2420_CONTROL_PADCONF_USB0_VP_OFFSET 0x0ee | ||
244 | #define OMAP2420_CONTROL_PADCONF_USB0_VM_OFFSET 0x0ef | ||
245 | #define OMAP2420_CONTROL_PADCONF_USB0_RCV_OFFSET 0x0f0 | ||
246 | #define OMAP2420_CONTROL_PADCONF_USB0_TXEN_OFFSET 0x0f1 | ||
247 | #define OMAP2420_CONTROL_PADCONF_USB0_SE0_OFFSET 0x0f2 | ||
248 | #define OMAP2420_CONTROL_PADCONF_USB0_DAT_OFFSET 0x0f3 | ||
249 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_SCLK_OFFSET 0x0f4 | ||
250 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_FS_OFFSET 0x0f5 | ||
251 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_DIN_OFFSET 0x0f6 | ||
252 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_DOUT_OFFSET 0x0f7 | ||
253 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_MCLK_OFFSET 0x0f8 | ||
254 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_RST_OFFSET 0x0f9 | ||
255 | #define OMAP2420_CONTROL_PADCONF_SYS_NRESPWRON_OFFSET 0x0fa | ||
256 | #define OMAP2420_CONTROL_PADCONF_SYS_NRESWARM_OFFSET 0x0fb | ||
257 | #define OMAP2420_CONTROL_PADCONF_SYS_NIRQ_OFFSET 0x0fc | ||
258 | #define OMAP2420_CONTROL_PADCONF_SYS_NV_OFFSET 0x0fd | ||
259 | #define OMAP2420_CONTROL_PADCONF_GPIO_119_OFFSET 0x0fe | ||
260 | #define OMAP2420_CONTROL_PADCONF_GPIO_120_OFFSET 0x0ff | ||
261 | #define OMAP2420_CONTROL_PADCONF_GPIO_121_OFFSET 0x100 | ||
262 | #define OMAP2420_CONTROL_PADCONF_GPIO_122_OFFSET 0x101 | ||
263 | #define OMAP2420_CONTROL_PADCONF_SYS_32K_OFFSET 0x102 | ||
264 | #define OMAP2420_CONTROL_PADCONF_SYS_XTALIN_OFFSET 0x103 | ||
265 | #define OMAP2420_CONTROL_PADCONF_SYS_XTALOUT_OFFSET 0x104 | ||
266 | #define OMAP2420_CONTROL_PADCONF_GPIO_36_OFFSET 0x105 | ||
267 | #define OMAP2420_CONTROL_PADCONF_SYS_CLKREQ_OFFSET 0x106 | ||
268 | #define OMAP2420_CONTROL_PADCONF_SYS_CLKOUT_OFFSET 0x107 | ||
269 | #define OMAP2420_CONTROL_PADCONF_GPIO_6_OFFSET 0x108 | ||
270 | #define OMAP2420_CONTROL_PADCONF_GPIO_124_OFFSET 0x109 | ||
271 | #define OMAP2420_CONTROL_PADCONF_GPIO_125_OFFSET 0x10a | ||
272 | #define OMAP2420_CONTROL_PADCONF_JTAG_EMU1_OFFSET 0x10b | ||
273 | #define OMAP2420_CONTROL_PADCONF_JTAG_EMU0_OFFSET 0x10c | ||
274 | #define OMAP2420_CONTROL_PADCONF_JTAG_NTRST_OFFSET 0x10d | ||
275 | #define OMAP2420_CONTROL_PADCONF_JTAG_TCK_OFFSET 0x10e | ||
276 | #define OMAP2420_CONTROL_PADCONF_JTAG_RTCK_OFFSET 0x10f | ||
277 | #define OMAP2420_CONTROL_PADCONF_JTAG_TMS_OFFSET 0x110 | ||
278 | #define OMAP2420_CONTROL_PADCONF_JTAG_TDI_OFFSET 0x111 | ||
279 | #define OMAP2420_CONTROL_PADCONF_JTAG_TDO_OFFSET 0x112 | ||
280 | |||
281 | #define OMAP2420_CONTROL_PADCONF_MUX_SIZE \ | ||
282 | (OMAP2420_CONTROL_PADCONF_JTAG_TDO_OFFSET + 0x1) | ||
diff --git a/arch/arm/mach-omap2/mux2430.c b/arch/arm/mach-omap2/mux2430.c deleted file mode 100644 index 4185f92553db..000000000000 --- a/arch/arm/mach-omap2/mux2430.c +++ /dev/null | |||
@@ -1,793 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Nokia | ||
3 | * Copyright (C) 2010 Texas Instruments | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #include <linux/module.h> | ||
11 | #include <linux/init.h> | ||
12 | |||
13 | #include "mux.h" | ||
14 | |||
15 | #ifdef CONFIG_OMAP_MUX | ||
16 | |||
17 | #define _OMAP2430_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \ | ||
18 | { \ | ||
19 | .reg_offset = (OMAP2430_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
20 | .gpio = (g), \ | ||
21 | .muxnames = { m0, m1, m2, m3, m4, m5, m6, m7 }, \ | ||
22 | } | ||
23 | |||
24 | #else | ||
25 | |||
26 | #define _OMAP2430_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \ | ||
27 | { \ | ||
28 | .reg_offset = (OMAP2430_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
29 | .gpio = (g), \ | ||
30 | } | ||
31 | |||
32 | #endif | ||
33 | |||
34 | #define _OMAP2430_BALLENTRY(M0, bb, bt) \ | ||
35 | { \ | ||
36 | .reg_offset = (OMAP2430_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
37 | .balls = { bb, bt }, \ | ||
38 | } | ||
39 | |||
40 | /* | ||
41 | * Superset of all mux modes for omap2430 | ||
42 | */ | ||
43 | static struct omap_mux __initdata omap2430_muxmodes[] = { | ||
44 | _OMAP2430_MUXENTRY(CAM_D0, 133, | ||
45 | "cam_d0", "hw_dbg0", "sti_dout", "gpio_133", | ||
46 | NULL, NULL, "etk_d2", "safe_mode"), | ||
47 | _OMAP2430_MUXENTRY(CAM_D10, 146, | ||
48 | "cam_d10", NULL, NULL, "gpio_146", | ||
49 | NULL, NULL, "etk_d12", "safe_mode"), | ||
50 | _OMAP2430_MUXENTRY(CAM_D11, 145, | ||
51 | "cam_d11", NULL, NULL, "gpio_145", | ||
52 | NULL, NULL, "etk_d13", "safe_mode"), | ||
53 | _OMAP2430_MUXENTRY(CAM_D1, 132, | ||
54 | "cam_d1", "hw_dbg1", "sti_din", "gpio_132", | ||
55 | NULL, NULL, "etk_d3", "safe_mode"), | ||
56 | _OMAP2430_MUXENTRY(CAM_D2, 129, | ||
57 | "cam_d2", "hw_dbg2", "mcbsp1_clkx", "gpio_129", | ||
58 | NULL, NULL, "etk_d4", "safe_mode"), | ||
59 | _OMAP2430_MUXENTRY(CAM_D3, 128, | ||
60 | "cam_d3", "hw_dbg3", "mcbsp1_dr", "gpio_128", | ||
61 | NULL, NULL, "etk_d5", "safe_mode"), | ||
62 | _OMAP2430_MUXENTRY(CAM_D4, 143, | ||
63 | "cam_d4", "hw_dbg4", "mcbsp1_fsr", "gpio_143", | ||
64 | NULL, NULL, "etk_d6", "safe_mode"), | ||
65 | _OMAP2430_MUXENTRY(CAM_D5, 112, | ||
66 | "cam_d5", "hw_dbg5", "mcbsp1_clkr", "gpio_112", | ||
67 | NULL, NULL, "etk_d7", "safe_mode"), | ||
68 | _OMAP2430_MUXENTRY(CAM_D6, 137, | ||
69 | "cam_d6", "hw_dbg6", NULL, "gpio_137", | ||
70 | NULL, NULL, "etk_d8", "safe_mode"), | ||
71 | _OMAP2430_MUXENTRY(CAM_D7, 136, | ||
72 | "cam_d7", "hw_dbg7", NULL, "gpio_136", | ||
73 | NULL, NULL, "etk_d9", "safe_mode"), | ||
74 | _OMAP2430_MUXENTRY(CAM_D8, 135, | ||
75 | "cam_d8", "hw_dbg8", NULL, "gpio_135", | ||
76 | NULL, NULL, "etk_d10", "safe_mode"), | ||
77 | _OMAP2430_MUXENTRY(CAM_D9, 134, | ||
78 | "cam_d9", "hw_dbg9", NULL, "gpio_134", | ||
79 | NULL, NULL, "etk_d11", "safe_mode"), | ||
80 | _OMAP2430_MUXENTRY(CAM_HS, 11, | ||
81 | "cam_hs", "hw_dbg10", "mcbsp1_dx", "gpio_11", | ||
82 | NULL, NULL, "etk_d1", "safe_mode"), | ||
83 | _OMAP2430_MUXENTRY(CAM_LCLK, 0, | ||
84 | "cam_lclk", NULL, "mcbsp_clks", NULL, | ||
85 | NULL, NULL, "etk_c1", "safe_mode"), | ||
86 | _OMAP2430_MUXENTRY(CAM_VS, 12, | ||
87 | "cam_vs", "hw_dbg11", "mcbsp1_fsx", "gpio_12", | ||
88 | NULL, NULL, "etk_d0", "safe_mode"), | ||
89 | _OMAP2430_MUXENTRY(CAM_XCLK, 0, | ||
90 | "cam_xclk", NULL, "sti_clk", NULL, | ||
91 | NULL, NULL, "etk_c2", NULL), | ||
92 | _OMAP2430_MUXENTRY(DSS_ACBIAS, 48, | ||
93 | "dss_acbias", NULL, "mcbsp2_fsx", "gpio_48", | ||
94 | NULL, NULL, NULL, "safe_mode"), | ||
95 | _OMAP2430_MUXENTRY(DSS_DATA0, 40, | ||
96 | "dss_data0", "uart1_cts", NULL, "gpio_40", | ||
97 | NULL, NULL, NULL, "safe_mode"), | ||
98 | _OMAP2430_MUXENTRY(DSS_DATA10, 128, | ||
99 | "dss_data10", "sdi_data1n", NULL, "gpio_128", | ||
100 | NULL, NULL, NULL, "safe_mode"), | ||
101 | _OMAP2430_MUXENTRY(DSS_DATA11, 129, | ||
102 | "dss_data11", "sdi_data1p", NULL, "gpio_129", | ||
103 | NULL, NULL, NULL, "safe_mode"), | ||
104 | _OMAP2430_MUXENTRY(DSS_DATA12, 130, | ||
105 | "dss_data12", "sdi_data2n", NULL, "gpio_130", | ||
106 | NULL, NULL, NULL, "safe_mode"), | ||
107 | _OMAP2430_MUXENTRY(DSS_DATA13, 131, | ||
108 | "dss_data13", "sdi_data2p", NULL, "gpio_131", | ||
109 | NULL, NULL, NULL, "safe_mode"), | ||
110 | _OMAP2430_MUXENTRY(DSS_DATA14, 132, | ||
111 | "dss_data14", "sdi_data3n", NULL, "gpio_132", | ||
112 | NULL, NULL, NULL, "safe_mode"), | ||
113 | _OMAP2430_MUXENTRY(DSS_DATA15, 133, | ||
114 | "dss_data15", "sdi_data3p", NULL, "gpio_133", | ||
115 | NULL, NULL, NULL, "safe_mode"), | ||
116 | _OMAP2430_MUXENTRY(DSS_DATA16, 46, | ||
117 | "dss_data16", NULL, NULL, "gpio_46", | ||
118 | NULL, NULL, NULL, "safe_mode"), | ||
119 | _OMAP2430_MUXENTRY(DSS_DATA17, 47, | ||
120 | "dss_data17", NULL, NULL, "gpio_47", | ||
121 | NULL, NULL, NULL, "safe_mode"), | ||
122 | _OMAP2430_MUXENTRY(DSS_DATA1, 41, | ||
123 | "dss_data1", "uart1_rts", NULL, "gpio_41", | ||
124 | NULL, NULL, NULL, "safe_mode"), | ||
125 | _OMAP2430_MUXENTRY(DSS_DATA2, 42, | ||
126 | "dss_data2", "uart1_tx", NULL, "gpio_42", | ||
127 | NULL, NULL, NULL, "safe_mode"), | ||
128 | _OMAP2430_MUXENTRY(DSS_DATA3, 43, | ||
129 | "dss_data3", "uart1_rx", NULL, "gpio_43", | ||
130 | NULL, NULL, NULL, "safe_mode"), | ||
131 | _OMAP2430_MUXENTRY(DSS_DATA4, 44, | ||
132 | "dss_data4", "uart3_rx_irrx", NULL, "gpio_44", | ||
133 | NULL, NULL, NULL, "safe_mode"), | ||
134 | _OMAP2430_MUXENTRY(DSS_DATA5, 45, | ||
135 | "dss_data5", "uart3_tx_irtx", NULL, "gpio_45", | ||
136 | NULL, NULL, NULL, "safe_mode"), | ||
137 | _OMAP2430_MUXENTRY(DSS_DATA6, 144, | ||
138 | "dss_data6", NULL, NULL, "gpio_144", | ||
139 | NULL, NULL, NULL, "safe_mode"), | ||
140 | _OMAP2430_MUXENTRY(DSS_DATA7, 147, | ||
141 | "dss_data7", NULL, NULL, "gpio_147", | ||
142 | NULL, NULL, NULL, "safe_mode"), | ||
143 | _OMAP2430_MUXENTRY(DSS_DATA8, 38, | ||
144 | "dss_data8", NULL, NULL, "gpio_38", | ||
145 | NULL, NULL, NULL, "safe_mode"), | ||
146 | _OMAP2430_MUXENTRY(DSS_DATA9, 39, | ||
147 | "dss_data9", NULL, NULL, "gpio_39", | ||
148 | NULL, NULL, NULL, "safe_mode"), | ||
149 | _OMAP2430_MUXENTRY(DSS_HSYNC, 110, | ||
150 | "dss_hsync", NULL, NULL, "gpio_110", | ||
151 | NULL, NULL, NULL, "safe_mode"), | ||
152 | _OMAP2430_MUXENTRY(GPIO_113, 113, | ||
153 | "gpio_113", "mcbsp2_clkx", NULL, "gpio_113", | ||
154 | NULL, NULL, NULL, "safe_mode"), | ||
155 | _OMAP2430_MUXENTRY(GPIO_114, 114, | ||
156 | "gpio_114", "mcbsp2_fsx", NULL, "gpio_114", | ||
157 | NULL, NULL, NULL, "safe_mode"), | ||
158 | _OMAP2430_MUXENTRY(GPIO_115, 115, | ||
159 | "gpio_115", "mcbsp2_dr", NULL, "gpio_115", | ||
160 | NULL, NULL, NULL, "safe_mode"), | ||
161 | _OMAP2430_MUXENTRY(GPIO_116, 116, | ||
162 | "gpio_116", "mcbsp2_dx", NULL, "gpio_116", | ||
163 | NULL, NULL, NULL, "safe_mode"), | ||
164 | _OMAP2430_MUXENTRY(GPIO_128, 128, | ||
165 | "gpio_128", NULL, "sti_din", "gpio_128", | ||
166 | NULL, "sys_boot0", NULL, "safe_mode"), | ||
167 | _OMAP2430_MUXENTRY(GPIO_129, 129, | ||
168 | "gpio_129", NULL, "sti_dout", "gpio_129", | ||
169 | NULL, "sys_boot1", NULL, "safe_mode"), | ||
170 | _OMAP2430_MUXENTRY(GPIO_130, 130, | ||
171 | "gpio_130", NULL, NULL, "gpio_130", | ||
172 | "jtag_emu2", "sys_boot2", NULL, "safe_mode"), | ||
173 | _OMAP2430_MUXENTRY(GPIO_131, 131, | ||
174 | "gpio_131", NULL, NULL, "gpio_131", | ||
175 | "jtag_emu3", "sys_boot3", NULL, "safe_mode"), | ||
176 | _OMAP2430_MUXENTRY(GPIO_132, 132, | ||
177 | "gpio_132", NULL, NULL, "gpio_132", | ||
178 | NULL, "sys_boot4", NULL, "safe_mode"), | ||
179 | _OMAP2430_MUXENTRY(GPIO_133, 133, | ||
180 | "gpio_133", NULL, NULL, "gpio_133", | ||
181 | NULL, "sys_boot5", NULL, "safe_mode"), | ||
182 | _OMAP2430_MUXENTRY(GPIO_134, 134, | ||
183 | "gpio_134", "ccp_datn", NULL, "gpio_134", | ||
184 | NULL, NULL, NULL, "safe_mode"), | ||
185 | _OMAP2430_MUXENTRY(GPIO_135, 135, | ||
186 | "gpio_135", "ccp_datp", NULL, "gpio_135", | ||
187 | NULL, NULL, NULL, "safe_mode"), | ||
188 | _OMAP2430_MUXENTRY(GPIO_136, 136, | ||
189 | "gpio_136", "ccp_clkn", NULL, "gpio_136", | ||
190 | NULL, NULL, NULL, "safe_mode"), | ||
191 | _OMAP2430_MUXENTRY(GPIO_137, 137, | ||
192 | "gpio_137", "ccp_clkp", NULL, "gpio_137", | ||
193 | NULL, NULL, NULL, "safe_mode"), | ||
194 | _OMAP2430_MUXENTRY(GPIO_138, 138, | ||
195 | "gpio_138", "spi3_clk", NULL, "gpio_138", | ||
196 | NULL, NULL, NULL, "safe_mode"), | ||
197 | _OMAP2430_MUXENTRY(GPIO_139, 139, | ||
198 | "gpio_139", "spi3_cs0", "sys_ndmareq3", "gpio_139", | ||
199 | NULL, NULL, NULL, "safe_mode"), | ||
200 | _OMAP2430_MUXENTRY(GPIO_140, 140, | ||
201 | "gpio_140", "spi3_simo", "sys_ndmareq4", "gpio_140", | ||
202 | NULL, NULL, "etk_d14", "safe_mode"), | ||
203 | _OMAP2430_MUXENTRY(GPIO_141, 141, | ||
204 | "gpio_141", "spi3_somi", NULL, "gpio_141", | ||
205 | NULL, NULL, NULL, "safe_mode"), | ||
206 | _OMAP2430_MUXENTRY(GPIO_142, 142, | ||
207 | "gpio_142", "spi3_cs1", "sys_ndmareq2", "gpio_142", | ||
208 | NULL, NULL, "etk_d15", "safe_mode"), | ||
209 | _OMAP2430_MUXENTRY(GPIO_148, 148, | ||
210 | "gpio_148", "mcbsp5_fsx", NULL, "gpio_148", | ||
211 | NULL, NULL, NULL, "safe_mode"), | ||
212 | _OMAP2430_MUXENTRY(GPIO_149, 149, | ||
213 | "gpio_149", "mcbsp5_dx", NULL, "gpio_149", | ||
214 | NULL, NULL, NULL, "safe_mode"), | ||
215 | _OMAP2430_MUXENTRY(GPIO_150, 150, | ||
216 | "gpio_150", "mcbsp5_dr", NULL, "gpio_150", | ||
217 | NULL, NULL, NULL, "safe_mode"), | ||
218 | _OMAP2430_MUXENTRY(GPIO_151, 151, | ||
219 | "gpio_151", "sys_pwrok", NULL, "gpio_151", | ||
220 | NULL, NULL, NULL, "safe_mode"), | ||
221 | _OMAP2430_MUXENTRY(GPIO_152, 152, | ||
222 | "gpio_152", "uart1_cts", "sys_ndmareq1", "gpio_152", | ||
223 | NULL, NULL, NULL, "safe_mode"), | ||
224 | _OMAP2430_MUXENTRY(GPIO_153, 153, | ||
225 | "gpio_153", "uart1_rx", "sys_ndmareq0", "gpio_153", | ||
226 | NULL, NULL, NULL, "safe_mode"), | ||
227 | _OMAP2430_MUXENTRY(GPIO_154, 154, | ||
228 | "gpio_154", "mcbsp5_clkx", NULL, "gpio_154", | ||
229 | NULL, NULL, NULL, "safe_mode"), | ||
230 | _OMAP2430_MUXENTRY(GPIO_63, 63, | ||
231 | "gpio_63", "mcbsp4_clkx", NULL, "gpio_63", | ||
232 | NULL, NULL, NULL, "safe_mode"), | ||
233 | _OMAP2430_MUXENTRY(GPIO_78, 78, | ||
234 | "gpio_78", NULL, "uart2_rts", "gpio_78", | ||
235 | "uart3_rts_sd", NULL, NULL, "safe_mode"), | ||
236 | _OMAP2430_MUXENTRY(GPIO_79, 79, | ||
237 | "gpio_79", "secure_indicator", "uart2_tx", "gpio_79", | ||
238 | "uart3_tx_irtx", NULL, NULL, "safe_mode"), | ||
239 | _OMAP2430_MUXENTRY(GPIO_7, 7, | ||
240 | "gpio_7", NULL, "uart2_cts", "gpio_7", | ||
241 | "uart3_cts_rctx", NULL, NULL, "safe_mode"), | ||
242 | _OMAP2430_MUXENTRY(GPIO_80, 80, | ||
243 | "gpio_80", NULL, "uart2_rx", "gpio_80", | ||
244 | "uart3_rx_irrx", NULL, NULL, "safe_mode"), | ||
245 | _OMAP2430_MUXENTRY(GPMC_A10, 3, | ||
246 | "gpmc_a10", NULL, "sys_ndmareq0", "gpio_3", | ||
247 | NULL, NULL, NULL, "safe_mode"), | ||
248 | _OMAP2430_MUXENTRY(GPMC_A1, 31, | ||
249 | "gpmc_a1", NULL, NULL, "gpio_31", | ||
250 | NULL, NULL, NULL, "safe_mode"), | ||
251 | _OMAP2430_MUXENTRY(GPMC_A2, 30, | ||
252 | "gpmc_a2", NULL, NULL, "gpio_30", | ||
253 | NULL, NULL, NULL, "safe_mode"), | ||
254 | _OMAP2430_MUXENTRY(GPMC_A3, 29, | ||
255 | "gpmc_a3", NULL, NULL, "gpio_29", | ||
256 | NULL, NULL, NULL, "safe_mode"), | ||
257 | _OMAP2430_MUXENTRY(GPMC_A4, 49, | ||
258 | "gpmc_a4", NULL, NULL, "gpio_49", | ||
259 | NULL, NULL, NULL, "safe_mode"), | ||
260 | _OMAP2430_MUXENTRY(GPMC_A5, 53, | ||
261 | "gpmc_a5", NULL, NULL, "gpio_53", | ||
262 | NULL, NULL, NULL, "safe_mode"), | ||
263 | _OMAP2430_MUXENTRY(GPMC_A6, 52, | ||
264 | "gpmc_a6", NULL, NULL, "gpio_52", | ||
265 | NULL, NULL, NULL, "safe_mode"), | ||
266 | _OMAP2430_MUXENTRY(GPMC_A7, 6, | ||
267 | "gpmc_a7", NULL, NULL, "gpio_6", | ||
268 | NULL, NULL, NULL, "safe_mode"), | ||
269 | _OMAP2430_MUXENTRY(GPMC_A8, 5, | ||
270 | "gpmc_a8", NULL, NULL, "gpio_5", | ||
271 | NULL, NULL, NULL, "safe_mode"), | ||
272 | _OMAP2430_MUXENTRY(GPMC_A9, 4, | ||
273 | "gpmc_a9", NULL, "sys_ndmareq1", "gpio_4", | ||
274 | NULL, NULL, NULL, "safe_mode"), | ||
275 | _OMAP2430_MUXENTRY(GPMC_CLK, 21, | ||
276 | "gpmc_clk", NULL, NULL, "gpio_21", | ||
277 | NULL, NULL, NULL, "safe_mode"), | ||
278 | _OMAP2430_MUXENTRY(GPMC_D10, 18, | ||
279 | "gpmc_d10", NULL, NULL, "gpio_18", | ||
280 | NULL, NULL, NULL, "safe_mode"), | ||
281 | _OMAP2430_MUXENTRY(GPMC_D11, 57, | ||
282 | "gpmc_d11", NULL, NULL, "gpio_57", | ||
283 | NULL, NULL, NULL, "safe_mode"), | ||
284 | _OMAP2430_MUXENTRY(GPMC_D12, 77, | ||
285 | "gpmc_d12", NULL, NULL, "gpio_77", | ||
286 | NULL, NULL, NULL, "safe_mode"), | ||
287 | _OMAP2430_MUXENTRY(GPMC_D13, 76, | ||
288 | "gpmc_d13", NULL, NULL, "gpio_76", | ||
289 | NULL, NULL, NULL, "safe_mode"), | ||
290 | _OMAP2430_MUXENTRY(GPMC_D14, 55, | ||
291 | "gpmc_d14", NULL, NULL, "gpio_55", | ||
292 | NULL, NULL, NULL, "safe_mode"), | ||
293 | _OMAP2430_MUXENTRY(GPMC_D15, 54, | ||
294 | "gpmc_d15", NULL, NULL, "gpio_54", | ||
295 | NULL, NULL, NULL, "safe_mode"), | ||
296 | _OMAP2430_MUXENTRY(GPMC_D8, 20, | ||
297 | "gpmc_d8", NULL, NULL, "gpio_20", | ||
298 | NULL, NULL, NULL, "safe_mode"), | ||
299 | _OMAP2430_MUXENTRY(GPMC_D9, 19, | ||
300 | "gpmc_d9", NULL, NULL, "gpio_19", | ||
301 | NULL, NULL, NULL, "safe_mode"), | ||
302 | _OMAP2430_MUXENTRY(GPMC_NCS1, 22, | ||
303 | "gpmc_ncs1", NULL, NULL, "gpio_22", | ||
304 | NULL, NULL, NULL, "safe_mode"), | ||
305 | _OMAP2430_MUXENTRY(GPMC_NCS2, 23, | ||
306 | "gpmc_ncs2", NULL, NULL, "gpio_23", | ||
307 | NULL, NULL, NULL, "safe_mode"), | ||
308 | _OMAP2430_MUXENTRY(GPMC_NCS3, 24, | ||
309 | "gpmc_ncs3", "gpmc_io_dir", NULL, "gpio_24", | ||
310 | NULL, NULL, NULL, "safe_mode"), | ||
311 | _OMAP2430_MUXENTRY(GPMC_NCS4, 25, | ||
312 | "gpmc_ncs4", NULL, NULL, "gpio_25", | ||
313 | NULL, NULL, NULL, "safe_mode"), | ||
314 | _OMAP2430_MUXENTRY(GPMC_NCS5, 26, | ||
315 | "gpmc_ncs5", NULL, NULL, "gpio_26", | ||
316 | NULL, NULL, NULL, "safe_mode"), | ||
317 | _OMAP2430_MUXENTRY(GPMC_NCS6, 27, | ||
318 | "gpmc_ncs6", NULL, NULL, "gpio_27", | ||
319 | NULL, NULL, NULL, "safe_mode"), | ||
320 | _OMAP2430_MUXENTRY(GPMC_NCS7, 28, | ||
321 | "gpmc_ncs7", "gpmc_io_dir", NULL, "gpio_28", | ||
322 | NULL, NULL, NULL, "safe_mode"), | ||
323 | _OMAP2430_MUXENTRY(GPMC_WAIT1, 33, | ||
324 | "gpmc_wait1", NULL, NULL, "gpio_33", | ||
325 | NULL, NULL, NULL, "safe_mode"), | ||
326 | _OMAP2430_MUXENTRY(GPMC_WAIT2, 34, | ||
327 | "gpmc_wait2", NULL, NULL, "gpio_34", | ||
328 | NULL, NULL, NULL, "safe_mode"), | ||
329 | _OMAP2430_MUXENTRY(GPMC_WAIT3, 35, | ||
330 | "gpmc_wait3", NULL, NULL, "gpio_35", | ||
331 | NULL, NULL, NULL, "safe_mode"), | ||
332 | _OMAP2430_MUXENTRY(HDQ_SIO, 101, | ||
333 | "hdq_sio", "usb2_tllse0", "sys_altclk", "gpio_101", | ||
334 | "uart3_rx_irrx", NULL, NULL, "safe_mode"), | ||
335 | _OMAP2430_MUXENTRY(I2C1_SCL, 50, | ||
336 | "i2c1_scl", NULL, NULL, "gpio_50", | ||
337 | NULL, NULL, NULL, "safe_mode"), | ||
338 | _OMAP2430_MUXENTRY(I2C1_SDA, 51, | ||
339 | "i2c1_sda", NULL, NULL, "gpio_51", | ||
340 | NULL, NULL, NULL, "safe_mode"), | ||
341 | _OMAP2430_MUXENTRY(I2C2_SCL, 99, | ||
342 | "i2c2_scl", NULL, NULL, "gpio_99", | ||
343 | NULL, NULL, NULL, "safe_mode"), | ||
344 | _OMAP2430_MUXENTRY(I2C2_SDA, 100, | ||
345 | "i2c2_sda", NULL, NULL, "gpio_100", | ||
346 | NULL, NULL, NULL, "safe_mode"), | ||
347 | _OMAP2430_MUXENTRY(JTAG_EMU0, 127, | ||
348 | "jtag_emu0", "secure_indicator", NULL, "gpio_127", | ||
349 | NULL, NULL, NULL, "safe_mode"), | ||
350 | _OMAP2430_MUXENTRY(JTAG_EMU1, 126, | ||
351 | "jtag_emu1", NULL, NULL, "gpio_126", | ||
352 | NULL, NULL, NULL, "safe_mode"), | ||
353 | _OMAP2430_MUXENTRY(MCBSP1_CLKR, 92, | ||
354 | "mcbsp1_clkr", "ssi2_dat_tx", NULL, "gpio_92", | ||
355 | NULL, NULL, NULL, "safe_mode"), | ||
356 | _OMAP2430_MUXENTRY(MCBSP1_CLKX, 98, | ||
357 | "mcbsp1_clkx", "ssi2_wake", NULL, "gpio_98", | ||
358 | NULL, NULL, NULL, "safe_mode"), | ||
359 | _OMAP2430_MUXENTRY(MCBSP1_DR, 95, | ||
360 | "mcbsp1_dr", "ssi2_dat_rx", NULL, "gpio_95", | ||
361 | NULL, NULL, NULL, "safe_mode"), | ||
362 | _OMAP2430_MUXENTRY(MCBSP1_DX, 94, | ||
363 | "mcbsp1_dx", "ssi2_rdy_tx", NULL, "gpio_94", | ||
364 | NULL, NULL, NULL, "safe_mode"), | ||
365 | _OMAP2430_MUXENTRY(MCBSP1_FSR, 93, | ||
366 | "mcbsp1_fsr", "ssi2_flag_tx", NULL, "gpio_93", | ||
367 | "spi2_cs1", NULL, NULL, "safe_mode"), | ||
368 | _OMAP2430_MUXENTRY(MCBSP1_FSX, 97, | ||
369 | "mcbsp1_fsx", "ssi2_rdy_rx", NULL, "gpio_97", | ||
370 | NULL, NULL, NULL, "safe_mode"), | ||
371 | _OMAP2430_MUXENTRY(MCBSP2_CLKX, 147, | ||
372 | "mcbsp2_clkx", "sdi_clkp", "dss_data23", "gpio_147", | ||
373 | NULL, NULL, NULL, "safe_mode"), | ||
374 | _OMAP2430_MUXENTRY(MCBSP2_DR, 144, | ||
375 | "mcbsp2_dr", "sdi_clkn", "dss_data22", "gpio_144", | ||
376 | NULL, NULL, NULL, "safe_mode"), | ||
377 | _OMAP2430_MUXENTRY(MCBSP3_CLKX, 71, | ||
378 | "mcbsp3_clkx", NULL, NULL, "gpio_71", | ||
379 | NULL, NULL, NULL, "safe_mode"), | ||
380 | _OMAP2430_MUXENTRY(MCBSP3_DR, 73, | ||
381 | "mcbsp3_dr", NULL, NULL, "gpio_73", | ||
382 | NULL, NULL, NULL, "safe_mode"), | ||
383 | _OMAP2430_MUXENTRY(MCBSP3_DX, 74, | ||
384 | "mcbsp3_dx", NULL, "sti_clk", "gpio_74", | ||
385 | NULL, NULL, NULL, "safe_mode"), | ||
386 | _OMAP2430_MUXENTRY(MCBSP3_FSX, 72, | ||
387 | "mcbsp3_fsx", NULL, NULL, "gpio_72", | ||
388 | NULL, NULL, NULL, "safe_mode"), | ||
389 | _OMAP2430_MUXENTRY(MCBSP_CLKS, 96, | ||
390 | "mcbsp_clks", "ssi2_flag_rx", NULL, "gpio_96", | ||
391 | NULL, NULL, NULL, "safe_mode"), | ||
392 | _OMAP2430_MUXENTRY(SDMMC1_CLKO, 0, | ||
393 | "sdmmc1_clko", "ms_clko", NULL, NULL, | ||
394 | NULL, "hw_dbg9", "hw_dbg3", "safe_mode"), | ||
395 | _OMAP2430_MUXENTRY(SDMMC1_CMD, 0, | ||
396 | "sdmmc1_cmd", "ms_bs", NULL, NULL, | ||
397 | NULL, "hw_dbg8", "hw_dbg2", "safe_mode"), | ||
398 | _OMAP2430_MUXENTRY(SDMMC1_DAT0, 0, | ||
399 | "sdmmc1_dat0", "ms_dat0", NULL, NULL, | ||
400 | NULL, "hw_dbg7", "hw_dbg1", "safe_mode"), | ||
401 | _OMAP2430_MUXENTRY(SDMMC1_DAT1, 75, | ||
402 | "sdmmc1_dat1", "ms_dat1", NULL, "gpio_75", | ||
403 | NULL, "hw_dbg6", "hw_dbg0", "safe_mode"), | ||
404 | _OMAP2430_MUXENTRY(SDMMC1_DAT2, 0, | ||
405 | "sdmmc1_dat2", "ms_dat2", NULL, NULL, | ||
406 | NULL, "hw_dbg5", "hw_dbg10", "safe_mode"), | ||
407 | _OMAP2430_MUXENTRY(SDMMC1_DAT3, 0, | ||
408 | "sdmmc1_dat3", "ms_dat3", NULL, NULL, | ||
409 | NULL, "hw_dbg4", "hw_dbg11", "safe_mode"), | ||
410 | _OMAP2430_MUXENTRY(SDMMC2_CLKO, 13, | ||
411 | "sdmmc2_clko", NULL, NULL, "gpio_13", | ||
412 | NULL, "spi3_clk", NULL, "safe_mode"), | ||
413 | _OMAP2430_MUXENTRY(SDMMC2_CMD, 15, | ||
414 | "sdmmc2_cmd", "usb2_rcv", NULL, "gpio_15", | ||
415 | NULL, "spi3_simo", NULL, "safe_mode"), | ||
416 | _OMAP2430_MUXENTRY(SDMMC2_DAT0, 16, | ||
417 | "sdmmc2_dat0", "usb2_tllse0", NULL, "gpio_16", | ||
418 | NULL, "spi3_somi", NULL, "safe_mode"), | ||
419 | _OMAP2430_MUXENTRY(SDMMC2_DAT1, 58, | ||
420 | "sdmmc2_dat1", "usb2_txen", NULL, "gpio_58", | ||
421 | NULL, NULL, NULL, "safe_mode"), | ||
422 | _OMAP2430_MUXENTRY(SDMMC2_DAT2, 17, | ||
423 | "sdmmc2_dat2", "usb2_dat", NULL, "gpio_17", | ||
424 | NULL, "spi3_cs1", NULL, "safe_mode"), | ||
425 | _OMAP2430_MUXENTRY(SDMMC2_DAT3, 14, | ||
426 | "sdmmc2_dat3", "usb2_se0", NULL, "gpio_14", | ||
427 | NULL, "spi3_cs0", NULL, "safe_mode"), | ||
428 | _OMAP2430_MUXENTRY(SDRC_A12, 2, | ||
429 | "sdrc_a12", NULL, NULL, "gpio_2", | ||
430 | NULL, NULL, NULL, "safe_mode"), | ||
431 | _OMAP2430_MUXENTRY(SDRC_A13, 1, | ||
432 | "sdrc_a13", NULL, NULL, "gpio_1", | ||
433 | NULL, NULL, NULL, "safe_mode"), | ||
434 | _OMAP2430_MUXENTRY(SDRC_A14, 0, | ||
435 | "sdrc_a14", NULL, NULL, "gpio_0", | ||
436 | NULL, NULL, NULL, "safe_mode"), | ||
437 | _OMAP2430_MUXENTRY(SDRC_CKE1, 36, | ||
438 | "sdrc_cke1", NULL, NULL, "gpio_36", | ||
439 | NULL, NULL, NULL, "safe_mode"), | ||
440 | _OMAP2430_MUXENTRY(SDRC_NCS1, 37, | ||
441 | "sdrc_ncs1", NULL, NULL, "gpio_37", | ||
442 | NULL, NULL, NULL, "safe_mode"), | ||
443 | _OMAP2430_MUXENTRY(SPI1_CLK, 81, | ||
444 | "spi1_clk", NULL, NULL, "gpio_81", | ||
445 | NULL, NULL, NULL, "safe_mode"), | ||
446 | _OMAP2430_MUXENTRY(SPI1_CS0, 84, | ||
447 | "spi1_cs0", NULL, NULL, "gpio_84", | ||
448 | NULL, NULL, NULL, "safe_mode"), | ||
449 | _OMAP2430_MUXENTRY(SPI1_CS1, 85, | ||
450 | "spi1_cs1", NULL, NULL, "gpio_85", | ||
451 | NULL, NULL, NULL, "safe_mode"), | ||
452 | _OMAP2430_MUXENTRY(SPI1_CS2, 86, | ||
453 | "spi1_cs2", NULL, NULL, "gpio_86", | ||
454 | NULL, NULL, NULL, "safe_mode"), | ||
455 | _OMAP2430_MUXENTRY(SPI1_CS3, 87, | ||
456 | "spi1_cs3", "spi2_cs1", NULL, "gpio_87", | ||
457 | NULL, NULL, NULL, "safe_mode"), | ||
458 | _OMAP2430_MUXENTRY(SPI1_SIMO, 82, | ||
459 | "spi1_simo", NULL, NULL, "gpio_82", | ||
460 | NULL, NULL, NULL, "safe_mode"), | ||
461 | _OMAP2430_MUXENTRY(SPI1_SOMI, 83, | ||
462 | "spi1_somi", NULL, NULL, "gpio_83", | ||
463 | NULL, NULL, NULL, "safe_mode"), | ||
464 | _OMAP2430_MUXENTRY(SPI2_CLK, 88, | ||
465 | "spi2_clk", "gpt9_pwm_evt", NULL, "gpio_88", | ||
466 | NULL, NULL, NULL, "safe_mode"), | ||
467 | _OMAP2430_MUXENTRY(SPI2_CS0, 91, | ||
468 | "spi2_cs0", "gpt12_pwm_evt", NULL, "gpio_91", | ||
469 | NULL, NULL, NULL, "safe_mode"), | ||
470 | _OMAP2430_MUXENTRY(SPI2_SIMO, 89, | ||
471 | "spi2_simo", "gpt10_pwm_evt", NULL, "gpio_89", | ||
472 | NULL, NULL, NULL, "safe_mode"), | ||
473 | _OMAP2430_MUXENTRY(SPI2_SOMI, 90, | ||
474 | "spi2_somi", "gpt11_pwm_evt", NULL, "gpio_90", | ||
475 | NULL, NULL, NULL, "safe_mode"), | ||
476 | _OMAP2430_MUXENTRY(SSI1_DAT_RX, 62, | ||
477 | "ssi1_dat_rx", "uart1_rx", "usb1_dat", "gpio_62", | ||
478 | NULL, NULL, NULL, "safe_mode"), | ||
479 | _OMAP2430_MUXENTRY(SSI1_DAT_TX, 59, | ||
480 | "ssi1_dat_tx", "uart1_tx", "usb1_se0", "gpio_59", | ||
481 | NULL, NULL, NULL, "safe_mode"), | ||
482 | _OMAP2430_MUXENTRY(SSI1_FLAG_RX, 64, | ||
483 | "ssi1_flag_rx", "mcbsp4_dr", NULL, "gpio_64", | ||
484 | NULL, NULL, NULL, "safe_mode"), | ||
485 | _OMAP2430_MUXENTRY(SSI1_FLAG_TX, 60, | ||
486 | "ssi1_flag_tx", "uart1_rts", "usb1_rcv", "gpio_60", | ||
487 | NULL, NULL, NULL, "safe_mode"), | ||
488 | _OMAP2430_MUXENTRY(SSI1_RDY_RX, 65, | ||
489 | "ssi1_rdy_rx", "mcbsp4_dx", NULL, "gpio_65", | ||
490 | NULL, NULL, NULL, "safe_mode"), | ||
491 | _OMAP2430_MUXENTRY(SSI1_RDY_TX, 61, | ||
492 | "ssi1_rdy_tx", "uart1_cts", "usb1_txen", "gpio_61", | ||
493 | NULL, NULL, NULL, "safe_mode"), | ||
494 | _OMAP2430_MUXENTRY(SSI1_WAKE, 66, | ||
495 | "ssi1_wake", "mcbsp4_fsx", NULL, "gpio_66", | ||
496 | NULL, NULL, NULL, "safe_mode"), | ||
497 | _OMAP2430_MUXENTRY(SYS_CLKOUT, 111, | ||
498 | "sys_clkout", NULL, NULL, "gpio_111", | ||
499 | NULL, NULL, NULL, "safe_mode"), | ||
500 | _OMAP2430_MUXENTRY(SYS_DRM_MSECURE, 118, | ||
501 | "sys_drm_msecure", NULL, "sys_ndmareq6", "gpio_118", | ||
502 | NULL, NULL, NULL, "safe_mode"), | ||
503 | _OMAP2430_MUXENTRY(SYS_NIRQ0, 56, | ||
504 | "sys_nirq0", NULL, NULL, "gpio_56", | ||
505 | NULL, NULL, NULL, "safe_mode"), | ||
506 | _OMAP2430_MUXENTRY(SYS_NIRQ1, 125, | ||
507 | "sys_nirq1", NULL, "sys_ndmareq5", "gpio_125", | ||
508 | NULL, NULL, NULL, "safe_mode"), | ||
509 | _OMAP2430_MUXENTRY(UART1_CTS, 32, | ||
510 | "uart1_cts", "sdi_vsync", "dss_data18", "gpio_32", | ||
511 | "mcbsp5_clkx", NULL, NULL, "safe_mode"), | ||
512 | _OMAP2430_MUXENTRY(UART1_RTS, 8, | ||
513 | "uart1_rts", "sdi_hsync", "dss_data19", "gpio_8", | ||
514 | "mcbsp5_fsx", NULL, NULL, "safe_mode"), | ||
515 | _OMAP2430_MUXENTRY(UART1_RX, 10, | ||
516 | "uart1_rx", "sdi_stp", "dss_data21", "gpio_10", | ||
517 | "mcbsp5_dr", NULL, NULL, "safe_mode"), | ||
518 | _OMAP2430_MUXENTRY(UART1_TX, 9, | ||
519 | "uart1_tx", "sdi_den", "dss_data20", "gpio_9", | ||
520 | "mcbsp5_dx", NULL, NULL, "safe_mode"), | ||
521 | _OMAP2430_MUXENTRY(UART2_CTS, 67, | ||
522 | "uart2_cts", "usb1_rcv", "gpt9_pwm_evt", "gpio_67", | ||
523 | NULL, NULL, NULL, "safe_mode"), | ||
524 | _OMAP2430_MUXENTRY(UART2_RTS, 68, | ||
525 | "uart2_rts", "usb1_txen", "gpt10_pwm_evt", "gpio_68", | ||
526 | NULL, NULL, NULL, "safe_mode"), | ||
527 | _OMAP2430_MUXENTRY(UART2_RX, 70, | ||
528 | "uart2_rx", "usb1_dat", "gpt12_pwm_evt", "gpio_70", | ||
529 | NULL, NULL, NULL, "safe_mode"), | ||
530 | _OMAP2430_MUXENTRY(UART2_TX, 69, | ||
531 | "uart2_tx", "usb1_se0", "gpt11_pwm_evt", "gpio_69", | ||
532 | NULL, NULL, NULL, "safe_mode"), | ||
533 | _OMAP2430_MUXENTRY(UART3_CTS_RCTX, 102, | ||
534 | "uart3_cts_rctx", "uart3_rx_irrx", NULL, "gpio_102", | ||
535 | NULL, NULL, NULL, "safe_mode"), | ||
536 | _OMAP2430_MUXENTRY(UART3_RTS_SD, 103, | ||
537 | "uart3_rts_sd", "uart3_tx_irtx", NULL, "gpio_103", | ||
538 | NULL, NULL, NULL, "safe_mode"), | ||
539 | _OMAP2430_MUXENTRY(UART3_RX_IRRX, 105, | ||
540 | "uart3_rx_irrx", NULL, NULL, "gpio_105", | ||
541 | NULL, NULL, NULL, "safe_mode"), | ||
542 | _OMAP2430_MUXENTRY(UART3_TX_IRTX, 104, | ||
543 | "uart3_tx_irtx", "uart3_cts_rctx", NULL, "gpio_104", | ||
544 | NULL, NULL, NULL, "safe_mode"), | ||
545 | _OMAP2430_MUXENTRY(USB0HS_CLK, 120, | ||
546 | "usb0hs_clk", NULL, NULL, "gpio_120", | ||
547 | NULL, NULL, NULL, "safe_mode"), | ||
548 | _OMAP2430_MUXENTRY(USB0HS_DATA0, 0, | ||
549 | "usb0hs_data0", "uart3_tx_irtx", NULL, NULL, | ||
550 | "usb0_txen", NULL, NULL, "safe_mode"), | ||
551 | _OMAP2430_MUXENTRY(USB0HS_DATA1, 0, | ||
552 | "usb0hs_data1", "uart3_rx_irrx", NULL, NULL, | ||
553 | "usb0_dat", NULL, NULL, "safe_mode"), | ||
554 | _OMAP2430_MUXENTRY(USB0HS_DATA2, 0, | ||
555 | "usb0hs_data2", "uart3_rts_sd", NULL, NULL, | ||
556 | "usb0_se0", NULL, NULL, "safe_mode"), | ||
557 | _OMAP2430_MUXENTRY(USB0HS_DATA3, 106, | ||
558 | "usb0hs_data3", NULL, "uart3_cts_rctx", "gpio_106", | ||
559 | "usb0_puen", NULL, NULL, "safe_mode"), | ||
560 | _OMAP2430_MUXENTRY(USB0HS_DATA4, 107, | ||
561 | "usb0hs_data4", "mcbsp2_dr", NULL, "gpio_107", | ||
562 | "usb0_vp", NULL, NULL, "safe_mode"), | ||
563 | _OMAP2430_MUXENTRY(USB0HS_DATA5, 108, | ||
564 | "usb0hs_data5", "mcbsp2_dx", NULL, "gpio_108", | ||
565 | "usb0_vm", NULL, NULL, "safe_mode"), | ||
566 | _OMAP2430_MUXENTRY(USB0HS_DATA6, 109, | ||
567 | "usb0hs_data6", "mcbsp2_fsx", NULL, "gpio_109", | ||
568 | "usb0_rcv", NULL, NULL, "safe_mode"), | ||
569 | _OMAP2430_MUXENTRY(USB0HS_DATA7, 124, | ||
570 | "usb0hs_data7", "mcbsp2_clkx", NULL, "gpio_124", | ||
571 | NULL, NULL, NULL, "safe_mode"), | ||
572 | _OMAP2430_MUXENTRY(USB0HS_DIR, 121, | ||
573 | "usb0hs_dir", NULL, NULL, "gpio_121", | ||
574 | NULL, NULL, NULL, "safe_mode"), | ||
575 | _OMAP2430_MUXENTRY(USB0HS_NXT, 123, | ||
576 | "usb0hs_nxt", NULL, NULL, "gpio_123", | ||
577 | NULL, NULL, NULL, "safe_mode"), | ||
578 | _OMAP2430_MUXENTRY(USB0HS_STP, 122, | ||
579 | "usb0hs_stp", NULL, NULL, "gpio_122", | ||
580 | NULL, NULL, NULL, "safe_mode"), | ||
581 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
582 | }; | ||
583 | |||
584 | /* | ||
585 | * Balls for POP package | ||
586 | * 447-pin s-PBGA Package, 0.00mm Ball Pitch (Bottom) | ||
587 | */ | ||
588 | #ifdef CONFIG_DEBUG_FS | ||
589 | static struct omap_ball __initdata omap2430_pop_ball[] = { | ||
590 | _OMAP2430_BALLENTRY(CAM_D0, "t8", NULL), | ||
591 | _OMAP2430_BALLENTRY(CAM_D1, "t4", NULL), | ||
592 | _OMAP2430_BALLENTRY(CAM_D10, "r4", NULL), | ||
593 | _OMAP2430_BALLENTRY(CAM_D11, "w3", NULL), | ||
594 | _OMAP2430_BALLENTRY(CAM_D2, "r2", NULL), | ||
595 | _OMAP2430_BALLENTRY(CAM_D3, "u3", NULL), | ||
596 | _OMAP2430_BALLENTRY(CAM_D4, "u2", NULL), | ||
597 | _OMAP2430_BALLENTRY(CAM_D5, "v1", NULL), | ||
598 | _OMAP2430_BALLENTRY(CAM_D6, "t3", NULL), | ||
599 | _OMAP2430_BALLENTRY(CAM_D7, "r3", NULL), | ||
600 | _OMAP2430_BALLENTRY(CAM_D8, "u7", NULL), | ||
601 | _OMAP2430_BALLENTRY(CAM_D9, "t7", NULL), | ||
602 | _OMAP2430_BALLENTRY(CAM_HS, "p2", NULL), | ||
603 | _OMAP2430_BALLENTRY(CAM_LCLK, "r7", NULL), | ||
604 | _OMAP2430_BALLENTRY(CAM_VS, "n2", NULL), | ||
605 | _OMAP2430_BALLENTRY(CAM_XCLK, "p3", NULL), | ||
606 | _OMAP2430_BALLENTRY(DSS_ACBIAS, "y3", NULL), | ||
607 | _OMAP2430_BALLENTRY(DSS_DATA0, "v8", NULL), | ||
608 | _OMAP2430_BALLENTRY(DSS_DATA1, "w1", NULL), | ||
609 | _OMAP2430_BALLENTRY(DSS_DATA10, "k25", NULL), | ||
610 | _OMAP2430_BALLENTRY(DSS_DATA11, "j25", NULL), | ||
611 | _OMAP2430_BALLENTRY(DSS_DATA12, "k24", NULL), | ||
612 | _OMAP2430_BALLENTRY(DSS_DATA13, "j24", NULL), | ||
613 | _OMAP2430_BALLENTRY(DSS_DATA14, "h25", NULL), | ||
614 | _OMAP2430_BALLENTRY(DSS_DATA15, "g25", NULL), | ||
615 | _OMAP2430_BALLENTRY(DSS_DATA16, "ac3", NULL), | ||
616 | _OMAP2430_BALLENTRY(DSS_DATA17, "y7", NULL), | ||
617 | _OMAP2430_BALLENTRY(DSS_DATA2, "u8", NULL), | ||
618 | _OMAP2430_BALLENTRY(DSS_DATA3, "u4", NULL), | ||
619 | _OMAP2430_BALLENTRY(DSS_DATA4, "v3", NULL), | ||
620 | _OMAP2430_BALLENTRY(DSS_DATA5, "aa4", NULL), | ||
621 | _OMAP2430_BALLENTRY(DSS_DATA6, "w8", NULL), | ||
622 | _OMAP2430_BALLENTRY(DSS_DATA7, "y1", NULL), | ||
623 | _OMAP2430_BALLENTRY(DSS_DATA8, "aa2", NULL), | ||
624 | _OMAP2430_BALLENTRY(DSS_DATA9, "ab4", NULL), | ||
625 | _OMAP2430_BALLENTRY(DSS_HSYNC, "v2", NULL), | ||
626 | _OMAP2430_BALLENTRY(GPIO_113, "ad16", NULL), | ||
627 | _OMAP2430_BALLENTRY(GPIO_114, "ac10", NULL), | ||
628 | _OMAP2430_BALLENTRY(GPIO_115, "ad13", NULL), | ||
629 | _OMAP2430_BALLENTRY(GPIO_116, "ae15", NULL), | ||
630 | _OMAP2430_BALLENTRY(GPIO_128, "p1", NULL), | ||
631 | _OMAP2430_BALLENTRY(GPIO_129, "r1", NULL), | ||
632 | _OMAP2430_BALLENTRY(GPIO_130, "p7", NULL), | ||
633 | _OMAP2430_BALLENTRY(GPIO_131, "l8", NULL), | ||
634 | _OMAP2430_BALLENTRY(GPIO_132, "w24", NULL), | ||
635 | _OMAP2430_BALLENTRY(GPIO_133, "aa24", NULL), | ||
636 | _OMAP2430_BALLENTRY(GPIO_134, "ae12", NULL), | ||
637 | _OMAP2430_BALLENTRY(GPIO_135, "ae11", NULL), | ||
638 | _OMAP2430_BALLENTRY(GPIO_136, "ad12", NULL), | ||
639 | _OMAP2430_BALLENTRY(GPIO_137, "ad11", NULL), | ||
640 | _OMAP2430_BALLENTRY(GPIO_138, "y12", NULL), | ||
641 | _OMAP2430_BALLENTRY(GPIO_139, "ad17", NULL), | ||
642 | _OMAP2430_BALLENTRY(GPIO_140, "l7", NULL), | ||
643 | _OMAP2430_BALLENTRY(GPIO_141, "ac24", NULL), | ||
644 | _OMAP2430_BALLENTRY(GPIO_142, "m3", NULL), | ||
645 | _OMAP2430_BALLENTRY(GPIO_148, "af12", NULL), | ||
646 | _OMAP2430_BALLENTRY(GPIO_149, "k7", NULL), | ||
647 | _OMAP2430_BALLENTRY(GPIO_150, "m1", NULL), | ||
648 | _OMAP2430_BALLENTRY(GPIO_151, "ad14", NULL), | ||
649 | _OMAP2430_BALLENTRY(GPIO_152, "ad18", NULL), | ||
650 | _OMAP2430_BALLENTRY(GPIO_153, "u24", NULL), | ||
651 | _OMAP2430_BALLENTRY(GPIO_154, "ae16", NULL), | ||
652 | _OMAP2430_BALLENTRY(GPIO_63, "n3", NULL), | ||
653 | _OMAP2430_BALLENTRY(GPIO_7, "ac23", NULL), | ||
654 | _OMAP2430_BALLENTRY(GPIO_78, "ad10", NULL), | ||
655 | _OMAP2430_BALLENTRY(GPIO_79, "ae10", NULL), | ||
656 | _OMAP2430_BALLENTRY(GPIO_80, "ae13", NULL), | ||
657 | _OMAP2430_BALLENTRY(GPMC_A1, "a9", NULL), | ||
658 | _OMAP2430_BALLENTRY(GPMC_A10, "g12", NULL), | ||
659 | _OMAP2430_BALLENTRY(GPMC_A2, "b8", NULL), | ||
660 | _OMAP2430_BALLENTRY(GPMC_A3, "g10", NULL), | ||
661 | _OMAP2430_BALLENTRY(GPMC_A4, "g11", NULL), | ||
662 | _OMAP2430_BALLENTRY(GPMC_A5, "a10", NULL), | ||
663 | _OMAP2430_BALLENTRY(GPMC_A6, "g13", NULL), | ||
664 | _OMAP2430_BALLENTRY(GPMC_A7, "a6", NULL), | ||
665 | _OMAP2430_BALLENTRY(GPMC_A8, "h1", NULL), | ||
666 | _OMAP2430_BALLENTRY(GPMC_A9, "c8", NULL), | ||
667 | _OMAP2430_BALLENTRY(GPMC_CLK, "n1", "l1"), | ||
668 | _OMAP2430_BALLENTRY(GPMC_D10, "d1", "n1"), | ||
669 | _OMAP2430_BALLENTRY(GPMC_D11, "d2", "p2"), | ||
670 | _OMAP2430_BALLENTRY(GPMC_D12, "e1", "p1"), | ||
671 | _OMAP2430_BALLENTRY(GPMC_D13, "e3", "m1"), | ||
672 | _OMAP2430_BALLENTRY(GPMC_D14, "c7", "j2"), | ||
673 | _OMAP2430_BALLENTRY(GPMC_D15, "f3", "k2"), | ||
674 | _OMAP2430_BALLENTRY(GPMC_D8, "e2", "r1"), | ||
675 | _OMAP2430_BALLENTRY(GPMC_D9, "ab1", "t1"), | ||
676 | _OMAP2430_BALLENTRY(GPMC_NCS1, "ac1", "w1"), | ||
677 | _OMAP2430_BALLENTRY(GPMC_NCS2, "c6", NULL), | ||
678 | _OMAP2430_BALLENTRY(GPMC_NCS3, "b9", NULL), | ||
679 | _OMAP2430_BALLENTRY(GPMC_NCS4, "b4", NULL), | ||
680 | _OMAP2430_BALLENTRY(GPMC_NCS5, "a4", NULL), | ||
681 | _OMAP2430_BALLENTRY(GPMC_NCS6, "f1", NULL), | ||
682 | _OMAP2430_BALLENTRY(GPMC_NCS7, "a7", NULL), | ||
683 | _OMAP2430_BALLENTRY(GPMC_WAIT1, "j1", "y8"), | ||
684 | _OMAP2430_BALLENTRY(GPMC_WAIT2, "b7", NULL), | ||
685 | _OMAP2430_BALLENTRY(GPMC_WAIT3, "g14", NULL), | ||
686 | _OMAP2430_BALLENTRY(HDQ_SIO, "h20", NULL), | ||
687 | _OMAP2430_BALLENTRY(I2C1_SCL, "y17", NULL), | ||
688 | _OMAP2430_BALLENTRY(I2C1_SDA, "ac19", NULL), | ||
689 | _OMAP2430_BALLENTRY(I2C2_SCL, "n7", NULL), | ||
690 | _OMAP2430_BALLENTRY(I2C2_SDA, "m4", NULL), | ||
691 | _OMAP2430_BALLENTRY(JTAG_EMU0, "e25", NULL), | ||
692 | _OMAP2430_BALLENTRY(JTAG_EMU1, "e24", NULL), | ||
693 | _OMAP2430_BALLENTRY(MCBSP1_CLKR, "ab2", NULL), | ||
694 | _OMAP2430_BALLENTRY(MCBSP1_CLKX, "y9", NULL), | ||
695 | _OMAP2430_BALLENTRY(MCBSP1_DR, "af3", NULL), | ||
696 | _OMAP2430_BALLENTRY(MCBSP1_DX, "aa1", NULL), | ||
697 | _OMAP2430_BALLENTRY(MCBSP1_FSR, "ad5", NULL), | ||
698 | _OMAP2430_BALLENTRY(MCBSP1_FSX, "ab3", NULL), | ||
699 | _OMAP2430_BALLENTRY(MCBSP2_CLKX, "j26", NULL), | ||
700 | _OMAP2430_BALLENTRY(MCBSP2_DR, "k26", NULL), | ||
701 | _OMAP2430_BALLENTRY(MCBSP3_CLKX, "ac9", NULL), | ||
702 | _OMAP2430_BALLENTRY(MCBSP3_DR, "ae2", NULL), | ||
703 | _OMAP2430_BALLENTRY(MCBSP3_DX, "af4", NULL), | ||
704 | _OMAP2430_BALLENTRY(MCBSP3_FSX, "ae4", NULL), | ||
705 | _OMAP2430_BALLENTRY(MCBSP_CLKS, "ad6", NULL), | ||
706 | _OMAP2430_BALLENTRY(SDMMC1_CLKO, "n23", NULL), | ||
707 | _OMAP2430_BALLENTRY(SDMMC1_CMD, "l23", NULL), | ||
708 | _OMAP2430_BALLENTRY(SDMMC1_DAT0, "m24", NULL), | ||
709 | _OMAP2430_BALLENTRY(SDMMC1_DAT1, "p23", NULL), | ||
710 | _OMAP2430_BALLENTRY(SDMMC1_DAT2, "t20", NULL), | ||
711 | _OMAP2430_BALLENTRY(SDMMC1_DAT3, "r20", NULL), | ||
712 | _OMAP2430_BALLENTRY(SDMMC2_CLKO, "v26", NULL), | ||
713 | _OMAP2430_BALLENTRY(SDMMC2_CMD, "w20", NULL), | ||
714 | _OMAP2430_BALLENTRY(SDMMC2_DAT0, "v23", NULL), | ||
715 | _OMAP2430_BALLENTRY(SDMMC2_DAT1, "y24", NULL), | ||
716 | _OMAP2430_BALLENTRY(SDMMC2_DAT2, "v25", NULL), | ||
717 | _OMAP2430_BALLENTRY(SDMMC2_DAT3, "v24", NULL), | ||
718 | _OMAP2430_BALLENTRY(SDRC_A12, "w26", "r21"), | ||
719 | _OMAP2430_BALLENTRY(SDRC_A13, "af20", "aa15"), | ||
720 | _OMAP2430_BALLENTRY(SDRC_A14, "af16", "y12"), | ||
721 | _OMAP2430_BALLENTRY(SDRC_CKE1, "af15", "y13"), | ||
722 | _OMAP2430_BALLENTRY(SDRC_NCS1, "aa25", "t20"), | ||
723 | _OMAP2430_BALLENTRY(SPI1_CLK, "y18", NULL), | ||
724 | _OMAP2430_BALLENTRY(SPI1_CS0, "u1", NULL), | ||
725 | _OMAP2430_BALLENTRY(SPI1_CS1, "af19", NULL), | ||
726 | _OMAP2430_BALLENTRY(SPI1_CS2, "ae19", NULL), | ||
727 | _OMAP2430_BALLENTRY(SPI1_CS3, "h24", NULL), | ||
728 | _OMAP2430_BALLENTRY(SPI1_SIMO, "ad15", NULL), | ||
729 | _OMAP2430_BALLENTRY(SPI1_SOMI, "ae17", NULL), | ||
730 | _OMAP2430_BALLENTRY(SPI2_CLK, "y20", NULL), | ||
731 | _OMAP2430_BALLENTRY(SPI2_CS0, "y19", NULL), | ||
732 | _OMAP2430_BALLENTRY(SPI2_SIMO, "ac20", NULL), | ||
733 | _OMAP2430_BALLENTRY(SPI2_SOMI, "ad19", NULL), | ||
734 | _OMAP2430_BALLENTRY(SSI1_DAT_RX, "aa26", NULL), | ||
735 | _OMAP2430_BALLENTRY(SSI1_DAT_TX, "ad24", NULL), | ||
736 | _OMAP2430_BALLENTRY(SSI1_FLAG_RX, "ad23", NULL), | ||
737 | _OMAP2430_BALLENTRY(SSI1_FLAG_TX, "ab24", NULL), | ||
738 | _OMAP2430_BALLENTRY(SSI1_RDY_RX, "ab25", NULL), | ||
739 | _OMAP2430_BALLENTRY(SSI1_RDY_TX, "y25", NULL), | ||
740 | _OMAP2430_BALLENTRY(SSI1_WAKE, "ac25", NULL), | ||
741 | _OMAP2430_BALLENTRY(SYS_CLKOUT, "r25", NULL), | ||
742 | _OMAP2430_BALLENTRY(SYS_DRM_MSECURE, "ae3", NULL), | ||
743 | _OMAP2430_BALLENTRY(SYS_NIRQ0, "w25", NULL), | ||
744 | _OMAP2430_BALLENTRY(SYS_NIRQ1, "ad21", NULL), | ||
745 | _OMAP2430_BALLENTRY(UART1_CTS, "p24", NULL), | ||
746 | _OMAP2430_BALLENTRY(UART1_RTS, "p25", NULL), | ||
747 | _OMAP2430_BALLENTRY(UART1_RX, "n24", NULL), | ||
748 | _OMAP2430_BALLENTRY(UART1_TX, "r24", NULL), | ||
749 | _OMAP2430_BALLENTRY(UART2_CTS, "u25", NULL), | ||
750 | _OMAP2430_BALLENTRY(UART2_RTS, "t23", NULL), | ||
751 | _OMAP2430_BALLENTRY(UART2_RX, "t24", NULL), | ||
752 | _OMAP2430_BALLENTRY(UART2_TX, "u20", NULL), | ||
753 | _OMAP2430_BALLENTRY(UART3_CTS_RCTX, "m2", NULL), | ||
754 | _OMAP2430_BALLENTRY(UART3_RTS_SD, "k2", NULL), | ||
755 | _OMAP2430_BALLENTRY(UART3_RX_IRRX, "l3", NULL), | ||
756 | _OMAP2430_BALLENTRY(UART3_TX_IRTX, "l2", NULL), | ||
757 | _OMAP2430_BALLENTRY(USB0HS_CLK, "ae8", NULL), | ||
758 | _OMAP2430_BALLENTRY(USB0HS_DATA0, "ad4", NULL), | ||
759 | _OMAP2430_BALLENTRY(USB0HS_DATA1, "ae6", NULL), | ||
760 | _OMAP2430_BALLENTRY(USB0HS_DATA2, "af9", NULL), | ||
761 | _OMAP2430_BALLENTRY(USB0HS_DATA3, "ad9", NULL), | ||
762 | _OMAP2430_BALLENTRY(USB0HS_DATA4, "y11", NULL), | ||
763 | _OMAP2430_BALLENTRY(USB0HS_DATA5, "ad7", NULL), | ||
764 | _OMAP2430_BALLENTRY(USB0HS_DATA6, "ae7", NULL), | ||
765 | _OMAP2430_BALLENTRY(USB0HS_DATA7, "ac7", NULL), | ||
766 | _OMAP2430_BALLENTRY(USB0HS_DIR, "ad8", NULL), | ||
767 | _OMAP2430_BALLENTRY(USB0HS_NXT, "ae9", NULL), | ||
768 | _OMAP2430_BALLENTRY(USB0HS_STP, "ae5", NULL), | ||
769 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
770 | }; | ||
771 | #else | ||
772 | #define omap2430_pop_ball NULL | ||
773 | #endif | ||
774 | |||
775 | int __init omap2430_mux_init(struct omap_board_mux *board_subset, int flags) | ||
776 | { | ||
777 | struct omap_ball *package_balls = NULL; | ||
778 | |||
779 | switch (flags & OMAP_PACKAGE_MASK) { | ||
780 | case OMAP_PACKAGE_ZAC: | ||
781 | package_balls = omap2430_pop_ball; | ||
782 | break; | ||
783 | default: | ||
784 | pr_warning("%s: No ball data available for omap2420 package\n", | ||
785 | __func__); | ||
786 | } | ||
787 | |||
788 | return omap_mux_init("core", OMAP_MUX_REG_8BIT | OMAP_MUX_GPIO_IN_MODE3, | ||
789 | OMAP2430_CONTROL_PADCONF_MUX_PBASE, | ||
790 | OMAP2430_CONTROL_PADCONF_MUX_SIZE, | ||
791 | omap2430_muxmodes, NULL, board_subset, | ||
792 | package_balls); | ||
793 | } | ||
diff --git a/arch/arm/mach-omap2/mux2430.h b/arch/arm/mach-omap2/mux2430.h deleted file mode 100644 index 9fd93149ebd9..000000000000 --- a/arch/arm/mach-omap2/mux2430.h +++ /dev/null | |||
@@ -1,370 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Nokia | ||
3 | * Copyright (C) 2009 Texas Instruments | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #define OMAP2430_CONTROL_PADCONF_MUX_PBASE 0x49002030LU | ||
11 | |||
12 | #define OMAP2430_MUX(mode0, mux_value) \ | ||
13 | { \ | ||
14 | .reg_offset = (OMAP2430_CONTROL_PADCONF_##mode0##_OFFSET), \ | ||
15 | .value = (mux_value), \ | ||
16 | } | ||
17 | |||
18 | /* | ||
19 | * OMAP2430 CONTROL_PADCONF* register offsets for pin-muxing | ||
20 | * | ||
21 | * Extracted from the TRM. Add 0x49002030 to these values to get the | ||
22 | * absolute addresses. The name in the macro is the mode-0 name of | ||
23 | * the pin. NOTE: These registers are 8-bits wide. | ||
24 | * | ||
25 | * Note that these defines use SDMMC instead of MMC for compatibility | ||
26 | * with signal names used in 3630. | ||
27 | */ | ||
28 | #define OMAP2430_CONTROL_PADCONF_GPMC_CLK_OFFSET 0x000 | ||
29 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS0_OFFSET 0x001 | ||
30 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS1_OFFSET 0x002 | ||
31 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS2_OFFSET 0x003 | ||
32 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS3_OFFSET 0x004 | ||
33 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS4_OFFSET 0x005 | ||
34 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS5_OFFSET 0x006 | ||
35 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS6_OFFSET 0x007 | ||
36 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS7_OFFSET 0x008 | ||
37 | #define OMAP2430_CONTROL_PADCONF_GPMC_NADV_ALE_OFFSET 0x009 | ||
38 | #define OMAP2430_CONTROL_PADCONF_GPMC_NOE_NRE_OFFSET 0x00a | ||
39 | #define OMAP2430_CONTROL_PADCONF_GPMC_NWE_OFFSET 0x00b | ||
40 | #define OMAP2430_CONTROL_PADCONF_GPMC_NBE0_CLE_OFFSET 0x00c | ||
41 | #define OMAP2430_CONTROL_PADCONF_GPMC_NBE1_OFFSET 0x00d | ||
42 | #define OMAP2430_CONTROL_PADCONF_GPMC_NWP_OFFSET 0x00e | ||
43 | #define OMAP2430_CONTROL_PADCONF_GPMC_WAIT0_OFFSET 0x00f | ||
44 | #define OMAP2430_CONTROL_PADCONF_GPMC_WAIT1_OFFSET 0x010 | ||
45 | #define OMAP2430_CONTROL_PADCONF_GPMC_WAIT2_OFFSET 0x011 | ||
46 | #define OMAP2430_CONTROL_PADCONF_GPMC_WAIT3_OFFSET 0x012 | ||
47 | #define OMAP2430_CONTROL_PADCONF_SDRC_CLK_OFFSET 0x013 | ||
48 | #define OMAP2430_CONTROL_PADCONF_SDRC_NCLK_OFFSET 0x014 | ||
49 | #define OMAP2430_CONTROL_PADCONF_SDRC_NCS0_OFFSET 0x015 | ||
50 | #define OMAP2430_CONTROL_PADCONF_SDRC_NCS1_OFFSET 0x016 | ||
51 | #define OMAP2430_CONTROL_PADCONF_SDRC_CKE0_OFFSET 0x017 | ||
52 | #define OMAP2430_CONTROL_PADCONF_SDRC_CKE1_OFFSET 0x018 | ||
53 | #define OMAP2430_CONTROL_PADCONF_SDRC_NRAS_OFFSET 0x019 | ||
54 | #define OMAP2430_CONTROL_PADCONF_SDRC_NCAS_OFFSET 0x01a | ||
55 | #define OMAP2430_CONTROL_PADCONF_SDRC_NWE_OFFSET 0x01b | ||
56 | #define OMAP2430_CONTROL_PADCONF_SDRC_DM0_OFFSET 0x01c | ||
57 | #define OMAP2430_CONTROL_PADCONF_SDRC_DM1_OFFSET 0x01d | ||
58 | #define OMAP2430_CONTROL_PADCONF_SDRC_DM2_OFFSET 0x01e | ||
59 | #define OMAP2430_CONTROL_PADCONF_SDRC_DM3_OFFSET 0x01f | ||
60 | #define OMAP2430_CONTROL_PADCONF_SDRC_DQS0_OFFSET 0x020 | ||
61 | #define OMAP2430_CONTROL_PADCONF_SDRC_DQS1_OFFSET 0x021 | ||
62 | #define OMAP2430_CONTROL_PADCONF_SDRC_DQS2_OFFSET 0x022 | ||
63 | #define OMAP2430_CONTROL_PADCONF_SDRC_DQS3_OFFSET 0x023 | ||
64 | #define OMAP2430_CONTROL_PADCONF_SDRC_A14_OFFSET 0x024 | ||
65 | #define OMAP2430_CONTROL_PADCONF_SDRC_A13_OFFSET 0x025 | ||
66 | #define OMAP2430_CONTROL_PADCONF_SDRC_A12_OFFSET 0x026 | ||
67 | #define OMAP2430_CONTROL_PADCONF_SDRC_BA1_OFFSET 0x027 | ||
68 | #define OMAP2430_CONTROL_PADCONF_SDRC_BA0_OFFSET 0x028 | ||
69 | #define OMAP2430_CONTROL_PADCONF_SDRC_A11_OFFSET 0x029 | ||
70 | #define OMAP2430_CONTROL_PADCONF_SDRC_A10_OFFSET 0x02a | ||
71 | #define OMAP2430_CONTROL_PADCONF_SDRC_A9_OFFSET 0x02b | ||
72 | #define OMAP2430_CONTROL_PADCONF_SDRC_A8_OFFSET 0x02c | ||
73 | #define OMAP2430_CONTROL_PADCONF_SDRC_A7_OFFSET 0x02d | ||
74 | #define OMAP2430_CONTROL_PADCONF_SDRC_A6_OFFSET 0x02e | ||
75 | #define OMAP2430_CONTROL_PADCONF_SDRC_A5_OFFSET 0x02f | ||
76 | #define OMAP2430_CONTROL_PADCONF_SDRC_A4_OFFSET 0x030 | ||
77 | #define OMAP2430_CONTROL_PADCONF_SDRC_A3_OFFSET 0x031 | ||
78 | #define OMAP2430_CONTROL_PADCONF_SDRC_A2_OFFSET 0x032 | ||
79 | #define OMAP2430_CONTROL_PADCONF_SDRC_A1_OFFSET 0x033 | ||
80 | #define OMAP2430_CONTROL_PADCONF_SDRC_A0_OFFSET 0x034 | ||
81 | #define OMAP2430_CONTROL_PADCONF_SDRC_D31_OFFSET 0x035 | ||
82 | #define OMAP2430_CONTROL_PADCONF_SDRC_D30_OFFSET 0x036 | ||
83 | #define OMAP2430_CONTROL_PADCONF_SDRC_D29_OFFSET 0x037 | ||
84 | #define OMAP2430_CONTROL_PADCONF_SDRC_D28_OFFSET 0x038 | ||
85 | #define OMAP2430_CONTROL_PADCONF_SDRC_D27_OFFSET 0x039 | ||
86 | #define OMAP2430_CONTROL_PADCONF_SDRC_D26_OFFSET 0x03a | ||
87 | #define OMAP2430_CONTROL_PADCONF_SDRC_D25_OFFSET 0x03b | ||
88 | #define OMAP2430_CONTROL_PADCONF_SDRC_D24_OFFSET 0x03c | ||
89 | #define OMAP2430_CONTROL_PADCONF_SDRC_D23_OFFSET 0x03d | ||
90 | #define OMAP2430_CONTROL_PADCONF_SDRC_D22_OFFSET 0x03e | ||
91 | #define OMAP2430_CONTROL_PADCONF_SDRC_D21_OFFSET 0x03f | ||
92 | #define OMAP2430_CONTROL_PADCONF_SDRC_D20_OFFSET 0x040 | ||
93 | #define OMAP2430_CONTROL_PADCONF_SDRC_D19_OFFSET 0x041 | ||
94 | #define OMAP2430_CONTROL_PADCONF_SDRC_D18_OFFSET 0x042 | ||
95 | #define OMAP2430_CONTROL_PADCONF_SDRC_D17_OFFSET 0x043 | ||
96 | #define OMAP2430_CONTROL_PADCONF_SDRC_D16_OFFSET 0x044 | ||
97 | #define OMAP2430_CONTROL_PADCONF_SDRC_D15_OFFSET 0x045 | ||
98 | #define OMAP2430_CONTROL_PADCONF_SDRC_D14_OFFSET 0x046 | ||
99 | #define OMAP2430_CONTROL_PADCONF_SDRC_D13_OFFSET 0x047 | ||
100 | #define OMAP2430_CONTROL_PADCONF_SDRC_D12_OFFSET 0x048 | ||
101 | #define OMAP2430_CONTROL_PADCONF_SDRC_D11_OFFSET 0x049 | ||
102 | #define OMAP2430_CONTROL_PADCONF_SDRC_D10_OFFSET 0x04a | ||
103 | #define OMAP2430_CONTROL_PADCONF_SDRC_D9_OFFSET 0x04b | ||
104 | #define OMAP2430_CONTROL_PADCONF_SDRC_D8_OFFSET 0x04c | ||
105 | #define OMAP2430_CONTROL_PADCONF_SDRC_D7_OFFSET 0x04d | ||
106 | #define OMAP2430_CONTROL_PADCONF_SDRC_D6_OFFSET 0x04e | ||
107 | #define OMAP2430_CONTROL_PADCONF_SDRC_D5_OFFSET 0x04f | ||
108 | #define OMAP2430_CONTROL_PADCONF_SDRC_D4_OFFSET 0x050 | ||
109 | #define OMAP2430_CONTROL_PADCONF_SDRC_D3_OFFSET 0x051 | ||
110 | #define OMAP2430_CONTROL_PADCONF_SDRC_D2_OFFSET 0x052 | ||
111 | #define OMAP2430_CONTROL_PADCONF_SDRC_D1_OFFSET 0x053 | ||
112 | #define OMAP2430_CONTROL_PADCONF_SDRC_D0_OFFSET 0x054 | ||
113 | #define OMAP2430_CONTROL_PADCONF_GPMC_A10_OFFSET 0x055 | ||
114 | #define OMAP2430_CONTROL_PADCONF_GPMC_A9_OFFSET 0x056 | ||
115 | #define OMAP2430_CONTROL_PADCONF_GPMC_A8_OFFSET 0x057 | ||
116 | #define OMAP2430_CONTROL_PADCONF_GPMC_A7_OFFSET 0x058 | ||
117 | #define OMAP2430_CONTROL_PADCONF_GPMC_A6_OFFSET 0x059 | ||
118 | #define OMAP2430_CONTROL_PADCONF_GPMC_A5_OFFSET 0x05a | ||
119 | #define OMAP2430_CONTROL_PADCONF_GPMC_A4_OFFSET 0x05b | ||
120 | #define OMAP2430_CONTROL_PADCONF_GPMC_A3_OFFSET 0x05c | ||
121 | #define OMAP2430_CONTROL_PADCONF_GPMC_A2_OFFSET 0x05d | ||
122 | #define OMAP2430_CONTROL_PADCONF_GPMC_A1_OFFSET 0x05e | ||
123 | #define OMAP2430_CONTROL_PADCONF_GPMC_D15_OFFSET 0x05f | ||
124 | #define OMAP2430_CONTROL_PADCONF_GPMC_D14_OFFSET 0x060 | ||
125 | #define OMAP2430_CONTROL_PADCONF_GPMC_D13_OFFSET 0x061 | ||
126 | #define OMAP2430_CONTROL_PADCONF_GPMC_D12_OFFSET 0x062 | ||
127 | #define OMAP2430_CONTROL_PADCONF_GPMC_D11_OFFSET 0x063 | ||
128 | #define OMAP2430_CONTROL_PADCONF_GPMC_D10_OFFSET 0x064 | ||
129 | #define OMAP2430_CONTROL_PADCONF_GPMC_D9_OFFSET 0x065 | ||
130 | #define OMAP2430_CONTROL_PADCONF_GPMC_D8_OFFSET 0x066 | ||
131 | #define OMAP2430_CONTROL_PADCONF_GPMC_D7_OFFSET 0x067 | ||
132 | #define OMAP2430_CONTROL_PADCONF_GPMC_D6_OFFSET 0x068 | ||
133 | #define OMAP2430_CONTROL_PADCONF_GPMC_D5_OFFSET 0x069 | ||
134 | #define OMAP2430_CONTROL_PADCONF_GPMC_D4_OFFSET 0x06a | ||
135 | #define OMAP2430_CONTROL_PADCONF_GPMC_D3_OFFSET 0x06b | ||
136 | #define OMAP2430_CONTROL_PADCONF_GPMC_D2_OFFSET 0x06c | ||
137 | #define OMAP2430_CONTROL_PADCONF_GPMC_D1_OFFSET 0x06d | ||
138 | #define OMAP2430_CONTROL_PADCONF_GPMC_D0_OFFSET 0x06e | ||
139 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA0_OFFSET 0x06f | ||
140 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA1_OFFSET 0x070 | ||
141 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA2_OFFSET 0x071 | ||
142 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA3_OFFSET 0x072 | ||
143 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA4_OFFSET 0x073 | ||
144 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA5_OFFSET 0x074 | ||
145 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA6_OFFSET 0x075 | ||
146 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA7_OFFSET 0x076 | ||
147 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA8_OFFSET 0x077 | ||
148 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA9_OFFSET 0x078 | ||
149 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA10_OFFSET 0x079 | ||
150 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA11_OFFSET 0x07a | ||
151 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA12_OFFSET 0x07b | ||
152 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA13_OFFSET 0x07c | ||
153 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA14_OFFSET 0x07d | ||
154 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA15_OFFSET 0x07e | ||
155 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA16_OFFSET 0x07f | ||
156 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA17_OFFSET 0x080 | ||
157 | #define OMAP2430_CONTROL_PADCONF_UART1_CTS_OFFSET 0x081 | ||
158 | #define OMAP2430_CONTROL_PADCONF_UART1_RTS_OFFSET 0x082 | ||
159 | #define OMAP2430_CONTROL_PADCONF_UART1_TX_OFFSET 0x083 | ||
160 | #define OMAP2430_CONTROL_PADCONF_UART1_RX_OFFSET 0x084 | ||
161 | #define OMAP2430_CONTROL_PADCONF_MCBSP2_DR_OFFSET 0x085 | ||
162 | #define OMAP2430_CONTROL_PADCONF_MCBSP2_CLKX_OFFSET 0x086 | ||
163 | #define OMAP2430_CONTROL_PADCONF_DSS_PCLK_OFFSET 0x087 | ||
164 | #define OMAP2430_CONTROL_PADCONF_DSS_VSYNC_OFFSET 0x088 | ||
165 | #define OMAP2430_CONTROL_PADCONF_DSS_HSYNC_OFFSET 0x089 | ||
166 | #define OMAP2430_CONTROL_PADCONF_DSS_ACBIAS_OFFSET 0x08a | ||
167 | #define OMAP2430_CONTROL_PADCONF_SYS_NRESPWRON_OFFSET 0x08b | ||
168 | #define OMAP2430_CONTROL_PADCONF_SYS_NRESWARM_OFFSET 0x08c | ||
169 | #define OMAP2430_CONTROL_PADCONF_SYS_NIRQ0_OFFSET 0x08d | ||
170 | #define OMAP2430_CONTROL_PADCONF_SYS_NIRQ1_OFFSET 0x08e | ||
171 | #define OMAP2430_CONTROL_PADCONF_SYS_VMODE_OFFSET 0x08f | ||
172 | #define OMAP2430_CONTROL_PADCONF_GPIO_128_OFFSET 0x090 | ||
173 | #define OMAP2430_CONTROL_PADCONF_GPIO_129_OFFSET 0x091 | ||
174 | #define OMAP2430_CONTROL_PADCONF_GPIO_130_OFFSET 0x092 | ||
175 | #define OMAP2430_CONTROL_PADCONF_GPIO_131_OFFSET 0x093 | ||
176 | #define OMAP2430_CONTROL_PADCONF_SYS_32K_OFFSET 0x094 | ||
177 | #define OMAP2430_CONTROL_PADCONF_SYS_XTALIN_OFFSET 0x095 | ||
178 | #define OMAP2430_CONTROL_PADCONF_SYS_XTALOUT_OFFSET 0x096 | ||
179 | #define OMAP2430_CONTROL_PADCONF_GPIO_132_OFFSET 0x097 | ||
180 | #define OMAP2430_CONTROL_PADCONF_SYS_CLKREQ_OFFSET 0x098 | ||
181 | #define OMAP2430_CONTROL_PADCONF_SYS_CLKOUT_OFFSET 0x099 | ||
182 | #define OMAP2430_CONTROL_PADCONF_GPIO_151_OFFSET 0x09a | ||
183 | #define OMAP2430_CONTROL_PADCONF_GPIO_133_OFFSET 0x09b | ||
184 | #define OMAP2430_CONTROL_PADCONF_JTAG_EMU1_OFFSET 0x09c | ||
185 | #define OMAP2430_CONTROL_PADCONF_JTAG_EMU0_OFFSET 0x09d | ||
186 | #define OMAP2430_CONTROL_PADCONF_JTAG_NTRST_OFFSET 0x09e | ||
187 | #define OMAP2430_CONTROL_PADCONF_JTAG_TCK_OFFSET 0x09f | ||
188 | #define OMAP2430_CONTROL_PADCONF_JTAG_RTCK_OFFSET 0x0a0 | ||
189 | #define OMAP2430_CONTROL_PADCONF_JTAG_TMS_OFFSET 0x0a1 | ||
190 | #define OMAP2430_CONTROL_PADCONF_JTAG_TDI_OFFSET 0x0a2 | ||
191 | #define OMAP2430_CONTROL_PADCONF_JTAG_TDO_OFFSET 0x0a3 | ||
192 | #define OMAP2430_CONTROL_PADCONF_CAM_D9_OFFSET 0x0a4 | ||
193 | #define OMAP2430_CONTROL_PADCONF_CAM_D8_OFFSET 0x0a5 | ||
194 | #define OMAP2430_CONTROL_PADCONF_CAM_D7_OFFSET 0x0a6 | ||
195 | #define OMAP2430_CONTROL_PADCONF_CAM_D6_OFFSET 0x0a7 | ||
196 | #define OMAP2430_CONTROL_PADCONF_CAM_D5_OFFSET 0x0a8 | ||
197 | #define OMAP2430_CONTROL_PADCONF_CAM_D4_OFFSET 0x0a9 | ||
198 | #define OMAP2430_CONTROL_PADCONF_CAM_D3_OFFSET 0x0aa | ||
199 | #define OMAP2430_CONTROL_PADCONF_CAM_D2_OFFSET 0x0ab | ||
200 | #define OMAP2430_CONTROL_PADCONF_CAM_D1_OFFSET 0x0ac | ||
201 | #define OMAP2430_CONTROL_PADCONF_CAM_D0_OFFSET 0x0ad | ||
202 | #define OMAP2430_CONTROL_PADCONF_CAM_HS_OFFSET 0x0ae | ||
203 | #define OMAP2430_CONTROL_PADCONF_CAM_VS_OFFSET 0x0af | ||
204 | #define OMAP2430_CONTROL_PADCONF_CAM_LCLK_OFFSET 0x0b0 | ||
205 | #define OMAP2430_CONTROL_PADCONF_CAM_XCLK_OFFSET 0x0b1 | ||
206 | #define OMAP2430_CONTROL_PADCONF_CAM_D11_OFFSET 0x0b2 | ||
207 | #define OMAP2430_CONTROL_PADCONF_CAM_D10_OFFSET 0x0b3 | ||
208 | #define OMAP2430_CONTROL_PADCONF_GPIO_134_OFFSET 0x0b4 | ||
209 | #define OMAP2430_CONTROL_PADCONF_GPIO_135_OFFSET 0x0b5 | ||
210 | #define OMAP2430_CONTROL_PADCONF_GPIO_136_OFFSET 0x0b6 | ||
211 | #define OMAP2430_CONTROL_PADCONF_GPIO_137_OFFSET 0x0b7 | ||
212 | #define OMAP2430_CONTROL_PADCONF_GPIO_138_OFFSET 0x0b8 | ||
213 | #define OMAP2430_CONTROL_PADCONF_GPIO_139_OFFSET 0x0b9 | ||
214 | #define OMAP2430_CONTROL_PADCONF_GPIO_140_OFFSET 0x0ba | ||
215 | #define OMAP2430_CONTROL_PADCONF_GPIO_141_OFFSET 0x0bb | ||
216 | #define OMAP2430_CONTROL_PADCONF_GPIO_142_OFFSET 0x0bc | ||
217 | #define OMAP2430_CONTROL_PADCONF_GPIO_154_OFFSET 0x0bd | ||
218 | #define OMAP2430_CONTROL_PADCONF_GPIO_148_OFFSET 0x0be | ||
219 | #define OMAP2430_CONTROL_PADCONF_GPIO_149_OFFSET 0x0bf | ||
220 | #define OMAP2430_CONTROL_PADCONF_GPIO_150_OFFSET 0x0c0 | ||
221 | #define OMAP2430_CONTROL_PADCONF_GPIO_152_OFFSET 0x0c1 | ||
222 | #define OMAP2430_CONTROL_PADCONF_GPIO_153_OFFSET 0x0c2 | ||
223 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_CLKO_OFFSET 0x0c3 | ||
224 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_CMD_OFFSET 0x0c4 | ||
225 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_DAT0_OFFSET 0x0c5 | ||
226 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_DAT1_OFFSET 0x0c6 | ||
227 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_DAT2_OFFSET 0x0c7 | ||
228 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_DAT3_OFFSET 0x0c8 | ||
229 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_CLKO_OFFSET 0x0c9 | ||
230 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_DAT3_OFFSET 0x0ca | ||
231 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_CMD_OFFSET 0x0cb | ||
232 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_DAT0_OFFSET 0x0cc | ||
233 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_DAT2_OFFSET 0x0cd | ||
234 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_DAT1_OFFSET 0x0ce | ||
235 | #define OMAP2430_CONTROL_PADCONF_UART2_CTS_OFFSET 0x0cf | ||
236 | #define OMAP2430_CONTROL_PADCONF_UART2_RTS_OFFSET 0x0d0 | ||
237 | #define OMAP2430_CONTROL_PADCONF_UART2_TX_OFFSET 0x0d1 | ||
238 | #define OMAP2430_CONTROL_PADCONF_UART2_RX_OFFSET 0x0d2 | ||
239 | #define OMAP2430_CONTROL_PADCONF_MCBSP3_CLKX_OFFSET 0x0d3 | ||
240 | #define OMAP2430_CONTROL_PADCONF_MCBSP3_FSX_OFFSET 0x0d4 | ||
241 | #define OMAP2430_CONTROL_PADCONF_MCBSP3_DR_OFFSET 0x0d5 | ||
242 | #define OMAP2430_CONTROL_PADCONF_MCBSP3_DX_OFFSET 0x0d6 | ||
243 | #define OMAP2430_CONTROL_PADCONF_SSI1_DAT_TX_OFFSET 0x0d7 | ||
244 | #define OMAP2430_CONTROL_PADCONF_SSI1_FLAG_TX_OFFSET 0x0d8 | ||
245 | #define OMAP2430_CONTROL_PADCONF_SSI1_RDY_TX_OFFSET 0x0d9 | ||
246 | #define OMAP2430_CONTROL_PADCONF_SSI1_DAT_RX_OFFSET 0x0da | ||
247 | #define OMAP2430_CONTROL_PADCONF_GPIO_63_OFFSET 0x0db | ||
248 | #define OMAP2430_CONTROL_PADCONF_SSI1_FLAG_RX_OFFSET 0x0dc | ||
249 | #define OMAP2430_CONTROL_PADCONF_SSI1_RDY_RX_OFFSET 0x0dd | ||
250 | #define OMAP2430_CONTROL_PADCONF_SSI1_WAKE_OFFSET 0x0de | ||
251 | #define OMAP2430_CONTROL_PADCONF_SPI1_CLK_OFFSET 0x0df | ||
252 | #define OMAP2430_CONTROL_PADCONF_SPI1_SIMO_OFFSET 0x0e0 | ||
253 | #define OMAP2430_CONTROL_PADCONF_SPI1_SOMI_OFFSET 0x0e1 | ||
254 | #define OMAP2430_CONTROL_PADCONF_SPI1_CS0_OFFSET 0x0e2 | ||
255 | #define OMAP2430_CONTROL_PADCONF_SPI1_CS1_OFFSET 0x0e3 | ||
256 | #define OMAP2430_CONTROL_PADCONF_SPI1_CS2_OFFSET 0x0e4 | ||
257 | #define OMAP2430_CONTROL_PADCONF_SPI1_CS3_OFFSET 0x0e5 | ||
258 | #define OMAP2430_CONTROL_PADCONF_SPI2_CLK_OFFSET 0x0e6 | ||
259 | #define OMAP2430_CONTROL_PADCONF_SPI2_SIMO_OFFSET 0x0e7 | ||
260 | #define OMAP2430_CONTROL_PADCONF_SPI2_SOMI_OFFSET 0x0e8 | ||
261 | #define OMAP2430_CONTROL_PADCONF_SPI2_CS0_OFFSET 0x0e9 | ||
262 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_CLKR_OFFSET 0x0ea | ||
263 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_FSR_OFFSET 0x0eb | ||
264 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_DX_OFFSET 0x0ec | ||
265 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_DR_OFFSET 0x0ed | ||
266 | #define OMAP2430_CONTROL_PADCONF_MCBSP_CLKS_OFFSET 0x0ee | ||
267 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_FSX_OFFSET 0x0ef | ||
268 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_CLKX_OFFSET 0x0f0 | ||
269 | #define OMAP2430_CONTROL_PADCONF_I2C1_SCL_OFFSET 0x0f1 | ||
270 | #define OMAP2430_CONTROL_PADCONF_I2C1_SDA_OFFSET 0x0f2 | ||
271 | #define OMAP2430_CONTROL_PADCONF_I2C2_SCL_OFFSET 0x0f3 | ||
272 | #define OMAP2430_CONTROL_PADCONF_I2C2_SDA_OFFSET 0x0f4 | ||
273 | #define OMAP2430_CONTROL_PADCONF_HDQ_SIO_OFFSET 0x0f5 | ||
274 | #define OMAP2430_CONTROL_PADCONF_UART3_CTS_RCTX_OFFSET 0x0f6 | ||
275 | #define OMAP2430_CONTROL_PADCONF_UART3_RTS_SD_OFFSET 0x0f7 | ||
276 | #define OMAP2430_CONTROL_PADCONF_UART3_TX_IRTX_OFFSET 0x0f8 | ||
277 | #define OMAP2430_CONTROL_PADCONF_UART3_RX_IRRX_OFFSET 0x0f9 | ||
278 | #define OMAP2430_CONTROL_PADCONF_GPIO_7_OFFSET 0x0fa | ||
279 | #define OMAP2430_CONTROL_PADCONF_GPIO_78_OFFSET 0x0fb | ||
280 | #define OMAP2430_CONTROL_PADCONF_GPIO_79_OFFSET 0x0fc | ||
281 | #define OMAP2430_CONTROL_PADCONF_GPIO_80_OFFSET 0x0fd | ||
282 | #define OMAP2430_CONTROL_PADCONF_GPIO_113_OFFSET 0x0fe | ||
283 | #define OMAP2430_CONTROL_PADCONF_GPIO_114_OFFSET 0x0ff | ||
284 | #define OMAP2430_CONTROL_PADCONF_GPIO_115_OFFSET 0x100 | ||
285 | #define OMAP2430_CONTROL_PADCONF_GPIO_116_OFFSET 0x101 | ||
286 | #define OMAP2430_CONTROL_PADCONF_SYS_DRM_MSECURE_OFFSET 0x102 | ||
287 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA3_OFFSET 0x103 | ||
288 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA4_OFFSET 0x104 | ||
289 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA5_OFFSET 0x105 | ||
290 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA6_OFFSET 0x106 | ||
291 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA2_OFFSET 0x107 | ||
292 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA0_OFFSET 0x108 | ||
293 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA1_OFFSET 0x109 | ||
294 | #define OMAP2430_CONTROL_PADCONF_USB0HS_CLK_OFFSET 0x10a | ||
295 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DIR_OFFSET 0x10b | ||
296 | #define OMAP2430_CONTROL_PADCONF_USB0HS_STP_OFFSET 0x10c | ||
297 | #define OMAP2430_CONTROL_PADCONF_USB0HS_NXT_OFFSET 0x10d | ||
298 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA7_OFFSET 0x10e | ||
299 | #define OMAP2430_CONTROL_PADCONF_TV_OUT_OFFSET 0x10f | ||
300 | #define OMAP2430_CONTROL_PADCONF_TV_VREF_OFFSET 0x110 | ||
301 | #define OMAP2430_CONTROL_PADCONF_TV_RSET_OFFSET 0x111 | ||
302 | #define OMAP2430_CONTROL_PADCONF_TV_VFB_OFFSET 0x112 | ||
303 | #define OMAP2430_CONTROL_PADCONF_TV_DACOUT_OFFSET 0x113 | ||
304 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD0_OFFSET 0x114 | ||
305 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD1_OFFSET 0x115 | ||
306 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD2_OFFSET 0x116 | ||
307 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD3_OFFSET 0x117 | ||
308 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD4_OFFSET 0x118 | ||
309 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD5_OFFSET 0x119 | ||
310 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD6_OFFSET 0x11a | ||
311 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD7_OFFSET 0x11b | ||
312 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD8_OFFSET 0x11c | ||
313 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD9_OFFSET 0x11d | ||
314 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD10_OFFSET 0x11e | ||
315 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD11_OFFSET 0x11f | ||
316 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD12_OFFSET 0x120 | ||
317 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD13_OFFSET 0x121 | ||
318 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD14_OFFSET 0x122 | ||
319 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD15_OFFSET 0x123 | ||
320 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD16_OFFSET 0x124 | ||
321 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD17_OFFSET 0x125 | ||
322 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD18_OFFSET 0x126 | ||
323 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD19_OFFSET 0x127 | ||
324 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD20_OFFSET 0x128 | ||
325 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD21_OFFSET 0x129 | ||
326 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD22_OFFSET 0x12a | ||
327 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD23_OFFSET 0x12b | ||
328 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD24_OFFSET 0x12c | ||
329 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD25_OFFSET 0x12d | ||
330 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD26_OFFSET 0x12e | ||
331 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD27_OFFSET 0x12f | ||
332 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD28_OFFSET 0x130 | ||
333 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD29_OFFSET 0x131 | ||
334 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD30_OFFSET 0x132 | ||
335 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD31_OFFSET 0x133 | ||
336 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD32_OFFSET 0x134 | ||
337 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD33_OFFSET 0x135 | ||
338 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD34_OFFSET 0x136 | ||
339 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD35_OFFSET 0x137 | ||
340 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD36_OFFSET 0x138 | ||
341 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD37_OFFSET 0x139 | ||
342 | #define OMAP2430_CONTROL_PADCONF_AD2DMWRITE_OFFSET 0x13a | ||
343 | #define OMAP2430_CONTROL_PADCONF_D2DCLK26MI_OFFSET 0x13b | ||
344 | #define OMAP2430_CONTROL_PADCONF_D2DNRESPWRON1_OFFSET 0x13c | ||
345 | #define OMAP2430_CONTROL_PADCONF_D2DNRESWARM_OFFSET 0x13d | ||
346 | #define OMAP2430_CONTROL_PADCONF_D2DARM9NIRQ_OFFSET 0x13e | ||
347 | #define OMAP2430_CONTROL_PADCONF_D2DUMA2P6FIQ_OFFSET 0x13f | ||
348 | #define OMAP2430_CONTROL_PADCONF_D2DSPINT_OFFSET 0x140 | ||
349 | #define OMAP2430_CONTROL_PADCONF_D2DFRINT_OFFSET 0x141 | ||
350 | #define OMAP2430_CONTROL_PADCONF_D2DDMAREQ0_OFFSET 0x142 | ||
351 | #define OMAP2430_CONTROL_PADCONF_D2DDMAREQ1_OFFSET 0x143 | ||
352 | #define OMAP2430_CONTROL_PADCONF_D2DDMAREQ2_OFFSET 0x144 | ||
353 | #define OMAP2430_CONTROL_PADCONF_D2DDMAREQ3_OFFSET 0x145 | ||
354 | #define OMAP2430_CONTROL_PADCONF_D2DN3GTRST_OFFSET 0x146 | ||
355 | #define OMAP2430_CONTROL_PADCONF_D2DN3GTDI_OFFSET 0x147 | ||
356 | #define OMAP2430_CONTROL_PADCONF_D2DN3GTDO_OFFSET 0x148 | ||
357 | #define OMAP2430_CONTROL_PADCONF_D2DN3GTMS_OFFSET 0x149 | ||
358 | #define OMAP2430_CONTROL_PADCONF_D2DN3GTCK_OFFSET 0x14a | ||
359 | #define OMAP2430_CONTROL_PADCONF_D2DN3GRTCK_OFFSET 0x14b | ||
360 | #define OMAP2430_CONTROL_PADCONF_D2DMSTDBY_OFFSET 0x14c | ||
361 | #define OMAP2430_CONTROL_PADCONF_AD2DSREAD_OFFSET 0x14d | ||
362 | #define OMAP2430_CONTROL_PADCONF_D2DSWAKEUP_OFFSET 0x14e | ||
363 | #define OMAP2430_CONTROL_PADCONF_D2DIDLEREQ_OFFSET 0x14f | ||
364 | #define OMAP2430_CONTROL_PADCONF_D2DIDLEACK_OFFSET 0x150 | ||
365 | #define OMAP2430_CONTROL_PADCONF_D2DSPARE0_OFFSET 0x151 | ||
366 | #define OMAP2430_CONTROL_PADCONF_AD2DSWRITE_OFFSET 0x152 | ||
367 | #define OMAP2430_CONTROL_PADCONF_AD2DMREAD_OFFSET 0x153 | ||
368 | |||
369 | #define OMAP2430_CONTROL_PADCONF_MUX_SIZE \ | ||
370 | (OMAP2430_CONTROL_PADCONF_AD2DMREAD_OFFSET + 0x1) | ||
diff --git a/arch/arm/mach-omap2/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h index 8cc7d331437d..3e97c6c8ecf1 100644 --- a/arch/arm/mach-omap2/omap-secure.h +++ b/arch/arm/mach-omap2/omap-secure.h | |||
@@ -76,6 +76,13 @@ static inline void omap_barrier_reserve_memblock(void) | |||
76 | { } | 76 | { } |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #ifdef CONFIG_SOC_HAS_REALTIME_COUNTER | ||
79 | void set_cntfreq(void); | 80 | void set_cntfreq(void); |
81 | #else | ||
82 | static inline void set_cntfreq(void) | ||
83 | { | ||
84 | } | ||
85 | #endif | ||
86 | |||
80 | #endif /* __ASSEMBLER__ */ | 87 | #endif /* __ASSEMBLER__ */ |
81 | #endif /* OMAP_ARCH_OMAP_SECURE_H */ | 88 | #endif /* OMAP_ARCH_OMAP_SECURE_H */ |
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index 57911430324e..b39efd46abf9 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include "iomap.h" | 35 | #include "iomap.h" |
36 | #include "common.h" | 36 | #include "common.h" |
37 | #include "mmc.h" | 37 | #include "mmc.h" |
38 | #include "hsmmc.h" | ||
39 | #include "prminst44xx.h" | 38 | #include "prminst44xx.h" |
40 | #include "prcm_mpu44xx.h" | 39 | #include "prcm_mpu44xx.h" |
41 | #include "omap4-sar-layout.h" | 40 | #include "omap4-sar-layout.h" |
@@ -284,59 +283,3 @@ skip_errata_init: | |||
284 | omap_wakeupgen_init(); | 283 | omap_wakeupgen_init(); |
285 | irqchip_init(); | 284 | irqchip_init(); |
286 | } | 285 | } |
287 | |||
288 | #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) | ||
289 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | ||
290 | { | ||
291 | int irq = 0; | ||
292 | struct platform_device *pdev = container_of(dev, | ||
293 | struct platform_device, dev); | ||
294 | struct omap_mmc_platform_data *pdata = dev->platform_data; | ||
295 | |||
296 | /* Setting MMC1 Card detect Irq */ | ||
297 | if (pdev->id == 0) { | ||
298 | irq = twl6030_mmc_card_detect_config(); | ||
299 | if (irq < 0) { | ||
300 | dev_err(dev, "%s: Error card detect config(%d)\n", | ||
301 | __func__, irq); | ||
302 | return irq; | ||
303 | } | ||
304 | pdata->slots[0].card_detect_irq = irq; | ||
305 | pdata->slots[0].card_detect = twl6030_mmc_card_detect; | ||
306 | } | ||
307 | return 0; | ||
308 | } | ||
309 | |||
310 | static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) | ||
311 | { | ||
312 | struct omap_mmc_platform_data *pdata; | ||
313 | |||
314 | /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ | ||
315 | if (!dev) { | ||
316 | pr_err("Failed %s\n", __func__); | ||
317 | return; | ||
318 | } | ||
319 | pdata = dev->platform_data; | ||
320 | pdata->init = omap4_twl6030_hsmmc_late_init; | ||
321 | } | ||
322 | |||
323 | int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
324 | { | ||
325 | struct omap2_hsmmc_info *c; | ||
326 | |||
327 | omap_hsmmc_init(controllers); | ||
328 | for (c = controllers; c->mmc; c++) { | ||
329 | /* pdev can be null if CONFIG_MMC_OMAP_HS is not set */ | ||
330 | if (!c->pdev) | ||
331 | continue; | ||
332 | omap4_twl6030_hsmmc_set_late_init(&c->pdev->dev); | ||
333 | } | ||
334 | |||
335 | return 0; | ||
336 | } | ||
337 | #else | ||
338 | int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
339 | { | ||
340 | return 0; | ||
341 | } | ||
342 | #endif | ||
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index 53f0735817bb..828f538b1c4e 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/of.h> | 36 | #include <linux/of.h> |
37 | #include <linux/notifier.h> | 37 | #include <linux/notifier.h> |
38 | 38 | ||
39 | #include "common.h" | ||
39 | #include "soc.h" | 40 | #include "soc.h" |
40 | #include "omap_device.h" | 41 | #include "omap_device.h" |
41 | #include "omap_hwmod.h" | 42 | #include "omap_hwmod.h" |
@@ -200,6 +201,7 @@ static int _omap_device_notifier_call(struct notifier_block *nb, | |||
200 | case BUS_NOTIFY_ADD_DEVICE: | 201 | case BUS_NOTIFY_ADD_DEVICE: |
201 | if (pdev->dev.of_node) | 202 | if (pdev->dev.of_node) |
202 | omap_device_build_from_dt(pdev); | 203 | omap_device_build_from_dt(pdev); |
204 | omap_auxdata_legacy_init(dev); | ||
203 | /* fall through */ | 205 | /* fall through */ |
204 | default: | 206 | default: |
205 | od = to_omap_device(pdev); | 207 | od = to_omap_device(pdev); |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index e3f0ecaf87dd..ee655dab672f 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -2326,38 +2326,80 @@ static int _shutdown(struct omap_hwmod *oh) | |||
2326 | return 0; | 2326 | return 0; |
2327 | } | 2327 | } |
2328 | 2328 | ||
2329 | static int of_dev_find_hwmod(struct device_node *np, | ||
2330 | struct omap_hwmod *oh) | ||
2331 | { | ||
2332 | int count, i, res; | ||
2333 | const char *p; | ||
2334 | |||
2335 | count = of_property_count_strings(np, "ti,hwmods"); | ||
2336 | if (count < 1) | ||
2337 | return -ENODEV; | ||
2338 | |||
2339 | for (i = 0; i < count; i++) { | ||
2340 | res = of_property_read_string_index(np, "ti,hwmods", | ||
2341 | i, &p); | ||
2342 | if (res) | ||
2343 | continue; | ||
2344 | if (!strcmp(p, oh->name)) { | ||
2345 | pr_debug("omap_hwmod: dt %s[%i] uses hwmod %s\n", | ||
2346 | np->name, i, oh->name); | ||
2347 | return i; | ||
2348 | } | ||
2349 | } | ||
2350 | |||
2351 | return -ENODEV; | ||
2352 | } | ||
2353 | |||
2329 | /** | 2354 | /** |
2330 | * of_dev_hwmod_lookup - look up needed hwmod from dt blob | 2355 | * of_dev_hwmod_lookup - look up needed hwmod from dt blob |
2331 | * @np: struct device_node * | 2356 | * @np: struct device_node * |
2332 | * @oh: struct omap_hwmod * | 2357 | * @oh: struct omap_hwmod * |
2358 | * @index: index of the entry found | ||
2359 | * @found: struct device_node * found or NULL | ||
2333 | * | 2360 | * |
2334 | * Parse the dt blob and find out needed hwmod. Recursive function is | 2361 | * Parse the dt blob and find out needed hwmod. Recursive function is |
2335 | * implemented to take care hierarchical dt blob parsing. | 2362 | * implemented to take care hierarchical dt blob parsing. |
2336 | * Return: The device node on success or NULL on failure. | 2363 | * Return: Returns 0 on success, -ENODEV when not found. |
2337 | */ | 2364 | */ |
2338 | static struct device_node *of_dev_hwmod_lookup(struct device_node *np, | 2365 | static int of_dev_hwmod_lookup(struct device_node *np, |
2339 | struct omap_hwmod *oh) | 2366 | struct omap_hwmod *oh, |
2367 | int *index, | ||
2368 | struct device_node **found) | ||
2340 | { | 2369 | { |
2341 | struct device_node *np0 = NULL, *np1 = NULL; | 2370 | struct device_node *np0 = NULL; |
2342 | const char *p; | 2371 | int res; |
2372 | |||
2373 | res = of_dev_find_hwmod(np, oh); | ||
2374 | if (res >= 0) { | ||
2375 | *found = np; | ||
2376 | *index = res; | ||
2377 | return 0; | ||
2378 | } | ||
2343 | 2379 | ||
2344 | for_each_child_of_node(np, np0) { | 2380 | for_each_child_of_node(np, np0) { |
2345 | if (of_find_property(np0, "ti,hwmods", NULL)) { | 2381 | struct device_node *fc; |
2346 | p = of_get_property(np0, "ti,hwmods", NULL); | 2382 | int i; |
2347 | if (!strcmp(p, oh->name)) | 2383 | |
2348 | return np0; | 2384 | res = of_dev_hwmod_lookup(np0, oh, &i, &fc); |
2349 | np1 = of_dev_hwmod_lookup(np0, oh); | 2385 | if (res == 0) { |
2350 | if (np1) | 2386 | *found = fc; |
2351 | return np1; | 2387 | *index = i; |
2388 | return 0; | ||
2352 | } | 2389 | } |
2353 | } | 2390 | } |
2354 | return NULL; | 2391 | |
2392 | *found = NULL; | ||
2393 | *index = 0; | ||
2394 | |||
2395 | return -ENODEV; | ||
2355 | } | 2396 | } |
2356 | 2397 | ||
2357 | /** | 2398 | /** |
2358 | * _init_mpu_rt_base - populate the virtual address for a hwmod | 2399 | * _init_mpu_rt_base - populate the virtual address for a hwmod |
2359 | * @oh: struct omap_hwmod * to locate the virtual address | 2400 | * @oh: struct omap_hwmod * to locate the virtual address |
2360 | * @data: (unused, caller should pass NULL) | 2401 | * @data: (unused, caller should pass NULL) |
2402 | * @index: index of the reg entry iospace in device tree | ||
2361 | * @np: struct device_node * of the IP block's device node in the DT data | 2403 | * @np: struct device_node * of the IP block's device node in the DT data |
2362 | * | 2404 | * |
2363 | * Cache the virtual address used by the MPU to access this IP block's | 2405 | * Cache the virtual address used by the MPU to access this IP block's |
@@ -2368,7 +2410,7 @@ static struct device_node *of_dev_hwmod_lookup(struct device_node *np, | |||
2368 | * -ENXIO on absent or invalid register target address space. | 2410 | * -ENXIO on absent or invalid register target address space. |
2369 | */ | 2411 | */ |
2370 | static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data, | 2412 | static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data, |
2371 | struct device_node *np) | 2413 | int index, struct device_node *np) |
2372 | { | 2414 | { |
2373 | struct omap_hwmod_addr_space *mem; | 2415 | struct omap_hwmod_addr_space *mem; |
2374 | void __iomem *va_start = NULL; | 2416 | void __iomem *va_start = NULL; |
@@ -2390,13 +2432,17 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data, | |||
2390 | if (!np) | 2432 | if (!np) |
2391 | return -ENXIO; | 2433 | return -ENXIO; |
2392 | 2434 | ||
2393 | va_start = of_iomap(np, oh->mpu_rt_idx); | 2435 | va_start = of_iomap(np, index + oh->mpu_rt_idx); |
2394 | } else { | 2436 | } else { |
2395 | va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start); | 2437 | va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start); |
2396 | } | 2438 | } |
2397 | 2439 | ||
2398 | if (!va_start) { | 2440 | if (!va_start) { |
2399 | pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name); | 2441 | if (mem) |
2442 | pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name); | ||
2443 | else | ||
2444 | pr_err("omap_hwmod: %s: Missing dt reg%i for %s\n", | ||
2445 | oh->name, index, np->full_name); | ||
2400 | return -ENXIO; | 2446 | return -ENXIO; |
2401 | } | 2447 | } |
2402 | 2448 | ||
@@ -2422,17 +2468,29 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data, | |||
2422 | */ | 2468 | */ |
2423 | static int __init _init(struct omap_hwmod *oh, void *data) | 2469 | static int __init _init(struct omap_hwmod *oh, void *data) |
2424 | { | 2470 | { |
2425 | int r; | 2471 | int r, index; |
2426 | struct device_node *np = NULL; | 2472 | struct device_node *np = NULL; |
2427 | 2473 | ||
2428 | if (oh->_state != _HWMOD_STATE_REGISTERED) | 2474 | if (oh->_state != _HWMOD_STATE_REGISTERED) |
2429 | return 0; | 2475 | return 0; |
2430 | 2476 | ||
2431 | if (of_have_populated_dt()) | 2477 | if (of_have_populated_dt()) { |
2432 | np = of_dev_hwmod_lookup(of_find_node_by_name(NULL, "ocp"), oh); | 2478 | struct device_node *bus; |
2479 | |||
2480 | bus = of_find_node_by_name(NULL, "ocp"); | ||
2481 | if (!bus) | ||
2482 | return -ENODEV; | ||
2483 | |||
2484 | r = of_dev_hwmod_lookup(bus, oh, &index, &np); | ||
2485 | if (r) | ||
2486 | pr_debug("omap_hwmod: %s missing dt data\n", oh->name); | ||
2487 | else if (np && index) | ||
2488 | pr_warn("omap_hwmod: %s using broken dt data from %s\n", | ||
2489 | oh->name, np->name); | ||
2490 | } | ||
2433 | 2491 | ||
2434 | if (oh->class->sysc) { | 2492 | if (oh->class->sysc) { |
2435 | r = _init_mpu_rt_base(oh, NULL, np); | 2493 | r = _init_mpu_rt_base(oh, NULL, index, np); |
2436 | if (r < 0) { | 2494 | if (r < 0) { |
2437 | WARN(1, "omap_hwmod: %s: doesn't have mpu register target base\n", | 2495 | WARN(1, "omap_hwmod: %s: doesn't have mpu register target base\n", |
2438 | oh->name); | 2496 | oh->name); |
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c index d8b9d60f854f..2f15979c2e9c 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c | |||
@@ -108,8 +108,6 @@ static struct omap_i2c_dev_attr i2c_dev_attr = { | |||
108 | /* I2C1 */ | 108 | /* I2C1 */ |
109 | static struct omap_hwmod omap2420_i2c1_hwmod = { | 109 | static struct omap_hwmod omap2420_i2c1_hwmod = { |
110 | .name = "i2c1", | 110 | .name = "i2c1", |
111 | .mpu_irqs = omap2_i2c1_mpu_irqs, | ||
112 | .sdma_reqs = omap2_i2c1_sdma_reqs, | ||
113 | .main_clk = "i2c1_fck", | 111 | .main_clk = "i2c1_fck", |
114 | .prcm = { | 112 | .prcm = { |
115 | .omap2 = { | 113 | .omap2 = { |
@@ -133,8 +131,6 @@ static struct omap_hwmod omap2420_i2c1_hwmod = { | |||
133 | /* I2C2 */ | 131 | /* I2C2 */ |
134 | static struct omap_hwmod omap2420_i2c2_hwmod = { | 132 | static struct omap_hwmod omap2420_i2c2_hwmod = { |
135 | .name = "i2c2", | 133 | .name = "i2c2", |
136 | .mpu_irqs = omap2_i2c2_mpu_irqs, | ||
137 | .sdma_reqs = omap2_i2c2_sdma_reqs, | ||
138 | .main_clk = "i2c2_fck", | 134 | .main_clk = "i2c2_fck", |
139 | .prcm = { | 135 | .prcm = { |
140 | .omap2 = { | 136 | .omap2 = { |
@@ -179,16 +175,9 @@ static struct omap_mbox_pdata omap2420_mailbox_attrs = { | |||
179 | .info = omap2420_mailbox_info, | 175 | .info = omap2420_mailbox_info, |
180 | }; | 176 | }; |
181 | 177 | ||
182 | static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = { | ||
183 | { .name = "dsp", .irq = 26 + OMAP_INTC_START, }, | ||
184 | { .name = "iva", .irq = 34 + OMAP_INTC_START, }, | ||
185 | { .irq = -1 }, | ||
186 | }; | ||
187 | |||
188 | static struct omap_hwmod omap2420_mailbox_hwmod = { | 178 | static struct omap_hwmod omap2420_mailbox_hwmod = { |
189 | .name = "mailbox", | 179 | .name = "mailbox", |
190 | .class = &omap2xxx_mailbox_hwmod_class, | 180 | .class = &omap2xxx_mailbox_hwmod_class, |
191 | .mpu_irqs = omap2420_mailbox_irqs, | ||
192 | .main_clk = "mailboxes_ick", | 181 | .main_clk = "mailboxes_ick", |
193 | .prcm = { | 182 | .prcm = { |
194 | .omap2 = { | 183 | .omap2 = { |
@@ -217,17 +206,9 @@ static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = { | |||
217 | }; | 206 | }; |
218 | 207 | ||
219 | /* mcbsp1 */ | 208 | /* mcbsp1 */ |
220 | static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = { | ||
221 | { .name = "tx", .irq = 59 + OMAP_INTC_START, }, | ||
222 | { .name = "rx", .irq = 60 + OMAP_INTC_START, }, | ||
223 | { .irq = -1 }, | ||
224 | }; | ||
225 | |||
226 | static struct omap_hwmod omap2420_mcbsp1_hwmod = { | 209 | static struct omap_hwmod omap2420_mcbsp1_hwmod = { |
227 | .name = "mcbsp1", | 210 | .name = "mcbsp1", |
228 | .class = &omap2420_mcbsp_hwmod_class, | 211 | .class = &omap2420_mcbsp_hwmod_class, |
229 | .mpu_irqs = omap2420_mcbsp1_irqs, | ||
230 | .sdma_reqs = omap2_mcbsp1_sdma_reqs, | ||
231 | .main_clk = "mcbsp1_fck", | 212 | .main_clk = "mcbsp1_fck", |
232 | .prcm = { | 213 | .prcm = { |
233 | .omap2 = { | 214 | .omap2 = { |
@@ -243,17 +224,9 @@ static struct omap_hwmod omap2420_mcbsp1_hwmod = { | |||
243 | }; | 224 | }; |
244 | 225 | ||
245 | /* mcbsp2 */ | 226 | /* mcbsp2 */ |
246 | static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = { | ||
247 | { .name = "tx", .irq = 62 + OMAP_INTC_START, }, | ||
248 | { .name = "rx", .irq = 63 + OMAP_INTC_START, }, | ||
249 | { .irq = -1 }, | ||
250 | }; | ||
251 | |||
252 | static struct omap_hwmod omap2420_mcbsp2_hwmod = { | 227 | static struct omap_hwmod omap2420_mcbsp2_hwmod = { |
253 | .name = "mcbsp2", | 228 | .name = "mcbsp2", |
254 | .class = &omap2420_mcbsp_hwmod_class, | 229 | .class = &omap2420_mcbsp_hwmod_class, |
255 | .mpu_irqs = omap2420_mcbsp2_irqs, | ||
256 | .sdma_reqs = omap2_mcbsp2_sdma_reqs, | ||
257 | .main_clk = "mcbsp2_fck", | 230 | .main_clk = "mcbsp2_fck", |
258 | .prcm = { | 231 | .prcm = { |
259 | .omap2 = { | 232 | .omap2 = { |
@@ -283,22 +256,9 @@ static struct omap_hwmod_class omap2420_msdi_hwmod_class = { | |||
283 | }; | 256 | }; |
284 | 257 | ||
285 | /* msdi1 */ | 258 | /* msdi1 */ |
286 | static struct omap_hwmod_irq_info omap2420_msdi1_irqs[] = { | ||
287 | { .irq = 83 + OMAP_INTC_START, }, | ||
288 | { .irq = -1 }, | ||
289 | }; | ||
290 | |||
291 | static struct omap_hwmod_dma_info omap2420_msdi1_sdma_reqs[] = { | ||
292 | { .name = "tx", .dma_req = 61 }, /* OMAP24XX_DMA_MMC1_TX */ | ||
293 | { .name = "rx", .dma_req = 62 }, /* OMAP24XX_DMA_MMC1_RX */ | ||
294 | { .dma_req = -1 } | ||
295 | }; | ||
296 | |||
297 | static struct omap_hwmod omap2420_msdi1_hwmod = { | 259 | static struct omap_hwmod omap2420_msdi1_hwmod = { |
298 | .name = "msdi1", | 260 | .name = "msdi1", |
299 | .class = &omap2420_msdi_hwmod_class, | 261 | .class = &omap2420_msdi_hwmod_class, |
300 | .mpu_irqs = omap2420_msdi1_irqs, | ||
301 | .sdma_reqs = omap2420_msdi1_sdma_reqs, | ||
302 | .main_clk = "mmc_fck", | 262 | .main_clk = "mmc_fck", |
303 | .prcm = { | 263 | .prcm = { |
304 | .omap2 = { | 264 | .omap2 = { |
@@ -315,7 +275,6 @@ static struct omap_hwmod omap2420_msdi1_hwmod = { | |||
315 | /* HDQ1W/1-wire */ | 275 | /* HDQ1W/1-wire */ |
316 | static struct omap_hwmod omap2420_hdq1w_hwmod = { | 276 | static struct omap_hwmod omap2420_hdq1w_hwmod = { |
317 | .name = "hdq1w", | 277 | .name = "hdq1w", |
318 | .mpu_irqs = omap2_hdq1w_mpu_irqs, | ||
319 | .main_clk = "hdq_fck", | 278 | .main_clk = "hdq_fck", |
320 | .prcm = { | 279 | .prcm = { |
321 | .omap2 = { | 280 | .omap2 = { |
@@ -338,7 +297,6 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__i2c1 = { | |||
338 | .master = &omap2xxx_l4_core_hwmod, | 297 | .master = &omap2xxx_l4_core_hwmod, |
339 | .slave = &omap2420_i2c1_hwmod, | 298 | .slave = &omap2420_i2c1_hwmod, |
340 | .clk = "i2c1_ick", | 299 | .clk = "i2c1_ick", |
341 | .addr = omap2_i2c1_addr_space, | ||
342 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 300 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
343 | }; | 301 | }; |
344 | 302 | ||
@@ -347,7 +305,6 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__i2c2 = { | |||
347 | .master = &omap2xxx_l4_core_hwmod, | 305 | .master = &omap2xxx_l4_core_hwmod, |
348 | .slave = &omap2420_i2c2_hwmod, | 306 | .slave = &omap2420_i2c2_hwmod, |
349 | .clk = "i2c2_ick", | 307 | .clk = "i2c2_ick", |
350 | .addr = omap2_i2c2_addr_space, | ||
351 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 308 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
352 | }; | 309 | }; |
353 | 310 | ||
@@ -367,111 +324,51 @@ static struct omap_hwmod_ocp_if omap2420_l3__dsp = { | |||
367 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 324 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
368 | }; | 325 | }; |
369 | 326 | ||
370 | static struct omap_hwmod_addr_space omap2420_timer1_addrs[] = { | ||
371 | { | ||
372 | .pa_start = 0x48028000, | ||
373 | .pa_end = 0x48028000 + SZ_1K - 1, | ||
374 | .flags = ADDR_TYPE_RT | ||
375 | }, | ||
376 | { } | ||
377 | }; | ||
378 | |||
379 | /* l4_wkup -> timer1 */ | 327 | /* l4_wkup -> timer1 */ |
380 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__timer1 = { | 328 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__timer1 = { |
381 | .master = &omap2xxx_l4_wkup_hwmod, | 329 | .master = &omap2xxx_l4_wkup_hwmod, |
382 | .slave = &omap2xxx_timer1_hwmod, | 330 | .slave = &omap2xxx_timer1_hwmod, |
383 | .clk = "gpt1_ick", | 331 | .clk = "gpt1_ick", |
384 | .addr = omap2420_timer1_addrs, | ||
385 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 332 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
386 | }; | 333 | }; |
387 | 334 | ||
388 | /* l4_wkup -> wd_timer2 */ | 335 | /* l4_wkup -> wd_timer2 */ |
389 | static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = { | ||
390 | { | ||
391 | .pa_start = 0x48022000, | ||
392 | .pa_end = 0x4802207f, | ||
393 | .flags = ADDR_TYPE_RT | ||
394 | }, | ||
395 | { } | ||
396 | }; | ||
397 | |||
398 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__wd_timer2 = { | 336 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__wd_timer2 = { |
399 | .master = &omap2xxx_l4_wkup_hwmod, | 337 | .master = &omap2xxx_l4_wkup_hwmod, |
400 | .slave = &omap2xxx_wd_timer2_hwmod, | 338 | .slave = &omap2xxx_wd_timer2_hwmod, |
401 | .clk = "mpu_wdt_ick", | 339 | .clk = "mpu_wdt_ick", |
402 | .addr = omap2420_wd_timer2_addrs, | ||
403 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 340 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
404 | }; | 341 | }; |
405 | 342 | ||
406 | /* l4_wkup -> gpio1 */ | 343 | /* l4_wkup -> gpio1 */ |
407 | static struct omap_hwmod_addr_space omap2420_gpio1_addr_space[] = { | ||
408 | { | ||
409 | .pa_start = 0x48018000, | ||
410 | .pa_end = 0x480181ff, | ||
411 | .flags = ADDR_TYPE_RT | ||
412 | }, | ||
413 | { } | ||
414 | }; | ||
415 | |||
416 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio1 = { | 344 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio1 = { |
417 | .master = &omap2xxx_l4_wkup_hwmod, | 345 | .master = &omap2xxx_l4_wkup_hwmod, |
418 | .slave = &omap2xxx_gpio1_hwmod, | 346 | .slave = &omap2xxx_gpio1_hwmod, |
419 | .clk = "gpios_ick", | 347 | .clk = "gpios_ick", |
420 | .addr = omap2420_gpio1_addr_space, | ||
421 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 348 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
422 | }; | 349 | }; |
423 | 350 | ||
424 | /* l4_wkup -> gpio2 */ | 351 | /* l4_wkup -> gpio2 */ |
425 | static struct omap_hwmod_addr_space omap2420_gpio2_addr_space[] = { | ||
426 | { | ||
427 | .pa_start = 0x4801a000, | ||
428 | .pa_end = 0x4801a1ff, | ||
429 | .flags = ADDR_TYPE_RT | ||
430 | }, | ||
431 | { } | ||
432 | }; | ||
433 | |||
434 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio2 = { | 352 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio2 = { |
435 | .master = &omap2xxx_l4_wkup_hwmod, | 353 | .master = &omap2xxx_l4_wkup_hwmod, |
436 | .slave = &omap2xxx_gpio2_hwmod, | 354 | .slave = &omap2xxx_gpio2_hwmod, |
437 | .clk = "gpios_ick", | 355 | .clk = "gpios_ick", |
438 | .addr = omap2420_gpio2_addr_space, | ||
439 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 356 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
440 | }; | 357 | }; |
441 | 358 | ||
442 | /* l4_wkup -> gpio3 */ | 359 | /* l4_wkup -> gpio3 */ |
443 | static struct omap_hwmod_addr_space omap2420_gpio3_addr_space[] = { | ||
444 | { | ||
445 | .pa_start = 0x4801c000, | ||
446 | .pa_end = 0x4801c1ff, | ||
447 | .flags = ADDR_TYPE_RT | ||
448 | }, | ||
449 | { } | ||
450 | }; | ||
451 | |||
452 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio3 = { | 360 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio3 = { |
453 | .master = &omap2xxx_l4_wkup_hwmod, | 361 | .master = &omap2xxx_l4_wkup_hwmod, |
454 | .slave = &omap2xxx_gpio3_hwmod, | 362 | .slave = &omap2xxx_gpio3_hwmod, |
455 | .clk = "gpios_ick", | 363 | .clk = "gpios_ick", |
456 | .addr = omap2420_gpio3_addr_space, | ||
457 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 364 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
458 | }; | 365 | }; |
459 | 366 | ||
460 | /* l4_wkup -> gpio4 */ | 367 | /* l4_wkup -> gpio4 */ |
461 | static struct omap_hwmod_addr_space omap2420_gpio4_addr_space[] = { | ||
462 | { | ||
463 | .pa_start = 0x4801e000, | ||
464 | .pa_end = 0x4801e1ff, | ||
465 | .flags = ADDR_TYPE_RT | ||
466 | }, | ||
467 | { } | ||
468 | }; | ||
469 | |||
470 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = { | 368 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = { |
471 | .master = &omap2xxx_l4_wkup_hwmod, | 369 | .master = &omap2xxx_l4_wkup_hwmod, |
472 | .slave = &omap2xxx_gpio4_hwmod, | 370 | .slave = &omap2xxx_gpio4_hwmod, |
473 | .clk = "gpios_ick", | 371 | .clk = "gpios_ick", |
474 | .addr = omap2420_gpio4_addr_space, | ||
475 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 372 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
476 | }; | 373 | }; |
477 | 374 | ||
@@ -496,7 +393,6 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__dma_system = { | |||
496 | static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = { | 393 | static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = { |
497 | .master = &omap2xxx_l4_core_hwmod, | 394 | .master = &omap2xxx_l4_core_hwmod, |
498 | .slave = &omap2420_mailbox_hwmod, | 395 | .slave = &omap2420_mailbox_hwmod, |
499 | .addr = omap2_mailbox_addrs, | ||
500 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 396 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
501 | }; | 397 | }; |
502 | 398 | ||
@@ -505,7 +401,6 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp1 = { | |||
505 | .master = &omap2xxx_l4_core_hwmod, | 401 | .master = &omap2xxx_l4_core_hwmod, |
506 | .slave = &omap2420_mcbsp1_hwmod, | 402 | .slave = &omap2420_mcbsp1_hwmod, |
507 | .clk = "mcbsp1_ick", | 403 | .clk = "mcbsp1_ick", |
508 | .addr = omap2_mcbsp1_addrs, | ||
509 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 404 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
510 | }; | 405 | }; |
511 | 406 | ||
@@ -514,25 +409,14 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp2 = { | |||
514 | .master = &omap2xxx_l4_core_hwmod, | 409 | .master = &omap2xxx_l4_core_hwmod, |
515 | .slave = &omap2420_mcbsp2_hwmod, | 410 | .slave = &omap2420_mcbsp2_hwmod, |
516 | .clk = "mcbsp2_ick", | 411 | .clk = "mcbsp2_ick", |
517 | .addr = omap2xxx_mcbsp2_addrs, | ||
518 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 412 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
519 | }; | 413 | }; |
520 | 414 | ||
521 | static struct omap_hwmod_addr_space omap2420_msdi1_addrs[] = { | ||
522 | { | ||
523 | .pa_start = 0x4809c000, | ||
524 | .pa_end = 0x4809c000 + SZ_128 - 1, | ||
525 | .flags = ADDR_TYPE_RT, | ||
526 | }, | ||
527 | { } | ||
528 | }; | ||
529 | |||
530 | /* l4_core -> msdi1 */ | 415 | /* l4_core -> msdi1 */ |
531 | static struct omap_hwmod_ocp_if omap2420_l4_core__msdi1 = { | 416 | static struct omap_hwmod_ocp_if omap2420_l4_core__msdi1 = { |
532 | .master = &omap2xxx_l4_core_hwmod, | 417 | .master = &omap2xxx_l4_core_hwmod, |
533 | .slave = &omap2420_msdi1_hwmod, | 418 | .slave = &omap2420_msdi1_hwmod, |
534 | .clk = "mmc_ick", | 419 | .clk = "mmc_ick", |
535 | .addr = omap2420_msdi1_addrs, | ||
536 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 420 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
537 | }; | 421 | }; |
538 | 422 | ||
@@ -541,36 +425,16 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__hdq1w = { | |||
541 | .master = &omap2xxx_l4_core_hwmod, | 425 | .master = &omap2xxx_l4_core_hwmod, |
542 | .slave = &omap2420_hdq1w_hwmod, | 426 | .slave = &omap2420_hdq1w_hwmod, |
543 | .clk = "hdq_ick", | 427 | .clk = "hdq_ick", |
544 | .addr = omap2_hdq1w_addr_space, | ||
545 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 428 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
546 | .flags = OMAP_FIREWALL_L4 | OCPIF_SWSUP_IDLE, | 429 | .flags = OMAP_FIREWALL_L4 | OCPIF_SWSUP_IDLE, |
547 | }; | 430 | }; |
548 | 431 | ||
549 | 432 | ||
550 | /* l4_wkup -> 32ksync_counter */ | 433 | /* l4_wkup -> 32ksync_counter */ |
551 | static struct omap_hwmod_addr_space omap2420_counter_32k_addrs[] = { | ||
552 | { | ||
553 | .pa_start = 0x48004000, | ||
554 | .pa_end = 0x4800401f, | ||
555 | .flags = ADDR_TYPE_RT | ||
556 | }, | ||
557 | { } | ||
558 | }; | ||
559 | |||
560 | static struct omap_hwmod_addr_space omap2420_gpmc_addrs[] = { | ||
561 | { | ||
562 | .pa_start = 0x6800a000, | ||
563 | .pa_end = 0x6800afff, | ||
564 | .flags = ADDR_TYPE_RT | ||
565 | }, | ||
566 | { } | ||
567 | }; | ||
568 | |||
569 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__counter_32k = { | 434 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__counter_32k = { |
570 | .master = &omap2xxx_l4_wkup_hwmod, | 435 | .master = &omap2xxx_l4_wkup_hwmod, |
571 | .slave = &omap2xxx_counter_32k_hwmod, | 436 | .slave = &omap2xxx_counter_32k_hwmod, |
572 | .clk = "sync_32k_ick", | 437 | .clk = "sync_32k_ick", |
573 | .addr = omap2420_counter_32k_addrs, | ||
574 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 438 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
575 | }; | 439 | }; |
576 | 440 | ||
@@ -578,7 +442,6 @@ static struct omap_hwmod_ocp_if omap2420_l3__gpmc = { | |||
578 | .master = &omap2xxx_l3_main_hwmod, | 442 | .master = &omap2xxx_l3_main_hwmod, |
579 | .slave = &omap2xxx_gpmc_hwmod, | 443 | .slave = &omap2xxx_gpmc_hwmod, |
580 | .clk = "core_l3_ck", | 444 | .clk = "core_l3_ck", |
581 | .addr = omap2420_gpmc_addrs, | ||
582 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 445 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
583 | }; | 446 | }; |
584 | 447 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c index 5b9083461dc5..6d1b60902179 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c | |||
@@ -86,8 +86,6 @@ static struct omap_i2c_dev_attr i2c_dev_attr = { | |||
86 | static struct omap_hwmod omap2430_i2c1_hwmod = { | 86 | static struct omap_hwmod omap2430_i2c1_hwmod = { |
87 | .name = "i2c1", | 87 | .name = "i2c1", |
88 | .flags = HWMOD_16BIT_REG, | 88 | .flags = HWMOD_16BIT_REG, |
89 | .mpu_irqs = omap2_i2c1_mpu_irqs, | ||
90 | .sdma_reqs = omap2_i2c1_sdma_reqs, | ||
91 | .main_clk = "i2chs1_fck", | 89 | .main_clk = "i2chs1_fck", |
92 | .prcm = { | 90 | .prcm = { |
93 | .omap2 = { | 91 | .omap2 = { |
@@ -114,8 +112,6 @@ static struct omap_hwmod omap2430_i2c1_hwmod = { | |||
114 | static struct omap_hwmod omap2430_i2c2_hwmod = { | 112 | static struct omap_hwmod omap2430_i2c2_hwmod = { |
115 | .name = "i2c2", | 113 | .name = "i2c2", |
116 | .flags = HWMOD_16BIT_REG, | 114 | .flags = HWMOD_16BIT_REG, |
117 | .mpu_irqs = omap2_i2c2_mpu_irqs, | ||
118 | .sdma_reqs = omap2_i2c2_sdma_reqs, | ||
119 | .main_clk = "i2chs2_fck", | 115 | .main_clk = "i2chs2_fck", |
120 | .prcm = { | 116 | .prcm = { |
121 | .omap2 = { | 117 | .omap2 = { |
@@ -131,15 +127,9 @@ static struct omap_hwmod omap2430_i2c2_hwmod = { | |||
131 | }; | 127 | }; |
132 | 128 | ||
133 | /* gpio5 */ | 129 | /* gpio5 */ |
134 | static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = { | ||
135 | { .irq = 33 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK5 */ | ||
136 | { .irq = -1 }, | ||
137 | }; | ||
138 | |||
139 | static struct omap_hwmod omap2430_gpio5_hwmod = { | 130 | static struct omap_hwmod omap2430_gpio5_hwmod = { |
140 | .name = "gpio5", | 131 | .name = "gpio5", |
141 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | 132 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, |
142 | .mpu_irqs = omap243x_gpio5_irqs, | ||
143 | .main_clk = "gpio5_fck", | 133 | .main_clk = "gpio5_fck", |
144 | .prcm = { | 134 | .prcm = { |
145 | .omap2 = { | 135 | .omap2 = { |
@@ -182,15 +172,9 @@ static struct omap_mbox_pdata omap2430_mailbox_attrs = { | |||
182 | .info = omap2430_mailbox_info, | 172 | .info = omap2430_mailbox_info, |
183 | }; | 173 | }; |
184 | 174 | ||
185 | static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = { | ||
186 | { .irq = 26 + OMAP_INTC_START, }, | ||
187 | { .irq = -1 }, | ||
188 | }; | ||
189 | |||
190 | static struct omap_hwmod omap2430_mailbox_hwmod = { | 175 | static struct omap_hwmod omap2430_mailbox_hwmod = { |
191 | .name = "mailbox", | 176 | .name = "mailbox", |
192 | .class = &omap2xxx_mailbox_hwmod_class, | 177 | .class = &omap2xxx_mailbox_hwmod_class, |
193 | .mpu_irqs = omap2430_mailbox_irqs, | ||
194 | .main_clk = "mailboxes_ick", | 178 | .main_clk = "mailboxes_ick", |
195 | .prcm = { | 179 | .prcm = { |
196 | .omap2 = { | 180 | .omap2 = { |
@@ -205,27 +189,12 @@ static struct omap_hwmod omap2430_mailbox_hwmod = { | |||
205 | }; | 189 | }; |
206 | 190 | ||
207 | /* mcspi3 */ | 191 | /* mcspi3 */ |
208 | static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = { | ||
209 | { .irq = 91 + OMAP_INTC_START, }, | ||
210 | { .irq = -1 }, | ||
211 | }; | ||
212 | |||
213 | static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = { | ||
214 | { .name = "tx0", .dma_req = 15 }, /* DMA_SPI3_TX0 */ | ||
215 | { .name = "rx0", .dma_req = 16 }, /* DMA_SPI3_RX0 */ | ||
216 | { .name = "tx1", .dma_req = 23 }, /* DMA_SPI3_TX1 */ | ||
217 | { .name = "rx1", .dma_req = 24 }, /* DMA_SPI3_RX1 */ | ||
218 | { .dma_req = -1 } | ||
219 | }; | ||
220 | |||
221 | static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = { | 192 | static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = { |
222 | .num_chipselect = 2, | 193 | .num_chipselect = 2, |
223 | }; | 194 | }; |
224 | 195 | ||
225 | static struct omap_hwmod omap2430_mcspi3_hwmod = { | 196 | static struct omap_hwmod omap2430_mcspi3_hwmod = { |
226 | .name = "mcspi3", | 197 | .name = "mcspi3", |
227 | .mpu_irqs = omap2430_mcspi3_mpu_irqs, | ||
228 | .sdma_reqs = omap2430_mcspi3_sdma_reqs, | ||
229 | .main_clk = "mcspi3_fck", | 198 | .main_clk = "mcspi3_fck", |
230 | .prcm = { | 199 | .prcm = { |
231 | .omap2 = { | 200 | .omap2 = { |
@@ -259,16 +228,8 @@ static struct omap_hwmod_class usbotg_class = { | |||
259 | }; | 228 | }; |
260 | 229 | ||
261 | /* usb_otg_hs */ | 230 | /* usb_otg_hs */ |
262 | static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = { | ||
263 | |||
264 | { .name = "mc", .irq = 92 + OMAP_INTC_START, }, | ||
265 | { .name = "dma", .irq = 93 + OMAP_INTC_START, }, | ||
266 | { .irq = -1 }, | ||
267 | }; | ||
268 | |||
269 | static struct omap_hwmod omap2430_usbhsotg_hwmod = { | 231 | static struct omap_hwmod omap2430_usbhsotg_hwmod = { |
270 | .name = "usb_otg_hs", | 232 | .name = "usb_otg_hs", |
271 | .mpu_irqs = omap2430_usbhsotg_mpu_irqs, | ||
272 | .main_clk = "usbhs_ick", | 233 | .main_clk = "usbhs_ick", |
273 | .prcm = { | 234 | .prcm = { |
274 | .omap2 = { | 235 | .omap2 = { |
@@ -313,19 +274,9 @@ static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = { | |||
313 | }; | 274 | }; |
314 | 275 | ||
315 | /* mcbsp1 */ | 276 | /* mcbsp1 */ |
316 | static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = { | ||
317 | { .name = "tx", .irq = 59 + OMAP_INTC_START, }, | ||
318 | { .name = "rx", .irq = 60 + OMAP_INTC_START, }, | ||
319 | { .name = "ovr", .irq = 61 + OMAP_INTC_START, }, | ||
320 | { .name = "common", .irq = 64 + OMAP_INTC_START, }, | ||
321 | { .irq = -1 }, | ||
322 | }; | ||
323 | |||
324 | static struct omap_hwmod omap2430_mcbsp1_hwmod = { | 277 | static struct omap_hwmod omap2430_mcbsp1_hwmod = { |
325 | .name = "mcbsp1", | 278 | .name = "mcbsp1", |
326 | .class = &omap2430_mcbsp_hwmod_class, | 279 | .class = &omap2430_mcbsp_hwmod_class, |
327 | .mpu_irqs = omap2430_mcbsp1_irqs, | ||
328 | .sdma_reqs = omap2_mcbsp1_sdma_reqs, | ||
329 | .main_clk = "mcbsp1_fck", | 280 | .main_clk = "mcbsp1_fck", |
330 | .prcm = { | 281 | .prcm = { |
331 | .omap2 = { | 282 | .omap2 = { |
@@ -341,18 +292,9 @@ static struct omap_hwmod omap2430_mcbsp1_hwmod = { | |||
341 | }; | 292 | }; |
342 | 293 | ||
343 | /* mcbsp2 */ | 294 | /* mcbsp2 */ |
344 | static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = { | ||
345 | { .name = "tx", .irq = 62 + OMAP_INTC_START, }, | ||
346 | { .name = "rx", .irq = 63 + OMAP_INTC_START, }, | ||
347 | { .name = "common", .irq = 16 + OMAP_INTC_START, }, | ||
348 | { .irq = -1 }, | ||
349 | }; | ||
350 | |||
351 | static struct omap_hwmod omap2430_mcbsp2_hwmod = { | 295 | static struct omap_hwmod omap2430_mcbsp2_hwmod = { |
352 | .name = "mcbsp2", | 296 | .name = "mcbsp2", |
353 | .class = &omap2430_mcbsp_hwmod_class, | 297 | .class = &omap2430_mcbsp_hwmod_class, |
354 | .mpu_irqs = omap2430_mcbsp2_irqs, | ||
355 | .sdma_reqs = omap2_mcbsp2_sdma_reqs, | ||
356 | .main_clk = "mcbsp2_fck", | 298 | .main_clk = "mcbsp2_fck", |
357 | .prcm = { | 299 | .prcm = { |
358 | .omap2 = { | 300 | .omap2 = { |
@@ -368,18 +310,9 @@ static struct omap_hwmod omap2430_mcbsp2_hwmod = { | |||
368 | }; | 310 | }; |
369 | 311 | ||
370 | /* mcbsp3 */ | 312 | /* mcbsp3 */ |
371 | static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = { | ||
372 | { .name = "tx", .irq = 89 + OMAP_INTC_START, }, | ||
373 | { .name = "rx", .irq = 90 + OMAP_INTC_START, }, | ||
374 | { .name = "common", .irq = 17 + OMAP_INTC_START, }, | ||
375 | { .irq = -1 }, | ||
376 | }; | ||
377 | |||
378 | static struct omap_hwmod omap2430_mcbsp3_hwmod = { | 313 | static struct omap_hwmod omap2430_mcbsp3_hwmod = { |
379 | .name = "mcbsp3", | 314 | .name = "mcbsp3", |
380 | .class = &omap2430_mcbsp_hwmod_class, | 315 | .class = &omap2430_mcbsp_hwmod_class, |
381 | .mpu_irqs = omap2430_mcbsp3_irqs, | ||
382 | .sdma_reqs = omap2_mcbsp3_sdma_reqs, | ||
383 | .main_clk = "mcbsp3_fck", | 316 | .main_clk = "mcbsp3_fck", |
384 | .prcm = { | 317 | .prcm = { |
385 | .omap2 = { | 318 | .omap2 = { |
@@ -395,24 +328,9 @@ static struct omap_hwmod omap2430_mcbsp3_hwmod = { | |||
395 | }; | 328 | }; |
396 | 329 | ||
397 | /* mcbsp4 */ | 330 | /* mcbsp4 */ |
398 | static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = { | ||
399 | { .name = "tx", .irq = 54 + OMAP_INTC_START, }, | ||
400 | { .name = "rx", .irq = 55 + OMAP_INTC_START, }, | ||
401 | { .name = "common", .irq = 18 + OMAP_INTC_START, }, | ||
402 | { .irq = -1 }, | ||
403 | }; | ||
404 | |||
405 | static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = { | ||
406 | { .name = "rx", .dma_req = 20 }, | ||
407 | { .name = "tx", .dma_req = 19 }, | ||
408 | { .dma_req = -1 } | ||
409 | }; | ||
410 | |||
411 | static struct omap_hwmod omap2430_mcbsp4_hwmod = { | 331 | static struct omap_hwmod omap2430_mcbsp4_hwmod = { |
412 | .name = "mcbsp4", | 332 | .name = "mcbsp4", |
413 | .class = &omap2430_mcbsp_hwmod_class, | 333 | .class = &omap2430_mcbsp_hwmod_class, |
414 | .mpu_irqs = omap2430_mcbsp4_irqs, | ||
415 | .sdma_reqs = omap2430_mcbsp4_sdma_chs, | ||
416 | .main_clk = "mcbsp4_fck", | 334 | .main_clk = "mcbsp4_fck", |
417 | .prcm = { | 335 | .prcm = { |
418 | .omap2 = { | 336 | .omap2 = { |
@@ -428,24 +346,9 @@ static struct omap_hwmod omap2430_mcbsp4_hwmod = { | |||
428 | }; | 346 | }; |
429 | 347 | ||
430 | /* mcbsp5 */ | 348 | /* mcbsp5 */ |
431 | static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = { | ||
432 | { .name = "tx", .irq = 81 + OMAP_INTC_START, }, | ||
433 | { .name = "rx", .irq = 82 + OMAP_INTC_START, }, | ||
434 | { .name = "common", .irq = 19 + OMAP_INTC_START, }, | ||
435 | { .irq = -1 }, | ||
436 | }; | ||
437 | |||
438 | static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = { | ||
439 | { .name = "rx", .dma_req = 22 }, | ||
440 | { .name = "tx", .dma_req = 21 }, | ||
441 | { .dma_req = -1 } | ||
442 | }; | ||
443 | |||
444 | static struct omap_hwmod omap2430_mcbsp5_hwmod = { | 349 | static struct omap_hwmod omap2430_mcbsp5_hwmod = { |
445 | .name = "mcbsp5", | 350 | .name = "mcbsp5", |
446 | .class = &omap2430_mcbsp_hwmod_class, | 351 | .class = &omap2430_mcbsp_hwmod_class, |
447 | .mpu_irqs = omap2430_mcbsp5_irqs, | ||
448 | .sdma_reqs = omap2430_mcbsp5_sdma_chs, | ||
449 | .main_clk = "mcbsp5_fck", | 352 | .main_clk = "mcbsp5_fck", |
450 | .prcm = { | 353 | .prcm = { |
451 | .omap2 = { | 354 | .omap2 = { |
@@ -478,17 +381,6 @@ static struct omap_hwmod_class omap2430_mmc_class = { | |||
478 | }; | 381 | }; |
479 | 382 | ||
480 | /* MMC/SD/SDIO1 */ | 383 | /* MMC/SD/SDIO1 */ |
481 | static struct omap_hwmod_irq_info omap2430_mmc1_mpu_irqs[] = { | ||
482 | { .irq = 83 + OMAP_INTC_START, }, | ||
483 | { .irq = -1 }, | ||
484 | }; | ||
485 | |||
486 | static struct omap_hwmod_dma_info omap2430_mmc1_sdma_reqs[] = { | ||
487 | { .name = "tx", .dma_req = 61 }, /* DMA_MMC1_TX */ | ||
488 | { .name = "rx", .dma_req = 62 }, /* DMA_MMC1_RX */ | ||
489 | { .dma_req = -1 } | ||
490 | }; | ||
491 | |||
492 | static struct omap_hwmod_opt_clk omap2430_mmc1_opt_clks[] = { | 384 | static struct omap_hwmod_opt_clk omap2430_mmc1_opt_clks[] = { |
493 | { .role = "dbck", .clk = "mmchsdb1_fck" }, | 385 | { .role = "dbck", .clk = "mmchsdb1_fck" }, |
494 | }; | 386 | }; |
@@ -500,8 +392,6 @@ static struct omap_mmc_dev_attr mmc1_dev_attr = { | |||
500 | static struct omap_hwmod omap2430_mmc1_hwmod = { | 392 | static struct omap_hwmod omap2430_mmc1_hwmod = { |
501 | .name = "mmc1", | 393 | .name = "mmc1", |
502 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | 394 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, |
503 | .mpu_irqs = omap2430_mmc1_mpu_irqs, | ||
504 | .sdma_reqs = omap2430_mmc1_sdma_reqs, | ||
505 | .opt_clks = omap2430_mmc1_opt_clks, | 395 | .opt_clks = omap2430_mmc1_opt_clks, |
506 | .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc1_opt_clks), | 396 | .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc1_opt_clks), |
507 | .main_clk = "mmchs1_fck", | 397 | .main_clk = "mmchs1_fck", |
@@ -519,17 +409,6 @@ static struct omap_hwmod omap2430_mmc1_hwmod = { | |||
519 | }; | 409 | }; |
520 | 410 | ||
521 | /* MMC/SD/SDIO2 */ | 411 | /* MMC/SD/SDIO2 */ |
522 | static struct omap_hwmod_irq_info omap2430_mmc2_mpu_irqs[] = { | ||
523 | { .irq = 86 + OMAP_INTC_START, }, | ||
524 | { .irq = -1 }, | ||
525 | }; | ||
526 | |||
527 | static struct omap_hwmod_dma_info omap2430_mmc2_sdma_reqs[] = { | ||
528 | { .name = "tx", .dma_req = 47 }, /* DMA_MMC2_TX */ | ||
529 | { .name = "rx", .dma_req = 48 }, /* DMA_MMC2_RX */ | ||
530 | { .dma_req = -1 } | ||
531 | }; | ||
532 | |||
533 | static struct omap_hwmod_opt_clk omap2430_mmc2_opt_clks[] = { | 412 | static struct omap_hwmod_opt_clk omap2430_mmc2_opt_clks[] = { |
534 | { .role = "dbck", .clk = "mmchsdb2_fck" }, | 413 | { .role = "dbck", .clk = "mmchsdb2_fck" }, |
535 | }; | 414 | }; |
@@ -537,8 +416,6 @@ static struct omap_hwmod_opt_clk omap2430_mmc2_opt_clks[] = { | |||
537 | static struct omap_hwmod omap2430_mmc2_hwmod = { | 416 | static struct omap_hwmod omap2430_mmc2_hwmod = { |
538 | .name = "mmc2", | 417 | .name = "mmc2", |
539 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | 418 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, |
540 | .mpu_irqs = omap2430_mmc2_mpu_irqs, | ||
541 | .sdma_reqs = omap2430_mmc2_sdma_reqs, | ||
542 | .opt_clks = omap2430_mmc2_opt_clks, | 419 | .opt_clks = omap2430_mmc2_opt_clks, |
543 | .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc2_opt_clks), | 420 | .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc2_opt_clks), |
544 | .main_clk = "mmchs2_fck", | 421 | .main_clk = "mmchs2_fck", |
@@ -557,7 +434,6 @@ static struct omap_hwmod omap2430_mmc2_hwmod = { | |||
557 | /* HDQ1W/1-wire */ | 434 | /* HDQ1W/1-wire */ |
558 | static struct omap_hwmod omap2430_hdq1w_hwmod = { | 435 | static struct omap_hwmod omap2430_hdq1w_hwmod = { |
559 | .name = "hdq1w", | 436 | .name = "hdq1w", |
560 | .mpu_irqs = omap2_hdq1w_mpu_irqs, | ||
561 | .main_clk = "hdq_fck", | 437 | .main_clk = "hdq_fck", |
562 | .prcm = { | 438 | .prcm = { |
563 | .omap2 = { | 439 | .omap2 = { |
@@ -589,7 +465,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__i2c1 = { | |||
589 | .master = &omap2xxx_l4_core_hwmod, | 465 | .master = &omap2xxx_l4_core_hwmod, |
590 | .slave = &omap2430_i2c1_hwmod, | 466 | .slave = &omap2430_i2c1_hwmod, |
591 | .clk = "i2c1_ick", | 467 | .clk = "i2c1_ick", |
592 | .addr = omap2_i2c1_addr_space, | ||
593 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 468 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
594 | }; | 469 | }; |
595 | 470 | ||
@@ -598,25 +473,14 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__i2c2 = { | |||
598 | .master = &omap2xxx_l4_core_hwmod, | 473 | .master = &omap2xxx_l4_core_hwmod, |
599 | .slave = &omap2430_i2c2_hwmod, | 474 | .slave = &omap2430_i2c2_hwmod, |
600 | .clk = "i2c2_ick", | 475 | .clk = "i2c2_ick", |
601 | .addr = omap2_i2c2_addr_space, | ||
602 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 476 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
603 | }; | 477 | }; |
604 | 478 | ||
605 | static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = { | ||
606 | { | ||
607 | .pa_start = OMAP243X_HS_BASE, | ||
608 | .pa_end = OMAP243X_HS_BASE + SZ_4K - 1, | ||
609 | .flags = ADDR_TYPE_RT | ||
610 | }, | ||
611 | { } | ||
612 | }; | ||
613 | |||
614 | /* l4_core ->usbhsotg interface */ | 479 | /* l4_core ->usbhsotg interface */ |
615 | static struct omap_hwmod_ocp_if omap2430_l4_core__usbhsotg = { | 480 | static struct omap_hwmod_ocp_if omap2430_l4_core__usbhsotg = { |
616 | .master = &omap2xxx_l4_core_hwmod, | 481 | .master = &omap2xxx_l4_core_hwmod, |
617 | .slave = &omap2430_usbhsotg_hwmod, | 482 | .slave = &omap2430_usbhsotg_hwmod, |
618 | .clk = "usb_l4_ick", | 483 | .clk = "usb_l4_ick", |
619 | .addr = omap2430_usbhsotg_addrs, | ||
620 | .user = OCP_USER_MPU, | 484 | .user = OCP_USER_MPU, |
621 | }; | 485 | }; |
622 | 486 | ||
@@ -625,7 +489,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__mmc1 = { | |||
625 | .master = &omap2xxx_l4_core_hwmod, | 489 | .master = &omap2xxx_l4_core_hwmod, |
626 | .slave = &omap2430_mmc1_hwmod, | 490 | .slave = &omap2430_mmc1_hwmod, |
627 | .clk = "mmchs1_ick", | 491 | .clk = "mmchs1_ick", |
628 | .addr = omap2430_mmc1_addr_space, | ||
629 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 492 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
630 | }; | 493 | }; |
631 | 494 | ||
@@ -634,7 +497,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__mmc2 = { | |||
634 | .master = &omap2xxx_l4_core_hwmod, | 497 | .master = &omap2xxx_l4_core_hwmod, |
635 | .slave = &omap2430_mmc2_hwmod, | 498 | .slave = &omap2430_mmc2_hwmod, |
636 | .clk = "mmchs2_ick", | 499 | .clk = "mmchs2_ick", |
637 | .addr = omap2430_mmc2_addr_space, | ||
638 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 500 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
639 | }; | 501 | }; |
640 | 502 | ||
@@ -643,7 +505,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi3 = { | |||
643 | .master = &omap2xxx_l4_core_hwmod, | 505 | .master = &omap2xxx_l4_core_hwmod, |
644 | .slave = &omap2430_mcspi3_hwmod, | 506 | .slave = &omap2430_mcspi3_hwmod, |
645 | .clk = "mcspi3_ick", | 507 | .clk = "mcspi3_ick", |
646 | .addr = omap2430_mcspi3_addr_space, | ||
647 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 508 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
648 | }; | 509 | }; |
649 | 510 | ||
@@ -655,129 +516,59 @@ static struct omap_hwmod_ocp_if omap2430_l3__iva = { | |||
655 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 516 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
656 | }; | 517 | }; |
657 | 518 | ||
658 | static struct omap_hwmod_addr_space omap2430_timer1_addrs[] = { | ||
659 | { | ||
660 | .pa_start = 0x49018000, | ||
661 | .pa_end = 0x49018000 + SZ_1K - 1, | ||
662 | .flags = ADDR_TYPE_RT | ||
663 | }, | ||
664 | { } | ||
665 | }; | ||
666 | |||
667 | /* l4_wkup -> timer1 */ | 519 | /* l4_wkup -> timer1 */ |
668 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__timer1 = { | 520 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__timer1 = { |
669 | .master = &omap2xxx_l4_wkup_hwmod, | 521 | .master = &omap2xxx_l4_wkup_hwmod, |
670 | .slave = &omap2xxx_timer1_hwmod, | 522 | .slave = &omap2xxx_timer1_hwmod, |
671 | .clk = "gpt1_ick", | 523 | .clk = "gpt1_ick", |
672 | .addr = omap2430_timer1_addrs, | ||
673 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 524 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
674 | }; | 525 | }; |
675 | 526 | ||
676 | /* l4_wkup -> wd_timer2 */ | 527 | /* l4_wkup -> wd_timer2 */ |
677 | static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = { | ||
678 | { | ||
679 | .pa_start = 0x49016000, | ||
680 | .pa_end = 0x4901607f, | ||
681 | .flags = ADDR_TYPE_RT | ||
682 | }, | ||
683 | { } | ||
684 | }; | ||
685 | |||
686 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__wd_timer2 = { | 528 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__wd_timer2 = { |
687 | .master = &omap2xxx_l4_wkup_hwmod, | 529 | .master = &omap2xxx_l4_wkup_hwmod, |
688 | .slave = &omap2xxx_wd_timer2_hwmod, | 530 | .slave = &omap2xxx_wd_timer2_hwmod, |
689 | .clk = "mpu_wdt_ick", | 531 | .clk = "mpu_wdt_ick", |
690 | .addr = omap2430_wd_timer2_addrs, | ||
691 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 532 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
692 | }; | 533 | }; |
693 | 534 | ||
694 | /* l4_wkup -> gpio1 */ | 535 | /* l4_wkup -> gpio1 */ |
695 | static struct omap_hwmod_addr_space omap2430_gpio1_addr_space[] = { | ||
696 | { | ||
697 | .pa_start = 0x4900C000, | ||
698 | .pa_end = 0x4900C1ff, | ||
699 | .flags = ADDR_TYPE_RT | ||
700 | }, | ||
701 | { } | ||
702 | }; | ||
703 | |||
704 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio1 = { | 536 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio1 = { |
705 | .master = &omap2xxx_l4_wkup_hwmod, | 537 | .master = &omap2xxx_l4_wkup_hwmod, |
706 | .slave = &omap2xxx_gpio1_hwmod, | 538 | .slave = &omap2xxx_gpio1_hwmod, |
707 | .clk = "gpios_ick", | 539 | .clk = "gpios_ick", |
708 | .addr = omap2430_gpio1_addr_space, | ||
709 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 540 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
710 | }; | 541 | }; |
711 | 542 | ||
712 | /* l4_wkup -> gpio2 */ | 543 | /* l4_wkup -> gpio2 */ |
713 | static struct omap_hwmod_addr_space omap2430_gpio2_addr_space[] = { | ||
714 | { | ||
715 | .pa_start = 0x4900E000, | ||
716 | .pa_end = 0x4900E1ff, | ||
717 | .flags = ADDR_TYPE_RT | ||
718 | }, | ||
719 | { } | ||
720 | }; | ||
721 | |||
722 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio2 = { | 544 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio2 = { |
723 | .master = &omap2xxx_l4_wkup_hwmod, | 545 | .master = &omap2xxx_l4_wkup_hwmod, |
724 | .slave = &omap2xxx_gpio2_hwmod, | 546 | .slave = &omap2xxx_gpio2_hwmod, |
725 | .clk = "gpios_ick", | 547 | .clk = "gpios_ick", |
726 | .addr = omap2430_gpio2_addr_space, | ||
727 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 548 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
728 | }; | 549 | }; |
729 | 550 | ||
730 | /* l4_wkup -> gpio3 */ | 551 | /* l4_wkup -> gpio3 */ |
731 | static struct omap_hwmod_addr_space omap2430_gpio3_addr_space[] = { | ||
732 | { | ||
733 | .pa_start = 0x49010000, | ||
734 | .pa_end = 0x490101ff, | ||
735 | .flags = ADDR_TYPE_RT | ||
736 | }, | ||
737 | { } | ||
738 | }; | ||
739 | |||
740 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio3 = { | 552 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio3 = { |
741 | .master = &omap2xxx_l4_wkup_hwmod, | 553 | .master = &omap2xxx_l4_wkup_hwmod, |
742 | .slave = &omap2xxx_gpio3_hwmod, | 554 | .slave = &omap2xxx_gpio3_hwmod, |
743 | .clk = "gpios_ick", | 555 | .clk = "gpios_ick", |
744 | .addr = omap2430_gpio3_addr_space, | ||
745 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 556 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
746 | }; | 557 | }; |
747 | 558 | ||
748 | /* l4_wkup -> gpio4 */ | 559 | /* l4_wkup -> gpio4 */ |
749 | static struct omap_hwmod_addr_space omap2430_gpio4_addr_space[] = { | ||
750 | { | ||
751 | .pa_start = 0x49012000, | ||
752 | .pa_end = 0x490121ff, | ||
753 | .flags = ADDR_TYPE_RT | ||
754 | }, | ||
755 | { } | ||
756 | }; | ||
757 | |||
758 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio4 = { | 560 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio4 = { |
759 | .master = &omap2xxx_l4_wkup_hwmod, | 561 | .master = &omap2xxx_l4_wkup_hwmod, |
760 | .slave = &omap2xxx_gpio4_hwmod, | 562 | .slave = &omap2xxx_gpio4_hwmod, |
761 | .clk = "gpios_ick", | 563 | .clk = "gpios_ick", |
762 | .addr = omap2430_gpio4_addr_space, | ||
763 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 564 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
764 | }; | 565 | }; |
765 | 566 | ||
766 | /* l4_core -> gpio5 */ | 567 | /* l4_core -> gpio5 */ |
767 | static struct omap_hwmod_addr_space omap2430_gpio5_addr_space[] = { | ||
768 | { | ||
769 | .pa_start = 0x480B6000, | ||
770 | .pa_end = 0x480B61ff, | ||
771 | .flags = ADDR_TYPE_RT | ||
772 | }, | ||
773 | { } | ||
774 | }; | ||
775 | |||
776 | static struct omap_hwmod_ocp_if omap2430_l4_core__gpio5 = { | 568 | static struct omap_hwmod_ocp_if omap2430_l4_core__gpio5 = { |
777 | .master = &omap2xxx_l4_core_hwmod, | 569 | .master = &omap2xxx_l4_core_hwmod, |
778 | .slave = &omap2430_gpio5_hwmod, | 570 | .slave = &omap2430_gpio5_hwmod, |
779 | .clk = "gpio5_ick", | 571 | .clk = "gpio5_ick", |
780 | .addr = omap2430_gpio5_addr_space, | ||
781 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 572 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
782 | }; | 573 | }; |
783 | 574 | ||
@@ -802,7 +593,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__dma_system = { | |||
802 | static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = { | 593 | static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = { |
803 | .master = &omap2xxx_l4_core_hwmod, | 594 | .master = &omap2xxx_l4_core_hwmod, |
804 | .slave = &omap2430_mailbox_hwmod, | 595 | .slave = &omap2430_mailbox_hwmod, |
805 | .addr = omap2_mailbox_addrs, | ||
806 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 596 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
807 | }; | 597 | }; |
808 | 598 | ||
@@ -811,7 +601,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp1 = { | |||
811 | .master = &omap2xxx_l4_core_hwmod, | 601 | .master = &omap2xxx_l4_core_hwmod, |
812 | .slave = &omap2430_mcbsp1_hwmod, | 602 | .slave = &omap2430_mcbsp1_hwmod, |
813 | .clk = "mcbsp1_ick", | 603 | .clk = "mcbsp1_ick", |
814 | .addr = omap2_mcbsp1_addrs, | ||
815 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 604 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
816 | }; | 605 | }; |
817 | 606 | ||
@@ -820,64 +609,30 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp2 = { | |||
820 | .master = &omap2xxx_l4_core_hwmod, | 609 | .master = &omap2xxx_l4_core_hwmod, |
821 | .slave = &omap2430_mcbsp2_hwmod, | 610 | .slave = &omap2430_mcbsp2_hwmod, |
822 | .clk = "mcbsp2_ick", | 611 | .clk = "mcbsp2_ick", |
823 | .addr = omap2xxx_mcbsp2_addrs, | ||
824 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 612 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
825 | }; | 613 | }; |
826 | 614 | ||
827 | static struct omap_hwmod_addr_space omap2430_mcbsp3_addrs[] = { | ||
828 | { | ||
829 | .name = "mpu", | ||
830 | .pa_start = 0x4808C000, | ||
831 | .pa_end = 0x4808C0ff, | ||
832 | .flags = ADDR_TYPE_RT | ||
833 | }, | ||
834 | { } | ||
835 | }; | ||
836 | |||
837 | /* l4_core -> mcbsp3 */ | 615 | /* l4_core -> mcbsp3 */ |
838 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp3 = { | 616 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp3 = { |
839 | .master = &omap2xxx_l4_core_hwmod, | 617 | .master = &omap2xxx_l4_core_hwmod, |
840 | .slave = &omap2430_mcbsp3_hwmod, | 618 | .slave = &omap2430_mcbsp3_hwmod, |
841 | .clk = "mcbsp3_ick", | 619 | .clk = "mcbsp3_ick", |
842 | .addr = omap2430_mcbsp3_addrs, | ||
843 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 620 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
844 | }; | 621 | }; |
845 | 622 | ||
846 | static struct omap_hwmod_addr_space omap2430_mcbsp4_addrs[] = { | ||
847 | { | ||
848 | .name = "mpu", | ||
849 | .pa_start = 0x4808E000, | ||
850 | .pa_end = 0x4808E0ff, | ||
851 | .flags = ADDR_TYPE_RT | ||
852 | }, | ||
853 | { } | ||
854 | }; | ||
855 | |||
856 | /* l4_core -> mcbsp4 */ | 623 | /* l4_core -> mcbsp4 */ |
857 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp4 = { | 624 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp4 = { |
858 | .master = &omap2xxx_l4_core_hwmod, | 625 | .master = &omap2xxx_l4_core_hwmod, |
859 | .slave = &omap2430_mcbsp4_hwmod, | 626 | .slave = &omap2430_mcbsp4_hwmod, |
860 | .clk = "mcbsp4_ick", | 627 | .clk = "mcbsp4_ick", |
861 | .addr = omap2430_mcbsp4_addrs, | ||
862 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 628 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
863 | }; | 629 | }; |
864 | 630 | ||
865 | static struct omap_hwmod_addr_space omap2430_mcbsp5_addrs[] = { | ||
866 | { | ||
867 | .name = "mpu", | ||
868 | .pa_start = 0x48096000, | ||
869 | .pa_end = 0x480960ff, | ||
870 | .flags = ADDR_TYPE_RT | ||
871 | }, | ||
872 | { } | ||
873 | }; | ||
874 | |||
875 | /* l4_core -> mcbsp5 */ | 631 | /* l4_core -> mcbsp5 */ |
876 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp5 = { | 632 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp5 = { |
877 | .master = &omap2xxx_l4_core_hwmod, | 633 | .master = &omap2xxx_l4_core_hwmod, |
878 | .slave = &omap2430_mcbsp5_hwmod, | 634 | .slave = &omap2430_mcbsp5_hwmod, |
879 | .clk = "mcbsp5_ick", | 635 | .clk = "mcbsp5_ick", |
880 | .addr = omap2430_mcbsp5_addrs, | ||
881 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 636 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
882 | }; | 637 | }; |
883 | 638 | ||
@@ -886,35 +641,15 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__hdq1w = { | |||
886 | .master = &omap2xxx_l4_core_hwmod, | 641 | .master = &omap2xxx_l4_core_hwmod, |
887 | .slave = &omap2430_hdq1w_hwmod, | 642 | .slave = &omap2430_hdq1w_hwmod, |
888 | .clk = "hdq_ick", | 643 | .clk = "hdq_ick", |
889 | .addr = omap2_hdq1w_addr_space, | ||
890 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 644 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
891 | .flags = OMAP_FIREWALL_L4 | OCPIF_SWSUP_IDLE, | 645 | .flags = OMAP_FIREWALL_L4 | OCPIF_SWSUP_IDLE, |
892 | }; | 646 | }; |
893 | 647 | ||
894 | /* l4_wkup -> 32ksync_counter */ | 648 | /* l4_wkup -> 32ksync_counter */ |
895 | static struct omap_hwmod_addr_space omap2430_counter_32k_addrs[] = { | ||
896 | { | ||
897 | .pa_start = 0x49020000, | ||
898 | .pa_end = 0x4902001f, | ||
899 | .flags = ADDR_TYPE_RT | ||
900 | }, | ||
901 | { } | ||
902 | }; | ||
903 | |||
904 | static struct omap_hwmod_addr_space omap2430_gpmc_addrs[] = { | ||
905 | { | ||
906 | .pa_start = 0x6e000000, | ||
907 | .pa_end = 0x6e000fff, | ||
908 | .flags = ADDR_TYPE_RT | ||
909 | }, | ||
910 | { } | ||
911 | }; | ||
912 | |||
913 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__counter_32k = { | 649 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__counter_32k = { |
914 | .master = &omap2xxx_l4_wkup_hwmod, | 650 | .master = &omap2xxx_l4_wkup_hwmod, |
915 | .slave = &omap2xxx_counter_32k_hwmod, | 651 | .slave = &omap2xxx_counter_32k_hwmod, |
916 | .clk = "sync_32k_ick", | 652 | .clk = "sync_32k_ick", |
917 | .addr = omap2430_counter_32k_addrs, | ||
918 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 653 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
919 | }; | 654 | }; |
920 | 655 | ||
@@ -922,7 +657,6 @@ static struct omap_hwmod_ocp_if omap2430_l3__gpmc = { | |||
922 | .master = &omap2xxx_l3_main_hwmod, | 657 | .master = &omap2xxx_l3_main_hwmod, |
923 | .slave = &omap2xxx_gpmc_hwmod, | 658 | .slave = &omap2xxx_gpmc_hwmod, |
924 | .clk = "core_l3_ck", | 659 | .clk = "core_l3_ck", |
925 | .addr = omap2430_gpmc_addrs, | ||
926 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 660 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
927 | }; | 661 | }; |
928 | 662 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c index 5fd40d4a989e..656861c29d5c 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c | |||
@@ -20,142 +20,6 @@ | |||
20 | 20 | ||
21 | #include "omap_hwmod_common_data.h" | 21 | #include "omap_hwmod_common_data.h" |
22 | 22 | ||
23 | static struct omap_hwmod_addr_space omap2xxx_uart1_addr_space[] = { | ||
24 | { | ||
25 | .pa_start = OMAP2_UART1_BASE, | ||
26 | .pa_end = OMAP2_UART1_BASE + SZ_8K - 1, | ||
27 | .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT, | ||
28 | }, | ||
29 | { } | ||
30 | }; | ||
31 | |||
32 | static struct omap_hwmod_addr_space omap2xxx_uart2_addr_space[] = { | ||
33 | { | ||
34 | .pa_start = OMAP2_UART2_BASE, | ||
35 | .pa_end = OMAP2_UART2_BASE + SZ_1K - 1, | ||
36 | .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT, | ||
37 | }, | ||
38 | { } | ||
39 | }; | ||
40 | |||
41 | static struct omap_hwmod_addr_space omap2xxx_uart3_addr_space[] = { | ||
42 | { | ||
43 | .pa_start = OMAP2_UART3_BASE, | ||
44 | .pa_end = OMAP2_UART3_BASE + SZ_1K - 1, | ||
45 | .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT, | ||
46 | }, | ||
47 | { } | ||
48 | }; | ||
49 | |||
50 | static struct omap_hwmod_addr_space omap2xxx_timer2_addrs[] = { | ||
51 | { | ||
52 | .pa_start = 0x4802a000, | ||
53 | .pa_end = 0x4802a000 + SZ_1K - 1, | ||
54 | .flags = ADDR_TYPE_RT | ||
55 | }, | ||
56 | { } | ||
57 | }; | ||
58 | |||
59 | static struct omap_hwmod_addr_space omap2xxx_timer3_addrs[] = { | ||
60 | { | ||
61 | .pa_start = 0x48078000, | ||
62 | .pa_end = 0x48078000 + SZ_1K - 1, | ||
63 | .flags = ADDR_TYPE_RT | ||
64 | }, | ||
65 | { } | ||
66 | }; | ||
67 | |||
68 | static struct omap_hwmod_addr_space omap2xxx_timer4_addrs[] = { | ||
69 | { | ||
70 | .pa_start = 0x4807a000, | ||
71 | .pa_end = 0x4807a000 + SZ_1K - 1, | ||
72 | .flags = ADDR_TYPE_RT | ||
73 | }, | ||
74 | { } | ||
75 | }; | ||
76 | |||
77 | static struct omap_hwmod_addr_space omap2xxx_timer5_addrs[] = { | ||
78 | { | ||
79 | .pa_start = 0x4807c000, | ||
80 | .pa_end = 0x4807c000 + SZ_1K - 1, | ||
81 | .flags = ADDR_TYPE_RT | ||
82 | }, | ||
83 | { } | ||
84 | }; | ||
85 | |||
86 | static struct omap_hwmod_addr_space omap2xxx_timer6_addrs[] = { | ||
87 | { | ||
88 | .pa_start = 0x4807e000, | ||
89 | .pa_end = 0x4807e000 + SZ_1K - 1, | ||
90 | .flags = ADDR_TYPE_RT | ||
91 | }, | ||
92 | { } | ||
93 | }; | ||
94 | |||
95 | static struct omap_hwmod_addr_space omap2xxx_timer7_addrs[] = { | ||
96 | { | ||
97 | .pa_start = 0x48080000, | ||
98 | .pa_end = 0x48080000 + SZ_1K - 1, | ||
99 | .flags = ADDR_TYPE_RT | ||
100 | }, | ||
101 | { } | ||
102 | }; | ||
103 | |||
104 | static struct omap_hwmod_addr_space omap2xxx_timer8_addrs[] = { | ||
105 | { | ||
106 | .pa_start = 0x48082000, | ||
107 | .pa_end = 0x48082000 + SZ_1K - 1, | ||
108 | .flags = ADDR_TYPE_RT | ||
109 | }, | ||
110 | { } | ||
111 | }; | ||
112 | |||
113 | static struct omap_hwmod_addr_space omap2xxx_timer9_addrs[] = { | ||
114 | { | ||
115 | .pa_start = 0x48084000, | ||
116 | .pa_end = 0x48084000 + SZ_1K - 1, | ||
117 | .flags = ADDR_TYPE_RT | ||
118 | }, | ||
119 | { } | ||
120 | }; | ||
121 | |||
122 | struct omap_hwmod_addr_space omap2xxx_mcbsp2_addrs[] = { | ||
123 | { | ||
124 | .name = "mpu", | ||
125 | .pa_start = 0x48076000, | ||
126 | .pa_end = 0x480760ff, | ||
127 | .flags = ADDR_TYPE_RT | ||
128 | }, | ||
129 | { } | ||
130 | }; | ||
131 | |||
132 | static struct omap_hwmod_addr_space omap2_rng_addr_space[] = { | ||
133 | { | ||
134 | .pa_start = 0x480a0000, | ||
135 | .pa_end = 0x480a004f, | ||
136 | .flags = ADDR_TYPE_RT | ||
137 | }, | ||
138 | { } | ||
139 | }; | ||
140 | |||
141 | static struct omap_hwmod_addr_space omap2xxx_sham_addrs[] = { | ||
142 | { | ||
143 | .pa_start = 0x480a4000, | ||
144 | .pa_end = 0x480a4000 + 0x64 - 1, | ||
145 | .flags = ADDR_TYPE_RT | ||
146 | }, | ||
147 | { } | ||
148 | }; | ||
149 | |||
150 | static struct omap_hwmod_addr_space omap2xxx_aes_addrs[] = { | ||
151 | { | ||
152 | .pa_start = 0x480a6000, | ||
153 | .pa_end = 0x480a6000 + 0x50 - 1, | ||
154 | .flags = ADDR_TYPE_RT | ||
155 | }, | ||
156 | { } | ||
157 | }; | ||
158 | |||
159 | /* | 23 | /* |
160 | * Common interconnect data | 24 | * Common interconnect data |
161 | */ | 25 | */ |
@@ -182,7 +46,7 @@ struct omap_hwmod_ocp_if omap2xxx_dss__l3 = { | |||
182 | .omap2 = { | 46 | .omap2 = { |
183 | .l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS, | 47 | .l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS, |
184 | .flags = OMAP_FIREWALL_L3, | 48 | .flags = OMAP_FIREWALL_L3, |
185 | } | 49 | }, |
186 | }, | 50 | }, |
187 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 51 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
188 | }; | 52 | }; |
@@ -199,7 +63,6 @@ struct omap_hwmod_ocp_if omap2_l4_core__uart1 = { | |||
199 | .master = &omap2xxx_l4_core_hwmod, | 63 | .master = &omap2xxx_l4_core_hwmod, |
200 | .slave = &omap2xxx_uart1_hwmod, | 64 | .slave = &omap2xxx_uart1_hwmod, |
201 | .clk = "uart1_ick", | 65 | .clk = "uart1_ick", |
202 | .addr = omap2xxx_uart1_addr_space, | ||
203 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 66 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
204 | }; | 67 | }; |
205 | 68 | ||
@@ -208,7 +71,6 @@ struct omap_hwmod_ocp_if omap2_l4_core__uart2 = { | |||
208 | .master = &omap2xxx_l4_core_hwmod, | 71 | .master = &omap2xxx_l4_core_hwmod, |
209 | .slave = &omap2xxx_uart2_hwmod, | 72 | .slave = &omap2xxx_uart2_hwmod, |
210 | .clk = "uart2_ick", | 73 | .clk = "uart2_ick", |
211 | .addr = omap2xxx_uart2_addr_space, | ||
212 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 74 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
213 | }; | 75 | }; |
214 | 76 | ||
@@ -217,7 +79,6 @@ struct omap_hwmod_ocp_if omap2_l4_core__uart3 = { | |||
217 | .master = &omap2xxx_l4_core_hwmod, | 79 | .master = &omap2xxx_l4_core_hwmod, |
218 | .slave = &omap2xxx_uart3_hwmod, | 80 | .slave = &omap2xxx_uart3_hwmod, |
219 | .clk = "uart3_ick", | 81 | .clk = "uart3_ick", |
220 | .addr = omap2xxx_uart3_addr_space, | ||
221 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 82 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
222 | }; | 83 | }; |
223 | 84 | ||
@@ -226,7 +87,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__mcspi1 = { | |||
226 | .master = &omap2xxx_l4_core_hwmod, | 87 | .master = &omap2xxx_l4_core_hwmod, |
227 | .slave = &omap2xxx_mcspi1_hwmod, | 88 | .slave = &omap2xxx_mcspi1_hwmod, |
228 | .clk = "mcspi1_ick", | 89 | .clk = "mcspi1_ick", |
229 | .addr = omap2_mcspi1_addr_space, | ||
230 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 90 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
231 | }; | 91 | }; |
232 | 92 | ||
@@ -235,7 +95,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__mcspi2 = { | |||
235 | .master = &omap2xxx_l4_core_hwmod, | 95 | .master = &omap2xxx_l4_core_hwmod, |
236 | .slave = &omap2xxx_mcspi2_hwmod, | 96 | .slave = &omap2xxx_mcspi2_hwmod, |
237 | .clk = "mcspi2_ick", | 97 | .clk = "mcspi2_ick", |
238 | .addr = omap2_mcspi2_addr_space, | ||
239 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 98 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
240 | }; | 99 | }; |
241 | 100 | ||
@@ -244,7 +103,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer2 = { | |||
244 | .master = &omap2xxx_l4_core_hwmod, | 103 | .master = &omap2xxx_l4_core_hwmod, |
245 | .slave = &omap2xxx_timer2_hwmod, | 104 | .slave = &omap2xxx_timer2_hwmod, |
246 | .clk = "gpt2_ick", | 105 | .clk = "gpt2_ick", |
247 | .addr = omap2xxx_timer2_addrs, | ||
248 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 106 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
249 | }; | 107 | }; |
250 | 108 | ||
@@ -253,7 +111,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer3 = { | |||
253 | .master = &omap2xxx_l4_core_hwmod, | 111 | .master = &omap2xxx_l4_core_hwmod, |
254 | .slave = &omap2xxx_timer3_hwmod, | 112 | .slave = &omap2xxx_timer3_hwmod, |
255 | .clk = "gpt3_ick", | 113 | .clk = "gpt3_ick", |
256 | .addr = omap2xxx_timer3_addrs, | ||
257 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 114 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
258 | }; | 115 | }; |
259 | 116 | ||
@@ -262,7 +119,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer4 = { | |||
262 | .master = &omap2xxx_l4_core_hwmod, | 119 | .master = &omap2xxx_l4_core_hwmod, |
263 | .slave = &omap2xxx_timer4_hwmod, | 120 | .slave = &omap2xxx_timer4_hwmod, |
264 | .clk = "gpt4_ick", | 121 | .clk = "gpt4_ick", |
265 | .addr = omap2xxx_timer4_addrs, | ||
266 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 122 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
267 | }; | 123 | }; |
268 | 124 | ||
@@ -271,7 +127,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer5 = { | |||
271 | .master = &omap2xxx_l4_core_hwmod, | 127 | .master = &omap2xxx_l4_core_hwmod, |
272 | .slave = &omap2xxx_timer5_hwmod, | 128 | .slave = &omap2xxx_timer5_hwmod, |
273 | .clk = "gpt5_ick", | 129 | .clk = "gpt5_ick", |
274 | .addr = omap2xxx_timer5_addrs, | ||
275 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 130 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
276 | }; | 131 | }; |
277 | 132 | ||
@@ -280,7 +135,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer6 = { | |||
280 | .master = &omap2xxx_l4_core_hwmod, | 135 | .master = &omap2xxx_l4_core_hwmod, |
281 | .slave = &omap2xxx_timer6_hwmod, | 136 | .slave = &omap2xxx_timer6_hwmod, |
282 | .clk = "gpt6_ick", | 137 | .clk = "gpt6_ick", |
283 | .addr = omap2xxx_timer6_addrs, | ||
284 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 138 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
285 | }; | 139 | }; |
286 | 140 | ||
@@ -289,7 +143,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer7 = { | |||
289 | .master = &omap2xxx_l4_core_hwmod, | 143 | .master = &omap2xxx_l4_core_hwmod, |
290 | .slave = &omap2xxx_timer7_hwmod, | 144 | .slave = &omap2xxx_timer7_hwmod, |
291 | .clk = "gpt7_ick", | 145 | .clk = "gpt7_ick", |
292 | .addr = omap2xxx_timer7_addrs, | ||
293 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 146 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
294 | }; | 147 | }; |
295 | 148 | ||
@@ -298,7 +151,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer8 = { | |||
298 | .master = &omap2xxx_l4_core_hwmod, | 151 | .master = &omap2xxx_l4_core_hwmod, |
299 | .slave = &omap2xxx_timer8_hwmod, | 152 | .slave = &omap2xxx_timer8_hwmod, |
300 | .clk = "gpt8_ick", | 153 | .clk = "gpt8_ick", |
301 | .addr = omap2xxx_timer8_addrs, | ||
302 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 154 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
303 | }; | 155 | }; |
304 | 156 | ||
@@ -307,7 +159,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer9 = { | |||
307 | .master = &omap2xxx_l4_core_hwmod, | 159 | .master = &omap2xxx_l4_core_hwmod, |
308 | .slave = &omap2xxx_timer9_hwmod, | 160 | .slave = &omap2xxx_timer9_hwmod, |
309 | .clk = "gpt9_ick", | 161 | .clk = "gpt9_ick", |
310 | .addr = omap2xxx_timer9_addrs, | ||
311 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 162 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
312 | }; | 163 | }; |
313 | 164 | ||
@@ -316,7 +167,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer10 = { | |||
316 | .master = &omap2xxx_l4_core_hwmod, | 167 | .master = &omap2xxx_l4_core_hwmod, |
317 | .slave = &omap2xxx_timer10_hwmod, | 168 | .slave = &omap2xxx_timer10_hwmod, |
318 | .clk = "gpt10_ick", | 169 | .clk = "gpt10_ick", |
319 | .addr = omap2_timer10_addrs, | ||
320 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 170 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
321 | }; | 171 | }; |
322 | 172 | ||
@@ -325,7 +175,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer11 = { | |||
325 | .master = &omap2xxx_l4_core_hwmod, | 175 | .master = &omap2xxx_l4_core_hwmod, |
326 | .slave = &omap2xxx_timer11_hwmod, | 176 | .slave = &omap2xxx_timer11_hwmod, |
327 | .clk = "gpt11_ick", | 177 | .clk = "gpt11_ick", |
328 | .addr = omap2_timer11_addrs, | ||
329 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 178 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
330 | }; | 179 | }; |
331 | 180 | ||
@@ -334,7 +183,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__timer12 = { | |||
334 | .master = &omap2xxx_l4_core_hwmod, | 183 | .master = &omap2xxx_l4_core_hwmod, |
335 | .slave = &omap2xxx_timer12_hwmod, | 184 | .slave = &omap2xxx_timer12_hwmod, |
336 | .clk = "gpt12_ick", | 185 | .clk = "gpt12_ick", |
337 | .addr = omap2xxx_timer12_addrs, | ||
338 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 186 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
339 | }; | 187 | }; |
340 | 188 | ||
@@ -348,7 +196,7 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__dss = { | |||
348 | .omap2 = { | 196 | .omap2 = { |
349 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION, | 197 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION, |
350 | .flags = OMAP_FIREWALL_L4, | 198 | .flags = OMAP_FIREWALL_L4, |
351 | } | 199 | }, |
352 | }, | 200 | }, |
353 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 201 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
354 | }; | 202 | }; |
@@ -363,7 +211,7 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_dispc = { | |||
363 | .omap2 = { | 211 | .omap2 = { |
364 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_DISPC_REGION, | 212 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_DISPC_REGION, |
365 | .flags = OMAP_FIREWALL_L4, | 213 | .flags = OMAP_FIREWALL_L4, |
366 | } | 214 | }, |
367 | }, | 215 | }, |
368 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 216 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
369 | }; | 217 | }; |
@@ -378,7 +226,7 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_rfbi = { | |||
378 | .omap2 = { | 226 | .omap2 = { |
379 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION, | 227 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION, |
380 | .flags = OMAP_FIREWALL_L4, | 228 | .flags = OMAP_FIREWALL_L4, |
381 | } | 229 | }, |
382 | }, | 230 | }, |
383 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 231 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
384 | }; | 232 | }; |
@@ -393,7 +241,7 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_venc = { | |||
393 | .omap2 = { | 241 | .omap2 = { |
394 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_VENC_REGION, | 242 | .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_VENC_REGION, |
395 | .flags = OMAP_FIREWALL_L4, | 243 | .flags = OMAP_FIREWALL_L4, |
396 | } | 244 | }, |
397 | }, | 245 | }, |
398 | .flags = OCPIF_SWSUP_IDLE, | 246 | .flags = OCPIF_SWSUP_IDLE, |
399 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 247 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
@@ -404,7 +252,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__rng = { | |||
404 | .master = &omap2xxx_l4_core_hwmod, | 252 | .master = &omap2xxx_l4_core_hwmod, |
405 | .slave = &omap2xxx_rng_hwmod, | 253 | .slave = &omap2xxx_rng_hwmod, |
406 | .clk = "rng_ick", | 254 | .clk = "rng_ick", |
407 | .addr = omap2_rng_addr_space, | ||
408 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 255 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
409 | }; | 256 | }; |
410 | 257 | ||
@@ -413,7 +260,6 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__sham = { | |||
413 | .master = &omap2xxx_l4_core_hwmod, | 260 | .master = &omap2xxx_l4_core_hwmod, |
414 | .slave = &omap2xxx_sham_hwmod, | 261 | .slave = &omap2xxx_sham_hwmod, |
415 | .clk = "sha_ick", | 262 | .clk = "sha_ick", |
416 | .addr = omap2xxx_sham_addrs, | ||
417 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 263 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
418 | }; | 264 | }; |
419 | 265 | ||
@@ -422,6 +268,5 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__aes = { | |||
422 | .master = &omap2xxx_l4_core_hwmod, | 268 | .master = &omap2xxx_l4_core_hwmod, |
423 | .slave = &omap2xxx_aes_hwmod, | 269 | .slave = &omap2xxx_aes_hwmod, |
424 | .clk = "aes_ick", | 270 | .clk = "aes_ick", |
425 | .addr = omap2xxx_aes_addrs, | ||
426 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 271 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
427 | }; | 272 | }; |
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c index 56cebb05509e..8821b9d6bae4 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c | |||
@@ -20,14 +20,9 @@ | |||
20 | #include "prm-regbits-24xx.h" | 20 | #include "prm-regbits-24xx.h" |
21 | #include "wd_timer.h" | 21 | #include "wd_timer.h" |
22 | 22 | ||
23 | struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[] = { | ||
24 | { .irq = 48 + OMAP_INTC_START, }, | ||
25 | { .irq = -1 }, | ||
26 | }; | ||
27 | |||
28 | struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = { | 23 | struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = { |
29 | { .name = "dispc", .dma_req = 5 }, | 24 | { .name = "dispc", .dma_req = 5 }, |
30 | { .dma_req = -1 } | 25 | { .dma_req = -1, }, |
31 | }; | 26 | }; |
32 | 27 | ||
33 | /* | 28 | /* |
@@ -219,14 +214,8 @@ struct omap_hwmod omap2xxx_l4_wkup_hwmod = { | |||
219 | }; | 214 | }; |
220 | 215 | ||
221 | /* MPU */ | 216 | /* MPU */ |
222 | static struct omap_hwmod_irq_info omap2xxx_mpu_irqs[] = { | ||
223 | { .name = "pmu", .irq = 3 + OMAP_INTC_START }, | ||
224 | { .irq = -1 } | ||
225 | }; | ||
226 | |||
227 | struct omap_hwmod omap2xxx_mpu_hwmod = { | 217 | struct omap_hwmod omap2xxx_mpu_hwmod = { |
228 | .name = "mpu", | 218 | .name = "mpu", |
229 | .mpu_irqs = omap2xxx_mpu_irqs, | ||
230 | .class = &mpu_hwmod_class, | 219 | .class = &mpu_hwmod_class, |
231 | .main_clk = "mpu_ck", | 220 | .main_clk = "mpu_ck", |
232 | }; | 221 | }; |
@@ -256,7 +245,6 @@ static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = { | |||
256 | 245 | ||
257 | struct omap_hwmod omap2xxx_timer1_hwmod = { | 246 | struct omap_hwmod omap2xxx_timer1_hwmod = { |
258 | .name = "timer1", | 247 | .name = "timer1", |
259 | .mpu_irqs = omap2_timer1_mpu_irqs, | ||
260 | .main_clk = "gpt1_fck", | 248 | .main_clk = "gpt1_fck", |
261 | .prcm = { | 249 | .prcm = { |
262 | .omap2 = { | 250 | .omap2 = { |
@@ -276,7 +264,6 @@ struct omap_hwmod omap2xxx_timer1_hwmod = { | |||
276 | 264 | ||
277 | struct omap_hwmod omap2xxx_timer2_hwmod = { | 265 | struct omap_hwmod omap2xxx_timer2_hwmod = { |
278 | .name = "timer2", | 266 | .name = "timer2", |
279 | .mpu_irqs = omap2_timer2_mpu_irqs, | ||
280 | .main_clk = "gpt2_fck", | 267 | .main_clk = "gpt2_fck", |
281 | .prcm = { | 268 | .prcm = { |
282 | .omap2 = { | 269 | .omap2 = { |
@@ -295,7 +282,6 @@ struct omap_hwmod omap2xxx_timer2_hwmod = { | |||
295 | 282 | ||
296 | struct omap_hwmod omap2xxx_timer3_hwmod = { | 283 | struct omap_hwmod omap2xxx_timer3_hwmod = { |
297 | .name = "timer3", | 284 | .name = "timer3", |
298 | .mpu_irqs = omap2_timer3_mpu_irqs, | ||
299 | .main_clk = "gpt3_fck", | 285 | .main_clk = "gpt3_fck", |
300 | .prcm = { | 286 | .prcm = { |
301 | .omap2 = { | 287 | .omap2 = { |
@@ -314,7 +300,6 @@ struct omap_hwmod omap2xxx_timer3_hwmod = { | |||
314 | 300 | ||
315 | struct omap_hwmod omap2xxx_timer4_hwmod = { | 301 | struct omap_hwmod omap2xxx_timer4_hwmod = { |
316 | .name = "timer4", | 302 | .name = "timer4", |
317 | .mpu_irqs = omap2_timer4_mpu_irqs, | ||
318 | .main_clk = "gpt4_fck", | 303 | .main_clk = "gpt4_fck", |
319 | .prcm = { | 304 | .prcm = { |
320 | .omap2 = { | 305 | .omap2 = { |
@@ -333,7 +318,6 @@ struct omap_hwmod omap2xxx_timer4_hwmod = { | |||
333 | 318 | ||
334 | struct omap_hwmod omap2xxx_timer5_hwmod = { | 319 | struct omap_hwmod omap2xxx_timer5_hwmod = { |
335 | .name = "timer5", | 320 | .name = "timer5", |
336 | .mpu_irqs = omap2_timer5_mpu_irqs, | ||
337 | .main_clk = "gpt5_fck", | 321 | .main_clk = "gpt5_fck", |
338 | .prcm = { | 322 | .prcm = { |
339 | .omap2 = { | 323 | .omap2 = { |
@@ -353,7 +337,6 @@ struct omap_hwmod omap2xxx_timer5_hwmod = { | |||
353 | 337 | ||
354 | struct omap_hwmod omap2xxx_timer6_hwmod = { | 338 | struct omap_hwmod omap2xxx_timer6_hwmod = { |
355 | .name = "timer6", | 339 | .name = "timer6", |
356 | .mpu_irqs = omap2_timer6_mpu_irqs, | ||
357 | .main_clk = "gpt6_fck", | 340 | .main_clk = "gpt6_fck", |
358 | .prcm = { | 341 | .prcm = { |
359 | .omap2 = { | 342 | .omap2 = { |
@@ -373,7 +356,6 @@ struct omap_hwmod omap2xxx_timer6_hwmod = { | |||
373 | 356 | ||
374 | struct omap_hwmod omap2xxx_timer7_hwmod = { | 357 | struct omap_hwmod omap2xxx_timer7_hwmod = { |
375 | .name = "timer7", | 358 | .name = "timer7", |
376 | .mpu_irqs = omap2_timer7_mpu_irqs, | ||
377 | .main_clk = "gpt7_fck", | 359 | .main_clk = "gpt7_fck", |
378 | .prcm = { | 360 | .prcm = { |
379 | .omap2 = { | 361 | .omap2 = { |
@@ -393,7 +375,6 @@ struct omap_hwmod omap2xxx_timer7_hwmod = { | |||
393 | 375 | ||
394 | struct omap_hwmod omap2xxx_timer8_hwmod = { | 376 | struct omap_hwmod omap2xxx_timer8_hwmod = { |
395 | .name = "timer8", | 377 | .name = "timer8", |
396 | .mpu_irqs = omap2_timer8_mpu_irqs, | ||
397 | .main_clk = "gpt8_fck", | 378 | .main_clk = "gpt8_fck", |
398 | .prcm = { | 379 | .prcm = { |
399 | .omap2 = { | 380 | .omap2 = { |
@@ -413,7 +394,6 @@ struct omap_hwmod omap2xxx_timer8_hwmod = { | |||
413 | 394 | ||
414 | struct omap_hwmod omap2xxx_timer9_hwmod = { | 395 | struct omap_hwmod omap2xxx_timer9_hwmod = { |
415 | .name = "timer9", | 396 | .name = "timer9", |
416 | .mpu_irqs = omap2_timer9_mpu_irqs, | ||
417 | .main_clk = "gpt9_fck", | 397 | .main_clk = "gpt9_fck", |
418 | .prcm = { | 398 | .prcm = { |
419 | .omap2 = { | 399 | .omap2 = { |
@@ -433,7 +413,6 @@ struct omap_hwmod omap2xxx_timer9_hwmod = { | |||
433 | 413 | ||
434 | struct omap_hwmod omap2xxx_timer10_hwmod = { | 414 | struct omap_hwmod omap2xxx_timer10_hwmod = { |
435 | .name = "timer10", | 415 | .name = "timer10", |
436 | .mpu_irqs = omap2_timer10_mpu_irqs, | ||
437 | .main_clk = "gpt10_fck", | 416 | .main_clk = "gpt10_fck", |
438 | .prcm = { | 417 | .prcm = { |
439 | .omap2 = { | 418 | .omap2 = { |
@@ -453,7 +432,6 @@ struct omap_hwmod omap2xxx_timer10_hwmod = { | |||
453 | 432 | ||
454 | struct omap_hwmod omap2xxx_timer11_hwmod = { | 433 | struct omap_hwmod omap2xxx_timer11_hwmod = { |
455 | .name = "timer11", | 434 | .name = "timer11", |
456 | .mpu_irqs = omap2_timer11_mpu_irqs, | ||
457 | .main_clk = "gpt11_fck", | 435 | .main_clk = "gpt11_fck", |
458 | .prcm = { | 436 | .prcm = { |
459 | .omap2 = { | 437 | .omap2 = { |
@@ -473,7 +451,6 @@ struct omap_hwmod omap2xxx_timer11_hwmod = { | |||
473 | 451 | ||
474 | struct omap_hwmod omap2xxx_timer12_hwmod = { | 452 | struct omap_hwmod omap2xxx_timer12_hwmod = { |
475 | .name = "timer12", | 453 | .name = "timer12", |
476 | .mpu_irqs = omap2xxx_timer12_mpu_irqs, | ||
477 | .main_clk = "gpt12_fck", | 454 | .main_clk = "gpt12_fck", |
478 | .prcm = { | 455 | .prcm = { |
479 | .omap2 = { | 456 | .omap2 = { |
@@ -509,8 +486,6 @@ struct omap_hwmod omap2xxx_wd_timer2_hwmod = { | |||
509 | 486 | ||
510 | struct omap_hwmod omap2xxx_uart1_hwmod = { | 487 | struct omap_hwmod omap2xxx_uart1_hwmod = { |
511 | .name = "uart1", | 488 | .name = "uart1", |
512 | .mpu_irqs = omap2_uart1_mpu_irqs, | ||
513 | .sdma_reqs = omap2_uart1_sdma_reqs, | ||
514 | .main_clk = "uart1_fck", | 489 | .main_clk = "uart1_fck", |
515 | .flags = DEBUG_OMAP2UART1_FLAGS | HWMOD_SWSUP_SIDLE_ACT, | 490 | .flags = DEBUG_OMAP2UART1_FLAGS | HWMOD_SWSUP_SIDLE_ACT, |
516 | .prcm = { | 491 | .prcm = { |
@@ -529,8 +504,6 @@ struct omap_hwmod omap2xxx_uart1_hwmod = { | |||
529 | 504 | ||
530 | struct omap_hwmod omap2xxx_uart2_hwmod = { | 505 | struct omap_hwmod omap2xxx_uart2_hwmod = { |
531 | .name = "uart2", | 506 | .name = "uart2", |
532 | .mpu_irqs = omap2_uart2_mpu_irqs, | ||
533 | .sdma_reqs = omap2_uart2_sdma_reqs, | ||
534 | .main_clk = "uart2_fck", | 507 | .main_clk = "uart2_fck", |
535 | .flags = DEBUG_OMAP2UART2_FLAGS | HWMOD_SWSUP_SIDLE_ACT, | 508 | .flags = DEBUG_OMAP2UART2_FLAGS | HWMOD_SWSUP_SIDLE_ACT, |
536 | .prcm = { | 509 | .prcm = { |
@@ -549,8 +522,6 @@ struct omap_hwmod omap2xxx_uart2_hwmod = { | |||
549 | 522 | ||
550 | struct omap_hwmod omap2xxx_uart3_hwmod = { | 523 | struct omap_hwmod omap2xxx_uart3_hwmod = { |
551 | .name = "uart3", | 524 | .name = "uart3", |
552 | .mpu_irqs = omap2_uart3_mpu_irqs, | ||
553 | .sdma_reqs = omap2_uart3_sdma_reqs, | ||
554 | .main_clk = "uart3_fck", | 525 | .main_clk = "uart3_fck", |
555 | .flags = DEBUG_OMAP2UART3_FLAGS | HWMOD_SWSUP_SIDLE_ACT, | 526 | .flags = DEBUG_OMAP2UART3_FLAGS | HWMOD_SWSUP_SIDLE_ACT, |
556 | .prcm = { | 527 | .prcm = { |
@@ -610,7 +581,7 @@ struct omap_hwmod omap2xxx_dss_dispc_hwmod = { | |||
610 | }, | 581 | }, |
611 | }, | 582 | }, |
612 | .flags = HWMOD_NO_IDLEST, | 583 | .flags = HWMOD_NO_IDLEST, |
613 | .dev_attr = &omap2_3_dss_dispc_dev_attr | 584 | .dev_attr = &omap2_3_dss_dispc_dev_attr, |
614 | }; | 585 | }; |
615 | 586 | ||
616 | static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = { | 587 | static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = { |
@@ -657,7 +628,6 @@ struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr = { | |||
657 | struct omap_hwmod omap2xxx_gpio1_hwmod = { | 628 | struct omap_hwmod omap2xxx_gpio1_hwmod = { |
658 | .name = "gpio1", | 629 | .name = "gpio1", |
659 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | 630 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, |
660 | .mpu_irqs = omap2_gpio1_irqs, | ||
661 | .main_clk = "gpios_fck", | 631 | .main_clk = "gpios_fck", |
662 | .prcm = { | 632 | .prcm = { |
663 | .omap2 = { | 633 | .omap2 = { |
@@ -676,7 +646,6 @@ struct omap_hwmod omap2xxx_gpio1_hwmod = { | |||
676 | struct omap_hwmod omap2xxx_gpio2_hwmod = { | 646 | struct omap_hwmod omap2xxx_gpio2_hwmod = { |
677 | .name = "gpio2", | 647 | .name = "gpio2", |
678 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | 648 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, |
679 | .mpu_irqs = omap2_gpio2_irqs, | ||
680 | .main_clk = "gpios_fck", | 649 | .main_clk = "gpios_fck", |
681 | .prcm = { | 650 | .prcm = { |
682 | .omap2 = { | 651 | .omap2 = { |
@@ -695,7 +664,6 @@ struct omap_hwmod omap2xxx_gpio2_hwmod = { | |||
695 | struct omap_hwmod omap2xxx_gpio3_hwmod = { | 664 | struct omap_hwmod omap2xxx_gpio3_hwmod = { |
696 | .name = "gpio3", | 665 | .name = "gpio3", |
697 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | 666 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, |
698 | .mpu_irqs = omap2_gpio3_irqs, | ||
699 | .main_clk = "gpios_fck", | 667 | .main_clk = "gpios_fck", |
700 | .prcm = { | 668 | .prcm = { |
701 | .omap2 = { | 669 | .omap2 = { |
@@ -714,7 +682,6 @@ struct omap_hwmod omap2xxx_gpio3_hwmod = { | |||
714 | struct omap_hwmod omap2xxx_gpio4_hwmod = { | 682 | struct omap_hwmod omap2xxx_gpio4_hwmod = { |
715 | .name = "gpio4", | 683 | .name = "gpio4", |
716 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | 684 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, |
717 | .mpu_irqs = omap2_gpio4_irqs, | ||
718 | .main_clk = "gpios_fck", | 685 | .main_clk = "gpios_fck", |
719 | .prcm = { | 686 | .prcm = { |
720 | .omap2 = { | 687 | .omap2 = { |
@@ -736,8 +703,6 @@ static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = { | |||
736 | 703 | ||
737 | struct omap_hwmod omap2xxx_mcspi1_hwmod = { | 704 | struct omap_hwmod omap2xxx_mcspi1_hwmod = { |
738 | .name = "mcspi1", | 705 | .name = "mcspi1", |
739 | .mpu_irqs = omap2_mcspi1_mpu_irqs, | ||
740 | .sdma_reqs = omap2_mcspi1_sdma_reqs, | ||
741 | .main_clk = "mcspi1_fck", | 706 | .main_clk = "mcspi1_fck", |
742 | .prcm = { | 707 | .prcm = { |
743 | .omap2 = { | 708 | .omap2 = { |
@@ -759,8 +724,6 @@ static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = { | |||
759 | 724 | ||
760 | struct omap_hwmod omap2xxx_mcspi2_hwmod = { | 725 | struct omap_hwmod omap2xxx_mcspi2_hwmod = { |
761 | .name = "mcspi2", | 726 | .name = "mcspi2", |
762 | .mpu_irqs = omap2_mcspi2_mpu_irqs, | ||
763 | .sdma_reqs = omap2_mcspi2_sdma_reqs, | ||
764 | .main_clk = "mcspi2_fck", | 727 | .main_clk = "mcspi2_fck", |
765 | .prcm = { | 728 | .prcm = { |
766 | .omap2 = { | 729 | .omap2 = { |
@@ -795,15 +758,9 @@ struct omap_hwmod omap2xxx_counter_32k_hwmod = { | |||
795 | }; | 758 | }; |
796 | 759 | ||
797 | /* gpmc */ | 760 | /* gpmc */ |
798 | static struct omap_hwmod_irq_info omap2xxx_gpmc_irqs[] = { | ||
799 | { .irq = 20 }, | ||
800 | { .irq = -1 } | ||
801 | }; | ||
802 | |||
803 | struct omap_hwmod omap2xxx_gpmc_hwmod = { | 761 | struct omap_hwmod omap2xxx_gpmc_hwmod = { |
804 | .name = "gpmc", | 762 | .name = "gpmc", |
805 | .class = &omap2xxx_gpmc_hwmod_class, | 763 | .class = &omap2xxx_gpmc_hwmod_class, |
806 | .mpu_irqs = omap2xxx_gpmc_irqs, | ||
807 | .main_clk = "gpmc_fck", | 764 | .main_clk = "gpmc_fck", |
808 | /* | 765 | /* |
809 | * XXX HWMOD_INIT_NO_RESET should not be needed for this IP | 766 | * XXX HWMOD_INIT_NO_RESET should not be needed for this IP |
@@ -840,14 +797,8 @@ static struct omap_hwmod_class omap2_rng_hwmod_class = { | |||
840 | .sysc = &omap2_rng_sysc, | 797 | .sysc = &omap2_rng_sysc, |
841 | }; | 798 | }; |
842 | 799 | ||
843 | static struct omap_hwmod_irq_info omap2_rng_mpu_irqs[] = { | ||
844 | { .irq = 52 }, | ||
845 | { .irq = -1 } | ||
846 | }; | ||
847 | |||
848 | struct omap_hwmod omap2xxx_rng_hwmod = { | 800 | struct omap_hwmod omap2xxx_rng_hwmod = { |
849 | .name = "rng", | 801 | .name = "rng", |
850 | .mpu_irqs = omap2_rng_mpu_irqs, | ||
851 | .main_clk = "l4_ck", | 802 | .main_clk = "l4_ck", |
852 | .prcm = { | 803 | .prcm = { |
853 | .omap2 = { | 804 | .omap2 = { |
@@ -884,20 +835,8 @@ static struct omap_hwmod_class omap2xxx_sham_class = { | |||
884 | .sysc = &omap2_sham_sysc, | 835 | .sysc = &omap2_sham_sysc, |
885 | }; | 836 | }; |
886 | 837 | ||
887 | static struct omap_hwmod_irq_info omap2_sham_mpu_irqs[] = { | ||
888 | { .irq = 51 + OMAP_INTC_START, }, | ||
889 | { .irq = -1 } | ||
890 | }; | ||
891 | |||
892 | static struct omap_hwmod_dma_info omap2_sham_sdma_chs[] = { | ||
893 | { .name = "rx", .dma_req = 13 }, | ||
894 | { .dma_req = -1 } | ||
895 | }; | ||
896 | |||
897 | struct omap_hwmod omap2xxx_sham_hwmod = { | 838 | struct omap_hwmod omap2xxx_sham_hwmod = { |
898 | .name = "sham", | 839 | .name = "sham", |
899 | .mpu_irqs = omap2_sham_mpu_irqs, | ||
900 | .sdma_reqs = omap2_sham_sdma_chs, | ||
901 | .main_clk = "l4_ck", | 840 | .main_clk = "l4_ck", |
902 | .prcm = { | 841 | .prcm = { |
903 | .omap2 = { | 842 | .omap2 = { |
@@ -927,15 +866,8 @@ static struct omap_hwmod_class omap2xxx_aes_class = { | |||
927 | .sysc = &omap2_aes_sysc, | 866 | .sysc = &omap2_aes_sysc, |
928 | }; | 867 | }; |
929 | 868 | ||
930 | static struct omap_hwmod_dma_info omap2_aes_sdma_chs[] = { | ||
931 | { .name = "tx", .dma_req = 9 }, | ||
932 | { .name = "rx", .dma_req = 10 }, | ||
933 | { .dma_req = -1 } | ||
934 | }; | ||
935 | |||
936 | struct omap_hwmod omap2xxx_aes_hwmod = { | 869 | struct omap_hwmod omap2xxx_aes_hwmod = { |
937 | .name = "aes", | 870 | .name = "aes", |
938 | .sdma_reqs = omap2_aes_sdma_chs, | ||
939 | .main_clk = "l4_ck", | 871 | .main_clk = "l4_ck", |
940 | .prcm = { | 872 | .prcm = { |
941 | .omap2 = { | 873 | .omap2 = { |
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.h b/arch/arm/mach-omap2/omap_hwmod_common_data.h index 6e04ff7065e1..2c38c6b0ee03 100644 --- a/arch/arm/mach-omap2/omap_hwmod_common_data.h +++ b/arch/arm/mach-omap2/omap_hwmod_common_data.h | |||
@@ -18,9 +18,6 @@ | |||
18 | #include "common.h" | 18 | #include "common.h" |
19 | #include "display.h" | 19 | #include "display.h" |
20 | 20 | ||
21 | /* Common address space across OMAP2xxx */ | ||
22 | extern struct omap_hwmod_addr_space omap2xxx_mcbsp2_addrs[]; | ||
23 | |||
24 | /* Common address space across OMAP2xxx/3xxx */ | 21 | /* Common address space across OMAP2xxx/3xxx */ |
25 | extern struct omap_hwmod_addr_space omap2_i2c1_addr_space[]; | 22 | extern struct omap_hwmod_addr_space omap2_i2c1_addr_space[]; |
26 | extern struct omap_hwmod_addr_space omap2_i2c2_addr_space[]; | 23 | extern struct omap_hwmod_addr_space omap2_i2c2_addr_space[]; |
@@ -41,8 +38,6 @@ extern struct omap_hwmod_addr_space omap2_mcbsp1_addrs[]; | |||
41 | extern struct omap_hwmod_addr_space omap2_hdq1w_addr_space[]; | 38 | extern struct omap_hwmod_addr_space omap2_hdq1w_addr_space[]; |
42 | 39 | ||
43 | /* Common IP block data across OMAP2xxx */ | 40 | /* Common IP block data across OMAP2xxx */ |
44 | extern struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[]; | ||
45 | extern struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[]; | ||
46 | extern struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr; | 41 | extern struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr; |
47 | extern struct omap_hwmod omap2xxx_l3_main_hwmod; | 42 | extern struct omap_hwmod omap2xxx_l3_main_hwmod; |
48 | extern struct omap_hwmod omap2xxx_l4_core_hwmod; | 43 | extern struct omap_hwmod omap2xxx_l4_core_hwmod; |
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index 10c71450cf63..5aaf720211f4 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <linux/clk.h> | 10 | #include <linux/clk.h> |
11 | #include <linux/davinci_emac.h> | ||
11 | #include <linux/gpio.h> | 12 | #include <linux/gpio.h> |
12 | #include <linux/init.h> | 13 | #include <linux/init.h> |
13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
@@ -16,6 +17,7 @@ | |||
16 | 17 | ||
17 | #include <linux/platform_data/pinctrl-single.h> | 18 | #include <linux/platform_data/pinctrl-single.h> |
18 | 19 | ||
20 | #include "am35xx.h" | ||
19 | #include "common.h" | 21 | #include "common.h" |
20 | #include "common-board-devices.h" | 22 | #include "common-board-devices.h" |
21 | #include "dss-common.h" | 23 | #include "dss-common.h" |
@@ -26,6 +28,9 @@ struct pdata_init { | |||
26 | void (*fn)(void); | 28 | void (*fn)(void); |
27 | }; | 29 | }; |
28 | 30 | ||
31 | struct of_dev_auxdata omap_auxdata_lookup[]; | ||
32 | static struct twl4030_gpio_platform_data twl_gpio_auxdata; | ||
33 | |||
29 | /* | 34 | /* |
30 | * Create alias for USB host PHY clock. | 35 | * Create alias for USB host PHY clock. |
31 | * Remove this when clock phandle can be provided via DT | 36 | * Remove this when clock phandle can be provided via DT |
@@ -68,6 +73,15 @@ static inline void legacy_init_wl12xx(unsigned ref_clock, | |||
68 | } | 73 | } |
69 | #endif | 74 | #endif |
70 | 75 | ||
76 | #ifdef CONFIG_MACH_NOKIA_N8X0 | ||
77 | static void __init omap2420_n8x0_legacy_init(void) | ||
78 | { | ||
79 | omap_auxdata_lookup[0].platform_data = n8x0_legacy_init(); | ||
80 | } | ||
81 | #else | ||
82 | #define omap2420_n8x0_legacy_init NULL | ||
83 | #endif | ||
84 | |||
71 | #ifdef CONFIG_ARCH_OMAP3 | 85 | #ifdef CONFIG_ARCH_OMAP3 |
72 | static void __init hsmmc2_internal_input_clk(void) | 86 | static void __init hsmmc2_internal_input_clk(void) |
73 | { | 87 | { |
@@ -92,6 +106,42 @@ static void __init omap3_zoom_legacy_init(void) | |||
92 | { | 106 | { |
93 | legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162); | 107 | legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162); |
94 | } | 108 | } |
109 | |||
110 | static void am35xx_enable_emac_int(void) | ||
111 | { | ||
112 | u32 v; | ||
113 | |||
114 | v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
115 | v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR | | ||
116 | AM35XX_CPGMAC_C0_MISC_PULSE_CLR | AM35XX_CPGMAC_C0_RX_THRESH_CLR); | ||
117 | omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
118 | omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */ | ||
119 | } | ||
120 | |||
121 | static void am35xx_disable_emac_int(void) | ||
122 | { | ||
123 | u32 v; | ||
124 | |||
125 | v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
126 | v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR); | ||
127 | omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR); | ||
128 | omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */ | ||
129 | } | ||
130 | |||
131 | static struct emac_platform_data am35xx_emac_pdata = { | ||
132 | .interrupt_enable = am35xx_enable_emac_int, | ||
133 | .interrupt_disable = am35xx_disable_emac_int, | ||
134 | }; | ||
135 | |||
136 | static void __init am3517_evm_legacy_init(void) | ||
137 | { | ||
138 | u32 v; | ||
139 | |||
140 | v = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); | ||
141 | v &= ~AM35XX_CPGMACSS_SW_RST; | ||
142 | omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET); | ||
143 | omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */ | ||
144 | } | ||
95 | #endif /* CONFIG_ARCH_OMAP3 */ | 145 | #endif /* CONFIG_ARCH_OMAP3 */ |
96 | 146 | ||
97 | #ifdef CONFIG_ARCH_OMAP4 | 147 | #ifdef CONFIG_ARCH_OMAP4 |
@@ -125,10 +175,45 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void)) | |||
125 | pcs_pdata.rearm = rearm; | 175 | pcs_pdata.rearm = rearm; |
126 | } | 176 | } |
127 | 177 | ||
178 | /* | ||
179 | * GPIOs for TWL are initialized by the I2C bus and need custom | ||
180 | * handing until DSS has device tree bindings. | ||
181 | */ | ||
182 | void omap_auxdata_legacy_init(struct device *dev) | ||
183 | { | ||
184 | if (dev->platform_data) | ||
185 | return; | ||
186 | |||
187 | if (strcmp("twl4030-gpio", dev_name(dev))) | ||
188 | return; | ||
189 | |||
190 | dev->platform_data = &twl_gpio_auxdata; | ||
191 | } | ||
192 | |||
193 | /* | ||
194 | * Few boards still need auxdata populated before we populate | ||
195 | * the dev entries in of_platform_populate(). | ||
196 | */ | ||
197 | static struct pdata_init auxdata_quirks[] __initdata = { | ||
198 | #ifdef CONFIG_SOC_OMAP2420 | ||
199 | { "nokia,n800", omap2420_n8x0_legacy_init, }, | ||
200 | { "nokia,n810", omap2420_n8x0_legacy_init, }, | ||
201 | { "nokia,n810-wimax", omap2420_n8x0_legacy_init, }, | ||
202 | #endif | ||
203 | { /* sentinel */ }, | ||
204 | }; | ||
205 | |||
128 | struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { | 206 | struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { |
207 | #ifdef CONFIG_MACH_NOKIA_N8X0 | ||
208 | OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL), | ||
209 | #endif | ||
129 | #ifdef CONFIG_ARCH_OMAP3 | 210 | #ifdef CONFIG_ARCH_OMAP3 |
130 | OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), | 211 | OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), |
131 | OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata), | 212 | OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata), |
213 | /* Only on am3517 */ | ||
214 | OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL), | ||
215 | OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0", | ||
216 | &am35xx_emac_pdata), | ||
132 | #endif | 217 | #endif |
133 | #ifdef CONFIG_ARCH_OMAP4 | 218 | #ifdef CONFIG_ARCH_OMAP4 |
134 | OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata), | 219 | OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata), |
@@ -137,13 +222,19 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { | |||
137 | { /* sentinel */ }, | 222 | { /* sentinel */ }, |
138 | }; | 223 | }; |
139 | 224 | ||
225 | /* | ||
226 | * Few boards still need to initialize some legacy devices with | ||
227 | * platform data until the drivers support device tree. | ||
228 | */ | ||
140 | static struct pdata_init pdata_quirks[] __initdata = { | 229 | static struct pdata_init pdata_quirks[] __initdata = { |
141 | #ifdef CONFIG_ARCH_OMAP3 | 230 | #ifdef CONFIG_ARCH_OMAP3 |
231 | { "nokia,omap3-n900", hsmmc2_internal_input_clk, }, | ||
142 | { "nokia,omap3-n9", hsmmc2_internal_input_clk, }, | 232 | { "nokia,omap3-n9", hsmmc2_internal_input_clk, }, |
143 | { "nokia,omap3-n950", hsmmc2_internal_input_clk, }, | 233 | { "nokia,omap3-n950", hsmmc2_internal_input_clk, }, |
144 | { "isee,omap3-igep0020", omap3_igep0020_legacy_init, }, | 234 | { "isee,omap3-igep0020", omap3_igep0020_legacy_init, }, |
145 | { "ti,omap3-evm-37xx", omap3_evm_legacy_init, }, | 235 | { "ti,omap3-evm-37xx", omap3_evm_legacy_init, }, |
146 | { "ti,omap3-zoom3", omap3_zoom_legacy_init, }, | 236 | { "ti,omap3-zoom3", omap3_zoom_legacy_init, }, |
237 | { "ti,am3517-evm", am3517_evm_legacy_init, }, | ||
147 | #endif | 238 | #endif |
148 | #ifdef CONFIG_ARCH_OMAP4 | 239 | #ifdef CONFIG_ARCH_OMAP4 |
149 | { "ti,omap4-sdp", omap4_sdp_legacy_init, }, | 240 | { "ti,omap4-sdp", omap4_sdp_legacy_init, }, |
@@ -155,14 +246,8 @@ static struct pdata_init pdata_quirks[] __initdata = { | |||
155 | { /* sentinel */ }, | 246 | { /* sentinel */ }, |
156 | }; | 247 | }; |
157 | 248 | ||
158 | void __init pdata_quirks_init(struct of_device_id *omap_dt_match_table) | 249 | static void pdata_quirks_check(struct pdata_init *quirks) |
159 | { | 250 | { |
160 | struct pdata_init *quirks = pdata_quirks; | ||
161 | |||
162 | omap_sdrc_init(NULL, NULL); | ||
163 | of_platform_populate(NULL, omap_dt_match_table, | ||
164 | omap_auxdata_lookup, NULL); | ||
165 | |||
166 | while (quirks->compatible) { | 251 | while (quirks->compatible) { |
167 | if (of_machine_is_compatible(quirks->compatible)) { | 252 | if (of_machine_is_compatible(quirks->compatible)) { |
168 | if (quirks->fn) | 253 | if (quirks->fn) |
@@ -172,3 +257,12 @@ void __init pdata_quirks_init(struct of_device_id *omap_dt_match_table) | |||
172 | quirks++; | 257 | quirks++; |
173 | } | 258 | } |
174 | } | 259 | } |
260 | |||
261 | void __init pdata_quirks_init(struct of_device_id *omap_dt_match_table) | ||
262 | { | ||
263 | omap_sdrc_init(NULL, NULL); | ||
264 | pdata_quirks_check(auxdata_quirks); | ||
265 | of_platform_populate(NULL, omap_dt_match_table, | ||
266 | omap_auxdata_lookup, NULL); | ||
267 | pdata_quirks_check(pdata_quirks); | ||
268 | } | ||
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 93b80e5da8d4..1f3770a8a728 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -120,7 +120,7 @@ static void omap3_save_secure_ram_context(void) | |||
120 | * will hang the system. | 120 | * will hang the system. |
121 | */ | 121 | */ |
122 | pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); | 122 | pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); |
123 | ret = _omap_save_secure_sram((u32 *) | 123 | ret = _omap_save_secure_sram((u32 *)(unsigned long) |
124 | __pa(omap3_secure_ram_storage)); | 124 | __pa(omap3_secure_ram_storage)); |
125 | pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state); | 125 | pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state); |
126 | /* Following is for error tracking, it should not happen */ | 126 | /* Following is for error tracking, it should not happen */ |
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index e233dfcbc186..93a2a6e4260f 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -128,7 +128,8 @@ skip_voltdm: | |||
128 | for (i = 0; i < pwrdm->banks; i++) | 128 | for (i = 0; i < pwrdm->banks; i++) |
129 | pwrdm->ret_mem_off_counter[i] = 0; | 129 | pwrdm->ret_mem_off_counter[i] = 0; |
130 | 130 | ||
131 | arch_pwrdm->pwrdm_wait_transition(pwrdm); | 131 | if (arch_pwrdm && arch_pwrdm->pwrdm_wait_transition) |
132 | arch_pwrdm->pwrdm_wait_transition(pwrdm); | ||
132 | pwrdm->state = pwrdm_read_pwrst(pwrdm); | 133 | pwrdm->state = pwrdm_read_pwrst(pwrdm); |
133 | pwrdm->state_counter[pwrdm->state] = 1; | 134 | pwrdm->state_counter[pwrdm->state] = 1; |
134 | 135 | ||
diff --git a/arch/arm/mach-omap2/prm44xx_54xx.h b/arch/arm/mach-omap2/prm44xx_54xx.h index 7a976065e138..8d95aa543ef5 100644 --- a/arch/arm/mach-omap2/prm44xx_54xx.h +++ b/arch/arm/mach-omap2/prm44xx_54xx.h | |||
@@ -43,7 +43,7 @@ extern void omap4_prm_vcvp_write(u32 val, u8 offset); | |||
43 | extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); | 43 | extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); |
44 | 44 | ||
45 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ | 45 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ |
46 | defined(CONFIG_SOC_DRA7XX) | 46 | defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX) |
47 | void omap44xx_prm_reconfigure_io_chain(void); | 47 | void omap44xx_prm_reconfigure_io_chain(void); |
48 | #else | 48 | #else |
49 | static inline void omap44xx_prm_reconfigure_io_chain(void) | 49 | static inline void omap44xx_prm_reconfigure_io_chain(void) |
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig index 037100a1563a..aee77f06f887 100644 --- a/arch/arm/mach-socfpga/Kconfig +++ b/arch/arm/mach-socfpga/Kconfig | |||
@@ -10,6 +10,7 @@ config ARCH_SOCFPGA | |||
10 | select GENERIC_CLOCKEVENTS | 10 | select GENERIC_CLOCKEVENTS |
11 | select GPIO_PL061 if GPIOLIB | 11 | select GPIO_PL061 if GPIOLIB |
12 | select HAVE_ARM_SCU | 12 | select HAVE_ARM_SCU |
13 | select HAVE_ARM_TWD if SMP | ||
13 | select HAVE_SMP | 14 | select HAVE_SMP |
14 | select MFD_SYSCON | 15 | select MFD_SYSCON |
15 | select SPARSE_IRQ | 16 | select SPARSE_IRQ |
diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c index d4639c506622..9a4e910c3796 100644 --- a/arch/arm/mach-tegra/fuse.c +++ b/arch/arm/mach-tegra/fuse.c | |||
@@ -209,13 +209,3 @@ void __init tegra_init_fuse(void) | |||
209 | tegra_sku_id, tegra_cpu_process_id, | 209 | tegra_sku_id, tegra_cpu_process_id, |
210 | tegra_core_process_id); | 210 | tegra_core_process_id); |
211 | } | 211 | } |
212 | |||
213 | unsigned long long tegra_chip_uid(void) | ||
214 | { | ||
215 | unsigned long long lo, hi; | ||
216 | |||
217 | lo = tegra_fuse_readl(FUSE_UID_LOW); | ||
218 | hi = tegra_fuse_readl(FUSE_UID_HIGH); | ||
219 | return (hi << 32ull) | lo; | ||
220 | } | ||
221 | EXPORT_SYMBOL(tegra_chip_uid); | ||
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 2e85c1e72535..12c7e5c03ea4 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
@@ -140,6 +140,10 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { | |||
140 | /* Requires call-back bindings. */ | 140 | /* Requires call-back bindings. */ |
141 | OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata), | 141 | OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata), |
142 | /* Requires DMA bindings. */ | 142 | /* Requires DMA bindings. */ |
143 | OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data), | ||
144 | OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data), | ||
145 | OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2", &mop500_sdi2_data), | ||
146 | OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data), | ||
143 | OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000, | 147 | OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000, |
144 | "ux500-msp-i2s.0", &msp0_platform_data), | 148 | "ux500-msp-i2s.0", &msp0_platform_data), |
145 | OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000, | 149 | OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000, |
diff --git a/arch/arm/mach-vexpress/spc.c b/arch/arm/mach-vexpress/spc.c index 033d34dcbd3f..c26ef5b92ca7 100644 --- a/arch/arm/mach-vexpress/spc.c +++ b/arch/arm/mach-vexpress/spc.c | |||
@@ -53,6 +53,11 @@ | |||
53 | #define A15_BX_ADDR0 0x68 | 53 | #define A15_BX_ADDR0 0x68 |
54 | #define A7_BX_ADDR0 0x78 | 54 | #define A7_BX_ADDR0 0x78 |
55 | 55 | ||
56 | /* SPC CPU/cluster reset statue */ | ||
57 | #define STANDBYWFI_STAT 0x3c | ||
58 | #define STANDBYWFI_STAT_A15_CPU_MASK(cpu) (1 << (cpu)) | ||
59 | #define STANDBYWFI_STAT_A7_CPU_MASK(cpu) (1 << (3 + (cpu))) | ||
60 | |||
56 | /* SPC system config interface registers */ | 61 | /* SPC system config interface registers */ |
57 | #define SYSCFG_WDATA 0x70 | 62 | #define SYSCFG_WDATA 0x70 |
58 | #define SYSCFG_RDATA 0x74 | 63 | #define SYSCFG_RDATA 0x74 |
@@ -213,6 +218,41 @@ void ve_spc_powerdown(u32 cluster, bool enable) | |||
213 | writel_relaxed(enable, info->baseaddr + pwdrn_reg); | 218 | writel_relaxed(enable, info->baseaddr + pwdrn_reg); |
214 | } | 219 | } |
215 | 220 | ||
221 | static u32 standbywfi_cpu_mask(u32 cpu, u32 cluster) | ||
222 | { | ||
223 | return cluster_is_a15(cluster) ? | ||
224 | STANDBYWFI_STAT_A15_CPU_MASK(cpu) | ||
225 | : STANDBYWFI_STAT_A7_CPU_MASK(cpu); | ||
226 | } | ||
227 | |||
228 | /** | ||
229 | * ve_spc_cpu_in_wfi(u32 cpu, u32 cluster) | ||
230 | * | ||
231 | * @cpu: mpidr[7:0] bitfield describing CPU affinity level within cluster | ||
232 | * @cluster: mpidr[15:8] bitfield describing cluster affinity level | ||
233 | * | ||
234 | * @return: non-zero if and only if the specified CPU is in WFI | ||
235 | * | ||
236 | * Take care when interpreting the result of this function: a CPU might | ||
237 | * be in WFI temporarily due to idle, and is not necessarily safely | ||
238 | * parked. | ||
239 | */ | ||
240 | int ve_spc_cpu_in_wfi(u32 cpu, u32 cluster) | ||
241 | { | ||
242 | int ret; | ||
243 | u32 mask = standbywfi_cpu_mask(cpu, cluster); | ||
244 | |||
245 | if (cluster >= MAX_CLUSTERS) | ||
246 | return 1; | ||
247 | |||
248 | ret = readl_relaxed(info->baseaddr + STANDBYWFI_STAT); | ||
249 | |||
250 | pr_debug("%s: PCFGREG[0x%X] = 0x%08X, mask = 0x%X\n", | ||
251 | __func__, STANDBYWFI_STAT, ret, mask); | ||
252 | |||
253 | return ret & mask; | ||
254 | } | ||
255 | |||
216 | static int ve_spc_get_performance(int cluster, u32 *freq) | 256 | static int ve_spc_get_performance(int cluster, u32 *freq) |
217 | { | 257 | { |
218 | struct ve_spc_opp *opps = info->opps[cluster]; | 258 | struct ve_spc_opp *opps = info->opps[cluster]; |
diff --git a/arch/arm/mach-vexpress/spc.h b/arch/arm/mach-vexpress/spc.h index dbd44c3720f9..793d065243b9 100644 --- a/arch/arm/mach-vexpress/spc.h +++ b/arch/arm/mach-vexpress/spc.h | |||
@@ -20,5 +20,6 @@ void ve_spc_global_wakeup_irq(bool set); | |||
20 | void ve_spc_cpu_wakeup_irq(u32 cluster, u32 cpu, bool set); | 20 | void ve_spc_cpu_wakeup_irq(u32 cluster, u32 cpu, bool set); |
21 | void ve_spc_set_resume_addr(u32 cluster, u32 cpu, u32 addr); | 21 | void ve_spc_set_resume_addr(u32 cluster, u32 cpu, u32 addr); |
22 | void ve_spc_powerdown(u32 cluster, bool enable); | 22 | void ve_spc_powerdown(u32 cluster, bool enable); |
23 | int ve_spc_cpu_in_wfi(u32 cpu, u32 cluster); | ||
23 | 24 | ||
24 | #endif | 25 | #endif |
diff --git a/arch/arm/mach-vexpress/tc2_pm.c b/arch/arm/mach-vexpress/tc2_pm.c index 05a364c5077a..29e7785a54bc 100644 --- a/arch/arm/mach-vexpress/tc2_pm.c +++ b/arch/arm/mach-vexpress/tc2_pm.c | |||
@@ -12,6 +12,7 @@ | |||
12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/delay.h> | ||
15 | #include <linux/init.h> | 16 | #include <linux/init.h> |
16 | #include <linux/io.h> | 17 | #include <linux/io.h> |
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
@@ -32,11 +33,17 @@ | |||
32 | #include "spc.h" | 33 | #include "spc.h" |
33 | 34 | ||
34 | /* SCC conf registers */ | 35 | /* SCC conf registers */ |
36 | #define RESET_CTRL 0x018 | ||
37 | #define RESET_A15_NCORERESET(cpu) (1 << (2 + (cpu))) | ||
38 | #define RESET_A7_NCORERESET(cpu) (1 << (16 + (cpu))) | ||
39 | |||
35 | #define A15_CONF 0x400 | 40 | #define A15_CONF 0x400 |
36 | #define A7_CONF 0x500 | 41 | #define A7_CONF 0x500 |
37 | #define SYS_INFO 0x700 | 42 | #define SYS_INFO 0x700 |
38 | #define SPC_BASE 0xb00 | 43 | #define SPC_BASE 0xb00 |
39 | 44 | ||
45 | static void __iomem *scc; | ||
46 | |||
40 | /* | 47 | /* |
41 | * We can't use regular spinlocks. In the switcher case, it is possible | 48 | * We can't use regular spinlocks. In the switcher case, it is possible |
42 | * for an outbound CPU to call power_down() after its inbound counterpart | 49 | * for an outbound CPU to call power_down() after its inbound counterpart |
@@ -190,6 +197,55 @@ static void tc2_pm_power_down(void) | |||
190 | tc2_pm_down(0); | 197 | tc2_pm_down(0); |
191 | } | 198 | } |
192 | 199 | ||
200 | static int tc2_core_in_reset(unsigned int cpu, unsigned int cluster) | ||
201 | { | ||
202 | u32 mask = cluster ? | ||
203 | RESET_A7_NCORERESET(cpu) | ||
204 | : RESET_A15_NCORERESET(cpu); | ||
205 | |||
206 | return !(readl_relaxed(scc + RESET_CTRL) & mask); | ||
207 | } | ||
208 | |||
209 | #define POLL_MSEC 10 | ||
210 | #define TIMEOUT_MSEC 1000 | ||
211 | |||
212 | static int tc2_pm_power_down_finish(unsigned int cpu, unsigned int cluster) | ||
213 | { | ||
214 | unsigned tries; | ||
215 | |||
216 | pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster); | ||
217 | BUG_ON(cluster >= TC2_CLUSTERS || cpu >= TC2_MAX_CPUS_PER_CLUSTER); | ||
218 | |||
219 | for (tries = 0; tries < TIMEOUT_MSEC / POLL_MSEC; ++tries) { | ||
220 | /* | ||
221 | * Only examine the hardware state if the target CPU has | ||
222 | * caught up at least as far as tc2_pm_down(): | ||
223 | */ | ||
224 | if (ACCESS_ONCE(tc2_pm_use_count[cpu][cluster]) == 0) { | ||
225 | pr_debug("%s(cpu=%u, cluster=%u): RESET_CTRL = 0x%08X\n", | ||
226 | __func__, cpu, cluster, | ||
227 | readl_relaxed(scc + RESET_CTRL)); | ||
228 | |||
229 | /* | ||
230 | * We need the CPU to reach WFI, but the power | ||
231 | * controller may put the cluster in reset and | ||
232 | * power it off as soon as that happens, before | ||
233 | * we have a chance to see STANDBYWFI. | ||
234 | * | ||
235 | * So we need to check for both conditions: | ||
236 | */ | ||
237 | if (tc2_core_in_reset(cpu, cluster) || | ||
238 | ve_spc_cpu_in_wfi(cpu, cluster)) | ||
239 | return 0; /* success: the CPU is halted */ | ||
240 | } | ||
241 | |||
242 | /* Otherwise, wait and retry: */ | ||
243 | msleep(POLL_MSEC); | ||
244 | } | ||
245 | |||
246 | return -ETIMEDOUT; /* timeout */ | ||
247 | } | ||
248 | |||
193 | static void tc2_pm_suspend(u64 residency) | 249 | static void tc2_pm_suspend(u64 residency) |
194 | { | 250 | { |
195 | unsigned int mpidr, cpu, cluster; | 251 | unsigned int mpidr, cpu, cluster; |
@@ -232,10 +288,11 @@ static void tc2_pm_powered_up(void) | |||
232 | } | 288 | } |
233 | 289 | ||
234 | static const struct mcpm_platform_ops tc2_pm_power_ops = { | 290 | static const struct mcpm_platform_ops tc2_pm_power_ops = { |
235 | .power_up = tc2_pm_power_up, | 291 | .power_up = tc2_pm_power_up, |
236 | .power_down = tc2_pm_power_down, | 292 | .power_down = tc2_pm_power_down, |
237 | .suspend = tc2_pm_suspend, | 293 | .power_down_finish = tc2_pm_power_down_finish, |
238 | .powered_up = tc2_pm_powered_up, | 294 | .suspend = tc2_pm_suspend, |
295 | .powered_up = tc2_pm_powered_up, | ||
239 | }; | 296 | }; |
240 | 297 | ||
241 | static bool __init tc2_pm_usage_count_init(void) | 298 | static bool __init tc2_pm_usage_count_init(void) |
@@ -269,7 +326,6 @@ static void __naked tc2_pm_power_up_setup(unsigned int affinity_level) | |||
269 | static int __init tc2_pm_init(void) | 326 | static int __init tc2_pm_init(void) |
270 | { | 327 | { |
271 | int ret, irq; | 328 | int ret, irq; |
272 | void __iomem *scc; | ||
273 | u32 a15_cluster_id, a7_cluster_id, sys_info; | 329 | u32 a15_cluster_id, a7_cluster_id, sys_info; |
274 | struct device_node *np; | 330 | struct device_node *np; |
275 | 331 | ||
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 79f8b39801a8..f6b6bfa88ecf 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * | 9 | * |
10 | * DMA uncached mapping support. | 10 | * DMA uncached mapping support. |
11 | */ | 11 | */ |
12 | #include <linux/bootmem.h> | ||
12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
13 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
14 | #include <linux/gfp.h> | 15 | #include <linux/gfp.h> |
@@ -162,6 +163,8 @@ static u64 get_coherent_dma_mask(struct device *dev) | |||
162 | u64 mask = (u64)DMA_BIT_MASK(32); | 163 | u64 mask = (u64)DMA_BIT_MASK(32); |
163 | 164 | ||
164 | if (dev) { | 165 | if (dev) { |
166 | unsigned long max_dma_pfn; | ||
167 | |||
165 | mask = dev->coherent_dma_mask; | 168 | mask = dev->coherent_dma_mask; |
166 | 169 | ||
167 | /* | 170 | /* |
@@ -173,6 +176,8 @@ static u64 get_coherent_dma_mask(struct device *dev) | |||
173 | return 0; | 176 | return 0; |
174 | } | 177 | } |
175 | 178 | ||
179 | max_dma_pfn = min(max_pfn, arm_dma_pfn_limit); | ||
180 | |||
176 | /* | 181 | /* |
177 | * If the mask allows for more memory than we can address, | 182 | * If the mask allows for more memory than we can address, |
178 | * and we actually have that much memory, then fail the | 183 | * and we actually have that much memory, then fail the |
@@ -180,7 +185,7 @@ static u64 get_coherent_dma_mask(struct device *dev) | |||
180 | */ | 185 | */ |
181 | if (sizeof(mask) != sizeof(dma_addr_t) && | 186 | if (sizeof(mask) != sizeof(dma_addr_t) && |
182 | mask > (dma_addr_t)~0 && | 187 | mask > (dma_addr_t)~0 && |
183 | dma_to_pfn(dev, ~0) > arm_dma_pfn_limit) { | 188 | dma_to_pfn(dev, ~0) > max_dma_pfn) { |
184 | dev_warn(dev, "Coherent DMA mask %#llx is larger than dma_addr_t allows\n", | 189 | dev_warn(dev, "Coherent DMA mask %#llx is larger than dma_addr_t allows\n", |
185 | mask); | 190 | mask); |
186 | dev_warn(dev, "Driver did not use or check the return value from dma_set_coherent_mask()?\n"); | 191 | dev_warn(dev, "Driver did not use or check the return value from dma_set_coherent_mask()?\n"); |
@@ -192,7 +197,7 @@ static u64 get_coherent_dma_mask(struct device *dev) | |||
192 | * fits within the allowable addresses which we can | 197 | * fits within the allowable addresses which we can |
193 | * allocate. | 198 | * allocate. |
194 | */ | 199 | */ |
195 | if (dma_to_pfn(dev, mask) < arm_dma_pfn_limit) { | 200 | if (dma_to_pfn(dev, mask) < max_dma_pfn) { |
196 | dev_warn(dev, "Coherent DMA mask %#llx (pfn %#lx-%#lx) covers a smaller range of system memory than the DMA zone pfn 0x0-%#lx\n", | 201 | dev_warn(dev, "Coherent DMA mask %#llx (pfn %#lx-%#lx) covers a smaller range of system memory than the DMA zone pfn 0x0-%#lx\n", |
197 | mask, | 202 | mask, |
198 | dma_to_pfn(dev, 0), dma_to_pfn(dev, mask) + 1, | 203 | dma_to_pfn(dev, 0), dma_to_pfn(dev, mask) + 1, |
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index d27158c38eb0..5e85ed371364 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c | |||
@@ -146,7 +146,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, | |||
146 | 146 | ||
147 | info.flags = VM_UNMAPPED_AREA_TOPDOWN; | 147 | info.flags = VM_UNMAPPED_AREA_TOPDOWN; |
148 | info.length = len; | 148 | info.length = len; |
149 | info.low_limit = PAGE_SIZE; | 149 | info.low_limit = FIRST_USER_ADDRESS; |
150 | info.high_limit = mm->mmap_base; | 150 | info.high_limit = mm->mmap_base; |
151 | info.align_mask = do_align ? (PAGE_MASK & (SHMLBA - 1)) : 0; | 151 | info.align_mask = do_align ? (PAGE_MASK & (SHMLBA - 1)) : 0; |
152 | info.align_offset = pgoff << PAGE_SHIFT; | 152 | info.align_offset = pgoff << PAGE_SHIFT; |
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c index 0acb089d0f70..1046b373d1ae 100644 --- a/arch/arm/mm/pgd.c +++ b/arch/arm/mm/pgd.c | |||
@@ -87,7 +87,8 @@ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
87 | init_pud = pud_offset(init_pgd, 0); | 87 | init_pud = pud_offset(init_pgd, 0); |
88 | init_pmd = pmd_offset(init_pud, 0); | 88 | init_pmd = pmd_offset(init_pud, 0); |
89 | init_pte = pte_offset_map(init_pmd, 0); | 89 | init_pte = pte_offset_map(init_pmd, 0); |
90 | set_pte_ext(new_pte, *init_pte, 0); | 90 | set_pte_ext(new_pte + 0, init_pte[0], 0); |
91 | set_pte_ext(new_pte + 1, init_pte[1], 0); | ||
91 | pte_unmap(init_pte); | 92 | pte_unmap(init_pte); |
92 | pte_unmap(new_pte); | 93 | pte_unmap(new_pte); |
93 | } | 94 | } |
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h index fb92abb91628..2861b155485a 100644 --- a/arch/arm/plat-omap/include/plat/dmtimer.h +++ b/arch/arm/plat-omap/include/plat/dmtimer.h | |||
@@ -336,8 +336,11 @@ static inline void __omap_dm_timer_enable_posted(struct omap_dm_timer *timer) | |||
336 | if (timer->posted) | 336 | if (timer->posted) |
337 | return; | 337 | return; |
338 | 338 | ||
339 | if (timer->errata & OMAP_TIMER_ERRATA_I103_I767) | 339 | if (timer->errata & OMAP_TIMER_ERRATA_I103_I767) { |
340 | timer->posted = OMAP_TIMER_NONPOSTED; | ||
341 | __omap_dm_timer_write(timer, OMAP_TIMER_IF_CTRL_REG, 0, 0); | ||
340 | return; | 342 | return; |
343 | } | ||
341 | 344 | ||
342 | __omap_dm_timer_write(timer, OMAP_TIMER_IF_CTRL_REG, | 345 | __omap_dm_timer_write(timer, OMAP_TIMER_IF_CTRL_REG, |
343 | OMAP_TIMER_CTRL_POSTED, 0); | 346 | OMAP_TIMER_CTRL_POSTED, 0); |
diff --git a/arch/arm/xen/p2m.c b/arch/arm/xen/p2m.c index 23732cdff551..b31ee1b275b0 100644 --- a/arch/arm/xen/p2m.c +++ b/arch/arm/xen/p2m.c | |||
@@ -25,8 +25,9 @@ struct xen_p2m_entry { | |||
25 | struct rb_node rbnode_phys; | 25 | struct rb_node rbnode_phys; |
26 | }; | 26 | }; |
27 | 27 | ||
28 | rwlock_t p2m_lock; | 28 | static rwlock_t p2m_lock; |
29 | struct rb_root phys_to_mach = RB_ROOT; | 29 | struct rb_root phys_to_mach = RB_ROOT; |
30 | EXPORT_SYMBOL_GPL(phys_to_mach); | ||
30 | static struct rb_root mach_to_phys = RB_ROOT; | 31 | static struct rb_root mach_to_phys = RB_ROOT; |
31 | 32 | ||
32 | static int xen_add_phys_to_mach_entry(struct xen_p2m_entry *new) | 33 | static int xen_add_phys_to_mach_entry(struct xen_p2m_entry *new) |
@@ -200,7 +201,7 @@ bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn) | |||
200 | } | 201 | } |
201 | EXPORT_SYMBOL_GPL(__set_phys_to_machine); | 202 | EXPORT_SYMBOL_GPL(__set_phys_to_machine); |
202 | 203 | ||
203 | int p2m_init(void) | 204 | static int p2m_init(void) |
204 | { | 205 | { |
205 | rwlock_init(&p2m_lock); | 206 | rwlock_init(&p2m_lock); |
206 | return 0; | 207 | return 0; |
diff --git a/arch/arm64/boot/dts/foundation-v8.dts b/arch/arm64/boot/dts/foundation-v8.dts index 84fcc5018284..519c4b2c0687 100644 --- a/arch/arm64/boot/dts/foundation-v8.dts +++ b/arch/arm64/boot/dts/foundation-v8.dts | |||
@@ -6,6 +6,8 @@ | |||
6 | 6 | ||
7 | /dts-v1/; | 7 | /dts-v1/; |
8 | 8 | ||
9 | /memreserve/ 0x80000000 0x00010000; | ||
10 | |||
9 | / { | 11 | / { |
10 | model = "Foundation-v8A"; | 12 | model = "Foundation-v8A"; |
11 | compatible = "arm,foundation-aarch64", "arm,vexpress"; | 13 | compatible = "arm,foundation-aarch64", "arm,vexpress"; |
diff --git a/arch/arm64/include/asm/irqflags.h b/arch/arm64/include/asm/irqflags.h index aa11943b8502..b2fcfbc51ecc 100644 --- a/arch/arm64/include/asm/irqflags.h +++ b/arch/arm64/include/asm/irqflags.h | |||
@@ -56,6 +56,9 @@ static inline void arch_local_irq_disable(void) | |||
56 | #define local_fiq_enable() asm("msr daifclr, #1" : : : "memory") | 56 | #define local_fiq_enable() asm("msr daifclr, #1" : : : "memory") |
57 | #define local_fiq_disable() asm("msr daifset, #1" : : : "memory") | 57 | #define local_fiq_disable() asm("msr daifset, #1" : : : "memory") |
58 | 58 | ||
59 | #define local_async_enable() asm("msr daifclr, #4" : : : "memory") | ||
60 | #define local_async_disable() asm("msr daifset, #4" : : : "memory") | ||
61 | |||
59 | /* | 62 | /* |
60 | * Save the current interrupt enable state. | 63 | * Save the current interrupt enable state. |
61 | */ | 64 | */ |
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 17bd3af0a117..7f2b60affbb4 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
@@ -25,10 +25,11 @@ | |||
25 | * Software defined PTE bits definition. | 25 | * Software defined PTE bits definition. |
26 | */ | 26 | */ |
27 | #define PTE_VALID (_AT(pteval_t, 1) << 0) | 27 | #define PTE_VALID (_AT(pteval_t, 1) << 0) |
28 | #define PTE_PROT_NONE (_AT(pteval_t, 1) << 2) /* only when !PTE_VALID */ | 28 | #define PTE_FILE (_AT(pteval_t, 1) << 2) /* only when !pte_present() */ |
29 | #define PTE_FILE (_AT(pteval_t, 1) << 3) /* only when !pte_present() */ | ||
30 | #define PTE_DIRTY (_AT(pteval_t, 1) << 55) | 29 | #define PTE_DIRTY (_AT(pteval_t, 1) << 55) |
31 | #define PTE_SPECIAL (_AT(pteval_t, 1) << 56) | 30 | #define PTE_SPECIAL (_AT(pteval_t, 1) << 56) |
31 | /* bit 57 for PMD_SECT_SPLITTING */ | ||
32 | #define PTE_PROT_NONE (_AT(pteval_t, 1) << 58) /* only when !PTE_VALID */ | ||
32 | 33 | ||
33 | /* | 34 | /* |
34 | * VMALLOC and SPARSEMEM_VMEMMAP ranges. | 35 | * VMALLOC and SPARSEMEM_VMEMMAP ranges. |
@@ -254,7 +255,7 @@ static inline int has_transparent_hugepage(void) | |||
254 | #define pgprot_noncached(prot) \ | 255 | #define pgprot_noncached(prot) \ |
255 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE)) | 256 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE)) |
256 | #define pgprot_writecombine(prot) \ | 257 | #define pgprot_writecombine(prot) \ |
257 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_GRE)) | 258 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC)) |
258 | #define pgprot_dmacoherent(prot) \ | 259 | #define pgprot_dmacoherent(prot) \ |
259 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC)) | 260 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC)) |
260 | #define __HAVE_PHYS_MEM_ACCESS_PROT | 261 | #define __HAVE_PHYS_MEM_ACCESS_PROT |
@@ -357,18 +358,20 @@ extern pgd_t idmap_pg_dir[PTRS_PER_PGD]; | |||
357 | 358 | ||
358 | /* | 359 | /* |
359 | * Encode and decode a swap entry: | 360 | * Encode and decode a swap entry: |
360 | * bits 0, 2: present (must both be zero) | 361 | * bits 0-1: present (must be zero) |
361 | * bit 3: PTE_FILE | 362 | * bit 2: PTE_FILE |
362 | * bits 4-8: swap type | 363 | * bits 3-8: swap type |
363 | * bits 9-63: swap offset | 364 | * bits 9-57: swap offset |
364 | */ | 365 | */ |
365 | #define __SWP_TYPE_SHIFT 4 | 366 | #define __SWP_TYPE_SHIFT 3 |
366 | #define __SWP_TYPE_BITS 6 | 367 | #define __SWP_TYPE_BITS 6 |
368 | #define __SWP_OFFSET_BITS 49 | ||
367 | #define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1) | 369 | #define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1) |
368 | #define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT) | 370 | #define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT) |
371 | #define __SWP_OFFSET_MASK ((1UL << __SWP_OFFSET_BITS) - 1) | ||
369 | 372 | ||
370 | #define __swp_type(x) (((x).val >> __SWP_TYPE_SHIFT) & __SWP_TYPE_MASK) | 373 | #define __swp_type(x) (((x).val >> __SWP_TYPE_SHIFT) & __SWP_TYPE_MASK) |
371 | #define __swp_offset(x) ((x).val >> __SWP_OFFSET_SHIFT) | 374 | #define __swp_offset(x) (((x).val >> __SWP_OFFSET_SHIFT) & __SWP_OFFSET_MASK) |
372 | #define __swp_entry(type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) }) | 375 | #define __swp_entry(type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) }) |
373 | 376 | ||
374 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | 377 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) |
@@ -382,15 +385,15 @@ extern pgd_t idmap_pg_dir[PTRS_PER_PGD]; | |||
382 | 385 | ||
383 | /* | 386 | /* |
384 | * Encode and decode a file entry: | 387 | * Encode and decode a file entry: |
385 | * bits 0, 2: present (must both be zero) | 388 | * bits 0-1: present (must be zero) |
386 | * bit 3: PTE_FILE | 389 | * bit 2: PTE_FILE |
387 | * bits 4-63: file offset / PAGE_SIZE | 390 | * bits 3-57: file offset / PAGE_SIZE |
388 | */ | 391 | */ |
389 | #define pte_file(pte) (pte_val(pte) & PTE_FILE) | 392 | #define pte_file(pte) (pte_val(pte) & PTE_FILE) |
390 | #define pte_to_pgoff(x) (pte_val(x) >> 4) | 393 | #define pte_to_pgoff(x) (pte_val(x) >> 3) |
391 | #define pgoff_to_pte(x) __pte(((x) << 4) | PTE_FILE) | 394 | #define pgoff_to_pte(x) __pte(((x) << 3) | PTE_FILE) |
392 | 395 | ||
393 | #define PTE_FILE_MAX_BITS 60 | 396 | #define PTE_FILE_MAX_BITS 55 |
394 | 397 | ||
395 | extern int kern_addr_valid(unsigned long addr); | 398 | extern int kern_addr_valid(unsigned long addr); |
396 | 399 | ||
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index 6a0a9b132d7a..4ae68579031d 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c | |||
@@ -248,7 +248,8 @@ static int brk_handler(unsigned long addr, unsigned int esr, | |||
248 | int aarch32_break_handler(struct pt_regs *regs) | 248 | int aarch32_break_handler(struct pt_regs *regs) |
249 | { | 249 | { |
250 | siginfo_t info; | 250 | siginfo_t info; |
251 | unsigned int instr; | 251 | u32 arm_instr; |
252 | u16 thumb_instr; | ||
252 | bool bp = false; | 253 | bool bp = false; |
253 | void __user *pc = (void __user *)instruction_pointer(regs); | 254 | void __user *pc = (void __user *)instruction_pointer(regs); |
254 | 255 | ||
@@ -257,18 +258,21 @@ int aarch32_break_handler(struct pt_regs *regs) | |||
257 | 258 | ||
258 | if (compat_thumb_mode(regs)) { | 259 | if (compat_thumb_mode(regs)) { |
259 | /* get 16-bit Thumb instruction */ | 260 | /* get 16-bit Thumb instruction */ |
260 | get_user(instr, (u16 __user *)pc); | 261 | get_user(thumb_instr, (u16 __user *)pc); |
261 | if (instr == AARCH32_BREAK_THUMB2_LO) { | 262 | thumb_instr = le16_to_cpu(thumb_instr); |
263 | if (thumb_instr == AARCH32_BREAK_THUMB2_LO) { | ||
262 | /* get second half of 32-bit Thumb-2 instruction */ | 264 | /* get second half of 32-bit Thumb-2 instruction */ |
263 | get_user(instr, (u16 __user *)(pc + 2)); | 265 | get_user(thumb_instr, (u16 __user *)(pc + 2)); |
264 | bp = instr == AARCH32_BREAK_THUMB2_HI; | 266 | thumb_instr = le16_to_cpu(thumb_instr); |
267 | bp = thumb_instr == AARCH32_BREAK_THUMB2_HI; | ||
265 | } else { | 268 | } else { |
266 | bp = instr == AARCH32_BREAK_THUMB; | 269 | bp = thumb_instr == AARCH32_BREAK_THUMB; |
267 | } | 270 | } |
268 | } else { | 271 | } else { |
269 | /* 32-bit ARM instruction */ | 272 | /* 32-bit ARM instruction */ |
270 | get_user(instr, (u32 __user *)pc); | 273 | get_user(arm_instr, (u32 __user *)pc); |
271 | bp = (instr & ~0xf0000000) == AARCH32_BREAK_ARM; | 274 | arm_instr = le32_to_cpu(arm_instr); |
275 | bp = (arm_instr & ~0xf0000000) == AARCH32_BREAK_ARM; | ||
272 | } | 276 | } |
273 | 277 | ||
274 | if (!bp) | 278 | if (!bp) |
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index e1166145ca29..4d2c6f3f0c41 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S | |||
@@ -309,15 +309,12 @@ el1_irq: | |||
309 | #ifdef CONFIG_TRACE_IRQFLAGS | 309 | #ifdef CONFIG_TRACE_IRQFLAGS |
310 | bl trace_hardirqs_off | 310 | bl trace_hardirqs_off |
311 | #endif | 311 | #endif |
312 | #ifdef CONFIG_PREEMPT | 312 | |
313 | get_thread_info tsk | ||
314 | ldr w24, [tsk, #TI_PREEMPT] // get preempt count | ||
315 | add w0, w24, #1 // increment it | ||
316 | str w0, [tsk, #TI_PREEMPT] | ||
317 | #endif | ||
318 | irq_handler | 313 | irq_handler |
314 | |||
319 | #ifdef CONFIG_PREEMPT | 315 | #ifdef CONFIG_PREEMPT |
320 | str w24, [tsk, #TI_PREEMPT] // restore preempt count | 316 | get_thread_info tsk |
317 | ldr w24, [tsk, #TI_PREEMPT] // restore preempt count | ||
321 | cbnz w24, 1f // preempt count != 0 | 318 | cbnz w24, 1f // preempt count != 0 |
322 | ldr x0, [tsk, #TI_FLAGS] // get flags | 319 | ldr x0, [tsk, #TI_FLAGS] // get flags |
323 | tbz x0, #TIF_NEED_RESCHED, 1f // needs rescheduling? | 320 | tbz x0, #TIF_NEED_RESCHED, 1f // needs rescheduling? |
@@ -507,22 +504,10 @@ el0_irq_naked: | |||
507 | #ifdef CONFIG_TRACE_IRQFLAGS | 504 | #ifdef CONFIG_TRACE_IRQFLAGS |
508 | bl trace_hardirqs_off | 505 | bl trace_hardirqs_off |
509 | #endif | 506 | #endif |
510 | get_thread_info tsk | 507 | |
511 | #ifdef CONFIG_PREEMPT | ||
512 | ldr w24, [tsk, #TI_PREEMPT] // get preempt count | ||
513 | add w23, w24, #1 // increment it | ||
514 | str w23, [tsk, #TI_PREEMPT] | ||
515 | #endif | ||
516 | irq_handler | 508 | irq_handler |
517 | #ifdef CONFIG_PREEMPT | 509 | get_thread_info tsk |
518 | ldr w0, [tsk, #TI_PREEMPT] | 510 | |
519 | str w24, [tsk, #TI_PREEMPT] | ||
520 | cmp w0, w23 | ||
521 | b.eq 1f | ||
522 | mov x1, #0 | ||
523 | str x1, [x1] // BUG | ||
524 | 1: | ||
525 | #endif | ||
526 | #ifdef CONFIG_TRACE_IRQFLAGS | 511 | #ifdef CONFIG_TRACE_IRQFLAGS |
527 | bl trace_hardirqs_on | 512 | bl trace_hardirqs_on |
528 | #endif | 513 | #endif |
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index fecdbf7de82e..6777a2192b83 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c | |||
@@ -636,28 +636,27 @@ static int compat_gpr_get(struct task_struct *target, | |||
636 | 636 | ||
637 | for (i = 0; i < num_regs; ++i) { | 637 | for (i = 0; i < num_regs; ++i) { |
638 | unsigned int idx = start + i; | 638 | unsigned int idx = start + i; |
639 | void *reg; | 639 | compat_ulong_t reg; |
640 | 640 | ||
641 | switch (idx) { | 641 | switch (idx) { |
642 | case 15: | 642 | case 15: |
643 | reg = (void *)&task_pt_regs(target)->pc; | 643 | reg = task_pt_regs(target)->pc; |
644 | break; | 644 | break; |
645 | case 16: | 645 | case 16: |
646 | reg = (void *)&task_pt_regs(target)->pstate; | 646 | reg = task_pt_regs(target)->pstate; |
647 | break; | 647 | break; |
648 | case 17: | 648 | case 17: |
649 | reg = (void *)&task_pt_regs(target)->orig_x0; | 649 | reg = task_pt_regs(target)->orig_x0; |
650 | break; | 650 | break; |
651 | default: | 651 | default: |
652 | reg = (void *)&task_pt_regs(target)->regs[idx]; | 652 | reg = task_pt_regs(target)->regs[idx]; |
653 | } | 653 | } |
654 | 654 | ||
655 | ret = copy_to_user(ubuf, reg, sizeof(compat_ulong_t)); | 655 | ret = copy_to_user(ubuf, ®, sizeof(reg)); |
656 | |||
657 | if (ret) | 656 | if (ret) |
658 | break; | 657 | break; |
659 | else | 658 | |
660 | ubuf += sizeof(compat_ulong_t); | 659 | ubuf += sizeof(reg); |
661 | } | 660 | } |
662 | 661 | ||
663 | return ret; | 662 | return ret; |
@@ -685,28 +684,28 @@ static int compat_gpr_set(struct task_struct *target, | |||
685 | 684 | ||
686 | for (i = 0; i < num_regs; ++i) { | 685 | for (i = 0; i < num_regs; ++i) { |
687 | unsigned int idx = start + i; | 686 | unsigned int idx = start + i; |
688 | void *reg; | 687 | compat_ulong_t reg; |
688 | |||
689 | ret = copy_from_user(®, ubuf, sizeof(reg)); | ||
690 | if (ret) | ||
691 | return ret; | ||
692 | |||
693 | ubuf += sizeof(reg); | ||
689 | 694 | ||
690 | switch (idx) { | 695 | switch (idx) { |
691 | case 15: | 696 | case 15: |
692 | reg = (void *)&newregs.pc; | 697 | newregs.pc = reg; |
693 | break; | 698 | break; |
694 | case 16: | 699 | case 16: |
695 | reg = (void *)&newregs.pstate; | 700 | newregs.pstate = reg; |
696 | break; | 701 | break; |
697 | case 17: | 702 | case 17: |
698 | reg = (void *)&newregs.orig_x0; | 703 | newregs.orig_x0 = reg; |
699 | break; | 704 | break; |
700 | default: | 705 | default: |
701 | reg = (void *)&newregs.regs[idx]; | 706 | newregs.regs[idx] = reg; |
702 | } | 707 | } |
703 | 708 | ||
704 | ret = copy_from_user(reg, ubuf, sizeof(compat_ulong_t)); | ||
705 | |||
706 | if (ret) | ||
707 | goto out; | ||
708 | else | ||
709 | ubuf += sizeof(compat_ulong_t); | ||
710 | } | 709 | } |
711 | 710 | ||
712 | if (valid_user_regs(&newregs.user_regs)) | 711 | if (valid_user_regs(&newregs.user_regs)) |
@@ -714,7 +713,6 @@ static int compat_gpr_set(struct task_struct *target, | |||
714 | else | 713 | else |
715 | ret = -EINVAL; | 714 | ret = -EINVAL; |
716 | 715 | ||
717 | out: | ||
718 | return ret; | 716 | return ret; |
719 | } | 717 | } |
720 | 718 | ||
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 0bc5e4cbc017..bd9bbd0e44ed 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c | |||
@@ -205,6 +205,11 @@ u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID }; | |||
205 | 205 | ||
206 | void __init setup_arch(char **cmdline_p) | 206 | void __init setup_arch(char **cmdline_p) |
207 | { | 207 | { |
208 | /* | ||
209 | * Unmask asynchronous aborts early to catch possible system errors. | ||
210 | */ | ||
211 | local_async_enable(); | ||
212 | |||
208 | setup_processor(); | 213 | setup_processor(); |
209 | 214 | ||
210 | setup_machine_fdt(__fdt_pointer); | 215 | setup_machine_fdt(__fdt_pointer); |
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index a5aeefab03c3..a0c2ca602cf8 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c | |||
@@ -160,6 +160,7 @@ asmlinkage void secondary_start_kernel(void) | |||
160 | 160 | ||
161 | local_irq_enable(); | 161 | local_irq_enable(); |
162 | local_fiq_enable(); | 162 | local_fiq_enable(); |
163 | local_async_enable(); | ||
163 | 164 | ||
164 | /* | 165 | /* |
165 | * OK, it's off to the idle thread for us | 166 | * OK, it's off to the idle thread for us |
diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig index ec1b014952b6..acacd348df89 100644 --- a/arch/parisc/configs/c3000_defconfig +++ b/arch/parisc/configs/c3000_defconfig | |||
@@ -50,7 +50,7 @@ CONFIG_BLK_DEV_CRYPTOLOOP=m | |||
50 | CONFIG_IDE=y | 50 | CONFIG_IDE=y |
51 | CONFIG_BLK_DEV_IDECD=y | 51 | CONFIG_BLK_DEV_IDECD=y |
52 | CONFIG_BLK_DEV_NS87415=y | 52 | CONFIG_BLK_DEV_NS87415=y |
53 | CONFIG_BLK_DEV_SIIMAGE=m | 53 | CONFIG_PATA_SIL680=m |
54 | CONFIG_SCSI=y | 54 | CONFIG_SCSI=y |
55 | CONFIG_BLK_DEV_SD=y | 55 | CONFIG_BLK_DEV_SD=y |
56 | CONFIG_CHR_DEV_ST=y | 56 | CONFIG_CHR_DEV_ST=y |
diff --git a/arch/parisc/configs/c8000_defconfig b/arch/parisc/configs/c8000_defconfig index e1c8d2015c89..8249ac9d9cfc 100644 --- a/arch/parisc/configs/c8000_defconfig +++ b/arch/parisc/configs/c8000_defconfig | |||
@@ -20,7 +20,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y | |||
20 | CONFIG_MODVERSIONS=y | 20 | CONFIG_MODVERSIONS=y |
21 | CONFIG_BLK_DEV_INTEGRITY=y | 21 | CONFIG_BLK_DEV_INTEGRITY=y |
22 | CONFIG_PA8X00=y | 22 | CONFIG_PA8X00=y |
23 | CONFIG_MLONGCALLS=y | ||
24 | CONFIG_64BIT=y | 23 | CONFIG_64BIT=y |
25 | CONFIG_SMP=y | 24 | CONFIG_SMP=y |
26 | CONFIG_PREEMPT=y | 25 | CONFIG_PREEMPT=y |
@@ -81,8 +80,6 @@ CONFIG_IDE=y | |||
81 | CONFIG_BLK_DEV_IDECD=y | 80 | CONFIG_BLK_DEV_IDECD=y |
82 | CONFIG_BLK_DEV_PLATFORM=y | 81 | CONFIG_BLK_DEV_PLATFORM=y |
83 | CONFIG_BLK_DEV_GENERIC=y | 82 | CONFIG_BLK_DEV_GENERIC=y |
84 | CONFIG_BLK_DEV_SIIMAGE=y | ||
85 | CONFIG_SCSI=y | ||
86 | CONFIG_BLK_DEV_SD=y | 83 | CONFIG_BLK_DEV_SD=y |
87 | CONFIG_CHR_DEV_ST=m | 84 | CONFIG_CHR_DEV_ST=m |
88 | CONFIG_BLK_DEV_SR=m | 85 | CONFIG_BLK_DEV_SR=m |
@@ -94,6 +91,8 @@ CONFIG_SCSI_FC_ATTRS=y | |||
94 | CONFIG_SCSI_SAS_LIBSAS=m | 91 | CONFIG_SCSI_SAS_LIBSAS=m |
95 | CONFIG_ISCSI_TCP=m | 92 | CONFIG_ISCSI_TCP=m |
96 | CONFIG_ISCSI_BOOT_SYSFS=m | 93 | CONFIG_ISCSI_BOOT_SYSFS=m |
94 | CONFIG_ATA=y | ||
95 | CONFIG_PATA_SIL680=y | ||
97 | CONFIG_FUSION=y | 96 | CONFIG_FUSION=y |
98 | CONFIG_FUSION_SPI=y | 97 | CONFIG_FUSION_SPI=y |
99 | CONFIG_FUSION_SAS=y | 98 | CONFIG_FUSION_SAS=y |
@@ -114,9 +113,8 @@ CONFIG_INPUT_FF_MEMLESS=m | |||
114 | # CONFIG_KEYBOARD_ATKBD is not set | 113 | # CONFIG_KEYBOARD_ATKBD is not set |
115 | # CONFIG_KEYBOARD_HIL_OLD is not set | 114 | # CONFIG_KEYBOARD_HIL_OLD is not set |
116 | # CONFIG_KEYBOARD_HIL is not set | 115 | # CONFIG_KEYBOARD_HIL is not set |
117 | CONFIG_MOUSE_PS2=m | 116 | # CONFIG_MOUSE_PS2 is not set |
118 | CONFIG_INPUT_MISC=y | 117 | CONFIG_INPUT_MISC=y |
119 | CONFIG_INPUT_CM109=m | ||
120 | CONFIG_SERIO_SERPORT=m | 118 | CONFIG_SERIO_SERPORT=m |
121 | CONFIG_SERIO_PARKBD=m | 119 | CONFIG_SERIO_PARKBD=m |
122 | CONFIG_SERIO_GSCPS2=m | 120 | CONFIG_SERIO_GSCPS2=m |
@@ -167,34 +165,6 @@ CONFIG_SND_VERBOSE_PRINTK=y | |||
167 | CONFIG_SND_AD1889=m | 165 | CONFIG_SND_AD1889=m |
168 | # CONFIG_SND_USB is not set | 166 | # CONFIG_SND_USB is not set |
169 | # CONFIG_SND_GSC is not set | 167 | # CONFIG_SND_GSC is not set |
170 | CONFIG_HID_A4TECH=m | ||
171 | CONFIG_HID_APPLE=m | ||
172 | CONFIG_HID_BELKIN=m | ||
173 | CONFIG_HID_CHERRY=m | ||
174 | CONFIG_HID_CHICONY=m | ||
175 | CONFIG_HID_CYPRESS=m | ||
176 | CONFIG_HID_DRAGONRISE=m | ||
177 | CONFIG_HID_EZKEY=m | ||
178 | CONFIG_HID_KYE=m | ||
179 | CONFIG_HID_GYRATION=m | ||
180 | CONFIG_HID_TWINHAN=m | ||
181 | CONFIG_HID_KENSINGTON=m | ||
182 | CONFIG_HID_LOGITECH=m | ||
183 | CONFIG_HID_LOGITECH_DJ=m | ||
184 | CONFIG_HID_MICROSOFT=m | ||
185 | CONFIG_HID_MONTEREY=m | ||
186 | CONFIG_HID_NTRIG=m | ||
187 | CONFIG_HID_ORTEK=m | ||
188 | CONFIG_HID_PANTHERLORD=m | ||
189 | CONFIG_HID_PETALYNX=m | ||
190 | CONFIG_HID_SAMSUNG=m | ||
191 | CONFIG_HID_SUNPLUS=m | ||
192 | CONFIG_HID_GREENASIA=m | ||
193 | CONFIG_HID_SMARTJOYPLUS=m | ||
194 | CONFIG_HID_TOPSEED=m | ||
195 | CONFIG_HID_THRUSTMASTER=m | ||
196 | CONFIG_HID_ZEROPLUS=m | ||
197 | CONFIG_USB_HID=m | ||
198 | CONFIG_USB=y | 168 | CONFIG_USB=y |
199 | CONFIG_USB_OHCI_HCD=y | 169 | CONFIG_USB_OHCI_HCD=y |
200 | CONFIG_USB_STORAGE=y | 170 | CONFIG_USB_STORAGE=y |
diff --git a/arch/parisc/configs/generic-64bit_defconfig b/arch/parisc/configs/generic-64bit_defconfig index 5874cebee077..28c1b5de044e 100644 --- a/arch/parisc/configs/generic-64bit_defconfig +++ b/arch/parisc/configs/generic-64bit_defconfig | |||
@@ -24,7 +24,6 @@ CONFIG_MODVERSIONS=y | |||
24 | CONFIG_BLK_DEV_INTEGRITY=y | 24 | CONFIG_BLK_DEV_INTEGRITY=y |
25 | # CONFIG_IOSCHED_DEADLINE is not set | 25 | # CONFIG_IOSCHED_DEADLINE is not set |
26 | CONFIG_PA8X00=y | 26 | CONFIG_PA8X00=y |
27 | CONFIG_MLONGCALLS=y | ||
28 | CONFIG_64BIT=y | 27 | CONFIG_64BIT=y |
29 | CONFIG_SMP=y | 28 | CONFIG_SMP=y |
30 | # CONFIG_COMPACTION is not set | 29 | # CONFIG_COMPACTION is not set |
@@ -68,7 +67,6 @@ CONFIG_IDE_GD=m | |||
68 | CONFIG_IDE_GD_ATAPI=y | 67 | CONFIG_IDE_GD_ATAPI=y |
69 | CONFIG_BLK_DEV_IDECD=m | 68 | CONFIG_BLK_DEV_IDECD=m |
70 | CONFIG_BLK_DEV_NS87415=y | 69 | CONFIG_BLK_DEV_NS87415=y |
71 | CONFIG_BLK_DEV_SIIMAGE=y | ||
72 | # CONFIG_SCSI_PROC_FS is not set | 70 | # CONFIG_SCSI_PROC_FS is not set |
73 | CONFIG_BLK_DEV_SD=y | 71 | CONFIG_BLK_DEV_SD=y |
74 | CONFIG_BLK_DEV_SR=y | 72 | CONFIG_BLK_DEV_SR=y |
@@ -82,6 +80,7 @@ CONFIG_SCSI_ZALON=y | |||
82 | CONFIG_SCSI_QLA_ISCSI=m | 80 | CONFIG_SCSI_QLA_ISCSI=m |
83 | CONFIG_SCSI_DH=y | 81 | CONFIG_SCSI_DH=y |
84 | CONFIG_ATA=y | 82 | CONFIG_ATA=y |
83 | CONFIG_PATA_SIL680=y | ||
85 | CONFIG_ATA_GENERIC=y | 84 | CONFIG_ATA_GENERIC=y |
86 | CONFIG_MD=y | 85 | CONFIG_MD=y |
87 | CONFIG_MD_LINEAR=m | 86 | CONFIG_MD_LINEAR=m |
@@ -162,7 +161,7 @@ CONFIG_SLIP_MODE_SLIP6=y | |||
162 | CONFIG_INPUT_EVDEV=y | 161 | CONFIG_INPUT_EVDEV=y |
163 | # CONFIG_KEYBOARD_HIL_OLD is not set | 162 | # CONFIG_KEYBOARD_HIL_OLD is not set |
164 | # CONFIG_KEYBOARD_HIL is not set | 163 | # CONFIG_KEYBOARD_HIL is not set |
165 | # CONFIG_INPUT_MOUSE is not set | 164 | # CONFIG_MOUSE_PS2 is not set |
166 | CONFIG_INPUT_MISC=y | 165 | CONFIG_INPUT_MISC=y |
167 | CONFIG_SERIO_SERPORT=m | 166 | CONFIG_SERIO_SERPORT=m |
168 | # CONFIG_HP_SDC is not set | 167 | # CONFIG_HP_SDC is not set |
@@ -216,32 +215,7 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y | |||
216 | CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y | 215 | CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y |
217 | CONFIG_LOGO=y | 216 | CONFIG_LOGO=y |
218 | # CONFIG_LOGO_LINUX_MONO is not set | 217 | # CONFIG_LOGO_LINUX_MONO is not set |
219 | CONFIG_HID=m | ||
220 | CONFIG_HIDRAW=y | 218 | CONFIG_HIDRAW=y |
221 | CONFIG_HID_DRAGONRISE=m | ||
222 | CONFIG_DRAGONRISE_FF=y | ||
223 | CONFIG_HID_KYE=m | ||
224 | CONFIG_HID_GYRATION=m | ||
225 | CONFIG_HID_TWINHAN=m | ||
226 | CONFIG_LOGITECH_FF=y | ||
227 | CONFIG_LOGIRUMBLEPAD2_FF=y | ||
228 | CONFIG_HID_NTRIG=m | ||
229 | CONFIG_HID_PANTHERLORD=m | ||
230 | CONFIG_PANTHERLORD_FF=y | ||
231 | CONFIG_HID_PETALYNX=m | ||
232 | CONFIG_HID_SAMSUNG=m | ||
233 | CONFIG_HID_SONY=m | ||
234 | CONFIG_HID_SUNPLUS=m | ||
235 | CONFIG_HID_GREENASIA=m | ||
236 | CONFIG_GREENASIA_FF=y | ||
237 | CONFIG_HID_SMARTJOYPLUS=m | ||
238 | CONFIG_SMARTJOYPLUS_FF=y | ||
239 | CONFIG_HID_TOPSEED=m | ||
240 | CONFIG_HID_THRUSTMASTER=m | ||
241 | CONFIG_THRUSTMASTER_FF=y | ||
242 | CONFIG_HID_ZEROPLUS=m | ||
243 | CONFIG_ZEROPLUS_FF=y | ||
244 | CONFIG_USB_HID=m | ||
245 | CONFIG_HID_PID=y | 219 | CONFIG_HID_PID=y |
246 | CONFIG_USB_HIDDEV=y | 220 | CONFIG_USB_HIDDEV=y |
247 | CONFIG_USB=y | 221 | CONFIG_USB=y |
@@ -251,13 +225,8 @@ CONFIG_USB_DYNAMIC_MINORS=y | |||
251 | CONFIG_USB_MON=m | 225 | CONFIG_USB_MON=m |
252 | CONFIG_USB_WUSB_CBAF=m | 226 | CONFIG_USB_WUSB_CBAF=m |
253 | CONFIG_USB_XHCI_HCD=m | 227 | CONFIG_USB_XHCI_HCD=m |
254 | CONFIG_USB_EHCI_HCD=m | 228 | CONFIG_USB_EHCI_HCD=y |
255 | CONFIG_USB_OHCI_HCD=m | 229 | CONFIG_USB_OHCI_HCD=y |
256 | CONFIG_USB_R8A66597_HCD=m | ||
257 | CONFIG_USB_ACM=m | ||
258 | CONFIG_USB_PRINTER=m | ||
259 | CONFIG_USB_WDM=m | ||
260 | CONFIG_USB_TMC=m | ||
261 | CONFIG_NEW_LEDS=y | 230 | CONFIG_NEW_LEDS=y |
262 | CONFIG_LEDS_CLASS=y | 231 | CONFIG_LEDS_CLASS=y |
263 | CONFIG_LEDS_TRIGGERS=y | 232 | CONFIG_LEDS_TRIGGERS=y |
diff --git a/arch/parisc/include/asm/serial.h b/arch/parisc/include/asm/serial.h index d7e3cc60dbc3..77e9b67c87ee 100644 --- a/arch/parisc/include/asm/serial.h +++ b/arch/parisc/include/asm/serial.h | |||
@@ -6,5 +6,3 @@ | |||
6 | * This is used for 16550-compatible UARTs | 6 | * This is used for 16550-compatible UARTs |
7 | */ | 7 | */ |
8 | #define BASE_BAUD ( 1843200 / 16 ) | 8 | #define BASE_BAUD ( 1843200 / 16 ) |
9 | |||
10 | #define SERIAL_PORT_DFNS | ||
diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c index 06cb3992907e..608716f8496b 100644 --- a/arch/parisc/kernel/hardware.c +++ b/arch/parisc/kernel/hardware.c | |||
@@ -36,6 +36,9 @@ | |||
36 | * HP PARISC Hardware Database | 36 | * HP PARISC Hardware Database |
37 | * Access to this database is only possible during bootup | 37 | * Access to this database is only possible during bootup |
38 | * so don't reference this table after starting the init process | 38 | * so don't reference this table after starting the init process |
39 | * | ||
40 | * NOTE: Product names which are listed here and ends with a '?' | ||
41 | * are guessed. If you know the correct name, please let us know. | ||
39 | */ | 42 | */ |
40 | 43 | ||
41 | static struct hp_hardware hp_hardware_list[] = { | 44 | static struct hp_hardware hp_hardware_list[] = { |
@@ -222,7 +225,7 @@ static struct hp_hardware hp_hardware_list[] = { | |||
222 | {HPHW_NPROC,0x5DD,0x4,0x81,"Duet W2"}, | 225 | {HPHW_NPROC,0x5DD,0x4,0x81,"Duet W2"}, |
223 | {HPHW_NPROC,0x5DE,0x4,0x81,"Piccolo W+"}, | 226 | {HPHW_NPROC,0x5DE,0x4,0x81,"Piccolo W+"}, |
224 | {HPHW_NPROC,0x5DF,0x4,0x81,"Cantata W2"}, | 227 | {HPHW_NPROC,0x5DF,0x4,0x81,"Cantata W2"}, |
225 | {HPHW_NPROC,0x5DF,0x0,0x00,"Marcato W+? (rp5470)"}, | 228 | {HPHW_NPROC,0x5DF,0x0,0x00,"Marcato W+ (rp5470)?"}, |
226 | {HPHW_NPROC,0x5E0,0x4,0x91,"Cantata DC- W2"}, | 229 | {HPHW_NPROC,0x5E0,0x4,0x91,"Cantata DC- W2"}, |
227 | {HPHW_NPROC,0x5E1,0x4,0x91,"Crescendo DC- W2"}, | 230 | {HPHW_NPROC,0x5E1,0x4,0x91,"Crescendo DC- W2"}, |
228 | {HPHW_NPROC,0x5E2,0x4,0x91,"Crescendo 650 W2"}, | 231 | {HPHW_NPROC,0x5E2,0x4,0x91,"Crescendo 650 W2"}, |
@@ -276,9 +279,11 @@ static struct hp_hardware hp_hardware_list[] = { | |||
276 | {HPHW_NPROC,0x888,0x4,0x91,"Storm Peak Fast DC-"}, | 279 | {HPHW_NPROC,0x888,0x4,0x91,"Storm Peak Fast DC-"}, |
277 | {HPHW_NPROC,0x889,0x4,0x91,"Storm Peak Fast"}, | 280 | {HPHW_NPROC,0x889,0x4,0x91,"Storm Peak Fast"}, |
278 | {HPHW_NPROC,0x88A,0x4,0x91,"Crestone Peak Slow"}, | 281 | {HPHW_NPROC,0x88A,0x4,0x91,"Crestone Peak Slow"}, |
282 | {HPHW_NPROC,0x88B,0x4,0x91,"Crestone Peak Fast?"}, | ||
279 | {HPHW_NPROC,0x88C,0x4,0x91,"Orca Mako+"}, | 283 | {HPHW_NPROC,0x88C,0x4,0x91,"Orca Mako+"}, |
280 | {HPHW_NPROC,0x88D,0x4,0x91,"Rainier/Medel Mako+ Slow"}, | 284 | {HPHW_NPROC,0x88D,0x4,0x91,"Rainier/Medel Mako+ Slow"}, |
281 | {HPHW_NPROC,0x88E,0x4,0x91,"Rainier/Medel Mako+ Fast"}, | 285 | {HPHW_NPROC,0x88E,0x4,0x91,"Rainier/Medel Mako+ Fast"}, |
286 | {HPHW_NPROC,0x892,0x4,0x91,"Mt. Hamilton Slow Mako+?"}, | ||
282 | {HPHW_NPROC,0x894,0x4,0x91,"Mt. Hamilton Fast Mako+"}, | 287 | {HPHW_NPROC,0x894,0x4,0x91,"Mt. Hamilton Fast Mako+"}, |
283 | {HPHW_NPROC,0x895,0x4,0x91,"Storm Peak Slow Mako+"}, | 288 | {HPHW_NPROC,0x895,0x4,0x91,"Storm Peak Slow Mako+"}, |
284 | {HPHW_NPROC,0x896,0x4,0x91,"Storm Peak Fast Mako+"}, | 289 | {HPHW_NPROC,0x896,0x4,0x91,"Storm Peak Fast Mako+"}, |
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S index d2d58258aea6..d4dc588c0dc1 100644 --- a/arch/parisc/kernel/head.S +++ b/arch/parisc/kernel/head.S | |||
@@ -41,9 +41,7 @@ END(boot_args) | |||
41 | .import fault_vector_11,code /* IVA parisc 1.1 32 bit */ | 41 | .import fault_vector_11,code /* IVA parisc 1.1 32 bit */ |
42 | .import $global$ /* forward declaration */ | 42 | .import $global$ /* forward declaration */ |
43 | #endif /*!CONFIG_64BIT*/ | 43 | #endif /*!CONFIG_64BIT*/ |
44 | .export _stext,data /* Kernel want it this way! */ | 44 | ENTRY(parisc_kernel_start) |
45 | _stext: | ||
46 | ENTRY(stext) | ||
47 | .proc | 45 | .proc |
48 | .callinfo | 46 | .callinfo |
49 | 47 | ||
@@ -347,7 +345,7 @@ smp_slave_stext: | |||
347 | .procend | 345 | .procend |
348 | #endif /* CONFIG_SMP */ | 346 | #endif /* CONFIG_SMP */ |
349 | 347 | ||
350 | ENDPROC(stext) | 348 | ENDPROC(parisc_kernel_start) |
351 | 349 | ||
352 | #ifndef CONFIG_64BIT | 350 | #ifndef CONFIG_64BIT |
353 | .section .data..read_mostly | 351 | .section .data..read_mostly |
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c index 5dfd248e3f1a..0d3a9d4927b5 100644 --- a/arch/parisc/kernel/sys_parisc.c +++ b/arch/parisc/kernel/sys_parisc.c | |||
@@ -61,8 +61,15 @@ static int get_offset(struct address_space *mapping) | |||
61 | return (unsigned long) mapping >> 8; | 61 | return (unsigned long) mapping >> 8; |
62 | } | 62 | } |
63 | 63 | ||
64 | static unsigned long get_shared_area(struct address_space *mapping, | 64 | static unsigned long shared_align_offset(struct file *filp, unsigned long pgoff) |
65 | unsigned long addr, unsigned long len, unsigned long pgoff) | 65 | { |
66 | struct address_space *mapping = filp ? filp->f_mapping : NULL; | ||
67 | |||
68 | return (get_offset(mapping) + pgoff) << PAGE_SHIFT; | ||
69 | } | ||
70 | |||
71 | static unsigned long get_shared_area(struct file *filp, unsigned long addr, | ||
72 | unsigned long len, unsigned long pgoff) | ||
66 | { | 73 | { |
67 | struct vm_unmapped_area_info info; | 74 | struct vm_unmapped_area_info info; |
68 | 75 | ||
@@ -71,7 +78,7 @@ static unsigned long get_shared_area(struct address_space *mapping, | |||
71 | info.low_limit = PAGE_ALIGN(addr); | 78 | info.low_limit = PAGE_ALIGN(addr); |
72 | info.high_limit = TASK_SIZE; | 79 | info.high_limit = TASK_SIZE; |
73 | info.align_mask = PAGE_MASK & (SHMLBA - 1); | 80 | info.align_mask = PAGE_MASK & (SHMLBA - 1); |
74 | info.align_offset = (get_offset(mapping) + pgoff) << PAGE_SHIFT; | 81 | info.align_offset = shared_align_offset(filp, pgoff); |
75 | return vm_unmapped_area(&info); | 82 | return vm_unmapped_area(&info); |
76 | } | 83 | } |
77 | 84 | ||
@@ -82,20 +89,18 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
82 | return -ENOMEM; | 89 | return -ENOMEM; |
83 | if (flags & MAP_FIXED) { | 90 | if (flags & MAP_FIXED) { |
84 | if ((flags & MAP_SHARED) && | 91 | if ((flags & MAP_SHARED) && |
85 | (addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1)) | 92 | (addr - shared_align_offset(filp, pgoff)) & (SHMLBA - 1)) |
86 | return -EINVAL; | 93 | return -EINVAL; |
87 | return addr; | 94 | return addr; |
88 | } | 95 | } |
89 | if (!addr) | 96 | if (!addr) |
90 | addr = TASK_UNMAPPED_BASE; | 97 | addr = TASK_UNMAPPED_BASE; |
91 | 98 | ||
92 | if (filp) { | 99 | if (filp || (flags & MAP_SHARED)) |
93 | addr = get_shared_area(filp->f_mapping, addr, len, pgoff); | 100 | addr = get_shared_area(filp, addr, len, pgoff); |
94 | } else if(flags & MAP_SHARED) { | 101 | else |
95 | addr = get_shared_area(NULL, addr, len, pgoff); | ||
96 | } else { | ||
97 | addr = get_unshared_area(addr, len); | 102 | addr = get_unshared_area(addr, len); |
98 | } | 103 | |
99 | return addr; | 104 | return addr; |
100 | } | 105 | } |
101 | 106 | ||
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index 76ed62ed785b..ddd988b267a9 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c | |||
@@ -168,7 +168,7 @@ void unwind_table_remove(struct unwind_table *table) | |||
168 | } | 168 | } |
169 | 169 | ||
170 | /* Called from setup_arch to import the kernel unwind info */ | 170 | /* Called from setup_arch to import the kernel unwind info */ |
171 | int unwind_init(void) | 171 | int __init unwind_init(void) |
172 | { | 172 | { |
173 | long start, stop; | 173 | long start, stop; |
174 | register unsigned long gp __asm__ ("r27"); | 174 | register unsigned long gp __asm__ ("r27"); |
@@ -233,7 +233,6 @@ static void unwind_frame_regs(struct unwind_frame_info *info) | |||
233 | e = find_unwind_entry(info->ip); | 233 | e = find_unwind_entry(info->ip); |
234 | if (e == NULL) { | 234 | if (e == NULL) { |
235 | unsigned long sp; | 235 | unsigned long sp; |
236 | extern char _stext[], _etext[]; | ||
237 | 236 | ||
238 | dbg("Cannot find unwind entry for 0x%lx; forced unwinding\n", info->ip); | 237 | dbg("Cannot find unwind entry for 0x%lx; forced unwinding\n", info->ip); |
239 | 238 | ||
@@ -281,8 +280,7 @@ static void unwind_frame_regs(struct unwind_frame_info *info) | |||
281 | break; | 280 | break; |
282 | info->prev_ip = tmp; | 281 | info->prev_ip = tmp; |
283 | sp = info->prev_sp; | 282 | sp = info->prev_sp; |
284 | } while (info->prev_ip < (unsigned long)_stext || | 283 | } while (!kernel_text_address(info->prev_ip)); |
285 | info->prev_ip > (unsigned long)_etext); | ||
286 | 284 | ||
287 | info->rp = 0; | 285 | info->rp = 0; |
288 | 286 | ||
@@ -435,9 +433,8 @@ unsigned long return_address(unsigned int level) | |||
435 | do { | 433 | do { |
436 | if (unwind_once(&info) < 0 || info.ip == 0) | 434 | if (unwind_once(&info) < 0 || info.ip == 0) |
437 | return 0; | 435 | return 0; |
438 | if (!__kernel_text_address(info.ip)) { | 436 | if (!kernel_text_address(info.ip)) |
439 | return 0; | 437 | return 0; |
440 | } | ||
441 | } while (info.ip && level--); | 438 | } while (info.ip && level--); |
442 | 439 | ||
443 | return info.ip; | 440 | return info.ip; |
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index 4bb095a2f6fc..0dacc5ca555a 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S | |||
@@ -6,24 +6,19 @@ | |||
6 | * Copyright (C) 2000 Michael Ang <mang with subcarrier.org> | 6 | * Copyright (C) 2000 Michael Ang <mang with subcarrier.org> |
7 | * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> | 7 | * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> |
8 | * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org> | 8 | * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org> |
9 | * Copyright (C) 2006 Helge Deller <deller@gmx.de> | 9 | * Copyright (C) 2006-2013 Helge Deller <deller@gmx.de> |
10 | * | 10 | */ |
11 | * | 11 | |
12 | * This program is free software; you can redistribute it and/or modify | 12 | /* |
13 | * it under the terms of the GNU General Public License as published by | 13 | * Put page table entries (swapper_pg_dir) as the first thing in .bss. This |
14 | * the Free Software Foundation; either version 2 of the License, or | 14 | * will ensure that it has .bss alignment (PAGE_SIZE). |
15 | * (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
25 | */ | 15 | */ |
16 | #define BSS_FIRST_SECTIONS *(.data..vm0.pmd) \ | ||
17 | *(.data..vm0.pgd) \ | ||
18 | *(.data..vm0.pte) | ||
19 | |||
26 | #include <asm-generic/vmlinux.lds.h> | 20 | #include <asm-generic/vmlinux.lds.h> |
21 | |||
27 | /* needed for the processor specific cache alignment size */ | 22 | /* needed for the processor specific cache alignment size */ |
28 | #include <asm/cache.h> | 23 | #include <asm/cache.h> |
29 | #include <asm/page.h> | 24 | #include <asm/page.h> |
@@ -39,7 +34,7 @@ OUTPUT_FORMAT("elf64-hppa-linux") | |||
39 | OUTPUT_ARCH(hppa:hppa2.0w) | 34 | OUTPUT_ARCH(hppa:hppa2.0w) |
40 | #endif | 35 | #endif |
41 | 36 | ||
42 | ENTRY(_stext) | 37 | ENTRY(parisc_kernel_start) |
43 | #ifndef CONFIG_64BIT | 38 | #ifndef CONFIG_64BIT |
44 | jiffies = jiffies_64 + 4; | 39 | jiffies = jiffies_64 + 4; |
45 | #else | 40 | #else |
@@ -49,11 +44,29 @@ SECTIONS | |||
49 | { | 44 | { |
50 | . = KERNEL_BINARY_TEXT_START; | 45 | . = KERNEL_BINARY_TEXT_START; |
51 | 46 | ||
47 | __init_begin = .; | ||
48 | HEAD_TEXT_SECTION | ||
49 | INIT_TEXT_SECTION(8) | ||
50 | |||
51 | . = ALIGN(PAGE_SIZE); | ||
52 | INIT_DATA_SECTION(PAGE_SIZE) | ||
53 | /* we have to discard exit text and such at runtime, not link time */ | ||
54 | .exit.text : | ||
55 | { | ||
56 | EXIT_TEXT | ||
57 | } | ||
58 | .exit.data : | ||
59 | { | ||
60 | EXIT_DATA | ||
61 | } | ||
62 | PERCPU_SECTION(8) | ||
63 | . = ALIGN(PAGE_SIZE); | ||
64 | __init_end = .; | ||
65 | /* freed after init ends here */ | ||
66 | |||
52 | _text = .; /* Text and read-only data */ | 67 | _text = .; /* Text and read-only data */ |
53 | .head ALIGN(16) : { | 68 | _stext = .; |
54 | HEAD_TEXT | 69 | .text ALIGN(PAGE_SIZE) : { |
55 | } = 0 | ||
56 | .text ALIGN(16) : { | ||
57 | TEXT_TEXT | 70 | TEXT_TEXT |
58 | SCHED_TEXT | 71 | SCHED_TEXT |
59 | LOCK_TEXT | 72 | LOCK_TEXT |
@@ -68,21 +81,28 @@ SECTIONS | |||
68 | *(.lock.text) /* out-of-line lock text */ | 81 | *(.lock.text) /* out-of-line lock text */ |
69 | *(.gnu.warning) | 82 | *(.gnu.warning) |
70 | } | 83 | } |
71 | /* End of text section */ | 84 | . = ALIGN(PAGE_SIZE); |
72 | _etext = .; | 85 | _etext = .; |
86 | /* End of text section */ | ||
73 | 87 | ||
74 | /* Start of data section */ | 88 | /* Start of data section */ |
75 | _sdata = .; | 89 | _sdata = .; |
76 | 90 | ||
77 | RODATA | 91 | RO_DATA_SECTION(8) |
78 | 92 | ||
79 | /* writeable */ | 93 | #ifdef CONFIG_64BIT |
80 | /* Make sure this is page aligned so | 94 | . = ALIGN(16); |
81 | * that we can properly leave these | 95 | /* Linkage tables */ |
82 | * as writable | 96 | .opd : { |
83 | */ | 97 | *(.opd) |
84 | . = ALIGN(PAGE_SIZE); | 98 | } PROVIDE (__gp = .); |
85 | data_start = .; | 99 | .plt : { |
100 | *(.plt) | ||
101 | } | ||
102 | .dlt : { | ||
103 | *(.dlt) | ||
104 | } | ||
105 | #endif | ||
86 | 106 | ||
87 | /* unwind info */ | 107 | /* unwind info */ |
88 | .PARISC.unwind : { | 108 | .PARISC.unwind : { |
@@ -91,7 +111,15 @@ SECTIONS | |||
91 | __stop___unwind = .; | 111 | __stop___unwind = .; |
92 | } | 112 | } |
93 | 113 | ||
94 | EXCEPTION_TABLE(16) | 114 | /* writeable */ |
115 | /* Make sure this is page aligned so | ||
116 | * that we can properly leave these | ||
117 | * as writable | ||
118 | */ | ||
119 | . = ALIGN(PAGE_SIZE); | ||
120 | data_start = .; | ||
121 | |||
122 | EXCEPTION_TABLE(8) | ||
95 | NOTES | 123 | NOTES |
96 | 124 | ||
97 | /* Data */ | 125 | /* Data */ |
@@ -107,54 +135,8 @@ SECTIONS | |||
107 | _edata = .; | 135 | _edata = .; |
108 | 136 | ||
109 | /* BSS */ | 137 | /* BSS */ |
110 | __bss_start = .; | 138 | BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 8) |
111 | /* page table entries need to be PAGE_SIZE aligned */ | ||
112 | . = ALIGN(PAGE_SIZE); | ||
113 | .data..vmpages : { | ||
114 | *(.data..vm0.pmd) | ||
115 | *(.data..vm0.pgd) | ||
116 | *(.data..vm0.pte) | ||
117 | } | ||
118 | .bss : { | ||
119 | *(.bss) | ||
120 | *(COMMON) | ||
121 | } | ||
122 | __bss_stop = .; | ||
123 | |||
124 | #ifdef CONFIG_64BIT | ||
125 | . = ALIGN(16); | ||
126 | /* Linkage tables */ | ||
127 | .opd : { | ||
128 | *(.opd) | ||
129 | } PROVIDE (__gp = .); | ||
130 | .plt : { | ||
131 | *(.plt) | ||
132 | } | ||
133 | .dlt : { | ||
134 | *(.dlt) | ||
135 | } | ||
136 | #endif | ||
137 | 139 | ||
138 | /* reserve space for interrupt stack by aligning __init* to 16k */ | ||
139 | . = ALIGN(16384); | ||
140 | __init_begin = .; | ||
141 | INIT_TEXT_SECTION(16384) | ||
142 | . = ALIGN(PAGE_SIZE); | ||
143 | INIT_DATA_SECTION(16) | ||
144 | /* we have to discard exit text and such at runtime, not link time */ | ||
145 | .exit.text : | ||
146 | { | ||
147 | EXIT_TEXT | ||
148 | } | ||
149 | .exit.data : | ||
150 | { | ||
151 | EXIT_DATA | ||
152 | } | ||
153 | |||
154 | PERCPU_SECTION(L1_CACHE_BYTES) | ||
155 | . = ALIGN(PAGE_SIZE); | ||
156 | __init_end = .; | ||
157 | /* freed after init ends here */ | ||
158 | _end = . ; | 140 | _end = . ; |
159 | 141 | ||
160 | STABS_DEBUG | 142 | STABS_DEBUG |
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index b0f96c0e6316..96f8168cf4ec 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/sections.h> | 32 | #include <asm/sections.h> |
33 | 33 | ||
34 | extern int data_start; | 34 | extern int data_start; |
35 | extern void parisc_kernel_start(void); /* Kernel entry point in head.S */ | ||
35 | 36 | ||
36 | #if PT_NLEVELS == 3 | 37 | #if PT_NLEVELS == 3 |
37 | /* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout | 38 | /* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout |
@@ -324,8 +325,9 @@ static void __init setup_bootmem(void) | |||
324 | reserve_bootmem_node(NODE_DATA(0), 0UL, | 325 | reserve_bootmem_node(NODE_DATA(0), 0UL, |
325 | (unsigned long)(PAGE0->mem_free + | 326 | (unsigned long)(PAGE0->mem_free + |
326 | PDC_CONSOLE_IO_IODC_SIZE), BOOTMEM_DEFAULT); | 327 | PDC_CONSOLE_IO_IODC_SIZE), BOOTMEM_DEFAULT); |
327 | reserve_bootmem_node(NODE_DATA(0), __pa((unsigned long)_text), | 328 | reserve_bootmem_node(NODE_DATA(0), __pa(KERNEL_BINARY_TEXT_START), |
328 | (unsigned long)(_end - _text), BOOTMEM_DEFAULT); | 329 | (unsigned long)(_end - KERNEL_BINARY_TEXT_START), |
330 | BOOTMEM_DEFAULT); | ||
329 | reserve_bootmem_node(NODE_DATA(0), (bootmap_start_pfn << PAGE_SHIFT), | 331 | reserve_bootmem_node(NODE_DATA(0), (bootmap_start_pfn << PAGE_SHIFT), |
330 | ((bootmap_pfn - bootmap_start_pfn) << PAGE_SHIFT), | 332 | ((bootmap_pfn - bootmap_start_pfn) << PAGE_SHIFT), |
331 | BOOTMEM_DEFAULT); | 333 | BOOTMEM_DEFAULT); |
@@ -378,6 +380,17 @@ static void __init setup_bootmem(void) | |||
378 | request_resource(&sysram_resources[0], &pdcdata_resource); | 380 | request_resource(&sysram_resources[0], &pdcdata_resource); |
379 | } | 381 | } |
380 | 382 | ||
383 | static int __init parisc_text_address(unsigned long vaddr) | ||
384 | { | ||
385 | static unsigned long head_ptr __initdata; | ||
386 | |||
387 | if (!head_ptr) | ||
388 | head_ptr = PAGE_MASK & (unsigned long) | ||
389 | dereference_function_descriptor(&parisc_kernel_start); | ||
390 | |||
391 | return core_kernel_text(vaddr) || vaddr == head_ptr; | ||
392 | } | ||
393 | |||
381 | static void __init map_pages(unsigned long start_vaddr, | 394 | static void __init map_pages(unsigned long start_vaddr, |
382 | unsigned long start_paddr, unsigned long size, | 395 | unsigned long start_paddr, unsigned long size, |
383 | pgprot_t pgprot, int force) | 396 | pgprot_t pgprot, int force) |
@@ -466,7 +479,7 @@ static void __init map_pages(unsigned long start_vaddr, | |||
466 | */ | 479 | */ |
467 | if (force) | 480 | if (force) |
468 | pte = __mk_pte(address, pgprot); | 481 | pte = __mk_pte(address, pgprot); |
469 | else if (core_kernel_text(vaddr) && | 482 | else if (parisc_text_address(vaddr) && |
470 | address != fv_addr) | 483 | address != fv_addr) |
471 | pte = __mk_pte(address, PAGE_KERNEL_EXEC); | 484 | pte = __mk_pte(address, PAGE_KERNEL_EXEC); |
472 | else | 485 | else |
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 8a2463670a5b..0f4344e6fbca 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -75,8 +75,10 @@ LDEMULATION := lppc | |||
75 | GNUTARGET := powerpcle | 75 | GNUTARGET := powerpcle |
76 | MULTIPLEWORD := -mno-multiple | 76 | MULTIPLEWORD := -mno-multiple |
77 | else | 77 | else |
78 | ifeq ($(call cc-option-yn,-mbig-endian),y) | ||
78 | override CC += -mbig-endian | 79 | override CC += -mbig-endian |
79 | override AS += -mbig-endian | 80 | override AS += -mbig-endian |
81 | endif | ||
80 | override LD += -EB | 82 | override LD += -EB |
81 | LDEMULATION := ppc | 83 | LDEMULATION := ppc |
82 | GNUTARGET := powerpc | 84 | GNUTARGET := powerpc |
@@ -128,7 +130,12 @@ CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5) | |||
128 | CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6) | 130 | CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6) |
129 | CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7) | 131 | CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7) |
130 | 132 | ||
133 | # Altivec option not allowed with e500mc64 in GCC. | ||
134 | ifeq ($(CONFIG_ALTIVEC),y) | ||
135 | E5500_CPU := -mcpu=powerpc64 | ||
136 | else | ||
131 | E5500_CPU := $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64) | 137 | E5500_CPU := $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64) |
138 | endif | ||
132 | CFLAGS-$(CONFIG_E5500_CPU) += $(E5500_CPU) | 139 | CFLAGS-$(CONFIG_E5500_CPU) += $(E5500_CPU) |
133 | CFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU)) | 140 | CFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU)) |
134 | 141 | ||
diff --git a/arch/powerpc/boot/dts/xcalibur1501.dts b/arch/powerpc/boot/dts/xcalibur1501.dts index cc00f4ddd9a7..c409cbafb126 100644 --- a/arch/powerpc/boot/dts/xcalibur1501.dts +++ b/arch/powerpc/boot/dts/xcalibur1501.dts | |||
@@ -637,14 +637,14 @@ | |||
637 | tlu@2f000 { | 637 | tlu@2f000 { |
638 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; | 638 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; |
639 | reg = <0x2f000 0x1000>; | 639 | reg = <0x2f000 0x1000>; |
640 | interupts = <61 2 >; | 640 | interrupts = <61 2>; |
641 | interrupt-parent = <&mpic>; | 641 | interrupt-parent = <&mpic>; |
642 | }; | 642 | }; |
643 | 643 | ||
644 | tlu@15000 { | 644 | tlu@15000 { |
645 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; | 645 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; |
646 | reg = <0x15000 0x1000>; | 646 | reg = <0x15000 0x1000>; |
647 | interupts = <75 2>; | 647 | interrupts = <75 2>; |
648 | interrupt-parent = <&mpic>; | 648 | interrupt-parent = <&mpic>; |
649 | }; | 649 | }; |
650 | }; | 650 | }; |
diff --git a/arch/powerpc/boot/dts/xpedite5301.dts b/arch/powerpc/boot/dts/xpedite5301.dts index 53c1c6a9752f..04cb410da48b 100644 --- a/arch/powerpc/boot/dts/xpedite5301.dts +++ b/arch/powerpc/boot/dts/xpedite5301.dts | |||
@@ -547,14 +547,14 @@ | |||
547 | tlu@2f000 { | 547 | tlu@2f000 { |
548 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; | 548 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; |
549 | reg = <0x2f000 0x1000>; | 549 | reg = <0x2f000 0x1000>; |
550 | interupts = <61 2 >; | 550 | interrupts = <61 2>; |
551 | interrupt-parent = <&mpic>; | 551 | interrupt-parent = <&mpic>; |
552 | }; | 552 | }; |
553 | 553 | ||
554 | tlu@15000 { | 554 | tlu@15000 { |
555 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; | 555 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; |
556 | reg = <0x15000 0x1000>; | 556 | reg = <0x15000 0x1000>; |
557 | interupts = <75 2>; | 557 | interrupts = <75 2>; |
558 | interrupt-parent = <&mpic>; | 558 | interrupt-parent = <&mpic>; |
559 | }; | 559 | }; |
560 | }; | 560 | }; |
diff --git a/arch/powerpc/boot/dts/xpedite5330.dts b/arch/powerpc/boot/dts/xpedite5330.dts index 215225983150..73f8620f1ce7 100644 --- a/arch/powerpc/boot/dts/xpedite5330.dts +++ b/arch/powerpc/boot/dts/xpedite5330.dts | |||
@@ -583,14 +583,14 @@ | |||
583 | tlu@2f000 { | 583 | tlu@2f000 { |
584 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; | 584 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; |
585 | reg = <0x2f000 0x1000>; | 585 | reg = <0x2f000 0x1000>; |
586 | interupts = <61 2 >; | 586 | interrupts = <61 2>; |
587 | interrupt-parent = <&mpic>; | 587 | interrupt-parent = <&mpic>; |
588 | }; | 588 | }; |
589 | 589 | ||
590 | tlu@15000 { | 590 | tlu@15000 { |
591 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; | 591 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; |
592 | reg = <0x15000 0x1000>; | 592 | reg = <0x15000 0x1000>; |
593 | interupts = <75 2>; | 593 | interrupts = <75 2>; |
594 | interrupt-parent = <&mpic>; | 594 | interrupt-parent = <&mpic>; |
595 | }; | 595 | }; |
596 | }; | 596 | }; |
diff --git a/arch/powerpc/boot/dts/xpedite5370.dts b/arch/powerpc/boot/dts/xpedite5370.dts index 11dbda10d756..cd0ea2b99362 100644 --- a/arch/powerpc/boot/dts/xpedite5370.dts +++ b/arch/powerpc/boot/dts/xpedite5370.dts | |||
@@ -545,14 +545,14 @@ | |||
545 | tlu@2f000 { | 545 | tlu@2f000 { |
546 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; | 546 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; |
547 | reg = <0x2f000 0x1000>; | 547 | reg = <0x2f000 0x1000>; |
548 | interupts = <61 2 >; | 548 | interrupts = <61 2>; |
549 | interrupt-parent = <&mpic>; | 549 | interrupt-parent = <&mpic>; |
550 | }; | 550 | }; |
551 | 551 | ||
552 | tlu@15000 { | 552 | tlu@15000 { |
553 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; | 553 | compatible = "fsl,mpc8572-tlu", "fsl_tlu"; |
554 | reg = <0x15000 0x1000>; | 554 | reg = <0x15000 0x1000>; |
555 | interupts = <75 2>; | 555 | interrupts = <75 2>; |
556 | interrupt-parent = <&mpic>; | 556 | interrupt-parent = <&mpic>; |
557 | }; | 557 | }; |
558 | }; | 558 | }; |
diff --git a/arch/powerpc/boot/util.S b/arch/powerpc/boot/util.S index 5143228e3e5f..6636b1d7821b 100644 --- a/arch/powerpc/boot/util.S +++ b/arch/powerpc/boot/util.S | |||
@@ -71,18 +71,32 @@ udelay: | |||
71 | add r4,r4,r5 | 71 | add r4,r4,r5 |
72 | addi r4,r4,-1 | 72 | addi r4,r4,-1 |
73 | divw r4,r4,r5 /* BUS ticks */ | 73 | divw r4,r4,r5 /* BUS ticks */ |
74 | #ifdef CONFIG_8xx | ||
75 | 1: mftbu r5 | ||
76 | mftb r6 | ||
77 | mftbu r7 | ||
78 | #else | ||
74 | 1: mfspr r5, SPRN_TBRU | 79 | 1: mfspr r5, SPRN_TBRU |
75 | mfspr r6, SPRN_TBRL | 80 | mfspr r6, SPRN_TBRL |
76 | mfspr r7, SPRN_TBRU | 81 | mfspr r7, SPRN_TBRU |
82 | #endif | ||
77 | cmpw 0,r5,r7 | 83 | cmpw 0,r5,r7 |
78 | bne 1b /* Get [synced] base time */ | 84 | bne 1b /* Get [synced] base time */ |
79 | addc r9,r6,r4 /* Compute end time */ | 85 | addc r9,r6,r4 /* Compute end time */ |
80 | addze r8,r5 | 86 | addze r8,r5 |
87 | #ifdef CONFIG_8xx | ||
88 | 2: mftbu r5 | ||
89 | #else | ||
81 | 2: mfspr r5, SPRN_TBRU | 90 | 2: mfspr r5, SPRN_TBRU |
91 | #endif | ||
82 | cmpw 0,r5,r8 | 92 | cmpw 0,r5,r8 |
83 | blt 2b | 93 | blt 2b |
84 | bgt 3f | 94 | bgt 3f |
95 | #ifdef CONFIG_8xx | ||
96 | mftb r6 | ||
97 | #else | ||
85 | mfspr r6, SPRN_TBRL | 98 | mfspr r6, SPRN_TBRL |
99 | #endif | ||
86 | cmpw 0,r6,r9 | 100 | cmpw 0,r6,r9 |
87 | blt 2b | 101 | blt 2b |
88 | 3: blr | 102 | 3: blr |
diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h index 16cb92d215d2..694012877bf7 100644 --- a/arch/powerpc/include/asm/pgalloc-64.h +++ b/arch/powerpc/include/asm/pgalloc-64.h | |||
@@ -16,6 +16,7 @@ struct vmemmap_backing { | |||
16 | unsigned long phys; | 16 | unsigned long phys; |
17 | unsigned long virt_addr; | 17 | unsigned long virt_addr; |
18 | }; | 18 | }; |
19 | extern struct vmemmap_backing *vmemmap_list; | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * Functions that deal with pagetables that could be at any level of | 22 | * Functions that deal with pagetables that could be at any level of |
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 3c1acc31a092..f595b98079ee 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h | |||
@@ -366,6 +366,8 @@ BEGIN_FTR_SECTION_NESTED(96); \ | |||
366 | cmpwi dest,0; \ | 366 | cmpwi dest,0; \ |
367 | beq- 90b; \ | 367 | beq- 90b; \ |
368 | END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96) | 368 | END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96) |
369 | #elif defined(CONFIG_8xx) | ||
370 | #define MFTB(dest) mftb dest | ||
369 | #else | 371 | #else |
370 | #define MFTB(dest) mfspr dest, SPRN_TBRL | 372 | #define MFTB(dest) mfspr dest, SPRN_TBRL |
371 | #endif | 373 | #endif |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 5c45787d551e..fa8388ed94c5 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -1174,12 +1174,19 @@ | |||
1174 | 1174 | ||
1175 | #else /* __powerpc64__ */ | 1175 | #else /* __powerpc64__ */ |
1176 | 1176 | ||
1177 | #if defined(CONFIG_8xx) | ||
1178 | #define mftbl() ({unsigned long rval; \ | ||
1179 | asm volatile("mftbl %0" : "=r" (rval)); rval;}) | ||
1180 | #define mftbu() ({unsigned long rval; \ | ||
1181 | asm volatile("mftbu %0" : "=r" (rval)); rval;}) | ||
1182 | #else | ||
1177 | #define mftbl() ({unsigned long rval; \ | 1183 | #define mftbl() ({unsigned long rval; \ |
1178 | asm volatile("mfspr %0, %1" : "=r" (rval) : \ | 1184 | asm volatile("mfspr %0, %1" : "=r" (rval) : \ |
1179 | "i" (SPRN_TBRL)); rval;}) | 1185 | "i" (SPRN_TBRL)); rval;}) |
1180 | #define mftbu() ({unsigned long rval; \ | 1186 | #define mftbu() ({unsigned long rval; \ |
1181 | asm volatile("mfspr %0, %1" : "=r" (rval) : \ | 1187 | asm volatile("mfspr %0, %1" : "=r" (rval) : \ |
1182 | "i" (SPRN_TBRU)); rval;}) | 1188 | "i" (SPRN_TBRU)); rval;}) |
1189 | #endif | ||
1183 | #endif /* !__powerpc64__ */ | 1190 | #endif /* !__powerpc64__ */ |
1184 | 1191 | ||
1185 | #define mttbl(v) asm volatile("mttbl %0":: "r"(v)) | 1192 | #define mttbl(v) asm volatile("mttbl %0":: "r"(v)) |
diff --git a/arch/powerpc/include/asm/timex.h b/arch/powerpc/include/asm/timex.h index 18908caa1f3b..2cf846edb3fc 100644 --- a/arch/powerpc/include/asm/timex.h +++ b/arch/powerpc/include/asm/timex.h | |||
@@ -29,7 +29,11 @@ static inline cycles_t get_cycles(void) | |||
29 | ret = 0; | 29 | ret = 0; |
30 | 30 | ||
31 | __asm__ __volatile__( | 31 | __asm__ __volatile__( |
32 | #ifdef CONFIG_8xx | ||
33 | "97: mftb %0\n" | ||
34 | #else | ||
32 | "97: mfspr %0, %2\n" | 35 | "97: mfspr %0, %2\n" |
36 | #endif | ||
33 | "99:\n" | 37 | "99:\n" |
34 | ".section __ftr_fixup,\"a\"\n" | 38 | ".section __ftr_fixup,\"a\"\n" |
35 | ".align 2\n" | 39 | ".align 2\n" |
@@ -41,7 +45,11 @@ static inline cycles_t get_cycles(void) | |||
41 | " .long 0\n" | 45 | " .long 0\n" |
42 | " .long 0\n" | 46 | " .long 0\n" |
43 | ".previous" | 47 | ".previous" |
48 | #ifdef CONFIG_8xx | ||
49 | : "=r" (ret) : "i" (CPU_FTR_601)); | ||
50 | #else | ||
44 | : "=r" (ret) : "i" (CPU_FTR_601), "i" (SPRN_TBRL)); | 51 | : "=r" (ret) : "i" (CPU_FTR_601), "i" (SPRN_TBRL)); |
52 | #endif | ||
45 | return ret; | 53 | return ret; |
46 | #endif | 54 | #endif |
47 | } | 55 | } |
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index e1ec57e87b3b..88a7fb458dfd 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/ftrace.h> | 18 | #include <linux/ftrace.h> |
19 | 19 | ||
20 | #include <asm/machdep.h> | 20 | #include <asm/machdep.h> |
21 | #include <asm/pgalloc.h> | ||
21 | #include <asm/prom.h> | 22 | #include <asm/prom.h> |
22 | #include <asm/sections.h> | 23 | #include <asm/sections.h> |
23 | 24 | ||
@@ -75,6 +76,17 @@ void arch_crash_save_vmcoreinfo(void) | |||
75 | #ifndef CONFIG_NEED_MULTIPLE_NODES | 76 | #ifndef CONFIG_NEED_MULTIPLE_NODES |
76 | VMCOREINFO_SYMBOL(contig_page_data); | 77 | VMCOREINFO_SYMBOL(contig_page_data); |
77 | #endif | 78 | #endif |
79 | #if defined(CONFIG_PPC64) && defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
80 | VMCOREINFO_SYMBOL(vmemmap_list); | ||
81 | VMCOREINFO_SYMBOL(mmu_vmemmap_psize); | ||
82 | VMCOREINFO_SYMBOL(mmu_psize_defs); | ||
83 | VMCOREINFO_STRUCT_SIZE(vmemmap_backing); | ||
84 | VMCOREINFO_OFFSET(vmemmap_backing, list); | ||
85 | VMCOREINFO_OFFSET(vmemmap_backing, phys); | ||
86 | VMCOREINFO_OFFSET(vmemmap_backing, virt_addr); | ||
87 | VMCOREINFO_STRUCT_SIZE(mmu_psize_def); | ||
88 | VMCOREINFO_OFFSET(mmu_psize_def, shift); | ||
89 | #endif | ||
78 | } | 90 | } |
79 | 91 | ||
80 | /* | 92 | /* |
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index fd82c289ab1c..28b898e68185 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c | |||
@@ -210,7 +210,7 @@ static void __init nvram_print_partitions(char * label) | |||
210 | printk(KERN_WARNING "--------%s---------\n", label); | 210 | printk(KERN_WARNING "--------%s---------\n", label); |
211 | printk(KERN_WARNING "indx\t\tsig\tchks\tlen\tname\n"); | 211 | printk(KERN_WARNING "indx\t\tsig\tchks\tlen\tname\n"); |
212 | list_for_each_entry(tmp_part, &nvram_partitions, partition) { | 212 | list_for_each_entry(tmp_part, &nvram_partitions, partition) { |
213 | printk(KERN_WARNING "%4d \t%02x\t%02x\t%d\t%12s\n", | 213 | printk(KERN_WARNING "%4d \t%02x\t%02x\t%d\t%12.12s\n", |
214 | tmp_part->index, tmp_part->header.signature, | 214 | tmp_part->index, tmp_part->header.signature, |
215 | tmp_part->header.checksum, tmp_part->header.length, | 215 | tmp_part->header.checksum, tmp_part->header.length, |
216 | tmp_part->header.name); | 216 | tmp_part->header.name); |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 1844298f5ea4..68027bfa5f8e 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
@@ -445,6 +445,12 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, | |||
445 | #endif /* CONFIG_ALTIVEC */ | 445 | #endif /* CONFIG_ALTIVEC */ |
446 | if (copy_fpr_to_user(&frame->mc_fregs, current)) | 446 | if (copy_fpr_to_user(&frame->mc_fregs, current)) |
447 | return 1; | 447 | return 1; |
448 | |||
449 | /* | ||
450 | * Clear the MSR VSX bit to indicate there is no valid state attached | ||
451 | * to this context, except in the specific case below where we set it. | ||
452 | */ | ||
453 | msr &= ~MSR_VSX; | ||
448 | #ifdef CONFIG_VSX | 454 | #ifdef CONFIG_VSX |
449 | /* | 455 | /* |
450 | * Copy VSR 0-31 upper half from thread_struct to local | 456 | * Copy VSR 0-31 upper half from thread_struct to local |
@@ -457,15 +463,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, | |||
457 | if (copy_vsx_to_user(&frame->mc_vsregs, current)) | 463 | if (copy_vsx_to_user(&frame->mc_vsregs, current)) |
458 | return 1; | 464 | return 1; |
459 | msr |= MSR_VSX; | 465 | msr |= MSR_VSX; |
460 | } else if (!ctx_has_vsx_region) | 466 | } |
461 | /* | ||
462 | * With a small context structure we can't hold the VSX | ||
463 | * registers, hence clear the MSR value to indicate the state | ||
464 | * was not saved. | ||
465 | */ | ||
466 | msr &= ~MSR_VSX; | ||
467 | |||
468 | |||
469 | #endif /* CONFIG_VSX */ | 467 | #endif /* CONFIG_VSX */ |
470 | #ifdef CONFIG_SPE | 468 | #ifdef CONFIG_SPE |
471 | /* save spe registers */ | 469 | /* save spe registers */ |
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index e66f67b8b9e6..42991045349f 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -122,6 +122,12 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, | |||
122 | flush_fp_to_thread(current); | 122 | flush_fp_to_thread(current); |
123 | /* copy fpr regs and fpscr */ | 123 | /* copy fpr regs and fpscr */ |
124 | err |= copy_fpr_to_user(&sc->fp_regs, current); | 124 | err |= copy_fpr_to_user(&sc->fp_regs, current); |
125 | |||
126 | /* | ||
127 | * Clear the MSR VSX bit to indicate there is no valid state attached | ||
128 | * to this context, except in the specific case below where we set it. | ||
129 | */ | ||
130 | msr &= ~MSR_VSX; | ||
125 | #ifdef CONFIG_VSX | 131 | #ifdef CONFIG_VSX |
126 | /* | 132 | /* |
127 | * Copy VSX low doubleword to local buffer for formatting, | 133 | * Copy VSX low doubleword to local buffer for formatting, |
diff --git a/arch/powerpc/kernel/vdso32/gettimeofday.S b/arch/powerpc/kernel/vdso32/gettimeofday.S index 6b1f2a6d5517..6b2b69616e77 100644 --- a/arch/powerpc/kernel/vdso32/gettimeofday.S +++ b/arch/powerpc/kernel/vdso32/gettimeofday.S | |||
@@ -232,9 +232,15 @@ __do_get_tspec: | |||
232 | lwz r6,(CFG_TB_ORIG_STAMP+4)(r9) | 232 | lwz r6,(CFG_TB_ORIG_STAMP+4)(r9) |
233 | 233 | ||
234 | /* Get a stable TB value */ | 234 | /* Get a stable TB value */ |
235 | #ifdef CONFIG_8xx | ||
236 | 2: mftbu r3 | ||
237 | mftbl r4 | ||
238 | mftbu r0 | ||
239 | #else | ||
235 | 2: mfspr r3, SPRN_TBRU | 240 | 2: mfspr r3, SPRN_TBRU |
236 | mfspr r4, SPRN_TBRL | 241 | mfspr r4, SPRN_TBRL |
237 | mfspr r0, SPRN_TBRU | 242 | mfspr r0, SPRN_TBRU |
243 | #endif | ||
238 | cmplw cr0,r3,r0 | 244 | cmplw cr0,r3,r0 |
239 | bne- 2b | 245 | bne- 2b |
240 | 246 | ||
diff --git a/arch/powerpc/mm/hugetlbpage-book3e.c b/arch/powerpc/mm/hugetlbpage-book3e.c index 3bc700655fc8..74551b5e41e5 100644 --- a/arch/powerpc/mm/hugetlbpage-book3e.c +++ b/arch/powerpc/mm/hugetlbpage-book3e.c | |||
@@ -117,6 +117,5 @@ void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr) | |||
117 | struct hstate *hstate = hstate_file(vma->vm_file); | 117 | struct hstate *hstate = hstate_file(vma->vm_file); |
118 | unsigned long tsize = huge_page_shift(hstate) - 10; | 118 | unsigned long tsize = huge_page_shift(hstate) - 10; |
119 | 119 | ||
120 | __flush_tlb_page(vma ? vma->vm_mm : NULL, vmaddr, tsize, 0); | 120 | __flush_tlb_page(vma->vm_mm, vmaddr, tsize, 0); |
121 | |||
122 | } | 121 | } |
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c index 41cd68dee681..358d74303138 100644 --- a/arch/powerpc/mm/tlb_nohash.c +++ b/arch/powerpc/mm/tlb_nohash.c | |||
@@ -305,7 +305,7 @@ void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr, | |||
305 | void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr) | 305 | void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr) |
306 | { | 306 | { |
307 | #ifdef CONFIG_HUGETLB_PAGE | 307 | #ifdef CONFIG_HUGETLB_PAGE |
308 | if (is_vm_hugetlb_page(vma)) | 308 | if (vma && is_vm_hugetlb_page(vma)) |
309 | flush_hugetlb_page(vma, vmaddr); | 309 | flush_hugetlb_page(vma, vmaddr); |
310 | #endif | 310 | #endif |
311 | 311 | ||
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 132f8726a257..bca2465a9c34 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype | |||
@@ -404,13 +404,27 @@ config PPC_DOORBELL | |||
404 | 404 | ||
405 | endmenu | 405 | endmenu |
406 | 406 | ||
407 | config CPU_LITTLE_ENDIAN | 407 | choice |
408 | bool "Build little endian kernel" | 408 | prompt "Endianness selection" |
409 | default n | 409 | default CPU_BIG_ENDIAN |
410 | help | 410 | help |
411 | This option selects whether a big endian or little endian kernel will | 411 | This option selects whether a big endian or little endian kernel will |
412 | be built. | 412 | be built. |
413 | 413 | ||
414 | config CPU_BIG_ENDIAN | ||
415 | bool "Build big endian kernel" | ||
416 | help | ||
417 | Build a big endian kernel. | ||
418 | |||
419 | If unsure, select this option. | ||
420 | |||
421 | config CPU_LITTLE_ENDIAN | ||
422 | bool "Build little endian kernel" | ||
423 | help | ||
424 | Build a little endian kernel. | ||
425 | |||
414 | Note that if cross compiling a little endian kernel, | 426 | Note that if cross compiling a little endian kernel, |
415 | CROSS_COMPILE must point to a toolchain capable of targeting | 427 | CROSS_COMPILE must point to a toolchain capable of targeting |
416 | little endian powerpc. | 428 | little endian powerpc. |
429 | |||
430 | endchoice | ||
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 314fced4fc14..5877e71901b3 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -101,7 +101,7 @@ config S390 | |||
101 | select GENERIC_CPU_DEVICES if !SMP | 101 | select GENERIC_CPU_DEVICES if !SMP |
102 | select GENERIC_FIND_FIRST_BIT | 102 | select GENERIC_FIND_FIRST_BIT |
103 | select GENERIC_SMP_IDLE_THREAD | 103 | select GENERIC_SMP_IDLE_THREAD |
104 | select GENERIC_TIME_VSYSCALL_OLD | 104 | select GENERIC_TIME_VSYSCALL |
105 | select HAVE_ALIGNED_STRUCT_PAGE if SLUB | 105 | select HAVE_ALIGNED_STRUCT_PAGE if SLUB |
106 | select HAVE_ARCH_JUMP_LABEL if !MARCH_G5 | 106 | select HAVE_ARCH_JUMP_LABEL if !MARCH_G5 |
107 | select HAVE_ARCH_SECCOMP_FILTER | 107 | select HAVE_ARCH_SECCOMP_FILTER |
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index 46cae138ece2..b3feabd39f31 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c | |||
@@ -35,7 +35,6 @@ static u8 *ctrblk; | |||
35 | static char keylen_flag; | 35 | static char keylen_flag; |
36 | 36 | ||
37 | struct s390_aes_ctx { | 37 | struct s390_aes_ctx { |
38 | u8 iv[AES_BLOCK_SIZE]; | ||
39 | u8 key[AES_MAX_KEY_SIZE]; | 38 | u8 key[AES_MAX_KEY_SIZE]; |
40 | long enc; | 39 | long enc; |
41 | long dec; | 40 | long dec; |
@@ -56,8 +55,7 @@ struct pcc_param { | |||
56 | 55 | ||
57 | struct s390_xts_ctx { | 56 | struct s390_xts_ctx { |
58 | u8 key[32]; | 57 | u8 key[32]; |
59 | u8 xts_param[16]; | 58 | u8 pcc_key[32]; |
60 | struct pcc_param pcc; | ||
61 | long enc; | 59 | long enc; |
62 | long dec; | 60 | long dec; |
63 | int key_len; | 61 | int key_len; |
@@ -441,30 +439,36 @@ static int cbc_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, | |||
441 | return aes_set_key(tfm, in_key, key_len); | 439 | return aes_set_key(tfm, in_key, key_len); |
442 | } | 440 | } |
443 | 441 | ||
444 | static int cbc_aes_crypt(struct blkcipher_desc *desc, long func, void *param, | 442 | static int cbc_aes_crypt(struct blkcipher_desc *desc, long func, |
445 | struct blkcipher_walk *walk) | 443 | struct blkcipher_walk *walk) |
446 | { | 444 | { |
445 | struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); | ||
447 | int ret = blkcipher_walk_virt(desc, walk); | 446 | int ret = blkcipher_walk_virt(desc, walk); |
448 | unsigned int nbytes = walk->nbytes; | 447 | unsigned int nbytes = walk->nbytes; |
448 | struct { | ||
449 | u8 iv[AES_BLOCK_SIZE]; | ||
450 | u8 key[AES_MAX_KEY_SIZE]; | ||
451 | } param; | ||
449 | 452 | ||
450 | if (!nbytes) | 453 | if (!nbytes) |
451 | goto out; | 454 | goto out; |
452 | 455 | ||
453 | memcpy(param, walk->iv, AES_BLOCK_SIZE); | 456 | memcpy(param.iv, walk->iv, AES_BLOCK_SIZE); |
457 | memcpy(param.key, sctx->key, sctx->key_len); | ||
454 | do { | 458 | do { |
455 | /* only use complete blocks */ | 459 | /* only use complete blocks */ |
456 | unsigned int n = nbytes & ~(AES_BLOCK_SIZE - 1); | 460 | unsigned int n = nbytes & ~(AES_BLOCK_SIZE - 1); |
457 | u8 *out = walk->dst.virt.addr; | 461 | u8 *out = walk->dst.virt.addr; |
458 | u8 *in = walk->src.virt.addr; | 462 | u8 *in = walk->src.virt.addr; |
459 | 463 | ||
460 | ret = crypt_s390_kmc(func, param, out, in, n); | 464 | ret = crypt_s390_kmc(func, ¶m, out, in, n); |
461 | if (ret < 0 || ret != n) | 465 | if (ret < 0 || ret != n) |
462 | return -EIO; | 466 | return -EIO; |
463 | 467 | ||
464 | nbytes &= AES_BLOCK_SIZE - 1; | 468 | nbytes &= AES_BLOCK_SIZE - 1; |
465 | ret = blkcipher_walk_done(desc, walk, nbytes); | 469 | ret = blkcipher_walk_done(desc, walk, nbytes); |
466 | } while ((nbytes = walk->nbytes)); | 470 | } while ((nbytes = walk->nbytes)); |
467 | memcpy(walk->iv, param, AES_BLOCK_SIZE); | 471 | memcpy(walk->iv, param.iv, AES_BLOCK_SIZE); |
468 | 472 | ||
469 | out: | 473 | out: |
470 | return ret; | 474 | return ret; |
@@ -481,7 +485,7 @@ static int cbc_aes_encrypt(struct blkcipher_desc *desc, | |||
481 | return fallback_blk_enc(desc, dst, src, nbytes); | 485 | return fallback_blk_enc(desc, dst, src, nbytes); |
482 | 486 | ||
483 | blkcipher_walk_init(&walk, dst, src, nbytes); | 487 | blkcipher_walk_init(&walk, dst, src, nbytes); |
484 | return cbc_aes_crypt(desc, sctx->enc, sctx->iv, &walk); | 488 | return cbc_aes_crypt(desc, sctx->enc, &walk); |
485 | } | 489 | } |
486 | 490 | ||
487 | static int cbc_aes_decrypt(struct blkcipher_desc *desc, | 491 | static int cbc_aes_decrypt(struct blkcipher_desc *desc, |
@@ -495,7 +499,7 @@ static int cbc_aes_decrypt(struct blkcipher_desc *desc, | |||
495 | return fallback_blk_dec(desc, dst, src, nbytes); | 499 | return fallback_blk_dec(desc, dst, src, nbytes); |
496 | 500 | ||
497 | blkcipher_walk_init(&walk, dst, src, nbytes); | 501 | blkcipher_walk_init(&walk, dst, src, nbytes); |
498 | return cbc_aes_crypt(desc, sctx->dec, sctx->iv, &walk); | 502 | return cbc_aes_crypt(desc, sctx->dec, &walk); |
499 | } | 503 | } |
500 | 504 | ||
501 | static struct crypto_alg cbc_aes_alg = { | 505 | static struct crypto_alg cbc_aes_alg = { |
@@ -586,7 +590,7 @@ static int xts_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, | |||
586 | xts_ctx->enc = KM_XTS_128_ENCRYPT; | 590 | xts_ctx->enc = KM_XTS_128_ENCRYPT; |
587 | xts_ctx->dec = KM_XTS_128_DECRYPT; | 591 | xts_ctx->dec = KM_XTS_128_DECRYPT; |
588 | memcpy(xts_ctx->key + 16, in_key, 16); | 592 | memcpy(xts_ctx->key + 16, in_key, 16); |
589 | memcpy(xts_ctx->pcc.key + 16, in_key + 16, 16); | 593 | memcpy(xts_ctx->pcc_key + 16, in_key + 16, 16); |
590 | break; | 594 | break; |
591 | case 48: | 595 | case 48: |
592 | xts_ctx->enc = 0; | 596 | xts_ctx->enc = 0; |
@@ -597,7 +601,7 @@ static int xts_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, | |||
597 | xts_ctx->enc = KM_XTS_256_ENCRYPT; | 601 | xts_ctx->enc = KM_XTS_256_ENCRYPT; |
598 | xts_ctx->dec = KM_XTS_256_DECRYPT; | 602 | xts_ctx->dec = KM_XTS_256_DECRYPT; |
599 | memcpy(xts_ctx->key, in_key, 32); | 603 | memcpy(xts_ctx->key, in_key, 32); |
600 | memcpy(xts_ctx->pcc.key, in_key + 32, 32); | 604 | memcpy(xts_ctx->pcc_key, in_key + 32, 32); |
601 | break; | 605 | break; |
602 | default: | 606 | default: |
603 | *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; | 607 | *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; |
@@ -616,29 +620,33 @@ static int xts_aes_crypt(struct blkcipher_desc *desc, long func, | |||
616 | unsigned int nbytes = walk->nbytes; | 620 | unsigned int nbytes = walk->nbytes; |
617 | unsigned int n; | 621 | unsigned int n; |
618 | u8 *in, *out; | 622 | u8 *in, *out; |
619 | void *param; | 623 | struct pcc_param pcc_param; |
624 | struct { | ||
625 | u8 key[32]; | ||
626 | u8 init[16]; | ||
627 | } xts_param; | ||
620 | 628 | ||
621 | if (!nbytes) | 629 | if (!nbytes) |
622 | goto out; | 630 | goto out; |
623 | 631 | ||
624 | memset(xts_ctx->pcc.block, 0, sizeof(xts_ctx->pcc.block)); | 632 | memset(pcc_param.block, 0, sizeof(pcc_param.block)); |
625 | memset(xts_ctx->pcc.bit, 0, sizeof(xts_ctx->pcc.bit)); | 633 | memset(pcc_param.bit, 0, sizeof(pcc_param.bit)); |
626 | memset(xts_ctx->pcc.xts, 0, sizeof(xts_ctx->pcc.xts)); | 634 | memset(pcc_param.xts, 0, sizeof(pcc_param.xts)); |
627 | memcpy(xts_ctx->pcc.tweak, walk->iv, sizeof(xts_ctx->pcc.tweak)); | 635 | memcpy(pcc_param.tweak, walk->iv, sizeof(pcc_param.tweak)); |
628 | param = xts_ctx->pcc.key + offset; | 636 | memcpy(pcc_param.key, xts_ctx->pcc_key, 32); |
629 | ret = crypt_s390_pcc(func, param); | 637 | ret = crypt_s390_pcc(func, &pcc_param.key[offset]); |
630 | if (ret < 0) | 638 | if (ret < 0) |
631 | return -EIO; | 639 | return -EIO; |
632 | 640 | ||
633 | memcpy(xts_ctx->xts_param, xts_ctx->pcc.xts, 16); | 641 | memcpy(xts_param.key, xts_ctx->key, 32); |
634 | param = xts_ctx->key + offset; | 642 | memcpy(xts_param.init, pcc_param.xts, 16); |
635 | do { | 643 | do { |
636 | /* only use complete blocks */ | 644 | /* only use complete blocks */ |
637 | n = nbytes & ~(AES_BLOCK_SIZE - 1); | 645 | n = nbytes & ~(AES_BLOCK_SIZE - 1); |
638 | out = walk->dst.virt.addr; | 646 | out = walk->dst.virt.addr; |
639 | in = walk->src.virt.addr; | 647 | in = walk->src.virt.addr; |
640 | 648 | ||
641 | ret = crypt_s390_km(func, param, out, in, n); | 649 | ret = crypt_s390_km(func, &xts_param.key[offset], out, in, n); |
642 | if (ret < 0 || ret != n) | 650 | if (ret < 0 || ret != n) |
643 | return -EIO; | 651 | return -EIO; |
644 | 652 | ||
diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h index 316c8503a3b4..114258eeaacd 100644 --- a/arch/s390/include/asm/page.h +++ b/arch/s390/include/asm/page.h | |||
@@ -48,33 +48,21 @@ static inline void clear_page(void *page) | |||
48 | : "memory", "cc"); | 48 | : "memory", "cc"); |
49 | } | 49 | } |
50 | 50 | ||
51 | /* | ||
52 | * copy_page uses the mvcl instruction with 0xb0 padding byte in order to | ||
53 | * bypass caches when copying a page. Especially when copying huge pages | ||
54 | * this keeps L1 and L2 data caches alive. | ||
55 | */ | ||
51 | static inline void copy_page(void *to, void *from) | 56 | static inline void copy_page(void *to, void *from) |
52 | { | 57 | { |
53 | if (MACHINE_HAS_MVPG) { | 58 | register void *reg2 asm ("2") = to; |
54 | register unsigned long reg0 asm ("0") = 0; | 59 | register unsigned long reg3 asm ("3") = 0x1000; |
55 | asm volatile( | 60 | register void *reg4 asm ("4") = from; |
56 | " mvpg %0,%1" | 61 | register unsigned long reg5 asm ("5") = 0xb0001000; |
57 | : : "a" (to), "a" (from), "d" (reg0) | 62 | asm volatile( |
58 | : "memory", "cc"); | 63 | " mvcl 2,4" |
59 | } else | 64 | : "+d" (reg2), "+d" (reg3), "+d" (reg4), "+d" (reg5) |
60 | asm volatile( | 65 | : : "memory", "cc"); |
61 | " mvc 0(256,%0),0(%1)\n" | ||
62 | " mvc 256(256,%0),256(%1)\n" | ||
63 | " mvc 512(256,%0),512(%1)\n" | ||
64 | " mvc 768(256,%0),768(%1)\n" | ||
65 | " mvc 1024(256,%0),1024(%1)\n" | ||
66 | " mvc 1280(256,%0),1280(%1)\n" | ||
67 | " mvc 1536(256,%0),1536(%1)\n" | ||
68 | " mvc 1792(256,%0),1792(%1)\n" | ||
69 | " mvc 2048(256,%0),2048(%1)\n" | ||
70 | " mvc 2304(256,%0),2304(%1)\n" | ||
71 | " mvc 2560(256,%0),2560(%1)\n" | ||
72 | " mvc 2816(256,%0),2816(%1)\n" | ||
73 | " mvc 3072(256,%0),3072(%1)\n" | ||
74 | " mvc 3328(256,%0),3328(%1)\n" | ||
75 | " mvc 3584(256,%0),3584(%1)\n" | ||
76 | " mvc 3840(256,%0),3840(%1)\n" | ||
77 | : : "a" (to), "a" (from) : "memory"); | ||
78 | } | 66 | } |
79 | 67 | ||
80 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 68 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
diff --git a/arch/s390/include/asm/vdso.h b/arch/s390/include/asm/vdso.h index a73eb2e1e918..bc9746a7d47c 100644 --- a/arch/s390/include/asm/vdso.h +++ b/arch/s390/include/asm/vdso.h | |||
@@ -26,8 +26,9 @@ struct vdso_data { | |||
26 | __u64 wtom_clock_nsec; /* 0x28 */ | 26 | __u64 wtom_clock_nsec; /* 0x28 */ |
27 | __u32 tz_minuteswest; /* Minutes west of Greenwich 0x30 */ | 27 | __u32 tz_minuteswest; /* Minutes west of Greenwich 0x30 */ |
28 | __u32 tz_dsttime; /* Type of dst correction 0x34 */ | 28 | __u32 tz_dsttime; /* Type of dst correction 0x34 */ |
29 | __u32 ectg_available; | 29 | __u32 ectg_available; /* ECTG instruction present 0x38 */ |
30 | __u32 ntp_mult; /* NTP adjusted multiplier 0x3C */ | 30 | __u32 tk_mult; /* Mult. used for xtime_nsec 0x3c */ |
31 | __u32 tk_shift; /* Shift used for xtime_nsec 0x40 */ | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | struct vdso_per_cpu_data { | 34 | struct vdso_per_cpu_data { |
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c index 2416138ebd3e..496116cd65ec 100644 --- a/arch/s390/kernel/asm-offsets.c +++ b/arch/s390/kernel/asm-offsets.c | |||
@@ -65,7 +65,8 @@ int main(void) | |||
65 | DEFINE(__VDSO_WTOM_NSEC, offsetof(struct vdso_data, wtom_clock_nsec)); | 65 | DEFINE(__VDSO_WTOM_NSEC, offsetof(struct vdso_data, wtom_clock_nsec)); |
66 | DEFINE(__VDSO_TIMEZONE, offsetof(struct vdso_data, tz_minuteswest)); | 66 | DEFINE(__VDSO_TIMEZONE, offsetof(struct vdso_data, tz_minuteswest)); |
67 | DEFINE(__VDSO_ECTG_OK, offsetof(struct vdso_data, ectg_available)); | 67 | DEFINE(__VDSO_ECTG_OK, offsetof(struct vdso_data, ectg_available)); |
68 | DEFINE(__VDSO_NTP_MULT, offsetof(struct vdso_data, ntp_mult)); | 68 | DEFINE(__VDSO_TK_MULT, offsetof(struct vdso_data, tk_mult)); |
69 | DEFINE(__VDSO_TK_SHIFT, offsetof(struct vdso_data, tk_shift)); | ||
69 | DEFINE(__VDSO_ECTG_BASE, offsetof(struct vdso_per_cpu_data, ectg_timer_base)); | 70 | DEFINE(__VDSO_ECTG_BASE, offsetof(struct vdso_per_cpu_data, ectg_timer_base)); |
70 | DEFINE(__VDSO_ECTG_USER, offsetof(struct vdso_per_cpu_data, ectg_user_time)); | 71 | DEFINE(__VDSO_ECTG_USER, offsetof(struct vdso_per_cpu_data, ectg_user_time)); |
71 | /* constants used by the vdso */ | 72 | /* constants used by the vdso */ |
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index 6e2442978409..95e7ba0fbb7e 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c | |||
@@ -194,7 +194,7 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs) | |||
194 | return -EINVAL; | 194 | return -EINVAL; |
195 | 195 | ||
196 | /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */ | 196 | /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */ |
197 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | | 197 | regs->psw.mask = (regs->psw.mask & ~(PSW_MASK_USER | PSW_MASK_RI)) | |
198 | (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_USER) << 32 | | 198 | (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_USER) << 32 | |
199 | (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_RI) << 32 | | 199 | (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_RI) << 32 | |
200 | (__u64)(user_sregs.regs.psw.addr & PSW32_ADDR_AMODE); | 200 | (__u64)(user_sregs.regs.psw.addr & PSW32_ADDR_AMODE); |
diff --git a/arch/s390/kernel/pgm_check.S b/arch/s390/kernel/pgm_check.S index 4a460c44e17e..813ec7260878 100644 --- a/arch/s390/kernel/pgm_check.S +++ b/arch/s390/kernel/pgm_check.S | |||
@@ -78,7 +78,7 @@ PGM_CHECK_DEFAULT /* 34 */ | |||
78 | PGM_CHECK_DEFAULT /* 35 */ | 78 | PGM_CHECK_DEFAULT /* 35 */ |
79 | PGM_CHECK_DEFAULT /* 36 */ | 79 | PGM_CHECK_DEFAULT /* 36 */ |
80 | PGM_CHECK_DEFAULT /* 37 */ | 80 | PGM_CHECK_DEFAULT /* 37 */ |
81 | PGM_CHECK_DEFAULT /* 38 */ | 81 | PGM_CHECK_64BIT(do_dat_exception) /* 38 */ |
82 | PGM_CHECK_64BIT(do_dat_exception) /* 39 */ | 82 | PGM_CHECK_64BIT(do_dat_exception) /* 39 */ |
83 | PGM_CHECK_64BIT(do_dat_exception) /* 3a */ | 83 | PGM_CHECK_64BIT(do_dat_exception) /* 3a */ |
84 | PGM_CHECK_64BIT(do_dat_exception) /* 3b */ | 84 | PGM_CHECK_64BIT(do_dat_exception) /* 3b */ |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index fb535874a246..d8fd508ccd1e 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -94,7 +94,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs) | |||
94 | return -EINVAL; | 94 | return -EINVAL; |
95 | 95 | ||
96 | /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */ | 96 | /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */ |
97 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | | 97 | regs->psw.mask = (regs->psw.mask & ~(PSW_MASK_USER | PSW_MASK_RI)) | |
98 | (user_sregs.regs.psw.mask & (PSW_MASK_USER | PSW_MASK_RI)); | 98 | (user_sregs.regs.psw.mask & (PSW_MASK_USER | PSW_MASK_RI)); |
99 | /* Check for invalid user address space control. */ | 99 | /* Check for invalid user address space control. */ |
100 | if ((regs->psw.mask & PSW_MASK_ASC) == PSW_ASC_HOME) | 100 | if ((regs->psw.mask & PSW_MASK_ASC) == PSW_ASC_HOME) |
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 064c3082ab33..dd95f1631621 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c | |||
@@ -108,20 +108,10 @@ static void fixup_clock_comparator(unsigned long long delta) | |||
108 | set_clock_comparator(S390_lowcore.clock_comparator); | 108 | set_clock_comparator(S390_lowcore.clock_comparator); |
109 | } | 109 | } |
110 | 110 | ||
111 | static int s390_next_ktime(ktime_t expires, | 111 | static int s390_next_event(unsigned long delta, |
112 | struct clock_event_device *evt) | 112 | struct clock_event_device *evt) |
113 | { | 113 | { |
114 | struct timespec ts; | 114 | S390_lowcore.clock_comparator = get_tod_clock() + delta; |
115 | u64 nsecs; | ||
116 | |||
117 | ts.tv_sec = ts.tv_nsec = 0; | ||
118 | monotonic_to_bootbased(&ts); | ||
119 | nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires)); | ||
120 | do_div(nsecs, 125); | ||
121 | S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9); | ||
122 | /* Program the maximum value if we have an overflow (== year 2042) */ | ||
123 | if (unlikely(S390_lowcore.clock_comparator < sched_clock_base_cc)) | ||
124 | S390_lowcore.clock_comparator = -1ULL; | ||
125 | set_clock_comparator(S390_lowcore.clock_comparator); | 115 | set_clock_comparator(S390_lowcore.clock_comparator); |
126 | return 0; | 116 | return 0; |
127 | } | 117 | } |
@@ -146,15 +136,14 @@ void init_cpu_timer(void) | |||
146 | cpu = smp_processor_id(); | 136 | cpu = smp_processor_id(); |
147 | cd = &per_cpu(comparators, cpu); | 137 | cd = &per_cpu(comparators, cpu); |
148 | cd->name = "comparator"; | 138 | cd->name = "comparator"; |
149 | cd->features = CLOCK_EVT_FEAT_ONESHOT | | 139 | cd->features = CLOCK_EVT_FEAT_ONESHOT; |
150 | CLOCK_EVT_FEAT_KTIME; | ||
151 | cd->mult = 16777; | 140 | cd->mult = 16777; |
152 | cd->shift = 12; | 141 | cd->shift = 12; |
153 | cd->min_delta_ns = 1; | 142 | cd->min_delta_ns = 1; |
154 | cd->max_delta_ns = LONG_MAX; | 143 | cd->max_delta_ns = LONG_MAX; |
155 | cd->rating = 400; | 144 | cd->rating = 400; |
156 | cd->cpumask = cpumask_of(cpu); | 145 | cd->cpumask = cpumask_of(cpu); |
157 | cd->set_next_ktime = s390_next_ktime; | 146 | cd->set_next_event = s390_next_event; |
158 | cd->set_mode = s390_set_mode; | 147 | cd->set_mode = s390_set_mode; |
159 | 148 | ||
160 | clockevents_register_device(cd); | 149 | clockevents_register_device(cd); |
@@ -221,21 +210,30 @@ struct clocksource * __init clocksource_default_clock(void) | |||
221 | return &clocksource_tod; | 210 | return &clocksource_tod; |
222 | } | 211 | } |
223 | 212 | ||
224 | void update_vsyscall_old(struct timespec *wall_time, struct timespec *wtm, | 213 | void update_vsyscall(struct timekeeper *tk) |
225 | struct clocksource *clock, u32 mult) | ||
226 | { | 214 | { |
227 | if (clock != &clocksource_tod) | 215 | u64 nsecps; |
216 | |||
217 | if (tk->clock != &clocksource_tod) | ||
228 | return; | 218 | return; |
229 | 219 | ||
230 | /* Make userspace gettimeofday spin until we're done. */ | 220 | /* Make userspace gettimeofday spin until we're done. */ |
231 | ++vdso_data->tb_update_count; | 221 | ++vdso_data->tb_update_count; |
232 | smp_wmb(); | 222 | smp_wmb(); |
233 | vdso_data->xtime_tod_stamp = clock->cycle_last; | 223 | vdso_data->xtime_tod_stamp = tk->clock->cycle_last; |
234 | vdso_data->xtime_clock_sec = wall_time->tv_sec; | 224 | vdso_data->xtime_clock_sec = tk->xtime_sec; |
235 | vdso_data->xtime_clock_nsec = wall_time->tv_nsec; | 225 | vdso_data->xtime_clock_nsec = tk->xtime_nsec; |
236 | vdso_data->wtom_clock_sec = wtm->tv_sec; | 226 | vdso_data->wtom_clock_sec = |
237 | vdso_data->wtom_clock_nsec = wtm->tv_nsec; | 227 | tk->xtime_sec + tk->wall_to_monotonic.tv_sec; |
238 | vdso_data->ntp_mult = mult; | 228 | vdso_data->wtom_clock_nsec = tk->xtime_nsec + |
229 | + (tk->wall_to_monotonic.tv_nsec << tk->shift); | ||
230 | nsecps = (u64) NSEC_PER_SEC << tk->shift; | ||
231 | while (vdso_data->wtom_clock_nsec >= nsecps) { | ||
232 | vdso_data->wtom_clock_nsec -= nsecps; | ||
233 | vdso_data->wtom_clock_sec++; | ||
234 | } | ||
235 | vdso_data->tk_mult = tk->mult; | ||
236 | vdso_data->tk_shift = tk->shift; | ||
239 | smp_wmb(); | 237 | smp_wmb(); |
240 | ++vdso_data->tb_update_count; | 238 | ++vdso_data->tb_update_count; |
241 | } | 239 | } |
diff --git a/arch/s390/kernel/vdso32/clock_gettime.S b/arch/s390/kernel/vdso32/clock_gettime.S index b2224e0b974c..5be8e472f57d 100644 --- a/arch/s390/kernel/vdso32/clock_gettime.S +++ b/arch/s390/kernel/vdso32/clock_gettime.S | |||
@@ -38,25 +38,26 @@ __kernel_clock_gettime: | |||
38 | sl %r1,__VDSO_XTIME_STAMP+4(%r5) | 38 | sl %r1,__VDSO_XTIME_STAMP+4(%r5) |
39 | brc 3,2f | 39 | brc 3,2f |
40 | ahi %r0,-1 | 40 | ahi %r0,-1 |
41 | 2: ms %r0,__VDSO_NTP_MULT(%r5) /* cyc2ns(clock,cycle_delta) */ | 41 | 2: ms %r0,__VDSO_TK_MULT(%r5) /* * tk->mult */ |
42 | lr %r2,%r0 | 42 | lr %r2,%r0 |
43 | l %r0,__VDSO_NTP_MULT(%r5) | 43 | l %r0,__VDSO_TK_MULT(%r5) |
44 | ltr %r1,%r1 | 44 | ltr %r1,%r1 |
45 | mr %r0,%r0 | 45 | mr %r0,%r0 |
46 | jnm 3f | 46 | jnm 3f |
47 | a %r0,__VDSO_NTP_MULT(%r5) | 47 | a %r0,__VDSO_TK_MULT(%r5) |
48 | 3: alr %r0,%r2 | 48 | 3: alr %r0,%r2 |
49 | srdl %r0,12 | 49 | al %r0,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ |
50 | al %r0,__VDSO_XTIME_NSEC(%r5) /* + xtime */ | ||
51 | al %r1,__VDSO_XTIME_NSEC+4(%r5) | 50 | al %r1,__VDSO_XTIME_NSEC+4(%r5) |
52 | brc 12,4f | 51 | brc 12,4f |
53 | ahi %r0,1 | 52 | ahi %r0,1 |
54 | 4: l %r2,__VDSO_XTIME_SEC+4(%r5) | 53 | 4: al %r0,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic.nsec */ |
55 | al %r0,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic */ | ||
56 | al %r1,__VDSO_WTOM_NSEC+4(%r5) | 54 | al %r1,__VDSO_WTOM_NSEC+4(%r5) |
57 | brc 12,5f | 55 | brc 12,5f |
58 | ahi %r0,1 | 56 | ahi %r0,1 |
59 | 5: al %r2,__VDSO_WTOM_SEC+4(%r5) | 57 | 5: l %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ |
58 | srdl %r0,0(%r2) /* >> tk->shift */ | ||
59 | l %r2,__VDSO_XTIME_SEC+4(%r5) | ||
60 | al %r2,__VDSO_WTOM_SEC+4(%r5) | ||
60 | cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ | 61 | cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ |
61 | jne 1b | 62 | jne 1b |
62 | basr %r5,0 | 63 | basr %r5,0 |
@@ -86,20 +87,21 @@ __kernel_clock_gettime: | |||
86 | sl %r1,__VDSO_XTIME_STAMP+4(%r5) | 87 | sl %r1,__VDSO_XTIME_STAMP+4(%r5) |
87 | brc 3,12f | 88 | brc 3,12f |
88 | ahi %r0,-1 | 89 | ahi %r0,-1 |
89 | 12: ms %r0,__VDSO_NTP_MULT(%r5) /* cyc2ns(clock,cycle_delta) */ | 90 | 12: ms %r0,__VDSO_TK_MULT(%r5) /* * tk->mult */ |
90 | lr %r2,%r0 | 91 | lr %r2,%r0 |
91 | l %r0,__VDSO_NTP_MULT(%r5) | 92 | l %r0,__VDSO_TK_MULT(%r5) |
92 | ltr %r1,%r1 | 93 | ltr %r1,%r1 |
93 | mr %r0,%r0 | 94 | mr %r0,%r0 |
94 | jnm 13f | 95 | jnm 13f |
95 | a %r0,__VDSO_NTP_MULT(%r5) | 96 | a %r0,__VDSO_TK_MULT(%r5) |
96 | 13: alr %r0,%r2 | 97 | 13: alr %r0,%r2 |
97 | srdl %r0,12 | 98 | al %r0,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ |
98 | al %r0,__VDSO_XTIME_NSEC(%r5) /* + xtime */ | ||
99 | al %r1,__VDSO_XTIME_NSEC+4(%r5) | 99 | al %r1,__VDSO_XTIME_NSEC+4(%r5) |
100 | brc 12,14f | 100 | brc 12,14f |
101 | ahi %r0,1 | 101 | ahi %r0,1 |
102 | 14: l %r2,__VDSO_XTIME_SEC+4(%r5) | 102 | 14: l %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ |
103 | srdl %r0,0(%r2) /* >> tk->shift */ | ||
104 | l %r2,__VDSO_XTIME_SEC+4(%r5) | ||
103 | cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ | 105 | cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ |
104 | jne 11b | 106 | jne 11b |
105 | basr %r5,0 | 107 | basr %r5,0 |
diff --git a/arch/s390/kernel/vdso32/gettimeofday.S b/arch/s390/kernel/vdso32/gettimeofday.S index 2d3633175e3b..fd621a950f7c 100644 --- a/arch/s390/kernel/vdso32/gettimeofday.S +++ b/arch/s390/kernel/vdso32/gettimeofday.S | |||
@@ -35,15 +35,14 @@ __kernel_gettimeofday: | |||
35 | sl %r1,__VDSO_XTIME_STAMP+4(%r5) | 35 | sl %r1,__VDSO_XTIME_STAMP+4(%r5) |
36 | brc 3,3f | 36 | brc 3,3f |
37 | ahi %r0,-1 | 37 | ahi %r0,-1 |
38 | 3: ms %r0,__VDSO_NTP_MULT(%r5) /* cyc2ns(clock,cycle_delta) */ | 38 | 3: ms %r0,__VDSO_TK_MULT(%r5) /* * tk->mult */ |
39 | st %r0,24(%r15) | 39 | st %r0,24(%r15) |
40 | l %r0,__VDSO_NTP_MULT(%r5) | 40 | l %r0,__VDSO_TK_MULT(%r5) |
41 | ltr %r1,%r1 | 41 | ltr %r1,%r1 |
42 | mr %r0,%r0 | 42 | mr %r0,%r0 |
43 | jnm 4f | 43 | jnm 4f |
44 | a %r0,__VDSO_NTP_MULT(%r5) | 44 | a %r0,__VDSO_TK_MULT(%r5) |
45 | 4: al %r0,24(%r15) | 45 | 4: al %r0,24(%r15) |
46 | srdl %r0,12 | ||
47 | al %r0,__VDSO_XTIME_NSEC(%r5) /* + xtime */ | 46 | al %r0,__VDSO_XTIME_NSEC(%r5) /* + xtime */ |
48 | al %r1,__VDSO_XTIME_NSEC+4(%r5) | 47 | al %r1,__VDSO_XTIME_NSEC+4(%r5) |
49 | brc 12,5f | 48 | brc 12,5f |
@@ -51,6 +50,8 @@ __kernel_gettimeofday: | |||
51 | 5: mvc 24(4,%r15),__VDSO_XTIME_SEC+4(%r5) | 50 | 5: mvc 24(4,%r15),__VDSO_XTIME_SEC+4(%r5) |
52 | cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ | 51 | cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ |
53 | jne 1b | 52 | jne 1b |
53 | l %r4,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ | ||
54 | srdl %r0,0(%r4) /* >> tk->shift */ | ||
54 | l %r4,24(%r15) /* get tv_sec from stack */ | 55 | l %r4,24(%r15) /* get tv_sec from stack */ |
55 | basr %r5,0 | 56 | basr %r5,0 |
56 | 6: ltr %r0,%r0 | 57 | 6: ltr %r0,%r0 |
diff --git a/arch/s390/kernel/vdso64/clock_gettime.S b/arch/s390/kernel/vdso64/clock_gettime.S index d46c95ed5f19..0add1072ba30 100644 --- a/arch/s390/kernel/vdso64/clock_gettime.S +++ b/arch/s390/kernel/vdso64/clock_gettime.S | |||
@@ -34,14 +34,15 @@ __kernel_clock_gettime: | |||
34 | tmll %r4,0x0001 /* pending update ? loop */ | 34 | tmll %r4,0x0001 /* pending update ? loop */ |
35 | jnz 0b | 35 | jnz 0b |
36 | stck 48(%r15) /* Store TOD clock */ | 36 | stck 48(%r15) /* Store TOD clock */ |
37 | lgf %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ | ||
38 | lg %r0,__VDSO_XTIME_SEC(%r5) /* tk->xtime_sec */ | ||
39 | alg %r0,__VDSO_WTOM_SEC(%r5) /* + wall_to_monotonic.sec */ | ||
37 | lg %r1,48(%r15) | 40 | lg %r1,48(%r15) |
38 | sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ | 41 | sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ |
39 | msgf %r1,__VDSO_NTP_MULT(%r5) /* * NTP adjustment */ | 42 | msgf %r1,__VDSO_TK_MULT(%r5) /* * tk->mult */ |
40 | srlg %r1,%r1,12 /* cyc2ns(clock,cycle_delta) */ | 43 | alg %r1,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ |
41 | alg %r1,__VDSO_XTIME_NSEC(%r5) /* + xtime */ | 44 | alg %r1,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic.nsec */ |
42 | lg %r0,__VDSO_XTIME_SEC(%r5) | 45 | srlg %r1,%r1,0(%r2) /* >> tk->shift */ |
43 | alg %r1,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic */ | ||
44 | alg %r0,__VDSO_WTOM_SEC(%r5) | ||
45 | clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ | 46 | clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ |
46 | jne 0b | 47 | jne 0b |
47 | larl %r5,13f | 48 | larl %r5,13f |
@@ -62,12 +63,13 @@ __kernel_clock_gettime: | |||
62 | tmll %r4,0x0001 /* pending update ? loop */ | 63 | tmll %r4,0x0001 /* pending update ? loop */ |
63 | jnz 5b | 64 | jnz 5b |
64 | stck 48(%r15) /* Store TOD clock */ | 65 | stck 48(%r15) /* Store TOD clock */ |
66 | lgf %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ | ||
65 | lg %r1,48(%r15) | 67 | lg %r1,48(%r15) |
66 | sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ | 68 | sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ |
67 | msgf %r1,__VDSO_NTP_MULT(%r5) /* * NTP adjustment */ | 69 | msgf %r1,__VDSO_TK_MULT(%r5) /* * tk->mult */ |
68 | srlg %r1,%r1,12 /* cyc2ns(clock,cycle_delta) */ | 70 | alg %r1,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ |
69 | alg %r1,__VDSO_XTIME_NSEC(%r5) /* + xtime */ | 71 | srlg %r1,%r1,0(%r2) /* >> tk->shift */ |
70 | lg %r0,__VDSO_XTIME_SEC(%r5) | 72 | lg %r0,__VDSO_XTIME_SEC(%r5) /* tk->xtime_sec */ |
71 | clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ | 73 | clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ |
72 | jne 5b | 74 | jne 5b |
73 | larl %r5,13f | 75 | larl %r5,13f |
diff --git a/arch/s390/kernel/vdso64/gettimeofday.S b/arch/s390/kernel/vdso64/gettimeofday.S index 36ee674722ec..d0860d1d0ccc 100644 --- a/arch/s390/kernel/vdso64/gettimeofday.S +++ b/arch/s390/kernel/vdso64/gettimeofday.S | |||
@@ -31,12 +31,13 @@ __kernel_gettimeofday: | |||
31 | stck 48(%r15) /* Store TOD clock */ | 31 | stck 48(%r15) /* Store TOD clock */ |
32 | lg %r1,48(%r15) | 32 | lg %r1,48(%r15) |
33 | sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ | 33 | sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ |
34 | msgf %r1,__VDSO_NTP_MULT(%r5) /* * NTP adjustment */ | 34 | msgf %r1,__VDSO_TK_MULT(%r5) /* * tk->mult */ |
35 | srlg %r1,%r1,12 /* cyc2ns(clock,cycle_delta) */ | 35 | alg %r1,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ |
36 | alg %r1,__VDSO_XTIME_NSEC(%r5) /* + xtime.tv_nsec */ | 36 | lg %r0,__VDSO_XTIME_SEC(%r5) /* tk->xtime_sec */ |
37 | lg %r0,__VDSO_XTIME_SEC(%r5) /* xtime.tv_sec */ | ||
38 | clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ | 37 | clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ |
39 | jne 0b | 38 | jne 0b |
39 | lgf %r5,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ | ||
40 | srlg %r1,%r1,0(%r5) /* >> tk->shift */ | ||
40 | larl %r5,5f | 41 | larl %r5,5f |
41 | 2: clg %r1,0(%r5) | 42 | 2: clg %r1,0(%r5) |
42 | jl 3f | 43 | jl 3f |
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c index 97e03caf7825..dbdab3e7a1a6 100644 --- a/arch/s390/lib/uaccess_pt.c +++ b/arch/s390/lib/uaccess_pt.c | |||
@@ -78,11 +78,14 @@ static size_t copy_in_kernel(size_t count, void __user *to, | |||
78 | * contains the (negative) exception code. | 78 | * contains the (negative) exception code. |
79 | */ | 79 | */ |
80 | #ifdef CONFIG_64BIT | 80 | #ifdef CONFIG_64BIT |
81 | |||
81 | static unsigned long follow_table(struct mm_struct *mm, | 82 | static unsigned long follow_table(struct mm_struct *mm, |
82 | unsigned long address, int write) | 83 | unsigned long address, int write) |
83 | { | 84 | { |
84 | unsigned long *table = (unsigned long *)__pa(mm->pgd); | 85 | unsigned long *table = (unsigned long *)__pa(mm->pgd); |
85 | 86 | ||
87 | if (unlikely(address > mm->context.asce_limit - 1)) | ||
88 | return -0x38UL; | ||
86 | switch (mm->context.asce_bits & _ASCE_TYPE_MASK) { | 89 | switch (mm->context.asce_bits & _ASCE_TYPE_MASK) { |
87 | case _ASCE_TYPE_REGION1: | 90 | case _ASCE_TYPE_REGION1: |
88 | table = table + ((address >> 53) & 0x7ff); | 91 | table = table + ((address >> 53) & 0x7ff); |
diff --git a/arch/um/Makefile b/arch/um/Makefile index 48d92bbe62e9..36e658a4291c 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -33,12 +33,11 @@ MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas | |||
33 | 33 | ||
34 | HEADER_ARCH := $(SUBARCH) | 34 | HEADER_ARCH := $(SUBARCH) |
35 | 35 | ||
36 | # Additional ARCH settings for x86 | 36 | ifneq ($(filter $(SUBARCH),x86 x86_64 i386),) |
37 | ifeq ($(SUBARCH),i386) | 37 | HEADER_ARCH := x86 |
38 | HEADER_ARCH := x86 | ||
39 | endif | 38 | endif |
40 | ifeq ($(SUBARCH),x86_64) | 39 | |
41 | HEADER_ARCH := x86 | 40 | ifdef CONFIG_64BIT |
42 | KBUILD_CFLAGS += -mcmodel=large | 41 | KBUILD_CFLAGS += -mcmodel=large |
43 | endif | 42 | endif |
44 | 43 | ||
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c index 4d6fdf68edf3..799d7e413bf5 100644 --- a/arch/um/kernel/sysrq.c +++ b/arch/um/kernel/sysrq.c | |||
@@ -19,7 +19,7 @@ struct stack_frame { | |||
19 | unsigned long return_address; | 19 | unsigned long return_address; |
20 | }; | 20 | }; |
21 | 21 | ||
22 | static void print_stack_trace(unsigned long *sp, unsigned long bp) | 22 | static void do_stack_trace(unsigned long *sp, unsigned long bp) |
23 | { | 23 | { |
24 | int reliable; | 24 | int reliable; |
25 | unsigned long addr; | 25 | unsigned long addr; |
@@ -94,5 +94,5 @@ void show_stack(struct task_struct *task, unsigned long *stack) | |||
94 | } | 94 | } |
95 | printk(KERN_CONT "\n"); | 95 | printk(KERN_CONT "\n"); |
96 | 96 | ||
97 | print_stack_trace(sp, bp); | 97 | do_stack_trace(sp, bp); |
98 | } | 98 | } |
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 41250fb33985..eda00f9be0cf 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -31,6 +31,9 @@ ifeq ($(CONFIG_X86_32),y) | |||
31 | 31 | ||
32 | KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return | 32 | KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return |
33 | 33 | ||
34 | # Don't autogenerate SSE instructions | ||
35 | KBUILD_CFLAGS += -mno-sse | ||
36 | |||
34 | # Never want PIC in a 32-bit kernel, prevent breakage with GCC built | 37 | # Never want PIC in a 32-bit kernel, prevent breakage with GCC built |
35 | # with nonstandard options | 38 | # with nonstandard options |
36 | KBUILD_CFLAGS += -fno-pic | 39 | KBUILD_CFLAGS += -fno-pic |
@@ -57,8 +60,11 @@ else | |||
57 | KBUILD_AFLAGS += -m64 | 60 | KBUILD_AFLAGS += -m64 |
58 | KBUILD_CFLAGS += -m64 | 61 | KBUILD_CFLAGS += -m64 |
59 | 62 | ||
63 | # Don't autogenerate SSE instructions | ||
64 | KBUILD_CFLAGS += -mno-sse | ||
65 | |||
60 | # Use -mpreferred-stack-boundary=3 if supported. | 66 | # Use -mpreferred-stack-boundary=3 if supported. |
61 | KBUILD_CFLAGS += $(call cc-option,-mno-sse -mpreferred-stack-boundary=3) | 67 | KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3) |
62 | 68 | ||
63 | # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu) | 69 | # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu) |
64 | cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8) | 70 | cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8) |
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile index 7d6ba9db1be9..e0fc24db234a 100644 --- a/arch/x86/crypto/Makefile +++ b/arch/x86/crypto/Makefile | |||
@@ -3,8 +3,9 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | avx_supported := $(call as-instr,vpxor %xmm0$(comma)%xmm0$(comma)%xmm0,yes,no) | 5 | avx_supported := $(call as-instr,vpxor %xmm0$(comma)%xmm0$(comma)%xmm0,yes,no) |
6 | avx2_supported := $(call as-instr,vpgatherdd %ymm0$(comma)(%eax$(comma)%ymm1\ | ||
7 | $(comma)4)$(comma)%ymm2,yes,no) | ||
6 | 8 | ||
7 | obj-$(CONFIG_CRYPTO_ABLK_HELPER_X86) += ablk_helper.o | ||
8 | obj-$(CONFIG_CRYPTO_GLUE_HELPER_X86) += glue_helper.o | 9 | obj-$(CONFIG_CRYPTO_GLUE_HELPER_X86) += glue_helper.o |
9 | 10 | ||
10 | obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o | 11 | obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o |
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c index f80e668785c0..835488b745ee 100644 --- a/arch/x86/crypto/aesni-intel_glue.c +++ b/arch/x86/crypto/aesni-intel_glue.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include <asm/cpu_device_id.h> | 34 | #include <asm/cpu_device_id.h> |
35 | #include <asm/i387.h> | 35 | #include <asm/i387.h> |
36 | #include <asm/crypto/aes.h> | 36 | #include <asm/crypto/aes.h> |
37 | #include <asm/crypto/ablk_helper.h> | 37 | #include <crypto/ablk_helper.h> |
38 | #include <crypto/scatterwalk.h> | 38 | #include <crypto/scatterwalk.h> |
39 | #include <crypto/internal/aead.h> | 39 | #include <crypto/internal/aead.h> |
40 | #include <linux/workqueue.h> | 40 | #include <linux/workqueue.h> |
diff --git a/arch/x86/crypto/camellia_aesni_avx2_glue.c b/arch/x86/crypto/camellia_aesni_avx2_glue.c index 414fe5d7946b..4209a76fcdaa 100644 --- a/arch/x86/crypto/camellia_aesni_avx2_glue.c +++ b/arch/x86/crypto/camellia_aesni_avx2_glue.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/crypto.h> | 15 | #include <linux/crypto.h> |
16 | #include <linux/err.h> | 16 | #include <linux/err.h> |
17 | #include <crypto/ablk_helper.h> | ||
17 | #include <crypto/algapi.h> | 18 | #include <crypto/algapi.h> |
18 | #include <crypto/ctr.h> | 19 | #include <crypto/ctr.h> |
19 | #include <crypto/lrw.h> | 20 | #include <crypto/lrw.h> |
@@ -21,7 +22,6 @@ | |||
21 | #include <asm/xcr.h> | 22 | #include <asm/xcr.h> |
22 | #include <asm/xsave.h> | 23 | #include <asm/xsave.h> |
23 | #include <asm/crypto/camellia.h> | 24 | #include <asm/crypto/camellia.h> |
24 | #include <asm/crypto/ablk_helper.h> | ||
25 | #include <asm/crypto/glue_helper.h> | 25 | #include <asm/crypto/glue_helper.h> |
26 | 26 | ||
27 | #define CAMELLIA_AESNI_PARALLEL_BLOCKS 16 | 27 | #define CAMELLIA_AESNI_PARALLEL_BLOCKS 16 |
diff --git a/arch/x86/crypto/camellia_aesni_avx_glue.c b/arch/x86/crypto/camellia_aesni_avx_glue.c index 37fd0c0a81ea..87a041a10f4a 100644 --- a/arch/x86/crypto/camellia_aesni_avx_glue.c +++ b/arch/x86/crypto/camellia_aesni_avx_glue.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/crypto.h> | 15 | #include <linux/crypto.h> |
16 | #include <linux/err.h> | 16 | #include <linux/err.h> |
17 | #include <crypto/ablk_helper.h> | ||
17 | #include <crypto/algapi.h> | 18 | #include <crypto/algapi.h> |
18 | #include <crypto/ctr.h> | 19 | #include <crypto/ctr.h> |
19 | #include <crypto/lrw.h> | 20 | #include <crypto/lrw.h> |
@@ -21,7 +22,6 @@ | |||
21 | #include <asm/xcr.h> | 22 | #include <asm/xcr.h> |
22 | #include <asm/xsave.h> | 23 | #include <asm/xsave.h> |
23 | #include <asm/crypto/camellia.h> | 24 | #include <asm/crypto/camellia.h> |
24 | #include <asm/crypto/ablk_helper.h> | ||
25 | #include <asm/crypto/glue_helper.h> | 25 | #include <asm/crypto/glue_helper.h> |
26 | 26 | ||
27 | #define CAMELLIA_AESNI_PARALLEL_BLOCKS 16 | 27 | #define CAMELLIA_AESNI_PARALLEL_BLOCKS 16 |
diff --git a/arch/x86/crypto/cast5_avx_glue.c b/arch/x86/crypto/cast5_avx_glue.c index c6631813dc11..e6a3700489b9 100644 --- a/arch/x86/crypto/cast5_avx_glue.c +++ b/arch/x86/crypto/cast5_avx_glue.c | |||
@@ -26,13 +26,13 @@ | |||
26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
27 | #include <linux/crypto.h> | 27 | #include <linux/crypto.h> |
28 | #include <linux/err.h> | 28 | #include <linux/err.h> |
29 | #include <crypto/ablk_helper.h> | ||
29 | #include <crypto/algapi.h> | 30 | #include <crypto/algapi.h> |
30 | #include <crypto/cast5.h> | 31 | #include <crypto/cast5.h> |
31 | #include <crypto/cryptd.h> | 32 | #include <crypto/cryptd.h> |
32 | #include <crypto/ctr.h> | 33 | #include <crypto/ctr.h> |
33 | #include <asm/xcr.h> | 34 | #include <asm/xcr.h> |
34 | #include <asm/xsave.h> | 35 | #include <asm/xsave.h> |
35 | #include <asm/crypto/ablk_helper.h> | ||
36 | #include <asm/crypto/glue_helper.h> | 36 | #include <asm/crypto/glue_helper.h> |
37 | 37 | ||
38 | #define CAST5_PARALLEL_BLOCKS 16 | 38 | #define CAST5_PARALLEL_BLOCKS 16 |
diff --git a/arch/x86/crypto/cast6_avx_glue.c b/arch/x86/crypto/cast6_avx_glue.c index 8d0dfb86a559..09f3677393e4 100644 --- a/arch/x86/crypto/cast6_avx_glue.c +++ b/arch/x86/crypto/cast6_avx_glue.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
29 | #include <linux/crypto.h> | 29 | #include <linux/crypto.h> |
30 | #include <linux/err.h> | 30 | #include <linux/err.h> |
31 | #include <crypto/ablk_helper.h> | ||
31 | #include <crypto/algapi.h> | 32 | #include <crypto/algapi.h> |
32 | #include <crypto/cast6.h> | 33 | #include <crypto/cast6.h> |
33 | #include <crypto/cryptd.h> | 34 | #include <crypto/cryptd.h> |
@@ -37,7 +38,6 @@ | |||
37 | #include <crypto/xts.h> | 38 | #include <crypto/xts.h> |
38 | #include <asm/xcr.h> | 39 | #include <asm/xcr.h> |
39 | #include <asm/xsave.h> | 40 | #include <asm/xsave.h> |
40 | #include <asm/crypto/ablk_helper.h> | ||
41 | #include <asm/crypto/glue_helper.h> | 41 | #include <asm/crypto/glue_helper.h> |
42 | 42 | ||
43 | #define CAST6_PARALLEL_BLOCKS 8 | 43 | #define CAST6_PARALLEL_BLOCKS 8 |
diff --git a/arch/x86/crypto/serpent_avx2_glue.c b/arch/x86/crypto/serpent_avx2_glue.c index 23aabc6c20a5..2fae489b1524 100644 --- a/arch/x86/crypto/serpent_avx2_glue.c +++ b/arch/x86/crypto/serpent_avx2_glue.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/crypto.h> | 15 | #include <linux/crypto.h> |
16 | #include <linux/err.h> | 16 | #include <linux/err.h> |
17 | #include <crypto/ablk_helper.h> | ||
17 | #include <crypto/algapi.h> | 18 | #include <crypto/algapi.h> |
18 | #include <crypto/ctr.h> | 19 | #include <crypto/ctr.h> |
19 | #include <crypto/lrw.h> | 20 | #include <crypto/lrw.h> |
@@ -22,7 +23,6 @@ | |||
22 | #include <asm/xcr.h> | 23 | #include <asm/xcr.h> |
23 | #include <asm/xsave.h> | 24 | #include <asm/xsave.h> |
24 | #include <asm/crypto/serpent-avx.h> | 25 | #include <asm/crypto/serpent-avx.h> |
25 | #include <asm/crypto/ablk_helper.h> | ||
26 | #include <asm/crypto/glue_helper.h> | 26 | #include <asm/crypto/glue_helper.h> |
27 | 27 | ||
28 | #define SERPENT_AVX2_PARALLEL_BLOCKS 16 | 28 | #define SERPENT_AVX2_PARALLEL_BLOCKS 16 |
diff --git a/arch/x86/crypto/serpent_avx_glue.c b/arch/x86/crypto/serpent_avx_glue.c index 9ae83cf8d21e..ff4870870972 100644 --- a/arch/x86/crypto/serpent_avx_glue.c +++ b/arch/x86/crypto/serpent_avx_glue.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
29 | #include <linux/crypto.h> | 29 | #include <linux/crypto.h> |
30 | #include <linux/err.h> | 30 | #include <linux/err.h> |
31 | #include <crypto/ablk_helper.h> | ||
31 | #include <crypto/algapi.h> | 32 | #include <crypto/algapi.h> |
32 | #include <crypto/serpent.h> | 33 | #include <crypto/serpent.h> |
33 | #include <crypto/cryptd.h> | 34 | #include <crypto/cryptd.h> |
@@ -38,7 +39,6 @@ | |||
38 | #include <asm/xcr.h> | 39 | #include <asm/xcr.h> |
39 | #include <asm/xsave.h> | 40 | #include <asm/xsave.h> |
40 | #include <asm/crypto/serpent-avx.h> | 41 | #include <asm/crypto/serpent-avx.h> |
41 | #include <asm/crypto/ablk_helper.h> | ||
42 | #include <asm/crypto/glue_helper.h> | 42 | #include <asm/crypto/glue_helper.h> |
43 | 43 | ||
44 | /* 8-way parallel cipher functions */ | 44 | /* 8-way parallel cipher functions */ |
diff --git a/arch/x86/crypto/serpent_sse2_glue.c b/arch/x86/crypto/serpent_sse2_glue.c index 97a356ece24d..8c95f8637306 100644 --- a/arch/x86/crypto/serpent_sse2_glue.c +++ b/arch/x86/crypto/serpent_sse2_glue.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/types.h> | 34 | #include <linux/types.h> |
35 | #include <linux/crypto.h> | 35 | #include <linux/crypto.h> |
36 | #include <linux/err.h> | 36 | #include <linux/err.h> |
37 | #include <crypto/ablk_helper.h> | ||
37 | #include <crypto/algapi.h> | 38 | #include <crypto/algapi.h> |
38 | #include <crypto/serpent.h> | 39 | #include <crypto/serpent.h> |
39 | #include <crypto/cryptd.h> | 40 | #include <crypto/cryptd.h> |
@@ -42,7 +43,6 @@ | |||
42 | #include <crypto/lrw.h> | 43 | #include <crypto/lrw.h> |
43 | #include <crypto/xts.h> | 44 | #include <crypto/xts.h> |
44 | #include <asm/crypto/serpent-sse2.h> | 45 | #include <asm/crypto/serpent-sse2.h> |
45 | #include <asm/crypto/ablk_helper.h> | ||
46 | #include <asm/crypto/glue_helper.h> | 46 | #include <asm/crypto/glue_helper.h> |
47 | 47 | ||
48 | static void serpent_decrypt_cbc_xway(void *ctx, u128 *dst, const u128 *src) | 48 | static void serpent_decrypt_cbc_xway(void *ctx, u128 *dst, const u128 *src) |
diff --git a/arch/x86/crypto/sha256_ssse3_glue.c b/arch/x86/crypto/sha256_ssse3_glue.c index 50226c4b86ed..f248546da1ca 100644 --- a/arch/x86/crypto/sha256_ssse3_glue.c +++ b/arch/x86/crypto/sha256_ssse3_glue.c | |||
@@ -281,7 +281,7 @@ static int __init sha256_ssse3_mod_init(void) | |||
281 | /* allow AVX to override SSSE3, it's a little faster */ | 281 | /* allow AVX to override SSSE3, it's a little faster */ |
282 | if (avx_usable()) { | 282 | if (avx_usable()) { |
283 | #ifdef CONFIG_AS_AVX2 | 283 | #ifdef CONFIG_AS_AVX2 |
284 | if (boot_cpu_has(X86_FEATURE_AVX2)) | 284 | if (boot_cpu_has(X86_FEATURE_AVX2) && boot_cpu_has(X86_FEATURE_BMI2)) |
285 | sha256_transform_asm = sha256_transform_rorx; | 285 | sha256_transform_asm = sha256_transform_rorx; |
286 | else | 286 | else |
287 | #endif | 287 | #endif |
@@ -319,4 +319,4 @@ MODULE_LICENSE("GPL"); | |||
319 | MODULE_DESCRIPTION("SHA256 Secure Hash Algorithm, Supplemental SSE3 accelerated"); | 319 | MODULE_DESCRIPTION("SHA256 Secure Hash Algorithm, Supplemental SSE3 accelerated"); |
320 | 320 | ||
321 | MODULE_ALIAS("sha256"); | 321 | MODULE_ALIAS("sha256"); |
322 | MODULE_ALIAS("sha384"); | 322 | MODULE_ALIAS("sha224"); |
diff --git a/arch/x86/crypto/twofish_avx_glue.c b/arch/x86/crypto/twofish_avx_glue.c index a62ba541884e..4e3c665be129 100644 --- a/arch/x86/crypto/twofish_avx_glue.c +++ b/arch/x86/crypto/twofish_avx_glue.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
29 | #include <linux/crypto.h> | 29 | #include <linux/crypto.h> |
30 | #include <linux/err.h> | 30 | #include <linux/err.h> |
31 | #include <crypto/ablk_helper.h> | ||
31 | #include <crypto/algapi.h> | 32 | #include <crypto/algapi.h> |
32 | #include <crypto/twofish.h> | 33 | #include <crypto/twofish.h> |
33 | #include <crypto/cryptd.h> | 34 | #include <crypto/cryptd.h> |
@@ -39,7 +40,6 @@ | |||
39 | #include <asm/xcr.h> | 40 | #include <asm/xcr.h> |
40 | #include <asm/xsave.h> | 41 | #include <asm/xsave.h> |
41 | #include <asm/crypto/twofish.h> | 42 | #include <asm/crypto/twofish.h> |
42 | #include <asm/crypto/ablk_helper.h> | ||
43 | #include <asm/crypto/glue_helper.h> | 43 | #include <asm/crypto/glue_helper.h> |
44 | #include <crypto/scatterwalk.h> | 44 | #include <crypto/scatterwalk.h> |
45 | #include <linux/workqueue.h> | 45 | #include <linux/workqueue.h> |
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h index da31c8b8a92d..b17f4f48ecd7 100644 --- a/arch/x86/include/asm/atomic.h +++ b/arch/x86/include/asm/atomic.h | |||
@@ -77,7 +77,7 @@ static inline void atomic_sub(int i, atomic_t *v) | |||
77 | */ | 77 | */ |
78 | static inline int atomic_sub_and_test(int i, atomic_t *v) | 78 | static inline int atomic_sub_and_test(int i, atomic_t *v) |
79 | { | 79 | { |
80 | GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, i, "%0", "e"); | 80 | GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, "er", i, "%0", "e"); |
81 | } | 81 | } |
82 | 82 | ||
83 | /** | 83 | /** |
@@ -141,7 +141,7 @@ static inline int atomic_inc_and_test(atomic_t *v) | |||
141 | */ | 141 | */ |
142 | static inline int atomic_add_negative(int i, atomic_t *v) | 142 | static inline int atomic_add_negative(int i, atomic_t *v) |
143 | { | 143 | { |
144 | GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, i, "%0", "s"); | 144 | GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, "er", i, "%0", "s"); |
145 | } | 145 | } |
146 | 146 | ||
147 | /** | 147 | /** |
diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h index 3f065c985aee..46e9052bbd28 100644 --- a/arch/x86/include/asm/atomic64_64.h +++ b/arch/x86/include/asm/atomic64_64.h | |||
@@ -72,7 +72,7 @@ static inline void atomic64_sub(long i, atomic64_t *v) | |||
72 | */ | 72 | */ |
73 | static inline int atomic64_sub_and_test(long i, atomic64_t *v) | 73 | static inline int atomic64_sub_and_test(long i, atomic64_t *v) |
74 | { | 74 | { |
75 | GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, i, "%0", "e"); | 75 | GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, "er", i, "%0", "e"); |
76 | } | 76 | } |
77 | 77 | ||
78 | /** | 78 | /** |
@@ -138,7 +138,7 @@ static inline int atomic64_inc_and_test(atomic64_t *v) | |||
138 | */ | 138 | */ |
139 | static inline int atomic64_add_negative(long i, atomic64_t *v) | 139 | static inline int atomic64_add_negative(long i, atomic64_t *v) |
140 | { | 140 | { |
141 | GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, i, "%0", "s"); | 141 | GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, "er", i, "%0", "s"); |
142 | } | 142 | } |
143 | 143 | ||
144 | /** | 144 | /** |
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index 6d76d0935989..9fc1af74dc83 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h | |||
@@ -205,7 +205,7 @@ static inline void change_bit(long nr, volatile unsigned long *addr) | |||
205 | */ | 205 | */ |
206 | static inline int test_and_set_bit(long nr, volatile unsigned long *addr) | 206 | static inline int test_and_set_bit(long nr, volatile unsigned long *addr) |
207 | { | 207 | { |
208 | GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, nr, "%0", "c"); | 208 | GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, "Ir", nr, "%0", "c"); |
209 | } | 209 | } |
210 | 210 | ||
211 | /** | 211 | /** |
@@ -251,7 +251,7 @@ static inline int __test_and_set_bit(long nr, volatile unsigned long *addr) | |||
251 | */ | 251 | */ |
252 | static inline int test_and_clear_bit(long nr, volatile unsigned long *addr) | 252 | static inline int test_and_clear_bit(long nr, volatile unsigned long *addr) |
253 | { | 253 | { |
254 | GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, nr, "%0", "c"); | 254 | GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, "Ir", nr, "%0", "c"); |
255 | } | 255 | } |
256 | 256 | ||
257 | /** | 257 | /** |
@@ -304,7 +304,7 @@ static inline int __test_and_change_bit(long nr, volatile unsigned long *addr) | |||
304 | */ | 304 | */ |
305 | static inline int test_and_change_bit(long nr, volatile unsigned long *addr) | 305 | static inline int test_and_change_bit(long nr, volatile unsigned long *addr) |
306 | { | 306 | { |
307 | GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, nr, "%0", "c"); | 307 | GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, "Ir", nr, "%0", "c"); |
308 | } | 308 | } |
309 | 309 | ||
310 | static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) | 310 | static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) |
diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h index 5b23e605e707..4ad6560847b1 100644 --- a/arch/x86/include/asm/local.h +++ b/arch/x86/include/asm/local.h | |||
@@ -52,7 +52,7 @@ static inline void local_sub(long i, local_t *l) | |||
52 | */ | 52 | */ |
53 | static inline int local_sub_and_test(long i, local_t *l) | 53 | static inline int local_sub_and_test(long i, local_t *l) |
54 | { | 54 | { |
55 | GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, i, "%0", "e"); | 55 | GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, "er", i, "%0", "e"); |
56 | } | 56 | } |
57 | 57 | ||
58 | /** | 58 | /** |
@@ -92,7 +92,7 @@ static inline int local_inc_and_test(local_t *l) | |||
92 | */ | 92 | */ |
93 | static inline int local_add_negative(long i, local_t *l) | 93 | static inline int local_add_negative(long i, local_t *l) |
94 | { | 94 | { |
95 | GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, i, "%0", "s"); | 95 | GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, "er", i, "%0", "s"); |
96 | } | 96 | } |
97 | 97 | ||
98 | /** | 98 | /** |
diff --git a/arch/x86/include/asm/rmwcc.h b/arch/x86/include/asm/rmwcc.h index 1ff990f1de8e..8f7866a5b9a4 100644 --- a/arch/x86/include/asm/rmwcc.h +++ b/arch/x86/include/asm/rmwcc.h | |||
@@ -16,8 +16,8 @@ cc_label: \ | |||
16 | #define GEN_UNARY_RMWcc(op, var, arg0, cc) \ | 16 | #define GEN_UNARY_RMWcc(op, var, arg0, cc) \ |
17 | __GEN_RMWcc(op " " arg0, var, cc) | 17 | __GEN_RMWcc(op " " arg0, var, cc) |
18 | 18 | ||
19 | #define GEN_BINARY_RMWcc(op, var, val, arg0, cc) \ | 19 | #define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \ |
20 | __GEN_RMWcc(op " %1, " arg0, var, cc, "er" (val)) | 20 | __GEN_RMWcc(op " %1, " arg0, var, cc, vcon (val)) |
21 | 21 | ||
22 | #else /* !CC_HAVE_ASM_GOTO */ | 22 | #else /* !CC_HAVE_ASM_GOTO */ |
23 | 23 | ||
@@ -33,8 +33,8 @@ do { \ | |||
33 | #define GEN_UNARY_RMWcc(op, var, arg0, cc) \ | 33 | #define GEN_UNARY_RMWcc(op, var, arg0, cc) \ |
34 | __GEN_RMWcc(op " " arg0, var, cc) | 34 | __GEN_RMWcc(op " " arg0, var, cc) |
35 | 35 | ||
36 | #define GEN_BINARY_RMWcc(op, var, val, arg0, cc) \ | 36 | #define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \ |
37 | __GEN_RMWcc(op " %2, " arg0, var, cc, "er" (val)) | 37 | __GEN_RMWcc(op " %2, " arg0, var, cc, vcon (val)) |
38 | 38 | ||
39 | #endif /* CC_HAVE_ASM_GOTO */ | 39 | #endif /* CC_HAVE_ASM_GOTO */ |
40 | 40 | ||
diff --git a/arch/x86/include/asm/simd.h b/arch/x86/include/asm/simd.h new file mode 100644 index 000000000000..ee80b92f0096 --- /dev/null +++ b/arch/x86/include/asm/simd.h | |||
@@ -0,0 +1,11 @@ | |||
1 | |||
2 | #include <asm/i387.h> | ||
3 | |||
4 | /* | ||
5 | * may_use_simd - whether it is allowable at this time to issue SIMD | ||
6 | * instructions or access the SIMD register file | ||
7 | */ | ||
8 | static __must_check inline bool may_use_simd(void) | ||
9 | { | ||
10 | return irq_fpu_usable(); | ||
11 | } | ||
diff --git a/arch/x86/include/asm/trace/irq_vectors.h b/arch/x86/include/asm/trace/irq_vectors.h index 2874df24e7a4..4cab890007a7 100644 --- a/arch/x86/include/asm/trace/irq_vectors.h +++ b/arch/x86/include/asm/trace/irq_vectors.h | |||
@@ -72,6 +72,17 @@ DEFINE_IRQ_VECTOR_EVENT(x86_platform_ipi); | |||
72 | DEFINE_IRQ_VECTOR_EVENT(irq_work); | 72 | DEFINE_IRQ_VECTOR_EVENT(irq_work); |
73 | 73 | ||
74 | /* | 74 | /* |
75 | * We must dis-allow sampling irq_work_exit() because perf event sampling | ||
76 | * itself can cause irq_work, which would lead to an infinite loop; | ||
77 | * | ||
78 | * 1) irq_work_exit happens | ||
79 | * 2) generates perf sample | ||
80 | * 3) generates irq_work | ||
81 | * 4) goto 1 | ||
82 | */ | ||
83 | TRACE_EVENT_PERF_PERM(irq_work_exit, is_sampling_event(p_event) ? -EPERM : 0); | ||
84 | |||
85 | /* | ||
75 | * call_function - called when entering/exiting a call function interrupt | 86 | * call_function - called when entering/exiting a call function interrupt |
76 | * vector handler | 87 | * vector handler |
77 | */ | 88 | */ |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index da3c599584a3..c752cb43e52f 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -558,6 +558,17 @@ void native_machine_shutdown(void) | |||
558 | { | 558 | { |
559 | /* Stop the cpus and apics */ | 559 | /* Stop the cpus and apics */ |
560 | #ifdef CONFIG_X86_IO_APIC | 560 | #ifdef CONFIG_X86_IO_APIC |
561 | /* | ||
562 | * Disabling IO APIC before local APIC is a workaround for | ||
563 | * erratum AVR31 in "Intel Atom Processor C2000 Product Family | ||
564 | * Specification Update". In this situation, interrupts that target | ||
565 | * a Logical Processor whose Local APIC is either in the process of | ||
566 | * being hardware disabled or software disabled are neither delivered | ||
567 | * nor discarded. When this erratum occurs, the processor may hang. | ||
568 | * | ||
569 | * Even without the erratum, it still makes sense to quiet IO APIC | ||
570 | * before disabling Local APIC. | ||
571 | */ | ||
561 | disable_IO_APIC(); | 572 | disable_IO_APIC(); |
562 | #endif | 573 | #endif |
563 | 574 | ||
diff --git a/arch/x86/platform/efi/early_printk.c b/arch/x86/platform/efi/early_printk.c index 6599a0027b76..81b506d5befd 100644 --- a/arch/x86/platform/efi/early_printk.c +++ b/arch/x86/platform/efi/early_printk.c | |||
@@ -142,7 +142,7 @@ early_efi_write(struct console *con, const char *str, unsigned int num) | |||
142 | efi_y += font->height; | 142 | efi_y += font->height; |
143 | } | 143 | } |
144 | 144 | ||
145 | if (efi_y + font->height >= si->lfb_height) { | 145 | if (efi_y + font->height > si->lfb_height) { |
146 | u32 i; | 146 | u32 i; |
147 | 147 | ||
148 | efi_y -= font->height; | 148 | efi_y -= font->height; |
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 1610b22edf09..86154eab9523 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -435,9 +435,9 @@ static inline uint64_t blkg_stat_read(struct blkg_stat *stat) | |||
435 | uint64_t v; | 435 | uint64_t v; |
436 | 436 | ||
437 | do { | 437 | do { |
438 | start = u64_stats_fetch_begin(&stat->syncp); | 438 | start = u64_stats_fetch_begin_bh(&stat->syncp); |
439 | v = stat->cnt; | 439 | v = stat->cnt; |
440 | } while (u64_stats_fetch_retry(&stat->syncp, start)); | 440 | } while (u64_stats_fetch_retry_bh(&stat->syncp, start)); |
441 | 441 | ||
442 | return v; | 442 | return v; |
443 | } | 443 | } |
@@ -508,9 +508,9 @@ static inline struct blkg_rwstat blkg_rwstat_read(struct blkg_rwstat *rwstat) | |||
508 | struct blkg_rwstat tmp; | 508 | struct blkg_rwstat tmp; |
509 | 509 | ||
510 | do { | 510 | do { |
511 | start = u64_stats_fetch_begin(&rwstat->syncp); | 511 | start = u64_stats_fetch_begin_bh(&rwstat->syncp); |
512 | tmp = *rwstat; | 512 | tmp = *rwstat; |
513 | } while (u64_stats_fetch_retry(&rwstat->syncp, start)); | 513 | } while (u64_stats_fetch_retry_bh(&rwstat->syncp, start)); |
514 | 514 | ||
515 | return tmp; | 515 | return tmp; |
516 | } | 516 | } |
diff --git a/block/blk-flush.c b/block/blk-flush.c index 331e627301ea..fb6f3c0ffa49 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c | |||
@@ -502,15 +502,6 @@ void blk_abort_flushes(struct request_queue *q) | |||
502 | } | 502 | } |
503 | } | 503 | } |
504 | 504 | ||
505 | static void bio_end_flush(struct bio *bio, int err) | ||
506 | { | ||
507 | if (err) | ||
508 | clear_bit(BIO_UPTODATE, &bio->bi_flags); | ||
509 | if (bio->bi_private) | ||
510 | complete(bio->bi_private); | ||
511 | bio_put(bio); | ||
512 | } | ||
513 | |||
514 | /** | 505 | /** |
515 | * blkdev_issue_flush - queue a flush | 506 | * blkdev_issue_flush - queue a flush |
516 | * @bdev: blockdev to issue flush for | 507 | * @bdev: blockdev to issue flush for |
@@ -526,7 +517,6 @@ static void bio_end_flush(struct bio *bio, int err) | |||
526 | int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask, | 517 | int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask, |
527 | sector_t *error_sector) | 518 | sector_t *error_sector) |
528 | { | 519 | { |
529 | DECLARE_COMPLETION_ONSTACK(wait); | ||
530 | struct request_queue *q; | 520 | struct request_queue *q; |
531 | struct bio *bio; | 521 | struct bio *bio; |
532 | int ret = 0; | 522 | int ret = 0; |
@@ -548,13 +538,9 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask, | |||
548 | return -ENXIO; | 538 | return -ENXIO; |
549 | 539 | ||
550 | bio = bio_alloc(gfp_mask, 0); | 540 | bio = bio_alloc(gfp_mask, 0); |
551 | bio->bi_end_io = bio_end_flush; | ||
552 | bio->bi_bdev = bdev; | 541 | bio->bi_bdev = bdev; |
553 | bio->bi_private = &wait; | ||
554 | 542 | ||
555 | bio_get(bio); | 543 | ret = submit_bio_wait(WRITE_FLUSH, bio); |
556 | submit_bio(WRITE_FLUSH, bio); | ||
557 | wait_for_completion_io(&wait); | ||
558 | 544 | ||
559 | /* | 545 | /* |
560 | * The driver must store the error location in ->bi_sector, if | 546 | * The driver must store the error location in ->bi_sector, if |
@@ -564,9 +550,6 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask, | |||
564 | if (error_sector) | 550 | if (error_sector) |
565 | *error_sector = bio->bi_sector; | 551 | *error_sector = bio->bi_sector; |
566 | 552 | ||
567 | if (!bio_flagged(bio, BIO_UPTODATE)) | ||
568 | ret = -EIO; | ||
569 | |||
570 | bio_put(bio); | 553 | bio_put(bio); |
571 | return ret; | 554 | return ret; |
572 | } | 555 | } |
diff --git a/block/blk-mq.c b/block/blk-mq.c index cdc629cf075b..c79126e11030 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -202,10 +202,12 @@ static struct request *blk_mq_alloc_request_pinned(struct request_queue *q, | |||
202 | if (rq) { | 202 | if (rq) { |
203 | blk_mq_rq_ctx_init(q, ctx, rq, rw); | 203 | blk_mq_rq_ctx_init(q, ctx, rq, rw); |
204 | break; | 204 | break; |
205 | } else if (!(gfp & __GFP_WAIT)) | 205 | } |
206 | break; | ||
207 | 206 | ||
208 | blk_mq_put_ctx(ctx); | 207 | blk_mq_put_ctx(ctx); |
208 | if (!(gfp & __GFP_WAIT)) | ||
209 | break; | ||
210 | |||
209 | __blk_mq_run_hw_queue(hctx); | 211 | __blk_mq_run_hw_queue(hctx); |
210 | blk_mq_wait_for_tags(hctx->tags); | 212 | blk_mq_wait_for_tags(hctx->tags); |
211 | } while (1); | 213 | } while (1); |
@@ -222,7 +224,8 @@ struct request *blk_mq_alloc_request(struct request_queue *q, int rw, | |||
222 | return NULL; | 224 | return NULL; |
223 | 225 | ||
224 | rq = blk_mq_alloc_request_pinned(q, rw, gfp, reserved); | 226 | rq = blk_mq_alloc_request_pinned(q, rw, gfp, reserved); |
225 | blk_mq_put_ctx(rq->mq_ctx); | 227 | if (rq) |
228 | blk_mq_put_ctx(rq->mq_ctx); | ||
226 | return rq; | 229 | return rq; |
227 | } | 230 | } |
228 | 231 | ||
@@ -235,7 +238,8 @@ struct request *blk_mq_alloc_reserved_request(struct request_queue *q, int rw, | |||
235 | return NULL; | 238 | return NULL; |
236 | 239 | ||
237 | rq = blk_mq_alloc_request_pinned(q, rw, gfp, true); | 240 | rq = blk_mq_alloc_request_pinned(q, rw, gfp, true); |
238 | blk_mq_put_ctx(rq->mq_ctx); | 241 | if (rq) |
242 | blk_mq_put_ctx(rq->mq_ctx); | ||
239 | return rq; | 243 | return rq; |
240 | } | 244 | } |
241 | EXPORT_SYMBOL(blk_mq_alloc_reserved_request); | 245 | EXPORT_SYMBOL(blk_mq_alloc_reserved_request); |
@@ -308,12 +312,12 @@ void blk_mq_complete_request(struct request *rq, int error) | |||
308 | 312 | ||
309 | blk_account_io_completion(rq, bytes); | 313 | blk_account_io_completion(rq, bytes); |
310 | 314 | ||
315 | blk_account_io_done(rq); | ||
316 | |||
311 | if (rq->end_io) | 317 | if (rq->end_io) |
312 | rq->end_io(rq, error); | 318 | rq->end_io(rq, error); |
313 | else | 319 | else |
314 | blk_mq_free_request(rq); | 320 | blk_mq_free_request(rq); |
315 | |||
316 | blk_account_io_done(rq); | ||
317 | } | 321 | } |
318 | 322 | ||
319 | void __blk_mq_end_io(struct request *rq, int error) | 323 | void __blk_mq_end_io(struct request *rq, int error) |
diff --git a/crypto/Kconfig b/crypto/Kconfig index 4ae5734fb473..7bcb70d216e1 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig | |||
@@ -174,9 +174,8 @@ config CRYPTO_TEST | |||
174 | help | 174 | help |
175 | Quick & dirty crypto test module. | 175 | Quick & dirty crypto test module. |
176 | 176 | ||
177 | config CRYPTO_ABLK_HELPER_X86 | 177 | config CRYPTO_ABLK_HELPER |
178 | tristate | 178 | tristate |
179 | depends on X86 | ||
180 | select CRYPTO_CRYPTD | 179 | select CRYPTO_CRYPTD |
181 | 180 | ||
182 | config CRYPTO_GLUE_HELPER_X86 | 181 | config CRYPTO_GLUE_HELPER_X86 |
@@ -695,7 +694,7 @@ config CRYPTO_AES_NI_INTEL | |||
695 | select CRYPTO_AES_X86_64 if 64BIT | 694 | select CRYPTO_AES_X86_64 if 64BIT |
696 | select CRYPTO_AES_586 if !64BIT | 695 | select CRYPTO_AES_586 if !64BIT |
697 | select CRYPTO_CRYPTD | 696 | select CRYPTO_CRYPTD |
698 | select CRYPTO_ABLK_HELPER_X86 | 697 | select CRYPTO_ABLK_HELPER |
699 | select CRYPTO_ALGAPI | 698 | select CRYPTO_ALGAPI |
700 | select CRYPTO_GLUE_HELPER_X86 if 64BIT | 699 | select CRYPTO_GLUE_HELPER_X86 if 64BIT |
701 | select CRYPTO_LRW | 700 | select CRYPTO_LRW |
@@ -895,7 +894,7 @@ config CRYPTO_CAMELLIA_AESNI_AVX_X86_64 | |||
895 | depends on CRYPTO | 894 | depends on CRYPTO |
896 | select CRYPTO_ALGAPI | 895 | select CRYPTO_ALGAPI |
897 | select CRYPTO_CRYPTD | 896 | select CRYPTO_CRYPTD |
898 | select CRYPTO_ABLK_HELPER_X86 | 897 | select CRYPTO_ABLK_HELPER |
899 | select CRYPTO_GLUE_HELPER_X86 | 898 | select CRYPTO_GLUE_HELPER_X86 |
900 | select CRYPTO_CAMELLIA_X86_64 | 899 | select CRYPTO_CAMELLIA_X86_64 |
901 | select CRYPTO_LRW | 900 | select CRYPTO_LRW |
@@ -917,7 +916,7 @@ config CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 | |||
917 | depends on CRYPTO | 916 | depends on CRYPTO |
918 | select CRYPTO_ALGAPI | 917 | select CRYPTO_ALGAPI |
919 | select CRYPTO_CRYPTD | 918 | select CRYPTO_CRYPTD |
920 | select CRYPTO_ABLK_HELPER_X86 | 919 | select CRYPTO_ABLK_HELPER |
921 | select CRYPTO_GLUE_HELPER_X86 | 920 | select CRYPTO_GLUE_HELPER_X86 |
922 | select CRYPTO_CAMELLIA_X86_64 | 921 | select CRYPTO_CAMELLIA_X86_64 |
923 | select CRYPTO_CAMELLIA_AESNI_AVX_X86_64 | 922 | select CRYPTO_CAMELLIA_AESNI_AVX_X86_64 |
@@ -969,7 +968,7 @@ config CRYPTO_CAST5_AVX_X86_64 | |||
969 | depends on X86 && 64BIT | 968 | depends on X86 && 64BIT |
970 | select CRYPTO_ALGAPI | 969 | select CRYPTO_ALGAPI |
971 | select CRYPTO_CRYPTD | 970 | select CRYPTO_CRYPTD |
972 | select CRYPTO_ABLK_HELPER_X86 | 971 | select CRYPTO_ABLK_HELPER |
973 | select CRYPTO_CAST_COMMON | 972 | select CRYPTO_CAST_COMMON |
974 | select CRYPTO_CAST5 | 973 | select CRYPTO_CAST5 |
975 | help | 974 | help |
@@ -992,7 +991,7 @@ config CRYPTO_CAST6_AVX_X86_64 | |||
992 | depends on X86 && 64BIT | 991 | depends on X86 && 64BIT |
993 | select CRYPTO_ALGAPI | 992 | select CRYPTO_ALGAPI |
994 | select CRYPTO_CRYPTD | 993 | select CRYPTO_CRYPTD |
995 | select CRYPTO_ABLK_HELPER_X86 | 994 | select CRYPTO_ABLK_HELPER |
996 | select CRYPTO_GLUE_HELPER_X86 | 995 | select CRYPTO_GLUE_HELPER_X86 |
997 | select CRYPTO_CAST_COMMON | 996 | select CRYPTO_CAST_COMMON |
998 | select CRYPTO_CAST6 | 997 | select CRYPTO_CAST6 |
@@ -1110,7 +1109,7 @@ config CRYPTO_SERPENT_SSE2_X86_64 | |||
1110 | depends on X86 && 64BIT | 1109 | depends on X86 && 64BIT |
1111 | select CRYPTO_ALGAPI | 1110 | select CRYPTO_ALGAPI |
1112 | select CRYPTO_CRYPTD | 1111 | select CRYPTO_CRYPTD |
1113 | select CRYPTO_ABLK_HELPER_X86 | 1112 | select CRYPTO_ABLK_HELPER |
1114 | select CRYPTO_GLUE_HELPER_X86 | 1113 | select CRYPTO_GLUE_HELPER_X86 |
1115 | select CRYPTO_SERPENT | 1114 | select CRYPTO_SERPENT |
1116 | select CRYPTO_LRW | 1115 | select CRYPTO_LRW |
@@ -1132,7 +1131,7 @@ config CRYPTO_SERPENT_SSE2_586 | |||
1132 | depends on X86 && !64BIT | 1131 | depends on X86 && !64BIT |
1133 | select CRYPTO_ALGAPI | 1132 | select CRYPTO_ALGAPI |
1134 | select CRYPTO_CRYPTD | 1133 | select CRYPTO_CRYPTD |
1135 | select CRYPTO_ABLK_HELPER_X86 | 1134 | select CRYPTO_ABLK_HELPER |
1136 | select CRYPTO_GLUE_HELPER_X86 | 1135 | select CRYPTO_GLUE_HELPER_X86 |
1137 | select CRYPTO_SERPENT | 1136 | select CRYPTO_SERPENT |
1138 | select CRYPTO_LRW | 1137 | select CRYPTO_LRW |
@@ -1154,7 +1153,7 @@ config CRYPTO_SERPENT_AVX_X86_64 | |||
1154 | depends on X86 && 64BIT | 1153 | depends on X86 && 64BIT |
1155 | select CRYPTO_ALGAPI | 1154 | select CRYPTO_ALGAPI |
1156 | select CRYPTO_CRYPTD | 1155 | select CRYPTO_CRYPTD |
1157 | select CRYPTO_ABLK_HELPER_X86 | 1156 | select CRYPTO_ABLK_HELPER |
1158 | select CRYPTO_GLUE_HELPER_X86 | 1157 | select CRYPTO_GLUE_HELPER_X86 |
1159 | select CRYPTO_SERPENT | 1158 | select CRYPTO_SERPENT |
1160 | select CRYPTO_LRW | 1159 | select CRYPTO_LRW |
@@ -1176,7 +1175,7 @@ config CRYPTO_SERPENT_AVX2_X86_64 | |||
1176 | depends on X86 && 64BIT | 1175 | depends on X86 && 64BIT |
1177 | select CRYPTO_ALGAPI | 1176 | select CRYPTO_ALGAPI |
1178 | select CRYPTO_CRYPTD | 1177 | select CRYPTO_CRYPTD |
1179 | select CRYPTO_ABLK_HELPER_X86 | 1178 | select CRYPTO_ABLK_HELPER |
1180 | select CRYPTO_GLUE_HELPER_X86 | 1179 | select CRYPTO_GLUE_HELPER_X86 |
1181 | select CRYPTO_SERPENT | 1180 | select CRYPTO_SERPENT |
1182 | select CRYPTO_SERPENT_AVX_X86_64 | 1181 | select CRYPTO_SERPENT_AVX_X86_64 |
@@ -1292,7 +1291,7 @@ config CRYPTO_TWOFISH_AVX_X86_64 | |||
1292 | depends on X86 && 64BIT | 1291 | depends on X86 && 64BIT |
1293 | select CRYPTO_ALGAPI | 1292 | select CRYPTO_ALGAPI |
1294 | select CRYPTO_CRYPTD | 1293 | select CRYPTO_CRYPTD |
1295 | select CRYPTO_ABLK_HELPER_X86 | 1294 | select CRYPTO_ABLK_HELPER |
1296 | select CRYPTO_GLUE_HELPER_X86 | 1295 | select CRYPTO_GLUE_HELPER_X86 |
1297 | select CRYPTO_TWOFISH_COMMON | 1296 | select CRYPTO_TWOFISH_COMMON |
1298 | select CRYPTO_TWOFISH_X86_64 | 1297 | select CRYPTO_TWOFISH_X86_64 |
diff --git a/crypto/Makefile b/crypto/Makefile index b3a7e807e08b..989c510da8cc 100644 --- a/crypto/Makefile +++ b/crypto/Makefile | |||
@@ -2,8 +2,13 @@ | |||
2 | # Cryptographic API | 2 | # Cryptographic API |
3 | # | 3 | # |
4 | 4 | ||
5 | # memneq MUST be built with -Os or -O0 to prevent early-return optimizations | ||
6 | # that will defeat memneq's actual purpose to prevent timing attacks. | ||
7 | CFLAGS_REMOVE_memneq.o := -O1 -O2 -O3 | ||
8 | CFLAGS_memneq.o := -Os | ||
9 | |||
5 | obj-$(CONFIG_CRYPTO) += crypto.o | 10 | obj-$(CONFIG_CRYPTO) += crypto.o |
6 | crypto-y := api.o cipher.o compress.o | 11 | crypto-y := api.o cipher.o compress.o memneq.o |
7 | 12 | ||
8 | obj-$(CONFIG_CRYPTO_WORKQUEUE) += crypto_wq.o | 13 | obj-$(CONFIG_CRYPTO_WORKQUEUE) += crypto_wq.o |
9 | 14 | ||
@@ -105,3 +110,4 @@ obj-$(CONFIG_XOR_BLOCKS) += xor.o | |||
105 | obj-$(CONFIG_ASYNC_CORE) += async_tx/ | 110 | obj-$(CONFIG_ASYNC_CORE) += async_tx/ |
106 | obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ | 111 | obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ |
107 | obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o | 112 | obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o |
113 | obj-$(CONFIG_CRYPTO_ABLK_HELPER) += ablk_helper.o | ||
diff --git a/arch/x86/crypto/ablk_helper.c b/crypto/ablk_helper.c index 43282fe04a8b..ffe7278d4bd8 100644 --- a/arch/x86/crypto/ablk_helper.c +++ b/crypto/ablk_helper.c | |||
@@ -28,10 +28,11 @@ | |||
28 | #include <linux/crypto.h> | 28 | #include <linux/crypto.h> |
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/hardirq.h> | ||
31 | #include <crypto/algapi.h> | 32 | #include <crypto/algapi.h> |
32 | #include <crypto/cryptd.h> | 33 | #include <crypto/cryptd.h> |
33 | #include <asm/i387.h> | 34 | #include <crypto/ablk_helper.h> |
34 | #include <asm/crypto/ablk_helper.h> | 35 | #include <asm/simd.h> |
35 | 36 | ||
36 | int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key, | 37 | int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key, |
37 | unsigned int key_len) | 38 | unsigned int key_len) |
@@ -70,11 +71,11 @@ int ablk_encrypt(struct ablkcipher_request *req) | |||
70 | struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); | 71 | struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); |
71 | struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm); | 72 | struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm); |
72 | 73 | ||
73 | if (!irq_fpu_usable()) { | 74 | if (!may_use_simd()) { |
74 | struct ablkcipher_request *cryptd_req = | 75 | struct ablkcipher_request *cryptd_req = |
75 | ablkcipher_request_ctx(req); | 76 | ablkcipher_request_ctx(req); |
76 | 77 | ||
77 | memcpy(cryptd_req, req, sizeof(*req)); | 78 | *cryptd_req = *req; |
78 | ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base); | 79 | ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base); |
79 | 80 | ||
80 | return crypto_ablkcipher_encrypt(cryptd_req); | 81 | return crypto_ablkcipher_encrypt(cryptd_req); |
@@ -89,11 +90,11 @@ int ablk_decrypt(struct ablkcipher_request *req) | |||
89 | struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); | 90 | struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); |
90 | struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm); | 91 | struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm); |
91 | 92 | ||
92 | if (!irq_fpu_usable()) { | 93 | if (!may_use_simd()) { |
93 | struct ablkcipher_request *cryptd_req = | 94 | struct ablkcipher_request *cryptd_req = |
94 | ablkcipher_request_ctx(req); | 95 | ablkcipher_request_ctx(req); |
95 | 96 | ||
96 | memcpy(cryptd_req, req, sizeof(*req)); | 97 | *cryptd_req = *req; |
97 | ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base); | 98 | ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base); |
98 | 99 | ||
99 | return crypto_ablkcipher_decrypt(cryptd_req); | 100 | return crypto_ablkcipher_decrypt(cryptd_req); |
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index 7d4a8d28277e..40886c489903 100644 --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c | |||
@@ -16,9 +16,7 @@ | |||
16 | #include <crypto/internal/skcipher.h> | 16 | #include <crypto/internal/skcipher.h> |
17 | #include <linux/cpumask.h> | 17 | #include <linux/cpumask.h> |
18 | #include <linux/err.h> | 18 | #include <linux/err.h> |
19 | #include <linux/init.h> | ||
20 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
21 | #include <linux/module.h> | ||
22 | #include <linux/rtnetlink.h> | 20 | #include <linux/rtnetlink.h> |
23 | #include <linux/sched.h> | 21 | #include <linux/sched.h> |
24 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
@@ -30,8 +28,6 @@ | |||
30 | 28 | ||
31 | #include "internal.h" | 29 | #include "internal.h" |
32 | 30 | ||
33 | static const char *skcipher_default_geniv __read_mostly; | ||
34 | |||
35 | struct ablkcipher_buffer { | 31 | struct ablkcipher_buffer { |
36 | struct list_head entry; | 32 | struct list_head entry; |
37 | struct scatter_walk dst; | 33 | struct scatter_walk dst; |
@@ -527,8 +523,7 @@ const char *crypto_default_geniv(const struct crypto_alg *alg) | |||
527 | alg->cra_blocksize) | 523 | alg->cra_blocksize) |
528 | return "chainiv"; | 524 | return "chainiv"; |
529 | 525 | ||
530 | return alg->cra_flags & CRYPTO_ALG_ASYNC ? | 526 | return "eseqiv"; |
531 | "eseqiv" : skcipher_default_geniv; | ||
532 | } | 527 | } |
533 | 528 | ||
534 | static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask) | 529 | static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask) |
@@ -709,17 +704,3 @@ err: | |||
709 | return ERR_PTR(err); | 704 | return ERR_PTR(err); |
710 | } | 705 | } |
711 | EXPORT_SYMBOL_GPL(crypto_alloc_ablkcipher); | 706 | EXPORT_SYMBOL_GPL(crypto_alloc_ablkcipher); |
712 | |||
713 | static int __init skcipher_module_init(void) | ||
714 | { | ||
715 | skcipher_default_geniv = num_possible_cpus() > 1 ? | ||
716 | "eseqiv" : "chainiv"; | ||
717 | return 0; | ||
718 | } | ||
719 | |||
720 | static void skcipher_module_exit(void) | ||
721 | { | ||
722 | } | ||
723 | |||
724 | module_init(skcipher_module_init); | ||
725 | module_exit(skcipher_module_exit); | ||
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c index ef5356cd280a..850246206b12 100644 --- a/crypto/algif_hash.c +++ b/crypto/algif_hash.c | |||
@@ -114,6 +114,9 @@ static ssize_t hash_sendpage(struct socket *sock, struct page *page, | |||
114 | struct hash_ctx *ctx = ask->private; | 114 | struct hash_ctx *ctx = ask->private; |
115 | int err; | 115 | int err; |
116 | 116 | ||
117 | if (flags & MSG_SENDPAGE_NOTLAST) | ||
118 | flags |= MSG_MORE; | ||
119 | |||
117 | lock_sock(sk); | 120 | lock_sock(sk); |
118 | sg_init_table(ctx->sgl.sg, 1); | 121 | sg_init_table(ctx->sgl.sg, 1); |
119 | sg_set_page(ctx->sgl.sg, page, size, offset); | 122 | sg_set_page(ctx->sgl.sg, page, size, offset); |
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index 6a6dfc062d2a..a19c027b29bd 100644 --- a/crypto/algif_skcipher.c +++ b/crypto/algif_skcipher.c | |||
@@ -378,6 +378,9 @@ static ssize_t skcipher_sendpage(struct socket *sock, struct page *page, | |||
378 | struct skcipher_sg_list *sgl; | 378 | struct skcipher_sg_list *sgl; |
379 | int err = -EINVAL; | 379 | int err = -EINVAL; |
380 | 380 | ||
381 | if (flags & MSG_SENDPAGE_NOTLAST) | ||
382 | flags |= MSG_MORE; | ||
383 | |||
381 | lock_sock(sk); | 384 | lock_sock(sk); |
382 | if (!ctx->more && ctx->used) | 385 | if (!ctx->more && ctx->used) |
383 | goto unlock; | 386 | goto unlock; |
diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index c0bb3778f1ae..666f1962a160 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c | |||
@@ -230,11 +230,11 @@ remainder: | |||
230 | */ | 230 | */ |
231 | if (byte_count < DEFAULT_BLK_SZ) { | 231 | if (byte_count < DEFAULT_BLK_SZ) { |
232 | empty_rbuf: | 232 | empty_rbuf: |
233 | for (; ctx->rand_data_valid < DEFAULT_BLK_SZ; | 233 | while (ctx->rand_data_valid < DEFAULT_BLK_SZ) { |
234 | ctx->rand_data_valid++) { | ||
235 | *ptr = ctx->rand_data[ctx->rand_data_valid]; | 234 | *ptr = ctx->rand_data[ctx->rand_data_valid]; |
236 | ptr++; | 235 | ptr++; |
237 | byte_count--; | 236 | byte_count--; |
237 | ctx->rand_data_valid++; | ||
238 | if (byte_count == 0) | 238 | if (byte_count == 0) |
239 | goto done; | 239 | goto done; |
240 | } | 240 | } |
diff --git a/crypto/asymmetric_keys/rsa.c b/crypto/asymmetric_keys/rsa.c index 90a17f59ba28..459cf97a75e2 100644 --- a/crypto/asymmetric_keys/rsa.c +++ b/crypto/asymmetric_keys/rsa.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include <crypto/algapi.h> | ||
16 | #include "public_key.h" | 17 | #include "public_key.h" |
17 | 18 | ||
18 | MODULE_LICENSE("GPL"); | 19 | MODULE_LICENSE("GPL"); |
@@ -189,12 +190,12 @@ static int RSA_verify(const u8 *H, const u8 *EM, size_t k, size_t hash_size, | |||
189 | } | 190 | } |
190 | } | 191 | } |
191 | 192 | ||
192 | if (memcmp(asn1_template, EM + T_offset, asn1_size) != 0) { | 193 | if (crypto_memneq(asn1_template, EM + T_offset, asn1_size) != 0) { |
193 | kleave(" = -EBADMSG [EM[T] ASN.1 mismatch]"); | 194 | kleave(" = -EBADMSG [EM[T] ASN.1 mismatch]"); |
194 | return -EBADMSG; | 195 | return -EBADMSG; |
195 | } | 196 | } |
196 | 197 | ||
197 | if (memcmp(H, EM + T_offset + asn1_size, hash_size) != 0) { | 198 | if (crypto_memneq(H, EM + T_offset + asn1_size, hash_size) != 0) { |
198 | kleave(" = -EKEYREJECTED [EM[T] hash mismatch]"); | 199 | kleave(" = -EKEYREJECTED [EM[T] hash mismatch]"); |
199 | return -EKEYREJECTED; | 200 | return -EKEYREJECTED; |
200 | } | 201 | } |
diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c index f83300b6e8c1..382ef0d2ff2e 100644 --- a/crypto/asymmetric_keys/x509_public_key.c +++ b/crypto/asymmetric_keys/x509_public_key.c | |||
@@ -18,60 +18,12 @@ | |||
18 | #include <linux/asn1_decoder.h> | 18 | #include <linux/asn1_decoder.h> |
19 | #include <keys/asymmetric-subtype.h> | 19 | #include <keys/asymmetric-subtype.h> |
20 | #include <keys/asymmetric-parser.h> | 20 | #include <keys/asymmetric-parser.h> |
21 | #include <keys/system_keyring.h> | ||
22 | #include <crypto/hash.h> | 21 | #include <crypto/hash.h> |
23 | #include "asymmetric_keys.h" | 22 | #include "asymmetric_keys.h" |
24 | #include "public_key.h" | 23 | #include "public_key.h" |
25 | #include "x509_parser.h" | 24 | #include "x509_parser.h" |
26 | 25 | ||
27 | /* | 26 | /* |
28 | * Find a key in the given keyring by issuer and authority. | ||
29 | */ | ||
30 | static struct key *x509_request_asymmetric_key( | ||
31 | struct key *keyring, | ||
32 | const char *signer, size_t signer_len, | ||
33 | const char *authority, size_t auth_len) | ||
34 | { | ||
35 | key_ref_t key; | ||
36 | char *id; | ||
37 | |||
38 | /* Construct an identifier. */ | ||
39 | id = kmalloc(signer_len + 2 + auth_len + 1, GFP_KERNEL); | ||
40 | if (!id) | ||
41 | return ERR_PTR(-ENOMEM); | ||
42 | |||
43 | memcpy(id, signer, signer_len); | ||
44 | id[signer_len + 0] = ':'; | ||
45 | id[signer_len + 1] = ' '; | ||
46 | memcpy(id + signer_len + 2, authority, auth_len); | ||
47 | id[signer_len + 2 + auth_len] = 0; | ||
48 | |||
49 | pr_debug("Look up: \"%s\"\n", id); | ||
50 | |||
51 | key = keyring_search(make_key_ref(keyring, 1), | ||
52 | &key_type_asymmetric, id); | ||
53 | if (IS_ERR(key)) | ||
54 | pr_debug("Request for module key '%s' err %ld\n", | ||
55 | id, PTR_ERR(key)); | ||
56 | kfree(id); | ||
57 | |||
58 | if (IS_ERR(key)) { | ||
59 | switch (PTR_ERR(key)) { | ||
60 | /* Hide some search errors */ | ||
61 | case -EACCES: | ||
62 | case -ENOTDIR: | ||
63 | case -EAGAIN: | ||
64 | return ERR_PTR(-ENOKEY); | ||
65 | default: | ||
66 | return ERR_CAST(key); | ||
67 | } | ||
68 | } | ||
69 | |||
70 | pr_devel("<==%s() = 0 [%x]\n", __func__, key_serial(key_ref_to_ptr(key))); | ||
71 | return key_ref_to_ptr(key); | ||
72 | } | ||
73 | |||
74 | /* | ||
75 | * Set up the signature parameters in an X.509 certificate. This involves | 27 | * Set up the signature parameters in an X.509 certificate. This involves |
76 | * digesting the signed data and extracting the signature. | 28 | * digesting the signed data and extracting the signature. |
77 | */ | 29 | */ |
@@ -151,33 +103,6 @@ int x509_check_signature(const struct public_key *pub, | |||
151 | EXPORT_SYMBOL_GPL(x509_check_signature); | 103 | EXPORT_SYMBOL_GPL(x509_check_signature); |
152 | 104 | ||
153 | /* | 105 | /* |
154 | * Check the new certificate against the ones in the trust keyring. If one of | ||
155 | * those is the signing key and validates the new certificate, then mark the | ||
156 | * new certificate as being trusted. | ||
157 | * | ||
158 | * Return 0 if the new certificate was successfully validated, 1 if we couldn't | ||
159 | * find a matching parent certificate in the trusted list and an error if there | ||
160 | * is a matching certificate but the signature check fails. | ||
161 | */ | ||
162 | static int x509_validate_trust(struct x509_certificate *cert, | ||
163 | struct key *trust_keyring) | ||
164 | { | ||
165 | const struct public_key *pk; | ||
166 | struct key *key; | ||
167 | int ret = 1; | ||
168 | |||
169 | key = x509_request_asymmetric_key(trust_keyring, | ||
170 | cert->issuer, strlen(cert->issuer), | ||
171 | cert->authority, | ||
172 | strlen(cert->authority)); | ||
173 | if (!IS_ERR(key)) { | ||
174 | pk = key->payload.data; | ||
175 | ret = x509_check_signature(pk, cert); | ||
176 | } | ||
177 | return ret; | ||
178 | } | ||
179 | |||
180 | /* | ||
181 | * Attempt to parse a data blob for a key as an X509 certificate. | 106 | * Attempt to parse a data blob for a key as an X509 certificate. |
182 | */ | 107 | */ |
183 | static int x509_key_preparse(struct key_preparsed_payload *prep) | 108 | static int x509_key_preparse(struct key_preparsed_payload *prep) |
@@ -230,13 +155,9 @@ static int x509_key_preparse(struct key_preparsed_payload *prep) | |||
230 | /* Check the signature on the key if it appears to be self-signed */ | 155 | /* Check the signature on the key if it appears to be self-signed */ |
231 | if (!cert->authority || | 156 | if (!cert->authority || |
232 | strcmp(cert->fingerprint, cert->authority) == 0) { | 157 | strcmp(cert->fingerprint, cert->authority) == 0) { |
233 | ret = x509_check_signature(cert->pub, cert); /* self-signed */ | 158 | ret = x509_check_signature(cert->pub, cert); |
234 | if (ret < 0) | 159 | if (ret < 0) |
235 | goto error_free_cert; | 160 | goto error_free_cert; |
236 | } else { | ||
237 | ret = x509_validate_trust(cert, system_trusted_keyring); | ||
238 | if (!ret) | ||
239 | prep->trusted = 1; | ||
240 | } | 161 | } |
241 | 162 | ||
242 | /* Propose a description */ | 163 | /* Propose a description */ |
diff --git a/crypto/authenc.c b/crypto/authenc.c index ffce19de05cf..e1223559d5df 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c | |||
@@ -52,40 +52,52 @@ static void authenc_request_complete(struct aead_request *req, int err) | |||
52 | aead_request_complete(req, err); | 52 | aead_request_complete(req, err); |
53 | } | 53 | } |
54 | 54 | ||
55 | static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key, | 55 | int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key, |
56 | unsigned int keylen) | 56 | unsigned int keylen) |
57 | { | 57 | { |
58 | unsigned int authkeylen; | 58 | struct rtattr *rta = (struct rtattr *)key; |
59 | unsigned int enckeylen; | ||
60 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); | ||
61 | struct crypto_ahash *auth = ctx->auth; | ||
62 | struct crypto_ablkcipher *enc = ctx->enc; | ||
63 | struct rtattr *rta = (void *)key; | ||
64 | struct crypto_authenc_key_param *param; | 59 | struct crypto_authenc_key_param *param; |
65 | int err = -EINVAL; | ||
66 | 60 | ||
67 | if (!RTA_OK(rta, keylen)) | 61 | if (!RTA_OK(rta, keylen)) |
68 | goto badkey; | 62 | return -EINVAL; |
69 | if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM) | 63 | if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM) |
70 | goto badkey; | 64 | return -EINVAL; |
71 | if (RTA_PAYLOAD(rta) < sizeof(*param)) | 65 | if (RTA_PAYLOAD(rta) < sizeof(*param)) |
72 | goto badkey; | 66 | return -EINVAL; |
73 | 67 | ||
74 | param = RTA_DATA(rta); | 68 | param = RTA_DATA(rta); |
75 | enckeylen = be32_to_cpu(param->enckeylen); | 69 | keys->enckeylen = be32_to_cpu(param->enckeylen); |
76 | 70 | ||
77 | key += RTA_ALIGN(rta->rta_len); | 71 | key += RTA_ALIGN(rta->rta_len); |
78 | keylen -= RTA_ALIGN(rta->rta_len); | 72 | keylen -= RTA_ALIGN(rta->rta_len); |
79 | 73 | ||
80 | if (keylen < enckeylen) | 74 | if (keylen < keys->enckeylen) |
81 | goto badkey; | 75 | return -EINVAL; |
82 | 76 | ||
83 | authkeylen = keylen - enckeylen; | 77 | keys->authkeylen = keylen - keys->enckeylen; |
78 | keys->authkey = key; | ||
79 | keys->enckey = key + keys->authkeylen; | ||
80 | |||
81 | return 0; | ||
82 | } | ||
83 | EXPORT_SYMBOL_GPL(crypto_authenc_extractkeys); | ||
84 | |||
85 | static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key, | ||
86 | unsigned int keylen) | ||
87 | { | ||
88 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); | ||
89 | struct crypto_ahash *auth = ctx->auth; | ||
90 | struct crypto_ablkcipher *enc = ctx->enc; | ||
91 | struct crypto_authenc_keys keys; | ||
92 | int err = -EINVAL; | ||
93 | |||
94 | if (crypto_authenc_extractkeys(&keys, key, keylen) != 0) | ||
95 | goto badkey; | ||
84 | 96 | ||
85 | crypto_ahash_clear_flags(auth, CRYPTO_TFM_REQ_MASK); | 97 | crypto_ahash_clear_flags(auth, CRYPTO_TFM_REQ_MASK); |
86 | crypto_ahash_set_flags(auth, crypto_aead_get_flags(authenc) & | 98 | crypto_ahash_set_flags(auth, crypto_aead_get_flags(authenc) & |
87 | CRYPTO_TFM_REQ_MASK); | 99 | CRYPTO_TFM_REQ_MASK); |
88 | err = crypto_ahash_setkey(auth, key, authkeylen); | 100 | err = crypto_ahash_setkey(auth, keys.authkey, keys.authkeylen); |
89 | crypto_aead_set_flags(authenc, crypto_ahash_get_flags(auth) & | 101 | crypto_aead_set_flags(authenc, crypto_ahash_get_flags(auth) & |
90 | CRYPTO_TFM_RES_MASK); | 102 | CRYPTO_TFM_RES_MASK); |
91 | 103 | ||
@@ -95,7 +107,7 @@ static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key, | |||
95 | crypto_ablkcipher_clear_flags(enc, CRYPTO_TFM_REQ_MASK); | 107 | crypto_ablkcipher_clear_flags(enc, CRYPTO_TFM_REQ_MASK); |
96 | crypto_ablkcipher_set_flags(enc, crypto_aead_get_flags(authenc) & | 108 | crypto_ablkcipher_set_flags(enc, crypto_aead_get_flags(authenc) & |
97 | CRYPTO_TFM_REQ_MASK); | 109 | CRYPTO_TFM_REQ_MASK); |
98 | err = crypto_ablkcipher_setkey(enc, key + authkeylen, enckeylen); | 110 | err = crypto_ablkcipher_setkey(enc, keys.enckey, keys.enckeylen); |
99 | crypto_aead_set_flags(authenc, crypto_ablkcipher_get_flags(enc) & | 111 | crypto_aead_set_flags(authenc, crypto_ablkcipher_get_flags(enc) & |
100 | CRYPTO_TFM_RES_MASK); | 112 | CRYPTO_TFM_RES_MASK); |
101 | 113 | ||
@@ -188,7 +200,7 @@ static void authenc_verify_ahash_update_done(struct crypto_async_request *areq, | |||
188 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, | 200 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, |
189 | authsize, 0); | 201 | authsize, 0); |
190 | 202 | ||
191 | err = memcmp(ihash, ahreq->result, authsize) ? -EBADMSG : 0; | 203 | err = crypto_memneq(ihash, ahreq->result, authsize) ? -EBADMSG : 0; |
192 | if (err) | 204 | if (err) |
193 | goto out; | 205 | goto out; |
194 | 206 | ||
@@ -227,7 +239,7 @@ static void authenc_verify_ahash_done(struct crypto_async_request *areq, | |||
227 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, | 239 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, |
228 | authsize, 0); | 240 | authsize, 0); |
229 | 241 | ||
230 | err = memcmp(ihash, ahreq->result, authsize) ? -EBADMSG : 0; | 242 | err = crypto_memneq(ihash, ahreq->result, authsize) ? -EBADMSG : 0; |
231 | if (err) | 243 | if (err) |
232 | goto out; | 244 | goto out; |
233 | 245 | ||
@@ -368,9 +380,10 @@ static void crypto_authenc_encrypt_done(struct crypto_async_request *req, | |||
368 | if (!err) { | 380 | if (!err) { |
369 | struct crypto_aead *authenc = crypto_aead_reqtfm(areq); | 381 | struct crypto_aead *authenc = crypto_aead_reqtfm(areq); |
370 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); | 382 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); |
371 | struct ablkcipher_request *abreq = aead_request_ctx(areq); | 383 | struct authenc_request_ctx *areq_ctx = aead_request_ctx(areq); |
372 | u8 *iv = (u8 *)(abreq + 1) + | 384 | struct ablkcipher_request *abreq = (void *)(areq_ctx->tail |
373 | crypto_ablkcipher_reqsize(ctx->enc); | 385 | + ctx->reqoff); |
386 | u8 *iv = (u8 *)abreq - crypto_ablkcipher_ivsize(ctx->enc); | ||
374 | 387 | ||
375 | err = crypto_authenc_genicv(areq, iv, 0); | 388 | err = crypto_authenc_genicv(areq, iv, 0); |
376 | } | 389 | } |
@@ -462,7 +475,7 @@ static int crypto_authenc_verify(struct aead_request *req, | |||
462 | ihash = ohash + authsize; | 475 | ihash = ohash + authsize; |
463 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, | 476 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, |
464 | authsize, 0); | 477 | authsize, 0); |
465 | return memcmp(ihash, ohash, authsize) ? -EBADMSG : 0; | 478 | return crypto_memneq(ihash, ohash, authsize) ? -EBADMSG : 0; |
466 | } | 479 | } |
467 | 480 | ||
468 | static int crypto_authenc_iverify(struct aead_request *req, u8 *iv, | 481 | static int crypto_authenc_iverify(struct aead_request *req, u8 *iv, |
diff --git a/crypto/authencesn.c b/crypto/authencesn.c index ab53762fc309..4be0dd4373a9 100644 --- a/crypto/authencesn.c +++ b/crypto/authencesn.c | |||
@@ -59,37 +59,19 @@ static void authenc_esn_request_complete(struct aead_request *req, int err) | |||
59 | static int crypto_authenc_esn_setkey(struct crypto_aead *authenc_esn, const u8 *key, | 59 | static int crypto_authenc_esn_setkey(struct crypto_aead *authenc_esn, const u8 *key, |
60 | unsigned int keylen) | 60 | unsigned int keylen) |
61 | { | 61 | { |
62 | unsigned int authkeylen; | ||
63 | unsigned int enckeylen; | ||
64 | struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(authenc_esn); | 62 | struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(authenc_esn); |
65 | struct crypto_ahash *auth = ctx->auth; | 63 | struct crypto_ahash *auth = ctx->auth; |
66 | struct crypto_ablkcipher *enc = ctx->enc; | 64 | struct crypto_ablkcipher *enc = ctx->enc; |
67 | struct rtattr *rta = (void *)key; | 65 | struct crypto_authenc_keys keys; |
68 | struct crypto_authenc_key_param *param; | ||
69 | int err = -EINVAL; | 66 | int err = -EINVAL; |
70 | 67 | ||
71 | if (!RTA_OK(rta, keylen)) | 68 | if (crypto_authenc_extractkeys(&keys, key, keylen) != 0) |
72 | goto badkey; | 69 | goto badkey; |
73 | if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM) | ||
74 | goto badkey; | ||
75 | if (RTA_PAYLOAD(rta) < sizeof(*param)) | ||
76 | goto badkey; | ||
77 | |||
78 | param = RTA_DATA(rta); | ||
79 | enckeylen = be32_to_cpu(param->enckeylen); | ||
80 | |||
81 | key += RTA_ALIGN(rta->rta_len); | ||
82 | keylen -= RTA_ALIGN(rta->rta_len); | ||
83 | |||
84 | if (keylen < enckeylen) | ||
85 | goto badkey; | ||
86 | |||
87 | authkeylen = keylen - enckeylen; | ||
88 | 70 | ||
89 | crypto_ahash_clear_flags(auth, CRYPTO_TFM_REQ_MASK); | 71 | crypto_ahash_clear_flags(auth, CRYPTO_TFM_REQ_MASK); |
90 | crypto_ahash_set_flags(auth, crypto_aead_get_flags(authenc_esn) & | 72 | crypto_ahash_set_flags(auth, crypto_aead_get_flags(authenc_esn) & |
91 | CRYPTO_TFM_REQ_MASK); | 73 | CRYPTO_TFM_REQ_MASK); |
92 | err = crypto_ahash_setkey(auth, key, authkeylen); | 74 | err = crypto_ahash_setkey(auth, keys.authkey, keys.authkeylen); |
93 | crypto_aead_set_flags(authenc_esn, crypto_ahash_get_flags(auth) & | 75 | crypto_aead_set_flags(authenc_esn, crypto_ahash_get_flags(auth) & |
94 | CRYPTO_TFM_RES_MASK); | 76 | CRYPTO_TFM_RES_MASK); |
95 | 77 | ||
@@ -99,7 +81,7 @@ static int crypto_authenc_esn_setkey(struct crypto_aead *authenc_esn, const u8 * | |||
99 | crypto_ablkcipher_clear_flags(enc, CRYPTO_TFM_REQ_MASK); | 81 | crypto_ablkcipher_clear_flags(enc, CRYPTO_TFM_REQ_MASK); |
100 | crypto_ablkcipher_set_flags(enc, crypto_aead_get_flags(authenc_esn) & | 82 | crypto_ablkcipher_set_flags(enc, crypto_aead_get_flags(authenc_esn) & |
101 | CRYPTO_TFM_REQ_MASK); | 83 | CRYPTO_TFM_REQ_MASK); |
102 | err = crypto_ablkcipher_setkey(enc, key + authkeylen, enckeylen); | 84 | err = crypto_ablkcipher_setkey(enc, keys.enckey, keys.enckeylen); |
103 | crypto_aead_set_flags(authenc_esn, crypto_ablkcipher_get_flags(enc) & | 85 | crypto_aead_set_flags(authenc_esn, crypto_ablkcipher_get_flags(enc) & |
104 | CRYPTO_TFM_RES_MASK); | 86 | CRYPTO_TFM_RES_MASK); |
105 | 87 | ||
@@ -247,7 +229,7 @@ static void authenc_esn_verify_ahash_update_done(struct crypto_async_request *ar | |||
247 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, | 229 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, |
248 | authsize, 0); | 230 | authsize, 0); |
249 | 231 | ||
250 | err = memcmp(ihash, ahreq->result, authsize) ? -EBADMSG : 0; | 232 | err = crypto_memneq(ihash, ahreq->result, authsize) ? -EBADMSG : 0; |
251 | if (err) | 233 | if (err) |
252 | goto out; | 234 | goto out; |
253 | 235 | ||
@@ -296,7 +278,7 @@ static void authenc_esn_verify_ahash_update_done2(struct crypto_async_request *a | |||
296 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, | 278 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, |
297 | authsize, 0); | 279 | authsize, 0); |
298 | 280 | ||
299 | err = memcmp(ihash, ahreq->result, authsize) ? -EBADMSG : 0; | 281 | err = crypto_memneq(ihash, ahreq->result, authsize) ? -EBADMSG : 0; |
300 | if (err) | 282 | if (err) |
301 | goto out; | 283 | goto out; |
302 | 284 | ||
@@ -336,7 +318,7 @@ static void authenc_esn_verify_ahash_done(struct crypto_async_request *areq, | |||
336 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, | 318 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, |
337 | authsize, 0); | 319 | authsize, 0); |
338 | 320 | ||
339 | err = memcmp(ihash, ahreq->result, authsize) ? -EBADMSG : 0; | 321 | err = crypto_memneq(ihash, ahreq->result, authsize) ? -EBADMSG : 0; |
340 | if (err) | 322 | if (err) |
341 | goto out; | 323 | goto out; |
342 | 324 | ||
@@ -568,7 +550,7 @@ static int crypto_authenc_esn_verify(struct aead_request *req) | |||
568 | ihash = ohash + authsize; | 550 | ihash = ohash + authsize; |
569 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, | 551 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, |
570 | authsize, 0); | 552 | authsize, 0); |
571 | return memcmp(ihash, ohash, authsize) ? -EBADMSG : 0; | 553 | return crypto_memneq(ihash, ohash, authsize) ? -EBADMSG : 0; |
572 | } | 554 | } |
573 | 555 | ||
574 | static int crypto_authenc_esn_iverify(struct aead_request *req, u8 *iv, | 556 | static int crypto_authenc_esn_iverify(struct aead_request *req, u8 *iv, |
diff --git a/crypto/ccm.c b/crypto/ccm.c index 499c91717d93..1df84217f7c9 100644 --- a/crypto/ccm.c +++ b/crypto/ccm.c | |||
@@ -271,7 +271,8 @@ static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain, | |||
271 | } | 271 | } |
272 | 272 | ||
273 | /* compute plaintext into mac */ | 273 | /* compute plaintext into mac */ |
274 | get_data_to_compute(cipher, pctx, plain, cryptlen); | 274 | if (cryptlen) |
275 | get_data_to_compute(cipher, pctx, plain, cryptlen); | ||
275 | 276 | ||
276 | out: | 277 | out: |
277 | return err; | 278 | return err; |
@@ -363,7 +364,7 @@ static void crypto_ccm_decrypt_done(struct crypto_async_request *areq, | |||
363 | 364 | ||
364 | if (!err) { | 365 | if (!err) { |
365 | err = crypto_ccm_auth(req, req->dst, cryptlen); | 366 | err = crypto_ccm_auth(req, req->dst, cryptlen); |
366 | if (!err && memcmp(pctx->auth_tag, pctx->odata, authsize)) | 367 | if (!err && crypto_memneq(pctx->auth_tag, pctx->odata, authsize)) |
367 | err = -EBADMSG; | 368 | err = -EBADMSG; |
368 | } | 369 | } |
369 | aead_request_complete(req, err); | 370 | aead_request_complete(req, err); |
@@ -422,7 +423,7 @@ static int crypto_ccm_decrypt(struct aead_request *req) | |||
422 | return err; | 423 | return err; |
423 | 424 | ||
424 | /* verify */ | 425 | /* verify */ |
425 | if (memcmp(authtag, odata, authsize)) | 426 | if (crypto_memneq(authtag, odata, authsize)) |
426 | return -EBADMSG; | 427 | return -EBADMSG; |
427 | 428 | ||
428 | return err; | 429 | return err; |
diff --git a/crypto/gcm.c b/crypto/gcm.c index 43e1fb05ea54..b4f017939004 100644 --- a/crypto/gcm.c +++ b/crypto/gcm.c | |||
@@ -582,7 +582,7 @@ static int crypto_gcm_verify(struct aead_request *req, | |||
582 | 582 | ||
583 | crypto_xor(auth_tag, iauth_tag, 16); | 583 | crypto_xor(auth_tag, iauth_tag, 16); |
584 | scatterwalk_map_and_copy(iauth_tag, req->src, cryptlen, authsize, 0); | 584 | scatterwalk_map_and_copy(iauth_tag, req->src, cryptlen, authsize, 0); |
585 | return memcmp(iauth_tag, auth_tag, authsize) ? -EBADMSG : 0; | 585 | return crypto_memneq(iauth_tag, auth_tag, authsize) ? -EBADMSG : 0; |
586 | } | 586 | } |
587 | 587 | ||
588 | static void gcm_decrypt_done(struct crypto_async_request *areq, int err) | 588 | static void gcm_decrypt_done(struct crypto_async_request *areq, int err) |
diff --git a/crypto/memneq.c b/crypto/memneq.c new file mode 100644 index 000000000000..cd0162221c14 --- /dev/null +++ b/crypto/memneq.c | |||
@@ -0,0 +1,138 @@ | |||
1 | /* | ||
2 | * Constant-time equality testing of memory regions. | ||
3 | * | ||
4 | * Authors: | ||
5 | * | ||
6 | * James Yonan <james@openvpn.net> | ||
7 | * Daniel Borkmann <dborkman@redhat.com> | ||
8 | * | ||
9 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
10 | * redistributing this file, you may do so under either license. | ||
11 | * | ||
12 | * GPL LICENSE SUMMARY | ||
13 | * | ||
14 | * Copyright(c) 2013 OpenVPN Technologies, Inc. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or modify | ||
17 | * it under the terms of version 2 of the GNU General Public License as | ||
18 | * published by the Free Software Foundation. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, but | ||
21 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
23 | * General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, write to the Free Software | ||
27 | * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
28 | * The full GNU General Public License is included in this distribution | ||
29 | * in the file called LICENSE.GPL. | ||
30 | * | ||
31 | * BSD LICENSE | ||
32 | * | ||
33 | * Copyright(c) 2013 OpenVPN Technologies, Inc. All rights reserved. | ||
34 | * | ||
35 | * Redistribution and use in source and binary forms, with or without | ||
36 | * modification, are permitted provided that the following conditions | ||
37 | * are met: | ||
38 | * | ||
39 | * * Redistributions of source code must retain the above copyright | ||
40 | * notice, this list of conditions and the following disclaimer. | ||
41 | * * Redistributions in binary form must reproduce the above copyright | ||
42 | * notice, this list of conditions and the following disclaimer in | ||
43 | * the documentation and/or other materials provided with the | ||
44 | * distribution. | ||
45 | * * Neither the name of OpenVPN Technologies nor the names of its | ||
46 | * contributors may be used to endorse or promote products derived | ||
47 | * from this software without specific prior written permission. | ||
48 | * | ||
49 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
50 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
51 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
52 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
53 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
54 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
55 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
56 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
57 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
58 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
59 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
60 | */ | ||
61 | |||
62 | #include <crypto/algapi.h> | ||
63 | |||
64 | #ifndef __HAVE_ARCH_CRYPTO_MEMNEQ | ||
65 | |||
66 | /* Generic path for arbitrary size */ | ||
67 | static inline unsigned long | ||
68 | __crypto_memneq_generic(const void *a, const void *b, size_t size) | ||
69 | { | ||
70 | unsigned long neq = 0; | ||
71 | |||
72 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) | ||
73 | while (size >= sizeof(unsigned long)) { | ||
74 | neq |= *(unsigned long *)a ^ *(unsigned long *)b; | ||
75 | a += sizeof(unsigned long); | ||
76 | b += sizeof(unsigned long); | ||
77 | size -= sizeof(unsigned long); | ||
78 | } | ||
79 | #endif /* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */ | ||
80 | while (size > 0) { | ||
81 | neq |= *(unsigned char *)a ^ *(unsigned char *)b; | ||
82 | a += 1; | ||
83 | b += 1; | ||
84 | size -= 1; | ||
85 | } | ||
86 | return neq; | ||
87 | } | ||
88 | |||
89 | /* Loop-free fast-path for frequently used 16-byte size */ | ||
90 | static inline unsigned long __crypto_memneq_16(const void *a, const void *b) | ||
91 | { | ||
92 | #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS | ||
93 | if (sizeof(unsigned long) == 8) | ||
94 | return ((*(unsigned long *)(a) ^ *(unsigned long *)(b)) | ||
95 | | (*(unsigned long *)(a+8) ^ *(unsigned long *)(b+8))); | ||
96 | else if (sizeof(unsigned int) == 4) | ||
97 | return ((*(unsigned int *)(a) ^ *(unsigned int *)(b)) | ||
98 | | (*(unsigned int *)(a+4) ^ *(unsigned int *)(b+4)) | ||
99 | | (*(unsigned int *)(a+8) ^ *(unsigned int *)(b+8)) | ||
100 | | (*(unsigned int *)(a+12) ^ *(unsigned int *)(b+12))); | ||
101 | else | ||
102 | #endif /* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */ | ||
103 | return ((*(unsigned char *)(a) ^ *(unsigned char *)(b)) | ||
104 | | (*(unsigned char *)(a+1) ^ *(unsigned char *)(b+1)) | ||
105 | | (*(unsigned char *)(a+2) ^ *(unsigned char *)(b+2)) | ||
106 | | (*(unsigned char *)(a+3) ^ *(unsigned char *)(b+3)) | ||
107 | | (*(unsigned char *)(a+4) ^ *(unsigned char *)(b+4)) | ||
108 | | (*(unsigned char *)(a+5) ^ *(unsigned char *)(b+5)) | ||
109 | | (*(unsigned char *)(a+6) ^ *(unsigned char *)(b+6)) | ||
110 | | (*(unsigned char *)(a+7) ^ *(unsigned char *)(b+7)) | ||
111 | | (*(unsigned char *)(a+8) ^ *(unsigned char *)(b+8)) | ||
112 | | (*(unsigned char *)(a+9) ^ *(unsigned char *)(b+9)) | ||
113 | | (*(unsigned char *)(a+10) ^ *(unsigned char *)(b+10)) | ||
114 | | (*(unsigned char *)(a+11) ^ *(unsigned char *)(b+11)) | ||
115 | | (*(unsigned char *)(a+12) ^ *(unsigned char *)(b+12)) | ||
116 | | (*(unsigned char *)(a+13) ^ *(unsigned char *)(b+13)) | ||
117 | | (*(unsigned char *)(a+14) ^ *(unsigned char *)(b+14)) | ||
118 | | (*(unsigned char *)(a+15) ^ *(unsigned char *)(b+15))); | ||
119 | } | ||
120 | |||
121 | /* Compare two areas of memory without leaking timing information, | ||
122 | * and with special optimizations for common sizes. Users should | ||
123 | * not call this function directly, but should instead use | ||
124 | * crypto_memneq defined in crypto/algapi.h. | ||
125 | */ | ||
126 | noinline unsigned long __crypto_memneq(const void *a, const void *b, | ||
127 | size_t size) | ||
128 | { | ||
129 | switch (size) { | ||
130 | case 16: | ||
131 | return __crypto_memneq_16(a, b); | ||
132 | default: | ||
133 | return __crypto_memneq_generic(a, b, size); | ||
134 | } | ||
135 | } | ||
136 | EXPORT_SYMBOL(__crypto_memneq); | ||
137 | |||
138 | #endif /* __HAVE_ARCH_CRYPTO_MEMNEQ */ | ||
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 1ab8258fcf56..001f07cdb828 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -1242,6 +1242,10 @@ static int do_test(int m) | |||
1242 | ret += tcrypt_test("cmac(des3_ede)"); | 1242 | ret += tcrypt_test("cmac(des3_ede)"); |
1243 | break; | 1243 | break; |
1244 | 1244 | ||
1245 | case 155: | ||
1246 | ret += tcrypt_test("authenc(hmac(sha1),cbc(aes))"); | ||
1247 | break; | ||
1248 | |||
1245 | case 200: | 1249 | case 200: |
1246 | test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, | 1250 | test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, |
1247 | speed_template_16_24_32); | 1251 | speed_template_16_24_32); |
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 432afc03e7c3..77955507f6f1 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -503,16 +503,16 @@ static int __test_aead(struct crypto_aead *tfm, int enc, | |||
503 | goto out; | 503 | goto out; |
504 | } | 504 | } |
505 | 505 | ||
506 | sg_init_one(&sg[0], input, | ||
507 | template[i].ilen + (enc ? authsize : 0)); | ||
508 | |||
509 | if (diff_dst) { | 506 | if (diff_dst) { |
510 | output = xoutbuf[0]; | 507 | output = xoutbuf[0]; |
511 | output += align_offset; | 508 | output += align_offset; |
509 | sg_init_one(&sg[0], input, template[i].ilen); | ||
512 | sg_init_one(&sgout[0], output, | 510 | sg_init_one(&sgout[0], output, |
511 | template[i].rlen); | ||
512 | } else { | ||
513 | sg_init_one(&sg[0], input, | ||
513 | template[i].ilen + | 514 | template[i].ilen + |
514 | (enc ? authsize : 0)); | 515 | (enc ? authsize : 0)); |
515 | } else { | ||
516 | output = input; | 516 | output = input; |
517 | } | 517 | } |
518 | 518 | ||
@@ -612,12 +612,6 @@ static int __test_aead(struct crypto_aead *tfm, int enc, | |||
612 | memcpy(q, template[i].input + temp, | 612 | memcpy(q, template[i].input + temp, |
613 | template[i].tap[k]); | 613 | template[i].tap[k]); |
614 | 614 | ||
615 | n = template[i].tap[k]; | ||
616 | if (k == template[i].np - 1 && enc) | ||
617 | n += authsize; | ||
618 | if (offset_in_page(q) + n < PAGE_SIZE) | ||
619 | q[n] = 0; | ||
620 | |||
621 | sg_set_buf(&sg[k], q, template[i].tap[k]); | 615 | sg_set_buf(&sg[k], q, template[i].tap[k]); |
622 | 616 | ||
623 | if (diff_dst) { | 617 | if (diff_dst) { |
@@ -625,13 +619,17 @@ static int __test_aead(struct crypto_aead *tfm, int enc, | |||
625 | offset_in_page(IDX[k]); | 619 | offset_in_page(IDX[k]); |
626 | 620 | ||
627 | memset(q, 0, template[i].tap[k]); | 621 | memset(q, 0, template[i].tap[k]); |
628 | if (offset_in_page(q) + n < PAGE_SIZE) | ||
629 | q[n] = 0; | ||
630 | 622 | ||
631 | sg_set_buf(&sgout[k], q, | 623 | sg_set_buf(&sgout[k], q, |
632 | template[i].tap[k]); | 624 | template[i].tap[k]); |
633 | } | 625 | } |
634 | 626 | ||
627 | n = template[i].tap[k]; | ||
628 | if (k == template[i].np - 1 && enc) | ||
629 | n += authsize; | ||
630 | if (offset_in_page(q) + n < PAGE_SIZE) | ||
631 | q[n] = 0; | ||
632 | |||
635 | temp += template[i].tap[k]; | 633 | temp += template[i].tap[k]; |
636 | } | 634 | } |
637 | 635 | ||
@@ -650,10 +648,10 @@ static int __test_aead(struct crypto_aead *tfm, int enc, | |||
650 | goto out; | 648 | goto out; |
651 | } | 649 | } |
652 | 650 | ||
653 | sg[k - 1].length += authsize; | ||
654 | |||
655 | if (diff_dst) | 651 | if (diff_dst) |
656 | sgout[k - 1].length += authsize; | 652 | sgout[k - 1].length += authsize; |
653 | else | ||
654 | sg[k - 1].length += authsize; | ||
657 | } | 655 | } |
658 | 656 | ||
659 | sg_init_table(asg, template[i].anp); | 657 | sg_init_table(asg, template[i].anp); |
diff --git a/drivers/acpi/acpica/acresrc.h b/drivers/acpi/acpica/acresrc.h index f691d0e4d9fa..ff97430455cb 100644 --- a/drivers/acpi/acpica/acresrc.h +++ b/drivers/acpi/acpica/acresrc.h | |||
@@ -184,7 +184,7 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, | |||
184 | struct acpi_buffer *output_buffer); | 184 | struct acpi_buffer *output_buffer); |
185 | 185 | ||
186 | acpi_status | 186 | acpi_status |
187 | acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer, | 187 | acpi_rs_create_aml_resources(struct acpi_buffer *resource_list, |
188 | struct acpi_buffer *output_buffer); | 188 | struct acpi_buffer *output_buffer); |
189 | 189 | ||
190 | acpi_status | 190 | acpi_status |
@@ -227,8 +227,8 @@ acpi_rs_get_list_length(u8 * aml_buffer, | |||
227 | u32 aml_buffer_length, acpi_size * size_needed); | 227 | u32 aml_buffer_length, acpi_size * size_needed); |
228 | 228 | ||
229 | acpi_status | 229 | acpi_status |
230 | acpi_rs_get_aml_length(struct acpi_resource *linked_list_buffer, | 230 | acpi_rs_get_aml_length(struct acpi_resource *resource_list, |
231 | acpi_size * size_needed); | 231 | acpi_size resource_list_size, acpi_size * size_needed); |
232 | 232 | ||
233 | acpi_status | 233 | acpi_status |
234 | acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, | 234 | acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, |
diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c index 243737363fb8..fd1ff54cda19 100644 --- a/drivers/acpi/acpica/nsalloc.c +++ b/drivers/acpi/acpica/nsalloc.c | |||
@@ -106,6 +106,7 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name) | |||
106 | void acpi_ns_delete_node(struct acpi_namespace_node *node) | 106 | void acpi_ns_delete_node(struct acpi_namespace_node *node) |
107 | { | 107 | { |
108 | union acpi_operand_object *obj_desc; | 108 | union acpi_operand_object *obj_desc; |
109 | union acpi_operand_object *next_desc; | ||
109 | 110 | ||
110 | ACPI_FUNCTION_NAME(ns_delete_node); | 111 | ACPI_FUNCTION_NAME(ns_delete_node); |
111 | 112 | ||
@@ -114,12 +115,13 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node) | |||
114 | acpi_ns_detach_object(node); | 115 | acpi_ns_detach_object(node); |
115 | 116 | ||
116 | /* | 117 | /* |
117 | * Delete an attached data object if present (an object that was created | 118 | * Delete an attached data object list if present (objects that were |
118 | * and attached via acpi_attach_data). Note: After any normal object is | 119 | * attached via acpi_attach_data). Note: After any normal object is |
119 | * detached above, the only possible remaining object is a data object. | 120 | * detached above, the only possible remaining object(s) are data |
121 | * objects, in a linked list. | ||
120 | */ | 122 | */ |
121 | obj_desc = node->object; | 123 | obj_desc = node->object; |
122 | if (obj_desc && (obj_desc->common.type == ACPI_TYPE_LOCAL_DATA)) { | 124 | while (obj_desc && (obj_desc->common.type == ACPI_TYPE_LOCAL_DATA)) { |
123 | 125 | ||
124 | /* Invoke the attached data deletion handler if present */ | 126 | /* Invoke the attached data deletion handler if present */ |
125 | 127 | ||
@@ -127,7 +129,15 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node) | |||
127 | obj_desc->data.handler(node, obj_desc->data.pointer); | 129 | obj_desc->data.handler(node, obj_desc->data.pointer); |
128 | } | 130 | } |
129 | 131 | ||
132 | next_desc = obj_desc->common.next_object; | ||
130 | acpi_ut_remove_reference(obj_desc); | 133 | acpi_ut_remove_reference(obj_desc); |
134 | obj_desc = next_desc; | ||
135 | } | ||
136 | |||
137 | /* Special case for the statically allocated root node */ | ||
138 | |||
139 | if (node == acpi_gbl_root_node) { | ||
140 | return; | ||
131 | } | 141 | } |
132 | 142 | ||
133 | /* Now we can delete the node */ | 143 | /* Now we can delete the node */ |
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c index cc2fea94c5f0..4a0665b6bcc1 100644 --- a/drivers/acpi/acpica/nsutils.c +++ b/drivers/acpi/acpica/nsutils.c | |||
@@ -593,24 +593,26 @@ struct acpi_namespace_node *acpi_ns_validate_handle(acpi_handle handle) | |||
593 | 593 | ||
594 | void acpi_ns_terminate(void) | 594 | void acpi_ns_terminate(void) |
595 | { | 595 | { |
596 | union acpi_operand_object *obj_desc; | 596 | acpi_status status; |
597 | 597 | ||
598 | ACPI_FUNCTION_TRACE(ns_terminate); | 598 | ACPI_FUNCTION_TRACE(ns_terminate); |
599 | 599 | ||
600 | /* | 600 | /* |
601 | * 1) Free the entire namespace -- all nodes and objects | 601 | * Free the entire namespace -- all nodes and all objects |
602 | * | 602 | * attached to the nodes |
603 | * Delete all object descriptors attached to namepsace nodes | ||
604 | */ | 603 | */ |
605 | acpi_ns_delete_namespace_subtree(acpi_gbl_root_node); | 604 | acpi_ns_delete_namespace_subtree(acpi_gbl_root_node); |
606 | 605 | ||
607 | /* Detach any objects attached to the root */ | 606 | /* Delete any objects attached to the root node */ |
608 | 607 | ||
609 | obj_desc = acpi_ns_get_attached_object(acpi_gbl_root_node); | 608 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); |
610 | if (obj_desc) { | 609 | if (ACPI_FAILURE(status)) { |
611 | acpi_ns_detach_object(acpi_gbl_root_node); | 610 | return_VOID; |
612 | } | 611 | } |
613 | 612 | ||
613 | acpi_ns_delete_node(acpi_gbl_root_node); | ||
614 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); | ||
615 | |||
614 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Namespace freed\n")); | 616 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Namespace freed\n")); |
615 | return_VOID; | 617 | return_VOID; |
616 | } | 618 | } |
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c index b62a0f4f4f9b..b60c9cf82862 100644 --- a/drivers/acpi/acpica/rscalc.c +++ b/drivers/acpi/acpica/rscalc.c | |||
@@ -174,6 +174,7 @@ acpi_rs_stream_option_length(u32 resource_length, | |||
174 | * FUNCTION: acpi_rs_get_aml_length | 174 | * FUNCTION: acpi_rs_get_aml_length |
175 | * | 175 | * |
176 | * PARAMETERS: resource - Pointer to the resource linked list | 176 | * PARAMETERS: resource - Pointer to the resource linked list |
177 | * resource_list_size - Size of the resource linked list | ||
177 | * size_needed - Where the required size is returned | 178 | * size_needed - Where the required size is returned |
178 | * | 179 | * |
179 | * RETURN: Status | 180 | * RETURN: Status |
@@ -185,16 +186,20 @@ acpi_rs_stream_option_length(u32 resource_length, | |||
185 | ******************************************************************************/ | 186 | ******************************************************************************/ |
186 | 187 | ||
187 | acpi_status | 188 | acpi_status |
188 | acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) | 189 | acpi_rs_get_aml_length(struct acpi_resource *resource, |
190 | acpi_size resource_list_size, acpi_size * size_needed) | ||
189 | { | 191 | { |
190 | acpi_size aml_size_needed = 0; | 192 | acpi_size aml_size_needed = 0; |
193 | struct acpi_resource *resource_end; | ||
191 | acpi_rs_length total_size; | 194 | acpi_rs_length total_size; |
192 | 195 | ||
193 | ACPI_FUNCTION_TRACE(rs_get_aml_length); | 196 | ACPI_FUNCTION_TRACE(rs_get_aml_length); |
194 | 197 | ||
195 | /* Traverse entire list of internal resource descriptors */ | 198 | /* Traverse entire list of internal resource descriptors */ |
196 | 199 | ||
197 | while (resource) { | 200 | resource_end = |
201 | ACPI_ADD_PTR(struct acpi_resource, resource, resource_list_size); | ||
202 | while (resource < resource_end) { | ||
198 | 203 | ||
199 | /* Validate the descriptor type */ | 204 | /* Validate the descriptor type */ |
200 | 205 | ||
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c index 65f3e1c5b598..3a2ace93e62c 100644 --- a/drivers/acpi/acpica/rscreate.c +++ b/drivers/acpi/acpica/rscreate.c | |||
@@ -418,22 +418,21 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
418 | * | 418 | * |
419 | * FUNCTION: acpi_rs_create_aml_resources | 419 | * FUNCTION: acpi_rs_create_aml_resources |
420 | * | 420 | * |
421 | * PARAMETERS: linked_list_buffer - Pointer to the resource linked list | 421 | * PARAMETERS: resource_list - Pointer to the resource list buffer |
422 | * output_buffer - Pointer to the user's buffer | 422 | * output_buffer - Where the AML buffer is returned |
423 | * | 423 | * |
424 | * RETURN: Status AE_OK if okay, else a valid acpi_status code. | 424 | * RETURN: Status AE_OK if okay, else a valid acpi_status code. |
425 | * If the output_buffer is too small, the error will be | 425 | * If the output_buffer is too small, the error will be |
426 | * AE_BUFFER_OVERFLOW and output_buffer->Length will point | 426 | * AE_BUFFER_OVERFLOW and output_buffer->Length will point |
427 | * to the size buffer needed. | 427 | * to the size buffer needed. |
428 | * | 428 | * |
429 | * DESCRIPTION: Takes the linked list of device resources and | 429 | * DESCRIPTION: Converts a list of device resources to an AML bytestream |
430 | * creates a bytestream to be used as input for the | 430 | * to be used as input for the _SRS control method. |
431 | * _SRS control method. | ||
432 | * | 431 | * |
433 | ******************************************************************************/ | 432 | ******************************************************************************/ |
434 | 433 | ||
435 | acpi_status | 434 | acpi_status |
436 | acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer, | 435 | acpi_rs_create_aml_resources(struct acpi_buffer *resource_list, |
437 | struct acpi_buffer *output_buffer) | 436 | struct acpi_buffer *output_buffer) |
438 | { | 437 | { |
439 | acpi_status status; | 438 | acpi_status status; |
@@ -441,16 +440,16 @@ acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer, | |||
441 | 440 | ||
442 | ACPI_FUNCTION_TRACE(rs_create_aml_resources); | 441 | ACPI_FUNCTION_TRACE(rs_create_aml_resources); |
443 | 442 | ||
444 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "LinkedListBuffer = %p\n", | 443 | /* Params already validated, no need to re-validate here */ |
445 | linked_list_buffer)); | ||
446 | 444 | ||
447 | /* | 445 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "ResourceList Buffer = %p\n", |
448 | * Params already validated, so we don't re-validate here | 446 | resource_list->pointer)); |
449 | * | 447 | |
450 | * Pass the linked_list_buffer into a module that calculates | 448 | /* Get the buffer size needed for the AML byte stream */ |
451 | * the buffer size needed for the byte stream. | 449 | |
452 | */ | 450 | status = acpi_rs_get_aml_length(resource_list->pointer, |
453 | status = acpi_rs_get_aml_length(linked_list_buffer, &aml_size_needed); | 451 | resource_list->length, |
452 | &aml_size_needed); | ||
454 | 453 | ||
455 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n", | 454 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n", |
456 | (u32)aml_size_needed, acpi_format_exception(status))); | 455 | (u32)aml_size_needed, acpi_format_exception(status))); |
@@ -467,10 +466,9 @@ acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer, | |||
467 | 466 | ||
468 | /* Do the conversion */ | 467 | /* Do the conversion */ |
469 | 468 | ||
470 | status = | 469 | status = acpi_rs_convert_resources_to_aml(resource_list->pointer, |
471 | acpi_rs_convert_resources_to_aml(linked_list_buffer, | 470 | aml_size_needed, |
472 | aml_size_needed, | 471 | output_buffer->pointer); |
473 | output_buffer->pointer); | ||
474 | if (ACPI_FAILURE(status)) { | 472 | if (ACPI_FAILURE(status)) { |
475 | return_ACPI_STATUS(status); | 473 | return_ACPI_STATUS(status); |
476 | } | 474 | } |
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c index aef303d56d86..14a7982c9961 100644 --- a/drivers/acpi/acpica/rsutils.c +++ b/drivers/acpi/acpica/rsutils.c | |||
@@ -753,7 +753,7 @@ acpi_rs_set_srs_method_data(struct acpi_namespace_node *node, | |||
753 | * Convert the linked list into a byte stream | 753 | * Convert the linked list into a byte stream |
754 | */ | 754 | */ |
755 | buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; | 755 | buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; |
756 | status = acpi_rs_create_aml_resources(in_buffer->pointer, &buffer); | 756 | status = acpi_rs_create_aml_resources(in_buffer, &buffer); |
757 | if (ACPI_FAILURE(status)) { | 757 | if (ACPI_FAILURE(status)) { |
758 | goto cleanup; | 758 | goto cleanup; |
759 | } | 759 | } |
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c index 1a67b3944b3b..03ae8affe48f 100644 --- a/drivers/acpi/acpica/utdebug.c +++ b/drivers/acpi/acpica/utdebug.c | |||
@@ -185,6 +185,7 @@ acpi_debug_print(u32 requested_debug_level, | |||
185 | } | 185 | } |
186 | 186 | ||
187 | acpi_gbl_prev_thread_id = thread_id; | 187 | acpi_gbl_prev_thread_id = thread_id; |
188 | acpi_gbl_nesting_level = 0; | ||
188 | } | 189 | } |
189 | 190 | ||
190 | /* | 191 | /* |
@@ -193,13 +194,21 @@ acpi_debug_print(u32 requested_debug_level, | |||
193 | */ | 194 | */ |
194 | acpi_os_printf("%9s-%04ld ", module_name, line_number); | 195 | acpi_os_printf("%9s-%04ld ", module_name, line_number); |
195 | 196 | ||
197 | #ifdef ACPI_EXEC_APP | ||
198 | /* | ||
199 | * For acpi_exec only, emit the thread ID and nesting level. | ||
200 | * Note: nesting level is really only useful during a single-thread | ||
201 | * execution. Otherwise, multiple threads will keep resetting the | ||
202 | * level. | ||
203 | */ | ||
196 | if (ACPI_LV_THREADS & acpi_dbg_level) { | 204 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
197 | acpi_os_printf("[%u] ", (u32)thread_id); | 205 | acpi_os_printf("[%u] ", (u32)thread_id); |
198 | } | 206 | } |
199 | 207 | ||
200 | acpi_os_printf("[%02ld] %-22.22s: ", | 208 | acpi_os_printf("[%02ld] ", acpi_gbl_nesting_level); |
201 | acpi_gbl_nesting_level, | 209 | #endif |
202 | acpi_ut_trim_function_name(function_name)); | 210 | |
211 | acpi_os_printf("%-22.22s: ", acpi_ut_trim_function_name(function_name)); | ||
203 | 212 | ||
204 | va_start(args, format); | 213 | va_start(args, format); |
205 | acpi_os_vprintf(format, args); | 214 | acpi_os_vprintf(format, args); |
@@ -420,7 +429,9 @@ acpi_ut_exit(u32 line_number, | |||
420 | component_id, "%s\n", acpi_gbl_fn_exit_str); | 429 | component_id, "%s\n", acpi_gbl_fn_exit_str); |
421 | } | 430 | } |
422 | 431 | ||
423 | acpi_gbl_nesting_level--; | 432 | if (acpi_gbl_nesting_level) { |
433 | acpi_gbl_nesting_level--; | ||
434 | } | ||
424 | } | 435 | } |
425 | 436 | ||
426 | ACPI_EXPORT_SYMBOL(acpi_ut_exit) | 437 | ACPI_EXPORT_SYMBOL(acpi_ut_exit) |
@@ -467,7 +478,9 @@ acpi_ut_status_exit(u32 line_number, | |||
467 | } | 478 | } |
468 | } | 479 | } |
469 | 480 | ||
470 | acpi_gbl_nesting_level--; | 481 | if (acpi_gbl_nesting_level) { |
482 | acpi_gbl_nesting_level--; | ||
483 | } | ||
471 | } | 484 | } |
472 | 485 | ||
473 | ACPI_EXPORT_SYMBOL(acpi_ut_status_exit) | 486 | ACPI_EXPORT_SYMBOL(acpi_ut_status_exit) |
@@ -504,7 +517,9 @@ acpi_ut_value_exit(u32 line_number, | |||
504 | ACPI_FORMAT_UINT64(value)); | 517 | ACPI_FORMAT_UINT64(value)); |
505 | } | 518 | } |
506 | 519 | ||
507 | acpi_gbl_nesting_level--; | 520 | if (acpi_gbl_nesting_level) { |
521 | acpi_gbl_nesting_level--; | ||
522 | } | ||
508 | } | 523 | } |
509 | 524 | ||
510 | ACPI_EXPORT_SYMBOL(acpi_ut_value_exit) | 525 | ACPI_EXPORT_SYMBOL(acpi_ut_value_exit) |
@@ -540,7 +555,9 @@ acpi_ut_ptr_exit(u32 line_number, | |||
540 | ptr); | 555 | ptr); |
541 | } | 556 | } |
542 | 557 | ||
543 | acpi_gbl_nesting_level--; | 558 | if (acpi_gbl_nesting_level) { |
559 | acpi_gbl_nesting_level--; | ||
560 | } | ||
544 | } | 561 | } |
545 | 562 | ||
546 | #endif | 563 | #endif |
diff --git a/drivers/acpi/nvs.c b/drivers/acpi/nvs.c index 266bc58ce0ce..386a9fe497b4 100644 --- a/drivers/acpi/nvs.c +++ b/drivers/acpi/nvs.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/acpi.h> | 14 | #include <linux/acpi.h> |
15 | #include <linux/acpi_io.h> | 15 | #include <linux/acpi_io.h> |
16 | #include <acpi/acpiosxf.h> | ||
17 | 16 | ||
18 | /* ACPI NVS regions, APEI may use it */ | 17 | /* ACPI NVS regions, APEI may use it */ |
19 | 18 | ||
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 0703bff5e60e..20360e480bd8 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -65,6 +65,9 @@ static struct acpi_scan_handler pci_root_handler = { | |||
65 | .ids = root_device_ids, | 65 | .ids = root_device_ids, |
66 | .attach = acpi_pci_root_add, | 66 | .attach = acpi_pci_root_add, |
67 | .detach = acpi_pci_root_remove, | 67 | .detach = acpi_pci_root_remove, |
68 | .hotplug = { | ||
69 | .ignore = true, | ||
70 | }, | ||
68 | }; | 71 | }; |
69 | 72 | ||
70 | static DEFINE_MUTEX(osc_lock); | 73 | static DEFINE_MUTEX(osc_lock); |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 15daa21fcd05..fd39459926b1 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -1772,7 +1772,7 @@ static void acpi_scan_init_hotplug(acpi_handle handle, int type) | |||
1772 | */ | 1772 | */ |
1773 | list_for_each_entry(hwid, &pnp.ids, list) { | 1773 | list_for_each_entry(hwid, &pnp.ids, list) { |
1774 | handler = acpi_scan_match_handler(hwid->id, NULL); | 1774 | handler = acpi_scan_match_handler(hwid->id, NULL); |
1775 | if (handler) { | 1775 | if (handler && !handler->hotplug.ignore) { |
1776 | acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, | 1776 | acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, |
1777 | acpi_hotplug_notify_cb, handler); | 1777 | acpi_hotplug_notify_cb, handler); |
1778 | break; | 1778 | break; |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 14df30580e15..721e949e606e 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -525,7 +525,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) | |||
525 | * generate wakeup events. | 525 | * generate wakeup events. |
526 | */ | 526 | */ |
527 | if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3)) { | 527 | if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3)) { |
528 | acpi_event_status pwr_btn_status; | 528 | acpi_event_status pwr_btn_status = ACPI_EVENT_FLAG_DISABLED; |
529 | 529 | ||
530 | acpi_get_event_status(ACPI_EVENT_POWER_BUTTON, &pwr_btn_status); | 530 | acpi_get_event_status(ACPI_EVENT_POWER_BUTTON, &pwr_btn_status); |
531 | 531 | ||
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index db5293650f62..6dbc3ca45223 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c | |||
@@ -309,7 +309,7 @@ static void acpi_table_attr_init(struct acpi_table_attr *table_attr, | |||
309 | sprintf(table_attr->name + ACPI_NAME_SIZE, "%d", | 309 | sprintf(table_attr->name + ACPI_NAME_SIZE, "%d", |
310 | table_attr->instance); | 310 | table_attr->instance); |
311 | 311 | ||
312 | table_attr->attr.size = 0; | 312 | table_attr->attr.size = table_header->length; |
313 | table_attr->attr.read = acpi_table_show; | 313 | table_attr->attr.read = acpi_table_show; |
314 | table_attr->attr.attr.name = table_attr->name; | 314 | table_attr->attr.attr.name = table_attr->name; |
315 | table_attr->attr.attr.mode = 0400; | 315 | table_attr->attr.attr.mode = 0400; |
@@ -354,8 +354,9 @@ static int acpi_tables_sysfs_init(void) | |||
354 | { | 354 | { |
355 | struct acpi_table_attr *table_attr; | 355 | struct acpi_table_attr *table_attr; |
356 | struct acpi_table_header *table_header = NULL; | 356 | struct acpi_table_header *table_header = NULL; |
357 | int table_index = 0; | 357 | int table_index; |
358 | int result; | 358 | acpi_status status; |
359 | int ret; | ||
359 | 360 | ||
360 | tables_kobj = kobject_create_and_add("tables", acpi_kobj); | 361 | tables_kobj = kobject_create_and_add("tables", acpi_kobj); |
361 | if (!tables_kobj) | 362 | if (!tables_kobj) |
@@ -365,33 +366,34 @@ static int acpi_tables_sysfs_init(void) | |||
365 | if (!dynamic_tables_kobj) | 366 | if (!dynamic_tables_kobj) |
366 | goto err_dynamic_tables; | 367 | goto err_dynamic_tables; |
367 | 368 | ||
368 | do { | 369 | for (table_index = 0;; table_index++) { |
369 | result = acpi_get_table_by_index(table_index, &table_header); | 370 | status = acpi_get_table_by_index(table_index, &table_header); |
370 | if (!result) { | 371 | |
371 | table_index++; | 372 | if (status == AE_BAD_PARAMETER) |
372 | table_attr = NULL; | 373 | break; |
373 | table_attr = | 374 | |
374 | kzalloc(sizeof(struct acpi_table_attr), GFP_KERNEL); | 375 | if (ACPI_FAILURE(status)) |
375 | if (!table_attr) | 376 | continue; |
376 | return -ENOMEM; | 377 | |
377 | 378 | table_attr = NULL; | |
378 | acpi_table_attr_init(table_attr, table_header); | 379 | table_attr = kzalloc(sizeof(*table_attr), GFP_KERNEL); |
379 | result = | 380 | if (!table_attr) |
380 | sysfs_create_bin_file(tables_kobj, | 381 | return -ENOMEM; |
381 | &table_attr->attr); | 382 | |
382 | if (result) { | 383 | acpi_table_attr_init(table_attr, table_header); |
383 | kfree(table_attr); | 384 | ret = sysfs_create_bin_file(tables_kobj, &table_attr->attr); |
384 | return result; | 385 | if (ret) { |
385 | } else | 386 | kfree(table_attr); |
386 | list_add_tail(&table_attr->node, | 387 | return ret; |
387 | &acpi_table_attr_list); | ||
388 | } | 388 | } |
389 | } while (!result); | 389 | list_add_tail(&table_attr->node, &acpi_table_attr_list); |
390 | } | ||
391 | |||
390 | kobject_uevent(tables_kobj, KOBJ_ADD); | 392 | kobject_uevent(tables_kobj, KOBJ_ADD); |
391 | kobject_uevent(dynamic_tables_kobj, KOBJ_ADD); | 393 | kobject_uevent(dynamic_tables_kobj, KOBJ_ADD); |
392 | result = acpi_install_table_handler(acpi_sysfs_table_handler, NULL); | 394 | status = acpi_install_table_handler(acpi_sysfs_table_handler, NULL); |
393 | 395 | ||
394 | return result == AE_OK ? 0 : -EINVAL; | 396 | return ACPI_FAILURE(status) ? -EINVAL : 0; |
395 | err_dynamic_tables: | 397 | err_dynamic_tables: |
396 | kobject_put(tables_kobj); | 398 | kobject_put(tables_kobj); |
397 | err: | 399 | err: |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index e2903d03180e..14f1e9506338 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -435,6 +435,8 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
435 | .driver_data = board_ahci_yes_fbs }, /* 88se9172 on some Gigabyte */ | 435 | .driver_data = board_ahci_yes_fbs }, /* 88se9172 on some Gigabyte */ |
436 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x91a3), | 436 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x91a3), |
437 | .driver_data = board_ahci_yes_fbs }, | 437 | .driver_data = board_ahci_yes_fbs }, |
438 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9230), | ||
439 | .driver_data = board_ahci_yes_fbs }, | ||
438 | 440 | ||
439 | /* Promise */ | 441 | /* Promise */ |
440 | { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ | 442 | { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ |
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index f9554318504f..4b231baceb09 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c | |||
@@ -329,6 +329,7 @@ static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_suspend, ahci_resume); | |||
329 | static const struct of_device_id ahci_of_match[] = { | 329 | static const struct of_device_id ahci_of_match[] = { |
330 | { .compatible = "snps,spear-ahci", }, | 330 | { .compatible = "snps,spear-ahci", }, |
331 | { .compatible = "snps,exynos5440-ahci", }, | 331 | { .compatible = "snps,exynos5440-ahci", }, |
332 | { .compatible = "ibm,476gtr-ahci", }, | ||
332 | {}, | 333 | {}, |
333 | }; | 334 | }; |
334 | MODULE_DEVICE_TABLE(of, ahci_of_match); | 335 | MODULE_DEVICE_TABLE(of, ahci_of_match); |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 81a94a3919db..75b93678bbcd 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -6304,10 +6304,9 @@ static void ata_port_detach(struct ata_port *ap) | |||
6304 | for (i = 0; i < SATA_PMP_MAX_PORTS; i++) | 6304 | for (i = 0; i < SATA_PMP_MAX_PORTS; i++) |
6305 | ata_tlink_delete(&ap->pmp_link[i]); | 6305 | ata_tlink_delete(&ap->pmp_link[i]); |
6306 | } | 6306 | } |
6307 | ata_tport_delete(ap); | ||
6308 | |||
6309 | /* remove the associated SCSI host */ | 6307 | /* remove the associated SCSI host */ |
6310 | scsi_remove_host(ap->scsi_host); | 6308 | scsi_remove_host(ap->scsi_host); |
6309 | ata_tport_delete(ap); | ||
6311 | } | 6310 | } |
6312 | 6311 | ||
6313 | /** | 6312 | /** |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index db6dfcfa3e2e..ab58556d347c 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -3625,6 +3625,7 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht) | |||
3625 | shost->max_lun = 1; | 3625 | shost->max_lun = 1; |
3626 | shost->max_channel = 1; | 3626 | shost->max_channel = 1; |
3627 | shost->max_cmd_len = 16; | 3627 | shost->max_cmd_len = 16; |
3628 | shost->no_write_same = 1; | ||
3628 | 3629 | ||
3629 | /* Schedule policy is determined by ->qc_defer() | 3630 | /* Schedule policy is determined by ->qc_defer() |
3630 | * callback and it needs to see every deferred qc. | 3631 | * callback and it needs to see every deferred qc. |
diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c index 68f9e3293e9c..88949c6d55dd 100644 --- a/drivers/ata/libata-zpodd.c +++ b/drivers/ata/libata-zpodd.c | |||
@@ -88,15 +88,13 @@ static enum odd_mech_type zpodd_get_mech_type(struct ata_device *dev) | |||
88 | static bool odd_can_poweroff(struct ata_device *ata_dev) | 88 | static bool odd_can_poweroff(struct ata_device *ata_dev) |
89 | { | 89 | { |
90 | acpi_handle handle; | 90 | acpi_handle handle; |
91 | acpi_status status; | ||
92 | struct acpi_device *acpi_dev; | 91 | struct acpi_device *acpi_dev; |
93 | 92 | ||
94 | handle = ata_dev_acpi_handle(ata_dev); | 93 | handle = ata_dev_acpi_handle(ata_dev); |
95 | if (!handle) | 94 | if (!handle) |
96 | return false; | 95 | return false; |
97 | 96 | ||
98 | status = acpi_bus_get_device(handle, &acpi_dev); | 97 | if (acpi_bus_get_device(handle, &acpi_dev)) |
99 | if (ACPI_FAILURE(status)) | ||
100 | return false; | 98 | return false; |
101 | 99 | ||
102 | return acpi_device_can_poweroff(acpi_dev); | 100 | return acpi_device_can_poweroff(acpi_dev); |
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c index e88690ebfd82..73492dd4a4bc 100644 --- a/drivers/ata/pata_arasan_cf.c +++ b/drivers/ata/pata_arasan_cf.c | |||
@@ -319,6 +319,7 @@ static int cf_init(struct arasan_cf_dev *acdev) | |||
319 | ret = clk_set_rate(acdev->clk, 166000000); | 319 | ret = clk_set_rate(acdev->clk, 166000000); |
320 | if (ret) { | 320 | if (ret) { |
321 | dev_warn(acdev->host->dev, "clock set rate failed"); | 321 | dev_warn(acdev->host->dev, "clock set rate failed"); |
322 | clk_disable_unprepare(acdev->clk); | ||
322 | return ret; | 323 | return ret; |
323 | } | 324 | } |
324 | 325 | ||
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 1b41fca3d65a..e3219dfd736c 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/async.h> | 29 | #include <linux/async.h> |
30 | #include <linux/suspend.h> | 30 | #include <linux/suspend.h> |
31 | #include <trace/events/power.h> | 31 | #include <trace/events/power.h> |
32 | #include <linux/cpufreq.h> | ||
32 | #include <linux/cpuidle.h> | 33 | #include <linux/cpuidle.h> |
33 | #include <linux/timer.h> | 34 | #include <linux/timer.h> |
34 | 35 | ||
@@ -540,6 +541,7 @@ static void dpm_resume_noirq(pm_message_t state) | |||
540 | dpm_show_time(starttime, state, "noirq"); | 541 | dpm_show_time(starttime, state, "noirq"); |
541 | resume_device_irqs(); | 542 | resume_device_irqs(); |
542 | cpuidle_resume(); | 543 | cpuidle_resume(); |
544 | cpufreq_resume(); | ||
543 | } | 545 | } |
544 | 546 | ||
545 | /** | 547 | /** |
@@ -955,6 +957,7 @@ static int dpm_suspend_noirq(pm_message_t state) | |||
955 | ktime_t starttime = ktime_get(); | 957 | ktime_t starttime = ktime_get(); |
956 | int error = 0; | 958 | int error = 0; |
957 | 959 | ||
960 | cpufreq_suspend(); | ||
958 | cpuidle_pause(); | 961 | cpuidle_pause(); |
959 | suspend_device_irqs(); | 962 | suspend_device_irqs(); |
960 | mutex_lock(&dpm_list_mtx); | 963 | mutex_lock(&dpm_list_mtx); |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 432db1b59b00..c4a4c9006288 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -489,7 +489,7 @@ static int blkif_queue_request(struct request *req) | |||
489 | 489 | ||
490 | if ((ring_req->operation == BLKIF_OP_INDIRECT) && | 490 | if ((ring_req->operation == BLKIF_OP_INDIRECT) && |
491 | (i % SEGS_PER_INDIRECT_FRAME == 0)) { | 491 | (i % SEGS_PER_INDIRECT_FRAME == 0)) { |
492 | unsigned long pfn; | 492 | unsigned long uninitialized_var(pfn); |
493 | 493 | ||
494 | if (segments) | 494 | if (segments) |
495 | kunmap_atomic(segments); | 495 | kunmap_atomic(segments); |
@@ -2011,6 +2011,10 @@ static void blkif_release(struct gendisk *disk, fmode_t mode) | |||
2011 | 2011 | ||
2012 | bdev = bdget_disk(disk, 0); | 2012 | bdev = bdget_disk(disk, 0); |
2013 | 2013 | ||
2014 | if (!bdev) { | ||
2015 | WARN(1, "Block device %s yanked out from us!\n", disk->disk_name); | ||
2016 | goto out_mutex; | ||
2017 | } | ||
2014 | if (bdev->bd_openers) | 2018 | if (bdev->bd_openers) |
2015 | goto out; | 2019 | goto out; |
2016 | 2020 | ||
@@ -2041,6 +2045,7 @@ static void blkif_release(struct gendisk *disk, fmode_t mode) | |||
2041 | 2045 | ||
2042 | out: | 2046 | out: |
2043 | bdput(bdev); | 2047 | bdput(bdev); |
2048 | out_mutex: | ||
2044 | mutex_unlock(&blkfront_mutex); | 2049 | mutex_unlock(&blkfront_mutex); |
2045 | } | 2050 | } |
2046 | 2051 | ||
diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index c206de2951f2..2f2b08457c67 100644 --- a/drivers/char/hw_random/Kconfig +++ b/drivers/char/hw_random/Kconfig | |||
@@ -165,6 +165,19 @@ config HW_RANDOM_OMAP | |||
165 | 165 | ||
166 | If unsure, say Y. | 166 | If unsure, say Y. |
167 | 167 | ||
168 | config HW_RANDOM_OMAP3_ROM | ||
169 | tristate "OMAP3 ROM Random Number Generator support" | ||
170 | depends on HW_RANDOM && ARCH_OMAP3 | ||
171 | default HW_RANDOM | ||
172 | ---help--- | ||
173 | This driver provides kernel-side support for the Random Number | ||
174 | Generator hardware found on OMAP34xx processors. | ||
175 | |||
176 | To compile this driver as a module, choose M here: the | ||
177 | module will be called omap3-rom-rng. | ||
178 | |||
179 | If unsure, say Y. | ||
180 | |||
168 | config HW_RANDOM_OCTEON | 181 | config HW_RANDOM_OCTEON |
169 | tristate "Octeon Random Number Generator support" | 182 | tristate "Octeon Random Number Generator support" |
170 | depends on HW_RANDOM && CAVIUM_OCTEON_SOC | 183 | depends on HW_RANDOM && CAVIUM_OCTEON_SOC |
@@ -327,3 +340,15 @@ config HW_RANDOM_TPM | |||
327 | module will be called tpm-rng. | 340 | module will be called tpm-rng. |
328 | 341 | ||
329 | If unsure, say Y. | 342 | If unsure, say Y. |
343 | |||
344 | config HW_RANDOM_MSM | ||
345 | tristate "Qualcomm MSM Random Number Generator support" | ||
346 | depends on HW_RANDOM && ARCH_MSM | ||
347 | ---help--- | ||
348 | This driver provides kernel-side support for the Random Number | ||
349 | Generator hardware found on Qualcomm MSM SoCs. | ||
350 | |||
351 | To compile this driver as a module, choose M here. the | ||
352 | module will be called msm-rng. | ||
353 | |||
354 | If unsure, say Y. | ||
diff --git a/drivers/char/hw_random/Makefile b/drivers/char/hw_random/Makefile index d7d2435ff7fa..3ae7755a52e7 100644 --- a/drivers/char/hw_random/Makefile +++ b/drivers/char/hw_random/Makefile | |||
@@ -15,6 +15,7 @@ n2-rng-y := n2-drv.o n2-asm.o | |||
15 | obj-$(CONFIG_HW_RANDOM_VIA) += via-rng.o | 15 | obj-$(CONFIG_HW_RANDOM_VIA) += via-rng.o |
16 | obj-$(CONFIG_HW_RANDOM_IXP4XX) += ixp4xx-rng.o | 16 | obj-$(CONFIG_HW_RANDOM_IXP4XX) += ixp4xx-rng.o |
17 | obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o | 17 | obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o |
18 | obj-$(CONFIG_HW_RANDOM_OMAP3_ROM) += omap3-rom-rng.o | ||
18 | obj-$(CONFIG_HW_RANDOM_PASEMI) += pasemi-rng.o | 19 | obj-$(CONFIG_HW_RANDOM_PASEMI) += pasemi-rng.o |
19 | obj-$(CONFIG_HW_RANDOM_VIRTIO) += virtio-rng.o | 20 | obj-$(CONFIG_HW_RANDOM_VIRTIO) += virtio-rng.o |
20 | obj-$(CONFIG_HW_RANDOM_TX4939) += tx4939-rng.o | 21 | obj-$(CONFIG_HW_RANDOM_TX4939) += tx4939-rng.o |
@@ -28,3 +29,4 @@ obj-$(CONFIG_HW_RANDOM_POWERNV) += powernv-rng.o | |||
28 | obj-$(CONFIG_HW_RANDOM_EXYNOS) += exynos-rng.o | 29 | obj-$(CONFIG_HW_RANDOM_EXYNOS) += exynos-rng.o |
29 | obj-$(CONFIG_HW_RANDOM_TPM) += tpm-rng.o | 30 | obj-$(CONFIG_HW_RANDOM_TPM) += tpm-rng.o |
30 | obj-$(CONFIG_HW_RANDOM_BCM2835) += bcm2835-rng.o | 31 | obj-$(CONFIG_HW_RANDOM_BCM2835) += bcm2835-rng.o |
32 | obj-$(CONFIG_HW_RANDOM_MSM) += msm-rng.o | ||
diff --git a/drivers/char/hw_random/msm-rng.c b/drivers/char/hw_random/msm-rng.c new file mode 100644 index 000000000000..148521e51dc6 --- /dev/null +++ b/drivers/char/hw_random/msm-rng.c | |||
@@ -0,0 +1,197 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 and | ||
6 | * only version 2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | */ | ||
14 | #include <linux/clk.h> | ||
15 | #include <linux/err.h> | ||
16 | #include <linux/hw_random.h> | ||
17 | #include <linux/io.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/of.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | |||
22 | /* Device specific register offsets */ | ||
23 | #define PRNG_DATA_OUT 0x0000 | ||
24 | #define PRNG_STATUS 0x0004 | ||
25 | #define PRNG_LFSR_CFG 0x0100 | ||
26 | #define PRNG_CONFIG 0x0104 | ||
27 | |||
28 | /* Device specific register masks and config values */ | ||
29 | #define PRNG_LFSR_CFG_MASK 0x0000ffff | ||
30 | #define PRNG_LFSR_CFG_CLOCKS 0x0000dddd | ||
31 | #define PRNG_CONFIG_HW_ENABLE BIT(1) | ||
32 | #define PRNG_STATUS_DATA_AVAIL BIT(0) | ||
33 | |||
34 | #define MAX_HW_FIFO_DEPTH 16 | ||
35 | #define MAX_HW_FIFO_SIZE (MAX_HW_FIFO_DEPTH * 4) | ||
36 | #define WORD_SZ 4 | ||
37 | |||
38 | struct msm_rng { | ||
39 | void __iomem *base; | ||
40 | struct clk *clk; | ||
41 | struct hwrng hwrng; | ||
42 | }; | ||
43 | |||
44 | #define to_msm_rng(p) container_of(p, struct msm_rng, hwrng) | ||
45 | |||
46 | static int msm_rng_enable(struct hwrng *hwrng, int enable) | ||
47 | { | ||
48 | struct msm_rng *rng = to_msm_rng(hwrng); | ||
49 | u32 val; | ||
50 | int ret; | ||
51 | |||
52 | ret = clk_prepare_enable(rng->clk); | ||
53 | if (ret) | ||
54 | return ret; | ||
55 | |||
56 | if (enable) { | ||
57 | /* Enable PRNG only if it is not already enabled */ | ||
58 | val = readl_relaxed(rng->base + PRNG_CONFIG); | ||
59 | if (val & PRNG_CONFIG_HW_ENABLE) | ||
60 | goto already_enabled; | ||
61 | |||
62 | val = readl_relaxed(rng->base + PRNG_LFSR_CFG); | ||
63 | val &= ~PRNG_LFSR_CFG_MASK; | ||
64 | val |= PRNG_LFSR_CFG_CLOCKS; | ||
65 | writel(val, rng->base + PRNG_LFSR_CFG); | ||
66 | |||
67 | val = readl_relaxed(rng->base + PRNG_CONFIG); | ||
68 | val |= PRNG_CONFIG_HW_ENABLE; | ||
69 | writel(val, rng->base + PRNG_CONFIG); | ||
70 | } else { | ||
71 | val = readl_relaxed(rng->base + PRNG_CONFIG); | ||
72 | val &= ~PRNG_CONFIG_HW_ENABLE; | ||
73 | writel(val, rng->base + PRNG_CONFIG); | ||
74 | } | ||
75 | |||
76 | already_enabled: | ||
77 | clk_disable_unprepare(rng->clk); | ||
78 | return 0; | ||
79 | } | ||
80 | |||
81 | static int msm_rng_read(struct hwrng *hwrng, void *data, size_t max, bool wait) | ||
82 | { | ||
83 | struct msm_rng *rng = to_msm_rng(hwrng); | ||
84 | size_t currsize = 0; | ||
85 | u32 *retdata = data; | ||
86 | size_t maxsize; | ||
87 | int ret; | ||
88 | u32 val; | ||
89 | |||
90 | /* calculate max size bytes to transfer back to caller */ | ||
91 | maxsize = min_t(size_t, MAX_HW_FIFO_SIZE, max); | ||
92 | |||
93 | /* no room for word data */ | ||
94 | if (maxsize < WORD_SZ) | ||
95 | return 0; | ||
96 | |||
97 | ret = clk_prepare_enable(rng->clk); | ||
98 | if (ret) | ||
99 | return ret; | ||
100 | |||
101 | /* read random data from hardware */ | ||
102 | do { | ||
103 | val = readl_relaxed(rng->base + PRNG_STATUS); | ||
104 | if (!(val & PRNG_STATUS_DATA_AVAIL)) | ||
105 | break; | ||
106 | |||
107 | val = readl_relaxed(rng->base + PRNG_DATA_OUT); | ||
108 | if (!val) | ||
109 | break; | ||
110 | |||
111 | *retdata++ = val; | ||
112 | currsize += WORD_SZ; | ||
113 | |||
114 | /* make sure we stay on 32bit boundary */ | ||
115 | if ((maxsize - currsize) < WORD_SZ) | ||
116 | break; | ||
117 | } while (currsize < maxsize); | ||
118 | |||
119 | clk_disable_unprepare(rng->clk); | ||
120 | |||
121 | return currsize; | ||
122 | } | ||
123 | |||
124 | static int msm_rng_init(struct hwrng *hwrng) | ||
125 | { | ||
126 | return msm_rng_enable(hwrng, 1); | ||
127 | } | ||
128 | |||
129 | static void msm_rng_cleanup(struct hwrng *hwrng) | ||
130 | { | ||
131 | msm_rng_enable(hwrng, 0); | ||
132 | } | ||
133 | |||
134 | static int msm_rng_probe(struct platform_device *pdev) | ||
135 | { | ||
136 | struct resource *res; | ||
137 | struct msm_rng *rng; | ||
138 | int ret; | ||
139 | |||
140 | rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); | ||
141 | if (!rng) | ||
142 | return -ENOMEM; | ||
143 | |||
144 | platform_set_drvdata(pdev, rng); | ||
145 | |||
146 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
147 | rng->base = devm_ioremap_resource(&pdev->dev, res); | ||
148 | if (IS_ERR(rng->base)) | ||
149 | return PTR_ERR(rng->base); | ||
150 | |||
151 | rng->clk = devm_clk_get(&pdev->dev, "core"); | ||
152 | if (IS_ERR(rng->clk)) | ||
153 | return PTR_ERR(rng->clk); | ||
154 | |||
155 | rng->hwrng.name = KBUILD_MODNAME, | ||
156 | rng->hwrng.init = msm_rng_init, | ||
157 | rng->hwrng.cleanup = msm_rng_cleanup, | ||
158 | rng->hwrng.read = msm_rng_read, | ||
159 | |||
160 | ret = hwrng_register(&rng->hwrng); | ||
161 | if (ret) { | ||
162 | dev_err(&pdev->dev, "failed to register hwrng\n"); | ||
163 | return ret; | ||
164 | } | ||
165 | |||
166 | return 0; | ||
167 | } | ||
168 | |||
169 | static int msm_rng_remove(struct platform_device *pdev) | ||
170 | { | ||
171 | struct msm_rng *rng = platform_get_drvdata(pdev); | ||
172 | |||
173 | hwrng_unregister(&rng->hwrng); | ||
174 | return 0; | ||
175 | } | ||
176 | |||
177 | static const struct of_device_id msm_rng_of_match[] = { | ||
178 | { .compatible = "qcom,prng", }, | ||
179 | {} | ||
180 | }; | ||
181 | MODULE_DEVICE_TABLE(of, msm_rng_of_match); | ||
182 | |||
183 | static struct platform_driver msm_rng_driver = { | ||
184 | .probe = msm_rng_probe, | ||
185 | .remove = msm_rng_remove, | ||
186 | .driver = { | ||
187 | .name = KBUILD_MODNAME, | ||
188 | .owner = THIS_MODULE, | ||
189 | .of_match_table = of_match_ptr(msm_rng_of_match), | ||
190 | } | ||
191 | }; | ||
192 | module_platform_driver(msm_rng_driver); | ||
193 | |||
194 | MODULE_ALIAS("platform:" KBUILD_MODNAME); | ||
195 | MODULE_AUTHOR("The Linux Foundation"); | ||
196 | MODULE_DESCRIPTION("Qualcomm MSM random number generator driver"); | ||
197 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/char/hw_random/omap3-rom-rng.c b/drivers/char/hw_random/omap3-rom-rng.c new file mode 100644 index 000000000000..c853e9e68573 --- /dev/null +++ b/drivers/char/hw_random/omap3-rom-rng.c | |||
@@ -0,0 +1,141 @@ | |||
1 | /* | ||
2 | * omap3-rom-rng.c - RNG driver for TI OMAP3 CPU family | ||
3 | * | ||
4 | * Copyright (C) 2009 Nokia Corporation | ||
5 | * Author: Juha Yrjola <juha.yrjola@solidboot.com> | ||
6 | * | ||
7 | * Copyright (C) 2013 Pali Rohár <pali.rohar@gmail.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
15 | |||
16 | #include <linux/module.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/random.h> | ||
19 | #include <linux/hw_random.h> | ||
20 | #include <linux/timer.h> | ||
21 | #include <linux/clk.h> | ||
22 | #include <linux/err.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | |||
25 | #define RNG_RESET 0x01 | ||
26 | #define RNG_GEN_PRNG_HW_INIT 0x02 | ||
27 | #define RNG_GEN_HW 0x08 | ||
28 | |||
29 | /* param1: ptr, param2: count, param3: flag */ | ||
30 | static u32 (*omap3_rom_rng_call)(u32, u32, u32); | ||
31 | |||
32 | static struct timer_list idle_timer; | ||
33 | static int rng_idle; | ||
34 | static struct clk *rng_clk; | ||
35 | |||
36 | static void omap3_rom_rng_idle(unsigned long data) | ||
37 | { | ||
38 | int r; | ||
39 | |||
40 | r = omap3_rom_rng_call(0, 0, RNG_RESET); | ||
41 | if (r != 0) { | ||
42 | pr_err("reset failed: %d\n", r); | ||
43 | return; | ||
44 | } | ||
45 | clk_disable_unprepare(rng_clk); | ||
46 | rng_idle = 1; | ||
47 | } | ||
48 | |||
49 | static int omap3_rom_rng_get_random(void *buf, unsigned int count) | ||
50 | { | ||
51 | u32 r; | ||
52 | u32 ptr; | ||
53 | |||
54 | del_timer_sync(&idle_timer); | ||
55 | if (rng_idle) { | ||
56 | clk_prepare_enable(rng_clk); | ||
57 | r = omap3_rom_rng_call(0, 0, RNG_GEN_PRNG_HW_INIT); | ||
58 | if (r != 0) { | ||
59 | clk_disable_unprepare(rng_clk); | ||
60 | pr_err("HW init failed: %d\n", r); | ||
61 | return -EIO; | ||
62 | } | ||
63 | rng_idle = 0; | ||
64 | } | ||
65 | |||
66 | ptr = virt_to_phys(buf); | ||
67 | r = omap3_rom_rng_call(ptr, count, RNG_GEN_HW); | ||
68 | mod_timer(&idle_timer, jiffies + msecs_to_jiffies(500)); | ||
69 | if (r != 0) | ||
70 | return -EINVAL; | ||
71 | return 0; | ||
72 | } | ||
73 | |||
74 | static int omap3_rom_rng_data_present(struct hwrng *rng, int wait) | ||
75 | { | ||
76 | return 1; | ||
77 | } | ||
78 | |||
79 | static int omap3_rom_rng_data_read(struct hwrng *rng, u32 *data) | ||
80 | { | ||
81 | int r; | ||
82 | |||
83 | r = omap3_rom_rng_get_random(data, 4); | ||
84 | if (r < 0) | ||
85 | return r; | ||
86 | return 4; | ||
87 | } | ||
88 | |||
89 | static struct hwrng omap3_rom_rng_ops = { | ||
90 | .name = "omap3-rom", | ||
91 | .data_present = omap3_rom_rng_data_present, | ||
92 | .data_read = omap3_rom_rng_data_read, | ||
93 | }; | ||
94 | |||
95 | static int omap3_rom_rng_probe(struct platform_device *pdev) | ||
96 | { | ||
97 | pr_info("initializing\n"); | ||
98 | |||
99 | omap3_rom_rng_call = pdev->dev.platform_data; | ||
100 | if (!omap3_rom_rng_call) { | ||
101 | pr_err("omap3_rom_rng_call is NULL\n"); | ||
102 | return -EINVAL; | ||
103 | } | ||
104 | |||
105 | setup_timer(&idle_timer, omap3_rom_rng_idle, 0); | ||
106 | rng_clk = clk_get(&pdev->dev, "ick"); | ||
107 | if (IS_ERR(rng_clk)) { | ||
108 | pr_err("unable to get RNG clock\n"); | ||
109 | return PTR_ERR(rng_clk); | ||
110 | } | ||
111 | |||
112 | /* Leave the RNG in reset state. */ | ||
113 | clk_prepare_enable(rng_clk); | ||
114 | omap3_rom_rng_idle(0); | ||
115 | |||
116 | return hwrng_register(&omap3_rom_rng_ops); | ||
117 | } | ||
118 | |||
119 | static int omap3_rom_rng_remove(struct platform_device *pdev) | ||
120 | { | ||
121 | hwrng_unregister(&omap3_rom_rng_ops); | ||
122 | clk_disable_unprepare(rng_clk); | ||
123 | clk_put(rng_clk); | ||
124 | return 0; | ||
125 | } | ||
126 | |||
127 | static struct platform_driver omap3_rom_rng_driver = { | ||
128 | .driver = { | ||
129 | .name = "omap3-rom-rng", | ||
130 | .owner = THIS_MODULE, | ||
131 | }, | ||
132 | .probe = omap3_rom_rng_probe, | ||
133 | .remove = omap3_rom_rng_remove, | ||
134 | }; | ||
135 | |||
136 | module_platform_driver(omap3_rom_rng_driver); | ||
137 | |||
138 | MODULE_ALIAS("platform:omap3-rom-rng"); | ||
139 | MODULE_AUTHOR("Juha Yrjola"); | ||
140 | MODULE_AUTHOR("Pali Rohár <pali.rohar@gmail.com>"); | ||
141 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/char/hw_random/pseries-rng.c b/drivers/char/hw_random/pseries-rng.c index b761459a3436..ab7ffdec0ec3 100644 --- a/drivers/char/hw_random/pseries-rng.c +++ b/drivers/char/hw_random/pseries-rng.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/hw_random.h> | 24 | #include <linux/hw_random.h> |
25 | #include <asm/vio.h> | 25 | #include <asm/vio.h> |
26 | 26 | ||
27 | #define MODULE_NAME "pseries-rng" | ||
28 | 27 | ||
29 | static int pseries_rng_data_read(struct hwrng *rng, u32 *data) | 28 | static int pseries_rng_data_read(struct hwrng *rng, u32 *data) |
30 | { | 29 | { |
@@ -55,7 +54,7 @@ static unsigned long pseries_rng_get_desired_dma(struct vio_dev *vdev) | |||
55 | }; | 54 | }; |
56 | 55 | ||
57 | static struct hwrng pseries_rng = { | 56 | static struct hwrng pseries_rng = { |
58 | .name = MODULE_NAME, | 57 | .name = KBUILD_MODNAME, |
59 | .data_read = pseries_rng_data_read, | 58 | .data_read = pseries_rng_data_read, |
60 | }; | 59 | }; |
61 | 60 | ||
@@ -78,7 +77,7 @@ static struct vio_device_id pseries_rng_driver_ids[] = { | |||
78 | MODULE_DEVICE_TABLE(vio, pseries_rng_driver_ids); | 77 | MODULE_DEVICE_TABLE(vio, pseries_rng_driver_ids); |
79 | 78 | ||
80 | static struct vio_driver pseries_rng_driver = { | 79 | static struct vio_driver pseries_rng_driver = { |
81 | .name = MODULE_NAME, | 80 | .name = KBUILD_MODNAME, |
82 | .probe = pseries_rng_probe, | 81 | .probe = pseries_rng_probe, |
83 | .remove = pseries_rng_remove, | 82 | .remove = pseries_rng_remove, |
84 | .get_desired_dma = pseries_rng_get_desired_dma, | 83 | .get_desired_dma = pseries_rng_get_desired_dma, |
diff --git a/drivers/char/hw_random/via-rng.c b/drivers/char/hw_random/via-rng.c index e737772ad69a..de5a6dcfb3e2 100644 --- a/drivers/char/hw_random/via-rng.c +++ b/drivers/char/hw_random/via-rng.c | |||
@@ -221,7 +221,7 @@ static void __exit mod_exit(void) | |||
221 | module_init(mod_init); | 221 | module_init(mod_init); |
222 | module_exit(mod_exit); | 222 | module_exit(mod_exit); |
223 | 223 | ||
224 | static struct x86_cpu_id via_rng_cpu_id[] = { | 224 | static struct x86_cpu_id __maybe_unused via_rng_cpu_id[] = { |
225 | X86_FEATURE_MATCH(X86_FEATURE_XSTORE), | 225 | X86_FEATURE_MATCH(X86_FEATURE_XSTORE), |
226 | {} | 226 | {} |
227 | }; | 227 | }; |
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index bdb953e15d2a..5c07a56962db 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig | |||
@@ -87,6 +87,7 @@ config ARM_ARCH_TIMER | |||
87 | config ARM_ARCH_TIMER_EVTSTREAM | 87 | config ARM_ARCH_TIMER_EVTSTREAM |
88 | bool "Support for ARM architected timer event stream generation" | 88 | bool "Support for ARM architected timer event stream generation" |
89 | default y if ARM_ARCH_TIMER | 89 | default y if ARM_ARCH_TIMER |
90 | depends on ARM_ARCH_TIMER | ||
90 | help | 91 | help |
91 | This option enables support for event stream generation based on | 92 | This option enables support for event stream generation based on |
92 | the ARM architected timer. It is used for waking up CPUs executing | 93 | the ARM architected timer. It is used for waking up CPUs executing |
diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c index 4aac9ee0d0c0..3cf12834681e 100644 --- a/drivers/clocksource/sh_mtu2.c +++ b/drivers/clocksource/sh_mtu2.c | |||
@@ -313,8 +313,20 @@ static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev) | |||
313 | goto err1; | 313 | goto err1; |
314 | } | 314 | } |
315 | 315 | ||
316 | return sh_mtu2_register(p, (char *)dev_name(&p->pdev->dev), | 316 | ret = clk_prepare(p->clk); |
317 | cfg->clockevent_rating); | 317 | if (ret < 0) |
318 | goto err2; | ||
319 | |||
320 | ret = sh_mtu2_register(p, (char *)dev_name(&p->pdev->dev), | ||
321 | cfg->clockevent_rating); | ||
322 | if (ret < 0) | ||
323 | goto err3; | ||
324 | |||
325 | return 0; | ||
326 | err3: | ||
327 | clk_unprepare(p->clk); | ||
328 | err2: | ||
329 | clk_put(p->clk); | ||
318 | err1: | 330 | err1: |
319 | iounmap(p->mapbase); | 331 | iounmap(p->mapbase); |
320 | err0: | 332 | err0: |
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index 78b8dae49628..63557cda0a7d 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c | |||
@@ -472,12 +472,26 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev) | |||
472 | ret = PTR_ERR(p->clk); | 472 | ret = PTR_ERR(p->clk); |
473 | goto err1; | 473 | goto err1; |
474 | } | 474 | } |
475 | |||
476 | ret = clk_prepare(p->clk); | ||
477 | if (ret < 0) | ||
478 | goto err2; | ||
479 | |||
475 | p->cs_enabled = false; | 480 | p->cs_enabled = false; |
476 | p->enable_count = 0; | 481 | p->enable_count = 0; |
477 | 482 | ||
478 | return sh_tmu_register(p, (char *)dev_name(&p->pdev->dev), | 483 | ret = sh_tmu_register(p, (char *)dev_name(&p->pdev->dev), |
479 | cfg->clockevent_rating, | 484 | cfg->clockevent_rating, |
480 | cfg->clocksource_rating); | 485 | cfg->clocksource_rating); |
486 | if (ret < 0) | ||
487 | goto err3; | ||
488 | |||
489 | return 0; | ||
490 | |||
491 | err3: | ||
492 | clk_unprepare(p->clk); | ||
493 | err2: | ||
494 | clk_put(p->clk); | ||
481 | err1: | 495 | err1: |
482 | iounmap(p->mapbase); | 496 | iounmap(p->mapbase); |
483 | err0: | 497 | err0: |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 02d534da22dd..81e9d4412db8 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/suspend.h> | ||
29 | #include <linux/syscore_ops.h> | 30 | #include <linux/syscore_ops.h> |
30 | #include <linux/tick.h> | 31 | #include <linux/tick.h> |
31 | #include <trace/events/power.h> | 32 | #include <trace/events/power.h> |
@@ -47,6 +48,9 @@ static LIST_HEAD(cpufreq_policy_list); | |||
47 | static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor); | 48 | static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor); |
48 | #endif | 49 | #endif |
49 | 50 | ||
51 | /* Flag to suspend/resume CPUFreq governors */ | ||
52 | static bool cpufreq_suspended; | ||
53 | |||
50 | static inline bool has_target(void) | 54 | static inline bool has_target(void) |
51 | { | 55 | { |
52 | return cpufreq_driver->target_index || cpufreq_driver->target; | 56 | return cpufreq_driver->target_index || cpufreq_driver->target; |
@@ -1462,6 +1466,41 @@ static struct subsys_interface cpufreq_interface = { | |||
1462 | .remove_dev = cpufreq_remove_dev, | 1466 | .remove_dev = cpufreq_remove_dev, |
1463 | }; | 1467 | }; |
1464 | 1468 | ||
1469 | void cpufreq_suspend(void) | ||
1470 | { | ||
1471 | struct cpufreq_policy *policy; | ||
1472 | |||
1473 | if (!has_target()) | ||
1474 | return; | ||
1475 | |||
1476 | pr_debug("%s: Suspending Governors\n", __func__); | ||
1477 | |||
1478 | list_for_each_entry(policy, &cpufreq_policy_list, policy_list) | ||
1479 | if (__cpufreq_governor(policy, CPUFREQ_GOV_STOP)) | ||
1480 | pr_err("%s: Failed to stop governor for policy: %p\n", | ||
1481 | __func__, policy); | ||
1482 | |||
1483 | cpufreq_suspended = true; | ||
1484 | } | ||
1485 | |||
1486 | void cpufreq_resume(void) | ||
1487 | { | ||
1488 | struct cpufreq_policy *policy; | ||
1489 | |||
1490 | if (!has_target()) | ||
1491 | return; | ||
1492 | |||
1493 | pr_debug("%s: Resuming Governors\n", __func__); | ||
1494 | |||
1495 | cpufreq_suspended = false; | ||
1496 | |||
1497 | list_for_each_entry(policy, &cpufreq_policy_list, policy_list) | ||
1498 | if (__cpufreq_governor(policy, CPUFREQ_GOV_START) | ||
1499 | || __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS)) | ||
1500 | pr_err("%s: Failed to start governor for policy: %p\n", | ||
1501 | __func__, policy); | ||
1502 | } | ||
1503 | |||
1465 | /** | 1504 | /** |
1466 | * cpufreq_bp_suspend - Prepare the boot CPU for system suspend. | 1505 | * cpufreq_bp_suspend - Prepare the boot CPU for system suspend. |
1467 | * | 1506 | * |
@@ -1764,6 +1803,10 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, | |||
1764 | struct cpufreq_governor *gov = NULL; | 1803 | struct cpufreq_governor *gov = NULL; |
1765 | #endif | 1804 | #endif |
1766 | 1805 | ||
1806 | /* Don't start any governor operations if we are entering suspend */ | ||
1807 | if (cpufreq_suspended) | ||
1808 | return 0; | ||
1809 | |||
1767 | if (policy->governor->max_transition_latency && | 1810 | if (policy->governor->max_transition_latency && |
1768 | policy->cpuinfo.transition_latency > | 1811 | policy->cpuinfo.transition_latency > |
1769 | policy->governor->max_transition_latency) { | 1812 | policy->governor->max_transition_latency) { |
@@ -2076,9 +2119,6 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb, | |||
2076 | dev = get_cpu_device(cpu); | 2119 | dev = get_cpu_device(cpu); |
2077 | if (dev) { | 2120 | if (dev) { |
2078 | 2121 | ||
2079 | if (action & CPU_TASKS_FROZEN) | ||
2080 | frozen = true; | ||
2081 | |||
2082 | switch (action & ~CPU_TASKS_FROZEN) { | 2122 | switch (action & ~CPU_TASKS_FROZEN) { |
2083 | case CPU_ONLINE: | 2123 | case CPU_ONLINE: |
2084 | __cpufreq_add_dev(dev, NULL, frozen); | 2124 | __cpufreq_add_dev(dev, NULL, frozen); |
diff --git a/drivers/cpufreq/exynos4210-cpufreq.c b/drivers/cpufreq/exynos4210-cpufreq.c index f2c75065ce19..dfd1643b0b2f 100644 --- a/drivers/cpufreq/exynos4210-cpufreq.c +++ b/drivers/cpufreq/exynos4210-cpufreq.c | |||
@@ -157,4 +157,3 @@ err_moutcore: | |||
157 | pr_debug("%s: failed initialization\n", __func__); | 157 | pr_debug("%s: failed initialization\n", __func__); |
158 | return -EINVAL; | 158 | return -EINVAL; |
159 | } | 159 | } |
160 | EXPORT_SYMBOL(exynos4210_cpufreq_init); | ||
diff --git a/drivers/cpufreq/exynos4x12-cpufreq.c b/drivers/cpufreq/exynos4x12-cpufreq.c index 8683304ce62c..efad5e657f6f 100644 --- a/drivers/cpufreq/exynos4x12-cpufreq.c +++ b/drivers/cpufreq/exynos4x12-cpufreq.c | |||
@@ -211,4 +211,3 @@ err_moutcore: | |||
211 | pr_debug("%s: failed initialization\n", __func__); | 211 | pr_debug("%s: failed initialization\n", __func__); |
212 | return -EINVAL; | 212 | return -EINVAL; |
213 | } | 213 | } |
214 | EXPORT_SYMBOL(exynos4x12_cpufreq_init); | ||
diff --git a/drivers/cpufreq/exynos5250-cpufreq.c b/drivers/cpufreq/exynos5250-cpufreq.c index 9fae466d7746..8feda86fe42c 100644 --- a/drivers/cpufreq/exynos5250-cpufreq.c +++ b/drivers/cpufreq/exynos5250-cpufreq.c | |||
@@ -236,4 +236,3 @@ err_moutcore: | |||
236 | pr_err("%s: failed initialization\n", __func__); | 236 | pr_err("%s: failed initialization\n", __func__); |
237 | return -EINVAL; | 237 | return -EINVAL; |
238 | } | 238 | } |
239 | EXPORT_SYMBOL(exynos5250_cpufreq_init); | ||
diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index f42df7ec03c5..b7309c37033d 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c | |||
@@ -142,10 +142,8 @@ static int tegra_target(struct cpufreq_policy *policy, unsigned int index) | |||
142 | 142 | ||
143 | mutex_lock(&tegra_cpu_lock); | 143 | mutex_lock(&tegra_cpu_lock); |
144 | 144 | ||
145 | if (is_suspended) { | 145 | if (is_suspended) |
146 | ret = -EBUSY; | ||
147 | goto out; | 146 | goto out; |
148 | } | ||
149 | 147 | ||
150 | freq = freq_table[index].frequency; | 148 | freq = freq_table[index].frequency; |
151 | 149 | ||
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 2a991e468f78..a55e68f2cfc8 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
@@ -400,7 +400,7 @@ EXPORT_SYMBOL_GPL(cpuidle_register_device); | |||
400 | */ | 400 | */ |
401 | void cpuidle_unregister_device(struct cpuidle_device *dev) | 401 | void cpuidle_unregister_device(struct cpuidle_device *dev) |
402 | { | 402 | { |
403 | if (dev->registered == 0) | 403 | if (!dev || dev->registered == 0) |
404 | return; | 404 | return; |
405 | 405 | ||
406 | cpuidle_pause_and_lock(); | 406 | cpuidle_pause_and_lock(); |
diff --git a/drivers/crypto/caam/Kconfig b/drivers/crypto/caam/Kconfig index ca89f6b84b06..e7555ff4cafd 100644 --- a/drivers/crypto/caam/Kconfig +++ b/drivers/crypto/caam/Kconfig | |||
@@ -4,16 +4,29 @@ config CRYPTO_DEV_FSL_CAAM | |||
4 | help | 4 | help |
5 | Enables the driver module for Freescale's Cryptographic Accelerator | 5 | Enables the driver module for Freescale's Cryptographic Accelerator |
6 | and Assurance Module (CAAM), also known as the SEC version 4 (SEC4). | 6 | and Assurance Module (CAAM), also known as the SEC version 4 (SEC4). |
7 | This module adds a job ring operation interface, and configures h/w | 7 | This module creates job ring devices, and configures h/w |
8 | to operate as a DPAA component automatically, depending | 8 | to operate as a DPAA component automatically, depending |
9 | on h/w feature availability. | 9 | on h/w feature availability. |
10 | 10 | ||
11 | To compile this driver as a module, choose M here: the module | 11 | To compile this driver as a module, choose M here: the module |
12 | will be called caam. | 12 | will be called caam. |
13 | 13 | ||
14 | config CRYPTO_DEV_FSL_CAAM_JR | ||
15 | tristate "Freescale CAAM Job Ring driver backend" | ||
16 | depends on CRYPTO_DEV_FSL_CAAM | ||
17 | default y | ||
18 | help | ||
19 | Enables the driver module for Job Rings which are part of | ||
20 | Freescale's Cryptographic Accelerator | ||
21 | and Assurance Module (CAAM). This module adds a job ring operation | ||
22 | interface. | ||
23 | |||
24 | To compile this driver as a module, choose M here: the module | ||
25 | will be called caam_jr. | ||
26 | |||
14 | config CRYPTO_DEV_FSL_CAAM_RINGSIZE | 27 | config CRYPTO_DEV_FSL_CAAM_RINGSIZE |
15 | int "Job Ring size" | 28 | int "Job Ring size" |
16 | depends on CRYPTO_DEV_FSL_CAAM | 29 | depends on CRYPTO_DEV_FSL_CAAM_JR |
17 | range 2 9 | 30 | range 2 9 |
18 | default "9" | 31 | default "9" |
19 | help | 32 | help |
@@ -31,7 +44,7 @@ config CRYPTO_DEV_FSL_CAAM_RINGSIZE | |||
31 | 44 | ||
32 | config CRYPTO_DEV_FSL_CAAM_INTC | 45 | config CRYPTO_DEV_FSL_CAAM_INTC |
33 | bool "Job Ring interrupt coalescing" | 46 | bool "Job Ring interrupt coalescing" |
34 | depends on CRYPTO_DEV_FSL_CAAM | 47 | depends on CRYPTO_DEV_FSL_CAAM_JR |
35 | default n | 48 | default n |
36 | help | 49 | help |
37 | Enable the Job Ring's interrupt coalescing feature. | 50 | Enable the Job Ring's interrupt coalescing feature. |
@@ -62,7 +75,7 @@ config CRYPTO_DEV_FSL_CAAM_INTC_TIME_THLD | |||
62 | 75 | ||
63 | config CRYPTO_DEV_FSL_CAAM_CRYPTO_API | 76 | config CRYPTO_DEV_FSL_CAAM_CRYPTO_API |
64 | tristate "Register algorithm implementations with the Crypto API" | 77 | tristate "Register algorithm implementations with the Crypto API" |
65 | depends on CRYPTO_DEV_FSL_CAAM | 78 | depends on CRYPTO_DEV_FSL_CAAM && CRYPTO_DEV_FSL_CAAM_JR |
66 | default y | 79 | default y |
67 | select CRYPTO_ALGAPI | 80 | select CRYPTO_ALGAPI |
68 | select CRYPTO_AUTHENC | 81 | select CRYPTO_AUTHENC |
@@ -76,7 +89,7 @@ config CRYPTO_DEV_FSL_CAAM_CRYPTO_API | |||
76 | 89 | ||
77 | config CRYPTO_DEV_FSL_CAAM_AHASH_API | 90 | config CRYPTO_DEV_FSL_CAAM_AHASH_API |
78 | tristate "Register hash algorithm implementations with Crypto API" | 91 | tristate "Register hash algorithm implementations with Crypto API" |
79 | depends on CRYPTO_DEV_FSL_CAAM | 92 | depends on CRYPTO_DEV_FSL_CAAM && CRYPTO_DEV_FSL_CAAM_JR |
80 | default y | 93 | default y |
81 | select CRYPTO_HASH | 94 | select CRYPTO_HASH |
82 | help | 95 | help |
@@ -88,7 +101,7 @@ config CRYPTO_DEV_FSL_CAAM_AHASH_API | |||
88 | 101 | ||
89 | config CRYPTO_DEV_FSL_CAAM_RNG_API | 102 | config CRYPTO_DEV_FSL_CAAM_RNG_API |
90 | tristate "Register caam device for hwrng API" | 103 | tristate "Register caam device for hwrng API" |
91 | depends on CRYPTO_DEV_FSL_CAAM | 104 | depends on CRYPTO_DEV_FSL_CAAM && CRYPTO_DEV_FSL_CAAM_JR |
92 | default y | 105 | default y |
93 | select CRYPTO_RNG | 106 | select CRYPTO_RNG |
94 | select HW_RANDOM | 107 | select HW_RANDOM |
diff --git a/drivers/crypto/caam/Makefile b/drivers/crypto/caam/Makefile index d56bd0ec65d8..550758a333e7 100644 --- a/drivers/crypto/caam/Makefile +++ b/drivers/crypto/caam/Makefile | |||
@@ -6,8 +6,10 @@ ifeq ($(CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG), y) | |||
6 | endif | 6 | endif |
7 | 7 | ||
8 | obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM) += caam.o | 8 | obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM) += caam.o |
9 | obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_JR) += caam_jr.o | ||
9 | obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API) += caamalg.o | 10 | obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API) += caamalg.o |
10 | obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API) += caamhash.o | 11 | obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API) += caamhash.o |
11 | obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API) += caamrng.o | 12 | obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API) += caamrng.o |
12 | 13 | ||
13 | caam-objs := ctrl.o jr.o error.o key_gen.o | 14 | caam-objs := ctrl.o |
15 | caam_jr-objs := jr.o key_gen.o error.o | ||
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index 7c63b72ecd75..4cf5dec826e1 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c | |||
@@ -86,6 +86,7 @@ | |||
86 | #else | 86 | #else |
87 | #define debug(format, arg...) | 87 | #define debug(format, arg...) |
88 | #endif | 88 | #endif |
89 | static struct list_head alg_list; | ||
89 | 90 | ||
90 | /* Set DK bit in class 1 operation if shared */ | 91 | /* Set DK bit in class 1 operation if shared */ |
91 | static inline void append_dec_op1(u32 *desc, u32 type) | 92 | static inline void append_dec_op1(u32 *desc, u32 type) |
@@ -817,7 +818,7 @@ static void aead_decrypt_done(struct device *jrdev, u32 *desc, u32 err, | |||
817 | ivsize, 1); | 818 | ivsize, 1); |
818 | print_hex_dump(KERN_ERR, "dst @"__stringify(__LINE__)": ", | 819 | print_hex_dump(KERN_ERR, "dst @"__stringify(__LINE__)": ", |
819 | DUMP_PREFIX_ADDRESS, 16, 4, sg_virt(req->dst), | 820 | DUMP_PREFIX_ADDRESS, 16, 4, sg_virt(req->dst), |
820 | req->cryptlen, 1); | 821 | req->cryptlen - ctx->authsize, 1); |
821 | #endif | 822 | #endif |
822 | 823 | ||
823 | if (err) { | 824 | if (err) { |
@@ -971,12 +972,9 @@ static void init_aead_job(u32 *sh_desc, dma_addr_t ptr, | |||
971 | (edesc->src_nents ? : 1); | 972 | (edesc->src_nents ? : 1); |
972 | in_options = LDST_SGF; | 973 | in_options = LDST_SGF; |
973 | } | 974 | } |
974 | if (encrypt) | 975 | |
975 | append_seq_in_ptr(desc, src_dma, req->assoclen + ivsize + | 976 | append_seq_in_ptr(desc, src_dma, req->assoclen + ivsize + req->cryptlen, |
976 | req->cryptlen - authsize, in_options); | 977 | in_options); |
977 | else | ||
978 | append_seq_in_ptr(desc, src_dma, req->assoclen + ivsize + | ||
979 | req->cryptlen, in_options); | ||
980 | 978 | ||
981 | if (likely(req->src == req->dst)) { | 979 | if (likely(req->src == req->dst)) { |
982 | if (all_contig) { | 980 | if (all_contig) { |
@@ -997,7 +995,8 @@ static void init_aead_job(u32 *sh_desc, dma_addr_t ptr, | |||
997 | } | 995 | } |
998 | } | 996 | } |
999 | if (encrypt) | 997 | if (encrypt) |
1000 | append_seq_out_ptr(desc, dst_dma, req->cryptlen, out_options); | 998 | append_seq_out_ptr(desc, dst_dma, req->cryptlen + authsize, |
999 | out_options); | ||
1001 | else | 1000 | else |
1002 | append_seq_out_ptr(desc, dst_dma, req->cryptlen - authsize, | 1001 | append_seq_out_ptr(desc, dst_dma, req->cryptlen - authsize, |
1003 | out_options); | 1002 | out_options); |
@@ -1047,8 +1046,8 @@ static void init_aead_giv_job(u32 *sh_desc, dma_addr_t ptr, | |||
1047 | sec4_sg_index += edesc->assoc_nents + 1 + edesc->src_nents; | 1046 | sec4_sg_index += edesc->assoc_nents + 1 + edesc->src_nents; |
1048 | in_options = LDST_SGF; | 1047 | in_options = LDST_SGF; |
1049 | } | 1048 | } |
1050 | append_seq_in_ptr(desc, src_dma, req->assoclen + ivsize + | 1049 | append_seq_in_ptr(desc, src_dma, req->assoclen + ivsize + req->cryptlen, |
1051 | req->cryptlen - authsize, in_options); | 1050 | in_options); |
1052 | 1051 | ||
1053 | if (contig & GIV_DST_CONTIG) { | 1052 | if (contig & GIV_DST_CONTIG) { |
1054 | dst_dma = edesc->iv_dma; | 1053 | dst_dma = edesc->iv_dma; |
@@ -1065,7 +1064,8 @@ static void init_aead_giv_job(u32 *sh_desc, dma_addr_t ptr, | |||
1065 | } | 1064 | } |
1066 | } | 1065 | } |
1067 | 1066 | ||
1068 | append_seq_out_ptr(desc, dst_dma, ivsize + req->cryptlen, out_options); | 1067 | append_seq_out_ptr(desc, dst_dma, ivsize + req->cryptlen + authsize, |
1068 | out_options); | ||
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | /* | 1071 | /* |
@@ -1129,7 +1129,8 @@ static void init_ablkcipher_job(u32 *sh_desc, dma_addr_t ptr, | |||
1129 | * allocate and map the aead extended descriptor | 1129 | * allocate and map the aead extended descriptor |
1130 | */ | 1130 | */ |
1131 | static struct aead_edesc *aead_edesc_alloc(struct aead_request *req, | 1131 | static struct aead_edesc *aead_edesc_alloc(struct aead_request *req, |
1132 | int desc_bytes, bool *all_contig_ptr) | 1132 | int desc_bytes, bool *all_contig_ptr, |
1133 | bool encrypt) | ||
1133 | { | 1134 | { |
1134 | struct crypto_aead *aead = crypto_aead_reqtfm(req); | 1135 | struct crypto_aead *aead = crypto_aead_reqtfm(req); |
1135 | struct caam_ctx *ctx = crypto_aead_ctx(aead); | 1136 | struct caam_ctx *ctx = crypto_aead_ctx(aead); |
@@ -1144,12 +1145,22 @@ static struct aead_edesc *aead_edesc_alloc(struct aead_request *req, | |||
1144 | bool assoc_chained = false, src_chained = false, dst_chained = false; | 1145 | bool assoc_chained = false, src_chained = false, dst_chained = false; |
1145 | int ivsize = crypto_aead_ivsize(aead); | 1146 | int ivsize = crypto_aead_ivsize(aead); |
1146 | int sec4_sg_index, sec4_sg_len = 0, sec4_sg_bytes; | 1147 | int sec4_sg_index, sec4_sg_len = 0, sec4_sg_bytes; |
1148 | unsigned int authsize = ctx->authsize; | ||
1147 | 1149 | ||
1148 | assoc_nents = sg_count(req->assoc, req->assoclen, &assoc_chained); | 1150 | assoc_nents = sg_count(req->assoc, req->assoclen, &assoc_chained); |
1149 | src_nents = sg_count(req->src, req->cryptlen, &src_chained); | ||
1150 | 1151 | ||
1151 | if (unlikely(req->dst != req->src)) | 1152 | if (unlikely(req->dst != req->src)) { |
1152 | dst_nents = sg_count(req->dst, req->cryptlen, &dst_chained); | 1153 | src_nents = sg_count(req->src, req->cryptlen, &src_chained); |
1154 | dst_nents = sg_count(req->dst, | ||
1155 | req->cryptlen + | ||
1156 | (encrypt ? authsize : (-authsize)), | ||
1157 | &dst_chained); | ||
1158 | } else { | ||
1159 | src_nents = sg_count(req->src, | ||
1160 | req->cryptlen + | ||
1161 | (encrypt ? authsize : 0), | ||
1162 | &src_chained); | ||
1163 | } | ||
1153 | 1164 | ||
1154 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, | 1165 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, |
1155 | DMA_TO_DEVICE, assoc_chained); | 1166 | DMA_TO_DEVICE, assoc_chained); |
@@ -1233,11 +1244,9 @@ static int aead_encrypt(struct aead_request *req) | |||
1233 | u32 *desc; | 1244 | u32 *desc; |
1234 | int ret = 0; | 1245 | int ret = 0; |
1235 | 1246 | ||
1236 | req->cryptlen += ctx->authsize; | ||
1237 | |||
1238 | /* allocate extended descriptor */ | 1247 | /* allocate extended descriptor */ |
1239 | edesc = aead_edesc_alloc(req, DESC_JOB_IO_LEN * | 1248 | edesc = aead_edesc_alloc(req, DESC_JOB_IO_LEN * |
1240 | CAAM_CMD_SZ, &all_contig); | 1249 | CAAM_CMD_SZ, &all_contig, true); |
1241 | if (IS_ERR(edesc)) | 1250 | if (IS_ERR(edesc)) |
1242 | return PTR_ERR(edesc); | 1251 | return PTR_ERR(edesc); |
1243 | 1252 | ||
@@ -1274,7 +1283,7 @@ static int aead_decrypt(struct aead_request *req) | |||
1274 | 1283 | ||
1275 | /* allocate extended descriptor */ | 1284 | /* allocate extended descriptor */ |
1276 | edesc = aead_edesc_alloc(req, DESC_JOB_IO_LEN * | 1285 | edesc = aead_edesc_alloc(req, DESC_JOB_IO_LEN * |
1277 | CAAM_CMD_SZ, &all_contig); | 1286 | CAAM_CMD_SZ, &all_contig, false); |
1278 | if (IS_ERR(edesc)) | 1287 | if (IS_ERR(edesc)) |
1279 | return PTR_ERR(edesc); | 1288 | return PTR_ERR(edesc); |
1280 | 1289 | ||
@@ -1331,7 +1340,8 @@ static struct aead_edesc *aead_giv_edesc_alloc(struct aead_givcrypt_request | |||
1331 | src_nents = sg_count(req->src, req->cryptlen, &src_chained); | 1340 | src_nents = sg_count(req->src, req->cryptlen, &src_chained); |
1332 | 1341 | ||
1333 | if (unlikely(req->dst != req->src)) | 1342 | if (unlikely(req->dst != req->src)) |
1334 | dst_nents = sg_count(req->dst, req->cryptlen, &dst_chained); | 1343 | dst_nents = sg_count(req->dst, req->cryptlen + ctx->authsize, |
1344 | &dst_chained); | ||
1335 | 1345 | ||
1336 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, | 1346 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, |
1337 | DMA_TO_DEVICE, assoc_chained); | 1347 | DMA_TO_DEVICE, assoc_chained); |
@@ -1425,8 +1435,6 @@ static int aead_givencrypt(struct aead_givcrypt_request *areq) | |||
1425 | u32 *desc; | 1435 | u32 *desc; |
1426 | int ret = 0; | 1436 | int ret = 0; |
1427 | 1437 | ||
1428 | req->cryptlen += ctx->authsize; | ||
1429 | |||
1430 | /* allocate extended descriptor */ | 1438 | /* allocate extended descriptor */ |
1431 | edesc = aead_giv_edesc_alloc(areq, DESC_JOB_IO_LEN * | 1439 | edesc = aead_giv_edesc_alloc(areq, DESC_JOB_IO_LEN * |
1432 | CAAM_CMD_SZ, &contig); | 1440 | CAAM_CMD_SZ, &contig); |
@@ -2057,7 +2065,6 @@ static struct caam_alg_template driver_algs[] = { | |||
2057 | 2065 | ||
2058 | struct caam_crypto_alg { | 2066 | struct caam_crypto_alg { |
2059 | struct list_head entry; | 2067 | struct list_head entry; |
2060 | struct device *ctrldev; | ||
2061 | int class1_alg_type; | 2068 | int class1_alg_type; |
2062 | int class2_alg_type; | 2069 | int class2_alg_type; |
2063 | int alg_op; | 2070 | int alg_op; |
@@ -2070,14 +2077,12 @@ static int caam_cra_init(struct crypto_tfm *tfm) | |||
2070 | struct caam_crypto_alg *caam_alg = | 2077 | struct caam_crypto_alg *caam_alg = |
2071 | container_of(alg, struct caam_crypto_alg, crypto_alg); | 2078 | container_of(alg, struct caam_crypto_alg, crypto_alg); |
2072 | struct caam_ctx *ctx = crypto_tfm_ctx(tfm); | 2079 | struct caam_ctx *ctx = crypto_tfm_ctx(tfm); |
2073 | struct caam_drv_private *priv = dev_get_drvdata(caam_alg->ctrldev); | ||
2074 | int tgt_jr = atomic_inc_return(&priv->tfm_count); | ||
2075 | 2080 | ||
2076 | /* | 2081 | ctx->jrdev = caam_jr_alloc(); |
2077 | * distribute tfms across job rings to ensure in-order | 2082 | if (IS_ERR(ctx->jrdev)) { |
2078 | * crypto request processing per tfm | 2083 | pr_err("Job Ring Device allocation for transform failed\n"); |
2079 | */ | 2084 | return PTR_ERR(ctx->jrdev); |
2080 | ctx->jrdev = priv->jrdev[(tgt_jr / 2) % priv->total_jobrs]; | 2085 | } |
2081 | 2086 | ||
2082 | /* copy descriptor header template value */ | 2087 | /* copy descriptor header template value */ |
2083 | ctx->class1_alg_type = OP_TYPE_CLASS1_ALG | caam_alg->class1_alg_type; | 2088 | ctx->class1_alg_type = OP_TYPE_CLASS1_ALG | caam_alg->class1_alg_type; |
@@ -2104,44 +2109,26 @@ static void caam_cra_exit(struct crypto_tfm *tfm) | |||
2104 | dma_unmap_single(ctx->jrdev, ctx->sh_desc_givenc_dma, | 2109 | dma_unmap_single(ctx->jrdev, ctx->sh_desc_givenc_dma, |
2105 | desc_bytes(ctx->sh_desc_givenc), | 2110 | desc_bytes(ctx->sh_desc_givenc), |
2106 | DMA_TO_DEVICE); | 2111 | DMA_TO_DEVICE); |
2112 | |||
2113 | caam_jr_free(ctx->jrdev); | ||
2107 | } | 2114 | } |
2108 | 2115 | ||
2109 | static void __exit caam_algapi_exit(void) | 2116 | static void __exit caam_algapi_exit(void) |
2110 | { | 2117 | { |
2111 | 2118 | ||
2112 | struct device_node *dev_node; | ||
2113 | struct platform_device *pdev; | ||
2114 | struct device *ctrldev; | ||
2115 | struct caam_drv_private *priv; | ||
2116 | struct caam_crypto_alg *t_alg, *n; | 2119 | struct caam_crypto_alg *t_alg, *n; |
2117 | 2120 | ||
2118 | dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0"); | 2121 | if (!alg_list.next) |
2119 | if (!dev_node) { | ||
2120 | dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0"); | ||
2121 | if (!dev_node) | ||
2122 | return; | ||
2123 | } | ||
2124 | |||
2125 | pdev = of_find_device_by_node(dev_node); | ||
2126 | if (!pdev) | ||
2127 | return; | ||
2128 | |||
2129 | ctrldev = &pdev->dev; | ||
2130 | of_node_put(dev_node); | ||
2131 | priv = dev_get_drvdata(ctrldev); | ||
2132 | |||
2133 | if (!priv->alg_list.next) | ||
2134 | return; | 2122 | return; |
2135 | 2123 | ||
2136 | list_for_each_entry_safe(t_alg, n, &priv->alg_list, entry) { | 2124 | list_for_each_entry_safe(t_alg, n, &alg_list, entry) { |
2137 | crypto_unregister_alg(&t_alg->crypto_alg); | 2125 | crypto_unregister_alg(&t_alg->crypto_alg); |
2138 | list_del(&t_alg->entry); | 2126 | list_del(&t_alg->entry); |
2139 | kfree(t_alg); | 2127 | kfree(t_alg); |
2140 | } | 2128 | } |
2141 | } | 2129 | } |
2142 | 2130 | ||
2143 | static struct caam_crypto_alg *caam_alg_alloc(struct device *ctrldev, | 2131 | static struct caam_crypto_alg *caam_alg_alloc(struct caam_alg_template |
2144 | struct caam_alg_template | ||
2145 | *template) | 2132 | *template) |
2146 | { | 2133 | { |
2147 | struct caam_crypto_alg *t_alg; | 2134 | struct caam_crypto_alg *t_alg; |
@@ -2149,7 +2136,7 @@ static struct caam_crypto_alg *caam_alg_alloc(struct device *ctrldev, | |||
2149 | 2136 | ||
2150 | t_alg = kzalloc(sizeof(struct caam_crypto_alg), GFP_KERNEL); | 2137 | t_alg = kzalloc(sizeof(struct caam_crypto_alg), GFP_KERNEL); |
2151 | if (!t_alg) { | 2138 | if (!t_alg) { |
2152 | dev_err(ctrldev, "failed to allocate t_alg\n"); | 2139 | pr_err("failed to allocate t_alg\n"); |
2153 | return ERR_PTR(-ENOMEM); | 2140 | return ERR_PTR(-ENOMEM); |
2154 | } | 2141 | } |
2155 | 2142 | ||
@@ -2181,62 +2168,39 @@ static struct caam_crypto_alg *caam_alg_alloc(struct device *ctrldev, | |||
2181 | t_alg->class1_alg_type = template->class1_alg_type; | 2168 | t_alg->class1_alg_type = template->class1_alg_type; |
2182 | t_alg->class2_alg_type = template->class2_alg_type; | 2169 | t_alg->class2_alg_type = template->class2_alg_type; |
2183 | t_alg->alg_op = template->alg_op; | 2170 | t_alg->alg_op = template->alg_op; |
2184 | t_alg->ctrldev = ctrldev; | ||
2185 | 2171 | ||
2186 | return t_alg; | 2172 | return t_alg; |
2187 | } | 2173 | } |
2188 | 2174 | ||
2189 | static int __init caam_algapi_init(void) | 2175 | static int __init caam_algapi_init(void) |
2190 | { | 2176 | { |
2191 | struct device_node *dev_node; | ||
2192 | struct platform_device *pdev; | ||
2193 | struct device *ctrldev; | ||
2194 | struct caam_drv_private *priv; | ||
2195 | int i = 0, err = 0; | 2177 | int i = 0, err = 0; |
2196 | 2178 | ||
2197 | dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0"); | 2179 | INIT_LIST_HEAD(&alg_list); |
2198 | if (!dev_node) { | ||
2199 | dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0"); | ||
2200 | if (!dev_node) | ||
2201 | return -ENODEV; | ||
2202 | } | ||
2203 | |||
2204 | pdev = of_find_device_by_node(dev_node); | ||
2205 | if (!pdev) | ||
2206 | return -ENODEV; | ||
2207 | |||
2208 | ctrldev = &pdev->dev; | ||
2209 | priv = dev_get_drvdata(ctrldev); | ||
2210 | of_node_put(dev_node); | ||
2211 | |||
2212 | INIT_LIST_HEAD(&priv->alg_list); | ||
2213 | |||
2214 | atomic_set(&priv->tfm_count, -1); | ||
2215 | 2180 | ||
2216 | /* register crypto algorithms the device supports */ | 2181 | /* register crypto algorithms the device supports */ |
2217 | for (i = 0; i < ARRAY_SIZE(driver_algs); i++) { | 2182 | for (i = 0; i < ARRAY_SIZE(driver_algs); i++) { |
2218 | /* TODO: check if h/w supports alg */ | 2183 | /* TODO: check if h/w supports alg */ |
2219 | struct caam_crypto_alg *t_alg; | 2184 | struct caam_crypto_alg *t_alg; |
2220 | 2185 | ||
2221 | t_alg = caam_alg_alloc(ctrldev, &driver_algs[i]); | 2186 | t_alg = caam_alg_alloc(&driver_algs[i]); |
2222 | if (IS_ERR(t_alg)) { | 2187 | if (IS_ERR(t_alg)) { |
2223 | err = PTR_ERR(t_alg); | 2188 | err = PTR_ERR(t_alg); |
2224 | dev_warn(ctrldev, "%s alg allocation failed\n", | 2189 | pr_warn("%s alg allocation failed\n", |
2225 | driver_algs[i].driver_name); | 2190 | driver_algs[i].driver_name); |
2226 | continue; | 2191 | continue; |
2227 | } | 2192 | } |
2228 | 2193 | ||
2229 | err = crypto_register_alg(&t_alg->crypto_alg); | 2194 | err = crypto_register_alg(&t_alg->crypto_alg); |
2230 | if (err) { | 2195 | if (err) { |
2231 | dev_warn(ctrldev, "%s alg registration failed\n", | 2196 | pr_warn("%s alg registration failed\n", |
2232 | t_alg->crypto_alg.cra_driver_name); | 2197 | t_alg->crypto_alg.cra_driver_name); |
2233 | kfree(t_alg); | 2198 | kfree(t_alg); |
2234 | } else | 2199 | } else |
2235 | list_add_tail(&t_alg->entry, &priv->alg_list); | 2200 | list_add_tail(&t_alg->entry, &alg_list); |
2236 | } | 2201 | } |
2237 | if (!list_empty(&priv->alg_list)) | 2202 | if (!list_empty(&alg_list)) |
2238 | dev_info(ctrldev, "%s algorithms registered in /proc/crypto\n", | 2203 | pr_info("caam algorithms registered in /proc/crypto\n"); |
2239 | (char *)of_get_property(dev_node, "compatible", NULL)); | ||
2240 | 2204 | ||
2241 | return err; | 2205 | return err; |
2242 | } | 2206 | } |
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index e732bd962e98..0378328f47a7 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c | |||
@@ -94,6 +94,9 @@ | |||
94 | #define debug(format, arg...) | 94 | #define debug(format, arg...) |
95 | #endif | 95 | #endif |
96 | 96 | ||
97 | |||
98 | static struct list_head hash_list; | ||
99 | |||
97 | /* ahash per-session context */ | 100 | /* ahash per-session context */ |
98 | struct caam_hash_ctx { | 101 | struct caam_hash_ctx { |
99 | struct device *jrdev; | 102 | struct device *jrdev; |
@@ -1653,7 +1656,6 @@ static struct caam_hash_template driver_hash[] = { | |||
1653 | 1656 | ||
1654 | struct caam_hash_alg { | 1657 | struct caam_hash_alg { |
1655 | struct list_head entry; | 1658 | struct list_head entry; |
1656 | struct device *ctrldev; | ||
1657 | int alg_type; | 1659 | int alg_type; |
1658 | int alg_op; | 1660 | int alg_op; |
1659 | struct ahash_alg ahash_alg; | 1661 | struct ahash_alg ahash_alg; |
@@ -1670,7 +1672,6 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm) | |||
1670 | struct caam_hash_alg *caam_hash = | 1672 | struct caam_hash_alg *caam_hash = |
1671 | container_of(alg, struct caam_hash_alg, ahash_alg); | 1673 | container_of(alg, struct caam_hash_alg, ahash_alg); |
1672 | struct caam_hash_ctx *ctx = crypto_tfm_ctx(tfm); | 1674 | struct caam_hash_ctx *ctx = crypto_tfm_ctx(tfm); |
1673 | struct caam_drv_private *priv = dev_get_drvdata(caam_hash->ctrldev); | ||
1674 | /* Sizes for MDHA running digests: MD5, SHA1, 224, 256, 384, 512 */ | 1675 | /* Sizes for MDHA running digests: MD5, SHA1, 224, 256, 384, 512 */ |
1675 | static const u8 runninglen[] = { HASH_MSG_LEN + MD5_DIGEST_SIZE, | 1676 | static const u8 runninglen[] = { HASH_MSG_LEN + MD5_DIGEST_SIZE, |
1676 | HASH_MSG_LEN + SHA1_DIGEST_SIZE, | 1677 | HASH_MSG_LEN + SHA1_DIGEST_SIZE, |
@@ -1678,15 +1679,17 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm) | |||
1678 | HASH_MSG_LEN + SHA256_DIGEST_SIZE, | 1679 | HASH_MSG_LEN + SHA256_DIGEST_SIZE, |
1679 | HASH_MSG_LEN + 64, | 1680 | HASH_MSG_LEN + 64, |
1680 | HASH_MSG_LEN + SHA512_DIGEST_SIZE }; | 1681 | HASH_MSG_LEN + SHA512_DIGEST_SIZE }; |
1681 | int tgt_jr = atomic_inc_return(&priv->tfm_count); | ||
1682 | int ret = 0; | 1682 | int ret = 0; |
1683 | 1683 | ||
1684 | /* | 1684 | /* |
1685 | * distribute tfms across job rings to ensure in-order | 1685 | * Get a Job ring from Job Ring driver to ensure in-order |
1686 | * crypto request processing per tfm | 1686 | * crypto request processing per tfm |
1687 | */ | 1687 | */ |
1688 | ctx->jrdev = priv->jrdev[tgt_jr % priv->total_jobrs]; | 1688 | ctx->jrdev = caam_jr_alloc(); |
1689 | 1689 | if (IS_ERR(ctx->jrdev)) { | |
1690 | pr_err("Job Ring Device allocation for transform failed\n"); | ||
1691 | return PTR_ERR(ctx->jrdev); | ||
1692 | } | ||
1690 | /* copy descriptor header template value */ | 1693 | /* copy descriptor header template value */ |
1691 | ctx->alg_type = OP_TYPE_CLASS2_ALG | caam_hash->alg_type; | 1694 | ctx->alg_type = OP_TYPE_CLASS2_ALG | caam_hash->alg_type; |
1692 | ctx->alg_op = OP_TYPE_CLASS2_ALG | caam_hash->alg_op; | 1695 | ctx->alg_op = OP_TYPE_CLASS2_ALG | caam_hash->alg_op; |
@@ -1729,35 +1732,18 @@ static void caam_hash_cra_exit(struct crypto_tfm *tfm) | |||
1729 | !dma_mapping_error(ctx->jrdev, ctx->sh_desc_finup_dma)) | 1732 | !dma_mapping_error(ctx->jrdev, ctx->sh_desc_finup_dma)) |
1730 | dma_unmap_single(ctx->jrdev, ctx->sh_desc_finup_dma, | 1733 | dma_unmap_single(ctx->jrdev, ctx->sh_desc_finup_dma, |
1731 | desc_bytes(ctx->sh_desc_finup), DMA_TO_DEVICE); | 1734 | desc_bytes(ctx->sh_desc_finup), DMA_TO_DEVICE); |
1735 | |||
1736 | caam_jr_free(ctx->jrdev); | ||
1732 | } | 1737 | } |
1733 | 1738 | ||
1734 | static void __exit caam_algapi_hash_exit(void) | 1739 | static void __exit caam_algapi_hash_exit(void) |
1735 | { | 1740 | { |
1736 | struct device_node *dev_node; | ||
1737 | struct platform_device *pdev; | ||
1738 | struct device *ctrldev; | ||
1739 | struct caam_drv_private *priv; | ||
1740 | struct caam_hash_alg *t_alg, *n; | 1741 | struct caam_hash_alg *t_alg, *n; |
1741 | 1742 | ||
1742 | dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0"); | 1743 | if (!hash_list.next) |
1743 | if (!dev_node) { | ||
1744 | dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0"); | ||
1745 | if (!dev_node) | ||
1746 | return; | ||
1747 | } | ||
1748 | |||
1749 | pdev = of_find_device_by_node(dev_node); | ||
1750 | if (!pdev) | ||
1751 | return; | 1744 | return; |
1752 | 1745 | ||
1753 | ctrldev = &pdev->dev; | 1746 | list_for_each_entry_safe(t_alg, n, &hash_list, entry) { |
1754 | of_node_put(dev_node); | ||
1755 | priv = dev_get_drvdata(ctrldev); | ||
1756 | |||
1757 | if (!priv->hash_list.next) | ||
1758 | return; | ||
1759 | |||
1760 | list_for_each_entry_safe(t_alg, n, &priv->hash_list, entry) { | ||
1761 | crypto_unregister_ahash(&t_alg->ahash_alg); | 1747 | crypto_unregister_ahash(&t_alg->ahash_alg); |
1762 | list_del(&t_alg->entry); | 1748 | list_del(&t_alg->entry); |
1763 | kfree(t_alg); | 1749 | kfree(t_alg); |
@@ -1765,7 +1751,7 @@ static void __exit caam_algapi_hash_exit(void) | |||
1765 | } | 1751 | } |
1766 | 1752 | ||
1767 | static struct caam_hash_alg * | 1753 | static struct caam_hash_alg * |
1768 | caam_hash_alloc(struct device *ctrldev, struct caam_hash_template *template, | 1754 | caam_hash_alloc(struct caam_hash_template *template, |
1769 | bool keyed) | 1755 | bool keyed) |
1770 | { | 1756 | { |
1771 | struct caam_hash_alg *t_alg; | 1757 | struct caam_hash_alg *t_alg; |
@@ -1774,7 +1760,7 @@ caam_hash_alloc(struct device *ctrldev, struct caam_hash_template *template, | |||
1774 | 1760 | ||
1775 | t_alg = kzalloc(sizeof(struct caam_hash_alg), GFP_KERNEL); | 1761 | t_alg = kzalloc(sizeof(struct caam_hash_alg), GFP_KERNEL); |
1776 | if (!t_alg) { | 1762 | if (!t_alg) { |
1777 | dev_err(ctrldev, "failed to allocate t_alg\n"); | 1763 | pr_err("failed to allocate t_alg\n"); |
1778 | return ERR_PTR(-ENOMEM); | 1764 | return ERR_PTR(-ENOMEM); |
1779 | } | 1765 | } |
1780 | 1766 | ||
@@ -1805,37 +1791,15 @@ caam_hash_alloc(struct device *ctrldev, struct caam_hash_template *template, | |||
1805 | 1791 | ||
1806 | t_alg->alg_type = template->alg_type; | 1792 | t_alg->alg_type = template->alg_type; |
1807 | t_alg->alg_op = template->alg_op; | 1793 | t_alg->alg_op = template->alg_op; |
1808 | t_alg->ctrldev = ctrldev; | ||
1809 | 1794 | ||
1810 | return t_alg; | 1795 | return t_alg; |
1811 | } | 1796 | } |
1812 | 1797 | ||
1813 | static int __init caam_algapi_hash_init(void) | 1798 | static int __init caam_algapi_hash_init(void) |
1814 | { | 1799 | { |
1815 | struct device_node *dev_node; | ||
1816 | struct platform_device *pdev; | ||
1817 | struct device *ctrldev; | ||
1818 | struct caam_drv_private *priv; | ||
1819 | int i = 0, err = 0; | 1800 | int i = 0, err = 0; |
1820 | 1801 | ||
1821 | dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0"); | 1802 | INIT_LIST_HEAD(&hash_list); |
1822 | if (!dev_node) { | ||
1823 | dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0"); | ||
1824 | if (!dev_node) | ||
1825 | return -ENODEV; | ||
1826 | } | ||
1827 | |||
1828 | pdev = of_find_device_by_node(dev_node); | ||
1829 | if (!pdev) | ||
1830 | return -ENODEV; | ||
1831 | |||
1832 | ctrldev = &pdev->dev; | ||
1833 | priv = dev_get_drvdata(ctrldev); | ||
1834 | of_node_put(dev_node); | ||
1835 | |||
1836 | INIT_LIST_HEAD(&priv->hash_list); | ||
1837 | |||
1838 | atomic_set(&priv->tfm_count, -1); | ||
1839 | 1803 | ||
1840 | /* register crypto algorithms the device supports */ | 1804 | /* register crypto algorithms the device supports */ |
1841 | for (i = 0; i < ARRAY_SIZE(driver_hash); i++) { | 1805 | for (i = 0; i < ARRAY_SIZE(driver_hash); i++) { |
@@ -1843,38 +1807,38 @@ static int __init caam_algapi_hash_init(void) | |||
1843 | struct caam_hash_alg *t_alg; | 1807 | struct caam_hash_alg *t_alg; |
1844 | 1808 | ||
1845 | /* register hmac version */ | 1809 | /* register hmac version */ |
1846 | t_alg = caam_hash_alloc(ctrldev, &driver_hash[i], true); | 1810 | t_alg = caam_hash_alloc(&driver_hash[i], true); |
1847 | if (IS_ERR(t_alg)) { | 1811 | if (IS_ERR(t_alg)) { |
1848 | err = PTR_ERR(t_alg); | 1812 | err = PTR_ERR(t_alg); |
1849 | dev_warn(ctrldev, "%s alg allocation failed\n", | 1813 | pr_warn("%s alg allocation failed\n", |
1850 | driver_hash[i].driver_name); | 1814 | driver_hash[i].driver_name); |
1851 | continue; | 1815 | continue; |
1852 | } | 1816 | } |
1853 | 1817 | ||
1854 | err = crypto_register_ahash(&t_alg->ahash_alg); | 1818 | err = crypto_register_ahash(&t_alg->ahash_alg); |
1855 | if (err) { | 1819 | if (err) { |
1856 | dev_warn(ctrldev, "%s alg registration failed\n", | 1820 | pr_warn("%s alg registration failed\n", |
1857 | t_alg->ahash_alg.halg.base.cra_driver_name); | 1821 | t_alg->ahash_alg.halg.base.cra_driver_name); |
1858 | kfree(t_alg); | 1822 | kfree(t_alg); |
1859 | } else | 1823 | } else |
1860 | list_add_tail(&t_alg->entry, &priv->hash_list); | 1824 | list_add_tail(&t_alg->entry, &hash_list); |
1861 | 1825 | ||
1862 | /* register unkeyed version */ | 1826 | /* register unkeyed version */ |
1863 | t_alg = caam_hash_alloc(ctrldev, &driver_hash[i], false); | 1827 | t_alg = caam_hash_alloc(&driver_hash[i], false); |
1864 | if (IS_ERR(t_alg)) { | 1828 | if (IS_ERR(t_alg)) { |
1865 | err = PTR_ERR(t_alg); | 1829 | err = PTR_ERR(t_alg); |
1866 | dev_warn(ctrldev, "%s alg allocation failed\n", | 1830 | pr_warn("%s alg allocation failed\n", |
1867 | driver_hash[i].driver_name); | 1831 | driver_hash[i].driver_name); |
1868 | continue; | 1832 | continue; |
1869 | } | 1833 | } |
1870 | 1834 | ||
1871 | err = crypto_register_ahash(&t_alg->ahash_alg); | 1835 | err = crypto_register_ahash(&t_alg->ahash_alg); |
1872 | if (err) { | 1836 | if (err) { |
1873 | dev_warn(ctrldev, "%s alg registration failed\n", | 1837 | pr_warn("%s alg registration failed\n", |
1874 | t_alg->ahash_alg.halg.base.cra_driver_name); | 1838 | t_alg->ahash_alg.halg.base.cra_driver_name); |
1875 | kfree(t_alg); | 1839 | kfree(t_alg); |
1876 | } else | 1840 | } else |
1877 | list_add_tail(&t_alg->entry, &priv->hash_list); | 1841 | list_add_tail(&t_alg->entry, &hash_list); |
1878 | } | 1842 | } |
1879 | 1843 | ||
1880 | return err; | 1844 | return err; |
diff --git a/drivers/crypto/caam/caamrng.c b/drivers/crypto/caam/caamrng.c index d1939a9539c0..28486b19fc36 100644 --- a/drivers/crypto/caam/caamrng.c +++ b/drivers/crypto/caam/caamrng.c | |||
@@ -273,34 +273,23 @@ static struct hwrng caam_rng = { | |||
273 | 273 | ||
274 | static void __exit caam_rng_exit(void) | 274 | static void __exit caam_rng_exit(void) |
275 | { | 275 | { |
276 | caam_jr_free(rng_ctx.jrdev); | ||
276 | hwrng_unregister(&caam_rng); | 277 | hwrng_unregister(&caam_rng); |
277 | } | 278 | } |
278 | 279 | ||
279 | static int __init caam_rng_init(void) | 280 | static int __init caam_rng_init(void) |
280 | { | 281 | { |
281 | struct device_node *dev_node; | 282 | struct device *dev; |
282 | struct platform_device *pdev; | ||
283 | struct device *ctrldev; | ||
284 | struct caam_drv_private *priv; | ||
285 | |||
286 | dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0"); | ||
287 | if (!dev_node) { | ||
288 | dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0"); | ||
289 | if (!dev_node) | ||
290 | return -ENODEV; | ||
291 | } | ||
292 | |||
293 | pdev = of_find_device_by_node(dev_node); | ||
294 | if (!pdev) | ||
295 | return -ENODEV; | ||
296 | 283 | ||
297 | ctrldev = &pdev->dev; | 284 | dev = caam_jr_alloc(); |
298 | priv = dev_get_drvdata(ctrldev); | 285 | if (IS_ERR(dev)) { |
299 | of_node_put(dev_node); | 286 | pr_err("Job Ring Device allocation for transform failed\n"); |
287 | return PTR_ERR(dev); | ||
288 | } | ||
300 | 289 | ||
301 | caam_init_rng(&rng_ctx, priv->jrdev[0]); | 290 | caam_init_rng(&rng_ctx, dev); |
302 | 291 | ||
303 | dev_info(priv->jrdev[0], "registering rng-caam\n"); | 292 | dev_info(dev, "registering rng-caam\n"); |
304 | return hwrng_register(&caam_rng); | 293 | return hwrng_register(&caam_rng); |
305 | } | 294 | } |
306 | 295 | ||
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index bc6d820812b6..63fb1af2c431 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c | |||
@@ -16,82 +16,75 @@ | |||
16 | #include "error.h" | 16 | #include "error.h" |
17 | #include "ctrl.h" | 17 | #include "ctrl.h" |
18 | 18 | ||
19 | static int caam_remove(struct platform_device *pdev) | ||
20 | { | ||
21 | struct device *ctrldev; | ||
22 | struct caam_drv_private *ctrlpriv; | ||
23 | struct caam_drv_private_jr *jrpriv; | ||
24 | struct caam_full __iomem *topregs; | ||
25 | int ring, ret = 0; | ||
26 | |||
27 | ctrldev = &pdev->dev; | ||
28 | ctrlpriv = dev_get_drvdata(ctrldev); | ||
29 | topregs = (struct caam_full __iomem *)ctrlpriv->ctrl; | ||
30 | |||
31 | /* shut down JobRs */ | ||
32 | for (ring = 0; ring < ctrlpriv->total_jobrs; ring++) { | ||
33 | ret |= caam_jr_shutdown(ctrlpriv->jrdev[ring]); | ||
34 | jrpriv = dev_get_drvdata(ctrlpriv->jrdev[ring]); | ||
35 | irq_dispose_mapping(jrpriv->irq); | ||
36 | } | ||
37 | |||
38 | /* Shut down debug views */ | ||
39 | #ifdef CONFIG_DEBUG_FS | ||
40 | debugfs_remove_recursive(ctrlpriv->dfs_root); | ||
41 | #endif | ||
42 | |||
43 | /* Unmap controller region */ | ||
44 | iounmap(&topregs->ctrl); | ||
45 | |||
46 | kfree(ctrlpriv->jrdev); | ||
47 | kfree(ctrlpriv); | ||
48 | |||
49 | return ret; | ||
50 | } | ||
51 | |||
52 | /* | 19 | /* |
53 | * Descriptor to instantiate RNG State Handle 0 in normal mode and | 20 | * Descriptor to instantiate RNG State Handle 0 in normal mode and |
54 | * load the JDKEK, TDKEK and TDSK registers | 21 | * load the JDKEK, TDKEK and TDSK registers |
55 | */ | 22 | */ |
56 | static void build_instantiation_desc(u32 *desc) | 23 | static void build_instantiation_desc(u32 *desc, int handle, int do_sk) |
57 | { | 24 | { |
58 | u32 *jump_cmd; | 25 | u32 *jump_cmd, op_flags; |
59 | 26 | ||
60 | init_job_desc(desc, 0); | 27 | init_job_desc(desc, 0); |
61 | 28 | ||
29 | op_flags = OP_TYPE_CLASS1_ALG | OP_ALG_ALGSEL_RNG | | ||
30 | (handle << OP_ALG_AAI_SHIFT) | OP_ALG_AS_INIT; | ||
31 | |||
62 | /* INIT RNG in non-test mode */ | 32 | /* INIT RNG in non-test mode */ |
63 | append_operation(desc, OP_TYPE_CLASS1_ALG | OP_ALG_ALGSEL_RNG | | 33 | append_operation(desc, op_flags); |
64 | OP_ALG_AS_INIT); | 34 | |
35 | if (!handle && do_sk) { | ||
36 | /* | ||
37 | * For SH0, Secure Keys must be generated as well | ||
38 | */ | ||
39 | |||
40 | /* wait for done */ | ||
41 | jump_cmd = append_jump(desc, JUMP_CLASS_CLASS1); | ||
42 | set_jump_tgt_here(desc, jump_cmd); | ||
43 | |||
44 | /* | ||
45 | * load 1 to clear written reg: | ||
46 | * resets the done interrrupt and returns the RNG to idle. | ||
47 | */ | ||
48 | append_load_imm_u32(desc, 1, LDST_SRCDST_WORD_CLRW); | ||
49 | |||
50 | /* Initialize State Handle */ | ||
51 | append_operation(desc, OP_TYPE_CLASS1_ALG | OP_ALG_ALGSEL_RNG | | ||
52 | OP_ALG_AAI_RNG4_SK); | ||
53 | } | ||
65 | 54 | ||
66 | /* wait for done */ | 55 | append_jump(desc, JUMP_CLASS_CLASS1 | JUMP_TYPE_HALT); |
67 | jump_cmd = append_jump(desc, JUMP_CLASS_CLASS1); | 56 | } |
68 | set_jump_tgt_here(desc, jump_cmd); | ||
69 | 57 | ||
70 | /* | 58 | /* Descriptor for deinstantiation of State Handle 0 of the RNG block. */ |
71 | * load 1 to clear written reg: | 59 | static void build_deinstantiation_desc(u32 *desc, int handle) |
72 | * resets the done interrupt and returns the RNG to idle. | 60 | { |
73 | */ | 61 | init_job_desc(desc, 0); |
74 | append_load_imm_u32(desc, 1, LDST_SRCDST_WORD_CLRW); | ||
75 | 62 | ||
76 | /* generate secure keys (non-test) */ | 63 | /* Uninstantiate State Handle 0 */ |
77 | append_operation(desc, OP_TYPE_CLASS1_ALG | OP_ALG_ALGSEL_RNG | | 64 | append_operation(desc, OP_TYPE_CLASS1_ALG | OP_ALG_ALGSEL_RNG | |
78 | OP_ALG_RNG4_SK); | 65 | (handle << OP_ALG_AAI_SHIFT) | OP_ALG_AS_INITFINAL); |
66 | |||
67 | append_jump(desc, JUMP_CLASS_CLASS1 | JUMP_TYPE_HALT); | ||
79 | } | 68 | } |
80 | 69 | ||
81 | static int instantiate_rng(struct device *ctrldev) | 70 | /* |
71 | * run_descriptor_deco0 - runs a descriptor on DECO0, under direct control of | ||
72 | * the software (no JR/QI used). | ||
73 | * @ctrldev - pointer to device | ||
74 | * @status - descriptor status, after being run | ||
75 | * | ||
76 | * Return: - 0 if no error occurred | ||
77 | * - -ENODEV if the DECO couldn't be acquired | ||
78 | * - -EAGAIN if an error occurred while executing the descriptor | ||
79 | */ | ||
80 | static inline int run_descriptor_deco0(struct device *ctrldev, u32 *desc, | ||
81 | u32 *status) | ||
82 | { | 82 | { |
83 | struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); | 83 | struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); |
84 | struct caam_full __iomem *topregs; | 84 | struct caam_full __iomem *topregs; |
85 | unsigned int timeout = 100000; | 85 | unsigned int timeout = 100000; |
86 | u32 *desc; | 86 | u32 deco_dbg_reg, flags; |
87 | int i, ret = 0; | 87 | int i; |
88 | |||
89 | desc = kmalloc(CAAM_CMD_SZ * 6, GFP_KERNEL | GFP_DMA); | ||
90 | if (!desc) { | ||
91 | dev_err(ctrldev, "can't allocate RNG init descriptor memory\n"); | ||
92 | return -ENOMEM; | ||
93 | } | ||
94 | build_instantiation_desc(desc); | ||
95 | 88 | ||
96 | /* Set the bit to request direct access to DECO0 */ | 89 | /* Set the bit to request direct access to DECO0 */ |
97 | topregs = (struct caam_full __iomem *)ctrlpriv->ctrl; | 90 | topregs = (struct caam_full __iomem *)ctrlpriv->ctrl; |
@@ -103,36 +96,219 @@ static int instantiate_rng(struct device *ctrldev) | |||
103 | 96 | ||
104 | if (!timeout) { | 97 | if (!timeout) { |
105 | dev_err(ctrldev, "failed to acquire DECO 0\n"); | 98 | dev_err(ctrldev, "failed to acquire DECO 0\n"); |
106 | ret = -EIO; | 99 | clrbits32(&topregs->ctrl.deco_rq, DECORR_RQD0ENABLE); |
107 | goto out; | 100 | return -ENODEV; |
108 | } | 101 | } |
109 | 102 | ||
110 | for (i = 0; i < desc_len(desc); i++) | 103 | for (i = 0; i < desc_len(desc); i++) |
111 | topregs->deco.descbuf[i] = *(desc + i); | 104 | wr_reg32(&topregs->deco.descbuf[i], *(desc + i)); |
105 | |||
106 | flags = DECO_JQCR_WHL; | ||
107 | /* | ||
108 | * If the descriptor length is longer than 4 words, then the | ||
109 | * FOUR bit in JRCTRL register must be set. | ||
110 | */ | ||
111 | if (desc_len(desc) >= 4) | ||
112 | flags |= DECO_JQCR_FOUR; | ||
112 | 113 | ||
113 | wr_reg32(&topregs->deco.jr_ctl_hi, DECO_JQCR_WHL | DECO_JQCR_FOUR); | 114 | /* Instruct the DECO to execute it */ |
115 | wr_reg32(&topregs->deco.jr_ctl_hi, flags); | ||
114 | 116 | ||
115 | timeout = 10000000; | 117 | timeout = 10000000; |
116 | while ((rd_reg32(&topregs->deco.desc_dbg) & DECO_DBG_VALID) && | 118 | do { |
117 | --timeout) | 119 | deco_dbg_reg = rd_reg32(&topregs->deco.desc_dbg); |
120 | /* | ||
121 | * If an error occured in the descriptor, then | ||
122 | * the DECO status field will be set to 0x0D | ||
123 | */ | ||
124 | if ((deco_dbg_reg & DESC_DBG_DECO_STAT_MASK) == | ||
125 | DESC_DBG_DECO_STAT_HOST_ERR) | ||
126 | break; | ||
118 | cpu_relax(); | 127 | cpu_relax(); |
128 | } while ((deco_dbg_reg & DESC_DBG_DECO_STAT_VALID) && --timeout); | ||
119 | 129 | ||
120 | if (!timeout) { | 130 | *status = rd_reg32(&topregs->deco.op_status_hi) & |
121 | dev_err(ctrldev, "failed to instantiate RNG\n"); | 131 | DECO_OP_STATUS_HI_ERR_MASK; |
122 | ret = -EIO; | ||
123 | } | ||
124 | 132 | ||
133 | /* Mark the DECO as free */ | ||
125 | clrbits32(&topregs->ctrl.deco_rq, DECORR_RQD0ENABLE); | 134 | clrbits32(&topregs->ctrl.deco_rq, DECORR_RQD0ENABLE); |
126 | out: | 135 | |
136 | if (!timeout) | ||
137 | return -EAGAIN; | ||
138 | |||
139 | return 0; | ||
140 | } | ||
141 | |||
142 | /* | ||
143 | * instantiate_rng - builds and executes a descriptor on DECO0, | ||
144 | * which initializes the RNG block. | ||
145 | * @ctrldev - pointer to device | ||
146 | * @state_handle_mask - bitmask containing the instantiation status | ||
147 | * for the RNG4 state handles which exist in | ||
148 | * the RNG4 block: 1 if it's been instantiated | ||
149 | * by an external entry, 0 otherwise. | ||
150 | * @gen_sk - generate data to be loaded into the JDKEK, TDKEK and TDSK; | ||
151 | * Caution: this can be done only once; if the keys need to be | ||
152 | * regenerated, a POR is required | ||
153 | * | ||
154 | * Return: - 0 if no error occurred | ||
155 | * - -ENOMEM if there isn't enough memory to allocate the descriptor | ||
156 | * - -ENODEV if DECO0 couldn't be acquired | ||
157 | * - -EAGAIN if an error occurred when executing the descriptor | ||
158 | * f.i. there was a RNG hardware error due to not "good enough" | ||
159 | * entropy being aquired. | ||
160 | */ | ||
161 | static int instantiate_rng(struct device *ctrldev, int state_handle_mask, | ||
162 | int gen_sk) | ||
163 | { | ||
164 | struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); | ||
165 | struct caam_full __iomem *topregs; | ||
166 | struct rng4tst __iomem *r4tst; | ||
167 | u32 *desc, status, rdsta_val; | ||
168 | int ret = 0, sh_idx; | ||
169 | |||
170 | topregs = (struct caam_full __iomem *)ctrlpriv->ctrl; | ||
171 | r4tst = &topregs->ctrl.r4tst[0]; | ||
172 | |||
173 | desc = kmalloc(CAAM_CMD_SZ * 7, GFP_KERNEL); | ||
174 | if (!desc) | ||
175 | return -ENOMEM; | ||
176 | |||
177 | for (sh_idx = 0; sh_idx < RNG4_MAX_HANDLES; sh_idx++) { | ||
178 | /* | ||
179 | * If the corresponding bit is set, this state handle | ||
180 | * was initialized by somebody else, so it's left alone. | ||
181 | */ | ||
182 | if ((1 << sh_idx) & state_handle_mask) | ||
183 | continue; | ||
184 | |||
185 | /* Create the descriptor for instantiating RNG State Handle */ | ||
186 | build_instantiation_desc(desc, sh_idx, gen_sk); | ||
187 | |||
188 | /* Try to run it through DECO0 */ | ||
189 | ret = run_descriptor_deco0(ctrldev, desc, &status); | ||
190 | |||
191 | /* | ||
192 | * If ret is not 0, or descriptor status is not 0, then | ||
193 | * something went wrong. No need to try the next state | ||
194 | * handle (if available), bail out here. | ||
195 | * Also, if for some reason, the State Handle didn't get | ||
196 | * instantiated although the descriptor has finished | ||
197 | * without any error (HW optimizations for later | ||
198 | * CAAM eras), then try again. | ||
199 | */ | ||
200 | rdsta_val = | ||
201 | rd_reg32(&topregs->ctrl.r4tst[0].rdsta) & RDSTA_IFMASK; | ||
202 | if (status || !(rdsta_val & (1 << sh_idx))) | ||
203 | ret = -EAGAIN; | ||
204 | if (ret) | ||
205 | break; | ||
206 | |||
207 | dev_info(ctrldev, "Instantiated RNG4 SH%d\n", sh_idx); | ||
208 | /* Clear the contents before recreating the descriptor */ | ||
209 | memset(desc, 0x00, CAAM_CMD_SZ * 7); | ||
210 | } | ||
211 | |||
127 | kfree(desc); | 212 | kfree(desc); |
213 | |||
128 | return ret; | 214 | return ret; |
129 | } | 215 | } |
130 | 216 | ||
131 | /* | 217 | /* |
132 | * By default, the TRNG runs for 200 clocks per sample; | 218 | * deinstantiate_rng - builds and executes a descriptor on DECO0, |
133 | * 1600 clocks per sample generates better entropy. | 219 | * which deinitializes the RNG block. |
220 | * @ctrldev - pointer to device | ||
221 | * @state_handle_mask - bitmask containing the instantiation status | ||
222 | * for the RNG4 state handles which exist in | ||
223 | * the RNG4 block: 1 if it's been instantiated | ||
224 | * | ||
225 | * Return: - 0 if no error occurred | ||
226 | * - -ENOMEM if there isn't enough memory to allocate the descriptor | ||
227 | * - -ENODEV if DECO0 couldn't be acquired | ||
228 | * - -EAGAIN if an error occurred when executing the descriptor | ||
134 | */ | 229 | */ |
135 | static void kick_trng(struct platform_device *pdev) | 230 | static int deinstantiate_rng(struct device *ctrldev, int state_handle_mask) |
231 | { | ||
232 | u32 *desc, status; | ||
233 | int sh_idx, ret = 0; | ||
234 | |||
235 | desc = kmalloc(CAAM_CMD_SZ * 3, GFP_KERNEL); | ||
236 | if (!desc) | ||
237 | return -ENOMEM; | ||
238 | |||
239 | for (sh_idx = 0; sh_idx < RNG4_MAX_HANDLES; sh_idx++) { | ||
240 | /* | ||
241 | * If the corresponding bit is set, then it means the state | ||
242 | * handle was initialized by us, and thus it needs to be | ||
243 | * deintialized as well | ||
244 | */ | ||
245 | if ((1 << sh_idx) & state_handle_mask) { | ||
246 | /* | ||
247 | * Create the descriptor for deinstantating this state | ||
248 | * handle | ||
249 | */ | ||
250 | build_deinstantiation_desc(desc, sh_idx); | ||
251 | |||
252 | /* Try to run it through DECO0 */ | ||
253 | ret = run_descriptor_deco0(ctrldev, desc, &status); | ||
254 | |||
255 | if (ret || status) { | ||
256 | dev_err(ctrldev, | ||
257 | "Failed to deinstantiate RNG4 SH%d\n", | ||
258 | sh_idx); | ||
259 | break; | ||
260 | } | ||
261 | dev_info(ctrldev, "Deinstantiated RNG4 SH%d\n", sh_idx); | ||
262 | } | ||
263 | } | ||
264 | |||
265 | kfree(desc); | ||
266 | |||
267 | return ret; | ||
268 | } | ||
269 | |||
270 | static int caam_remove(struct platform_device *pdev) | ||
271 | { | ||
272 | struct device *ctrldev; | ||
273 | struct caam_drv_private *ctrlpriv; | ||
274 | struct caam_full __iomem *topregs; | ||
275 | int ring, ret = 0; | ||
276 | |||
277 | ctrldev = &pdev->dev; | ||
278 | ctrlpriv = dev_get_drvdata(ctrldev); | ||
279 | topregs = (struct caam_full __iomem *)ctrlpriv->ctrl; | ||
280 | |||
281 | /* Remove platform devices for JobRs */ | ||
282 | for (ring = 0; ring < ctrlpriv->total_jobrs; ring++) { | ||
283 | if (ctrlpriv->jrpdev[ring]) | ||
284 | of_device_unregister(ctrlpriv->jrpdev[ring]); | ||
285 | } | ||
286 | |||
287 | /* De-initialize RNG state handles initialized by this driver. */ | ||
288 | if (ctrlpriv->rng4_sh_init) | ||
289 | deinstantiate_rng(ctrldev, ctrlpriv->rng4_sh_init); | ||
290 | |||
291 | /* Shut down debug views */ | ||
292 | #ifdef CONFIG_DEBUG_FS | ||
293 | debugfs_remove_recursive(ctrlpriv->dfs_root); | ||
294 | #endif | ||
295 | |||
296 | /* Unmap controller region */ | ||
297 | iounmap(&topregs->ctrl); | ||
298 | |||
299 | kfree(ctrlpriv->jrpdev); | ||
300 | kfree(ctrlpriv); | ||
301 | |||
302 | return ret; | ||
303 | } | ||
304 | |||
305 | /* | ||
306 | * kick_trng - sets the various parameters for enabling the initialization | ||
307 | * of the RNG4 block in CAAM | ||
308 | * @pdev - pointer to the platform device | ||
309 | * @ent_delay - Defines the length (in system clocks) of each entropy sample. | ||
310 | */ | ||
311 | static void kick_trng(struct platform_device *pdev, int ent_delay) | ||
136 | { | 312 | { |
137 | struct device *ctrldev = &pdev->dev; | 313 | struct device *ctrldev = &pdev->dev; |
138 | struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); | 314 | struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); |
@@ -145,14 +321,31 @@ static void kick_trng(struct platform_device *pdev) | |||
145 | 321 | ||
146 | /* put RNG4 into program mode */ | 322 | /* put RNG4 into program mode */ |
147 | setbits32(&r4tst->rtmctl, RTMCTL_PRGM); | 323 | setbits32(&r4tst->rtmctl, RTMCTL_PRGM); |
148 | /* 1600 clocks per sample */ | 324 | |
325 | /* | ||
326 | * Performance-wise, it does not make sense to | ||
327 | * set the delay to a value that is lower | ||
328 | * than the last one that worked (i.e. the state handles | ||
329 | * were instantiated properly. Thus, instead of wasting | ||
330 | * time trying to set the values controlling the sample | ||
331 | * frequency, the function simply returns. | ||
332 | */ | ||
333 | val = (rd_reg32(&r4tst->rtsdctl) & RTSDCTL_ENT_DLY_MASK) | ||
334 | >> RTSDCTL_ENT_DLY_SHIFT; | ||
335 | if (ent_delay <= val) { | ||
336 | /* put RNG4 into run mode */ | ||
337 | clrbits32(&r4tst->rtmctl, RTMCTL_PRGM); | ||
338 | return; | ||
339 | } | ||
340 | |||
149 | val = rd_reg32(&r4tst->rtsdctl); | 341 | val = rd_reg32(&r4tst->rtsdctl); |
150 | val = (val & ~RTSDCTL_ENT_DLY_MASK) | (1600 << RTSDCTL_ENT_DLY_SHIFT); | 342 | val = (val & ~RTSDCTL_ENT_DLY_MASK) | |
343 | (ent_delay << RTSDCTL_ENT_DLY_SHIFT); | ||
151 | wr_reg32(&r4tst->rtsdctl, val); | 344 | wr_reg32(&r4tst->rtsdctl, val); |
152 | /* min. freq. count */ | 345 | /* min. freq. count, equal to 1/4 of the entropy sample length */ |
153 | wr_reg32(&r4tst->rtfrqmin, 400); | 346 | wr_reg32(&r4tst->rtfrqmin, ent_delay >> 2); |
154 | /* max. freq. count */ | 347 | /* max. freq. count, equal to 8 times the entropy sample length */ |
155 | wr_reg32(&r4tst->rtfrqmax, 6400); | 348 | wr_reg32(&r4tst->rtfrqmax, ent_delay << 3); |
156 | /* put RNG4 into run mode */ | 349 | /* put RNG4 into run mode */ |
157 | clrbits32(&r4tst->rtmctl, RTMCTL_PRGM); | 350 | clrbits32(&r4tst->rtmctl, RTMCTL_PRGM); |
158 | } | 351 | } |
@@ -193,7 +386,7 @@ EXPORT_SYMBOL(caam_get_era); | |||
193 | /* Probe routine for CAAM top (controller) level */ | 386 | /* Probe routine for CAAM top (controller) level */ |
194 | static int caam_probe(struct platform_device *pdev) | 387 | static int caam_probe(struct platform_device *pdev) |
195 | { | 388 | { |
196 | int ret, ring, rspec; | 389 | int ret, ring, rspec, gen_sk, ent_delay = RTSDCTL_ENT_DLY_MIN; |
197 | u64 caam_id; | 390 | u64 caam_id; |
198 | struct device *dev; | 391 | struct device *dev; |
199 | struct device_node *nprop, *np; | 392 | struct device_node *nprop, *np; |
@@ -258,8 +451,9 @@ static int caam_probe(struct platform_device *pdev) | |||
258 | rspec++; | 451 | rspec++; |
259 | } | 452 | } |
260 | 453 | ||
261 | ctrlpriv->jrdev = kzalloc(sizeof(struct device *) * rspec, GFP_KERNEL); | 454 | ctrlpriv->jrpdev = kzalloc(sizeof(struct platform_device *) * rspec, |
262 | if (ctrlpriv->jrdev == NULL) { | 455 | GFP_KERNEL); |
456 | if (ctrlpriv->jrpdev == NULL) { | ||
263 | iounmap(&topregs->ctrl); | 457 | iounmap(&topregs->ctrl); |
264 | return -ENOMEM; | 458 | return -ENOMEM; |
265 | } | 459 | } |
@@ -267,13 +461,24 @@ static int caam_probe(struct platform_device *pdev) | |||
267 | ring = 0; | 461 | ring = 0; |
268 | ctrlpriv->total_jobrs = 0; | 462 | ctrlpriv->total_jobrs = 0; |
269 | for_each_compatible_node(np, NULL, "fsl,sec-v4.0-job-ring") { | 463 | for_each_compatible_node(np, NULL, "fsl,sec-v4.0-job-ring") { |
270 | caam_jr_probe(pdev, np, ring); | 464 | ctrlpriv->jrpdev[ring] = |
465 | of_platform_device_create(np, NULL, dev); | ||
466 | if (!ctrlpriv->jrpdev[ring]) { | ||
467 | pr_warn("JR%d Platform device creation error\n", ring); | ||
468 | continue; | ||
469 | } | ||
271 | ctrlpriv->total_jobrs++; | 470 | ctrlpriv->total_jobrs++; |
272 | ring++; | 471 | ring++; |
273 | } | 472 | } |
274 | if (!ring) { | 473 | if (!ring) { |
275 | for_each_compatible_node(np, NULL, "fsl,sec4.0-job-ring") { | 474 | for_each_compatible_node(np, NULL, "fsl,sec4.0-job-ring") { |
276 | caam_jr_probe(pdev, np, ring); | 475 | ctrlpriv->jrpdev[ring] = |
476 | of_platform_device_create(np, NULL, dev); | ||
477 | if (!ctrlpriv->jrpdev[ring]) { | ||
478 | pr_warn("JR%d Platform device creation error\n", | ||
479 | ring); | ||
480 | continue; | ||
481 | } | ||
277 | ctrlpriv->total_jobrs++; | 482 | ctrlpriv->total_jobrs++; |
278 | ring++; | 483 | ring++; |
279 | } | 484 | } |
@@ -299,16 +504,55 @@ static int caam_probe(struct platform_device *pdev) | |||
299 | 504 | ||
300 | /* | 505 | /* |
301 | * If SEC has RNG version >= 4 and RNG state handle has not been | 506 | * If SEC has RNG version >= 4 and RNG state handle has not been |
302 | * already instantiated ,do RNG instantiation | 507 | * already instantiated, do RNG instantiation |
303 | */ | 508 | */ |
304 | if ((cha_vid & CHA_ID_RNG_MASK) >> CHA_ID_RNG_SHIFT >= 4 && | 509 | if ((cha_vid & CHA_ID_RNG_MASK) >> CHA_ID_RNG_SHIFT >= 4) { |
305 | !(rd_reg32(&topregs->ctrl.r4tst[0].rdsta) & RDSTA_IF0)) { | 510 | ctrlpriv->rng4_sh_init = |
306 | kick_trng(pdev); | 511 | rd_reg32(&topregs->ctrl.r4tst[0].rdsta); |
307 | ret = instantiate_rng(dev); | 512 | /* |
513 | * If the secure keys (TDKEK, JDKEK, TDSK), were already | ||
514 | * generated, signal this to the function that is instantiating | ||
515 | * the state handles. An error would occur if RNG4 attempts | ||
516 | * to regenerate these keys before the next POR. | ||
517 | */ | ||
518 | gen_sk = ctrlpriv->rng4_sh_init & RDSTA_SKVN ? 0 : 1; | ||
519 | ctrlpriv->rng4_sh_init &= RDSTA_IFMASK; | ||
520 | do { | ||
521 | int inst_handles = | ||
522 | rd_reg32(&topregs->ctrl.r4tst[0].rdsta) & | ||
523 | RDSTA_IFMASK; | ||
524 | /* | ||
525 | * If either SH were instantiated by somebody else | ||
526 | * (e.g. u-boot) then it is assumed that the entropy | ||
527 | * parameters are properly set and thus the function | ||
528 | * setting these (kick_trng(...)) is skipped. | ||
529 | * Also, if a handle was instantiated, do not change | ||
530 | * the TRNG parameters. | ||
531 | */ | ||
532 | if (!(ctrlpriv->rng4_sh_init || inst_handles)) { | ||
533 | kick_trng(pdev, ent_delay); | ||
534 | ent_delay += 400; | ||
535 | } | ||
536 | /* | ||
537 | * if instantiate_rng(...) fails, the loop will rerun | ||
538 | * and the kick_trng(...) function will modfiy the | ||
539 | * upper and lower limits of the entropy sampling | ||
540 | * interval, leading to a sucessful initialization of | ||
541 | * the RNG. | ||
542 | */ | ||
543 | ret = instantiate_rng(dev, inst_handles, | ||
544 | gen_sk); | ||
545 | } while ((ret == -EAGAIN) && (ent_delay < RTSDCTL_ENT_DLY_MAX)); | ||
308 | if (ret) { | 546 | if (ret) { |
547 | dev_err(dev, "failed to instantiate RNG"); | ||
309 | caam_remove(pdev); | 548 | caam_remove(pdev); |
310 | return ret; | 549 | return ret; |
311 | } | 550 | } |
551 | /* | ||
552 | * Set handles init'ed by this module as the complement of the | ||
553 | * already initialized ones | ||
554 | */ | ||
555 | ctrlpriv->rng4_sh_init = ~ctrlpriv->rng4_sh_init & RDSTA_IFMASK; | ||
312 | 556 | ||
313 | /* Enable RDB bit so that RNG works faster */ | 557 | /* Enable RDB bit so that RNG works faster */ |
314 | setbits32(&topregs->ctrl.scfgr, SCFGR_RDBENABLE); | 558 | setbits32(&topregs->ctrl.scfgr, SCFGR_RDBENABLE); |
diff --git a/drivers/crypto/caam/desc.h b/drivers/crypto/caam/desc.h index 53b296f78b0d..7e4500f18df6 100644 --- a/drivers/crypto/caam/desc.h +++ b/drivers/crypto/caam/desc.h | |||
@@ -1155,8 +1155,15 @@ struct sec4_sg_entry { | |||
1155 | 1155 | ||
1156 | /* randomizer AAI set */ | 1156 | /* randomizer AAI set */ |
1157 | #define OP_ALG_AAI_RNG (0x00 << OP_ALG_AAI_SHIFT) | 1157 | #define OP_ALG_AAI_RNG (0x00 << OP_ALG_AAI_SHIFT) |
1158 | #define OP_ALG_AAI_RNG_NOZERO (0x10 << OP_ALG_AAI_SHIFT) | 1158 | #define OP_ALG_AAI_RNG_NZB (0x10 << OP_ALG_AAI_SHIFT) |
1159 | #define OP_ALG_AAI_RNG_ODD (0x20 << OP_ALG_AAI_SHIFT) | 1159 | #define OP_ALG_AAI_RNG_OBP (0x20 << OP_ALG_AAI_SHIFT) |
1160 | |||
1161 | /* RNG4 AAI set */ | ||
1162 | #define OP_ALG_AAI_RNG4_SH_0 (0x00 << OP_ALG_AAI_SHIFT) | ||
1163 | #define OP_ALG_AAI_RNG4_SH_1 (0x01 << OP_ALG_AAI_SHIFT) | ||
1164 | #define OP_ALG_AAI_RNG4_PS (0x40 << OP_ALG_AAI_SHIFT) | ||
1165 | #define OP_ALG_AAI_RNG4_AI (0x80 << OP_ALG_AAI_SHIFT) | ||
1166 | #define OP_ALG_AAI_RNG4_SK (0x100 << OP_ALG_AAI_SHIFT) | ||
1160 | 1167 | ||
1161 | /* hmac/smac AAI set */ | 1168 | /* hmac/smac AAI set */ |
1162 | #define OP_ALG_AAI_HASH (0x00 << OP_ALG_AAI_SHIFT) | 1169 | #define OP_ALG_AAI_HASH (0x00 << OP_ALG_AAI_SHIFT) |
@@ -1178,12 +1185,6 @@ struct sec4_sg_entry { | |||
1178 | #define OP_ALG_AAI_GSM (0x10 << OP_ALG_AAI_SHIFT) | 1185 | #define OP_ALG_AAI_GSM (0x10 << OP_ALG_AAI_SHIFT) |
1179 | #define OP_ALG_AAI_EDGE (0x20 << OP_ALG_AAI_SHIFT) | 1186 | #define OP_ALG_AAI_EDGE (0x20 << OP_ALG_AAI_SHIFT) |
1180 | 1187 | ||
1181 | /* RNG4 set */ | ||
1182 | #define OP_ALG_RNG4_SHIFT 4 | ||
1183 | #define OP_ALG_RNG4_MASK (0x1f3 << OP_ALG_RNG4_SHIFT) | ||
1184 | |||
1185 | #define OP_ALG_RNG4_SK (0x100 << OP_ALG_RNG4_SHIFT) | ||
1186 | |||
1187 | #define OP_ALG_AS_SHIFT 2 | 1188 | #define OP_ALG_AS_SHIFT 2 |
1188 | #define OP_ALG_AS_MASK (0x3 << OP_ALG_AS_SHIFT) | 1189 | #define OP_ALG_AS_MASK (0x3 << OP_ALG_AS_SHIFT) |
1189 | #define OP_ALG_AS_UPDATE (0 << OP_ALG_AS_SHIFT) | 1190 | #define OP_ALG_AS_UPDATE (0 << OP_ALG_AS_SHIFT) |
diff --git a/drivers/crypto/caam/intern.h b/drivers/crypto/caam/intern.h index 34c4b9f7fbfa..6d85fcc5bd0a 100644 --- a/drivers/crypto/caam/intern.h +++ b/drivers/crypto/caam/intern.h | |||
@@ -37,13 +37,16 @@ struct caam_jrentry_info { | |||
37 | 37 | ||
38 | /* Private sub-storage for a single JobR */ | 38 | /* Private sub-storage for a single JobR */ |
39 | struct caam_drv_private_jr { | 39 | struct caam_drv_private_jr { |
40 | struct device *parentdev; /* points back to controller dev */ | 40 | struct list_head list_node; /* Job Ring device list */ |
41 | struct platform_device *jr_pdev;/* points to platform device for JR */ | 41 | struct device *dev; |
42 | int ridx; | 42 | int ridx; |
43 | struct caam_job_ring __iomem *rregs; /* JobR's register space */ | 43 | struct caam_job_ring __iomem *rregs; /* JobR's register space */ |
44 | struct tasklet_struct irqtask; | 44 | struct tasklet_struct irqtask; |
45 | int irq; /* One per queue */ | 45 | int irq; /* One per queue */ |
46 | 46 | ||
47 | /* Number of scatterlist crypt transforms active on the JobR */ | ||
48 | atomic_t tfm_count ____cacheline_aligned; | ||
49 | |||
47 | /* Job ring info */ | 50 | /* Job ring info */ |
48 | int ringsize; /* Size of rings (assume input = output) */ | 51 | int ringsize; /* Size of rings (assume input = output) */ |
49 | struct caam_jrentry_info *entinfo; /* Alloc'ed 1 per ring entry */ | 52 | struct caam_jrentry_info *entinfo; /* Alloc'ed 1 per ring entry */ |
@@ -63,7 +66,7 @@ struct caam_drv_private_jr { | |||
63 | struct caam_drv_private { | 66 | struct caam_drv_private { |
64 | 67 | ||
65 | struct device *dev; | 68 | struct device *dev; |
66 | struct device **jrdev; /* Alloc'ed array per sub-device */ | 69 | struct platform_device **jrpdev; /* Alloc'ed array per sub-device */ |
67 | struct platform_device *pdev; | 70 | struct platform_device *pdev; |
68 | 71 | ||
69 | /* Physical-presence section */ | 72 | /* Physical-presence section */ |
@@ -80,12 +83,11 @@ struct caam_drv_private { | |||
80 | u8 qi_present; /* Nonzero if QI present in device */ | 83 | u8 qi_present; /* Nonzero if QI present in device */ |
81 | int secvio_irq; /* Security violation interrupt number */ | 84 | int secvio_irq; /* Security violation interrupt number */ |
82 | 85 | ||
83 | /* which jr allocated to scatterlist crypto */ | 86 | #define RNG4_MAX_HANDLES 2 |
84 | atomic_t tfm_count ____cacheline_aligned; | 87 | /* RNG4 block */ |
85 | /* list of registered crypto algorithms (mk generic context handle?) */ | 88 | u32 rng4_sh_init; /* This bitmap shows which of the State |
86 | struct list_head alg_list; | 89 | Handles of the RNG4 block are initialized |
87 | /* list of registered hash algorithms (mk generic context handle?) */ | 90 | by this driver */ |
88 | struct list_head hash_list; | ||
89 | 91 | ||
90 | /* | 92 | /* |
91 | * debugfs entries for developer view into driver/device | 93 | * debugfs entries for developer view into driver/device |
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c index bdb786d5a5e5..1d80bd3636c5 100644 --- a/drivers/crypto/caam/jr.c +++ b/drivers/crypto/caam/jr.c | |||
@@ -6,6 +6,7 @@ | |||
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/of_irq.h> | 8 | #include <linux/of_irq.h> |
9 | #include <linux/of_address.h> | ||
9 | 10 | ||
10 | #include "compat.h" | 11 | #include "compat.h" |
11 | #include "regs.h" | 12 | #include "regs.h" |
@@ -13,6 +14,113 @@ | |||
13 | #include "desc.h" | 14 | #include "desc.h" |
14 | #include "intern.h" | 15 | #include "intern.h" |
15 | 16 | ||
17 | struct jr_driver_data { | ||
18 | /* List of Physical JobR's with the Driver */ | ||
19 | struct list_head jr_list; | ||
20 | spinlock_t jr_alloc_lock; /* jr_list lock */ | ||
21 | } ____cacheline_aligned; | ||
22 | |||
23 | static struct jr_driver_data driver_data; | ||
24 | |||
25 | static int caam_reset_hw_jr(struct device *dev) | ||
26 | { | ||
27 | struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); | ||
28 | unsigned int timeout = 100000; | ||
29 | |||
30 | /* | ||
31 | * mask interrupts since we are going to poll | ||
32 | * for reset completion status | ||
33 | */ | ||
34 | setbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK); | ||
35 | |||
36 | /* initiate flush (required prior to reset) */ | ||
37 | wr_reg32(&jrp->rregs->jrcommand, JRCR_RESET); | ||
38 | while (((rd_reg32(&jrp->rregs->jrintstatus) & JRINT_ERR_HALT_MASK) == | ||
39 | JRINT_ERR_HALT_INPROGRESS) && --timeout) | ||
40 | cpu_relax(); | ||
41 | |||
42 | if ((rd_reg32(&jrp->rregs->jrintstatus) & JRINT_ERR_HALT_MASK) != | ||
43 | JRINT_ERR_HALT_COMPLETE || timeout == 0) { | ||
44 | dev_err(dev, "failed to flush job ring %d\n", jrp->ridx); | ||
45 | return -EIO; | ||
46 | } | ||
47 | |||
48 | /* initiate reset */ | ||
49 | timeout = 100000; | ||
50 | wr_reg32(&jrp->rregs->jrcommand, JRCR_RESET); | ||
51 | while ((rd_reg32(&jrp->rregs->jrcommand) & JRCR_RESET) && --timeout) | ||
52 | cpu_relax(); | ||
53 | |||
54 | if (timeout == 0) { | ||
55 | dev_err(dev, "failed to reset job ring %d\n", jrp->ridx); | ||
56 | return -EIO; | ||
57 | } | ||
58 | |||
59 | /* unmask interrupts */ | ||
60 | clrbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK); | ||
61 | |||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | /* | ||
66 | * Shutdown JobR independent of platform property code | ||
67 | */ | ||
68 | int caam_jr_shutdown(struct device *dev) | ||
69 | { | ||
70 | struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); | ||
71 | dma_addr_t inpbusaddr, outbusaddr; | ||
72 | int ret; | ||
73 | |||
74 | ret = caam_reset_hw_jr(dev); | ||
75 | |||
76 | tasklet_kill(&jrp->irqtask); | ||
77 | |||
78 | /* Release interrupt */ | ||
79 | free_irq(jrp->irq, dev); | ||
80 | |||
81 | /* Free rings */ | ||
82 | inpbusaddr = rd_reg64(&jrp->rregs->inpring_base); | ||
83 | outbusaddr = rd_reg64(&jrp->rregs->outring_base); | ||
84 | dma_free_coherent(dev, sizeof(dma_addr_t) * JOBR_DEPTH, | ||
85 | jrp->inpring, inpbusaddr); | ||
86 | dma_free_coherent(dev, sizeof(struct jr_outentry) * JOBR_DEPTH, | ||
87 | jrp->outring, outbusaddr); | ||
88 | kfree(jrp->entinfo); | ||
89 | |||
90 | return ret; | ||
91 | } | ||
92 | |||
93 | static int caam_jr_remove(struct platform_device *pdev) | ||
94 | { | ||
95 | int ret; | ||
96 | struct device *jrdev; | ||
97 | struct caam_drv_private_jr *jrpriv; | ||
98 | |||
99 | jrdev = &pdev->dev; | ||
100 | jrpriv = dev_get_drvdata(jrdev); | ||
101 | |||
102 | /* | ||
103 | * Return EBUSY if job ring already allocated. | ||
104 | */ | ||
105 | if (atomic_read(&jrpriv->tfm_count)) { | ||
106 | dev_err(jrdev, "Device is busy\n"); | ||
107 | return -EBUSY; | ||
108 | } | ||
109 | |||
110 | /* Remove the node from Physical JobR list maintained by driver */ | ||
111 | spin_lock(&driver_data.jr_alloc_lock); | ||
112 | list_del(&jrpriv->list_node); | ||
113 | spin_unlock(&driver_data.jr_alloc_lock); | ||
114 | |||
115 | /* Release ring */ | ||
116 | ret = caam_jr_shutdown(jrdev); | ||
117 | if (ret) | ||
118 | dev_err(jrdev, "Failed to shut down job ring\n"); | ||
119 | irq_dispose_mapping(jrpriv->irq); | ||
120 | |||
121 | return ret; | ||
122 | } | ||
123 | |||
16 | /* Main per-ring interrupt handler */ | 124 | /* Main per-ring interrupt handler */ |
17 | static irqreturn_t caam_jr_interrupt(int irq, void *st_dev) | 125 | static irqreturn_t caam_jr_interrupt(int irq, void *st_dev) |
18 | { | 126 | { |
@@ -128,6 +236,59 @@ static void caam_jr_dequeue(unsigned long devarg) | |||
128 | } | 236 | } |
129 | 237 | ||
130 | /** | 238 | /** |
239 | * caam_jr_alloc() - Alloc a job ring for someone to use as needed. | ||
240 | * | ||
241 | * returns : pointer to the newly allocated physical | ||
242 | * JobR dev can be written to if successful. | ||
243 | **/ | ||
244 | struct device *caam_jr_alloc(void) | ||
245 | { | ||
246 | struct caam_drv_private_jr *jrpriv, *min_jrpriv = NULL; | ||
247 | struct device *dev = NULL; | ||
248 | int min_tfm_cnt = INT_MAX; | ||
249 | int tfm_cnt; | ||
250 | |||
251 | spin_lock(&driver_data.jr_alloc_lock); | ||
252 | |||
253 | if (list_empty(&driver_data.jr_list)) { | ||
254 | spin_unlock(&driver_data.jr_alloc_lock); | ||
255 | return ERR_PTR(-ENODEV); | ||
256 | } | ||
257 | |||
258 | list_for_each_entry(jrpriv, &driver_data.jr_list, list_node) { | ||
259 | tfm_cnt = atomic_read(&jrpriv->tfm_count); | ||
260 | if (tfm_cnt < min_tfm_cnt) { | ||
261 | min_tfm_cnt = tfm_cnt; | ||
262 | min_jrpriv = jrpriv; | ||
263 | } | ||
264 | if (!min_tfm_cnt) | ||
265 | break; | ||
266 | } | ||
267 | |||
268 | if (min_jrpriv) { | ||
269 | atomic_inc(&min_jrpriv->tfm_count); | ||
270 | dev = min_jrpriv->dev; | ||
271 | } | ||
272 | spin_unlock(&driver_data.jr_alloc_lock); | ||
273 | |||
274 | return dev; | ||
275 | } | ||
276 | EXPORT_SYMBOL(caam_jr_alloc); | ||
277 | |||
278 | /** | ||
279 | * caam_jr_free() - Free the Job Ring | ||
280 | * @rdev - points to the dev that identifies the Job ring to | ||
281 | * be released. | ||
282 | **/ | ||
283 | void caam_jr_free(struct device *rdev) | ||
284 | { | ||
285 | struct caam_drv_private_jr *jrpriv = dev_get_drvdata(rdev); | ||
286 | |||
287 | atomic_dec(&jrpriv->tfm_count); | ||
288 | } | ||
289 | EXPORT_SYMBOL(caam_jr_free); | ||
290 | |||
291 | /** | ||
131 | * caam_jr_enqueue() - Enqueue a job descriptor head. Returns 0 if OK, | 292 | * caam_jr_enqueue() - Enqueue a job descriptor head. Returns 0 if OK, |
132 | * -EBUSY if the queue is full, -EIO if it cannot map the caller's | 293 | * -EBUSY if the queue is full, -EIO if it cannot map the caller's |
133 | * descriptor. | 294 | * descriptor. |
@@ -207,46 +368,6 @@ int caam_jr_enqueue(struct device *dev, u32 *desc, | |||
207 | } | 368 | } |
208 | EXPORT_SYMBOL(caam_jr_enqueue); | 369 | EXPORT_SYMBOL(caam_jr_enqueue); |
209 | 370 | ||
210 | static int caam_reset_hw_jr(struct device *dev) | ||
211 | { | ||
212 | struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); | ||
213 | unsigned int timeout = 100000; | ||
214 | |||
215 | /* | ||
216 | * mask interrupts since we are going to poll | ||
217 | * for reset completion status | ||
218 | */ | ||
219 | setbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK); | ||
220 | |||
221 | /* initiate flush (required prior to reset) */ | ||
222 | wr_reg32(&jrp->rregs->jrcommand, JRCR_RESET); | ||
223 | while (((rd_reg32(&jrp->rregs->jrintstatus) & JRINT_ERR_HALT_MASK) == | ||
224 | JRINT_ERR_HALT_INPROGRESS) && --timeout) | ||
225 | cpu_relax(); | ||
226 | |||
227 | if ((rd_reg32(&jrp->rregs->jrintstatus) & JRINT_ERR_HALT_MASK) != | ||
228 | JRINT_ERR_HALT_COMPLETE || timeout == 0) { | ||
229 | dev_err(dev, "failed to flush job ring %d\n", jrp->ridx); | ||
230 | return -EIO; | ||
231 | } | ||
232 | |||
233 | /* initiate reset */ | ||
234 | timeout = 100000; | ||
235 | wr_reg32(&jrp->rregs->jrcommand, JRCR_RESET); | ||
236 | while ((rd_reg32(&jrp->rregs->jrcommand) & JRCR_RESET) && --timeout) | ||
237 | cpu_relax(); | ||
238 | |||
239 | if (timeout == 0) { | ||
240 | dev_err(dev, "failed to reset job ring %d\n", jrp->ridx); | ||
241 | return -EIO; | ||
242 | } | ||
243 | |||
244 | /* unmask interrupts */ | ||
245 | clrbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK); | ||
246 | |||
247 | return 0; | ||
248 | } | ||
249 | |||
250 | /* | 371 | /* |
251 | * Init JobR independent of platform property detection | 372 | * Init JobR independent of platform property detection |
252 | */ | 373 | */ |
@@ -262,7 +383,7 @@ static int caam_jr_init(struct device *dev) | |||
262 | 383 | ||
263 | /* Connect job ring interrupt handler. */ | 384 | /* Connect job ring interrupt handler. */ |
264 | error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED, | 385 | error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED, |
265 | "caam-jobr", dev); | 386 | dev_name(dev), dev); |
266 | if (error) { | 387 | if (error) { |
267 | dev_err(dev, "can't connect JobR %d interrupt (%d)\n", | 388 | dev_err(dev, "can't connect JobR %d interrupt (%d)\n", |
268 | jrp->ridx, jrp->irq); | 389 | jrp->ridx, jrp->irq); |
@@ -318,86 +439,43 @@ static int caam_jr_init(struct device *dev) | |||
318 | return 0; | 439 | return 0; |
319 | } | 440 | } |
320 | 441 | ||
321 | /* | ||
322 | * Shutdown JobR independent of platform property code | ||
323 | */ | ||
324 | int caam_jr_shutdown(struct device *dev) | ||
325 | { | ||
326 | struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); | ||
327 | dma_addr_t inpbusaddr, outbusaddr; | ||
328 | int ret; | ||
329 | |||
330 | ret = caam_reset_hw_jr(dev); | ||
331 | |||
332 | tasklet_kill(&jrp->irqtask); | ||
333 | |||
334 | /* Release interrupt */ | ||
335 | free_irq(jrp->irq, dev); | ||
336 | |||
337 | /* Free rings */ | ||
338 | inpbusaddr = rd_reg64(&jrp->rregs->inpring_base); | ||
339 | outbusaddr = rd_reg64(&jrp->rregs->outring_base); | ||
340 | dma_free_coherent(dev, sizeof(dma_addr_t) * JOBR_DEPTH, | ||
341 | jrp->inpring, inpbusaddr); | ||
342 | dma_free_coherent(dev, sizeof(struct jr_outentry) * JOBR_DEPTH, | ||
343 | jrp->outring, outbusaddr); | ||
344 | kfree(jrp->entinfo); | ||
345 | of_device_unregister(jrp->jr_pdev); | ||
346 | |||
347 | return ret; | ||
348 | } | ||
349 | 442 | ||
350 | /* | 443 | /* |
351 | * Probe routine for each detected JobR subsystem. It assumes that | 444 | * Probe routine for each detected JobR subsystem. |
352 | * property detection was picked up externally. | ||
353 | */ | 445 | */ |
354 | int caam_jr_probe(struct platform_device *pdev, struct device_node *np, | 446 | static int caam_jr_probe(struct platform_device *pdev) |
355 | int ring) | ||
356 | { | 447 | { |
357 | struct device *ctrldev, *jrdev; | 448 | struct device *jrdev; |
358 | struct platform_device *jr_pdev; | 449 | struct device_node *nprop; |
359 | struct caam_drv_private *ctrlpriv; | 450 | struct caam_job_ring __iomem *ctrl; |
360 | struct caam_drv_private_jr *jrpriv; | 451 | struct caam_drv_private_jr *jrpriv; |
361 | u32 *jroffset; | 452 | static int total_jobrs; |
362 | int error; | 453 | int error; |
363 | 454 | ||
364 | ctrldev = &pdev->dev; | 455 | jrdev = &pdev->dev; |
365 | ctrlpriv = dev_get_drvdata(ctrldev); | ||
366 | |||
367 | jrpriv = kmalloc(sizeof(struct caam_drv_private_jr), | 456 | jrpriv = kmalloc(sizeof(struct caam_drv_private_jr), |
368 | GFP_KERNEL); | 457 | GFP_KERNEL); |
369 | if (jrpriv == NULL) { | 458 | if (!jrpriv) |
370 | dev_err(ctrldev, "can't alloc private mem for job ring %d\n", | ||
371 | ring); | ||
372 | return -ENOMEM; | 459 | return -ENOMEM; |
373 | } | ||
374 | jrpriv->parentdev = ctrldev; /* point back to parent */ | ||
375 | jrpriv->ridx = ring; /* save ring identity relative to detection */ | ||
376 | 460 | ||
377 | /* | 461 | dev_set_drvdata(jrdev, jrpriv); |
378 | * Derive a pointer to the detected JobRs regs | ||
379 | * Driver has already iomapped the entire space, we just | ||
380 | * need to add in the offset to this JobR. Don't know if I | ||
381 | * like this long-term, but it'll run | ||
382 | */ | ||
383 | jroffset = (u32 *)of_get_property(np, "reg", NULL); | ||
384 | jrpriv->rregs = (struct caam_job_ring __iomem *)((void *)ctrlpriv->ctrl | ||
385 | + *jroffset); | ||
386 | 462 | ||
387 | /* Build a local dev for each detected queue */ | 463 | /* save ring identity relative to detection */ |
388 | jr_pdev = of_platform_device_create(np, NULL, ctrldev); | 464 | jrpriv->ridx = total_jobrs++; |
389 | if (jr_pdev == NULL) { | 465 | |
390 | kfree(jrpriv); | 466 | nprop = pdev->dev.of_node; |
391 | return -EINVAL; | 467 | /* Get configuration properties from device tree */ |
468 | /* First, get register page */ | ||
469 | ctrl = of_iomap(nprop, 0); | ||
470 | if (!ctrl) { | ||
471 | dev_err(jrdev, "of_iomap() failed\n"); | ||
472 | return -ENOMEM; | ||
392 | } | 473 | } |
393 | 474 | ||
394 | jrpriv->jr_pdev = jr_pdev; | 475 | jrpriv->rregs = (struct caam_job_ring __force *)ctrl; |
395 | jrdev = &jr_pdev->dev; | ||
396 | dev_set_drvdata(jrdev, jrpriv); | ||
397 | ctrlpriv->jrdev[ring] = jrdev; | ||
398 | 476 | ||
399 | if (sizeof(dma_addr_t) == sizeof(u64)) | 477 | if (sizeof(dma_addr_t) == sizeof(u64)) |
400 | if (of_device_is_compatible(np, "fsl,sec-v5.0-job-ring")) | 478 | if (of_device_is_compatible(nprop, "fsl,sec-v5.0-job-ring")) |
401 | dma_set_mask(jrdev, DMA_BIT_MASK(40)); | 479 | dma_set_mask(jrdev, DMA_BIT_MASK(40)); |
402 | else | 480 | else |
403 | dma_set_mask(jrdev, DMA_BIT_MASK(36)); | 481 | dma_set_mask(jrdev, DMA_BIT_MASK(36)); |
@@ -405,15 +483,61 @@ int caam_jr_probe(struct platform_device *pdev, struct device_node *np, | |||
405 | dma_set_mask(jrdev, DMA_BIT_MASK(32)); | 483 | dma_set_mask(jrdev, DMA_BIT_MASK(32)); |
406 | 484 | ||
407 | /* Identify the interrupt */ | 485 | /* Identify the interrupt */ |
408 | jrpriv->irq = irq_of_parse_and_map(np, 0); | 486 | jrpriv->irq = irq_of_parse_and_map(nprop, 0); |
409 | 487 | ||
410 | /* Now do the platform independent part */ | 488 | /* Now do the platform independent part */ |
411 | error = caam_jr_init(jrdev); /* now turn on hardware */ | 489 | error = caam_jr_init(jrdev); /* now turn on hardware */ |
412 | if (error) { | 490 | if (error) { |
413 | of_device_unregister(jr_pdev); | ||
414 | kfree(jrpriv); | 491 | kfree(jrpriv); |
415 | return error; | 492 | return error; |
416 | } | 493 | } |
417 | 494 | ||
418 | return error; | 495 | jrpriv->dev = jrdev; |
496 | spin_lock(&driver_data.jr_alloc_lock); | ||
497 | list_add_tail(&jrpriv->list_node, &driver_data.jr_list); | ||
498 | spin_unlock(&driver_data.jr_alloc_lock); | ||
499 | |||
500 | atomic_set(&jrpriv->tfm_count, 0); | ||
501 | |||
502 | return 0; | ||
503 | } | ||
504 | |||
505 | static struct of_device_id caam_jr_match[] = { | ||
506 | { | ||
507 | .compatible = "fsl,sec-v4.0-job-ring", | ||
508 | }, | ||
509 | { | ||
510 | .compatible = "fsl,sec4.0-job-ring", | ||
511 | }, | ||
512 | {}, | ||
513 | }; | ||
514 | MODULE_DEVICE_TABLE(of, caam_jr_match); | ||
515 | |||
516 | static struct platform_driver caam_jr_driver = { | ||
517 | .driver = { | ||
518 | .name = "caam_jr", | ||
519 | .owner = THIS_MODULE, | ||
520 | .of_match_table = caam_jr_match, | ||
521 | }, | ||
522 | .probe = caam_jr_probe, | ||
523 | .remove = caam_jr_remove, | ||
524 | }; | ||
525 | |||
526 | static int __init jr_driver_init(void) | ||
527 | { | ||
528 | spin_lock_init(&driver_data.jr_alloc_lock); | ||
529 | INIT_LIST_HEAD(&driver_data.jr_list); | ||
530 | return platform_driver_register(&caam_jr_driver); | ||
531 | } | ||
532 | |||
533 | static void __exit jr_driver_exit(void) | ||
534 | { | ||
535 | platform_driver_unregister(&caam_jr_driver); | ||
419 | } | 536 | } |
537 | |||
538 | module_init(jr_driver_init); | ||
539 | module_exit(jr_driver_exit); | ||
540 | |||
541 | MODULE_LICENSE("GPL"); | ||
542 | MODULE_DESCRIPTION("FSL CAAM JR request backend"); | ||
543 | MODULE_AUTHOR("Freescale Semiconductor - NMG/STC"); | ||
diff --git a/drivers/crypto/caam/jr.h b/drivers/crypto/caam/jr.h index 9d8741a59037..97113a6d6c58 100644 --- a/drivers/crypto/caam/jr.h +++ b/drivers/crypto/caam/jr.h | |||
@@ -8,12 +8,11 @@ | |||
8 | #define JR_H | 8 | #define JR_H |
9 | 9 | ||
10 | /* Prototypes for backend-level services exposed to APIs */ | 10 | /* Prototypes for backend-level services exposed to APIs */ |
11 | struct device *caam_jr_alloc(void); | ||
12 | void caam_jr_free(struct device *rdev); | ||
11 | int caam_jr_enqueue(struct device *dev, u32 *desc, | 13 | int caam_jr_enqueue(struct device *dev, u32 *desc, |
12 | void (*cbk)(struct device *dev, u32 *desc, u32 status, | 14 | void (*cbk)(struct device *dev, u32 *desc, u32 status, |
13 | void *areq), | 15 | void *areq), |
14 | void *areq); | 16 | void *areq); |
15 | 17 | ||
16 | extern int caam_jr_probe(struct platform_device *pdev, struct device_node *np, | ||
17 | int ring); | ||
18 | extern int caam_jr_shutdown(struct device *dev); | ||
19 | #endif /* JR_H */ | 18 | #endif /* JR_H */ |
diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h index 4455396918de..d50174f45b21 100644 --- a/drivers/crypto/caam/regs.h +++ b/drivers/crypto/caam/regs.h | |||
@@ -245,7 +245,7 @@ struct rngtst { | |||
245 | 245 | ||
246 | /* RNG4 TRNG test registers */ | 246 | /* RNG4 TRNG test registers */ |
247 | struct rng4tst { | 247 | struct rng4tst { |
248 | #define RTMCTL_PRGM 0x00010000 /* 1 -> program mode, 0 -> run mode */ | 248 | #define RTMCTL_PRGM 0x00010000 /* 1 -> program mode, 0 -> run mode */ |
249 | u32 rtmctl; /* misc. control register */ | 249 | u32 rtmctl; /* misc. control register */ |
250 | u32 rtscmisc; /* statistical check misc. register */ | 250 | u32 rtscmisc; /* statistical check misc. register */ |
251 | u32 rtpkrrng; /* poker range register */ | 251 | u32 rtpkrrng; /* poker range register */ |
@@ -255,6 +255,8 @@ struct rng4tst { | |||
255 | }; | 255 | }; |
256 | #define RTSDCTL_ENT_DLY_SHIFT 16 | 256 | #define RTSDCTL_ENT_DLY_SHIFT 16 |
257 | #define RTSDCTL_ENT_DLY_MASK (0xffff << RTSDCTL_ENT_DLY_SHIFT) | 257 | #define RTSDCTL_ENT_DLY_MASK (0xffff << RTSDCTL_ENT_DLY_SHIFT) |
258 | #define RTSDCTL_ENT_DLY_MIN 1200 | ||
259 | #define RTSDCTL_ENT_DLY_MAX 12800 | ||
258 | u32 rtsdctl; /* seed control register */ | 260 | u32 rtsdctl; /* seed control register */ |
259 | union { | 261 | union { |
260 | u32 rtsblim; /* PRGM=1: sparse bit limit register */ | 262 | u32 rtsblim; /* PRGM=1: sparse bit limit register */ |
@@ -266,7 +268,11 @@ struct rng4tst { | |||
266 | u32 rtfrqcnt; /* PRGM=0: freq. count register */ | 268 | u32 rtfrqcnt; /* PRGM=0: freq. count register */ |
267 | }; | 269 | }; |
268 | u32 rsvd1[40]; | 270 | u32 rsvd1[40]; |
271 | #define RDSTA_SKVT 0x80000000 | ||
272 | #define RDSTA_SKVN 0x40000000 | ||
269 | #define RDSTA_IF0 0x00000001 | 273 | #define RDSTA_IF0 0x00000001 |
274 | #define RDSTA_IF1 0x00000002 | ||
275 | #define RDSTA_IFMASK (RDSTA_IF1 | RDSTA_IF0) | ||
270 | u32 rdsta; | 276 | u32 rdsta; |
271 | u32 rsvd2[15]; | 277 | u32 rsvd2[15]; |
272 | }; | 278 | }; |
@@ -692,6 +698,7 @@ struct caam_deco { | |||
692 | u32 jr_ctl_hi; /* CxJRR - JobR Control Register @800 */ | 698 | u32 jr_ctl_hi; /* CxJRR - JobR Control Register @800 */ |
693 | u32 jr_ctl_lo; | 699 | u32 jr_ctl_lo; |
694 | u64 jr_descaddr; /* CxDADR - JobR Descriptor Address */ | 700 | u64 jr_descaddr; /* CxDADR - JobR Descriptor Address */ |
701 | #define DECO_OP_STATUS_HI_ERR_MASK 0xF00000FF | ||
695 | u32 op_status_hi; /* DxOPSTA - DECO Operation Status */ | 702 | u32 op_status_hi; /* DxOPSTA - DECO Operation Status */ |
696 | u32 op_status_lo; | 703 | u32 op_status_lo; |
697 | u32 rsvd24[2]; | 704 | u32 rsvd24[2]; |
@@ -706,12 +713,13 @@ struct caam_deco { | |||
706 | u32 rsvd29[48]; | 713 | u32 rsvd29[48]; |
707 | u32 descbuf[64]; /* DxDESB - Descriptor buffer */ | 714 | u32 descbuf[64]; /* DxDESB - Descriptor buffer */ |
708 | u32 rscvd30[193]; | 715 | u32 rscvd30[193]; |
716 | #define DESC_DBG_DECO_STAT_HOST_ERR 0x00D00000 | ||
717 | #define DESC_DBG_DECO_STAT_VALID 0x80000000 | ||
718 | #define DESC_DBG_DECO_STAT_MASK 0x00F00000 | ||
709 | u32 desc_dbg; /* DxDDR - DECO Debug Register */ | 719 | u32 desc_dbg; /* DxDDR - DECO Debug Register */ |
710 | u32 rsvd31[126]; | 720 | u32 rsvd31[126]; |
711 | }; | 721 | }; |
712 | 722 | ||
713 | /* DECO DBG Register Valid Bit*/ | ||
714 | #define DECO_DBG_VALID 0x80000000 | ||
715 | #define DECO_JQCR_WHL 0x20000000 | 723 | #define DECO_JQCR_WHL 0x20000000 |
716 | #define DECO_JQCR_FOUR 0x10000000 | 724 | #define DECO_JQCR_FOUR 0x10000000 |
717 | 725 | ||
diff --git a/drivers/crypto/caam/sg_sw_sec4.h b/drivers/crypto/caam/sg_sw_sec4.h index e0037c8ee243..b12ff85f4241 100644 --- a/drivers/crypto/caam/sg_sw_sec4.h +++ b/drivers/crypto/caam/sg_sw_sec4.h | |||
@@ -117,6 +117,21 @@ static int dma_unmap_sg_chained(struct device *dev, struct scatterlist *sg, | |||
117 | return nents; | 117 | return nents; |
118 | } | 118 | } |
119 | 119 | ||
120 | /* Map SG page in kernel virtual address space and copy */ | ||
121 | static inline void sg_map_copy(u8 *dest, struct scatterlist *sg, | ||
122 | int len, int offset) | ||
123 | { | ||
124 | u8 *mapped_addr; | ||
125 | |||
126 | /* | ||
127 | * Page here can be user-space pinned using get_user_pages | ||
128 | * Same must be kmapped before use and kunmapped subsequently | ||
129 | */ | ||
130 | mapped_addr = kmap_atomic(sg_page(sg)); | ||
131 | memcpy(dest, mapped_addr + offset, len); | ||
132 | kunmap_atomic(mapped_addr); | ||
133 | } | ||
134 | |||
120 | /* Copy from len bytes of sg to dest, starting from beginning */ | 135 | /* Copy from len bytes of sg to dest, starting from beginning */ |
121 | static inline void sg_copy(u8 *dest, struct scatterlist *sg, unsigned int len) | 136 | static inline void sg_copy(u8 *dest, struct scatterlist *sg, unsigned int len) |
122 | { | 137 | { |
@@ -124,15 +139,15 @@ static inline void sg_copy(u8 *dest, struct scatterlist *sg, unsigned int len) | |||
124 | int cpy_index = 0, next_cpy_index = current_sg->length; | 139 | int cpy_index = 0, next_cpy_index = current_sg->length; |
125 | 140 | ||
126 | while (next_cpy_index < len) { | 141 | while (next_cpy_index < len) { |
127 | memcpy(dest + cpy_index, (u8 *) sg_virt(current_sg), | 142 | sg_map_copy(dest + cpy_index, current_sg, current_sg->length, |
128 | current_sg->length); | 143 | current_sg->offset); |
129 | current_sg = scatterwalk_sg_next(current_sg); | 144 | current_sg = scatterwalk_sg_next(current_sg); |
130 | cpy_index = next_cpy_index; | 145 | cpy_index = next_cpy_index; |
131 | next_cpy_index += current_sg->length; | 146 | next_cpy_index += current_sg->length; |
132 | } | 147 | } |
133 | if (cpy_index < len) | 148 | if (cpy_index < len) |
134 | memcpy(dest + cpy_index, (u8 *) sg_virt(current_sg), | 149 | sg_map_copy(dest + cpy_index, current_sg, len-cpy_index, |
135 | len - cpy_index); | 150 | current_sg->offset); |
136 | } | 151 | } |
137 | 152 | ||
138 | /* Copy sg data, from to_skip to end, to dest */ | 153 | /* Copy sg data, from to_skip to end, to dest */ |
@@ -140,7 +155,7 @@ static inline void sg_copy_part(u8 *dest, struct scatterlist *sg, | |||
140 | int to_skip, unsigned int end) | 155 | int to_skip, unsigned int end) |
141 | { | 156 | { |
142 | struct scatterlist *current_sg = sg; | 157 | struct scatterlist *current_sg = sg; |
143 | int sg_index, cpy_index; | 158 | int sg_index, cpy_index, offset; |
144 | 159 | ||
145 | sg_index = current_sg->length; | 160 | sg_index = current_sg->length; |
146 | while (sg_index <= to_skip) { | 161 | while (sg_index <= to_skip) { |
@@ -148,9 +163,10 @@ static inline void sg_copy_part(u8 *dest, struct scatterlist *sg, | |||
148 | sg_index += current_sg->length; | 163 | sg_index += current_sg->length; |
149 | } | 164 | } |
150 | cpy_index = sg_index - to_skip; | 165 | cpy_index = sg_index - to_skip; |
151 | memcpy(dest, (u8 *) sg_virt(current_sg) + | 166 | offset = current_sg->offset + current_sg->length - cpy_index; |
152 | current_sg->length - cpy_index, cpy_index); | 167 | sg_map_copy(dest, current_sg, cpy_index, offset); |
153 | current_sg = scatterwalk_sg_next(current_sg); | 168 | if (end - sg_index) { |
154 | if (end - sg_index) | 169 | current_sg = scatterwalk_sg_next(current_sg); |
155 | sg_copy(dest + cpy_index, current_sg, end - sg_index); | 170 | sg_copy(dest + cpy_index, current_sg, end - sg_index); |
171 | } | ||
156 | } | 172 | } |
diff --git a/drivers/crypto/dcp.c b/drivers/crypto/dcp.c index a8a7dd4b0d25..247ab8048f5b 100644 --- a/drivers/crypto/dcp.c +++ b/drivers/crypto/dcp.c | |||
@@ -733,12 +733,9 @@ static int dcp_probe(struct platform_device *pdev) | |||
733 | platform_set_drvdata(pdev, dev); | 733 | platform_set_drvdata(pdev, dev); |
734 | 734 | ||
735 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 735 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
736 | if (!r) { | 736 | dev->dcp_regs_base = devm_ioremap_resource(&pdev->dev, r); |
737 | dev_err(&pdev->dev, "failed to get IORESOURCE_MEM\n"); | 737 | if (IS_ERR(dev->dcp_regs_base)) |
738 | return -ENXIO; | 738 | return PTR_ERR(dev->dcp_regs_base); |
739 | } | ||
740 | dev->dcp_regs_base = devm_ioremap(&pdev->dev, r->start, | ||
741 | resource_size(r)); | ||
742 | 739 | ||
743 | dcp_set(dev, DCP_CTRL_SFRST, DCP_REG_CTRL); | 740 | dcp_set(dev, DCP_CTRL_SFRST, DCP_REG_CTRL); |
744 | udelay(10); | 741 | udelay(10); |
@@ -762,7 +759,8 @@ static int dcp_probe(struct platform_device *pdev) | |||
762 | return -EIO; | 759 | return -EIO; |
763 | } | 760 | } |
764 | dev->dcp_vmi_irq = r->start; | 761 | dev->dcp_vmi_irq = r->start; |
765 | ret = request_irq(dev->dcp_vmi_irq, dcp_vmi_irq, 0, "dcp", dev); | 762 | ret = devm_request_irq(&pdev->dev, dev->dcp_vmi_irq, dcp_vmi_irq, 0, |
763 | "dcp", dev); | ||
766 | if (ret != 0) { | 764 | if (ret != 0) { |
767 | dev_err(&pdev->dev, "can't request_irq (0)\n"); | 765 | dev_err(&pdev->dev, "can't request_irq (0)\n"); |
768 | return -EIO; | 766 | return -EIO; |
@@ -771,15 +769,14 @@ static int dcp_probe(struct platform_device *pdev) | |||
771 | r = platform_get_resource(pdev, IORESOURCE_IRQ, 1); | 769 | r = platform_get_resource(pdev, IORESOURCE_IRQ, 1); |
772 | if (!r) { | 770 | if (!r) { |
773 | dev_err(&pdev->dev, "can't get IRQ resource (1)\n"); | 771 | dev_err(&pdev->dev, "can't get IRQ resource (1)\n"); |
774 | ret = -EIO; | 772 | return -EIO; |
775 | goto err_free_irq0; | ||
776 | } | 773 | } |
777 | dev->dcp_irq = r->start; | 774 | dev->dcp_irq = r->start; |
778 | ret = request_irq(dev->dcp_irq, dcp_irq, 0, "dcp", dev); | 775 | ret = devm_request_irq(&pdev->dev, dev->dcp_irq, dcp_irq, 0, "dcp", |
776 | dev); | ||
779 | if (ret != 0) { | 777 | if (ret != 0) { |
780 | dev_err(&pdev->dev, "can't request_irq (1)\n"); | 778 | dev_err(&pdev->dev, "can't request_irq (1)\n"); |
781 | ret = -EIO; | 779 | return -EIO; |
782 | goto err_free_irq0; | ||
783 | } | 780 | } |
784 | 781 | ||
785 | dev->hw_pkg[0] = dma_alloc_coherent(&pdev->dev, | 782 | dev->hw_pkg[0] = dma_alloc_coherent(&pdev->dev, |
@@ -788,8 +785,7 @@ static int dcp_probe(struct platform_device *pdev) | |||
788 | GFP_KERNEL); | 785 | GFP_KERNEL); |
789 | if (!dev->hw_pkg[0]) { | 786 | if (!dev->hw_pkg[0]) { |
790 | dev_err(&pdev->dev, "Could not allocate hw descriptors\n"); | 787 | dev_err(&pdev->dev, "Could not allocate hw descriptors\n"); |
791 | ret = -ENOMEM; | 788 | return -ENOMEM; |
792 | goto err_free_irq1; | ||
793 | } | 789 | } |
794 | 790 | ||
795 | for (i = 1; i < DCP_MAX_PKG; i++) { | 791 | for (i = 1; i < DCP_MAX_PKG; i++) { |
@@ -848,16 +844,14 @@ err_unregister: | |||
848 | for (j = 0; j < i; j++) | 844 | for (j = 0; j < i; j++) |
849 | crypto_unregister_alg(&algs[j]); | 845 | crypto_unregister_alg(&algs[j]); |
850 | err_free_key_iv: | 846 | err_free_key_iv: |
847 | tasklet_kill(&dev->done_task); | ||
848 | tasklet_kill(&dev->queue_task); | ||
851 | dma_free_coherent(&pdev->dev, 2 * AES_KEYSIZE_128, dev->payload_base, | 849 | dma_free_coherent(&pdev->dev, 2 * AES_KEYSIZE_128, dev->payload_base, |
852 | dev->payload_base_dma); | 850 | dev->payload_base_dma); |
853 | err_free_hw_packet: | 851 | err_free_hw_packet: |
854 | dma_free_coherent(&pdev->dev, DCP_MAX_PKG * | 852 | dma_free_coherent(&pdev->dev, DCP_MAX_PKG * |
855 | sizeof(struct dcp_hw_packet), dev->hw_pkg[0], | 853 | sizeof(struct dcp_hw_packet), dev->hw_pkg[0], |
856 | dev->hw_phys_pkg); | 854 | dev->hw_phys_pkg); |
857 | err_free_irq1: | ||
858 | free_irq(dev->dcp_irq, dev); | ||
859 | err_free_irq0: | ||
860 | free_irq(dev->dcp_vmi_irq, dev); | ||
861 | 855 | ||
862 | return ret; | 856 | return ret; |
863 | } | 857 | } |
@@ -868,23 +862,20 @@ static int dcp_remove(struct platform_device *pdev) | |||
868 | int j; | 862 | int j; |
869 | dev = platform_get_drvdata(pdev); | 863 | dev = platform_get_drvdata(pdev); |
870 | 864 | ||
871 | dma_free_coherent(&pdev->dev, | 865 | misc_deregister(&dev->dcp_bootstream_misc); |
872 | DCP_MAX_PKG * sizeof(struct dcp_hw_packet), | ||
873 | dev->hw_pkg[0], dev->hw_phys_pkg); | ||
874 | |||
875 | dma_free_coherent(&pdev->dev, 2 * AES_KEYSIZE_128, dev->payload_base, | ||
876 | dev->payload_base_dma); | ||
877 | 866 | ||
878 | free_irq(dev->dcp_irq, dev); | 867 | for (j = 0; j < ARRAY_SIZE(algs); j++) |
879 | free_irq(dev->dcp_vmi_irq, dev); | 868 | crypto_unregister_alg(&algs[j]); |
880 | 869 | ||
881 | tasklet_kill(&dev->done_task); | 870 | tasklet_kill(&dev->done_task); |
882 | tasklet_kill(&dev->queue_task); | 871 | tasklet_kill(&dev->queue_task); |
883 | 872 | ||
884 | for (j = 0; j < ARRAY_SIZE(algs); j++) | 873 | dma_free_coherent(&pdev->dev, 2 * AES_KEYSIZE_128, dev->payload_base, |
885 | crypto_unregister_alg(&algs[j]); | 874 | dev->payload_base_dma); |
886 | 875 | ||
887 | misc_deregister(&dev->dcp_bootstream_misc); | 876 | dma_free_coherent(&pdev->dev, |
877 | DCP_MAX_PKG * sizeof(struct dcp_hw_packet), | ||
878 | dev->hw_pkg[0], dev->hw_phys_pkg); | ||
888 | 879 | ||
889 | return 0; | 880 | return 0; |
890 | } | 881 | } |
diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 214357e12dc0..9dd6e01eac33 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c | |||
@@ -1149,32 +1149,24 @@ static int aead_setkey(struct crypto_aead *tfm, const u8 *key, | |||
1149 | unsigned int keylen) | 1149 | unsigned int keylen) |
1150 | { | 1150 | { |
1151 | struct ixp_ctx *ctx = crypto_aead_ctx(tfm); | 1151 | struct ixp_ctx *ctx = crypto_aead_ctx(tfm); |
1152 | struct rtattr *rta = (struct rtattr *)key; | 1152 | struct crypto_authenc_keys keys; |
1153 | struct crypto_authenc_key_param *param; | ||
1154 | 1153 | ||
1155 | if (!RTA_OK(rta, keylen)) | 1154 | if (crypto_authenc_extractkeys(&keys, key, keylen) != 0) |
1156 | goto badkey; | ||
1157 | if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM) | ||
1158 | goto badkey; | ||
1159 | if (RTA_PAYLOAD(rta) < sizeof(*param)) | ||
1160 | goto badkey; | 1155 | goto badkey; |
1161 | 1156 | ||
1162 | param = RTA_DATA(rta); | 1157 | if (keys.authkeylen > sizeof(ctx->authkey)) |
1163 | ctx->enckey_len = be32_to_cpu(param->enckeylen); | 1158 | goto badkey; |
1164 | |||
1165 | key += RTA_ALIGN(rta->rta_len); | ||
1166 | keylen -= RTA_ALIGN(rta->rta_len); | ||
1167 | 1159 | ||
1168 | if (keylen < ctx->enckey_len) | 1160 | if (keys.enckeylen > sizeof(ctx->enckey)) |
1169 | goto badkey; | 1161 | goto badkey; |
1170 | 1162 | ||
1171 | ctx->authkey_len = keylen - ctx->enckey_len; | 1163 | memcpy(ctx->authkey, keys.authkey, keys.authkeylen); |
1172 | memcpy(ctx->enckey, key + ctx->authkey_len, ctx->enckey_len); | 1164 | memcpy(ctx->enckey, keys.enckey, keys.enckeylen); |
1173 | memcpy(ctx->authkey, key, ctx->authkey_len); | 1165 | ctx->authkey_len = keys.authkeylen; |
1166 | ctx->enckey_len = keys.enckeylen; | ||
1174 | 1167 | ||
1175 | return aead_setup(tfm, crypto_aead_authsize(tfm)); | 1168 | return aead_setup(tfm, crypto_aead_authsize(tfm)); |
1176 | badkey: | 1169 | badkey: |
1177 | ctx->enckey_len = 0; | ||
1178 | crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); | 1170 | crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); |
1179 | return -EINVAL; | 1171 | return -EINVAL; |
1180 | } | 1172 | } |
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c index 3374a3ebe4c7..8d1e6f8e9e9c 100644 --- a/drivers/crypto/mv_cesa.c +++ b/drivers/crypto/mv_cesa.c | |||
@@ -907,7 +907,7 @@ static int mv_cra_hash_hmac_sha1_init(struct crypto_tfm *tfm) | |||
907 | return mv_cra_hash_init(tfm, "sha1", COP_HMAC_SHA1, SHA1_BLOCK_SIZE); | 907 | return mv_cra_hash_init(tfm, "sha1", COP_HMAC_SHA1, SHA1_BLOCK_SIZE); |
908 | } | 908 | } |
909 | 909 | ||
910 | irqreturn_t crypto_int(int irq, void *priv) | 910 | static irqreturn_t crypto_int(int irq, void *priv) |
911 | { | 911 | { |
912 | u32 val; | 912 | u32 val; |
913 | 913 | ||
@@ -928,7 +928,7 @@ irqreturn_t crypto_int(int irq, void *priv) | |||
928 | return IRQ_HANDLED; | 928 | return IRQ_HANDLED; |
929 | } | 929 | } |
930 | 930 | ||
931 | struct crypto_alg mv_aes_alg_ecb = { | 931 | static struct crypto_alg mv_aes_alg_ecb = { |
932 | .cra_name = "ecb(aes)", | 932 | .cra_name = "ecb(aes)", |
933 | .cra_driver_name = "mv-ecb-aes", | 933 | .cra_driver_name = "mv-ecb-aes", |
934 | .cra_priority = 300, | 934 | .cra_priority = 300, |
@@ -951,7 +951,7 @@ struct crypto_alg mv_aes_alg_ecb = { | |||
951 | }, | 951 | }, |
952 | }; | 952 | }; |
953 | 953 | ||
954 | struct crypto_alg mv_aes_alg_cbc = { | 954 | static struct crypto_alg mv_aes_alg_cbc = { |
955 | .cra_name = "cbc(aes)", | 955 | .cra_name = "cbc(aes)", |
956 | .cra_driver_name = "mv-cbc-aes", | 956 | .cra_driver_name = "mv-cbc-aes", |
957 | .cra_priority = 300, | 957 | .cra_priority = 300, |
@@ -975,7 +975,7 @@ struct crypto_alg mv_aes_alg_cbc = { | |||
975 | }, | 975 | }, |
976 | }; | 976 | }; |
977 | 977 | ||
978 | struct ahash_alg mv_sha1_alg = { | 978 | static struct ahash_alg mv_sha1_alg = { |
979 | .init = mv_hash_init, | 979 | .init = mv_hash_init, |
980 | .update = mv_hash_update, | 980 | .update = mv_hash_update, |
981 | .final = mv_hash_final, | 981 | .final = mv_hash_final, |
@@ -999,7 +999,7 @@ struct ahash_alg mv_sha1_alg = { | |||
999 | } | 999 | } |
1000 | }; | 1000 | }; |
1001 | 1001 | ||
1002 | struct ahash_alg mv_hmac_sha1_alg = { | 1002 | static struct ahash_alg mv_hmac_sha1_alg = { |
1003 | .init = mv_hash_init, | 1003 | .init = mv_hash_init, |
1004 | .update = mv_hash_update, | 1004 | .update = mv_hash_update, |
1005 | .final = mv_hash_final, | 1005 | .final = mv_hash_final, |
@@ -1084,7 +1084,7 @@ static int mv_probe(struct platform_device *pdev) | |||
1084 | goto err_unmap_sram; | 1084 | goto err_unmap_sram; |
1085 | } | 1085 | } |
1086 | 1086 | ||
1087 | ret = request_irq(irq, crypto_int, IRQF_DISABLED, dev_name(&pdev->dev), | 1087 | ret = request_irq(irq, crypto_int, 0, dev_name(&pdev->dev), |
1088 | cp); | 1088 | cp); |
1089 | if (ret) | 1089 | if (ret) |
1090 | goto err_thread; | 1090 | goto err_thread; |
@@ -1187,7 +1187,7 @@ static struct platform_driver marvell_crypto = { | |||
1187 | .driver = { | 1187 | .driver = { |
1188 | .owner = THIS_MODULE, | 1188 | .owner = THIS_MODULE, |
1189 | .name = "mv_crypto", | 1189 | .name = "mv_crypto", |
1190 | .of_match_table = of_match_ptr(mv_cesa_of_match_table), | 1190 | .of_match_table = mv_cesa_of_match_table, |
1191 | }, | 1191 | }, |
1192 | }; | 1192 | }; |
1193 | MODULE_ALIAS("platform:mv_crypto"); | 1193 | MODULE_ALIAS("platform:mv_crypto"); |
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c index ce791c2f81f7..a9ccbf14096e 100644 --- a/drivers/crypto/omap-aes.c +++ b/drivers/crypto/omap-aes.c | |||
@@ -275,7 +275,7 @@ static int omap_aes_write_ctrl(struct omap_aes_dev *dd) | |||
275 | if (dd->flags & FLAGS_CBC) | 275 | if (dd->flags & FLAGS_CBC) |
276 | val |= AES_REG_CTRL_CBC; | 276 | val |= AES_REG_CTRL_CBC; |
277 | if (dd->flags & FLAGS_CTR) { | 277 | if (dd->flags & FLAGS_CTR) { |
278 | val |= AES_REG_CTRL_CTR | AES_REG_CTRL_CTR_WIDTH_32; | 278 | val |= AES_REG_CTRL_CTR | AES_REG_CTRL_CTR_WIDTH_128; |
279 | mask = AES_REG_CTRL_CTR | AES_REG_CTRL_CTR_WIDTH_MASK; | 279 | mask = AES_REG_CTRL_CTR | AES_REG_CTRL_CTR_WIDTH_MASK; |
280 | } | 280 | } |
281 | if (dd->flags & FLAGS_ENCRYPT) | 281 | if (dd->flags & FLAGS_ENCRYPT) |
@@ -554,7 +554,7 @@ static int omap_aes_crypt_dma_stop(struct omap_aes_dev *dd) | |||
554 | return err; | 554 | return err; |
555 | } | 555 | } |
556 | 556 | ||
557 | int omap_aes_check_aligned(struct scatterlist *sg) | 557 | static int omap_aes_check_aligned(struct scatterlist *sg) |
558 | { | 558 | { |
559 | while (sg) { | 559 | while (sg) { |
560 | if (!IS_ALIGNED(sg->offset, 4)) | 560 | if (!IS_ALIGNED(sg->offset, 4)) |
@@ -566,7 +566,7 @@ int omap_aes_check_aligned(struct scatterlist *sg) | |||
566 | return 0; | 566 | return 0; |
567 | } | 567 | } |
568 | 568 | ||
569 | int omap_aes_copy_sgs(struct omap_aes_dev *dd) | 569 | static int omap_aes_copy_sgs(struct omap_aes_dev *dd) |
570 | { | 570 | { |
571 | void *buf_in, *buf_out; | 571 | void *buf_in, *buf_out; |
572 | int pages; | 572 | int pages; |
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index e28104b4aab0..e45aaaf0db30 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c | |||
@@ -2033,3 +2033,4 @@ module_platform_driver(omap_sham_driver); | |||
2033 | MODULE_DESCRIPTION("OMAP SHA1/MD5 hw acceleration support."); | 2033 | MODULE_DESCRIPTION("OMAP SHA1/MD5 hw acceleration support."); |
2034 | MODULE_LICENSE("GPL v2"); | 2034 | MODULE_LICENSE("GPL v2"); |
2035 | MODULE_AUTHOR("Dmitry Kasatkin"); | 2035 | MODULE_AUTHOR("Dmitry Kasatkin"); |
2036 | MODULE_ALIAS("platform:omap-sham"); | ||
diff --git a/drivers/crypto/picoxcell_crypto.c b/drivers/crypto/picoxcell_crypto.c index 888f7f4a6d3f..a6175ba6d238 100644 --- a/drivers/crypto/picoxcell_crypto.c +++ b/drivers/crypto/picoxcell_crypto.c | |||
@@ -495,45 +495,29 @@ static int spacc_aead_setkey(struct crypto_aead *tfm, const u8 *key, | |||
495 | { | 495 | { |
496 | struct spacc_aead_ctx *ctx = crypto_aead_ctx(tfm); | 496 | struct spacc_aead_ctx *ctx = crypto_aead_ctx(tfm); |
497 | struct spacc_alg *alg = to_spacc_alg(tfm->base.__crt_alg); | 497 | struct spacc_alg *alg = to_spacc_alg(tfm->base.__crt_alg); |
498 | struct rtattr *rta = (void *)key; | 498 | struct crypto_authenc_keys keys; |
499 | struct crypto_authenc_key_param *param; | ||
500 | unsigned int authkeylen, enckeylen; | ||
501 | int err = -EINVAL; | 499 | int err = -EINVAL; |
502 | 500 | ||
503 | if (!RTA_OK(rta, keylen)) | 501 | if (crypto_authenc_extractkeys(&keys, key, keylen) != 0) |
504 | goto badkey; | 502 | goto badkey; |
505 | 503 | ||
506 | if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM) | 504 | if (keys.enckeylen > AES_MAX_KEY_SIZE) |
507 | goto badkey; | 505 | goto badkey; |
508 | 506 | ||
509 | if (RTA_PAYLOAD(rta) < sizeof(*param)) | 507 | if (keys.authkeylen > sizeof(ctx->hash_ctx)) |
510 | goto badkey; | ||
511 | |||
512 | param = RTA_DATA(rta); | ||
513 | enckeylen = be32_to_cpu(param->enckeylen); | ||
514 | |||
515 | key += RTA_ALIGN(rta->rta_len); | ||
516 | keylen -= RTA_ALIGN(rta->rta_len); | ||
517 | |||
518 | if (keylen < enckeylen) | ||
519 | goto badkey; | ||
520 | |||
521 | authkeylen = keylen - enckeylen; | ||
522 | |||
523 | if (enckeylen > AES_MAX_KEY_SIZE) | ||
524 | goto badkey; | 508 | goto badkey; |
525 | 509 | ||
526 | if ((alg->ctrl_default & SPACC_CRYPTO_ALG_MASK) == | 510 | if ((alg->ctrl_default & SPACC_CRYPTO_ALG_MASK) == |
527 | SPA_CTRL_CIPH_ALG_AES) | 511 | SPA_CTRL_CIPH_ALG_AES) |
528 | err = spacc_aead_aes_setkey(tfm, key + authkeylen, enckeylen); | 512 | err = spacc_aead_aes_setkey(tfm, keys.enckey, keys.enckeylen); |
529 | else | 513 | else |
530 | err = spacc_aead_des_setkey(tfm, key + authkeylen, enckeylen); | 514 | err = spacc_aead_des_setkey(tfm, keys.enckey, keys.enckeylen); |
531 | 515 | ||
532 | if (err) | 516 | if (err) |
533 | goto badkey; | 517 | goto badkey; |
534 | 518 | ||
535 | memcpy(ctx->hash_ctx, key, authkeylen); | 519 | memcpy(ctx->hash_ctx, keys.authkey, keys.authkeylen); |
536 | ctx->hash_key_len = authkeylen; | 520 | ctx->hash_key_len = keys.authkeylen; |
537 | 521 | ||
538 | return 0; | 522 | return 0; |
539 | 523 | ||
diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c index d7bb8bac36e9..785a9ded7bdf 100644 --- a/drivers/crypto/sahara.c +++ b/drivers/crypto/sahara.c | |||
@@ -1058,7 +1058,7 @@ static struct platform_driver sahara_driver = { | |||
1058 | .driver = { | 1058 | .driver = { |
1059 | .name = SAHARA_NAME, | 1059 | .name = SAHARA_NAME, |
1060 | .owner = THIS_MODULE, | 1060 | .owner = THIS_MODULE, |
1061 | .of_match_table = of_match_ptr(sahara_dt_ids), | 1061 | .of_match_table = sahara_dt_ids, |
1062 | }, | 1062 | }, |
1063 | .id_table = sahara_platform_ids, | 1063 | .id_table = sahara_platform_ids, |
1064 | }; | 1064 | }; |
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 6cd0e6038583..b44f4ddc565c 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c | |||
@@ -673,39 +673,20 @@ static int aead_setkey(struct crypto_aead *authenc, | |||
673 | const u8 *key, unsigned int keylen) | 673 | const u8 *key, unsigned int keylen) |
674 | { | 674 | { |
675 | struct talitos_ctx *ctx = crypto_aead_ctx(authenc); | 675 | struct talitos_ctx *ctx = crypto_aead_ctx(authenc); |
676 | struct rtattr *rta = (void *)key; | 676 | struct crypto_authenc_keys keys; |
677 | struct crypto_authenc_key_param *param; | ||
678 | unsigned int authkeylen; | ||
679 | unsigned int enckeylen; | ||
680 | |||
681 | if (!RTA_OK(rta, keylen)) | ||
682 | goto badkey; | ||
683 | 677 | ||
684 | if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM) | 678 | if (crypto_authenc_extractkeys(&keys, key, keylen) != 0) |
685 | goto badkey; | 679 | goto badkey; |
686 | 680 | ||
687 | if (RTA_PAYLOAD(rta) < sizeof(*param)) | 681 | if (keys.authkeylen + keys.enckeylen > TALITOS_MAX_KEY_SIZE) |
688 | goto badkey; | 682 | goto badkey; |
689 | 683 | ||
690 | param = RTA_DATA(rta); | 684 | memcpy(ctx->key, keys.authkey, keys.authkeylen); |
691 | enckeylen = be32_to_cpu(param->enckeylen); | 685 | memcpy(&ctx->key[keys.authkeylen], keys.enckey, keys.enckeylen); |
692 | |||
693 | key += RTA_ALIGN(rta->rta_len); | ||
694 | keylen -= RTA_ALIGN(rta->rta_len); | ||
695 | 686 | ||
696 | if (keylen < enckeylen) | 687 | ctx->keylen = keys.authkeylen + keys.enckeylen; |
697 | goto badkey; | 688 | ctx->enckeylen = keys.enckeylen; |
698 | 689 | ctx->authkeylen = keys.authkeylen; | |
699 | authkeylen = keylen - enckeylen; | ||
700 | |||
701 | if (keylen > TALITOS_MAX_KEY_SIZE) | ||
702 | goto badkey; | ||
703 | |||
704 | memcpy(&ctx->key, key, keylen); | ||
705 | |||
706 | ctx->keylen = keylen; | ||
707 | ctx->enckeylen = enckeylen; | ||
708 | ctx->authkeylen = authkeylen; | ||
709 | 690 | ||
710 | return 0; | 691 | return 0; |
711 | 692 | ||
@@ -809,7 +790,7 @@ static void ipsec_esp_unmap(struct device *dev, | |||
809 | 790 | ||
810 | if (edesc->assoc_chained) | 791 | if (edesc->assoc_chained) |
811 | talitos_unmap_sg_chain(dev, areq->assoc, DMA_TO_DEVICE); | 792 | talitos_unmap_sg_chain(dev, areq->assoc, DMA_TO_DEVICE); |
812 | else | 793 | else if (areq->assoclen) |
813 | /* assoc_nents counts also for IV in non-contiguous cases */ | 794 | /* assoc_nents counts also for IV in non-contiguous cases */ |
814 | dma_unmap_sg(dev, areq->assoc, | 795 | dma_unmap_sg(dev, areq->assoc, |
815 | edesc->assoc_nents ? edesc->assoc_nents - 1 : 1, | 796 | edesc->assoc_nents ? edesc->assoc_nents - 1 : 1, |
@@ -992,7 +973,11 @@ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq, | |||
992 | dma_sync_single_for_device(dev, edesc->dma_link_tbl, | 973 | dma_sync_single_for_device(dev, edesc->dma_link_tbl, |
993 | edesc->dma_len, DMA_BIDIRECTIONAL); | 974 | edesc->dma_len, DMA_BIDIRECTIONAL); |
994 | } else { | 975 | } else { |
995 | to_talitos_ptr(&desc->ptr[1], sg_dma_address(areq->assoc)); | 976 | if (areq->assoclen) |
977 | to_talitos_ptr(&desc->ptr[1], | ||
978 | sg_dma_address(areq->assoc)); | ||
979 | else | ||
980 | to_talitos_ptr(&desc->ptr[1], edesc->iv_dma); | ||
996 | desc->ptr[1].j_extent = 0; | 981 | desc->ptr[1].j_extent = 0; |
997 | } | 982 | } |
998 | 983 | ||
@@ -1127,7 +1112,8 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, | |||
1127 | unsigned int authsize, | 1112 | unsigned int authsize, |
1128 | unsigned int ivsize, | 1113 | unsigned int ivsize, |
1129 | int icv_stashing, | 1114 | int icv_stashing, |
1130 | u32 cryptoflags) | 1115 | u32 cryptoflags, |
1116 | bool encrypt) | ||
1131 | { | 1117 | { |
1132 | struct talitos_edesc *edesc; | 1118 | struct talitos_edesc *edesc; |
1133 | int assoc_nents = 0, src_nents, dst_nents, alloc_len, dma_len; | 1119 | int assoc_nents = 0, src_nents, dst_nents, alloc_len, dma_len; |
@@ -1141,10 +1127,10 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, | |||
1141 | return ERR_PTR(-EINVAL); | 1127 | return ERR_PTR(-EINVAL); |
1142 | } | 1128 | } |
1143 | 1129 | ||
1144 | if (iv) | 1130 | if (ivsize) |
1145 | iv_dma = dma_map_single(dev, iv, ivsize, DMA_TO_DEVICE); | 1131 | iv_dma = dma_map_single(dev, iv, ivsize, DMA_TO_DEVICE); |
1146 | 1132 | ||
1147 | if (assoc) { | 1133 | if (assoclen) { |
1148 | /* | 1134 | /* |
1149 | * Currently it is assumed that iv is provided whenever assoc | 1135 | * Currently it is assumed that iv is provided whenever assoc |
1150 | * is. | 1136 | * is. |
@@ -1160,19 +1146,17 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, | |||
1160 | assoc_nents = assoc_nents ? assoc_nents + 1 : 2; | 1146 | assoc_nents = assoc_nents ? assoc_nents + 1 : 2; |
1161 | } | 1147 | } |
1162 | 1148 | ||
1163 | src_nents = sg_count(src, cryptlen + authsize, &src_chained); | 1149 | if (!dst || dst == src) { |
1164 | src_nents = (src_nents == 1) ? 0 : src_nents; | 1150 | src_nents = sg_count(src, cryptlen + authsize, &src_chained); |
1165 | 1151 | src_nents = (src_nents == 1) ? 0 : src_nents; | |
1166 | if (!dst) { | 1152 | dst_nents = dst ? src_nents : 0; |
1167 | dst_nents = 0; | 1153 | } else { /* dst && dst != src*/ |
1168 | } else { | 1154 | src_nents = sg_count(src, cryptlen + (encrypt ? 0 : authsize), |
1169 | if (dst == src) { | 1155 | &src_chained); |
1170 | dst_nents = src_nents; | 1156 | src_nents = (src_nents == 1) ? 0 : src_nents; |
1171 | } else { | 1157 | dst_nents = sg_count(dst, cryptlen + (encrypt ? authsize : 0), |
1172 | dst_nents = sg_count(dst, cryptlen + authsize, | 1158 | &dst_chained); |
1173 | &dst_chained); | 1159 | dst_nents = (dst_nents == 1) ? 0 : dst_nents; |
1174 | dst_nents = (dst_nents == 1) ? 0 : dst_nents; | ||
1175 | } | ||
1176 | } | 1160 | } |
1177 | 1161 | ||
1178 | /* | 1162 | /* |
@@ -1192,9 +1176,16 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, | |||
1192 | 1176 | ||
1193 | edesc = kmalloc(alloc_len, GFP_DMA | flags); | 1177 | edesc = kmalloc(alloc_len, GFP_DMA | flags); |
1194 | if (!edesc) { | 1178 | if (!edesc) { |
1195 | talitos_unmap_sg_chain(dev, assoc, DMA_TO_DEVICE); | 1179 | if (assoc_chained) |
1180 | talitos_unmap_sg_chain(dev, assoc, DMA_TO_DEVICE); | ||
1181 | else if (assoclen) | ||
1182 | dma_unmap_sg(dev, assoc, | ||
1183 | assoc_nents ? assoc_nents - 1 : 1, | ||
1184 | DMA_TO_DEVICE); | ||
1185 | |||
1196 | if (iv_dma) | 1186 | if (iv_dma) |
1197 | dma_unmap_single(dev, iv_dma, ivsize, DMA_TO_DEVICE); | 1187 | dma_unmap_single(dev, iv_dma, ivsize, DMA_TO_DEVICE); |
1188 | |||
1198 | dev_err(dev, "could not allocate edescriptor\n"); | 1189 | dev_err(dev, "could not allocate edescriptor\n"); |
1199 | return ERR_PTR(-ENOMEM); | 1190 | return ERR_PTR(-ENOMEM); |
1200 | } | 1191 | } |
@@ -1216,7 +1207,7 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, | |||
1216 | } | 1207 | } |
1217 | 1208 | ||
1218 | static struct talitos_edesc *aead_edesc_alloc(struct aead_request *areq, u8 *iv, | 1209 | static struct talitos_edesc *aead_edesc_alloc(struct aead_request *areq, u8 *iv, |
1219 | int icv_stashing) | 1210 | int icv_stashing, bool encrypt) |
1220 | { | 1211 | { |
1221 | struct crypto_aead *authenc = crypto_aead_reqtfm(areq); | 1212 | struct crypto_aead *authenc = crypto_aead_reqtfm(areq); |
1222 | struct talitos_ctx *ctx = crypto_aead_ctx(authenc); | 1213 | struct talitos_ctx *ctx = crypto_aead_ctx(authenc); |
@@ -1225,7 +1216,7 @@ static struct talitos_edesc *aead_edesc_alloc(struct aead_request *areq, u8 *iv, | |||
1225 | return talitos_edesc_alloc(ctx->dev, areq->assoc, areq->src, areq->dst, | 1216 | return talitos_edesc_alloc(ctx->dev, areq->assoc, areq->src, areq->dst, |
1226 | iv, areq->assoclen, areq->cryptlen, | 1217 | iv, areq->assoclen, areq->cryptlen, |
1227 | ctx->authsize, ivsize, icv_stashing, | 1218 | ctx->authsize, ivsize, icv_stashing, |
1228 | areq->base.flags); | 1219 | areq->base.flags, encrypt); |
1229 | } | 1220 | } |
1230 | 1221 | ||
1231 | static int aead_encrypt(struct aead_request *req) | 1222 | static int aead_encrypt(struct aead_request *req) |
@@ -1235,7 +1226,7 @@ static int aead_encrypt(struct aead_request *req) | |||
1235 | struct talitos_edesc *edesc; | 1226 | struct talitos_edesc *edesc; |
1236 | 1227 | ||
1237 | /* allocate extended descriptor */ | 1228 | /* allocate extended descriptor */ |
1238 | edesc = aead_edesc_alloc(req, req->iv, 0); | 1229 | edesc = aead_edesc_alloc(req, req->iv, 0, true); |
1239 | if (IS_ERR(edesc)) | 1230 | if (IS_ERR(edesc)) |
1240 | return PTR_ERR(edesc); | 1231 | return PTR_ERR(edesc); |
1241 | 1232 | ||
@@ -1258,7 +1249,7 @@ static int aead_decrypt(struct aead_request *req) | |||
1258 | req->cryptlen -= authsize; | 1249 | req->cryptlen -= authsize; |
1259 | 1250 | ||
1260 | /* allocate extended descriptor */ | 1251 | /* allocate extended descriptor */ |
1261 | edesc = aead_edesc_alloc(req, req->iv, 1); | 1252 | edesc = aead_edesc_alloc(req, req->iv, 1, false); |
1262 | if (IS_ERR(edesc)) | 1253 | if (IS_ERR(edesc)) |
1263 | return PTR_ERR(edesc); | 1254 | return PTR_ERR(edesc); |
1264 | 1255 | ||
@@ -1304,7 +1295,7 @@ static int aead_givencrypt(struct aead_givcrypt_request *req) | |||
1304 | struct talitos_edesc *edesc; | 1295 | struct talitos_edesc *edesc; |
1305 | 1296 | ||
1306 | /* allocate extended descriptor */ | 1297 | /* allocate extended descriptor */ |
1307 | edesc = aead_edesc_alloc(areq, req->giv, 0); | 1298 | edesc = aead_edesc_alloc(areq, req->giv, 0, true); |
1308 | if (IS_ERR(edesc)) | 1299 | if (IS_ERR(edesc)) |
1309 | return PTR_ERR(edesc); | 1300 | return PTR_ERR(edesc); |
1310 | 1301 | ||
@@ -1460,7 +1451,7 @@ static int common_nonsnoop(struct talitos_edesc *edesc, | |||
1460 | } | 1451 | } |
1461 | 1452 | ||
1462 | static struct talitos_edesc *ablkcipher_edesc_alloc(struct ablkcipher_request * | 1453 | static struct talitos_edesc *ablkcipher_edesc_alloc(struct ablkcipher_request * |
1463 | areq) | 1454 | areq, bool encrypt) |
1464 | { | 1455 | { |
1465 | struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq); | 1456 | struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq); |
1466 | struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher); | 1457 | struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher); |
@@ -1468,7 +1459,7 @@ static struct talitos_edesc *ablkcipher_edesc_alloc(struct ablkcipher_request * | |||
1468 | 1459 | ||
1469 | return talitos_edesc_alloc(ctx->dev, NULL, areq->src, areq->dst, | 1460 | return talitos_edesc_alloc(ctx->dev, NULL, areq->src, areq->dst, |
1470 | areq->info, 0, areq->nbytes, 0, ivsize, 0, | 1461 | areq->info, 0, areq->nbytes, 0, ivsize, 0, |
1471 | areq->base.flags); | 1462 | areq->base.flags, encrypt); |
1472 | } | 1463 | } |
1473 | 1464 | ||
1474 | static int ablkcipher_encrypt(struct ablkcipher_request *areq) | 1465 | static int ablkcipher_encrypt(struct ablkcipher_request *areq) |
@@ -1478,7 +1469,7 @@ static int ablkcipher_encrypt(struct ablkcipher_request *areq) | |||
1478 | struct talitos_edesc *edesc; | 1469 | struct talitos_edesc *edesc; |
1479 | 1470 | ||
1480 | /* allocate extended descriptor */ | 1471 | /* allocate extended descriptor */ |
1481 | edesc = ablkcipher_edesc_alloc(areq); | 1472 | edesc = ablkcipher_edesc_alloc(areq, true); |
1482 | if (IS_ERR(edesc)) | 1473 | if (IS_ERR(edesc)) |
1483 | return PTR_ERR(edesc); | 1474 | return PTR_ERR(edesc); |
1484 | 1475 | ||
@@ -1495,7 +1486,7 @@ static int ablkcipher_decrypt(struct ablkcipher_request *areq) | |||
1495 | struct talitos_edesc *edesc; | 1486 | struct talitos_edesc *edesc; |
1496 | 1487 | ||
1497 | /* allocate extended descriptor */ | 1488 | /* allocate extended descriptor */ |
1498 | edesc = ablkcipher_edesc_alloc(areq); | 1489 | edesc = ablkcipher_edesc_alloc(areq, false); |
1499 | if (IS_ERR(edesc)) | 1490 | if (IS_ERR(edesc)) |
1500 | return PTR_ERR(edesc); | 1491 | return PTR_ERR(edesc); |
1501 | 1492 | ||
@@ -1647,7 +1638,7 @@ static struct talitos_edesc *ahash_edesc_alloc(struct ahash_request *areq, | |||
1647 | struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); | 1638 | struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); |
1648 | 1639 | ||
1649 | return talitos_edesc_alloc(ctx->dev, NULL, req_ctx->psrc, NULL, NULL, 0, | 1640 | return talitos_edesc_alloc(ctx->dev, NULL, req_ctx->psrc, NULL, NULL, 0, |
1650 | nbytes, 0, 0, 0, areq->base.flags); | 1641 | nbytes, 0, 0, 0, areq->base.flags, false); |
1651 | } | 1642 | } |
1652 | 1643 | ||
1653 | static int ahash_init(struct ahash_request *areq) | 1644 | static int ahash_init(struct ahash_request *areq) |
diff --git a/drivers/crypto/tegra-aes.c b/drivers/crypto/tegra-aes.c index fa05e3c329bd..060eecc5dbc3 100644 --- a/drivers/crypto/tegra-aes.c +++ b/drivers/crypto/tegra-aes.c | |||
@@ -27,6 +27,8 @@ | |||
27 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 27 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
31 | |||
30 | #include <linux/module.h> | 32 | #include <linux/module.h> |
31 | #include <linux/init.h> | 33 | #include <linux/init.h> |
32 | #include <linux/errno.h> | 34 | #include <linux/errno.h> |
@@ -199,8 +201,6 @@ static void aes_workqueue_handler(struct work_struct *work); | |||
199 | static DECLARE_WORK(aes_work, aes_workqueue_handler); | 201 | static DECLARE_WORK(aes_work, aes_workqueue_handler); |
200 | static struct workqueue_struct *aes_wq; | 202 | static struct workqueue_struct *aes_wq; |
201 | 203 | ||
202 | extern unsigned long long tegra_chip_uid(void); | ||
203 | |||
204 | static inline u32 aes_readl(struct tegra_aes_dev *dd, u32 offset) | 204 | static inline u32 aes_readl(struct tegra_aes_dev *dd, u32 offset) |
205 | { | 205 | { |
206 | return readl(dd->io_base + offset); | 206 | return readl(dd->io_base + offset); |
@@ -713,13 +713,12 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed, | |||
713 | struct tegra_aes_dev *dd = aes_dev; | 713 | struct tegra_aes_dev *dd = aes_dev; |
714 | struct tegra_aes_ctx *ctx = &rng_ctx; | 714 | struct tegra_aes_ctx *ctx = &rng_ctx; |
715 | struct tegra_aes_slot *key_slot; | 715 | struct tegra_aes_slot *key_slot; |
716 | struct timespec ts; | ||
717 | int ret = 0; | 716 | int ret = 0; |
718 | u64 nsec, tmp[2]; | 717 | u8 tmp[16]; /* 16 bytes = 128 bits of entropy */ |
719 | u8 *dt; | 718 | u8 *dt; |
720 | 719 | ||
721 | if (!ctx || !dd) { | 720 | if (!ctx || !dd) { |
722 | dev_err(dd->dev, "ctx=0x%x, dd=0x%x\n", | 721 | pr_err("ctx=0x%x, dd=0x%x\n", |
723 | (unsigned int)ctx, (unsigned int)dd); | 722 | (unsigned int)ctx, (unsigned int)dd); |
724 | return -EINVAL; | 723 | return -EINVAL; |
725 | } | 724 | } |
@@ -778,14 +777,8 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed, | |||
778 | if (dd->ivlen >= (2 * DEFAULT_RNG_BLK_SZ + AES_KEYSIZE_128)) { | 777 | if (dd->ivlen >= (2 * DEFAULT_RNG_BLK_SZ + AES_KEYSIZE_128)) { |
779 | dt = dd->iv + DEFAULT_RNG_BLK_SZ + AES_KEYSIZE_128; | 778 | dt = dd->iv + DEFAULT_RNG_BLK_SZ + AES_KEYSIZE_128; |
780 | } else { | 779 | } else { |
781 | getnstimeofday(&ts); | 780 | get_random_bytes(tmp, sizeof(tmp)); |
782 | nsec = timespec_to_ns(&ts); | 781 | dt = tmp; |
783 | do_div(nsec, 1000); | ||
784 | nsec ^= dd->ctr << 56; | ||
785 | dd->ctr++; | ||
786 | tmp[0] = nsec; | ||
787 | tmp[1] = tegra_chip_uid(); | ||
788 | dt = (u8 *)tmp; | ||
789 | } | 782 | } |
790 | memcpy(dd->dt, dt, DEFAULT_RNG_BLK_SZ); | 783 | memcpy(dd->dt, dt, DEFAULT_RNG_BLK_SZ); |
791 | 784 | ||
@@ -804,7 +797,7 @@ static int tegra_aes_cra_init(struct crypto_tfm *tfm) | |||
804 | return 0; | 797 | return 0; |
805 | } | 798 | } |
806 | 799 | ||
807 | void tegra_aes_cra_exit(struct crypto_tfm *tfm) | 800 | static void tegra_aes_cra_exit(struct crypto_tfm *tfm) |
808 | { | 801 | { |
809 | struct tegra_aes_ctx *ctx = | 802 | struct tegra_aes_ctx *ctx = |
810 | crypto_ablkcipher_ctx((struct crypto_ablkcipher *)tfm); | 803 | crypto_ablkcipher_ctx((struct crypto_ablkcipher *)tfm); |
@@ -924,7 +917,7 @@ static int tegra_aes_probe(struct platform_device *pdev) | |||
924 | } | 917 | } |
925 | 918 | ||
926 | /* Initialize the vde clock */ | 919 | /* Initialize the vde clock */ |
927 | dd->aes_clk = clk_get(dev, "vde"); | 920 | dd->aes_clk = devm_clk_get(dev, "vde"); |
928 | if (IS_ERR(dd->aes_clk)) { | 921 | if (IS_ERR(dd->aes_clk)) { |
929 | dev_err(dev, "iclock intialization failed.\n"); | 922 | dev_err(dev, "iclock intialization failed.\n"); |
930 | err = -ENODEV; | 923 | err = -ENODEV; |
@@ -1033,8 +1026,6 @@ out: | |||
1033 | if (dd->buf_out) | 1026 | if (dd->buf_out) |
1034 | dma_free_coherent(dev, AES_HW_DMA_BUFFER_SIZE_BYTES, | 1027 | dma_free_coherent(dev, AES_HW_DMA_BUFFER_SIZE_BYTES, |
1035 | dd->buf_out, dd->dma_buf_out); | 1028 | dd->buf_out, dd->dma_buf_out); |
1036 | if (!IS_ERR(dd->aes_clk)) | ||
1037 | clk_put(dd->aes_clk); | ||
1038 | if (aes_wq) | 1029 | if (aes_wq) |
1039 | destroy_workqueue(aes_wq); | 1030 | destroy_workqueue(aes_wq); |
1040 | spin_lock(&list_lock); | 1031 | spin_lock(&list_lock); |
@@ -1068,7 +1059,6 @@ static int tegra_aes_remove(struct platform_device *pdev) | |||
1068 | dd->buf_in, dd->dma_buf_in); | 1059 | dd->buf_in, dd->dma_buf_in); |
1069 | dma_free_coherent(dev, AES_HW_DMA_BUFFER_SIZE_BYTES, | 1060 | dma_free_coherent(dev, AES_HW_DMA_BUFFER_SIZE_BYTES, |
1070 | dd->buf_out, dd->dma_buf_out); | 1061 | dd->buf_out, dd->dma_buf_out); |
1071 | clk_put(dd->aes_clk); | ||
1072 | aes_dev = NULL; | 1062 | aes_dev = NULL; |
1073 | 1063 | ||
1074 | return 0; | 1064 | return 0; |
diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index 281029daf98c..b0bb056458a3 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c | |||
@@ -1623,6 +1623,7 @@ static struct scsi_host_template scsi_driver_template = { | |||
1623 | .cmd_per_lun = 1, | 1623 | .cmd_per_lun = 1, |
1624 | .can_queue = 1, | 1624 | .can_queue = 1, |
1625 | .sdev_attrs = sbp2_scsi_sysfs_attrs, | 1625 | .sdev_attrs = sbp2_scsi_sysfs_attrs, |
1626 | .no_write_same = 1, | ||
1626 | }; | 1627 | }; |
1627 | 1628 | ||
1628 | MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>"); | 1629 | MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>"); |
diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c index 5002d50e3781..743fd426f21b 100644 --- a/drivers/firmware/efi/efi-pstore.c +++ b/drivers/firmware/efi/efi-pstore.c | |||
@@ -18,14 +18,12 @@ module_param_named(pstore_disable, efivars_pstore_disable, bool, 0644); | |||
18 | 18 | ||
19 | static int efi_pstore_open(struct pstore_info *psi) | 19 | static int efi_pstore_open(struct pstore_info *psi) |
20 | { | 20 | { |
21 | efivar_entry_iter_begin(); | ||
22 | psi->data = NULL; | 21 | psi->data = NULL; |
23 | return 0; | 22 | return 0; |
24 | } | 23 | } |
25 | 24 | ||
26 | static int efi_pstore_close(struct pstore_info *psi) | 25 | static int efi_pstore_close(struct pstore_info *psi) |
27 | { | 26 | { |
28 | efivar_entry_iter_end(); | ||
29 | psi->data = NULL; | 27 | psi->data = NULL; |
30 | return 0; | 28 | return 0; |
31 | } | 29 | } |
@@ -39,6 +37,12 @@ struct pstore_read_data { | |||
39 | char **buf; | 37 | char **buf; |
40 | }; | 38 | }; |
41 | 39 | ||
40 | static inline u64 generic_id(unsigned long timestamp, | ||
41 | unsigned int part, int count) | ||
42 | { | ||
43 | return (timestamp * 100 + part) * 1000 + count; | ||
44 | } | ||
45 | |||
42 | static int efi_pstore_read_func(struct efivar_entry *entry, void *data) | 46 | static int efi_pstore_read_func(struct efivar_entry *entry, void *data) |
43 | { | 47 | { |
44 | efi_guid_t vendor = LINUX_EFI_CRASH_GUID; | 48 | efi_guid_t vendor = LINUX_EFI_CRASH_GUID; |
@@ -57,7 +61,7 @@ static int efi_pstore_read_func(struct efivar_entry *entry, void *data) | |||
57 | 61 | ||
58 | if (sscanf(name, "dump-type%u-%u-%d-%lu-%c", | 62 | if (sscanf(name, "dump-type%u-%u-%d-%lu-%c", |
59 | cb_data->type, &part, &cnt, &time, &data_type) == 5) { | 63 | cb_data->type, &part, &cnt, &time, &data_type) == 5) { |
60 | *cb_data->id = part; | 64 | *cb_data->id = generic_id(time, part, cnt); |
61 | *cb_data->count = cnt; | 65 | *cb_data->count = cnt; |
62 | cb_data->timespec->tv_sec = time; | 66 | cb_data->timespec->tv_sec = time; |
63 | cb_data->timespec->tv_nsec = 0; | 67 | cb_data->timespec->tv_nsec = 0; |
@@ -67,7 +71,7 @@ static int efi_pstore_read_func(struct efivar_entry *entry, void *data) | |||
67 | *cb_data->compressed = false; | 71 | *cb_data->compressed = false; |
68 | } else if (sscanf(name, "dump-type%u-%u-%d-%lu", | 72 | } else if (sscanf(name, "dump-type%u-%u-%d-%lu", |
69 | cb_data->type, &part, &cnt, &time) == 4) { | 73 | cb_data->type, &part, &cnt, &time) == 4) { |
70 | *cb_data->id = part; | 74 | *cb_data->id = generic_id(time, part, cnt); |
71 | *cb_data->count = cnt; | 75 | *cb_data->count = cnt; |
72 | cb_data->timespec->tv_sec = time; | 76 | cb_data->timespec->tv_sec = time; |
73 | cb_data->timespec->tv_nsec = 0; | 77 | cb_data->timespec->tv_nsec = 0; |
@@ -79,7 +83,7 @@ static int efi_pstore_read_func(struct efivar_entry *entry, void *data) | |||
79 | * which doesn't support holding | 83 | * which doesn't support holding |
80 | * multiple logs, remains. | 84 | * multiple logs, remains. |
81 | */ | 85 | */ |
82 | *cb_data->id = part; | 86 | *cb_data->id = generic_id(time, part, 0); |
83 | *cb_data->count = 0; | 87 | *cb_data->count = 0; |
84 | cb_data->timespec->tv_sec = time; | 88 | cb_data->timespec->tv_sec = time; |
85 | cb_data->timespec->tv_nsec = 0; | 89 | cb_data->timespec->tv_nsec = 0; |
@@ -91,19 +95,125 @@ static int efi_pstore_read_func(struct efivar_entry *entry, void *data) | |||
91 | __efivar_entry_get(entry, &entry->var.Attributes, | 95 | __efivar_entry_get(entry, &entry->var.Attributes, |
92 | &entry->var.DataSize, entry->var.Data); | 96 | &entry->var.DataSize, entry->var.Data); |
93 | size = entry->var.DataSize; | 97 | size = entry->var.DataSize; |
98 | memcpy(*cb_data->buf, entry->var.Data, | ||
99 | (size_t)min_t(unsigned long, EFIVARS_DATA_SIZE_MAX, size)); | ||
94 | 100 | ||
95 | *cb_data->buf = kmemdup(entry->var.Data, size, GFP_KERNEL); | ||
96 | if (*cb_data->buf == NULL) | ||
97 | return -ENOMEM; | ||
98 | return size; | 101 | return size; |
99 | } | 102 | } |
100 | 103 | ||
104 | /** | ||
105 | * efi_pstore_scan_sysfs_enter | ||
106 | * @entry: scanning entry | ||
107 | * @next: next entry | ||
108 | * @head: list head | ||
109 | */ | ||
110 | static void efi_pstore_scan_sysfs_enter(struct efivar_entry *pos, | ||
111 | struct efivar_entry *next, | ||
112 | struct list_head *head) | ||
113 | { | ||
114 | pos->scanning = true; | ||
115 | if (&next->list != head) | ||
116 | next->scanning = true; | ||
117 | } | ||
118 | |||
119 | /** | ||
120 | * __efi_pstore_scan_sysfs_exit | ||
121 | * @entry: deleting entry | ||
122 | * @turn_off_scanning: Check if a scanning flag should be turned off | ||
123 | */ | ||
124 | static inline void __efi_pstore_scan_sysfs_exit(struct efivar_entry *entry, | ||
125 | bool turn_off_scanning) | ||
126 | { | ||
127 | if (entry->deleting) { | ||
128 | list_del(&entry->list); | ||
129 | efivar_entry_iter_end(); | ||
130 | efivar_unregister(entry); | ||
131 | efivar_entry_iter_begin(); | ||
132 | } else if (turn_off_scanning) | ||
133 | entry->scanning = false; | ||
134 | } | ||
135 | |||
136 | /** | ||
137 | * efi_pstore_scan_sysfs_exit | ||
138 | * @pos: scanning entry | ||
139 | * @next: next entry | ||
140 | * @head: list head | ||
141 | * @stop: a flag checking if scanning will stop | ||
142 | */ | ||
143 | static void efi_pstore_scan_sysfs_exit(struct efivar_entry *pos, | ||
144 | struct efivar_entry *next, | ||
145 | struct list_head *head, bool stop) | ||
146 | { | ||
147 | __efi_pstore_scan_sysfs_exit(pos, true); | ||
148 | if (stop) | ||
149 | __efi_pstore_scan_sysfs_exit(next, &next->list != head); | ||
150 | } | ||
151 | |||
152 | /** | ||
153 | * efi_pstore_sysfs_entry_iter | ||
154 | * | ||
155 | * @data: function-specific data to pass to callback | ||
156 | * @pos: entry to begin iterating from | ||
157 | * | ||
158 | * You MUST call efivar_enter_iter_begin() before this function, and | ||
159 | * efivar_entry_iter_end() afterwards. | ||
160 | * | ||
161 | * It is possible to begin iteration from an arbitrary entry within | ||
162 | * the list by passing @pos. @pos is updated on return to point to | ||
163 | * the next entry of the last one passed to efi_pstore_read_func(). | ||
164 | * To begin iterating from the beginning of the list @pos must be %NULL. | ||
165 | */ | ||
166 | static int efi_pstore_sysfs_entry_iter(void *data, struct efivar_entry **pos) | ||
167 | { | ||
168 | struct efivar_entry *entry, *n; | ||
169 | struct list_head *head = &efivar_sysfs_list; | ||
170 | int size = 0; | ||
171 | |||
172 | if (!*pos) { | ||
173 | list_for_each_entry_safe(entry, n, head, list) { | ||
174 | efi_pstore_scan_sysfs_enter(entry, n, head); | ||
175 | |||
176 | size = efi_pstore_read_func(entry, data); | ||
177 | efi_pstore_scan_sysfs_exit(entry, n, head, size < 0); | ||
178 | if (size) | ||
179 | break; | ||
180 | } | ||
181 | *pos = n; | ||
182 | return size; | ||
183 | } | ||
184 | |||
185 | list_for_each_entry_safe_from((*pos), n, head, list) { | ||
186 | efi_pstore_scan_sysfs_enter((*pos), n, head); | ||
187 | |||
188 | size = efi_pstore_read_func((*pos), data); | ||
189 | efi_pstore_scan_sysfs_exit((*pos), n, head, size < 0); | ||
190 | if (size) | ||
191 | break; | ||
192 | } | ||
193 | *pos = n; | ||
194 | return size; | ||
195 | } | ||
196 | |||
197 | /** | ||
198 | * efi_pstore_read | ||
199 | * | ||
200 | * This function returns a size of NVRAM entry logged via efi_pstore_write(). | ||
201 | * The meaning and behavior of efi_pstore/pstore are as below. | ||
202 | * | ||
203 | * size > 0: Got data of an entry logged via efi_pstore_write() successfully, | ||
204 | * and pstore filesystem will continue reading subsequent entries. | ||
205 | * size == 0: Entry was not logged via efi_pstore_write(), | ||
206 | * and efi_pstore driver will continue reading subsequent entries. | ||
207 | * size < 0: Failed to get data of entry logging via efi_pstore_write(), | ||
208 | * and pstore will stop reading entry. | ||
209 | */ | ||
101 | static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type, | 210 | static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type, |
102 | int *count, struct timespec *timespec, | 211 | int *count, struct timespec *timespec, |
103 | char **buf, bool *compressed, | 212 | char **buf, bool *compressed, |
104 | struct pstore_info *psi) | 213 | struct pstore_info *psi) |
105 | { | 214 | { |
106 | struct pstore_read_data data; | 215 | struct pstore_read_data data; |
216 | ssize_t size; | ||
107 | 217 | ||
108 | data.id = id; | 218 | data.id = id; |
109 | data.type = type; | 219 | data.type = type; |
@@ -112,8 +222,17 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type, | |||
112 | data.compressed = compressed; | 222 | data.compressed = compressed; |
113 | data.buf = buf; | 223 | data.buf = buf; |
114 | 224 | ||
115 | return __efivar_entry_iter(efi_pstore_read_func, &efivar_sysfs_list, &data, | 225 | *data.buf = kzalloc(EFIVARS_DATA_SIZE_MAX, GFP_KERNEL); |
116 | (struct efivar_entry **)&psi->data); | 226 | if (!*data.buf) |
227 | return -ENOMEM; | ||
228 | |||
229 | efivar_entry_iter_begin(); | ||
230 | size = efi_pstore_sysfs_entry_iter(&data, | ||
231 | (struct efivar_entry **)&psi->data); | ||
232 | efivar_entry_iter_end(); | ||
233 | if (size <= 0) | ||
234 | kfree(*data.buf); | ||
235 | return size; | ||
117 | } | 236 | } |
118 | 237 | ||
119 | static int efi_pstore_write(enum pstore_type_id type, | 238 | static int efi_pstore_write(enum pstore_type_id type, |
@@ -184,9 +303,17 @@ static int efi_pstore_erase_func(struct efivar_entry *entry, void *data) | |||
184 | return 0; | 303 | return 0; |
185 | } | 304 | } |
186 | 305 | ||
306 | if (entry->scanning) { | ||
307 | /* | ||
308 | * Skip deletion because this entry will be deleted | ||
309 | * after scanning is completed. | ||
310 | */ | ||
311 | entry->deleting = true; | ||
312 | } else | ||
313 | list_del(&entry->list); | ||
314 | |||
187 | /* found */ | 315 | /* found */ |
188 | __efivar_entry_delete(entry); | 316 | __efivar_entry_delete(entry); |
189 | list_del(&entry->list); | ||
190 | 317 | ||
191 | return 1; | 318 | return 1; |
192 | } | 319 | } |
@@ -199,14 +326,16 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, | |||
199 | char name[DUMP_NAME_LEN]; | 326 | char name[DUMP_NAME_LEN]; |
200 | efi_char16_t efi_name[DUMP_NAME_LEN]; | 327 | efi_char16_t efi_name[DUMP_NAME_LEN]; |
201 | int found, i; | 328 | int found, i; |
329 | unsigned int part; | ||
202 | 330 | ||
203 | sprintf(name, "dump-type%u-%u-%d-%lu", type, (unsigned int)id, count, | 331 | do_div(id, 1000); |
204 | time.tv_sec); | 332 | part = do_div(id, 100); |
333 | sprintf(name, "dump-type%u-%u-%d-%lu", type, part, count, time.tv_sec); | ||
205 | 334 | ||
206 | for (i = 0; i < DUMP_NAME_LEN; i++) | 335 | for (i = 0; i < DUMP_NAME_LEN; i++) |
207 | efi_name[i] = name[i]; | 336 | efi_name[i] = name[i]; |
208 | 337 | ||
209 | edata.id = id; | 338 | edata.id = part; |
210 | edata.type = type; | 339 | edata.type = type; |
211 | edata.count = count; | 340 | edata.count = count; |
212 | edata.time = time; | 341 | edata.time = time; |
@@ -214,10 +343,12 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, | |||
214 | 343 | ||
215 | efivar_entry_iter_begin(); | 344 | efivar_entry_iter_begin(); |
216 | found = __efivar_entry_iter(efi_pstore_erase_func, &efivar_sysfs_list, &edata, &entry); | 345 | found = __efivar_entry_iter(efi_pstore_erase_func, &efivar_sysfs_list, &edata, &entry); |
217 | efivar_entry_iter_end(); | ||
218 | 346 | ||
219 | if (found) | 347 | if (found && !entry->scanning) { |
348 | efivar_entry_iter_end(); | ||
220 | efivar_unregister(entry); | 349 | efivar_unregister(entry); |
350 | } else | ||
351 | efivar_entry_iter_end(); | ||
221 | 352 | ||
222 | return 0; | 353 | return 0; |
223 | } | 354 | } |
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c index 933eb027d527..3dc248239197 100644 --- a/drivers/firmware/efi/efivars.c +++ b/drivers/firmware/efi/efivars.c | |||
@@ -383,12 +383,16 @@ static ssize_t efivar_delete(struct file *filp, struct kobject *kobj, | |||
383 | else if (__efivar_entry_delete(entry)) | 383 | else if (__efivar_entry_delete(entry)) |
384 | err = -EIO; | 384 | err = -EIO; |
385 | 385 | ||
386 | efivar_entry_iter_end(); | 386 | if (err) { |
387 | 387 | efivar_entry_iter_end(); | |
388 | if (err) | ||
389 | return err; | 388 | return err; |
389 | } | ||
390 | 390 | ||
391 | efivar_unregister(entry); | 391 | if (!entry->scanning) { |
392 | efivar_entry_iter_end(); | ||
393 | efivar_unregister(entry); | ||
394 | } else | ||
395 | efivar_entry_iter_end(); | ||
392 | 396 | ||
393 | /* It's dead Jim.... */ | 397 | /* It's dead Jim.... */ |
394 | return count; | 398 | return count; |
diff --git a/drivers/firmware/efi/vars.c b/drivers/firmware/efi/vars.c index 391c67b182d9..b22659cccca4 100644 --- a/drivers/firmware/efi/vars.c +++ b/drivers/firmware/efi/vars.c | |||
@@ -683,8 +683,16 @@ struct efivar_entry *efivar_entry_find(efi_char16_t *name, efi_guid_t guid, | |||
683 | if (!found) | 683 | if (!found) |
684 | return NULL; | 684 | return NULL; |
685 | 685 | ||
686 | if (remove) | 686 | if (remove) { |
687 | list_del(&entry->list); | 687 | if (entry->scanning) { |
688 | /* | ||
689 | * The entry will be deleted | ||
690 | * after scanning is completed. | ||
691 | */ | ||
692 | entry->deleting = true; | ||
693 | } else | ||
694 | list_del(&entry->list); | ||
695 | } | ||
688 | 696 | ||
689 | return entry; | 697 | return entry; |
690 | } | 698 | } |
diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index 72c927dc3be1..54c18c220a60 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c | |||
@@ -158,7 +158,7 @@ static int bcm_kona_gpio_get(struct gpio_chip *chip, unsigned gpio) | |||
158 | spin_unlock_irqrestore(&kona_gpio->lock, flags); | 158 | spin_unlock_irqrestore(&kona_gpio->lock, flags); |
159 | 159 | ||
160 | /* return the specified bit status */ | 160 | /* return the specified bit status */ |
161 | return !!(val & bit); | 161 | return !!(val & BIT(bit)); |
162 | } | 162 | } |
163 | 163 | ||
164 | static int bcm_kona_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) | 164 | static int bcm_kona_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) |
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c index 914e859e3eda..d7d6d72eba33 100644 --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c | |||
@@ -70,10 +70,14 @@ static int mpc8572_gpio_get(struct gpio_chip *gc, unsigned int gpio) | |||
70 | u32 val; | 70 | u32 val; |
71 | struct of_mm_gpio_chip *mm = to_of_mm_gpio_chip(gc); | 71 | struct of_mm_gpio_chip *mm = to_of_mm_gpio_chip(gc); |
72 | struct mpc8xxx_gpio_chip *mpc8xxx_gc = to_mpc8xxx_gpio_chip(mm); | 72 | struct mpc8xxx_gpio_chip *mpc8xxx_gc = to_mpc8xxx_gpio_chip(mm); |
73 | u32 out_mask, out_shadow; | ||
73 | 74 | ||
74 | val = in_be32(mm->regs + GPIO_DAT) & ~in_be32(mm->regs + GPIO_DIR); | 75 | out_mask = in_be32(mm->regs + GPIO_DIR); |
75 | 76 | ||
76 | return (val | mpc8xxx_gc->data) & mpc8xxx_gpio2mask(gpio); | 77 | val = in_be32(mm->regs + GPIO_DAT) & ~out_mask; |
78 | out_shadow = mpc8xxx_gc->data & out_mask; | ||
79 | |||
80 | return (val | out_shadow) & mpc8xxx_gpio2mask(gpio); | ||
77 | } | 81 | } |
78 | 82 | ||
79 | static int mpc8xxx_gpio_get(struct gpio_chip *gc, unsigned int gpio) | 83 | static int mpc8xxx_gpio_get(struct gpio_chip *gc, unsigned int gpio) |
diff --git a/drivers/gpio/gpio-msm-v2.c b/drivers/gpio/gpio-msm-v2.c index f7a0cc4da950..7b37300973db 100644 --- a/drivers/gpio/gpio-msm-v2.c +++ b/drivers/gpio/gpio-msm-v2.c | |||
@@ -102,7 +102,7 @@ struct msm_gpio_dev { | |||
102 | DECLARE_BITMAP(wake_irqs, MAX_NR_GPIO); | 102 | DECLARE_BITMAP(wake_irqs, MAX_NR_GPIO); |
103 | DECLARE_BITMAP(dual_edge_irqs, MAX_NR_GPIO); | 103 | DECLARE_BITMAP(dual_edge_irqs, MAX_NR_GPIO); |
104 | struct irq_domain *domain; | 104 | struct irq_domain *domain; |
105 | unsigned int summary_irq; | 105 | int summary_irq; |
106 | void __iomem *msm_tlmm_base; | 106 | void __iomem *msm_tlmm_base; |
107 | }; | 107 | }; |
108 | 108 | ||
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c index 3c3321f94053..db3129043e63 100644 --- a/drivers/gpio/gpio-mvebu.c +++ b/drivers/gpio/gpio-mvebu.c | |||
@@ -79,7 +79,7 @@ struct mvebu_gpio_chip { | |||
79 | spinlock_t lock; | 79 | spinlock_t lock; |
80 | void __iomem *membase; | 80 | void __iomem *membase; |
81 | void __iomem *percpu_membase; | 81 | void __iomem *percpu_membase; |
82 | unsigned int irqbase; | 82 | int irqbase; |
83 | struct irq_domain *domain; | 83 | struct irq_domain *domain; |
84 | int soc_variant; | 84 | int soc_variant; |
85 | }; | 85 | }; |
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index f22f7f3e2e53..b4d42112d02d 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c | |||
@@ -286,11 +286,6 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) | |||
286 | if (!chip->base) | 286 | if (!chip->base) |
287 | return -ENOMEM; | 287 | return -ENOMEM; |
288 | 288 | ||
289 | chip->domain = irq_domain_add_simple(adev->dev.of_node, PL061_GPIO_NR, | ||
290 | irq_base, &pl061_domain_ops, chip); | ||
291 | if (!chip->domain) | ||
292 | return -ENODEV; | ||
293 | |||
294 | spin_lock_init(&chip->lock); | 289 | spin_lock_init(&chip->lock); |
295 | 290 | ||
296 | chip->gc.request = pl061_gpio_request; | 291 | chip->gc.request = pl061_gpio_request; |
@@ -320,6 +315,11 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) | |||
320 | irq_set_chained_handler(irq, pl061_irq_handler); | 315 | irq_set_chained_handler(irq, pl061_irq_handler); |
321 | irq_set_handler_data(irq, chip); | 316 | irq_set_handler_data(irq, chip); |
322 | 317 | ||
318 | chip->domain = irq_domain_add_simple(adev->dev.of_node, PL061_GPIO_NR, | ||
319 | irq_base, &pl061_domain_ops, chip); | ||
320 | if (!chip->domain) | ||
321 | return -ENODEV; | ||
322 | |||
323 | for (i = 0; i < PL061_GPIO_NR; i++) { | 323 | for (i = 0; i < PL061_GPIO_NR; i++) { |
324 | if (pdata) { | 324 | if (pdata) { |
325 | if (pdata->directions & (1 << i)) | 325 | if (pdata->directions & (1 << i)) |
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index d3f15ae93bd3..fe088a30567a 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c | |||
@@ -381,7 +381,7 @@ static int gpio_rcar_probe(struct platform_device *pdev) | |||
381 | if (!p->irq_domain) { | 381 | if (!p->irq_domain) { |
382 | ret = -ENXIO; | 382 | ret = -ENXIO; |
383 | dev_err(&pdev->dev, "cannot initialize irq domain\n"); | 383 | dev_err(&pdev->dev, "cannot initialize irq domain\n"); |
384 | goto err1; | 384 | goto err0; |
385 | } | 385 | } |
386 | 386 | ||
387 | if (devm_request_irq(&pdev->dev, irq->start, | 387 | if (devm_request_irq(&pdev->dev, irq->start, |
diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c index 0502b9a041a5..da071ddbad99 100644 --- a/drivers/gpio/gpio-tb10x.c +++ b/drivers/gpio/gpio-tb10x.c | |||
@@ -132,6 +132,7 @@ static int tb10x_gpio_direction_out(struct gpio_chip *chip, | |||
132 | int mask = BIT(offset); | 132 | int mask = BIT(offset); |
133 | int val = TB10X_GPIO_DIR_OUT << offset; | 133 | int val = TB10X_GPIO_DIR_OUT << offset; |
134 | 134 | ||
135 | tb10x_gpio_set(chip, offset, value); | ||
135 | tb10x_set_bits(tb10x_gpio, OFFSET_TO_REG_DDR, mask, val); | 136 | tb10x_set_bits(tb10x_gpio, OFFSET_TO_REG_DDR, mask, val); |
136 | 137 | ||
137 | return 0; | 138 | return 0; |
diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c index 0c7e891c8651..b97d6a6577b9 100644 --- a/drivers/gpio/gpio-twl4030.c +++ b/drivers/gpio/gpio-twl4030.c | |||
@@ -354,17 +354,18 @@ static void twl_set(struct gpio_chip *chip, unsigned offset, int value) | |||
354 | static int twl_direction_out(struct gpio_chip *chip, unsigned offset, int value) | 354 | static int twl_direction_out(struct gpio_chip *chip, unsigned offset, int value) |
355 | { | 355 | { |
356 | struct gpio_twl4030_priv *priv = to_gpio_twl4030(chip); | 356 | struct gpio_twl4030_priv *priv = to_gpio_twl4030(chip); |
357 | int ret = -EINVAL; | ||
357 | 358 | ||
358 | mutex_lock(&priv->mutex); | 359 | mutex_lock(&priv->mutex); |
359 | if (offset < TWL4030_GPIO_MAX) | 360 | if (offset < TWL4030_GPIO_MAX) |
360 | twl4030_set_gpio_dataout(offset, value); | 361 | ret = twl4030_set_gpio_direction(offset, 0); |
361 | 362 | ||
362 | priv->direction |= BIT(offset); | 363 | priv->direction |= BIT(offset); |
363 | mutex_unlock(&priv->mutex); | 364 | mutex_unlock(&priv->mutex); |
364 | 365 | ||
365 | twl_set(chip, offset, value); | 366 | twl_set(chip, offset, value); |
366 | 367 | ||
367 | return 0; | 368 | return ret; |
368 | } | 369 | } |
369 | 370 | ||
370 | static int twl_to_irq(struct gpio_chip *chip, unsigned offset) | 371 | static int twl_to_irq(struct gpio_chip *chip, unsigned offset) |
@@ -435,7 +436,8 @@ static int gpio_twl4030_debounce(u32 debounce, u8 mmc_cd) | |||
435 | 436 | ||
436 | static int gpio_twl4030_remove(struct platform_device *pdev); | 437 | static int gpio_twl4030_remove(struct platform_device *pdev); |
437 | 438 | ||
438 | static struct twl4030_gpio_platform_data *of_gpio_twl4030(struct device *dev) | 439 | static struct twl4030_gpio_platform_data *of_gpio_twl4030(struct device *dev, |
440 | struct twl4030_gpio_platform_data *pdata) | ||
439 | { | 441 | { |
440 | struct twl4030_gpio_platform_data *omap_twl_info; | 442 | struct twl4030_gpio_platform_data *omap_twl_info; |
441 | 443 | ||
@@ -443,6 +445,9 @@ static struct twl4030_gpio_platform_data *of_gpio_twl4030(struct device *dev) | |||
443 | if (!omap_twl_info) | 445 | if (!omap_twl_info) |
444 | return NULL; | 446 | return NULL; |
445 | 447 | ||
448 | if (pdata) | ||
449 | *omap_twl_info = *pdata; | ||
450 | |||
446 | omap_twl_info->use_leds = of_property_read_bool(dev->of_node, | 451 | omap_twl_info->use_leds = of_property_read_bool(dev->of_node, |
447 | "ti,use-leds"); | 452 | "ti,use-leds"); |
448 | 453 | ||
@@ -500,7 +505,7 @@ no_irqs: | |||
500 | mutex_init(&priv->mutex); | 505 | mutex_init(&priv->mutex); |
501 | 506 | ||
502 | if (node) | 507 | if (node) |
503 | pdata = of_gpio_twl4030(&pdev->dev); | 508 | pdata = of_gpio_twl4030(&pdev->dev, pdata); |
504 | 509 | ||
505 | if (pdata == NULL) { | 510 | if (pdata == NULL) { |
506 | dev_err(&pdev->dev, "Platform data is missing\n"); | 511 | dev_err(&pdev->dev, "Platform data is missing\n"); |
diff --git a/drivers/gpio/gpio-ucb1400.c b/drivers/gpio/gpio-ucb1400.c index 1a605f2a0f55..06fb5cf99ded 100644 --- a/drivers/gpio/gpio-ucb1400.c +++ b/drivers/gpio/gpio-ucb1400.c | |||
@@ -105,3 +105,4 @@ module_platform_driver(ucb1400_gpio_driver); | |||
105 | 105 | ||
106 | MODULE_DESCRIPTION("Philips UCB1400 GPIO driver"); | 106 | MODULE_DESCRIPTION("Philips UCB1400 GPIO driver"); |
107 | MODULE_LICENSE("GPL"); | 107 | MODULE_LICENSE("GPL"); |
108 | MODULE_ALIAS("platform:ucb1400_gpio"); | ||
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 4e10b10d3ddd..85f772c0b26a 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/idr.h> | 14 | #include <linux/idr.h> |
15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include <linux/acpi.h> | 16 | #include <linux/acpi.h> |
17 | #include <linux/gpio/driver.h> | ||
17 | 18 | ||
18 | #define CREATE_TRACE_POINTS | 19 | #define CREATE_TRACE_POINTS |
19 | #include <trace/events/gpio.h> | 20 | #include <trace/events/gpio.h> |
@@ -1308,6 +1309,18 @@ struct gpio_chip *gpiochip_find(void *data, | |||
1308 | } | 1309 | } |
1309 | EXPORT_SYMBOL_GPL(gpiochip_find); | 1310 | EXPORT_SYMBOL_GPL(gpiochip_find); |
1310 | 1311 | ||
1312 | static int gpiochip_match_name(struct gpio_chip *chip, void *data) | ||
1313 | { | ||
1314 | const char *name = data; | ||
1315 | |||
1316 | return !strcmp(chip->label, name); | ||
1317 | } | ||
1318 | |||
1319 | static struct gpio_chip *find_chip_by_name(const char *name) | ||
1320 | { | ||
1321 | return gpiochip_find((void *)name, gpiochip_match_name); | ||
1322 | } | ||
1323 | |||
1311 | #ifdef CONFIG_PINCTRL | 1324 | #ifdef CONFIG_PINCTRL |
1312 | 1325 | ||
1313 | /** | 1326 | /** |
@@ -1341,8 +1354,10 @@ int gpiochip_add_pingroup_range(struct gpio_chip *chip, | |||
1341 | ret = pinctrl_get_group_pins(pctldev, pin_group, | 1354 | ret = pinctrl_get_group_pins(pctldev, pin_group, |
1342 | &pin_range->range.pins, | 1355 | &pin_range->range.pins, |
1343 | &pin_range->range.npins); | 1356 | &pin_range->range.npins); |
1344 | if (ret < 0) | 1357 | if (ret < 0) { |
1358 | kfree(pin_range); | ||
1345 | return ret; | 1359 | return ret; |
1360 | } | ||
1346 | 1361 | ||
1347 | pinctrl_add_gpio_range(pctldev, &pin_range->range); | 1362 | pinctrl_add_gpio_range(pctldev, &pin_range->range); |
1348 | 1363 | ||
@@ -2260,26 +2275,10 @@ void gpiod_add_table(struct gpiod_lookup *table, size_t size) | |||
2260 | mutex_unlock(&gpio_lookup_lock); | 2275 | mutex_unlock(&gpio_lookup_lock); |
2261 | } | 2276 | } |
2262 | 2277 | ||
2263 | /* | ||
2264 | * Caller must have a acquired gpio_lookup_lock | ||
2265 | */ | ||
2266 | static struct gpio_chip *find_chip_by_name(const char *name) | ||
2267 | { | ||
2268 | struct gpio_chip *chip = NULL; | ||
2269 | |||
2270 | list_for_each_entry(chip, &gpio_lookup_list, list) { | ||
2271 | if (chip->label == NULL) | ||
2272 | continue; | ||
2273 | if (!strcmp(chip->label, name)) | ||
2274 | break; | ||
2275 | } | ||
2276 | |||
2277 | return chip; | ||
2278 | } | ||
2279 | |||
2280 | #ifdef CONFIG_OF | 2278 | #ifdef CONFIG_OF |
2281 | static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, | 2279 | static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, |
2282 | unsigned int idx, unsigned long *flags) | 2280 | unsigned int idx, |
2281 | enum gpio_lookup_flags *flags) | ||
2283 | { | 2282 | { |
2284 | char prop_name[32]; /* 32 is max size of property name */ | 2283 | char prop_name[32]; /* 32 is max size of property name */ |
2285 | enum of_gpio_flags of_flags; | 2284 | enum of_gpio_flags of_flags; |
@@ -2297,20 +2296,22 @@ static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, | |||
2297 | return desc; | 2296 | return desc; |
2298 | 2297 | ||
2299 | if (of_flags & OF_GPIO_ACTIVE_LOW) | 2298 | if (of_flags & OF_GPIO_ACTIVE_LOW) |
2300 | *flags |= GPIOF_ACTIVE_LOW; | 2299 | *flags |= GPIO_ACTIVE_LOW; |
2301 | 2300 | ||
2302 | return desc; | 2301 | return desc; |
2303 | } | 2302 | } |
2304 | #else | 2303 | #else |
2305 | static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, | 2304 | static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, |
2306 | unsigned int idx, unsigned long *flags) | 2305 | unsigned int idx, |
2306 | enum gpio_lookup_flags *flags) | ||
2307 | { | 2307 | { |
2308 | return ERR_PTR(-ENODEV); | 2308 | return ERR_PTR(-ENODEV); |
2309 | } | 2309 | } |
2310 | #endif | 2310 | #endif |
2311 | 2311 | ||
2312 | static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id, | 2312 | static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id, |
2313 | unsigned int idx, unsigned long *flags) | 2313 | unsigned int idx, |
2314 | enum gpio_lookup_flags *flags) | ||
2314 | { | 2315 | { |
2315 | struct acpi_gpio_info info; | 2316 | struct acpi_gpio_info info; |
2316 | struct gpio_desc *desc; | 2317 | struct gpio_desc *desc; |
@@ -2320,13 +2321,14 @@ static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id, | |||
2320 | return desc; | 2321 | return desc; |
2321 | 2322 | ||
2322 | if (info.gpioint && info.active_low) | 2323 | if (info.gpioint && info.active_low) |
2323 | *flags |= GPIOF_ACTIVE_LOW; | 2324 | *flags |= GPIO_ACTIVE_LOW; |
2324 | 2325 | ||
2325 | return desc; | 2326 | return desc; |
2326 | } | 2327 | } |
2327 | 2328 | ||
2328 | static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id, | 2329 | static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id, |
2329 | unsigned int idx, unsigned long *flags) | 2330 | unsigned int idx, |
2331 | enum gpio_lookup_flags *flags) | ||
2330 | { | 2332 | { |
2331 | const char *dev_id = dev ? dev_name(dev) : NULL; | 2333 | const char *dev_id = dev ? dev_name(dev) : NULL; |
2332 | struct gpio_desc *desc = ERR_PTR(-ENODEV); | 2334 | struct gpio_desc *desc = ERR_PTR(-ENODEV); |
@@ -2366,7 +2368,7 @@ static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id, | |||
2366 | continue; | 2368 | continue; |
2367 | } | 2369 | } |
2368 | 2370 | ||
2369 | if (chip->ngpio >= p->chip_hwnum) { | 2371 | if (chip->ngpio <= p->chip_hwnum) { |
2370 | dev_warn(dev, "GPIO chip %s has %d GPIOs\n", | 2372 | dev_warn(dev, "GPIO chip %s has %d GPIOs\n", |
2371 | chip->label, chip->ngpio); | 2373 | chip->label, chip->ngpio); |
2372 | continue; | 2374 | continue; |
@@ -2416,9 +2418,9 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev, | |||
2416 | const char *con_id, | 2418 | const char *con_id, |
2417 | unsigned int idx) | 2419 | unsigned int idx) |
2418 | { | 2420 | { |
2419 | struct gpio_desc *desc; | 2421 | struct gpio_desc *desc = NULL; |
2420 | int status; | 2422 | int status; |
2421 | unsigned long flags = 0; | 2423 | enum gpio_lookup_flags flags = 0; |
2422 | 2424 | ||
2423 | dev_dbg(dev, "GPIO lookup for consumer %s\n", con_id); | 2425 | dev_dbg(dev, "GPIO lookup for consumer %s\n", con_id); |
2424 | 2426 | ||
@@ -2429,13 +2431,23 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev, | |||
2429 | } else if (IS_ENABLED(CONFIG_ACPI) && dev && ACPI_HANDLE(dev)) { | 2431 | } else if (IS_ENABLED(CONFIG_ACPI) && dev && ACPI_HANDLE(dev)) { |
2430 | dev_dbg(dev, "using ACPI for GPIO lookup\n"); | 2432 | dev_dbg(dev, "using ACPI for GPIO lookup\n"); |
2431 | desc = acpi_find_gpio(dev, con_id, idx, &flags); | 2433 | desc = acpi_find_gpio(dev, con_id, idx, &flags); |
2432 | } else { | 2434 | } |
2435 | |||
2436 | /* | ||
2437 | * Either we are not using DT or ACPI, or their lookup did not return | ||
2438 | * a result. In that case, use platform lookup as a fallback. | ||
2439 | */ | ||
2440 | if (!desc || IS_ERR(desc)) { | ||
2441 | struct gpio_desc *pdesc; | ||
2433 | dev_dbg(dev, "using lookup tables for GPIO lookup"); | 2442 | dev_dbg(dev, "using lookup tables for GPIO lookup"); |
2434 | desc = gpiod_find(dev, con_id, idx, &flags); | 2443 | pdesc = gpiod_find(dev, con_id, idx, &flags); |
2444 | /* If used as fallback, do not replace the previous error */ | ||
2445 | if (!IS_ERR(pdesc) || !desc) | ||
2446 | desc = pdesc; | ||
2435 | } | 2447 | } |
2436 | 2448 | ||
2437 | if (IS_ERR(desc)) { | 2449 | if (IS_ERR(desc)) { |
2438 | dev_warn(dev, "lookup for GPIO %s failed\n", con_id); | 2450 | dev_dbg(dev, "lookup for GPIO %s failed\n", con_id); |
2439 | return desc; | 2451 | return desc; |
2440 | } | 2452 | } |
2441 | 2453 | ||
@@ -2444,8 +2456,12 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev, | |||
2444 | if (status < 0) | 2456 | if (status < 0) |
2445 | return ERR_PTR(status); | 2457 | return ERR_PTR(status); |
2446 | 2458 | ||
2447 | if (flags & GPIOF_ACTIVE_LOW) | 2459 | if (flags & GPIO_ACTIVE_LOW) |
2448 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); | 2460 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); |
2461 | if (flags & GPIO_OPEN_DRAIN) | ||
2462 | set_bit(FLAG_OPEN_DRAIN, &desc->flags); | ||
2463 | if (flags & GPIO_OPEN_SOURCE) | ||
2464 | set_bit(FLAG_OPEN_SOURCE, &desc->flags); | ||
2449 | 2465 | ||
2450 | return desc; | 2466 | return desc; |
2451 | } | 2467 | } |
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index bd2bca395792..c22c3097c3e8 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c | |||
@@ -516,7 +516,7 @@ int drm_sysfs_device_add(struct drm_minor *minor) | |||
516 | minor_str = "card%d"; | 516 | minor_str = "card%d"; |
517 | 517 | ||
518 | minor->kdev = kzalloc(sizeof(*minor->kdev), GFP_KERNEL); | 518 | minor->kdev = kzalloc(sizeof(*minor->kdev), GFP_KERNEL); |
519 | if (!minor->dev) { | 519 | if (!minor->kdev) { |
520 | r = -ENOMEM; | 520 | r = -ENOMEM; |
521 | goto error; | 521 | goto error; |
522 | } | 522 | } |
diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c index 38a4db5bfe21..4aff04fa483c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c +++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c | |||
@@ -630,7 +630,6 @@ error: | |||
630 | hwmon->hwmon = NULL; | 630 | hwmon->hwmon = NULL; |
631 | return ret; | 631 | return ret; |
632 | #else | 632 | #else |
633 | hwmon->hwmon = NULL; | ||
634 | return 0; | 633 | return 0; |
635 | #endif | 634 | #endif |
636 | } | 635 | } |
diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index 0109a9644cb2..821ab7b9409b 100644 --- a/drivers/gpu/drm/qxl/qxl_release.c +++ b/drivers/gpu/drm/qxl/qxl_release.c | |||
@@ -92,6 +92,7 @@ qxl_release_free(struct qxl_device *qdev, | |||
92 | - DRM_FILE_OFFSET); | 92 | - DRM_FILE_OFFSET); |
93 | qxl_fence_remove_release(&bo->fence, release->id); | 93 | qxl_fence_remove_release(&bo->fence, release->id); |
94 | qxl_bo_unref(&bo); | 94 | qxl_bo_unref(&bo); |
95 | kfree(entry); | ||
95 | } | 96 | } |
96 | spin_lock(&qdev->release_idr_lock); | 97 | spin_lock(&qdev->release_idr_lock); |
97 | idr_remove(&qdev->release_idr, release->id); | 98 | idr_remove(&qdev->release_idr, release->id); |
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 329fbb9b5976..34e2d39d4ce8 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -460,6 +460,7 @@ config HID_MULTITOUCH | |||
460 | - Stantum multitouch panels | 460 | - Stantum multitouch panels |
461 | - Touch International Panels | 461 | - Touch International Panels |
462 | - Unitec Panels | 462 | - Unitec Panels |
463 | - Wistron optical touch panels | ||
463 | - XAT optical touch panels | 464 | - XAT optical touch panels |
464 | - Xiroku optical touch panels | 465 | - Xiroku optical touch panels |
465 | - Zytronic touch panels | 466 | - Zytronic touch panels |
diff --git a/drivers/hid/hid-appleir.c b/drivers/hid/hid-appleir.c index a42e6a394c5e..0e6a42d37eb6 100644 --- a/drivers/hid/hid-appleir.c +++ b/drivers/hid/hid-appleir.c | |||
@@ -297,6 +297,9 @@ static int appleir_probe(struct hid_device *hid, const struct hid_device_id *id) | |||
297 | 297 | ||
298 | appleir->hid = hid; | 298 | appleir->hid = hid; |
299 | 299 | ||
300 | /* force input as some remotes bypass the input registration */ | ||
301 | hid->quirks |= HID_QUIRK_HIDINPUT_FORCE; | ||
302 | |||
300 | spin_lock_init(&appleir->lock); | 303 | spin_lock_init(&appleir->lock); |
301 | setup_timer(&appleir->key_up_timer, | 304 | setup_timer(&appleir->key_up_timer, |
302 | key_up_tick, (unsigned long) appleir); | 305 | key_up_tick, (unsigned long) appleir); |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8c10f2742233..253fe23ef7fe 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1723,6 +1723,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1723 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, | 1723 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, |
1724 | { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) }, | 1724 | { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) }, |
1725 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, | 1725 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, |
1726 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_MANTICORE) }, | ||
1726 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GX_IMPERATOR) }, | 1727 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GX_IMPERATOR) }, |
1727 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, | 1728 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, |
1728 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) }, | 1729 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) }, |
@@ -1879,7 +1880,6 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1879 | 1880 | ||
1880 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) }, | 1881 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) }, |
1881 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | 1882 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, |
1882 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | ||
1883 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, | 1883 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, |
1884 | { } | 1884 | { } |
1885 | }; | 1885 | }; |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 76559629568c..f9304cb37154 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -489,6 +489,7 @@ | |||
489 | #define USB_VENDOR_ID_KYE 0x0458 | 489 | #define USB_VENDOR_ID_KYE 0x0458 |
490 | #define USB_DEVICE_ID_KYE_ERGO_525V 0x0087 | 490 | #define USB_DEVICE_ID_KYE_ERGO_525V 0x0087 |
491 | #define USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE 0x0138 | 491 | #define USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE 0x0138 |
492 | #define USB_DEVICE_ID_GENIUS_MANTICORE 0x0153 | ||
492 | #define USB_DEVICE_ID_GENIUS_GX_IMPERATOR 0x4018 | 493 | #define USB_DEVICE_ID_GENIUS_GX_IMPERATOR 0x4018 |
493 | #define USB_DEVICE_ID_KYE_GPEN_560 0x5003 | 494 | #define USB_DEVICE_ID_KYE_GPEN_560 0x5003 |
494 | #define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010 | 495 | #define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010 |
@@ -640,7 +641,6 @@ | |||
640 | #define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003 | 641 | #define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003 |
641 | 642 | ||
642 | #define USB_VENDOR_ID_NINTENDO 0x057e | 643 | #define USB_VENDOR_ID_NINTENDO 0x057e |
643 | #define USB_VENDOR_ID_NINTENDO2 0x054c | ||
644 | #define USB_DEVICE_ID_NINTENDO_WIIMOTE 0x0306 | 644 | #define USB_DEVICE_ID_NINTENDO_WIIMOTE 0x0306 |
645 | #define USB_DEVICE_ID_NINTENDO_WIIMOTE2 0x0330 | 645 | #define USB_DEVICE_ID_NINTENDO_WIIMOTE2 0x0330 |
646 | 646 | ||
@@ -902,6 +902,9 @@ | |||
902 | #define USB_DEVICE_ID_SUPER_DUAL_BOX_PRO 0x8802 | 902 | #define USB_DEVICE_ID_SUPER_DUAL_BOX_PRO 0x8802 |
903 | #define USB_DEVICE_ID_SUPER_JOY_BOX_5_PRO 0x8804 | 903 | #define USB_DEVICE_ID_SUPER_JOY_BOX_5_PRO 0x8804 |
904 | 904 | ||
905 | #define USB_VENDOR_ID_WISTRON 0x0fb8 | ||
906 | #define USB_DEVICE_ID_WISTRON_OPTICAL_TOUCH 0x1109 | ||
907 | |||
905 | #define USB_VENDOR_ID_X_TENSIONS 0x1ae7 | 908 | #define USB_VENDOR_ID_X_TENSIONS 0x1ae7 |
906 | #define USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE 0x9001 | 909 | #define USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE 0x9001 |
907 | 910 | ||
diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c index 73845120295e..ecb5ca669e97 100644 --- a/drivers/hid/hid-kye.c +++ b/drivers/hid/hid-kye.c | |||
@@ -341,6 +341,9 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
341 | case USB_DEVICE_ID_GENIUS_GX_IMPERATOR: | 341 | case USB_DEVICE_ID_GENIUS_GX_IMPERATOR: |
342 | rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83, | 342 | rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83, |
343 | "Genius Gx Imperator Keyboard"); | 343 | "Genius Gx Imperator Keyboard"); |
344 | case USB_DEVICE_ID_GENIUS_MANTICORE: | ||
345 | rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104, | ||
346 | "Genius Manticore Keyboard"); | ||
344 | break; | 347 | break; |
345 | } | 348 | } |
346 | return rdesc; | 349 | return rdesc; |
@@ -418,6 +421,14 @@ static int kye_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
418 | goto enabling_err; | 421 | goto enabling_err; |
419 | } | 422 | } |
420 | break; | 423 | break; |
424 | case USB_DEVICE_ID_GENIUS_MANTICORE: | ||
425 | /* | ||
426 | * The manticore keyboard needs to have all the interfaces | ||
427 | * opened at least once to be fully functional. | ||
428 | */ | ||
429 | if (hid_hw_open(hdev)) | ||
430 | hid_hw_close(hdev); | ||
431 | break; | ||
421 | } | 432 | } |
422 | 433 | ||
423 | return 0; | 434 | return 0; |
@@ -439,6 +450,8 @@ static const struct hid_device_id kye_devices[] = { | |||
439 | USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, | 450 | USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, |
440 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, | 451 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, |
441 | USB_DEVICE_ID_GENIUS_GX_IMPERATOR) }, | 452 | USB_DEVICE_ID_GENIUS_GX_IMPERATOR) }, |
453 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, | ||
454 | USB_DEVICE_ID_GENIUS_MANTICORE) }, | ||
442 | { } | 455 | { } |
443 | }; | 456 | }; |
444 | MODULE_DEVICE_TABLE(hid, kye_devices); | 457 | MODULE_DEVICE_TABLE(hid, kye_devices); |
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index a2cedb8ae1c0..d83b1e8b505b 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c | |||
@@ -1335,6 +1335,12 @@ static const struct hid_device_id mt_devices[] = { | |||
1335 | { .driver_data = MT_CLS_NSMU, | 1335 | { .driver_data = MT_CLS_NSMU, |
1336 | MT_USB_DEVICE(USB_VENDOR_ID_UNITEC, | 1336 | MT_USB_DEVICE(USB_VENDOR_ID_UNITEC, |
1337 | USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) }, | 1337 | USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) }, |
1338 | |||
1339 | /* Wistron panels */ | ||
1340 | { .driver_data = MT_CLS_NSMU, | ||
1341 | MT_USB_DEVICE(USB_VENDOR_ID_WISTRON, | ||
1342 | USB_DEVICE_ID_WISTRON_OPTICAL_TOUCH) }, | ||
1343 | |||
1338 | /* XAT */ | 1344 | /* XAT */ |
1339 | { .driver_data = MT_CLS_NSMU, | 1345 | { .driver_data = MT_CLS_NSMU, |
1340 | MT_USB_DEVICE(USB_VENDOR_ID_XAT, | 1346 | MT_USB_DEVICE(USB_VENDOR_ID_XAT, |
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index da551d113762..098af2f84b8c 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
@@ -225,6 +225,13 @@ static const unsigned int buzz_keymap[] = { | |||
225 | struct sony_sc { | 225 | struct sony_sc { |
226 | unsigned long quirks; | 226 | unsigned long quirks; |
227 | 227 | ||
228 | #ifdef CONFIG_SONY_FF | ||
229 | struct work_struct rumble_worker; | ||
230 | struct hid_device *hdev; | ||
231 | __u8 left; | ||
232 | __u8 right; | ||
233 | #endif | ||
234 | |||
228 | void *extra; | 235 | void *extra; |
229 | }; | 236 | }; |
230 | 237 | ||
@@ -615,9 +622,9 @@ static void buzz_remove(struct hid_device *hdev) | |||
615 | } | 622 | } |
616 | 623 | ||
617 | #ifdef CONFIG_SONY_FF | 624 | #ifdef CONFIG_SONY_FF |
618 | static int sony_play_effect(struct input_dev *dev, void *data, | 625 | static void sony_rumble_worker(struct work_struct *work) |
619 | struct ff_effect *effect) | ||
620 | { | 626 | { |
627 | struct sony_sc *sc = container_of(work, struct sony_sc, rumble_worker); | ||
621 | unsigned char buf[] = { | 628 | unsigned char buf[] = { |
622 | 0x01, | 629 | 0x01, |
623 | 0x00, 0xff, 0x00, 0xff, 0x00, | 630 | 0x00, 0xff, 0x00, 0xff, 0x00, |
@@ -628,21 +635,28 @@ static int sony_play_effect(struct input_dev *dev, void *data, | |||
628 | 0xff, 0x27, 0x10, 0x00, 0x32, | 635 | 0xff, 0x27, 0x10, 0x00, 0x32, |
629 | 0x00, 0x00, 0x00, 0x00, 0x00 | 636 | 0x00, 0x00, 0x00, 0x00, 0x00 |
630 | }; | 637 | }; |
631 | __u8 left; | 638 | |
632 | __u8 right; | 639 | buf[3] = sc->right; |
640 | buf[5] = sc->left; | ||
641 | |||
642 | sc->hdev->hid_output_raw_report(sc->hdev, buf, sizeof(buf), | ||
643 | HID_OUTPUT_REPORT); | ||
644 | } | ||
645 | |||
646 | static int sony_play_effect(struct input_dev *dev, void *data, | ||
647 | struct ff_effect *effect) | ||
648 | { | ||
633 | struct hid_device *hid = input_get_drvdata(dev); | 649 | struct hid_device *hid = input_get_drvdata(dev); |
650 | struct sony_sc *sc = hid_get_drvdata(hid); | ||
634 | 651 | ||
635 | if (effect->type != FF_RUMBLE) | 652 | if (effect->type != FF_RUMBLE) |
636 | return 0; | 653 | return 0; |
637 | 654 | ||
638 | left = effect->u.rumble.strong_magnitude / 256; | 655 | sc->left = effect->u.rumble.strong_magnitude / 256; |
639 | right = effect->u.rumble.weak_magnitude ? 1 : 0; | 656 | sc->right = effect->u.rumble.weak_magnitude ? 1 : 0; |
640 | |||
641 | buf[3] = right; | ||
642 | buf[5] = left; | ||
643 | 657 | ||
644 | return hid->hid_output_raw_report(hid, buf, sizeof(buf), | 658 | schedule_work(&sc->rumble_worker); |
645 | HID_OUTPUT_REPORT); | 659 | return 0; |
646 | } | 660 | } |
647 | 661 | ||
648 | static int sony_init_ff(struct hid_device *hdev) | 662 | static int sony_init_ff(struct hid_device *hdev) |
@@ -650,16 +664,31 @@ static int sony_init_ff(struct hid_device *hdev) | |||
650 | struct hid_input *hidinput = list_entry(hdev->inputs.next, | 664 | struct hid_input *hidinput = list_entry(hdev->inputs.next, |
651 | struct hid_input, list); | 665 | struct hid_input, list); |
652 | struct input_dev *input_dev = hidinput->input; | 666 | struct input_dev *input_dev = hidinput->input; |
667 | struct sony_sc *sc = hid_get_drvdata(hdev); | ||
668 | |||
669 | sc->hdev = hdev; | ||
670 | INIT_WORK(&sc->rumble_worker, sony_rumble_worker); | ||
653 | 671 | ||
654 | input_set_capability(input_dev, EV_FF, FF_RUMBLE); | 672 | input_set_capability(input_dev, EV_FF, FF_RUMBLE); |
655 | return input_ff_create_memless(input_dev, NULL, sony_play_effect); | 673 | return input_ff_create_memless(input_dev, NULL, sony_play_effect); |
656 | } | 674 | } |
657 | 675 | ||
676 | static void sony_destroy_ff(struct hid_device *hdev) | ||
677 | { | ||
678 | struct sony_sc *sc = hid_get_drvdata(hdev); | ||
679 | |||
680 | cancel_work_sync(&sc->rumble_worker); | ||
681 | } | ||
682 | |||
658 | #else | 683 | #else |
659 | static int sony_init_ff(struct hid_device *hdev) | 684 | static int sony_init_ff(struct hid_device *hdev) |
660 | { | 685 | { |
661 | return 0; | 686 | return 0; |
662 | } | 687 | } |
688 | |||
689 | static void sony_destroy_ff(struct hid_device *hdev) | ||
690 | { | ||
691 | } | ||
663 | #endif | 692 | #endif |
664 | 693 | ||
665 | static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) | 694 | static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) |
@@ -728,6 +757,8 @@ static void sony_remove(struct hid_device *hdev) | |||
728 | if (sc->quirks & BUZZ_CONTROLLER) | 757 | if (sc->quirks & BUZZ_CONTROLLER) |
729 | buzz_remove(hdev); | 758 | buzz_remove(hdev); |
730 | 759 | ||
760 | sony_destroy_ff(hdev); | ||
761 | |||
731 | hid_hw_stop(hdev); | 762 | hid_hw_stop(hdev); |
732 | } | 763 | } |
733 | 764 | ||
diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c index 1446f526ee8b..abb20db2b443 100644 --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c | |||
@@ -834,8 +834,7 @@ static void wiimote_init_set_type(struct wiimote_data *wdata, | |||
834 | goto done; | 834 | goto done; |
835 | } | 835 | } |
836 | 836 | ||
837 | if (vendor == USB_VENDOR_ID_NINTENDO || | 837 | if (vendor == USB_VENDOR_ID_NINTENDO) { |
838 | vendor == USB_VENDOR_ID_NINTENDO2) { | ||
839 | if (product == USB_DEVICE_ID_NINTENDO_WIIMOTE) { | 838 | if (product == USB_DEVICE_ID_NINTENDO_WIIMOTE) { |
840 | devtype = WIIMOTE_DEV_GEN10; | 839 | devtype = WIIMOTE_DEV_GEN10; |
841 | goto done; | 840 | goto done; |
@@ -1856,8 +1855,6 @@ static void wiimote_hid_remove(struct hid_device *hdev) | |||
1856 | static const struct hid_device_id wiimote_hid_devices[] = { | 1855 | static const struct hid_device_id wiimote_hid_devices[] = { |
1857 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, | 1856 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, |
1858 | USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | 1857 | USB_DEVICE_ID_NINTENDO_WIIMOTE) }, |
1859 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2, | ||
1860 | USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | ||
1861 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, | 1858 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, |
1862 | USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, | 1859 | USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, |
1863 | { } | 1860 | { } |
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 93b00d76374c..cedc6da93c19 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c | |||
@@ -287,7 +287,7 @@ static int uhid_event_from_user(const char __user *buffer, size_t len, | |||
287 | */ | 287 | */ |
288 | struct uhid_create_req_compat *compat; | 288 | struct uhid_create_req_compat *compat; |
289 | 289 | ||
290 | compat = kmalloc(sizeof(*compat), GFP_KERNEL); | 290 | compat = kzalloc(sizeof(*compat), GFP_KERNEL); |
291 | if (!compat) | 291 | if (!compat) |
292 | return -ENOMEM; | 292 | return -ENOMEM; |
293 | 293 | ||
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c index 1d7ff46812c3..dafc63c6932d 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/err.h> | 18 | #include <linux/err.h> |
19 | 19 | ||
20 | #include <acpi/acpi.h> | 20 | #include <acpi/acpi.h> |
21 | #include <acpi/acpixf.h> | ||
22 | #include <acpi/acpi_drivers.h> | 21 | #include <acpi/acpi_drivers.h> |
23 | #include <acpi/acpi_bus.h> | 22 | #include <acpi/acpi_bus.h> |
24 | 23 | ||
diff --git a/drivers/i2c/busses/i2c-bcm-kona.c b/drivers/i2c/busses/i2c-bcm-kona.c index 036cf03aeb61..18a74a6751a9 100644 --- a/drivers/i2c/busses/i2c-bcm-kona.c +++ b/drivers/i2c/busses/i2c-bcm-kona.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/clk.h> | ||
24 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
25 | 24 | ||
26 | /* Hardware register offsets and field defintions */ | 25 | /* Hardware register offsets and field defintions */ |
@@ -891,7 +890,7 @@ static const struct of_device_id bcm_kona_i2c_of_match[] = { | |||
891 | {.compatible = "brcm,kona-i2c",}, | 890 | {.compatible = "brcm,kona-i2c",}, |
892 | {}, | 891 | {}, |
893 | }; | 892 | }; |
894 | MODULE_DEVICE_TABLE(of, kona_i2c_of_match); | 893 | MODULE_DEVICE_TABLE(of, bcm_kona_i2c_of_match); |
895 | 894 | ||
896 | static struct platform_driver bcm_kona_i2c_driver = { | 895 | static struct platform_driver bcm_kona_i2c_driver = { |
897 | .driver = { | 896 | .driver = { |
diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c index d7e8600f31fb..77df97b932af 100644 --- a/drivers/i2c/busses/i2c-bcm2835.c +++ b/drivers/i2c/busses/i2c-bcm2835.c | |||
@@ -299,6 +299,7 @@ static int bcm2835_i2c_probe(struct platform_device *pdev) | |||
299 | strlcpy(adap->name, "bcm2835 I2C adapter", sizeof(adap->name)); | 299 | strlcpy(adap->name, "bcm2835 I2C adapter", sizeof(adap->name)); |
300 | adap->algo = &bcm2835_i2c_algo; | 300 | adap->algo = &bcm2835_i2c_algo; |
301 | adap->dev.parent = &pdev->dev; | 301 | adap->dev.parent = &pdev->dev; |
302 | adap->dev.of_node = pdev->dev.of_node; | ||
302 | 303 | ||
303 | bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, 0); | 304 | bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, 0); |
304 | 305 | ||
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index ff05d9fef4a8..af0b5830303d 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c | |||
@@ -125,12 +125,12 @@ static struct davinci_i2c_platform_data davinci_i2c_platform_data_default = { | |||
125 | static inline void davinci_i2c_write_reg(struct davinci_i2c_dev *i2c_dev, | 125 | static inline void davinci_i2c_write_reg(struct davinci_i2c_dev *i2c_dev, |
126 | int reg, u16 val) | 126 | int reg, u16 val) |
127 | { | 127 | { |
128 | __raw_writew(val, i2c_dev->base + reg); | 128 | writew_relaxed(val, i2c_dev->base + reg); |
129 | } | 129 | } |
130 | 130 | ||
131 | static inline u16 davinci_i2c_read_reg(struct davinci_i2c_dev *i2c_dev, int reg) | 131 | static inline u16 davinci_i2c_read_reg(struct davinci_i2c_dev *i2c_dev, int reg) |
132 | { | 132 | { |
133 | return __raw_readw(i2c_dev->base + reg); | 133 | return readw_relaxed(i2c_dev->base + reg); |
134 | } | 134 | } |
135 | 135 | ||
136 | /* Generate a pulse on the i2c clock pin. */ | 136 | /* Generate a pulse on the i2c clock pin. */ |
diff --git a/drivers/i2c/busses/i2c-diolan-u2c.c b/drivers/i2c/busses/i2c-diolan-u2c.c index dae3ddfe7619..721f7ebf9a3b 100644 --- a/drivers/i2c/busses/i2c-diolan-u2c.c +++ b/drivers/i2c/busses/i2c-diolan-u2c.c | |||
@@ -25,8 +25,6 @@ | |||
25 | #define USB_VENDOR_ID_DIOLAN 0x0abf | 25 | #define USB_VENDOR_ID_DIOLAN 0x0abf |
26 | #define USB_DEVICE_ID_DIOLAN_U2C 0x3370 | 26 | #define USB_DEVICE_ID_DIOLAN_U2C 0x3370 |
27 | 27 | ||
28 | #define DIOLAN_OUT_EP 0x02 | ||
29 | #define DIOLAN_IN_EP 0x84 | ||
30 | 28 | ||
31 | /* commands via USB, must match command ids in the firmware */ | 29 | /* commands via USB, must match command ids in the firmware */ |
32 | #define CMD_I2C_READ 0x01 | 30 | #define CMD_I2C_READ 0x01 |
@@ -84,6 +82,7 @@ | |||
84 | struct i2c_diolan_u2c { | 82 | struct i2c_diolan_u2c { |
85 | u8 obuffer[DIOLAN_OUTBUF_LEN]; /* output buffer */ | 83 | u8 obuffer[DIOLAN_OUTBUF_LEN]; /* output buffer */ |
86 | u8 ibuffer[DIOLAN_INBUF_LEN]; /* input buffer */ | 84 | u8 ibuffer[DIOLAN_INBUF_LEN]; /* input buffer */ |
85 | int ep_in, ep_out; /* Endpoints */ | ||
87 | struct usb_device *usb_dev; /* the usb device for this device */ | 86 | struct usb_device *usb_dev; /* the usb device for this device */ |
88 | struct usb_interface *interface;/* the interface for this device */ | 87 | struct usb_interface *interface;/* the interface for this device */ |
89 | struct i2c_adapter adapter; /* i2c related things */ | 88 | struct i2c_adapter adapter; /* i2c related things */ |
@@ -109,7 +108,7 @@ static int diolan_usb_transfer(struct i2c_diolan_u2c *dev) | |||
109 | return -EINVAL; | 108 | return -EINVAL; |
110 | 109 | ||
111 | ret = usb_bulk_msg(dev->usb_dev, | 110 | ret = usb_bulk_msg(dev->usb_dev, |
112 | usb_sndbulkpipe(dev->usb_dev, DIOLAN_OUT_EP), | 111 | usb_sndbulkpipe(dev->usb_dev, dev->ep_out), |
113 | dev->obuffer, dev->olen, &actual, | 112 | dev->obuffer, dev->olen, &actual, |
114 | DIOLAN_USB_TIMEOUT); | 113 | DIOLAN_USB_TIMEOUT); |
115 | if (!ret) { | 114 | if (!ret) { |
@@ -118,7 +117,7 @@ static int diolan_usb_transfer(struct i2c_diolan_u2c *dev) | |||
118 | 117 | ||
119 | tmpret = usb_bulk_msg(dev->usb_dev, | 118 | tmpret = usb_bulk_msg(dev->usb_dev, |
120 | usb_rcvbulkpipe(dev->usb_dev, | 119 | usb_rcvbulkpipe(dev->usb_dev, |
121 | DIOLAN_IN_EP), | 120 | dev->ep_in), |
122 | dev->ibuffer, | 121 | dev->ibuffer, |
123 | sizeof(dev->ibuffer), &actual, | 122 | sizeof(dev->ibuffer), &actual, |
124 | DIOLAN_USB_TIMEOUT); | 123 | DIOLAN_USB_TIMEOUT); |
@@ -210,7 +209,7 @@ static void diolan_flush_input(struct i2c_diolan_u2c *dev) | |||
210 | int ret; | 209 | int ret; |
211 | 210 | ||
212 | ret = usb_bulk_msg(dev->usb_dev, | 211 | ret = usb_bulk_msg(dev->usb_dev, |
213 | usb_rcvbulkpipe(dev->usb_dev, DIOLAN_IN_EP), | 212 | usb_rcvbulkpipe(dev->usb_dev, dev->ep_in), |
214 | dev->ibuffer, sizeof(dev->ibuffer), &actual, | 213 | dev->ibuffer, sizeof(dev->ibuffer), &actual, |
215 | DIOLAN_USB_TIMEOUT); | 214 | DIOLAN_USB_TIMEOUT); |
216 | if (ret < 0 || actual == 0) | 215 | if (ret < 0 || actual == 0) |
@@ -445,9 +444,14 @@ static void diolan_u2c_free(struct i2c_diolan_u2c *dev) | |||
445 | static int diolan_u2c_probe(struct usb_interface *interface, | 444 | static int diolan_u2c_probe(struct usb_interface *interface, |
446 | const struct usb_device_id *id) | 445 | const struct usb_device_id *id) |
447 | { | 446 | { |
447 | struct usb_host_interface *hostif = interface->cur_altsetting; | ||
448 | struct i2c_diolan_u2c *dev; | 448 | struct i2c_diolan_u2c *dev; |
449 | int ret; | 449 | int ret; |
450 | 450 | ||
451 | if (hostif->desc.bInterfaceNumber != 0 | ||
452 | || hostif->desc.bNumEndpoints < 2) | ||
453 | return -ENODEV; | ||
454 | |||
451 | /* allocate memory for our device state and initialize it */ | 455 | /* allocate memory for our device state and initialize it */ |
452 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 456 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
453 | if (dev == NULL) { | 457 | if (dev == NULL) { |
@@ -455,6 +459,8 @@ static int diolan_u2c_probe(struct usb_interface *interface, | |||
455 | ret = -ENOMEM; | 459 | ret = -ENOMEM; |
456 | goto error; | 460 | goto error; |
457 | } | 461 | } |
462 | dev->ep_out = hostif->endpoint[0].desc.bEndpointAddress; | ||
463 | dev->ep_in = hostif->endpoint[1].desc.bEndpointAddress; | ||
458 | 464 | ||
459 | dev->usb_dev = usb_get_dev(interface_to_usbdev(interface)); | 465 | dev->usb_dev = usb_get_dev(interface_to_usbdev(interface)); |
460 | dev->interface = interface; | 466 | dev->interface = interface; |
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index a6a891d7970d..90dcc2eaac5f 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -266,13 +266,13 @@ static const u8 reg_map_ip_v2[] = { | |||
266 | static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev, | 266 | static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev, |
267 | int reg, u16 val) | 267 | int reg, u16 val) |
268 | { | 268 | { |
269 | __raw_writew(val, i2c_dev->base + | 269 | writew_relaxed(val, i2c_dev->base + |
270 | (i2c_dev->regs[reg] << i2c_dev->reg_shift)); | 270 | (i2c_dev->regs[reg] << i2c_dev->reg_shift)); |
271 | } | 271 | } |
272 | 272 | ||
273 | static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg) | 273 | static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg) |
274 | { | 274 | { |
275 | return __raw_readw(i2c_dev->base + | 275 | return readw_relaxed(i2c_dev->base + |
276 | (i2c_dev->regs[reg] << i2c_dev->reg_shift)); | 276 | (i2c_dev->regs[reg] << i2c_dev->reg_shift)); |
277 | } | 277 | } |
278 | 278 | ||
@@ -1037,6 +1037,20 @@ static const struct i2c_algorithm omap_i2c_algo = { | |||
1037 | }; | 1037 | }; |
1038 | 1038 | ||
1039 | #ifdef CONFIG_OF | 1039 | #ifdef CONFIG_OF |
1040 | static struct omap_i2c_bus_platform_data omap2420_pdata = { | ||
1041 | .rev = OMAP_I2C_IP_VERSION_1, | ||
1042 | .flags = OMAP_I2C_FLAG_NO_FIFO | | ||
1043 | OMAP_I2C_FLAG_SIMPLE_CLOCK | | ||
1044 | OMAP_I2C_FLAG_16BIT_DATA_REG | | ||
1045 | OMAP_I2C_FLAG_BUS_SHIFT_2, | ||
1046 | }; | ||
1047 | |||
1048 | static struct omap_i2c_bus_platform_data omap2430_pdata = { | ||
1049 | .rev = OMAP_I2C_IP_VERSION_1, | ||
1050 | .flags = OMAP_I2C_FLAG_BUS_SHIFT_2 | | ||
1051 | OMAP_I2C_FLAG_FORCE_19200_INT_CLK, | ||
1052 | }; | ||
1053 | |||
1040 | static struct omap_i2c_bus_platform_data omap3_pdata = { | 1054 | static struct omap_i2c_bus_platform_data omap3_pdata = { |
1041 | .rev = OMAP_I2C_IP_VERSION_1, | 1055 | .rev = OMAP_I2C_IP_VERSION_1, |
1042 | .flags = OMAP_I2C_FLAG_BUS_SHIFT_2, | 1056 | .flags = OMAP_I2C_FLAG_BUS_SHIFT_2, |
@@ -1055,6 +1069,14 @@ static const struct of_device_id omap_i2c_of_match[] = { | |||
1055 | .compatible = "ti,omap3-i2c", | 1069 | .compatible = "ti,omap3-i2c", |
1056 | .data = &omap3_pdata, | 1070 | .data = &omap3_pdata, |
1057 | }, | 1071 | }, |
1072 | { | ||
1073 | .compatible = "ti,omap2430-i2c", | ||
1074 | .data = &omap2430_pdata, | ||
1075 | }, | ||
1076 | { | ||
1077 | .compatible = "ti,omap2420-i2c", | ||
1078 | .data = &omap2420_pdata, | ||
1079 | }, | ||
1058 | { }, | 1080 | { }, |
1059 | }; | 1081 | }; |
1060 | MODULE_DEVICE_TABLE(of, omap_i2c_of_match); | 1082 | MODULE_DEVICE_TABLE(of, omap_i2c_of_match); |
@@ -1140,9 +1162,9 @@ omap_i2c_probe(struct platform_device *pdev) | |||
1140 | * Read the Rev hi bit-[15:14] ie scheme this is 1 indicates ver2. | 1162 | * Read the Rev hi bit-[15:14] ie scheme this is 1 indicates ver2. |
1141 | * On omap1/3/2 Offset 4 is IE Reg the bit [15:14] is 0 at reset. | 1163 | * On omap1/3/2 Offset 4 is IE Reg the bit [15:14] is 0 at reset. |
1142 | * Also since the omap_i2c_read_reg uses reg_map_ip_* a | 1164 | * Also since the omap_i2c_read_reg uses reg_map_ip_* a |
1143 | * raw_readw is done. | 1165 | * readw_relaxed is done. |
1144 | */ | 1166 | */ |
1145 | rev = __raw_readw(dev->base + 0x04); | 1167 | rev = readw_relaxed(dev->base + 0x04); |
1146 | 1168 | ||
1147 | dev->scheme = OMAP_I2C_SCHEME(rev); | 1169 | dev->scheme = OMAP_I2C_SCHEME(rev); |
1148 | switch (dev->scheme) { | 1170 | switch (dev->scheme) { |
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index cbd4e9abc47e..92d1206482a6 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
@@ -329,7 +329,7 @@ static struct cpuidle_state atom_cstates[] __initdata = { | |||
329 | { | 329 | { |
330 | .enter = NULL } | 330 | .enter = NULL } |
331 | }; | 331 | }; |
332 | static struct cpuidle_state avn_cstates[CPUIDLE_STATE_MAX] = { | 332 | static struct cpuidle_state avn_cstates[] __initdata = { |
333 | { | 333 | { |
334 | .name = "C1-AVN", | 334 | .name = "C1-AVN", |
335 | .desc = "MWAIT 0x00", | 335 | .desc = "MWAIT 0x00", |
@@ -340,7 +340,7 @@ static struct cpuidle_state avn_cstates[CPUIDLE_STATE_MAX] = { | |||
340 | { | 340 | { |
341 | .name = "C6-AVN", | 341 | .name = "C6-AVN", |
342 | .desc = "MWAIT 0x51", | 342 | .desc = "MWAIT 0x51", |
343 | .flags = MWAIT2flg(0x58) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | 343 | .flags = MWAIT2flg(0x51) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, |
344 | .exit_latency = 15, | 344 | .exit_latency = 15, |
345 | .target_residency = 45, | 345 | .target_residency = 45, |
346 | .enter = &intel_idle }, | 346 | .enter = &intel_idle }, |
diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c index dcda17395c4e..1cae4e920c9b 100644 --- a/drivers/iio/accel/hid-sensor-accel-3d.c +++ b/drivers/iio/accel/hid-sensor-accel-3d.c | |||
@@ -350,7 +350,7 @@ static int hid_accel_3d_probe(struct platform_device *pdev) | |||
350 | error_iio_unreg: | 350 | error_iio_unreg: |
351 | iio_device_unregister(indio_dev); | 351 | iio_device_unregister(indio_dev); |
352 | error_remove_trigger: | 352 | error_remove_trigger: |
353 | hid_sensor_remove_trigger(indio_dev); | 353 | hid_sensor_remove_trigger(&accel_state->common_attributes); |
354 | error_unreg_buffer_funcs: | 354 | error_unreg_buffer_funcs: |
355 | iio_triggered_buffer_cleanup(indio_dev); | 355 | iio_triggered_buffer_cleanup(indio_dev); |
356 | error_free_dev_mem: | 356 | error_free_dev_mem: |
@@ -363,10 +363,11 @@ static int hid_accel_3d_remove(struct platform_device *pdev) | |||
363 | { | 363 | { |
364 | struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; | 364 | struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; |
365 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); | 365 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); |
366 | struct accel_3d_state *accel_state = iio_priv(indio_dev); | ||
366 | 367 | ||
367 | sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_ACCEL_3D); | 368 | sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_ACCEL_3D); |
368 | iio_device_unregister(indio_dev); | 369 | iio_device_unregister(indio_dev); |
369 | hid_sensor_remove_trigger(indio_dev); | 370 | hid_sensor_remove_trigger(&accel_state->common_attributes); |
370 | iio_triggered_buffer_cleanup(indio_dev); | 371 | iio_triggered_buffer_cleanup(indio_dev); |
371 | kfree(indio_dev->channels); | 372 | kfree(indio_dev->channels); |
372 | 373 | ||
diff --git a/drivers/iio/accel/kxsd9.c b/drivers/iio/accel/kxsd9.c index d72118d1189c..98ba761cbb9c 100644 --- a/drivers/iio/accel/kxsd9.c +++ b/drivers/iio/accel/kxsd9.c | |||
@@ -112,9 +112,10 @@ static int kxsd9_read(struct iio_dev *indio_dev, u8 address) | |||
112 | mutex_lock(&st->buf_lock); | 112 | mutex_lock(&st->buf_lock); |
113 | st->tx[0] = KXSD9_READ(address); | 113 | st->tx[0] = KXSD9_READ(address); |
114 | ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers)); | 114 | ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers)); |
115 | if (ret) | 115 | if (!ret) |
116 | return ret; | 116 | ret = (((u16)(st->rx[0])) << 8) | (st->rx[1] & 0xF0); |
117 | return (((u16)(st->rx[0])) << 8) | (st->rx[1] & 0xF0); | 117 | mutex_unlock(&st->buf_lock); |
118 | return ret; | ||
118 | } | 119 | } |
119 | 120 | ||
120 | static IIO_CONST_ATTR(accel_scale_available, | 121 | static IIO_CONST_ATTR(accel_scale_available, |
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 17df74908db1..5b1aa027c034 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c | |||
@@ -1047,6 +1047,7 @@ static int at91_adc_probe(struct platform_device *pdev) | |||
1047 | } else { | 1047 | } else { |
1048 | if (!st->caps->has_tsmr) { | 1048 | if (!st->caps->has_tsmr) { |
1049 | dev_err(&pdev->dev, "We don't support non-TSMR adc\n"); | 1049 | dev_err(&pdev->dev, "We don't support non-TSMR adc\n"); |
1050 | ret = -ENODEV; | ||
1050 | goto error_disable_adc_clk; | 1051 | goto error_disable_adc_clk; |
1051 | } | 1052 | } |
1052 | 1053 | ||
diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c index 12948325431c..c8c1baaec6c1 100644 --- a/drivers/iio/adc/mcp3422.c +++ b/drivers/iio/adc/mcp3422.c | |||
@@ -88,10 +88,10 @@ static const int mcp3422_sample_rates[4] = { | |||
88 | 88 | ||
89 | /* sample rates to sign extension table */ | 89 | /* sample rates to sign extension table */ |
90 | static const int mcp3422_sign_extend[4] = { | 90 | static const int mcp3422_sign_extend[4] = { |
91 | [MCP3422_SRATE_240] = 12, | 91 | [MCP3422_SRATE_240] = 11, |
92 | [MCP3422_SRATE_60] = 14, | 92 | [MCP3422_SRATE_60] = 13, |
93 | [MCP3422_SRATE_15] = 16, | 93 | [MCP3422_SRATE_15] = 15, |
94 | [MCP3422_SRATE_3] = 18 }; | 94 | [MCP3422_SRATE_3] = 17 }; |
95 | 95 | ||
96 | /* Client data (each client gets its own) */ | 96 | /* Client data (each client gets its own) */ |
97 | struct mcp3422 { | 97 | struct mcp3422 { |
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index 728411ec7642..d4d748214e4b 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c | |||
@@ -229,12 +229,15 @@ static int tiadc_iio_buffered_hardware_setup(struct iio_dev *indio_dev, | |||
229 | unsigned long flags, | 229 | unsigned long flags, |
230 | const struct iio_buffer_setup_ops *setup_ops) | 230 | const struct iio_buffer_setup_ops *setup_ops) |
231 | { | 231 | { |
232 | struct iio_buffer *buffer; | ||
232 | int ret; | 233 | int ret; |
233 | 234 | ||
234 | indio_dev->buffer = iio_kfifo_allocate(indio_dev); | 235 | buffer = iio_kfifo_allocate(indio_dev); |
235 | if (!indio_dev->buffer) | 236 | if (!buffer) |
236 | return -ENOMEM; | 237 | return -ENOMEM; |
237 | 238 | ||
239 | iio_device_attach_buffer(indio_dev, buffer); | ||
240 | |||
238 | ret = request_threaded_irq(irq, pollfunc_th, pollfunc_bh, | 241 | ret = request_threaded_irq(irq, pollfunc_th, pollfunc_bh, |
239 | flags, indio_dev->name, indio_dev); | 242 | flags, indio_dev->name, indio_dev); |
240 | if (ret) | 243 | if (ret) |
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index b6e77e0fc420..bbd6426c9726 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c | |||
@@ -55,11 +55,10 @@ static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig, | |||
55 | return 0; | 55 | return 0; |
56 | } | 56 | } |
57 | 57 | ||
58 | void hid_sensor_remove_trigger(struct iio_dev *indio_dev) | 58 | void hid_sensor_remove_trigger(struct hid_sensor_common *attrb) |
59 | { | 59 | { |
60 | iio_trigger_unregister(indio_dev->trig); | 60 | iio_trigger_unregister(attrb->trigger); |
61 | iio_trigger_free(indio_dev->trig); | 61 | iio_trigger_free(attrb->trigger); |
62 | indio_dev->trig = NULL; | ||
63 | } | 62 | } |
64 | EXPORT_SYMBOL(hid_sensor_remove_trigger); | 63 | EXPORT_SYMBOL(hid_sensor_remove_trigger); |
65 | 64 | ||
@@ -90,7 +89,7 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name, | |||
90 | dev_err(&indio_dev->dev, "Trigger Register Failed\n"); | 89 | dev_err(&indio_dev->dev, "Trigger Register Failed\n"); |
91 | goto error_free_trig; | 90 | goto error_free_trig; |
92 | } | 91 | } |
93 | indio_dev->trig = trig; | 92 | indio_dev->trig = attrb->trigger = trig; |
94 | 93 | ||
95 | return ret; | 94 | return ret; |
96 | 95 | ||
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.h b/drivers/iio/common/hid-sensors/hid-sensor-trigger.h index 9a8731478eda..ca02f7811aa8 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.h +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.h | |||
@@ -21,6 +21,6 @@ | |||
21 | 21 | ||
22 | int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name, | 22 | int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name, |
23 | struct hid_sensor_common *attrb); | 23 | struct hid_sensor_common *attrb); |
24 | void hid_sensor_remove_trigger(struct iio_dev *indio_dev); | 24 | void hid_sensor_remove_trigger(struct hid_sensor_common *attrb); |
25 | 25 | ||
26 | #endif | 26 | #endif |
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c index ea01c6bcfb56..e54f0f4959d3 100644 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c | |||
@@ -348,7 +348,7 @@ static int hid_gyro_3d_probe(struct platform_device *pdev) | |||
348 | error_iio_unreg: | 348 | error_iio_unreg: |
349 | iio_device_unregister(indio_dev); | 349 | iio_device_unregister(indio_dev); |
350 | error_remove_trigger: | 350 | error_remove_trigger: |
351 | hid_sensor_remove_trigger(indio_dev); | 351 | hid_sensor_remove_trigger(&gyro_state->common_attributes); |
352 | error_unreg_buffer_funcs: | 352 | error_unreg_buffer_funcs: |
353 | iio_triggered_buffer_cleanup(indio_dev); | 353 | iio_triggered_buffer_cleanup(indio_dev); |
354 | error_free_dev_mem: | 354 | error_free_dev_mem: |
@@ -361,10 +361,11 @@ static int hid_gyro_3d_remove(struct platform_device *pdev) | |||
361 | { | 361 | { |
362 | struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; | 362 | struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; |
363 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); | 363 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); |
364 | struct gyro_3d_state *gyro_state = iio_priv(indio_dev); | ||
364 | 365 | ||
365 | sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_GYRO_3D); | 366 | sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_GYRO_3D); |
366 | iio_device_unregister(indio_dev); | 367 | iio_device_unregister(indio_dev); |
367 | hid_sensor_remove_trigger(indio_dev); | 368 | hid_sensor_remove_trigger(&gyro_state->common_attributes); |
368 | iio_triggered_buffer_cleanup(indio_dev); | 369 | iio_triggered_buffer_cleanup(indio_dev); |
369 | kfree(indio_dev->channels); | 370 | kfree(indio_dev->channels); |
370 | 371 | ||
diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig index f98c2b509254..b0d65df3ede2 100644 --- a/drivers/iio/light/Kconfig +++ b/drivers/iio/light/Kconfig | |||
@@ -81,6 +81,8 @@ config SENSORS_LM3533 | |||
81 | config TCS3472 | 81 | config TCS3472 |
82 | tristate "TAOS TCS3472 color light-to-digital converter" | 82 | tristate "TAOS TCS3472 color light-to-digital converter" |
83 | depends on I2C | 83 | depends on I2C |
84 | select IIO_BUFFER | ||
85 | select IIO_TRIGGERED_BUFFER | ||
84 | help | 86 | help |
85 | If you say yes here you get support for the TAOS TCS3472 | 87 | If you say yes here you get support for the TAOS TCS3472 |
86 | family of color light-to-digital converters with IR filter. | 88 | family of color light-to-digital converters with IR filter. |
diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index fa6ae8cf89ea..8e8b9d722853 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c | |||
@@ -314,7 +314,7 @@ static int hid_als_probe(struct platform_device *pdev) | |||
314 | error_iio_unreg: | 314 | error_iio_unreg: |
315 | iio_device_unregister(indio_dev); | 315 | iio_device_unregister(indio_dev); |
316 | error_remove_trigger: | 316 | error_remove_trigger: |
317 | hid_sensor_remove_trigger(indio_dev); | 317 | hid_sensor_remove_trigger(&als_state->common_attributes); |
318 | error_unreg_buffer_funcs: | 318 | error_unreg_buffer_funcs: |
319 | iio_triggered_buffer_cleanup(indio_dev); | 319 | iio_triggered_buffer_cleanup(indio_dev); |
320 | error_free_dev_mem: | 320 | error_free_dev_mem: |
@@ -327,10 +327,11 @@ static int hid_als_remove(struct platform_device *pdev) | |||
327 | { | 327 | { |
328 | struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; | 328 | struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; |
329 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); | 329 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); |
330 | struct als_state *als_state = iio_priv(indio_dev); | ||
330 | 331 | ||
331 | sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_ALS); | 332 | sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_ALS); |
332 | iio_device_unregister(indio_dev); | 333 | iio_device_unregister(indio_dev); |
333 | hid_sensor_remove_trigger(indio_dev); | 334 | hid_sensor_remove_trigger(&als_state->common_attributes); |
334 | iio_triggered_buffer_cleanup(indio_dev); | 335 | iio_triggered_buffer_cleanup(indio_dev); |
335 | kfree(indio_dev->channels); | 336 | kfree(indio_dev->channels); |
336 | 337 | ||
diff --git a/drivers/iio/magnetometer/Kconfig b/drivers/iio/magnetometer/Kconfig index 0cf09637b35b..d86d226dcd67 100644 --- a/drivers/iio/magnetometer/Kconfig +++ b/drivers/iio/magnetometer/Kconfig | |||
@@ -19,6 +19,8 @@ config AK8975 | |||
19 | config MAG3110 | 19 | config MAG3110 |
20 | tristate "Freescale MAG3110 3-Axis Magnetometer" | 20 | tristate "Freescale MAG3110 3-Axis Magnetometer" |
21 | depends on I2C | 21 | depends on I2C |
22 | select IIO_BUFFER | ||
23 | select IIO_TRIGGERED_BUFFER | ||
22 | help | 24 | help |
23 | Say yes here to build support for the Freescale MAG3110 3-Axis | 25 | Say yes here to build support for the Freescale MAG3110 3-Axis |
24 | magnetometer. | 26 | magnetometer. |
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c index 2634920562fb..b26e1028a0a0 100644 --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c | |||
@@ -351,7 +351,7 @@ static int hid_magn_3d_probe(struct platform_device *pdev) | |||
351 | error_iio_unreg: | 351 | error_iio_unreg: |
352 | iio_device_unregister(indio_dev); | 352 | iio_device_unregister(indio_dev); |
353 | error_remove_trigger: | 353 | error_remove_trigger: |
354 | hid_sensor_remove_trigger(indio_dev); | 354 | hid_sensor_remove_trigger(&magn_state->common_attributes); |
355 | error_unreg_buffer_funcs: | 355 | error_unreg_buffer_funcs: |
356 | iio_triggered_buffer_cleanup(indio_dev); | 356 | iio_triggered_buffer_cleanup(indio_dev); |
357 | error_free_dev_mem: | 357 | error_free_dev_mem: |
@@ -364,10 +364,11 @@ static int hid_magn_3d_remove(struct platform_device *pdev) | |||
364 | { | 364 | { |
365 | struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; | 365 | struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; |
366 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); | 366 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); |
367 | struct magn_3d_state *magn_state = iio_priv(indio_dev); | ||
367 | 368 | ||
368 | sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_COMPASS_3D); | 369 | sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_COMPASS_3D); |
369 | iio_device_unregister(indio_dev); | 370 | iio_device_unregister(indio_dev); |
370 | hid_sensor_remove_trigger(indio_dev); | 371 | hid_sensor_remove_trigger(&magn_state->common_attributes); |
371 | iio_triggered_buffer_cleanup(indio_dev); | 372 | iio_triggered_buffer_cleanup(indio_dev); |
372 | kfree(indio_dev->channels); | 373 | kfree(indio_dev->channels); |
373 | 374 | ||
diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c index 783c5b417356..becf54496967 100644 --- a/drivers/iio/magnetometer/mag3110.c +++ b/drivers/iio/magnetometer/mag3110.c | |||
@@ -250,7 +250,12 @@ done: | |||
250 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ) | \ | 250 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ) | \ |
251 | BIT(IIO_CHAN_INFO_SCALE), \ | 251 | BIT(IIO_CHAN_INFO_SCALE), \ |
252 | .scan_index = idx, \ | 252 | .scan_index = idx, \ |
253 | .scan_type = IIO_ST('s', 16, 16, IIO_BE), \ | 253 | .scan_type = { \ |
254 | .sign = 's', \ | ||
255 | .realbits = 16, \ | ||
256 | .storagebits = 16, \ | ||
257 | .endianness = IIO_BE, \ | ||
258 | }, \ | ||
254 | } | 259 | } |
255 | 260 | ||
256 | static const struct iio_chan_spec mag3110_channels[] = { | 261 | static const struct iio_chan_spec mag3110_channels[] = { |
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c index 86b822806e95..45e0e3e55de2 100644 --- a/drivers/input/misc/hp_sdc_rtc.c +++ b/drivers/input/misc/hp_sdc_rtc.c | |||
@@ -180,7 +180,10 @@ static int64_t hp_sdc_rtc_read_i8042timer (uint8_t loadcmd, int numreg) | |||
180 | if (WARN_ON(down_interruptible(&i8042tregs))) | 180 | if (WARN_ON(down_interruptible(&i8042tregs))) |
181 | return -1; | 181 | return -1; |
182 | 182 | ||
183 | if (hp_sdc_enqueue_transaction(&t)) return -1; | 183 | if (hp_sdc_enqueue_transaction(&t)) { |
184 | up(&i8042tregs); | ||
185 | return -1; | ||
186 | } | ||
184 | 187 | ||
185 | /* Sleep until results come back. */ | 188 | /* Sleep until results come back. */ |
186 | if (WARN_ON(down_interruptible(&i8042tregs))) | 189 | if (WARN_ON(down_interruptible(&i8042tregs))) |
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 00d1e547b211..961d58d32647 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
@@ -906,6 +906,17 @@ config TOUCHSCREEN_STMPE | |||
906 | To compile this driver as a module, choose M here: the | 906 | To compile this driver as a module, choose M here: the |
907 | module will be called stmpe-ts. | 907 | module will be called stmpe-ts. |
908 | 908 | ||
909 | config TOUCHSCREEN_SUR40 | ||
910 | tristate "Samsung SUR40 (Surface 2.0/PixelSense) touchscreen" | ||
911 | depends on USB | ||
912 | select INPUT_POLLDEV | ||
913 | help | ||
914 | Say Y here if you want support for the Samsung SUR40 touchscreen | ||
915 | (also known as Microsoft Surface 2.0 or Microsoft PixelSense). | ||
916 | |||
917 | To compile this driver as a module, choose M here: the | ||
918 | module will be called sur40. | ||
919 | |||
909 | config TOUCHSCREEN_TPS6507X | 920 | config TOUCHSCREEN_TPS6507X |
910 | tristate "TPS6507x based touchscreens" | 921 | tristate "TPS6507x based touchscreens" |
911 | depends on I2C | 922 | depends on I2C |
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index 7587883b8d38..62801f213346 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile | |||
@@ -54,6 +54,7 @@ obj-$(CONFIG_TOUCHSCREEN_PIXCIR) += pixcir_i2c_ts.o | |||
54 | obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o | 54 | obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o |
55 | obj-$(CONFIG_TOUCHSCREEN_ST1232) += st1232.o | 55 | obj-$(CONFIG_TOUCHSCREEN_ST1232) += st1232.o |
56 | obj-$(CONFIG_TOUCHSCREEN_STMPE) += stmpe-ts.o | 56 | obj-$(CONFIG_TOUCHSCREEN_STMPE) += stmpe-ts.o |
57 | obj-$(CONFIG_TOUCHSCREEN_SUR40) += sur40.o | ||
57 | obj-$(CONFIG_TOUCHSCREEN_TI_AM335X_TSC) += ti_am335x_tsc.o | 58 | obj-$(CONFIG_TOUCHSCREEN_TI_AM335X_TSC) += ti_am335x_tsc.o |
58 | obj-$(CONFIG_TOUCHSCREEN_TNETV107X) += tnetv107x-ts.o | 59 | obj-$(CONFIG_TOUCHSCREEN_TNETV107X) += tnetv107x-ts.o |
59 | obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o | 60 | obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o |
diff --git a/drivers/input/touchscreen/atmel-wm97xx.c b/drivers/input/touchscreen/atmel-wm97xx.c index 268a35e55d7f..279c0e42b8a7 100644 --- a/drivers/input/touchscreen/atmel-wm97xx.c +++ b/drivers/input/touchscreen/atmel-wm97xx.c | |||
@@ -391,7 +391,7 @@ static int __exit atmel_wm97xx_remove(struct platform_device *pdev) | |||
391 | } | 391 | } |
392 | 392 | ||
393 | #ifdef CONFIG_PM_SLEEP | 393 | #ifdef CONFIG_PM_SLEEP |
394 | static int atmel_wm97xx_suspend(struct *dev) | 394 | static int atmel_wm97xx_suspend(struct device *dev) |
395 | { | 395 | { |
396 | struct platform_device *pdev = to_platform_device(dev); | 396 | struct platform_device *pdev = to_platform_device(dev); |
397 | struct atmel_wm97xx *atmel_wm97xx = platform_get_drvdata(pdev); | 397 | struct atmel_wm97xx *atmel_wm97xx = platform_get_drvdata(pdev); |
diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c index 42d830efa316..a035a390f8e2 100644 --- a/drivers/input/touchscreen/cyttsp4_core.c +++ b/drivers/input/touchscreen/cyttsp4_core.c | |||
@@ -1246,8 +1246,7 @@ static void cyttsp4_watchdog_timer(unsigned long handle) | |||
1246 | 1246 | ||
1247 | dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__); | 1247 | dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__); |
1248 | 1248 | ||
1249 | if (!work_pending(&cd->watchdog_work)) | 1249 | schedule_work(&cd->watchdog_work); |
1250 | schedule_work(&cd->watchdog_work); | ||
1251 | 1250 | ||
1252 | return; | 1251 | return; |
1253 | } | 1252 | } |
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c new file mode 100644 index 000000000000..cfd1b7e8c001 --- /dev/null +++ b/drivers/input/touchscreen/sur40.c | |||
@@ -0,0 +1,466 @@ | |||
1 | /* | ||
2 | * Surface2.0/SUR40/PixelSense input driver | ||
3 | * | ||
4 | * Copyright (c) 2013 by Florian 'floe' Echtler <floe@butterbrot.org> | ||
5 | * | ||
6 | * Derived from the USB Skeleton driver 1.1, | ||
7 | * Copyright (c) 2003 Greg Kroah-Hartman (greg@kroah.com) | ||
8 | * | ||
9 | * and from the Apple USB BCM5974 multitouch driver, | ||
10 | * Copyright (c) 2008 Henrik Rydberg (rydberg@euromail.se) | ||
11 | * | ||
12 | * and from the generic hid-multitouch driver, | ||
13 | * Copyright (c) 2010-2012 Stephane Chatty <chatty@enac.fr> | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or | ||
16 | * modify it under the terms of the GNU General Public License as | ||
17 | * published by the Free Software Foundation; either version 2 of | ||
18 | * the License, or (at your option) any later version. | ||
19 | */ | ||
20 | |||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/errno.h> | ||
23 | #include <linux/delay.h> | ||
24 | #include <linux/init.h> | ||
25 | #include <linux/slab.h> | ||
26 | #include <linux/module.h> | ||
27 | #include <linux/completion.h> | ||
28 | #include <linux/uaccess.h> | ||
29 | #include <linux/usb.h> | ||
30 | #include <linux/printk.h> | ||
31 | #include <linux/input-polldev.h> | ||
32 | #include <linux/input/mt.h> | ||
33 | #include <linux/usb/input.h> | ||
34 | |||
35 | /* read 512 bytes from endpoint 0x86 -> get header + blobs */ | ||
36 | struct sur40_header { | ||
37 | |||
38 | __le16 type; /* always 0x0001 */ | ||
39 | __le16 count; /* count of blobs (if 0: continue prev. packet) */ | ||
40 | |||
41 | __le32 packet_id; /* unique ID for all packets in one frame */ | ||
42 | |||
43 | __le32 timestamp; /* milliseconds (inc. by 16 or 17 each frame) */ | ||
44 | __le32 unknown; /* "epoch?" always 02/03 00 00 00 */ | ||
45 | |||
46 | } __packed; | ||
47 | |||
48 | struct sur40_blob { | ||
49 | |||
50 | __le16 blob_id; | ||
51 | |||
52 | u8 action; /* 0x02 = enter/exit, 0x03 = update (?) */ | ||
53 | u8 unknown; /* always 0x01 or 0x02 (no idea what this is?) */ | ||
54 | |||
55 | __le16 bb_pos_x; /* upper left corner of bounding box */ | ||
56 | __le16 bb_pos_y; | ||
57 | |||
58 | __le16 bb_size_x; /* size of bounding box */ | ||
59 | __le16 bb_size_y; | ||
60 | |||
61 | __le16 pos_x; /* finger tip position */ | ||
62 | __le16 pos_y; | ||
63 | |||
64 | __le16 ctr_x; /* centroid position */ | ||
65 | __le16 ctr_y; | ||
66 | |||
67 | __le16 axis_x; /* somehow related to major/minor axis, mostly: */ | ||
68 | __le16 axis_y; /* axis_x == bb_size_y && axis_y == bb_size_x */ | ||
69 | |||
70 | __le32 angle; /* orientation in radians relative to x axis - | ||
71 | actually an IEEE754 float, don't use in kernel */ | ||
72 | |||
73 | __le32 area; /* size in pixels/pressure (?) */ | ||
74 | |||
75 | u8 padding[32]; | ||
76 | |||
77 | } __packed; | ||
78 | |||
79 | /* combined header/blob data */ | ||
80 | struct sur40_data { | ||
81 | struct sur40_header header; | ||
82 | struct sur40_blob blobs[]; | ||
83 | } __packed; | ||
84 | |||
85 | |||
86 | /* version information */ | ||
87 | #define DRIVER_SHORT "sur40" | ||
88 | #define DRIVER_AUTHOR "Florian 'floe' Echtler <floe@butterbrot.org>" | ||
89 | #define DRIVER_DESC "Surface2.0/SUR40/PixelSense input driver" | ||
90 | |||
91 | /* vendor and device IDs */ | ||
92 | #define ID_MICROSOFT 0x045e | ||
93 | #define ID_SUR40 0x0775 | ||
94 | |||
95 | /* sensor resolution */ | ||
96 | #define SENSOR_RES_X 1920 | ||
97 | #define SENSOR_RES_Y 1080 | ||
98 | |||
99 | /* touch data endpoint */ | ||
100 | #define TOUCH_ENDPOINT 0x86 | ||
101 | |||
102 | /* polling interval (ms) */ | ||
103 | #define POLL_INTERVAL 10 | ||
104 | |||
105 | /* maximum number of contacts FIXME: this is a guess? */ | ||
106 | #define MAX_CONTACTS 64 | ||
107 | |||
108 | /* control commands */ | ||
109 | #define SUR40_GET_VERSION 0xb0 /* 12 bytes string */ | ||
110 | #define SUR40_UNKNOWN1 0xb3 /* 5 bytes */ | ||
111 | #define SUR40_UNKNOWN2 0xc1 /* 24 bytes */ | ||
112 | |||
113 | #define SUR40_GET_STATE 0xc5 /* 4 bytes state (?) */ | ||
114 | #define SUR40_GET_SENSORS 0xb1 /* 8 bytes sensors */ | ||
115 | |||
116 | /* | ||
117 | * Note: an earlier, non-public version of this driver used USB_RECIP_ENDPOINT | ||
118 | * here by mistake which is very likely to have corrupted the firmware EEPROM | ||
119 | * on two separate SUR40 devices. Thanks to Alan Stern who spotted this bug. | ||
120 | * Should you ever run into a similar problem, the background story to this | ||
121 | * incident and instructions on how to fix the corrupted EEPROM are available | ||
122 | * at https://floe.butterbrot.org/matrix/hacking/surface/brick.html | ||
123 | */ | ||
124 | |||
125 | struct sur40_state { | ||
126 | |||
127 | struct usb_device *usbdev; | ||
128 | struct device *dev; | ||
129 | struct input_polled_dev *input; | ||
130 | |||
131 | struct sur40_data *bulk_in_buffer; | ||
132 | size_t bulk_in_size; | ||
133 | u8 bulk_in_epaddr; | ||
134 | |||
135 | char phys[64]; | ||
136 | }; | ||
137 | |||
138 | static int sur40_command(struct sur40_state *dev, | ||
139 | u8 command, u16 index, void *buffer, u16 size) | ||
140 | { | ||
141 | return usb_control_msg(dev->usbdev, usb_rcvctrlpipe(dev->usbdev, 0), | ||
142 | command, | ||
143 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, | ||
144 | 0x00, index, buffer, size, 1000); | ||
145 | } | ||
146 | |||
147 | /* Initialization routine, called from sur40_open */ | ||
148 | static int sur40_init(struct sur40_state *dev) | ||
149 | { | ||
150 | int result; | ||
151 | u8 buffer[24]; | ||
152 | |||
153 | /* stupidly replay the original MS driver init sequence */ | ||
154 | result = sur40_command(dev, SUR40_GET_VERSION, 0x00, buffer, 12); | ||
155 | if (result < 0) | ||
156 | return result; | ||
157 | |||
158 | result = sur40_command(dev, SUR40_GET_VERSION, 0x01, buffer, 12); | ||
159 | if (result < 0) | ||
160 | return result; | ||
161 | |||
162 | result = sur40_command(dev, SUR40_GET_VERSION, 0x02, buffer, 12); | ||
163 | if (result < 0) | ||
164 | return result; | ||
165 | |||
166 | result = sur40_command(dev, SUR40_UNKNOWN2, 0x00, buffer, 24); | ||
167 | if (result < 0) | ||
168 | return result; | ||
169 | |||
170 | result = sur40_command(dev, SUR40_UNKNOWN1, 0x00, buffer, 5); | ||
171 | if (result < 0) | ||
172 | return result; | ||
173 | |||
174 | result = sur40_command(dev, SUR40_GET_VERSION, 0x03, buffer, 12); | ||
175 | |||
176 | /* | ||
177 | * Discard the result buffer - no known data inside except | ||
178 | * some version strings, maybe extract these sometime... | ||
179 | */ | ||
180 | |||
181 | return result; | ||
182 | } | ||
183 | |||
184 | /* | ||
185 | * Callback routines from input_polled_dev | ||
186 | */ | ||
187 | |||
188 | /* Enable the device, polling will now start. */ | ||
189 | static void sur40_open(struct input_polled_dev *polldev) | ||
190 | { | ||
191 | struct sur40_state *sur40 = polldev->private; | ||
192 | |||
193 | dev_dbg(sur40->dev, "open\n"); | ||
194 | sur40_init(sur40); | ||
195 | } | ||
196 | |||
197 | /* Disable device, polling has stopped. */ | ||
198 | static void sur40_close(struct input_polled_dev *polldev) | ||
199 | { | ||
200 | struct sur40_state *sur40 = polldev->private; | ||
201 | |||
202 | dev_dbg(sur40->dev, "close\n"); | ||
203 | /* | ||
204 | * There is no known way to stop the device, so we simply | ||
205 | * stop polling. | ||
206 | */ | ||
207 | } | ||
208 | |||
209 | /* | ||
210 | * This function is called when a whole contact has been processed, | ||
211 | * so that it can assign it to a slot and store the data there. | ||
212 | */ | ||
213 | static void sur40_report_blob(struct sur40_blob *blob, struct input_dev *input) | ||
214 | { | ||
215 | int wide, major, minor; | ||
216 | |||
217 | int bb_size_x = le16_to_cpu(blob->bb_size_x); | ||
218 | int bb_size_y = le16_to_cpu(blob->bb_size_y); | ||
219 | |||
220 | int pos_x = le16_to_cpu(blob->pos_x); | ||
221 | int pos_y = le16_to_cpu(blob->pos_y); | ||
222 | |||
223 | int ctr_x = le16_to_cpu(blob->ctr_x); | ||
224 | int ctr_y = le16_to_cpu(blob->ctr_y); | ||
225 | |||
226 | int slotnum = input_mt_get_slot_by_key(input, blob->blob_id); | ||
227 | if (slotnum < 0 || slotnum >= MAX_CONTACTS) | ||
228 | return; | ||
229 | |||
230 | input_mt_slot(input, slotnum); | ||
231 | input_mt_report_slot_state(input, MT_TOOL_FINGER, 1); | ||
232 | wide = (bb_size_x > bb_size_y); | ||
233 | major = max(bb_size_x, bb_size_y); | ||
234 | minor = min(bb_size_x, bb_size_y); | ||
235 | |||
236 | input_report_abs(input, ABS_MT_POSITION_X, pos_x); | ||
237 | input_report_abs(input, ABS_MT_POSITION_Y, pos_y); | ||
238 | input_report_abs(input, ABS_MT_TOOL_X, ctr_x); | ||
239 | input_report_abs(input, ABS_MT_TOOL_Y, ctr_y); | ||
240 | |||
241 | /* TODO: use a better orientation measure */ | ||
242 | input_report_abs(input, ABS_MT_ORIENTATION, wide); | ||
243 | input_report_abs(input, ABS_MT_TOUCH_MAJOR, major); | ||
244 | input_report_abs(input, ABS_MT_TOUCH_MINOR, minor); | ||
245 | } | ||
246 | |||
247 | /* core function: poll for new input data */ | ||
248 | static void sur40_poll(struct input_polled_dev *polldev) | ||
249 | { | ||
250 | |||
251 | struct sur40_state *sur40 = polldev->private; | ||
252 | struct input_dev *input = polldev->input; | ||
253 | int result, bulk_read, need_blobs, packet_blobs, i; | ||
254 | u32 packet_id; | ||
255 | |||
256 | struct sur40_header *header = &sur40->bulk_in_buffer->header; | ||
257 | struct sur40_blob *inblob = &sur40->bulk_in_buffer->blobs[0]; | ||
258 | |||
259 | dev_dbg(sur40->dev, "poll\n"); | ||
260 | |||
261 | need_blobs = -1; | ||
262 | |||
263 | do { | ||
264 | |||
265 | /* perform a blocking bulk read to get data from the device */ | ||
266 | result = usb_bulk_msg(sur40->usbdev, | ||
267 | usb_rcvbulkpipe(sur40->usbdev, sur40->bulk_in_epaddr), | ||
268 | sur40->bulk_in_buffer, sur40->bulk_in_size, | ||
269 | &bulk_read, 1000); | ||
270 | |||
271 | dev_dbg(sur40->dev, "received %d bytes\n", bulk_read); | ||
272 | |||
273 | if (result < 0) { | ||
274 | dev_err(sur40->dev, "error in usb_bulk_read\n"); | ||
275 | return; | ||
276 | } | ||
277 | |||
278 | result = bulk_read - sizeof(struct sur40_header); | ||
279 | |||
280 | if (result % sizeof(struct sur40_blob) != 0) { | ||
281 | dev_err(sur40->dev, "transfer size mismatch\n"); | ||
282 | return; | ||
283 | } | ||
284 | |||
285 | /* first packet? */ | ||
286 | if (need_blobs == -1) { | ||
287 | need_blobs = le16_to_cpu(header->count); | ||
288 | dev_dbg(sur40->dev, "need %d blobs\n", need_blobs); | ||
289 | packet_id = header->packet_id; | ||
290 | } | ||
291 | |||
292 | /* | ||
293 | * Sanity check. when video data is also being retrieved, the | ||
294 | * packet ID will usually increase in the middle of a series | ||
295 | * instead of at the end. | ||
296 | */ | ||
297 | if (packet_id != header->packet_id) | ||
298 | dev_warn(sur40->dev, "packet ID mismatch\n"); | ||
299 | |||
300 | packet_blobs = result / sizeof(struct sur40_blob); | ||
301 | dev_dbg(sur40->dev, "received %d blobs\n", packet_blobs); | ||
302 | |||
303 | /* packets always contain at least 4 blobs, even if empty */ | ||
304 | if (packet_blobs > need_blobs) | ||
305 | packet_blobs = need_blobs; | ||
306 | |||
307 | for (i = 0; i < packet_blobs; i++) { | ||
308 | need_blobs--; | ||
309 | dev_dbg(sur40->dev, "processing blob\n"); | ||
310 | sur40_report_blob(&(inblob[i]), input); | ||
311 | } | ||
312 | |||
313 | } while (need_blobs > 0); | ||
314 | |||
315 | input_mt_sync_frame(input); | ||
316 | input_sync(input); | ||
317 | } | ||
318 | |||
319 | /* Initialize input device parameters. */ | ||
320 | static void sur40_input_setup(struct input_dev *input_dev) | ||
321 | { | ||
322 | __set_bit(EV_KEY, input_dev->evbit); | ||
323 | __set_bit(EV_ABS, input_dev->evbit); | ||
324 | |||
325 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, | ||
326 | 0, SENSOR_RES_X, 0, 0); | ||
327 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, | ||
328 | 0, SENSOR_RES_Y, 0, 0); | ||
329 | |||
330 | input_set_abs_params(input_dev, ABS_MT_TOOL_X, | ||
331 | 0, SENSOR_RES_X, 0, 0); | ||
332 | input_set_abs_params(input_dev, ABS_MT_TOOL_Y, | ||
333 | 0, SENSOR_RES_Y, 0, 0); | ||
334 | |||
335 | /* max value unknown, but major/minor axis | ||
336 | * can never be larger than screen */ | ||
337 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, | ||
338 | 0, SENSOR_RES_X, 0, 0); | ||
339 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MINOR, | ||
340 | 0, SENSOR_RES_Y, 0, 0); | ||
341 | |||
342 | input_set_abs_params(input_dev, ABS_MT_ORIENTATION, 0, 1, 0, 0); | ||
343 | |||
344 | input_mt_init_slots(input_dev, MAX_CONTACTS, | ||
345 | INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED); | ||
346 | } | ||
347 | |||
348 | /* Check candidate USB interface. */ | ||
349 | static int sur40_probe(struct usb_interface *interface, | ||
350 | const struct usb_device_id *id) | ||
351 | { | ||
352 | struct usb_device *usbdev = interface_to_usbdev(interface); | ||
353 | struct sur40_state *sur40; | ||
354 | struct usb_host_interface *iface_desc; | ||
355 | struct usb_endpoint_descriptor *endpoint; | ||
356 | struct input_polled_dev *poll_dev; | ||
357 | int error; | ||
358 | |||
359 | /* Check if we really have the right interface. */ | ||
360 | iface_desc = &interface->altsetting[0]; | ||
361 | if (iface_desc->desc.bInterfaceClass != 0xFF) | ||
362 | return -ENODEV; | ||
363 | |||
364 | /* Use endpoint #4 (0x86). */ | ||
365 | endpoint = &iface_desc->endpoint[4].desc; | ||
366 | if (endpoint->bEndpointAddress != TOUCH_ENDPOINT) | ||
367 | return -ENODEV; | ||
368 | |||
369 | /* Allocate memory for our device state and initialize it. */ | ||
370 | sur40 = kzalloc(sizeof(struct sur40_state), GFP_KERNEL); | ||
371 | if (!sur40) | ||
372 | return -ENOMEM; | ||
373 | |||
374 | poll_dev = input_allocate_polled_device(); | ||
375 | if (!poll_dev) { | ||
376 | error = -ENOMEM; | ||
377 | goto err_free_dev; | ||
378 | } | ||
379 | |||
380 | /* Set up polled input device control structure */ | ||
381 | poll_dev->private = sur40; | ||
382 | poll_dev->poll_interval = POLL_INTERVAL; | ||
383 | poll_dev->open = sur40_open; | ||
384 | poll_dev->poll = sur40_poll; | ||
385 | poll_dev->close = sur40_close; | ||
386 | |||
387 | /* Set up regular input device structure */ | ||
388 | sur40_input_setup(poll_dev->input); | ||
389 | |||
390 | poll_dev->input->name = "Samsung SUR40"; | ||
391 | usb_to_input_id(usbdev, &poll_dev->input->id); | ||
392 | usb_make_path(usbdev, sur40->phys, sizeof(sur40->phys)); | ||
393 | strlcat(sur40->phys, "/input0", sizeof(sur40->phys)); | ||
394 | poll_dev->input->phys = sur40->phys; | ||
395 | poll_dev->input->dev.parent = &interface->dev; | ||
396 | |||
397 | sur40->usbdev = usbdev; | ||
398 | sur40->dev = &interface->dev; | ||
399 | sur40->input = poll_dev; | ||
400 | |||
401 | /* use the bulk-in endpoint tested above */ | ||
402 | sur40->bulk_in_size = usb_endpoint_maxp(endpoint); | ||
403 | sur40->bulk_in_epaddr = endpoint->bEndpointAddress; | ||
404 | sur40->bulk_in_buffer = kmalloc(sur40->bulk_in_size, GFP_KERNEL); | ||
405 | if (!sur40->bulk_in_buffer) { | ||
406 | dev_err(&interface->dev, "Unable to allocate input buffer."); | ||
407 | error = -ENOMEM; | ||
408 | goto err_free_polldev; | ||
409 | } | ||
410 | |||
411 | error = input_register_polled_device(poll_dev); | ||
412 | if (error) { | ||
413 | dev_err(&interface->dev, | ||
414 | "Unable to register polled input device."); | ||
415 | goto err_free_buffer; | ||
416 | } | ||
417 | |||
418 | /* we can register the device now, as it is ready */ | ||
419 | usb_set_intfdata(interface, sur40); | ||
420 | dev_dbg(&interface->dev, "%s is now attached\n", DRIVER_DESC); | ||
421 | |||
422 | return 0; | ||
423 | |||
424 | err_free_buffer: | ||
425 | kfree(sur40->bulk_in_buffer); | ||
426 | err_free_polldev: | ||
427 | input_free_polled_device(sur40->input); | ||
428 | err_free_dev: | ||
429 | kfree(sur40); | ||
430 | |||
431 | return error; | ||
432 | } | ||
433 | |||
434 | /* Unregister device & clean up. */ | ||
435 | static void sur40_disconnect(struct usb_interface *interface) | ||
436 | { | ||
437 | struct sur40_state *sur40 = usb_get_intfdata(interface); | ||
438 | |||
439 | input_unregister_polled_device(sur40->input); | ||
440 | input_free_polled_device(sur40->input); | ||
441 | kfree(sur40->bulk_in_buffer); | ||
442 | kfree(sur40); | ||
443 | |||
444 | usb_set_intfdata(interface, NULL); | ||
445 | dev_dbg(&interface->dev, "%s is now disconnected\n", DRIVER_DESC); | ||
446 | } | ||
447 | |||
448 | static const struct usb_device_id sur40_table[] = { | ||
449 | { USB_DEVICE(ID_MICROSOFT, ID_SUR40) }, /* Samsung SUR40 */ | ||
450 | { } /* terminating null entry */ | ||
451 | }; | ||
452 | MODULE_DEVICE_TABLE(usb, sur40_table); | ||
453 | |||
454 | /* USB-specific object needed to register this driver with the USB subsystem. */ | ||
455 | static struct usb_driver sur40_driver = { | ||
456 | .name = DRIVER_SHORT, | ||
457 | .probe = sur40_probe, | ||
458 | .disconnect = sur40_disconnect, | ||
459 | .id_table = sur40_table, | ||
460 | }; | ||
461 | |||
462 | module_usb_driver(sur40_driver); | ||
463 | |||
464 | MODULE_AUTHOR(DRIVER_AUTHOR); | ||
465 | MODULE_DESCRIPTION(DRIVER_DESC); | ||
466 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 9031171c141b..341c6016812d 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -957,12 +957,13 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start, | |||
957 | if (WARN_ON(!gic->domain)) | 957 | if (WARN_ON(!gic->domain)) |
958 | return; | 958 | return; |
959 | 959 | ||
960 | if (gic_nr == 0) { | ||
960 | #ifdef CONFIG_SMP | 961 | #ifdef CONFIG_SMP |
961 | set_smp_cross_call(gic_raise_softirq); | 962 | set_smp_cross_call(gic_raise_softirq); |
962 | register_cpu_notifier(&gic_cpu_notifier); | 963 | register_cpu_notifier(&gic_cpu_notifier); |
963 | #endif | 964 | #endif |
964 | 965 | set_handle_irq(gic_handle_irq); | |
965 | set_handle_irq(gic_handle_irq); | 966 | } |
966 | 967 | ||
967 | gic_chip.flags |= gic_arch_extn.flags; | 968 | gic_chip.flags |= gic_arch_extn.flags; |
968 | gic_dist_init(gic); | 969 | gic_dist_init(gic); |
diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c index 2848171b8576..b31d8e99c419 100644 --- a/drivers/leds/leds-pwm.c +++ b/drivers/leds/leds-pwm.c | |||
@@ -82,22 +82,12 @@ static inline size_t sizeof_pwm_leds_priv(int num_leds) | |||
82 | (sizeof(struct led_pwm_data) * num_leds); | 82 | (sizeof(struct led_pwm_data) * num_leds); |
83 | } | 83 | } |
84 | 84 | ||
85 | static struct led_pwm_priv *led_pwm_create_of(struct platform_device *pdev) | 85 | static int led_pwm_create_of(struct platform_device *pdev, |
86 | struct led_pwm_priv *priv) | ||
86 | { | 87 | { |
87 | struct device_node *node = pdev->dev.of_node; | 88 | struct device_node *node = pdev->dev.of_node; |
88 | struct device_node *child; | 89 | struct device_node *child; |
89 | struct led_pwm_priv *priv; | 90 | int ret; |
90 | int count, ret; | ||
91 | |||
92 | /* count LEDs in this device, so we know how much to allocate */ | ||
93 | count = of_get_child_count(node); | ||
94 | if (!count) | ||
95 | return NULL; | ||
96 | |||
97 | priv = devm_kzalloc(&pdev->dev, sizeof_pwm_leds_priv(count), | ||
98 | GFP_KERNEL); | ||
99 | if (!priv) | ||
100 | return NULL; | ||
101 | 91 | ||
102 | for_each_child_of_node(node, child) { | 92 | for_each_child_of_node(node, child) { |
103 | struct led_pwm_data *led_dat = &priv->leds[priv->num_leds]; | 93 | struct led_pwm_data *led_dat = &priv->leds[priv->num_leds]; |
@@ -109,6 +99,7 @@ static struct led_pwm_priv *led_pwm_create_of(struct platform_device *pdev) | |||
109 | if (IS_ERR(led_dat->pwm)) { | 99 | if (IS_ERR(led_dat->pwm)) { |
110 | dev_err(&pdev->dev, "unable to request PWM for %s\n", | 100 | dev_err(&pdev->dev, "unable to request PWM for %s\n", |
111 | led_dat->cdev.name); | 101 | led_dat->cdev.name); |
102 | ret = PTR_ERR(led_dat->pwm); | ||
112 | goto err; | 103 | goto err; |
113 | } | 104 | } |
114 | /* Get the period from PWM core when n*/ | 105 | /* Get the period from PWM core when n*/ |
@@ -137,28 +128,36 @@ static struct led_pwm_priv *led_pwm_create_of(struct platform_device *pdev) | |||
137 | priv->num_leds++; | 128 | priv->num_leds++; |
138 | } | 129 | } |
139 | 130 | ||
140 | return priv; | 131 | return 0; |
141 | err: | 132 | err: |
142 | while (priv->num_leds--) | 133 | while (priv->num_leds--) |
143 | led_classdev_unregister(&priv->leds[priv->num_leds].cdev); | 134 | led_classdev_unregister(&priv->leds[priv->num_leds].cdev); |
144 | 135 | ||
145 | return NULL; | 136 | return ret; |
146 | } | 137 | } |
147 | 138 | ||
148 | static int led_pwm_probe(struct platform_device *pdev) | 139 | static int led_pwm_probe(struct platform_device *pdev) |
149 | { | 140 | { |
150 | struct led_pwm_platform_data *pdata = dev_get_platdata(&pdev->dev); | 141 | struct led_pwm_platform_data *pdata = dev_get_platdata(&pdev->dev); |
151 | struct led_pwm_priv *priv; | 142 | struct led_pwm_priv *priv; |
152 | int i, ret = 0; | 143 | int count, i; |
144 | int ret = 0; | ||
145 | |||
146 | if (pdata) | ||
147 | count = pdata->num_leds; | ||
148 | else | ||
149 | count = of_get_child_count(pdev->dev.of_node); | ||
150 | |||
151 | if (!count) | ||
152 | return -EINVAL; | ||
153 | 153 | ||
154 | if (pdata && pdata->num_leds) { | 154 | priv = devm_kzalloc(&pdev->dev, sizeof_pwm_leds_priv(count), |
155 | priv = devm_kzalloc(&pdev->dev, | 155 | GFP_KERNEL); |
156 | sizeof_pwm_leds_priv(pdata->num_leds), | 156 | if (!priv) |
157 | GFP_KERNEL); | 157 | return -ENOMEM; |
158 | if (!priv) | ||
159 | return -ENOMEM; | ||
160 | 158 | ||
161 | for (i = 0; i < pdata->num_leds; i++) { | 159 | if (pdata) { |
160 | for (i = 0; i < count; i++) { | ||
162 | struct led_pwm *cur_led = &pdata->leds[i]; | 161 | struct led_pwm *cur_led = &pdata->leds[i]; |
163 | struct led_pwm_data *led_dat = &priv->leds[i]; | 162 | struct led_pwm_data *led_dat = &priv->leds[i]; |
164 | 163 | ||
@@ -188,11 +187,11 @@ static int led_pwm_probe(struct platform_device *pdev) | |||
188 | if (ret < 0) | 187 | if (ret < 0) |
189 | goto err; | 188 | goto err; |
190 | } | 189 | } |
191 | priv->num_leds = pdata->num_leds; | 190 | priv->num_leds = count; |
192 | } else { | 191 | } else { |
193 | priv = led_pwm_create_of(pdev); | 192 | ret = led_pwm_create_of(pdev, priv); |
194 | if (!priv) | 193 | if (ret) |
195 | return -ENODEV; | 194 | return ret; |
196 | } | 195 | } |
197 | 196 | ||
198 | platform_set_drvdata(pdev, priv); | 197 | platform_set_drvdata(pdev, priv); |
diff --git a/drivers/macintosh/Makefile b/drivers/macintosh/Makefile index 6753b65f8ede..d2f0120bc878 100644 --- a/drivers/macintosh/Makefile +++ b/drivers/macintosh/Makefile | |||
@@ -40,6 +40,7 @@ obj-$(CONFIG_WINDFARM_RM31) += windfarm_fcu_controls.o \ | |||
40 | windfarm_ad7417_sensor.o \ | 40 | windfarm_ad7417_sensor.o \ |
41 | windfarm_lm75_sensor.o \ | 41 | windfarm_lm75_sensor.o \ |
42 | windfarm_lm87_sensor.o \ | 42 | windfarm_lm87_sensor.o \ |
43 | windfarm_max6690_sensor.o \ | ||
43 | windfarm_pid.o \ | 44 | windfarm_pid.o \ |
44 | windfarm_cpufreq_clamp.o \ | 45 | windfarm_cpufreq_clamp.o \ |
45 | windfarm_rm31.o | 46 | windfarm_rm31.o |
diff --git a/drivers/md/md.c b/drivers/md/md.c index b6b7a2866c9e..21f4d7ff0da2 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -776,16 +776,10 @@ void md_super_wait(struct mddev *mddev) | |||
776 | finish_wait(&mddev->sb_wait, &wq); | 776 | finish_wait(&mddev->sb_wait, &wq); |
777 | } | 777 | } |
778 | 778 | ||
779 | static void bi_complete(struct bio *bio, int error) | ||
780 | { | ||
781 | complete((struct completion*)bio->bi_private); | ||
782 | } | ||
783 | |||
784 | int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, | 779 | int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, |
785 | struct page *page, int rw, bool metadata_op) | 780 | struct page *page, int rw, bool metadata_op) |
786 | { | 781 | { |
787 | struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev); | 782 | struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev); |
788 | struct completion event; | ||
789 | int ret; | 783 | int ret; |
790 | 784 | ||
791 | rw |= REQ_SYNC; | 785 | rw |= REQ_SYNC; |
@@ -801,11 +795,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, | |||
801 | else | 795 | else |
802 | bio->bi_sector = sector + rdev->data_offset; | 796 | bio->bi_sector = sector + rdev->data_offset; |
803 | bio_add_page(bio, page, size, 0); | 797 | bio_add_page(bio, page, size, 0); |
804 | init_completion(&event); | 798 | submit_bio_wait(rw, bio); |
805 | bio->bi_private = &event; | ||
806 | bio->bi_end_io = bi_complete; | ||
807 | submit_bio(rw, bio); | ||
808 | wait_for_completion(&event); | ||
809 | 799 | ||
810 | ret = test_bit(BIO_UPTODATE, &bio->bi_flags); | 800 | ret = test_bit(BIO_UPTODATE, &bio->bi_flags); |
811 | bio_put(bio); | 801 | bio_put(bio); |
@@ -7777,7 +7767,7 @@ void md_check_recovery(struct mddev *mddev) | |||
7777 | if (mddev->ro && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) | 7767 | if (mddev->ro && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) |
7778 | return; | 7768 | return; |
7779 | if ( ! ( | 7769 | if ( ! ( |
7780 | (mddev->flags & ~ (1<<MD_CHANGE_PENDING)) || | 7770 | (mddev->flags & MD_UPDATE_SB_FLAGS & ~ (1<<MD_CHANGE_PENDING)) || |
7781 | test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || | 7771 | test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || |
7782 | test_bit(MD_RECOVERY_DONE, &mddev->recovery) || | 7772 | test_bit(MD_RECOVERY_DONE, &mddev->recovery) || |
7783 | (mddev->external == 0 && mddev->safemode == 1) || | 7773 | (mddev->external == 0 && mddev->safemode == 1) || |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 47da0af6322b..cc055da02e2a 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -678,26 +678,23 @@ get_active_stripe(struct r5conf *conf, sector_t sector, | |||
678 | } else | 678 | } else |
679 | init_stripe(sh, sector, previous); | 679 | init_stripe(sh, sector, previous); |
680 | } else { | 680 | } else { |
681 | spin_lock(&conf->device_lock); | ||
681 | if (atomic_read(&sh->count)) { | 682 | if (atomic_read(&sh->count)) { |
682 | BUG_ON(!list_empty(&sh->lru) | 683 | BUG_ON(!list_empty(&sh->lru) |
683 | && !test_bit(STRIPE_EXPANDING, &sh->state) | 684 | && !test_bit(STRIPE_EXPANDING, &sh->state) |
684 | && !test_bit(STRIPE_ON_UNPLUG_LIST, &sh->state) | 685 | && !test_bit(STRIPE_ON_UNPLUG_LIST, &sh->state) |
685 | && !test_bit(STRIPE_ON_RELEASE_LIST, &sh->state)); | 686 | ); |
686 | } else { | 687 | } else { |
687 | spin_lock(&conf->device_lock); | ||
688 | if (!test_bit(STRIPE_HANDLE, &sh->state)) | 688 | if (!test_bit(STRIPE_HANDLE, &sh->state)) |
689 | atomic_inc(&conf->active_stripes); | 689 | atomic_inc(&conf->active_stripes); |
690 | if (list_empty(&sh->lru) && | 690 | BUG_ON(list_empty(&sh->lru)); |
691 | !test_bit(STRIPE_ON_RELEASE_LIST, &sh->state) && | ||
692 | !test_bit(STRIPE_EXPANDING, &sh->state)) | ||
693 | BUG(); | ||
694 | list_del_init(&sh->lru); | 691 | list_del_init(&sh->lru); |
695 | if (sh->group) { | 692 | if (sh->group) { |
696 | sh->group->stripes_cnt--; | 693 | sh->group->stripes_cnt--; |
697 | sh->group = NULL; | 694 | sh->group = NULL; |
698 | } | 695 | } |
699 | spin_unlock(&conf->device_lock); | ||
700 | } | 696 | } |
697 | spin_unlock(&conf->device_lock); | ||
701 | } | 698 | } |
702 | } while (sh == NULL); | 699 | } while (sh == NULL); |
703 | 700 | ||
@@ -5471,7 +5468,7 @@ static int alloc_thread_groups(struct r5conf *conf, int cnt, | |||
5471 | for (i = 0; i < *group_cnt; i++) { | 5468 | for (i = 0; i < *group_cnt; i++) { |
5472 | struct r5worker_group *group; | 5469 | struct r5worker_group *group; |
5473 | 5470 | ||
5474 | group = worker_groups[i]; | 5471 | group = &(*worker_groups)[i]; |
5475 | INIT_LIST_HEAD(&group->handle_list); | 5472 | INIT_LIST_HEAD(&group->handle_list); |
5476 | group->conf = conf; | 5473 | group->conf = conf; |
5477 | group->workers = workers + i * cnt; | 5474 | group->workers = workers + i * cnt; |
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 29473c2c95ae..d5b3dd8a940e 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c | |||
@@ -1133,6 +1133,11 @@ static int twl_remove(struct i2c_client *client) | |||
1133 | return 0; | 1133 | return 0; |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | static struct of_dev_auxdata twl_auxdata_lookup[] = { | ||
1137 | OF_DEV_AUXDATA("ti,twl4030-gpio", 0, "twl4030-gpio", NULL), | ||
1138 | { /* sentinel */ }, | ||
1139 | }; | ||
1140 | |||
1136 | /* NOTE: This driver only handles a single twl4030/tps659x0 chip */ | 1141 | /* NOTE: This driver only handles a single twl4030/tps659x0 chip */ |
1137 | static int | 1142 | static int |
1138 | twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | 1143 | twl_probe(struct i2c_client *client, const struct i2c_device_id *id) |
@@ -1271,10 +1276,14 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1271 | twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); | 1276 | twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); |
1272 | } | 1277 | } |
1273 | 1278 | ||
1274 | if (node) | 1279 | if (node) { |
1275 | status = of_platform_populate(node, NULL, NULL, &client->dev); | 1280 | if (pdata) |
1276 | else | 1281 | twl_auxdata_lookup[0].platform_data = pdata->gpio; |
1282 | status = of_platform_populate(node, NULL, twl_auxdata_lookup, | ||
1283 | &client->dev); | ||
1284 | } else { | ||
1277 | status = add_children(pdata, irq_base, id->driver_data); | 1285 | status = add_children(pdata, irq_base, id->driver_data); |
1286 | } | ||
1278 | 1287 | ||
1279 | fail: | 1288 | fail: |
1280 | if (status < 0) | 1289 | if (status < 0) |
diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c index 0e8df41aaf14..2cf2bbc0b927 100644 --- a/drivers/misc/enclosure.c +++ b/drivers/misc/enclosure.c | |||
@@ -198,6 +198,13 @@ static void enclosure_remove_links(struct enclosure_component *cdev) | |||
198 | { | 198 | { |
199 | char name[ENCLOSURE_NAME_SIZE]; | 199 | char name[ENCLOSURE_NAME_SIZE]; |
200 | 200 | ||
201 | /* | ||
202 | * In odd circumstances, like multipath devices, something else may | ||
203 | * already have removed the links, so check for this condition first. | ||
204 | */ | ||
205 | if (!cdev->dev->kobj.sd) | ||
206 | return; | ||
207 | |||
201 | enclosure_link_name(cdev, name); | 208 | enclosure_link_name(cdev, name); |
202 | sysfs_remove_link(&cdev->dev->kobj, name); | 209 | sysfs_remove_link(&cdev->dev->kobj, name); |
203 | sysfs_remove_link(&cdev->cdev.kobj, "device"); | 210 | sysfs_remove_link(&cdev->cdev.kobj, "device"); |
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 0b10a9030f4e..98b6b6ef7e5c 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/timer.h> | 24 | #include <linux/timer.h> |
25 | #include <linux/of.h> | ||
25 | #include <linux/omap-dma.h> | 26 | #include <linux/omap-dma.h> |
26 | #include <linux/mmc/host.h> | 27 | #include <linux/mmc/host.h> |
27 | #include <linux/mmc/card.h> | 28 | #include <linux/mmc/card.h> |
@@ -90,17 +91,6 @@ | |||
90 | #define OMAP_MMC_CMDTYPE_AC 2 | 91 | #define OMAP_MMC_CMDTYPE_AC 2 |
91 | #define OMAP_MMC_CMDTYPE_ADTC 3 | 92 | #define OMAP_MMC_CMDTYPE_ADTC 3 |
92 | 93 | ||
93 | #define OMAP_DMA_MMC_TX 21 | ||
94 | #define OMAP_DMA_MMC_RX 22 | ||
95 | #define OMAP_DMA_MMC2_TX 54 | ||
96 | #define OMAP_DMA_MMC2_RX 55 | ||
97 | |||
98 | #define OMAP24XX_DMA_MMC2_TX 47 | ||
99 | #define OMAP24XX_DMA_MMC2_RX 48 | ||
100 | #define OMAP24XX_DMA_MMC1_TX 61 | ||
101 | #define OMAP24XX_DMA_MMC1_RX 62 | ||
102 | |||
103 | |||
104 | #define DRIVER_NAME "mmci-omap" | 94 | #define DRIVER_NAME "mmci-omap" |
105 | 95 | ||
106 | /* Specifies how often in millisecs to poll for card status changes | 96 | /* Specifies how often in millisecs to poll for card status changes |
@@ -1330,7 +1320,7 @@ static int mmc_omap_probe(struct platform_device *pdev) | |||
1330 | struct mmc_omap_host *host = NULL; | 1320 | struct mmc_omap_host *host = NULL; |
1331 | struct resource *res; | 1321 | struct resource *res; |
1332 | dma_cap_mask_t mask; | 1322 | dma_cap_mask_t mask; |
1333 | unsigned sig; | 1323 | unsigned sig = 0; |
1334 | int i, ret = 0; | 1324 | int i, ret = 0; |
1335 | int irq; | 1325 | int irq; |
1336 | 1326 | ||
@@ -1340,7 +1330,7 @@ static int mmc_omap_probe(struct platform_device *pdev) | |||
1340 | } | 1330 | } |
1341 | if (pdata->nr_slots == 0) { | 1331 | if (pdata->nr_slots == 0) { |
1342 | dev_err(&pdev->dev, "no slots\n"); | 1332 | dev_err(&pdev->dev, "no slots\n"); |
1343 | return -ENXIO; | 1333 | return -EPROBE_DEFER; |
1344 | } | 1334 | } |
1345 | 1335 | ||
1346 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1336 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -1407,19 +1397,20 @@ static int mmc_omap_probe(struct platform_device *pdev) | |||
1407 | host->dma_tx_burst = -1; | 1397 | host->dma_tx_burst = -1; |
1408 | host->dma_rx_burst = -1; | 1398 | host->dma_rx_burst = -1; |
1409 | 1399 | ||
1410 | if (mmc_omap2()) | 1400 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); |
1411 | sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX; | 1401 | if (res) |
1412 | else | 1402 | sig = res->start; |
1413 | sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX; | 1403 | host->dma_tx = dma_request_slave_channel_compat(mask, |
1414 | host->dma_tx = dma_request_channel(mask, omap_dma_filter_fn, &sig); | 1404 | omap_dma_filter_fn, &sig, &pdev->dev, "tx"); |
1415 | if (!host->dma_tx) | 1405 | if (!host->dma_tx) |
1416 | dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n", | 1406 | dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n", |
1417 | sig); | 1407 | sig); |
1418 | if (mmc_omap2()) | 1408 | |
1419 | sig = host->id == 0 ? OMAP24XX_DMA_MMC1_RX : OMAP24XX_DMA_MMC2_RX; | 1409 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); |
1420 | else | 1410 | if (res) |
1421 | sig = host->id == 0 ? OMAP_DMA_MMC_RX : OMAP_DMA_MMC2_RX; | 1411 | sig = res->start; |
1422 | host->dma_rx = dma_request_channel(mask, omap_dma_filter_fn, &sig); | 1412 | host->dma_rx = dma_request_slave_channel_compat(mask, |
1413 | omap_dma_filter_fn, &sig, &pdev->dev, "rx"); | ||
1423 | if (!host->dma_rx) | 1414 | if (!host->dma_rx) |
1424 | dev_warn(host->dev, "unable to obtain RX DMA engine channel %u\n", | 1415 | dev_warn(host->dev, "unable to obtain RX DMA engine channel %u\n", |
1425 | sig); | 1416 | sig); |
@@ -1512,12 +1503,20 @@ static int mmc_omap_remove(struct platform_device *pdev) | |||
1512 | return 0; | 1503 | return 0; |
1513 | } | 1504 | } |
1514 | 1505 | ||
1506 | #if IS_BUILTIN(CONFIG_OF) | ||
1507 | static const struct of_device_id mmc_omap_match[] = { | ||
1508 | { .compatible = "ti,omap2420-mmc", }, | ||
1509 | { }, | ||
1510 | }; | ||
1511 | #endif | ||
1512 | |||
1515 | static struct platform_driver mmc_omap_driver = { | 1513 | static struct platform_driver mmc_omap_driver = { |
1516 | .probe = mmc_omap_probe, | 1514 | .probe = mmc_omap_probe, |
1517 | .remove = mmc_omap_remove, | 1515 | .remove = mmc_omap_remove, |
1518 | .driver = { | 1516 | .driver = { |
1519 | .name = DRIVER_NAME, | 1517 | .name = DRIVER_NAME, |
1520 | .owner = THIS_MODULE, | 1518 | .owner = THIS_MODULE, |
1519 | .of_match_table = of_match_ptr(mmc_omap_match), | ||
1521 | }, | 1520 | }, |
1522 | }; | 1521 | }; |
1523 | 1522 | ||
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 4dd5ee2a34cc..36eab0c4fb33 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4110,7 +4110,7 @@ static int bond_check_params(struct bond_params *params) | |||
4110 | if (!miimon) { | 4110 | if (!miimon) { |
4111 | pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n"); | 4111 | pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n"); |
4112 | pr_warning("Forcing miimon to 100msec\n"); | 4112 | pr_warning("Forcing miimon to 100msec\n"); |
4113 | miimon = 100; | 4113 | miimon = BOND_DEFAULT_MIIMON; |
4114 | } | 4114 | } |
4115 | } | 4115 | } |
4116 | 4116 | ||
@@ -4147,7 +4147,7 @@ static int bond_check_params(struct bond_params *params) | |||
4147 | if (!miimon) { | 4147 | if (!miimon) { |
4148 | pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure and link speed which are essential for TLB/ALB load balancing\n"); | 4148 | pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure and link speed which are essential for TLB/ALB load balancing\n"); |
4149 | pr_warning("Forcing miimon to 100msec\n"); | 4149 | pr_warning("Forcing miimon to 100msec\n"); |
4150 | miimon = 100; | 4150 | miimon = BOND_DEFAULT_MIIMON; |
4151 | } | 4151 | } |
4152 | } | 4152 | } |
4153 | 4153 | ||
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c index 9a5223c7b4d1..ea6f640782b7 100644 --- a/drivers/net/bonding/bond_options.c +++ b/drivers/net/bonding/bond_options.c | |||
@@ -45,10 +45,15 @@ int bond_option_mode_set(struct bonding *bond, int mode) | |||
45 | return -EPERM; | 45 | return -EPERM; |
46 | } | 46 | } |
47 | 47 | ||
48 | if (BOND_MODE_IS_LB(mode) && bond->params.arp_interval) { | 48 | if (BOND_NO_USES_ARP(mode) && bond->params.arp_interval) { |
49 | pr_err("%s: %s mode is incompatible with arp monitoring.\n", | 49 | pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n", |
50 | bond->dev->name, bond_mode_tbl[mode].modename); | 50 | bond->dev->name, bond_mode_tbl[mode].modename); |
51 | return -EINVAL; | 51 | /* disable arp monitoring */ |
52 | bond->params.arp_interval = 0; | ||
53 | /* set miimon to default value */ | ||
54 | bond->params.miimon = BOND_DEFAULT_MIIMON; | ||
55 | pr_info("%s: Setting MII monitoring interval to %d.\n", | ||
56 | bond->dev->name, bond->params.miimon); | ||
52 | } | 57 | } |
53 | 58 | ||
54 | /* don't cache arp_validate between modes */ | 59 | /* don't cache arp_validate between modes */ |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 0ec2a7e8c8a9..abf5e106edc5 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -523,9 +523,7 @@ static ssize_t bonding_store_arp_interval(struct device *d, | |||
523 | ret = -EINVAL; | 523 | ret = -EINVAL; |
524 | goto out; | 524 | goto out; |
525 | } | 525 | } |
526 | if (bond->params.mode == BOND_MODE_ALB || | 526 | if (BOND_NO_USES_ARP(bond->params.mode)) { |
527 | bond->params.mode == BOND_MODE_TLB || | ||
528 | bond->params.mode == BOND_MODE_8023AD) { | ||
529 | pr_info("%s: ARP monitoring cannot be used with ALB/TLB/802.3ad. Only MII monitoring is supported on %s.\n", | 527 | pr_info("%s: ARP monitoring cannot be used with ALB/TLB/802.3ad. Only MII monitoring is supported on %s.\n", |
530 | bond->dev->name, bond->dev->name); | 528 | bond->dev->name, bond->dev->name); |
531 | ret = -EINVAL; | 529 | ret = -EINVAL; |
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index ca31286aa028..a9f4f9f4d8ce 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -35,6 +35,8 @@ | |||
35 | 35 | ||
36 | #define BOND_MAX_ARP_TARGETS 16 | 36 | #define BOND_MAX_ARP_TARGETS 16 |
37 | 37 | ||
38 | #define BOND_DEFAULT_MIIMON 100 | ||
39 | |||
38 | #define IS_UP(dev) \ | 40 | #define IS_UP(dev) \ |
39 | ((((dev)->flags & IFF_UP) == IFF_UP) && \ | 41 | ((((dev)->flags & IFF_UP) == IFF_UP) && \ |
40 | netif_running(dev) && \ | 42 | netif_running(dev) && \ |
@@ -55,6 +57,11 @@ | |||
55 | ((mode) == BOND_MODE_TLB) || \ | 57 | ((mode) == BOND_MODE_TLB) || \ |
56 | ((mode) == BOND_MODE_ALB)) | 58 | ((mode) == BOND_MODE_ALB)) |
57 | 59 | ||
60 | #define BOND_NO_USES_ARP(mode) \ | ||
61 | (((mode) == BOND_MODE_8023AD) || \ | ||
62 | ((mode) == BOND_MODE_TLB) || \ | ||
63 | ((mode) == BOND_MODE_ALB)) | ||
64 | |||
58 | #define TX_QUEUE_OVERRIDE(mode) \ | 65 | #define TX_QUEUE_OVERRIDE(mode) \ |
59 | (((mode) == BOND_MODE_ACTIVEBACKUP) || \ | 66 | (((mode) == BOND_MODE_ACTIVEBACKUP) || \ |
60 | ((mode) == BOND_MODE_ROUNDROBIN)) | 67 | ((mode) == BOND_MODE_ROUNDROBIN)) |
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c index e3fc07cf2f62..77061eebb034 100644 --- a/drivers/net/can/c_can/c_can.c +++ b/drivers/net/can/c_can/c_can.c | |||
@@ -712,22 +712,31 @@ static int c_can_set_mode(struct net_device *dev, enum can_mode mode) | |||
712 | return 0; | 712 | return 0; |
713 | } | 713 | } |
714 | 714 | ||
715 | static int c_can_get_berr_counter(const struct net_device *dev, | 715 | static int __c_can_get_berr_counter(const struct net_device *dev, |
716 | struct can_berr_counter *bec) | 716 | struct can_berr_counter *bec) |
717 | { | 717 | { |
718 | unsigned int reg_err_counter; | 718 | unsigned int reg_err_counter; |
719 | struct c_can_priv *priv = netdev_priv(dev); | 719 | struct c_can_priv *priv = netdev_priv(dev); |
720 | 720 | ||
721 | c_can_pm_runtime_get_sync(priv); | ||
722 | |||
723 | reg_err_counter = priv->read_reg(priv, C_CAN_ERR_CNT_REG); | 721 | reg_err_counter = priv->read_reg(priv, C_CAN_ERR_CNT_REG); |
724 | bec->rxerr = (reg_err_counter & ERR_CNT_REC_MASK) >> | 722 | bec->rxerr = (reg_err_counter & ERR_CNT_REC_MASK) >> |
725 | ERR_CNT_REC_SHIFT; | 723 | ERR_CNT_REC_SHIFT; |
726 | bec->txerr = reg_err_counter & ERR_CNT_TEC_MASK; | 724 | bec->txerr = reg_err_counter & ERR_CNT_TEC_MASK; |
727 | 725 | ||
726 | return 0; | ||
727 | } | ||
728 | |||
729 | static int c_can_get_berr_counter(const struct net_device *dev, | ||
730 | struct can_berr_counter *bec) | ||
731 | { | ||
732 | struct c_can_priv *priv = netdev_priv(dev); | ||
733 | int err; | ||
734 | |||
735 | c_can_pm_runtime_get_sync(priv); | ||
736 | err = __c_can_get_berr_counter(dev, bec); | ||
728 | c_can_pm_runtime_put_sync(priv); | 737 | c_can_pm_runtime_put_sync(priv); |
729 | 738 | ||
730 | return 0; | 739 | return err; |
731 | } | 740 | } |
732 | 741 | ||
733 | /* | 742 | /* |
@@ -754,6 +763,7 @@ static void c_can_do_tx(struct net_device *dev) | |||
754 | if (!(val & (1 << (msg_obj_no - 1)))) { | 763 | if (!(val & (1 << (msg_obj_no - 1)))) { |
755 | can_get_echo_skb(dev, | 764 | can_get_echo_skb(dev, |
756 | msg_obj_no - C_CAN_MSG_OBJ_TX_FIRST); | 765 | msg_obj_no - C_CAN_MSG_OBJ_TX_FIRST); |
766 | c_can_object_get(dev, 0, msg_obj_no, IF_COMM_ALL); | ||
757 | stats->tx_bytes += priv->read_reg(priv, | 767 | stats->tx_bytes += priv->read_reg(priv, |
758 | C_CAN_IFACE(MSGCTRL_REG, 0)) | 768 | C_CAN_IFACE(MSGCTRL_REG, 0)) |
759 | & IF_MCONT_DLC_MASK; | 769 | & IF_MCONT_DLC_MASK; |
@@ -872,7 +882,7 @@ static int c_can_handle_state_change(struct net_device *dev, | |||
872 | if (unlikely(!skb)) | 882 | if (unlikely(!skb)) |
873 | return 0; | 883 | return 0; |
874 | 884 | ||
875 | c_can_get_berr_counter(dev, &bec); | 885 | __c_can_get_berr_counter(dev, &bec); |
876 | reg_err_counter = priv->read_reg(priv, C_CAN_ERR_CNT_REG); | 886 | reg_err_counter = priv->read_reg(priv, C_CAN_ERR_CNT_REG); |
877 | rx_err_passive = (reg_err_counter & ERR_CNT_RP_MASK) >> | 887 | rx_err_passive = (reg_err_counter & ERR_CNT_RP_MASK) >> |
878 | ERR_CNT_RP_SHIFT; | 888 | ERR_CNT_RP_SHIFT; |
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index ae08cf129ebb..aaed97bee471 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
@@ -1020,13 +1020,13 @@ static int flexcan_probe(struct platform_device *pdev) | |||
1020 | dev_err(&pdev->dev, "no ipg clock defined\n"); | 1020 | dev_err(&pdev->dev, "no ipg clock defined\n"); |
1021 | return PTR_ERR(clk_ipg); | 1021 | return PTR_ERR(clk_ipg); |
1022 | } | 1022 | } |
1023 | clock_freq = clk_get_rate(clk_ipg); | ||
1024 | 1023 | ||
1025 | clk_per = devm_clk_get(&pdev->dev, "per"); | 1024 | clk_per = devm_clk_get(&pdev->dev, "per"); |
1026 | if (IS_ERR(clk_per)) { | 1025 | if (IS_ERR(clk_per)) { |
1027 | dev_err(&pdev->dev, "no per clock defined\n"); | 1026 | dev_err(&pdev->dev, "no per clock defined\n"); |
1028 | return PTR_ERR(clk_per); | 1027 | return PTR_ERR(clk_per); |
1029 | } | 1028 | } |
1029 | clock_freq = clk_get_rate(clk_per); | ||
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1032 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c index 7164a999f50f..f17c3018b7c7 100644 --- a/drivers/net/can/sja1000/sja1000.c +++ b/drivers/net/can/sja1000/sja1000.c | |||
@@ -494,20 +494,20 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) | |||
494 | uint8_t isrc, status; | 494 | uint8_t isrc, status; |
495 | int n = 0; | 495 | int n = 0; |
496 | 496 | ||
497 | /* Shared interrupts and IRQ off? */ | ||
498 | if (priv->read_reg(priv, SJA1000_IER) == IRQ_OFF) | ||
499 | return IRQ_NONE; | ||
500 | |||
501 | if (priv->pre_irq) | 497 | if (priv->pre_irq) |
502 | priv->pre_irq(priv); | 498 | priv->pre_irq(priv); |
503 | 499 | ||
500 | /* Shared interrupts and IRQ off? */ | ||
501 | if (priv->read_reg(priv, SJA1000_IER) == IRQ_OFF) | ||
502 | goto out; | ||
503 | |||
504 | while ((isrc = priv->read_reg(priv, SJA1000_IR)) && | 504 | while ((isrc = priv->read_reg(priv, SJA1000_IR)) && |
505 | (n < SJA1000_MAX_IRQ)) { | 505 | (n < SJA1000_MAX_IRQ)) { |
506 | n++; | 506 | |
507 | status = priv->read_reg(priv, SJA1000_SR); | 507 | status = priv->read_reg(priv, SJA1000_SR); |
508 | /* check for absent controller due to hw unplug */ | 508 | /* check for absent controller due to hw unplug */ |
509 | if (status == 0xFF && sja1000_is_absent(priv)) | 509 | if (status == 0xFF && sja1000_is_absent(priv)) |
510 | return IRQ_NONE; | 510 | goto out; |
511 | 511 | ||
512 | if (isrc & IRQ_WUI) | 512 | if (isrc & IRQ_WUI) |
513 | netdev_warn(dev, "wakeup interrupt\n"); | 513 | netdev_warn(dev, "wakeup interrupt\n"); |
@@ -535,7 +535,7 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) | |||
535 | status = priv->read_reg(priv, SJA1000_SR); | 535 | status = priv->read_reg(priv, SJA1000_SR); |
536 | /* check for absent controller */ | 536 | /* check for absent controller */ |
537 | if (status == 0xFF && sja1000_is_absent(priv)) | 537 | if (status == 0xFF && sja1000_is_absent(priv)) |
538 | return IRQ_NONE; | 538 | goto out; |
539 | } | 539 | } |
540 | } | 540 | } |
541 | if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) { | 541 | if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) { |
@@ -543,8 +543,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) | |||
543 | if (sja1000_err(dev, isrc, status)) | 543 | if (sja1000_err(dev, isrc, status)) |
544 | break; | 544 | break; |
545 | } | 545 | } |
546 | n++; | ||
546 | } | 547 | } |
547 | 548 | out: | |
548 | if (priv->post_irq) | 549 | if (priv->post_irq) |
549 | priv->post_irq(priv); | 550 | priv->post_irq(priv); |
550 | 551 | ||
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index a9e068423ba0..369b736dde05 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -10629,10 +10629,8 @@ static void tg3_sd_scan_scratchpad(struct tg3 *tp, struct tg3_ocir *ocir) | |||
10629 | static ssize_t tg3_show_temp(struct device *dev, | 10629 | static ssize_t tg3_show_temp(struct device *dev, |
10630 | struct device_attribute *devattr, char *buf) | 10630 | struct device_attribute *devattr, char *buf) |
10631 | { | 10631 | { |
10632 | struct pci_dev *pdev = to_pci_dev(dev); | ||
10633 | struct net_device *netdev = pci_get_drvdata(pdev); | ||
10634 | struct tg3 *tp = netdev_priv(netdev); | ||
10635 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); | 10632 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
10633 | struct tg3 *tp = dev_get_drvdata(dev); | ||
10636 | u32 temperature; | 10634 | u32 temperature; |
10637 | 10635 | ||
10638 | spin_lock_bh(&tp->lock); | 10636 | spin_lock_bh(&tp->lock); |
@@ -10650,29 +10648,25 @@ static SENSOR_DEVICE_ATTR(temp1_crit, S_IRUGO, tg3_show_temp, NULL, | |||
10650 | static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO, tg3_show_temp, NULL, | 10648 | static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO, tg3_show_temp, NULL, |
10651 | TG3_TEMP_MAX_OFFSET); | 10649 | TG3_TEMP_MAX_OFFSET); |
10652 | 10650 | ||
10653 | static struct attribute *tg3_attributes[] = { | 10651 | static struct attribute *tg3_attrs[] = { |
10654 | &sensor_dev_attr_temp1_input.dev_attr.attr, | 10652 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
10655 | &sensor_dev_attr_temp1_crit.dev_attr.attr, | 10653 | &sensor_dev_attr_temp1_crit.dev_attr.attr, |
10656 | &sensor_dev_attr_temp1_max.dev_attr.attr, | 10654 | &sensor_dev_attr_temp1_max.dev_attr.attr, |
10657 | NULL | 10655 | NULL |
10658 | }; | 10656 | }; |
10659 | 10657 | ATTRIBUTE_GROUPS(tg3); | |
10660 | static const struct attribute_group tg3_group = { | ||
10661 | .attrs = tg3_attributes, | ||
10662 | }; | ||
10663 | 10658 | ||
10664 | static void tg3_hwmon_close(struct tg3 *tp) | 10659 | static void tg3_hwmon_close(struct tg3 *tp) |
10665 | { | 10660 | { |
10666 | if (tp->hwmon_dev) { | 10661 | if (tp->hwmon_dev) { |
10667 | hwmon_device_unregister(tp->hwmon_dev); | 10662 | hwmon_device_unregister(tp->hwmon_dev); |
10668 | tp->hwmon_dev = NULL; | 10663 | tp->hwmon_dev = NULL; |
10669 | sysfs_remove_group(&tp->pdev->dev.kobj, &tg3_group); | ||
10670 | } | 10664 | } |
10671 | } | 10665 | } |
10672 | 10666 | ||
10673 | static void tg3_hwmon_open(struct tg3 *tp) | 10667 | static void tg3_hwmon_open(struct tg3 *tp) |
10674 | { | 10668 | { |
10675 | int i, err; | 10669 | int i; |
10676 | u32 size = 0; | 10670 | u32 size = 0; |
10677 | struct pci_dev *pdev = tp->pdev; | 10671 | struct pci_dev *pdev = tp->pdev; |
10678 | struct tg3_ocir ocirs[TG3_SD_NUM_RECS]; | 10672 | struct tg3_ocir ocirs[TG3_SD_NUM_RECS]; |
@@ -10690,18 +10684,11 @@ static void tg3_hwmon_open(struct tg3 *tp) | |||
10690 | if (!size) | 10684 | if (!size) |
10691 | return; | 10685 | return; |
10692 | 10686 | ||
10693 | /* Register hwmon sysfs hooks */ | 10687 | tp->hwmon_dev = hwmon_device_register_with_groups(&pdev->dev, "tg3", |
10694 | err = sysfs_create_group(&pdev->dev.kobj, &tg3_group); | 10688 | tp, tg3_groups); |
10695 | if (err) { | ||
10696 | dev_err(&pdev->dev, "Cannot create sysfs group, aborting\n"); | ||
10697 | return; | ||
10698 | } | ||
10699 | |||
10700 | tp->hwmon_dev = hwmon_device_register(&pdev->dev); | ||
10701 | if (IS_ERR(tp->hwmon_dev)) { | 10689 | if (IS_ERR(tp->hwmon_dev)) { |
10702 | tp->hwmon_dev = NULL; | 10690 | tp->hwmon_dev = NULL; |
10703 | dev_err(&pdev->dev, "Cannot register hwmon device, aborting\n"); | 10691 | dev_err(&pdev->dev, "Cannot register hwmon device, aborting\n"); |
10704 | sysfs_remove_group(&pdev->dev.kobj, &tg3_group); | ||
10705 | } | 10692 | } |
10706 | } | 10693 | } |
10707 | 10694 | ||
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index f4825db5d179..5878df619b53 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
@@ -503,6 +503,7 @@ struct be_adapter { | |||
503 | }; | 503 | }; |
504 | 504 | ||
505 | #define be_physfn(adapter) (!adapter->virtfn) | 505 | #define be_physfn(adapter) (!adapter->virtfn) |
506 | #define be_virtfn(adapter) (adapter->virtfn) | ||
506 | #define sriov_enabled(adapter) (adapter->num_vfs > 0) | 507 | #define sriov_enabled(adapter) (adapter->num_vfs > 0) |
507 | #define sriov_want(adapter) (be_physfn(adapter) && \ | 508 | #define sriov_want(adapter) (be_physfn(adapter) && \ |
508 | (num_vfs || pci_num_vf(adapter->pdev))) | 509 | (num_vfs || pci_num_vf(adapter->pdev))) |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index dbcd5262c016..e0e8bc1ef14c 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -1032,6 +1032,13 @@ int be_cmd_cq_create(struct be_adapter *adapter, struct be_queue_info *cq, | |||
1032 | } else { | 1032 | } else { |
1033 | req->hdr.version = 2; | 1033 | req->hdr.version = 2; |
1034 | req->page_size = 1; /* 1 for 4K */ | 1034 | req->page_size = 1; /* 1 for 4K */ |
1035 | |||
1036 | /* coalesce-wm field in this cmd is not relevant to Lancer. | ||
1037 | * Lancer uses COMMON_MODIFY_CQ to set this field | ||
1038 | */ | ||
1039 | if (!lancer_chip(adapter)) | ||
1040 | AMAP_SET_BITS(struct amap_cq_context_v2, coalescwm, | ||
1041 | ctxt, coalesce_wm); | ||
1035 | AMAP_SET_BITS(struct amap_cq_context_v2, nodelay, ctxt, | 1042 | AMAP_SET_BITS(struct amap_cq_context_v2, nodelay, ctxt, |
1036 | no_delay); | 1043 | no_delay); |
1037 | AMAP_SET_BITS(struct amap_cq_context_v2, count, ctxt, | 1044 | AMAP_SET_BITS(struct amap_cq_context_v2, count, ctxt, |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index abde97471636..fee64bf10446 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -2658,8 +2658,8 @@ static int be_close(struct net_device *netdev) | |||
2658 | 2658 | ||
2659 | be_roce_dev_close(adapter); | 2659 | be_roce_dev_close(adapter); |
2660 | 2660 | ||
2661 | for_all_evt_queues(adapter, eqo, i) { | 2661 | if (adapter->flags & BE_FLAGS_NAPI_ENABLED) { |
2662 | if (adapter->flags & BE_FLAGS_NAPI_ENABLED) { | 2662 | for_all_evt_queues(adapter, eqo, i) { |
2663 | napi_disable(&eqo->napi); | 2663 | napi_disable(&eqo->napi); |
2664 | be_disable_busy_poll(eqo); | 2664 | be_disable_busy_poll(eqo); |
2665 | } | 2665 | } |
@@ -3253,12 +3253,10 @@ static int be_mac_setup(struct be_adapter *adapter) | |||
3253 | memcpy(mac, adapter->netdev->dev_addr, ETH_ALEN); | 3253 | memcpy(mac, adapter->netdev->dev_addr, ETH_ALEN); |
3254 | } | 3254 | } |
3255 | 3255 | ||
3256 | /* On BE3 VFs this cmd may fail due to lack of privilege. | 3256 | /* For BE3-R VFs, the PF programs the initial MAC address */ |
3257 | * Ignore the failure as in this case pmac_id is fetched | 3257 | if (!(BEx_chip(adapter) && be_virtfn(adapter))) |
3258 | * in the IFACE_CREATE cmd. | 3258 | be_cmd_pmac_add(adapter, mac, adapter->if_handle, |
3259 | */ | 3259 | &adapter->pmac_id[0], 0); |
3260 | be_cmd_pmac_add(adapter, mac, adapter->if_handle, | ||
3261 | &adapter->pmac_id[0], 0); | ||
3262 | return 0; | 3260 | return 0; |
3263 | } | 3261 | } |
3264 | 3262 | ||
@@ -4599,6 +4597,7 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4599 | if (adapter->wol) | 4597 | if (adapter->wol) |
4600 | be_setup_wol(adapter, true); | 4598 | be_setup_wol(adapter, true); |
4601 | 4599 | ||
4600 | be_intr_set(adapter, false); | ||
4602 | cancel_delayed_work_sync(&adapter->func_recovery_work); | 4601 | cancel_delayed_work_sync(&adapter->func_recovery_work); |
4603 | 4602 | ||
4604 | netif_device_detach(netdev); | 4603 | netif_device_detach(netdev); |
@@ -4634,6 +4633,7 @@ static int be_resume(struct pci_dev *pdev) | |||
4634 | if (status) | 4633 | if (status) |
4635 | return status; | 4634 | return status; |
4636 | 4635 | ||
4636 | be_intr_set(adapter, true); | ||
4637 | /* tell fw we're ready to fire cmds */ | 4637 | /* tell fw we're ready to fire cmds */ |
4638 | status = be_cmd_fw_init(adapter); | 4638 | status = be_cmd_fw_init(adapter); |
4639 | if (status) | 4639 | if (status) |
diff --git a/drivers/net/ethernet/intel/e1000/e1000.h b/drivers/net/ethernet/intel/e1000/e1000.h index 58c147271a36..f9313b36c887 100644 --- a/drivers/net/ethernet/intel/e1000/e1000.h +++ b/drivers/net/ethernet/intel/e1000/e1000.h | |||
@@ -83,6 +83,11 @@ struct e1000_adapter; | |||
83 | 83 | ||
84 | #define E1000_MAX_INTR 10 | 84 | #define E1000_MAX_INTR 10 |
85 | 85 | ||
86 | /* | ||
87 | * Count for polling __E1000_RESET condition every 10-20msec. | ||
88 | */ | ||
89 | #define E1000_CHECK_RESET_COUNT 50 | ||
90 | |||
86 | /* TX/RX descriptor defines */ | 91 | /* TX/RX descriptor defines */ |
87 | #define E1000_DEFAULT_TXD 256 | 92 | #define E1000_DEFAULT_TXD 256 |
88 | #define E1000_MAX_TXD 256 | 93 | #define E1000_MAX_TXD 256 |
@@ -312,8 +317,6 @@ struct e1000_adapter { | |||
312 | struct delayed_work watchdog_task; | 317 | struct delayed_work watchdog_task; |
313 | struct delayed_work fifo_stall_task; | 318 | struct delayed_work fifo_stall_task; |
314 | struct delayed_work phy_info_task; | 319 | struct delayed_work phy_info_task; |
315 | |||
316 | struct mutex mutex; | ||
317 | }; | 320 | }; |
318 | 321 | ||
319 | enum e1000_state_t { | 322 | enum e1000_state_t { |
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index e38622825fa7..46e6544ed1b7 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -494,13 +494,20 @@ static void e1000_down_and_stop(struct e1000_adapter *adapter) | |||
494 | { | 494 | { |
495 | set_bit(__E1000_DOWN, &adapter->flags); | 495 | set_bit(__E1000_DOWN, &adapter->flags); |
496 | 496 | ||
497 | /* Only kill reset task if adapter is not resetting */ | ||
498 | if (!test_bit(__E1000_RESETTING, &adapter->flags)) | ||
499 | cancel_work_sync(&adapter->reset_task); | ||
500 | |||
501 | cancel_delayed_work_sync(&adapter->watchdog_task); | 497 | cancel_delayed_work_sync(&adapter->watchdog_task); |
498 | |||
499 | /* | ||
500 | * Since the watchdog task can reschedule other tasks, we should cancel | ||
501 | * it first, otherwise we can run into the situation when a work is | ||
502 | * still running after the adapter has been turned down. | ||
503 | */ | ||
504 | |||
502 | cancel_delayed_work_sync(&adapter->phy_info_task); | 505 | cancel_delayed_work_sync(&adapter->phy_info_task); |
503 | cancel_delayed_work_sync(&adapter->fifo_stall_task); | 506 | cancel_delayed_work_sync(&adapter->fifo_stall_task); |
507 | |||
508 | /* Only kill reset task if adapter is not resetting */ | ||
509 | if (!test_bit(__E1000_RESETTING, &adapter->flags)) | ||
510 | cancel_work_sync(&adapter->reset_task); | ||
504 | } | 511 | } |
505 | 512 | ||
506 | void e1000_down(struct e1000_adapter *adapter) | 513 | void e1000_down(struct e1000_adapter *adapter) |
@@ -544,21 +551,8 @@ void e1000_down(struct e1000_adapter *adapter) | |||
544 | e1000_clean_all_rx_rings(adapter); | 551 | e1000_clean_all_rx_rings(adapter); |
545 | } | 552 | } |
546 | 553 | ||
547 | static void e1000_reinit_safe(struct e1000_adapter *adapter) | ||
548 | { | ||
549 | while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) | ||
550 | msleep(1); | ||
551 | mutex_lock(&adapter->mutex); | ||
552 | e1000_down(adapter); | ||
553 | e1000_up(adapter); | ||
554 | mutex_unlock(&adapter->mutex); | ||
555 | clear_bit(__E1000_RESETTING, &adapter->flags); | ||
556 | } | ||
557 | |||
558 | void e1000_reinit_locked(struct e1000_adapter *adapter) | 554 | void e1000_reinit_locked(struct e1000_adapter *adapter) |
559 | { | 555 | { |
560 | /* if rtnl_lock is not held the call path is bogus */ | ||
561 | ASSERT_RTNL(); | ||
562 | WARN_ON(in_interrupt()); | 556 | WARN_ON(in_interrupt()); |
563 | while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) | 557 | while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) |
564 | msleep(1); | 558 | msleep(1); |
@@ -1316,7 +1310,6 @@ static int e1000_sw_init(struct e1000_adapter *adapter) | |||
1316 | e1000_irq_disable(adapter); | 1310 | e1000_irq_disable(adapter); |
1317 | 1311 | ||
1318 | spin_lock_init(&adapter->stats_lock); | 1312 | spin_lock_init(&adapter->stats_lock); |
1319 | mutex_init(&adapter->mutex); | ||
1320 | 1313 | ||
1321 | set_bit(__E1000_DOWN, &adapter->flags); | 1314 | set_bit(__E1000_DOWN, &adapter->flags); |
1322 | 1315 | ||
@@ -1440,6 +1433,10 @@ static int e1000_close(struct net_device *netdev) | |||
1440 | { | 1433 | { |
1441 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1434 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1442 | struct e1000_hw *hw = &adapter->hw; | 1435 | struct e1000_hw *hw = &adapter->hw; |
1436 | int count = E1000_CHECK_RESET_COUNT; | ||
1437 | |||
1438 | while (test_bit(__E1000_RESETTING, &adapter->flags) && count--) | ||
1439 | usleep_range(10000, 20000); | ||
1443 | 1440 | ||
1444 | WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags)); | 1441 | WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags)); |
1445 | e1000_down(adapter); | 1442 | e1000_down(adapter); |
@@ -2325,11 +2322,8 @@ static void e1000_update_phy_info_task(struct work_struct *work) | |||
2325 | struct e1000_adapter *adapter = container_of(work, | 2322 | struct e1000_adapter *adapter = container_of(work, |
2326 | struct e1000_adapter, | 2323 | struct e1000_adapter, |
2327 | phy_info_task.work); | 2324 | phy_info_task.work); |
2328 | if (test_bit(__E1000_DOWN, &adapter->flags)) | 2325 | |
2329 | return; | ||
2330 | mutex_lock(&adapter->mutex); | ||
2331 | e1000_phy_get_info(&adapter->hw, &adapter->phy_info); | 2326 | e1000_phy_get_info(&adapter->hw, &adapter->phy_info); |
2332 | mutex_unlock(&adapter->mutex); | ||
2333 | } | 2327 | } |
2334 | 2328 | ||
2335 | /** | 2329 | /** |
@@ -2345,9 +2339,6 @@ static void e1000_82547_tx_fifo_stall_task(struct work_struct *work) | |||
2345 | struct net_device *netdev = adapter->netdev; | 2339 | struct net_device *netdev = adapter->netdev; |
2346 | u32 tctl; | 2340 | u32 tctl; |
2347 | 2341 | ||
2348 | if (test_bit(__E1000_DOWN, &adapter->flags)) | ||
2349 | return; | ||
2350 | mutex_lock(&adapter->mutex); | ||
2351 | if (atomic_read(&adapter->tx_fifo_stall)) { | 2342 | if (atomic_read(&adapter->tx_fifo_stall)) { |
2352 | if ((er32(TDT) == er32(TDH)) && | 2343 | if ((er32(TDT) == er32(TDH)) && |
2353 | (er32(TDFT) == er32(TDFH)) && | 2344 | (er32(TDFT) == er32(TDFH)) && |
@@ -2368,7 +2359,6 @@ static void e1000_82547_tx_fifo_stall_task(struct work_struct *work) | |||
2368 | schedule_delayed_work(&adapter->fifo_stall_task, 1); | 2359 | schedule_delayed_work(&adapter->fifo_stall_task, 1); |
2369 | } | 2360 | } |
2370 | } | 2361 | } |
2371 | mutex_unlock(&adapter->mutex); | ||
2372 | } | 2362 | } |
2373 | 2363 | ||
2374 | bool e1000_has_link(struct e1000_adapter *adapter) | 2364 | bool e1000_has_link(struct e1000_adapter *adapter) |
@@ -2422,10 +2412,6 @@ static void e1000_watchdog(struct work_struct *work) | |||
2422 | struct e1000_tx_ring *txdr = adapter->tx_ring; | 2412 | struct e1000_tx_ring *txdr = adapter->tx_ring; |
2423 | u32 link, tctl; | 2413 | u32 link, tctl; |
2424 | 2414 | ||
2425 | if (test_bit(__E1000_DOWN, &adapter->flags)) | ||
2426 | return; | ||
2427 | |||
2428 | mutex_lock(&adapter->mutex); | ||
2429 | link = e1000_has_link(adapter); | 2415 | link = e1000_has_link(adapter); |
2430 | if ((netif_carrier_ok(netdev)) && link) | 2416 | if ((netif_carrier_ok(netdev)) && link) |
2431 | goto link_up; | 2417 | goto link_up; |
@@ -2516,7 +2502,7 @@ link_up: | |||
2516 | adapter->tx_timeout_count++; | 2502 | adapter->tx_timeout_count++; |
2517 | schedule_work(&adapter->reset_task); | 2503 | schedule_work(&adapter->reset_task); |
2518 | /* exit immediately since reset is imminent */ | 2504 | /* exit immediately since reset is imminent */ |
2519 | goto unlock; | 2505 | return; |
2520 | } | 2506 | } |
2521 | } | 2507 | } |
2522 | 2508 | ||
@@ -2544,9 +2530,6 @@ link_up: | |||
2544 | /* Reschedule the task */ | 2530 | /* Reschedule the task */ |
2545 | if (!test_bit(__E1000_DOWN, &adapter->flags)) | 2531 | if (!test_bit(__E1000_DOWN, &adapter->flags)) |
2546 | schedule_delayed_work(&adapter->watchdog_task, 2 * HZ); | 2532 | schedule_delayed_work(&adapter->watchdog_task, 2 * HZ); |
2547 | |||
2548 | unlock: | ||
2549 | mutex_unlock(&adapter->mutex); | ||
2550 | } | 2533 | } |
2551 | 2534 | ||
2552 | enum latency_range { | 2535 | enum latency_range { |
@@ -3495,10 +3478,8 @@ static void e1000_reset_task(struct work_struct *work) | |||
3495 | struct e1000_adapter *adapter = | 3478 | struct e1000_adapter *adapter = |
3496 | container_of(work, struct e1000_adapter, reset_task); | 3479 | container_of(work, struct e1000_adapter, reset_task); |
3497 | 3480 | ||
3498 | if (test_bit(__E1000_DOWN, &adapter->flags)) | ||
3499 | return; | ||
3500 | e_err(drv, "Reset adapter\n"); | 3481 | e_err(drv, "Reset adapter\n"); |
3501 | e1000_reinit_safe(adapter); | 3482 | e1000_reinit_locked(adapter); |
3502 | } | 3483 | } |
3503 | 3484 | ||
3504 | /** | 3485 | /** |
@@ -4963,6 +4944,11 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
4963 | netif_device_detach(netdev); | 4944 | netif_device_detach(netdev); |
4964 | 4945 | ||
4965 | if (netif_running(netdev)) { | 4946 | if (netif_running(netdev)) { |
4947 | int count = E1000_CHECK_RESET_COUNT; | ||
4948 | |||
4949 | while (test_bit(__E1000_RESETTING, &adapter->flags) && count--) | ||
4950 | usleep_range(10000, 20000); | ||
4951 | |||
4966 | WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags)); | 4952 | WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags)); |
4967 | e1000_down(adapter); | 4953 | e1000_down(adapter); |
4968 | } | 4954 | } |
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index b0f3666b1d7f..c3143da497c8 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c | |||
@@ -2062,14 +2062,15 @@ static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
2062 | { | 2062 | { |
2063 | struct igb_adapter *adapter = netdev_priv(netdev); | 2063 | struct igb_adapter *adapter = netdev_priv(netdev); |
2064 | 2064 | ||
2065 | wol->supported = WAKE_UCAST | WAKE_MCAST | | ||
2066 | WAKE_BCAST | WAKE_MAGIC | | ||
2067 | WAKE_PHY; | ||
2068 | wol->wolopts = 0; | 2065 | wol->wolopts = 0; |
2069 | 2066 | ||
2070 | if (!(adapter->flags & IGB_FLAG_WOL_SUPPORTED)) | 2067 | if (!(adapter->flags & IGB_FLAG_WOL_SUPPORTED)) |
2071 | return; | 2068 | return; |
2072 | 2069 | ||
2070 | wol->supported = WAKE_UCAST | WAKE_MCAST | | ||
2071 | WAKE_BCAST | WAKE_MAGIC | | ||
2072 | WAKE_PHY; | ||
2073 | |||
2073 | /* apply any specific unsupported masks here */ | 2074 | /* apply any specific unsupported masks here */ |
2074 | switch (adapter->hw.device_id) { | 2075 | switch (adapter->hw.device_id) { |
2075 | default: | 2076 | default: |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 0c55079ebee3..cc06854296a3 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -4251,8 +4251,8 @@ static void ixgbe_disable_fwd_ring(struct ixgbe_fwd_adapter *vadapter, | |||
4251 | rx_ring->l2_accel_priv = NULL; | 4251 | rx_ring->l2_accel_priv = NULL; |
4252 | } | 4252 | } |
4253 | 4253 | ||
4254 | int ixgbe_fwd_ring_down(struct net_device *vdev, | 4254 | static int ixgbe_fwd_ring_down(struct net_device *vdev, |
4255 | struct ixgbe_fwd_adapter *accel) | 4255 | struct ixgbe_fwd_adapter *accel) |
4256 | { | 4256 | { |
4257 | struct ixgbe_adapter *adapter = accel->real_adapter; | 4257 | struct ixgbe_adapter *adapter = accel->real_adapter; |
4258 | unsigned int rxbase = accel->rx_base_queue; | 4258 | unsigned int rxbase = accel->rx_base_queue; |
@@ -7986,10 +7986,9 @@ skip_sriov: | |||
7986 | NETIF_F_TSO | | 7986 | NETIF_F_TSO | |
7987 | NETIF_F_TSO6 | | 7987 | NETIF_F_TSO6 | |
7988 | NETIF_F_RXHASH | | 7988 | NETIF_F_RXHASH | |
7989 | NETIF_F_RXCSUM | | 7989 | NETIF_F_RXCSUM; |
7990 | NETIF_F_HW_L2FW_DOFFLOAD; | ||
7991 | 7990 | ||
7992 | netdev->hw_features = netdev->features; | 7991 | netdev->hw_features = netdev->features | NETIF_F_HW_L2FW_DOFFLOAD; |
7993 | 7992 | ||
7994 | switch (adapter->hw.mac.type) { | 7993 | switch (adapter->hw.mac.type) { |
7995 | case ixgbe_mac_82599EB: | 7994 | case ixgbe_mac_82599EB: |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c index e4c676006be9..39217e5ff7dc 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | |||
@@ -46,6 +46,7 @@ static bool ixgbe_get_i2c_data(u32 *i2cctl); | |||
46 | static void ixgbe_i2c_bus_clear(struct ixgbe_hw *hw); | 46 | static void ixgbe_i2c_bus_clear(struct ixgbe_hw *hw); |
47 | static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id); | 47 | static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id); |
48 | static s32 ixgbe_get_phy_id(struct ixgbe_hw *hw); | 48 | static s32 ixgbe_get_phy_id(struct ixgbe_hw *hw); |
49 | static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw); | ||
49 | 50 | ||
50 | /** | 51 | /** |
51 | * ixgbe_identify_phy_generic - Get physical layer module | 52 | * ixgbe_identify_phy_generic - Get physical layer module |
@@ -1164,7 +1165,7 @@ err_read_i2c_eeprom: | |||
1164 | * | 1165 | * |
1165 | * Searches for and identifies the QSFP module and assigns appropriate PHY type | 1166 | * Searches for and identifies the QSFP module and assigns appropriate PHY type |
1166 | **/ | 1167 | **/ |
1167 | s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) | 1168 | static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) |
1168 | { | 1169 | { |
1169 | struct ixgbe_adapter *adapter = hw->back; | 1170 | struct ixgbe_adapter *adapter = hw->back; |
1170 | s32 status = IXGBE_ERR_PHY_ADDR_INVALID; | 1171 | s32 status = IXGBE_ERR_PHY_ADDR_INVALID; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h index aae900a256da..fffcbdd2bf0e 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h | |||
@@ -145,7 +145,6 @@ s32 ixgbe_get_phy_firmware_version_generic(struct ixgbe_hw *hw, | |||
145 | s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw); | 145 | s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw); |
146 | s32 ixgbe_identify_module_generic(struct ixgbe_hw *hw); | 146 | s32 ixgbe_identify_module_generic(struct ixgbe_hw *hw); |
147 | s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw); | 147 | s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw); |
148 | s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw); | ||
149 | s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, | 148 | s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, |
150 | u16 *list_offset, | 149 | u16 *list_offset, |
151 | u16 *data_offset); | 150 | u16 *data_offset); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c index 40626690e8a8..c11d063473e5 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c | |||
@@ -140,7 +140,6 @@ void mlx4_en_ex_selftest(struct net_device *dev, u32 *flags, u64 *buf) | |||
140 | { | 140 | { |
141 | struct mlx4_en_priv *priv = netdev_priv(dev); | 141 | struct mlx4_en_priv *priv = netdev_priv(dev); |
142 | struct mlx4_en_dev *mdev = priv->mdev; | 142 | struct mlx4_en_dev *mdev = priv->mdev; |
143 | struct mlx4_en_tx_ring *tx_ring; | ||
144 | int i, carrier_ok; | 143 | int i, carrier_ok; |
145 | 144 | ||
146 | memset(buf, 0, sizeof(u64) * MLX4_EN_NUM_SELF_TEST); | 145 | memset(buf, 0, sizeof(u64) * MLX4_EN_NUM_SELF_TEST); |
@@ -150,16 +149,10 @@ void mlx4_en_ex_selftest(struct net_device *dev, u32 *flags, u64 *buf) | |||
150 | carrier_ok = netif_carrier_ok(dev); | 149 | carrier_ok = netif_carrier_ok(dev); |
151 | 150 | ||
152 | netif_carrier_off(dev); | 151 | netif_carrier_off(dev); |
153 | retry_tx: | ||
154 | /* Wait until all tx queues are empty. | 152 | /* Wait until all tx queues are empty. |
155 | * there should not be any additional incoming traffic | 153 | * there should not be any additional incoming traffic |
156 | * since we turned the carrier off */ | 154 | * since we turned the carrier off */ |
157 | msleep(200); | 155 | msleep(200); |
158 | for (i = 0; i < priv->tx_ring_num && carrier_ok; i++) { | ||
159 | tx_ring = priv->tx_ring[i]; | ||
160 | if (tx_ring->prod != (tx_ring->cons + tx_ring->last_nr_txbb)) | ||
161 | goto retry_tx; | ||
162 | } | ||
163 | 156 | ||
164 | if (priv->mdev->dev->caps.flags & | 157 | if (priv->mdev->dev->caps.flags & |
165 | MLX4_DEV_CAP_FLAG_UC_LOOPBACK) { | 158 | MLX4_DEV_CAP_FLAG_UC_LOOPBACK) { |
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index f2a2128165dd..737c1a881f78 100644 --- a/drivers/net/ethernet/realtek/8139cp.c +++ b/drivers/net/ethernet/realtek/8139cp.c | |||
@@ -678,9 +678,6 @@ static void cp_tx (struct cp_private *cp) | |||
678 | le32_to_cpu(txd->opts1) & 0xffff, | 678 | le32_to_cpu(txd->opts1) & 0xffff, |
679 | PCI_DMA_TODEVICE); | 679 | PCI_DMA_TODEVICE); |
680 | 680 | ||
681 | bytes_compl += skb->len; | ||
682 | pkts_compl++; | ||
683 | |||
684 | if (status & LastFrag) { | 681 | if (status & LastFrag) { |
685 | if (status & (TxError | TxFIFOUnder)) { | 682 | if (status & (TxError | TxFIFOUnder)) { |
686 | netif_dbg(cp, tx_err, cp->dev, | 683 | netif_dbg(cp, tx_err, cp->dev, |
@@ -702,6 +699,8 @@ static void cp_tx (struct cp_private *cp) | |||
702 | netif_dbg(cp, tx_done, cp->dev, | 699 | netif_dbg(cp, tx_done, cp->dev, |
703 | "tx done, slot %d\n", tx_tail); | 700 | "tx done, slot %d\n", tx_tail); |
704 | } | 701 | } |
702 | bytes_compl += skb->len; | ||
703 | pkts_compl++; | ||
705 | dev_kfree_skb_irq(skb); | 704 | dev_kfree_skb_irq(skb); |
706 | } | 705 | } |
707 | 706 | ||
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 799387570766..c737f0ea5de7 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -3465,6 +3465,11 @@ static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp) | |||
3465 | rtl_writephy(tp, 0x14, 0x9065); | 3465 | rtl_writephy(tp, 0x14, 0x9065); |
3466 | rtl_writephy(tp, 0x14, 0x1065); | 3466 | rtl_writephy(tp, 0x14, 0x1065); |
3467 | 3467 | ||
3468 | /* Check ALDPS bit, disable it if enabled */ | ||
3469 | rtl_writephy(tp, 0x1f, 0x0a43); | ||
3470 | if (rtl_readphy(tp, 0x10) & 0x0004) | ||
3471 | rtl_w1w0_phy(tp, 0x10, 0x0000, 0x0004); | ||
3472 | |||
3468 | rtl_writephy(tp, 0x1f, 0x0000); | 3473 | rtl_writephy(tp, 0x1f, 0x0000); |
3469 | } | 3474 | } |
3470 | 3475 | ||
diff --git a/drivers/net/ethernet/sfc/mcdi.h b/drivers/net/ethernet/sfc/mcdi.h index 656a3277c2b2..15816cacb548 100644 --- a/drivers/net/ethernet/sfc/mcdi.h +++ b/drivers/net/ethernet/sfc/mcdi.h | |||
@@ -75,6 +75,8 @@ struct efx_mcdi_mon { | |||
75 | unsigned long last_update; | 75 | unsigned long last_update; |
76 | struct device *device; | 76 | struct device *device; |
77 | struct efx_mcdi_mon_attribute *attrs; | 77 | struct efx_mcdi_mon_attribute *attrs; |
78 | struct attribute_group group; | ||
79 | const struct attribute_group *groups[2]; | ||
78 | unsigned int n_attrs; | 80 | unsigned int n_attrs; |
79 | }; | 81 | }; |
80 | 82 | ||
diff --git a/drivers/net/ethernet/sfc/mcdi_mon.c b/drivers/net/ethernet/sfc/mcdi_mon.c index 4cc5d95b2a5a..d72ad4fc3617 100644 --- a/drivers/net/ethernet/sfc/mcdi_mon.c +++ b/drivers/net/ethernet/sfc/mcdi_mon.c | |||
@@ -139,17 +139,10 @@ static int efx_mcdi_mon_update(struct efx_nic *efx) | |||
139 | return rc; | 139 | return rc; |
140 | } | 140 | } |
141 | 141 | ||
142 | static ssize_t efx_mcdi_mon_show_name(struct device *dev, | ||
143 | struct device_attribute *attr, | ||
144 | char *buf) | ||
145 | { | ||
146 | return sprintf(buf, "%s\n", KBUILD_MODNAME); | ||
147 | } | ||
148 | |||
149 | static int efx_mcdi_mon_get_entry(struct device *dev, unsigned int index, | 142 | static int efx_mcdi_mon_get_entry(struct device *dev, unsigned int index, |
150 | efx_dword_t *entry) | 143 | efx_dword_t *entry) |
151 | { | 144 | { |
152 | struct efx_nic *efx = dev_get_drvdata(dev); | 145 | struct efx_nic *efx = dev_get_drvdata(dev->parent); |
153 | struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); | 146 | struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); |
154 | int rc; | 147 | int rc; |
155 | 148 | ||
@@ -263,7 +256,7 @@ static ssize_t efx_mcdi_mon_show_label(struct device *dev, | |||
263 | efx_mcdi_sensor_type[mon_attr->type].label); | 256 | efx_mcdi_sensor_type[mon_attr->type].label); |
264 | } | 257 | } |
265 | 258 | ||
266 | static int | 259 | static void |
267 | efx_mcdi_mon_add_attr(struct efx_nic *efx, const char *name, | 260 | efx_mcdi_mon_add_attr(struct efx_nic *efx, const char *name, |
268 | ssize_t (*reader)(struct device *, | 261 | ssize_t (*reader)(struct device *, |
269 | struct device_attribute *, char *), | 262 | struct device_attribute *, char *), |
@@ -272,7 +265,6 @@ efx_mcdi_mon_add_attr(struct efx_nic *efx, const char *name, | |||
272 | { | 265 | { |
273 | struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); | 266 | struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); |
274 | struct efx_mcdi_mon_attribute *attr = &hwmon->attrs[hwmon->n_attrs]; | 267 | struct efx_mcdi_mon_attribute *attr = &hwmon->attrs[hwmon->n_attrs]; |
275 | int rc; | ||
276 | 268 | ||
277 | strlcpy(attr->name, name, sizeof(attr->name)); | 269 | strlcpy(attr->name, name, sizeof(attr->name)); |
278 | attr->index = index; | 270 | attr->index = index; |
@@ -286,10 +278,7 @@ efx_mcdi_mon_add_attr(struct efx_nic *efx, const char *name, | |||
286 | attr->dev_attr.attr.name = attr->name; | 278 | attr->dev_attr.attr.name = attr->name; |
287 | attr->dev_attr.attr.mode = S_IRUGO; | 279 | attr->dev_attr.attr.mode = S_IRUGO; |
288 | attr->dev_attr.show = reader; | 280 | attr->dev_attr.show = reader; |
289 | rc = device_create_file(&efx->pci_dev->dev, &attr->dev_attr); | 281 | hwmon->group.attrs[hwmon->n_attrs++] = &attr->dev_attr.attr; |
290 | if (rc == 0) | ||
291 | ++hwmon->n_attrs; | ||
292 | return rc; | ||
293 | } | 282 | } |
294 | 283 | ||
295 | int efx_mcdi_mon_probe(struct efx_nic *efx) | 284 | int efx_mcdi_mon_probe(struct efx_nic *efx) |
@@ -338,26 +327,22 @@ int efx_mcdi_mon_probe(struct efx_nic *efx) | |||
338 | efx_mcdi_mon_update(efx); | 327 | efx_mcdi_mon_update(efx); |
339 | 328 | ||
340 | /* Allocate space for the maximum possible number of | 329 | /* Allocate space for the maximum possible number of |
341 | * attributes for this set of sensors: name of the driver plus | 330 | * attributes for this set of sensors: |
342 | * value, min, max, crit, alarm and label for each sensor. | 331 | * value, min, max, crit, alarm and label for each sensor. |
343 | */ | 332 | */ |
344 | n_attrs = 1 + 6 * n_sensors; | 333 | n_attrs = 6 * n_sensors; |
345 | hwmon->attrs = kcalloc(n_attrs, sizeof(*hwmon->attrs), GFP_KERNEL); | 334 | hwmon->attrs = kcalloc(n_attrs, sizeof(*hwmon->attrs), GFP_KERNEL); |
346 | if (!hwmon->attrs) { | 335 | if (!hwmon->attrs) { |
347 | rc = -ENOMEM; | 336 | rc = -ENOMEM; |
348 | goto fail; | 337 | goto fail; |
349 | } | 338 | } |
350 | 339 | hwmon->group.attrs = kcalloc(n_attrs + 1, sizeof(struct attribute *), | |
351 | hwmon->device = hwmon_device_register(&efx->pci_dev->dev); | 340 | GFP_KERNEL); |
352 | if (IS_ERR(hwmon->device)) { | 341 | if (!hwmon->group.attrs) { |
353 | rc = PTR_ERR(hwmon->device); | 342 | rc = -ENOMEM; |
354 | goto fail; | 343 | goto fail; |
355 | } | 344 | } |
356 | 345 | ||
357 | rc = efx_mcdi_mon_add_attr(efx, "name", efx_mcdi_mon_show_name, 0, 0, 0); | ||
358 | if (rc) | ||
359 | goto fail; | ||
360 | |||
361 | for (i = 0, j = -1, type = -1; ; i++) { | 346 | for (i = 0, j = -1, type = -1; ; i++) { |
362 | enum efx_hwmon_type hwmon_type; | 347 | enum efx_hwmon_type hwmon_type; |
363 | const char *hwmon_prefix; | 348 | const char *hwmon_prefix; |
@@ -372,7 +357,7 @@ int efx_mcdi_mon_probe(struct efx_nic *efx) | |||
372 | page = type / 32; | 357 | page = type / 32; |
373 | j = -1; | 358 | j = -1; |
374 | if (page == n_pages) | 359 | if (page == n_pages) |
375 | return 0; | 360 | goto hwmon_register; |
376 | 361 | ||
377 | MCDI_SET_DWORD(inbuf, SENSOR_INFO_EXT_IN_PAGE, | 362 | MCDI_SET_DWORD(inbuf, SENSOR_INFO_EXT_IN_PAGE, |
378 | page); | 363 | page); |
@@ -453,28 +438,22 @@ int efx_mcdi_mon_probe(struct efx_nic *efx) | |||
453 | if (min1 != max1) { | 438 | if (min1 != max1) { |
454 | snprintf(name, sizeof(name), "%s%u_input", | 439 | snprintf(name, sizeof(name), "%s%u_input", |
455 | hwmon_prefix, hwmon_index); | 440 | hwmon_prefix, hwmon_index); |
456 | rc = efx_mcdi_mon_add_attr( | 441 | efx_mcdi_mon_add_attr( |
457 | efx, name, efx_mcdi_mon_show_value, i, type, 0); | 442 | efx, name, efx_mcdi_mon_show_value, i, type, 0); |
458 | if (rc) | ||
459 | goto fail; | ||
460 | 443 | ||
461 | if (hwmon_type != EFX_HWMON_POWER) { | 444 | if (hwmon_type != EFX_HWMON_POWER) { |
462 | snprintf(name, sizeof(name), "%s%u_min", | 445 | snprintf(name, sizeof(name), "%s%u_min", |
463 | hwmon_prefix, hwmon_index); | 446 | hwmon_prefix, hwmon_index); |
464 | rc = efx_mcdi_mon_add_attr( | 447 | efx_mcdi_mon_add_attr( |
465 | efx, name, efx_mcdi_mon_show_limit, | 448 | efx, name, efx_mcdi_mon_show_limit, |
466 | i, type, min1); | 449 | i, type, min1); |
467 | if (rc) | ||
468 | goto fail; | ||
469 | } | 450 | } |
470 | 451 | ||
471 | snprintf(name, sizeof(name), "%s%u_max", | 452 | snprintf(name, sizeof(name), "%s%u_max", |
472 | hwmon_prefix, hwmon_index); | 453 | hwmon_prefix, hwmon_index); |
473 | rc = efx_mcdi_mon_add_attr( | 454 | efx_mcdi_mon_add_attr( |
474 | efx, name, efx_mcdi_mon_show_limit, | 455 | efx, name, efx_mcdi_mon_show_limit, |
475 | i, type, max1); | 456 | i, type, max1); |
476 | if (rc) | ||
477 | goto fail; | ||
478 | 457 | ||
479 | if (min2 != max2) { | 458 | if (min2 != max2) { |
480 | /* Assume max2 is critical value. | 459 | /* Assume max2 is critical value. |
@@ -482,32 +461,38 @@ int efx_mcdi_mon_probe(struct efx_nic *efx) | |||
482 | */ | 461 | */ |
483 | snprintf(name, sizeof(name), "%s%u_crit", | 462 | snprintf(name, sizeof(name), "%s%u_crit", |
484 | hwmon_prefix, hwmon_index); | 463 | hwmon_prefix, hwmon_index); |
485 | rc = efx_mcdi_mon_add_attr( | 464 | efx_mcdi_mon_add_attr( |
486 | efx, name, efx_mcdi_mon_show_limit, | 465 | efx, name, efx_mcdi_mon_show_limit, |
487 | i, type, max2); | 466 | i, type, max2); |
488 | if (rc) | ||
489 | goto fail; | ||
490 | } | 467 | } |
491 | } | 468 | } |
492 | 469 | ||
493 | snprintf(name, sizeof(name), "%s%u_alarm", | 470 | snprintf(name, sizeof(name), "%s%u_alarm", |
494 | hwmon_prefix, hwmon_index); | 471 | hwmon_prefix, hwmon_index); |
495 | rc = efx_mcdi_mon_add_attr( | 472 | efx_mcdi_mon_add_attr( |
496 | efx, name, efx_mcdi_mon_show_alarm, i, type, 0); | 473 | efx, name, efx_mcdi_mon_show_alarm, i, type, 0); |
497 | if (rc) | ||
498 | goto fail; | ||
499 | 474 | ||
500 | if (type < ARRAY_SIZE(efx_mcdi_sensor_type) && | 475 | if (type < ARRAY_SIZE(efx_mcdi_sensor_type) && |
501 | efx_mcdi_sensor_type[type].label) { | 476 | efx_mcdi_sensor_type[type].label) { |
502 | snprintf(name, sizeof(name), "%s%u_label", | 477 | snprintf(name, sizeof(name), "%s%u_label", |
503 | hwmon_prefix, hwmon_index); | 478 | hwmon_prefix, hwmon_index); |
504 | rc = efx_mcdi_mon_add_attr( | 479 | efx_mcdi_mon_add_attr( |
505 | efx, name, efx_mcdi_mon_show_label, i, type, 0); | 480 | efx, name, efx_mcdi_mon_show_label, i, type, 0); |
506 | if (rc) | ||
507 | goto fail; | ||
508 | } | 481 | } |
509 | } | 482 | } |
510 | 483 | ||
484 | hwmon_register: | ||
485 | hwmon->groups[0] = &hwmon->group; | ||
486 | hwmon->device = hwmon_device_register_with_groups(&efx->pci_dev->dev, | ||
487 | KBUILD_MODNAME, NULL, | ||
488 | hwmon->groups); | ||
489 | if (IS_ERR(hwmon->device)) { | ||
490 | rc = PTR_ERR(hwmon->device); | ||
491 | goto fail; | ||
492 | } | ||
493 | |||
494 | return 0; | ||
495 | |||
511 | fail: | 496 | fail: |
512 | efx_mcdi_mon_remove(efx); | 497 | efx_mcdi_mon_remove(efx); |
513 | return rc; | 498 | return rc; |
@@ -516,14 +501,11 @@ fail: | |||
516 | void efx_mcdi_mon_remove(struct efx_nic *efx) | 501 | void efx_mcdi_mon_remove(struct efx_nic *efx) |
517 | { | 502 | { |
518 | struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); | 503 | struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); |
519 | unsigned int i; | ||
520 | 504 | ||
521 | for (i = 0; i < hwmon->n_attrs; i++) | ||
522 | device_remove_file(&efx->pci_dev->dev, | ||
523 | &hwmon->attrs[i].dev_attr); | ||
524 | kfree(hwmon->attrs); | ||
525 | if (hwmon->device) | 505 | if (hwmon->device) |
526 | hwmon_device_unregister(hwmon->device); | 506 | hwmon_device_unregister(hwmon->device); |
507 | kfree(hwmon->attrs); | ||
508 | kfree(hwmon->group.attrs); | ||
527 | efx_nic_free_buffer(efx, &hwmon->dma_buf); | 509 | efx_nic_free_buffer(efx, &hwmon->dma_buf); |
528 | } | 510 | } |
529 | 511 | ||
diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h index c9d4c872e81d..749654b976bc 100644 --- a/drivers/net/ethernet/smsc/smc91x.h +++ b/drivers/net/ethernet/smsc/smc91x.h | |||
@@ -46,7 +46,8 @@ | |||
46 | defined(CONFIG_MACH_LITTLETON) ||\ | 46 | defined(CONFIG_MACH_LITTLETON) ||\ |
47 | defined(CONFIG_MACH_ZYLONITE2) ||\ | 47 | defined(CONFIG_MACH_ZYLONITE2) ||\ |
48 | defined(CONFIG_ARCH_VIPER) ||\ | 48 | defined(CONFIG_ARCH_VIPER) ||\ |
49 | defined(CONFIG_MACH_STARGATE2) | 49 | defined(CONFIG_MACH_STARGATE2) ||\ |
50 | defined(CONFIG_ARCH_VERSATILE) | ||
50 | 51 | ||
51 | #include <asm/mach-types.h> | 52 | #include <asm/mach-types.h> |
52 | 53 | ||
@@ -154,6 +155,8 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg) | |||
154 | #define SMC_outl(v, a, r) writel(v, (a) + (r)) | 155 | #define SMC_outl(v, a, r) writel(v, (a) + (r)) |
155 | #define SMC_insl(a, r, p, l) readsl((a) + (r), p, l) | 156 | #define SMC_insl(a, r, p, l) readsl((a) + (r), p, l) |
156 | #define SMC_outsl(a, r, p, l) writesl((a) + (r), p, l) | 157 | #define SMC_outsl(a, r, p, l) writesl((a) + (r), p, l) |
158 | #define SMC_insw(a, r, p, l) readsw((a) + (r), p, l) | ||
159 | #define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l) | ||
157 | #define SMC_IRQ_FLAGS (-1) /* from resource */ | 160 | #define SMC_IRQ_FLAGS (-1) /* from resource */ |
158 | 161 | ||
159 | /* We actually can't write halfwords properly if not word aligned */ | 162 | /* We actually can't write halfwords properly if not word aligned */ |
@@ -206,23 +209,6 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) | |||
206 | #define RPC_LSA_DEFAULT RPC_LED_TX_RX | 209 | #define RPC_LSA_DEFAULT RPC_LED_TX_RX |
207 | #define RPC_LSB_DEFAULT RPC_LED_100_10 | 210 | #define RPC_LSB_DEFAULT RPC_LED_100_10 |
208 | 211 | ||
209 | #elif defined(CONFIG_ARCH_VERSATILE) | ||
210 | |||
211 | #define SMC_CAN_USE_8BIT 1 | ||
212 | #define SMC_CAN_USE_16BIT 1 | ||
213 | #define SMC_CAN_USE_32BIT 1 | ||
214 | #define SMC_NOWAIT 1 | ||
215 | |||
216 | #define SMC_inb(a, r) readb((a) + (r)) | ||
217 | #define SMC_inw(a, r) readw((a) + (r)) | ||
218 | #define SMC_inl(a, r) readl((a) + (r)) | ||
219 | #define SMC_outb(v, a, r) writeb(v, (a) + (r)) | ||
220 | #define SMC_outw(v, a, r) writew(v, (a) + (r)) | ||
221 | #define SMC_outl(v, a, r) writel(v, (a) + (r)) | ||
222 | #define SMC_insl(a, r, p, l) readsl((a) + (r), p, l) | ||
223 | #define SMC_outsl(a, r, p, l) writesl((a) + (r), p, l) | ||
224 | #define SMC_IRQ_FLAGS (-1) /* from resource */ | ||
225 | |||
226 | #elif defined(CONFIG_MN10300) | 212 | #elif defined(CONFIG_MN10300) |
227 | 213 | ||
228 | /* | 214 | /* |
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c index d022bf936572..ad61d26a44f3 100644 --- a/drivers/net/ethernet/via/via-velocity.c +++ b/drivers/net/ethernet/via/via-velocity.c | |||
@@ -2172,16 +2172,13 @@ static int velocity_poll(struct napi_struct *napi, int budget) | |||
2172 | unsigned int rx_done; | 2172 | unsigned int rx_done; |
2173 | unsigned long flags; | 2173 | unsigned long flags; |
2174 | 2174 | ||
2175 | spin_lock_irqsave(&vptr->lock, flags); | ||
2176 | /* | 2175 | /* |
2177 | * Do rx and tx twice for performance (taken from the VIA | 2176 | * Do rx and tx twice for performance (taken from the VIA |
2178 | * out-of-tree driver). | 2177 | * out-of-tree driver). |
2179 | */ | 2178 | */ |
2180 | rx_done = velocity_rx_srv(vptr, budget / 2); | 2179 | rx_done = velocity_rx_srv(vptr, budget); |
2181 | velocity_tx_srv(vptr); | 2180 | spin_lock_irqsave(&vptr->lock, flags); |
2182 | rx_done += velocity_rx_srv(vptr, budget - rx_done); | ||
2183 | velocity_tx_srv(vptr); | 2181 | velocity_tx_srv(vptr); |
2184 | |||
2185 | /* If budget not fully consumed, exit the polling mode */ | 2182 | /* If budget not fully consumed, exit the polling mode */ |
2186 | if (rx_done < budget) { | 2183 | if (rx_done < budget) { |
2187 | napi_complete(napi); | 2184 | napi_complete(napi); |
@@ -2342,6 +2339,8 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu) | |||
2342 | if (ret < 0) | 2339 | if (ret < 0) |
2343 | goto out_free_tmp_vptr_1; | 2340 | goto out_free_tmp_vptr_1; |
2344 | 2341 | ||
2342 | napi_disable(&vptr->napi); | ||
2343 | |||
2345 | spin_lock_irqsave(&vptr->lock, flags); | 2344 | spin_lock_irqsave(&vptr->lock, flags); |
2346 | 2345 | ||
2347 | netif_stop_queue(dev); | 2346 | netif_stop_queue(dev); |
@@ -2362,6 +2361,8 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu) | |||
2362 | 2361 | ||
2363 | velocity_give_many_rx_descs(vptr); | 2362 | velocity_give_many_rx_descs(vptr); |
2364 | 2363 | ||
2364 | napi_enable(&vptr->napi); | ||
2365 | |||
2365 | mac_enable_int(vptr->mac_regs); | 2366 | mac_enable_int(vptr->mac_regs); |
2366 | netif_start_queue(dev); | 2367 | netif_start_queue(dev); |
2367 | 2368 | ||
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index dc76670c2f2a..9093004f9b63 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -744,7 +744,7 @@ err: | |||
744 | rcu_read_lock(); | 744 | rcu_read_lock(); |
745 | vlan = rcu_dereference(q->vlan); | 745 | vlan = rcu_dereference(q->vlan); |
746 | if (vlan) | 746 | if (vlan) |
747 | vlan->dev->stats.tx_dropped++; | 747 | this_cpu_inc(vlan->pcpu_stats->tx_dropped); |
748 | rcu_read_unlock(); | 748 | rcu_read_unlock(); |
749 | 749 | ||
750 | return err; | 750 | return err; |
@@ -767,7 +767,6 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q, | |||
767 | const struct sk_buff *skb, | 767 | const struct sk_buff *skb, |
768 | const struct iovec *iv, int len) | 768 | const struct iovec *iv, int len) |
769 | { | 769 | { |
770 | struct macvlan_dev *vlan; | ||
771 | int ret; | 770 | int ret; |
772 | int vnet_hdr_len = 0; | 771 | int vnet_hdr_len = 0; |
773 | int vlan_offset = 0; | 772 | int vlan_offset = 0; |
@@ -821,15 +820,6 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q, | |||
821 | copied += len; | 820 | copied += len; |
822 | 821 | ||
823 | done: | 822 | done: |
824 | rcu_read_lock(); | ||
825 | vlan = rcu_dereference(q->vlan); | ||
826 | if (vlan) { | ||
827 | preempt_disable(); | ||
828 | macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0); | ||
829 | preempt_enable(); | ||
830 | } | ||
831 | rcu_read_unlock(); | ||
832 | |||
833 | return ret ? ret : copied; | 823 | return ret ? ret : copied; |
834 | } | 824 | } |
835 | 825 | ||
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c index 508e4359338b..14372c65a7e8 100644 --- a/drivers/net/phy/vitesse.c +++ b/drivers/net/phy/vitesse.c | |||
@@ -64,6 +64,7 @@ | |||
64 | 64 | ||
65 | #define PHY_ID_VSC8234 0x000fc620 | 65 | #define PHY_ID_VSC8234 0x000fc620 |
66 | #define PHY_ID_VSC8244 0x000fc6c0 | 66 | #define PHY_ID_VSC8244 0x000fc6c0 |
67 | #define PHY_ID_VSC8514 0x00070670 | ||
67 | #define PHY_ID_VSC8574 0x000704a0 | 68 | #define PHY_ID_VSC8574 0x000704a0 |
68 | #define PHY_ID_VSC8662 0x00070660 | 69 | #define PHY_ID_VSC8662 0x00070660 |
69 | #define PHY_ID_VSC8221 0x000fc550 | 70 | #define PHY_ID_VSC8221 0x000fc550 |
@@ -131,6 +132,7 @@ static int vsc82xx_config_intr(struct phy_device *phydev) | |||
131 | err = phy_write(phydev, MII_VSC8244_IMASK, | 132 | err = phy_write(phydev, MII_VSC8244_IMASK, |
132 | (phydev->drv->phy_id == PHY_ID_VSC8234 || | 133 | (phydev->drv->phy_id == PHY_ID_VSC8234 || |
133 | phydev->drv->phy_id == PHY_ID_VSC8244 || | 134 | phydev->drv->phy_id == PHY_ID_VSC8244 || |
135 | phydev->drv->phy_id == PHY_ID_VSC8514 || | ||
134 | phydev->drv->phy_id == PHY_ID_VSC8574) ? | 136 | phydev->drv->phy_id == PHY_ID_VSC8574) ? |
135 | MII_VSC8244_IMASK_MASK : | 137 | MII_VSC8244_IMASK_MASK : |
136 | MII_VSC8221_IMASK_MASK); | 138 | MII_VSC8221_IMASK_MASK); |
@@ -246,6 +248,18 @@ static struct phy_driver vsc82xx_driver[] = { | |||
246 | .config_intr = &vsc82xx_config_intr, | 248 | .config_intr = &vsc82xx_config_intr, |
247 | .driver = { .owner = THIS_MODULE,}, | 249 | .driver = { .owner = THIS_MODULE,}, |
248 | }, { | 250 | }, { |
251 | .phy_id = PHY_ID_VSC8514, | ||
252 | .name = "Vitesse VSC8514", | ||
253 | .phy_id_mask = 0x000ffff0, | ||
254 | .features = PHY_GBIT_FEATURES, | ||
255 | .flags = PHY_HAS_INTERRUPT, | ||
256 | .config_init = &vsc824x_config_init, | ||
257 | .config_aneg = &vsc82x4_config_aneg, | ||
258 | .read_status = &genphy_read_status, | ||
259 | .ack_interrupt = &vsc824x_ack_interrupt, | ||
260 | .config_intr = &vsc82xx_config_intr, | ||
261 | .driver = { .owner = THIS_MODULE,}, | ||
262 | }, { | ||
249 | .phy_id = PHY_ID_VSC8574, | 263 | .phy_id = PHY_ID_VSC8574, |
250 | .name = "Vitesse VSC8574", | 264 | .name = "Vitesse VSC8574", |
251 | .phy_id_mask = 0x000ffff0, | 265 | .phy_id_mask = 0x000ffff0, |
@@ -315,6 +329,7 @@ module_exit(vsc82xx_exit); | |||
315 | static struct mdio_device_id __maybe_unused vitesse_tbl[] = { | 329 | static struct mdio_device_id __maybe_unused vitesse_tbl[] = { |
316 | { PHY_ID_VSC8234, 0x000ffff0 }, | 330 | { PHY_ID_VSC8234, 0x000ffff0 }, |
317 | { PHY_ID_VSC8244, 0x000fffc0 }, | 331 | { PHY_ID_VSC8244, 0x000fffc0 }, |
332 | { PHY_ID_VSC8514, 0x000ffff0 }, | ||
318 | { PHY_ID_VSC8574, 0x000ffff0 }, | 333 | { PHY_ID_VSC8574, 0x000ffff0 }, |
319 | { PHY_ID_VSC8662, 0x000ffff0 }, | 334 | { PHY_ID_VSC8662, 0x000ffff0 }, |
320 | { PHY_ID_VSC8221, 0x000ffff0 }, | 335 | { PHY_ID_VSC8221, 0x000ffff0 }, |
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 34b0de09d881..736050d6b451 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -1366,6 +1366,8 @@ static int team_user_linkup_option_get(struct team *team, | |||
1366 | return 0; | 1366 | return 0; |
1367 | } | 1367 | } |
1368 | 1368 | ||
1369 | static void __team_carrier_check(struct team *team); | ||
1370 | |||
1369 | static int team_user_linkup_option_set(struct team *team, | 1371 | static int team_user_linkup_option_set(struct team *team, |
1370 | struct team_gsetter_ctx *ctx) | 1372 | struct team_gsetter_ctx *ctx) |
1371 | { | 1373 | { |
@@ -1373,6 +1375,7 @@ static int team_user_linkup_option_set(struct team *team, | |||
1373 | 1375 | ||
1374 | port->user.linkup = ctx->data.bool_val; | 1376 | port->user.linkup = ctx->data.bool_val; |
1375 | team_refresh_port_linkup(port); | 1377 | team_refresh_port_linkup(port); |
1378 | __team_carrier_check(port->team); | ||
1376 | return 0; | 1379 | return 0; |
1377 | } | 1380 | } |
1378 | 1381 | ||
@@ -1392,6 +1395,7 @@ static int team_user_linkup_en_option_set(struct team *team, | |||
1392 | 1395 | ||
1393 | port->user.linkup_enabled = ctx->data.bool_val; | 1396 | port->user.linkup_enabled = ctx->data.bool_val; |
1394 | team_refresh_port_linkup(port); | 1397 | team_refresh_port_linkup(port); |
1398 | __team_carrier_check(port->team); | ||
1395 | return 0; | 1399 | return 0; |
1396 | } | 1400 | } |
1397 | 1401 | ||
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7bab4de658a9..916241d16c67 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -299,35 +299,76 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq, | |||
299 | return skb; | 299 | return skb; |
300 | } | 300 | } |
301 | 301 | ||
302 | static int receive_mergeable(struct receive_queue *rq, struct sk_buff *head_skb) | 302 | static struct sk_buff *receive_small(void *buf, unsigned int len) |
303 | { | 303 | { |
304 | struct skb_vnet_hdr *hdr = skb_vnet_hdr(head_skb); | 304 | struct sk_buff * skb = buf; |
305 | |||
306 | len -= sizeof(struct virtio_net_hdr); | ||
307 | skb_trim(skb, len); | ||
308 | |||
309 | return skb; | ||
310 | } | ||
311 | |||
312 | static struct sk_buff *receive_big(struct net_device *dev, | ||
313 | struct receive_queue *rq, | ||
314 | void *buf, | ||
315 | unsigned int len) | ||
316 | { | ||
317 | struct page *page = buf; | ||
318 | struct sk_buff *skb = page_to_skb(rq, page, 0, len, PAGE_SIZE); | ||
319 | |||
320 | if (unlikely(!skb)) | ||
321 | goto err; | ||
322 | |||
323 | return skb; | ||
324 | |||
325 | err: | ||
326 | dev->stats.rx_dropped++; | ||
327 | give_pages(rq, page); | ||
328 | return NULL; | ||
329 | } | ||
330 | |||
331 | static struct sk_buff *receive_mergeable(struct net_device *dev, | ||
332 | struct receive_queue *rq, | ||
333 | void *buf, | ||
334 | unsigned int len) | ||
335 | { | ||
336 | struct skb_vnet_hdr *hdr = buf; | ||
337 | int num_buf = hdr->mhdr.num_buffers; | ||
338 | struct page *page = virt_to_head_page(buf); | ||
339 | int offset = buf - page_address(page); | ||
340 | struct sk_buff *head_skb = page_to_skb(rq, page, offset, len, | ||
341 | MERGE_BUFFER_LEN); | ||
305 | struct sk_buff *curr_skb = head_skb; | 342 | struct sk_buff *curr_skb = head_skb; |
306 | char *buf; | ||
307 | struct page *page; | ||
308 | int num_buf, len, offset; | ||
309 | 343 | ||
310 | num_buf = hdr->mhdr.num_buffers; | 344 | if (unlikely(!curr_skb)) |
345 | goto err_skb; | ||
346 | |||
311 | while (--num_buf) { | 347 | while (--num_buf) { |
312 | int num_skb_frags = skb_shinfo(curr_skb)->nr_frags; | 348 | int num_skb_frags; |
349 | |||
313 | buf = virtqueue_get_buf(rq->vq, &len); | 350 | buf = virtqueue_get_buf(rq->vq, &len); |
314 | if (unlikely(!buf)) { | 351 | if (unlikely(!buf)) { |
315 | pr_debug("%s: rx error: %d buffers missing\n", | 352 | pr_debug("%s: rx error: %d buffers out of %d missing\n", |
316 | head_skb->dev->name, hdr->mhdr.num_buffers); | 353 | dev->name, num_buf, hdr->mhdr.num_buffers); |
317 | head_skb->dev->stats.rx_length_errors++; | 354 | dev->stats.rx_length_errors++; |
318 | return -EINVAL; | 355 | goto err_buf; |
319 | } | 356 | } |
320 | if (unlikely(len > MERGE_BUFFER_LEN)) { | 357 | if (unlikely(len > MERGE_BUFFER_LEN)) { |
321 | pr_debug("%s: rx error: merge buffer too long\n", | 358 | pr_debug("%s: rx error: merge buffer too long\n", |
322 | head_skb->dev->name); | 359 | dev->name); |
323 | len = MERGE_BUFFER_LEN; | 360 | len = MERGE_BUFFER_LEN; |
324 | } | 361 | } |
362 | |||
363 | page = virt_to_head_page(buf); | ||
364 | --rq->num; | ||
365 | |||
366 | num_skb_frags = skb_shinfo(curr_skb)->nr_frags; | ||
325 | if (unlikely(num_skb_frags == MAX_SKB_FRAGS)) { | 367 | if (unlikely(num_skb_frags == MAX_SKB_FRAGS)) { |
326 | struct sk_buff *nskb = alloc_skb(0, GFP_ATOMIC); | 368 | struct sk_buff *nskb = alloc_skb(0, GFP_ATOMIC); |
327 | if (unlikely(!nskb)) { | 369 | |
328 | head_skb->dev->stats.rx_dropped++; | 370 | if (unlikely(!nskb)) |
329 | return -ENOMEM; | 371 | goto err_skb; |
330 | } | ||
331 | if (curr_skb == head_skb) | 372 | if (curr_skb == head_skb) |
332 | skb_shinfo(curr_skb)->frag_list = nskb; | 373 | skb_shinfo(curr_skb)->frag_list = nskb; |
333 | else | 374 | else |
@@ -341,8 +382,7 @@ static int receive_mergeable(struct receive_queue *rq, struct sk_buff *head_skb) | |||
341 | head_skb->len += len; | 382 | head_skb->len += len; |
342 | head_skb->truesize += MERGE_BUFFER_LEN; | 383 | head_skb->truesize += MERGE_BUFFER_LEN; |
343 | } | 384 | } |
344 | page = virt_to_head_page(buf); | 385 | offset = buf - page_address(page); |
345 | offset = buf - (char *)page_address(page); | ||
346 | if (skb_can_coalesce(curr_skb, num_skb_frags, page, offset)) { | 386 | if (skb_can_coalesce(curr_skb, num_skb_frags, page, offset)) { |
347 | put_page(page); | 387 | put_page(page); |
348 | skb_coalesce_rx_frag(curr_skb, num_skb_frags - 1, | 388 | skb_coalesce_rx_frag(curr_skb, num_skb_frags - 1, |
@@ -351,9 +391,28 @@ static int receive_mergeable(struct receive_queue *rq, struct sk_buff *head_skb) | |||
351 | skb_add_rx_frag(curr_skb, num_skb_frags, page, | 391 | skb_add_rx_frag(curr_skb, num_skb_frags, page, |
352 | offset, len, MERGE_BUFFER_LEN); | 392 | offset, len, MERGE_BUFFER_LEN); |
353 | } | 393 | } |
394 | } | ||
395 | |||
396 | return head_skb; | ||
397 | |||
398 | err_skb: | ||
399 | put_page(page); | ||
400 | while (--num_buf) { | ||
401 | buf = virtqueue_get_buf(rq->vq, &len); | ||
402 | if (unlikely(!buf)) { | ||
403 | pr_debug("%s: rx error: %d buffers missing\n", | ||
404 | dev->name, num_buf); | ||
405 | dev->stats.rx_length_errors++; | ||
406 | break; | ||
407 | } | ||
408 | page = virt_to_head_page(buf); | ||
409 | put_page(page); | ||
354 | --rq->num; | 410 | --rq->num; |
355 | } | 411 | } |
356 | return 0; | 412 | err_buf: |
413 | dev->stats.rx_dropped++; | ||
414 | dev_kfree_skb(head_skb); | ||
415 | return NULL; | ||
357 | } | 416 | } |
358 | 417 | ||
359 | static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len) | 418 | static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len) |
@@ -362,7 +421,6 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len) | |||
362 | struct net_device *dev = vi->dev; | 421 | struct net_device *dev = vi->dev; |
363 | struct virtnet_stats *stats = this_cpu_ptr(vi->stats); | 422 | struct virtnet_stats *stats = this_cpu_ptr(vi->stats); |
364 | struct sk_buff *skb; | 423 | struct sk_buff *skb; |
365 | struct page *page; | ||
366 | struct skb_vnet_hdr *hdr; | 424 | struct skb_vnet_hdr *hdr; |
367 | 425 | ||
368 | if (unlikely(len < sizeof(struct virtio_net_hdr) + ETH_HLEN)) { | 426 | if (unlikely(len < sizeof(struct virtio_net_hdr) + ETH_HLEN)) { |
@@ -377,33 +435,15 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len) | |||
377 | return; | 435 | return; |
378 | } | 436 | } |
379 | 437 | ||
380 | if (!vi->mergeable_rx_bufs && !vi->big_packets) { | 438 | if (vi->mergeable_rx_bufs) |
381 | skb = buf; | 439 | skb = receive_mergeable(dev, rq, buf, len); |
382 | len -= sizeof(struct virtio_net_hdr); | 440 | else if (vi->big_packets) |
383 | skb_trim(skb, len); | 441 | skb = receive_big(dev, rq, buf, len); |
384 | } else if (vi->mergeable_rx_bufs) { | 442 | else |
385 | struct page *page = virt_to_head_page(buf); | 443 | skb = receive_small(buf, len); |
386 | skb = page_to_skb(rq, page, | 444 | |
387 | (char *)buf - (char *)page_address(page), | 445 | if (unlikely(!skb)) |
388 | len, MERGE_BUFFER_LEN); | 446 | return; |
389 | if (unlikely(!skb)) { | ||
390 | dev->stats.rx_dropped++; | ||
391 | put_page(page); | ||
392 | return; | ||
393 | } | ||
394 | if (receive_mergeable(rq, skb)) { | ||
395 | dev_kfree_skb(skb); | ||
396 | return; | ||
397 | } | ||
398 | } else { | ||
399 | page = buf; | ||
400 | skb = page_to_skb(rq, page, 0, len, PAGE_SIZE); | ||
401 | if (unlikely(!skb)) { | ||
402 | dev->stats.rx_dropped++; | ||
403 | give_pages(rq, page); | ||
404 | return; | ||
405 | } | ||
406 | } | ||
407 | 447 | ||
408 | hdr = skb_vnet_hdr(skb); | 448 | hdr = skb_vnet_hdr(skb); |
409 | 449 | ||
@@ -1084,7 +1124,7 @@ static void virtnet_set_rx_mode(struct net_device *dev) | |||
1084 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_MAC, | 1124 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_MAC, |
1085 | VIRTIO_NET_CTRL_MAC_TABLE_SET, | 1125 | VIRTIO_NET_CTRL_MAC_TABLE_SET, |
1086 | sg, NULL)) | 1126 | sg, NULL)) |
1087 | dev_warn(&dev->dev, "Failed to set MAC fitler table.\n"); | 1127 | dev_warn(&dev->dev, "Failed to set MAC filter table.\n"); |
1088 | 1128 | ||
1089 | kfree(buf); | 1129 | kfree(buf); |
1090 | } | 1130 | } |
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 919b6509455c..64f0e0d18b81 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/udp.h> | 39 | #include <linux/udp.h> |
40 | 40 | ||
41 | #include <net/tcp.h> | 41 | #include <net/tcp.h> |
42 | #include <net/ip6_checksum.h> | ||
42 | 43 | ||
43 | #include <xen/xen.h> | 44 | #include <xen/xen.h> |
44 | #include <xen/events.h> | 45 | #include <xen/events.h> |
diff --git a/drivers/ntb/ntb_hw.c b/drivers/ntb/ntb_hw.c index 1cb6e51e6bda..170e8e60cdb7 100644 --- a/drivers/ntb/ntb_hw.c +++ b/drivers/ntb/ntb_hw.c | |||
@@ -141,6 +141,24 @@ void ntb_unregister_event_callback(struct ntb_device *ndev) | |||
141 | ndev->event_cb = NULL; | 141 | ndev->event_cb = NULL; |
142 | } | 142 | } |
143 | 143 | ||
144 | static void ntb_irq_work(unsigned long data) | ||
145 | { | ||
146 | struct ntb_db_cb *db_cb = (struct ntb_db_cb *)data; | ||
147 | int rc; | ||
148 | |||
149 | rc = db_cb->callback(db_cb->data, db_cb->db_num); | ||
150 | if (rc) | ||
151 | tasklet_schedule(&db_cb->irq_work); | ||
152 | else { | ||
153 | struct ntb_device *ndev = db_cb->ndev; | ||
154 | unsigned long mask; | ||
155 | |||
156 | mask = readw(ndev->reg_ofs.ldb_mask); | ||
157 | clear_bit(db_cb->db_num * ndev->bits_per_vector, &mask); | ||
158 | writew(mask, ndev->reg_ofs.ldb_mask); | ||
159 | } | ||
160 | } | ||
161 | |||
144 | /** | 162 | /** |
145 | * ntb_register_db_callback() - register a callback for doorbell interrupt | 163 | * ntb_register_db_callback() - register a callback for doorbell interrupt |
146 | * @ndev: pointer to ntb_device instance | 164 | * @ndev: pointer to ntb_device instance |
@@ -155,7 +173,7 @@ void ntb_unregister_event_callback(struct ntb_device *ndev) | |||
155 | * RETURNS: An appropriate -ERRNO error value on error, or zero for success. | 173 | * RETURNS: An appropriate -ERRNO error value on error, or zero for success. |
156 | */ | 174 | */ |
157 | int ntb_register_db_callback(struct ntb_device *ndev, unsigned int idx, | 175 | int ntb_register_db_callback(struct ntb_device *ndev, unsigned int idx, |
158 | void *data, void (*func)(void *data, int db_num)) | 176 | void *data, int (*func)(void *data, int db_num)) |
159 | { | 177 | { |
160 | unsigned long mask; | 178 | unsigned long mask; |
161 | 179 | ||
@@ -166,6 +184,10 @@ int ntb_register_db_callback(struct ntb_device *ndev, unsigned int idx, | |||
166 | 184 | ||
167 | ndev->db_cb[idx].callback = func; | 185 | ndev->db_cb[idx].callback = func; |
168 | ndev->db_cb[idx].data = data; | 186 | ndev->db_cb[idx].data = data; |
187 | ndev->db_cb[idx].ndev = ndev; | ||
188 | |||
189 | tasklet_init(&ndev->db_cb[idx].irq_work, ntb_irq_work, | ||
190 | (unsigned long) &ndev->db_cb[idx]); | ||
169 | 191 | ||
170 | /* unmask interrupt */ | 192 | /* unmask interrupt */ |
171 | mask = readw(ndev->reg_ofs.ldb_mask); | 193 | mask = readw(ndev->reg_ofs.ldb_mask); |
@@ -194,6 +216,8 @@ void ntb_unregister_db_callback(struct ntb_device *ndev, unsigned int idx) | |||
194 | set_bit(idx * ndev->bits_per_vector, &mask); | 216 | set_bit(idx * ndev->bits_per_vector, &mask); |
195 | writew(mask, ndev->reg_ofs.ldb_mask); | 217 | writew(mask, ndev->reg_ofs.ldb_mask); |
196 | 218 | ||
219 | tasklet_disable(&ndev->db_cb[idx].irq_work); | ||
220 | |||
197 | ndev->db_cb[idx].callback = NULL; | 221 | ndev->db_cb[idx].callback = NULL; |
198 | } | 222 | } |
199 | 223 | ||
@@ -678,6 +702,7 @@ static int ntb_xeon_setup(struct ntb_device *ndev) | |||
678 | return -EINVAL; | 702 | return -EINVAL; |
679 | 703 | ||
680 | ndev->limits.max_mw = SNB_ERRATA_MAX_MW; | 704 | ndev->limits.max_mw = SNB_ERRATA_MAX_MW; |
705 | ndev->limits.max_db_bits = SNB_MAX_DB_BITS; | ||
681 | ndev->reg_ofs.spad_write = ndev->mw[1].vbase + | 706 | ndev->reg_ofs.spad_write = ndev->mw[1].vbase + |
682 | SNB_SPAD_OFFSET; | 707 | SNB_SPAD_OFFSET; |
683 | ndev->reg_ofs.rdb = ndev->mw[1].vbase + | 708 | ndev->reg_ofs.rdb = ndev->mw[1].vbase + |
@@ -688,8 +713,21 @@ static int ntb_xeon_setup(struct ntb_device *ndev) | |||
688 | */ | 713 | */ |
689 | writeq(ndev->mw[1].bar_sz + 0x1000, ndev->reg_base + | 714 | writeq(ndev->mw[1].bar_sz + 0x1000, ndev->reg_base + |
690 | SNB_PBAR4LMT_OFFSET); | 715 | SNB_PBAR4LMT_OFFSET); |
716 | /* HW errata on the Limit registers. They can only be | ||
717 | * written when the base register is 4GB aligned and | ||
718 | * < 32bit. This should already be the case based on the | ||
719 | * driver defaults, but write the Limit registers first | ||
720 | * just in case. | ||
721 | */ | ||
691 | } else { | 722 | } else { |
692 | ndev->limits.max_mw = SNB_MAX_MW; | 723 | ndev->limits.max_mw = SNB_MAX_MW; |
724 | |||
725 | /* HW Errata on bit 14 of b2bdoorbell register. Writes | ||
726 | * will not be mirrored to the remote system. Shrink | ||
727 | * the number of bits by one, since bit 14 is the last | ||
728 | * bit. | ||
729 | */ | ||
730 | ndev->limits.max_db_bits = SNB_MAX_DB_BITS - 1; | ||
693 | ndev->reg_ofs.spad_write = ndev->reg_base + | 731 | ndev->reg_ofs.spad_write = ndev->reg_base + |
694 | SNB_B2B_SPAD_OFFSET; | 732 | SNB_B2B_SPAD_OFFSET; |
695 | ndev->reg_ofs.rdb = ndev->reg_base + | 733 | ndev->reg_ofs.rdb = ndev->reg_base + |
@@ -699,6 +737,12 @@ static int ntb_xeon_setup(struct ntb_device *ndev) | |||
699 | * something silly | 737 | * something silly |
700 | */ | 738 | */ |
701 | writeq(0, ndev->reg_base + SNB_PBAR4LMT_OFFSET); | 739 | writeq(0, ndev->reg_base + SNB_PBAR4LMT_OFFSET); |
740 | /* HW errata on the Limit registers. They can only be | ||
741 | * written when the base register is 4GB aligned and | ||
742 | * < 32bit. This should already be the case based on the | ||
743 | * driver defaults, but write the Limit registers first | ||
744 | * just in case. | ||
745 | */ | ||
702 | } | 746 | } |
703 | 747 | ||
704 | /* The Xeon errata workaround requires setting SBAR Base | 748 | /* The Xeon errata workaround requires setting SBAR Base |
@@ -769,6 +813,7 @@ static int ntb_xeon_setup(struct ntb_device *ndev) | |||
769 | * have an equal amount. | 813 | * have an equal amount. |
770 | */ | 814 | */ |
771 | ndev->limits.max_spads = SNB_MAX_COMPAT_SPADS / 2; | 815 | ndev->limits.max_spads = SNB_MAX_COMPAT_SPADS / 2; |
816 | ndev->limits.max_db_bits = SNB_MAX_DB_BITS; | ||
772 | /* Note: The SDOORBELL is the cause of the errata. You REALLY | 817 | /* Note: The SDOORBELL is the cause of the errata. You REALLY |
773 | * don't want to touch it. | 818 | * don't want to touch it. |
774 | */ | 819 | */ |
@@ -793,6 +838,7 @@ static int ntb_xeon_setup(struct ntb_device *ndev) | |||
793 | * have an equal amount. | 838 | * have an equal amount. |
794 | */ | 839 | */ |
795 | ndev->limits.max_spads = SNB_MAX_COMPAT_SPADS / 2; | 840 | ndev->limits.max_spads = SNB_MAX_COMPAT_SPADS / 2; |
841 | ndev->limits.max_db_bits = SNB_MAX_DB_BITS; | ||
796 | ndev->reg_ofs.rdb = ndev->reg_base + SNB_PDOORBELL_OFFSET; | 842 | ndev->reg_ofs.rdb = ndev->reg_base + SNB_PDOORBELL_OFFSET; |
797 | ndev->reg_ofs.ldb = ndev->reg_base + SNB_SDOORBELL_OFFSET; | 843 | ndev->reg_ofs.ldb = ndev->reg_base + SNB_SDOORBELL_OFFSET; |
798 | ndev->reg_ofs.ldb_mask = ndev->reg_base + SNB_SDBMSK_OFFSET; | 844 | ndev->reg_ofs.ldb_mask = ndev->reg_base + SNB_SDBMSK_OFFSET; |
@@ -819,7 +865,6 @@ static int ntb_xeon_setup(struct ntb_device *ndev) | |||
819 | ndev->reg_ofs.lnk_stat = ndev->reg_base + SNB_SLINK_STATUS_OFFSET; | 865 | ndev->reg_ofs.lnk_stat = ndev->reg_base + SNB_SLINK_STATUS_OFFSET; |
820 | ndev->reg_ofs.spci_cmd = ndev->reg_base + SNB_PCICMD_OFFSET; | 866 | ndev->reg_ofs.spci_cmd = ndev->reg_base + SNB_PCICMD_OFFSET; |
821 | 867 | ||
822 | ndev->limits.max_db_bits = SNB_MAX_DB_BITS; | ||
823 | ndev->limits.msix_cnt = SNB_MSIX_CNT; | 868 | ndev->limits.msix_cnt = SNB_MSIX_CNT; |
824 | ndev->bits_per_vector = SNB_DB_BITS_PER_VEC; | 869 | ndev->bits_per_vector = SNB_DB_BITS_PER_VEC; |
825 | 870 | ||
@@ -934,12 +979,16 @@ static irqreturn_t bwd_callback_msix_irq(int irq, void *data) | |||
934 | { | 979 | { |
935 | struct ntb_db_cb *db_cb = data; | 980 | struct ntb_db_cb *db_cb = data; |
936 | struct ntb_device *ndev = db_cb->ndev; | 981 | struct ntb_device *ndev = db_cb->ndev; |
982 | unsigned long mask; | ||
937 | 983 | ||
938 | dev_dbg(&ndev->pdev->dev, "MSI-X irq %d received for DB %d\n", irq, | 984 | dev_dbg(&ndev->pdev->dev, "MSI-X irq %d received for DB %d\n", irq, |
939 | db_cb->db_num); | 985 | db_cb->db_num); |
940 | 986 | ||
941 | if (db_cb->callback) | 987 | mask = readw(ndev->reg_ofs.ldb_mask); |
942 | db_cb->callback(db_cb->data, db_cb->db_num); | 988 | set_bit(db_cb->db_num * ndev->bits_per_vector, &mask); |
989 | writew(mask, ndev->reg_ofs.ldb_mask); | ||
990 | |||
991 | tasklet_schedule(&db_cb->irq_work); | ||
943 | 992 | ||
944 | /* No need to check for the specific HB irq, any interrupt means | 993 | /* No need to check for the specific HB irq, any interrupt means |
945 | * we're connected. | 994 | * we're connected. |
@@ -955,12 +1004,16 @@ static irqreturn_t xeon_callback_msix_irq(int irq, void *data) | |||
955 | { | 1004 | { |
956 | struct ntb_db_cb *db_cb = data; | 1005 | struct ntb_db_cb *db_cb = data; |
957 | struct ntb_device *ndev = db_cb->ndev; | 1006 | struct ntb_device *ndev = db_cb->ndev; |
1007 | unsigned long mask; | ||
958 | 1008 | ||
959 | dev_dbg(&ndev->pdev->dev, "MSI-X irq %d received for DB %d\n", irq, | 1009 | dev_dbg(&ndev->pdev->dev, "MSI-X irq %d received for DB %d\n", irq, |
960 | db_cb->db_num); | 1010 | db_cb->db_num); |
961 | 1011 | ||
962 | if (db_cb->callback) | 1012 | mask = readw(ndev->reg_ofs.ldb_mask); |
963 | db_cb->callback(db_cb->data, db_cb->db_num); | 1013 | set_bit(db_cb->db_num * ndev->bits_per_vector, &mask); |
1014 | writew(mask, ndev->reg_ofs.ldb_mask); | ||
1015 | |||
1016 | tasklet_schedule(&db_cb->irq_work); | ||
964 | 1017 | ||
965 | /* On Sandybridge, there are 16 bits in the interrupt register | 1018 | /* On Sandybridge, there are 16 bits in the interrupt register |
966 | * but only 4 vectors. So, 5 bits are assigned to the first 3 | 1019 | * but only 4 vectors. So, 5 bits are assigned to the first 3 |
@@ -986,7 +1039,7 @@ static irqreturn_t xeon_event_msix_irq(int irq, void *dev) | |||
986 | dev_err(&ndev->pdev->dev, "Error determining link status\n"); | 1039 | dev_err(&ndev->pdev->dev, "Error determining link status\n"); |
987 | 1040 | ||
988 | /* bit 15 is always the link bit */ | 1041 | /* bit 15 is always the link bit */ |
989 | writew(1 << ndev->limits.max_db_bits, ndev->reg_ofs.ldb); | 1042 | writew(1 << SNB_LINK_DB, ndev->reg_ofs.ldb); |
990 | 1043 | ||
991 | return IRQ_HANDLED; | 1044 | return IRQ_HANDLED; |
992 | } | 1045 | } |
@@ -1075,6 +1128,10 @@ static int ntb_setup_msix(struct ntb_device *ndev) | |||
1075 | "Only %d MSI-X vectors. Limiting the number of queues to that number.\n", | 1128 | "Only %d MSI-X vectors. Limiting the number of queues to that number.\n", |
1076 | rc); | 1129 | rc); |
1077 | msix_entries = rc; | 1130 | msix_entries = rc; |
1131 | |||
1132 | rc = pci_enable_msix(pdev, ndev->msix_entries, msix_entries); | ||
1133 | if (rc) | ||
1134 | goto err1; | ||
1078 | } | 1135 | } |
1079 | 1136 | ||
1080 | for (i = 0; i < msix_entries; i++) { | 1137 | for (i = 0; i < msix_entries; i++) { |
@@ -1176,9 +1233,10 @@ static int ntb_setup_interrupts(struct ntb_device *ndev) | |||
1176 | */ | 1233 | */ |
1177 | if (ndev->hw_type == BWD_HW) | 1234 | if (ndev->hw_type == BWD_HW) |
1178 | writeq(~0, ndev->reg_ofs.ldb_mask); | 1235 | writeq(~0, ndev->reg_ofs.ldb_mask); |
1179 | else | 1236 | else { |
1180 | writew(~(1 << ndev->limits.max_db_bits), | 1237 | u16 var = 1 << SNB_LINK_DB; |
1181 | ndev->reg_ofs.ldb_mask); | 1238 | writew(~var, ndev->reg_ofs.ldb_mask); |
1239 | } | ||
1182 | 1240 | ||
1183 | rc = ntb_setup_msix(ndev); | 1241 | rc = ntb_setup_msix(ndev); |
1184 | if (!rc) | 1242 | if (!rc) |
@@ -1286,6 +1344,39 @@ static void ntb_free_debugfs(struct ntb_device *ndev) | |||
1286 | } | 1344 | } |
1287 | } | 1345 | } |
1288 | 1346 | ||
1347 | static void ntb_hw_link_up(struct ntb_device *ndev) | ||
1348 | { | ||
1349 | if (ndev->conn_type == NTB_CONN_TRANSPARENT) | ||
1350 | ntb_link_event(ndev, NTB_LINK_UP); | ||
1351 | else { | ||
1352 | u32 ntb_cntl; | ||
1353 | |||
1354 | /* Let's bring the NTB link up */ | ||
1355 | ntb_cntl = readl(ndev->reg_ofs.lnk_cntl); | ||
1356 | ntb_cntl &= ~(NTB_CNTL_LINK_DISABLE | NTB_CNTL_CFG_LOCK); | ||
1357 | ntb_cntl |= NTB_CNTL_P2S_BAR23_SNOOP | NTB_CNTL_S2P_BAR23_SNOOP; | ||
1358 | ntb_cntl |= NTB_CNTL_P2S_BAR45_SNOOP | NTB_CNTL_S2P_BAR45_SNOOP; | ||
1359 | writel(ntb_cntl, ndev->reg_ofs.lnk_cntl); | ||
1360 | } | ||
1361 | } | ||
1362 | |||
1363 | static void ntb_hw_link_down(struct ntb_device *ndev) | ||
1364 | { | ||
1365 | u32 ntb_cntl; | ||
1366 | |||
1367 | if (ndev->conn_type == NTB_CONN_TRANSPARENT) { | ||
1368 | ntb_link_event(ndev, NTB_LINK_DOWN); | ||
1369 | return; | ||
1370 | } | ||
1371 | |||
1372 | /* Bring NTB link down */ | ||
1373 | ntb_cntl = readl(ndev->reg_ofs.lnk_cntl); | ||
1374 | ntb_cntl &= ~(NTB_CNTL_P2S_BAR23_SNOOP | NTB_CNTL_S2P_BAR23_SNOOP); | ||
1375 | ntb_cntl &= ~(NTB_CNTL_P2S_BAR45_SNOOP | NTB_CNTL_S2P_BAR45_SNOOP); | ||
1376 | ntb_cntl |= NTB_CNTL_LINK_DISABLE | NTB_CNTL_CFG_LOCK; | ||
1377 | writel(ntb_cntl, ndev->reg_ofs.lnk_cntl); | ||
1378 | } | ||
1379 | |||
1289 | static int ntb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 1380 | static int ntb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
1290 | { | 1381 | { |
1291 | struct ntb_device *ndev; | 1382 | struct ntb_device *ndev; |
@@ -1374,9 +1465,7 @@ static int ntb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1374 | if (rc) | 1465 | if (rc) |
1375 | goto err6; | 1466 | goto err6; |
1376 | 1467 | ||
1377 | /* Let's bring the NTB link up */ | 1468 | ntb_hw_link_up(ndev); |
1378 | writel(NTB_CNTL_BAR23_SNOOP | NTB_CNTL_BAR45_SNOOP, | ||
1379 | ndev->reg_ofs.lnk_cntl); | ||
1380 | 1469 | ||
1381 | return 0; | 1470 | return 0; |
1382 | 1471 | ||
@@ -1406,12 +1495,8 @@ static void ntb_pci_remove(struct pci_dev *pdev) | |||
1406 | { | 1495 | { |
1407 | struct ntb_device *ndev = pci_get_drvdata(pdev); | 1496 | struct ntb_device *ndev = pci_get_drvdata(pdev); |
1408 | int i; | 1497 | int i; |
1409 | u32 ntb_cntl; | ||
1410 | 1498 | ||
1411 | /* Bring NTB link down */ | 1499 | ntb_hw_link_down(ndev); |
1412 | ntb_cntl = readl(ndev->reg_ofs.lnk_cntl); | ||
1413 | ntb_cntl |= NTB_CNTL_LINK_DISABLE; | ||
1414 | writel(ntb_cntl, ndev->reg_ofs.lnk_cntl); | ||
1415 | 1500 | ||
1416 | ntb_transport_free(ndev->ntb_transport); | 1501 | ntb_transport_free(ndev->ntb_transport); |
1417 | 1502 | ||
diff --git a/drivers/ntb/ntb_hw.h b/drivers/ntb/ntb_hw.h index 0a31cedae7d4..bbdb7edca10c 100644 --- a/drivers/ntb/ntb_hw.h +++ b/drivers/ntb/ntb_hw.h | |||
@@ -106,10 +106,11 @@ struct ntb_mw { | |||
106 | }; | 106 | }; |
107 | 107 | ||
108 | struct ntb_db_cb { | 108 | struct ntb_db_cb { |
109 | void (*callback) (void *data, int db_num); | 109 | int (*callback)(void *data, int db_num); |
110 | unsigned int db_num; | 110 | unsigned int db_num; |
111 | void *data; | 111 | void *data; |
112 | struct ntb_device *ndev; | 112 | struct ntb_device *ndev; |
113 | struct tasklet_struct irq_work; | ||
113 | }; | 114 | }; |
114 | 115 | ||
115 | struct ntb_device { | 116 | struct ntb_device { |
@@ -228,8 +229,8 @@ struct ntb_device *ntb_register_transport(struct pci_dev *pdev, | |||
228 | void ntb_unregister_transport(struct ntb_device *ndev); | 229 | void ntb_unregister_transport(struct ntb_device *ndev); |
229 | void ntb_set_mw_addr(struct ntb_device *ndev, unsigned int mw, u64 addr); | 230 | void ntb_set_mw_addr(struct ntb_device *ndev, unsigned int mw, u64 addr); |
230 | int ntb_register_db_callback(struct ntb_device *ndev, unsigned int idx, | 231 | int ntb_register_db_callback(struct ntb_device *ndev, unsigned int idx, |
231 | void *data, void (*db_cb_func) (void *data, | 232 | void *data, int (*db_cb_func)(void *data, |
232 | int db_num)); | 233 | int db_num)); |
233 | void ntb_unregister_db_callback(struct ntb_device *ndev, unsigned int idx); | 234 | void ntb_unregister_db_callback(struct ntb_device *ndev, unsigned int idx); |
234 | int ntb_register_event_callback(struct ntb_device *ndev, | 235 | int ntb_register_event_callback(struct ntb_device *ndev, |
235 | void (*event_cb_func) (void *handle, | 236 | void (*event_cb_func) (void *handle, |
diff --git a/drivers/ntb/ntb_regs.h b/drivers/ntb/ntb_regs.h index aa4bdd393c58..9774506419d7 100644 --- a/drivers/ntb/ntb_regs.h +++ b/drivers/ntb/ntb_regs.h | |||
@@ -55,6 +55,7 @@ | |||
55 | #define SNB_MAX_COMPAT_SPADS 16 | 55 | #define SNB_MAX_COMPAT_SPADS 16 |
56 | /* Reserve the uppermost bit for link interrupt */ | 56 | /* Reserve the uppermost bit for link interrupt */ |
57 | #define SNB_MAX_DB_BITS 15 | 57 | #define SNB_MAX_DB_BITS 15 |
58 | #define SNB_LINK_DB 15 | ||
58 | #define SNB_DB_BITS_PER_VEC 5 | 59 | #define SNB_DB_BITS_PER_VEC 5 |
59 | #define SNB_MAX_MW 2 | 60 | #define SNB_MAX_MW 2 |
60 | #define SNB_ERRATA_MAX_MW 1 | 61 | #define SNB_ERRATA_MAX_MW 1 |
@@ -75,9 +76,6 @@ | |||
75 | #define SNB_SBAR2XLAT_OFFSET 0x0030 | 76 | #define SNB_SBAR2XLAT_OFFSET 0x0030 |
76 | #define SNB_SBAR4XLAT_OFFSET 0x0038 | 77 | #define SNB_SBAR4XLAT_OFFSET 0x0038 |
77 | #define SNB_SBAR0BASE_OFFSET 0x0040 | 78 | #define SNB_SBAR0BASE_OFFSET 0x0040 |
78 | #define SNB_SBAR0BASE_OFFSET 0x0040 | ||
79 | #define SNB_SBAR2BASE_OFFSET 0x0048 | ||
80 | #define SNB_SBAR4BASE_OFFSET 0x0050 | ||
81 | #define SNB_SBAR2BASE_OFFSET 0x0048 | 79 | #define SNB_SBAR2BASE_OFFSET 0x0048 |
82 | #define SNB_SBAR4BASE_OFFSET 0x0050 | 80 | #define SNB_SBAR4BASE_OFFSET 0x0050 |
83 | #define SNB_NTBCNTL_OFFSET 0x0058 | 81 | #define SNB_NTBCNTL_OFFSET 0x0058 |
@@ -145,11 +143,13 @@ | |||
145 | #define BWD_LTSSMSTATEJMP_FORCEDETECT (1 << 2) | 143 | #define BWD_LTSSMSTATEJMP_FORCEDETECT (1 << 2) |
146 | #define BWD_IBIST_ERR_OFLOW 0x7FFF7FFF | 144 | #define BWD_IBIST_ERR_OFLOW 0x7FFF7FFF |
147 | 145 | ||
148 | #define NTB_CNTL_CFG_LOCK (1 << 0) | 146 | #define NTB_CNTL_CFG_LOCK (1 << 0) |
149 | #define NTB_CNTL_LINK_DISABLE (1 << 1) | 147 | #define NTB_CNTL_LINK_DISABLE (1 << 1) |
150 | #define NTB_CNTL_BAR23_SNOOP (1 << 2) | 148 | #define NTB_CNTL_S2P_BAR23_SNOOP (1 << 2) |
151 | #define NTB_CNTL_BAR45_SNOOP (1 << 6) | 149 | #define NTB_CNTL_P2S_BAR23_SNOOP (1 << 4) |
152 | #define BWD_CNTL_LINK_DOWN (1 << 16) | 150 | #define NTB_CNTL_S2P_BAR45_SNOOP (1 << 6) |
151 | #define NTB_CNTL_P2S_BAR45_SNOOP (1 << 8) | ||
152 | #define BWD_CNTL_LINK_DOWN (1 << 16) | ||
153 | 153 | ||
154 | #define NTB_PPD_OFFSET 0x00D4 | 154 | #define NTB_PPD_OFFSET 0x00D4 |
155 | #define SNB_PPD_CONN_TYPE 0x0003 | 155 | #define SNB_PPD_CONN_TYPE 0x0003 |
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index d0222f13d154..3217f394d45b 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c | |||
@@ -119,7 +119,6 @@ struct ntb_transport_qp { | |||
119 | 119 | ||
120 | void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, | 120 | void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, |
121 | void *data, int len); | 121 | void *data, int len); |
122 | struct tasklet_struct rx_work; | ||
123 | struct list_head rx_pend_q; | 122 | struct list_head rx_pend_q; |
124 | struct list_head rx_free_q; | 123 | struct list_head rx_free_q; |
125 | spinlock_t ntb_rx_pend_q_lock; | 124 | spinlock_t ntb_rx_pend_q_lock; |
@@ -584,11 +583,8 @@ static int ntb_set_mw(struct ntb_transport *nt, int num_mw, unsigned int size) | |||
584 | return 0; | 583 | return 0; |
585 | } | 584 | } |
586 | 585 | ||
587 | static void ntb_qp_link_cleanup(struct work_struct *work) | 586 | static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp) |
588 | { | 587 | { |
589 | struct ntb_transport_qp *qp = container_of(work, | ||
590 | struct ntb_transport_qp, | ||
591 | link_cleanup); | ||
592 | struct ntb_transport *nt = qp->transport; | 588 | struct ntb_transport *nt = qp->transport; |
593 | struct pci_dev *pdev = ntb_query_pdev(nt->ndev); | 589 | struct pci_dev *pdev = ntb_query_pdev(nt->ndev); |
594 | 590 | ||
@@ -602,6 +598,16 @@ static void ntb_qp_link_cleanup(struct work_struct *work) | |||
602 | 598 | ||
603 | dev_info(&pdev->dev, "qp %d: Link Down\n", qp->qp_num); | 599 | dev_info(&pdev->dev, "qp %d: Link Down\n", qp->qp_num); |
604 | qp->qp_link = NTB_LINK_DOWN; | 600 | qp->qp_link = NTB_LINK_DOWN; |
601 | } | ||
602 | |||
603 | static void ntb_qp_link_cleanup_work(struct work_struct *work) | ||
604 | { | ||
605 | struct ntb_transport_qp *qp = container_of(work, | ||
606 | struct ntb_transport_qp, | ||
607 | link_cleanup); | ||
608 | struct ntb_transport *nt = qp->transport; | ||
609 | |||
610 | ntb_qp_link_cleanup(qp); | ||
605 | 611 | ||
606 | if (nt->transport_link == NTB_LINK_UP) | 612 | if (nt->transport_link == NTB_LINK_UP) |
607 | schedule_delayed_work(&qp->link_work, | 613 | schedule_delayed_work(&qp->link_work, |
@@ -613,22 +619,20 @@ static void ntb_qp_link_down(struct ntb_transport_qp *qp) | |||
613 | schedule_work(&qp->link_cleanup); | 619 | schedule_work(&qp->link_cleanup); |
614 | } | 620 | } |
615 | 621 | ||
616 | static void ntb_transport_link_cleanup(struct work_struct *work) | 622 | static void ntb_transport_link_cleanup(struct ntb_transport *nt) |
617 | { | 623 | { |
618 | struct ntb_transport *nt = container_of(work, struct ntb_transport, | ||
619 | link_cleanup); | ||
620 | int i; | 624 | int i; |
621 | 625 | ||
626 | /* Pass along the info to any clients */ | ||
627 | for (i = 0; i < nt->max_qps; i++) | ||
628 | if (!test_bit(i, &nt->qp_bitmap)) | ||
629 | ntb_qp_link_cleanup(&nt->qps[i]); | ||
630 | |||
622 | if (nt->transport_link == NTB_LINK_DOWN) | 631 | if (nt->transport_link == NTB_LINK_DOWN) |
623 | cancel_delayed_work_sync(&nt->link_work); | 632 | cancel_delayed_work_sync(&nt->link_work); |
624 | else | 633 | else |
625 | nt->transport_link = NTB_LINK_DOWN; | 634 | nt->transport_link = NTB_LINK_DOWN; |
626 | 635 | ||
627 | /* Pass along the info to any clients */ | ||
628 | for (i = 0; i < nt->max_qps; i++) | ||
629 | if (!test_bit(i, &nt->qp_bitmap)) | ||
630 | ntb_qp_link_down(&nt->qps[i]); | ||
631 | |||
632 | /* The scratchpad registers keep the values if the remote side | 636 | /* The scratchpad registers keep the values if the remote side |
633 | * goes down, blast them now to give them a sane value the next | 637 | * goes down, blast them now to give them a sane value the next |
634 | * time they are accessed | 638 | * time they are accessed |
@@ -637,6 +641,14 @@ static void ntb_transport_link_cleanup(struct work_struct *work) | |||
637 | ntb_write_local_spad(nt->ndev, i, 0); | 641 | ntb_write_local_spad(nt->ndev, i, 0); |
638 | } | 642 | } |
639 | 643 | ||
644 | static void ntb_transport_link_cleanup_work(struct work_struct *work) | ||
645 | { | ||
646 | struct ntb_transport *nt = container_of(work, struct ntb_transport, | ||
647 | link_cleanup); | ||
648 | |||
649 | ntb_transport_link_cleanup(nt); | ||
650 | } | ||
651 | |||
640 | static void ntb_transport_event_callback(void *data, enum ntb_hw_event event) | 652 | static void ntb_transport_event_callback(void *data, enum ntb_hw_event event) |
641 | { | 653 | { |
642 | struct ntb_transport *nt = data; | 654 | struct ntb_transport *nt = data; |
@@ -880,7 +892,7 @@ static int ntb_transport_init_queue(struct ntb_transport *nt, | |||
880 | } | 892 | } |
881 | 893 | ||
882 | INIT_DELAYED_WORK(&qp->link_work, ntb_qp_link_work); | 894 | INIT_DELAYED_WORK(&qp->link_work, ntb_qp_link_work); |
883 | INIT_WORK(&qp->link_cleanup, ntb_qp_link_cleanup); | 895 | INIT_WORK(&qp->link_cleanup, ntb_qp_link_cleanup_work); |
884 | 896 | ||
885 | spin_lock_init(&qp->ntb_rx_pend_q_lock); | 897 | spin_lock_init(&qp->ntb_rx_pend_q_lock); |
886 | spin_lock_init(&qp->ntb_rx_free_q_lock); | 898 | spin_lock_init(&qp->ntb_rx_free_q_lock); |
@@ -936,7 +948,7 @@ int ntb_transport_init(struct pci_dev *pdev) | |||
936 | } | 948 | } |
937 | 949 | ||
938 | INIT_DELAYED_WORK(&nt->link_work, ntb_transport_link_work); | 950 | INIT_DELAYED_WORK(&nt->link_work, ntb_transport_link_work); |
939 | INIT_WORK(&nt->link_cleanup, ntb_transport_link_cleanup); | 951 | INIT_WORK(&nt->link_cleanup, ntb_transport_link_cleanup_work); |
940 | 952 | ||
941 | rc = ntb_register_event_callback(nt->ndev, | 953 | rc = ntb_register_event_callback(nt->ndev, |
942 | ntb_transport_event_callback); | 954 | ntb_transport_event_callback); |
@@ -972,7 +984,7 @@ void ntb_transport_free(void *transport) | |||
972 | struct ntb_device *ndev = nt->ndev; | 984 | struct ntb_device *ndev = nt->ndev; |
973 | int i; | 985 | int i; |
974 | 986 | ||
975 | nt->transport_link = NTB_LINK_DOWN; | 987 | ntb_transport_link_cleanup(nt); |
976 | 988 | ||
977 | /* verify that all the qp's are freed */ | 989 | /* verify that all the qp's are freed */ |
978 | for (i = 0; i < nt->max_qps; i++) { | 990 | for (i = 0; i < nt->max_qps; i++) { |
@@ -1188,11 +1200,14 @@ err: | |||
1188 | goto out; | 1200 | goto out; |
1189 | } | 1201 | } |
1190 | 1202 | ||
1191 | static void ntb_transport_rx(unsigned long data) | 1203 | static int ntb_transport_rxc_db(void *data, int db_num) |
1192 | { | 1204 | { |
1193 | struct ntb_transport_qp *qp = (struct ntb_transport_qp *)data; | 1205 | struct ntb_transport_qp *qp = data; |
1194 | int rc, i; | 1206 | int rc, i; |
1195 | 1207 | ||
1208 | dev_dbg(&ntb_query_pdev(qp->ndev)->dev, "%s: doorbell %d received\n", | ||
1209 | __func__, db_num); | ||
1210 | |||
1196 | /* Limit the number of packets processed in a single interrupt to | 1211 | /* Limit the number of packets processed in a single interrupt to |
1197 | * provide fairness to others | 1212 | * provide fairness to others |
1198 | */ | 1213 | */ |
@@ -1204,16 +1219,8 @@ static void ntb_transport_rx(unsigned long data) | |||
1204 | 1219 | ||
1205 | if (qp->dma_chan) | 1220 | if (qp->dma_chan) |
1206 | dma_async_issue_pending(qp->dma_chan); | 1221 | dma_async_issue_pending(qp->dma_chan); |
1207 | } | ||
1208 | |||
1209 | static void ntb_transport_rxc_db(void *data, int db_num) | ||
1210 | { | ||
1211 | struct ntb_transport_qp *qp = data; | ||
1212 | |||
1213 | dev_dbg(&ntb_query_pdev(qp->ndev)->dev, "%s: doorbell %d received\n", | ||
1214 | __func__, db_num); | ||
1215 | 1222 | ||
1216 | tasklet_schedule(&qp->rx_work); | 1223 | return i; |
1217 | } | 1224 | } |
1218 | 1225 | ||
1219 | static void ntb_tx_copy_callback(void *data) | 1226 | static void ntb_tx_copy_callback(void *data) |
@@ -1432,11 +1439,12 @@ ntb_transport_create_queue(void *data, struct pci_dev *pdev, | |||
1432 | qp->tx_handler = handlers->tx_handler; | 1439 | qp->tx_handler = handlers->tx_handler; |
1433 | qp->event_handler = handlers->event_handler; | 1440 | qp->event_handler = handlers->event_handler; |
1434 | 1441 | ||
1442 | dmaengine_get(); | ||
1435 | qp->dma_chan = dma_find_channel(DMA_MEMCPY); | 1443 | qp->dma_chan = dma_find_channel(DMA_MEMCPY); |
1436 | if (!qp->dma_chan) | 1444 | if (!qp->dma_chan) { |
1445 | dmaengine_put(); | ||
1437 | dev_info(&pdev->dev, "Unable to allocate DMA channel, using CPU instead\n"); | 1446 | dev_info(&pdev->dev, "Unable to allocate DMA channel, using CPU instead\n"); |
1438 | else | 1447 | } |
1439 | dmaengine_get(); | ||
1440 | 1448 | ||
1441 | for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { | 1449 | for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { |
1442 | entry = kzalloc(sizeof(struct ntb_queue_entry), GFP_ATOMIC); | 1450 | entry = kzalloc(sizeof(struct ntb_queue_entry), GFP_ATOMIC); |
@@ -1458,25 +1466,23 @@ ntb_transport_create_queue(void *data, struct pci_dev *pdev, | |||
1458 | &qp->tx_free_q); | 1466 | &qp->tx_free_q); |
1459 | } | 1467 | } |
1460 | 1468 | ||
1461 | tasklet_init(&qp->rx_work, ntb_transport_rx, (unsigned long) qp); | ||
1462 | |||
1463 | rc = ntb_register_db_callback(qp->ndev, free_queue, qp, | 1469 | rc = ntb_register_db_callback(qp->ndev, free_queue, qp, |
1464 | ntb_transport_rxc_db); | 1470 | ntb_transport_rxc_db); |
1465 | if (rc) | 1471 | if (rc) |
1466 | goto err3; | 1472 | goto err2; |
1467 | 1473 | ||
1468 | dev_info(&pdev->dev, "NTB Transport QP %d created\n", qp->qp_num); | 1474 | dev_info(&pdev->dev, "NTB Transport QP %d created\n", qp->qp_num); |
1469 | 1475 | ||
1470 | return qp; | 1476 | return qp; |
1471 | 1477 | ||
1472 | err3: | ||
1473 | tasklet_disable(&qp->rx_work); | ||
1474 | err2: | 1478 | err2: |
1475 | while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) | 1479 | while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) |
1476 | kfree(entry); | 1480 | kfree(entry); |
1477 | err1: | 1481 | err1: |
1478 | while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q))) | 1482 | while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q))) |
1479 | kfree(entry); | 1483 | kfree(entry); |
1484 | if (qp->dma_chan) | ||
1485 | dmaengine_put(); | ||
1480 | set_bit(free_queue, &nt->qp_bitmap); | 1486 | set_bit(free_queue, &nt->qp_bitmap); |
1481 | err: | 1487 | err: |
1482 | return NULL; | 1488 | return NULL; |
@@ -1515,7 +1521,6 @@ void ntb_transport_free_queue(struct ntb_transport_qp *qp) | |||
1515 | } | 1521 | } |
1516 | 1522 | ||
1517 | ntb_unregister_db_callback(qp->ndev, qp->qp_num); | 1523 | ntb_unregister_db_callback(qp->ndev, qp->qp_num); |
1518 | tasklet_disable(&qp->rx_work); | ||
1519 | 1524 | ||
1520 | cancel_delayed_work_sync(&qp->link_work); | 1525 | cancel_delayed_work_sync(&qp->link_work); |
1521 | 1526 | ||
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index b3b1b9aa8863..3a02717473ad 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -9,10 +9,6 @@ | |||
9 | * | 9 | * |
10 | * Init/reset quirks for USB host controllers should be in the | 10 | * Init/reset quirks for USB host controllers should be in the |
11 | * USB quirks file, where their drivers can access reuse it. | 11 | * USB quirks file, where their drivers can access reuse it. |
12 | * | ||
13 | * The bridge optimization stuff has been removed. If you really | ||
14 | * have a silly BIOS which is unable to set your host bridge right, | ||
15 | * use the PowerTweak utility (see http://powertweak.sourceforge.net). | ||
16 | */ | 12 | */ |
17 | 13 | ||
18 | #include <linux/types.h> | 14 | #include <linux/types.h> |
diff --git a/drivers/pinctrl/pinctrl-abx500.c b/drivers/pinctrl/pinctrl-abx500.c index 4780959e11d4..5183e7bb8de3 100644 --- a/drivers/pinctrl/pinctrl-abx500.c +++ b/drivers/pinctrl/pinctrl-abx500.c | |||
@@ -418,7 +418,7 @@ static int abx500_set_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip, | |||
418 | ret = abx500_gpio_set_bits(chip, | 418 | ret = abx500_gpio_set_bits(chip, |
419 | AB8500_GPIO_ALTFUN_REG, | 419 | AB8500_GPIO_ALTFUN_REG, |
420 | af.alt_bit1, | 420 | af.alt_bit1, |
421 | !!(af.alta_val && BIT(0))); | 421 | !!(af.alta_val & BIT(0))); |
422 | if (ret < 0) | 422 | if (ret < 0) |
423 | goto out; | 423 | goto out; |
424 | 424 | ||
@@ -439,7 +439,7 @@ static int abx500_set_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip, | |||
439 | goto out; | 439 | goto out; |
440 | 440 | ||
441 | ret = abx500_gpio_set_bits(chip, AB8500_GPIO_ALTFUN_REG, | 441 | ret = abx500_gpio_set_bits(chip, AB8500_GPIO_ALTFUN_REG, |
442 | af.alt_bit1, !!(af.altb_val && BIT(0))); | 442 | af.alt_bit1, !!(af.altb_val & BIT(0))); |
443 | if (ret < 0) | 443 | if (ret < 0) |
444 | goto out; | 444 | goto out; |
445 | 445 | ||
@@ -462,7 +462,7 @@ static int abx500_set_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip, | |||
462 | goto out; | 462 | goto out; |
463 | 463 | ||
464 | ret = abx500_gpio_set_bits(chip, AB8500_GPIO_ALTFUN_REG, | 464 | ret = abx500_gpio_set_bits(chip, AB8500_GPIO_ALTFUN_REG, |
465 | af.alt_bit2, !!(af.altc_val && BIT(1))); | 465 | af.alt_bit2, !!(af.altc_val & BIT(1))); |
466 | break; | 466 | break; |
467 | 467 | ||
468 | default: | 468 | default: |
diff --git a/drivers/pinctrl/pinctrl-abx500.h b/drivers/pinctrl/pinctrl-abx500.h index eeca8f973999..82293806e842 100644 --- a/drivers/pinctrl/pinctrl-abx500.h +++ b/drivers/pinctrl/pinctrl-abx500.h | |||
@@ -1,4 +1,4 @@ | |||
1 | #ifndef PINCTRL_PINCTRL_ABx5O0_H | 1 | #ifndef PINCTRL_PINCTRL_ABx500_H |
2 | #define PINCTRL_PINCTRL_ABx500_H | 2 | #define PINCTRL_PINCTRL_ABx500_H |
3 | 3 | ||
4 | /* Package definitions */ | 4 | /* Package definitions */ |
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index e939c28cbf1f..46dddc159286 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c | |||
@@ -504,6 +504,7 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank, | |||
504 | data |= (3 << bit); | 504 | data |= (3 << bit); |
505 | break; | 505 | break; |
506 | default: | 506 | default: |
507 | spin_unlock_irqrestore(&bank->slock, flags); | ||
507 | dev_err(info->dev, "unsupported pull setting %d\n", | 508 | dev_err(info->dev, "unsupported pull setting %d\n", |
508 | pull); | 509 | pull); |
509 | return -EINVAL; | 510 | return -EINVAL; |
@@ -1453,8 +1454,8 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev) | |||
1453 | if (ctrl->type == RK3188) { | 1454 | if (ctrl->type == RK3188) { |
1454 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 1455 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
1455 | info->reg_pull = devm_ioremap_resource(&pdev->dev, res); | 1456 | info->reg_pull = devm_ioremap_resource(&pdev->dev, res); |
1456 | if (IS_ERR(info->reg_base)) | 1457 | if (IS_ERR(info->reg_pull)) |
1457 | return PTR_ERR(info->reg_base); | 1458 | return PTR_ERR(info->reg_pull); |
1458 | } | 1459 | } |
1459 | 1460 | ||
1460 | ret = rockchip_gpiolib_register(pdev, info); | 1461 | ret = rockchip_gpiolib_register(pdev, info); |
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7740.c b/drivers/pinctrl/sh-pfc/pfc-r8a7740.c index 009174d07767..bc5eb453a45c 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7740.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7740.c | |||
@@ -3720,7 +3720,7 @@ static void __iomem *r8a7740_pinmux_portcr(struct sh_pfc *pfc, unsigned int pin) | |||
3720 | const struct r8a7740_portcr_group *group = | 3720 | const struct r8a7740_portcr_group *group = |
3721 | &r8a7740_portcr_offsets[i]; | 3721 | &r8a7740_portcr_offsets[i]; |
3722 | 3722 | ||
3723 | if (i <= group->end_pin) | 3723 | if (pin <= group->end_pin) |
3724 | return pfc->window->virt + group->offset + pin; | 3724 | return pfc->window->virt + group->offset + pin; |
3725 | } | 3725 | } |
3726 | 3726 | ||
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7372.c b/drivers/pinctrl/sh-pfc/pfc-sh7372.c index 70b522d34821..cc097b693820 100644 --- a/drivers/pinctrl/sh-pfc/pfc-sh7372.c +++ b/drivers/pinctrl/sh-pfc/pfc-sh7372.c | |||
@@ -2584,7 +2584,7 @@ static void __iomem *sh7372_pinmux_portcr(struct sh_pfc *pfc, unsigned int pin) | |||
2584 | const struct sh7372_portcr_group *group = | 2584 | const struct sh7372_portcr_group *group = |
2585 | &sh7372_portcr_offsets[i]; | 2585 | &sh7372_portcr_offsets[i]; |
2586 | 2586 | ||
2587 | if (i <= group->end_pin) | 2587 | if (pin <= group->end_pin) |
2588 | return pfc->window->virt + group->offset + pin; | 2588 | return pfc->window->virt + group->offset + pin; |
2589 | } | 2589 | } |
2590 | 2590 | ||
diff --git a/drivers/platform/Kconfig b/drivers/platform/Kconfig index 69616aeaa966..09fde58b12e0 100644 --- a/drivers/platform/Kconfig +++ b/drivers/platform/Kconfig | |||
@@ -5,3 +5,4 @@ if GOLDFISH | |||
5 | source "drivers/platform/goldfish/Kconfig" | 5 | source "drivers/platform/goldfish/Kconfig" |
6 | endif | 6 | endif |
7 | 7 | ||
8 | source "drivers/platform/chrome/Kconfig" | ||
diff --git a/drivers/platform/Makefile b/drivers/platform/Makefile index 8a44a4cd6d1e..3656b7b17b99 100644 --- a/drivers/platform/Makefile +++ b/drivers/platform/Makefile | |||
@@ -5,3 +5,4 @@ | |||
5 | obj-$(CONFIG_X86) += x86/ | 5 | obj-$(CONFIG_X86) += x86/ |
6 | obj-$(CONFIG_OLPC) += olpc/ | 6 | obj-$(CONFIG_OLPC) += olpc/ |
7 | obj-$(CONFIG_GOLDFISH) += goldfish/ | 7 | obj-$(CONFIG_GOLDFISH) += goldfish/ |
8 | obj-$(CONFIG_CHROME_PLATFORMS) += chrome/ | ||
diff --git a/drivers/platform/chrome/Kconfig b/drivers/platform/chrome/Kconfig new file mode 100644 index 000000000000..b13303e75a34 --- /dev/null +++ b/drivers/platform/chrome/Kconfig | |||
@@ -0,0 +1,28 @@ | |||
1 | # | ||
2 | # Platform support for Chrome OS hardware (Chromebooks and Chromeboxes) | ||
3 | # | ||
4 | |||
5 | menuconfig CHROME_PLATFORMS | ||
6 | bool "Platform support for Chrome hardware" | ||
7 | depends on X86 | ||
8 | ---help--- | ||
9 | Say Y here to get to see options for platform support for | ||
10 | various Chromebooks and Chromeboxes. This option alone does | ||
11 | not add any kernel code. | ||
12 | |||
13 | If you say N, all options in this submenu will be skipped and disabled. | ||
14 | |||
15 | if CHROME_PLATFORMS | ||
16 | |||
17 | config CHROMEOS_LAPTOP | ||
18 | tristate "Chrome OS Laptop" | ||
19 | depends on I2C | ||
20 | depends on DMI | ||
21 | ---help--- | ||
22 | This driver instantiates i2c and smbus devices such as | ||
23 | light sensors and touchpads. | ||
24 | |||
25 | If you have a supported Chromebook, choose Y or M here. | ||
26 | The module will be called chromeos_laptop. | ||
27 | |||
28 | endif # CHROMEOS_PLATFORMS | ||
diff --git a/drivers/platform/chrome/Makefile b/drivers/platform/chrome/Makefile new file mode 100644 index 000000000000..015e9195e226 --- /dev/null +++ b/drivers/platform/chrome/Makefile | |||
@@ -0,0 +1,2 @@ | |||
1 | |||
2 | obj-$(CONFIG_CHROMEOS_LAPTOP) += chromeos_laptop.o | ||
diff --git a/drivers/platform/x86/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c index 3e5b4497a1d0..3e5b4497a1d0 100644 --- a/drivers/platform/x86/chromeos_laptop.c +++ b/drivers/platform/chrome/chromeos_laptop.c | |||
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index b51a7460cc49..d9dcd37b5a52 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig | |||
@@ -79,17 +79,6 @@ config ASUS_LAPTOP | |||
79 | 79 | ||
80 | If you have an ACPI-compatible ASUS laptop, say Y or M here. | 80 | If you have an ACPI-compatible ASUS laptop, say Y or M here. |
81 | 81 | ||
82 | config CHROMEOS_LAPTOP | ||
83 | tristate "Chrome OS Laptop" | ||
84 | depends on I2C | ||
85 | depends on DMI | ||
86 | ---help--- | ||
87 | This driver instantiates i2c and smbus devices such as | ||
88 | light sensors and touchpads. | ||
89 | |||
90 | If you have a supported Chromebook, choose Y or M here. | ||
91 | The module will be called chromeos_laptop. | ||
92 | |||
93 | config DELL_LAPTOP | 82 | config DELL_LAPTOP |
94 | tristate "Dell Laptop Extras" | 83 | tristate "Dell Laptop Extras" |
95 | depends on X86 | 84 | depends on X86 |
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile index 5dbe19324351..f0e6aa407ffb 100644 --- a/drivers/platform/x86/Makefile +++ b/drivers/platform/x86/Makefile | |||
@@ -50,7 +50,6 @@ obj-$(CONFIG_INTEL_MID_POWER_BUTTON) += intel_mid_powerbtn.o | |||
50 | obj-$(CONFIG_INTEL_OAKTRAIL) += intel_oaktrail.o | 50 | obj-$(CONFIG_INTEL_OAKTRAIL) += intel_oaktrail.o |
51 | obj-$(CONFIG_SAMSUNG_Q10) += samsung-q10.o | 51 | obj-$(CONFIG_SAMSUNG_Q10) += samsung-q10.o |
52 | obj-$(CONFIG_APPLE_GMUX) += apple-gmux.o | 52 | obj-$(CONFIG_APPLE_GMUX) += apple-gmux.o |
53 | obj-$(CONFIG_CHROMEOS_LAPTOP) += chromeos_laptop.o | ||
54 | obj-$(CONFIG_INTEL_RST) += intel-rst.o | 53 | obj-$(CONFIG_INTEL_RST) += intel-rst.o |
55 | obj-$(CONFIG_INTEL_SMARTCONNECT) += intel-smartconnect.o | 54 | obj-$(CONFIG_INTEL_SMARTCONNECT) += intel-smartconnect.o |
56 | 55 | ||
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 0e9c169b42f8..594323a926cf 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c | |||
@@ -1494,10 +1494,9 @@ static int asus_input_init(struct asus_laptop *asus) | |||
1494 | int error; | 1494 | int error; |
1495 | 1495 | ||
1496 | input = input_allocate_device(); | 1496 | input = input_allocate_device(); |
1497 | if (!input) { | 1497 | if (!input) |
1498 | pr_warn("Unable to allocate input device\n"); | ||
1499 | return -ENOMEM; | 1498 | return -ENOMEM; |
1500 | } | 1499 | |
1501 | input->name = "Asus Laptop extra buttons"; | 1500 | input->name = "Asus Laptop extra buttons"; |
1502 | input->phys = ASUS_LAPTOP_FILE "/input0"; | 1501 | input->phys = ASUS_LAPTOP_FILE "/input0"; |
1503 | input->id.bustype = BUS_HOST; | 1502 | input->id.bustype = BUS_HOST; |
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index bb77e18b3dd4..c608b1d33f4a 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/err.h> | 21 | #include <linux/err.h> |
22 | #include <linux/dmi.h> | 22 | #include <linux/dmi.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/rfkill.h> | ||
24 | #include <linux/power_supply.h> | 25 | #include <linux/power_supply.h> |
25 | #include <linux/acpi.h> | 26 | #include <linux/acpi.h> |
26 | #include <linux/mm.h> | 27 | #include <linux/mm.h> |
@@ -89,6 +90,13 @@ static struct platform_driver platform_driver = { | |||
89 | 90 | ||
90 | static struct platform_device *platform_device; | 91 | static struct platform_device *platform_device; |
91 | static struct backlight_device *dell_backlight_device; | 92 | static struct backlight_device *dell_backlight_device; |
93 | static struct rfkill *wifi_rfkill; | ||
94 | static struct rfkill *bluetooth_rfkill; | ||
95 | static struct rfkill *wwan_rfkill; | ||
96 | static bool force_rfkill; | ||
97 | |||
98 | module_param(force_rfkill, bool, 0444); | ||
99 | MODULE_PARM_DESC(force_rfkill, "enable rfkill on non whitelisted models"); | ||
92 | 100 | ||
93 | static const struct dmi_system_id dell_device_table[] __initconst = { | 101 | static const struct dmi_system_id dell_device_table[] __initconst = { |
94 | { | 102 | { |
@@ -355,6 +363,108 @@ dell_send_request(struct calling_interface_buffer *buffer, int class, | |||
355 | return buffer; | 363 | return buffer; |
356 | } | 364 | } |
357 | 365 | ||
366 | /* Derived from information in DellWirelessCtl.cpp: | ||
367 | Class 17, select 11 is radio control. It returns an array of 32-bit values. | ||
368 | |||
369 | Input byte 0 = 0: Wireless information | ||
370 | |||
371 | result[0]: return code | ||
372 | result[1]: | ||
373 | Bit 0: Hardware switch supported | ||
374 | Bit 1: Wifi locator supported | ||
375 | Bit 2: Wifi is supported | ||
376 | Bit 3: Bluetooth is supported | ||
377 | Bit 4: WWAN is supported | ||
378 | Bit 5: Wireless keyboard supported | ||
379 | Bits 6-7: Reserved | ||
380 | Bit 8: Wifi is installed | ||
381 | Bit 9: Bluetooth is installed | ||
382 | Bit 10: WWAN is installed | ||
383 | Bits 11-15: Reserved | ||
384 | Bit 16: Hardware switch is on | ||
385 | Bit 17: Wifi is blocked | ||
386 | Bit 18: Bluetooth is blocked | ||
387 | Bit 19: WWAN is blocked | ||
388 | Bits 20-31: Reserved | ||
389 | result[2]: NVRAM size in bytes | ||
390 | result[3]: NVRAM format version number | ||
391 | |||
392 | Input byte 0 = 2: Wireless switch configuration | ||
393 | result[0]: return code | ||
394 | result[1]: | ||
395 | Bit 0: Wifi controlled by switch | ||
396 | Bit 1: Bluetooth controlled by switch | ||
397 | Bit 2: WWAN controlled by switch | ||
398 | Bits 3-6: Reserved | ||
399 | Bit 7: Wireless switch config locked | ||
400 | Bit 8: Wifi locator enabled | ||
401 | Bits 9-14: Reserved | ||
402 | Bit 15: Wifi locator setting locked | ||
403 | Bits 16-31: Reserved | ||
404 | */ | ||
405 | |||
406 | static int dell_rfkill_set(void *data, bool blocked) | ||
407 | { | ||
408 | int disable = blocked ? 1 : 0; | ||
409 | unsigned long radio = (unsigned long)data; | ||
410 | int hwswitch_bit = (unsigned long)data - 1; | ||
411 | |||
412 | get_buffer(); | ||
413 | dell_send_request(buffer, 17, 11); | ||
414 | |||
415 | /* If the hardware switch controls this radio, and the hardware | ||
416 | switch is disabled, always disable the radio */ | ||
417 | if ((hwswitch_state & BIT(hwswitch_bit)) && | ||
418 | !(buffer->output[1] & BIT(16))) | ||
419 | disable = 1; | ||
420 | |||
421 | buffer->input[0] = (1 | (radio<<8) | (disable << 16)); | ||
422 | dell_send_request(buffer, 17, 11); | ||
423 | |||
424 | release_buffer(); | ||
425 | return 0; | ||
426 | } | ||
427 | |||
428 | /* Must be called with the buffer held */ | ||
429 | static void dell_rfkill_update_sw_state(struct rfkill *rfkill, int radio, | ||
430 | int status) | ||
431 | { | ||
432 | if (status & BIT(0)) { | ||
433 | /* Has hw-switch, sync sw_state to BIOS */ | ||
434 | int block = rfkill_blocked(rfkill); | ||
435 | buffer->input[0] = (1 | (radio << 8) | (block << 16)); | ||
436 | dell_send_request(buffer, 17, 11); | ||
437 | } else { | ||
438 | /* No hw-switch, sync BIOS state to sw_state */ | ||
439 | rfkill_set_sw_state(rfkill, !!(status & BIT(radio + 16))); | ||
440 | } | ||
441 | } | ||
442 | |||
443 | static void dell_rfkill_update_hw_state(struct rfkill *rfkill, int radio, | ||
444 | int status) | ||
445 | { | ||
446 | if (hwswitch_state & (BIT(radio - 1))) | ||
447 | rfkill_set_hw_state(rfkill, !(status & BIT(16))); | ||
448 | } | ||
449 | |||
450 | static void dell_rfkill_query(struct rfkill *rfkill, void *data) | ||
451 | { | ||
452 | int status; | ||
453 | |||
454 | get_buffer(); | ||
455 | dell_send_request(buffer, 17, 11); | ||
456 | status = buffer->output[1]; | ||
457 | |||
458 | dell_rfkill_update_hw_state(rfkill, (unsigned long)data, status); | ||
459 | |||
460 | release_buffer(); | ||
461 | } | ||
462 | |||
463 | static const struct rfkill_ops dell_rfkill_ops = { | ||
464 | .set_block = dell_rfkill_set, | ||
465 | .query = dell_rfkill_query, | ||
466 | }; | ||
467 | |||
358 | static struct dentry *dell_laptop_dir; | 468 | static struct dentry *dell_laptop_dir; |
359 | 469 | ||
360 | static int dell_debugfs_show(struct seq_file *s, void *data) | 470 | static int dell_debugfs_show(struct seq_file *s, void *data) |
@@ -424,6 +534,136 @@ static const struct file_operations dell_debugfs_fops = { | |||
424 | .release = single_release, | 534 | .release = single_release, |
425 | }; | 535 | }; |
426 | 536 | ||
537 | static void dell_update_rfkill(struct work_struct *ignored) | ||
538 | { | ||
539 | int status; | ||
540 | |||
541 | get_buffer(); | ||
542 | dell_send_request(buffer, 17, 11); | ||
543 | status = buffer->output[1]; | ||
544 | |||
545 | if (wifi_rfkill) { | ||
546 | dell_rfkill_update_hw_state(wifi_rfkill, 1, status); | ||
547 | dell_rfkill_update_sw_state(wifi_rfkill, 1, status); | ||
548 | } | ||
549 | if (bluetooth_rfkill) { | ||
550 | dell_rfkill_update_hw_state(bluetooth_rfkill, 2, status); | ||
551 | dell_rfkill_update_sw_state(bluetooth_rfkill, 2, status); | ||
552 | } | ||
553 | if (wwan_rfkill) { | ||
554 | dell_rfkill_update_hw_state(wwan_rfkill, 3, status); | ||
555 | dell_rfkill_update_sw_state(wwan_rfkill, 3, status); | ||
556 | } | ||
557 | |||
558 | release_buffer(); | ||
559 | } | ||
560 | static DECLARE_DELAYED_WORK(dell_rfkill_work, dell_update_rfkill); | ||
561 | |||
562 | |||
563 | static int __init dell_setup_rfkill(void) | ||
564 | { | ||
565 | int status; | ||
566 | int ret; | ||
567 | const char *product; | ||
568 | |||
569 | /* | ||
570 | * rfkill causes trouble on various non Latitudes, according to Dell | ||
571 | * actually testing the rfkill functionality is only done on Latitudes. | ||
572 | */ | ||
573 | product = dmi_get_system_info(DMI_PRODUCT_NAME); | ||
574 | if (!force_rfkill && (!product || strncmp(product, "Latitude", 8))) | ||
575 | return 0; | ||
576 | |||
577 | get_buffer(); | ||
578 | dell_send_request(buffer, 17, 11); | ||
579 | status = buffer->output[1]; | ||
580 | buffer->input[0] = 0x2; | ||
581 | dell_send_request(buffer, 17, 11); | ||
582 | hwswitch_state = buffer->output[1]; | ||
583 | release_buffer(); | ||
584 | |||
585 | if (!(status & BIT(0))) { | ||
586 | if (force_rfkill) { | ||
587 | /* No hwsitch, clear all hw-controlled bits */ | ||
588 | hwswitch_state &= ~7; | ||
589 | } else { | ||
590 | /* rfkill is only tested on laptops with a hwswitch */ | ||
591 | return 0; | ||
592 | } | ||
593 | } | ||
594 | |||
595 | if ((status & (1<<2|1<<8)) == (1<<2|1<<8)) { | ||
596 | wifi_rfkill = rfkill_alloc("dell-wifi", &platform_device->dev, | ||
597 | RFKILL_TYPE_WLAN, | ||
598 | &dell_rfkill_ops, (void *) 1); | ||
599 | if (!wifi_rfkill) { | ||
600 | ret = -ENOMEM; | ||
601 | goto err_wifi; | ||
602 | } | ||
603 | ret = rfkill_register(wifi_rfkill); | ||
604 | if (ret) | ||
605 | goto err_wifi; | ||
606 | } | ||
607 | |||
608 | if ((status & (1<<3|1<<9)) == (1<<3|1<<9)) { | ||
609 | bluetooth_rfkill = rfkill_alloc("dell-bluetooth", | ||
610 | &platform_device->dev, | ||
611 | RFKILL_TYPE_BLUETOOTH, | ||
612 | &dell_rfkill_ops, (void *) 2); | ||
613 | if (!bluetooth_rfkill) { | ||
614 | ret = -ENOMEM; | ||
615 | goto err_bluetooth; | ||
616 | } | ||
617 | ret = rfkill_register(bluetooth_rfkill); | ||
618 | if (ret) | ||
619 | goto err_bluetooth; | ||
620 | } | ||
621 | |||
622 | if ((status & (1<<4|1<<10)) == (1<<4|1<<10)) { | ||
623 | wwan_rfkill = rfkill_alloc("dell-wwan", | ||
624 | &platform_device->dev, | ||
625 | RFKILL_TYPE_WWAN, | ||
626 | &dell_rfkill_ops, (void *) 3); | ||
627 | if (!wwan_rfkill) { | ||
628 | ret = -ENOMEM; | ||
629 | goto err_wwan; | ||
630 | } | ||
631 | ret = rfkill_register(wwan_rfkill); | ||
632 | if (ret) | ||
633 | goto err_wwan; | ||
634 | } | ||
635 | |||
636 | return 0; | ||
637 | err_wwan: | ||
638 | rfkill_destroy(wwan_rfkill); | ||
639 | if (bluetooth_rfkill) | ||
640 | rfkill_unregister(bluetooth_rfkill); | ||
641 | err_bluetooth: | ||
642 | rfkill_destroy(bluetooth_rfkill); | ||
643 | if (wifi_rfkill) | ||
644 | rfkill_unregister(wifi_rfkill); | ||
645 | err_wifi: | ||
646 | rfkill_destroy(wifi_rfkill); | ||
647 | |||
648 | return ret; | ||
649 | } | ||
650 | |||
651 | static void dell_cleanup_rfkill(void) | ||
652 | { | ||
653 | if (wifi_rfkill) { | ||
654 | rfkill_unregister(wifi_rfkill); | ||
655 | rfkill_destroy(wifi_rfkill); | ||
656 | } | ||
657 | if (bluetooth_rfkill) { | ||
658 | rfkill_unregister(bluetooth_rfkill); | ||
659 | rfkill_destroy(bluetooth_rfkill); | ||
660 | } | ||
661 | if (wwan_rfkill) { | ||
662 | rfkill_unregister(wwan_rfkill); | ||
663 | rfkill_destroy(wwan_rfkill); | ||
664 | } | ||
665 | } | ||
666 | |||
427 | static int dell_send_intensity(struct backlight_device *bd) | 667 | static int dell_send_intensity(struct backlight_device *bd) |
428 | { | 668 | { |
429 | int ret = 0; | 669 | int ret = 0; |
@@ -515,6 +755,30 @@ static void touchpad_led_exit(void) | |||
515 | led_classdev_unregister(&touchpad_led); | 755 | led_classdev_unregister(&touchpad_led); |
516 | } | 756 | } |
517 | 757 | ||
758 | static bool dell_laptop_i8042_filter(unsigned char data, unsigned char str, | ||
759 | struct serio *port) | ||
760 | { | ||
761 | static bool extended; | ||
762 | |||
763 | if (str & 0x20) | ||
764 | return false; | ||
765 | |||
766 | if (unlikely(data == 0xe0)) { | ||
767 | extended = true; | ||
768 | return false; | ||
769 | } else if (unlikely(extended)) { | ||
770 | switch (data) { | ||
771 | case 0x8: | ||
772 | schedule_delayed_work(&dell_rfkill_work, | ||
773 | round_jiffies_relative(HZ / 4)); | ||
774 | break; | ||
775 | } | ||
776 | extended = false; | ||
777 | } | ||
778 | |||
779 | return false; | ||
780 | } | ||
781 | |||
518 | static int __init dell_init(void) | 782 | static int __init dell_init(void) |
519 | { | 783 | { |
520 | int max_intensity = 0; | 784 | int max_intensity = 0; |
@@ -557,10 +821,26 @@ static int __init dell_init(void) | |||
557 | } | 821 | } |
558 | buffer = page_address(bufferpage); | 822 | buffer = page_address(bufferpage); |
559 | 823 | ||
824 | ret = dell_setup_rfkill(); | ||
825 | |||
826 | if (ret) { | ||
827 | pr_warn("Unable to setup rfkill\n"); | ||
828 | goto fail_rfkill; | ||
829 | } | ||
830 | |||
831 | ret = i8042_install_filter(dell_laptop_i8042_filter); | ||
832 | if (ret) { | ||
833 | pr_warn("Unable to install key filter\n"); | ||
834 | goto fail_filter; | ||
835 | } | ||
836 | |||
560 | if (quirks && quirks->touchpad_led) | 837 | if (quirks && quirks->touchpad_led) |
561 | touchpad_led_init(&platform_device->dev); | 838 | touchpad_led_init(&platform_device->dev); |
562 | 839 | ||
563 | dell_laptop_dir = debugfs_create_dir("dell_laptop", NULL); | 840 | dell_laptop_dir = debugfs_create_dir("dell_laptop", NULL); |
841 | if (dell_laptop_dir != NULL) | ||
842 | debugfs_create_file("rfkill", 0444, dell_laptop_dir, NULL, | ||
843 | &dell_debugfs_fops); | ||
564 | 844 | ||
565 | #ifdef CONFIG_ACPI | 845 | #ifdef CONFIG_ACPI |
566 | /* In the event of an ACPI backlight being available, don't | 846 | /* In the event of an ACPI backlight being available, don't |
@@ -603,6 +883,11 @@ static int __init dell_init(void) | |||
603 | return 0; | 883 | return 0; |
604 | 884 | ||
605 | fail_backlight: | 885 | fail_backlight: |
886 | i8042_remove_filter(dell_laptop_i8042_filter); | ||
887 | cancel_delayed_work_sync(&dell_rfkill_work); | ||
888 | fail_filter: | ||
889 | dell_cleanup_rfkill(); | ||
890 | fail_rfkill: | ||
606 | free_page((unsigned long)bufferpage); | 891 | free_page((unsigned long)bufferpage); |
607 | fail_buffer: | 892 | fail_buffer: |
608 | platform_device_del(platform_device); | 893 | platform_device_del(platform_device); |
@@ -620,7 +905,10 @@ static void __exit dell_exit(void) | |||
620 | debugfs_remove_recursive(dell_laptop_dir); | 905 | debugfs_remove_recursive(dell_laptop_dir); |
621 | if (quirks && quirks->touchpad_led) | 906 | if (quirks && quirks->touchpad_led) |
622 | touchpad_led_exit(); | 907 | touchpad_led_exit(); |
908 | i8042_remove_filter(dell_laptop_i8042_filter); | ||
909 | cancel_delayed_work_sync(&dell_rfkill_work); | ||
623 | backlight_device_unregister(dell_backlight_device); | 910 | backlight_device_unregister(dell_backlight_device); |
911 | dell_cleanup_rfkill(); | ||
624 | if (platform_device) { | 912 | if (platform_device) { |
625 | platform_device_unregister(platform_device); | 913 | platform_device_unregister(platform_device); |
626 | platform_driver_unregister(&platform_driver); | 914 | platform_driver_unregister(&platform_driver); |
diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c index fa9a2171cc13..60e0900bc117 100644 --- a/drivers/platform/x86/dell-wmi.c +++ b/drivers/platform/x86/dell-wmi.c | |||
@@ -130,7 +130,8 @@ static const u16 bios_to_linux_keycode[256] __initconst = { | |||
130 | KEY_BRIGHTNESSUP, KEY_UNKNOWN, KEY_KBDILLUMTOGGLE, | 130 | KEY_BRIGHTNESSUP, KEY_UNKNOWN, KEY_KBDILLUMTOGGLE, |
131 | KEY_UNKNOWN, KEY_SWITCHVIDEOMODE, KEY_UNKNOWN, KEY_UNKNOWN, | 131 | KEY_UNKNOWN, KEY_SWITCHVIDEOMODE, KEY_UNKNOWN, KEY_UNKNOWN, |
132 | KEY_SWITCHVIDEOMODE, KEY_UNKNOWN, KEY_UNKNOWN, KEY_PROG2, | 132 | KEY_SWITCHVIDEOMODE, KEY_UNKNOWN, KEY_UNKNOWN, KEY_PROG2, |
133 | KEY_UNKNOWN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 133 | KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, |
134 | KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_MICMUTE, | ||
134 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 135 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
135 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 136 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
136 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 137 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
@@ -139,8 +140,8 @@ static const u16 bios_to_linux_keycode[256] __initconst = { | |||
139 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 140 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
140 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 141 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
141 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 142 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
142 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 143 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
143 | KEY_PROG3 | 144 | 0, 0, 0, 0, 0, 0, 0, 0, 0, KEY_PROG3 |
144 | }; | 145 | }; |
145 | 146 | ||
146 | static struct input_dev *dell_wmi_input_dev; | 147 | static struct input_dev *dell_wmi_input_dev; |
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index aefcc32e5634..dec68e7a99c7 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
@@ -1203,10 +1203,8 @@ static int eeepc_input_init(struct eeepc_laptop *eeepc) | |||
1203 | int error; | 1203 | int error; |
1204 | 1204 | ||
1205 | input = input_allocate_device(); | 1205 | input = input_allocate_device(); |
1206 | if (!input) { | 1206 | if (!input) |
1207 | pr_info("Unable to allocate input device\n"); | ||
1208 | return -ENOMEM; | 1207 | return -ENOMEM; |
1209 | } | ||
1210 | 1208 | ||
1211 | input->name = "Asus EeePC extra buttons"; | 1209 | input->name = "Asus EeePC extra buttons"; |
1212 | input->phys = EEEPC_LAPTOP_FILE "/input0"; | 1210 | input->phys = EEEPC_LAPTOP_FILE "/input0"; |
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 1c86fa0857c8..8ba8956b5a48 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
@@ -54,6 +54,7 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4"); | |||
54 | #define HPWMI_HARDWARE_QUERY 0x4 | 54 | #define HPWMI_HARDWARE_QUERY 0x4 |
55 | #define HPWMI_WIRELESS_QUERY 0x5 | 55 | #define HPWMI_WIRELESS_QUERY 0x5 |
56 | #define HPWMI_HOTKEY_QUERY 0xc | 56 | #define HPWMI_HOTKEY_QUERY 0xc |
57 | #define HPWMI_FEATURE_QUERY 0xd | ||
57 | #define HPWMI_WIRELESS2_QUERY 0x1b | 58 | #define HPWMI_WIRELESS2_QUERY 0x1b |
58 | #define HPWMI_POSTCODEERROR_QUERY 0x2a | 59 | #define HPWMI_POSTCODEERROR_QUERY 0x2a |
59 | 60 | ||
@@ -292,6 +293,17 @@ static int hp_wmi_tablet_state(void) | |||
292 | return (state & 0x4) ? 1 : 0; | 293 | return (state & 0x4) ? 1 : 0; |
293 | } | 294 | } |
294 | 295 | ||
296 | static int hp_wmi_bios_2009_later(void) | ||
297 | { | ||
298 | int state = 0; | ||
299 | int ret = hp_wmi_perform_query(HPWMI_FEATURE_QUERY, 0, &state, | ||
300 | sizeof(state), sizeof(state)); | ||
301 | if (ret) | ||
302 | return ret; | ||
303 | |||
304 | return (state & 0x10) ? 1 : 0; | ||
305 | } | ||
306 | |||
295 | static int hp_wmi_set_block(void *data, bool blocked) | 307 | static int hp_wmi_set_block(void *data, bool blocked) |
296 | { | 308 | { |
297 | enum hp_wmi_radio r = (enum hp_wmi_radio) data; | 309 | enum hp_wmi_radio r = (enum hp_wmi_radio) data; |
@@ -871,7 +883,7 @@ static int __init hp_wmi_bios_setup(struct platform_device *device) | |||
871 | gps_rfkill = NULL; | 883 | gps_rfkill = NULL; |
872 | rfkill2_count = 0; | 884 | rfkill2_count = 0; |
873 | 885 | ||
874 | if (hp_wmi_rfkill_setup(device)) | 886 | if (hp_wmi_bios_2009_later() || hp_wmi_rfkill_setup(device)) |
875 | hp_wmi_rfkill2_setup(device); | 887 | hp_wmi_rfkill2_setup(device); |
876 | 888 | ||
877 | err = device_create_file(&device->dev, &dev_attr_display); | 889 | err = device_create_file(&device->dev, &dev_attr_display); |
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 6788acc22ab9..19ec95147f69 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c | |||
@@ -570,10 +570,8 @@ static int ideapad_input_init(struct ideapad_private *priv) | |||
570 | int error; | 570 | int error; |
571 | 571 | ||
572 | inputdev = input_allocate_device(); | 572 | inputdev = input_allocate_device(); |
573 | if (!inputdev) { | 573 | if (!inputdev) |
574 | pr_info("Unable to allocate input device\n"); | ||
575 | return -ENOMEM; | 574 | return -ENOMEM; |
576 | } | ||
577 | 575 | ||
578 | inputdev->name = "Ideapad extra buttons"; | 576 | inputdev->name = "Ideapad extra buttons"; |
579 | inputdev->phys = "ideapad/input0"; | 577 | inputdev->phys = "ideapad/input0"; |
diff --git a/drivers/platform/x86/intel_mid_powerbtn.c b/drivers/platform/x86/intel_mid_powerbtn.c index 6b18aba82cfa..8d6775266d66 100644 --- a/drivers/platform/x86/intel_mid_powerbtn.c +++ b/drivers/platform/x86/intel_mid_powerbtn.c | |||
@@ -66,10 +66,8 @@ static int mfld_pb_probe(struct platform_device *pdev) | |||
66 | return -EINVAL; | 66 | return -EINVAL; |
67 | 67 | ||
68 | input = input_allocate_device(); | 68 | input = input_allocate_device(); |
69 | if (!input) { | 69 | if (!input) |
70 | dev_err(&pdev->dev, "Input device allocation error\n"); | ||
71 | return -ENOMEM; | 70 | return -ENOMEM; |
72 | } | ||
73 | 71 | ||
74 | input->name = pdev->name; | 72 | input->name = pdev->name; |
75 | input->phys = "power-button/input0"; | 73 | input->phys = "power-button/input0"; |
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index d654f831410d..60ea476a9130 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c | |||
@@ -58,12 +58,56 @@ | |||
58 | * message handler is called within firmware. | 58 | * message handler is called within firmware. |
59 | */ | 59 | */ |
60 | 60 | ||
61 | #define IPC_BASE_ADDR 0xFF11C000 /* IPC1 base register address */ | ||
62 | #define IPC_MAX_ADDR 0x100 /* Maximum IPC regisers */ | ||
63 | #define IPC_WWBUF_SIZE 20 /* IPC Write buffer Size */ | 61 | #define IPC_WWBUF_SIZE 20 /* IPC Write buffer Size */ |
64 | #define IPC_RWBUF_SIZE 20 /* IPC Read buffer Size */ | 62 | #define IPC_RWBUF_SIZE 20 /* IPC Read buffer Size */ |
65 | #define IPC_I2C_BASE 0xFF12B000 /* I2C control register base address */ | 63 | #define IPC_IOC 0x100 /* IPC command register IOC bit */ |
66 | #define IPC_I2C_MAX_ADDR 0x10 /* Maximum I2C regisers */ | 64 | |
65 | enum { | ||
66 | SCU_IPC_LINCROFT, | ||
67 | SCU_IPC_PENWELL, | ||
68 | SCU_IPC_CLOVERVIEW, | ||
69 | SCU_IPC_TANGIER, | ||
70 | }; | ||
71 | |||
72 | /* intel scu ipc driver data*/ | ||
73 | struct intel_scu_ipc_pdata_t { | ||
74 | u32 ipc_base; | ||
75 | u32 i2c_base; | ||
76 | u32 ipc_len; | ||
77 | u32 i2c_len; | ||
78 | u8 irq_mode; | ||
79 | }; | ||
80 | |||
81 | static struct intel_scu_ipc_pdata_t intel_scu_ipc_pdata[] = { | ||
82 | [SCU_IPC_LINCROFT] = { | ||
83 | .ipc_base = 0xff11c000, | ||
84 | .i2c_base = 0xff12b000, | ||
85 | .ipc_len = 0x100, | ||
86 | .i2c_len = 0x10, | ||
87 | .irq_mode = 0, | ||
88 | }, | ||
89 | [SCU_IPC_PENWELL] = { | ||
90 | .ipc_base = 0xff11c000, | ||
91 | .i2c_base = 0xff12b000, | ||
92 | .ipc_len = 0x100, | ||
93 | .i2c_len = 0x10, | ||
94 | .irq_mode = 1, | ||
95 | }, | ||
96 | [SCU_IPC_CLOVERVIEW] = { | ||
97 | .ipc_base = 0xff11c000, | ||
98 | .i2c_base = 0xff12b000, | ||
99 | .ipc_len = 0x100, | ||
100 | .i2c_len = 0x10, | ||
101 | .irq_mode = 1, | ||
102 | }, | ||
103 | [SCU_IPC_TANGIER] = { | ||
104 | .ipc_base = 0xff009000, | ||
105 | .i2c_base = 0xff00d000, | ||
106 | .ipc_len = 0x100, | ||
107 | .i2c_len = 0x10, | ||
108 | .irq_mode = 0, | ||
109 | }, | ||
110 | }; | ||
67 | 111 | ||
68 | static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id); | 112 | static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id); |
69 | static void ipc_remove(struct pci_dev *pdev); | 113 | static void ipc_remove(struct pci_dev *pdev); |
@@ -72,6 +116,8 @@ struct intel_scu_ipc_dev { | |||
72 | struct pci_dev *pdev; | 116 | struct pci_dev *pdev; |
73 | void __iomem *ipc_base; | 117 | void __iomem *ipc_base; |
74 | void __iomem *i2c_base; | 118 | void __iomem *i2c_base; |
119 | struct completion cmd_complete; | ||
120 | u8 irq_mode; | ||
75 | }; | 121 | }; |
76 | 122 | ||
77 | static struct intel_scu_ipc_dev ipcdev; /* Only one for now */ | 123 | static struct intel_scu_ipc_dev ipcdev; /* Only one for now */ |
@@ -98,6 +144,10 @@ static DEFINE_MUTEX(ipclock); /* lock used to prevent multiple call to SCU */ | |||
98 | */ | 144 | */ |
99 | static inline void ipc_command(u32 cmd) /* Send ipc command */ | 145 | static inline void ipc_command(u32 cmd) /* Send ipc command */ |
100 | { | 146 | { |
147 | if (ipcdev.irq_mode) { | ||
148 | reinit_completion(&ipcdev.cmd_complete); | ||
149 | writel(cmd | IPC_IOC, ipcdev.ipc_base); | ||
150 | } | ||
101 | writel(cmd, ipcdev.ipc_base); | 151 | writel(cmd, ipcdev.ipc_base); |
102 | } | 152 | } |
103 | 153 | ||
@@ -156,6 +206,30 @@ static inline int busy_loop(void) /* Wait till scu status is busy */ | |||
156 | return 0; | 206 | return 0; |
157 | } | 207 | } |
158 | 208 | ||
209 | /* Wait till ipc ioc interrupt is received or timeout in 3 HZ */ | ||
210 | static inline int ipc_wait_for_interrupt(void) | ||
211 | { | ||
212 | int status; | ||
213 | |||
214 | if (!wait_for_completion_timeout(&ipcdev.cmd_complete, 3 * HZ)) { | ||
215 | struct device *dev = &ipcdev.pdev->dev; | ||
216 | dev_err(dev, "IPC timed out\n"); | ||
217 | return -ETIMEDOUT; | ||
218 | } | ||
219 | |||
220 | status = ipc_read_status(); | ||
221 | |||
222 | if ((status >> 1) & 1) | ||
223 | return -EIO; | ||
224 | |||
225 | return 0; | ||
226 | } | ||
227 | |||
228 | int intel_scu_ipc_check_status(void) | ||
229 | { | ||
230 | return ipcdev.irq_mode ? ipc_wait_for_interrupt() : busy_loop(); | ||
231 | } | ||
232 | |||
159 | /* Read/Write power control(PMIC in Langwell, MSIC in PenWell) registers */ | 233 | /* Read/Write power control(PMIC in Langwell, MSIC in PenWell) registers */ |
160 | static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) | 234 | static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) |
161 | { | 235 | { |
@@ -196,8 +270,8 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) | |||
196 | ipc_command(4 << 16 | id << 12 | 0 << 8 | op); | 270 | ipc_command(4 << 16 | id << 12 | 0 << 8 | op); |
197 | } | 271 | } |
198 | 272 | ||
199 | err = busy_loop(); | 273 | err = intel_scu_ipc_check_status(); |
200 | if (id == IPC_CMD_PCNTRL_R) { /* Read rbuf */ | 274 | if (!err && id == IPC_CMD_PCNTRL_R) { /* Read rbuf */ |
201 | /* Workaround: values are read as 0 without memcpy_fromio */ | 275 | /* Workaround: values are read as 0 without memcpy_fromio */ |
202 | memcpy_fromio(cbuf, ipcdev.ipc_base + 0x90, 16); | 276 | memcpy_fromio(cbuf, ipcdev.ipc_base + 0x90, 16); |
203 | for (nc = 0; nc < count; nc++) | 277 | for (nc = 0; nc < count; nc++) |
@@ -391,7 +465,7 @@ int intel_scu_ipc_simple_command(int cmd, int sub) | |||
391 | return -ENODEV; | 465 | return -ENODEV; |
392 | } | 466 | } |
393 | ipc_command(sub << 12 | cmd); | 467 | ipc_command(sub << 12 | cmd); |
394 | err = busy_loop(); | 468 | err = intel_scu_ipc_check_status(); |
395 | mutex_unlock(&ipclock); | 469 | mutex_unlock(&ipclock); |
396 | return err; | 470 | return err; |
397 | } | 471 | } |
@@ -425,10 +499,12 @@ int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen, | |||
425 | ipc_data_writel(*in++, 4 * i); | 499 | ipc_data_writel(*in++, 4 * i); |
426 | 500 | ||
427 | ipc_command((inlen << 16) | (sub << 12) | cmd); | 501 | ipc_command((inlen << 16) | (sub << 12) | cmd); |
428 | err = busy_loop(); | 502 | err = intel_scu_ipc_check_status(); |
429 | 503 | ||
430 | for (i = 0; i < outlen; i++) | 504 | if (!err) { |
431 | *out++ = ipc_data_readl(4 * i); | 505 | for (i = 0; i < outlen; i++) |
506 | *out++ = ipc_data_readl(4 * i); | ||
507 | } | ||
432 | 508 | ||
433 | mutex_unlock(&ipclock); | 509 | mutex_unlock(&ipclock); |
434 | return err; | 510 | return err; |
@@ -491,6 +567,9 @@ EXPORT_SYMBOL(intel_scu_ipc_i2c_cntrl); | |||
491 | */ | 567 | */ |
492 | static irqreturn_t ioc(int irq, void *dev_id) | 568 | static irqreturn_t ioc(int irq, void *dev_id) |
493 | { | 569 | { |
570 | if (ipcdev.irq_mode) | ||
571 | complete(&ipcdev.cmd_complete); | ||
572 | |||
494 | return IRQ_HANDLED; | 573 | return IRQ_HANDLED; |
495 | } | 574 | } |
496 | 575 | ||
@@ -504,13 +583,18 @@ static irqreturn_t ioc(int irq, void *dev_id) | |||
504 | */ | 583 | */ |
505 | static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id) | 584 | static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id) |
506 | { | 585 | { |
507 | int err; | 586 | int err, pid; |
587 | struct intel_scu_ipc_pdata_t *pdata; | ||
508 | resource_size_t pci_resource; | 588 | resource_size_t pci_resource; |
509 | 589 | ||
510 | if (ipcdev.pdev) /* We support only one SCU */ | 590 | if (ipcdev.pdev) /* We support only one SCU */ |
511 | return -EBUSY; | 591 | return -EBUSY; |
512 | 592 | ||
593 | pid = id->driver_data; | ||
594 | pdata = &intel_scu_ipc_pdata[pid]; | ||
595 | |||
513 | ipcdev.pdev = pci_dev_get(dev); | 596 | ipcdev.pdev = pci_dev_get(dev); |
597 | ipcdev.irq_mode = pdata->irq_mode; | ||
514 | 598 | ||
515 | err = pci_enable_device(dev); | 599 | err = pci_enable_device(dev); |
516 | if (err) | 600 | if (err) |
@@ -524,14 +608,16 @@ static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
524 | if (!pci_resource) | 608 | if (!pci_resource) |
525 | return -ENOMEM; | 609 | return -ENOMEM; |
526 | 610 | ||
611 | init_completion(&ipcdev.cmd_complete); | ||
612 | |||
527 | if (request_irq(dev->irq, ioc, 0, "intel_scu_ipc", &ipcdev)) | 613 | if (request_irq(dev->irq, ioc, 0, "intel_scu_ipc", &ipcdev)) |
528 | return -EBUSY; | 614 | return -EBUSY; |
529 | 615 | ||
530 | ipcdev.ipc_base = ioremap_nocache(IPC_BASE_ADDR, IPC_MAX_ADDR); | 616 | ipcdev.ipc_base = ioremap_nocache(pdata->ipc_base, pdata->ipc_len); |
531 | if (!ipcdev.ipc_base) | 617 | if (!ipcdev.ipc_base) |
532 | return -ENOMEM; | 618 | return -ENOMEM; |
533 | 619 | ||
534 | ipcdev.i2c_base = ioremap_nocache(IPC_I2C_BASE, IPC_I2C_MAX_ADDR); | 620 | ipcdev.i2c_base = ioremap_nocache(pdata->i2c_base, pdata->i2c_len); |
535 | if (!ipcdev.i2c_base) { | 621 | if (!ipcdev.i2c_base) { |
536 | iounmap(ipcdev.ipc_base); | 622 | iounmap(ipcdev.ipc_base); |
537 | return -ENOMEM; | 623 | return -ENOMEM; |
@@ -564,7 +650,10 @@ static void ipc_remove(struct pci_dev *pdev) | |||
564 | } | 650 | } |
565 | 651 | ||
566 | static DEFINE_PCI_DEVICE_TABLE(pci_ids) = { | 652 | static DEFINE_PCI_DEVICE_TABLE(pci_ids) = { |
567 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x082a)}, | 653 | {PCI_VDEVICE(INTEL, 0x082a), SCU_IPC_LINCROFT}, |
654 | {PCI_VDEVICE(INTEL, 0x080e), SCU_IPC_PENWELL}, | ||
655 | {PCI_VDEVICE(INTEL, 0x08ea), SCU_IPC_CLOVERVIEW}, | ||
656 | {PCI_VDEVICE(INTEL, 0x11a0), SCU_IPC_TANGIER}, | ||
568 | { 0,} | 657 | { 0,} |
569 | }; | 658 | }; |
570 | MODULE_DEVICE_TABLE(pci, pci_ids); | 659 | MODULE_DEVICE_TABLE(pci, pci_ids); |
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 10d12b221601..3008fd20572e 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c | |||
@@ -490,11 +490,8 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc) | |||
490 | int error; | 490 | int error; |
491 | 491 | ||
492 | input_dev = input_allocate_device(); | 492 | input_dev = input_allocate_device(); |
493 | if (!input_dev) { | 493 | if (!input_dev) |
494 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | ||
495 | "Couldn't allocate input device for hotkey")); | ||
496 | return -ENOMEM; | 494 | return -ENOMEM; |
497 | } | ||
498 | 495 | ||
499 | input_dev->name = ACPI_PCC_DRIVER_NAME; | 496 | input_dev->name = ACPI_PCC_DRIVER_NAME; |
500 | input_dev->phys = ACPI_PCC_INPUT_PHYS; | 497 | input_dev->phys = ACPI_PCC_INPUT_PHYS; |
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 47caab0ea7a1..fb233ae7bb0e 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
@@ -140,12 +140,12 @@ MODULE_PARM_DESC(kbd_backlight_timeout, | |||
140 | "on the model (default: no change from current value)"); | 140 | "on the model (default: no change from current value)"); |
141 | 141 | ||
142 | #ifdef CONFIG_PM_SLEEP | 142 | #ifdef CONFIG_PM_SLEEP |
143 | static void sony_nc_kbd_backlight_resume(void); | ||
144 | static void sony_nc_thermal_resume(void); | 143 | static void sony_nc_thermal_resume(void); |
145 | #endif | 144 | #endif |
146 | static int sony_nc_kbd_backlight_setup(struct platform_device *pd, | 145 | static int sony_nc_kbd_backlight_setup(struct platform_device *pd, |
147 | unsigned int handle); | 146 | unsigned int handle); |
148 | static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd); | 147 | static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd, |
148 | unsigned int handle); | ||
149 | 149 | ||
150 | static int sony_nc_battery_care_setup(struct platform_device *pd, | 150 | static int sony_nc_battery_care_setup(struct platform_device *pd, |
151 | unsigned int handle); | 151 | unsigned int handle); |
@@ -304,8 +304,8 @@ static int sony_laptop_input_keycode_map[] = { | |||
304 | KEY_FN_F10, /* 14 SONYPI_EVENT_FNKEY_F10 */ | 304 | KEY_FN_F10, /* 14 SONYPI_EVENT_FNKEY_F10 */ |
305 | KEY_FN_F11, /* 15 SONYPI_EVENT_FNKEY_F11 */ | 305 | KEY_FN_F11, /* 15 SONYPI_EVENT_FNKEY_F11 */ |
306 | KEY_FN_F12, /* 16 SONYPI_EVENT_FNKEY_F12 */ | 306 | KEY_FN_F12, /* 16 SONYPI_EVENT_FNKEY_F12 */ |
307 | KEY_FN_F1, /* 17 SONYPI_EVENT_FNKEY_1 */ | 307 | KEY_FN_1, /* 17 SONYPI_EVENT_FNKEY_1 */ |
308 | KEY_FN_F2, /* 18 SONYPI_EVENT_FNKEY_2 */ | 308 | KEY_FN_2, /* 18 SONYPI_EVENT_FNKEY_2 */ |
309 | KEY_FN_D, /* 19 SONYPI_EVENT_FNKEY_D */ | 309 | KEY_FN_D, /* 19 SONYPI_EVENT_FNKEY_D */ |
310 | KEY_FN_E, /* 20 SONYPI_EVENT_FNKEY_E */ | 310 | KEY_FN_E, /* 20 SONYPI_EVENT_FNKEY_E */ |
311 | KEY_FN_F, /* 21 SONYPI_EVENT_FNKEY_F */ | 311 | KEY_FN_F, /* 21 SONYPI_EVENT_FNKEY_F */ |
@@ -1444,7 +1444,7 @@ static void sony_nc_function_cleanup(struct platform_device *pd) | |||
1444 | case 0x014b: | 1444 | case 0x014b: |
1445 | case 0x014c: | 1445 | case 0x014c: |
1446 | case 0x0163: | 1446 | case 0x0163: |
1447 | sony_nc_kbd_backlight_cleanup(pd); | 1447 | sony_nc_kbd_backlight_cleanup(pd, handle); |
1448 | break; | 1448 | break; |
1449 | default: | 1449 | default: |
1450 | continue; | 1450 | continue; |
@@ -1486,13 +1486,6 @@ static void sony_nc_function_resume(void) | |||
1486 | case 0x0135: | 1486 | case 0x0135: |
1487 | sony_nc_rfkill_update(); | 1487 | sony_nc_rfkill_update(); |
1488 | break; | 1488 | break; |
1489 | case 0x0137: | ||
1490 | case 0x0143: | ||
1491 | case 0x014b: | ||
1492 | case 0x014c: | ||
1493 | case 0x0163: | ||
1494 | sony_nc_kbd_backlight_resume(); | ||
1495 | break; | ||
1496 | default: | 1489 | default: |
1497 | continue; | 1490 | continue; |
1498 | } | 1491 | } |
@@ -1822,6 +1815,12 @@ static int sony_nc_kbd_backlight_setup(struct platform_device *pd, | |||
1822 | int result; | 1815 | int result; |
1823 | int ret = 0; | 1816 | int ret = 0; |
1824 | 1817 | ||
1818 | if (kbdbl_ctl) { | ||
1819 | pr_warn("handle 0x%.4x: keyboard backlight setup already done for 0x%.4x\n", | ||
1820 | handle, kbdbl_ctl->handle); | ||
1821 | return -EBUSY; | ||
1822 | } | ||
1823 | |||
1825 | /* verify the kbd backlight presence, these handles are not used for | 1824 | /* verify the kbd backlight presence, these handles are not used for |
1826 | * keyboard backlight only | 1825 | * keyboard backlight only |
1827 | */ | 1826 | */ |
@@ -1881,9 +1880,10 @@ outkzalloc: | |||
1881 | return ret; | 1880 | return ret; |
1882 | } | 1881 | } |
1883 | 1882 | ||
1884 | static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd) | 1883 | static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd, |
1884 | unsigned int handle) | ||
1885 | { | 1885 | { |
1886 | if (kbdbl_ctl) { | 1886 | if (kbdbl_ctl && handle == kbdbl_ctl->handle) { |
1887 | device_remove_file(&pd->dev, &kbdbl_ctl->mode_attr); | 1887 | device_remove_file(&pd->dev, &kbdbl_ctl->mode_attr); |
1888 | device_remove_file(&pd->dev, &kbdbl_ctl->timeout_attr); | 1888 | device_remove_file(&pd->dev, &kbdbl_ctl->timeout_attr); |
1889 | kfree(kbdbl_ctl); | 1889 | kfree(kbdbl_ctl); |
@@ -1891,25 +1891,6 @@ static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd) | |||
1891 | } | 1891 | } |
1892 | } | 1892 | } |
1893 | 1893 | ||
1894 | #ifdef CONFIG_PM_SLEEP | ||
1895 | static void sony_nc_kbd_backlight_resume(void) | ||
1896 | { | ||
1897 | int ignore = 0; | ||
1898 | |||
1899 | if (!kbdbl_ctl) | ||
1900 | return; | ||
1901 | |||
1902 | if (kbdbl_ctl->mode == 0) | ||
1903 | sony_call_snc_handle(kbdbl_ctl->handle, kbdbl_ctl->base, | ||
1904 | &ignore); | ||
1905 | |||
1906 | if (kbdbl_ctl->timeout != 0) | ||
1907 | sony_call_snc_handle(kbdbl_ctl->handle, | ||
1908 | (kbdbl_ctl->base + 0x200) | | ||
1909 | (kbdbl_ctl->timeout << 0x10), &ignore); | ||
1910 | } | ||
1911 | #endif | ||
1912 | |||
1913 | struct battery_care_control { | 1894 | struct battery_care_control { |
1914 | struct device_attribute attrs[2]; | 1895 | struct device_attribute attrs[2]; |
1915 | unsigned int handle; | 1896 | unsigned int handle; |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 05e046aa5e31..58b0274d24cc 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -6438,7 +6438,12 @@ static struct ibm_struct brightness_driver_data = { | |||
6438 | #define TPACPI_ALSA_SHRTNAME "ThinkPad Console Audio Control" | 6438 | #define TPACPI_ALSA_SHRTNAME "ThinkPad Console Audio Control" |
6439 | #define TPACPI_ALSA_MIXERNAME TPACPI_ALSA_SHRTNAME | 6439 | #define TPACPI_ALSA_MIXERNAME TPACPI_ALSA_SHRTNAME |
6440 | 6440 | ||
6441 | static int alsa_index = ~((1 << (SNDRV_CARDS - 3)) - 1); /* last three slots */ | 6441 | #if SNDRV_CARDS <= 32 |
6442 | #define DEFAULT_ALSA_IDX ~((1 << (SNDRV_CARDS - 3)) - 1) | ||
6443 | #else | ||
6444 | #define DEFAULT_ALSA_IDX ~((1 << (32 - 3)) - 1) | ||
6445 | #endif | ||
6446 | static int alsa_index = DEFAULT_ALSA_IDX; /* last three slots */ | ||
6442 | static char *alsa_id = "ThinkPadEC"; | 6447 | static char *alsa_id = "ThinkPadEC"; |
6443 | static bool alsa_enable = SNDRV_DEFAULT_ENABLE1; | 6448 | static bool alsa_enable = SNDRV_DEFAULT_ENABLE1; |
6444 | 6449 | ||
@@ -9163,7 +9168,6 @@ static int __init thinkpad_acpi_module_init(void) | |||
9163 | mutex_init(&tpacpi_inputdev_send_mutex); | 9168 | mutex_init(&tpacpi_inputdev_send_mutex); |
9164 | tpacpi_inputdev = input_allocate_device(); | 9169 | tpacpi_inputdev = input_allocate_device(); |
9165 | if (!tpacpi_inputdev) { | 9170 | if (!tpacpi_inputdev) { |
9166 | pr_err("unable to allocate input device\n"); | ||
9167 | thinkpad_acpi_module_exit(); | 9171 | thinkpad_acpi_module_exit(); |
9168 | return -ENOMEM; | 9172 | return -ENOMEM; |
9169 | } else { | 9173 | } else { |
diff --git a/drivers/platform/x86/topstar-laptop.c b/drivers/platform/x86/topstar-laptop.c index 67897c8740ba..e597de05e6c2 100644 --- a/drivers/platform/x86/topstar-laptop.c +++ b/drivers/platform/x86/topstar-laptop.c | |||
@@ -97,10 +97,8 @@ static int acpi_topstar_init_hkey(struct topstar_hkey *hkey) | |||
97 | int error; | 97 | int error; |
98 | 98 | ||
99 | input = input_allocate_device(); | 99 | input = input_allocate_device(); |
100 | if (!input) { | 100 | if (!input) |
101 | pr_err("Unable to allocate input device\n"); | ||
102 | return -ENOMEM; | 101 | return -ENOMEM; |
103 | } | ||
104 | 102 | ||
105 | input->name = "Topstar Laptop extra buttons"; | 103 | input->name = "Topstar Laptop extra buttons"; |
106 | input->phys = "topstar/input0"; | 104 | input->phys = "topstar/input0"; |
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 0cfadb65f7c6..7fce391818d3 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
@@ -975,10 +975,8 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) | |||
975 | u32 hci_result; | 975 | u32 hci_result; |
976 | 976 | ||
977 | dev->hotkey_dev = input_allocate_device(); | 977 | dev->hotkey_dev = input_allocate_device(); |
978 | if (!dev->hotkey_dev) { | 978 | if (!dev->hotkey_dev) |
979 | pr_info("Unable to register input device\n"); | ||
980 | return -ENOMEM; | 979 | return -ENOMEM; |
981 | } | ||
982 | 980 | ||
983 | dev->hotkey_dev->name = "Toshiba input device"; | 981 | dev->hotkey_dev->name = "Toshiba input device"; |
984 | dev->hotkey_dev->phys = "toshiba_acpi/input0"; | 982 | dev->hotkey_dev->phys = "toshiba_acpi/input0"; |
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 62e8c221d01e..c2e7b2657aeb 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c | |||
@@ -672,8 +672,10 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, | |||
672 | struct wmi_block *wblock; | 672 | struct wmi_block *wblock; |
673 | 673 | ||
674 | wblock = dev_get_drvdata(dev); | 674 | wblock = dev_get_drvdata(dev); |
675 | if (!wblock) | 675 | if (!wblock) { |
676 | return -ENOMEM; | 676 | strcat(buf, "\n"); |
677 | return strlen(buf); | ||
678 | } | ||
677 | 679 | ||
678 | wmi_gtoa(wblock->gblock.guid, guid_string); | 680 | wmi_gtoa(wblock->gblock.guid, guid_string); |
679 | 681 | ||
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 6936e0acedcd..f748cc8cbb03 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c | |||
@@ -197,6 +197,11 @@ static int pnp_bus_freeze(struct device *dev) | |||
197 | return __pnp_bus_suspend(dev, PMSG_FREEZE); | 197 | return __pnp_bus_suspend(dev, PMSG_FREEZE); |
198 | } | 198 | } |
199 | 199 | ||
200 | static int pnp_bus_poweroff(struct device *dev) | ||
201 | { | ||
202 | return __pnp_bus_suspend(dev, PMSG_HIBERNATE); | ||
203 | } | ||
204 | |||
200 | static int pnp_bus_resume(struct device *dev) | 205 | static int pnp_bus_resume(struct device *dev) |
201 | { | 206 | { |
202 | struct pnp_dev *pnp_dev = to_pnp_dev(dev); | 207 | struct pnp_dev *pnp_dev = to_pnp_dev(dev); |
@@ -234,9 +239,14 @@ static int pnp_bus_resume(struct device *dev) | |||
234 | } | 239 | } |
235 | 240 | ||
236 | static const struct dev_pm_ops pnp_bus_dev_pm_ops = { | 241 | static const struct dev_pm_ops pnp_bus_dev_pm_ops = { |
242 | /* Suspend callbacks */ | ||
237 | .suspend = pnp_bus_suspend, | 243 | .suspend = pnp_bus_suspend, |
238 | .freeze = pnp_bus_freeze, | ||
239 | .resume = pnp_bus_resume, | 244 | .resume = pnp_bus_resume, |
245 | /* Hibernate callbacks */ | ||
246 | .freeze = pnp_bus_freeze, | ||
247 | .thaw = pnp_bus_resume, | ||
248 | .poweroff = pnp_bus_poweroff, | ||
249 | .restore = pnp_bus_resume, | ||
240 | }; | 250 | }; |
241 | 251 | ||
242 | struct bus_type pnp_bus_type = { | 252 | struct bus_type pnp_bus_type = { |
diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c index 8d0fe431dbdd..84419af16f77 100644 --- a/drivers/powercap/powercap_sys.c +++ b/drivers/powercap/powercap_sys.c | |||
@@ -377,9 +377,14 @@ static void create_power_zone_common_attributes( | |||
377 | if (power_zone->ops->get_max_energy_range_uj) | 377 | if (power_zone->ops->get_max_energy_range_uj) |
378 | power_zone->zone_dev_attrs[count++] = | 378 | power_zone->zone_dev_attrs[count++] = |
379 | &dev_attr_max_energy_range_uj.attr; | 379 | &dev_attr_max_energy_range_uj.attr; |
380 | if (power_zone->ops->get_energy_uj) | 380 | if (power_zone->ops->get_energy_uj) { |
381 | if (power_zone->ops->reset_energy_uj) | ||
382 | dev_attr_energy_uj.attr.mode = S_IWUSR | S_IRUGO; | ||
383 | else | ||
384 | dev_attr_energy_uj.attr.mode = S_IRUGO; | ||
381 | power_zone->zone_dev_attrs[count++] = | 385 | power_zone->zone_dev_attrs[count++] = |
382 | &dev_attr_energy_uj.attr; | 386 | &dev_attr_energy_uj.attr; |
387 | } | ||
383 | if (power_zone->ops->get_power_uw) | 388 | if (power_zone->ops->get_power_uw) |
384 | power_zone->zone_dev_attrs[count++] = | 389 | power_zone->zone_dev_attrs[count++] = |
385 | &dev_attr_power_uw.attr; | 390 | &dev_attr_power_uw.attr; |
diff --git a/drivers/regulator/arizona-micsupp.c b/drivers/regulator/arizona-micsupp.c index 724706a97dc4..fd3154d86901 100644 --- a/drivers/regulator/arizona-micsupp.c +++ b/drivers/regulator/arizona-micsupp.c | |||
@@ -174,6 +174,33 @@ static const struct regulator_desc arizona_micsupp = { | |||
174 | .owner = THIS_MODULE, | 174 | .owner = THIS_MODULE, |
175 | }; | 175 | }; |
176 | 176 | ||
177 | static const struct regulator_linear_range arizona_micsupp_ext_ranges[] = { | ||
178 | REGULATOR_LINEAR_RANGE(900000, 0, 0x14, 25000), | ||
179 | REGULATOR_LINEAR_RANGE(1500000, 0x15, 0x27, 100000), | ||
180 | }; | ||
181 | |||
182 | static const struct regulator_desc arizona_micsupp_ext = { | ||
183 | .name = "MICVDD", | ||
184 | .supply_name = "CPVDD", | ||
185 | .type = REGULATOR_VOLTAGE, | ||
186 | .n_voltages = 40, | ||
187 | .ops = &arizona_micsupp_ops, | ||
188 | |||
189 | .vsel_reg = ARIZONA_LDO2_CONTROL_1, | ||
190 | .vsel_mask = ARIZONA_LDO2_VSEL_MASK, | ||
191 | .enable_reg = ARIZONA_MIC_CHARGE_PUMP_1, | ||
192 | .enable_mask = ARIZONA_CPMIC_ENA, | ||
193 | .bypass_reg = ARIZONA_MIC_CHARGE_PUMP_1, | ||
194 | .bypass_mask = ARIZONA_CPMIC_BYPASS, | ||
195 | |||
196 | .linear_ranges = arizona_micsupp_ext_ranges, | ||
197 | .n_linear_ranges = ARRAY_SIZE(arizona_micsupp_ext_ranges), | ||
198 | |||
199 | .enable_time = 3000, | ||
200 | |||
201 | .owner = THIS_MODULE, | ||
202 | }; | ||
203 | |||
177 | static const struct regulator_init_data arizona_micsupp_default = { | 204 | static const struct regulator_init_data arizona_micsupp_default = { |
178 | .constraints = { | 205 | .constraints = { |
179 | .valid_ops_mask = REGULATOR_CHANGE_STATUS | | 206 | .valid_ops_mask = REGULATOR_CHANGE_STATUS | |
@@ -186,9 +213,22 @@ static const struct regulator_init_data arizona_micsupp_default = { | |||
186 | .num_consumer_supplies = 1, | 213 | .num_consumer_supplies = 1, |
187 | }; | 214 | }; |
188 | 215 | ||
216 | static const struct regulator_init_data arizona_micsupp_ext_default = { | ||
217 | .constraints = { | ||
218 | .valid_ops_mask = REGULATOR_CHANGE_STATUS | | ||
219 | REGULATOR_CHANGE_VOLTAGE | | ||
220 | REGULATOR_CHANGE_BYPASS, | ||
221 | .min_uV = 900000, | ||
222 | .max_uV = 3300000, | ||
223 | }, | ||
224 | |||
225 | .num_consumer_supplies = 1, | ||
226 | }; | ||
227 | |||
189 | static int arizona_micsupp_probe(struct platform_device *pdev) | 228 | static int arizona_micsupp_probe(struct platform_device *pdev) |
190 | { | 229 | { |
191 | struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); | 230 | struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); |
231 | const struct regulator_desc *desc; | ||
192 | struct regulator_config config = { }; | 232 | struct regulator_config config = { }; |
193 | struct arizona_micsupp *micsupp; | 233 | struct arizona_micsupp *micsupp; |
194 | int ret; | 234 | int ret; |
@@ -207,7 +247,17 @@ static int arizona_micsupp_probe(struct platform_device *pdev) | |||
207 | * default init_data for it. This will be overridden with | 247 | * default init_data for it. This will be overridden with |
208 | * platform data if provided. | 248 | * platform data if provided. |
209 | */ | 249 | */ |
210 | micsupp->init_data = arizona_micsupp_default; | 250 | switch (arizona->type) { |
251 | case WM5110: | ||
252 | desc = &arizona_micsupp_ext; | ||
253 | micsupp->init_data = arizona_micsupp_ext_default; | ||
254 | break; | ||
255 | default: | ||
256 | desc = &arizona_micsupp; | ||
257 | micsupp->init_data = arizona_micsupp_default; | ||
258 | break; | ||
259 | } | ||
260 | |||
211 | micsupp->init_data.consumer_supplies = &micsupp->supply; | 261 | micsupp->init_data.consumer_supplies = &micsupp->supply; |
212 | micsupp->supply.supply = "MICVDD"; | 262 | micsupp->supply.supply = "MICVDD"; |
213 | micsupp->supply.dev_name = dev_name(arizona->dev); | 263 | micsupp->supply.dev_name = dev_name(arizona->dev); |
@@ -226,7 +276,7 @@ static int arizona_micsupp_probe(struct platform_device *pdev) | |||
226 | ARIZONA_CPMIC_BYPASS, 0); | 276 | ARIZONA_CPMIC_BYPASS, 0); |
227 | 277 | ||
228 | micsupp->regulator = devm_regulator_register(&pdev->dev, | 278 | micsupp->regulator = devm_regulator_register(&pdev->dev, |
229 | &arizona_micsupp, | 279 | desc, |
230 | &config); | 280 | &config); |
231 | if (IS_ERR(micsupp->regulator)) { | 281 | if (IS_ERR(micsupp->regulator)) { |
232 | ret = PTR_ERR(micsupp->regulator); | 282 | ret = PTR_ERR(micsupp->regulator); |
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 6382f0af353b..3fe13130baec 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -2184,6 +2184,9 @@ int regulator_list_voltage(struct regulator *regulator, unsigned selector) | |||
2184 | struct regulator_ops *ops = rdev->desc->ops; | 2184 | struct regulator_ops *ops = rdev->desc->ops; |
2185 | int ret; | 2185 | int ret; |
2186 | 2186 | ||
2187 | if (rdev->desc->fixed_uV && rdev->desc->n_voltages == 1 && !selector) | ||
2188 | return rdev->desc->fixed_uV; | ||
2189 | |||
2187 | if (!ops->list_voltage || selector >= rdev->desc->n_voltages) | 2190 | if (!ops->list_voltage || selector >= rdev->desc->n_voltages) |
2188 | return -EINVAL; | 2191 | return -EINVAL; |
2189 | 2192 | ||
diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index 04406a918c04..234960dc9607 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c | |||
@@ -139,6 +139,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np) | |||
139 | struct property *prop; | 139 | struct property *prop; |
140 | const char *regtype; | 140 | const char *regtype; |
141 | int proplen, gpio, i; | 141 | int proplen, gpio, i; |
142 | int ret; | ||
142 | 143 | ||
143 | config = devm_kzalloc(dev, | 144 | config = devm_kzalloc(dev, |
144 | sizeof(struct gpio_regulator_config), | 145 | sizeof(struct gpio_regulator_config), |
@@ -202,7 +203,11 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np) | |||
202 | } | 203 | } |
203 | config->nr_states = i; | 204 | config->nr_states = i; |
204 | 205 | ||
205 | of_property_read_string(np, "regulator-type", ®type); | 206 | ret = of_property_read_string(np, "regulator-type", ®type); |
207 | if (ret < 0) { | ||
208 | dev_err(dev, "Missing 'regulator-type' property\n"); | ||
209 | return ERR_PTR(-EINVAL); | ||
210 | } | ||
206 | 211 | ||
207 | if (!strncmp("voltage", regtype, 7)) | 212 | if (!strncmp("voltage", regtype, 7)) |
208 | config->type = REGULATOR_VOLTAGE; | 213 | config->type = REGULATOR_VOLTAGE; |
diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c index ba67b2c4e2e7..032df3799efb 100644 --- a/drivers/regulator/pfuze100-regulator.c +++ b/drivers/regulator/pfuze100-regulator.c | |||
@@ -308,9 +308,15 @@ static int pfuze_identify(struct pfuze_chip *pfuze_chip) | |||
308 | if (ret) | 308 | if (ret) |
309 | return ret; | 309 | return ret; |
310 | 310 | ||
311 | if (value & 0x0f) { | 311 | switch (value & 0x0f) { |
312 | dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value); | 312 | /* Freescale misprogrammed 1-3% of parts prior to week 8 of 2013 as ID=8 */ |
313 | return -ENODEV; | 313 | case 0x8: |
314 | dev_info(pfuze_chip->dev, "Assuming misprogrammed ID=0x8"); | ||
315 | case 0x0: | ||
316 | break; | ||
317 | default: | ||
318 | dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value); | ||
319 | return -ENODEV; | ||
314 | } | 320 | } |
315 | 321 | ||
316 | ret = regmap_read(pfuze_chip->regmap, PFUZE100_REVID, &value); | 322 | ret = regmap_read(pfuze_chip->regmap, PFUZE100_REVID, &value); |
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index cee7e2708a1f..95e45782692f 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
@@ -3224,6 +3224,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev, | |||
3224 | 3224 | ||
3225 | fcx_multitrack = private->features.feature[40] & 0x20; | 3225 | fcx_multitrack = private->features.feature[40] & 0x20; |
3226 | data_size = blk_rq_bytes(req); | 3226 | data_size = blk_rq_bytes(req); |
3227 | if (data_size % blksize) | ||
3228 | return ERR_PTR(-EINVAL); | ||
3227 | /* tpm write request add CBC data on each track boundary */ | 3229 | /* tpm write request add CBC data on each track boundary */ |
3228 | if (rq_data_dir(req) == WRITE) | 3230 | if (rq_data_dir(req) == WRITE) |
3229 | data_size += (last_trk - first_trk) * 4; | 3231 | data_size += (last_trk - first_trk) * 4; |
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index 5e1e12c0cf42..0a7325361d29 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c | |||
@@ -2025,7 +2025,8 @@ static struct scsi_host_template driver_template = { | |||
2025 | .cmd_per_lun = TW_MAX_CMDS_PER_LUN, | 2025 | .cmd_per_lun = TW_MAX_CMDS_PER_LUN, |
2026 | .use_clustering = ENABLE_CLUSTERING, | 2026 | .use_clustering = ENABLE_CLUSTERING, |
2027 | .shost_attrs = twa_host_attrs, | 2027 | .shost_attrs = twa_host_attrs, |
2028 | .emulated = 1 | 2028 | .emulated = 1, |
2029 | .no_write_same = 1, | ||
2029 | }; | 2030 | }; |
2030 | 2031 | ||
2031 | /* This function will probe and initialize a card */ | 2032 | /* This function will probe and initialize a card */ |
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index c845bdbeb6c0..4de346017e9f 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c | |||
@@ -1600,7 +1600,8 @@ static struct scsi_host_template driver_template = { | |||
1600 | .cmd_per_lun = TW_MAX_CMDS_PER_LUN, | 1600 | .cmd_per_lun = TW_MAX_CMDS_PER_LUN, |
1601 | .use_clustering = ENABLE_CLUSTERING, | 1601 | .use_clustering = ENABLE_CLUSTERING, |
1602 | .shost_attrs = twl_host_attrs, | 1602 | .shost_attrs = twl_host_attrs, |
1603 | .emulated = 1 | 1603 | .emulated = 1, |
1604 | .no_write_same = 1, | ||
1604 | }; | 1605 | }; |
1605 | 1606 | ||
1606 | /* This function will probe and initialize a card */ | 1607 | /* This function will probe and initialize a card */ |
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index b9276d10b25c..752624e6bc00 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c | |||
@@ -2279,7 +2279,8 @@ static struct scsi_host_template driver_template = { | |||
2279 | .cmd_per_lun = TW_MAX_CMDS_PER_LUN, | 2279 | .cmd_per_lun = TW_MAX_CMDS_PER_LUN, |
2280 | .use_clustering = ENABLE_CLUSTERING, | 2280 | .use_clustering = ENABLE_CLUSTERING, |
2281 | .shost_attrs = tw_host_attrs, | 2281 | .shost_attrs = tw_host_attrs, |
2282 | .emulated = 1 | 2282 | .emulated = 1, |
2283 | .no_write_same = 1, | ||
2283 | }; | 2284 | }; |
2284 | 2285 | ||
2285 | /* This function will probe and initialize a card */ | 2286 | /* This function will probe and initialize a card */ |
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index f0d432c139d0..4921ed19a027 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
@@ -1081,6 +1081,7 @@ static struct scsi_host_template aac_driver_template = { | |||
1081 | #endif | 1081 | #endif |
1082 | .use_clustering = ENABLE_CLUSTERING, | 1082 | .use_clustering = ENABLE_CLUSTERING, |
1083 | .emulated = 1, | 1083 | .emulated = 1, |
1084 | .no_write_same = 1, | ||
1084 | }; | 1085 | }; |
1085 | 1086 | ||
1086 | static void __aac_shutdown(struct aac_dev * aac) | 1087 | static void __aac_shutdown(struct aac_dev * aac) |
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index 97fd450aff09..4f6a30b8e5f9 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c | |||
@@ -137,6 +137,7 @@ static struct scsi_host_template arcmsr_scsi_host_template = { | |||
137 | .cmd_per_lun = ARCMSR_MAX_CMD_PERLUN, | 137 | .cmd_per_lun = ARCMSR_MAX_CMD_PERLUN, |
138 | .use_clustering = ENABLE_CLUSTERING, | 138 | .use_clustering = ENABLE_CLUSTERING, |
139 | .shost_attrs = arcmsr_host_attrs, | 139 | .shost_attrs = arcmsr_host_attrs, |
140 | .no_write_same = 1, | ||
140 | }; | 141 | }; |
141 | static struct pci_device_id arcmsr_device_id_table[] = { | 142 | static struct pci_device_id arcmsr_device_id_table[] = { |
142 | {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1110)}, | 143 | {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1110)}, |
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h index 94d5d0102f7d..42bcb970445a 100644 --- a/drivers/scsi/bfa/bfa_fcs.h +++ b/drivers/scsi/bfa/bfa_fcs.h | |||
@@ -296,6 +296,7 @@ wwn_t bfa_fcs_lport_get_rport(struct bfa_fcs_lport_s *port, wwn_t wwn, | |||
296 | struct bfa_fcs_lport_s *bfa_fcs_lookup_port(struct bfa_fcs_s *fcs, | 296 | struct bfa_fcs_lport_s *bfa_fcs_lookup_port(struct bfa_fcs_s *fcs, |
297 | u16 vf_id, wwn_t lpwwn); | 297 | u16 vf_id, wwn_t lpwwn); |
298 | 298 | ||
299 | void bfa_fcs_lport_set_symname(struct bfa_fcs_lport_s *port, char *symname); | ||
299 | void bfa_fcs_lport_get_info(struct bfa_fcs_lport_s *port, | 300 | void bfa_fcs_lport_get_info(struct bfa_fcs_lport_s *port, |
300 | struct bfa_lport_info_s *port_info); | 301 | struct bfa_lport_info_s *port_info); |
301 | void bfa_fcs_lport_get_attr(struct bfa_fcs_lport_s *port, | 302 | void bfa_fcs_lport_get_attr(struct bfa_fcs_lport_s *port, |
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c index 2f61a5af3658..f5e4e61a0fd7 100644 --- a/drivers/scsi/bfa/bfa_fcs_lport.c +++ b/drivers/scsi/bfa/bfa_fcs_lport.c | |||
@@ -1097,6 +1097,17 @@ bfa_fcs_lport_init(struct bfa_fcs_lport_s *lport, | |||
1097 | bfa_sm_send_event(lport, BFA_FCS_PORT_SM_CREATE); | 1097 | bfa_sm_send_event(lport, BFA_FCS_PORT_SM_CREATE); |
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | void | ||
1101 | bfa_fcs_lport_set_symname(struct bfa_fcs_lport_s *port, | ||
1102 | char *symname) | ||
1103 | { | ||
1104 | strcpy(port->port_cfg.sym_name.symname, symname); | ||
1105 | |||
1106 | if (bfa_sm_cmp_state(port, bfa_fcs_lport_sm_online)) | ||
1107 | bfa_fcs_lport_ns_util_send_rspn_id( | ||
1108 | BFA_FCS_GET_NS_FROM_PORT(port), NULL); | ||
1109 | } | ||
1110 | |||
1100 | /* | 1111 | /* |
1101 | * fcs_lport_api | 1112 | * fcs_lport_api |
1102 | */ | 1113 | */ |
@@ -5140,9 +5151,6 @@ bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg, struct bfa_fcxp_s *fcxp_alloced) | |||
5140 | u8 *psymbl = &symbl[0]; | 5151 | u8 *psymbl = &symbl[0]; |
5141 | int len; | 5152 | int len; |
5142 | 5153 | ||
5143 | if (!bfa_sm_cmp_state(port, bfa_fcs_lport_sm_online)) | ||
5144 | return; | ||
5145 | |||
5146 | /* Avoid sending RSPN in the following states. */ | 5154 | /* Avoid sending RSPN in the following states. */ |
5147 | if (bfa_sm_cmp_state(ns, bfa_fcs_lport_ns_sm_offline) || | 5155 | if (bfa_sm_cmp_state(ns, bfa_fcs_lport_ns_sm_offline) || |
5148 | bfa_sm_cmp_state(ns, bfa_fcs_lport_ns_sm_plogi_sending) || | 5156 | bfa_sm_cmp_state(ns, bfa_fcs_lport_ns_sm_plogi_sending) || |
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c index e9a681d31223..40be670a1cbc 100644 --- a/drivers/scsi/bfa/bfad_attr.c +++ b/drivers/scsi/bfa/bfad_attr.c | |||
@@ -593,11 +593,8 @@ bfad_im_vport_set_symbolic_name(struct fc_vport *fc_vport) | |||
593 | return; | 593 | return; |
594 | 594 | ||
595 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 595 | spin_lock_irqsave(&bfad->bfad_lock, flags); |
596 | if (strlen(sym_name) > 0) { | 596 | if (strlen(sym_name) > 0) |
597 | strcpy(fcs_vport->lport.port_cfg.sym_name.symname, sym_name); | 597 | bfa_fcs_lport_set_symname(&fcs_vport->lport, sym_name); |
598 | bfa_fcs_lport_ns_util_send_rspn_id( | ||
599 | BFA_FCS_GET_NS_FROM_PORT((&fcs_vport->lport)), NULL); | ||
600 | } | ||
601 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 598 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
602 | } | 599 | } |
603 | 600 | ||
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index ee4fa40a50b1..ce5ef0190bad 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c | |||
@@ -4684,6 +4684,7 @@ static struct scsi_host_template gdth_template = { | |||
4684 | .cmd_per_lun = GDTH_MAXC_P_L, | 4684 | .cmd_per_lun = GDTH_MAXC_P_L, |
4685 | .unchecked_isa_dma = 1, | 4685 | .unchecked_isa_dma = 1, |
4686 | .use_clustering = ENABLE_CLUSTERING, | 4686 | .use_clustering = ENABLE_CLUSTERING, |
4687 | .no_write_same = 1, | ||
4687 | }; | 4688 | }; |
4688 | 4689 | ||
4689 | #ifdef CONFIG_ISA | 4690 | #ifdef CONFIG_ISA |
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index f334859024c0..f2c5005f312a 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -395,6 +395,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) | |||
395 | shost->use_clustering = sht->use_clustering; | 395 | shost->use_clustering = sht->use_clustering; |
396 | shost->ordered_tag = sht->ordered_tag; | 396 | shost->ordered_tag = sht->ordered_tag; |
397 | shost->eh_deadline = shost_eh_deadline * HZ; | 397 | shost->eh_deadline = shost_eh_deadline * HZ; |
398 | shost->no_write_same = sht->no_write_same; | ||
398 | 399 | ||
399 | if (sht->supported_mode == MODE_UNKNOWN) | 400 | if (sht->supported_mode == MODE_UNKNOWN) |
400 | /* means we didn't set it ... default to INITIATOR */ | 401 | /* means we didn't set it ... default to INITIATOR */ |
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 22f6432eb475..20a5e6ecf945 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -561,6 +561,7 @@ static struct scsi_host_template hpsa_driver_template = { | |||
561 | .sdev_attrs = hpsa_sdev_attrs, | 561 | .sdev_attrs = hpsa_sdev_attrs, |
562 | .shost_attrs = hpsa_shost_attrs, | 562 | .shost_attrs = hpsa_shost_attrs, |
563 | .max_sectors = 8192, | 563 | .max_sectors = 8192, |
564 | .no_write_same = 1, | ||
564 | }; | 565 | }; |
565 | 566 | ||
566 | 567 | ||
@@ -1288,7 +1289,7 @@ static void complete_scsi_command(struct CommandList *cp) | |||
1288 | "has check condition: aborted command: " | 1289 | "has check condition: aborted command: " |
1289 | "ASC: 0x%x, ASCQ: 0x%x\n", | 1290 | "ASC: 0x%x, ASCQ: 0x%x\n", |
1290 | cp, asc, ascq); | 1291 | cp, asc, ascq); |
1291 | cmd->result = DID_SOFT_ERROR << 16; | 1292 | cmd->result |= DID_SOFT_ERROR << 16; |
1292 | break; | 1293 | break; |
1293 | } | 1294 | } |
1294 | /* Must be some other type of check condition */ | 1295 | /* Must be some other type of check condition */ |
@@ -4925,7 +4926,7 @@ reinit_after_soft_reset: | |||
4925 | hpsa_hba_inquiry(h); | 4926 | hpsa_hba_inquiry(h); |
4926 | hpsa_register_scsi(h); /* hook ourselves into SCSI subsystem */ | 4927 | hpsa_register_scsi(h); /* hook ourselves into SCSI subsystem */ |
4927 | start_controller_lockup_detector(h); | 4928 | start_controller_lockup_detector(h); |
4928 | return 1; | 4929 | return 0; |
4929 | 4930 | ||
4930 | clean4: | 4931 | clean4: |
4931 | hpsa_free_sg_chain_blocks(h); | 4932 | hpsa_free_sg_chain_blocks(h); |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 36ac1c34ce97..573f4128b6b6 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -6305,7 +6305,8 @@ static struct scsi_host_template driver_template = { | |||
6305 | .use_clustering = ENABLE_CLUSTERING, | 6305 | .use_clustering = ENABLE_CLUSTERING, |
6306 | .shost_attrs = ipr_ioa_attrs, | 6306 | .shost_attrs = ipr_ioa_attrs, |
6307 | .sdev_attrs = ipr_dev_attrs, | 6307 | .sdev_attrs = ipr_dev_attrs, |
6308 | .proc_name = IPR_NAME | 6308 | .proc_name = IPR_NAME, |
6309 | .no_write_same = 1, | ||
6309 | }; | 6310 | }; |
6310 | 6311 | ||
6311 | /** | 6312 | /** |
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 8d5ea8a1e5a6..52a216f21ae5 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c | |||
@@ -374,6 +374,7 @@ static struct scsi_host_template ips_driver_template = { | |||
374 | .sg_tablesize = IPS_MAX_SG, | 374 | .sg_tablesize = IPS_MAX_SG, |
375 | .cmd_per_lun = 3, | 375 | .cmd_per_lun = 3, |
376 | .use_clustering = ENABLE_CLUSTERING, | 376 | .use_clustering = ENABLE_CLUSTERING, |
377 | .no_write_same = 1, | ||
377 | }; | 378 | }; |
378 | 379 | ||
379 | 380 | ||
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 161c98efade9..d2895836f9fa 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
@@ -211,7 +211,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) | |||
211 | qc->tf.nsect = 0; | 211 | qc->tf.nsect = 0; |
212 | } | 212 | } |
213 | 213 | ||
214 | ata_tf_to_fis(&qc->tf, 1, 0, (u8*)&task->ata_task.fis); | 214 | ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, (u8 *)&task->ata_task.fis); |
215 | task->uldd_task = qc; | 215 | task->uldd_task = qc; |
216 | if (ata_is_atapi(qc->tf.protocol)) { | 216 | if (ata_is_atapi(qc->tf.protocol)) { |
217 | memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); | 217 | memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); |
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 90c95a3385d1..816db12ef5d5 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c | |||
@@ -4244,6 +4244,7 @@ static struct scsi_host_template megaraid_template = { | |||
4244 | .eh_device_reset_handler = megaraid_reset, | 4244 | .eh_device_reset_handler = megaraid_reset, |
4245 | .eh_bus_reset_handler = megaraid_reset, | 4245 | .eh_bus_reset_handler = megaraid_reset, |
4246 | .eh_host_reset_handler = megaraid_reset, | 4246 | .eh_host_reset_handler = megaraid_reset, |
4247 | .no_write_same = 1, | ||
4247 | }; | 4248 | }; |
4248 | 4249 | ||
4249 | static int | 4250 | static int |
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index d1a4b82836ea..e2237a97cb9d 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c | |||
@@ -367,6 +367,7 @@ static struct scsi_host_template megaraid_template_g = { | |||
367 | .eh_host_reset_handler = megaraid_reset_handler, | 367 | .eh_host_reset_handler = megaraid_reset_handler, |
368 | .change_queue_depth = megaraid_change_queue_depth, | 368 | .change_queue_depth = megaraid_change_queue_depth, |
369 | .use_clustering = ENABLE_CLUSTERING, | 369 | .use_clustering = ENABLE_CLUSTERING, |
370 | .no_write_same = 1, | ||
370 | .sdev_attrs = megaraid_sdev_attrs, | 371 | .sdev_attrs = megaraid_sdev_attrs, |
371 | .shost_attrs = megaraid_shost_attrs, | 372 | .shost_attrs = megaraid_shost_attrs, |
372 | }; | 373 | }; |
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 0a743a5d1647..c99812bf2a73 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c | |||
@@ -2148,6 +2148,7 @@ static struct scsi_host_template megasas_template = { | |||
2148 | .bios_param = megasas_bios_param, | 2148 | .bios_param = megasas_bios_param, |
2149 | .use_clustering = ENABLE_CLUSTERING, | 2149 | .use_clustering = ENABLE_CLUSTERING, |
2150 | .change_queue_depth = megasas_change_queue_depth, | 2150 | .change_queue_depth = megasas_change_queue_depth, |
2151 | .no_write_same = 1, | ||
2151 | }; | 2152 | }; |
2152 | 2153 | ||
2153 | /** | 2154 | /** |
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index f16ece91b94a..0a1296a87d66 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c | |||
@@ -3403,6 +3403,7 @@ hw_event_sas_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb) | |||
3403 | unsigned long flags; | 3403 | unsigned long flags; |
3404 | u8 deviceType = pPayload->sas_identify.dev_type; | 3404 | u8 deviceType = pPayload->sas_identify.dev_type; |
3405 | port->port_state = portstate; | 3405 | port->port_state = portstate; |
3406 | phy->phy_state = PHY_STATE_LINK_UP_SPC; | ||
3406 | PM8001_MSG_DBG(pm8001_ha, | 3407 | PM8001_MSG_DBG(pm8001_ha, |
3407 | pm8001_printk("HW_EVENT_SAS_PHY_UP port id = %d, phy id = %d\n", | 3408 | pm8001_printk("HW_EVENT_SAS_PHY_UP port id = %d, phy id = %d\n", |
3408 | port_id, phy_id)); | 3409 | port_id, phy_id)); |
@@ -3483,6 +3484,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb) | |||
3483 | pm8001_printk("HW_EVENT_SATA_PHY_UP port id = %d," | 3484 | pm8001_printk("HW_EVENT_SATA_PHY_UP port id = %d," |
3484 | " phy id = %d\n", port_id, phy_id)); | 3485 | " phy id = %d\n", port_id, phy_id)); |
3485 | port->port_state = portstate; | 3486 | port->port_state = portstate; |
3487 | phy->phy_state = PHY_STATE_LINK_UP_SPC; | ||
3486 | port->port_attached = 1; | 3488 | port->port_attached = 1; |
3487 | pm8001_get_lrate_mode(phy, link_rate); | 3489 | pm8001_get_lrate_mode(phy, link_rate); |
3488 | phy->phy_type |= PORT_TYPE_SATA; | 3490 | phy->phy_type |= PORT_TYPE_SATA; |
diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h index 6d91e2446542..e4867e690c84 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.h +++ b/drivers/scsi/pm8001/pm8001_hwi.h | |||
@@ -131,6 +131,10 @@ | |||
131 | #define LINKRATE_30 (0x02 << 8) | 131 | #define LINKRATE_30 (0x02 << 8) |
132 | #define LINKRATE_60 (0x04 << 8) | 132 | #define LINKRATE_60 (0x04 << 8) |
133 | 133 | ||
134 | /* for phy state */ | ||
135 | |||
136 | #define PHY_STATE_LINK_UP_SPC 0x1 | ||
137 | |||
134 | /* for new SPC controllers MEMBASE III is shared between BIOS and DATA */ | 138 | /* for new SPC controllers MEMBASE III is shared between BIOS and DATA */ |
135 | #define GSM_SM_BASE 0x4F0000 | 139 | #define GSM_SM_BASE 0x4F0000 |
136 | struct mpi_msg_hdr{ | 140 | struct mpi_msg_hdr{ |
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 34f5f5ffef05..73a120d81b4d 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c | |||
@@ -175,20 +175,16 @@ static void pm8001_free(struct pm8001_hba_info *pm8001_ha) | |||
175 | static void pm8001_tasklet(unsigned long opaque) | 175 | static void pm8001_tasklet(unsigned long opaque) |
176 | { | 176 | { |
177 | struct pm8001_hba_info *pm8001_ha; | 177 | struct pm8001_hba_info *pm8001_ha; |
178 | u32 vec; | 178 | struct isr_param *irq_vector; |
179 | pm8001_ha = (struct pm8001_hba_info *)opaque; | 179 | |
180 | irq_vector = (struct isr_param *)opaque; | ||
181 | pm8001_ha = irq_vector->drv_inst; | ||
180 | if (unlikely(!pm8001_ha)) | 182 | if (unlikely(!pm8001_ha)) |
181 | BUG_ON(1); | 183 | BUG_ON(1); |
182 | vec = pm8001_ha->int_vector; | 184 | PM8001_CHIP_DISP->isr(pm8001_ha, irq_vector->irq_id); |
183 | PM8001_CHIP_DISP->isr(pm8001_ha, vec); | ||
184 | } | 185 | } |
185 | #endif | 186 | #endif |
186 | 187 | ||
187 | static struct pm8001_hba_info *outq_to_hba(u8 *outq) | ||
188 | { | ||
189 | return container_of((outq - *outq), struct pm8001_hba_info, outq[0]); | ||
190 | } | ||
191 | |||
192 | /** | 188 | /** |
193 | * pm8001_interrupt_handler_msix - main MSIX interrupt handler. | 189 | * pm8001_interrupt_handler_msix - main MSIX interrupt handler. |
194 | * It obtains the vector number and calls the equivalent bottom | 190 | * It obtains the vector number and calls the equivalent bottom |
@@ -198,18 +194,20 @@ static struct pm8001_hba_info *outq_to_hba(u8 *outq) | |||
198 | */ | 194 | */ |
199 | static irqreturn_t pm8001_interrupt_handler_msix(int irq, void *opaque) | 195 | static irqreturn_t pm8001_interrupt_handler_msix(int irq, void *opaque) |
200 | { | 196 | { |
201 | struct pm8001_hba_info *pm8001_ha = outq_to_hba(opaque); | 197 | struct isr_param *irq_vector; |
202 | u8 outq = *(u8 *)opaque; | 198 | struct pm8001_hba_info *pm8001_ha; |
203 | irqreturn_t ret = IRQ_HANDLED; | 199 | irqreturn_t ret = IRQ_HANDLED; |
200 | irq_vector = (struct isr_param *)opaque; | ||
201 | pm8001_ha = irq_vector->drv_inst; | ||
202 | |||
204 | if (unlikely(!pm8001_ha)) | 203 | if (unlikely(!pm8001_ha)) |
205 | return IRQ_NONE; | 204 | return IRQ_NONE; |
206 | if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha)) | 205 | if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha)) |
207 | return IRQ_NONE; | 206 | return IRQ_NONE; |
208 | pm8001_ha->int_vector = outq; | ||
209 | #ifdef PM8001_USE_TASKLET | 207 | #ifdef PM8001_USE_TASKLET |
210 | tasklet_schedule(&pm8001_ha->tasklet); | 208 | tasklet_schedule(&pm8001_ha->tasklet[irq_vector->irq_id]); |
211 | #else | 209 | #else |
212 | ret = PM8001_CHIP_DISP->isr(pm8001_ha, outq); | 210 | ret = PM8001_CHIP_DISP->isr(pm8001_ha, irq_vector->irq_id); |
213 | #endif | 211 | #endif |
214 | return ret; | 212 | return ret; |
215 | } | 213 | } |
@@ -230,9 +228,8 @@ static irqreturn_t pm8001_interrupt_handler_intx(int irq, void *dev_id) | |||
230 | if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha)) | 228 | if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha)) |
231 | return IRQ_NONE; | 229 | return IRQ_NONE; |
232 | 230 | ||
233 | pm8001_ha->int_vector = 0; | ||
234 | #ifdef PM8001_USE_TASKLET | 231 | #ifdef PM8001_USE_TASKLET |
235 | tasklet_schedule(&pm8001_ha->tasklet); | 232 | tasklet_schedule(&pm8001_ha->tasklet[0]); |
236 | #else | 233 | #else |
237 | ret = PM8001_CHIP_DISP->isr(pm8001_ha, 0); | 234 | ret = PM8001_CHIP_DISP->isr(pm8001_ha, 0); |
238 | #endif | 235 | #endif |
@@ -457,7 +454,7 @@ static struct pm8001_hba_info *pm8001_pci_alloc(struct pci_dev *pdev, | |||
457 | { | 454 | { |
458 | struct pm8001_hba_info *pm8001_ha; | 455 | struct pm8001_hba_info *pm8001_ha; |
459 | struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost); | 456 | struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost); |
460 | 457 | int j; | |
461 | 458 | ||
462 | pm8001_ha = sha->lldd_ha; | 459 | pm8001_ha = sha->lldd_ha; |
463 | if (!pm8001_ha) | 460 | if (!pm8001_ha) |
@@ -480,12 +477,14 @@ static struct pm8001_hba_info *pm8001_pci_alloc(struct pci_dev *pdev, | |||
480 | pm8001_ha->iomb_size = IOMB_SIZE_SPC; | 477 | pm8001_ha->iomb_size = IOMB_SIZE_SPC; |
481 | 478 | ||
482 | #ifdef PM8001_USE_TASKLET | 479 | #ifdef PM8001_USE_TASKLET |
483 | /** | 480 | /* Tasklet for non msi-x interrupt handler */ |
484 | * default tasklet for non msi-x interrupt handler/first msi-x | 481 | if ((!pdev->msix_cap) || (pm8001_ha->chip_id == chip_8001)) |
485 | * interrupt handler | 482 | tasklet_init(&pm8001_ha->tasklet[0], pm8001_tasklet, |
486 | **/ | 483 | (unsigned long)&(pm8001_ha->irq_vector[0])); |
487 | tasklet_init(&pm8001_ha->tasklet, pm8001_tasklet, | 484 | else |
488 | (unsigned long)pm8001_ha); | 485 | for (j = 0; j < PM8001_MAX_MSIX_VEC; j++) |
486 | tasklet_init(&pm8001_ha->tasklet[j], pm8001_tasklet, | ||
487 | (unsigned long)&(pm8001_ha->irq_vector[j])); | ||
489 | #endif | 488 | #endif |
490 | pm8001_ioremap(pm8001_ha); | 489 | pm8001_ioremap(pm8001_ha); |
491 | if (!pm8001_alloc(pm8001_ha, ent)) | 490 | if (!pm8001_alloc(pm8001_ha, ent)) |
@@ -733,19 +732,20 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha) | |||
733 | "pci_enable_msix request ret:%d no of intr %d\n", | 732 | "pci_enable_msix request ret:%d no of intr %d\n", |
734 | rc, pm8001_ha->number_of_intr)); | 733 | rc, pm8001_ha->number_of_intr)); |
735 | 734 | ||
736 | for (i = 0; i < number_of_intr; i++) | ||
737 | pm8001_ha->outq[i] = i; | ||
738 | 735 | ||
739 | for (i = 0; i < number_of_intr; i++) { | 736 | for (i = 0; i < number_of_intr; i++) { |
740 | snprintf(intr_drvname[i], sizeof(intr_drvname[0]), | 737 | snprintf(intr_drvname[i], sizeof(intr_drvname[0]), |
741 | DRV_NAME"%d", i); | 738 | DRV_NAME"%d", i); |
739 | pm8001_ha->irq_vector[i].irq_id = i; | ||
740 | pm8001_ha->irq_vector[i].drv_inst = pm8001_ha; | ||
741 | |||
742 | if (request_irq(pm8001_ha->msix_entries[i].vector, | 742 | if (request_irq(pm8001_ha->msix_entries[i].vector, |
743 | pm8001_interrupt_handler_msix, flag, | 743 | pm8001_interrupt_handler_msix, flag, |
744 | intr_drvname[i], &pm8001_ha->outq[i])) { | 744 | intr_drvname[i], &(pm8001_ha->irq_vector[i]))) { |
745 | for (j = 0; j < i; j++) | 745 | for (j = 0; j < i; j++) |
746 | free_irq( | 746 | free_irq( |
747 | pm8001_ha->msix_entries[j].vector, | 747 | pm8001_ha->msix_entries[j].vector, |
748 | &pm8001_ha->outq[j]); | 748 | &(pm8001_ha->irq_vector[i])); |
749 | pci_disable_msix(pm8001_ha->pdev); | 749 | pci_disable_msix(pm8001_ha->pdev); |
750 | break; | 750 | break; |
751 | } | 751 | } |
@@ -907,7 +907,7 @@ static void pm8001_pci_remove(struct pci_dev *pdev) | |||
907 | { | 907 | { |
908 | struct sas_ha_struct *sha = pci_get_drvdata(pdev); | 908 | struct sas_ha_struct *sha = pci_get_drvdata(pdev); |
909 | struct pm8001_hba_info *pm8001_ha; | 909 | struct pm8001_hba_info *pm8001_ha; |
910 | int i; | 910 | int i, j; |
911 | pm8001_ha = sha->lldd_ha; | 911 | pm8001_ha = sha->lldd_ha; |
912 | sas_unregister_ha(sha); | 912 | sas_unregister_ha(sha); |
913 | sas_remove_host(pm8001_ha->shost); | 913 | sas_remove_host(pm8001_ha->shost); |
@@ -921,13 +921,18 @@ static void pm8001_pci_remove(struct pci_dev *pdev) | |||
921 | synchronize_irq(pm8001_ha->msix_entries[i].vector); | 921 | synchronize_irq(pm8001_ha->msix_entries[i].vector); |
922 | for (i = 0; i < pm8001_ha->number_of_intr; i++) | 922 | for (i = 0; i < pm8001_ha->number_of_intr; i++) |
923 | free_irq(pm8001_ha->msix_entries[i].vector, | 923 | free_irq(pm8001_ha->msix_entries[i].vector, |
924 | &pm8001_ha->outq[i]); | 924 | &(pm8001_ha->irq_vector[i])); |
925 | pci_disable_msix(pdev); | 925 | pci_disable_msix(pdev); |
926 | #else | 926 | #else |
927 | free_irq(pm8001_ha->irq, sha); | 927 | free_irq(pm8001_ha->irq, sha); |
928 | #endif | 928 | #endif |
929 | #ifdef PM8001_USE_TASKLET | 929 | #ifdef PM8001_USE_TASKLET |
930 | tasklet_kill(&pm8001_ha->tasklet); | 930 | /* For non-msix and msix interrupts */ |
931 | if ((!pdev->msix_cap) || (pm8001_ha->chip_id == chip_8001)) | ||
932 | tasklet_kill(&pm8001_ha->tasklet[0]); | ||
933 | else | ||
934 | for (j = 0; j < PM8001_MAX_MSIX_VEC; j++) | ||
935 | tasklet_kill(&pm8001_ha->tasklet[j]); | ||
931 | #endif | 936 | #endif |
932 | pm8001_free(pm8001_ha); | 937 | pm8001_free(pm8001_ha); |
933 | kfree(sha->sas_phy); | 938 | kfree(sha->sas_phy); |
@@ -948,7 +953,7 @@ static int pm8001_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
948 | { | 953 | { |
949 | struct sas_ha_struct *sha = pci_get_drvdata(pdev); | 954 | struct sas_ha_struct *sha = pci_get_drvdata(pdev); |
950 | struct pm8001_hba_info *pm8001_ha; | 955 | struct pm8001_hba_info *pm8001_ha; |
951 | int i; | 956 | int i, j; |
952 | u32 device_state; | 957 | u32 device_state; |
953 | pm8001_ha = sha->lldd_ha; | 958 | pm8001_ha = sha->lldd_ha; |
954 | flush_workqueue(pm8001_wq); | 959 | flush_workqueue(pm8001_wq); |
@@ -964,13 +969,18 @@ static int pm8001_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
964 | synchronize_irq(pm8001_ha->msix_entries[i].vector); | 969 | synchronize_irq(pm8001_ha->msix_entries[i].vector); |
965 | for (i = 0; i < pm8001_ha->number_of_intr; i++) | 970 | for (i = 0; i < pm8001_ha->number_of_intr; i++) |
966 | free_irq(pm8001_ha->msix_entries[i].vector, | 971 | free_irq(pm8001_ha->msix_entries[i].vector, |
967 | &pm8001_ha->outq[i]); | 972 | &(pm8001_ha->irq_vector[i])); |
968 | pci_disable_msix(pdev); | 973 | pci_disable_msix(pdev); |
969 | #else | 974 | #else |
970 | free_irq(pm8001_ha->irq, sha); | 975 | free_irq(pm8001_ha->irq, sha); |
971 | #endif | 976 | #endif |
972 | #ifdef PM8001_USE_TASKLET | 977 | #ifdef PM8001_USE_TASKLET |
973 | tasklet_kill(&pm8001_ha->tasklet); | 978 | /* For non-msix and msix interrupts */ |
979 | if ((!pdev->msix_cap) || (pm8001_ha->chip_id == chip_8001)) | ||
980 | tasklet_kill(&pm8001_ha->tasklet[0]); | ||
981 | else | ||
982 | for (j = 0; j < PM8001_MAX_MSIX_VEC; j++) | ||
983 | tasklet_kill(&pm8001_ha->tasklet[j]); | ||
974 | #endif | 984 | #endif |
975 | device_state = pci_choose_state(pdev, state); | 985 | device_state = pci_choose_state(pdev, state); |
976 | pm8001_printk("pdev=0x%p, slot=%s, entering " | 986 | pm8001_printk("pdev=0x%p, slot=%s, entering " |
@@ -993,7 +1003,7 @@ static int pm8001_pci_resume(struct pci_dev *pdev) | |||
993 | struct sas_ha_struct *sha = pci_get_drvdata(pdev); | 1003 | struct sas_ha_struct *sha = pci_get_drvdata(pdev); |
994 | struct pm8001_hba_info *pm8001_ha; | 1004 | struct pm8001_hba_info *pm8001_ha; |
995 | int rc; | 1005 | int rc; |
996 | u8 i = 0; | 1006 | u8 i = 0, j; |
997 | u32 device_state; | 1007 | u32 device_state; |
998 | pm8001_ha = sha->lldd_ha; | 1008 | pm8001_ha = sha->lldd_ha; |
999 | device_state = pdev->current_state; | 1009 | device_state = pdev->current_state; |
@@ -1033,10 +1043,14 @@ static int pm8001_pci_resume(struct pci_dev *pdev) | |||
1033 | if (rc) | 1043 | if (rc) |
1034 | goto err_out_disable; | 1044 | goto err_out_disable; |
1035 | #ifdef PM8001_USE_TASKLET | 1045 | #ifdef PM8001_USE_TASKLET |
1036 | /* default tasklet for non msi-x interrupt handler/first msi-x | 1046 | /* Tasklet for non msi-x interrupt handler */ |
1037 | * interrupt handler */ | 1047 | if ((!pdev->msix_cap) || (pm8001_ha->chip_id == chip_8001)) |
1038 | tasklet_init(&pm8001_ha->tasklet, pm8001_tasklet, | 1048 | tasklet_init(&pm8001_ha->tasklet[0], pm8001_tasklet, |
1039 | (unsigned long)pm8001_ha); | 1049 | (unsigned long)&(pm8001_ha->irq_vector[0])); |
1050 | else | ||
1051 | for (j = 0; j < PM8001_MAX_MSIX_VEC; j++) | ||
1052 | tasklet_init(&pm8001_ha->tasklet[j], pm8001_tasklet, | ||
1053 | (unsigned long)&(pm8001_ha->irq_vector[j])); | ||
1040 | #endif | 1054 | #endif |
1041 | PM8001_CHIP_DISP->interrupt_enable(pm8001_ha, 0); | 1055 | PM8001_CHIP_DISP->interrupt_enable(pm8001_ha, 0); |
1042 | if (pm8001_ha->chip_id != chip_8001) { | 1056 | if (pm8001_ha->chip_id != chip_8001) { |
@@ -1169,6 +1183,7 @@ module_exit(pm8001_exit); | |||
1169 | MODULE_AUTHOR("Jack Wang <jack_wang@usish.com>"); | 1183 | MODULE_AUTHOR("Jack Wang <jack_wang@usish.com>"); |
1170 | MODULE_AUTHOR("Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>"); | 1184 | MODULE_AUTHOR("Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>"); |
1171 | MODULE_AUTHOR("Sangeetha Gnanasekaran <Sangeetha.Gnanasekaran@pmcs.com>"); | 1185 | MODULE_AUTHOR("Sangeetha Gnanasekaran <Sangeetha.Gnanasekaran@pmcs.com>"); |
1186 | MODULE_AUTHOR("Nikith Ganigarakoppal <Nikith.Ganigarakoppal@pmcs.com>"); | ||
1172 | MODULE_DESCRIPTION( | 1187 | MODULE_DESCRIPTION( |
1173 | "PMC-Sierra PM8001/8081/8088/8089/8074/8076/8077 " | 1188 | "PMC-Sierra PM8001/8081/8088/8089/8074/8076/8077 " |
1174 | "SAS/SATA controller driver"); | 1189 | "SAS/SATA controller driver"); |
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c index f4eb18e51631..f50ac44b950e 100644 --- a/drivers/scsi/pm8001/pm8001_sas.c +++ b/drivers/scsi/pm8001/pm8001_sas.c | |||
@@ -1098,15 +1098,17 @@ int pm8001_lu_reset(struct domain_device *dev, u8 *lun) | |||
1098 | struct pm8001_tmf_task tmf_task; | 1098 | struct pm8001_tmf_task tmf_task; |
1099 | struct pm8001_device *pm8001_dev = dev->lldd_dev; | 1099 | struct pm8001_device *pm8001_dev = dev->lldd_dev; |
1100 | struct pm8001_hba_info *pm8001_ha = pm8001_find_ha_by_dev(dev); | 1100 | struct pm8001_hba_info *pm8001_ha = pm8001_find_ha_by_dev(dev); |
1101 | DECLARE_COMPLETION_ONSTACK(completion_setstate); | ||
1101 | if (dev_is_sata(dev)) { | 1102 | if (dev_is_sata(dev)) { |
1102 | struct sas_phy *phy = sas_get_local_phy(dev); | 1103 | struct sas_phy *phy = sas_get_local_phy(dev); |
1103 | rc = pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev , | 1104 | rc = pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev , |
1104 | dev, 1, 0); | 1105 | dev, 1, 0); |
1105 | rc = sas_phy_reset(phy, 1); | 1106 | rc = sas_phy_reset(phy, 1); |
1106 | sas_put_local_phy(phy); | 1107 | sas_put_local_phy(phy); |
1108 | pm8001_dev->setds_completion = &completion_setstate; | ||
1107 | rc = PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha, | 1109 | rc = PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha, |
1108 | pm8001_dev, 0x01); | 1110 | pm8001_dev, 0x01); |
1109 | msleep(2000); | 1111 | wait_for_completion(&completion_setstate); |
1110 | } else { | 1112 | } else { |
1111 | tmf_task.tmf = TMF_LU_RESET; | 1113 | tmf_task.tmf = TMF_LU_RESET; |
1112 | rc = pm8001_issue_ssp_tmf(dev, lun, &tmf_task); | 1114 | rc = pm8001_issue_ssp_tmf(dev, lun, &tmf_task); |
diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h index 6037d477a183..6c5fd5ee22d3 100644 --- a/drivers/scsi/pm8001/pm8001_sas.h +++ b/drivers/scsi/pm8001/pm8001_sas.h | |||
@@ -466,6 +466,10 @@ struct pm8001_hba_memspace { | |||
466 | u64 membase; | 466 | u64 membase; |
467 | u32 memsize; | 467 | u32 memsize; |
468 | }; | 468 | }; |
469 | struct isr_param { | ||
470 | struct pm8001_hba_info *drv_inst; | ||
471 | u32 irq_id; | ||
472 | }; | ||
469 | struct pm8001_hba_info { | 473 | struct pm8001_hba_info { |
470 | char name[PM8001_NAME_LENGTH]; | 474 | char name[PM8001_NAME_LENGTH]; |
471 | struct list_head list; | 475 | struct list_head list; |
@@ -519,14 +523,13 @@ struct pm8001_hba_info { | |||
519 | int number_of_intr;/*will be used in remove()*/ | 523 | int number_of_intr;/*will be used in remove()*/ |
520 | #endif | 524 | #endif |
521 | #ifdef PM8001_USE_TASKLET | 525 | #ifdef PM8001_USE_TASKLET |
522 | struct tasklet_struct tasklet; | 526 | struct tasklet_struct tasklet[PM8001_MAX_MSIX_VEC]; |
523 | #endif | 527 | #endif |
524 | u32 logging_level; | 528 | u32 logging_level; |
525 | u32 fw_status; | 529 | u32 fw_status; |
526 | u32 smp_exp_mode; | 530 | u32 smp_exp_mode; |
527 | u32 int_vector; | ||
528 | const struct firmware *fw_image; | 531 | const struct firmware *fw_image; |
529 | u8 outq[PM8001_MAX_MSIX_VEC]; | 532 | struct isr_param irq_vector[PM8001_MAX_MSIX_VEC]; |
530 | }; | 533 | }; |
531 | 534 | ||
532 | struct pm8001_work { | 535 | struct pm8001_work { |
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 8987b1706216..c950dc5c9943 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c | |||
@@ -2894,6 +2894,7 @@ hw_event_sas_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb) | |||
2894 | unsigned long flags; | 2894 | unsigned long flags; |
2895 | u8 deviceType = pPayload->sas_identify.dev_type; | 2895 | u8 deviceType = pPayload->sas_identify.dev_type; |
2896 | port->port_state = portstate; | 2896 | port->port_state = portstate; |
2897 | phy->phy_state = PHY_STATE_LINK_UP_SPCV; | ||
2897 | PM8001_MSG_DBG(pm8001_ha, pm8001_printk( | 2898 | PM8001_MSG_DBG(pm8001_ha, pm8001_printk( |
2898 | "portid:%d; phyid:%d; linkrate:%d; " | 2899 | "portid:%d; phyid:%d; linkrate:%d; " |
2899 | "portstate:%x; devicetype:%x\n", | 2900 | "portstate:%x; devicetype:%x\n", |
@@ -2978,6 +2979,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb) | |||
2978 | port_id, phy_id, link_rate, portstate)); | 2979 | port_id, phy_id, link_rate, portstate)); |
2979 | 2980 | ||
2980 | port->port_state = portstate; | 2981 | port->port_state = portstate; |
2982 | phy->phy_state = PHY_STATE_LINK_UP_SPCV; | ||
2981 | port->port_attached = 1; | 2983 | port->port_attached = 1; |
2982 | pm8001_get_lrate_mode(phy, link_rate); | 2984 | pm8001_get_lrate_mode(phy, link_rate); |
2983 | phy->phy_type |= PORT_TYPE_SATA; | 2985 | phy->phy_type |= PORT_TYPE_SATA; |
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h index c86816bea424..9970a385795d 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.h +++ b/drivers/scsi/pm8001/pm80xx_hwi.h | |||
@@ -215,6 +215,8 @@ | |||
215 | #define SAS_DOPNRJT_RTRY_TMO 128 | 215 | #define SAS_DOPNRJT_RTRY_TMO 128 |
216 | #define SAS_COPNRJT_RTRY_TMO 128 | 216 | #define SAS_COPNRJT_RTRY_TMO 128 |
217 | 217 | ||
218 | /* for phy state */ | ||
219 | #define PHY_STATE_LINK_UP_SPCV 0x2 | ||
218 | /* | 220 | /* |
219 | Making ORR bigger than IT NEXUS LOSS which is 2000000us = 2 second. | 221 | Making ORR bigger than IT NEXUS LOSS which is 2000000us = 2 second. |
220 | Assuming a bigger value 3 second, 3000000/128 = 23437.5 where 128 | 222 | Assuming a bigger value 3 second, 3000000/128 = 23437.5 where 128 |
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index bd6f743d87a7..be8ce54f99b2 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c | |||
@@ -1404,11 +1404,22 @@ enum { | |||
1404 | }; | 1404 | }; |
1405 | #define PMCRAID_AEN_CMD_MAX (__PMCRAID_AEN_CMD_MAX - 1) | 1405 | #define PMCRAID_AEN_CMD_MAX (__PMCRAID_AEN_CMD_MAX - 1) |
1406 | 1406 | ||
1407 | static struct genl_multicast_group pmcraid_mcgrps[] = { | ||
1408 | { .name = "events", /* not really used - see ID discussion below */ }, | ||
1409 | }; | ||
1410 | |||
1407 | static struct genl_family pmcraid_event_family = { | 1411 | static struct genl_family pmcraid_event_family = { |
1408 | .id = GENL_ID_GENERATE, | 1412 | /* |
1413 | * Due to prior multicast group abuse (the code having assumed that | ||
1414 | * the family ID can be used as a multicast group ID) we need to | ||
1415 | * statically allocate a family (and thus group) ID. | ||
1416 | */ | ||
1417 | .id = GENL_ID_PMCRAID, | ||
1409 | .name = "pmcraid", | 1418 | .name = "pmcraid", |
1410 | .version = 1, | 1419 | .version = 1, |
1411 | .maxattr = PMCRAID_AEN_ATTR_MAX | 1420 | .maxattr = PMCRAID_AEN_ATTR_MAX, |
1421 | .mcgrps = pmcraid_mcgrps, | ||
1422 | .n_mcgrps = ARRAY_SIZE(pmcraid_mcgrps), | ||
1412 | }; | 1423 | }; |
1413 | 1424 | ||
1414 | /** | 1425 | /** |
@@ -1511,9 +1522,8 @@ static int pmcraid_notify_aen( | |||
1511 | return result; | 1522 | return result; |
1512 | } | 1523 | } |
1513 | 1524 | ||
1514 | result = | 1525 | result = genlmsg_multicast(&pmcraid_event_family, skb, |
1515 | genlmsg_multicast(&pmcraid_event_family, skb, 0, | 1526 | 0, 0, GFP_ATOMIC); |
1516 | pmcraid_event_family.id, GFP_ATOMIC); | ||
1517 | 1527 | ||
1518 | /* If there are no listeners, genlmsg_multicast may return non-zero | 1528 | /* If there are no listeners, genlmsg_multicast may return non-zero |
1519 | * value. | 1529 | * value. |
@@ -4315,6 +4325,7 @@ static struct scsi_host_template pmcraid_host_template = { | |||
4315 | .this_id = -1, | 4325 | .this_id = -1, |
4316 | .sg_tablesize = PMCRAID_MAX_IOADLS, | 4326 | .sg_tablesize = PMCRAID_MAX_IOADLS, |
4317 | .max_sectors = PMCRAID_IOA_MAX_SECTORS, | 4327 | .max_sectors = PMCRAID_IOA_MAX_SECTORS, |
4328 | .no_write_same = 1, | ||
4318 | .cmd_per_lun = PMCRAID_MAX_CMD_PER_LUN, | 4329 | .cmd_per_lun = PMCRAID_MAX_CMD_PER_LUN, |
4319 | .use_clustering = ENABLE_CLUSTERING, | 4330 | .use_clustering = ENABLE_CLUSTERING, |
4320 | .shost_attrs = pmcraid_host_attrs, | 4331 | .shost_attrs = pmcraid_host_attrs, |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index e6c4bff04339..69725f7c32c1 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -2659,6 +2659,12 @@ static void sd_read_write_same(struct scsi_disk *sdkp, unsigned char *buffer) | |||
2659 | { | 2659 | { |
2660 | struct scsi_device *sdev = sdkp->device; | 2660 | struct scsi_device *sdev = sdkp->device; |
2661 | 2661 | ||
2662 | if (sdev->host->no_write_same) { | ||
2663 | sdev->no_write_same = 1; | ||
2664 | |||
2665 | return; | ||
2666 | } | ||
2667 | |||
2662 | if (scsi_report_opcode(sdev, buffer, SD_BUF_SIZE, INQUIRY) < 0) { | 2668 | if (scsi_report_opcode(sdev, buffer, SD_BUF_SIZE, INQUIRY) < 0) { |
2663 | /* too large values might cause issues with arcmsr */ | 2669 | /* too large values might cause issues with arcmsr */ |
2664 | int vpd_buf_len = 64; | 2670 | int vpd_buf_len = 64; |
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 1a28f5632797..17d740427240 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c | |||
@@ -1697,6 +1697,7 @@ static struct scsi_host_template scsi_driver = { | |||
1697 | .use_clustering = DISABLE_CLUSTERING, | 1697 | .use_clustering = DISABLE_CLUSTERING, |
1698 | /* Make sure we dont get a sg segment crosses a page boundary */ | 1698 | /* Make sure we dont get a sg segment crosses a page boundary */ |
1699 | .dma_boundary = PAGE_SIZE-1, | 1699 | .dma_boundary = PAGE_SIZE-1, |
1700 | .no_write_same = 1, | ||
1700 | }; | 1701 | }; |
1701 | 1702 | ||
1702 | enum { | 1703 | enum { |
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 3ed666fe840a..9025edd7dc45 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c | |||
@@ -377,7 +377,7 @@ out_master_put: | |||
377 | 377 | ||
378 | static int bcm2835_spi_remove(struct platform_device *pdev) | 378 | static int bcm2835_spi_remove(struct platform_device *pdev) |
379 | { | 379 | { |
380 | struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); | 380 | struct spi_master *master = platform_get_drvdata(pdev); |
381 | struct bcm2835_spi *bs = spi_master_get_devdata(master); | 381 | struct bcm2835_spi *bs = spi_master_get_devdata(master); |
382 | 382 | ||
383 | free_irq(bs->irq, master); | 383 | free_irq(bs->irq, master); |
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index 80d56b214eb5..469ecd876358 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c | |||
@@ -435,7 +435,7 @@ out: | |||
435 | 435 | ||
436 | static int bcm63xx_spi_remove(struct platform_device *pdev) | 436 | static int bcm63xx_spi_remove(struct platform_device *pdev) |
437 | { | 437 | { |
438 | struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); | 438 | struct spi_master *master = platform_get_drvdata(pdev); |
439 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); | 439 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); |
440 | 440 | ||
441 | /* reset spi block */ | 441 | /* reset spi block */ |
diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index 9602bbd8d7ea..87676587d783 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c | |||
@@ -557,7 +557,7 @@ free_master: | |||
557 | 557 | ||
558 | static int mpc512x_psc_spi_do_remove(struct device *dev) | 558 | static int mpc512x_psc_spi_do_remove(struct device *dev) |
559 | { | 559 | { |
560 | struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); | 560 | struct spi_master *master = dev_get_drvdata(dev); |
561 | struct mpc512x_psc_spi *mps = spi_master_get_devdata(master); | 561 | struct mpc512x_psc_spi *mps = spi_master_get_devdata(master); |
562 | 562 | ||
563 | clk_disable_unprepare(mps->clk_mclk); | 563 | clk_disable_unprepare(mps->clk_mclk); |
diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c index 73afb56c08cc..3adebfa22e3d 100644 --- a/drivers/spi/spi-mxs.c +++ b/drivers/spi/spi-mxs.c | |||
@@ -565,7 +565,7 @@ static int mxs_spi_remove(struct platform_device *pdev) | |||
565 | struct mxs_spi *spi; | 565 | struct mxs_spi *spi; |
566 | struct mxs_ssp *ssp; | 566 | struct mxs_ssp *ssp; |
567 | 567 | ||
568 | master = spi_master_get(platform_get_drvdata(pdev)); | 568 | master = platform_get_drvdata(pdev); |
569 | spi = spi_master_get_devdata(master); | 569 | spi = spi_master_get_devdata(master); |
570 | ssp = &spi->ssp; | 570 | ssp = &spi->ssp; |
571 | 571 | ||
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index cb0e1f1137ad..7765b1999537 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c | |||
@@ -1073,6 +1073,8 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev) | |||
1073 | static struct acpi_device_id pxa2xx_spi_acpi_match[] = { | 1073 | static struct acpi_device_id pxa2xx_spi_acpi_match[] = { |
1074 | { "INT33C0", 0 }, | 1074 | { "INT33C0", 0 }, |
1075 | { "INT33C1", 0 }, | 1075 | { "INT33C1", 0 }, |
1076 | { "INT3430", 0 }, | ||
1077 | { "INT3431", 0 }, | ||
1076 | { "80860F0E", 0 }, | 1078 | { "80860F0E", 0 }, |
1077 | { }, | 1079 | { }, |
1078 | }; | 1080 | }; |
@@ -1291,6 +1293,9 @@ static int pxa2xx_spi_resume(struct device *dev) | |||
1291 | /* Enable the SSP clock */ | 1293 | /* Enable the SSP clock */ |
1292 | clk_prepare_enable(ssp->clk); | 1294 | clk_prepare_enable(ssp->clk); |
1293 | 1295 | ||
1296 | /* Restore LPSS private register bits */ | ||
1297 | lpss_ssp_setup(drv_data); | ||
1298 | |||
1294 | /* Start the queue running */ | 1299 | /* Start the queue running */ |
1295 | status = spi_master_resume(drv_data->master); | 1300 | status = spi_master_resume(drv_data->master); |
1296 | if (status != 0) { | 1301 | if (status != 0) { |
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 58449ad4ad0d..9e829cee7357 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c | |||
@@ -885,14 +885,13 @@ static void rspi_release_dma(struct rspi_data *rspi) | |||
885 | 885 | ||
886 | static int rspi_remove(struct platform_device *pdev) | 886 | static int rspi_remove(struct platform_device *pdev) |
887 | { | 887 | { |
888 | struct rspi_data *rspi = spi_master_get(platform_get_drvdata(pdev)); | 888 | struct rspi_data *rspi = platform_get_drvdata(pdev); |
889 | 889 | ||
890 | spi_unregister_master(rspi->master); | 890 | spi_unregister_master(rspi->master); |
891 | rspi_release_dma(rspi); | 891 | rspi_release_dma(rspi); |
892 | free_irq(platform_get_irq(pdev, 0), rspi); | 892 | free_irq(platform_get_irq(pdev, 0), rspi); |
893 | clk_put(rspi->clk); | 893 | clk_put(rspi->clk); |
894 | iounmap(rspi->addr); | 894 | iounmap(rspi->addr); |
895 | spi_master_put(rspi->master); | ||
896 | 895 | ||
897 | return 0; | 896 | return 0; |
898 | } | 897 | } |
diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index 0b71270fbf67..4396bd448540 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c | |||
@@ -161,7 +161,7 @@ static int ti_qspi_setup(struct spi_device *spi) | |||
161 | qspi->spi_max_frequency, clk_div); | 161 | qspi->spi_max_frequency, clk_div); |
162 | 162 | ||
163 | ret = pm_runtime_get_sync(qspi->dev); | 163 | ret = pm_runtime_get_sync(qspi->dev); |
164 | if (ret) { | 164 | if (ret < 0) { |
165 | dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); | 165 | dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); |
166 | return ret; | 166 | return ret; |
167 | } | 167 | } |
@@ -459,11 +459,10 @@ static int ti_qspi_probe(struct platform_device *pdev) | |||
459 | if (!of_property_read_u32(np, "num-cs", &num_cs)) | 459 | if (!of_property_read_u32(np, "num-cs", &num_cs)) |
460 | master->num_chipselect = num_cs; | 460 | master->num_chipselect = num_cs; |
461 | 461 | ||
462 | platform_set_drvdata(pdev, master); | ||
463 | |||
464 | qspi = spi_master_get_devdata(master); | 462 | qspi = spi_master_get_devdata(master); |
465 | qspi->master = master; | 463 | qspi->master = master; |
466 | qspi->dev = &pdev->dev; | 464 | qspi->dev = &pdev->dev; |
465 | platform_set_drvdata(pdev, qspi); | ||
467 | 466 | ||
468 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 467 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
469 | 468 | ||
@@ -517,10 +516,26 @@ free_master: | |||
517 | 516 | ||
518 | static int ti_qspi_remove(struct platform_device *pdev) | 517 | static int ti_qspi_remove(struct platform_device *pdev) |
519 | { | 518 | { |
520 | struct ti_qspi *qspi = platform_get_drvdata(pdev); | 519 | struct spi_master *master; |
520 | struct ti_qspi *qspi; | ||
521 | int ret; | ||
522 | |||
523 | master = platform_get_drvdata(pdev); | ||
524 | qspi = spi_master_get_devdata(master); | ||
525 | |||
526 | ret = pm_runtime_get_sync(qspi->dev); | ||
527 | if (ret < 0) { | ||
528 | dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); | ||
529 | return ret; | ||
530 | } | ||
521 | 531 | ||
522 | ti_qspi_write(qspi, QSPI_WC_INT_DISABLE, QSPI_INTR_ENABLE_CLEAR_REG); | 532 | ti_qspi_write(qspi, QSPI_WC_INT_DISABLE, QSPI_INTR_ENABLE_CLEAR_REG); |
523 | 533 | ||
534 | pm_runtime_put(qspi->dev); | ||
535 | pm_runtime_disable(&pdev->dev); | ||
536 | |||
537 | spi_unregister_master(master); | ||
538 | |||
524 | return 0; | 539 | return 0; |
525 | } | 540 | } |
526 | 541 | ||
diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c index 637cce2b8bdd..18c9bb2b5f39 100644 --- a/drivers/spi/spi-txx9.c +++ b/drivers/spi/spi-txx9.c | |||
@@ -425,7 +425,7 @@ exit: | |||
425 | 425 | ||
426 | static int txx9spi_remove(struct platform_device *dev) | 426 | static int txx9spi_remove(struct platform_device *dev) |
427 | { | 427 | { |
428 | struct spi_master *master = spi_master_get(platform_get_drvdata(dev)); | 428 | struct spi_master *master = platform_get_drvdata(dev); |
429 | struct txx9spi *c = spi_master_get_devdata(master); | 429 | struct txx9spi *c = spi_master_get_devdata(master); |
430 | 430 | ||
431 | destroy_workqueue(c->workqueue); | 431 | destroy_workqueue(c->workqueue); |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 18cc625d887f..349ebba4b199 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -1415,7 +1415,7 @@ int devm_spi_register_master(struct device *dev, struct spi_master *master) | |||
1415 | return -ENOMEM; | 1415 | return -ENOMEM; |
1416 | 1416 | ||
1417 | ret = spi_register_master(master); | 1417 | ret = spi_register_master(master); |
1418 | if (ret != 0) { | 1418 | if (!ret) { |
1419 | *ptr = master; | 1419 | *ptr = master; |
1420 | devres_add(dev, ptr); | 1420 | devres_add(dev, ptr); |
1421 | } else { | 1421 | } else { |
diff --git a/drivers/staging/btmtk_usb/btmtk_usb.c b/drivers/staging/btmtk_usb/btmtk_usb.c index 7a9bf3b57810..9a5ebd6cc512 100644 --- a/drivers/staging/btmtk_usb/btmtk_usb.c +++ b/drivers/staging/btmtk_usb/btmtk_usb.c | |||
@@ -1284,9 +1284,8 @@ done: | |||
1284 | kfree_skb(skb); | 1284 | kfree_skb(skb); |
1285 | } | 1285 | } |
1286 | 1286 | ||
1287 | static int btmtk_usb_send_frame(struct sk_buff *skb) | 1287 | static int btmtk_usb_send_frame(struct hci_dev *hdev, struct sk_buff *skb) |
1288 | { | 1288 | { |
1289 | struct hci_dev *hdev = (struct hci_dev *)skb->dev; | ||
1290 | struct btmtk_usb_data *data = hci_get_drvdata(hdev); | 1289 | struct btmtk_usb_data *data = hci_get_drvdata(hdev); |
1291 | struct usb_ctrlrequest *dr; | 1290 | struct usb_ctrlrequest *dr; |
1292 | struct urb *urb; | 1291 | struct urb *urb; |
diff --git a/drivers/staging/comedi/drivers/pcl730.c b/drivers/staging/comedi/drivers/pcl730.c index d041b714db29..2baaf1db6fbf 100644 --- a/drivers/staging/comedi/drivers/pcl730.c +++ b/drivers/staging/comedi/drivers/pcl730.c | |||
@@ -173,11 +173,11 @@ static int pcl730_do_insn_bits(struct comedi_device *dev, | |||
173 | if (mask) { | 173 | if (mask) { |
174 | if (mask & 0x00ff) | 174 | if (mask & 0x00ff) |
175 | outb(s->state & 0xff, dev->iobase + reg); | 175 | outb(s->state & 0xff, dev->iobase + reg); |
176 | if ((mask & 0xff00) & (s->n_chan > 8)) | 176 | if ((mask & 0xff00) && (s->n_chan > 8)) |
177 | outb((s->state >> 8) & 0xff, dev->iobase + reg + 1); | 177 | outb((s->state >> 8) & 0xff, dev->iobase + reg + 1); |
178 | if ((mask & 0xff0000) & (s->n_chan > 16)) | 178 | if ((mask & 0xff0000) && (s->n_chan > 16)) |
179 | outb((s->state >> 16) & 0xff, dev->iobase + reg + 2); | 179 | outb((s->state >> 16) & 0xff, dev->iobase + reg + 2); |
180 | if ((mask & 0xff000000) & (s->n_chan > 24)) | 180 | if ((mask & 0xff000000) && (s->n_chan > 24)) |
181 | outb((s->state >> 24) & 0xff, dev->iobase + reg + 3); | 181 | outb((s->state >> 24) & 0xff, dev->iobase + reg + 3); |
182 | } | 182 | } |
183 | 183 | ||
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 6815cfe2664e..b486099b543d 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c | |||
@@ -494,7 +494,7 @@ static void s626_send_dac(struct comedi_device *dev, uint32_t val) | |||
494 | * Private helper function: Write setpoint to an application DAC channel. | 494 | * Private helper function: Write setpoint to an application DAC channel. |
495 | */ | 495 | */ |
496 | static void s626_set_dac(struct comedi_device *dev, uint16_t chan, | 496 | static void s626_set_dac(struct comedi_device *dev, uint16_t chan, |
497 | unsigned short dacdata) | 497 | int16_t dacdata) |
498 | { | 498 | { |
499 | struct s626_private *devpriv = dev->private; | 499 | struct s626_private *devpriv = dev->private; |
500 | uint16_t signmask; | 500 | uint16_t signmask; |
diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c index 933b01a0f03d..0adf3cffddb0 100644 --- a/drivers/staging/comedi/drivers/vmk80xx.c +++ b/drivers/staging/comedi/drivers/vmk80xx.c | |||
@@ -465,7 +465,7 @@ static int vmk80xx_do_insn_bits(struct comedi_device *dev, | |||
465 | unsigned char *rx_buf = devpriv->usb_rx_buf; | 465 | unsigned char *rx_buf = devpriv->usb_rx_buf; |
466 | unsigned char *tx_buf = devpriv->usb_tx_buf; | 466 | unsigned char *tx_buf = devpriv->usb_tx_buf; |
467 | int reg, cmd; | 467 | int reg, cmd; |
468 | int ret; | 468 | int ret = 0; |
469 | 469 | ||
470 | if (devpriv->model == VMK8061_MODEL) { | 470 | if (devpriv->model == VMK8061_MODEL) { |
471 | reg = VMK8061_DO_REG; | 471 | reg = VMK8061_DO_REG; |
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c index 68ded17c0f5c..12f333fa59b5 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c | |||
@@ -578,7 +578,7 @@ static int request_code_segment(struct ft1000_usb *ft1000dev, u16 **s_file, | |||
578 | u8 **c_file, const u8 *endpoint, bool boot_case) | 578 | u8 **c_file, const u8 *endpoint, bool boot_case) |
579 | { | 579 | { |
580 | long word_length; | 580 | long word_length; |
581 | int status; | 581 | int status = 0; |
582 | 582 | ||
583 | /*DEBUG("FT1000:REQUEST_CODE_SEGMENT\n");i*/ | 583 | /*DEBUG("FT1000:REQUEST_CODE_SEGMENT\n");i*/ |
584 | word_length = get_request_value(ft1000dev); | 584 | word_length = get_request_value(ft1000dev); |
@@ -1074,4 +1074,3 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, | |||
1074 | 1074 | ||
1075 | return status; | 1075 | return status; |
1076 | } | 1076 | } |
1077 | |||
diff --git a/drivers/staging/iio/magnetometer/Kconfig b/drivers/staging/iio/magnetometer/Kconfig index a3ea69e9d800..34634da1f9f7 100644 --- a/drivers/staging/iio/magnetometer/Kconfig +++ b/drivers/staging/iio/magnetometer/Kconfig | |||
@@ -6,6 +6,8 @@ menu "Magnetometer sensors" | |||
6 | config SENSORS_HMC5843 | 6 | config SENSORS_HMC5843 |
7 | tristate "Honeywell HMC5843/5883/5883L 3-Axis Magnetometer" | 7 | tristate "Honeywell HMC5843/5883/5883L 3-Axis Magnetometer" |
8 | depends on I2C | 8 | depends on I2C |
9 | select IIO_BUFFER | ||
10 | select IIO_TRIGGERED_BUFFER | ||
9 | help | 11 | help |
10 | Say Y here to add support for the Honeywell HMC5843, HMC5883 and | 12 | Say Y here to add support for the Honeywell HMC5843, HMC5883 and |
11 | HMC5883L 3-Axis Magnetometer (digital compass). | 13 | HMC5883L 3-Axis Magnetometer (digital compass). |
diff --git a/drivers/staging/imx-drm/Makefile b/drivers/staging/imx-drm/Makefile index 2c3a9e178fb5..8742432d7b01 100644 --- a/drivers/staging/imx-drm/Makefile +++ b/drivers/staging/imx-drm/Makefile | |||
@@ -8,4 +8,6 @@ obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o | |||
8 | obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o | 8 | obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o |
9 | obj-$(CONFIG_DRM_IMX_FB_HELPER) += imx-fbdev.o | 9 | obj-$(CONFIG_DRM_IMX_FB_HELPER) += imx-fbdev.o |
10 | obj-$(CONFIG_DRM_IMX_IPUV3_CORE) += ipu-v3/ | 10 | obj-$(CONFIG_DRM_IMX_IPUV3_CORE) += ipu-v3/ |
11 | obj-$(CONFIG_DRM_IMX_IPUV3) += ipuv3-crtc.o ipuv3-plane.o | 11 | |
12 | imx-ipuv3-crtc-objs := ipuv3-crtc.o ipuv3-plane.o | ||
13 | obj-$(CONFIG_DRM_IMX_IPUV3) += imx-ipuv3-crtc.o | ||
diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c index 51aa9772f959..6bd015ac9d68 100644 --- a/drivers/staging/imx-drm/imx-drm-core.c +++ b/drivers/staging/imx-drm/imx-drm-core.c | |||
@@ -72,6 +72,7 @@ int imx_drm_crtc_id(struct imx_drm_crtc *crtc) | |||
72 | { | 72 | { |
73 | return crtc->pipe; | 73 | return crtc->pipe; |
74 | } | 74 | } |
75 | EXPORT_SYMBOL_GPL(imx_drm_crtc_id); | ||
75 | 76 | ||
76 | static void imx_drm_driver_lastclose(struct drm_device *drm) | 77 | static void imx_drm_driver_lastclose(struct drm_device *drm) |
77 | { | 78 | { |
diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index 5dec771d70ee..4d340f4a2198 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c | |||
@@ -409,8 +409,8 @@ int ptlrpc_stop_pinger(void) | |||
409 | struct l_wait_info lwi = { 0 }; | 409 | struct l_wait_info lwi = { 0 }; |
410 | int rc = 0; | 410 | int rc = 0; |
411 | 411 | ||
412 | if (!thread_is_init(&pinger_thread) && | 412 | if (thread_is_init(&pinger_thread) || |
413 | !thread_is_stopped(&pinger_thread)) | 413 | thread_is_stopped(&pinger_thread)) |
414 | return -EALREADY; | 414 | return -EALREADY; |
415 | 415 | ||
416 | ptlrpc_pinger_remove_timeouts(); | 416 | ptlrpc_pinger_remove_timeouts(); |
diff --git a/drivers/staging/media/go7007/go7007-usb.c b/drivers/staging/media/go7007/go7007-usb.c index 58684da45e6c..b658c2316df3 100644 --- a/drivers/staging/media/go7007/go7007-usb.c +++ b/drivers/staging/media/go7007/go7007-usb.c | |||
@@ -15,6 +15,8 @@ | |||
15 | * Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | 15 | * Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
19 | |||
18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
19 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
20 | #include <linux/init.h> | 22 | #include <linux/init.h> |
@@ -661,7 +663,7 @@ static int go7007_usb_interface_reset(struct go7007 *go) | |||
661 | 663 | ||
662 | if (usb->board->flags & GO7007_USB_EZUSB) { | 664 | if (usb->board->flags & GO7007_USB_EZUSB) { |
663 | /* Reset buffer in EZ-USB */ | 665 | /* Reset buffer in EZ-USB */ |
664 | dev_dbg(go->dev, "resetting EZ-USB buffers\n"); | 666 | pr_debug("resetting EZ-USB buffers\n"); |
665 | if (go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0 || | 667 | if (go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0 || |
666 | go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0) | 668 | go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0) |
667 | return -1; | 669 | return -1; |
@@ -689,7 +691,7 @@ static int go7007_usb_ezusb_write_interrupt(struct go7007 *go, | |||
689 | u16 status_reg = 0; | 691 | u16 status_reg = 0; |
690 | int timeout = 500; | 692 | int timeout = 500; |
691 | 693 | ||
692 | dev_dbg(go->dev, "WriteInterrupt: %04x %04x\n", addr, data); | 694 | pr_debug("WriteInterrupt: %04x %04x\n", addr, data); |
693 | 695 | ||
694 | for (i = 0; i < 100; ++i) { | 696 | for (i = 0; i < 100; ++i) { |
695 | r = usb_control_msg(usb->usbdev, | 697 | r = usb_control_msg(usb->usbdev, |
@@ -734,7 +736,7 @@ static int go7007_usb_onboard_write_interrupt(struct go7007 *go, | |||
734 | int r; | 736 | int r; |
735 | int timeout = 500; | 737 | int timeout = 500; |
736 | 738 | ||
737 | dev_dbg(go->dev, "WriteInterrupt: %04x %04x\n", addr, data); | 739 | pr_debug("WriteInterrupt: %04x %04x\n", addr, data); |
738 | 740 | ||
739 | go->usb_buf[0] = data & 0xff; | 741 | go->usb_buf[0] = data & 0xff; |
740 | go->usb_buf[1] = data >> 8; | 742 | go->usb_buf[1] = data >> 8; |
@@ -771,7 +773,7 @@ static void go7007_usb_readinterrupt_complete(struct urb *urb) | |||
771 | go->interrupt_available = 1; | 773 | go->interrupt_available = 1; |
772 | go->interrupt_data = __le16_to_cpu(regs[0]); | 774 | go->interrupt_data = __le16_to_cpu(regs[0]); |
773 | go->interrupt_value = __le16_to_cpu(regs[1]); | 775 | go->interrupt_value = __le16_to_cpu(regs[1]); |
774 | dev_dbg(go->dev, "ReadInterrupt: %04x %04x\n", | 776 | pr_debug("ReadInterrupt: %04x %04x\n", |
775 | go->interrupt_value, go->interrupt_data); | 777 | go->interrupt_value, go->interrupt_data); |
776 | } | 778 | } |
777 | 779 | ||
@@ -891,7 +893,7 @@ static int go7007_usb_send_firmware(struct go7007 *go, u8 *data, int len) | |||
891 | int transferred, pipe; | 893 | int transferred, pipe; |
892 | int timeout = 500; | 894 | int timeout = 500; |
893 | 895 | ||
894 | dev_dbg(go->dev, "DownloadBuffer sending %d bytes\n", len); | 896 | pr_debug("DownloadBuffer sending %d bytes\n", len); |
895 | 897 | ||
896 | if (usb->board->flags & GO7007_USB_EZUSB) | 898 | if (usb->board->flags & GO7007_USB_EZUSB) |
897 | pipe = usb_sndbulkpipe(usb->usbdev, 2); | 899 | pipe = usb_sndbulkpipe(usb->usbdev, 2); |
@@ -977,7 +979,7 @@ static int go7007_usb_i2c_master_xfer(struct i2c_adapter *adapter, | |||
977 | !(msgs[i].flags & I2C_M_RD) && | 979 | !(msgs[i].flags & I2C_M_RD) && |
978 | (msgs[i + 1].flags & I2C_M_RD)) { | 980 | (msgs[i + 1].flags & I2C_M_RD)) { |
979 | #ifdef GO7007_I2C_DEBUG | 981 | #ifdef GO7007_I2C_DEBUG |
980 | dev_dbg(go->dev, "i2c write/read %d/%d bytes on %02x\n", | 982 | pr_debug("i2c write/read %d/%d bytes on %02x\n", |
981 | msgs[i].len, msgs[i + 1].len, msgs[i].addr); | 983 | msgs[i].len, msgs[i + 1].len, msgs[i].addr); |
982 | #endif | 984 | #endif |
983 | buf[0] = 0x01; | 985 | buf[0] = 0x01; |
@@ -988,7 +990,7 @@ static int go7007_usb_i2c_master_xfer(struct i2c_adapter *adapter, | |||
988 | buf[buf_len++] = msgs[++i].len; | 990 | buf[buf_len++] = msgs[++i].len; |
989 | } else if (msgs[i].flags & I2C_M_RD) { | 991 | } else if (msgs[i].flags & I2C_M_RD) { |
990 | #ifdef GO7007_I2C_DEBUG | 992 | #ifdef GO7007_I2C_DEBUG |
991 | dev_dbg(go->dev, "i2c read %d bytes on %02x\n", | 993 | pr_debug("i2c read %d bytes on %02x\n", |
992 | msgs[i].len, msgs[i].addr); | 994 | msgs[i].len, msgs[i].addr); |
993 | #endif | 995 | #endif |
994 | buf[0] = 0x01; | 996 | buf[0] = 0x01; |
@@ -998,7 +1000,7 @@ static int go7007_usb_i2c_master_xfer(struct i2c_adapter *adapter, | |||
998 | buf_len = 4; | 1000 | buf_len = 4; |
999 | } else { | 1001 | } else { |
1000 | #ifdef GO7007_I2C_DEBUG | 1002 | #ifdef GO7007_I2C_DEBUG |
1001 | dev_dbg(go->dev, "i2c write %d bytes on %02x\n", | 1003 | pr_debug("i2c write %d bytes on %02x\n", |
1002 | msgs[i].len, msgs[i].addr); | 1004 | msgs[i].len, msgs[i].addr); |
1003 | #endif | 1005 | #endif |
1004 | buf[0] = 0x00; | 1006 | buf[0] = 0x00; |
@@ -1057,7 +1059,7 @@ static int go7007_usb_probe(struct usb_interface *intf, | |||
1057 | char *name; | 1059 | char *name; |
1058 | int video_pipe, i, v_urb_len; | 1060 | int video_pipe, i, v_urb_len; |
1059 | 1061 | ||
1060 | dev_dbg(go->dev, "probing new GO7007 USB board\n"); | 1062 | pr_debug("probing new GO7007 USB board\n"); |
1061 | 1063 | ||
1062 | switch (id->driver_info) { | 1064 | switch (id->driver_info) { |
1063 | case GO7007_BOARDID_MATRIX_II: | 1065 | case GO7007_BOARDID_MATRIX_II: |
@@ -1097,13 +1099,13 @@ static int go7007_usb_probe(struct usb_interface *intf, | |||
1097 | board = &board_px_tv402u; | 1099 | board = &board_px_tv402u; |
1098 | break; | 1100 | break; |
1099 | case GO7007_BOARDID_LIFEVIEW_LR192: | 1101 | case GO7007_BOARDID_LIFEVIEW_LR192: |
1100 | dev_err(go->dev, "The Lifeview TV Walker Ultra is not supported. Sorry!\n"); | 1102 | dev_err(&intf->dev, "The Lifeview TV Walker Ultra is not supported. Sorry!\n"); |
1101 | return -ENODEV; | 1103 | return -ENODEV; |
1102 | name = "Lifeview TV Walker Ultra"; | 1104 | name = "Lifeview TV Walker Ultra"; |
1103 | board = &board_lifeview_lr192; | 1105 | board = &board_lifeview_lr192; |
1104 | break; | 1106 | break; |
1105 | case GO7007_BOARDID_SENSORAY_2250: | 1107 | case GO7007_BOARDID_SENSORAY_2250: |
1106 | dev_info(go->dev, "Sensoray 2250 found\n"); | 1108 | dev_info(&intf->dev, "Sensoray 2250 found\n"); |
1107 | name = "Sensoray 2250/2251"; | 1109 | name = "Sensoray 2250/2251"; |
1108 | board = &board_sensoray_2250; | 1110 | board = &board_sensoray_2250; |
1109 | break; | 1111 | break; |
@@ -1112,7 +1114,7 @@ static int go7007_usb_probe(struct usb_interface *intf, | |||
1112 | board = &board_ads_usbav_709; | 1114 | board = &board_ads_usbav_709; |
1113 | break; | 1115 | break; |
1114 | default: | 1116 | default: |
1115 | dev_err(go->dev, "unknown board ID %d!\n", | 1117 | dev_err(&intf->dev, "unknown board ID %d!\n", |
1116 | (unsigned int)id->driver_info); | 1118 | (unsigned int)id->driver_info); |
1117 | return -ENODEV; | 1119 | return -ENODEV; |
1118 | } | 1120 | } |
@@ -1247,7 +1249,7 @@ static int go7007_usb_probe(struct usb_interface *intf, | |||
1247 | sizeof(go->name)); | 1249 | sizeof(go->name)); |
1248 | break; | 1250 | break; |
1249 | default: | 1251 | default: |
1250 | dev_dbg(go->dev, "unable to detect tuner type!\n"); | 1252 | pr_debug("unable to detect tuner type!\n"); |
1251 | break; | 1253 | break; |
1252 | } | 1254 | } |
1253 | /* Configure tuner mode selection inputs connected | 1255 | /* Configure tuner mode selection inputs connected |
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 3066ee2e753b..49ea76b3435d 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c | |||
@@ -681,7 +681,8 @@ static irqreturn_t nvec_interrupt(int irq, void *dev) | |||
681 | dev_err(nvec->dev, | 681 | dev_err(nvec->dev, |
682 | "RX buffer overflow on %p: " | 682 | "RX buffer overflow on %p: " |
683 | "Trying to write byte %u of %u\n", | 683 | "Trying to write byte %u of %u\n", |
684 | nvec->rx, nvec->rx->pos, NVEC_MSG_SIZE); | 684 | nvec->rx, nvec->rx ? nvec->rx->pos : 0, |
685 | NVEC_MSG_SIZE); | ||
685 | break; | 686 | break; |
686 | default: | 687 | default: |
687 | nvec->state = 0; | 688 | nvec->state = 0; |
diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c index 2c678f409573..2f548ebada59 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ap.c +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c | |||
@@ -1115,6 +1115,9 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) | |||
1115 | return _FAIL; | 1115 | return _FAIL; |
1116 | } | 1116 | } |
1117 | 1117 | ||
1118 | /* fix bug of flush_cam_entry at STOP AP mode */ | ||
1119 | psta->state |= WIFI_AP_STATE; | ||
1120 | rtw_indicate_connect(padapter); | ||
1118 | pmlmepriv->cur_network.join_res = true;/* for check if already set beacon */ | 1121 | pmlmepriv->cur_network.join_res = true;/* for check if already set beacon */ |
1119 | return ret; | 1122 | return ret; |
1120 | } | 1123 | } |
diff --git a/drivers/staging/tidspbridge/Kconfig b/drivers/staging/tidspbridge/Kconfig index 165b918b8171..1b6d581c438b 100644 --- a/drivers/staging/tidspbridge/Kconfig +++ b/drivers/staging/tidspbridge/Kconfig | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | menuconfig TIDSPBRIDGE | 5 | menuconfig TIDSPBRIDGE |
6 | tristate "DSP Bridge driver" | 6 | tristate "DSP Bridge driver" |
7 | depends on ARCH_OMAP3 && !ARCH_MULTIPLATFORM | 7 | depends on ARCH_OMAP3 && !ARCH_MULTIPLATFORM && BROKEN |
8 | select MAILBOX | 8 | select MAILBOX |
9 | select OMAP2PLUS_MBOX | 9 | select OMAP2PLUS_MBOX |
10 | help | 10 | help |
diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c index aab0012bba92..ab8b2ba6eedd 100644 --- a/drivers/staging/vt6655/hostap.c +++ b/drivers/staging/vt6655/hostap.c | |||
@@ -143,7 +143,8 @@ static int hostap_disable_hostapd(PSDevice pDevice, int rtnl_locked) | |||
143 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n", | 143 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n", |
144 | pDevice->dev->name, pDevice->apdev->name); | 144 | pDevice->dev->name, pDevice->apdev->name); |
145 | } | 145 | } |
146 | free_netdev(pDevice->apdev); | 146 | if (pDevice->apdev) |
147 | free_netdev(pDevice->apdev); | ||
147 | pDevice->apdev = NULL; | 148 | pDevice->apdev = NULL; |
148 | pDevice->bEnable8021x = false; | 149 | pDevice->bEnable8021x = false; |
149 | pDevice->bEnableHostWEP = false; | 150 | pDevice->bEnableHostWEP = false; |
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c index 1e8b8412e67e..4aa5ef54b683 100644 --- a/drivers/staging/vt6656/baseband.c +++ b/drivers/staging/vt6656/baseband.c | |||
@@ -939,6 +939,7 @@ int BBbVT3184Init(struct vnt_private *pDevice) | |||
939 | u8 * pbyAgc; | 939 | u8 * pbyAgc; |
940 | u16 wLengthAgc; | 940 | u16 wLengthAgc; |
941 | u8 abyArray[256]; | 941 | u8 abyArray[256]; |
942 | u8 data; | ||
942 | 943 | ||
943 | ntStatus = CONTROLnsRequestIn(pDevice, | 944 | ntStatus = CONTROLnsRequestIn(pDevice, |
944 | MESSAGE_TYPE_READ, | 945 | MESSAGE_TYPE_READ, |
@@ -1104,6 +1105,16 @@ else { | |||
1104 | ControlvWriteByte(pDevice,MESSAGE_REQUEST_BBREG,0x0D,0x01); | 1105 | ControlvWriteByte(pDevice,MESSAGE_REQUEST_BBREG,0x0D,0x01); |
1105 | 1106 | ||
1106 | RFbRFTableDownload(pDevice); | 1107 | RFbRFTableDownload(pDevice); |
1108 | |||
1109 | /* Fix for TX USB resets from vendors driver */ | ||
1110 | CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ, USB_REG4, | ||
1111 | MESSAGE_REQUEST_MEM, sizeof(data), &data); | ||
1112 | |||
1113 | data |= 0x2; | ||
1114 | |||
1115 | CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_WRITE, USB_REG4, | ||
1116 | MESSAGE_REQUEST_MEM, sizeof(data), &data); | ||
1117 | |||
1107 | return true;//ntStatus; | 1118 | return true;//ntStatus; |
1108 | } | 1119 | } |
1109 | 1120 | ||
diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c index ae1676d190c5..67ba48b9a8d9 100644 --- a/drivers/staging/vt6656/hostap.c +++ b/drivers/staging/vt6656/hostap.c | |||
@@ -133,7 +133,8 @@ static int hostap_disable_hostapd(struct vnt_private *pDevice, int rtnl_locked) | |||
133 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n", | 133 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n", |
134 | pDevice->dev->name, pDevice->apdev->name); | 134 | pDevice->dev->name, pDevice->apdev->name); |
135 | } | 135 | } |
136 | free_netdev(pDevice->apdev); | 136 | if (pDevice->apdev) |
137 | free_netdev(pDevice->apdev); | ||
137 | pDevice->apdev = NULL; | 138 | pDevice->apdev = NULL; |
138 | pDevice->bEnable8021x = false; | 139 | pDevice->bEnable8021x = false; |
139 | pDevice->bEnableHostWEP = false; | 140 | pDevice->bEnableHostWEP = false; |
diff --git a/drivers/staging/vt6656/rndis.h b/drivers/staging/vt6656/rndis.h index 5e073062017a..5cf5e732a36f 100644 --- a/drivers/staging/vt6656/rndis.h +++ b/drivers/staging/vt6656/rndis.h | |||
@@ -66,6 +66,8 @@ | |||
66 | 66 | ||
67 | #define VIAUSB20_PACKET_HEADER 0x04 | 67 | #define VIAUSB20_PACKET_HEADER 0x04 |
68 | 68 | ||
69 | #define USB_REG4 0x604 | ||
70 | |||
69 | typedef struct _CMD_MESSAGE | 71 | typedef struct _CMD_MESSAGE |
70 | { | 72 | { |
71 | u8 byData[256]; | 73 | u8 byData[256]; |
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c index 79ce363b2ea9..3277d9838f4e 100644 --- a/drivers/staging/zram/zram_drv.c +++ b/drivers/staging/zram/zram_drv.c | |||
@@ -652,21 +652,30 @@ static ssize_t reset_store(struct device *dev, | |||
652 | return -ENOMEM; | 652 | return -ENOMEM; |
653 | 653 | ||
654 | /* Do not reset an active device! */ | 654 | /* Do not reset an active device! */ |
655 | if (bdev->bd_holders) | 655 | if (bdev->bd_holders) { |
656 | return -EBUSY; | 656 | ret = -EBUSY; |
657 | goto out; | ||
658 | } | ||
657 | 659 | ||
658 | ret = kstrtou16(buf, 10, &do_reset); | 660 | ret = kstrtou16(buf, 10, &do_reset); |
659 | if (ret) | 661 | if (ret) |
660 | return ret; | 662 | goto out; |
661 | 663 | ||
662 | if (!do_reset) | 664 | if (!do_reset) { |
663 | return -EINVAL; | 665 | ret = -EINVAL; |
666 | goto out; | ||
667 | } | ||
664 | 668 | ||
665 | /* Make sure all pending I/O is finished */ | 669 | /* Make sure all pending I/O is finished */ |
666 | fsync_bdev(bdev); | 670 | fsync_bdev(bdev); |
671 | bdput(bdev); | ||
667 | 672 | ||
668 | zram_reset_device(zram, true); | 673 | zram_reset_device(zram, true); |
669 | return len; | 674 | return len; |
675 | |||
676 | out: | ||
677 | bdput(bdev); | ||
678 | return ret; | ||
670 | } | 679 | } |
671 | 680 | ||
672 | static void __zram_make_request(struct zram *zram, struct bio *bio, int rw) | 681 | static void __zram_make_request(struct zram *zram, struct bio *bio, int rw) |
diff --git a/drivers/staging/zsmalloc/zsmalloc-main.c b/drivers/staging/zsmalloc/zsmalloc-main.c index 1a67537dbc56..3b950e5a918f 100644 --- a/drivers/staging/zsmalloc/zsmalloc-main.c +++ b/drivers/staging/zsmalloc/zsmalloc-main.c | |||
@@ -430,7 +430,12 @@ static struct page *get_next_page(struct page *page) | |||
430 | return next; | 430 | return next; |
431 | } | 431 | } |
432 | 432 | ||
433 | /* Encode <page, obj_idx> as a single handle value */ | 433 | /* |
434 | * Encode <page, obj_idx> as a single handle value. | ||
435 | * On hardware platforms with physical memory starting at 0x0 the pfn | ||
436 | * could be 0 so we ensure that the handle will never be 0 by adjusting the | ||
437 | * encoded obj_idx value before encoding. | ||
438 | */ | ||
434 | static void *obj_location_to_handle(struct page *page, unsigned long obj_idx) | 439 | static void *obj_location_to_handle(struct page *page, unsigned long obj_idx) |
435 | { | 440 | { |
436 | unsigned long handle; | 441 | unsigned long handle; |
@@ -441,17 +446,21 @@ static void *obj_location_to_handle(struct page *page, unsigned long obj_idx) | |||
441 | } | 446 | } |
442 | 447 | ||
443 | handle = page_to_pfn(page) << OBJ_INDEX_BITS; | 448 | handle = page_to_pfn(page) << OBJ_INDEX_BITS; |
444 | handle |= (obj_idx & OBJ_INDEX_MASK); | 449 | handle |= ((obj_idx + 1) & OBJ_INDEX_MASK); |
445 | 450 | ||
446 | return (void *)handle; | 451 | return (void *)handle; |
447 | } | 452 | } |
448 | 453 | ||
449 | /* Decode <page, obj_idx> pair from the given object handle */ | 454 | /* |
455 | * Decode <page, obj_idx> pair from the given object handle. We adjust the | ||
456 | * decoded obj_idx back to its original value since it was adjusted in | ||
457 | * obj_location_to_handle(). | ||
458 | */ | ||
450 | static void obj_handle_to_location(unsigned long handle, struct page **page, | 459 | static void obj_handle_to_location(unsigned long handle, struct page **page, |
451 | unsigned long *obj_idx) | 460 | unsigned long *obj_idx) |
452 | { | 461 | { |
453 | *page = pfn_to_page(handle >> OBJ_INDEX_BITS); | 462 | *page = pfn_to_page(handle >> OBJ_INDEX_BITS); |
454 | *obj_idx = handle & OBJ_INDEX_MASK; | 463 | *obj_idx = (handle & OBJ_INDEX_MASK) - 1; |
455 | } | 464 | } |
456 | 465 | ||
457 | static unsigned long obj_idx_to_offset(struct page *page, | 466 | static unsigned long obj_idx_to_offset(struct page *page, |
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index 2b86f8e0fb58..71630a2af42c 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c | |||
@@ -1855,6 +1855,9 @@ static struct console sercons = { | |||
1855 | */ | 1855 | */ |
1856 | static int __init amiserial_console_init(void) | 1856 | static int __init amiserial_console_init(void) |
1857 | { | 1857 | { |
1858 | if (!MACH_IS_AMIGA) | ||
1859 | return -ENODEV; | ||
1860 | |||
1858 | register_console(&sercons); | 1861 | register_console(&sercons); |
1859 | return 0; | 1862 | return 0; |
1860 | } | 1863 | } |
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 7cdd1eb9406c..0f74945af624 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
@@ -768,7 +768,7 @@ static size_t __process_echoes(struct tty_struct *tty) | |||
768 | * data at the tail to prevent a subsequent overrun */ | 768 | * data at the tail to prevent a subsequent overrun */ |
769 | while (ldata->echo_commit - tail >= ECHO_DISCARD_WATERMARK) { | 769 | while (ldata->echo_commit - tail >= ECHO_DISCARD_WATERMARK) { |
770 | if (echo_buf(ldata, tail) == ECHO_OP_START) { | 770 | if (echo_buf(ldata, tail) == ECHO_OP_START) { |
771 | if (echo_buf(ldata, tail) == ECHO_OP_ERASE_TAB) | 771 | if (echo_buf(ldata, tail + 1) == ECHO_OP_ERASE_TAB) |
772 | tail += 3; | 772 | tail += 3; |
773 | else | 773 | else |
774 | tail += 2; | 774 | tail += 2; |
@@ -1998,7 +1998,10 @@ static int canon_copy_from_read_buf(struct tty_struct *tty, | |||
1998 | found = 1; | 1998 | found = 1; |
1999 | 1999 | ||
2000 | size = N_TTY_BUF_SIZE - tail; | 2000 | size = N_TTY_BUF_SIZE - tail; |
2001 | n = (found + eol + size) & (N_TTY_BUF_SIZE - 1); | 2001 | n = eol - tail; |
2002 | if (n > 4096) | ||
2003 | n += 4096; | ||
2004 | n += found; | ||
2002 | c = n; | 2005 | c = n; |
2003 | 2006 | ||
2004 | if (found && read_buf(ldata, eol) == __DISABLED_CHAR) { | 2007 | if (found && read_buf(ldata, eol) == __DISABLED_CHAR) { |
@@ -2243,18 +2246,19 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, | |||
2243 | if (time) | 2246 | if (time) |
2244 | timeout = time; | 2247 | timeout = time; |
2245 | } | 2248 | } |
2246 | mutex_unlock(&ldata->atomic_read_lock); | 2249 | n_tty_set_room(tty); |
2247 | remove_wait_queue(&tty->read_wait, &wait); | 2250 | up_read(&tty->termios_rwsem); |
2248 | 2251 | ||
2252 | remove_wait_queue(&tty->read_wait, &wait); | ||
2249 | if (!waitqueue_active(&tty->read_wait)) | 2253 | if (!waitqueue_active(&tty->read_wait)) |
2250 | ldata->minimum_to_wake = minimum; | 2254 | ldata->minimum_to_wake = minimum; |
2251 | 2255 | ||
2256 | mutex_unlock(&ldata->atomic_read_lock); | ||
2257 | |||
2252 | __set_current_state(TASK_RUNNING); | 2258 | __set_current_state(TASK_RUNNING); |
2253 | if (b - buf) | 2259 | if (b - buf) |
2254 | retval = b - buf; | 2260 | retval = b - buf; |
2255 | 2261 | ||
2256 | n_tty_set_room(tty); | ||
2257 | up_read(&tty->termios_rwsem); | ||
2258 | return retval; | 2262 | return retval; |
2259 | } | 2263 | } |
2260 | 2264 | ||
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig index f3b306efaa59..23329918f229 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig | |||
@@ -41,7 +41,7 @@ config SERIAL_8250_DEPRECATED_OPTIONS | |||
41 | accept kernel parameters in both forms like 8250_core.nr_uarts=4 and | 41 | accept kernel parameters in both forms like 8250_core.nr_uarts=4 and |
42 | 8250.nr_uarts=4. We now renamed the module back to 8250, but if | 42 | 8250.nr_uarts=4. We now renamed the module back to 8250, but if |
43 | anybody noticed in 3.7 and changed their userspace we still have to | 43 | anybody noticed in 3.7 and changed their userspace we still have to |
44 | keep the 8350_core.* options around until they revert the changes | 44 | keep the 8250_core.* options around until they revert the changes |
45 | they already did. | 45 | they already did. |
46 | 46 | ||
47 | If 8250 is built as a module, this adds 8250_core alias instead. | 47 | If 8250 is built as a module, this adds 8250_core alias instead. |
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index 481b781b26e3..e9d420ff3931 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c | |||
@@ -2052,6 +2052,9 @@ static int __init pmz_console_init(void) | |||
2052 | /* Probe ports */ | 2052 | /* Probe ports */ |
2053 | pmz_probe(); | 2053 | pmz_probe(); |
2054 | 2054 | ||
2055 | if (pmz_ports_count == 0) | ||
2056 | return -ENODEV; | ||
2057 | |||
2055 | /* TODO: Autoprobe console based on OF */ | 2058 | /* TODO: Autoprobe console based on OF */ |
2056 | /* pmz_console.index = i; */ | 2059 | /* pmz_console.index = i; */ |
2057 | register_console(&pmz_console); | 2060 | register_console(&pmz_console); |
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 3a1a01af9a80..c74a00ad7add 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -2086,6 +2086,7 @@ retry_open: | |||
2086 | filp->f_op = &tty_fops; | 2086 | filp->f_op = &tty_fops; |
2087 | goto retry_open; | 2087 | goto retry_open; |
2088 | } | 2088 | } |
2089 | clear_bit(TTY_HUPPED, &tty->flags); | ||
2089 | tty_unlock(tty); | 2090 | tty_unlock(tty); |
2090 | 2091 | ||
2091 | 2092 | ||
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index 67beb8444930..f7beb6eb40c7 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c | |||
@@ -653,6 +653,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma) | |||
653 | return -EINVAL; | 653 | return -EINVAL; |
654 | mem = idev->info->mem + mi; | 654 | mem = idev->info->mem + mi; |
655 | 655 | ||
656 | if (mem->addr & ~PAGE_MASK) | ||
657 | return -ENODEV; | ||
656 | if (vma->vm_end - vma->vm_start > mem->size) | 658 | if (vma->vm_end - vma->vm_start > mem->size) |
657 | return -EINVAL; | 659 | return -EINVAL; |
658 | 660 | ||
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 8521051cf946..cd961622f9c1 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
@@ -131,6 +131,7 @@ static const struct platform_device_id atmel_lcdfb_devtypes[] = { | |||
131 | /* terminator */ | 131 | /* terminator */ |
132 | } | 132 | } |
133 | }; | 133 | }; |
134 | MODULE_DEVICE_TABLE(platform, atmel_lcdfb_devtypes); | ||
134 | 135 | ||
135 | static struct atmel_lcdfb_config * | 136 | static struct atmel_lcdfb_config * |
136 | atmel_lcdfb_get_config(struct platform_device *pdev) | 137 | atmel_lcdfb_get_config(struct platform_device *pdev) |
diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c index 50c857477e4f..65041e15fd59 100644 --- a/drivers/video/kyro/fbdev.c +++ b/drivers/video/kyro/fbdev.c | |||
@@ -624,15 +624,15 @@ static int kyrofb_ioctl(struct fb_info *info, | |||
624 | return -EINVAL; | 624 | return -EINVAL; |
625 | } | 625 | } |
626 | case KYRO_IOCTL_UVSTRIDE: | 626 | case KYRO_IOCTL_UVSTRIDE: |
627 | if (copy_to_user(argp, &deviceInfo.ulOverlayUVStride, sizeof(unsigned long))) | 627 | if (copy_to_user(argp, &deviceInfo.ulOverlayUVStride, sizeof(deviceInfo.ulOverlayUVStride))) |
628 | return -EFAULT; | 628 | return -EFAULT; |
629 | break; | 629 | break; |
630 | case KYRO_IOCTL_STRIDE: | 630 | case KYRO_IOCTL_STRIDE: |
631 | if (copy_to_user(argp, &deviceInfo.ulOverlayStride, sizeof(unsigned long))) | 631 | if (copy_to_user(argp, &deviceInfo.ulOverlayStride, sizeof(deviceInfo.ulOverlayStride))) |
632 | return -EFAULT; | 632 | return -EFAULT; |
633 | break; | 633 | break; |
634 | case KYRO_IOCTL_OVERLAY_OFFSET: | 634 | case KYRO_IOCTL_OVERLAY_OFFSET: |
635 | if (copy_to_user(argp, &deviceInfo.ulOverlayOffset, sizeof(unsigned long))) | 635 | if (copy_to_user(argp, &deviceInfo.ulOverlayOffset, sizeof(deviceInfo.ulOverlayOffset))) |
636 | return -EFAULT; | 636 | return -EFAULT; |
637 | break; | 637 | break; |
638 | } | 638 | } |
diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c index e6d56f714ae4..d94f35dbd536 100644 --- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c +++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c | |||
@@ -526,6 +526,8 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev) | |||
526 | struct omap_dss_device *in = ddata->in; | 526 | struct omap_dss_device *in = ddata->in; |
527 | int r; | 527 | int r; |
528 | 528 | ||
529 | mutex_lock(&ddata->mutex); | ||
530 | |||
529 | dev_dbg(&ddata->spi->dev, "%s\n", __func__); | 531 | dev_dbg(&ddata->spi->dev, "%s\n", __func__); |
530 | 532 | ||
531 | in->ops.sdi->set_timings(in, &ddata->videomode); | 533 | in->ops.sdi->set_timings(in, &ddata->videomode); |
@@ -614,10 +616,7 @@ static int acx565akm_enable(struct omap_dss_device *dssdev) | |||
614 | if (omapdss_device_is_enabled(dssdev)) | 616 | if (omapdss_device_is_enabled(dssdev)) |
615 | return 0; | 617 | return 0; |
616 | 618 | ||
617 | mutex_lock(&ddata->mutex); | ||
618 | r = acx565akm_panel_power_on(dssdev); | 619 | r = acx565akm_panel_power_on(dssdev); |
619 | mutex_unlock(&ddata->mutex); | ||
620 | |||
621 | if (r) | 620 | if (r) |
622 | return r; | 621 | return r; |
623 | 622 | ||
diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c index e0f098562a74..a297de5cc859 100644 --- a/drivers/video/sh_mobile_meram.c +++ b/drivers/video/sh_mobile_meram.c | |||
@@ -569,6 +569,7 @@ EXPORT_SYMBOL_GPL(sh_mobile_meram_cache_update); | |||
569 | * Power management | 569 | * Power management |
570 | */ | 570 | */ |
571 | 571 | ||
572 | #if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME) | ||
572 | static int sh_mobile_meram_suspend(struct device *dev) | 573 | static int sh_mobile_meram_suspend(struct device *dev) |
573 | { | 574 | { |
574 | struct platform_device *pdev = to_platform_device(dev); | 575 | struct platform_device *pdev = to_platform_device(dev); |
@@ -611,6 +612,7 @@ static int sh_mobile_meram_resume(struct device *dev) | |||
611 | meram_write_reg(priv->base, common_regs[i], priv->regs[i]); | 612 | meram_write_reg(priv->base, common_regs[i], priv->regs[i]); |
612 | return 0; | 613 | return 0; |
613 | } | 614 | } |
615 | #endif /* CONFIG_PM_SLEEP || CONFIG_PM_RUNTIME */ | ||
614 | 616 | ||
615 | static UNIVERSAL_DEV_PM_OPS(sh_mobile_meram_dev_pm_ops, | 617 | static UNIVERSAL_DEV_PM_OPS(sh_mobile_meram_dev_pm_ops, |
616 | sh_mobile_meram_suspend, | 618 | sh_mobile_meram_suspend, |
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c index b30e5a439d1f..a8f2b280f796 100644 --- a/drivers/video/vt8500lcdfb.c +++ b/drivers/video/vt8500lcdfb.c | |||
@@ -293,8 +293,7 @@ static int vt8500lcd_probe(struct platform_device *pdev) | |||
293 | + sizeof(u32) * 16, GFP_KERNEL); | 293 | + sizeof(u32) * 16, GFP_KERNEL); |
294 | if (!fbi) { | 294 | if (!fbi) { |
295 | dev_err(&pdev->dev, "Failed to initialize framebuffer device\n"); | 295 | dev_err(&pdev->dev, "Failed to initialize framebuffer device\n"); |
296 | ret = -ENOMEM; | 296 | return -ENOMEM; |
297 | goto failed; | ||
298 | } | 297 | } |
299 | 298 | ||
300 | strcpy(fbi->fb.fix.id, "VT8500 LCD"); | 299 | strcpy(fbi->fb.fix.id, "VT8500 LCD"); |
@@ -327,15 +326,13 @@ static int vt8500lcd_probe(struct platform_device *pdev) | |||
327 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 326 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
328 | if (res == NULL) { | 327 | if (res == NULL) { |
329 | dev_err(&pdev->dev, "no I/O memory resource defined\n"); | 328 | dev_err(&pdev->dev, "no I/O memory resource defined\n"); |
330 | ret = -ENODEV; | 329 | return -ENODEV; |
331 | goto failed_fbi; | ||
332 | } | 330 | } |
333 | 331 | ||
334 | res = request_mem_region(res->start, resource_size(res), "vt8500lcd"); | 332 | res = request_mem_region(res->start, resource_size(res), "vt8500lcd"); |
335 | if (res == NULL) { | 333 | if (res == NULL) { |
336 | dev_err(&pdev->dev, "failed to request I/O memory\n"); | 334 | dev_err(&pdev->dev, "failed to request I/O memory\n"); |
337 | ret = -EBUSY; | 335 | return -EBUSY; |
338 | goto failed_fbi; | ||
339 | } | 336 | } |
340 | 337 | ||
341 | fbi->regbase = ioremap(res->start, resource_size(res)); | 338 | fbi->regbase = ioremap(res->start, resource_size(res)); |
@@ -346,17 +343,19 @@ static int vt8500lcd_probe(struct platform_device *pdev) | |||
346 | } | 343 | } |
347 | 344 | ||
348 | disp_timing = of_get_display_timings(pdev->dev.of_node); | 345 | disp_timing = of_get_display_timings(pdev->dev.of_node); |
349 | if (!disp_timing) | 346 | if (!disp_timing) { |
350 | return -EINVAL; | 347 | ret = -EINVAL; |
348 | goto failed_free_io; | ||
349 | } | ||
351 | 350 | ||
352 | ret = of_get_fb_videomode(pdev->dev.of_node, &of_mode, | 351 | ret = of_get_fb_videomode(pdev->dev.of_node, &of_mode, |
353 | OF_USE_NATIVE_MODE); | 352 | OF_USE_NATIVE_MODE); |
354 | if (ret) | 353 | if (ret) |
355 | return ret; | 354 | goto failed_free_io; |
356 | 355 | ||
357 | ret = of_property_read_u32(pdev->dev.of_node, "bits-per-pixel", &bpp); | 356 | ret = of_property_read_u32(pdev->dev.of_node, "bits-per-pixel", &bpp); |
358 | if (ret) | 357 | if (ret) |
359 | return ret; | 358 | goto failed_free_io; |
360 | 359 | ||
361 | /* try allocating the framebuffer */ | 360 | /* try allocating the framebuffer */ |
362 | fb_mem_len = of_mode.xres * of_mode.yres * 2 * (bpp / 8); | 361 | fb_mem_len = of_mode.xres * of_mode.yres * 2 * (bpp / 8); |
@@ -364,7 +363,8 @@ static int vt8500lcd_probe(struct platform_device *pdev) | |||
364 | GFP_KERNEL); | 363 | GFP_KERNEL); |
365 | if (!fb_mem_virt) { | 364 | if (!fb_mem_virt) { |
366 | pr_err("%s: Failed to allocate framebuffer\n", __func__); | 365 | pr_err("%s: Failed to allocate framebuffer\n", __func__); |
367 | return -ENOMEM; | 366 | ret = -ENOMEM; |
367 | goto failed_free_io; | ||
368 | } | 368 | } |
369 | 369 | ||
370 | fbi->fb.fix.smem_start = fb_mem_phys; | 370 | fbi->fb.fix.smem_start = fb_mem_phys; |
@@ -447,9 +447,6 @@ failed_free_io: | |||
447 | iounmap(fbi->regbase); | 447 | iounmap(fbi->regbase); |
448 | failed_free_res: | 448 | failed_free_res: |
449 | release_mem_region(res->start, resource_size(res)); | 449 | release_mem_region(res->start, resource_size(res)); |
450 | failed_fbi: | ||
451 | kfree(fbi); | ||
452 | failed: | ||
453 | return ret; | 450 | return ret; |
454 | } | 451 | } |
455 | 452 | ||
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 62ccf5424ba8..028387192b60 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c | |||
@@ -930,9 +930,10 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | |||
930 | ret = m2p_add_override(mfn, pages[i], kmap_ops ? | 930 | ret = m2p_add_override(mfn, pages[i], kmap_ops ? |
931 | &kmap_ops[i] : NULL); | 931 | &kmap_ops[i] : NULL); |
932 | if (ret) | 932 | if (ret) |
933 | return ret; | 933 | goto out; |
934 | } | 934 | } |
935 | 935 | ||
936 | out: | ||
936 | if (lazy) | 937 | if (lazy) |
937 | arch_leave_lazy_mmu_mode(); | 938 | arch_leave_lazy_mmu_mode(); |
938 | 939 | ||
@@ -969,9 +970,10 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | |||
969 | ret = m2p_remove_override(pages[i], kmap_ops ? | 970 | ret = m2p_remove_override(pages[i], kmap_ops ? |
970 | &kmap_ops[i] : NULL); | 971 | &kmap_ops[i] : NULL); |
971 | if (ret) | 972 | if (ret) |
972 | return ret; | 973 | goto out; |
973 | } | 974 | } |
974 | 975 | ||
976 | out: | ||
975 | if (lazy) | 977 | if (lazy) |
976 | arch_leave_lazy_mmu_mode(); | 978 | arch_leave_lazy_mmu_mode(); |
977 | 979 | ||
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index a224bc74b6b9..1eac0731c349 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c | |||
@@ -555,6 +555,11 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, | |||
555 | sg_dma_len(sgl) = 0; | 555 | sg_dma_len(sgl) = 0; |
556 | return 0; | 556 | return 0; |
557 | } | 557 | } |
558 | xen_dma_map_page(hwdev, pfn_to_page(map >> PAGE_SHIFT), | ||
559 | map & ~PAGE_MASK, | ||
560 | sg->length, | ||
561 | dir, | ||
562 | attrs); | ||
558 | sg->dma_address = xen_phys_to_bus(map); | 563 | sg->dma_address = xen_phys_to_bus(map); |
559 | } else { | 564 | } else { |
560 | /* we are not interested in the dma_addr returned by | 565 | /* we are not interested in the dma_addr returned by |
diff --git a/fs/affs/Changes b/fs/affs/Changes index a29409c1ffe0..b41c2c9792ff 100644 --- a/fs/affs/Changes +++ b/fs/affs/Changes | |||
@@ -91,7 +91,7 @@ more 2.4 fixes: [Roman Zippel] | |||
91 | Version 3.11 | 91 | Version 3.11 |
92 | ------------ | 92 | ------------ |
93 | 93 | ||
94 | - Converted to use 2.3.x page cache [Dave Jones <dave@powertweak.com>] | 94 | - Converted to use 2.3.x page cache [Dave Jones] |
95 | - Corruption in truncate() bugfix [Ken Tyler <kent@werple.net.au>] | 95 | - Corruption in truncate() bugfix [Ken Tyler <kent@werple.net.au>] |
96 | 96 | ||
97 | Version 3.10 | 97 | Version 3.10 |
@@ -367,8 +367,10 @@ static int aio_setup_ring(struct kioctx *ctx) | |||
367 | if (nr_pages > AIO_RING_PAGES) { | 367 | if (nr_pages > AIO_RING_PAGES) { |
368 | ctx->ring_pages = kcalloc(nr_pages, sizeof(struct page *), | 368 | ctx->ring_pages = kcalloc(nr_pages, sizeof(struct page *), |
369 | GFP_KERNEL); | 369 | GFP_KERNEL); |
370 | if (!ctx->ring_pages) | 370 | if (!ctx->ring_pages) { |
371 | put_aio_ring_file(ctx); | ||
371 | return -ENOMEM; | 372 | return -ENOMEM; |
373 | } | ||
372 | } | 374 | } |
373 | 375 | ||
374 | ctx->mmap_size = nr_pages * PAGE_SIZE; | 376 | ctx->mmap_size = nr_pages * PAGE_SIZE; |
@@ -645,7 +647,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) | |||
645 | aio_nr + nr_events < aio_nr) { | 647 | aio_nr + nr_events < aio_nr) { |
646 | spin_unlock(&aio_nr_lock); | 648 | spin_unlock(&aio_nr_lock); |
647 | err = -EAGAIN; | 649 | err = -EAGAIN; |
648 | goto err; | 650 | goto err_ctx; |
649 | } | 651 | } |
650 | aio_nr += ctx->max_reqs; | 652 | aio_nr += ctx->max_reqs; |
651 | spin_unlock(&aio_nr_lock); | 653 | spin_unlock(&aio_nr_lock); |
@@ -662,6 +664,8 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) | |||
662 | 664 | ||
663 | err_cleanup: | 665 | err_cleanup: |
664 | aio_nr_sub(ctx->max_reqs); | 666 | aio_nr_sub(ctx->max_reqs); |
667 | err_ctx: | ||
668 | aio_free_ring(ctx); | ||
665 | err: | 669 | err: |
666 | free_percpu(ctx->cpu); | 670 | free_percpu(ctx->cpu); |
667 | free_percpu(ctx->reqs.pcpu_count); | 671 | free_percpu(ctx->reqs.pcpu_count); |
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index b50764bef141..131d82800b3a 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c | |||
@@ -333,7 +333,6 @@ static void btrfsic_release_block_ctx(struct btrfsic_block_data_ctx *block_ctx); | |||
333 | static int btrfsic_read_block(struct btrfsic_state *state, | 333 | static int btrfsic_read_block(struct btrfsic_state *state, |
334 | struct btrfsic_block_data_ctx *block_ctx); | 334 | struct btrfsic_block_data_ctx *block_ctx); |
335 | static void btrfsic_dump_database(struct btrfsic_state *state); | 335 | static void btrfsic_dump_database(struct btrfsic_state *state); |
336 | static void btrfsic_complete_bio_end_io(struct bio *bio, int err); | ||
337 | static int btrfsic_test_for_metadata(struct btrfsic_state *state, | 336 | static int btrfsic_test_for_metadata(struct btrfsic_state *state, |
338 | char **datav, unsigned int num_pages); | 337 | char **datav, unsigned int num_pages); |
339 | static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state, | 338 | static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state, |
@@ -1687,7 +1686,6 @@ static int btrfsic_read_block(struct btrfsic_state *state, | |||
1687 | for (i = 0; i < num_pages;) { | 1686 | for (i = 0; i < num_pages;) { |
1688 | struct bio *bio; | 1687 | struct bio *bio; |
1689 | unsigned int j; | 1688 | unsigned int j; |
1690 | DECLARE_COMPLETION_ONSTACK(complete); | ||
1691 | 1689 | ||
1692 | bio = btrfs_io_bio_alloc(GFP_NOFS, num_pages - i); | 1690 | bio = btrfs_io_bio_alloc(GFP_NOFS, num_pages - i); |
1693 | if (!bio) { | 1691 | if (!bio) { |
@@ -1698,8 +1696,6 @@ static int btrfsic_read_block(struct btrfsic_state *state, | |||
1698 | } | 1696 | } |
1699 | bio->bi_bdev = block_ctx->dev->bdev; | 1697 | bio->bi_bdev = block_ctx->dev->bdev; |
1700 | bio->bi_sector = dev_bytenr >> 9; | 1698 | bio->bi_sector = dev_bytenr >> 9; |
1701 | bio->bi_end_io = btrfsic_complete_bio_end_io; | ||
1702 | bio->bi_private = &complete; | ||
1703 | 1699 | ||
1704 | for (j = i; j < num_pages; j++) { | 1700 | for (j = i; j < num_pages; j++) { |
1705 | ret = bio_add_page(bio, block_ctx->pagev[j], | 1701 | ret = bio_add_page(bio, block_ctx->pagev[j], |
@@ -1712,12 +1708,7 @@ static int btrfsic_read_block(struct btrfsic_state *state, | |||
1712 | "btrfsic: error, failed to add a single page!\n"); | 1708 | "btrfsic: error, failed to add a single page!\n"); |
1713 | return -1; | 1709 | return -1; |
1714 | } | 1710 | } |
1715 | submit_bio(READ, bio); | 1711 | if (submit_bio_wait(READ, bio)) { |
1716 | |||
1717 | /* this will also unplug the queue */ | ||
1718 | wait_for_completion(&complete); | ||
1719 | |||
1720 | if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) { | ||
1721 | printk(KERN_INFO | 1712 | printk(KERN_INFO |
1722 | "btrfsic: read error at logical %llu dev %s!\n", | 1713 | "btrfsic: read error at logical %llu dev %s!\n", |
1723 | block_ctx->start, block_ctx->dev->name); | 1714 | block_ctx->start, block_ctx->dev->name); |
@@ -1740,11 +1731,6 @@ static int btrfsic_read_block(struct btrfsic_state *state, | |||
1740 | return block_ctx->len; | 1731 | return block_ctx->len; |
1741 | } | 1732 | } |
1742 | 1733 | ||
1743 | static void btrfsic_complete_bio_end_io(struct bio *bio, int err) | ||
1744 | { | ||
1745 | complete((struct completion *)bio->bi_private); | ||
1746 | } | ||
1747 | |||
1748 | static void btrfsic_dump_database(struct btrfsic_state *state) | 1734 | static void btrfsic_dump_database(struct btrfsic_state *state) |
1749 | { | 1735 | { |
1750 | struct list_head *elem_all; | 1736 | struct list_head *elem_all; |
@@ -3008,14 +2994,12 @@ int btrfsic_submit_bh(int rw, struct buffer_head *bh) | |||
3008 | return submit_bh(rw, bh); | 2994 | return submit_bh(rw, bh); |
3009 | } | 2995 | } |
3010 | 2996 | ||
3011 | void btrfsic_submit_bio(int rw, struct bio *bio) | 2997 | static void __btrfsic_submit_bio(int rw, struct bio *bio) |
3012 | { | 2998 | { |
3013 | struct btrfsic_dev_state *dev_state; | 2999 | struct btrfsic_dev_state *dev_state; |
3014 | 3000 | ||
3015 | if (!btrfsic_is_initialized) { | 3001 | if (!btrfsic_is_initialized) |
3016 | submit_bio(rw, bio); | ||
3017 | return; | 3002 | return; |
3018 | } | ||
3019 | 3003 | ||
3020 | mutex_lock(&btrfsic_mutex); | 3004 | mutex_lock(&btrfsic_mutex); |
3021 | /* since btrfsic_submit_bio() is also called before | 3005 | /* since btrfsic_submit_bio() is also called before |
@@ -3106,10 +3090,20 @@ void btrfsic_submit_bio(int rw, struct bio *bio) | |||
3106 | } | 3090 | } |
3107 | leave: | 3091 | leave: |
3108 | mutex_unlock(&btrfsic_mutex); | 3092 | mutex_unlock(&btrfsic_mutex); |
3093 | } | ||
3109 | 3094 | ||
3095 | void btrfsic_submit_bio(int rw, struct bio *bio) | ||
3096 | { | ||
3097 | __btrfsic_submit_bio(rw, bio); | ||
3110 | submit_bio(rw, bio); | 3098 | submit_bio(rw, bio); |
3111 | } | 3099 | } |
3112 | 3100 | ||
3101 | int btrfsic_submit_bio_wait(int rw, struct bio *bio) | ||
3102 | { | ||
3103 | __btrfsic_submit_bio(rw, bio); | ||
3104 | return submit_bio_wait(rw, bio); | ||
3105 | } | ||
3106 | |||
3113 | int btrfsic_mount(struct btrfs_root *root, | 3107 | int btrfsic_mount(struct btrfs_root *root, |
3114 | struct btrfs_fs_devices *fs_devices, | 3108 | struct btrfs_fs_devices *fs_devices, |
3115 | int including_extent_data, u32 print_mask) | 3109 | int including_extent_data, u32 print_mask) |
diff --git a/fs/btrfs/check-integrity.h b/fs/btrfs/check-integrity.h index 8b59175cc502..13b8566c97ab 100644 --- a/fs/btrfs/check-integrity.h +++ b/fs/btrfs/check-integrity.h | |||
@@ -22,9 +22,11 @@ | |||
22 | #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY | 22 | #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY |
23 | int btrfsic_submit_bh(int rw, struct buffer_head *bh); | 23 | int btrfsic_submit_bh(int rw, struct buffer_head *bh); |
24 | void btrfsic_submit_bio(int rw, struct bio *bio); | 24 | void btrfsic_submit_bio(int rw, struct bio *bio); |
25 | int btrfsic_submit_bio_wait(int rw, struct bio *bio); | ||
25 | #else | 26 | #else |
26 | #define btrfsic_submit_bh submit_bh | 27 | #define btrfsic_submit_bh submit_bh |
27 | #define btrfsic_submit_bio submit_bio | 28 | #define btrfsic_submit_bio submit_bio |
29 | #define btrfsic_submit_bio_wait submit_bio_wait | ||
28 | #endif | 30 | #endif |
29 | 31 | ||
30 | int btrfsic_mount(struct btrfs_root *root, | 32 | int btrfsic_mount(struct btrfs_root *root, |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 8e457fca0a0b..ff43802a7c88 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -1952,11 +1952,6 @@ static int free_io_failure(struct inode *inode, struct io_failure_record *rec, | |||
1952 | return err; | 1952 | return err; |
1953 | } | 1953 | } |
1954 | 1954 | ||
1955 | static void repair_io_failure_callback(struct bio *bio, int err) | ||
1956 | { | ||
1957 | complete(bio->bi_private); | ||
1958 | } | ||
1959 | |||
1960 | /* | 1955 | /* |
1961 | * this bypasses the standard btrfs submit functions deliberately, as | 1956 | * this bypasses the standard btrfs submit functions deliberately, as |
1962 | * the standard behavior is to write all copies in a raid setup. here we only | 1957 | * the standard behavior is to write all copies in a raid setup. here we only |
@@ -1973,7 +1968,6 @@ int repair_io_failure(struct btrfs_fs_info *fs_info, u64 start, | |||
1973 | { | 1968 | { |
1974 | struct bio *bio; | 1969 | struct bio *bio; |
1975 | struct btrfs_device *dev; | 1970 | struct btrfs_device *dev; |
1976 | DECLARE_COMPLETION_ONSTACK(compl); | ||
1977 | u64 map_length = 0; | 1971 | u64 map_length = 0; |
1978 | u64 sector; | 1972 | u64 sector; |
1979 | struct btrfs_bio *bbio = NULL; | 1973 | struct btrfs_bio *bbio = NULL; |
@@ -1990,8 +1984,6 @@ int repair_io_failure(struct btrfs_fs_info *fs_info, u64 start, | |||
1990 | bio = btrfs_io_bio_alloc(GFP_NOFS, 1); | 1984 | bio = btrfs_io_bio_alloc(GFP_NOFS, 1); |
1991 | if (!bio) | 1985 | if (!bio) |
1992 | return -EIO; | 1986 | return -EIO; |
1993 | bio->bi_private = &compl; | ||
1994 | bio->bi_end_io = repair_io_failure_callback; | ||
1995 | bio->bi_size = 0; | 1987 | bio->bi_size = 0; |
1996 | map_length = length; | 1988 | map_length = length; |
1997 | 1989 | ||
@@ -2012,10 +2004,8 @@ int repair_io_failure(struct btrfs_fs_info *fs_info, u64 start, | |||
2012 | } | 2004 | } |
2013 | bio->bi_bdev = dev->bdev; | 2005 | bio->bi_bdev = dev->bdev; |
2014 | bio_add_page(bio, page, length, start - page_offset(page)); | 2006 | bio_add_page(bio, page, length, start - page_offset(page)); |
2015 | btrfsic_submit_bio(WRITE_SYNC, bio); | ||
2016 | wait_for_completion(&compl); | ||
2017 | 2007 | ||
2018 | if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) { | 2008 | if (btrfsic_submit_bio_wait(WRITE_SYNC, bio)) { |
2019 | /* try to remap that extent elsewhere? */ | 2009 | /* try to remap that extent elsewhere? */ |
2020 | bio_put(bio); | 2010 | bio_put(bio); |
2021 | btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS); | 2011 | btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS); |
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 561e2f16ba3e..1fd3f33c330a 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -208,7 +208,6 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info, | |||
208 | int is_metadata, int have_csum, | 208 | int is_metadata, int have_csum, |
209 | const u8 *csum, u64 generation, | 209 | const u8 *csum, u64 generation, |
210 | u16 csum_size); | 210 | u16 csum_size); |
211 | static void scrub_complete_bio_end_io(struct bio *bio, int err); | ||
212 | static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, | 211 | static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, |
213 | struct scrub_block *sblock_good, | 212 | struct scrub_block *sblock_good, |
214 | int force_write); | 213 | int force_write); |
@@ -1294,7 +1293,6 @@ static void scrub_recheck_block(struct btrfs_fs_info *fs_info, | |||
1294 | for (page_num = 0; page_num < sblock->page_count; page_num++) { | 1293 | for (page_num = 0; page_num < sblock->page_count; page_num++) { |
1295 | struct bio *bio; | 1294 | struct bio *bio; |
1296 | struct scrub_page *page = sblock->pagev[page_num]; | 1295 | struct scrub_page *page = sblock->pagev[page_num]; |
1297 | DECLARE_COMPLETION_ONSTACK(complete); | ||
1298 | 1296 | ||
1299 | if (page->dev->bdev == NULL) { | 1297 | if (page->dev->bdev == NULL) { |
1300 | page->io_error = 1; | 1298 | page->io_error = 1; |
@@ -1311,18 +1309,11 @@ static void scrub_recheck_block(struct btrfs_fs_info *fs_info, | |||
1311 | } | 1309 | } |
1312 | bio->bi_bdev = page->dev->bdev; | 1310 | bio->bi_bdev = page->dev->bdev; |
1313 | bio->bi_sector = page->physical >> 9; | 1311 | bio->bi_sector = page->physical >> 9; |
1314 | bio->bi_end_io = scrub_complete_bio_end_io; | ||
1315 | bio->bi_private = &complete; | ||
1316 | 1312 | ||
1317 | bio_add_page(bio, page->page, PAGE_SIZE, 0); | 1313 | bio_add_page(bio, page->page, PAGE_SIZE, 0); |
1318 | btrfsic_submit_bio(READ, bio); | 1314 | if (btrfsic_submit_bio_wait(READ, bio)) |
1319 | |||
1320 | /* this will also unplug the queue */ | ||
1321 | wait_for_completion(&complete); | ||
1322 | |||
1323 | page->io_error = !test_bit(BIO_UPTODATE, &bio->bi_flags); | ||
1324 | if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) | ||
1325 | sblock->no_io_error_seen = 0; | 1315 | sblock->no_io_error_seen = 0; |
1316 | |||
1326 | bio_put(bio); | 1317 | bio_put(bio); |
1327 | } | 1318 | } |
1328 | 1319 | ||
@@ -1391,11 +1382,6 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info, | |||
1391 | sblock->checksum_error = 1; | 1382 | sblock->checksum_error = 1; |
1392 | } | 1383 | } |
1393 | 1384 | ||
1394 | static void scrub_complete_bio_end_io(struct bio *bio, int err) | ||
1395 | { | ||
1396 | complete((struct completion *)bio->bi_private); | ||
1397 | } | ||
1398 | |||
1399 | static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, | 1385 | static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, |
1400 | struct scrub_block *sblock_good, | 1386 | struct scrub_block *sblock_good, |
1401 | int force_write) | 1387 | int force_write) |
@@ -1430,7 +1416,6 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, | |||
1430 | sblock_bad->checksum_error || page_bad->io_error) { | 1416 | sblock_bad->checksum_error || page_bad->io_error) { |
1431 | struct bio *bio; | 1417 | struct bio *bio; |
1432 | int ret; | 1418 | int ret; |
1433 | DECLARE_COMPLETION_ONSTACK(complete); | ||
1434 | 1419 | ||
1435 | if (!page_bad->dev->bdev) { | 1420 | if (!page_bad->dev->bdev) { |
1436 | printk_ratelimited(KERN_WARNING | 1421 | printk_ratelimited(KERN_WARNING |
@@ -1443,19 +1428,14 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, | |||
1443 | return -EIO; | 1428 | return -EIO; |
1444 | bio->bi_bdev = page_bad->dev->bdev; | 1429 | bio->bi_bdev = page_bad->dev->bdev; |
1445 | bio->bi_sector = page_bad->physical >> 9; | 1430 | bio->bi_sector = page_bad->physical >> 9; |
1446 | bio->bi_end_io = scrub_complete_bio_end_io; | ||
1447 | bio->bi_private = &complete; | ||
1448 | 1431 | ||
1449 | ret = bio_add_page(bio, page_good->page, PAGE_SIZE, 0); | 1432 | ret = bio_add_page(bio, page_good->page, PAGE_SIZE, 0); |
1450 | if (PAGE_SIZE != ret) { | 1433 | if (PAGE_SIZE != ret) { |
1451 | bio_put(bio); | 1434 | bio_put(bio); |
1452 | return -EIO; | 1435 | return -EIO; |
1453 | } | 1436 | } |
1454 | btrfsic_submit_bio(WRITE, bio); | ||
1455 | 1437 | ||
1456 | /* this will also unplug the queue */ | 1438 | if (btrfsic_submit_bio_wait(WRITE, bio)) { |
1457 | wait_for_completion(&complete); | ||
1458 | if (!bio_flagged(bio, BIO_UPTODATE)) { | ||
1459 | btrfs_dev_stat_inc_and_print(page_bad->dev, | 1439 | btrfs_dev_stat_inc_and_print(page_bad->dev, |
1460 | BTRFS_DEV_STAT_WRITE_ERRS); | 1440 | BTRFS_DEV_STAT_WRITE_ERRS); |
1461 | btrfs_dev_replace_stats_inc( | 1441 | btrfs_dev_replace_stats_inc( |
@@ -3375,7 +3355,6 @@ static int write_page_nocow(struct scrub_ctx *sctx, | |||
3375 | struct bio *bio; | 3355 | struct bio *bio; |
3376 | struct btrfs_device *dev; | 3356 | struct btrfs_device *dev; |
3377 | int ret; | 3357 | int ret; |
3378 | DECLARE_COMPLETION_ONSTACK(compl); | ||
3379 | 3358 | ||
3380 | dev = sctx->wr_ctx.tgtdev; | 3359 | dev = sctx->wr_ctx.tgtdev; |
3381 | if (!dev) | 3360 | if (!dev) |
@@ -3392,8 +3371,6 @@ static int write_page_nocow(struct scrub_ctx *sctx, | |||
3392 | spin_unlock(&sctx->stat_lock); | 3371 | spin_unlock(&sctx->stat_lock); |
3393 | return -ENOMEM; | 3372 | return -ENOMEM; |
3394 | } | 3373 | } |
3395 | bio->bi_private = &compl; | ||
3396 | bio->bi_end_io = scrub_complete_bio_end_io; | ||
3397 | bio->bi_size = 0; | 3374 | bio->bi_size = 0; |
3398 | bio->bi_sector = physical_for_dev_replace >> 9; | 3375 | bio->bi_sector = physical_for_dev_replace >> 9; |
3399 | bio->bi_bdev = dev->bdev; | 3376 | bio->bi_bdev = dev->bdev; |
@@ -3404,10 +3381,8 @@ leave_with_eio: | |||
3404 | btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS); | 3381 | btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS); |
3405 | return -EIO; | 3382 | return -EIO; |
3406 | } | 3383 | } |
3407 | btrfsic_submit_bio(WRITE_SYNC, bio); | ||
3408 | wait_for_completion(&compl); | ||
3409 | 3384 | ||
3410 | if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) | 3385 | if (btrfsic_submit_bio_wait(WRITE_SYNC, bio)) |
3411 | goto leave_with_eio; | 3386 | goto leave_with_eio; |
3412 | 3387 | ||
3413 | bio_put(bio); | 3388 | bio_put(bio); |
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 6df8bd481425..1e561c059539 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -216,7 +216,7 @@ static int readpage_nounlock(struct file *filp, struct page *page) | |||
216 | } | 216 | } |
217 | SetPageUptodate(page); | 217 | SetPageUptodate(page); |
218 | 218 | ||
219 | if (err == 0) | 219 | if (err >= 0) |
220 | ceph_readpage_to_fscache(inode, page); | 220 | ceph_readpage_to_fscache(inode, page); |
221 | 221 | ||
222 | out: | 222 | out: |
diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c index 7db2e6ca4b8f..8c44fdd4e1c3 100644 --- a/fs/ceph/cache.c +++ b/fs/ceph/cache.c | |||
@@ -324,6 +324,9 @@ void ceph_invalidate_fscache_page(struct inode* inode, struct page *page) | |||
324 | { | 324 | { |
325 | struct ceph_inode_info *ci = ceph_inode(inode); | 325 | struct ceph_inode_info *ci = ceph_inode(inode); |
326 | 326 | ||
327 | if (!PageFsCache(page)) | ||
328 | return; | ||
329 | |||
327 | fscache_wait_on_page_write(ci->fscache, page); | 330 | fscache_wait_on_page_write(ci->fscache, page); |
328 | fscache_uncache_page(ci->fscache, page); | 331 | fscache_uncache_page(ci->fscache, page); |
329 | } | 332 | } |
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 13976c33332e..3c0a4bd74996 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -897,7 +897,7 @@ static int __ceph_is_any_caps(struct ceph_inode_info *ci) | |||
897 | * caller should hold i_ceph_lock. | 897 | * caller should hold i_ceph_lock. |
898 | * caller will not hold session s_mutex if called from destroy_inode. | 898 | * caller will not hold session s_mutex if called from destroy_inode. |
899 | */ | 899 | */ |
900 | void __ceph_remove_cap(struct ceph_cap *cap) | 900 | void __ceph_remove_cap(struct ceph_cap *cap, bool queue_release) |
901 | { | 901 | { |
902 | struct ceph_mds_session *session = cap->session; | 902 | struct ceph_mds_session *session = cap->session; |
903 | struct ceph_inode_info *ci = cap->ci; | 903 | struct ceph_inode_info *ci = cap->ci; |
@@ -909,6 +909,16 @@ void __ceph_remove_cap(struct ceph_cap *cap) | |||
909 | 909 | ||
910 | /* remove from session list */ | 910 | /* remove from session list */ |
911 | spin_lock(&session->s_cap_lock); | 911 | spin_lock(&session->s_cap_lock); |
912 | /* | ||
913 | * s_cap_reconnect is protected by s_cap_lock. no one changes | ||
914 | * s_cap_gen while session is in the reconnect state. | ||
915 | */ | ||
916 | if (queue_release && | ||
917 | (!session->s_cap_reconnect || | ||
918 | cap->cap_gen == session->s_cap_gen)) | ||
919 | __queue_cap_release(session, ci->i_vino.ino, cap->cap_id, | ||
920 | cap->mseq, cap->issue_seq); | ||
921 | |||
912 | if (session->s_cap_iterator == cap) { | 922 | if (session->s_cap_iterator == cap) { |
913 | /* not yet, we are iterating over this very cap */ | 923 | /* not yet, we are iterating over this very cap */ |
914 | dout("__ceph_remove_cap delaying %p removal from session %p\n", | 924 | dout("__ceph_remove_cap delaying %p removal from session %p\n", |
@@ -1023,7 +1033,6 @@ void __queue_cap_release(struct ceph_mds_session *session, | |||
1023 | struct ceph_mds_cap_release *head; | 1033 | struct ceph_mds_cap_release *head; |
1024 | struct ceph_mds_cap_item *item; | 1034 | struct ceph_mds_cap_item *item; |
1025 | 1035 | ||
1026 | spin_lock(&session->s_cap_lock); | ||
1027 | BUG_ON(!session->s_num_cap_releases); | 1036 | BUG_ON(!session->s_num_cap_releases); |
1028 | msg = list_first_entry(&session->s_cap_releases, | 1037 | msg = list_first_entry(&session->s_cap_releases, |
1029 | struct ceph_msg, list_head); | 1038 | struct ceph_msg, list_head); |
@@ -1052,7 +1061,6 @@ void __queue_cap_release(struct ceph_mds_session *session, | |||
1052 | (int)CEPH_CAPS_PER_RELEASE, | 1061 | (int)CEPH_CAPS_PER_RELEASE, |
1053 | (int)msg->front.iov_len); | 1062 | (int)msg->front.iov_len); |
1054 | } | 1063 | } |
1055 | spin_unlock(&session->s_cap_lock); | ||
1056 | } | 1064 | } |
1057 | 1065 | ||
1058 | /* | 1066 | /* |
@@ -1067,12 +1075,8 @@ void ceph_queue_caps_release(struct inode *inode) | |||
1067 | p = rb_first(&ci->i_caps); | 1075 | p = rb_first(&ci->i_caps); |
1068 | while (p) { | 1076 | while (p) { |
1069 | struct ceph_cap *cap = rb_entry(p, struct ceph_cap, ci_node); | 1077 | struct ceph_cap *cap = rb_entry(p, struct ceph_cap, ci_node); |
1070 | struct ceph_mds_session *session = cap->session; | ||
1071 | |||
1072 | __queue_cap_release(session, ceph_ino(inode), cap->cap_id, | ||
1073 | cap->mseq, cap->issue_seq); | ||
1074 | p = rb_next(p); | 1078 | p = rb_next(p); |
1075 | __ceph_remove_cap(cap); | 1079 | __ceph_remove_cap(cap, true); |
1076 | } | 1080 | } |
1077 | } | 1081 | } |
1078 | 1082 | ||
@@ -2791,7 +2795,7 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex, | |||
2791 | } | 2795 | } |
2792 | spin_unlock(&mdsc->cap_dirty_lock); | 2796 | spin_unlock(&mdsc->cap_dirty_lock); |
2793 | } | 2797 | } |
2794 | __ceph_remove_cap(cap); | 2798 | __ceph_remove_cap(cap, false); |
2795 | } | 2799 | } |
2796 | /* else, we already released it */ | 2800 | /* else, we already released it */ |
2797 | 2801 | ||
@@ -2931,9 +2935,12 @@ void ceph_handle_caps(struct ceph_mds_session *session, | |||
2931 | if (!inode) { | 2935 | if (!inode) { |
2932 | dout(" i don't have ino %llx\n", vino.ino); | 2936 | dout(" i don't have ino %llx\n", vino.ino); |
2933 | 2937 | ||
2934 | if (op == CEPH_CAP_OP_IMPORT) | 2938 | if (op == CEPH_CAP_OP_IMPORT) { |
2939 | spin_lock(&session->s_cap_lock); | ||
2935 | __queue_cap_release(session, vino.ino, cap_id, | 2940 | __queue_cap_release(session, vino.ino, cap_id, |
2936 | mseq, seq); | 2941 | mseq, seq); |
2942 | spin_unlock(&session->s_cap_lock); | ||
2943 | } | ||
2937 | goto flush_cap_releases; | 2944 | goto flush_cap_releases; |
2938 | } | 2945 | } |
2939 | 2946 | ||
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 868b61d56cac..2a0bcaeb189a 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -352,8 +352,18 @@ more: | |||
352 | } | 352 | } |
353 | 353 | ||
354 | /* note next offset and last dentry name */ | 354 | /* note next offset and last dentry name */ |
355 | rinfo = &req->r_reply_info; | ||
356 | if (le32_to_cpu(rinfo->dir_dir->frag) != frag) { | ||
357 | frag = le32_to_cpu(rinfo->dir_dir->frag); | ||
358 | if (ceph_frag_is_leftmost(frag)) | ||
359 | fi->next_offset = 2; | ||
360 | else | ||
361 | fi->next_offset = 0; | ||
362 | off = fi->next_offset; | ||
363 | } | ||
355 | fi->offset = fi->next_offset; | 364 | fi->offset = fi->next_offset; |
356 | fi->last_readdir = req; | 365 | fi->last_readdir = req; |
366 | fi->frag = frag; | ||
357 | 367 | ||
358 | if (req->r_reply_info.dir_end) { | 368 | if (req->r_reply_info.dir_end) { |
359 | kfree(fi->last_name); | 369 | kfree(fi->last_name); |
@@ -363,7 +373,6 @@ more: | |||
363 | else | 373 | else |
364 | fi->next_offset = 0; | 374 | fi->next_offset = 0; |
365 | } else { | 375 | } else { |
366 | rinfo = &req->r_reply_info; | ||
367 | err = note_last_dentry(fi, | 376 | err = note_last_dentry(fi, |
368 | rinfo->dir_dname[rinfo->dir_nr-1], | 377 | rinfo->dir_dname[rinfo->dir_nr-1], |
369 | rinfo->dir_dname_len[rinfo->dir_nr-1]); | 378 | rinfo->dir_dname_len[rinfo->dir_nr-1]); |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 8549a48115f7..9a8e396aed89 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -577,6 +577,8 @@ static int fill_inode(struct inode *inode, | |||
577 | int issued = 0, implemented; | 577 | int issued = 0, implemented; |
578 | struct timespec mtime, atime, ctime; | 578 | struct timespec mtime, atime, ctime; |
579 | u32 nsplits; | 579 | u32 nsplits; |
580 | struct ceph_inode_frag *frag; | ||
581 | struct rb_node *rb_node; | ||
580 | struct ceph_buffer *xattr_blob = NULL; | 582 | struct ceph_buffer *xattr_blob = NULL; |
581 | int err = 0; | 583 | int err = 0; |
582 | int queue_trunc = 0; | 584 | int queue_trunc = 0; |
@@ -751,15 +753,38 @@ no_change: | |||
751 | /* FIXME: move me up, if/when version reflects fragtree changes */ | 753 | /* FIXME: move me up, if/when version reflects fragtree changes */ |
752 | nsplits = le32_to_cpu(info->fragtree.nsplits); | 754 | nsplits = le32_to_cpu(info->fragtree.nsplits); |
753 | mutex_lock(&ci->i_fragtree_mutex); | 755 | mutex_lock(&ci->i_fragtree_mutex); |
756 | rb_node = rb_first(&ci->i_fragtree); | ||
754 | for (i = 0; i < nsplits; i++) { | 757 | for (i = 0; i < nsplits; i++) { |
755 | u32 id = le32_to_cpu(info->fragtree.splits[i].frag); | 758 | u32 id = le32_to_cpu(info->fragtree.splits[i].frag); |
756 | struct ceph_inode_frag *frag = __get_or_create_frag(ci, id); | 759 | frag = NULL; |
757 | 760 | while (rb_node) { | |
758 | if (IS_ERR(frag)) | 761 | frag = rb_entry(rb_node, struct ceph_inode_frag, node); |
759 | continue; | 762 | if (ceph_frag_compare(frag->frag, id) >= 0) { |
763 | if (frag->frag != id) | ||
764 | frag = NULL; | ||
765 | else | ||
766 | rb_node = rb_next(rb_node); | ||
767 | break; | ||
768 | } | ||
769 | rb_node = rb_next(rb_node); | ||
770 | rb_erase(&frag->node, &ci->i_fragtree); | ||
771 | kfree(frag); | ||
772 | frag = NULL; | ||
773 | } | ||
774 | if (!frag) { | ||
775 | frag = __get_or_create_frag(ci, id); | ||
776 | if (IS_ERR(frag)) | ||
777 | continue; | ||
778 | } | ||
760 | frag->split_by = le32_to_cpu(info->fragtree.splits[i].by); | 779 | frag->split_by = le32_to_cpu(info->fragtree.splits[i].by); |
761 | dout(" frag %x split by %d\n", frag->frag, frag->split_by); | 780 | dout(" frag %x split by %d\n", frag->frag, frag->split_by); |
762 | } | 781 | } |
782 | while (rb_node) { | ||
783 | frag = rb_entry(rb_node, struct ceph_inode_frag, node); | ||
784 | rb_node = rb_next(rb_node); | ||
785 | rb_erase(&frag->node, &ci->i_fragtree); | ||
786 | kfree(frag); | ||
787 | } | ||
763 | mutex_unlock(&ci->i_fragtree_mutex); | 788 | mutex_unlock(&ci->i_fragtree_mutex); |
764 | 789 | ||
765 | /* were we issued a capability? */ | 790 | /* were we issued a capability? */ |
@@ -1250,8 +1275,20 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req, | |||
1250 | int err = 0, i; | 1275 | int err = 0, i; |
1251 | struct inode *snapdir = NULL; | 1276 | struct inode *snapdir = NULL; |
1252 | struct ceph_mds_request_head *rhead = req->r_request->front.iov_base; | 1277 | struct ceph_mds_request_head *rhead = req->r_request->front.iov_base; |
1253 | u64 frag = le32_to_cpu(rhead->args.readdir.frag); | ||
1254 | struct ceph_dentry_info *di; | 1278 | struct ceph_dentry_info *di; |
1279 | u64 r_readdir_offset = req->r_readdir_offset; | ||
1280 | u32 frag = le32_to_cpu(rhead->args.readdir.frag); | ||
1281 | |||
1282 | if (rinfo->dir_dir && | ||
1283 | le32_to_cpu(rinfo->dir_dir->frag) != frag) { | ||
1284 | dout("readdir_prepopulate got new frag %x -> %x\n", | ||
1285 | frag, le32_to_cpu(rinfo->dir_dir->frag)); | ||
1286 | frag = le32_to_cpu(rinfo->dir_dir->frag); | ||
1287 | if (ceph_frag_is_leftmost(frag)) | ||
1288 | r_readdir_offset = 2; | ||
1289 | else | ||
1290 | r_readdir_offset = 0; | ||
1291 | } | ||
1255 | 1292 | ||
1256 | if (req->r_aborted) | 1293 | if (req->r_aborted) |
1257 | return readdir_prepopulate_inodes_only(req, session); | 1294 | return readdir_prepopulate_inodes_only(req, session); |
@@ -1315,7 +1352,7 @@ retry_lookup: | |||
1315 | } | 1352 | } |
1316 | 1353 | ||
1317 | di = dn->d_fsdata; | 1354 | di = dn->d_fsdata; |
1318 | di->offset = ceph_make_fpos(frag, i + req->r_readdir_offset); | 1355 | di->offset = ceph_make_fpos(frag, i + r_readdir_offset); |
1319 | 1356 | ||
1320 | /* inode */ | 1357 | /* inode */ |
1321 | if (dn->d_inode) { | 1358 | if (dn->d_inode) { |
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index b7bda5d9611d..d90861f45210 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -43,6 +43,7 @@ | |||
43 | */ | 43 | */ |
44 | 44 | ||
45 | struct ceph_reconnect_state { | 45 | struct ceph_reconnect_state { |
46 | int nr_caps; | ||
46 | struct ceph_pagelist *pagelist; | 47 | struct ceph_pagelist *pagelist; |
47 | bool flock; | 48 | bool flock; |
48 | }; | 49 | }; |
@@ -443,6 +444,7 @@ static struct ceph_mds_session *register_session(struct ceph_mds_client *mdsc, | |||
443 | INIT_LIST_HEAD(&s->s_waiting); | 444 | INIT_LIST_HEAD(&s->s_waiting); |
444 | INIT_LIST_HEAD(&s->s_unsafe); | 445 | INIT_LIST_HEAD(&s->s_unsafe); |
445 | s->s_num_cap_releases = 0; | 446 | s->s_num_cap_releases = 0; |
447 | s->s_cap_reconnect = 0; | ||
446 | s->s_cap_iterator = NULL; | 448 | s->s_cap_iterator = NULL; |
447 | INIT_LIST_HEAD(&s->s_cap_releases); | 449 | INIT_LIST_HEAD(&s->s_cap_releases); |
448 | INIT_LIST_HEAD(&s->s_cap_releases_done); | 450 | INIT_LIST_HEAD(&s->s_cap_releases_done); |
@@ -642,6 +644,8 @@ static void __unregister_request(struct ceph_mds_client *mdsc, | |||
642 | req->r_unsafe_dir = NULL; | 644 | req->r_unsafe_dir = NULL; |
643 | } | 645 | } |
644 | 646 | ||
647 | complete_all(&req->r_safe_completion); | ||
648 | |||
645 | ceph_mdsc_put_request(req); | 649 | ceph_mdsc_put_request(req); |
646 | } | 650 | } |
647 | 651 | ||
@@ -986,7 +990,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap, | |||
986 | dout("removing cap %p, ci is %p, inode is %p\n", | 990 | dout("removing cap %p, ci is %p, inode is %p\n", |
987 | cap, ci, &ci->vfs_inode); | 991 | cap, ci, &ci->vfs_inode); |
988 | spin_lock(&ci->i_ceph_lock); | 992 | spin_lock(&ci->i_ceph_lock); |
989 | __ceph_remove_cap(cap); | 993 | __ceph_remove_cap(cap, false); |
990 | if (!__ceph_is_any_real_caps(ci)) { | 994 | if (!__ceph_is_any_real_caps(ci)) { |
991 | struct ceph_mds_client *mdsc = | 995 | struct ceph_mds_client *mdsc = |
992 | ceph_sb_to_client(inode->i_sb)->mdsc; | 996 | ceph_sb_to_client(inode->i_sb)->mdsc; |
@@ -1231,9 +1235,7 @@ static int trim_caps_cb(struct inode *inode, struct ceph_cap *cap, void *arg) | |||
1231 | session->s_trim_caps--; | 1235 | session->s_trim_caps--; |
1232 | if (oissued) { | 1236 | if (oissued) { |
1233 | /* we aren't the only cap.. just remove us */ | 1237 | /* we aren't the only cap.. just remove us */ |
1234 | __queue_cap_release(session, ceph_ino(inode), cap->cap_id, | 1238 | __ceph_remove_cap(cap, true); |
1235 | cap->mseq, cap->issue_seq); | ||
1236 | __ceph_remove_cap(cap); | ||
1237 | } else { | 1239 | } else { |
1238 | /* try to drop referring dentries */ | 1240 | /* try to drop referring dentries */ |
1239 | spin_unlock(&ci->i_ceph_lock); | 1241 | spin_unlock(&ci->i_ceph_lock); |
@@ -1416,7 +1418,6 @@ static void discard_cap_releases(struct ceph_mds_client *mdsc, | |||
1416 | unsigned num; | 1418 | unsigned num; |
1417 | 1419 | ||
1418 | dout("discard_cap_releases mds%d\n", session->s_mds); | 1420 | dout("discard_cap_releases mds%d\n", session->s_mds); |
1419 | spin_lock(&session->s_cap_lock); | ||
1420 | 1421 | ||
1421 | /* zero out the in-progress message */ | 1422 | /* zero out the in-progress message */ |
1422 | msg = list_first_entry(&session->s_cap_releases, | 1423 | msg = list_first_entry(&session->s_cap_releases, |
@@ -1443,8 +1444,6 @@ static void discard_cap_releases(struct ceph_mds_client *mdsc, | |||
1443 | msg->front.iov_len = sizeof(*head); | 1444 | msg->front.iov_len = sizeof(*head); |
1444 | list_add(&msg->list_head, &session->s_cap_releases); | 1445 | list_add(&msg->list_head, &session->s_cap_releases); |
1445 | } | 1446 | } |
1446 | |||
1447 | spin_unlock(&session->s_cap_lock); | ||
1448 | } | 1447 | } |
1449 | 1448 | ||
1450 | /* | 1449 | /* |
@@ -1875,8 +1874,11 @@ static int __do_request(struct ceph_mds_client *mdsc, | |||
1875 | int mds = -1; | 1874 | int mds = -1; |
1876 | int err = -EAGAIN; | 1875 | int err = -EAGAIN; |
1877 | 1876 | ||
1878 | if (req->r_err || req->r_got_result) | 1877 | if (req->r_err || req->r_got_result) { |
1878 | if (req->r_aborted) | ||
1879 | __unregister_request(mdsc, req); | ||
1879 | goto out; | 1880 | goto out; |
1881 | } | ||
1880 | 1882 | ||
1881 | if (req->r_timeout && | 1883 | if (req->r_timeout && |
1882 | time_after_eq(jiffies, req->r_started + req->r_timeout)) { | 1884 | time_after_eq(jiffies, req->r_started + req->r_timeout)) { |
@@ -2186,7 +2188,6 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
2186 | if (head->safe) { | 2188 | if (head->safe) { |
2187 | req->r_got_safe = true; | 2189 | req->r_got_safe = true; |
2188 | __unregister_request(mdsc, req); | 2190 | __unregister_request(mdsc, req); |
2189 | complete_all(&req->r_safe_completion); | ||
2190 | 2191 | ||
2191 | if (req->r_got_unsafe) { | 2192 | if (req->r_got_unsafe) { |
2192 | /* | 2193 | /* |
@@ -2238,8 +2239,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
2238 | err = ceph_fill_trace(mdsc->fsc->sb, req, req->r_session); | 2239 | err = ceph_fill_trace(mdsc->fsc->sb, req, req->r_session); |
2239 | if (err == 0) { | 2240 | if (err == 0) { |
2240 | if (result == 0 && (req->r_op == CEPH_MDS_OP_READDIR || | 2241 | if (result == 0 && (req->r_op == CEPH_MDS_OP_READDIR || |
2241 | req->r_op == CEPH_MDS_OP_LSSNAP) && | 2242 | req->r_op == CEPH_MDS_OP_LSSNAP)) |
2242 | rinfo->dir_nr) | ||
2243 | ceph_readdir_prepopulate(req, req->r_session); | 2243 | ceph_readdir_prepopulate(req, req->r_session); |
2244 | ceph_unreserve_caps(mdsc, &req->r_caps_reservation); | 2244 | ceph_unreserve_caps(mdsc, &req->r_caps_reservation); |
2245 | } | 2245 | } |
@@ -2490,6 +2490,7 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, | |||
2490 | cap->seq = 0; /* reset cap seq */ | 2490 | cap->seq = 0; /* reset cap seq */ |
2491 | cap->issue_seq = 0; /* and issue_seq */ | 2491 | cap->issue_seq = 0; /* and issue_seq */ |
2492 | cap->mseq = 0; /* and migrate_seq */ | 2492 | cap->mseq = 0; /* and migrate_seq */ |
2493 | cap->cap_gen = cap->session->s_cap_gen; | ||
2493 | 2494 | ||
2494 | if (recon_state->flock) { | 2495 | if (recon_state->flock) { |
2495 | rec.v2.cap_id = cpu_to_le64(cap->cap_id); | 2496 | rec.v2.cap_id = cpu_to_le64(cap->cap_id); |
@@ -2552,6 +2553,8 @@ encode_again: | |||
2552 | } else { | 2553 | } else { |
2553 | err = ceph_pagelist_append(pagelist, &rec, reclen); | 2554 | err = ceph_pagelist_append(pagelist, &rec, reclen); |
2554 | } | 2555 | } |
2556 | |||
2557 | recon_state->nr_caps++; | ||
2555 | out_free: | 2558 | out_free: |
2556 | kfree(path); | 2559 | kfree(path); |
2557 | out_dput: | 2560 | out_dput: |
@@ -2579,6 +2582,7 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, | |||
2579 | struct rb_node *p; | 2582 | struct rb_node *p; |
2580 | int mds = session->s_mds; | 2583 | int mds = session->s_mds; |
2581 | int err = -ENOMEM; | 2584 | int err = -ENOMEM; |
2585 | int s_nr_caps; | ||
2582 | struct ceph_pagelist *pagelist; | 2586 | struct ceph_pagelist *pagelist; |
2583 | struct ceph_reconnect_state recon_state; | 2587 | struct ceph_reconnect_state recon_state; |
2584 | 2588 | ||
@@ -2610,20 +2614,38 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, | |||
2610 | dout("session %p state %s\n", session, | 2614 | dout("session %p state %s\n", session, |
2611 | session_state_name(session->s_state)); | 2615 | session_state_name(session->s_state)); |
2612 | 2616 | ||
2617 | spin_lock(&session->s_gen_ttl_lock); | ||
2618 | session->s_cap_gen++; | ||
2619 | spin_unlock(&session->s_gen_ttl_lock); | ||
2620 | |||
2621 | spin_lock(&session->s_cap_lock); | ||
2622 | /* | ||
2623 | * notify __ceph_remove_cap() that we are composing cap reconnect. | ||
2624 | * If a cap get released before being added to the cap reconnect, | ||
2625 | * __ceph_remove_cap() should skip queuing cap release. | ||
2626 | */ | ||
2627 | session->s_cap_reconnect = 1; | ||
2613 | /* drop old cap expires; we're about to reestablish that state */ | 2628 | /* drop old cap expires; we're about to reestablish that state */ |
2614 | discard_cap_releases(mdsc, session); | 2629 | discard_cap_releases(mdsc, session); |
2630 | spin_unlock(&session->s_cap_lock); | ||
2615 | 2631 | ||
2616 | /* traverse this session's caps */ | 2632 | /* traverse this session's caps */ |
2617 | err = ceph_pagelist_encode_32(pagelist, session->s_nr_caps); | 2633 | s_nr_caps = session->s_nr_caps; |
2634 | err = ceph_pagelist_encode_32(pagelist, s_nr_caps); | ||
2618 | if (err) | 2635 | if (err) |
2619 | goto fail; | 2636 | goto fail; |
2620 | 2637 | ||
2638 | recon_state.nr_caps = 0; | ||
2621 | recon_state.pagelist = pagelist; | 2639 | recon_state.pagelist = pagelist; |
2622 | recon_state.flock = session->s_con.peer_features & CEPH_FEATURE_FLOCK; | 2640 | recon_state.flock = session->s_con.peer_features & CEPH_FEATURE_FLOCK; |
2623 | err = iterate_session_caps(session, encode_caps_cb, &recon_state); | 2641 | err = iterate_session_caps(session, encode_caps_cb, &recon_state); |
2624 | if (err < 0) | 2642 | if (err < 0) |
2625 | goto fail; | 2643 | goto fail; |
2626 | 2644 | ||
2645 | spin_lock(&session->s_cap_lock); | ||
2646 | session->s_cap_reconnect = 0; | ||
2647 | spin_unlock(&session->s_cap_lock); | ||
2648 | |||
2627 | /* | 2649 | /* |
2628 | * snaprealms. we provide mds with the ino, seq (version), and | 2650 | * snaprealms. we provide mds with the ino, seq (version), and |
2629 | * parent for all of our realms. If the mds has any newer info, | 2651 | * parent for all of our realms. If the mds has any newer info, |
@@ -2646,11 +2668,18 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, | |||
2646 | 2668 | ||
2647 | if (recon_state.flock) | 2669 | if (recon_state.flock) |
2648 | reply->hdr.version = cpu_to_le16(2); | 2670 | reply->hdr.version = cpu_to_le16(2); |
2649 | if (pagelist->length) { | 2671 | |
2650 | /* set up outbound data if we have any */ | 2672 | /* raced with cap release? */ |
2651 | reply->hdr.data_len = cpu_to_le32(pagelist->length); | 2673 | if (s_nr_caps != recon_state.nr_caps) { |
2652 | ceph_msg_data_add_pagelist(reply, pagelist); | 2674 | struct page *page = list_first_entry(&pagelist->head, |
2675 | struct page, lru); | ||
2676 | __le32 *addr = kmap_atomic(page); | ||
2677 | *addr = cpu_to_le32(recon_state.nr_caps); | ||
2678 | kunmap_atomic(addr); | ||
2653 | } | 2679 | } |
2680 | |||
2681 | reply->hdr.data_len = cpu_to_le32(pagelist->length); | ||
2682 | ceph_msg_data_add_pagelist(reply, pagelist); | ||
2654 | ceph_con_send(&session->s_con, reply); | 2683 | ceph_con_send(&session->s_con, reply); |
2655 | 2684 | ||
2656 | mutex_unlock(&session->s_mutex); | 2685 | mutex_unlock(&session->s_mutex); |
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index c2a19fbbe517..4c053d099ae4 100644 --- a/fs/ceph/mds_client.h +++ b/fs/ceph/mds_client.h | |||
@@ -132,6 +132,7 @@ struct ceph_mds_session { | |||
132 | struct list_head s_caps; /* all caps issued by this session */ | 132 | struct list_head s_caps; /* all caps issued by this session */ |
133 | int s_nr_caps, s_trim_caps; | 133 | int s_nr_caps, s_trim_caps; |
134 | int s_num_cap_releases; | 134 | int s_num_cap_releases; |
135 | int s_cap_reconnect; | ||
135 | struct list_head s_cap_releases; /* waiting cap_release messages */ | 136 | struct list_head s_cap_releases; /* waiting cap_release messages */ |
136 | struct list_head s_cap_releases_done; /* ready to send */ | 137 | struct list_head s_cap_releases_done; /* ready to send */ |
137 | struct ceph_cap *s_cap_iterator; | 138 | struct ceph_cap *s_cap_iterator; |
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 6014b0a3c405..ef4ac38bb614 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
@@ -741,13 +741,7 @@ extern int ceph_add_cap(struct inode *inode, | |||
741 | int fmode, unsigned issued, unsigned wanted, | 741 | int fmode, unsigned issued, unsigned wanted, |
742 | unsigned cap, unsigned seq, u64 realmino, int flags, | 742 | unsigned cap, unsigned seq, u64 realmino, int flags, |
743 | struct ceph_cap_reservation *caps_reservation); | 743 | struct ceph_cap_reservation *caps_reservation); |
744 | extern void __ceph_remove_cap(struct ceph_cap *cap); | 744 | extern void __ceph_remove_cap(struct ceph_cap *cap, bool queue_release); |
745 | static inline void ceph_remove_cap(struct ceph_cap *cap) | ||
746 | { | ||
747 | spin_lock(&cap->ci->i_ceph_lock); | ||
748 | __ceph_remove_cap(cap); | ||
749 | spin_unlock(&cap->ci->i_ceph_lock); | ||
750 | } | ||
751 | extern void ceph_put_cap(struct ceph_mds_client *mdsc, | 745 | extern void ceph_put_cap(struct ceph_mds_client *mdsc, |
752 | struct ceph_cap *cap); | 746 | struct ceph_cap *cap); |
753 | 747 | ||
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index d9ea7ada1378..f918a998a087 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -384,6 +384,7 @@ struct smb_version_operations { | |||
384 | int (*clone_range)(const unsigned int, struct cifsFileInfo *src_file, | 384 | int (*clone_range)(const unsigned int, struct cifsFileInfo *src_file, |
385 | struct cifsFileInfo *target_file, u64 src_off, u64 len, | 385 | struct cifsFileInfo *target_file, u64 src_off, u64 len, |
386 | u64 dest_off); | 386 | u64 dest_off); |
387 | int (*validate_negotiate)(const unsigned int, struct cifs_tcon *); | ||
387 | }; | 388 | }; |
388 | 389 | ||
389 | struct smb_version_values { | 390 | struct smb_version_values { |
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c index 409b45eefe70..77492301cc2b 100644 --- a/fs/cifs/ioctl.c +++ b/fs/cifs/ioctl.c | |||
@@ -26,13 +26,15 @@ | |||
26 | #include <linux/mount.h> | 26 | #include <linux/mount.h> |
27 | #include <linux/mm.h> | 27 | #include <linux/mm.h> |
28 | #include <linux/pagemap.h> | 28 | #include <linux/pagemap.h> |
29 | #include <linux/btrfs.h> | ||
30 | #include "cifspdu.h" | 29 | #include "cifspdu.h" |
31 | #include "cifsglob.h" | 30 | #include "cifsglob.h" |
32 | #include "cifsproto.h" | 31 | #include "cifsproto.h" |
33 | #include "cifs_debug.h" | 32 | #include "cifs_debug.h" |
34 | #include "cifsfs.h" | 33 | #include "cifsfs.h" |
35 | 34 | ||
35 | #define CIFS_IOCTL_MAGIC 0xCF | ||
36 | #define CIFS_IOC_COPYCHUNK_FILE _IOW(CIFS_IOCTL_MAGIC, 3, int) | ||
37 | |||
36 | static long cifs_ioctl_clone(unsigned int xid, struct file *dst_file, | 38 | static long cifs_ioctl_clone(unsigned int xid, struct file *dst_file, |
37 | unsigned long srcfd, u64 off, u64 len, u64 destoff) | 39 | unsigned long srcfd, u64 off, u64 len, u64 destoff) |
38 | { | 40 | { |
@@ -213,7 +215,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) | |||
213 | cifs_dbg(FYI, "set compress flag rc %d\n", rc); | 215 | cifs_dbg(FYI, "set compress flag rc %d\n", rc); |
214 | } | 216 | } |
215 | break; | 217 | break; |
216 | case BTRFS_IOC_CLONE: | 218 | case CIFS_IOC_COPYCHUNK_FILE: |
217 | rc = cifs_ioctl_clone(xid, filep, arg, 0, 0, 0); | 219 | rc = cifs_ioctl_clone(xid, filep, arg, 0, 0, 0); |
218 | break; | 220 | break; |
219 | default: | 221 | default: |
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 11dde4b24f8a..757da3e54d3d 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
@@ -532,7 +532,10 @@ smb2_clone_range(const unsigned int xid, | |||
532 | int rc; | 532 | int rc; |
533 | unsigned int ret_data_len; | 533 | unsigned int ret_data_len; |
534 | struct copychunk_ioctl *pcchunk; | 534 | struct copychunk_ioctl *pcchunk; |
535 | char *retbuf = NULL; | 535 | struct copychunk_ioctl_rsp *retbuf = NULL; |
536 | struct cifs_tcon *tcon; | ||
537 | int chunks_copied = 0; | ||
538 | bool chunk_sizes_updated = false; | ||
536 | 539 | ||
537 | pcchunk = kmalloc(sizeof(struct copychunk_ioctl), GFP_KERNEL); | 540 | pcchunk = kmalloc(sizeof(struct copychunk_ioctl), GFP_KERNEL); |
538 | 541 | ||
@@ -547,27 +550,96 @@ smb2_clone_range(const unsigned int xid, | |||
547 | 550 | ||
548 | /* Note: request_res_key sets res_key null only if rc !=0 */ | 551 | /* Note: request_res_key sets res_key null only if rc !=0 */ |
549 | if (rc) | 552 | if (rc) |
550 | return rc; | 553 | goto cchunk_out; |
551 | 554 | ||
552 | /* For now array only one chunk long, will make more flexible later */ | 555 | /* For now array only one chunk long, will make more flexible later */ |
553 | pcchunk->ChunkCount = __constant_cpu_to_le32(1); | 556 | pcchunk->ChunkCount = __constant_cpu_to_le32(1); |
554 | pcchunk->Reserved = 0; | 557 | pcchunk->Reserved = 0; |
555 | pcchunk->SourceOffset = cpu_to_le64(src_off); | ||
556 | pcchunk->TargetOffset = cpu_to_le64(dest_off); | ||
557 | pcchunk->Length = cpu_to_le32(len); | ||
558 | pcchunk->Reserved2 = 0; | 558 | pcchunk->Reserved2 = 0; |
559 | 559 | ||
560 | /* Request that server copy to target from src file identified by key */ | 560 | tcon = tlink_tcon(trgtfile->tlink); |
561 | rc = SMB2_ioctl(xid, tlink_tcon(trgtfile->tlink), | ||
562 | trgtfile->fid.persistent_fid, | ||
563 | trgtfile->fid.volatile_fid, FSCTL_SRV_COPYCHUNK_WRITE, | ||
564 | true /* is_fsctl */, (char *)pcchunk, | ||
565 | sizeof(struct copychunk_ioctl), &retbuf, &ret_data_len); | ||
566 | 561 | ||
567 | /* BB need to special case rc = EINVAL to alter chunk size */ | 562 | while (len > 0) { |
563 | pcchunk->SourceOffset = cpu_to_le64(src_off); | ||
564 | pcchunk->TargetOffset = cpu_to_le64(dest_off); | ||
565 | pcchunk->Length = | ||
566 | cpu_to_le32(min_t(u32, len, tcon->max_bytes_chunk)); | ||
568 | 567 | ||
569 | cifs_dbg(FYI, "rc %d data length out %d\n", rc, ret_data_len); | 568 | /* Request server copy to target from src identified by key */ |
569 | rc = SMB2_ioctl(xid, tcon, trgtfile->fid.persistent_fid, | ||
570 | trgtfile->fid.volatile_fid, FSCTL_SRV_COPYCHUNK_WRITE, | ||
571 | true /* is_fsctl */, (char *)pcchunk, | ||
572 | sizeof(struct copychunk_ioctl), (char **)&retbuf, | ||
573 | &ret_data_len); | ||
574 | if (rc == 0) { | ||
575 | if (ret_data_len != | ||
576 | sizeof(struct copychunk_ioctl_rsp)) { | ||
577 | cifs_dbg(VFS, "invalid cchunk response size\n"); | ||
578 | rc = -EIO; | ||
579 | goto cchunk_out; | ||
580 | } | ||
581 | if (retbuf->TotalBytesWritten == 0) { | ||
582 | cifs_dbg(FYI, "no bytes copied\n"); | ||
583 | rc = -EIO; | ||
584 | goto cchunk_out; | ||
585 | } | ||
586 | /* | ||
587 | * Check if server claimed to write more than we asked | ||
588 | */ | ||
589 | if (le32_to_cpu(retbuf->TotalBytesWritten) > | ||
590 | le32_to_cpu(pcchunk->Length)) { | ||
591 | cifs_dbg(VFS, "invalid copy chunk response\n"); | ||
592 | rc = -EIO; | ||
593 | goto cchunk_out; | ||
594 | } | ||
595 | if (le32_to_cpu(retbuf->ChunksWritten) != 1) { | ||
596 | cifs_dbg(VFS, "invalid num chunks written\n"); | ||
597 | rc = -EIO; | ||
598 | goto cchunk_out; | ||
599 | } | ||
600 | chunks_copied++; | ||
601 | |||
602 | src_off += le32_to_cpu(retbuf->TotalBytesWritten); | ||
603 | dest_off += le32_to_cpu(retbuf->TotalBytesWritten); | ||
604 | len -= le32_to_cpu(retbuf->TotalBytesWritten); | ||
605 | |||
606 | cifs_dbg(FYI, "Chunks %d PartialChunk %d Total %d\n", | ||
607 | le32_to_cpu(retbuf->ChunksWritten), | ||
608 | le32_to_cpu(retbuf->ChunkBytesWritten), | ||
609 | le32_to_cpu(retbuf->TotalBytesWritten)); | ||
610 | } else if (rc == -EINVAL) { | ||
611 | if (ret_data_len != sizeof(struct copychunk_ioctl_rsp)) | ||
612 | goto cchunk_out; | ||
613 | |||
614 | cifs_dbg(FYI, "MaxChunks %d BytesChunk %d MaxCopy %d\n", | ||
615 | le32_to_cpu(retbuf->ChunksWritten), | ||
616 | le32_to_cpu(retbuf->ChunkBytesWritten), | ||
617 | le32_to_cpu(retbuf->TotalBytesWritten)); | ||
618 | |||
619 | /* | ||
620 | * Check if this is the first request using these sizes, | ||
621 | * (ie check if copy succeed once with original sizes | ||
622 | * and check if the server gave us different sizes after | ||
623 | * we already updated max sizes on previous request). | ||
624 | * if not then why is the server returning an error now | ||
625 | */ | ||
626 | if ((chunks_copied != 0) || chunk_sizes_updated) | ||
627 | goto cchunk_out; | ||
628 | |||
629 | /* Check that server is not asking us to grow size */ | ||
630 | if (le32_to_cpu(retbuf->ChunkBytesWritten) < | ||
631 | tcon->max_bytes_chunk) | ||
632 | tcon->max_bytes_chunk = | ||
633 | le32_to_cpu(retbuf->ChunkBytesWritten); | ||
634 | else | ||
635 | goto cchunk_out; /* server gave us bogus size */ | ||
636 | |||
637 | /* No need to change MaxChunks since already set to 1 */ | ||
638 | chunk_sizes_updated = true; | ||
639 | } | ||
640 | } | ||
570 | 641 | ||
642 | cchunk_out: | ||
571 | kfree(pcchunk); | 643 | kfree(pcchunk); |
572 | return rc; | 644 | return rc; |
573 | } | 645 | } |
@@ -1247,6 +1319,7 @@ struct smb_version_operations smb30_operations = { | |||
1247 | .create_lease_buf = smb3_create_lease_buf, | 1319 | .create_lease_buf = smb3_create_lease_buf, |
1248 | .parse_lease_buf = smb3_parse_lease_buf, | 1320 | .parse_lease_buf = smb3_parse_lease_buf, |
1249 | .clone_range = smb2_clone_range, | 1321 | .clone_range = smb2_clone_range, |
1322 | .validate_negotiate = smb3_validate_negotiate, | ||
1250 | }; | 1323 | }; |
1251 | 1324 | ||
1252 | struct smb_version_values smb20_values = { | 1325 | struct smb_version_values smb20_values = { |
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index d65270c290a1..2013234b73ad 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c | |||
@@ -454,6 +454,81 @@ neg_exit: | |||
454 | return rc; | 454 | return rc; |
455 | } | 455 | } |
456 | 456 | ||
457 | int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) | ||
458 | { | ||
459 | int rc = 0; | ||
460 | struct validate_negotiate_info_req vneg_inbuf; | ||
461 | struct validate_negotiate_info_rsp *pneg_rsp; | ||
462 | u32 rsplen; | ||
463 | |||
464 | cifs_dbg(FYI, "validate negotiate\n"); | ||
465 | |||
466 | /* | ||
467 | * validation ioctl must be signed, so no point sending this if we | ||
468 | * can not sign it. We could eventually change this to selectively | ||
469 | * sign just this, the first and only signed request on a connection. | ||
470 | * This is good enough for now since a user who wants better security | ||
471 | * would also enable signing on the mount. Having validation of | ||
472 | * negotiate info for signed connections helps reduce attack vectors | ||
473 | */ | ||
474 | if (tcon->ses->server->sign == false) | ||
475 | return 0; /* validation requires signing */ | ||
476 | |||
477 | vneg_inbuf.Capabilities = | ||
478 | cpu_to_le32(tcon->ses->server->vals->req_capabilities); | ||
479 | memcpy(vneg_inbuf.Guid, cifs_client_guid, SMB2_CLIENT_GUID_SIZE); | ||
480 | |||
481 | if (tcon->ses->sign) | ||
482 | vneg_inbuf.SecurityMode = | ||
483 | cpu_to_le16(SMB2_NEGOTIATE_SIGNING_REQUIRED); | ||
484 | else if (global_secflags & CIFSSEC_MAY_SIGN) | ||
485 | vneg_inbuf.SecurityMode = | ||
486 | cpu_to_le16(SMB2_NEGOTIATE_SIGNING_ENABLED); | ||
487 | else | ||
488 | vneg_inbuf.SecurityMode = 0; | ||
489 | |||
490 | vneg_inbuf.DialectCount = cpu_to_le16(1); | ||
491 | vneg_inbuf.Dialects[0] = | ||
492 | cpu_to_le16(tcon->ses->server->vals->protocol_id); | ||
493 | |||
494 | rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID, | ||
495 | FSCTL_VALIDATE_NEGOTIATE_INFO, true /* is_fsctl */, | ||
496 | (char *)&vneg_inbuf, sizeof(struct validate_negotiate_info_req), | ||
497 | (char **)&pneg_rsp, &rsplen); | ||
498 | |||
499 | if (rc != 0) { | ||
500 | cifs_dbg(VFS, "validate protocol negotiate failed: %d\n", rc); | ||
501 | return -EIO; | ||
502 | } | ||
503 | |||
504 | if (rsplen != sizeof(struct validate_negotiate_info_rsp)) { | ||
505 | cifs_dbg(VFS, "invalid size of protocol negotiate response\n"); | ||
506 | return -EIO; | ||
507 | } | ||
508 | |||
509 | /* check validate negotiate info response matches what we got earlier */ | ||
510 | if (pneg_rsp->Dialect != | ||
511 | cpu_to_le16(tcon->ses->server->vals->protocol_id)) | ||
512 | goto vneg_out; | ||
513 | |||
514 | if (pneg_rsp->SecurityMode != cpu_to_le16(tcon->ses->server->sec_mode)) | ||
515 | goto vneg_out; | ||
516 | |||
517 | /* do not validate server guid because not saved at negprot time yet */ | ||
518 | |||
519 | if ((le32_to_cpu(pneg_rsp->Capabilities) | SMB2_NT_FIND | | ||
520 | SMB2_LARGE_FILES) != tcon->ses->server->capabilities) | ||
521 | goto vneg_out; | ||
522 | |||
523 | /* validate negotiate successful */ | ||
524 | cifs_dbg(FYI, "validate negotiate info successful\n"); | ||
525 | return 0; | ||
526 | |||
527 | vneg_out: | ||
528 | cifs_dbg(VFS, "protocol revalidation - security settings mismatch\n"); | ||
529 | return -EIO; | ||
530 | } | ||
531 | |||
457 | int | 532 | int |
458 | SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, | 533 | SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, |
459 | const struct nls_table *nls_cp) | 534 | const struct nls_table *nls_cp) |
@@ -829,6 +904,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, | |||
829 | ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) | 904 | ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) |
830 | cifs_dbg(VFS, "DFS capability contradicts DFS flag\n"); | 905 | cifs_dbg(VFS, "DFS capability contradicts DFS flag\n"); |
831 | init_copy_chunk_defaults(tcon); | 906 | init_copy_chunk_defaults(tcon); |
907 | if (tcon->ses->server->ops->validate_negotiate) | ||
908 | rc = tcon->ses->server->ops->validate_negotiate(xid, tcon); | ||
832 | tcon_exit: | 909 | tcon_exit: |
833 | free_rsp_buf(resp_buftype, rsp); | 910 | free_rsp_buf(resp_buftype, rsp); |
834 | kfree(unc_path); | 911 | kfree(unc_path); |
@@ -1214,10 +1291,17 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, | |||
1214 | rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buftype, 0); | 1291 | rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buftype, 0); |
1215 | rsp = (struct smb2_ioctl_rsp *)iov[0].iov_base; | 1292 | rsp = (struct smb2_ioctl_rsp *)iov[0].iov_base; |
1216 | 1293 | ||
1217 | if (rc != 0) { | 1294 | if ((rc != 0) && (rc != -EINVAL)) { |
1218 | if (tcon) | 1295 | if (tcon) |
1219 | cifs_stats_fail_inc(tcon, SMB2_IOCTL_HE); | 1296 | cifs_stats_fail_inc(tcon, SMB2_IOCTL_HE); |
1220 | goto ioctl_exit; | 1297 | goto ioctl_exit; |
1298 | } else if (rc == -EINVAL) { | ||
1299 | if ((opcode != FSCTL_SRV_COPYCHUNK_WRITE) && | ||
1300 | (opcode != FSCTL_SRV_COPYCHUNK)) { | ||
1301 | if (tcon) | ||
1302 | cifs_stats_fail_inc(tcon, SMB2_IOCTL_HE); | ||
1303 | goto ioctl_exit; | ||
1304 | } | ||
1221 | } | 1305 | } |
1222 | 1306 | ||
1223 | /* check if caller wants to look at return data or just return rc */ | 1307 | /* check if caller wants to look at return data or just return rc */ |
@@ -2154,11 +2238,9 @@ send_set_info(const unsigned int xid, struct cifs_tcon *tcon, | |||
2154 | rc = SendReceive2(xid, ses, iov, num, &resp_buftype, 0); | 2238 | rc = SendReceive2(xid, ses, iov, num, &resp_buftype, 0); |
2155 | rsp = (struct smb2_set_info_rsp *)iov[0].iov_base; | 2239 | rsp = (struct smb2_set_info_rsp *)iov[0].iov_base; |
2156 | 2240 | ||
2157 | if (rc != 0) { | 2241 | if (rc != 0) |
2158 | cifs_stats_fail_inc(tcon, SMB2_SET_INFO_HE); | 2242 | cifs_stats_fail_inc(tcon, SMB2_SET_INFO_HE); |
2159 | goto out; | 2243 | |
2160 | } | ||
2161 | out: | ||
2162 | free_rsp_buf(resp_buftype, rsp); | 2244 | free_rsp_buf(resp_buftype, rsp); |
2163 | kfree(iov); | 2245 | kfree(iov); |
2164 | return rc; | 2246 | return rc; |
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index f88320bbb477..2022c542ea3a 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h | |||
@@ -577,13 +577,19 @@ struct copychunk_ioctl_rsp { | |||
577 | __le32 TotalBytesWritten; | 577 | __le32 TotalBytesWritten; |
578 | } __packed; | 578 | } __packed; |
579 | 579 | ||
580 | /* Response and Request are the same format */ | 580 | struct validate_negotiate_info_req { |
581 | struct validate_negotiate_info { | ||
582 | __le32 Capabilities; | 581 | __le32 Capabilities; |
583 | __u8 Guid[SMB2_CLIENT_GUID_SIZE]; | 582 | __u8 Guid[SMB2_CLIENT_GUID_SIZE]; |
584 | __le16 SecurityMode; | 583 | __le16 SecurityMode; |
585 | __le16 DialectCount; | 584 | __le16 DialectCount; |
586 | __le16 Dialect[1]; | 585 | __le16 Dialects[1]; /* dialect (someday maybe list) client asked for */ |
586 | } __packed; | ||
587 | |||
588 | struct validate_negotiate_info_rsp { | ||
589 | __le32 Capabilities; | ||
590 | __u8 Guid[SMB2_CLIENT_GUID_SIZE]; | ||
591 | __le16 SecurityMode; | ||
592 | __le16 Dialect; /* Dialect in use for the connection */ | ||
587 | } __packed; | 593 | } __packed; |
588 | 594 | ||
589 | #define RSS_CAPABLE 0x00000001 | 595 | #define RSS_CAPABLE 0x00000001 |
diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h index b4eea105b08c..93adc64666f3 100644 --- a/fs/cifs/smb2proto.h +++ b/fs/cifs/smb2proto.h | |||
@@ -162,5 +162,6 @@ extern int smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, | |||
162 | struct smb2_lock_element *buf); | 162 | struct smb2_lock_element *buf); |
163 | extern int SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon, | 163 | extern int SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon, |
164 | __u8 *lease_key, const __le32 lease_state); | 164 | __u8 *lease_key, const __le32 lease_state); |
165 | extern int smb3_validate_negotiate(const unsigned int, struct cifs_tcon *); | ||
165 | 166 | ||
166 | #endif /* _SMB2PROTO_H */ | 167 | #endif /* _SMB2PROTO_H */ |
diff --git a/fs/cifs/smbfsctl.h b/fs/cifs/smbfsctl.h index a4b2391fe66e..0e538b5c9622 100644 --- a/fs/cifs/smbfsctl.h +++ b/fs/cifs/smbfsctl.h | |||
@@ -90,7 +90,7 @@ | |||
90 | #define FSCTL_LMR_REQUEST_RESILIENCY 0x001401D4 /* BB add struct */ | 90 | #define FSCTL_LMR_REQUEST_RESILIENCY 0x001401D4 /* BB add struct */ |
91 | #define FSCTL_LMR_GET_LINK_TRACK_INF 0x001400E8 /* BB add struct */ | 91 | #define FSCTL_LMR_GET_LINK_TRACK_INF 0x001400E8 /* BB add struct */ |
92 | #define FSCTL_LMR_SET_LINK_TRACK_INF 0x001400EC /* BB add struct */ | 92 | #define FSCTL_LMR_SET_LINK_TRACK_INF 0x001400EC /* BB add struct */ |
93 | #define FSCTL_VALIDATE_NEGOTIATE_INFO 0x00140204 /* BB add struct */ | 93 | #define FSCTL_VALIDATE_NEGOTIATE_INFO 0x00140204 |
94 | /* Perform server-side data movement */ | 94 | /* Perform server-side data movement */ |
95 | #define FSCTL_SRV_COPYCHUNK 0x001440F2 | 95 | #define FSCTL_SRV_COPYCHUNK 0x001440F2 |
96 | #define FSCTL_SRV_COPYCHUNK_WRITE 0x001480F2 | 96 | #define FSCTL_SRV_COPYCHUNK_WRITE 0x001480F2 |
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 79b65c3b9e87..8b5e2584c840 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -1852,8 +1852,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, | |||
1852 | goto error_tgt_fput; | 1852 | goto error_tgt_fput; |
1853 | 1853 | ||
1854 | /* Check if EPOLLWAKEUP is allowed */ | 1854 | /* Check if EPOLLWAKEUP is allowed */ |
1855 | if ((epds.events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) | 1855 | ep_take_care_of_epollwakeup(&epds); |
1856 | epds.events &= ~EPOLLWAKEUP; | ||
1857 | 1856 | ||
1858 | /* | 1857 | /* |
1859 | * We have to check that the file structure underneath the file descriptor | 1858 | * We have to check that the file structure underneath the file descriptor |
diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c index b51a6079108d..e9a97a0d4314 100644 --- a/fs/hfsplus/wrapper.c +++ b/fs/hfsplus/wrapper.c | |||
@@ -24,13 +24,6 @@ struct hfsplus_wd { | |||
24 | u16 embed_count; | 24 | u16 embed_count; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | static void hfsplus_end_io_sync(struct bio *bio, int err) | ||
28 | { | ||
29 | if (err) | ||
30 | clear_bit(BIO_UPTODATE, &bio->bi_flags); | ||
31 | complete(bio->bi_private); | ||
32 | } | ||
33 | |||
34 | /* | 27 | /* |
35 | * hfsplus_submit_bio - Perfrom block I/O | 28 | * hfsplus_submit_bio - Perfrom block I/O |
36 | * @sb: super block of volume for I/O | 29 | * @sb: super block of volume for I/O |
@@ -53,7 +46,6 @@ static void hfsplus_end_io_sync(struct bio *bio, int err) | |||
53 | int hfsplus_submit_bio(struct super_block *sb, sector_t sector, | 46 | int hfsplus_submit_bio(struct super_block *sb, sector_t sector, |
54 | void *buf, void **data, int rw) | 47 | void *buf, void **data, int rw) |
55 | { | 48 | { |
56 | DECLARE_COMPLETION_ONSTACK(wait); | ||
57 | struct bio *bio; | 49 | struct bio *bio; |
58 | int ret = 0; | 50 | int ret = 0; |
59 | u64 io_size; | 51 | u64 io_size; |
@@ -73,8 +65,6 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector, | |||
73 | bio = bio_alloc(GFP_NOIO, 1); | 65 | bio = bio_alloc(GFP_NOIO, 1); |
74 | bio->bi_sector = sector; | 66 | bio->bi_sector = sector; |
75 | bio->bi_bdev = sb->s_bdev; | 67 | bio->bi_bdev = sb->s_bdev; |
76 | bio->bi_end_io = hfsplus_end_io_sync; | ||
77 | bio->bi_private = &wait; | ||
78 | 68 | ||
79 | if (!(rw & WRITE) && data) | 69 | if (!(rw & WRITE) && data) |
80 | *data = (u8 *)buf + offset; | 70 | *data = (u8 *)buf + offset; |
@@ -93,12 +83,7 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector, | |||
93 | buf = (u8 *)buf + len; | 83 | buf = (u8 *)buf + len; |
94 | } | 84 | } |
95 | 85 | ||
96 | submit_bio(rw, bio); | 86 | ret = submit_bio_wait(rw, bio); |
97 | wait_for_completion(&wait); | ||
98 | |||
99 | if (!bio_flagged(bio, BIO_UPTODATE)) | ||
100 | ret = -EIO; | ||
101 | |||
102 | out: | 87 | out: |
103 | bio_put(bio); | 88 | bio_put(bio); |
104 | return ret < 0 ? ret : 0; | 89 | return ret < 0 ? ret : 0; |
diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c index 550475ca6a0e..0f95f0d0b313 100644 --- a/fs/logfs/dev_bdev.c +++ b/fs/logfs/dev_bdev.c | |||
@@ -14,16 +14,10 @@ | |||
14 | 14 | ||
15 | #define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1)) | 15 | #define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1)) |
16 | 16 | ||
17 | static void request_complete(struct bio *bio, int err) | ||
18 | { | ||
19 | complete((struct completion *)bio->bi_private); | ||
20 | } | ||
21 | |||
22 | static int sync_request(struct page *page, struct block_device *bdev, int rw) | 17 | static int sync_request(struct page *page, struct block_device *bdev, int rw) |
23 | { | 18 | { |
24 | struct bio bio; | 19 | struct bio bio; |
25 | struct bio_vec bio_vec; | 20 | struct bio_vec bio_vec; |
26 | struct completion complete; | ||
27 | 21 | ||
28 | bio_init(&bio); | 22 | bio_init(&bio); |
29 | bio.bi_max_vecs = 1; | 23 | bio.bi_max_vecs = 1; |
@@ -35,13 +29,8 @@ static int sync_request(struct page *page, struct block_device *bdev, int rw) | |||
35 | bio.bi_size = PAGE_SIZE; | 29 | bio.bi_size = PAGE_SIZE; |
36 | bio.bi_bdev = bdev; | 30 | bio.bi_bdev = bdev; |
37 | bio.bi_sector = page->index * (PAGE_SIZE >> 9); | 31 | bio.bi_sector = page->index * (PAGE_SIZE >> 9); |
38 | init_completion(&complete); | ||
39 | bio.bi_private = &complete; | ||
40 | bio.bi_end_io = request_complete; | ||
41 | 32 | ||
42 | submit_bio(rw, &bio); | 33 | return submit_bio_wait(rw, &bio); |
43 | wait_for_completion(&complete); | ||
44 | return test_bit(BIO_UPTODATE, &bio.bi_flags) ? 0 : -EIO; | ||
45 | } | 34 | } |
46 | 35 | ||
47 | static int bdev_readpage(void *_sb, struct page *page) | 36 | static int bdev_readpage(void *_sb, struct page *page) |
diff --git a/fs/namei.c b/fs/namei.c index 8f77a8cea289..c53d3a9547f9 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -513,8 +513,7 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry) | |||
513 | 513 | ||
514 | if (!lockref_get_not_dead(&parent->d_lockref)) { | 514 | if (!lockref_get_not_dead(&parent->d_lockref)) { |
515 | nd->path.dentry = NULL; | 515 | nd->path.dentry = NULL; |
516 | rcu_read_unlock(); | 516 | goto out; |
517 | return -ECHILD; | ||
518 | } | 517 | } |
519 | 518 | ||
520 | /* | 519 | /* |
diff --git a/fs/nfs/blocklayout/blocklayout.h b/fs/nfs/blocklayout/blocklayout.h index 8485978993e8..9838fb020473 100644 --- a/fs/nfs/blocklayout/blocklayout.h +++ b/fs/nfs/blocklayout/blocklayout.h | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/nfs_fs.h> | 36 | #include <linux/nfs_fs.h> |
37 | #include <linux/sunrpc/rpc_pipe_fs.h> | 37 | #include <linux/sunrpc/rpc_pipe_fs.h> |
38 | 38 | ||
39 | #include "../nfs4_fs.h" | ||
39 | #include "../pnfs.h" | 40 | #include "../pnfs.h" |
40 | #include "../netns.h" | 41 | #include "../netns.h" |
41 | 42 | ||
diff --git a/fs/nfs/blocklayout/extents.c b/fs/nfs/blocklayout/extents.c index 9c3e117c3ed1..4d0161442565 100644 --- a/fs/nfs/blocklayout/extents.c +++ b/fs/nfs/blocklayout/extents.c | |||
@@ -44,7 +44,7 @@ | |||
44 | static inline sector_t normalize(sector_t s, int base) | 44 | static inline sector_t normalize(sector_t s, int base) |
45 | { | 45 | { |
46 | sector_t tmp = s; /* Since do_div modifies its argument */ | 46 | sector_t tmp = s; /* Since do_div modifies its argument */ |
47 | return s - do_div(tmp, base); | 47 | return s - sector_div(tmp, base); |
48 | } | 48 | } |
49 | 49 | ||
50 | static inline sector_t normalize_up(sector_t s, int base) | 50 | static inline sector_t normalize_up(sector_t s, int base) |
diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c index fc0f95ec7358..d25f10fb4926 100644 --- a/fs/nfs/dns_resolve.c +++ b/fs/nfs/dns_resolve.c | |||
@@ -46,7 +46,9 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen, | |||
46 | #include <linux/sunrpc/cache.h> | 46 | #include <linux/sunrpc/cache.h> |
47 | #include <linux/sunrpc/svcauth.h> | 47 | #include <linux/sunrpc/svcauth.h> |
48 | #include <linux/sunrpc/rpc_pipe_fs.h> | 48 | #include <linux/sunrpc/rpc_pipe_fs.h> |
49 | #include <linux/nfs_fs.h> | ||
49 | 50 | ||
51 | #include "nfs4_fs.h" | ||
50 | #include "dns_resolve.h" | 52 | #include "dns_resolve.h" |
51 | #include "cache_lib.h" | 53 | #include "cache_lib.h" |
52 | #include "netns.h" | 54 | #include "netns.h" |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 18ab2da4eeb6..00ad1c2b217d 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -312,7 +312,7 @@ struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) | |||
312 | } | 312 | } |
313 | EXPORT_SYMBOL_GPL(nfs4_label_alloc); | 313 | EXPORT_SYMBOL_GPL(nfs4_label_alloc); |
314 | #else | 314 | #else |
315 | void inline nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr, | 315 | void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr, |
316 | struct nfs4_label *label) | 316 | struct nfs4_label *label) |
317 | { | 317 | { |
318 | } | 318 | } |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index bca6a3e3c49c..8b5cc04a8611 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -269,6 +269,21 @@ extern const u32 nfs41_maxgetdevinfo_overhead; | |||
269 | extern struct rpc_procinfo nfs4_procedures[]; | 269 | extern struct rpc_procinfo nfs4_procedures[]; |
270 | #endif | 270 | #endif |
271 | 271 | ||
272 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL | ||
273 | extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); | ||
274 | static inline void nfs4_label_free(struct nfs4_label *label) | ||
275 | { | ||
276 | if (label) { | ||
277 | kfree(label->label); | ||
278 | kfree(label); | ||
279 | } | ||
280 | return; | ||
281 | } | ||
282 | #else | ||
283 | static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } | ||
284 | static inline void nfs4_label_free(void *label) {} | ||
285 | #endif /* CONFIG_NFS_V4_SECURITY_LABEL */ | ||
286 | |||
272 | /* proc.c */ | 287 | /* proc.c */ |
273 | void nfs_close_context(struct nfs_open_context *ctx, int is_sync); | 288 | void nfs_close_context(struct nfs_open_context *ctx, int is_sync); |
274 | extern struct nfs_client *nfs_init_client(struct nfs_client *clp, | 289 | extern struct nfs_client *nfs_init_client(struct nfs_client *clp, |
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 3ce79b04522e..5609edc742a0 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -9,6 +9,14 @@ | |||
9 | #ifndef __LINUX_FS_NFS_NFS4_FS_H | 9 | #ifndef __LINUX_FS_NFS_NFS4_FS_H |
10 | #define __LINUX_FS_NFS_NFS4_FS_H | 10 | #define __LINUX_FS_NFS_NFS4_FS_H |
11 | 11 | ||
12 | #if defined(CONFIG_NFS_V4_2) | ||
13 | #define NFS4_MAX_MINOR_VERSION 2 | ||
14 | #elif defined(CONFIG_NFS_V4_1) | ||
15 | #define NFS4_MAX_MINOR_VERSION 1 | ||
16 | #else | ||
17 | #define NFS4_MAX_MINOR_VERSION 0 | ||
18 | #endif | ||
19 | |||
12 | #if IS_ENABLED(CONFIG_NFS_V4) | 20 | #if IS_ENABLED(CONFIG_NFS_V4) |
13 | 21 | ||
14 | #define NFS4_MAX_LOOP_ON_RECOVER (10) | 22 | #define NFS4_MAX_LOOP_ON_RECOVER (10) |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 659990c0109e..15052b81df42 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2518,9 +2518,8 @@ static void nfs4_close_done(struct rpc_task *task, void *data) | |||
2518 | calldata->roc_barrier); | 2518 | calldata->roc_barrier); |
2519 | nfs_set_open_stateid(state, &calldata->res.stateid, 0); | 2519 | nfs_set_open_stateid(state, &calldata->res.stateid, 0); |
2520 | renew_lease(server, calldata->timestamp); | 2520 | renew_lease(server, calldata->timestamp); |
2521 | nfs4_close_clear_stateid_flags(state, | ||
2522 | calldata->arg.fmode); | ||
2523 | break; | 2521 | break; |
2522 | case -NFS4ERR_ADMIN_REVOKED: | ||
2524 | case -NFS4ERR_STALE_STATEID: | 2523 | case -NFS4ERR_STALE_STATEID: |
2525 | case -NFS4ERR_OLD_STATEID: | 2524 | case -NFS4ERR_OLD_STATEID: |
2526 | case -NFS4ERR_BAD_STATEID: | 2525 | case -NFS4ERR_BAD_STATEID: |
@@ -2528,9 +2527,13 @@ static void nfs4_close_done(struct rpc_task *task, void *data) | |||
2528 | if (calldata->arg.fmode == 0) | 2527 | if (calldata->arg.fmode == 0) |
2529 | break; | 2528 | break; |
2530 | default: | 2529 | default: |
2531 | if (nfs4_async_handle_error(task, server, state) == -EAGAIN) | 2530 | if (nfs4_async_handle_error(task, server, state) == -EAGAIN) { |
2532 | rpc_restart_call_prepare(task); | 2531 | rpc_restart_call_prepare(task); |
2532 | goto out_release; | ||
2533 | } | ||
2533 | } | 2534 | } |
2535 | nfs4_close_clear_stateid_flags(state, calldata->arg.fmode); | ||
2536 | out_release: | ||
2534 | nfs_release_seqid(calldata->arg.seqid); | 2537 | nfs_release_seqid(calldata->arg.seqid); |
2535 | nfs_refresh_inode(calldata->inode, calldata->res.fattr); | 2538 | nfs_refresh_inode(calldata->inode, calldata->res.fattr); |
2536 | dprintk("%s: done, ret = %d!\n", __func__, task->tk_status); | 2539 | dprintk("%s: done, ret = %d!\n", __func__, task->tk_status); |
@@ -4802,7 +4805,7 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server, | |||
4802 | dprintk("%s ERROR %d, Reset session\n", __func__, | 4805 | dprintk("%s ERROR %d, Reset session\n", __func__, |
4803 | task->tk_status); | 4806 | task->tk_status); |
4804 | nfs4_schedule_session_recovery(clp->cl_session, task->tk_status); | 4807 | nfs4_schedule_session_recovery(clp->cl_session, task->tk_status); |
4805 | goto restart_call; | 4808 | goto wait_on_recovery; |
4806 | #endif /* CONFIG_NFS_V4_1 */ | 4809 | #endif /* CONFIG_NFS_V4_1 */ |
4807 | case -NFS4ERR_DELAY: | 4810 | case -NFS4ERR_DELAY: |
4808 | nfs_inc_server_stats(server, NFSIOS_DELAY); | 4811 | nfs_inc_server_stats(server, NFSIOS_DELAY); |
@@ -4987,11 +4990,17 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata) | |||
4987 | 4990 | ||
4988 | trace_nfs4_delegreturn_exit(&data->args, &data->res, task->tk_status); | 4991 | trace_nfs4_delegreturn_exit(&data->args, &data->res, task->tk_status); |
4989 | switch (task->tk_status) { | 4992 | switch (task->tk_status) { |
4990 | case -NFS4ERR_STALE_STATEID: | ||
4991 | case -NFS4ERR_EXPIRED: | ||
4992 | case 0: | 4993 | case 0: |
4993 | renew_lease(data->res.server, data->timestamp); | 4994 | renew_lease(data->res.server, data->timestamp); |
4994 | break; | 4995 | break; |
4996 | case -NFS4ERR_ADMIN_REVOKED: | ||
4997 | case -NFS4ERR_DELEG_REVOKED: | ||
4998 | case -NFS4ERR_BAD_STATEID: | ||
4999 | case -NFS4ERR_OLD_STATEID: | ||
5000 | case -NFS4ERR_STALE_STATEID: | ||
5001 | case -NFS4ERR_EXPIRED: | ||
5002 | task->tk_status = 0; | ||
5003 | break; | ||
4995 | default: | 5004 | default: |
4996 | if (nfs4_async_handle_error(task, data->res.server, NULL) == | 5005 | if (nfs4_async_handle_error(task, data->res.server, NULL) == |
4997 | -EAGAIN) { | 5006 | -EAGAIN) { |
@@ -7589,7 +7598,14 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata) | |||
7589 | return; | 7598 | return; |
7590 | 7599 | ||
7591 | server = NFS_SERVER(lrp->args.inode); | 7600 | server = NFS_SERVER(lrp->args.inode); |
7592 | if (nfs4_async_handle_error(task, server, NULL) == -EAGAIN) { | 7601 | switch (task->tk_status) { |
7602 | default: | ||
7603 | task->tk_status = 0; | ||
7604 | case 0: | ||
7605 | break; | ||
7606 | case -NFS4ERR_DELAY: | ||
7607 | if (nfs4_async_handle_error(task, server, NULL) != -EAGAIN) | ||
7608 | break; | ||
7593 | rpc_restart_call_prepare(task); | 7609 | rpc_restart_call_prepare(task); |
7594 | return; | 7610 | return; |
7595 | } | 7611 | } |
@@ -726,11 +726,25 @@ pipe_poll(struct file *filp, poll_table *wait) | |||
726 | return mask; | 726 | return mask; |
727 | } | 727 | } |
728 | 728 | ||
729 | static void put_pipe_info(struct inode *inode, struct pipe_inode_info *pipe) | ||
730 | { | ||
731 | int kill = 0; | ||
732 | |||
733 | spin_lock(&inode->i_lock); | ||
734 | if (!--pipe->files) { | ||
735 | inode->i_pipe = NULL; | ||
736 | kill = 1; | ||
737 | } | ||
738 | spin_unlock(&inode->i_lock); | ||
739 | |||
740 | if (kill) | ||
741 | free_pipe_info(pipe); | ||
742 | } | ||
743 | |||
729 | static int | 744 | static int |
730 | pipe_release(struct inode *inode, struct file *file) | 745 | pipe_release(struct inode *inode, struct file *file) |
731 | { | 746 | { |
732 | struct pipe_inode_info *pipe = inode->i_pipe; | 747 | struct pipe_inode_info *pipe = file->private_data; |
733 | int kill = 0; | ||
734 | 748 | ||
735 | __pipe_lock(pipe); | 749 | __pipe_lock(pipe); |
736 | if (file->f_mode & FMODE_READ) | 750 | if (file->f_mode & FMODE_READ) |
@@ -743,17 +757,9 @@ pipe_release(struct inode *inode, struct file *file) | |||
743 | kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); | 757 | kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); |
744 | kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); | 758 | kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); |
745 | } | 759 | } |
746 | spin_lock(&inode->i_lock); | ||
747 | if (!--pipe->files) { | ||
748 | inode->i_pipe = NULL; | ||
749 | kill = 1; | ||
750 | } | ||
751 | spin_unlock(&inode->i_lock); | ||
752 | __pipe_unlock(pipe); | 760 | __pipe_unlock(pipe); |
753 | 761 | ||
754 | if (kill) | 762 | put_pipe_info(inode, pipe); |
755 | free_pipe_info(pipe); | ||
756 | |||
757 | return 0; | 763 | return 0; |
758 | } | 764 | } |
759 | 765 | ||
@@ -1014,7 +1020,6 @@ static int fifo_open(struct inode *inode, struct file *filp) | |||
1014 | { | 1020 | { |
1015 | struct pipe_inode_info *pipe; | 1021 | struct pipe_inode_info *pipe; |
1016 | bool is_pipe = inode->i_sb->s_magic == PIPEFS_MAGIC; | 1022 | bool is_pipe = inode->i_sb->s_magic == PIPEFS_MAGIC; |
1017 | int kill = 0; | ||
1018 | int ret; | 1023 | int ret; |
1019 | 1024 | ||
1020 | filp->f_version = 0; | 1025 | filp->f_version = 0; |
@@ -1130,15 +1135,9 @@ err_wr: | |||
1130 | goto err; | 1135 | goto err; |
1131 | 1136 | ||
1132 | err: | 1137 | err: |
1133 | spin_lock(&inode->i_lock); | ||
1134 | if (!--pipe->files) { | ||
1135 | inode->i_pipe = NULL; | ||
1136 | kill = 1; | ||
1137 | } | ||
1138 | spin_unlock(&inode->i_lock); | ||
1139 | __pipe_unlock(pipe); | 1138 | __pipe_unlock(pipe); |
1140 | if (kill) | 1139 | |
1141 | free_pipe_info(pipe); | 1140 | put_pipe_info(inode, pipe); |
1142 | return ret; | 1141 | return ret; |
1143 | } | 1142 | } |
1144 | 1143 | ||
diff --git a/fs/squashfs/file_direct.c b/fs/squashfs/file_direct.c index 2943b2bfae48..62a0de6632e1 100644 --- a/fs/squashfs/file_direct.c +++ b/fs/squashfs/file_direct.c | |||
@@ -84,6 +84,9 @@ int squashfs_readpage_block(struct page *target_page, u64 block, int bsize) | |||
84 | */ | 84 | */ |
85 | res = squashfs_read_cache(target_page, block, bsize, pages, | 85 | res = squashfs_read_cache(target_page, block, bsize, pages, |
86 | page); | 86 | page); |
87 | if (res < 0) | ||
88 | goto mark_errored; | ||
89 | |||
87 | goto out; | 90 | goto out; |
88 | } | 91 | } |
89 | 92 | ||
@@ -119,7 +122,7 @@ mark_errored: | |||
119 | * dealt with by the caller | 122 | * dealt with by the caller |
120 | */ | 123 | */ |
121 | for (i = 0; i < pages; i++) { | 124 | for (i = 0; i < pages; i++) { |
122 | if (page[i] == target_page) | 125 | if (page[i] == NULL || page[i] == target_page) |
123 | continue; | 126 | continue; |
124 | flush_dcache_page(page[i]); | 127 | flush_dcache_page(page[i]); |
125 | SetPageError(page[i]); | 128 | SetPageError(page[i]); |
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 79b5da2acbe1..b94f93685093 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -609,7 +609,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file) | |||
609 | struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata; | 609 | struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata; |
610 | struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; | 610 | struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; |
611 | struct sysfs_open_file *of; | 611 | struct sysfs_open_file *of; |
612 | bool has_read, has_write; | 612 | bool has_read, has_write, has_mmap; |
613 | int error = -EACCES; | 613 | int error = -EACCES; |
614 | 614 | ||
615 | /* need attr_sd for attr and ops, its parent for kobj */ | 615 | /* need attr_sd for attr and ops, its parent for kobj */ |
@@ -621,6 +621,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file) | |||
621 | 621 | ||
622 | has_read = battr->read || battr->mmap; | 622 | has_read = battr->read || battr->mmap; |
623 | has_write = battr->write || battr->mmap; | 623 | has_write = battr->write || battr->mmap; |
624 | has_mmap = battr->mmap; | ||
624 | } else { | 625 | } else { |
625 | const struct sysfs_ops *ops = sysfs_file_ops(attr_sd); | 626 | const struct sysfs_ops *ops = sysfs_file_ops(attr_sd); |
626 | 627 | ||
@@ -632,6 +633,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file) | |||
632 | 633 | ||
633 | has_read = ops->show; | 634 | has_read = ops->show; |
634 | has_write = ops->store; | 635 | has_write = ops->store; |
636 | has_mmap = false; | ||
635 | } | 637 | } |
636 | 638 | ||
637 | /* check perms and supported operations */ | 639 | /* check perms and supported operations */ |
@@ -649,7 +651,23 @@ static int sysfs_open_file(struct inode *inode, struct file *file) | |||
649 | if (!of) | 651 | if (!of) |
650 | goto err_out; | 652 | goto err_out; |
651 | 653 | ||
652 | mutex_init(&of->mutex); | 654 | /* |
655 | * The following is done to give a different lockdep key to | ||
656 | * @of->mutex for files which implement mmap. This is a rather | ||
657 | * crude way to avoid false positive lockdep warning around | ||
658 | * mm->mmap_sem - mmap nests @of->mutex under mm->mmap_sem and | ||
659 | * reading /sys/block/sda/trace/act_mask grabs sr_mutex, under | ||
660 | * which mm->mmap_sem nests, while holding @of->mutex. As each | ||
661 | * open file has a separate mutex, it's okay as long as those don't | ||
662 | * happen on the same file. At this point, we can't easily give | ||
663 | * each file a separate locking class. Let's differentiate on | ||
664 | * whether the file has mmap or not for now. | ||
665 | */ | ||
666 | if (has_mmap) | ||
667 | mutex_init(&of->mutex); | ||
668 | else | ||
669 | mutex_init(&of->mutex); | ||
670 | |||
653 | of->sd = attr_sd; | 671 | of->sd = attr_sd; |
654 | of->file = file; | 672 | of->file = file; |
655 | 673 | ||
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index d98c67001840..3ea214cff349 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
@@ -83,7 +83,9 @@ | |||
83 | * Should the subsystem abort the loading of an ACPI table if the | 83 | * Should the subsystem abort the loading of an ACPI table if the |
84 | * table checksum is incorrect? | 84 | * table checksum is incorrect? |
85 | */ | 85 | */ |
86 | #ifndef ACPI_CHECKSUM_ABORT | ||
86 | #define ACPI_CHECKSUM_ABORT FALSE | 87 | #define ACPI_CHECKSUM_ABORT FALSE |
88 | #endif | ||
87 | 89 | ||
88 | /* | 90 | /* |
89 | * Generate a version of ACPICA that only supports "reduced hardware" | 91 | * Generate a version of ACPICA that only supports "reduced hardware" |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 7b2de026a4f3..c602c7718421 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -100,6 +100,7 @@ enum acpi_hotplug_mode { | |||
100 | struct acpi_hotplug_profile { | 100 | struct acpi_hotplug_profile { |
101 | struct kobject kobj; | 101 | struct kobject kobj; |
102 | bool enabled:1; | 102 | bool enabled:1; |
103 | bool ignore:1; | ||
103 | enum acpi_hotplug_mode mode; | 104 | enum acpi_hotplug_mode mode; |
104 | }; | 105 | }; |
105 | 106 | ||
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index d8f9457755b4..4278aba96503 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 47 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
48 | 48 | ||
49 | #define ACPI_CA_VERSION 0x20130927 | 49 | #define ACPI_CA_VERSION 0x20131115 |
50 | 50 | ||
51 | #include <acpi/acconfig.h> | 51 | #include <acpi/acconfig.h> |
52 | #include <acpi/actypes.h> | 52 | #include <acpi/actypes.h> |
diff --git a/include/asm-generic/simd.h b/include/asm-generic/simd.h new file mode 100644 index 000000000000..f57eb7b5c23b --- /dev/null +++ b/include/asm-generic/simd.h | |||
@@ -0,0 +1,14 @@ | |||
1 | |||
2 | #include <linux/hardirq.h> | ||
3 | |||
4 | /* | ||
5 | * may_use_simd - whether it is allowable at this time to issue SIMD | ||
6 | * instructions or access the SIMD register file | ||
7 | * | ||
8 | * As architectures typically don't preserve the SIMD register file when | ||
9 | * taking an interrupt, !in_interrupt() should be a reasonable default. | ||
10 | */ | ||
11 | static __must_check inline bool may_use_simd(void) | ||
12 | { | ||
13 | return !in_interrupt(); | ||
14 | } | ||
diff --git a/arch/x86/include/asm/crypto/ablk_helper.h b/include/crypto/ablk_helper.h index 4f93df50c23e..4f93df50c23e 100644 --- a/arch/x86/include/asm/crypto/ablk_helper.h +++ b/include/crypto/ablk_helper.h | |||
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 418d270e1806..e73c19e90e38 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
@@ -386,5 +386,21 @@ static inline int crypto_requires_sync(u32 type, u32 mask) | |||
386 | return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC; | 386 | return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC; |
387 | } | 387 | } |
388 | 388 | ||
389 | #endif /* _CRYPTO_ALGAPI_H */ | 389 | noinline unsigned long __crypto_memneq(const void *a, const void *b, size_t size); |
390 | |||
391 | /** | ||
392 | * crypto_memneq - Compare two areas of memory without leaking | ||
393 | * timing information. | ||
394 | * | ||
395 | * @a: One area of memory | ||
396 | * @b: Another area of memory | ||
397 | * @size: The size of the area. | ||
398 | * | ||
399 | * Returns 0 when data is equal, 1 otherwise. | ||
400 | */ | ||
401 | static inline int crypto_memneq(const void *a, const void *b, size_t size) | ||
402 | { | ||
403 | return __crypto_memneq(a, b, size) != 0UL ? 1 : 0; | ||
404 | } | ||
390 | 405 | ||
406 | #endif /* _CRYPTO_ALGAPI_H */ | ||
diff --git a/include/crypto/authenc.h b/include/crypto/authenc.h index e47b044929a8..6775059539b5 100644 --- a/include/crypto/authenc.h +++ b/include/crypto/authenc.h | |||
@@ -23,5 +23,15 @@ struct crypto_authenc_key_param { | |||
23 | __be32 enckeylen; | 23 | __be32 enckeylen; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | #endif /* _CRYPTO_AUTHENC_H */ | 26 | struct crypto_authenc_keys { |
27 | const u8 *authkey; | ||
28 | const u8 *enckey; | ||
29 | |||
30 | unsigned int authkeylen; | ||
31 | unsigned int enckeylen; | ||
32 | }; | ||
27 | 33 | ||
34 | int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key, | ||
35 | unsigned int keylen); | ||
36 | |||
37 | #endif /* _CRYPTO_AUTHENC_H */ | ||
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 13621cc8cf4c..64ebede184f1 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h | |||
@@ -36,6 +36,7 @@ static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num, | |||
36 | { | 36 | { |
37 | sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0); | 37 | sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0); |
38 | sg1[num - 1].page_link &= ~0x02; | 38 | sg1[num - 1].page_link &= ~0x02; |
39 | sg1[num - 1].page_link |= 0x01; | ||
39 | } | 40 | } |
40 | 41 | ||
41 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | 42 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index dc196bbcf227..ee5fe9d77ae8 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -280,6 +280,14 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy) | |||
280 | policy->cpuinfo.max_freq); | 280 | policy->cpuinfo.max_freq); |
281 | } | 281 | } |
282 | 282 | ||
283 | #ifdef CONFIG_CPU_FREQ | ||
284 | void cpufreq_suspend(void); | ||
285 | void cpufreq_resume(void); | ||
286 | #else | ||
287 | static inline void cpufreq_suspend(void) {} | ||
288 | static inline void cpufreq_resume(void) {} | ||
289 | #endif | ||
290 | |||
283 | /********************************************************************* | 291 | /********************************************************************* |
284 | * CPUFREQ NOTIFIER INTERFACE * | 292 | * CPUFREQ NOTIFIER INTERFACE * |
285 | *********************************************************************/ | 293 | *********************************************************************/ |
diff --git a/include/linux/efi.h b/include/linux/efi.h index bc5687d0f315..11ce6784a196 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -801,6 +801,8 @@ struct efivar_entry { | |||
801 | struct efi_variable var; | 801 | struct efi_variable var; |
802 | struct list_head list; | 802 | struct list_head list; |
803 | struct kobject kobj; | 803 | struct kobject kobj; |
804 | bool scanning; | ||
805 | bool deleting; | ||
804 | }; | 806 | }; |
805 | 807 | ||
806 | 808 | ||
@@ -866,6 +868,8 @@ void efivar_run_worker(void); | |||
866 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) | 868 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) |
867 | int efivars_sysfs_init(void); | 869 | int efivars_sysfs_init(void); |
868 | 870 | ||
871 | #define EFIVARS_DATA_SIZE_MAX 1024 | ||
872 | |||
869 | #endif /* CONFIG_EFI_VARS */ | 873 | #endif /* CONFIG_EFI_VARS */ |
870 | 874 | ||
871 | #endif /* _LINUX_EFI_H */ | 875 | #endif /* _LINUX_EFI_H */ |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 9abbe630c456..8c9b7a1c4138 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -248,6 +248,9 @@ struct ftrace_event_call { | |||
248 | #ifdef CONFIG_PERF_EVENTS | 248 | #ifdef CONFIG_PERF_EVENTS |
249 | int perf_refcount; | 249 | int perf_refcount; |
250 | struct hlist_head __percpu *perf_events; | 250 | struct hlist_head __percpu *perf_events; |
251 | |||
252 | int (*perf_perm)(struct ftrace_event_call *, | ||
253 | struct perf_event *); | ||
251 | #endif | 254 | #endif |
252 | }; | 255 | }; |
253 | 256 | ||
@@ -317,6 +320,19 @@ struct ftrace_event_file { | |||
317 | } \ | 320 | } \ |
318 | early_initcall(trace_init_flags_##name); | 321 | early_initcall(trace_init_flags_##name); |
319 | 322 | ||
323 | #define __TRACE_EVENT_PERF_PERM(name, expr...) \ | ||
324 | static int perf_perm_##name(struct ftrace_event_call *tp_event, \ | ||
325 | struct perf_event *p_event) \ | ||
326 | { \ | ||
327 | return ({ expr; }); \ | ||
328 | } \ | ||
329 | static int __init trace_init_perf_perm_##name(void) \ | ||
330 | { \ | ||
331 | event_##name.perf_perm = &perf_perm_##name; \ | ||
332 | return 0; \ | ||
333 | } \ | ||
334 | early_initcall(trace_init_perf_perm_##name); | ||
335 | |||
320 | #define PERF_MAX_TRACE_SIZE 2048 | 336 | #define PERF_MAX_TRACE_SIZE 2048 |
321 | 337 | ||
322 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ | 338 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 656a27efb2c8..3ea2cf6b0e6c 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h | |||
@@ -2,9 +2,12 @@ | |||
2 | #define __LINUX_GPIO_DRIVER_H | 2 | #define __LINUX_GPIO_DRIVER_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/module.h> | ||
5 | 6 | ||
6 | struct device; | 7 | struct device; |
7 | struct gpio_desc; | 8 | struct gpio_desc; |
9 | struct of_phandle_args; | ||
10 | struct device_node; | ||
8 | struct seq_file; | 11 | struct seq_file; |
9 | 12 | ||
10 | /** | 13 | /** |
@@ -125,6 +128,13 @@ extern struct gpio_chip *gpiochip_find(void *data, | |||
125 | int gpiod_lock_as_irq(struct gpio_desc *desc); | 128 | int gpiod_lock_as_irq(struct gpio_desc *desc); |
126 | void gpiod_unlock_as_irq(struct gpio_desc *desc); | 129 | void gpiod_unlock_as_irq(struct gpio_desc *desc); |
127 | 130 | ||
131 | enum gpio_lookup_flags { | ||
132 | GPIO_ACTIVE_HIGH = (0 << 0), | ||
133 | GPIO_ACTIVE_LOW = (1 << 0), | ||
134 | GPIO_OPEN_DRAIN = (1 << 1), | ||
135 | GPIO_OPEN_SOURCE = (1 << 2), | ||
136 | }; | ||
137 | |||
128 | /** | 138 | /** |
129 | * Lookup table for associating GPIOs to specific devices and functions using | 139 | * Lookup table for associating GPIOs to specific devices and functions using |
130 | * platform data. | 140 | * platform data. |
@@ -152,9 +162,9 @@ struct gpiod_lookup { | |||
152 | */ | 162 | */ |
153 | unsigned int idx; | 163 | unsigned int idx; |
154 | /* | 164 | /* |
155 | * mask of GPIOF_* values | 165 | * mask of GPIO_* values |
156 | */ | 166 | */ |
157 | unsigned long flags; | 167 | enum gpio_lookup_flags flags; |
158 | }; | 168 | }; |
159 | 169 | ||
160 | /* | 170 | /* |
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index a265af294ea4..206a2af6b62b 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h | |||
@@ -21,6 +21,8 @@ | |||
21 | 21 | ||
22 | #include <linux/hid.h> | 22 | #include <linux/hid.h> |
23 | #include <linux/hid-sensor-ids.h> | 23 | #include <linux/hid-sensor-ids.h> |
24 | #include <linux/iio/iio.h> | ||
25 | #include <linux/iio/trigger.h> | ||
24 | 26 | ||
25 | /** | 27 | /** |
26 | * struct hid_sensor_hub_attribute_info - Attribute info | 28 | * struct hid_sensor_hub_attribute_info - Attribute info |
@@ -184,6 +186,7 @@ struct hid_sensor_common { | |||
184 | struct platform_device *pdev; | 186 | struct platform_device *pdev; |
185 | unsigned usage_id; | 187 | unsigned usage_id; |
186 | bool data_ready; | 188 | bool data_ready; |
189 | struct iio_trigger *trigger; | ||
187 | struct hid_sensor_hub_attribute_info poll; | 190 | struct hid_sensor_hub_attribute_info poll; |
188 | struct hid_sensor_hub_attribute_info report_state; | 191 | struct hid_sensor_hub_attribute_info report_state; |
189 | struct hid_sensor_hub_attribute_info power_state; | 192 | struct hid_sensor_hub_attribute_info power_state; |
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h index 714ba08dc092..e374e369fb2f 100644 --- a/include/linux/irqreturn.h +++ b/include/linux/irqreturn.h | |||
@@ -14,6 +14,6 @@ enum irqreturn { | |||
14 | }; | 14 | }; |
15 | 15 | ||
16 | typedef enum irqreturn irqreturn_t; | 16 | typedef enum irqreturn irqreturn_t; |
17 | #define IRQ_RETVAL(x) ((x) != IRQ_NONE) | 17 | #define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) |
18 | 18 | ||
19 | #endif | 19 | #endif |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index c1637062c1ce..12c2cb947df5 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -413,16 +413,6 @@ enum lock_type4 { | |||
413 | #define NFS4_VERSION 4 | 413 | #define NFS4_VERSION 4 |
414 | #define NFS4_MINOR_VERSION 0 | 414 | #define NFS4_MINOR_VERSION 0 |
415 | 415 | ||
416 | #if defined(CONFIG_NFS_V4_2) | ||
417 | #define NFS4_MAX_MINOR_VERSION 2 | ||
418 | #else | ||
419 | #if defined(CONFIG_NFS_V4_1) | ||
420 | #define NFS4_MAX_MINOR_VERSION 1 | ||
421 | #else | ||
422 | #define NFS4_MAX_MINOR_VERSION 0 | ||
423 | #endif /* CONFIG_NFS_V4_1 */ | ||
424 | #endif /* CONFIG_NFS_V4_2 */ | ||
425 | |||
426 | #define NFS4_DEBUG 1 | 416 | #define NFS4_DEBUG 1 |
427 | 417 | ||
428 | /* Index of predefined Linux client operations */ | 418 | /* Index of predefined Linux client operations */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 14a48207a304..48997374eaf0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -507,24 +507,6 @@ extern int nfs_mountpoint_expiry_timeout; | |||
507 | extern void nfs_release_automount_timer(void); | 507 | extern void nfs_release_automount_timer(void); |
508 | 508 | ||
509 | /* | 509 | /* |
510 | * linux/fs/nfs/nfs4proc.c | ||
511 | */ | ||
512 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL | ||
513 | extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); | ||
514 | static inline void nfs4_label_free(struct nfs4_label *label) | ||
515 | { | ||
516 | if (label) { | ||
517 | kfree(label->label); | ||
518 | kfree(label); | ||
519 | } | ||
520 | return; | ||
521 | } | ||
522 | #else | ||
523 | static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } | ||
524 | static inline void nfs4_label_free(void *label) {} | ||
525 | #endif | ||
526 | |||
527 | /* | ||
528 | * linux/fs/nfs/unlink.c | 510 | * linux/fs/nfs/unlink.c |
529 | */ | 511 | */ |
530 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); | 512 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); |
diff --git a/include/linux/padata.h b/include/linux/padata.h index 86292beebfe2..438694650471 100644 --- a/include/linux/padata.h +++ b/include/linux/padata.h | |||
@@ -129,10 +129,9 @@ struct parallel_data { | |||
129 | struct padata_serial_queue __percpu *squeue; | 129 | struct padata_serial_queue __percpu *squeue; |
130 | atomic_t reorder_objects; | 130 | atomic_t reorder_objects; |
131 | atomic_t refcnt; | 131 | atomic_t refcnt; |
132 | atomic_t seq_nr; | ||
132 | struct padata_cpumask cpumask; | 133 | struct padata_cpumask cpumask; |
133 | spinlock_t lock ____cacheline_aligned; | 134 | spinlock_t lock ____cacheline_aligned; |
134 | spinlock_t seq_lock; | ||
135 | unsigned int seq_nr; | ||
136 | unsigned int processed; | 135 | unsigned int processed; |
137 | struct timer_list timer; | 136 | struct timer_list timer; |
138 | }; | 137 | }; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 7e35d4b9e14a..768b037dfacb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -831,8 +831,6 @@ struct sched_domain { | |||
831 | unsigned int balance_interval; /* initialise to 1. units in ms. */ | 831 | unsigned int balance_interval; /* initialise to 1. units in ms. */ |
832 | unsigned int nr_balance_failed; /* initialise to 0 */ | 832 | unsigned int nr_balance_failed; /* initialise to 0 */ |
833 | 833 | ||
834 | u64 last_update; | ||
835 | |||
836 | /* idle_balance() stats */ | 834 | /* idle_balance() stats */ |
837 | u64 max_newidle_lb_cost; | 835 | u64 max_newidle_lb_cost; |
838 | unsigned long next_decay_max_lb_cost; | 836 | unsigned long next_decay_max_lb_cost; |
diff --git a/include/linux/slab.h b/include/linux/slab.h index c2bba248fa63..1e2f4fe12773 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -388,10 +388,55 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) | |||
388 | /** | 388 | /** |
389 | * kmalloc - allocate memory | 389 | * kmalloc - allocate memory |
390 | * @size: how many bytes of memory are required. | 390 | * @size: how many bytes of memory are required. |
391 | * @flags: the type of memory to allocate (see kcalloc). | 391 | * @flags: the type of memory to allocate. |
392 | * | 392 | * |
393 | * kmalloc is the normal method of allocating memory | 393 | * kmalloc is the normal method of allocating memory |
394 | * for objects smaller than page size in the kernel. | 394 | * for objects smaller than page size in the kernel. |
395 | * | ||
396 | * The @flags argument may be one of: | ||
397 | * | ||
398 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
399 | * | ||
400 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
401 | * | ||
402 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. | ||
403 | * For example, use this inside interrupt handlers. | ||
404 | * | ||
405 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
406 | * | ||
407 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
408 | * | ||
409 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
410 | * | ||
411 | * %GFP_NOWAIT - Allocation will not sleep. | ||
412 | * | ||
413 | * %GFP_THISNODE - Allocate node-local memory only. | ||
414 | * | ||
415 | * %GFP_DMA - Allocation suitable for DMA. | ||
416 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
417 | * slab created with SLAB_DMA. | ||
418 | * | ||
419 | * Also it is possible to set different flags by OR'ing | ||
420 | * in one or more of the following additional @flags: | ||
421 | * | ||
422 | * %__GFP_COLD - Request cache-cold pages instead of | ||
423 | * trying to return cache-warm pages. | ||
424 | * | ||
425 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
426 | * | ||
427 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
428 | * (think twice before using). | ||
429 | * | ||
430 | * %__GFP_NORETRY - If memory is not immediately available, | ||
431 | * then give up at once. | ||
432 | * | ||
433 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
434 | * | ||
435 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
436 | * | ||
437 | * There are other flags available as well, but these are not intended | ||
438 | * for general use, and so are not documented here. For a full list of | ||
439 | * potential flags, always refer to linux/gfp.h. | ||
395 | */ | 440 | */ |
396 | static __always_inline void *kmalloc(size_t size, gfp_t flags) | 441 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
397 | { | 442 | { |
@@ -502,61 +547,6 @@ int cache_show(struct kmem_cache *s, struct seq_file *m); | |||
502 | void print_slabinfo_header(struct seq_file *m); | 547 | void print_slabinfo_header(struct seq_file *m); |
503 | 548 | ||
504 | /** | 549 | /** |
505 | * kmalloc - allocate memory | ||
506 | * @size: how many bytes of memory are required. | ||
507 | * @flags: the type of memory to allocate. | ||
508 | * | ||
509 | * The @flags argument may be one of: | ||
510 | * | ||
511 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
512 | * | ||
513 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
514 | * | ||
515 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. | ||
516 | * For example, use this inside interrupt handlers. | ||
517 | * | ||
518 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
519 | * | ||
520 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
521 | * | ||
522 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
523 | * | ||
524 | * %GFP_NOWAIT - Allocation will not sleep. | ||
525 | * | ||
526 | * %GFP_THISNODE - Allocate node-local memory only. | ||
527 | * | ||
528 | * %GFP_DMA - Allocation suitable for DMA. | ||
529 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
530 | * slab created with SLAB_DMA. | ||
531 | * | ||
532 | * Also it is possible to set different flags by OR'ing | ||
533 | * in one or more of the following additional @flags: | ||
534 | * | ||
535 | * %__GFP_COLD - Request cache-cold pages instead of | ||
536 | * trying to return cache-warm pages. | ||
537 | * | ||
538 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
539 | * | ||
540 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
541 | * (think twice before using). | ||
542 | * | ||
543 | * %__GFP_NORETRY - If memory is not immediately available, | ||
544 | * then give up at once. | ||
545 | * | ||
546 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
547 | * | ||
548 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
549 | * | ||
550 | * There are other flags available as well, but these are not intended | ||
551 | * for general use, and so are not documented here. For a full list of | ||
552 | * potential flags, always refer to linux/gfp.h. | ||
553 | * | ||
554 | * kmalloc is the normal method of allocating memory | ||
555 | * in the kernel. | ||
556 | */ | ||
557 | static __always_inline void *kmalloc(size_t size, gfp_t flags); | ||
558 | |||
559 | /** | ||
560 | * kmalloc_array - allocate memory for an array. | 550 | * kmalloc_array - allocate memory for an array. |
561 | * @n: number of elements. | 551 | * @n: number of elements. |
562 | * @size: element size. | 552 | * @size: element size. |
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h index c98cfa406952..fd4498329c7c 100644 --- a/include/linux/tegra-powergate.h +++ b/include/linux/tegra-powergate.h | |||
@@ -45,6 +45,7 @@ struct clk; | |||
45 | 45 | ||
46 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D | 46 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D |
47 | 47 | ||
48 | #ifdef CONFIG_ARCH_TEGRA | ||
48 | int tegra_powergate_is_powered(int id); | 49 | int tegra_powergate_is_powered(int id); |
49 | int tegra_powergate_power_on(int id); | 50 | int tegra_powergate_power_on(int id); |
50 | int tegra_powergate_power_off(int id); | 51 | int tegra_powergate_power_off(int id); |
@@ -52,5 +53,31 @@ int tegra_powergate_remove_clamping(int id); | |||
52 | 53 | ||
53 | /* Must be called with clk disabled, and returns with clk enabled */ | 54 | /* Must be called with clk disabled, and returns with clk enabled */ |
54 | int tegra_powergate_sequence_power_up(int id, struct clk *clk); | 55 | int tegra_powergate_sequence_power_up(int id, struct clk *clk); |
56 | #else | ||
57 | static inline int tegra_powergate_is_powered(int id) | ||
58 | { | ||
59 | return -ENOSYS; | ||
60 | } | ||
61 | |||
62 | static inline int tegra_powergate_power_on(int id) | ||
63 | { | ||
64 | return -ENOSYS; | ||
65 | } | ||
66 | |||
67 | static inline int tegra_powergate_power_off(int id) | ||
68 | { | ||
69 | return -ENOSYS; | ||
70 | } | ||
71 | |||
72 | static inline int tegra_powergate_remove_clamping(int id) | ||
73 | { | ||
74 | return -ENOSYS; | ||
75 | } | ||
76 | |||
77 | static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk) | ||
78 | { | ||
79 | return -ENOSYS; | ||
80 | } | ||
81 | #endif | ||
55 | 82 | ||
56 | #endif /* _MACH_TEGRA_POWERGATE_H_ */ | 83 | #endif /* _MACH_TEGRA_POWERGATE_H_ */ |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index ebeab360d851..f16dc0a40049 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -267,6 +267,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
267 | 267 | ||
268 | #define TRACE_EVENT_FLAGS(event, flag) | 268 | #define TRACE_EVENT_FLAGS(event, flag) |
269 | 269 | ||
270 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
271 | |||
270 | #endif /* DECLARE_TRACE */ | 272 | #endif /* DECLARE_TRACE */ |
271 | 273 | ||
272 | #ifndef TRACE_EVENT | 274 | #ifndef TRACE_EVENT |
@@ -399,4 +401,6 @@ static inline void tracepoint_synchronize_unregister(void) | |||
399 | 401 | ||
400 | #define TRACE_EVENT_FLAGS(event, flag) | 402 | #define TRACE_EVENT_FLAGS(event, flag) |
401 | 403 | ||
404 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
405 | |||
402 | #endif /* ifdef TRACE_EVENT (see note above) */ | 406 | #endif /* ifdef TRACE_EVENT (see note above) */ |
diff --git a/include/net/ip.h b/include/net/ip.h index 217bc5bfc6c6..5a25f36fe3a7 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -473,7 +473,7 @@ int compat_ip_getsockopt(struct sock *sk, int level, int optname, | |||
473 | int ip_ra_control(struct sock *sk, unsigned char on, | 473 | int ip_ra_control(struct sock *sk, unsigned char on, |
474 | void (*destructor)(struct sock *)); | 474 | void (*destructor)(struct sock *)); |
475 | 475 | ||
476 | int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); | 476 | int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len); |
477 | void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | 477 | void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
478 | u32 info, u8 *payload); | 478 | u32 info, u8 *payload); |
479 | void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | 479 | void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 2a5f668cd683..eb198acaac1d 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -776,8 +776,10 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
776 | 776 | ||
777 | int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); | 777 | int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); |
778 | 778 | ||
779 | int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); | 779 | int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, |
780 | int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len); | 780 | int *addr_len); |
781 | int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len, | ||
782 | int *addr_len); | ||
781 | void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | 783 | void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
782 | u32 info, u8 *payload); | 784 | u32 info, u8 *payload); |
783 | void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info); | 785 | void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info); |
diff --git a/include/net/ping.h b/include/net/ping.h index 3f67704f3747..90f48417b03d 100644 --- a/include/net/ping.h +++ b/include/net/ping.h | |||
@@ -31,7 +31,8 @@ | |||
31 | 31 | ||
32 | /* Compatibility glue so we can support IPv6 when it's compiled as a module */ | 32 | /* Compatibility glue so we can support IPv6 when it's compiled as a module */ |
33 | struct pingv6_ops { | 33 | struct pingv6_ops { |
34 | int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len); | 34 | int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len, |
35 | int *addr_len); | ||
35 | int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg, | 36 | int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg, |
36 | struct sk_buff *skb); | 37 | struct sk_buff *skb); |
37 | int (*icmpv6_err_convert)(u8 type, u8 code, int *err); | 38 | int (*icmpv6_err_convert)(u8 type, u8 code, int *err); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 2174d8da0770..ea0ca5f6e629 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -629,6 +629,7 @@ struct sctp_chunk { | |||
629 | #define SCTP_NEED_FRTX 0x1 | 629 | #define SCTP_NEED_FRTX 0x1 |
630 | #define SCTP_DONT_FRTX 0x2 | 630 | #define SCTP_DONT_FRTX 0x2 |
631 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ | 631 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ |
632 | resent:1, /* Has this chunk ever been resent. */ | ||
632 | has_tsn:1, /* Does this chunk have a TSN yet? */ | 633 | has_tsn:1, /* Does this chunk have a TSN yet? */ |
633 | has_ssn:1, /* Does this chunk have a SSN yet? */ | 634 | has_ssn:1, /* Does this chunk have a SSN yet? */ |
634 | singleton:1, /* Only chunk in the packet? */ | 635 | singleton:1, /* Only chunk in the packet? */ |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 546084964d55..fe3b58e836c8 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -475,6 +475,9 @@ struct scsi_host_template { | |||
475 | */ | 475 | */ |
476 | unsigned ordered_tag:1; | 476 | unsigned ordered_tag:1; |
477 | 477 | ||
478 | /* True if the controller does not support WRITE SAME */ | ||
479 | unsigned no_write_same:1; | ||
480 | |||
478 | /* | 481 | /* |
479 | * Countdown for host blocking with no commands outstanding. | 482 | * Countdown for host blocking with no commands outstanding. |
480 | */ | 483 | */ |
@@ -677,6 +680,9 @@ struct Scsi_Host { | |||
677 | /* Don't resume host in EH */ | 680 | /* Don't resume host in EH */ |
678 | unsigned eh_noresume:1; | 681 | unsigned eh_noresume:1; |
679 | 682 | ||
683 | /* The controller does not support WRITE SAME */ | ||
684 | unsigned no_write_same:1; | ||
685 | |||
680 | /* | 686 | /* |
681 | * Optional work queue to be utilized by the transport | 687 | * Optional work queue to be utilized by the transport |
682 | */ | 688 | */ |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 2037c45adfe6..56ebdfca6273 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -104,7 +104,8 @@ struct device; | |||
104 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ | 104 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
105 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | 105 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
106 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 106 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
107 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, \ | 107 | { .id = snd_soc_dapm_mux, .name = wname, \ |
108 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ | ||
108 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | 109 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
109 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 110 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
110 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ | 111 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 52594b20179e..5c38606613d8 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -90,6 +90,10 @@ | |||
90 | #define TRACE_EVENT_FLAGS(name, value) \ | 90 | #define TRACE_EVENT_FLAGS(name, value) \ |
91 | __TRACE_EVENT_FLAGS(name, value) | 91 | __TRACE_EVENT_FLAGS(name, value) |
92 | 92 | ||
93 | #undef TRACE_EVENT_PERF_PERM | ||
94 | #define TRACE_EVENT_PERF_PERM(name, expr...) \ | ||
95 | __TRACE_EVENT_PERF_PERM(name, expr) | ||
96 | |||
93 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 97 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
94 | 98 | ||
95 | 99 | ||
@@ -140,6 +144,9 @@ | |||
140 | #undef TRACE_EVENT_FLAGS | 144 | #undef TRACE_EVENT_FLAGS |
141 | #define TRACE_EVENT_FLAGS(event, flag) | 145 | #define TRACE_EVENT_FLAGS(event, flag) |
142 | 146 | ||
147 | #undef TRACE_EVENT_PERF_PERM | ||
148 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
149 | |||
143 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 150 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
144 | 151 | ||
145 | /* | 152 | /* |
@@ -372,7 +379,8 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | |||
372 | __data_size += (len) * sizeof(type); | 379 | __data_size += (len) * sizeof(type); |
373 | 380 | ||
374 | #undef __string | 381 | #undef __string |
375 | #define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) | 382 | #define __string(item, src) __dynamic_array(char, item, \ |
383 | strlen((src) ? (const char *)(src) : "(null)") + 1) | ||
376 | 384 | ||
377 | #undef DECLARE_EVENT_CLASS | 385 | #undef DECLARE_EVENT_CLASS |
378 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 386 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
@@ -501,7 +509,7 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
501 | 509 | ||
502 | #undef __assign_str | 510 | #undef __assign_str |
503 | #define __assign_str(dst, src) \ | 511 | #define __assign_str(dst, src) \ |
504 | strcpy(__get_str(dst), src); | 512 | strcpy(__get_str(dst), (src) ? (const char *)(src) : "(null)"); |
505 | 513 | ||
506 | #undef TP_fast_assign | 514 | #undef TP_fast_assign |
507 | #define TP_fast_assign(args...) args | 515 | #define TP_fast_assign(args...) args |
diff --git a/include/uapi/linux/eventpoll.h b/include/uapi/linux/eventpoll.h index 2c267bcbb85c..bc81fb2e1f0e 100644 --- a/include/uapi/linux/eventpoll.h +++ b/include/uapi/linux/eventpoll.h | |||
@@ -61,5 +61,16 @@ struct epoll_event { | |||
61 | __u64 data; | 61 | __u64 data; |
62 | } EPOLL_PACKED; | 62 | } EPOLL_PACKED; |
63 | 63 | ||
64 | 64 | #ifdef CONFIG_PM_SLEEP | |
65 | static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) | ||
66 | { | ||
67 | if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) | ||
68 | epev->events &= ~EPOLLWAKEUP; | ||
69 | } | ||
70 | #else | ||
71 | static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) | ||
72 | { | ||
73 | epev->events &= ~EPOLLWAKEUP; | ||
74 | } | ||
75 | #endif | ||
65 | #endif /* _UAPI_LINUX_EVENTPOLL_H */ | 76 | #endif /* _UAPI_LINUX_EVENTPOLL_H */ |
diff --git a/include/uapi/linux/genetlink.h b/include/uapi/linux/genetlink.h index 1af72d8228e0..c3363ba1ae05 100644 --- a/include/uapi/linux/genetlink.h +++ b/include/uapi/linux/genetlink.h | |||
@@ -28,6 +28,7 @@ struct genlmsghdr { | |||
28 | #define GENL_ID_GENERATE 0 | 28 | #define GENL_ID_GENERATE 0 |
29 | #define GENL_ID_CTRL NLMSG_MIN_TYPE | 29 | #define GENL_ID_CTRL NLMSG_MIN_TYPE |
30 | #define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1) | 30 | #define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1) |
31 | #define GENL_ID_PMCRAID (NLMSG_MIN_TYPE + 2) | ||
31 | 32 | ||
32 | /************************************************************************** | 33 | /************************************************************************** |
33 | * Controller | 34 | * Controller |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index b78566f59aba..6db460121f84 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
@@ -488,7 +488,9 @@ enum { | |||
488 | IFLA_HSR_UNSPEC, | 488 | IFLA_HSR_UNSPEC, |
489 | IFLA_HSR_SLAVE1, | 489 | IFLA_HSR_SLAVE1, |
490 | IFLA_HSR_SLAVE2, | 490 | IFLA_HSR_SLAVE2, |
491 | IFLA_HSR_MULTICAST_SPEC, | 491 | IFLA_HSR_MULTICAST_SPEC, /* Last byte of supervision addr */ |
492 | IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */ | ||
493 | IFLA_HSR_SEQ_NR, | ||
492 | __IFLA_HSR_MAX, | 494 | __IFLA_HSR_MAX, |
493 | }; | 495 | }; |
494 | 496 | ||
diff --git a/include/uapi/linux/netlink_diag.h b/include/uapi/linux/netlink_diag.h index 4e31db4eea41..f2159d30d1f5 100644 --- a/include/uapi/linux/netlink_diag.h +++ b/include/uapi/linux/netlink_diag.h | |||
@@ -33,6 +33,7 @@ struct netlink_diag_ring { | |||
33 | }; | 33 | }; |
34 | 34 | ||
35 | enum { | 35 | enum { |
36 | /* NETLINK_DIAG_NONE, standard nl API requires this attribute! */ | ||
36 | NETLINK_DIAG_MEMINFO, | 37 | NETLINK_DIAG_MEMINFO, |
37 | NETLINK_DIAG_GROUPS, | 38 | NETLINK_DIAG_GROUPS, |
38 | NETLINK_DIAG_RX_RING, | 39 | NETLINK_DIAG_RX_RING, |
diff --git a/include/uapi/linux/packet_diag.h b/include/uapi/linux/packet_diag.h index b2cc0cd9c4d9..d08c63f3dd6f 100644 --- a/include/uapi/linux/packet_diag.h +++ b/include/uapi/linux/packet_diag.h | |||
@@ -29,6 +29,7 @@ struct packet_diag_msg { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | enum { | 31 | enum { |
32 | /* PACKET_DIAG_NONE, standard nl API requires this attribute! */ | ||
32 | PACKET_DIAG_INFO, | 33 | PACKET_DIAG_INFO, |
33 | PACKET_DIAG_MCLIST, | 34 | PACKET_DIAG_MCLIST, |
34 | PACKET_DIAG_RX_RING, | 35 | PACKET_DIAG_RX_RING, |
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h index b9e2a6a7446f..1eb0b8dd1830 100644 --- a/include/uapi/linux/unix_diag.h +++ b/include/uapi/linux/unix_diag.h | |||
@@ -31,6 +31,7 @@ struct unix_diag_msg { | |||
31 | }; | 31 | }; |
32 | 32 | ||
33 | enum { | 33 | enum { |
34 | /* UNIX_DIAG_NONE, standard nl API requires this attribute! */ | ||
34 | UNIX_DIAG_NAME, | 35 | UNIX_DIAG_NAME, |
35 | UNIX_DIAG_VFS, | 36 | UNIX_DIAG_VFS, |
36 | UNIX_DIAG_PEER, | 37 | UNIX_DIAG_PEER, |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 4c62513fe19f..8b729c278b64 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -90,6 +90,14 @@ static DEFINE_MUTEX(cgroup_mutex); | |||
90 | static DEFINE_MUTEX(cgroup_root_mutex); | 90 | static DEFINE_MUTEX(cgroup_root_mutex); |
91 | 91 | ||
92 | /* | 92 | /* |
93 | * cgroup destruction makes heavy use of work items and there can be a lot | ||
94 | * of concurrent destructions. Use a separate workqueue so that cgroup | ||
95 | * destruction work items don't end up filling up max_active of system_wq | ||
96 | * which may lead to deadlock. | ||
97 | */ | ||
98 | static struct workqueue_struct *cgroup_destroy_wq; | ||
99 | |||
100 | /* | ||
93 | * Generate an array of cgroup subsystem pointers. At boot time, this is | 101 | * Generate an array of cgroup subsystem pointers. At boot time, this is |
94 | * populated with the built in subsystems, and modular subsystems are | 102 | * populated with the built in subsystems, and modular subsystems are |
95 | * registered after that. The mutable section of this array is protected by | 103 | * registered after that. The mutable section of this array is protected by |
@@ -191,6 +199,7 @@ static void cgroup_destroy_css_killed(struct cgroup *cgrp); | |||
191 | static int cgroup_destroy_locked(struct cgroup *cgrp); | 199 | static int cgroup_destroy_locked(struct cgroup *cgrp); |
192 | static int cgroup_addrm_files(struct cgroup *cgrp, struct cftype cfts[], | 200 | static int cgroup_addrm_files(struct cgroup *cgrp, struct cftype cfts[], |
193 | bool is_add); | 201 | bool is_add); |
202 | static int cgroup_file_release(struct inode *inode, struct file *file); | ||
194 | 203 | ||
195 | /** | 204 | /** |
196 | * cgroup_css - obtain a cgroup's css for the specified subsystem | 205 | * cgroup_css - obtain a cgroup's css for the specified subsystem |
@@ -871,7 +880,7 @@ static void cgroup_free_rcu(struct rcu_head *head) | |||
871 | struct cgroup *cgrp = container_of(head, struct cgroup, rcu_head); | 880 | struct cgroup *cgrp = container_of(head, struct cgroup, rcu_head); |
872 | 881 | ||
873 | INIT_WORK(&cgrp->destroy_work, cgroup_free_fn); | 882 | INIT_WORK(&cgrp->destroy_work, cgroup_free_fn); |
874 | schedule_work(&cgrp->destroy_work); | 883 | queue_work(cgroup_destroy_wq, &cgrp->destroy_work); |
875 | } | 884 | } |
876 | 885 | ||
877 | static void cgroup_diput(struct dentry *dentry, struct inode *inode) | 886 | static void cgroup_diput(struct dentry *dentry, struct inode *inode) |
@@ -2421,7 +2430,7 @@ static const struct file_operations cgroup_seqfile_operations = { | |||
2421 | .read = seq_read, | 2430 | .read = seq_read, |
2422 | .write = cgroup_file_write, | 2431 | .write = cgroup_file_write, |
2423 | .llseek = seq_lseek, | 2432 | .llseek = seq_lseek, |
2424 | .release = single_release, | 2433 | .release = cgroup_file_release, |
2425 | }; | 2434 | }; |
2426 | 2435 | ||
2427 | static int cgroup_file_open(struct inode *inode, struct file *file) | 2436 | static int cgroup_file_open(struct inode *inode, struct file *file) |
@@ -2482,6 +2491,8 @@ static int cgroup_file_release(struct inode *inode, struct file *file) | |||
2482 | ret = cft->release(inode, file); | 2491 | ret = cft->release(inode, file); |
2483 | if (css->ss) | 2492 | if (css->ss) |
2484 | css_put(css); | 2493 | css_put(css); |
2494 | if (file->f_op == &cgroup_seqfile_operations) | ||
2495 | single_release(inode, file); | ||
2485 | return ret; | 2496 | return ret; |
2486 | } | 2497 | } |
2487 | 2498 | ||
@@ -4249,7 +4260,7 @@ static void css_free_rcu_fn(struct rcu_head *rcu_head) | |||
4249 | * css_put(). dput() requires process context which we don't have. | 4260 | * css_put(). dput() requires process context which we don't have. |
4250 | */ | 4261 | */ |
4251 | INIT_WORK(&css->destroy_work, css_free_work_fn); | 4262 | INIT_WORK(&css->destroy_work, css_free_work_fn); |
4252 | schedule_work(&css->destroy_work); | 4263 | queue_work(cgroup_destroy_wq, &css->destroy_work); |
4253 | } | 4264 | } |
4254 | 4265 | ||
4255 | static void css_release(struct percpu_ref *ref) | 4266 | static void css_release(struct percpu_ref *ref) |
@@ -4539,7 +4550,7 @@ static void css_killed_ref_fn(struct percpu_ref *ref) | |||
4539 | container_of(ref, struct cgroup_subsys_state, refcnt); | 4550 | container_of(ref, struct cgroup_subsys_state, refcnt); |
4540 | 4551 | ||
4541 | INIT_WORK(&css->destroy_work, css_killed_work_fn); | 4552 | INIT_WORK(&css->destroy_work, css_killed_work_fn); |
4542 | schedule_work(&css->destroy_work); | 4553 | queue_work(cgroup_destroy_wq, &css->destroy_work); |
4543 | } | 4554 | } |
4544 | 4555 | ||
4545 | /** | 4556 | /** |
@@ -5063,6 +5074,22 @@ out: | |||
5063 | return err; | 5074 | return err; |
5064 | } | 5075 | } |
5065 | 5076 | ||
5077 | static int __init cgroup_wq_init(void) | ||
5078 | { | ||
5079 | /* | ||
5080 | * There isn't much point in executing destruction path in | ||
5081 | * parallel. Good chunk is serialized with cgroup_mutex anyway. | ||
5082 | * Use 1 for @max_active. | ||
5083 | * | ||
5084 | * We would prefer to do this in cgroup_init() above, but that | ||
5085 | * is called before init_workqueues(): so leave this until after. | ||
5086 | */ | ||
5087 | cgroup_destroy_wq = alloc_workqueue("cgroup_destroy", 0, 1); | ||
5088 | BUG_ON(!cgroup_destroy_wq); | ||
5089 | return 0; | ||
5090 | } | ||
5091 | core_initcall(cgroup_wq_init); | ||
5092 | |||
5066 | /* | 5093 | /* |
5067 | * proc_cgroup_show() | 5094 | * proc_cgroup_show() |
5068 | * - Print task's cgroup paths into seq_file, one line for each hierarchy | 5095 | * - Print task's cgroup paths into seq_file, one line for each hierarchy |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 6bf981e13c43..4772034b4b17 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -1033,8 +1033,10 @@ static void cpuset_change_task_nodemask(struct task_struct *tsk, | |||
1033 | need_loop = task_has_mempolicy(tsk) || | 1033 | need_loop = task_has_mempolicy(tsk) || |
1034 | !nodes_intersects(*newmems, tsk->mems_allowed); | 1034 | !nodes_intersects(*newmems, tsk->mems_allowed); |
1035 | 1035 | ||
1036 | if (need_loop) | 1036 | if (need_loop) { |
1037 | local_irq_disable(); | ||
1037 | write_seqcount_begin(&tsk->mems_allowed_seq); | 1038 | write_seqcount_begin(&tsk->mems_allowed_seq); |
1039 | } | ||
1038 | 1040 | ||
1039 | nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems); | 1041 | nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems); |
1040 | mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP1); | 1042 | mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP1); |
@@ -1042,8 +1044,10 @@ static void cpuset_change_task_nodemask(struct task_struct *tsk, | |||
1042 | mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP2); | 1044 | mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP2); |
1043 | tsk->mems_allowed = *newmems; | 1045 | tsk->mems_allowed = *newmems; |
1044 | 1046 | ||
1045 | if (need_loop) | 1047 | if (need_loop) { |
1046 | write_seqcount_end(&tsk->mems_allowed_seq); | 1048 | write_seqcount_end(&tsk->mems_allowed_seq); |
1049 | local_irq_enable(); | ||
1050 | } | ||
1047 | 1051 | ||
1048 | task_unlock(tsk); | 1052 | task_unlock(tsk); |
1049 | } | 1053 | } |
diff --git a/kernel/events/core.c b/kernel/events/core.c index d724e7757cd1..72348dc192c1 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -5680,11 +5680,6 @@ static void swevent_hlist_put(struct perf_event *event) | |||
5680 | { | 5680 | { |
5681 | int cpu; | 5681 | int cpu; |
5682 | 5682 | ||
5683 | if (event->cpu != -1) { | ||
5684 | swevent_hlist_put_cpu(event, event->cpu); | ||
5685 | return; | ||
5686 | } | ||
5687 | |||
5688 | for_each_possible_cpu(cpu) | 5683 | for_each_possible_cpu(cpu) |
5689 | swevent_hlist_put_cpu(event, cpu); | 5684 | swevent_hlist_put_cpu(event, cpu); |
5690 | } | 5685 | } |
@@ -5718,9 +5713,6 @@ static int swevent_hlist_get(struct perf_event *event) | |||
5718 | int err; | 5713 | int err; |
5719 | int cpu, failed_cpu; | 5714 | int cpu, failed_cpu; |
5720 | 5715 | ||
5721 | if (event->cpu != -1) | ||
5722 | return swevent_hlist_get_cpu(event, event->cpu); | ||
5723 | |||
5724 | get_online_cpus(); | 5716 | get_online_cpus(); |
5725 | for_each_possible_cpu(cpu) { | 5717 | for_each_possible_cpu(cpu) { |
5726 | err = swevent_hlist_get_cpu(event, cpu); | 5718 | err = swevent_hlist_get_cpu(event, cpu); |
diff --git a/kernel/extable.c b/kernel/extable.c index 832cb28105bb..763faf037ec1 100644 --- a/kernel/extable.c +++ b/kernel/extable.c | |||
@@ -61,7 +61,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr) | |||
61 | static inline int init_kernel_text(unsigned long addr) | 61 | static inline int init_kernel_text(unsigned long addr) |
62 | { | 62 | { |
63 | if (addr >= (unsigned long)_sinittext && | 63 | if (addr >= (unsigned long)_sinittext && |
64 | addr <= (unsigned long)_einittext) | 64 | addr < (unsigned long)_einittext) |
65 | return 1; | 65 | return 1; |
66 | return 0; | 66 | return 0; |
67 | } | 67 | } |
@@ -69,7 +69,7 @@ static inline int init_kernel_text(unsigned long addr) | |||
69 | int core_kernel_text(unsigned long addr) | 69 | int core_kernel_text(unsigned long addr) |
70 | { | 70 | { |
71 | if (addr >= (unsigned long)_stext && | 71 | if (addr >= (unsigned long)_stext && |
72 | addr <= (unsigned long)_etext) | 72 | addr < (unsigned long)_etext) |
73 | return 1; | 73 | return 1; |
74 | 74 | ||
75 | if (system_state == SYSTEM_BOOTING && | 75 | if (system_state == SYSTEM_BOOTING && |
diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c index cb228bf21760..abcd6ca86cb7 100644 --- a/kernel/irq/pm.c +++ b/kernel/irq/pm.c | |||
@@ -50,7 +50,7 @@ static void resume_irqs(bool want_early) | |||
50 | bool is_early = desc->action && | 50 | bool is_early = desc->action && |
51 | desc->action->flags & IRQF_EARLY_RESUME; | 51 | desc->action->flags & IRQF_EARLY_RESUME; |
52 | 52 | ||
53 | if (is_early != want_early) | 53 | if (!is_early && want_early) |
54 | continue; | 54 | continue; |
55 | 55 | ||
56 | raw_spin_lock_irqsave(&desc->lock, flags); | 56 | raw_spin_lock_irqsave(&desc->lock, flags); |
diff --git a/kernel/padata.c b/kernel/padata.c index 07af2c95dcfe..2abd25d79cc8 100644 --- a/kernel/padata.c +++ b/kernel/padata.c | |||
@@ -46,6 +46,7 @@ static int padata_index_to_cpu(struct parallel_data *pd, int cpu_index) | |||
46 | 46 | ||
47 | static int padata_cpu_hash(struct parallel_data *pd) | 47 | static int padata_cpu_hash(struct parallel_data *pd) |
48 | { | 48 | { |
49 | unsigned int seq_nr; | ||
49 | int cpu_index; | 50 | int cpu_index; |
50 | 51 | ||
51 | /* | 52 | /* |
@@ -53,10 +54,8 @@ static int padata_cpu_hash(struct parallel_data *pd) | |||
53 | * seq_nr mod. number of cpus in use. | 54 | * seq_nr mod. number of cpus in use. |
54 | */ | 55 | */ |
55 | 56 | ||
56 | spin_lock(&pd->seq_lock); | 57 | seq_nr = atomic_inc_return(&pd->seq_nr); |
57 | cpu_index = pd->seq_nr % cpumask_weight(pd->cpumask.pcpu); | 58 | cpu_index = seq_nr % cpumask_weight(pd->cpumask.pcpu); |
58 | pd->seq_nr++; | ||
59 | spin_unlock(&pd->seq_lock); | ||
60 | 59 | ||
61 | return padata_index_to_cpu(pd, cpu_index); | 60 | return padata_index_to_cpu(pd, cpu_index); |
62 | } | 61 | } |
@@ -429,7 +428,7 @@ static struct parallel_data *padata_alloc_pd(struct padata_instance *pinst, | |||
429 | padata_init_pqueues(pd); | 428 | padata_init_pqueues(pd); |
430 | padata_init_squeues(pd); | 429 | padata_init_squeues(pd); |
431 | setup_timer(&pd->timer, padata_reorder_timer, (unsigned long)pd); | 430 | setup_timer(&pd->timer, padata_reorder_timer, (unsigned long)pd); |
432 | pd->seq_nr = 0; | 431 | atomic_set(&pd->seq_nr, -1); |
433 | atomic_set(&pd->reorder_objects, 0); | 432 | atomic_set(&pd->reorder_objects, 0); |
434 | atomic_set(&pd->refcnt, 0); | 433 | atomic_set(&pd->refcnt, 0); |
435 | pd->pinst = pinst; | 434 | pd->pinst = pinst; |
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 6abb03dff5c0..08a765232432 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -1632,7 +1632,7 @@ module_param(rcu_idle_gp_delay, int, 0644); | |||
1632 | static int rcu_idle_lazy_gp_delay = RCU_IDLE_LAZY_GP_DELAY; | 1632 | static int rcu_idle_lazy_gp_delay = RCU_IDLE_LAZY_GP_DELAY; |
1633 | module_param(rcu_idle_lazy_gp_delay, int, 0644); | 1633 | module_param(rcu_idle_lazy_gp_delay, int, 0644); |
1634 | 1634 | ||
1635 | extern int tick_nohz_enabled; | 1635 | extern int tick_nohz_active; |
1636 | 1636 | ||
1637 | /* | 1637 | /* |
1638 | * Try to advance callbacks for all flavors of RCU on the current CPU, but | 1638 | * Try to advance callbacks for all flavors of RCU on the current CPU, but |
@@ -1729,7 +1729,7 @@ static void rcu_prepare_for_idle(int cpu) | |||
1729 | int tne; | 1729 | int tne; |
1730 | 1730 | ||
1731 | /* Handle nohz enablement switches conservatively. */ | 1731 | /* Handle nohz enablement switches conservatively. */ |
1732 | tne = ACCESS_ONCE(tick_nohz_enabled); | 1732 | tne = ACCESS_ONCE(tick_nohz_active); |
1733 | if (tne != rdtp->tick_nohz_enabled_snap) { | 1733 | if (tne != rdtp->tick_nohz_enabled_snap) { |
1734 | if (rcu_cpu_has_callbacks(cpu, NULL)) | 1734 | if (rcu_cpu_has_callbacks(cpu, NULL)) |
1735 | invoke_rcu_core(); /* force nohz to see update. */ | 1735 | invoke_rcu_core(); /* force nohz to see update. */ |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c1808606ee5f..e85cda20ab2b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -2660,6 +2660,7 @@ asmlinkage void __sched notrace preempt_schedule(void) | |||
2660 | } while (need_resched()); | 2660 | } while (need_resched()); |
2661 | } | 2661 | } |
2662 | EXPORT_SYMBOL(preempt_schedule); | 2662 | EXPORT_SYMBOL(preempt_schedule); |
2663 | #endif /* CONFIG_PREEMPT */ | ||
2663 | 2664 | ||
2664 | /* | 2665 | /* |
2665 | * this is the entry point to schedule() from kernel preemption | 2666 | * this is the entry point to schedule() from kernel preemption |
@@ -2693,8 +2694,6 @@ asmlinkage void __sched preempt_schedule_irq(void) | |||
2693 | exception_exit(prev_state); | 2694 | exception_exit(prev_state); |
2694 | } | 2695 | } |
2695 | 2696 | ||
2696 | #endif /* CONFIG_PREEMPT */ | ||
2697 | |||
2698 | int default_wake_function(wait_queue_t *curr, unsigned mode, int wake_flags, | 2697 | int default_wake_function(wait_queue_t *curr, unsigned mode, int wake_flags, |
2699 | void *key) | 2698 | void *key) |
2700 | { | 2699 | { |
@@ -4762,7 +4761,7 @@ static void rq_attach_root(struct rq *rq, struct root_domain *rd) | |||
4762 | cpumask_clear_cpu(rq->cpu, old_rd->span); | 4761 | cpumask_clear_cpu(rq->cpu, old_rd->span); |
4763 | 4762 | ||
4764 | /* | 4763 | /* |
4765 | * If we dont want to free the old_rt yet then | 4764 | * If we dont want to free the old_rd yet then |
4766 | * set old_rd to NULL to skip the freeing later | 4765 | * set old_rd to NULL to skip the freeing later |
4767 | * in this function: | 4766 | * in this function: |
4768 | */ | 4767 | */ |
@@ -4910,8 +4909,9 @@ static void update_top_cache_domain(int cpu) | |||
4910 | if (sd) { | 4909 | if (sd) { |
4911 | id = cpumask_first(sched_domain_span(sd)); | 4910 | id = cpumask_first(sched_domain_span(sd)); |
4912 | size = cpumask_weight(sched_domain_span(sd)); | 4911 | size = cpumask_weight(sched_domain_span(sd)); |
4913 | rcu_assign_pointer(per_cpu(sd_busy, cpu), sd->parent); | 4912 | sd = sd->parent; /* sd_busy */ |
4914 | } | 4913 | } |
4914 | rcu_assign_pointer(per_cpu(sd_busy, cpu), sd); | ||
4915 | 4915 | ||
4916 | rcu_assign_pointer(per_cpu(sd_llc, cpu), sd); | 4916 | rcu_assign_pointer(per_cpu(sd_llc, cpu), sd); |
4917 | per_cpu(sd_llc_size, cpu) = size; | 4917 | per_cpu(sd_llc_size, cpu) = size; |
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e8b652ebe027..fd773ade1a31 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -5379,10 +5379,31 @@ void update_group_power(struct sched_domain *sd, int cpu) | |||
5379 | */ | 5379 | */ |
5380 | 5380 | ||
5381 | for_each_cpu(cpu, sched_group_cpus(sdg)) { | 5381 | for_each_cpu(cpu, sched_group_cpus(sdg)) { |
5382 | struct sched_group *sg = cpu_rq(cpu)->sd->groups; | 5382 | struct sched_group_power *sgp; |
5383 | struct rq *rq = cpu_rq(cpu); | ||
5383 | 5384 | ||
5384 | power_orig += sg->sgp->power_orig; | 5385 | /* |
5385 | power += sg->sgp->power; | 5386 | * build_sched_domains() -> init_sched_groups_power() |
5387 | * gets here before we've attached the domains to the | ||
5388 | * runqueues. | ||
5389 | * | ||
5390 | * Use power_of(), which is set irrespective of domains | ||
5391 | * in update_cpu_power(). | ||
5392 | * | ||
5393 | * This avoids power/power_orig from being 0 and | ||
5394 | * causing divide-by-zero issues on boot. | ||
5395 | * | ||
5396 | * Runtime updates will correct power_orig. | ||
5397 | */ | ||
5398 | if (unlikely(!rq->sd)) { | ||
5399 | power_orig += power_of(cpu); | ||
5400 | power += power_of(cpu); | ||
5401 | continue; | ||
5402 | } | ||
5403 | |||
5404 | sgp = rq->sd->groups->sgp; | ||
5405 | power_orig += sgp->power_orig; | ||
5406 | power += sgp->power; | ||
5386 | } | 5407 | } |
5387 | } else { | 5408 | } else { |
5388 | /* | 5409 | /* |
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 64522ecdfe0e..162b03ab0ad2 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c | |||
@@ -33,6 +33,21 @@ DEFINE_PER_CPU(struct tick_device, tick_cpu_device); | |||
33 | */ | 33 | */ |
34 | ktime_t tick_next_period; | 34 | ktime_t tick_next_period; |
35 | ktime_t tick_period; | 35 | ktime_t tick_period; |
36 | |||
37 | /* | ||
38 | * tick_do_timer_cpu is a timer core internal variable which holds the CPU NR | ||
39 | * which is responsible for calling do_timer(), i.e. the timekeeping stuff. This | ||
40 | * variable has two functions: | ||
41 | * | ||
42 | * 1) Prevent a thundering herd issue of a gazillion of CPUs trying to grab the | ||
43 | * timekeeping lock all at once. Only the CPU which is assigned to do the | ||
44 | * update is handling it. | ||
45 | * | ||
46 | * 2) Hand off the duty in the NOHZ idle case by setting the value to | ||
47 | * TICK_DO_TIMER_NONE, i.e. a non existing CPU. So the next cpu which looks | ||
48 | * at it will take over and keep the time keeping alive. The handover | ||
49 | * procedure also covers cpu hotplug. | ||
50 | */ | ||
36 | int tick_do_timer_cpu __read_mostly = TICK_DO_TIMER_BOOT; | 51 | int tick_do_timer_cpu __read_mostly = TICK_DO_TIMER_BOOT; |
37 | 52 | ||
38 | /* | 53 | /* |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 3612fc77f834..ea20f7d1ac2c 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -361,8 +361,8 @@ void __init tick_nohz_init(void) | |||
361 | /* | 361 | /* |
362 | * NO HZ enabled ? | 362 | * NO HZ enabled ? |
363 | */ | 363 | */ |
364 | int tick_nohz_enabled __read_mostly = 1; | 364 | static int tick_nohz_enabled __read_mostly = 1; |
365 | 365 | int tick_nohz_active __read_mostly; | |
366 | /* | 366 | /* |
367 | * Enable / Disable tickless mode | 367 | * Enable / Disable tickless mode |
368 | */ | 368 | */ |
@@ -465,7 +465,7 @@ u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time) | |||
465 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); | 465 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); |
466 | ktime_t now, idle; | 466 | ktime_t now, idle; |
467 | 467 | ||
468 | if (!tick_nohz_enabled) | 468 | if (!tick_nohz_active) |
469 | return -1; | 469 | return -1; |
470 | 470 | ||
471 | now = ktime_get(); | 471 | now = ktime_get(); |
@@ -506,7 +506,7 @@ u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time) | |||
506 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); | 506 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); |
507 | ktime_t now, iowait; | 507 | ktime_t now, iowait; |
508 | 508 | ||
509 | if (!tick_nohz_enabled) | 509 | if (!tick_nohz_active) |
510 | return -1; | 510 | return -1; |
511 | 511 | ||
512 | now = ktime_get(); | 512 | now = ktime_get(); |
@@ -711,8 +711,10 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) | |||
711 | return false; | 711 | return false; |
712 | } | 712 | } |
713 | 713 | ||
714 | if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE)) | 714 | if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE)) { |
715 | ts->sleep_length = (ktime_t) { .tv64 = NSEC_PER_SEC/HZ }; | ||
715 | return false; | 716 | return false; |
717 | } | ||
716 | 718 | ||
717 | if (need_resched()) | 719 | if (need_resched()) |
718 | return false; | 720 | return false; |
@@ -799,11 +801,6 @@ void tick_nohz_idle_enter(void) | |||
799 | local_irq_disable(); | 801 | local_irq_disable(); |
800 | 802 | ||
801 | ts = &__get_cpu_var(tick_cpu_sched); | 803 | ts = &__get_cpu_var(tick_cpu_sched); |
802 | /* | ||
803 | * set ts->inidle unconditionally. even if the system did not | ||
804 | * switch to nohz mode the cpu frequency governers rely on the | ||
805 | * update of the idle time accounting in tick_nohz_start_idle(). | ||
806 | */ | ||
807 | ts->inidle = 1; | 804 | ts->inidle = 1; |
808 | __tick_nohz_idle_enter(ts); | 805 | __tick_nohz_idle_enter(ts); |
809 | 806 | ||
@@ -973,7 +970,7 @@ static void tick_nohz_switch_to_nohz(void) | |||
973 | struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched); | 970 | struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched); |
974 | ktime_t next; | 971 | ktime_t next; |
975 | 972 | ||
976 | if (!tick_nohz_enabled) | 973 | if (!tick_nohz_active) |
977 | return; | 974 | return; |
978 | 975 | ||
979 | local_irq_disable(); | 976 | local_irq_disable(); |
@@ -981,7 +978,7 @@ static void tick_nohz_switch_to_nohz(void) | |||
981 | local_irq_enable(); | 978 | local_irq_enable(); |
982 | return; | 979 | return; |
983 | } | 980 | } |
984 | 981 | tick_nohz_active = 1; | |
985 | ts->nohz_mode = NOHZ_MODE_LOWRES; | 982 | ts->nohz_mode = NOHZ_MODE_LOWRES; |
986 | 983 | ||
987 | /* | 984 | /* |
@@ -1139,8 +1136,10 @@ void tick_setup_sched_timer(void) | |||
1139 | } | 1136 | } |
1140 | 1137 | ||
1141 | #ifdef CONFIG_NO_HZ_COMMON | 1138 | #ifdef CONFIG_NO_HZ_COMMON |
1142 | if (tick_nohz_enabled) | 1139 | if (tick_nohz_enabled) { |
1143 | ts->nohz_mode = NOHZ_MODE_HIGHRES; | 1140 | ts->nohz_mode = NOHZ_MODE_HIGHRES; |
1141 | tick_nohz_active = 1; | ||
1142 | } | ||
1144 | #endif | 1143 | #endif |
1145 | } | 1144 | } |
1146 | #endif /* HIGH_RES_TIMERS */ | 1145 | #endif /* HIGH_RES_TIMERS */ |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 3abf53418b67..87b4f00284c9 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -1347,7 +1347,7 @@ static inline void old_vsyscall_fixup(struct timekeeper *tk) | |||
1347 | tk->xtime_nsec -= remainder; | 1347 | tk->xtime_nsec -= remainder; |
1348 | tk->xtime_nsec += 1ULL << tk->shift; | 1348 | tk->xtime_nsec += 1ULL << tk->shift; |
1349 | tk->ntp_error += remainder << tk->ntp_error_shift; | 1349 | tk->ntp_error += remainder << tk->ntp_error_shift; |
1350 | 1350 | tk->ntp_error -= (1ULL << tk->shift) << tk->ntp_error_shift; | |
1351 | } | 1351 | } |
1352 | #else | 1352 | #else |
1353 | #define old_vsyscall_fixup(tk) | 1353 | #define old_vsyscall_fixup(tk) |
diff --git a/kernel/timer.c b/kernel/timer.c index 6582b82fa966..accfd241b9e5 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -1518,9 +1518,8 @@ static int init_timers_cpu(int cpu) | |||
1518 | /* | 1518 | /* |
1519 | * The APs use this path later in boot | 1519 | * The APs use this path later in boot |
1520 | */ | 1520 | */ |
1521 | base = kmalloc_node(sizeof(*base), | 1521 | base = kzalloc_node(sizeof(*base), GFP_KERNEL, |
1522 | GFP_KERNEL | __GFP_ZERO, | 1522 | cpu_to_node(cpu)); |
1523 | cpu_to_node(cpu)); | ||
1524 | if (!base) | 1523 | if (!base) |
1525 | return -ENOMEM; | 1524 | return -ENOMEM; |
1526 | 1525 | ||
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 22fa55696760..0e9f9eaade2f 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -367,9 +367,6 @@ static int remove_ftrace_list_ops(struct ftrace_ops **list, | |||
367 | 367 | ||
368 | static int __register_ftrace_function(struct ftrace_ops *ops) | 368 | static int __register_ftrace_function(struct ftrace_ops *ops) |
369 | { | 369 | { |
370 | if (unlikely(ftrace_disabled)) | ||
371 | return -ENODEV; | ||
372 | |||
373 | if (FTRACE_WARN_ON(ops == &global_ops)) | 370 | if (FTRACE_WARN_ON(ops == &global_ops)) |
374 | return -EINVAL; | 371 | return -EINVAL; |
375 | 372 | ||
@@ -428,9 +425,6 @@ static int __unregister_ftrace_function(struct ftrace_ops *ops) | |||
428 | { | 425 | { |
429 | int ret; | 426 | int ret; |
430 | 427 | ||
431 | if (ftrace_disabled) | ||
432 | return -ENODEV; | ||
433 | |||
434 | if (WARN_ON(!(ops->flags & FTRACE_OPS_FL_ENABLED))) | 428 | if (WARN_ON(!(ops->flags & FTRACE_OPS_FL_ENABLED))) |
435 | return -EBUSY; | 429 | return -EBUSY; |
436 | 430 | ||
@@ -2088,10 +2082,15 @@ static void ftrace_startup_enable(int command) | |||
2088 | static int ftrace_startup(struct ftrace_ops *ops, int command) | 2082 | static int ftrace_startup(struct ftrace_ops *ops, int command) |
2089 | { | 2083 | { |
2090 | bool hash_enable = true; | 2084 | bool hash_enable = true; |
2085 | int ret; | ||
2091 | 2086 | ||
2092 | if (unlikely(ftrace_disabled)) | 2087 | if (unlikely(ftrace_disabled)) |
2093 | return -ENODEV; | 2088 | return -ENODEV; |
2094 | 2089 | ||
2090 | ret = __register_ftrace_function(ops); | ||
2091 | if (ret) | ||
2092 | return ret; | ||
2093 | |||
2095 | ftrace_start_up++; | 2094 | ftrace_start_up++; |
2096 | command |= FTRACE_UPDATE_CALLS; | 2095 | command |= FTRACE_UPDATE_CALLS; |
2097 | 2096 | ||
@@ -2113,12 +2112,17 @@ static int ftrace_startup(struct ftrace_ops *ops, int command) | |||
2113 | return 0; | 2112 | return 0; |
2114 | } | 2113 | } |
2115 | 2114 | ||
2116 | static void ftrace_shutdown(struct ftrace_ops *ops, int command) | 2115 | static int ftrace_shutdown(struct ftrace_ops *ops, int command) |
2117 | { | 2116 | { |
2118 | bool hash_disable = true; | 2117 | bool hash_disable = true; |
2118 | int ret; | ||
2119 | 2119 | ||
2120 | if (unlikely(ftrace_disabled)) | 2120 | if (unlikely(ftrace_disabled)) |
2121 | return; | 2121 | return -ENODEV; |
2122 | |||
2123 | ret = __unregister_ftrace_function(ops); | ||
2124 | if (ret) | ||
2125 | return ret; | ||
2122 | 2126 | ||
2123 | ftrace_start_up--; | 2127 | ftrace_start_up--; |
2124 | /* | 2128 | /* |
@@ -2153,9 +2157,10 @@ static void ftrace_shutdown(struct ftrace_ops *ops, int command) | |||
2153 | } | 2157 | } |
2154 | 2158 | ||
2155 | if (!command || !ftrace_enabled) | 2159 | if (!command || !ftrace_enabled) |
2156 | return; | 2160 | return 0; |
2157 | 2161 | ||
2158 | ftrace_run_update_code(command); | 2162 | ftrace_run_update_code(command); |
2163 | return 0; | ||
2159 | } | 2164 | } |
2160 | 2165 | ||
2161 | static void ftrace_startup_sysctl(void) | 2166 | static void ftrace_startup_sysctl(void) |
@@ -3060,16 +3065,13 @@ static void __enable_ftrace_function_probe(void) | |||
3060 | if (i == FTRACE_FUNC_HASHSIZE) | 3065 | if (i == FTRACE_FUNC_HASHSIZE) |
3061 | return; | 3066 | return; |
3062 | 3067 | ||
3063 | ret = __register_ftrace_function(&trace_probe_ops); | 3068 | ret = ftrace_startup(&trace_probe_ops, 0); |
3064 | if (!ret) | ||
3065 | ret = ftrace_startup(&trace_probe_ops, 0); | ||
3066 | 3069 | ||
3067 | ftrace_probe_registered = 1; | 3070 | ftrace_probe_registered = 1; |
3068 | } | 3071 | } |
3069 | 3072 | ||
3070 | static void __disable_ftrace_function_probe(void) | 3073 | static void __disable_ftrace_function_probe(void) |
3071 | { | 3074 | { |
3072 | int ret; | ||
3073 | int i; | 3075 | int i; |
3074 | 3076 | ||
3075 | if (!ftrace_probe_registered) | 3077 | if (!ftrace_probe_registered) |
@@ -3082,9 +3084,7 @@ static void __disable_ftrace_function_probe(void) | |||
3082 | } | 3084 | } |
3083 | 3085 | ||
3084 | /* no more funcs left */ | 3086 | /* no more funcs left */ |
3085 | ret = __unregister_ftrace_function(&trace_probe_ops); | 3087 | ftrace_shutdown(&trace_probe_ops, 0); |
3086 | if (!ret) | ||
3087 | ftrace_shutdown(&trace_probe_ops, 0); | ||
3088 | 3088 | ||
3089 | ftrace_probe_registered = 0; | 3089 | ftrace_probe_registered = 0; |
3090 | } | 3090 | } |
@@ -4366,12 +4366,15 @@ core_initcall(ftrace_nodyn_init); | |||
4366 | static inline int ftrace_init_dyn_debugfs(struct dentry *d_tracer) { return 0; } | 4366 | static inline int ftrace_init_dyn_debugfs(struct dentry *d_tracer) { return 0; } |
4367 | static inline void ftrace_startup_enable(int command) { } | 4367 | static inline void ftrace_startup_enable(int command) { } |
4368 | /* Keep as macros so we do not need to define the commands */ | 4368 | /* Keep as macros so we do not need to define the commands */ |
4369 | # define ftrace_startup(ops, command) \ | 4369 | # define ftrace_startup(ops, command) \ |
4370 | ({ \ | 4370 | ({ \ |
4371 | (ops)->flags |= FTRACE_OPS_FL_ENABLED; \ | 4371 | int ___ret = __register_ftrace_function(ops); \ |
4372 | 0; \ | 4372 | if (!___ret) \ |
4373 | (ops)->flags |= FTRACE_OPS_FL_ENABLED; \ | ||
4374 | ___ret; \ | ||
4373 | }) | 4375 | }) |
4374 | # define ftrace_shutdown(ops, command) do { } while (0) | 4376 | # define ftrace_shutdown(ops, command) __unregister_ftrace_function(ops) |
4377 | |||
4375 | # define ftrace_startup_sysctl() do { } while (0) | 4378 | # define ftrace_startup_sysctl() do { } while (0) |
4376 | # define ftrace_shutdown_sysctl() do { } while (0) | 4379 | # define ftrace_shutdown_sysctl() do { } while (0) |
4377 | 4380 | ||
@@ -4780,9 +4783,7 @@ int register_ftrace_function(struct ftrace_ops *ops) | |||
4780 | 4783 | ||
4781 | mutex_lock(&ftrace_lock); | 4784 | mutex_lock(&ftrace_lock); |
4782 | 4785 | ||
4783 | ret = __register_ftrace_function(ops); | 4786 | ret = ftrace_startup(ops, 0); |
4784 | if (!ret) | ||
4785 | ret = ftrace_startup(ops, 0); | ||
4786 | 4787 | ||
4787 | mutex_unlock(&ftrace_lock); | 4788 | mutex_unlock(&ftrace_lock); |
4788 | 4789 | ||
@@ -4801,9 +4802,7 @@ int unregister_ftrace_function(struct ftrace_ops *ops) | |||
4801 | int ret; | 4802 | int ret; |
4802 | 4803 | ||
4803 | mutex_lock(&ftrace_lock); | 4804 | mutex_lock(&ftrace_lock); |
4804 | ret = __unregister_ftrace_function(ops); | 4805 | ret = ftrace_shutdown(ops, 0); |
4805 | if (!ret) | ||
4806 | ftrace_shutdown(ops, 0); | ||
4807 | mutex_unlock(&ftrace_lock); | 4806 | mutex_unlock(&ftrace_lock); |
4808 | 4807 | ||
4809 | return ret; | 4808 | return ret; |
@@ -4997,6 +4996,13 @@ ftrace_suspend_notifier_call(struct notifier_block *bl, unsigned long state, | |||
4997 | return NOTIFY_DONE; | 4996 | return NOTIFY_DONE; |
4998 | } | 4997 | } |
4999 | 4998 | ||
4999 | /* Just a place holder for function graph */ | ||
5000 | static struct ftrace_ops fgraph_ops __read_mostly = { | ||
5001 | .func = ftrace_stub, | ||
5002 | .flags = FTRACE_OPS_FL_STUB | FTRACE_OPS_FL_GLOBAL | | ||
5003 | FTRACE_OPS_FL_RECURSION_SAFE, | ||
5004 | }; | ||
5005 | |||
5000 | int register_ftrace_graph(trace_func_graph_ret_t retfunc, | 5006 | int register_ftrace_graph(trace_func_graph_ret_t retfunc, |
5001 | trace_func_graph_ent_t entryfunc) | 5007 | trace_func_graph_ent_t entryfunc) |
5002 | { | 5008 | { |
@@ -5023,7 +5029,7 @@ int register_ftrace_graph(trace_func_graph_ret_t retfunc, | |||
5023 | ftrace_graph_return = retfunc; | 5029 | ftrace_graph_return = retfunc; |
5024 | ftrace_graph_entry = entryfunc; | 5030 | ftrace_graph_entry = entryfunc; |
5025 | 5031 | ||
5026 | ret = ftrace_startup(&global_ops, FTRACE_START_FUNC_RET); | 5032 | ret = ftrace_startup(&fgraph_ops, FTRACE_START_FUNC_RET); |
5027 | 5033 | ||
5028 | out: | 5034 | out: |
5029 | mutex_unlock(&ftrace_lock); | 5035 | mutex_unlock(&ftrace_lock); |
@@ -5040,7 +5046,7 @@ void unregister_ftrace_graph(void) | |||
5040 | ftrace_graph_active--; | 5046 | ftrace_graph_active--; |
5041 | ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub; | 5047 | ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub; |
5042 | ftrace_graph_entry = ftrace_graph_entry_stub; | 5048 | ftrace_graph_entry = ftrace_graph_entry_stub; |
5043 | ftrace_shutdown(&global_ops, FTRACE_STOP_FUNC_RET); | 5049 | ftrace_shutdown(&fgraph_ops, FTRACE_STOP_FUNC_RET); |
5044 | unregister_pm_notifier(&ftrace_suspend_notifier); | 5050 | unregister_pm_notifier(&ftrace_suspend_notifier); |
5045 | unregister_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL); | 5051 | unregister_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL); |
5046 | 5052 | ||
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c index 78e27e3b52ac..e854f420e033 100644 --- a/kernel/trace/trace_event_perf.c +++ b/kernel/trace/trace_event_perf.c | |||
@@ -24,6 +24,12 @@ static int total_ref_count; | |||
24 | static int perf_trace_event_perm(struct ftrace_event_call *tp_event, | 24 | static int perf_trace_event_perm(struct ftrace_event_call *tp_event, |
25 | struct perf_event *p_event) | 25 | struct perf_event *p_event) |
26 | { | 26 | { |
27 | if (tp_event->perf_perm) { | ||
28 | int ret = tp_event->perf_perm(tp_event, p_event); | ||
29 | if (ret) | ||
30 | return ret; | ||
31 | } | ||
32 | |||
27 | /* The ftrace function trace is allowed only for root. */ | 33 | /* The ftrace function trace is allowed only for root. */ |
28 | if (ftrace_event_is_function(tp_event) && | 34 | if (ftrace_event_is_function(tp_event) && |
29 | perf_paranoid_tracepoint_raw() && !capable(CAP_SYS_ADMIN)) | 35 | perf_paranoid_tracepoint_raw() && !capable(CAP_SYS_ADMIN)) |
@@ -173,7 +179,7 @@ static int perf_trace_event_init(struct ftrace_event_call *tp_event, | |||
173 | int perf_trace_init(struct perf_event *p_event) | 179 | int perf_trace_init(struct perf_event *p_event) |
174 | { | 180 | { |
175 | struct ftrace_event_call *tp_event; | 181 | struct ftrace_event_call *tp_event; |
176 | int event_id = p_event->attr.config; | 182 | u64 event_id = p_event->attr.config; |
177 | int ret = -EINVAL; | 183 | int ret = -EINVAL; |
178 | 184 | ||
179 | mutex_lock(&event_mutex); | 185 | mutex_lock(&event_mutex); |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index f919a2e21bf3..a11800ae96de 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -2314,6 +2314,9 @@ int event_trace_del_tracer(struct trace_array *tr) | |||
2314 | /* Disable any running events */ | 2314 | /* Disable any running events */ |
2315 | __ftrace_set_clr_event_nolock(tr, NULL, NULL, NULL, 0); | 2315 | __ftrace_set_clr_event_nolock(tr, NULL, NULL, NULL, 0); |
2316 | 2316 | ||
2317 | /* Access to events are within rcu_read_lock_sched() */ | ||
2318 | synchronize_sched(); | ||
2319 | |||
2317 | down_write(&trace_event_sem); | 2320 | down_write(&trace_event_sem); |
2318 | __trace_remove_event_dirs(tr); | 2321 | __trace_remove_event_dirs(tr); |
2319 | debugfs_remove_recursive(tr->event_dir); | 2322 | debugfs_remove_recursive(tr->event_dir); |
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index e4b6d11bdf78..ea90eb5f6f17 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -431,11 +431,6 @@ static void unreg_event_syscall_enter(struct ftrace_event_file *file, | |||
431 | if (!tr->sys_refcount_enter) | 431 | if (!tr->sys_refcount_enter) |
432 | unregister_trace_sys_enter(ftrace_syscall_enter, tr); | 432 | unregister_trace_sys_enter(ftrace_syscall_enter, tr); |
433 | mutex_unlock(&syscall_trace_lock); | 433 | mutex_unlock(&syscall_trace_lock); |
434 | /* | ||
435 | * Callers expect the event to be completely disabled on | ||
436 | * return, so wait for current handlers to finish. | ||
437 | */ | ||
438 | synchronize_sched(); | ||
439 | } | 434 | } |
440 | 435 | ||
441 | static int reg_event_syscall_exit(struct ftrace_event_file *file, | 436 | static int reg_event_syscall_exit(struct ftrace_event_file *file, |
@@ -474,11 +469,6 @@ static void unreg_event_syscall_exit(struct ftrace_event_file *file, | |||
474 | if (!tr->sys_refcount_exit) | 469 | if (!tr->sys_refcount_exit) |
475 | unregister_trace_sys_exit(ftrace_syscall_exit, tr); | 470 | unregister_trace_sys_exit(ftrace_syscall_exit, tr); |
476 | mutex_unlock(&syscall_trace_lock); | 471 | mutex_unlock(&syscall_trace_lock); |
477 | /* | ||
478 | * Callers expect the event to be completely disabled on | ||
479 | * return, so wait for current handlers to finish. | ||
480 | */ | ||
481 | synchronize_sched(); | ||
482 | } | 472 | } |
483 | 473 | ||
484 | static int __init init_syscall_trace(struct ftrace_event_call *call) | 474 | static int __init init_syscall_trace(struct ftrace_event_call *call) |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 987293d03ebc..c66912be990f 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -305,6 +305,9 @@ static DEFINE_HASHTABLE(unbound_pool_hash, UNBOUND_POOL_HASH_ORDER); | |||
305 | /* I: attributes used when instantiating standard unbound pools on demand */ | 305 | /* I: attributes used when instantiating standard unbound pools on demand */ |
306 | static struct workqueue_attrs *unbound_std_wq_attrs[NR_STD_WORKER_POOLS]; | 306 | static struct workqueue_attrs *unbound_std_wq_attrs[NR_STD_WORKER_POOLS]; |
307 | 307 | ||
308 | /* I: attributes used when instantiating ordered pools on demand */ | ||
309 | static struct workqueue_attrs *ordered_wq_attrs[NR_STD_WORKER_POOLS]; | ||
310 | |||
308 | struct workqueue_struct *system_wq __read_mostly; | 311 | struct workqueue_struct *system_wq __read_mostly; |
309 | EXPORT_SYMBOL(system_wq); | 312 | EXPORT_SYMBOL(system_wq); |
310 | struct workqueue_struct *system_highpri_wq __read_mostly; | 313 | struct workqueue_struct *system_highpri_wq __read_mostly; |
@@ -518,14 +521,21 @@ static inline void debug_work_activate(struct work_struct *work) { } | |||
518 | static inline void debug_work_deactivate(struct work_struct *work) { } | 521 | static inline void debug_work_deactivate(struct work_struct *work) { } |
519 | #endif | 522 | #endif |
520 | 523 | ||
521 | /* allocate ID and assign it to @pool */ | 524 | /** |
525 | * worker_pool_assign_id - allocate ID and assing it to @pool | ||
526 | * @pool: the pool pointer of interest | ||
527 | * | ||
528 | * Returns 0 if ID in [0, WORK_OFFQ_POOL_NONE) is allocated and assigned | ||
529 | * successfully, -errno on failure. | ||
530 | */ | ||
522 | static int worker_pool_assign_id(struct worker_pool *pool) | 531 | static int worker_pool_assign_id(struct worker_pool *pool) |
523 | { | 532 | { |
524 | int ret; | 533 | int ret; |
525 | 534 | ||
526 | lockdep_assert_held(&wq_pool_mutex); | 535 | lockdep_assert_held(&wq_pool_mutex); |
527 | 536 | ||
528 | ret = idr_alloc(&worker_pool_idr, pool, 0, 0, GFP_KERNEL); | 537 | ret = idr_alloc(&worker_pool_idr, pool, 0, WORK_OFFQ_POOL_NONE, |
538 | GFP_KERNEL); | ||
529 | if (ret >= 0) { | 539 | if (ret >= 0) { |
530 | pool->id = ret; | 540 | pool->id = ret; |
531 | return 0; | 541 | return 0; |
@@ -1320,7 +1330,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, | |||
1320 | 1330 | ||
1321 | debug_work_activate(work); | 1331 | debug_work_activate(work); |
1322 | 1332 | ||
1323 | /* if dying, only works from the same workqueue are allowed */ | 1333 | /* if draining, only works from the same workqueue are allowed */ |
1324 | if (unlikely(wq->flags & __WQ_DRAINING) && | 1334 | if (unlikely(wq->flags & __WQ_DRAINING) && |
1325 | WARN_ON_ONCE(!is_chained_work(wq))) | 1335 | WARN_ON_ONCE(!is_chained_work(wq))) |
1326 | return; | 1336 | return; |
@@ -1736,16 +1746,17 @@ static struct worker *create_worker(struct worker_pool *pool) | |||
1736 | if (IS_ERR(worker->task)) | 1746 | if (IS_ERR(worker->task)) |
1737 | goto fail; | 1747 | goto fail; |
1738 | 1748 | ||
1749 | set_user_nice(worker->task, pool->attrs->nice); | ||
1750 | |||
1751 | /* prevent userland from meddling with cpumask of workqueue workers */ | ||
1752 | worker->task->flags |= PF_NO_SETAFFINITY; | ||
1753 | |||
1739 | /* | 1754 | /* |
1740 | * set_cpus_allowed_ptr() will fail if the cpumask doesn't have any | 1755 | * set_cpus_allowed_ptr() will fail if the cpumask doesn't have any |
1741 | * online CPUs. It'll be re-applied when any of the CPUs come up. | 1756 | * online CPUs. It'll be re-applied when any of the CPUs come up. |
1742 | */ | 1757 | */ |
1743 | set_user_nice(worker->task, pool->attrs->nice); | ||
1744 | set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask); | 1758 | set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask); |
1745 | 1759 | ||
1746 | /* prevent userland from meddling with cpumask of workqueue workers */ | ||
1747 | worker->task->flags |= PF_NO_SETAFFINITY; | ||
1748 | |||
1749 | /* | 1760 | /* |
1750 | * The caller is responsible for ensuring %POOL_DISASSOCIATED | 1761 | * The caller is responsible for ensuring %POOL_DISASSOCIATED |
1751 | * remains stable across this function. See the comments above the | 1762 | * remains stable across this function. See the comments above the |
@@ -4106,7 +4117,7 @@ out_unlock: | |||
4106 | static int alloc_and_link_pwqs(struct workqueue_struct *wq) | 4117 | static int alloc_and_link_pwqs(struct workqueue_struct *wq) |
4107 | { | 4118 | { |
4108 | bool highpri = wq->flags & WQ_HIGHPRI; | 4119 | bool highpri = wq->flags & WQ_HIGHPRI; |
4109 | int cpu; | 4120 | int cpu, ret; |
4110 | 4121 | ||
4111 | if (!(wq->flags & WQ_UNBOUND)) { | 4122 | if (!(wq->flags & WQ_UNBOUND)) { |
4112 | wq->cpu_pwqs = alloc_percpu(struct pool_workqueue); | 4123 | wq->cpu_pwqs = alloc_percpu(struct pool_workqueue); |
@@ -4126,6 +4137,13 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq) | |||
4126 | mutex_unlock(&wq->mutex); | 4137 | mutex_unlock(&wq->mutex); |
4127 | } | 4138 | } |
4128 | return 0; | 4139 | return 0; |
4140 | } else if (wq->flags & __WQ_ORDERED) { | ||
4141 | ret = apply_workqueue_attrs(wq, ordered_wq_attrs[highpri]); | ||
4142 | /* there should only be single pwq for ordering guarantee */ | ||
4143 | WARN(!ret && (wq->pwqs.next != &wq->dfl_pwq->pwqs_node || | ||
4144 | wq->pwqs.prev != &wq->dfl_pwq->pwqs_node), | ||
4145 | "ordering guarantee broken for workqueue %s\n", wq->name); | ||
4146 | return ret; | ||
4129 | } else { | 4147 | } else { |
4130 | return apply_workqueue_attrs(wq, unbound_std_wq_attrs[highpri]); | 4148 | return apply_workqueue_attrs(wq, unbound_std_wq_attrs[highpri]); |
4131 | } | 4149 | } |
@@ -5009,10 +5027,6 @@ static int __init init_workqueues(void) | |||
5009 | int std_nice[NR_STD_WORKER_POOLS] = { 0, HIGHPRI_NICE_LEVEL }; | 5027 | int std_nice[NR_STD_WORKER_POOLS] = { 0, HIGHPRI_NICE_LEVEL }; |
5010 | int i, cpu; | 5028 | int i, cpu; |
5011 | 5029 | ||
5012 | /* make sure we have enough bits for OFFQ pool ID */ | ||
5013 | BUILD_BUG_ON((1LU << (BITS_PER_LONG - WORK_OFFQ_POOL_SHIFT)) < | ||
5014 | WORK_CPU_END * NR_STD_WORKER_POOLS); | ||
5015 | |||
5016 | WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long)); | 5030 | WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long)); |
5017 | 5031 | ||
5018 | pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC); | 5032 | pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC); |
@@ -5051,13 +5065,23 @@ static int __init init_workqueues(void) | |||
5051 | } | 5065 | } |
5052 | } | 5066 | } |
5053 | 5067 | ||
5054 | /* create default unbound wq attrs */ | 5068 | /* create default unbound and ordered wq attrs */ |
5055 | for (i = 0; i < NR_STD_WORKER_POOLS; i++) { | 5069 | for (i = 0; i < NR_STD_WORKER_POOLS; i++) { |
5056 | struct workqueue_attrs *attrs; | 5070 | struct workqueue_attrs *attrs; |
5057 | 5071 | ||
5058 | BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL))); | 5072 | BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL))); |
5059 | attrs->nice = std_nice[i]; | 5073 | attrs->nice = std_nice[i]; |
5060 | unbound_std_wq_attrs[i] = attrs; | 5074 | unbound_std_wq_attrs[i] = attrs; |
5075 | |||
5076 | /* | ||
5077 | * An ordered wq should have only one pwq as ordering is | ||
5078 | * guaranteed by max_active which is enforced by pwqs. | ||
5079 | * Turn off NUMA so that dfl_pwq is used for all nodes. | ||
5080 | */ | ||
5081 | BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL))); | ||
5082 | attrs->nice = std_nice[i]; | ||
5083 | attrs->no_numa = true; | ||
5084 | ordered_wq_attrs[i] = attrs; | ||
5061 | } | 5085 | } |
5062 | 5086 | ||
5063 | system_wq = alloc_workqueue("events", 0, 0); | 5087 | system_wq = alloc_workqueue("events", 0, 0); |
diff --git a/lib/lockref.c b/lib/lockref.c index d2b123f8456b..f07a40d33871 100644 --- a/lib/lockref.c +++ b/lib/lockref.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/export.h> | 1 | #include <linux/export.h> |
2 | #include <linux/lockref.h> | 2 | #include <linux/lockref.h> |
3 | #include <linux/mutex.h> | ||
3 | 4 | ||
4 | #if USE_CMPXCHG_LOCKREF | 5 | #if USE_CMPXCHG_LOCKREF |
5 | 6 | ||
@@ -12,14 +13,6 @@ | |||
12 | #endif | 13 | #endif |
13 | 14 | ||
14 | /* | 15 | /* |
15 | * Allow architectures to override the default cpu_relax() within CMPXCHG_LOOP. | ||
16 | * This is useful for architectures with an expensive cpu_relax(). | ||
17 | */ | ||
18 | #ifndef arch_mutex_cpu_relax | ||
19 | # define arch_mutex_cpu_relax() cpu_relax() | ||
20 | #endif | ||
21 | |||
22 | /* | ||
23 | * Note that the "cmpxchg()" reloads the "old" value for the | 16 | * Note that the "cmpxchg()" reloads the "old" value for the |
24 | * failure case. | 17 | * failure case. |
25 | */ | 18 | */ |
diff --git a/net/compat.c b/net/compat.c index 618c6a8a911b..dd32e34c1e2c 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -72,7 +72,7 @@ int get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr __user *umsg) | |||
72 | __get_user(kmsg->msg_flags, &umsg->msg_flags)) | 72 | __get_user(kmsg->msg_flags, &umsg->msg_flags)) |
73 | return -EFAULT; | 73 | return -EFAULT; |
74 | if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) | 74 | if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) |
75 | return -EINVAL; | 75 | kmsg->msg_namelen = sizeof(struct sockaddr_storage); |
76 | kmsg->msg_name = compat_ptr(tmp1); | 76 | kmsg->msg_name = compat_ptr(tmp1); |
77 | kmsg->msg_iov = compat_ptr(tmp2); | 77 | kmsg->msg_iov = compat_ptr(tmp2); |
78 | kmsg->msg_control = compat_ptr(tmp3); | 78 | kmsg->msg_control = compat_ptr(tmp3); |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 261357a66300..a797fff7f222 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -2527,6 +2527,8 @@ static int process_ipsec(struct pktgen_dev *pkt_dev, | |||
2527 | if (x) { | 2527 | if (x) { |
2528 | int ret; | 2528 | int ret; |
2529 | __u8 *eth; | 2529 | __u8 *eth; |
2530 | struct iphdr *iph; | ||
2531 | |||
2530 | nhead = x->props.header_len - skb_headroom(skb); | 2532 | nhead = x->props.header_len - skb_headroom(skb); |
2531 | if (nhead > 0) { | 2533 | if (nhead > 0) { |
2532 | ret = pskb_expand_head(skb, nhead, 0, GFP_ATOMIC); | 2534 | ret = pskb_expand_head(skb, nhead, 0, GFP_ATOMIC); |
@@ -2548,6 +2550,11 @@ static int process_ipsec(struct pktgen_dev *pkt_dev, | |||
2548 | eth = (__u8 *) skb_push(skb, ETH_HLEN); | 2550 | eth = (__u8 *) skb_push(skb, ETH_HLEN); |
2549 | memcpy(eth, pkt_dev->hh, 12); | 2551 | memcpy(eth, pkt_dev->hh, 12); |
2550 | *(u16 *) ð[12] = protocol; | 2552 | *(u16 *) ð[12] = protocol; |
2553 | |||
2554 | /* Update IPv4 header len as well as checksum value */ | ||
2555 | iph = ip_hdr(skb); | ||
2556 | iph->tot_len = htons(skb->len - ETH_HLEN); | ||
2557 | ip_send_check(iph); | ||
2551 | } | 2558 | } |
2552 | } | 2559 | } |
2553 | return 1; | 2560 | return 1; |
diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 003f5bb3acd2..4bdab1521878 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c | |||
@@ -288,7 +288,8 @@ void hsr_addr_subst_dest(struct hsr_priv *hsr_priv, struct ethhdr *ethhdr, | |||
288 | static bool seq_nr_after(u16 a, u16 b) | 288 | static bool seq_nr_after(u16 a, u16 b) |
289 | { | 289 | { |
290 | /* Remove inconsistency where | 290 | /* Remove inconsistency where |
291 | * seq_nr_after(a, b) == seq_nr_before(a, b) */ | 291 | * seq_nr_after(a, b) == seq_nr_before(a, b) |
292 | */ | ||
292 | if ((int) b - a == 32768) | 293 | if ((int) b - a == 32768) |
293 | return false; | 294 | return false; |
294 | 295 | ||
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c index 5325af85eea6..01a5261ac7a5 100644 --- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c | |||
@@ -23,6 +23,8 @@ static const struct nla_policy hsr_policy[IFLA_HSR_MAX + 1] = { | |||
23 | [IFLA_HSR_SLAVE1] = { .type = NLA_U32 }, | 23 | [IFLA_HSR_SLAVE1] = { .type = NLA_U32 }, |
24 | [IFLA_HSR_SLAVE2] = { .type = NLA_U32 }, | 24 | [IFLA_HSR_SLAVE2] = { .type = NLA_U32 }, |
25 | [IFLA_HSR_MULTICAST_SPEC] = { .type = NLA_U8 }, | 25 | [IFLA_HSR_MULTICAST_SPEC] = { .type = NLA_U8 }, |
26 | [IFLA_HSR_SUPERVISION_ADDR] = { .type = NLA_BINARY, .len = ETH_ALEN }, | ||
27 | [IFLA_HSR_SEQ_NR] = { .type = NLA_U16 }, | ||
26 | }; | 28 | }; |
27 | 29 | ||
28 | 30 | ||
@@ -59,6 +61,31 @@ static int hsr_newlink(struct net *src_net, struct net_device *dev, | |||
59 | return hsr_dev_finalize(dev, link, multicast_spec); | 61 | return hsr_dev_finalize(dev, link, multicast_spec); |
60 | } | 62 | } |
61 | 63 | ||
64 | static int hsr_fill_info(struct sk_buff *skb, const struct net_device *dev) | ||
65 | { | ||
66 | struct hsr_priv *hsr_priv; | ||
67 | |||
68 | hsr_priv = netdev_priv(dev); | ||
69 | |||
70 | if (hsr_priv->slave[0]) | ||
71 | if (nla_put_u32(skb, IFLA_HSR_SLAVE1, hsr_priv->slave[0]->ifindex)) | ||
72 | goto nla_put_failure; | ||
73 | |||
74 | if (hsr_priv->slave[1]) | ||
75 | if (nla_put_u32(skb, IFLA_HSR_SLAVE2, hsr_priv->slave[1]->ifindex)) | ||
76 | goto nla_put_failure; | ||
77 | |||
78 | if (nla_put(skb, IFLA_HSR_SUPERVISION_ADDR, ETH_ALEN, | ||
79 | hsr_priv->sup_multicast_addr) || | ||
80 | nla_put_u16(skb, IFLA_HSR_SEQ_NR, hsr_priv->sequence_nr)) | ||
81 | goto nla_put_failure; | ||
82 | |||
83 | return 0; | ||
84 | |||
85 | nla_put_failure: | ||
86 | return -EMSGSIZE; | ||
87 | } | ||
88 | |||
62 | static struct rtnl_link_ops hsr_link_ops __read_mostly = { | 89 | static struct rtnl_link_ops hsr_link_ops __read_mostly = { |
63 | .kind = "hsr", | 90 | .kind = "hsr", |
64 | .maxtype = IFLA_HSR_MAX, | 91 | .maxtype = IFLA_HSR_MAX, |
@@ -66,6 +93,7 @@ static struct rtnl_link_ops hsr_link_ops __read_mostly = { | |||
66 | .priv_size = sizeof(struct hsr_priv), | 93 | .priv_size = sizeof(struct hsr_priv), |
67 | .setup = hsr_dev_setup, | 94 | .setup = hsr_dev_setup, |
68 | .newlink = hsr_newlink, | 95 | .newlink = hsr_newlink, |
96 | .fill_info = hsr_fill_info, | ||
69 | }; | 97 | }; |
70 | 98 | ||
71 | 99 | ||
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 3f858266fa7e..ddf32a6bc415 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -386,7 +386,7 @@ void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 port, u32 inf | |||
386 | /* | 386 | /* |
387 | * Handle MSG_ERRQUEUE | 387 | * Handle MSG_ERRQUEUE |
388 | */ | 388 | */ |
389 | int ip_recv_error(struct sock *sk, struct msghdr *msg, int len) | 389 | int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) |
390 | { | 390 | { |
391 | struct sock_exterr_skb *serr; | 391 | struct sock_exterr_skb *serr; |
392 | struct sk_buff *skb, *skb2; | 392 | struct sk_buff *skb, *skb2; |
@@ -423,6 +423,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len) | |||
423 | serr->addr_offset); | 423 | serr->addr_offset); |
424 | sin->sin_port = serr->port; | 424 | sin->sin_port = serr->port; |
425 | memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); | 425 | memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); |
426 | *addr_len = sizeof(*sin); | ||
426 | } | 427 | } |
427 | 428 | ||
428 | memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); | 429 | memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); |
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 876c6ca2d8f9..242e7f4ed6f4 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c | |||
@@ -772,7 +772,7 @@ int ping_v4_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
772 | err = PTR_ERR(rt); | 772 | err = PTR_ERR(rt); |
773 | rt = NULL; | 773 | rt = NULL; |
774 | if (err == -ENETUNREACH) | 774 | if (err == -ENETUNREACH) |
775 | IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES); | 775 | IP_INC_STATS(net, IPSTATS_MIB_OUTNOROUTES); |
776 | goto out; | 776 | goto out; |
777 | } | 777 | } |
778 | 778 | ||
@@ -841,10 +841,11 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
841 | 841 | ||
842 | if (flags & MSG_ERRQUEUE) { | 842 | if (flags & MSG_ERRQUEUE) { |
843 | if (family == AF_INET) { | 843 | if (family == AF_INET) { |
844 | return ip_recv_error(sk, msg, len); | 844 | return ip_recv_error(sk, msg, len, addr_len); |
845 | #if IS_ENABLED(CONFIG_IPV6) | 845 | #if IS_ENABLED(CONFIG_IPV6) |
846 | } else if (family == AF_INET6) { | 846 | } else if (family == AF_INET6) { |
847 | return pingv6_ops.ipv6_recv_error(sk, msg, len); | 847 | return pingv6_ops.ipv6_recv_error(sk, msg, len, |
848 | addr_len); | ||
848 | #endif | 849 | #endif |
849 | } | 850 | } |
850 | } | 851 | } |
diff --git a/net/ipv4/protocol.c b/net/ipv4/protocol.c index ce848461acbb..46d6a1c923a8 100644 --- a/net/ipv4/protocol.c +++ b/net/ipv4/protocol.c | |||
@@ -31,10 +31,6 @@ | |||
31 | const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS] __read_mostly; | 31 | const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS] __read_mostly; |
32 | const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS] __read_mostly; | 32 | const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS] __read_mostly; |
33 | 33 | ||
34 | /* | ||
35 | * Add a protocol handler to the hash tables | ||
36 | */ | ||
37 | |||
38 | int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol) | 34 | int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol) |
39 | { | 35 | { |
40 | if (!prot->netns_ok) { | 36 | if (!prot->netns_ok) { |
@@ -55,10 +51,6 @@ int inet_add_offload(const struct net_offload *prot, unsigned char protocol) | |||
55 | } | 51 | } |
56 | EXPORT_SYMBOL(inet_add_offload); | 52 | EXPORT_SYMBOL(inet_add_offload); |
57 | 53 | ||
58 | /* | ||
59 | * Remove a protocol from the hash tables. | ||
60 | */ | ||
61 | |||
62 | int inet_del_protocol(const struct net_protocol *prot, unsigned char protocol) | 54 | int inet_del_protocol(const struct net_protocol *prot, unsigned char protocol) |
63 | { | 55 | { |
64 | int ret; | 56 | int ret; |
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 5cb8ddb505ee..23c3e5b5bb53 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -697,7 +697,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
697 | goto out; | 697 | goto out; |
698 | 698 | ||
699 | if (flags & MSG_ERRQUEUE) { | 699 | if (flags & MSG_ERRQUEUE) { |
700 | err = ip_recv_error(sk, msg, len); | 700 | err = ip_recv_error(sk, msg, len, addr_len); |
701 | goto out; | 701 | goto out; |
702 | } | 702 | } |
703 | 703 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 59a6f8b90cd9..067213924751 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -177,7 +177,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
177 | if (IS_ERR(rt)) { | 177 | if (IS_ERR(rt)) { |
178 | err = PTR_ERR(rt); | 178 | err = PTR_ERR(rt); |
179 | if (err == -ENETUNREACH) | 179 | if (err == -ENETUNREACH) |
180 | IP_INC_STATS_BH(sock_net(sk), IPSTATS_MIB_OUTNOROUTES); | 180 | IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTNOROUTES); |
181 | return err; | 181 | return err; |
182 | } | 182 | } |
183 | 183 | ||
diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c index 03e9154f7e68..269a89ecd2f4 100644 --- a/net/ipv4/tcp_memcontrol.c +++ b/net/ipv4/tcp_memcontrol.c | |||
@@ -60,7 +60,6 @@ EXPORT_SYMBOL(tcp_destroy_cgroup); | |||
60 | static int tcp_update_limit(struct mem_cgroup *memcg, u64 val) | 60 | static int tcp_update_limit(struct mem_cgroup *memcg, u64 val) |
61 | { | 61 | { |
62 | struct cg_proto *cg_proto; | 62 | struct cg_proto *cg_proto; |
63 | u64 old_lim; | ||
64 | int i; | 63 | int i; |
65 | int ret; | 64 | int ret; |
66 | 65 | ||
@@ -71,7 +70,6 @@ static int tcp_update_limit(struct mem_cgroup *memcg, u64 val) | |||
71 | if (val > RES_COUNTER_MAX) | 70 | if (val > RES_COUNTER_MAX) |
72 | val = RES_COUNTER_MAX; | 71 | val = RES_COUNTER_MAX; |
73 | 72 | ||
74 | old_lim = res_counter_read_u64(&cg_proto->memory_allocated, RES_LIMIT); | ||
75 | ret = res_counter_set_limit(&cg_proto->memory_allocated, val); | 73 | ret = res_counter_set_limit(&cg_proto->memory_allocated, val); |
76 | if (ret) | 74 | if (ret) |
77 | return ret; | 75 | return ret; |
diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c index a2b68a108eae..05606353c7e7 100644 --- a/net/ipv4/tcp_offload.c +++ b/net/ipv4/tcp_offload.c | |||
@@ -274,33 +274,32 @@ static struct sk_buff **tcp4_gro_receive(struct sk_buff **head, struct sk_buff * | |||
274 | { | 274 | { |
275 | const struct iphdr *iph = skb_gro_network_header(skb); | 275 | const struct iphdr *iph = skb_gro_network_header(skb); |
276 | __wsum wsum; | 276 | __wsum wsum; |
277 | __sum16 sum; | 277 | |
278 | /* Don't bother verifying checksum if we're going to flush anyway. */ | ||
279 | if (NAPI_GRO_CB(skb)->flush) | ||
280 | goto skip_csum; | ||
281 | |||
282 | wsum = skb->csum; | ||
278 | 283 | ||
279 | switch (skb->ip_summed) { | 284 | switch (skb->ip_summed) { |
285 | case CHECKSUM_NONE: | ||
286 | wsum = skb_checksum(skb, skb_gro_offset(skb), skb_gro_len(skb), | ||
287 | 0); | ||
288 | |||
289 | /* fall through */ | ||
290 | |||
280 | case CHECKSUM_COMPLETE: | 291 | case CHECKSUM_COMPLETE: |
281 | if (!tcp_v4_check(skb_gro_len(skb), iph->saddr, iph->daddr, | 292 | if (!tcp_v4_check(skb_gro_len(skb), iph->saddr, iph->daddr, |
282 | skb->csum)) { | 293 | wsum)) { |
283 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 294 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
284 | break; | 295 | break; |
285 | } | 296 | } |
286 | flush: | 297 | |
287 | NAPI_GRO_CB(skb)->flush = 1; | 298 | NAPI_GRO_CB(skb)->flush = 1; |
288 | return NULL; | 299 | return NULL; |
289 | |||
290 | case CHECKSUM_NONE: | ||
291 | wsum = csum_tcpudp_nofold(iph->saddr, iph->daddr, | ||
292 | skb_gro_len(skb), IPPROTO_TCP, 0); | ||
293 | sum = csum_fold(skb_checksum(skb, | ||
294 | skb_gro_offset(skb), | ||
295 | skb_gro_len(skb), | ||
296 | wsum)); | ||
297 | if (sum) | ||
298 | goto flush; | ||
299 | |||
300 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
301 | break; | ||
302 | } | 300 | } |
303 | 301 | ||
302 | skip_csum: | ||
304 | return tcp_gro_receive(head, skb); | 303 | return tcp_gro_receive(head, skb); |
305 | } | 304 | } |
306 | 305 | ||
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 5944d7d668dd..44f6a20fa29d 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -999,7 +999,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
999 | err = PTR_ERR(rt); | 999 | err = PTR_ERR(rt); |
1000 | rt = NULL; | 1000 | rt = NULL; |
1001 | if (err == -ENETUNREACH) | 1001 | if (err == -ENETUNREACH) |
1002 | IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES); | 1002 | IP_INC_STATS(net, IPSTATS_MIB_OUTNOROUTES); |
1003 | goto out; | 1003 | goto out; |
1004 | } | 1004 | } |
1005 | 1005 | ||
@@ -1098,6 +1098,9 @@ int udp_sendpage(struct sock *sk, struct page *page, int offset, | |||
1098 | struct udp_sock *up = udp_sk(sk); | 1098 | struct udp_sock *up = udp_sk(sk); |
1099 | int ret; | 1099 | int ret; |
1100 | 1100 | ||
1101 | if (flags & MSG_SENDPAGE_NOTLAST) | ||
1102 | flags |= MSG_MORE; | ||
1103 | |||
1101 | if (!up->pending) { | 1104 | if (!up->pending) { |
1102 | struct msghdr msg = { .msg_flags = flags|MSG_MORE }; | 1105 | struct msghdr msg = { .msg_flags = flags|MSG_MORE }; |
1103 | 1106 | ||
@@ -1236,7 +1239,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1236 | bool slow; | 1239 | bool slow; |
1237 | 1240 | ||
1238 | if (flags & MSG_ERRQUEUE) | 1241 | if (flags & MSG_ERRQUEUE) |
1239 | return ip_recv_error(sk, msg, len); | 1242 | return ip_recv_error(sk, msg, len, addr_len); |
1240 | 1243 | ||
1241 | try_again: | 1244 | try_again: |
1242 | skb = __skb_recv_datagram(sk, flags | (noblock ? MSG_DONTWAIT : 0), | 1245 | skb = __skb_recv_datagram(sk, flags | (noblock ? MSG_DONTWAIT : 0), |
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index a454b0ff57c7..8dfe1f4d3c1a 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c | |||
@@ -318,7 +318,7 @@ void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu) | |||
318 | /* | 318 | /* |
319 | * Handle MSG_ERRQUEUE | 319 | * Handle MSG_ERRQUEUE |
320 | */ | 320 | */ |
321 | int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) | 321 | int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) |
322 | { | 322 | { |
323 | struct ipv6_pinfo *np = inet6_sk(sk); | 323 | struct ipv6_pinfo *np = inet6_sk(sk); |
324 | struct sock_exterr_skb *serr; | 324 | struct sock_exterr_skb *serr; |
@@ -369,6 +369,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) | |||
369 | &sin->sin6_addr); | 369 | &sin->sin6_addr); |
370 | sin->sin6_scope_id = 0; | 370 | sin->sin6_scope_id = 0; |
371 | } | 371 | } |
372 | *addr_len = sizeof(*sin); | ||
372 | } | 373 | } |
373 | 374 | ||
374 | memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); | 375 | memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); |
@@ -377,6 +378,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) | |||
377 | if (serr->ee.ee_origin != SO_EE_ORIGIN_LOCAL) { | 378 | if (serr->ee.ee_origin != SO_EE_ORIGIN_LOCAL) { |
378 | sin->sin6_family = AF_INET6; | 379 | sin->sin6_family = AF_INET6; |
379 | sin->sin6_flowinfo = 0; | 380 | sin->sin6_flowinfo = 0; |
381 | sin->sin6_port = 0; | ||
380 | if (skb->protocol == htons(ETH_P_IPV6)) { | 382 | if (skb->protocol == htons(ETH_P_IPV6)) { |
381 | sin->sin6_addr = ipv6_hdr(skb)->saddr; | 383 | sin->sin6_addr = ipv6_hdr(skb)->saddr; |
382 | if (np->rxopt.all) | 384 | if (np->rxopt.all) |
@@ -423,7 +425,8 @@ EXPORT_SYMBOL_GPL(ipv6_recv_error); | |||
423 | /* | 425 | /* |
424 | * Handle IPV6_RECVPATHMTU | 426 | * Handle IPV6_RECVPATHMTU |
425 | */ | 427 | */ |
426 | int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len) | 428 | int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len, |
429 | int *addr_len) | ||
427 | { | 430 | { |
428 | struct ipv6_pinfo *np = inet6_sk(sk); | 431 | struct ipv6_pinfo *np = inet6_sk(sk); |
429 | struct sk_buff *skb; | 432 | struct sk_buff *skb; |
@@ -457,6 +460,7 @@ int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len) | |||
457 | sin->sin6_port = 0; | 460 | sin->sin6_port = 0; |
458 | sin->sin6_scope_id = mtu_info.ip6m_addr.sin6_scope_id; | 461 | sin->sin6_scope_id = mtu_info.ip6m_addr.sin6_scope_id; |
459 | sin->sin6_addr = mtu_info.ip6m_addr.sin6_addr; | 462 | sin->sin6_addr = mtu_info.ip6m_addr.sin6_addr; |
463 | *addr_len = sizeof(*sin); | ||
460 | } | 464 | } |
461 | 465 | ||
462 | put_cmsg(msg, SOL_IPV6, IPV6_PATHMTU, sizeof(mtu_info), &mtu_info); | 466 | put_cmsg(msg, SOL_IPV6, IPV6_PATHMTU, sizeof(mtu_info), &mtu_info); |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 59df872e2f4d..4acdb63495db 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -116,8 +116,8 @@ static int ip6_finish_output2(struct sk_buff *skb) | |||
116 | } | 116 | } |
117 | rcu_read_unlock_bh(); | 117 | rcu_read_unlock_bh(); |
118 | 118 | ||
119 | IP6_INC_STATS_BH(dev_net(dst->dev), | 119 | IP6_INC_STATS(dev_net(dst->dev), |
120 | ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES); | 120 | ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES); |
121 | kfree_skb(skb); | 121 | kfree_skb(skb); |
122 | return -EINVAL; | 122 | return -EINVAL; |
123 | } | 123 | } |
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c index 8815e31a87fe..a83243c3d656 100644 --- a/net/ipv6/ping.c +++ b/net/ipv6/ping.c | |||
@@ -57,7 +57,8 @@ static struct inet_protosw pingv6_protosw = { | |||
57 | 57 | ||
58 | 58 | ||
59 | /* Compatibility glue so we can support IPv6 when it's compiled as a module */ | 59 | /* Compatibility glue so we can support IPv6 when it's compiled as a module */ |
60 | static int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) | 60 | static int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, |
61 | int *addr_len) | ||
61 | { | 62 | { |
62 | return -EAFNOSUPPORT; | 63 | return -EAFNOSUPPORT; |
63 | } | 64 | } |
diff --git a/net/ipv6/protocol.c b/net/ipv6/protocol.c index 22d1bd4670da..e048cf1bb6a2 100644 --- a/net/ipv6/protocol.c +++ b/net/ipv6/protocol.c | |||
@@ -36,10 +36,6 @@ int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char protocol | |||
36 | } | 36 | } |
37 | EXPORT_SYMBOL(inet6_add_protocol); | 37 | EXPORT_SYMBOL(inet6_add_protocol); |
38 | 38 | ||
39 | /* | ||
40 | * Remove a protocol from the hash tables. | ||
41 | */ | ||
42 | |||
43 | int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char protocol) | 39 | int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char protocol) |
44 | { | 40 | { |
45 | int ret; | 41 | int ret; |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index e24ff1df0401..7fb4e14c467f 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -466,10 +466,10 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
466 | return -EOPNOTSUPP; | 466 | return -EOPNOTSUPP; |
467 | 467 | ||
468 | if (flags & MSG_ERRQUEUE) | 468 | if (flags & MSG_ERRQUEUE) |
469 | return ipv6_recv_error(sk, msg, len); | 469 | return ipv6_recv_error(sk, msg, len, addr_len); |
470 | 470 | ||
471 | if (np->rxpmtu && np->rxopt.bits.rxpmtu) | 471 | if (np->rxpmtu && np->rxopt.bits.rxpmtu) |
472 | return ipv6_recv_rxpmtu(sk, msg, len); | 472 | return ipv6_recv_rxpmtu(sk, msg, len, addr_len); |
473 | 473 | ||
474 | skb = skb_recv_datagram(sk, flags, noblock, &err); | 474 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
475 | if (!skb) | 475 | if (!skb) |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 1b4a4a953675..366fbba3359a 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -478,14 +478,44 @@ static void ipip6_tunnel_uninit(struct net_device *dev) | |||
478 | dev_put(dev); | 478 | dev_put(dev); |
479 | } | 479 | } |
480 | 480 | ||
481 | /* Generate icmpv6 with type/code ICMPV6_DEST_UNREACH/ICMPV6_ADDR_UNREACH | ||
482 | * if sufficient data bytes are available | ||
483 | */ | ||
484 | static int ipip6_err_gen_icmpv6_unreach(struct sk_buff *skb) | ||
485 | { | ||
486 | const struct iphdr *iph = (const struct iphdr *) skb->data; | ||
487 | struct rt6_info *rt; | ||
488 | struct sk_buff *skb2; | ||
489 | |||
490 | if (!pskb_may_pull(skb, iph->ihl * 4 + sizeof(struct ipv6hdr) + 8)) | ||
491 | return 1; | ||
492 | |||
493 | skb2 = skb_clone(skb, GFP_ATOMIC); | ||
494 | |||
495 | if (!skb2) | ||
496 | return 1; | ||
497 | |||
498 | skb_dst_drop(skb2); | ||
499 | skb_pull(skb2, iph->ihl * 4); | ||
500 | skb_reset_network_header(skb2); | ||
501 | |||
502 | rt = rt6_lookup(dev_net(skb->dev), &ipv6_hdr(skb2)->saddr, NULL, 0, 0); | ||
503 | |||
504 | if (rt && rt->dst.dev) | ||
505 | skb2->dev = rt->dst.dev; | ||
506 | |||
507 | icmpv6_send(skb2, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0); | ||
508 | |||
509 | if (rt) | ||
510 | ip6_rt_put(rt); | ||
511 | |||
512 | kfree_skb(skb2); | ||
513 | |||
514 | return 0; | ||
515 | } | ||
481 | 516 | ||
482 | static int ipip6_err(struct sk_buff *skb, u32 info) | 517 | static int ipip6_err(struct sk_buff *skb, u32 info) |
483 | { | 518 | { |
484 | |||
485 | /* All the routers (except for Linux) return only | ||
486 | 8 bytes of packet payload. It means, that precise relaying of | ||
487 | ICMP in the real Internet is absolutely infeasible. | ||
488 | */ | ||
489 | const struct iphdr *iph = (const struct iphdr *)skb->data; | 519 | const struct iphdr *iph = (const struct iphdr *)skb->data; |
490 | const int type = icmp_hdr(skb)->type; | 520 | const int type = icmp_hdr(skb)->type; |
491 | const int code = icmp_hdr(skb)->code; | 521 | const int code = icmp_hdr(skb)->code; |
@@ -500,7 +530,6 @@ static int ipip6_err(struct sk_buff *skb, u32 info) | |||
500 | case ICMP_DEST_UNREACH: | 530 | case ICMP_DEST_UNREACH: |
501 | switch (code) { | 531 | switch (code) { |
502 | case ICMP_SR_FAILED: | 532 | case ICMP_SR_FAILED: |
503 | case ICMP_PORT_UNREACH: | ||
504 | /* Impossible event. */ | 533 | /* Impossible event. */ |
505 | return 0; | 534 | return 0; |
506 | default: | 535 | default: |
@@ -545,6 +574,9 @@ static int ipip6_err(struct sk_buff *skb, u32 info) | |||
545 | goto out; | 574 | goto out; |
546 | 575 | ||
547 | err = 0; | 576 | err = 0; |
577 | if (!ipip6_err_gen_icmpv6_unreach(skb)) | ||
578 | goto out; | ||
579 | |||
548 | if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) | 580 | if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) |
549 | goto out; | 581 | goto out; |
550 | 582 | ||
@@ -919,7 +951,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
919 | if (!new_skb) { | 951 | if (!new_skb) { |
920 | ip_rt_put(rt); | 952 | ip_rt_put(rt); |
921 | dev->stats.tx_dropped++; | 953 | dev->stats.tx_dropped++; |
922 | dev_kfree_skb(skb); | 954 | kfree_skb(skb); |
923 | return NETDEV_TX_OK; | 955 | return NETDEV_TX_OK; |
924 | } | 956 | } |
925 | if (skb->sk) | 957 | if (skb->sk) |
@@ -945,7 +977,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
945 | tx_error_icmp: | 977 | tx_error_icmp: |
946 | dst_link_failure(skb); | 978 | dst_link_failure(skb); |
947 | tx_error: | 979 | tx_error: |
948 | dev_kfree_skb(skb); | 980 | kfree_skb(skb); |
949 | out: | 981 | out: |
950 | dev->stats.tx_errors++; | 982 | dev->stats.tx_errors++; |
951 | return NETDEV_TX_OK; | 983 | return NETDEV_TX_OK; |
@@ -985,7 +1017,7 @@ static netdev_tx_t sit_tunnel_xmit(struct sk_buff *skb, | |||
985 | 1017 | ||
986 | tx_err: | 1018 | tx_err: |
987 | dev->stats.tx_errors++; | 1019 | dev->stats.tx_errors++; |
988 | dev_kfree_skb(skb); | 1020 | kfree_skb(skb); |
989 | return NETDEV_TX_OK; | 1021 | return NETDEV_TX_OK; |
990 | 1022 | ||
991 | } | 1023 | } |
diff --git a/net/ipv6/tcpv6_offload.c b/net/ipv6/tcpv6_offload.c index c1097c798900..6d18157dc32c 100644 --- a/net/ipv6/tcpv6_offload.c +++ b/net/ipv6/tcpv6_offload.c | |||
@@ -37,34 +37,32 @@ static struct sk_buff **tcp6_gro_receive(struct sk_buff **head, | |||
37 | { | 37 | { |
38 | const struct ipv6hdr *iph = skb_gro_network_header(skb); | 38 | const struct ipv6hdr *iph = skb_gro_network_header(skb); |
39 | __wsum wsum; | 39 | __wsum wsum; |
40 | __sum16 sum; | 40 | |
41 | /* Don't bother verifying checksum if we're going to flush anyway. */ | ||
42 | if (NAPI_GRO_CB(skb)->flush) | ||
43 | goto skip_csum; | ||
44 | |||
45 | wsum = skb->csum; | ||
41 | 46 | ||
42 | switch (skb->ip_summed) { | 47 | switch (skb->ip_summed) { |
48 | case CHECKSUM_NONE: | ||
49 | wsum = skb_checksum(skb, skb_gro_offset(skb), skb_gro_len(skb), | ||
50 | wsum); | ||
51 | |||
52 | /* fall through */ | ||
53 | |||
43 | case CHECKSUM_COMPLETE: | 54 | case CHECKSUM_COMPLETE: |
44 | if (!tcp_v6_check(skb_gro_len(skb), &iph->saddr, &iph->daddr, | 55 | if (!tcp_v6_check(skb_gro_len(skb), &iph->saddr, &iph->daddr, |
45 | skb->csum)) { | 56 | wsum)) { |
46 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 57 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
47 | break; | 58 | break; |
48 | } | 59 | } |
49 | flush: | 60 | |
50 | NAPI_GRO_CB(skb)->flush = 1; | 61 | NAPI_GRO_CB(skb)->flush = 1; |
51 | return NULL; | 62 | return NULL; |
52 | |||
53 | case CHECKSUM_NONE: | ||
54 | wsum = ~csum_unfold(csum_ipv6_magic(&iph->saddr, &iph->daddr, | ||
55 | skb_gro_len(skb), | ||
56 | IPPROTO_TCP, 0)); | ||
57 | sum = csum_fold(skb_checksum(skb, | ||
58 | skb_gro_offset(skb), | ||
59 | skb_gro_len(skb), | ||
60 | wsum)); | ||
61 | if (sum) | ||
62 | goto flush; | ||
63 | |||
64 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
65 | break; | ||
66 | } | 63 | } |
67 | 64 | ||
65 | skip_csum: | ||
68 | return tcp_gro_receive(head, skb); | 66 | return tcp_gro_receive(head, skb); |
69 | } | 67 | } |
70 | 68 | ||
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 81eb8cf8389b..bcd5699313c3 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -393,10 +393,10 @@ int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
393 | bool slow; | 393 | bool slow; |
394 | 394 | ||
395 | if (flags & MSG_ERRQUEUE) | 395 | if (flags & MSG_ERRQUEUE) |
396 | return ipv6_recv_error(sk, msg, len); | 396 | return ipv6_recv_error(sk, msg, len, addr_len); |
397 | 397 | ||
398 | if (np->rxpmtu && np->rxopt.bits.rxpmtu) | 398 | if (np->rxpmtu && np->rxopt.bits.rxpmtu) |
399 | return ipv6_recv_rxpmtu(sk, msg, len); | 399 | return ipv6_recv_rxpmtu(sk, msg, len, addr_len); |
400 | 400 | ||
401 | try_again: | 401 | try_again: |
402 | skb = __skb_recv_datagram(sk, flags | (noblock ? MSG_DONTWAIT : 0), | 402 | skb = __skb_recv_datagram(sk, flags | (noblock ? MSG_DONTWAIT : 0), |
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c index cfd65304be60..d9b437e55007 100644 --- a/net/l2tp/l2tp_ip6.c +++ b/net/l2tp/l2tp_ip6.c | |||
@@ -665,7 +665,7 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
665 | *addr_len = sizeof(*lsa); | 665 | *addr_len = sizeof(*lsa); |
666 | 666 | ||
667 | if (flags & MSG_ERRQUEUE) | 667 | if (flags & MSG_ERRQUEUE) |
668 | return ipv6_recv_error(sk, msg, len); | 668 | return ipv6_recv_error(sk, msg, len, addr_len); |
669 | 669 | ||
670 | skb = skb_recv_datagram(sk, flags, noblock, &err); | 670 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
671 | if (!skb) | 671 | if (!skb) |
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 4518a57aa5fe..713671ae45af 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -74,9 +74,12 @@ static struct list_head family_ht[GENL_FAM_TAB_SIZE]; | |||
74 | * Bit 17 is marked as already used since the VFS quota code | 74 | * Bit 17 is marked as already used since the VFS quota code |
75 | * also abused this API and relied on family == group ID, we | 75 | * also abused this API and relied on family == group ID, we |
76 | * cater to that by giving it a static family and group ID. | 76 | * cater to that by giving it a static family and group ID. |
77 | * Bit 18 is marked as already used since the PMCRAID driver | ||
78 | * did the same thing as the VFS quota code (maybe copied?) | ||
77 | */ | 79 | */ |
78 | static unsigned long mc_group_start = 0x3 | BIT(GENL_ID_CTRL) | | 80 | static unsigned long mc_group_start = 0x3 | BIT(GENL_ID_CTRL) | |
79 | BIT(GENL_ID_VFS_DQUOT); | 81 | BIT(GENL_ID_VFS_DQUOT) | |
82 | BIT(GENL_ID_PMCRAID); | ||
80 | static unsigned long *mc_groups = &mc_group_start; | 83 | static unsigned long *mc_groups = &mc_group_start; |
81 | static unsigned long mc_groups_longs = 1; | 84 | static unsigned long mc_groups_longs = 1; |
82 | 85 | ||
@@ -139,6 +142,7 @@ static u16 genl_generate_id(void) | |||
139 | 142 | ||
140 | for (i = 0; i <= GENL_MAX_ID - GENL_MIN_ID; i++) { | 143 | for (i = 0; i <= GENL_MAX_ID - GENL_MIN_ID; i++) { |
141 | if (id_gen_idx != GENL_ID_VFS_DQUOT && | 144 | if (id_gen_idx != GENL_ID_VFS_DQUOT && |
145 | id_gen_idx != GENL_ID_PMCRAID && | ||
142 | !genl_family_find_byid(id_gen_idx)) | 146 | !genl_family_find_byid(id_gen_idx)) |
143 | return id_gen_idx; | 147 | return id_gen_idx; |
144 | if (++id_gen_idx > GENL_MAX_ID) | 148 | if (++id_gen_idx > GENL_MAX_ID) |
@@ -214,7 +218,7 @@ static int genl_validate_assign_mc_groups(struct genl_family *family) | |||
214 | { | 218 | { |
215 | int first_id; | 219 | int first_id; |
216 | int n_groups = family->n_mcgrps; | 220 | int n_groups = family->n_mcgrps; |
217 | int err, i; | 221 | int err = 0, i; |
218 | bool groups_allocated = false; | 222 | bool groups_allocated = false; |
219 | 223 | ||
220 | if (!n_groups) | 224 | if (!n_groups) |
@@ -236,9 +240,12 @@ static int genl_validate_assign_mc_groups(struct genl_family *family) | |||
236 | } else if (strcmp(family->name, "NET_DM") == 0) { | 240 | } else if (strcmp(family->name, "NET_DM") == 0) { |
237 | first_id = 1; | 241 | first_id = 1; |
238 | BUG_ON(n_groups != 1); | 242 | BUG_ON(n_groups != 1); |
239 | } else if (strcmp(family->name, "VFS_DQUOT") == 0) { | 243 | } else if (family->id == GENL_ID_VFS_DQUOT) { |
240 | first_id = GENL_ID_VFS_DQUOT; | 244 | first_id = GENL_ID_VFS_DQUOT; |
241 | BUG_ON(n_groups != 1); | 245 | BUG_ON(n_groups != 1); |
246 | } else if (family->id == GENL_ID_PMCRAID) { | ||
247 | first_id = GENL_ID_PMCRAID; | ||
248 | BUG_ON(n_groups != 1); | ||
242 | } else { | 249 | } else { |
243 | groups_allocated = true; | 250 | groups_allocated = true; |
244 | err = genl_allocate_reserve_groups(n_groups, &first_id); | 251 | err = genl_allocate_reserve_groups(n_groups, &first_id); |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index ac27c86ef6d1..ba2548bd85bf 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -439,9 +439,9 @@ static void prb_shutdown_retire_blk_timer(struct packet_sock *po, | |||
439 | 439 | ||
440 | pkc = tx_ring ? &po->tx_ring.prb_bdqc : &po->rx_ring.prb_bdqc; | 440 | pkc = tx_ring ? &po->tx_ring.prb_bdqc : &po->rx_ring.prb_bdqc; |
441 | 441 | ||
442 | spin_lock(&rb_queue->lock); | 442 | spin_lock_bh(&rb_queue->lock); |
443 | pkc->delete_blk_timer = 1; | 443 | pkc->delete_blk_timer = 1; |
444 | spin_unlock(&rb_queue->lock); | 444 | spin_unlock_bh(&rb_queue->lock); |
445 | 445 | ||
446 | prb_del_retire_blk_timer(pkc); | 446 | prb_del_retire_blk_timer(pkc); |
447 | } | 447 | } |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 75c94e59a3bd..bccd52b36e97 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -215,10 +215,10 @@ static bool loss_4state(struct netem_sched_data *q) | |||
215 | if (rnd < clg->a4) { | 215 | if (rnd < clg->a4) { |
216 | clg->state = 4; | 216 | clg->state = 4; |
217 | return true; | 217 | return true; |
218 | } else if (clg->a4 < rnd && rnd < clg->a1) { | 218 | } else if (clg->a4 < rnd && rnd < clg->a1 + clg->a4) { |
219 | clg->state = 3; | 219 | clg->state = 3; |
220 | return true; | 220 | return true; |
221 | } else if (clg->a1 < rnd) | 221 | } else if (clg->a1 + clg->a4 < rnd) |
222 | clg->state = 1; | 222 | clg->state = 1; |
223 | 223 | ||
224 | break; | 224 | break; |
@@ -268,10 +268,11 @@ static bool loss_gilb_ell(struct netem_sched_data *q) | |||
268 | clg->state = 2; | 268 | clg->state = 2; |
269 | if (net_random() < clg->a4) | 269 | if (net_random() < clg->a4) |
270 | return true; | 270 | return true; |
271 | break; | ||
271 | case 2: | 272 | case 2: |
272 | if (net_random() < clg->a2) | 273 | if (net_random() < clg->a2) |
273 | clg->state = 1; | 274 | clg->state = 1; |
274 | if (clg->a3 > net_random()) | 275 | if (net_random() > clg->a3) |
275 | return true; | 276 | return true; |
276 | } | 277 | } |
277 | 278 | ||
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 68f98595819c..a6090051c5db 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <net/netlink.h> | 21 | #include <net/netlink.h> |
22 | #include <net/sch_generic.h> | 22 | #include <net/sch_generic.h> |
23 | #include <net/pkt_sched.h> | 23 | #include <net/pkt_sched.h> |
24 | #include <net/tcp.h> | ||
24 | 25 | ||
25 | 26 | ||
26 | /* Simple Token Bucket Filter. | 27 | /* Simple Token Bucket Filter. |
@@ -117,6 +118,22 @@ struct tbf_sched_data { | |||
117 | }; | 118 | }; |
118 | 119 | ||
119 | 120 | ||
121 | /* | ||
122 | * Return length of individual segments of a gso packet, | ||
123 | * including all headers (MAC, IP, TCP/UDP) | ||
124 | */ | ||
125 | static unsigned int skb_gso_seglen(const struct sk_buff *skb) | ||
126 | { | ||
127 | unsigned int hdr_len = skb_transport_header(skb) - skb_mac_header(skb); | ||
128 | const struct skb_shared_info *shinfo = skb_shinfo(skb); | ||
129 | |||
130 | if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) | ||
131 | hdr_len += tcp_hdrlen(skb); | ||
132 | else | ||
133 | hdr_len += sizeof(struct udphdr); | ||
134 | return hdr_len + shinfo->gso_size; | ||
135 | } | ||
136 | |||
120 | /* GSO packet is too big, segment it so that tbf can transmit | 137 | /* GSO packet is too big, segment it so that tbf can transmit |
121 | * each segment in time | 138 | * each segment in time |
122 | */ | 139 | */ |
@@ -136,12 +153,8 @@ static int tbf_segment(struct sk_buff *skb, struct Qdisc *sch) | |||
136 | while (segs) { | 153 | while (segs) { |
137 | nskb = segs->next; | 154 | nskb = segs->next; |
138 | segs->next = NULL; | 155 | segs->next = NULL; |
139 | if (likely(segs->len <= q->max_size)) { | 156 | qdisc_skb_cb(segs)->pkt_len = segs->len; |
140 | qdisc_skb_cb(segs)->pkt_len = segs->len; | 157 | ret = qdisc_enqueue(segs, q->qdisc); |
141 | ret = qdisc_enqueue(segs, q->qdisc); | ||
142 | } else { | ||
143 | ret = qdisc_reshape_fail(skb, sch); | ||
144 | } | ||
145 | if (ret != NET_XMIT_SUCCESS) { | 158 | if (ret != NET_XMIT_SUCCESS) { |
146 | if (net_xmit_drop_count(ret)) | 159 | if (net_xmit_drop_count(ret)) |
147 | sch->qstats.drops++; | 160 | sch->qstats.drops++; |
@@ -163,7 +176,7 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
163 | int ret; | 176 | int ret; |
164 | 177 | ||
165 | if (qdisc_pkt_len(skb) > q->max_size) { | 178 | if (qdisc_pkt_len(skb) > q->max_size) { |
166 | if (skb_is_gso(skb)) | 179 | if (skb_is_gso(skb) && skb_gso_seglen(skb) <= q->max_size) |
167 | return tbf_segment(skb, sch); | 180 | return tbf_segment(skb, sch); |
168 | return qdisc_reshape_fail(skb, sch); | 181 | return qdisc_reshape_fail(skb, sch); |
169 | } | 182 | } |
@@ -319,6 +332,11 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt) | |||
319 | if (max_size < 0) | 332 | if (max_size < 0) |
320 | goto done; | 333 | goto done; |
321 | 334 | ||
335 | if (max_size < psched_mtu(qdisc_dev(sch))) | ||
336 | pr_warn_ratelimited("sch_tbf: burst %u is lower than device %s mtu (%u) !\n", | ||
337 | max_size, qdisc_dev(sch)->name, | ||
338 | psched_mtu(qdisc_dev(sch))); | ||
339 | |||
322 | if (q->qdisc != &noop_qdisc) { | 340 | if (q->qdisc != &noop_qdisc) { |
323 | err = fifo_set_limit(q->qdisc, qopt->limit); | 341 | err = fifo_set_limit(q->qdisc, qopt->limit); |
324 | if (err) | 342 | if (err) |
diff --git a/net/sctp/output.c b/net/sctp/output.c index e650978daf27..0e2644d0a773 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -474,10 +474,11 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
474 | * for a given destination transport address. | 474 | * for a given destination transport address. |
475 | */ | 475 | */ |
476 | 476 | ||
477 | if (!tp->rto_pending) { | 477 | if (!chunk->resent && !tp->rto_pending) { |
478 | chunk->rtt_in_progress = 1; | 478 | chunk->rtt_in_progress = 1; |
479 | tp->rto_pending = 1; | 479 | tp->rto_pending = 1; |
480 | } | 480 | } |
481 | |||
481 | has_data = 1; | 482 | has_data = 1; |
482 | } | 483 | } |
483 | 484 | ||
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index 94df75877869..f51ba985a36e 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
@@ -446,6 +446,8 @@ void sctp_retransmit_mark(struct sctp_outq *q, | |||
446 | transport->rto_pending = 0; | 446 | transport->rto_pending = 0; |
447 | } | 447 | } |
448 | 448 | ||
449 | chunk->resent = 1; | ||
450 | |||
449 | /* Move the chunk to the retransmit queue. The chunks | 451 | /* Move the chunk to the retransmit queue. The chunks |
450 | * on the retransmit queue are always kept in order. | 452 | * on the retransmit queue are always kept in order. |
451 | */ | 453 | */ |
@@ -1375,6 +1377,7 @@ static void sctp_check_transmitted(struct sctp_outq *q, | |||
1375 | * instance). | 1377 | * instance). |
1376 | */ | 1378 | */ |
1377 | if (!tchunk->tsn_gap_acked && | 1379 | if (!tchunk->tsn_gap_acked && |
1380 | !tchunk->resent && | ||
1378 | tchunk->rtt_in_progress) { | 1381 | tchunk->rtt_in_progress) { |
1379 | tchunk->rtt_in_progress = 0; | 1382 | tchunk->rtt_in_progress = 0; |
1380 | rtt = jiffies - tchunk->sent_at; | 1383 | rtt = jiffies - tchunk->sent_at; |
@@ -1391,7 +1394,8 @@ static void sctp_check_transmitted(struct sctp_outq *q, | |||
1391 | */ | 1394 | */ |
1392 | if (!tchunk->tsn_gap_acked) { | 1395 | if (!tchunk->tsn_gap_acked) { |
1393 | tchunk->tsn_gap_acked = 1; | 1396 | tchunk->tsn_gap_acked = 1; |
1394 | *highest_new_tsn_in_sack = tsn; | 1397 | if (TSN_lt(*highest_new_tsn_in_sack, tsn)) |
1398 | *highest_new_tsn_in_sack = tsn; | ||
1395 | bytes_acked += sctp_data_size(tchunk); | 1399 | bytes_acked += sctp_data_size(tchunk); |
1396 | if (!tchunk->transport) | 1400 | if (!tchunk->transport) |
1397 | migrate_bytes += sctp_data_size(tchunk); | 1401 | migrate_bytes += sctp_data_size(tchunk); |
diff --git a/net/socket.c b/net/socket.c index 0b18693f2be6..e83c416708af 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1973,7 +1973,7 @@ static int copy_msghdr_from_user(struct msghdr *kmsg, | |||
1973 | if (copy_from_user(kmsg, umsg, sizeof(struct msghdr))) | 1973 | if (copy_from_user(kmsg, umsg, sizeof(struct msghdr))) |
1974 | return -EFAULT; | 1974 | return -EFAULT; |
1975 | if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) | 1975 | if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) |
1976 | return -EINVAL; | 1976 | kmsg->msg_namelen = sizeof(struct sockaddr_storage); |
1977 | return 0; | 1977 | return 0; |
1978 | } | 1978 | } |
1979 | 1979 | ||
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 97912b40c254..42fdfc634e56 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -1517,7 +1517,7 @@ out: | |||
1517 | static int | 1517 | static int |
1518 | gss_refresh_null(struct rpc_task *task) | 1518 | gss_refresh_null(struct rpc_task *task) |
1519 | { | 1519 | { |
1520 | return -EACCES; | 1520 | return 0; |
1521 | } | 1521 | } |
1522 | 1522 | ||
1523 | static __be32 * | 1523 | static __be32 * |
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index d0da66396f62..91280b82da08 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -364,7 +364,8 @@ if ($arch eq "x86_64") { | |||
364 | } elsif ($arch eq "blackfin") { | 364 | } elsif ($arch eq "blackfin") { |
365 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s__mcount\$"; | 365 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s__mcount\$"; |
366 | $mcount_adjust = -4; | 366 | $mcount_adjust = -4; |
367 | } elsif ($arch eq "tilegx") { | 367 | } elsif ($arch eq "tilegx" || $arch eq "tile") { |
368 | # Default to the newer TILE-Gx architecture if only "tile" is given. | ||
368 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s__mcount\$"; | 369 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s__mcount\$"; |
369 | $type = ".quad"; | 370 | $type = ".quad"; |
370 | $alignment = 8; | 371 | $alignment = 8; |
diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c index 77ca965ab684..b4af4ebc5be2 100644 --- a/security/integrity/digsig.c +++ b/security/integrity/digsig.c | |||
@@ -13,9 +13,7 @@ | |||
13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
14 | 14 | ||
15 | #include <linux/err.h> | 15 | #include <linux/err.h> |
16 | #include <linux/sched.h> | ||
17 | #include <linux/rbtree.h> | 16 | #include <linux/rbtree.h> |
18 | #include <linux/cred.h> | ||
19 | #include <linux/key-type.h> | 17 | #include <linux/key-type.h> |
20 | #include <linux/digsig.h> | 18 | #include <linux/digsig.h> |
21 | 19 | ||
@@ -23,19 +21,11 @@ | |||
23 | 21 | ||
24 | static struct key *keyring[INTEGRITY_KEYRING_MAX]; | 22 | static struct key *keyring[INTEGRITY_KEYRING_MAX]; |
25 | 23 | ||
26 | #ifdef CONFIG_IMA_TRUSTED_KEYRING | ||
27 | static const char *keyring_name[INTEGRITY_KEYRING_MAX] = { | ||
28 | ".evm", | ||
29 | ".module", | ||
30 | ".ima", | ||
31 | }; | ||
32 | #else | ||
33 | static const char *keyring_name[INTEGRITY_KEYRING_MAX] = { | 24 | static const char *keyring_name[INTEGRITY_KEYRING_MAX] = { |
34 | "_evm", | 25 | "_evm", |
35 | "_module", | 26 | "_module", |
36 | "_ima", | 27 | "_ima", |
37 | }; | 28 | }; |
38 | #endif | ||
39 | 29 | ||
40 | int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen, | 30 | int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen, |
41 | const char *digest, int digestlen) | 31 | const char *digest, int digestlen) |
@@ -45,7 +35,7 @@ int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen, | |||
45 | 35 | ||
46 | if (!keyring[id]) { | 36 | if (!keyring[id]) { |
47 | keyring[id] = | 37 | keyring[id] = |
48 | request_key(&key_type_keyring, keyring_name[id], NULL); | 38 | request_key(&key_type_keyring, keyring_name[id], NULL); |
49 | if (IS_ERR(keyring[id])) { | 39 | if (IS_ERR(keyring[id])) { |
50 | int err = PTR_ERR(keyring[id]); | 40 | int err = PTR_ERR(keyring[id]); |
51 | pr_err("no %s keyring: %d\n", keyring_name[id], err); | 41 | pr_err("no %s keyring: %d\n", keyring_name[id], err); |
@@ -66,21 +56,3 @@ int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen, | |||
66 | 56 | ||
67 | return -EOPNOTSUPP; | 57 | return -EOPNOTSUPP; |
68 | } | 58 | } |
69 | |||
70 | int integrity_init_keyring(const unsigned int id) | ||
71 | { | ||
72 | const struct cred *cred = current_cred(); | ||
73 | const struct user_struct *user = cred->user; | ||
74 | |||
75 | keyring[id] = keyring_alloc(keyring_name[id], KUIDT_INIT(0), | ||
76 | KGIDT_INIT(0), cred, | ||
77 | ((KEY_POS_ALL & ~KEY_POS_SETATTR) | | ||
78 | KEY_USR_VIEW | KEY_USR_READ), | ||
79 | KEY_ALLOC_NOT_IN_QUOTA, user->uid_keyring); | ||
80 | if (!IS_ERR(keyring[id])) | ||
81 | set_bit(KEY_FLAG_TRUSTED_ONLY, &keyring[id]->flags); | ||
82 | else | ||
83 | pr_info("Can't allocate %s keyring (%ld)\n", | ||
84 | keyring_name[id], PTR_ERR(keyring[id])); | ||
85 | return 0; | ||
86 | } | ||
diff --git a/security/integrity/ima/Kconfig b/security/integrity/ima/Kconfig index dad8d4ca2437..81a27971d884 100644 --- a/security/integrity/ima/Kconfig +++ b/security/integrity/ima/Kconfig | |||
@@ -123,11 +123,3 @@ config IMA_APPRAISE | |||
123 | For more information on integrity appraisal refer to: | 123 | For more information on integrity appraisal refer to: |
124 | <http://linux-ima.sourceforge.net> | 124 | <http://linux-ima.sourceforge.net> |
125 | If unsure, say N. | 125 | If unsure, say N. |
126 | |||
127 | config IMA_TRUSTED_KEYRING | ||
128 | bool "Require all keys on the _ima keyring be signed" | ||
129 | depends on IMA_APPRAISE && SYSTEM_TRUSTED_KEYRING | ||
130 | default y | ||
131 | help | ||
132 | This option requires that all keys added to the _ima | ||
133 | keyring be signed by a key on the system trusted keyring. | ||
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h index bf03c6a16cc8..0356e1d437ca 100644 --- a/security/integrity/ima/ima.h +++ b/security/integrity/ima/ima.h | |||
@@ -26,7 +26,8 @@ | |||
26 | 26 | ||
27 | #include "../integrity.h" | 27 | #include "../integrity.h" |
28 | 28 | ||
29 | enum ima_show_type { IMA_SHOW_BINARY, IMA_SHOW_ASCII }; | 29 | enum ima_show_type { IMA_SHOW_BINARY, IMA_SHOW_BINARY_NO_FIELD_LEN, |
30 | IMA_SHOW_ASCII }; | ||
30 | enum tpm_pcrs { TPM_PCR0 = 0, TPM_PCR8 = 8 }; | 31 | enum tpm_pcrs { TPM_PCR0 = 0, TPM_PCR8 = 8 }; |
31 | 32 | ||
32 | /* digest size for IMA, fits SHA1 or MD5 */ | 33 | /* digest size for IMA, fits SHA1 or MD5 */ |
@@ -97,7 +98,8 @@ int ima_add_template_entry(struct ima_template_entry *entry, int violation, | |||
97 | const char *op, struct inode *inode, | 98 | const char *op, struct inode *inode, |
98 | const unsigned char *filename); | 99 | const unsigned char *filename); |
99 | int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash); | 100 | int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash); |
100 | int ima_calc_field_array_hash(struct ima_field_data *field_data, int num_fields, | 101 | int ima_calc_field_array_hash(struct ima_field_data *field_data, |
102 | struct ima_template_desc *desc, int num_fields, | ||
101 | struct ima_digest_data *hash); | 103 | struct ima_digest_data *hash); |
102 | int __init ima_calc_boot_aggregate(struct ima_digest_data *hash); | 104 | int __init ima_calc_boot_aggregate(struct ima_digest_data *hash); |
103 | void ima_add_violation(struct file *file, const unsigned char *filename, | 105 | void ima_add_violation(struct file *file, const unsigned char *filename, |
@@ -146,6 +148,7 @@ int ima_alloc_init_template(struct integrity_iint_cache *iint, | |||
146 | int xattr_len, struct ima_template_entry **entry); | 148 | int xattr_len, struct ima_template_entry **entry); |
147 | int ima_store_template(struct ima_template_entry *entry, int violation, | 149 | int ima_store_template(struct ima_template_entry *entry, int violation, |
148 | struct inode *inode, const unsigned char *filename); | 150 | struct inode *inode, const unsigned char *filename); |
151 | void ima_free_template_entry(struct ima_template_entry *entry); | ||
149 | const char *ima_d_path(struct path *path, char **pathbuf); | 152 | const char *ima_d_path(struct path *path, char **pathbuf); |
150 | 153 | ||
151 | /* rbtree tree calls to lookup, insert, delete | 154 | /* rbtree tree calls to lookup, insert, delete |
diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c index 0e7540863fc2..c38bbce8c6a6 100644 --- a/security/integrity/ima/ima_api.c +++ b/security/integrity/ima/ima_api.c | |||
@@ -22,6 +22,19 @@ | |||
22 | #include "ima.h" | 22 | #include "ima.h" |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * ima_free_template_entry - free an existing template entry | ||
26 | */ | ||
27 | void ima_free_template_entry(struct ima_template_entry *entry) | ||
28 | { | ||
29 | int i; | ||
30 | |||
31 | for (i = 0; i < entry->template_desc->num_fields; i++) | ||
32 | kfree(entry->template_data[i].data); | ||
33 | |||
34 | kfree(entry); | ||
35 | } | ||
36 | |||
37 | /* | ||
25 | * ima_alloc_init_template - create and initialize a new template entry | 38 | * ima_alloc_init_template - create and initialize a new template entry |
26 | */ | 39 | */ |
27 | int ima_alloc_init_template(struct integrity_iint_cache *iint, | 40 | int ima_alloc_init_template(struct integrity_iint_cache *iint, |
@@ -37,6 +50,7 @@ int ima_alloc_init_template(struct integrity_iint_cache *iint, | |||
37 | if (!*entry) | 50 | if (!*entry) |
38 | return -ENOMEM; | 51 | return -ENOMEM; |
39 | 52 | ||
53 | (*entry)->template_desc = template_desc; | ||
40 | for (i = 0; i < template_desc->num_fields; i++) { | 54 | for (i = 0; i < template_desc->num_fields; i++) { |
41 | struct ima_template_field *field = template_desc->fields[i]; | 55 | struct ima_template_field *field = template_desc->fields[i]; |
42 | u32 len; | 56 | u32 len; |
@@ -51,10 +65,9 @@ int ima_alloc_init_template(struct integrity_iint_cache *iint, | |||
51 | (*entry)->template_data_len += sizeof(len); | 65 | (*entry)->template_data_len += sizeof(len); |
52 | (*entry)->template_data_len += len; | 66 | (*entry)->template_data_len += len; |
53 | } | 67 | } |
54 | (*entry)->template_desc = template_desc; | ||
55 | return 0; | 68 | return 0; |
56 | out: | 69 | out: |
57 | kfree(*entry); | 70 | ima_free_template_entry(*entry); |
58 | *entry = NULL; | 71 | *entry = NULL; |
59 | return result; | 72 | return result; |
60 | } | 73 | } |
@@ -94,6 +107,7 @@ int ima_store_template(struct ima_template_entry *entry, | |||
94 | /* this function uses default algo */ | 107 | /* this function uses default algo */ |
95 | hash.hdr.algo = HASH_ALGO_SHA1; | 108 | hash.hdr.algo = HASH_ALGO_SHA1; |
96 | result = ima_calc_field_array_hash(&entry->template_data[0], | 109 | result = ima_calc_field_array_hash(&entry->template_data[0], |
110 | entry->template_desc, | ||
97 | num_fields, &hash.hdr); | 111 | num_fields, &hash.hdr); |
98 | if (result < 0) { | 112 | if (result < 0) { |
99 | integrity_audit_msg(AUDIT_INTEGRITY_PCR, inode, | 113 | integrity_audit_msg(AUDIT_INTEGRITY_PCR, inode, |
@@ -133,7 +147,7 @@ void ima_add_violation(struct file *file, const unsigned char *filename, | |||
133 | } | 147 | } |
134 | result = ima_store_template(entry, violation, inode, filename); | 148 | result = ima_store_template(entry, violation, inode, filename); |
135 | if (result < 0) | 149 | if (result < 0) |
136 | kfree(entry); | 150 | ima_free_template_entry(entry); |
137 | err_out: | 151 | err_out: |
138 | integrity_audit_msg(AUDIT_INTEGRITY_PCR, inode, filename, | 152 | integrity_audit_msg(AUDIT_INTEGRITY_PCR, inode, filename, |
139 | op, cause, result, 0); | 153 | op, cause, result, 0); |
@@ -268,7 +282,7 @@ void ima_store_measurement(struct integrity_iint_cache *iint, | |||
268 | if (!result || result == -EEXIST) | 282 | if (!result || result == -EEXIST) |
269 | iint->flags |= IMA_MEASURED; | 283 | iint->flags |= IMA_MEASURED; |
270 | if (result < 0) | 284 | if (result < 0) |
271 | kfree(entry); | 285 | ima_free_template_entry(entry); |
272 | } | 286 | } |
273 | 287 | ||
274 | void ima_audit_measurement(struct integrity_iint_cache *iint, | 288 | void ima_audit_measurement(struct integrity_iint_cache *iint, |
diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c index 46353ee517f6..734e9468aca0 100644 --- a/security/integrity/ima/ima_appraise.c +++ b/security/integrity/ima/ima_appraise.c | |||
@@ -381,14 +381,3 @@ int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name) | |||
381 | } | 381 | } |
382 | return result; | 382 | return result; |
383 | } | 383 | } |
384 | |||
385 | #ifdef CONFIG_IMA_TRUSTED_KEYRING | ||
386 | static int __init init_ima_keyring(void) | ||
387 | { | ||
388 | int ret; | ||
389 | |||
390 | ret = integrity_init_keyring(INTEGRITY_KEYRING_IMA); | ||
391 | return 0; | ||
392 | } | ||
393 | late_initcall(init_ima_keyring); | ||
394 | #endif | ||
diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c index 676e0292dfec..fdf60def52e9 100644 --- a/security/integrity/ima/ima_crypto.c +++ b/security/integrity/ima/ima_crypto.c | |||
@@ -140,6 +140,7 @@ int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash) | |||
140 | * Calculate the hash of template data | 140 | * Calculate the hash of template data |
141 | */ | 141 | */ |
142 | static int ima_calc_field_array_hash_tfm(struct ima_field_data *field_data, | 142 | static int ima_calc_field_array_hash_tfm(struct ima_field_data *field_data, |
143 | struct ima_template_desc *td, | ||
143 | int num_fields, | 144 | int num_fields, |
144 | struct ima_digest_data *hash, | 145 | struct ima_digest_data *hash, |
145 | struct crypto_shash *tfm) | 146 | struct crypto_shash *tfm) |
@@ -160,9 +161,13 @@ static int ima_calc_field_array_hash_tfm(struct ima_field_data *field_data, | |||
160 | return rc; | 161 | return rc; |
161 | 162 | ||
162 | for (i = 0; i < num_fields; i++) { | 163 | for (i = 0; i < num_fields; i++) { |
163 | rc = crypto_shash_update(&desc.shash, | 164 | if (strcmp(td->name, IMA_TEMPLATE_IMA_NAME) != 0) { |
164 | (const u8 *) &field_data[i].len, | 165 | rc = crypto_shash_update(&desc.shash, |
165 | sizeof(field_data[i].len)); | 166 | (const u8 *) &field_data[i].len, |
167 | sizeof(field_data[i].len)); | ||
168 | if (rc) | ||
169 | break; | ||
170 | } | ||
166 | rc = crypto_shash_update(&desc.shash, field_data[i].data, | 171 | rc = crypto_shash_update(&desc.shash, field_data[i].data, |
167 | field_data[i].len); | 172 | field_data[i].len); |
168 | if (rc) | 173 | if (rc) |
@@ -175,7 +180,8 @@ static int ima_calc_field_array_hash_tfm(struct ima_field_data *field_data, | |||
175 | return rc; | 180 | return rc; |
176 | } | 181 | } |
177 | 182 | ||
178 | int ima_calc_field_array_hash(struct ima_field_data *field_data, int num_fields, | 183 | int ima_calc_field_array_hash(struct ima_field_data *field_data, |
184 | struct ima_template_desc *desc, int num_fields, | ||
179 | struct ima_digest_data *hash) | 185 | struct ima_digest_data *hash) |
180 | { | 186 | { |
181 | struct crypto_shash *tfm; | 187 | struct crypto_shash *tfm; |
@@ -185,7 +191,8 @@ int ima_calc_field_array_hash(struct ima_field_data *field_data, int num_fields, | |||
185 | if (IS_ERR(tfm)) | 191 | if (IS_ERR(tfm)) |
186 | return PTR_ERR(tfm); | 192 | return PTR_ERR(tfm); |
187 | 193 | ||
188 | rc = ima_calc_field_array_hash_tfm(field_data, num_fields, hash, tfm); | 194 | rc = ima_calc_field_array_hash_tfm(field_data, desc, num_fields, |
195 | hash, tfm); | ||
189 | 196 | ||
190 | ima_free_tfm(tfm); | 197 | ima_free_tfm(tfm); |
191 | 198 | ||
diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c index d47a7c86a21d..db01125926bd 100644 --- a/security/integrity/ima/ima_fs.c +++ b/security/integrity/ima/ima_fs.c | |||
@@ -120,6 +120,7 @@ static int ima_measurements_show(struct seq_file *m, void *v) | |||
120 | struct ima_template_entry *e; | 120 | struct ima_template_entry *e; |
121 | int namelen; | 121 | int namelen; |
122 | u32 pcr = CONFIG_IMA_MEASURE_PCR_IDX; | 122 | u32 pcr = CONFIG_IMA_MEASURE_PCR_IDX; |
123 | bool is_ima_template = false; | ||
123 | int i; | 124 | int i; |
124 | 125 | ||
125 | /* get entry */ | 126 | /* get entry */ |
@@ -145,14 +146,21 @@ static int ima_measurements_show(struct seq_file *m, void *v) | |||
145 | ima_putc(m, e->template_desc->name, namelen); | 146 | ima_putc(m, e->template_desc->name, namelen); |
146 | 147 | ||
147 | /* 5th: template length (except for 'ima' template) */ | 148 | /* 5th: template length (except for 'ima' template) */ |
148 | if (strcmp(e->template_desc->name, IMA_TEMPLATE_IMA_NAME) != 0) | 149 | if (strcmp(e->template_desc->name, IMA_TEMPLATE_IMA_NAME) == 0) |
150 | is_ima_template = true; | ||
151 | |||
152 | if (!is_ima_template) | ||
149 | ima_putc(m, &e->template_data_len, | 153 | ima_putc(m, &e->template_data_len, |
150 | sizeof(e->template_data_len)); | 154 | sizeof(e->template_data_len)); |
151 | 155 | ||
152 | /* 6th: template specific data */ | 156 | /* 6th: template specific data */ |
153 | for (i = 0; i < e->template_desc->num_fields; i++) { | 157 | for (i = 0; i < e->template_desc->num_fields; i++) { |
154 | e->template_desc->fields[i]->field_show(m, IMA_SHOW_BINARY, | 158 | enum ima_show_type show = IMA_SHOW_BINARY; |
155 | &e->template_data[i]); | 159 | struct ima_template_field *field = e->template_desc->fields[i]; |
160 | |||
161 | if (is_ima_template && strcmp(field->field_id, "d") == 0) | ||
162 | show = IMA_SHOW_BINARY_NO_FIELD_LEN; | ||
163 | field->field_show(m, show, &e->template_data[i]); | ||
156 | } | 164 | } |
157 | return 0; | 165 | return 0; |
158 | } | 166 | } |
diff --git a/security/integrity/ima/ima_init.c b/security/integrity/ima/ima_init.c index 15f34bd40abe..37122768554a 100644 --- a/security/integrity/ima/ima_init.c +++ b/security/integrity/ima/ima_init.c | |||
@@ -63,7 +63,6 @@ static void __init ima_add_boot_aggregate(void) | |||
63 | result = ima_calc_boot_aggregate(&hash.hdr); | 63 | result = ima_calc_boot_aggregate(&hash.hdr); |
64 | if (result < 0) { | 64 | if (result < 0) { |
65 | audit_cause = "hashing_error"; | 65 | audit_cause = "hashing_error"; |
66 | kfree(entry); | ||
67 | goto err_out; | 66 | goto err_out; |
68 | } | 67 | } |
69 | } | 68 | } |
@@ -76,7 +75,7 @@ static void __init ima_add_boot_aggregate(void) | |||
76 | result = ima_store_template(entry, violation, NULL, | 75 | result = ima_store_template(entry, violation, NULL, |
77 | boot_aggregate_name); | 76 | boot_aggregate_name); |
78 | if (result < 0) | 77 | if (result < 0) |
79 | kfree(entry); | 78 | ima_free_template_entry(entry); |
80 | return; | 79 | return; |
81 | err_out: | 80 | err_out: |
82 | integrity_audit_msg(AUDIT_INTEGRITY_PCR, NULL, boot_aggregate_name, op, | 81 | integrity_audit_msg(AUDIT_INTEGRITY_PCR, NULL, boot_aggregate_name, op, |
diff --git a/security/integrity/ima/ima_template.c b/security/integrity/ima/ima_template.c index 4e5da990630b..635695f6a185 100644 --- a/security/integrity/ima/ima_template.c +++ b/security/integrity/ima/ima_template.c | |||
@@ -90,7 +90,7 @@ static struct ima_template_field *lookup_template_field(const char *field_id) | |||
90 | return NULL; | 90 | return NULL; |
91 | } | 91 | } |
92 | 92 | ||
93 | static int template_fmt_size(char *template_fmt) | 93 | static int template_fmt_size(const char *template_fmt) |
94 | { | 94 | { |
95 | char c; | 95 | char c; |
96 | int template_fmt_len = strlen(template_fmt); | 96 | int template_fmt_len = strlen(template_fmt); |
@@ -106,22 +106,29 @@ static int template_fmt_size(char *template_fmt) | |||
106 | return j + 1; | 106 | return j + 1; |
107 | } | 107 | } |
108 | 108 | ||
109 | static int template_desc_init_fields(char *template_fmt, | 109 | static int template_desc_init_fields(const char *template_fmt, |
110 | struct ima_template_field ***fields, | 110 | struct ima_template_field ***fields, |
111 | int *num_fields) | 111 | int *num_fields) |
112 | { | 112 | { |
113 | char *c, *template_fmt_ptr = template_fmt; | 113 | char *c, *template_fmt_copy, *template_fmt_ptr; |
114 | int template_num_fields = template_fmt_size(template_fmt); | 114 | int template_num_fields = template_fmt_size(template_fmt); |
115 | int i, result = 0; | 115 | int i, result = 0; |
116 | 116 | ||
117 | if (template_num_fields > IMA_TEMPLATE_NUM_FIELDS_MAX) | 117 | if (template_num_fields > IMA_TEMPLATE_NUM_FIELDS_MAX) |
118 | return -EINVAL; | 118 | return -EINVAL; |
119 | 119 | ||
120 | /* copying is needed as strsep() modifies the original buffer */ | ||
121 | template_fmt_copy = kstrdup(template_fmt, GFP_KERNEL); | ||
122 | if (template_fmt_copy == NULL) | ||
123 | return -ENOMEM; | ||
124 | |||
120 | *fields = kzalloc(template_num_fields * sizeof(*fields), GFP_KERNEL); | 125 | *fields = kzalloc(template_num_fields * sizeof(*fields), GFP_KERNEL); |
121 | if (*fields == NULL) { | 126 | if (*fields == NULL) { |
122 | result = -ENOMEM; | 127 | result = -ENOMEM; |
123 | goto out; | 128 | goto out; |
124 | } | 129 | } |
130 | |||
131 | template_fmt_ptr = template_fmt_copy; | ||
125 | for (i = 0; (c = strsep(&template_fmt_ptr, "|")) != NULL && | 132 | for (i = 0; (c = strsep(&template_fmt_ptr, "|")) != NULL && |
126 | i < template_num_fields; i++) { | 133 | i < template_num_fields; i++) { |
127 | struct ima_template_field *f = lookup_template_field(c); | 134 | struct ima_template_field *f = lookup_template_field(c); |
@@ -133,10 +140,12 @@ static int template_desc_init_fields(char *template_fmt, | |||
133 | (*fields)[i] = f; | 140 | (*fields)[i] = f; |
134 | } | 141 | } |
135 | *num_fields = i; | 142 | *num_fields = i; |
136 | return 0; | ||
137 | out: | 143 | out: |
138 | kfree(*fields); | 144 | if (result < 0) { |
139 | *fields = NULL; | 145 | kfree(*fields); |
146 | *fields = NULL; | ||
147 | } | ||
148 | kfree(template_fmt_copy); | ||
140 | return result; | 149 | return result; |
141 | } | 150 | } |
142 | 151 | ||
diff --git a/security/integrity/ima/ima_template_lib.c b/security/integrity/ima/ima_template_lib.c index 6d66ad6ed265..c38adcc910fb 100644 --- a/security/integrity/ima/ima_template_lib.c +++ b/security/integrity/ima/ima_template_lib.c | |||
@@ -109,9 +109,12 @@ static void ima_show_template_data_binary(struct seq_file *m, | |||
109 | enum data_formats datafmt, | 109 | enum data_formats datafmt, |
110 | struct ima_field_data *field_data) | 110 | struct ima_field_data *field_data) |
111 | { | 111 | { |
112 | ima_putc(m, &field_data->len, sizeof(u32)); | 112 | if (show != IMA_SHOW_BINARY_NO_FIELD_LEN) |
113 | ima_putc(m, &field_data->len, sizeof(u32)); | ||
114 | |||
113 | if (!field_data->len) | 115 | if (!field_data->len) |
114 | return; | 116 | return; |
117 | |||
115 | ima_putc(m, field_data->data, field_data->len); | 118 | ima_putc(m, field_data->data, field_data->len); |
116 | } | 119 | } |
117 | 120 | ||
@@ -125,6 +128,7 @@ static void ima_show_template_field_data(struct seq_file *m, | |||
125 | ima_show_template_data_ascii(m, show, datafmt, field_data); | 128 | ima_show_template_data_ascii(m, show, datafmt, field_data); |
126 | break; | 129 | break; |
127 | case IMA_SHOW_BINARY: | 130 | case IMA_SHOW_BINARY: |
131 | case IMA_SHOW_BINARY_NO_FIELD_LEN: | ||
128 | ima_show_template_data_binary(m, show, datafmt, field_data); | 132 | ima_show_template_data_binary(m, show, datafmt, field_data); |
129 | break; | 133 | break; |
130 | default: | 134 | default: |
diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h index b9e7c133734a..2fb5e53e927f 100644 --- a/security/integrity/integrity.h +++ b/security/integrity/integrity.h | |||
@@ -137,19 +137,12 @@ static inline int integrity_digsig_verify(const unsigned int id, | |||
137 | #ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS | 137 | #ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS |
138 | int asymmetric_verify(struct key *keyring, const char *sig, | 138 | int asymmetric_verify(struct key *keyring, const char *sig, |
139 | int siglen, const char *data, int datalen); | 139 | int siglen, const char *data, int datalen); |
140 | |||
141 | int integrity_init_keyring(const unsigned int id); | ||
142 | #else | 140 | #else |
143 | static inline int asymmetric_verify(struct key *keyring, const char *sig, | 141 | static inline int asymmetric_verify(struct key *keyring, const char *sig, |
144 | int siglen, const char *data, int datalen) | 142 | int siglen, const char *data, int datalen) |
145 | { | 143 | { |
146 | return -EOPNOTSUPP; | 144 | return -EOPNOTSUPP; |
147 | } | 145 | } |
148 | |||
149 | static int integrity_init_keyring(const unsigned int id) | ||
150 | { | ||
151 | return 0; | ||
152 | } | ||
153 | #endif | 146 | #endif |
154 | 147 | ||
155 | #ifdef CONFIG_INTEGRITY_AUDIT | 148 | #ifdef CONFIG_INTEGRITY_AUDIT |
diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c index 872d59e35ee2..721d8fd45685 100644 --- a/sound/atmel/abdac.c +++ b/sound/atmel/abdac.c | |||
@@ -357,7 +357,8 @@ static int set_sample_rates(struct atmel_abdac *dac) | |||
357 | if (new_rate < 0) | 357 | if (new_rate < 0) |
358 | break; | 358 | break; |
359 | /* make sure we are below the ABDAC clock */ | 359 | /* make sure we are below the ABDAC clock */ |
360 | if (new_rate <= clk_get_rate(dac->pclk)) { | 360 | if (index < MAX_NUM_RATES && |
361 | new_rate <= clk_get_rate(dac->pclk)) { | ||
361 | dac->rates[index] = new_rate / 256; | 362 | dac->rates[index] = new_rate / 256; |
362 | index++; | 363 | index++; |
363 | } | 364 | } |
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c index d3226892ad6b..9048777228e2 100644 --- a/sound/firewire/amdtp.c +++ b/sound/firewire/amdtp.c | |||
@@ -434,17 +434,14 @@ static void queue_out_packet(struct amdtp_out_stream *s, unsigned int cycle) | |||
434 | return; | 434 | return; |
435 | index = s->packet_index; | 435 | index = s->packet_index; |
436 | 436 | ||
437 | /* this module generate empty packet for 'no data' */ | ||
437 | syt = calculate_syt(s, cycle); | 438 | syt = calculate_syt(s, cycle); |
438 | if (!(s->flags & CIP_BLOCKING)) { | 439 | if (!(s->flags & CIP_BLOCKING)) |
439 | data_blocks = calculate_data_blocks(s); | 440 | data_blocks = calculate_data_blocks(s); |
440 | } else { | 441 | else if (syt != 0xffff) |
441 | if (syt != 0xffff) { | 442 | data_blocks = s->syt_interval; |
442 | data_blocks = s->syt_interval; | 443 | else |
443 | } else { | 444 | data_blocks = 0; |
444 | data_blocks = 0; | ||
445 | syt = 0xffffff; | ||
446 | } | ||
447 | } | ||
448 | 445 | ||
449 | buffer = s->buffer.packets[index].buffer; | 446 | buffer = s->buffer.packets[index].buffer; |
450 | buffer[0] = cpu_to_be32(ACCESS_ONCE(s->source_node_id_field) | | 447 | buffer[0] = cpu_to_be32(ACCESS_ONCE(s->source_node_id_field) | |
diff --git a/sound/firewire/dice.c b/sound/firewire/dice.c index 57bcd31fcc12..c0aa64941cee 100644 --- a/sound/firewire/dice.c +++ b/sound/firewire/dice.c | |||
@@ -1019,7 +1019,7 @@ static void dice_proc_read(struct snd_info_entry *entry, | |||
1019 | 1019 | ||
1020 | if (dice_proc_read_mem(dice, &tx_rx_header, sections[2], 2) < 0) | 1020 | if (dice_proc_read_mem(dice, &tx_rx_header, sections[2], 2) < 0) |
1021 | return; | 1021 | return; |
1022 | quadlets = min_t(u32, tx_rx_header.size, sizeof(buf.tx)); | 1022 | quadlets = min_t(u32, tx_rx_header.size, sizeof(buf.tx) / 4); |
1023 | for (stream = 0; stream < tx_rx_header.number; ++stream) { | 1023 | for (stream = 0; stream < tx_rx_header.number; ++stream) { |
1024 | if (dice_proc_read_mem(dice, &buf.tx, sections[2] + 2 + | 1024 | if (dice_proc_read_mem(dice, &buf.tx, sections[2] + 2 + |
1025 | stream * tx_rx_header.size, | 1025 | stream * tx_rx_header.size, |
@@ -1045,7 +1045,7 @@ static void dice_proc_read(struct snd_info_entry *entry, | |||
1045 | 1045 | ||
1046 | if (dice_proc_read_mem(dice, &tx_rx_header, sections[4], 2) < 0) | 1046 | if (dice_proc_read_mem(dice, &tx_rx_header, sections[4], 2) < 0) |
1047 | return; | 1047 | return; |
1048 | quadlets = min_t(u32, tx_rx_header.size, sizeof(buf.rx)); | 1048 | quadlets = min_t(u32, tx_rx_header.size, sizeof(buf.rx) / 4); |
1049 | for (stream = 0; stream < tx_rx_header.number; ++stream) { | 1049 | for (stream = 0; stream < tx_rx_header.number; ++stream) { |
1050 | if (dice_proc_read_mem(dice, &buf.rx, sections[4] + 2 + | 1050 | if (dice_proc_read_mem(dice, &buf.rx, sections[4] + 2 + |
1051 | stream * tx_rx_header.size, | 1051 | stream * tx_rx_header.size, |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 77db69480c19..7aa9870040c1 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -698,7 +698,6 @@ struct hda_bus { | |||
698 | unsigned int in_reset:1; /* during reset operation */ | 698 | unsigned int in_reset:1; /* during reset operation */ |
699 | unsigned int power_keep_link_on:1; /* don't power off HDA link */ | 699 | unsigned int power_keep_link_on:1; /* don't power off HDA link */ |
700 | unsigned int no_response_fallback:1; /* don't fallback at RIRB error */ | 700 | unsigned int no_response_fallback:1; /* don't fallback at RIRB error */ |
701 | unsigned int avoid_link_reset:1; /* don't reset link at runtime PM */ | ||
702 | 701 | ||
703 | int primary_dig_out_type; /* primary digital out PCM type */ | 702 | int primary_dig_out_type; /* primary digital out PCM type */ |
704 | }; | 703 | }; |
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 3067ed4fe3b2..c4671d00babd 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -2506,12 +2506,8 @@ static int create_out_jack_modes(struct hda_codec *codec, int num_pins, | |||
2506 | 2506 | ||
2507 | for (i = 0; i < num_pins; i++) { | 2507 | for (i = 0; i < num_pins; i++) { |
2508 | hda_nid_t pin = pins[i]; | 2508 | hda_nid_t pin = pins[i]; |
2509 | if (pin == spec->hp_mic_pin) { | 2509 | if (pin == spec->hp_mic_pin) |
2510 | int ret = create_hp_mic_jack_mode(codec, pin); | ||
2511 | if (ret < 0) | ||
2512 | return ret; | ||
2513 | continue; | 2510 | continue; |
2514 | } | ||
2515 | if (get_out_jack_num_items(codec, pin) > 1) { | 2511 | if (get_out_jack_num_items(codec, pin) > 1) { |
2516 | struct snd_kcontrol_new *knew; | 2512 | struct snd_kcontrol_new *knew; |
2517 | char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; | 2513 | char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; |
@@ -2764,7 +2760,7 @@ static int hp_mic_jack_mode_put(struct snd_kcontrol *kcontrol, | |||
2764 | val &= ~(AC_PINCTL_VREFEN | PIN_HP); | 2760 | val &= ~(AC_PINCTL_VREFEN | PIN_HP); |
2765 | val |= get_vref_idx(vref_caps, idx) | PIN_IN; | 2761 | val |= get_vref_idx(vref_caps, idx) | PIN_IN; |
2766 | } else | 2762 | } else |
2767 | val = snd_hda_get_default_vref(codec, nid); | 2763 | val = snd_hda_get_default_vref(codec, nid) | PIN_IN; |
2768 | } | 2764 | } |
2769 | snd_hda_set_pin_ctl_cache(codec, nid, val); | 2765 | snd_hda_set_pin_ctl_cache(codec, nid, val); |
2770 | call_hp_automute(codec, NULL); | 2766 | call_hp_automute(codec, NULL); |
@@ -2784,9 +2780,6 @@ static int create_hp_mic_jack_mode(struct hda_codec *codec, hda_nid_t pin) | |||
2784 | struct hda_gen_spec *spec = codec->spec; | 2780 | struct hda_gen_spec *spec = codec->spec; |
2785 | struct snd_kcontrol_new *knew; | 2781 | struct snd_kcontrol_new *knew; |
2786 | 2782 | ||
2787 | if (get_out_jack_num_items(codec, pin) <= 1 && | ||
2788 | get_in_jack_num_items(codec, pin) <= 1) | ||
2789 | return 0; /* no need */ | ||
2790 | knew = snd_hda_gen_add_kctl(spec, "Headphone Mic Jack Mode", | 2783 | knew = snd_hda_gen_add_kctl(spec, "Headphone Mic Jack Mode", |
2791 | &hp_mic_jack_mode_enum); | 2784 | &hp_mic_jack_mode_enum); |
2792 | if (!knew) | 2785 | if (!knew) |
@@ -2815,6 +2808,42 @@ static int add_loopback_list(struct hda_gen_spec *spec, hda_nid_t mix, int idx) | |||
2815 | return 0; | 2808 | return 0; |
2816 | } | 2809 | } |
2817 | 2810 | ||
2811 | /* return true if either a volume or a mute amp is found for the given | ||
2812 | * aamix path; the amp has to be either in the mixer node or its direct leaf | ||
2813 | */ | ||
2814 | static bool look_for_mix_leaf_ctls(struct hda_codec *codec, hda_nid_t mix_nid, | ||
2815 | hda_nid_t pin, unsigned int *mix_val, | ||
2816 | unsigned int *mute_val) | ||
2817 | { | ||
2818 | int idx, num_conns; | ||
2819 | const hda_nid_t *list; | ||
2820 | hda_nid_t nid; | ||
2821 | |||
2822 | idx = snd_hda_get_conn_index(codec, mix_nid, pin, true); | ||
2823 | if (idx < 0) | ||
2824 | return false; | ||
2825 | |||
2826 | *mix_val = *mute_val = 0; | ||
2827 | if (nid_has_volume(codec, mix_nid, HDA_INPUT)) | ||
2828 | *mix_val = HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT); | ||
2829 | if (nid_has_mute(codec, mix_nid, HDA_INPUT)) | ||
2830 | *mute_val = HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT); | ||
2831 | if (*mix_val && *mute_val) | ||
2832 | return true; | ||
2833 | |||
2834 | /* check leaf node */ | ||
2835 | num_conns = snd_hda_get_conn_list(codec, mix_nid, &list); | ||
2836 | if (num_conns < idx) | ||
2837 | return false; | ||
2838 | nid = list[idx]; | ||
2839 | if (!*mix_val && nid_has_volume(codec, nid, HDA_OUTPUT)) | ||
2840 | *mix_val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT); | ||
2841 | if (!*mute_val && nid_has_mute(codec, nid, HDA_OUTPUT)) | ||
2842 | *mute_val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT); | ||
2843 | |||
2844 | return *mix_val || *mute_val; | ||
2845 | } | ||
2846 | |||
2818 | /* create input playback/capture controls for the given pin */ | 2847 | /* create input playback/capture controls for the given pin */ |
2819 | static int new_analog_input(struct hda_codec *codec, int input_idx, | 2848 | static int new_analog_input(struct hda_codec *codec, int input_idx, |
2820 | hda_nid_t pin, const char *ctlname, int ctlidx, | 2849 | hda_nid_t pin, const char *ctlname, int ctlidx, |
@@ -2822,12 +2851,11 @@ static int new_analog_input(struct hda_codec *codec, int input_idx, | |||
2822 | { | 2851 | { |
2823 | struct hda_gen_spec *spec = codec->spec; | 2852 | struct hda_gen_spec *spec = codec->spec; |
2824 | struct nid_path *path; | 2853 | struct nid_path *path; |
2825 | unsigned int val; | 2854 | unsigned int mix_val, mute_val; |
2826 | int err, idx; | 2855 | int err, idx; |
2827 | 2856 | ||
2828 | if (!nid_has_volume(codec, mix_nid, HDA_INPUT) && | 2857 | if (!look_for_mix_leaf_ctls(codec, mix_nid, pin, &mix_val, &mute_val)) |
2829 | !nid_has_mute(codec, mix_nid, HDA_INPUT)) | 2858 | return 0; |
2830 | return 0; /* no need for analog loopback */ | ||
2831 | 2859 | ||
2832 | path = snd_hda_add_new_path(codec, pin, mix_nid, 0); | 2860 | path = snd_hda_add_new_path(codec, pin, mix_nid, 0); |
2833 | if (!path) | 2861 | if (!path) |
@@ -2836,20 +2864,18 @@ static int new_analog_input(struct hda_codec *codec, int input_idx, | |||
2836 | spec->loopback_paths[input_idx] = snd_hda_get_path_idx(codec, path); | 2864 | spec->loopback_paths[input_idx] = snd_hda_get_path_idx(codec, path); |
2837 | 2865 | ||
2838 | idx = path->idx[path->depth - 1]; | 2866 | idx = path->idx[path->depth - 1]; |
2839 | if (nid_has_volume(codec, mix_nid, HDA_INPUT)) { | 2867 | if (mix_val) { |
2840 | val = HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT); | 2868 | err = __add_pb_vol_ctrl(spec, HDA_CTL_WIDGET_VOL, ctlname, ctlidx, mix_val); |
2841 | err = __add_pb_vol_ctrl(spec, HDA_CTL_WIDGET_VOL, ctlname, ctlidx, val); | ||
2842 | if (err < 0) | 2869 | if (err < 0) |
2843 | return err; | 2870 | return err; |
2844 | path->ctls[NID_PATH_VOL_CTL] = val; | 2871 | path->ctls[NID_PATH_VOL_CTL] = mix_val; |
2845 | } | 2872 | } |
2846 | 2873 | ||
2847 | if (nid_has_mute(codec, mix_nid, HDA_INPUT)) { | 2874 | if (mute_val) { |
2848 | val = HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT); | 2875 | err = __add_pb_sw_ctrl(spec, HDA_CTL_WIDGET_MUTE, ctlname, ctlidx, mute_val); |
2849 | err = __add_pb_sw_ctrl(spec, HDA_CTL_WIDGET_MUTE, ctlname, ctlidx, val); | ||
2850 | if (err < 0) | 2876 | if (err < 0) |
2851 | return err; | 2877 | return err; |
2852 | path->ctls[NID_PATH_MUTE_CTL] = val; | 2878 | path->ctls[NID_PATH_MUTE_CTL] = mute_val; |
2853 | } | 2879 | } |
2854 | 2880 | ||
2855 | path->active = true; | 2881 | path->active = true; |
@@ -4383,6 +4409,17 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec, | |||
4383 | if (err < 0) | 4409 | if (err < 0) |
4384 | return err; | 4410 | return err; |
4385 | 4411 | ||
4412 | /* create "Headphone Mic Jack Mode" if no input selection is | ||
4413 | * available (or user specifies add_jack_modes hint) | ||
4414 | */ | ||
4415 | if (spec->hp_mic_pin && | ||
4416 | (spec->auto_mic || spec->input_mux.num_items == 1 || | ||
4417 | spec->add_jack_modes)) { | ||
4418 | err = create_hp_mic_jack_mode(codec, spec->hp_mic_pin); | ||
4419 | if (err < 0) | ||
4420 | return err; | ||
4421 | } | ||
4422 | |||
4386 | if (spec->add_jack_modes) { | 4423 | if (spec->add_jack_modes) { |
4387 | if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { | 4424 | if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { |
4388 | err = create_out_jack_modes(codec, cfg->line_outs, | 4425 | err = create_out_jack_modes(codec, cfg->line_outs, |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 7a09404579a7..27aa14007cbd 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -2994,8 +2994,7 @@ static int azx_runtime_suspend(struct device *dev) | |||
2994 | STATESTS_INT_MASK); | 2994 | STATESTS_INT_MASK); |
2995 | 2995 | ||
2996 | azx_stop_chip(chip); | 2996 | azx_stop_chip(chip); |
2997 | if (!chip->bus->avoid_link_reset) | 2997 | azx_enter_link_reset(chip); |
2998 | azx_enter_link_reset(chip); | ||
2999 | azx_clear_irq_pending(chip); | 2998 | azx_clear_irq_pending(chip); |
3000 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) | 2999 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) |
3001 | hda_display_power(false); | 3000 | hda_display_power(false); |
@@ -3877,7 +3876,8 @@ static int azx_probe(struct pci_dev *pci, | |||
3877 | } | 3876 | } |
3878 | 3877 | ||
3879 | dev++; | 3878 | dev++; |
3880 | complete_all(&chip->probe_wait); | 3879 | if (chip->disabled) |
3880 | complete_all(&chip->probe_wait); | ||
3881 | return 0; | 3881 | return 0; |
3882 | 3882 | ||
3883 | out_free: | 3883 | out_free: |
@@ -3954,10 +3954,10 @@ static int azx_probe_continue(struct azx *chip) | |||
3954 | if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME) || chip->use_vga_switcheroo) | 3954 | if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME) || chip->use_vga_switcheroo) |
3955 | pm_runtime_put_noidle(&pci->dev); | 3955 | pm_runtime_put_noidle(&pci->dev); |
3956 | 3956 | ||
3957 | return 0; | ||
3958 | |||
3959 | out_free: | 3957 | out_free: |
3960 | chip->init_failed = 1; | 3958 | if (err < 0) |
3959 | chip->init_failed = 1; | ||
3960 | complete_all(&chip->probe_wait); | ||
3961 | return err; | 3961 | return err; |
3962 | } | 3962 | } |
3963 | 3963 | ||
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 1a83559f4cbd..cac015be3325 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -147,6 +147,8 @@ static void ad_vmaster_eapd_hook(void *private_data, int enabled) | |||
147 | 147 | ||
148 | if (!spec->eapd_nid) | 148 | if (!spec->eapd_nid) |
149 | return; | 149 | return; |
150 | if (codec->inv_eapd) | ||
151 | enabled = !enabled; | ||
150 | snd_hda_codec_update_cache(codec, spec->eapd_nid, 0, | 152 | snd_hda_codec_update_cache(codec, spec->eapd_nid, 0, |
151 | AC_VERB_SET_EAPD_BTLENABLE, | 153 | AC_VERB_SET_EAPD_BTLENABLE, |
152 | enabled ? 0x02 : 0x00); | 154 | enabled ? 0x02 : 0x00); |
@@ -359,6 +361,9 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
359 | */ | 361 | */ |
360 | spec->gen.multiout.no_share_stream = 1; | 362 | spec->gen.multiout.no_share_stream = 1; |
361 | 363 | ||
364 | /* AD1986A can't manage the dynamic pin on/off smoothly */ | ||
365 | spec->gen.auto_mute_via_amp = 1; | ||
366 | |||
362 | snd_hda_pick_fixup(codec, ad1986a_fixup_models, ad1986a_fixup_tbl, | 367 | snd_hda_pick_fixup(codec, ad1986a_fixup_models, ad1986a_fixup_tbl, |
363 | ad1986a_fixups); | 368 | ad1986a_fixups); |
364 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | 369 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
@@ -962,6 +967,7 @@ static void ad1884_fixup_hp_eapd(struct hda_codec *codec, | |||
962 | switch (action) { | 967 | switch (action) { |
963 | case HDA_FIXUP_ACT_PRE_PROBE: | 968 | case HDA_FIXUP_ACT_PRE_PROBE: |
964 | spec->gen.vmaster_mute.hook = ad1884_vmaster_hp_gpio_hook; | 969 | spec->gen.vmaster_mute.hook = ad1884_vmaster_hp_gpio_hook; |
970 | spec->gen.own_eapd_ctl = 1; | ||
965 | snd_hda_sequence_write_cache(codec, gpio_init_verbs); | 971 | snd_hda_sequence_write_cache(codec, gpio_init_verbs); |
966 | break; | 972 | break; |
967 | case HDA_FIXUP_ACT_PROBE: | 973 | case HDA_FIXUP_ACT_PROBE: |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index c205bb1747fd..1f2717f817a0 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -3244,9 +3244,29 @@ enum { | |||
3244 | #if IS_ENABLED(CONFIG_THINKPAD_ACPI) | 3244 | #if IS_ENABLED(CONFIG_THINKPAD_ACPI) |
3245 | 3245 | ||
3246 | #include <linux/thinkpad_acpi.h> | 3246 | #include <linux/thinkpad_acpi.h> |
3247 | #include <acpi/acpi.h> | ||
3247 | 3248 | ||
3248 | static int (*led_set_func)(int, bool); | 3249 | static int (*led_set_func)(int, bool); |
3249 | 3250 | ||
3251 | static acpi_status acpi_check_cb(acpi_handle handle, u32 lvl, void *context, | ||
3252 | void **rv) | ||
3253 | { | ||
3254 | bool *found = context; | ||
3255 | *found = true; | ||
3256 | return AE_OK; | ||
3257 | } | ||
3258 | |||
3259 | static bool is_thinkpad(struct hda_codec *codec) | ||
3260 | { | ||
3261 | bool found = false; | ||
3262 | if (codec->subsystem_id >> 16 != 0x17aa) | ||
3263 | return false; | ||
3264 | if (ACPI_SUCCESS(acpi_get_devices("LEN0068", acpi_check_cb, &found, NULL)) && found) | ||
3265 | return true; | ||
3266 | found = false; | ||
3267 | return ACPI_SUCCESS(acpi_get_devices("IBM0068", acpi_check_cb, &found, NULL)) && found; | ||
3268 | } | ||
3269 | |||
3250 | static void update_tpacpi_mute_led(void *private_data, int enabled) | 3270 | static void update_tpacpi_mute_led(void *private_data, int enabled) |
3251 | { | 3271 | { |
3252 | struct hda_codec *codec = private_data; | 3272 | struct hda_codec *codec = private_data; |
@@ -3279,6 +3299,8 @@ static void cxt_fixup_thinkpad_acpi(struct hda_codec *codec, | |||
3279 | bool removefunc = false; | 3299 | bool removefunc = false; |
3280 | 3300 | ||
3281 | if (action == HDA_FIXUP_ACT_PROBE) { | 3301 | if (action == HDA_FIXUP_ACT_PROBE) { |
3302 | if (!is_thinkpad(codec)) | ||
3303 | return; | ||
3282 | if (!led_set_func) | 3304 | if (!led_set_func) |
3283 | led_set_func = symbol_request(tpacpi_led_set); | 3305 | led_set_func = symbol_request(tpacpi_led_set); |
3284 | if (!led_set_func) { | 3306 | if (!led_set_func) { |
@@ -3494,6 +3516,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = { | |||
3494 | SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC), | 3516 | SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC), |
3495 | SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC), | 3517 | SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC), |
3496 | SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC), | 3518 | SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC), |
3519 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI), | ||
3497 | SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004), | 3520 | SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004), |
3498 | SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205), | 3521 | SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205), |
3499 | {} | 3522 | {} |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 08407bed093e..c4a66ef6cf6f 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -1142,32 +1142,34 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, | |||
1142 | 1142 | ||
1143 | static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll); | 1143 | static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll); |
1144 | 1144 | ||
1145 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | 1145 | static void jack_callback(struct hda_codec *codec, struct hda_jack_tbl *jack) |
1146 | { | 1146 | { |
1147 | struct hdmi_spec *spec = codec->spec; | 1147 | struct hdmi_spec *spec = codec->spec; |
1148 | int pin_idx = pin_nid_to_pin_index(spec, jack->nid); | ||
1149 | if (pin_idx < 0) | ||
1150 | return; | ||
1151 | |||
1152 | if (hdmi_present_sense(get_pin(spec, pin_idx), 1)) | ||
1153 | snd_hda_jack_report_sync(codec); | ||
1154 | } | ||
1155 | |||
1156 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | ||
1157 | { | ||
1148 | int tag = res >> AC_UNSOL_RES_TAG_SHIFT; | 1158 | int tag = res >> AC_UNSOL_RES_TAG_SHIFT; |
1149 | int pin_nid; | ||
1150 | int pin_idx; | ||
1151 | struct hda_jack_tbl *jack; | 1159 | struct hda_jack_tbl *jack; |
1152 | int dev_entry = (res & AC_UNSOL_RES_DE) >> AC_UNSOL_RES_DE_SHIFT; | 1160 | int dev_entry = (res & AC_UNSOL_RES_DE) >> AC_UNSOL_RES_DE_SHIFT; |
1153 | 1161 | ||
1154 | jack = snd_hda_jack_tbl_get_from_tag(codec, tag); | 1162 | jack = snd_hda_jack_tbl_get_from_tag(codec, tag); |
1155 | if (!jack) | 1163 | if (!jack) |
1156 | return; | 1164 | return; |
1157 | pin_nid = jack->nid; | ||
1158 | jack->jack_dirty = 1; | 1165 | jack->jack_dirty = 1; |
1159 | 1166 | ||
1160 | _snd_printd(SND_PR_VERBOSE, | 1167 | _snd_printd(SND_PR_VERBOSE, |
1161 | "HDMI hot plug event: Codec=%d Pin=%d Device=%d Inactive=%d Presence_Detect=%d ELD_Valid=%d\n", | 1168 | "HDMI hot plug event: Codec=%d Pin=%d Device=%d Inactive=%d Presence_Detect=%d ELD_Valid=%d\n", |
1162 | codec->addr, pin_nid, dev_entry, !!(res & AC_UNSOL_RES_IA), | 1169 | codec->addr, jack->nid, dev_entry, !!(res & AC_UNSOL_RES_IA), |
1163 | !!(res & AC_UNSOL_RES_PD), !!(res & AC_UNSOL_RES_ELDV)); | 1170 | !!(res & AC_UNSOL_RES_PD), !!(res & AC_UNSOL_RES_ELDV)); |
1164 | 1171 | ||
1165 | pin_idx = pin_nid_to_pin_index(spec, pin_nid); | 1172 | jack_callback(codec, jack); |
1166 | if (pin_idx < 0) | ||
1167 | return; | ||
1168 | |||
1169 | if (hdmi_present_sense(get_pin(spec, pin_idx), 1)) | ||
1170 | snd_hda_jack_report_sync(codec); | ||
1171 | } | 1173 | } |
1172 | 1174 | ||
1173 | static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) | 1175 | static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) |
@@ -2095,7 +2097,8 @@ static int generic_hdmi_init(struct hda_codec *codec) | |||
2095 | hda_nid_t pin_nid = per_pin->pin_nid; | 2097 | hda_nid_t pin_nid = per_pin->pin_nid; |
2096 | 2098 | ||
2097 | hdmi_init_pin(codec, pin_nid); | 2099 | hdmi_init_pin(codec, pin_nid); |
2098 | snd_hda_jack_detect_enable(codec, pin_nid, pin_nid); | 2100 | snd_hda_jack_detect_enable_callback(codec, pin_nid, pin_nid, |
2101 | codec->jackpoll_interval > 0 ? jack_callback : NULL); | ||
2099 | } | 2102 | } |
2100 | return 0; | 2103 | return 0; |
2101 | } | 2104 | } |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 5e42059f10a1..c5ea483d7559 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1780,8 +1780,11 @@ enum { | |||
1780 | ALC889_FIXUP_DAC_ROUTE, | 1780 | ALC889_FIXUP_DAC_ROUTE, |
1781 | ALC889_FIXUP_MBP_VREF, | 1781 | ALC889_FIXUP_MBP_VREF, |
1782 | ALC889_FIXUP_IMAC91_VREF, | 1782 | ALC889_FIXUP_IMAC91_VREF, |
1783 | ALC889_FIXUP_MBA21_VREF, | ||
1783 | ALC882_FIXUP_INV_DMIC, | 1784 | ALC882_FIXUP_INV_DMIC, |
1784 | ALC882_FIXUP_NO_PRIMARY_HP, | 1785 | ALC882_FIXUP_NO_PRIMARY_HP, |
1786 | ALC887_FIXUP_ASUS_BASS, | ||
1787 | ALC887_FIXUP_BASS_CHMAP, | ||
1785 | }; | 1788 | }; |
1786 | 1789 | ||
1787 | static void alc889_fixup_coef(struct hda_codec *codec, | 1790 | static void alc889_fixup_coef(struct hda_codec *codec, |
@@ -1882,17 +1885,13 @@ static void alc889_fixup_mbp_vref(struct hda_codec *codec, | |||
1882 | } | 1885 | } |
1883 | } | 1886 | } |
1884 | 1887 | ||
1885 | /* Set VREF on speaker pins on imac91 */ | 1888 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
1886 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, | 1889 | const hda_nid_t *nids, int num_nids) |
1887 | const struct hda_fixup *fix, int action) | ||
1888 | { | 1890 | { |
1889 | struct alc_spec *spec = codec->spec; | 1891 | struct alc_spec *spec = codec->spec; |
1890 | static hda_nid_t nids[2] = { 0x18, 0x1a }; | ||
1891 | int i; | 1892 | int i; |
1892 | 1893 | ||
1893 | if (action != HDA_FIXUP_ACT_INIT) | 1894 | for (i = 0; i < num_nids; i++) { |
1894 | return; | ||
1895 | for (i = 0; i < ARRAY_SIZE(nids); i++) { | ||
1896 | unsigned int val; | 1895 | unsigned int val; |
1897 | val = snd_hda_codec_get_pin_target(codec, nids[i]); | 1896 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
1898 | val |= AC_PINCTL_VREF_50; | 1897 | val |= AC_PINCTL_VREF_50; |
@@ -1901,6 +1900,26 @@ static void alc889_fixup_imac91_vref(struct hda_codec *codec, | |||
1901 | spec->gen.keep_vref_in_automute = 1; | 1900 | spec->gen.keep_vref_in_automute = 1; |
1902 | } | 1901 | } |
1903 | 1902 | ||
1903 | /* Set VREF on speaker pins on imac91 */ | ||
1904 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, | ||
1905 | const struct hda_fixup *fix, int action) | ||
1906 | { | ||
1907 | static hda_nid_t nids[2] = { 0x18, 0x1a }; | ||
1908 | |||
1909 | if (action == HDA_FIXUP_ACT_INIT) | ||
1910 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | ||
1911 | } | ||
1912 | |||
1913 | /* Set VREF on speaker pins on mba21 */ | ||
1914 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, | ||
1915 | const struct hda_fixup *fix, int action) | ||
1916 | { | ||
1917 | static hda_nid_t nids[2] = { 0x18, 0x19 }; | ||
1918 | |||
1919 | if (action == HDA_FIXUP_ACT_INIT) | ||
1920 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | ||
1921 | } | ||
1922 | |||
1904 | /* Don't take HP output as primary | 1923 | /* Don't take HP output as primary |
1905 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio | 1924 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
1906 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 | 1925 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 |
@@ -1915,6 +1934,9 @@ static void alc882_fixup_no_primary_hp(struct hda_codec *codec, | |||
1915 | } | 1934 | } |
1916 | } | 1935 | } |
1917 | 1936 | ||
1937 | static void alc_fixup_bass_chmap(struct hda_codec *codec, | ||
1938 | const struct hda_fixup *fix, int action); | ||
1939 | |||
1918 | static const struct hda_fixup alc882_fixups[] = { | 1940 | static const struct hda_fixup alc882_fixups[] = { |
1919 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { | 1941 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
1920 | .type = HDA_FIXUP_PINS, | 1942 | .type = HDA_FIXUP_PINS, |
@@ -2097,6 +2119,12 @@ static const struct hda_fixup alc882_fixups[] = { | |||
2097 | .chained = true, | 2119 | .chained = true, |
2098 | .chain_id = ALC882_FIXUP_GPIO1, | 2120 | .chain_id = ALC882_FIXUP_GPIO1, |
2099 | }, | 2121 | }, |
2122 | [ALC889_FIXUP_MBA21_VREF] = { | ||
2123 | .type = HDA_FIXUP_FUNC, | ||
2124 | .v.func = alc889_fixup_mba21_vref, | ||
2125 | .chained = true, | ||
2126 | .chain_id = ALC889_FIXUP_MBP_VREF, | ||
2127 | }, | ||
2100 | [ALC882_FIXUP_INV_DMIC] = { | 2128 | [ALC882_FIXUP_INV_DMIC] = { |
2101 | .type = HDA_FIXUP_FUNC, | 2129 | .type = HDA_FIXUP_FUNC, |
2102 | .v.func = alc_fixup_inv_dmic_0x12, | 2130 | .v.func = alc_fixup_inv_dmic_0x12, |
@@ -2105,6 +2133,19 @@ static const struct hda_fixup alc882_fixups[] = { | |||
2105 | .type = HDA_FIXUP_FUNC, | 2133 | .type = HDA_FIXUP_FUNC, |
2106 | .v.func = alc882_fixup_no_primary_hp, | 2134 | .v.func = alc882_fixup_no_primary_hp, |
2107 | }, | 2135 | }, |
2136 | [ALC887_FIXUP_ASUS_BASS] = { | ||
2137 | .type = HDA_FIXUP_PINS, | ||
2138 | .v.pins = (const struct hda_pintbl[]) { | ||
2139 | {0x16, 0x99130130}, /* bass speaker */ | ||
2140 | {} | ||
2141 | }, | ||
2142 | .chained = true, | ||
2143 | .chain_id = ALC887_FIXUP_BASS_CHMAP, | ||
2144 | }, | ||
2145 | [ALC887_FIXUP_BASS_CHMAP] = { | ||
2146 | .type = HDA_FIXUP_FUNC, | ||
2147 | .v.func = alc_fixup_bass_chmap, | ||
2148 | }, | ||
2108 | }; | 2149 | }; |
2109 | 2150 | ||
2110 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { | 2151 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
@@ -2138,6 +2179,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { | |||
2138 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), | 2179 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
2139 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), | 2180 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
2140 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), | 2181 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
2182 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), | ||
2141 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), | 2183 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
2142 | SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), | 2184 | SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), |
2143 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), | 2185 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
@@ -2153,7 +2195,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { | |||
2153 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), | 2195 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), |
2154 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), | 2196 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
2155 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBP_VREF), | 2197 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBP_VREF), |
2156 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBP_VREF), | 2198 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
2157 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), | 2199 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
2158 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), | 2200 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
2159 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), | 2201 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
@@ -3268,6 +3310,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) | |||
3268 | alc_write_coef_idx(codec, 0x18, 0x7388); | 3310 | alc_write_coef_idx(codec, 0x18, 0x7388); |
3269 | break; | 3311 | break; |
3270 | case 0x10ec0668: | 3312 | case 0x10ec0668: |
3313 | alc_write_coef_idx(codec, 0x11, 0x0001); | ||
3271 | alc_write_coef_idx(codec, 0x15, 0x0d60); | 3314 | alc_write_coef_idx(codec, 0x15, 0x0d60); |
3272 | alc_write_coef_idx(codec, 0xc3, 0x0000); | 3315 | alc_write_coef_idx(codec, 0xc3, 0x0000); |
3273 | break; | 3316 | break; |
@@ -3296,6 +3339,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) | |||
3296 | alc_write_coef_idx(codec, 0x18, 0x7388); | 3339 | alc_write_coef_idx(codec, 0x18, 0x7388); |
3297 | break; | 3340 | break; |
3298 | case 0x10ec0668: | 3341 | case 0x10ec0668: |
3342 | alc_write_coef_idx(codec, 0x11, 0x0001); | ||
3299 | alc_write_coef_idx(codec, 0x15, 0x0d50); | 3343 | alc_write_coef_idx(codec, 0x15, 0x0d50); |
3300 | alc_write_coef_idx(codec, 0xc3, 0x0000); | 3344 | alc_write_coef_idx(codec, 0xc3, 0x0000); |
3301 | break; | 3345 | break; |
@@ -3581,11 +3625,6 @@ static void alc283_hp_automute_hook(struct hda_codec *codec, | |||
3581 | vref); | 3625 | vref); |
3582 | } | 3626 | } |
3583 | 3627 | ||
3584 | static void alc283_chromebook_caps(struct hda_codec *codec) | ||
3585 | { | ||
3586 | snd_hda_override_wcaps(codec, 0x03, 0); | ||
3587 | } | ||
3588 | |||
3589 | static void alc283_fixup_chromebook(struct hda_codec *codec, | 3628 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
3590 | const struct hda_fixup *fix, int action) | 3629 | const struct hda_fixup *fix, int action) |
3591 | { | 3630 | { |
@@ -3594,9 +3633,26 @@ static void alc283_fixup_chromebook(struct hda_codec *codec, | |||
3594 | 3633 | ||
3595 | switch (action) { | 3634 | switch (action) { |
3596 | case HDA_FIXUP_ACT_PRE_PROBE: | 3635 | case HDA_FIXUP_ACT_PRE_PROBE: |
3597 | alc283_chromebook_caps(codec); | 3636 | snd_hda_override_wcaps(codec, 0x03, 0); |
3598 | /* Disable AA-loopback as it causes white noise */ | 3637 | /* Disable AA-loopback as it causes white noise */ |
3599 | spec->gen.mixer_nid = 0; | 3638 | spec->gen.mixer_nid = 0; |
3639 | break; | ||
3640 | case HDA_FIXUP_ACT_INIT: | ||
3641 | /* Enable Line1 input control by verb */ | ||
3642 | val = alc_read_coef_idx(codec, 0x1a); | ||
3643 | alc_write_coef_idx(codec, 0x1a, val | (1 << 4)); | ||
3644 | break; | ||
3645 | } | ||
3646 | } | ||
3647 | |||
3648 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, | ||
3649 | const struct hda_fixup *fix, int action) | ||
3650 | { | ||
3651 | struct alc_spec *spec = codec->spec; | ||
3652 | int val; | ||
3653 | |||
3654 | switch (action) { | ||
3655 | case HDA_FIXUP_ACT_PRE_PROBE: | ||
3600 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; | 3656 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
3601 | break; | 3657 | break; |
3602 | case HDA_FIXUP_ACT_INIT: | 3658 | case HDA_FIXUP_ACT_INIT: |
@@ -3604,9 +3660,6 @@ static void alc283_fixup_chromebook(struct hda_codec *codec, | |||
3604 | /* Set to manual mode */ | 3660 | /* Set to manual mode */ |
3605 | val = alc_read_coef_idx(codec, 0x06); | 3661 | val = alc_read_coef_idx(codec, 0x06); |
3606 | alc_write_coef_idx(codec, 0x06, val & ~0x000c); | 3662 | alc_write_coef_idx(codec, 0x06, val & ~0x000c); |
3607 | /* Enable Line1 input control by verb */ | ||
3608 | val = alc_read_coef_idx(codec, 0x1a); | ||
3609 | alc_write_coef_idx(codec, 0x1a, val | (1 << 4)); | ||
3610 | break; | 3663 | break; |
3611 | } | 3664 | } |
3612 | } | 3665 | } |
@@ -3798,9 +3851,11 @@ enum { | |||
3798 | ALC271_FIXUP_HP_GATE_MIC_JACK, | 3851 | ALC271_FIXUP_HP_GATE_MIC_JACK, |
3799 | ALC269_FIXUP_ACER_AC700, | 3852 | ALC269_FIXUP_ACER_AC700, |
3800 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, | 3853 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
3854 | ALC269VB_FIXUP_ASUS_ZENBOOK, | ||
3801 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, | 3855 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
3802 | ALC269VB_FIXUP_ORDISSIMO_EVE2, | 3856 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
3803 | ALC283_FIXUP_CHROME_BOOK, | 3857 | ALC283_FIXUP_CHROME_BOOK, |
3858 | ALC283_FIXUP_SENSE_COMBO_JACK, | ||
3804 | ALC282_FIXUP_ASUS_TX300, | 3859 | ALC282_FIXUP_ASUS_TX300, |
3805 | ALC283_FIXUP_INT_MIC, | 3860 | ALC283_FIXUP_INT_MIC, |
3806 | ALC290_FIXUP_MONO_SPEAKERS, | 3861 | ALC290_FIXUP_MONO_SPEAKERS, |
@@ -4075,6 +4130,12 @@ static const struct hda_fixup alc269_fixups[] = { | |||
4075 | .chained = true, | 4130 | .chained = true, |
4076 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | 4131 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
4077 | }, | 4132 | }, |
4133 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { | ||
4134 | .type = HDA_FIXUP_FUNC, | ||
4135 | .v.func = alc269_fixup_limit_int_mic_boost, | ||
4136 | .chained = true, | ||
4137 | .chain_id = ALC269VB_FIXUP_DMIC, | ||
4138 | }, | ||
4078 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { | 4139 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
4079 | .type = HDA_FIXUP_FUNC, | 4140 | .type = HDA_FIXUP_FUNC, |
4080 | .v.func = alc269_fixup_limit_int_mic_boost, | 4141 | .v.func = alc269_fixup_limit_int_mic_boost, |
@@ -4094,6 +4155,12 @@ static const struct hda_fixup alc269_fixups[] = { | |||
4094 | .type = HDA_FIXUP_FUNC, | 4155 | .type = HDA_FIXUP_FUNC, |
4095 | .v.func = alc283_fixup_chromebook, | 4156 | .v.func = alc283_fixup_chromebook, |
4096 | }, | 4157 | }, |
4158 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { | ||
4159 | .type = HDA_FIXUP_FUNC, | ||
4160 | .v.func = alc283_fixup_sense_combo_jack, | ||
4161 | .chained = true, | ||
4162 | .chain_id = ALC283_FIXUP_CHROME_BOOK, | ||
4163 | }, | ||
4097 | [ALC282_FIXUP_ASUS_TX300] = { | 4164 | [ALC282_FIXUP_ASUS_TX300] = { |
4098 | .type = HDA_FIXUP_FUNC, | 4165 | .type = HDA_FIXUP_FUNC, |
4099 | .v.func = alc282_fixup_asus_tx300, | 4166 | .v.func = alc282_fixup_asus_tx300, |
@@ -4176,6 +4243,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
4176 | SND_PCI_QUIRK(0x1028, 0x0614, "Dell Inspiron 3135", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | 4243 | SND_PCI_QUIRK(0x1028, 0x0614, "Dell Inspiron 3135", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
4177 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_MONO_SPEAKERS), | 4244 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_MONO_SPEAKERS), |
4178 | SND_PCI_QUIRK(0x1028, 0x061f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), | 4245 | SND_PCI_QUIRK(0x1028, 0x061f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
4246 | SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS), | ||
4179 | SND_PCI_QUIRK(0x1028, 0x063f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), | 4247 | SND_PCI_QUIRK(0x1028, 0x063f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
4180 | SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), | 4248 | SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), |
4181 | SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), | 4249 | SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), |
@@ -4184,13 +4252,12 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
4184 | SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 4252 | SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
4185 | SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 4253 | SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
4186 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), | 4254 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
4187 | SND_PCI_QUIRK(0x103c, 0x21ed, "HP Falco Chromebook", ALC283_FIXUP_CHROME_BOOK), | ||
4188 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), | 4255 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
4189 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), | 4256 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
4190 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 4257 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
4191 | SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 4258 | SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
4192 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC), | 4259 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
4193 | SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC), | 4260 | SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK), |
4194 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), | 4261 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
4195 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), | 4262 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
4196 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), | 4263 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
@@ -4292,6 +4359,8 @@ static const struct hda_model_fixup alc269_fixup_models[] = { | |||
4292 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, | 4359 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
4293 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, | 4360 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
4294 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, | 4361 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, |
4362 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-chrome"}, | ||
4363 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, | ||
4295 | {} | 4364 | {} |
4296 | }; | 4365 | }; |
4297 | 4366 | ||
@@ -4467,6 +4536,7 @@ enum { | |||
4467 | ALC861_FIXUP_AMP_VREF_0F, | 4536 | ALC861_FIXUP_AMP_VREF_0F, |
4468 | ALC861_FIXUP_NO_JACK_DETECT, | 4537 | ALC861_FIXUP_NO_JACK_DETECT, |
4469 | ALC861_FIXUP_ASUS_A6RP, | 4538 | ALC861_FIXUP_ASUS_A6RP, |
4539 | ALC660_FIXUP_ASUS_W7J, | ||
4470 | }; | 4540 | }; |
4471 | 4541 | ||
4472 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ | 4542 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
@@ -4516,10 +4586,22 @@ static const struct hda_fixup alc861_fixups[] = { | |||
4516 | .v.func = alc861_fixup_asus_amp_vref_0f, | 4586 | .v.func = alc861_fixup_asus_amp_vref_0f, |
4517 | .chained = true, | 4587 | .chained = true, |
4518 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, | 4588 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, |
4589 | }, | ||
4590 | [ALC660_FIXUP_ASUS_W7J] = { | ||
4591 | .type = HDA_FIXUP_VERBS, | ||
4592 | .v.verbs = (const struct hda_verb[]) { | ||
4593 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 | ||
4594 | * for enabling outputs | ||
4595 | */ | ||
4596 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, | ||
4597 | { } | ||
4598 | }, | ||
4519 | } | 4599 | } |
4520 | }; | 4600 | }; |
4521 | 4601 | ||
4522 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { | 4602 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
4603 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), | ||
4604 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), | ||
4523 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), | 4605 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
4524 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), | 4606 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), |
4525 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), | 4607 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), |
@@ -4715,7 +4797,7 @@ static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { | |||
4715 | }; | 4797 | }; |
4716 | 4798 | ||
4717 | /* override the 2.1 chmap */ | 4799 | /* override the 2.1 chmap */ |
4718 | static void alc662_fixup_bass_chmap(struct hda_codec *codec, | 4800 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
4719 | const struct hda_fixup *fix, int action) | 4801 | const struct hda_fixup *fix, int action) |
4720 | { | 4802 | { |
4721 | if (action == HDA_FIXUP_ACT_BUILD) { | 4803 | if (action == HDA_FIXUP_ACT_BUILD) { |
@@ -4923,7 +5005,7 @@ static const struct hda_fixup alc662_fixups[] = { | |||
4923 | }, | 5005 | }, |
4924 | [ALC662_FIXUP_BASS_CHMAP] = { | 5006 | [ALC662_FIXUP_BASS_CHMAP] = { |
4925 | .type = HDA_FIXUP_FUNC, | 5007 | .type = HDA_FIXUP_FUNC, |
4926 | .v.func = alc662_fixup_bass_chmap, | 5008 | .v.func = alc_fixup_bass_chmap, |
4927 | .chained = true, | 5009 | .chained = true, |
4928 | .chain_id = ALC662_FIXUP_ASUS_MODE4 | 5010 | .chain_id = ALC662_FIXUP_ASUS_MODE4 |
4929 | }, | 5011 | }, |
@@ -4936,7 +5018,7 @@ static const struct hda_fixup alc662_fixups[] = { | |||
4936 | }, | 5018 | }, |
4937 | [ALC662_FIXUP_BASS_1A_CHMAP] = { | 5019 | [ALC662_FIXUP_BASS_1A_CHMAP] = { |
4938 | .type = HDA_FIXUP_FUNC, | 5020 | .type = HDA_FIXUP_FUNC, |
4939 | .v.func = alc662_fixup_bass_chmap, | 5021 | .v.func = alc_fixup_bass_chmap, |
4940 | .chained = true, | 5022 | .chained = true, |
4941 | .chain_id = ALC662_FIXUP_BASS_1A, | 5023 | .chain_id = ALC662_FIXUP_BASS_1A, |
4942 | }, | 5024 | }, |
@@ -5118,6 +5200,7 @@ static int patch_alc662(struct hda_codec *codec) | |||
5118 | case 0x10ec0272: | 5200 | case 0x10ec0272: |
5119 | case 0x10ec0663: | 5201 | case 0x10ec0663: |
5120 | case 0x10ec0665: | 5202 | case 0x10ec0665: |
5203 | case 0x10ec0668: | ||
5121 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | 5204 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
5122 | break; | 5205 | break; |
5123 | case 0x10ec0273: | 5206 | case 0x10ec0273: |
@@ -5175,6 +5258,7 @@ static int patch_alc680(struct hda_codec *codec) | |||
5175 | */ | 5258 | */ |
5176 | static const struct hda_codec_preset snd_hda_preset_realtek[] = { | 5259 | static const struct hda_codec_preset snd_hda_preset_realtek[] = { |
5177 | { .id = 0x10ec0221, .name = "ALC221", .patch = patch_alc269 }, | 5260 | { .id = 0x10ec0221, .name = "ALC221", .patch = patch_alc269 }, |
5261 | { .id = 0x10ec0231, .name = "ALC231", .patch = patch_alc269 }, | ||
5178 | { .id = 0x10ec0233, .name = "ALC233", .patch = patch_alc269 }, | 5262 | { .id = 0x10ec0233, .name = "ALC233", .patch = patch_alc269 }, |
5179 | { .id = 0x10ec0255, .name = "ALC255", .patch = patch_alc269 }, | 5263 | { .id = 0x10ec0255, .name = "ALC255", .patch = patch_alc269 }, |
5180 | { .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 }, | 5264 | { .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 }, |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index d2cc0041d9d3..088a5afbd1b9 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -2094,7 +2094,8 @@ static void stac92hd83xxx_fixup_hp_mic_led(struct hda_codec *codec, | |||
2094 | 2094 | ||
2095 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | 2095 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
2096 | spec->mic_mute_led_gpio = 0x08; /* GPIO3 */ | 2096 | spec->mic_mute_led_gpio = 0x08; /* GPIO3 */ |
2097 | codec->bus->avoid_link_reset = 1; | 2097 | /* resetting controller clears GPIO, so we need to keep on */ |
2098 | codec->bus->power_keep_link_on = 1; | ||
2098 | } | 2099 | } |
2099 | } | 2100 | } |
2100 | 2101 | ||
diff --git a/sound/soc/atmel/sam9x5_wm8731.c b/sound/soc/atmel/sam9x5_wm8731.c index 992ae38d5a15..1b372283bd01 100644 --- a/sound/soc/atmel/sam9x5_wm8731.c +++ b/sound/soc/atmel/sam9x5_wm8731.c | |||
@@ -97,6 +97,8 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev) | |||
97 | goto out; | 97 | goto out; |
98 | } | 98 | } |
99 | 99 | ||
100 | snd_soc_card_set_drvdata(card, priv); | ||
101 | |||
100 | card->dev = &pdev->dev; | 102 | card->dev = &pdev->dev; |
101 | card->owner = THIS_MODULE; | 103 | card->owner = THIS_MODULE; |
102 | card->dai_link = dai; | 104 | card->dai_link = dai; |
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index c3c7396a6181..99b359e19d35 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c | |||
@@ -248,19 +248,6 @@ ARIZONA_MIXER_CONTROLS("SPKDAT1R", ARIZONA_OUT5RMIX_INPUT_1_SOURCE), | |||
248 | ARIZONA_MIXER_CONTROLS("SPKDAT2L", ARIZONA_OUT6LMIX_INPUT_1_SOURCE), | 248 | ARIZONA_MIXER_CONTROLS("SPKDAT2L", ARIZONA_OUT6LMIX_INPUT_1_SOURCE), |
249 | ARIZONA_MIXER_CONTROLS("SPKDAT2R", ARIZONA_OUT6RMIX_INPUT_1_SOURCE), | 249 | ARIZONA_MIXER_CONTROLS("SPKDAT2R", ARIZONA_OUT6RMIX_INPUT_1_SOURCE), |
250 | 250 | ||
251 | SOC_SINGLE("HPOUT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_1L, | ||
252 | ARIZONA_OUT1_OSR_SHIFT, 1, 0), | ||
253 | SOC_SINGLE("HPOUT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_2L, | ||
254 | ARIZONA_OUT2_OSR_SHIFT, 1, 0), | ||
255 | SOC_SINGLE("HPOUT3 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_3L, | ||
256 | ARIZONA_OUT3_OSR_SHIFT, 1, 0), | ||
257 | SOC_SINGLE("Speaker High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_4L, | ||
258 | ARIZONA_OUT4_OSR_SHIFT, 1, 0), | ||
259 | SOC_SINGLE("SPKDAT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_5L, | ||
260 | ARIZONA_OUT5_OSR_SHIFT, 1, 0), | ||
261 | SOC_SINGLE("SPKDAT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_6L, | ||
262 | ARIZONA_OUT6_OSR_SHIFT, 1, 0), | ||
263 | |||
264 | SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L, | 251 | SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L, |
265 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1), | 252 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1), |
266 | SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L, | 253 | SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L, |
@@ -293,18 +280,6 @@ SOC_DOUBLE_R_TLV("SPKDAT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_6L, | |||
293 | ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_VOL_SHIFT, | 280 | ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_VOL_SHIFT, |
294 | 0xbf, 0, digital_tlv), | 281 | 0xbf, 0, digital_tlv), |
295 | 282 | ||
296 | SOC_DOUBLE_R_RANGE_TLV("HPOUT1 Volume", ARIZONA_OUTPUT_PATH_CONFIG_1L, | ||
297 | ARIZONA_OUTPUT_PATH_CONFIG_1R, | ||
298 | ARIZONA_OUT1L_PGA_VOL_SHIFT, | ||
299 | 0x34, 0x40, 0, ana_tlv), | ||
300 | SOC_DOUBLE_R_RANGE_TLV("HPOUT2 Volume", ARIZONA_OUTPUT_PATH_CONFIG_2L, | ||
301 | ARIZONA_OUTPUT_PATH_CONFIG_2R, | ||
302 | ARIZONA_OUT2L_PGA_VOL_SHIFT, | ||
303 | 0x34, 0x40, 0, ana_tlv), | ||
304 | SOC_DOUBLE_R_RANGE_TLV("HPOUT3 Volume", ARIZONA_OUTPUT_PATH_CONFIG_3L, | ||
305 | ARIZONA_OUTPUT_PATH_CONFIG_3R, | ||
306 | ARIZONA_OUT3L_PGA_VOL_SHIFT, 0x34, 0x40, 0, ana_tlv), | ||
307 | |||
308 | SOC_DOUBLE("SPKDAT1 Switch", ARIZONA_PDM_SPK1_CTRL_1, ARIZONA_SPK1L_MUTE_SHIFT, | 283 | SOC_DOUBLE("SPKDAT1 Switch", ARIZONA_PDM_SPK1_CTRL_1, ARIZONA_SPK1L_MUTE_SHIFT, |
309 | ARIZONA_SPK1R_MUTE_SHIFT, 1, 1), | 284 | ARIZONA_SPK1R_MUTE_SHIFT, 1, 1), |
310 | SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT, | 285 | SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT, |
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 456bb8c6d759..bc7472c968e3 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
@@ -447,10 +447,10 @@ static int wm8731_set_dai_fmt(struct snd_soc_dai *codec_dai, | |||
447 | iface |= 0x0001; | 447 | iface |= 0x0001; |
448 | break; | 448 | break; |
449 | case SND_SOC_DAIFMT_DSP_A: | 449 | case SND_SOC_DAIFMT_DSP_A: |
450 | iface |= 0x0003; | 450 | iface |= 0x0013; |
451 | break; | 451 | break; |
452 | case SND_SOC_DAIFMT_DSP_B: | 452 | case SND_SOC_DAIFMT_DSP_B: |
453 | iface |= 0x0013; | 453 | iface |= 0x0003; |
454 | break; | 454 | break; |
455 | default: | 455 | default: |
456 | return -EINVAL; | 456 | return -EINVAL; |
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c index 253c88bb7a4c..4f05fb88bddf 100644 --- a/sound/soc/codecs/wm8990.c +++ b/sound/soc/codecs/wm8990.c | |||
@@ -1259,6 +1259,8 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec, | |||
1259 | 1259 | ||
1260 | /* disable POBCTRL, SOFT_ST and BUFDCOPEN */ | 1260 | /* disable POBCTRL, SOFT_ST and BUFDCOPEN */ |
1261 | snd_soc_write(codec, WM8990_ANTIPOP2, 0x0); | 1261 | snd_soc_write(codec, WM8990_ANTIPOP2, 0x0); |
1262 | |||
1263 | codec->cache_sync = 1; | ||
1262 | break; | 1264 | break; |
1263 | } | 1265 | } |
1264 | 1266 | ||
diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c index eb4373840bb6..3665f612819d 100644 --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c | |||
@@ -69,7 +69,6 @@ static int pcm030_fabric_probe(struct platform_device *op) | |||
69 | return -ENOMEM; | 69 | return -ENOMEM; |
70 | 70 | ||
71 | card->dev = &op->dev; | 71 | card->dev = &op->dev; |
72 | platform_set_drvdata(op, pdata); | ||
73 | 72 | ||
74 | pdata->card = card; | 73 | pdata->card = card; |
75 | 74 | ||
@@ -98,6 +97,8 @@ static int pcm030_fabric_probe(struct platform_device *op) | |||
98 | if (ret) | 97 | if (ret) |
99 | dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret); | 98 | dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret); |
100 | 99 | ||
100 | platform_set_drvdata(op, pdata); | ||
101 | |||
101 | return ret; | 102 | return ret; |
102 | } | 103 | } |
103 | 104 | ||
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c index d34d91743e3f..0b18f654b413 100644 --- a/sound/soc/kirkwood/kirkwood-i2s.c +++ b/sound/soc/kirkwood/kirkwood-i2s.c | |||
@@ -33,6 +33,10 @@ | |||
33 | SNDRV_PCM_FMTBIT_S24_LE | \ | 33 | SNDRV_PCM_FMTBIT_S24_LE | \ |
34 | SNDRV_PCM_FMTBIT_S32_LE) | 34 | SNDRV_PCM_FMTBIT_S32_LE) |
35 | 35 | ||
36 | #define KIRKWOOD_SPDIF_FORMATS \ | ||
37 | (SNDRV_PCM_FMTBIT_S16_LE | \ | ||
38 | SNDRV_PCM_FMTBIT_S24_LE) | ||
39 | |||
36 | static int kirkwood_i2s_set_fmt(struct snd_soc_dai *cpu_dai, | 40 | static int kirkwood_i2s_set_fmt(struct snd_soc_dai *cpu_dai, |
37 | unsigned int fmt) | 41 | unsigned int fmt) |
38 | { | 42 | { |
@@ -244,15 +248,15 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream, | |||
244 | ctl); | 248 | ctl); |
245 | } | 249 | } |
246 | 250 | ||
247 | if (dai->id == 0) | ||
248 | ctl &= ~KIRKWOOD_PLAYCTL_SPDIF_EN; /* i2s */ | ||
249 | else | ||
250 | ctl &= ~KIRKWOOD_PLAYCTL_I2S_EN; /* spdif */ | ||
251 | |||
252 | switch (cmd) { | 251 | switch (cmd) { |
253 | case SNDRV_PCM_TRIGGER_START: | 252 | case SNDRV_PCM_TRIGGER_START: |
254 | /* configure */ | 253 | /* configure */ |
255 | ctl = priv->ctl_play; | 254 | ctl = priv->ctl_play; |
255 | if (dai->id == 0) | ||
256 | ctl &= ~KIRKWOOD_PLAYCTL_SPDIF_EN; /* i2s */ | ||
257 | else | ||
258 | ctl &= ~KIRKWOOD_PLAYCTL_I2S_EN; /* spdif */ | ||
259 | |||
256 | value = ctl & ~KIRKWOOD_PLAYCTL_ENABLE_MASK; | 260 | value = ctl & ~KIRKWOOD_PLAYCTL_ENABLE_MASK; |
257 | writel(value, priv->io + KIRKWOOD_PLAYCTL); | 261 | writel(value, priv->io + KIRKWOOD_PLAYCTL); |
258 | 262 | ||
@@ -449,14 +453,14 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai[2] = { | |||
449 | .channels_max = 2, | 453 | .channels_max = 2, |
450 | .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | | 454 | .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | |
451 | SNDRV_PCM_RATE_96000, | 455 | SNDRV_PCM_RATE_96000, |
452 | .formats = KIRKWOOD_I2S_FORMATS, | 456 | .formats = KIRKWOOD_SPDIF_FORMATS, |
453 | }, | 457 | }, |
454 | .capture = { | 458 | .capture = { |
455 | .channels_min = 1, | 459 | .channels_min = 1, |
456 | .channels_max = 2, | 460 | .channels_max = 2, |
457 | .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | | 461 | .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | |
458 | SNDRV_PCM_RATE_96000, | 462 | SNDRV_PCM_RATE_96000, |
459 | .formats = KIRKWOOD_I2S_FORMATS, | 463 | .formats = KIRKWOOD_SPDIF_FORMATS, |
460 | }, | 464 | }, |
461 | .ops = &kirkwood_i2s_dai_ops, | 465 | .ops = &kirkwood_i2s_dai_ops, |
462 | }, | 466 | }, |
@@ -493,7 +497,7 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = { | |||
493 | .rates = SNDRV_PCM_RATE_8000_192000 | | 497 | .rates = SNDRV_PCM_RATE_8000_192000 | |
494 | SNDRV_PCM_RATE_CONTINUOUS | | 498 | SNDRV_PCM_RATE_CONTINUOUS | |
495 | SNDRV_PCM_RATE_KNOT, | 499 | SNDRV_PCM_RATE_KNOT, |
496 | .formats = KIRKWOOD_I2S_FORMATS, | 500 | .formats = KIRKWOOD_SPDIF_FORMATS, |
497 | }, | 501 | }, |
498 | .capture = { | 502 | .capture = { |
499 | .channels_min = 1, | 503 | .channels_min = 1, |
@@ -501,7 +505,7 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = { | |||
501 | .rates = SNDRV_PCM_RATE_8000_192000 | | 505 | .rates = SNDRV_PCM_RATE_8000_192000 | |
502 | SNDRV_PCM_RATE_CONTINUOUS | | 506 | SNDRV_PCM_RATE_CONTINUOUS | |
503 | SNDRV_PCM_RATE_KNOT, | 507 | SNDRV_PCM_RATE_KNOT, |
504 | .formats = KIRKWOOD_I2S_FORMATS, | 508 | .formats = KIRKWOOD_SPDIF_FORMATS, |
505 | }, | 509 | }, |
506 | .ops = &kirkwood_i2s_dai_ops, | 510 | .ops = &kirkwood_i2s_dai_ops, |
507 | }, | 511 | }, |
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index 6d216cb6c19b..3fde9e402710 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c | |||
@@ -100,12 +100,12 @@ static int n810_startup(struct snd_pcm_substream *substream) | |||
100 | SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2); | 100 | SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2); |
101 | 101 | ||
102 | n810_ext_control(&codec->dapm); | 102 | n810_ext_control(&codec->dapm); |
103 | return clk_enable(sys_clkout2); | 103 | return clk_prepare_enable(sys_clkout2); |
104 | } | 104 | } |
105 | 105 | ||
106 | static void n810_shutdown(struct snd_pcm_substream *substream) | 106 | static void n810_shutdown(struct snd_pcm_substream *substream) |
107 | { | 107 | { |
108 | clk_disable(sys_clkout2); | 108 | clk_disable_unprepare(sys_clkout2); |
109 | } | 109 | } |
110 | 110 | ||
111 | static int n810_hw_params(struct snd_pcm_substream *substream, | 111 | static int n810_hw_params(struct snd_pcm_substream *substream, |
diff --git a/sound/soc/sh/Kconfig b/sound/soc/sh/Kconfig index 14011d90d70a..ff60e11ecb56 100644 --- a/sound/soc/sh/Kconfig +++ b/sound/soc/sh/Kconfig | |||
@@ -37,6 +37,7 @@ config SND_SOC_SH4_SIU | |||
37 | config SND_SOC_RCAR | 37 | config SND_SOC_RCAR |
38 | tristate "R-Car series SRU/SCU/SSIU/SSI support" | 38 | tristate "R-Car series SRU/SCU/SSIU/SSI support" |
39 | select SND_SIMPLE_CARD | 39 | select SND_SIMPLE_CARD |
40 | select REGMAP | ||
40 | help | 41 | help |
41 | This option enables R-Car SUR/SCU/SSIU/SSI sound support | 42 | This option enables R-Car SUR/SCU/SSIU/SSI sound support |
42 | 43 | ||
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4e53d87e881d..a66783e13a9c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -3212,11 +3212,11 @@ int snd_soc_bytes_get(struct snd_kcontrol *kcontrol, | |||
3212 | break; | 3212 | break; |
3213 | case 2: | 3213 | case 2: |
3214 | ((u16 *)(&ucontrol->value.bytes.data))[0] | 3214 | ((u16 *)(&ucontrol->value.bytes.data))[0] |
3215 | &= ~params->mask; | 3215 | &= cpu_to_be16(~params->mask); |
3216 | break; | 3216 | break; |
3217 | case 4: | 3217 | case 4: |
3218 | ((u32 *)(&ucontrol->value.bytes.data))[0] | 3218 | ((u32 *)(&ucontrol->value.bytes.data))[0] |
3219 | &= ~params->mask; | 3219 | &= cpu_to_be32(~params->mask); |
3220 | break; | 3220 | break; |
3221 | default: | 3221 | default: |
3222 | return -EINVAL; | 3222 | return -EINVAL; |
diff --git a/sound/soc/soc-devres.c b/sound/soc/soc-devres.c index b1d732255c02..3449c1e909ae 100644 --- a/sound/soc/soc-devres.c +++ b/sound/soc/soc-devres.c | |||
@@ -66,7 +66,7 @@ static void devm_card_release(struct device *dev, void *res) | |||
66 | */ | 66 | */ |
67 | int devm_snd_soc_register_card(struct device *dev, struct snd_soc_card *card) | 67 | int devm_snd_soc_register_card(struct device *dev, struct snd_soc_card *card) |
68 | { | 68 | { |
69 | struct device **ptr; | 69 | struct snd_soc_card **ptr; |
70 | int ret; | 70 | int ret; |
71 | 71 | ||
72 | ptr = devres_alloc(devm_card_release, sizeof(*ptr), GFP_KERNEL); | 72 | ptr = devres_alloc(devm_card_release, sizeof(*ptr), GFP_KERNEL); |
@@ -75,7 +75,7 @@ int devm_snd_soc_register_card(struct device *dev, struct snd_soc_card *card) | |||
75 | 75 | ||
76 | ret = snd_soc_register_card(card); | 76 | ret = snd_soc_register_card(card); |
77 | if (ret == 0) { | 77 | if (ret == 0) { |
78 | *ptr = dev; | 78 | *ptr = card; |
79 | devres_add(dev, ptr); | 79 | devres_add(dev, ptr); |
80 | } else { | 80 | } else { |
81 | devres_free(ptr); | 81 | devres_free(ptr); |
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 42782c01e413..11a90cd027fa 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -148,12 +148,12 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream, | |||
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
151 | static void soc_pcm_init_runtime_hw(struct snd_pcm_hardware *hw, | 151 | static void soc_pcm_init_runtime_hw(struct snd_pcm_runtime *runtime, |
152 | struct snd_soc_pcm_stream *codec_stream, | 152 | struct snd_soc_pcm_stream *codec_stream, |
153 | struct snd_soc_pcm_stream *cpu_stream) | 153 | struct snd_soc_pcm_stream *cpu_stream) |
154 | { | 154 | { |
155 | hw->rate_min = max(codec_stream->rate_min, cpu_stream->rate_min); | 155 | struct snd_pcm_hardware *hw = &runtime->hw; |
156 | hw->rate_max = max(codec_stream->rate_max, cpu_stream->rate_max); | 156 | |
157 | hw->channels_min = max(codec_stream->channels_min, | 157 | hw->channels_min = max(codec_stream->channels_min, |
158 | cpu_stream->channels_min); | 158 | cpu_stream->channels_min); |
159 | hw->channels_max = min(codec_stream->channels_max, | 159 | hw->channels_max = min(codec_stream->channels_max, |
@@ -166,6 +166,13 @@ static void soc_pcm_init_runtime_hw(struct snd_pcm_hardware *hw, | |||
166 | if (cpu_stream->rates | 166 | if (cpu_stream->rates |
167 | & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS)) | 167 | & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS)) |
168 | hw->rates |= codec_stream->rates; | 168 | hw->rates |= codec_stream->rates; |
169 | |||
170 | snd_pcm_limit_hw_rates(runtime); | ||
171 | |||
172 | hw->rate_min = max(hw->rate_min, cpu_stream->rate_min); | ||
173 | hw->rate_min = max(hw->rate_min, codec_stream->rate_min); | ||
174 | hw->rate_max = min_not_zero(hw->rate_max, cpu_stream->rate_max); | ||
175 | hw->rate_max = min_not_zero(hw->rate_max, codec_stream->rate_max); | ||
169 | } | 176 | } |
170 | 177 | ||
171 | /* | 178 | /* |
@@ -235,15 +242,14 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) | |||
235 | 242 | ||
236 | /* Check that the codec and cpu DAIs are compatible */ | 243 | /* Check that the codec and cpu DAIs are compatible */ |
237 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 244 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
238 | soc_pcm_init_runtime_hw(&runtime->hw, &codec_dai_drv->playback, | 245 | soc_pcm_init_runtime_hw(runtime, &codec_dai_drv->playback, |
239 | &cpu_dai_drv->playback); | 246 | &cpu_dai_drv->playback); |
240 | } else { | 247 | } else { |
241 | soc_pcm_init_runtime_hw(&runtime->hw, &codec_dai_drv->capture, | 248 | soc_pcm_init_runtime_hw(runtime, &codec_dai_drv->capture, |
242 | &cpu_dai_drv->capture); | 249 | &cpu_dai_drv->capture); |
243 | } | 250 | } |
244 | 251 | ||
245 | ret = -EINVAL; | 252 | ret = -EINVAL; |
246 | snd_pcm_limit_hw_rates(runtime); | ||
247 | if (!runtime->hw.rates) { | 253 | if (!runtime->hw.rates) { |
248 | printk(KERN_ERR "ASoC: %s <-> %s No matching rates\n", | 254 | printk(KERN_ERR "ASoC: %s <-> %s No matching rates\n", |
249 | codec_dai->name, cpu_dai->name); | 255 | codec_dai->name, cpu_dai->name); |
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index b9ba0fcc45df..83aabea259d7 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c | |||
@@ -636,8 +636,22 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep, | |||
636 | if (usb_pipein(ep->pipe) || | 636 | if (usb_pipein(ep->pipe) || |
637 | snd_usb_endpoint_implicit_feedback_sink(ep)) { | 637 | snd_usb_endpoint_implicit_feedback_sink(ep)) { |
638 | 638 | ||
639 | urb_packs = packs_per_ms; | ||
640 | /* | ||
641 | * Wireless devices can poll at a max rate of once per 4ms. | ||
642 | * For dataintervals less than 5, increase the packet count to | ||
643 | * allow the host controller to use bursting to fill in the | ||
644 | * gaps. | ||
645 | */ | ||
646 | if (snd_usb_get_speed(ep->chip->dev) == USB_SPEED_WIRELESS) { | ||
647 | int interval = ep->datainterval; | ||
648 | while (interval < 5) { | ||
649 | urb_packs <<= 1; | ||
650 | ++interval; | ||
651 | } | ||
652 | } | ||
639 | /* make capture URBs <= 1 ms and smaller than a period */ | 653 | /* make capture URBs <= 1 ms and smaller than a period */ |
640 | urb_packs = min(max_packs_per_urb, packs_per_ms); | 654 | urb_packs = min(max_packs_per_urb, urb_packs); |
641 | while (urb_packs > 1 && urb_packs * maxsize >= period_bytes) | 655 | while (urb_packs > 1 && urb_packs * maxsize >= period_bytes) |
642 | urb_packs >>= 1; | 656 | urb_packs >>= 1; |
643 | ep->nurbs = MAX_URBS; | 657 | ep->nurbs = MAX_URBS; |
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 0362d575de7d..217c82ee3665 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c | |||
@@ -1606,6 +1606,24 @@ process_arg(struct event_format *event, struct print_arg *arg, char **tok) | |||
1606 | static enum event_type | 1606 | static enum event_type |
1607 | process_op(struct event_format *event, struct print_arg *arg, char **tok); | 1607 | process_op(struct event_format *event, struct print_arg *arg, char **tok); |
1608 | 1608 | ||
1609 | /* | ||
1610 | * For __print_symbolic() and __print_flags, we need to completely | ||
1611 | * evaluate the first argument, which defines what to print next. | ||
1612 | */ | ||
1613 | static enum event_type | ||
1614 | process_field_arg(struct event_format *event, struct print_arg *arg, char **tok) | ||
1615 | { | ||
1616 | enum event_type type; | ||
1617 | |||
1618 | type = process_arg(event, arg, tok); | ||
1619 | |||
1620 | while (type == EVENT_OP) { | ||
1621 | type = process_op(event, arg, tok); | ||
1622 | } | ||
1623 | |||
1624 | return type; | ||
1625 | } | ||
1626 | |||
1609 | static enum event_type | 1627 | static enum event_type |
1610 | process_cond(struct event_format *event, struct print_arg *top, char **tok) | 1628 | process_cond(struct event_format *event, struct print_arg *top, char **tok) |
1611 | { | 1629 | { |
@@ -2371,7 +2389,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok) | |||
2371 | goto out_free; | 2389 | goto out_free; |
2372 | } | 2390 | } |
2373 | 2391 | ||
2374 | type = process_arg(event, field, &token); | 2392 | type = process_field_arg(event, field, &token); |
2375 | 2393 | ||
2376 | /* Handle operations in the first argument */ | 2394 | /* Handle operations in the first argument */ |
2377 | while (type == EVENT_OP) | 2395 | while (type == EVENT_OP) |
@@ -2424,7 +2442,8 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok) | |||
2424 | goto out_free; | 2442 | goto out_free; |
2425 | } | 2443 | } |
2426 | 2444 | ||
2427 | type = process_arg(event, field, &token); | 2445 | type = process_field_arg(event, field, &token); |
2446 | |||
2428 | if (test_type_token(type, token, EVENT_DELIM, ",")) | 2447 | if (test_type_token(type, token, EVENT_DELIM, ",")) |
2429 | goto out_free_field; | 2448 | goto out_free_field; |
2430 | 2449 | ||
@@ -3446,7 +3465,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg | |||
3446 | * is in the bottom half of the 32 bit field. | 3465 | * is in the bottom half of the 32 bit field. |
3447 | */ | 3466 | */ |
3448 | offset &= 0xffff; | 3467 | offset &= 0xffff; |
3449 | val = (unsigned long long)(data + offset); | 3468 | val = (unsigned long long)((unsigned long)data + offset); |
3450 | break; | 3469 | break; |
3451 | default: /* not sure what to do there */ | 3470 | default: /* not sure what to do there */ |
3452 | return 0; | 3471 | return 0; |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 369c03648f88..1cd035708931 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -2078,8 +2078,10 @@ static int process_group_desc(struct perf_file_section *section __maybe_unused, | |||
2078 | if (evsel->idx == (int) desc[i].leader_idx) { | 2078 | if (evsel->idx == (int) desc[i].leader_idx) { |
2079 | evsel->leader = evsel; | 2079 | evsel->leader = evsel; |
2080 | /* {anon_group} is a dummy name */ | 2080 | /* {anon_group} is a dummy name */ |
2081 | if (strcmp(desc[i].name, "{anon_group}")) | 2081 | if (strcmp(desc[i].name, "{anon_group}")) { |
2082 | evsel->group_name = desc[i].name; | 2082 | evsel->group_name = desc[i].name; |
2083 | desc[i].name = NULL; | ||
2084 | } | ||
2083 | evsel->nr_members = desc[i].nr_members; | 2085 | evsel->nr_members = desc[i].nr_members; |
2084 | 2086 | ||
2085 | if (i >= nr_groups || nr > 0) { | 2087 | if (i >= nr_groups || nr > 0) { |
@@ -2105,7 +2107,7 @@ static int process_group_desc(struct perf_file_section *section __maybe_unused, | |||
2105 | 2107 | ||
2106 | ret = 0; | 2108 | ret = 0; |
2107 | out_free: | 2109 | out_free: |
2108 | while ((int) --i >= 0) | 2110 | for (i = 0; i < nr_groups; i++) |
2109 | free(desc[i].name); | 2111 | free(desc[i].name); |
2110 | free(desc); | 2112 | free(desc); |
2111 | 2113 | ||
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index cd8e2f592719..49eaf1d7d89d 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c | |||
@@ -70,14 +70,13 @@ int thread__set_comm(struct thread *thread, const char *str, u64 timestamp) | |||
70 | /* Override latest entry if it had no specific time coverage */ | 70 | /* Override latest entry if it had no specific time coverage */ |
71 | if (!curr->start) { | 71 | if (!curr->start) { |
72 | comm__override(curr, str, timestamp); | 72 | comm__override(curr, str, timestamp); |
73 | return 0; | 73 | } else { |
74 | new = comm__new(str, timestamp); | ||
75 | if (!new) | ||
76 | return -ENOMEM; | ||
77 | list_add(&new->list, &thread->comm_list); | ||
74 | } | 78 | } |
75 | 79 | ||
76 | new = comm__new(str, timestamp); | ||
77 | if (!new) | ||
78 | return -ENOMEM; | ||
79 | |||
80 | list_add(&new->list, &thread->comm_list); | ||
81 | thread->comm_set = true; | 80 | thread->comm_set = true; |
82 | 81 | ||
83 | return 0; | 82 | return 0; |
diff --git a/tools/power/cpupower/man/cpupower-idle-info.1 b/tools/power/cpupower/man/cpupower-idle-info.1 index 4178effd9e99..7b3646adb92f 100644 --- a/tools/power/cpupower/man/cpupower-idle-info.1 +++ b/tools/power/cpupower/man/cpupower-idle-info.1 | |||
@@ -87,4 +87,5 @@ Thomas Renninger <trenn@suse.de> | |||
87 | .fi | 87 | .fi |
88 | .SH "SEE ALSO" | 88 | .SH "SEE ALSO" |
89 | .LP | 89 | .LP |
90 | cpupower(1), cpupower\-monitor(1), cpupower\-info(1), cpupower\-set(1) | 90 | cpupower(1), cpupower\-monitor(1), cpupower\-info(1), cpupower\-set(1), |
91 | cpupower\-idle\-set(1) | ||
diff --git a/tools/power/cpupower/man/cpupower-idle-set.1 b/tools/power/cpupower/man/cpupower-idle-set.1 new file mode 100644 index 000000000000..6b1607272a5b --- /dev/null +++ b/tools/power/cpupower/man/cpupower-idle-set.1 | |||
@@ -0,0 +1,71 @@ | |||
1 | .TH "CPUPOWER-IDLE-SET" "1" "0.1" "" "cpupower Manual" | ||
2 | .SH "NAME" | ||
3 | .LP | ||
4 | cpupower idle\-set \- Utility to set cpu idle state specific kernel options | ||
5 | .SH "SYNTAX" | ||
6 | .LP | ||
7 | cpupower [ \-c cpulist ] idle\-info [\fIoptions\fP] | ||
8 | .SH "DESCRIPTION" | ||
9 | .LP | ||
10 | The cpupower idle\-set subcommand allows to set cpu idle, also called cpu | ||
11 | sleep state, specific options offered by the kernel. One example is disabling | ||
12 | sleep states. This can be handy for power vs performance tuning. | ||
13 | .SH "OPTIONS" | ||
14 | .LP | ||
15 | .TP | ||
16 | \fB\-d\fR \fB\-\-disable\fR | ||
17 | Disable a specific processor sleep state. | ||
18 | .TP | ||
19 | \fB\-e\fR \fB\-\-enable\fR | ||
20 | Enable a specific processor sleep state. | ||
21 | |||
22 | .SH "REMARKS" | ||
23 | .LP | ||
24 | Cpuidle Governors Policy on Disabling Sleep States | ||
25 | |||
26 | .RS 4 | ||
27 | Depending on the used cpuidle governor, implementing the kernel policy | ||
28 | how to choose sleep states, subsequent sleep states on this core, might get | ||
29 | disabled as well. | ||
30 | |||
31 | There are two cpuidle governors ladder and menu. While the ladder | ||
32 | governor is always available, if CONFIG_CPU_IDLE is selected, the | ||
33 | menu governor additionally requires CONFIG_NO_HZ. | ||
34 | |||
35 | The behavior and the effect of the disable variable depends on the | ||
36 | implementation of a particular governor. In the ladder governor, for | ||
37 | example, it is not coherent, i.e. if one is disabling a light state, | ||
38 | then all deeper states are disabled as well. Likewise, if one enables a | ||
39 | deep state but a lighter state still is disabled, then this has no effect. | ||
40 | .RE | ||
41 | .LP | ||
42 | Disabling the Lightest Sleep State may not have any Affect | ||
43 | |||
44 | .RS 4 | ||
45 | If criteria are not met to enter deeper sleep states and the lightest sleep | ||
46 | state is chosen when idle, the kernel may still enter this sleep state, | ||
47 | irrespective of whether it is disabled or not. This is also reflected in | ||
48 | the usage count of the disabled sleep state when using the cpupower idle-info | ||
49 | command. | ||
50 | .RE | ||
51 | .LP | ||
52 | Selecting specific CPU Cores | ||
53 | |||
54 | .RS 4 | ||
55 | By default processor sleep states of all CPU cores are set. Please refer | ||
56 | to the cpupower(1) manpage in the \-\-cpu option section how to disable | ||
57 | C-states of specific cores. | ||
58 | .RE | ||
59 | .SH "FILES" | ||
60 | .nf | ||
61 | \fI/sys/devices/system/cpu/cpu*/cpuidle/state*\fP | ||
62 | \fI/sys/devices/system/cpu/cpuidle/*\fP | ||
63 | .fi | ||
64 | .SH "AUTHORS" | ||
65 | .nf | ||
66 | Thomas Renninger <trenn@suse.de> | ||
67 | .fi | ||
68 | .SH "SEE ALSO" | ||
69 | .LP | ||
70 | cpupower(1), cpupower\-monitor(1), cpupower\-info(1), cpupower\-set(1), | ||
71 | cpupower\-idle\-info(1) | ||
diff --git a/tools/power/cpupower/utils/helpers/sysfs.c b/tools/power/cpupower/utils/helpers/sysfs.c index 5cdc600e8152..851c7a16ca49 100644 --- a/tools/power/cpupower/utils/helpers/sysfs.c +++ b/tools/power/cpupower/utils/helpers/sysfs.c | |||
@@ -278,7 +278,7 @@ static char *sysfs_idlestate_get_one_string(unsigned int cpu, | |||
278 | int sysfs_is_idlestate_disabled(unsigned int cpu, | 278 | int sysfs_is_idlestate_disabled(unsigned int cpu, |
279 | unsigned int idlestate) | 279 | unsigned int idlestate) |
280 | { | 280 | { |
281 | if (sysfs_get_idlestate_count(cpu) < idlestate) | 281 | if (sysfs_get_idlestate_count(cpu) <= idlestate) |
282 | return -1; | 282 | return -1; |
283 | 283 | ||
284 | if (!sysfs_idlestate_file_exists(cpu, idlestate, | 284 | if (!sysfs_idlestate_file_exists(cpu, idlestate, |
@@ -303,7 +303,7 @@ int sysfs_idlestate_disable(unsigned int cpu, | |||
303 | char value[SYSFS_PATH_MAX]; | 303 | char value[SYSFS_PATH_MAX]; |
304 | int bytes_written; | 304 | int bytes_written; |
305 | 305 | ||
306 | if (sysfs_get_idlestate_count(cpu) < idlestate) | 306 | if (sysfs_get_idlestate_count(cpu) <= idlestate) |
307 | return -1; | 307 | return -1; |
308 | 308 | ||
309 | if (!sysfs_idlestate_file_exists(cpu, idlestate, | 309 | if (!sysfs_idlestate_file_exists(cpu, idlestate, |