/[linux-patches]/genpatches-2.6/trunk/3.4/1015_linux-3.4.16.patch
Gentoo

Contents of /genpatches-2.6/trunk/3.4/1015_linux-3.4.16.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2254 - (show annotations) (download)
Wed Dec 19 19:51:16 2012 UTC (3 years, 8 months ago) by mpagano
File size: 60111 byte(s)
Linux patches 3.4.12 through and including 3.4.24
1 diff --git a/Makefile b/Makefile
2 index fe9ea67..470d96b 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 4
8 -SUBLEVEL = 15
9 +SUBLEVEL = 16
10 EXTRAVERSION =
11 NAME = Saber-toothed Squirrel
12
13 diff --git a/arch/s390/boot/compressed/vmlinux.lds.S b/arch/s390/boot/compressed/vmlinux.lds.S
14 index d80f79d..8e1fb82 100644
15 --- a/arch/s390/boot/compressed/vmlinux.lds.S
16 +++ b/arch/s390/boot/compressed/vmlinux.lds.S
17 @@ -5,7 +5,7 @@ OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
18 OUTPUT_ARCH(s390:64-bit)
19 #else
20 OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
21 -OUTPUT_ARCH(s390)
22 +OUTPUT_ARCH(s390:31-bit)
23 #endif
24
25 ENTRY(startup)
26 diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
27 index 21109c6..1343d7c 100644
28 --- a/arch/s390/kernel/vmlinux.lds.S
29 +++ b/arch/s390/kernel/vmlinux.lds.S
30 @@ -8,7 +8,7 @@
31
32 #ifndef CONFIG_64BIT
33 OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
34 -OUTPUT_ARCH(s390)
35 +OUTPUT_ARCH(s390:31-bit)
36 ENTRY(startup)
37 jiffies = jiffies_64 + 4;
38 #else
39 diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
40 index 28559ce..602eca8 100644
41 --- a/arch/sparc/kernel/perf_event.c
42 +++ b/arch/sparc/kernel/perf_event.c
43 @@ -557,11 +557,13 @@ static u64 nop_for_index(int idx)
44
45 static inline void sparc_pmu_enable_event(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc, int idx)
46 {
47 - u64 val, mask = mask_for_index(idx);
48 + u64 enc, val, mask = mask_for_index(idx);
49 +
50 + enc = perf_event_get_enc(cpuc->events[idx]);
51
52 val = cpuc->pcr;
53 val &= ~mask;
54 - val |= hwc->config;
55 + val |= event_encoding(enc, idx);
56 cpuc->pcr = val;
57
58 pcr_ops->write(cpuc->pcr);
59 @@ -1428,8 +1430,6 @@ static void perf_callchain_user_64(struct perf_callchain_entry *entry,
60 {
61 unsigned long ufp;
62
63 - perf_callchain_store(entry, regs->tpc);
64 -
65 ufp = regs->u_regs[UREG_I6] + STACK_BIAS;
66 do {
67 struct sparc_stackf *usf, sf;
68 @@ -1450,8 +1450,6 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry,
69 {
70 unsigned long ufp;
71
72 - perf_callchain_store(entry, regs->tpc);
73 -
74 ufp = regs->u_regs[UREG_I6] & 0xffffffffUL;
75 do {
76 struct sparc_stackf32 *usf, sf;
77 @@ -1470,6 +1468,11 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry,
78 void
79 perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
80 {
81 + perf_callchain_store(entry, regs->tpc);
82 +
83 + if (!current->mm)
84 + return;
85 +
86 flushw_user();
87 if (test_thread_flag(TIF_32BIT))
88 perf_callchain_user_32(entry, regs);
89 diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
90 index 3ee51f1..57b7cab 100644
91 --- a/arch/sparc/kernel/sys_sparc_64.c
92 +++ b/arch/sparc/kernel/sys_sparc_64.c
93 @@ -519,12 +519,12 @@ SYSCALL_DEFINE1(sparc64_personality, unsigned long, personality)
94 {
95 int ret;
96
97 - if (current->personality == PER_LINUX32 &&
98 - personality == PER_LINUX)
99 - personality = PER_LINUX32;
100 + if (personality(current->personality) == PER_LINUX32 &&
101 + personality(personality) == PER_LINUX)
102 + personality |= PER_LINUX32;
103 ret = sys_personality(personality);
104 - if (ret == PER_LINUX32)
105 - ret = PER_LINUX;
106 + if (personality(ret) == PER_LINUX32)
107 + ret &= ~PER_LINUX32;
108
109 return ret;
110 }
111 diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
112 index 1d7e274..7f5f65d 100644
113 --- a/arch/sparc/kernel/syscalls.S
114 +++ b/arch/sparc/kernel/syscalls.S
115 @@ -212,24 +212,20 @@ linux_sparc_syscall:
116 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
117 ret_sys_call:
118 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3
119 - ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
120 sra %o0, 0, %o0
121 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
122 sllx %g2, 32, %g2
123
124 - /* Check if force_successful_syscall_return()
125 - * was invoked.
126 - */
127 - ldub [%g6 + TI_SYS_NOERROR], %l2
128 - brnz,a,pn %l2, 80f
129 - stb %g0, [%g6 + TI_SYS_NOERROR]
130 -
131 cmp %o0, -ERESTART_RESTARTBLOCK
132 bgeu,pn %xcc, 1f
133 - andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6
134 -80:
135 + andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0
136 + ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
137 +
138 +2:
139 + stb %g0, [%g6 + TI_SYS_NOERROR]
140 /* System call success, clear Carry condition code. */
141 andn %g3, %g2, %g3
142 +3:
143 stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
144 bne,pn %icc, linux_syscall_trace2
145 add %l1, 0x4, %l2 ! npc = npc+4
146 @@ -238,20 +234,20 @@ ret_sys_call:
147 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
148
149 1:
150 + /* Check if force_successful_syscall_return()
151 + * was invoked.
152 + */
153 + ldub [%g6 + TI_SYS_NOERROR], %l2
154 + brnz,pn %l2, 2b
155 + ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
156 /* System call failure, set Carry condition code.
157 * Also, get abs(errno) to return to the process.
158 */
159 - andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6
160 sub %g0, %o0, %o0
161 - or %g3, %g2, %g3
162 stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
163 - stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
164 - bne,pn %icc, linux_syscall_trace2
165 - add %l1, 0x4, %l2 ! npc = npc+4
166 - stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]
167 + ba,pt %xcc, 3b
168 + or %g3, %g2, %g3
169
170 - b,pt %xcc, rtrap
171 - stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
172 linux_syscall_trace2:
173 call syscall_trace_leave
174 add %sp, PTREGS_OFF, %o0
175 diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
176 index 21faaee..0791618 100644
177 --- a/arch/sparc/mm/init_64.c
178 +++ b/arch/sparc/mm/init_64.c
179 @@ -2099,6 +2099,9 @@ EXPORT_SYMBOL(_PAGE_CACHE);
180 #ifdef CONFIG_SPARSEMEM_VMEMMAP
181 unsigned long vmemmap_table[VMEMMAP_SIZE];
182
183 +static long __meminitdata addr_start, addr_end;
184 +static int __meminitdata node_start;
185 +
186 int __meminit vmemmap_populate(struct page *start, unsigned long nr, int node)
187 {
188 unsigned long vstart = (unsigned long) start;
189 @@ -2129,15 +2132,30 @@ int __meminit vmemmap_populate(struct page *start, unsigned long nr, int node)
190
191 *vmem_pp = pte_base | __pa(block);
192
193 - printk(KERN_INFO "[%p-%p] page_structs=%lu "
194 - "node=%d entry=%lu/%lu\n", start, block, nr,
195 - node,
196 - addr >> VMEMMAP_CHUNK_SHIFT,
197 - VMEMMAP_SIZE);
198 + /* check to see if we have contiguous blocks */
199 + if (addr_end != addr || node_start != node) {
200 + if (addr_start)
201 + printk(KERN_DEBUG " [%lx-%lx] on node %d\n",
202 + addr_start, addr_end-1, node_start);
203 + addr_start = addr;
204 + node_start = node;
205 + }
206 + addr_end = addr + VMEMMAP_CHUNK;
207 }
208 }
209 return 0;
210 }
211 +
212 +void __meminit vmemmap_populate_print_last(void)
213 +{
214 + if (addr_start) {
215 + printk(KERN_DEBUG " [%lx-%lx] on node %d\n",
216 + addr_start, addr_end-1, node_start);
217 + addr_start = 0;
218 + addr_end = 0;
219 + node_start = 0;
220 + }
221 +}
222 #endif /* CONFIG_SPARSEMEM_VMEMMAP */
223
224 static void prot_init_common(unsigned long page_none,
225 diff --git a/arch/tile/Makefile b/arch/tile/Makefile
226 index 9520bc5..99f461d 100644
227 --- a/arch/tile/Makefile
228 +++ b/arch/tile/Makefile
229 @@ -26,6 +26,10 @@ $(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH))
230 endif
231 endif
232
233 +# The tile compiler may emit .eh_frame information for backtracing.
234 +# In kernel modules, this causes load failures due to unsupported relocations.
235 +KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
236 +
237 ifneq ($(CONFIG_DEBUG_EXTRA_FLAGS),"")
238 KBUILD_CFLAGS += $(CONFIG_DEBUG_EXTRA_FLAGS)
239 endif
240 diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
241 index 7b784f4..6d4f7ba 100644
242 --- a/arch/x86/kernel/entry_32.S
243 +++ b/arch/x86/kernel/entry_32.S
244 @@ -1025,7 +1025,7 @@ ENTRY(xen_sysenter_target)
245
246 ENTRY(xen_hypervisor_callback)
247 CFI_STARTPROC
248 - pushl_cfi $0
249 + pushl_cfi $-1 /* orig_ax = -1 => not a system call */
250 SAVE_ALL
251 TRACE_IRQS_OFF
252
253 @@ -1067,14 +1067,16 @@ ENTRY(xen_failsafe_callback)
254 2: mov 8(%esp),%es
255 3: mov 12(%esp),%fs
256 4: mov 16(%esp),%gs
257 + /* EAX == 0 => Category 1 (Bad segment)
258 + EAX != 0 => Category 2 (Bad IRET) */
259 testl %eax,%eax
260 popl_cfi %eax
261 lea 16(%esp),%esp
262 CFI_ADJUST_CFA_OFFSET -16
263 jz 5f
264 addl $16,%esp
265 - jmp iret_exc # EAX != 0 => Category 2 (Bad IRET)
266 -5: pushl_cfi $0 # EAX == 0 => Category 1 (Bad segment)
267 + jmp iret_exc
268 +5: pushl_cfi $-1 /* orig_ax = -1 => not a system call */
269 SAVE_ALL
270 jmp ret_from_exception
271 CFI_ENDPROC
272 diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
273 index cdc79b5..bd6f592 100644
274 --- a/arch/x86/kernel/entry_64.S
275 +++ b/arch/x86/kernel/entry_64.S
276 @@ -1351,7 +1351,7 @@ ENTRY(xen_failsafe_callback)
277 CFI_RESTORE r11
278 addq $0x30,%rsp
279 CFI_ADJUST_CFA_OFFSET -0x30
280 - pushq_cfi $0
281 + pushq_cfi $-1 /* orig_ax = -1 => not a system call */
282 SAVE_ALL
283 jmp error_exit
284 CFI_ENDPROC
285 diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
286 index 1a29015..fbbd1eb 100644
287 --- a/arch/x86/kernel/setup.c
288 +++ b/arch/x86/kernel/setup.c
289 @@ -927,8 +927,21 @@ void __init setup_arch(char **cmdline_p)
290
291 #ifdef CONFIG_X86_64
292 if (max_pfn > max_low_pfn) {
293 - max_pfn_mapped = init_memory_mapping(1UL<<32,
294 - max_pfn<<PAGE_SHIFT);
295 + int i;
296 + for (i = 0; i < e820.nr_map; i++) {
297 + struct e820entry *ei = &e820.map[i];
298 +
299 + if (ei->addr + ei->size <= 1UL << 32)
300 + continue;
301 +
302 + if (ei->type == E820_RESERVED)
303 + continue;
304 +
305 + max_pfn_mapped = init_memory_mapping(
306 + ei->addr < 1UL << 32 ? 1UL << 32 : ei->addr,
307 + ei->addr + ei->size);
308 + }
309 +
310 /* can we preseve max_low_pfn ?*/
311 max_low_pfn = max_pfn;
312 }
313 diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
314 index 26b8a85..48768df 100644
315 --- a/arch/x86/oprofile/nmi_int.c
316 +++ b/arch/x86/oprofile/nmi_int.c
317 @@ -55,7 +55,7 @@ u64 op_x86_get_ctrl(struct op_x86_model_spec const *model,
318 val |= counter_config->extra;
319 event &= model->event_mask ? model->event_mask : 0xFF;
320 val |= event & 0xFF;
321 - val |= (event & 0x0F00) << 24;
322 + val |= (u64)(event & 0x0F00) << 24;
323
324 return val;
325 }
326 diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
327 index 7ef73c9..a8bfe1c 100644
328 --- a/drivers/edac/amd64_edac.c
329 +++ b/drivers/edac/amd64_edac.c
330 @@ -170,8 +170,11 @@ static int __amd64_set_scrub_rate(struct pci_dev *ctl, u32 new_bw, u32 min_rate)
331 * memory controller and apply to register. Search for the first
332 * bandwidth entry that is greater or equal than the setting requested
333 * and program that. If at last entry, turn off DRAM scrubbing.
334 + *
335 + * If no suitable bandwidth is found, turn off DRAM scrubbing entirely
336 + * by falling back to the last element in scrubrates[].
337 */
338 - for (i = 0; i < ARRAY_SIZE(scrubrates); i++) {
339 + for (i = 0; i < ARRAY_SIZE(scrubrates) - 1; i++) {
340 /*
341 * skip scrub rates which aren't recommended
342 * (see F10 BKDG, F3x58)
343 @@ -181,12 +184,6 @@ static int __amd64_set_scrub_rate(struct pci_dev *ctl, u32 new_bw, u32 min_rate)
344
345 if (scrubrates[i].bandwidth <= new_bw)
346 break;
347 -
348 - /*
349 - * if no suitable bandwidth found, turn off DRAM scrubbing
350 - * entirely by falling back to the last element in the
351 - * scrubrates array.
352 - */
353 }
354
355 scrubval = scrubrates[i].scrubval;
356 diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
357 index e3e470f..67432e2 100644
358 --- a/drivers/infiniband/core/cma.c
359 +++ b/drivers/infiniband/core/cma.c
360 @@ -3451,7 +3451,8 @@ out:
361 }
362
363 static const struct ibnl_client_cbs cma_cb_table[] = {
364 - [RDMA_NL_RDMA_CM_ID_STATS] = { .dump = cma_get_id_stats },
365 + [RDMA_NL_RDMA_CM_ID_STATS] = { .dump = cma_get_id_stats,
366 + .module = THIS_MODULE },
367 };
368
369 static int __init cma_init(void)
370 diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c
371 index 396e293..8c3b08a 100644
372 --- a/drivers/infiniband/core/netlink.c
373 +++ b/drivers/infiniband/core/netlink.c
374 @@ -151,6 +151,7 @@ static int ibnl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
375 {
376 struct netlink_dump_control c = {
377 .dump = client->cb_table[op].dump,
378 + .module = client->cb_table[op].module,
379 };
380 return netlink_dump_start(nls, skb, nlh, &c);
381 }
382 diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
383 index 17ef6c4..035f28e 100644
384 --- a/drivers/iommu/tegra-smmu.c
385 +++ b/drivers/iommu/tegra-smmu.c
386 @@ -148,7 +148,7 @@
387
388 #define SMMU_ADDR_TO_PFN(addr) ((addr) >> 12)
389 #define SMMU_ADDR_TO_PDN(addr) ((addr) >> 22)
390 -#define SMMU_PDN_TO_ADDR(addr) ((pdn) << 22)
391 +#define SMMU_PDN_TO_ADDR(pdn) ((pdn) << 22)
392
393 #define _READABLE (1 << SMMU_PTB_DATA_ASID_READABLE_SHIFT)
394 #define _WRITABLE (1 << SMMU_PTB_DATA_ASID_WRITABLE_SHIFT)
395 diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c
396 index 0b3e481..eab0641 100644
397 --- a/drivers/media/video/au0828/au0828-video.c
398 +++ b/drivers/media/video/au0828/au0828-video.c
399 @@ -1692,14 +1692,18 @@ static int vidioc_streamoff(struct file *file, void *priv,
400 (AUVI_INPUT(i).audio_setup)(dev, 0);
401 }
402
403 - videobuf_streamoff(&fh->vb_vidq);
404 - res_free(fh, AU0828_RESOURCE_VIDEO);
405 + if (res_check(fh, AU0828_RESOURCE_VIDEO)) {
406 + videobuf_streamoff(&fh->vb_vidq);
407 + res_free(fh, AU0828_RESOURCE_VIDEO);
408 + }
409 } else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
410 dev->vbi_timeout_running = 0;
411 del_timer_sync(&dev->vbi_timeout);
412
413 - videobuf_streamoff(&fh->vb_vbiq);
414 - res_free(fh, AU0828_RESOURCE_VBI);
415 + if (res_check(fh, AU0828_RESOURCE_VBI)) {
416 + videobuf_streamoff(&fh->vb_vbiq);
417 + res_free(fh, AU0828_RESOURCE_VBI);
418 + }
419 }
420
421 return 0;
422 diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
423 index 47b19c0..eb9f5fb 100644
424 --- a/drivers/mtd/nand/nand_base.c
425 +++ b/drivers/mtd/nand/nand_base.c
426 @@ -2897,9 +2897,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
427 if (le16_to_cpu(p->features) & 1)
428 *busw = NAND_BUSWIDTH_16;
429
430 - chip->options &= ~NAND_CHIPOPTIONS_MSK;
431 - chip->options |= (NAND_NO_READRDY |
432 - NAND_NO_AUTOINCR) & NAND_CHIPOPTIONS_MSK;
433 + chip->options |= NAND_NO_READRDY | NAND_NO_AUTOINCR;
434
435 pr_info("ONFI flash detected\n");
436 return 1;
437 @@ -3064,9 +3062,8 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
438 mtd->erasesize <<= ((id_data[3] & 0x03) << 1);
439 }
440 }
441 - /* Get chip options, preserve non chip based options */
442 - chip->options &= ~NAND_CHIPOPTIONS_MSK;
443 - chip->options |= type->options & NAND_CHIPOPTIONS_MSK;
444 + /* Get chip options */
445 + chip->options |= type->options;
446
447 /*
448 * Check if chip is not a Samsung device. Do not clear the
449 diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
450 index 5a30bf8..f4be8f7 100644
451 --- a/drivers/net/ethernet/marvell/skge.c
452 +++ b/drivers/net/ethernet/marvell/skge.c
453 @@ -4153,6 +4153,13 @@ static struct dmi_system_id skge_32bit_dma_boards[] = {
454 DMI_MATCH(DMI_BOARD_NAME, "nForce"),
455 },
456 },
457 + {
458 + .ident = "ASUS P5NSLI",
459 + .matches = {
460 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
461 + DMI_MATCH(DMI_BOARD_NAME, "P5NSLI")
462 + },
463 + },
464 {}
465 };
466
467 diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c
468 index b066273..7dd879c 100644
469 --- a/drivers/pcmcia/pxa2xx_sharpsl.c
470 +++ b/drivers/pcmcia/pxa2xx_sharpsl.c
471 @@ -194,7 +194,7 @@ static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
472 sharpsl_pcmcia_init_reset(skt);
473 }
474
475 -static struct pcmcia_low_level sharpsl_pcmcia_ops __initdata = {
476 +static struct pcmcia_low_level sharpsl_pcmcia_ops = {
477 .owner = THIS_MODULE,
478 .hw_init = sharpsl_pcmcia_hw_init,
479 .socket_state = sharpsl_pcmcia_socket_state,
480 diff --git a/drivers/pinctrl/pinctrl-tegra.c b/drivers/pinctrl/pinctrl-tegra.c
481 index 9b32968..2a32a2f 100644
482 --- a/drivers/pinctrl/pinctrl-tegra.c
483 +++ b/drivers/pinctrl/pinctrl-tegra.c
484 @@ -259,7 +259,7 @@ static int tegra_pinconf_reg(struct tegra_pmx *pmx,
485 *bank = g->drv_bank;
486 *reg = g->drv_reg;
487 *bit = g->lpmd_bit;
488 - *width = 1;
489 + *width = 2;
490 break;
491 case TEGRA_PINCONF_PARAM_DRIVE_DOWN_STRENGTH:
492 *bank = g->drv_bank;
493 diff --git a/drivers/pinctrl/pinctrl-tegra30.c b/drivers/pinctrl/pinctrl-tegra30.c
494 index 4d7571d..636d96c 100644
495 --- a/drivers/pinctrl/pinctrl-tegra30.c
496 +++ b/drivers/pinctrl/pinctrl-tegra30.c
497 @@ -3343,10 +3343,10 @@ static const struct tegra_function tegra30_functions[] = {
498 FUNCTION(vi_alt3),
499 };
500
501 -#define MUXCTL_REG_A 0x3000
502 -#define PINGROUP_REG_A 0x868
503 +#define DRV_PINGROUP_REG_A 0x868 /* bank 0 */
504 +#define PINGROUP_REG_A 0x3000 /* bank 1 */
505
506 -#define PINGROUP_REG_Y(r) ((r) - MUXCTL_REG_A)
507 +#define PINGROUP_REG_Y(r) ((r) - PINGROUP_REG_A)
508 #define PINGROUP_REG_N(r) -1
509
510 #define PINGROUP(pg_name, f0, f1, f2, f3, f_safe, r, od, ior) \
511 @@ -3362,25 +3362,25 @@ static const struct tegra_function tegra30_functions[] = {
512 }, \
513 .func_safe = TEGRA_MUX_ ## f_safe, \
514 .mux_reg = PINGROUP_REG_Y(r), \
515 - .mux_bank = 0, \
516 + .mux_bank = 1, \
517 .mux_bit = 0, \
518 .pupd_reg = PINGROUP_REG_Y(r), \
519 - .pupd_bank = 0, \
520 + .pupd_bank = 1, \
521 .pupd_bit = 2, \
522 .tri_reg = PINGROUP_REG_Y(r), \
523 - .tri_bank = 0, \
524 + .tri_bank = 1, \
525 .tri_bit = 4, \
526 .einput_reg = PINGROUP_REG_Y(r), \
527 - .einput_bank = 0, \
528 + .einput_bank = 1, \
529 .einput_bit = 5, \
530 .odrain_reg = PINGROUP_REG_##od(r), \
531 - .odrain_bank = 0, \
532 + .odrain_bank = 1, \
533 .odrain_bit = 6, \
534 .lock_reg = PINGROUP_REG_Y(r), \
535 - .lock_bank = 0, \
536 + .lock_bank = 1, \
537 .lock_bit = 7, \
538 .ioreset_reg = PINGROUP_REG_##ior(r), \
539 - .ioreset_bank = 0, \
540 + .ioreset_bank = 1, \
541 .ioreset_bit = 8, \
542 .drv_reg = -1, \
543 }
544 @@ -3399,8 +3399,8 @@ static const struct tegra_function tegra30_functions[] = {
545 .odrain_reg = -1, \
546 .lock_reg = -1, \
547 .ioreset_reg = -1, \
548 - .drv_reg = ((r) - PINGROUP_REG_A), \
549 - .drv_bank = 1, \
550 + .drv_reg = ((r) - DRV_PINGROUP_REG_A), \
551 + .drv_bank = 0, \
552 .hsm_bit = hsm_b, \
553 .schmitt_bit = schmitt_b, \
554 .lpmd_bit = lpmd_b, \
555 diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
556 index 7f2fac1..c5f7eae 100644
557 --- a/drivers/usb/class/cdc-acm.c
558 +++ b/drivers/usb/class/cdc-acm.c
559 @@ -818,10 +818,6 @@ static const __u32 acm_tty_speed[] = {
560 2500000, 3000000, 3500000, 4000000
561 };
562
563 -static const __u8 acm_tty_size[] = {
564 - 5, 6, 7, 8
565 -};
566 -
567 static void acm_tty_set_termios(struct tty_struct *tty,
568 struct ktermios *termios_old)
569 {
570 @@ -835,7 +831,21 @@ static void acm_tty_set_termios(struct tty_struct *tty,
571 newline.bParityType = termios->c_cflag & PARENB ?
572 (termios->c_cflag & PARODD ? 1 : 2) +
573 (termios->c_cflag & CMSPAR ? 2 : 0) : 0;
574 - newline.bDataBits = acm_tty_size[(termios->c_cflag & CSIZE) >> 4];
575 + switch (termios->c_cflag & CSIZE) {
576 + case CS5:
577 + newline.bDataBits = 5;
578 + break;
579 + case CS6:
580 + newline.bDataBits = 6;
581 + break;
582 + case CS7:
583 + newline.bDataBits = 7;
584 + break;
585 + case CS8:
586 + default:
587 + newline.bDataBits = 8;
588 + break;
589 + }
590 /* FIXME: Needs to clear unsupported bits in the termios */
591 acm->clocal = ((termios->c_cflag & CLOCAL) != 0);
592
593 @@ -1234,7 +1244,7 @@ made_compressed_probe:
594
595 if (usb_endpoint_xfer_int(epwrite))
596 usb_fill_int_urb(snd->urb, usb_dev,
597 - usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
598 + usb_sndintpipe(usb_dev, epwrite->bEndpointAddress),
599 NULL, acm->writesize, acm_write_bulk, snd, epwrite->bInterval);
600 else
601 usb_fill_bulk_urb(snd->urb, usb_dev,
602 diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
603 index b8d4697..cee0c3e 100644
604 --- a/drivers/usb/dwc3/gadget.c
605 +++ b/drivers/usb/dwc3/gadget.c
606 @@ -1777,6 +1777,7 @@ static void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum)
607 ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);
608 WARN_ON_ONCE(ret);
609 dep->res_trans_idx = 0;
610 + dep->flags &= ~DWC3_EP_BUSY;
611 }
612 }
613
614 diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
615 index f756231..e52ddfe 100644
616 --- a/drivers/usb/host/xhci.c
617 +++ b/drivers/usb/host/xhci.c
618 @@ -479,7 +479,8 @@ static bool compliance_mode_recovery_timer_quirk_check(void)
619
620 if (strstr(dmi_product_name, "Z420") ||
621 strstr(dmi_product_name, "Z620") ||
622 - strstr(dmi_product_name, "Z820"))
623 + strstr(dmi_product_name, "Z820") ||
624 + strstr(dmi_product_name, "Z1"))
625 return true;
626
627 return false;
628 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
629 index 57de734..17ec21e 100644
630 --- a/drivers/usb/serial/option.c
631 +++ b/drivers/usb/serial/option.c
632 @@ -503,11 +503,19 @@ static const struct option_blacklist_info net_intf5_blacklist = {
633 .reserved = BIT(5),
634 };
635
636 +static const struct option_blacklist_info net_intf6_blacklist = {
637 + .reserved = BIT(6),
638 +};
639 +
640 static const struct option_blacklist_info zte_mf626_blacklist = {
641 .sendsetup = BIT(0) | BIT(1),
642 .reserved = BIT(4),
643 };
644
645 +static const struct option_blacklist_info zte_1255_blacklist = {
646 + .reserved = BIT(3) | BIT(4),
647 +};
648 +
649 static const struct usb_device_id option_ids[] = {
650 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
651 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
652 @@ -853,13 +861,19 @@ static const struct usb_device_id option_ids[] = {
653 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0113, 0xff, 0xff, 0xff),
654 .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
655 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0117, 0xff, 0xff, 0xff) },
656 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0118, 0xff, 0xff, 0xff) },
657 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0121, 0xff, 0xff, 0xff) },
658 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0118, 0xff, 0xff, 0xff),
659 + .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
660 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0121, 0xff, 0xff, 0xff),
661 + .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
662 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0122, 0xff, 0xff, 0xff) },
663 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0123, 0xff, 0xff, 0xff) },
664 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0124, 0xff, 0xff, 0xff) },
665 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0125, 0xff, 0xff, 0xff) },
666 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0126, 0xff, 0xff, 0xff) },
667 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0123, 0xff, 0xff, 0xff),
668 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
669 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0124, 0xff, 0xff, 0xff),
670 + .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
671 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0125, 0xff, 0xff, 0xff),
672 + .driver_info = (kernel_ulong_t)&net_intf6_blacklist },
673 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0126, 0xff, 0xff, 0xff),
674 + .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
675 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0128, 0xff, 0xff, 0xff) },
676 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0142, 0xff, 0xff, 0xff) },
677 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) },
678 @@ -872,7 +886,8 @@ static const struct usb_device_id option_ids[] = {
679 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xff) },
680 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xff),
681 .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
682 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff) },
683 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff),
684 + .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
685 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0159, 0xff, 0xff, 0xff) },
686 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) },
687 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) },
688 @@ -880,13 +895,22 @@ static const struct usb_device_id option_ids[] = {
689 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) },
690 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff),
691 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
692 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0191, 0xff, 0xff, 0xff), /* ZTE EuFi890 */
693 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
694 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0199, 0xff, 0xff, 0xff), /* ZTE MF820S */
695 + .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
696 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */
697 + .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
698 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff),
699 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
700 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff),
701 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
702 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff),
703 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
704 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) },
705 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff),
706 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
707 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1021, 0xff, 0xff, 0xff),
708 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
709 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) },
710 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1058, 0xff, 0xff, 0xff) },
711 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1059, 0xff, 0xff, 0xff) },
712 @@ -1002,18 +1026,24 @@ static const struct usb_device_id option_ids[] = {
713 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1169, 0xff, 0xff, 0xff) },
714 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1170, 0xff, 0xff, 0xff) },
715 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1244, 0xff, 0xff, 0xff) },
716 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1245, 0xff, 0xff, 0xff) },
717 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1245, 0xff, 0xff, 0xff),
718 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
719 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1246, 0xff, 0xff, 0xff) },
720 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1247, 0xff, 0xff, 0xff) },
721 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1247, 0xff, 0xff, 0xff),
722 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
723 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1248, 0xff, 0xff, 0xff) },
724 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1249, 0xff, 0xff, 0xff) },
725 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1250, 0xff, 0xff, 0xff) },
726 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1251, 0xff, 0xff, 0xff) },
727 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1252, 0xff, 0xff, 0xff) },
728 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1252, 0xff, 0xff, 0xff),
729 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
730 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1253, 0xff, 0xff, 0xff) },
731 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1254, 0xff, 0xff, 0xff) },
732 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1255, 0xff, 0xff, 0xff) },
733 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1256, 0xff, 0xff, 0xff) },
734 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1254, 0xff, 0xff, 0xff),
735 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
736 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1255, 0xff, 0xff, 0xff),
737 + .driver_info = (kernel_ulong_t)&zte_1255_blacklist },
738 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1256, 0xff, 0xff, 0xff),
739 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
740 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1257, 0xff, 0xff, 0xff) },
741 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1258, 0xff, 0xff, 0xff) },
742 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1259, 0xff, 0xff, 0xff) },
743 @@ -1058,8 +1088,16 @@ static const struct usb_device_id option_ids[] = {
744 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) },
745 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) },
746 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) },
747 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xff),
748 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
749 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff),
750 .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
751 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1424, 0xff, 0xff, 0xff),
752 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
753 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1425, 0xff, 0xff, 0xff),
754 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
755 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff), /* ZTE MF91 */
756 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
757 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
758 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
759 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
760 @@ -1071,15 +1109,21 @@ static const struct usb_device_id option_ids[] = {
761 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
762 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
763 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xff) },
764 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) },
765 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0133, 0xff, 0xff, 0xff) },
766 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) },
767 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff),
768 + .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
769 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0133, 0xff, 0xff, 0xff),
770 + .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
771 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff),
772 + .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
773 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) },
774 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) },
775 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) },
776 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff),
777 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
778 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) },
779 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) },
780 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) },
781 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff),
782 + .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
783 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff),
784 + .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
785
786 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
787 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
788 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
789 index 8b384cc..c215985 100644
790 --- a/fs/ext4/extents.c
791 +++ b/fs/ext4/extents.c
792 @@ -52,6 +52,9 @@
793 #define EXT4_EXT_MARK_UNINIT1 0x2 /* mark first half uninitialized */
794 #define EXT4_EXT_MARK_UNINIT2 0x4 /* mark second half uninitialized */
795
796 +#define EXT4_EXT_DATA_VALID1 0x8 /* first half contains valid data */
797 +#define EXT4_EXT_DATA_VALID2 0x10 /* second half contains valid data */
798 +
799 static int ext4_split_extent(handle_t *handle,
800 struct inode *inode,
801 struct ext4_ext_path *path,
802 @@ -2829,6 +2832,9 @@ static int ext4_split_extent_at(handle_t *handle,
803 unsigned int ee_len, depth;
804 int err = 0;
805
806 + BUG_ON((split_flag & (EXT4_EXT_DATA_VALID1 | EXT4_EXT_DATA_VALID2)) ==
807 + (EXT4_EXT_DATA_VALID1 | EXT4_EXT_DATA_VALID2));
808 +
809 ext_debug("ext4_split_extents_at: inode %lu, logical"
810 "block %llu\n", inode->i_ino, (unsigned long long)split);
811
812 @@ -2887,7 +2893,14 @@ static int ext4_split_extent_at(handle_t *handle,
813
814 err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
815 if (err == -ENOSPC && (EXT4_EXT_MAY_ZEROOUT & split_flag)) {
816 - err = ext4_ext_zeroout(inode, &orig_ex);
817 + if (split_flag & (EXT4_EXT_DATA_VALID1|EXT4_EXT_DATA_VALID2)) {
818 + if (split_flag & EXT4_EXT_DATA_VALID1)
819 + err = ext4_ext_zeroout(inode, ex2);
820 + else
821 + err = ext4_ext_zeroout(inode, ex);
822 + } else
823 + err = ext4_ext_zeroout(inode, &orig_ex);
824 +
825 if (err)
826 goto fix_extent_len;
827 /* update the extent length and mark as initialized */
828 @@ -2940,12 +2953,13 @@ static int ext4_split_extent(handle_t *handle,
829 uninitialized = ext4_ext_is_uninitialized(ex);
830
831 if (map->m_lblk + map->m_len < ee_block + ee_len) {
832 - split_flag1 = split_flag & EXT4_EXT_MAY_ZEROOUT ?
833 - EXT4_EXT_MAY_ZEROOUT : 0;
834 + split_flag1 = split_flag & EXT4_EXT_MAY_ZEROOUT;
835 flags1 = flags | EXT4_GET_BLOCKS_PRE_IO;
836 if (uninitialized)
837 split_flag1 |= EXT4_EXT_MARK_UNINIT1 |
838 EXT4_EXT_MARK_UNINIT2;
839 + if (split_flag & EXT4_EXT_DATA_VALID2)
840 + split_flag1 |= EXT4_EXT_DATA_VALID1;
841 err = ext4_split_extent_at(handle, inode, path,
842 map->m_lblk + map->m_len, split_flag1, flags1);
843 if (err)
844 @@ -2958,8 +2972,8 @@ static int ext4_split_extent(handle_t *handle,
845 return PTR_ERR(path);
846
847 if (map->m_lblk >= ee_block) {
848 - split_flag1 = split_flag & EXT4_EXT_MAY_ZEROOUT ?
849 - EXT4_EXT_MAY_ZEROOUT : 0;
850 + split_flag1 = split_flag & (EXT4_EXT_MAY_ZEROOUT |
851 + EXT4_EXT_DATA_VALID2);
852 if (uninitialized)
853 split_flag1 |= EXT4_EXT_MARK_UNINIT1;
854 if (split_flag & EXT4_EXT_MARK_UNINIT2)
855 @@ -3237,26 +3251,47 @@ static int ext4_split_unwritten_extents(handle_t *handle,
856
857 split_flag |= ee_block + ee_len <= eof_block ? EXT4_EXT_MAY_ZEROOUT : 0;
858 split_flag |= EXT4_EXT_MARK_UNINIT2;
859 -
860 + if (flags & EXT4_GET_BLOCKS_CONVERT)
861 + split_flag |= EXT4_EXT_DATA_VALID2;
862 flags |= EXT4_GET_BLOCKS_PRE_IO;
863 return ext4_split_extent(handle, inode, path, map, split_flag, flags);
864 }
865
866 static int ext4_convert_unwritten_extents_endio(handle_t *handle,
867 - struct inode *inode,
868 - struct ext4_ext_path *path)
869 + struct inode *inode,
870 + struct ext4_map_blocks *map,
871 + struct ext4_ext_path *path)
872 {
873 struct ext4_extent *ex;
874 + ext4_lblk_t ee_block;
875 + unsigned int ee_len;
876 int depth;
877 int err = 0;
878
879 depth = ext_depth(inode);
880 ex = path[depth].p_ext;
881 + ee_block = le32_to_cpu(ex->ee_block);
882 + ee_len = ext4_ext_get_actual_len(ex);
883
884 ext_debug("ext4_convert_unwritten_extents_endio: inode %lu, logical"
885 "block %llu, max_blocks %u\n", inode->i_ino,
886 - (unsigned long long)le32_to_cpu(ex->ee_block),
887 - ext4_ext_get_actual_len(ex));
888 + (unsigned long long)ee_block, ee_len);
889 +
890 + /* If extent is larger than requested then split is required */
891 + if (ee_block != map->m_lblk || ee_len > map->m_len) {
892 + err = ext4_split_unwritten_extents(handle, inode, map, path,
893 + EXT4_GET_BLOCKS_CONVERT);
894 + if (err < 0)
895 + goto out;
896 + ext4_ext_drop_refs(path);
897 + path = ext4_ext_find_extent(inode, map->m_lblk, path);
898 + if (IS_ERR(path)) {
899 + err = PTR_ERR(path);
900 + goto out;
901 + }
902 + depth = ext_depth(inode);
903 + ex = path[depth].p_ext;
904 + }
905
906 err = ext4_ext_get_access(handle, inode, path + depth);
907 if (err)
908 @@ -3564,7 +3599,7 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode,
909 }
910 /* IO end_io complete, convert the filled extent to written */
911 if ((flags & EXT4_GET_BLOCKS_CONVERT)) {
912 - ret = ext4_convert_unwritten_extents_endio(handle, inode,
913 + ret = ext4_convert_unwritten_extents_endio(handle, inode, map,
914 path);
915 if (ret >= 0) {
916 ext4_update_inode_fsync_trans(handle, inode, 1);
917 diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
918 index 6b0a57e..e77c4fe 100644
919 --- a/fs/ext4/mballoc.c
920 +++ b/fs/ext4/mballoc.c
921 @@ -4984,8 +4984,9 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)
922 end = start + (range->len >> sb->s_blocksize_bits) - 1;
923 minlen = range->minlen >> sb->s_blocksize_bits;
924
925 - if (unlikely(minlen > EXT4_CLUSTERS_PER_GROUP(sb)) ||
926 - unlikely(start >= max_blks))
927 + if (minlen > EXT4_CLUSTERS_PER_GROUP(sb) ||
928 + start >= max_blks ||
929 + range->len < sb->s_blocksize)
930 return -EINVAL;
931 if (end >= max_blks)
932 end = max_blks - 1;
933 diff --git a/fs/lockd/clntxdr.c b/fs/lockd/clntxdr.c
934 index d269ada..982d267 100644
935 --- a/fs/lockd/clntxdr.c
936 +++ b/fs/lockd/clntxdr.c
937 @@ -223,7 +223,7 @@ static void encode_nlm_stat(struct xdr_stream *xdr,
938 {
939 __be32 *p;
940
941 - BUG_ON(be32_to_cpu(stat) > NLM_LCK_DENIED_GRACE_PERIOD);
942 + WARN_ON_ONCE(be32_to_cpu(stat) > NLM_LCK_DENIED_GRACE_PERIOD);
943 p = xdr_reserve_space(xdr, 4);
944 *p = stat;
945 }
946 diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
947 index d27aab1..d413af3 100644
948 --- a/fs/lockd/svcproc.c
949 +++ b/fs/lockd/svcproc.c
950 @@ -67,7 +67,8 @@ nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,
951
952 /* Obtain file pointer. Not used by FREE_ALL call. */
953 if (filp != NULL) {
954 - if ((error = nlm_lookup_file(rqstp, &file, &lock->fh)) != 0)
955 + error = cast_status(nlm_lookup_file(rqstp, &file, &lock->fh));
956 + if (error != 0)
957 goto no_locks;
958 *filp = file;
959
960 diff --git a/fs/proc/stat.c b/fs/proc/stat.c
961 index 64c3b31..e296572 100644
962 --- a/fs/proc/stat.c
963 +++ b/fs/proc/stat.c
964 @@ -45,10 +45,13 @@ static cputime64_t get_iowait_time(int cpu)
965
966 static u64 get_idle_time(int cpu)
967 {
968 - u64 idle, idle_time = get_cpu_idle_time_us(cpu, NULL);
969 + u64 idle, idle_time = -1ULL;
970 +
971 + if (cpu_online(cpu))
972 + idle_time = get_cpu_idle_time_us(cpu, NULL);
973
974 if (idle_time == -1ULL)
975 - /* !NO_HZ so we can rely on cpustat.idle */
976 + /* !NO_HZ or cpu offline so we can rely on cpustat.idle */
977 idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE];
978 else
979 idle = usecs_to_cputime64(idle_time);
980 @@ -58,10 +61,13 @@ static u64 get_idle_time(int cpu)
981
982 static u64 get_iowait_time(int cpu)
983 {
984 - u64 iowait, iowait_time = get_cpu_iowait_time_us(cpu, NULL);
985 + u64 iowait, iowait_time = -1ULL;
986 +
987 + if (cpu_online(cpu))
988 + iowait_time = get_cpu_iowait_time_us(cpu, NULL);
989
990 if (iowait_time == -1ULL)
991 - /* !NO_HZ so we can rely on cpustat.iowait */
992 + /* !NO_HZ or cpu offline so we can rely on cpustat.iowait */
993 iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT];
994 else
995 iowait = usecs_to_cputime64(iowait_time);
996 diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
997 index a810987..561e130 100644
998 --- a/include/linux/if_vlan.h
999 +++ b/include/linux/if_vlan.h
1000 @@ -82,6 +82,8 @@ static inline int is_vlan_dev(struct net_device *dev)
1001 }
1002
1003 #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT)
1004 +#define vlan_tx_nonzero_tag_present(__skb) \
1005 + (vlan_tx_tag_present(__skb) && ((__skb)->vlan_tci & VLAN_VID_MASK))
1006 #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
1007
1008 #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
1009 @@ -91,7 +93,7 @@ extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
1010 extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
1011 extern u16 vlan_dev_vlan_id(const struct net_device *dev);
1012
1013 -extern bool vlan_do_receive(struct sk_buff **skb, bool last_handler);
1014 +extern bool vlan_do_receive(struct sk_buff **skb);
1015 extern struct sk_buff *vlan_untag(struct sk_buff *skb);
1016
1017 extern int vlan_vid_add(struct net_device *dev, unsigned short vid);
1018 @@ -120,10 +122,8 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
1019 return 0;
1020 }
1021
1022 -static inline bool vlan_do_receive(struct sk_buff **skb, bool last_handler)
1023 +static inline bool vlan_do_receive(struct sk_buff **skb)
1024 {
1025 - if (((*skb)->vlan_tci & VLAN_VID_MASK) && last_handler)
1026 - (*skb)->pkt_type = PACKET_OTHERHOST;
1027 return false;
1028 }
1029
1030 diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
1031 index 1482340..2483513 100644
1032 --- a/include/linux/mtd/nand.h
1033 +++ b/include/linux/mtd/nand.h
1034 @@ -215,9 +215,6 @@ typedef enum {
1035 #define NAND_SUBPAGE_READ(chip) ((chip->ecc.mode == NAND_ECC_SOFT) \
1036 && (chip->page_shift > 9))
1037
1038 -/* Mask to zero out the chip options, which come from the id table */
1039 -#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR)
1040 -
1041 /* Non chip related options */
1042 /* This option skips the bbt scan during initialization. */
1043 #define NAND_SKIP_BBTSCAN 0x00010000
1044 diff --git a/include/linux/netlink.h b/include/linux/netlink.h
1045 index a2092f5..b23e9cd 100644
1046 --- a/include/linux/netlink.h
1047 +++ b/include/linux/netlink.h
1048 @@ -153,6 +153,7 @@ struct nlattr {
1049
1050 #include <linux/capability.h>
1051 #include <linux/skbuff.h>
1052 +#include <linux/export.h>
1053
1054 struct net;
1055
1056 @@ -226,6 +227,8 @@ struct netlink_callback {
1057 struct netlink_callback *cb);
1058 int (*done)(struct netlink_callback *cb);
1059 void *data;
1060 + /* the module that dump function belong to */
1061 + struct module *module;
1062 u16 family;
1063 u16 min_dump_alloc;
1064 unsigned int prev_seq, seq;
1065 @@ -251,14 +254,24 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
1066
1067 struct netlink_dump_control {
1068 int (*dump)(struct sk_buff *skb, struct netlink_callback *);
1069 - int (*done)(struct netlink_callback*);
1070 + int (*done)(struct netlink_callback *);
1071 void *data;
1072 + struct module *module;
1073 u16 min_dump_alloc;
1074 };
1075
1076 -extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1077 - const struct nlmsghdr *nlh,
1078 - struct netlink_dump_control *control);
1079 +extern int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1080 + const struct nlmsghdr *nlh,
1081 + struct netlink_dump_control *control);
1082 +static inline int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1083 + const struct nlmsghdr *nlh,
1084 + struct netlink_dump_control *control)
1085 +{
1086 + if (!control->module)
1087 + control->module = THIS_MODULE;
1088 +
1089 + return __netlink_dump_start(ssk, skb, nlh, control);
1090 +}
1091
1092
1093 #define NL_NONROOT_RECV 0x1
1094 diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
1095 index 77d278d..005b507 100644
1096 --- a/include/linux/sunrpc/xprt.h
1097 +++ b/include/linux/sunrpc/xprt.h
1098 @@ -114,6 +114,7 @@ struct rpc_xprt_ops {
1099 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
1100 int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
1101 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
1102 + void (*alloc_slot)(struct rpc_xprt *xprt, struct rpc_task *task);
1103 void (*rpcbind)(struct rpc_task *task);
1104 void (*set_port)(struct rpc_xprt *xprt, unsigned short port);
1105 void (*connect)(struct rpc_task *task);
1106 @@ -279,6 +280,8 @@ void xprt_connect(struct rpc_task *task);
1107 void xprt_reserve(struct rpc_task *task);
1108 int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
1109 int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
1110 +void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task);
1111 +void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task);
1112 int xprt_prepare_transmit(struct rpc_task *task);
1113 void xprt_transmit(struct rpc_task *task);
1114 void xprt_end_transmit(struct rpc_task *task);
1115 diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h
1116 index 3c5363a..bd3d8b2 100644
1117 --- a/include/rdma/rdma_netlink.h
1118 +++ b/include/rdma/rdma_netlink.h
1119 @@ -39,6 +39,7 @@ struct rdma_cm_id_stats {
1120
1121 struct ibnl_client_cbs {
1122 int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb);
1123 + struct module *module;
1124 };
1125
1126 int ibnl_init(void);
1127 diff --git a/kernel/cgroup.c b/kernel/cgroup.c
1128 index ed64cca..762f7cc7 100644
1129 --- a/kernel/cgroup.c
1130 +++ b/kernel/cgroup.c
1131 @@ -1868,9 +1868,8 @@ static void cgroup_task_migrate(struct cgroup *cgrp, struct cgroup *oldcgrp,
1132 * trading it for newcg is protected by cgroup_mutex, we're safe to drop
1133 * it here; it will be freed under RCU.
1134 */
1135 - put_css_set(oldcg);
1136 -
1137 set_bit(CGRP_RELEASABLE, &oldcgrp->flags);
1138 + put_css_set(oldcg);
1139 }
1140
1141 /**
1142 @@ -4463,31 +4462,20 @@ static const struct file_operations proc_cgroupstats_operations = {
1143 *
1144 * A pointer to the shared css_set was automatically copied in
1145 * fork.c by dup_task_struct(). However, we ignore that copy, since
1146 - * it was not made under the protection of RCU, cgroup_mutex or
1147 - * threadgroup_change_begin(), so it might no longer be a valid
1148 - * cgroup pointer. cgroup_attach_task() might have already changed
1149 - * current->cgroups, allowing the previously referenced cgroup
1150 - * group to be removed and freed.
1151 - *
1152 - * Outside the pointer validity we also need to process the css_set
1153 - * inheritance between threadgoup_change_begin() and
1154 - * threadgoup_change_end(), this way there is no leak in any process
1155 - * wide migration performed by cgroup_attach_proc() that could otherwise
1156 - * miss a thread because it is too early or too late in the fork stage.
1157 + * it was not made under the protection of RCU or cgroup_mutex, so
1158 + * might no longer be a valid cgroup pointer. cgroup_attach_task() might
1159 + * have already changed current->cgroups, allowing the previously
1160 + * referenced cgroup group to be removed and freed.
1161 *
1162 * At the point that cgroup_fork() is called, 'current' is the parent
1163 * task, and the passed argument 'child' points to the child task.
1164 */
1165 void cgroup_fork(struct task_struct *child)
1166 {
1167 - /*
1168 - * We don't need to task_lock() current because current->cgroups
1169 - * can't be changed concurrently here. The parent obviously hasn't
1170 - * exited and called cgroup_exit(), and we are synchronized against
1171 - * cgroup migration through threadgroup_change_begin().
1172 - */
1173 + task_lock(current);
1174 child->cgroups = current->cgroups;
1175 get_css_set(child->cgroups);
1176 + task_unlock(current);
1177 INIT_LIST_HEAD(&child->cg_list);
1178 }
1179
1180 @@ -4540,19 +4528,10 @@ void cgroup_post_fork(struct task_struct *child)
1181 */
1182 if (use_task_css_set_links) {
1183 write_lock(&css_set_lock);
1184 - if (list_empty(&child->cg_list)) {
1185 - /*
1186 - * It's safe to use child->cgroups without task_lock()
1187 - * here because we are protected through
1188 - * threadgroup_change_begin() against concurrent
1189 - * css_set change in cgroup_task_migrate(). Also
1190 - * the task can't exit at that point until
1191 - * wake_up_new_task() is called, so we are protected
1192 - * against cgroup_exit() setting child->cgroup to
1193 - * init_css_set.
1194 - */
1195 + task_lock(child);
1196 + if (list_empty(&child->cg_list))
1197 list_add(&child->cg_list, &child->cgroups->tasks);
1198 - }
1199 + task_unlock(child);
1200 write_unlock(&css_set_lock);
1201 }
1202 }
1203 diff --git a/kernel/sys.c b/kernel/sys.c
1204 index 898a84c..b0003db 100644
1205 --- a/kernel/sys.c
1206 +++ b/kernel/sys.c
1207 @@ -1180,15 +1180,16 @@ DECLARE_RWSEM(uts_sem);
1208 * Work around broken programs that cannot handle "Linux 3.0".
1209 * Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40
1210 */
1211 -static int override_release(char __user *release, int len)
1212 +static int override_release(char __user *release, size_t len)
1213 {
1214 int ret = 0;
1215 - char buf[65];
1216
1217 if (current->personality & UNAME26) {
1218 - char *rest = UTS_RELEASE;
1219 + const char *rest = UTS_RELEASE;
1220 + char buf[65] = { 0 };
1221 int ndots = 0;
1222 unsigned v;
1223 + size_t copy;
1224
1225 while (*rest) {
1226 if (*rest == '.' && ++ndots >= 3)
1227 @@ -1198,8 +1199,9 @@ static int override_release(char __user *release, int len)
1228 rest++;
1229 }
1230 v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
1231 - snprintf(buf, len, "2.6.%u%s", v, rest);
1232 - ret = copy_to_user(release, buf, len);
1233 + copy = clamp_t(size_t, len, 1, sizeof(buf));
1234 + copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
1235 + ret = copy_to_user(release, buf, copy + 1);
1236 }
1237 return ret;
1238 }
1239 diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
1240 index f364630..912613c 100644
1241 --- a/net/8021q/vlan_core.c
1242 +++ b/net/8021q/vlan_core.c
1243 @@ -5,7 +5,7 @@
1244 #include <linux/export.h>
1245 #include "vlan.h"
1246
1247 -bool vlan_do_receive(struct sk_buff **skbp, bool last_handler)
1248 +bool vlan_do_receive(struct sk_buff **skbp)
1249 {
1250 struct sk_buff *skb = *skbp;
1251 u16 vlan_id = skb->vlan_tci & VLAN_VID_MASK;
1252 @@ -13,14 +13,8 @@ bool vlan_do_receive(struct sk_buff **skbp, bool last_handler)
1253 struct vlan_pcpu_stats *rx_stats;
1254
1255 vlan_dev = vlan_find_dev(skb->dev, vlan_id);
1256 - if (!vlan_dev) {
1257 - /* Only the last call to vlan_do_receive() should change
1258 - * pkt_type to PACKET_OTHERHOST
1259 - */
1260 - if (vlan_id && last_handler)
1261 - skb->pkt_type = PACKET_OTHERHOST;
1262 + if (!vlan_dev)
1263 return false;
1264 - }
1265
1266 skb = *skbp = skb_share_check(skb, GFP_ATOMIC);
1267 if (unlikely(!skb))
1268 diff --git a/net/core/dev.c b/net/core/dev.c
1269 index 086bc2e..82ca51b 100644
1270 --- a/net/core/dev.c
1271 +++ b/net/core/dev.c
1272 @@ -3209,18 +3209,18 @@ another_round:
1273 ncls:
1274 #endif
1275
1276 - rx_handler = rcu_dereference(skb->dev->rx_handler);
1277 if (vlan_tx_tag_present(skb)) {
1278 if (pt_prev) {
1279 ret = deliver_skb(skb, pt_prev, orig_dev);
1280 pt_prev = NULL;
1281 }
1282 - if (vlan_do_receive(&skb, !rx_handler))
1283 + if (vlan_do_receive(&skb))
1284 goto another_round;
1285 else if (unlikely(!skb))
1286 goto out;
1287 }
1288
1289 + rx_handler = rcu_dereference(skb->dev->rx_handler);
1290 if (rx_handler) {
1291 if (pt_prev) {
1292 ret = deliver_skb(skb, pt_prev, orig_dev);
1293 @@ -3240,6 +3240,9 @@ ncls:
1294 }
1295 }
1296
1297 + if (vlan_tx_nonzero_tag_present(skb))
1298 + skb->pkt_type = PACKET_OTHERHOST;
1299 +
1300 /* deliver only exact match when indicated */
1301 null_or_dev = deliver_exact ? skb->dev : NULL;
1302
1303 diff --git a/net/core/neighbour.c b/net/core/neighbour.c
1304 index 73b9035..ac88107 100644
1305 --- a/net/core/neighbour.c
1306 +++ b/net/core/neighbour.c
1307 @@ -1285,8 +1285,6 @@ int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb)
1308 if (!dst)
1309 goto discard;
1310
1311 - __skb_pull(skb, skb_network_offset(skb));
1312 -
1313 if (!neigh_event_send(neigh, skb)) {
1314 int err;
1315 struct net_device *dev = neigh->dev;
1316 @@ -1296,6 +1294,7 @@ int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb)
1317 neigh_hh_init(neigh, dst);
1318
1319 do {
1320 + __skb_pull(skb, skb_network_offset(skb));
1321 seq = read_seqbegin(&neigh->ha_lock);
1322 err = dev_hard_header(skb, dev, ntohs(skb->protocol),
1323 neigh->ha, NULL, skb->len);
1324 @@ -1326,9 +1325,8 @@ int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb)
1325 unsigned int seq;
1326 int err;
1327
1328 - __skb_pull(skb, skb_network_offset(skb));
1329 -
1330 do {
1331 + __skb_pull(skb, skb_network_offset(skb));
1332 seq = read_seqbegin(&neigh->ha_lock);
1333 err = dev_hard_header(skb, dev, ntohs(skb->protocol),
1334 neigh->ha, NULL, skb->len);
1335 diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
1336 index 0cb86ce..8f2458d 100644
1337 --- a/net/ipv4/tcp_ipv4.c
1338 +++ b/net/ipv4/tcp_ipv4.c
1339 @@ -678,10 +678,11 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
1340 arg.csumoffset = offsetof(struct tcphdr, check) / 2;
1341 arg.flags = (sk && inet_sk(sk)->transparent) ? IP_REPLY_ARG_NOSRCCHECK : 0;
1342 /* When socket is gone, all binding information is lost.
1343 - * routing might fail in this case. using iif for oif to
1344 - * make sure we can deliver it
1345 + * routing might fail in this case. No choice here, if we choose to force
1346 + * input interface, we will misroute in case of asymmetric route.
1347 */
1348 - arg.bound_dev_if = sk ? sk->sk_bound_dev_if : inet_iif(skb);
1349 + if (sk)
1350 + arg.bound_dev_if = sk->sk_bound_dev_if;
1351
1352 net = dev_net(skb_dst(skb)->dev);
1353 arg.tos = ip_hdr(skb)->tos;
1354 diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
1355 index 5ec6069..468a5ce 100644
1356 --- a/net/ipv6/addrconf.c
1357 +++ b/net/ipv6/addrconf.c
1358 @@ -3095,14 +3095,15 @@ static struct inet6_ifaddr *if6_get_first(struct seq_file *seq, loff_t pos)
1359 struct hlist_node *n;
1360 hlist_for_each_entry_rcu_bh(ifa, n, &inet6_addr_lst[state->bucket],
1361 addr_lst) {
1362 + if (!net_eq(dev_net(ifa->idev->dev), net))
1363 + continue;
1364 /* sync with offset */
1365 if (p < state->offset) {
1366 p++;
1367 continue;
1368 }
1369 state->offset++;
1370 - if (net_eq(dev_net(ifa->idev->dev), net))
1371 - return ifa;
1372 + return ifa;
1373 }
1374
1375 /* prepare for next bucket */
1376 @@ -3120,18 +3121,20 @@ static struct inet6_ifaddr *if6_get_next(struct seq_file *seq,
1377 struct hlist_node *n = &ifa->addr_lst;
1378
1379 hlist_for_each_entry_continue_rcu_bh(ifa, n, addr_lst) {
1380 + if (!net_eq(dev_net(ifa->idev->dev), net))
1381 + continue;
1382 state->offset++;
1383 - if (net_eq(dev_net(ifa->idev->dev), net))
1384 - return ifa;
1385 + return ifa;
1386 }
1387
1388 while (++state->bucket < IN6_ADDR_HSIZE) {
1389 state->offset = 0;
1390 hlist_for_each_entry_rcu_bh(ifa, n,
1391 &inet6_addr_lst[state->bucket], addr_lst) {
1392 + if (!net_eq(dev_net(ifa->idev->dev), net))
1393 + continue;
1394 state->offset++;
1395 - if (net_eq(dev_net(ifa->idev->dev), net))
1396 - return ifa;
1397 + return ifa;
1398 }
1399 }
1400
1401 diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
1402 index 98256cf..8a8fa2d 100644
1403 --- a/net/ipv6/tcp_ipv6.c
1404 +++ b/net/ipv6/tcp_ipv6.c
1405 @@ -896,7 +896,8 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,
1406 __tcp_v6_send_check(buff, &fl6.saddr, &fl6.daddr);
1407
1408 fl6.flowi6_proto = IPPROTO_TCP;
1409 - fl6.flowi6_oif = inet6_iif(skb);
1410 + if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL)
1411 + fl6.flowi6_oif = inet6_iif(skb);
1412 fl6.fl6_dport = t1->dest;
1413 fl6.fl6_sport = t1->source;
1414 security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));
1415 diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
1416 index bba6ba1..edce424 100644
1417 --- a/net/netlink/af_netlink.c
1418 +++ b/net/netlink/af_netlink.c
1419 @@ -156,6 +156,8 @@ static void netlink_sock_destruct(struct sock *sk)
1420 if (nlk->cb) {
1421 if (nlk->cb->done)
1422 nlk->cb->done(nlk->cb);
1423 +
1424 + module_put(nlk->cb->module);
1425 netlink_destroy_callback(nlk->cb);
1426 }
1427
1428 @@ -1728,6 +1730,7 @@ static int netlink_dump(struct sock *sk)
1429 nlk->cb = NULL;
1430 mutex_unlock(nlk->cb_mutex);
1431
1432 + module_put(cb->module);
1433 netlink_destroy_callback(cb);
1434 return 0;
1435
1436 @@ -1737,9 +1740,9 @@ errout_skb:
1437 return err;
1438 }
1439
1440 -int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1441 - const struct nlmsghdr *nlh,
1442 - struct netlink_dump_control *control)
1443 +int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1444 + const struct nlmsghdr *nlh,
1445 + struct netlink_dump_control *control)
1446 {
1447 struct netlink_callback *cb;
1448 struct sock *sk;
1449 @@ -1754,6 +1757,7 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1450 cb->done = control->done;
1451 cb->nlh = nlh;
1452 cb->data = control->data;
1453 + cb->module = control->module;
1454 cb->min_dump_alloc = control->min_dump_alloc;
1455 atomic_inc(&skb->users);
1456 cb->skb = skb;
1457 @@ -1764,19 +1768,28 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1458 return -ECONNREFUSED;
1459 }
1460 nlk = nlk_sk(sk);
1461 - /* A dump is in progress... */
1462 +
1463 mutex_lock(nlk->cb_mutex);
1464 + /* A dump is in progress... */
1465 if (nlk->cb) {
1466 mutex_unlock(nlk->cb_mutex);
1467 netlink_destroy_callback(cb);
1468 - sock_put(sk);
1469 - return -EBUSY;
1470 + ret = -EBUSY;
1471 + goto out;
1472 }
1473 + /* add reference of module which cb->dump belongs to */
1474 + if (!try_module_get(cb->module)) {
1475 + mutex_unlock(nlk->cb_mutex);
1476 + netlink_destroy_callback(cb);
1477 + ret = -EPROTONOSUPPORT;
1478 + goto out;
1479 + }
1480 +
1481 nlk->cb = cb;
1482 mutex_unlock(nlk->cb_mutex);
1483
1484 ret = netlink_dump(sk);
1485 -
1486 +out:
1487 sock_put(sk);
1488
1489 if (ret)
1490 @@ -1787,7 +1800,7 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1491 */
1492 return -EINTR;
1493 }
1494 -EXPORT_SYMBOL(netlink_dump_start);
1495 +EXPORT_SYMBOL(__netlink_dump_start);
1496
1497 void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
1498 {
1499 diff --git a/net/rds/send.c b/net/rds/send.c
1500 index 96531d4..88eace5 100644
1501 --- a/net/rds/send.c
1502 +++ b/net/rds/send.c
1503 @@ -1122,7 +1122,7 @@ rds_send_pong(struct rds_connection *conn, __be16 dport)
1504 rds_stats_inc(s_send_pong);
1505
1506 if (!test_bit(RDS_LL_SEND_FULL, &conn->c_flags))
1507 - rds_send_xmit(conn);
1508 + queue_delayed_work(rds_wq, &conn->c_send_w, 0);
1509
1510 rds_message_put(rm);
1511 return 0;
1512 diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
1513 index de0b0f3..76cb304 100644
1514 --- a/net/sunrpc/cache.c
1515 +++ b/net/sunrpc/cache.c
1516 @@ -1406,11 +1406,11 @@ static ssize_t read_flush(struct file *file, char __user *buf,
1517 size_t count, loff_t *ppos,
1518 struct cache_detail *cd)
1519 {
1520 - char tbuf[20];
1521 + char tbuf[22];
1522 unsigned long p = *ppos;
1523 size_t len;
1524
1525 - sprintf(tbuf, "%lu\n", convert_to_wallclock(cd->flush_time));
1526 + snprintf(tbuf, sizeof(tbuf), "%lu\n", convert_to_wallclock(cd->flush_time));
1527 len = strlen(tbuf);
1528 if (p >= len)
1529 return 0;
1530 diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
1531 index da72492..176a24f 100644
1532 --- a/net/sunrpc/xprt.c
1533 +++ b/net/sunrpc/xprt.c
1534 @@ -969,11 +969,11 @@ static bool xprt_dynamic_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req)
1535 return false;
1536 }
1537
1538 -static void xprt_alloc_slot(struct rpc_task *task)
1539 +void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task)
1540 {
1541 - struct rpc_xprt *xprt = task->tk_xprt;
1542 struct rpc_rqst *req;
1543
1544 + spin_lock(&xprt->reserve_lock);
1545 if (!list_empty(&xprt->free)) {
1546 req = list_entry(xprt->free.next, struct rpc_rqst, rq_list);
1547 list_del(&req->rq_list);
1548 @@ -994,12 +994,29 @@ static void xprt_alloc_slot(struct rpc_task *task)
1549 default:
1550 task->tk_status = -EAGAIN;
1551 }
1552 + spin_unlock(&xprt->reserve_lock);
1553 return;
1554 out_init_req:
1555 task->tk_status = 0;
1556 task->tk_rqstp = req;
1557 xprt_request_init(task, xprt);
1558 + spin_unlock(&xprt->reserve_lock);
1559 +}
1560 +EXPORT_SYMBOL_GPL(xprt_alloc_slot);
1561 +
1562 +void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task)
1563 +{
1564 + /* Note: grabbing the xprt_lock_write() ensures that we throttle
1565 + * new slot allocation if the transport is congested (i.e. when
1566 + * reconnecting a stream transport or when out of socket write
1567 + * buffer space).
1568 + */
1569 + if (xprt_lock_write(xprt, task)) {
1570 + xprt_alloc_slot(xprt, task);
1571 + xprt_release_write(xprt, task);
1572 + }
1573 }
1574 +EXPORT_SYMBOL_GPL(xprt_lock_and_alloc_slot);
1575
1576 static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req)
1577 {
1578 @@ -1083,20 +1100,9 @@ void xprt_reserve(struct rpc_task *task)
1579 if (task->tk_rqstp != NULL)
1580 return;
1581
1582 - /* Note: grabbing the xprt_lock_write() here is not strictly needed,
1583 - * but ensures that we throttle new slot allocation if the transport
1584 - * is congested (e.g. if reconnecting or if we're out of socket
1585 - * write buffer space).
1586 - */
1587 task->tk_timeout = 0;
1588 task->tk_status = -EAGAIN;
1589 - if (!xprt_lock_write(xprt, task))
1590 - return;
1591 -
1592 - spin_lock(&xprt->reserve_lock);
1593 - xprt_alloc_slot(task);
1594 - spin_unlock(&xprt->reserve_lock);
1595 - xprt_release_write(xprt, task);
1596 + xprt->ops->alloc_slot(xprt, task);
1597 }
1598
1599 static inline __be32 xprt_alloc_xid(struct rpc_xprt *xprt)
1600 diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
1601 index 06cdbff..5d9202d 100644
1602 --- a/net/sunrpc/xprtrdma/transport.c
1603 +++ b/net/sunrpc/xprtrdma/transport.c
1604 @@ -713,6 +713,7 @@ static void xprt_rdma_print_stats(struct rpc_xprt *xprt, struct seq_file *seq)
1605 static struct rpc_xprt_ops xprt_rdma_procs = {
1606 .reserve_xprt = xprt_rdma_reserve_xprt,
1607 .release_xprt = xprt_release_xprt_cong, /* sunrpc/xprt.c */
1608 + .alloc_slot = xprt_alloc_slot,
1609 .release_request = xprt_release_rqst_cong, /* ditto */
1610 .set_retrans_timeout = xprt_set_retrans_timeout_def, /* ditto */
1611 .rpcbind = rpcb_getport_async, /* sunrpc/rpcb_clnt.c */
1612 diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
1613 index 00ff343..a4a6586 100644
1614 --- a/net/sunrpc/xprtsock.c
1615 +++ b/net/sunrpc/xprtsock.c
1616 @@ -2444,6 +2444,7 @@ static void bc_destroy(struct rpc_xprt *xprt)
1617 static struct rpc_xprt_ops xs_local_ops = {
1618 .reserve_xprt = xprt_reserve_xprt,
1619 .release_xprt = xs_tcp_release_xprt,
1620 + .alloc_slot = xprt_alloc_slot,
1621 .rpcbind = xs_local_rpcbind,
1622 .set_port = xs_local_set_port,
1623 .connect = xs_connect,
1624 @@ -2460,6 +2461,7 @@ static struct rpc_xprt_ops xs_udp_ops = {
1625 .set_buffer_size = xs_udp_set_buffer_size,
1626 .reserve_xprt = xprt_reserve_xprt_cong,
1627 .release_xprt = xprt_release_xprt_cong,
1628 + .alloc_slot = xprt_alloc_slot,
1629 .rpcbind = rpcb_getport_async,
1630 .set_port = xs_set_port,
1631 .connect = xs_connect,
1632 @@ -2477,6 +2479,7 @@ static struct rpc_xprt_ops xs_udp_ops = {
1633 static struct rpc_xprt_ops xs_tcp_ops = {
1634 .reserve_xprt = xprt_reserve_xprt,
1635 .release_xprt = xs_tcp_release_xprt,
1636 + .alloc_slot = xprt_lock_and_alloc_slot,
1637 .rpcbind = rpcb_getport_async,
1638 .set_port = xs_set_port,
1639 .connect = xs_connect,
1640 @@ -2496,6 +2499,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
1641 static struct rpc_xprt_ops bc_tcp_ops = {
1642 .reserve_xprt = xprt_reserve_xprt,
1643 .release_xprt = xprt_release_xprt,
1644 + .alloc_slot = xprt_alloc_slot,
1645 .rpcbind = xs_local_rpcbind,
1646 .buf_alloc = bc_malloc,
1647 .buf_free = bc_free,

  ViewVC Help
Powered by ViewVC 1.1.20