/[linux-patches]/genpatches-2.6/tags/3.0-30/1018_linux-3.0.19.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1018_linux-3.0.19.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (23 months, 4 weeks ago) by mpagano
File size: 73506 byte(s)
3.0-30 release
1 diff --git a/Makefile b/Makefile
2 index 581b8e9..1e57901 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 0
8 -SUBLEVEL = 18
9 +SUBLEVEL = 19
10 EXTRAVERSION =
11 NAME = Sneaky Weasel
12
13 diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
14 index 9a9706c..6ebdb0d 100644
15 --- a/arch/arm/mach-ux500/Kconfig
16 +++ b/arch/arm/mach-ux500/Kconfig
17 @@ -7,6 +7,7 @@ config UX500_SOC_COMMON
18 select HAS_MTU
19 select ARM_ERRATA_753970
20 select ARM_ERRATA_754322
21 + select ARM_ERRATA_764369
22
23 menu "Ux500 SoC"
24
25 diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
26 index 089c0b5..b6ba103 100644
27 --- a/arch/arm/mm/proc-v7.S
28 +++ b/arch/arm/mm/proc-v7.S
29 @@ -270,10 +270,6 @@ cpu_resume_l1_flags:
30 * Initialise TLB, Caches, and MMU state ready to switch the MMU
31 * on. Return in r0 the new CP15 C1 control register setting.
32 *
33 - * We automatically detect if we have a Harvard cache, and use the
34 - * Harvard cache control instructions insead of the unified cache
35 - * control instructions.
36 - *
37 * This should be able to cover all ARMv7 cores.
38 *
39 * It is assumed that:
40 @@ -363,9 +359,7 @@ __v7_setup:
41 #endif
42
43 3: mov r10, #0
44 -#ifdef HARVARD_CACHE
45 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate
46 -#endif
47 dsb
48 #ifdef CONFIG_MMU
49 mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs
50 diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h
51 index 54a13aa..21f7385 100644
52 --- a/arch/x86/include/asm/uv/uv_hub.h
53 +++ b/arch/x86/include/asm/uv/uv_hub.h
54 @@ -318,13 +318,13 @@ uv_gpa_in_mmr_space(unsigned long gpa)
55 /* UV global physical address --> socket phys RAM */
56 static inline unsigned long uv_gpa_to_soc_phys_ram(unsigned long gpa)
57 {
58 - unsigned long paddr = gpa & uv_hub_info->gpa_mask;
59 + unsigned long paddr;
60 unsigned long remap_base = uv_hub_info->lowmem_remap_base;
61 unsigned long remap_top = uv_hub_info->lowmem_remap_top;
62
63 gpa = ((gpa << uv_hub_info->m_shift) >> uv_hub_info->m_shift) |
64 ((gpa >> uv_hub_info->n_lshift) << uv_hub_info->m_val);
65 - gpa = gpa & uv_hub_info->gpa_mask;
66 + paddr = gpa & uv_hub_info->gpa_mask;
67 if (paddr >= remap_base && paddr < remap_base + remap_top)
68 paddr -= remap_base;
69 return paddr;
70 diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
71 index c561038..b727450 100644
72 --- a/arch/x86/kernel/microcode_amd.c
73 +++ b/arch/x86/kernel/microcode_amd.c
74 @@ -298,13 +298,33 @@ free_table:
75 return state;
76 }
77
78 +/*
79 + * AMD microcode firmware naming convention, up to family 15h they are in
80 + * the legacy file:
81 + *
82 + * amd-ucode/microcode_amd.bin
83 + *
84 + * This legacy file is always smaller than 2K in size.
85 + *
86 + * Starting at family 15h they are in family specific firmware files:
87 + *
88 + * amd-ucode/microcode_amd_fam15h.bin
89 + * amd-ucode/microcode_amd_fam16h.bin
90 + * ...
91 + *
92 + * These might be larger than 2K.
93 + */
94 static enum ucode_state request_microcode_amd(int cpu, struct device *device)
95 {
96 - const char *fw_name = "amd-ucode/microcode_amd.bin";
97 + char fw_name[36] = "amd-ucode/microcode_amd.bin";
98 const struct firmware *fw;
99 enum ucode_state ret = UCODE_NFOUND;
100 + struct cpuinfo_x86 *c = &cpu_data(cpu);
101 +
102 + if (c->x86 >= 0x15)
103 + snprintf(fw_name, sizeof(fw_name), "amd-ucode/microcode_amd_fam%.2xh.bin", c->x86);
104
105 - if (request_firmware(&fw, fw_name, device)) {
106 + if (request_firmware(&fw, (const char *)fw_name, device)) {
107 pr_err("failed to load file %s\n", fw_name);
108 goto out;
109 }
110 diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
111 index 7b65f75..7c1b765 100644
112 --- a/arch/x86/net/bpf_jit_comp.c
113 +++ b/arch/x86/net/bpf_jit_comp.c
114 @@ -151,17 +151,18 @@ void bpf_jit_compile(struct sk_filter *fp)
115 cleanup_addr = proglen; /* epilogue address */
116
117 for (pass = 0; pass < 10; pass++) {
118 + u8 seen_or_pass0 = (pass == 0) ? (SEEN_XREG | SEEN_DATAREF | SEEN_MEM) : seen;
119 /* no prologue/epilogue for trivial filters (RET something) */
120 proglen = 0;
121 prog = temp;
122
123 - if (seen) {
124 + if (seen_or_pass0) {
125 EMIT4(0x55, 0x48, 0x89, 0xe5); /* push %rbp; mov %rsp,%rbp */
126 EMIT4(0x48, 0x83, 0xec, 96); /* subq $96,%rsp */
127 /* note : must save %rbx in case bpf_error is hit */
128 - if (seen & (SEEN_XREG | SEEN_DATAREF))
129 + if (seen_or_pass0 & (SEEN_XREG | SEEN_DATAREF))
130 EMIT4(0x48, 0x89, 0x5d, 0xf8); /* mov %rbx, -8(%rbp) */
131 - if (seen & SEEN_XREG)
132 + if (seen_or_pass0 & SEEN_XREG)
133 CLEAR_X(); /* make sure we dont leek kernel memory */
134
135 /*
136 @@ -170,7 +171,7 @@ void bpf_jit_compile(struct sk_filter *fp)
137 * r9 = skb->len - skb->data_len
138 * r8 = skb->data
139 */
140 - if (seen & SEEN_DATAREF) {
141 + if (seen_or_pass0 & SEEN_DATAREF) {
142 if (offsetof(struct sk_buff, len) <= 127)
143 /* mov off8(%rdi),%r9d */
144 EMIT4(0x44, 0x8b, 0x4f, offsetof(struct sk_buff, len));
145 @@ -260,9 +261,14 @@ void bpf_jit_compile(struct sk_filter *fp)
146 case BPF_S_ALU_DIV_X: /* A /= X; */
147 seen |= SEEN_XREG;
148 EMIT2(0x85, 0xdb); /* test %ebx,%ebx */
149 - if (pc_ret0 != -1)
150 - EMIT_COND_JMP(X86_JE, addrs[pc_ret0] - (addrs[i] - 4));
151 - else {
152 + if (pc_ret0 > 0) {
153 + /* addrs[pc_ret0 - 1] is start address of target
154 + * (addrs[i] - 4) is the address following this jmp
155 + * ("xor %edx,%edx; div %ebx" being 4 bytes long)
156 + */
157 + EMIT_COND_JMP(X86_JE, addrs[pc_ret0 - 1] -
158 + (addrs[i] - 4));
159 + } else {
160 EMIT_COND_JMP(X86_JNE, 2 + 5);
161 CLEAR_A();
162 EMIT1_off32(0xe9, cleanup_addr - (addrs[i] - 4)); /* jmp .+off32 */
163 @@ -335,12 +341,12 @@ void bpf_jit_compile(struct sk_filter *fp)
164 }
165 /* fallinto */
166 case BPF_S_RET_A:
167 - if (seen) {
168 + if (seen_or_pass0) {
169 if (i != flen - 1) {
170 EMIT_JMP(cleanup_addr - addrs[i]);
171 break;
172 }
173 - if (seen & SEEN_XREG)
174 + if (seen_or_pass0 & SEEN_XREG)
175 EMIT4(0x48, 0x8b, 0x5d, 0xf8); /* mov -8(%rbp),%rbx */
176 EMIT1(0xc9); /* leaveq */
177 }
178 @@ -483,8 +489,9 @@ common_load: seen |= SEEN_DATAREF;
179 goto common_load;
180 case BPF_S_LDX_B_MSH:
181 if ((int)K < 0) {
182 - if (pc_ret0 != -1) {
183 - EMIT_JMP(addrs[pc_ret0] - addrs[i]);
184 + if (pc_ret0 > 0) {
185 + /* addrs[pc_ret0 - 1] is the start address */
186 + EMIT_JMP(addrs[pc_ret0 - 1] - addrs[i]);
187 break;
188 }
189 CLEAR_A();
190 @@ -599,13 +606,14 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
191 * use it to give the cleanup instruction(s) addr
192 */
193 cleanup_addr = proglen - 1; /* ret */
194 - if (seen)
195 + if (seen_or_pass0)
196 cleanup_addr -= 1; /* leaveq */
197 - if (seen & SEEN_XREG)
198 + if (seen_or_pass0 & SEEN_XREG)
199 cleanup_addr -= 4; /* mov -8(%rbp),%rbx */
200
201 if (image) {
202 - WARN_ON(proglen != oldproglen);
203 + if (proglen != oldproglen)
204 + pr_err("bpb_jit_compile proglen=%u != oldproglen=%u\n", proglen, oldproglen);
205 break;
206 }
207 if (proglen == oldproglen) {
208 diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
209 index 9ed9f60..88f160b 100644
210 --- a/crypto/sha512_generic.c
211 +++ b/crypto/sha512_generic.c
212 @@ -21,8 +21,6 @@
213 #include <linux/percpu.h>
214 #include <asm/byteorder.h>
215
216 -static DEFINE_PER_CPU(u64[80], msg_schedule);
217 -
218 static inline u64 Ch(u64 x, u64 y, u64 z)
219 {
220 return z ^ (x & (y ^ z));
221 @@ -80,7 +78,7 @@ static inline void LOAD_OP(int I, u64 *W, const u8 *input)
222
223 static inline void BLEND_OP(int I, u64 *W)
224 {
225 - W[I] = s1(W[I-2]) + W[I-7] + s0(W[I-15]) + W[I-16];
226 + W[I % 16] += s1(W[(I-2) % 16]) + W[(I-7) % 16] + s0(W[(I-15) % 16]);
227 }
228
229 static void
230 @@ -89,38 +87,48 @@ sha512_transform(u64 *state, const u8 *input)
231 u64 a, b, c, d, e, f, g, h, t1, t2;
232
233 int i;
234 - u64 *W = get_cpu_var(msg_schedule);
235 + u64 W[16];
236
237 /* load the input */
238 for (i = 0; i < 16; i++)
239 LOAD_OP(i, W, input);
240
241 - for (i = 16; i < 80; i++) {
242 - BLEND_OP(i, W);
243 - }
244 -
245 /* load the state into our registers */
246 a=state[0]; b=state[1]; c=state[2]; d=state[3];
247 e=state[4]; f=state[5]; g=state[6]; h=state[7];
248
249 - /* now iterate */
250 - for (i=0; i<80; i+=8) {
251 - t1 = h + e1(e) + Ch(e,f,g) + sha512_K[i ] + W[i ];
252 - t2 = e0(a) + Maj(a,b,c); d+=t1; h=t1+t2;
253 - t1 = g + e1(d) + Ch(d,e,f) + sha512_K[i+1] + W[i+1];
254 - t2 = e0(h) + Maj(h,a,b); c+=t1; g=t1+t2;
255 - t1 = f + e1(c) + Ch(c,d,e) + sha512_K[i+2] + W[i+2];
256 - t2 = e0(g) + Maj(g,h,a); b+=t1; f=t1+t2;
257 - t1 = e + e1(b) + Ch(b,c,d) + sha512_K[i+3] + W[i+3];
258 - t2 = e0(f) + Maj(f,g,h); a+=t1; e=t1+t2;
259 - t1 = d + e1(a) + Ch(a,b,c) + sha512_K[i+4] + W[i+4];
260 - t2 = e0(e) + Maj(e,f,g); h+=t1; d=t1+t2;
261 - t1 = c + e1(h) + Ch(h,a,b) + sha512_K[i+5] + W[i+5];
262 - t2 = e0(d) + Maj(d,e,f); g+=t1; c=t1+t2;
263 - t1 = b + e1(g) + Ch(g,h,a) + sha512_K[i+6] + W[i+6];
264 - t2 = e0(c) + Maj(c,d,e); f+=t1; b=t1+t2;
265 - t1 = a + e1(f) + Ch(f,g,h) + sha512_K[i+7] + W[i+7];
266 - t2 = e0(b) + Maj(b,c,d); e+=t1; a=t1+t2;
267 +#define SHA512_0_15(i, a, b, c, d, e, f, g, h) \
268 + t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[i]; \
269 + t2 = e0(a) + Maj(a, b, c); \
270 + d += t1; \
271 + h = t1 + t2
272 +
273 +#define SHA512_16_79(i, a, b, c, d, e, f, g, h) \
274 + BLEND_OP(i, W); \
275 + t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)%16]; \
276 + t2 = e0(a) + Maj(a, b, c); \
277 + d += t1; \
278 + h = t1 + t2
279 +
280 + for (i = 0; i < 16; i += 8) {
281 + SHA512_0_15(i, a, b, c, d, e, f, g, h);
282 + SHA512_0_15(i + 1, h, a, b, c, d, e, f, g);
283 + SHA512_0_15(i + 2, g, h, a, b, c, d, e, f);
284 + SHA512_0_15(i + 3, f, g, h, a, b, c, d, e);
285 + SHA512_0_15(i + 4, e, f, g, h, a, b, c, d);
286 + SHA512_0_15(i + 5, d, e, f, g, h, a, b, c);
287 + SHA512_0_15(i + 6, c, d, e, f, g, h, a, b);
288 + SHA512_0_15(i + 7, b, c, d, e, f, g, h, a);
289 + }
290 + for (i = 16; i < 80; i += 8) {
291 + SHA512_16_79(i, a, b, c, d, e, f, g, h);
292 + SHA512_16_79(i + 1, h, a, b, c, d, e, f, g);
293 + SHA512_16_79(i + 2, g, h, a, b, c, d, e, f);
294 + SHA512_16_79(i + 3, f, g, h, a, b, c, d, e);
295 + SHA512_16_79(i + 4, e, f, g, h, a, b, c, d);
296 + SHA512_16_79(i + 5, d, e, f, g, h, a, b, c);
297 + SHA512_16_79(i + 6, c, d, e, f, g, h, a, b);
298 + SHA512_16_79(i + 7, b, c, d, e, f, g, h, a);
299 }
300
301 state[0] += a; state[1] += b; state[2] += c; state[3] += d;
302 @@ -128,8 +136,6 @@ sha512_transform(u64 *state, const u8 *input)
303
304 /* erase our data */
305 a = b = c = d = e = f = g = h = t1 = t2 = 0;
306 - memset(W, 0, sizeof(__get_cpu_var(msg_schedule)));
307 - put_cpu_var(msg_schedule);
308 }
309
310 static int
311 diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c
312 index 3f46772..ba23790 100644
313 --- a/drivers/gpu/drm/drm_auth.c
314 +++ b/drivers/gpu/drm/drm_auth.c
315 @@ -101,7 +101,7 @@ static int drm_add_magic(struct drm_master *master, struct drm_file *priv,
316 * Searches and unlinks the entry in drm_device::magiclist with the magic
317 * number hash key, while holding the drm_device::struct_mutex lock.
318 */
319 -static int drm_remove_magic(struct drm_master *master, drm_magic_t magic)
320 +int drm_remove_magic(struct drm_master *master, drm_magic_t magic)
321 {
322 struct drm_magic_entry *pt;
323 struct drm_hash_item *hash;
324 @@ -136,6 +136,8 @@ static int drm_remove_magic(struct drm_master *master, drm_magic_t magic)
325 * If there is a magic number in drm_file::magic then use it, otherwise
326 * searches an unique non-zero magic number and add it associating it with \p
327 * file_priv.
328 + * This ioctl needs protection by the drm_global_mutex, which protects
329 + * struct drm_file::magic and struct drm_magic_entry::priv.
330 */
331 int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv)
332 {
333 @@ -173,6 +175,8 @@ int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv)
334 * \return zero if authentication successed, or a negative number otherwise.
335 *
336 * Checks if \p file_priv is associated with the magic number passed in \arg.
337 + * This ioctl needs protection by the drm_global_mutex, which protects
338 + * struct drm_file::magic and struct drm_magic_entry::priv.
339 */
340 int drm_authmagic(struct drm_device *dev, void *data,
341 struct drm_file *file_priv)
342 diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
343 index 2ec7d48..c42e12c 100644
344 --- a/drivers/gpu/drm/drm_fops.c
345 +++ b/drivers/gpu/drm/drm_fops.c
346 @@ -486,6 +486,11 @@ int drm_release(struct inode *inode, struct file *filp)
347 (long)old_encode_dev(file_priv->minor->device),
348 dev->open_count);
349
350 + /* Release any auth tokens that might point to this file_priv,
351 + (do that under the drm_global_mutex) */
352 + if (file_priv->magic)
353 + (void) drm_remove_magic(file_priv->master, file_priv->magic);
354 +
355 /* if the master has gone away we can't do anything with the lock */
356 if (file_priv->minor->master)
357 drm_master_release(dev, filp);
358 diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
359 index 30fe554..bdda08e 100644
360 --- a/drivers/gpu/drm/i915/intel_sdvo.c
361 +++ b/drivers/gpu/drm/i915/intel_sdvo.c
362 @@ -1059,15 +1059,13 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
363
364 /* Set the SDVO control regs. */
365 if (INTEL_INFO(dev)->gen >= 4) {
366 - sdvox = 0;
367 + /* The real mode polarity is set by the SDVO commands, using
368 + * struct intel_sdvo_dtd. */
369 + sdvox = SDVO_VSYNC_ACTIVE_HIGH | SDVO_HSYNC_ACTIVE_HIGH;
370 if (intel_sdvo->is_hdmi)
371 sdvox |= intel_sdvo->color_range;
372 if (INTEL_INFO(dev)->gen < 5)
373 sdvox |= SDVO_BORDER_ENABLE;
374 - if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
375 - sdvox |= SDVO_VSYNC_ACTIVE_HIGH;
376 - if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
377 - sdvox |= SDVO_HSYNC_ACTIVE_HIGH;
378 } else {
379 sdvox = I915_READ(intel_sdvo->sdvo_reg);
380 switch (intel_sdvo->sdvo_reg) {
381 diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c
382 index fecc1aa..5feb6e9 100644
383 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
384 +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
385 @@ -134,6 +134,12 @@ static bool radeon_msi_ok(struct radeon_device *rdev)
386 /* Dell RS690 only seems to work with MSIs. */
387 if ((rdev->pdev->device == 0x791f) &&
388 (rdev->pdev->subsystem_vendor == 0x1028) &&
389 + (rdev->pdev->subsystem_device == 0x01fc))
390 + return true;
391 +
392 + /* Dell RS690 only seems to work with MSIs. */
393 + if ((rdev->pdev->device == 0x791f) &&
394 + (rdev->pdev->subsystem_vendor == 0x1028) &&
395 (rdev->pdev->subsystem_device == 0x01fd))
396 return true;
397
398 diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
399 index dfe32e6..8a38c91 100644
400 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
401 +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
402 @@ -313,7 +313,7 @@ int vmw_framebuffer_create_handle(struct drm_framebuffer *fb,
403 unsigned int *handle)
404 {
405 if (handle)
406 - handle = 0;
407 + *handle = 0;
408
409 return 0;
410 }
411 diff --git a/drivers/hwmon/f71805f.c b/drivers/hwmon/f71805f.c
412 index 92f9497..6dbfd3e 100644
413 --- a/drivers/hwmon/f71805f.c
414 +++ b/drivers/hwmon/f71805f.c
415 @@ -283,11 +283,11 @@ static inline long temp_from_reg(u8 reg)
416
417 static inline u8 temp_to_reg(long val)
418 {
419 - if (val < 0)
420 - val = 0;
421 - else if (val > 1000 * 0xff)
422 - val = 0xff;
423 - return ((val + 500) / 1000);
424 + if (val <= 0)
425 + return 0;
426 + if (val >= 1000 * 0xff)
427 + return 0xff;
428 + return (val + 500) / 1000;
429 }
430
431 /*
432 diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
433 index cf4330b..9594cdb 100644
434 --- a/drivers/hwmon/sht15.c
435 +++ b/drivers/hwmon/sht15.c
436 @@ -883,7 +883,7 @@ static int sht15_invalidate_voltage(struct notifier_block *nb,
437
438 static int __devinit sht15_probe(struct platform_device *pdev)
439 {
440 - int ret = 0;
441 + int ret;
442 struct sht15_data *data = kzalloc(sizeof(*data), GFP_KERNEL);
443 u8 status = 0;
444
445 @@ -901,6 +901,7 @@ static int __devinit sht15_probe(struct platform_device *pdev)
446 init_waitqueue_head(&data->wait_queue);
447
448 if (pdev->dev.platform_data == NULL) {
449 + ret = -EINVAL;
450 dev_err(&pdev->dev, "no platform data supplied\n");
451 goto err_free_data;
452 }
453 diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
454 index 4b2fc50..6284515 100644
455 --- a/drivers/hwmon/w83627ehf.c
456 +++ b/drivers/hwmon/w83627ehf.c
457 @@ -1295,6 +1295,7 @@ store_pwm_mode(struct device *dev, struct device_attribute *attr,
458 {
459 struct w83627ehf_data *data = dev_get_drvdata(dev);
460 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
461 + struct w83627ehf_sio_data *sio_data = dev->platform_data;
462 int nr = sensor_attr->index;
463 unsigned long val;
464 int err;
465 @@ -1306,6 +1307,11 @@ store_pwm_mode(struct device *dev, struct device_attribute *attr,
466
467 if (val > 1)
468 return -EINVAL;
469 +
470 + /* On NCT67766F, DC mode is only supported for pwm1 */
471 + if (sio_data->kind == nct6776 && nr && val != 1)
472 + return -EINVAL;
473 +
474 mutex_lock(&data->update_lock);
475 reg = w83627ehf_read_value(data, W83627EHF_REG_PWM_ENABLE[nr]);
476 data->pwm_mode[nr] = val;
477 diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
478 index 2df9276..5e725e0 100644
479 --- a/drivers/net/bonding/bond_alb.c
480 +++ b/drivers/net/bonding/bond_alb.c
481 @@ -871,16 +871,12 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
482 }
483 }
484
485 -/* hw is a boolean parameter that determines whether we should try and
486 - * set the hw address of the device as well as the hw address of the
487 - * net_device
488 - */
489 -static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw)
490 +static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[])
491 {
492 struct net_device *dev = slave->dev;
493 struct sockaddr s_addr;
494
495 - if (!hw) {
496 + if (slave->bond->params.mode == BOND_MODE_TLB) {
497 memcpy(dev->dev_addr, addr, dev->addr_len);
498 return 0;
499 }
500 @@ -910,8 +906,8 @@ static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct
501 u8 tmp_mac_addr[ETH_ALEN];
502
503 memcpy(tmp_mac_addr, slave1->dev->dev_addr, ETH_ALEN);
504 - alb_set_slave_mac_addr(slave1, slave2->dev->dev_addr, bond->alb_info.rlb_enabled);
505 - alb_set_slave_mac_addr(slave2, tmp_mac_addr, bond->alb_info.rlb_enabled);
506 + alb_set_slave_mac_addr(slave1, slave2->dev->dev_addr);
507 + alb_set_slave_mac_addr(slave2, tmp_mac_addr);
508
509 }
510
511 @@ -1058,8 +1054,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
512
513 /* Try setting slave mac to bond address and fall-through
514 to code handling that situation below... */
515 - alb_set_slave_mac_addr(slave, bond->dev->dev_addr,
516 - bond->alb_info.rlb_enabled);
517 + alb_set_slave_mac_addr(slave, bond->dev->dev_addr);
518 }
519
520 /* The slave's address is equal to the address of the bond.
521 @@ -1095,8 +1090,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
522 }
523
524 if (free_mac_slave) {
525 - alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr,
526 - bond->alb_info.rlb_enabled);
527 + alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr);
528
529 pr_warning("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n",
530 bond->dev->name, slave->dev->name,
531 @@ -1452,8 +1446,7 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave)
532 {
533 int res;
534
535 - res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr,
536 - bond->alb_info.rlb_enabled);
537 + res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr);
538 if (res) {
539 return res;
540 }
541 @@ -1604,8 +1597,7 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
542 alb_swap_mac_addr(bond, swap_slave, new_slave);
543 } else {
544 /* set the new_slave to the bond mac address */
545 - alb_set_slave_mac_addr(new_slave, bond->dev->dev_addr,
546 - bond->alb_info.rlb_enabled);
547 + alb_set_slave_mac_addr(new_slave, bond->dev->dev_addr);
548 }
549
550 if (swap_slave) {
551 @@ -1665,8 +1657,7 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
552 alb_swap_mac_addr(bond, swap_slave, bond->curr_active_slave);
553 alb_fasten_mac_swap(bond, swap_slave, bond->curr_active_slave);
554 } else {
555 - alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr,
556 - bond->alb_info.rlb_enabled);
557 + alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr);
558
559 read_lock(&bond->lock);
560 alb_send_learning_packets(bond->curr_active_slave, bond_dev->dev_addr);
561 diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
562 index f5f6831..4a4733e 100644
563 --- a/drivers/tty/serial/amba-pl011.c
564 +++ b/drivers/tty/serial/amba-pl011.c
565 @@ -1733,9 +1733,19 @@ pl011_console_write(struct console *co, const char *s, unsigned int count)
566 {
567 struct uart_amba_port *uap = amba_ports[co->index];
568 unsigned int status, old_cr, new_cr;
569 + unsigned long flags;
570 + int locked = 1;
571
572 clk_enable(uap->clk);
573
574 + local_irq_save(flags);
575 + if (uap->port.sysrq)
576 + locked = 0;
577 + else if (oops_in_progress)
578 + locked = spin_trylock(&uap->port.lock);
579 + else
580 + spin_lock(&uap->port.lock);
581 +
582 /*
583 * First save the CR then disable the interrupts
584 */
585 @@ -1755,6 +1765,10 @@ pl011_console_write(struct console *co, const char *s, unsigned int count)
586 } while (status & UART01x_FR_BUSY);
587 writew(old_cr, uap->port.membase + UART011_CR);
588
589 + if (locked)
590 + spin_unlock(&uap->port.lock);
591 + local_irq_restore(flags);
592 +
593 clk_disable(uap->clk);
594 }
595
596 diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c
597 index 2aaafa9..6c12d94 100644
598 --- a/drivers/tty/serial/jsm/jsm_driver.c
599 +++ b/drivers/tty/serial/jsm/jsm_driver.c
600 @@ -269,6 +269,7 @@ static void jsm_io_resume(struct pci_dev *pdev)
601 struct jsm_board *brd = pci_get_drvdata(pdev);
602
603 pci_restore_state(pdev);
604 + pci_save_state(pdev);
605
606 jsm_uart_port_init(brd);
607 }
608 diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
609 index 33d37d2..a4aaca0 100644
610 --- a/drivers/tty/tty_port.c
611 +++ b/drivers/tty/tty_port.c
612 @@ -227,7 +227,6 @@ int tty_port_block_til_ready(struct tty_port *port,
613 int do_clocal = 0, retval;
614 unsigned long flags;
615 DEFINE_WAIT(wait);
616 - int cd;
617
618 /* block if port is in the process of being closed */
619 if (tty_hung_up_p(filp) || port->flags & ASYNC_CLOSING) {
620 @@ -284,11 +283,14 @@ int tty_port_block_til_ready(struct tty_port *port,
621 retval = -ERESTARTSYS;
622 break;
623 }
624 - /* Probe the carrier. For devices with no carrier detect this
625 - will always return true */
626 - cd = tty_port_carrier_raised(port);
627 + /*
628 + * Probe the carrier. For devices with no carrier detect
629 + * tty_port_carrier_raised will always return true.
630 + * Never ask drivers if CLOCAL is set, this causes troubles
631 + * on some hardware.
632 + */
633 if (!(port->flags & ASYNC_CLOSING) &&
634 - (do_clocal || cd))
635 + (do_clocal || tty_port_carrier_raised(port)))
636 break;
637 if (signal_pending(current)) {
638 retval = -ERESTARTSYS;
639 diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
640 index 2b9ff51..90581a8 100644
641 --- a/drivers/usb/class/cdc-wdm.c
642 +++ b/drivers/usb/class/cdc-wdm.c
643 @@ -57,6 +57,8 @@ MODULE_DEVICE_TABLE (usb, wdm_ids);
644
645 #define WDM_MAX 16
646
647 +/* CDC-WMC r1.1 requires wMaxCommand to be "at least 256 decimal (0x100)" */
648 +#define WDM_DEFAULT_BUFSIZE 256
649
650 static DEFINE_MUTEX(wdm_mutex);
651
652 @@ -88,7 +90,8 @@ struct wdm_device {
653 int count;
654 dma_addr_t shandle;
655 dma_addr_t ihandle;
656 - struct mutex lock;
657 + struct mutex wlock;
658 + struct mutex rlock;
659 wait_queue_head_t wait;
660 struct work_struct rxwork;
661 int werr;
662 @@ -323,7 +326,7 @@ static ssize_t wdm_write
663 }
664
665 /* concurrent writes and disconnect */
666 - r = mutex_lock_interruptible(&desc->lock);
667 + r = mutex_lock_interruptible(&desc->wlock);
668 rv = -ERESTARTSYS;
669 if (r) {
670 kfree(buf);
671 @@ -386,7 +389,7 @@ static ssize_t wdm_write
672 out:
673 usb_autopm_put_interface(desc->intf);
674 outnp:
675 - mutex_unlock(&desc->lock);
676 + mutex_unlock(&desc->wlock);
677 outnl:
678 return rv < 0 ? rv : count;
679 }
680 @@ -399,7 +402,7 @@ static ssize_t wdm_read
681 struct wdm_device *desc = file->private_data;
682
683
684 - rv = mutex_lock_interruptible(&desc->lock); /*concurrent reads */
685 + rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */
686 if (rv < 0)
687 return -ERESTARTSYS;
688
689 @@ -467,14 +470,16 @@ retry:
690 for (i = 0; i < desc->length - cntr; i++)
691 desc->ubuf[i] = desc->ubuf[i + cntr];
692
693 + spin_lock_irq(&desc->iuspin);
694 desc->length -= cntr;
695 + spin_unlock_irq(&desc->iuspin);
696 /* in case we had outstanding data */
697 if (!desc->length)
698 clear_bit(WDM_READ, &desc->flags);
699 rv = cntr;
700
701 err:
702 - mutex_unlock(&desc->lock);
703 + mutex_unlock(&desc->rlock);
704 return rv;
705 }
706
707 @@ -540,7 +545,8 @@ static int wdm_open(struct inode *inode, struct file *file)
708 }
709 intf->needs_remote_wakeup = 1;
710
711 - mutex_lock(&desc->lock);
712 + /* using write lock to protect desc->count */
713 + mutex_lock(&desc->wlock);
714 if (!desc->count++) {
715 desc->werr = 0;
716 desc->rerr = 0;
717 @@ -553,7 +559,7 @@ static int wdm_open(struct inode *inode, struct file *file)
718 } else {
719 rv = 0;
720 }
721 - mutex_unlock(&desc->lock);
722 + mutex_unlock(&desc->wlock);
723 usb_autopm_put_interface(desc->intf);
724 out:
725 mutex_unlock(&wdm_mutex);
726 @@ -565,9 +571,11 @@ static int wdm_release(struct inode *inode, struct file *file)
727 struct wdm_device *desc = file->private_data;
728
729 mutex_lock(&wdm_mutex);
730 - mutex_lock(&desc->lock);
731 +
732 + /* using write lock to protect desc->count */
733 + mutex_lock(&desc->wlock);
734 desc->count--;
735 - mutex_unlock(&desc->lock);
736 + mutex_unlock(&desc->wlock);
737
738 if (!desc->count) {
739 dev_dbg(&desc->intf->dev, "wdm_release: cleanup");
740 @@ -630,7 +638,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
741 struct usb_cdc_dmm_desc *dmhd;
742 u8 *buffer = intf->altsetting->extra;
743 int buflen = intf->altsetting->extralen;
744 - u16 maxcom = 0;
745 + u16 maxcom = WDM_DEFAULT_BUFSIZE;
746
747 if (!buffer)
748 goto out;
749 @@ -665,7 +673,8 @@ next_desc:
750 desc = kzalloc(sizeof(struct wdm_device), GFP_KERNEL);
751 if (!desc)
752 goto out;
753 - mutex_init(&desc->lock);
754 + mutex_init(&desc->rlock);
755 + mutex_init(&desc->wlock);
756 spin_lock_init(&desc->iuspin);
757 init_waitqueue_head(&desc->wait);
758 desc->wMaxCommand = maxcom;
759 @@ -716,7 +725,7 @@ next_desc:
760 goto err;
761
762 desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf),
763 - desc->bMaxPacketSize0,
764 + desc->wMaxCommand,
765 GFP_KERNEL,
766 &desc->response->transfer_dma);
767 if (!desc->inbuf)
768 @@ -779,11 +788,13 @@ static void wdm_disconnect(struct usb_interface *intf)
769 /* to terminate pending flushes */
770 clear_bit(WDM_IN_USE, &desc->flags);
771 spin_unlock_irqrestore(&desc->iuspin, flags);
772 - mutex_lock(&desc->lock);
773 + wake_up_all(&desc->wait);
774 + mutex_lock(&desc->rlock);
775 + mutex_lock(&desc->wlock);
776 kill_urbs(desc);
777 cancel_work_sync(&desc->rxwork);
778 - mutex_unlock(&desc->lock);
779 - wake_up_all(&desc->wait);
780 + mutex_unlock(&desc->wlock);
781 + mutex_unlock(&desc->rlock);
782 if (!desc->count)
783 cleanup(desc);
784 mutex_unlock(&wdm_mutex);
785 @@ -798,8 +809,10 @@ static int wdm_suspend(struct usb_interface *intf, pm_message_t message)
786 dev_dbg(&desc->intf->dev, "wdm%d_suspend\n", intf->minor);
787
788 /* if this is an autosuspend the caller does the locking */
789 - if (!(message.event & PM_EVENT_AUTO))
790 - mutex_lock(&desc->lock);
791 + if (!(message.event & PM_EVENT_AUTO)) {
792 + mutex_lock(&desc->rlock);
793 + mutex_lock(&desc->wlock);
794 + }
795 spin_lock_irq(&desc->iuspin);
796
797 if ((message.event & PM_EVENT_AUTO) &&
798 @@ -815,8 +828,10 @@ static int wdm_suspend(struct usb_interface *intf, pm_message_t message)
799 kill_urbs(desc);
800 cancel_work_sync(&desc->rxwork);
801 }
802 - if (!(message.event & PM_EVENT_AUTO))
803 - mutex_unlock(&desc->lock);
804 + if (!(message.event & PM_EVENT_AUTO)) {
805 + mutex_unlock(&desc->wlock);
806 + mutex_unlock(&desc->rlock);
807 + }
808
809 return rv;
810 }
811 @@ -854,7 +869,8 @@ static int wdm_pre_reset(struct usb_interface *intf)
812 {
813 struct wdm_device *desc = usb_get_intfdata(intf);
814
815 - mutex_lock(&desc->lock);
816 + mutex_lock(&desc->rlock);
817 + mutex_lock(&desc->wlock);
818 kill_urbs(desc);
819
820 /*
821 @@ -876,7 +892,8 @@ static int wdm_post_reset(struct usb_interface *intf)
822 int rv;
823
824 rv = recover_from_urb_loss(desc);
825 - mutex_unlock(&desc->lock);
826 + mutex_unlock(&desc->wlock);
827 + mutex_unlock(&desc->rlock);
828 return 0;
829 }
830
831 diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
832 index f380bf9..bc7f166 100644
833 --- a/drivers/usb/host/ehci-fsl.c
834 +++ b/drivers/usb/host/ehci-fsl.c
835 @@ -125,7 +125,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
836 */
837 if (pdata->init && pdata->init(pdev)) {
838 retval = -ENODEV;
839 - goto err3;
840 + goto err4;
841 }
842
843 /* Enable USB controller, 83xx or 8536 */
844 diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
845 index c0c5d6c..edcedc4 100644
846 --- a/drivers/usb/host/xhci-ring.c
847 +++ b/drivers/usb/host/xhci-ring.c
848 @@ -1218,6 +1218,7 @@ static void handle_vendor_event(struct xhci_hcd *xhci,
849 *
850 * Returns a zero-based port number, which is suitable for indexing into each of
851 * the split roothubs' port arrays and bus state arrays.
852 + * Add one to it in order to call xhci_find_slot_id_by_port.
853 */
854 static unsigned int find_faked_portnum_from_hw_portnum(struct usb_hcd *hcd,
855 struct xhci_hcd *xhci, u32 port_id)
856 @@ -1340,7 +1341,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
857 temp |= PORT_LINK_STROBE | XDEV_U0;
858 xhci_writel(xhci, temp, port_array[faked_port_index]);
859 slot_id = xhci_find_slot_id_by_port(hcd, xhci,
860 - faked_port_index);
861 + faked_port_index + 1);
862 if (!slot_id) {
863 xhci_dbg(xhci, "slot_id is zero\n");
864 goto cleanup;
865 @@ -3381,7 +3382,8 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
866 /* Check TD length */
867 if (running_total != td_len) {
868 xhci_err(xhci, "ISOC TD length unmatch\n");
869 - return -EINVAL;
870 + ret = -EINVAL;
871 + goto cleanup;
872 }
873 }
874
875 diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c
876 index 417b8f2..59689fa 100644
877 --- a/drivers/usb/misc/usbsevseg.c
878 +++ b/drivers/usb/misc/usbsevseg.c
879 @@ -24,7 +24,7 @@
880
881 #define VENDOR_ID 0x0fc5
882 #define PRODUCT_ID 0x1227
883 -#define MAXLEN 6
884 +#define MAXLEN 8
885
886 /* table of devices that work with this driver */
887 static const struct usb_device_id id_table[] = {
888 diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
889 index a1a324b..a515237 100644
890 --- a/drivers/usb/serial/cp210x.c
891 +++ b/drivers/usb/serial/cp210x.c
892 @@ -39,6 +39,8 @@ static void cp210x_get_termios(struct tty_struct *,
893 struct usb_serial_port *port);
894 static void cp210x_get_termios_port(struct usb_serial_port *port,
895 unsigned int *cflagp, unsigned int *baudp);
896 +static void cp210x_change_speed(struct tty_struct *, struct usb_serial_port *,
897 + struct ktermios *);
898 static void cp210x_set_termios(struct tty_struct *, struct usb_serial_port *,
899 struct ktermios*);
900 static int cp210x_tiocmget(struct tty_struct *);
901 @@ -138,6 +140,7 @@ static const struct usb_device_id id_table[] = {
902 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
903 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
904 { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
905 + { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */
906 { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
907 { } /* Terminating Entry */
908 };
909 @@ -201,6 +204,8 @@ static struct usb_serial_driver cp210x_device = {
910 #define CP210X_EMBED_EVENTS 0x15
911 #define CP210X_GET_EVENTSTATE 0x16
912 #define CP210X_SET_CHARS 0x19
913 +#define CP210X_GET_BAUDRATE 0x1D
914 +#define CP210X_SET_BAUDRATE 0x1E
915
916 /* CP210X_IFC_ENABLE */
917 #define UART_ENABLE 0x0001
918 @@ -354,8 +359,8 @@ static inline int cp210x_set_config_single(struct usb_serial_port *port,
919 * Quantises the baud rate as per AN205 Table 1
920 */
921 static unsigned int cp210x_quantise_baudrate(unsigned int baud) {
922 - if (baud <= 56) baud = 0;
923 - else if (baud <= 300) baud = 300;
924 + if (baud <= 300)
925 + baud = 300;
926 else if (baud <= 600) baud = 600;
927 else if (baud <= 1200) baud = 1200;
928 else if (baud <= 1800) baud = 1800;
929 @@ -383,17 +388,15 @@ static unsigned int cp210x_quantise_baudrate(unsigned int baud) {
930 else if (baud <= 491520) baud = 460800;
931 else if (baud <= 567138) baud = 500000;
932 else if (baud <= 670254) baud = 576000;
933 - else if (baud <= 1053257) baud = 921600;
934 - else if (baud <= 1474560) baud = 1228800;
935 - else if (baud <= 2457600) baud = 1843200;
936 - else baud = 3686400;
937 + else if (baud < 1000000)
938 + baud = 921600;
939 + else if (baud > 2000000)
940 + baud = 2000000;
941 return baud;
942 }
943
944 static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
945 {
946 - int result;
947 -
948 dbg("%s - port %d", __func__, port->number);
949
950 if (cp210x_set_config_single(port, CP210X_IFC_ENABLE, UART_ENABLE)) {
951 @@ -402,13 +405,14 @@ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
952 return -EPROTO;
953 }
954
955 - result = usb_serial_generic_open(tty, port);
956 - if (result)
957 - return result;
958 -
959 /* Configure the termios structure */
960 cp210x_get_termios(tty, port);
961 - return 0;
962 +
963 + /* The baud rate must be initialised on cp2104 */
964 + if (tty)
965 + cp210x_change_speed(tty, port, NULL);
966 +
967 + return usb_serial_generic_open(tty, port);
968 }
969
970 static void cp210x_close(struct usb_serial_port *port)
971 @@ -460,10 +464,7 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
972
973 dbg("%s - port %d", __func__, port->number);
974
975 - cp210x_get_config(port, CP210X_GET_BAUDDIV, &baud, 2);
976 - /* Convert to baudrate */
977 - if (baud)
978 - baud = cp210x_quantise_baudrate((BAUD_RATE_GEN_FREQ + baud/2)/ baud);
979 + cp210x_get_config(port, CP210X_GET_BAUDRATE, &baud, 4);
980
981 dbg("%s - baud rate = %d", __func__, baud);
982 *baudp = baud;
983 @@ -577,11 +578,64 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
984 *cflagp = cflag;
985 }
986
987 +/*
988 + * CP2101 supports the following baud rates:
989 + *
990 + * 300, 600, 1200, 1800, 2400, 4800, 7200, 9600, 14400, 19200, 28800,
991 + * 38400, 56000, 57600, 115200, 128000, 230400, 460800, 921600
992 + *
993 + * CP2102 and CP2103 support the following additional rates:
994 + *
995 + * 4000, 16000, 51200, 64000, 76800, 153600, 250000, 256000, 500000,
996 + * 576000
997 + *
998 + * The device will map a requested rate to a supported one, but the result
999 + * of requests for rates greater than 1053257 is undefined (see AN205).
1000 + *
1001 + * CP2104, CP2105 and CP2110 support most rates up to 2M, 921k and 1M baud,
1002 + * respectively, with an error less than 1%. The actual rates are determined
1003 + * by
1004 + *
1005 + * div = round(freq / (2 x prescale x request))
1006 + * actual = freq / (2 x prescale x div)
1007 + *
1008 + * For CP2104 and CP2105 freq is 48Mhz and prescale is 4 for request <= 365bps
1009 + * or 1 otherwise.
1010 + * For CP2110 freq is 24Mhz and prescale is 4 for request <= 300bps or 1
1011 + * otherwise.
1012 + */
1013 +static void cp210x_change_speed(struct tty_struct *tty,
1014 + struct usb_serial_port *port, struct ktermios *old_termios)
1015 +{
1016 + u32 baud;
1017 +
1018 + baud = tty->termios->c_ospeed;
1019 +
1020 + /* This maps the requested rate to a rate valid on cp2102 or cp2103,
1021 + * or to an arbitrary rate in [1M,2M].
1022 + *
1023 + * NOTE: B0 is not implemented.
1024 + */
1025 + baud = cp210x_quantise_baudrate(baud);
1026 +
1027 + dbg("%s - setting baud rate to %u", __func__, baud);
1028 + if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud,
1029 + sizeof(baud))) {
1030 + dev_warn(&port->dev, "failed to set baud rate to %u\n", baud);
1031 + if (old_termios)
1032 + baud = old_termios->c_ospeed;
1033 + else
1034 + baud = 9600;
1035 + }
1036 +
1037 + tty_encode_baud_rate(tty, baud, baud);
1038 +}
1039 +
1040 static void cp210x_set_termios(struct tty_struct *tty,
1041 struct usb_serial_port *port, struct ktermios *old_termios)
1042 {
1043 unsigned int cflag, old_cflag;
1044 - unsigned int baud = 0, bits;
1045 + unsigned int bits;
1046 unsigned int modem_ctl[4];
1047
1048 dbg("%s - port %d", __func__, port->number);
1049 @@ -592,20 +646,9 @@ static void cp210x_set_termios(struct tty_struct *tty,
1050 tty->termios->c_cflag &= ~CMSPAR;
1051 cflag = tty->termios->c_cflag;
1052 old_cflag = old_termios->c_cflag;
1053 - baud = cp210x_quantise_baudrate(tty_get_baud_rate(tty));
1054 -
1055 - /* If the baud rate is to be updated*/
1056 - if (baud != tty_termios_baud_rate(old_termios) && baud != 0) {
1057 - dbg("%s - Setting baud rate to %d baud", __func__,
1058 - baud);
1059 - if (cp210x_set_config_single(port, CP210X_SET_BAUDDIV,
1060 - ((BAUD_RATE_GEN_FREQ + baud/2) / baud))) {
1061 - dbg("Baud rate requested not supported by device");
1062 - baud = tty_termios_baud_rate(old_termios);
1063 - }
1064 - }
1065 - /* Report back the resulting baud rate */
1066 - tty_encode_baud_rate(tty, baud, baud);
1067 +
1068 + if (tty->termios->c_ospeed != old_termios->c_ospeed)
1069 + cp210x_change_speed(tty, port, old_termios);
1070
1071 /* If the number of data bits is to be updated */
1072 if ((cflag & CSIZE) != (old_cflag & CSIZE)) {
1073 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1074 index b02fd50..a872cc2 100644
1075 --- a/drivers/usb/serial/ftdi_sio.c
1076 +++ b/drivers/usb/serial/ftdi_sio.c
1077 @@ -796,6 +796,7 @@ static struct usb_device_id id_table_combined [] = {
1078 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1079 { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID),
1080 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1081 + { USB_DEVICE(HORNBY_VID, HORNBY_ELITE_PID) },
1082 { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) },
1083 { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID),
1084 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1085 @@ -804,6 +805,8 @@ static struct usb_device_id id_table_combined [] = {
1086 { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) },
1087 { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID),
1088 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1089 + { USB_DEVICE(FTDI_VID, TI_XDS100V2_PID),
1090 + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1091 { USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) },
1092 { USB_DEVICE(FTDI_VID, HAMEG_HO720_PID) },
1093 { USB_DEVICE(FTDI_VID, HAMEG_HO730_PID) },
1094 @@ -840,6 +843,7 @@ static struct usb_device_id id_table_combined [] = {
1095 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1096 { USB_DEVICE(ST_VID, ST_STMCLT1030_PID),
1097 .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk },
1098 + { USB_DEVICE(FTDI_VID, FTDI_RF_R106) },
1099 { }, /* Optional parameter entry */
1100 { } /* Terminating entry */
1101 };
1102 @@ -1326,8 +1330,7 @@ static int set_serial_info(struct tty_struct *tty,
1103 goto check_and_exit;
1104 }
1105
1106 - if ((new_serial.baud_base != priv->baud_base) &&
1107 - (new_serial.baud_base < 9600)) {
1108 + if (new_serial.baud_base != priv->baud_base) {
1109 mutex_unlock(&priv->cfg_lock);
1110 return -EINVAL;
1111 }
1112 @@ -1816,6 +1819,7 @@ static int ftdi_sio_port_remove(struct usb_serial_port *port)
1113
1114 static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
1115 {
1116 + struct ktermios dummy;
1117 struct usb_device *dev = port->serial->dev;
1118 struct ftdi_private *priv = usb_get_serial_port_data(port);
1119 int result;
1120 @@ -1834,8 +1838,10 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
1121 This is same behaviour as serial.c/rs_open() - Kuba */
1122
1123 /* ftdi_set_termios will send usb control messages */
1124 - if (tty)
1125 - ftdi_set_termios(tty, port, tty->termios);
1126 + if (tty) {
1127 + memset(&dummy, 0, sizeof(dummy));
1128 + ftdi_set_termios(tty, port, &dummy);
1129 + }
1130
1131 /* Start reading from the device */
1132 result = usb_serial_generic_open(tty, port);
1133 diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1134 index 055b64e..76d4f31 100644
1135 --- a/drivers/usb/serial/ftdi_sio_ids.h
1136 +++ b/drivers/usb/serial/ftdi_sio_ids.h
1137 @@ -39,6 +39,13 @@
1138 /* www.candapter.com Ewert Energy Systems CANdapter device */
1139 #define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */
1140
1141 +/*
1142 + * Texas Instruments XDS100v2 JTAG / BeagleBone A3
1143 + * http://processors.wiki.ti.com/index.php/XDS100
1144 + * http://beagleboard.org/bone
1145 + */
1146 +#define TI_XDS100V2_PID 0xa6d0
1147 +
1148 #define FTDI_NXTCAM_PID 0xABB8 /* NXTCam for Mindstorms NXT */
1149
1150 /* US Interface Navigator (http://www.usinterface.com/) */
1151 @@ -525,6 +532,12 @@
1152 #define ADI_GNICEPLUS_PID 0xF001
1153
1154 /*
1155 + * Hornby Elite
1156 + */
1157 +#define HORNBY_VID 0x04D8
1158 +#define HORNBY_ELITE_PID 0x000A
1159 +
1160 +/*
1161 * RATOC REX-USB60F
1162 */
1163 #define RATOC_VENDOR_ID 0x0584
1164 @@ -1168,3 +1181,9 @@
1165 */
1166 /* TagTracer MIFARE*/
1167 #define FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID 0xF7C0
1168 +
1169 +/*
1170 + * Rainforest Automation
1171 + */
1172 +/* ZigBee controller */
1173 +#define FTDI_RF_R106 0x8A28
1174 diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
1175 index 0aac00a..8a90d58 100644
1176 --- a/drivers/usb/serial/io_ti.c
1177 +++ b/drivers/usb/serial/io_ti.c
1178 @@ -2677,15 +2677,7 @@ cleanup:
1179
1180 static void edge_disconnect(struct usb_serial *serial)
1181 {
1182 - int i;
1183 - struct edgeport_port *edge_port;
1184 -
1185 dbg("%s", __func__);
1186 -
1187 - for (i = 0; i < serial->num_ports; ++i) {
1188 - edge_port = usb_get_serial_port_data(serial->port[i]);
1189 - edge_remove_sysfs_attrs(edge_port->port);
1190 - }
1191 }
1192
1193 static void edge_release(struct usb_serial *serial)
1194 @@ -2764,6 +2756,7 @@ static struct usb_serial_driver edgeport_1port_device = {
1195 .disconnect = edge_disconnect,
1196 .release = edge_release,
1197 .port_probe = edge_create_sysfs_attrs,
1198 + .port_remove = edge_remove_sysfs_attrs,
1199 .ioctl = edge_ioctl,
1200 .set_termios = edge_set_termios,
1201 .tiocmget = edge_tiocmget,
1202 @@ -2795,6 +2788,7 @@ static struct usb_serial_driver edgeport_2port_device = {
1203 .disconnect = edge_disconnect,
1204 .release = edge_release,
1205 .port_probe = edge_create_sysfs_attrs,
1206 + .port_remove = edge_remove_sysfs_attrs,
1207 .ioctl = edge_ioctl,
1208 .set_termios = edge_set_termios,
1209 .tiocmget = edge_tiocmget,
1210 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1211 index c96b6b6..2a9ed6e 100644
1212 --- a/drivers/usb/serial/option.c
1213 +++ b/drivers/usb/serial/option.c
1214 @@ -480,6 +480,10 @@ static void option_instat_callback(struct urb *urb);
1215 #define ZD_VENDOR_ID 0x0685
1216 #define ZD_PRODUCT_7000 0x7000
1217
1218 +/* LG products */
1219 +#define LG_VENDOR_ID 0x1004
1220 +#define LG_PRODUCT_L02C 0x618f
1221 +
1222 /* some devices interfaces need special handling due to a number of reasons */
1223 enum option_blacklist_reason {
1224 OPTION_BLACKLIST_NONE = 0,
1225 @@ -1183,6 +1187,7 @@ static const struct usb_device_id option_ids[] = {
1226 { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) },
1227 { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) },
1228 { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) },
1229 + { USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */
1230 { } /* Terminating entry */
1231 };
1232 MODULE_DEVICE_TABLE(usb, option_ids);
1233 diff --git a/drivers/usb/serial/qcaux.c b/drivers/usb/serial/qcaux.c
1234 index 30b73e6..a348198 100644
1235 --- a/drivers/usb/serial/qcaux.c
1236 +++ b/drivers/usb/serial/qcaux.c
1237 @@ -36,6 +36,7 @@
1238 #define UTSTARCOM_PRODUCT_UM175_V1 0x3712
1239 #define UTSTARCOM_PRODUCT_UM175_V2 0x3714
1240 #define UTSTARCOM_PRODUCT_UM175_ALLTEL 0x3715
1241 +#define PANTECH_PRODUCT_UML190_VZW 0x3716
1242 #define PANTECH_PRODUCT_UML290_VZW 0x3718
1243
1244 /* CMOTECH devices */
1245 @@ -67,7 +68,11 @@ static struct usb_device_id id_table[] = {
1246 { USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) },
1247 { USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) },
1248 { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_U520, 0xff, 0x00, 0x00) },
1249 - { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xff, 0xff) },
1250 + { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML190_VZW, 0xff, 0xff, 0xff) },
1251 + { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML190_VZW, 0xff, 0xfe, 0xff) },
1252 + { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xfd, 0xff) }, /* NMEA */
1253 + { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xfe, 0xff) }, /* WMC */
1254 + { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xff, 0xff) }, /* DIAG */
1255 { },
1256 };
1257 MODULE_DEVICE_TABLE(usb, id_table);
1258 diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
1259 index 7cf5c3e..c6602d2 100644
1260 --- a/fs/ecryptfs/crypto.c
1261 +++ b/fs/ecryptfs/crypto.c
1262 @@ -417,17 +417,6 @@ static int ecryptfs_encrypt_extent(struct page *enc_extent_page,
1263 (unsigned long long)(extent_base + extent_offset), rc);
1264 goto out;
1265 }
1266 - if (unlikely(ecryptfs_verbosity > 0)) {
1267 - ecryptfs_printk(KERN_DEBUG, "Encrypting extent "
1268 - "with iv:\n");
1269 - ecryptfs_dump_hex(extent_iv, crypt_stat->iv_bytes);
1270 - ecryptfs_printk(KERN_DEBUG, "First 8 bytes before "
1271 - "encryption:\n");
1272 - ecryptfs_dump_hex((char *)
1273 - (page_address(page)
1274 - + (extent_offset * crypt_stat->extent_size)),
1275 - 8);
1276 - }
1277 rc = ecryptfs_encrypt_page_offset(crypt_stat, enc_extent_page, 0,
1278 page, (extent_offset
1279 * crypt_stat->extent_size),
1280 @@ -440,14 +429,6 @@ static int ecryptfs_encrypt_extent(struct page *enc_extent_page,
1281 goto out;
1282 }
1283 rc = 0;
1284 - if (unlikely(ecryptfs_verbosity > 0)) {
1285 - ecryptfs_printk(KERN_DEBUG, "Encrypt extent [0x%.16llx]; "
1286 - "rc = [%d]\n",
1287 - (unsigned long long)(extent_base + extent_offset), rc);
1288 - ecryptfs_printk(KERN_DEBUG, "First 8 bytes after "
1289 - "encryption:\n");
1290 - ecryptfs_dump_hex((char *)(page_address(enc_extent_page)), 8);
1291 - }
1292 out:
1293 return rc;
1294 }
1295 @@ -543,17 +524,6 @@ static int ecryptfs_decrypt_extent(struct page *page,
1296 (unsigned long long)(extent_base + extent_offset), rc);
1297 goto out;
1298 }
1299 - if (unlikely(ecryptfs_verbosity > 0)) {
1300 - ecryptfs_printk(KERN_DEBUG, "Decrypting extent "
1301 - "with iv:\n");
1302 - ecryptfs_dump_hex(extent_iv, crypt_stat->iv_bytes);
1303 - ecryptfs_printk(KERN_DEBUG, "First 8 bytes before "
1304 - "decryption:\n");
1305 - ecryptfs_dump_hex((char *)
1306 - (page_address(enc_extent_page)
1307 - + (extent_offset * crypt_stat->extent_size)),
1308 - 8);
1309 - }
1310 rc = ecryptfs_decrypt_page_offset(crypt_stat, page,
1311 (extent_offset
1312 * crypt_stat->extent_size),
1313 @@ -567,16 +537,6 @@ static int ecryptfs_decrypt_extent(struct page *page,
1314 goto out;
1315 }
1316 rc = 0;
1317 - if (unlikely(ecryptfs_verbosity > 0)) {
1318 - ecryptfs_printk(KERN_DEBUG, "Decrypt extent [0x%.16llx]; "
1319 - "rc = [%d]\n",
1320 - (unsigned long long)(extent_base + extent_offset), rc);
1321 - ecryptfs_printk(KERN_DEBUG, "First 8 bytes after "
1322 - "decryption:\n");
1323 - ecryptfs_dump_hex((char *)(page_address(page)
1324 - + (extent_offset
1325 - * crypt_stat->extent_size)), 8);
1326 - }
1327 out:
1328 return rc;
1329 }
1330 @@ -1618,7 +1578,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
1331 rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_inode);
1332 if (rc) {
1333 printk(KERN_DEBUG "Valid eCryptfs headers not found in "
1334 - "file header region or xattr region\n");
1335 + "file header region or xattr region, inode %lu\n",
1336 + ecryptfs_inode->i_ino);
1337 rc = -EINVAL;
1338 goto out;
1339 }
1340 @@ -1627,7 +1588,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
1341 ECRYPTFS_DONT_VALIDATE_HEADER_SIZE);
1342 if (rc) {
1343 printk(KERN_DEBUG "Valid eCryptfs headers not found in "
1344 - "file xattr region either\n");
1345 + "file xattr region either, inode %lu\n",
1346 + ecryptfs_inode->i_ino);
1347 rc = -EINVAL;
1348 }
1349 if (crypt_stat->mount_crypt_stat->flags
1350 @@ -1638,7 +1600,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
1351 "crypto metadata only in the extended attribute "
1352 "region, but eCryptfs was mounted without "
1353 "xattr support enabled. eCryptfs will not treat "
1354 - "this like an encrypted file.\n");
1355 + "this like an encrypted file, inode %lu\n",
1356 + ecryptfs_inode->i_ino);
1357 rc = -EINVAL;
1358 }
1359 }
1360 diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
1361 index 4a4fad7f..e3562f2 100644
1362 --- a/fs/ecryptfs/inode.c
1363 +++ b/fs/ecryptfs/inode.c
1364 @@ -854,18 +854,6 @@ static int truncate_upper(struct dentry *dentry, struct iattr *ia,
1365 size_t num_zeros = (PAGE_CACHE_SIZE
1366 - (ia->ia_size & ~PAGE_CACHE_MASK));
1367
1368 -
1369 - /*
1370 - * XXX(truncate) this should really happen at the begginning
1371 - * of ->setattr. But the code is too messy to that as part
1372 - * of a larger patch. ecryptfs is also totally missing out
1373 - * on the inode_change_ok check at the beginning of
1374 - * ->setattr while would include this.
1375 - */
1376 - rc = inode_newsize_ok(inode, ia->ia_size);
1377 - if (rc)
1378 - goto out;
1379 -
1380 if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) {
1381 truncate_setsize(inode, ia->ia_size);
1382 lower_ia->ia_size = ia->ia_size;
1383 @@ -915,6 +903,28 @@ out:
1384 return rc;
1385 }
1386
1387 +static int ecryptfs_inode_newsize_ok(struct inode *inode, loff_t offset)
1388 +{
1389 + struct ecryptfs_crypt_stat *crypt_stat;
1390 + loff_t lower_oldsize, lower_newsize;
1391 +
1392 + crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat;
1393 + lower_oldsize = upper_size_to_lower_size(crypt_stat,
1394 + i_size_read(inode));
1395 + lower_newsize = upper_size_to_lower_size(crypt_stat, offset);
1396 + if (lower_newsize > lower_oldsize) {
1397 + /*
1398 + * The eCryptfs inode and the new *lower* size are mixed here
1399 + * because we may not have the lower i_mutex held and/or it may
1400 + * not be appropriate to call inode_newsize_ok() with inodes
1401 + * from other filesystems.
1402 + */
1403 + return inode_newsize_ok(inode, lower_newsize);
1404 + }
1405 +
1406 + return 0;
1407 +}
1408 +
1409 /**
1410 * ecryptfs_truncate
1411 * @dentry: The ecryptfs layer dentry
1412 @@ -931,6 +941,10 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length)
1413 struct iattr lower_ia = { .ia_valid = 0 };
1414 int rc;
1415
1416 + rc = ecryptfs_inode_newsize_ok(dentry->d_inode, new_length);
1417 + if (rc)
1418 + return rc;
1419 +
1420 rc = truncate_upper(dentry, &ia, &lower_ia);
1421 if (!rc && lower_ia.ia_valid & ATTR_SIZE) {
1422 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
1423 @@ -1012,6 +1026,16 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
1424 }
1425 }
1426 mutex_unlock(&crypt_stat->cs_mutex);
1427 +
1428 + rc = inode_change_ok(inode, ia);
1429 + if (rc)
1430 + goto out;
1431 + if (ia->ia_valid & ATTR_SIZE) {
1432 + rc = ecryptfs_inode_newsize_ok(inode, ia->ia_size);
1433 + if (rc)
1434 + goto out;
1435 + }
1436 +
1437 if (S_ISREG(inode->i_mode)) {
1438 rc = filemap_write_and_wait(inode->i_mapping);
1439 if (rc)
1440 diff --git a/fs/ecryptfs/miscdev.c b/fs/ecryptfs/miscdev.c
1441 index 940a82e..0dc5a3d 100644
1442 --- a/fs/ecryptfs/miscdev.c
1443 +++ b/fs/ecryptfs/miscdev.c
1444 @@ -409,11 +409,47 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf,
1445 ssize_t sz = 0;
1446 char *data;
1447 uid_t euid = current_euid();
1448 + unsigned char packet_size_peek[3];
1449 int rc;
1450
1451 - if (count == 0)
1452 + if (count == 0) {
1453 goto out;
1454 + } else if (count == (1 + 4)) {
1455 + /* Likely a harmless MSG_HELO or MSG_QUIT - no packet length */
1456 + goto memdup;
1457 + } else if (count < (1 + 4 + 1)
1458 + || count > (1 + 4 + 2 + sizeof(struct ecryptfs_message) + 4
1459 + + ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES)) {
1460 + printk(KERN_WARNING "%s: Acceptable packet size range is "
1461 + "[%d-%lu], but amount of data written is [%zu].",
1462 + __func__, (1 + 4 + 1),
1463 + (1 + 4 + 2 + sizeof(struct ecryptfs_message) + 4
1464 + + ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES), count);
1465 + return -EINVAL;
1466 + }
1467 +
1468 + if (copy_from_user(packet_size_peek, (buf + 1 + 4),
1469 + sizeof(packet_size_peek))) {
1470 + printk(KERN_WARNING "%s: Error while inspecting packet size\n",
1471 + __func__);
1472 + return -EFAULT;
1473 + }
1474 +
1475 + rc = ecryptfs_parse_packet_length(packet_size_peek, &packet_size,
1476 + &packet_size_length);
1477 + if (rc) {
1478 + printk(KERN_WARNING "%s: Error parsing packet length; "
1479 + "rc = [%d]\n", __func__, rc);
1480 + return rc;
1481 + }
1482 +
1483 + if ((1 + 4 + packet_size_length + packet_size) != count) {
1484 + printk(KERN_WARNING "%s: Invalid packet size [%zu]\n", __func__,
1485 + packet_size);
1486 + return -EINVAL;
1487 + }
1488
1489 +memdup:
1490 data = memdup_user(buf, count);
1491 if (IS_ERR(data)) {
1492 printk(KERN_ERR "%s: memdup_user returned error [%ld]\n",
1493 @@ -435,23 +471,7 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf,
1494 }
1495 memcpy(&counter_nbo, &data[i], 4);
1496 seq = be32_to_cpu(counter_nbo);
1497 - i += 4;
1498 - rc = ecryptfs_parse_packet_length(&data[i], &packet_size,
1499 - &packet_size_length);
1500 - if (rc) {
1501 - printk(KERN_WARNING "%s: Error parsing packet length; "
1502 - "rc = [%d]\n", __func__, rc);
1503 - goto out_free;
1504 - }
1505 - i += packet_size_length;
1506 - if ((1 + 4 + packet_size_length + packet_size) != count) {
1507 - printk(KERN_WARNING "%s: (1 + packet_size_length([%zd])"
1508 - " + packet_size([%zd]))([%zd]) != "
1509 - "count([%zd]). Invalid packet format.\n",
1510 - __func__, packet_size_length, packet_size,
1511 - (1 + packet_size_length + packet_size), count);
1512 - goto out_free;
1513 - }
1514 + i += 4 + packet_size_length;
1515 rc = ecryptfs_miscdev_response(&data[i], packet_size,
1516 euid, current_user_ns(),
1517 task_pid(current), seq);
1518 diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c
1519 index 3745f7c..54eb14c 100644
1520 --- a/fs/ecryptfs/read_write.c
1521 +++ b/fs/ecryptfs/read_write.c
1522 @@ -132,6 +132,11 @@ int ecryptfs_write(struct inode *ecryptfs_inode, char *data, loff_t offset,
1523 size_t num_bytes = (PAGE_CACHE_SIZE - start_offset_in_page);
1524 size_t total_remaining_bytes = ((offset + size) - pos);
1525
1526 + if (fatal_signal_pending(current)) {
1527 + rc = -EINTR;
1528 + break;
1529 + }
1530 +
1531 if (num_bytes > total_remaining_bytes)
1532 num_bytes = total_remaining_bytes;
1533 if (pos < offset) {
1534 @@ -193,15 +198,19 @@ int ecryptfs_write(struct inode *ecryptfs_inode, char *data, loff_t offset,
1535 }
1536 pos += num_bytes;
1537 }
1538 - if ((offset + size) > ecryptfs_file_size) {
1539 - i_size_write(ecryptfs_inode, (offset + size));
1540 + if (pos > ecryptfs_file_size) {
1541 + i_size_write(ecryptfs_inode, pos);
1542 if (crypt_stat->flags & ECRYPTFS_ENCRYPTED) {
1543 - rc = ecryptfs_write_inode_size_to_metadata(
1544 + int rc2;
1545 +
1546 + rc2 = ecryptfs_write_inode_size_to_metadata(
1547 ecryptfs_inode);
1548 - if (rc) {
1549 + if (rc2) {
1550 printk(KERN_ERR "Problem with "
1551 "ecryptfs_write_inode_size_to_metadata; "
1552 - "rc = [%d]\n", rc);
1553 + "rc = [%d]\n", rc2);
1554 + if (!rc)
1555 + rc = rc2;
1556 goto out;
1557 }
1558 }
1559 diff --git a/fs/xfs/linux-2.6/xfs_discard.c b/fs/xfs/linux-2.6/xfs_discard.c
1560 index 244e797..572494f 100644
1561 --- a/fs/xfs/linux-2.6/xfs_discard.c
1562 +++ b/fs/xfs/linux-2.6/xfs_discard.c
1563 @@ -68,7 +68,7 @@ xfs_trim_extents(
1564 * Look up the longest btree in the AGF and start with it.
1565 */
1566 error = xfs_alloc_lookup_le(cur, 0,
1567 - XFS_BUF_TO_AGF(agbp)->agf_longest, &i);
1568 + be32_to_cpu(XFS_BUF_TO_AGF(agbp)->agf_longest), &i);
1569 if (error)
1570 goto out_del_cursor;
1571
1572 @@ -84,7 +84,7 @@ xfs_trim_extents(
1573 if (error)
1574 goto out_del_cursor;
1575 XFS_WANT_CORRUPTED_GOTO(i == 1, out_del_cursor);
1576 - ASSERT(flen <= XFS_BUF_TO_AGF(agbp)->agf_longest);
1577 + ASSERT(flen <= be32_to_cpu(XFS_BUF_TO_AGF(agbp)->agf_longest));
1578
1579 /*
1580 * Too small? Give up.
1581 diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
1582 index 6cc4d41..59509ae 100644
1583 --- a/fs/xfs/xfs_vnodeops.c
1584 +++ b/fs/xfs/xfs_vnodeops.c
1585 @@ -554,7 +554,8 @@ xfs_readlink(
1586 __func__, (unsigned long long) ip->i_ino,
1587 (long long) pathlen);
1588 ASSERT(0);
1589 - return XFS_ERROR(EFSCORRUPTED);
1590 + error = XFS_ERROR(EFSCORRUPTED);
1591 + goto out;
1592 }
1593
1594
1595 diff --git a/include/drm/drmP.h b/include/drm/drmP.h
1596 index 738b3a5..40aaebf 100644
1597 --- a/include/drm/drmP.h
1598 +++ b/include/drm/drmP.h
1599 @@ -1323,6 +1323,7 @@ extern int drm_getmagic(struct drm_device *dev, void *data,
1600 struct drm_file *file_priv);
1601 extern int drm_authmagic(struct drm_device *dev, void *data,
1602 struct drm_file *file_priv);
1603 +extern int drm_remove_magic(struct drm_master *master, drm_magic_t magic);
1604
1605 /* Cache management (drm_cache.c) */
1606 void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
1607 diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h
1608 index 3419bf5..d55f434 100644
1609 --- a/include/net/netns/generic.h
1610 +++ b/include/net/netns/generic.h
1611 @@ -41,6 +41,7 @@ static inline void *net_generic(const struct net *net, int id)
1612 ptr = ng->ptr[id - 1];
1613 rcu_read_unlock();
1614
1615 + BUG_ON(!ptr);
1616 return ptr;
1617 }
1618 #endif
1619 diff --git a/kernel/printk.c b/kernel/printk.c
1620 index 084982f..3fc4708 100644
1621 --- a/kernel/printk.c
1622 +++ b/kernel/printk.c
1623 @@ -318,8 +318,10 @@ static int check_syslog_permissions(int type, bool from_file)
1624 return 0;
1625 /* For historical reasons, accept CAP_SYS_ADMIN too, with a warning */
1626 if (capable(CAP_SYS_ADMIN)) {
1627 - WARN_ONCE(1, "Attempt to access syslog with CAP_SYS_ADMIN "
1628 - "but no CAP_SYSLOG (deprecated).\n");
1629 + printk_once(KERN_WARNING "%s (%d): "
1630 + "Attempt to access syslog with CAP_SYS_ADMIN "
1631 + "but no CAP_SYSLOG (deprecated).\n",
1632 + current->comm, task_pid_nr(current));
1633 return 0;
1634 }
1635 return -EPERM;
1636 diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
1637 index ef9271b..9f8e2e1 100644
1638 --- a/kernel/trace/ftrace.c
1639 +++ b/kernel/trace/ftrace.c
1640 @@ -952,7 +952,7 @@ struct ftrace_func_probe {
1641 };
1642
1643 enum {
1644 - FTRACE_ENABLE_CALLS = (1 << 0),
1645 + FTRACE_UPDATE_CALLS = (1 << 0),
1646 FTRACE_DISABLE_CALLS = (1 << 1),
1647 FTRACE_UPDATE_TRACE_FUNC = (1 << 2),
1648 FTRACE_START_FUNC_RET = (1 << 3),
1649 @@ -1182,8 +1182,14 @@ alloc_and_copy_ftrace_hash(int size_bits, struct ftrace_hash *hash)
1650 return NULL;
1651 }
1652
1653 +static void
1654 +ftrace_hash_rec_disable(struct ftrace_ops *ops, int filter_hash);
1655 +static void
1656 +ftrace_hash_rec_enable(struct ftrace_ops *ops, int filter_hash);
1657 +
1658 static int
1659 -ftrace_hash_move(struct ftrace_hash **dst, struct ftrace_hash *src)
1660 +ftrace_hash_move(struct ftrace_ops *ops, int enable,
1661 + struct ftrace_hash **dst, struct ftrace_hash *src)
1662 {
1663 struct ftrace_func_entry *entry;
1664 struct hlist_node *tp, *tn;
1665 @@ -1193,9 +1199,16 @@ ftrace_hash_move(struct ftrace_hash **dst, struct ftrace_hash *src)
1666 unsigned long key;
1667 int size = src->count;
1668 int bits = 0;
1669 + int ret;
1670 int i;
1671
1672 /*
1673 + * Remove the current set, update the hash and add
1674 + * them back.
1675 + */
1676 + ftrace_hash_rec_disable(ops, enable);
1677 +
1678 + /*
1679 * If the new source is empty, just free dst and assign it
1680 * the empty_hash.
1681 */
1682 @@ -1215,9 +1228,10 @@ ftrace_hash_move(struct ftrace_hash **dst, struct ftrace_hash *src)
1683 if (bits > FTRACE_HASH_MAX_BITS)
1684 bits = FTRACE_HASH_MAX_BITS;
1685
1686 + ret = -ENOMEM;
1687 new_hash = alloc_ftrace_hash(bits);
1688 if (!new_hash)
1689 - return -ENOMEM;
1690 + goto out;
1691
1692 size = 1 << src->size_bits;
1693 for (i = 0; i < size; i++) {
1694 @@ -1236,7 +1250,16 @@ ftrace_hash_move(struct ftrace_hash **dst, struct ftrace_hash *src)
1695 rcu_assign_pointer(*dst, new_hash);
1696 free_ftrace_hash_rcu(old_hash);
1697
1698 - return 0;
1699 + ret = 0;
1700 + out:
1701 + /*
1702 + * Enable regardless of ret:
1703 + * On success, we enable the new hash.
1704 + * On failure, we re-enable the original hash.
1705 + */
1706 + ftrace_hash_rec_enable(ops, enable);
1707 +
1708 + return ret;
1709 }
1710
1711 /*
1712 @@ -1498,7 +1521,7 @@ int ftrace_text_reserved(void *start, void *end)
1713
1714
1715 static int
1716 -__ftrace_replace_code(struct dyn_ftrace *rec, int enable)
1717 +__ftrace_replace_code(struct dyn_ftrace *rec, int update)
1718 {
1719 unsigned long ftrace_addr;
1720 unsigned long flag = 0UL;
1721 @@ -1506,17 +1529,17 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
1722 ftrace_addr = (unsigned long)FTRACE_ADDR;
1723
1724 /*
1725 - * If we are enabling tracing:
1726 + * If we are updating calls:
1727 *
1728 * If the record has a ref count, then we need to enable it
1729 * because someone is using it.
1730 *
1731 * Otherwise we make sure its disabled.
1732 *
1733 - * If we are disabling tracing, then disable all records that
1734 + * If we are disabling calls, then disable all records that
1735 * are enabled.
1736 */
1737 - if (enable && (rec->flags & ~FTRACE_FL_MASK))
1738 + if (update && (rec->flags & ~FTRACE_FL_MASK))
1739 flag = FTRACE_FL_ENABLED;
1740
1741 /* If the state of this record hasn't changed, then do nothing */
1742 @@ -1532,7 +1555,7 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
1743 return ftrace_make_nop(NULL, rec, ftrace_addr);
1744 }
1745
1746 -static void ftrace_replace_code(int enable)
1747 +static void ftrace_replace_code(int update)
1748 {
1749 struct dyn_ftrace *rec;
1750 struct ftrace_page *pg;
1751 @@ -1546,7 +1569,7 @@ static void ftrace_replace_code(int enable)
1752 if (rec->flags & FTRACE_FL_FREE)
1753 continue;
1754
1755 - failed = __ftrace_replace_code(rec, enable);
1756 + failed = __ftrace_replace_code(rec, update);
1757 if (failed) {
1758 ftrace_bug(failed, rec->ip);
1759 /* Stop processing */
1760 @@ -1596,7 +1619,7 @@ static int __ftrace_modify_code(void *data)
1761 {
1762 int *command = data;
1763
1764 - if (*command & FTRACE_ENABLE_CALLS)
1765 + if (*command & FTRACE_UPDATE_CALLS)
1766 ftrace_replace_code(1);
1767 else if (*command & FTRACE_DISABLE_CALLS)
1768 ftrace_replace_code(0);
1769 @@ -1652,7 +1675,7 @@ static int ftrace_startup(struct ftrace_ops *ops, int command)
1770 return -ENODEV;
1771
1772 ftrace_start_up++;
1773 - command |= FTRACE_ENABLE_CALLS;
1774 + command |= FTRACE_UPDATE_CALLS;
1775
1776 /* ops marked global share the filter hashes */
1777 if (ops->flags & FTRACE_OPS_FL_GLOBAL) {
1778 @@ -1704,8 +1727,7 @@ static void ftrace_shutdown(struct ftrace_ops *ops, int command)
1779 if (ops != &global_ops || !global_start_up)
1780 ops->flags &= ~FTRACE_OPS_FL_ENABLED;
1781
1782 - if (!ftrace_start_up)
1783 - command |= FTRACE_DISABLE_CALLS;
1784 + command |= FTRACE_UPDATE_CALLS;
1785
1786 if (saved_ftrace_func != ftrace_trace_function) {
1787 saved_ftrace_func = ftrace_trace_function;
1788 @@ -1727,7 +1749,7 @@ static void ftrace_startup_sysctl(void)
1789 saved_ftrace_func = NULL;
1790 /* ftrace_start_up is true if we want ftrace running */
1791 if (ftrace_start_up)
1792 - ftrace_run_update_code(FTRACE_ENABLE_CALLS);
1793 + ftrace_run_update_code(FTRACE_UPDATE_CALLS);
1794 }
1795
1796 static void ftrace_shutdown_sysctl(void)
1797 @@ -2877,7 +2899,11 @@ ftrace_set_regex(struct ftrace_ops *ops, unsigned char *buf, int len,
1798 ftrace_match_records(hash, buf, len);
1799
1800 mutex_lock(&ftrace_lock);
1801 - ret = ftrace_hash_move(orig_hash, hash);
1802 + ret = ftrace_hash_move(ops, enable, orig_hash, hash);
1803 + if (!ret && ops->flags & FTRACE_OPS_FL_ENABLED
1804 + && ftrace_enabled)
1805 + ftrace_run_update_code(FTRACE_UPDATE_CALLS);
1806 +
1807 mutex_unlock(&ftrace_lock);
1808
1809 mutex_unlock(&ftrace_regex_lock);
1810 @@ -3060,18 +3086,12 @@ ftrace_regex_release(struct inode *inode, struct file *file)
1811 orig_hash = &iter->ops->notrace_hash;
1812
1813 mutex_lock(&ftrace_lock);
1814 - /*
1815 - * Remove the current set, update the hash and add
1816 - * them back.
1817 - */
1818 - ftrace_hash_rec_disable(iter->ops, filter_hash);
1819 - ret = ftrace_hash_move(orig_hash, iter->hash);
1820 - if (!ret) {
1821 - ftrace_hash_rec_enable(iter->ops, filter_hash);
1822 - if (iter->ops->flags & FTRACE_OPS_FL_ENABLED
1823 - && ftrace_enabled)
1824 - ftrace_run_update_code(FTRACE_ENABLE_CALLS);
1825 - }
1826 + ret = ftrace_hash_move(iter->ops, filter_hash,
1827 + orig_hash, iter->hash);
1828 + if (!ret && (iter->ops->flags & FTRACE_OPS_FL_ENABLED)
1829 + && ftrace_enabled)
1830 + ftrace_run_update_code(FTRACE_UPDATE_CALLS);
1831 +
1832 mutex_unlock(&ftrace_lock);
1833 }
1834 free_ftrace_hash(iter->hash);
1835 diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
1836 index dbdaa95..5ba4366 100644
1837 --- a/net/caif/caif_dev.c
1838 +++ b/net/caif/caif_dev.c
1839 @@ -53,7 +53,6 @@ struct cfcnfg *get_cfcnfg(struct net *net)
1840 struct caif_net *caifn;
1841 BUG_ON(!net);
1842 caifn = net_generic(net, caif_net_id);
1843 - BUG_ON(!caifn);
1844 return caifn->cfg;
1845 }
1846 EXPORT_SYMBOL(get_cfcnfg);
1847 @@ -63,7 +62,6 @@ static struct caif_device_entry_list *caif_device_list(struct net *net)
1848 struct caif_net *caifn;
1849 BUG_ON(!net);
1850 caifn = net_generic(net, caif_net_id);
1851 - BUG_ON(!caifn);
1852 return &caifn->caifdevs;
1853 }
1854
1855 @@ -92,7 +90,6 @@ static struct caif_device_entry *caif_device_alloc(struct net_device *dev)
1856 struct caif_device_entry *caifd;
1857
1858 caifdevs = caif_device_list(dev_net(dev));
1859 - BUG_ON(!caifdevs);
1860
1861 caifd = kzalloc(sizeof(*caifd), GFP_ATOMIC);
1862 if (!caifd)
1863 @@ -108,7 +105,7 @@ static struct caif_device_entry *caif_get(struct net_device *dev)
1864 struct caif_device_entry_list *caifdevs =
1865 caif_device_list(dev_net(dev));
1866 struct caif_device_entry *caifd;
1867 - BUG_ON(!caifdevs);
1868 +
1869 list_for_each_entry_rcu(caifd, &caifdevs->list, list) {
1870 if (caifd->netdev == dev)
1871 return caifd;
1872 @@ -349,7 +346,7 @@ static struct notifier_block caif_device_notifier = {
1873 static int caif_init_net(struct net *net)
1874 {
1875 struct caif_net *caifn = net_generic(net, caif_net_id);
1876 - BUG_ON(!caifn);
1877 +
1878 INIT_LIST_HEAD(&caifn->caifdevs.list);
1879 mutex_init(&caifn->caifdevs.lock);
1880
1881 @@ -414,7 +411,7 @@ static int __init caif_device_init(void)
1882 {
1883 int result;
1884
1885 - result = register_pernet_device(&caif_net_ops);
1886 + result = register_pernet_subsys(&caif_net_ops);
1887
1888 if (result)
1889 return result;
1890 @@ -427,7 +424,7 @@ static int __init caif_device_init(void)
1891
1892 static void __exit caif_device_exit(void)
1893 {
1894 - unregister_pernet_device(&caif_net_ops);
1895 + unregister_pernet_subsys(&caif_net_ops);
1896 unregister_netdevice_notifier(&caif_device_notifier);
1897 dev_remove_pack(&caif_packet_type);
1898 }
1899 diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c
1900 index 52fe33b..bca32d7 100644
1901 --- a/net/caif/cfcnfg.c
1902 +++ b/net/caif/cfcnfg.c
1903 @@ -313,7 +313,6 @@ int caif_connect_client(struct net *net, struct caif_connect_request *conn_req,
1904 int err;
1905 struct cfctrl_link_param param;
1906 struct cfcnfg *cfg = get_cfcnfg(net);
1907 - caif_assert(cfg != NULL);
1908
1909 rcu_read_lock();
1910 err = caif_connect_req_to_link_param(cfg, conn_req, &param);
1911 diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
1912 index ea489db..0b0211d 100644
1913 --- a/net/core/net_namespace.c
1914 +++ b/net/core/net_namespace.c
1915 @@ -29,6 +29,20 @@ EXPORT_SYMBOL(init_net);
1916
1917 #define INITIAL_NET_GEN_PTRS 13 /* +1 for len +2 for rcu_head */
1918
1919 +static unsigned int max_gen_ptrs = INITIAL_NET_GEN_PTRS;
1920 +
1921 +static struct net_generic *net_alloc_generic(void)
1922 +{
1923 + struct net_generic *ng;
1924 + size_t generic_size = offsetof(struct net_generic, ptr[max_gen_ptrs]);
1925 +
1926 + ng = kzalloc(generic_size, GFP_KERNEL);
1927 + if (ng)
1928 + ng->len = max_gen_ptrs;
1929 +
1930 + return ng;
1931 +}
1932 +
1933 static int net_assign_generic(struct net *net, int id, void *data)
1934 {
1935 struct net_generic *ng, *old_ng;
1936 @@ -42,8 +56,7 @@ static int net_assign_generic(struct net *net, int id, void *data)
1937 if (old_ng->len >= id)
1938 goto assign;
1939
1940 - ng = kzalloc(sizeof(struct net_generic) +
1941 - id * sizeof(void *), GFP_KERNEL);
1942 + ng = net_alloc_generic();
1943 if (ng == NULL)
1944 return -ENOMEM;
1945
1946 @@ -58,7 +71,6 @@ static int net_assign_generic(struct net *net, int id, void *data)
1947 * the old copy for kfree after a grace period.
1948 */
1949
1950 - ng->len = id;
1951 memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*));
1952
1953 rcu_assign_pointer(net->gen, ng);
1954 @@ -159,18 +171,6 @@ out_undo:
1955 goto out;
1956 }
1957
1958 -static struct net_generic *net_alloc_generic(void)
1959 -{
1960 - struct net_generic *ng;
1961 - size_t generic_size = sizeof(struct net_generic) +
1962 - INITIAL_NET_GEN_PTRS * sizeof(void *);
1963 -
1964 - ng = kzalloc(generic_size, GFP_KERNEL);
1965 - if (ng)
1966 - ng->len = INITIAL_NET_GEN_PTRS;
1967 -
1968 - return ng;
1969 -}
1970
1971 #ifdef CONFIG_NET_NS
1972 static struct kmem_cache *net_cachep;
1973 @@ -481,6 +481,7 @@ again:
1974 }
1975 return error;
1976 }
1977 + max_gen_ptrs = max_t(unsigned int, max_gen_ptrs, *ops->id);
1978 }
1979 error = __register_pernet_operations(list, ops);
1980 if (error) {
1981 diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
1982 index c7056b2..36d1440 100644
1983 --- a/net/ipv4/ah4.c
1984 +++ b/net/ipv4/ah4.c
1985 @@ -369,8 +369,6 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
1986 if (err == -EINPROGRESS)
1987 goto out;
1988
1989 - if (err == -EBUSY)
1990 - err = NET_XMIT_DROP;
1991 goto out_free;
1992 }
1993
1994 diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
1995 index 69790aa..53b0125 100644
1996 --- a/net/ipv4/tcp_ipv4.c
1997 +++ b/net/ipv4/tcp_ipv4.c
1998 @@ -630,7 +630,7 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
1999 arg.iov[0].iov_len = sizeof(rep.th);
2000
2001 #ifdef CONFIG_TCP_MD5SIG
2002 - key = sk ? tcp_v4_md5_do_lookup(sk, ip_hdr(skb)->daddr) : NULL;
2003 + key = sk ? tcp_v4_md5_do_lookup(sk, ip_hdr(skb)->saddr) : NULL;
2004 if (key) {
2005 rep.opt[0] = htonl((TCPOPT_NOP << 24) |
2006 (TCPOPT_NOP << 16) |
2007 diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
2008 index 882e0b0..faf257b 100644
2009 --- a/net/ipv4/tcp_output.c
2010 +++ b/net/ipv4/tcp_output.c
2011 @@ -1134,11 +1134,9 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
2012 sk_mem_uncharge(sk, len);
2013 sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
2014
2015 - /* Any change of skb->len requires recalculation of tso
2016 - * factor and mss.
2017 - */
2018 + /* Any change of skb->len requires recalculation of tso factor. */
2019 if (tcp_skb_pcount(skb) > 1)
2020 - tcp_set_skb_tso_segs(sk, skb, tcp_current_mss(sk));
2021 + tcp_set_skb_tso_segs(sk, skb, tcp_skb_mss(skb));
2022
2023 return 0;
2024 }
2025 diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
2026 index 7a33aaa..4c0f894 100644
2027 --- a/net/ipv6/ah6.c
2028 +++ b/net/ipv6/ah6.c
2029 @@ -581,8 +581,6 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
2030 if (err == -EINPROGRESS)
2031 goto out;
2032
2033 - if (err == -EBUSY)
2034 - err = NET_XMIT_DROP;
2035 goto out_free;
2036 }
2037
2038 diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
2039 index 296510a..51587a0 100644
2040 --- a/net/ipv6/tcp_ipv6.c
2041 +++ b/net/ipv6/tcp_ipv6.c
2042 @@ -1096,7 +1096,7 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)
2043
2044 #ifdef CONFIG_TCP_MD5SIG
2045 if (sk)
2046 - key = tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr);
2047 + key = tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->saddr);
2048 #endif
2049
2050 if (th->ack)
2051 diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
2052 index b6466e7..858ca23 100644
2053 --- a/net/l2tp/l2tp_ip.c
2054 +++ b/net/l2tp/l2tp_ip.c
2055 @@ -393,11 +393,6 @@ static int l2tp_ip_backlog_recv(struct sock *sk, struct sk_buff *skb)
2056 {
2057 int rc;
2058
2059 - if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb))
2060 - goto drop;
2061 -
2062 - nf_reset(skb);
2063 -
2064 /* Charge it to the socket, dropping if the queue is full. */
2065 rc = sock_queue_rcv_skb(sk, skb);
2066 if (rc < 0)
2067 diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
2068 index bb6ad81..424ff62 100644
2069 --- a/net/rds/af_rds.c
2070 +++ b/net/rds/af_rds.c
2071 @@ -68,7 +68,6 @@ static int rds_release(struct socket *sock)
2072 {
2073 struct sock *sk = sock->sk;
2074 struct rds_sock *rs;
2075 - unsigned long flags;
2076
2077 if (!sk)
2078 goto out;
2079 @@ -94,10 +93,10 @@ static int rds_release(struct socket *sock)
2080 rds_rdma_drop_keys(rs);
2081 rds_notify_queue_get(rs, NULL);
2082
2083 - spin_lock_irqsave(&rds_sock_lock, flags);
2084 + spin_lock_bh(&rds_sock_lock);
2085 list_del_init(&rs->rs_item);
2086 rds_sock_count--;
2087 - spin_unlock_irqrestore(&rds_sock_lock, flags);
2088 + spin_unlock_bh(&rds_sock_lock);
2089
2090 rds_trans_put(rs->rs_transport);
2091
2092 @@ -409,7 +408,6 @@ static const struct proto_ops rds_proto_ops = {
2093
2094 static int __rds_create(struct socket *sock, struct sock *sk, int protocol)
2095 {
2096 - unsigned long flags;
2097 struct rds_sock *rs;
2098
2099 sock_init_data(sock, sk);
2100 @@ -426,10 +424,10 @@ static int __rds_create(struct socket *sock, struct sock *sk, int protocol)
2101 spin_lock_init(&rs->rs_rdma_lock);
2102 rs->rs_rdma_keys = RB_ROOT;
2103
2104 - spin_lock_irqsave(&rds_sock_lock, flags);
2105 + spin_lock_bh(&rds_sock_lock);
2106 list_add_tail(&rs->rs_item, &rds_sock_list);
2107 rds_sock_count++;
2108 - spin_unlock_irqrestore(&rds_sock_lock, flags);
2109 + spin_unlock_bh(&rds_sock_lock);
2110
2111 return 0;
2112 }
2113 @@ -471,12 +469,11 @@ static void rds_sock_inc_info(struct socket *sock, unsigned int len,
2114 {
2115 struct rds_sock *rs;
2116 struct rds_incoming *inc;
2117 - unsigned long flags;
2118 unsigned int total = 0;
2119
2120 len /= sizeof(struct rds_info_message);
2121
2122 - spin_lock_irqsave(&rds_sock_lock, flags);
2123 + spin_lock_bh(&rds_sock_lock);
2124
2125 list_for_each_entry(rs, &rds_sock_list, rs_item) {
2126 read_lock(&rs->rs_recv_lock);
2127 @@ -492,7 +489,7 @@ static void rds_sock_inc_info(struct socket *sock, unsigned int len,
2128 read_unlock(&rs->rs_recv_lock);
2129 }
2130
2131 - spin_unlock_irqrestore(&rds_sock_lock, flags);
2132 + spin_unlock_bh(&rds_sock_lock);
2133
2134 lens->nr = total;
2135 lens->each = sizeof(struct rds_info_message);
2136 @@ -504,11 +501,10 @@ static void rds_sock_info(struct socket *sock, unsigned int len,
2137 {
2138 struct rds_info_socket sinfo;
2139 struct rds_sock *rs;
2140 - unsigned long flags;
2141
2142 len /= sizeof(struct rds_info_socket);
2143
2144 - spin_lock_irqsave(&rds_sock_lock, flags);
2145 + spin_lock_bh(&rds_sock_lock);
2146
2147 if (len < rds_sock_count)
2148 goto out;
2149 @@ -529,7 +525,7 @@ out:
2150 lens->nr = rds_sock_count;
2151 lens->each = sizeof(struct rds_info_socket);
2152
2153 - spin_unlock_irqrestore(&rds_sock_lock, flags);
2154 + spin_unlock_bh(&rds_sock_lock);
2155 }
2156
2157 static void rds_exit(void)
2158 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
2159 index eb0a141..51412e1 100644
2160 --- a/sound/pci/hda/patch_realtek.c
2161 +++ b/sound/pci/hda/patch_realtek.c
2162 @@ -16419,6 +16419,7 @@ static const struct alc_config_preset alc861_presets[] = {
2163 /* Pin config fixes */
2164 enum {
2165 PINFIX_FSC_AMILO_PI1505,
2166 + PINFIX_ASUS_A6RP,
2167 };
2168
2169 static const struct alc_fixup alc861_fixups[] = {
2170 @@ -16430,9 +16431,19 @@ static const struct alc_fixup alc861_fixups[] = {
2171 { }
2172 }
2173 },
2174 + [PINFIX_ASUS_A6RP] = {
2175 + .type = ALC_FIXUP_VERBS,
2176 + .v.verbs = (const struct hda_verb[]) {
2177 + /* node 0x0f VREF seems controlling the master output */
2178 + { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 },
2179 + { }
2180 + },
2181 + },
2182 };
2183
2184 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
2185 + SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", PINFIX_ASUS_A6RP),
2186 + SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", PINFIX_ASUS_A6RP),
2187 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", PINFIX_FSC_AMILO_PI1505),
2188 {}
2189 };
2190 diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
2191 index 0d8db75..43d88c7 100644
2192 --- a/sound/pci/hda/patch_sigmatel.c
2193 +++ b/sound/pci/hda/patch_sigmatel.c
2194 @@ -4162,13 +4162,15 @@ static int enable_pin_detect(struct hda_codec *codec, hda_nid_t nid,
2195 return 1;
2196 }
2197
2198 -static int is_nid_hp_pin(struct auto_pin_cfg *cfg, hda_nid_t nid)
2199 +static int is_nid_out_jack_pin(struct auto_pin_cfg *cfg, hda_nid_t nid)
2200 {
2201 int i;
2202 for (i = 0; i < cfg->hp_outs; i++)
2203 if (cfg->hp_pins[i] == nid)
2204 return 1; /* nid is a HP-Out */
2205 -
2206 + for (i = 0; i < cfg->line_outs; i++)
2207 + if (cfg->line_out_pins[i] == nid)
2208 + return 1; /* nid is a line-Out */
2209 return 0; /* nid is not a HP-Out */
2210 };
2211
2212 @@ -4354,7 +4356,7 @@ static int stac92xx_init(struct hda_codec *codec)
2213 continue;
2214 }
2215
2216 - if (is_nid_hp_pin(cfg, nid))
2217 + if (is_nid_out_jack_pin(cfg, nid))
2218 continue; /* already has an unsol event */
2219
2220 pinctl = snd_hda_codec_read(codec, nid, 0,

  ViewVC Help
Powered by ViewVC 1.1.20