diff options
140 files changed, 1140 insertions, 638 deletions
@@ -953,11 +953,11 @@ S: Blacksburg, Virginia 24061 | |||
953 | S: USA | 953 | S: USA |
954 | 954 | ||
955 | N: Randy Dunlap | 955 | N: Randy Dunlap |
956 | E: rdunlap@xenotime.net | 956 | E: rdunlap@infradead.org |
957 | W: http://www.xenotime.net/linux/linux.html | 957 | W: http://www.infradead.org/~rdunlap/ |
958 | W: http://www.linux-usb.org | ||
959 | D: Linux-USB subsystem, USB core/UHCI/printer/storage drivers | 958 | D: Linux-USB subsystem, USB core/UHCI/printer/storage drivers |
960 | D: x86 SMP, ACPI, bootflag hacking | 959 | D: x86 SMP, ACPI, bootflag hacking |
960 | D: documentation, builds | ||
961 | S: (ask for current address) | 961 | S: (ask for current address) |
962 | S: USA | 962 | S: USA |
963 | 963 | ||
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index c379a2a6949f..aa0c1e63f050 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -60,8 +60,7 @@ own source tree. For example: | |||
60 | "dontdiff" is a list of files which are generated by the kernel during | 60 | "dontdiff" is a list of files which are generated by the kernel during |
61 | the build process, and should be ignored in any diff(1)-generated | 61 | the build process, and should be ignored in any diff(1)-generated |
62 | patch. The "dontdiff" file is included in the kernel tree in | 62 | patch. The "dontdiff" file is included in the kernel tree in |
63 | 2.6.12 and later. For earlier kernel versions, you can get it | 63 | 2.6.12 and later. |
64 | from <http://www.xenotime.net/linux/doc/dontdiff>. | ||
65 | 64 | ||
66 | Make sure your patch does not include any extra files which do not | 65 | Make sure your patch does not include any extra files which do not |
67 | belong in a patch submission. Make sure to review your patch -after- | 66 | belong in a patch submission. Make sure to review your patch -after- |
diff --git a/Documentation/hwmon/adm1275 b/Documentation/hwmon/adm1275 index 2cfa25667123..15b4a20d5062 100644 --- a/Documentation/hwmon/adm1275 +++ b/Documentation/hwmon/adm1275 | |||
@@ -15,7 +15,7 @@ Supported chips: | |||
15 | Addresses scanned: - | 15 | Addresses scanned: - |
16 | Datasheet: www.analog.com/static/imported-files/data_sheets/ADM1276.pdf | 16 | Datasheet: www.analog.com/static/imported-files/data_sheets/ADM1276.pdf |
17 | 17 | ||
18 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 18 | Author: Guenter Roeck <linux@roeck-us.net> |
19 | 19 | ||
20 | 20 | ||
21 | Description | 21 | Description |
diff --git a/Documentation/hwmon/adt7410 b/Documentation/hwmon/adt7410 index 96004000dc2a..58150c480e56 100644 --- a/Documentation/hwmon/adt7410 +++ b/Documentation/hwmon/adt7410 | |||
@@ -4,9 +4,14 @@ Kernel driver adt7410 | |||
4 | Supported chips: | 4 | Supported chips: |
5 | * Analog Devices ADT7410 | 5 | * Analog Devices ADT7410 |
6 | Prefix: 'adt7410' | 6 | Prefix: 'adt7410' |
7 | Addresses scanned: I2C 0x48 - 0x4B | 7 | Addresses scanned: None |
8 | Datasheet: Publicly available at the Analog Devices website | 8 | Datasheet: Publicly available at the Analog Devices website |
9 | http://www.analog.com/static/imported-files/data_sheets/ADT7410.pdf | 9 | http://www.analog.com/static/imported-files/data_sheets/ADT7410.pdf |
10 | * Analog Devices ADT7420 | ||
11 | Prefix: 'adt7420' | ||
12 | Addresses scanned: None | ||
13 | Datasheet: Publicly available at the Analog Devices website | ||
14 | http://www.analog.com/static/imported-files/data_sheets/ADT7420.pdf | ||
10 | 15 | ||
11 | Author: Hartmut Knaack <knaack.h@gmx.de> | 16 | Author: Hartmut Knaack <knaack.h@gmx.de> |
12 | 17 | ||
@@ -27,6 +32,10 @@ value per second or even justget one sample on demand for power saving. | |||
27 | Besides, it can completely power down its ADC, if power management is | 32 | Besides, it can completely power down its ADC, if power management is |
28 | required. | 33 | required. |
29 | 34 | ||
35 | The ADT7420 is register compatible, the only differences being the package, | ||
36 | a slightly narrower operating temperature range (-40°C to +150°C), and a | ||
37 | better accuracy (0.25°C instead of 0.50°C.) | ||
38 | |||
30 | Configuration Notes | 39 | Configuration Notes |
31 | ------------------- | 40 | ------------------- |
32 | 41 | ||
diff --git a/Documentation/hwmon/jc42 b/Documentation/hwmon/jc42 index 165077121238..868d74d6b773 100644 --- a/Documentation/hwmon/jc42 +++ b/Documentation/hwmon/jc42 | |||
@@ -49,7 +49,7 @@ Supported chips: | |||
49 | Addresses scanned: I2C 0x18 - 0x1f | 49 | Addresses scanned: I2C 0x18 - 0x1f |
50 | 50 | ||
51 | Author: | 51 | Author: |
52 | Guenter Roeck <guenter.roeck@ericsson.com> | 52 | Guenter Roeck <linux@roeck-us.net> |
53 | 53 | ||
54 | 54 | ||
55 | Description | 55 | Description |
diff --git a/Documentation/hwmon/lineage-pem b/Documentation/hwmon/lineage-pem index 2ba5ed126858..83b2ddc160c8 100644 --- a/Documentation/hwmon/lineage-pem +++ b/Documentation/hwmon/lineage-pem | |||
@@ -8,7 +8,7 @@ Supported devices: | |||
8 | Documentation: | 8 | Documentation: |
9 | http://www.lineagepower.com/oem/pdf/CPLI2C.pdf | 9 | http://www.lineagepower.com/oem/pdf/CPLI2C.pdf |
10 | 10 | ||
11 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 11 | Author: Guenter Roeck <linux@roeck-us.net> |
12 | 12 | ||
13 | 13 | ||
14 | Description | 14 | Description |
diff --git a/Documentation/hwmon/lm25066 b/Documentation/hwmon/lm25066 index a21db81c4591..26025e419d35 100644 --- a/Documentation/hwmon/lm25066 +++ b/Documentation/hwmon/lm25066 | |||
@@ -19,7 +19,7 @@ Supported chips: | |||
19 | Datasheet: | 19 | Datasheet: |
20 | http://www.national.com/pf/LM/LM5066.html | 20 | http://www.national.com/pf/LM/LM5066.html |
21 | 21 | ||
22 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 22 | Author: Guenter Roeck <linux@roeck-us.net> |
23 | 23 | ||
24 | 24 | ||
25 | Description | 25 | Description |
diff --git a/Documentation/hwmon/ltc2978 b/Documentation/hwmon/ltc2978 index c365f9beb5dd..e4d75c606c97 100644 --- a/Documentation/hwmon/ltc2978 +++ b/Documentation/hwmon/ltc2978 | |||
@@ -5,13 +5,13 @@ Supported chips: | |||
5 | * Linear Technology LTC2978 | 5 | * Linear Technology LTC2978 |
6 | Prefix: 'ltc2978' | 6 | Prefix: 'ltc2978' |
7 | Addresses scanned: - | 7 | Addresses scanned: - |
8 | Datasheet: http://cds.linear.com/docs/Datasheet/2978fa.pdf | 8 | Datasheet: http://www.linear.com/product/ltc2978 |
9 | * Linear Technology LTC3880 | 9 | * Linear Technology LTC3880 |
10 | Prefix: 'ltc3880' | 10 | Prefix: 'ltc3880' |
11 | Addresses scanned: - | 11 | Addresses scanned: - |
12 | Datasheet: http://cds.linear.com/docs/Datasheet/3880f.pdf | 12 | Datasheet: http://www.linear.com/product/ltc3880 |
13 | 13 | ||
14 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 14 | Author: Guenter Roeck <linux@roeck-us.net> |
15 | 15 | ||
16 | 16 | ||
17 | Description | 17 | Description |
diff --git a/Documentation/hwmon/ltc4261 b/Documentation/hwmon/ltc4261 index eba2e2c4b94d..9378a75c6134 100644 --- a/Documentation/hwmon/ltc4261 +++ b/Documentation/hwmon/ltc4261 | |||
@@ -8,7 +8,7 @@ Supported chips: | |||
8 | Datasheet: | 8 | Datasheet: |
9 | http://cds.linear.com/docs/Datasheet/42612fb.pdf | 9 | http://cds.linear.com/docs/Datasheet/42612fb.pdf |
10 | 10 | ||
11 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 11 | Author: Guenter Roeck <linux@roeck-us.net> |
12 | 12 | ||
13 | 13 | ||
14 | Description | 14 | Description |
diff --git a/Documentation/hwmon/max16064 b/Documentation/hwmon/max16064 index f8b478076f6d..d59cc7829bec 100644 --- a/Documentation/hwmon/max16064 +++ b/Documentation/hwmon/max16064 | |||
@@ -7,7 +7,7 @@ Supported chips: | |||
7 | Addresses scanned: - | 7 | Addresses scanned: - |
8 | Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX16064.pdf | 8 | Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX16064.pdf |
9 | 9 | ||
10 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 10 | Author: Guenter Roeck <linux@roeck-us.net> |
11 | 11 | ||
12 | 12 | ||
13 | Description | 13 | Description |
diff --git a/Documentation/hwmon/max16065 b/Documentation/hwmon/max16065 index c11f64a1f2ad..208a29e43010 100644 --- a/Documentation/hwmon/max16065 +++ b/Documentation/hwmon/max16065 | |||
@@ -24,7 +24,7 @@ Supported chips: | |||
24 | http://datasheets.maxim-ic.com/en/ds/MAX16070-MAX16071.pdf | 24 | http://datasheets.maxim-ic.com/en/ds/MAX16070-MAX16071.pdf |
25 | 25 | ||
26 | 26 | ||
27 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 27 | Author: Guenter Roeck <linux@roeck-us.net> |
28 | 28 | ||
29 | 29 | ||
30 | Description | 30 | Description |
diff --git a/Documentation/hwmon/max34440 b/Documentation/hwmon/max34440 index 47651ff341ae..37cbf472a19d 100644 --- a/Documentation/hwmon/max34440 +++ b/Documentation/hwmon/max34440 | |||
@@ -27,7 +27,7 @@ Supported chips: | |||
27 | Addresses scanned: - | 27 | Addresses scanned: - |
28 | Datasheet: http://datasheets.maximintegrated.com/en/ds/MAX34461.pdf | 28 | Datasheet: http://datasheets.maximintegrated.com/en/ds/MAX34461.pdf |
29 | 29 | ||
30 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 30 | Author: Guenter Roeck <linux@roeck-us.net> |
31 | 31 | ||
32 | 32 | ||
33 | Description | 33 | Description |
diff --git a/Documentation/hwmon/max8688 b/Documentation/hwmon/max8688 index fe849871df32..e78078638b91 100644 --- a/Documentation/hwmon/max8688 +++ b/Documentation/hwmon/max8688 | |||
@@ -7,7 +7,7 @@ Supported chips: | |||
7 | Addresses scanned: - | 7 | Addresses scanned: - |
8 | Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX8688.pdf | 8 | Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX8688.pdf |
9 | 9 | ||
10 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 10 | Author: Guenter Roeck <linux@roeck-us.net> |
11 | 11 | ||
12 | 12 | ||
13 | Description | 13 | Description |
diff --git a/Documentation/hwmon/pmbus b/Documentation/hwmon/pmbus index 3d3a0f97f966..cf756ed48ff9 100644 --- a/Documentation/hwmon/pmbus +++ b/Documentation/hwmon/pmbus | |||
@@ -34,7 +34,7 @@ Supported chips: | |||
34 | Addresses scanned: - | 34 | Addresses scanned: - |
35 | Datasheet: n.a. | 35 | Datasheet: n.a. |
36 | 36 | ||
37 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 37 | Author: Guenter Roeck <linux@roeck-us.net> |
38 | 38 | ||
39 | 39 | ||
40 | Description | 40 | Description |
diff --git a/Documentation/hwmon/smm665 b/Documentation/hwmon/smm665 index 59e316140542..a341eeedab75 100644 --- a/Documentation/hwmon/smm665 +++ b/Documentation/hwmon/smm665 | |||
@@ -29,7 +29,7 @@ Supported chips: | |||
29 | http://www.summitmicro.com/prod_select/summary/SMM766/SMM766_2086.pdf | 29 | http://www.summitmicro.com/prod_select/summary/SMM766/SMM766_2086.pdf |
30 | http://www.summitmicro.com/prod_select/summary/SMM766B/SMM766B_2122.pdf | 30 | http://www.summitmicro.com/prod_select/summary/SMM766B/SMM766B_2122.pdf |
31 | 31 | ||
32 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 32 | Author: Guenter Roeck <linux@roeck-us.net> |
33 | 33 | ||
34 | 34 | ||
35 | Module Parameters | 35 | Module Parameters |
diff --git a/Documentation/hwmon/ucd9000 b/Documentation/hwmon/ucd9000 index 0df5f276505b..805e33edb978 100644 --- a/Documentation/hwmon/ucd9000 +++ b/Documentation/hwmon/ucd9000 | |||
@@ -11,7 +11,7 @@ Supported chips: | |||
11 | http://focus.ti.com/lit/ds/symlink/ucd9090.pdf | 11 | http://focus.ti.com/lit/ds/symlink/ucd9090.pdf |
12 | http://focus.ti.com/lit/ds/symlink/ucd90910.pdf | 12 | http://focus.ti.com/lit/ds/symlink/ucd90910.pdf |
13 | 13 | ||
14 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 14 | Author: Guenter Roeck <linux@roeck-us.net> |
15 | 15 | ||
16 | 16 | ||
17 | Description | 17 | Description |
diff --git a/Documentation/hwmon/ucd9200 b/Documentation/hwmon/ucd9200 index fd7d07b1908a..1e8060e631bd 100644 --- a/Documentation/hwmon/ucd9200 +++ b/Documentation/hwmon/ucd9200 | |||
@@ -15,7 +15,7 @@ Supported chips: | |||
15 | http://focus.ti.com/lit/ds/symlink/ucd9246.pdf | 15 | http://focus.ti.com/lit/ds/symlink/ucd9246.pdf |
16 | http://focus.ti.com/lit/ds/symlink/ucd9248.pdf | 16 | http://focus.ti.com/lit/ds/symlink/ucd9248.pdf |
17 | 17 | ||
18 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 18 | Author: Guenter Roeck <linux@roeck-us.net> |
19 | 19 | ||
20 | 20 | ||
21 | Description | 21 | Description |
diff --git a/Documentation/hwmon/zl6100 b/Documentation/hwmon/zl6100 index 3d924b6b59e9..756b57c6b73e 100644 --- a/Documentation/hwmon/zl6100 +++ b/Documentation/hwmon/zl6100 | |||
@@ -54,7 +54,7 @@ http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146401 | |||
54 | http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146256 | 54 | http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146256 |
55 | 55 | ||
56 | 56 | ||
57 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 57 | Author: Guenter Roeck <linux@roeck-us.net> |
58 | 58 | ||
59 | 59 | ||
60 | Description | 60 | Description |
diff --git a/Documentation/power/opp.txt b/Documentation/power/opp.txt index 3035d00757ad..425c51d56aef 100644 --- a/Documentation/power/opp.txt +++ b/Documentation/power/opp.txt | |||
@@ -1,6 +1,5 @@ | |||
1 | *=============* | 1 | Operating Performance Points (OPP) Library |
2 | * OPP Library * | 2 | ========================================== |
3 | *=============* | ||
4 | 3 | ||
5 | (C) 2009-2010 Nishanth Menon <nm@ti.com>, Texas Instruments Incorporated | 4 | (C) 2009-2010 Nishanth Menon <nm@ti.com>, Texas Instruments Incorporated |
6 | 5 | ||
@@ -16,15 +15,31 @@ Contents | |||
16 | 15 | ||
17 | 1. Introduction | 16 | 1. Introduction |
18 | =============== | 17 | =============== |
18 | 1.1 What is an Operating Performance Point (OPP)? | ||
19 | |||
19 | Complex SoCs of today consists of a multiple sub-modules working in conjunction. | 20 | Complex SoCs of today consists of a multiple sub-modules working in conjunction. |
20 | In an operational system executing varied use cases, not all modules in the SoC | 21 | In an operational system executing varied use cases, not all modules in the SoC |
21 | need to function at their highest performing frequency all the time. To | 22 | need to function at their highest performing frequency all the time. To |
22 | facilitate this, sub-modules in a SoC are grouped into domains, allowing some | 23 | facilitate this, sub-modules in a SoC are grouped into domains, allowing some |
23 | domains to run at lower voltage and frequency while other domains are loaded | 24 | domains to run at lower voltage and frequency while other domains run at |
24 | more. The set of discrete tuples consisting of frequency and voltage pairs that | 25 | voltage/frequency pairs that are higher. |
26 | |||
27 | The set of discrete tuples consisting of frequency and voltage pairs that | ||
25 | the device will support per domain are called Operating Performance Points or | 28 | the device will support per domain are called Operating Performance Points or |
26 | OPPs. | 29 | OPPs. |
27 | 30 | ||
31 | As an example: | ||
32 | Let us consider an MPU device which supports the following: | ||
33 | {300MHz at minimum voltage of 1V}, {800MHz at minimum voltage of 1.2V}, | ||
34 | {1GHz at minimum voltage of 1.3V} | ||
35 | |||
36 | We can represent these as three OPPs as the following {Hz, uV} tuples: | ||
37 | {300000000, 1000000} | ||
38 | {800000000, 1200000} | ||
39 | {1000000000, 1300000} | ||
40 | |||
41 | 1.2 Operating Performance Points Library | ||
42 | |||
28 | OPP library provides a set of helper functions to organize and query the OPP | 43 | OPP library provides a set of helper functions to organize and query the OPP |
29 | information. The library is located in drivers/base/power/opp.c and the header | 44 | information. The library is located in drivers/base/power/opp.c and the header |
30 | is located in include/linux/opp.h. OPP library can be enabled by enabling | 45 | is located in include/linux/opp.h. OPP library can be enabled by enabling |
diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt index e8a6aa473bab..6e953564de03 100644 --- a/Documentation/printk-formats.txt +++ b/Documentation/printk-formats.txt | |||
@@ -170,5 +170,5 @@ Reminder: sizeof() result is of type size_t. | |||
170 | Thank you for your cooperation and attention. | 170 | Thank you for your cooperation and attention. |
171 | 171 | ||
172 | 172 | ||
173 | By Randy Dunlap <rdunlap@xenotime.net> and | 173 | By Randy Dunlap <rdunlap@infradead.org> and |
174 | Andrew Murray <amurray@mpc-data.co.uk> | 174 | Andrew Murray <amurray@mpc-data.co.uk> |
diff --git a/arch/alpha/boot/head.S b/arch/alpha/boot/head.S index b06812bcac83..8efb26686d47 100644 --- a/arch/alpha/boot/head.S +++ b/arch/alpha/boot/head.S | |||
@@ -4,6 +4,7 @@ | |||
4 | * initial bootloader stuff.. | 4 | * initial bootloader stuff.. |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <asm/pal.h> | ||
7 | 8 | ||
8 | .set noreorder | 9 | .set noreorder |
9 | .globl __start | 10 | .globl __start |
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 5cad8a6dadb0..afed28e37ea5 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
@@ -120,7 +120,7 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS) | |||
120 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) | 120 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) |
121 | endif | 121 | endif |
122 | 122 | ||
123 | ccflags-y := -fpic -fno-builtin -I$(obj) | 123 | ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj) |
124 | asflags-y := -Wa,-march=all -DZIMAGE | 124 | asflags-y := -Wa,-march=all -DZIMAGE |
125 | 125 | ||
126 | # Supply kernel BSS size to the decompressor via a linker symbol. | 126 | # Supply kernel BSS size to the decompressor via a linker symbol. |
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h index 9f77e7804f3b..e3d55547e755 100644 --- a/arch/arm/include/asm/mmu.h +++ b/arch/arm/include/asm/mmu.h | |||
@@ -5,15 +5,15 @@ | |||
5 | 5 | ||
6 | typedef struct { | 6 | typedef struct { |
7 | #ifdef CONFIG_CPU_HAS_ASID | 7 | #ifdef CONFIG_CPU_HAS_ASID |
8 | u64 id; | 8 | atomic64_t id; |
9 | #endif | 9 | #endif |
10 | unsigned int vmalloc_seq; | 10 | unsigned int vmalloc_seq; |
11 | } mm_context_t; | 11 | } mm_context_t; |
12 | 12 | ||
13 | #ifdef CONFIG_CPU_HAS_ASID | 13 | #ifdef CONFIG_CPU_HAS_ASID |
14 | #define ASID_BITS 8 | 14 | #define ASID_BITS 8 |
15 | #define ASID_MASK ((~0ULL) << ASID_BITS) | 15 | #define ASID_MASK ((~0ULL) << ASID_BITS) |
16 | #define ASID(mm) ((mm)->context.id & ~ASID_MASK) | 16 | #define ASID(mm) ((mm)->context.id.counter & ~ASID_MASK) |
17 | #else | 17 | #else |
18 | #define ASID(mm) (0) | 18 | #define ASID(mm) (0) |
19 | #endif | 19 | #endif |
@@ -26,7 +26,7 @@ typedef struct { | |||
26 | * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com> | 26 | * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com> |
27 | */ | 27 | */ |
28 | typedef struct { | 28 | typedef struct { |
29 | unsigned long end_brk; | 29 | unsigned long end_brk; |
30 | } mm_context_t; | 30 | } mm_context_t; |
31 | 31 | ||
32 | #endif | 32 | #endif |
diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h index e1f644bc7cc5..863a6611323c 100644 --- a/arch/arm/include/asm/mmu_context.h +++ b/arch/arm/include/asm/mmu_context.h | |||
@@ -25,7 +25,7 @@ void __check_vmalloc_seq(struct mm_struct *mm); | |||
25 | #ifdef CONFIG_CPU_HAS_ASID | 25 | #ifdef CONFIG_CPU_HAS_ASID |
26 | 26 | ||
27 | void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk); | 27 | void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk); |
28 | #define init_new_context(tsk,mm) ({ mm->context.id = 0; }) | 28 | #define init_new_context(tsk,mm) ({ atomic64_set(&mm->context.id, 0); 0; }) |
29 | 29 | ||
30 | #else /* !CONFIG_CPU_HAS_ASID */ | 30 | #else /* !CONFIG_CPU_HAS_ASID */ |
31 | 31 | ||
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h index 6e924d3a77eb..4db8c8820f0d 100644 --- a/arch/arm/include/asm/tlbflush.h +++ b/arch/arm/include/asm/tlbflush.h | |||
@@ -34,10 +34,13 @@ | |||
34 | #define TLB_V6_D_ASID (1 << 17) | 34 | #define TLB_V6_D_ASID (1 << 17) |
35 | #define TLB_V6_I_ASID (1 << 18) | 35 | #define TLB_V6_I_ASID (1 << 18) |
36 | 36 | ||
37 | #define TLB_V6_BP (1 << 19) | ||
38 | |||
37 | /* Unified Inner Shareable TLB operations (ARMv7 MP extensions) */ | 39 | /* Unified Inner Shareable TLB operations (ARMv7 MP extensions) */ |
38 | #define TLB_V7_UIS_PAGE (1 << 19) | 40 | #define TLB_V7_UIS_PAGE (1 << 20) |
39 | #define TLB_V7_UIS_FULL (1 << 20) | 41 | #define TLB_V7_UIS_FULL (1 << 21) |
40 | #define TLB_V7_UIS_ASID (1 << 21) | 42 | #define TLB_V7_UIS_ASID (1 << 22) |
43 | #define TLB_V7_UIS_BP (1 << 23) | ||
41 | 44 | ||
42 | #define TLB_BARRIER (1 << 28) | 45 | #define TLB_BARRIER (1 << 28) |
43 | #define TLB_L2CLEAN_FR (1 << 29) /* Feroceon */ | 46 | #define TLB_L2CLEAN_FR (1 << 29) /* Feroceon */ |
@@ -150,7 +153,8 @@ | |||
150 | #define v6wbi_tlb_flags (TLB_WB | TLB_DCLEAN | TLB_BARRIER | \ | 153 | #define v6wbi_tlb_flags (TLB_WB | TLB_DCLEAN | TLB_BARRIER | \ |
151 | TLB_V6_I_FULL | TLB_V6_D_FULL | \ | 154 | TLB_V6_I_FULL | TLB_V6_D_FULL | \ |
152 | TLB_V6_I_PAGE | TLB_V6_D_PAGE | \ | 155 | TLB_V6_I_PAGE | TLB_V6_D_PAGE | \ |
153 | TLB_V6_I_ASID | TLB_V6_D_ASID) | 156 | TLB_V6_I_ASID | TLB_V6_D_ASID | \ |
157 | TLB_V6_BP) | ||
154 | 158 | ||
155 | #ifdef CONFIG_CPU_TLB_V6 | 159 | #ifdef CONFIG_CPU_TLB_V6 |
156 | # define v6wbi_possible_flags v6wbi_tlb_flags | 160 | # define v6wbi_possible_flags v6wbi_tlb_flags |
@@ -166,9 +170,11 @@ | |||
166 | #endif | 170 | #endif |
167 | 171 | ||
168 | #define v7wbi_tlb_flags_smp (TLB_WB | TLB_DCLEAN | TLB_BARRIER | \ | 172 | #define v7wbi_tlb_flags_smp (TLB_WB | TLB_DCLEAN | TLB_BARRIER | \ |
169 | TLB_V7_UIS_FULL | TLB_V7_UIS_PAGE | TLB_V7_UIS_ASID) | 173 | TLB_V7_UIS_FULL | TLB_V7_UIS_PAGE | \ |
174 | TLB_V7_UIS_ASID | TLB_V7_UIS_BP) | ||
170 | #define v7wbi_tlb_flags_up (TLB_WB | TLB_DCLEAN | TLB_BARRIER | \ | 175 | #define v7wbi_tlb_flags_up (TLB_WB | TLB_DCLEAN | TLB_BARRIER | \ |
171 | TLB_V6_U_FULL | TLB_V6_U_PAGE | TLB_V6_U_ASID) | 176 | TLB_V6_U_FULL | TLB_V6_U_PAGE | \ |
177 | TLB_V6_U_ASID | TLB_V6_BP) | ||
172 | 178 | ||
173 | #ifdef CONFIG_CPU_TLB_V7 | 179 | #ifdef CONFIG_CPU_TLB_V7 |
174 | 180 | ||
@@ -430,6 +436,20 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr) | |||
430 | } | 436 | } |
431 | } | 437 | } |
432 | 438 | ||
439 | static inline void local_flush_bp_all(void) | ||
440 | { | ||
441 | const int zero = 0; | ||
442 | const unsigned int __tlb_flag = __cpu_tlb_flags; | ||
443 | |||
444 | if (tlb_flag(TLB_V7_UIS_BP)) | ||
445 | asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero)); | ||
446 | else if (tlb_flag(TLB_V6_BP)) | ||
447 | asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero)); | ||
448 | |||
449 | if (tlb_flag(TLB_BARRIER)) | ||
450 | isb(); | ||
451 | } | ||
452 | |||
433 | /* | 453 | /* |
434 | * flush_pmd_entry | 454 | * flush_pmd_entry |
435 | * | 455 | * |
@@ -480,6 +500,7 @@ static inline void clean_pmd_entry(void *pmd) | |||
480 | #define flush_tlb_kernel_page local_flush_tlb_kernel_page | 500 | #define flush_tlb_kernel_page local_flush_tlb_kernel_page |
481 | #define flush_tlb_range local_flush_tlb_range | 501 | #define flush_tlb_range local_flush_tlb_range |
482 | #define flush_tlb_kernel_range local_flush_tlb_kernel_range | 502 | #define flush_tlb_kernel_range local_flush_tlb_kernel_range |
503 | #define flush_bp_all local_flush_bp_all | ||
483 | #else | 504 | #else |
484 | extern void flush_tlb_all(void); | 505 | extern void flush_tlb_all(void); |
485 | extern void flush_tlb_mm(struct mm_struct *mm); | 506 | extern void flush_tlb_mm(struct mm_struct *mm); |
@@ -487,6 +508,7 @@ extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr); | |||
487 | extern void flush_tlb_kernel_page(unsigned long kaddr); | 508 | extern void flush_tlb_kernel_page(unsigned long kaddr); |
488 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); | 509 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); |
489 | extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); | 510 | extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); |
511 | extern void flush_bp_all(void); | ||
490 | #endif | 512 | #endif |
491 | 513 | ||
492 | /* | 514 | /* |
diff --git a/arch/arm/include/uapi/asm/unistd.h b/arch/arm/include/uapi/asm/unistd.h index 4da7cde70b5d..af33b44990ed 100644 --- a/arch/arm/include/uapi/asm/unistd.h +++ b/arch/arm/include/uapi/asm/unistd.h | |||
@@ -404,7 +404,7 @@ | |||
404 | #define __NR_setns (__NR_SYSCALL_BASE+375) | 404 | #define __NR_setns (__NR_SYSCALL_BASE+375) |
405 | #define __NR_process_vm_readv (__NR_SYSCALL_BASE+376) | 405 | #define __NR_process_vm_readv (__NR_SYSCALL_BASE+376) |
406 | #define __NR_process_vm_writev (__NR_SYSCALL_BASE+377) | 406 | #define __NR_process_vm_writev (__NR_SYSCALL_BASE+377) |
407 | /* 378 for kcmp */ | 407 | #define __NR_kcmp (__NR_SYSCALL_BASE+378) |
408 | #define __NR_finit_module (__NR_SYSCALL_BASE+379) | 408 | #define __NR_finit_module (__NR_SYSCALL_BASE+379) |
409 | 409 | ||
410 | /* | 410 | /* |
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 5ce738b43508..923eec7105cf 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c | |||
@@ -110,7 +110,7 @@ int main(void) | |||
110 | BLANK(); | 110 | BLANK(); |
111 | #endif | 111 | #endif |
112 | #ifdef CONFIG_CPU_HAS_ASID | 112 | #ifdef CONFIG_CPU_HAS_ASID |
113 | DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id)); | 113 | DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id.counter)); |
114 | BLANK(); | 114 | BLANK(); |
115 | #endif | 115 | #endif |
116 | DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm)); | 116 | DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm)); |
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 0cc57611fc4f..c6ca7e376773 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
@@ -387,7 +387,7 @@ | |||
387 | /* 375 */ CALL(sys_setns) | 387 | /* 375 */ CALL(sys_setns) |
388 | CALL(sys_process_vm_readv) | 388 | CALL(sys_process_vm_readv) |
389 | CALL(sys_process_vm_writev) | 389 | CALL(sys_process_vm_writev) |
390 | CALL(sys_ni_syscall) /* reserved for sys_kcmp */ | 390 | CALL(sys_kcmp) |
391 | CALL(sys_finit_module) | 391 | CALL(sys_finit_module) |
392 | #ifndef syscalls_counted | 392 | #ifndef syscalls_counted |
393 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls | 393 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls |
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 486a15ae9011..e0eb9a1cae77 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -184,13 +184,22 @@ __create_page_tables: | |||
184 | orr r3, r3, #3 @ PGD block type | 184 | orr r3, r3, #3 @ PGD block type |
185 | mov r6, #4 @ PTRS_PER_PGD | 185 | mov r6, #4 @ PTRS_PER_PGD |
186 | mov r7, #1 << (55 - 32) @ L_PGD_SWAPPER | 186 | mov r7, #1 << (55 - 32) @ L_PGD_SWAPPER |
187 | 1: str r3, [r0], #4 @ set bottom PGD entry bits | 187 | 1: |
188 | #ifdef CONFIG_CPU_ENDIAN_BE8 | ||
188 | str r7, [r0], #4 @ set top PGD entry bits | 189 | str r7, [r0], #4 @ set top PGD entry bits |
190 | str r3, [r0], #4 @ set bottom PGD entry bits | ||
191 | #else | ||
192 | str r3, [r0], #4 @ set bottom PGD entry bits | ||
193 | str r7, [r0], #4 @ set top PGD entry bits | ||
194 | #endif | ||
189 | add r3, r3, #0x1000 @ next PMD table | 195 | add r3, r3, #0x1000 @ next PMD table |
190 | subs r6, r6, #1 | 196 | subs r6, r6, #1 |
191 | bne 1b | 197 | bne 1b |
192 | 198 | ||
193 | add r4, r4, #0x1000 @ point to the PMD tables | 199 | add r4, r4, #0x1000 @ point to the PMD tables |
200 | #ifdef CONFIG_CPU_ENDIAN_BE8 | ||
201 | add r4, r4, #4 @ we only write the bottom word | ||
202 | #endif | ||
194 | #endif | 203 | #endif |
195 | 204 | ||
196 | ldr r7, [r10, #PROCINFO_MM_MMUFLAGS] @ mm_mmuflags | 205 | ldr r7, [r10, #PROCINFO_MM_MMUFLAGS] @ mm_mmuflags |
@@ -258,6 +267,11 @@ __create_page_tables: | |||
258 | addne r6, r6, #1 << SECTION_SHIFT | 267 | addne r6, r6, #1 << SECTION_SHIFT |
259 | strne r6, [r3] | 268 | strne r6, [r3] |
260 | 269 | ||
270 | #if defined(CONFIG_LPAE) && defined(CONFIG_CPU_ENDIAN_BE8) | ||
271 | sub r4, r4, #4 @ Fixup page table pointer | ||
272 | @ for 64-bit descriptors | ||
273 | #endif | ||
274 | |||
261 | #ifdef CONFIG_DEBUG_LL | 275 | #ifdef CONFIG_DEBUG_LL |
262 | #if !defined(CONFIG_DEBUG_ICEDCC) && !defined(CONFIG_DEBUG_SEMIHOSTING) | 276 | #if !defined(CONFIG_DEBUG_ICEDCC) && !defined(CONFIG_DEBUG_SEMIHOSTING) |
263 | /* | 277 | /* |
@@ -276,13 +290,17 @@ __create_page_tables: | |||
276 | orr r3, r7, r3, lsl #SECTION_SHIFT | 290 | orr r3, r7, r3, lsl #SECTION_SHIFT |
277 | #ifdef CONFIG_ARM_LPAE | 291 | #ifdef CONFIG_ARM_LPAE |
278 | mov r7, #1 << (54 - 32) @ XN | 292 | mov r7, #1 << (54 - 32) @ XN |
293 | #ifdef CONFIG_CPU_ENDIAN_BE8 | ||
294 | str r7, [r0], #4 | ||
295 | str r3, [r0], #4 | ||
279 | #else | 296 | #else |
280 | orr r3, r3, #PMD_SECT_XN | ||
281 | #endif | ||
282 | str r3, [r0], #4 | 297 | str r3, [r0], #4 |
283 | #ifdef CONFIG_ARM_LPAE | ||
284 | str r7, [r0], #4 | 298 | str r7, [r0], #4 |
285 | #endif | 299 | #endif |
300 | #else | ||
301 | orr r3, r3, #PMD_SECT_XN | ||
302 | str r3, [r0], #4 | ||
303 | #endif | ||
286 | 304 | ||
287 | #else /* CONFIG_DEBUG_ICEDCC || CONFIG_DEBUG_SEMIHOSTING */ | 305 | #else /* CONFIG_DEBUG_ICEDCC || CONFIG_DEBUG_SEMIHOSTING */ |
288 | /* we don't need any serial debugging mappings */ | 306 | /* we don't need any serial debugging mappings */ |
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c index 5eae53e7a2e1..96093b75ab90 100644 --- a/arch/arm/kernel/hw_breakpoint.c +++ b/arch/arm/kernel/hw_breakpoint.c | |||
@@ -1023,7 +1023,7 @@ out_mdbgen: | |||
1023 | static int __cpuinit dbg_reset_notify(struct notifier_block *self, | 1023 | static int __cpuinit dbg_reset_notify(struct notifier_block *self, |
1024 | unsigned long action, void *cpu) | 1024 | unsigned long action, void *cpu) |
1025 | { | 1025 | { |
1026 | if (action == CPU_ONLINE) | 1026 | if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE) |
1027 | smp_call_function_single((int)cpu, reset_ctrl_regs, NULL, 1); | 1027 | smp_call_function_single((int)cpu, reset_ctrl_regs, NULL, 1); |
1028 | 1028 | ||
1029 | return NOTIFY_OK; | 1029 | return NOTIFY_OK; |
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index 31e0eb353cd8..146157dfe27c 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -400,7 +400,7 @@ __hw_perf_event_init(struct perf_event *event) | |||
400 | } | 400 | } |
401 | 401 | ||
402 | if (event->group_leader != event) { | 402 | if (event->group_leader != event) { |
403 | if (validate_group(event) != 0); | 403 | if (validate_group(event) != 0) |
404 | return -EINVAL; | 404 | return -EINVAL; |
405 | } | 405 | } |
406 | 406 | ||
@@ -484,7 +484,7 @@ const struct dev_pm_ops armpmu_dev_pm_ops = { | |||
484 | SET_RUNTIME_PM_OPS(armpmu_runtime_suspend, armpmu_runtime_resume, NULL) | 484 | SET_RUNTIME_PM_OPS(armpmu_runtime_suspend, armpmu_runtime_resume, NULL) |
485 | }; | 485 | }; |
486 | 486 | ||
487 | static void __init armpmu_init(struct arm_pmu *armpmu) | 487 | static void armpmu_init(struct arm_pmu *armpmu) |
488 | { | 488 | { |
489 | atomic_set(&armpmu->active_events, 0); | 489 | atomic_set(&armpmu->active_events, 0); |
490 | mutex_init(&armpmu->reserve_mutex); | 490 | mutex_init(&armpmu->reserve_mutex); |
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c index 8c79a9e70b83..039cffb053a7 100644 --- a/arch/arm/kernel/perf_event_v7.c +++ b/arch/arm/kernel/perf_event_v7.c | |||
@@ -774,7 +774,7 @@ static const unsigned armv7_a7_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | |||
774 | /* | 774 | /* |
775 | * PMXEVTYPER: Event selection reg | 775 | * PMXEVTYPER: Event selection reg |
776 | */ | 776 | */ |
777 | #define ARMV7_EVTYPE_MASK 0xc00000ff /* Mask for writable bits */ | 777 | #define ARMV7_EVTYPE_MASK 0xc80000ff /* Mask for writable bits */ |
778 | #define ARMV7_EVTYPE_EVENT 0xff /* Mask for EVENT bits */ | 778 | #define ARMV7_EVTYPE_EVENT 0xff /* Mask for EVENT bits */ |
779 | 779 | ||
780 | /* | 780 | /* |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 1bdfd87c8e41..31644f1978d5 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -285,6 +285,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void) | |||
285 | * switch away from it before attempting any exclusive accesses. | 285 | * switch away from it before attempting any exclusive accesses. |
286 | */ | 286 | */ |
287 | cpu_switch_mm(mm->pgd, mm); | 287 | cpu_switch_mm(mm->pgd, mm); |
288 | local_flush_bp_all(); | ||
288 | enter_lazy_tlb(mm, current); | 289 | enter_lazy_tlb(mm, current); |
289 | local_flush_tlb_all(); | 290 | local_flush_tlb_all(); |
290 | 291 | ||
diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c index 02c5d2ce23bf..bd0300531399 100644 --- a/arch/arm/kernel/smp_tlb.c +++ b/arch/arm/kernel/smp_tlb.c | |||
@@ -64,6 +64,11 @@ static inline void ipi_flush_tlb_kernel_range(void *arg) | |||
64 | local_flush_tlb_kernel_range(ta->ta_start, ta->ta_end); | 64 | local_flush_tlb_kernel_range(ta->ta_start, ta->ta_end); |
65 | } | 65 | } |
66 | 66 | ||
67 | static inline void ipi_flush_bp_all(void *ignored) | ||
68 | { | ||
69 | local_flush_bp_all(); | ||
70 | } | ||
71 | |||
67 | void flush_tlb_all(void) | 72 | void flush_tlb_all(void) |
68 | { | 73 | { |
69 | if (tlb_ops_need_broadcast()) | 74 | if (tlb_ops_need_broadcast()) |
@@ -127,3 +132,10 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end) | |||
127 | local_flush_tlb_kernel_range(start, end); | 132 | local_flush_tlb_kernel_range(start, end); |
128 | } | 133 | } |
129 | 134 | ||
135 | void flush_bp_all(void) | ||
136 | { | ||
137 | if (tlb_ops_need_broadcast()) | ||
138 | on_each_cpu(ipi_flush_bp_all, NULL, 1); | ||
139 | else | ||
140 | local_flush_bp_all(); | ||
141 | } | ||
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index c092115d903a..3f2565037480 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/of_irq.h> | 22 | #include <linux/of_irq.h> |
23 | #include <linux/of_address.h> | 23 | #include <linux/of_address.h> |
24 | 24 | ||
25 | #include <asm/smp_plat.h> | ||
25 | #include <asm/smp_twd.h> | 26 | #include <asm/smp_twd.h> |
26 | #include <asm/localtimer.h> | 27 | #include <asm/localtimer.h> |
27 | 28 | ||
@@ -373,6 +374,9 @@ void __init twd_local_timer_of_register(void) | |||
373 | struct device_node *np; | 374 | struct device_node *np; |
374 | int err; | 375 | int err; |
375 | 376 | ||
377 | if (!is_smp() || !setup_max_cpus) | ||
378 | return; | ||
379 | |||
376 | np = of_find_matching_node(NULL, twd_of_match); | 380 | np = of_find_matching_node(NULL, twd_of_match); |
377 | if (!np) | 381 | if (!np) |
378 | return; | 382 | return; |
diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c index 358bca3a995e..c59c97ea8268 100644 --- a/arch/arm/kernel/suspend.c +++ b/arch/arm/kernel/suspend.c | |||
@@ -68,6 +68,7 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) | |||
68 | ret = __cpu_suspend(arg, fn); | 68 | ret = __cpu_suspend(arg, fn); |
69 | if (ret == 0) { | 69 | if (ret == 0) { |
70 | cpu_switch_mm(mm->pgd, mm); | 70 | cpu_switch_mm(mm->pgd, mm); |
71 | local_flush_bp_all(); | ||
71 | local_flush_tlb_all(); | 72 | local_flush_tlb_all(); |
72 | } | 73 | } |
73 | 74 | ||
diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S index 650d5923ab83..d912e7397ecc 100644 --- a/arch/arm/lib/memset.S +++ b/arch/arm/lib/memset.S | |||
@@ -19,9 +19,9 @@ | |||
19 | 1: subs r2, r2, #4 @ 1 do we have enough | 19 | 1: subs r2, r2, #4 @ 1 do we have enough |
20 | blt 5f @ 1 bytes to align with? | 20 | blt 5f @ 1 bytes to align with? |
21 | cmp r3, #2 @ 1 | 21 | cmp r3, #2 @ 1 |
22 | strltb r1, [r0], #1 @ 1 | 22 | strltb r1, [ip], #1 @ 1 |
23 | strleb r1, [r0], #1 @ 1 | 23 | strleb r1, [ip], #1 @ 1 |
24 | strb r1, [r0], #1 @ 1 | 24 | strb r1, [ip], #1 @ 1 |
25 | add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3)) | 25 | add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3)) |
26 | /* | 26 | /* |
27 | * The pointer is now aligned and the length is adjusted. Try doing the | 27 | * The pointer is now aligned and the length is adjusted. Try doing the |
@@ -29,10 +29,14 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | ENTRY(memset) | 31 | ENTRY(memset) |
32 | ands r3, r0, #3 @ 1 unaligned? | 32 | /* |
33 | * Preserve the contents of r0 for the return value. | ||
34 | */ | ||
35 | mov ip, r0 | ||
36 | ands r3, ip, #3 @ 1 unaligned? | ||
33 | bne 1b @ 1 | 37 | bne 1b @ 1 |
34 | /* | 38 | /* |
35 | * we know that the pointer in r0 is aligned to a word boundary. | 39 | * we know that the pointer in ip is aligned to a word boundary. |
36 | */ | 40 | */ |
37 | orr r1, r1, r1, lsl #8 | 41 | orr r1, r1, r1, lsl #8 |
38 | orr r1, r1, r1, lsl #16 | 42 | orr r1, r1, r1, lsl #16 |
@@ -43,29 +47,28 @@ ENTRY(memset) | |||
43 | #if ! CALGN(1)+0 | 47 | #if ! CALGN(1)+0 |
44 | 48 | ||
45 | /* | 49 | /* |
46 | * We need an extra register for this loop - save the return address and | 50 | * We need 2 extra registers for this loop - use r8 and the LR |
47 | * use the LR | ||
48 | */ | 51 | */ |
49 | str lr, [sp, #-4]! | 52 | stmfd sp!, {r8, lr} |
50 | mov ip, r1 | 53 | mov r8, r1 |
51 | mov lr, r1 | 54 | mov lr, r1 |
52 | 55 | ||
53 | 2: subs r2, r2, #64 | 56 | 2: subs r2, r2, #64 |
54 | stmgeia r0!, {r1, r3, ip, lr} @ 64 bytes at a time. | 57 | stmgeia ip!, {r1, r3, r8, lr} @ 64 bytes at a time. |
55 | stmgeia r0!, {r1, r3, ip, lr} | 58 | stmgeia ip!, {r1, r3, r8, lr} |
56 | stmgeia r0!, {r1, r3, ip, lr} | 59 | stmgeia ip!, {r1, r3, r8, lr} |
57 | stmgeia r0!, {r1, r3, ip, lr} | 60 | stmgeia ip!, {r1, r3, r8, lr} |
58 | bgt 2b | 61 | bgt 2b |
59 | ldmeqfd sp!, {pc} @ Now <64 bytes to go. | 62 | ldmeqfd sp!, {r8, pc} @ Now <64 bytes to go. |
60 | /* | 63 | /* |
61 | * No need to correct the count; we're only testing bits from now on | 64 | * No need to correct the count; we're only testing bits from now on |
62 | */ | 65 | */ |
63 | tst r2, #32 | 66 | tst r2, #32 |
64 | stmneia r0!, {r1, r3, ip, lr} | 67 | stmneia ip!, {r1, r3, r8, lr} |
65 | stmneia r0!, {r1, r3, ip, lr} | 68 | stmneia ip!, {r1, r3, r8, lr} |
66 | tst r2, #16 | 69 | tst r2, #16 |
67 | stmneia r0!, {r1, r3, ip, lr} | 70 | stmneia ip!, {r1, r3, r8, lr} |
68 | ldr lr, [sp], #4 | 71 | ldmfd sp!, {r8, lr} |
69 | 72 | ||
70 | #else | 73 | #else |
71 | 74 | ||
@@ -74,54 +77,54 @@ ENTRY(memset) | |||
74 | * whole cache lines at once. | 77 | * whole cache lines at once. |
75 | */ | 78 | */ |
76 | 79 | ||
77 | stmfd sp!, {r4-r7, lr} | 80 | stmfd sp!, {r4-r8, lr} |
78 | mov r4, r1 | 81 | mov r4, r1 |
79 | mov r5, r1 | 82 | mov r5, r1 |
80 | mov r6, r1 | 83 | mov r6, r1 |
81 | mov r7, r1 | 84 | mov r7, r1 |
82 | mov ip, r1 | 85 | mov r8, r1 |
83 | mov lr, r1 | 86 | mov lr, r1 |
84 | 87 | ||
85 | cmp r2, #96 | 88 | cmp r2, #96 |
86 | tstgt r0, #31 | 89 | tstgt ip, #31 |
87 | ble 3f | 90 | ble 3f |
88 | 91 | ||
89 | and ip, r0, #31 | 92 | and r8, ip, #31 |
90 | rsb ip, ip, #32 | 93 | rsb r8, r8, #32 |
91 | sub r2, r2, ip | 94 | sub r2, r2, r8 |
92 | movs ip, ip, lsl #(32 - 4) | 95 | movs r8, r8, lsl #(32 - 4) |
93 | stmcsia r0!, {r4, r5, r6, r7} | 96 | stmcsia ip!, {r4, r5, r6, r7} |
94 | stmmiia r0!, {r4, r5} | 97 | stmmiia ip!, {r4, r5} |
95 | tst ip, #(1 << 30) | 98 | tst r8, #(1 << 30) |
96 | mov ip, r1 | 99 | mov r8, r1 |
97 | strne r1, [r0], #4 | 100 | strne r1, [ip], #4 |
98 | 101 | ||
99 | 3: subs r2, r2, #64 | 102 | 3: subs r2, r2, #64 |
100 | stmgeia r0!, {r1, r3-r7, ip, lr} | 103 | stmgeia ip!, {r1, r3-r8, lr} |
101 | stmgeia r0!, {r1, r3-r7, ip, lr} | 104 | stmgeia ip!, {r1, r3-r8, lr} |
102 | bgt 3b | 105 | bgt 3b |
103 | ldmeqfd sp!, {r4-r7, pc} | 106 | ldmeqfd sp!, {r4-r8, pc} |
104 | 107 | ||
105 | tst r2, #32 | 108 | tst r2, #32 |
106 | stmneia r0!, {r1, r3-r7, ip, lr} | 109 | stmneia ip!, {r1, r3-r8, lr} |
107 | tst r2, #16 | 110 | tst r2, #16 |
108 | stmneia r0!, {r4-r7} | 111 | stmneia ip!, {r4-r7} |
109 | ldmfd sp!, {r4-r7, lr} | 112 | ldmfd sp!, {r4-r8, lr} |
110 | 113 | ||
111 | #endif | 114 | #endif |
112 | 115 | ||
113 | 4: tst r2, #8 | 116 | 4: tst r2, #8 |
114 | stmneia r0!, {r1, r3} | 117 | stmneia ip!, {r1, r3} |
115 | tst r2, #4 | 118 | tst r2, #4 |
116 | strne r1, [r0], #4 | 119 | strne r1, [ip], #4 |
117 | /* | 120 | /* |
118 | * When we get here, we've got less than 4 bytes to zero. We | 121 | * When we get here, we've got less than 4 bytes to zero. We |
119 | * may have an unaligned pointer as well. | 122 | * may have an unaligned pointer as well. |
120 | */ | 123 | */ |
121 | 5: tst r2, #2 | 124 | 5: tst r2, #2 |
122 | strneb r1, [r0], #1 | 125 | strneb r1, [ip], #1 |
123 | strneb r1, [r0], #1 | 126 | strneb r1, [ip], #1 |
124 | tst r2, #1 | 127 | tst r2, #1 |
125 | strneb r1, [r0], #1 | 128 | strneb r1, [ip], #1 |
126 | mov pc, lr | 129 | mov pc, lr |
127 | ENDPROC(memset) | 130 | ENDPROC(memset) |
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c index 27c2cb7ab813..1504b68f4c66 100644 --- a/arch/arm/mach-netx/generic.c +++ b/arch/arm/mach-netx/generic.c | |||
@@ -168,7 +168,7 @@ void __init netx_init_irq(void) | |||
168 | { | 168 | { |
169 | int irq; | 169 | int irq; |
170 | 170 | ||
171 | vic_init(io_p2v(NETX_PA_VIC), 0, ~0, 0); | 171 | vic_init(io_p2v(NETX_PA_VIC), NETX_IRQ_VIC_START, ~0, 0); |
172 | 172 | ||
173 | for (irq = NETX_IRQ_HIF_CHAINED(0); irq <= NETX_IRQ_HIF_LAST; irq++) { | 173 | for (irq = NETX_IRQ_HIF_CHAINED(0); irq <= NETX_IRQ_HIF_LAST; irq++) { |
174 | irq_set_chip_and_handler(irq, &netx_hif_chip, | 174 | irq_set_chip_and_handler(irq, &netx_hif_chip, |
diff --git a/arch/arm/mach-netx/include/mach/irqs.h b/arch/arm/mach-netx/include/mach/irqs.h index 6ce914d54a30..8f74a844a775 100644 --- a/arch/arm/mach-netx/include/mach/irqs.h +++ b/arch/arm/mach-netx/include/mach/irqs.h | |||
@@ -17,42 +17,42 @@ | |||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #define NETX_IRQ_VIC_START 0 | 20 | #define NETX_IRQ_VIC_START 64 |
21 | #define NETX_IRQ_SOFTINT 0 | 21 | #define NETX_IRQ_SOFTINT (NETX_IRQ_VIC_START + 0) |
22 | #define NETX_IRQ_TIMER0 1 | 22 | #define NETX_IRQ_TIMER0 (NETX_IRQ_VIC_START + 1) |
23 | #define NETX_IRQ_TIMER1 2 | 23 | #define NETX_IRQ_TIMER1 (NETX_IRQ_VIC_START + 2) |
24 | #define NETX_IRQ_TIMER2 3 | 24 | #define NETX_IRQ_TIMER2 (NETX_IRQ_VIC_START + 3) |
25 | #define NETX_IRQ_SYSTIME_NS 4 | 25 | #define NETX_IRQ_SYSTIME_NS (NETX_IRQ_VIC_START + 4) |
26 | #define NETX_IRQ_SYSTIME_S 5 | 26 | #define NETX_IRQ_SYSTIME_S (NETX_IRQ_VIC_START + 5) |
27 | #define NETX_IRQ_GPIO_15 6 | 27 | #define NETX_IRQ_GPIO_15 (NETX_IRQ_VIC_START + 6) |
28 | #define NETX_IRQ_WATCHDOG 7 | 28 | #define NETX_IRQ_WATCHDOG (NETX_IRQ_VIC_START + 7) |
29 | #define NETX_IRQ_UART0 8 | 29 | #define NETX_IRQ_UART0 (NETX_IRQ_VIC_START + 8) |
30 | #define NETX_IRQ_UART1 9 | 30 | #define NETX_IRQ_UART1 (NETX_IRQ_VIC_START + 9) |
31 | #define NETX_IRQ_UART2 10 | 31 | #define NETX_IRQ_UART2 (NETX_IRQ_VIC_START + 10) |
32 | #define NETX_IRQ_USB 11 | 32 | #define NETX_IRQ_USB (NETX_IRQ_VIC_START + 11) |
33 | #define NETX_IRQ_SPI 12 | 33 | #define NETX_IRQ_SPI (NETX_IRQ_VIC_START + 12) |
34 | #define NETX_IRQ_I2C 13 | 34 | #define NETX_IRQ_I2C (NETX_IRQ_VIC_START + 13) |
35 | #define NETX_IRQ_LCD 14 | 35 | #define NETX_IRQ_LCD (NETX_IRQ_VIC_START + 14) |
36 | #define NETX_IRQ_HIF 15 | 36 | #define NETX_IRQ_HIF (NETX_IRQ_VIC_START + 15) |
37 | #define NETX_IRQ_GPIO_0_14 16 | 37 | #define NETX_IRQ_GPIO_0_14 (NETX_IRQ_VIC_START + 16) |
38 | #define NETX_IRQ_XPEC0 17 | 38 | #define NETX_IRQ_XPEC0 (NETX_IRQ_VIC_START + 17) |
39 | #define NETX_IRQ_XPEC1 18 | 39 | #define NETX_IRQ_XPEC1 (NETX_IRQ_VIC_START + 18) |
40 | #define NETX_IRQ_XPEC2 19 | 40 | #define NETX_IRQ_XPEC2 (NETX_IRQ_VIC_START + 19) |
41 | #define NETX_IRQ_XPEC3 20 | 41 | #define NETX_IRQ_XPEC3 (NETX_IRQ_VIC_START + 20) |
42 | #define NETX_IRQ_XPEC(no) (17 + (no)) | 42 | #define NETX_IRQ_XPEC(no) (NETX_IRQ_VIC_START + 17 + (no)) |
43 | #define NETX_IRQ_MSYNC0 21 | 43 | #define NETX_IRQ_MSYNC0 (NETX_IRQ_VIC_START + 21) |
44 | #define NETX_IRQ_MSYNC1 22 | 44 | #define NETX_IRQ_MSYNC1 (NETX_IRQ_VIC_START + 22) |
45 | #define NETX_IRQ_MSYNC2 23 | 45 | #define NETX_IRQ_MSYNC2 (NETX_IRQ_VIC_START + 23) |
46 | #define NETX_IRQ_MSYNC3 24 | 46 | #define NETX_IRQ_MSYNC3 (NETX_IRQ_VIC_START + 24) |
47 | #define NETX_IRQ_IRQ_PHY 25 | 47 | #define NETX_IRQ_IRQ_PHY (NETX_IRQ_VIC_START + 25) |
48 | #define NETX_IRQ_ISO_AREA 26 | 48 | #define NETX_IRQ_ISO_AREA (NETX_IRQ_VIC_START + 26) |
49 | /* int 27 is reserved */ | 49 | /* int 27 is reserved */ |
50 | /* int 28 is reserved */ | 50 | /* int 28 is reserved */ |
51 | #define NETX_IRQ_TIMER3 29 | 51 | #define NETX_IRQ_TIMER3 (NETX_IRQ_VIC_START + 29) |
52 | #define NETX_IRQ_TIMER4 30 | 52 | #define NETX_IRQ_TIMER4 (NETX_IRQ_VIC_START + 30) |
53 | /* int 31 is reserved */ | 53 | /* int 31 is reserved */ |
54 | 54 | ||
55 | #define NETX_IRQS 32 | 55 | #define NETX_IRQS (NETX_IRQ_VIC_START + 32) |
56 | 56 | ||
57 | /* for multiplexed irqs on gpio 0..14 */ | 57 | /* for multiplexed irqs on gpio 0..14 */ |
58 | #define NETX_IRQ_GPIO(x) (NETX_IRQS + (x)) | 58 | #define NETX_IRQ_GPIO(x) (NETX_IRQS + (x)) |
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index 7a0511191f6b..a5a4b2bc42ba 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c | |||
@@ -152,9 +152,9 @@ static int is_reserved_asid(u64 asid) | |||
152 | return 0; | 152 | return 0; |
153 | } | 153 | } |
154 | 154 | ||
155 | static void new_context(struct mm_struct *mm, unsigned int cpu) | 155 | static u64 new_context(struct mm_struct *mm, unsigned int cpu) |
156 | { | 156 | { |
157 | u64 asid = mm->context.id; | 157 | u64 asid = atomic64_read(&mm->context.id); |
158 | u64 generation = atomic64_read(&asid_generation); | 158 | u64 generation = atomic64_read(&asid_generation); |
159 | 159 | ||
160 | if (asid != 0 && is_reserved_asid(asid)) { | 160 | if (asid != 0 && is_reserved_asid(asid)) { |
@@ -181,13 +181,14 @@ static void new_context(struct mm_struct *mm, unsigned int cpu) | |||
181 | cpumask_clear(mm_cpumask(mm)); | 181 | cpumask_clear(mm_cpumask(mm)); |
182 | } | 182 | } |
183 | 183 | ||
184 | mm->context.id = asid; | 184 | return asid; |
185 | } | 185 | } |
186 | 186 | ||
187 | void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk) | 187 | void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk) |
188 | { | 188 | { |
189 | unsigned long flags; | 189 | unsigned long flags; |
190 | unsigned int cpu = smp_processor_id(); | 190 | unsigned int cpu = smp_processor_id(); |
191 | u64 asid; | ||
191 | 192 | ||
192 | if (unlikely(mm->context.vmalloc_seq != init_mm.context.vmalloc_seq)) | 193 | if (unlikely(mm->context.vmalloc_seq != init_mm.context.vmalloc_seq)) |
193 | __check_vmalloc_seq(mm); | 194 | __check_vmalloc_seq(mm); |
@@ -198,20 +199,26 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk) | |||
198 | */ | 199 | */ |
199 | cpu_set_reserved_ttbr0(); | 200 | cpu_set_reserved_ttbr0(); |
200 | 201 | ||
201 | if (!((mm->context.id ^ atomic64_read(&asid_generation)) >> ASID_BITS) | 202 | asid = atomic64_read(&mm->context.id); |
202 | && atomic64_xchg(&per_cpu(active_asids, cpu), mm->context.id)) | 203 | if (!((asid ^ atomic64_read(&asid_generation)) >> ASID_BITS) |
204 | && atomic64_xchg(&per_cpu(active_asids, cpu), asid)) | ||
203 | goto switch_mm_fastpath; | 205 | goto switch_mm_fastpath; |
204 | 206 | ||
205 | raw_spin_lock_irqsave(&cpu_asid_lock, flags); | 207 | raw_spin_lock_irqsave(&cpu_asid_lock, flags); |
206 | /* Check that our ASID belongs to the current generation. */ | 208 | /* Check that our ASID belongs to the current generation. */ |
207 | if ((mm->context.id ^ atomic64_read(&asid_generation)) >> ASID_BITS) | 209 | asid = atomic64_read(&mm->context.id); |
208 | new_context(mm, cpu); | 210 | if ((asid ^ atomic64_read(&asid_generation)) >> ASID_BITS) { |
209 | 211 | asid = new_context(mm, cpu); | |
210 | atomic64_set(&per_cpu(active_asids, cpu), mm->context.id); | 212 | atomic64_set(&mm->context.id, asid); |
211 | cpumask_set_cpu(cpu, mm_cpumask(mm)); | 213 | } |
212 | 214 | ||
213 | if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) | 215 | if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) { |
216 | local_flush_bp_all(); | ||
214 | local_flush_tlb_all(); | 217 | local_flush_tlb_all(); |
218 | } | ||
219 | |||
220 | atomic64_set(&per_cpu(active_asids, cpu), asid); | ||
221 | cpumask_set_cpu(cpu, mm_cpumask(mm)); | ||
215 | raw_spin_unlock_irqrestore(&cpu_asid_lock, flags); | 222 | raw_spin_unlock_irqrestore(&cpu_asid_lock, flags); |
216 | 223 | ||
217 | switch_mm_fastpath: | 224 | switch_mm_fastpath: |
diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c index 2dffc010cc41..5ee505c937d1 100644 --- a/arch/arm/mm/idmap.c +++ b/arch/arm/mm/idmap.c | |||
@@ -141,6 +141,7 @@ void setup_mm_for_reboot(void) | |||
141 | { | 141 | { |
142 | /* Switch to the identity mapping. */ | 142 | /* Switch to the identity mapping. */ |
143 | cpu_switch_mm(idmap_pgd, &init_mm); | 143 | cpu_switch_mm(idmap_pgd, &init_mm); |
144 | local_flush_bp_all(); | ||
144 | 145 | ||
145 | #ifdef CONFIG_CPU_HAS_ASID | 146 | #ifdef CONFIG_CPU_HAS_ASID |
146 | /* | 147 | /* |
diff --git a/arch/arm/mm/proc-v7-3level.S b/arch/arm/mm/proc-v7-3level.S index 50bf1dafc9ea..6ffd78c0f9ab 100644 --- a/arch/arm/mm/proc-v7-3level.S +++ b/arch/arm/mm/proc-v7-3level.S | |||
@@ -48,7 +48,7 @@ | |||
48 | ENTRY(cpu_v7_switch_mm) | 48 | ENTRY(cpu_v7_switch_mm) |
49 | #ifdef CONFIG_MMU | 49 | #ifdef CONFIG_MMU |
50 | mmid r1, r1 @ get mm->context.id | 50 | mmid r1, r1 @ get mm->context.id |
51 | and r3, r1, #0xff | 51 | asid r3, r1 |
52 | mov r3, r3, lsl #(48 - 32) @ ASID | 52 | mov r3, r3, lsl #(48 - 32) @ ASID |
53 | mcrr p15, 0, r0, r3, c2 @ set TTB 0 | 53 | mcrr p15, 0, r0, r3, c2 @ set TTB 0 |
54 | isb | 54 | isb |
diff --git a/arch/metag/include/asm/elf.h b/arch/metag/include/asm/elf.h index d63b9d0e57dd..d2baf6961794 100644 --- a/arch/metag/include/asm/elf.h +++ b/arch/metag/include/asm/elf.h | |||
@@ -100,9 +100,6 @@ typedef unsigned long elf_fpregset_t; | |||
100 | 100 | ||
101 | #define ELF_PLATFORM (NULL) | 101 | #define ELF_PLATFORM (NULL) |
102 | 102 | ||
103 | #define SET_PERSONALITY(ex) \ | ||
104 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
105 | |||
106 | #define STACK_RND_MASK (0) | 103 | #define STACK_RND_MASK (0) |
107 | 104 | ||
108 | #ifdef CONFIG_METAG_USER_TCM | 105 | #ifdef CONFIG_METAG_USER_TCM |
diff --git a/arch/metag/mm/Kconfig b/arch/metag/mm/Kconfig index cd7f2f2ad416..975f2f4e3ecf 100644 --- a/arch/metag/mm/Kconfig +++ b/arch/metag/mm/Kconfig | |||
@@ -40,6 +40,7 @@ endchoice | |||
40 | 40 | ||
41 | config NUMA | 41 | config NUMA |
42 | bool "Non Uniform Memory Access (NUMA) Support" | 42 | bool "Non Uniform Memory Access (NUMA) Support" |
43 | select ARCH_WANT_NUMA_VARIABLE_LOCALITY | ||
43 | help | 44 | help |
44 | Some Meta systems have MMU-mappable on-chip memories with | 45 | Some Meta systems have MMU-mappable on-chip memories with |
45 | lower latencies than main memory. This enables support for | 46 | lower latencies than main memory. This enables support for |
diff --git a/arch/tile/include/asm/compat.h b/arch/tile/include/asm/compat.h index 001d418a8957..78f1f2ded86c 100644 --- a/arch/tile/include/asm/compat.h +++ b/arch/tile/include/asm/compat.h | |||
@@ -288,6 +288,9 @@ long compat_sys_sync_file_range2(int fd, unsigned int flags, | |||
288 | long compat_sys_fallocate(int fd, int mode, | 288 | long compat_sys_fallocate(int fd, int mode, |
289 | u32 offset_lo, u32 offset_hi, | 289 | u32 offset_lo, u32 offset_hi, |
290 | u32 len_lo, u32 len_hi); | 290 | u32 len_lo, u32 len_hi); |
291 | long compat_sys_llseek(unsigned int fd, unsigned int offset_high, | ||
292 | unsigned int offset_low, loff_t __user * result, | ||
293 | unsigned int origin); | ||
291 | 294 | ||
292 | /* Assembly trampoline to avoid clobbering r0. */ | 295 | /* Assembly trampoline to avoid clobbering r0. */ |
293 | long _compat_sys_rt_sigreturn(void); | 296 | long _compat_sys_rt_sigreturn(void); |
diff --git a/arch/tile/kernel/compat.c b/arch/tile/kernel/compat.c index 7f72401b4f45..6ea4cdb3c6a0 100644 --- a/arch/tile/kernel/compat.c +++ b/arch/tile/kernel/compat.c | |||
@@ -32,50 +32,65 @@ | |||
32 | * adapt the usual convention. | 32 | * adapt the usual convention. |
33 | */ | 33 | */ |
34 | 34 | ||
35 | long compat_sys_truncate64(char __user *filename, u32 dummy, u32 low, u32 high) | 35 | COMPAT_SYSCALL_DEFINE4(truncate64, char __user *, filename, u32, dummy, |
36 | u32, low, u32, high) | ||
36 | { | 37 | { |
37 | return sys_truncate(filename, ((loff_t)high << 32) | low); | 38 | return sys_truncate(filename, ((loff_t)high << 32) | low); |
38 | } | 39 | } |
39 | 40 | ||
40 | long compat_sys_ftruncate64(unsigned int fd, u32 dummy, u32 low, u32 high) | 41 | COMPAT_SYSCALL_DEFINE4(ftruncate64, unsigned int, fd, u32, dummy, |
42 | u32, low, u32, high) | ||
41 | { | 43 | { |
42 | return sys_ftruncate(fd, ((loff_t)high << 32) | low); | 44 | return sys_ftruncate(fd, ((loff_t)high << 32) | low); |
43 | } | 45 | } |
44 | 46 | ||
45 | long compat_sys_pread64(unsigned int fd, char __user *ubuf, size_t count, | 47 | COMPAT_SYSCALL_DEFINE6(pread64, unsigned int, fd, char __user *, ubuf, |
46 | u32 dummy, u32 low, u32 high) | 48 | size_t, count, u32, dummy, u32, low, u32, high) |
47 | { | 49 | { |
48 | return sys_pread64(fd, ubuf, count, ((loff_t)high << 32) | low); | 50 | return sys_pread64(fd, ubuf, count, ((loff_t)high << 32) | low); |
49 | } | 51 | } |
50 | 52 | ||
51 | long compat_sys_pwrite64(unsigned int fd, char __user *ubuf, size_t count, | 53 | COMPAT_SYSCALL_DEFINE6(pwrite64, unsigned int, fd, char __user *, ubuf, |
52 | u32 dummy, u32 low, u32 high) | 54 | size_t, count, u32, dummy, u32, low, u32, high) |
53 | { | 55 | { |
54 | return sys_pwrite64(fd, ubuf, count, ((loff_t)high << 32) | low); | 56 | return sys_pwrite64(fd, ubuf, count, ((loff_t)high << 32) | low); |
55 | } | 57 | } |
56 | 58 | ||
57 | long compat_sys_lookup_dcookie(u32 low, u32 high, char __user *buf, size_t len) | 59 | COMPAT_SYSCALL_DEFINE4(lookup_dcookie, u32, low, u32, high, |
60 | char __user *, buf, size_t, len) | ||
58 | { | 61 | { |
59 | return sys_lookup_dcookie(((loff_t)high << 32) | low, buf, len); | 62 | return sys_lookup_dcookie(((loff_t)high << 32) | low, buf, len); |
60 | } | 63 | } |
61 | 64 | ||
62 | long compat_sys_sync_file_range2(int fd, unsigned int flags, | 65 | COMPAT_SYSCALL_DEFINE6(sync_file_range2, int, fd, unsigned int, flags, |
63 | u32 offset_lo, u32 offset_hi, | 66 | u32, offset_lo, u32, offset_hi, |
64 | u32 nbytes_lo, u32 nbytes_hi) | 67 | u32, nbytes_lo, u32, nbytes_hi) |
65 | { | 68 | { |
66 | return sys_sync_file_range(fd, ((loff_t)offset_hi << 32) | offset_lo, | 69 | return sys_sync_file_range(fd, ((loff_t)offset_hi << 32) | offset_lo, |
67 | ((loff_t)nbytes_hi << 32) | nbytes_lo, | 70 | ((loff_t)nbytes_hi << 32) | nbytes_lo, |
68 | flags); | 71 | flags); |
69 | } | 72 | } |
70 | 73 | ||
71 | long compat_sys_fallocate(int fd, int mode, | 74 | COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, |
72 | u32 offset_lo, u32 offset_hi, | 75 | u32, offset_lo, u32, offset_hi, |
73 | u32 len_lo, u32 len_hi) | 76 | u32, len_lo, u32, len_hi) |
74 | { | 77 | { |
75 | return sys_fallocate(fd, mode, ((loff_t)offset_hi << 32) | offset_lo, | 78 | return sys_fallocate(fd, mode, ((loff_t)offset_hi << 32) | offset_lo, |
76 | ((loff_t)len_hi << 32) | len_lo); | 79 | ((loff_t)len_hi << 32) | len_lo); |
77 | } | 80 | } |
78 | 81 | ||
82 | /* | ||
83 | * Avoid bug in generic sys_llseek() that specifies offset_high and | ||
84 | * offset_low as "unsigned long", thus making it possible to pass | ||
85 | * a sign-extended high 32 bits in offset_low. | ||
86 | */ | ||
87 | COMPAT_SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned int, offset_high, | ||
88 | unsigned int, offset_low, loff_t __user *, result, | ||
89 | unsigned int, origin) | ||
90 | { | ||
91 | return sys_llseek(fd, offset_high, offset_low, result, origin); | ||
92 | } | ||
93 | |||
79 | /* Provide the compat syscall number to call mapping. */ | 94 | /* Provide the compat syscall number to call mapping. */ |
80 | #undef __SYSCALL | 95 | #undef __SYSCALL |
81 | #define __SYSCALL(nr, call) [nr] = (call), | 96 | #define __SYSCALL(nr, call) [nr] = (call), |
@@ -83,6 +98,7 @@ long compat_sys_fallocate(int fd, int mode, | |||
83 | /* See comments in sys.c */ | 98 | /* See comments in sys.c */ |
84 | #define compat_sys_fadvise64_64 sys32_fadvise64_64 | 99 | #define compat_sys_fadvise64_64 sys32_fadvise64_64 |
85 | #define compat_sys_readahead sys32_readahead | 100 | #define compat_sys_readahead sys32_readahead |
101 | #define sys_llseek compat_sys_llseek | ||
86 | 102 | ||
87 | /* Call the assembly trampolines where necessary. */ | 103 | /* Call the assembly trampolines where necessary. */ |
88 | #define compat_sys_rt_sigreturn _compat_sys_rt_sigreturn | 104 | #define compat_sys_rt_sigreturn _compat_sys_rt_sigreturn |
diff --git a/arch/x86/include/asm/bootparam_utils.h b/arch/x86/include/asm/bootparam_utils.h index 5b5e9cb774b5..653668d140f9 100644 --- a/arch/x86/include/asm/bootparam_utils.h +++ b/arch/x86/include/asm/bootparam_utils.h | |||
@@ -14,13 +14,29 @@ | |||
14 | * analysis of kexec-tools; if other broken bootloaders initialize a | 14 | * analysis of kexec-tools; if other broken bootloaders initialize a |
15 | * different set of fields we will need to figure out how to disambiguate. | 15 | * different set of fields we will need to figure out how to disambiguate. |
16 | * | 16 | * |
17 | * Note: efi_info is commonly left uninitialized, but that field has a | ||
18 | * private magic, so it is better to leave it unchanged. | ||
17 | */ | 19 | */ |
18 | static void sanitize_boot_params(struct boot_params *boot_params) | 20 | static void sanitize_boot_params(struct boot_params *boot_params) |
19 | { | 21 | { |
22 | /* | ||
23 | * IMPORTANT NOTE TO BOOTLOADER AUTHORS: do not simply clear | ||
24 | * this field. The purpose of this field is to guarantee | ||
25 | * compliance with the x86 boot spec located in | ||
26 | * Documentation/x86/boot.txt . That spec says that the | ||
27 | * *whole* structure should be cleared, after which only the | ||
28 | * portion defined by struct setup_header (boot_params->hdr) | ||
29 | * should be copied in. | ||
30 | * | ||
31 | * If you're having an issue because the sentinel is set, you | ||
32 | * need to change the whole structure to be cleared, not this | ||
33 | * (or any other) individual field, or you will soon have | ||
34 | * problems again. | ||
35 | */ | ||
20 | if (boot_params->sentinel) { | 36 | if (boot_params->sentinel) { |
21 | /*fields in boot_params are not valid, clear them */ | 37 | /* fields in boot_params are left uninitialized, clear them */ |
22 | memset(&boot_params->olpc_ofw_header, 0, | 38 | memset(&boot_params->olpc_ofw_header, 0, |
23 | (char *)&boot_params->alt_mem_k - | 39 | (char *)&boot_params->efi_info - |
24 | (char *)&boot_params->olpc_ofw_header); | 40 | (char *)&boot_params->olpc_ofw_header); |
25 | memset(&boot_params->kbd_status, 0, | 41 | memset(&boot_params->kbd_status, 0, |
26 | (char *)&boot_params->hdr - | 42 | (char *)&boot_params->hdr - |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 84d32855f65c..90d8cc930f5e 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -171,9 +171,15 @@ static struct resource bss_resource = { | |||
171 | 171 | ||
172 | #ifdef CONFIG_X86_32 | 172 | #ifdef CONFIG_X86_32 |
173 | /* cpu data as detected by the assembly code in head.S */ | 173 | /* cpu data as detected by the assembly code in head.S */ |
174 | struct cpuinfo_x86 new_cpu_data __cpuinitdata = {0, 0, 0, 0, -1, 1, 0, 0, -1}; | 174 | struct cpuinfo_x86 new_cpu_data __cpuinitdata = { |
175 | .wp_works_ok = -1, | ||
176 | .fdiv_bug = -1, | ||
177 | }; | ||
175 | /* common cpu data for all cpus */ | 178 | /* common cpu data for all cpus */ |
176 | struct cpuinfo_x86 boot_cpu_data __read_mostly = {0, 0, 0, 0, -1, 1, 0, 0, -1}; | 179 | struct cpuinfo_x86 boot_cpu_data __read_mostly = { |
180 | .wp_works_ok = -1, | ||
181 | .fdiv_bug = -1, | ||
182 | }; | ||
177 | EXPORT_SYMBOL(boot_cpu_data); | 183 | EXPORT_SYMBOL(boot_cpu_data); |
178 | 184 | ||
179 | unsigned int def_to_bigsmp; | 185 | unsigned int def_to_bigsmp; |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index a6ceaedc396a..9f190a2a00e9 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -1365,9 +1365,8 @@ static inline void mwait_play_dead(void) | |||
1365 | unsigned int eax, ebx, ecx, edx; | 1365 | unsigned int eax, ebx, ecx, edx; |
1366 | unsigned int highest_cstate = 0; | 1366 | unsigned int highest_cstate = 0; |
1367 | unsigned int highest_subcstate = 0; | 1367 | unsigned int highest_subcstate = 0; |
1368 | int i; | ||
1369 | void *mwait_ptr; | 1368 | void *mwait_ptr; |
1370 | struct cpuinfo_x86 *c = __this_cpu_ptr(&cpu_info); | 1369 | int i; |
1371 | 1370 | ||
1372 | if (!this_cpu_has(X86_FEATURE_MWAIT)) | 1371 | if (!this_cpu_has(X86_FEATURE_MWAIT)) |
1373 | return; | 1372 | return; |
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 4903a03ae876..59b7fc453277 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
@@ -410,9 +410,8 @@ void __init init_mem_mapping(void) | |||
410 | /* the ISA range is always mapped regardless of memory holes */ | 410 | /* the ISA range is always mapped regardless of memory holes */ |
411 | init_memory_mapping(0, ISA_END_ADDRESS); | 411 | init_memory_mapping(0, ISA_END_ADDRESS); |
412 | 412 | ||
413 | /* xen has big range in reserved near end of ram, skip it at first */ | 413 | /* xen has big range in reserved near end of ram, skip it at first.*/ |
414 | addr = memblock_find_in_range(ISA_END_ADDRESS, end, PMD_SIZE, | 414 | addr = memblock_find_in_range(ISA_END_ADDRESS, end, PMD_SIZE, PMD_SIZE); |
415 | PAGE_SIZE); | ||
416 | real_end = addr + PMD_SIZE; | 415 | real_end = addr + PMD_SIZE; |
417 | 416 | ||
418 | /* step_size need to be small so pgt_buf from BRK could cover it */ | 417 | /* step_size need to be small so pgt_buf from BRK could cover it */ |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 2610bd93c896..657438858e83 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -563,6 +563,13 @@ int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags) | |||
563 | if (base > __pa(high_memory-1)) | 563 | if (base > __pa(high_memory-1)) |
564 | return 0; | 564 | return 0; |
565 | 565 | ||
566 | /* | ||
567 | * some areas in the middle of the kernel identity range | ||
568 | * are not mapped, like the PCI space. | ||
569 | */ | ||
570 | if (!page_is_ram(base >> PAGE_SHIFT)) | ||
571 | return 0; | ||
572 | |||
566 | id_sz = (__pa(high_memory-1) <= base + size) ? | 573 | id_sz = (__pa(high_memory-1) <= base + size) ? |
567 | __pa(high_memory) - base : | 574 | __pa(high_memory) - base : |
568 | size; | 575 | size; |
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index ef6f155469b5..40a84cc6740c 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c | |||
@@ -36,12 +36,11 @@ int register_acpi_bus_type(struct acpi_bus_type *type) | |||
36 | { | 36 | { |
37 | if (acpi_disabled) | 37 | if (acpi_disabled) |
38 | return -ENODEV; | 38 | return -ENODEV; |
39 | if (type && type->bus && type->find_device) { | 39 | if (type && type->match && type->find_device) { |
40 | down_write(&bus_type_sem); | 40 | down_write(&bus_type_sem); |
41 | list_add_tail(&type->list, &bus_type_list); | 41 | list_add_tail(&type->list, &bus_type_list); |
42 | up_write(&bus_type_sem); | 42 | up_write(&bus_type_sem); |
43 | printk(KERN_INFO PREFIX "bus type %s registered\n", | 43 | printk(KERN_INFO PREFIX "bus type %s registered\n", type->name); |
44 | type->bus->name); | ||
45 | return 0; | 44 | return 0; |
46 | } | 45 | } |
47 | return -ENODEV; | 46 | return -ENODEV; |
@@ -56,24 +55,21 @@ int unregister_acpi_bus_type(struct acpi_bus_type *type) | |||
56 | down_write(&bus_type_sem); | 55 | down_write(&bus_type_sem); |
57 | list_del_init(&type->list); | 56 | list_del_init(&type->list); |
58 | up_write(&bus_type_sem); | 57 | up_write(&bus_type_sem); |
59 | printk(KERN_INFO PREFIX "ACPI bus type %s unregistered\n", | 58 | printk(KERN_INFO PREFIX "bus type %s unregistered\n", |
60 | type->bus->name); | 59 | type->name); |
61 | return 0; | 60 | return 0; |
62 | } | 61 | } |
63 | return -ENODEV; | 62 | return -ENODEV; |
64 | } | 63 | } |
65 | EXPORT_SYMBOL_GPL(unregister_acpi_bus_type); | 64 | EXPORT_SYMBOL_GPL(unregister_acpi_bus_type); |
66 | 65 | ||
67 | static struct acpi_bus_type *acpi_get_bus_type(struct bus_type *type) | 66 | static struct acpi_bus_type *acpi_get_bus_type(struct device *dev) |
68 | { | 67 | { |
69 | struct acpi_bus_type *tmp, *ret = NULL; | 68 | struct acpi_bus_type *tmp, *ret = NULL; |
70 | 69 | ||
71 | if (!type) | ||
72 | return NULL; | ||
73 | |||
74 | down_read(&bus_type_sem); | 70 | down_read(&bus_type_sem); |
75 | list_for_each_entry(tmp, &bus_type_list, list) { | 71 | list_for_each_entry(tmp, &bus_type_list, list) { |
76 | if (tmp->bus == type) { | 72 | if (tmp->match(dev)) { |
77 | ret = tmp; | 73 | ret = tmp; |
78 | break; | 74 | break; |
79 | } | 75 | } |
@@ -82,22 +78,6 @@ static struct acpi_bus_type *acpi_get_bus_type(struct bus_type *type) | |||
82 | return ret; | 78 | return ret; |
83 | } | 79 | } |
84 | 80 | ||
85 | static int acpi_find_bridge_device(struct device *dev, acpi_handle * handle) | ||
86 | { | ||
87 | struct acpi_bus_type *tmp; | ||
88 | int ret = -ENODEV; | ||
89 | |||
90 | down_read(&bus_type_sem); | ||
91 | list_for_each_entry(tmp, &bus_type_list, list) { | ||
92 | if (tmp->find_bridge && !tmp->find_bridge(dev, handle)) { | ||
93 | ret = 0; | ||
94 | break; | ||
95 | } | ||
96 | } | ||
97 | up_read(&bus_type_sem); | ||
98 | return ret; | ||
99 | } | ||
100 | |||
101 | static acpi_status do_acpi_find_child(acpi_handle handle, u32 lvl_not_used, | 81 | static acpi_status do_acpi_find_child(acpi_handle handle, u32 lvl_not_used, |
102 | void *addr_p, void **ret_p) | 82 | void *addr_p, void **ret_p) |
103 | { | 83 | { |
@@ -261,29 +241,12 @@ err: | |||
261 | 241 | ||
262 | static int acpi_platform_notify(struct device *dev) | 242 | static int acpi_platform_notify(struct device *dev) |
263 | { | 243 | { |
264 | struct acpi_bus_type *type; | 244 | struct acpi_bus_type *type = acpi_get_bus_type(dev); |
265 | acpi_handle handle; | 245 | acpi_handle handle; |
266 | int ret; | 246 | int ret; |
267 | 247 | ||
268 | ret = acpi_bind_one(dev, NULL); | 248 | ret = acpi_bind_one(dev, NULL); |
269 | if (ret && (!dev->bus || !dev->parent)) { | 249 | if (ret && type) { |
270 | /* bridge devices genernally haven't bus or parent */ | ||
271 | ret = acpi_find_bridge_device(dev, &handle); | ||
272 | if (!ret) { | ||
273 | ret = acpi_bind_one(dev, handle); | ||
274 | if (ret) | ||
275 | goto out; | ||
276 | } | ||
277 | } | ||
278 | |||
279 | type = acpi_get_bus_type(dev->bus); | ||
280 | if (ret) { | ||
281 | if (!type || !type->find_device) { | ||
282 | DBG("No ACPI bus support for %s\n", dev_name(dev)); | ||
283 | ret = -EINVAL; | ||
284 | goto out; | ||
285 | } | ||
286 | |||
287 | ret = type->find_device(dev, &handle); | 250 | ret = type->find_device(dev, &handle); |
288 | if (ret) { | 251 | if (ret) { |
289 | DBG("Unable to get handle for %s\n", dev_name(dev)); | 252 | DBG("Unable to get handle for %s\n", dev_name(dev)); |
@@ -316,7 +279,7 @@ static int acpi_platform_notify_remove(struct device *dev) | |||
316 | { | 279 | { |
317 | struct acpi_bus_type *type; | 280 | struct acpi_bus_type *type; |
318 | 281 | ||
319 | type = acpi_get_bus_type(dev->bus); | 282 | type = acpi_get_bus_type(dev); |
320 | if (type && type->cleanup) | 283 | if (type && type->cleanup) |
321 | type->cleanup(dev); | 284 | type->cleanup(dev); |
322 | 285 | ||
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index eff722278ff5..164d49569aeb 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -158,8 +158,7 @@ static int map_mat_entry(acpi_handle handle, int type, u32 acpi_id) | |||
158 | } | 158 | } |
159 | 159 | ||
160 | exit: | 160 | exit: |
161 | if (buffer.pointer) | 161 | kfree(buffer.pointer); |
162 | kfree(buffer.pointer); | ||
163 | return apic_id; | 162 | return apic_id; |
164 | } | 163 | } |
165 | 164 | ||
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index df34bd04ae62..bec717ffd25f 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
@@ -559,7 +559,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device) | |||
559 | return 0; | 559 | return 0; |
560 | #endif | 560 | #endif |
561 | 561 | ||
562 | BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0)); | 562 | BUG_ON(pr->id >= nr_cpu_ids); |
563 | 563 | ||
564 | /* | 564 | /* |
565 | * Buggy BIOS check | 565 | * Buggy BIOS check |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 6d3a06a629a1..24213033fbae 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -599,7 +599,6 @@ static void acpi_sleep_suspend_setup(void) | |||
599 | status = acpi_get_sleep_type_data(i, &type_a, &type_b); | 599 | status = acpi_get_sleep_type_data(i, &type_a, &type_b); |
600 | if (ACPI_SUCCESS(status)) { | 600 | if (ACPI_SUCCESS(status)) { |
601 | sleep_states[i] = 1; | 601 | sleep_states[i] = 1; |
602 | pr_cont(" S%d", i); | ||
603 | } | 602 | } |
604 | } | 603 | } |
605 | 604 | ||
@@ -742,7 +741,6 @@ static void acpi_sleep_hibernate_setup(void) | |||
742 | hibernation_set_ops(old_suspend_ordering ? | 741 | hibernation_set_ops(old_suspend_ordering ? |
743 | &acpi_hibernation_ops_old : &acpi_hibernation_ops); | 742 | &acpi_hibernation_ops_old : &acpi_hibernation_ops); |
744 | sleep_states[ACPI_STATE_S4] = 1; | 743 | sleep_states[ACPI_STATE_S4] = 1; |
745 | pr_cont(KERN_CONT " S4"); | ||
746 | if (nosigcheck) | 744 | if (nosigcheck) |
747 | return; | 745 | return; |
748 | 746 | ||
@@ -788,6 +786,9 @@ int __init acpi_sleep_init(void) | |||
788 | { | 786 | { |
789 | acpi_status status; | 787 | acpi_status status; |
790 | u8 type_a, type_b; | 788 | u8 type_a, type_b; |
789 | char supported[ACPI_S_STATE_COUNT * 3 + 1]; | ||
790 | char *pos = supported; | ||
791 | int i; | ||
791 | 792 | ||
792 | if (acpi_disabled) | 793 | if (acpi_disabled) |
793 | return 0; | 794 | return 0; |
@@ -795,7 +796,6 @@ int __init acpi_sleep_init(void) | |||
795 | acpi_sleep_dmi_check(); | 796 | acpi_sleep_dmi_check(); |
796 | 797 | ||
797 | sleep_states[ACPI_STATE_S0] = 1; | 798 | sleep_states[ACPI_STATE_S0] = 1; |
798 | pr_info(PREFIX "(supports S0"); | ||
799 | 799 | ||
800 | acpi_sleep_suspend_setup(); | 800 | acpi_sleep_suspend_setup(); |
801 | acpi_sleep_hibernate_setup(); | 801 | acpi_sleep_hibernate_setup(); |
@@ -803,11 +803,17 @@ int __init acpi_sleep_init(void) | |||
803 | status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b); | 803 | status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b); |
804 | if (ACPI_SUCCESS(status)) { | 804 | if (ACPI_SUCCESS(status)) { |
805 | sleep_states[ACPI_STATE_S5] = 1; | 805 | sleep_states[ACPI_STATE_S5] = 1; |
806 | pr_cont(" S5"); | ||
807 | pm_power_off_prepare = acpi_power_off_prepare; | 806 | pm_power_off_prepare = acpi_power_off_prepare; |
808 | pm_power_off = acpi_power_off; | 807 | pm_power_off = acpi_power_off; |
809 | } | 808 | } |
810 | pr_cont(")\n"); | 809 | |
810 | supported[0] = 0; | ||
811 | for (i = 0; i < ACPI_S_STATE_COUNT; i++) { | ||
812 | if (sleep_states[i]) | ||
813 | pos += sprintf(pos, " S%d", i); | ||
814 | } | ||
815 | pr_info(PREFIX "(supports%s)\n", supported); | ||
816 | |||
811 | /* | 817 | /* |
812 | * Register the tts_notifier to reboot notifier list so that the _TTS | 818 | * Register the tts_notifier to reboot notifier list so that the _TTS |
813 | * object can also be evaluated when the system enters S5. | 819 | * object can also be evaluated when the system enters S5. |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 0ea1018280bd..beea3115577e 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -1144,13 +1144,8 @@ static int ata_acpi_find_device(struct device *dev, acpi_handle *handle) | |||
1144 | return -ENODEV; | 1144 | return -ENODEV; |
1145 | } | 1145 | } |
1146 | 1146 | ||
1147 | static int ata_acpi_find_dummy(struct device *dev, acpi_handle *handle) | ||
1148 | { | ||
1149 | return -ENODEV; | ||
1150 | } | ||
1151 | |||
1152 | static struct acpi_bus_type ata_acpi_bus = { | 1147 | static struct acpi_bus_type ata_acpi_bus = { |
1153 | .find_bridge = ata_acpi_find_dummy, | 1148 | .name = "ATA", |
1154 | .find_device = ata_acpi_find_device, | 1149 | .find_device = ata_acpi_find_device, |
1155 | }; | 1150 | }; |
1156 | 1151 | ||
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 2b7f77d3fcb0..15beb500a4e4 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -99,7 +99,6 @@ void device_pm_add(struct device *dev) | |||
99 | dev_warn(dev, "parent %s should not be sleeping\n", | 99 | dev_warn(dev, "parent %s should not be sleeping\n", |
100 | dev_name(dev->parent)); | 100 | dev_name(dev->parent)); |
101 | list_add_tail(&dev->power.entry, &dpm_list); | 101 | list_add_tail(&dev->power.entry, &dpm_list); |
102 | dev_pm_qos_constraints_init(dev); | ||
103 | mutex_unlock(&dpm_list_mtx); | 102 | mutex_unlock(&dpm_list_mtx); |
104 | } | 103 | } |
105 | 104 | ||
@@ -113,7 +112,6 @@ void device_pm_remove(struct device *dev) | |||
113 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); | 112 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); |
114 | complete_all(&dev->power.completion); | 113 | complete_all(&dev->power.completion); |
115 | mutex_lock(&dpm_list_mtx); | 114 | mutex_lock(&dpm_list_mtx); |
116 | dev_pm_qos_constraints_destroy(dev); | ||
117 | list_del_init(&dev->power.entry); | 115 | list_del_init(&dev->power.entry); |
118 | mutex_unlock(&dpm_list_mtx); | 116 | mutex_unlock(&dpm_list_mtx); |
119 | device_wakeup_disable(dev); | 117 | device_wakeup_disable(dev); |
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h index b16686a0a5a2..cfc3226ec492 100644 --- a/drivers/base/power/power.h +++ b/drivers/base/power/power.h | |||
@@ -4,7 +4,7 @@ static inline void device_pm_init_common(struct device *dev) | |||
4 | { | 4 | { |
5 | if (!dev->power.early_init) { | 5 | if (!dev->power.early_init) { |
6 | spin_lock_init(&dev->power.lock); | 6 | spin_lock_init(&dev->power.lock); |
7 | dev->power.power_state = PMSG_INVALID; | 7 | dev->power.qos = NULL; |
8 | dev->power.early_init = true; | 8 | dev->power.early_init = true; |
9 | } | 9 | } |
10 | } | 10 | } |
@@ -56,14 +56,10 @@ extern void device_pm_move_last(struct device *); | |||
56 | 56 | ||
57 | static inline void device_pm_sleep_init(struct device *dev) {} | 57 | static inline void device_pm_sleep_init(struct device *dev) {} |
58 | 58 | ||
59 | static inline void device_pm_add(struct device *dev) | 59 | static inline void device_pm_add(struct device *dev) {} |
60 | { | ||
61 | dev_pm_qos_constraints_init(dev); | ||
62 | } | ||
63 | 60 | ||
64 | static inline void device_pm_remove(struct device *dev) | 61 | static inline void device_pm_remove(struct device *dev) |
65 | { | 62 | { |
66 | dev_pm_qos_constraints_destroy(dev); | ||
67 | pm_runtime_remove(dev); | 63 | pm_runtime_remove(dev); |
68 | } | 64 | } |
69 | 65 | ||
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index 3d4d1f8aac5c..5f74587ef258 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/mutex.h> | 41 | #include <linux/mutex.h> |
42 | #include <linux/export.h> | 42 | #include <linux/export.h> |
43 | #include <linux/pm_runtime.h> | 43 | #include <linux/pm_runtime.h> |
44 | #include <linux/err.h> | ||
44 | 45 | ||
45 | #include "power.h" | 46 | #include "power.h" |
46 | 47 | ||
@@ -61,7 +62,7 @@ enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask) | |||
61 | struct pm_qos_flags *pqf; | 62 | struct pm_qos_flags *pqf; |
62 | s32 val; | 63 | s32 val; |
63 | 64 | ||
64 | if (!qos) | 65 | if (IS_ERR_OR_NULL(qos)) |
65 | return PM_QOS_FLAGS_UNDEFINED; | 66 | return PM_QOS_FLAGS_UNDEFINED; |
66 | 67 | ||
67 | pqf = &qos->flags; | 68 | pqf = &qos->flags; |
@@ -101,7 +102,8 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_flags); | |||
101 | */ | 102 | */ |
102 | s32 __dev_pm_qos_read_value(struct device *dev) | 103 | s32 __dev_pm_qos_read_value(struct device *dev) |
103 | { | 104 | { |
104 | return dev->power.qos ? pm_qos_read_value(&dev->power.qos->latency) : 0; | 105 | return IS_ERR_OR_NULL(dev->power.qos) ? |
106 | 0 : pm_qos_read_value(&dev->power.qos->latency); | ||
105 | } | 107 | } |
106 | 108 | ||
107 | /** | 109 | /** |
@@ -198,20 +200,8 @@ static int dev_pm_qos_constraints_allocate(struct device *dev) | |||
198 | return 0; | 200 | return 0; |
199 | } | 201 | } |
200 | 202 | ||
201 | /** | 203 | static void __dev_pm_qos_hide_latency_limit(struct device *dev); |
202 | * dev_pm_qos_constraints_init - Initalize device's PM QoS constraints pointer. | 204 | static void __dev_pm_qos_hide_flags(struct device *dev); |
203 | * @dev: target device | ||
204 | * | ||
205 | * Called from the device PM subsystem during device insertion under | ||
206 | * device_pm_lock(). | ||
207 | */ | ||
208 | void dev_pm_qos_constraints_init(struct device *dev) | ||
209 | { | ||
210 | mutex_lock(&dev_pm_qos_mtx); | ||
211 | dev->power.qos = NULL; | ||
212 | dev->power.power_state = PMSG_ON; | ||
213 | mutex_unlock(&dev_pm_qos_mtx); | ||
214 | } | ||
215 | 205 | ||
216 | /** | 206 | /** |
217 | * dev_pm_qos_constraints_destroy | 207 | * dev_pm_qos_constraints_destroy |
@@ -226,16 +216,15 @@ void dev_pm_qos_constraints_destroy(struct device *dev) | |||
226 | struct pm_qos_constraints *c; | 216 | struct pm_qos_constraints *c; |
227 | struct pm_qos_flags *f; | 217 | struct pm_qos_flags *f; |
228 | 218 | ||
219 | mutex_lock(&dev_pm_qos_mtx); | ||
220 | |||
229 | /* | 221 | /* |
230 | * If the device's PM QoS resume latency limit or PM QoS flags have been | 222 | * If the device's PM QoS resume latency limit or PM QoS flags have been |
231 | * exposed to user space, they have to be hidden at this point. | 223 | * exposed to user space, they have to be hidden at this point. |
232 | */ | 224 | */ |
233 | dev_pm_qos_hide_latency_limit(dev); | 225 | __dev_pm_qos_hide_latency_limit(dev); |
234 | dev_pm_qos_hide_flags(dev); | 226 | __dev_pm_qos_hide_flags(dev); |
235 | 227 | ||
236 | mutex_lock(&dev_pm_qos_mtx); | ||
237 | |||
238 | dev->power.power_state = PMSG_INVALID; | ||
239 | qos = dev->power.qos; | 228 | qos = dev->power.qos; |
240 | if (!qos) | 229 | if (!qos) |
241 | goto out; | 230 | goto out; |
@@ -257,7 +246,7 @@ void dev_pm_qos_constraints_destroy(struct device *dev) | |||
257 | } | 246 | } |
258 | 247 | ||
259 | spin_lock_irq(&dev->power.lock); | 248 | spin_lock_irq(&dev->power.lock); |
260 | dev->power.qos = NULL; | 249 | dev->power.qos = ERR_PTR(-ENODEV); |
261 | spin_unlock_irq(&dev->power.lock); | 250 | spin_unlock_irq(&dev->power.lock); |
262 | 251 | ||
263 | kfree(c->notifiers); | 252 | kfree(c->notifiers); |
@@ -301,32 +290,19 @@ int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req, | |||
301 | "%s() called for already added request\n", __func__)) | 290 | "%s() called for already added request\n", __func__)) |
302 | return -EINVAL; | 291 | return -EINVAL; |
303 | 292 | ||
304 | req->dev = dev; | ||
305 | |||
306 | mutex_lock(&dev_pm_qos_mtx); | 293 | mutex_lock(&dev_pm_qos_mtx); |
307 | 294 | ||
308 | if (!dev->power.qos) { | 295 | if (IS_ERR(dev->power.qos)) |
309 | if (dev->power.power_state.event == PM_EVENT_INVALID) { | 296 | ret = -ENODEV; |
310 | /* The device has been removed from the system. */ | 297 | else if (!dev->power.qos) |
311 | req->dev = NULL; | 298 | ret = dev_pm_qos_constraints_allocate(dev); |
312 | ret = -ENODEV; | ||
313 | goto out; | ||
314 | } else { | ||
315 | /* | ||
316 | * Allocate the constraints data on the first call to | ||
317 | * add_request, i.e. only if the data is not already | ||
318 | * allocated and if the device has not been removed. | ||
319 | */ | ||
320 | ret = dev_pm_qos_constraints_allocate(dev); | ||
321 | } | ||
322 | } | ||
323 | 299 | ||
324 | if (!ret) { | 300 | if (!ret) { |
301 | req->dev = dev; | ||
325 | req->type = type; | 302 | req->type = type; |
326 | ret = apply_constraint(req, PM_QOS_ADD_REQ, value); | 303 | ret = apply_constraint(req, PM_QOS_ADD_REQ, value); |
327 | } | 304 | } |
328 | 305 | ||
329 | out: | ||
330 | mutex_unlock(&dev_pm_qos_mtx); | 306 | mutex_unlock(&dev_pm_qos_mtx); |
331 | 307 | ||
332 | return ret; | 308 | return ret; |
@@ -344,7 +320,14 @@ static int __dev_pm_qos_update_request(struct dev_pm_qos_request *req, | |||
344 | s32 curr_value; | 320 | s32 curr_value; |
345 | int ret = 0; | 321 | int ret = 0; |
346 | 322 | ||
347 | if (!req->dev->power.qos) | 323 | if (!req) /*guard against callers passing in null */ |
324 | return -EINVAL; | ||
325 | |||
326 | if (WARN(!dev_pm_qos_request_active(req), | ||
327 | "%s() called for unknown object\n", __func__)) | ||
328 | return -EINVAL; | ||
329 | |||
330 | if (IS_ERR_OR_NULL(req->dev->power.qos)) | ||
348 | return -ENODEV; | 331 | return -ENODEV; |
349 | 332 | ||
350 | switch(req->type) { | 333 | switch(req->type) { |
@@ -386,6 +369,17 @@ int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value) | |||
386 | { | 369 | { |
387 | int ret; | 370 | int ret; |
388 | 371 | ||
372 | mutex_lock(&dev_pm_qos_mtx); | ||
373 | ret = __dev_pm_qos_update_request(req, new_value); | ||
374 | mutex_unlock(&dev_pm_qos_mtx); | ||
375 | return ret; | ||
376 | } | ||
377 | EXPORT_SYMBOL_GPL(dev_pm_qos_update_request); | ||
378 | |||
379 | static int __dev_pm_qos_remove_request(struct dev_pm_qos_request *req) | ||
380 | { | ||
381 | int ret; | ||
382 | |||
389 | if (!req) /*guard against callers passing in null */ | 383 | if (!req) /*guard against callers passing in null */ |
390 | return -EINVAL; | 384 | return -EINVAL; |
391 | 385 | ||
@@ -393,13 +387,13 @@ int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value) | |||
393 | "%s() called for unknown object\n", __func__)) | 387 | "%s() called for unknown object\n", __func__)) |
394 | return -EINVAL; | 388 | return -EINVAL; |
395 | 389 | ||
396 | mutex_lock(&dev_pm_qos_mtx); | 390 | if (IS_ERR_OR_NULL(req->dev->power.qos)) |
397 | ret = __dev_pm_qos_update_request(req, new_value); | 391 | return -ENODEV; |
398 | mutex_unlock(&dev_pm_qos_mtx); | ||
399 | 392 | ||
393 | ret = apply_constraint(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); | ||
394 | memset(req, 0, sizeof(*req)); | ||
400 | return ret; | 395 | return ret; |
401 | } | 396 | } |
402 | EXPORT_SYMBOL_GPL(dev_pm_qos_update_request); | ||
403 | 397 | ||
404 | /** | 398 | /** |
405 | * dev_pm_qos_remove_request - modifies an existing qos request | 399 | * dev_pm_qos_remove_request - modifies an existing qos request |
@@ -418,26 +412,10 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_update_request); | |||
418 | */ | 412 | */ |
419 | int dev_pm_qos_remove_request(struct dev_pm_qos_request *req) | 413 | int dev_pm_qos_remove_request(struct dev_pm_qos_request *req) |
420 | { | 414 | { |
421 | int ret = 0; | 415 | int ret; |
422 | |||
423 | if (!req) /*guard against callers passing in null */ | ||
424 | return -EINVAL; | ||
425 | |||
426 | if (WARN(!dev_pm_qos_request_active(req), | ||
427 | "%s() called for unknown object\n", __func__)) | ||
428 | return -EINVAL; | ||
429 | 416 | ||
430 | mutex_lock(&dev_pm_qos_mtx); | 417 | mutex_lock(&dev_pm_qos_mtx); |
431 | 418 | ret = __dev_pm_qos_remove_request(req); | |
432 | if (req->dev->power.qos) { | ||
433 | ret = apply_constraint(req, PM_QOS_REMOVE_REQ, | ||
434 | PM_QOS_DEFAULT_VALUE); | ||
435 | memset(req, 0, sizeof(*req)); | ||
436 | } else { | ||
437 | /* Return if the device has been removed */ | ||
438 | ret = -ENODEV; | ||
439 | } | ||
440 | |||
441 | mutex_unlock(&dev_pm_qos_mtx); | 419 | mutex_unlock(&dev_pm_qos_mtx); |
442 | return ret; | 420 | return ret; |
443 | } | 421 | } |
@@ -462,9 +440,10 @@ int dev_pm_qos_add_notifier(struct device *dev, struct notifier_block *notifier) | |||
462 | 440 | ||
463 | mutex_lock(&dev_pm_qos_mtx); | 441 | mutex_lock(&dev_pm_qos_mtx); |
464 | 442 | ||
465 | if (!dev->power.qos) | 443 | if (IS_ERR(dev->power.qos)) |
466 | ret = dev->power.power_state.event != PM_EVENT_INVALID ? | 444 | ret = -ENODEV; |
467 | dev_pm_qos_constraints_allocate(dev) : -ENODEV; | 445 | else if (!dev->power.qos) |
446 | ret = dev_pm_qos_constraints_allocate(dev); | ||
468 | 447 | ||
469 | if (!ret) | 448 | if (!ret) |
470 | ret = blocking_notifier_chain_register( | 449 | ret = blocking_notifier_chain_register( |
@@ -493,7 +472,7 @@ int dev_pm_qos_remove_notifier(struct device *dev, | |||
493 | mutex_lock(&dev_pm_qos_mtx); | 472 | mutex_lock(&dev_pm_qos_mtx); |
494 | 473 | ||
495 | /* Silently return if the constraints object is not present. */ | 474 | /* Silently return if the constraints object is not present. */ |
496 | if (dev->power.qos) | 475 | if (!IS_ERR_OR_NULL(dev->power.qos)) |
497 | retval = blocking_notifier_chain_unregister( | 476 | retval = blocking_notifier_chain_unregister( |
498 | dev->power.qos->latency.notifiers, | 477 | dev->power.qos->latency.notifiers, |
499 | notifier); | 478 | notifier); |
@@ -563,16 +542,20 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_add_ancestor_request); | |||
563 | static void __dev_pm_qos_drop_user_request(struct device *dev, | 542 | static void __dev_pm_qos_drop_user_request(struct device *dev, |
564 | enum dev_pm_qos_req_type type) | 543 | enum dev_pm_qos_req_type type) |
565 | { | 544 | { |
545 | struct dev_pm_qos_request *req = NULL; | ||
546 | |||
566 | switch(type) { | 547 | switch(type) { |
567 | case DEV_PM_QOS_LATENCY: | 548 | case DEV_PM_QOS_LATENCY: |
568 | dev_pm_qos_remove_request(dev->power.qos->latency_req); | 549 | req = dev->power.qos->latency_req; |
569 | dev->power.qos->latency_req = NULL; | 550 | dev->power.qos->latency_req = NULL; |
570 | break; | 551 | break; |
571 | case DEV_PM_QOS_FLAGS: | 552 | case DEV_PM_QOS_FLAGS: |
572 | dev_pm_qos_remove_request(dev->power.qos->flags_req); | 553 | req = dev->power.qos->flags_req; |
573 | dev->power.qos->flags_req = NULL; | 554 | dev->power.qos->flags_req = NULL; |
574 | break; | 555 | break; |
575 | } | 556 | } |
557 | __dev_pm_qos_remove_request(req); | ||
558 | kfree(req); | ||
576 | } | 559 | } |
577 | 560 | ||
578 | /** | 561 | /** |
@@ -588,36 +571,57 @@ int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) | |||
588 | if (!device_is_registered(dev) || value < 0) | 571 | if (!device_is_registered(dev) || value < 0) |
589 | return -EINVAL; | 572 | return -EINVAL; |
590 | 573 | ||
591 | if (dev->power.qos && dev->power.qos->latency_req) | ||
592 | return -EEXIST; | ||
593 | |||
594 | req = kzalloc(sizeof(*req), GFP_KERNEL); | 574 | req = kzalloc(sizeof(*req), GFP_KERNEL); |
595 | if (!req) | 575 | if (!req) |
596 | return -ENOMEM; | 576 | return -ENOMEM; |
597 | 577 | ||
598 | ret = dev_pm_qos_add_request(dev, req, DEV_PM_QOS_LATENCY, value); | 578 | ret = dev_pm_qos_add_request(dev, req, DEV_PM_QOS_LATENCY, value); |
599 | if (ret < 0) | 579 | if (ret < 0) { |
580 | kfree(req); | ||
600 | return ret; | 581 | return ret; |
582 | } | ||
583 | |||
584 | mutex_lock(&dev_pm_qos_mtx); | ||
585 | |||
586 | if (IS_ERR_OR_NULL(dev->power.qos)) | ||
587 | ret = -ENODEV; | ||
588 | else if (dev->power.qos->latency_req) | ||
589 | ret = -EEXIST; | ||
590 | |||
591 | if (ret < 0) { | ||
592 | __dev_pm_qos_remove_request(req); | ||
593 | kfree(req); | ||
594 | goto out; | ||
595 | } | ||
601 | 596 | ||
602 | dev->power.qos->latency_req = req; | 597 | dev->power.qos->latency_req = req; |
603 | ret = pm_qos_sysfs_add_latency(dev); | 598 | ret = pm_qos_sysfs_add_latency(dev); |
604 | if (ret) | 599 | if (ret) |
605 | __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_LATENCY); | 600 | __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_LATENCY); |
606 | 601 | ||
602 | out: | ||
603 | mutex_unlock(&dev_pm_qos_mtx); | ||
607 | return ret; | 604 | return ret; |
608 | } | 605 | } |
609 | EXPORT_SYMBOL_GPL(dev_pm_qos_expose_latency_limit); | 606 | EXPORT_SYMBOL_GPL(dev_pm_qos_expose_latency_limit); |
610 | 607 | ||
608 | static void __dev_pm_qos_hide_latency_limit(struct device *dev) | ||
609 | { | ||
610 | if (!IS_ERR_OR_NULL(dev->power.qos) && dev->power.qos->latency_req) { | ||
611 | pm_qos_sysfs_remove_latency(dev); | ||
612 | __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_LATENCY); | ||
613 | } | ||
614 | } | ||
615 | |||
611 | /** | 616 | /** |
612 | * dev_pm_qos_hide_latency_limit - Hide PM QoS latency limit from user space. | 617 | * dev_pm_qos_hide_latency_limit - Hide PM QoS latency limit from user space. |
613 | * @dev: Device whose PM QoS latency limit is to be hidden from user space. | 618 | * @dev: Device whose PM QoS latency limit is to be hidden from user space. |
614 | */ | 619 | */ |
615 | void dev_pm_qos_hide_latency_limit(struct device *dev) | 620 | void dev_pm_qos_hide_latency_limit(struct device *dev) |
616 | { | 621 | { |
617 | if (dev->power.qos && dev->power.qos->latency_req) { | 622 | mutex_lock(&dev_pm_qos_mtx); |
618 | pm_qos_sysfs_remove_latency(dev); | 623 | __dev_pm_qos_hide_latency_limit(dev); |
619 | __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_LATENCY); | 624 | mutex_unlock(&dev_pm_qos_mtx); |
620 | } | ||
621 | } | 625 | } |
622 | EXPORT_SYMBOL_GPL(dev_pm_qos_hide_latency_limit); | 626 | EXPORT_SYMBOL_GPL(dev_pm_qos_hide_latency_limit); |
623 | 627 | ||
@@ -634,41 +638,61 @@ int dev_pm_qos_expose_flags(struct device *dev, s32 val) | |||
634 | if (!device_is_registered(dev)) | 638 | if (!device_is_registered(dev)) |
635 | return -EINVAL; | 639 | return -EINVAL; |
636 | 640 | ||
637 | if (dev->power.qos && dev->power.qos->flags_req) | ||
638 | return -EEXIST; | ||
639 | |||
640 | req = kzalloc(sizeof(*req), GFP_KERNEL); | 641 | req = kzalloc(sizeof(*req), GFP_KERNEL); |
641 | if (!req) | 642 | if (!req) |
642 | return -ENOMEM; | 643 | return -ENOMEM; |
643 | 644 | ||
644 | pm_runtime_get_sync(dev); | ||
645 | ret = dev_pm_qos_add_request(dev, req, DEV_PM_QOS_FLAGS, val); | 645 | ret = dev_pm_qos_add_request(dev, req, DEV_PM_QOS_FLAGS, val); |
646 | if (ret < 0) | 646 | if (ret < 0) { |
647 | goto fail; | 647 | kfree(req); |
648 | return ret; | ||
649 | } | ||
650 | |||
651 | pm_runtime_get_sync(dev); | ||
652 | mutex_lock(&dev_pm_qos_mtx); | ||
653 | |||
654 | if (IS_ERR_OR_NULL(dev->power.qos)) | ||
655 | ret = -ENODEV; | ||
656 | else if (dev->power.qos->flags_req) | ||
657 | ret = -EEXIST; | ||
658 | |||
659 | if (ret < 0) { | ||
660 | __dev_pm_qos_remove_request(req); | ||
661 | kfree(req); | ||
662 | goto out; | ||
663 | } | ||
648 | 664 | ||
649 | dev->power.qos->flags_req = req; | 665 | dev->power.qos->flags_req = req; |
650 | ret = pm_qos_sysfs_add_flags(dev); | 666 | ret = pm_qos_sysfs_add_flags(dev); |
651 | if (ret) | 667 | if (ret) |
652 | __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_FLAGS); | 668 | __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_FLAGS); |
653 | 669 | ||
654 | fail: | 670 | out: |
671 | mutex_unlock(&dev_pm_qos_mtx); | ||
655 | pm_runtime_put(dev); | 672 | pm_runtime_put(dev); |
656 | return ret; | 673 | return ret; |
657 | } | 674 | } |
658 | EXPORT_SYMBOL_GPL(dev_pm_qos_expose_flags); | 675 | EXPORT_SYMBOL_GPL(dev_pm_qos_expose_flags); |
659 | 676 | ||
677 | static void __dev_pm_qos_hide_flags(struct device *dev) | ||
678 | { | ||
679 | if (!IS_ERR_OR_NULL(dev->power.qos) && dev->power.qos->flags_req) { | ||
680 | pm_qos_sysfs_remove_flags(dev); | ||
681 | __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_FLAGS); | ||
682 | } | ||
683 | } | ||
684 | |||
660 | /** | 685 | /** |
661 | * dev_pm_qos_hide_flags - Hide PM QoS flags of a device from user space. | 686 | * dev_pm_qos_hide_flags - Hide PM QoS flags of a device from user space. |
662 | * @dev: Device whose PM QoS flags are to be hidden from user space. | 687 | * @dev: Device whose PM QoS flags are to be hidden from user space. |
663 | */ | 688 | */ |
664 | void dev_pm_qos_hide_flags(struct device *dev) | 689 | void dev_pm_qos_hide_flags(struct device *dev) |
665 | { | 690 | { |
666 | if (dev->power.qos && dev->power.qos->flags_req) { | 691 | pm_runtime_get_sync(dev); |
667 | pm_qos_sysfs_remove_flags(dev); | 692 | mutex_lock(&dev_pm_qos_mtx); |
668 | pm_runtime_get_sync(dev); | 693 | __dev_pm_qos_hide_flags(dev); |
669 | __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_FLAGS); | 694 | mutex_unlock(&dev_pm_qos_mtx); |
670 | pm_runtime_put(dev); | 695 | pm_runtime_put(dev); |
671 | } | ||
672 | } | 696 | } |
673 | EXPORT_SYMBOL_GPL(dev_pm_qos_hide_flags); | 697 | EXPORT_SYMBOL_GPL(dev_pm_qos_hide_flags); |
674 | 698 | ||
@@ -683,12 +707,14 @@ int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set) | |||
683 | s32 value; | 707 | s32 value; |
684 | int ret; | 708 | int ret; |
685 | 709 | ||
686 | if (!dev->power.qos || !dev->power.qos->flags_req) | ||
687 | return -EINVAL; | ||
688 | |||
689 | pm_runtime_get_sync(dev); | 710 | pm_runtime_get_sync(dev); |
690 | mutex_lock(&dev_pm_qos_mtx); | 711 | mutex_lock(&dev_pm_qos_mtx); |
691 | 712 | ||
713 | if (IS_ERR_OR_NULL(dev->power.qos) || !dev->power.qos->flags_req) { | ||
714 | ret = -EINVAL; | ||
715 | goto out; | ||
716 | } | ||
717 | |||
692 | value = dev_pm_qos_requested_flags(dev); | 718 | value = dev_pm_qos_requested_flags(dev); |
693 | if (set) | 719 | if (set) |
694 | value |= mask; | 720 | value |= mask; |
@@ -697,9 +723,12 @@ int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set) | |||
697 | 723 | ||
698 | ret = __dev_pm_qos_update_request(dev->power.qos->flags_req, value); | 724 | ret = __dev_pm_qos_update_request(dev->power.qos->flags_req, value); |
699 | 725 | ||
726 | out: | ||
700 | mutex_unlock(&dev_pm_qos_mtx); | 727 | mutex_unlock(&dev_pm_qos_mtx); |
701 | pm_runtime_put(dev); | 728 | pm_runtime_put(dev); |
702 | |||
703 | return ret; | 729 | return ret; |
704 | } | 730 | } |
731 | #else /* !CONFIG_PM_RUNTIME */ | ||
732 | static void __dev_pm_qos_hide_latency_limit(struct device *dev) {} | ||
733 | static void __dev_pm_qos_hide_flags(struct device *dev) {} | ||
705 | #endif /* CONFIG_PM_RUNTIME */ | 734 | #endif /* CONFIG_PM_RUNTIME */ |
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c index 50d16e3cb0a9..a53ebd265701 100644 --- a/drivers/base/power/sysfs.c +++ b/drivers/base/power/sysfs.c | |||
@@ -708,6 +708,7 @@ void rpm_sysfs_remove(struct device *dev) | |||
708 | 708 | ||
709 | void dpm_sysfs_remove(struct device *dev) | 709 | void dpm_sysfs_remove(struct device *dev) |
710 | { | 710 | { |
711 | dev_pm_qos_constraints_destroy(dev); | ||
711 | rpm_sysfs_remove(dev); | 712 | rpm_sysfs_remove(dev); |
712 | sysfs_unmerge_group(&dev->kobj, &pm_wakeup_attr_group); | 713 | sysfs_unmerge_group(&dev->kobj, &pm_wakeup_attr_group); |
713 | sysfs_remove_group(&dev->kobj, &pm_attr_group); | 714 | sysfs_remove_group(&dev->kobj, &pm_attr_group); |
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c index 4706c63d0bc6..020ea2b9fd2f 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c | |||
@@ -184,6 +184,7 @@ static irqreturn_t regmap_irq_thread(int irq, void *d) | |||
184 | if (ret < 0) { | 184 | if (ret < 0) { |
185 | dev_err(map->dev, "IRQ thread failed to resume: %d\n", | 185 | dev_err(map->dev, "IRQ thread failed to resume: %d\n", |
186 | ret); | 186 | ret); |
187 | pm_runtime_put(map->dev); | ||
187 | return IRQ_NONE; | 188 | return IRQ_NONE; |
188 | } | 189 | } |
189 | } | 190 | } |
diff --git a/drivers/char/random.c b/drivers/char/random.c index 594bda9dcfc8..32a6c5764950 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -852,6 +852,7 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min, | |||
852 | int reserved) | 852 | int reserved) |
853 | { | 853 | { |
854 | unsigned long flags; | 854 | unsigned long flags; |
855 | int wakeup_write = 0; | ||
855 | 856 | ||
856 | /* Hold lock while accounting */ | 857 | /* Hold lock while accounting */ |
857 | spin_lock_irqsave(&r->lock, flags); | 858 | spin_lock_irqsave(&r->lock, flags); |
@@ -873,10 +874,8 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min, | |||
873 | else | 874 | else |
874 | r->entropy_count = reserved; | 875 | r->entropy_count = reserved; |
875 | 876 | ||
876 | if (r->entropy_count < random_write_wakeup_thresh) { | 877 | if (r->entropy_count < random_write_wakeup_thresh) |
877 | wake_up_interruptible(&random_write_wait); | 878 | wakeup_write = 1; |
878 | kill_fasync(&fasync, SIGIO, POLL_OUT); | ||
879 | } | ||
880 | } | 879 | } |
881 | 880 | ||
882 | DEBUG_ENT("debiting %zu entropy credits from %s%s\n", | 881 | DEBUG_ENT("debiting %zu entropy credits from %s%s\n", |
@@ -884,6 +883,11 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min, | |||
884 | 883 | ||
885 | spin_unlock_irqrestore(&r->lock, flags); | 884 | spin_unlock_irqrestore(&r->lock, flags); |
886 | 885 | ||
886 | if (wakeup_write) { | ||
887 | wake_up_interruptible(&random_write_wait); | ||
888 | kill_fasync(&fasync, SIGIO, POLL_OUT); | ||
889 | } | ||
890 | |||
887 | return nbytes; | 891 | return nbytes; |
888 | } | 892 | } |
889 | 893 | ||
diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h index d2ac91150600..46bde01eee62 100644 --- a/drivers/cpufreq/cpufreq_governor.h +++ b/drivers/cpufreq/cpufreq_governor.h | |||
@@ -64,7 +64,7 @@ static void *get_cpu_dbs_info_s(int cpu) \ | |||
64 | * dbs: used as a shortform for demand based switching It helps to keep variable | 64 | * dbs: used as a shortform for demand based switching It helps to keep variable |
65 | * names smaller, simpler | 65 | * names smaller, simpler |
66 | * cdbs: common dbs | 66 | * cdbs: common dbs |
67 | * on_*: On-demand governor | 67 | * od_*: On-demand governor |
68 | * cs_*: Conservative governor | 68 | * cs_*: Conservative governor |
69 | */ | 69 | */ |
70 | 70 | ||
diff --git a/drivers/cpufreq/highbank-cpufreq.c b/drivers/cpufreq/highbank-cpufreq.c index 66e3a71b81a3..b61b5a3fad64 100644 --- a/drivers/cpufreq/highbank-cpufreq.c +++ b/drivers/cpufreq/highbank-cpufreq.c | |||
@@ -28,13 +28,7 @@ | |||
28 | 28 | ||
29 | static int hb_voltage_change(unsigned int freq) | 29 | static int hb_voltage_change(unsigned int freq) |
30 | { | 30 | { |
31 | int i; | 31 | u32 msg[HB_CPUFREQ_IPC_LEN] = {HB_CPUFREQ_CHANGE_NOTE, freq / 1000000}; |
32 | u32 msg[HB_CPUFREQ_IPC_LEN]; | ||
33 | |||
34 | msg[0] = HB_CPUFREQ_CHANGE_NOTE; | ||
35 | msg[1] = freq / 1000000; | ||
36 | for (i = 2; i < HB_CPUFREQ_IPC_LEN; i++) | ||
37 | msg[i] = 0; | ||
38 | 32 | ||
39 | return pl320_ipc_transmit(msg); | 33 | return pl320_ipc_transmit(msg); |
40 | } | 34 | } |
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 096fde0ebcb5..f6dd1e761129 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -662,6 +662,9 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) | |||
662 | 662 | ||
663 | cpu = all_cpu_data[policy->cpu]; | 663 | cpu = all_cpu_data[policy->cpu]; |
664 | 664 | ||
665 | if (!policy->cpuinfo.max_freq) | ||
666 | return -ENODEV; | ||
667 | |||
665 | intel_pstate_get_min_max(cpu, &min, &max); | 668 | intel_pstate_get_min_max(cpu, &min, &max); |
666 | 669 | ||
667 | limits.min_perf_pct = (policy->min * 100) / policy->cpuinfo.max_freq; | 670 | limits.min_perf_pct = (policy->min * 100) / policy->cpuinfo.max_freq; |
@@ -747,37 +750,11 @@ static struct cpufreq_driver intel_pstate_driver = { | |||
747 | .owner = THIS_MODULE, | 750 | .owner = THIS_MODULE, |
748 | }; | 751 | }; |
749 | 752 | ||
750 | static void intel_pstate_exit(void) | ||
751 | { | ||
752 | int cpu; | ||
753 | |||
754 | sysfs_remove_group(intel_pstate_kobject, | ||
755 | &intel_pstate_attr_group); | ||
756 | debugfs_remove_recursive(debugfs_parent); | ||
757 | |||
758 | cpufreq_unregister_driver(&intel_pstate_driver); | ||
759 | |||
760 | if (!all_cpu_data) | ||
761 | return; | ||
762 | |||
763 | get_online_cpus(); | ||
764 | for_each_online_cpu(cpu) { | ||
765 | if (all_cpu_data[cpu]) { | ||
766 | del_timer_sync(&all_cpu_data[cpu]->timer); | ||
767 | kfree(all_cpu_data[cpu]); | ||
768 | } | ||
769 | } | ||
770 | |||
771 | put_online_cpus(); | ||
772 | vfree(all_cpu_data); | ||
773 | } | ||
774 | module_exit(intel_pstate_exit); | ||
775 | |||
776 | static int __initdata no_load; | 753 | static int __initdata no_load; |
777 | 754 | ||
778 | static int __init intel_pstate_init(void) | 755 | static int __init intel_pstate_init(void) |
779 | { | 756 | { |
780 | int rc = 0; | 757 | int cpu, rc = 0; |
781 | const struct x86_cpu_id *id; | 758 | const struct x86_cpu_id *id; |
782 | 759 | ||
783 | if (no_load) | 760 | if (no_load) |
@@ -802,7 +779,16 @@ static int __init intel_pstate_init(void) | |||
802 | intel_pstate_sysfs_expose_params(); | 779 | intel_pstate_sysfs_expose_params(); |
803 | return rc; | 780 | return rc; |
804 | out: | 781 | out: |
805 | intel_pstate_exit(); | 782 | get_online_cpus(); |
783 | for_each_online_cpu(cpu) { | ||
784 | if (all_cpu_data[cpu]) { | ||
785 | del_timer_sync(&all_cpu_data[cpu]->timer); | ||
786 | kfree(all_cpu_data[cpu]); | ||
787 | } | ||
788 | } | ||
789 | |||
790 | put_online_cpus(); | ||
791 | vfree(all_cpu_data); | ||
806 | return -ENODEV; | 792 | return -ENODEV; |
807 | } | 793 | } |
808 | device_initcall(intel_pstate_init); | 794 | device_initcall(intel_pstate_init); |
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 982f1f5f5742..4cd392dbf115 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c | |||
@@ -442,7 +442,6 @@ static int __init dmi_present(const char __iomem *p) | |||
442 | static int __init smbios_present(const char __iomem *p) | 442 | static int __init smbios_present(const char __iomem *p) |
443 | { | 443 | { |
444 | u8 buf[32]; | 444 | u8 buf[32]; |
445 | int offset = 0; | ||
446 | 445 | ||
447 | memcpy_fromio(buf, p, 32); | 446 | memcpy_fromio(buf, p, 32); |
448 | if ((buf[5] < 32) && dmi_checksum(buf, buf[5])) { | 447 | if ((buf[5] < 32) && dmi_checksum(buf, buf[5])) { |
@@ -461,9 +460,9 @@ static int __init smbios_present(const char __iomem *p) | |||
461 | dmi_ver = 0x0206; | 460 | dmi_ver = 0x0206; |
462 | break; | 461 | break; |
463 | } | 462 | } |
464 | offset = 16; | 463 | return memcmp(p + 16, "_DMI_", 5) || dmi_present(p + 16); |
465 | } | 464 | } |
466 | return dmi_present(buf + offset); | 465 | return 1; |
467 | } | 466 | } |
468 | 467 | ||
469 | void __init dmi_scan_machine(void) | 468 | void __init dmi_scan_machine(void) |
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 7320bf891706..bea32d1ef7d5 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c | |||
@@ -426,6 +426,44 @@ get_var_data(struct efivars *efivars, struct efi_variable *var) | |||
426 | return status; | 426 | return status; |
427 | } | 427 | } |
428 | 428 | ||
429 | static efi_status_t | ||
430 | check_var_size_locked(struct efivars *efivars, u32 attributes, | ||
431 | unsigned long size) | ||
432 | { | ||
433 | u64 storage_size, remaining_size, max_size; | ||
434 | efi_status_t status; | ||
435 | const struct efivar_operations *fops = efivars->ops; | ||
436 | |||
437 | if (!efivars->ops->query_variable_info) | ||
438 | return EFI_UNSUPPORTED; | ||
439 | |||
440 | status = fops->query_variable_info(attributes, &storage_size, | ||
441 | &remaining_size, &max_size); | ||
442 | |||
443 | if (status != EFI_SUCCESS) | ||
444 | return status; | ||
445 | |||
446 | if (!storage_size || size > remaining_size || size > max_size || | ||
447 | (remaining_size - size) < (storage_size / 2)) | ||
448 | return EFI_OUT_OF_RESOURCES; | ||
449 | |||
450 | return status; | ||
451 | } | ||
452 | |||
453 | |||
454 | static efi_status_t | ||
455 | check_var_size(struct efivars *efivars, u32 attributes, unsigned long size) | ||
456 | { | ||
457 | efi_status_t status; | ||
458 | unsigned long flags; | ||
459 | |||
460 | spin_lock_irqsave(&efivars->lock, flags); | ||
461 | status = check_var_size_locked(efivars, attributes, size); | ||
462 | spin_unlock_irqrestore(&efivars->lock, flags); | ||
463 | |||
464 | return status; | ||
465 | } | ||
466 | |||
429 | static ssize_t | 467 | static ssize_t |
430 | efivar_guid_read(struct efivar_entry *entry, char *buf) | 468 | efivar_guid_read(struct efivar_entry *entry, char *buf) |
431 | { | 469 | { |
@@ -547,11 +585,16 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count) | |||
547 | } | 585 | } |
548 | 586 | ||
549 | spin_lock_irq(&efivars->lock); | 587 | spin_lock_irq(&efivars->lock); |
550 | status = efivars->ops->set_variable(new_var->VariableName, | 588 | |
551 | &new_var->VendorGuid, | 589 | status = check_var_size_locked(efivars, new_var->Attributes, |
552 | new_var->Attributes, | 590 | new_var->DataSize + utf16_strsize(new_var->VariableName, 1024)); |
553 | new_var->DataSize, | 591 | |
554 | new_var->Data); | 592 | if (status == EFI_SUCCESS || status == EFI_UNSUPPORTED) |
593 | status = efivars->ops->set_variable(new_var->VariableName, | ||
594 | &new_var->VendorGuid, | ||
595 | new_var->Attributes, | ||
596 | new_var->DataSize, | ||
597 | new_var->Data); | ||
555 | 598 | ||
556 | spin_unlock_irq(&efivars->lock); | 599 | spin_unlock_irq(&efivars->lock); |
557 | 600 | ||
@@ -702,8 +745,7 @@ static ssize_t efivarfs_file_write(struct file *file, | |||
702 | u32 attributes; | 745 | u32 attributes; |
703 | struct inode *inode = file->f_mapping->host; | 746 | struct inode *inode = file->f_mapping->host; |
704 | unsigned long datasize = count - sizeof(attributes); | 747 | unsigned long datasize = count - sizeof(attributes); |
705 | unsigned long newdatasize; | 748 | unsigned long newdatasize, varsize; |
706 | u64 storage_size, remaining_size, max_size; | ||
707 | ssize_t bytes = 0; | 749 | ssize_t bytes = 0; |
708 | 750 | ||
709 | if (count < sizeof(attributes)) | 751 | if (count < sizeof(attributes)) |
@@ -722,28 +764,18 @@ static ssize_t efivarfs_file_write(struct file *file, | |||
722 | * amounts of memory. Pick a default size of 64K if | 764 | * amounts of memory. Pick a default size of 64K if |
723 | * QueryVariableInfo() isn't supported by the firmware. | 765 | * QueryVariableInfo() isn't supported by the firmware. |
724 | */ | 766 | */ |
725 | spin_lock_irq(&efivars->lock); | ||
726 | |||
727 | if (!efivars->ops->query_variable_info) | ||
728 | status = EFI_UNSUPPORTED; | ||
729 | else { | ||
730 | const struct efivar_operations *fops = efivars->ops; | ||
731 | status = fops->query_variable_info(attributes, &storage_size, | ||
732 | &remaining_size, &max_size); | ||
733 | } | ||
734 | 767 | ||
735 | spin_unlock_irq(&efivars->lock); | 768 | varsize = datasize + utf16_strsize(var->var.VariableName, 1024); |
769 | status = check_var_size(efivars, attributes, varsize); | ||
736 | 770 | ||
737 | if (status != EFI_SUCCESS) { | 771 | if (status != EFI_SUCCESS) { |
738 | if (status != EFI_UNSUPPORTED) | 772 | if (status != EFI_UNSUPPORTED) |
739 | return efi_status_to_err(status); | 773 | return efi_status_to_err(status); |
740 | 774 | ||
741 | remaining_size = 65536; | 775 | if (datasize > 65536) |
776 | return -ENOSPC; | ||
742 | } | 777 | } |
743 | 778 | ||
744 | if (datasize > remaining_size) | ||
745 | return -ENOSPC; | ||
746 | |||
747 | data = kmalloc(datasize, GFP_KERNEL); | 779 | data = kmalloc(datasize, GFP_KERNEL); |
748 | if (!data) | 780 | if (!data) |
749 | return -ENOMEM; | 781 | return -ENOMEM; |
@@ -765,6 +797,19 @@ static ssize_t efivarfs_file_write(struct file *file, | |||
765 | */ | 797 | */ |
766 | spin_lock_irq(&efivars->lock); | 798 | spin_lock_irq(&efivars->lock); |
767 | 799 | ||
800 | /* | ||
801 | * Ensure that the available space hasn't shrunk below the safe level | ||
802 | */ | ||
803 | |||
804 | status = check_var_size_locked(efivars, attributes, varsize); | ||
805 | |||
806 | if (status != EFI_SUCCESS && status != EFI_UNSUPPORTED) { | ||
807 | spin_unlock_irq(&efivars->lock); | ||
808 | kfree(data); | ||
809 | |||
810 | return efi_status_to_err(status); | ||
811 | } | ||
812 | |||
768 | status = efivars->ops->set_variable(var->var.VariableName, | 813 | status = efivars->ops->set_variable(var->var.VariableName, |
769 | &var->var.VendorGuid, | 814 | &var->var.VendorGuid, |
770 | attributes, datasize, | 815 | attributes, datasize, |
@@ -929,8 +974,8 @@ static bool efivarfs_valid_name(const char *str, int len) | |||
929 | if (len < GUID_LEN + 2) | 974 | if (len < GUID_LEN + 2) |
930 | return false; | 975 | return false; |
931 | 976 | ||
932 | /* GUID should be right after the first '-' */ | 977 | /* GUID must be preceded by a '-' */ |
933 | if (s - 1 != strchr(str, '-')) | 978 | if (*(s - 1) != '-') |
934 | return false; | 979 | return false; |
935 | 980 | ||
936 | /* | 981 | /* |
@@ -1118,15 +1163,22 @@ static struct dentry_operations efivarfs_d_ops = { | |||
1118 | 1163 | ||
1119 | static struct dentry *efivarfs_alloc_dentry(struct dentry *parent, char *name) | 1164 | static struct dentry *efivarfs_alloc_dentry(struct dentry *parent, char *name) |
1120 | { | 1165 | { |
1166 | struct dentry *d; | ||
1121 | struct qstr q; | 1167 | struct qstr q; |
1168 | int err; | ||
1122 | 1169 | ||
1123 | q.name = name; | 1170 | q.name = name; |
1124 | q.len = strlen(name); | 1171 | q.len = strlen(name); |
1125 | 1172 | ||
1126 | if (efivarfs_d_hash(NULL, NULL, &q)) | 1173 | err = efivarfs_d_hash(NULL, NULL, &q); |
1127 | return NULL; | 1174 | if (err) |
1175 | return ERR_PTR(err); | ||
1176 | |||
1177 | d = d_alloc(parent, &q); | ||
1178 | if (d) | ||
1179 | return d; | ||
1128 | 1180 | ||
1129 | return d_alloc(parent, &q); | 1181 | return ERR_PTR(-ENOMEM); |
1130 | } | 1182 | } |
1131 | 1183 | ||
1132 | static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) | 1184 | static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) |
@@ -1136,6 +1188,7 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) | |||
1136 | struct efivar_entry *entry, *n; | 1188 | struct efivar_entry *entry, *n; |
1137 | struct efivars *efivars = &__efivars; | 1189 | struct efivars *efivars = &__efivars; |
1138 | char *name; | 1190 | char *name; |
1191 | int err = -ENOMEM; | ||
1139 | 1192 | ||
1140 | efivarfs_sb = sb; | 1193 | efivarfs_sb = sb; |
1141 | 1194 | ||
@@ -1186,8 +1239,10 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) | |||
1186 | goto fail_name; | 1239 | goto fail_name; |
1187 | 1240 | ||
1188 | dentry = efivarfs_alloc_dentry(root, name); | 1241 | dentry = efivarfs_alloc_dentry(root, name); |
1189 | if (!dentry) | 1242 | if (IS_ERR(dentry)) { |
1243 | err = PTR_ERR(dentry); | ||
1190 | goto fail_inode; | 1244 | goto fail_inode; |
1245 | } | ||
1191 | 1246 | ||
1192 | /* copied by the above to local storage in the dentry. */ | 1247 | /* copied by the above to local storage in the dentry. */ |
1193 | kfree(name); | 1248 | kfree(name); |
@@ -1214,7 +1269,7 @@ fail_inode: | |||
1214 | fail_name: | 1269 | fail_name: |
1215 | kfree(name); | 1270 | kfree(name); |
1216 | fail: | 1271 | fail: |
1217 | return -ENOMEM; | 1272 | return err; |
1218 | } | 1273 | } |
1219 | 1274 | ||
1220 | static struct dentry *efivarfs_mount(struct file_system_type *fs_type, | 1275 | static struct dentry *efivarfs_mount(struct file_system_type *fs_type, |
@@ -1345,7 +1400,6 @@ static int efi_pstore_write(enum pstore_type_id type, | |||
1345 | efi_guid_t vendor = LINUX_EFI_CRASH_GUID; | 1400 | efi_guid_t vendor = LINUX_EFI_CRASH_GUID; |
1346 | struct efivars *efivars = psi->data; | 1401 | struct efivars *efivars = psi->data; |
1347 | int i, ret = 0; | 1402 | int i, ret = 0; |
1348 | u64 storage_space, remaining_space, max_variable_size; | ||
1349 | efi_status_t status = EFI_NOT_FOUND; | 1403 | efi_status_t status = EFI_NOT_FOUND; |
1350 | unsigned long flags; | 1404 | unsigned long flags; |
1351 | 1405 | ||
@@ -1365,11 +1419,11 @@ static int efi_pstore_write(enum pstore_type_id type, | |||
1365 | * size: a size of logging data | 1419 | * size: a size of logging data |
1366 | * DUMP_NAME_LEN * 2: a maximum size of variable name | 1420 | * DUMP_NAME_LEN * 2: a maximum size of variable name |
1367 | */ | 1421 | */ |
1368 | status = efivars->ops->query_variable_info(PSTORE_EFI_ATTRIBUTES, | 1422 | |
1369 | &storage_space, | 1423 | status = check_var_size_locked(efivars, PSTORE_EFI_ATTRIBUTES, |
1370 | &remaining_space, | 1424 | size + DUMP_NAME_LEN * 2); |
1371 | &max_variable_size); | 1425 | |
1372 | if (status || remaining_space < size + DUMP_NAME_LEN * 2) { | 1426 | if (status) { |
1373 | spin_unlock_irqrestore(&efivars->lock, flags); | 1427 | spin_unlock_irqrestore(&efivars->lock, flags); |
1374 | *id = part; | 1428 | *id = part; |
1375 | return -ENOSPC; | 1429 | return -ENOSPC; |
@@ -1544,6 +1598,14 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj, | |||
1544 | return -EINVAL; | 1598 | return -EINVAL; |
1545 | } | 1599 | } |
1546 | 1600 | ||
1601 | status = check_var_size_locked(efivars, new_var->Attributes, | ||
1602 | new_var->DataSize + utf16_strsize(new_var->VariableName, 1024)); | ||
1603 | |||
1604 | if (status && status != EFI_UNSUPPORTED) { | ||
1605 | spin_unlock_irq(&efivars->lock); | ||
1606 | return efi_status_to_err(status); | ||
1607 | } | ||
1608 | |||
1547 | /* now *really* create the variable via EFI */ | 1609 | /* now *really* create the variable via EFI */ |
1548 | status = efivars->ops->set_variable(new_var->VariableName, | 1610 | status = efivars->ops->set_variable(new_var->VariableName, |
1549 | &new_var->VendorGuid, | 1611 | &new_var->VendorGuid, |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index c5b8c81b9440..0a8eceb75902 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -379,15 +379,15 @@ static const struct pci_device_id pciidlist[] = { /* aka */ | |||
379 | INTEL_VGA_DEVICE(0x0A06, &intel_haswell_m_info), /* ULT GT1 mobile */ | 379 | INTEL_VGA_DEVICE(0x0A06, &intel_haswell_m_info), /* ULT GT1 mobile */ |
380 | INTEL_VGA_DEVICE(0x0A16, &intel_haswell_m_info), /* ULT GT2 mobile */ | 380 | INTEL_VGA_DEVICE(0x0A16, &intel_haswell_m_info), /* ULT GT2 mobile */ |
381 | INTEL_VGA_DEVICE(0x0A26, &intel_haswell_m_info), /* ULT GT2 mobile */ | 381 | INTEL_VGA_DEVICE(0x0A26, &intel_haswell_m_info), /* ULT GT2 mobile */ |
382 | INTEL_VGA_DEVICE(0x0D12, &intel_haswell_d_info), /* CRW GT1 desktop */ | 382 | INTEL_VGA_DEVICE(0x0D02, &intel_haswell_d_info), /* CRW GT1 desktop */ |
383 | INTEL_VGA_DEVICE(0x0D12, &intel_haswell_d_info), /* CRW GT2 desktop */ | ||
383 | INTEL_VGA_DEVICE(0x0D22, &intel_haswell_d_info), /* CRW GT2 desktop */ | 384 | INTEL_VGA_DEVICE(0x0D22, &intel_haswell_d_info), /* CRW GT2 desktop */ |
384 | INTEL_VGA_DEVICE(0x0D32, &intel_haswell_d_info), /* CRW GT2 desktop */ | 385 | INTEL_VGA_DEVICE(0x0D0A, &intel_haswell_d_info), /* CRW GT1 server */ |
385 | INTEL_VGA_DEVICE(0x0D1A, &intel_haswell_d_info), /* CRW GT1 server */ | 386 | INTEL_VGA_DEVICE(0x0D1A, &intel_haswell_d_info), /* CRW GT2 server */ |
386 | INTEL_VGA_DEVICE(0x0D2A, &intel_haswell_d_info), /* CRW GT2 server */ | 387 | INTEL_VGA_DEVICE(0x0D2A, &intel_haswell_d_info), /* CRW GT2 server */ |
387 | INTEL_VGA_DEVICE(0x0D3A, &intel_haswell_d_info), /* CRW GT2 server */ | 388 | INTEL_VGA_DEVICE(0x0D06, &intel_haswell_m_info), /* CRW GT1 mobile */ |
388 | INTEL_VGA_DEVICE(0x0D16, &intel_haswell_m_info), /* CRW GT1 mobile */ | 389 | INTEL_VGA_DEVICE(0x0D16, &intel_haswell_m_info), /* CRW GT2 mobile */ |
389 | INTEL_VGA_DEVICE(0x0D26, &intel_haswell_m_info), /* CRW GT2 mobile */ | 390 | INTEL_VGA_DEVICE(0x0D26, &intel_haswell_m_info), /* CRW GT2 mobile */ |
390 | INTEL_VGA_DEVICE(0x0D36, &intel_haswell_m_info), /* CRW GT2 mobile */ | ||
391 | INTEL_VGA_DEVICE(0x0f30, &intel_valleyview_m_info), | 391 | INTEL_VGA_DEVICE(0x0f30, &intel_valleyview_m_info), |
392 | INTEL_VGA_DEVICE(0x0157, &intel_valleyview_m_info), | 392 | INTEL_VGA_DEVICE(0x0157, &intel_valleyview_m_info), |
393 | INTEL_VGA_DEVICE(0x0155, &intel_valleyview_d_info), | 393 | INTEL_VGA_DEVICE(0x0155, &intel_valleyview_d_info), |
@@ -495,6 +495,7 @@ static int i915_drm_freeze(struct drm_device *dev) | |||
495 | intel_modeset_disable(dev); | 495 | intel_modeset_disable(dev); |
496 | 496 | ||
497 | drm_irq_uninstall(dev); | 497 | drm_irq_uninstall(dev); |
498 | dev_priv->enable_hotplug_processing = false; | ||
498 | } | 499 | } |
499 | 500 | ||
500 | i915_save_state(dev); | 501 | i915_save_state(dev); |
@@ -568,10 +569,20 @@ static int __i915_drm_thaw(struct drm_device *dev) | |||
568 | error = i915_gem_init_hw(dev); | 569 | error = i915_gem_init_hw(dev); |
569 | mutex_unlock(&dev->struct_mutex); | 570 | mutex_unlock(&dev->struct_mutex); |
570 | 571 | ||
572 | /* We need working interrupts for modeset enabling ... */ | ||
573 | drm_irq_install(dev); | ||
574 | |||
571 | intel_modeset_init_hw(dev); | 575 | intel_modeset_init_hw(dev); |
572 | intel_modeset_setup_hw_state(dev, false); | 576 | intel_modeset_setup_hw_state(dev, false); |
573 | drm_irq_install(dev); | 577 | |
578 | /* | ||
579 | * ... but also need to make sure that hotplug processing | ||
580 | * doesn't cause havoc. Like in the driver load code we don't | ||
581 | * bother with the tiny race here where we might loose hotplug | ||
582 | * notifications. | ||
583 | * */ | ||
574 | intel_hpd_init(dev); | 584 | intel_hpd_init(dev); |
585 | dev_priv->enable_hotplug_processing = true; | ||
575 | } | 586 | } |
576 | 587 | ||
577 | intel_opregion_init(dev); | 588 | intel_opregion_init(dev); |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 2cd97d1cc920..3c7bb0410b51 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -701,7 +701,7 @@ static irqreturn_t ivybridge_irq_handler(int irq, void *arg) | |||
701 | { | 701 | { |
702 | struct drm_device *dev = (struct drm_device *) arg; | 702 | struct drm_device *dev = (struct drm_device *) arg; |
703 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 703 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
704 | u32 de_iir, gt_iir, de_ier, pm_iir; | 704 | u32 de_iir, gt_iir, de_ier, pm_iir, sde_ier; |
705 | irqreturn_t ret = IRQ_NONE; | 705 | irqreturn_t ret = IRQ_NONE; |
706 | int i; | 706 | int i; |
707 | 707 | ||
@@ -711,6 +711,15 @@ static irqreturn_t ivybridge_irq_handler(int irq, void *arg) | |||
711 | de_ier = I915_READ(DEIER); | 711 | de_ier = I915_READ(DEIER); |
712 | I915_WRITE(DEIER, de_ier & ~DE_MASTER_IRQ_CONTROL); | 712 | I915_WRITE(DEIER, de_ier & ~DE_MASTER_IRQ_CONTROL); |
713 | 713 | ||
714 | /* Disable south interrupts. We'll only write to SDEIIR once, so further | ||
715 | * interrupts will will be stored on its back queue, and then we'll be | ||
716 | * able to process them after we restore SDEIER (as soon as we restore | ||
717 | * it, we'll get an interrupt if SDEIIR still has something to process | ||
718 | * due to its back queue). */ | ||
719 | sde_ier = I915_READ(SDEIER); | ||
720 | I915_WRITE(SDEIER, 0); | ||
721 | POSTING_READ(SDEIER); | ||
722 | |||
714 | gt_iir = I915_READ(GTIIR); | 723 | gt_iir = I915_READ(GTIIR); |
715 | if (gt_iir) { | 724 | if (gt_iir) { |
716 | snb_gt_irq_handler(dev, dev_priv, gt_iir); | 725 | snb_gt_irq_handler(dev, dev_priv, gt_iir); |
@@ -759,6 +768,8 @@ static irqreturn_t ivybridge_irq_handler(int irq, void *arg) | |||
759 | 768 | ||
760 | I915_WRITE(DEIER, de_ier); | 769 | I915_WRITE(DEIER, de_ier); |
761 | POSTING_READ(DEIER); | 770 | POSTING_READ(DEIER); |
771 | I915_WRITE(SDEIER, sde_ier); | ||
772 | POSTING_READ(SDEIER); | ||
762 | 773 | ||
763 | return ret; | 774 | return ret; |
764 | } | 775 | } |
@@ -778,7 +789,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg) | |||
778 | struct drm_device *dev = (struct drm_device *) arg; | 789 | struct drm_device *dev = (struct drm_device *) arg; |
779 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 790 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
780 | int ret = IRQ_NONE; | 791 | int ret = IRQ_NONE; |
781 | u32 de_iir, gt_iir, de_ier, pm_iir; | 792 | u32 de_iir, gt_iir, de_ier, pm_iir, sde_ier; |
782 | 793 | ||
783 | atomic_inc(&dev_priv->irq_received); | 794 | atomic_inc(&dev_priv->irq_received); |
784 | 795 | ||
@@ -787,6 +798,15 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg) | |||
787 | I915_WRITE(DEIER, de_ier & ~DE_MASTER_IRQ_CONTROL); | 798 | I915_WRITE(DEIER, de_ier & ~DE_MASTER_IRQ_CONTROL); |
788 | POSTING_READ(DEIER); | 799 | POSTING_READ(DEIER); |
789 | 800 | ||
801 | /* Disable south interrupts. We'll only write to SDEIIR once, so further | ||
802 | * interrupts will will be stored on its back queue, and then we'll be | ||
803 | * able to process them after we restore SDEIER (as soon as we restore | ||
804 | * it, we'll get an interrupt if SDEIIR still has something to process | ||
805 | * due to its back queue). */ | ||
806 | sde_ier = I915_READ(SDEIER); | ||
807 | I915_WRITE(SDEIER, 0); | ||
808 | POSTING_READ(SDEIER); | ||
809 | |||
790 | de_iir = I915_READ(DEIIR); | 810 | de_iir = I915_READ(DEIIR); |
791 | gt_iir = I915_READ(GTIIR); | 811 | gt_iir = I915_READ(GTIIR); |
792 | pm_iir = I915_READ(GEN6_PMIIR); | 812 | pm_iir = I915_READ(GEN6_PMIIR); |
@@ -849,6 +869,8 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg) | |||
849 | done: | 869 | done: |
850 | I915_WRITE(DEIER, de_ier); | 870 | I915_WRITE(DEIER, de_ier); |
851 | POSTING_READ(DEIER); | 871 | POSTING_READ(DEIER); |
872 | I915_WRITE(SDEIER, sde_ier); | ||
873 | POSTING_READ(SDEIER); | ||
852 | 874 | ||
853 | return ret; | 875 | return ret; |
854 | } | 876 | } |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 527b664d3434..848992f67d56 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -1613,9 +1613,9 @@ | |||
1613 | #define ADPA_CRT_HOTPLUG_FORCE_TRIGGER (1<<16) | 1613 | #define ADPA_CRT_HOTPLUG_FORCE_TRIGGER (1<<16) |
1614 | #define ADPA_USE_VGA_HVPOLARITY (1<<15) | 1614 | #define ADPA_USE_VGA_HVPOLARITY (1<<15) |
1615 | #define ADPA_SETS_HVPOLARITY 0 | 1615 | #define ADPA_SETS_HVPOLARITY 0 |
1616 | #define ADPA_VSYNC_CNTL_DISABLE (1<<11) | 1616 | #define ADPA_VSYNC_CNTL_DISABLE (1<<10) |
1617 | #define ADPA_VSYNC_CNTL_ENABLE 0 | 1617 | #define ADPA_VSYNC_CNTL_ENABLE 0 |
1618 | #define ADPA_HSYNC_CNTL_DISABLE (1<<10) | 1618 | #define ADPA_HSYNC_CNTL_DISABLE (1<<11) |
1619 | #define ADPA_HSYNC_CNTL_ENABLE 0 | 1619 | #define ADPA_HSYNC_CNTL_ENABLE 0 |
1620 | #define ADPA_VSYNC_ACTIVE_HIGH (1<<4) | 1620 | #define ADPA_VSYNC_ACTIVE_HIGH (1<<4) |
1621 | #define ADPA_VSYNC_ACTIVE_LOW 0 | 1621 | #define ADPA_VSYNC_ACTIVE_LOW 0 |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 969d08c72d10..32a3693905ec 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -88,7 +88,7 @@ static void intel_disable_crt(struct intel_encoder *encoder) | |||
88 | u32 temp; | 88 | u32 temp; |
89 | 89 | ||
90 | temp = I915_READ(crt->adpa_reg); | 90 | temp = I915_READ(crt->adpa_reg); |
91 | temp &= ~(ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE); | 91 | temp |= ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE; |
92 | temp &= ~ADPA_DAC_ENABLE; | 92 | temp &= ~ADPA_DAC_ENABLE; |
93 | I915_WRITE(crt->adpa_reg, temp); | 93 | I915_WRITE(crt->adpa_reg, temp); |
94 | } | 94 | } |
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index d64af5aa4a1c..8d0bac3c35d7 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
@@ -1391,8 +1391,8 @@ void intel_ddi_prepare_link_retrain(struct drm_encoder *encoder) | |||
1391 | struct intel_dp *intel_dp = &intel_dig_port->dp; | 1391 | struct intel_dp *intel_dp = &intel_dig_port->dp; |
1392 | struct drm_i915_private *dev_priv = encoder->dev->dev_private; | 1392 | struct drm_i915_private *dev_priv = encoder->dev->dev_private; |
1393 | enum port port = intel_dig_port->port; | 1393 | enum port port = intel_dig_port->port; |
1394 | bool wait; | ||
1395 | uint32_t val; | 1394 | uint32_t val; |
1395 | bool wait = false; | ||
1396 | 1396 | ||
1397 | if (I915_READ(DP_TP_CTL(port)) & DP_TP_CTL_ENABLE) { | 1397 | if (I915_READ(DP_TP_CTL(port)) & DP_TP_CTL_ENABLE) { |
1398 | val = I915_READ(DDI_BUF_CTL(port)); | 1398 | val = I915_READ(DDI_BUF_CTL(port)); |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index a05ac2c91ba2..287b42c9d1a8 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -3604,6 +3604,30 @@ static void intel_crtc_dpms_overlay(struct intel_crtc *intel_crtc, bool enable) | |||
3604 | */ | 3604 | */ |
3605 | } | 3605 | } |
3606 | 3606 | ||
3607 | /** | ||
3608 | * i9xx_fixup_plane - ugly workaround for G45 to fire up the hardware | ||
3609 | * cursor plane briefly if not already running after enabling the display | ||
3610 | * plane. | ||
3611 | * This workaround avoids occasional blank screens when self refresh is | ||
3612 | * enabled. | ||
3613 | */ | ||
3614 | static void | ||
3615 | g4x_fixup_plane(struct drm_i915_private *dev_priv, enum pipe pipe) | ||
3616 | { | ||
3617 | u32 cntl = I915_READ(CURCNTR(pipe)); | ||
3618 | |||
3619 | if ((cntl & CURSOR_MODE) == 0) { | ||
3620 | u32 fw_bcl_self = I915_READ(FW_BLC_SELF); | ||
3621 | |||
3622 | I915_WRITE(FW_BLC_SELF, fw_bcl_self & ~FW_BLC_SELF_EN); | ||
3623 | I915_WRITE(CURCNTR(pipe), CURSOR_MODE_64_ARGB_AX); | ||
3624 | intel_wait_for_vblank(dev_priv->dev, pipe); | ||
3625 | I915_WRITE(CURCNTR(pipe), cntl); | ||
3626 | I915_WRITE(CURBASE(pipe), I915_READ(CURBASE(pipe))); | ||
3627 | I915_WRITE(FW_BLC_SELF, fw_bcl_self); | ||
3628 | } | ||
3629 | } | ||
3630 | |||
3607 | static void i9xx_crtc_enable(struct drm_crtc *crtc) | 3631 | static void i9xx_crtc_enable(struct drm_crtc *crtc) |
3608 | { | 3632 | { |
3609 | struct drm_device *dev = crtc->dev; | 3633 | struct drm_device *dev = crtc->dev; |
@@ -3629,6 +3653,8 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc) | |||
3629 | 3653 | ||
3630 | intel_enable_pipe(dev_priv, pipe, false); | 3654 | intel_enable_pipe(dev_priv, pipe, false); |
3631 | intel_enable_plane(dev_priv, plane, pipe); | 3655 | intel_enable_plane(dev_priv, plane, pipe); |
3656 | if (IS_G4X(dev)) | ||
3657 | g4x_fixup_plane(dev_priv, pipe); | ||
3632 | 3658 | ||
3633 | intel_crtc_load_lut(crtc); | 3659 | intel_crtc_load_lut(crtc); |
3634 | intel_update_fbc(dev); | 3660 | intel_update_fbc(dev); |
@@ -7256,8 +7282,8 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
7256 | { | 7282 | { |
7257 | struct drm_device *dev = crtc->dev; | 7283 | struct drm_device *dev = crtc->dev; |
7258 | struct drm_i915_private *dev_priv = dev->dev_private; | 7284 | struct drm_i915_private *dev_priv = dev->dev_private; |
7259 | struct intel_framebuffer *intel_fb; | 7285 | struct drm_framebuffer *old_fb = crtc->fb; |
7260 | struct drm_i915_gem_object *obj; | 7286 | struct drm_i915_gem_object *obj = to_intel_framebuffer(fb)->obj; |
7261 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 7287 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
7262 | struct intel_unpin_work *work; | 7288 | struct intel_unpin_work *work; |
7263 | unsigned long flags; | 7289 | unsigned long flags; |
@@ -7282,8 +7308,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
7282 | 7308 | ||
7283 | work->event = event; | 7309 | work->event = event; |
7284 | work->crtc = crtc; | 7310 | work->crtc = crtc; |
7285 | intel_fb = to_intel_framebuffer(crtc->fb); | 7311 | work->old_fb_obj = to_intel_framebuffer(old_fb)->obj; |
7286 | work->old_fb_obj = intel_fb->obj; | ||
7287 | INIT_WORK(&work->work, intel_unpin_work_fn); | 7312 | INIT_WORK(&work->work, intel_unpin_work_fn); |
7288 | 7313 | ||
7289 | ret = drm_vblank_get(dev, intel_crtc->pipe); | 7314 | ret = drm_vblank_get(dev, intel_crtc->pipe); |
@@ -7303,9 +7328,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
7303 | intel_crtc->unpin_work = work; | 7328 | intel_crtc->unpin_work = work; |
7304 | spin_unlock_irqrestore(&dev->event_lock, flags); | 7329 | spin_unlock_irqrestore(&dev->event_lock, flags); |
7305 | 7330 | ||
7306 | intel_fb = to_intel_framebuffer(fb); | ||
7307 | obj = intel_fb->obj; | ||
7308 | |||
7309 | if (atomic_read(&intel_crtc->unpin_work_count) >= 2) | 7331 | if (atomic_read(&intel_crtc->unpin_work_count) >= 2) |
7310 | flush_workqueue(dev_priv->wq); | 7332 | flush_workqueue(dev_priv->wq); |
7311 | 7333 | ||
@@ -7340,6 +7362,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
7340 | 7362 | ||
7341 | cleanup_pending: | 7363 | cleanup_pending: |
7342 | atomic_dec(&intel_crtc->unpin_work_count); | 7364 | atomic_dec(&intel_crtc->unpin_work_count); |
7365 | crtc->fb = old_fb; | ||
7343 | drm_gem_object_unreference(&work->old_fb_obj->base); | 7366 | drm_gem_object_unreference(&work->old_fb_obj->base); |
7344 | drm_gem_object_unreference(&obj->base); | 7367 | drm_gem_object_unreference(&obj->base); |
7345 | mutex_unlock(&dev->struct_mutex); | 7368 | mutex_unlock(&dev->struct_mutex); |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index f61cb7998c72..6f728e5ee793 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -353,7 +353,8 @@ intel_dp_aux_wait_done(struct intel_dp *intel_dp, bool has_aux_irq) | |||
353 | 353 | ||
354 | #define C (((status = I915_READ_NOTRACE(ch_ctl)) & DP_AUX_CH_CTL_SEND_BUSY) == 0) | 354 | #define C (((status = I915_READ_NOTRACE(ch_ctl)) & DP_AUX_CH_CTL_SEND_BUSY) == 0) |
355 | if (has_aux_irq) | 355 | if (has_aux_irq) |
356 | done = wait_event_timeout(dev_priv->gmbus_wait_queue, C, 10); | 356 | done = wait_event_timeout(dev_priv->gmbus_wait_queue, C, |
357 | msecs_to_jiffies(10)); | ||
357 | else | 358 | else |
358 | done = wait_for_atomic(C, 10) == 0; | 359 | done = wait_for_atomic(C, 10) == 0; |
359 | if (!done) | 360 | if (!done) |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 61fee7fcdc2c..a1794c6df1bf 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -2574,7 +2574,7 @@ static void gen6_enable_rps(struct drm_device *dev) | |||
2574 | I915_WRITE(GEN6_RC_SLEEP, 0); | 2574 | I915_WRITE(GEN6_RC_SLEEP, 0); |
2575 | I915_WRITE(GEN6_RC1e_THRESHOLD, 1000); | 2575 | I915_WRITE(GEN6_RC1e_THRESHOLD, 1000); |
2576 | I915_WRITE(GEN6_RC6_THRESHOLD, 50000); | 2576 | I915_WRITE(GEN6_RC6_THRESHOLD, 50000); |
2577 | I915_WRITE(GEN6_RC6p_THRESHOLD, 100000); | 2577 | I915_WRITE(GEN6_RC6p_THRESHOLD, 150000); |
2578 | I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ | 2578 | I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ |
2579 | 2579 | ||
2580 | /* Check if we are enabling RC6 */ | 2580 | /* Check if we are enabling RC6 */ |
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h index 5ea5033eae0a..4d932c46725d 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.h +++ b/drivers/gpu/drm/mgag200/mgag200_drv.h | |||
@@ -112,7 +112,6 @@ struct mga_framebuffer { | |||
112 | struct mga_fbdev { | 112 | struct mga_fbdev { |
113 | struct drm_fb_helper helper; | 113 | struct drm_fb_helper helper; |
114 | struct mga_framebuffer mfb; | 114 | struct mga_framebuffer mfb; |
115 | struct list_head fbdev_list; | ||
116 | void *sysram; | 115 | void *sysram; |
117 | int size; | 116 | int size; |
118 | struct ttm_bo_kmap_obj mapping; | 117 | struct ttm_bo_kmap_obj mapping; |
diff --git a/drivers/gpu/drm/mgag200/mgag200_i2c.c b/drivers/gpu/drm/mgag200/mgag200_i2c.c index 5a88ec51b513..d3dcf54e6233 100644 --- a/drivers/gpu/drm/mgag200/mgag200_i2c.c +++ b/drivers/gpu/drm/mgag200/mgag200_i2c.c | |||
@@ -92,6 +92,7 @@ struct mga_i2c_chan *mgag200_i2c_create(struct drm_device *dev) | |||
92 | int ret; | 92 | int ret; |
93 | int data, clock; | 93 | int data, clock; |
94 | 94 | ||
95 | WREG_DAC(MGA1064_GEN_IO_CTL2, 1); | ||
95 | WREG_DAC(MGA1064_GEN_IO_DATA, 0xff); | 96 | WREG_DAC(MGA1064_GEN_IO_DATA, 0xff); |
96 | WREG_DAC(MGA1064_GEN_IO_CTL, 0); | 97 | WREG_DAC(MGA1064_GEN_IO_CTL, 0); |
97 | 98 | ||
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index d3d99a28ddef..a274b9906ef8 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c | |||
@@ -1406,6 +1406,14 @@ static int mga_vga_get_modes(struct drm_connector *connector) | |||
1406 | static int mga_vga_mode_valid(struct drm_connector *connector, | 1406 | static int mga_vga_mode_valid(struct drm_connector *connector, |
1407 | struct drm_display_mode *mode) | 1407 | struct drm_display_mode *mode) |
1408 | { | 1408 | { |
1409 | struct drm_device *dev = connector->dev; | ||
1410 | struct mga_device *mdev = (struct mga_device*)dev->dev_private; | ||
1411 | struct mga_fbdev *mfbdev = mdev->mfbdev; | ||
1412 | struct drm_fb_helper *fb_helper = &mfbdev->helper; | ||
1413 | struct drm_fb_helper_connector *fb_helper_conn = NULL; | ||
1414 | int bpp = 32; | ||
1415 | int i = 0; | ||
1416 | |||
1409 | /* FIXME: Add bandwidth and g200se limitations */ | 1417 | /* FIXME: Add bandwidth and g200se limitations */ |
1410 | 1418 | ||
1411 | if (mode->crtc_hdisplay > 2048 || mode->crtc_hsync_start > 4096 || | 1419 | if (mode->crtc_hdisplay > 2048 || mode->crtc_hsync_start > 4096 || |
@@ -1415,6 +1423,25 @@ static int mga_vga_mode_valid(struct drm_connector *connector, | |||
1415 | return MODE_BAD; | 1423 | return MODE_BAD; |
1416 | } | 1424 | } |
1417 | 1425 | ||
1426 | /* Validate the mode input by the user */ | ||
1427 | for (i = 0; i < fb_helper->connector_count; i++) { | ||
1428 | if (fb_helper->connector_info[i]->connector == connector) { | ||
1429 | /* Found the helper for this connector */ | ||
1430 | fb_helper_conn = fb_helper->connector_info[i]; | ||
1431 | if (fb_helper_conn->cmdline_mode.specified) { | ||
1432 | if (fb_helper_conn->cmdline_mode.bpp_specified) { | ||
1433 | bpp = fb_helper_conn->cmdline_mode.bpp; | ||
1434 | } | ||
1435 | } | ||
1436 | } | ||
1437 | } | ||
1438 | |||
1439 | if ((mode->hdisplay * mode->vdisplay * (bpp/8)) > mdev->mc.vram_size) { | ||
1440 | if (fb_helper_conn) | ||
1441 | fb_helper_conn->cmdline_mode.specified = false; | ||
1442 | return MODE_BAD; | ||
1443 | } | ||
1444 | |||
1418 | return MODE_OK; | 1445 | return MODE_OK; |
1419 | } | 1446 | } |
1420 | 1447 | ||
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c index 61cec0f6ff1c..4857f913efdd 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c | |||
@@ -350,7 +350,7 @@ nve0_graph_init_gpc_0(struct nvc0_graph_priv *priv) | |||
350 | nv_wr32(priv, GPC_UNIT(gpc, 0x0918), magicgpc918); | 350 | nv_wr32(priv, GPC_UNIT(gpc, 0x0918), magicgpc918); |
351 | } | 351 | } |
352 | 352 | ||
353 | nv_wr32(priv, GPC_BCAST(0x1bd4), magicgpc918); | 353 | nv_wr32(priv, GPC_BCAST(0x3fd4), magicgpc918); |
354 | nv_wr32(priv, GPC_BCAST(0x08ac), nv_rd32(priv, 0x100800)); | 354 | nv_wr32(priv, GPC_BCAST(0x08ac), nv_rd32(priv, 0x100800)); |
355 | } | 355 | } |
356 | 356 | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c index 2cc1e6a5eb6a..9c41b58d57e2 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c | |||
@@ -869,7 +869,7 @@ init_idx_addr_latched(struct nvbios_init *init) | |||
869 | init->offset += 2; | 869 | init->offset += 2; |
870 | 870 | ||
871 | init_wr32(init, dreg, idata); | 871 | init_wr32(init, dreg, idata); |
872 | init_mask(init, creg, ~mask, data | idata); | 872 | init_mask(init, creg, ~mask, data | iaddr); |
873 | } | 873 | } |
874 | } | 874 | } |
875 | 875 | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c b/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c index a114a0ed7e98..2e98e8a3f1aa 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c | |||
@@ -142,6 +142,7 @@ nouveau_i2c_port_create_(struct nouveau_object *parent, | |||
142 | /* drop port's i2c subdev refcount, i2c handles this itself */ | 142 | /* drop port's i2c subdev refcount, i2c handles this itself */ |
143 | if (ret == 0) { | 143 | if (ret == 0) { |
144 | list_add_tail(&port->head, &i2c->ports); | 144 | list_add_tail(&port->head, &i2c->ports); |
145 | atomic_dec(&parent->refcount); | ||
145 | atomic_dec(&engine->refcount); | 146 | atomic_dec(&engine->refcount); |
146 | } | 147 | } |
147 | 148 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_agp.c b/drivers/gpu/drm/nouveau/nouveau_agp.c index d28430cd2ba6..6e7a55f93a85 100644 --- a/drivers/gpu/drm/nouveau/nouveau_agp.c +++ b/drivers/gpu/drm/nouveau/nouveau_agp.c | |||
@@ -47,6 +47,18 @@ nouveau_agp_enabled(struct nouveau_drm *drm) | |||
47 | if (drm->agp.stat == UNKNOWN) { | 47 | if (drm->agp.stat == UNKNOWN) { |
48 | if (!nouveau_agpmode) | 48 | if (!nouveau_agpmode) |
49 | return false; | 49 | return false; |
50 | #ifdef __powerpc__ | ||
51 | /* Disable AGP by default on all PowerPC machines for | ||
52 | * now -- At least some UniNorth-2 AGP bridges are | ||
53 | * known to be broken: DMA from the host to the card | ||
54 | * works just fine, but writeback from the card to the | ||
55 | * host goes straight to memory untranslated bypassing | ||
56 | * the GATT somehow, making them quite painful to deal | ||
57 | * with... | ||
58 | */ | ||
59 | if (nouveau_agpmode == -1) | ||
60 | return false; | ||
61 | #endif | ||
50 | return true; | 62 | return true; |
51 | } | 63 | } |
52 | 64 | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index a6237c9cbbc3..87a5a56ed358 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -55,9 +55,9 @@ | |||
55 | 55 | ||
56 | /* offsets in shared sync bo of various structures */ | 56 | /* offsets in shared sync bo of various structures */ |
57 | #define EVO_SYNC(c, o) ((c) * 0x0100 + (o)) | 57 | #define EVO_SYNC(c, o) ((c) * 0x0100 + (o)) |
58 | #define EVO_MAST_NTFY EVO_SYNC( 0, 0x00) | 58 | #define EVO_MAST_NTFY EVO_SYNC( 0, 0x00) |
59 | #define EVO_FLIP_SEM0(c) EVO_SYNC((c), 0x00) | 59 | #define EVO_FLIP_SEM0(c) EVO_SYNC((c) + 1, 0x00) |
60 | #define EVO_FLIP_SEM1(c) EVO_SYNC((c), 0x10) | 60 | #define EVO_FLIP_SEM1(c) EVO_SYNC((c) + 1, 0x10) |
61 | 61 | ||
62 | #define EVO_CORE_HANDLE (0xd1500000) | 62 | #define EVO_CORE_HANDLE (0xd1500000) |
63 | #define EVO_CHAN_HANDLE(t,i) (0xd15c0000 | (((t) & 0x00ff) << 8) | (i)) | 63 | #define EVO_CHAN_HANDLE(t,i) (0xd15c0000 | (((t) & 0x00ff) << 8) | (i)) |
@@ -341,10 +341,8 @@ struct nv50_curs { | |||
341 | 341 | ||
342 | struct nv50_sync { | 342 | struct nv50_sync { |
343 | struct nv50_dmac base; | 343 | struct nv50_dmac base; |
344 | struct { | 344 | u32 addr; |
345 | u32 offset; | 345 | u32 data; |
346 | u16 value; | ||
347 | } sem; | ||
348 | }; | 346 | }; |
349 | 347 | ||
350 | struct nv50_ovly { | 348 | struct nv50_ovly { |
@@ -471,13 +469,33 @@ nv50_display_crtc_sema(struct drm_device *dev, int crtc) | |||
471 | return nv50_disp(dev)->sync; | 469 | return nv50_disp(dev)->sync; |
472 | } | 470 | } |
473 | 471 | ||
472 | struct nv50_display_flip { | ||
473 | struct nv50_disp *disp; | ||
474 | struct nv50_sync *chan; | ||
475 | }; | ||
476 | |||
477 | static bool | ||
478 | nv50_display_flip_wait(void *data) | ||
479 | { | ||
480 | struct nv50_display_flip *flip = data; | ||
481 | if (nouveau_bo_rd32(flip->disp->sync, flip->chan->addr / 4) == | ||
482 | flip->chan->data); | ||
483 | return true; | ||
484 | usleep_range(1, 2); | ||
485 | return false; | ||
486 | } | ||
487 | |||
474 | void | 488 | void |
475 | nv50_display_flip_stop(struct drm_crtc *crtc) | 489 | nv50_display_flip_stop(struct drm_crtc *crtc) |
476 | { | 490 | { |
477 | struct nv50_sync *sync = nv50_sync(crtc); | 491 | struct nouveau_device *device = nouveau_dev(crtc->dev); |
492 | struct nv50_display_flip flip = { | ||
493 | .disp = nv50_disp(crtc->dev), | ||
494 | .chan = nv50_sync(crtc), | ||
495 | }; | ||
478 | u32 *push; | 496 | u32 *push; |
479 | 497 | ||
480 | push = evo_wait(sync, 8); | 498 | push = evo_wait(flip.chan, 8); |
481 | if (push) { | 499 | if (push) { |
482 | evo_mthd(push, 0x0084, 1); | 500 | evo_mthd(push, 0x0084, 1); |
483 | evo_data(push, 0x00000000); | 501 | evo_data(push, 0x00000000); |
@@ -487,8 +505,10 @@ nv50_display_flip_stop(struct drm_crtc *crtc) | |||
487 | evo_data(push, 0x00000000); | 505 | evo_data(push, 0x00000000); |
488 | evo_mthd(push, 0x0080, 1); | 506 | evo_mthd(push, 0x0080, 1); |
489 | evo_data(push, 0x00000000); | 507 | evo_data(push, 0x00000000); |
490 | evo_kick(push, sync); | 508 | evo_kick(push, flip.chan); |
491 | } | 509 | } |
510 | |||
511 | nv_wait_cb(device, nv50_display_flip_wait, &flip); | ||
492 | } | 512 | } |
493 | 513 | ||
494 | int | 514 | int |
@@ -496,11 +516,10 @@ nv50_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
496 | struct nouveau_channel *chan, u32 swap_interval) | 516 | struct nouveau_channel *chan, u32 swap_interval) |
497 | { | 517 | { |
498 | struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb); | 518 | struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb); |
499 | struct nv50_disp *disp = nv50_disp(crtc->dev); | ||
500 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); | 519 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); |
501 | struct nv50_sync *sync = nv50_sync(crtc); | 520 | struct nv50_sync *sync = nv50_sync(crtc); |
521 | int head = nv_crtc->index, ret; | ||
502 | u32 *push; | 522 | u32 *push; |
503 | int ret; | ||
504 | 523 | ||
505 | swap_interval <<= 4; | 524 | swap_interval <<= 4; |
506 | if (swap_interval == 0) | 525 | if (swap_interval == 0) |
@@ -510,58 +529,64 @@ nv50_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
510 | if (unlikely(push == NULL)) | 529 | if (unlikely(push == NULL)) |
511 | return -EBUSY; | 530 | return -EBUSY; |
512 | 531 | ||
513 | /* synchronise with the rendering channel, if necessary */ | 532 | if (chan && nv_mclass(chan->object) < NV84_CHANNEL_IND_CLASS) { |
514 | if (likely(chan)) { | 533 | ret = RING_SPACE(chan, 8); |
534 | if (ret) | ||
535 | return ret; | ||
536 | |||
537 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 2); | ||
538 | OUT_RING (chan, NvEvoSema0 + head); | ||
539 | OUT_RING (chan, sync->addr ^ 0x10); | ||
540 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_SEMAPHORE_RELEASE, 1); | ||
541 | OUT_RING (chan, sync->data + 1); | ||
542 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_SEMAPHORE_OFFSET, 2); | ||
543 | OUT_RING (chan, sync->addr); | ||
544 | OUT_RING (chan, sync->data); | ||
545 | } else | ||
546 | if (chan && nv_mclass(chan->object) < NVC0_CHANNEL_IND_CLASS) { | ||
547 | u64 addr = nv84_fence_crtc(chan, head) + sync->addr; | ||
548 | ret = RING_SPACE(chan, 12); | ||
549 | if (ret) | ||
550 | return ret; | ||
551 | |||
552 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 1); | ||
553 | OUT_RING (chan, chan->vram); | ||
554 | BEGIN_NV04(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | ||
555 | OUT_RING (chan, upper_32_bits(addr ^ 0x10)); | ||
556 | OUT_RING (chan, lower_32_bits(addr ^ 0x10)); | ||
557 | OUT_RING (chan, sync->data + 1); | ||
558 | OUT_RING (chan, NV84_SUBCHAN_SEMAPHORE_TRIGGER_WRITE_LONG); | ||
559 | BEGIN_NV04(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | ||
560 | OUT_RING (chan, upper_32_bits(addr)); | ||
561 | OUT_RING (chan, lower_32_bits(addr)); | ||
562 | OUT_RING (chan, sync->data); | ||
563 | OUT_RING (chan, NV84_SUBCHAN_SEMAPHORE_TRIGGER_ACQUIRE_EQUAL); | ||
564 | } else | ||
565 | if (chan) { | ||
566 | u64 addr = nv84_fence_crtc(chan, head) + sync->addr; | ||
515 | ret = RING_SPACE(chan, 10); | 567 | ret = RING_SPACE(chan, 10); |
516 | if (ret) | 568 | if (ret) |
517 | return ret; | 569 | return ret; |
518 | 570 | ||
519 | if (nv_mclass(chan->object) < NV84_CHANNEL_IND_CLASS) { | 571 | BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); |
520 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 2); | 572 | OUT_RING (chan, upper_32_bits(addr ^ 0x10)); |
521 | OUT_RING (chan, NvEvoSema0 + nv_crtc->index); | 573 | OUT_RING (chan, lower_32_bits(addr ^ 0x10)); |
522 | OUT_RING (chan, sync->sem.offset); | 574 | OUT_RING (chan, sync->data + 1); |
523 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_SEMAPHORE_RELEASE, 1); | 575 | OUT_RING (chan, NV84_SUBCHAN_SEMAPHORE_TRIGGER_WRITE_LONG | |
524 | OUT_RING (chan, 0xf00d0000 | sync->sem.value); | 576 | NVC0_SUBCHAN_SEMAPHORE_TRIGGER_YIELD); |
525 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_SEMAPHORE_OFFSET, 2); | 577 | BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); |
526 | OUT_RING (chan, sync->sem.offset ^ 0x10); | 578 | OUT_RING (chan, upper_32_bits(addr)); |
527 | OUT_RING (chan, 0x74b1e000); | 579 | OUT_RING (chan, lower_32_bits(addr)); |
528 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 1); | 580 | OUT_RING (chan, sync->data); |
529 | OUT_RING (chan, NvSema); | 581 | OUT_RING (chan, NV84_SUBCHAN_SEMAPHORE_TRIGGER_ACQUIRE_EQUAL | |
530 | } else | 582 | NVC0_SUBCHAN_SEMAPHORE_TRIGGER_YIELD); |
531 | if (nv_mclass(chan->object) < NVC0_CHANNEL_IND_CLASS) { | 583 | } |
532 | u64 offset = nv84_fence_crtc(chan, nv_crtc->index); | ||
533 | offset += sync->sem.offset; | ||
534 | |||
535 | BEGIN_NV04(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | ||
536 | OUT_RING (chan, upper_32_bits(offset)); | ||
537 | OUT_RING (chan, lower_32_bits(offset)); | ||
538 | OUT_RING (chan, 0xf00d0000 | sync->sem.value); | ||
539 | OUT_RING (chan, 0x00000002); | ||
540 | BEGIN_NV04(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | ||
541 | OUT_RING (chan, upper_32_bits(offset)); | ||
542 | OUT_RING (chan, lower_32_bits(offset ^ 0x10)); | ||
543 | OUT_RING (chan, 0x74b1e000); | ||
544 | OUT_RING (chan, 0x00000001); | ||
545 | } else { | ||
546 | u64 offset = nv84_fence_crtc(chan, nv_crtc->index); | ||
547 | offset += sync->sem.offset; | ||
548 | |||
549 | BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | ||
550 | OUT_RING (chan, upper_32_bits(offset)); | ||
551 | OUT_RING (chan, lower_32_bits(offset)); | ||
552 | OUT_RING (chan, 0xf00d0000 | sync->sem.value); | ||
553 | OUT_RING (chan, 0x00001002); | ||
554 | BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | ||
555 | OUT_RING (chan, upper_32_bits(offset)); | ||
556 | OUT_RING (chan, lower_32_bits(offset ^ 0x10)); | ||
557 | OUT_RING (chan, 0x74b1e000); | ||
558 | OUT_RING (chan, 0x00001001); | ||
559 | } | ||
560 | 584 | ||
585 | if (chan) { | ||
586 | sync->addr ^= 0x10; | ||
587 | sync->data++; | ||
561 | FIRE_RING (chan); | 588 | FIRE_RING (chan); |
562 | } else { | 589 | } else { |
563 | nouveau_bo_wr32(disp->sync, sync->sem.offset / 4, | ||
564 | 0xf00d0000 | sync->sem.value); | ||
565 | evo_sync(crtc->dev); | 590 | evo_sync(crtc->dev); |
566 | } | 591 | } |
567 | 592 | ||
@@ -575,9 +600,9 @@ nv50_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
575 | evo_data(push, 0x40000000); | 600 | evo_data(push, 0x40000000); |
576 | } | 601 | } |
577 | evo_mthd(push, 0x0088, 4); | 602 | evo_mthd(push, 0x0088, 4); |
578 | evo_data(push, sync->sem.offset); | 603 | evo_data(push, sync->addr); |
579 | evo_data(push, 0xf00d0000 | sync->sem.value); | 604 | evo_data(push, sync->data++); |
580 | evo_data(push, 0x74b1e000); | 605 | evo_data(push, sync->data); |
581 | evo_data(push, NvEvoSync); | 606 | evo_data(push, NvEvoSync); |
582 | evo_mthd(push, 0x00a0, 2); | 607 | evo_mthd(push, 0x00a0, 2); |
583 | evo_data(push, 0x00000000); | 608 | evo_data(push, 0x00000000); |
@@ -605,9 +630,6 @@ nv50_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
605 | evo_mthd(push, 0x0080, 1); | 630 | evo_mthd(push, 0x0080, 1); |
606 | evo_data(push, 0x00000000); | 631 | evo_data(push, 0x00000000); |
607 | evo_kick(push, sync); | 632 | evo_kick(push, sync); |
608 | |||
609 | sync->sem.offset ^= 0x10; | ||
610 | sync->sem.value++; | ||
611 | return 0; | 633 | return 0; |
612 | } | 634 | } |
613 | 635 | ||
@@ -1379,7 +1401,8 @@ nv50_crtc_create(struct drm_device *dev, struct nouveau_object *core, int index) | |||
1379 | if (ret) | 1401 | if (ret) |
1380 | goto out; | 1402 | goto out; |
1381 | 1403 | ||
1382 | head->sync.sem.offset = EVO_SYNC(1 + index, 0x00); | 1404 | head->sync.addr = EVO_FLIP_SEM0(index); |
1405 | head->sync.data = 0x00000000; | ||
1383 | 1406 | ||
1384 | /* allocate overlay resources */ | 1407 | /* allocate overlay resources */ |
1385 | ret = nv50_pioc_create(disp->core, NV50_DISP_OIMM_CLASS, index, | 1408 | ret = nv50_pioc_create(disp->core, NV50_DISP_OIMM_CLASS, index, |
@@ -2112,15 +2135,23 @@ nv50_display_fini(struct drm_device *dev) | |||
2112 | int | 2135 | int |
2113 | nv50_display_init(struct drm_device *dev) | 2136 | nv50_display_init(struct drm_device *dev) |
2114 | { | 2137 | { |
2115 | u32 *push = evo_wait(nv50_mast(dev), 32); | 2138 | struct nv50_disp *disp = nv50_disp(dev); |
2116 | if (push) { | 2139 | struct drm_crtc *crtc; |
2117 | evo_mthd(push, 0x0088, 1); | 2140 | u32 *push; |
2118 | evo_data(push, NvEvoSync); | 2141 | |
2119 | evo_kick(push, nv50_mast(dev)); | 2142 | push = evo_wait(nv50_mast(dev), 32); |
2120 | return 0; | 2143 | if (!push) |
2144 | return -EBUSY; | ||
2145 | |||
2146 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | ||
2147 | struct nv50_sync *sync = nv50_sync(crtc); | ||
2148 | nouveau_bo_wr32(disp->sync, sync->addr / 4, sync->data); | ||
2121 | } | 2149 | } |
2122 | 2150 | ||
2123 | return -EBUSY; | 2151 | evo_mthd(push, 0x0088, 1); |
2152 | evo_data(push, NvEvoSync); | ||
2153 | evo_kick(push, nv50_mast(dev)); | ||
2154 | return 0; | ||
2124 | } | 2155 | } |
2125 | 2156 | ||
2126 | void | 2157 | void |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 3c38ea46531c..305a657bf215 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -2438,6 +2438,12 @@ static u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev) | |||
2438 | if (tmp & L2_BUSY) | 2438 | if (tmp & L2_BUSY) |
2439 | reset_mask |= RADEON_RESET_VMC; | 2439 | reset_mask |= RADEON_RESET_VMC; |
2440 | 2440 | ||
2441 | /* Skip MC reset as it's mostly likely not hung, just busy */ | ||
2442 | if (reset_mask & RADEON_RESET_MC) { | ||
2443 | DRM_DEBUG("MC busy: 0x%08X, clearing.\n", reset_mask); | ||
2444 | reset_mask &= ~RADEON_RESET_MC; | ||
2445 | } | ||
2446 | |||
2441 | return reset_mask; | 2447 | return reset_mask; |
2442 | } | 2448 | } |
2443 | 2449 | ||
diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c index 99fb13286fd0..eb8ac315f92f 100644 --- a/drivers/gpu/drm/radeon/evergreen_cs.c +++ b/drivers/gpu/drm/radeon/evergreen_cs.c | |||
@@ -834,7 +834,7 @@ static int evergreen_cs_track_validate_texture(struct radeon_cs_parser *p, | |||
834 | __func__, __LINE__, toffset, surf.base_align); | 834 | __func__, __LINE__, toffset, surf.base_align); |
835 | return -EINVAL; | 835 | return -EINVAL; |
836 | } | 836 | } |
837 | if (moffset & (surf.base_align - 1)) { | 837 | if (surf.nsamples <= 1 && moffset & (surf.base_align - 1)) { |
838 | dev_warn(p->dev, "%s:%d mipmap bo base %ld not aligned with %ld\n", | 838 | dev_warn(p->dev, "%s:%d mipmap bo base %ld not aligned with %ld\n", |
839 | __func__, __LINE__, moffset, surf.base_align); | 839 | __func__, __LINE__, moffset, surf.base_align); |
840 | return -EINVAL; | 840 | return -EINVAL; |
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index 7cead763be9e..d4c633e12863 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
@@ -1381,6 +1381,12 @@ static u32 cayman_gpu_check_soft_reset(struct radeon_device *rdev) | |||
1381 | if (tmp & L2_BUSY) | 1381 | if (tmp & L2_BUSY) |
1382 | reset_mask |= RADEON_RESET_VMC; | 1382 | reset_mask |= RADEON_RESET_VMC; |
1383 | 1383 | ||
1384 | /* Skip MC reset as it's mostly likely not hung, just busy */ | ||
1385 | if (reset_mask & RADEON_RESET_MC) { | ||
1386 | DRM_DEBUG("MC busy: 0x%08X, clearing.\n", reset_mask); | ||
1387 | reset_mask &= ~RADEON_RESET_MC; | ||
1388 | } | ||
1389 | |||
1384 | return reset_mask; | 1390 | return reset_mask; |
1385 | } | 1391 | } |
1386 | 1392 | ||
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 6d4b5611daf4..0740db3fcd22 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -1394,6 +1394,12 @@ static u32 r600_gpu_check_soft_reset(struct radeon_device *rdev) | |||
1394 | if (r600_is_display_hung(rdev)) | 1394 | if (r600_is_display_hung(rdev)) |
1395 | reset_mask |= RADEON_RESET_DISPLAY; | 1395 | reset_mask |= RADEON_RESET_DISPLAY; |
1396 | 1396 | ||
1397 | /* Skip MC reset as it's mostly likely not hung, just busy */ | ||
1398 | if (reset_mask & RADEON_RESET_MC) { | ||
1399 | DRM_DEBUG("MC busy: 0x%08X, clearing.\n", reset_mask); | ||
1400 | reset_mask &= ~RADEON_RESET_MC; | ||
1401 | } | ||
1402 | |||
1397 | return reset_mask; | 1403 | return reset_mask; |
1398 | } | 1404 | } |
1399 | 1405 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 3e403bdda58f..78edadc9e86b 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
@@ -970,6 +970,15 @@ struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct | |||
970 | found = 1; | 970 | found = 1; |
971 | } | 971 | } |
972 | 972 | ||
973 | /* quirks */ | ||
974 | /* Radeon 9100 (R200) */ | ||
975 | if ((dev->pdev->device == 0x514D) && | ||
976 | (dev->pdev->subsystem_vendor == 0x174B) && | ||
977 | (dev->pdev->subsystem_device == 0x7149)) { | ||
978 | /* vbios value is bad, use the default */ | ||
979 | found = 0; | ||
980 | } | ||
981 | |||
973 | if (!found) /* fallback to defaults */ | 982 | if (!found) /* fallback to defaults */ |
974 | radeon_legacy_get_primary_dac_info_from_table(rdev, p_dac); | 983 | radeon_legacy_get_primary_dac_info_from_table(rdev, p_dac); |
975 | 984 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 167758488ed6..66a7f0fd9620 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -70,9 +70,10 @@ | |||
70 | * 2.27.0 - r600-SI: Add CS ioctl support for async DMA | 70 | * 2.27.0 - r600-SI: Add CS ioctl support for async DMA |
71 | * 2.28.0 - r600-eg: Add MEM_WRITE packet support | 71 | * 2.28.0 - r600-eg: Add MEM_WRITE packet support |
72 | * 2.29.0 - R500 FP16 color clear registers | 72 | * 2.29.0 - R500 FP16 color clear registers |
73 | * 2.30.0 - fix for FMASK texturing | ||
73 | */ | 74 | */ |
74 | #define KMS_DRIVER_MAJOR 2 | 75 | #define KMS_DRIVER_MAJOR 2 |
75 | #define KMS_DRIVER_MINOR 29 | 76 | #define KMS_DRIVER_MINOR 30 |
76 | #define KMS_DRIVER_PATCHLEVEL 0 | 77 | #define KMS_DRIVER_PATCHLEVEL 0 |
77 | int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); | 78 | int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); |
78 | int radeon_driver_unload_kms(struct drm_device *dev); | 79 | int radeon_driver_unload_kms(struct drm_device *dev); |
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index 90374dd77960..48f80cd42d8f 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c | |||
@@ -400,6 +400,9 @@ void radeon_irq_kms_enable_afmt(struct radeon_device *rdev, int block) | |||
400 | { | 400 | { |
401 | unsigned long irqflags; | 401 | unsigned long irqflags; |
402 | 402 | ||
403 | if (!rdev->ddev->irq_enabled) | ||
404 | return; | ||
405 | |||
403 | spin_lock_irqsave(&rdev->irq.lock, irqflags); | 406 | spin_lock_irqsave(&rdev->irq.lock, irqflags); |
404 | rdev->irq.afmt[block] = true; | 407 | rdev->irq.afmt[block] = true; |
405 | radeon_irq_set(rdev); | 408 | radeon_irq_set(rdev); |
@@ -419,6 +422,9 @@ void radeon_irq_kms_disable_afmt(struct radeon_device *rdev, int block) | |||
419 | { | 422 | { |
420 | unsigned long irqflags; | 423 | unsigned long irqflags; |
421 | 424 | ||
425 | if (!rdev->ddev->irq_enabled) | ||
426 | return; | ||
427 | |||
422 | spin_lock_irqsave(&rdev->irq.lock, irqflags); | 428 | spin_lock_irqsave(&rdev->irq.lock, irqflags); |
423 | rdev->irq.afmt[block] = false; | 429 | rdev->irq.afmt[block] = false; |
424 | radeon_irq_set(rdev); | 430 | radeon_irq_set(rdev); |
@@ -438,6 +444,9 @@ void radeon_irq_kms_enable_hpd(struct radeon_device *rdev, unsigned hpd_mask) | |||
438 | unsigned long irqflags; | 444 | unsigned long irqflags; |
439 | int i; | 445 | int i; |
440 | 446 | ||
447 | if (!rdev->ddev->irq_enabled) | ||
448 | return; | ||
449 | |||
441 | spin_lock_irqsave(&rdev->irq.lock, irqflags); | 450 | spin_lock_irqsave(&rdev->irq.lock, irqflags); |
442 | for (i = 0; i < RADEON_MAX_HPD_PINS; ++i) | 451 | for (i = 0; i < RADEON_MAX_HPD_PINS; ++i) |
443 | rdev->irq.hpd[i] |= !!(hpd_mask & (1 << i)); | 452 | rdev->irq.hpd[i] |= !!(hpd_mask & (1 << i)); |
@@ -458,6 +467,9 @@ void radeon_irq_kms_disable_hpd(struct radeon_device *rdev, unsigned hpd_mask) | |||
458 | unsigned long irqflags; | 467 | unsigned long irqflags; |
459 | int i; | 468 | int i; |
460 | 469 | ||
470 | if (!rdev->ddev->irq_enabled) | ||
471 | return; | ||
472 | |||
461 | spin_lock_irqsave(&rdev->irq.lock, irqflags); | 473 | spin_lock_irqsave(&rdev->irq.lock, irqflags); |
462 | for (i = 0; i < RADEON_MAX_HPD_PINS; ++i) | 474 | for (i = 0; i < RADEON_MAX_HPD_PINS; ++i) |
463 | rdev->irq.hpd[i] &= !(hpd_mask & (1 << i)); | 475 | rdev->irq.hpd[i] &= !(hpd_mask & (1 << i)); |
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 80979ed951eb..9128120da044 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
@@ -2284,6 +2284,12 @@ static u32 si_gpu_check_soft_reset(struct radeon_device *rdev) | |||
2284 | if (tmp & L2_BUSY) | 2284 | if (tmp & L2_BUSY) |
2285 | reset_mask |= RADEON_RESET_VMC; | 2285 | reset_mask |= RADEON_RESET_VMC; |
2286 | 2286 | ||
2287 | /* Skip MC reset as it's mostly likely not hung, just busy */ | ||
2288 | if (reset_mask & RADEON_RESET_MC) { | ||
2289 | DRM_DEBUG("MC busy: 0x%08X, clearing.\n", reset_mask); | ||
2290 | reset_mask &= ~RADEON_RESET_MC; | ||
2291 | } | ||
2292 | |||
2287 | return reset_mask; | 2293 | return reset_mask; |
2288 | } | 2294 | } |
2289 | 2295 | ||
diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig index c92955df0658..be1daf7344d3 100644 --- a/drivers/gpu/drm/tegra/Kconfig +++ b/drivers/gpu/drm/tegra/Kconfig | |||
@@ -4,7 +4,6 @@ config DRM_TEGRA | |||
4 | select DRM_KMS_HELPER | 4 | select DRM_KMS_HELPER |
5 | select DRM_GEM_CMA_HELPER | 5 | select DRM_GEM_CMA_HELPER |
6 | select DRM_KMS_CMA_HELPER | 6 | select DRM_KMS_CMA_HELPER |
7 | select DRM_HDMI | ||
8 | select FB_CFB_FILLRECT | 7 | select FB_CFB_FILLRECT |
9 | select FB_CFB_COPYAREA | 8 | select FB_CFB_COPYAREA |
10 | select FB_CFB_IMAGEBLIT | 9 | select FB_CFB_IMAGEBLIT |
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index 9500f2f3f8fe..8758f38c948c 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c | |||
@@ -459,19 +459,25 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev, | |||
459 | struct dj_report *dj_report) | 459 | struct dj_report *dj_report) |
460 | { | 460 | { |
461 | struct hid_device *hdev = djrcv_dev->hdev; | 461 | struct hid_device *hdev = djrcv_dev->hdev; |
462 | int sent_bytes; | 462 | struct hid_report *report; |
463 | struct hid_report_enum *output_report_enum; | ||
464 | u8 *data = (u8 *)(&dj_report->device_index); | ||
465 | int i; | ||
463 | 466 | ||
464 | if (!hdev->hid_output_raw_report) { | 467 | output_report_enum = &hdev->report_enum[HID_OUTPUT_REPORT]; |
465 | dev_err(&hdev->dev, "%s:" | 468 | report = output_report_enum->report_id_hash[REPORT_ID_DJ_SHORT]; |
466 | "hid_output_raw_report is null\n", __func__); | 469 | |
470 | if (!report) { | ||
471 | dev_err(&hdev->dev, "%s: unable to find dj report\n", __func__); | ||
467 | return -ENODEV; | 472 | return -ENODEV; |
468 | } | 473 | } |
469 | 474 | ||
470 | sent_bytes = hdev->hid_output_raw_report(hdev, (u8 *) dj_report, | 475 | for (i = 0; i < report->field[0]->report_count; i++) |
471 | sizeof(struct dj_report), | 476 | report->field[0]->value[i] = data[i]; |
472 | HID_OUTPUT_REPORT); | 477 | |
478 | usbhid_submit_report(hdev, report, USB_DIR_OUT); | ||
473 | 479 | ||
474 | return (sent_bytes < 0) ? sent_bytes : 0; | 480 | return 0; |
475 | } | 481 | } |
476 | 482 | ||
477 | static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) | 483 | static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) |
diff --git a/drivers/hwmon/pmbus/ltc2978.c b/drivers/hwmon/pmbus/ltc2978.c index 9652a2c92a24..a58de38e23d8 100644 --- a/drivers/hwmon/pmbus/ltc2978.c +++ b/drivers/hwmon/pmbus/ltc2978.c | |||
@@ -62,7 +62,7 @@ struct ltc2978_data { | |||
62 | int temp_min, temp_max; | 62 | int temp_min, temp_max; |
63 | int vout_min[8], vout_max[8]; | 63 | int vout_min[8], vout_max[8]; |
64 | int iout_max[2]; | 64 | int iout_max[2]; |
65 | int temp2_max[2]; | 65 | int temp2_max; |
66 | struct pmbus_driver_info info; | 66 | struct pmbus_driver_info info; |
67 | }; | 67 | }; |
68 | 68 | ||
@@ -204,10 +204,9 @@ static int ltc3880_read_word_data(struct i2c_client *client, int page, int reg) | |||
204 | ret = pmbus_read_word_data(client, page, | 204 | ret = pmbus_read_word_data(client, page, |
205 | LTC3880_MFR_TEMPERATURE2_PEAK); | 205 | LTC3880_MFR_TEMPERATURE2_PEAK); |
206 | if (ret >= 0) { | 206 | if (ret >= 0) { |
207 | if (lin11_to_val(ret) | 207 | if (lin11_to_val(ret) > lin11_to_val(data->temp2_max)) |
208 | > lin11_to_val(data->temp2_max[page])) | 208 | data->temp2_max = ret; |
209 | data->temp2_max[page] = ret; | 209 | ret = data->temp2_max; |
210 | ret = data->temp2_max[page]; | ||
211 | } | 210 | } |
212 | break; | 211 | break; |
213 | case PMBUS_VIRT_READ_VIN_MIN: | 212 | case PMBUS_VIRT_READ_VIN_MIN: |
@@ -248,11 +247,11 @@ static int ltc2978_write_word_data(struct i2c_client *client, int page, | |||
248 | 247 | ||
249 | switch (reg) { | 248 | switch (reg) { |
250 | case PMBUS_VIRT_RESET_IOUT_HISTORY: | 249 | case PMBUS_VIRT_RESET_IOUT_HISTORY: |
251 | data->iout_max[page] = 0x7fff; | 250 | data->iout_max[page] = 0x7c00; |
252 | ret = ltc2978_clear_peaks(client, page, data->id); | 251 | ret = ltc2978_clear_peaks(client, page, data->id); |
253 | break; | 252 | break; |
254 | case PMBUS_VIRT_RESET_TEMP2_HISTORY: | 253 | case PMBUS_VIRT_RESET_TEMP2_HISTORY: |
255 | data->temp2_max[page] = 0x7fff; | 254 | data->temp2_max = 0x7c00; |
256 | ret = ltc2978_clear_peaks(client, page, data->id); | 255 | ret = ltc2978_clear_peaks(client, page, data->id); |
257 | break; | 256 | break; |
258 | case PMBUS_VIRT_RESET_VOUT_HISTORY: | 257 | case PMBUS_VIRT_RESET_VOUT_HISTORY: |
@@ -262,12 +261,12 @@ static int ltc2978_write_word_data(struct i2c_client *client, int page, | |||
262 | break; | 261 | break; |
263 | case PMBUS_VIRT_RESET_VIN_HISTORY: | 262 | case PMBUS_VIRT_RESET_VIN_HISTORY: |
264 | data->vin_min = 0x7bff; | 263 | data->vin_min = 0x7bff; |
265 | data->vin_max = 0; | 264 | data->vin_max = 0x7c00; |
266 | ret = ltc2978_clear_peaks(client, page, data->id); | 265 | ret = ltc2978_clear_peaks(client, page, data->id); |
267 | break; | 266 | break; |
268 | case PMBUS_VIRT_RESET_TEMP_HISTORY: | 267 | case PMBUS_VIRT_RESET_TEMP_HISTORY: |
269 | data->temp_min = 0x7bff; | 268 | data->temp_min = 0x7bff; |
270 | data->temp_max = 0x7fff; | 269 | data->temp_max = 0x7c00; |
271 | ret = ltc2978_clear_peaks(client, page, data->id); | 270 | ret = ltc2978_clear_peaks(client, page, data->id); |
272 | break; | 271 | break; |
273 | default: | 272 | default: |
@@ -321,12 +320,13 @@ static int ltc2978_probe(struct i2c_client *client, | |||
321 | info = &data->info; | 320 | info = &data->info; |
322 | info->write_word_data = ltc2978_write_word_data; | 321 | info->write_word_data = ltc2978_write_word_data; |
323 | 322 | ||
324 | data->vout_min[0] = 0xffff; | ||
325 | data->vin_min = 0x7bff; | 323 | data->vin_min = 0x7bff; |
324 | data->vin_max = 0x7c00; | ||
326 | data->temp_min = 0x7bff; | 325 | data->temp_min = 0x7bff; |
327 | data->temp_max = 0x7fff; | 326 | data->temp_max = 0x7c00; |
327 | data->temp2_max = 0x7c00; | ||
328 | 328 | ||
329 | switch (id->driver_data) { | 329 | switch (data->id) { |
330 | case ltc2978: | 330 | case ltc2978: |
331 | info->read_word_data = ltc2978_read_word_data; | 331 | info->read_word_data = ltc2978_read_word_data; |
332 | info->pages = 8; | 332 | info->pages = 8; |
@@ -336,7 +336,6 @@ static int ltc2978_probe(struct i2c_client *client, | |||
336 | for (i = 1; i < 8; i++) { | 336 | for (i = 1; i < 8; i++) { |
337 | info->func[i] = PMBUS_HAVE_VOUT | 337 | info->func[i] = PMBUS_HAVE_VOUT |
338 | | PMBUS_HAVE_STATUS_VOUT; | 338 | | PMBUS_HAVE_STATUS_VOUT; |
339 | data->vout_min[i] = 0xffff; | ||
340 | } | 339 | } |
341 | break; | 340 | break; |
342 | case ltc3880: | 341 | case ltc3880: |
@@ -352,11 +351,14 @@ static int ltc2978_probe(struct i2c_client *client, | |||
352 | | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | 351 | | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
353 | | PMBUS_HAVE_POUT | 352 | | PMBUS_HAVE_POUT |
354 | | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP; | 353 | | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP; |
355 | data->vout_min[1] = 0xffff; | 354 | data->iout_max[0] = 0x7c00; |
355 | data->iout_max[1] = 0x7c00; | ||
356 | break; | 356 | break; |
357 | default: | 357 | default: |
358 | return -ENODEV; | 358 | return -ENODEV; |
359 | } | 359 | } |
360 | for (i = 0; i < info->pages; i++) | ||
361 | data->vout_min[i] = 0xffff; | ||
360 | 362 | ||
361 | return pmbus_do_probe(client, id, info); | 363 | return pmbus_do_probe(client, id, info); |
362 | } | 364 | } |
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c index bfe326e896df..2507f902fb7a 100644 --- a/drivers/hwmon/sht15.c +++ b/drivers/hwmon/sht15.c | |||
@@ -965,7 +965,13 @@ static int sht15_probe(struct platform_device *pdev) | |||
965 | if (voltage) | 965 | if (voltage) |
966 | data->supply_uv = voltage; | 966 | data->supply_uv = voltage; |
967 | 967 | ||
968 | regulator_enable(data->reg); | 968 | ret = regulator_enable(data->reg); |
969 | if (ret != 0) { | ||
970 | dev_err(&pdev->dev, | ||
971 | "failed to enable regulator: %d\n", ret); | ||
972 | return ret; | ||
973 | } | ||
974 | |||
969 | /* | 975 | /* |
970 | * Setup a notifier block to update this if another device | 976 | * Setup a notifier block to update this if another device |
971 | * causes the voltage to change | 977 | * causes the voltage to change |
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index dc7e478b7e5f..e5cdaf87822c 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c | |||
@@ -1083,6 +1083,7 @@ static const char *dma_remap_fault_reasons[] = | |||
1083 | "non-zero reserved fields in RTP", | 1083 | "non-zero reserved fields in RTP", |
1084 | "non-zero reserved fields in CTP", | 1084 | "non-zero reserved fields in CTP", |
1085 | "non-zero reserved fields in PTE", | 1085 | "non-zero reserved fields in PTE", |
1086 | "PCE for translation request specifies blocking", | ||
1086 | }; | 1087 | }; |
1087 | 1088 | ||
1088 | static const char *irq_remap_fault_reasons[] = | 1089 | static const char *irq_remap_fault_reasons[] = |
diff --git a/drivers/mailbox/pl320-ipc.c b/drivers/mailbox/pl320-ipc.c index c45b3aedafba..d873cbae2fbb 100644 --- a/drivers/mailbox/pl320-ipc.c +++ b/drivers/mailbox/pl320-ipc.c | |||
@@ -138,8 +138,7 @@ int pl320_ipc_unregister_notifier(struct notifier_block *nb) | |||
138 | } | 138 | } |
139 | EXPORT_SYMBOL_GPL(pl320_ipc_unregister_notifier); | 139 | EXPORT_SYMBOL_GPL(pl320_ipc_unregister_notifier); |
140 | 140 | ||
141 | static int __init pl320_probe(struct amba_device *adev, | 141 | static int pl320_probe(struct amba_device *adev, const struct amba_id *id) |
142 | const struct amba_id *id) | ||
143 | { | 142 | { |
144 | int ret; | 143 | int ret; |
145 | 144 | ||
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 39c937f9b426..dee5dddaa292 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -331,8 +331,14 @@ static void pci_acpi_cleanup(struct device *dev) | |||
331 | } | 331 | } |
332 | } | 332 | } |
333 | 333 | ||
334 | static bool pci_acpi_bus_match(struct device *dev) | ||
335 | { | ||
336 | return dev->bus == &pci_bus_type; | ||
337 | } | ||
338 | |||
334 | static struct acpi_bus_type acpi_pci_bus = { | 339 | static struct acpi_bus_type acpi_pci_bus = { |
335 | .bus = &pci_bus_type, | 340 | .name = "PCI", |
341 | .match = pci_acpi_bus_match, | ||
336 | .find_device = acpi_pci_find_device, | 342 | .find_device = acpi_pci_find_device, |
337 | .setup = pci_acpi_setup, | 343 | .setup = pci_acpi_setup, |
338 | .cleanup = pci_acpi_cleanup, | 344 | .cleanup = pci_acpi_cleanup, |
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 8813fc03aa09..55cd459a3908 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
@@ -353,8 +353,14 @@ static int __init acpi_pnp_find_device(struct device *dev, acpi_handle * handle) | |||
353 | /* complete initialization of a PNPACPI device includes having | 353 | /* complete initialization of a PNPACPI device includes having |
354 | * pnpdev->dev.archdata.acpi_handle point to its ACPI sibling. | 354 | * pnpdev->dev.archdata.acpi_handle point to its ACPI sibling. |
355 | */ | 355 | */ |
356 | static bool acpi_pnp_bus_match(struct device *dev) | ||
357 | { | ||
358 | return dev->bus == &pnp_bus_type; | ||
359 | } | ||
360 | |||
356 | static struct acpi_bus_type __initdata acpi_pnp_bus = { | 361 | static struct acpi_bus_type __initdata acpi_pnp_bus = { |
357 | .bus = &pnp_bus_type, | 362 | .name = "PNP", |
363 | .match = acpi_pnp_bus_match, | ||
358 | .find_device = acpi_pnp_find_device, | 364 | .find_device = acpi_pnp_find_device, |
359 | }; | 365 | }; |
360 | 366 | ||
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index da9782bd27d0..e3661c20cf38 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -2830,7 +2830,7 @@ EXPORT_SYMBOL_GPL(regulator_get_bypass_regmap); | |||
2830 | * regulator_allow_bypass - allow the regulator to go into bypass mode | 2830 | * regulator_allow_bypass - allow the regulator to go into bypass mode |
2831 | * | 2831 | * |
2832 | * @regulator: Regulator to configure | 2832 | * @regulator: Regulator to configure |
2833 | * @allow: enable or disable bypass mode | 2833 | * @enable: enable or disable bypass mode |
2834 | * | 2834 | * |
2835 | * Allow the regulator to go into bypass mode if all other consumers | 2835 | * Allow the regulator to go into bypass mode if all other consumers |
2836 | * for the regulator also enable bypass mode and the machine | 2836 | * for the regulator also enable bypass mode and the machine |
@@ -3057,9 +3057,13 @@ int regulator_bulk_enable(int num_consumers, | |||
3057 | return 0; | 3057 | return 0; |
3058 | 3058 | ||
3059 | err: | 3059 | err: |
3060 | pr_err("Failed to enable %s: %d\n", consumers[i].supply, ret); | 3060 | for (i = 0; i < num_consumers; i++) { |
3061 | while (--i >= 0) | 3061 | if (consumers[i].ret < 0) |
3062 | regulator_disable(consumers[i].consumer); | 3062 | pr_err("Failed to enable %s: %d\n", consumers[i].supply, |
3063 | consumers[i].ret); | ||
3064 | else | ||
3065 | regulator_disable(consumers[i].consumer); | ||
3066 | } | ||
3063 | 3067 | ||
3064 | return ret; | 3068 | return ret; |
3065 | } | 3069 | } |
diff --git a/drivers/regulator/db8500-prcmu.c b/drivers/regulator/db8500-prcmu.c index 219d162b651e..a53c11a529d5 100644 --- a/drivers/regulator/db8500-prcmu.c +++ b/drivers/regulator/db8500-prcmu.c | |||
@@ -528,7 +528,7 @@ static int db8500_regulator_probe(struct platform_device *pdev) | |||
528 | return 0; | 528 | return 0; |
529 | } | 529 | } |
530 | 530 | ||
531 | static int __exit db8500_regulator_remove(struct platform_device *pdev) | 531 | static int db8500_regulator_remove(struct platform_device *pdev) |
532 | { | 532 | { |
533 | int i; | 533 | int i; |
534 | 534 | ||
@@ -553,7 +553,7 @@ static struct platform_driver db8500_regulator_driver = { | |||
553 | .owner = THIS_MODULE, | 553 | .owner = THIS_MODULE, |
554 | }, | 554 | }, |
555 | .probe = db8500_regulator_probe, | 555 | .probe = db8500_regulator_probe, |
556 | .remove = __exit_p(db8500_regulator_remove), | 556 | .remove = db8500_regulator_remove, |
557 | }; | 557 | }; |
558 | 558 | ||
559 | static int __init db8500_regulator_init(void) | 559 | static int __init db8500_regulator_init(void) |
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index cde13bb5a8fb..39cf14606784 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copyright 2011-2012 Texas Instruments Inc. | 4 | * Copyright 2011-2012 Texas Instruments Inc. |
5 | * | 5 | * |
6 | * Author: Graeme Gregory <gg@slimlogic.co.uk> | 6 | * Author: Graeme Gregory <gg@slimlogic.co.uk> |
7 | * Author: Ian Lartey <ian@slimlogic.co.uk> | ||
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify it | 9 | * This program is free software; you can redistribute it and/or modify it |
9 | * under the terms of the GNU General Public License as published by the | 10 | * under the terms of the GNU General Public License as published by the |
@@ -156,7 +157,7 @@ static const struct regs_info palmas_regs_info[] = { | |||
156 | * | 157 | * |
157 | * So they are basically (maxV-minV)/stepV | 158 | * So they are basically (maxV-minV)/stepV |
158 | */ | 159 | */ |
159 | #define PALMAS_SMPS_NUM_VOLTAGES 116 | 160 | #define PALMAS_SMPS_NUM_VOLTAGES 117 |
160 | #define PALMAS_SMPS10_NUM_VOLTAGES 2 | 161 | #define PALMAS_SMPS10_NUM_VOLTAGES 2 |
161 | #define PALMAS_LDO_NUM_VOLTAGES 50 | 162 | #define PALMAS_LDO_NUM_VOLTAGES 50 |
162 | 163 | ||
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c index 74508cc62d67..f705d25b437c 100644 --- a/drivers/regulator/twl-regulator.c +++ b/drivers/regulator/twl-regulator.c | |||
@@ -471,24 +471,23 @@ twl4030ldo_set_voltage_sel(struct regulator_dev *rdev, unsigned selector) | |||
471 | selector); | 471 | selector); |
472 | } | 472 | } |
473 | 473 | ||
474 | static int twl4030ldo_get_voltage(struct regulator_dev *rdev) | 474 | static int twl4030ldo_get_voltage_sel(struct regulator_dev *rdev) |
475 | { | 475 | { |
476 | struct twlreg_info *info = rdev_get_drvdata(rdev); | 476 | struct twlreg_info *info = rdev_get_drvdata(rdev); |
477 | int vsel = twlreg_read(info, TWL_MODULE_PM_RECEIVER, | 477 | int vsel = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_VOLTAGE); |
478 | VREG_VOLTAGE); | ||
479 | 478 | ||
480 | if (vsel < 0) | 479 | if (vsel < 0) |
481 | return vsel; | 480 | return vsel; |
482 | 481 | ||
483 | vsel &= info->table_len - 1; | 482 | vsel &= info->table_len - 1; |
484 | return LDO_MV(info->table[vsel]) * 1000; | 483 | return vsel; |
485 | } | 484 | } |
486 | 485 | ||
487 | static struct regulator_ops twl4030ldo_ops = { | 486 | static struct regulator_ops twl4030ldo_ops = { |
488 | .list_voltage = twl4030ldo_list_voltage, | 487 | .list_voltage = twl4030ldo_list_voltage, |
489 | 488 | ||
490 | .set_voltage_sel = twl4030ldo_set_voltage_sel, | 489 | .set_voltage_sel = twl4030ldo_set_voltage_sel, |
491 | .get_voltage = twl4030ldo_get_voltage, | 490 | .get_voltage_sel = twl4030ldo_get_voltage_sel, |
492 | 491 | ||
493 | .enable = twl4030reg_enable, | 492 | .enable = twl4030reg_enable, |
494 | .disable = twl4030reg_disable, | 493 | .disable = twl4030reg_disable, |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 765398c063c7..c31187d79343 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -71,9 +71,14 @@ struct kmem_cache *scsi_sdb_cache; | |||
71 | #ifdef CONFIG_ACPI | 71 | #ifdef CONFIG_ACPI |
72 | #include <acpi/acpi_bus.h> | 72 | #include <acpi/acpi_bus.h> |
73 | 73 | ||
74 | static bool acpi_scsi_bus_match(struct device *dev) | ||
75 | { | ||
76 | return dev->bus == &scsi_bus_type; | ||
77 | } | ||
78 | |||
74 | int scsi_register_acpi_bus_type(struct acpi_bus_type *bus) | 79 | int scsi_register_acpi_bus_type(struct acpi_bus_type *bus) |
75 | { | 80 | { |
76 | bus->bus = &scsi_bus_type; | 81 | bus->match = acpi_scsi_bus_match; |
77 | return register_acpi_bus_type(bus); | 82 | return register_acpi_bus_type(bus); |
78 | } | 83 | } |
79 | EXPORT_SYMBOL_GPL(scsi_register_acpi_bus_type); | 84 | EXPORT_SYMBOL_GPL(scsi_register_acpi_bus_type); |
diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c index cef4252bb31a..b6f4bad3f756 100644 --- a/drivers/usb/core/usb-acpi.c +++ b/drivers/usb/core/usb-acpi.c | |||
@@ -210,9 +210,14 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) | |||
210 | return 0; | 210 | return 0; |
211 | } | 211 | } |
212 | 212 | ||
213 | static bool usb_acpi_bus_match(struct device *dev) | ||
214 | { | ||
215 | return is_usb_device(dev) || is_usb_port(dev); | ||
216 | } | ||
217 | |||
213 | static struct acpi_bus_type usb_acpi_bus = { | 218 | static struct acpi_bus_type usb_acpi_bus = { |
214 | .bus = &usb_bus_type, | 219 | .name = "USB", |
215 | .find_bridge = usb_acpi_find_device, | 220 | .match = usb_acpi_bus_match, |
216 | .find_device = usb_acpi_find_device, | 221 | .find_device = usb_acpi_find_device, |
217 | }; | 222 | }; |
218 | 223 | ||
diff --git a/fs/ecryptfs/Kconfig b/fs/ecryptfs/Kconfig index e15ef38c24fa..434aa313f077 100644 --- a/fs/ecryptfs/Kconfig +++ b/fs/ecryptfs/Kconfig | |||
@@ -12,3 +12,11 @@ config ECRYPT_FS | |||
12 | 12 | ||
13 | To compile this file system support as a module, choose M here: the | 13 | To compile this file system support as a module, choose M here: the |
14 | module will be called ecryptfs. | 14 | module will be called ecryptfs. |
15 | |||
16 | config ECRYPT_FS_MESSAGING | ||
17 | bool "Enable notifications for userspace key wrap/unwrap" | ||
18 | depends on ECRYPT_FS | ||
19 | help | ||
20 | Enables the /dev/ecryptfs entry for use by ecryptfsd. This allows | ||
21 | for userspace to wrap/unwrap file encryption keys by other | ||
22 | backends, like OpenSSL. | ||
diff --git a/fs/ecryptfs/Makefile b/fs/ecryptfs/Makefile index 2cc9ee4ad2eb..49678a69947d 100644 --- a/fs/ecryptfs/Makefile +++ b/fs/ecryptfs/Makefile | |||
@@ -1,7 +1,10 @@ | |||
1 | # | 1 | # |
2 | # Makefile for the Linux 2.6 eCryptfs | 2 | # Makefile for the Linux eCryptfs |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_ECRYPT_FS) += ecryptfs.o | 5 | obj-$(CONFIG_ECRYPT_FS) += ecryptfs.o |
6 | 6 | ||
7 | ecryptfs-objs := dentry.o file.o inode.o main.o super.o mmap.o read_write.o crypto.o keystore.o messaging.o miscdev.o kthread.o debug.o | 7 | ecryptfs-y := dentry.o file.o inode.o main.o super.o mmap.o read_write.o \ |
8 | crypto.o keystore.o kthread.o debug.o | ||
9 | |||
10 | ecryptfs-$(CONFIG_ECRYPT_FS_MESSAGING) += messaging.o miscdev.o | ||
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index a7b0c2dfb3db..d5c25db4398f 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -301,17 +301,14 @@ int virt_to_scatterlist(const void *addr, int size, struct scatterlist *sg, | |||
301 | while (size > 0 && i < sg_size) { | 301 | while (size > 0 && i < sg_size) { |
302 | pg = virt_to_page(addr); | 302 | pg = virt_to_page(addr); |
303 | offset = offset_in_page(addr); | 303 | offset = offset_in_page(addr); |
304 | if (sg) | 304 | sg_set_page(&sg[i], pg, 0, offset); |
305 | sg_set_page(&sg[i], pg, 0, offset); | ||
306 | remainder_of_page = PAGE_CACHE_SIZE - offset; | 305 | remainder_of_page = PAGE_CACHE_SIZE - offset; |
307 | if (size >= remainder_of_page) { | 306 | if (size >= remainder_of_page) { |
308 | if (sg) | 307 | sg[i].length = remainder_of_page; |
309 | sg[i].length = remainder_of_page; | ||
310 | addr += remainder_of_page; | 308 | addr += remainder_of_page; |
311 | size -= remainder_of_page; | 309 | size -= remainder_of_page; |
312 | } else { | 310 | } else { |
313 | if (sg) | 311 | sg[i].length = size; |
314 | sg[i].length = size; | ||
315 | addr += size; | 312 | addr += size; |
316 | size = 0; | 313 | size = 0; |
317 | } | 314 | } |
diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c index 1b5d9af937df..bf12ba5dd223 100644 --- a/fs/ecryptfs/dentry.c +++ b/fs/ecryptfs/dentry.c | |||
@@ -45,14 +45,12 @@ | |||
45 | static int ecryptfs_d_revalidate(struct dentry *dentry, unsigned int flags) | 45 | static int ecryptfs_d_revalidate(struct dentry *dentry, unsigned int flags) |
46 | { | 46 | { |
47 | struct dentry *lower_dentry; | 47 | struct dentry *lower_dentry; |
48 | struct vfsmount *lower_mnt; | ||
49 | int rc = 1; | 48 | int rc = 1; |
50 | 49 | ||
51 | if (flags & LOOKUP_RCU) | 50 | if (flags & LOOKUP_RCU) |
52 | return -ECHILD; | 51 | return -ECHILD; |
53 | 52 | ||
54 | lower_dentry = ecryptfs_dentry_to_lower(dentry); | 53 | lower_dentry = ecryptfs_dentry_to_lower(dentry); |
55 | lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry); | ||
56 | if (!lower_dentry->d_op || !lower_dentry->d_op->d_revalidate) | 54 | if (!lower_dentry->d_op || !lower_dentry->d_op->d_revalidate) |
57 | goto out; | 55 | goto out; |
58 | rc = lower_dentry->d_op->d_revalidate(lower_dentry, flags); | 56 | rc = lower_dentry->d_op->d_revalidate(lower_dentry, flags); |
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h index 7e2c6f5d7985..dd299b389d4e 100644 --- a/fs/ecryptfs/ecryptfs_kernel.h +++ b/fs/ecryptfs/ecryptfs_kernel.h | |||
@@ -172,6 +172,19 @@ ecryptfs_get_key_payload_data(struct key *key) | |||
172 | #define ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE 24 | 172 | #define ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE 24 |
173 | #define ECRYPTFS_ENCRYPTED_DENTRY_NAME_LEN (18 + 1 + 4 + 1 + 32) | 173 | #define ECRYPTFS_ENCRYPTED_DENTRY_NAME_LEN (18 + 1 + 4 + 1 + 32) |
174 | 174 | ||
175 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
176 | # define ECRYPTFS_VERSIONING_MASK_MESSAGING (ECRYPTFS_VERSIONING_DEVMISC \ | ||
177 | | ECRYPTFS_VERSIONING_PUBKEY) | ||
178 | #else | ||
179 | # define ECRYPTFS_VERSIONING_MASK_MESSAGING 0 | ||
180 | #endif | ||
181 | |||
182 | #define ECRYPTFS_VERSIONING_MASK (ECRYPTFS_VERSIONING_PASSPHRASE \ | ||
183 | | ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH \ | ||
184 | | ECRYPTFS_VERSIONING_XATTR \ | ||
185 | | ECRYPTFS_VERSIONING_MULTKEY \ | ||
186 | | ECRYPTFS_VERSIONING_MASK_MESSAGING \ | ||
187 | | ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION) | ||
175 | struct ecryptfs_key_sig { | 188 | struct ecryptfs_key_sig { |
176 | struct list_head crypt_stat_list; | 189 | struct list_head crypt_stat_list; |
177 | char keysig[ECRYPTFS_SIG_SIZE_HEX + 1]; | 190 | char keysig[ECRYPTFS_SIG_SIZE_HEX + 1]; |
@@ -399,7 +412,9 @@ struct ecryptfs_daemon { | |||
399 | struct hlist_node euid_chain; | 412 | struct hlist_node euid_chain; |
400 | }; | 413 | }; |
401 | 414 | ||
415 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
402 | extern struct mutex ecryptfs_daemon_hash_mux; | 416 | extern struct mutex ecryptfs_daemon_hash_mux; |
417 | #endif | ||
403 | 418 | ||
404 | static inline size_t | 419 | static inline size_t |
405 | ecryptfs_lower_header_size(struct ecryptfs_crypt_stat *crypt_stat) | 420 | ecryptfs_lower_header_size(struct ecryptfs_crypt_stat *crypt_stat) |
@@ -610,6 +625,7 @@ int | |||
610 | ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value, | 625 | ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value, |
611 | size_t size, int flags); | 626 | size_t size, int flags); |
612 | int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode); | 627 | int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode); |
628 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
613 | int ecryptfs_process_response(struct ecryptfs_daemon *daemon, | 629 | int ecryptfs_process_response(struct ecryptfs_daemon *daemon, |
614 | struct ecryptfs_message *msg, u32 seq); | 630 | struct ecryptfs_message *msg, u32 seq); |
615 | int ecryptfs_send_message(char *data, int data_len, | 631 | int ecryptfs_send_message(char *data, int data_len, |
@@ -618,6 +634,24 @@ int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx, | |||
618 | struct ecryptfs_message **emsg); | 634 | struct ecryptfs_message **emsg); |
619 | int ecryptfs_init_messaging(void); | 635 | int ecryptfs_init_messaging(void); |
620 | void ecryptfs_release_messaging(void); | 636 | void ecryptfs_release_messaging(void); |
637 | #else | ||
638 | static inline int ecryptfs_init_messaging(void) | ||
639 | { | ||
640 | return 0; | ||
641 | } | ||
642 | static inline void ecryptfs_release_messaging(void) | ||
643 | { } | ||
644 | static inline int ecryptfs_send_message(char *data, int data_len, | ||
645 | struct ecryptfs_msg_ctx **msg_ctx) | ||
646 | { | ||
647 | return -ENOTCONN; | ||
648 | } | ||
649 | static inline int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx, | ||
650 | struct ecryptfs_message **emsg) | ||
651 | { | ||
652 | return -ENOMSG; | ||
653 | } | ||
654 | #endif | ||
621 | 655 | ||
622 | void | 656 | void |
623 | ecryptfs_write_header_metadata(char *virt, | 657 | ecryptfs_write_header_metadata(char *virt, |
@@ -655,12 +689,11 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs, | |||
655 | size_t offset_in_page, size_t size, | 689 | size_t offset_in_page, size_t size, |
656 | struct inode *ecryptfs_inode); | 690 | struct inode *ecryptfs_inode); |
657 | struct page *ecryptfs_get_locked_page(struct inode *inode, loff_t index); | 691 | struct page *ecryptfs_get_locked_page(struct inode *inode, loff_t index); |
658 | int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon); | ||
659 | int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon); | ||
660 | int ecryptfs_parse_packet_length(unsigned char *data, size_t *size, | 692 | int ecryptfs_parse_packet_length(unsigned char *data, size_t *size, |
661 | size_t *length_size); | 693 | size_t *length_size); |
662 | int ecryptfs_write_packet_length(char *dest, size_t size, | 694 | int ecryptfs_write_packet_length(char *dest, size_t size, |
663 | size_t *packet_size_length); | 695 | size_t *packet_size_length); |
696 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
664 | int ecryptfs_init_ecryptfs_miscdev(void); | 697 | int ecryptfs_init_ecryptfs_miscdev(void); |
665 | void ecryptfs_destroy_ecryptfs_miscdev(void); | 698 | void ecryptfs_destroy_ecryptfs_miscdev(void); |
666 | int ecryptfs_send_miscdev(char *data, size_t data_size, | 699 | int ecryptfs_send_miscdev(char *data, size_t data_size, |
@@ -669,6 +702,9 @@ int ecryptfs_send_miscdev(char *data, size_t data_size, | |||
669 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx); | 702 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx); |
670 | int | 703 | int |
671 | ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, struct file *file); | 704 | ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, struct file *file); |
705 | int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon); | ||
706 | int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon); | ||
707 | #endif | ||
672 | int ecryptfs_init_kthread(void); | 708 | int ecryptfs_init_kthread(void); |
673 | void ecryptfs_destroy_kthread(void); | 709 | void ecryptfs_destroy_kthread(void); |
674 | int ecryptfs_privileged_open(struct file **lower_file, | 710 | int ecryptfs_privileged_open(struct file **lower_file, |
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index 53acc9d0c138..63b1f54b6a1f 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
@@ -199,7 +199,6 @@ static int ecryptfs_open(struct inode *inode, struct file *file) | |||
199 | struct dentry *ecryptfs_dentry = file->f_path.dentry; | 199 | struct dentry *ecryptfs_dentry = file->f_path.dentry; |
200 | /* Private value of ecryptfs_dentry allocated in | 200 | /* Private value of ecryptfs_dentry allocated in |
201 | * ecryptfs_lookup() */ | 201 | * ecryptfs_lookup() */ |
202 | struct dentry *lower_dentry; | ||
203 | struct ecryptfs_file_info *file_info; | 202 | struct ecryptfs_file_info *file_info; |
204 | 203 | ||
205 | mount_crypt_stat = &ecryptfs_superblock_to_private( | 204 | mount_crypt_stat = &ecryptfs_superblock_to_private( |
@@ -222,7 +221,6 @@ static int ecryptfs_open(struct inode *inode, struct file *file) | |||
222 | rc = -ENOMEM; | 221 | rc = -ENOMEM; |
223 | goto out; | 222 | goto out; |
224 | } | 223 | } |
225 | lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry); | ||
226 | crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat; | 224 | crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat; |
227 | mutex_lock(&crypt_stat->cs_mutex); | 225 | mutex_lock(&crypt_stat->cs_mutex); |
228 | if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED)) { | 226 | if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED)) { |
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index e0f07fb6d56b..5eab400e2590 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -999,8 +999,8 @@ out: | |||
999 | return rc; | 999 | return rc; |
1000 | } | 1000 | } |
1001 | 1001 | ||
1002 | int ecryptfs_getattr_link(struct vfsmount *mnt, struct dentry *dentry, | 1002 | static int ecryptfs_getattr_link(struct vfsmount *mnt, struct dentry *dentry, |
1003 | struct kstat *stat) | 1003 | struct kstat *stat) |
1004 | { | 1004 | { |
1005 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; | 1005 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; |
1006 | int rc = 0; | 1006 | int rc = 0; |
@@ -1021,8 +1021,8 @@ int ecryptfs_getattr_link(struct vfsmount *mnt, struct dentry *dentry, | |||
1021 | return rc; | 1021 | return rc; |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry, | 1024 | static int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry, |
1025 | struct kstat *stat) | 1025 | struct kstat *stat) |
1026 | { | 1026 | { |
1027 | struct kstat lower_stat; | 1027 | struct kstat lower_stat; |
1028 | int rc; | 1028 | int rc; |
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index 2333203a120b..7d52806c2119 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c | |||
@@ -1150,7 +1150,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | |||
1150 | struct ecryptfs_message *msg = NULL; | 1150 | struct ecryptfs_message *msg = NULL; |
1151 | char *auth_tok_sig; | 1151 | char *auth_tok_sig; |
1152 | char *payload; | 1152 | char *payload; |
1153 | size_t payload_len; | 1153 | size_t payload_len = 0; |
1154 | int rc; | 1154 | int rc; |
1155 | 1155 | ||
1156 | rc = ecryptfs_get_auth_tok_sig(&auth_tok_sig, auth_tok); | 1156 | rc = ecryptfs_get_auth_tok_sig(&auth_tok_sig, auth_tok); |
@@ -1168,7 +1168,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | |||
1168 | rc = ecryptfs_send_message(payload, payload_len, &msg_ctx); | 1168 | rc = ecryptfs_send_message(payload, payload_len, &msg_ctx); |
1169 | if (rc) { | 1169 | if (rc) { |
1170 | ecryptfs_printk(KERN_ERR, "Error sending message to " | 1170 | ecryptfs_printk(KERN_ERR, "Error sending message to " |
1171 | "ecryptfsd\n"); | 1171 | "ecryptfsd: %d\n", rc); |
1172 | goto out; | 1172 | goto out; |
1173 | } | 1173 | } |
1174 | rc = ecryptfs_wait_for_response(msg_ctx, &msg); | 1174 | rc = ecryptfs_wait_for_response(msg_ctx, &msg); |
@@ -1202,8 +1202,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | |||
1202 | crypt_stat->key_size); | 1202 | crypt_stat->key_size); |
1203 | } | 1203 | } |
1204 | out: | 1204 | out: |
1205 | if (msg) | 1205 | kfree(msg); |
1206 | kfree(msg); | ||
1207 | return rc; | 1206 | return rc; |
1208 | } | 1207 | } |
1209 | 1208 | ||
@@ -1989,7 +1988,7 @@ pki_encrypt_session_key(struct key *auth_tok_key, | |||
1989 | rc = ecryptfs_send_message(payload, payload_len, &msg_ctx); | 1988 | rc = ecryptfs_send_message(payload, payload_len, &msg_ctx); |
1990 | if (rc) { | 1989 | if (rc) { |
1991 | ecryptfs_printk(KERN_ERR, "Error sending message to " | 1990 | ecryptfs_printk(KERN_ERR, "Error sending message to " |
1992 | "ecryptfsd\n"); | 1991 | "ecryptfsd: %d\n", rc); |
1993 | goto out; | 1992 | goto out; |
1994 | } | 1993 | } |
1995 | rc = ecryptfs_wait_for_response(msg_ctx, &msg); | 1994 | rc = ecryptfs_wait_for_response(msg_ctx, &msg); |
diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c index 8d7a577ae497..49ff8ea08f1c 100644 --- a/fs/ecryptfs/messaging.c +++ b/fs/ecryptfs/messaging.c | |||
@@ -97,8 +97,7 @@ static void ecryptfs_msg_ctx_free_to_alloc(struct ecryptfs_msg_ctx *msg_ctx) | |||
97 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx) | 97 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx) |
98 | { | 98 | { |
99 | list_move(&(msg_ctx->node), &ecryptfs_msg_ctx_free_list); | 99 | list_move(&(msg_ctx->node), &ecryptfs_msg_ctx_free_list); |
100 | if (msg_ctx->msg) | 100 | kfree(msg_ctx->msg); |
101 | kfree(msg_ctx->msg); | ||
102 | msg_ctx->msg = NULL; | 101 | msg_ctx->msg = NULL; |
103 | msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_FREE; | 102 | msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_FREE; |
104 | } | 103 | } |
@@ -283,7 +282,7 @@ ecryptfs_send_message_locked(char *data, int data_len, u8 msg_type, | |||
283 | int rc; | 282 | int rc; |
284 | 283 | ||
285 | rc = ecryptfs_find_daemon_by_euid(&daemon); | 284 | rc = ecryptfs_find_daemon_by_euid(&daemon); |
286 | if (rc || !daemon) { | 285 | if (rc) { |
287 | rc = -ENOTCONN; | 286 | rc = -ENOTCONN; |
288 | goto out; | 287 | goto out; |
289 | } | 288 | } |
diff --git a/fs/namei.c b/fs/namei.c index 961bc1268366..57ae9c8c66bf 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -689,8 +689,6 @@ void nd_jump_link(struct nameidata *nd, struct path *path) | |||
689 | nd->path = *path; | 689 | nd->path = *path; |
690 | nd->inode = nd->path.dentry->d_inode; | 690 | nd->inode = nd->path.dentry->d_inode; |
691 | nd->flags |= LOOKUP_JUMPED; | 691 | nd->flags |= LOOKUP_JUMPED; |
692 | |||
693 | BUG_ON(nd->inode->i_op->follow_link); | ||
694 | } | 692 | } |
695 | 693 | ||
696 | static inline void put_link(struct nameidata *nd, struct path *link, void *cookie) | 694 | static inline void put_link(struct nameidata *nd, struct path *link, void *cookie) |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index e65278f560c4..22ba56e834e2 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -437,11 +437,9 @@ void acpi_remove_dir(struct acpi_device *); | |||
437 | */ | 437 | */ |
438 | struct acpi_bus_type { | 438 | struct acpi_bus_type { |
439 | struct list_head list; | 439 | struct list_head list; |
440 | struct bus_type *bus; | 440 | const char *name; |
441 | /* For general devices under the bus */ | 441 | bool (*match)(struct device *dev); |
442 | int (*find_device) (struct device *, acpi_handle *); | 442 | int (*find_device) (struct device *, acpi_handle *); |
443 | /* For bridges, such as PCI root bridge, IDE controller */ | ||
444 | int (*find_bridge) (struct device *, acpi_handle *); | ||
445 | void (*setup)(struct device *); | 443 | void (*setup)(struct device *); |
446 | void (*cleanup)(struct device *); | 444 | void (*cleanup)(struct device *); |
447 | }; | 445 | }; |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 8839b3a24660..e3e0d651c6ca 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -443,12 +443,12 @@ struct drm_crtc { | |||
443 | * @dpms: set power state (see drm_crtc_funcs above) | 443 | * @dpms: set power state (see drm_crtc_funcs above) |
444 | * @save: save connector state | 444 | * @save: save connector state |
445 | * @restore: restore connector state | 445 | * @restore: restore connector state |
446 | * @reset: reset connector after state has been invalidate (e.g. resume) | 446 | * @reset: reset connector after state has been invalidated (e.g. resume) |
447 | * @detect: is this connector active? | 447 | * @detect: is this connector active? |
448 | * @fill_modes: fill mode list for this connector | 448 | * @fill_modes: fill mode list for this connector |
449 | * @set_property: property for this connector may need update | 449 | * @set_property: property for this connector may need an update |
450 | * @destroy: make object go away | 450 | * @destroy: make object go away |
451 | * @force: notify the driver the connector is forced on | 451 | * @force: notify the driver that the connector is forced on |
452 | * | 452 | * |
453 | * Each CRTC may have one or more connectors attached to it. The functions | 453 | * Each CRTC may have one or more connectors attached to it. The functions |
454 | * below allow the core DRM code to control connectors, enumerate available modes, | 454 | * below allow the core DRM code to control connectors, enumerate available modes, |
diff --git a/include/linux/ecryptfs.h b/include/linux/ecryptfs.h index 2224a8c0cb64..8d5ab998a222 100644 --- a/include/linux/ecryptfs.h +++ b/include/linux/ecryptfs.h | |||
@@ -6,9 +6,8 @@ | |||
6 | #define ECRYPTFS_VERSION_MINOR 0x04 | 6 | #define ECRYPTFS_VERSION_MINOR 0x04 |
7 | #define ECRYPTFS_SUPPORTED_FILE_VERSION 0x03 | 7 | #define ECRYPTFS_SUPPORTED_FILE_VERSION 0x03 |
8 | /* These flags indicate which features are supported by the kernel | 8 | /* These flags indicate which features are supported by the kernel |
9 | * module; userspace tools such as the mount helper read | 9 | * module; userspace tools such as the mount helper read the feature |
10 | * ECRYPTFS_VERSIONING_MASK from a sysfs handle in order to determine | 10 | * bits from a sysfs handle in order to determine how to behave. */ |
11 | * how to behave. */ | ||
12 | #define ECRYPTFS_VERSIONING_PASSPHRASE 0x00000001 | 11 | #define ECRYPTFS_VERSIONING_PASSPHRASE 0x00000001 |
13 | #define ECRYPTFS_VERSIONING_PUBKEY 0x00000002 | 12 | #define ECRYPTFS_VERSIONING_PUBKEY 0x00000002 |
14 | #define ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH 0x00000004 | 13 | #define ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH 0x00000004 |
@@ -19,13 +18,6 @@ | |||
19 | #define ECRYPTFS_VERSIONING_HMAC 0x00000080 | 18 | #define ECRYPTFS_VERSIONING_HMAC 0x00000080 |
20 | #define ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION 0x00000100 | 19 | #define ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION 0x00000100 |
21 | #define ECRYPTFS_VERSIONING_GCM 0x00000200 | 20 | #define ECRYPTFS_VERSIONING_GCM 0x00000200 |
22 | #define ECRYPTFS_VERSIONING_MASK (ECRYPTFS_VERSIONING_PASSPHRASE \ | ||
23 | | ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH \ | ||
24 | | ECRYPTFS_VERSIONING_PUBKEY \ | ||
25 | | ECRYPTFS_VERSIONING_XATTR \ | ||
26 | | ECRYPTFS_VERSIONING_MULTKEY \ | ||
27 | | ECRYPTFS_VERSIONING_DEVMISC \ | ||
28 | | ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION) | ||
29 | #define ECRYPTFS_MAX_PASSWORD_LENGTH 64 | 21 | #define ECRYPTFS_MAX_PASSWORD_LENGTH 64 |
30 | #define ECRYPTFS_MAX_PASSPHRASE_BYTES ECRYPTFS_MAX_PASSWORD_LENGTH | 22 | #define ECRYPTFS_MAX_PASSPHRASE_BYTES ECRYPTFS_MAX_PASSWORD_LENGTH |
31 | #define ECRYPTFS_SALT_SIZE 8 | 23 | #define ECRYPTFS_SALT_SIZE 8 |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 23070fd83872..7df93f52db08 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -199,6 +199,8 @@ enum regulator_type { | |||
199 | * output when using regulator_set_voltage_sel_regmap | 199 | * output when using regulator_set_voltage_sel_regmap |
200 | * @enable_reg: Register for control when using regmap enable/disable ops | 200 | * @enable_reg: Register for control when using regmap enable/disable ops |
201 | * @enable_mask: Mask for control when using regmap enable/disable ops | 201 | * @enable_mask: Mask for control when using regmap enable/disable ops |
202 | * @bypass_reg: Register for control when using regmap set_bypass | ||
203 | * @bypass_mask: Mask for control when using regmap set_bypass | ||
202 | * | 204 | * |
203 | * @enable_time: Time taken for initial enable of regulator (in uS). | 205 | * @enable_time: Time taken for initial enable of regulator (in uS). |
204 | */ | 206 | */ |
@@ -820,15 +820,17 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, | |||
820 | struct msg_msg *copy = NULL; | 820 | struct msg_msg *copy = NULL; |
821 | unsigned long copy_number = 0; | 821 | unsigned long copy_number = 0; |
822 | 822 | ||
823 | ns = current->nsproxy->ipc_ns; | ||
824 | |||
823 | if (msqid < 0 || (long) bufsz < 0) | 825 | if (msqid < 0 || (long) bufsz < 0) |
824 | return -EINVAL; | 826 | return -EINVAL; |
825 | if (msgflg & MSG_COPY) { | 827 | if (msgflg & MSG_COPY) { |
826 | copy = prepare_copy(buf, bufsz, msgflg, &msgtyp, ©_number); | 828 | copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax), |
829 | msgflg, &msgtyp, ©_number); | ||
827 | if (IS_ERR(copy)) | 830 | if (IS_ERR(copy)) |
828 | return PTR_ERR(copy); | 831 | return PTR_ERR(copy); |
829 | } | 832 | } |
830 | mode = convert_mode(&msgtyp, msgflg); | 833 | mode = convert_mode(&msgtyp, msgflg); |
831 | ns = current->nsproxy->ipc_ns; | ||
832 | 834 | ||
833 | msq = msg_lock_check(ns, msqid); | 835 | msq = msg_lock_check(ns, msqid); |
834 | if (IS_ERR(msq)) { | 836 | if (IS_ERR(msq)) { |
diff --git a/ipc/msgutil.c b/ipc/msgutil.c index ebfcbfa8b7f2..5df8e4bf1db0 100644 --- a/ipc/msgutil.c +++ b/ipc/msgutil.c | |||
@@ -117,9 +117,6 @@ struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst) | |||
117 | if (alen > DATALEN_MSG) | 117 | if (alen > DATALEN_MSG) |
118 | alen = DATALEN_MSG; | 118 | alen = DATALEN_MSG; |
119 | 119 | ||
120 | dst->next = NULL; | ||
121 | dst->security = NULL; | ||
122 | |||
123 | memcpy(dst + 1, src + 1, alen); | 120 | memcpy(dst + 1, src + 1, alen); |
124 | 121 | ||
125 | len -= alen; | 122 | len -= alen; |
diff --git a/kernel/smpboot.c b/kernel/smpboot.c index 25d3d8b6e4e1..8eaed9aa9cf0 100644 --- a/kernel/smpboot.c +++ b/kernel/smpboot.c | |||
@@ -131,7 +131,7 @@ static int smpboot_thread_fn(void *data) | |||
131 | continue; | 131 | continue; |
132 | } | 132 | } |
133 | 133 | ||
134 | //BUG_ON(td->cpu != smp_processor_id()); | 134 | BUG_ON(td->cpu != smp_processor_id()); |
135 | 135 | ||
136 | /* Check for state change setup */ | 136 | /* Check for state change setup */ |
137 | switch (td->status) { | 137 | switch (td->status) { |
@@ -569,8 +569,7 @@ void idr_remove(struct idr *idp, int id) | |||
569 | struct idr_layer *p; | 569 | struct idr_layer *p; |
570 | struct idr_layer *to_free; | 570 | struct idr_layer *to_free; |
571 | 571 | ||
572 | /* see comment in idr_find_slowpath() */ | 572 | if (id < 0) |
573 | if (WARN_ON_ONCE(id < 0)) | ||
574 | return; | 573 | return; |
575 | 574 | ||
576 | sub_remove(idp, (idp->layers - 1) * IDR_BITS, id); | 575 | sub_remove(idp, (idp->layers - 1) * IDR_BITS, id); |
@@ -667,15 +666,7 @@ void *idr_find_slowpath(struct idr *idp, int id) | |||
667 | int n; | 666 | int n; |
668 | struct idr_layer *p; | 667 | struct idr_layer *p; |
669 | 668 | ||
670 | /* | 669 | if (id < 0) |
671 | * If @id is negative, idr_find() used to ignore the sign bit and | ||
672 | * performed lookup with the rest of bits, which is weird and can | ||
673 | * lead to very obscure bugs. We're now returning NULL for all | ||
674 | * negative IDs but just in case somebody was depending on the sign | ||
675 | * bit being ignored, let's trigger WARN_ON_ONCE() so that they can | ||
676 | * be detected and fixed. WARN_ON_ONCE() can later be removed. | ||
677 | */ | ||
678 | if (WARN_ON_ONCE(id < 0)) | ||
679 | return NULL; | 670 | return NULL; |
680 | 671 | ||
681 | p = rcu_dereference_raw(idp->top); | 672 | p = rcu_dereference_raw(idp->top); |
@@ -824,8 +815,7 @@ void *idr_replace(struct idr *idp, void *ptr, int id) | |||
824 | int n; | 815 | int n; |
825 | struct idr_layer *p, *old_p; | 816 | struct idr_layer *p, *old_p; |
826 | 817 | ||
827 | /* see comment in idr_find_slowpath() */ | 818 | if (id < 0) |
828 | if (WARN_ON_ONCE(id < 0)) | ||
829 | return ERR_PTR(-EINVAL); | 819 | return ERR_PTR(-EINVAL); |
830 | 820 | ||
831 | p = idp->top; | 821 | p = idp->top; |
@@ -489,7 +489,7 @@ out: page = NULL; | |||
489 | */ | 489 | */ |
490 | static inline int get_kpfn_nid(unsigned long kpfn) | 490 | static inline int get_kpfn_nid(unsigned long kpfn) |
491 | { | 491 | { |
492 | return ksm_merge_across_nodes ? 0 : pfn_to_nid(kpfn); | 492 | return ksm_merge_across_nodes ? 0 : NUMA(pfn_to_nid(kpfn)); |
493 | } | 493 | } |
494 | 494 | ||
495 | static void remove_node_from_stable_tree(struct stable_node *stable_node) | 495 | static void remove_node_from_stable_tree(struct stable_node *stable_node) |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 53b8201b31eb..2b552224f5cf 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -3012,6 +3012,8 @@ void memcg_update_array_size(int num) | |||
3012 | memcg_limited_groups_array_size = memcg_caches_array_size(num); | 3012 | memcg_limited_groups_array_size = memcg_caches_array_size(num); |
3013 | } | 3013 | } |
3014 | 3014 | ||
3015 | static void kmem_cache_destroy_work_func(struct work_struct *w); | ||
3016 | |||
3015 | int memcg_update_cache_size(struct kmem_cache *s, int num_groups) | 3017 | int memcg_update_cache_size(struct kmem_cache *s, int num_groups) |
3016 | { | 3018 | { |
3017 | struct memcg_cache_params *cur_params = s->memcg_params; | 3019 | struct memcg_cache_params *cur_params = s->memcg_params; |
@@ -3031,6 +3033,8 @@ int memcg_update_cache_size(struct kmem_cache *s, int num_groups) | |||
3031 | return -ENOMEM; | 3033 | return -ENOMEM; |
3032 | } | 3034 | } |
3033 | 3035 | ||
3036 | INIT_WORK(&s->memcg_params->destroy, | ||
3037 | kmem_cache_destroy_work_func); | ||
3034 | s->memcg_params->is_root_cache = true; | 3038 | s->memcg_params->is_root_cache = true; |
3035 | 3039 | ||
3036 | /* | 3040 | /* |
@@ -3078,6 +3082,8 @@ int memcg_register_cache(struct mem_cgroup *memcg, struct kmem_cache *s, | |||
3078 | if (!s->memcg_params) | 3082 | if (!s->memcg_params) |
3079 | return -ENOMEM; | 3083 | return -ENOMEM; |
3080 | 3084 | ||
3085 | INIT_WORK(&s->memcg_params->destroy, | ||
3086 | kmem_cache_destroy_work_func); | ||
3081 | if (memcg) { | 3087 | if (memcg) { |
3082 | s->memcg_params->memcg = memcg; | 3088 | s->memcg_params->memcg = memcg; |
3083 | s->memcg_params->root_cache = root_cache; | 3089 | s->memcg_params->root_cache = root_cache; |
@@ -3358,8 +3364,6 @@ static void mem_cgroup_destroy_all_caches(struct mem_cgroup *memcg) | |||
3358 | list_for_each_entry(params, &memcg->memcg_slab_caches, list) { | 3364 | list_for_each_entry(params, &memcg->memcg_slab_caches, list) { |
3359 | cachep = memcg_params_to_cache(params); | 3365 | cachep = memcg_params_to_cache(params); |
3360 | cachep->memcg_params->dead = true; | 3366 | cachep->memcg_params->dead = true; |
3361 | INIT_WORK(&cachep->memcg_params->destroy, | ||
3362 | kmem_cache_destroy_work_func); | ||
3363 | schedule_work(&cachep->memcg_params->destroy); | 3367 | schedule_work(&cachep->memcg_params->destroy); |
3364 | } | 3368 | } |
3365 | mutex_unlock(&memcg->slab_caches_mutex); | 3369 | mutex_unlock(&memcg->slab_caches_mutex); |
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 31d26637b658..74310017296e 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -2390,9 +2390,9 @@ restart: | |||
2390 | 2390 | ||
2391 | *mpol_new = *n->policy; | 2391 | *mpol_new = *n->policy; |
2392 | atomic_set(&mpol_new->refcnt, 1); | 2392 | atomic_set(&mpol_new->refcnt, 1); |
2393 | sp_node_init(n_new, n->end, end, mpol_new); | 2393 | sp_node_init(n_new, end, n->end, mpol_new); |
2394 | sp_insert(sp, n_new); | ||
2395 | n->end = start; | 2394 | n->end = start; |
2395 | sp_insert(sp, n_new); | ||
2396 | n_new = NULL; | 2396 | n_new = NULL; |
2397 | mpol_new = NULL; | 2397 | mpol_new = NULL; |
2398 | break; | 2398 | break; |
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 74dea377fe5b..de2e950a0a7a 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c | |||
@@ -655,7 +655,7 @@ static struct p9_trans_module p9_virtio_trans = { | |||
655 | .create = p9_virtio_create, | 655 | .create = p9_virtio_create, |
656 | .close = p9_virtio_close, | 656 | .close = p9_virtio_close, |
657 | .request = p9_virtio_request, | 657 | .request = p9_virtio_request, |
658 | //.zc_request = p9_virtio_zc_request, | 658 | .zc_request = p9_virtio_zc_request, |
659 | .cancel = p9_virtio_cancel, | 659 | .cancel = p9_virtio_cancel, |
660 | /* | 660 | /* |
661 | * We leave one entry for input and one entry for response | 661 | * We leave one entry for input and one entry for response |
diff --git a/sound/core/seq/oss/seq_oss_event.c b/sound/core/seq/oss/seq_oss_event.c index 066f5f3e3f4c..c3908862bc8b 100644 --- a/sound/core/seq/oss/seq_oss_event.c +++ b/sound/core/seq/oss/seq_oss_event.c | |||
@@ -285,7 +285,12 @@ local_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev | |||
285 | static int | 285 | static int |
286 | note_on_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev) | 286 | note_on_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev) |
287 | { | 287 | { |
288 | struct seq_oss_synthinfo *info = &dp->synths[dev]; | 288 | struct seq_oss_synthinfo *info; |
289 | |||
290 | if (!snd_seq_oss_synth_is_valid(dp, dev)) | ||
291 | return -ENXIO; | ||
292 | |||
293 | info = &dp->synths[dev]; | ||
289 | switch (info->arg.event_passing) { | 294 | switch (info->arg.event_passing) { |
290 | case SNDRV_SEQ_OSS_PROCESS_EVENTS: | 295 | case SNDRV_SEQ_OSS_PROCESS_EVENTS: |
291 | if (! info->ch || ch < 0 || ch >= info->nr_voices) { | 296 | if (! info->ch || ch < 0 || ch >= info->nr_voices) { |
@@ -340,7 +345,12 @@ note_on_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, st | |||
340 | static int | 345 | static int |
341 | note_off_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev) | 346 | note_off_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev) |
342 | { | 347 | { |
343 | struct seq_oss_synthinfo *info = &dp->synths[dev]; | 348 | struct seq_oss_synthinfo *info; |
349 | |||
350 | if (!snd_seq_oss_synth_is_valid(dp, dev)) | ||
351 | return -ENXIO; | ||
352 | |||
353 | info = &dp->synths[dev]; | ||
344 | switch (info->arg.event_passing) { | 354 | switch (info->arg.event_passing) { |
345 | case SNDRV_SEQ_OSS_PROCESS_EVENTS: | 355 | case SNDRV_SEQ_OSS_PROCESS_EVENTS: |
346 | if (! info->ch || ch < 0 || ch >= info->nr_voices) { | 356 | if (! info->ch || ch < 0 || ch >= info->nr_voices) { |
diff --git a/sound/core/vmaster.c b/sound/core/vmaster.c index 857586135d18..0097f3619faa 100644 --- a/sound/core/vmaster.c +++ b/sound/core/vmaster.c | |||
@@ -213,7 +213,10 @@ static int slave_put(struct snd_kcontrol *kcontrol, | |||
213 | } | 213 | } |
214 | if (!changed) | 214 | if (!changed) |
215 | return 0; | 215 | return 0; |
216 | return slave_put_val(slave, ucontrol); | 216 | err = slave_put_val(slave, ucontrol); |
217 | if (err < 0) | ||
218 | return err; | ||
219 | return 1; | ||
217 | } | 220 | } |
218 | 221 | ||
219 | static int slave_tlv_cmd(struct snd_kcontrol *kcontrol, | 222 | static int slave_tlv_cmd(struct snd_kcontrol *kcontrol, |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 04b57383e8cb..97c68dd24ef5 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3334,6 +3334,8 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec, | |||
3334 | return -EBUSY; | 3334 | return -EBUSY; |
3335 | } | 3335 | } |
3336 | spdif = snd_array_new(&codec->spdif_out); | 3336 | spdif = snd_array_new(&codec->spdif_out); |
3337 | if (!spdif) | ||
3338 | return -ENOMEM; | ||
3337 | for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) { | 3339 | for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) { |
3338 | kctl = snd_ctl_new1(dig_mix, codec); | 3340 | kctl = snd_ctl_new1(dig_mix, codec); |
3339 | if (!kctl) | 3341 | if (!kctl) |
@@ -3431,11 +3433,16 @@ static struct snd_kcontrol_new spdif_share_sw = { | |||
3431 | int snd_hda_create_spdif_share_sw(struct hda_codec *codec, | 3433 | int snd_hda_create_spdif_share_sw(struct hda_codec *codec, |
3432 | struct hda_multi_out *mout) | 3434 | struct hda_multi_out *mout) |
3433 | { | 3435 | { |
3436 | struct snd_kcontrol *kctl; | ||
3437 | |||
3434 | if (!mout->dig_out_nid) | 3438 | if (!mout->dig_out_nid) |
3435 | return 0; | 3439 | return 0; |
3440 | |||
3441 | kctl = snd_ctl_new1(&spdif_share_sw, mout); | ||
3442 | if (!kctl) | ||
3443 | return -ENOMEM; | ||
3436 | /* ATTENTION: here mout is passed as private_data, instead of codec */ | 3444 | /* ATTENTION: here mout is passed as private_data, instead of codec */ |
3437 | return snd_hda_ctl_add(codec, mout->dig_out_nid, | 3445 | return snd_hda_ctl_add(codec, mout->dig_out_nid, kctl); |
3438 | snd_ctl_new1(&spdif_share_sw, mout)); | ||
3439 | } | 3446 | } |
3440 | EXPORT_SYMBOL_HDA(snd_hda_create_spdif_share_sw); | 3447 | EXPORT_SYMBOL_HDA(snd_hda_create_spdif_share_sw); |
3441 | 3448 | ||
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index db02c1e96b08..eefc4563b2f9 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c | |||
@@ -2298,6 +2298,11 @@ static int dspxfr_one_seg(struct hda_codec *codec, | |||
2298 | hda_frame_size_words = ((sample_rate_div == 0) ? 0 : | 2298 | hda_frame_size_words = ((sample_rate_div == 0) ? 0 : |
2299 | (num_chans * sample_rate_mul / sample_rate_div)); | 2299 | (num_chans * sample_rate_mul / sample_rate_div)); |
2300 | 2300 | ||
2301 | if (hda_frame_size_words == 0) { | ||
2302 | snd_printdd(KERN_ERR "frmsz zero\n"); | ||
2303 | return -EINVAL; | ||
2304 | } | ||
2305 | |||
2301 | buffer_size_words = min(buffer_size_words, | 2306 | buffer_size_words = min(buffer_size_words, |
2302 | (unsigned int)(UC_RANGE(chip_addx, 1) ? | 2307 | (unsigned int)(UC_RANGE(chip_addx, 1) ? |
2303 | 65536 : 32768)); | 2308 | 65536 : 32768)); |
@@ -2308,8 +2313,7 @@ static int dspxfr_one_seg(struct hda_codec *codec, | |||
2308 | chip_addx, hda_frame_size_words, num_chans, | 2313 | chip_addx, hda_frame_size_words, num_chans, |
2309 | sample_rate_mul, sample_rate_div, buffer_size_words); | 2314 | sample_rate_mul, sample_rate_div, buffer_size_words); |
2310 | 2315 | ||
2311 | if ((buffer_addx == NULL) || (hda_frame_size_words == 0) || | 2316 | if (buffer_size_words < hda_frame_size_words) { |
2312 | (buffer_size_words < hda_frame_size_words)) { | ||
2313 | snd_printdd(KERN_ERR "dspxfr_one_seg:failed\n"); | 2317 | snd_printdd(KERN_ERR "dspxfr_one_seg:failed\n"); |
2314 | return -EINVAL; | 2318 | return -EINVAL; |
2315 | } | 2319 | } |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 2d4237bc0d8e..563c24df4d6f 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -3163,6 +3163,7 @@ static int patch_alc269(struct hda_codec *codec) | |||
3163 | case 0x10ec0290: | 3163 | case 0x10ec0290: |
3164 | spec->codec_variant = ALC269_TYPE_ALC280; | 3164 | spec->codec_variant = ALC269_TYPE_ALC280; |
3165 | break; | 3165 | break; |
3166 | case 0x10ec0233: | ||
3166 | case 0x10ec0282: | 3167 | case 0x10ec0282: |
3167 | case 0x10ec0283: | 3168 | case 0x10ec0283: |
3168 | spec->codec_variant = ALC269_TYPE_ALC282; | 3169 | spec->codec_variant = ALC269_TYPE_ALC282; |
@@ -3862,6 +3863,7 @@ static int patch_alc680(struct hda_codec *codec) | |||
3862 | */ | 3863 | */ |
3863 | static const struct hda_codec_preset snd_hda_preset_realtek[] = { | 3864 | static const struct hda_codec_preset snd_hda_preset_realtek[] = { |
3864 | { .id = 0x10ec0221, .name = "ALC221", .patch = patch_alc269 }, | 3865 | { .id = 0x10ec0221, .name = "ALC221", .patch = patch_alc269 }, |
3866 | { .id = 0x10ec0233, .name = "ALC233", .patch = patch_alc269 }, | ||
3865 | { .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 }, | 3867 | { .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 }, |
3866 | { .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 }, | 3868 | { .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 }, |
3867 | { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 }, | 3869 | { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 }, |
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 2ffdc35d5ffd..806407a3973e 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c | |||
@@ -2594,6 +2594,8 @@ static int snd_ice1712_create(struct snd_card *card, | |||
2594 | snd_ice1712_proc_init(ice); | 2594 | snd_ice1712_proc_init(ice); |
2595 | synchronize_irq(pci->irq); | 2595 | synchronize_irq(pci->irq); |
2596 | 2596 | ||
2597 | card->private_data = ice; | ||
2598 | |||
2597 | err = pci_request_regions(pci, "ICE1712"); | 2599 | err = pci_request_regions(pci, "ICE1712"); |
2598 | if (err < 0) { | 2600 | if (err < 0) { |
2599 | kfree(ice); | 2601 | kfree(ice); |
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index b8d461db369f..b82bbf584146 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c | |||
@@ -573,6 +573,13 @@ static const struct reg_default wm5102_sysclk_reva_patch[] = { | |||
573 | { 0x025e, 0x0112 }, | 573 | { 0x025e, 0x0112 }, |
574 | }; | 574 | }; |
575 | 575 | ||
576 | static const struct reg_default wm5102_sysclk_revb_patch[] = { | ||
577 | { 0x3081, 0x08FE }, | ||
578 | { 0x3083, 0x00ED }, | ||
579 | { 0x30C1, 0x08FE }, | ||
580 | { 0x30C3, 0x00ED }, | ||
581 | }; | ||
582 | |||
576 | static int wm5102_sysclk_ev(struct snd_soc_dapm_widget *w, | 583 | static int wm5102_sysclk_ev(struct snd_soc_dapm_widget *w, |
577 | struct snd_kcontrol *kcontrol, int event) | 584 | struct snd_kcontrol *kcontrol, int event) |
578 | { | 585 | { |
@@ -587,6 +594,10 @@ static int wm5102_sysclk_ev(struct snd_soc_dapm_widget *w, | |||
587 | patch = wm5102_sysclk_reva_patch; | 594 | patch = wm5102_sysclk_reva_patch; |
588 | patch_size = ARRAY_SIZE(wm5102_sysclk_reva_patch); | 595 | patch_size = ARRAY_SIZE(wm5102_sysclk_reva_patch); |
589 | break; | 596 | break; |
597 | default: | ||
598 | patch = wm5102_sysclk_revb_patch; | ||
599 | patch_size = ARRAY_SIZE(wm5102_sysclk_revb_patch); | ||
600 | break; | ||
590 | } | 601 | } |
591 | 602 | ||
592 | switch (event) { | 603 | switch (event) { |
@@ -755,7 +766,7 @@ SOC_SINGLE("SPKDAT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_5L, | |||
755 | 766 | ||
756 | SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L, | 767 | SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L, |
757 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1), | 768 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1), |
758 | SOC_DOUBLE_R("OUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L, | 769 | SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L, |
759 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_MUTE_SHIFT, 1, 1), | 770 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_MUTE_SHIFT, 1, 1), |
760 | SOC_SINGLE("EPOUT Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_3L, | 771 | SOC_SINGLE("EPOUT Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_3L, |
761 | ARIZONA_OUT3L_MUTE_SHIFT, 1, 1), | 772 | ARIZONA_OUT3L_MUTE_SHIFT, 1, 1), |
@@ -767,7 +778,7 @@ SOC_DOUBLE_R("SPKDAT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_5L, | |||
767 | SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_1L, | 778 | SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_1L, |
768 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_VOL_SHIFT, | 779 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_VOL_SHIFT, |
769 | 0xbf, 0, digital_tlv), | 780 | 0xbf, 0, digital_tlv), |
770 | SOC_DOUBLE_R_TLV("OUT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_2L, | 781 | SOC_DOUBLE_R_TLV("HPOUT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_2L, |
771 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_VOL_SHIFT, | 782 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_VOL_SHIFT, |
772 | 0xbf, 0, digital_tlv), | 783 | 0xbf, 0, digital_tlv), |
773 | SOC_SINGLE_TLV("EPOUT Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_3L, | 784 | SOC_SINGLE_TLV("EPOUT Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_3L, |
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index cd17b477781d..cdeb301da1f6 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c | |||
@@ -213,9 +213,9 @@ ARIZONA_MIXER_CONTROLS("SPKDAT2R", ARIZONA_OUT6RMIX_INPUT_1_SOURCE), | |||
213 | 213 | ||
214 | SOC_SINGLE("HPOUT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_1L, | 214 | SOC_SINGLE("HPOUT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_1L, |
215 | ARIZONA_OUT1_OSR_SHIFT, 1, 0), | 215 | ARIZONA_OUT1_OSR_SHIFT, 1, 0), |
216 | SOC_SINGLE("OUT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_2L, | 216 | SOC_SINGLE("HPOUT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_2L, |
217 | ARIZONA_OUT2_OSR_SHIFT, 1, 0), | 217 | ARIZONA_OUT2_OSR_SHIFT, 1, 0), |
218 | SOC_SINGLE("OUT3 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_3L, | 218 | SOC_SINGLE("HPOUT3 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_3L, |
219 | ARIZONA_OUT3_OSR_SHIFT, 1, 0), | 219 | ARIZONA_OUT3_OSR_SHIFT, 1, 0), |
220 | SOC_SINGLE("Speaker High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_4L, | 220 | SOC_SINGLE("Speaker High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_4L, |
221 | ARIZONA_OUT4_OSR_SHIFT, 1, 0), | 221 | ARIZONA_OUT4_OSR_SHIFT, 1, 0), |
@@ -226,9 +226,9 @@ SOC_SINGLE("SPKDAT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_6L, | |||
226 | 226 | ||
227 | SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L, | 227 | SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L, |
228 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1), | 228 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1), |
229 | SOC_DOUBLE_R("OUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L, | 229 | SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L, |
230 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_MUTE_SHIFT, 1, 1), | 230 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_MUTE_SHIFT, 1, 1), |
231 | SOC_DOUBLE_R("OUT3 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_3L, | 231 | SOC_DOUBLE_R("HPOUT3 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_3L, |
232 | ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_MUTE_SHIFT, 1, 1), | 232 | ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_MUTE_SHIFT, 1, 1), |
233 | SOC_DOUBLE_R("Speaker Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_4L, | 233 | SOC_DOUBLE_R("Speaker Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_4L, |
234 | ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_MUTE_SHIFT, 1, 1), | 234 | ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_MUTE_SHIFT, 1, 1), |
@@ -240,10 +240,10 @@ SOC_DOUBLE_R("SPKDAT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_6L, | |||
240 | SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_1L, | 240 | SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_1L, |
241 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_VOL_SHIFT, | 241 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_VOL_SHIFT, |
242 | 0xbf, 0, digital_tlv), | 242 | 0xbf, 0, digital_tlv), |
243 | SOC_DOUBLE_R_TLV("OUT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_2L, | 243 | SOC_DOUBLE_R_TLV("HPOUT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_2L, |
244 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_VOL_SHIFT, | 244 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_VOL_SHIFT, |
245 | 0xbf, 0, digital_tlv), | 245 | 0xbf, 0, digital_tlv), |
246 | SOC_DOUBLE_R_TLV("OUT3 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_3L, | 246 | SOC_DOUBLE_R_TLV("HPOUT3 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_3L, |
247 | ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_VOL_SHIFT, | 247 | ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_VOL_SHIFT, |
248 | 0xbf, 0, digital_tlv), | 248 | 0xbf, 0, digital_tlv), |
249 | SOC_DOUBLE_R_TLV("Speaker Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_4L, | 249 | SOC_DOUBLE_R_TLV("Speaker Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_4L, |
@@ -260,11 +260,11 @@ SOC_DOUBLE_R_RANGE_TLV("HPOUT1 Volume", ARIZONA_OUTPUT_PATH_CONFIG_1L, | |||
260 | ARIZONA_OUTPUT_PATH_CONFIG_1R, | 260 | ARIZONA_OUTPUT_PATH_CONFIG_1R, |
261 | ARIZONA_OUT1L_PGA_VOL_SHIFT, | 261 | ARIZONA_OUT1L_PGA_VOL_SHIFT, |
262 | 0x34, 0x40, 0, ana_tlv), | 262 | 0x34, 0x40, 0, ana_tlv), |
263 | SOC_DOUBLE_R_RANGE_TLV("OUT2 Volume", ARIZONA_OUTPUT_PATH_CONFIG_2L, | 263 | SOC_DOUBLE_R_RANGE_TLV("HPOUT2 Volume", ARIZONA_OUTPUT_PATH_CONFIG_2L, |
264 | ARIZONA_OUTPUT_PATH_CONFIG_2R, | 264 | ARIZONA_OUTPUT_PATH_CONFIG_2R, |
265 | ARIZONA_OUT2L_PGA_VOL_SHIFT, | 265 | ARIZONA_OUT2L_PGA_VOL_SHIFT, |
266 | 0x34, 0x40, 0, ana_tlv), | 266 | 0x34, 0x40, 0, ana_tlv), |
267 | SOC_DOUBLE_R_RANGE_TLV("OUT3 Volume", ARIZONA_OUTPUT_PATH_CONFIG_3L, | 267 | SOC_DOUBLE_R_RANGE_TLV("HPOUT3 Volume", ARIZONA_OUTPUT_PATH_CONFIG_3L, |
268 | ARIZONA_OUTPUT_PATH_CONFIG_3R, | 268 | ARIZONA_OUTPUT_PATH_CONFIG_3R, |
269 | ARIZONA_OUT3L_PGA_VOL_SHIFT, 0x34, 0x40, 0, ana_tlv), | 269 | ARIZONA_OUT3L_PGA_VOL_SHIFT, 0x34, 0x40, 0, ana_tlv), |
270 | 270 | ||
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index ec0efc1443ba..0e8b3aaf6c8d 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c | |||
@@ -1301,7 +1301,7 @@ static irqreturn_t wm8350_hpl_jack_handler(int irq, void *data) | |||
1301 | if (device_may_wakeup(wm8350->dev)) | 1301 | if (device_may_wakeup(wm8350->dev)) |
1302 | pm_wakeup_event(wm8350->dev, 250); | 1302 | pm_wakeup_event(wm8350->dev, 250); |
1303 | 1303 | ||
1304 | schedule_delayed_work(&priv->hpl.work, 200); | 1304 | schedule_delayed_work(&priv->hpl.work, msecs_to_jiffies(200)); |
1305 | 1305 | ||
1306 | return IRQ_HANDLED; | 1306 | return IRQ_HANDLED; |
1307 | } | 1307 | } |
@@ -1318,7 +1318,7 @@ static irqreturn_t wm8350_hpr_jack_handler(int irq, void *data) | |||
1318 | if (device_may_wakeup(wm8350->dev)) | 1318 | if (device_may_wakeup(wm8350->dev)) |
1319 | pm_wakeup_event(wm8350->dev, 250); | 1319 | pm_wakeup_event(wm8350->dev, 250); |
1320 | 1320 | ||
1321 | schedule_delayed_work(&priv->hpr.work, 200); | 1321 | schedule_delayed_work(&priv->hpr.work, msecs_to_jiffies(200)); |
1322 | 1322 | ||
1323 | return IRQ_HANDLED; | 1323 | return IRQ_HANDLED; |
1324 | } | 1324 | } |
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index 9bb927325993..a64b93425ae3 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c | |||
@@ -53,8 +53,8 @@ | |||
53 | * using 2 wire for device control, so we cache them instead. | 53 | * using 2 wire for device control, so we cache them instead. |
54 | */ | 54 | */ |
55 | static const struct reg_default wm8960_reg_defaults[] = { | 55 | static const struct reg_default wm8960_reg_defaults[] = { |
56 | { 0x0, 0x0097 }, | 56 | { 0x0, 0x00a7 }, |
57 | { 0x1, 0x0097 }, | 57 | { 0x1, 0x00a7 }, |
58 | { 0x2, 0x0000 }, | 58 | { 0x2, 0x0000 }, |
59 | { 0x3, 0x0000 }, | 59 | { 0x3, 0x0000 }, |
60 | { 0x4, 0x0000 }, | 60 | { 0x4, 0x0000 }, |
@@ -323,8 +323,8 @@ SND_SOC_DAPM_MIXER("Left Input Mixer", WM8960_POWER3, 5, 0, | |||
323 | SND_SOC_DAPM_MIXER("Right Input Mixer", WM8960_POWER3, 4, 0, | 323 | SND_SOC_DAPM_MIXER("Right Input Mixer", WM8960_POWER3, 4, 0, |
324 | wm8960_rin, ARRAY_SIZE(wm8960_rin)), | 324 | wm8960_rin, ARRAY_SIZE(wm8960_rin)), |
325 | 325 | ||
326 | SND_SOC_DAPM_ADC("Left ADC", "Capture", WM8960_POWER2, 3, 0), | 326 | SND_SOC_DAPM_ADC("Left ADC", "Capture", WM8960_POWER1, 3, 0), |
327 | SND_SOC_DAPM_ADC("Right ADC", "Capture", WM8960_POWER2, 2, 0), | 327 | SND_SOC_DAPM_ADC("Right ADC", "Capture", WM8960_POWER1, 2, 0), |
328 | 328 | ||
329 | SND_SOC_DAPM_DAC("Left DAC", "Playback", WM8960_POWER2, 8, 0), | 329 | SND_SOC_DAPM_DAC("Left DAC", "Playback", WM8960_POWER2, 8, 0), |
330 | SND_SOC_DAPM_DAC("Right DAC", "Playback", WM8960_POWER2, 7, 0), | 330 | SND_SOC_DAPM_DAC("Right DAC", "Playback", WM8960_POWER2, 7, 0), |
diff --git a/sound/soc/tegra/tegra20_i2s.h b/sound/soc/tegra/tegra20_i2s.h index c27069d24d77..729958713cd4 100644 --- a/sound/soc/tegra/tegra20_i2s.h +++ b/sound/soc/tegra/tegra20_i2s.h | |||
@@ -121,7 +121,7 @@ | |||
121 | 121 | ||
122 | #define TEGRA20_I2S_TIMING_NON_SYM_ENABLE (1 << 12) | 122 | #define TEGRA20_I2S_TIMING_NON_SYM_ENABLE (1 << 12) |
123 | #define TEGRA20_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT 0 | 123 | #define TEGRA20_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT 0 |
124 | #define TEGRA20_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US 0x7fff | 124 | #define TEGRA20_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US 0x7ff |
125 | #define TEGRA20_I2S_TIMING_CHANNEL_BIT_COUNT_MASK (TEGRA20_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US << TEGRA20_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT) | 125 | #define TEGRA20_I2S_TIMING_CHANNEL_BIT_COUNT_MASK (TEGRA20_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US << TEGRA20_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT) |
126 | 126 | ||
127 | /* Fields in TEGRA20_I2S_FIFO_SCR */ | 127 | /* Fields in TEGRA20_I2S_FIFO_SCR */ |
diff --git a/sound/soc/tegra/tegra30_i2s.h b/sound/soc/tegra/tegra30_i2s.h index 34dc47b9581c..a294d942b9f7 100644 --- a/sound/soc/tegra/tegra30_i2s.h +++ b/sound/soc/tegra/tegra30_i2s.h | |||
@@ -110,7 +110,7 @@ | |||
110 | 110 | ||
111 | #define TEGRA30_I2S_TIMING_NON_SYM_ENABLE (1 << 12) | 111 | #define TEGRA30_I2S_TIMING_NON_SYM_ENABLE (1 << 12) |
112 | #define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT 0 | 112 | #define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT 0 |
113 | #define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US 0x7fff | 113 | #define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US 0x7ff |
114 | #define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK (TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US << TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT) | 114 | #define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK (TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US << TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT) |
115 | 115 | ||
116 | /* Fields in TEGRA30_I2S_OFFSET */ | 116 | /* Fields in TEGRA30_I2S_OFFSET */ |
diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh index 880cdd5dc63f..77edcdcc016b 100644 --- a/tools/testing/selftests/efivarfs/efivarfs.sh +++ b/tools/testing/selftests/efivarfs/efivarfs.sh | |||
@@ -125,6 +125,63 @@ test_open_unlink() | |||
125 | ./open-unlink $file | 125 | ./open-unlink $file |
126 | } | 126 | } |
127 | 127 | ||
128 | # test that we can create a range of filenames | ||
129 | test_valid_filenames() | ||
130 | { | ||
131 | local attrs='\x07\x00\x00\x00' | ||
132 | local ret=0 | ||
133 | |||
134 | local file_list="abc dump-type0-11-1-1362436005 1234 -" | ||
135 | for f in $file_list; do | ||
136 | local file=$efivarfs_mount/$f-$test_guid | ||
137 | |||
138 | printf "$attrs\x00" > $file | ||
139 | |||
140 | if [ ! -e $file ]; then | ||
141 | echo "$file could not be created" >&2 | ||
142 | ret=1 | ||
143 | else | ||
144 | rm $file | ||
145 | fi | ||
146 | done | ||
147 | |||
148 | exit $ret | ||
149 | } | ||
150 | |||
151 | test_invalid_filenames() | ||
152 | { | ||
153 | local attrs='\x07\x00\x00\x00' | ||
154 | local ret=0 | ||
155 | |||
156 | local file_list=" | ||
157 | -1234-1234-1234-123456789abc | ||
158 | foo | ||
159 | foo-bar | ||
160 | -foo- | ||
161 | foo-barbazba-foob-foob-foob-foobarbazfoo | ||
162 | foo------------------------------------- | ||
163 | -12345678-1234-1234-1234-123456789abc | ||
164 | a-12345678=1234-1234-1234-123456789abc | ||
165 | a-12345678-1234=1234-1234-123456789abc | ||
166 | a-12345678-1234-1234=1234-123456789abc | ||
167 | a-12345678-1234-1234-1234=123456789abc | ||
168 | 1112345678-1234-1234-1234-123456789abc" | ||
169 | |||
170 | for f in $file_list; do | ||
171 | local file=$efivarfs_mount/$f | ||
172 | |||
173 | printf "$attrs\x00" 2>/dev/null > $file | ||
174 | |||
175 | if [ -e $file ]; then | ||
176 | echo "Creating $file should have failed" >&2 | ||
177 | rm $file | ||
178 | ret=1 | ||
179 | fi | ||
180 | done | ||
181 | |||
182 | exit $ret | ||
183 | } | ||
184 | |||
128 | check_prereqs | 185 | check_prereqs |
129 | 186 | ||
130 | rc=0 | 187 | rc=0 |
@@ -135,5 +192,7 @@ run_test test_create_read | |||
135 | run_test test_delete | 192 | run_test test_delete |
136 | run_test test_zero_size_delete | 193 | run_test test_zero_size_delete |
137 | run_test test_open_unlink | 194 | run_test test_open_unlink |
195 | run_test test_valid_filenames | ||
196 | run_test test_invalid_filenames | ||
138 | 197 | ||
139 | exit $rc | 198 | exit $rc |