1 |
Author: mpagano |
2 |
Date: 2012-11-01 14:38:47 +0000 (Thu, 01 Nov 2012) |
3 |
New Revision: 2230 |
4 |
|
5 |
Added: |
6 |
genpatches-2.6/trunk/3.6/1004_linux-3.6.5.patch |
7 |
Modified: |
8 |
genpatches-2.6/trunk/3.6/0000_README |
9 |
Log: |
10 |
Linux 3.6.5 |
11 |
|
12 |
Modified: genpatches-2.6/trunk/3.6/0000_README |
13 |
=================================================================== |
14 |
--- genpatches-2.6/trunk/3.6/0000_README 2012-10-29 18:15:33 UTC (rev 2229) |
15 |
+++ genpatches-2.6/trunk/3.6/0000_README 2012-11-01 14:38:47 UTC (rev 2230) |
16 |
@@ -55,6 +55,10 @@ |
17 |
From: http://www.kernel.org |
18 |
Desc: Linux 3.6.4 |
19 |
|
20 |
+Patch: 1004_linux-3.6.5.patch |
21 |
+From: http://www.kernel.org |
22 |
+Desc: Linux 3.6.5 |
23 |
+ |
24 |
Patch: 2400_kcopy-patch-for-infiniband-driver.patch |
25 |
From: Alexey Shvetsov <alexxy@g.o> |
26 |
Desc: Zero copy for infiniband psm userspace driver |
27 |
|
28 |
Added: genpatches-2.6/trunk/3.6/1004_linux-3.6.5.patch |
29 |
=================================================================== |
30 |
--- genpatches-2.6/trunk/3.6/1004_linux-3.6.5.patch (rev 0) |
31 |
+++ genpatches-2.6/trunk/3.6/1004_linux-3.6.5.patch 2012-11-01 14:38:47 UTC (rev 2230) |
32 |
@@ -0,0 +1,4649 @@ |
33 |
+diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.txt b/Documentation/devicetree/bindings/arm/atmel-at91.txt |
34 |
+index ecc81e3..d187e9f 100644 |
35 |
+--- a/Documentation/devicetree/bindings/arm/atmel-at91.txt |
36 |
++++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt |
37 |
+@@ -8,7 +8,7 @@ PIT Timer required properties: |
38 |
+ shared across all System Controller members. |
39 |
+ |
40 |
+ TC/TCLIB Timer required properties: |
41 |
+-- compatible: Should be "atmel,<chip>-pit". |
42 |
++- compatible: Should be "atmel,<chip>-tcb". |
43 |
+ <chip> can be "at91rm9200" or "at91sam9x5" |
44 |
+ - reg: Should contain registers location and length |
45 |
+ - interrupts: Should contain all interrupts for the TC block |
46 |
+diff --git a/Makefile b/Makefile |
47 |
+index dcf132a..6e4a00d 100644 |
48 |
+--- a/Makefile |
49 |
++++ b/Makefile |
50 |
+@@ -1,6 +1,6 @@ |
51 |
+ VERSION = 3 |
52 |
+ PATCHLEVEL = 6 |
53 |
+-SUBLEVEL = 4 |
54 |
++SUBLEVEL = 5 |
55 |
+ EXTRAVERSION = |
56 |
+ NAME = Terrified Chipmunk |
57 |
+ |
58 |
+diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c |
59 |
+index ebd8ad2..0181f7e 100644 |
60 |
+--- a/arch/arm/kernel/smp.c |
61 |
++++ b/arch/arm/kernel/smp.c |
62 |
+@@ -222,18 +222,24 @@ static void percpu_timer_setup(void); |
63 |
+ asmlinkage void __cpuinit secondary_start_kernel(void) |
64 |
+ { |
65 |
+ struct mm_struct *mm = &init_mm; |
66 |
+- unsigned int cpu = smp_processor_id(); |
67 |
++ unsigned int cpu; |
68 |
++ |
69 |
++ /* |
70 |
++ * The identity mapping is uncached (strongly ordered), so |
71 |
++ * switch away from it before attempting any exclusive accesses. |
72 |
++ */ |
73 |
++ cpu_switch_mm(mm->pgd, mm); |
74 |
++ enter_lazy_tlb(mm, current); |
75 |
++ local_flush_tlb_all(); |
76 |
+ |
77 |
+ /* |
78 |
+ * All kernel threads share the same mm context; grab a |
79 |
+ * reference and switch to it. |
80 |
+ */ |
81 |
++ cpu = smp_processor_id(); |
82 |
+ atomic_inc(&mm->mm_count); |
83 |
+ current->active_mm = mm; |
84 |
+ cpumask_set_cpu(cpu, mm_cpumask(mm)); |
85 |
+- cpu_switch_mm(mm->pgd, mm); |
86 |
+- enter_lazy_tlb(mm, current); |
87 |
+- local_flush_tlb_all(); |
88 |
+ |
89 |
+ printk("CPU%u: Booted secondary processor\n", cpu); |
90 |
+ |
91 |
+diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c |
92 |
+index 01fb732..d5a4913 100644 |
93 |
+--- a/arch/arm/mach-at91/at91rm9200_devices.c |
94 |
++++ b/arch/arm/mach-at91/at91rm9200_devices.c |
95 |
+@@ -463,7 +463,7 @@ static struct i2c_gpio_platform_data pdata = { |
96 |
+ |
97 |
+ static struct platform_device at91rm9200_twi_device = { |
98 |
+ .name = "i2c-gpio", |
99 |
+- .id = -1, |
100 |
++ .id = 0, |
101 |
+ .dev.platform_data = &pdata, |
102 |
+ }; |
103 |
+ |
104 |
+diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c |
105 |
+index bce572a..18ca240 100644 |
106 |
+--- a/arch/arm/mach-at91/at91sam9260_devices.c |
107 |
++++ b/arch/arm/mach-at91/at91sam9260_devices.c |
108 |
+@@ -471,7 +471,7 @@ static struct i2c_gpio_platform_data pdata = { |
109 |
+ |
110 |
+ static struct platform_device at91sam9260_twi_device = { |
111 |
+ .name = "i2c-gpio", |
112 |
+- .id = -1, |
113 |
++ .id = 0, |
114 |
+ .dev.platform_data = &pdata, |
115 |
+ }; |
116 |
+ |
117 |
+diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c |
118 |
+index bc2590d..2495de8 100644 |
119 |
+--- a/arch/arm/mach-at91/at91sam9261_devices.c |
120 |
++++ b/arch/arm/mach-at91/at91sam9261_devices.c |
121 |
+@@ -285,7 +285,7 @@ static struct i2c_gpio_platform_data pdata = { |
122 |
+ |
123 |
+ static struct platform_device at91sam9261_twi_device = { |
124 |
+ .name = "i2c-gpio", |
125 |
+- .id = -1, |
126 |
++ .id = 0, |
127 |
+ .dev.platform_data = &pdata, |
128 |
+ }; |
129 |
+ |
130 |
+diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c |
131 |
+index 9b6ca73..9877963 100644 |
132 |
+--- a/arch/arm/mach-at91/at91sam9263_devices.c |
133 |
++++ b/arch/arm/mach-at91/at91sam9263_devices.c |
134 |
+@@ -542,7 +542,7 @@ static struct i2c_gpio_platform_data pdata = { |
135 |
+ |
136 |
+ static struct platform_device at91sam9263_twi_device = { |
137 |
+ .name = "i2c-gpio", |
138 |
+- .id = -1, |
139 |
++ .id = 0, |
140 |
+ .dev.platform_data = &pdata, |
141 |
+ }; |
142 |
+ |
143 |
+diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c |
144 |
+index b3d365d..c82a427 100644 |
145 |
+--- a/arch/arm/mach-at91/at91sam9rl_devices.c |
146 |
++++ b/arch/arm/mach-at91/at91sam9rl_devices.c |
147 |
+@@ -314,7 +314,7 @@ static struct i2c_gpio_platform_data pdata = { |
148 |
+ |
149 |
+ static struct platform_device at91sam9rl_twi_device = { |
150 |
+ .name = "i2c-gpio", |
151 |
+- .id = -1, |
152 |
++ .id = 0, |
153 |
+ .dev.platform_data = &pdata, |
154 |
+ }; |
155 |
+ |
156 |
+diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c |
157 |
+index 18103c5d..997d359 100644 |
158 |
+--- a/arch/arm/mach-at91/board-neocore926.c |
159 |
++++ b/arch/arm/mach-at91/board-neocore926.c |
160 |
+@@ -129,7 +129,7 @@ static struct spi_board_info neocore926_spi_devices[] = { |
161 |
+ .max_speed_hz = 125000 * 16, |
162 |
+ .bus_num = 0, |
163 |
+ .platform_data = &ads_info, |
164 |
+- .irq = AT91SAM9263_ID_IRQ1, |
165 |
++ .irq = NR_IRQS_LEGACY + AT91SAM9263_ID_IRQ1, |
166 |
+ }, |
167 |
+ #endif |
168 |
+ }; |
169 |
+diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c |
170 |
+index 2269be5..17659be 100644 |
171 |
+--- a/arch/arm/mach-at91/board-sam9261ek.c |
172 |
++++ b/arch/arm/mach-at91/board-sam9261ek.c |
173 |
+@@ -309,7 +309,7 @@ static struct spi_board_info ek_spi_devices[] = { |
174 |
+ .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */ |
175 |
+ .bus_num = 0, |
176 |
+ .platform_data = &ads_info, |
177 |
+- .irq = AT91SAM9261_ID_IRQ0, |
178 |
++ .irq = NR_IRQS_LEGACY + AT91SAM9261_ID_IRQ0, |
179 |
+ .controller_data = (void *) AT91_PIN_PA28, /* CS pin */ |
180 |
+ }, |
181 |
+ #endif |
182 |
+diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c |
183 |
+index 82adf58..9e7153b 100644 |
184 |
+--- a/arch/arm/mach-at91/board-sam9263ek.c |
185 |
++++ b/arch/arm/mach-at91/board-sam9263ek.c |
186 |
+@@ -132,7 +132,7 @@ static struct spi_board_info ek_spi_devices[] = { |
187 |
+ .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */ |
188 |
+ .bus_num = 0, |
189 |
+ .platform_data = &ads_info, |
190 |
+- .irq = AT91SAM9263_ID_IRQ1, |
191 |
++ .irq = NR_IRQS_LEGACY + AT91SAM9263_ID_IRQ1, |
192 |
+ }, |
193 |
+ #endif |
194 |
+ }; |
195 |
+diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h |
196 |
+index f496506..b62f560e 100644 |
197 |
+--- a/arch/arm/mach-at91/generic.h |
198 |
++++ b/arch/arm/mach-at91/generic.h |
199 |
+@@ -26,7 +26,8 @@ extern void __init at91_dt_initialize(void); |
200 |
+ extern void __init at91_init_irq_default(void); |
201 |
+ extern void __init at91_init_interrupts(unsigned int priority[]); |
202 |
+ extern void __init at91x40_init_interrupts(unsigned int priority[]); |
203 |
+-extern void __init at91_aic_init(unsigned int priority[]); |
204 |
++extern void __init at91_aic_init(unsigned int priority[], |
205 |
++ unsigned int ext_irq_mask); |
206 |
+ extern int __init at91_aic_of_init(struct device_node *node, |
207 |
+ struct device_node *parent); |
208 |
+ extern int __init at91_aic5_of_init(struct device_node *node, |
209 |
+diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c |
210 |
+index 1e02c0e..febc2ee 100644 |
211 |
+--- a/arch/arm/mach-at91/irq.c |
212 |
++++ b/arch/arm/mach-at91/irq.c |
213 |
+@@ -502,14 +502,19 @@ int __init at91_aic5_of_init(struct device_node *node, |
214 |
+ /* |
215 |
+ * Initialize the AIC interrupt controller. |
216 |
+ */ |
217 |
+-void __init at91_aic_init(unsigned int *priority) |
218 |
++void __init at91_aic_init(unsigned int *priority, unsigned int ext_irq_mask) |
219 |
+ { |
220 |
+ unsigned int i; |
221 |
+ int irq_base; |
222 |
+ |
223 |
+- if (at91_aic_pm_init()) |
224 |
++ at91_extern_irq = kzalloc(BITS_TO_LONGS(n_irqs) |
225 |
++ * sizeof(*at91_extern_irq), GFP_KERNEL); |
226 |
++ |
227 |
++ if (at91_aic_pm_init() || at91_extern_irq == NULL) |
228 |
+ panic("Unable to allocate bit maps\n"); |
229 |
+ |
230 |
++ *at91_extern_irq = ext_irq_mask; |
231 |
++ |
232 |
+ at91_aic_base = ioremap(AT91_AIC, 512); |
233 |
+ if (!at91_aic_base) |
234 |
+ panic("Unable to ioremap AIC registers\n"); |
235 |
+diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c |
236 |
+index 944bffb..bd0e88c 100644 |
237 |
+--- a/arch/arm/mach-at91/setup.c |
238 |
++++ b/arch/arm/mach-at91/setup.c |
239 |
+@@ -47,7 +47,7 @@ void __init at91_init_irq_default(void) |
240 |
+ void __init at91_init_interrupts(unsigned int *priority) |
241 |
+ { |
242 |
+ /* Initialize the AIC interrupt controller */ |
243 |
+- at91_aic_init(priority); |
244 |
++ at91_aic_init(priority, at91_extern_irq); |
245 |
+ |
246 |
+ /* Enable GPIO interrupts */ |
247 |
+ at91_gpio_irq_setup(); |
248 |
+@@ -151,7 +151,7 @@ static void __init soc_detect(u32 dbgu_base) |
249 |
+ } |
250 |
+ |
251 |
+ /* at91sam9g10 */ |
252 |
+- if ((cidr & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { |
253 |
++ if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { |
254 |
+ at91_soc_initdata.type = AT91_SOC_SAM9G10; |
255 |
+ at91_boot_soc = at91sam9261_soc; |
256 |
+ } |
257 |
+diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c |
258 |
+index 4eb39cd..3e02ae6 100644 |
259 |
+--- a/arch/arm/mach-exynos/common.c |
260 |
++++ b/arch/arm/mach-exynos/common.c |
261 |
+@@ -47,6 +47,7 @@ |
262 |
+ #include <plat/fimc-core.h> |
263 |
+ #include <plat/iic-core.h> |
264 |
+ #include <plat/tv-core.h> |
265 |
++#include <plat/spi-core.h> |
266 |
+ #include <plat/regs-serial.h> |
267 |
+ |
268 |
+ #include "common.h" |
269 |
+@@ -346,6 +347,8 @@ static void __init exynos4_map_io(void) |
270 |
+ |
271 |
+ s5p_fb_setname(0, "exynos4-fb"); |
272 |
+ s5p_hdmi_setname("exynos4-hdmi"); |
273 |
++ |
274 |
++ s3c64xx_spi_setname("exynos4210-spi"); |
275 |
+ } |
276 |
+ |
277 |
+ static void __init exynos5_map_io(void) |
278 |
+@@ -366,6 +369,8 @@ static void __init exynos5_map_io(void) |
279 |
+ s3c_i2c0_setname("s3c2440-i2c"); |
280 |
+ s3c_i2c1_setname("s3c2440-i2c"); |
281 |
+ s3c_i2c2_setname("s3c2440-i2c"); |
282 |
++ |
283 |
++ s3c64xx_spi_setname("exynos4210-spi"); |
284 |
+ } |
285 |
+ |
286 |
+ static void __init exynos4_init_clocks(int xtal) |
287 |
+diff --git a/arch/arm/mach-s3c24xx/s3c2416.c b/arch/arm/mach-s3c24xx/s3c2416.c |
288 |
+index ed5a95ec..77ee0b7 100644 |
289 |
+--- a/arch/arm/mach-s3c24xx/s3c2416.c |
290 |
++++ b/arch/arm/mach-s3c24xx/s3c2416.c |
291 |
+@@ -61,6 +61,7 @@ |
292 |
+ #include <plat/nand-core.h> |
293 |
+ #include <plat/adc-core.h> |
294 |
+ #include <plat/rtc-core.h> |
295 |
++#include <plat/spi-core.h> |
296 |
+ |
297 |
+ static struct map_desc s3c2416_iodesc[] __initdata = { |
298 |
+ IODESC_ENT(WATCHDOG), |
299 |
+@@ -132,6 +133,7 @@ void __init s3c2416_map_io(void) |
300 |
+ /* initialize device information early */ |
301 |
+ s3c2416_default_sdhci0(); |
302 |
+ s3c2416_default_sdhci1(); |
303 |
++ s3c64xx_spi_setname("s3c2443-spi"); |
304 |
+ |
305 |
+ iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc)); |
306 |
+ } |
307 |
+diff --git a/arch/arm/mach-s3c24xx/s3c2443.c b/arch/arm/mach-s3c24xx/s3c2443.c |
308 |
+index ab648ad..165b6a6 100644 |
309 |
+--- a/arch/arm/mach-s3c24xx/s3c2443.c |
310 |
++++ b/arch/arm/mach-s3c24xx/s3c2443.c |
311 |
+@@ -43,6 +43,7 @@ |
312 |
+ #include <plat/nand-core.h> |
313 |
+ #include <plat/adc-core.h> |
314 |
+ #include <plat/rtc-core.h> |
315 |
++#include <plat/spi-core.h> |
316 |
+ |
317 |
+ static struct map_desc s3c2443_iodesc[] __initdata = { |
318 |
+ IODESC_ENT(WATCHDOG), |
319 |
+@@ -100,6 +101,9 @@ void __init s3c2443_map_io(void) |
320 |
+ s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull; |
321 |
+ s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull; |
322 |
+ |
323 |
++ /* initialize device information early */ |
324 |
++ s3c64xx_spi_setname("s3c2443-spi"); |
325 |
++ |
326 |
+ iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc)); |
327 |
+ } |
328 |
+ |
329 |
+diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c |
330 |
+index 6e6a0a9..111e404 100644 |
331 |
+--- a/arch/arm/mach-s5p64x0/common.c |
332 |
++++ b/arch/arm/mach-s5p64x0/common.c |
333 |
+@@ -44,6 +44,7 @@ |
334 |
+ #include <plat/sdhci.h> |
335 |
+ #include <plat/adc-core.h> |
336 |
+ #include <plat/fb-core.h> |
337 |
++#include <plat/spi-core.h> |
338 |
+ #include <plat/gpio-cfg.h> |
339 |
+ #include <plat/regs-irqtype.h> |
340 |
+ #include <plat/regs-serial.h> |
341 |
+@@ -179,6 +180,7 @@ void __init s5p6440_map_io(void) |
342 |
+ /* initialize any device information early */ |
343 |
+ s3c_adc_setname("s3c64xx-adc"); |
344 |
+ s3c_fb_setname("s5p64x0-fb"); |
345 |
++ s3c64xx_spi_setname("s5p64x0-spi"); |
346 |
+ |
347 |
+ s5p64x0_default_sdhci0(); |
348 |
+ s5p64x0_default_sdhci1(); |
349 |
+@@ -193,6 +195,7 @@ void __init s5p6450_map_io(void) |
350 |
+ /* initialize any device information early */ |
351 |
+ s3c_adc_setname("s3c64xx-adc"); |
352 |
+ s3c_fb_setname("s5p64x0-fb"); |
353 |
++ s3c64xx_spi_setname("s5p64x0-spi"); |
354 |
+ |
355 |
+ s5p64x0_default_sdhci0(); |
356 |
+ s5p64x0_default_sdhci1(); |
357 |
+diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c |
358 |
+index 6219086..cc6e561 100644 |
359 |
+--- a/arch/arm/mach-s5pc100/common.c |
360 |
++++ b/arch/arm/mach-s5pc100/common.c |
361 |
+@@ -45,6 +45,7 @@ |
362 |
+ #include <plat/fb-core.h> |
363 |
+ #include <plat/iic-core.h> |
364 |
+ #include <plat/onenand-core.h> |
365 |
++#include <plat/spi-core.h> |
366 |
+ #include <plat/regs-serial.h> |
367 |
+ #include <plat/watchdog-reset.h> |
368 |
+ |
369 |
+@@ -165,6 +166,8 @@ void __init s5pc100_map_io(void) |
370 |
+ s3c_onenand_setname("s5pc100-onenand"); |
371 |
+ s3c_fb_setname("s5pc100-fb"); |
372 |
+ s3c_cfcon_setname("s5pc100-pata"); |
373 |
++ |
374 |
++ s3c64xx_spi_setname("s5pc100-spi"); |
375 |
+ } |
376 |
+ |
377 |
+ void __init s5pc100_init_clocks(int xtal) |
378 |
+diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c |
379 |
+index 4c9e902..a0c50ef 100644 |
380 |
+--- a/arch/arm/mach-s5pv210/common.c |
381 |
++++ b/arch/arm/mach-s5pv210/common.c |
382 |
+@@ -43,6 +43,7 @@ |
383 |
+ #include <plat/iic-core.h> |
384 |
+ #include <plat/keypad-core.h> |
385 |
+ #include <plat/tv-core.h> |
386 |
++#include <plat/spi-core.h> |
387 |
+ #include <plat/regs-serial.h> |
388 |
+ |
389 |
+ #include "common.h" |
390 |
+@@ -196,6 +197,8 @@ void __init s5pv210_map_io(void) |
391 |
+ |
392 |
+ /* setup TV devices */ |
393 |
+ s5p_hdmi_setname("s5pv210-hdmi"); |
394 |
++ |
395 |
++ s3c64xx_spi_setname("s5pv210-spi"); |
396 |
+ } |
397 |
+ |
398 |
+ void __init s5pv210_init_clocks(int xtal) |
399 |
+diff --git a/arch/arm/plat-samsung/include/plat/spi-core.h b/arch/arm/plat-samsung/include/plat/spi-core.h |
400 |
+new file mode 100644 |
401 |
+index 0000000..0b9428a |
402 |
+--- /dev/null |
403 |
++++ b/arch/arm/plat-samsung/include/plat/spi-core.h |
404 |
+@@ -0,0 +1,30 @@ |
405 |
++/* |
406 |
++ * Copyright (C) 2012 Heiko Stuebner <heiko@××××××.de> |
407 |
++ * |
408 |
++ * This program is free software; you can redistribute it and/or modify |
409 |
++ * it under the terms of the GNU General Public License version 2 as |
410 |
++ * published by the Free Software Foundation. |
411 |
++ */ |
412 |
++ |
413 |
++#ifndef __PLAT_S3C_SPI_CORE_H |
414 |
++#define __PLAT_S3C_SPI_CORE_H |
415 |
++ |
416 |
++/* These functions are only for use with the core support code, such as |
417 |
++ * the cpu specific initialisation code |
418 |
++ */ |
419 |
++ |
420 |
++/* re-define device name depending on support. */ |
421 |
++static inline void s3c64xx_spi_setname(char *name) |
422 |
++{ |
423 |
++#ifdef CONFIG_S3C64XX_DEV_SPI0 |
424 |
++ s3c64xx_device_spi0.name = name; |
425 |
++#endif |
426 |
++#ifdef CONFIG_S3C64XX_DEV_SPI1 |
427 |
++ s3c64xx_device_spi1.name = name; |
428 |
++#endif |
429 |
++#ifdef CONFIG_S3C64XX_DEV_SPI2 |
430 |
++ s3c64xx_device_spi2.name = name; |
431 |
++#endif |
432 |
++} |
433 |
++ |
434 |
++#endif /* __PLAT_S3C_SPI_CORE_H */ |
435 |
+diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h |
436 |
+index c9dcc18..029189d 100644 |
437 |
+--- a/arch/x86/include/asm/efi.h |
438 |
++++ b/arch/x86/include/asm/efi.h |
439 |
+@@ -98,6 +98,7 @@ extern void efi_set_executable(efi_memory_desc_t *md, bool executable); |
440 |
+ extern int efi_memblock_x86_reserve_range(void); |
441 |
+ extern void efi_call_phys_prelog(void); |
442 |
+ extern void efi_call_phys_epilog(void); |
443 |
++extern void efi_unmap_memmap(void); |
444 |
+ |
445 |
+ #ifndef CONFIG_EFI |
446 |
+ /* |
447 |
+diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c |
448 |
+index ed858e9..df06ade 100644 |
449 |
+--- a/arch/x86/kernel/e820.c |
450 |
++++ b/arch/x86/kernel/e820.c |
451 |
+@@ -1077,6 +1077,9 @@ void __init memblock_x86_fill(void) |
452 |
+ memblock_add(ei->addr, ei->size); |
453 |
+ } |
454 |
+ |
455 |
++ /* throw away partial pages */ |
456 |
++ memblock_trim_memory(PAGE_SIZE); |
457 |
++ |
458 |
+ memblock_dump_all(); |
459 |
+ } |
460 |
+ |
461 |
+diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c |
462 |
+index 198e774..5cee802 100644 |
463 |
+--- a/arch/x86/kernel/setup.c |
464 |
++++ b/arch/x86/kernel/setup.c |
465 |
+@@ -920,18 +920,19 @@ void __init setup_arch(char **cmdline_p) |
466 |
+ #ifdef CONFIG_X86_64 |
467 |
+ if (max_pfn > max_low_pfn) { |
468 |
+ int i; |
469 |
+- for (i = 0; i < e820.nr_map; i++) { |
470 |
+- struct e820entry *ei = &e820.map[i]; |
471 |
++ unsigned long start, end; |
472 |
++ unsigned long start_pfn, end_pfn; |
473 |
+ |
474 |
+- if (ei->addr + ei->size <= 1UL << 32) |
475 |
+- continue; |
476 |
++ for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, |
477 |
++ NULL) { |
478 |
+ |
479 |
+- if (ei->type == E820_RESERVED) |
480 |
++ end = PFN_PHYS(end_pfn); |
481 |
++ if (end <= (1UL<<32)) |
482 |
+ continue; |
483 |
+ |
484 |
++ start = PFN_PHYS(start_pfn); |
485 |
+ max_pfn_mapped = init_memory_mapping( |
486 |
+- ei->addr < 1UL << 32 ? 1UL << 32 : ei->addr, |
487 |
+- ei->addr + ei->size); |
488 |
++ max((1UL<<32), start), end); |
489 |
+ } |
490 |
+ |
491 |
+ /* can we preseve max_low_pfn ?*/ |
492 |
+@@ -1047,6 +1048,18 @@ void __init setup_arch(char **cmdline_p) |
493 |
+ mcheck_init(); |
494 |
+ |
495 |
+ arch_init_ideal_nops(); |
496 |
++ |
497 |
++#ifdef CONFIG_EFI |
498 |
++ /* Once setup is done above, disable efi_enabled on mismatched |
499 |
++ * firmware/kernel archtectures since there is no support for |
500 |
++ * runtime services. |
501 |
++ */ |
502 |
++ if (efi_enabled && IS_ENABLED(CONFIG_X86_64) != efi_64bit) { |
503 |
++ pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n"); |
504 |
++ efi_unmap_memmap(); |
505 |
++ efi_enabled = 0; |
506 |
++ } |
507 |
++#endif |
508 |
+ } |
509 |
+ |
510 |
+ #ifdef CONFIG_X86_32 |
511 |
+diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c |
512 |
+index ab1f6a9..d7aea41 100644 |
513 |
+--- a/arch/x86/mm/init.c |
514 |
++++ b/arch/x86/mm/init.c |
515 |
+@@ -35,40 +35,44 @@ struct map_range { |
516 |
+ unsigned page_size_mask; |
517 |
+ }; |
518 |
+ |
519 |
+-static void __init find_early_table_space(struct map_range *mr, unsigned long end, |
520 |
+- int use_pse, int use_gbpages) |
521 |
++/* |
522 |
++ * First calculate space needed for kernel direct mapping page tables to cover |
523 |
++ * mr[0].start to mr[nr_range - 1].end, while accounting for possible 2M and 1GB |
524 |
++ * pages. Then find enough contiguous space for those page tables. |
525 |
++ */ |
526 |
++static void __init find_early_table_space(struct map_range *mr, int nr_range) |
527 |
+ { |
528 |
+- unsigned long puds, pmds, ptes, tables, start = 0, good_end = end; |
529 |
++ int i; |
530 |
++ unsigned long puds = 0, pmds = 0, ptes = 0, tables; |
531 |
++ unsigned long start = 0, good_end; |
532 |
+ phys_addr_t base; |
533 |
+ |
534 |
+- puds = (end + PUD_SIZE - 1) >> PUD_SHIFT; |
535 |
+- tables = roundup(puds * sizeof(pud_t), PAGE_SIZE); |
536 |
+- |
537 |
+- if (use_gbpages) { |
538 |
+- unsigned long extra; |
539 |
+- |
540 |
+- extra = end - ((end>>PUD_SHIFT) << PUD_SHIFT); |
541 |
+- pmds = (extra + PMD_SIZE - 1) >> PMD_SHIFT; |
542 |
+- } else |
543 |
+- pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; |
544 |
++ for (i = 0; i < nr_range; i++) { |
545 |
++ unsigned long range, extra; |
546 |
+ |
547 |
+- tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE); |
548 |
++ range = mr[i].end - mr[i].start; |
549 |
++ puds += (range + PUD_SIZE - 1) >> PUD_SHIFT; |
550 |
+ |
551 |
+- if (use_pse) { |
552 |
+- unsigned long extra; |
553 |
++ if (mr[i].page_size_mask & (1 << PG_LEVEL_1G)) { |
554 |
++ extra = range - ((range >> PUD_SHIFT) << PUD_SHIFT); |
555 |
++ pmds += (extra + PMD_SIZE - 1) >> PMD_SHIFT; |
556 |
++ } else { |
557 |
++ pmds += (range + PMD_SIZE - 1) >> PMD_SHIFT; |
558 |
++ } |
559 |
+ |
560 |
+- extra = end - ((end>>PMD_SHIFT) << PMD_SHIFT); |
561 |
++ if (mr[i].page_size_mask & (1 << PG_LEVEL_2M)) { |
562 |
++ extra = range - ((range >> PMD_SHIFT) << PMD_SHIFT); |
563 |
+ #ifdef CONFIG_X86_32 |
564 |
+- extra += PMD_SIZE; |
565 |
++ extra += PMD_SIZE; |
566 |
+ #endif |
567 |
+- /* The first 2/4M doesn't use large pages. */ |
568 |
+- if (mr->start < PMD_SIZE) |
569 |
+- extra += mr->end - mr->start; |
570 |
+- |
571 |
+- ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT; |
572 |
+- } else |
573 |
+- ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT; |
574 |
++ ptes += (extra + PAGE_SIZE - 1) >> PAGE_SHIFT; |
575 |
++ } else { |
576 |
++ ptes += (range + PAGE_SIZE - 1) >> PAGE_SHIFT; |
577 |
++ } |
578 |
++ } |
579 |
+ |
580 |
++ tables = roundup(puds * sizeof(pud_t), PAGE_SIZE); |
581 |
++ tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE); |
582 |
+ tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE); |
583 |
+ |
584 |
+ #ifdef CONFIG_X86_32 |
585 |
+@@ -86,7 +90,7 @@ static void __init find_early_table_space(struct map_range *mr, unsigned long en |
586 |
+ pgt_buf_top = pgt_buf_start + (tables >> PAGE_SHIFT); |
587 |
+ |
588 |
+ printk(KERN_DEBUG "kernel direct mapping tables up to %#lx @ [mem %#010lx-%#010lx]\n", |
589 |
+- end - 1, pgt_buf_start << PAGE_SHIFT, |
590 |
++ mr[nr_range - 1].end - 1, pgt_buf_start << PAGE_SHIFT, |
591 |
+ (pgt_buf_top << PAGE_SHIFT) - 1); |
592 |
+ } |
593 |
+ |
594 |
+@@ -267,7 +271,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, |
595 |
+ * nodes are discovered. |
596 |
+ */ |
597 |
+ if (!after_bootmem) |
598 |
+- find_early_table_space(&mr[0], end, use_pse, use_gbpages); |
599 |
++ find_early_table_space(mr, nr_range); |
600 |
+ |
601 |
+ for (i = 0; i < nr_range; i++) |
602 |
+ ret = kernel_physical_mapping_init(mr[i].start, mr[i].end, |
603 |
+diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c |
604 |
+index 2b6b4a3..3baff25 100644 |
605 |
+--- a/arch/x86/mm/init_64.c |
606 |
++++ b/arch/x86/mm/init_64.c |
607 |
+@@ -386,7 +386,8 @@ phys_pte_init(pte_t *pte_page, unsigned long addr, unsigned long end, |
608 |
+ * these mappings are more intelligent. |
609 |
+ */ |
610 |
+ if (pte_val(*pte)) { |
611 |
+- pages++; |
612 |
++ if (!after_bootmem) |
613 |
++ pages++; |
614 |
+ continue; |
615 |
+ } |
616 |
+ |
617 |
+@@ -451,6 +452,8 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end, |
618 |
+ * attributes. |
619 |
+ */ |
620 |
+ if (page_size_mask & (1 << PG_LEVEL_2M)) { |
621 |
++ if (!after_bootmem) |
622 |
++ pages++; |
623 |
+ last_map_addr = next; |
624 |
+ continue; |
625 |
+ } |
626 |
+@@ -526,6 +529,8 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end, |
627 |
+ * attributes. |
628 |
+ */ |
629 |
+ if (page_size_mask & (1 << PG_LEVEL_1G)) { |
630 |
++ if (!after_bootmem) |
631 |
++ pages++; |
632 |
+ last_map_addr = next; |
633 |
+ continue; |
634 |
+ } |
635 |
+diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c |
636 |
+index f55a4ce..72d8899 100644 |
637 |
+--- a/arch/x86/platform/efi/efi.c |
638 |
++++ b/arch/x86/platform/efi/efi.c |
639 |
+@@ -69,11 +69,15 @@ EXPORT_SYMBOL(efi); |
640 |
+ struct efi_memory_map memmap; |
641 |
+ |
642 |
+ bool efi_64bit; |
643 |
+-static bool efi_native; |
644 |
+ |
645 |
+ static struct efi efi_phys __initdata; |
646 |
+ static efi_system_table_t efi_systab __initdata; |
647 |
+ |
648 |
++static inline bool efi_is_native(void) |
649 |
++{ |
650 |
++ return IS_ENABLED(CONFIG_X86_64) == efi_64bit; |
651 |
++} |
652 |
++ |
653 |
+ static int __init setup_noefi(char *arg) |
654 |
+ { |
655 |
+ efi_enabled = 0; |
656 |
+@@ -419,10 +423,21 @@ void __init efi_reserve_boot_services(void) |
657 |
+ } |
658 |
+ } |
659 |
+ |
660 |
+-static void __init efi_free_boot_services(void) |
661 |
++void __init efi_unmap_memmap(void) |
662 |
++{ |
663 |
++ if (memmap.map) { |
664 |
++ early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size); |
665 |
++ memmap.map = NULL; |
666 |
++ } |
667 |
++} |
668 |
++ |
669 |
++void __init efi_free_boot_services(void) |
670 |
+ { |
671 |
+ void *p; |
672 |
+ |
673 |
++ if (!efi_is_native()) |
674 |
++ return; |
675 |
++ |
676 |
+ for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { |
677 |
+ efi_memory_desc_t *md = p; |
678 |
+ unsigned long long start = md->phys_addr; |
679 |
+@@ -438,6 +453,8 @@ static void __init efi_free_boot_services(void) |
680 |
+ |
681 |
+ free_bootmem_late(start, size); |
682 |
+ } |
683 |
++ |
684 |
++ efi_unmap_memmap(); |
685 |
+ } |
686 |
+ |
687 |
+ static int __init efi_systab_init(void *phys) |
688 |
+@@ -670,12 +687,10 @@ void __init efi_init(void) |
689 |
+ return; |
690 |
+ } |
691 |
+ efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab; |
692 |
+- efi_native = !efi_64bit; |
693 |
+ #else |
694 |
+ efi_phys.systab = (efi_system_table_t *) |
695 |
+ (boot_params.efi_info.efi_systab | |
696 |
+ ((__u64)boot_params.efi_info.efi_systab_hi<<32)); |
697 |
+- efi_native = efi_64bit; |
698 |
+ #endif |
699 |
+ |
700 |
+ if (efi_systab_init(efi_phys.systab)) { |
701 |
+@@ -709,7 +724,7 @@ void __init efi_init(void) |
702 |
+ * that doesn't match the kernel 32/64-bit mode. |
703 |
+ */ |
704 |
+ |
705 |
+- if (!efi_native) |
706 |
++ if (!efi_is_native()) |
707 |
+ pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n"); |
708 |
+ else if (efi_runtime_init()) { |
709 |
+ efi_enabled = 0; |
710 |
+@@ -721,7 +736,7 @@ void __init efi_init(void) |
711 |
+ return; |
712 |
+ } |
713 |
+ #ifdef CONFIG_X86_32 |
714 |
+- if (efi_native) { |
715 |
++ if (efi_is_native()) { |
716 |
+ x86_platform.get_wallclock = efi_get_time; |
717 |
+ x86_platform.set_wallclock = efi_set_rtc_mmss; |
718 |
+ } |
719 |
+@@ -787,8 +802,10 @@ void __init efi_enter_virtual_mode(void) |
720 |
+ * non-native EFI |
721 |
+ */ |
722 |
+ |
723 |
+- if (!efi_native) |
724 |
+- goto out; |
725 |
++ if (!efi_is_native()) { |
726 |
++ efi_unmap_memmap(); |
727 |
++ return; |
728 |
++ } |
729 |
+ |
730 |
+ /* Merge contiguous regions of the same type and attribute */ |
731 |
+ for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { |
732 |
+@@ -878,13 +895,6 @@ void __init efi_enter_virtual_mode(void) |
733 |
+ } |
734 |
+ |
735 |
+ /* |
736 |
+- * Thankfully, it does seem that no runtime services other than |
737 |
+- * SetVirtualAddressMap() will touch boot services code, so we can |
738 |
+- * get rid of it all at this point |
739 |
+- */ |
740 |
+- efi_free_boot_services(); |
741 |
+- |
742 |
+- /* |
743 |
+ * Now that EFI is in virtual mode, update the function |
744 |
+ * pointers in the runtime service table to the new virtual addresses. |
745 |
+ * |
746 |
+@@ -907,9 +917,6 @@ void __init efi_enter_virtual_mode(void) |
747 |
+ if (__supported_pte_mask & _PAGE_NX) |
748 |
+ runtime_code_page_mkexec(); |
749 |
+ |
750 |
+-out: |
751 |
+- early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size); |
752 |
+- memmap.map = NULL; |
753 |
+ kfree(new_memmap); |
754 |
+ } |
755 |
+ |
756 |
+diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c |
757 |
+index 758af9c..0059e26 100644 |
758 |
+--- a/drivers/bcma/main.c |
759 |
++++ b/drivers/bcma/main.c |
760 |
+@@ -141,9 +141,10 @@ static int bcma_register_cores(struct bcma_bus *bus) |
761 |
+ |
762 |
+ static void bcma_unregister_cores(struct bcma_bus *bus) |
763 |
+ { |
764 |
+- struct bcma_device *core; |
765 |
++ struct bcma_device *core, *tmp; |
766 |
+ |
767 |
+- list_for_each_entry(core, &bus->cores, list) { |
768 |
++ list_for_each_entry_safe(core, tmp, &bus->cores, list) { |
769 |
++ list_del(&core->list); |
770 |
+ if (core->dev_registered) |
771 |
+ device_unregister(&core->dev); |
772 |
+ } |
773 |
+diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c |
774 |
+index 1a40935..c671369 100644 |
775 |
+--- a/drivers/cpufreq/powernow-k8.c |
776 |
++++ b/drivers/cpufreq/powernow-k8.c |
777 |
+@@ -1223,14 +1223,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, |
778 |
+ struct powernowk8_target_arg pta = { .pol = pol, .targfreq = targfreq, |
779 |
+ .relation = relation }; |
780 |
+ |
781 |
+- /* |
782 |
+- * Must run on @pol->cpu. cpufreq core is responsible for ensuring |
783 |
+- * that we're bound to the current CPU and pol->cpu stays online. |
784 |
+- */ |
785 |
+- if (smp_processor_id() == pol->cpu) |
786 |
+- return powernowk8_target_fn(&pta); |
787 |
+- else |
788 |
+- return work_on_cpu(pol->cpu, powernowk8_target_fn, &pta); |
789 |
++ return work_on_cpu(pol->cpu, powernowk8_target_fn, &pta); |
790 |
+ } |
791 |
+ |
792 |
+ /* Driver entry point to verify the policy and range of frequencies */ |
793 |
+diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c |
794 |
+index 5084975..8aa9113 100644 |
795 |
+--- a/drivers/dma/imx-dma.c |
796 |
++++ b/drivers/dma/imx-dma.c |
797 |
+@@ -474,8 +474,10 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) |
798 |
+ slot = i; |
799 |
+ break; |
800 |
+ } |
801 |
+- if (slot < 0) |
802 |
++ if (slot < 0) { |
803 |
++ spin_unlock_irqrestore(&imxdma->lock, flags); |
804 |
+ return -EBUSY; |
805 |
++ } |
806 |
+ |
807 |
+ imxdma->slots_2d[slot].xsr = d->x; |
808 |
+ imxdma->slots_2d[slot].ysr = d->y; |
809 |
+diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c |
810 |
+index 434ad31..c439489 100644 |
811 |
+--- a/drivers/dma/sirf-dma.c |
812 |
++++ b/drivers/dma/sirf-dma.c |
813 |
+@@ -109,7 +109,7 @@ static void sirfsoc_dma_execute(struct sirfsoc_dma_chan *schan) |
814 |
+ sdesc = list_first_entry(&schan->queued, struct sirfsoc_dma_desc, |
815 |
+ node); |
816 |
+ /* Move the first queued descriptor to active list */ |
817 |
+- list_move_tail(&schan->queued, &schan->active); |
818 |
++ list_move_tail(&sdesc->node, &schan->active); |
819 |
+ |
820 |
+ /* Start the DMA transfer */ |
821 |
+ writel_relaxed(sdesc->width, sdma->base + SIRFSOC_DMA_WIDTH_0 + |
822 |
+@@ -428,7 +428,7 @@ static struct dma_async_tx_descriptor *sirfsoc_dma_prep_interleaved( |
823 |
+ unsigned long iflags; |
824 |
+ int ret; |
825 |
+ |
826 |
+- if ((xt->dir != DMA_MEM_TO_DEV) || (xt->dir != DMA_DEV_TO_MEM)) { |
827 |
++ if ((xt->dir != DMA_MEM_TO_DEV) && (xt->dir != DMA_DEV_TO_MEM)) { |
828 |
+ ret = -EINVAL; |
829 |
+ goto err_dir; |
830 |
+ } |
831 |
+diff --git a/drivers/extcon/extcon_class.c b/drivers/extcon/extcon_class.c |
832 |
+index f6419f9..7dcfb7c 100644 |
833 |
+--- a/drivers/extcon/extcon_class.c |
834 |
++++ b/drivers/extcon/extcon_class.c |
835 |
+@@ -575,6 +575,10 @@ static void extcon_cleanup(struct extcon_dev *edev, bool skip) |
836 |
+ kfree(edev->cables); |
837 |
+ } |
838 |
+ |
839 |
++#if defined(CONFIG_ANDROID) |
840 |
++ if (switch_class) |
841 |
++ class_compat_remove_link(switch_class, edev->dev, NULL); |
842 |
++#endif |
843 |
+ device_unregister(edev->dev); |
844 |
+ put_device(edev->dev); |
845 |
+ } |
846 |
+@@ -821,6 +825,9 @@ module_init(extcon_class_init); |
847 |
+ |
848 |
+ static void __exit extcon_class_exit(void) |
849 |
+ { |
850 |
++#if defined(CONFIG_ANDROID) |
851 |
++ class_compat_unregister(switch_class); |
852 |
++#endif |
853 |
+ class_destroy(extcon_class); |
854 |
+ } |
855 |
+ module_exit(extcon_class_exit); |
856 |
+diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c |
857 |
+index d883b20..e932810 100644 |
858 |
+--- a/drivers/gpu/drm/radeon/evergreen_cs.c |
859 |
++++ b/drivers/gpu/drm/radeon/evergreen_cs.c |
860 |
+@@ -2829,6 +2829,7 @@ static bool evergreen_vm_reg_valid(u32 reg) |
861 |
+ case CAYMAN_SQ_EX_ALLOC_TABLE_SLOTS: |
862 |
+ return true; |
863 |
+ default: |
864 |
++ DRM_ERROR("Invalid register 0x%x in CS\n", reg); |
865 |
+ return false; |
866 |
+ } |
867 |
+ } |
868 |
+diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c |
869 |
+index 4065374..f4c3d28 100644 |
870 |
+--- a/drivers/hv/channel.c |
871 |
++++ b/drivers/hv/channel.c |
872 |
+@@ -146,14 +146,14 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, |
873 |
+ |
874 |
+ if (ret != 0) { |
875 |
+ err = ret; |
876 |
+- goto errorout; |
877 |
++ goto error0; |
878 |
+ } |
879 |
+ |
880 |
+ ret = hv_ringbuffer_init( |
881 |
+ &newchannel->inbound, in, recv_ringbuffer_size); |
882 |
+ if (ret != 0) { |
883 |
+ err = ret; |
884 |
+- goto errorout; |
885 |
++ goto error0; |
886 |
+ } |
887 |
+ |
888 |
+ |
889 |
+@@ -168,7 +168,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, |
890 |
+ |
891 |
+ if (ret != 0) { |
892 |
+ err = ret; |
893 |
+- goto errorout; |
894 |
++ goto error0; |
895 |
+ } |
896 |
+ |
897 |
+ /* Create and init the channel open message */ |
898 |
+@@ -177,7 +177,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, |
899 |
+ GFP_KERNEL); |
900 |
+ if (!open_info) { |
901 |
+ err = -ENOMEM; |
902 |
+- goto errorout; |
903 |
++ goto error0; |
904 |
+ } |
905 |
+ |
906 |
+ init_completion(&open_info->waitevent); |
907 |
+@@ -193,7 +193,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, |
908 |
+ |
909 |
+ if (userdatalen > MAX_USER_DEFINED_BYTES) { |
910 |
+ err = -EINVAL; |
911 |
+- goto errorout; |
912 |
++ goto error0; |
913 |
+ } |
914 |
+ |
915 |
+ if (userdatalen) |
916 |
+@@ -208,19 +208,18 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, |
917 |
+ sizeof(struct vmbus_channel_open_channel)); |
918 |
+ |
919 |
+ if (ret != 0) |
920 |
+- goto cleanup; |
921 |
++ goto error1; |
922 |
+ |
923 |
+ t = wait_for_completion_timeout(&open_info->waitevent, 5*HZ); |
924 |
+ if (t == 0) { |
925 |
+ err = -ETIMEDOUT; |
926 |
+- goto errorout; |
927 |
++ goto error1; |
928 |
+ } |
929 |
+ |
930 |
+ |
931 |
+ if (open_info->response.open_result.status) |
932 |
+ err = open_info->response.open_result.status; |
933 |
+ |
934 |
+-cleanup: |
935 |
+ spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); |
936 |
+ list_del(&open_info->msglistentry); |
937 |
+ spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); |
938 |
+@@ -228,9 +227,12 @@ cleanup: |
939 |
+ kfree(open_info); |
940 |
+ return err; |
941 |
+ |
942 |
+-errorout: |
943 |
+- hv_ringbuffer_cleanup(&newchannel->outbound); |
944 |
+- hv_ringbuffer_cleanup(&newchannel->inbound); |
945 |
++error1: |
946 |
++ spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); |
947 |
++ list_del(&open_info->msglistentry); |
948 |
++ spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); |
949 |
++ |
950 |
++error0: |
951 |
+ free_pages((unsigned long)out, |
952 |
+ get_order(send_ringbuffer_size + recv_ringbuffer_size)); |
953 |
+ kfree(open_info); |
954 |
+diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c |
955 |
+index 4e2a162..4e98100 100644 |
956 |
+--- a/drivers/net/ethernet/tile/tilegx.c |
957 |
++++ b/drivers/net/ethernet/tile/tilegx.c |
958 |
+@@ -1334,11 +1334,11 @@ static int tso_count_edescs(struct sk_buff *skb) |
959 |
+ { |
960 |
+ struct skb_shared_info *sh = skb_shinfo(skb); |
961 |
+ unsigned int sh_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
962 |
+- unsigned int data_len = skb->data_len + skb->hdr_len - sh_len; |
963 |
++ unsigned int data_len = skb->len - sh_len; |
964 |
+ unsigned int p_len = sh->gso_size; |
965 |
+ long f_id = -1; /* id of the current fragment */ |
966 |
+- long f_size = skb->hdr_len; /* size of the current fragment */ |
967 |
+- long f_used = sh_len; /* bytes used from the current fragment */ |
968 |
++ long f_size = skb_headlen(skb) - sh_len; /* current fragment size */ |
969 |
++ long f_used = 0; /* bytes used from the current fragment */ |
970 |
+ long n; /* size of the current piece of payload */ |
971 |
+ int num_edescs = 0; |
972 |
+ int segment; |
973 |
+@@ -1353,7 +1353,7 @@ static int tso_count_edescs(struct sk_buff *skb) |
974 |
+ /* Advance as needed. */ |
975 |
+ while (f_used >= f_size) { |
976 |
+ f_id++; |
977 |
+- f_size = sh->frags[f_id].size; |
978 |
++ f_size = skb_frag_size(&sh->frags[f_id]); |
979 |
+ f_used = 0; |
980 |
+ } |
981 |
+ |
982 |
+@@ -1384,13 +1384,13 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers, |
983 |
+ struct iphdr *ih; |
984 |
+ struct tcphdr *th; |
985 |
+ unsigned int sh_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
986 |
+- unsigned int data_len = skb->data_len + skb->hdr_len - sh_len; |
987 |
++ unsigned int data_len = skb->len - sh_len; |
988 |
+ unsigned char *data = skb->data; |
989 |
+ unsigned int ih_off, th_off, p_len; |
990 |
+ unsigned int isum_seed, tsum_seed, id, seq; |
991 |
+ long f_id = -1; /* id of the current fragment */ |
992 |
+- long f_size = skb->hdr_len; /* size of the current fragment */ |
993 |
+- long f_used = sh_len; /* bytes used from the current fragment */ |
994 |
++ long f_size = skb_headlen(skb) - sh_len; /* current fragment size */ |
995 |
++ long f_used = 0; /* bytes used from the current fragment */ |
996 |
+ long n; /* size of the current piece of payload */ |
997 |
+ int segment; |
998 |
+ |
999 |
+@@ -1405,7 +1405,7 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers, |
1000 |
+ isum_seed = ((0xFFFF - ih->check) + |
1001 |
+ (0xFFFF - ih->tot_len) + |
1002 |
+ (0xFFFF - ih->id)); |
1003 |
+- tsum_seed = th->check + (0xFFFF ^ htons(sh_len + data_len)); |
1004 |
++ tsum_seed = th->check + (0xFFFF ^ htons(skb->len)); |
1005 |
+ id = ntohs(ih->id); |
1006 |
+ seq = ntohl(th->seq); |
1007 |
+ |
1008 |
+@@ -1444,7 +1444,7 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers, |
1009 |
+ /* Advance as needed. */ |
1010 |
+ while (f_used >= f_size) { |
1011 |
+ f_id++; |
1012 |
+- f_size = sh->frags[f_id].size; |
1013 |
++ f_size = skb_frag_size(&sh->frags[f_id]); |
1014 |
+ f_used = 0; |
1015 |
+ } |
1016 |
+ |
1017 |
+@@ -1478,14 +1478,14 @@ static void tso_egress(struct net_device *dev, gxio_mpipe_equeue_t *equeue, |
1018 |
+ struct tile_net_priv *priv = netdev_priv(dev); |
1019 |
+ struct skb_shared_info *sh = skb_shinfo(skb); |
1020 |
+ unsigned int sh_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
1021 |
+- unsigned int data_len = skb->data_len + skb->hdr_len - sh_len; |
1022 |
++ unsigned int data_len = skb->len - sh_len; |
1023 |
+ unsigned int p_len = sh->gso_size; |
1024 |
+ gxio_mpipe_edesc_t edesc_head = { { 0 } }; |
1025 |
+ gxio_mpipe_edesc_t edesc_body = { { 0 } }; |
1026 |
+ long f_id = -1; /* id of the current fragment */ |
1027 |
+- long f_size = skb->hdr_len; /* size of the current fragment */ |
1028 |
+- long f_used = sh_len; /* bytes used from the current fragment */ |
1029 |
+- void *f_data = skb->data; |
1030 |
++ long f_size = skb_headlen(skb) - sh_len; /* current fragment size */ |
1031 |
++ long f_used = 0; /* bytes used from the current fragment */ |
1032 |
++ void *f_data = skb->data + sh_len; |
1033 |
+ long n; /* size of the current piece of payload */ |
1034 |
+ unsigned long tx_packets = 0, tx_bytes = 0; |
1035 |
+ unsigned int csum_start; |
1036 |
+@@ -1516,15 +1516,18 @@ static void tso_egress(struct net_device *dev, gxio_mpipe_equeue_t *equeue, |
1037 |
+ |
1038 |
+ /* Egress the payload. */ |
1039 |
+ while (p_used < p_len) { |
1040 |
++ void *va; |
1041 |
+ |
1042 |
+ /* Advance as needed. */ |
1043 |
+ while (f_used >= f_size) { |
1044 |
+ f_id++; |
1045 |
+- f_size = sh->frags[f_id].size; |
1046 |
+- f_used = 0; |
1047 |
++ f_size = skb_frag_size(&sh->frags[f_id]); |
1048 |
+ f_data = tile_net_frag_buf(&sh->frags[f_id]); |
1049 |
++ f_used = 0; |
1050 |
+ } |
1051 |
+ |
1052 |
++ va = f_data + f_used; |
1053 |
++ |
1054 |
+ /* Use bytes from the current fragment. */ |
1055 |
+ n = p_len - p_used; |
1056 |
+ if (n > f_size - f_used) |
1057 |
+@@ -1533,7 +1536,7 @@ static void tso_egress(struct net_device *dev, gxio_mpipe_equeue_t *equeue, |
1058 |
+ p_used += n; |
1059 |
+ |
1060 |
+ /* Egress a piece of the payload. */ |
1061 |
+- edesc_body.va = va_to_tile_io_addr(f_data) + f_used; |
1062 |
++ edesc_body.va = va_to_tile_io_addr(va); |
1063 |
+ edesc_body.xfer_size = n; |
1064 |
+ edesc_body.bound = !(p_used < p_len); |
1065 |
+ gxio_mpipe_equeue_put_at(equeue, edesc_body, slot); |
1066 |
+diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c |
1067 |
+index a03de71..d012982 100644 |
1068 |
+--- a/drivers/net/usb/cdc_ether.c |
1069 |
++++ b/drivers/net/usb/cdc_ether.c |
1070 |
+@@ -592,6 +592,32 @@ static const struct usb_device_id products [] = { |
1071 |
+ .driver_info = 0, |
1072 |
+ }, |
1073 |
+ |
1074 |
++/* Novatel USB551L and MC551 - handled by qmi_wwan */ |
1075 |
++{ |
1076 |
++ .match_flags = USB_DEVICE_ID_MATCH_VENDOR |
1077 |
++ | USB_DEVICE_ID_MATCH_PRODUCT |
1078 |
++ | USB_DEVICE_ID_MATCH_INT_INFO, |
1079 |
++ .idVendor = NOVATEL_VENDOR_ID, |
1080 |
++ .idProduct = 0xB001, |
1081 |
++ .bInterfaceClass = USB_CLASS_COMM, |
1082 |
++ .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, |
1083 |
++ .bInterfaceProtocol = USB_CDC_PROTO_NONE, |
1084 |
++ .driver_info = 0, |
1085 |
++}, |
1086 |
++ |
1087 |
++/* Novatel E362 - handled by qmi_wwan */ |
1088 |
++{ |
1089 |
++ .match_flags = USB_DEVICE_ID_MATCH_VENDOR |
1090 |
++ | USB_DEVICE_ID_MATCH_PRODUCT |
1091 |
++ | USB_DEVICE_ID_MATCH_INT_INFO, |
1092 |
++ .idVendor = NOVATEL_VENDOR_ID, |
1093 |
++ .idProduct = 0x9010, |
1094 |
++ .bInterfaceClass = USB_CLASS_COMM, |
1095 |
++ .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, |
1096 |
++ .bInterfaceProtocol = USB_CDC_PROTO_NONE, |
1097 |
++ .driver_info = 0, |
1098 |
++}, |
1099 |
++ |
1100 |
+ /* |
1101 |
+ * WHITELIST!!! |
1102 |
+ * |
1103 |
+@@ -604,21 +630,6 @@ static const struct usb_device_id products [] = { |
1104 |
+ * because of bugs/quirks in a given product (like Zaurus, above). |
1105 |
+ */ |
1106 |
+ { |
1107 |
+- /* Novatel USB551L */ |
1108 |
+- /* This match must come *before* the generic CDC-ETHER match so that |
1109 |
+- * we get FLAG_WWAN set on the device, since it's descriptors are |
1110 |
+- * generic CDC-ETHER. |
1111 |
+- */ |
1112 |
+- .match_flags = USB_DEVICE_ID_MATCH_VENDOR |
1113 |
+- | USB_DEVICE_ID_MATCH_PRODUCT |
1114 |
+- | USB_DEVICE_ID_MATCH_INT_INFO, |
1115 |
+- .idVendor = NOVATEL_VENDOR_ID, |
1116 |
+- .idProduct = 0xB001, |
1117 |
+- .bInterfaceClass = USB_CLASS_COMM, |
1118 |
+- .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, |
1119 |
+- .bInterfaceProtocol = USB_CDC_PROTO_NONE, |
1120 |
+- .driver_info = (unsigned long)&wwan_info, |
1121 |
+-}, { |
1122 |
+ /* ZTE (Vodafone) K3805-Z */ |
1123 |
+ .match_flags = USB_DEVICE_ID_MATCH_VENDOR |
1124 |
+ | USB_DEVICE_ID_MATCH_PRODUCT |
1125 |
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c |
1126 |
+index 3543c9e..3585f93 100644 |
1127 |
+--- a/drivers/net/usb/qmi_wwan.c |
1128 |
++++ b/drivers/net/usb/qmi_wwan.c |
1129 |
+@@ -364,6 +364,20 @@ static const struct usb_device_id products[] = { |
1130 |
+ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 57), |
1131 |
+ .driver_info = (unsigned long)&qmi_wwan_info, |
1132 |
+ }, |
1133 |
++ { /* Novatel USB551L and MC551 */ |
1134 |
++ USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0xb001, |
1135 |
++ USB_CLASS_COMM, |
1136 |
++ USB_CDC_SUBCLASS_ETHERNET, |
1137 |
++ USB_CDC_PROTO_NONE), |
1138 |
++ .driver_info = (unsigned long)&qmi_wwan_info, |
1139 |
++ }, |
1140 |
++ { /* Novatel E362 */ |
1141 |
++ USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0x9010, |
1142 |
++ USB_CLASS_COMM, |
1143 |
++ USB_CDC_SUBCLASS_ETHERNET, |
1144 |
++ USB_CDC_PROTO_NONE), |
1145 |
++ .driver_info = (unsigned long)&qmi_wwan_info, |
1146 |
++ }, |
1147 |
+ |
1148 |
+ /* 2. Combined interface devices matching on class+protocol */ |
1149 |
+ { /* Huawei E367 and possibly others in "Windows mode" */ |
1150 |
+diff --git a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h |
1151 |
+index 89bf94d..6f7cf49 100644 |
1152 |
+--- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h |
1153 |
++++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h |
1154 |
+@@ -534,107 +534,107 @@ static const u32 ar9300_2p2_baseband_core[][2] = { |
1155 |
+ |
1156 |
+ static const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5] = { |
1157 |
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ |
1158 |
+- {0x0000a2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352}, |
1159 |
+- {0x0000a2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584}, |
1160 |
+- {0x0000a2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800}, |
1161 |
++ {0x0000a2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, |
1162 |
++ {0x0000a2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, |
1163 |
++ {0x0000a2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, |
1164 |
+ {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, |
1165 |
+ {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, |
1166 |
+ {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
1167 |
+ {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, |
1168 |
+ {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, |
1169 |
+ {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200}, |
1170 |
+- {0x0000a510, 0x15000028, 0x15000028, 0x0f000202, 0x0f000202}, |
1171 |
+- {0x0000a514, 0x1b00002b, 0x1b00002b, 0x12000400, 0x12000400}, |
1172 |
+- {0x0000a518, 0x1f020028, 0x1f020028, 0x16000402, 0x16000402}, |
1173 |
+- {0x0000a51c, 0x2502002b, 0x2502002b, 0x19000404, 0x19000404}, |
1174 |
+- {0x0000a520, 0x2a04002a, 0x2a04002a, 0x1c000603, 0x1c000603}, |
1175 |
+- {0x0000a524, 0x2e06002a, 0x2e06002a, 0x21000a02, 0x21000a02}, |
1176 |
+- {0x0000a528, 0x3302202d, 0x3302202d, 0x25000a04, 0x25000a04}, |
1177 |
+- {0x0000a52c, 0x3804202c, 0x3804202c, 0x28000a20, 0x28000a20}, |
1178 |
+- {0x0000a530, 0x3c06202c, 0x3c06202c, 0x2c000e20, 0x2c000e20}, |
1179 |
+- {0x0000a534, 0x4108202d, 0x4108202d, 0x30000e22, 0x30000e22}, |
1180 |
+- {0x0000a538, 0x4506402d, 0x4506402d, 0x34000e24, 0x34000e24}, |
1181 |
+- {0x0000a53c, 0x4906222d, 0x4906222d, 0x38001640, 0x38001640}, |
1182 |
+- {0x0000a540, 0x4d062231, 0x4d062231, 0x3c001660, 0x3c001660}, |
1183 |
+- {0x0000a544, 0x50082231, 0x50082231, 0x3f001861, 0x3f001861}, |
1184 |
+- {0x0000a548, 0x5608422e, 0x5608422e, 0x43001a81, 0x43001a81}, |
1185 |
+- {0x0000a54c, 0x5a08442e, 0x5a08442e, 0x47001a83, 0x47001a83}, |
1186 |
+- {0x0000a550, 0x5e0a4431, 0x5e0a4431, 0x4a001c84, 0x4a001c84}, |
1187 |
+- {0x0000a554, 0x640a4432, 0x640a4432, 0x4e001ce3, 0x4e001ce3}, |
1188 |
+- {0x0000a558, 0x680a4434, 0x680a4434, 0x52001ce5, 0x52001ce5}, |
1189 |
+- {0x0000a55c, 0x6c0a6434, 0x6c0a6434, 0x56001ce9, 0x56001ce9}, |
1190 |
+- {0x0000a560, 0x6f0a6633, 0x6f0a6633, 0x5a001ceb, 0x5a001ceb}, |
1191 |
+- {0x0000a564, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec}, |
1192 |
+- {0x0000a568, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec}, |
1193 |
+- {0x0000a56c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec}, |
1194 |
+- {0x0000a570, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec}, |
1195 |
+- {0x0000a574, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec}, |
1196 |
+- {0x0000a578, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec}, |
1197 |
+- {0x0000a57c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec}, |
1198 |
++ {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202}, |
1199 |
++ {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400}, |
1200 |
++ {0x0000a518, 0x21002220, 0x21002220, 0x16000402, 0x16000402}, |
1201 |
++ {0x0000a51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404}, |
1202 |
++ {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603}, |
1203 |
++ {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02}, |
1204 |
++ {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04}, |
1205 |
++ {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20}, |
1206 |
++ {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20}, |
1207 |
++ {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22}, |
1208 |
++ {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24}, |
1209 |
++ {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640}, |
1210 |
++ {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660}, |
1211 |
++ {0x0000a544, 0x52022470, 0x52022470, 0x3f001861, 0x3f001861}, |
1212 |
++ {0x0000a548, 0x55022490, 0x55022490, 0x43001a81, 0x43001a81}, |
1213 |
++ {0x0000a54c, 0x59022492, 0x59022492, 0x47001a83, 0x47001a83}, |
1214 |
++ {0x0000a550, 0x5d022692, 0x5d022692, 0x4a001c84, 0x4a001c84}, |
1215 |
++ {0x0000a554, 0x61022892, 0x61022892, 0x4e001ce3, 0x4e001ce3}, |
1216 |
++ {0x0000a558, 0x65024890, 0x65024890, 0x52001ce5, 0x52001ce5}, |
1217 |
++ {0x0000a55c, 0x69024892, 0x69024892, 0x56001ce9, 0x56001ce9}, |
1218 |
++ {0x0000a560, 0x6e024c92, 0x6e024c92, 0x5a001ceb, 0x5a001ceb}, |
1219 |
++ {0x0000a564, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
1220 |
++ {0x0000a568, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
1221 |
++ {0x0000a56c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
1222 |
++ {0x0000a570, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
1223 |
++ {0x0000a574, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
1224 |
++ {0x0000a578, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
1225 |
++ {0x0000a57c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
1226 |
+ {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000}, |
1227 |
+ {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002}, |
1228 |
+ {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004}, |
1229 |
+ {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200}, |
1230 |
+- {0x0000a590, 0x15800028, 0x15800028, 0x0f800202, 0x0f800202}, |
1231 |
+- {0x0000a594, 0x1b80002b, 0x1b80002b, 0x12800400, 0x12800400}, |
1232 |
+- {0x0000a598, 0x1f820028, 0x1f820028, 0x16800402, 0x16800402}, |
1233 |
+- {0x0000a59c, 0x2582002b, 0x2582002b, 0x19800404, 0x19800404}, |
1234 |
+- {0x0000a5a0, 0x2a84002a, 0x2a84002a, 0x1c800603, 0x1c800603}, |
1235 |
+- {0x0000a5a4, 0x2e86002a, 0x2e86002a, 0x21800a02, 0x21800a02}, |
1236 |
+- {0x0000a5a8, 0x3382202d, 0x3382202d, 0x25800a04, 0x25800a04}, |
1237 |
+- {0x0000a5ac, 0x3884202c, 0x3884202c, 0x28800a20, 0x28800a20}, |
1238 |
+- {0x0000a5b0, 0x3c86202c, 0x3c86202c, 0x2c800e20, 0x2c800e20}, |
1239 |
+- {0x0000a5b4, 0x4188202d, 0x4188202d, 0x30800e22, 0x30800e22}, |
1240 |
+- {0x0000a5b8, 0x4586402d, 0x4586402d, 0x34800e24, 0x34800e24}, |
1241 |
+- {0x0000a5bc, 0x4986222d, 0x4986222d, 0x38801640, 0x38801640}, |
1242 |
+- {0x0000a5c0, 0x4d862231, 0x4d862231, 0x3c801660, 0x3c801660}, |
1243 |
+- {0x0000a5c4, 0x50882231, 0x50882231, 0x3f801861, 0x3f801861}, |
1244 |
+- {0x0000a5c8, 0x5688422e, 0x5688422e, 0x43801a81, 0x43801a81}, |
1245 |
+- {0x0000a5cc, 0x5a88442e, 0x5a88442e, 0x47801a83, 0x47801a83}, |
1246 |
+- {0x0000a5d0, 0x5e8a4431, 0x5e8a4431, 0x4a801c84, 0x4a801c84}, |
1247 |
+- {0x0000a5d4, 0x648a4432, 0x648a4432, 0x4e801ce3, 0x4e801ce3}, |
1248 |
+- {0x0000a5d8, 0x688a4434, 0x688a4434, 0x52801ce5, 0x52801ce5}, |
1249 |
+- {0x0000a5dc, 0x6c8a6434, 0x6c8a6434, 0x56801ce9, 0x56801ce9}, |
1250 |
+- {0x0000a5e0, 0x6f8a6633, 0x6f8a6633, 0x5a801ceb, 0x5a801ceb}, |
1251 |
+- {0x0000a5e4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec}, |
1252 |
+- {0x0000a5e8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec}, |
1253 |
+- {0x0000a5ec, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec}, |
1254 |
+- {0x0000a5f0, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec}, |
1255 |
+- {0x0000a5f4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec}, |
1256 |
+- {0x0000a5f8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec}, |
1257 |
+- {0x0000a5fc, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec}, |
1258 |
++ {0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202}, |
1259 |
++ {0x0000a594, 0x1c800223, 0x1c800223, 0x12800400, 0x12800400}, |
1260 |
++ {0x0000a598, 0x21802220, 0x21802220, 0x16800402, 0x16800402}, |
1261 |
++ {0x0000a59c, 0x27802223, 0x27802223, 0x19800404, 0x19800404}, |
1262 |
++ {0x0000a5a0, 0x2b822220, 0x2b822220, 0x1c800603, 0x1c800603}, |
1263 |
++ {0x0000a5a4, 0x2f822222, 0x2f822222, 0x21800a02, 0x21800a02}, |
1264 |
++ {0x0000a5a8, 0x34822225, 0x34822225, 0x25800a04, 0x25800a04}, |
1265 |
++ {0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x28800a20, 0x28800a20}, |
1266 |
++ {0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2c800e20, 0x2c800e20}, |
1267 |
++ {0x0000a5b4, 0x4282242a, 0x4282242a, 0x30800e22, 0x30800e22}, |
1268 |
++ {0x0000a5b8, 0x4782244a, 0x4782244a, 0x34800e24, 0x34800e24}, |
1269 |
++ {0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x38801640, 0x38801640}, |
1270 |
++ {0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x3c801660, 0x3c801660}, |
1271 |
++ {0x0000a5c4, 0x52822470, 0x52822470, 0x3f801861, 0x3f801861}, |
1272 |
++ {0x0000a5c8, 0x55822490, 0x55822490, 0x43801a81, 0x43801a81}, |
1273 |
++ {0x0000a5cc, 0x59822492, 0x59822492, 0x47801a83, 0x47801a83}, |
1274 |
++ {0x0000a5d0, 0x5d822692, 0x5d822692, 0x4a801c84, 0x4a801c84}, |
1275 |
++ {0x0000a5d4, 0x61822892, 0x61822892, 0x4e801ce3, 0x4e801ce3}, |
1276 |
++ {0x0000a5d8, 0x65824890, 0x65824890, 0x52801ce5, 0x52801ce5}, |
1277 |
++ {0x0000a5dc, 0x69824892, 0x69824892, 0x56801ce9, 0x56801ce9}, |
1278 |
++ {0x0000a5e0, 0x6e824c92, 0x6e824c92, 0x5a801ceb, 0x5a801ceb}, |
1279 |
++ {0x0000a5e4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
1280 |
++ {0x0000a5e8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
1281 |
++ {0x0000a5ec, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
1282 |
++ {0x0000a5f0, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
1283 |
++ {0x0000a5f4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
1284 |
++ {0x0000a5f8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
1285 |
++ {0x0000a5fc, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
1286 |
+ {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
1287 |
+ {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
1288 |
+- {0x0000a608, 0x01804601, 0x01804601, 0x00000000, 0x00000000}, |
1289 |
+- {0x0000a60c, 0x01804601, 0x01804601, 0x00000000, 0x00000000}, |
1290 |
+- {0x0000a610, 0x01804601, 0x01804601, 0x00000000, 0x00000000}, |
1291 |
+- {0x0000a614, 0x01804601, 0x01804601, 0x01404000, 0x01404000}, |
1292 |
+- {0x0000a618, 0x01804601, 0x01804601, 0x01404501, 0x01404501}, |
1293 |
+- {0x0000a61c, 0x01804601, 0x01804601, 0x02008501, 0x02008501}, |
1294 |
+- {0x0000a620, 0x03408d02, 0x03408d02, 0x0280ca03, 0x0280ca03}, |
1295 |
+- {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04}, |
1296 |
+- {0x0000a628, 0x03410d04, 0x03410d04, 0x04014c04, 0x04014c04}, |
1297 |
+- {0x0000a62c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005}, |
1298 |
+- {0x0000a630, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005}, |
1299 |
+- {0x0000a634, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005}, |
1300 |
+- {0x0000a638, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005}, |
1301 |
+- {0x0000a63c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005}, |
1302 |
+- {0x0000b2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352}, |
1303 |
+- {0x0000b2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584}, |
1304 |
+- {0x0000b2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800}, |
1305 |
++ {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
1306 |
++ {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
1307 |
++ {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
1308 |
++ {0x0000a614, 0x02004000, 0x02004000, 0x01404000, 0x01404000}, |
1309 |
++ {0x0000a618, 0x02004801, 0x02004801, 0x01404501, 0x01404501}, |
1310 |
++ {0x0000a61c, 0x02808a02, 0x02808a02, 0x02008501, 0x02008501}, |
1311 |
++ {0x0000a620, 0x0380ce03, 0x0380ce03, 0x0280ca03, 0x0280ca03}, |
1312 |
++ {0x0000a624, 0x04411104, 0x04411104, 0x03010c04, 0x03010c04}, |
1313 |
++ {0x0000a628, 0x04411104, 0x04411104, 0x04014c04, 0x04014c04}, |
1314 |
++ {0x0000a62c, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, |
1315 |
++ {0x0000a630, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, |
1316 |
++ {0x0000a634, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, |
1317 |
++ {0x0000a638, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, |
1318 |
++ {0x0000a63c, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, |
1319 |
++ {0x0000b2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, |
1320 |
++ {0x0000b2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, |
1321 |
++ {0x0000b2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, |
1322 |
+ {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, |
1323 |
+- {0x0000c2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352}, |
1324 |
+- {0x0000c2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584}, |
1325 |
+- {0x0000c2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800}, |
1326 |
++ {0x0000c2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, |
1327 |
++ {0x0000c2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, |
1328 |
++ {0x0000c2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, |
1329 |
+ {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, |
1330 |
+ {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, |
1331 |
+- {0x00016048, 0x61200001, 0x61200001, 0x66480001, 0x66480001}, |
1332 |
++ {0x00016048, 0x66480001, 0x66480001, 0x66480001, 0x66480001}, |
1333 |
+ {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, |
1334 |
+ {0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, |
1335 |
+- {0x00016448, 0x61200001, 0x61200001, 0x66480001, 0x66480001}, |
1336 |
++ {0x00016448, 0x66480001, 0x66480001, 0x66480001, 0x66480001}, |
1337 |
+ {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, |
1338 |
+ {0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, |
1339 |
+- {0x00016848, 0x61200001, 0x61200001, 0x66480001, 0x66480001}, |
1340 |
++ {0x00016848, 0x66480001, 0x66480001, 0x66480001, 0x66480001}, |
1341 |
+ {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, |
1342 |
+ }; |
1343 |
+ |
1344 |
+diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c |
1345 |
+index a140165..46d9d4e 100644 |
1346 |
+--- a/drivers/net/wireless/b43/main.c |
1347 |
++++ b/drivers/net/wireless/b43/main.c |
1348 |
+@@ -5374,6 +5374,8 @@ static void b43_bcma_remove(struct bcma_device *core) |
1349 |
+ cancel_work_sync(&wldev->restart_work); |
1350 |
+ |
1351 |
+ B43_WARN_ON(!wl); |
1352 |
++ if (!wldev->fw.ucode.data) |
1353 |
++ return; /* NULL if firmware never loaded */ |
1354 |
+ if (wl->current_dev == wldev && wl->hw_registred) { |
1355 |
+ b43_leds_stop(wldev); |
1356 |
+ ieee80211_unregister_hw(wl->hw); |
1357 |
+@@ -5448,6 +5450,8 @@ static void b43_ssb_remove(struct ssb_device *sdev) |
1358 |
+ cancel_work_sync(&wldev->restart_work); |
1359 |
+ |
1360 |
+ B43_WARN_ON(!wl); |
1361 |
++ if (!wldev->fw.ucode.data) |
1362 |
++ return; /* NULL if firmware never loaded */ |
1363 |
+ if (wl->current_dev == wldev && wl->hw_registred) { |
1364 |
+ b43_leds_stop(wldev); |
1365 |
+ ieee80211_unregister_hw(wl->hw); |
1366 |
+diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c |
1367 |
+index 0df4591..6d1754a 100644 |
1368 |
+--- a/drivers/net/wireless/ipw2x00/ipw2200.c |
1369 |
++++ b/drivers/net/wireless/ipw2x00/ipw2200.c |
1370 |
+@@ -10479,7 +10479,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv, |
1371 |
+ } else |
1372 |
+ len = src->len; |
1373 |
+ |
1374 |
+- dst = alloc_skb(len + sizeof(*rt_hdr), GFP_ATOMIC); |
1375 |
++ dst = alloc_skb(len + sizeof(*rt_hdr) + sizeof(u16)*2, GFP_ATOMIC); |
1376 |
+ if (!dst) |
1377 |
+ continue; |
1378 |
+ |
1379 |
+diff --git a/drivers/net/wireless/iwlwifi/dvm/devices.c b/drivers/net/wireless/iwlwifi/dvm/devices.c |
1380 |
+index 349c205..da58620 100644 |
1381 |
+--- a/drivers/net/wireless/iwlwifi/dvm/devices.c |
1382 |
++++ b/drivers/net/wireless/iwlwifi/dvm/devices.c |
1383 |
+@@ -518,7 +518,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv, |
1384 |
+ * See iwlagn_mac_channel_switch. |
1385 |
+ */ |
1386 |
+ struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; |
1387 |
+- struct iwl6000_channel_switch_cmd cmd; |
1388 |
++ struct iwl6000_channel_switch_cmd *cmd; |
1389 |
+ u32 switch_time_in_usec, ucode_switch_time; |
1390 |
+ u16 ch; |
1391 |
+ u32 tsf_low; |
1392 |
+@@ -527,18 +527,25 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv, |
1393 |
+ struct ieee80211_vif *vif = ctx->vif; |
1394 |
+ struct iwl_host_cmd hcmd = { |
1395 |
+ .id = REPLY_CHANNEL_SWITCH, |
1396 |
+- .len = { sizeof(cmd), }, |
1397 |
++ .len = { sizeof(*cmd), }, |
1398 |
+ .flags = CMD_SYNC, |
1399 |
+- .data = { &cmd, }, |
1400 |
++ .dataflags[0] = IWL_HCMD_DFL_NOCOPY, |
1401 |
+ }; |
1402 |
++ int err; |
1403 |
+ |
1404 |
+- cmd.band = priv->band == IEEE80211_BAND_2GHZ; |
1405 |
++ cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); |
1406 |
++ if (!cmd) |
1407 |
++ return -ENOMEM; |
1408 |
++ |
1409 |
++ hcmd.data[0] = cmd; |
1410 |
++ |
1411 |
++ cmd->band = priv->band == IEEE80211_BAND_2GHZ; |
1412 |
+ ch = ch_switch->channel->hw_value; |
1413 |
+ IWL_DEBUG_11H(priv, "channel switch from %u to %u\n", |
1414 |
+ ctx->active.channel, ch); |
1415 |
+- cmd.channel = cpu_to_le16(ch); |
1416 |
+- cmd.rxon_flags = ctx->staging.flags; |
1417 |
+- cmd.rxon_filter_flags = ctx->staging.filter_flags; |
1418 |
++ cmd->channel = cpu_to_le16(ch); |
1419 |
++ cmd->rxon_flags = ctx->staging.flags; |
1420 |
++ cmd->rxon_filter_flags = ctx->staging.filter_flags; |
1421 |
+ switch_count = ch_switch->count; |
1422 |
+ tsf_low = ch_switch->timestamp & 0x0ffffffff; |
1423 |
+ /* |
1424 |
+@@ -554,23 +561,25 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv, |
1425 |
+ switch_count = 0; |
1426 |
+ } |
1427 |
+ if (switch_count <= 1) |
1428 |
+- cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time); |
1429 |
++ cmd->switch_time = cpu_to_le32(priv->ucode_beacon_time); |
1430 |
+ else { |
1431 |
+ switch_time_in_usec = |
1432 |
+ vif->bss_conf.beacon_int * switch_count * TIME_UNIT; |
1433 |
+ ucode_switch_time = iwl_usecs_to_beacons(priv, |
1434 |
+ switch_time_in_usec, |
1435 |
+ beacon_interval); |
1436 |
+- cmd.switch_time = iwl_add_beacon_time(priv, |
1437 |
+- priv->ucode_beacon_time, |
1438 |
+- ucode_switch_time, |
1439 |
+- beacon_interval); |
1440 |
++ cmd->switch_time = iwl_add_beacon_time(priv, |
1441 |
++ priv->ucode_beacon_time, |
1442 |
++ ucode_switch_time, |
1443 |
++ beacon_interval); |
1444 |
+ } |
1445 |
+ IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n", |
1446 |
+- cmd.switch_time); |
1447 |
+- cmd.expect_beacon = ch_switch->channel->flags & IEEE80211_CHAN_RADAR; |
1448 |
++ cmd->switch_time); |
1449 |
++ cmd->expect_beacon = ch_switch->channel->flags & IEEE80211_CHAN_RADAR; |
1450 |
+ |
1451 |
+- return iwl_dvm_send_cmd(priv, &hcmd); |
1452 |
++ err = iwl_dvm_send_cmd(priv, &hcmd); |
1453 |
++ kfree(cmd); |
1454 |
++ return err; |
1455 |
+ } |
1456 |
+ |
1457 |
+ struct iwl_lib_ops iwl6000_lib = { |
1458 |
+diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c |
1459 |
+index 891cd6c..4eed510 100644 |
1460 |
+--- a/drivers/rtc/rtc-imxdi.c |
1461 |
++++ b/drivers/rtc/rtc-imxdi.c |
1462 |
+@@ -392,6 +392,8 @@ static int dryice_rtc_probe(struct platform_device *pdev) |
1463 |
+ if (imxdi->ioaddr == NULL) |
1464 |
+ return -ENOMEM; |
1465 |
+ |
1466 |
++ spin_lock_init(&imxdi->irq_lock); |
1467 |
++ |
1468 |
+ imxdi->irq = platform_get_irq(pdev, 0); |
1469 |
+ if (imxdi->irq < 0) |
1470 |
+ return imxdi->irq; |
1471 |
+diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c |
1472 |
+index 574e992..467d493 100644 |
1473 |
+--- a/drivers/staging/android/binder.c |
1474 |
++++ b/drivers/staging/android/binder.c |
1475 |
+@@ -655,7 +655,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate, |
1476 |
+ page = &proc->pages[(page_addr - proc->buffer) / PAGE_SIZE]; |
1477 |
+ |
1478 |
+ BUG_ON(*page); |
1479 |
+- *page = alloc_page(GFP_KERNEL | __GFP_ZERO); |
1480 |
++ *page = alloc_page(GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO); |
1481 |
+ if (*page == NULL) { |
1482 |
+ pr_err("binder: %d: binder_alloc_buf failed " |
1483 |
+ "for page at %p\n", proc->pid, page_addr); |
1484 |
+@@ -2507,14 +2507,38 @@ static void binder_release_work(struct list_head *list) |
1485 |
+ struct binder_transaction *t; |
1486 |
+ |
1487 |
+ t = container_of(w, struct binder_transaction, work); |
1488 |
+- if (t->buffer->target_node && !(t->flags & TF_ONE_WAY)) |
1489 |
++ if (t->buffer->target_node && |
1490 |
++ !(t->flags & TF_ONE_WAY)) { |
1491 |
+ binder_send_failed_reply(t, BR_DEAD_REPLY); |
1492 |
++ } else { |
1493 |
++ binder_debug(BINDER_DEBUG_DEAD_TRANSACTION, |
1494 |
++ "binder: undelivered transaction %d\n", |
1495 |
++ t->debug_id); |
1496 |
++ t->buffer->transaction = NULL; |
1497 |
++ kfree(t); |
1498 |
++ binder_stats_deleted(BINDER_STAT_TRANSACTION); |
1499 |
++ } |
1500 |
+ } break; |
1501 |
+ case BINDER_WORK_TRANSACTION_COMPLETE: { |
1502 |
++ binder_debug(BINDER_DEBUG_DEAD_TRANSACTION, |
1503 |
++ "binder: undelivered TRANSACTION_COMPLETE\n"); |
1504 |
+ kfree(w); |
1505 |
+ binder_stats_deleted(BINDER_STAT_TRANSACTION_COMPLETE); |
1506 |
+ } break; |
1507 |
++ case BINDER_WORK_DEAD_BINDER_AND_CLEAR: |
1508 |
++ case BINDER_WORK_CLEAR_DEATH_NOTIFICATION: { |
1509 |
++ struct binder_ref_death *death; |
1510 |
++ |
1511 |
++ death = container_of(w, struct binder_ref_death, work); |
1512 |
++ binder_debug(BINDER_DEBUG_DEAD_TRANSACTION, |
1513 |
++ "binder: undelivered death notification, %p\n", |
1514 |
++ death->cookie); |
1515 |
++ kfree(death); |
1516 |
++ binder_stats_deleted(BINDER_STAT_DEATH); |
1517 |
++ } break; |
1518 |
+ default: |
1519 |
++ pr_err("binder: unexpected work type, %d, not freed\n", |
1520 |
++ w->type); |
1521 |
+ break; |
1522 |
+ } |
1523 |
+ } |
1524 |
+@@ -2984,6 +3008,7 @@ static void binder_deferred_release(struct binder_proc *proc) |
1525 |
+ nodes++; |
1526 |
+ rb_erase(&node->rb_node, &proc->nodes); |
1527 |
+ list_del_init(&node->work.entry); |
1528 |
++ binder_release_work(&node->async_todo); |
1529 |
+ if (hlist_empty(&node->refs)) { |
1530 |
+ kfree(node); |
1531 |
+ binder_stats_deleted(BINDER_STAT_NODE); |
1532 |
+@@ -3022,6 +3047,7 @@ static void binder_deferred_release(struct binder_proc *proc) |
1533 |
+ binder_delete_ref(ref); |
1534 |
+ } |
1535 |
+ binder_release_work(&proc->todo); |
1536 |
++ binder_release_work(&proc->delivered_death); |
1537 |
+ buffers = 0; |
1538 |
+ |
1539 |
+ while ((n = rb_first(&proc->allocated_buffers))) { |
1540 |
+diff --git a/drivers/staging/comedi/drivers/amplc_dio200.c b/drivers/staging/comedi/drivers/amplc_dio200.c |
1541 |
+index cc8931f..aee22fd 100644 |
1542 |
+--- a/drivers/staging/comedi/drivers/amplc_dio200.c |
1543 |
++++ b/drivers/staging/comedi/drivers/amplc_dio200.c |
1544 |
+@@ -1429,6 +1429,8 @@ static void dio200_detach(struct comedi_device *dev) |
1545 |
+ const struct dio200_layout_struct *layout; |
1546 |
+ unsigned n; |
1547 |
+ |
1548 |
++ if (!thisboard) |
1549 |
++ return; |
1550 |
+ if (dev->irq) |
1551 |
+ free_irq(dev->irq, dev); |
1552 |
+ if (dev->subdevices) { |
1553 |
+diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c b/drivers/staging/comedi/drivers/amplc_pc236.c |
1554 |
+index f502879..b46e663 100644 |
1555 |
+--- a/drivers/staging/comedi/drivers/amplc_pc236.c |
1556 |
++++ b/drivers/staging/comedi/drivers/amplc_pc236.c |
1557 |
+@@ -577,10 +577,12 @@ static int __devinit pc236_attach_pci(struct comedi_device *dev, |
1558 |
+ |
1559 |
+ static void pc236_detach(struct comedi_device *dev) |
1560 |
+ { |
1561 |
+- struct pc236_private *devpriv = dev->private; |
1562 |
++ const struct pc236_board *thisboard = comedi_board(dev); |
1563 |
+ struct pci_dev *pcidev = comedi_to_pci_dev(dev); |
1564 |
+ |
1565 |
+- if (devpriv) |
1566 |
++ if (!thisboard) |
1567 |
++ return; |
1568 |
++ if (dev->iobase) |
1569 |
+ pc236_intr_disable(dev); |
1570 |
+ if (dev->irq) |
1571 |
+ free_irq(dev->irq, dev); |
1572 |
+diff --git a/drivers/staging/comedi/drivers/amplc_pc263.c b/drivers/staging/comedi/drivers/amplc_pc263.c |
1573 |
+index 8191c4e..8c0fbd1 100644 |
1574 |
+--- a/drivers/staging/comedi/drivers/amplc_pc263.c |
1575 |
++++ b/drivers/staging/comedi/drivers/amplc_pc263.c |
1576 |
+@@ -310,8 +310,11 @@ static int __devinit pc263_attach_pci(struct comedi_device *dev, |
1577 |
+ |
1578 |
+ static void pc263_detach(struct comedi_device *dev) |
1579 |
+ { |
1580 |
++ const struct pc263_board *thisboard = comedi_board(dev); |
1581 |
+ struct pci_dev *pcidev = comedi_to_pci_dev(dev); |
1582 |
+ |
1583 |
++ if (!thisboard) |
1584 |
++ return; |
1585 |
+ if (pcidev) { |
1586 |
+ if (dev->iobase) |
1587 |
+ comedi_pci_disable(pcidev); |
1588 |
+diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c |
1589 |
+index 67a914a..d893e3b 100644 |
1590 |
+--- a/drivers/staging/comedi/drivers/das08.c |
1591 |
++++ b/drivers/staging/comedi/drivers/das08.c |
1592 |
+@@ -1028,6 +1028,8 @@ static void __maybe_unused das08_detach(struct comedi_device *dev) |
1593 |
+ const struct das08_board_struct *thisboard = comedi_board(dev); |
1594 |
+ struct das08_private_struct *devpriv = dev->private; |
1595 |
+ |
1596 |
++ if (!thisboard) |
1597 |
++ return; |
1598 |
+ das08_common_detach(dev); |
1599 |
+ if (IS_ENABLED(CONFIG_COMEDI_DAS08_ISA) && |
1600 |
+ (thisboard->bustype == isa || thisboard->bustype == pc104)) { |
1601 |
+diff --git a/drivers/staging/comedi/drivers/ni_daq_700.c b/drivers/staging/comedi/drivers/ni_daq_700.c |
1602 |
+index 83016b4..bcf6a65 100644 |
1603 |
+--- a/drivers/staging/comedi/drivers/ni_daq_700.c |
1604 |
++++ b/drivers/staging/comedi/drivers/ni_daq_700.c |
1605 |
+@@ -71,7 +71,7 @@ static int subdev_700_insn(struct comedi_device *dev, |
1606 |
+ } |
1607 |
+ |
1608 |
+ data[1] = s->state & 0xff; |
1609 |
+- data[1] |= inb(dev->iobase + DIO_R); |
1610 |
++ data[1] |= inb(dev->iobase + DIO_R) << 8; |
1611 |
+ |
1612 |
+ return insn->n; |
1613 |
+ } |
1614 |
+diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c |
1615 |
+index ab8b787..d3a1d65 100644 |
1616 |
+--- a/drivers/staging/comedi/drivers/ni_labpc.c |
1617 |
++++ b/drivers/staging/comedi/drivers/ni_labpc.c |
1618 |
+@@ -809,6 +809,8 @@ static int labpc_find_device(struct comedi_device *dev, int bus, int slot) |
1619 |
+ |
1620 |
+ void labpc_common_detach(struct comedi_device *dev) |
1621 |
+ { |
1622 |
++ if (!thisboard) |
1623 |
++ return; |
1624 |
+ if (dev->subdevices) |
1625 |
+ subdev_8255_cleanup(dev, dev->subdevices + 2); |
1626 |
+ #ifdef CONFIG_ISA_DMA_API |
1627 |
+diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c |
1628 |
+index 653b074..6edefde 100644 |
1629 |
+--- a/drivers/staging/zram/zram_drv.c |
1630 |
++++ b/drivers/staging/zram/zram_drv.c |
1631 |
+@@ -223,8 +223,13 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, |
1632 |
+ cmem = zs_map_object(zram->mem_pool, zram->table[index].handle, |
1633 |
+ ZS_MM_RO); |
1634 |
+ |
1635 |
+- ret = lzo1x_decompress_safe(cmem, zram->table[index].size, |
1636 |
++ if (zram->table[index].size == PAGE_SIZE) { |
1637 |
++ memcpy(uncmem, cmem, PAGE_SIZE); |
1638 |
++ ret = LZO_E_OK; |
1639 |
++ } else { |
1640 |
++ ret = lzo1x_decompress_safe(cmem, zram->table[index].size, |
1641 |
+ uncmem, &clen); |
1642 |
++ } |
1643 |
+ |
1644 |
+ if (is_partial_io(bvec)) { |
1645 |
+ memcpy(user_mem + bvec->bv_offset, uncmem + offset, |
1646 |
+@@ -342,8 +347,11 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index, |
1647 |
+ goto out; |
1648 |
+ } |
1649 |
+ |
1650 |
+- if (unlikely(clen > max_zpage_size)) |
1651 |
++ if (unlikely(clen > max_zpage_size)) { |
1652 |
+ zram_stat_inc(&zram->stats.bad_compress); |
1653 |
++ src = uncmem; |
1654 |
++ clen = PAGE_SIZE; |
1655 |
++ } |
1656 |
+ |
1657 |
+ handle = zs_malloc(zram->mem_pool, clen); |
1658 |
+ if (!handle) { |
1659 |
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c |
1660 |
+index bbff143..fe7faf0 100644 |
1661 |
+--- a/drivers/usb/core/hub.c |
1662 |
++++ b/drivers/usb/core/hub.c |
1663 |
+@@ -730,13 +730,16 @@ static void hub_tt_work(struct work_struct *work) |
1664 |
+ int limit = 100; |
1665 |
+ |
1666 |
+ spin_lock_irqsave (&hub->tt.lock, flags); |
1667 |
+- while (--limit && !list_empty (&hub->tt.clear_list)) { |
1668 |
++ while (!list_empty(&hub->tt.clear_list)) { |
1669 |
+ struct list_head *next; |
1670 |
+ struct usb_tt_clear *clear; |
1671 |
+ struct usb_device *hdev = hub->hdev; |
1672 |
+ const struct hc_driver *drv; |
1673 |
+ int status; |
1674 |
+ |
1675 |
++ if (!hub->quiescing && --limit < 0) |
1676 |
++ break; |
1677 |
++ |
1678 |
+ next = hub->tt.clear_list.next; |
1679 |
+ clear = list_entry (next, struct usb_tt_clear, clear_list); |
1680 |
+ list_del (&clear->clear_list); |
1681 |
+@@ -1201,7 +1204,7 @@ static void hub_quiesce(struct usb_hub *hub, enum hub_quiescing_type type) |
1682 |
+ if (hub->has_indicators) |
1683 |
+ cancel_delayed_work_sync(&hub->leds); |
1684 |
+ if (hub->tt.hub) |
1685 |
+- cancel_work_sync(&hub->tt.clear_work); |
1686 |
++ flush_work_sync(&hub->tt.clear_work); |
1687 |
+ } |
1688 |
+ |
1689 |
+ /* caller has locked the hub device */ |
1690 |
+diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c |
1691 |
+index 966d148..39f9e4a 100644 |
1692 |
+--- a/drivers/usb/host/pci-quirks.c |
1693 |
++++ b/drivers/usb/host/pci-quirks.c |
1694 |
+@@ -545,7 +545,14 @@ static const struct dmi_system_id __devinitconst ehci_dmi_nohandoff_table[] = { |
1695 |
+ /* Pegatron Lucid (Ordissimo AIRIS) */ |
1696 |
+ .matches = { |
1697 |
+ DMI_MATCH(DMI_BOARD_NAME, "M11JB"), |
1698 |
+- DMI_MATCH(DMI_BIOS_VERSION, "Lucid-GE-133"), |
1699 |
++ DMI_MATCH(DMI_BIOS_VERSION, "Lucid-"), |
1700 |
++ }, |
1701 |
++ }, |
1702 |
++ { |
1703 |
++ /* Pegatron Lucid (Ordissimo) */ |
1704 |
++ .matches = { |
1705 |
++ DMI_MATCH(DMI_BOARD_NAME, "Ordissimo"), |
1706 |
++ DMI_MATCH(DMI_BIOS_VERSION, "Lucid-"), |
1707 |
+ }, |
1708 |
+ }, |
1709 |
+ { } |
1710 |
+diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c |
1711 |
+index a6e18b9..4f1e265 100644 |
1712 |
+--- a/drivers/usb/host/xhci-ring.c |
1713 |
++++ b/drivers/usb/host/xhci-ring.c |
1714 |
+@@ -1228,6 +1228,17 @@ static void xhci_cmd_to_noop(struct xhci_hcd *xhci, struct xhci_cd *cur_cd) |
1715 |
+ cur_seg = find_trb_seg(xhci->cmd_ring->first_seg, |
1716 |
+ xhci->cmd_ring->dequeue, &cycle_state); |
1717 |
+ |
1718 |
++ if (!cur_seg) { |
1719 |
++ xhci_warn(xhci, "Command ring mismatch, dequeue = %p %llx (dma)\n", |
1720 |
++ xhci->cmd_ring->dequeue, |
1721 |
++ (unsigned long long) |
1722 |
++ xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg, |
1723 |
++ xhci->cmd_ring->dequeue)); |
1724 |
++ xhci_debug_ring(xhci, xhci->cmd_ring); |
1725 |
++ xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring); |
1726 |
++ return; |
1727 |
++ } |
1728 |
++ |
1729 |
+ /* find the command trb matched by cd from command ring */ |
1730 |
+ for (cmd_trb = xhci->cmd_ring->dequeue; |
1731 |
+ cmd_trb != xhci->cmd_ring->enqueue; |
1732 |
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c |
1733 |
+index 0644f65..a6e910b 100644 |
1734 |
+--- a/drivers/usb/host/xhci.c |
1735 |
++++ b/drivers/usb/host/xhci.c |
1736 |
+@@ -4020,7 +4020,7 @@ int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev) |
1737 |
+ static unsigned long long xhci_service_interval_to_ns( |
1738 |
+ struct usb_endpoint_descriptor *desc) |
1739 |
+ { |
1740 |
+- return (1 << (desc->bInterval - 1)) * 125 * 1000; |
1741 |
++ return (1ULL << (desc->bInterval - 1)) * 125 * 1000; |
1742 |
+ } |
1743 |
+ |
1744 |
+ static u16 xhci_get_timeout_no_hub_lpm(struct usb_device *udev, |
1745 |
+@@ -4141,7 +4141,7 @@ static u16 xhci_calculate_intel_u2_timeout(struct usb_device *udev, |
1746 |
+ (xhci_service_interval_to_ns(desc) > timeout_ns)) |
1747 |
+ timeout_ns = xhci_service_interval_to_ns(desc); |
1748 |
+ |
1749 |
+- u2_del_ns = udev->bos->ss_cap->bU2DevExitLat * 1000; |
1750 |
++ u2_del_ns = le16_to_cpu(udev->bos->ss_cap->bU2DevExitLat) * 1000ULL; |
1751 |
+ if (u2_del_ns > timeout_ns) |
1752 |
+ timeout_ns = u2_del_ns; |
1753 |
+ |
1754 |
+diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c |
1755 |
+index cabd1b1..8391d30 100644 |
1756 |
+--- a/drivers/usb/serial/ch341.c |
1757 |
++++ b/drivers/usb/serial/ch341.c |
1758 |
+@@ -241,13 +241,11 @@ out: kfree(buffer); |
1759 |
+ return r; |
1760 |
+ } |
1761 |
+ |
1762 |
+-/* allocate private data */ |
1763 |
+-static int ch341_attach(struct usb_serial *serial) |
1764 |
++static int ch341_port_probe(struct usb_serial_port *port) |
1765 |
+ { |
1766 |
+ struct ch341_private *priv; |
1767 |
+ int r; |
1768 |
+ |
1769 |
+- /* private data */ |
1770 |
+ priv = kzalloc(sizeof(struct ch341_private), GFP_KERNEL); |
1771 |
+ if (!priv) |
1772 |
+ return -ENOMEM; |
1773 |
+@@ -257,17 +255,27 @@ static int ch341_attach(struct usb_serial *serial) |
1774 |
+ priv->baud_rate = DEFAULT_BAUD_RATE; |
1775 |
+ priv->line_control = CH341_BIT_RTS | CH341_BIT_DTR; |
1776 |
+ |
1777 |
+- r = ch341_configure(serial->dev, priv); |
1778 |
++ r = ch341_configure(port->serial->dev, priv); |
1779 |
+ if (r < 0) |
1780 |
+ goto error; |
1781 |
+ |
1782 |
+- usb_set_serial_port_data(serial->port[0], priv); |
1783 |
++ usb_set_serial_port_data(port, priv); |
1784 |
+ return 0; |
1785 |
+ |
1786 |
+ error: kfree(priv); |
1787 |
+ return r; |
1788 |
+ } |
1789 |
+ |
1790 |
++static int ch341_port_remove(struct usb_serial_port *port) |
1791 |
++{ |
1792 |
++ struct ch341_private *priv; |
1793 |
++ |
1794 |
++ priv = usb_get_serial_port_data(port); |
1795 |
++ kfree(priv); |
1796 |
++ |
1797 |
++ return 0; |
1798 |
++} |
1799 |
++ |
1800 |
+ static int ch341_carrier_raised(struct usb_serial_port *port) |
1801 |
+ { |
1802 |
+ struct ch341_private *priv = usb_get_serial_port_data(port); |
1803 |
+@@ -303,7 +311,7 @@ static void ch341_close(struct usb_serial_port *port) |
1804 |
+ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port) |
1805 |
+ { |
1806 |
+ struct usb_serial *serial = port->serial; |
1807 |
+- struct ch341_private *priv = usb_get_serial_port_data(serial->port[0]); |
1808 |
++ struct ch341_private *priv = usb_get_serial_port_data(port); |
1809 |
+ int r; |
1810 |
+ |
1811 |
+ priv->baud_rate = DEFAULT_BAUD_RATE; |
1812 |
+@@ -606,7 +614,8 @@ static struct usb_serial_driver ch341_device = { |
1813 |
+ .tiocmget = ch341_tiocmget, |
1814 |
+ .tiocmset = ch341_tiocmset, |
1815 |
+ .read_int_callback = ch341_read_int_callback, |
1816 |
+- .attach = ch341_attach, |
1817 |
++ .port_probe = ch341_port_probe, |
1818 |
++ .port_remove = ch341_port_remove, |
1819 |
+ .reset_resume = ch341_reset_resume, |
1820 |
+ }; |
1821 |
+ |
1822 |
+diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c |
1823 |
+index b5cd838..06e8bf4 100644 |
1824 |
+--- a/drivers/usb/serial/digi_acceleport.c |
1825 |
++++ b/drivers/usb/serial/digi_acceleport.c |
1826 |
+@@ -244,6 +244,8 @@ static int digi_startup_device(struct usb_serial *serial); |
1827 |
+ static int digi_startup(struct usb_serial *serial); |
1828 |
+ static void digi_disconnect(struct usb_serial *serial); |
1829 |
+ static void digi_release(struct usb_serial *serial); |
1830 |
++static int digi_port_probe(struct usb_serial_port *port); |
1831 |
++static int digi_port_remove(struct usb_serial_port *port); |
1832 |
+ static void digi_read_bulk_callback(struct urb *urb); |
1833 |
+ static int digi_read_inb_callback(struct urb *urb); |
1834 |
+ static int digi_read_oob_callback(struct urb *urb); |
1835 |
+@@ -298,6 +300,8 @@ static struct usb_serial_driver digi_acceleport_2_device = { |
1836 |
+ .attach = digi_startup, |
1837 |
+ .disconnect = digi_disconnect, |
1838 |
+ .release = digi_release, |
1839 |
++ .port_probe = digi_port_probe, |
1840 |
++ .port_remove = digi_port_remove, |
1841 |
+ }; |
1842 |
+ |
1843 |
+ static struct usb_serial_driver digi_acceleport_4_device = { |
1844 |
+@@ -324,6 +328,8 @@ static struct usb_serial_driver digi_acceleport_4_device = { |
1845 |
+ .attach = digi_startup, |
1846 |
+ .disconnect = digi_disconnect, |
1847 |
+ .release = digi_release, |
1848 |
++ .port_probe = digi_port_probe, |
1849 |
++ .port_remove = digi_port_remove, |
1850 |
+ }; |
1851 |
+ |
1852 |
+ static struct usb_serial_driver * const serial_drivers[] = { |
1853 |
+@@ -1237,59 +1243,50 @@ static int digi_startup_device(struct usb_serial *serial) |
1854 |
+ return ret; |
1855 |
+ } |
1856 |
+ |
1857 |
+- |
1858 |
+-static int digi_startup(struct usb_serial *serial) |
1859 |
++static int digi_port_init(struct usb_serial_port *port, unsigned port_num) |
1860 |
+ { |
1861 |
+- |
1862 |
+- int i; |
1863 |
+ struct digi_port *priv; |
1864 |
+- struct digi_serial *serial_priv; |
1865 |
+ |
1866 |
+- /* allocate the private data structures for all ports */ |
1867 |
+- /* number of regular ports + 1 for the out-of-band port */ |
1868 |
+- for (i = 0; i < serial->type->num_ports + 1; i++) { |
1869 |
+- /* allocate port private structure */ |
1870 |
+- priv = kmalloc(sizeof(struct digi_port), GFP_KERNEL); |
1871 |
+- if (priv == NULL) { |
1872 |
+- while (--i >= 0) |
1873 |
+- kfree(usb_get_serial_port_data(serial->port[i])); |
1874 |
+- return 1; /* error */ |
1875 |
+- } |
1876 |
++ priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
1877 |
++ if (!priv) |
1878 |
++ return -ENOMEM; |
1879 |
+ |
1880 |
+- /* initialize port private structure */ |
1881 |
+- spin_lock_init(&priv->dp_port_lock); |
1882 |
+- priv->dp_port_num = i; |
1883 |
+- priv->dp_out_buf_len = 0; |
1884 |
+- priv->dp_write_urb_in_use = 0; |
1885 |
+- priv->dp_modem_signals = 0; |
1886 |
+- init_waitqueue_head(&priv->dp_modem_change_wait); |
1887 |
+- priv->dp_transmit_idle = 0; |
1888 |
+- init_waitqueue_head(&priv->dp_transmit_idle_wait); |
1889 |
+- priv->dp_throttled = 0; |
1890 |
+- priv->dp_throttle_restart = 0; |
1891 |
+- init_waitqueue_head(&priv->dp_flush_wait); |
1892 |
+- init_waitqueue_head(&priv->dp_close_wait); |
1893 |
+- INIT_WORK(&priv->dp_wakeup_work, digi_wakeup_write_lock); |
1894 |
+- priv->dp_port = serial->port[i]; |
1895 |
+- /* initialize write wait queue for this port */ |
1896 |
+- init_waitqueue_head(&serial->port[i]->write_wait); |
1897 |
+- |
1898 |
+- usb_set_serial_port_data(serial->port[i], priv); |
1899 |
+- } |
1900 |
++ spin_lock_init(&priv->dp_port_lock); |
1901 |
++ priv->dp_port_num = port_num; |
1902 |
++ init_waitqueue_head(&priv->dp_modem_change_wait); |
1903 |
++ init_waitqueue_head(&priv->dp_transmit_idle_wait); |
1904 |
++ init_waitqueue_head(&priv->dp_flush_wait); |
1905 |
++ init_waitqueue_head(&priv->dp_close_wait); |
1906 |
++ INIT_WORK(&priv->dp_wakeup_work, digi_wakeup_write_lock); |
1907 |
++ priv->dp_port = port; |
1908 |
+ |
1909 |
+- /* allocate serial private structure */ |
1910 |
+- serial_priv = kmalloc(sizeof(struct digi_serial), GFP_KERNEL); |
1911 |
+- if (serial_priv == NULL) { |
1912 |
+- for (i = 0; i < serial->type->num_ports + 1; i++) |
1913 |
+- kfree(usb_get_serial_port_data(serial->port[i])); |
1914 |
+- return 1; /* error */ |
1915 |
+- } |
1916 |
++ init_waitqueue_head(&port->write_wait); |
1917 |
++ |
1918 |
++ usb_set_serial_port_data(port, priv); |
1919 |
++ |
1920 |
++ return 0; |
1921 |
++} |
1922 |
++ |
1923 |
++static int digi_startup(struct usb_serial *serial) |
1924 |
++{ |
1925 |
++ struct digi_serial *serial_priv; |
1926 |
++ int ret; |
1927 |
++ |
1928 |
++ serial_priv = kzalloc(sizeof(*serial_priv), GFP_KERNEL); |
1929 |
++ if (!serial_priv) |
1930 |
++ return -ENOMEM; |
1931 |
+ |
1932 |
+- /* initialize serial private structure */ |
1933 |
+ spin_lock_init(&serial_priv->ds_serial_lock); |
1934 |
+ serial_priv->ds_oob_port_num = serial->type->num_ports; |
1935 |
+ serial_priv->ds_oob_port = serial->port[serial_priv->ds_oob_port_num]; |
1936 |
+- serial_priv->ds_device_started = 0; |
1937 |
++ |
1938 |
++ ret = digi_port_init(serial_priv->ds_oob_port, |
1939 |
++ serial_priv->ds_oob_port_num); |
1940 |
++ if (ret) { |
1941 |
++ kfree(serial_priv); |
1942 |
++ return ret; |
1943 |
++ } |
1944 |
++ |
1945 |
+ usb_set_serial_data(serial, serial_priv); |
1946 |
+ |
1947 |
+ return 0; |
1948 |
+@@ -1310,15 +1307,35 @@ static void digi_disconnect(struct usb_serial *serial) |
1949 |
+ |
1950 |
+ static void digi_release(struct usb_serial *serial) |
1951 |
+ { |
1952 |
+- int i; |
1953 |
++ struct digi_serial *serial_priv; |
1954 |
++ struct digi_port *priv; |
1955 |
++ |
1956 |
++ serial_priv = usb_get_serial_data(serial); |
1957 |
++ |
1958 |
++ priv = usb_get_serial_port_data(serial_priv->ds_oob_port); |
1959 |
++ kfree(priv); |
1960 |
+ |
1961 |
+- /* free the private data structures for all ports */ |
1962 |
+- /* number of regular ports + 1 for the out-of-band port */ |
1963 |
+- for (i = 0; i < serial->type->num_ports + 1; i++) |
1964 |
+- kfree(usb_get_serial_port_data(serial->port[i])); |
1965 |
+- kfree(usb_get_serial_data(serial)); |
1966 |
++ kfree(serial_priv); |
1967 |
+ } |
1968 |
+ |
1969 |
++static int digi_port_probe(struct usb_serial_port *port) |
1970 |
++{ |
1971 |
++ unsigned port_num; |
1972 |
++ |
1973 |
++ port_num = port->number - port->serial->minor; |
1974 |
++ |
1975 |
++ return digi_port_init(port, port_num); |
1976 |
++} |
1977 |
++ |
1978 |
++static int digi_port_remove(struct usb_serial_port *port) |
1979 |
++{ |
1980 |
++ struct digi_port *priv; |
1981 |
++ |
1982 |
++ priv = usb_get_serial_port_data(port); |
1983 |
++ kfree(priv); |
1984 |
++ |
1985 |
++ return 0; |
1986 |
++} |
1987 |
+ |
1988 |
+ static void digi_read_bulk_callback(struct urb *urb) |
1989 |
+ { |
1990 |
+diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c |
1991 |
+index 2cb30c5..8df011f 100644 |
1992 |
+--- a/drivers/usb/serial/ipw.c |
1993 |
++++ b/drivers/usb/serial/ipw.c |
1994 |
+@@ -209,8 +209,7 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port) |
1995 |
+ return 0; |
1996 |
+ } |
1997 |
+ |
1998 |
+-/* fake probe - only to allocate data structures */ |
1999 |
+-static int ipw_probe(struct usb_serial *serial, const struct usb_device_id *id) |
2000 |
++static int ipw_attach(struct usb_serial *serial) |
2001 |
+ { |
2002 |
+ struct usb_wwan_intf_private *data; |
2003 |
+ |
2004 |
+@@ -310,9 +309,9 @@ static struct usb_serial_driver ipw_device = { |
2005 |
+ .num_ports = 1, |
2006 |
+ .open = ipw_open, |
2007 |
+ .close = ipw_close, |
2008 |
+- .probe = ipw_probe, |
2009 |
+- .attach = usb_wwan_startup, |
2010 |
++ .attach = ipw_attach, |
2011 |
+ .release = ipw_release, |
2012 |
++ .port_probe = usb_wwan_port_probe, |
2013 |
+ .port_remove = usb_wwan_port_remove, |
2014 |
+ .dtr_rts = ipw_dtr_rts, |
2015 |
+ .write = usb_wwan_write, |
2016 |
+diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c |
2017 |
+index af0b70e..f6788d7 100644 |
2018 |
+--- a/drivers/usb/serial/keyspan.c |
2019 |
++++ b/drivers/usb/serial/keyspan.c |
2020 |
+@@ -1392,13 +1392,9 @@ static struct callbacks { |
2021 |
+ data in device_details */ |
2022 |
+ static void keyspan_setup_urbs(struct usb_serial *serial) |
2023 |
+ { |
2024 |
+- int i, j; |
2025 |
+ struct keyspan_serial_private *s_priv; |
2026 |
+ const struct keyspan_device_details *d_details; |
2027 |
+- struct usb_serial_port *port; |
2028 |
+- struct keyspan_port_private *p_priv; |
2029 |
+ struct callbacks *cback; |
2030 |
+- int endp; |
2031 |
+ |
2032 |
+ s_priv = usb_get_serial_data(serial); |
2033 |
+ d_details = s_priv->device_details; |
2034 |
+@@ -1422,45 +1418,6 @@ static void keyspan_setup_urbs(struct usb_serial *serial) |
2035 |
+ (serial, d_details->glocont_endpoint, USB_DIR_OUT, |
2036 |
+ serial, s_priv->glocont_buf, GLOCONT_BUFLEN, |
2037 |
+ cback->glocont_callback); |
2038 |
+- |
2039 |
+- /* Setup endpoints for each port specific thing */ |
2040 |
+- for (i = 0; i < d_details->num_ports; i++) { |
2041 |
+- port = serial->port[i]; |
2042 |
+- p_priv = usb_get_serial_port_data(port); |
2043 |
+- |
2044 |
+- /* Do indat endpoints first, once for each flip */ |
2045 |
+- endp = d_details->indat_endpoints[i]; |
2046 |
+- for (j = 0; j <= d_details->indat_endp_flip; ++j, ++endp) { |
2047 |
+- p_priv->in_urbs[j] = keyspan_setup_urb |
2048 |
+- (serial, endp, USB_DIR_IN, port, |
2049 |
+- p_priv->in_buffer[j], 64, |
2050 |
+- cback->indat_callback); |
2051 |
+- } |
2052 |
+- for (; j < 2; ++j) |
2053 |
+- p_priv->in_urbs[j] = NULL; |
2054 |
+- |
2055 |
+- /* outdat endpoints also have flip */ |
2056 |
+- endp = d_details->outdat_endpoints[i]; |
2057 |
+- for (j = 0; j <= d_details->outdat_endp_flip; ++j, ++endp) { |
2058 |
+- p_priv->out_urbs[j] = keyspan_setup_urb |
2059 |
+- (serial, endp, USB_DIR_OUT, port, |
2060 |
+- p_priv->out_buffer[j], 64, |
2061 |
+- cback->outdat_callback); |
2062 |
+- } |
2063 |
+- for (; j < 2; ++j) |
2064 |
+- p_priv->out_urbs[j] = NULL; |
2065 |
+- |
2066 |
+- /* inack endpoint */ |
2067 |
+- p_priv->inack_urb = keyspan_setup_urb |
2068 |
+- (serial, d_details->inack_endpoints[i], USB_DIR_IN, |
2069 |
+- port, p_priv->inack_buffer, 1, cback->inack_callback); |
2070 |
+- |
2071 |
+- /* outcont endpoint */ |
2072 |
+- p_priv->outcont_urb = keyspan_setup_urb |
2073 |
+- (serial, d_details->outcont_endpoints[i], USB_DIR_OUT, |
2074 |
+- port, p_priv->outcont_buffer, 64, |
2075 |
+- cback->outcont_callback); |
2076 |
+- } |
2077 |
+ } |
2078 |
+ |
2079 |
+ /* usa19 function doesn't require prescaler */ |
2080 |
+@@ -2422,9 +2379,7 @@ static void keyspan_send_setup(struct usb_serial_port *port, int reset_port) |
2081 |
+ static int keyspan_startup(struct usb_serial *serial) |
2082 |
+ { |
2083 |
+ int i, err; |
2084 |
+- struct usb_serial_port *port; |
2085 |
+ struct keyspan_serial_private *s_priv; |
2086 |
+- struct keyspan_port_private *p_priv; |
2087 |
+ const struct keyspan_device_details *d_details; |
2088 |
+ |
2089 |
+ for (i = 0; (d_details = keyspan_devices[i]) != NULL; ++i) |
2090 |
+@@ -2448,19 +2403,6 @@ static int keyspan_startup(struct usb_serial *serial) |
2091 |
+ s_priv->device_details = d_details; |
2092 |
+ usb_set_serial_data(serial, s_priv); |
2093 |
+ |
2094 |
+- /* Now setup per port private data */ |
2095 |
+- for (i = 0; i < serial->num_ports; i++) { |
2096 |
+- port = serial->port[i]; |
2097 |
+- p_priv = kzalloc(sizeof(struct keyspan_port_private), |
2098 |
+- GFP_KERNEL); |
2099 |
+- if (!p_priv) { |
2100 |
+- dbg("%s - kmalloc for keyspan_port_private (%d) failed!.", __func__, i); |
2101 |
+- return 1; |
2102 |
+- } |
2103 |
+- p_priv->device_details = d_details; |
2104 |
+- usb_set_serial_port_data(port, p_priv); |
2105 |
+- } |
2106 |
+- |
2107 |
+ keyspan_setup_urbs(serial); |
2108 |
+ |
2109 |
+ if (s_priv->instat_urb != NULL) { |
2110 |
+@@ -2481,61 +2423,112 @@ static int keyspan_startup(struct usb_serial *serial) |
2111 |
+ |
2112 |
+ static void keyspan_disconnect(struct usb_serial *serial) |
2113 |
+ { |
2114 |
+- int i, j; |
2115 |
+- struct usb_serial_port *port; |
2116 |
+- struct keyspan_serial_private *s_priv; |
2117 |
+- struct keyspan_port_private *p_priv; |
2118 |
++ struct keyspan_serial_private *s_priv; |
2119 |
+ |
2120 |
+ s_priv = usb_get_serial_data(serial); |
2121 |
+ |
2122 |
+- /* Stop reading/writing urbs */ |
2123 |
+ stop_urb(s_priv->instat_urb); |
2124 |
+ stop_urb(s_priv->glocont_urb); |
2125 |
+ stop_urb(s_priv->indat_urb); |
2126 |
+- for (i = 0; i < serial->num_ports; ++i) { |
2127 |
+- port = serial->port[i]; |
2128 |
+- p_priv = usb_get_serial_port_data(port); |
2129 |
+- stop_urb(p_priv->inack_urb); |
2130 |
+- stop_urb(p_priv->outcont_urb); |
2131 |
+- for (j = 0; j < 2; j++) { |
2132 |
+- stop_urb(p_priv->in_urbs[j]); |
2133 |
+- stop_urb(p_priv->out_urbs[j]); |
2134 |
+- } |
2135 |
+- } |
2136 |
++} |
2137 |
++ |
2138 |
++static void keyspan_release(struct usb_serial *serial) |
2139 |
++{ |
2140 |
++ struct keyspan_serial_private *s_priv; |
2141 |
++ |
2142 |
++ s_priv = usb_get_serial_data(serial); |
2143 |
+ |
2144 |
+- /* Now free them */ |
2145 |
+ usb_free_urb(s_priv->instat_urb); |
2146 |
+ usb_free_urb(s_priv->indat_urb); |
2147 |
+ usb_free_urb(s_priv->glocont_urb); |
2148 |
+- for (i = 0; i < serial->num_ports; ++i) { |
2149 |
+- port = serial->port[i]; |
2150 |
+- p_priv = usb_get_serial_port_data(port); |
2151 |
+- usb_free_urb(p_priv->inack_urb); |
2152 |
+- usb_free_urb(p_priv->outcont_urb); |
2153 |
+- for (j = 0; j < 2; j++) { |
2154 |
+- usb_free_urb(p_priv->in_urbs[j]); |
2155 |
+- usb_free_urb(p_priv->out_urbs[j]); |
2156 |
+- } |
2157 |
+- } |
2158 |
++ |
2159 |
++ kfree(s_priv); |
2160 |
+ } |
2161 |
+ |
2162 |
+-static void keyspan_release(struct usb_serial *serial) |
2163 |
++static int keyspan_port_probe(struct usb_serial_port *port) |
2164 |
+ { |
2165 |
+- int i; |
2166 |
+- struct usb_serial_port *port; |
2167 |
+- struct keyspan_serial_private *s_priv; |
2168 |
++ struct usb_serial *serial = port->serial; |
2169 |
++ struct keyspan_port_private *s_priv; |
2170 |
++ struct keyspan_port_private *p_priv; |
2171 |
++ const struct keyspan_device_details *d_details; |
2172 |
++ struct callbacks *cback; |
2173 |
++ int endp; |
2174 |
++ int port_num; |
2175 |
++ int i; |
2176 |
+ |
2177 |
+ s_priv = usb_get_serial_data(serial); |
2178 |
++ d_details = s_priv->device_details; |
2179 |
+ |
2180 |
+- /* dbg("Freeing serial->private."); */ |
2181 |
+- kfree(s_priv); |
2182 |
++ p_priv = kzalloc(sizeof(*p_priv), GFP_KERNEL); |
2183 |
++ if (!p_priv) |
2184 |
++ return -ENOMEM; |
2185 |
+ |
2186 |
+- /* dbg("Freeing port->private."); */ |
2187 |
+- /* Now free per port private data */ |
2188 |
+- for (i = 0; i < serial->num_ports; i++) { |
2189 |
+- port = serial->port[i]; |
2190 |
+- kfree(usb_get_serial_port_data(port)); |
2191 |
++ s_priv = usb_get_serial_data(port->serial); |
2192 |
++ p_priv->device_details = d_details; |
2193 |
++ |
2194 |
++ /* Setup values for the various callback routines */ |
2195 |
++ cback = &keyspan_callbacks[d_details->msg_format]; |
2196 |
++ |
2197 |
++ port_num = port->number - port->serial->minor; |
2198 |
++ |
2199 |
++ /* Do indat endpoints first, once for each flip */ |
2200 |
++ endp = d_details->indat_endpoints[port_num]; |
2201 |
++ for (i = 0; i <= d_details->indat_endp_flip; ++i, ++endp) { |
2202 |
++ p_priv->in_urbs[i] = keyspan_setup_urb(serial, endp, |
2203 |
++ USB_DIR_IN, port, |
2204 |
++ p_priv->in_buffer[i], 64, |
2205 |
++ cback->indat_callback); |
2206 |
++ } |
2207 |
++ /* outdat endpoints also have flip */ |
2208 |
++ endp = d_details->outdat_endpoints[port_num]; |
2209 |
++ for (i = 0; i <= d_details->outdat_endp_flip; ++i, ++endp) { |
2210 |
++ p_priv->out_urbs[i] = keyspan_setup_urb(serial, endp, |
2211 |
++ USB_DIR_OUT, port, |
2212 |
++ p_priv->out_buffer[i], 64, |
2213 |
++ cback->outdat_callback); |
2214 |
++ } |
2215 |
++ /* inack endpoint */ |
2216 |
++ p_priv->inack_urb = keyspan_setup_urb(serial, |
2217 |
++ d_details->inack_endpoints[port_num], |
2218 |
++ USB_DIR_IN, port, |
2219 |
++ p_priv->inack_buffer, 1, |
2220 |
++ cback->inack_callback); |
2221 |
++ /* outcont endpoint */ |
2222 |
++ p_priv->outcont_urb = keyspan_setup_urb(serial, |
2223 |
++ d_details->outcont_endpoints[port_num], |
2224 |
++ USB_DIR_OUT, port, |
2225 |
++ p_priv->outcont_buffer, 64, |
2226 |
++ cback->outcont_callback); |
2227 |
++ |
2228 |
++ usb_set_serial_port_data(port, p_priv); |
2229 |
++ |
2230 |
++ return 0; |
2231 |
++} |
2232 |
++ |
2233 |
++static int keyspan_port_remove(struct usb_serial_port *port) |
2234 |
++{ |
2235 |
++ struct keyspan_port_private *p_priv; |
2236 |
++ int i; |
2237 |
++ |
2238 |
++ p_priv = usb_get_serial_port_data(port); |
2239 |
++ |
2240 |
++ stop_urb(p_priv->inack_urb); |
2241 |
++ stop_urb(p_priv->outcont_urb); |
2242 |
++ for (i = 0; i < 2; i++) { |
2243 |
++ stop_urb(p_priv->in_urbs[i]); |
2244 |
++ stop_urb(p_priv->out_urbs[i]); |
2245 |
++ } |
2246 |
++ |
2247 |
++ usb_free_urb(p_priv->inack_urb); |
2248 |
++ usb_free_urb(p_priv->outcont_urb); |
2249 |
++ for (i = 0; i < 2; i++) { |
2250 |
++ usb_free_urb(p_priv->in_urbs[i]); |
2251 |
++ usb_free_urb(p_priv->out_urbs[i]); |
2252 |
+ } |
2253 |
++ |
2254 |
++ kfree(p_priv); |
2255 |
++ |
2256 |
++ return 0; |
2257 |
+ } |
2258 |
+ |
2259 |
+ MODULE_AUTHOR(DRIVER_AUTHOR); |
2260 |
+diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h |
2261 |
+index fe1c5d9..90a7b36 100644 |
2262 |
+--- a/drivers/usb/serial/keyspan.h |
2263 |
++++ b/drivers/usb/serial/keyspan.h |
2264 |
+@@ -42,6 +42,8 @@ static void keyspan_dtr_rts (struct usb_serial_port *port, int on); |
2265 |
+ static int keyspan_startup (struct usb_serial *serial); |
2266 |
+ static void keyspan_disconnect (struct usb_serial *serial); |
2267 |
+ static void keyspan_release (struct usb_serial *serial); |
2268 |
++static int keyspan_port_probe(struct usb_serial_port *port); |
2269 |
++static int keyspan_port_remove(struct usb_serial_port *port); |
2270 |
+ static int keyspan_write_room (struct tty_struct *tty); |
2271 |
+ |
2272 |
+ static int keyspan_write (struct tty_struct *tty, |
2273 |
+@@ -562,6 +564,8 @@ static struct usb_serial_driver keyspan_1port_device = { |
2274 |
+ .attach = keyspan_startup, |
2275 |
+ .disconnect = keyspan_disconnect, |
2276 |
+ .release = keyspan_release, |
2277 |
++ .port_probe = keyspan_port_probe, |
2278 |
++ .port_remove = keyspan_port_remove, |
2279 |
+ }; |
2280 |
+ |
2281 |
+ static struct usb_serial_driver keyspan_2port_device = { |
2282 |
+@@ -584,6 +588,8 @@ static struct usb_serial_driver keyspan_2port_device = { |
2283 |
+ .attach = keyspan_startup, |
2284 |
+ .disconnect = keyspan_disconnect, |
2285 |
+ .release = keyspan_release, |
2286 |
++ .port_probe = keyspan_port_probe, |
2287 |
++ .port_remove = keyspan_port_remove, |
2288 |
+ }; |
2289 |
+ |
2290 |
+ static struct usb_serial_driver keyspan_4port_device = { |
2291 |
+@@ -606,6 +612,8 @@ static struct usb_serial_driver keyspan_4port_device = { |
2292 |
+ .attach = keyspan_startup, |
2293 |
+ .disconnect = keyspan_disconnect, |
2294 |
+ .release = keyspan_release, |
2295 |
++ .port_probe = keyspan_port_probe, |
2296 |
++ .port_remove = keyspan_port_remove, |
2297 |
+ }; |
2298 |
+ |
2299 |
+ static struct usb_serial_driver * const serial_drivers[] = { |
2300 |
+diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c |
2301 |
+index a71fa0a..c088250 100644 |
2302 |
+--- a/drivers/usb/serial/mct_u232.c |
2303 |
++++ b/drivers/usb/serial/mct_u232.c |
2304 |
+@@ -51,7 +51,8 @@ static bool debug; |
2305 |
+ * Function prototypes |
2306 |
+ */ |
2307 |
+ static int mct_u232_startup(struct usb_serial *serial); |
2308 |
+-static void mct_u232_release(struct usb_serial *serial); |
2309 |
++static int mct_u232_port_probe(struct usb_serial_port *port); |
2310 |
++static int mct_u232_port_remove(struct usb_serial_port *remove); |
2311 |
+ static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port); |
2312 |
+ static void mct_u232_close(struct usb_serial_port *port); |
2313 |
+ static void mct_u232_dtr_rts(struct usb_serial_port *port, int on); |
2314 |
+@@ -101,7 +102,8 @@ static struct usb_serial_driver mct_u232_device = { |
2315 |
+ .tiocmget = mct_u232_tiocmget, |
2316 |
+ .tiocmset = mct_u232_tiocmset, |
2317 |
+ .attach = mct_u232_startup, |
2318 |
+- .release = mct_u232_release, |
2319 |
++ .port_probe = mct_u232_port_probe, |
2320 |
++ .port_remove = mct_u232_port_remove, |
2321 |
+ .ioctl = mct_u232_ioctl, |
2322 |
+ .get_icount = mct_u232_get_icount, |
2323 |
+ }; |
2324 |
+@@ -392,18 +394,8 @@ static void mct_u232_msr_to_state(unsigned int *control_state, |
2325 |
+ |
2326 |
+ static int mct_u232_startup(struct usb_serial *serial) |
2327 |
+ { |
2328 |
+- struct mct_u232_private *priv; |
2329 |
+ struct usb_serial_port *port, *rport; |
2330 |
+ |
2331 |
+- priv = kzalloc(sizeof(struct mct_u232_private), GFP_KERNEL); |
2332 |
+- if (!priv) |
2333 |
+- return -ENOMEM; |
2334 |
+- spin_lock_init(&priv->lock); |
2335 |
+- init_waitqueue_head(&priv->msr_wait); |
2336 |
+- usb_set_serial_port_data(serial->port[0], priv); |
2337 |
+- |
2338 |
+- init_waitqueue_head(&serial->port[0]->write_wait); |
2339 |
+- |
2340 |
+ /* Puh, that's dirty */ |
2341 |
+ port = serial->port[0]; |
2342 |
+ rport = serial->port[1]; |
2343 |
+@@ -416,18 +408,31 @@ static int mct_u232_startup(struct usb_serial *serial) |
2344 |
+ return 0; |
2345 |
+ } /* mct_u232_startup */ |
2346 |
+ |
2347 |
++static int mct_u232_port_probe(struct usb_serial_port *port) |
2348 |
++{ |
2349 |
++ struct mct_u232_private *priv; |
2350 |
++ |
2351 |
++ priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
2352 |
++ if (!priv) |
2353 |
++ return -ENOMEM; |
2354 |
++ |
2355 |
++ spin_lock_init(&priv->lock); |
2356 |
++ init_waitqueue_head(&priv->msr_wait); |
2357 |
++ |
2358 |
++ usb_set_serial_port_data(port, priv); |
2359 |
+ |
2360 |
+-static void mct_u232_release(struct usb_serial *serial) |
2361 |
++ return 0; |
2362 |
++} |
2363 |
++ |
2364 |
++static int mct_u232_port_remove(struct usb_serial_port *port) |
2365 |
+ { |
2366 |
+ struct mct_u232_private *priv; |
2367 |
+- int i; |
2368 |
+ |
2369 |
+- for (i = 0; i < serial->num_ports; ++i) { |
2370 |
+- /* My special items, the standard routines free my urbs */ |
2371 |
+- priv = usb_get_serial_port_data(serial->port[i]); |
2372 |
+- kfree(priv); |
2373 |
+- } |
2374 |
+-} /* mct_u232_release */ |
2375 |
++ priv = usb_get_serial_port_data(port); |
2376 |
++ kfree(priv); |
2377 |
++ |
2378 |
++ return 0; |
2379 |
++} |
2380 |
+ |
2381 |
+ static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port) |
2382 |
+ { |
2383 |
+@@ -519,12 +524,14 @@ static void mct_u232_dtr_rts(struct usb_serial_port *port, int on) |
2384 |
+ |
2385 |
+ static void mct_u232_close(struct usb_serial_port *port) |
2386 |
+ { |
2387 |
+- if (port->serial->dev) { |
2388 |
+- /* shutdown our urbs */ |
2389 |
+- usb_kill_urb(port->write_urb); |
2390 |
+- usb_kill_urb(port->read_urb); |
2391 |
+- usb_kill_urb(port->interrupt_in_urb); |
2392 |
+- } |
2393 |
++ /* |
2394 |
++ * Must kill the read urb as it is actually an interrupt urb, which |
2395 |
++ * generic close thus fails to kill. |
2396 |
++ */ |
2397 |
++ usb_kill_urb(port->read_urb); |
2398 |
++ usb_kill_urb(port->interrupt_in_urb); |
2399 |
++ |
2400 |
++ usb_serial_generic_close(port); |
2401 |
+ } /* mct_u232_close */ |
2402 |
+ |
2403 |
+ |
2404 |
+diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c |
2405 |
+index d47eb06..d284fb8 100644 |
2406 |
+--- a/drivers/usb/serial/metro-usb.c |
2407 |
++++ b/drivers/usb/serial/metro-usb.c |
2408 |
+@@ -188,16 +188,13 @@ static void metrousb_cleanup(struct usb_serial_port *port) |
2409 |
+ { |
2410 |
+ dev_dbg(&port->dev, "%s\n", __func__); |
2411 |
+ |
2412 |
+- if (port->serial->dev) { |
2413 |
+- /* Shutdown any interrupt in urbs. */ |
2414 |
+- if (port->interrupt_in_urb) { |
2415 |
+- usb_unlink_urb(port->interrupt_in_urb); |
2416 |
+- usb_kill_urb(port->interrupt_in_urb); |
2417 |
+- } |
2418 |
+- |
2419 |
+- /* Send deactivate cmd to device */ |
2420 |
++ usb_unlink_urb(port->interrupt_in_urb); |
2421 |
++ usb_kill_urb(port->interrupt_in_urb); |
2422 |
++ |
2423 |
++ mutex_lock(&port->serial->disc_mutex); |
2424 |
++ if (!port->serial->disconnected) |
2425 |
+ metrousb_send_unidirectional_cmd(UNI_CMD_CLOSE, port); |
2426 |
+- } |
2427 |
++ mutex_unlock(&port->serial->disc_mutex); |
2428 |
+ } |
2429 |
+ |
2430 |
+ static int metrousb_open(struct tty_struct *tty, struct usb_serial_port *port) |
2431 |
+@@ -280,51 +277,27 @@ static int metrousb_set_modem_ctrl(struct usb_serial *serial, unsigned int contr |
2432 |
+ return retval; |
2433 |
+ } |
2434 |
+ |
2435 |
+-static void metrousb_shutdown(struct usb_serial *serial) |
2436 |
++static int metrousb_port_probe(struct usb_serial_port *port) |
2437 |
+ { |
2438 |
+- int i = 0; |
2439 |
++ struct metrousb_private *metro_priv; |
2440 |
+ |
2441 |
+- dev_dbg(&serial->dev->dev, "%s\n", __func__); |
2442 |
++ metro_priv = kzalloc(sizeof(*metro_priv), GFP_KERNEL); |
2443 |
++ if (!metro_priv) |
2444 |
++ return -ENOMEM; |
2445 |
+ |
2446 |
+- /* Stop reading and writing on all ports. */ |
2447 |
+- for (i = 0; i < serial->num_ports; ++i) { |
2448 |
+- /* Close any open urbs. */ |
2449 |
+- metrousb_cleanup(serial->port[i]); |
2450 |
++ spin_lock_init(&metro_priv->lock); |
2451 |
+ |
2452 |
+- /* Free memory. */ |
2453 |
+- kfree(usb_get_serial_port_data(serial->port[i])); |
2454 |
+- usb_set_serial_port_data(serial->port[i], NULL); |
2455 |
++ usb_set_serial_port_data(port, metro_priv); |
2456 |
+ |
2457 |
+- dev_dbg(&serial->dev->dev, "%s - freed port number=%d\n", |
2458 |
+- __func__, serial->port[i]->number); |
2459 |
+- } |
2460 |
++ return 0; |
2461 |
+ } |
2462 |
+ |
2463 |
+-static int metrousb_startup(struct usb_serial *serial) |
2464 |
++static int metrousb_port_remove(struct usb_serial_port *port) |
2465 |
+ { |
2466 |
+ struct metrousb_private *metro_priv; |
2467 |
+- struct usb_serial_port *port; |
2468 |
+- int i = 0; |
2469 |
+ |
2470 |
+- dev_dbg(&serial->dev->dev, "%s\n", __func__); |
2471 |
+- |
2472 |
+- /* Loop through the serial ports setting up the private structures. |
2473 |
+- * Currently we only use one port. */ |
2474 |
+- for (i = 0; i < serial->num_ports; ++i) { |
2475 |
+- port = serial->port[i]; |
2476 |
+- |
2477 |
+- /* Declare memory. */ |
2478 |
+- metro_priv = kzalloc(sizeof(struct metrousb_private), GFP_KERNEL); |
2479 |
+- if (!metro_priv) |
2480 |
+- return -ENOMEM; |
2481 |
+- |
2482 |
+- /* Initialize memory. */ |
2483 |
+- spin_lock_init(&metro_priv->lock); |
2484 |
+- usb_set_serial_port_data(port, metro_priv); |
2485 |
+- |
2486 |
+- dev_dbg(&serial->dev->dev, "%s - port number=%d\n ", |
2487 |
+- __func__, port->number); |
2488 |
+- } |
2489 |
++ metro_priv = usb_get_serial_port_data(port); |
2490 |
++ kfree(metro_priv); |
2491 |
+ |
2492 |
+ return 0; |
2493 |
+ } |
2494 |
+@@ -423,8 +396,8 @@ static struct usb_serial_driver metrousb_device = { |
2495 |
+ .close = metrousb_cleanup, |
2496 |
+ .read_int_callback = metrousb_read_int_callback, |
2497 |
+ .write_int_callback = metrousb_write_int_callback, |
2498 |
+- .attach = metrousb_startup, |
2499 |
+- .release = metrousb_shutdown, |
2500 |
++ .port_probe = metrousb_port_probe, |
2501 |
++ .port_remove = metrousb_port_remove, |
2502 |
+ .throttle = metrousb_throttle, |
2503 |
+ .unthrottle = metrousb_unthrottle, |
2504 |
+ .tiocmget = metrousb_tiocmget, |
2505 |
+diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c |
2506 |
+index a07dd3c..eb84767 100644 |
2507 |
+--- a/drivers/usb/serial/mos7720.c |
2508 |
++++ b/drivers/usb/serial/mos7720.c |
2509 |
+@@ -2023,9 +2023,7 @@ static int mos7720_ioctl(struct tty_struct *tty, |
2510 |
+ |
2511 |
+ static int mos7720_startup(struct usb_serial *serial) |
2512 |
+ { |
2513 |
+- struct moschip_port *mos7720_port; |
2514 |
+ struct usb_device *dev; |
2515 |
+- int i; |
2516 |
+ char data; |
2517 |
+ u16 product; |
2518 |
+ int ret_val; |
2519 |
+@@ -2063,29 +2061,6 @@ static int mos7720_startup(struct usb_serial *serial) |
2520 |
+ serial->port[1]->interrupt_in_buffer = NULL; |
2521 |
+ } |
2522 |
+ |
2523 |
+- |
2524 |
+- /* set up serial port private structures */ |
2525 |
+- for (i = 0; i < serial->num_ports; ++i) { |
2526 |
+- mos7720_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL); |
2527 |
+- if (mos7720_port == NULL) { |
2528 |
+- dev_err(&dev->dev, "%s - Out of memory\n", __func__); |
2529 |
+- return -ENOMEM; |
2530 |
+- } |
2531 |
+- |
2532 |
+- /* Initialize all port interrupt end point to port 0 int |
2533 |
+- * endpoint. Our device has only one interrupt endpoint |
2534 |
+- * common to all ports */ |
2535 |
+- serial->port[i]->interrupt_in_endpointAddress = |
2536 |
+- serial->port[0]->interrupt_in_endpointAddress; |
2537 |
+- |
2538 |
+- mos7720_port->port = serial->port[i]; |
2539 |
+- usb_set_serial_port_data(serial->port[i], mos7720_port); |
2540 |
+- |
2541 |
+- dbg("port number is %d", serial->port[i]->number); |
2542 |
+- dbg("serial number is %d", serial->minor); |
2543 |
+- } |
2544 |
+- |
2545 |
+- |
2546 |
+ /* setting configuration feature to one */ |
2547 |
+ usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), |
2548 |
+ (__u8)0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5*HZ); |
2549 |
+@@ -2113,8 +2088,6 @@ static int mos7720_startup(struct usb_serial *serial) |
2550 |
+ |
2551 |
+ static void mos7720_release(struct usb_serial *serial) |
2552 |
+ { |
2553 |
+- int i; |
2554 |
+- |
2555 |
+ #ifdef CONFIG_USB_SERIAL_MOS7715_PARPORT |
2556 |
+ /* close the parallel port */ |
2557 |
+ |
2558 |
+@@ -2153,9 +2126,36 @@ static void mos7720_release(struct usb_serial *serial) |
2559 |
+ kref_put(&mos_parport->ref_count, destroy_mos_parport); |
2560 |
+ } |
2561 |
+ #endif |
2562 |
+- /* free private structure allocated for serial port */ |
2563 |
+- for (i = 0; i < serial->num_ports; ++i) |
2564 |
+- kfree(usb_get_serial_port_data(serial->port[i])); |
2565 |
++} |
2566 |
++ |
2567 |
++static int mos7720_port_probe(struct usb_serial_port *port) |
2568 |
++{ |
2569 |
++ struct moschip_port *mos7720_port; |
2570 |
++ |
2571 |
++ mos7720_port = kzalloc(sizeof(*mos7720_port), GFP_KERNEL); |
2572 |
++ if (!mos7720_port) |
2573 |
++ return -ENOMEM; |
2574 |
++ |
2575 |
++ /* Initialize all port interrupt end point to port 0 int endpoint. |
2576 |
++ * Our device has only one interrupt endpoint common to all ports. |
2577 |
++ */ |
2578 |
++ port->interrupt_in_endpointAddress = |
2579 |
++ port->serial->port[0]->interrupt_in_endpointAddress; |
2580 |
++ mos7720_port->port = port; |
2581 |
++ |
2582 |
++ usb_set_serial_port_data(port, mos7720_port); |
2583 |
++ |
2584 |
++ return 0; |
2585 |
++} |
2586 |
++ |
2587 |
++static int mos7720_port_remove(struct usb_serial_port *port) |
2588 |
++{ |
2589 |
++ struct moschip_port *mos7720_port; |
2590 |
++ |
2591 |
++ mos7720_port = usb_get_serial_port_data(port); |
2592 |
++ kfree(mos7720_port); |
2593 |
++ |
2594 |
++ return 0; |
2595 |
+ } |
2596 |
+ |
2597 |
+ static struct usb_serial_driver moschip7720_2port_driver = { |
2598 |
+@@ -2173,6 +2173,8 @@ static struct usb_serial_driver moschip7720_2port_driver = { |
2599 |
+ .probe = mos77xx_probe, |
2600 |
+ .attach = mos7720_startup, |
2601 |
+ .release = mos7720_release, |
2602 |
++ .port_probe = mos7720_port_probe, |
2603 |
++ .port_remove = mos7720_port_remove, |
2604 |
+ .ioctl = mos7720_ioctl, |
2605 |
+ .tiocmget = mos7720_tiocmget, |
2606 |
+ .tiocmset = mos7720_tiocmset, |
2607 |
+diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c |
2608 |
+index 2f6da1e..52e5ca7 100644 |
2609 |
+--- a/drivers/usb/serial/mos7840.c |
2610 |
++++ b/drivers/usb/serial/mos7840.c |
2611 |
+@@ -218,12 +218,10 @@ struct moschip_port { |
2612 |
+ int port_num; /*Actual port number in the device(1,2,etc) */ |
2613 |
+ struct urb *write_urb; /* write URB for this port */ |
2614 |
+ struct urb *read_urb; /* read URB for this port */ |
2615 |
+- struct urb *int_urb; |
2616 |
+ __u8 shadowLCR; /* last LCR value received */ |
2617 |
+ __u8 shadowMCR; /* last MCR value received */ |
2618 |
+ char open; |
2619 |
+ char open_ports; |
2620 |
+- char zombie; |
2621 |
+ wait_queue_head_t wait_chase; /* for handling sleeping while waiting for chase to finish */ |
2622 |
+ wait_queue_head_t delta_msr_wait; /* for handling sleeping while waiting for msr change to happen */ |
2623 |
+ int delta_msr_cond; |
2624 |
+@@ -493,7 +491,6 @@ static void mos7840_control_callback(struct urb *urb) |
2625 |
+ unsigned char *data; |
2626 |
+ struct moschip_port *mos7840_port; |
2627 |
+ __u8 regval = 0x0; |
2628 |
+- int result = 0; |
2629 |
+ int status = urb->status; |
2630 |
+ |
2631 |
+ mos7840_port = urb->context; |
2632 |
+@@ -512,7 +509,7 @@ static void mos7840_control_callback(struct urb *urb) |
2633 |
+ default: |
2634 |
+ dbg("%s - nonzero urb status received: %d", __func__, |
2635 |
+ status); |
2636 |
+- goto exit; |
2637 |
++ return; |
2638 |
+ } |
2639 |
+ |
2640 |
+ dbg("%s urb buffer size is %d", __func__, urb->actual_length); |
2641 |
+@@ -525,17 +522,6 @@ static void mos7840_control_callback(struct urb *urb) |
2642 |
+ mos7840_handle_new_msr(mos7840_port, regval); |
2643 |
+ else if (mos7840_port->MsrLsr == 1) |
2644 |
+ mos7840_handle_new_lsr(mos7840_port, regval); |
2645 |
+- |
2646 |
+-exit: |
2647 |
+- spin_lock(&mos7840_port->pool_lock); |
2648 |
+- if (!mos7840_port->zombie) |
2649 |
+- result = usb_submit_urb(mos7840_port->int_urb, GFP_ATOMIC); |
2650 |
+- spin_unlock(&mos7840_port->pool_lock); |
2651 |
+- if (result) { |
2652 |
+- dev_err(&urb->dev->dev, |
2653 |
+- "%s - Error %d submitting interrupt urb\n", |
2654 |
+- __func__, result); |
2655 |
+- } |
2656 |
+ } |
2657 |
+ |
2658 |
+ static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg, |
2659 |
+@@ -704,14 +690,7 @@ static void mos7840_interrupt_callback(struct urb *urb) |
2660 |
+ wreg = MODEM_STATUS_REGISTER; |
2661 |
+ break; |
2662 |
+ } |
2663 |
+- spin_lock(&mos7840_port->pool_lock); |
2664 |
+- if (!mos7840_port->zombie) { |
2665 |
+- rv = mos7840_get_reg(mos7840_port, wval, wreg, &Data); |
2666 |
+- } else { |
2667 |
+- spin_unlock(&mos7840_port->pool_lock); |
2668 |
+- return; |
2669 |
+- } |
2670 |
+- spin_unlock(&mos7840_port->pool_lock); |
2671 |
++ rv = mos7840_get_reg(mos7840_port, wval, wreg, &Data); |
2672 |
+ } |
2673 |
+ } |
2674 |
+ } |
2675 |
+@@ -2684,7 +2663,6 @@ error: |
2676 |
+ kfree(mos7840_port->ctrl_buf); |
2677 |
+ usb_free_urb(mos7840_port->control_urb); |
2678 |
+ kfree(mos7840_port); |
2679 |
+- serial->port[i] = NULL; |
2680 |
+ } |
2681 |
+ return status; |
2682 |
+ } |
2683 |
+@@ -2714,9 +2692,6 @@ static void mos7840_disconnect(struct usb_serial *serial) |
2684 |
+ mos7840_port = mos7840_get_port_private(serial->port[i]); |
2685 |
+ dbg ("mos7840_port %d = %p", i, mos7840_port); |
2686 |
+ if (mos7840_port) { |
2687 |
+- spin_lock_irqsave(&mos7840_port->pool_lock, flags); |
2688 |
+- mos7840_port->zombie = 1; |
2689 |
+- spin_unlock_irqrestore(&mos7840_port->pool_lock, flags); |
2690 |
+ usb_kill_urb(mos7840_port->control_urb); |
2691 |
+ } |
2692 |
+ } |
2693 |
+@@ -2754,6 +2729,7 @@ static void mos7840_release(struct usb_serial *serial) |
2694 |
+ del_timer_sync(&mos7840_port->led_timer1); |
2695 |
+ del_timer_sync(&mos7840_port->led_timer2); |
2696 |
+ } |
2697 |
++ usb_free_urb(mos7840_port->control_urb); |
2698 |
+ kfree(mos7840_port->ctrl_buf); |
2699 |
+ kfree(mos7840_port->dr); |
2700 |
+ kfree(mos7840_port); |
2701 |
+diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c |
2702 |
+index 6f3d705..27c9d06 100644 |
2703 |
+--- a/drivers/usb/serial/omninet.c |
2704 |
++++ b/drivers/usb/serial/omninet.c |
2705 |
+@@ -46,8 +46,8 @@ static int omninet_write(struct tty_struct *tty, struct usb_serial_port *port, |
2706 |
+ const unsigned char *buf, int count); |
2707 |
+ static int omninet_write_room(struct tty_struct *tty); |
2708 |
+ static void omninet_disconnect(struct usb_serial *serial); |
2709 |
+-static void omninet_release(struct usb_serial *serial); |
2710 |
+-static int omninet_attach(struct usb_serial *serial); |
2711 |
++static int omninet_port_probe(struct usb_serial_port *port); |
2712 |
++static int omninet_port_remove(struct usb_serial_port *port); |
2713 |
+ |
2714 |
+ static const struct usb_device_id id_table[] = { |
2715 |
+ { USB_DEVICE(ZYXEL_VENDOR_ID, ZYXEL_OMNINET_ID) }, |
2716 |
+@@ -64,7 +64,8 @@ static struct usb_serial_driver zyxel_omninet_device = { |
2717 |
+ .description = "ZyXEL - omni.net lcd plus usb", |
2718 |
+ .id_table = id_table, |
2719 |
+ .num_ports = 1, |
2720 |
+- .attach = omninet_attach, |
2721 |
++ .port_probe = omninet_port_probe, |
2722 |
++ .port_remove = omninet_port_remove, |
2723 |
+ .open = omninet_open, |
2724 |
+ .close = omninet_close, |
2725 |
+ .write = omninet_write, |
2726 |
+@@ -72,7 +73,6 @@ static struct usb_serial_driver zyxel_omninet_device = { |
2727 |
+ .read_bulk_callback = omninet_read_bulk_callback, |
2728 |
+ .write_bulk_callback = omninet_write_bulk_callback, |
2729 |
+ .disconnect = omninet_disconnect, |
2730 |
+- .release = omninet_release, |
2731 |
+ }; |
2732 |
+ |
2733 |
+ static struct usb_serial_driver * const serial_drivers[] = { |
2734 |
+@@ -114,18 +114,26 @@ struct omninet_data { |
2735 |
+ __u8 od_outseq; /* Sequence number for bulk_out URBs */ |
2736 |
+ }; |
2737 |
+ |
2738 |
+-static int omninet_attach(struct usb_serial *serial) |
2739 |
++static int omninet_port_probe(struct usb_serial_port *port) |
2740 |
+ { |
2741 |
+ struct omninet_data *od; |
2742 |
+- struct usb_serial_port *port = serial->port[0]; |
2743 |
+ |
2744 |
+ od = kmalloc(sizeof(struct omninet_data), GFP_KERNEL); |
2745 |
+- if (!od) { |
2746 |
+- dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", |
2747 |
+- __func__, sizeof(struct omninet_data)); |
2748 |
++ if (!od) |
2749 |
+ return -ENOMEM; |
2750 |
+- } |
2751 |
++ |
2752 |
+ usb_set_serial_port_data(port, od); |
2753 |
++ |
2754 |
++ return 0; |
2755 |
++} |
2756 |
++ |
2757 |
++static int omninet_port_remove(struct usb_serial_port *port) |
2758 |
++{ |
2759 |
++ struct omninet_data *od; |
2760 |
++ |
2761 |
++ od = usb_get_serial_port_data(port); |
2762 |
++ kfree(od); |
2763 |
++ |
2764 |
+ return 0; |
2765 |
+ } |
2766 |
+ |
2767 |
+@@ -291,14 +299,6 @@ static void omninet_disconnect(struct usb_serial *serial) |
2768 |
+ usb_kill_urb(wport->write_urb); |
2769 |
+ } |
2770 |
+ |
2771 |
+- |
2772 |
+-static void omninet_release(struct usb_serial *serial) |
2773 |
+-{ |
2774 |
+- struct usb_serial_port *port = serial->port[0]; |
2775 |
+- |
2776 |
+- kfree(usb_get_serial_port_data(port)); |
2777 |
+-} |
2778 |
+- |
2779 |
+ module_usb_serial_driver(serial_drivers, id_table); |
2780 |
+ |
2781 |
+ MODULE_AUTHOR(DRIVER_AUTHOR); |
2782 |
+diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c |
2783 |
+index 02cb1b7..623358a 100644 |
2784 |
+--- a/drivers/usb/serial/opticon.c |
2785 |
++++ b/drivers/usb/serial/opticon.c |
2786 |
+@@ -158,7 +158,11 @@ static int send_control_msg(struct usb_serial_port *port, u8 requesttype, |
2787 |
+ { |
2788 |
+ struct usb_serial *serial = port->serial; |
2789 |
+ int retval; |
2790 |
+- u8 buffer[2]; |
2791 |
++ u8 *buffer; |
2792 |
++ |
2793 |
++ buffer = kzalloc(1, GFP_KERNEL); |
2794 |
++ if (!buffer) |
2795 |
++ return -ENOMEM; |
2796 |
+ |
2797 |
+ buffer[0] = val; |
2798 |
+ /* Send the message to the vendor control endpoint |
2799 |
+@@ -167,6 +171,7 @@ static int send_control_msg(struct usb_serial_port *port, u8 requesttype, |
2800 |
+ requesttype, |
2801 |
+ USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE, |
2802 |
+ 0, 0, buffer, 1, 0); |
2803 |
++ kfree(buffer); |
2804 |
+ |
2805 |
+ return retval; |
2806 |
+ } |
2807 |
+@@ -284,7 +289,7 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port, |
2808 |
+ if (!dr) { |
2809 |
+ dev_err(&port->dev, "out of memory\n"); |
2810 |
+ count = -ENOMEM; |
2811 |
+- goto error; |
2812 |
++ goto error_no_dr; |
2813 |
+ } |
2814 |
+ |
2815 |
+ dr->bRequestType = USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT; |
2816 |
+@@ -314,6 +319,8 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port, |
2817 |
+ |
2818 |
+ return count; |
2819 |
+ error: |
2820 |
++ kfree(dr); |
2821 |
++error_no_dr: |
2822 |
+ usb_free_urb(urb); |
2823 |
+ error_no_urb: |
2824 |
+ kfree(buffer); |
2825 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
2826 |
+index a0542ca..76a48e4 100644 |
2827 |
+--- a/drivers/usb/serial/option.c |
2828 |
++++ b/drivers/usb/serial/option.c |
2829 |
+@@ -47,6 +47,7 @@ |
2830 |
+ /* Function prototypes */ |
2831 |
+ static int option_probe(struct usb_serial *serial, |
2832 |
+ const struct usb_device_id *id); |
2833 |
++static int option_attach(struct usb_serial *serial); |
2834 |
+ static void option_release(struct usb_serial *serial); |
2835 |
+ static int option_send_setup(struct usb_serial_port *port); |
2836 |
+ static void option_instat_callback(struct urb *urb); |
2837 |
+@@ -1288,8 +1289,9 @@ static struct usb_serial_driver option_1port_device = { |
2838 |
+ .tiocmget = usb_wwan_tiocmget, |
2839 |
+ .tiocmset = usb_wwan_tiocmset, |
2840 |
+ .ioctl = usb_wwan_ioctl, |
2841 |
+- .attach = usb_wwan_startup, |
2842 |
++ .attach = option_attach, |
2843 |
+ .release = option_release, |
2844 |
++ .port_probe = usb_wwan_port_probe, |
2845 |
+ .port_remove = usb_wwan_port_remove, |
2846 |
+ .read_int_callback = option_instat_callback, |
2847 |
+ #ifdef CONFIG_PM |
2848 |
+@@ -1337,8 +1339,6 @@ static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason, |
2849 |
+ static int option_probe(struct usb_serial *serial, |
2850 |
+ const struct usb_device_id *id) |
2851 |
+ { |
2852 |
+- struct usb_wwan_intf_private *data; |
2853 |
+- struct option_private *priv; |
2854 |
+ struct usb_interface_descriptor *iface_desc = |
2855 |
+ &serial->interface->cur_altsetting->desc; |
2856 |
+ struct usb_device_descriptor *dev_desc = &serial->dev->descriptor; |
2857 |
+@@ -1376,6 +1376,19 @@ static int option_probe(struct usb_serial *serial, |
2858 |
+ iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) |
2859 |
+ return -ENODEV; |
2860 |
+ |
2861 |
++ /* Store device id so we can use it during attach. */ |
2862 |
++ usb_set_serial_data(serial, (void *)id); |
2863 |
++ |
2864 |
++ return 0; |
2865 |
++} |
2866 |
++ |
2867 |
++static int option_attach(struct usb_serial *serial) |
2868 |
++{ |
2869 |
++ struct usb_interface_descriptor *iface_desc; |
2870 |
++ const struct usb_device_id *id; |
2871 |
++ struct usb_wwan_intf_private *data; |
2872 |
++ struct option_private *priv; |
2873 |
++ |
2874 |
+ data = kzalloc(sizeof(struct usb_wwan_intf_private), GFP_KERNEL); |
2875 |
+ if (!data) |
2876 |
+ return -ENOMEM; |
2877 |
+@@ -1386,6 +1399,10 @@ static int option_probe(struct usb_serial *serial, |
2878 |
+ return -ENOMEM; |
2879 |
+ } |
2880 |
+ |
2881 |
++ /* Retrieve device id stored at probe. */ |
2882 |
++ id = usb_get_serial_data(serial); |
2883 |
++ iface_desc = &serial->interface->cur_altsetting->desc; |
2884 |
++ |
2885 |
+ priv->bInterfaceNumber = iface_desc->bInterfaceNumber; |
2886 |
+ data->private = priv; |
2887 |
+ |
2888 |
+diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c |
2889 |
+index bfd5077..93232ca 100644 |
2890 |
+--- a/drivers/usb/serial/qcserial.c |
2891 |
++++ b/drivers/usb/serial/qcserial.c |
2892 |
+@@ -140,7 +140,6 @@ MODULE_DEVICE_TABLE(usb, id_table); |
2893 |
+ |
2894 |
+ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) |
2895 |
+ { |
2896 |
+- struct usb_wwan_intf_private *data; |
2897 |
+ struct usb_host_interface *intf = serial->interface->cur_altsetting; |
2898 |
+ struct device *dev = &serial->dev->dev; |
2899 |
+ int retval = -ENODEV; |
2900 |
+@@ -156,13 +155,6 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) |
2901 |
+ ifnum = intf->desc.bInterfaceNumber; |
2902 |
+ dev_dbg(dev, "This Interface = %d\n", ifnum); |
2903 |
+ |
2904 |
+- data = kzalloc(sizeof(struct usb_wwan_intf_private), |
2905 |
+- GFP_KERNEL); |
2906 |
+- if (!data) |
2907 |
+- return -ENOMEM; |
2908 |
+- |
2909 |
+- spin_lock_init(&data->susp_lock); |
2910 |
+- |
2911 |
+ if (nintf == 1) { |
2912 |
+ /* QDL mode */ |
2913 |
+ /* Gobi 2000 has a single altsetting, older ones have two */ |
2914 |
+@@ -255,20 +247,28 @@ done: |
2915 |
+ } |
2916 |
+ } |
2917 |
+ |
2918 |
+- /* Set serial->private if not returning error */ |
2919 |
+- if (retval == 0) |
2920 |
+- usb_set_serial_data(serial, data); |
2921 |
+- else |
2922 |
+- kfree(data); |
2923 |
+- |
2924 |
+ return retval; |
2925 |
+ } |
2926 |
+ |
2927 |
++static int qc_attach(struct usb_serial *serial) |
2928 |
++{ |
2929 |
++ struct usb_wwan_intf_private *data; |
2930 |
++ |
2931 |
++ data = kzalloc(sizeof(*data), GFP_KERNEL); |
2932 |
++ if (!data) |
2933 |
++ return -ENOMEM; |
2934 |
++ |
2935 |
++ spin_lock_init(&data->susp_lock); |
2936 |
++ |
2937 |
++ usb_set_serial_data(serial, data); |
2938 |
++ |
2939 |
++ return 0; |
2940 |
++} |
2941 |
++ |
2942 |
+ static void qc_release(struct usb_serial *serial) |
2943 |
+ { |
2944 |
+ struct usb_wwan_intf_private *priv = usb_get_serial_data(serial); |
2945 |
+ |
2946 |
+- /* Free the private data allocated in qcprobe */ |
2947 |
+ usb_set_serial_data(serial, NULL); |
2948 |
+ kfree(priv); |
2949 |
+ } |
2950 |
+@@ -287,8 +287,9 @@ static struct usb_serial_driver qcdevice = { |
2951 |
+ .write = usb_wwan_write, |
2952 |
+ .write_room = usb_wwan_write_room, |
2953 |
+ .chars_in_buffer = usb_wwan_chars_in_buffer, |
2954 |
+- .attach = usb_wwan_startup, |
2955 |
++ .attach = qc_attach, |
2956 |
+ .release = qc_release, |
2957 |
++ .port_probe = usb_wwan_port_probe, |
2958 |
+ .port_remove = usb_wwan_port_remove, |
2959 |
+ #ifdef CONFIG_PM |
2960 |
+ .suspend = usb_wwan_suspend, |
2961 |
+diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c |
2962 |
+index 151670b..ea69301 100644 |
2963 |
+--- a/drivers/usb/serial/quatech2.c |
2964 |
++++ b/drivers/usb/serial/quatech2.c |
2965 |
+@@ -145,12 +145,12 @@ static void qt2_read_bulk_callback(struct urb *urb); |
2966 |
+ |
2967 |
+ static void qt2_release(struct usb_serial *serial) |
2968 |
+ { |
2969 |
+- int i; |
2970 |
++ struct qt2_serial_private *serial_priv; |
2971 |
+ |
2972 |
+- kfree(usb_get_serial_data(serial)); |
2973 |
++ serial_priv = usb_get_serial_data(serial); |
2974 |
+ |
2975 |
+- for (i = 0; i < serial->num_ports; i++) |
2976 |
+- kfree(usb_get_serial_port_data(serial->port[i])); |
2977 |
++ usb_free_urb(serial_priv->read_urb); |
2978 |
++ kfree(serial_priv); |
2979 |
+ } |
2980 |
+ |
2981 |
+ static inline int calc_baud_divisor(int baudrate) |
2982 |
+@@ -425,11 +425,16 @@ static void qt2_close(struct usb_serial_port *port) |
2983 |
+ port_priv->is_open = false; |
2984 |
+ |
2985 |
+ spin_lock_irqsave(&port_priv->urb_lock, flags); |
2986 |
+- if (port_priv->write_urb->status == -EINPROGRESS) |
2987 |
+- usb_kill_urb(port_priv->write_urb); |
2988 |
++ usb_kill_urb(port_priv->write_urb); |
2989 |
+ port_priv->urb_in_use = false; |
2990 |
+ spin_unlock_irqrestore(&port_priv->urb_lock, flags); |
2991 |
+ |
2992 |
++ mutex_lock(&port->serial->disc_mutex); |
2993 |
++ if (port->serial->disconnected) { |
2994 |
++ mutex_unlock(&port->serial->disc_mutex); |
2995 |
++ return; |
2996 |
++ } |
2997 |
++ |
2998 |
+ /* flush the port transmit buffer */ |
2999 |
+ i = usb_control_msg(serial->dev, |
3000 |
+ usb_rcvctrlpipe(serial->dev, 0), |
3001 |
+@@ -461,26 +466,14 @@ static void qt2_close(struct usb_serial_port *port) |
3002 |
+ dev_err(&port->dev, "%s - close port failed %i\n", |
3003 |
+ __func__, i); |
3004 |
+ |
3005 |
++ mutex_unlock(&port->serial->disc_mutex); |
3006 |
+ } |
3007 |
+ |
3008 |
+ static void qt2_disconnect(struct usb_serial *serial) |
3009 |
+ { |
3010 |
+ struct qt2_serial_private *serial_priv = usb_get_serial_data(serial); |
3011 |
+- struct qt2_port_private *port_priv; |
3012 |
+- int i; |
3013 |
+- |
3014 |
+- if (serial_priv->read_urb->status == -EINPROGRESS) |
3015 |
+- usb_kill_urb(serial_priv->read_urb); |
3016 |
+- |
3017 |
+- usb_free_urb(serial_priv->read_urb); |
3018 |
+ |
3019 |
+- for (i = 0; i < serial->num_ports; i++) { |
3020 |
+- port_priv = usb_get_serial_port_data(serial->port[i]); |
3021 |
+- |
3022 |
+- if (port_priv->write_urb->status == -EINPROGRESS) |
3023 |
+- usb_kill_urb(port_priv->write_urb); |
3024 |
+- usb_free_urb(port_priv->write_urb); |
3025 |
+- } |
3026 |
++ usb_kill_urb(serial_priv->read_urb); |
3027 |
+ } |
3028 |
+ |
3029 |
+ static int get_serial_info(struct usb_serial_port *port, |
3030 |
+@@ -775,11 +768,9 @@ static void qt2_read_bulk_callback(struct urb *urb) |
3031 |
+ |
3032 |
+ static int qt2_setup_urbs(struct usb_serial *serial) |
3033 |
+ { |
3034 |
+- struct usb_serial_port *port; |
3035 |
+ struct usb_serial_port *port0; |
3036 |
+ struct qt2_serial_private *serial_priv; |
3037 |
+- struct qt2_port_private *port_priv; |
3038 |
+- int pcount, status; |
3039 |
++ int status; |
3040 |
+ |
3041 |
+ port0 = serial->port[0]; |
3042 |
+ |
3043 |
+@@ -797,46 +788,21 @@ static int qt2_setup_urbs(struct usb_serial *serial) |
3044 |
+ sizeof(serial_priv->read_buffer), |
3045 |
+ qt2_read_bulk_callback, serial); |
3046 |
+ |
3047 |
+- /* setup write_urb for each port */ |
3048 |
+- for (pcount = 0; pcount < serial->num_ports; pcount++) { |
3049 |
+- |
3050 |
+- port = serial->port[pcount]; |
3051 |
+- port_priv = usb_get_serial_port_data(port); |
3052 |
+- |
3053 |
+- port_priv->write_urb = usb_alloc_urb(0, GFP_KERNEL); |
3054 |
+- if (!port_priv->write_urb) { |
3055 |
+- dev_err(&serial->dev->dev, |
3056 |
+- "failed to alloc write_urb for port %i\n", |
3057 |
+- pcount); |
3058 |
+- return -ENOMEM; |
3059 |
+- } |
3060 |
+- |
3061 |
+- usb_fill_bulk_urb(port_priv->write_urb, |
3062 |
+- serial->dev, |
3063 |
+- usb_sndbulkpipe(serial->dev, |
3064 |
+- port0-> |
3065 |
+- bulk_out_endpointAddress), |
3066 |
+- port_priv->write_buffer, |
3067 |
+- sizeof(port_priv->write_buffer), |
3068 |
+- qt2_write_bulk_callback, port); |
3069 |
+- } |
3070 |
+- |
3071 |
+ status = usb_submit_urb(serial_priv->read_urb, GFP_KERNEL); |
3072 |
+ if (status != 0) { |
3073 |
+ dev_err(&serial->dev->dev, |
3074 |
+ "%s - submit read urb failed %i\n", __func__, status); |
3075 |
++ usb_free_urb(serial_priv->read_urb); |
3076 |
+ return status; |
3077 |
+ } |
3078 |
+ |
3079 |
+ return 0; |
3080 |
+- |
3081 |
+ } |
3082 |
+ |
3083 |
+ static int qt2_attach(struct usb_serial *serial) |
3084 |
+ { |
3085 |
+ struct qt2_serial_private *serial_priv; |
3086 |
+- struct qt2_port_private *port_priv; |
3087 |
+- int status, pcount; |
3088 |
++ int status; |
3089 |
+ |
3090 |
+ /* power on unit */ |
3091 |
+ status = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), |
3092 |
+@@ -856,26 +822,6 @@ static int qt2_attach(struct usb_serial *serial) |
3093 |
+ |
3094 |
+ usb_set_serial_data(serial, serial_priv); |
3095 |
+ |
3096 |
+- for (pcount = 0; pcount < serial->num_ports; pcount++) { |
3097 |
+- port_priv = kzalloc(sizeof(*port_priv), GFP_KERNEL); |
3098 |
+- if (!port_priv) { |
3099 |
+- dev_err(&serial->dev->dev, |
3100 |
+- "%s- kmalloc(%Zd) failed.\n", __func__, |
3101 |
+- sizeof(*port_priv)); |
3102 |
+- pcount--; |
3103 |
+- status = -ENOMEM; |
3104 |
+- goto attach_failed; |
3105 |
+- } |
3106 |
+- |
3107 |
+- spin_lock_init(&port_priv->lock); |
3108 |
+- spin_lock_init(&port_priv->urb_lock); |
3109 |
+- init_waitqueue_head(&port_priv->delta_msr_wait); |
3110 |
+- |
3111 |
+- port_priv->port = serial->port[pcount]; |
3112 |
+- |
3113 |
+- usb_set_serial_port_data(serial->port[pcount], port_priv); |
3114 |
+- } |
3115 |
+- |
3116 |
+ status = qt2_setup_urbs(serial); |
3117 |
+ if (status != 0) |
3118 |
+ goto attach_failed; |
3119 |
+@@ -883,14 +829,53 @@ static int qt2_attach(struct usb_serial *serial) |
3120 |
+ return 0; |
3121 |
+ |
3122 |
+ attach_failed: |
3123 |
+- for (/* empty */; pcount >= 0; pcount--) { |
3124 |
+- port_priv = usb_get_serial_port_data(serial->port[pcount]); |
3125 |
+- kfree(port_priv); |
3126 |
+- } |
3127 |
+ kfree(serial_priv); |
3128 |
+ return status; |
3129 |
+ } |
3130 |
+ |
3131 |
++static int qt2_port_probe(struct usb_serial_port *port) |
3132 |
++{ |
3133 |
++ struct usb_serial *serial = port->serial; |
3134 |
++ struct qt2_port_private *port_priv; |
3135 |
++ u8 bEndpointAddress; |
3136 |
++ |
3137 |
++ port_priv = kzalloc(sizeof(*port_priv), GFP_KERNEL); |
3138 |
++ if (!port_priv) |
3139 |
++ return -ENOMEM; |
3140 |
++ |
3141 |
++ spin_lock_init(&port_priv->lock); |
3142 |
++ spin_lock_init(&port_priv->urb_lock); |
3143 |
++ init_waitqueue_head(&port_priv->delta_msr_wait); |
3144 |
++ port_priv->port = port; |
3145 |
++ |
3146 |
++ port_priv->write_urb = usb_alloc_urb(0, GFP_KERNEL); |
3147 |
++ if (!port_priv->write_urb) { |
3148 |
++ kfree(port_priv); |
3149 |
++ return -ENOMEM; |
3150 |
++ } |
3151 |
++ bEndpointAddress = serial->port[0]->bulk_out_endpointAddress; |
3152 |
++ usb_fill_bulk_urb(port_priv->write_urb, serial->dev, |
3153 |
++ usb_sndbulkpipe(serial->dev, bEndpointAddress), |
3154 |
++ port_priv->write_buffer, |
3155 |
++ sizeof(port_priv->write_buffer), |
3156 |
++ qt2_write_bulk_callback, port); |
3157 |
++ |
3158 |
++ usb_set_serial_port_data(port, port_priv); |
3159 |
++ |
3160 |
++ return 0; |
3161 |
++} |
3162 |
++ |
3163 |
++static int qt2_port_remove(struct usb_serial_port *port) |
3164 |
++{ |
3165 |
++ struct qt2_port_private *port_priv; |
3166 |
++ |
3167 |
++ port_priv = usb_get_serial_port_data(port); |
3168 |
++ usb_free_urb(port_priv->write_urb); |
3169 |
++ kfree(port_priv); |
3170 |
++ |
3171 |
++ return 0; |
3172 |
++} |
3173 |
++ |
3174 |
+ static int qt2_tiocmget(struct tty_struct *tty) |
3175 |
+ { |
3176 |
+ struct usb_serial_port *port = tty->driver_data; |
3177 |
+@@ -1129,6 +1114,8 @@ static struct usb_serial_driver qt2_device = { |
3178 |
+ .attach = qt2_attach, |
3179 |
+ .release = qt2_release, |
3180 |
+ .disconnect = qt2_disconnect, |
3181 |
++ .port_probe = qt2_port_probe, |
3182 |
++ .port_remove = qt2_port_remove, |
3183 |
+ .dtr_rts = qt2_dtr_rts, |
3184 |
+ .break_ctl = qt2_break_ctl, |
3185 |
+ .tiocmget = qt2_tiocmget, |
3186 |
+diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c |
3187 |
+index 0274710..cf6d149 100644 |
3188 |
+--- a/drivers/usb/serial/sierra.c |
3189 |
++++ b/drivers/usb/serial/sierra.c |
3190 |
+@@ -162,7 +162,6 @@ static int sierra_probe(struct usb_serial *serial, |
3191 |
+ { |
3192 |
+ int result = 0; |
3193 |
+ struct usb_device *udev; |
3194 |
+- struct sierra_intf_private *data; |
3195 |
+ u8 ifnum; |
3196 |
+ |
3197 |
+ udev = serial->dev; |
3198 |
+@@ -189,11 +188,6 @@ static int sierra_probe(struct usb_serial *serial, |
3199 |
+ return -ENODEV; |
3200 |
+ } |
3201 |
+ |
3202 |
+- data = serial->private = kzalloc(sizeof(struct sierra_intf_private), GFP_KERNEL); |
3203 |
+- if (!data) |
3204 |
+- return -ENOMEM; |
3205 |
+- spin_lock_init(&data->susp_lock); |
3206 |
+- |
3207 |
+ return result; |
3208 |
+ } |
3209 |
+ |
3210 |
+@@ -886,11 +880,15 @@ static void sierra_dtr_rts(struct usb_serial_port *port, int on) |
3211 |
+ |
3212 |
+ static int sierra_startup(struct usb_serial *serial) |
3213 |
+ { |
3214 |
+- struct usb_serial_port *port; |
3215 |
+- struct sierra_port_private *portdata; |
3216 |
+- struct sierra_iface_info *himemoryp = NULL; |
3217 |
+- int i; |
3218 |
+- u8 ifnum; |
3219 |
++ struct sierra_intf_private *intfdata; |
3220 |
++ |
3221 |
++ intfdata = kzalloc(sizeof(*intfdata), GFP_KERNEL); |
3222 |
++ if (!intfdata) |
3223 |
++ return -ENOMEM; |
3224 |
++ |
3225 |
++ spin_lock_init(&intfdata->susp_lock); |
3226 |
++ |
3227 |
++ usb_set_serial_data(serial, intfdata); |
3228 |
+ |
3229 |
+ /* Set Device mode to D0 */ |
3230 |
+ sierra_set_power_state(serial->dev, 0x0000); |
3231 |
+@@ -899,68 +897,71 @@ static int sierra_startup(struct usb_serial *serial) |
3232 |
+ if (nmea) |
3233 |
+ sierra_vsc_set_nmea(serial->dev, 1); |
3234 |
+ |
3235 |
+- /* Now setup per port private data */ |
3236 |
+- for (i = 0; i < serial->num_ports; i++) { |
3237 |
+- port = serial->port[i]; |
3238 |
+- portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); |
3239 |
+- if (!portdata) { |
3240 |
+- dev_dbg(&port->dev, "%s: kmalloc for " |
3241 |
+- "sierra_port_private (%d) failed!\n", |
3242 |
+- __func__, i); |
3243 |
+- return -ENOMEM; |
3244 |
+- } |
3245 |
+- spin_lock_init(&portdata->lock); |
3246 |
+- init_usb_anchor(&portdata->active); |
3247 |
+- init_usb_anchor(&portdata->delayed); |
3248 |
+- ifnum = i; |
3249 |
+- /* Assume low memory requirements */ |
3250 |
+- portdata->num_out_urbs = N_OUT_URB; |
3251 |
+- portdata->num_in_urbs = N_IN_URB; |
3252 |
+- |
3253 |
+- /* Determine actual memory requirements */ |
3254 |
+- if (serial->num_ports == 1) { |
3255 |
+- /* Get interface number for composite device */ |
3256 |
+- ifnum = sierra_calc_interface(serial); |
3257 |
+- himemoryp = |
3258 |
+- (struct sierra_iface_info *)&typeB_interface_list; |
3259 |
+- if (is_himemory(ifnum, himemoryp)) { |
3260 |
+- portdata->num_out_urbs = N_OUT_URB_HM; |
3261 |
+- portdata->num_in_urbs = N_IN_URB_HM; |
3262 |
+- } |
3263 |
+- } |
3264 |
+- else { |
3265 |
+- himemoryp = |
3266 |
+- (struct sierra_iface_info *)&typeA_interface_list; |
3267 |
+- if (is_himemory(i, himemoryp)) { |
3268 |
+- portdata->num_out_urbs = N_OUT_URB_HM; |
3269 |
+- portdata->num_in_urbs = N_IN_URB_HM; |
3270 |
+- } |
3271 |
+- } |
3272 |
+- dev_dbg(&serial->dev->dev, |
3273 |
+- "Memory usage (urbs) interface #%d, in=%d, out=%d\n", |
3274 |
+- ifnum,portdata->num_in_urbs, portdata->num_out_urbs ); |
3275 |
+- /* Set the port private data pointer */ |
3276 |
+- usb_set_serial_port_data(port, portdata); |
3277 |
+- } |
3278 |
+- |
3279 |
+ return 0; |
3280 |
+ } |
3281 |
+ |
3282 |
+ static void sierra_release(struct usb_serial *serial) |
3283 |
+ { |
3284 |
+- int i; |
3285 |
+- struct usb_serial_port *port; |
3286 |
++ struct sierra_intf_private *intfdata; |
3287 |
++ |
3288 |
++ intfdata = usb_get_serial_data(serial); |
3289 |
++ kfree(intfdata); |
3290 |
++} |
3291 |
++ |
3292 |
++static int sierra_port_probe(struct usb_serial_port *port) |
3293 |
++{ |
3294 |
++ struct usb_serial *serial = port->serial; |
3295 |
+ struct sierra_port_private *portdata; |
3296 |
++ const struct sierra_iface_info *himemoryp; |
3297 |
++ u8 ifnum; |
3298 |
+ |
3299 |
+- for (i = 0; i < serial->num_ports; ++i) { |
3300 |
+- port = serial->port[i]; |
3301 |
+- if (!port) |
3302 |
+- continue; |
3303 |
+- portdata = usb_get_serial_port_data(port); |
3304 |
+- if (!portdata) |
3305 |
+- continue; |
3306 |
+- kfree(portdata); |
3307 |
++ portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); |
3308 |
++ if (!portdata) |
3309 |
++ return -ENOMEM; |
3310 |
++ |
3311 |
++ spin_lock_init(&portdata->lock); |
3312 |
++ init_usb_anchor(&portdata->active); |
3313 |
++ init_usb_anchor(&portdata->delayed); |
3314 |
++ |
3315 |
++ /* Assume low memory requirements */ |
3316 |
++ portdata->num_out_urbs = N_OUT_URB; |
3317 |
++ portdata->num_in_urbs = N_IN_URB; |
3318 |
++ |
3319 |
++ /* Determine actual memory requirements */ |
3320 |
++ if (serial->num_ports == 1) { |
3321 |
++ /* Get interface number for composite device */ |
3322 |
++ ifnum = sierra_calc_interface(serial); |
3323 |
++ himemoryp = &typeB_interface_list; |
3324 |
++ } else { |
3325 |
++ /* This is really the usb-serial port number of the interface |
3326 |
++ * rather than the interface number. |
3327 |
++ */ |
3328 |
++ ifnum = port->number - serial->minor; |
3329 |
++ himemoryp = &typeA_interface_list; |
3330 |
+ } |
3331 |
++ |
3332 |
++ if (is_himemory(ifnum, himemoryp)) { |
3333 |
++ portdata->num_out_urbs = N_OUT_URB_HM; |
3334 |
++ portdata->num_in_urbs = N_IN_URB_HM; |
3335 |
++ } |
3336 |
++ |
3337 |
++ dev_dbg(&port->dev, |
3338 |
++ "Memory usage (urbs) interface #%d, in=%d, out=%d\n", |
3339 |
++ ifnum, portdata->num_in_urbs, portdata->num_out_urbs); |
3340 |
++ |
3341 |
++ usb_set_serial_port_data(port, portdata); |
3342 |
++ |
3343 |
++ return 0; |
3344 |
++} |
3345 |
++ |
3346 |
++static int sierra_port_remove(struct usb_serial_port *port) |
3347 |
++{ |
3348 |
++ struct sierra_port_private *portdata; |
3349 |
++ |
3350 |
++ portdata = usb_get_serial_port_data(port); |
3351 |
++ kfree(portdata); |
3352 |
++ |
3353 |
++ return 0; |
3354 |
+ } |
3355 |
+ |
3356 |
+ #ifdef CONFIG_PM |
3357 |
+@@ -1064,6 +1065,8 @@ static struct usb_serial_driver sierra_device = { |
3358 |
+ .tiocmset = sierra_tiocmset, |
3359 |
+ .attach = sierra_startup, |
3360 |
+ .release = sierra_release, |
3361 |
++ .port_probe = sierra_port_probe, |
3362 |
++ .port_remove = sierra_port_remove, |
3363 |
+ .suspend = sierra_suspend, |
3364 |
+ .resume = sierra_resume, |
3365 |
+ .read_int_callback = sierra_instat_callback, |
3366 |
+diff --git a/drivers/usb/serial/usb-wwan.h b/drivers/usb/serial/usb-wwan.h |
3367 |
+index 1f034d2..684739b 100644 |
3368 |
+--- a/drivers/usb/serial/usb-wwan.h |
3369 |
++++ b/drivers/usb/serial/usb-wwan.h |
3370 |
+@@ -8,7 +8,7 @@ |
3371 |
+ extern void usb_wwan_dtr_rts(struct usb_serial_port *port, int on); |
3372 |
+ extern int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port); |
3373 |
+ extern void usb_wwan_close(struct usb_serial_port *port); |
3374 |
+-extern int usb_wwan_startup(struct usb_serial *serial); |
3375 |
++extern int usb_wwan_port_probe(struct usb_serial_port *port); |
3376 |
+ extern int usb_wwan_port_remove(struct usb_serial_port *port); |
3377 |
+ extern int usb_wwan_write_room(struct tty_struct *tty); |
3378 |
+ extern void usb_wwan_set_termios(struct tty_struct *tty, |
3379 |
+diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c |
3380 |
+index 6855d5e..2f2d074 100644 |
3381 |
+--- a/drivers/usb/serial/usb_wwan.c |
3382 |
++++ b/drivers/usb/serial/usb_wwan.c |
3383 |
+@@ -447,10 +447,12 @@ void usb_wwan_close(struct usb_serial_port *port) |
3384 |
+ EXPORT_SYMBOL(usb_wwan_close); |
3385 |
+ |
3386 |
+ /* Helper functions used by usb_wwan_setup_urbs */ |
3387 |
+-static struct urb *usb_wwan_setup_urb(struct usb_serial *serial, int endpoint, |
3388 |
++static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, |
3389 |
++ int endpoint, |
3390 |
+ int dir, void *ctx, char *buf, int len, |
3391 |
+ void (*callback) (struct urb *)) |
3392 |
+ { |
3393 |
++ struct usb_serial *serial = port->serial; |
3394 |
+ struct urb *urb; |
3395 |
+ |
3396 |
+ if (endpoint == -1) |
3397 |
+@@ -470,100 +472,74 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial *serial, int endpoint, |
3398 |
+ return urb; |
3399 |
+ } |
3400 |
+ |
3401 |
+-/* Setup urbs */ |
3402 |
+-static void usb_wwan_setup_urbs(struct usb_serial *serial) |
3403 |
++int usb_wwan_port_probe(struct usb_serial_port *port) |
3404 |
+ { |
3405 |
+- int i, j; |
3406 |
+- struct usb_serial_port *port; |
3407 |
+ struct usb_wwan_port_private *portdata; |
3408 |
++ struct urb *urb; |
3409 |
++ u8 *buffer; |
3410 |
++ int err; |
3411 |
++ int i; |
3412 |
+ |
3413 |
+- for (i = 0; i < serial->num_ports; i++) { |
3414 |
+- port = serial->port[i]; |
3415 |
+- portdata = usb_get_serial_port_data(port); |
3416 |
+- |
3417 |
+- /* Do indat endpoints first */ |
3418 |
+- for (j = 0; j < N_IN_URB; ++j) { |
3419 |
+- portdata->in_urbs[j] = usb_wwan_setup_urb(serial, |
3420 |
+- port-> |
3421 |
+- bulk_in_endpointAddress, |
3422 |
+- USB_DIR_IN, |
3423 |
+- port, |
3424 |
+- portdata-> |
3425 |
+- in_buffer[j], |
3426 |
+- IN_BUFLEN, |
3427 |
+- usb_wwan_indat_callback); |
3428 |
+- } |
3429 |
+- |
3430 |
+- /* outdat endpoints */ |
3431 |
+- for (j = 0; j < N_OUT_URB; ++j) { |
3432 |
+- portdata->out_urbs[j] = usb_wwan_setup_urb(serial, |
3433 |
+- port-> |
3434 |
+- bulk_out_endpointAddress, |
3435 |
+- USB_DIR_OUT, |
3436 |
+- port, |
3437 |
+- portdata-> |
3438 |
+- out_buffer |
3439 |
+- [j], |
3440 |
+- OUT_BUFLEN, |
3441 |
+- usb_wwan_outdat_callback); |
3442 |
+- } |
3443 |
+- } |
3444 |
+-} |
3445 |
++ portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); |
3446 |
++ if (!portdata) |
3447 |
++ return -ENOMEM; |
3448 |
+ |
3449 |
+-int usb_wwan_startup(struct usb_serial *serial) |
3450 |
+-{ |
3451 |
+- int i, j, err; |
3452 |
+- struct usb_serial_port *port; |
3453 |
+- struct usb_wwan_port_private *portdata; |
3454 |
+- u8 *buffer; |
3455 |
++ init_usb_anchor(&portdata->delayed); |
3456 |
+ |
3457 |
+- /* Now setup per port private data */ |
3458 |
+- for (i = 0; i < serial->num_ports; i++) { |
3459 |
+- port = serial->port[i]; |
3460 |
+- portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); |
3461 |
+- if (!portdata) { |
3462 |
+- dbg("%s: kmalloc for usb_wwan_port_private (%d) failed!.", |
3463 |
+- __func__, i); |
3464 |
+- return 1; |
3465 |
+- } |
3466 |
+- init_usb_anchor(&portdata->delayed); |
3467 |
++ for (i = 0; i < N_IN_URB; i++) { |
3468 |
++ buffer = (u8 *)__get_free_page(GFP_KERNEL); |
3469 |
++ if (!buffer) |
3470 |
++ goto bail_out_error; |
3471 |
++ portdata->in_buffer[i] = buffer; |
3472 |
++ |
3473 |
++ urb = usb_wwan_setup_urb(port, port->bulk_in_endpointAddress, |
3474 |
++ USB_DIR_IN, port, |
3475 |
++ buffer, IN_BUFLEN, |
3476 |
++ usb_wwan_indat_callback); |
3477 |
++ portdata->in_urbs[i] = urb; |
3478 |
++ } |
3479 |
++ for (i = 0; i < N_OUT_URB; i++) { |
3480 |
++ if (port->bulk_out_endpointAddress == -1) |
3481 |
++ continue; |
3482 |
+ |
3483 |
+- for (j = 0; j < N_IN_URB; j++) { |
3484 |
+- buffer = (u8 *) __get_free_page(GFP_KERNEL); |
3485 |
+- if (!buffer) |
3486 |
+- goto bail_out_error; |
3487 |
+- portdata->in_buffer[j] = buffer; |
3488 |
+- } |
3489 |
++ buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL); |
3490 |
++ if (!buffer) |
3491 |
++ goto bail_out_error2; |
3492 |
++ portdata->out_buffer[i] = buffer; |
3493 |
+ |
3494 |
+- for (j = 0; j < N_OUT_URB; j++) { |
3495 |
+- buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL); |
3496 |
+- if (!buffer) |
3497 |
+- goto bail_out_error2; |
3498 |
+- portdata->out_buffer[j] = buffer; |
3499 |
+- } |
3500 |
++ urb = usb_wwan_setup_urb(port, port->bulk_out_endpointAddress, |
3501 |
++ USB_DIR_OUT, port, |
3502 |
++ buffer, OUT_BUFLEN, |
3503 |
++ usb_wwan_outdat_callback); |
3504 |
++ portdata->out_urbs[i] = urb; |
3505 |
++ } |
3506 |
+ |
3507 |
+- usb_set_serial_port_data(port, portdata); |
3508 |
++ usb_set_serial_port_data(port, portdata); |
3509 |
+ |
3510 |
+- if (!port->interrupt_in_urb) |
3511 |
+- continue; |
3512 |
++ if (port->interrupt_in_urb) { |
3513 |
+ err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
3514 |
+ if (err) |
3515 |
+- dbg("%s: submit irq_in urb failed %d", __func__, err); |
3516 |
++ dev_dbg(&port->dev, "%s: submit irq_in urb failed %d\n", |
3517 |
++ __func__, err); |
3518 |
+ } |
3519 |
+- usb_wwan_setup_urbs(serial); |
3520 |
++ |
3521 |
+ return 0; |
3522 |
+ |
3523 |
+ bail_out_error2: |
3524 |
+- for (j = 0; j < N_OUT_URB; j++) |
3525 |
+- kfree(portdata->out_buffer[j]); |
3526 |
++ for (i = 0; i < N_OUT_URB; i++) { |
3527 |
++ usb_free_urb(portdata->out_urbs[i]); |
3528 |
++ kfree(portdata->out_buffer[i]); |
3529 |
++ } |
3530 |
+ bail_out_error: |
3531 |
+- for (j = 0; j < N_IN_URB; j++) |
3532 |
+- if (portdata->in_buffer[j]) |
3533 |
+- free_page((unsigned long)portdata->in_buffer[j]); |
3534 |
++ for (i = 0; i < N_IN_URB; i++) { |
3535 |
++ usb_free_urb(portdata->in_urbs[i]); |
3536 |
++ free_page((unsigned long)portdata->in_buffer[i]); |
3537 |
++ } |
3538 |
+ kfree(portdata); |
3539 |
+- return 1; |
3540 |
++ |
3541 |
++ return -ENOMEM; |
3542 |
+ } |
3543 |
+-EXPORT_SYMBOL(usb_wwan_startup); |
3544 |
++EXPORT_SYMBOL_GPL(usb_wwan_port_probe); |
3545 |
+ |
3546 |
+ int usb_wwan_port_remove(struct usb_serial_port *port) |
3547 |
+ { |
3548 |
+diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c |
3549 |
+index 473635e..bd36321 100644 |
3550 |
+--- a/drivers/usb/serial/whiteheat.c |
3551 |
++++ b/drivers/usb/serial/whiteheat.c |
3552 |
+@@ -86,6 +86,8 @@ static int whiteheat_firmware_attach(struct usb_serial *serial); |
3553 |
+ /* function prototypes for the Connect Tech WhiteHEAT serial converter */ |
3554 |
+ static int whiteheat_attach(struct usb_serial *serial); |
3555 |
+ static void whiteheat_release(struct usb_serial *serial); |
3556 |
++static int whiteheat_port_probe(struct usb_serial_port *port); |
3557 |
++static int whiteheat_port_remove(struct usb_serial_port *port); |
3558 |
+ static int whiteheat_open(struct tty_struct *tty, |
3559 |
+ struct usb_serial_port *port); |
3560 |
+ static void whiteheat_close(struct usb_serial_port *port); |
3561 |
+@@ -120,6 +122,8 @@ static struct usb_serial_driver whiteheat_device = { |
3562 |
+ .num_ports = 4, |
3563 |
+ .attach = whiteheat_attach, |
3564 |
+ .release = whiteheat_release, |
3565 |
++ .port_probe = whiteheat_port_probe, |
3566 |
++ .port_remove = whiteheat_port_remove, |
3567 |
+ .open = whiteheat_open, |
3568 |
+ .close = whiteheat_close, |
3569 |
+ .ioctl = whiteheat_ioctl, |
3570 |
+@@ -290,15 +294,12 @@ static int whiteheat_attach(struct usb_serial *serial) |
3571 |
+ { |
3572 |
+ struct usb_serial_port *command_port; |
3573 |
+ struct whiteheat_command_private *command_info; |
3574 |
+- struct usb_serial_port *port; |
3575 |
+- struct whiteheat_private *info; |
3576 |
+ struct whiteheat_hw_info *hw_info; |
3577 |
+ int pipe; |
3578 |
+ int ret; |
3579 |
+ int alen; |
3580 |
+ __u8 *command; |
3581 |
+ __u8 *result; |
3582 |
+- int i; |
3583 |
+ |
3584 |
+ command_port = serial->port[COMMAND_PORT]; |
3585 |
+ |
3586 |
+@@ -357,22 +358,6 @@ static int whiteheat_attach(struct usb_serial *serial) |
3587 |
+ serial->type->description, |
3588 |
+ hw_info->sw_major_rev, hw_info->sw_minor_rev); |
3589 |
+ |
3590 |
+- for (i = 0; i < serial->num_ports; i++) { |
3591 |
+- port = serial->port[i]; |
3592 |
+- |
3593 |
+- info = kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL); |
3594 |
+- if (info == NULL) { |
3595 |
+- dev_err(&port->dev, |
3596 |
+- "%s: Out of memory for port structures\n", |
3597 |
+- serial->type->description); |
3598 |
+- goto no_private; |
3599 |
+- } |
3600 |
+- |
3601 |
+- info->mcr = 0; |
3602 |
+- |
3603 |
+- usb_set_serial_port_data(port, info); |
3604 |
+- } |
3605 |
+- |
3606 |
+ command_info = kmalloc(sizeof(struct whiteheat_command_private), |
3607 |
+ GFP_KERNEL); |
3608 |
+ if (command_info == NULL) { |
3609 |
+@@ -405,16 +390,10 @@ no_firmware: |
3610 |
+ "%s: please contact support@×××××××××××.com\n", |
3611 |
+ serial->type->description); |
3612 |
+ kfree(result); |
3613 |
++ kfree(command); |
3614 |
+ return -ENODEV; |
3615 |
+ |
3616 |
+ no_command_private: |
3617 |
+- for (i = serial->num_ports - 1; i >= 0; i--) { |
3618 |
+- port = serial->port[i]; |
3619 |
+- info = usb_get_serial_port_data(port); |
3620 |
+- kfree(info); |
3621 |
+-no_private: |
3622 |
+- ; |
3623 |
+- } |
3624 |
+ kfree(result); |
3625 |
+ no_result_buffer: |
3626 |
+ kfree(command); |
3627 |
+@@ -422,21 +401,36 @@ no_command_buffer: |
3628 |
+ return -ENOMEM; |
3629 |
+ } |
3630 |
+ |
3631 |
+- |
3632 |
+ static void whiteheat_release(struct usb_serial *serial) |
3633 |
+ { |
3634 |
+ struct usb_serial_port *command_port; |
3635 |
+- struct whiteheat_private *info; |
3636 |
+- int i; |
3637 |
+ |
3638 |
+ /* free up our private data for our command port */ |
3639 |
+ command_port = serial->port[COMMAND_PORT]; |
3640 |
+ kfree(usb_get_serial_port_data(command_port)); |
3641 |
++} |
3642 |
+ |
3643 |
+- for (i = 0; i < serial->num_ports; i++) { |
3644 |
+- info = usb_get_serial_port_data(serial->port[i]); |
3645 |
+- kfree(info); |
3646 |
+- } |
3647 |
++static int whiteheat_port_probe(struct usb_serial_port *port) |
3648 |
++{ |
3649 |
++ struct whiteheat_private *info; |
3650 |
++ |
3651 |
++ info = kzalloc(sizeof(*info), GFP_KERNEL); |
3652 |
++ if (!info) |
3653 |
++ return -ENOMEM; |
3654 |
++ |
3655 |
++ usb_set_serial_port_data(port, info); |
3656 |
++ |
3657 |
++ return 0; |
3658 |
++} |
3659 |
++ |
3660 |
++static int whiteheat_port_remove(struct usb_serial_port *port) |
3661 |
++{ |
3662 |
++ struct whiteheat_private *info; |
3663 |
++ |
3664 |
++ info = usb_get_serial_port_data(port); |
3665 |
++ kfree(info); |
3666 |
++ |
3667 |
++ return 0; |
3668 |
+ } |
3669 |
+ |
3670 |
+ static int whiteheat_open(struct tty_struct *tty, struct usb_serial_port *port) |
3671 |
+diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h |
3672 |
+index 62a31be..8f98c9a 100644 |
3673 |
+--- a/drivers/usb/storage/unusual_devs.h |
3674 |
++++ b/drivers/usb/storage/unusual_devs.h |
3675 |
+@@ -1004,6 +1004,12 @@ UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x9999, |
3676 |
+ USB_SC_8070, USB_PR_CB, NULL, |
3677 |
+ US_FL_NEED_OVERRIDE | US_FL_FIX_INQUIRY ), |
3678 |
+ |
3679 |
++/* Submitted by Oleksandr Chumachenko <ledest@×××××.com> */ |
3680 |
++UNUSUAL_DEV( 0x07cf, 0x1167, 0x0100, 0x0100, |
3681 |
++ "Casio", |
3682 |
++ "EX-N1 DigitalCamera", |
3683 |
++ USB_SC_8070, USB_PR_DEVICE, NULL, 0), |
3684 |
++ |
3685 |
+ /* Submitted by Hartmut Wahl <hwahl@×××××.de>*/ |
3686 |
+ UNUSUAL_DEV( 0x0839, 0x000a, 0x0001, 0x0001, |
3687 |
+ "Samsung", |
3688 |
+diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c |
3689 |
+index 072cbba..7f93f34 100644 |
3690 |
+--- a/drivers/vhost/net.c |
3691 |
++++ b/drivers/vhost/net.c |
3692 |
+@@ -379,7 +379,8 @@ static void handle_rx(struct vhost_net *net) |
3693 |
+ .hdr.gso_type = VIRTIO_NET_HDR_GSO_NONE |
3694 |
+ }; |
3695 |
+ size_t total_len = 0; |
3696 |
+- int err, headcount, mergeable; |
3697 |
++ int err, mergeable; |
3698 |
++ s16 headcount; |
3699 |
+ size_t vhost_hlen, sock_hlen; |
3700 |
+ size_t vhost_len, sock_len; |
3701 |
+ /* TODO: check that we are running from vhost_worker? */ |
3702 |
+diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c |
3703 |
+index debdfe0..5d2069f 100644 |
3704 |
+--- a/fs/compat_ioctl.c |
3705 |
++++ b/fs/compat_ioctl.c |
3706 |
+@@ -210,6 +210,8 @@ static int do_video_set_spu_palette(unsigned int fd, unsigned int cmd, |
3707 |
+ |
3708 |
+ err = get_user(palp, &up->palette); |
3709 |
+ err |= get_user(length, &up->length); |
3710 |
++ if (err) |
3711 |
++ return -EFAULT; |
3712 |
+ |
3713 |
+ up_native = compat_alloc_user_space(sizeof(struct video_spu_palette)); |
3714 |
+ err = put_user(compat_ptr(palp), &up_native->palette); |
3715 |
+diff --git a/fs/exec.c b/fs/exec.c |
3716 |
+index 574cf4d..fab2c6d 100644 |
3717 |
+--- a/fs/exec.c |
3718 |
++++ b/fs/exec.c |
3719 |
+@@ -1110,7 +1110,8 @@ int flush_old_exec(struct linux_binprm * bprm) |
3720 |
+ bprm->mm = NULL; /* We're using it now */ |
3721 |
+ |
3722 |
+ set_fs(USER_DS); |
3723 |
+- current->flags &= ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD); |
3724 |
++ current->flags &= |
3725 |
++ ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD | PF_NOFREEZE); |
3726 |
+ flush_thread(); |
3727 |
+ current->personality &= ~bprm->per_clear; |
3728 |
+ |
3729 |
+diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c |
3730 |
+index e4fb3ba..3d7e09b 100644 |
3731 |
+--- a/fs/lockd/mon.c |
3732 |
++++ b/fs/lockd/mon.c |
3733 |
+@@ -85,29 +85,38 @@ static struct rpc_clnt *nsm_create(struct net *net) |
3734 |
+ return rpc_create(&args); |
3735 |
+ } |
3736 |
+ |
3737 |
++static struct rpc_clnt *nsm_client_set(struct lockd_net *ln, |
3738 |
++ struct rpc_clnt *clnt) |
3739 |
++{ |
3740 |
++ spin_lock(&ln->nsm_clnt_lock); |
3741 |
++ if (ln->nsm_users == 0) { |
3742 |
++ if (clnt == NULL) |
3743 |
++ goto out; |
3744 |
++ ln->nsm_clnt = clnt; |
3745 |
++ } |
3746 |
++ clnt = ln->nsm_clnt; |
3747 |
++ ln->nsm_users++; |
3748 |
++out: |
3749 |
++ spin_unlock(&ln->nsm_clnt_lock); |
3750 |
++ return clnt; |
3751 |
++} |
3752 |
++ |
3753 |
+ static struct rpc_clnt *nsm_client_get(struct net *net) |
3754 |
+ { |
3755 |
+- static DEFINE_MUTEX(nsm_create_mutex); |
3756 |
+- struct rpc_clnt *clnt; |
3757 |
++ struct rpc_clnt *clnt, *new; |
3758 |
+ struct lockd_net *ln = net_generic(net, lockd_net_id); |
3759 |
+ |
3760 |
+- spin_lock(&ln->nsm_clnt_lock); |
3761 |
+- if (ln->nsm_users) { |
3762 |
+- ln->nsm_users++; |
3763 |
+- clnt = ln->nsm_clnt; |
3764 |
+- spin_unlock(&ln->nsm_clnt_lock); |
3765 |
++ clnt = nsm_client_set(ln, NULL); |
3766 |
++ if (clnt != NULL) |
3767 |
+ goto out; |
3768 |
+- } |
3769 |
+- spin_unlock(&ln->nsm_clnt_lock); |
3770 |
+ |
3771 |
+- mutex_lock(&nsm_create_mutex); |
3772 |
+- clnt = nsm_create(net); |
3773 |
+- if (!IS_ERR(clnt)) { |
3774 |
+- ln->nsm_clnt = clnt; |
3775 |
+- smp_wmb(); |
3776 |
+- ln->nsm_users = 1; |
3777 |
+- } |
3778 |
+- mutex_unlock(&nsm_create_mutex); |
3779 |
++ clnt = new = nsm_create(net); |
3780 |
++ if (IS_ERR(clnt)) |
3781 |
++ goto out; |
3782 |
++ |
3783 |
++ clnt = nsm_client_set(ln, new); |
3784 |
++ if (clnt != new) |
3785 |
++ rpc_shutdown_client(new); |
3786 |
+ out: |
3787 |
+ return clnt; |
3788 |
+ } |
3789 |
+@@ -115,18 +124,16 @@ out: |
3790 |
+ static void nsm_client_put(struct net *net) |
3791 |
+ { |
3792 |
+ struct lockd_net *ln = net_generic(net, lockd_net_id); |
3793 |
+- struct rpc_clnt *clnt = ln->nsm_clnt; |
3794 |
+- int shutdown = 0; |
3795 |
++ struct rpc_clnt *clnt = NULL; |
3796 |
+ |
3797 |
+ spin_lock(&ln->nsm_clnt_lock); |
3798 |
+- if (ln->nsm_users) { |
3799 |
+- if (--ln->nsm_users) |
3800 |
+- ln->nsm_clnt = NULL; |
3801 |
+- shutdown = !ln->nsm_users; |
3802 |
++ ln->nsm_users--; |
3803 |
++ if (ln->nsm_users == 0) { |
3804 |
++ clnt = ln->nsm_clnt; |
3805 |
++ ln->nsm_clnt = NULL; |
3806 |
+ } |
3807 |
+ spin_unlock(&ln->nsm_clnt_lock); |
3808 |
+- |
3809 |
+- if (shutdown) |
3810 |
++ if (clnt != NULL) |
3811 |
+ rpc_shutdown_client(clnt); |
3812 |
+ } |
3813 |
+ |
3814 |
+diff --git a/fs/namei.c b/fs/namei.c |
3815 |
+index 81bd546..091c4b7 100644 |
3816 |
+--- a/fs/namei.c |
3817 |
++++ b/fs/namei.c |
3818 |
+@@ -651,8 +651,8 @@ static inline void put_link(struct nameidata *nd, struct path *link, void *cooki |
3819 |
+ path_put(link); |
3820 |
+ } |
3821 |
+ |
3822 |
+-int sysctl_protected_symlinks __read_mostly = 1; |
3823 |
+-int sysctl_protected_hardlinks __read_mostly = 1; |
3824 |
++int sysctl_protected_symlinks __read_mostly = 0; |
3825 |
++int sysctl_protected_hardlinks __read_mostly = 0; |
3826 |
+ |
3827 |
+ /** |
3828 |
+ * may_follow_link - Check symlink following for unsafe situations |
3829 |
+diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c |
3830 |
+index f3d16ad..1093968 100644 |
3831 |
+--- a/fs/nfs/blocklayout/blocklayout.c |
3832 |
++++ b/fs/nfs/blocklayout/blocklayout.c |
3833 |
+@@ -242,14 +242,6 @@ bl_end_par_io_read(void *data, int unused) |
3834 |
+ schedule_work(&rdata->task.u.tk_work); |
3835 |
+ } |
3836 |
+ |
3837 |
+-static bool |
3838 |
+-bl_check_alignment(u64 offset, u32 len, unsigned long blkmask) |
3839 |
+-{ |
3840 |
+- if ((offset & blkmask) || (len & blkmask)) |
3841 |
+- return false; |
3842 |
+- return true; |
3843 |
+-} |
3844 |
+- |
3845 |
+ static enum pnfs_try_status |
3846 |
+ bl_read_pagelist(struct nfs_read_data *rdata) |
3847 |
+ { |
3848 |
+@@ -260,15 +252,15 @@ bl_read_pagelist(struct nfs_read_data *rdata) |
3849 |
+ sector_t isect, extent_length = 0; |
3850 |
+ struct parallel_io *par; |
3851 |
+ loff_t f_offset = rdata->args.offset; |
3852 |
++ size_t bytes_left = rdata->args.count; |
3853 |
++ unsigned int pg_offset, pg_len; |
3854 |
+ struct page **pages = rdata->args.pages; |
3855 |
+ int pg_index = rdata->args.pgbase >> PAGE_CACHE_SHIFT; |
3856 |
++ const bool is_dio = (header->dreq != NULL); |
3857 |
+ |
3858 |
+ dprintk("%s enter nr_pages %u offset %lld count %u\n", __func__, |
3859 |
+ rdata->pages.npages, f_offset, (unsigned int)rdata->args.count); |
3860 |
+ |
3861 |
+- if (!bl_check_alignment(f_offset, rdata->args.count, PAGE_CACHE_MASK)) |
3862 |
+- goto use_mds; |
3863 |
+- |
3864 |
+ par = alloc_parallel(rdata); |
3865 |
+ if (!par) |
3866 |
+ goto use_mds; |
3867 |
+@@ -298,36 +290,53 @@ bl_read_pagelist(struct nfs_read_data *rdata) |
3868 |
+ extent_length = min(extent_length, cow_length); |
3869 |
+ } |
3870 |
+ } |
3871 |
++ |
3872 |
++ if (is_dio) { |
3873 |
++ pg_offset = f_offset & ~PAGE_CACHE_MASK; |
3874 |
++ if (pg_offset + bytes_left > PAGE_CACHE_SIZE) |
3875 |
++ pg_len = PAGE_CACHE_SIZE - pg_offset; |
3876 |
++ else |
3877 |
++ pg_len = bytes_left; |
3878 |
++ |
3879 |
++ f_offset += pg_len; |
3880 |
++ bytes_left -= pg_len; |
3881 |
++ isect += (pg_offset >> SECTOR_SHIFT); |
3882 |
++ } else { |
3883 |
++ pg_offset = 0; |
3884 |
++ pg_len = PAGE_CACHE_SIZE; |
3885 |
++ } |
3886 |
++ |
3887 |
+ hole = is_hole(be, isect); |
3888 |
+ if (hole && !cow_read) { |
3889 |
+ bio = bl_submit_bio(READ, bio); |
3890 |
+ /* Fill hole w/ zeroes w/o accessing device */ |
3891 |
+ dprintk("%s Zeroing page for hole\n", __func__); |
3892 |
+- zero_user_segment(pages[i], 0, PAGE_CACHE_SIZE); |
3893 |
++ zero_user_segment(pages[i], pg_offset, pg_len); |
3894 |
+ print_page(pages[i]); |
3895 |
+ SetPageUptodate(pages[i]); |
3896 |
+ } else { |
3897 |
+ struct pnfs_block_extent *be_read; |
3898 |
+ |
3899 |
+ be_read = (hole && cow_read) ? cow_read : be; |
3900 |
+- bio = bl_add_page_to_bio(bio, rdata->pages.npages - i, |
3901 |
++ bio = do_add_page_to_bio(bio, rdata->pages.npages - i, |
3902 |
+ READ, |
3903 |
+ isect, pages[i], be_read, |
3904 |
+- bl_end_io_read, par); |
3905 |
++ bl_end_io_read, par, |
3906 |
++ pg_offset, pg_len); |
3907 |
+ if (IS_ERR(bio)) { |
3908 |
+ header->pnfs_error = PTR_ERR(bio); |
3909 |
+ bio = NULL; |
3910 |
+ goto out; |
3911 |
+ } |
3912 |
+ } |
3913 |
+- isect += PAGE_CACHE_SECTORS; |
3914 |
++ isect += (pg_len >> SECTOR_SHIFT); |
3915 |
+ extent_length -= PAGE_CACHE_SECTORS; |
3916 |
+ } |
3917 |
+ if ((isect << SECTOR_SHIFT) >= header->inode->i_size) { |
3918 |
+ rdata->res.eof = 1; |
3919 |
+- rdata->res.count = header->inode->i_size - f_offset; |
3920 |
++ rdata->res.count = header->inode->i_size - rdata->args.offset; |
3921 |
+ } else { |
3922 |
+- rdata->res.count = (isect << SECTOR_SHIFT) - f_offset; |
3923 |
++ rdata->res.count = (isect << SECTOR_SHIFT) - rdata->args.offset; |
3924 |
+ } |
3925 |
+ out: |
3926 |
+ bl_put_extent(be); |
3927 |
+@@ -688,10 +697,13 @@ bl_write_pagelist(struct nfs_write_data *wdata, int sync) |
3928 |
+ NFS_SERVER(header->inode)->pnfs_blksize >> PAGE_CACHE_SHIFT; |
3929 |
+ |
3930 |
+ dprintk("%s enter, %Zu@%lld\n", __func__, count, offset); |
3931 |
+- /* Check for alignment first */ |
3932 |
+- if (!bl_check_alignment(offset, count, PAGE_CACHE_MASK)) |
3933 |
+- goto out_mds; |
3934 |
+ |
3935 |
++ if (header->dreq != NULL && |
3936 |
++ (!IS_ALIGNED(offset, NFS_SERVER(header->inode)->pnfs_blksize) || |
3937 |
++ !IS_ALIGNED(count, NFS_SERVER(header->inode)->pnfs_blksize))) { |
3938 |
++ dprintk("pnfsblock nonblock aligned DIO writes. Resend MDS\n"); |
3939 |
++ goto out_mds; |
3940 |
++ } |
3941 |
+ /* At this point, wdata->pages is a (sequential) list of nfs_pages. |
3942 |
+ * We want to write each, and if there is an error set pnfs_error |
3943 |
+ * to have it redone using nfs. |
3944 |
+@@ -1164,33 +1176,64 @@ bl_clear_layoutdriver(struct nfs_server *server) |
3945 |
+ return 0; |
3946 |
+ } |
3947 |
+ |
3948 |
++static bool |
3949 |
++is_aligned_req(struct nfs_page *req, unsigned int alignment) |
3950 |
++{ |
3951 |
++ return IS_ALIGNED(req->wb_offset, alignment) && |
3952 |
++ IS_ALIGNED(req->wb_bytes, alignment); |
3953 |
++} |
3954 |
++ |
3955 |
+ static void |
3956 |
+ bl_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *req) |
3957 |
+ { |
3958 |
+- if (!bl_check_alignment(req->wb_offset, req->wb_bytes, PAGE_CACHE_MASK)) |
3959 |
++ if (pgio->pg_dreq != NULL && |
3960 |
++ !is_aligned_req(req, SECTOR_SIZE)) |
3961 |
+ nfs_pageio_reset_read_mds(pgio); |
3962 |
+ else |
3963 |
+ pnfs_generic_pg_init_read(pgio, req); |
3964 |
+ } |
3965 |
+ |
3966 |
+-static void |
3967 |
++static bool |
3968 |
++bl_pg_test_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, |
3969 |
++ struct nfs_page *req) |
3970 |
++{ |
3971 |
++ if (pgio->pg_dreq != NULL && |
3972 |
++ !is_aligned_req(req, SECTOR_SIZE)) |
3973 |
++ return false; |
3974 |
++ |
3975 |
++ return pnfs_generic_pg_test(pgio, prev, req); |
3976 |
++} |
3977 |
++ |
3978 |
++void |
3979 |
+ bl_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req) |
3980 |
+ { |
3981 |
+- if (!bl_check_alignment(req->wb_offset, req->wb_bytes, PAGE_CACHE_MASK)) |
3982 |
++ if (pgio->pg_dreq != NULL && |
3983 |
++ !is_aligned_req(req, PAGE_CACHE_SIZE)) |
3984 |
+ nfs_pageio_reset_write_mds(pgio); |
3985 |
+ else |
3986 |
+ pnfs_generic_pg_init_write(pgio, req); |
3987 |
+ } |
3988 |
+ |
3989 |
++static bool |
3990 |
++bl_pg_test_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, |
3991 |
++ struct nfs_page *req) |
3992 |
++{ |
3993 |
++ if (pgio->pg_dreq != NULL && |
3994 |
++ !is_aligned_req(req, PAGE_CACHE_SIZE)) |
3995 |
++ return false; |
3996 |
++ |
3997 |
++ return pnfs_generic_pg_test(pgio, prev, req); |
3998 |
++} |
3999 |
++ |
4000 |
+ static const struct nfs_pageio_ops bl_pg_read_ops = { |
4001 |
+ .pg_init = bl_pg_init_read, |
4002 |
+- .pg_test = pnfs_generic_pg_test, |
4003 |
++ .pg_test = bl_pg_test_read, |
4004 |
+ .pg_doio = pnfs_generic_pg_readpages, |
4005 |
+ }; |
4006 |
+ |
4007 |
+ static const struct nfs_pageio_ops bl_pg_write_ops = { |
4008 |
+ .pg_init = bl_pg_init_write, |
4009 |
+- .pg_test = pnfs_generic_pg_test, |
4010 |
++ .pg_test = bl_pg_test_write, |
4011 |
+ .pg_doio = pnfs_generic_pg_writepages, |
4012 |
+ }; |
4013 |
+ |
4014 |
+diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c |
4015 |
+index 6b0bb00..2fbdff6 100644 |
4016 |
+--- a/fs/sysfs/dir.c |
4017 |
++++ b/fs/sysfs/dir.c |
4018 |
+@@ -485,20 +485,18 @@ int __sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd) |
4019 |
+ /** |
4020 |
+ * sysfs_pathname - return full path to sysfs dirent |
4021 |
+ * @sd: sysfs_dirent whose path we want |
4022 |
+- * @path: caller allocated buffer |
4023 |
++ * @path: caller allocated buffer of size PATH_MAX |
4024 |
+ * |
4025 |
+ * Gives the name "/" to the sysfs_root entry; any path returned |
4026 |
+ * is relative to wherever sysfs is mounted. |
4027 |
+- * |
4028 |
+- * XXX: does no error checking on @path size |
4029 |
+ */ |
4030 |
+ static char *sysfs_pathname(struct sysfs_dirent *sd, char *path) |
4031 |
+ { |
4032 |
+ if (sd->s_parent) { |
4033 |
+ sysfs_pathname(sd->s_parent, path); |
4034 |
+- strcat(path, "/"); |
4035 |
++ strlcat(path, "/", PATH_MAX); |
4036 |
+ } |
4037 |
+- strcat(path, sd->s_name); |
4038 |
++ strlcat(path, sd->s_name, PATH_MAX); |
4039 |
+ return path; |
4040 |
+ } |
4041 |
+ |
4042 |
+@@ -531,9 +529,11 @@ int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd) |
4043 |
+ char *path = kzalloc(PATH_MAX, GFP_KERNEL); |
4044 |
+ WARN(1, KERN_WARNING |
4045 |
+ "sysfs: cannot create duplicate filename '%s'\n", |
4046 |
+- (path == NULL) ? sd->s_name : |
4047 |
+- strcat(strcat(sysfs_pathname(acxt->parent_sd, path), "/"), |
4048 |
+- sd->s_name)); |
4049 |
++ (path == NULL) ? sd->s_name |
4050 |
++ : (sysfs_pathname(acxt->parent_sd, path), |
4051 |
++ strlcat(path, "/", PATH_MAX), |
4052 |
++ strlcat(path, sd->s_name, PATH_MAX), |
4053 |
++ path)); |
4054 |
+ kfree(path); |
4055 |
+ } |
4056 |
+ |
4057 |
+diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h |
4058 |
+index c78bb99..af1cbaf 100644 |
4059 |
+--- a/include/drm/drm_pciids.h |
4060 |
++++ b/include/drm/drm_pciids.h |
4061 |
+@@ -205,6 +205,8 @@ |
4062 |
+ {0x1002, 0x6788, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
4063 |
+ {0x1002, 0x678A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
4064 |
+ {0x1002, 0x6790, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
4065 |
++ {0x1002, 0x6791, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
4066 |
++ {0x1002, 0x6792, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
4067 |
+ {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
4068 |
+ {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
4069 |
+ {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
4070 |
+@@ -217,6 +219,7 @@ |
4071 |
+ {0x1002, 0x6808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
4072 |
+ {0x1002, 0x6809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
4073 |
+ {0x1002, 0x6810, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
4074 |
++ {0x1002, 0x6811, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
4075 |
+ {0x1002, 0x6816, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
4076 |
+ {0x1002, 0x6817, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
4077 |
+ {0x1002, 0x6818, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
4078 |
+diff --git a/include/linux/efi.h b/include/linux/efi.h |
4079 |
+index ec45ccd..5782114 100644 |
4080 |
+--- a/include/linux/efi.h |
4081 |
++++ b/include/linux/efi.h |
4082 |
+@@ -496,6 +496,11 @@ extern void efi_map_pal_code (void); |
4083 |
+ extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); |
4084 |
+ extern void efi_gettimeofday (struct timespec *ts); |
4085 |
+ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ |
4086 |
++#ifdef CONFIG_X86 |
4087 |
++extern void efi_free_boot_services(void); |
4088 |
++#else |
4089 |
++static inline void efi_free_boot_services(void) {} |
4090 |
++#endif |
4091 |
+ extern u64 efi_get_iobase (void); |
4092 |
+ extern u32 efi_mem_type (unsigned long phys_addr); |
4093 |
+ extern u64 efi_mem_attributes (unsigned long phys_addr); |
4094 |
+diff --git a/include/linux/memblock.h b/include/linux/memblock.h |
4095 |
+index 19dc455..c948c44 100644 |
4096 |
+--- a/include/linux/memblock.h |
4097 |
++++ b/include/linux/memblock.h |
4098 |
+@@ -57,6 +57,7 @@ int memblock_add(phys_addr_t base, phys_addr_t size); |
4099 |
+ int memblock_remove(phys_addr_t base, phys_addr_t size); |
4100 |
+ int memblock_free(phys_addr_t base, phys_addr_t size); |
4101 |
+ int memblock_reserve(phys_addr_t base, phys_addr_t size); |
4102 |
++void memblock_trim_memory(phys_addr_t align); |
4103 |
+ |
4104 |
+ #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
4105 |
+ void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, |
4106 |
+diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h |
4107 |
+index 3d254e1..f10553c 100644 |
4108 |
+--- a/include/net/cfg80211.h |
4109 |
++++ b/include/net/cfg80211.h |
4110 |
+@@ -1217,6 +1217,7 @@ struct cfg80211_deauth_request { |
4111 |
+ const u8 *ie; |
4112 |
+ size_t ie_len; |
4113 |
+ u16 reason_code; |
4114 |
++ bool local_state_change; |
4115 |
+ }; |
4116 |
+ |
4117 |
+ /** |
4118 |
+diff --git a/init/main.c b/init/main.c |
4119 |
+index b286730..d61ec54 100644 |
4120 |
+--- a/init/main.c |
4121 |
++++ b/init/main.c |
4122 |
+@@ -631,6 +631,9 @@ asmlinkage void __init start_kernel(void) |
4123 |
+ acpi_early_init(); /* before LAPIC and SMP init */ |
4124 |
+ sfi_init_late(); |
4125 |
+ |
4126 |
++ if (efi_enabled) |
4127 |
++ efi_free_boot_services(); |
4128 |
++ |
4129 |
+ ftrace_init(); |
4130 |
+ |
4131 |
+ /* Do the rest non-__init'ed, we're now alive */ |
4132 |
+diff --git a/lib/genalloc.c b/lib/genalloc.c |
4133 |
+index 6bc04aa..7cb7a5d 100644 |
4134 |
+--- a/lib/genalloc.c |
4135 |
++++ b/lib/genalloc.c |
4136 |
+@@ -176,7 +176,7 @@ int gen_pool_add_virt(struct gen_pool *pool, unsigned long virt, phys_addr_t phy |
4137 |
+ struct gen_pool_chunk *chunk; |
4138 |
+ int nbits = size >> pool->min_alloc_order; |
4139 |
+ int nbytes = sizeof(struct gen_pool_chunk) + |
4140 |
+- (nbits + BITS_PER_BYTE - 1) / BITS_PER_BYTE; |
4141 |
++ BITS_TO_LONGS(nbits) * sizeof(long); |
4142 |
+ |
4143 |
+ chunk = kmalloc_node(nbytes, GFP_KERNEL | __GFP_ZERO, nid); |
4144 |
+ if (unlikely(chunk == NULL)) |
4145 |
+diff --git a/mm/memblock.c b/mm/memblock.c |
4146 |
+index 82aa349..0e490e8 100644 |
4147 |
+--- a/mm/memblock.c |
4148 |
++++ b/mm/memblock.c |
4149 |
+@@ -929,6 +929,30 @@ int __init_memblock memblock_is_region_reserved(phys_addr_t base, phys_addr_t si |
4150 |
+ return memblock_overlaps_region(&memblock.reserved, base, size) >= 0; |
4151 |
+ } |
4152 |
+ |
4153 |
++void __init_memblock memblock_trim_memory(phys_addr_t align) |
4154 |
++{ |
4155 |
++ int i; |
4156 |
++ phys_addr_t start, end, orig_start, orig_end; |
4157 |
++ struct memblock_type *mem = &memblock.memory; |
4158 |
++ |
4159 |
++ for (i = 0; i < mem->cnt; i++) { |
4160 |
++ orig_start = mem->regions[i].base; |
4161 |
++ orig_end = mem->regions[i].base + mem->regions[i].size; |
4162 |
++ start = round_up(orig_start, align); |
4163 |
++ end = round_down(orig_end, align); |
4164 |
++ |
4165 |
++ if (start == orig_start && end == orig_end) |
4166 |
++ continue; |
4167 |
++ |
4168 |
++ if (start < end) { |
4169 |
++ mem->regions[i].base = start; |
4170 |
++ mem->regions[i].size = end - start; |
4171 |
++ } else { |
4172 |
++ memblock_remove_region(mem, i); |
4173 |
++ i--; |
4174 |
++ } |
4175 |
++ } |
4176 |
++} |
4177 |
+ |
4178 |
+ void __init_memblock memblock_set_current_limit(phys_addr_t limit) |
4179 |
+ { |
4180 |
+diff --git a/mm/rmap.c b/mm/rmap.c |
4181 |
+index 0f3b7cd..aa95e59 100644 |
4182 |
+--- a/mm/rmap.c |
4183 |
++++ b/mm/rmap.c |
4184 |
+@@ -56,6 +56,7 @@ |
4185 |
+ #include <linux/mmu_notifier.h> |
4186 |
+ #include <linux/migrate.h> |
4187 |
+ #include <linux/hugetlb.h> |
4188 |
++#include <linux/backing-dev.h> |
4189 |
+ |
4190 |
+ #include <asm/tlbflush.h> |
4191 |
+ |
4192 |
+@@ -971,11 +972,8 @@ int page_mkclean(struct page *page) |
4193 |
+ |
4194 |
+ if (page_mapped(page)) { |
4195 |
+ struct address_space *mapping = page_mapping(page); |
4196 |
+- if (mapping) { |
4197 |
++ if (mapping) |
4198 |
+ ret = page_mkclean_file(mapping, page); |
4199 |
+- if (page_test_and_clear_dirty(page_to_pfn(page), 1)) |
4200 |
+- ret = 1; |
4201 |
+- } |
4202 |
+ } |
4203 |
+ |
4204 |
+ return ret; |
4205 |
+@@ -1161,6 +1159,7 @@ void page_add_file_rmap(struct page *page) |
4206 |
+ */ |
4207 |
+ void page_remove_rmap(struct page *page) |
4208 |
+ { |
4209 |
++ struct address_space *mapping = page_mapping(page); |
4210 |
+ bool anon = PageAnon(page); |
4211 |
+ bool locked; |
4212 |
+ unsigned long flags; |
4213 |
+@@ -1183,8 +1182,19 @@ void page_remove_rmap(struct page *page) |
4214 |
+ * this if the page is anon, so about to be freed; but perhaps |
4215 |
+ * not if it's in swapcache - there might be another pte slot |
4216 |
+ * containing the swap entry, but page not yet written to swap. |
4217 |
++ * |
4218 |
++ * And we can skip it on file pages, so long as the filesystem |
4219 |
++ * participates in dirty tracking; but need to catch shm and tmpfs |
4220 |
++ * and ramfs pages which have been modified since creation by read |
4221 |
++ * fault. |
4222 |
++ * |
4223 |
++ * Note that mapping must be decided above, before decrementing |
4224 |
++ * mapcount (which luckily provides a barrier): once page is unmapped, |
4225 |
++ * it could be truncated and page->mapping reset to NULL at any moment. |
4226 |
++ * Note also that we are relying on page_mapping(page) to set mapping |
4227 |
++ * to &swapper_space when PageSwapCache(page). |
4228 |
+ */ |
4229 |
+- if ((!anon || PageSwapCache(page)) && |
4230 |
++ if (mapping && !mapping_cap_account_dirty(mapping) && |
4231 |
+ page_test_and_clear_dirty(page_to_pfn(page), 1)) |
4232 |
+ set_page_dirty(page); |
4233 |
+ /* |
4234 |
+diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c |
4235 |
+index 8c225ef..2ac8d50 100644 |
4236 |
+--- a/net/bluetooth/smp.c |
4237 |
++++ b/net/bluetooth/smp.c |
4238 |
+@@ -32,6 +32,8 @@ |
4239 |
+ |
4240 |
+ #define SMP_TIMEOUT msecs_to_jiffies(30000) |
4241 |
+ |
4242 |
++#define AUTH_REQ_MASK 0x07 |
4243 |
++ |
4244 |
+ static inline void swap128(u8 src[16], u8 dst[16]) |
4245 |
+ { |
4246 |
+ int i; |
4247 |
+@@ -230,7 +232,7 @@ static void build_pairing_cmd(struct l2cap_conn *conn, |
4248 |
+ req->max_key_size = SMP_MAX_ENC_KEY_SIZE; |
4249 |
+ req->init_key_dist = 0; |
4250 |
+ req->resp_key_dist = dist_keys; |
4251 |
+- req->auth_req = authreq; |
4252 |
++ req->auth_req = (authreq & AUTH_REQ_MASK); |
4253 |
+ return; |
4254 |
+ } |
4255 |
+ |
4256 |
+@@ -239,7 +241,7 @@ static void build_pairing_cmd(struct l2cap_conn *conn, |
4257 |
+ rsp->max_key_size = SMP_MAX_ENC_KEY_SIZE; |
4258 |
+ rsp->init_key_dist = 0; |
4259 |
+ rsp->resp_key_dist = req->resp_key_dist & dist_keys; |
4260 |
+- rsp->auth_req = authreq; |
4261 |
++ rsp->auth_req = (authreq & AUTH_REQ_MASK); |
4262 |
+ } |
4263 |
+ |
4264 |
+ static u8 check_enc_key_size(struct l2cap_conn *conn, __u8 max_key_size) |
4265 |
+diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c |
4266 |
+index bfb57dc..c93d395 100644 |
4267 |
+--- a/net/mac80211/iface.c |
4268 |
++++ b/net/mac80211/iface.c |
4269 |
+@@ -822,7 +822,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, |
4270 |
+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
4271 |
+ if (info->control.vif == &sdata->vif) { |
4272 |
+ __skb_unlink(skb, &local->pending[i]); |
4273 |
+- dev_kfree_skb_irq(skb); |
4274 |
++ ieee80211_free_txskb(&local->hw, skb); |
4275 |
+ } |
4276 |
+ } |
4277 |
+ } |
4278 |
+diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c |
4279 |
+index f76b833..b71d466 100644 |
4280 |
+--- a/net/mac80211/mlme.c |
4281 |
++++ b/net/mac80211/mlme.c |
4282 |
+@@ -3065,22 +3065,32 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata, |
4283 |
+ ht_cfreq, ht_oper->primary_chan, |
4284 |
+ cbss->channel->band); |
4285 |
+ ht_oper = NULL; |
4286 |
++ } else { |
4287 |
++ channel_type = NL80211_CHAN_HT20; |
4288 |
+ } |
4289 |
+ } |
4290 |
+ |
4291 |
+- if (ht_oper) { |
4292 |
+- channel_type = NL80211_CHAN_HT20; |
4293 |
++ if (ht_oper && sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) { |
4294 |
++ /* |
4295 |
++ * cfg80211 already verified that the channel itself can |
4296 |
++ * be used, but it didn't check that we can do the right |
4297 |
++ * HT type, so do that here as well. If HT40 isn't allowed |
4298 |
++ * on this channel, disable 40 MHz operation. |
4299 |
++ */ |
4300 |
+ |
4301 |
+- if (sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) { |
4302 |
+- switch (ht_oper->ht_param & |
4303 |
+- IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { |
4304 |
+- case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: |
4305 |
++ switch (ht_oper->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { |
4306 |
++ case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: |
4307 |
++ if (cbss->channel->flags & IEEE80211_CHAN_NO_HT40PLUS) |
4308 |
++ ifmgd->flags |= IEEE80211_STA_DISABLE_40MHZ; |
4309 |
++ else |
4310 |
+ channel_type = NL80211_CHAN_HT40PLUS; |
4311 |
+- break; |
4312 |
+- case IEEE80211_HT_PARAM_CHA_SEC_BELOW: |
4313 |
++ break; |
4314 |
++ case IEEE80211_HT_PARAM_CHA_SEC_BELOW: |
4315 |
++ if (cbss->channel->flags & IEEE80211_CHAN_NO_HT40MINUS) |
4316 |
++ ifmgd->flags |= IEEE80211_STA_DISABLE_40MHZ; |
4317 |
++ else |
4318 |
+ channel_type = NL80211_CHAN_HT40MINUS; |
4319 |
+- break; |
4320 |
+- } |
4321 |
++ break; |
4322 |
+ } |
4323 |
+ } |
4324 |
+ |
4325 |
+@@ -3457,6 +3467,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, |
4326 |
+ { |
4327 |
+ struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
4328 |
+ u8 frame_buf[DEAUTH_DISASSOC_LEN]; |
4329 |
++ bool tx = !req->local_state_change; |
4330 |
+ |
4331 |
+ mutex_lock(&ifmgd->mtx); |
4332 |
+ |
4333 |
+@@ -3473,11 +3484,11 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, |
4334 |
+ if (ifmgd->associated && |
4335 |
+ ether_addr_equal(ifmgd->associated->bssid, req->bssid)) |
4336 |
+ ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, |
4337 |
+- req->reason_code, true, frame_buf); |
4338 |
++ req->reason_code, tx, frame_buf); |
4339 |
+ else |
4340 |
+ ieee80211_send_deauth_disassoc(sdata, req->bssid, |
4341 |
+ IEEE80211_STYPE_DEAUTH, |
4342 |
+- req->reason_code, true, |
4343 |
++ req->reason_code, tx, |
4344 |
+ frame_buf); |
4345 |
+ mutex_unlock(&ifmgd->mtx); |
4346 |
+ |
4347 |
+diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c |
4348 |
+index 06fa75c..63882b9 100644 |
4349 |
+--- a/net/mac80211/sta_info.c |
4350 |
++++ b/net/mac80211/sta_info.c |
4351 |
+@@ -585,7 +585,7 @@ static bool sta_info_cleanup_expire_buffered_ac(struct ieee80211_local *local, |
4352 |
+ */ |
4353 |
+ if (!skb) |
4354 |
+ break; |
4355 |
+- dev_kfree_skb(skb); |
4356 |
++ ieee80211_free_txskb(&local->hw, skb); |
4357 |
+ } |
4358 |
+ |
4359 |
+ /* |
4360 |
+@@ -614,7 +614,7 @@ static bool sta_info_cleanup_expire_buffered_ac(struct ieee80211_local *local, |
4361 |
+ local->total_ps_buffered--; |
4362 |
+ ps_dbg(sta->sdata, "Buffered frame expired (STA %pM)\n", |
4363 |
+ sta->sta.addr); |
4364 |
+- dev_kfree_skb(skb); |
4365 |
++ ieee80211_free_txskb(&local->hw, skb); |
4366 |
+ } |
4367 |
+ |
4368 |
+ /* |
4369 |
+diff --git a/net/mac80211/util.c b/net/mac80211/util.c |
4370 |
+index 39b82fe..c9b52f7 100644 |
4371 |
+--- a/net/mac80211/util.c |
4372 |
++++ b/net/mac80211/util.c |
4373 |
+@@ -400,7 +400,7 @@ void ieee80211_add_pending_skb(struct ieee80211_local *local, |
4374 |
+ int queue = info->hw_queue; |
4375 |
+ |
4376 |
+ if (WARN_ON(!info->control.vif)) { |
4377 |
+- kfree_skb(skb); |
4378 |
++ ieee80211_free_txskb(&local->hw, skb); |
4379 |
+ return; |
4380 |
+ } |
4381 |
+ |
4382 |
+@@ -425,7 +425,7 @@ void ieee80211_add_pending_skbs_fn(struct ieee80211_local *local, |
4383 |
+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
4384 |
+ |
4385 |
+ if (WARN_ON(!info->control.vif)) { |
4386 |
+- kfree_skb(skb); |
4387 |
++ ieee80211_free_txskb(&local->hw, skb); |
4388 |
+ continue; |
4389 |
+ } |
4390 |
+ |
4391 |
+diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c |
4392 |
+index bdb53ab..e72562a 100644 |
4393 |
+--- a/net/mac80211/wpa.c |
4394 |
++++ b/net/mac80211/wpa.c |
4395 |
+@@ -106,7 +106,8 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx) |
4396 |
+ if (status->flag & RX_FLAG_MMIC_ERROR) |
4397 |
+ goto mic_fail; |
4398 |
+ |
4399 |
+- if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key) |
4400 |
++ if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key && |
4401 |
++ rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP) |
4402 |
+ goto update_iv; |
4403 |
+ |
4404 |
+ return RX_CONTINUE; |
4405 |
+diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c |
4406 |
+index 97f8918..6a70db4 100644 |
4407 |
+--- a/net/sunrpc/xprtsock.c |
4408 |
++++ b/net/sunrpc/xprtsock.c |
4409 |
+@@ -254,7 +254,6 @@ struct sock_xprt { |
4410 |
+ void (*old_data_ready)(struct sock *, int); |
4411 |
+ void (*old_state_change)(struct sock *); |
4412 |
+ void (*old_write_space)(struct sock *); |
4413 |
+- void (*old_error_report)(struct sock *); |
4414 |
+ }; |
4415 |
+ |
4416 |
+ /* |
4417 |
+@@ -737,10 +736,10 @@ static int xs_tcp_send_request(struct rpc_task *task) |
4418 |
+ dprintk("RPC: sendmsg returned unrecognized error %d\n", |
4419 |
+ -status); |
4420 |
+ case -ECONNRESET: |
4421 |
+- case -EPIPE: |
4422 |
+ xs_tcp_shutdown(xprt); |
4423 |
+ case -ECONNREFUSED: |
4424 |
+ case -ENOTCONN: |
4425 |
++ case -EPIPE: |
4426 |
+ clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); |
4427 |
+ } |
4428 |
+ |
4429 |
+@@ -781,7 +780,6 @@ static void xs_save_old_callbacks(struct sock_xprt *transport, struct sock *sk) |
4430 |
+ transport->old_data_ready = sk->sk_data_ready; |
4431 |
+ transport->old_state_change = sk->sk_state_change; |
4432 |
+ transport->old_write_space = sk->sk_write_space; |
4433 |
+- transport->old_error_report = sk->sk_error_report; |
4434 |
+ } |
4435 |
+ |
4436 |
+ static void xs_restore_old_callbacks(struct sock_xprt *transport, struct sock *sk) |
4437 |
+@@ -789,7 +787,6 @@ static void xs_restore_old_callbacks(struct sock_xprt *transport, struct sock *s |
4438 |
+ sk->sk_data_ready = transport->old_data_ready; |
4439 |
+ sk->sk_state_change = transport->old_state_change; |
4440 |
+ sk->sk_write_space = transport->old_write_space; |
4441 |
+- sk->sk_error_report = transport->old_error_report; |
4442 |
+ } |
4443 |
+ |
4444 |
+ static void xs_reset_transport(struct sock_xprt *transport) |
4445 |
+@@ -1462,7 +1459,7 @@ static void xs_tcp_cancel_linger_timeout(struct rpc_xprt *xprt) |
4446 |
+ xprt_clear_connecting(xprt); |
4447 |
+ } |
4448 |
+ |
4449 |
+-static void xs_sock_mark_closed(struct rpc_xprt *xprt) |
4450 |
++static void xs_sock_reset_connection_flags(struct rpc_xprt *xprt) |
4451 |
+ { |
4452 |
+ smp_mb__before_clear_bit(); |
4453 |
+ clear_bit(XPRT_CONNECTION_ABORT, &xprt->state); |
4454 |
+@@ -1470,6 +1467,11 @@ static void xs_sock_mark_closed(struct rpc_xprt *xprt) |
4455 |
+ clear_bit(XPRT_CLOSE_WAIT, &xprt->state); |
4456 |
+ clear_bit(XPRT_CLOSING, &xprt->state); |
4457 |
+ smp_mb__after_clear_bit(); |
4458 |
++} |
4459 |
++ |
4460 |
++static void xs_sock_mark_closed(struct rpc_xprt *xprt) |
4461 |
++{ |
4462 |
++ xs_sock_reset_connection_flags(xprt); |
4463 |
+ /* Mark transport as closed and wake up all pending tasks */ |
4464 |
+ xprt_disconnect_done(xprt); |
4465 |
+ } |
4466 |
+@@ -1525,6 +1527,7 @@ static void xs_tcp_state_change(struct sock *sk) |
4467 |
+ case TCP_CLOSE_WAIT: |
4468 |
+ /* The server initiated a shutdown of the socket */ |
4469 |
+ xprt->connect_cookie++; |
4470 |
++ clear_bit(XPRT_CONNECTED, &xprt->state); |
4471 |
+ xs_tcp_force_close(xprt); |
4472 |
+ case TCP_CLOSING: |
4473 |
+ /* |
4474 |
+@@ -1549,25 +1552,6 @@ static void xs_tcp_state_change(struct sock *sk) |
4475 |
+ read_unlock_bh(&sk->sk_callback_lock); |
4476 |
+ } |
4477 |
+ |
4478 |
+-/** |
4479 |
+- * xs_error_report - callback mainly for catching socket errors |
4480 |
+- * @sk: socket |
4481 |
+- */ |
4482 |
+-static void xs_error_report(struct sock *sk) |
4483 |
+-{ |
4484 |
+- struct rpc_xprt *xprt; |
4485 |
+- |
4486 |
+- read_lock_bh(&sk->sk_callback_lock); |
4487 |
+- if (!(xprt = xprt_from_sock(sk))) |
4488 |
+- goto out; |
4489 |
+- dprintk("RPC: %s client %p...\n" |
4490 |
+- "RPC: error %d\n", |
4491 |
+- __func__, xprt, sk->sk_err); |
4492 |
+- xprt_wake_pending_tasks(xprt, -EAGAIN); |
4493 |
+-out: |
4494 |
+- read_unlock_bh(&sk->sk_callback_lock); |
4495 |
+-} |
4496 |
+- |
4497 |
+ static void xs_write_space(struct sock *sk) |
4498 |
+ { |
4499 |
+ struct socket *sock; |
4500 |
+@@ -1867,7 +1851,6 @@ static int xs_local_finish_connecting(struct rpc_xprt *xprt, |
4501 |
+ sk->sk_user_data = xprt; |
4502 |
+ sk->sk_data_ready = xs_local_data_ready; |
4503 |
+ sk->sk_write_space = xs_udp_write_space; |
4504 |
+- sk->sk_error_report = xs_error_report; |
4505 |
+ sk->sk_allocation = GFP_ATOMIC; |
4506 |
+ |
4507 |
+ xprt_clear_connected(xprt); |
4508 |
+@@ -1995,7 +1978,6 @@ static void xs_udp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) |
4509 |
+ sk->sk_user_data = xprt; |
4510 |
+ sk->sk_data_ready = xs_udp_data_ready; |
4511 |
+ sk->sk_write_space = xs_udp_write_space; |
4512 |
+- sk->sk_error_report = xs_error_report; |
4513 |
+ sk->sk_no_check = UDP_CSUM_NORCV; |
4514 |
+ sk->sk_allocation = GFP_ATOMIC; |
4515 |
+ |
4516 |
+@@ -2065,10 +2047,8 @@ static void xs_abort_connection(struct sock_xprt *transport) |
4517 |
+ any.sa_family = AF_UNSPEC; |
4518 |
+ result = kernel_connect(transport->sock, &any, sizeof(any), 0); |
4519 |
+ if (!result) |
4520 |
+- xs_sock_mark_closed(&transport->xprt); |
4521 |
+- else |
4522 |
+- dprintk("RPC: AF_UNSPEC connect return code %d\n", |
4523 |
+- result); |
4524 |
++ xs_sock_reset_connection_flags(&transport->xprt); |
4525 |
++ dprintk("RPC: AF_UNSPEC connect return code %d\n", result); |
4526 |
+ } |
4527 |
+ |
4528 |
+ static void xs_tcp_reuse_connection(struct sock_xprt *transport) |
4529 |
+@@ -2113,7 +2093,6 @@ static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) |
4530 |
+ sk->sk_data_ready = xs_tcp_data_ready; |
4531 |
+ sk->sk_state_change = xs_tcp_state_change; |
4532 |
+ sk->sk_write_space = xs_tcp_write_space; |
4533 |
+- sk->sk_error_report = xs_error_report; |
4534 |
+ sk->sk_allocation = GFP_ATOMIC; |
4535 |
+ |
4536 |
+ /* socket options */ |
4537 |
+diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c |
4538 |
+index 1cdb1d5..9ea174f 100644 |
4539 |
+--- a/net/wireless/mlme.c |
4540 |
++++ b/net/wireless/mlme.c |
4541 |
+@@ -457,20 +457,14 @@ int __cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev, |
4542 |
+ .reason_code = reason, |
4543 |
+ .ie = ie, |
4544 |
+ .ie_len = ie_len, |
4545 |
++ .local_state_change = local_state_change, |
4546 |
+ }; |
4547 |
+ |
4548 |
+ ASSERT_WDEV_LOCK(wdev); |
4549 |
+ |
4550 |
+- if (local_state_change) { |
4551 |
+- if (wdev->current_bss && |
4552 |
+- ether_addr_equal(wdev->current_bss->pub.bssid, bssid)) { |
4553 |
+- cfg80211_unhold_bss(wdev->current_bss); |
4554 |
+- cfg80211_put_bss(&wdev->current_bss->pub); |
4555 |
+- wdev->current_bss = NULL; |
4556 |
+- } |
4557 |
+- |
4558 |
++ if (local_state_change && (!wdev->current_bss || |
4559 |
++ !ether_addr_equal(wdev->current_bss->pub.bssid, bssid))) |
4560 |
+ return 0; |
4561 |
+- } |
4562 |
+ |
4563 |
+ return rdev->ops->deauth(&rdev->wiphy, dev, &req); |
4564 |
+ } |
4565 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
4566 |
+index 155cbd2..70ce60f 100644 |
4567 |
+--- a/sound/pci/hda/patch_realtek.c |
4568 |
++++ b/sound/pci/hda/patch_realtek.c |
4569 |
+@@ -5704,6 +5704,7 @@ static const struct hda_verb alc268_beep_init_verbs[] = { |
4570 |
+ |
4571 |
+ enum { |
4572 |
+ ALC268_FIXUP_INV_DMIC, |
4573 |
++ ALC268_FIXUP_HP_EAPD, |
4574 |
+ }; |
4575 |
+ |
4576 |
+ static const struct alc_fixup alc268_fixups[] = { |
4577 |
+@@ -5711,10 +5712,26 @@ static const struct alc_fixup alc268_fixups[] = { |
4578 |
+ .type = ALC_FIXUP_FUNC, |
4579 |
+ .v.func = alc_fixup_inv_dmic_0x12, |
4580 |
+ }, |
4581 |
++ [ALC268_FIXUP_HP_EAPD] = { |
4582 |
++ .type = ALC_FIXUP_VERBS, |
4583 |
++ .v.verbs = (const struct hda_verb[]) { |
4584 |
++ {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
4585 |
++ {} |
4586 |
++ } |
4587 |
++ }, |
4588 |
+ }; |
4589 |
+ |
4590 |
+ static const struct alc_model_fixup alc268_fixup_models[] = { |
4591 |
+ {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
4592 |
++ {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
4593 |
++ {} |
4594 |
++}; |
4595 |
++ |
4596 |
++static const struct snd_pci_quirk alc268_fixup_tbl[] = { |
4597 |
++ /* below is codec SSID since multiple Toshiba laptops have the |
4598 |
++ * same PCI SSID 1179:ff00 |
4599 |
++ */ |
4600 |
++ SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), |
4601 |
+ {} |
4602 |
+ }; |
4603 |
+ |
4604 |
+@@ -5749,7 +5766,7 @@ static int patch_alc268(struct hda_codec *codec) |
4605 |
+ |
4606 |
+ spec = codec->spec; |
4607 |
+ |
4608 |
+- alc_pick_fixup(codec, alc268_fixup_models, NULL, alc268_fixups); |
4609 |
++ alc_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
4610 |
+ alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); |
4611 |
+ |
4612 |
+ /* automatic parse from the BIOS config */ |
4613 |
+@@ -6214,6 +6231,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
4614 |
+ SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), |
4615 |
+ SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK), |
4616 |
+ SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
4617 |
++ SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
4618 |
+ SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
4619 |
+ SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
4620 |
+ SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
4621 |
+diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c |
4622 |
+index af0f22f..aca6edc 100644 |
4623 |
+--- a/usr/gen_init_cpio.c |
4624 |
++++ b/usr/gen_init_cpio.c |
4625 |
+@@ -303,7 +303,7 @@ static int cpio_mkfile(const char *name, const char *location, |
4626 |
+ int retval; |
4627 |
+ int rc = -1; |
4628 |
+ int namesize; |
4629 |
+- int i; |
4630 |
++ unsigned int i; |
4631 |
+ |
4632 |
+ mode |= S_IFREG; |
4633 |
+ |
4634 |
+@@ -381,25 +381,28 @@ error: |
4635 |
+ |
4636 |
+ static char *cpio_replace_env(char *new_location) |
4637 |
+ { |
4638 |
+- char expanded[PATH_MAX + 1]; |
4639 |
+- char env_var[PATH_MAX + 1]; |
4640 |
+- char *start; |
4641 |
+- char *end; |
4642 |
+- |
4643 |
+- for (start = NULL; (start = strstr(new_location, "${")); ) { |
4644 |
+- end = strchr(start, '}'); |
4645 |
+- if (start < end) { |
4646 |
+- *env_var = *expanded = '\0'; |
4647 |
+- strncat(env_var, start + 2, end - start - 2); |
4648 |
+- strncat(expanded, new_location, start - new_location); |
4649 |
+- strncat(expanded, getenv(env_var), PATH_MAX); |
4650 |
+- strncat(expanded, end + 1, PATH_MAX); |
4651 |
+- strncpy(new_location, expanded, PATH_MAX); |
4652 |
+- } else |
4653 |
+- break; |
4654 |
+- } |
4655 |
+- |
4656 |
+- return new_location; |
4657 |
++ char expanded[PATH_MAX + 1]; |
4658 |
++ char env_var[PATH_MAX + 1]; |
4659 |
++ char *start; |
4660 |
++ char *end; |
4661 |
++ |
4662 |
++ for (start = NULL; (start = strstr(new_location, "${")); ) { |
4663 |
++ end = strchr(start, '}'); |
4664 |
++ if (start < end) { |
4665 |
++ *env_var = *expanded = '\0'; |
4666 |
++ strncat(env_var, start + 2, end - start - 2); |
4667 |
++ strncat(expanded, new_location, start - new_location); |
4668 |
++ strncat(expanded, getenv(env_var), |
4669 |
++ PATH_MAX - strlen(expanded)); |
4670 |
++ strncat(expanded, end + 1, |
4671 |
++ PATH_MAX - strlen(expanded)); |
4672 |
++ strncpy(new_location, expanded, PATH_MAX); |
4673 |
++ new_location[PATH_MAX] = 0; |
4674 |
++ } else |
4675 |
++ break; |
4676 |
++ } |
4677 |
++ |
4678 |
++ return new_location; |
4679 |
+ } |
4680 |
+ |
4681 |
+ |