1 |
Author: mpagano |
2 |
Date: 2012-06-19 00:00:27 +0000 (Tue, 19 Jun 2012) |
3 |
New Revision: 2162 |
4 |
|
5 |
Added: |
6 |
genpatches-2.6/trunk/3.0/1033_linux-3.0.34.patch |
7 |
genpatches-2.6/trunk/3.0/1034_linux-3.0.35.patch |
8 |
Modified: |
9 |
genpatches-2.6/trunk/3.0/0000_README |
10 |
Log: |
11 |
Linux patches 3.0.34 and 3.0.35 |
12 |
|
13 |
Modified: genpatches-2.6/trunk/3.0/0000_README |
14 |
=================================================================== |
15 |
--- genpatches-2.6/trunk/3.0/0000_README 2012-06-18 17:49:37 UTC (rev 2161) |
16 |
+++ genpatches-2.6/trunk/3.0/0000_README 2012-06-19 00:00:27 UTC (rev 2162) |
17 |
@@ -167,6 +167,14 @@ |
18 |
From: http://www.kernel.org |
19 |
Desc: Linux 3.0.33 |
20 |
|
21 |
+Patch: 1033_linux-3.0.34.patch |
22 |
+From: http://www.kernel.org |
23 |
+Desc: Linux 3.0.34 |
24 |
+ |
25 |
+Patch: 1034_linux-3.0.35.patch |
26 |
+From: http://www.kernel.org |
27 |
+Desc: Linux 3.0.35 |
28 |
+ |
29 |
Patch: 1800_fix-zcache-build.patch |
30 |
From: http://bugs.gentoo.org/show_bug.cgi?id=376325 |
31 |
Desc: Fix zcache build error |
32 |
|
33 |
Added: genpatches-2.6/trunk/3.0/1033_linux-3.0.34.patch |
34 |
=================================================================== |
35 |
--- genpatches-2.6/trunk/3.0/1033_linux-3.0.34.patch (rev 0) |
36 |
+++ genpatches-2.6/trunk/3.0/1033_linux-3.0.34.patch 2012-06-19 00:00:27 UTC (rev 2162) |
37 |
@@ -0,0 +1,1483 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index c621c70..61ef485 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 3 |
44 |
+ PATCHLEVEL = 0 |
45 |
+-SUBLEVEL = 33 |
46 |
++SUBLEVEL = 34 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Sneaky Weasel |
49 |
+ |
50 |
+diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S |
51 |
+index 5350342..07ef351 100644 |
52 |
+--- a/arch/parisc/kernel/entry.S |
53 |
++++ b/arch/parisc/kernel/entry.S |
54 |
+@@ -552,7 +552,7 @@ |
55 |
+ * entry (identifying the physical page) and %r23 up with |
56 |
+ * the from tlb entry (or nothing if only a to entry---for |
57 |
+ * clear_user_page_asm) */ |
58 |
+- .macro do_alias spc,tmp,tmp1,va,pte,prot,fault |
59 |
++ .macro do_alias spc,tmp,tmp1,va,pte,prot,fault,patype |
60 |
+ cmpib,COND(<>),n 0,\spc,\fault |
61 |
+ ldil L%(TMPALIAS_MAP_START),\tmp |
62 |
+ #if defined(CONFIG_64BIT) && (TMPALIAS_MAP_START >= 0x80000000) |
63 |
+@@ -581,11 +581,15 @@ |
64 |
+ */ |
65 |
+ cmpiclr,= 0x01,\tmp,%r0 |
66 |
+ ldi (_PAGE_DIRTY|_PAGE_READ|_PAGE_WRITE),\prot |
67 |
+-#ifdef CONFIG_64BIT |
68 |
++.ifc \patype,20 |
69 |
+ depd,z \prot,8,7,\prot |
70 |
+-#else |
71 |
++.else |
72 |
++.ifc \patype,11 |
73 |
+ depw,z \prot,8,7,\prot |
74 |
+-#endif |
75 |
++.else |
76 |
++ .error "undefined PA type to do_alias" |
77 |
++.endif |
78 |
++.endif |
79 |
+ /* |
80 |
+ * OK, it is in the temp alias region, check whether "from" or "to". |
81 |
+ * Check "subtle" note in pacache.S re: r23/r26. |
82 |
+@@ -1189,7 +1193,7 @@ dtlb_miss_20w: |
83 |
+ nop |
84 |
+ |
85 |
+ dtlb_check_alias_20w: |
86 |
+- do_alias spc,t0,t1,va,pte,prot,dtlb_fault |
87 |
++ do_alias spc,t0,t1,va,pte,prot,dtlb_fault,20 |
88 |
+ |
89 |
+ idtlbt pte,prot |
90 |
+ |
91 |
+@@ -1213,7 +1217,7 @@ nadtlb_miss_20w: |
92 |
+ nop |
93 |
+ |
94 |
+ nadtlb_check_alias_20w: |
95 |
+- do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate |
96 |
++ do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,20 |
97 |
+ |
98 |
+ idtlbt pte,prot |
99 |
+ |
100 |
+@@ -1245,7 +1249,7 @@ dtlb_miss_11: |
101 |
+ nop |
102 |
+ |
103 |
+ dtlb_check_alias_11: |
104 |
+- do_alias spc,t0,t1,va,pte,prot,dtlb_fault |
105 |
++ do_alias spc,t0,t1,va,pte,prot,dtlb_fault,11 |
106 |
+ |
107 |
+ idtlba pte,(va) |
108 |
+ idtlbp prot,(va) |
109 |
+@@ -1277,7 +1281,7 @@ nadtlb_miss_11: |
110 |
+ nop |
111 |
+ |
112 |
+ nadtlb_check_alias_11: |
113 |
+- do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate |
114 |
++ do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,11 |
115 |
+ |
116 |
+ idtlba pte,(va) |
117 |
+ idtlbp prot,(va) |
118 |
+@@ -1304,7 +1308,7 @@ dtlb_miss_20: |
119 |
+ nop |
120 |
+ |
121 |
+ dtlb_check_alias_20: |
122 |
+- do_alias spc,t0,t1,va,pte,prot,dtlb_fault |
123 |
++ do_alias spc,t0,t1,va,pte,prot,dtlb_fault,20 |
124 |
+ |
125 |
+ idtlbt pte,prot |
126 |
+ |
127 |
+@@ -1330,7 +1334,7 @@ nadtlb_miss_20: |
128 |
+ nop |
129 |
+ |
130 |
+ nadtlb_check_alias_20: |
131 |
+- do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate |
132 |
++ do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,20 |
133 |
+ |
134 |
+ idtlbt pte,prot |
135 |
+ |
136 |
+@@ -1457,7 +1461,7 @@ naitlb_miss_20w: |
137 |
+ nop |
138 |
+ |
139 |
+ naitlb_check_alias_20w: |
140 |
+- do_alias spc,t0,t1,va,pte,prot,naitlb_fault |
141 |
++ do_alias spc,t0,t1,va,pte,prot,naitlb_fault,20 |
142 |
+ |
143 |
+ iitlbt pte,prot |
144 |
+ |
145 |
+@@ -1511,7 +1515,7 @@ naitlb_miss_11: |
146 |
+ nop |
147 |
+ |
148 |
+ naitlb_check_alias_11: |
149 |
+- do_alias spc,t0,t1,va,pte,prot,itlb_fault |
150 |
++ do_alias spc,t0,t1,va,pte,prot,itlb_fault,11 |
151 |
+ |
152 |
+ iitlba pte,(%sr0, va) |
153 |
+ iitlbp prot,(%sr0, va) |
154 |
+@@ -1557,7 +1561,7 @@ naitlb_miss_20: |
155 |
+ nop |
156 |
+ |
157 |
+ naitlb_check_alias_20: |
158 |
+- do_alias spc,t0,t1,va,pte,prot,naitlb_fault |
159 |
++ do_alias spc,t0,t1,va,pte,prot,naitlb_fault,20 |
160 |
+ |
161 |
+ iitlbt pte,prot |
162 |
+ |
163 |
+diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S |
164 |
+index fa6f2b8..64a9998 100644 |
165 |
+--- a/arch/parisc/kernel/vmlinux.lds.S |
166 |
++++ b/arch/parisc/kernel/vmlinux.lds.S |
167 |
+@@ -50,8 +50,10 @@ SECTIONS |
168 |
+ . = KERNEL_BINARY_TEXT_START; |
169 |
+ |
170 |
+ _text = .; /* Text and read-only data */ |
171 |
+- .text ALIGN(16) : { |
172 |
++ .head ALIGN(16) : { |
173 |
+ HEAD_TEXT |
174 |
++ } = 0 |
175 |
++ .text ALIGN(16) : { |
176 |
+ TEXT_TEXT |
177 |
+ SCHED_TEXT |
178 |
+ LOCK_TEXT |
179 |
+@@ -65,7 +67,7 @@ SECTIONS |
180 |
+ *(.fixup) |
181 |
+ *(.lock.text) /* out-of-line lock text */ |
182 |
+ *(.gnu.warning) |
183 |
+- } = 0 |
184 |
++ } |
185 |
+ /* End of text section */ |
186 |
+ _etext = .; |
187 |
+ |
188 |
+diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h |
189 |
+index effff47..43876f1 100644 |
190 |
+--- a/arch/x86/include/asm/pgtable-3level.h |
191 |
++++ b/arch/x86/include/asm/pgtable-3level.h |
192 |
+@@ -31,6 +31,56 @@ static inline void native_set_pte(pte_t *ptep, pte_t pte) |
193 |
+ ptep->pte_low = pte.pte_low; |
194 |
+ } |
195 |
+ |
196 |
++#define pmd_read_atomic pmd_read_atomic |
197 |
++/* |
198 |
++ * pte_offset_map_lock on 32bit PAE kernels was reading the pmd_t with |
199 |
++ * a "*pmdp" dereference done by gcc. Problem is, in certain places |
200 |
++ * where pte_offset_map_lock is called, concurrent page faults are |
201 |
++ * allowed, if the mmap_sem is hold for reading. An example is mincore |
202 |
++ * vs page faults vs MADV_DONTNEED. On the page fault side |
203 |
++ * pmd_populate rightfully does a set_64bit, but if we're reading the |
204 |
++ * pmd_t with a "*pmdp" on the mincore side, a SMP race can happen |
205 |
++ * because gcc will not read the 64bit of the pmd atomically. To fix |
206 |
++ * this all places running pmd_offset_map_lock() while holding the |
207 |
++ * mmap_sem in read mode, shall read the pmdp pointer using this |
208 |
++ * function to know if the pmd is null nor not, and in turn to know if |
209 |
++ * they can run pmd_offset_map_lock or pmd_trans_huge or other pmd |
210 |
++ * operations. |
211 |
++ * |
212 |
++ * Without THP if the mmap_sem is hold for reading, the |
213 |
++ * pmd can only transition from null to not null while pmd_read_atomic runs. |
214 |
++ * So there's no need of literally reading it atomically. |
215 |
++ * |
216 |
++ * With THP if the mmap_sem is hold for reading, the pmd can become |
217 |
++ * THP or null or point to a pte (and in turn become "stable") at any |
218 |
++ * time under pmd_read_atomic, so it's mandatory to read it atomically |
219 |
++ * with cmpxchg8b. |
220 |
++ */ |
221 |
++#ifndef CONFIG_TRANSPARENT_HUGEPAGE |
222 |
++static inline pmd_t pmd_read_atomic(pmd_t *pmdp) |
223 |
++{ |
224 |
++ pmdval_t ret; |
225 |
++ u32 *tmp = (u32 *)pmdp; |
226 |
++ |
227 |
++ ret = (pmdval_t) (*tmp); |
228 |
++ if (ret) { |
229 |
++ /* |
230 |
++ * If the low part is null, we must not read the high part |
231 |
++ * or we can end up with a partial pmd. |
232 |
++ */ |
233 |
++ smp_rmb(); |
234 |
++ ret |= ((pmdval_t)*(tmp + 1)) << 32; |
235 |
++ } |
236 |
++ |
237 |
++ return (pmd_t) { ret }; |
238 |
++} |
239 |
++#else /* CONFIG_TRANSPARENT_HUGEPAGE */ |
240 |
++static inline pmd_t pmd_read_atomic(pmd_t *pmdp) |
241 |
++{ |
242 |
++ return (pmd_t) { atomic64_read((atomic64_t *)pmdp) }; |
243 |
++} |
244 |
++#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
245 |
++ |
246 |
+ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) |
247 |
+ { |
248 |
+ set_64bit((unsigned long long *)(ptep), native_pte_val(pte)); |
249 |
+diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c |
250 |
+index fcc13ac..d77c97d 100644 |
251 |
+--- a/drivers/acpi/battery.c |
252 |
++++ b/drivers/acpi/battery.c |
253 |
+@@ -635,11 +635,19 @@ static int acpi_battery_update(struct acpi_battery *battery) |
254 |
+ |
255 |
+ static void acpi_battery_refresh(struct acpi_battery *battery) |
256 |
+ { |
257 |
++ int power_unit; |
258 |
++ |
259 |
+ if (!battery->bat.dev) |
260 |
+ return; |
261 |
+ |
262 |
++ power_unit = battery->power_unit; |
263 |
++ |
264 |
+ acpi_battery_get_info(battery); |
265 |
+- /* The battery may have changed its reporting units. */ |
266 |
++ |
267 |
++ if (power_unit == battery->power_unit) |
268 |
++ return; |
269 |
++ |
270 |
++ /* The battery has changed its reporting units. */ |
271 |
+ sysfs_remove_battery(battery); |
272 |
+ sysfs_add_battery(battery); |
273 |
+ } |
274 |
+diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c |
275 |
+index 5d1d076..d452592 100644 |
276 |
+--- a/drivers/atm/solos-pci.c |
277 |
++++ b/drivers/atm/solos-pci.c |
278 |
+@@ -984,6 +984,7 @@ static uint32_t fpga_tx(struct solos_card *card) |
279 |
+ } else if (skb && card->using_dma) { |
280 |
+ SKB_CB(skb)->dma_addr = pci_map_single(card->dev, skb->data, |
281 |
+ skb->len, PCI_DMA_TODEVICE); |
282 |
++ card->tx_skb[port] = skb; |
283 |
+ iowrite32(SKB_CB(skb)->dma_addr, |
284 |
+ card->config_regs + TX_DMA_ADDR(port)); |
285 |
+ } |
286 |
+@@ -1152,7 +1153,8 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id) |
287 |
+ db_fpga_upgrade = db_firmware_upgrade = 0; |
288 |
+ } |
289 |
+ |
290 |
+- if (card->fpga_version >= DMA_SUPPORTED){ |
291 |
++ if (card->fpga_version >= DMA_SUPPORTED) { |
292 |
++ pci_set_master(dev); |
293 |
+ card->using_dma = 1; |
294 |
+ } else { |
295 |
+ card->using_dma = 0; |
296 |
+diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c |
297 |
+index a714c73..305e752 100644 |
298 |
+--- a/drivers/bluetooth/ath3k.c |
299 |
++++ b/drivers/bluetooth/ath3k.c |
300 |
+@@ -78,6 +78,9 @@ static struct usb_device_id ath3k_table[] = { |
301 |
+ /* Atheros AR5BBU12 with sflash firmware */ |
302 |
+ { USB_DEVICE(0x0489, 0xE02C) }, |
303 |
+ |
304 |
++ /* Atheros AR5BBU22 with sflash firmware */ |
305 |
++ { USB_DEVICE(0x0489, 0xE03C) }, |
306 |
++ |
307 |
+ { } /* Terminating entry */ |
308 |
+ }; |
309 |
+ |
310 |
+@@ -94,6 +97,9 @@ static struct usb_device_id ath3k_blist_tbl[] = { |
311 |
+ { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, |
312 |
+ { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, |
313 |
+ |
314 |
++ /* Atheros AR5BBU22 with sflash firmware */ |
315 |
++ { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, |
316 |
++ |
317 |
+ { } /* Terminating entry */ |
318 |
+ }; |
319 |
+ |
320 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
321 |
+index 8fbda40..f4585b9 100644 |
322 |
+--- a/drivers/bluetooth/btusb.c |
323 |
++++ b/drivers/bluetooth/btusb.c |
324 |
+@@ -61,7 +61,7 @@ static struct usb_device_id btusb_table[] = { |
325 |
+ { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, |
326 |
+ |
327 |
+ /* Broadcom SoftSailing reporting vendor specific */ |
328 |
+- { USB_DEVICE(0x05ac, 0x21e1) }, |
329 |
++ { USB_DEVICE(0x0a5c, 0x21e1) }, |
330 |
+ |
331 |
+ /* Apple MacBookPro 7,1 */ |
332 |
+ { USB_DEVICE(0x05ac, 0x8213) }, |
333 |
+@@ -100,6 +100,17 @@ static struct usb_device_id btusb_table[] = { |
334 |
+ /* Canyon CN-BTU1 with HID interfaces */ |
335 |
+ { USB_DEVICE(0x0c10, 0x0000) }, |
336 |
+ |
337 |
++ /* Broadcom BCM20702A0 */ |
338 |
++ { USB_DEVICE(0x0489, 0xe042) }, |
339 |
++ { USB_DEVICE(0x0a5c, 0x21e3) }, |
340 |
++ { USB_DEVICE(0x0a5c, 0x21e6) }, |
341 |
++ { USB_DEVICE(0x0a5c, 0x21e8) }, |
342 |
++ { USB_DEVICE(0x0a5c, 0x21f3) }, |
343 |
++ { USB_DEVICE(0x413c, 0x8197) }, |
344 |
++ |
345 |
++ /* Foxconn - Hon Hai */ |
346 |
++ { USB_DEVICE(0x0489, 0xe033) }, |
347 |
++ |
348 |
+ { } /* Terminating entry */ |
349 |
+ }; |
350 |
+ |
351 |
+@@ -130,6 +141,9 @@ static struct usb_device_id blacklist_table[] = { |
352 |
+ /* Atheros AR5BBU12 with sflash firmware */ |
353 |
+ { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, |
354 |
+ |
355 |
++ /* Atheros AR5BBU12 with sflash firmware */ |
356 |
++ { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, |
357 |
++ |
358 |
+ /* Broadcom BCM2035 */ |
359 |
+ { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, |
360 |
+ { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, |
361 |
+diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c |
362 |
+index 06bc46e..c901060 100644 |
363 |
+--- a/drivers/gpu/drm/i915/intel_sdvo.c |
364 |
++++ b/drivers/gpu/drm/i915/intel_sdvo.c |
365 |
+@@ -762,10 +762,12 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd, |
366 |
+ ((v_sync_len & 0x30) >> 4); |
367 |
+ |
368 |
+ dtd->part2.dtd_flags = 0x18; |
369 |
++ if (mode->flags & DRM_MODE_FLAG_INTERLACE) |
370 |
++ dtd->part2.dtd_flags |= DTD_FLAG_INTERLACE; |
371 |
+ if (mode->flags & DRM_MODE_FLAG_PHSYNC) |
372 |
+- dtd->part2.dtd_flags |= 0x2; |
373 |
++ dtd->part2.dtd_flags |= DTD_FLAG_HSYNC_POSITIVE; |
374 |
+ if (mode->flags & DRM_MODE_FLAG_PVSYNC) |
375 |
+- dtd->part2.dtd_flags |= 0x4; |
376 |
++ dtd->part2.dtd_flags |= DTD_FLAG_VSYNC_POSITIVE; |
377 |
+ |
378 |
+ dtd->part2.sdvo_flags = 0; |
379 |
+ dtd->part2.v_sync_off_high = v_sync_offset & 0xc0; |
380 |
+@@ -799,9 +801,11 @@ static void intel_sdvo_get_mode_from_dtd(struct drm_display_mode * mode, |
381 |
+ mode->clock = dtd->part1.clock * 10; |
382 |
+ |
383 |
+ mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); |
384 |
+- if (dtd->part2.dtd_flags & 0x2) |
385 |
++ if (dtd->part2.dtd_flags & DTD_FLAG_INTERLACE) |
386 |
++ mode->flags |= DRM_MODE_FLAG_INTERLACE; |
387 |
++ if (dtd->part2.dtd_flags & DTD_FLAG_HSYNC_POSITIVE) |
388 |
+ mode->flags |= DRM_MODE_FLAG_PHSYNC; |
389 |
+- if (dtd->part2.dtd_flags & 0x4) |
390 |
++ if (dtd->part2.dtd_flags & DTD_FLAG_VSYNC_POSITIVE) |
391 |
+ mode->flags |= DRM_MODE_FLAG_PVSYNC; |
392 |
+ } |
393 |
+ |
394 |
+diff --git a/drivers/gpu/drm/i915/intel_sdvo_regs.h b/drivers/gpu/drm/i915/intel_sdvo_regs.h |
395 |
+index 4f4e23b..c5c8ddf 100644 |
396 |
+--- a/drivers/gpu/drm/i915/intel_sdvo_regs.h |
397 |
++++ b/drivers/gpu/drm/i915/intel_sdvo_regs.h |
398 |
+@@ -61,6 +61,11 @@ struct intel_sdvo_caps { |
399 |
+ u16 output_flags; |
400 |
+ } __attribute__((packed)); |
401 |
+ |
402 |
++/* Note: SDVO detailed timing flags match EDID misc flags. */ |
403 |
++#define DTD_FLAG_HSYNC_POSITIVE (1 << 1) |
404 |
++#define DTD_FLAG_VSYNC_POSITIVE (1 << 2) |
405 |
++#define DTD_FLAG_INTERLACE (1 << 7) |
406 |
++ |
407 |
+ /** This matches the EDID DTD structure, more or less */ |
408 |
+ struct intel_sdvo_dtd { |
409 |
+ struct { |
410 |
+diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c |
411 |
+index f57b08b..2136e6b 100644 |
412 |
+--- a/drivers/gpu/drm/i915/intel_tv.c |
413 |
++++ b/drivers/gpu/drm/i915/intel_tv.c |
414 |
+@@ -1301,6 +1301,11 @@ intel_tv_detect_type (struct intel_tv *intel_tv, |
415 |
+ |
416 |
+ I915_WRITE(TV_DAC, save_tv_dac & ~TVDAC_STATE_CHG_EN); |
417 |
+ I915_WRITE(TV_CTL, save_tv_ctl); |
418 |
++ POSTING_READ(TV_CTL); |
419 |
++ |
420 |
++ /* For unknown reasons the hw barfs if we don't do this vblank wait. */ |
421 |
++ intel_wait_for_vblank(intel_tv->base.base.dev, |
422 |
++ to_intel_crtc(intel_tv->base.base.crtc)->pipe); |
423 |
+ |
424 |
+ /* Restore interrupt config */ |
425 |
+ if (connector->polled & DRM_CONNECTOR_POLL_HPD) { |
426 |
+diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c |
427 |
+index fe052c6..8846bad 100644 |
428 |
+--- a/drivers/gpu/drm/radeon/evergreen.c |
429 |
++++ b/drivers/gpu/drm/radeon/evergreen.c |
430 |
+@@ -926,6 +926,11 @@ int evergreen_pcie_gart_enable(struct radeon_device *rdev) |
431 |
+ WREG32(MC_VM_MD_L1_TLB0_CNTL, tmp); |
432 |
+ WREG32(MC_VM_MD_L1_TLB1_CNTL, tmp); |
433 |
+ WREG32(MC_VM_MD_L1_TLB2_CNTL, tmp); |
434 |
++ if ((rdev->family == CHIP_JUNIPER) || |
435 |
++ (rdev->family == CHIP_CYPRESS) || |
436 |
++ (rdev->family == CHIP_HEMLOCK) || |
437 |
++ (rdev->family == CHIP_BARTS)) |
438 |
++ WREG32(MC_VM_MD_L1_TLB3_CNTL, tmp); |
439 |
+ } |
440 |
+ WREG32(MC_VM_MB_L1_TLB0_CNTL, tmp); |
441 |
+ WREG32(MC_VM_MB_L1_TLB1_CNTL, tmp); |
442 |
+@@ -2064,9 +2069,9 @@ static void evergreen_gpu_init(struct radeon_device *rdev) |
443 |
+ WREG32(CC_SYS_RB_BACKEND_DISABLE, rb); |
444 |
+ WREG32(GC_USER_RB_BACKEND_DISABLE, rb); |
445 |
+ WREG32(CC_GC_SHADER_PIPE_CONFIG, sp); |
446 |
+- } |
447 |
++ } |
448 |
+ |
449 |
+- grbm_gfx_index |= SE_BROADCAST_WRITES; |
450 |
++ grbm_gfx_index = INSTANCE_BROADCAST_WRITES | SE_BROADCAST_WRITES; |
451 |
+ WREG32(GRBM_GFX_INDEX, grbm_gfx_index); |
452 |
+ WREG32(RLC_GFX_INDEX, grbm_gfx_index); |
453 |
+ |
454 |
+diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h |
455 |
+index b7b2714..6078ae4 100644 |
456 |
+--- a/drivers/gpu/drm/radeon/evergreend.h |
457 |
++++ b/drivers/gpu/drm/radeon/evergreend.h |
458 |
+@@ -230,6 +230,7 @@ |
459 |
+ #define MC_VM_MD_L1_TLB0_CNTL 0x2654 |
460 |
+ #define MC_VM_MD_L1_TLB1_CNTL 0x2658 |
461 |
+ #define MC_VM_MD_L1_TLB2_CNTL 0x265C |
462 |
++#define MC_VM_MD_L1_TLB3_CNTL 0x2698 |
463 |
+ |
464 |
+ #define FUS_MC_VM_MD_L1_TLB0_CNTL 0x265C |
465 |
+ #define FUS_MC_VM_MD_L1_TLB1_CNTL 0x2660 |
466 |
+diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c |
467 |
+index a324564..ef6b426 100644 |
468 |
+--- a/drivers/gpu/drm/radeon/radeon_atombios.c |
469 |
++++ b/drivers/gpu/drm/radeon/radeon_atombios.c |
470 |
+@@ -480,7 +480,9 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, |
471 |
+ */ |
472 |
+ if ((dev->pdev->device == 0x9498) && |
473 |
+ (dev->pdev->subsystem_vendor == 0x1682) && |
474 |
+- (dev->pdev->subsystem_device == 0x2452)) { |
475 |
++ (dev->pdev->subsystem_device == 0x2452) && |
476 |
++ (i2c_bus->valid == false) && |
477 |
++ !(supported_device & (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT))) { |
478 |
+ struct radeon_device *rdev = dev->dev_private; |
479 |
+ *i2c_bus = radeon_lookup_i2c_gpio(rdev, 0x93); |
480 |
+ } |
481 |
+diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c |
482 |
+index 84cf82f..51d20aa 100644 |
483 |
+--- a/drivers/gpu/drm/radeon/rv770.c |
484 |
++++ b/drivers/gpu/drm/radeon/rv770.c |
485 |
+@@ -151,6 +151,8 @@ int rv770_pcie_gart_enable(struct radeon_device *rdev) |
486 |
+ WREG32(MC_VM_MD_L1_TLB0_CNTL, tmp); |
487 |
+ WREG32(MC_VM_MD_L1_TLB1_CNTL, tmp); |
488 |
+ WREG32(MC_VM_MD_L1_TLB2_CNTL, tmp); |
489 |
++ if (rdev->family == CHIP_RV740) |
490 |
++ WREG32(MC_VM_MD_L1_TLB3_CNTL, tmp); |
491 |
+ WREG32(MC_VM_MB_L1_TLB0_CNTL, tmp); |
492 |
+ WREG32(MC_VM_MB_L1_TLB1_CNTL, tmp); |
493 |
+ WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp); |
494 |
+diff --git a/drivers/gpu/drm/radeon/rv770d.h b/drivers/gpu/drm/radeon/rv770d.h |
495 |
+index 79fa588..7538092 100644 |
496 |
+--- a/drivers/gpu/drm/radeon/rv770d.h |
497 |
++++ b/drivers/gpu/drm/radeon/rv770d.h |
498 |
+@@ -174,6 +174,7 @@ |
499 |
+ #define MC_VM_MD_L1_TLB0_CNTL 0x2654 |
500 |
+ #define MC_VM_MD_L1_TLB1_CNTL 0x2658 |
501 |
+ #define MC_VM_MD_L1_TLB2_CNTL 0x265C |
502 |
++#define MC_VM_MD_L1_TLB3_CNTL 0x2698 |
503 |
+ #define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C |
504 |
+ #define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038 |
505 |
+ #define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034 |
506 |
+diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c |
507 |
+index 81b6850..7632edb 100644 |
508 |
+--- a/drivers/gpu/drm/ttm/ttm_bo.c |
509 |
++++ b/drivers/gpu/drm/ttm/ttm_bo.c |
510 |
+@@ -1809,6 +1809,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink) |
511 |
+ spin_unlock(&glob->lru_lock); |
512 |
+ (void) ttm_bo_cleanup_refs(bo, false, false, false); |
513 |
+ kref_put(&bo->list_kref, ttm_bo_release_list); |
514 |
++ spin_lock(&glob->lru_lock); |
515 |
+ continue; |
516 |
+ } |
517 |
+ |
518 |
+diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c |
519 |
+index ccbeaa1..cc81cd6 100644 |
520 |
+--- a/drivers/mtd/nand/nand_bbt.c |
521 |
++++ b/drivers/mtd/nand/nand_bbt.c |
522 |
+@@ -360,6 +360,7 @@ static int scan_read_raw_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs, |
523 |
+ |
524 |
+ buf += mtd->oobsize + mtd->writesize; |
525 |
+ len -= mtd->writesize; |
526 |
++ offs += mtd->writesize; |
527 |
+ } |
528 |
+ return 0; |
529 |
+ } |
530 |
+diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c |
531 |
+index ab4723d..735f726 100644 |
532 |
+--- a/drivers/net/macvlan.c |
533 |
++++ b/drivers/net/macvlan.c |
534 |
+@@ -247,7 +247,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) |
535 |
+ |
536 |
+ xmit_world: |
537 |
+ skb->ip_summed = ip_summed; |
538 |
+- skb_set_dev(skb, vlan->lowerdev); |
539 |
++ skb->dev = vlan->lowerdev; |
540 |
+ return dev_queue_xmit(skb); |
541 |
+ } |
542 |
+ |
543 |
+diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c |
544 |
+index 592b0cf..2aed7a0 100644 |
545 |
+--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c |
546 |
++++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c |
547 |
+@@ -878,6 +878,7 @@ static void rs_bt_update_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
548 |
+ if ((priv->bt_traffic_load != priv->last_bt_traffic_load) || |
549 |
+ (priv->bt_full_concurrent != full_concurrent)) { |
550 |
+ priv->bt_full_concurrent = full_concurrent; |
551 |
++ priv->last_bt_traffic_load = priv->bt_traffic_load; |
552 |
+ |
553 |
+ /* Update uCode's rate table. */ |
554 |
+ tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); |
555 |
+diff --git a/drivers/net/wireless/wl1251/sdio.c b/drivers/net/wireless/wl1251/sdio.c |
556 |
+index 85a7101..4cf5c2e 100644 |
557 |
+--- a/drivers/net/wireless/wl1251/sdio.c |
558 |
++++ b/drivers/net/wireless/wl1251/sdio.c |
559 |
+@@ -259,6 +259,7 @@ static int wl1251_sdio_probe(struct sdio_func *func, |
560 |
+ } |
561 |
+ |
562 |
+ if (wl->irq) { |
563 |
++ irq_set_status_flags(wl->irq, IRQ_NOAUTOEN); |
564 |
+ ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl); |
565 |
+ if (ret < 0) { |
566 |
+ wl1251_error("request_irq() failed: %d", ret); |
567 |
+@@ -266,7 +267,6 @@ static int wl1251_sdio_probe(struct sdio_func *func, |
568 |
+ } |
569 |
+ |
570 |
+ irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING); |
571 |
+- disable_irq(wl->irq); |
572 |
+ |
573 |
+ wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq; |
574 |
+ wl1251_sdio_ops.disable_irq = wl1251_disable_line_irq; |
575 |
+diff --git a/drivers/net/wireless/wl1251/spi.c b/drivers/net/wireless/wl1251/spi.c |
576 |
+index af6448c..49f3651 100644 |
577 |
+--- a/drivers/net/wireless/wl1251/spi.c |
578 |
++++ b/drivers/net/wireless/wl1251/spi.c |
579 |
+@@ -280,6 +280,7 @@ static int __devinit wl1251_spi_probe(struct spi_device *spi) |
580 |
+ |
581 |
+ wl->use_eeprom = pdata->use_eeprom; |
582 |
+ |
583 |
++ irq_set_status_flags(wl->irq, IRQ_NOAUTOEN); |
584 |
+ ret = request_irq(wl->irq, wl1251_irq, 0, DRIVER_NAME, wl); |
585 |
+ if (ret < 0) { |
586 |
+ wl1251_error("request_irq() failed: %d", ret); |
587 |
+@@ -288,8 +289,6 @@ static int __devinit wl1251_spi_probe(struct spi_device *spi) |
588 |
+ |
589 |
+ irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING); |
590 |
+ |
591 |
+- disable_irq(wl->irq); |
592 |
+- |
593 |
+ ret = wl1251_init_ieee80211(wl); |
594 |
+ if (ret) |
595 |
+ goto out_irq; |
596 |
+diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c |
597 |
+index 72ab1e6..99fc45b 100644 |
598 |
+--- a/drivers/scsi/scsi_lib.c |
599 |
++++ b/drivers/scsi/scsi_lib.c |
600 |
+@@ -1380,16 +1380,19 @@ static int scsi_lld_busy(struct request_queue *q) |
601 |
+ { |
602 |
+ struct scsi_device *sdev = q->queuedata; |
603 |
+ struct Scsi_Host *shost; |
604 |
+- struct scsi_target *starget; |
605 |
+ |
606 |
+ if (!sdev) |
607 |
+ return 0; |
608 |
+ |
609 |
+ shost = sdev->host; |
610 |
+- starget = scsi_target(sdev); |
611 |
+ |
612 |
+- if (scsi_host_in_recovery(shost) || scsi_host_is_busy(shost) || |
613 |
+- scsi_target_is_busy(starget) || scsi_device_is_busy(sdev)) |
614 |
++ /* |
615 |
++ * Ignore host/starget busy state. |
616 |
++ * Since block layer does not have a concept of fairness across |
617 |
++ * multiple queues, congestion of host/starget needs to be handled |
618 |
++ * in SCSI layer. |
619 |
++ */ |
620 |
++ if (scsi_host_in_recovery(shost) || scsi_device_is_busy(sdev)) |
621 |
+ return 1; |
622 |
+ |
623 |
+ return 0; |
624 |
+diff --git a/drivers/scsi/scsi_wait_scan.c b/drivers/scsi/scsi_wait_scan.c |
625 |
+index 74708fc..ae78148 100644 |
626 |
+--- a/drivers/scsi/scsi_wait_scan.c |
627 |
++++ b/drivers/scsi/scsi_wait_scan.c |
628 |
+@@ -12,7 +12,7 @@ |
629 |
+ |
630 |
+ #include <linux/module.h> |
631 |
+ #include <linux/device.h> |
632 |
+-#include <scsi/scsi_scan.h> |
633 |
++#include "scsi_priv.h" |
634 |
+ |
635 |
+ static int __init wait_scan_init(void) |
636 |
+ { |
637 |
+diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h |
638 |
+index 6255fa8..7cb9dd2 100644 |
639 |
+--- a/fs/cifs/cifsglob.h |
640 |
++++ b/fs/cifs/cifsglob.h |
641 |
+@@ -43,6 +43,7 @@ |
642 |
+ |
643 |
+ #define CIFS_MIN_RCV_POOL 4 |
644 |
+ |
645 |
++#define MAX_REOPEN_ATT 5 /* these many maximum attempts to reopen a file */ |
646 |
+ /* |
647 |
+ * default attribute cache timeout (jiffies) |
648 |
+ */ |
649 |
+diff --git a/fs/cifs/file.c b/fs/cifs/file.c |
650 |
+index a9b4a24..9040cb0 100644 |
651 |
+--- a/fs/cifs/file.c |
652 |
++++ b/fs/cifs/file.c |
653 |
+@@ -973,10 +973,11 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode, |
654 |
+ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode, |
655 |
+ bool fsuid_only) |
656 |
+ { |
657 |
+- struct cifsFileInfo *open_file; |
658 |
++ struct cifsFileInfo *open_file, *inv_file = NULL; |
659 |
+ struct cifs_sb_info *cifs_sb; |
660 |
+ bool any_available = false; |
661 |
+ int rc; |
662 |
++ unsigned int refind = 0; |
663 |
+ |
664 |
+ /* Having a null inode here (because mapping->host was set to zero by |
665 |
+ the VFS or MM) should not happen but we had reports of on oops (due to |
666 |
+@@ -996,40 +997,25 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode, |
667 |
+ |
668 |
+ spin_lock(&cifs_file_list_lock); |
669 |
+ refind_writable: |
670 |
++ if (refind > MAX_REOPEN_ATT) { |
671 |
++ spin_unlock(&cifs_file_list_lock); |
672 |
++ return NULL; |
673 |
++ } |
674 |
+ list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { |
675 |
+ if (!any_available && open_file->pid != current->tgid) |
676 |
+ continue; |
677 |
+ if (fsuid_only && open_file->uid != current_fsuid()) |
678 |
+ continue; |
679 |
+ if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) { |
680 |
+- cifsFileInfo_get(open_file); |
681 |
+- |
682 |
+ if (!open_file->invalidHandle) { |
683 |
+ /* found a good writable file */ |
684 |
++ cifsFileInfo_get(open_file); |
685 |
+ spin_unlock(&cifs_file_list_lock); |
686 |
+ return open_file; |
687 |
++ } else { |
688 |
++ if (!inv_file) |
689 |
++ inv_file = open_file; |
690 |
+ } |
691 |
+- |
692 |
+- spin_unlock(&cifs_file_list_lock); |
693 |
+- |
694 |
+- /* Had to unlock since following call can block */ |
695 |
+- rc = cifs_reopen_file(open_file, false); |
696 |
+- if (!rc) |
697 |
+- return open_file; |
698 |
+- |
699 |
+- /* if it fails, try another handle if possible */ |
700 |
+- cFYI(1, "wp failed on reopen file"); |
701 |
+- cifsFileInfo_put(open_file); |
702 |
+- |
703 |
+- spin_lock(&cifs_file_list_lock); |
704 |
+- |
705 |
+- /* else we simply continue to the next entry. Thus |
706 |
+- we do not loop on reopen errors. If we |
707 |
+- can not reopen the file, for example if we |
708 |
+- reconnected to a server with another client |
709 |
+- racing to delete or lock the file we would not |
710 |
+- make progress if we restarted before the beginning |
711 |
+- of the loop here. */ |
712 |
+ } |
713 |
+ } |
714 |
+ /* couldn't find useable FH with same pid, try any available */ |
715 |
+@@ -1037,7 +1023,30 @@ refind_writable: |
716 |
+ any_available = true; |
717 |
+ goto refind_writable; |
718 |
+ } |
719 |
++ |
720 |
++ if (inv_file) { |
721 |
++ any_available = false; |
722 |
++ cifsFileInfo_get(inv_file); |
723 |
++ } |
724 |
++ |
725 |
+ spin_unlock(&cifs_file_list_lock); |
726 |
++ |
727 |
++ if (inv_file) { |
728 |
++ rc = cifs_reopen_file(inv_file, false); |
729 |
++ if (!rc) |
730 |
++ return inv_file; |
731 |
++ else { |
732 |
++ spin_lock(&cifs_file_list_lock); |
733 |
++ list_move_tail(&inv_file->flist, |
734 |
++ &cifs_inode->openFileList); |
735 |
++ spin_unlock(&cifs_file_list_lock); |
736 |
++ cifsFileInfo_put(inv_file); |
737 |
++ spin_lock(&cifs_file_list_lock); |
738 |
++ ++refind; |
739 |
++ goto refind_writable; |
740 |
++ } |
741 |
++ } |
742 |
++ |
743 |
+ return NULL; |
744 |
+ } |
745 |
+ |
746 |
+diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c |
747 |
+index 808c554..4cbe1c2 100644 |
748 |
+--- a/fs/ext4/ioctl.c |
749 |
++++ b/fs/ext4/ioctl.c |
750 |
+@@ -35,7 +35,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
751 |
+ handle_t *handle = NULL; |
752 |
+ int err, migrate = 0; |
753 |
+ struct ext4_iloc iloc; |
754 |
+- unsigned int oldflags; |
755 |
++ unsigned int oldflags, mask, i; |
756 |
+ unsigned int jflag; |
757 |
+ |
758 |
+ if (!inode_owner_or_capable(inode)) |
759 |
+@@ -112,9 +112,14 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
760 |
+ if (err) |
761 |
+ goto flags_err; |
762 |
+ |
763 |
+- flags = flags & EXT4_FL_USER_MODIFIABLE; |
764 |
+- flags |= oldflags & ~EXT4_FL_USER_MODIFIABLE; |
765 |
+- ei->i_flags = flags; |
766 |
++ for (i = 0, mask = 1; i < 32; i++, mask <<= 1) { |
767 |
++ if (!(mask & EXT4_FL_USER_MODIFIABLE)) |
768 |
++ continue; |
769 |
++ if (mask & flags) |
770 |
++ ext4_set_inode_flag(inode, i); |
771 |
++ else |
772 |
++ ext4_clear_inode_flag(inode, i); |
773 |
++ } |
774 |
+ |
775 |
+ ext4_set_inode_flags(inode); |
776 |
+ inode->i_ctime = ext4_current_time(inode); |
777 |
+diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c |
778 |
+index 0f1be7f..b6adf68 100644 |
779 |
+--- a/fs/ext4/mballoc.c |
780 |
++++ b/fs/ext4/mballoc.c |
781 |
+@@ -2528,6 +2528,9 @@ int ext4_mb_release(struct super_block *sb) |
782 |
+ struct ext4_sb_info *sbi = EXT4_SB(sb); |
783 |
+ struct kmem_cache *cachep = get_groupinfo_cache(sb->s_blocksize_bits); |
784 |
+ |
785 |
++ if (sbi->s_proc) |
786 |
++ remove_proc_entry("mb_groups", sbi->s_proc); |
787 |
++ |
788 |
+ if (sbi->s_group_info) { |
789 |
+ for (i = 0; i < ngroups; i++) { |
790 |
+ grinfo = ext4_get_group_info(sb, i); |
791 |
+@@ -2575,8 +2578,6 @@ int ext4_mb_release(struct super_block *sb) |
792 |
+ } |
793 |
+ |
794 |
+ free_percpu(sbi->s_locality_groups); |
795 |
+- if (sbi->s_proc) |
796 |
+- remove_proc_entry("mb_groups", sbi->s_proc); |
797 |
+ |
798 |
+ return 0; |
799 |
+ } |
800 |
+@@ -4583,6 +4584,7 @@ do_more: |
801 |
+ */ |
802 |
+ new_entry = kmem_cache_alloc(ext4_free_ext_cachep, GFP_NOFS); |
803 |
+ if (!new_entry) { |
804 |
++ ext4_mb_unload_buddy(&e4b); |
805 |
+ err = -ENOMEM; |
806 |
+ goto error_return; |
807 |
+ } |
808 |
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c |
809 |
+index df121b2..113b107 100644 |
810 |
+--- a/fs/ext4/super.c |
811 |
++++ b/fs/ext4/super.c |
812 |
+@@ -433,6 +433,7 @@ void __ext4_error(struct super_block *sb, const char *function, |
813 |
+ printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: comm %s: %pV\n", |
814 |
+ sb->s_id, function, line, current->comm, &vaf); |
815 |
+ va_end(args); |
816 |
++ save_error_info(sb, function, line); |
817 |
+ |
818 |
+ ext4_handle_error(sb); |
819 |
+ } |
820 |
+@@ -3618,7 +3619,8 @@ no_journal: |
821 |
+ goto failed_mount4; |
822 |
+ } |
823 |
+ |
824 |
+- ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY); |
825 |
++ if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY)) |
826 |
++ sb->s_flags |= MS_RDONLY; |
827 |
+ |
828 |
+ /* determine the minimum size of new large inodes, if present */ |
829 |
+ if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) { |
830 |
+diff --git a/fs/namespace.c b/fs/namespace.c |
831 |
+index edc1c4a..b3d8f51 100644 |
832 |
+--- a/fs/namespace.c |
833 |
++++ b/fs/namespace.c |
834 |
+@@ -1244,8 +1244,9 @@ void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill) |
835 |
+ list_del_init(&p->mnt_expire); |
836 |
+ list_del_init(&p->mnt_list); |
837 |
+ __touch_mnt_namespace(p->mnt_ns); |
838 |
++ if (p->mnt_ns) |
839 |
++ __mnt_make_shortterm(p); |
840 |
+ p->mnt_ns = NULL; |
841 |
+- __mnt_make_shortterm(p); |
842 |
+ list_del_init(&p->mnt_child); |
843 |
+ if (p->mnt_parent != p) { |
844 |
+ p->mnt_parent->mnt_ghosts++; |
845 |
+diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c |
846 |
+index 30f6548..b7a7e5f 100644 |
847 |
+--- a/fs/nfs/nfs4proc.c |
848 |
++++ b/fs/nfs/nfs4proc.c |
849 |
+@@ -94,6 +94,8 @@ static int nfs4_map_errors(int err) |
850 |
+ case -NFS4ERR_BADOWNER: |
851 |
+ case -NFS4ERR_BADNAME: |
852 |
+ return -EINVAL; |
853 |
++ case -NFS4ERR_SHARE_DENIED: |
854 |
++ return -EACCES; |
855 |
+ default: |
856 |
+ dprintk("%s could not handle NFSv4 error %d\n", |
857 |
+ __func__, -err); |
858 |
+diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h |
859 |
+index a03c098..831924a 100644 |
860 |
+--- a/include/asm-generic/pgtable.h |
861 |
++++ b/include/asm-generic/pgtable.h |
862 |
+@@ -445,6 +445,18 @@ static inline int pmd_write(pmd_t pmd) |
863 |
+ #endif /* __HAVE_ARCH_PMD_WRITE */ |
864 |
+ #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
865 |
+ |
866 |
++#ifndef pmd_read_atomic |
867 |
++static inline pmd_t pmd_read_atomic(pmd_t *pmdp) |
868 |
++{ |
869 |
++ /* |
870 |
++ * Depend on compiler for an atomic pmd read. NOTE: this is |
871 |
++ * only going to work, if the pmdval_t isn't larger than |
872 |
++ * an unsigned long. |
873 |
++ */ |
874 |
++ return *pmdp; |
875 |
++} |
876 |
++#endif |
877 |
++ |
878 |
+ /* |
879 |
+ * This function is meant to be used by sites walking pagetables with |
880 |
+ * the mmap_sem hold in read mode to protect against MADV_DONTNEED and |
881 |
+@@ -458,11 +470,17 @@ static inline int pmd_write(pmd_t pmd) |
882 |
+ * undefined so behaving like if the pmd was none is safe (because it |
883 |
+ * can return none anyway). The compiler level barrier() is critically |
884 |
+ * important to compute the two checks atomically on the same pmdval. |
885 |
++ * |
886 |
++ * For 32bit kernels with a 64bit large pmd_t this automatically takes |
887 |
++ * care of reading the pmd atomically to avoid SMP race conditions |
888 |
++ * against pmd_populate() when the mmap_sem is hold for reading by the |
889 |
++ * caller (a special atomic read not done by "gcc" as in the generic |
890 |
++ * version above, is also needed when THP is disabled because the page |
891 |
++ * fault can populate the pmd from under us). |
892 |
+ */ |
893 |
+ static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd) |
894 |
+ { |
895 |
+- /* depend on compiler for an atomic pmd read */ |
896 |
+- pmd_t pmdval = *pmd; |
897 |
++ pmd_t pmdval = pmd_read_atomic(pmd); |
898 |
+ /* |
899 |
+ * The barrier will stabilize the pmdval in a register or on |
900 |
+ * the stack so that it will stop changing under the code. |
901 |
+diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h |
902 |
+index 14b6cd0..4306811 100644 |
903 |
+--- a/include/drm/drm_pciids.h |
904 |
++++ b/include/drm/drm_pciids.h |
905 |
+@@ -181,6 +181,7 @@ |
906 |
+ {0x1002, 0x6747, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ |
907 |
+ {0x1002, 0x6748, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ |
908 |
+ {0x1002, 0x6749, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ |
909 |
++ {0x1002, 0x674A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ |
910 |
+ {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ |
911 |
+ {0x1002, 0x6751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ |
912 |
+ {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ |
913 |
+@@ -198,6 +199,7 @@ |
914 |
+ {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ |
915 |
+ {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ |
916 |
+ {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ |
917 |
++ {0x1002, 0x6771, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ |
918 |
+ {0x1002, 0x6772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ |
919 |
+ {0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ |
920 |
+ {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ |
921 |
+diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h |
922 |
+index 33b5968..c6d6d48 100644 |
923 |
+--- a/include/linux/netdevice.h |
924 |
++++ b/include/linux/netdevice.h |
925 |
+@@ -1453,15 +1453,6 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev) |
926 |
+ return 0; |
927 |
+ } |
928 |
+ |
929 |
+-#ifndef CONFIG_NET_NS |
930 |
+-static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev) |
931 |
+-{ |
932 |
+- skb->dev = dev; |
933 |
+-} |
934 |
+-#else /* CONFIG_NET_NS */ |
935 |
+-void skb_set_dev(struct sk_buff *skb, struct net_device *dev); |
936 |
+-#endif |
937 |
+- |
938 |
+ static inline bool netdev_uses_trailer_tags(struct net_device *dev) |
939 |
+ { |
940 |
+ #ifdef CONFIG_NET_DSA_TAG_TRAILER |
941 |
+diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h |
942 |
+index f13b52b..37b643b 100644 |
943 |
+--- a/include/linux/skbuff.h |
944 |
++++ b/include/linux/skbuff.h |
945 |
+@@ -1633,8 +1633,6 @@ static inline int __skb_cow(struct sk_buff *skb, unsigned int headroom, |
946 |
+ { |
947 |
+ int delta = 0; |
948 |
+ |
949 |
+- if (headroom < NET_SKB_PAD) |
950 |
+- headroom = NET_SKB_PAD; |
951 |
+ if (headroom > skb_headroom(skb)) |
952 |
+ delta = headroom - skb_headroom(skb); |
953 |
+ |
954 |
+diff --git a/include/net/dst.h b/include/net/dst.h |
955 |
+index d020134..7907ff1 100644 |
956 |
+--- a/include/net/dst.h |
957 |
++++ b/include/net/dst.h |
958 |
+@@ -78,6 +78,7 @@ struct dst_entry { |
959 |
+ #define DST_NOHASH 0x0008 |
960 |
+ #define DST_NOCACHE 0x0010 |
961 |
+ #define DST_NOCOUNT 0x0020 |
962 |
++#define DST_XFRM_TUNNEL 0x0100 |
963 |
+ union { |
964 |
+ struct dst_entry *next; |
965 |
+ struct rtable __rcu *rt_next; |
966 |
+diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h |
967 |
+index b2c2366..f686066 100644 |
968 |
+--- a/include/net/sctp/sctp.h |
969 |
++++ b/include/net/sctp/sctp.h |
970 |
+@@ -700,4 +700,17 @@ static inline void sctp_v4_map_v6(union sctp_addr *addr) |
971 |
+ addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); |
972 |
+ } |
973 |
+ |
974 |
++/* The cookie is always 0 since this is how it's used in the |
975 |
++ * pmtu code. |
976 |
++ */ |
977 |
++static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) |
978 |
++{ |
979 |
++ if (t->dst && !dst_check(t->dst, 0)) { |
980 |
++ dst_release(t->dst); |
981 |
++ t->dst = NULL; |
982 |
++ } |
983 |
++ |
984 |
++ return t->dst; |
985 |
++} |
986 |
++ |
987 |
+ #endif /* __net_sctp_h__ */ |
988 |
+diff --git a/mm/vmscan.c b/mm/vmscan.c |
989 |
+index 6072d74..769935d 100644 |
990 |
+--- a/mm/vmscan.c |
991 |
++++ b/mm/vmscan.c |
992 |
+@@ -665,7 +665,7 @@ static enum page_references page_check_references(struct page *page, |
993 |
+ return PAGEREF_RECLAIM; |
994 |
+ |
995 |
+ if (referenced_ptes) { |
996 |
+- if (PageAnon(page)) |
997 |
++ if (PageSwapBacked(page)) |
998 |
+ return PAGEREF_ACTIVATE; |
999 |
+ /* |
1000 |
+ * All mapped pages start out with page table |
1001 |
+diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c |
1002 |
+index 5b4f51d..d548456 100644 |
1003 |
+--- a/net/8021q/vlan_dev.c |
1004 |
++++ b/net/8021q/vlan_dev.c |
1005 |
+@@ -154,7 +154,7 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb, |
1006 |
+ skb = __vlan_hwaccel_put_tag(skb, vlan_tci); |
1007 |
+ } |
1008 |
+ |
1009 |
+- skb_set_dev(skb, vlan_dev_info(dev)->real_dev); |
1010 |
++ skb->dev = vlan_dev_info(dev)->real_dev; |
1011 |
+ len = skb->len; |
1012 |
+ ret = dev_queue_xmit(skb); |
1013 |
+ |
1014 |
+diff --git a/net/core/dev.c b/net/core/dev.c |
1015 |
+index 1e77897..a71eafc 100644 |
1016 |
+--- a/net/core/dev.c |
1017 |
++++ b/net/core/dev.c |
1018 |
+@@ -1533,10 +1533,14 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) |
1019 |
+ kfree_skb(skb); |
1020 |
+ return NET_RX_DROP; |
1021 |
+ } |
1022 |
+- skb_set_dev(skb, dev); |
1023 |
++ skb->dev = dev; |
1024 |
++ skb_dst_drop(skb); |
1025 |
+ skb->tstamp.tv64 = 0; |
1026 |
+ skb->pkt_type = PACKET_HOST; |
1027 |
+ skb->protocol = eth_type_trans(skb, dev); |
1028 |
++ skb->mark = 0; |
1029 |
++ secpath_reset(skb); |
1030 |
++ nf_reset(skb); |
1031 |
+ return netif_rx(skb); |
1032 |
+ } |
1033 |
+ EXPORT_SYMBOL_GPL(dev_forward_skb); |
1034 |
+@@ -1791,36 +1795,6 @@ void netif_device_attach(struct net_device *dev) |
1035 |
+ } |
1036 |
+ EXPORT_SYMBOL(netif_device_attach); |
1037 |
+ |
1038 |
+-/** |
1039 |
+- * skb_dev_set -- assign a new device to a buffer |
1040 |
+- * @skb: buffer for the new device |
1041 |
+- * @dev: network device |
1042 |
+- * |
1043 |
+- * If an skb is owned by a device already, we have to reset |
1044 |
+- * all data private to the namespace a device belongs to |
1045 |
+- * before assigning it a new device. |
1046 |
+- */ |
1047 |
+-#ifdef CONFIG_NET_NS |
1048 |
+-void skb_set_dev(struct sk_buff *skb, struct net_device *dev) |
1049 |
+-{ |
1050 |
+- skb_dst_drop(skb); |
1051 |
+- if (skb->dev && !net_eq(dev_net(skb->dev), dev_net(dev))) { |
1052 |
+- secpath_reset(skb); |
1053 |
+- nf_reset(skb); |
1054 |
+- skb_init_secmark(skb); |
1055 |
+- skb->mark = 0; |
1056 |
+- skb->priority = 0; |
1057 |
+- skb->nf_trace = 0; |
1058 |
+- skb->ipvs_property = 0; |
1059 |
+-#ifdef CONFIG_NET_SCHED |
1060 |
+- skb->tc_index = 0; |
1061 |
+-#endif |
1062 |
+- } |
1063 |
+- skb->dev = dev; |
1064 |
+-} |
1065 |
+-EXPORT_SYMBOL(skb_set_dev); |
1066 |
+-#endif /* CONFIG_NET_NS */ |
1067 |
+- |
1068 |
+ /* |
1069 |
+ * Invalidate hardware checksum when packet is to be mangled, and |
1070 |
+ * complete checksum manually on outgoing path. |
1071 |
+diff --git a/net/core/pktgen.c b/net/core/pktgen.c |
1072 |
+index e35a6fb..c0e0f76 100644 |
1073 |
+--- a/net/core/pktgen.c |
1074 |
++++ b/net/core/pktgen.c |
1075 |
+@@ -1932,7 +1932,7 @@ static int pktgen_device_event(struct notifier_block *unused, |
1076 |
+ { |
1077 |
+ struct net_device *dev = ptr; |
1078 |
+ |
1079 |
+- if (!net_eq(dev_net(dev), &init_net)) |
1080 |
++ if (!net_eq(dev_net(dev), &init_net) || pktgen_exiting) |
1081 |
+ return NOTIFY_DONE; |
1082 |
+ |
1083 |
+ /* It is OK that we do not hold the group lock right now, |
1084 |
+@@ -3755,12 +3755,18 @@ static void __exit pg_cleanup(void) |
1085 |
+ { |
1086 |
+ struct pktgen_thread *t; |
1087 |
+ struct list_head *q, *n; |
1088 |
++ LIST_HEAD(list); |
1089 |
+ |
1090 |
+ /* Stop all interfaces & threads */ |
1091 |
+ pktgen_exiting = true; |
1092 |
+ |
1093 |
+- list_for_each_safe(q, n, &pktgen_threads) { |
1094 |
++ mutex_lock(&pktgen_thread_lock); |
1095 |
++ list_splice_init(&pktgen_threads, &list); |
1096 |
++ mutex_unlock(&pktgen_thread_lock); |
1097 |
++ |
1098 |
++ list_for_each_safe(q, n, &list) { |
1099 |
+ t = list_entry(q, struct pktgen_thread, th_list); |
1100 |
++ list_del(&t->th_list); |
1101 |
+ kthread_stop(t->tsk); |
1102 |
+ kfree(t); |
1103 |
+ } |
1104 |
+diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c |
1105 |
+index a5b4134..530787b 100644 |
1106 |
+--- a/net/ipv4/esp4.c |
1107 |
++++ b/net/ipv4/esp4.c |
1108 |
+@@ -457,28 +457,22 @@ static u32 esp4_get_mtu(struct xfrm_state *x, int mtu) |
1109 |
+ struct esp_data *esp = x->data; |
1110 |
+ u32 blksize = ALIGN(crypto_aead_blocksize(esp->aead), 4); |
1111 |
+ u32 align = max_t(u32, blksize, esp->padlen); |
1112 |
+- u32 rem; |
1113 |
+- |
1114 |
+- mtu -= x->props.header_len + crypto_aead_authsize(esp->aead); |
1115 |
+- rem = mtu & (align - 1); |
1116 |
+- mtu &= ~(align - 1); |
1117 |
++ unsigned int net_adj; |
1118 |
+ |
1119 |
+ switch (x->props.mode) { |
1120 |
+- case XFRM_MODE_TUNNEL: |
1121 |
+- break; |
1122 |
+- default: |
1123 |
+ case XFRM_MODE_TRANSPORT: |
1124 |
+- /* The worst case */ |
1125 |
+- mtu -= blksize - 4; |
1126 |
+- mtu += min_t(u32, blksize - 4, rem); |
1127 |
+- break; |
1128 |
+ case XFRM_MODE_BEET: |
1129 |
+- /* The worst case. */ |
1130 |
+- mtu += min_t(u32, IPV4_BEET_PHMAXLEN, rem); |
1131 |
++ net_adj = sizeof(struct iphdr); |
1132 |
+ break; |
1133 |
++ case XFRM_MODE_TUNNEL: |
1134 |
++ net_adj = 0; |
1135 |
++ break; |
1136 |
++ default: |
1137 |
++ BUG(); |
1138 |
+ } |
1139 |
+ |
1140 |
+- return mtu - 2; |
1141 |
++ return ((mtu - x->props.header_len - crypto_aead_authsize(esp->aead) - |
1142 |
++ net_adj) & ~(align - 1)) + (net_adj - 2); |
1143 |
+ } |
1144 |
+ |
1145 |
+ static void esp4_err(struct sk_buff *skb, u32 info) |
1146 |
+diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c |
1147 |
+index 33e2c35..7e454ba 100644 |
1148 |
+--- a/net/ipv4/fib_semantics.c |
1149 |
++++ b/net/ipv4/fib_semantics.c |
1150 |
+@@ -142,6 +142,18 @@ const struct fib_prop fib_props[RTN_MAX + 1] = { |
1151 |
+ }; |
1152 |
+ |
1153 |
+ /* Release a nexthop info record */ |
1154 |
++static void free_fib_info_rcu(struct rcu_head *head) |
1155 |
++{ |
1156 |
++ struct fib_info *fi = container_of(head, struct fib_info, rcu); |
1157 |
++ |
1158 |
++ change_nexthops(fi) { |
1159 |
++ if (nexthop_nh->nh_dev) |
1160 |
++ dev_put(nexthop_nh->nh_dev); |
1161 |
++ } endfor_nexthops(fi); |
1162 |
++ |
1163 |
++ release_net(fi->fib_net); |
1164 |
++ kfree(fi); |
1165 |
++} |
1166 |
+ |
1167 |
+ void free_fib_info(struct fib_info *fi) |
1168 |
+ { |
1169 |
+@@ -149,14 +161,8 @@ void free_fib_info(struct fib_info *fi) |
1170 |
+ pr_warning("Freeing alive fib_info %p\n", fi); |
1171 |
+ return; |
1172 |
+ } |
1173 |
+- change_nexthops(fi) { |
1174 |
+- if (nexthop_nh->nh_dev) |
1175 |
+- dev_put(nexthop_nh->nh_dev); |
1176 |
+- nexthop_nh->nh_dev = NULL; |
1177 |
+- } endfor_nexthops(fi); |
1178 |
+ fib_info_cnt--; |
1179 |
+- release_net(fi->fib_net); |
1180 |
+- kfree_rcu(fi, rcu); |
1181 |
++ call_rcu(&fi->rcu, free_fib_info_rcu); |
1182 |
+ } |
1183 |
+ |
1184 |
+ void fib_release_info(struct fib_info *fi) |
1185 |
+diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c |
1186 |
+index 58c25ea..0d884eb 100644 |
1187 |
+--- a/net/ipv4/fib_trie.c |
1188 |
++++ b/net/ipv4/fib_trie.c |
1189 |
+@@ -1371,6 +1371,8 @@ static int check_leaf(struct fib_table *tb, struct trie *t, struct leaf *l, |
1190 |
+ |
1191 |
+ if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos) |
1192 |
+ continue; |
1193 |
++ if (fi->fib_dead) |
1194 |
++ continue; |
1195 |
+ if (fa->fa_info->fib_scope < flp->flowi4_scope) |
1196 |
+ continue; |
1197 |
+ fib_alias_accessed(fa); |
1198 |
+diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c |
1199 |
+index 1ac7938..65dd543 100644 |
1200 |
+--- a/net/ipv6/esp6.c |
1201 |
++++ b/net/ipv6/esp6.c |
1202 |
+@@ -411,19 +411,15 @@ static u32 esp6_get_mtu(struct xfrm_state *x, int mtu) |
1203 |
+ struct esp_data *esp = x->data; |
1204 |
+ u32 blksize = ALIGN(crypto_aead_blocksize(esp->aead), 4); |
1205 |
+ u32 align = max_t(u32, blksize, esp->padlen); |
1206 |
+- u32 rem; |
1207 |
++ unsigned int net_adj; |
1208 |
+ |
1209 |
+- mtu -= x->props.header_len + crypto_aead_authsize(esp->aead); |
1210 |
+- rem = mtu & (align - 1); |
1211 |
+- mtu &= ~(align - 1); |
1212 |
+- |
1213 |
+- if (x->props.mode != XFRM_MODE_TUNNEL) { |
1214 |
+- u32 padsize = ((blksize - 1) & 7) + 1; |
1215 |
+- mtu -= blksize - padsize; |
1216 |
+- mtu += min_t(u32, blksize - padsize, rem); |
1217 |
+- } |
1218 |
++ if (x->props.mode != XFRM_MODE_TUNNEL) |
1219 |
++ net_adj = sizeof(struct ipv6hdr); |
1220 |
++ else |
1221 |
++ net_adj = 0; |
1222 |
+ |
1223 |
+- return mtu - 2; |
1224 |
++ return ((mtu - x->props.header_len - crypto_aead_authsize(esp->aead) - |
1225 |
++ net_adj) & ~(align - 1)) + (net_adj - 2); |
1226 |
+ } |
1227 |
+ |
1228 |
+ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
1229 |
+diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c |
1230 |
+index 9cbf176..ae9f6d4 100644 |
1231 |
+--- a/net/ipv6/ip6_output.c |
1232 |
++++ b/net/ipv6/ip6_output.c |
1233 |
+@@ -1194,6 +1194,29 @@ static inline struct ipv6_rt_hdr *ip6_rthdr_dup(struct ipv6_rt_hdr *src, |
1234 |
+ return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL; |
1235 |
+ } |
1236 |
+ |
1237 |
++static void ip6_append_data_mtu(int *mtu, |
1238 |
++ int *maxfraglen, |
1239 |
++ unsigned int fragheaderlen, |
1240 |
++ struct sk_buff *skb, |
1241 |
++ struct rt6_info *rt) |
1242 |
++{ |
1243 |
++ if (!(rt->dst.flags & DST_XFRM_TUNNEL)) { |
1244 |
++ if (skb == NULL) { |
1245 |
++ /* first fragment, reserve header_len */ |
1246 |
++ *mtu = *mtu - rt->dst.header_len; |
1247 |
++ |
1248 |
++ } else { |
1249 |
++ /* |
1250 |
++ * this fragment is not first, the headers |
1251 |
++ * space is regarded as data space. |
1252 |
++ */ |
1253 |
++ *mtu = dst_mtu(rt->dst.path); |
1254 |
++ } |
1255 |
++ *maxfraglen = ((*mtu - fragheaderlen) & ~7) |
1256 |
++ + fragheaderlen - sizeof(struct frag_hdr); |
1257 |
++ } |
1258 |
++} |
1259 |
++ |
1260 |
+ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, |
1261 |
+ int offset, int len, int odd, struct sk_buff *skb), |
1262 |
+ void *from, int length, int transhdrlen, |
1263 |
+@@ -1203,7 +1226,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, |
1264 |
+ struct inet_sock *inet = inet_sk(sk); |
1265 |
+ struct ipv6_pinfo *np = inet6_sk(sk); |
1266 |
+ struct inet_cork *cork; |
1267 |
+- struct sk_buff *skb; |
1268 |
++ struct sk_buff *skb, *skb_prev = NULL; |
1269 |
+ unsigned int maxfraglen, fragheaderlen; |
1270 |
+ int exthdrlen; |
1271 |
+ int hh_len; |
1272 |
+@@ -1260,8 +1283,12 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, |
1273 |
+ inet->cork.fl.u.ip6 = *fl6; |
1274 |
+ np->cork.hop_limit = hlimit; |
1275 |
+ np->cork.tclass = tclass; |
1276 |
+- mtu = np->pmtudisc == IPV6_PMTUDISC_PROBE ? |
1277 |
+- rt->dst.dev->mtu : dst_mtu(rt->dst.path); |
1278 |
++ if (rt->dst.flags & DST_XFRM_TUNNEL) |
1279 |
++ mtu = np->pmtudisc == IPV6_PMTUDISC_PROBE ? |
1280 |
++ rt->dst.dev->mtu : dst_mtu(&rt->dst); |
1281 |
++ else |
1282 |
++ mtu = np->pmtudisc == IPV6_PMTUDISC_PROBE ? |
1283 |
++ rt->dst.dev->mtu : dst_mtu(rt->dst.path); |
1284 |
+ if (np->frag_size < mtu) { |
1285 |
+ if (np->frag_size) |
1286 |
+ mtu = np->frag_size; |
1287 |
+@@ -1356,38 +1383,43 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, |
1288 |
+ unsigned int fraglen; |
1289 |
+ unsigned int fraggap; |
1290 |
+ unsigned int alloclen; |
1291 |
+- struct sk_buff *skb_prev; |
1292 |
+ alloc_new_skb: |
1293 |
+- skb_prev = skb; |
1294 |
+- |
1295 |
+ /* There's no room in the current skb */ |
1296 |
+- if (skb_prev) |
1297 |
+- fraggap = skb_prev->len - maxfraglen; |
1298 |
++ if (skb) |
1299 |
++ fraggap = skb->len - maxfraglen; |
1300 |
+ else |
1301 |
+ fraggap = 0; |
1302 |
++ /* update mtu and maxfraglen if necessary */ |
1303 |
++ if (skb == NULL || skb_prev == NULL) |
1304 |
++ ip6_append_data_mtu(&mtu, &maxfraglen, |
1305 |
++ fragheaderlen, skb, rt); |
1306 |
++ |
1307 |
++ skb_prev = skb; |
1308 |
+ |
1309 |
+ /* |
1310 |
+ * If remaining data exceeds the mtu, |
1311 |
+ * we know we need more fragment(s). |
1312 |
+ */ |
1313 |
+ datalen = length + fraggap; |
1314 |
+- if (datalen > (cork->length <= mtu && !(cork->flags & IPCORK_ALLFRAG) ? mtu : maxfraglen) - fragheaderlen) |
1315 |
+- datalen = maxfraglen - fragheaderlen; |
1316 |
+ |
1317 |
+- fraglen = datalen + fragheaderlen; |
1318 |
++ if (datalen > (cork->length <= mtu && !(cork->flags & IPCORK_ALLFRAG) ? mtu : maxfraglen) - fragheaderlen) |
1319 |
++ datalen = maxfraglen - fragheaderlen - rt->dst.trailer_len; |
1320 |
+ if ((flags & MSG_MORE) && |
1321 |
+ !(rt->dst.dev->features&NETIF_F_SG)) |
1322 |
+ alloclen = mtu; |
1323 |
+ else |
1324 |
+ alloclen = datalen + fragheaderlen; |
1325 |
+ |
1326 |
+- /* |
1327 |
+- * The last fragment gets additional space at tail. |
1328 |
+- * Note: we overallocate on fragments with MSG_MODE |
1329 |
+- * because we have no idea if we're the last one. |
1330 |
+- */ |
1331 |
+- if (datalen == length + fraggap) |
1332 |
+- alloclen += rt->dst.trailer_len; |
1333 |
++ if (datalen != length + fraggap) { |
1334 |
++ /* |
1335 |
++ * this is not the last fragment, the trailer |
1336 |
++ * space is regarded as data space. |
1337 |
++ */ |
1338 |
++ datalen += rt->dst.trailer_len; |
1339 |
++ } |
1340 |
++ |
1341 |
++ alloclen += rt->dst.trailer_len; |
1342 |
++ fraglen = datalen + fragheaderlen; |
1343 |
+ |
1344 |
+ /* |
1345 |
+ * We just reserve space for fragment header. |
1346 |
+diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c |
1347 |
+index ea52d02..78bc442 100644 |
1348 |
+--- a/net/l2tp/l2tp_ip.c |
1349 |
++++ b/net/l2tp/l2tp_ip.c |
1350 |
+@@ -251,9 +251,16 @@ static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) |
1351 |
+ { |
1352 |
+ struct inet_sock *inet = inet_sk(sk); |
1353 |
+ struct sockaddr_l2tpip *addr = (struct sockaddr_l2tpip *) uaddr; |
1354 |
+- int ret = -EINVAL; |
1355 |
++ int ret; |
1356 |
+ int chk_addr_ret; |
1357 |
+ |
1358 |
++ if (!sock_flag(sk, SOCK_ZAPPED)) |
1359 |
++ return -EINVAL; |
1360 |
++ if (addr_len < sizeof(struct sockaddr_l2tpip)) |
1361 |
++ return -EINVAL; |
1362 |
++ if (addr->l2tp_family != AF_INET) |
1363 |
++ return -EINVAL; |
1364 |
++ |
1365 |
+ ret = -EADDRINUSE; |
1366 |
+ read_lock_bh(&l2tp_ip_lock); |
1367 |
+ if (__l2tp_ip_bind_lookup(&init_net, addr->l2tp_addr.s_addr, sk->sk_bound_dev_if, addr->l2tp_conn_id)) |
1368 |
+@@ -283,6 +290,8 @@ static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) |
1369 |
+ sk_del_node_init(sk); |
1370 |
+ write_unlock_bh(&l2tp_ip_lock); |
1371 |
+ ret = 0; |
1372 |
++ sock_reset_flag(sk, SOCK_ZAPPED); |
1373 |
++ |
1374 |
+ out: |
1375 |
+ release_sock(sk); |
1376 |
+ |
1377 |
+@@ -303,13 +312,14 @@ static int l2tp_ip_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len |
1378 |
+ __be32 saddr; |
1379 |
+ int oif, rc; |
1380 |
+ |
1381 |
+- rc = -EINVAL; |
1382 |
++ if (sock_flag(sk, SOCK_ZAPPED)) /* Must bind first - autobinding does not work */ |
1383 |
++ return -EINVAL; |
1384 |
++ |
1385 |
+ if (addr_len < sizeof(*lsa)) |
1386 |
+- goto out; |
1387 |
++ return -EINVAL; |
1388 |
+ |
1389 |
+- rc = -EAFNOSUPPORT; |
1390 |
+ if (lsa->l2tp_family != AF_INET) |
1391 |
+- goto out; |
1392 |
++ return -EAFNOSUPPORT; |
1393 |
+ |
1394 |
+ lock_sock(sk); |
1395 |
+ |
1396 |
+@@ -363,6 +373,14 @@ out: |
1397 |
+ return rc; |
1398 |
+ } |
1399 |
+ |
1400 |
++static int l2tp_ip_disconnect(struct sock *sk, int flags) |
1401 |
++{ |
1402 |
++ if (sock_flag(sk, SOCK_ZAPPED)) |
1403 |
++ return 0; |
1404 |
++ |
1405 |
++ return udp_disconnect(sk, flags); |
1406 |
++} |
1407 |
++ |
1408 |
+ static int l2tp_ip_getname(struct socket *sock, struct sockaddr *uaddr, |
1409 |
+ int *uaddr_len, int peer) |
1410 |
+ { |
1411 |
+@@ -591,7 +609,7 @@ static struct proto l2tp_ip_prot = { |
1412 |
+ .close = l2tp_ip_close, |
1413 |
+ .bind = l2tp_ip_bind, |
1414 |
+ .connect = l2tp_ip_connect, |
1415 |
+- .disconnect = udp_disconnect, |
1416 |
++ .disconnect = l2tp_ip_disconnect, |
1417 |
+ .ioctl = udp_ioctl, |
1418 |
+ .destroy = l2tp_ip_destroy_sock, |
1419 |
+ .setsockopt = ip_setsockopt, |
1420 |
+diff --git a/net/mac80211/util.c b/net/mac80211/util.c |
1421 |
+index 2124db8..11d9d49 100644 |
1422 |
+--- a/net/mac80211/util.c |
1423 |
++++ b/net/mac80211/util.c |
1424 |
+@@ -1254,6 +1254,12 @@ int ieee80211_reconfig(struct ieee80211_local *local) |
1425 |
+ } |
1426 |
+ } |
1427 |
+ |
1428 |
++ /* add back keys */ |
1429 |
++ list_for_each_entry(sdata, &local->interfaces, list) |
1430 |
++ if (ieee80211_sdata_running(sdata)) |
1431 |
++ ieee80211_enable_keys(sdata); |
1432 |
++ |
1433 |
++ wake_up: |
1434 |
+ /* |
1435 |
+ * Clear the WLAN_STA_BLOCK_BA flag so new aggregation |
1436 |
+ * sessions can be established after a resume. |
1437 |
+@@ -1275,12 +1281,6 @@ int ieee80211_reconfig(struct ieee80211_local *local) |
1438 |
+ mutex_unlock(&local->sta_mtx); |
1439 |
+ } |
1440 |
+ |
1441 |
+- /* add back keys */ |
1442 |
+- list_for_each_entry(sdata, &local->interfaces, list) |
1443 |
+- if (ieee80211_sdata_running(sdata)) |
1444 |
+- ieee80211_enable_keys(sdata); |
1445 |
+- |
1446 |
+- wake_up: |
1447 |
+ ieee80211_wake_queues_by_reason(hw, |
1448 |
+ IEEE80211_QUEUE_STOP_REASON_SUSPEND); |
1449 |
+ |
1450 |
+diff --git a/net/sctp/output.c b/net/sctp/output.c |
1451 |
+index 817174e..8fc4dcd 100644 |
1452 |
+--- a/net/sctp/output.c |
1453 |
++++ b/net/sctp/output.c |
1454 |
+@@ -377,9 +377,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) |
1455 |
+ */ |
1456 |
+ skb_set_owner_w(nskb, sk); |
1457 |
+ |
1458 |
+- /* The 'obsolete' field of dst is set to 2 when a dst is freed. */ |
1459 |
+- if (!dst || (dst->obsolete > 1)) { |
1460 |
+- dst_release(dst); |
1461 |
++ if (!sctp_transport_dst_check(tp)) { |
1462 |
+ sctp_transport_route(tp, NULL, sctp_sk(sk)); |
1463 |
+ if (asoc && (asoc->param_flags & SPP_PMTUD_ENABLE)) { |
1464 |
+ sctp_assoc_sync_pmtu(asoc); |
1465 |
+diff --git a/net/sctp/transport.c b/net/sctp/transport.c |
1466 |
+index 394c57c..8da4481 100644 |
1467 |
+--- a/net/sctp/transport.c |
1468 |
++++ b/net/sctp/transport.c |
1469 |
+@@ -226,23 +226,6 @@ void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk) |
1470 |
+ transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; |
1471 |
+ } |
1472 |
+ |
1473 |
+-/* this is a complete rip-off from __sk_dst_check |
1474 |
+- * the cookie is always 0 since this is how it's used in the |
1475 |
+- * pmtu code |
1476 |
+- */ |
1477 |
+-static struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) |
1478 |
+-{ |
1479 |
+- struct dst_entry *dst = t->dst; |
1480 |
+- |
1481 |
+- if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) { |
1482 |
+- dst_release(t->dst); |
1483 |
+- t->dst = NULL; |
1484 |
+- return NULL; |
1485 |
+- } |
1486 |
+- |
1487 |
+- return dst; |
1488 |
+-} |
1489 |
+- |
1490 |
+ void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu) |
1491 |
+ { |
1492 |
+ struct dst_entry *dst; |
1493 |
+diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c |
1494 |
+index 7803eb6..0c0e40e 100644 |
1495 |
+--- a/net/xfrm/xfrm_policy.c |
1496 |
++++ b/net/xfrm/xfrm_policy.c |
1497 |
+@@ -1917,6 +1917,9 @@ no_transform: |
1498 |
+ } |
1499 |
+ ok: |
1500 |
+ xfrm_pols_put(pols, drop_pols); |
1501 |
++ if (dst && dst->xfrm && |
1502 |
++ dst->xfrm->props.mode == XFRM_MODE_TUNNEL) |
1503 |
++ dst->flags |= DST_XFRM_TUNNEL; |
1504 |
+ return dst; |
1505 |
+ |
1506 |
+ nopol: |
1507 |
+diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c |
1508 |
+index b8dcbf4..506c0fa 100644 |
1509 |
+--- a/sound/usb/pcm.c |
1510 |
++++ b/sound/usb/pcm.c |
1511 |
+@@ -670,6 +670,9 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime, |
1512 |
+ int count = 0, needs_knot = 0; |
1513 |
+ int err; |
1514 |
+ |
1515 |
++ kfree(subs->rate_list.list); |
1516 |
++ subs->rate_list.list = NULL; |
1517 |
++ |
1518 |
+ list_for_each_entry(fp, &subs->fmt_list, list) { |
1519 |
+ if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS) |
1520 |
+ return 0; |
1521 |
|
1522 |
Added: genpatches-2.6/trunk/3.0/1034_linux-3.0.35.patch |
1523 |
=================================================================== |
1524 |
--- genpatches-2.6/trunk/3.0/1034_linux-3.0.35.patch (rev 0) |
1525 |
+++ genpatches-2.6/trunk/3.0/1034_linux-3.0.35.patch 2012-06-19 00:00:27 UTC (rev 2162) |
1526 |
@@ -0,0 +1,811 @@ |
1527 |
+diff --git a/Makefile b/Makefile |
1528 |
+index 61ef485..fe91076 100644 |
1529 |
+--- a/Makefile |
1530 |
++++ b/Makefile |
1531 |
+@@ -1,6 +1,6 @@ |
1532 |
+ VERSION = 3 |
1533 |
+ PATCHLEVEL = 0 |
1534 |
+-SUBLEVEL = 34 |
1535 |
++SUBLEVEL = 35 |
1536 |
+ EXTRAVERSION = |
1537 |
+ NAME = Sneaky Weasel |
1538 |
+ |
1539 |
+diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c |
1540 |
+index f832773..449a7e0 100644 |
1541 |
+--- a/arch/powerpc/kernel/module_32.c |
1542 |
++++ b/arch/powerpc/kernel/module_32.c |
1543 |
+@@ -187,8 +187,8 @@ int apply_relocate(Elf32_Shdr *sechdrs, |
1544 |
+ |
1545 |
+ static inline int entry_matches(struct ppc_plt_entry *entry, Elf32_Addr val) |
1546 |
+ { |
1547 |
+- if (entry->jump[0] == 0x3d600000 + ((val + 0x8000) >> 16) |
1548 |
+- && entry->jump[1] == 0x396b0000 + (val & 0xffff)) |
1549 |
++ if (entry->jump[0] == 0x3d800000 + ((val + 0x8000) >> 16) |
1550 |
++ && entry->jump[1] == 0x398c0000 + (val & 0xffff)) |
1551 |
+ return 1; |
1552 |
+ return 0; |
1553 |
+ } |
1554 |
+@@ -215,10 +215,9 @@ static uint32_t do_plt_call(void *location, |
1555 |
+ entry++; |
1556 |
+ } |
1557 |
+ |
1558 |
+- /* Stolen from Paul Mackerras as well... */ |
1559 |
+- entry->jump[0] = 0x3d600000+((val+0x8000)>>16); /* lis r11,sym@ha */ |
1560 |
+- entry->jump[1] = 0x396b0000 + (val&0xffff); /* addi r11,r11,sym@l*/ |
1561 |
+- entry->jump[2] = 0x7d6903a6; /* mtctr r11 */ |
1562 |
++ entry->jump[0] = 0x3d800000+((val+0x8000)>>16); /* lis r12,sym@ha */ |
1563 |
++ entry->jump[1] = 0x398c0000 + (val&0xffff); /* addi r12,r12,sym@l*/ |
1564 |
++ entry->jump[2] = 0x7d8903a6; /* mtctr r12 */ |
1565 |
+ entry->jump[3] = 0x4e800420; /* bctr */ |
1566 |
+ |
1567 |
+ DEBUGP("Initialized plt for 0x%x at %p\n", val, entry); |
1568 |
+diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S |
1569 |
+index be6d9e3..3470624 100644 |
1570 |
+--- a/arch/x86/crypto/aesni-intel_asm.S |
1571 |
++++ b/arch/x86/crypto/aesni-intel_asm.S |
1572 |
+@@ -2460,10 +2460,12 @@ ENTRY(aesni_cbc_dec) |
1573 |
+ pxor IN3, STATE4 |
1574 |
+ movaps IN4, IV |
1575 |
+ #else |
1576 |
+- pxor (INP), STATE2 |
1577 |
+- pxor 0x10(INP), STATE3 |
1578 |
+ pxor IN1, STATE4 |
1579 |
+ movaps IN2, IV |
1580 |
++ movups (INP), IN1 |
1581 |
++ pxor IN1, STATE2 |
1582 |
++ movups 0x10(INP), IN2 |
1583 |
++ pxor IN2, STATE3 |
1584 |
+ #endif |
1585 |
+ movups STATE1, (OUTP) |
1586 |
+ movups STATE2, 0x10(OUTP) |
1587 |
+diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c |
1588 |
+index bb0adad..dc4fb77 100644 |
1589 |
+--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c |
1590 |
++++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c |
1591 |
+@@ -52,6 +52,7 @@ struct threshold_block { |
1592 |
+ unsigned int cpu; |
1593 |
+ u32 address; |
1594 |
+ u16 interrupt_enable; |
1595 |
++ bool interrupt_capable; |
1596 |
+ u16 threshold_limit; |
1597 |
+ struct kobject kobj; |
1598 |
+ struct list_head miscj; |
1599 |
+@@ -86,6 +87,21 @@ struct thresh_restart { |
1600 |
+ u16 old_limit; |
1601 |
+ }; |
1602 |
+ |
1603 |
++static bool lvt_interrupt_supported(unsigned int bank, u32 msr_high_bits) |
1604 |
++{ |
1605 |
++ /* |
1606 |
++ * bank 4 supports APIC LVT interrupts implicitly since forever. |
1607 |
++ */ |
1608 |
++ if (bank == 4) |
1609 |
++ return true; |
1610 |
++ |
1611 |
++ /* |
1612 |
++ * IntP: interrupt present; if this bit is set, the thresholding |
1613 |
++ * bank can generate APIC LVT interrupts |
1614 |
++ */ |
1615 |
++ return msr_high_bits & BIT(28); |
1616 |
++} |
1617 |
++ |
1618 |
+ static int lvt_off_valid(struct threshold_block *b, int apic, u32 lo, u32 hi) |
1619 |
+ { |
1620 |
+ int msr = (hi & MASK_LVTOFF_HI) >> 20; |
1621 |
+@@ -107,8 +123,10 @@ static int lvt_off_valid(struct threshold_block *b, int apic, u32 lo, u32 hi) |
1622 |
+ return 1; |
1623 |
+ }; |
1624 |
+ |
1625 |
+-/* must be called with correct cpu affinity */ |
1626 |
+-/* Called via smp_call_function_single() */ |
1627 |
++/* |
1628 |
++ * Called via smp_call_function_single(), must be called with correct |
1629 |
++ * cpu affinity. |
1630 |
++ */ |
1631 |
+ static void threshold_restart_bank(void *_tr) |
1632 |
+ { |
1633 |
+ struct thresh_restart *tr = _tr; |
1634 |
+@@ -131,6 +149,12 @@ static void threshold_restart_bank(void *_tr) |
1635 |
+ (new_count & THRESHOLD_MAX); |
1636 |
+ } |
1637 |
+ |
1638 |
++ /* clear IntType */ |
1639 |
++ hi &= ~MASK_INT_TYPE_HI; |
1640 |
++ |
1641 |
++ if (!tr->b->interrupt_capable) |
1642 |
++ goto done; |
1643 |
++ |
1644 |
+ if (tr->set_lvt_off) { |
1645 |
+ if (lvt_off_valid(tr->b, tr->lvt_off, lo, hi)) { |
1646 |
+ /* set new lvt offset */ |
1647 |
+@@ -139,9 +163,10 @@ static void threshold_restart_bank(void *_tr) |
1648 |
+ } |
1649 |
+ } |
1650 |
+ |
1651 |
+- tr->b->interrupt_enable ? |
1652 |
+- (hi = (hi & ~MASK_INT_TYPE_HI) | INT_TYPE_APIC) : |
1653 |
+- (hi &= ~MASK_INT_TYPE_HI); |
1654 |
++ if (tr->b->interrupt_enable) |
1655 |
++ hi |= INT_TYPE_APIC; |
1656 |
++ |
1657 |
++ done: |
1658 |
+ |
1659 |
+ hi |= MASK_COUNT_EN_HI; |
1660 |
+ wrmsr(tr->b->address, lo, hi); |
1661 |
+@@ -206,14 +231,18 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c) |
1662 |
+ if (shared_bank[bank] && c->cpu_core_id) |
1663 |
+ break; |
1664 |
+ #endif |
1665 |
+- offset = setup_APIC_mce(offset, |
1666 |
+- (high & MASK_LVTOFF_HI) >> 20); |
1667 |
+ |
1668 |
+ memset(&b, 0, sizeof(b)); |
1669 |
+- b.cpu = cpu; |
1670 |
+- b.bank = bank; |
1671 |
+- b.block = block; |
1672 |
+- b.address = address; |
1673 |
++ b.cpu = cpu; |
1674 |
++ b.bank = bank; |
1675 |
++ b.block = block; |
1676 |
++ b.address = address; |
1677 |
++ b.interrupt_capable = lvt_interrupt_supported(bank, high); |
1678 |
++ |
1679 |
++ if (b.interrupt_capable) { |
1680 |
++ int new = (high & MASK_LVTOFF_HI) >> 20; |
1681 |
++ offset = setup_APIC_mce(offset, new); |
1682 |
++ } |
1683 |
+ |
1684 |
+ mce_threshold_block_init(&b, offset); |
1685 |
+ mce_threshold_vector = amd_threshold_interrupt; |
1686 |
+@@ -313,6 +342,9 @@ store_interrupt_enable(struct threshold_block *b, const char *buf, size_t size) |
1687 |
+ struct thresh_restart tr; |
1688 |
+ unsigned long new; |
1689 |
+ |
1690 |
++ if (!b->interrupt_capable) |
1691 |
++ return -EINVAL; |
1692 |
++ |
1693 |
+ if (strict_strtoul(buf, 0, &new) < 0) |
1694 |
+ return -EINVAL; |
1695 |
+ |
1696 |
+@@ -471,6 +503,7 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu, |
1697 |
+ b->cpu = cpu; |
1698 |
+ b->address = address; |
1699 |
+ b->interrupt_enable = 0; |
1700 |
++ b->interrupt_capable = lvt_interrupt_supported(bank, high); |
1701 |
+ b->threshold_limit = THRESHOLD_MAX; |
1702 |
+ |
1703 |
+ INIT_LIST_HEAD(&b->miscj); |
1704 |
+diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c |
1705 |
+index db39e9e..623a335 100644 |
1706 |
+--- a/drivers/acpi/video.c |
1707 |
++++ b/drivers/acpi/video.c |
1708 |
+@@ -1732,6 +1732,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type) |
1709 |
+ |
1710 |
+ static int __init intel_opregion_present(void) |
1711 |
+ { |
1712 |
++ int i915 = 0; |
1713 |
+ #if defined(CONFIG_DRM_I915) || defined(CONFIG_DRM_I915_MODULE) |
1714 |
+ struct pci_dev *dev = NULL; |
1715 |
+ u32 address; |
1716 |
+@@ -1744,10 +1745,10 @@ static int __init intel_opregion_present(void) |
1717 |
+ pci_read_config_dword(dev, 0xfc, &address); |
1718 |
+ if (!address) |
1719 |
+ continue; |
1720 |
+- return 1; |
1721 |
++ i915 = 1; |
1722 |
+ } |
1723 |
+ #endif |
1724 |
+- return 0; |
1725 |
++ return i915; |
1726 |
+ } |
1727 |
+ |
1728 |
+ int acpi_video_register(void) |
1729 |
+diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c |
1730 |
+index b427711..58b49d1 100644 |
1731 |
+--- a/drivers/char/agp/intel-agp.c |
1732 |
++++ b/drivers/char/agp/intel-agp.c |
1733 |
+@@ -897,6 +897,7 @@ static struct pci_device_id agp_intel_pci_table[] = { |
1734 |
+ ID(PCI_DEVICE_ID_INTEL_B43_HB), |
1735 |
+ ID(PCI_DEVICE_ID_INTEL_B43_1_HB), |
1736 |
+ ID(PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB), |
1737 |
++ ID(PCI_DEVICE_ID_INTEL_IRONLAKE_D2_HB), |
1738 |
+ ID(PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB), |
1739 |
+ ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB), |
1740 |
+ ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB), |
1741 |
+diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h |
1742 |
+index 5da67f1..6f24604 100644 |
1743 |
+--- a/drivers/char/agp/intel-agp.h |
1744 |
++++ b/drivers/char/agp/intel-agp.h |
1745 |
+@@ -211,6 +211,7 @@ |
1746 |
+ #define PCI_DEVICE_ID_INTEL_G41_HB 0x2E30 |
1747 |
+ #define PCI_DEVICE_ID_INTEL_G41_IG 0x2E32 |
1748 |
+ #define PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB 0x0040 |
1749 |
++#define PCI_DEVICE_ID_INTEL_IRONLAKE_D2_HB 0x0069 |
1750 |
+ #define PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG 0x0042 |
1751 |
+ #define PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB 0x0044 |
1752 |
+ #define PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB 0x0062 |
1753 |
+diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c |
1754 |
+index 9a4c3ab..e8e18ca 100644 |
1755 |
+--- a/drivers/hwmon/fam15h_power.c |
1756 |
++++ b/drivers/hwmon/fam15h_power.c |
1757 |
+@@ -61,14 +61,14 @@ static ssize_t show_power(struct device *dev, |
1758 |
+ REG_TDP_RUNNING_AVERAGE, &val); |
1759 |
+ running_avg_capture = (val >> 4) & 0x3fffff; |
1760 |
+ running_avg_capture = sign_extend32(running_avg_capture, 21); |
1761 |
+- running_avg_range = val & 0xf; |
1762 |
++ running_avg_range = (val & 0xf) + 1; |
1763 |
+ |
1764 |
+ pci_bus_read_config_dword(f4->bus, PCI_DEVFN(PCI_SLOT(f4->devfn), 5), |
1765 |
+ REG_TDP_LIMIT3, &val); |
1766 |
+ |
1767 |
+ tdp_limit = val >> 16; |
1768 |
+- curr_pwr_watts = tdp_limit + data->base_tdp - |
1769 |
+- (s32)(running_avg_capture >> (running_avg_range + 1)); |
1770 |
++ curr_pwr_watts = (tdp_limit + data->base_tdp) << running_avg_range; |
1771 |
++ curr_pwr_watts -= running_avg_capture; |
1772 |
+ curr_pwr_watts *= data->tdp_to_watts; |
1773 |
+ |
1774 |
+ /* |
1775 |
+@@ -78,7 +78,7 @@ static ssize_t show_power(struct device *dev, |
1776 |
+ * scaling factor 1/(2^16). For conversion we use |
1777 |
+ * (10^6)/(2^16) = 15625/(2^10) |
1778 |
+ */ |
1779 |
+- curr_pwr_watts = (curr_pwr_watts * 15625) >> 10; |
1780 |
++ curr_pwr_watts = (curr_pwr_watts * 15625) >> (10 + running_avg_range); |
1781 |
+ return sprintf(buf, "%u\n", (unsigned int) curr_pwr_watts); |
1782 |
+ } |
1783 |
+ static DEVICE_ATTR(power1_input, S_IRUGO, show_power, NULL); |
1784 |
+diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c |
1785 |
+index 7e5cc0b..1f8a824 100644 |
1786 |
+--- a/drivers/net/can/c_can/c_can.c |
1787 |
++++ b/drivers/net/can/c_can/c_can.c |
1788 |
+@@ -688,7 +688,7 @@ static int c_can_get_berr_counter(const struct net_device *dev, |
1789 |
+ * |
1790 |
+ * We iterate from priv->tx_echo to priv->tx_next and check if the |
1791 |
+ * packet has been transmitted, echo it back to the CAN framework. |
1792 |
+- * If we discover a not yet transmitted package, stop looking for more. |
1793 |
++ * If we discover a not yet transmitted packet, stop looking for more. |
1794 |
+ */ |
1795 |
+ static void c_can_do_tx(struct net_device *dev) |
1796 |
+ { |
1797 |
+@@ -700,7 +700,7 @@ static void c_can_do_tx(struct net_device *dev) |
1798 |
+ for (/* nix */; (priv->tx_next - priv->tx_echo) > 0; priv->tx_echo++) { |
1799 |
+ msg_obj_no = get_tx_echo_msg_obj(priv); |
1800 |
+ val = c_can_read_reg32(priv, &priv->regs->txrqst1); |
1801 |
+- if (!(val & (1 << msg_obj_no))) { |
1802 |
++ if (!(val & (1 << (msg_obj_no - 1)))) { |
1803 |
+ can_get_echo_skb(dev, |
1804 |
+ msg_obj_no - C_CAN_MSG_OBJ_TX_FIRST); |
1805 |
+ stats->tx_bytes += priv->read_reg(priv, |
1806 |
+@@ -708,6 +708,8 @@ static void c_can_do_tx(struct net_device *dev) |
1807 |
+ & IF_MCONT_DLC_MASK; |
1808 |
+ stats->tx_packets++; |
1809 |
+ c_can_inval_msg_object(dev, 0, msg_obj_no); |
1810 |
++ } else { |
1811 |
++ break; |
1812 |
+ } |
1813 |
+ } |
1814 |
+ |
1815 |
+@@ -952,7 +954,7 @@ static int c_can_poll(struct napi_struct *napi, int quota) |
1816 |
+ struct net_device *dev = napi->dev; |
1817 |
+ struct c_can_priv *priv = netdev_priv(dev); |
1818 |
+ |
1819 |
+- irqstatus = priv->read_reg(priv, &priv->regs->interrupt); |
1820 |
++ irqstatus = priv->irqstatus; |
1821 |
+ if (!irqstatus) |
1822 |
+ goto end; |
1823 |
+ |
1824 |
+@@ -1030,12 +1032,11 @@ end: |
1825 |
+ |
1826 |
+ static irqreturn_t c_can_isr(int irq, void *dev_id) |
1827 |
+ { |
1828 |
+- u16 irqstatus; |
1829 |
+ struct net_device *dev = (struct net_device *)dev_id; |
1830 |
+ struct c_can_priv *priv = netdev_priv(dev); |
1831 |
+ |
1832 |
+- irqstatus = priv->read_reg(priv, &priv->regs->interrupt); |
1833 |
+- if (!irqstatus) |
1834 |
++ priv->irqstatus = priv->read_reg(priv, &priv->regs->interrupt); |
1835 |
++ if (!priv->irqstatus) |
1836 |
+ return IRQ_NONE; |
1837 |
+ |
1838 |
+ /* disable all interrupts and schedule the NAPI */ |
1839 |
+@@ -1065,10 +1066,11 @@ static int c_can_open(struct net_device *dev) |
1840 |
+ goto exit_irq_fail; |
1841 |
+ } |
1842 |
+ |
1843 |
++ napi_enable(&priv->napi); |
1844 |
++ |
1845 |
+ /* start the c_can controller */ |
1846 |
+ c_can_start(dev); |
1847 |
+ |
1848 |
+- napi_enable(&priv->napi); |
1849 |
+ netif_start_queue(dev); |
1850 |
+ |
1851 |
+ return 0; |
1852 |
+diff --git a/drivers/net/can/c_can/c_can.h b/drivers/net/can/c_can/c_can.h |
1853 |
+index 9b7fbef..5f32d34 100644 |
1854 |
+--- a/drivers/net/can/c_can/c_can.h |
1855 |
++++ b/drivers/net/can/c_can/c_can.h |
1856 |
+@@ -76,6 +76,7 @@ struct c_can_priv { |
1857 |
+ unsigned int tx_next; |
1858 |
+ unsigned int tx_echo; |
1859 |
+ void *priv; /* for board-specific data */ |
1860 |
++ u16 irqstatus; |
1861 |
+ }; |
1862 |
+ |
1863 |
+ struct net_device *alloc_c_can_dev(void); |
1864 |
+diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h |
1865 |
+index 8676899..2c71884 100644 |
1866 |
+--- a/drivers/net/e1000/e1000.h |
1867 |
++++ b/drivers/net/e1000/e1000.h |
1868 |
+@@ -150,6 +150,8 @@ struct e1000_buffer { |
1869 |
+ unsigned long time_stamp; |
1870 |
+ u16 length; |
1871 |
+ u16 next_to_watch; |
1872 |
++ unsigned int segs; |
1873 |
++ unsigned int bytecount; |
1874 |
+ u16 mapped_as_page; |
1875 |
+ }; |
1876 |
+ |
1877 |
+diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c |
1878 |
+index 76e8af0..99525f9 100644 |
1879 |
+--- a/drivers/net/e1000/e1000_main.c |
1880 |
++++ b/drivers/net/e1000/e1000_main.c |
1881 |
+@@ -2798,7 +2798,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter, |
1882 |
+ struct e1000_buffer *buffer_info; |
1883 |
+ unsigned int len = skb_headlen(skb); |
1884 |
+ unsigned int offset = 0, size, count = 0, i; |
1885 |
+- unsigned int f; |
1886 |
++ unsigned int f, bytecount, segs; |
1887 |
+ |
1888 |
+ i = tx_ring->next_to_use; |
1889 |
+ |
1890 |
+@@ -2899,7 +2899,13 @@ static int e1000_tx_map(struct e1000_adapter *adapter, |
1891 |
+ } |
1892 |
+ } |
1893 |
+ |
1894 |
++ segs = skb_shinfo(skb)->gso_segs ?: 1; |
1895 |
++ /* multiply data chunks by size of headers */ |
1896 |
++ bytecount = ((segs - 1) * skb_headlen(skb)) + skb->len; |
1897 |
++ |
1898 |
+ tx_ring->buffer_info[i].skb = skb; |
1899 |
++ tx_ring->buffer_info[i].segs = segs; |
1900 |
++ tx_ring->buffer_info[i].bytecount = bytecount; |
1901 |
+ tx_ring->buffer_info[first].next_to_watch = i; |
1902 |
+ |
1903 |
+ return count; |
1904 |
+@@ -3573,14 +3579,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, |
1905 |
+ cleaned = (i == eop); |
1906 |
+ |
1907 |
+ if (cleaned) { |
1908 |
+- struct sk_buff *skb = buffer_info->skb; |
1909 |
+- unsigned int segs, bytecount; |
1910 |
+- segs = skb_shinfo(skb)->gso_segs ?: 1; |
1911 |
+- /* multiply data chunks by size of headers */ |
1912 |
+- bytecount = ((segs - 1) * skb_headlen(skb)) + |
1913 |
+- skb->len; |
1914 |
+- total_tx_packets += segs; |
1915 |
+- total_tx_bytes += bytecount; |
1916 |
++ total_tx_packets += buffer_info->segs; |
1917 |
++ total_tx_bytes += buffer_info->bytecount; |
1918 |
+ } |
1919 |
+ e1000_unmap_and_free_tx_resource(adapter, buffer_info); |
1920 |
+ tx_desc->upper.data = 0; |
1921 |
+diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c |
1922 |
+index ed1b432..864448b 100644 |
1923 |
+--- a/drivers/net/usb/sierra_net.c |
1924 |
++++ b/drivers/net/usb/sierra_net.c |
1925 |
+@@ -943,7 +943,7 @@ struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb, |
1926 |
+ } |
1927 |
+ |
1928 |
+ static const u8 sierra_net_ifnum_list[] = { 7, 10, 11 }; |
1929 |
+-static const struct sierra_net_info_data sierra_net_info_data_68A3 = { |
1930 |
++static const struct sierra_net_info_data sierra_net_info_data_direct_ip = { |
1931 |
+ .rx_urb_size = 8 * 1024, |
1932 |
+ .whitelist = { |
1933 |
+ .infolen = ARRAY_SIZE(sierra_net_ifnum_list), |
1934 |
+@@ -951,7 +951,7 @@ static const struct sierra_net_info_data sierra_net_info_data_68A3 = { |
1935 |
+ } |
1936 |
+ }; |
1937 |
+ |
1938 |
+-static const struct driver_info sierra_net_info_68A3 = { |
1939 |
++static const struct driver_info sierra_net_info_direct_ip = { |
1940 |
+ .description = "Sierra Wireless USB-to-WWAN Modem", |
1941 |
+ .flags = FLAG_WWAN | FLAG_SEND_ZLP, |
1942 |
+ .bind = sierra_net_bind, |
1943 |
+@@ -959,12 +959,18 @@ static const struct driver_info sierra_net_info_68A3 = { |
1944 |
+ .status = sierra_net_status, |
1945 |
+ .rx_fixup = sierra_net_rx_fixup, |
1946 |
+ .tx_fixup = sierra_net_tx_fixup, |
1947 |
+- .data = (unsigned long)&sierra_net_info_data_68A3, |
1948 |
++ .data = (unsigned long)&sierra_net_info_data_direct_ip, |
1949 |
+ }; |
1950 |
+ |
1951 |
+ static const struct usb_device_id products[] = { |
1952 |
+ {USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless USB-to-WWAN modem */ |
1953 |
+- .driver_info = (unsigned long) &sierra_net_info_68A3}, |
1954 |
++ .driver_info = (unsigned long) &sierra_net_info_direct_ip}, |
1955 |
++ {USB_DEVICE(0x0F3D, 0x68A3), /* AT&T Direct IP modem */ |
1956 |
++ .driver_info = (unsigned long) &sierra_net_info_direct_ip}, |
1957 |
++ {USB_DEVICE(0x1199, 0x68AA), /* Sierra Wireless Direct IP LTE modem */ |
1958 |
++ .driver_info = (unsigned long) &sierra_net_info_direct_ip}, |
1959 |
++ {USB_DEVICE(0x0F3D, 0x68AA), /* AT&T Direct IP LTE modem */ |
1960 |
++ .driver_info = (unsigned long) &sierra_net_info_direct_ip}, |
1961 |
+ |
1962 |
+ {}, /* last item */ |
1963 |
+ }; |
1964 |
+diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c |
1965 |
+index 0bd722c..5c9999d 100644 |
1966 |
+--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c |
1967 |
++++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c |
1968 |
+@@ -477,7 +477,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, |
1969 |
+ sizeof(struct iwl_keyinfo)); |
1970 |
+ priv->stations[sta_id].sta.key.key_flags = |
1971 |
+ STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; |
1972 |
+- priv->stations[sta_id].sta.key.key_offset = WEP_INVALID_OFFSET; |
1973 |
++ priv->stations[sta_id].sta.key.key_offset = keyconf->hw_key_idx; |
1974 |
+ priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; |
1975 |
+ priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
1976 |
+ |
1977 |
+diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c |
1978 |
+index d5016071..c04a025 100644 |
1979 |
+--- a/fs/fuse/dir.c |
1980 |
++++ b/fs/fuse/dir.c |
1981 |
+@@ -858,6 +858,7 @@ int fuse_update_attributes(struct inode *inode, struct kstat *stat, |
1982 |
+ if (stat) { |
1983 |
+ generic_fillattr(inode, stat); |
1984 |
+ stat->mode = fi->orig_i_mode; |
1985 |
++ stat->ino = fi->orig_ino; |
1986 |
+ } |
1987 |
+ } |
1988 |
+ |
1989 |
+diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h |
1990 |
+index b788bec..f621550 100644 |
1991 |
+--- a/fs/fuse/fuse_i.h |
1992 |
++++ b/fs/fuse/fuse_i.h |
1993 |
+@@ -82,6 +82,9 @@ struct fuse_inode { |
1994 |
+ preserve the original mode */ |
1995 |
+ mode_t orig_i_mode; |
1996 |
+ |
1997 |
++ /** 64 bit inode number */ |
1998 |
++ u64 orig_ino; |
1999 |
++ |
2000 |
+ /** Version of last attribute change */ |
2001 |
+ u64 attr_version; |
2002 |
+ |
2003 |
+diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c |
2004 |
+index 38f84cd..69a1e0f 100644 |
2005 |
+--- a/fs/fuse/inode.c |
2006 |
++++ b/fs/fuse/inode.c |
2007 |
+@@ -91,6 +91,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb) |
2008 |
+ fi->nlookup = 0; |
2009 |
+ fi->attr_version = 0; |
2010 |
+ fi->writectr = 0; |
2011 |
++ fi->orig_ino = 0; |
2012 |
+ INIT_LIST_HEAD(&fi->write_files); |
2013 |
+ INIT_LIST_HEAD(&fi->queued_writes); |
2014 |
+ INIT_LIST_HEAD(&fi->writepages); |
2015 |
+@@ -140,6 +141,18 @@ static int fuse_remount_fs(struct super_block *sb, int *flags, char *data) |
2016 |
+ return 0; |
2017 |
+ } |
2018 |
+ |
2019 |
++/* |
2020 |
++ * ino_t is 32-bits on 32-bit arch. We have to squash the 64-bit value down |
2021 |
++ * so that it will fit. |
2022 |
++ */ |
2023 |
++static ino_t fuse_squash_ino(u64 ino64) |
2024 |
++{ |
2025 |
++ ino_t ino = (ino_t) ino64; |
2026 |
++ if (sizeof(ino_t) < sizeof(u64)) |
2027 |
++ ino ^= ino64 >> (sizeof(u64) - sizeof(ino_t)) * 8; |
2028 |
++ return ino; |
2029 |
++} |
2030 |
++ |
2031 |
+ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, |
2032 |
+ u64 attr_valid) |
2033 |
+ { |
2034 |
+@@ -149,7 +162,7 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, |
2035 |
+ fi->attr_version = ++fc->attr_version; |
2036 |
+ fi->i_time = attr_valid; |
2037 |
+ |
2038 |
+- inode->i_ino = attr->ino; |
2039 |
++ inode->i_ino = fuse_squash_ino(attr->ino); |
2040 |
+ inode->i_mode = (inode->i_mode & S_IFMT) | (attr->mode & 07777); |
2041 |
+ inode->i_nlink = attr->nlink; |
2042 |
+ inode->i_uid = attr->uid; |
2043 |
+@@ -175,6 +188,8 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, |
2044 |
+ fi->orig_i_mode = inode->i_mode; |
2045 |
+ if (!(fc->flags & FUSE_DEFAULT_PERMISSIONS)) |
2046 |
+ inode->i_mode &= ~S_ISVTX; |
2047 |
++ |
2048 |
++ fi->orig_ino = attr->ino; |
2049 |
+ } |
2050 |
+ |
2051 |
+ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, |
2052 |
+diff --git a/kernel/sched.c b/kernel/sched.c |
2053 |
+index 03dff14..8ef48f0 100644 |
2054 |
+--- a/kernel/sched.c |
2055 |
++++ b/kernel/sched.c |
2056 |
+@@ -7220,11 +7220,8 @@ int sched_domain_level_max; |
2057 |
+ |
2058 |
+ static int __init setup_relax_domain_level(char *str) |
2059 |
+ { |
2060 |
+- unsigned long val; |
2061 |
+- |
2062 |
+- val = simple_strtoul(str, NULL, 0); |
2063 |
+- if (val < sched_domain_level_max) |
2064 |
+- default_relax_domain_level = val; |
2065 |
++ if (kstrtoint(str, 0, &default_relax_domain_level)) |
2066 |
++ pr_warn("Unable to set relax_domain_level\n"); |
2067 |
+ |
2068 |
+ return 1; |
2069 |
+ } |
2070 |
+@@ -7417,7 +7414,6 @@ struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl, |
2071 |
+ if (!sd) |
2072 |
+ return child; |
2073 |
+ |
2074 |
+- set_domain_attribute(sd, attr); |
2075 |
+ cpumask_and(sched_domain_span(sd), cpu_map, tl->mask(cpu)); |
2076 |
+ if (child) { |
2077 |
+ sd->level = child->level + 1; |
2078 |
+@@ -7425,6 +7421,7 @@ struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl, |
2079 |
+ child->parent = sd; |
2080 |
+ } |
2081 |
+ sd->child = child; |
2082 |
++ set_domain_attribute(sd, attr); |
2083 |
+ |
2084 |
+ return sd; |
2085 |
+ } |
2086 |
+diff --git a/lib/btree.c b/lib/btree.c |
2087 |
+index 2a34392..297124d 100644 |
2088 |
+--- a/lib/btree.c |
2089 |
++++ b/lib/btree.c |
2090 |
+@@ -319,8 +319,8 @@ void *btree_get_prev(struct btree_head *head, struct btree_geo *geo, |
2091 |
+ |
2092 |
+ if (head->height == 0) |
2093 |
+ return NULL; |
2094 |
+-retry: |
2095 |
+ longcpy(key, __key, geo->keylen); |
2096 |
++retry: |
2097 |
+ dec_key(geo, key); |
2098 |
+ |
2099 |
+ node = head->node; |
2100 |
+@@ -351,7 +351,7 @@ retry: |
2101 |
+ } |
2102 |
+ miss: |
2103 |
+ if (retry_key) { |
2104 |
+- __key = retry_key; |
2105 |
++ longcpy(key, retry_key, geo->keylen); |
2106 |
+ retry_key = NULL; |
2107 |
+ goto retry; |
2108 |
+ } |
2109 |
+diff --git a/mm/hugetlb.c b/mm/hugetlb.c |
2110 |
+index 00b0abb..05f8fd4 100644 |
2111 |
+--- a/mm/hugetlb.c |
2112 |
++++ b/mm/hugetlb.c |
2113 |
+@@ -2060,6 +2060,15 @@ static void hugetlb_vm_op_open(struct vm_area_struct *vma) |
2114 |
+ kref_get(&reservations->refs); |
2115 |
+ } |
2116 |
+ |
2117 |
++static void resv_map_put(struct vm_area_struct *vma) |
2118 |
++{ |
2119 |
++ struct resv_map *reservations = vma_resv_map(vma); |
2120 |
++ |
2121 |
++ if (!reservations) |
2122 |
++ return; |
2123 |
++ kref_put(&reservations->refs, resv_map_release); |
2124 |
++} |
2125 |
++ |
2126 |
+ static void hugetlb_vm_op_close(struct vm_area_struct *vma) |
2127 |
+ { |
2128 |
+ struct hstate *h = hstate_vma(vma); |
2129 |
+@@ -2075,7 +2084,7 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma) |
2130 |
+ reserve = (end - start) - |
2131 |
+ region_count(&reservations->regions, start, end); |
2132 |
+ |
2133 |
+- kref_put(&reservations->refs, resv_map_release); |
2134 |
++ resv_map_put(vma); |
2135 |
+ |
2136 |
+ if (reserve) { |
2137 |
+ hugetlb_acct_memory(h, -reserve); |
2138 |
+@@ -2877,12 +2886,16 @@ int hugetlb_reserve_pages(struct inode *inode, |
2139 |
+ set_vma_resv_flags(vma, HPAGE_RESV_OWNER); |
2140 |
+ } |
2141 |
+ |
2142 |
+- if (chg < 0) |
2143 |
+- return chg; |
2144 |
++ if (chg < 0) { |
2145 |
++ ret = chg; |
2146 |
++ goto out_err; |
2147 |
++ } |
2148 |
+ |
2149 |
+ /* There must be enough filesystem quota for the mapping */ |
2150 |
+- if (hugetlb_get_quota(inode->i_mapping, chg)) |
2151 |
+- return -ENOSPC; |
2152 |
++ if (hugetlb_get_quota(inode->i_mapping, chg)) { |
2153 |
++ ret = -ENOSPC; |
2154 |
++ goto out_err; |
2155 |
++ } |
2156 |
+ |
2157 |
+ /* |
2158 |
+ * Check enough hugepages are available for the reservation. |
2159 |
+@@ -2891,7 +2904,7 @@ int hugetlb_reserve_pages(struct inode *inode, |
2160 |
+ ret = hugetlb_acct_memory(h, chg); |
2161 |
+ if (ret < 0) { |
2162 |
+ hugetlb_put_quota(inode->i_mapping, chg); |
2163 |
+- return ret; |
2164 |
++ goto out_err; |
2165 |
+ } |
2166 |
+ |
2167 |
+ /* |
2168 |
+@@ -2908,6 +2921,10 @@ int hugetlb_reserve_pages(struct inode *inode, |
2169 |
+ if (!vma || vma->vm_flags & VM_MAYSHARE) |
2170 |
+ region_add(&inode->i_mapping->private_list, from, to); |
2171 |
+ return 0; |
2172 |
++out_err: |
2173 |
++ if (vma) |
2174 |
++ resv_map_put(vma); |
2175 |
++ return ret; |
2176 |
+ } |
2177 |
+ |
2178 |
+ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed) |
2179 |
+diff --git a/mm/vmalloc.c b/mm/vmalloc.c |
2180 |
+index 43b44db..bdb7004 100644 |
2181 |
+--- a/mm/vmalloc.c |
2182 |
++++ b/mm/vmalloc.c |
2183 |
+@@ -256,7 +256,7 @@ struct vmap_area { |
2184 |
+ struct rb_node rb_node; /* address sorted rbtree */ |
2185 |
+ struct list_head list; /* address sorted list */ |
2186 |
+ struct list_head purge_list; /* "lazy purge" list */ |
2187 |
+- void *private; |
2188 |
++ struct vm_struct *vm; |
2189 |
+ struct rcu_head rcu_head; |
2190 |
+ }; |
2191 |
+ |
2192 |
+@@ -1174,9 +1174,10 @@ void __init vmalloc_init(void) |
2193 |
+ /* Import existing vmlist entries. */ |
2194 |
+ for (tmp = vmlist; tmp; tmp = tmp->next) { |
2195 |
+ va = kzalloc(sizeof(struct vmap_area), GFP_NOWAIT); |
2196 |
+- va->flags = tmp->flags | VM_VM_AREA; |
2197 |
++ va->flags = VM_VM_AREA; |
2198 |
+ va->va_start = (unsigned long)tmp->addr; |
2199 |
+ va->va_end = va->va_start + tmp->size; |
2200 |
++ va->vm = tmp; |
2201 |
+ __insert_vmap_area(va); |
2202 |
+ } |
2203 |
+ |
2204 |
+@@ -1274,7 +1275,7 @@ static void setup_vmalloc_vm(struct vm_struct *vm, struct vmap_area *va, |
2205 |
+ vm->addr = (void *)va->va_start; |
2206 |
+ vm->size = va->va_end - va->va_start; |
2207 |
+ vm->caller = caller; |
2208 |
+- va->private = vm; |
2209 |
++ va->vm = vm; |
2210 |
+ va->flags |= VM_VM_AREA; |
2211 |
+ } |
2212 |
+ |
2213 |
+@@ -1397,7 +1398,7 @@ static struct vm_struct *find_vm_area(const void *addr) |
2214 |
+ |
2215 |
+ va = find_vmap_area((unsigned long)addr); |
2216 |
+ if (va && va->flags & VM_VM_AREA) |
2217 |
+- return va->private; |
2218 |
++ return va->vm; |
2219 |
+ |
2220 |
+ return NULL; |
2221 |
+ } |
2222 |
+@@ -1416,7 +1417,7 @@ struct vm_struct *remove_vm_area(const void *addr) |
2223 |
+ |
2224 |
+ va = find_vmap_area((unsigned long)addr); |
2225 |
+ if (va && va->flags & VM_VM_AREA) { |
2226 |
+- struct vm_struct *vm = va->private; |
2227 |
++ struct vm_struct *vm = va->vm; |
2228 |
+ |
2229 |
+ if (!(vm->flags & VM_UNLIST)) { |
2230 |
+ struct vm_struct *tmp, **p; |
2231 |
+diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c |
2232 |
+index 895eec1..65f3764c 100644 |
2233 |
+--- a/net/mac80211/iface.c |
2234 |
++++ b/net/mac80211/iface.c |
2235 |
+@@ -498,6 +498,18 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, |
2236 |
+ ieee80211_configure_filter(local); |
2237 |
+ break; |
2238 |
+ default: |
2239 |
++ mutex_lock(&local->mtx); |
2240 |
++ if (local->hw_roc_dev == sdata->dev && |
2241 |
++ local->hw_roc_channel) { |
2242 |
++ /* ignore return value since this is racy */ |
2243 |
++ drv_cancel_remain_on_channel(local); |
2244 |
++ ieee80211_queue_work(&local->hw, &local->hw_roc_done); |
2245 |
++ } |
2246 |
++ mutex_unlock(&local->mtx); |
2247 |
++ |
2248 |
++ flush_work(&local->hw_roc_start); |
2249 |
++ flush_work(&local->hw_roc_done); |
2250 |
++ |
2251 |
+ flush_work(&sdata->work); |
2252 |
+ /* |
2253 |
+ * When we get here, the interface is marked down. |
2254 |
+diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c |
2255 |
+index 13427b1..c55eb9d 100644 |
2256 |
+--- a/net/mac80211/offchannel.c |
2257 |
++++ b/net/mac80211/offchannel.c |
2258 |
+@@ -251,6 +251,22 @@ static void ieee80211_hw_roc_done(struct work_struct *work) |
2259 |
+ return; |
2260 |
+ } |
2261 |
+ |
2262 |
++ /* was never transmitted */ |
2263 |
++ if (local->hw_roc_skb) { |
2264 |
++ u64 cookie; |
2265 |
++ |
2266 |
++ cookie = local->hw_roc_cookie ^ 2; |
2267 |
++ |
2268 |
++ cfg80211_mgmt_tx_status(local->hw_roc_dev, cookie, |
2269 |
++ local->hw_roc_skb->data, |
2270 |
++ local->hw_roc_skb->len, false, |
2271 |
++ GFP_KERNEL); |
2272 |
++ |
2273 |
++ kfree_skb(local->hw_roc_skb); |
2274 |
++ local->hw_roc_skb = NULL; |
2275 |
++ local->hw_roc_skb_for_status = NULL; |
2276 |
++ } |
2277 |
++ |
2278 |
+ if (!local->hw_roc_for_tx) |
2279 |
+ cfg80211_remain_on_channel_expired(local->hw_roc_dev, |
2280 |
+ local->hw_roc_cookie, |
2281 |
+diff --git a/net/wireless/util.c b/net/wireless/util.c |
2282 |
+index 9c22330..30f68dc 100644 |
2283 |
+--- a/net/wireless/util.c |
2284 |
++++ b/net/wireless/util.c |
2285 |
+@@ -937,6 +937,7 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev, |
2286 |
+ enum nl80211_iftype iftype) |
2287 |
+ { |
2288 |
+ struct wireless_dev *wdev_iter; |
2289 |
++ u32 used_iftypes = BIT(iftype); |
2290 |
+ int num[NUM_NL80211_IFTYPES]; |
2291 |
+ int total = 1; |
2292 |
+ int i, j; |
2293 |
+@@ -970,12 +971,14 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev, |
2294 |
+ |
2295 |
+ num[wdev_iter->iftype]++; |
2296 |
+ total++; |
2297 |
++ used_iftypes |= BIT(wdev_iter->iftype); |
2298 |
+ } |
2299 |
+ mutex_unlock(&rdev->devlist_mtx); |
2300 |
+ |
2301 |
+ for (i = 0; i < rdev->wiphy.n_iface_combinations; i++) { |
2302 |
+ const struct ieee80211_iface_combination *c; |
2303 |
+ struct ieee80211_iface_limit *limits; |
2304 |
++ u32 all_iftypes = 0; |
2305 |
+ |
2306 |
+ c = &rdev->wiphy.iface_combinations[i]; |
2307 |
+ |
2308 |
+@@ -990,6 +993,7 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev, |
2309 |
+ if (rdev->wiphy.software_iftypes & BIT(iftype)) |
2310 |
+ continue; |
2311 |
+ for (j = 0; j < c->n_limits; j++) { |
2312 |
++ all_iftypes |= limits[j].types; |
2313 |
+ if (!(limits[j].types & BIT(iftype))) |
2314 |
+ continue; |
2315 |
+ if (limits[j].max < num[iftype]) |
2316 |
+@@ -997,7 +1001,20 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev, |
2317 |
+ limits[j].max -= num[iftype]; |
2318 |
+ } |
2319 |
+ } |
2320 |
+- /* yay, it fits */ |
2321 |
++ |
2322 |
++ /* |
2323 |
++ * Finally check that all iftypes that we're currently |
2324 |
++ * using are actually part of this combination. If they |
2325 |
++ * aren't then we can't use this combination and have |
2326 |
++ * to continue to the next. |
2327 |
++ */ |
2328 |
++ if ((all_iftypes & used_iftypes) != used_iftypes) |
2329 |
++ goto cont; |
2330 |
++ |
2331 |
++ /* |
2332 |
++ * This combination covered all interface types and |
2333 |
++ * supported the requested numbers, so we're good. |
2334 |
++ */ |
2335 |
+ kfree(limits); |
2336 |
+ return 0; |
2337 |
+ cont: |