Magellan Linux

Annotation of /trunk/kernel-magellan/patches-3.2/0114-3.2.15-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1740 - (hide annotations) (download)
Mon Apr 16 16:34:49 2012 UTC (12 years, 1 month ago) by niro
File size: 72414 byte(s)
-incr patch for linux-3.2.15
1 niro 1740 diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
2     index dbc59fa..379cdc7 100644
3     --- a/arch/arm/mach-tegra/Kconfig
4     +++ b/arch/arm/mach-tegra/Kconfig
5     @@ -61,11 +61,6 @@ config MACH_SEABOARD
6     config MACH_TEGRA_DT
7     bool "Generic Tegra board (FDT support)"
8     select USE_OF
9     - select ARM_ERRATA_743622
10     - select ARM_ERRATA_751472
11     - select ARM_ERRATA_754322
12     - select ARM_ERRATA_764369
13     - select PL310_ERRATA_769419 if CACHE_L2X0
14     help
15     Support for generic nVidia Tegra boards using Flattened Device Tree
16    
17     diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
18     index c247de0..1918d76 100644
19     --- a/arch/m68k/mac/config.c
20     +++ b/arch/m68k/mac/config.c
21     @@ -950,6 +950,9 @@ int __init mac_platform_init(void)
22     {
23     u8 *swim_base;
24    
25     + if (!MACH_IS_MAC)
26     + return -ENODEV;
27     +
28     /*
29     * Serial devices
30     */
31     diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
32     index 431793e..34baa0e 100644
33     --- a/arch/x86/include/asm/timer.h
34     +++ b/arch/x86/include/asm/timer.h
35     @@ -57,14 +57,10 @@ DECLARE_PER_CPU(unsigned long long, cyc2ns_offset);
36    
37     static inline unsigned long long __cycles_2_ns(unsigned long long cyc)
38     {
39     - unsigned long long quot;
40     - unsigned long long rem;
41     int cpu = smp_processor_id();
42     unsigned long long ns = per_cpu(cyc2ns_offset, cpu);
43     - quot = (cyc >> CYC2NS_SCALE_FACTOR);
44     - rem = cyc & ((1ULL << CYC2NS_SCALE_FACTOR) - 1);
45     - ns += quot * per_cpu(cyc2ns, cpu) +
46     - ((rem * per_cpu(cyc2ns, cpu)) >> CYC2NS_SCALE_FACTOR);
47     + ns += mult_frac(cyc, per_cpu(cyc2ns, cpu),
48     + (1UL << CYC2NS_SCALE_FACTOR));
49     return ns;
50     }
51    
52     diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
53     index a25e276..6d939d7 100644
54     --- a/arch/x86/kernel/apic/io_apic.c
55     +++ b/arch/x86/kernel/apic/io_apic.c
56     @@ -3963,36 +3963,18 @@ int mp_find_ioapic_pin(int ioapic, u32 gsi)
57     static __init int bad_ioapic(unsigned long address)
58     {
59     if (nr_ioapics >= MAX_IO_APICS) {
60     - pr_warn("WARNING: Max # of I/O APICs (%d) exceeded (found %d), skipping\n",
61     - MAX_IO_APICS, nr_ioapics);
62     + printk(KERN_WARNING "WARNING: Max # of I/O APICs (%d) exceeded "
63     + "(found %d), skipping\n", MAX_IO_APICS, nr_ioapics);
64     return 1;
65     }
66     if (!address) {
67     - pr_warn("WARNING: Bogus (zero) I/O APIC address found in table, skipping!\n");
68     + printk(KERN_WARNING "WARNING: Bogus (zero) I/O APIC address"
69     + " found in table, skipping!\n");
70     return 1;
71     }
72     return 0;
73     }
74    
75     -static __init int bad_ioapic_register(int idx)
76     -{
77     - union IO_APIC_reg_00 reg_00;
78     - union IO_APIC_reg_01 reg_01;
79     - union IO_APIC_reg_02 reg_02;
80     -
81     - reg_00.raw = io_apic_read(idx, 0);
82     - reg_01.raw = io_apic_read(idx, 1);
83     - reg_02.raw = io_apic_read(idx, 2);
84     -
85     - if (reg_00.raw == -1 && reg_01.raw == -1 && reg_02.raw == -1) {
86     - pr_warn("I/O APIC 0x%x registers return all ones, skipping!\n",
87     - mpc_ioapic_addr(idx));
88     - return 1;
89     - }
90     -
91     - return 0;
92     -}
93     -
94     void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
95     {
96     int idx = 0;
97     @@ -4009,12 +3991,6 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
98     ioapics[idx].mp_config.apicaddr = address;
99    
100     set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
101     -
102     - if (bad_ioapic_register(idx)) {
103     - clear_fixmap(FIX_IO_APIC_BASE_0 + idx);
104     - return;
105     - }
106     -
107     ioapics[idx].mp_config.apicid = io_apic_unique_id(id);
108     ioapics[idx].mp_config.apicver = io_apic_get_version(idx);
109    
110     @@ -4035,10 +4011,10 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
111     if (gsi_cfg->gsi_end >= gsi_top)
112     gsi_top = gsi_cfg->gsi_end + 1;
113    
114     - pr_info("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, GSI %d-%d\n",
115     - idx, mpc_ioapic_id(idx),
116     - mpc_ioapic_ver(idx), mpc_ioapic_addr(idx),
117     - gsi_cfg->gsi_base, gsi_cfg->gsi_end);
118     + printk(KERN_INFO "IOAPIC[%d]: apic_id %d, version %d, address 0x%x, "
119     + "GSI %d-%d\n", idx, mpc_ioapic_id(idx),
120     + mpc_ioapic_ver(idx), mpc_ioapic_addr(idx),
121     + gsi_cfg->gsi_base, gsi_cfg->gsi_end);
122    
123     nr_ioapics++;
124     }
125     diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
126     index faba577..2f45c4c 100644
127     --- a/arch/x86/kernel/kgdb.c
128     +++ b/arch/x86/kernel/kgdb.c
129     @@ -43,6 +43,8 @@
130     #include <linux/smp.h>
131     #include <linux/nmi.h>
132     #include <linux/hw_breakpoint.h>
133     +#include <linux/uaccess.h>
134     +#include <linux/memory.h>
135    
136     #include <asm/debugreg.h>
137     #include <asm/apicdef.h>
138     @@ -740,6 +742,64 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip)
139     regs->ip = ip;
140     }
141    
142     +int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
143     +{
144     + int err;
145     + char opc[BREAK_INSTR_SIZE];
146     +
147     + bpt->type = BP_BREAKPOINT;
148     + err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
149     + BREAK_INSTR_SIZE);
150     + if (err)
151     + return err;
152     + err = probe_kernel_write((char *)bpt->bpt_addr,
153     + arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE);
154     +#ifdef CONFIG_DEBUG_RODATA
155     + if (!err)
156     + return err;
157     + /*
158     + * It is safe to call text_poke() because normal kernel execution
159     + * is stopped on all cores, so long as the text_mutex is not locked.
160     + */
161     + if (mutex_is_locked(&text_mutex))
162     + return -EBUSY;
163     + text_poke((void *)bpt->bpt_addr, arch_kgdb_ops.gdb_bpt_instr,
164     + BREAK_INSTR_SIZE);
165     + err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE);
166     + if (err)
167     + return err;
168     + if (memcmp(opc, arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE))
169     + return -EINVAL;
170     + bpt->type = BP_POKE_BREAKPOINT;
171     +#endif /* CONFIG_DEBUG_RODATA */
172     + return err;
173     +}
174     +
175     +int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
176     +{
177     +#ifdef CONFIG_DEBUG_RODATA
178     + int err;
179     + char opc[BREAK_INSTR_SIZE];
180     +
181     + if (bpt->type != BP_POKE_BREAKPOINT)
182     + goto knl_write;
183     + /*
184     + * It is safe to call text_poke() because normal kernel execution
185     + * is stopped on all cores, so long as the text_mutex is not locked.
186     + */
187     + if (mutex_is_locked(&text_mutex))
188     + goto knl_write;
189     + text_poke((void *)bpt->bpt_addr, bpt->saved_instr, BREAK_INSTR_SIZE);
190     + err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE);
191     + if (err || memcmp(opc, bpt->saved_instr, BREAK_INSTR_SIZE))
192     + goto knl_write;
193     + return err;
194     +knl_write:
195     +#endif /* CONFIG_DEBUG_RODATA */
196     + return probe_kernel_write((char *)bpt->bpt_addr,
197     + (char *)bpt->saved_instr, BREAK_INSTR_SIZE);
198     +}
199     +
200     struct kgdb_arch arch_kgdb_ops = {
201     /* Breakpoint instruction: */
202     .gdb_bpt_instr = { 0xcc },
203     diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
204     index 3fe298a..1ec515b 100644
205     --- a/arch/x86/kernel/tsc.c
206     +++ b/arch/x86/kernel/tsc.c
207     @@ -622,7 +622,8 @@ static void set_cyc2ns_scale(unsigned long cpu_khz, int cpu)
208    
209     if (cpu_khz) {
210     *scale = (NSEC_PER_MSEC << CYC2NS_SCALE_FACTOR)/cpu_khz;
211     - *offset = ns_now - (tsc_now * *scale >> CYC2NS_SCALE_FACTOR);
212     + *offset = ns_now - mult_frac(tsc_now, *scale,
213     + (1UL << CYC2NS_SCALE_FACTOR));
214     }
215    
216     sched_clock_idle_wakeup_event(0);
217     diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
218     index 5671752..5a5b6e4 100644
219     --- a/arch/x86/net/bpf_jit_comp.c
220     +++ b/arch/x86/net/bpf_jit_comp.c
221     @@ -289,7 +289,7 @@ void bpf_jit_compile(struct sk_filter *fp)
222     EMIT2(0x24, K & 0xFF); /* and imm8,%al */
223     } else if (K >= 0xFFFF0000) {
224     EMIT2(0x66, 0x25); /* and imm16,%ax */
225     - EMIT2(K, 2);
226     + EMIT(K, 2);
227     } else {
228     EMIT1_off32(0x25, K); /* and imm32,%eax */
229     }
230     diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
231     index f8348ab..0ed97d8 100644
232     --- a/arch/x86/pci/acpi.c
233     +++ b/arch/x86/pci/acpi.c
234     @@ -54,6 +54,16 @@ static const struct dmi_system_id pci_use_crs_table[] __initconst = {
235     DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
236     },
237     },
238     + /* https://bugzilla.kernel.org/show_bug.cgi?id=42619 */
239     + {
240     + .callback = set_use_crs,
241     + .ident = "MSI MS-7253",
242     + .matches = {
243     + DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
244     + DMI_MATCH(DMI_BOARD_NAME, "MS-7253"),
245     + DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
246     + },
247     + },
248     {}
249     };
250    
251     diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
252     index 6f5588e..4c531b4 100644
253     --- a/drivers/acpi/acpica/tbfadt.c
254     +++ b/drivers/acpi/acpica/tbfadt.c
255     @@ -350,10 +350,6 @@ static void acpi_tb_convert_fadt(void)
256     u32 address32;
257     u32 i;
258    
259     - /* Update the local FADT table header length */
260     -
261     - acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
262     -
263     /*
264     * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
265     * Later code will always use the X 64-bit field. Also, check for an
266     @@ -395,6 +391,10 @@ static void acpi_tb_convert_fadt(void)
267     acpi_gbl_FADT.boot_flags = 0;
268     }
269    
270     + /* Update the local FADT table header length */
271     +
272     + acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
273     +
274     /*
275     * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
276     * generic address structures as necessary. Later code will always use
277     diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
278     index 870550d..4da7d9d 100644
279     --- a/drivers/acpi/processor_thermal.c
280     +++ b/drivers/acpi/processor_thermal.c
281     @@ -58,6 +58,27 @@ ACPI_MODULE_NAME("processor_thermal");
282     static DEFINE_PER_CPU(unsigned int, cpufreq_thermal_reduction_pctg);
283     static unsigned int acpi_thermal_cpufreq_is_init = 0;
284    
285     +#define reduction_pctg(cpu) \
286     + per_cpu(cpufreq_thermal_reduction_pctg, phys_package_first_cpu(cpu))
287     +
288     +/*
289     + * Emulate "per package data" using per cpu data (which should really be
290     + * provided elsewhere)
291     + *
292     + * Note we can lose a CPU on cpu hotunplug, in this case we forget the state
293     + * temporarily. Fortunately that's not a big issue here (I hope)
294     + */
295     +static int phys_package_first_cpu(int cpu)
296     +{
297     + int i;
298     + int id = topology_physical_package_id(cpu);
299     +
300     + for_each_online_cpu(i)
301     + if (topology_physical_package_id(i) == id)
302     + return i;
303     + return 0;
304     +}
305     +
306     static int cpu_has_cpufreq(unsigned int cpu)
307     {
308     struct cpufreq_policy policy;
309     @@ -77,7 +98,7 @@ static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb,
310    
311     max_freq = (
312     policy->cpuinfo.max_freq *
313     - (100 - per_cpu(cpufreq_thermal_reduction_pctg, policy->cpu) * 20)
314     + (100 - reduction_pctg(policy->cpu) * 20)
315     ) / 100;
316    
317     cpufreq_verify_within_limits(policy, 0, max_freq);
318     @@ -103,16 +124,28 @@ static int cpufreq_get_cur_state(unsigned int cpu)
319     if (!cpu_has_cpufreq(cpu))
320     return 0;
321    
322     - return per_cpu(cpufreq_thermal_reduction_pctg, cpu);
323     + return reduction_pctg(cpu);
324     }
325    
326     static int cpufreq_set_cur_state(unsigned int cpu, int state)
327     {
328     + int i;
329     +
330     if (!cpu_has_cpufreq(cpu))
331     return 0;
332    
333     - per_cpu(cpufreq_thermal_reduction_pctg, cpu) = state;
334     - cpufreq_update_policy(cpu);
335     + reduction_pctg(cpu) = state;
336     +
337     + /*
338     + * Update all the CPUs in the same package because they all
339     + * contribute to the temperature and often share the same
340     + * frequency.
341     + */
342     + for_each_online_cpu(i) {
343     + if (topology_physical_package_id(i) ==
344     + topology_physical_package_id(cpu))
345     + cpufreq_update_policy(i);
346     + }
347     return 0;
348     }
349    
350     @@ -120,10 +153,6 @@ void acpi_thermal_cpufreq_init(void)
351     {
352     int i;
353    
354     - for (i = 0; i < nr_cpu_ids; i++)
355     - if (cpu_present(i))
356     - per_cpu(cpufreq_thermal_reduction_pctg, i) = 0;
357     -
358     i = cpufreq_register_notifier(&acpi_thermal_cpufreq_notifier_block,
359     CPUFREQ_POLICY_NOTIFIER);
360     if (!i)
361     diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
362     index a4d6cb0..6595180 100644
363     --- a/drivers/dma/ioat/dma.c
364     +++ b/drivers/dma/ioat/dma.c
365     @@ -548,9 +548,9 @@ void ioat_dma_unmap(struct ioat_chan_common *chan, enum dma_ctrl_flags flags,
366     PCI_DMA_TODEVICE, flags, 0);
367     }
368    
369     -unsigned long ioat_get_current_completion(struct ioat_chan_common *chan)
370     +dma_addr_t ioat_get_current_completion(struct ioat_chan_common *chan)
371     {
372     - unsigned long phys_complete;
373     + dma_addr_t phys_complete;
374     u64 completion;
375    
376     completion = *chan->completion;
377     @@ -571,7 +571,7 @@ unsigned long ioat_get_current_completion(struct ioat_chan_common *chan)
378     }
379    
380     bool ioat_cleanup_preamble(struct ioat_chan_common *chan,
381     - unsigned long *phys_complete)
382     + dma_addr_t *phys_complete)
383     {
384     *phys_complete = ioat_get_current_completion(chan);
385     if (*phys_complete == chan->last_completion)
386     @@ -582,14 +582,14 @@ bool ioat_cleanup_preamble(struct ioat_chan_common *chan,
387     return true;
388     }
389    
390     -static void __cleanup(struct ioat_dma_chan *ioat, unsigned long phys_complete)
391     +static void __cleanup(struct ioat_dma_chan *ioat, dma_addr_t phys_complete)
392     {
393     struct ioat_chan_common *chan = &ioat->base;
394     struct list_head *_desc, *n;
395     struct dma_async_tx_descriptor *tx;
396    
397     - dev_dbg(to_dev(chan), "%s: phys_complete: %lx\n",
398     - __func__, phys_complete);
399     + dev_dbg(to_dev(chan), "%s: phys_complete: %llx\n",
400     + __func__, (unsigned long long) phys_complete);
401     list_for_each_safe(_desc, n, &ioat->used_desc) {
402     struct ioat_desc_sw *desc;
403    
404     @@ -655,7 +655,7 @@ static void __cleanup(struct ioat_dma_chan *ioat, unsigned long phys_complete)
405     static void ioat1_cleanup(struct ioat_dma_chan *ioat)
406     {
407     struct ioat_chan_common *chan = &ioat->base;
408     - unsigned long phys_complete;
409     + dma_addr_t phys_complete;
410    
411     prefetch(chan->completion);
412    
413     @@ -701,7 +701,7 @@ static void ioat1_timer_event(unsigned long data)
414     mod_timer(&chan->timer, jiffies + COMPLETION_TIMEOUT);
415     spin_unlock_bh(&ioat->desc_lock);
416     } else if (test_bit(IOAT_COMPLETION_PENDING, &chan->state)) {
417     - unsigned long phys_complete;
418     + dma_addr_t phys_complete;
419    
420     spin_lock_bh(&ioat->desc_lock);
421     /* if we haven't made progress and we have already
422     diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
423     index 5216c8a..8bebddd 100644
424     --- a/drivers/dma/ioat/dma.h
425     +++ b/drivers/dma/ioat/dma.h
426     @@ -88,7 +88,7 @@ struct ioatdma_device {
427     struct ioat_chan_common {
428     struct dma_chan common;
429     void __iomem *reg_base;
430     - unsigned long last_completion;
431     + dma_addr_t last_completion;
432     spinlock_t cleanup_lock;
433     dma_cookie_t completed_cookie;
434     unsigned long state;
435     @@ -333,7 +333,7 @@ int __devinit ioat_dma_self_test(struct ioatdma_device *device);
436     void __devexit ioat_dma_remove(struct ioatdma_device *device);
437     struct dca_provider * __devinit ioat_dca_init(struct pci_dev *pdev,
438     void __iomem *iobase);
439     -unsigned long ioat_get_current_completion(struct ioat_chan_common *chan);
440     +dma_addr_t ioat_get_current_completion(struct ioat_chan_common *chan);
441     void ioat_init_channel(struct ioatdma_device *device,
442     struct ioat_chan_common *chan, int idx);
443     enum dma_status ioat_dma_tx_status(struct dma_chan *c, dma_cookie_t cookie,
444     @@ -341,7 +341,7 @@ enum dma_status ioat_dma_tx_status(struct dma_chan *c, dma_cookie_t cookie,
445     void ioat_dma_unmap(struct ioat_chan_common *chan, enum dma_ctrl_flags flags,
446     size_t len, struct ioat_dma_descriptor *hw);
447     bool ioat_cleanup_preamble(struct ioat_chan_common *chan,
448     - unsigned long *phys_complete);
449     + dma_addr_t *phys_complete);
450     void ioat_kobject_add(struct ioatdma_device *device, struct kobj_type *type);
451     void ioat_kobject_del(struct ioatdma_device *device);
452     extern const struct sysfs_ops ioat_sysfs_ops;
453     diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
454     index 5d65f83..cb8864d 100644
455     --- a/drivers/dma/ioat/dma_v2.c
456     +++ b/drivers/dma/ioat/dma_v2.c
457     @@ -126,7 +126,7 @@ static void ioat2_start_null_desc(struct ioat2_dma_chan *ioat)
458     spin_unlock_bh(&ioat->prep_lock);
459     }
460    
461     -static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
462     +static void __cleanup(struct ioat2_dma_chan *ioat, dma_addr_t phys_complete)
463     {
464     struct ioat_chan_common *chan = &ioat->base;
465     struct dma_async_tx_descriptor *tx;
466     @@ -178,7 +178,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
467     static void ioat2_cleanup(struct ioat2_dma_chan *ioat)
468     {
469     struct ioat_chan_common *chan = &ioat->base;
470     - unsigned long phys_complete;
471     + dma_addr_t phys_complete;
472    
473     spin_lock_bh(&chan->cleanup_lock);
474     if (ioat_cleanup_preamble(chan, &phys_complete))
475     @@ -259,7 +259,7 @@ int ioat2_reset_sync(struct ioat_chan_common *chan, unsigned long tmo)
476     static void ioat2_restart_channel(struct ioat2_dma_chan *ioat)
477     {
478     struct ioat_chan_common *chan = &ioat->base;
479     - unsigned long phys_complete;
480     + dma_addr_t phys_complete;
481    
482     ioat2_quiesce(chan, 0);
483     if (ioat_cleanup_preamble(chan, &phys_complete))
484     @@ -274,7 +274,7 @@ void ioat2_timer_event(unsigned long data)
485     struct ioat_chan_common *chan = &ioat->base;
486    
487     if (test_bit(IOAT_COMPLETION_PENDING, &chan->state)) {
488     - unsigned long phys_complete;
489     + dma_addr_t phys_complete;
490     u64 status;
491    
492     status = ioat_chansts(chan);
493     diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c
494     index f519c93..2dbf32b 100644
495     --- a/drivers/dma/ioat/dma_v3.c
496     +++ b/drivers/dma/ioat/dma_v3.c
497     @@ -256,7 +256,7 @@ static bool desc_has_ext(struct ioat_ring_ent *desc)
498     * The difference from the dma_v2.c __cleanup() is that this routine
499     * handles extended descriptors and dma-unmapping raid operations.
500     */
501     -static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
502     +static void __cleanup(struct ioat2_dma_chan *ioat, dma_addr_t phys_complete)
503     {
504     struct ioat_chan_common *chan = &ioat->base;
505     struct ioat_ring_ent *desc;
506     @@ -314,7 +314,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
507     static void ioat3_cleanup(struct ioat2_dma_chan *ioat)
508     {
509     struct ioat_chan_common *chan = &ioat->base;
510     - unsigned long phys_complete;
511     + dma_addr_t phys_complete;
512    
513     spin_lock_bh(&chan->cleanup_lock);
514     if (ioat_cleanup_preamble(chan, &phys_complete))
515     @@ -333,7 +333,7 @@ static void ioat3_cleanup_event(unsigned long data)
516     static void ioat3_restart_channel(struct ioat2_dma_chan *ioat)
517     {
518     struct ioat_chan_common *chan = &ioat->base;
519     - unsigned long phys_complete;
520     + dma_addr_t phys_complete;
521    
522     ioat2_quiesce(chan, 0);
523     if (ioat_cleanup_preamble(chan, &phys_complete))
524     @@ -348,7 +348,7 @@ static void ioat3_timer_event(unsigned long data)
525     struct ioat_chan_common *chan = &ioat->base;
526    
527     if (test_bit(IOAT_COMPLETION_PENDING, &chan->state)) {
528     - unsigned long phys_complete;
529     + dma_addr_t phys_complete;
530     u64 status;
531    
532     status = ioat_chansts(chan);
533     diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
534     index 80fe39d..dd58373 100644
535     --- a/drivers/gpu/drm/drm_fb_helper.c
536     +++ b/drivers/gpu/drm/drm_fb_helper.c
537     @@ -610,9 +610,13 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
538     return -EINVAL;
539    
540     /* Need to resize the fb object !!! */
541     - if (var->bits_per_pixel > fb->bits_per_pixel || var->xres > fb->width || var->yres > fb->height) {
542     + if (var->bits_per_pixel > fb->bits_per_pixel ||
543     + var->xres > fb->width || var->yres > fb->height ||
544     + var->xres_virtual > fb->width || var->yres_virtual > fb->height) {
545     DRM_DEBUG("fb userspace requested width/height/bpp is greater than current fb "
546     - "object %dx%d-%d > %dx%d-%d\n", var->xres, var->yres, var->bits_per_pixel,
547     + "request %dx%d-%d (virtual %dx%d) > %dx%d-%d\n",
548     + var->xres, var->yres, var->bits_per_pixel,
549     + var->xres_virtual, var->yres_virtual,
550     fb->width, fb->height, fb->bits_per_pixel);
551     return -EINVAL;
552     }
553     diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
554     index d04597d..e52b705 100644
555     --- a/drivers/gpu/drm/i915/i915_drv.c
556     +++ b/drivers/gpu/drm/i915/i915_drv.c
557     @@ -508,7 +508,9 @@ static int i915_drm_thaw(struct drm_device *dev)
558     drm_irq_install(dev);
559    
560     /* Resume the modeset for every activated CRTC */
561     + mutex_lock(&dev->mode_config.mutex);
562     drm_helper_resume_force_mode(dev);
563     + mutex_unlock(&dev->mode_config.mutex);
564    
565     if (IS_IRONLAKE_M(dev))
566     ironlake_enable_rc6(dev);
567     diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
568     index 1608d2a..2f99fd4 100644
569     --- a/drivers/gpu/drm/i915/i915_reg.h
570     +++ b/drivers/gpu/drm/i915/i915_reg.h
571     @@ -2312,6 +2312,7 @@
572     #define PIPECONF_DISABLE 0
573     #define PIPECONF_DOUBLE_WIDE (1<<30)
574     #define I965_PIPECONF_ACTIVE (1<<30)
575     +#define PIPECONF_FRAME_START_DELAY_MASK (3<<27)
576     #define PIPECONF_SINGLE_WIDE 0
577     #define PIPECONF_PIPE_UNLOCKED 0
578     #define PIPECONF_PIPE_LOCKED (1<<25)
579     diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
580     index 63880e2..22efb08 100644
581     --- a/drivers/gpu/drm/i915/intel_bios.c
582     +++ b/drivers/gpu/drm/i915/intel_bios.c
583     @@ -24,6 +24,7 @@
584     * Eric Anholt <eric@anholt.net>
585     *
586     */
587     +#include <linux/dmi.h>
588     #include <drm/drm_dp_helper.h>
589     #include "drmP.h"
590     #include "drm.h"
591     @@ -621,6 +622,26 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
592     dev_priv->edp.bpp = 18;
593     }
594    
595     +static int __init intel_no_opregion_vbt_callback(const struct dmi_system_id *id)
596     +{
597     + DRM_DEBUG_KMS("Falling back to manually reading VBT from "
598     + "VBIOS ROM for %s\n",
599     + id->ident);
600     + return 1;
601     +}
602     +
603     +static const struct dmi_system_id intel_no_opregion_vbt[] = {
604     + {
605     + .callback = intel_no_opregion_vbt_callback,
606     + .ident = "ThinkCentre A57",
607     + .matches = {
608     + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
609     + DMI_MATCH(DMI_PRODUCT_NAME, "97027RG"),
610     + },
611     + },
612     + { }
613     +};
614     +
615     /**
616     * intel_parse_bios - find VBT and initialize settings from the BIOS
617     * @dev: DRM device
618     @@ -641,7 +662,7 @@ intel_parse_bios(struct drm_device *dev)
619     init_vbt_defaults(dev_priv);
620    
621     /* XXX Should this validation be moved to intel_opregion.c? */
622     - if (dev_priv->opregion.vbt) {
623     + if (!dmi_check_system(intel_no_opregion_vbt) && dev_priv->opregion.vbt) {
624     struct vbt_header *vbt = dev_priv->opregion.vbt;
625     if (memcmp(vbt->signature, "$VBT", 4) == 0) {
626     DRM_DEBUG_KMS("Using VBT from OpRegion: %20s\n",
627     diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
628     index 9ec9755..9011f48 100644
629     --- a/drivers/gpu/drm/i915/intel_display.c
630     +++ b/drivers/gpu/drm/i915/intel_display.c
631     @@ -7278,6 +7278,12 @@ static void intel_sanitize_modesetting(struct drm_device *dev,
632     struct drm_i915_private *dev_priv = dev->dev_private;
633     u32 reg, val;
634    
635     + /* Clear any frame start delays used for debugging left by the BIOS */
636     + for_each_pipe(pipe) {
637     + reg = PIPECONF(pipe);
638     + I915_WRITE(reg, I915_READ(reg) & ~PIPECONF_FRAME_START_DELAY_MASK);
639     + }
640     +
641     if (HAS_PCH_SPLIT(dev))
642     return;
643    
644     diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
645     index b83f745..583c2d0 100644
646     --- a/drivers/gpu/drm/i915/intel_lvds.c
647     +++ b/drivers/gpu/drm/i915/intel_lvds.c
648     @@ -731,6 +731,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
649     DMI_MATCH(DMI_BOARD_NAME, "AT5NM10T-I"),
650     },
651     },
652     + {
653     + .callback = intel_no_lvds_dmi_callback,
654     + .ident = "MSI Wind Box DC500",
655     + .matches = {
656     + DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
657     + DMI_MATCH(DMI_BOARD_NAME, "MS-7469"),
658     + },
659     + },
660    
661     { } /* terminating entry */
662     };
663     diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
664     index 14cc88a..3a05cdb 100644
665     --- a/drivers/gpu/drm/radeon/atom.c
666     +++ b/drivers/gpu/drm/radeon/atom.c
667     @@ -1304,8 +1304,11 @@ struct atom_context *atom_parse(struct card_info *card, void *bios)
668    
669     int atom_asic_init(struct atom_context *ctx)
670     {
671     + struct radeon_device *rdev = ctx->card->dev->dev_private;
672     int hwi = CU16(ctx->data_table + ATOM_DATA_FWI_PTR);
673     uint32_t ps[16];
674     + int ret;
675     +
676     memset(ps, 0, 64);
677    
678     ps[0] = cpu_to_le32(CU32(hwi + ATOM_FWI_DEFSCLK_PTR));
679     @@ -1315,7 +1318,17 @@ int atom_asic_init(struct atom_context *ctx)
680    
681     if (!CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_INIT))
682     return 1;
683     - return atom_execute_table(ctx, ATOM_CMD_INIT, ps);
684     + ret = atom_execute_table(ctx, ATOM_CMD_INIT, ps);
685     + if (ret)
686     + return ret;
687     +
688     + memset(ps, 0, 64);
689     +
690     + if (rdev->family < CHIP_R600) {
691     + if (CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_SPDFANCNTL))
692     + atom_execute_table(ctx, ATOM_CMD_SPDFANCNTL, ps);
693     + }
694     + return ret;
695     }
696    
697     void atom_destroy(struct atom_context *ctx)
698     diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h
699     index 93cfe20..25fea63 100644
700     --- a/drivers/gpu/drm/radeon/atom.h
701     +++ b/drivers/gpu/drm/radeon/atom.h
702     @@ -44,6 +44,7 @@
703     #define ATOM_CMD_SETSCLK 0x0A
704     #define ATOM_CMD_SETMCLK 0x0B
705     #define ATOM_CMD_SETPCLK 0x0C
706     +#define ATOM_CMD_SPDFANCNTL 0x39
707    
708     #define ATOM_DATA_FWI_PTR 0xC
709     #define ATOM_DATA_IIO_PTR 0x32
710     diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
711     index 5c74179..20d5852 100644
712     --- a/drivers/iommu/amd_iommu_init.c
713     +++ b/drivers/iommu/amd_iommu_init.c
714     @@ -1033,8 +1033,9 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
715     {
716     int r;
717    
718     - if (pci_enable_msi(iommu->dev))
719     - return 1;
720     + r = pci_enable_msi(iommu->dev);
721     + if (r)
722     + return r;
723    
724     r = request_threaded_irq(iommu->dev->irq,
725     amd_iommu_int_handler,
726     @@ -1044,24 +1045,33 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
727    
728     if (r) {
729     pci_disable_msi(iommu->dev);
730     - return 1;
731     + return r;
732     }
733    
734     iommu->int_enabled = true;
735     - iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
736    
737     return 0;
738     }
739    
740     static int iommu_init_msi(struct amd_iommu *iommu)
741     {
742     + int ret;
743     +
744     if (iommu->int_enabled)
745     - return 0;
746     + goto enable_faults;
747    
748     if (pci_find_capability(iommu->dev, PCI_CAP_ID_MSI))
749     - return iommu_setup_msi(iommu);
750     + ret = iommu_setup_msi(iommu);
751     + else
752     + ret = -ENODEV;
753    
754     - return 1;
755     + if (ret)
756     + return ret;
757     +
758     +enable_faults:
759     + iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
760     +
761     + return 0;
762     }
763    
764     /****************************************************************************
765     diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
766     index 3eee45f..83f4988 100644
767     --- a/drivers/mfd/twl6030-irq.c
768     +++ b/drivers/mfd/twl6030-irq.c
769     @@ -187,8 +187,17 @@ static int twl6030_irq_thread(void *data)
770     }
771     local_irq_enable();
772     }
773     - ret = twl_i2c_write(TWL_MODULE_PIH, sts.bytes,
774     - REG_INT_STS_A, 3); /* clear INT_STS_A */
775     +
776     + /*
777     + * NOTE:
778     + * Simulation confirms that documentation is wrong w.r.t the
779     + * interrupt status clear operation. A single *byte* write to
780     + * any one of STS_A to STS_C register results in all three
781     + * STS registers being reset. Since it does not matter which
782     + * value is written, all three registers are cleared on a
783     + * single byte write, so we just use 0x0 to clear.
784     + */
785     + ret = twl_i2c_write_u8(TWL_MODULE_PIH, 0x00, REG_INT_STS_A);
786     if (ret)
787     pr_warning("twl6030: I2C error in clearing PIH ISR\n");
788    
789     diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c
790     index 3f7ad83..3aa9a96 100644
791     --- a/drivers/misc/kgdbts.c
792     +++ b/drivers/misc/kgdbts.c
793     @@ -134,12 +134,17 @@ static int force_hwbrks;
794     static int hwbreaks_ok;
795     static int hw_break_val;
796     static int hw_break_val2;
797     +static int cont_instead_of_sstep;
798     +static unsigned long cont_thread_id;
799     +static unsigned long sstep_thread_id;
800     #if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || defined(CONFIG_SPARC)
801     static int arch_needs_sstep_emulation = 1;
802     #else
803     static int arch_needs_sstep_emulation;
804     #endif
805     +static unsigned long cont_addr;
806     static unsigned long sstep_addr;
807     +static int restart_from_top_after_write;
808     static int sstep_state;
809    
810     /* Storage for the registers, in GDB format. */
811     @@ -187,7 +192,8 @@ static int kgdbts_unreg_thread(void *ptr)
812     */
813     while (!final_ack)
814     msleep_interruptible(1500);
815     -
816     + /* Pause for any other threads to exit after final ack. */
817     + msleep_interruptible(1000);
818     if (configured)
819     kgdb_unregister_io_module(&kgdbts_io_ops);
820     configured = 0;
821     @@ -211,7 +217,7 @@ static unsigned long lookup_addr(char *arg)
822     if (!strcmp(arg, "kgdbts_break_test"))
823     addr = (unsigned long)kgdbts_break_test;
824     else if (!strcmp(arg, "sys_open"))
825     - addr = (unsigned long)sys_open;
826     + addr = (unsigned long)do_sys_open;
827     else if (!strcmp(arg, "do_fork"))
828     addr = (unsigned long)do_fork;
829     else if (!strcmp(arg, "hw_break_val"))
830     @@ -283,6 +289,16 @@ static void hw_break_val_write(void)
831     hw_break_val++;
832     }
833    
834     +static int get_thread_id_continue(char *put_str, char *arg)
835     +{
836     + char *ptr = &put_str[11];
837     +
838     + if (put_str[1] != 'T' || put_str[2] != '0')
839     + return 1;
840     + kgdb_hex2long(&ptr, &cont_thread_id);
841     + return 0;
842     +}
843     +
844     static int check_and_rewind_pc(char *put_str, char *arg)
845     {
846     unsigned long addr = lookup_addr(arg);
847     @@ -299,13 +315,21 @@ static int check_and_rewind_pc(char *put_str, char *arg)
848     if (addr + BREAK_INSTR_SIZE == ip)
849     offset = -BREAK_INSTR_SIZE;
850     #endif
851     - if (strcmp(arg, "silent") && ip + offset != addr) {
852     +
853     + if (arch_needs_sstep_emulation && sstep_addr &&
854     + ip + offset == sstep_addr &&
855     + ((!strcmp(arg, "sys_open") || !strcmp(arg, "do_fork")))) {
856     + /* This is special case for emulated single step */
857     + v2printk("Emul: rewind hit single step bp\n");
858     + restart_from_top_after_write = 1;
859     + } else if (strcmp(arg, "silent") && ip + offset != addr) {
860     eprintk("kgdbts: BP mismatch %lx expected %lx\n",
861     ip + offset, addr);
862     return 1;
863     }
864     /* Readjust the instruction pointer if needed */
865     ip += offset;
866     + cont_addr = ip;
867     #ifdef GDB_ADJUSTS_BREAK_OFFSET
868     instruction_pointer_set(&kgdbts_regs, ip);
869     #endif
870     @@ -315,6 +339,8 @@ static int check_and_rewind_pc(char *put_str, char *arg)
871     static int check_single_step(char *put_str, char *arg)
872     {
873     unsigned long addr = lookup_addr(arg);
874     + static int matched_id;
875     +
876     /*
877     * From an arch indepent point of view the instruction pointer
878     * should be on a different instruction
879     @@ -324,6 +350,29 @@ static int check_single_step(char *put_str, char *arg)
880     gdb_regs_to_pt_regs(kgdbts_gdb_regs, &kgdbts_regs);
881     v2printk("Singlestep stopped at IP: %lx\n",
882     instruction_pointer(&kgdbts_regs));
883     +
884     + if (sstep_thread_id != cont_thread_id) {
885     + /*
886     + * Ensure we stopped in the same thread id as before, else the
887     + * debugger should continue until the original thread that was
888     + * single stepped is scheduled again, emulating gdb's behavior.
889     + */
890     + v2printk("ThrID does not match: %lx\n", cont_thread_id);
891     + if (arch_needs_sstep_emulation) {
892     + if (matched_id &&
893     + instruction_pointer(&kgdbts_regs) != addr)
894     + goto continue_test;
895     + matched_id++;
896     + ts.idx -= 2;
897     + sstep_state = 0;
898     + return 0;
899     + }
900     + cont_instead_of_sstep = 1;
901     + ts.idx -= 4;
902     + return 0;
903     + }
904     +continue_test:
905     + matched_id = 0;
906     if (instruction_pointer(&kgdbts_regs) == addr) {
907     eprintk("kgdbts: SingleStep failed at %lx\n",
908     instruction_pointer(&kgdbts_regs));
909     @@ -365,10 +414,40 @@ static int got_break(char *put_str, char *arg)
910     return 1;
911     }
912    
913     +static void get_cont_catch(char *arg)
914     +{
915     + /* Always send detach because the test is completed at this point */
916     + fill_get_buf("D");
917     +}
918     +
919     +static int put_cont_catch(char *put_str, char *arg)
920     +{
921     + /* This is at the end of the test and we catch any and all input */
922     + v2printk("kgdbts: cleanup task: %lx\n", sstep_thread_id);
923     + ts.idx--;
924     + return 0;
925     +}
926     +
927     +static int emul_reset(char *put_str, char *arg)
928     +{
929     + if (strncmp(put_str, "$OK", 3))
930     + return 1;
931     + if (restart_from_top_after_write) {
932     + restart_from_top_after_write = 0;
933     + ts.idx = -1;
934     + }
935     + return 0;
936     +}
937     +
938     static void emul_sstep_get(char *arg)
939     {
940     if (!arch_needs_sstep_emulation) {
941     - fill_get_buf(arg);
942     + if (cont_instead_of_sstep) {
943     + cont_instead_of_sstep = 0;
944     + fill_get_buf("c");
945     + } else {
946     + fill_get_buf(arg);
947     + }
948     return;
949     }
950     switch (sstep_state) {
951     @@ -398,9 +477,11 @@ static void emul_sstep_get(char *arg)
952     static int emul_sstep_put(char *put_str, char *arg)
953     {
954     if (!arch_needs_sstep_emulation) {
955     - if (!strncmp(put_str+1, arg, 2))
956     - return 0;
957     - return 1;
958     + char *ptr = &put_str[11];
959     + if (put_str[1] != 'T' || put_str[2] != '0')
960     + return 1;
961     + kgdb_hex2long(&ptr, &sstep_thread_id);
962     + return 0;
963     }
964     switch (sstep_state) {
965     case 1:
966     @@ -411,8 +492,7 @@ static int emul_sstep_put(char *put_str, char *arg)
967     v2printk("Stopped at IP: %lx\n",
968     instruction_pointer(&kgdbts_regs));
969     /* Want to stop at IP + break instruction size by default */
970     - sstep_addr = instruction_pointer(&kgdbts_regs) +
971     - BREAK_INSTR_SIZE;
972     + sstep_addr = cont_addr + BREAK_INSTR_SIZE;
973     break;
974     case 2:
975     if (strncmp(put_str, "$OK", 3)) {
976     @@ -424,6 +504,9 @@ static int emul_sstep_put(char *put_str, char *arg)
977     if (strncmp(put_str, "$T0", 3)) {
978     eprintk("kgdbts: failed continue sstep\n");
979     return 1;
980     + } else {
981     + char *ptr = &put_str[11];
982     + kgdb_hex2long(&ptr, &sstep_thread_id);
983     }
984     break;
985     case 4:
986     @@ -502,10 +585,10 @@ static struct test_struct bad_read_test[] = {
987     static struct test_struct singlestep_break_test[] = {
988     { "?", "S0*" }, /* Clear break points */
989     { "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */
990     - { "c", "T0*", }, /* Continue */
991     + { "c", "T0*", NULL, get_thread_id_continue }, /* Continue */
992     + { "kgdbts_break_test", "OK", sw_rem_break }, /*remove breakpoint */
993     { "g", "kgdbts_break_test", NULL, check_and_rewind_pc },
994     { "write", "OK", write_regs }, /* Write registers */
995     - { "kgdbts_break_test", "OK", sw_rem_break }, /*remove breakpoint */
996     { "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
997     { "g", "kgdbts_break_test", NULL, check_single_step },
998     { "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */
999     @@ -523,16 +606,16 @@ static struct test_struct singlestep_break_test[] = {
1000     static struct test_struct do_fork_test[] = {
1001     { "?", "S0*" }, /* Clear break points */
1002     { "do_fork", "OK", sw_break, }, /* set sw breakpoint */
1003     - { "c", "T0*", }, /* Continue */
1004     - { "g", "do_fork", NULL, check_and_rewind_pc }, /* check location */
1005     - { "write", "OK", write_regs }, /* Write registers */
1006     + { "c", "T0*", NULL, get_thread_id_continue }, /* Continue */
1007     { "do_fork", "OK", sw_rem_break }, /*remove breakpoint */
1008     + { "g", "do_fork", NULL, check_and_rewind_pc }, /* check location */
1009     + { "write", "OK", write_regs, emul_reset }, /* Write registers */
1010     { "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
1011     { "g", "do_fork", NULL, check_single_step },
1012     { "do_fork", "OK", sw_break, }, /* set sw breakpoint */
1013     { "7", "T0*", skip_back_repeat_test }, /* Loop based on repeat_test */
1014     { "D", "OK", NULL, final_ack_set }, /* detach and unregister I/O */
1015     - { "", "" },
1016     + { "", "", get_cont_catch, put_cont_catch },
1017     };
1018    
1019     /* Test for hitting a breakpoint at sys_open for what ever the number
1020     @@ -541,16 +624,16 @@ static struct test_struct do_fork_test[] = {
1021     static struct test_struct sys_open_test[] = {
1022     { "?", "S0*" }, /* Clear break points */
1023     { "sys_open", "OK", sw_break, }, /* set sw breakpoint */
1024     - { "c", "T0*", }, /* Continue */
1025     - { "g", "sys_open", NULL, check_and_rewind_pc }, /* check location */
1026     - { "write", "OK", write_regs }, /* Write registers */
1027     + { "c", "T0*", NULL, get_thread_id_continue }, /* Continue */
1028     { "sys_open", "OK", sw_rem_break }, /*remove breakpoint */
1029     + { "g", "sys_open", NULL, check_and_rewind_pc }, /* check location */
1030     + { "write", "OK", write_regs, emul_reset }, /* Write registers */
1031     { "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
1032     { "g", "sys_open", NULL, check_single_step },
1033     { "sys_open", "OK", sw_break, }, /* set sw breakpoint */
1034     { "7", "T0*", skip_back_repeat_test }, /* Loop based on repeat_test */
1035     { "D", "OK", NULL, final_ack_set }, /* detach and unregister I/O */
1036     - { "", "" },
1037     + { "", "", get_cont_catch, put_cont_catch },
1038     };
1039    
1040     /*
1041     @@ -693,8 +776,8 @@ static int run_simple_test(int is_get_char, int chr)
1042     /* This callback is a put char which is when kgdb sends data to
1043     * this I/O module.
1044     */
1045     - if (ts.tst[ts.idx].get[0] == '\0' &&
1046     - ts.tst[ts.idx].put[0] == '\0') {
1047     + if (ts.tst[ts.idx].get[0] == '\0' && ts.tst[ts.idx].put[0] == '\0' &&
1048     + !ts.tst[ts.idx].get_handler) {
1049     eprintk("kgdbts: ERROR: beyond end of test on"
1050     " '%s' line %i\n", ts.name, ts.idx);
1051     return 0;
1052     @@ -907,6 +990,17 @@ static void kgdbts_run_tests(void)
1053     if (ptr)
1054     sstep_test = simple_strtol(ptr+1, NULL, 10);
1055    
1056     + /* All HW break point tests */
1057     + if (arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT) {
1058     + hwbreaks_ok = 1;
1059     + v1printk("kgdbts:RUN hw breakpoint test\n");
1060     + run_breakpoint_test(1);
1061     + v1printk("kgdbts:RUN hw write breakpoint test\n");
1062     + run_hw_break_test(1);
1063     + v1printk("kgdbts:RUN access write breakpoint test\n");
1064     + run_hw_break_test(0);
1065     + }
1066     +
1067     /* required internal KGDB tests */
1068     v1printk("kgdbts:RUN plant and detach test\n");
1069     run_plant_and_detach_test(0);
1070     @@ -924,35 +1018,11 @@ static void kgdbts_run_tests(void)
1071    
1072     /* ===Optional tests=== */
1073    
1074     - /* All HW break point tests */
1075     - if (arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT) {
1076     - hwbreaks_ok = 1;
1077     - v1printk("kgdbts:RUN hw breakpoint test\n");
1078     - run_breakpoint_test(1);
1079     - v1printk("kgdbts:RUN hw write breakpoint test\n");
1080     - run_hw_break_test(1);
1081     - v1printk("kgdbts:RUN access write breakpoint test\n");
1082     - run_hw_break_test(0);
1083     - }
1084     -
1085     if (nmi_sleep) {
1086     v1printk("kgdbts:RUN NMI sleep %i seconds test\n", nmi_sleep);
1087     run_nmi_sleep_test(nmi_sleep);
1088     }
1089    
1090     -#ifdef CONFIG_DEBUG_RODATA
1091     - /* Until there is an api to write to read-only text segments, use
1092     - * HW breakpoints for the remainder of any tests, else print a
1093     - * failure message if hw breakpoints do not work.
1094     - */
1095     - if (!(arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT && hwbreaks_ok)) {
1096     - eprintk("kgdbts: HW breakpoints do not work,"
1097     - "skipping remaining tests\n");
1098     - return;
1099     - }
1100     - force_hwbrks = 1;
1101     -#endif /* CONFIG_DEBUG_RODATA */
1102     -
1103     /* If the do_fork test is run it will be the last test that is
1104     * executed because a kernel thread will be spawned at the very
1105     * end to unregister the debug hooks.
1106     diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
1107     index 9896933..0932024 100644
1108     --- a/drivers/mmc/host/atmel-mci.c
1109     +++ b/drivers/mmc/host/atmel-mci.c
1110     @@ -480,7 +480,14 @@ err:
1111     static inline unsigned int atmci_ns_to_clocks(struct atmel_mci *host,
1112     unsigned int ns)
1113     {
1114     - return (ns * (host->bus_hz / 1000000) + 999) / 1000;
1115     + /*
1116     + * It is easier here to use us instead of ns for the timeout,
1117     + * it prevents from overflows during calculation.
1118     + */
1119     + unsigned int us = DIV_ROUND_UP(ns, 1000);
1120     +
1121     + /* Maximum clock frequency is host->bus_hz/2 */
1122     + return us * (DIV_ROUND_UP(host->bus_hz, 2000000));
1123     }
1124    
1125     static void atmci_set_timeout(struct atmel_mci *host,
1126     diff --git a/drivers/mmc/host/sdhci-dove.c b/drivers/mmc/host/sdhci-dove.c
1127     index a81312c..31acb70 100644
1128     --- a/drivers/mmc/host/sdhci-dove.c
1129     +++ b/drivers/mmc/host/sdhci-dove.c
1130     @@ -20,6 +20,7 @@
1131     */
1132    
1133     #include <linux/io.h>
1134     +#include <linux/module.h>
1135     #include <linux/mmc/host.h>
1136    
1137     #include "sdhci-pltfm.h"
1138     diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
1139     index b78f231..8cd983c 100644
1140     --- a/drivers/mtd/devices/block2mtd.c
1141     +++ b/drivers/mtd/devices/block2mtd.c
1142     @@ -284,6 +284,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size)
1143     dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
1144     dev->mtd.erasesize = erase_size;
1145     dev->mtd.writesize = 1;
1146     + dev->mtd.writebufsize = PAGE_SIZE;
1147     dev->mtd.type = MTD_RAM;
1148     dev->mtd.flags = MTD_CAP_RAM;
1149     dev->mtd.erase = block2mtd_erase;
1150     diff --git a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c
1151     index 3a11ea6..5f12668 100644
1152     --- a/drivers/mtd/devices/lart.c
1153     +++ b/drivers/mtd/devices/lart.c
1154     @@ -630,6 +630,7 @@ static int __init lart_flash_init (void)
1155     mtd.name = module_name;
1156     mtd.type = MTD_NORFLASH;
1157     mtd.writesize = 1;
1158     + mtd.writebufsize = 4;
1159     mtd.flags = MTD_CAP_NORFLASH;
1160     mtd.size = FLASH_BLOCKSIZE_PARAM * FLASH_NUMBLOCKS_16m_PARAM + FLASH_BLOCKSIZE_MAIN * FLASH_NUMBLOCKS_16m_MAIN;
1161     mtd.erasesize = FLASH_BLOCKSIZE_MAIN;
1162     diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
1163     index 884904d..9f9982f 100644
1164     --- a/drivers/mtd/devices/m25p80.c
1165     +++ b/drivers/mtd/devices/m25p80.c
1166     @@ -932,6 +932,7 @@ static int __devinit m25p_probe(struct spi_device *spi)
1167     ppdata.of_node = spi->dev.of_node;
1168     flash->mtd.dev.parent = &spi->dev;
1169     flash->page_size = info->page_size;
1170     + flash->mtd.writebufsize = flash->page_size;
1171    
1172     if (info->addr_width)
1173     flash->addr_width = info->addr_width;
1174     diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c
1175     index d38ef3b..9c35250 100644
1176     --- a/drivers/mtd/devices/sst25l.c
1177     +++ b/drivers/mtd/devices/sst25l.c
1178     @@ -402,6 +402,7 @@ static int __devinit sst25l_probe(struct spi_device *spi)
1179     flash->mtd.flags = MTD_CAP_NORFLASH;
1180     flash->mtd.erasesize = flash_info->erase_size;
1181     flash->mtd.writesize = flash_info->page_size;
1182     + flash->mtd.writebufsize = flash_info->page_size;
1183     flash->mtd.size = flash_info->page_size * flash_info->nr_pages;
1184     flash->mtd.erase = sst25l_erase;
1185     flash->mtd.read = sst25l_read;
1186     diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c
1187     index 3040901..696372f 100644
1188     --- a/drivers/mtd/maps/ixp4xx.c
1189     +++ b/drivers/mtd/maps/ixp4xx.c
1190     @@ -182,6 +182,9 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
1191     {
1192     struct flash_platform_data *plat = dev->dev.platform_data;
1193     struct ixp4xx_flash_info *info;
1194     + struct mtd_part_parser_data ppdata = {
1195     + .origin = dev->resource->start,
1196     + };
1197     int err = -1;
1198    
1199     if (!plat)
1200     @@ -247,7 +250,7 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
1201     /* Use the fast version */
1202     info->map.write = ixp4xx_write16;
1203    
1204     - err = mtd_device_parse_register(info->mtd, probes, dev->resource->start,
1205     + err = mtd_device_parse_register(info->mtd, probes, &ppdata,
1206     plat->parts, plat->nr_parts);
1207     if (err) {
1208     printk(KERN_ERR "Could not parse partitions\n");
1209     diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c
1210     index 4f10e27..764d468 100644
1211     --- a/drivers/mtd/maps/lantiq-flash.c
1212     +++ b/drivers/mtd/maps/lantiq-flash.c
1213     @@ -45,6 +45,7 @@ struct ltq_mtd {
1214     };
1215    
1216     static char ltq_map_name[] = "ltq_nor";
1217     +static const char *ltq_probe_types[] __devinitconst = { "cmdlinepart", NULL };
1218    
1219     static map_word
1220     ltq_read16(struct map_info *map, unsigned long adr)
1221     @@ -168,7 +169,7 @@ ltq_mtd_probe(struct platform_device *pdev)
1222     cfi->addr_unlock1 ^= 1;
1223     cfi->addr_unlock2 ^= 1;
1224    
1225     - err = mtd_device_parse_register(ltq_mtd->mtd, NULL, 0,
1226     + err = mtd_device_parse_register(ltq_mtd->mtd, ltq_probe_types, 0,
1227     ltq_mtd_data->parts, ltq_mtd_data->nr_parts);
1228     if (err) {
1229     dev_err(&pdev->dev, "failed to add partitions\n");
1230     diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
1231     index 493ec2f..f39f83e 100644
1232     --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
1233     +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
1234     @@ -1124,7 +1124,7 @@ static int gpmi_block_markbad(struct mtd_info *mtd, loff_t ofs)
1235     chip->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1);
1236    
1237     /* Do we have a flash based bad block table ? */
1238     - if (chip->options & NAND_BBT_USE_FLASH)
1239     + if (chip->bbt_options & NAND_BBT_USE_FLASH)
1240     ret = nand_update_bbt(mtd, ofs);
1241     else {
1242     chipnr = (int)(ofs >> chip->chip_shift);
1243     diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
1244     index bf40741..3d55883 100644
1245     --- a/drivers/net/ethernet/broadcom/tg3.c
1246     +++ b/drivers/net/ethernet/broadcom/tg3.c
1247     @@ -2794,7 +2794,9 @@ static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power)
1248     if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
1249     GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
1250     (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 &&
1251     - (tp->phy_flags & TG3_PHYFLG_MII_SERDES)))
1252     + (tp->phy_flags & TG3_PHYFLG_MII_SERDES)) ||
1253     + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
1254     + !tp->pci_fn))
1255     return;
1256    
1257     if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX ||
1258     diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
1259     index 4d9f84b..ada234a 100644
1260     --- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
1261     +++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
1262     @@ -356,16 +356,15 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev)
1263    
1264     if (prop)
1265     tbiaddr = *prop;
1266     - }
1267     -
1268     - if (tbiaddr == -1) {
1269     - err = -EBUSY;
1270    
1271     - goto err_free_irqs;
1272     + if (tbiaddr == -1) {
1273     + err = -EBUSY;
1274     + goto err_free_irqs;
1275     + } else {
1276     + out_be32(tbipa, tbiaddr);
1277     + }
1278     }
1279    
1280     - out_be32(tbipa, tbiaddr);
1281     -
1282     err = of_mdiobus_register(new_bus, np);
1283     if (err) {
1284     printk (KERN_ERR "%s: Cannot register as MDIO bus\n",
1285     diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
1286     index f612b35..7eb8a00 100644
1287     --- a/drivers/net/ethernet/marvell/sky2.c
1288     +++ b/drivers/net/ethernet/marvell/sky2.c
1289     @@ -1766,13 +1766,14 @@ static int sky2_open(struct net_device *dev)
1290    
1291     sky2_hw_up(sky2);
1292    
1293     + /* Enable interrupts from phy/mac for port */
1294     + imask = sky2_read32(hw, B0_IMSK);
1295     +
1296     if (hw->chip_id == CHIP_ID_YUKON_OPT ||
1297     hw->chip_id == CHIP_ID_YUKON_PRM ||
1298     hw->chip_id == CHIP_ID_YUKON_OP_2)
1299     imask |= Y2_IS_PHY_QLNK; /* enable PHY Quick Link */
1300    
1301     - /* Enable interrupts from phy/mac for port */
1302     - imask = sky2_read32(hw, B0_IMSK);
1303     imask |= portirq_msk[port];
1304     sky2_write32(hw, B0_IMSK, imask);
1305     sky2_read32(hw, B0_IMSK);
1306     diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
1307     index 0cf2351..697cae3 100644
1308     --- a/drivers/net/ethernet/realtek/r8169.c
1309     +++ b/drivers/net/ethernet/realtek/r8169.c
1310     @@ -6194,6 +6194,9 @@ static void rtl_shutdown(struct pci_dev *pdev)
1311     {
1312     struct net_device *dev = pci_get_drvdata(pdev);
1313     struct rtl8169_private *tp = netdev_priv(dev);
1314     + struct device *d = &pdev->dev;
1315     +
1316     + pm_runtime_get_sync(d);
1317    
1318     rtl8169_net_suspend(dev);
1319    
1320     @@ -6215,6 +6218,8 @@ static void rtl_shutdown(struct pci_dev *pdev)
1321     pci_wake_from_d3(pdev, true);
1322     pci_set_power_state(pdev, PCI_D3hot);
1323     }
1324     +
1325     + pm_runtime_put_noidle(d);
1326     }
1327    
1328     static struct pci_driver rtl8169_pci_driver = {
1329     diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
1330     index 882f53f..82d43b2 100644
1331     --- a/drivers/net/usb/cdc_eem.c
1332     +++ b/drivers/net/usb/cdc_eem.c
1333     @@ -93,6 +93,7 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf)
1334     /* no jumbogram (16K) support for now */
1335    
1336     dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN;
1337     + dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
1338    
1339     return 0;
1340     }
1341     diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c
1342     index 246b3bb..c1e6a44 100644
1343     --- a/drivers/net/usb/zaurus.c
1344     +++ b/drivers/net/usb/zaurus.c
1345     @@ -332,6 +332,11 @@ static const struct usb_device_id products [] = {
1346     .driver_info = ZAURUS_PXA_INFO,
1347     },
1348     {
1349     + /* Motorola Rokr E6 */
1350     + USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6027, USB_CLASS_COMM,
1351     + USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
1352     + .driver_info = (unsigned long) &bogus_mdlm_info,
1353     +}, {
1354     /* Motorola MOTOMAGX phones */
1355     USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM,
1356     USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
1357     diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
1358     index 1f07558..f20678a 100644
1359     --- a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
1360     +++ b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
1361     @@ -1968,7 +1968,7 @@ void rtl92c_phy_set_io(struct ieee80211_hw *hw)
1362     break;
1363     case IO_CMD_PAUSE_DM_BY_SCAN:
1364     rtlphy->initgain_backup.xaagccore1 = dm_digtable.cur_igvalue;
1365     - dm_digtable.cur_igvalue = 0x17;
1366     + dm_digtable.cur_igvalue = 0x37;
1367     rtl92c_dm_write_dig(hw);
1368     break;
1369     default:
1370     diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c
1371     index 0883349..2cf4c5f 100644
1372     --- a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c
1373     +++ b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c
1374     @@ -3192,7 +3192,7 @@ static void rtl92d_phy_set_io(struct ieee80211_hw *hw)
1375     break;
1376     case IO_CMD_PAUSE_DM_BY_SCAN:
1377     rtlphy->initgain_backup.xaagccore1 = de_digtable.cur_igvalue;
1378     - de_digtable.cur_igvalue = 0x17;
1379     + de_digtable.cur_igvalue = 0x37;
1380     rtl92d_dm_write_dig(hw);
1381     break;
1382     default:
1383     diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
1384     index 1e5290b..110e4af 100644
1385     --- a/drivers/platform/x86/acer-wmi.c
1386     +++ b/drivers/platform/x86/acer-wmi.c
1387     @@ -692,6 +692,7 @@ static const struct acpi_device_id norfkill_ids[] = {
1388     { "VPC2004", 0},
1389     { "IBM0068", 0},
1390     { "LEN0068", 0},
1391     + { "SNY5001", 0}, /* sony-laptop in charge */
1392     { "", 0},
1393     };
1394    
1395     diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
1396     index b00c176..d21e8f5 100644
1397     --- a/drivers/pnp/pnpacpi/core.c
1398     +++ b/drivers/pnp/pnpacpi/core.c
1399     @@ -321,9 +321,14 @@ static int __init acpi_pnp_match(struct device *dev, void *_pnp)
1400     {
1401     struct acpi_device *acpi = to_acpi_device(dev);
1402     struct pnp_dev *pnp = _pnp;
1403     + struct device *physical_device;
1404     +
1405     + physical_device = acpi_get_physical_device(acpi->handle);
1406     + if (physical_device)
1407     + put_device(physical_device);
1408    
1409     /* true means it matched */
1410     - return !acpi_get_physical_device(acpi->handle)
1411     + return !physical_device
1412     && compare_pnp_id(pnp->id, acpi_device_hid(acpi));
1413     }
1414    
1415     diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
1416     index cdb774b..5660916 100644
1417     --- a/drivers/target/target_core_transport.c
1418     +++ b/drivers/target/target_core_transport.c
1419     @@ -2666,7 +2666,7 @@ static int transport_generic_cmd_sequencer(
1420     cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB;
1421    
1422     if (target_check_write_same_discard(&cdb[10], dev) < 0)
1423     - goto out_invalid_cdb_field;
1424     + goto out_unsupported_cdb;
1425     if (!passthrough)
1426     cmd->execute_task = target_emulate_write_same;
1427     break;
1428     @@ -2949,7 +2949,7 @@ static int transport_generic_cmd_sequencer(
1429     cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB;
1430    
1431     if (target_check_write_same_discard(&cdb[1], dev) < 0)
1432     - goto out_invalid_cdb_field;
1433     + goto out_unsupported_cdb;
1434     if (!passthrough)
1435     cmd->execute_task = target_emulate_write_same;
1436     break;
1437     @@ -2972,7 +2972,7 @@ static int transport_generic_cmd_sequencer(
1438     * of byte 1 bit 3 UNMAP instead of original reserved field
1439     */
1440     if (target_check_write_same_discard(&cdb[1], dev) < 0)
1441     - goto out_invalid_cdb_field;
1442     + goto out_unsupported_cdb;
1443     if (!passthrough)
1444     cmd->execute_task = target_emulate_write_same;
1445     break;
1446     diff --git a/drivers/target/tcm_fc/tcm_fc.h b/drivers/target/tcm_fc/tcm_fc.h
1447     index e05c551..be7ed12 100644
1448     --- a/drivers/target/tcm_fc/tcm_fc.h
1449     +++ b/drivers/target/tcm_fc/tcm_fc.h
1450     @@ -124,6 +124,7 @@ struct ft_cmd {
1451     /* Local sense buffer */
1452     unsigned char ft_sense_buffer[TRANSPORT_SENSE_BUFFER];
1453     u32 was_ddp_setup:1; /* Set only if ddp is setup */
1454     + u32 aborted:1; /* Set if aborted by reset or timeout */
1455     struct scatterlist *sg; /* Set only if DDP is setup */
1456     u32 sg_cnt; /* No. of item in scatterlist */
1457     };
1458     diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
1459     index 754b669..d95cfe2 100644
1460     --- a/drivers/target/tcm_fc/tfc_cmd.c
1461     +++ b/drivers/target/tcm_fc/tfc_cmd.c
1462     @@ -130,6 +130,8 @@ int ft_queue_status(struct se_cmd *se_cmd)
1463     struct fc_exch *ep;
1464     size_t len;
1465    
1466     + if (cmd->aborted)
1467     + return 0;
1468     ft_dump_cmd(cmd, __func__);
1469     ep = fc_seq_exch(cmd->seq);
1470     lport = ep->lp;
1471     @@ -196,6 +198,8 @@ int ft_write_pending(struct se_cmd *se_cmd)
1472    
1473     ft_dump_cmd(cmd, __func__);
1474    
1475     + if (cmd->aborted)
1476     + return 0;
1477     ep = fc_seq_exch(cmd->seq);
1478     lport = ep->lp;
1479     fp = fc_frame_alloc(lport, sizeof(*txrdy));
1480     @@ -266,10 +270,10 @@ static void ft_recv_seq(struct fc_seq *sp, struct fc_frame *fp, void *arg)
1481     struct ft_cmd *cmd = arg;
1482     struct fc_frame_header *fh;
1483    
1484     - if (IS_ERR(fp)) {
1485     + if (unlikely(IS_ERR(fp))) {
1486     /* XXX need to find cmd if queued */
1487     cmd->seq = NULL;
1488     - transport_generic_free_cmd(&cmd->se_cmd, 0);
1489     + cmd->aborted = true;
1490     return;
1491     }
1492    
1493     @@ -447,6 +451,8 @@ int ft_queue_tm_resp(struct se_cmd *se_cmd)
1494     struct se_tmr_req *tmr = se_cmd->se_tmr_req;
1495     enum fcp_resp_rsp_codes code;
1496    
1497     + if (cmd->aborted)
1498     + return 0;
1499     switch (tmr->response) {
1500     case TMR_FUNCTION_COMPLETE:
1501     code = FCP_TMF_CMPL;
1502     diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c
1503     index 9402b73..7962325 100644
1504     --- a/drivers/target/tcm_fc/tfc_conf.c
1505     +++ b/drivers/target/tcm_fc/tfc_conf.c
1506     @@ -304,6 +304,7 @@ static struct se_portal_group *ft_add_tpg(
1507     {
1508     struct ft_lport_acl *lacl;
1509     struct ft_tpg *tpg;
1510     + struct workqueue_struct *wq;
1511     unsigned long index;
1512     int ret;
1513    
1514     @@ -325,18 +326,20 @@ static struct se_portal_group *ft_add_tpg(
1515     tpg->lport_acl = lacl;
1516     INIT_LIST_HEAD(&tpg->lun_list);
1517    
1518     - ret = core_tpg_register(&ft_configfs->tf_ops, wwn, &tpg->se_tpg,
1519     - tpg, TRANSPORT_TPG_TYPE_NORMAL);
1520     - if (ret < 0) {
1521     + wq = alloc_workqueue("tcm_fc", 0, 1);
1522     + if (!wq) {
1523     kfree(tpg);
1524     return NULL;
1525     }
1526    
1527     - tpg->workqueue = alloc_workqueue("tcm_fc", 0, 1);
1528     - if (!tpg->workqueue) {
1529     + ret = core_tpg_register(&ft_configfs->tf_ops, wwn, &tpg->se_tpg,
1530     + tpg, TRANSPORT_TPG_TYPE_NORMAL);
1531     + if (ret < 0) {
1532     + destroy_workqueue(wq);
1533     kfree(tpg);
1534     return NULL;
1535     }
1536     + tpg->workqueue = wq;
1537    
1538     mutex_lock(&ft_lport_lock);
1539     list_add_tail(&tpg->list, &lacl->tpg_list);
1540     diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c
1541     index 1369b1c..ada131c 100644
1542     --- a/drivers/target/tcm_fc/tfc_io.c
1543     +++ b/drivers/target/tcm_fc/tfc_io.c
1544     @@ -84,6 +84,8 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
1545     void *from;
1546     void *to = NULL;
1547    
1548     + if (cmd->aborted)
1549     + return 0;
1550     ep = fc_seq_exch(cmd->seq);
1551     lport = ep->lp;
1552     cmd->seq = lport->tt.seq_start_next(cmd->seq);
1553     diff --git a/fs/cifs/file.c b/fs/cifs/file.c
1554     index 159fcc5..0f7dc22 100644
1555     --- a/fs/cifs/file.c
1556     +++ b/fs/cifs/file.c
1557     @@ -835,13 +835,21 @@ cifs_posix_lock_set(struct file *file, struct file_lock *flock)
1558     if ((flock->fl_flags & FL_POSIX) == 0)
1559     return rc;
1560    
1561     +try_again:
1562     mutex_lock(&cinode->lock_mutex);
1563     if (!cinode->can_cache_brlcks) {
1564     mutex_unlock(&cinode->lock_mutex);
1565     return rc;
1566     }
1567     - rc = posix_lock_file_wait(file, flock);
1568     +
1569     + rc = posix_lock_file(file, flock, NULL);
1570     mutex_unlock(&cinode->lock_mutex);
1571     + if (rc == FILE_LOCK_DEFERRED) {
1572     + rc = wait_event_interruptible(flock->fl_wait, !flock->fl_next);
1573     + if (!rc)
1574     + goto try_again;
1575     + locks_delete_block(flock);
1576     + }
1577     return rc;
1578     }
1579    
1580     diff --git a/fs/locks.c b/fs/locks.c
1581     index 637694b..0d68f1f 100644
1582     --- a/fs/locks.c
1583     +++ b/fs/locks.c
1584     @@ -510,12 +510,13 @@ static void __locks_delete_block(struct file_lock *waiter)
1585    
1586     /*
1587     */
1588     -static void locks_delete_block(struct file_lock *waiter)
1589     +void locks_delete_block(struct file_lock *waiter)
1590     {
1591     lock_flocks();
1592     __locks_delete_block(waiter);
1593     unlock_flocks();
1594     }
1595     +EXPORT_SYMBOL(locks_delete_block);
1596    
1597     /* Insert waiter into blocker's block list.
1598     * We use a circular list so that processes can be easily woken up in
1599     diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
1600     index d945700..757293b 100644
1601     --- a/fs/nfs/nfs4proc.c
1602     +++ b/fs/nfs/nfs4proc.c
1603     @@ -3618,7 +3618,7 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
1604     if (acl_len > buflen)
1605     goto out_free;
1606     _copy_from_pages(buf, pages, res.acl_data_offset,
1607     - res.acl_len);
1608     + acl_len);
1609     }
1610     ret = acl_len;
1611     out_free:
1612     diff --git a/include/linux/fs.h b/include/linux/fs.h
1613     index 10b2288..11f1951 100644
1614     --- a/include/linux/fs.h
1615     +++ b/include/linux/fs.h
1616     @@ -1203,6 +1203,7 @@ extern int vfs_setlease(struct file *, long, struct file_lock **);
1617     extern int lease_modify(struct file_lock **, int);
1618     extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
1619     extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
1620     +extern void locks_delete_block(struct file_lock *waiter);
1621     extern void lock_flocks(void);
1622     extern void unlock_flocks(void);
1623     #else /* !CONFIG_FILE_LOCKING */
1624     @@ -1347,6 +1348,10 @@ static inline int lock_may_write(struct inode *inode, loff_t start,
1625     return 1;
1626     }
1627    
1628     +static inline void locks_delete_block(struct file_lock *waiter)
1629     +{
1630     +}
1631     +
1632     static inline void lock_flocks(void)
1633     {
1634     }
1635     diff --git a/include/linux/kernel.h b/include/linux/kernel.h
1636     index e8b1597..a70783d 100644
1637     --- a/include/linux/kernel.h
1638     +++ b/include/linux/kernel.h
1639     @@ -85,6 +85,19 @@
1640     } \
1641     )
1642    
1643     +/*
1644     + * Multiplies an integer by a fraction, while avoiding unnecessary
1645     + * overflow or loss of precision.
1646     + */
1647     +#define mult_frac(x, numer, denom)( \
1648     +{ \
1649     + typeof(x) quot = (x) / (denom); \
1650     + typeof(x) rem = (x) % (denom); \
1651     + (quot * (numer)) + ((rem * (numer)) / (denom)); \
1652     +} \
1653     +)
1654     +
1655     +
1656     #define _RET_IP_ (unsigned long)__builtin_return_address(0)
1657     #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
1658    
1659     diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
1660     index fa39183..c4d2fc1 100644
1661     --- a/include/linux/kgdb.h
1662     +++ b/include/linux/kgdb.h
1663     @@ -63,7 +63,8 @@ enum kgdb_bptype {
1664     BP_HARDWARE_BREAKPOINT,
1665     BP_WRITE_WATCHPOINT,
1666     BP_READ_WATCHPOINT,
1667     - BP_ACCESS_WATCHPOINT
1668     + BP_ACCESS_WATCHPOINT,
1669     + BP_POKE_BREAKPOINT,
1670     };
1671    
1672     enum kgdb_bpstate {
1673     @@ -207,8 +208,8 @@ extern void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc);
1674    
1675     /* Optional functions. */
1676     extern int kgdb_validate_break_address(unsigned long addr);
1677     -extern int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr);
1678     -extern int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle);
1679     +extern int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt);
1680     +extern int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt);
1681    
1682     /**
1683     * kgdb_arch_late - Perform any architecture specific initalization.
1684     diff --git a/kernel/cred.c b/kernel/cred.c
1685     index 5791612..48c6fd3 100644
1686     --- a/kernel/cred.c
1687     +++ b/kernel/cred.c
1688     @@ -385,6 +385,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)
1689     struct cred *new;
1690     int ret;
1691    
1692     + p->replacement_session_keyring = NULL;
1693     +
1694     if (
1695     #ifdef CONFIG_KEYS
1696     !p->cred->thread_keyring &&
1697     diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
1698     index 0d7c087..7fda904 100644
1699     --- a/kernel/debug/debug_core.c
1700     +++ b/kernel/debug/debug_core.c
1701     @@ -157,37 +157,39 @@ early_param("nokgdbroundup", opt_nokgdbroundup);
1702     * Weak aliases for breakpoint management,
1703     * can be overriden by architectures when needed:
1704     */
1705     -int __weak kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr)
1706     +int __weak kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
1707     {
1708     int err;
1709    
1710     - err = probe_kernel_read(saved_instr, (char *)addr, BREAK_INSTR_SIZE);
1711     + err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
1712     + BREAK_INSTR_SIZE);
1713     if (err)
1714     return err;
1715     -
1716     - return probe_kernel_write((char *)addr, arch_kgdb_ops.gdb_bpt_instr,
1717     - BREAK_INSTR_SIZE);
1718     + err = probe_kernel_write((char *)bpt->bpt_addr,
1719     + arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE);
1720     + return err;
1721     }
1722    
1723     -int __weak kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle)
1724     +int __weak kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
1725     {
1726     - return probe_kernel_write((char *)addr,
1727     - (char *)bundle, BREAK_INSTR_SIZE);
1728     + return probe_kernel_write((char *)bpt->bpt_addr,
1729     + (char *)bpt->saved_instr, BREAK_INSTR_SIZE);
1730     }
1731    
1732     int __weak kgdb_validate_break_address(unsigned long addr)
1733     {
1734     - char tmp_variable[BREAK_INSTR_SIZE];
1735     + struct kgdb_bkpt tmp;
1736     int err;
1737     - /* Validate setting the breakpoint and then removing it. In the
1738     + /* Validate setting the breakpoint and then removing it. If the
1739     * remove fails, the kernel needs to emit a bad message because we
1740     * are deep trouble not being able to put things back the way we
1741     * found them.
1742     */
1743     - err = kgdb_arch_set_breakpoint(addr, tmp_variable);
1744     + tmp.bpt_addr = addr;
1745     + err = kgdb_arch_set_breakpoint(&tmp);
1746     if (err)
1747     return err;
1748     - err = kgdb_arch_remove_breakpoint(addr, tmp_variable);
1749     + err = kgdb_arch_remove_breakpoint(&tmp);
1750     if (err)
1751     printk(KERN_ERR "KGDB: Critical breakpoint error, kernel "
1752     "memory destroyed at: %lx", addr);
1753     @@ -231,7 +233,6 @@ static void kgdb_flush_swbreak_addr(unsigned long addr)
1754     */
1755     int dbg_activate_sw_breakpoints(void)
1756     {
1757     - unsigned long addr;
1758     int error;
1759     int ret = 0;
1760     int i;
1761     @@ -240,16 +241,15 @@ int dbg_activate_sw_breakpoints(void)
1762     if (kgdb_break[i].state != BP_SET)
1763     continue;
1764    
1765     - addr = kgdb_break[i].bpt_addr;
1766     - error = kgdb_arch_set_breakpoint(addr,
1767     - kgdb_break[i].saved_instr);
1768     + error = kgdb_arch_set_breakpoint(&kgdb_break[i]);
1769     if (error) {
1770     ret = error;
1771     - printk(KERN_INFO "KGDB: BP install failed: %lx", addr);
1772     + printk(KERN_INFO "KGDB: BP install failed: %lx",
1773     + kgdb_break[i].bpt_addr);
1774     continue;
1775     }
1776    
1777     - kgdb_flush_swbreak_addr(addr);
1778     + kgdb_flush_swbreak_addr(kgdb_break[i].bpt_addr);
1779     kgdb_break[i].state = BP_ACTIVE;
1780     }
1781     return ret;
1782     @@ -298,7 +298,6 @@ int dbg_set_sw_break(unsigned long addr)
1783    
1784     int dbg_deactivate_sw_breakpoints(void)
1785     {
1786     - unsigned long addr;
1787     int error;
1788     int ret = 0;
1789     int i;
1790     @@ -306,15 +305,14 @@ int dbg_deactivate_sw_breakpoints(void)
1791     for (i = 0; i < KGDB_MAX_BREAKPOINTS; i++) {
1792     if (kgdb_break[i].state != BP_ACTIVE)
1793     continue;
1794     - addr = kgdb_break[i].bpt_addr;
1795     - error = kgdb_arch_remove_breakpoint(addr,
1796     - kgdb_break[i].saved_instr);
1797     + error = kgdb_arch_remove_breakpoint(&kgdb_break[i]);
1798     if (error) {
1799     - printk(KERN_INFO "KGDB: BP remove failed: %lx\n", addr);
1800     + printk(KERN_INFO "KGDB: BP remove failed: %lx\n",
1801     + kgdb_break[i].bpt_addr);
1802     ret = error;
1803     }
1804    
1805     - kgdb_flush_swbreak_addr(addr);
1806     + kgdb_flush_swbreak_addr(kgdb_break[i].bpt_addr);
1807     kgdb_break[i].state = BP_SET;
1808     }
1809     return ret;
1810     @@ -348,7 +346,6 @@ int kgdb_isremovedbreak(unsigned long addr)
1811    
1812     int dbg_remove_all_break(void)
1813     {
1814     - unsigned long addr;
1815     int error;
1816     int i;
1817    
1818     @@ -356,12 +353,10 @@ int dbg_remove_all_break(void)
1819     for (i = 0; i < KGDB_MAX_BREAKPOINTS; i++) {
1820     if (kgdb_break[i].state != BP_ACTIVE)
1821     goto setundefined;
1822     - addr = kgdb_break[i].bpt_addr;
1823     - error = kgdb_arch_remove_breakpoint(addr,
1824     - kgdb_break[i].saved_instr);
1825     + error = kgdb_arch_remove_breakpoint(&kgdb_break[i]);
1826     if (error)
1827     printk(KERN_ERR "KGDB: breakpoint remove failed: %lx\n",
1828     - addr);
1829     + kgdb_break[i].bpt_addr);
1830     setundefined:
1831     kgdb_break[i].state = BP_UNDEFINED;
1832     }
1833     diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c
1834     index 4742090..c3c8975 100644
1835     --- a/kernel/irq/migration.c
1836     +++ b/kernel/irq/migration.c
1837     @@ -43,12 +43,16 @@ void irq_move_masked_irq(struct irq_data *idata)
1838     * masking the irqs.
1839     */
1840     if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask)
1841     - < nr_cpu_ids))
1842     - if (!chip->irq_set_affinity(&desc->irq_data,
1843     - desc->pending_mask, false)) {
1844     + < nr_cpu_ids)) {
1845     + int ret = chip->irq_set_affinity(&desc->irq_data,
1846     + desc->pending_mask, false);
1847     + switch (ret) {
1848     + case IRQ_SET_MASK_OK:
1849     cpumask_copy(desc->irq_data.affinity, desc->pending_mask);
1850     + case IRQ_SET_MASK_OK_NOCOPY:
1851     irq_set_thread_affinity(desc);
1852     }
1853     + }
1854    
1855     cpumask_clear(desc->pending_mask);
1856     }
1857     diff --git a/kernel/sysctl.c b/kernel/sysctl.c
1858     index ae27196..ea7ec7f 100644
1859     --- a/kernel/sysctl.c
1860     +++ b/kernel/sysctl.c
1861     @@ -166,7 +166,7 @@ static int proc_taint(struct ctl_table *table, int write,
1862     #endif
1863    
1864     #ifdef CONFIG_PRINTK
1865     -static int proc_dmesg_restrict(struct ctl_table *table, int write,
1866     +static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
1867     void __user *buffer, size_t *lenp, loff_t *ppos);
1868     #endif
1869    
1870     @@ -713,7 +713,7 @@ static struct ctl_table kern_table[] = {
1871     .data = &dmesg_restrict,
1872     .maxlen = sizeof(int),
1873     .mode = 0644,
1874     - .proc_handler = proc_dointvec_minmax,
1875     + .proc_handler = proc_dointvec_minmax_sysadmin,
1876     .extra1 = &zero,
1877     .extra2 = &one,
1878     },
1879     @@ -722,7 +722,7 @@ static struct ctl_table kern_table[] = {
1880     .data = &kptr_restrict,
1881     .maxlen = sizeof(int),
1882     .mode = 0644,
1883     - .proc_handler = proc_dmesg_restrict,
1884     + .proc_handler = proc_dointvec_minmax_sysadmin,
1885     .extra1 = &zero,
1886     .extra2 = &two,
1887     },
1888     @@ -2422,7 +2422,7 @@ static int proc_taint(struct ctl_table *table, int write,
1889     }
1890    
1891     #ifdef CONFIG_PRINTK
1892     -static int proc_dmesg_restrict(struct ctl_table *table, int write,
1893     +static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
1894     void __user *buffer, size_t *lenp, loff_t *ppos)
1895     {
1896     if (write && !capable(CAP_SYS_ADMIN))
1897     diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
1898     index f2bd275..697e49d 100644
1899     --- a/kernel/trace/trace.c
1900     +++ b/kernel/trace/trace.c
1901     @@ -1642,6 +1642,7 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu,
1902     int cpu_file = iter->cpu_file;
1903     u64 next_ts = 0, ts;
1904     int next_cpu = -1;
1905     + int next_size = 0;
1906     int cpu;
1907    
1908     /*
1909     @@ -1673,9 +1674,12 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu,
1910     next_cpu = cpu;
1911     next_ts = ts;
1912     next_lost = lost_events;
1913     + next_size = iter->ent_size;
1914     }
1915     }
1916    
1917     + iter->ent_size = next_size;
1918     +
1919     if (ent_cpu)
1920     *ent_cpu = next_cpu;
1921    
1922     diff --git a/kernel/trace/trace_entries.h b/kernel/trace/trace_entries.h
1923     index 9336590..205dcac 100644
1924     --- a/kernel/trace/trace_entries.h
1925     +++ b/kernel/trace/trace_entries.h
1926     @@ -156,6 +156,12 @@ FTRACE_ENTRY_DUP(wakeup, ctx_switch_entry,
1927    
1928     #define FTRACE_STACK_ENTRIES 8
1929    
1930     +#ifndef CONFIG_64BIT
1931     +# define IP_FMT "%08lx"
1932     +#else
1933     +# define IP_FMT "%016lx"
1934     +#endif
1935     +
1936     FTRACE_ENTRY(kernel_stack, stack_entry,
1937    
1938     TRACE_STACK,
1939     @@ -165,8 +171,9 @@ FTRACE_ENTRY(kernel_stack, stack_entry,
1940     __dynamic_array(unsigned long, caller )
1941     ),
1942    
1943     - F_printk("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n"
1944     - "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n",
1945     + F_printk("\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
1946     + "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
1947     + "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n",
1948     __entry->caller[0], __entry->caller[1], __entry->caller[2],
1949     __entry->caller[3], __entry->caller[4], __entry->caller[5],
1950     __entry->caller[6], __entry->caller[7])
1951     @@ -181,8 +188,9 @@ FTRACE_ENTRY(user_stack, userstack_entry,
1952     __array( unsigned long, caller, FTRACE_STACK_ENTRIES )
1953     ),
1954    
1955     - F_printk("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n"
1956     - "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n",
1957     + F_printk("\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
1958     + "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
1959     + "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n",
1960     __entry->caller[0], __entry->caller[1], __entry->caller[2],
1961     __entry->caller[3], __entry->caller[4], __entry->caller[5],
1962     __entry->caller[6], __entry->caller[7])
1963     diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
1964     index bbeec31..ad4000c 100644
1965     --- a/kernel/trace/trace_export.c
1966     +++ b/kernel/trace/trace_export.c
1967     @@ -150,7 +150,7 @@ ftrace_define_fields_##name(struct ftrace_event_call *event_call) \
1968     #define __dynamic_array(type, item)
1969    
1970     #undef F_printk
1971     -#define F_printk(fmt, args...) #fmt ", " __stringify(args)
1972     +#define F_printk(fmt, args...) __stringify(fmt) ", " __stringify(args)
1973    
1974     #undef FTRACE_ENTRY
1975     #define FTRACE_ENTRY(call, struct_name, etype, tstruct, print) \
1976     diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
1977     index c1c597e..98bfbd5 100644
1978     --- a/net/bluetooth/hci_conn.c
1979     +++ b/net/bluetooth/hci_conn.c
1980     @@ -608,6 +608,10 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
1981    
1982     if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
1983     struct hci_cp_auth_requested cp;
1984     +
1985     + /* encrypt must be pending if auth is also pending */
1986     + set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend);
1987     +
1988     cp.handle = cpu_to_le16(conn->handle);
1989     hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
1990     sizeof(cp), &cp);
1991     diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
1992     index 41c2310..aea1559 100644
1993     --- a/net/mac80211/agg-rx.c
1994     +++ b/net/mac80211/agg-rx.c
1995     @@ -49,6 +49,8 @@ static void ieee80211_free_tid_rx(struct rcu_head *h)
1996     container_of(h, struct tid_ampdu_rx, rcu_head);
1997     int i;
1998    
1999     + del_timer_sync(&tid_rx->reorder_timer);
2000     +
2001     for (i = 0; i < tid_rx->buf_size; i++)
2002     dev_kfree_skb(tid_rx->reorder_buf[i]);
2003     kfree(tid_rx->reorder_buf);
2004     @@ -88,7 +90,6 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
2005     tid, 0, reason);
2006    
2007     del_timer_sync(&tid_rx->session_timer);
2008     - del_timer_sync(&tid_rx->reorder_timer);
2009    
2010     call_rcu(&tid_rx->rcu_head, ieee80211_free_tid_rx);
2011     }
2012     diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c
2013     index 178ff4f..2679507 100644
2014     --- a/net/rose/rose_dev.c
2015     +++ b/net/rose/rose_dev.c
2016     @@ -96,11 +96,11 @@ static int rose_set_mac_address(struct net_device *dev, void *addr)
2017     struct sockaddr *sa = addr;
2018     int err;
2019    
2020     - if (!memcpy(dev->dev_addr, sa->sa_data, dev->addr_len))
2021     + if (!memcmp(dev->dev_addr, sa->sa_data, dev->addr_len))
2022     return 0;
2023    
2024     if (dev->flags & IFF_UP) {
2025     - err = rose_add_loopback_node((rose_address *)dev->dev_addr);
2026     + err = rose_add_loopback_node((rose_address *)sa->sa_data);
2027     if (err)
2028     return err;
2029    
2030     diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
2031     index 2bd594e..619228d 100644
2032     --- a/scripts/mod/modpost.c
2033     +++ b/scripts/mod/modpost.c
2034     @@ -132,8 +132,10 @@ static struct module *new_module(char *modname)
2035     /* strip trailing .o */
2036     s = strrchr(p, '.');
2037     if (s != NULL)
2038     - if (strcmp(s, ".o") == 0)
2039     + if (strcmp(s, ".o") == 0) {
2040     *s = '\0';
2041     + mod->is_dot_o = 1;
2042     + }
2043    
2044     /* add to list */
2045     mod->name = p;
2046     @@ -587,7 +589,8 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
2047     unsigned int crc;
2048     enum export export;
2049    
2050     - if (!is_vmlinux(mod->name) && strncmp(symname, "__ksymtab", 9) == 0)
2051     + if ((!is_vmlinux(mod->name) || mod->is_dot_o) &&
2052     + strncmp(symname, "__ksymtab", 9) == 0)
2053     export = export_from_secname(info, get_secindex(info, sym));
2054     else
2055     export = export_from_sec(info, get_secindex(info, sym));
2056     @@ -849,7 +852,7 @@ static void check_section(const char *modname, struct elf_info *elf,
2057    
2058     #define ALL_INIT_DATA_SECTIONS \
2059     ".init.setup$", ".init.rodata$", \
2060     - ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$" \
2061     + ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$", \
2062     ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$"
2063     #define ALL_EXIT_DATA_SECTIONS \
2064     ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$"
2065     diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
2066     index 2031119..51207e4 100644
2067     --- a/scripts/mod/modpost.h
2068     +++ b/scripts/mod/modpost.h
2069     @@ -113,6 +113,7 @@ struct module {
2070     int has_cleanup;
2071     struct buffer dev_table_buf;
2072     char srcversion[25];
2073     + int is_dot_o;
2074     };
2075    
2076     struct elf_info {
2077     diff --git a/security/tomoyo/mount.c b/security/tomoyo/mount.c
2078     index bee09d0..fe00cdf 100644
2079     --- a/security/tomoyo/mount.c
2080     +++ b/security/tomoyo/mount.c
2081     @@ -199,30 +199,32 @@ int tomoyo_mount_permission(char *dev_name, struct path *path,
2082     if (flags & MS_REMOUNT) {
2083     type = tomoyo_mounts[TOMOYO_MOUNT_REMOUNT];
2084     flags &= ~MS_REMOUNT;
2085     - }
2086     - if (flags & MS_MOVE) {
2087     - type = tomoyo_mounts[TOMOYO_MOUNT_MOVE];
2088     - flags &= ~MS_MOVE;
2089     - }
2090     - if (flags & MS_BIND) {
2091     + } else if (flags & MS_BIND) {
2092     type = tomoyo_mounts[TOMOYO_MOUNT_BIND];
2093     flags &= ~MS_BIND;
2094     - }
2095     - if (flags & MS_UNBINDABLE) {
2096     - type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_UNBINDABLE];
2097     - flags &= ~MS_UNBINDABLE;
2098     - }
2099     - if (flags & MS_PRIVATE) {
2100     + } else if (flags & MS_SHARED) {
2101     + if (flags & (MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
2102     + return -EINVAL;
2103     + type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_SHARED];
2104     + flags &= ~MS_SHARED;
2105     + } else if (flags & MS_PRIVATE) {
2106     + if (flags & (MS_SHARED | MS_SLAVE | MS_UNBINDABLE))
2107     + return -EINVAL;
2108     type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_PRIVATE];
2109     flags &= ~MS_PRIVATE;
2110     - }
2111     - if (flags & MS_SLAVE) {
2112     + } else if (flags & MS_SLAVE) {
2113     + if (flags & (MS_SHARED | MS_PRIVATE | MS_UNBINDABLE))
2114     + return -EINVAL;
2115     type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_SLAVE];
2116     flags &= ~MS_SLAVE;
2117     - }
2118     - if (flags & MS_SHARED) {
2119     - type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_SHARED];
2120     - flags &= ~MS_SHARED;
2121     + } else if (flags & MS_UNBINDABLE) {
2122     + if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE))
2123     + return -EINVAL;
2124     + type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_UNBINDABLE];
2125     + flags &= ~MS_UNBINDABLE;
2126     + } else if (flags & MS_MOVE) {
2127     + type = tomoyo_mounts[TOMOYO_MOUNT_MOVE];
2128     + flags &= ~MS_MOVE;
2129     }
2130     if (!type)
2131     type = "<NULL>";
2132     diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
2133     index 12c1bde..1c4999d 100644
2134     --- a/sound/soc/codecs/ak4642.c
2135     +++ b/sound/soc/codecs/ak4642.c
2136     @@ -144,7 +144,7 @@
2137     * min : 0xFE : -115.0 dB
2138     * mute: 0xFF
2139     */
2140     -static const DECLARE_TLV_DB_SCALE(out_tlv, -11500, 50, 1);
2141     +static const DECLARE_TLV_DB_SCALE(out_tlv, -11550, 50, 1);
2142    
2143     static const struct snd_kcontrol_new ak4642_snd_controls[] = {
2144    
2145     diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
2146     index 6e502af..2f1f5f8 100644
2147     --- a/sound/soc/codecs/wm8994.c
2148     +++ b/sound/soc/codecs/wm8994.c
2149     @@ -3190,7 +3190,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
2150     case 2:
2151     case 3:
2152     wm8994->hubs.dcs_codes_l = -9;
2153     - wm8994->hubs.dcs_codes_r = -5;
2154     + wm8994->hubs.dcs_codes_r = -7;
2155     break;
2156     default:
2157     break;