/[linux-patches]/genpatches-2.6/tags/3.0-30/1027_linux-3.0.28.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1027_linux-3.0.28.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (2 years, 8 months ago) by mpagano
File size: 51829 byte(s)
3.0-30 release
1 diff --git a/Makefile b/Makefile
2 index 2996cbf..b18b2b4 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 0
8 -SUBLEVEL = 27
9 +SUBLEVEL = 28
10 EXTRAVERSION =
11 NAME = Sneaky Weasel
12
13 diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
14 index c247de0..1918d76 100644
15 --- a/arch/m68k/mac/config.c
16 +++ b/arch/m68k/mac/config.c
17 @@ -950,6 +950,9 @@ int __init mac_platform_init(void)
18 {
19 u8 *swim_base;
20
21 + if (!MACH_IS_MAC)
22 + return -ENODEV;
23 +
24 /*
25 * Serial devices
26 */
27 diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
28 index 431793e..34baa0e 100644
29 --- a/arch/x86/include/asm/timer.h
30 +++ b/arch/x86/include/asm/timer.h
31 @@ -57,14 +57,10 @@ DECLARE_PER_CPU(unsigned long long, cyc2ns_offset);
32
33 static inline unsigned long long __cycles_2_ns(unsigned long long cyc)
34 {
35 - unsigned long long quot;
36 - unsigned long long rem;
37 int cpu = smp_processor_id();
38 unsigned long long ns = per_cpu(cyc2ns_offset, cpu);
39 - quot = (cyc >> CYC2NS_SCALE_FACTOR);
40 - rem = cyc & ((1ULL << CYC2NS_SCALE_FACTOR) - 1);
41 - ns += quot * per_cpu(cyc2ns, cpu) +
42 - ((rem * per_cpu(cyc2ns, cpu)) >> CYC2NS_SCALE_FACTOR);
43 + ns += mult_frac(cyc, per_cpu(cyc2ns, cpu),
44 + (1UL << CYC2NS_SCALE_FACTOR));
45 return ns;
46 }
47
48 diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
49 index bfc8453..33df6e8 100644
50 --- a/arch/x86/kernel/amd_iommu_init.c
51 +++ b/arch/x86/kernel/amd_iommu_init.c
52 @@ -1031,8 +1031,9 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
53 {
54 int r;
55
56 - if (pci_enable_msi(iommu->dev))
57 - return 1;
58 + r = pci_enable_msi(iommu->dev);
59 + if (r)
60 + return r;
61
62 r = request_threaded_irq(iommu->dev->irq,
63 amd_iommu_int_handler,
64 @@ -1042,24 +1043,33 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
65
66 if (r) {
67 pci_disable_msi(iommu->dev);
68 - return 1;
69 + return r;
70 }
71
72 iommu->int_enabled = true;
73 - iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
74
75 return 0;
76 }
77
78 static int iommu_init_msi(struct amd_iommu *iommu)
79 {
80 + int ret;
81 +
82 if (iommu->int_enabled)
83 - return 0;
84 + goto enable_faults;
85
86 if (pci_find_capability(iommu->dev, PCI_CAP_ID_MSI))
87 - return iommu_setup_msi(iommu);
88 + ret = iommu_setup_msi(iommu);
89 + else
90 + ret = -ENODEV;
91
92 - return 1;
93 + if (ret)
94 + return ret;
95 +
96 +enable_faults:
97 + iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
98 +
99 + return 0;
100 }
101
102 /****************************************************************************
103 diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
104 index 16e9d94..e529339 100644
105 --- a/arch/x86/kernel/apic/io_apic.c
106 +++ b/arch/x86/kernel/apic/io_apic.c
107 @@ -3927,36 +3927,18 @@ int mp_find_ioapic_pin(int ioapic, u32 gsi)
108 static __init int bad_ioapic(unsigned long address)
109 {
110 if (nr_ioapics >= MAX_IO_APICS) {
111 - pr_warn("WARNING: Max # of I/O APICs (%d) exceeded (found %d), skipping\n",
112 - MAX_IO_APICS, nr_ioapics);
113 + printk(KERN_WARNING "WARNING: Max # of I/O APICs (%d) exceeded "
114 + "(found %d), skipping\n", MAX_IO_APICS, nr_ioapics);
115 return 1;
116 }
117 if (!address) {
118 - pr_warn("WARNING: Bogus (zero) I/O APIC address found in table, skipping!\n");
119 + printk(KERN_WARNING "WARNING: Bogus (zero) I/O APIC address"
120 + " found in table, skipping!\n");
121 return 1;
122 }
123 return 0;
124 }
125
126 -static __init int bad_ioapic_register(int idx)
127 -{
128 - union IO_APIC_reg_00 reg_00;
129 - union IO_APIC_reg_01 reg_01;
130 - union IO_APIC_reg_02 reg_02;
131 -
132 - reg_00.raw = io_apic_read(idx, 0);
133 - reg_01.raw = io_apic_read(idx, 1);
134 - reg_02.raw = io_apic_read(idx, 2);
135 -
136 - if (reg_00.raw == -1 && reg_01.raw == -1 && reg_02.raw == -1) {
137 - pr_warn("I/O APIC 0x%x registers return all ones, skipping!\n",
138 - mpc_ioapic_addr(idx));
139 - return 1;
140 - }
141 -
142 - return 0;
143 -}
144 -
145 void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
146 {
147 int idx = 0;
148 @@ -3973,12 +3955,6 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
149 ioapics[idx].mp_config.apicaddr = address;
150
151 set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
152 -
153 - if (bad_ioapic_register(idx)) {
154 - clear_fixmap(FIX_IO_APIC_BASE_0 + idx);
155 - return;
156 - }
157 -
158 ioapics[idx].mp_config.apicid = io_apic_unique_id(id);
159 ioapics[idx].mp_config.apicver = io_apic_get_version(idx);
160
161 @@ -3999,10 +3975,10 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
162 if (gsi_cfg->gsi_end >= gsi_top)
163 gsi_top = gsi_cfg->gsi_end + 1;
164
165 - pr_info("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, GSI %d-%d\n",
166 - idx, mpc_ioapic_id(idx),
167 - mpc_ioapic_ver(idx), mpc_ioapic_addr(idx),
168 - gsi_cfg->gsi_base, gsi_cfg->gsi_end);
169 + printk(KERN_INFO "IOAPIC[%d]: apic_id %d, version %d, address 0x%x, "
170 + "GSI %d-%d\n", idx, mpc_ioapic_id(idx),
171 + mpc_ioapic_ver(idx), mpc_ioapic_addr(idx),
172 + gsi_cfg->gsi_base, gsi_cfg->gsi_end);
173
174 nr_ioapics++;
175 }
176 diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
177 index 5f9ecff..fc1f48d 100644
178 --- a/arch/x86/kernel/kgdb.c
179 +++ b/arch/x86/kernel/kgdb.c
180 @@ -43,6 +43,8 @@
181 #include <linux/smp.h>
182 #include <linux/nmi.h>
183 #include <linux/hw_breakpoint.h>
184 +#include <linux/uaccess.h>
185 +#include <linux/memory.h>
186
187 #include <asm/debugreg.h>
188 #include <asm/apicdef.h>
189 @@ -710,6 +712,64 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip)
190 regs->ip = ip;
191 }
192
193 +int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
194 +{
195 + int err;
196 + char opc[BREAK_INSTR_SIZE];
197 +
198 + bpt->type = BP_BREAKPOINT;
199 + err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
200 + BREAK_INSTR_SIZE);
201 + if (err)
202 + return err;
203 + err = probe_kernel_write((char *)bpt->bpt_addr,
204 + arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE);
205 +#ifdef CONFIG_DEBUG_RODATA
206 + if (!err)
207 + return err;
208 + /*
209 + * It is safe to call text_poke() because normal kernel execution
210 + * is stopped on all cores, so long as the text_mutex is not locked.
211 + */
212 + if (mutex_is_locked(&text_mutex))
213 + return -EBUSY;
214 + text_poke((void *)bpt->bpt_addr, arch_kgdb_ops.gdb_bpt_instr,
215 + BREAK_INSTR_SIZE);
216 + err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE);
217 + if (err)
218 + return err;
219 + if (memcmp(opc, arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE))
220 + return -EINVAL;
221 + bpt->type = BP_POKE_BREAKPOINT;
222 +#endif /* CONFIG_DEBUG_RODATA */
223 + return err;
224 +}
225 +
226 +int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
227 +{
228 +#ifdef CONFIG_DEBUG_RODATA
229 + int err;
230 + char opc[BREAK_INSTR_SIZE];
231 +
232 + if (bpt->type != BP_POKE_BREAKPOINT)
233 + goto knl_write;
234 + /*
235 + * It is safe to call text_poke() because normal kernel execution
236 + * is stopped on all cores, so long as the text_mutex is not locked.
237 + */
238 + if (mutex_is_locked(&text_mutex))
239 + goto knl_write;
240 + text_poke((void *)bpt->bpt_addr, bpt->saved_instr, BREAK_INSTR_SIZE);
241 + err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE);
242 + if (err || memcmp(opc, bpt->saved_instr, BREAK_INSTR_SIZE))
243 + goto knl_write;
244 + return err;
245 +knl_write:
246 +#endif /* CONFIG_DEBUG_RODATA */
247 + return probe_kernel_write((char *)bpt->bpt_addr,
248 + (char *)bpt->saved_instr, BREAK_INSTR_SIZE);
249 +}
250 +
251 struct kgdb_arch arch_kgdb_ops = {
252 /* Breakpoint instruction: */
253 .gdb_bpt_instr = { 0xcc },
254 diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
255 index 63fed52..4406c03 100644
256 --- a/arch/x86/kernel/tsc.c
257 +++ b/arch/x86/kernel/tsc.c
258 @@ -623,7 +623,8 @@ static void set_cyc2ns_scale(unsigned long cpu_khz, int cpu)
259
260 if (cpu_khz) {
261 *scale = (NSEC_PER_MSEC << CYC2NS_SCALE_FACTOR)/cpu_khz;
262 - *offset = ns_now - (tsc_now * *scale >> CYC2NS_SCALE_FACTOR);
263 + *offset = ns_now - mult_frac(tsc_now, *scale,
264 + (1UL << CYC2NS_SCALE_FACTOR));
265 }
266
267 sched_clock_idle_wakeup_event(0);
268 diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
269 index 5671752..5a5b6e4 100644
270 --- a/arch/x86/net/bpf_jit_comp.c
271 +++ b/arch/x86/net/bpf_jit_comp.c
272 @@ -289,7 +289,7 @@ void bpf_jit_compile(struct sk_filter *fp)
273 EMIT2(0x24, K & 0xFF); /* and imm8,%al */
274 } else if (K >= 0xFFFF0000) {
275 EMIT2(0x66, 0x25); /* and imm16,%ax */
276 - EMIT2(K, 2);
277 + EMIT(K, 2);
278 } else {
279 EMIT1_off32(0x25, K); /* and imm32,%eax */
280 }
281 diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
282 index 53f9e68..0473a8f 100644
283 --- a/arch/x86/pci/acpi.c
284 +++ b/arch/x86/pci/acpi.c
285 @@ -54,6 +54,16 @@ static const struct dmi_system_id pci_use_crs_table[] __initconst = {
286 DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
287 },
288 },
289 + /* https://bugzilla.kernel.org/show_bug.cgi?id=42619 */
290 + {
291 + .callback = set_use_crs,
292 + .ident = "MSI MS-7253",
293 + .matches = {
294 + DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
295 + DMI_MATCH(DMI_BOARD_NAME, "MS-7253"),
296 + DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
297 + },
298 + },
299 {}
300 };
301
302 diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
303 index 6f5588e..4c531b4 100644
304 --- a/drivers/acpi/acpica/tbfadt.c
305 +++ b/drivers/acpi/acpica/tbfadt.c
306 @@ -350,10 +350,6 @@ static void acpi_tb_convert_fadt(void)
307 u32 address32;
308 u32 i;
309
310 - /* Update the local FADT table header length */
311 -
312 - acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
313 -
314 /*
315 * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
316 * Later code will always use the X 64-bit field. Also, check for an
317 @@ -395,6 +391,10 @@ static void acpi_tb_convert_fadt(void)
318 acpi_gbl_FADT.boot_flags = 0;
319 }
320
321 + /* Update the local FADT table header length */
322 +
323 + acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
324 +
325 /*
326 * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
327 * generic address structures as necessary. Later code will always use
328 diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
329 index 79cb653..3854df2 100644
330 --- a/drivers/acpi/processor_thermal.c
331 +++ b/drivers/acpi/processor_thermal.c
332 @@ -58,6 +58,27 @@ ACPI_MODULE_NAME("processor_thermal");
333 static DEFINE_PER_CPU(unsigned int, cpufreq_thermal_reduction_pctg);
334 static unsigned int acpi_thermal_cpufreq_is_init = 0;
335
336 +#define reduction_pctg(cpu) \
337 + per_cpu(cpufreq_thermal_reduction_pctg, phys_package_first_cpu(cpu))
338 +
339 +/*
340 + * Emulate "per package data" using per cpu data (which should really be
341 + * provided elsewhere)
342 + *
343 + * Note we can lose a CPU on cpu hotunplug, in this case we forget the state
344 + * temporarily. Fortunately that's not a big issue here (I hope)
345 + */
346 +static int phys_package_first_cpu(int cpu)
347 +{
348 + int i;
349 + int id = topology_physical_package_id(cpu);
350 +
351 + for_each_online_cpu(i)
352 + if (topology_physical_package_id(i) == id)
353 + return i;
354 + return 0;
355 +}
356 +
357 static int cpu_has_cpufreq(unsigned int cpu)
358 {
359 struct cpufreq_policy policy;
360 @@ -77,7 +98,7 @@ static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb,
361
362 max_freq = (
363 policy->cpuinfo.max_freq *
364 - (100 - per_cpu(cpufreq_thermal_reduction_pctg, policy->cpu) * 20)
365 + (100 - reduction_pctg(policy->cpu) * 20)
366 ) / 100;
367
368 cpufreq_verify_within_limits(policy, 0, max_freq);
369 @@ -103,16 +124,28 @@ static int cpufreq_get_cur_state(unsigned int cpu)
370 if (!cpu_has_cpufreq(cpu))
371 return 0;
372
373 - return per_cpu(cpufreq_thermal_reduction_pctg, cpu);
374 + return reduction_pctg(cpu);
375 }
376
377 static int cpufreq_set_cur_state(unsigned int cpu, int state)
378 {
379 + int i;
380 +
381 if (!cpu_has_cpufreq(cpu))
382 return 0;
383
384 - per_cpu(cpufreq_thermal_reduction_pctg, cpu) = state;
385 - cpufreq_update_policy(cpu);
386 + reduction_pctg(cpu) = state;
387 +
388 + /*
389 + * Update all the CPUs in the same package because they all
390 + * contribute to the temperature and often share the same
391 + * frequency.
392 + */
393 + for_each_online_cpu(i) {
394 + if (topology_physical_package_id(i) ==
395 + topology_physical_package_id(cpu))
396 + cpufreq_update_policy(i);
397 + }
398 return 0;
399 }
400
401 @@ -120,10 +153,6 @@ void acpi_thermal_cpufreq_init(void)
402 {
403 int i;
404
405 - for (i = 0; i < nr_cpu_ids; i++)
406 - if (cpu_present(i))
407 - per_cpu(cpufreq_thermal_reduction_pctg, i) = 0;
408 -
409 i = cpufreq_register_notifier(&acpi_thermal_cpufreq_notifier_block,
410 CPUFREQ_POLICY_NOTIFIER);
411 if (!i)
412 diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
413 index 802b61a..a9dcdc7 100644
414 --- a/drivers/gpu/drm/drm_fb_helper.c
415 +++ b/drivers/gpu/drm/drm_fb_helper.c
416 @@ -610,9 +610,13 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
417 return -EINVAL;
418
419 /* Need to resize the fb object !!! */
420 - if (var->bits_per_pixel > fb->bits_per_pixel || var->xres > fb->width || var->yres > fb->height) {
421 + if (var->bits_per_pixel > fb->bits_per_pixel ||
422 + var->xres > fb->width || var->yres > fb->height ||
423 + var->xres_virtual > fb->width || var->yres_virtual > fb->height) {
424 DRM_DEBUG("fb userspace requested width/height/bpp is greater than current fb "
425 - "object %dx%d-%d > %dx%d-%d\n", var->xres, var->yres, var->bits_per_pixel,
426 + "request %dx%d-%d (virtual %dx%d) > %dx%d-%d\n",
427 + var->xres, var->yres, var->bits_per_pixel,
428 + var->xres_virtual, var->yres_virtual,
429 fb->width, fb->height, fb->bits_per_pixel);
430 return -EINVAL;
431 }
432 diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
433 index 2d3e16b..111686a 100644
434 --- a/drivers/gpu/drm/i915/i915_drv.c
435 +++ b/drivers/gpu/drm/i915/i915_drv.c
436 @@ -442,7 +442,9 @@ static int i915_drm_thaw(struct drm_device *dev)
437 drm_irq_install(dev);
438
439 /* Resume the modeset for every activated CRTC */
440 + mutex_lock(&dev->mode_config.mutex);
441 drm_helper_resume_force_mode(dev);
442 + mutex_unlock(&dev->mode_config.mutex);
443
444 if (IS_IRONLAKE_M(dev))
445 ironlake_enable_rc6(dev);
446 diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
447 index 56315cb..b05c256 100644
448 --- a/drivers/gpu/drm/i915/i915_reg.h
449 +++ b/drivers/gpu/drm/i915/i915_reg.h
450 @@ -2274,6 +2274,7 @@
451 #define PIPECONF_DISABLE 0
452 #define PIPECONF_DOUBLE_WIDE (1<<30)
453 #define I965_PIPECONF_ACTIVE (1<<30)
454 +#define PIPECONF_FRAME_START_DELAY_MASK (3<<27)
455 #define PIPECONF_SINGLE_WIDE 0
456 #define PIPECONF_PIPE_UNLOCKED 0
457 #define PIPECONF_PIPE_LOCKED (1<<25)
458 diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
459 index 927442a..e5fa074 100644
460 --- a/drivers/gpu/drm/i915/intel_bios.c
461 +++ b/drivers/gpu/drm/i915/intel_bios.c
462 @@ -24,6 +24,7 @@
463 * Eric Anholt <eric@anholt.net>
464 *
465 */
466 +#include <linux/dmi.h>
467 #include <drm/drm_dp_helper.h>
468 #include "drmP.h"
469 #include "drm.h"
470 @@ -592,6 +593,26 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
471 dev_priv->edp.bpp = 18;
472 }
473
474 +static int __init intel_no_opregion_vbt_callback(const struct dmi_system_id *id)
475 +{
476 + DRM_DEBUG_KMS("Falling back to manually reading VBT from "
477 + "VBIOS ROM for %s\n",
478 + id->ident);
479 + return 1;
480 +}
481 +
482 +static const struct dmi_system_id intel_no_opregion_vbt[] = {
483 + {
484 + .callback = intel_no_opregion_vbt_callback,
485 + .ident = "ThinkCentre A57",
486 + .matches = {
487 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
488 + DMI_MATCH(DMI_PRODUCT_NAME, "97027RG"),
489 + },
490 + },
491 + { }
492 +};
493 +
494 /**
495 * intel_parse_bios - find VBT and initialize settings from the BIOS
496 * @dev: DRM device
497 @@ -612,7 +633,7 @@ intel_parse_bios(struct drm_device *dev)
498 init_vbt_defaults(dev_priv);
499
500 /* XXX Should this validation be moved to intel_opregion.c? */
501 - if (dev_priv->opregion.vbt) {
502 + if (!dmi_check_system(intel_no_opregion_vbt) && dev_priv->opregion.vbt) {
503 struct vbt_header *vbt = dev_priv->opregion.vbt;
504 if (memcmp(vbt->signature, "$VBT", 4) == 0) {
505 DRM_DEBUG_DRIVER("Using VBT from OpRegion: %20s\n",
506 diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
507 index 57f9043..f150a15 100644
508 --- a/drivers/gpu/drm/i915/intel_display.c
509 +++ b/drivers/gpu/drm/i915/intel_display.c
510 @@ -6580,6 +6580,12 @@ static void intel_sanitize_modesetting(struct drm_device *dev,
511 struct drm_i915_private *dev_priv = dev->dev_private;
512 u32 reg, val;
513
514 + /* Clear any frame start delays used for debugging left by the BIOS */
515 + for_each_pipe(pipe) {
516 + reg = PIPECONF(pipe);
517 + I915_WRITE(reg, I915_READ(reg) & ~PIPECONF_FRAME_START_DELAY_MASK);
518 + }
519 +
520 if (HAS_PCH_SPLIT(dev))
521 return;
522
523 diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
524 index 21257f8..ff85a91 100644
525 --- a/drivers/gpu/drm/i915/intel_lvds.c
526 +++ b/drivers/gpu/drm/i915/intel_lvds.c
527 @@ -743,6 +743,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
528 DMI_MATCH(DMI_PRODUCT_NAME, "EB1007"),
529 },
530 },
531 + {
532 + .callback = intel_no_lvds_dmi_callback,
533 + .ident = "MSI Wind Box DC500",
534 + .matches = {
535 + DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
536 + DMI_MATCH(DMI_BOARD_NAME, "MS-7469"),
537 + },
538 + },
539
540 { } /* terminating entry */
541 };
542 diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
543 index 9a0aee2..88661ea 100644
544 --- a/drivers/gpu/drm/radeon/atom.c
545 +++ b/drivers/gpu/drm/radeon/atom.c
546 @@ -1301,8 +1301,11 @@ struct atom_context *atom_parse(struct card_info *card, void *bios)
547
548 int atom_asic_init(struct atom_context *ctx)
549 {
550 + struct radeon_device *rdev = ctx->card->dev->dev_private;
551 int hwi = CU16(ctx->data_table + ATOM_DATA_FWI_PTR);
552 uint32_t ps[16];
553 + int ret;
554 +
555 memset(ps, 0, 64);
556
557 ps[0] = cpu_to_le32(CU32(hwi + ATOM_FWI_DEFSCLK_PTR));
558 @@ -1312,7 +1315,17 @@ int atom_asic_init(struct atom_context *ctx)
559
560 if (!CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_INIT))
561 return 1;
562 - return atom_execute_table(ctx, ATOM_CMD_INIT, ps);
563 + ret = atom_execute_table(ctx, ATOM_CMD_INIT, ps);
564 + if (ret)
565 + return ret;
566 +
567 + memset(ps, 0, 64);
568 +
569 + if (rdev->family < CHIP_R600) {
570 + if (CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_SPDFANCNTL))
571 + atom_execute_table(ctx, ATOM_CMD_SPDFANCNTL, ps);
572 + }
573 + return ret;
574 }
575
576 void atom_destroy(struct atom_context *ctx)
577 diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h
578 index 93cfe20..25fea63 100644
579 --- a/drivers/gpu/drm/radeon/atom.h
580 +++ b/drivers/gpu/drm/radeon/atom.h
581 @@ -44,6 +44,7 @@
582 #define ATOM_CMD_SETSCLK 0x0A
583 #define ATOM_CMD_SETMCLK 0x0B
584 #define ATOM_CMD_SETPCLK 0x0C
585 +#define ATOM_CMD_SPDFANCNTL 0x39
586
587 #define ATOM_DATA_FWI_PTR 0xC
588 #define ATOM_DATA_IIO_PTR 0x32
589 diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
590 index eb3b5f8..b0563b6 100644
591 --- a/drivers/mfd/twl6030-irq.c
592 +++ b/drivers/mfd/twl6030-irq.c
593 @@ -145,8 +145,17 @@ static int twl6030_irq_thread(void *data)
594 }
595 local_irq_enable();
596 }
597 - ret = twl_i2c_write(TWL_MODULE_PIH, sts.bytes,
598 - REG_INT_STS_A, 3); /* clear INT_STS_A */
599 +
600 + /*
601 + * NOTE:
602 + * Simulation confirms that documentation is wrong w.r.t the
603 + * interrupt status clear operation. A single *byte* write to
604 + * any one of STS_A to STS_C register results in all three
605 + * STS registers being reset. Since it does not matter which
606 + * value is written, all three registers are cleared on a
607 + * single byte write, so we just use 0x0 to clear.
608 + */
609 + ret = twl_i2c_write_u8(TWL_MODULE_PIH, 0x00, REG_INT_STS_A);
610 if (ret)
611 pr_warning("twl6030: I2C error in clearing PIH ISR\n");
612
613 diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c
614 index 8cebec5..cdefef2 100644
615 --- a/drivers/misc/kgdbts.c
616 +++ b/drivers/misc/kgdbts.c
617 @@ -133,12 +133,17 @@ static int force_hwbrks;
618 static int hwbreaks_ok;
619 static int hw_break_val;
620 static int hw_break_val2;
621 +static int cont_instead_of_sstep;
622 +static unsigned long cont_thread_id;
623 +static unsigned long sstep_thread_id;
624 #if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || defined(CONFIG_SPARC)
625 static int arch_needs_sstep_emulation = 1;
626 #else
627 static int arch_needs_sstep_emulation;
628 #endif
629 +static unsigned long cont_addr;
630 static unsigned long sstep_addr;
631 +static int restart_from_top_after_write;
632 static int sstep_state;
633
634 /* Storage for the registers, in GDB format. */
635 @@ -186,7 +191,8 @@ static int kgdbts_unreg_thread(void *ptr)
636 */
637 while (!final_ack)
638 msleep_interruptible(1500);
639 -
640 + /* Pause for any other threads to exit after final ack. */
641 + msleep_interruptible(1000);
642 if (configured)
643 kgdb_unregister_io_module(&kgdbts_io_ops);
644 configured = 0;
645 @@ -210,7 +216,7 @@ static unsigned long lookup_addr(char *arg)
646 if (!strcmp(arg, "kgdbts_break_test"))
647 addr = (unsigned long)kgdbts_break_test;
648 else if (!strcmp(arg, "sys_open"))
649 - addr = (unsigned long)sys_open;
650 + addr = (unsigned long)do_sys_open;
651 else if (!strcmp(arg, "do_fork"))
652 addr = (unsigned long)do_fork;
653 else if (!strcmp(arg, "hw_break_val"))
654 @@ -282,6 +288,16 @@ static void hw_break_val_write(void)
655 hw_break_val++;
656 }
657
658 +static int get_thread_id_continue(char *put_str, char *arg)
659 +{
660 + char *ptr = &put_str[11];
661 +
662 + if (put_str[1] != 'T' || put_str[2] != '0')
663 + return 1;
664 + kgdb_hex2long(&ptr, &cont_thread_id);
665 + return 0;
666 +}
667 +
668 static int check_and_rewind_pc(char *put_str, char *arg)
669 {
670 unsigned long addr = lookup_addr(arg);
671 @@ -298,13 +314,21 @@ static int check_and_rewind_pc(char *put_str, char *arg)
672 if (addr + BREAK_INSTR_SIZE == ip)
673 offset = -BREAK_INSTR_SIZE;
674 #endif
675 - if (strcmp(arg, "silent") && ip + offset != addr) {
676 +
677 + if (arch_needs_sstep_emulation && sstep_addr &&
678 + ip + offset == sstep_addr &&
679 + ((!strcmp(arg, "sys_open") || !strcmp(arg, "do_fork")))) {
680 + /* This is special case for emulated single step */
681 + v2printk("Emul: rewind hit single step bp\n");
682 + restart_from_top_after_write = 1;
683 + } else if (strcmp(arg, "silent") && ip + offset != addr) {
684 eprintk("kgdbts: BP mismatch %lx expected %lx\n",
685 ip + offset, addr);
686 return 1;
687 }
688 /* Readjust the instruction pointer if needed */
689 ip += offset;
690 + cont_addr = ip;
691 #ifdef GDB_ADJUSTS_BREAK_OFFSET
692 instruction_pointer_set(&kgdbts_regs, ip);
693 #endif
694 @@ -314,6 +338,8 @@ static int check_and_rewind_pc(char *put_str, char *arg)
695 static int check_single_step(char *put_str, char *arg)
696 {
697 unsigned long addr = lookup_addr(arg);
698 + static int matched_id;
699 +
700 /*
701 * From an arch indepent point of view the instruction pointer
702 * should be on a different instruction
703 @@ -323,6 +349,29 @@ static int check_single_step(char *put_str, char *arg)
704 gdb_regs_to_pt_regs(kgdbts_gdb_regs, &kgdbts_regs);
705 v2printk("Singlestep stopped at IP: %lx\n",
706 instruction_pointer(&kgdbts_regs));
707 +
708 + if (sstep_thread_id != cont_thread_id) {
709 + /*
710 + * Ensure we stopped in the same thread id as before, else the
711 + * debugger should continue until the original thread that was
712 + * single stepped is scheduled again, emulating gdb's behavior.
713 + */
714 + v2printk("ThrID does not match: %lx\n", cont_thread_id);
715 + if (arch_needs_sstep_emulation) {
716 + if (matched_id &&
717 + instruction_pointer(&kgdbts_regs) != addr)
718 + goto continue_test;
719 + matched_id++;
720 + ts.idx -= 2;
721 + sstep_state = 0;
722 + return 0;
723 + }
724 + cont_instead_of_sstep = 1;
725 + ts.idx -= 4;
726 + return 0;
727 + }
728 +continue_test:
729 + matched_id = 0;
730 if (instruction_pointer(&kgdbts_regs) == addr) {
731 eprintk("kgdbts: SingleStep failed at %lx\n",
732 instruction_pointer(&kgdbts_regs));
733 @@ -364,10 +413,40 @@ static int got_break(char *put_str, char *arg)
734 return 1;
735 }
736
737 +static void get_cont_catch(char *arg)
738 +{
739 + /* Always send detach because the test is completed at this point */
740 + fill_get_buf("D");
741 +}
742 +
743 +static int put_cont_catch(char *put_str, char *arg)
744 +{
745 + /* This is at the end of the test and we catch any and all input */
746 + v2printk("kgdbts: cleanup task: %lx\n", sstep_thread_id);
747 + ts.idx--;
748 + return 0;
749 +}
750 +
751 +static int emul_reset(char *put_str, char *arg)
752 +{
753 + if (strncmp(put_str, "$OK", 3))
754 + return 1;
755 + if (restart_from_top_after_write) {
756 + restart_from_top_after_write = 0;
757 + ts.idx = -1;
758 + }
759 + return 0;
760 +}
761 +
762 static void emul_sstep_get(char *arg)
763 {
764 if (!arch_needs_sstep_emulation) {
765 - fill_get_buf(arg);
766 + if (cont_instead_of_sstep) {
767 + cont_instead_of_sstep = 0;
768 + fill_get_buf("c");
769 + } else {
770 + fill_get_buf(arg);
771 + }
772 return;
773 }
774 switch (sstep_state) {
775 @@ -397,9 +476,11 @@ static void emul_sstep_get(char *arg)
776 static int emul_sstep_put(char *put_str, char *arg)
777 {
778 if (!arch_needs_sstep_emulation) {
779 - if (!strncmp(put_str+1, arg, 2))
780 - return 0;
781 - return 1;
782 + char *ptr = &put_str[11];
783 + if (put_str[1] != 'T' || put_str[2] != '0')
784 + return 1;
785 + kgdb_hex2long(&ptr, &sstep_thread_id);
786 + return 0;
787 }
788 switch (sstep_state) {
789 case 1:
790 @@ -410,8 +491,7 @@ static int emul_sstep_put(char *put_str, char *arg)
791 v2printk("Stopped at IP: %lx\n",
792 instruction_pointer(&kgdbts_regs));
793 /* Want to stop at IP + break instruction size by default */
794 - sstep_addr = instruction_pointer(&kgdbts_regs) +
795 - BREAK_INSTR_SIZE;
796 + sstep_addr = cont_addr + BREAK_INSTR_SIZE;
797 break;
798 case 2:
799 if (strncmp(put_str, "$OK", 3)) {
800 @@ -423,6 +503,9 @@ static int emul_sstep_put(char *put_str, char *arg)
801 if (strncmp(put_str, "$T0", 3)) {
802 eprintk("kgdbts: failed continue sstep\n");
803 return 1;
804 + } else {
805 + char *ptr = &put_str[11];
806 + kgdb_hex2long(&ptr, &sstep_thread_id);
807 }
808 break;
809 case 4:
810 @@ -501,10 +584,10 @@ static struct test_struct bad_read_test[] = {
811 static struct test_struct singlestep_break_test[] = {
812 { "?", "S0*" }, /* Clear break points */
813 { "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */
814 - { "c", "T0*", }, /* Continue */
815 + { "c", "T0*", NULL, get_thread_id_continue }, /* Continue */
816 + { "kgdbts_break_test", "OK", sw_rem_break }, /*remove breakpoint */
817 { "g", "kgdbts_break_test", NULL, check_and_rewind_pc },
818 { "write", "OK", write_regs }, /* Write registers */
819 - { "kgdbts_break_test", "OK", sw_rem_break }, /*remove breakpoint */
820 { "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
821 { "g", "kgdbts_break_test", NULL, check_single_step },
822 { "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */
823 @@ -522,16 +605,16 @@ static struct test_struct singlestep_break_test[] = {
824 static struct test_struct do_fork_test[] = {
825 { "?", "S0*" }, /* Clear break points */
826 { "do_fork", "OK", sw_break, }, /* set sw breakpoint */
827 - { "c", "T0*", }, /* Continue */
828 - { "g", "do_fork", NULL, check_and_rewind_pc }, /* check location */
829 - { "write", "OK", write_regs }, /* Write registers */
830 + { "c", "T0*", NULL, get_thread_id_continue }, /* Continue */
831 { "do_fork", "OK", sw_rem_break }, /*remove breakpoint */
832 + { "g", "do_fork", NULL, check_and_rewind_pc }, /* check location */
833 + { "write", "OK", write_regs, emul_reset }, /* Write registers */
834 { "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
835 { "g", "do_fork", NULL, check_single_step },
836 { "do_fork", "OK", sw_break, }, /* set sw breakpoint */
837 { "7", "T0*", skip_back_repeat_test }, /* Loop based on repeat_test */
838 { "D", "OK", NULL, final_ack_set }, /* detach and unregister I/O */
839 - { "", "" },
840 + { "", "", get_cont_catch, put_cont_catch },
841 };
842
843 /* Test for hitting a breakpoint at sys_open for what ever the number
844 @@ -540,16 +623,16 @@ static struct test_struct do_fork_test[] = {
845 static struct test_struct sys_open_test[] = {
846 { "?", "S0*" }, /* Clear break points */
847 { "sys_open", "OK", sw_break, }, /* set sw breakpoint */
848 - { "c", "T0*", }, /* Continue */
849 - { "g", "sys_open", NULL, check_and_rewind_pc }, /* check location */
850 - { "write", "OK", write_regs }, /* Write registers */
851 + { "c", "T0*", NULL, get_thread_id_continue }, /* Continue */
852 { "sys_open", "OK", sw_rem_break }, /*remove breakpoint */
853 + { "g", "sys_open", NULL, check_and_rewind_pc }, /* check location */
854 + { "write", "OK", write_regs, emul_reset }, /* Write registers */
855 { "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
856 { "g", "sys_open", NULL, check_single_step },
857 { "sys_open", "OK", sw_break, }, /* set sw breakpoint */
858 { "7", "T0*", skip_back_repeat_test }, /* Loop based on repeat_test */
859 { "D", "OK", NULL, final_ack_set }, /* detach and unregister I/O */
860 - { "", "" },
861 + { "", "", get_cont_catch, put_cont_catch },
862 };
863
864 /*
865 @@ -692,8 +775,8 @@ static int run_simple_test(int is_get_char, int chr)
866 /* This callback is a put char which is when kgdb sends data to
867 * this I/O module.
868 */
869 - if (ts.tst[ts.idx].get[0] == '\0' &&
870 - ts.tst[ts.idx].put[0] == '\0') {
871 + if (ts.tst[ts.idx].get[0] == '\0' && ts.tst[ts.idx].put[0] == '\0' &&
872 + !ts.tst[ts.idx].get_handler) {
873 eprintk("kgdbts: ERROR: beyond end of test on"
874 " '%s' line %i\n", ts.name, ts.idx);
875 return 0;
876 @@ -906,6 +989,17 @@ static void kgdbts_run_tests(void)
877 if (ptr)
878 sstep_test = simple_strtol(ptr+1, NULL, 10);
879
880 + /* All HW break point tests */
881 + if (arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT) {
882 + hwbreaks_ok = 1;
883 + v1printk("kgdbts:RUN hw breakpoint test\n");
884 + run_breakpoint_test(1);
885 + v1printk("kgdbts:RUN hw write breakpoint test\n");
886 + run_hw_break_test(1);
887 + v1printk("kgdbts:RUN access write breakpoint test\n");
888 + run_hw_break_test(0);
889 + }
890 +
891 /* required internal KGDB tests */
892 v1printk("kgdbts:RUN plant and detach test\n");
893 run_plant_and_detach_test(0);
894 @@ -923,35 +1017,11 @@ static void kgdbts_run_tests(void)
895
896 /* ===Optional tests=== */
897
898 - /* All HW break point tests */
899 - if (arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT) {
900 - hwbreaks_ok = 1;
901 - v1printk("kgdbts:RUN hw breakpoint test\n");
902 - run_breakpoint_test(1);
903 - v1printk("kgdbts:RUN hw write breakpoint test\n");
904 - run_hw_break_test(1);
905 - v1printk("kgdbts:RUN access write breakpoint test\n");
906 - run_hw_break_test(0);
907 - }
908 -
909 if (nmi_sleep) {
910 v1printk("kgdbts:RUN NMI sleep %i seconds test\n", nmi_sleep);
911 run_nmi_sleep_test(nmi_sleep);
912 }
913
914 -#ifdef CONFIG_DEBUG_RODATA
915 - /* Until there is an api to write to read-only text segments, use
916 - * HW breakpoints for the remainder of any tests, else print a
917 - * failure message if hw breakpoints do not work.
918 - */
919 - if (!(arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT && hwbreaks_ok)) {
920 - eprintk("kgdbts: HW breakpoints do not work,"
921 - "skipping remaining tests\n");
922 - return;
923 - }
924 - force_hwbrks = 1;
925 -#endif /* CONFIG_DEBUG_RODATA */
926 -
927 /* If the do_fork test is run it will be the last test that is
928 * executed because a kernel thread will be spawned at the very
929 * end to unregister the debug hooks.
930 diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
931 index aa8039f..b6cd386 100644
932 --- a/drivers/mmc/host/atmel-mci.c
933 +++ b/drivers/mmc/host/atmel-mci.c
934 @@ -468,7 +468,14 @@ err:
935 static inline unsigned int ns_to_clocks(struct atmel_mci *host,
936 unsigned int ns)
937 {
938 - return (ns * (host->bus_hz / 1000000) + 999) / 1000;
939 + /*
940 + * It is easier here to use us instead of ns for the timeout,
941 + * it prevents from overflows during calculation.
942 + */
943 + unsigned int us = DIV_ROUND_UP(ns, 1000);
944 +
945 + /* Maximum clock frequency is host->bus_hz/2 */
946 + return us * (DIV_ROUND_UP(host->bus_hz, 2000000));
947 }
948
949 static void atmci_set_timeout(struct atmel_mci *host,
950 diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
951 index b78f231..8cd983c 100644
952 --- a/drivers/mtd/devices/block2mtd.c
953 +++ b/drivers/mtd/devices/block2mtd.c
954 @@ -284,6 +284,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size)
955 dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
956 dev->mtd.erasesize = erase_size;
957 dev->mtd.writesize = 1;
958 + dev->mtd.writebufsize = PAGE_SIZE;
959 dev->mtd.type = MTD_RAM;
960 dev->mtd.flags = MTD_CAP_RAM;
961 dev->mtd.erase = block2mtd_erase;
962 diff --git a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c
963 index 772a0ff..09d5b5a 100644
964 --- a/drivers/mtd/devices/lart.c
965 +++ b/drivers/mtd/devices/lart.c
966 @@ -636,6 +636,7 @@ static int __init lart_flash_init (void)
967 mtd.name = module_name;
968 mtd.type = MTD_NORFLASH;
969 mtd.writesize = 1;
970 + mtd.writebufsize = 4;
971 mtd.flags = MTD_CAP_NORFLASH;
972 mtd.size = FLASH_BLOCKSIZE_PARAM * FLASH_NUMBLOCKS_16m_PARAM + FLASH_BLOCKSIZE_MAIN * FLASH_NUMBLOCKS_16m_MAIN;
973 mtd.erasesize = FLASH_BLOCKSIZE_MAIN;
974 diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
975 index 35180e4..9fad104d 100644
976 --- a/drivers/mtd/devices/m25p80.c
977 +++ b/drivers/mtd/devices/m25p80.c
978 @@ -930,6 +930,7 @@ static int __devinit m25p_probe(struct spi_device *spi)
979
980 flash->mtd.dev.parent = &spi->dev;
981 flash->page_size = info->page_size;
982 + flash->mtd.writebufsize = flash->page_size;
983
984 if (info->addr_width)
985 flash->addr_width = info->addr_width;
986 diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c
987 index 1e2c430..867710a 100644
988 --- a/drivers/mtd/devices/sst25l.c
989 +++ b/drivers/mtd/devices/sst25l.c
990 @@ -406,6 +406,7 @@ static int __devinit sst25l_probe(struct spi_device *spi)
991 flash->mtd.flags = MTD_CAP_NORFLASH;
992 flash->mtd.erasesize = flash_info->erase_size;
993 flash->mtd.writesize = flash_info->page_size;
994 + flash->mtd.writebufsize = flash_info->page_size;
995 flash->mtd.size = flash_info->page_size * flash_info->nr_pages;
996 flash->mtd.erase = sst25l_erase;
997 flash->mtd.read = sst25l_read;
998 diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
999 index 882f53f..82d43b2 100644
1000 --- a/drivers/net/usb/cdc_eem.c
1001 +++ b/drivers/net/usb/cdc_eem.c
1002 @@ -93,6 +93,7 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf)
1003 /* no jumbogram (16K) support for now */
1004
1005 dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN;
1006 + dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
1007
1008 return 0;
1009 }
1010 diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c
1011 index 246b3bb..c1e6a44 100644
1012 --- a/drivers/net/usb/zaurus.c
1013 +++ b/drivers/net/usb/zaurus.c
1014 @@ -332,6 +332,11 @@ static const struct usb_device_id products [] = {
1015 .driver_info = ZAURUS_PXA_INFO,
1016 },
1017 {
1018 + /* Motorola Rokr E6 */
1019 + USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6027, USB_CLASS_COMM,
1020 + USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
1021 + .driver_info = (unsigned long) &bogus_mdlm_info,
1022 +}, {
1023 /* Motorola MOTOMAGX phones */
1024 USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM,
1025 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
1026 diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
1027 index db9b25a..2080b22 100644
1028 --- a/drivers/platform/x86/acer-wmi.c
1029 +++ b/drivers/platform/x86/acer-wmi.c
1030 @@ -689,6 +689,7 @@ static const struct acpi_device_id norfkill_ids[] = {
1031 { "VPC2004", 0},
1032 { "IBM0068", 0},
1033 { "LEN0068", 0},
1034 + { "SNY5001", 0}, /* sony-laptop in charge */
1035 { "", 0},
1036 };
1037
1038 diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
1039 index ca84d50..5f44b55 100644
1040 --- a/drivers/pnp/pnpacpi/core.c
1041 +++ b/drivers/pnp/pnpacpi/core.c
1042 @@ -320,9 +320,14 @@ static int __init acpi_pnp_match(struct device *dev, void *_pnp)
1043 {
1044 struct acpi_device *acpi = to_acpi_device(dev);
1045 struct pnp_dev *pnp = _pnp;
1046 + struct device *physical_device;
1047 +
1048 + physical_device = acpi_get_physical_device(acpi->handle);
1049 + if (physical_device)
1050 + put_device(physical_device);
1051
1052 /* true means it matched */
1053 - return !acpi_get_physical_device(acpi->handle)
1054 + return !physical_device
1055 && compare_pnp_id(pnp->id, acpi_device_hid(acpi));
1056 }
1057
1058 diff --git a/include/linux/kernel.h b/include/linux/kernel.h
1059 index 953352a..3a3925d 100644
1060 --- a/include/linux/kernel.h
1061 +++ b/include/linux/kernel.h
1062 @@ -77,6 +77,19 @@
1063 } \
1064 )
1065
1066 +/*
1067 + * Multiplies an integer by a fraction, while avoiding unnecessary
1068 + * overflow or loss of precision.
1069 + */
1070 +#define mult_frac(x, numer, denom)( \
1071 +{ \
1072 + typeof(x) quot = (x) / (denom); \
1073 + typeof(x) rem = (x) % (denom); \
1074 + (quot * (numer)) + ((rem * (numer)) / (denom)); \
1075 +} \
1076 +)
1077 +
1078 +
1079 #define _RET_IP_ (unsigned long)__builtin_return_address(0)
1080 #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
1081
1082 diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
1083 index 10ca03d..f7192fb 100644
1084 --- a/include/linux/kgdb.h
1085 +++ b/include/linux/kgdb.h
1086 @@ -63,7 +63,8 @@ enum kgdb_bptype {
1087 BP_HARDWARE_BREAKPOINT,
1088 BP_WRITE_WATCHPOINT,
1089 BP_READ_WATCHPOINT,
1090 - BP_ACCESS_WATCHPOINT
1091 + BP_ACCESS_WATCHPOINT,
1092 + BP_POKE_BREAKPOINT,
1093 };
1094
1095 enum kgdb_bpstate {
1096 @@ -207,8 +208,8 @@ extern void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc);
1097
1098 /* Optional functions. */
1099 extern int kgdb_validate_break_address(unsigned long addr);
1100 -extern int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr);
1101 -extern int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle);
1102 +extern int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt);
1103 +extern int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt);
1104
1105 /**
1106 * kgdb_arch_late - Perform any architecture specific initalization.
1107 diff --git a/kernel/cred.c b/kernel/cred.c
1108 index 174fa84..3a55ea4 100644
1109 --- a/kernel/cred.c
1110 +++ b/kernel/cred.c
1111 @@ -385,6 +385,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)
1112 struct cred *new;
1113 int ret;
1114
1115 + p->replacement_session_keyring = NULL;
1116 +
1117 if (
1118 #ifdef CONFIG_KEYS
1119 !p->cred->thread_keyring &&
1120 diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
1121 index bad6786..5ee24d1 100644
1122 --- a/kernel/debug/debug_core.c
1123 +++ b/kernel/debug/debug_core.c
1124 @@ -157,37 +157,39 @@ early_param("nokgdbroundup", opt_nokgdbroundup);
1125 * Weak aliases for breakpoint management,
1126 * can be overriden by architectures when needed:
1127 */
1128 -int __weak kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr)
1129 +int __weak kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
1130 {
1131 int err;
1132
1133 - err = probe_kernel_read(saved_instr, (char *)addr, BREAK_INSTR_SIZE);
1134 + err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
1135 + BREAK_INSTR_SIZE);
1136 if (err)
1137 return err;
1138 -
1139 - return probe_kernel_write((char *)addr, arch_kgdb_ops.gdb_bpt_instr,
1140 - BREAK_INSTR_SIZE);
1141 + err = probe_kernel_write((char *)bpt->bpt_addr,
1142 + arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE);
1143 + return err;
1144 }
1145
1146 -int __weak kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle)
1147 +int __weak kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
1148 {
1149 - return probe_kernel_write((char *)addr,
1150 - (char *)bundle, BREAK_INSTR_SIZE);
1151 + return probe_kernel_write((char *)bpt->bpt_addr,
1152 + (char *)bpt->saved_instr, BREAK_INSTR_SIZE);
1153 }
1154
1155 int __weak kgdb_validate_break_address(unsigned long addr)
1156 {
1157 - char tmp_variable[BREAK_INSTR_SIZE];
1158 + struct kgdb_bkpt tmp;
1159 int err;
1160 - /* Validate setting the breakpoint and then removing it. In the
1161 + /* Validate setting the breakpoint and then removing it. If the
1162 * remove fails, the kernel needs to emit a bad message because we
1163 * are deep trouble not being able to put things back the way we
1164 * found them.
1165 */
1166 - err = kgdb_arch_set_breakpoint(addr, tmp_variable);
1167 + tmp.bpt_addr = addr;
1168 + err = kgdb_arch_set_breakpoint(&tmp);
1169 if (err)
1170 return err;
1171 - err = kgdb_arch_remove_breakpoint(addr, tmp_variable);
1172 + err = kgdb_arch_remove_breakpoint(&tmp);
1173 if (err)
1174 printk(KERN_ERR "KGDB: Critical breakpoint error, kernel "
1175 "memory destroyed at: %lx", addr);
1176 @@ -231,7 +233,6 @@ static void kgdb_flush_swbreak_addr(unsigned long addr)
1177 */
1178 int dbg_activate_sw_breakpoints(void)
1179 {
1180 - unsigned long addr;
1181 int error;
1182 int ret = 0;
1183 int i;
1184 @@ -240,16 +241,15 @@ int dbg_activate_sw_breakpoints(void)
1185 if (kgdb_break[i].state != BP_SET)
1186 continue;
1187
1188 - addr = kgdb_break[i].bpt_addr;
1189 - error = kgdb_arch_set_breakpoint(addr,
1190 - kgdb_break[i].saved_instr);
1191 + error = kgdb_arch_set_breakpoint(&kgdb_break[i]);
1192 if (error) {
1193 ret = error;
1194 - printk(KERN_INFO "KGDB: BP install failed: %lx", addr);
1195 + printk(KERN_INFO "KGDB: BP install failed: %lx",
1196 + kgdb_break[i].bpt_addr);
1197 continue;
1198 }
1199
1200 - kgdb_flush_swbreak_addr(addr);
1201 + kgdb_flush_swbreak_addr(kgdb_break[i].bpt_addr);
1202 kgdb_break[i].state = BP_ACTIVE;
1203 }
1204 return ret;
1205 @@ -298,7 +298,6 @@ int dbg_set_sw_break(unsigned long addr)
1206
1207 int dbg_deactivate_sw_breakpoints(void)
1208 {
1209 - unsigned long addr;
1210 int error;
1211 int ret = 0;
1212 int i;
1213 @@ -306,15 +305,14 @@ int dbg_deactivate_sw_breakpoints(void)
1214 for (i = 0; i < KGDB_MAX_BREAKPOINTS; i++) {
1215 if (kgdb_break[i].state != BP_ACTIVE)
1216 continue;
1217 - addr = kgdb_break[i].bpt_addr;
1218 - error = kgdb_arch_remove_breakpoint(addr,
1219 - kgdb_break[i].saved_instr);
1220 + error = kgdb_arch_remove_breakpoint(&kgdb_break[i]);
1221 if (error) {
1222 - printk(KERN_INFO "KGDB: BP remove failed: %lx\n", addr);
1223 + printk(KERN_INFO "KGDB: BP remove failed: %lx\n",
1224 + kgdb_break[i].bpt_addr);
1225 ret = error;
1226 }
1227
1228 - kgdb_flush_swbreak_addr(addr);
1229 + kgdb_flush_swbreak_addr(kgdb_break[i].bpt_addr);
1230 kgdb_break[i].state = BP_SET;
1231 }
1232 return ret;
1233 @@ -348,7 +346,6 @@ int kgdb_isremovedbreak(unsigned long addr)
1234
1235 int dbg_remove_all_break(void)
1236 {
1237 - unsigned long addr;
1238 int error;
1239 int i;
1240
1241 @@ -356,12 +353,10 @@ int dbg_remove_all_break(void)
1242 for (i = 0; i < KGDB_MAX_BREAKPOINTS; i++) {
1243 if (kgdb_break[i].state != BP_ACTIVE)
1244 goto setundefined;
1245 - addr = kgdb_break[i].bpt_addr;
1246 - error = kgdb_arch_remove_breakpoint(addr,
1247 - kgdb_break[i].saved_instr);
1248 + error = kgdb_arch_remove_breakpoint(&kgdb_break[i]);
1249 if (error)
1250 printk(KERN_ERR "KGDB: breakpoint remove failed: %lx\n",
1251 - addr);
1252 + kgdb_break[i].bpt_addr);
1253 setundefined:
1254 kgdb_break[i].state = BP_UNDEFINED;
1255 }
1256 diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c
1257 index 4742090..c3c8975 100644
1258 --- a/kernel/irq/migration.c
1259 +++ b/kernel/irq/migration.c
1260 @@ -43,12 +43,16 @@ void irq_move_masked_irq(struct irq_data *idata)
1261 * masking the irqs.
1262 */
1263 if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask)
1264 - < nr_cpu_ids))
1265 - if (!chip->irq_set_affinity(&desc->irq_data,
1266 - desc->pending_mask, false)) {
1267 + < nr_cpu_ids)) {
1268 + int ret = chip->irq_set_affinity(&desc->irq_data,
1269 + desc->pending_mask, false);
1270 + switch (ret) {
1271 + case IRQ_SET_MASK_OK:
1272 cpumask_copy(desc->irq_data.affinity, desc->pending_mask);
1273 + case IRQ_SET_MASK_OK_NOCOPY:
1274 irq_set_thread_affinity(desc);
1275 }
1276 + }
1277
1278 cpumask_clear(desc->pending_mask);
1279 }
1280 diff --git a/kernel/sysctl.c b/kernel/sysctl.c
1281 index f175d98..aaaa7e7 100644
1282 --- a/kernel/sysctl.c
1283 +++ b/kernel/sysctl.c
1284 @@ -172,7 +172,7 @@ static int proc_taint(struct ctl_table *table, int write,
1285 #endif
1286
1287 #ifdef CONFIG_PRINTK
1288 -static int proc_dmesg_restrict(struct ctl_table *table, int write,
1289 +static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
1290 void __user *buffer, size_t *lenp, loff_t *ppos);
1291 #endif
1292
1293 @@ -709,7 +709,7 @@ static struct ctl_table kern_table[] = {
1294 .data = &dmesg_restrict,
1295 .maxlen = sizeof(int),
1296 .mode = 0644,
1297 - .proc_handler = proc_dointvec_minmax,
1298 + .proc_handler = proc_dointvec_minmax_sysadmin,
1299 .extra1 = &zero,
1300 .extra2 = &one,
1301 },
1302 @@ -718,7 +718,7 @@ static struct ctl_table kern_table[] = {
1303 .data = &kptr_restrict,
1304 .maxlen = sizeof(int),
1305 .mode = 0644,
1306 - .proc_handler = proc_dmesg_restrict,
1307 + .proc_handler = proc_dointvec_minmax_sysadmin,
1308 .extra1 = &zero,
1309 .extra2 = &two,
1310 },
1311 @@ -2416,7 +2416,7 @@ static int proc_taint(struct ctl_table *table, int write,
1312 }
1313
1314 #ifdef CONFIG_PRINTK
1315 -static int proc_dmesg_restrict(struct ctl_table *table, int write,
1316 +static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
1317 void __user *buffer, size_t *lenp, loff_t *ppos)
1318 {
1319 if (write && !capable(CAP_SYS_ADMIN))
1320 diff --git a/kernel/trace/trace_entries.h b/kernel/trace/trace_entries.h
1321 index e32744c..1fe81ee 100644
1322 --- a/kernel/trace/trace_entries.h
1323 +++ b/kernel/trace/trace_entries.h
1324 @@ -156,6 +156,12 @@ FTRACE_ENTRY_DUP(wakeup, ctx_switch_entry,
1325
1326 #define FTRACE_STACK_ENTRIES 8
1327
1328 +#ifndef CONFIG_64BIT
1329 +# define IP_FMT "%08lx"
1330 +#else
1331 +# define IP_FMT "%016lx"
1332 +#endif
1333 +
1334 FTRACE_ENTRY(kernel_stack, stack_entry,
1335
1336 TRACE_STACK,
1337 @@ -164,8 +170,9 @@ FTRACE_ENTRY(kernel_stack, stack_entry,
1338 __array( unsigned long, caller, FTRACE_STACK_ENTRIES )
1339 ),
1340
1341 - F_printk("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n"
1342 - "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n",
1343 + F_printk("\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
1344 + "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
1345 + "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n",
1346 __entry->caller[0], __entry->caller[1], __entry->caller[2],
1347 __entry->caller[3], __entry->caller[4], __entry->caller[5],
1348 __entry->caller[6], __entry->caller[7])
1349 @@ -180,8 +187,9 @@ FTRACE_ENTRY(user_stack, userstack_entry,
1350 __array( unsigned long, caller, FTRACE_STACK_ENTRIES )
1351 ),
1352
1353 - F_printk("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n"
1354 - "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n",
1355 + F_printk("\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
1356 + "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
1357 + "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n",
1358 __entry->caller[0], __entry->caller[1], __entry->caller[2],
1359 __entry->caller[3], __entry->caller[4], __entry->caller[5],
1360 __entry->caller[6], __entry->caller[7])
1361 diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
1362 index bbeec31..ad4000c 100644
1363 --- a/kernel/trace/trace_export.c
1364 +++ b/kernel/trace/trace_export.c
1365 @@ -150,7 +150,7 @@ ftrace_define_fields_##name(struct ftrace_event_call *event_call) \
1366 #define __dynamic_array(type, item)
1367
1368 #undef F_printk
1369 -#define F_printk(fmt, args...) #fmt ", " __stringify(args)
1370 +#define F_printk(fmt, args...) __stringify(fmt) ", " __stringify(args)
1371
1372 #undef FTRACE_ENTRY
1373 #define FTRACE_ENTRY(call, struct_name, etype, tstruct, print) \
1374 diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
1375 index bcd158f..4bb16b8 100644
1376 --- a/net/bluetooth/hci_conn.c
1377 +++ b/net/bluetooth/hci_conn.c
1378 @@ -548,6 +548,10 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
1379
1380 if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
1381 struct hci_cp_auth_requested cp;
1382 +
1383 + /* encrypt must be pending if auth is also pending */
1384 + set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend);
1385 +
1386 cp.handle = cpu_to_le16(conn->handle);
1387 hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
1388 sizeof(cp), &cp);
1389 diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
1390 index 9c0d76c..1a41b14 100644
1391 --- a/net/mac80211/agg-rx.c
1392 +++ b/net/mac80211/agg-rx.c
1393 @@ -48,6 +48,8 @@ static void ieee80211_free_tid_rx(struct rcu_head *h)
1394 container_of(h, struct tid_ampdu_rx, rcu_head);
1395 int i;
1396
1397 + del_timer_sync(&tid_rx->reorder_timer);
1398 +
1399 for (i = 0; i < tid_rx->buf_size; i++)
1400 dev_kfree_skb(tid_rx->reorder_buf[i]);
1401 kfree(tid_rx->reorder_buf);
1402 @@ -87,7 +89,6 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
1403 tid, 0, reason);
1404
1405 del_timer_sync(&tid_rx->session_timer);
1406 - del_timer_sync(&tid_rx->reorder_timer);
1407
1408 call_rcu(&tid_rx->rcu_head, ieee80211_free_tid_rx);
1409 }
1410 diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c
1411 index 178ff4f..2679507 100644
1412 --- a/net/rose/rose_dev.c
1413 +++ b/net/rose/rose_dev.c
1414 @@ -96,11 +96,11 @@ static int rose_set_mac_address(struct net_device *dev, void *addr)
1415 struct sockaddr *sa = addr;
1416 int err;
1417
1418 - if (!memcpy(dev->dev_addr, sa->sa_data, dev->addr_len))
1419 + if (!memcmp(dev->dev_addr, sa->sa_data, dev->addr_len))
1420 return 0;
1421
1422 if (dev->flags & IFF_UP) {
1423 - err = rose_add_loopback_node((rose_address *)dev->dev_addr);
1424 + err = rose_add_loopback_node((rose_address *)sa->sa_data);
1425 if (err)
1426 return err;
1427
1428 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
1429 index 413c536..e3cd345 100644
1430 --- a/scripts/mod/modpost.c
1431 +++ b/scripts/mod/modpost.c
1432 @@ -132,8 +132,10 @@ static struct module *new_module(char *modname)
1433 /* strip trailing .o */
1434 s = strrchr(p, '.');
1435 if (s != NULL)
1436 - if (strcmp(s, ".o") == 0)
1437 + if (strcmp(s, ".o") == 0) {
1438 *s = '\0';
1439 + mod->is_dot_o = 1;
1440 + }
1441
1442 /* add to list */
1443 mod->name = p;
1444 @@ -254,6 +256,28 @@ static enum export export_no(const char *s)
1445 return export_unknown;
1446 }
1447
1448 +static const char *sec_name(struct elf_info *elf, int secindex);
1449 +
1450 +#define strstarts(str, prefix) (strncmp(str, prefix, strlen(prefix)) == 0)
1451 +
1452 +static enum export export_from_secname(struct elf_info *elf, unsigned int sec)
1453 +{
1454 + const char *secname = sec_name(elf, sec);
1455 +
1456 + if (strstarts(secname, "___ksymtab+"))
1457 + return export_plain;
1458 + else if (strstarts(secname, "___ksymtab_unused+"))
1459 + return export_unused;
1460 + else if (strstarts(secname, "___ksymtab_gpl+"))
1461 + return export_gpl;
1462 + else if (strstarts(secname, "___ksymtab_unused_gpl+"))
1463 + return export_unused_gpl;
1464 + else if (strstarts(secname, "___ksymtab_gpl_future+"))
1465 + return export_gpl_future;
1466 + else
1467 + return export_unknown;
1468 +}
1469 +
1470 static enum export export_from_sec(struct elf_info *elf, unsigned int sec)
1471 {
1472 if (sec == elf->export_sec)
1473 @@ -563,7 +587,13 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
1474 Elf_Sym *sym, const char *symname)
1475 {
1476 unsigned int crc;
1477 - enum export export = export_from_sec(info, get_secindex(info, sym));
1478 + enum export export;
1479 +
1480 + if ((!is_vmlinux(mod->name) || mod->is_dot_o) &&
1481 + strncmp(symname, "__ksymtab", 9) == 0)
1482 + export = export_from_secname(info, get_secindex(info, sym));
1483 + else
1484 + export = export_from_sec(info, get_secindex(info, sym));
1485
1486 switch (sym->st_shndx) {
1487 case SHN_COMMON:
1488 @@ -822,7 +852,7 @@ static void check_section(const char *modname, struct elf_info *elf,
1489
1490 #define ALL_INIT_DATA_SECTIONS \
1491 ".init.setup$", ".init.rodata$", \
1492 - ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$" \
1493 + ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$", \
1494 ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$"
1495 #define ALL_EXIT_DATA_SECTIONS \
1496 ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$"
1497 diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
1498 index 2031119..51207e4 100644
1499 --- a/scripts/mod/modpost.h
1500 +++ b/scripts/mod/modpost.h
1501 @@ -113,6 +113,7 @@ struct module {
1502 int has_cleanup;
1503 struct buffer dev_table_buf;
1504 char srcversion[25];
1505 + int is_dot_o;
1506 };
1507
1508 struct elf_info {
1509 diff --git a/security/tomoyo/mount.c b/security/tomoyo/mount.c
1510 index 9fc2e15..892494a 100644
1511 --- a/security/tomoyo/mount.c
1512 +++ b/security/tomoyo/mount.c
1513 @@ -205,30 +205,32 @@ int tomoyo_mount_permission(char *dev_name, struct path *path, char *type,
1514 if (flags & MS_REMOUNT) {
1515 type = TOMOYO_MOUNT_REMOUNT_KEYWORD;
1516 flags &= ~MS_REMOUNT;
1517 - }
1518 - if (flags & MS_MOVE) {
1519 - type = TOMOYO_MOUNT_MOVE_KEYWORD;
1520 - flags &= ~MS_MOVE;
1521 - }
1522 - if (flags & MS_BIND) {
1523 + } else if (flags & MS_BIND) {
1524 type = TOMOYO_MOUNT_BIND_KEYWORD;
1525 flags &= ~MS_BIND;
1526 - }
1527 - if (flags & MS_UNBINDABLE) {
1528 - type = TOMOYO_MOUNT_MAKE_UNBINDABLE_KEYWORD;
1529 - flags &= ~MS_UNBINDABLE;
1530 - }
1531 - if (flags & MS_PRIVATE) {
1532 + } else if (flags & MS_SHARED) {
1533 + if (flags & (MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
1534 + return -EINVAL;
1535 + type = TOMOYO_MOUNT_MAKE_SHARED_KEYWORD;
1536 + flags &= ~MS_SHARED;
1537 + } else if (flags & MS_PRIVATE) {
1538 + if (flags & (MS_SHARED | MS_SLAVE | MS_UNBINDABLE))
1539 + return -EINVAL;
1540 type = TOMOYO_MOUNT_MAKE_PRIVATE_KEYWORD;
1541 flags &= ~MS_PRIVATE;
1542 - }
1543 - if (flags & MS_SLAVE) {
1544 + } else if (flags & MS_SLAVE) {
1545 + if (flags & (MS_SHARED | MS_PRIVATE | MS_UNBINDABLE))
1546 + return -EINVAL;
1547 type = TOMOYO_MOUNT_MAKE_SLAVE_KEYWORD;
1548 flags &= ~MS_SLAVE;
1549 - }
1550 - if (flags & MS_SHARED) {
1551 - type = TOMOYO_MOUNT_MAKE_SHARED_KEYWORD;
1552 - flags &= ~MS_SHARED;
1553 + } else if (flags & MS_UNBINDABLE) {
1554 + if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE))
1555 + return -EINVAL;
1556 + type = TOMOYO_MOUNT_MAKE_UNBINDABLE_KEYWORD;
1557 + flags &= ~MS_UNBINDABLE;
1558 + } else if (flags & MS_MOVE) {
1559 + type = TOMOYO_MOUNT_MOVE_KEYWORD;
1560 + flags &= ~MS_MOVE;
1561 }
1562 if (!type)
1563 type = "<NULL>";
1564 diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
1565 index 79c1b3d..7d45197 100644
1566 --- a/sound/soc/codecs/ak4642.c
1567 +++ b/sound/soc/codecs/ak4642.c
1568 @@ -143,7 +143,7 @@
1569 * min : 0xFE : -115.0 dB
1570 * mute: 0xFF
1571 */
1572 -static const DECLARE_TLV_DB_SCALE(out_tlv, -11500, 50, 1);
1573 +static const DECLARE_TLV_DB_SCALE(out_tlv, -11550, 50, 1);
1574
1575 static const struct snd_kcontrol_new ak4642_snd_controls[] = {
1576

  ViewVC Help
Powered by ViewVC 1.1.20