/[linux-patches]/genpatches-2.6/tags/3.0-30/1033_linux-3.0.34.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1033_linux-3.0.34.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (2 years ago) by mpagano
File size: 47350 byte(s)
3.0-30 release
1 diff --git a/Makefile b/Makefile
2 index c621c70..61ef485 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 0
8 -SUBLEVEL = 33
9 +SUBLEVEL = 34
10 EXTRAVERSION =
11 NAME = Sneaky Weasel
12
13 diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
14 index 5350342..07ef351 100644
15 --- a/arch/parisc/kernel/entry.S
16 +++ b/arch/parisc/kernel/entry.S
17 @@ -552,7 +552,7 @@
18 * entry (identifying the physical page) and %r23 up with
19 * the from tlb entry (or nothing if only a to entry---for
20 * clear_user_page_asm) */
21 - .macro do_alias spc,tmp,tmp1,va,pte,prot,fault
22 + .macro do_alias spc,tmp,tmp1,va,pte,prot,fault,patype
23 cmpib,COND(<>),n 0,\spc,\fault
24 ldil L%(TMPALIAS_MAP_START),\tmp
25 #if defined(CONFIG_64BIT) && (TMPALIAS_MAP_START >= 0x80000000)
26 @@ -581,11 +581,15 @@
27 */
28 cmpiclr,= 0x01,\tmp,%r0
29 ldi (_PAGE_DIRTY|_PAGE_READ|_PAGE_WRITE),\prot
30 -#ifdef CONFIG_64BIT
31 +.ifc \patype,20
32 depd,z \prot,8,7,\prot
33 -#else
34 +.else
35 +.ifc \patype,11
36 depw,z \prot,8,7,\prot
37 -#endif
38 +.else
39 + .error "undefined PA type to do_alias"
40 +.endif
41 +.endif
42 /*
43 * OK, it is in the temp alias region, check whether "from" or "to".
44 * Check "subtle" note in pacache.S re: r23/r26.
45 @@ -1189,7 +1193,7 @@ dtlb_miss_20w:
46 nop
47
48 dtlb_check_alias_20w:
49 - do_alias spc,t0,t1,va,pte,prot,dtlb_fault
50 + do_alias spc,t0,t1,va,pte,prot,dtlb_fault,20
51
52 idtlbt pte,prot
53
54 @@ -1213,7 +1217,7 @@ nadtlb_miss_20w:
55 nop
56
57 nadtlb_check_alias_20w:
58 - do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate
59 + do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,20
60
61 idtlbt pte,prot
62
63 @@ -1245,7 +1249,7 @@ dtlb_miss_11:
64 nop
65
66 dtlb_check_alias_11:
67 - do_alias spc,t0,t1,va,pte,prot,dtlb_fault
68 + do_alias spc,t0,t1,va,pte,prot,dtlb_fault,11
69
70 idtlba pte,(va)
71 idtlbp prot,(va)
72 @@ -1277,7 +1281,7 @@ nadtlb_miss_11:
73 nop
74
75 nadtlb_check_alias_11:
76 - do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate
77 + do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,11
78
79 idtlba pte,(va)
80 idtlbp prot,(va)
81 @@ -1304,7 +1308,7 @@ dtlb_miss_20:
82 nop
83
84 dtlb_check_alias_20:
85 - do_alias spc,t0,t1,va,pte,prot,dtlb_fault
86 + do_alias spc,t0,t1,va,pte,prot,dtlb_fault,20
87
88 idtlbt pte,prot
89
90 @@ -1330,7 +1334,7 @@ nadtlb_miss_20:
91 nop
92
93 nadtlb_check_alias_20:
94 - do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate
95 + do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,20
96
97 idtlbt pte,prot
98
99 @@ -1457,7 +1461,7 @@ naitlb_miss_20w:
100 nop
101
102 naitlb_check_alias_20w:
103 - do_alias spc,t0,t1,va,pte,prot,naitlb_fault
104 + do_alias spc,t0,t1,va,pte,prot,naitlb_fault,20
105
106 iitlbt pte,prot
107
108 @@ -1511,7 +1515,7 @@ naitlb_miss_11:
109 nop
110
111 naitlb_check_alias_11:
112 - do_alias spc,t0,t1,va,pte,prot,itlb_fault
113 + do_alias spc,t0,t1,va,pte,prot,itlb_fault,11
114
115 iitlba pte,(%sr0, va)
116 iitlbp prot,(%sr0, va)
117 @@ -1557,7 +1561,7 @@ naitlb_miss_20:
118 nop
119
120 naitlb_check_alias_20:
121 - do_alias spc,t0,t1,va,pte,prot,naitlb_fault
122 + do_alias spc,t0,t1,va,pte,prot,naitlb_fault,20
123
124 iitlbt pte,prot
125
126 diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
127 index fa6f2b8..64a9998 100644
128 --- a/arch/parisc/kernel/vmlinux.lds.S
129 +++ b/arch/parisc/kernel/vmlinux.lds.S
130 @@ -50,8 +50,10 @@ SECTIONS
131 . = KERNEL_BINARY_TEXT_START;
132
133 _text = .; /* Text and read-only data */
134 - .text ALIGN(16) : {
135 + .head ALIGN(16) : {
136 HEAD_TEXT
137 + } = 0
138 + .text ALIGN(16) : {
139 TEXT_TEXT
140 SCHED_TEXT
141 LOCK_TEXT
142 @@ -65,7 +67,7 @@ SECTIONS
143 *(.fixup)
144 *(.lock.text) /* out-of-line lock text */
145 *(.gnu.warning)
146 - } = 0
147 + }
148 /* End of text section */
149 _etext = .;
150
151 diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h
152 index effff47..43876f1 100644
153 --- a/arch/x86/include/asm/pgtable-3level.h
154 +++ b/arch/x86/include/asm/pgtable-3level.h
155 @@ -31,6 +31,56 @@ static inline void native_set_pte(pte_t *ptep, pte_t pte)
156 ptep->pte_low = pte.pte_low;
157 }
158
159 +#define pmd_read_atomic pmd_read_atomic
160 +/*
161 + * pte_offset_map_lock on 32bit PAE kernels was reading the pmd_t with
162 + * a "*pmdp" dereference done by gcc. Problem is, in certain places
163 + * where pte_offset_map_lock is called, concurrent page faults are
164 + * allowed, if the mmap_sem is hold for reading. An example is mincore
165 + * vs page faults vs MADV_DONTNEED. On the page fault side
166 + * pmd_populate rightfully does a set_64bit, but if we're reading the
167 + * pmd_t with a "*pmdp" on the mincore side, a SMP race can happen
168 + * because gcc will not read the 64bit of the pmd atomically. To fix
169 + * this all places running pmd_offset_map_lock() while holding the
170 + * mmap_sem in read mode, shall read the pmdp pointer using this
171 + * function to know if the pmd is null nor not, and in turn to know if
172 + * they can run pmd_offset_map_lock or pmd_trans_huge or other pmd
173 + * operations.
174 + *
175 + * Without THP if the mmap_sem is hold for reading, the
176 + * pmd can only transition from null to not null while pmd_read_atomic runs.
177 + * So there's no need of literally reading it atomically.
178 + *
179 + * With THP if the mmap_sem is hold for reading, the pmd can become
180 + * THP or null or point to a pte (and in turn become "stable") at any
181 + * time under pmd_read_atomic, so it's mandatory to read it atomically
182 + * with cmpxchg8b.
183 + */
184 +#ifndef CONFIG_TRANSPARENT_HUGEPAGE
185 +static inline pmd_t pmd_read_atomic(pmd_t *pmdp)
186 +{
187 + pmdval_t ret;
188 + u32 *tmp = (u32 *)pmdp;
189 +
190 + ret = (pmdval_t) (*tmp);
191 + if (ret) {
192 + /*
193 + * If the low part is null, we must not read the high part
194 + * or we can end up with a partial pmd.
195 + */
196 + smp_rmb();
197 + ret |= ((pmdval_t)*(tmp + 1)) << 32;
198 + }
199 +
200 + return (pmd_t) { ret };
201 +}
202 +#else /* CONFIG_TRANSPARENT_HUGEPAGE */
203 +static inline pmd_t pmd_read_atomic(pmd_t *pmdp)
204 +{
205 + return (pmd_t) { atomic64_read((atomic64_t *)pmdp) };
206 +}
207 +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
208 +
209 static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
210 {
211 set_64bit((unsigned long long *)(ptep), native_pte_val(pte));
212 diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
213 index fcc13ac..d77c97d 100644
214 --- a/drivers/acpi/battery.c
215 +++ b/drivers/acpi/battery.c
216 @@ -635,11 +635,19 @@ static int acpi_battery_update(struct acpi_battery *battery)
217
218 static void acpi_battery_refresh(struct acpi_battery *battery)
219 {
220 + int power_unit;
221 +
222 if (!battery->bat.dev)
223 return;
224
225 + power_unit = battery->power_unit;
226 +
227 acpi_battery_get_info(battery);
228 - /* The battery may have changed its reporting units. */
229 +
230 + if (power_unit == battery->power_unit)
231 + return;
232 +
233 + /* The battery has changed its reporting units. */
234 sysfs_remove_battery(battery);
235 sysfs_add_battery(battery);
236 }
237 diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
238 index 5d1d076..d452592 100644
239 --- a/drivers/atm/solos-pci.c
240 +++ b/drivers/atm/solos-pci.c
241 @@ -984,6 +984,7 @@ static uint32_t fpga_tx(struct solos_card *card)
242 } else if (skb && card->using_dma) {
243 SKB_CB(skb)->dma_addr = pci_map_single(card->dev, skb->data,
244 skb->len, PCI_DMA_TODEVICE);
245 + card->tx_skb[port] = skb;
246 iowrite32(SKB_CB(skb)->dma_addr,
247 card->config_regs + TX_DMA_ADDR(port));
248 }
249 @@ -1152,7 +1153,8 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
250 db_fpga_upgrade = db_firmware_upgrade = 0;
251 }
252
253 - if (card->fpga_version >= DMA_SUPPORTED){
254 + if (card->fpga_version >= DMA_SUPPORTED) {
255 + pci_set_master(dev);
256 card->using_dma = 1;
257 } else {
258 card->using_dma = 0;
259 diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
260 index a714c73..305e752 100644
261 --- a/drivers/bluetooth/ath3k.c
262 +++ b/drivers/bluetooth/ath3k.c
263 @@ -78,6 +78,9 @@ static struct usb_device_id ath3k_table[] = {
264 /* Atheros AR5BBU12 with sflash firmware */
265 { USB_DEVICE(0x0489, 0xE02C) },
266
267 + /* Atheros AR5BBU22 with sflash firmware */
268 + { USB_DEVICE(0x0489, 0xE03C) },
269 +
270 { } /* Terminating entry */
271 };
272
273 @@ -94,6 +97,9 @@ static struct usb_device_id ath3k_blist_tbl[] = {
274 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
275 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
276
277 + /* Atheros AR5BBU22 with sflash firmware */
278 + { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
279 +
280 { } /* Terminating entry */
281 };
282
283 diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
284 index 8fbda40..f4585b9 100644
285 --- a/drivers/bluetooth/btusb.c
286 +++ b/drivers/bluetooth/btusb.c
287 @@ -61,7 +61,7 @@ static struct usb_device_id btusb_table[] = {
288 { USB_DEVICE_INFO(0xe0, 0x01, 0x01) },
289
290 /* Broadcom SoftSailing reporting vendor specific */
291 - { USB_DEVICE(0x05ac, 0x21e1) },
292 + { USB_DEVICE(0x0a5c, 0x21e1) },
293
294 /* Apple MacBookPro 7,1 */
295 { USB_DEVICE(0x05ac, 0x8213) },
296 @@ -100,6 +100,17 @@ static struct usb_device_id btusb_table[] = {
297 /* Canyon CN-BTU1 with HID interfaces */
298 { USB_DEVICE(0x0c10, 0x0000) },
299
300 + /* Broadcom BCM20702A0 */
301 + { USB_DEVICE(0x0489, 0xe042) },
302 + { USB_DEVICE(0x0a5c, 0x21e3) },
303 + { USB_DEVICE(0x0a5c, 0x21e6) },
304 + { USB_DEVICE(0x0a5c, 0x21e8) },
305 + { USB_DEVICE(0x0a5c, 0x21f3) },
306 + { USB_DEVICE(0x413c, 0x8197) },
307 +
308 + /* Foxconn - Hon Hai */
309 + { USB_DEVICE(0x0489, 0xe033) },
310 +
311 { } /* Terminating entry */
312 };
313
314 @@ -130,6 +141,9 @@ static struct usb_device_id blacklist_table[] = {
315 /* Atheros AR5BBU12 with sflash firmware */
316 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
317
318 + /* Atheros AR5BBU12 with sflash firmware */
319 + { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 },
320 +
321 /* Broadcom BCM2035 */
322 { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU },
323 { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU },
324 diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
325 index 06bc46e..c901060 100644
326 --- a/drivers/gpu/drm/i915/intel_sdvo.c
327 +++ b/drivers/gpu/drm/i915/intel_sdvo.c
328 @@ -762,10 +762,12 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd,
329 ((v_sync_len & 0x30) >> 4);
330
331 dtd->part2.dtd_flags = 0x18;
332 + if (mode->flags & DRM_MODE_FLAG_INTERLACE)
333 + dtd->part2.dtd_flags |= DTD_FLAG_INTERLACE;
334 if (mode->flags & DRM_MODE_FLAG_PHSYNC)
335 - dtd->part2.dtd_flags |= 0x2;
336 + dtd->part2.dtd_flags |= DTD_FLAG_HSYNC_POSITIVE;
337 if (mode->flags & DRM_MODE_FLAG_PVSYNC)
338 - dtd->part2.dtd_flags |= 0x4;
339 + dtd->part2.dtd_flags |= DTD_FLAG_VSYNC_POSITIVE;
340
341 dtd->part2.sdvo_flags = 0;
342 dtd->part2.v_sync_off_high = v_sync_offset & 0xc0;
343 @@ -799,9 +801,11 @@ static void intel_sdvo_get_mode_from_dtd(struct drm_display_mode * mode,
344 mode->clock = dtd->part1.clock * 10;
345
346 mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
347 - if (dtd->part2.dtd_flags & 0x2)
348 + if (dtd->part2.dtd_flags & DTD_FLAG_INTERLACE)
349 + mode->flags |= DRM_MODE_FLAG_INTERLACE;
350 + if (dtd->part2.dtd_flags & DTD_FLAG_HSYNC_POSITIVE)
351 mode->flags |= DRM_MODE_FLAG_PHSYNC;
352 - if (dtd->part2.dtd_flags & 0x4)
353 + if (dtd->part2.dtd_flags & DTD_FLAG_VSYNC_POSITIVE)
354 mode->flags |= DRM_MODE_FLAG_PVSYNC;
355 }
356
357 diff --git a/drivers/gpu/drm/i915/intel_sdvo_regs.h b/drivers/gpu/drm/i915/intel_sdvo_regs.h
358 index 4f4e23b..c5c8ddf 100644
359 --- a/drivers/gpu/drm/i915/intel_sdvo_regs.h
360 +++ b/drivers/gpu/drm/i915/intel_sdvo_regs.h
361 @@ -61,6 +61,11 @@ struct intel_sdvo_caps {
362 u16 output_flags;
363 } __attribute__((packed));
364
365 +/* Note: SDVO detailed timing flags match EDID misc flags. */
366 +#define DTD_FLAG_HSYNC_POSITIVE (1 << 1)
367 +#define DTD_FLAG_VSYNC_POSITIVE (1 << 2)
368 +#define DTD_FLAG_INTERLACE (1 << 7)
369 +
370 /** This matches the EDID DTD structure, more or less */
371 struct intel_sdvo_dtd {
372 struct {
373 diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
374 index f57b08b..2136e6b 100644
375 --- a/drivers/gpu/drm/i915/intel_tv.c
376 +++ b/drivers/gpu/drm/i915/intel_tv.c
377 @@ -1301,6 +1301,11 @@ intel_tv_detect_type (struct intel_tv *intel_tv,
378
379 I915_WRITE(TV_DAC, save_tv_dac & ~TVDAC_STATE_CHG_EN);
380 I915_WRITE(TV_CTL, save_tv_ctl);
381 + POSTING_READ(TV_CTL);
382 +
383 + /* For unknown reasons the hw barfs if we don't do this vblank wait. */
384 + intel_wait_for_vblank(intel_tv->base.base.dev,
385 + to_intel_crtc(intel_tv->base.base.crtc)->pipe);
386
387 /* Restore interrupt config */
388 if (connector->polled & DRM_CONNECTOR_POLL_HPD) {
389 diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
390 index fe052c6..8846bad 100644
391 --- a/drivers/gpu/drm/radeon/evergreen.c
392 +++ b/drivers/gpu/drm/radeon/evergreen.c
393 @@ -926,6 +926,11 @@ int evergreen_pcie_gart_enable(struct radeon_device *rdev)
394 WREG32(MC_VM_MD_L1_TLB0_CNTL, tmp);
395 WREG32(MC_VM_MD_L1_TLB1_CNTL, tmp);
396 WREG32(MC_VM_MD_L1_TLB2_CNTL, tmp);
397 + if ((rdev->family == CHIP_JUNIPER) ||
398 + (rdev->family == CHIP_CYPRESS) ||
399 + (rdev->family == CHIP_HEMLOCK) ||
400 + (rdev->family == CHIP_BARTS))
401 + WREG32(MC_VM_MD_L1_TLB3_CNTL, tmp);
402 }
403 WREG32(MC_VM_MB_L1_TLB0_CNTL, tmp);
404 WREG32(MC_VM_MB_L1_TLB1_CNTL, tmp);
405 @@ -2064,9 +2069,9 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
406 WREG32(CC_SYS_RB_BACKEND_DISABLE, rb);
407 WREG32(GC_USER_RB_BACKEND_DISABLE, rb);
408 WREG32(CC_GC_SHADER_PIPE_CONFIG, sp);
409 - }
410 + }
411
412 - grbm_gfx_index |= SE_BROADCAST_WRITES;
413 + grbm_gfx_index = INSTANCE_BROADCAST_WRITES | SE_BROADCAST_WRITES;
414 WREG32(GRBM_GFX_INDEX, grbm_gfx_index);
415 WREG32(RLC_GFX_INDEX, grbm_gfx_index);
416
417 diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h
418 index b7b2714..6078ae4 100644
419 --- a/drivers/gpu/drm/radeon/evergreend.h
420 +++ b/drivers/gpu/drm/radeon/evergreend.h
421 @@ -230,6 +230,7 @@
422 #define MC_VM_MD_L1_TLB0_CNTL 0x2654
423 #define MC_VM_MD_L1_TLB1_CNTL 0x2658
424 #define MC_VM_MD_L1_TLB2_CNTL 0x265C
425 +#define MC_VM_MD_L1_TLB3_CNTL 0x2698
426
427 #define FUS_MC_VM_MD_L1_TLB0_CNTL 0x265C
428 #define FUS_MC_VM_MD_L1_TLB1_CNTL 0x2660
429 diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
430 index a324564..ef6b426 100644
431 --- a/drivers/gpu/drm/radeon/radeon_atombios.c
432 +++ b/drivers/gpu/drm/radeon/radeon_atombios.c
433 @@ -480,7 +480,9 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
434 */
435 if ((dev->pdev->device == 0x9498) &&
436 (dev->pdev->subsystem_vendor == 0x1682) &&
437 - (dev->pdev->subsystem_device == 0x2452)) {
438 + (dev->pdev->subsystem_device == 0x2452) &&
439 + (i2c_bus->valid == false) &&
440 + !(supported_device & (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT))) {
441 struct radeon_device *rdev = dev->dev_private;
442 *i2c_bus = radeon_lookup_i2c_gpio(rdev, 0x93);
443 }
444 diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
445 index 84cf82f..51d20aa 100644
446 --- a/drivers/gpu/drm/radeon/rv770.c
447 +++ b/drivers/gpu/drm/radeon/rv770.c
448 @@ -151,6 +151,8 @@ int rv770_pcie_gart_enable(struct radeon_device *rdev)
449 WREG32(MC_VM_MD_L1_TLB0_CNTL, tmp);
450 WREG32(MC_VM_MD_L1_TLB1_CNTL, tmp);
451 WREG32(MC_VM_MD_L1_TLB2_CNTL, tmp);
452 + if (rdev->family == CHIP_RV740)
453 + WREG32(MC_VM_MD_L1_TLB3_CNTL, tmp);
454 WREG32(MC_VM_MB_L1_TLB0_CNTL, tmp);
455 WREG32(MC_VM_MB_L1_TLB1_CNTL, tmp);
456 WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp);
457 diff --git a/drivers/gpu/drm/radeon/rv770d.h b/drivers/gpu/drm/radeon/rv770d.h
458 index 79fa588..7538092 100644
459 --- a/drivers/gpu/drm/radeon/rv770d.h
460 +++ b/drivers/gpu/drm/radeon/rv770d.h
461 @@ -174,6 +174,7 @@
462 #define MC_VM_MD_L1_TLB0_CNTL 0x2654
463 #define MC_VM_MD_L1_TLB1_CNTL 0x2658
464 #define MC_VM_MD_L1_TLB2_CNTL 0x265C
465 +#define MC_VM_MD_L1_TLB3_CNTL 0x2698
466 #define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C
467 #define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038
468 #define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034
469 diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
470 index 81b6850..7632edb 100644
471 --- a/drivers/gpu/drm/ttm/ttm_bo.c
472 +++ b/drivers/gpu/drm/ttm/ttm_bo.c
473 @@ -1809,6 +1809,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
474 spin_unlock(&glob->lru_lock);
475 (void) ttm_bo_cleanup_refs(bo, false, false, false);
476 kref_put(&bo->list_kref, ttm_bo_release_list);
477 + spin_lock(&glob->lru_lock);
478 continue;
479 }
480
481 diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
482 index ccbeaa1..cc81cd6 100644
483 --- a/drivers/mtd/nand/nand_bbt.c
484 +++ b/drivers/mtd/nand/nand_bbt.c
485 @@ -360,6 +360,7 @@ static int scan_read_raw_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
486
487 buf += mtd->oobsize + mtd->writesize;
488 len -= mtd->writesize;
489 + offs += mtd->writesize;
490 }
491 return 0;
492 }
493 diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
494 index ab4723d..735f726 100644
495 --- a/drivers/net/macvlan.c
496 +++ b/drivers/net/macvlan.c
497 @@ -247,7 +247,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
498
499 xmit_world:
500 skb->ip_summed = ip_summed;
501 - skb_set_dev(skb, vlan->lowerdev);
502 + skb->dev = vlan->lowerdev;
503 return dev_queue_xmit(skb);
504 }
505
506 diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
507 index 592b0cf..2aed7a0 100644
508 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
509 +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
510 @@ -878,6 +878,7 @@ static void rs_bt_update_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
511 if ((priv->bt_traffic_load != priv->last_bt_traffic_load) ||
512 (priv->bt_full_concurrent != full_concurrent)) {
513 priv->bt_full_concurrent = full_concurrent;
514 + priv->last_bt_traffic_load = priv->bt_traffic_load;
515
516 /* Update uCode's rate table. */
517 tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
518 diff --git a/drivers/net/wireless/wl1251/sdio.c b/drivers/net/wireless/wl1251/sdio.c
519 index 85a7101..4cf5c2e 100644
520 --- a/drivers/net/wireless/wl1251/sdio.c
521 +++ b/drivers/net/wireless/wl1251/sdio.c
522 @@ -259,6 +259,7 @@ static int wl1251_sdio_probe(struct sdio_func *func,
523 }
524
525 if (wl->irq) {
526 + irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
527 ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl);
528 if (ret < 0) {
529 wl1251_error("request_irq() failed: %d", ret);
530 @@ -266,7 +267,6 @@ static int wl1251_sdio_probe(struct sdio_func *func,
531 }
532
533 irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
534 - disable_irq(wl->irq);
535
536 wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq;
537 wl1251_sdio_ops.disable_irq = wl1251_disable_line_irq;
538 diff --git a/drivers/net/wireless/wl1251/spi.c b/drivers/net/wireless/wl1251/spi.c
539 index af6448c..49f3651 100644
540 --- a/drivers/net/wireless/wl1251/spi.c
541 +++ b/drivers/net/wireless/wl1251/spi.c
542 @@ -280,6 +280,7 @@ static int __devinit wl1251_spi_probe(struct spi_device *spi)
543
544 wl->use_eeprom = pdata->use_eeprom;
545
546 + irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
547 ret = request_irq(wl->irq, wl1251_irq, 0, DRIVER_NAME, wl);
548 if (ret < 0) {
549 wl1251_error("request_irq() failed: %d", ret);
550 @@ -288,8 +289,6 @@ static int __devinit wl1251_spi_probe(struct spi_device *spi)
551
552 irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
553
554 - disable_irq(wl->irq);
555 -
556 ret = wl1251_init_ieee80211(wl);
557 if (ret)
558 goto out_irq;
559 diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
560 index 72ab1e6..99fc45b 100644
561 --- a/drivers/scsi/scsi_lib.c
562 +++ b/drivers/scsi/scsi_lib.c
563 @@ -1380,16 +1380,19 @@ static int scsi_lld_busy(struct request_queue *q)
564 {
565 struct scsi_device *sdev = q->queuedata;
566 struct Scsi_Host *shost;
567 - struct scsi_target *starget;
568
569 if (!sdev)
570 return 0;
571
572 shost = sdev->host;
573 - starget = scsi_target(sdev);
574
575 - if (scsi_host_in_recovery(shost) || scsi_host_is_busy(shost) ||
576 - scsi_target_is_busy(starget) || scsi_device_is_busy(sdev))
577 + /*
578 + * Ignore host/starget busy state.
579 + * Since block layer does not have a concept of fairness across
580 + * multiple queues, congestion of host/starget needs to be handled
581 + * in SCSI layer.
582 + */
583 + if (scsi_host_in_recovery(shost) || scsi_device_is_busy(sdev))
584 return 1;
585
586 return 0;
587 diff --git a/drivers/scsi/scsi_wait_scan.c b/drivers/scsi/scsi_wait_scan.c
588 index 74708fc..ae78148 100644
589 --- a/drivers/scsi/scsi_wait_scan.c
590 +++ b/drivers/scsi/scsi_wait_scan.c
591 @@ -12,7 +12,7 @@
592
593 #include <linux/module.h>
594 #include <linux/device.h>
595 -#include <scsi/scsi_scan.h>
596 +#include "scsi_priv.h"
597
598 static int __init wait_scan_init(void)
599 {
600 diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
601 index 6255fa8..7cb9dd2 100644
602 --- a/fs/cifs/cifsglob.h
603 +++ b/fs/cifs/cifsglob.h
604 @@ -43,6 +43,7 @@
605
606 #define CIFS_MIN_RCV_POOL 4
607
608 +#define MAX_REOPEN_ATT 5 /* these many maximum attempts to reopen a file */
609 /*
610 * default attribute cache timeout (jiffies)
611 */
612 diff --git a/fs/cifs/file.c b/fs/cifs/file.c
613 index a9b4a24..9040cb0 100644
614 --- a/fs/cifs/file.c
615 +++ b/fs/cifs/file.c
616 @@ -973,10 +973,11 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
617 struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
618 bool fsuid_only)
619 {
620 - struct cifsFileInfo *open_file;
621 + struct cifsFileInfo *open_file, *inv_file = NULL;
622 struct cifs_sb_info *cifs_sb;
623 bool any_available = false;
624 int rc;
625 + unsigned int refind = 0;
626
627 /* Having a null inode here (because mapping->host was set to zero by
628 the VFS or MM) should not happen but we had reports of on oops (due to
629 @@ -996,40 +997,25 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
630
631 spin_lock(&cifs_file_list_lock);
632 refind_writable:
633 + if (refind > MAX_REOPEN_ATT) {
634 + spin_unlock(&cifs_file_list_lock);
635 + return NULL;
636 + }
637 list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {
638 if (!any_available && open_file->pid != current->tgid)
639 continue;
640 if (fsuid_only && open_file->uid != current_fsuid())
641 continue;
642 if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) {
643 - cifsFileInfo_get(open_file);
644 -
645 if (!open_file->invalidHandle) {
646 /* found a good writable file */
647 + cifsFileInfo_get(open_file);
648 spin_unlock(&cifs_file_list_lock);
649 return open_file;
650 + } else {
651 + if (!inv_file)
652 + inv_file = open_file;
653 }
654 -
655 - spin_unlock(&cifs_file_list_lock);
656 -
657 - /* Had to unlock since following call can block */
658 - rc = cifs_reopen_file(open_file, false);
659 - if (!rc)
660 - return open_file;
661 -
662 - /* if it fails, try another handle if possible */
663 - cFYI(1, "wp failed on reopen file");
664 - cifsFileInfo_put(open_file);
665 -
666 - spin_lock(&cifs_file_list_lock);
667 -
668 - /* else we simply continue to the next entry. Thus
669 - we do not loop on reopen errors. If we
670 - can not reopen the file, for example if we
671 - reconnected to a server with another client
672 - racing to delete or lock the file we would not
673 - make progress if we restarted before the beginning
674 - of the loop here. */
675 }
676 }
677 /* couldn't find useable FH with same pid, try any available */
678 @@ -1037,7 +1023,30 @@ refind_writable:
679 any_available = true;
680 goto refind_writable;
681 }
682 +
683 + if (inv_file) {
684 + any_available = false;
685 + cifsFileInfo_get(inv_file);
686 + }
687 +
688 spin_unlock(&cifs_file_list_lock);
689 +
690 + if (inv_file) {
691 + rc = cifs_reopen_file(inv_file, false);
692 + if (!rc)
693 + return inv_file;
694 + else {
695 + spin_lock(&cifs_file_list_lock);
696 + list_move_tail(&inv_file->flist,
697 + &cifs_inode->openFileList);
698 + spin_unlock(&cifs_file_list_lock);
699 + cifsFileInfo_put(inv_file);
700 + spin_lock(&cifs_file_list_lock);
701 + ++refind;
702 + goto refind_writable;
703 + }
704 + }
705 +
706 return NULL;
707 }
708
709 diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
710 index 808c554..4cbe1c2 100644
711 --- a/fs/ext4/ioctl.c
712 +++ b/fs/ext4/ioctl.c
713 @@ -35,7 +35,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
714 handle_t *handle = NULL;
715 int err, migrate = 0;
716 struct ext4_iloc iloc;
717 - unsigned int oldflags;
718 + unsigned int oldflags, mask, i;
719 unsigned int jflag;
720
721 if (!inode_owner_or_capable(inode))
722 @@ -112,9 +112,14 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
723 if (err)
724 goto flags_err;
725
726 - flags = flags & EXT4_FL_USER_MODIFIABLE;
727 - flags |= oldflags & ~EXT4_FL_USER_MODIFIABLE;
728 - ei->i_flags = flags;
729 + for (i = 0, mask = 1; i < 32; i++, mask <<= 1) {
730 + if (!(mask & EXT4_FL_USER_MODIFIABLE))
731 + continue;
732 + if (mask & flags)
733 + ext4_set_inode_flag(inode, i);
734 + else
735 + ext4_clear_inode_flag(inode, i);
736 + }
737
738 ext4_set_inode_flags(inode);
739 inode->i_ctime = ext4_current_time(inode);
740 diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
741 index 0f1be7f..b6adf68 100644
742 --- a/fs/ext4/mballoc.c
743 +++ b/fs/ext4/mballoc.c
744 @@ -2528,6 +2528,9 @@ int ext4_mb_release(struct super_block *sb)
745 struct ext4_sb_info *sbi = EXT4_SB(sb);
746 struct kmem_cache *cachep = get_groupinfo_cache(sb->s_blocksize_bits);
747
748 + if (sbi->s_proc)
749 + remove_proc_entry("mb_groups", sbi->s_proc);
750 +
751 if (sbi->s_group_info) {
752 for (i = 0; i < ngroups; i++) {
753 grinfo = ext4_get_group_info(sb, i);
754 @@ -2575,8 +2578,6 @@ int ext4_mb_release(struct super_block *sb)
755 }
756
757 free_percpu(sbi->s_locality_groups);
758 - if (sbi->s_proc)
759 - remove_proc_entry("mb_groups", sbi->s_proc);
760
761 return 0;
762 }
763 @@ -4583,6 +4584,7 @@ do_more:
764 */
765 new_entry = kmem_cache_alloc(ext4_free_ext_cachep, GFP_NOFS);
766 if (!new_entry) {
767 + ext4_mb_unload_buddy(&e4b);
768 err = -ENOMEM;
769 goto error_return;
770 }
771 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
772 index df121b2..113b107 100644
773 --- a/fs/ext4/super.c
774 +++ b/fs/ext4/super.c
775 @@ -433,6 +433,7 @@ void __ext4_error(struct super_block *sb, const char *function,
776 printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: comm %s: %pV\n",
777 sb->s_id, function, line, current->comm, &vaf);
778 va_end(args);
779 + save_error_info(sb, function, line);
780
781 ext4_handle_error(sb);
782 }
783 @@ -3618,7 +3619,8 @@ no_journal:
784 goto failed_mount4;
785 }
786
787 - ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY);
788 + if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY))
789 + sb->s_flags |= MS_RDONLY;
790
791 /* determine the minimum size of new large inodes, if present */
792 if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) {
793 diff --git a/fs/namespace.c b/fs/namespace.c
794 index edc1c4a..b3d8f51 100644
795 --- a/fs/namespace.c
796 +++ b/fs/namespace.c
797 @@ -1244,8 +1244,9 @@ void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill)
798 list_del_init(&p->mnt_expire);
799 list_del_init(&p->mnt_list);
800 __touch_mnt_namespace(p->mnt_ns);
801 + if (p->mnt_ns)
802 + __mnt_make_shortterm(p);
803 p->mnt_ns = NULL;
804 - __mnt_make_shortterm(p);
805 list_del_init(&p->mnt_child);
806 if (p->mnt_parent != p) {
807 p->mnt_parent->mnt_ghosts++;
808 diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
809 index 30f6548..b7a7e5f 100644
810 --- a/fs/nfs/nfs4proc.c
811 +++ b/fs/nfs/nfs4proc.c
812 @@ -94,6 +94,8 @@ static int nfs4_map_errors(int err)
813 case -NFS4ERR_BADOWNER:
814 case -NFS4ERR_BADNAME:
815 return -EINVAL;
816 + case -NFS4ERR_SHARE_DENIED:
817 + return -EACCES;
818 default:
819 dprintk("%s could not handle NFSv4 error %d\n",
820 __func__, -err);
821 diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
822 index a03c098..831924a 100644
823 --- a/include/asm-generic/pgtable.h
824 +++ b/include/asm-generic/pgtable.h
825 @@ -445,6 +445,18 @@ static inline int pmd_write(pmd_t pmd)
826 #endif /* __HAVE_ARCH_PMD_WRITE */
827 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
828
829 +#ifndef pmd_read_atomic
830 +static inline pmd_t pmd_read_atomic(pmd_t *pmdp)
831 +{
832 + /*
833 + * Depend on compiler for an atomic pmd read. NOTE: this is
834 + * only going to work, if the pmdval_t isn't larger than
835 + * an unsigned long.
836 + */
837 + return *pmdp;
838 +}
839 +#endif
840 +
841 /*
842 * This function is meant to be used by sites walking pagetables with
843 * the mmap_sem hold in read mode to protect against MADV_DONTNEED and
844 @@ -458,11 +470,17 @@ static inline int pmd_write(pmd_t pmd)
845 * undefined so behaving like if the pmd was none is safe (because it
846 * can return none anyway). The compiler level barrier() is critically
847 * important to compute the two checks atomically on the same pmdval.
848 + *
849 + * For 32bit kernels with a 64bit large pmd_t this automatically takes
850 + * care of reading the pmd atomically to avoid SMP race conditions
851 + * against pmd_populate() when the mmap_sem is hold for reading by the
852 + * caller (a special atomic read not done by "gcc" as in the generic
853 + * version above, is also needed when THP is disabled because the page
854 + * fault can populate the pmd from under us).
855 */
856 static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd)
857 {
858 - /* depend on compiler for an atomic pmd read */
859 - pmd_t pmdval = *pmd;
860 + pmd_t pmdval = pmd_read_atomic(pmd);
861 /*
862 * The barrier will stabilize the pmdval in a register or on
863 * the stack so that it will stop changing under the code.
864 diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
865 index 14b6cd0..4306811 100644
866 --- a/include/drm/drm_pciids.h
867 +++ b/include/drm/drm_pciids.h
868 @@ -181,6 +181,7 @@
869 {0x1002, 0x6747, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
870 {0x1002, 0x6748, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
871 {0x1002, 0x6749, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
872 + {0x1002, 0x674A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
873 {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
874 {0x1002, 0x6751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
875 {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
876 @@ -198,6 +199,7 @@
877 {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
878 {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
879 {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
880 + {0x1002, 0x6771, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
881 {0x1002, 0x6772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
882 {0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
883 {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
884 diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
885 index 33b5968..c6d6d48 100644
886 --- a/include/linux/netdevice.h
887 +++ b/include/linux/netdevice.h
888 @@ -1453,15 +1453,6 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev)
889 return 0;
890 }
891
892 -#ifndef CONFIG_NET_NS
893 -static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev)
894 -{
895 - skb->dev = dev;
896 -}
897 -#else /* CONFIG_NET_NS */
898 -void skb_set_dev(struct sk_buff *skb, struct net_device *dev);
899 -#endif
900 -
901 static inline bool netdev_uses_trailer_tags(struct net_device *dev)
902 {
903 #ifdef CONFIG_NET_DSA_TAG_TRAILER
904 diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
905 index f13b52b..37b643b 100644
906 --- a/include/linux/skbuff.h
907 +++ b/include/linux/skbuff.h
908 @@ -1633,8 +1633,6 @@ static inline int __skb_cow(struct sk_buff *skb, unsigned int headroom,
909 {
910 int delta = 0;
911
912 - if (headroom < NET_SKB_PAD)
913 - headroom = NET_SKB_PAD;
914 if (headroom > skb_headroom(skb))
915 delta = headroom - skb_headroom(skb);
916
917 diff --git a/include/net/dst.h b/include/net/dst.h
918 index d020134..7907ff1 100644
919 --- a/include/net/dst.h
920 +++ b/include/net/dst.h
921 @@ -78,6 +78,7 @@ struct dst_entry {
922 #define DST_NOHASH 0x0008
923 #define DST_NOCACHE 0x0010
924 #define DST_NOCOUNT 0x0020
925 +#define DST_XFRM_TUNNEL 0x0100
926 union {
927 struct dst_entry *next;
928 struct rtable __rcu *rt_next;
929 diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
930 index b2c2366..f686066 100644
931 --- a/include/net/sctp/sctp.h
932 +++ b/include/net/sctp/sctp.h
933 @@ -700,4 +700,17 @@ static inline void sctp_v4_map_v6(union sctp_addr *addr)
934 addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff);
935 }
936
937 +/* The cookie is always 0 since this is how it's used in the
938 + * pmtu code.
939 + */
940 +static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
941 +{
942 + if (t->dst && !dst_check(t->dst, 0)) {
943 + dst_release(t->dst);
944 + t->dst = NULL;
945 + }
946 +
947 + return t->dst;
948 +}
949 +
950 #endif /* __net_sctp_h__ */
951 diff --git a/mm/vmscan.c b/mm/vmscan.c
952 index 6072d74..769935d 100644
953 --- a/mm/vmscan.c
954 +++ b/mm/vmscan.c
955 @@ -665,7 +665,7 @@ static enum page_references page_check_references(struct page *page,
956 return PAGEREF_RECLAIM;
957
958 if (referenced_ptes) {
959 - if (PageAnon(page))
960 + if (PageSwapBacked(page))
961 return PAGEREF_ACTIVATE;
962 /*
963 * All mapped pages start out with page table
964 diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
965 index 5b4f51d..d548456 100644
966 --- a/net/8021q/vlan_dev.c
967 +++ b/net/8021q/vlan_dev.c
968 @@ -154,7 +154,7 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,
969 skb = __vlan_hwaccel_put_tag(skb, vlan_tci);
970 }
971
972 - skb_set_dev(skb, vlan_dev_info(dev)->real_dev);
973 + skb->dev = vlan_dev_info(dev)->real_dev;
974 len = skb->len;
975 ret = dev_queue_xmit(skb);
976
977 diff --git a/net/core/dev.c b/net/core/dev.c
978 index 1e77897..a71eafc 100644
979 --- a/net/core/dev.c
980 +++ b/net/core/dev.c
981 @@ -1533,10 +1533,14 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
982 kfree_skb(skb);
983 return NET_RX_DROP;
984 }
985 - skb_set_dev(skb, dev);
986 + skb->dev = dev;
987 + skb_dst_drop(skb);
988 skb->tstamp.tv64 = 0;
989 skb->pkt_type = PACKET_HOST;
990 skb->protocol = eth_type_trans(skb, dev);
991 + skb->mark = 0;
992 + secpath_reset(skb);
993 + nf_reset(skb);
994 return netif_rx(skb);
995 }
996 EXPORT_SYMBOL_GPL(dev_forward_skb);
997 @@ -1791,36 +1795,6 @@ void netif_device_attach(struct net_device *dev)
998 }
999 EXPORT_SYMBOL(netif_device_attach);
1000
1001 -/**
1002 - * skb_dev_set -- assign a new device to a buffer
1003 - * @skb: buffer for the new device
1004 - * @dev: network device
1005 - *
1006 - * If an skb is owned by a device already, we have to reset
1007 - * all data private to the namespace a device belongs to
1008 - * before assigning it a new device.
1009 - */
1010 -#ifdef CONFIG_NET_NS
1011 -void skb_set_dev(struct sk_buff *skb, struct net_device *dev)
1012 -{
1013 - skb_dst_drop(skb);
1014 - if (skb->dev && !net_eq(dev_net(skb->dev), dev_net(dev))) {
1015 - secpath_reset(skb);
1016 - nf_reset(skb);
1017 - skb_init_secmark(skb);
1018 - skb->mark = 0;
1019 - skb->priority = 0;
1020 - skb->nf_trace = 0;
1021 - skb->ipvs_property = 0;
1022 -#ifdef CONFIG_NET_SCHED
1023 - skb->tc_index = 0;
1024 -#endif
1025 - }
1026 - skb->dev = dev;
1027 -}
1028 -EXPORT_SYMBOL(skb_set_dev);
1029 -#endif /* CONFIG_NET_NS */
1030 -
1031 /*
1032 * Invalidate hardware checksum when packet is to be mangled, and
1033 * complete checksum manually on outgoing path.
1034 diff --git a/net/core/pktgen.c b/net/core/pktgen.c
1035 index e35a6fb..c0e0f76 100644
1036 --- a/net/core/pktgen.c
1037 +++ b/net/core/pktgen.c
1038 @@ -1932,7 +1932,7 @@ static int pktgen_device_event(struct notifier_block *unused,
1039 {
1040 struct net_device *dev = ptr;
1041
1042 - if (!net_eq(dev_net(dev), &init_net))
1043 + if (!net_eq(dev_net(dev), &init_net) || pktgen_exiting)
1044 return NOTIFY_DONE;
1045
1046 /* It is OK that we do not hold the group lock right now,
1047 @@ -3755,12 +3755,18 @@ static void __exit pg_cleanup(void)
1048 {
1049 struct pktgen_thread *t;
1050 struct list_head *q, *n;
1051 + LIST_HEAD(list);
1052
1053 /* Stop all interfaces & threads */
1054 pktgen_exiting = true;
1055
1056 - list_for_each_safe(q, n, &pktgen_threads) {
1057 + mutex_lock(&pktgen_thread_lock);
1058 + list_splice_init(&pktgen_threads, &list);
1059 + mutex_unlock(&pktgen_thread_lock);
1060 +
1061 + list_for_each_safe(q, n, &list) {
1062 t = list_entry(q, struct pktgen_thread, th_list);
1063 + list_del(&t->th_list);
1064 kthread_stop(t->tsk);
1065 kfree(t);
1066 }
1067 diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
1068 index a5b4134..530787b 100644
1069 --- a/net/ipv4/esp4.c
1070 +++ b/net/ipv4/esp4.c
1071 @@ -457,28 +457,22 @@ static u32 esp4_get_mtu(struct xfrm_state *x, int mtu)
1072 struct esp_data *esp = x->data;
1073 u32 blksize = ALIGN(crypto_aead_blocksize(esp->aead), 4);
1074 u32 align = max_t(u32, blksize, esp->padlen);
1075 - u32 rem;
1076 -
1077 - mtu -= x->props.header_len + crypto_aead_authsize(esp->aead);
1078 - rem = mtu & (align - 1);
1079 - mtu &= ~(align - 1);
1080 + unsigned int net_adj;
1081
1082 switch (x->props.mode) {
1083 - case XFRM_MODE_TUNNEL:
1084 - break;
1085 - default:
1086 case XFRM_MODE_TRANSPORT:
1087 - /* The worst case */
1088 - mtu -= blksize - 4;
1089 - mtu += min_t(u32, blksize - 4, rem);
1090 - break;
1091 case XFRM_MODE_BEET:
1092 - /* The worst case. */
1093 - mtu += min_t(u32, IPV4_BEET_PHMAXLEN, rem);
1094 + net_adj = sizeof(struct iphdr);
1095 break;
1096 + case XFRM_MODE_TUNNEL:
1097 + net_adj = 0;
1098 + break;
1099 + default:
1100 + BUG();
1101 }
1102
1103 - return mtu - 2;
1104 + return ((mtu - x->props.header_len - crypto_aead_authsize(esp->aead) -
1105 + net_adj) & ~(align - 1)) + (net_adj - 2);
1106 }
1107
1108 static void esp4_err(struct sk_buff *skb, u32 info)
1109 diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
1110 index 33e2c35..7e454ba 100644
1111 --- a/net/ipv4/fib_semantics.c
1112 +++ b/net/ipv4/fib_semantics.c
1113 @@ -142,6 +142,18 @@ const struct fib_prop fib_props[RTN_MAX + 1] = {
1114 };
1115
1116 /* Release a nexthop info record */
1117 +static void free_fib_info_rcu(struct rcu_head *head)
1118 +{
1119 + struct fib_info *fi = container_of(head, struct fib_info, rcu);
1120 +
1121 + change_nexthops(fi) {
1122 + if (nexthop_nh->nh_dev)
1123 + dev_put(nexthop_nh->nh_dev);
1124 + } endfor_nexthops(fi);
1125 +
1126 + release_net(fi->fib_net);
1127 + kfree(fi);
1128 +}
1129
1130 void free_fib_info(struct fib_info *fi)
1131 {
1132 @@ -149,14 +161,8 @@ void free_fib_info(struct fib_info *fi)
1133 pr_warning("Freeing alive fib_info %p\n", fi);
1134 return;
1135 }
1136 - change_nexthops(fi) {
1137 - if (nexthop_nh->nh_dev)
1138 - dev_put(nexthop_nh->nh_dev);
1139 - nexthop_nh->nh_dev = NULL;
1140 - } endfor_nexthops(fi);
1141 fib_info_cnt--;
1142 - release_net(fi->fib_net);
1143 - kfree_rcu(fi, rcu);
1144 + call_rcu(&fi->rcu, free_fib_info_rcu);
1145 }
1146
1147 void fib_release_info(struct fib_info *fi)
1148 diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
1149 index 58c25ea..0d884eb 100644
1150 --- a/net/ipv4/fib_trie.c
1151 +++ b/net/ipv4/fib_trie.c
1152 @@ -1371,6 +1371,8 @@ static int check_leaf(struct fib_table *tb, struct trie *t, struct leaf *l,
1153
1154 if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos)
1155 continue;
1156 + if (fi->fib_dead)
1157 + continue;
1158 if (fa->fa_info->fib_scope < flp->flowi4_scope)
1159 continue;
1160 fib_alias_accessed(fa);
1161 diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
1162 index 1ac7938..65dd543 100644
1163 --- a/net/ipv6/esp6.c
1164 +++ b/net/ipv6/esp6.c
1165 @@ -411,19 +411,15 @@ static u32 esp6_get_mtu(struct xfrm_state *x, int mtu)
1166 struct esp_data *esp = x->data;
1167 u32 blksize = ALIGN(crypto_aead_blocksize(esp->aead), 4);
1168 u32 align = max_t(u32, blksize, esp->padlen);
1169 - u32 rem;
1170 + unsigned int net_adj;
1171
1172 - mtu -= x->props.header_len + crypto_aead_authsize(esp->aead);
1173 - rem = mtu & (align - 1);
1174 - mtu &= ~(align - 1);
1175 -
1176 - if (x->props.mode != XFRM_MODE_TUNNEL) {
1177 - u32 padsize = ((blksize - 1) & 7) + 1;
1178 - mtu -= blksize - padsize;
1179 - mtu += min_t(u32, blksize - padsize, rem);
1180 - }
1181 + if (x->props.mode != XFRM_MODE_TUNNEL)
1182 + net_adj = sizeof(struct ipv6hdr);
1183 + else
1184 + net_adj = 0;
1185
1186 - return mtu - 2;
1187 + return ((mtu - x->props.header_len - crypto_aead_authsize(esp->aead) -
1188 + net_adj) & ~(align - 1)) + (net_adj - 2);
1189 }
1190
1191 static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
1192 diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
1193 index 9cbf176..ae9f6d4 100644
1194 --- a/net/ipv6/ip6_output.c
1195 +++ b/net/ipv6/ip6_output.c
1196 @@ -1194,6 +1194,29 @@ static inline struct ipv6_rt_hdr *ip6_rthdr_dup(struct ipv6_rt_hdr *src,
1197 return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL;
1198 }
1199
1200 +static void ip6_append_data_mtu(int *mtu,
1201 + int *maxfraglen,
1202 + unsigned int fragheaderlen,
1203 + struct sk_buff *skb,
1204 + struct rt6_info *rt)
1205 +{
1206 + if (!(rt->dst.flags & DST_XFRM_TUNNEL)) {
1207 + if (skb == NULL) {
1208 + /* first fragment, reserve header_len */
1209 + *mtu = *mtu - rt->dst.header_len;
1210 +
1211 + } else {
1212 + /*
1213 + * this fragment is not first, the headers
1214 + * space is regarded as data space.
1215 + */
1216 + *mtu = dst_mtu(rt->dst.path);
1217 + }
1218 + *maxfraglen = ((*mtu - fragheaderlen) & ~7)
1219 + + fragheaderlen - sizeof(struct frag_hdr);
1220 + }
1221 +}
1222 +
1223 int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
1224 int offset, int len, int odd, struct sk_buff *skb),
1225 void *from, int length, int transhdrlen,
1226 @@ -1203,7 +1226,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
1227 struct inet_sock *inet = inet_sk(sk);
1228 struct ipv6_pinfo *np = inet6_sk(sk);
1229 struct inet_cork *cork;
1230 - struct sk_buff *skb;
1231 + struct sk_buff *skb, *skb_prev = NULL;
1232 unsigned int maxfraglen, fragheaderlen;
1233 int exthdrlen;
1234 int hh_len;
1235 @@ -1260,8 +1283,12 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
1236 inet->cork.fl.u.ip6 = *fl6;
1237 np->cork.hop_limit = hlimit;
1238 np->cork.tclass = tclass;
1239 - mtu = np->pmtudisc == IPV6_PMTUDISC_PROBE ?
1240 - rt->dst.dev->mtu : dst_mtu(rt->dst.path);
1241 + if (rt->dst.flags & DST_XFRM_TUNNEL)
1242 + mtu = np->pmtudisc == IPV6_PMTUDISC_PROBE ?
1243 + rt->dst.dev->mtu : dst_mtu(&rt->dst);
1244 + else
1245 + mtu = np->pmtudisc == IPV6_PMTUDISC_PROBE ?
1246 + rt->dst.dev->mtu : dst_mtu(rt->dst.path);
1247 if (np->frag_size < mtu) {
1248 if (np->frag_size)
1249 mtu = np->frag_size;
1250 @@ -1356,38 +1383,43 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
1251 unsigned int fraglen;
1252 unsigned int fraggap;
1253 unsigned int alloclen;
1254 - struct sk_buff *skb_prev;
1255 alloc_new_skb:
1256 - skb_prev = skb;
1257 -
1258 /* There's no room in the current skb */
1259 - if (skb_prev)
1260 - fraggap = skb_prev->len - maxfraglen;
1261 + if (skb)
1262 + fraggap = skb->len - maxfraglen;
1263 else
1264 fraggap = 0;
1265 + /* update mtu and maxfraglen if necessary */
1266 + if (skb == NULL || skb_prev == NULL)
1267 + ip6_append_data_mtu(&mtu, &maxfraglen,
1268 + fragheaderlen, skb, rt);
1269 +
1270 + skb_prev = skb;
1271
1272 /*
1273 * If remaining data exceeds the mtu,
1274 * we know we need more fragment(s).
1275 */
1276 datalen = length + fraggap;
1277 - if (datalen > (cork->length <= mtu && !(cork->flags & IPCORK_ALLFRAG) ? mtu : maxfraglen) - fragheaderlen)
1278 - datalen = maxfraglen - fragheaderlen;
1279
1280 - fraglen = datalen + fragheaderlen;
1281 + if (datalen > (cork->length <= mtu && !(cork->flags & IPCORK_ALLFRAG) ? mtu : maxfraglen) - fragheaderlen)
1282 + datalen = maxfraglen - fragheaderlen - rt->dst.trailer_len;
1283 if ((flags & MSG_MORE) &&
1284 !(rt->dst.dev->features&NETIF_F_SG))
1285 alloclen = mtu;
1286 else
1287 alloclen = datalen + fragheaderlen;
1288
1289 - /*
1290 - * The last fragment gets additional space at tail.
1291 - * Note: we overallocate on fragments with MSG_MODE
1292 - * because we have no idea if we're the last one.
1293 - */
1294 - if (datalen == length + fraggap)
1295 - alloclen += rt->dst.trailer_len;
1296 + if (datalen != length + fraggap) {
1297 + /*
1298 + * this is not the last fragment, the trailer
1299 + * space is regarded as data space.
1300 + */
1301 + datalen += rt->dst.trailer_len;
1302 + }
1303 +
1304 + alloclen += rt->dst.trailer_len;
1305 + fraglen = datalen + fragheaderlen;
1306
1307 /*
1308 * We just reserve space for fragment header.
1309 diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
1310 index ea52d02..78bc442 100644
1311 --- a/net/l2tp/l2tp_ip.c
1312 +++ b/net/l2tp/l2tp_ip.c
1313 @@ -251,9 +251,16 @@ static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
1314 {
1315 struct inet_sock *inet = inet_sk(sk);
1316 struct sockaddr_l2tpip *addr = (struct sockaddr_l2tpip *) uaddr;
1317 - int ret = -EINVAL;
1318 + int ret;
1319 int chk_addr_ret;
1320
1321 + if (!sock_flag(sk, SOCK_ZAPPED))
1322 + return -EINVAL;
1323 + if (addr_len < sizeof(struct sockaddr_l2tpip))
1324 + return -EINVAL;
1325 + if (addr->l2tp_family != AF_INET)
1326 + return -EINVAL;
1327 +
1328 ret = -EADDRINUSE;
1329 read_lock_bh(&l2tp_ip_lock);
1330 if (__l2tp_ip_bind_lookup(&init_net, addr->l2tp_addr.s_addr, sk->sk_bound_dev_if, addr->l2tp_conn_id))
1331 @@ -283,6 +290,8 @@ static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
1332 sk_del_node_init(sk);
1333 write_unlock_bh(&l2tp_ip_lock);
1334 ret = 0;
1335 + sock_reset_flag(sk, SOCK_ZAPPED);
1336 +
1337 out:
1338 release_sock(sk);
1339
1340 @@ -303,13 +312,14 @@ static int l2tp_ip_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len
1341 __be32 saddr;
1342 int oif, rc;
1343
1344 - rc = -EINVAL;
1345 + if (sock_flag(sk, SOCK_ZAPPED)) /* Must bind first - autobinding does not work */
1346 + return -EINVAL;
1347 +
1348 if (addr_len < sizeof(*lsa))
1349 - goto out;
1350 + return -EINVAL;
1351
1352 - rc = -EAFNOSUPPORT;
1353 if (lsa->l2tp_family != AF_INET)
1354 - goto out;
1355 + return -EAFNOSUPPORT;
1356
1357 lock_sock(sk);
1358
1359 @@ -363,6 +373,14 @@ out:
1360 return rc;
1361 }
1362
1363 +static int l2tp_ip_disconnect(struct sock *sk, int flags)
1364 +{
1365 + if (sock_flag(sk, SOCK_ZAPPED))
1366 + return 0;
1367 +
1368 + return udp_disconnect(sk, flags);
1369 +}
1370 +
1371 static int l2tp_ip_getname(struct socket *sock, struct sockaddr *uaddr,
1372 int *uaddr_len, int peer)
1373 {
1374 @@ -591,7 +609,7 @@ static struct proto l2tp_ip_prot = {
1375 .close = l2tp_ip_close,
1376 .bind = l2tp_ip_bind,
1377 .connect = l2tp_ip_connect,
1378 - .disconnect = udp_disconnect,
1379 + .disconnect = l2tp_ip_disconnect,
1380 .ioctl = udp_ioctl,
1381 .destroy = l2tp_ip_destroy_sock,
1382 .setsockopt = ip_setsockopt,
1383 diff --git a/net/mac80211/util.c b/net/mac80211/util.c
1384 index 2124db8..11d9d49 100644
1385 --- a/net/mac80211/util.c
1386 +++ b/net/mac80211/util.c
1387 @@ -1254,6 +1254,12 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1388 }
1389 }
1390
1391 + /* add back keys */
1392 + list_for_each_entry(sdata, &local->interfaces, list)
1393 + if (ieee80211_sdata_running(sdata))
1394 + ieee80211_enable_keys(sdata);
1395 +
1396 + wake_up:
1397 /*
1398 * Clear the WLAN_STA_BLOCK_BA flag so new aggregation
1399 * sessions can be established after a resume.
1400 @@ -1275,12 +1281,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1401 mutex_unlock(&local->sta_mtx);
1402 }
1403
1404 - /* add back keys */
1405 - list_for_each_entry(sdata, &local->interfaces, list)
1406 - if (ieee80211_sdata_running(sdata))
1407 - ieee80211_enable_keys(sdata);
1408 -
1409 - wake_up:
1410 ieee80211_wake_queues_by_reason(hw,
1411 IEEE80211_QUEUE_STOP_REASON_SUSPEND);
1412
1413 diff --git a/net/sctp/output.c b/net/sctp/output.c
1414 index 817174e..8fc4dcd 100644
1415 --- a/net/sctp/output.c
1416 +++ b/net/sctp/output.c
1417 @@ -377,9 +377,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
1418 */
1419 skb_set_owner_w(nskb, sk);
1420
1421 - /* The 'obsolete' field of dst is set to 2 when a dst is freed. */
1422 - if (!dst || (dst->obsolete > 1)) {
1423 - dst_release(dst);
1424 + if (!sctp_transport_dst_check(tp)) {
1425 sctp_transport_route(tp, NULL, sctp_sk(sk));
1426 if (asoc && (asoc->param_flags & SPP_PMTUD_ENABLE)) {
1427 sctp_assoc_sync_pmtu(asoc);
1428 diff --git a/net/sctp/transport.c b/net/sctp/transport.c
1429 index 394c57c..8da4481 100644
1430 --- a/net/sctp/transport.c
1431 +++ b/net/sctp/transport.c
1432 @@ -226,23 +226,6 @@ void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk)
1433 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
1434 }
1435
1436 -/* this is a complete rip-off from __sk_dst_check
1437 - * the cookie is always 0 since this is how it's used in the
1438 - * pmtu code
1439 - */
1440 -static struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
1441 -{
1442 - struct dst_entry *dst = t->dst;
1443 -
1444 - if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) {
1445 - dst_release(t->dst);
1446 - t->dst = NULL;
1447 - return NULL;
1448 - }
1449 -
1450 - return dst;
1451 -}
1452 -
1453 void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)
1454 {
1455 struct dst_entry *dst;
1456 diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
1457 index 7803eb6..0c0e40e 100644
1458 --- a/net/xfrm/xfrm_policy.c
1459 +++ b/net/xfrm/xfrm_policy.c
1460 @@ -1917,6 +1917,9 @@ no_transform:
1461 }
1462 ok:
1463 xfrm_pols_put(pols, drop_pols);
1464 + if (dst && dst->xfrm &&
1465 + dst->xfrm->props.mode == XFRM_MODE_TUNNEL)
1466 + dst->flags |= DST_XFRM_TUNNEL;
1467 return dst;
1468
1469 nopol:
1470 diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
1471 index b8dcbf4..506c0fa 100644
1472 --- a/sound/usb/pcm.c
1473 +++ b/sound/usb/pcm.c
1474 @@ -670,6 +670,9 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime,
1475 int count = 0, needs_knot = 0;
1476 int err;
1477
1478 + kfree(subs->rate_list.list);
1479 + subs->rate_list.list = NULL;
1480 +
1481 list_for_each_entry(fp, &subs->fmt_list, list) {
1482 if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS)
1483 return 0;

  ViewVC Help
Powered by ViewVC 1.1.20