diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-22 10:30:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-22 10:30:03 -0400 |
commit | d84a2b0d6fecbb6e29875dd9dc97cdcdaa15744a (patch) | |
tree | ea756d49395ac4a08d6cdff98d74e60384a322a6 | |
parent | 3f76a4ea5383ba2f9e76f9625f77ff246907a134 (diff) | |
parent | 0f33be009b89d2268e94194dc4fd01a7851b6d51 (diff) |
Merge 3.17-rc6 into staging-next.
We want the fixes in there, and it resolves a merge issue with
drivers/iio/accel/bma180.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
167 files changed, 1078 insertions, 612 deletions
diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt index 0ac23f2ed104..1852906517ab 100644 --- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt +++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt | |||
@@ -11,10 +11,6 @@ Required properties: | |||
11 | 11 | ||
12 | Optional properties for main touchpad device: | 12 | Optional properties for main touchpad device: |
13 | 13 | ||
14 | - linux,gpio-keymap: An array of up to 4 entries indicating the Linux | ||
15 | keycode generated by each GPIO. Linux keycodes are defined in | ||
16 | <dt-bindings/input/input.h>. | ||
17 | |||
18 | - linux,gpio-keymap: When enabled, the SPT_GPIOPWN_T19 object sends messages | 14 | - linux,gpio-keymap: When enabled, the SPT_GPIOPWN_T19 object sends messages |
19 | on GPIO bit changes. An array of up to 8 entries can be provided | 15 | on GPIO bit changes. An array of up to 8 entries can be provided |
20 | indicating the Linux keycode mapped to each bit of the status byte, | 16 | indicating the Linux keycode mapped to each bit of the status byte, |
diff --git a/Documentation/devicetree/bindings/sound/rockchip-i2s.txt b/Documentation/devicetree/bindings/sound/rockchip-i2s.txt index 6c55fcfe5e1d..9b82c20b306b 100644 --- a/Documentation/devicetree/bindings/sound/rockchip-i2s.txt +++ b/Documentation/devicetree/bindings/sound/rockchip-i2s.txt | |||
@@ -31,7 +31,7 @@ i2s@ff890000 { | |||
31 | #address-cells = <1>; | 31 | #address-cells = <1>; |
32 | #size-cells = <0>; | 32 | #size-cells = <0>; |
33 | dmas = <&pdma1 0>, <&pdma1 1>; | 33 | dmas = <&pdma1 0>, <&pdma1 1>; |
34 | dma-names = "rx", "tx"; | 34 | dma-names = "tx", "rx"; |
35 | clock-names = "i2s_hclk", "i2s_clk"; | 35 | clock-names = "i2s_hclk", "i2s_clk"; |
36 | clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>; | 36 | clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>; |
37 | }; | 37 | }; |
diff --git a/Documentation/devicetree/bindings/spi/spi-rockchip.txt b/Documentation/devicetree/bindings/spi/spi-rockchip.txt index 7bab35575817..467dec441c62 100644 --- a/Documentation/devicetree/bindings/spi/spi-rockchip.txt +++ b/Documentation/devicetree/bindings/spi/spi-rockchip.txt | |||
@@ -16,11 +16,15 @@ Required Properties: | |||
16 | - clocks: Must contain an entry for each entry in clock-names. | 16 | - clocks: Must contain an entry for each entry in clock-names. |
17 | - clock-names: Shall be "spiclk" for the transfer-clock, and "apb_pclk" for | 17 | - clock-names: Shall be "spiclk" for the transfer-clock, and "apb_pclk" for |
18 | the peripheral clock. | 18 | the peripheral clock. |
19 | - #address-cells: should be 1. | ||
20 | - #size-cells: should be 0. | ||
21 | |||
22 | Optional Properties: | ||
23 | |||
19 | - dmas: DMA specifiers for tx and rx dma. See the DMA client binding, | 24 | - dmas: DMA specifiers for tx and rx dma. See the DMA client binding, |
20 | Documentation/devicetree/bindings/dma/dma.txt | 25 | Documentation/devicetree/bindings/dma/dma.txt |
21 | - dma-names: DMA request names should include "tx" and "rx" if present. | 26 | - dma-names: DMA request names should include "tx" and "rx" if present. |
22 | - #address-cells: should be 1. | 27 | |
23 | - #size-cells: should be 0. | ||
24 | 28 | ||
25 | Example: | 29 | Example: |
26 | 30 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index b2f927b60194..5663713db076 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -6890,7 +6890,7 @@ F: arch/x86/kernel/quirks.c | |||
6890 | 6890 | ||
6891 | PCI DRIVER FOR IMX6 | 6891 | PCI DRIVER FOR IMX6 |
6892 | M: Richard Zhu <r65037@freescale.com> | 6892 | M: Richard Zhu <r65037@freescale.com> |
6893 | M: Shawn Guo <shawn.guo@freescale.com> | 6893 | M: Lucas Stach <l.stach@pengutronix.de> |
6894 | L: linux-pci@vger.kernel.org | 6894 | L: linux-pci@vger.kernel.org |
6895 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 6895 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
6896 | S: Maintained | 6896 | S: Maintained |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 3 | 1 | VERSION = 3 |
2 | PATCHLEVEL = 17 | 2 | PATCHLEVEL = 17 |
3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
4 | EXTRAVERSION = -rc5 | 4 | EXTRAVERSION = -rc6 |
5 | NAME = Shuffling Zombie Juror | 5 | NAME = Shuffling Zombie Juror |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/include/asm/tls.h b/arch/arm/include/asm/tls.h index 83259b873333..36172adda9d0 100644 --- a/arch/arm/include/asm/tls.h +++ b/arch/arm/include/asm/tls.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef __ASMARM_TLS_H | 1 | #ifndef __ASMARM_TLS_H |
2 | #define __ASMARM_TLS_H | 2 | #define __ASMARM_TLS_H |
3 | 3 | ||
4 | #include <linux/compiler.h> | ||
5 | #include <asm/thread_info.h> | ||
6 | |||
4 | #ifdef __ASSEMBLY__ | 7 | #ifdef __ASSEMBLY__ |
5 | #include <asm/asm-offsets.h> | 8 | #include <asm/asm-offsets.h> |
6 | .macro switch_tls_none, base, tp, tpuser, tmp1, tmp2 | 9 | .macro switch_tls_none, base, tp, tpuser, tmp1, tmp2 |
@@ -50,6 +53,47 @@ | |||
50 | #endif | 53 | #endif |
51 | 54 | ||
52 | #ifndef __ASSEMBLY__ | 55 | #ifndef __ASSEMBLY__ |
56 | |||
57 | static inline void set_tls(unsigned long val) | ||
58 | { | ||
59 | struct thread_info *thread; | ||
60 | |||
61 | thread = current_thread_info(); | ||
62 | |||
63 | thread->tp_value[0] = val; | ||
64 | |||
65 | /* | ||
66 | * This code runs with preemption enabled and therefore must | ||
67 | * be reentrant with respect to switch_tls. | ||
68 | * | ||
69 | * We need to ensure ordering between the shadow state and the | ||
70 | * hardware state, so that we don't corrupt the hardware state | ||
71 | * with a stale shadow state during context switch. | ||
72 | * | ||
73 | * If we're preempted here, switch_tls will load TPIDRURO from | ||
74 | * thread_info upon resuming execution and the following mcr | ||
75 | * is merely redundant. | ||
76 | */ | ||
77 | barrier(); | ||
78 | |||
79 | if (!tls_emu) { | ||
80 | if (has_tls_reg) { | ||
81 | asm("mcr p15, 0, %0, c13, c0, 3" | ||
82 | : : "r" (val)); | ||
83 | } else { | ||
84 | /* | ||
85 | * User space must never try to access this | ||
86 | * directly. Expect your app to break | ||
87 | * eventually if you do so. The user helper | ||
88 | * at 0xffff0fe0 must be used instead. (see | ||
89 | * entry-armv.S for details) | ||
90 | */ | ||
91 | *((unsigned int *)0xffff0ff0) = val; | ||
92 | } | ||
93 | |||
94 | } | ||
95 | } | ||
96 | |||
53 | static inline unsigned long get_tpuser(void) | 97 | static inline unsigned long get_tpuser(void) |
54 | { | 98 | { |
55 | unsigned long reg = 0; | 99 | unsigned long reg = 0; |
@@ -59,5 +103,23 @@ static inline unsigned long get_tpuser(void) | |||
59 | 103 | ||
60 | return reg; | 104 | return reg; |
61 | } | 105 | } |
106 | |||
107 | static inline void set_tpuser(unsigned long val) | ||
108 | { | ||
109 | /* Since TPIDRURW is fully context-switched (unlike TPIDRURO), | ||
110 | * we need not update thread_info. | ||
111 | */ | ||
112 | if (has_tls_reg && !tls_emu) { | ||
113 | asm("mcr p15, 0, %0, c13, c0, 2" | ||
114 | : : "r" (val)); | ||
115 | } | ||
116 | } | ||
117 | |||
118 | static inline void flush_tls(void) | ||
119 | { | ||
120 | set_tls(0); | ||
121 | set_tpuser(0); | ||
122 | } | ||
123 | |||
62 | #endif | 124 | #endif |
63 | #endif /* __ASMARM_TLS_H */ | 125 | #endif /* __ASMARM_TLS_H */ |
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index a4cd7af475e9..4767eb9caa78 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h | |||
@@ -107,8 +107,11 @@ static inline void set_fs(mm_segment_t fs) | |||
107 | extern int __get_user_1(void *); | 107 | extern int __get_user_1(void *); |
108 | extern int __get_user_2(void *); | 108 | extern int __get_user_2(void *); |
109 | extern int __get_user_4(void *); | 109 | extern int __get_user_4(void *); |
110 | extern int __get_user_lo8(void *); | 110 | extern int __get_user_32t_8(void *); |
111 | extern int __get_user_8(void *); | 111 | extern int __get_user_8(void *); |
112 | extern int __get_user_64t_1(void *); | ||
113 | extern int __get_user_64t_2(void *); | ||
114 | extern int __get_user_64t_4(void *); | ||
112 | 115 | ||
113 | #define __GUP_CLOBBER_1 "lr", "cc" | 116 | #define __GUP_CLOBBER_1 "lr", "cc" |
114 | #ifdef CONFIG_CPU_USE_DOMAINS | 117 | #ifdef CONFIG_CPU_USE_DOMAINS |
@@ -117,7 +120,7 @@ extern int __get_user_8(void *); | |||
117 | #define __GUP_CLOBBER_2 "lr", "cc" | 120 | #define __GUP_CLOBBER_2 "lr", "cc" |
118 | #endif | 121 | #endif |
119 | #define __GUP_CLOBBER_4 "lr", "cc" | 122 | #define __GUP_CLOBBER_4 "lr", "cc" |
120 | #define __GUP_CLOBBER_lo8 "lr", "cc" | 123 | #define __GUP_CLOBBER_32t_8 "lr", "cc" |
121 | #define __GUP_CLOBBER_8 "lr", "cc" | 124 | #define __GUP_CLOBBER_8 "lr", "cc" |
122 | 125 | ||
123 | #define __get_user_x(__r2,__p,__e,__l,__s) \ | 126 | #define __get_user_x(__r2,__p,__e,__l,__s) \ |
@@ -131,12 +134,30 @@ extern int __get_user_8(void *); | |||
131 | 134 | ||
132 | /* narrowing a double-word get into a single 32bit word register: */ | 135 | /* narrowing a double-word get into a single 32bit word register: */ |
133 | #ifdef __ARMEB__ | 136 | #ifdef __ARMEB__ |
134 | #define __get_user_xb(__r2, __p, __e, __l, __s) \ | 137 | #define __get_user_x_32t(__r2, __p, __e, __l, __s) \ |
135 | __get_user_x(__r2, __p, __e, __l, lo8) | 138 | __get_user_x(__r2, __p, __e, __l, 32t_8) |
136 | #else | 139 | #else |
137 | #define __get_user_xb __get_user_x | 140 | #define __get_user_x_32t __get_user_x |
138 | #endif | 141 | #endif |
139 | 142 | ||
143 | /* | ||
144 | * storing result into proper least significant word of 64bit target var, | ||
145 | * different only for big endian case where 64 bit __r2 lsw is r3: | ||
146 | */ | ||
147 | #ifdef __ARMEB__ | ||
148 | #define __get_user_x_64t(__r2, __p, __e, __l, __s) \ | ||
149 | __asm__ __volatile__ ( \ | ||
150 | __asmeq("%0", "r0") __asmeq("%1", "r2") \ | ||
151 | __asmeq("%3", "r1") \ | ||
152 | "bl __get_user_64t_" #__s \ | ||
153 | : "=&r" (__e), "=r" (__r2) \ | ||
154 | : "0" (__p), "r" (__l) \ | ||
155 | : __GUP_CLOBBER_##__s) | ||
156 | #else | ||
157 | #define __get_user_x_64t __get_user_x | ||
158 | #endif | ||
159 | |||
160 | |||
140 | #define __get_user_check(x,p) \ | 161 | #define __get_user_check(x,p) \ |
141 | ({ \ | 162 | ({ \ |
142 | unsigned long __limit = current_thread_info()->addr_limit - 1; \ | 163 | unsigned long __limit = current_thread_info()->addr_limit - 1; \ |
@@ -146,17 +167,26 @@ extern int __get_user_8(void *); | |||
146 | register int __e asm("r0"); \ | 167 | register int __e asm("r0"); \ |
147 | switch (sizeof(*(__p))) { \ | 168 | switch (sizeof(*(__p))) { \ |
148 | case 1: \ | 169 | case 1: \ |
149 | __get_user_x(__r2, __p, __e, __l, 1); \ | 170 | if (sizeof((x)) >= 8) \ |
171 | __get_user_x_64t(__r2, __p, __e, __l, 1); \ | ||
172 | else \ | ||
173 | __get_user_x(__r2, __p, __e, __l, 1); \ | ||
150 | break; \ | 174 | break; \ |
151 | case 2: \ | 175 | case 2: \ |
152 | __get_user_x(__r2, __p, __e, __l, 2); \ | 176 | if (sizeof((x)) >= 8) \ |
177 | __get_user_x_64t(__r2, __p, __e, __l, 2); \ | ||
178 | else \ | ||
179 | __get_user_x(__r2, __p, __e, __l, 2); \ | ||
153 | break; \ | 180 | break; \ |
154 | case 4: \ | 181 | case 4: \ |
155 | __get_user_x(__r2, __p, __e, __l, 4); \ | 182 | if (sizeof((x)) >= 8) \ |
183 | __get_user_x_64t(__r2, __p, __e, __l, 4); \ | ||
184 | else \ | ||
185 | __get_user_x(__r2, __p, __e, __l, 4); \ | ||
156 | break; \ | 186 | break; \ |
157 | case 8: \ | 187 | case 8: \ |
158 | if (sizeof((x)) < 8) \ | 188 | if (sizeof((x)) < 8) \ |
159 | __get_user_xb(__r2, __p, __e, __l, 4); \ | 189 | __get_user_x_32t(__r2, __p, __e, __l, 4); \ |
160 | else \ | 190 | else \ |
161 | __get_user_x(__r2, __p, __e, __l, 8); \ | 191 | __get_user_x(__r2, __p, __e, __l, 8); \ |
162 | break; \ | 192 | break; \ |
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c index f7b450f97e68..a88671cfe1ff 100644 --- a/arch/arm/kernel/armksyms.c +++ b/arch/arm/kernel/armksyms.c | |||
@@ -98,6 +98,14 @@ EXPORT_SYMBOL(__clear_user); | |||
98 | EXPORT_SYMBOL(__get_user_1); | 98 | EXPORT_SYMBOL(__get_user_1); |
99 | EXPORT_SYMBOL(__get_user_2); | 99 | EXPORT_SYMBOL(__get_user_2); |
100 | EXPORT_SYMBOL(__get_user_4); | 100 | EXPORT_SYMBOL(__get_user_4); |
101 | EXPORT_SYMBOL(__get_user_8); | ||
102 | |||
103 | #ifdef __ARMEB__ | ||
104 | EXPORT_SYMBOL(__get_user_64t_1); | ||
105 | EXPORT_SYMBOL(__get_user_64t_2); | ||
106 | EXPORT_SYMBOL(__get_user_64t_4); | ||
107 | EXPORT_SYMBOL(__get_user_32t_8); | ||
108 | #endif | ||
101 | 109 | ||
102 | EXPORT_SYMBOL(__put_user_1); | 110 | EXPORT_SYMBOL(__put_user_1); |
103 | EXPORT_SYMBOL(__put_user_2); | 111 | EXPORT_SYMBOL(__put_user_2); |
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 2c4257604513..5c4d38e32a51 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c | |||
@@ -175,7 +175,7 @@ static bool migrate_one_irq(struct irq_desc *desc) | |||
175 | c = irq_data_get_irq_chip(d); | 175 | c = irq_data_get_irq_chip(d); |
176 | if (!c->irq_set_affinity) | 176 | if (!c->irq_set_affinity) |
177 | pr_debug("IRQ%u: unable to set affinity\n", d->irq); | 177 | pr_debug("IRQ%u: unable to set affinity\n", d->irq); |
178 | else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret) | 178 | else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret) |
179 | cpumask_copy(d->affinity, affinity); | 179 | cpumask_copy(d->affinity, affinity); |
180 | 180 | ||
181 | return ret; | 181 | return ret; |
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c index e6a6edbec613..4bf4cce759fe 100644 --- a/arch/arm/kernel/perf_event_cpu.c +++ b/arch/arm/kernel/perf_event_cpu.c | |||
@@ -76,21 +76,15 @@ static struct pmu_hw_events *cpu_pmu_get_cpu_events(void) | |||
76 | 76 | ||
77 | static void cpu_pmu_enable_percpu_irq(void *data) | 77 | static void cpu_pmu_enable_percpu_irq(void *data) |
78 | { | 78 | { |
79 | struct arm_pmu *cpu_pmu = data; | 79 | int irq = *(int *)data; |
80 | struct platform_device *pmu_device = cpu_pmu->plat_device; | ||
81 | int irq = platform_get_irq(pmu_device, 0); | ||
82 | 80 | ||
83 | enable_percpu_irq(irq, IRQ_TYPE_NONE); | 81 | enable_percpu_irq(irq, IRQ_TYPE_NONE); |
84 | cpumask_set_cpu(smp_processor_id(), &cpu_pmu->active_irqs); | ||
85 | } | 82 | } |
86 | 83 | ||
87 | static void cpu_pmu_disable_percpu_irq(void *data) | 84 | static void cpu_pmu_disable_percpu_irq(void *data) |
88 | { | 85 | { |
89 | struct arm_pmu *cpu_pmu = data; | 86 | int irq = *(int *)data; |
90 | struct platform_device *pmu_device = cpu_pmu->plat_device; | ||
91 | int irq = platform_get_irq(pmu_device, 0); | ||
92 | 87 | ||
93 | cpumask_clear_cpu(smp_processor_id(), &cpu_pmu->active_irqs); | ||
94 | disable_percpu_irq(irq); | 88 | disable_percpu_irq(irq); |
95 | } | 89 | } |
96 | 90 | ||
@@ -103,7 +97,7 @@ static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu) | |||
103 | 97 | ||
104 | irq = platform_get_irq(pmu_device, 0); | 98 | irq = platform_get_irq(pmu_device, 0); |
105 | if (irq >= 0 && irq_is_percpu(irq)) { | 99 | if (irq >= 0 && irq_is_percpu(irq)) { |
106 | on_each_cpu(cpu_pmu_disable_percpu_irq, cpu_pmu, 1); | 100 | on_each_cpu(cpu_pmu_disable_percpu_irq, &irq, 1); |
107 | free_percpu_irq(irq, &percpu_pmu); | 101 | free_percpu_irq(irq, &percpu_pmu); |
108 | } else { | 102 | } else { |
109 | for (i = 0; i < irqs; ++i) { | 103 | for (i = 0; i < irqs; ++i) { |
@@ -138,7 +132,7 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler) | |||
138 | irq); | 132 | irq); |
139 | return err; | 133 | return err; |
140 | } | 134 | } |
141 | on_each_cpu(cpu_pmu_enable_percpu_irq, cpu_pmu, 1); | 135 | on_each_cpu(cpu_pmu_enable_percpu_irq, &irq, 1); |
142 | } else { | 136 | } else { |
143 | for (i = 0; i < irqs; ++i) { | 137 | for (i = 0; i < irqs; ++i) { |
144 | err = 0; | 138 | err = 0; |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 81ef686a91ca..a35f6ebbd2c2 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -334,6 +334,8 @@ void flush_thread(void) | |||
334 | memset(&tsk->thread.debug, 0, sizeof(struct debug_info)); | 334 | memset(&tsk->thread.debug, 0, sizeof(struct debug_info)); |
335 | memset(&thread->fpstate, 0, sizeof(union fp_state)); | 335 | memset(&thread->fpstate, 0, sizeof(union fp_state)); |
336 | 336 | ||
337 | flush_tls(); | ||
338 | |||
337 | thread_notify(THREAD_NOTIFY_FLUSH, thread); | 339 | thread_notify(THREAD_NOTIFY_FLUSH, thread); |
338 | } | 340 | } |
339 | 341 | ||
diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c index 67ca8578c6d8..587fdfe1a72c 100644 --- a/arch/arm/kernel/swp_emulate.c +++ b/arch/arm/kernel/swp_emulate.c | |||
@@ -142,14 +142,6 @@ static int emulate_swpX(unsigned int address, unsigned int *data, | |||
142 | while (1) { | 142 | while (1) { |
143 | unsigned long temp; | 143 | unsigned long temp; |
144 | 144 | ||
145 | /* | ||
146 | * Barrier required between accessing protected resource and | ||
147 | * releasing a lock for it. Legacy code might not have done | ||
148 | * this, and we cannot determine that this is not the case | ||
149 | * being emulated, so insert always. | ||
150 | */ | ||
151 | smp_mb(); | ||
152 | |||
153 | if (type == TYPE_SWPB) | 145 | if (type == TYPE_SWPB) |
154 | __user_swpb_asm(*data, address, res, temp); | 146 | __user_swpb_asm(*data, address, res, temp); |
155 | else | 147 | else |
@@ -162,13 +154,6 @@ static int emulate_swpX(unsigned int address, unsigned int *data, | |||
162 | } | 154 | } |
163 | 155 | ||
164 | if (res == 0) { | 156 | if (res == 0) { |
165 | /* | ||
166 | * Barrier also required between acquiring a lock for a | ||
167 | * protected resource and accessing the resource. Inserted for | ||
168 | * same reason as above. | ||
169 | */ | ||
170 | smp_mb(); | ||
171 | |||
172 | if (type == TYPE_SWPB) | 157 | if (type == TYPE_SWPB) |
173 | swpbcounter++; | 158 | swpbcounter++; |
174 | else | 159 | else |
diff --git a/arch/arm/kernel/thumbee.c b/arch/arm/kernel/thumbee.c index 7b8403b76666..80f0d69205e7 100644 --- a/arch/arm/kernel/thumbee.c +++ b/arch/arm/kernel/thumbee.c | |||
@@ -45,7 +45,7 @@ static int thumbee_notifier(struct notifier_block *self, unsigned long cmd, void | |||
45 | 45 | ||
46 | switch (cmd) { | 46 | switch (cmd) { |
47 | case THREAD_NOTIFY_FLUSH: | 47 | case THREAD_NOTIFY_FLUSH: |
48 | thread->thumbee_state = 0; | 48 | teehbr_write(0); |
49 | break; | 49 | break; |
50 | case THREAD_NOTIFY_SWITCH: | 50 | case THREAD_NOTIFY_SWITCH: |
51 | current_thread_info()->thumbee_state = teehbr_read(); | 51 | current_thread_info()->thumbee_state = teehbr_read(); |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index c8e4bb714944..a964c9f40f87 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -581,7 +581,6 @@ do_cache_op(unsigned long start, unsigned long end, int flags) | |||
581 | #define NR(x) ((__ARM_NR_##x) - __ARM_NR_BASE) | 581 | #define NR(x) ((__ARM_NR_##x) - __ARM_NR_BASE) |
582 | asmlinkage int arm_syscall(int no, struct pt_regs *regs) | 582 | asmlinkage int arm_syscall(int no, struct pt_regs *regs) |
583 | { | 583 | { |
584 | struct thread_info *thread = current_thread_info(); | ||
585 | siginfo_t info; | 584 | siginfo_t info; |
586 | 585 | ||
587 | if ((no >> 16) != (__ARM_NR_BASE>> 16)) | 586 | if ((no >> 16) != (__ARM_NR_BASE>> 16)) |
@@ -632,21 +631,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) | |||
632 | return regs->ARM_r0; | 631 | return regs->ARM_r0; |
633 | 632 | ||
634 | case NR(set_tls): | 633 | case NR(set_tls): |
635 | thread->tp_value[0] = regs->ARM_r0; | 634 | set_tls(regs->ARM_r0); |
636 | if (tls_emu) | ||
637 | return 0; | ||
638 | if (has_tls_reg) { | ||
639 | asm ("mcr p15, 0, %0, c13, c0, 3" | ||
640 | : : "r" (regs->ARM_r0)); | ||
641 | } else { | ||
642 | /* | ||
643 | * User space must never try to access this directly. | ||
644 | * Expect your app to break eventually if you do so. | ||
645 | * The user helper at 0xffff0fe0 must be used instead. | ||
646 | * (see entry-armv.S for details) | ||
647 | */ | ||
648 | *((unsigned int *)0xffff0ff0) = regs->ARM_r0; | ||
649 | } | ||
650 | return 0; | 635 | return 0; |
651 | 636 | ||
652 | #ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG | 637 | #ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG |
diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S index 938600098b88..8ecfd15c3a02 100644 --- a/arch/arm/lib/getuser.S +++ b/arch/arm/lib/getuser.S | |||
@@ -80,7 +80,7 @@ ENTRY(__get_user_8) | |||
80 | ENDPROC(__get_user_8) | 80 | ENDPROC(__get_user_8) |
81 | 81 | ||
82 | #ifdef __ARMEB__ | 82 | #ifdef __ARMEB__ |
83 | ENTRY(__get_user_lo8) | 83 | ENTRY(__get_user_32t_8) |
84 | check_uaccess r0, 8, r1, r2, __get_user_bad | 84 | check_uaccess r0, 8, r1, r2, __get_user_bad |
85 | #ifdef CONFIG_CPU_USE_DOMAINS | 85 | #ifdef CONFIG_CPU_USE_DOMAINS |
86 | add r0, r0, #4 | 86 | add r0, r0, #4 |
@@ -90,7 +90,37 @@ ENTRY(__get_user_lo8) | |||
90 | #endif | 90 | #endif |
91 | mov r0, #0 | 91 | mov r0, #0 |
92 | ret lr | 92 | ret lr |
93 | ENDPROC(__get_user_lo8) | 93 | ENDPROC(__get_user_32t_8) |
94 | |||
95 | ENTRY(__get_user_64t_1) | ||
96 | check_uaccess r0, 1, r1, r2, __get_user_bad8 | ||
97 | 8: TUSER(ldrb) r3, [r0] | ||
98 | mov r0, #0 | ||
99 | ret lr | ||
100 | ENDPROC(__get_user_64t_1) | ||
101 | |||
102 | ENTRY(__get_user_64t_2) | ||
103 | check_uaccess r0, 2, r1, r2, __get_user_bad8 | ||
104 | #ifdef CONFIG_CPU_USE_DOMAINS | ||
105 | rb .req ip | ||
106 | 9: ldrbt r3, [r0], #1 | ||
107 | 10: ldrbt rb, [r0], #0 | ||
108 | #else | ||
109 | rb .req r0 | ||
110 | 9: ldrb r3, [r0] | ||
111 | 10: ldrb rb, [r0, #1] | ||
112 | #endif | ||
113 | orr r3, rb, r3, lsl #8 | ||
114 | mov r0, #0 | ||
115 | ret lr | ||
116 | ENDPROC(__get_user_64t_2) | ||
117 | |||
118 | ENTRY(__get_user_64t_4) | ||
119 | check_uaccess r0, 4, r1, r2, __get_user_bad8 | ||
120 | 11: TUSER(ldr) r3, [r0] | ||
121 | mov r0, #0 | ||
122 | ret lr | ||
123 | ENDPROC(__get_user_64t_4) | ||
94 | #endif | 124 | #endif |
95 | 125 | ||
96 | __get_user_bad8: | 126 | __get_user_bad8: |
@@ -111,5 +141,9 @@ ENDPROC(__get_user_bad8) | |||
111 | .long 6b, __get_user_bad8 | 141 | .long 6b, __get_user_bad8 |
112 | #ifdef __ARMEB__ | 142 | #ifdef __ARMEB__ |
113 | .long 7b, __get_user_bad | 143 | .long 7b, __get_user_bad |
144 | .long 8b, __get_user_bad8 | ||
145 | .long 9b, __get_user_bad8 | ||
146 | .long 10b, __get_user_bad8 | ||
147 | .long 11b, __get_user_bad8 | ||
114 | #endif | 148 | #endif |
115 | .popsection | 149 | .popsection |
diff --git a/arch/arm/mm/proc-v7-3level.S b/arch/arm/mm/proc-v7-3level.S index 1a24e9232ec8..b64e67c7f176 100644 --- a/arch/arm/mm/proc-v7-3level.S +++ b/arch/arm/mm/proc-v7-3level.S | |||
@@ -146,7 +146,6 @@ ENDPROC(cpu_v7_set_pte_ext) | |||
146 | mov \tmp, \ttbr1, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits | 146 | mov \tmp, \ttbr1, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits |
147 | mov \ttbr1, \ttbr1, lsl #ARCH_PGD_SHIFT @ lower bits | 147 | mov \ttbr1, \ttbr1, lsl #ARCH_PGD_SHIFT @ lower bits |
148 | addls \ttbr1, \ttbr1, #TTBR1_OFFSET | 148 | addls \ttbr1, \ttbr1, #TTBR1_OFFSET |
149 | adcls \tmp, \tmp, #0 | ||
150 | mcrr p15, 1, \ttbr1, \tmp, c2 @ load TTBR1 | 149 | mcrr p15, 1, \ttbr1, \tmp, c2 @ load TTBR1 |
151 | mov \tmp, \ttbr0, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits | 150 | mov \tmp, \ttbr0, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits |
152 | mov \ttbr0, \ttbr0, lsl #ARCH_PGD_SHIFT @ lower bits | 151 | mov \ttbr0, \ttbr0, lsl #ARCH_PGD_SHIFT @ lower bits |
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 5472c2401876..a83061f37e43 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c | |||
@@ -149,8 +149,7 @@ void __init arm64_memblock_init(void) | |||
149 | memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start); | 149 | memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start); |
150 | #endif | 150 | #endif |
151 | 151 | ||
152 | if (!efi_enabled(EFI_MEMMAP)) | 152 | early_init_fdt_scan_reserved_mem(); |
153 | early_init_fdt_scan_reserved_mem(); | ||
154 | 153 | ||
155 | /* 4GB maximum for 32-bit only capable devices */ | 154 | /* 4GB maximum for 32-bit only capable devices */ |
156 | if (IS_ENABLED(CONFIG_ZONE_DMA)) | 155 | if (IS_ENABLED(CONFIG_ZONE_DMA)) |
diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h index 6a65bb7d0657..18026b2eb582 100644 --- a/arch/ia64/include/uapi/asm/unistd.h +++ b/arch/ia64/include/uapi/asm/unistd.h | |||
@@ -329,6 +329,6 @@ | |||
329 | #define __NR_sched_getattr 1337 | 329 | #define __NR_sched_getattr 1337 |
330 | #define __NR_renameat2 1338 | 330 | #define __NR_renameat2 1338 |
331 | #define __NR_getrandom 1339 | 331 | #define __NR_getrandom 1339 |
332 | #define __NR_memfd_create 1339 | 332 | #define __NR_memfd_create 1340 |
333 | 333 | ||
334 | #endif /* _UAPI_ASM_IA64_UNISTD_H */ | 334 | #endif /* _UAPI_ASM_IA64_UNISTD_H */ |
diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c index ec73b2cf912a..fc505d58f078 100644 --- a/arch/ia64/pci/fixup.c +++ b/arch/ia64/pci/fixup.c | |||
@@ -38,27 +38,6 @@ static void pci_fixup_video(struct pci_dev *pdev) | |||
38 | return; | 38 | return; |
39 | /* Maybe, this machine supports legacy memory map. */ | 39 | /* Maybe, this machine supports legacy memory map. */ |
40 | 40 | ||
41 | if (!vga_default_device()) { | ||
42 | resource_size_t start, end; | ||
43 | int i; | ||
44 | |||
45 | /* Does firmware framebuffer belong to us? */ | ||
46 | for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { | ||
47 | if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM)) | ||
48 | continue; | ||
49 | |||
50 | start = pci_resource_start(pdev, i); | ||
51 | end = pci_resource_end(pdev, i); | ||
52 | |||
53 | if (!start || !end) | ||
54 | continue; | ||
55 | |||
56 | if (screen_info.lfb_base >= start && | ||
57 | (screen_info.lfb_base + screen_info.lfb_size) < end) | ||
58 | vga_set_default_device(pdev); | ||
59 | } | ||
60 | } | ||
61 | |||
62 | /* Is VGA routed to us? */ | 41 | /* Is VGA routed to us? */ |
63 | bus = pdev->bus; | 42 | bus = pdev->bus; |
64 | while (bus) { | 43 | while (bus) { |
@@ -83,8 +62,7 @@ static void pci_fixup_video(struct pci_dev *pdev) | |||
83 | pci_read_config_word(pdev, PCI_COMMAND, &config); | 62 | pci_read_config_word(pdev, PCI_COMMAND, &config); |
84 | if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { | 63 | if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { |
85 | pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; | 64 | pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; |
86 | dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); | 65 | dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n"); |
87 | vga_set_default_device(pdev); | ||
88 | } | 66 | } |
89 | } | 67 | } |
90 | } | 68 | } |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 900c7e5333b6..574c43000699 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -546,6 +546,7 @@ config SGI_IP28 | |||
546 | # select SYS_HAS_EARLY_PRINTK | 546 | # select SYS_HAS_EARLY_PRINTK |
547 | select SYS_SUPPORTS_64BIT_KERNEL | 547 | select SYS_SUPPORTS_64BIT_KERNEL |
548 | select SYS_SUPPORTS_BIG_ENDIAN | 548 | select SYS_SUPPORTS_BIG_ENDIAN |
549 | select MIPS_L1_CACHE_SHIFT_7 | ||
549 | help | 550 | help |
550 | This is the SGI Indigo2 with R10000 processor. To compile a Linux | 551 | This is the SGI Indigo2 with R10000 processor. To compile a Linux |
551 | kernel that runs on these, say Y here. | 552 | kernel that runs on these, say Y here. |
@@ -2029,7 +2030,9 @@ config MIPS_CMP | |||
2029 | bool "MIPS CMP framework support (DEPRECATED)" | 2030 | bool "MIPS CMP framework support (DEPRECATED)" |
2030 | depends on SYS_SUPPORTS_MIPS_CMP | 2031 | depends on SYS_SUPPORTS_MIPS_CMP |
2031 | select MIPS_GIC_IPI | 2032 | select MIPS_GIC_IPI |
2033 | select SMP | ||
2032 | select SYNC_R4K | 2034 | select SYNC_R4K |
2035 | select SYS_SUPPORTS_SMP | ||
2033 | select WEAK_ORDERING | 2036 | select WEAK_ORDERING |
2034 | default n | 2037 | default n |
2035 | help | 2038 | help |
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 9336509f47ad..bbac51e11179 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
@@ -113,7 +113,16 @@ predef-le += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__ | |||
113 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be)) | 113 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be)) |
114 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le)) | 114 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le)) |
115 | 115 | ||
116 | cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) | 116 | # For smartmips configurations, there are hundreds of warnings due to ISA overrides |
117 | # in assembly and header files. smartmips is only supported for MIPS32r1 onwards | ||
118 | # and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or | ||
119 | # similar directives in the kernel will spam the build logs with the following warnings: | ||
120 | # Warning: the `smartmips' extension requires MIPS32 revision 1 or greater | ||
121 | # or | ||
122 | # Warning: the 64-bit MIPS architecture does not support the `smartmips' extension | ||
123 | # Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has | ||
124 | # been fixed properly. | ||
125 | cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) -Wa,--no-warn | ||
117 | cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips) | 126 | cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips) |
118 | 127 | ||
119 | cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \ | 128 | cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \ |
diff --git a/arch/mips/bcm63xx/irq.c b/arch/mips/bcm63xx/irq.c index 37eb2d1fa69a..b94bf44d8d8e 100644 --- a/arch/mips/bcm63xx/irq.c +++ b/arch/mips/bcm63xx/irq.c | |||
@@ -434,7 +434,7 @@ static void bcm63xx_init_irq(void) | |||
434 | irq_stat_addr[0] += PERF_IRQSTAT_3368_REG; | 434 | irq_stat_addr[0] += PERF_IRQSTAT_3368_REG; |
435 | irq_mask_addr[0] += PERF_IRQMASK_3368_REG; | 435 | irq_mask_addr[0] += PERF_IRQMASK_3368_REG; |
436 | irq_stat_addr[1] = 0; | 436 | irq_stat_addr[1] = 0; |
437 | irq_stat_addr[1] = 0; | 437 | irq_mask_addr[1] = 0; |
438 | irq_bits = 32; | 438 | irq_bits = 32; |
439 | ext_irq_count = 4; | 439 | ext_irq_count = 4; |
440 | ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368; | 440 | ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368; |
@@ -443,7 +443,7 @@ static void bcm63xx_init_irq(void) | |||
443 | irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0); | 443 | irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0); |
444 | irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0); | 444 | irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0); |
445 | irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1); | 445 | irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1); |
446 | irq_stat_addr[1] += PERF_IRQMASK_6328_REG(1); | 446 | irq_mask_addr[1] += PERF_IRQMASK_6328_REG(1); |
447 | irq_bits = 64; | 447 | irq_bits = 64; |
448 | ext_irq_count = 4; | 448 | ext_irq_count = 4; |
449 | is_ext_irq_cascaded = 1; | 449 | is_ext_irq_cascaded = 1; |
diff --git a/arch/mips/boot/compressed/decompress.c b/arch/mips/boot/compressed/decompress.c index b49c7adbfa89..31903cf9709d 100644 --- a/arch/mips/boot/compressed/decompress.c +++ b/arch/mips/boot/compressed/decompress.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/string.h> | ||
16 | 17 | ||
17 | #include <asm/addrspace.h> | 18 | #include <asm/addrspace.h> |
18 | 19 | ||
diff --git a/arch/mips/include/asm/cop2.h b/arch/mips/include/asm/cop2.h index d0352983b94d..51f80bd36fcc 100644 --- a/arch/mips/include/asm/cop2.h +++ b/arch/mips/include/asm/cop2.h | |||
@@ -16,8 +16,8 @@ | |||
16 | extern void octeon_cop2_save(struct octeon_cop2_state *); | 16 | extern void octeon_cop2_save(struct octeon_cop2_state *); |
17 | extern void octeon_cop2_restore(struct octeon_cop2_state *); | 17 | extern void octeon_cop2_restore(struct octeon_cop2_state *); |
18 | 18 | ||
19 | #define cop2_save(r) octeon_cop2_save(r) | 19 | #define cop2_save(r) octeon_cop2_save(&(r)->thread.cp2) |
20 | #define cop2_restore(r) octeon_cop2_restore(r) | 20 | #define cop2_restore(r) octeon_cop2_restore(&(r)->thread.cp2) |
21 | 21 | ||
22 | #define cop2_present 1 | 22 | #define cop2_present 1 |
23 | #define cop2_lazy_restore 1 | 23 | #define cop2_lazy_restore 1 |
@@ -26,26 +26,26 @@ extern void octeon_cop2_restore(struct octeon_cop2_state *); | |||
26 | 26 | ||
27 | extern void nlm_cop2_save(struct nlm_cop2_state *); | 27 | extern void nlm_cop2_save(struct nlm_cop2_state *); |
28 | extern void nlm_cop2_restore(struct nlm_cop2_state *); | 28 | extern void nlm_cop2_restore(struct nlm_cop2_state *); |
29 | #define cop2_save(r) nlm_cop2_save(r) | 29 | |
30 | #define cop2_restore(r) nlm_cop2_restore(r) | 30 | #define cop2_save(r) nlm_cop2_save(&(r)->thread.cp2) |
31 | #define cop2_restore(r) nlm_cop2_restore(&(r)->thread.cp2) | ||
31 | 32 | ||
32 | #define cop2_present 1 | 33 | #define cop2_present 1 |
33 | #define cop2_lazy_restore 0 | 34 | #define cop2_lazy_restore 0 |
34 | 35 | ||
35 | #elif defined(CONFIG_CPU_LOONGSON3) | 36 | #elif defined(CONFIG_CPU_LOONGSON3) |
36 | 37 | ||
37 | #define cop2_save(r) | ||
38 | #define cop2_restore(r) | ||
39 | |||
40 | #define cop2_present 1 | 38 | #define cop2_present 1 |
41 | #define cop2_lazy_restore 1 | 39 | #define cop2_lazy_restore 1 |
40 | #define cop2_save(r) do { (r); } while (0) | ||
41 | #define cop2_restore(r) do { (r); } while (0) | ||
42 | 42 | ||
43 | #else | 43 | #else |
44 | 44 | ||
45 | #define cop2_present 0 | 45 | #define cop2_present 0 |
46 | #define cop2_lazy_restore 0 | 46 | #define cop2_lazy_restore 0 |
47 | #define cop2_save(r) | 47 | #define cop2_save(r) do { (r); } while (0) |
48 | #define cop2_restore(r) | 48 | #define cop2_restore(r) do { (r); } while (0) |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | enum cu2_ops { | 51 | enum cu2_ops { |
diff --git a/arch/mips/include/asm/mach-ip28/spaces.h b/arch/mips/include/asm/mach-ip28/spaces.h index 5d6a76434d00..c4a912733b65 100644 --- a/arch/mips/include/asm/mach-ip28/spaces.h +++ b/arch/mips/include/asm/mach-ip28/spaces.h | |||
@@ -11,15 +11,8 @@ | |||
11 | #ifndef _ASM_MACH_IP28_SPACES_H | 11 | #ifndef _ASM_MACH_IP28_SPACES_H |
12 | #define _ASM_MACH_IP28_SPACES_H | 12 | #define _ASM_MACH_IP28_SPACES_H |
13 | 13 | ||
14 | #define CAC_BASE _AC(0xa800000000000000, UL) | ||
15 | |||
16 | #define HIGHMEM_START (~0UL) | ||
17 | |||
18 | #define PHYS_OFFSET _AC(0x20000000, UL) | 14 | #define PHYS_OFFSET _AC(0x20000000, UL) |
19 | 15 | ||
20 | #define UNCAC_BASE _AC(0xc0000000, UL) /* 0xa0000000 + PHYS_OFFSET */ | ||
21 | #define IO_BASE UNCAC_BASE | ||
22 | |||
23 | #include <asm/mach-generic/spaces.h> | 16 | #include <asm/mach-generic/spaces.h> |
24 | 17 | ||
25 | #endif /* _ASM_MACH_IP28_SPACES_H */ | 18 | #endif /* _ASM_MACH_IP28_SPACES_H */ |
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h index 5699ec3a71af..3be81803595d 100644 --- a/arch/mips/include/asm/page.h +++ b/arch/mips/include/asm/page.h | |||
@@ -37,7 +37,7 @@ | |||
37 | 37 | ||
38 | /* | 38 | /* |
39 | * This is used for calculating the real page sizes | 39 | * This is used for calculating the real page sizes |
40 | * for FTLB or VTLB + FTLB confugrations. | 40 | * for FTLB or VTLB + FTLB configurations. |
41 | */ | 41 | */ |
42 | static inline unsigned int page_size_ftlb(unsigned int mmuextdef) | 42 | static inline unsigned int page_size_ftlb(unsigned int mmuextdef) |
43 | { | 43 | { |
@@ -223,7 +223,8 @@ static inline int pfn_valid(unsigned long pfn) | |||
223 | 223 | ||
224 | #endif | 224 | #endif |
225 | 225 | ||
226 | #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) | 226 | #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \ |
227 | (kaddr)))) | ||
227 | 228 | ||
228 | extern int __virt_addr_valid(const volatile void *kaddr); | 229 | extern int __virt_addr_valid(const volatile void *kaddr); |
229 | #define virt_addr_valid(kaddr) \ | 230 | #define virt_addr_valid(kaddr) \ |
diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h index 1e0f20a9cdda..eacf865d21c2 100644 --- a/arch/mips/include/asm/smp.h +++ b/arch/mips/include/asm/smp.h | |||
@@ -37,11 +37,6 @@ extern int __cpu_logical_map[NR_CPUS]; | |||
37 | 37 | ||
38 | #define NO_PROC_ID (-1) | 38 | #define NO_PROC_ID (-1) |
39 | 39 | ||
40 | #define topology_physical_package_id(cpu) (cpu_data[cpu].package) | ||
41 | #define topology_core_id(cpu) (cpu_data[cpu].core) | ||
42 | #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) | ||
43 | #define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu]) | ||
44 | |||
45 | #define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */ | 40 | #define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */ |
46 | #define SMP_CALL_FUNCTION 0x2 | 41 | #define SMP_CALL_FUNCTION 0x2 |
47 | /* Octeon - Tell another core to flush its icache */ | 42 | /* Octeon - Tell another core to flush its icache */ |
diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h index 495c1041a2cc..b928b6f898cd 100644 --- a/arch/mips/include/asm/switch_to.h +++ b/arch/mips/include/asm/switch_to.h | |||
@@ -92,7 +92,7 @@ do { \ | |||
92 | KSTK_STATUS(prev) &= ~ST0_CU2; \ | 92 | KSTK_STATUS(prev) &= ~ST0_CU2; \ |
93 | __c0_stat = read_c0_status(); \ | 93 | __c0_stat = read_c0_status(); \ |
94 | write_c0_status(__c0_stat | ST0_CU2); \ | 94 | write_c0_status(__c0_stat | ST0_CU2); \ |
95 | cop2_save(&prev->thread.cp2); \ | 95 | cop2_save(prev); \ |
96 | write_c0_status(__c0_stat & ~ST0_CU2); \ | 96 | write_c0_status(__c0_stat & ~ST0_CU2); \ |
97 | } \ | 97 | } \ |
98 | __clear_software_ll_bit(); \ | 98 | __clear_software_ll_bit(); \ |
@@ -111,7 +111,7 @@ do { \ | |||
111 | (KSTK_STATUS(current) & ST0_CU2)) { \ | 111 | (KSTK_STATUS(current) & ST0_CU2)) { \ |
112 | __c0_stat = read_c0_status(); \ | 112 | __c0_stat = read_c0_status(); \ |
113 | write_c0_status(__c0_stat | ST0_CU2); \ | 113 | write_c0_status(__c0_stat | ST0_CU2); \ |
114 | cop2_restore(¤t->thread.cp2); \ | 114 | cop2_restore(current); \ |
115 | write_c0_status(__c0_stat & ~ST0_CU2); \ | 115 | write_c0_status(__c0_stat & ~ST0_CU2); \ |
116 | } \ | 116 | } \ |
117 | if (cpu_has_dsp) \ | 117 | if (cpu_has_dsp) \ |
diff --git a/arch/mips/include/asm/topology.h b/arch/mips/include/asm/topology.h index 20ea4859c822..3e307ec2afba 100644 --- a/arch/mips/include/asm/topology.h +++ b/arch/mips/include/asm/topology.h | |||
@@ -9,5 +9,13 @@ | |||
9 | #define __ASM_TOPOLOGY_H | 9 | #define __ASM_TOPOLOGY_H |
10 | 10 | ||
11 | #include <topology.h> | 11 | #include <topology.h> |
12 | #include <linux/smp.h> | ||
13 | |||
14 | #ifdef CONFIG_SMP | ||
15 | #define topology_physical_package_id(cpu) (cpu_data[cpu].package) | ||
16 | #define topology_core_id(cpu) (cpu_data[cpu].core) | ||
17 | #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) | ||
18 | #define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu]) | ||
19 | #endif | ||
12 | 20 | ||
13 | #endif /* __ASM_TOPOLOGY_H */ | 21 | #endif /* __ASM_TOPOLOGY_H */ |
diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h index 9bc13eaf9d67..fdb4923777d1 100644 --- a/arch/mips/include/uapi/asm/unistd.h +++ b/arch/mips/include/uapi/asm/unistd.h | |||
@@ -373,16 +373,18 @@ | |||
373 | #define __NR_sched_getattr (__NR_Linux + 350) | 373 | #define __NR_sched_getattr (__NR_Linux + 350) |
374 | #define __NR_renameat2 (__NR_Linux + 351) | 374 | #define __NR_renameat2 (__NR_Linux + 351) |
375 | #define __NR_seccomp (__NR_Linux + 352) | 375 | #define __NR_seccomp (__NR_Linux + 352) |
376 | #define __NR_getrandom (__NR_Linux + 353) | ||
377 | #define __NR_memfd_create (__NR_Linux + 354) | ||
376 | 378 | ||
377 | /* | 379 | /* |
378 | * Offset of the last Linux o32 flavoured syscall | 380 | * Offset of the last Linux o32 flavoured syscall |
379 | */ | 381 | */ |
380 | #define __NR_Linux_syscalls 352 | 382 | #define __NR_Linux_syscalls 354 |
381 | 383 | ||
382 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 384 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
383 | 385 | ||
384 | #define __NR_O32_Linux 4000 | 386 | #define __NR_O32_Linux 4000 |
385 | #define __NR_O32_Linux_syscalls 352 | 387 | #define __NR_O32_Linux_syscalls 354 |
386 | 388 | ||
387 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 389 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
388 | 390 | ||
@@ -703,16 +705,18 @@ | |||
703 | #define __NR_sched_getattr (__NR_Linux + 310) | 705 | #define __NR_sched_getattr (__NR_Linux + 310) |
704 | #define __NR_renameat2 (__NR_Linux + 311) | 706 | #define __NR_renameat2 (__NR_Linux + 311) |
705 | #define __NR_seccomp (__NR_Linux + 312) | 707 | #define __NR_seccomp (__NR_Linux + 312) |
708 | #define __NR_getrandom (__NR_Linux + 313) | ||
709 | #define __NR_memfd_create (__NR_Linux + 314) | ||
706 | 710 | ||
707 | /* | 711 | /* |
708 | * Offset of the last Linux 64-bit flavoured syscall | 712 | * Offset of the last Linux 64-bit flavoured syscall |
709 | */ | 713 | */ |
710 | #define __NR_Linux_syscalls 312 | 714 | #define __NR_Linux_syscalls 314 |
711 | 715 | ||
712 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 716 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
713 | 717 | ||
714 | #define __NR_64_Linux 5000 | 718 | #define __NR_64_Linux 5000 |
715 | #define __NR_64_Linux_syscalls 312 | 719 | #define __NR_64_Linux_syscalls 314 |
716 | 720 | ||
717 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 721 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
718 | 722 | ||
@@ -1037,15 +1041,17 @@ | |||
1037 | #define __NR_sched_getattr (__NR_Linux + 314) | 1041 | #define __NR_sched_getattr (__NR_Linux + 314) |
1038 | #define __NR_renameat2 (__NR_Linux + 315) | 1042 | #define __NR_renameat2 (__NR_Linux + 315) |
1039 | #define __NR_seccomp (__NR_Linux + 316) | 1043 | #define __NR_seccomp (__NR_Linux + 316) |
1044 | #define __NR_getrandom (__NR_Linux + 317) | ||
1045 | #define __NR_memfd_create (__NR_Linux + 318) | ||
1040 | 1046 | ||
1041 | /* | 1047 | /* |
1042 | * Offset of the last N32 flavoured syscall | 1048 | * Offset of the last N32 flavoured syscall |
1043 | */ | 1049 | */ |
1044 | #define __NR_Linux_syscalls 316 | 1050 | #define __NR_Linux_syscalls 318 |
1045 | 1051 | ||
1046 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 1052 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
1047 | 1053 | ||
1048 | #define __NR_N32_Linux 6000 | 1054 | #define __NR_N32_Linux 6000 |
1049 | #define __NR_N32_Linux_syscalls 316 | 1055 | #define __NR_N32_Linux_syscalls 318 |
1050 | 1056 | ||
1051 | #endif /* _UAPI_ASM_UNISTD_H */ | 1057 | #endif /* _UAPI_ASM_UNISTD_H */ |
diff --git a/arch/mips/kernel/machine_kexec.c b/arch/mips/kernel/machine_kexec.c index 992e18474da5..50980bf3983e 100644 --- a/arch/mips/kernel/machine_kexec.c +++ b/arch/mips/kernel/machine_kexec.c | |||
@@ -71,8 +71,12 @@ machine_kexec(struct kimage *image) | |||
71 | kexec_start_address = | 71 | kexec_start_address = |
72 | (unsigned long) phys_to_virt(image->start); | 72 | (unsigned long) phys_to_virt(image->start); |
73 | 73 | ||
74 | kexec_indirection_page = | 74 | if (image->type == KEXEC_TYPE_DEFAULT) { |
75 | (unsigned long) phys_to_virt(image->head & PAGE_MASK); | 75 | kexec_indirection_page = |
76 | (unsigned long) phys_to_virt(image->head & PAGE_MASK); | ||
77 | } else { | ||
78 | kexec_indirection_page = (unsigned long)&image->head; | ||
79 | } | ||
76 | 80 | ||
77 | memcpy((void*)reboot_code_buffer, relocate_new_kernel, | 81 | memcpy((void*)reboot_code_buffer, relocate_new_kernel, |
78 | relocate_new_kernel_size); | 82 | relocate_new_kernel_size); |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index f93b4cbec739..744cd10ba599 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -577,3 +577,5 @@ EXPORT(sys_call_table) | |||
577 | PTR sys_sched_getattr /* 4350 */ | 577 | PTR sys_sched_getattr /* 4350 */ |
578 | PTR sys_renameat2 | 578 | PTR sys_renameat2 |
579 | PTR sys_seccomp | 579 | PTR sys_seccomp |
580 | PTR sys_getrandom | ||
581 | PTR sys_memfd_create | ||
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 03ebd9979ad2..002b1bc09c38 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -432,4 +432,6 @@ EXPORT(sys_call_table) | |||
432 | PTR sys_sched_getattr /* 5310 */ | 432 | PTR sys_sched_getattr /* 5310 */ |
433 | PTR sys_renameat2 | 433 | PTR sys_renameat2 |
434 | PTR sys_seccomp | 434 | PTR sys_seccomp |
435 | PTR sys_getrandom | ||
436 | PTR sys_memfd_create | ||
435 | .size sys_call_table,.-sys_call_table | 437 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index ebc9228e2e15..ca6cbbe9805b 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -425,4 +425,6 @@ EXPORT(sysn32_call_table) | |||
425 | PTR sys_sched_getattr | 425 | PTR sys_sched_getattr |
426 | PTR sys_renameat2 /* 6315 */ | 426 | PTR sys_renameat2 /* 6315 */ |
427 | PTR sys_seccomp | 427 | PTR sys_seccomp |
428 | PTR sys_getrandom | ||
429 | PTR sys_memfd_create | ||
428 | .size sysn32_call_table,.-sysn32_call_table | 430 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 25bb8400156d..9e10d11fbb84 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -562,4 +562,6 @@ EXPORT(sys32_call_table) | |||
562 | PTR sys_sched_getattr /* 4350 */ | 562 | PTR sys_sched_getattr /* 4350 */ |
563 | PTR sys_renameat2 | 563 | PTR sys_renameat2 |
564 | PTR sys_seccomp | 564 | PTR sys_seccomp |
565 | PTR sys_getrandom | ||
566 | PTR sys_memfd_create | ||
565 | .size sys32_call_table,.-sys32_call_table | 567 | .size sys32_call_table,.-sys32_call_table |
diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c index 05a56619ece2..9f7ecbda250c 100644 --- a/arch/mips/net/bpf_jit.c +++ b/arch/mips/net/bpf_jit.c | |||
@@ -793,6 +793,7 @@ static int build_body(struct jit_ctx *ctx) | |||
793 | const struct sock_filter *inst; | 793 | const struct sock_filter *inst; |
794 | unsigned int i, off, load_order, condt; | 794 | unsigned int i, off, load_order, condt; |
795 | u32 k, b_off __maybe_unused; | 795 | u32 k, b_off __maybe_unused; |
796 | int tmp; | ||
796 | 797 | ||
797 | for (i = 0; i < prog->len; i++) { | 798 | for (i = 0; i < prog->len; i++) { |
798 | u16 code; | 799 | u16 code; |
@@ -1332,9 +1333,9 @@ jmp_cmp: | |||
1332 | case BPF_ANC | SKF_AD_PKTTYPE: | 1333 | case BPF_ANC | SKF_AD_PKTTYPE: |
1333 | ctx->flags |= SEEN_SKB; | 1334 | ctx->flags |= SEEN_SKB; |
1334 | 1335 | ||
1335 | off = pkt_type_offset(); | 1336 | tmp = off = pkt_type_offset(); |
1336 | 1337 | ||
1337 | if (off < 0) | 1338 | if (tmp < 0) |
1338 | return -1; | 1339 | return -1; |
1339 | emit_load_byte(r_tmp, r_skb, off, ctx); | 1340 | emit_load_byte(r_tmp, r_skb, off, ctx); |
1340 | /* Keep only the last 3 bits */ | 1341 | /* Keep only the last 3 bits */ |
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index f277184e2ac1..dca9842d8f91 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c | |||
@@ -1032,7 +1032,6 @@ struct boot_params *make_boot_params(struct efi_config *c) | |||
1032 | int i; | 1032 | int i; |
1033 | unsigned long ramdisk_addr; | 1033 | unsigned long ramdisk_addr; |
1034 | unsigned long ramdisk_size; | 1034 | unsigned long ramdisk_size; |
1035 | unsigned long initrd_addr_max; | ||
1036 | 1035 | ||
1037 | efi_early = c; | 1036 | efi_early = c; |
1038 | sys_table = (efi_system_table_t *)(unsigned long)efi_early->table; | 1037 | sys_table = (efi_system_table_t *)(unsigned long)efi_early->table; |
@@ -1095,15 +1094,20 @@ struct boot_params *make_boot_params(struct efi_config *c) | |||
1095 | 1094 | ||
1096 | memset(sdt, 0, sizeof(*sdt)); | 1095 | memset(sdt, 0, sizeof(*sdt)); |
1097 | 1096 | ||
1098 | if (hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) | ||
1099 | initrd_addr_max = -1UL; | ||
1100 | else | ||
1101 | initrd_addr_max = hdr->initrd_addr_max; | ||
1102 | |||
1103 | status = handle_cmdline_files(sys_table, image, | 1097 | status = handle_cmdline_files(sys_table, image, |
1104 | (char *)(unsigned long)hdr->cmd_line_ptr, | 1098 | (char *)(unsigned long)hdr->cmd_line_ptr, |
1105 | "initrd=", initrd_addr_max, | 1099 | "initrd=", hdr->initrd_addr_max, |
1106 | &ramdisk_addr, &ramdisk_size); | 1100 | &ramdisk_addr, &ramdisk_size); |
1101 | |||
1102 | if (status != EFI_SUCCESS && | ||
1103 | hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) { | ||
1104 | efi_printk(sys_table, "Trying to load files to higher address\n"); | ||
1105 | status = handle_cmdline_files(sys_table, image, | ||
1106 | (char *)(unsigned long)hdr->cmd_line_ptr, | ||
1107 | "initrd=", -1UL, | ||
1108 | &ramdisk_addr, &ramdisk_size); | ||
1109 | } | ||
1110 | |||
1107 | if (status != EFI_SUCCESS) | 1111 | if (status != EFI_SUCCESS) |
1108 | goto fail2; | 1112 | goto fail2; |
1109 | hdr->ramdisk_image = ramdisk_addr & 0xffffffff; | 1113 | hdr->ramdisk_image = ramdisk_addr & 0xffffffff; |
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index cbed1407a5cd..d6b8aa4c986c 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S | |||
@@ -30,6 +30,33 @@ | |||
30 | #include <asm/boot.h> | 30 | #include <asm/boot.h> |
31 | #include <asm/asm-offsets.h> | 31 | #include <asm/asm-offsets.h> |
32 | 32 | ||
33 | /* | ||
34 | * Adjust our own GOT | ||
35 | * | ||
36 | * The relocation base must be in %ebx | ||
37 | * | ||
38 | * It is safe to call this macro more than once, because in some of the | ||
39 | * code paths multiple invocations are inevitable, e.g. via the efi* | ||
40 | * entry points. | ||
41 | * | ||
42 | * Relocation is only performed the first time. | ||
43 | */ | ||
44 | .macro FIXUP_GOT | ||
45 | cmpb $1, got_fixed(%ebx) | ||
46 | je 2f | ||
47 | |||
48 | leal _got(%ebx), %edx | ||
49 | leal _egot(%ebx), %ecx | ||
50 | 1: | ||
51 | cmpl %ecx, %edx | ||
52 | jae 2f | ||
53 | addl %ebx, (%edx) | ||
54 | addl $4, %edx | ||
55 | jmp 1b | ||
56 | 2: | ||
57 | movb $1, got_fixed(%ebx) | ||
58 | .endm | ||
59 | |||
33 | __HEAD | 60 | __HEAD |
34 | ENTRY(startup_32) | 61 | ENTRY(startup_32) |
35 | #ifdef CONFIG_EFI_STUB | 62 | #ifdef CONFIG_EFI_STUB |
@@ -56,6 +83,9 @@ ENTRY(efi_pe_entry) | |||
56 | add %esi, 88(%eax) | 83 | add %esi, 88(%eax) |
57 | pushl %eax | 84 | pushl %eax |
58 | 85 | ||
86 | movl %esi, %ebx | ||
87 | FIXUP_GOT | ||
88 | |||
59 | call make_boot_params | 89 | call make_boot_params |
60 | cmpl $0, %eax | 90 | cmpl $0, %eax |
61 | je fail | 91 | je fail |
@@ -81,6 +111,10 @@ ENTRY(efi32_stub_entry) | |||
81 | leal efi32_config(%esi), %eax | 111 | leal efi32_config(%esi), %eax |
82 | add %esi, 88(%eax) | 112 | add %esi, 88(%eax) |
83 | pushl %eax | 113 | pushl %eax |
114 | |||
115 | movl %esi, %ebx | ||
116 | FIXUP_GOT | ||
117 | |||
84 | 2: | 118 | 2: |
85 | call efi_main | 119 | call efi_main |
86 | cmpl $0, %eax | 120 | cmpl $0, %eax |
@@ -190,19 +224,7 @@ relocated: | |||
190 | shrl $2, %ecx | 224 | shrl $2, %ecx |
191 | rep stosl | 225 | rep stosl |
192 | 226 | ||
193 | /* | 227 | FIXUP_GOT |
194 | * Adjust our own GOT | ||
195 | */ | ||
196 | leal _got(%ebx), %edx | ||
197 | leal _egot(%ebx), %ecx | ||
198 | 1: | ||
199 | cmpl %ecx, %edx | ||
200 | jae 2f | ||
201 | addl %ebx, (%edx) | ||
202 | addl $4, %edx | ||
203 | jmp 1b | ||
204 | 2: | ||
205 | |||
206 | /* | 228 | /* |
207 | * Do the decompression, and jump to the new kernel.. | 229 | * Do the decompression, and jump to the new kernel.. |
208 | */ | 230 | */ |
@@ -225,8 +247,12 @@ relocated: | |||
225 | xorl %ebx, %ebx | 247 | xorl %ebx, %ebx |
226 | jmp *%eax | 248 | jmp *%eax |
227 | 249 | ||
228 | #ifdef CONFIG_EFI_STUB | ||
229 | .data | 250 | .data |
251 | /* Have we relocated the GOT? */ | ||
252 | got_fixed: | ||
253 | .byte 0 | ||
254 | |||
255 | #ifdef CONFIG_EFI_STUB | ||
230 | efi32_config: | 256 | efi32_config: |
231 | .fill 11,8,0 | 257 | .fill 11,8,0 |
232 | .long efi_call_phys | 258 | .long efi_call_phys |
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 2884e0c3e8a5..50f69c7eaaf4 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S | |||
@@ -32,6 +32,33 @@ | |||
32 | #include <asm/processor-flags.h> | 32 | #include <asm/processor-flags.h> |
33 | #include <asm/asm-offsets.h> | 33 | #include <asm/asm-offsets.h> |
34 | 34 | ||
35 | /* | ||
36 | * Adjust our own GOT | ||
37 | * | ||
38 | * The relocation base must be in %rbx | ||
39 | * | ||
40 | * It is safe to call this macro more than once, because in some of the | ||
41 | * code paths multiple invocations are inevitable, e.g. via the efi* | ||
42 | * entry points. | ||
43 | * | ||
44 | * Relocation is only performed the first time. | ||
45 | */ | ||
46 | .macro FIXUP_GOT | ||
47 | cmpb $1, got_fixed(%rip) | ||
48 | je 2f | ||
49 | |||
50 | leaq _got(%rip), %rdx | ||
51 | leaq _egot(%rip), %rcx | ||
52 | 1: | ||
53 | cmpq %rcx, %rdx | ||
54 | jae 2f | ||
55 | addq %rbx, (%rdx) | ||
56 | addq $8, %rdx | ||
57 | jmp 1b | ||
58 | 2: | ||
59 | movb $1, got_fixed(%rip) | ||
60 | .endm | ||
61 | |||
35 | __HEAD | 62 | __HEAD |
36 | .code32 | 63 | .code32 |
37 | ENTRY(startup_32) | 64 | ENTRY(startup_32) |
@@ -252,10 +279,13 @@ ENTRY(efi_pe_entry) | |||
252 | subq $1b, %rbp | 279 | subq $1b, %rbp |
253 | 280 | ||
254 | /* | 281 | /* |
255 | * Relocate efi_config->call(). | 282 | * Relocate efi_config->call() and the GOT entries. |
256 | */ | 283 | */ |
257 | addq %rbp, efi64_config+88(%rip) | 284 | addq %rbp, efi64_config+88(%rip) |
258 | 285 | ||
286 | movq %rbp, %rbx | ||
287 | FIXUP_GOT | ||
288 | |||
259 | movq %rax, %rdi | 289 | movq %rax, %rdi |
260 | call make_boot_params | 290 | call make_boot_params |
261 | cmpq $0,%rax | 291 | cmpq $0,%rax |
@@ -271,10 +301,13 @@ handover_entry: | |||
271 | subq $1b, %rbp | 301 | subq $1b, %rbp |
272 | 302 | ||
273 | /* | 303 | /* |
274 | * Relocate efi_config->call(). | 304 | * Relocate efi_config->call() and the GOT entries. |
275 | */ | 305 | */ |
276 | movq efi_config(%rip), %rax | 306 | movq efi_config(%rip), %rax |
277 | addq %rbp, 88(%rax) | 307 | addq %rbp, 88(%rax) |
308 | |||
309 | movq %rbp, %rbx | ||
310 | FIXUP_GOT | ||
278 | 2: | 311 | 2: |
279 | movq efi_config(%rip), %rdi | 312 | movq efi_config(%rip), %rdi |
280 | call efi_main | 313 | call efi_main |
@@ -385,19 +418,8 @@ relocated: | |||
385 | shrq $3, %rcx | 418 | shrq $3, %rcx |
386 | rep stosq | 419 | rep stosq |
387 | 420 | ||
388 | /* | 421 | FIXUP_GOT |
389 | * Adjust our own GOT | 422 | |
390 | */ | ||
391 | leaq _got(%rip), %rdx | ||
392 | leaq _egot(%rip), %rcx | ||
393 | 1: | ||
394 | cmpq %rcx, %rdx | ||
395 | jae 2f | ||
396 | addq %rbx, (%rdx) | ||
397 | addq $8, %rdx | ||
398 | jmp 1b | ||
399 | 2: | ||
400 | |||
401 | /* | 423 | /* |
402 | * Do the decompression, and jump to the new kernel.. | 424 | * Do the decompression, and jump to the new kernel.. |
403 | */ | 425 | */ |
@@ -437,6 +459,10 @@ gdt: | |||
437 | .quad 0x0000000000000000 /* TS continued */ | 459 | .quad 0x0000000000000000 /* TS continued */ |
438 | gdt_end: | 460 | gdt_end: |
439 | 461 | ||
462 | /* Have we relocated the GOT? */ | ||
463 | got_fixed: | ||
464 | .byte 0 | ||
465 | |||
440 | #ifdef CONFIG_EFI_STUB | 466 | #ifdef CONFIG_EFI_STUB |
441 | efi_config: | 467 | efi_config: |
442 | .quad 0 | 468 | .quad 0 |
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index 478c490f3654..1733ab49ac5e 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
@@ -239,6 +239,7 @@ static inline int mp_find_ioapic(u32 gsi) { return 0; } | |||
239 | static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; } | 239 | static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; } |
240 | static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags) { return gsi; } | 240 | static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags) { return gsi; } |
241 | static inline void mp_unmap_irq(int irq) { } | 241 | static inline void mp_unmap_irq(int irq) { } |
242 | static inline bool mp_should_keep_irq(struct device *dev) { return 1; } | ||
242 | 243 | ||
243 | static inline int save_ioapic_entries(void) | 244 | static inline int save_ioapic_entries(void) |
244 | { | 245 | { |
diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c index f304773285ae..f1314d0bcf0a 100644 --- a/arch/x86/kernel/kprobes/opt.c +++ b/arch/x86/kernel/kprobes/opt.c | |||
@@ -338,8 +338,10 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op) | |||
338 | * a relative jump. | 338 | * a relative jump. |
339 | */ | 339 | */ |
340 | rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE; | 340 | rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE; |
341 | if (abs(rel) > 0x7fffffff) | 341 | if (abs(rel) > 0x7fffffff) { |
342 | __arch_remove_optimized_kprobe(op, 0); | ||
342 | return -ERANGE; | 343 | return -ERANGE; |
344 | } | ||
343 | 345 | ||
344 | buf = (u8 *)op->optinsn.insn; | 346 | buf = (u8 *)op->optinsn.insn; |
345 | 347 | ||
diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index 167ffcac16ed..95a427e57887 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch/x86/mm/dump_pagetables.c | |||
@@ -48,7 +48,9 @@ enum address_markers_idx { | |||
48 | LOW_KERNEL_NR, | 48 | LOW_KERNEL_NR, |
49 | VMALLOC_START_NR, | 49 | VMALLOC_START_NR, |
50 | VMEMMAP_START_NR, | 50 | VMEMMAP_START_NR, |
51 | # ifdef CONFIG_X86_ESPFIX64 | ||
51 | ESPFIX_START_NR, | 52 | ESPFIX_START_NR, |
53 | # endif | ||
52 | HIGH_KERNEL_NR, | 54 | HIGH_KERNEL_NR, |
53 | MODULES_VADDR_NR, | 55 | MODULES_VADDR_NR, |
54 | MODULES_END_NR, | 56 | MODULES_END_NR, |
@@ -71,7 +73,9 @@ static struct addr_marker address_markers[] = { | |||
71 | { PAGE_OFFSET, "Low Kernel Mapping" }, | 73 | { PAGE_OFFSET, "Low Kernel Mapping" }, |
72 | { VMALLOC_START, "vmalloc() Area" }, | 74 | { VMALLOC_START, "vmalloc() Area" }, |
73 | { VMEMMAP_START, "Vmemmap" }, | 75 | { VMEMMAP_START, "Vmemmap" }, |
76 | # ifdef CONFIG_X86_ESPFIX64 | ||
74 | { ESPFIX_BASE_ADDR, "ESPfix Area", 16 }, | 77 | { ESPFIX_BASE_ADDR, "ESPfix Area", 16 }, |
78 | # endif | ||
75 | { __START_KERNEL_map, "High Kernel Mapping" }, | 79 | { __START_KERNEL_map, "High Kernel Mapping" }, |
76 | { MODULES_VADDR, "Modules" }, | 80 | { MODULES_VADDR, "Modules" }, |
77 | { MODULES_END, "End Modules" }, | 81 | { MODULES_END, "End Modules" }, |
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c index 25e7e1372bb2..919b91205cd4 100644 --- a/arch/x86/mm/mmap.c +++ b/arch/x86/mm/mmap.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <linux/sched.h> | 31 | #include <linux/sched.h> |
32 | #include <asm/elf.h> | 32 | #include <asm/elf.h> |
33 | 33 | ||
34 | struct __read_mostly va_alignment va_align = { | 34 | struct va_alignment __read_mostly va_align = { |
35 | .flags = -1, | 35 | .flags = -1, |
36 | }; | 36 | }; |
37 | 37 | ||
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index c61ea57d1ba1..9a2b7101ae8a 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c | |||
@@ -326,27 +326,6 @@ static void pci_fixup_video(struct pci_dev *pdev) | |||
326 | struct pci_bus *bus; | 326 | struct pci_bus *bus; |
327 | u16 config; | 327 | u16 config; |
328 | 328 | ||
329 | if (!vga_default_device()) { | ||
330 | resource_size_t start, end; | ||
331 | int i; | ||
332 | |||
333 | /* Does firmware framebuffer belong to us? */ | ||
334 | for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { | ||
335 | if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM)) | ||
336 | continue; | ||
337 | |||
338 | start = pci_resource_start(pdev, i); | ||
339 | end = pci_resource_end(pdev, i); | ||
340 | |||
341 | if (!start || !end) | ||
342 | continue; | ||
343 | |||
344 | if (screen_info.lfb_base >= start && | ||
345 | (screen_info.lfb_base + screen_info.lfb_size) < end) | ||
346 | vga_set_default_device(pdev); | ||
347 | } | ||
348 | } | ||
349 | |||
350 | /* Is VGA routed to us? */ | 329 | /* Is VGA routed to us? */ |
351 | bus = pdev->bus; | 330 | bus = pdev->bus; |
352 | while (bus) { | 331 | while (bus) { |
@@ -371,8 +350,7 @@ static void pci_fixup_video(struct pci_dev *pdev) | |||
371 | pci_read_config_word(pdev, PCI_COMMAND, &config); | 350 | pci_read_config_word(pdev, PCI_COMMAND, &config); |
372 | if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { | 351 | if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { |
373 | pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; | 352 | pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; |
374 | dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); | 353 | dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n"); |
375 | vga_set_default_device(pdev); | ||
376 | } | 354 | } |
377 | } | 355 | } |
378 | } | 356 | } |
diff --git a/crypto/drbg.c b/crypto/drbg.c index 7894db9ca90b..a53ee099e281 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c | |||
@@ -1922,9 +1922,6 @@ static inline int __init drbg_healthcheck_sanity(void) | |||
1922 | /* overflow max addtllen with personalization string */ | 1922 | /* overflow max addtllen with personalization string */ |
1923 | ret = drbg_instantiate(drbg, &addtl, coreref, pr); | 1923 | ret = drbg_instantiate(drbg, &addtl, coreref, pr); |
1924 | BUG_ON(0 == ret); | 1924 | BUG_ON(0 == ret); |
1925 | /* test uninstantated DRBG */ | ||
1926 | len = drbg_generate(drbg, buf, (max_request_bytes + 1), NULL); | ||
1927 | BUG_ON(0 < len); | ||
1928 | /* all tests passed */ | 1925 | /* all tests passed */ |
1929 | rc = 0; | 1926 | rc = 0; |
1930 | 1927 | ||
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 8581f5b84f48..8b67bd0f6bb5 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -177,16 +177,6 @@ void acpi_bus_detach_private_data(acpi_handle handle) | |||
177 | } | 177 | } |
178 | EXPORT_SYMBOL_GPL(acpi_bus_detach_private_data); | 178 | EXPORT_SYMBOL_GPL(acpi_bus_detach_private_data); |
179 | 179 | ||
180 | void acpi_bus_no_hotplug(acpi_handle handle) | ||
181 | { | ||
182 | struct acpi_device *adev = NULL; | ||
183 | |||
184 | acpi_bus_get_device(handle, &adev); | ||
185 | if (adev) | ||
186 | adev->flags.no_hotplug = true; | ||
187 | } | ||
188 | EXPORT_SYMBOL_GPL(acpi_bus_no_hotplug); | ||
189 | |||
190 | static void acpi_print_osc_error(acpi_handle handle, | 180 | static void acpi_print_osc_error(acpi_handle handle, |
191 | struct acpi_osc_context *context, char *error) | 181 | struct acpi_osc_context *context, char *error) |
192 | { | 182 | { |
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index 65ea7b256b3e..0c94b661c16f 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c | |||
@@ -512,7 +512,14 @@ void regmap_debugfs_init(struct regmap *map, const char *name) | |||
512 | map, ®map_reg_ranges_fops); | 512 | map, ®map_reg_ranges_fops); |
513 | 513 | ||
514 | if (map->max_register || regmap_readable(map, 0)) { | 514 | if (map->max_register || regmap_readable(map, 0)) { |
515 | debugfs_create_file("registers", 0400, map->debugfs, | 515 | umode_t registers_mode; |
516 | |||
517 | if (IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS)) | ||
518 | registers_mode = 0600; | ||
519 | else | ||
520 | registers_mode = 0400; | ||
521 | |||
522 | debugfs_create_file("registers", registers_mode, map->debugfs, | ||
516 | map, ®map_map_fops); | 523 | map, ®map_map_fops); |
517 | debugfs_create_file("access", 0400, map->debugfs, | 524 | debugfs_create_file("access", 0400, map->debugfs, |
518 | map, ®map_access_fops); | 525 | map, ®map_access_fops); |
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index 2e3139eda93b..132c9ccfdc62 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c | |||
@@ -36,6 +36,7 @@ struct virtrng_info { | |||
36 | int index; | 36 | int index; |
37 | bool busy; | 37 | bool busy; |
38 | bool hwrng_register_done; | 38 | bool hwrng_register_done; |
39 | bool hwrng_removed; | ||
39 | }; | 40 | }; |
40 | 41 | ||
41 | 42 | ||
@@ -68,6 +69,9 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) | |||
68 | int ret; | 69 | int ret; |
69 | struct virtrng_info *vi = (struct virtrng_info *)rng->priv; | 70 | struct virtrng_info *vi = (struct virtrng_info *)rng->priv; |
70 | 71 | ||
72 | if (vi->hwrng_removed) | ||
73 | return -ENODEV; | ||
74 | |||
71 | if (!vi->busy) { | 75 | if (!vi->busy) { |
72 | vi->busy = true; | 76 | vi->busy = true; |
73 | init_completion(&vi->have_data); | 77 | init_completion(&vi->have_data); |
@@ -137,6 +141,9 @@ static void remove_common(struct virtio_device *vdev) | |||
137 | { | 141 | { |
138 | struct virtrng_info *vi = vdev->priv; | 142 | struct virtrng_info *vi = vdev->priv; |
139 | 143 | ||
144 | vi->hwrng_removed = true; | ||
145 | vi->data_avail = 0; | ||
146 | complete(&vi->have_data); | ||
140 | vdev->config->reset(vdev); | 147 | vdev->config->reset(vdev); |
141 | vi->busy = false; | 148 | vi->busy = false; |
142 | if (vi->hwrng_register_done) | 149 | if (vi->hwrng_register_done) |
diff --git a/drivers/firmware/efi/libstub/fdt.c b/drivers/firmware/efi/libstub/fdt.c index a56bb3528755..c846a9608cbd 100644 --- a/drivers/firmware/efi/libstub/fdt.c +++ b/drivers/firmware/efi/libstub/fdt.c | |||
@@ -22,7 +22,7 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, | |||
22 | unsigned long map_size, unsigned long desc_size, | 22 | unsigned long map_size, unsigned long desc_size, |
23 | u32 desc_ver) | 23 | u32 desc_ver) |
24 | { | 24 | { |
25 | int node, prev; | 25 | int node, prev, num_rsv; |
26 | int status; | 26 | int status; |
27 | u32 fdt_val32; | 27 | u32 fdt_val32; |
28 | u64 fdt_val64; | 28 | u64 fdt_val64; |
@@ -73,6 +73,14 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, | |||
73 | prev = node; | 73 | prev = node; |
74 | } | 74 | } |
75 | 75 | ||
76 | /* | ||
77 | * Delete all memory reserve map entries. When booting via UEFI, | ||
78 | * kernel will use the UEFI memory map to find reserved regions. | ||
79 | */ | ||
80 | num_rsv = fdt_num_mem_rsv(fdt); | ||
81 | while (num_rsv-- > 0) | ||
82 | fdt_del_mem_rsv(fdt, num_rsv); | ||
83 | |||
76 | node = fdt_subnode_offset(fdt, 0, "chosen"); | 84 | node = fdt_subnode_offset(fdt, 0, "chosen"); |
77 | if (node < 0) { | 85 | if (node < 0) { |
78 | node = fdt_add_subnode(fdt, 0, "chosen"); | 86 | node = fdt_add_subnode(fdt, 0, "chosen"); |
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index 9d7346b92653..6b7efcf363d6 100644 --- a/drivers/gpu/drm/bochs/bochs_kms.c +++ b/drivers/gpu/drm/bochs/bochs_kms.c | |||
@@ -250,6 +250,7 @@ static void bochs_connector_init(struct drm_device *dev) | |||
250 | DRM_MODE_CONNECTOR_VIRTUAL); | 250 | DRM_MODE_CONNECTOR_VIRTUAL); |
251 | drm_connector_helper_add(connector, | 251 | drm_connector_helper_add(connector, |
252 | &bochs_connector_connector_helper_funcs); | 252 | &bochs_connector_connector_helper_funcs); |
253 | drm_connector_register(connector); | ||
253 | } | 254 | } |
254 | 255 | ||
255 | 256 | ||
diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index e1c5c3222129..c7c5a9d91fa0 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c | |||
@@ -555,6 +555,7 @@ static struct drm_connector *cirrus_vga_init(struct drm_device *dev) | |||
555 | 555 | ||
556 | drm_connector_helper_add(connector, &cirrus_vga_connector_helper_funcs); | 556 | drm_connector_helper_add(connector, &cirrus_vga_connector_helper_funcs); |
557 | 557 | ||
558 | drm_connector_register(connector); | ||
558 | return connector; | 559 | return connector; |
559 | } | 560 | } |
560 | 561 | ||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 81d7681faa63..fdff1d420c14 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -1631,6 +1631,10 @@ static void intel_dp_get_config(struct intel_encoder *encoder, | |||
1631 | 1631 | ||
1632 | pipe_config->adjusted_mode.flags |= flags; | 1632 | pipe_config->adjusted_mode.flags |= flags; |
1633 | 1633 | ||
1634 | if (!HAS_PCH_SPLIT(dev) && !IS_VALLEYVIEW(dev) && | ||
1635 | tmp & DP_COLOR_RANGE_16_235) | ||
1636 | pipe_config->limited_color_range = true; | ||
1637 | |||
1634 | pipe_config->has_dp_encoder = true; | 1638 | pipe_config->has_dp_encoder = true; |
1635 | 1639 | ||
1636 | intel_dp_get_m_n(crtc, pipe_config); | 1640 | intel_dp_get_m_n(crtc, pipe_config); |
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index f9151f6641d9..ca34de7f6a7b 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -712,7 +712,8 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, | |||
712 | struct intel_crtc_config *pipe_config) | 712 | struct intel_crtc_config *pipe_config) |
713 | { | 713 | { |
714 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); | 714 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); |
715 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | 715 | struct drm_device *dev = encoder->base.dev; |
716 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
716 | u32 tmp, flags = 0; | 717 | u32 tmp, flags = 0; |
717 | int dotclock; | 718 | int dotclock; |
718 | 719 | ||
@@ -734,6 +735,10 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, | |||
734 | if (tmp & HDMI_MODE_SELECT_HDMI) | 735 | if (tmp & HDMI_MODE_SELECT_HDMI) |
735 | pipe_config->has_audio = true; | 736 | pipe_config->has_audio = true; |
736 | 737 | ||
738 | if (!HAS_PCH_SPLIT(dev) && | ||
739 | tmp & HDMI_COLOR_RANGE_16_235) | ||
740 | pipe_config->limited_color_range = true; | ||
741 | |||
737 | pipe_config->adjusted_mode.flags |= flags; | 742 | pipe_config->adjusted_mode.flags |= flags; |
738 | 743 | ||
739 | if ((tmp & SDVO_COLOR_FORMAT_MASK) == HDMI_COLOR_FORMAT_12bpc) | 744 | if ((tmp & SDVO_COLOR_FORMAT_MASK) == HDMI_COLOR_FORMAT_12bpc) |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 2d068edd1adc..47a126a0493f 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -1400,7 +1400,7 @@ i830_dispatch_execbuffer(struct intel_engine_cs *ring, | |||
1400 | */ | 1400 | */ |
1401 | intel_ring_emit(ring, SRC_COPY_BLT_CMD | BLT_WRITE_RGBA); | 1401 | intel_ring_emit(ring, SRC_COPY_BLT_CMD | BLT_WRITE_RGBA); |
1402 | intel_ring_emit(ring, BLT_DEPTH_32 | BLT_ROP_SRC_COPY | 4096); | 1402 | intel_ring_emit(ring, BLT_DEPTH_32 | BLT_ROP_SRC_COPY | 4096); |
1403 | intel_ring_emit(ring, DIV_ROUND_UP(len, 4096) << 16 | 1024); | 1403 | intel_ring_emit(ring, DIV_ROUND_UP(len, 4096) << 16 | 4096); |
1404 | intel_ring_emit(ring, cs_offset); | 1404 | intel_ring_emit(ring, cs_offset); |
1405 | intel_ring_emit(ring, 4096); | 1405 | intel_ring_emit(ring, 4096); |
1406 | intel_ring_emit(ring, offset); | 1406 | intel_ring_emit(ring, offset); |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c index 0a44459844e3..05a278bab247 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c | |||
@@ -200,7 +200,6 @@ nvc0_bar_init(struct nouveau_object *object) | |||
200 | 200 | ||
201 | nv_mask(priv, 0x000200, 0x00000100, 0x00000000); | 201 | nv_mask(priv, 0x000200, 0x00000100, 0x00000000); |
202 | nv_mask(priv, 0x000200, 0x00000100, 0x00000100); | 202 | nv_mask(priv, 0x000200, 0x00000100, 0x00000100); |
203 | nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); | ||
204 | 203 | ||
205 | nv_wr32(priv, 0x001704, 0x80000000 | priv->bar[1].mem->addr >> 12); | 204 | nv_wr32(priv, 0x001704, 0x80000000 | priv->bar[1].mem->addr >> 12); |
206 | if (priv->bar[0].mem) | 205 | if (priv->bar[0].mem) |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c index b19a2b3c1081..32f28dc73ef2 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c | |||
@@ -60,6 +60,7 @@ nvc0_fb_init(struct nouveau_object *object) | |||
60 | 60 | ||
61 | if (priv->r100c10_page) | 61 | if (priv->r100c10_page) |
62 | nv_wr32(priv, 0x100c10, priv->r100c10 >> 8); | 62 | nv_wr32(priv, 0x100c10, priv->r100c10 >> 8); |
63 | nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */ | ||
63 | return 0; | 64 | return 0; |
64 | } | 65 | } |
65 | 66 | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c b/drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c index b54b582e72c4..d5d65285efe5 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c +++ b/drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c | |||
@@ -98,6 +98,7 @@ static int | |||
98 | gf100_ltc_init(struct nouveau_object *object) | 98 | gf100_ltc_init(struct nouveau_object *object) |
99 | { | 99 | { |
100 | struct nvkm_ltc_priv *priv = (void *)object; | 100 | struct nvkm_ltc_priv *priv = (void *)object; |
101 | u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); | ||
101 | int ret; | 102 | int ret; |
102 | 103 | ||
103 | ret = nvkm_ltc_init(priv); | 104 | ret = nvkm_ltc_init(priv); |
@@ -107,6 +108,7 @@ gf100_ltc_init(struct nouveau_object *object) | |||
107 | nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */ | 108 | nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */ |
108 | nv_wr32(priv, 0x17e8d8, priv->ltc_nr); | 109 | nv_wr32(priv, 0x17e8d8, priv->ltc_nr); |
109 | nv_wr32(priv, 0x17e8d4, priv->tag_base); | 110 | nv_wr32(priv, 0x17e8d4, priv->tag_base); |
111 | nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000); | ||
110 | return 0; | 112 | return 0; |
111 | } | 113 | } |
112 | 114 | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/ltc/gk104.c b/drivers/gpu/drm/nouveau/core/subdev/ltc/gk104.c index ea716569745d..b39b5d0eb8f9 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/ltc/gk104.c +++ b/drivers/gpu/drm/nouveau/core/subdev/ltc/gk104.c | |||
@@ -28,6 +28,7 @@ static int | |||
28 | gk104_ltc_init(struct nouveau_object *object) | 28 | gk104_ltc_init(struct nouveau_object *object) |
29 | { | 29 | { |
30 | struct nvkm_ltc_priv *priv = (void *)object; | 30 | struct nvkm_ltc_priv *priv = (void *)object; |
31 | u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); | ||
31 | int ret; | 32 | int ret; |
32 | 33 | ||
33 | ret = nvkm_ltc_init(priv); | 34 | ret = nvkm_ltc_init(priv); |
@@ -37,6 +38,7 @@ gk104_ltc_init(struct nouveau_object *object) | |||
37 | nv_wr32(priv, 0x17e8d8, priv->ltc_nr); | 38 | nv_wr32(priv, 0x17e8d8, priv->ltc_nr); |
38 | nv_wr32(priv, 0x17e000, priv->ltc_nr); | 39 | nv_wr32(priv, 0x17e000, priv->ltc_nr); |
39 | nv_wr32(priv, 0x17e8d4, priv->tag_base); | 40 | nv_wr32(priv, 0x17e8d4, priv->tag_base); |
41 | nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000); | ||
40 | return 0; | 42 | return 0; |
41 | } | 43 | } |
42 | 44 | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/ltc/gm107.c b/drivers/gpu/drm/nouveau/core/subdev/ltc/gm107.c index 4761b2e9af00..a4de64289762 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/ltc/gm107.c +++ b/drivers/gpu/drm/nouveau/core/subdev/ltc/gm107.c | |||
@@ -98,6 +98,7 @@ static int | |||
98 | gm107_ltc_init(struct nouveau_object *object) | 98 | gm107_ltc_init(struct nouveau_object *object) |
99 | { | 99 | { |
100 | struct nvkm_ltc_priv *priv = (void *)object; | 100 | struct nvkm_ltc_priv *priv = (void *)object; |
101 | u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); | ||
101 | int ret; | 102 | int ret; |
102 | 103 | ||
103 | ret = nvkm_ltc_init(priv); | 104 | ret = nvkm_ltc_init(priv); |
@@ -106,6 +107,7 @@ gm107_ltc_init(struct nouveau_object *object) | |||
106 | 107 | ||
107 | nv_wr32(priv, 0x17e27c, priv->ltc_nr); | 108 | nv_wr32(priv, 0x17e27c, priv->ltc_nr); |
108 | nv_wr32(priv, 0x17e278, priv->tag_base); | 109 | nv_wr32(priv, 0x17e278, priv->tag_base); |
110 | nv_mask(priv, 0x17e264, 0x00000002, lpg128 ? 0x00000002 : 0x00000000); | ||
109 | return 0; | 111 | return 0; |
110 | } | 112 | } |
111 | 113 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c index 279206997e5c..622424692b3b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c | |||
@@ -46,7 +46,6 @@ static struct nouveau_dsm_priv { | |||
46 | bool dsm_detected; | 46 | bool dsm_detected; |
47 | bool optimus_detected; | 47 | bool optimus_detected; |
48 | acpi_handle dhandle; | 48 | acpi_handle dhandle; |
49 | acpi_handle other_handle; | ||
50 | acpi_handle rom_handle; | 49 | acpi_handle rom_handle; |
51 | } nouveau_dsm_priv; | 50 | } nouveau_dsm_priv; |
52 | 51 | ||
@@ -222,10 +221,9 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev) | |||
222 | if (!dhandle) | 221 | if (!dhandle) |
223 | return false; | 222 | return false; |
224 | 223 | ||
225 | if (!acpi_has_method(dhandle, "_DSM")) { | 224 | if (!acpi_has_method(dhandle, "_DSM")) |
226 | nouveau_dsm_priv.other_handle = dhandle; | ||
227 | return false; | 225 | return false; |
228 | } | 226 | |
229 | if (acpi_check_dsm(dhandle, nouveau_dsm_muid, 0x00000102, | 227 | if (acpi_check_dsm(dhandle, nouveau_dsm_muid, 0x00000102, |
230 | 1 << NOUVEAU_DSM_POWER)) | 228 | 1 << NOUVEAU_DSM_POWER)) |
231 | retval |= NOUVEAU_DSM_HAS_MUX; | 229 | retval |= NOUVEAU_DSM_HAS_MUX; |
@@ -301,16 +299,6 @@ static bool nouveau_dsm_detect(void) | |||
301 | printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n", | 299 | printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n", |
302 | acpi_method_name); | 300 | acpi_method_name); |
303 | nouveau_dsm_priv.dsm_detected = true; | 301 | nouveau_dsm_priv.dsm_detected = true; |
304 | /* | ||
305 | * On some systems hotplug events are generated for the device | ||
306 | * being switched off when _DSM is executed. They cause ACPI | ||
307 | * hotplug to trigger and attempt to remove the device from | ||
308 | * the system, which causes it to break down. Prevent that from | ||
309 | * happening by setting the no_hotplug flag for the involved | ||
310 | * ACPI device objects. | ||
311 | */ | ||
312 | acpi_bus_no_hotplug(nouveau_dsm_priv.dhandle); | ||
313 | acpi_bus_no_hotplug(nouveau_dsm_priv.other_handle); | ||
314 | ret = true; | 302 | ret = true; |
315 | } | 303 | } |
316 | 304 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 250a5e88c751..9c3af96a7153 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
@@ -627,6 +627,7 @@ int nouveau_pmops_suspend(struct device *dev) | |||
627 | 627 | ||
628 | pci_save_state(pdev); | 628 | pci_save_state(pdev); |
629 | pci_disable_device(pdev); | 629 | pci_disable_device(pdev); |
630 | pci_ignore_hotplug(pdev); | ||
630 | pci_set_power_state(pdev, PCI_D3hot); | 631 | pci_set_power_state(pdev, PCI_D3hot); |
631 | return 0; | 632 | return 0; |
632 | } | 633 | } |
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c index 18d55d447248..c7592ec8ecb8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_vga.c +++ b/drivers/gpu/drm/nouveau/nouveau_vga.c | |||
@@ -108,7 +108,16 @@ void | |||
108 | nouveau_vga_fini(struct nouveau_drm *drm) | 108 | nouveau_vga_fini(struct nouveau_drm *drm) |
109 | { | 109 | { |
110 | struct drm_device *dev = drm->dev; | 110 | struct drm_device *dev = drm->dev; |
111 | bool runtime = false; | ||
112 | |||
113 | if (nouveau_runtime_pm == 1) | ||
114 | runtime = true; | ||
115 | if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm())) | ||
116 | runtime = true; | ||
117 | |||
111 | vga_switcheroo_unregister_client(dev->pdev); | 118 | vga_switcheroo_unregister_client(dev->pdev); |
119 | if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus()) | ||
120 | vga_switcheroo_fini_domain_pm_ops(drm->dev->dev); | ||
112 | vga_client_register(dev->pdev, NULL, NULL, NULL); | 121 | vga_client_register(dev->pdev, NULL, NULL, NULL); |
113 | } | 122 | } |
114 | 123 | ||
diff --git a/drivers/gpu/drm/radeon/cik_sdma.c b/drivers/gpu/drm/radeon/cik_sdma.c index 192278bc993c..c4ffa54b1e3d 100644 --- a/drivers/gpu/drm/radeon/cik_sdma.c +++ b/drivers/gpu/drm/radeon/cik_sdma.c | |||
@@ -489,13 +489,6 @@ int cik_sdma_resume(struct radeon_device *rdev) | |||
489 | { | 489 | { |
490 | int r; | 490 | int r; |
491 | 491 | ||
492 | /* Reset dma */ | ||
493 | WREG32(SRBM_SOFT_RESET, SOFT_RESET_SDMA | SOFT_RESET_SDMA1); | ||
494 | RREG32(SRBM_SOFT_RESET); | ||
495 | udelay(50); | ||
496 | WREG32(SRBM_SOFT_RESET, 0); | ||
497 | RREG32(SRBM_SOFT_RESET); | ||
498 | |||
499 | r = cik_sdma_load_microcode(rdev); | 492 | r = cik_sdma_load_microcode(rdev); |
500 | if (r) | 493 | if (r) |
501 | return r; | 494 | return r; |
diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c index 8b58e11b64fa..67cb472d188c 100644 --- a/drivers/gpu/drm/radeon/kv_dpm.c +++ b/drivers/gpu/drm/radeon/kv_dpm.c | |||
@@ -33,6 +33,8 @@ | |||
33 | #define KV_MINIMUM_ENGINE_CLOCK 800 | 33 | #define KV_MINIMUM_ENGINE_CLOCK 800 |
34 | #define SMC_RAM_END 0x40000 | 34 | #define SMC_RAM_END 0x40000 |
35 | 35 | ||
36 | static int kv_enable_nb_dpm(struct radeon_device *rdev, | ||
37 | bool enable); | ||
36 | static void kv_init_graphics_levels(struct radeon_device *rdev); | 38 | static void kv_init_graphics_levels(struct radeon_device *rdev); |
37 | static int kv_calculate_ds_divider(struct radeon_device *rdev); | 39 | static int kv_calculate_ds_divider(struct radeon_device *rdev); |
38 | static int kv_calculate_nbps_level_settings(struct radeon_device *rdev); | 40 | static int kv_calculate_nbps_level_settings(struct radeon_device *rdev); |
@@ -1295,6 +1297,9 @@ void kv_dpm_disable(struct radeon_device *rdev) | |||
1295 | { | 1297 | { |
1296 | kv_smc_bapm_enable(rdev, false); | 1298 | kv_smc_bapm_enable(rdev, false); |
1297 | 1299 | ||
1300 | if (rdev->family == CHIP_MULLINS) | ||
1301 | kv_enable_nb_dpm(rdev, false); | ||
1302 | |||
1298 | /* powerup blocks */ | 1303 | /* powerup blocks */ |
1299 | kv_dpm_powergate_acp(rdev, false); | 1304 | kv_dpm_powergate_acp(rdev, false); |
1300 | kv_dpm_powergate_samu(rdev, false); | 1305 | kv_dpm_powergate_samu(rdev, false); |
@@ -1769,15 +1774,24 @@ static int kv_update_dfs_bypass_settings(struct radeon_device *rdev, | |||
1769 | return ret; | 1774 | return ret; |
1770 | } | 1775 | } |
1771 | 1776 | ||
1772 | static int kv_enable_nb_dpm(struct radeon_device *rdev) | 1777 | static int kv_enable_nb_dpm(struct radeon_device *rdev, |
1778 | bool enable) | ||
1773 | { | 1779 | { |
1774 | struct kv_power_info *pi = kv_get_pi(rdev); | 1780 | struct kv_power_info *pi = kv_get_pi(rdev); |
1775 | int ret = 0; | 1781 | int ret = 0; |
1776 | 1782 | ||
1777 | if (pi->enable_nb_dpm && !pi->nb_dpm_enabled) { | 1783 | if (enable) { |
1778 | ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Enable); | 1784 | if (pi->enable_nb_dpm && !pi->nb_dpm_enabled) { |
1779 | if (ret == 0) | 1785 | ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Enable); |
1780 | pi->nb_dpm_enabled = true; | 1786 | if (ret == 0) |
1787 | pi->nb_dpm_enabled = true; | ||
1788 | } | ||
1789 | } else { | ||
1790 | if (pi->enable_nb_dpm && pi->nb_dpm_enabled) { | ||
1791 | ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Disable); | ||
1792 | if (ret == 0) | ||
1793 | pi->nb_dpm_enabled = false; | ||
1794 | } | ||
1781 | } | 1795 | } |
1782 | 1796 | ||
1783 | return ret; | 1797 | return ret; |
@@ -1864,7 +1878,7 @@ int kv_dpm_set_power_state(struct radeon_device *rdev) | |||
1864 | } | 1878 | } |
1865 | kv_update_sclk_t(rdev); | 1879 | kv_update_sclk_t(rdev); |
1866 | if (rdev->family == CHIP_MULLINS) | 1880 | if (rdev->family == CHIP_MULLINS) |
1867 | kv_enable_nb_dpm(rdev); | 1881 | kv_enable_nb_dpm(rdev, true); |
1868 | } | 1882 | } |
1869 | } else { | 1883 | } else { |
1870 | if (pi->enable_dpm) { | 1884 | if (pi->enable_dpm) { |
@@ -1889,7 +1903,7 @@ int kv_dpm_set_power_state(struct radeon_device *rdev) | |||
1889 | } | 1903 | } |
1890 | kv_update_acp_boot_level(rdev); | 1904 | kv_update_acp_boot_level(rdev); |
1891 | kv_update_sclk_t(rdev); | 1905 | kv_update_sclk_t(rdev); |
1892 | kv_enable_nb_dpm(rdev); | 1906 | kv_enable_nb_dpm(rdev, true); |
1893 | } | 1907 | } |
1894 | } | 1908 | } |
1895 | 1909 | ||
diff --git a/drivers/gpu/drm/radeon/ni_dma.c b/drivers/gpu/drm/radeon/ni_dma.c index 8a3e6221cece..f26f0a9fb522 100644 --- a/drivers/gpu/drm/radeon/ni_dma.c +++ b/drivers/gpu/drm/radeon/ni_dma.c | |||
@@ -191,12 +191,6 @@ int cayman_dma_resume(struct radeon_device *rdev) | |||
191 | u32 reg_offset, wb_offset; | 191 | u32 reg_offset, wb_offset; |
192 | int i, r; | 192 | int i, r; |
193 | 193 | ||
194 | /* Reset dma */ | ||
195 | WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA | SOFT_RESET_DMA1); | ||
196 | RREG32(SRBM_SOFT_RESET); | ||
197 | udelay(50); | ||
198 | WREG32(SRBM_SOFT_RESET, 0); | ||
199 | |||
200 | for (i = 0; i < 2; i++) { | 194 | for (i = 0; i < 2; i++) { |
201 | if (i == 0) { | 195 | if (i == 0) { |
202 | ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX]; | 196 | ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX]; |
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 4c5ec44ff328..b0098e792e62 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -821,6 +821,20 @@ u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc) | |||
821 | return RREG32(RADEON_CRTC2_CRNT_FRAME); | 821 | return RREG32(RADEON_CRTC2_CRNT_FRAME); |
822 | } | 822 | } |
823 | 823 | ||
824 | /** | ||
825 | * r100_ring_hdp_flush - flush Host Data Path via the ring buffer | ||
826 | * rdev: radeon device structure | ||
827 | * ring: ring buffer struct for emitting packets | ||
828 | */ | ||
829 | static void r100_ring_hdp_flush(struct radeon_device *rdev, struct radeon_ring *ring) | ||
830 | { | ||
831 | radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); | ||
832 | radeon_ring_write(ring, rdev->config.r100.hdp_cntl | | ||
833 | RADEON_HDP_READ_BUFFER_INVALIDATE); | ||
834 | radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); | ||
835 | radeon_ring_write(ring, rdev->config.r100.hdp_cntl); | ||
836 | } | ||
837 | |||
824 | /* Who ever call radeon_fence_emit should call ring_lock and ask | 838 | /* Who ever call radeon_fence_emit should call ring_lock and ask |
825 | * for enough space (today caller are ib schedule and buffer move) */ | 839 | * for enough space (today caller are ib schedule and buffer move) */ |
826 | void r100_fence_ring_emit(struct radeon_device *rdev, | 840 | void r100_fence_ring_emit(struct radeon_device *rdev, |
@@ -1056,20 +1070,6 @@ void r100_gfx_set_wptr(struct radeon_device *rdev, | |||
1056 | (void)RREG32(RADEON_CP_RB_WPTR); | 1070 | (void)RREG32(RADEON_CP_RB_WPTR); |
1057 | } | 1071 | } |
1058 | 1072 | ||
1059 | /** | ||
1060 | * r100_ring_hdp_flush - flush Host Data Path via the ring buffer | ||
1061 | * rdev: radeon device structure | ||
1062 | * ring: ring buffer struct for emitting packets | ||
1063 | */ | ||
1064 | void r100_ring_hdp_flush(struct radeon_device *rdev, struct radeon_ring *ring) | ||
1065 | { | ||
1066 | radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); | ||
1067 | radeon_ring_write(ring, rdev->config.r100.hdp_cntl | | ||
1068 | RADEON_HDP_READ_BUFFER_INVALIDATE); | ||
1069 | radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); | ||
1070 | radeon_ring_write(ring, rdev->config.r100.hdp_cntl); | ||
1071 | } | ||
1072 | |||
1073 | static void r100_cp_load_microcode(struct radeon_device *rdev) | 1073 | static void r100_cp_load_microcode(struct radeon_device *rdev) |
1074 | { | 1074 | { |
1075 | const __be32 *fw_data; | 1075 | const __be32 *fw_data; |
diff --git a/drivers/gpu/drm/radeon/r600_dma.c b/drivers/gpu/drm/radeon/r600_dma.c index 51fd98553eaf..a908daa006d2 100644 --- a/drivers/gpu/drm/radeon/r600_dma.c +++ b/drivers/gpu/drm/radeon/r600_dma.c | |||
@@ -124,15 +124,6 @@ int r600_dma_resume(struct radeon_device *rdev) | |||
124 | u32 rb_bufsz; | 124 | u32 rb_bufsz; |
125 | int r; | 125 | int r; |
126 | 126 | ||
127 | /* Reset dma */ | ||
128 | if (rdev->family >= CHIP_RV770) | ||
129 | WREG32(SRBM_SOFT_RESET, RV770_SOFT_RESET_DMA); | ||
130 | else | ||
131 | WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA); | ||
132 | RREG32(SRBM_SOFT_RESET); | ||
133 | udelay(50); | ||
134 | WREG32(SRBM_SOFT_RESET, 0); | ||
135 | |||
136 | WREG32(DMA_SEM_INCOMPLETE_TIMER_CNTL, 0); | 127 | WREG32(DMA_SEM_INCOMPLETE_TIMER_CNTL, 0); |
137 | WREG32(DMA_SEM_WAIT_FAIL_TIMER_CNTL, 0); | 128 | WREG32(DMA_SEM_WAIT_FAIL_TIMER_CNTL, 0); |
138 | 129 | ||
diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h index 0c4a7d8d93e0..31e1052ad3e3 100644 --- a/drivers/gpu/drm/radeon/r600d.h +++ b/drivers/gpu/drm/radeon/r600d.h | |||
@@ -44,13 +44,6 @@ | |||
44 | #define R6XX_MAX_PIPES 8 | 44 | #define R6XX_MAX_PIPES 8 |
45 | #define R6XX_MAX_PIPES_MASK 0xff | 45 | #define R6XX_MAX_PIPES_MASK 0xff |
46 | 46 | ||
47 | /* PTE flags */ | ||
48 | #define PTE_VALID (1 << 0) | ||
49 | #define PTE_SYSTEM (1 << 1) | ||
50 | #define PTE_SNOOPED (1 << 2) | ||
51 | #define PTE_READABLE (1 << 5) | ||
52 | #define PTE_WRITEABLE (1 << 6) | ||
53 | |||
54 | /* tiling bits */ | 47 | /* tiling bits */ |
55 | #define ARRAY_LINEAR_GENERAL 0x00000000 | 48 | #define ARRAY_LINEAR_GENERAL 0x00000000 |
56 | #define ARRAY_LINEAR_ALIGNED 0x00000001 | 49 | #define ARRAY_LINEAR_ALIGNED 0x00000001 |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index eeeeabe09758..2dd5847f9b98 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
@@ -185,7 +185,6 @@ static struct radeon_asic_ring r100_gfx_ring = { | |||
185 | .get_rptr = &r100_gfx_get_rptr, | 185 | .get_rptr = &r100_gfx_get_rptr, |
186 | .get_wptr = &r100_gfx_get_wptr, | 186 | .get_wptr = &r100_gfx_get_wptr, |
187 | .set_wptr = &r100_gfx_set_wptr, | 187 | .set_wptr = &r100_gfx_set_wptr, |
188 | .hdp_flush = &r100_ring_hdp_flush, | ||
189 | }; | 188 | }; |
190 | 189 | ||
191 | static struct radeon_asic r100_asic = { | 190 | static struct radeon_asic r100_asic = { |
@@ -332,7 +331,6 @@ static struct radeon_asic_ring r300_gfx_ring = { | |||
332 | .get_rptr = &r100_gfx_get_rptr, | 331 | .get_rptr = &r100_gfx_get_rptr, |
333 | .get_wptr = &r100_gfx_get_wptr, | 332 | .get_wptr = &r100_gfx_get_wptr, |
334 | .set_wptr = &r100_gfx_set_wptr, | 333 | .set_wptr = &r100_gfx_set_wptr, |
335 | .hdp_flush = &r100_ring_hdp_flush, | ||
336 | }; | 334 | }; |
337 | 335 | ||
338 | static struct radeon_asic r300_asic = { | 336 | static struct radeon_asic r300_asic = { |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h index 275a5dc01780..7756bc1e1cd3 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h | |||
@@ -148,8 +148,7 @@ u32 r100_gfx_get_wptr(struct radeon_device *rdev, | |||
148 | struct radeon_ring *ring); | 148 | struct radeon_ring *ring); |
149 | void r100_gfx_set_wptr(struct radeon_device *rdev, | 149 | void r100_gfx_set_wptr(struct radeon_device *rdev, |
150 | struct radeon_ring *ring); | 150 | struct radeon_ring *ring); |
151 | void r100_ring_hdp_flush(struct radeon_device *rdev, | 151 | |
152 | struct radeon_ring *ring); | ||
153 | /* | 152 | /* |
154 | * r200,rv250,rs300,rv280 | 153 | * r200,rv250,rs300,rv280 |
155 | */ | 154 | */ |
diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c index a9fb0d016d38..8bc7d0bbd3c8 100644 --- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c +++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c | |||
@@ -33,7 +33,6 @@ static struct radeon_atpx_priv { | |||
33 | bool atpx_detected; | 33 | bool atpx_detected; |
34 | /* handle for device - and atpx */ | 34 | /* handle for device - and atpx */ |
35 | acpi_handle dhandle; | 35 | acpi_handle dhandle; |
36 | acpi_handle other_handle; | ||
37 | struct radeon_atpx atpx; | 36 | struct radeon_atpx atpx; |
38 | } radeon_atpx_priv; | 37 | } radeon_atpx_priv; |
39 | 38 | ||
@@ -453,10 +452,9 @@ static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev) | |||
453 | return false; | 452 | return false; |
454 | 453 | ||
455 | status = acpi_get_handle(dhandle, "ATPX", &atpx_handle); | 454 | status = acpi_get_handle(dhandle, "ATPX", &atpx_handle); |
456 | if (ACPI_FAILURE(status)) { | 455 | if (ACPI_FAILURE(status)) |
457 | radeon_atpx_priv.other_handle = dhandle; | ||
458 | return false; | 456 | return false; |
459 | } | 457 | |
460 | radeon_atpx_priv.dhandle = dhandle; | 458 | radeon_atpx_priv.dhandle = dhandle; |
461 | radeon_atpx_priv.atpx.handle = atpx_handle; | 459 | radeon_atpx_priv.atpx.handle = atpx_handle; |
462 | return true; | 460 | return true; |
@@ -540,16 +538,6 @@ static bool radeon_atpx_detect(void) | |||
540 | printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n", | 538 | printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n", |
541 | acpi_method_name); | 539 | acpi_method_name); |
542 | radeon_atpx_priv.atpx_detected = true; | 540 | radeon_atpx_priv.atpx_detected = true; |
543 | /* | ||
544 | * On some systems hotplug events are generated for the device | ||
545 | * being switched off when ATPX is executed. They cause ACPI | ||
546 | * hotplug to trigger and attempt to remove the device from | ||
547 | * the system, which causes it to break down. Prevent that from | ||
548 | * happening by setting the no_hotplug flag for the involved | ||
549 | * ACPI device objects. | ||
550 | */ | ||
551 | acpi_bus_no_hotplug(radeon_atpx_priv.dhandle); | ||
552 | acpi_bus_no_hotplug(radeon_atpx_priv.other_handle); | ||
553 | return true; | 541 | return true; |
554 | } | 542 | } |
555 | return false; | 543 | return false; |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 6a219bcee66d..75223dd3a8a3 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
@@ -1393,7 +1393,7 @@ int radeon_device_init(struct radeon_device *rdev, | |||
1393 | 1393 | ||
1394 | r = radeon_init(rdev); | 1394 | r = radeon_init(rdev); |
1395 | if (r) | 1395 | if (r) |
1396 | return r; | 1396 | goto failed; |
1397 | 1397 | ||
1398 | r = radeon_ib_ring_tests(rdev); | 1398 | r = radeon_ib_ring_tests(rdev); |
1399 | if (r) | 1399 | if (r) |
@@ -1413,7 +1413,7 @@ int radeon_device_init(struct radeon_device *rdev, | |||
1413 | radeon_agp_disable(rdev); | 1413 | radeon_agp_disable(rdev); |
1414 | r = radeon_init(rdev); | 1414 | r = radeon_init(rdev); |
1415 | if (r) | 1415 | if (r) |
1416 | return r; | 1416 | goto failed; |
1417 | } | 1417 | } |
1418 | 1418 | ||
1419 | if ((radeon_testing & 1)) { | 1419 | if ((radeon_testing & 1)) { |
@@ -1435,6 +1435,11 @@ int radeon_device_init(struct radeon_device *rdev, | |||
1435 | DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n"); | 1435 | DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n"); |
1436 | } | 1436 | } |
1437 | return 0; | 1437 | return 0; |
1438 | |||
1439 | failed: | ||
1440 | if (runtime) | ||
1441 | vga_switcheroo_fini_domain_pm_ops(rdev->dev); | ||
1442 | return r; | ||
1438 | } | 1443 | } |
1439 | 1444 | ||
1440 | static void radeon_debugfs_remove_files(struct radeon_device *rdev); | 1445 | static void radeon_debugfs_remove_files(struct radeon_device *rdev); |
@@ -1455,6 +1460,8 @@ void radeon_device_fini(struct radeon_device *rdev) | |||
1455 | radeon_bo_evict_vram(rdev); | 1460 | radeon_bo_evict_vram(rdev); |
1456 | radeon_fini(rdev); | 1461 | radeon_fini(rdev); |
1457 | vga_switcheroo_unregister_client(rdev->pdev); | 1462 | vga_switcheroo_unregister_client(rdev->pdev); |
1463 | if (rdev->flags & RADEON_IS_PX) | ||
1464 | vga_switcheroo_fini_domain_pm_ops(rdev->dev); | ||
1458 | vga_client_register(rdev->pdev, NULL, NULL, NULL); | 1465 | vga_client_register(rdev->pdev, NULL, NULL, NULL); |
1459 | if (rdev->rio_mem) | 1466 | if (rdev->rio_mem) |
1460 | pci_iounmap(rdev->pdev, rdev->rio_mem); | 1467 | pci_iounmap(rdev->pdev, rdev->rio_mem); |
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 8df888908833..4126fd0937a2 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -83,7 +83,7 @@ | |||
83 | * CIK: 1D and linear tiling modes contain valid PIPE_CONFIG | 83 | * CIK: 1D and linear tiling modes contain valid PIPE_CONFIG |
84 | * 2.39.0 - Add INFO query for number of active CUs | 84 | * 2.39.0 - Add INFO query for number of active CUs |
85 | * 2.40.0 - Add RADEON_GEM_GTT_WC/UC, flush HDP cache before submitting | 85 | * 2.40.0 - Add RADEON_GEM_GTT_WC/UC, flush HDP cache before submitting |
86 | * CS to GPU | 86 | * CS to GPU on >= r600 |
87 | */ | 87 | */ |
88 | #define KMS_DRIVER_MAJOR 2 | 88 | #define KMS_DRIVER_MAJOR 2 |
89 | #define KMS_DRIVER_MINOR 40 | 89 | #define KMS_DRIVER_MINOR 40 |
@@ -440,6 +440,7 @@ static int radeon_pmops_runtime_suspend(struct device *dev) | |||
440 | ret = radeon_suspend_kms(drm_dev, false, false); | 440 | ret = radeon_suspend_kms(drm_dev, false, false); |
441 | pci_save_state(pdev); | 441 | pci_save_state(pdev); |
442 | pci_disable_device(pdev); | 442 | pci_disable_device(pdev); |
443 | pci_ignore_hotplug(pdev); | ||
443 | pci_set_power_state(pdev, PCI_D3cold); | 444 | pci_set_power_state(pdev, PCI_D3cold); |
444 | drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; | 445 | drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; |
445 | 446 | ||
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c index 6c1fc339d228..c5799f16aa4b 100644 --- a/drivers/gpu/drm/radeon/rs400.c +++ b/drivers/gpu/drm/radeon/rs400.c | |||
@@ -221,9 +221,9 @@ void rs400_gart_set_page(struct radeon_device *rdev, unsigned i, | |||
221 | entry = (lower_32_bits(addr) & PAGE_MASK) | | 221 | entry = (lower_32_bits(addr) & PAGE_MASK) | |
222 | ((upper_32_bits(addr) & 0xff) << 4); | 222 | ((upper_32_bits(addr) & 0xff) << 4); |
223 | if (flags & RADEON_GART_PAGE_READ) | 223 | if (flags & RADEON_GART_PAGE_READ) |
224 | addr |= RS400_PTE_READABLE; | 224 | entry |= RS400_PTE_READABLE; |
225 | if (flags & RADEON_GART_PAGE_WRITE) | 225 | if (flags & RADEON_GART_PAGE_WRITE) |
226 | addr |= RS400_PTE_WRITEABLE; | 226 | entry |= RS400_PTE_WRITEABLE; |
227 | if (!(flags & RADEON_GART_PAGE_SNOOP)) | 227 | if (!(flags & RADEON_GART_PAGE_SNOOP)) |
228 | entry |= RS400_PTE_UNSNOOPED; | 228 | entry |= RS400_PTE_UNSNOOPED; |
229 | entry = cpu_to_le32(entry); | 229 | entry = cpu_to_le32(entry); |
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index ef93156a69c6..b22968c08d1f 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c | |||
@@ -298,7 +298,6 @@ static int hdmi_avi_infoframe_config(struct sti_hdmi *hdmi) | |||
298 | hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD2(HDMI_IFRAME_SLOT_AVI)); | 298 | hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD2(HDMI_IFRAME_SLOT_AVI)); |
299 | 299 | ||
300 | val = frame[0xC]; | 300 | val = frame[0xC]; |
301 | val |= frame[0xD] << 8; | ||
302 | hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD3(HDMI_IFRAME_SLOT_AVI)); | 301 | hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD3(HDMI_IFRAME_SLOT_AVI)); |
303 | 302 | ||
304 | /* Enable transmission slot for AVI infoframe | 303 | /* Enable transmission slot for AVI infoframe |
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index 6866448083b2..37ac7b5dbd06 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c | |||
@@ -660,6 +660,12 @@ int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain * | |||
660 | } | 660 | } |
661 | EXPORT_SYMBOL(vga_switcheroo_init_domain_pm_ops); | 661 | EXPORT_SYMBOL(vga_switcheroo_init_domain_pm_ops); |
662 | 662 | ||
663 | void vga_switcheroo_fini_domain_pm_ops(struct device *dev) | ||
664 | { | ||
665 | dev->pm_domain = NULL; | ||
666 | } | ||
667 | EXPORT_SYMBOL(vga_switcheroo_fini_domain_pm_ops); | ||
668 | |||
663 | static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev) | 669 | static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev) |
664 | { | 670 | { |
665 | struct pci_dev *pdev = to_pci_dev(dev); | 671 | struct pci_dev *pdev = to_pci_dev(dev); |
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index d2077f040f3e..77711623b973 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/poll.h> | 41 | #include <linux/poll.h> |
42 | #include <linux/miscdevice.h> | 42 | #include <linux/miscdevice.h> |
43 | #include <linux/slab.h> | 43 | #include <linux/slab.h> |
44 | #include <linux/screen_info.h> | ||
44 | 45 | ||
45 | #include <linux/uaccess.h> | 46 | #include <linux/uaccess.h> |
46 | 47 | ||
@@ -112,10 +113,8 @@ both: | |||
112 | return 1; | 113 | return 1; |
113 | } | 114 | } |
114 | 115 | ||
115 | #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE | ||
116 | /* this is only used a cookie - it should not be dereferenced */ | 116 | /* this is only used a cookie - it should not be dereferenced */ |
117 | static struct pci_dev *vga_default; | 117 | static struct pci_dev *vga_default; |
118 | #endif | ||
119 | 118 | ||
120 | static void vga_arb_device_card_gone(struct pci_dev *pdev); | 119 | static void vga_arb_device_card_gone(struct pci_dev *pdev); |
121 | 120 | ||
@@ -131,7 +130,6 @@ static struct vga_device *vgadev_find(struct pci_dev *pdev) | |||
131 | } | 130 | } |
132 | 131 | ||
133 | /* Returns the default VGA device (vgacon's babe) */ | 132 | /* Returns the default VGA device (vgacon's babe) */ |
134 | #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE | ||
135 | struct pci_dev *vga_default_device(void) | 133 | struct pci_dev *vga_default_device(void) |
136 | { | 134 | { |
137 | return vga_default; | 135 | return vga_default; |
@@ -147,7 +145,6 @@ void vga_set_default_device(struct pci_dev *pdev) | |||
147 | pci_dev_put(vga_default); | 145 | pci_dev_put(vga_default); |
148 | vga_default = pci_dev_get(pdev); | 146 | vga_default = pci_dev_get(pdev); |
149 | } | 147 | } |
150 | #endif | ||
151 | 148 | ||
152 | static inline void vga_irq_set_state(struct vga_device *vgadev, bool state) | 149 | static inline void vga_irq_set_state(struct vga_device *vgadev, bool state) |
153 | { | 150 | { |
@@ -583,11 +580,12 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) | |||
583 | /* Deal with VGA default device. Use first enabled one | 580 | /* Deal with VGA default device. Use first enabled one |
584 | * by default if arch doesn't have it's own hook | 581 | * by default if arch doesn't have it's own hook |
585 | */ | 582 | */ |
586 | #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE | ||
587 | if (vga_default == NULL && | 583 | if (vga_default == NULL && |
588 | ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) | 584 | ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) { |
585 | pr_info("vgaarb: setting as boot device: PCI:%s\n", | ||
586 | pci_name(pdev)); | ||
589 | vga_set_default_device(pdev); | 587 | vga_set_default_device(pdev); |
590 | #endif | 588 | } |
591 | 589 | ||
592 | vga_arbiter_check_bridge_sharing(vgadev); | 590 | vga_arbiter_check_bridge_sharing(vgadev); |
593 | 591 | ||
@@ -621,10 +619,8 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev) | |||
621 | goto bail; | 619 | goto bail; |
622 | } | 620 | } |
623 | 621 | ||
624 | #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE | ||
625 | if (vga_default == pdev) | 622 | if (vga_default == pdev) |
626 | vga_set_default_device(NULL); | 623 | vga_set_default_device(NULL); |
627 | #endif | ||
628 | 624 | ||
629 | if (vgadev->decodes & (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM)) | 625 | if (vgadev->decodes & (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM)) |
630 | vga_decode_count--; | 626 | vga_decode_count--; |
@@ -1320,6 +1316,38 @@ static int __init vga_arb_device_init(void) | |||
1320 | pr_info("vgaarb: loaded\n"); | 1316 | pr_info("vgaarb: loaded\n"); |
1321 | 1317 | ||
1322 | list_for_each_entry(vgadev, &vga_list, list) { | 1318 | list_for_each_entry(vgadev, &vga_list, list) { |
1319 | #if defined(CONFIG_X86) || defined(CONFIG_IA64) | ||
1320 | /* Override I/O based detection done by vga_arbiter_add_pci_device() | ||
1321 | * as it may take the wrong device (e.g. on Apple system under EFI). | ||
1322 | * | ||
1323 | * Select the device owning the boot framebuffer if there is one. | ||
1324 | */ | ||
1325 | resource_size_t start, end; | ||
1326 | int i; | ||
1327 | |||
1328 | /* Does firmware framebuffer belong to us? */ | ||
1329 | for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { | ||
1330 | if (!(pci_resource_flags(vgadev->pdev, i) & IORESOURCE_MEM)) | ||
1331 | continue; | ||
1332 | |||
1333 | start = pci_resource_start(vgadev->pdev, i); | ||
1334 | end = pci_resource_end(vgadev->pdev, i); | ||
1335 | |||
1336 | if (!start || !end) | ||
1337 | continue; | ||
1338 | |||
1339 | if (screen_info.lfb_base < start || | ||
1340 | (screen_info.lfb_base + screen_info.lfb_size) >= end) | ||
1341 | continue; | ||
1342 | if (!vga_default_device()) | ||
1343 | pr_info("vgaarb: setting as boot device: PCI:%s\n", | ||
1344 | pci_name(vgadev->pdev)); | ||
1345 | else if (vgadev->pdev != vga_default_device()) | ||
1346 | pr_info("vgaarb: overriding boot device: PCI:%s\n", | ||
1347 | pci_name(vgadev->pdev)); | ||
1348 | vga_set_default_device(vgadev->pdev); | ||
1349 | } | ||
1350 | #endif | ||
1323 | if (vgadev->bridge_has_one_vga) | 1351 | if (vgadev->bridge_has_one_vga) |
1324 | pr_info("vgaarb: bridge control possible %s\n", pci_name(vgadev->pdev)); | 1352 | pr_info("vgaarb: bridge control possible %s\n", pci_name(vgadev->pdev)); |
1325 | else | 1353 | else |
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index 6ef19641457c..f081b007f7d2 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c | |||
@@ -748,7 +748,7 @@ static int bma180_probe(struct i2c_client *client, | |||
748 | data->trig->dev.parent = &client->dev; | 748 | data->trig->dev.parent = &client->dev; |
749 | data->trig->ops = &bma180_trigger_ops; | 749 | data->trig->ops = &bma180_trigger_ops; |
750 | iio_trigger_set_drvdata(data->trig, indio_dev); | 750 | iio_trigger_set_drvdata(data->trig, indio_dev); |
751 | indio_dev->trig = data->trig; | 751 | indio_dev->trig = iio_trigger_get(trig); |
752 | 752 | ||
753 | ret = iio_trigger_register(data->trig); | 753 | ret = iio_trigger_register(data->trig); |
754 | if (ret) | 754 | if (ret) |
diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c index c55b81f7f970..d10bd0c97233 100644 --- a/drivers/iio/adc/ad_sigma_delta.c +++ b/drivers/iio/adc/ad_sigma_delta.c | |||
@@ -472,7 +472,7 @@ static int ad_sd_probe_trigger(struct iio_dev *indio_dev) | |||
472 | goto error_free_irq; | 472 | goto error_free_irq; |
473 | 473 | ||
474 | /* select default trigger */ | 474 | /* select default trigger */ |
475 | indio_dev->trig = sigma_delta->trig; | 475 | indio_dev->trig = iio_trigger_get(sigma_delta->trig); |
476 | 476 | ||
477 | return 0; | 477 | return 0; |
478 | 478 | ||
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 7807e0ef5b29..ff61ae55dd3f 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c | |||
@@ -196,6 +196,7 @@ struct at91_adc_state { | |||
196 | bool done; | 196 | bool done; |
197 | int irq; | 197 | int irq; |
198 | u16 last_value; | 198 | u16 last_value; |
199 | int chnb; | ||
199 | struct mutex lock; | 200 | struct mutex lock; |
200 | u8 num_channels; | 201 | u8 num_channels; |
201 | void __iomem *reg_base; | 202 | void __iomem *reg_base; |
@@ -274,7 +275,7 @@ static void handle_adc_eoc_trigger(int irq, struct iio_dev *idev) | |||
274 | disable_irq_nosync(irq); | 275 | disable_irq_nosync(irq); |
275 | iio_trigger_poll(idev->trig); | 276 | iio_trigger_poll(idev->trig); |
276 | } else { | 277 | } else { |
277 | st->last_value = at91_adc_readl(st, AT91_ADC_LCDR); | 278 | st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb)); |
278 | st->done = true; | 279 | st->done = true; |
279 | wake_up_interruptible(&st->wq_data_avail); | 280 | wake_up_interruptible(&st->wq_data_avail); |
280 | } | 281 | } |
@@ -351,7 +352,7 @@ static irqreturn_t at91_adc_rl_interrupt(int irq, void *private) | |||
351 | unsigned int reg; | 352 | unsigned int reg; |
352 | 353 | ||
353 | status &= at91_adc_readl(st, AT91_ADC_IMR); | 354 | status &= at91_adc_readl(st, AT91_ADC_IMR); |
354 | if (status & st->registers->drdy_mask) | 355 | if (status & GENMASK(st->num_channels - 1, 0)) |
355 | handle_adc_eoc_trigger(irq, idev); | 356 | handle_adc_eoc_trigger(irq, idev); |
356 | 357 | ||
357 | if (status & AT91RL_ADC_IER_PEN) { | 358 | if (status & AT91RL_ADC_IER_PEN) { |
@@ -418,7 +419,7 @@ static irqreturn_t at91_adc_9x5_interrupt(int irq, void *private) | |||
418 | AT91_ADC_IER_YRDY | | 419 | AT91_ADC_IER_YRDY | |
419 | AT91_ADC_IER_PRDY; | 420 | AT91_ADC_IER_PRDY; |
420 | 421 | ||
421 | if (status & st->registers->drdy_mask) | 422 | if (status & GENMASK(st->num_channels - 1, 0)) |
422 | handle_adc_eoc_trigger(irq, idev); | 423 | handle_adc_eoc_trigger(irq, idev); |
423 | 424 | ||
424 | if (status & AT91_ADC_IER_PEN) { | 425 | if (status & AT91_ADC_IER_PEN) { |
@@ -689,9 +690,10 @@ static int at91_adc_read_raw(struct iio_dev *idev, | |||
689 | case IIO_CHAN_INFO_RAW: | 690 | case IIO_CHAN_INFO_RAW: |
690 | mutex_lock(&st->lock); | 691 | mutex_lock(&st->lock); |
691 | 692 | ||
693 | st->chnb = chan->channel; | ||
692 | at91_adc_writel(st, AT91_ADC_CHER, | 694 | at91_adc_writel(st, AT91_ADC_CHER, |
693 | AT91_ADC_CH(chan->channel)); | 695 | AT91_ADC_CH(chan->channel)); |
694 | at91_adc_writel(st, AT91_ADC_IER, st->registers->drdy_mask); | 696 | at91_adc_writel(st, AT91_ADC_IER, BIT(chan->channel)); |
695 | at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_START); | 697 | at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_START); |
696 | 698 | ||
697 | ret = wait_event_interruptible_timeout(st->wq_data_avail, | 699 | ret = wait_event_interruptible_timeout(st->wq_data_avail, |
@@ -708,7 +710,7 @@ static int at91_adc_read_raw(struct iio_dev *idev, | |||
708 | 710 | ||
709 | at91_adc_writel(st, AT91_ADC_CHDR, | 711 | at91_adc_writel(st, AT91_ADC_CHDR, |
710 | AT91_ADC_CH(chan->channel)); | 712 | AT91_ADC_CH(chan->channel)); |
711 | at91_adc_writel(st, AT91_ADC_IDR, st->registers->drdy_mask); | 713 | at91_adc_writel(st, AT91_ADC_IDR, BIT(chan->channel)); |
712 | 714 | ||
713 | st->last_value = 0; | 715 | st->last_value = 0; |
714 | st->done = false; | 716 | st->done = false; |
diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 5d52a3106fac..a221f7329b79 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c | |||
@@ -1126,7 +1126,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, struct device_node *np, | |||
1126 | chan->address = XADC_REG_VPVN; | 1126 | chan->address = XADC_REG_VPVN; |
1127 | } else { | 1127 | } else { |
1128 | chan->scan_index = 15 + reg; | 1128 | chan->scan_index = 15 + reg; |
1129 | chan->scan_index = XADC_REG_VAUX(reg - 1); | 1129 | chan->address = XADC_REG_VAUX(reg - 1); |
1130 | } | 1130 | } |
1131 | num_channels++; | 1131 | num_channels++; |
1132 | chan++; | 1132 | chan++; |
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index a3109a6f4d86..92068cdbf8c7 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c | |||
@@ -122,7 +122,8 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name, | |||
122 | dev_err(&indio_dev->dev, "Trigger Register Failed\n"); | 122 | dev_err(&indio_dev->dev, "Trigger Register Failed\n"); |
123 | goto error_free_trig; | 123 | goto error_free_trig; |
124 | } | 124 | } |
125 | indio_dev->trig = attrb->trigger = trig; | 125 | attrb->trigger = trig; |
126 | indio_dev->trig = iio_trigger_get(trig); | ||
126 | 127 | ||
127 | return ret; | 128 | return ret; |
128 | 129 | ||
diff --git a/drivers/iio/common/st_sensors/st_sensors_trigger.c b/drivers/iio/common/st_sensors/st_sensors_trigger.c index 8fc3a97eb266..8d8ca6f1e16a 100644 --- a/drivers/iio/common/st_sensors/st_sensors_trigger.c +++ b/drivers/iio/common/st_sensors/st_sensors_trigger.c | |||
@@ -49,7 +49,7 @@ int st_sensors_allocate_trigger(struct iio_dev *indio_dev, | |||
49 | dev_err(&indio_dev->dev, "failed to register iio trigger.\n"); | 49 | dev_err(&indio_dev->dev, "failed to register iio trigger.\n"); |
50 | goto iio_trigger_register_error; | 50 | goto iio_trigger_register_error; |
51 | } | 51 | } |
52 | indio_dev->trig = sdata->trig; | 52 | indio_dev->trig = iio_trigger_get(sdata->trig); |
53 | 53 | ||
54 | return 0; | 54 | return 0; |
55 | 55 | ||
diff --git a/drivers/iio/gyro/itg3200_buffer.c b/drivers/iio/gyro/itg3200_buffer.c index e3b3c5084070..eef50e91f17c 100644 --- a/drivers/iio/gyro/itg3200_buffer.c +++ b/drivers/iio/gyro/itg3200_buffer.c | |||
@@ -132,7 +132,7 @@ int itg3200_probe_trigger(struct iio_dev *indio_dev) | |||
132 | goto error_free_irq; | 132 | goto error_free_irq; |
133 | 133 | ||
134 | /* select default trigger */ | 134 | /* select default trigger */ |
135 | indio_dev->trig = st->trig; | 135 | indio_dev->trig = iio_trigger_get(st->trig); |
136 | 136 | ||
137 | return 0; | 137 | return 0; |
138 | 138 | ||
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c index 03b9372c1212..926fccea8de0 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | |||
@@ -135,7 +135,7 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev) | |||
135 | ret = iio_trigger_register(st->trig); | 135 | ret = iio_trigger_register(st->trig); |
136 | if (ret) | 136 | if (ret) |
137 | goto error_free_irq; | 137 | goto error_free_irq; |
138 | indio_dev->trig = st->trig; | 138 | indio_dev->trig = iio_trigger_get(st->trig); |
139 | 139 | ||
140 | return 0; | 140 | return 0; |
141 | 141 | ||
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index c7497009d60a..f0846108d006 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c | |||
@@ -178,7 +178,7 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, | |||
178 | index = of_property_match_string(np, "io-channel-names", | 178 | index = of_property_match_string(np, "io-channel-names", |
179 | name); | 179 | name); |
180 | chan = of_iio_channel_get(np, index); | 180 | chan = of_iio_channel_get(np, index); |
181 | if (!IS_ERR(chan)) | 181 | if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) |
182 | break; | 182 | break; |
183 | else if (name && index >= 0) { | 183 | else if (name && index >= 0) { |
184 | pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", | 184 | pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", |
diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c index a4b64130ac2f..68cae86dbd29 100644 --- a/drivers/iio/magnetometer/st_magn_core.c +++ b/drivers/iio/magnetometer/st_magn_core.c | |||
@@ -42,7 +42,8 @@ | |||
42 | #define ST_MAGN_FS_AVL_5600MG 5600 | 42 | #define ST_MAGN_FS_AVL_5600MG 5600 |
43 | #define ST_MAGN_FS_AVL_8000MG 8000 | 43 | #define ST_MAGN_FS_AVL_8000MG 8000 |
44 | #define ST_MAGN_FS_AVL_8100MG 8100 | 44 | #define ST_MAGN_FS_AVL_8100MG 8100 |
45 | #define ST_MAGN_FS_AVL_10000MG 10000 | 45 | #define ST_MAGN_FS_AVL_12000MG 12000 |
46 | #define ST_MAGN_FS_AVL_16000MG 16000 | ||
46 | 47 | ||
47 | /* CUSTOM VALUES FOR SENSOR 1 */ | 48 | /* CUSTOM VALUES FOR SENSOR 1 */ |
48 | #define ST_MAGN_1_WAI_EXP 0x3c | 49 | #define ST_MAGN_1_WAI_EXP 0x3c |
@@ -69,20 +70,20 @@ | |||
69 | #define ST_MAGN_1_FS_AVL_4700_VAL 0x05 | 70 | #define ST_MAGN_1_FS_AVL_4700_VAL 0x05 |
70 | #define ST_MAGN_1_FS_AVL_5600_VAL 0x06 | 71 | #define ST_MAGN_1_FS_AVL_5600_VAL 0x06 |
71 | #define ST_MAGN_1_FS_AVL_8100_VAL 0x07 | 72 | #define ST_MAGN_1_FS_AVL_8100_VAL 0x07 |
72 | #define ST_MAGN_1_FS_AVL_1300_GAIN_XY 1100 | 73 | #define ST_MAGN_1_FS_AVL_1300_GAIN_XY 909 |
73 | #define ST_MAGN_1_FS_AVL_1900_GAIN_XY 855 | 74 | #define ST_MAGN_1_FS_AVL_1900_GAIN_XY 1169 |
74 | #define ST_MAGN_1_FS_AVL_2500_GAIN_XY 670 | 75 | #define ST_MAGN_1_FS_AVL_2500_GAIN_XY 1492 |
75 | #define ST_MAGN_1_FS_AVL_4000_GAIN_XY 450 | 76 | #define ST_MAGN_1_FS_AVL_4000_GAIN_XY 2222 |
76 | #define ST_MAGN_1_FS_AVL_4700_GAIN_XY 400 | 77 | #define ST_MAGN_1_FS_AVL_4700_GAIN_XY 2500 |
77 | #define ST_MAGN_1_FS_AVL_5600_GAIN_XY 330 | 78 | #define ST_MAGN_1_FS_AVL_5600_GAIN_XY 3030 |
78 | #define ST_MAGN_1_FS_AVL_8100_GAIN_XY 230 | 79 | #define ST_MAGN_1_FS_AVL_8100_GAIN_XY 4347 |
79 | #define ST_MAGN_1_FS_AVL_1300_GAIN_Z 980 | 80 | #define ST_MAGN_1_FS_AVL_1300_GAIN_Z 1020 |
80 | #define ST_MAGN_1_FS_AVL_1900_GAIN_Z 760 | 81 | #define ST_MAGN_1_FS_AVL_1900_GAIN_Z 1315 |
81 | #define ST_MAGN_1_FS_AVL_2500_GAIN_Z 600 | 82 | #define ST_MAGN_1_FS_AVL_2500_GAIN_Z 1666 |
82 | #define ST_MAGN_1_FS_AVL_4000_GAIN_Z 400 | 83 | #define ST_MAGN_1_FS_AVL_4000_GAIN_Z 2500 |
83 | #define ST_MAGN_1_FS_AVL_4700_GAIN_Z 355 | 84 | #define ST_MAGN_1_FS_AVL_4700_GAIN_Z 2816 |
84 | #define ST_MAGN_1_FS_AVL_5600_GAIN_Z 295 | 85 | #define ST_MAGN_1_FS_AVL_5600_GAIN_Z 3389 |
85 | #define ST_MAGN_1_FS_AVL_8100_GAIN_Z 205 | 86 | #define ST_MAGN_1_FS_AVL_8100_GAIN_Z 4878 |
86 | #define ST_MAGN_1_MULTIREAD_BIT false | 87 | #define ST_MAGN_1_MULTIREAD_BIT false |
87 | 88 | ||
88 | /* CUSTOM VALUES FOR SENSOR 2 */ | 89 | /* CUSTOM VALUES FOR SENSOR 2 */ |
@@ -105,10 +106,12 @@ | |||
105 | #define ST_MAGN_2_FS_MASK 0x60 | 106 | #define ST_MAGN_2_FS_MASK 0x60 |
106 | #define ST_MAGN_2_FS_AVL_4000_VAL 0x00 | 107 | #define ST_MAGN_2_FS_AVL_4000_VAL 0x00 |
107 | #define ST_MAGN_2_FS_AVL_8000_VAL 0x01 | 108 | #define ST_MAGN_2_FS_AVL_8000_VAL 0x01 |
108 | #define ST_MAGN_2_FS_AVL_10000_VAL 0x02 | 109 | #define ST_MAGN_2_FS_AVL_12000_VAL 0x02 |
109 | #define ST_MAGN_2_FS_AVL_4000_GAIN 430 | 110 | #define ST_MAGN_2_FS_AVL_16000_VAL 0x03 |
110 | #define ST_MAGN_2_FS_AVL_8000_GAIN 230 | 111 | #define ST_MAGN_2_FS_AVL_4000_GAIN 146 |
111 | #define ST_MAGN_2_FS_AVL_10000_GAIN 230 | 112 | #define ST_MAGN_2_FS_AVL_8000_GAIN 292 |
113 | #define ST_MAGN_2_FS_AVL_12000_GAIN 438 | ||
114 | #define ST_MAGN_2_FS_AVL_16000_GAIN 584 | ||
112 | #define ST_MAGN_2_MULTIREAD_BIT false | 115 | #define ST_MAGN_2_MULTIREAD_BIT false |
113 | #define ST_MAGN_2_OUT_X_L_ADDR 0x28 | 116 | #define ST_MAGN_2_OUT_X_L_ADDR 0x28 |
114 | #define ST_MAGN_2_OUT_Y_L_ADDR 0x2a | 117 | #define ST_MAGN_2_OUT_Y_L_ADDR 0x2a |
@@ -266,9 +269,14 @@ static const struct st_sensors st_magn_sensors[] = { | |||
266 | .gain = ST_MAGN_2_FS_AVL_8000_GAIN, | 269 | .gain = ST_MAGN_2_FS_AVL_8000_GAIN, |
267 | }, | 270 | }, |
268 | [2] = { | 271 | [2] = { |
269 | .num = ST_MAGN_FS_AVL_10000MG, | 272 | .num = ST_MAGN_FS_AVL_12000MG, |
270 | .value = ST_MAGN_2_FS_AVL_10000_VAL, | 273 | .value = ST_MAGN_2_FS_AVL_12000_VAL, |
271 | .gain = ST_MAGN_2_FS_AVL_10000_GAIN, | 274 | .gain = ST_MAGN_2_FS_AVL_12000_GAIN, |
275 | }, | ||
276 | [3] = { | ||
277 | .num = ST_MAGN_FS_AVL_16000MG, | ||
278 | .value = ST_MAGN_2_FS_AVL_16000_VAL, | ||
279 | .gain = ST_MAGN_2_FS_AVL_16000_GAIN, | ||
272 | }, | 280 | }, |
273 | }, | 281 | }, |
274 | }, | 282 | }, |
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index d4c7928a0f36..da8ff124762a 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -586,17 +586,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
586 | init_completion(&isert_conn->conn_wait); | 586 | init_completion(&isert_conn->conn_wait); |
587 | init_completion(&isert_conn->conn_wait_comp_err); | 587 | init_completion(&isert_conn->conn_wait_comp_err); |
588 | kref_init(&isert_conn->conn_kref); | 588 | kref_init(&isert_conn->conn_kref); |
589 | kref_get(&isert_conn->conn_kref); | ||
590 | mutex_init(&isert_conn->conn_mutex); | 589 | mutex_init(&isert_conn->conn_mutex); |
591 | spin_lock_init(&isert_conn->conn_lock); | 590 | spin_lock_init(&isert_conn->conn_lock); |
592 | INIT_LIST_HEAD(&isert_conn->conn_fr_pool); | 591 | INIT_LIST_HEAD(&isert_conn->conn_fr_pool); |
593 | 592 | ||
594 | cma_id->context = isert_conn; | 593 | cma_id->context = isert_conn; |
595 | isert_conn->conn_cm_id = cma_id; | 594 | isert_conn->conn_cm_id = cma_id; |
596 | isert_conn->responder_resources = event->param.conn.responder_resources; | ||
597 | isert_conn->initiator_depth = event->param.conn.initiator_depth; | ||
598 | pr_debug("Using responder_resources: %u initiator_depth: %u\n", | ||
599 | isert_conn->responder_resources, isert_conn->initiator_depth); | ||
600 | 595 | ||
601 | isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN + | 596 | isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN + |
602 | ISER_RX_LOGIN_SIZE, GFP_KERNEL); | 597 | ISER_RX_LOGIN_SIZE, GFP_KERNEL); |
@@ -643,6 +638,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
643 | goto out_rsp_dma_map; | 638 | goto out_rsp_dma_map; |
644 | } | 639 | } |
645 | 640 | ||
641 | /* Set max inflight RDMA READ requests */ | ||
642 | isert_conn->initiator_depth = min_t(u8, | ||
643 | event->param.conn.initiator_depth, | ||
644 | device->dev_attr.max_qp_init_rd_atom); | ||
645 | pr_debug("Using initiator_depth: %u\n", isert_conn->initiator_depth); | ||
646 | |||
646 | isert_conn->conn_device = device; | 647 | isert_conn->conn_device = device; |
647 | isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device); | 648 | isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device); |
648 | if (IS_ERR(isert_conn->conn_pd)) { | 649 | if (IS_ERR(isert_conn->conn_pd)) { |
@@ -746,7 +747,9 @@ isert_connect_release(struct isert_conn *isert_conn) | |||
746 | static void | 747 | static void |
747 | isert_connected_handler(struct rdma_cm_id *cma_id) | 748 | isert_connected_handler(struct rdma_cm_id *cma_id) |
748 | { | 749 | { |
749 | return; | 750 | struct isert_conn *isert_conn = cma_id->context; |
751 | |||
752 | kref_get(&isert_conn->conn_kref); | ||
750 | } | 753 | } |
751 | 754 | ||
752 | static void | 755 | static void |
@@ -798,7 +801,6 @@ isert_disconnect_work(struct work_struct *work) | |||
798 | 801 | ||
799 | wake_up: | 802 | wake_up: |
800 | complete(&isert_conn->conn_wait); | 803 | complete(&isert_conn->conn_wait); |
801 | isert_put_conn(isert_conn); | ||
802 | } | 804 | } |
803 | 805 | ||
804 | static void | 806 | static void |
@@ -3067,7 +3069,6 @@ isert_rdma_accept(struct isert_conn *isert_conn) | |||
3067 | int ret; | 3069 | int ret; |
3068 | 3070 | ||
3069 | memset(&cp, 0, sizeof(struct rdma_conn_param)); | 3071 | memset(&cp, 0, sizeof(struct rdma_conn_param)); |
3070 | cp.responder_resources = isert_conn->responder_resources; | ||
3071 | cp.initiator_depth = isert_conn->initiator_depth; | 3072 | cp.initiator_depth = isert_conn->initiator_depth; |
3072 | cp.retry_count = 7; | 3073 | cp.retry_count = 7; |
3073 | cp.rnr_retry_count = 7; | 3074 | cp.rnr_retry_count = 7; |
@@ -3215,7 +3216,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) | |||
3215 | pr_debug("isert_wait_conn: Starting \n"); | 3216 | pr_debug("isert_wait_conn: Starting \n"); |
3216 | 3217 | ||
3217 | mutex_lock(&isert_conn->conn_mutex); | 3218 | mutex_lock(&isert_conn->conn_mutex); |
3218 | if (isert_conn->conn_cm_id) { | 3219 | if (isert_conn->conn_cm_id && !isert_conn->disconnect) { |
3219 | pr_debug("Calling rdma_disconnect from isert_wait_conn\n"); | 3220 | pr_debug("Calling rdma_disconnect from isert_wait_conn\n"); |
3220 | rdma_disconnect(isert_conn->conn_cm_id); | 3221 | rdma_disconnect(isert_conn->conn_cm_id); |
3221 | } | 3222 | } |
@@ -3234,6 +3235,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) | |||
3234 | wait_for_completion(&isert_conn->conn_wait_comp_err); | 3235 | wait_for_completion(&isert_conn->conn_wait_comp_err); |
3235 | 3236 | ||
3236 | wait_for_completion(&isert_conn->conn_wait); | 3237 | wait_for_completion(&isert_conn->conn_wait); |
3238 | isert_put_conn(isert_conn); | ||
3237 | } | 3239 | } |
3238 | 3240 | ||
3239 | static void isert_free_conn(struct iscsi_conn *conn) | 3241 | static void isert_free_conn(struct iscsi_conn *conn) |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 2dd1d0dd4f7d..6f5d79569136 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -1791,14 +1791,6 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = { | |||
1791 | { | 1791 | { |
1792 | .matches = { | 1792 | .matches = { |
1793 | DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), | 1793 | DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), |
1794 | DMI_MATCH(DMI_PRODUCT_NAME, "LW25-B7HV"), | ||
1795 | }, | ||
1796 | .callback = atkbd_deactivate_fixup, | ||
1797 | }, | ||
1798 | { | ||
1799 | .matches = { | ||
1800 | DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), | ||
1801 | DMI_MATCH(DMI_PRODUCT_NAME, "P1-J273B"), | ||
1802 | }, | 1794 | }, |
1803 | .callback = atkbd_deactivate_fixup, | 1795 | .callback = atkbd_deactivate_fixup, |
1804 | }, | 1796 | }, |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 136b7b204f56..713e3ddb43bd 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -465,6 +465,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { | |||
465 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), | 465 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), |
466 | }, | 466 | }, |
467 | }, | 467 | }, |
468 | { | ||
469 | /* Avatar AVIU-145A6 */ | ||
470 | .matches = { | ||
471 | DMI_MATCH(DMI_SYS_VENDOR, "Intel"), | ||
472 | DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"), | ||
473 | }, | ||
474 | }, | ||
468 | { } | 475 | { } |
469 | }; | 476 | }; |
470 | 477 | ||
@@ -608,6 +615,14 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = { | |||
608 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), | 615 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), |
609 | }, | 616 | }, |
610 | }, | 617 | }, |
618 | { | ||
619 | /* Fujitsu U574 laptop */ | ||
620 | /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */ | ||
621 | .matches = { | ||
622 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), | ||
623 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"), | ||
624 | }, | ||
625 | }, | ||
611 | { } | 626 | { } |
612 | }; | 627 | }; |
613 | 628 | ||
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 3807c3e971cc..f5a98af3b325 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
@@ -1254,6 +1254,8 @@ static int __init i8042_create_aux_port(int idx) | |||
1254 | } else { | 1254 | } else { |
1255 | snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx); | 1255 | snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx); |
1256 | snprintf(serio->phys, sizeof(serio->phys), I8042_MUX_PHYS_DESC, idx + 1); | 1256 | snprintf(serio->phys, sizeof(serio->phys), I8042_MUX_PHYS_DESC, idx + 1); |
1257 | strlcpy(serio->firmware_id, i8042_aux_firmware_id, | ||
1258 | sizeof(serio->firmware_id)); | ||
1257 | } | 1259 | } |
1258 | 1260 | ||
1259 | port->serio = serio; | 1261 | port->serio = serio; |
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig index f60bad491eb6..3c89fcbc621e 100644 --- a/drivers/media/Kconfig +++ b/drivers/media/Kconfig | |||
@@ -182,7 +182,6 @@ config MEDIA_SUBDRV_AUTOSELECT | |||
182 | depends on HAS_IOMEM | 182 | depends on HAS_IOMEM |
183 | select I2C | 183 | select I2C |
184 | select I2C_MUX | 184 | select I2C_MUX |
185 | select SPI | ||
186 | default y | 185 | default y |
187 | help | 186 | help |
188 | By default, a media driver auto-selects all possible ancillary | 187 | By default, a media driver auto-selects all possible ancillary |
diff --git a/drivers/media/dvb-core/dvb-usb-ids.h b/drivers/media/dvb-core/dvb-usb-ids.h index 5135a096bfa6..12ce19c98ded 100644 --- a/drivers/media/dvb-core/dvb-usb-ids.h +++ b/drivers/media/dvb-core/dvb-usb-ids.h | |||
@@ -280,6 +280,8 @@ | |||
280 | #define USB_PID_PCTV_400E 0x020f | 280 | #define USB_PID_PCTV_400E 0x020f |
281 | #define USB_PID_PCTV_450E 0x0222 | 281 | #define USB_PID_PCTV_450E 0x0222 |
282 | #define USB_PID_PCTV_452E 0x021f | 282 | #define USB_PID_PCTV_452E 0x021f |
283 | #define USB_PID_PCTV_78E 0x025a | ||
284 | #define USB_PID_PCTV_79E 0x0262 | ||
283 | #define USB_PID_REALTEK_RTL2831U 0x2831 | 285 | #define USB_PID_REALTEK_RTL2831U 0x2831 |
284 | #define USB_PID_REALTEK_RTL2832U 0x2832 | 286 | #define USB_PID_REALTEK_RTL2832U 0x2832 |
285 | #define USB_PID_TECHNOTREND_CONNECT_S2_3600 0x3007 | 287 | #define USB_PID_TECHNOTREND_CONNECT_S2_3600 0x3007 |
diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c index be4bec2a9640..5c90ea683a7e 100644 --- a/drivers/media/dvb-frontends/af9033.c +++ b/drivers/media/dvb-frontends/af9033.c | |||
@@ -314,6 +314,19 @@ static int af9033_init(struct dvb_frontend *fe) | |||
314 | goto err; | 314 | goto err; |
315 | } | 315 | } |
316 | 316 | ||
317 | /* feed clock to RF tuner */ | ||
318 | switch (state->cfg.tuner) { | ||
319 | case AF9033_TUNER_IT9135_38: | ||
320 | case AF9033_TUNER_IT9135_51: | ||
321 | case AF9033_TUNER_IT9135_52: | ||
322 | case AF9033_TUNER_IT9135_60: | ||
323 | case AF9033_TUNER_IT9135_61: | ||
324 | case AF9033_TUNER_IT9135_62: | ||
325 | ret = af9033_wr_reg(state, 0x80fba8, 0x00); | ||
326 | if (ret < 0) | ||
327 | goto err; | ||
328 | } | ||
329 | |||
317 | /* settings for TS interface */ | 330 | /* settings for TS interface */ |
318 | if (state->cfg.ts_mode == AF9033_TS_MODE_USB) { | 331 | if (state->cfg.ts_mode == AF9033_TS_MODE_USB) { |
319 | ret = af9033_wr_reg_mask(state, 0x80f9a5, 0x00, 0x01); | 332 | ret = af9033_wr_reg_mask(state, 0x80f9a5, 0x00, 0x01); |
diff --git a/drivers/media/dvb-frontends/af9033_priv.h b/drivers/media/dvb-frontends/af9033_priv.h index fc2ad581e302..ded7b67d7526 100644 --- a/drivers/media/dvb-frontends/af9033_priv.h +++ b/drivers/media/dvb-frontends/af9033_priv.h | |||
@@ -1418,7 +1418,7 @@ static const struct reg_val tuner_init_it9135_60[] = { | |||
1418 | { 0x800068, 0x0a }, | 1418 | { 0x800068, 0x0a }, |
1419 | { 0x80006a, 0x03 }, | 1419 | { 0x80006a, 0x03 }, |
1420 | { 0x800070, 0x0a }, | 1420 | { 0x800070, 0x0a }, |
1421 | { 0x800071, 0x05 }, | 1421 | { 0x800071, 0x0a }, |
1422 | { 0x800072, 0x02 }, | 1422 | { 0x800072, 0x02 }, |
1423 | { 0x800075, 0x8c }, | 1423 | { 0x800075, 0x8c }, |
1424 | { 0x800076, 0x8c }, | 1424 | { 0x800076, 0x8c }, |
@@ -1484,7 +1484,6 @@ static const struct reg_val tuner_init_it9135_60[] = { | |||
1484 | { 0x800104, 0x02 }, | 1484 | { 0x800104, 0x02 }, |
1485 | { 0x800105, 0xbe }, | 1485 | { 0x800105, 0xbe }, |
1486 | { 0x800106, 0x00 }, | 1486 | { 0x800106, 0x00 }, |
1487 | { 0x800109, 0x02 }, | ||
1488 | { 0x800115, 0x0a }, | 1487 | { 0x800115, 0x0a }, |
1489 | { 0x800116, 0x03 }, | 1488 | { 0x800116, 0x03 }, |
1490 | { 0x80011a, 0xbe }, | 1489 | { 0x80011a, 0xbe }, |
@@ -1510,7 +1509,6 @@ static const struct reg_val tuner_init_it9135_60[] = { | |||
1510 | { 0x80014b, 0x8c }, | 1509 | { 0x80014b, 0x8c }, |
1511 | { 0x80014d, 0xac }, | 1510 | { 0x80014d, 0xac }, |
1512 | { 0x80014e, 0xc6 }, | 1511 | { 0x80014e, 0xc6 }, |
1513 | { 0x80014f, 0x03 }, | ||
1514 | { 0x800151, 0x1e }, | 1512 | { 0x800151, 0x1e }, |
1515 | { 0x800153, 0xbc }, | 1513 | { 0x800153, 0xbc }, |
1516 | { 0x800178, 0x09 }, | 1514 | { 0x800178, 0x09 }, |
@@ -1522,9 +1520,10 @@ static const struct reg_val tuner_init_it9135_60[] = { | |||
1522 | { 0x80018d, 0x5f }, | 1520 | { 0x80018d, 0x5f }, |
1523 | { 0x80018f, 0xa0 }, | 1521 | { 0x80018f, 0xa0 }, |
1524 | { 0x800190, 0x5a }, | 1522 | { 0x800190, 0x5a }, |
1525 | { 0x80ed02, 0xff }, | 1523 | { 0x800191, 0x00 }, |
1526 | { 0x80ee42, 0xff }, | 1524 | { 0x80ed02, 0x40 }, |
1527 | { 0x80ee82, 0xff }, | 1525 | { 0x80ee42, 0x40 }, |
1526 | { 0x80ee82, 0x40 }, | ||
1528 | { 0x80f000, 0x0f }, | 1527 | { 0x80f000, 0x0f }, |
1529 | { 0x80f01f, 0x8c }, | 1528 | { 0x80f01f, 0x8c }, |
1530 | { 0x80f020, 0x00 }, | 1529 | { 0x80f020, 0x00 }, |
@@ -1699,7 +1698,6 @@ static const struct reg_val tuner_init_it9135_61[] = { | |||
1699 | { 0x800104, 0x02 }, | 1698 | { 0x800104, 0x02 }, |
1700 | { 0x800105, 0xc8 }, | 1699 | { 0x800105, 0xc8 }, |
1701 | { 0x800106, 0x00 }, | 1700 | { 0x800106, 0x00 }, |
1702 | { 0x800109, 0x02 }, | ||
1703 | { 0x800115, 0x0a }, | 1701 | { 0x800115, 0x0a }, |
1704 | { 0x800116, 0x03 }, | 1702 | { 0x800116, 0x03 }, |
1705 | { 0x80011a, 0xc6 }, | 1703 | { 0x80011a, 0xc6 }, |
@@ -1725,7 +1723,6 @@ static const struct reg_val tuner_init_it9135_61[] = { | |||
1725 | { 0x80014b, 0x8c }, | 1723 | { 0x80014b, 0x8c }, |
1726 | { 0x80014d, 0xa8 }, | 1724 | { 0x80014d, 0xa8 }, |
1727 | { 0x80014e, 0xc6 }, | 1725 | { 0x80014e, 0xc6 }, |
1728 | { 0x80014f, 0x03 }, | ||
1729 | { 0x800151, 0x28 }, | 1726 | { 0x800151, 0x28 }, |
1730 | { 0x800153, 0xcc }, | 1727 | { 0x800153, 0xcc }, |
1731 | { 0x800178, 0x09 }, | 1728 | { 0x800178, 0x09 }, |
@@ -1737,9 +1734,10 @@ static const struct reg_val tuner_init_it9135_61[] = { | |||
1737 | { 0x80018d, 0x5f }, | 1734 | { 0x80018d, 0x5f }, |
1738 | { 0x80018f, 0xfb }, | 1735 | { 0x80018f, 0xfb }, |
1739 | { 0x800190, 0x5c }, | 1736 | { 0x800190, 0x5c }, |
1740 | { 0x80ed02, 0xff }, | 1737 | { 0x800191, 0x00 }, |
1741 | { 0x80ee42, 0xff }, | 1738 | { 0x80ed02, 0x40 }, |
1742 | { 0x80ee82, 0xff }, | 1739 | { 0x80ee42, 0x40 }, |
1740 | { 0x80ee82, 0x40 }, | ||
1743 | { 0x80f000, 0x0f }, | 1741 | { 0x80f000, 0x0f }, |
1744 | { 0x80f01f, 0x8c }, | 1742 | { 0x80f01f, 0x8c }, |
1745 | { 0x80f020, 0x00 }, | 1743 | { 0x80f020, 0x00 }, |
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index 1eaf975d3612..62acb10630f9 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c | |||
@@ -1282,19 +1282,12 @@ static int smiapp_set_power(struct v4l2_subdev *subdev, int on) | |||
1282 | 1282 | ||
1283 | mutex_lock(&sensor->power_mutex); | 1283 | mutex_lock(&sensor->power_mutex); |
1284 | 1284 | ||
1285 | /* | 1285 | if (on && !sensor->power_count) { |
1286 | * If the power count is modified from 0 to != 0 or from != 0 | ||
1287 | * to 0, update the power state. | ||
1288 | */ | ||
1289 | if (!sensor->power_count == !on) | ||
1290 | goto out; | ||
1291 | |||
1292 | if (on) { | ||
1293 | /* Power on and perform initialisation. */ | 1286 | /* Power on and perform initialisation. */ |
1294 | ret = smiapp_power_on(sensor); | 1287 | ret = smiapp_power_on(sensor); |
1295 | if (ret < 0) | 1288 | if (ret < 0) |
1296 | goto out; | 1289 | goto out; |
1297 | } else { | 1290 | } else if (!on && sensor->power_count == 1) { |
1298 | smiapp_power_off(sensor); | 1291 | smiapp_power_off(sensor); |
1299 | } | 1292 | } |
1300 | 1293 | ||
@@ -2572,7 +2565,7 @@ static int smiapp_registered(struct v4l2_subdev *subdev) | |||
2572 | 2565 | ||
2573 | this->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; | 2566 | this->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; |
2574 | this->sd.internal_ops = &smiapp_internal_ops; | 2567 | this->sd.internal_ops = &smiapp_internal_ops; |
2575 | this->sd.owner = NULL; | 2568 | this->sd.owner = THIS_MODULE; |
2576 | v4l2_set_subdevdata(&this->sd, client); | 2569 | v4l2_set_subdevdata(&this->sd, client); |
2577 | 2570 | ||
2578 | rval = media_entity_init(&this->sd.entity, | 2571 | rval = media_entity_init(&this->sd.entity, |
diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c index 716bdc57fac6..83f5074706f9 100644 --- a/drivers/media/pci/cx18/cx18-driver.c +++ b/drivers/media/pci/cx18/cx18-driver.c | |||
@@ -1091,6 +1091,7 @@ static int cx18_probe(struct pci_dev *pci_dev, | |||
1091 | setup.addr = ADDR_UNSET; | 1091 | setup.addr = ADDR_UNSET; |
1092 | setup.type = cx->options.tuner; | 1092 | setup.type = cx->options.tuner; |
1093 | setup.mode_mask = T_ANALOG_TV; /* matches TV tuners */ | 1093 | setup.mode_mask = T_ANALOG_TV; /* matches TV tuners */ |
1094 | setup.config = NULL; | ||
1094 | if (cx->options.radio > 0) | 1095 | if (cx->options.radio > 0) |
1095 | setup.mode_mask |= T_RADIO; | 1096 | setup.mode_mask |= T_RADIO; |
1096 | setup.tuner_callback = (setup.type == TUNER_XC2028) ? | 1097 | setup.tuner_callback = (setup.type == TUNER_XC2028) ? |
diff --git a/drivers/media/tuners/tuner_it913x.c b/drivers/media/tuners/tuner_it913x.c index 6f30d7e535b8..3d83c425bccf 100644 --- a/drivers/media/tuners/tuner_it913x.c +++ b/drivers/media/tuners/tuner_it913x.c | |||
@@ -396,6 +396,7 @@ struct dvb_frontend *it913x_attach(struct dvb_frontend *fe, | |||
396 | struct i2c_adapter *i2c_adap, u8 i2c_addr, u8 config) | 396 | struct i2c_adapter *i2c_adap, u8 i2c_addr, u8 config) |
397 | { | 397 | { |
398 | struct it913x_state *state = NULL; | 398 | struct it913x_state *state = NULL; |
399 | int ret; | ||
399 | 400 | ||
400 | /* allocate memory for the internal state */ | 401 | /* allocate memory for the internal state */ |
401 | state = kzalloc(sizeof(struct it913x_state), GFP_KERNEL); | 402 | state = kzalloc(sizeof(struct it913x_state), GFP_KERNEL); |
@@ -425,6 +426,11 @@ struct dvb_frontend *it913x_attach(struct dvb_frontend *fe, | |||
425 | state->tuner_type = config; | 426 | state->tuner_type = config; |
426 | state->firmware_ver = 1; | 427 | state->firmware_ver = 1; |
427 | 428 | ||
429 | /* tuner RF initial */ | ||
430 | ret = it913x_wr_reg(state, PRO_DMOD, 0xec4c, 0x68); | ||
431 | if (ret < 0) | ||
432 | goto error; | ||
433 | |||
428 | fe->tuner_priv = state; | 434 | fe->tuner_priv = state; |
429 | memcpy(&fe->ops.tuner_ops, &it913x_tuner_ops, | 435 | memcpy(&fe->ops.tuner_ops, &it913x_tuner_ops, |
430 | sizeof(struct dvb_tuner_ops)); | 436 | sizeof(struct dvb_tuner_ops)); |
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 75ec1c659fdd..c82beac0e0cb 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c | |||
@@ -1575,6 +1575,10 @@ static const struct usb_device_id af9035_id_table[] = { | |||
1575 | &af9035_props, "Leadtek WinFast DTV Dongle Dual", NULL) }, | 1575 | &af9035_props, "Leadtek WinFast DTV Dongle Dual", NULL) }, |
1576 | { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xf900, | 1576 | { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xf900, |
1577 | &af9035_props, "Hauppauge WinTV-MiniStick 2", NULL) }, | 1577 | &af9035_props, "Hauppauge WinTV-MiniStick 2", NULL) }, |
1578 | { DVB_USB_DEVICE(USB_VID_PCTV, USB_PID_PCTV_78E, | ||
1579 | &af9035_props, "PCTV 78e", RC_MAP_IT913X_V1) }, | ||
1580 | { DVB_USB_DEVICE(USB_VID_PCTV, USB_PID_PCTV_79E, | ||
1581 | &af9035_props, "PCTV 79e", RC_MAP_IT913X_V2) }, | ||
1578 | { } | 1582 | { } |
1579 | }; | 1583 | }; |
1580 | MODULE_DEVICE_TABLE(usb, af9035_id_table); | 1584 | MODULE_DEVICE_TABLE(usb, af9035_id_table); |
diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index a568efaa331c..35fc73a8d0b3 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c | |||
@@ -49,6 +49,9 @@ struct imx6_pcie { | |||
49 | 49 | ||
50 | /* PCIe Port Logic registers (memory-mapped) */ | 50 | /* PCIe Port Logic registers (memory-mapped) */ |
51 | #define PL_OFFSET 0x700 | 51 | #define PL_OFFSET 0x700 |
52 | #define PCIE_PL_PFLR (PL_OFFSET + 0x08) | ||
53 | #define PCIE_PL_PFLR_LINK_STATE_MASK (0x3f << 16) | ||
54 | #define PCIE_PL_PFLR_FORCE_LINK (1 << 15) | ||
52 | #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) | 55 | #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) |
53 | #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) | 56 | #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) |
54 | #define PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING (1 << 29) | 57 | #define PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING (1 << 29) |
@@ -214,6 +217,32 @@ static int imx6q_pcie_abort_handler(unsigned long addr, | |||
214 | static int imx6_pcie_assert_core_reset(struct pcie_port *pp) | 217 | static int imx6_pcie_assert_core_reset(struct pcie_port *pp) |
215 | { | 218 | { |
216 | struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); | 219 | struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); |
220 | u32 val, gpr1, gpr12; | ||
221 | |||
222 | /* | ||
223 | * If the bootloader already enabled the link we need some special | ||
224 | * handling to get the core back into a state where it is safe to | ||
225 | * touch it for configuration. As there is no dedicated reset signal | ||
226 | * wired up for MX6QDL, we need to manually force LTSSM into "detect" | ||
227 | * state before completely disabling LTSSM, which is a prerequisite | ||
228 | * for core configuration. | ||
229 | * | ||
230 | * If both LTSSM_ENABLE and REF_SSP_ENABLE are active we have a strong | ||
231 | * indication that the bootloader activated the link. | ||
232 | */ | ||
233 | regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, &gpr1); | ||
234 | regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, &gpr12); | ||
235 | |||
236 | if ((gpr1 & IMX6Q_GPR1_PCIE_REF_CLK_EN) && | ||
237 | (gpr12 & IMX6Q_GPR12_PCIE_CTL_2)) { | ||
238 | val = readl(pp->dbi_base + PCIE_PL_PFLR); | ||
239 | val &= ~PCIE_PL_PFLR_LINK_STATE_MASK; | ||
240 | val |= PCIE_PL_PFLR_FORCE_LINK; | ||
241 | writel(val, pp->dbi_base + PCIE_PL_PFLR); | ||
242 | |||
243 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, | ||
244 | IMX6Q_GPR12_PCIE_CTL_2, 0 << 10); | ||
245 | } | ||
217 | 246 | ||
218 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, | 247 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, |
219 | IMX6Q_GPR1_PCIE_TEST_PD, 1 << 18); | 248 | IMX6Q_GPR1_PCIE_TEST_PD, 1 << 18); |
@@ -589,6 +618,14 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) | |||
589 | return 0; | 618 | return 0; |
590 | } | 619 | } |
591 | 620 | ||
621 | static void imx6_pcie_shutdown(struct platform_device *pdev) | ||
622 | { | ||
623 | struct imx6_pcie *imx6_pcie = platform_get_drvdata(pdev); | ||
624 | |||
625 | /* bring down link, so bootloader gets clean state in case of reboot */ | ||
626 | imx6_pcie_assert_core_reset(&imx6_pcie->pp); | ||
627 | } | ||
628 | |||
592 | static const struct of_device_id imx6_pcie_of_match[] = { | 629 | static const struct of_device_id imx6_pcie_of_match[] = { |
593 | { .compatible = "fsl,imx6q-pcie", }, | 630 | { .compatible = "fsl,imx6q-pcie", }, |
594 | {}, | 631 | {}, |
@@ -601,6 +638,7 @@ static struct platform_driver imx6_pcie_driver = { | |||
601 | .owner = THIS_MODULE, | 638 | .owner = THIS_MODULE, |
602 | .of_match_table = imx6_pcie_of_match, | 639 | .of_match_table = imx6_pcie_of_match, |
603 | }, | 640 | }, |
641 | .shutdown = imx6_pcie_shutdown, | ||
604 | }; | 642 | }; |
605 | 643 | ||
606 | /* Freescale PCIe driver does not allow module unload */ | 644 | /* Freescale PCIe driver does not allow module unload */ |
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 70741c8c46a0..6cd5160fc057 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -560,19 +560,15 @@ static void disable_slot(struct acpiphp_slot *slot) | |||
560 | slot->flags &= (~SLOT_ENABLED); | 560 | slot->flags &= (~SLOT_ENABLED); |
561 | } | 561 | } |
562 | 562 | ||
563 | static bool acpiphp_no_hotplug(struct acpi_device *adev) | ||
564 | { | ||
565 | return adev && adev->flags.no_hotplug; | ||
566 | } | ||
567 | |||
568 | static bool slot_no_hotplug(struct acpiphp_slot *slot) | 563 | static bool slot_no_hotplug(struct acpiphp_slot *slot) |
569 | { | 564 | { |
570 | struct acpiphp_func *func; | 565 | struct pci_bus *bus = slot->bus; |
566 | struct pci_dev *dev; | ||
571 | 567 | ||
572 | list_for_each_entry(func, &slot->funcs, sibling) | 568 | list_for_each_entry(dev, &bus->devices, bus_list) { |
573 | if (acpiphp_no_hotplug(func_to_acpi_device(func))) | 569 | if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug) |
574 | return true; | 570 | return true; |
575 | 571 | } | |
576 | return false; | 572 | return false; |
577 | } | 573 | } |
578 | 574 | ||
@@ -645,7 +641,7 @@ static void trim_stale_devices(struct pci_dev *dev) | |||
645 | 641 | ||
646 | status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta); | 642 | status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta); |
647 | alive = (ACPI_SUCCESS(status) && device_status_valid(sta)) | 643 | alive = (ACPI_SUCCESS(status) && device_status_valid(sta)) |
648 | || acpiphp_no_hotplug(adev); | 644 | || dev->ignore_hotplug; |
649 | } | 645 | } |
650 | if (!alive) | 646 | if (!alive) |
651 | alive = pci_device_is_present(dev); | 647 | alive = pci_device_is_present(dev); |
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 9da84b8b27d8..5e01ae39ec46 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -506,6 +506,8 @@ static irqreturn_t pcie_isr(int irq, void *dev_id) | |||
506 | { | 506 | { |
507 | struct controller *ctrl = (struct controller *)dev_id; | 507 | struct controller *ctrl = (struct controller *)dev_id; |
508 | struct pci_dev *pdev = ctrl_dev(ctrl); | 508 | struct pci_dev *pdev = ctrl_dev(ctrl); |
509 | struct pci_bus *subordinate = pdev->subordinate; | ||
510 | struct pci_dev *dev; | ||
509 | struct slot *slot = ctrl->slot; | 511 | struct slot *slot = ctrl->slot; |
510 | u16 detected, intr_loc; | 512 | u16 detected, intr_loc; |
511 | 513 | ||
@@ -539,6 +541,16 @@ static irqreturn_t pcie_isr(int irq, void *dev_id) | |||
539 | wake_up(&ctrl->queue); | 541 | wake_up(&ctrl->queue); |
540 | } | 542 | } |
541 | 543 | ||
544 | if (subordinate) { | ||
545 | list_for_each_entry(dev, &subordinate->devices, bus_list) { | ||
546 | if (dev->ignore_hotplug) { | ||
547 | ctrl_dbg(ctrl, "ignoring hotplug event %#06x (%s requested no hotplug)\n", | ||
548 | intr_loc, pci_name(dev)); | ||
549 | return IRQ_HANDLED; | ||
550 | } | ||
551 | } | ||
552 | } | ||
553 | |||
542 | if (!(intr_loc & ~PCI_EXP_SLTSTA_CC)) | 554 | if (!(intr_loc & ~PCI_EXP_SLTSTA_CC)) |
543 | return IRQ_HANDLED; | 555 | return IRQ_HANDLED; |
544 | 556 | ||
diff --git a/drivers/pci/hotplug/pcihp_slot.c b/drivers/pci/hotplug/pcihp_slot.c index e246a10a0d2c..3e36ec8d708a 100644 --- a/drivers/pci/hotplug/pcihp_slot.c +++ b/drivers/pci/hotplug/pcihp_slot.c | |||
@@ -46,7 +46,6 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp) | |||
46 | */ | 46 | */ |
47 | if (pci_is_pcie(dev)) | 47 | if (pci_is_pcie(dev)) |
48 | return; | 48 | return; |
49 | dev_info(&dev->dev, "using default PCI settings\n"); | ||
50 | hpp = &pci_default_type0; | 49 | hpp = &pci_default_type0; |
51 | } | 50 | } |
52 | 51 | ||
@@ -153,7 +152,6 @@ void pci_configure_slot(struct pci_dev *dev) | |||
153 | { | 152 | { |
154 | struct pci_dev *cdev; | 153 | struct pci_dev *cdev; |
155 | struct hotplug_params hpp; | 154 | struct hotplug_params hpp; |
156 | int ret; | ||
157 | 155 | ||
158 | if (!(dev->hdr_type == PCI_HEADER_TYPE_NORMAL || | 156 | if (!(dev->hdr_type == PCI_HEADER_TYPE_NORMAL || |
159 | (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE && | 157 | (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE && |
@@ -163,9 +161,7 @@ void pci_configure_slot(struct pci_dev *dev) | |||
163 | pcie_bus_configure_settings(dev->bus); | 161 | pcie_bus_configure_settings(dev->bus); |
164 | 162 | ||
165 | memset(&hpp, 0, sizeof(hpp)); | 163 | memset(&hpp, 0, sizeof(hpp)); |
166 | ret = pci_get_hp_params(dev, &hpp); | 164 | pci_get_hp_params(dev, &hpp); |
167 | if (ret) | ||
168 | dev_warn(&dev->dev, "no hotplug settings from platform\n"); | ||
169 | 165 | ||
170 | program_hpp_type2(dev, hpp.t2); | 166 | program_hpp_type2(dev, hpp.t2); |
171 | program_hpp_type1(dev, hpp.t1); | 167 | program_hpp_type1(dev, hpp.t1); |
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 4ff8cbb620d3..f833aa271a2e 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig | |||
@@ -214,12 +214,14 @@ config PHY_QCOM_IPQ806X_SATA | |||
214 | config PHY_ST_SPEAR1310_MIPHY | 214 | config PHY_ST_SPEAR1310_MIPHY |
215 | tristate "ST SPEAR1310-MIPHY driver" | 215 | tristate "ST SPEAR1310-MIPHY driver" |
216 | select GENERIC_PHY | 216 | select GENERIC_PHY |
217 | depends on MACH_SPEAR1310 || COMPILE_TEST | ||
217 | help | 218 | help |
218 | Support for ST SPEAr1310 MIPHY which can be used for PCIe and SATA. | 219 | Support for ST SPEAr1310 MIPHY which can be used for PCIe and SATA. |
219 | 220 | ||
220 | config PHY_ST_SPEAR1340_MIPHY | 221 | config PHY_ST_SPEAR1340_MIPHY |
221 | tristate "ST SPEAR1340-MIPHY driver" | 222 | tristate "ST SPEAR1340-MIPHY driver" |
222 | select GENERIC_PHY | 223 | select GENERIC_PHY |
224 | depends on MACH_SPEAR1340 || COMPILE_TEST | ||
223 | help | 225 | help |
224 | Support for ST SPEAr1340 MIPHY which can be used for PCIe and SATA. | 226 | Support for ST SPEAr1340 MIPHY which can be used for PCIe and SATA. |
225 | 227 | ||
diff --git a/drivers/phy/phy-miphy365x.c b/drivers/phy/phy-miphy365x.c index e111baf187ce..e0fb7a1e5a5a 100644 --- a/drivers/phy/phy-miphy365x.c +++ b/drivers/phy/phy-miphy365x.c | |||
@@ -163,6 +163,7 @@ enum miphy_sata_gen { | |||
163 | }; | 163 | }; |
164 | 164 | ||
165 | static u8 rx_tx_spd[] = { | 165 | static u8 rx_tx_spd[] = { |
166 | 0, /* GEN0 doesn't exist. */ | ||
166 | TX_SPDSEL_GEN1_VAL | RX_SPDSEL_GEN1_VAL, | 167 | TX_SPDSEL_GEN1_VAL | RX_SPDSEL_GEN1_VAL, |
167 | TX_SPDSEL_GEN2_VAL | RX_SPDSEL_GEN2_VAL, | 168 | TX_SPDSEL_GEN2_VAL | RX_SPDSEL_GEN2_VAL, |
168 | TX_SPDSEL_GEN3_VAL | RX_SPDSEL_GEN3_VAL | 169 | TX_SPDSEL_GEN3_VAL | RX_SPDSEL_GEN3_VAL |
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c index 337634ad0562..6d77dcd7dcf6 100644 --- a/drivers/regulator/88pm8607.c +++ b/drivers/regulator/88pm8607.c | |||
@@ -319,7 +319,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev, | |||
319 | struct regulator_config *config) | 319 | struct regulator_config *config) |
320 | { | 320 | { |
321 | struct device_node *nproot, *np; | 321 | struct device_node *nproot, *np; |
322 | nproot = of_node_get(pdev->dev.parent->of_node); | 322 | nproot = pdev->dev.parent->of_node; |
323 | if (!nproot) | 323 | if (!nproot) |
324 | return -ENODEV; | 324 | return -ENODEV; |
325 | nproot = of_get_child_by_name(nproot, "regulators"); | 325 | nproot = of_get_child_by_name(nproot, "regulators"); |
diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c index fdb6ea8ae7e6..00033625a09c 100644 --- a/drivers/regulator/da9052-regulator.c +++ b/drivers/regulator/da9052-regulator.c | |||
@@ -422,9 +422,9 @@ static int da9052_regulator_probe(struct platform_device *pdev) | |||
422 | config.init_data = pdata->regulators[pdev->id]; | 422 | config.init_data = pdata->regulators[pdev->id]; |
423 | } else { | 423 | } else { |
424 | #ifdef CONFIG_OF | 424 | #ifdef CONFIG_OF |
425 | struct device_node *nproot, *np; | 425 | struct device_node *nproot = da9052->dev->of_node; |
426 | struct device_node *np; | ||
426 | 427 | ||
427 | nproot = of_node_get(da9052->dev->of_node); | ||
428 | if (!nproot) | 428 | if (!nproot) |
429 | return -ENODEV; | 429 | return -ENODEV; |
430 | 430 | ||
diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c index 9623e9e290bf..3426be89c9f6 100644 --- a/drivers/regulator/max8907-regulator.c +++ b/drivers/regulator/max8907-regulator.c | |||
@@ -226,7 +226,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev) | |||
226 | struct device_node *np, *regulators; | 226 | struct device_node *np, *regulators; |
227 | int ret; | 227 | int ret; |
228 | 228 | ||
229 | np = of_node_get(pdev->dev.parent->of_node); | 229 | np = pdev->dev.parent->of_node; |
230 | if (!np) | 230 | if (!np) |
231 | return 0; | 231 | return 0; |
232 | 232 | ||
diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c index dad2bcd14e96..7770777befc4 100644 --- a/drivers/regulator/max8925-regulator.c +++ b/drivers/regulator/max8925-regulator.c | |||
@@ -250,7 +250,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev, | |||
250 | struct device_node *nproot, *np; | 250 | struct device_node *nproot, *np; |
251 | int rcount; | 251 | int rcount; |
252 | 252 | ||
253 | nproot = of_node_get(pdev->dev.parent->of_node); | 253 | nproot = pdev->dev.parent->of_node; |
254 | if (!nproot) | 254 | if (!nproot) |
255 | return -ENODEV; | 255 | return -ENODEV; |
256 | np = of_get_child_by_name(nproot, "regulators"); | 256 | np = of_get_child_by_name(nproot, "regulators"); |
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 90b4c530dee5..9c31e215a521 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c | |||
@@ -917,7 +917,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, | |||
917 | struct max8997_regulator_data *rdata; | 917 | struct max8997_regulator_data *rdata; |
918 | unsigned int i, dvs_voltage_nr = 1, ret; | 918 | unsigned int i, dvs_voltage_nr = 1, ret; |
919 | 919 | ||
920 | pmic_np = of_node_get(iodev->dev->of_node); | 920 | pmic_np = iodev->dev->of_node; |
921 | if (!pmic_np) { | 921 | if (!pmic_np) { |
922 | dev_err(&pdev->dev, "could not find pmic sub-node\n"); | 922 | dev_err(&pdev->dev, "could not find pmic sub-node\n"); |
923 | return -ENODEV; | 923 | return -ENODEV; |
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index a7ce34d1b5f2..1878e5b567ef 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c | |||
@@ -1427,7 +1427,6 @@ static void palmas_dt_to_pdata(struct device *dev, | |||
1427 | u32 prop; | 1427 | u32 prop; |
1428 | int idx, ret; | 1428 | int idx, ret; |
1429 | 1429 | ||
1430 | node = of_node_get(node); | ||
1431 | regulators = of_get_child_by_name(node, "regulators"); | 1430 | regulators = of_get_child_by_name(node, "regulators"); |
1432 | if (!regulators) { | 1431 | if (!regulators) { |
1433 | dev_info(dev, "regulator node not found\n"); | 1432 | dev_info(dev, "regulator node not found\n"); |
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c index fa7db8847578..e584c998b55f 100644 --- a/drivers/regulator/tps65910-regulator.c +++ b/drivers/regulator/tps65910-regulator.c | |||
@@ -1014,7 +1014,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( | |||
1014 | if (!pmic_plat_data) | 1014 | if (!pmic_plat_data) |
1015 | return NULL; | 1015 | return NULL; |
1016 | 1016 | ||
1017 | np = of_node_get(pdev->dev.parent->of_node); | 1017 | np = pdev->dev.parent->of_node; |
1018 | regulators = of_get_child_by_name(np, "regulators"); | 1018 | regulators = of_get_child_by_name(np, "regulators"); |
1019 | if (!regulators) { | 1019 | if (!regulators) { |
1020 | dev_err(&pdev->dev, "regulator node not found\n"); | 1020 | dev_err(&pdev->dev, "regulator node not found\n"); |
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index ea025e4806b6..191b59793519 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -717,11 +717,21 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr, | |||
717 | return NULL; | 717 | return NULL; |
718 | } | 718 | } |
719 | 719 | ||
720 | if (data_size > ISCSI_DEF_MAX_RECV_SEG_LEN) { | ||
721 | iscsi_conn_printk(KERN_ERR, conn, "Invalid buffer len of %u for login task. Max len is %u\n", data_size, ISCSI_DEF_MAX_RECV_SEG_LEN); | ||
722 | return NULL; | ||
723 | } | ||
724 | |||
720 | task = conn->login_task; | 725 | task = conn->login_task; |
721 | } else { | 726 | } else { |
722 | if (session->state != ISCSI_STATE_LOGGED_IN) | 727 | if (session->state != ISCSI_STATE_LOGGED_IN) |
723 | return NULL; | 728 | return NULL; |
724 | 729 | ||
730 | if (data_size != 0) { | ||
731 | iscsi_conn_printk(KERN_ERR, conn, "Can not send data buffer of len %u for op 0x%x\n", data_size, opcode); | ||
732 | return NULL; | ||
733 | } | ||
734 | |||
725 | BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE); | 735 | BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE); |
726 | BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED); | 736 | BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED); |
727 | 737 | ||
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index d837dc180522..aaea4b98af16 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -733,12 +733,13 @@ static bool scsi_end_request(struct request *req, int error, | |||
733 | } else { | 733 | } else { |
734 | unsigned long flags; | 734 | unsigned long flags; |
735 | 735 | ||
736 | if (bidi_bytes) | ||
737 | scsi_release_bidi_buffers(cmd); | ||
738 | |||
736 | spin_lock_irqsave(q->queue_lock, flags); | 739 | spin_lock_irqsave(q->queue_lock, flags); |
737 | blk_finish_request(req, error); | 740 | blk_finish_request(req, error); |
738 | spin_unlock_irqrestore(q->queue_lock, flags); | 741 | spin_unlock_irqrestore(q->queue_lock, flags); |
739 | 742 | ||
740 | if (bidi_bytes) | ||
741 | scsi_release_bidi_buffers(cmd); | ||
742 | scsi_release_buffers(cmd); | 743 | scsi_release_buffers(cmd); |
743 | scsi_next_command(cmd); | 744 | scsi_next_command(cmd); |
744 | } | 745 | } |
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 48f1d26e6ad9..134fb6eb7b19 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c | |||
@@ -397,24 +397,21 @@ static int davinci_spi_setup(struct spi_device *spi) | |||
397 | struct spi_master *master = spi->master; | 397 | struct spi_master *master = spi->master; |
398 | struct device_node *np = spi->dev.of_node; | 398 | struct device_node *np = spi->dev.of_node; |
399 | bool internal_cs = true; | 399 | bool internal_cs = true; |
400 | unsigned long flags = GPIOF_DIR_OUT; | ||
401 | 400 | ||
402 | dspi = spi_master_get_devdata(spi->master); | 401 | dspi = spi_master_get_devdata(spi->master); |
403 | pdata = &dspi->pdata; | 402 | pdata = &dspi->pdata; |
404 | 403 | ||
405 | flags |= (spi->mode & SPI_CS_HIGH) ? GPIOF_INIT_LOW : GPIOF_INIT_HIGH; | ||
406 | |||
407 | if (!(spi->mode & SPI_NO_CS)) { | 404 | if (!(spi->mode & SPI_NO_CS)) { |
408 | if (np && (master->cs_gpios != NULL) && (spi->cs_gpio >= 0)) { | 405 | if (np && (master->cs_gpios != NULL) && (spi->cs_gpio >= 0)) { |
409 | retval = gpio_request_one(spi->cs_gpio, | 406 | retval = gpio_direction_output( |
410 | flags, dev_name(&spi->dev)); | 407 | spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); |
411 | internal_cs = false; | 408 | internal_cs = false; |
412 | } else if (pdata->chip_sel && | 409 | } else if (pdata->chip_sel && |
413 | spi->chip_select < pdata->num_chipselect && | 410 | spi->chip_select < pdata->num_chipselect && |
414 | pdata->chip_sel[spi->chip_select] != SPI_INTERN_CS) { | 411 | pdata->chip_sel[spi->chip_select] != SPI_INTERN_CS) { |
415 | spi->cs_gpio = pdata->chip_sel[spi->chip_select]; | 412 | spi->cs_gpio = pdata->chip_sel[spi->chip_select]; |
416 | retval = gpio_request_one(spi->cs_gpio, | 413 | retval = gpio_direction_output( |
417 | flags, dev_name(&spi->dev)); | 414 | spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); |
418 | internal_cs = false; | 415 | internal_cs = false; |
419 | } | 416 | } |
420 | 417 | ||
@@ -439,12 +436,6 @@ static int davinci_spi_setup(struct spi_device *spi) | |||
439 | return retval; | 436 | return retval; |
440 | } | 437 | } |
441 | 438 | ||
442 | static void davinci_spi_cleanup(struct spi_device *spi) | ||
443 | { | ||
444 | if (spi->cs_gpio >= 0) | ||
445 | gpio_free(spi->cs_gpio); | ||
446 | } | ||
447 | |||
448 | static int davinci_spi_check_error(struct davinci_spi *dspi, int int_status) | 439 | static int davinci_spi_check_error(struct davinci_spi *dspi, int int_status) |
449 | { | 440 | { |
450 | struct device *sdev = dspi->bitbang.master->dev.parent; | 441 | struct device *sdev = dspi->bitbang.master->dev.parent; |
@@ -956,7 +947,6 @@ static int davinci_spi_probe(struct platform_device *pdev) | |||
956 | master->num_chipselect = pdata->num_chipselect; | 947 | master->num_chipselect = pdata->num_chipselect; |
957 | master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16); | 948 | master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16); |
958 | master->setup = davinci_spi_setup; | 949 | master->setup = davinci_spi_setup; |
959 | master->cleanup = davinci_spi_cleanup; | ||
960 | 950 | ||
961 | dspi->bitbang.chipselect = davinci_spi_chipselect; | 951 | dspi->bitbang.chipselect = davinci_spi_chipselect; |
962 | dspi->bitbang.setup_transfer = davinci_spi_setup_transfer; | 952 | dspi->bitbang.setup_transfer = davinci_spi_setup_transfer; |
@@ -967,6 +957,27 @@ static int davinci_spi_probe(struct platform_device *pdev) | |||
967 | if (dspi->version == SPI_VERSION_2) | 957 | if (dspi->version == SPI_VERSION_2) |
968 | dspi->bitbang.flags |= SPI_READY; | 958 | dspi->bitbang.flags |= SPI_READY; |
969 | 959 | ||
960 | if (pdev->dev.of_node) { | ||
961 | int i; | ||
962 | |||
963 | for (i = 0; i < pdata->num_chipselect; i++) { | ||
964 | int cs_gpio = of_get_named_gpio(pdev->dev.of_node, | ||
965 | "cs-gpios", i); | ||
966 | |||
967 | if (cs_gpio == -EPROBE_DEFER) { | ||
968 | ret = cs_gpio; | ||
969 | goto free_clk; | ||
970 | } | ||
971 | |||
972 | if (gpio_is_valid(cs_gpio)) { | ||
973 | ret = devm_gpio_request(&pdev->dev, cs_gpio, | ||
974 | dev_name(&pdev->dev)); | ||
975 | if (ret) | ||
976 | goto free_clk; | ||
977 | } | ||
978 | } | ||
979 | } | ||
980 | |||
970 | r = platform_get_resource(pdev, IORESOURCE_DMA, 0); | 981 | r = platform_get_resource(pdev, IORESOURCE_DMA, 0); |
971 | if (r) | 982 | if (r) |
972 | dma_rx_chan = r->start; | 983 | dma_rx_chan = r->start; |
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 670f0627f3bf..0dd0623319b0 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c | |||
@@ -547,8 +547,7 @@ static int dw_spi_setup(struct spi_device *spi) | |||
547 | /* Only alloc on first setup */ | 547 | /* Only alloc on first setup */ |
548 | chip = spi_get_ctldata(spi); | 548 | chip = spi_get_ctldata(spi); |
549 | if (!chip) { | 549 | if (!chip) { |
550 | chip = devm_kzalloc(&spi->dev, sizeof(struct chip_data), | 550 | chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); |
551 | GFP_KERNEL); | ||
552 | if (!chip) | 551 | if (!chip) |
553 | return -ENOMEM; | 552 | return -ENOMEM; |
554 | spi_set_ctldata(spi, chip); | 553 | spi_set_ctldata(spi, chip); |
@@ -606,6 +605,14 @@ static int dw_spi_setup(struct spi_device *spi) | |||
606 | return 0; | 605 | return 0; |
607 | } | 606 | } |
608 | 607 | ||
608 | static void dw_spi_cleanup(struct spi_device *spi) | ||
609 | { | ||
610 | struct chip_data *chip = spi_get_ctldata(spi); | ||
611 | |||
612 | kfree(chip); | ||
613 | spi_set_ctldata(spi, NULL); | ||
614 | } | ||
615 | |||
609 | /* Restart the controller, disable all interrupts, clean rx fifo */ | 616 | /* Restart the controller, disable all interrupts, clean rx fifo */ |
610 | static void spi_hw_init(struct dw_spi *dws) | 617 | static void spi_hw_init(struct dw_spi *dws) |
611 | { | 618 | { |
@@ -661,6 +668,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) | |||
661 | master->bus_num = dws->bus_num; | 668 | master->bus_num = dws->bus_num; |
662 | master->num_chipselect = dws->num_cs; | 669 | master->num_chipselect = dws->num_cs; |
663 | master->setup = dw_spi_setup; | 670 | master->setup = dw_spi_setup; |
671 | master->cleanup = dw_spi_cleanup; | ||
664 | master->transfer_one_message = dw_spi_transfer_one_message; | 672 | master->transfer_one_message = dw_spi_transfer_one_message; |
665 | master->max_speed_hz = dws->max_freq; | 673 | master->max_speed_hz = dws->max_freq; |
666 | 674 | ||
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index 8ebd724e4c59..429e11190265 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c | |||
@@ -452,16 +452,16 @@ static int fsl_espi_setup(struct spi_device *spi) | |||
452 | int retval; | 452 | int retval; |
453 | u32 hw_mode; | 453 | u32 hw_mode; |
454 | u32 loop_mode; | 454 | u32 loop_mode; |
455 | struct spi_mpc8xxx_cs *cs = spi->controller_state; | 455 | struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); |
456 | 456 | ||
457 | if (!spi->max_speed_hz) | 457 | if (!spi->max_speed_hz) |
458 | return -EINVAL; | 458 | return -EINVAL; |
459 | 459 | ||
460 | if (!cs) { | 460 | if (!cs) { |
461 | cs = devm_kzalloc(&spi->dev, sizeof(*cs), GFP_KERNEL); | 461 | cs = kzalloc(sizeof(*cs), GFP_KERNEL); |
462 | if (!cs) | 462 | if (!cs) |
463 | return -ENOMEM; | 463 | return -ENOMEM; |
464 | spi->controller_state = cs; | 464 | spi_set_ctldata(spi, cs); |
465 | } | 465 | } |
466 | 466 | ||
467 | mpc8xxx_spi = spi_master_get_devdata(spi->master); | 467 | mpc8xxx_spi = spi_master_get_devdata(spi->master); |
@@ -496,6 +496,14 @@ static int fsl_espi_setup(struct spi_device *spi) | |||
496 | return 0; | 496 | return 0; |
497 | } | 497 | } |
498 | 498 | ||
499 | static void fsl_espi_cleanup(struct spi_device *spi) | ||
500 | { | ||
501 | struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); | ||
502 | |||
503 | kfree(cs); | ||
504 | spi_set_ctldata(spi, NULL); | ||
505 | } | ||
506 | |||
499 | void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) | 507 | void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) |
500 | { | 508 | { |
501 | struct fsl_espi_reg *reg_base = mspi->reg_base; | 509 | struct fsl_espi_reg *reg_base = mspi->reg_base; |
@@ -605,6 +613,7 @@ static struct spi_master * fsl_espi_probe(struct device *dev, | |||
605 | 613 | ||
606 | master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16); | 614 | master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16); |
607 | master->setup = fsl_espi_setup; | 615 | master->setup = fsl_espi_setup; |
616 | master->cleanup = fsl_espi_cleanup; | ||
608 | 617 | ||
609 | mpc8xxx_spi = spi_master_get_devdata(master); | 618 | mpc8xxx_spi = spi_master_get_devdata(master); |
610 | mpc8xxx_spi->spi_do_one_msg = fsl_espi_do_one_msg; | 619 | mpc8xxx_spi->spi_do_one_msg = fsl_espi_do_one_msg; |
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index 9452f6740997..590f31bc0aba 100644 --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c | |||
@@ -425,16 +425,16 @@ static int fsl_spi_setup(struct spi_device *spi) | |||
425 | struct fsl_spi_reg *reg_base; | 425 | struct fsl_spi_reg *reg_base; |
426 | int retval; | 426 | int retval; |
427 | u32 hw_mode; | 427 | u32 hw_mode; |
428 | struct spi_mpc8xxx_cs *cs = spi->controller_state; | 428 | struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); |
429 | 429 | ||
430 | if (!spi->max_speed_hz) | 430 | if (!spi->max_speed_hz) |
431 | return -EINVAL; | 431 | return -EINVAL; |
432 | 432 | ||
433 | if (!cs) { | 433 | if (!cs) { |
434 | cs = devm_kzalloc(&spi->dev, sizeof(*cs), GFP_KERNEL); | 434 | cs = kzalloc(sizeof(*cs), GFP_KERNEL); |
435 | if (!cs) | 435 | if (!cs) |
436 | return -ENOMEM; | 436 | return -ENOMEM; |
437 | spi->controller_state = cs; | 437 | spi_set_ctldata(spi, cs); |
438 | } | 438 | } |
439 | mpc8xxx_spi = spi_master_get_devdata(spi->master); | 439 | mpc8xxx_spi = spi_master_get_devdata(spi->master); |
440 | 440 | ||
@@ -496,9 +496,13 @@ static int fsl_spi_setup(struct spi_device *spi) | |||
496 | static void fsl_spi_cleanup(struct spi_device *spi) | 496 | static void fsl_spi_cleanup(struct spi_device *spi) |
497 | { | 497 | { |
498 | struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); | 498 | struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); |
499 | struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); | ||
499 | 500 | ||
500 | if (mpc8xxx_spi->type == TYPE_GRLIB && gpio_is_valid(spi->cs_gpio)) | 501 | if (mpc8xxx_spi->type == TYPE_GRLIB && gpio_is_valid(spi->cs_gpio)) |
501 | gpio_free(spi->cs_gpio); | 502 | gpio_free(spi->cs_gpio); |
503 | |||
504 | kfree(cs); | ||
505 | spi_set_ctldata(spi, NULL); | ||
502 | } | 506 | } |
503 | 507 | ||
504 | static void fsl_spi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) | 508 | static void fsl_spi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) |
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 1189cfd96477..f1f0a587e4fc 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c | |||
@@ -2136,7 +2136,7 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id) | |||
2136 | cs_gpio); | 2136 | cs_gpio); |
2137 | else if (gpio_direction_output(cs_gpio, 1)) | 2137 | else if (gpio_direction_output(cs_gpio, 1)) |
2138 | dev_err(&adev->dev, | 2138 | dev_err(&adev->dev, |
2139 | "could set gpio %d as output\n", | 2139 | "could not set gpio %d as output\n", |
2140 | cs_gpio); | 2140 | cs_gpio); |
2141 | } | 2141 | } |
2142 | } | 2142 | } |
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index cd0e08b0c9f6..3afc266b666d 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c | |||
@@ -220,7 +220,7 @@ static inline void wait_for_idle(struct rockchip_spi *rs) | |||
220 | do { | 220 | do { |
221 | if (!(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)) | 221 | if (!(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)) |
222 | return; | 222 | return; |
223 | } while (time_before(jiffies, timeout)); | 223 | } while (!time_after(jiffies, timeout)); |
224 | 224 | ||
225 | dev_warn(rs->dev, "spi controller is in busy state!\n"); | 225 | dev_warn(rs->dev, "spi controller is in busy state!\n"); |
226 | } | 226 | } |
@@ -529,7 +529,8 @@ static int rockchip_spi_transfer_one( | |||
529 | int ret = 0; | 529 | int ret = 0; |
530 | struct rockchip_spi *rs = spi_master_get_devdata(master); | 530 | struct rockchip_spi *rs = spi_master_get_devdata(master); |
531 | 531 | ||
532 | WARN_ON((readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)); | 532 | WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) && |
533 | (readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)); | ||
533 | 534 | ||
534 | if (!xfer->tx_buf && !xfer->rx_buf) { | 535 | if (!xfer->tx_buf && !xfer->rx_buf) { |
535 | dev_err(rs->dev, "No buffer for transfer\n"); | 536 | dev_err(rs->dev, "No buffer for transfer\n"); |
diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index 95ac276eaafe..6f0602fd7401 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c | |||
@@ -312,6 +312,8 @@ static int spi_sirfsoc_cmd_transfer(struct spi_device *spi, | |||
312 | u32 cmd; | 312 | u32 cmd; |
313 | 313 | ||
314 | sspi = spi_master_get_devdata(spi->master); | 314 | sspi = spi_master_get_devdata(spi->master); |
315 | writel(SIRFSOC_SPI_FIFO_RESET, sspi->base + SIRFSOC_SPI_TXFIFO_OP); | ||
316 | writel(SIRFSOC_SPI_FIFO_START, sspi->base + SIRFSOC_SPI_TXFIFO_OP); | ||
315 | memcpy(&cmd, sspi->tx, t->len); | 317 | memcpy(&cmd, sspi->tx, t->len); |
316 | if (sspi->word_width == 1 && !(spi->mode & SPI_LSB_FIRST)) | 318 | if (sspi->word_width == 1 && !(spi->mode & SPI_LSB_FIRST)) |
317 | cmd = cpu_to_be32(cmd) >> | 319 | cmd = cpu_to_be32(cmd) >> |
@@ -438,7 +440,8 @@ static void spi_sirfsoc_pio_transfer(struct spi_device *spi, | |||
438 | sspi->tx_word(sspi); | 440 | sspi->tx_word(sspi); |
439 | writel(SIRFSOC_SPI_TXFIFO_EMPTY_INT_EN | | 441 | writel(SIRFSOC_SPI_TXFIFO_EMPTY_INT_EN | |
440 | SIRFSOC_SPI_TX_UFLOW_INT_EN | | 442 | SIRFSOC_SPI_TX_UFLOW_INT_EN | |
441 | SIRFSOC_SPI_RX_OFLOW_INT_EN, | 443 | SIRFSOC_SPI_RX_OFLOW_INT_EN | |
444 | SIRFSOC_SPI_RX_IO_DMA_INT_EN, | ||
442 | sspi->base + SIRFSOC_SPI_INT_EN); | 445 | sspi->base + SIRFSOC_SPI_INT_EN); |
443 | writel(SIRFSOC_SPI_RX_EN | SIRFSOC_SPI_TX_EN, | 446 | writel(SIRFSOC_SPI_RX_EN | SIRFSOC_SPI_TX_EN, |
444 | sspi->base + SIRFSOC_SPI_TX_RX_EN); | 447 | sspi->base + SIRFSOC_SPI_TX_RX_EN); |
diff --git a/drivers/staging/iio/meter/ade7758_trigger.c b/drivers/staging/iio/meter/ade7758_trigger.c index ea01b8f7a2c3..6f45ce0478d7 100644 --- a/drivers/staging/iio/meter/ade7758_trigger.c +++ b/drivers/staging/iio/meter/ade7758_trigger.c | |||
@@ -85,7 +85,7 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) | |||
85 | ret = iio_trigger_register(st->trig); | 85 | ret = iio_trigger_register(st->trig); |
86 | 86 | ||
87 | /* select default trigger */ | 87 | /* select default trigger */ |
88 | indio_dev->trig = st->trig; | 88 | indio_dev->trig = iio_trigger_get(st->trig); |
89 | if (ret) | 89 | if (ret) |
90 | goto error_free_irq; | 90 | goto error_free_irq; |
91 | 91 | ||
diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c index 0dd87d481280..73429f4419df 100644 --- a/drivers/staging/vt6655/hostap.c +++ b/drivers/staging/vt6655/hostap.c | |||
@@ -341,6 +341,9 @@ static int hostap_set_generic_element(struct vnt_private *pDevice, | |||
341 | { | 341 | { |
342 | PSMgmtObject pMgmt = pDevice->pMgmt; | 342 | PSMgmtObject pMgmt = pDevice->pMgmt; |
343 | 343 | ||
344 | if (param->u.generic_elem.len > sizeof(pMgmt->abyWPAIE)) | ||
345 | return -EINVAL; | ||
346 | |||
344 | memcpy(pMgmt->abyWPAIE, | 347 | memcpy(pMgmt->abyWPAIE, |
345 | param->u.generic_elem.data, | 348 | param->u.generic_elem.data, |
346 | param->u.generic_elem.len | 349 | param->u.generic_elem.len |
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 1f4c794f5fcc..260c3e1e312c 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
@@ -4540,6 +4540,7 @@ static void iscsit_logout_post_handler_diffcid( | |||
4540 | { | 4540 | { |
4541 | struct iscsi_conn *l_conn; | 4541 | struct iscsi_conn *l_conn; |
4542 | struct iscsi_session *sess = conn->sess; | 4542 | struct iscsi_session *sess = conn->sess; |
4543 | bool conn_found = false; | ||
4543 | 4544 | ||
4544 | if (!sess) | 4545 | if (!sess) |
4545 | return; | 4546 | return; |
@@ -4548,12 +4549,13 @@ static void iscsit_logout_post_handler_diffcid( | |||
4548 | list_for_each_entry(l_conn, &sess->sess_conn_list, conn_list) { | 4549 | list_for_each_entry(l_conn, &sess->sess_conn_list, conn_list) { |
4549 | if (l_conn->cid == cid) { | 4550 | if (l_conn->cid == cid) { |
4550 | iscsit_inc_conn_usage_count(l_conn); | 4551 | iscsit_inc_conn_usage_count(l_conn); |
4552 | conn_found = true; | ||
4551 | break; | 4553 | break; |
4552 | } | 4554 | } |
4553 | } | 4555 | } |
4554 | spin_unlock_bh(&sess->conn_lock); | 4556 | spin_unlock_bh(&sess->conn_lock); |
4555 | 4557 | ||
4556 | if (!l_conn) | 4558 | if (!conn_found) |
4557 | return; | 4559 | return; |
4558 | 4560 | ||
4559 | if (l_conn->sock) | 4561 | if (l_conn->sock) |
diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c index 02f9de26f38a..18c29260b4a2 100644 --- a/drivers/target/iscsi/iscsi_target_parameters.c +++ b/drivers/target/iscsi/iscsi_target_parameters.c | |||
@@ -601,7 +601,7 @@ int iscsi_copy_param_list( | |||
601 | param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL); | 601 | param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL); |
602 | if (!param_list) { | 602 | if (!param_list) { |
603 | pr_err("Unable to allocate memory for struct iscsi_param_list.\n"); | 603 | pr_err("Unable to allocate memory for struct iscsi_param_list.\n"); |
604 | goto err_out; | 604 | return -1; |
605 | } | 605 | } |
606 | INIT_LIST_HEAD(¶m_list->param_list); | 606 | INIT_LIST_HEAD(¶m_list->param_list); |
607 | INIT_LIST_HEAD(¶m_list->extra_response_list); | 607 | INIT_LIST_HEAD(¶m_list->extra_response_list); |
diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index fd90b28f1d94..73355f4fca74 100644 --- a/drivers/target/iscsi/iscsi_target_util.c +++ b/drivers/target/iscsi/iscsi_target_util.c | |||
@@ -400,6 +400,8 @@ struct iscsi_cmd *iscsit_find_cmd_from_itt_or_dump( | |||
400 | 400 | ||
401 | spin_lock_bh(&conn->cmd_lock); | 401 | spin_lock_bh(&conn->cmd_lock); |
402 | list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) { | 402 | list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) { |
403 | if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT) | ||
404 | continue; | ||
403 | if (cmd->init_task_tag == init_task_tag) { | 405 | if (cmd->init_task_tag == init_task_tag) { |
404 | spin_unlock_bh(&conn->cmd_lock); | 406 | spin_unlock_bh(&conn->cmd_lock); |
405 | return cmd; | 407 | return cmd; |
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index bf55c5a04cfa..756def38c77a 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c | |||
@@ -2363,7 +2363,7 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_support_##_name(\ | |||
2363 | pr_err("Invalid value '%ld', must be '0' or '1'\n", tmp); \ | 2363 | pr_err("Invalid value '%ld', must be '0' or '1'\n", tmp); \ |
2364 | return -EINVAL; \ | 2364 | return -EINVAL; \ |
2365 | } \ | 2365 | } \ |
2366 | if (!tmp) \ | 2366 | if (tmp) \ |
2367 | t->_var |= _bit; \ | 2367 | t->_var |= _bit; \ |
2368 | else \ | 2368 | else \ |
2369 | t->_var &= ~_bit; \ | 2369 | t->_var &= ~_bit; \ |
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index 6cd7222738fc..bc286a67af7c 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c | |||
@@ -664,7 +664,7 @@ spc_emulate_evpd_b3(struct se_cmd *cmd, unsigned char *buf) | |||
664 | buf[0] = dev->transport->get_device_type(dev); | 664 | buf[0] = dev->transport->get_device_type(dev); |
665 | buf[3] = 0x0c; | 665 | buf[3] = 0x0c; |
666 | put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[8]); | 666 | put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[8]); |
667 | put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[12]); | 667 | put_unaligned_be32(dev->t10_alua.lba_map_segment_multiplier, &buf[12]); |
668 | 668 | ||
669 | return 0; | 669 | return 0; |
670 | } | 670 | } |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 81cda09b47e3..488a30836c36 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -965,8 +965,6 @@ rescan: | |||
965 | } | 965 | } |
966 | 966 | ||
967 | qh->exception = 1; | 967 | qh->exception = 1; |
968 | if (ehci->rh_state < EHCI_RH_RUNNING) | ||
969 | qh->qh_state = QH_STATE_IDLE; | ||
970 | switch (qh->qh_state) { | 968 | switch (qh->qh_state) { |
971 | case QH_STATE_LINKED: | 969 | case QH_STATE_LINKED: |
972 | WARN_ON(!list_empty(&qh->qtd_list)); | 970 | WARN_ON(!list_empty(&qh->qtd_list)); |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 60cfcbc78552..4a5c68a47e46 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -101,6 +101,12 @@ UNUSUAL_DEV( 0x03f0, 0x4002, 0x0001, 0x0001, | |||
101 | "PhotoSmart R707", | 101 | "PhotoSmart R707", |
102 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), | 102 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), |
103 | 103 | ||
104 | UNUSUAL_DEV( 0x03f3, 0x0001, 0x0000, 0x9999, | ||
105 | "Adaptec", | ||
106 | "USBConnect 2000", | ||
107 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, | ||
108 | US_FL_SCM_MULT_TARG ), | ||
109 | |||
104 | /* Reported by Sebastian Kapfer <sebastian_kapfer@gmx.net> | 110 | /* Reported by Sebastian Kapfer <sebastian_kapfer@gmx.net> |
105 | * and Olaf Hering <olh@suse.de> (different bcd's, same vendor/product) | 111 | * and Olaf Hering <olh@suse.de> (different bcd's, same vendor/product) |
106 | * for USB floppies that need the SINGLE_LUN enforcement. | 112 | * for USB floppies that need the SINGLE_LUN enforcement. |
@@ -1125,6 +1131,18 @@ UNUSUAL_DEV( 0x0851, 0x1543, 0x0200, 0x0200, | |||
1125 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 1131 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
1126 | US_FL_NOT_LOCKABLE), | 1132 | US_FL_NOT_LOCKABLE), |
1127 | 1133 | ||
1134 | UNUSUAL_DEV( 0x085a, 0x0026, 0x0100, 0x0133, | ||
1135 | "Xircom", | ||
1136 | "PortGear USB-SCSI (Mac USB Dock)", | ||
1137 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, | ||
1138 | US_FL_SCM_MULT_TARG ), | ||
1139 | |||
1140 | UNUSUAL_DEV( 0x085a, 0x0028, 0x0100, 0x0133, | ||
1141 | "Xircom", | ||
1142 | "PortGear USB to SCSI Converter", | ||
1143 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, | ||
1144 | US_FL_SCM_MULT_TARG ), | ||
1145 | |||
1128 | /* Submitted by Jan De Luyck <lkml@kcore.org> */ | 1146 | /* Submitted by Jan De Luyck <lkml@kcore.org> */ |
1129 | UNUSUAL_DEV( 0x08bd, 0x1100, 0x0000, 0x0000, | 1147 | UNUSUAL_DEV( 0x08bd, 0x1100, 0x0000, 0x0000, |
1130 | "CITIZEN", | 1148 | "CITIZEN", |
@@ -1964,6 +1982,14 @@ UNUSUAL_DEV( 0x152d, 0x2329, 0x0100, 0x0100, | |||
1964 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 1982 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
1965 | US_FL_IGNORE_RESIDUE | US_FL_SANE_SENSE ), | 1983 | US_FL_IGNORE_RESIDUE | US_FL_SANE_SENSE ), |
1966 | 1984 | ||
1985 | /* Entrega Technologies U1-SC25 (later Xircom PortGear PGSCSI) | ||
1986 | * and Mac USB Dock USB-SCSI */ | ||
1987 | UNUSUAL_DEV( 0x1645, 0x0007, 0x0100, 0x0133, | ||
1988 | "Entrega Technologies", | ||
1989 | "USB to SCSI Converter", | ||
1990 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, | ||
1991 | US_FL_SCM_MULT_TARG ), | ||
1992 | |||
1967 | /* Reported by Robert Schedel <r.schedel@yahoo.de> | 1993 | /* Reported by Robert Schedel <r.schedel@yahoo.de> |
1968 | * Note: this is a 'super top' device like the above 14cd/6600 device */ | 1994 | * Note: this is a 'super top' device like the above 14cd/6600 device */ |
1969 | UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201, | 1995 | UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201, |
@@ -1986,6 +2012,12 @@ UNUSUAL_DEV( 0x177f, 0x0400, 0x0000, 0x0000, | |||
1986 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 2012 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
1987 | US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ), | 2013 | US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ), |
1988 | 2014 | ||
2015 | UNUSUAL_DEV( 0x1822, 0x0001, 0x0000, 0x9999, | ||
2016 | "Ariston Technologies", | ||
2017 | "iConnect USB to SCSI adapter", | ||
2018 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, | ||
2019 | US_FL_SCM_MULT_TARG ), | ||
2020 | |||
1989 | /* Reported by Hans de Goede <hdegoede@redhat.com> | 2021 | /* Reported by Hans de Goede <hdegoede@redhat.com> |
1990 | * These Appotech controllers are found in Picture Frames, they provide a | 2022 | * These Appotech controllers are found in Picture Frames, they provide a |
1991 | * (buggy) emulation of a cdrom drive which contains the windows software | 2023 | * (buggy) emulation of a cdrom drive which contains the windows software |
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 43527fd78825..56b8522d5767 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h | |||
@@ -234,8 +234,17 @@ static inline int btrfs_inode_in_log(struct inode *inode, u64 generation) | |||
234 | BTRFS_I(inode)->last_sub_trans <= | 234 | BTRFS_I(inode)->last_sub_trans <= |
235 | BTRFS_I(inode)->last_log_commit && | 235 | BTRFS_I(inode)->last_log_commit && |
236 | BTRFS_I(inode)->last_sub_trans <= | 236 | BTRFS_I(inode)->last_sub_trans <= |
237 | BTRFS_I(inode)->root->last_log_commit) | 237 | BTRFS_I(inode)->root->last_log_commit) { |
238 | return 1; | 238 | /* |
239 | * After a ranged fsync we might have left some extent maps | ||
240 | * (that fall outside the fsync's range). So return false | ||
241 | * here if the list isn't empty, to make sure btrfs_log_inode() | ||
242 | * will be called and process those extent maps. | ||
243 | */ | ||
244 | smp_mb(); | ||
245 | if (list_empty(&BTRFS_I(inode)->extent_tree.modified_extents)) | ||
246 | return 1; | ||
247 | } | ||
239 | return 0; | 248 | return 0; |
240 | } | 249 | } |
241 | 250 | ||
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index d296efe2d3e7..1d1ba083ca6e 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -4093,18 +4093,8 @@ log_extents: | |||
4093 | } | 4093 | } |
4094 | } | 4094 | } |
4095 | 4095 | ||
4096 | write_lock(&em_tree->lock); | 4096 | BTRFS_I(inode)->logged_trans = trans->transid; |
4097 | /* | 4097 | BTRFS_I(inode)->last_log_commit = BTRFS_I(inode)->last_sub_trans; |
4098 | * If we're doing a ranged fsync and there are still modified extents | ||
4099 | * in the list, we must run on the next fsync call as it might cover | ||
4100 | * those extents (a full fsync or an fsync for other range). | ||
4101 | */ | ||
4102 | if (list_empty(&em_tree->modified_extents)) { | ||
4103 | BTRFS_I(inode)->logged_trans = trans->transid; | ||
4104 | BTRFS_I(inode)->last_log_commit = | ||
4105 | BTRFS_I(inode)->last_sub_trans; | ||
4106 | } | ||
4107 | write_unlock(&em_tree->lock); | ||
4108 | out_unlock: | 4098 | out_unlock: |
4109 | if (unlikely(err)) | 4099 | if (unlikely(err)) |
4110 | btrfs_put_logged_extents(&logged_list); | 4100 | btrfs_put_logged_extents(&logged_list); |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 340a92d08e84..2c2d6d1d8eee 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -529,12 +529,12 @@ static noinline int device_list_add(const char *path, | |||
529 | */ | 529 | */ |
530 | 530 | ||
531 | /* | 531 | /* |
532 | * As of now don't allow update to btrfs_fs_device through | 532 | * For now, we do allow update to btrfs_fs_device through the |
533 | * the btrfs dev scan cli, after FS has been mounted. | 533 | * btrfs dev scan cli after FS has been mounted. We're still |
534 | * tracking a problem where systems fail mount by subvolume id | ||
535 | * when we reject replacement on a mounted FS. | ||
534 | */ | 536 | */ |
535 | if (fs_devices->opened) { | 537 | if (!fs_devices->opened && found_transid < device->generation) { |
536 | return -EBUSY; | ||
537 | } else { | ||
538 | /* | 538 | /* |
539 | * That is if the FS is _not_ mounted and if you | 539 | * That is if the FS is _not_ mounted and if you |
540 | * are here, that means there is more than one | 540 | * are here, that means there is more than one |
@@ -542,8 +542,7 @@ static noinline int device_list_add(const char *path, | |||
542 | * with larger generation number or the last-in if | 542 | * with larger generation number or the last-in if |
543 | * generation are equal. | 543 | * generation are equal. |
544 | */ | 544 | */ |
545 | if (found_transid < device->generation) | 545 | return -EEXIST; |
546 | return -EEXIST; | ||
547 | } | 546 | } |
548 | 547 | ||
549 | name = rcu_string_strdup(path, GFP_NOFS); | 548 | name = rcu_string_strdup(path, GFP_NOFS); |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index b0fafa499505..002e0c173939 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -136,5 +136,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); | |||
136 | extern const struct export_operations cifs_export_ops; | 136 | extern const struct export_operations cifs_export_ops; |
137 | #endif /* CONFIG_CIFS_NFSD_EXPORT */ | 137 | #endif /* CONFIG_CIFS_NFSD_EXPORT */ |
138 | 138 | ||
139 | #define CIFS_VERSION "2.04" | 139 | #define CIFS_VERSION "2.05" |
140 | #endif /* _CIFSFS_H */ | 140 | #endif /* _CIFSFS_H */ |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 8a9fded7c135..36ca2045009b 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -837,6 +837,7 @@ cifs_demultiplex_thread(void *p) | |||
837 | struct TCP_Server_Info *server = p; | 837 | struct TCP_Server_Info *server = p; |
838 | unsigned int pdu_length; | 838 | unsigned int pdu_length; |
839 | char *buf = NULL; | 839 | char *buf = NULL; |
840 | struct task_struct *task_to_wake = NULL; | ||
840 | struct mid_q_entry *mid_entry; | 841 | struct mid_q_entry *mid_entry; |
841 | 842 | ||
842 | current->flags |= PF_MEMALLOC; | 843 | current->flags |= PF_MEMALLOC; |
@@ -927,7 +928,19 @@ cifs_demultiplex_thread(void *p) | |||
927 | if (server->smallbuf) /* no sense logging a debug message if NULL */ | 928 | if (server->smallbuf) /* no sense logging a debug message if NULL */ |
928 | cifs_small_buf_release(server->smallbuf); | 929 | cifs_small_buf_release(server->smallbuf); |
929 | 930 | ||
931 | task_to_wake = xchg(&server->tsk, NULL); | ||
930 | clean_demultiplex_info(server); | 932 | clean_demultiplex_info(server); |
933 | |||
934 | /* if server->tsk was NULL then wait for a signal before exiting */ | ||
935 | if (!task_to_wake) { | ||
936 | set_current_state(TASK_INTERRUPTIBLE); | ||
937 | while (!signal_pending(current)) { | ||
938 | schedule(); | ||
939 | set_current_state(TASK_INTERRUPTIBLE); | ||
940 | } | ||
941 | set_current_state(TASK_RUNNING); | ||
942 | } | ||
943 | |||
931 | module_put_and_exit(0); | 944 | module_put_and_exit(0); |
932 | } | 945 | } |
933 | 946 | ||
@@ -2050,6 +2063,8 @@ cifs_find_tcp_session(struct smb_vol *vol) | |||
2050 | static void | 2063 | static void |
2051 | cifs_put_tcp_session(struct TCP_Server_Info *server) | 2064 | cifs_put_tcp_session(struct TCP_Server_Info *server) |
2052 | { | 2065 | { |
2066 | struct task_struct *task; | ||
2067 | |||
2053 | spin_lock(&cifs_tcp_ses_lock); | 2068 | spin_lock(&cifs_tcp_ses_lock); |
2054 | if (--server->srv_count > 0) { | 2069 | if (--server->srv_count > 0) { |
2055 | spin_unlock(&cifs_tcp_ses_lock); | 2070 | spin_unlock(&cifs_tcp_ses_lock); |
@@ -2073,6 +2088,10 @@ cifs_put_tcp_session(struct TCP_Server_Info *server) | |||
2073 | kfree(server->session_key.response); | 2088 | kfree(server->session_key.response); |
2074 | server->session_key.response = NULL; | 2089 | server->session_key.response = NULL; |
2075 | server->session_key.len = 0; | 2090 | server->session_key.len = 0; |
2091 | |||
2092 | task = xchg(&server->tsk, NULL); | ||
2093 | if (task) | ||
2094 | force_sig(SIGKILL, task); | ||
2076 | } | 2095 | } |
2077 | 2096 | ||
2078 | static struct TCP_Server_Info * | 2097 | static struct TCP_Server_Info * |
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 68559fd557fb..5657416d3483 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
@@ -213,8 +213,12 @@ create_mf_symlink(const unsigned int xid, struct cifs_tcon *tcon, | |||
213 | if (rc) | 213 | if (rc) |
214 | goto out; | 214 | goto out; |
215 | 215 | ||
216 | rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb, | 216 | if (tcon->ses->server->ops->create_mf_symlink) |
217 | fromName, buf, &bytes_written); | 217 | rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, |
218 | cifs_sb, fromName, buf, &bytes_written); | ||
219 | else | ||
220 | rc = -EOPNOTSUPP; | ||
221 | |||
218 | if (rc) | 222 | if (rc) |
219 | goto out; | 223 | goto out; |
220 | 224 | ||
@@ -339,9 +343,11 @@ cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon, | |||
339 | if (rc) | 343 | if (rc) |
340 | return rc; | 344 | return rc; |
341 | 345 | ||
342 | if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) | 346 | if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) { |
347 | rc = -ENOENT; | ||
343 | /* it's not a symlink */ | 348 | /* it's not a symlink */ |
344 | goto out; | 349 | goto out; |
350 | } | ||
345 | 351 | ||
346 | io_parms.netfid = fid.netfid; | 352 | io_parms.netfid = fid.netfid; |
347 | io_parms.pid = current->tgid; | 353 | io_parms.pid = current->tgid; |
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index 6834b9c3bec1..b333ff60781d 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c | |||
@@ -925,11 +925,23 @@ cifs_NTtimeToUnix(__le64 ntutc) | |||
925 | /* BB what about the timezone? BB */ | 925 | /* BB what about the timezone? BB */ |
926 | 926 | ||
927 | /* Subtract the NTFS time offset, then convert to 1s intervals. */ | 927 | /* Subtract the NTFS time offset, then convert to 1s intervals. */ |
928 | u64 t; | 928 | s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET; |
929 | |||
930 | /* | ||
931 | * Unfortunately can not use normal 64 bit division on 32 bit arch, but | ||
932 | * the alternative, do_div, does not work with negative numbers so have | ||
933 | * to special case them | ||
934 | */ | ||
935 | if (t < 0) { | ||
936 | t = -t; | ||
937 | ts.tv_nsec = (long)(do_div(t, 10000000) * 100); | ||
938 | ts.tv_nsec = -ts.tv_nsec; | ||
939 | ts.tv_sec = -t; | ||
940 | } else { | ||
941 | ts.tv_nsec = (long)do_div(t, 10000000) * 100; | ||
942 | ts.tv_sec = t; | ||
943 | } | ||
929 | 944 | ||
930 | t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET; | ||
931 | ts.tv_nsec = do_div(t, 10000000) * 100; | ||
932 | ts.tv_sec = t; | ||
933 | return ts; | 945 | return ts; |
934 | } | 946 | } |
935 | 947 | ||
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 3a5e83317683..57db63ff88da 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c | |||
@@ -745,14 +745,6 @@ out: | |||
745 | sess_free_buffer(sess_data); | 745 | sess_free_buffer(sess_data); |
746 | } | 746 | } |
747 | 747 | ||
748 | #else | ||
749 | |||
750 | static void | ||
751 | sess_auth_lanman(struct sess_data *sess_data) | ||
752 | { | ||
753 | sess_data->result = -EOPNOTSUPP; | ||
754 | sess_data->func = NULL; | ||
755 | } | ||
756 | #endif | 748 | #endif |
757 | 749 | ||
758 | static void | 750 | static void |
@@ -1103,15 +1095,6 @@ out: | |||
1103 | ses->auth_key.response = NULL; | 1095 | ses->auth_key.response = NULL; |
1104 | } | 1096 | } |
1105 | 1097 | ||
1106 | #else | ||
1107 | |||
1108 | static void | ||
1109 | sess_auth_kerberos(struct sess_data *sess_data) | ||
1110 | { | ||
1111 | cifs_dbg(VFS, "Kerberos negotiated but upcall support disabled!\n"); | ||
1112 | sess_data->result = -ENOSYS; | ||
1113 | sess_data->func = NULL; | ||
1114 | } | ||
1115 | #endif /* ! CONFIG_CIFS_UPCALL */ | 1098 | #endif /* ! CONFIG_CIFS_UPCALL */ |
1116 | 1099 | ||
1117 | /* | 1100 | /* |
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index e6ee5b6e8d99..f0b945ab853e 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -359,7 +359,7 @@ static inline void release_metapath(struct metapath *mp) | |||
359 | * Returns: The length of the extent (minimum of one block) | 359 | * Returns: The length of the extent (minimum of one block) |
360 | */ | 360 | */ |
361 | 361 | ||
362 | static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, unsigned limit, int *eob) | 362 | static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, size_t limit, int *eob) |
363 | { | 363 | { |
364 | const __be64 *end = (start + len); | 364 | const __be64 *end = (start + len); |
365 | const __be64 *first = ptr; | 365 | const __be64 *first = ptr; |
@@ -449,7 +449,7 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock, | |||
449 | struct buffer_head *bh_map, struct metapath *mp, | 449 | struct buffer_head *bh_map, struct metapath *mp, |
450 | const unsigned int sheight, | 450 | const unsigned int sheight, |
451 | const unsigned int height, | 451 | const unsigned int height, |
452 | const unsigned int maxlen) | 452 | const size_t maxlen) |
453 | { | 453 | { |
454 | struct gfs2_inode *ip = GFS2_I(inode); | 454 | struct gfs2_inode *ip = GFS2_I(inode); |
455 | struct gfs2_sbd *sdp = GFS2_SB(inode); | 455 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
@@ -483,7 +483,8 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock, | |||
483 | } else { | 483 | } else { |
484 | /* Need to allocate indirect blocks */ | 484 | /* Need to allocate indirect blocks */ |
485 | ptrs_per_blk = height > 1 ? sdp->sd_inptrs : sdp->sd_diptrs; | 485 | ptrs_per_blk = height > 1 ? sdp->sd_inptrs : sdp->sd_diptrs; |
486 | dblks = min(maxlen, ptrs_per_blk - mp->mp_list[end_of_metadata]); | 486 | dblks = min(maxlen, (size_t)(ptrs_per_blk - |
487 | mp->mp_list[end_of_metadata])); | ||
487 | if (height == ip->i_height) { | 488 | if (height == ip->i_height) { |
488 | /* Writing into existing tree, extend tree down */ | 489 | /* Writing into existing tree, extend tree down */ |
489 | iblks = height - sheight; | 490 | iblks = height - sheight; |
@@ -605,7 +606,7 @@ int gfs2_block_map(struct inode *inode, sector_t lblock, | |||
605 | struct gfs2_inode *ip = GFS2_I(inode); | 606 | struct gfs2_inode *ip = GFS2_I(inode); |
606 | struct gfs2_sbd *sdp = GFS2_SB(inode); | 607 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
607 | unsigned int bsize = sdp->sd_sb.sb_bsize; | 608 | unsigned int bsize = sdp->sd_sb.sb_bsize; |
608 | const unsigned int maxlen = bh_map->b_size >> inode->i_blkbits; | 609 | const size_t maxlen = bh_map->b_size >> inode->i_blkbits; |
609 | const u64 *arr = sdp->sd_heightsize; | 610 | const u64 *arr = sdp->sd_heightsize; |
610 | __be64 *ptr; | 611 | __be64 *ptr; |
611 | u64 size; | 612 | u64 size; |
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 26b3f952e6b1..7f4ed3daa38c 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/dlm.h> | 26 | #include <linux/dlm.h> |
27 | #include <linux/dlm_plock.h> | 27 | #include <linux/dlm_plock.h> |
28 | #include <linux/aio.h> | 28 | #include <linux/aio.h> |
29 | #include <linux/delay.h> | ||
29 | 30 | ||
30 | #include "gfs2.h" | 31 | #include "gfs2.h" |
31 | #include "incore.h" | 32 | #include "incore.h" |
@@ -979,9 +980,10 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) | |||
979 | unsigned int state; | 980 | unsigned int state; |
980 | int flags; | 981 | int flags; |
981 | int error = 0; | 982 | int error = 0; |
983 | int sleeptime; | ||
982 | 984 | ||
983 | state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; | 985 | state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; |
984 | flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY) | GL_EXACT; | 986 | flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY_1CB) | GL_EXACT; |
985 | 987 | ||
986 | mutex_lock(&fp->f_fl_mutex); | 988 | mutex_lock(&fp->f_fl_mutex); |
987 | 989 | ||
@@ -1001,7 +1003,14 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) | |||
1001 | gfs2_holder_init(gl, state, flags, fl_gh); | 1003 | gfs2_holder_init(gl, state, flags, fl_gh); |
1002 | gfs2_glock_put(gl); | 1004 | gfs2_glock_put(gl); |
1003 | } | 1005 | } |
1004 | error = gfs2_glock_nq(fl_gh); | 1006 | for (sleeptime = 1; sleeptime <= 4; sleeptime <<= 1) { |
1007 | error = gfs2_glock_nq(fl_gh); | ||
1008 | if (error != GLR_TRYFAILED) | ||
1009 | break; | ||
1010 | fl_gh->gh_flags = LM_FLAG_TRY | GL_EXACT; | ||
1011 | fl_gh->gh_error = 0; | ||
1012 | msleep(sleeptime); | ||
1013 | } | ||
1005 | if (error) { | 1014 | if (error) { |
1006 | gfs2_holder_uninit(fl_gh); | 1015 | gfs2_holder_uninit(fl_gh); |
1007 | if (error == GLR_TRYFAILED) | 1016 | if (error == GLR_TRYFAILED) |
@@ -1024,7 +1033,7 @@ static void do_unflock(struct file *file, struct file_lock *fl) | |||
1024 | mutex_lock(&fp->f_fl_mutex); | 1033 | mutex_lock(&fp->f_fl_mutex); |
1025 | flock_lock_file_wait(file, fl); | 1034 | flock_lock_file_wait(file, fl); |
1026 | if (fl_gh->gh_gl) { | 1035 | if (fl_gh->gh_gl) { |
1027 | gfs2_glock_dq_wait(fl_gh); | 1036 | gfs2_glock_dq(fl_gh); |
1028 | gfs2_holder_uninit(fl_gh); | 1037 | gfs2_holder_uninit(fl_gh); |
1029 | } | 1038 | } |
1030 | mutex_unlock(&fp->f_fl_mutex); | 1039 | mutex_unlock(&fp->f_fl_mutex); |
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 67d310c9ada3..39e7e9959b74 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -262,6 +262,9 @@ struct gfs2_holder { | |||
262 | unsigned long gh_ip; | 262 | unsigned long gh_ip; |
263 | }; | 263 | }; |
264 | 264 | ||
265 | /* Number of quota types we support */ | ||
266 | #define GFS2_MAXQUOTAS 2 | ||
267 | |||
265 | /* Resource group multi-block reservation, in order of appearance: | 268 | /* Resource group multi-block reservation, in order of appearance: |
266 | 269 | ||
267 | Step 1. Function prepares to write, allocates a mb, sets the size hint. | 270 | Step 1. Function prepares to write, allocates a mb, sets the size hint. |
@@ -282,8 +285,8 @@ struct gfs2_blkreserv { | |||
282 | u64 rs_inum; /* Inode number for reservation */ | 285 | u64 rs_inum; /* Inode number for reservation */ |
283 | 286 | ||
284 | /* ancillary quota stuff */ | 287 | /* ancillary quota stuff */ |
285 | struct gfs2_quota_data *rs_qa_qd[2 * MAXQUOTAS]; | 288 | struct gfs2_quota_data *rs_qa_qd[2 * GFS2_MAXQUOTAS]; |
286 | struct gfs2_holder rs_qa_qd_ghs[2 * MAXQUOTAS]; | 289 | struct gfs2_holder rs_qa_qd_ghs[2 * GFS2_MAXQUOTAS]; |
287 | unsigned int rs_qa_qd_num; | 290 | unsigned int rs_qa_qd_num; |
288 | }; | 291 | }; |
289 | 292 | ||
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index e62e59477884..fc8ac2ee0667 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -626,8 +626,10 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, | |||
626 | if (!IS_ERR(inode)) { | 626 | if (!IS_ERR(inode)) { |
627 | d = d_splice_alias(inode, dentry); | 627 | d = d_splice_alias(inode, dentry); |
628 | error = PTR_ERR(d); | 628 | error = PTR_ERR(d); |
629 | if (IS_ERR(d)) | 629 | if (IS_ERR(d)) { |
630 | inode = ERR_CAST(d); | ||
630 | goto fail_gunlock; | 631 | goto fail_gunlock; |
632 | } | ||
631 | error = 0; | 633 | error = 0; |
632 | if (file) { | 634 | if (file) { |
633 | if (S_ISREG(inode->i_mode)) { | 635 | if (S_ISREG(inode->i_mode)) { |
@@ -840,8 +842,10 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, | |||
840 | int error; | 842 | int error; |
841 | 843 | ||
842 | inode = gfs2_lookupi(dir, &dentry->d_name, 0); | 844 | inode = gfs2_lookupi(dir, &dentry->d_name, 0); |
843 | if (!inode) | 845 | if (inode == NULL) { |
846 | d_add(dentry, NULL); | ||
844 | return NULL; | 847 | return NULL; |
848 | } | ||
845 | if (IS_ERR(inode)) | 849 | if (IS_ERR(inode)) |
846 | return ERR_CAST(inode); | 850 | return ERR_CAST(inode); |
847 | 851 | ||
@@ -854,7 +858,6 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, | |||
854 | 858 | ||
855 | d = d_splice_alias(inode, dentry); | 859 | d = d_splice_alias(inode, dentry); |
856 | if (IS_ERR(d)) { | 860 | if (IS_ERR(d)) { |
857 | iput(inode); | ||
858 | gfs2_glock_dq_uninit(&gh); | 861 | gfs2_glock_dq_uninit(&gh); |
859 | return d; | 862 | return d; |
860 | } | 863 | } |
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 2607ff13d486..a346f56c4c6d 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c | |||
@@ -1294,7 +1294,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) | |||
1294 | int val; | 1294 | int val; |
1295 | 1295 | ||
1296 | if (is_ancestor(root, sdp->sd_master_dir)) | 1296 | if (is_ancestor(root, sdp->sd_master_dir)) |
1297 | seq_printf(s, ",meta"); | 1297 | seq_puts(s, ",meta"); |
1298 | if (args->ar_lockproto[0]) | 1298 | if (args->ar_lockproto[0]) |
1299 | seq_printf(s, ",lockproto=%s", args->ar_lockproto); | 1299 | seq_printf(s, ",lockproto=%s", args->ar_lockproto); |
1300 | if (args->ar_locktable[0]) | 1300 | if (args->ar_locktable[0]) |
@@ -1302,13 +1302,13 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) | |||
1302 | if (args->ar_hostdata[0]) | 1302 | if (args->ar_hostdata[0]) |
1303 | seq_printf(s, ",hostdata=%s", args->ar_hostdata); | 1303 | seq_printf(s, ",hostdata=%s", args->ar_hostdata); |
1304 | if (args->ar_spectator) | 1304 | if (args->ar_spectator) |
1305 | seq_printf(s, ",spectator"); | 1305 | seq_puts(s, ",spectator"); |
1306 | if (args->ar_localflocks) | 1306 | if (args->ar_localflocks) |
1307 | seq_printf(s, ",localflocks"); | 1307 | seq_puts(s, ",localflocks"); |
1308 | if (args->ar_debug) | 1308 | if (args->ar_debug) |
1309 | seq_printf(s, ",debug"); | 1309 | seq_puts(s, ",debug"); |
1310 | if (args->ar_posix_acl) | 1310 | if (args->ar_posix_acl) |
1311 | seq_printf(s, ",acl"); | 1311 | seq_puts(s, ",acl"); |
1312 | if (args->ar_quota != GFS2_QUOTA_DEFAULT) { | 1312 | if (args->ar_quota != GFS2_QUOTA_DEFAULT) { |
1313 | char *state; | 1313 | char *state; |
1314 | switch (args->ar_quota) { | 1314 | switch (args->ar_quota) { |
@@ -1328,7 +1328,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) | |||
1328 | seq_printf(s, ",quota=%s", state); | 1328 | seq_printf(s, ",quota=%s", state); |
1329 | } | 1329 | } |
1330 | if (args->ar_suiddir) | 1330 | if (args->ar_suiddir) |
1331 | seq_printf(s, ",suiddir"); | 1331 | seq_puts(s, ",suiddir"); |
1332 | if (args->ar_data != GFS2_DATA_DEFAULT) { | 1332 | if (args->ar_data != GFS2_DATA_DEFAULT) { |
1333 | char *state; | 1333 | char *state; |
1334 | switch (args->ar_data) { | 1334 | switch (args->ar_data) { |
@@ -1345,7 +1345,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) | |||
1345 | seq_printf(s, ",data=%s", state); | 1345 | seq_printf(s, ",data=%s", state); |
1346 | } | 1346 | } |
1347 | if (args->ar_discard) | 1347 | if (args->ar_discard) |
1348 | seq_printf(s, ",discard"); | 1348 | seq_puts(s, ",discard"); |
1349 | val = sdp->sd_tune.gt_logd_secs; | 1349 | val = sdp->sd_tune.gt_logd_secs; |
1350 | if (val != 30) | 1350 | if (val != 30) |
1351 | seq_printf(s, ",commit=%d", val); | 1351 | seq_printf(s, ",commit=%d", val); |
@@ -1376,11 +1376,11 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root) | |||
1376 | seq_printf(s, ",errors=%s", state); | 1376 | seq_printf(s, ",errors=%s", state); |
1377 | } | 1377 | } |
1378 | if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags)) | 1378 | if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags)) |
1379 | seq_printf(s, ",nobarrier"); | 1379 | seq_puts(s, ",nobarrier"); |
1380 | if (test_bit(SDF_DEMOTE, &sdp->sd_flags)) | 1380 | if (test_bit(SDF_DEMOTE, &sdp->sd_flags)) |
1381 | seq_printf(s, ",demote_interface_used"); | 1381 | seq_puts(s, ",demote_interface_used"); |
1382 | if (args->ar_rgrplvb) | 1382 | if (args->ar_rgrplvb) |
1383 | seq_printf(s, ",rgrplvb"); | 1383 | seq_puts(s, ",rgrplvb"); |
1384 | return 0; | 1384 | return 0; |
1385 | } | 1385 | } |
1386 | 1386 | ||
diff --git a/fs/namei.c b/fs/namei.c index 215e44254c53..a7b05bf82d31 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1674,14 +1674,13 @@ EXPORT_SYMBOL(full_name_hash); | |||
1674 | 1674 | ||
1675 | /* | 1675 | /* |
1676 | * Calculate the length and hash of the path component, and | 1676 | * Calculate the length and hash of the path component, and |
1677 | * fill in the qstr. return the "len" as the result. | 1677 | * return the "hash_len" as the result. |
1678 | */ | 1678 | */ |
1679 | static inline unsigned long hash_name(const char *name, struct qstr *res) | 1679 | static inline u64 hash_name(const char *name) |
1680 | { | 1680 | { |
1681 | unsigned long a, b, adata, bdata, mask, hash, len; | 1681 | unsigned long a, b, adata, bdata, mask, hash, len; |
1682 | const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; | 1682 | const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; |
1683 | 1683 | ||
1684 | res->name = name; | ||
1685 | hash = a = 0; | 1684 | hash = a = 0; |
1686 | len = -sizeof(unsigned long); | 1685 | len = -sizeof(unsigned long); |
1687 | do { | 1686 | do { |
@@ -1698,9 +1697,7 @@ static inline unsigned long hash_name(const char *name, struct qstr *res) | |||
1698 | 1697 | ||
1699 | hash += a & zero_bytemask(mask); | 1698 | hash += a & zero_bytemask(mask); |
1700 | len += find_zero(mask); | 1699 | len += find_zero(mask); |
1701 | res->hash_len = hashlen_create(fold_hash(hash), len); | 1700 | return hashlen_create(fold_hash(hash), len); |
1702 | |||
1703 | return len; | ||
1704 | } | 1701 | } |
1705 | 1702 | ||
1706 | #else | 1703 | #else |
@@ -1718,20 +1715,18 @@ EXPORT_SYMBOL(full_name_hash); | |||
1718 | * We know there's a real path component here of at least | 1715 | * We know there's a real path component here of at least |
1719 | * one character. | 1716 | * one character. |
1720 | */ | 1717 | */ |
1721 | static inline long hash_name(const char *name, struct qstr *res) | 1718 | static inline u64 hash_name(const char *name) |
1722 | { | 1719 | { |
1723 | unsigned long hash = init_name_hash(); | 1720 | unsigned long hash = init_name_hash(); |
1724 | unsigned long len = 0, c; | 1721 | unsigned long len = 0, c; |
1725 | 1722 | ||
1726 | res->name = name; | ||
1727 | c = (unsigned char)*name; | 1723 | c = (unsigned char)*name; |
1728 | do { | 1724 | do { |
1729 | len++; | 1725 | len++; |
1730 | hash = partial_name_hash(c, hash); | 1726 | hash = partial_name_hash(c, hash); |
1731 | c = (unsigned char)name[len]; | 1727 | c = (unsigned char)name[len]; |
1732 | } while (c && c != '/'); | 1728 | } while (c && c != '/'); |
1733 | res->hash_len = hashlen_create(end_name_hash(hash), len); | 1729 | return hashlen_create(end_name_hash(hash), len); |
1734 | return len; | ||
1735 | } | 1730 | } |
1736 | 1731 | ||
1737 | #endif | 1732 | #endif |
@@ -1756,18 +1751,17 @@ static int link_path_walk(const char *name, struct nameidata *nd) | |||
1756 | 1751 | ||
1757 | /* At this point we know we have a real path component. */ | 1752 | /* At this point we know we have a real path component. */ |
1758 | for(;;) { | 1753 | for(;;) { |
1759 | struct qstr this; | 1754 | u64 hash_len; |
1760 | long len; | ||
1761 | int type; | 1755 | int type; |
1762 | 1756 | ||
1763 | err = may_lookup(nd); | 1757 | err = may_lookup(nd); |
1764 | if (err) | 1758 | if (err) |
1765 | break; | 1759 | break; |
1766 | 1760 | ||
1767 | len = hash_name(name, &this); | 1761 | hash_len = hash_name(name); |
1768 | 1762 | ||
1769 | type = LAST_NORM; | 1763 | type = LAST_NORM; |
1770 | if (name[0] == '.') switch (len) { | 1764 | if (name[0] == '.') switch (hashlen_len(hash_len)) { |
1771 | case 2: | 1765 | case 2: |
1772 | if (name[1] == '.') { | 1766 | if (name[1] == '.') { |
1773 | type = LAST_DOTDOT; | 1767 | type = LAST_DOTDOT; |
@@ -1781,29 +1775,32 @@ static int link_path_walk(const char *name, struct nameidata *nd) | |||
1781 | struct dentry *parent = nd->path.dentry; | 1775 | struct dentry *parent = nd->path.dentry; |
1782 | nd->flags &= ~LOOKUP_JUMPED; | 1776 | nd->flags &= ~LOOKUP_JUMPED; |
1783 | if (unlikely(parent->d_flags & DCACHE_OP_HASH)) { | 1777 | if (unlikely(parent->d_flags & DCACHE_OP_HASH)) { |
1778 | struct qstr this = { { .hash_len = hash_len }, .name = name }; | ||
1784 | err = parent->d_op->d_hash(parent, &this); | 1779 | err = parent->d_op->d_hash(parent, &this); |
1785 | if (err < 0) | 1780 | if (err < 0) |
1786 | break; | 1781 | break; |
1782 | hash_len = this.hash_len; | ||
1783 | name = this.name; | ||
1787 | } | 1784 | } |
1788 | } | 1785 | } |
1789 | 1786 | ||
1790 | nd->last = this; | 1787 | nd->last.hash_len = hash_len; |
1788 | nd->last.name = name; | ||
1791 | nd->last_type = type; | 1789 | nd->last_type = type; |
1792 | 1790 | ||
1793 | if (!name[len]) | 1791 | name += hashlen_len(hash_len); |
1792 | if (!*name) | ||
1794 | return 0; | 1793 | return 0; |
1795 | /* | 1794 | /* |
1796 | * If it wasn't NUL, we know it was '/'. Skip that | 1795 | * If it wasn't NUL, we know it was '/'. Skip that |
1797 | * slash, and continue until no more slashes. | 1796 | * slash, and continue until no more slashes. |
1798 | */ | 1797 | */ |
1799 | do { | 1798 | do { |
1800 | len++; | 1799 | name++; |
1801 | } while (unlikely(name[len] == '/')); | 1800 | } while (unlikely(*name == '/')); |
1802 | if (!name[len]) | 1801 | if (!*name) |
1803 | return 0; | 1802 | return 0; |
1804 | 1803 | ||
1805 | name += len; | ||
1806 | |||
1807 | err = walk_component(nd, &next, LOOKUP_FOLLOW); | 1804 | err = walk_component(nd, &next, LOOKUP_FOLLOW); |
1808 | if (err < 0) | 1805 | if (err < 0) |
1809 | return err; | 1806 | return err; |
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 53e435a95260..ffdb28d86cf8 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c | |||
@@ -482,6 +482,16 @@ int nfs40_walk_client_list(struct nfs_client *new, | |||
482 | 482 | ||
483 | spin_lock(&nn->nfs_client_lock); | 483 | spin_lock(&nn->nfs_client_lock); |
484 | list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) { | 484 | list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) { |
485 | |||
486 | if (pos->rpc_ops != new->rpc_ops) | ||
487 | continue; | ||
488 | |||
489 | if (pos->cl_proto != new->cl_proto) | ||
490 | continue; | ||
491 | |||
492 | if (pos->cl_minorversion != new->cl_minorversion) | ||
493 | continue; | ||
494 | |||
485 | /* If "pos" isn't marked ready, we can't trust the | 495 | /* If "pos" isn't marked ready, we can't trust the |
486 | * remaining fields in "pos" */ | 496 | * remaining fields in "pos" */ |
487 | if (pos->cl_cons_state > NFS_CS_READY) { | 497 | if (pos->cl_cons_state > NFS_CS_READY) { |
@@ -501,15 +511,6 @@ int nfs40_walk_client_list(struct nfs_client *new, | |||
501 | if (pos->cl_cons_state != NFS_CS_READY) | 511 | if (pos->cl_cons_state != NFS_CS_READY) |
502 | continue; | 512 | continue; |
503 | 513 | ||
504 | if (pos->rpc_ops != new->rpc_ops) | ||
505 | continue; | ||
506 | |||
507 | if (pos->cl_proto != new->cl_proto) | ||
508 | continue; | ||
509 | |||
510 | if (pos->cl_minorversion != new->cl_minorversion) | ||
511 | continue; | ||
512 | |||
513 | if (pos->cl_clientid != new->cl_clientid) | 514 | if (pos->cl_clientid != new->cl_clientid) |
514 | continue; | 515 | continue; |
515 | 516 | ||
@@ -622,6 +623,16 @@ int nfs41_walk_client_list(struct nfs_client *new, | |||
622 | 623 | ||
623 | spin_lock(&nn->nfs_client_lock); | 624 | spin_lock(&nn->nfs_client_lock); |
624 | list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) { | 625 | list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) { |
626 | |||
627 | if (pos->rpc_ops != new->rpc_ops) | ||
628 | continue; | ||
629 | |||
630 | if (pos->cl_proto != new->cl_proto) | ||
631 | continue; | ||
632 | |||
633 | if (pos->cl_minorversion != new->cl_minorversion) | ||
634 | continue; | ||
635 | |||
625 | /* If "pos" isn't marked ready, we can't trust the | 636 | /* If "pos" isn't marked ready, we can't trust the |
626 | * remaining fields in "pos", especially the client | 637 | * remaining fields in "pos", especially the client |
627 | * ID and serverowner fields. Wait for CREATE_SESSION | 638 | * ID and serverowner fields. Wait for CREATE_SESSION |
@@ -647,15 +658,6 @@ int nfs41_walk_client_list(struct nfs_client *new, | |||
647 | if (pos->cl_cons_state != NFS_CS_READY) | 658 | if (pos->cl_cons_state != NFS_CS_READY) |
648 | continue; | 659 | continue; |
649 | 660 | ||
650 | if (pos->rpc_ops != new->rpc_ops) | ||
651 | continue; | ||
652 | |||
653 | if (pos->cl_proto != new->cl_proto) | ||
654 | continue; | ||
655 | |||
656 | if (pos->cl_minorversion != new->cl_minorversion) | ||
657 | continue; | ||
658 | |||
659 | if (!nfs4_match_clientids(pos, new)) | 661 | if (!nfs4_match_clientids(pos, new)) |
660 | continue; | 662 | continue; |
661 | 663 | ||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 7dd8aca31c29..6ca0c8e7a945 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2226,9 +2226,13 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, | |||
2226 | ret = _nfs4_proc_open(opendata); | 2226 | ret = _nfs4_proc_open(opendata); |
2227 | if (ret != 0) { | 2227 | if (ret != 0) { |
2228 | if (ret == -ENOENT) { | 2228 | if (ret == -ENOENT) { |
2229 | d_drop(opendata->dentry); | 2229 | dentry = opendata->dentry; |
2230 | d_add(opendata->dentry, NULL); | 2230 | if (dentry->d_inode) |
2231 | nfs_set_verifier(opendata->dentry, | 2231 | d_delete(dentry); |
2232 | else if (d_unhashed(dentry)) | ||
2233 | d_add(dentry, NULL); | ||
2234 | |||
2235 | nfs_set_verifier(dentry, | ||
2232 | nfs_save_change_attribute(opendata->dir->d_inode)); | 2236 | nfs_save_change_attribute(opendata->dir->d_inode)); |
2233 | } | 2237 | } |
2234 | goto out; | 2238 | goto out; |
@@ -2614,23 +2618,23 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) | |||
2614 | is_rdwr = test_bit(NFS_O_RDWR_STATE, &state->flags); | 2618 | is_rdwr = test_bit(NFS_O_RDWR_STATE, &state->flags); |
2615 | is_rdonly = test_bit(NFS_O_RDONLY_STATE, &state->flags); | 2619 | is_rdonly = test_bit(NFS_O_RDONLY_STATE, &state->flags); |
2616 | is_wronly = test_bit(NFS_O_WRONLY_STATE, &state->flags); | 2620 | is_wronly = test_bit(NFS_O_WRONLY_STATE, &state->flags); |
2617 | /* Calculate the current open share mode */ | ||
2618 | calldata->arg.fmode = 0; | ||
2619 | if (is_rdonly || is_rdwr) | ||
2620 | calldata->arg.fmode |= FMODE_READ; | ||
2621 | if (is_wronly || is_rdwr) | ||
2622 | calldata->arg.fmode |= FMODE_WRITE; | ||
2623 | /* Calculate the change in open mode */ | 2621 | /* Calculate the change in open mode */ |
2622 | calldata->arg.fmode = 0; | ||
2624 | if (state->n_rdwr == 0) { | 2623 | if (state->n_rdwr == 0) { |
2625 | if (state->n_rdonly == 0) { | 2624 | if (state->n_rdonly == 0) |
2626 | call_close |= is_rdonly || is_rdwr; | 2625 | call_close |= is_rdonly; |
2627 | calldata->arg.fmode &= ~FMODE_READ; | 2626 | else if (is_rdonly) |
2628 | } | 2627 | calldata->arg.fmode |= FMODE_READ; |
2629 | if (state->n_wronly == 0) { | 2628 | if (state->n_wronly == 0) |
2630 | call_close |= is_wronly || is_rdwr; | 2629 | call_close |= is_wronly; |
2631 | calldata->arg.fmode &= ~FMODE_WRITE; | 2630 | else if (is_wronly) |
2632 | } | 2631 | calldata->arg.fmode |= FMODE_WRITE; |
2633 | } | 2632 | } else if (is_rdwr) |
2633 | calldata->arg.fmode |= FMODE_READ|FMODE_WRITE; | ||
2634 | |||
2635 | if (calldata->arg.fmode == 0) | ||
2636 | call_close |= is_rdwr; | ||
2637 | |||
2634 | if (!nfs4_valid_open_stateid(state)) | 2638 | if (!nfs4_valid_open_stateid(state)) |
2635 | call_close = 0; | 2639 | call_close = 0; |
2636 | spin_unlock(&state->owner->so_lock); | 2640 | spin_unlock(&state->owner->so_lock); |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index c1c9de19edbe..d91e59b79f0d 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -204,10 +204,9 @@ struct acpi_device_flags { | |||
204 | u32 match_driver:1; | 204 | u32 match_driver:1; |
205 | u32 initialized:1; | 205 | u32 initialized:1; |
206 | u32 visited:1; | 206 | u32 visited:1; |
207 | u32 no_hotplug:1; | ||
208 | u32 hotplug_notify:1; | 207 | u32 hotplug_notify:1; |
209 | u32 is_dock_station:1; | 208 | u32 is_dock_station:1; |
210 | u32 reserved:22; | 209 | u32 reserved:23; |
211 | }; | 210 | }; |
212 | 211 | ||
213 | /* File System */ | 212 | /* File System */ |
@@ -411,7 +410,6 @@ void acpi_bus_private_data_handler(acpi_handle, void *); | |||
411 | int acpi_bus_get_private_data(acpi_handle, void **); | 410 | int acpi_bus_get_private_data(acpi_handle, void **); |
412 | int acpi_bus_attach_private_data(acpi_handle, void *); | 411 | int acpi_bus_attach_private_data(acpi_handle, void *); |
413 | void acpi_bus_detach_private_data(acpi_handle); | 412 | void acpi_bus_detach_private_data(acpi_handle); |
414 | void acpi_bus_no_hotplug(acpi_handle handle); | ||
415 | extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); | 413 | extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); |
416 | extern int register_acpi_notifier(struct notifier_block *); | 414 | extern int register_acpi_notifier(struct notifier_block *); |
417 | extern int unregister_acpi_notifier(struct notifier_block *); | 415 | extern int unregister_acpi_notifier(struct notifier_block *); |
diff --git a/include/crypto/drbg.h b/include/crypto/drbg.h index 831d786976c5..882675e7c055 100644 --- a/include/crypto/drbg.h +++ b/include/crypto/drbg.h | |||
@@ -162,12 +162,25 @@ static inline size_t drbg_max_request_bytes(struct drbg_state *drbg) | |||
162 | 162 | ||
163 | static inline size_t drbg_max_addtl(struct drbg_state *drbg) | 163 | static inline size_t drbg_max_addtl(struct drbg_state *drbg) |
164 | { | 164 | { |
165 | #if (__BITS_PER_LONG == 32) | ||
166 | /* | ||
167 | * SP800-90A allows smaller maximum numbers to be returned -- we | ||
168 | * return SIZE_MAX - 1 to allow the verification of the enforcement | ||
169 | * of this value in drbg_healthcheck_sanity. | ||
170 | */ | ||
171 | return (SIZE_MAX - 1); | ||
172 | #else | ||
165 | return (1UL<<(drbg->core->max_addtllen)); | 173 | return (1UL<<(drbg->core->max_addtllen)); |
174 | #endif | ||
166 | } | 175 | } |
167 | 176 | ||
168 | static inline size_t drbg_max_requests(struct drbg_state *drbg) | 177 | static inline size_t drbg_max_requests(struct drbg_state *drbg) |
169 | { | 178 | { |
179 | #if (__BITS_PER_LONG == 32) | ||
180 | return SIZE_MAX; | ||
181 | #else | ||
170 | return (1UL<<(drbg->core->max_req)); | 182 | return (1UL<<(drbg->core->max_req)); |
183 | #endif | ||
171 | } | 184 | } |
172 | 185 | ||
173 | /* | 186 | /* |
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index 4b79ffe7b188..fa76c79a52a1 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h | |||
@@ -84,10 +84,12 @@ static inline void iio_trigger_put(struct iio_trigger *trig) | |||
84 | put_device(&trig->dev); | 84 | put_device(&trig->dev); |
85 | } | 85 | } |
86 | 86 | ||
87 | static inline void iio_trigger_get(struct iio_trigger *trig) | 87 | static inline struct iio_trigger *iio_trigger_get(struct iio_trigger *trig) |
88 | { | 88 | { |
89 | get_device(&trig->dev); | 89 | get_device(&trig->dev); |
90 | __module_get(trig->ops->owner); | 90 | __module_get(trig->ops->owner); |
91 | |||
92 | return trig; | ||
91 | } | 93 | } |
92 | 94 | ||
93 | /** | 95 | /** |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 61978a460841..96453f9bc8ba 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -303,6 +303,7 @@ struct pci_dev { | |||
303 | D3cold, not set for devices | 303 | D3cold, not set for devices |
304 | powered on/off by the | 304 | powered on/off by the |
305 | corresponding bridge */ | 305 | corresponding bridge */ |
306 | unsigned int ignore_hotplug:1; /* Ignore hotplug events */ | ||
306 | unsigned int d3_delay; /* D3->D0 transition time in ms */ | 307 | unsigned int d3_delay; /* D3->D0 transition time in ms */ |
307 | unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ | 308 | unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ |
308 | 309 | ||
@@ -1021,6 +1022,11 @@ bool pci_dev_run_wake(struct pci_dev *dev); | |||
1021 | bool pci_check_pme_status(struct pci_dev *dev); | 1022 | bool pci_check_pme_status(struct pci_dev *dev); |
1022 | void pci_pme_wakeup_bus(struct pci_bus *bus); | 1023 | void pci_pme_wakeup_bus(struct pci_bus *bus); |
1023 | 1024 | ||
1025 | static inline void pci_ignore_hotplug(struct pci_dev *dev) | ||
1026 | { | ||
1027 | dev->ignore_hotplug = 1; | ||
1028 | } | ||
1029 | |||
1024 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | 1030 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
1025 | bool enable) | 1031 | bool enable) |
1026 | { | 1032 | { |
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h index 502073a53dd3..b483abd34493 100644 --- a/include/linux/vga_switcheroo.h +++ b/include/linux/vga_switcheroo.h | |||
@@ -64,6 +64,7 @@ int vga_switcheroo_get_client_state(struct pci_dev *dev); | |||
64 | void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic); | 64 | void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic); |
65 | 65 | ||
66 | int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain); | 66 | int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain); |
67 | void vga_switcheroo_fini_domain_pm_ops(struct device *dev); | ||
67 | int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain); | 68 | int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain); |
68 | #else | 69 | #else |
69 | 70 | ||
@@ -82,6 +83,7 @@ static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return | |||
82 | static inline void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) {} | 83 | static inline void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) {} |
83 | 84 | ||
84 | static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; } | 85 | static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; } |
86 | static inline void vga_switcheroo_fini_domain_pm_ops(struct device *dev) {} | ||
85 | static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; } | 87 | static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; } |
86 | 88 | ||
87 | #endif | 89 | #endif |
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h index 2c02f3a8d2ba..c37bd4d06739 100644 --- a/include/linux/vgaarb.h +++ b/include/linux/vgaarb.h | |||
@@ -182,7 +182,6 @@ extern void vga_put(struct pci_dev *pdev, unsigned int rsrc); | |||
182 | * vga_get()... | 182 | * vga_get()... |
183 | */ | 183 | */ |
184 | 184 | ||
185 | #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE | ||
186 | #ifdef CONFIG_VGA_ARB | 185 | #ifdef CONFIG_VGA_ARB |
187 | extern struct pci_dev *vga_default_device(void); | 186 | extern struct pci_dev *vga_default_device(void); |
188 | extern void vga_set_default_device(struct pci_dev *pdev); | 187 | extern void vga_set_default_device(struct pci_dev *pdev); |
@@ -190,7 +189,6 @@ extern void vga_set_default_device(struct pci_dev *pdev); | |||
190 | static inline struct pci_dev *vga_default_device(void) { return NULL; }; | 189 | static inline struct pci_dev *vga_default_device(void) { return NULL; }; |
191 | static inline void vga_set_default_device(struct pci_dev *pdev) { }; | 190 | static inline void vga_set_default_device(struct pci_dev *pdev) { }; |
192 | #endif | 191 | #endif |
193 | #endif | ||
194 | 192 | ||
195 | /** | 193 | /** |
196 | * vga_conflicts | 194 | * vga_conflicts |
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index cdcc90b07ecb..e64583560701 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
@@ -68,7 +68,7 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) | |||
68 | return; | 68 | return; |
69 | 69 | ||
70 | if (!shost_use_blk_mq(sdev->host) && | 70 | if (!shost_use_blk_mq(sdev->host) && |
71 | blk_queue_tagged(sdev->request_queue)) | 71 | !blk_queue_tagged(sdev->request_queue)) |
72 | blk_queue_init_tags(sdev->request_queue, depth, | 72 | blk_queue_init_tags(sdev->request_queue, depth, |
73 | sdev->host->bqt); | 73 | sdev->host->bqt); |
74 | 74 | ||
diff --git a/init/do_mounts.c b/init/do_mounts.c index b6237c31b0e2..82f22885c87e 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c | |||
@@ -539,6 +539,12 @@ void __init prepare_namespace(void) | |||
539 | { | 539 | { |
540 | int is_floppy; | 540 | int is_floppy; |
541 | 541 | ||
542 | if (root_delay) { | ||
543 | printk(KERN_INFO "Waiting %d sec before mounting root device...\n", | ||
544 | root_delay); | ||
545 | ssleep(root_delay); | ||
546 | } | ||
547 | |||
542 | /* | 548 | /* |
543 | * wait for the known devices to complete their probing | 549 | * wait for the known devices to complete their probing |
544 | * | 550 | * |
@@ -565,12 +571,6 @@ void __init prepare_namespace(void) | |||
565 | if (initrd_load()) | 571 | if (initrd_load()) |
566 | goto out; | 572 | goto out; |
567 | 573 | ||
568 | if (root_delay) { | ||
569 | pr_info("Waiting %d sec before mounting root device...\n", | ||
570 | root_delay); | ||
571 | ssleep(root_delay); | ||
572 | } | ||
573 | |||
574 | /* wait for any asynchronous scanning to complete */ | 574 | /* wait for any asynchronous scanning to complete */ |
575 | if ((ROOT_DEV == 0) && root_wait) { | 575 | if ((ROOT_DEV == 0) && root_wait) { |
576 | printk(KERN_INFO "Waiting for root device %s...\n", | 576 | printk(KERN_INFO "Waiting for root device %s...\n", |
diff --git a/kernel/events/core.c b/kernel/events/core.c index f9c1ed002dbc..d640a8b4dcbc 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -1524,6 +1524,11 @@ retry: | |||
1524 | */ | 1524 | */ |
1525 | if (ctx->is_active) { | 1525 | if (ctx->is_active) { |
1526 | raw_spin_unlock_irq(&ctx->lock); | 1526 | raw_spin_unlock_irq(&ctx->lock); |
1527 | /* | ||
1528 | * Reload the task pointer, it might have been changed by | ||
1529 | * a concurrent perf_event_context_sched_out(). | ||
1530 | */ | ||
1531 | task = ctx->task; | ||
1527 | goto retry; | 1532 | goto retry; |
1528 | } | 1533 | } |
1529 | 1534 | ||
@@ -1967,6 +1972,11 @@ retry: | |||
1967 | */ | 1972 | */ |
1968 | if (ctx->is_active) { | 1973 | if (ctx->is_active) { |
1969 | raw_spin_unlock_irq(&ctx->lock); | 1974 | raw_spin_unlock_irq(&ctx->lock); |
1975 | /* | ||
1976 | * Reload the task pointer, it might have been changed by | ||
1977 | * a concurrent perf_event_context_sched_out(). | ||
1978 | */ | ||
1979 | task = ctx->task; | ||
1970 | goto retry; | 1980 | goto retry; |
1971 | } | 1981 | } |
1972 | 1982 | ||
diff --git a/mm/dmapool.c b/mm/dmapool.c index 306baa594f95..ba8019b063e1 100644 --- a/mm/dmapool.c +++ b/mm/dmapool.c | |||
@@ -176,7 +176,7 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev, | |||
176 | if (list_empty(&dev->dma_pools) && | 176 | if (list_empty(&dev->dma_pools) && |
177 | device_create_file(dev, &dev_attr_pools)) { | 177 | device_create_file(dev, &dev_attr_pools)) { |
178 | kfree(retval); | 178 | kfree(retval); |
179 | return NULL; | 179 | retval = NULL; |
180 | } else | 180 | } else |
181 | list_add(&retval->pools, &dev->dma_pools); | 181 | list_add(&retval->pools, &dev->dma_pools); |
182 | mutex_unlock(&pools_lock); | 182 | mutex_unlock(&pools_lock); |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index ea823e1100da..98cd1908c039 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -566,8 +566,8 @@ static void stac_init_power_map(struct hda_codec *codec) | |||
566 | if (snd_hda_jack_tbl_get(codec, nid)) | 566 | if (snd_hda_jack_tbl_get(codec, nid)) |
567 | continue; | 567 | continue; |
568 | if (def_conf == AC_JACK_PORT_COMPLEX && | 568 | if (def_conf == AC_JACK_PORT_COMPLEX && |
569 | !(spec->vref_mute_led_nid == nid || | 569 | spec->vref_mute_led_nid != nid && |
570 | is_jack_detectable(codec, nid))) { | 570 | is_jack_detectable(codec, nid)) { |
571 | snd_hda_jack_detect_enable_callback(codec, nid, | 571 | snd_hda_jack_detect_enable_callback(codec, nid, |
572 | STAC_PWR_EVENT, | 572 | STAC_PWR_EVENT, |
573 | jack_update_power); | 573 | jack_update_power); |
@@ -4276,11 +4276,18 @@ static int stac_parse_auto_config(struct hda_codec *codec) | |||
4276 | return err; | 4276 | return err; |
4277 | } | 4277 | } |
4278 | 4278 | ||
4279 | stac_init_power_map(codec); | ||
4280 | |||
4281 | return 0; | 4279 | return 0; |
4282 | } | 4280 | } |
4283 | 4281 | ||
4282 | static int stac_build_controls(struct hda_codec *codec) | ||
4283 | { | ||
4284 | int err = snd_hda_gen_build_controls(codec); | ||
4285 | |||
4286 | if (err < 0) | ||
4287 | return err; | ||
4288 | stac_init_power_map(codec); | ||
4289 | return 0; | ||
4290 | } | ||
4284 | 4291 | ||
4285 | static int stac_init(struct hda_codec *codec) | 4292 | static int stac_init(struct hda_codec *codec) |
4286 | { | 4293 | { |
@@ -4392,7 +4399,7 @@ static int stac_suspend(struct hda_codec *codec) | |||
4392 | #endif /* CONFIG_PM */ | 4399 | #endif /* CONFIG_PM */ |
4393 | 4400 | ||
4394 | static const struct hda_codec_ops stac_patch_ops = { | 4401 | static const struct hda_codec_ops stac_patch_ops = { |
4395 | .build_controls = snd_hda_gen_build_controls, | 4402 | .build_controls = stac_build_controls, |
4396 | .build_pcms = snd_hda_gen_build_pcms, | 4403 | .build_pcms = snd_hda_gen_build_pcms, |
4397 | .init = stac_init, | 4404 | .init = stac_init, |
4398 | .free = stac_free, | 4405 | .free = stac_free, |
diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c index 98523209f739..69a85164357c 100644 --- a/sound/soc/codecs/cs4265.c +++ b/sound/soc/codecs/cs4265.c | |||
@@ -458,12 +458,12 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, | |||
458 | if (params_width(params) == 16) { | 458 | if (params_width(params) == 16) { |
459 | snd_soc_update_bits(codec, CS4265_DAC_CTL, | 459 | snd_soc_update_bits(codec, CS4265_DAC_CTL, |
460 | CS4265_DAC_CTL_DIF, (1 << 5)); | 460 | CS4265_DAC_CTL_DIF, (1 << 5)); |
461 | snd_soc_update_bits(codec, CS4265_ADC_CTL, | 461 | snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, |
462 | CS4265_SPDIF_CTL2_DIF, (1 << 7)); | 462 | CS4265_SPDIF_CTL2_DIF, (1 << 7)); |
463 | } else { | 463 | } else { |
464 | snd_soc_update_bits(codec, CS4265_DAC_CTL, | 464 | snd_soc_update_bits(codec, CS4265_DAC_CTL, |
465 | CS4265_DAC_CTL_DIF, (3 << 5)); | 465 | CS4265_DAC_CTL_DIF, (3 << 5)); |
466 | snd_soc_update_bits(codec, CS4265_ADC_CTL, | 466 | snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, |
467 | CS4265_SPDIF_CTL2_DIF, (1 << 7)); | 467 | CS4265_SPDIF_CTL2_DIF, (1 << 7)); |
468 | } | 468 | } |
469 | break; | 469 | break; |
@@ -472,7 +472,7 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, | |||
472 | CS4265_DAC_CTL_DIF, 0); | 472 | CS4265_DAC_CTL_DIF, 0); |
473 | snd_soc_update_bits(codec, CS4265_ADC_CTL, | 473 | snd_soc_update_bits(codec, CS4265_ADC_CTL, |
474 | CS4265_ADC_DIF, 0); | 474 | CS4265_ADC_DIF, 0); |
475 | snd_soc_update_bits(codec, CS4265_ADC_CTL, | 475 | snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, |
476 | CS4265_SPDIF_CTL2_DIF, (1 << 6)); | 476 | CS4265_SPDIF_CTL2_DIF, (1 << 6)); |
477 | 477 | ||
478 | break; | 478 | break; |
diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c index 9aa1323fb2ab..89c748dd3d6e 100644 --- a/sound/soc/codecs/sta529.c +++ b/sound/soc/codecs/sta529.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * sound/soc/codecs/sta529.c -- spear ALSA Soc codec driver | 4 | * sound/soc/codecs/sta529.c -- spear ALSA Soc codec driver |
5 | * | 5 | * |
6 | * Copyright (C) 2012 ST Microelectronics | 6 | * Copyright (C) 2012 ST Microelectronics |
7 | * Rajeev Kumar <rajeev-dlh.kumar@st.com> | 7 | * Rajeev Kumar <rajeevkumar.linux@gmail.com> |
8 | * | 8 | * |
9 | * This file is licensed under the terms of the GNU General Public | 9 | * This file is licensed under the terms of the GNU General Public |
10 | * License version 2. This program is licensed "as is" without any | 10 | * License version 2. This program is licensed "as is" without any |
@@ -426,5 +426,5 @@ static struct i2c_driver sta529_i2c_driver = { | |||
426 | module_i2c_driver(sta529_i2c_driver); | 426 | module_i2c_driver(sta529_i2c_driver); |
427 | 427 | ||
428 | MODULE_DESCRIPTION("ASoC STA529 codec driver"); | 428 | MODULE_DESCRIPTION("ASoC STA529 codec driver"); |
429 | MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); | 429 | MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); |
430 | MODULE_LICENSE("GPL"); | 430 | MODULE_LICENSE("GPL"); |
diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index 0f64c7890eed..aea9e1ff9126 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c | |||
@@ -189,46 +189,57 @@ static const struct aic31xx_rate_divs aic31xx_divs[] = { | |||
189 | /* mclk rate pll: p j d dosr ndac mdac aors nadc madc */ | 189 | /* mclk rate pll: p j d dosr ndac mdac aors nadc madc */ |
190 | /* 8k rate */ | 190 | /* 8k rate */ |
191 | {12000000, 8000, 1, 8, 1920, 128, 48, 2, 128, 48, 2}, | 191 | {12000000, 8000, 1, 8, 1920, 128, 48, 2, 128, 48, 2}, |
192 | {12000000, 8000, 1, 8, 1920, 128, 32, 3, 128, 32, 3}, | ||
192 | {24000000, 8000, 2, 8, 1920, 128, 48, 2, 128, 48, 2}, | 193 | {24000000, 8000, 2, 8, 1920, 128, 48, 2, 128, 48, 2}, |
193 | {25000000, 8000, 2, 7, 8643, 128, 48, 2, 128, 48, 2}, | 194 | {25000000, 8000, 2, 7, 8643, 128, 48, 2, 128, 48, 2}, |
194 | /* 11.025k rate */ | 195 | /* 11.025k rate */ |
195 | {12000000, 11025, 1, 7, 5264, 128, 32, 2, 128, 32, 2}, | 196 | {12000000, 11025, 1, 7, 5264, 128, 32, 2, 128, 32, 2}, |
197 | {12000000, 11025, 1, 8, 4672, 128, 24, 3, 128, 24, 3}, | ||
196 | {24000000, 11025, 2, 7, 5264, 128, 32, 2, 128, 32, 2}, | 198 | {24000000, 11025, 2, 7, 5264, 128, 32, 2, 128, 32, 2}, |
197 | {25000000, 11025, 2, 7, 2253, 128, 32, 2, 128, 32, 2}, | 199 | {25000000, 11025, 2, 7, 2253, 128, 32, 2, 128, 32, 2}, |
198 | /* 16k rate */ | 200 | /* 16k rate */ |
199 | {12000000, 16000, 1, 8, 1920, 128, 24, 2, 128, 24, 2}, | 201 | {12000000, 16000, 1, 8, 1920, 128, 24, 2, 128, 24, 2}, |
202 | {12000000, 16000, 1, 8, 1920, 128, 16, 3, 128, 16, 3}, | ||
200 | {24000000, 16000, 2, 8, 1920, 128, 24, 2, 128, 24, 2}, | 203 | {24000000, 16000, 2, 8, 1920, 128, 24, 2, 128, 24, 2}, |
201 | {25000000, 16000, 2, 7, 8643, 128, 24, 2, 128, 24, 2}, | 204 | {25000000, 16000, 2, 7, 8643, 128, 24, 2, 128, 24, 2}, |
202 | /* 22.05k rate */ | 205 | /* 22.05k rate */ |
203 | {12000000, 22050, 1, 7, 5264, 128, 16, 2, 128, 16, 2}, | 206 | {12000000, 22050, 1, 7, 5264, 128, 16, 2, 128, 16, 2}, |
207 | {12000000, 22050, 1, 8, 4672, 128, 12, 3, 128, 12, 3}, | ||
204 | {24000000, 22050, 2, 7, 5264, 128, 16, 2, 128, 16, 2}, | 208 | {24000000, 22050, 2, 7, 5264, 128, 16, 2, 128, 16, 2}, |
205 | {25000000, 22050, 2, 7, 2253, 128, 16, 2, 128, 16, 2}, | 209 | {25000000, 22050, 2, 7, 2253, 128, 16, 2, 128, 16, 2}, |
206 | /* 32k rate */ | 210 | /* 32k rate */ |
207 | {12000000, 32000, 1, 8, 1920, 128, 12, 2, 128, 12, 2}, | 211 | {12000000, 32000, 1, 8, 1920, 128, 12, 2, 128, 12, 2}, |
212 | {12000000, 32000, 1, 8, 1920, 128, 8, 3, 128, 8, 3}, | ||
208 | {24000000, 32000, 2, 8, 1920, 128, 12, 2, 128, 12, 2}, | 213 | {24000000, 32000, 2, 8, 1920, 128, 12, 2, 128, 12, 2}, |
209 | {25000000, 32000, 2, 7, 8643, 128, 12, 2, 128, 12, 2}, | 214 | {25000000, 32000, 2, 7, 8643, 128, 12, 2, 128, 12, 2}, |
210 | /* 44.1k rate */ | 215 | /* 44.1k rate */ |
211 | {12000000, 44100, 1, 7, 5264, 128, 8, 2, 128, 8, 2}, | 216 | {12000000, 44100, 1, 7, 5264, 128, 8, 2, 128, 8, 2}, |
217 | {12000000, 44100, 1, 8, 4672, 128, 6, 3, 128, 6, 3}, | ||
212 | {24000000, 44100, 2, 7, 5264, 128, 8, 2, 128, 8, 2}, | 218 | {24000000, 44100, 2, 7, 5264, 128, 8, 2, 128, 8, 2}, |
213 | {25000000, 44100, 2, 7, 2253, 128, 8, 2, 128, 8, 2}, | 219 | {25000000, 44100, 2, 7, 2253, 128, 8, 2, 128, 8, 2}, |
214 | /* 48k rate */ | 220 | /* 48k rate */ |
215 | {12000000, 48000, 1, 8, 1920, 128, 8, 2, 128, 8, 2}, | 221 | {12000000, 48000, 1, 8, 1920, 128, 8, 2, 128, 8, 2}, |
222 | {12000000, 48000, 1, 7, 6800, 96, 5, 4, 96, 5, 4}, | ||
216 | {24000000, 48000, 2, 8, 1920, 128, 8, 2, 128, 8, 2}, | 223 | {24000000, 48000, 2, 8, 1920, 128, 8, 2, 128, 8, 2}, |
217 | {25000000, 48000, 2, 7, 8643, 128, 8, 2, 128, 8, 2}, | 224 | {25000000, 48000, 2, 7, 8643, 128, 8, 2, 128, 8, 2}, |
218 | /* 88.2k rate */ | 225 | /* 88.2k rate */ |
219 | {12000000, 88200, 1, 7, 5264, 64, 8, 2, 64, 8, 2}, | 226 | {12000000, 88200, 1, 7, 5264, 64, 8, 2, 64, 8, 2}, |
227 | {12000000, 88200, 1, 8, 4672, 64, 6, 3, 64, 6, 3}, | ||
220 | {24000000, 88200, 2, 7, 5264, 64, 8, 2, 64, 8, 2}, | 228 | {24000000, 88200, 2, 7, 5264, 64, 8, 2, 64, 8, 2}, |
221 | {25000000, 88200, 2, 7, 2253, 64, 8, 2, 64, 8, 2}, | 229 | {25000000, 88200, 2, 7, 2253, 64, 8, 2, 64, 8, 2}, |
222 | /* 96k rate */ | 230 | /* 96k rate */ |
223 | {12000000, 96000, 1, 8, 1920, 64, 8, 2, 64, 8, 2}, | 231 | {12000000, 96000, 1, 8, 1920, 64, 8, 2, 64, 8, 2}, |
232 | {12000000, 96000, 1, 7, 6800, 48, 5, 4, 48, 5, 4}, | ||
224 | {24000000, 96000, 2, 8, 1920, 64, 8, 2, 64, 8, 2}, | 233 | {24000000, 96000, 2, 8, 1920, 64, 8, 2, 64, 8, 2}, |
225 | {25000000, 96000, 2, 7, 8643, 64, 8, 2, 64, 8, 2}, | 234 | {25000000, 96000, 2, 7, 8643, 64, 8, 2, 64, 8, 2}, |
226 | /* 176.4k rate */ | 235 | /* 176.4k rate */ |
227 | {12000000, 176400, 1, 7, 5264, 32, 8, 2, 32, 8, 2}, | 236 | {12000000, 176400, 1, 7, 5264, 32, 8, 2, 32, 8, 2}, |
237 | {12000000, 176400, 1, 8, 4672, 32, 6, 3, 32, 6, 3}, | ||
228 | {24000000, 176400, 2, 7, 5264, 32, 8, 2, 32, 8, 2}, | 238 | {24000000, 176400, 2, 7, 5264, 32, 8, 2, 32, 8, 2}, |
229 | {25000000, 176400, 2, 7, 2253, 32, 8, 2, 32, 8, 2}, | 239 | {25000000, 176400, 2, 7, 2253, 32, 8, 2, 32, 8, 2}, |
230 | /* 192k rate */ | 240 | /* 192k rate */ |
231 | {12000000, 192000, 1, 8, 1920, 32, 8, 2, 32, 8, 2}, | 241 | {12000000, 192000, 1, 8, 1920, 32, 8, 2, 32, 8, 2}, |
242 | {12000000, 192000, 1, 7, 6800, 24, 5, 4, 24, 5, 4}, | ||
232 | {24000000, 192000, 2, 8, 1920, 32, 8, 2, 32, 8, 2}, | 243 | {24000000, 192000, 2, 8, 1920, 32, 8, 2, 32, 8, 2}, |
233 | {25000000, 192000, 2, 7, 8643, 32, 8, 2, 32, 8, 2}, | 244 | {25000000, 192000, 2, 7, 8643, 32, 8, 2, 32, 8, 2}, |
234 | }; | 245 | }; |
@@ -680,7 +691,9 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, | |||
680 | struct snd_pcm_hw_params *params) | 691 | struct snd_pcm_hw_params *params) |
681 | { | 692 | { |
682 | struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); | 693 | struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); |
694 | int bclk_score = snd_soc_params_to_frame_size(params); | ||
683 | int bclk_n = 0; | 695 | int bclk_n = 0; |
696 | int match = -1; | ||
684 | int i; | 697 | int i; |
685 | 698 | ||
686 | /* Use PLL as CODEC_CLKIN and DAC_CLK as BDIV_CLKIN */ | 699 | /* Use PLL as CODEC_CLKIN and DAC_CLK as BDIV_CLKIN */ |
@@ -691,15 +704,37 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, | |||
691 | 704 | ||
692 | for (i = 0; i < ARRAY_SIZE(aic31xx_divs); i++) { | 705 | for (i = 0; i < ARRAY_SIZE(aic31xx_divs); i++) { |
693 | if (aic31xx_divs[i].rate == params_rate(params) && | 706 | if (aic31xx_divs[i].rate == params_rate(params) && |
694 | aic31xx_divs[i].mclk == aic31xx->sysclk) | 707 | aic31xx_divs[i].mclk == aic31xx->sysclk) { |
695 | break; | 708 | int s = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) % |
709 | snd_soc_params_to_frame_size(params); | ||
710 | int bn = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) / | ||
711 | snd_soc_params_to_frame_size(params); | ||
712 | if (s < bclk_score && bn > 0) { | ||
713 | match = i; | ||
714 | bclk_n = bn; | ||
715 | bclk_score = s; | ||
716 | } | ||
717 | } | ||
696 | } | 718 | } |
697 | 719 | ||
698 | if (i == ARRAY_SIZE(aic31xx_divs)) { | 720 | if (match == -1) { |
699 | dev_err(codec->dev, "%s: Sampling rate %u not supported\n", | 721 | dev_err(codec->dev, |
722 | "%s: Sample rate (%u) and format not supported\n", | ||
700 | __func__, params_rate(params)); | 723 | __func__, params_rate(params)); |
724 | /* See bellow for details how fix this. */ | ||
701 | return -EINVAL; | 725 | return -EINVAL; |
702 | } | 726 | } |
727 | if (bclk_score != 0) { | ||
728 | dev_warn(codec->dev, "Can not produce exact bitclock"); | ||
729 | /* This is fine if using dsp format, but if using i2s | ||
730 | there may be trouble. To fix the issue edit the | ||
731 | aic31xx_divs table for your mclk and sample | ||
732 | rate. Details can be found from: | ||
733 | http://www.ti.com/lit/ds/symlink/tlv320aic3100.pdf | ||
734 | Section: 5.6 CLOCK Generation and PLL | ||
735 | */ | ||
736 | } | ||
737 | i = match; | ||
703 | 738 | ||
704 | /* PLL configuration */ | 739 | /* PLL configuration */ |
705 | snd_soc_update_bits(codec, AIC31XX_PLLPR, AIC31XX_PLL_MASK, | 740 | snd_soc_update_bits(codec, AIC31XX_PLLPR, AIC31XX_PLL_MASK, |
@@ -729,14 +764,6 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, | |||
729 | snd_soc_write(codec, AIC31XX_AOSR, aic31xx_divs[i].aosr); | 764 | snd_soc_write(codec, AIC31XX_AOSR, aic31xx_divs[i].aosr); |
730 | 765 | ||
731 | /* Bit clock divider configuration. */ | 766 | /* Bit clock divider configuration. */ |
732 | bclk_n = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) | ||
733 | / snd_soc_params_to_frame_size(params); | ||
734 | if (bclk_n == 0) { | ||
735 | dev_err(codec->dev, "%s: Not enough BLCK bandwidth\n", | ||
736 | __func__); | ||
737 | return -EINVAL; | ||
738 | } | ||
739 | |||
740 | snd_soc_update_bits(codec, AIC31XX_BCLKN, | 767 | snd_soc_update_bits(codec, AIC31XX_BCLKN, |
741 | AIC31XX_PLL_MASK, bclk_n); | 768 | AIC31XX_PLL_MASK, bclk_n); |
742 | 769 | ||
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 6a6b2ff7d7d7..68347b55f6e1 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -467,8 +467,17 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp, | |||
467 | { | 467 | { |
468 | u32 fmt; | 468 | u32 fmt; |
469 | u32 tx_rotate = (word_length / 4) & 0x7; | 469 | u32 tx_rotate = (word_length / 4) & 0x7; |
470 | u32 rx_rotate = (32 - word_length) / 4; | ||
471 | u32 mask = (1ULL << word_length) - 1; | 470 | u32 mask = (1ULL << word_length) - 1; |
471 | /* | ||
472 | * For captured data we should not rotate, inversion and masking is | ||
473 | * enoguh to get the data to the right position: | ||
474 | * Format data from bus after reverse (XRBUF) | ||
475 | * S16_LE: |LSB|MSB|xxx|xxx| |xxx|xxx|MSB|LSB| | ||
476 | * S24_3LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| | ||
477 | * S24_LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| | ||
478 | * S32_LE: |LSB|DAT|DAT|MSB| |MSB|DAT|DAT|LSB| | ||
479 | */ | ||
480 | u32 rx_rotate = 0; | ||
472 | 481 | ||
473 | /* | 482 | /* |
474 | * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv() | 483 | * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv() |
diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c index 25c31f1655f6..e961388e6e9c 100644 --- a/sound/soc/dwc/designware_i2s.c +++ b/sound/soc/dwc/designware_i2s.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * sound/soc/dwc/designware_i2s.c | 4 | * sound/soc/dwc/designware_i2s.c |
5 | * | 5 | * |
6 | * Copyright (C) 2010 ST Microelectronics | 6 | * Copyright (C) 2010 ST Microelectronics |
7 | * Rajeev Kumar <rajeev-dlh.kumar@st.com> | 7 | * Rajeev Kumar <rajeevkumar.linux@gmail.com> |
8 | * | 8 | * |
9 | * This file is licensed under the terms of the GNU General Public | 9 | * This file is licensed under the terms of the GNU General Public |
10 | * License version 2. This program is licensed "as is" without any | 10 | * License version 2. This program is licensed "as is" without any |
@@ -455,7 +455,7 @@ static struct platform_driver dw_i2s_driver = { | |||
455 | 455 | ||
456 | module_platform_driver(dw_i2s_driver); | 456 | module_platform_driver(dw_i2s_driver); |
457 | 457 | ||
458 | MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); | 458 | MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); |
459 | MODULE_DESCRIPTION("DESIGNWARE I2S SoC Interface"); | 459 | MODULE_DESCRIPTION("DESIGNWARE I2S SoC Interface"); |
460 | MODULE_LICENSE("GPL"); | 460 | MODULE_LICENSE("GPL"); |
461 | MODULE_ALIAS("platform:designware_i2s"); | 461 | MODULE_ALIAS("platform:designware_i2s"); |
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 8d8e4b59049f..fb9e05c9f471 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c | |||
@@ -165,13 +165,14 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, | |||
165 | struct rk_i2s_dev *i2s = to_info(cpu_dai); | 165 | struct rk_i2s_dev *i2s = to_info(cpu_dai); |
166 | unsigned int mask = 0, val = 0; | 166 | unsigned int mask = 0, val = 0; |
167 | 167 | ||
168 | mask = I2S_CKR_MSS_SLAVE; | 168 | mask = I2S_CKR_MSS_MASK; |
169 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | 169 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
170 | case SND_SOC_DAIFMT_CBS_CFS: | 170 | case SND_SOC_DAIFMT_CBS_CFS: |
171 | val = I2S_CKR_MSS_SLAVE; | 171 | /* Set source clock in Master mode */ |
172 | val = I2S_CKR_MSS_MASTER; | ||
172 | break; | 173 | break; |
173 | case SND_SOC_DAIFMT_CBM_CFM: | 174 | case SND_SOC_DAIFMT_CBM_CFM: |
174 | val = I2S_CKR_MSS_MASTER; | 175 | val = I2S_CKR_MSS_SLAVE; |
175 | break; | 176 | break; |
176 | default: | 177 | default: |
177 | return -EINVAL; | 178 | return -EINVAL; |
@@ -361,6 +362,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg) | |||
361 | case I2S_XFER: | 362 | case I2S_XFER: |
362 | case I2S_CLR: | 363 | case I2S_CLR: |
363 | case I2S_RXDR: | 364 | case I2S_RXDR: |
365 | case I2S_FIFOLR: | ||
366 | case I2S_INTSR: | ||
364 | return true; | 367 | return true; |
365 | default: | 368 | default: |
366 | return false; | 369 | return false; |
@@ -370,8 +373,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg) | |||
370 | static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg) | 373 | static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg) |
371 | { | 374 | { |
372 | switch (reg) { | 375 | switch (reg) { |
373 | case I2S_FIFOLR: | ||
374 | case I2S_INTSR: | 376 | case I2S_INTSR: |
377 | case I2S_CLR: | ||
375 | return true; | 378 | return true; |
376 | default: | 379 | default: |
377 | return false; | 380 | return false; |
@@ -381,8 +384,6 @@ static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg) | |||
381 | static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg) | 384 | static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg) |
382 | { | 385 | { |
383 | switch (reg) { | 386 | switch (reg) { |
384 | case I2S_FIFOLR: | ||
385 | return true; | ||
386 | default: | 387 | default: |
387 | return false; | 388 | return false; |
388 | } | 389 | } |
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 03eec22f0f46..9d513473b300 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c | |||
@@ -462,7 +462,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, | |||
462 | if (dir == SND_SOC_CLOCK_IN) | 462 | if (dir == SND_SOC_CLOCK_IN) |
463 | rfs = 0; | 463 | rfs = 0; |
464 | 464 | ||
465 | if ((rfs && other->rfs && (other->rfs != rfs)) || | 465 | if ((rfs && other && other->rfs && (other->rfs != rfs)) || |
466 | (any_active(i2s) && | 466 | (any_active(i2s) && |
467 | (((dir == SND_SOC_CLOCK_IN) | 467 | (((dir == SND_SOC_CLOCK_IN) |
468 | && !(mod & MOD_CDCLKCON)) || | 468 | && !(mod & MOD_CDCLKCON)) || |
@@ -762,7 +762,8 @@ static void i2s_shutdown(struct snd_pcm_substream *substream, | |||
762 | } else { | 762 | } else { |
763 | u32 mod = readl(i2s->addr + I2SMOD); | 763 | u32 mod = readl(i2s->addr + I2SMOD); |
764 | i2s->cdclk_out = !(mod & MOD_CDCLKCON); | 764 | i2s->cdclk_out = !(mod & MOD_CDCLKCON); |
765 | other->cdclk_out = i2s->cdclk_out; | 765 | if (other) |
766 | other->cdclk_out = i2s->cdclk_out; | ||
766 | } | 767 | } |
767 | /* Reset any constraint on RFS and BFS */ | 768 | /* Reset any constraint on RFS and BFS */ |
768 | i2s->rfs = 0; | 769 | i2s->rfs = 0; |
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index 27c06acce205..3092b58fede6 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c | |||
@@ -101,7 +101,11 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream) | |||
101 | 101 | ||
102 | fe->dpcm[stream].runtime = fe_substream->runtime; | 102 | fe->dpcm[stream].runtime = fe_substream->runtime; |
103 | 103 | ||
104 | if (dpcm_path_get(fe, stream, &list) <= 0) { | 104 | ret = dpcm_path_get(fe, stream, &list); |
105 | if (ret < 0) { | ||
106 | mutex_unlock(&fe->card->mutex); | ||
107 | goto fe_err; | ||
108 | } else if (ret == 0) { | ||
105 | dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", | 109 | dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", |
106 | fe->dai_link->name, stream ? "capture" : "playback"); | 110 | fe->dai_link->name, stream ? "capture" : "playback"); |
107 | } | 111 | } |
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 731fdb5b5f9b..642c86240752 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -2352,7 +2352,11 @@ static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream) | |||
2352 | mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME); | 2352 | mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME); |
2353 | fe->dpcm[stream].runtime = fe_substream->runtime; | 2353 | fe->dpcm[stream].runtime = fe_substream->runtime; |
2354 | 2354 | ||
2355 | if (dpcm_path_get(fe, stream, &list) <= 0) { | 2355 | ret = dpcm_path_get(fe, stream, &list); |
2356 | if (ret < 0) { | ||
2357 | mutex_unlock(&fe->card->mutex); | ||
2358 | return ret; | ||
2359 | } else if (ret == 0) { | ||
2356 | dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", | 2360 | dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", |
2357 | fe->dai_link->name, stream ? "capture" : "playback"); | 2361 | fe->dai_link->name, stream ? "capture" : "playback"); |
2358 | } | 2362 | } |
diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c index 0e5a8f35d0ad..a7dc3c56f44d 100644 --- a/sound/soc/spear/spear_pcm.c +++ b/sound/soc/spear/spear_pcm.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * sound/soc/spear/spear_pcm.c | 4 | * sound/soc/spear/spear_pcm.c |
5 | * | 5 | * |
6 | * Copyright (C) 2012 ST Microelectronics | 6 | * Copyright (C) 2012 ST Microelectronics |
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | 7 | * Rajeev Kumar<rajeevkumar.linux@gmail.com> |
8 | * | 8 | * |
9 | * This file is licensed under the terms of the GNU General Public | 9 | * This file is licensed under the terms of the GNU General Public |
10 | * License version 2. This program is licensed "as is" without any | 10 | * License version 2. This program is licensed "as is" without any |
@@ -50,6 +50,6 @@ int devm_spear_pcm_platform_register(struct device *dev, | |||
50 | } | 50 | } |
51 | EXPORT_SYMBOL_GPL(devm_spear_pcm_platform_register); | 51 | EXPORT_SYMBOL_GPL(devm_spear_pcm_platform_register); |
52 | 52 | ||
53 | MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); | 53 | MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); |
54 | MODULE_DESCRIPTION("SPEAr PCM DMA module"); | 54 | MODULE_DESCRIPTION("SPEAr PCM DMA module"); |
55 | MODULE_LICENSE("GPL"); | 55 | MODULE_LICENSE("GPL"); |