Magellan Linux

Contents of /trunk/kernel26-mcore/patches-2.6.37-r4/0101-2.6.37.2-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1301 - (show annotations) (download)
Thu Mar 10 22:13:57 2011 UTC (13 years, 1 month ago) by niro
File size: 82804 byte(s)
2.6.37-mcore-r4: updated to linux-2.6.37.3
1 diff --git a/Documentation/hwmon/jc42 b/Documentation/hwmon/jc42
2 index 0e76ef1..a22ecf4 100644
3 --- a/Documentation/hwmon/jc42
4 +++ b/Documentation/hwmon/jc42
5 @@ -51,7 +51,8 @@ Supported chips:
6 * JEDEC JC 42.4 compliant temperature sensor chips
7 Prefix: 'jc42'
8 Addresses scanned: I2C 0x18 - 0x1f
9 - Datasheet: -
10 + Datasheet:
11 + http://www.jedec.org/sites/default/files/docs/4_01_04R19.pdf
12
13 Author:
14 Guenter Roeck <guenter.roeck@ericsson.com>
15 @@ -60,7 +61,11 @@ Author:
16 Description
17 -----------
18
19 -This driver implements support for JEDEC JC 42.4 compliant temperature sensors.
20 +This driver implements support for JEDEC JC 42.4 compliant temperature sensors,
21 +which are used on many DDR3 memory modules for mobile devices and servers. Some
22 +systems use the sensor to prevent memory overheating by automatically throttling
23 +the memory controller.
24 +
25 The driver auto-detects the chips listed above, but can be manually instantiated
26 to support other JC 42.4 compliant chips.
27
28 @@ -81,15 +86,19 @@ limits. The chip supports only a single register to configure the hysteresis,
29 which applies to all limits. This register can be written by writing into
30 temp1_crit_hyst. Other hysteresis attributes are read-only.
31
32 +If the BIOS has configured the sensor for automatic temperature management, it
33 +is likely that it has locked the registers, i.e., that the temperature limits
34 +cannot be changed.
35 +
36 Sysfs entries
37 -------------
38
39 temp1_input Temperature (RO)
40 -temp1_min Minimum temperature (RW)
41 -temp1_max Maximum temperature (RW)
42 -temp1_crit Critical high temperature (RW)
43 +temp1_min Minimum temperature (RO or RW)
44 +temp1_max Maximum temperature (RO or RW)
45 +temp1_crit Critical high temperature (RO or RW)
46
47 -temp1_crit_hyst Critical hysteresis temperature (RW)
48 +temp1_crit_hyst Critical hysteresis temperature (RO or RW)
49 temp1_max_hyst Maximum hysteresis temperature (RO)
50
51 temp1_min_alarm Temperature low alarm
52 diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp
53 index 6526eee..d2b56a4 100644
54 --- a/Documentation/hwmon/k10temp
55 +++ b/Documentation/hwmon/k10temp
56 @@ -9,6 +9,8 @@ Supported chips:
57 Socket S1G3: Athlon II, Sempron, Turion II
58 * AMD Family 11h processors:
59 Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
60 +* AMD Family 12h processors: "Llano"
61 +* AMD Family 14h processors: "Brazos" (C/E/G-Series)
62
63 Prefix: 'k10temp'
64 Addresses scanned: PCI space
65 @@ -17,10 +19,14 @@ Supported chips:
66 http://support.amd.com/us/Processor_TechDocs/31116.pdf
67 BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors:
68 http://support.amd.com/us/Processor_TechDocs/41256.pdf
69 + BIOS and Kernel Developer's Guide (BKDG) for AMD Family 14h Models 00h-0Fh Processors:
70 + http://support.amd.com/us/Processor_TechDocs/43170.pdf
71 Revision Guide for AMD Family 10h Processors:
72 http://support.amd.com/us/Processor_TechDocs/41322.pdf
73 Revision Guide for AMD Family 11h Processors:
74 http://support.amd.com/us/Processor_TechDocs/41788.pdf
75 + Revision Guide for AMD Family 14h Models 00h-0Fh Processors:
76 + http://support.amd.com/us/Processor_TechDocs/47534.pdf
77 AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks:
78 http://support.amd.com/us/Processor_TechDocs/43373.pdf
79 AMD Family 10h Server and Workstation Processor Power and Thermal Data Sheet:
80 @@ -34,7 +40,7 @@ Description
81 -----------
82
83 This driver permits reading of the internal temperature sensor of AMD
84 -Family 10h and 11h processors.
85 +Family 10h/11h/12h/14h processors.
86
87 All these processors have a sensor, but on those for Socket F or AM2+,
88 the sensor may return inconsistent values (erratum 319). The driver
89 diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
90 index 907d5a6..abaf844 100644
91 --- a/arch/arm/kernel/signal.c
92 +++ b/arch/arm/kernel/signal.c
93 @@ -474,7 +474,9 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka,
94 unsigned long handler = (unsigned long)ka->sa.sa_handler;
95 unsigned long retcode;
96 int thumb = 0;
97 - unsigned long cpsr = regs->ARM_cpsr & ~PSR_f;
98 + unsigned long cpsr = regs->ARM_cpsr & ~(PSR_f | PSR_E_BIT);
99 +
100 + cpsr |= PSR_ENDSTATE;
101
102 /*
103 * Maybe we need to deliver a 32-bit signal to a 26-bit task.
104 diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
105 index cead889..223ba96 100644
106 --- a/arch/arm/kernel/vmlinux.lds.S
107 +++ b/arch/arm/kernel/vmlinux.lds.S
108 @@ -21,6 +21,12 @@
109 #define ARM_CPU_KEEP(x)
110 #endif
111
112 +#if defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)
113 +#define ARM_EXIT_KEEP(x) x
114 +#else
115 +#define ARM_EXIT_KEEP(x)
116 +#endif
117 +
118 OUTPUT_ARCH(arm)
119 ENTRY(stext)
120
121 @@ -43,6 +49,7 @@ SECTIONS
122 _sinittext = .;
123 HEAD_TEXT
124 INIT_TEXT
125 + ARM_EXIT_KEEP(EXIT_TEXT)
126 _einittext = .;
127 ARM_CPU_DISCARD(PROC_INFO)
128 __arch_info_begin = .;
129 @@ -67,6 +74,7 @@ SECTIONS
130 #ifndef CONFIG_XIP_KERNEL
131 __init_begin = _stext;
132 INIT_DATA
133 + ARM_EXIT_KEEP(EXIT_DATA)
134 #endif
135 }
136
137 @@ -161,6 +169,7 @@ SECTIONS
138 . = ALIGN(PAGE_SIZE);
139 __init_begin = .;
140 INIT_DATA
141 + ARM_EXIT_KEEP(EXIT_DATA)
142 . = ALIGN(PAGE_SIZE);
143 __init_end = .;
144 #endif
145 diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
146 index 27692d0..cfb7607 100644
147 --- a/arch/arm/mach-sa1100/simpad.c
148 +++ b/arch/arm/mach-sa1100/simpad.c
149 @@ -166,9 +166,6 @@ static void __init simpad_map_io(void)
150 PCFR = 0;
151 PSDR = 0;
152
153 - sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources,
154 - ARRAY_SIZE(simpad_flash_resources));
155 - sa11x0_register_mcp(&simpad_mcp_data);
156 }
157
158 static void simpad_power_off(void)
159 @@ -216,6 +213,10 @@ static int __init simpad_init(void)
160
161 pm_power_off = simpad_power_off;
162
163 + sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources,
164 + ARRAY_SIZE(simpad_flash_resources));
165 + sa11x0_register_mcp(&simpad_mcp_data);
166 +
167 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
168 if(ret)
169 printk(KERN_WARNING "simpad: Unable to register mq200 framebuffer device");
170 diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
171 index 8d6f871..b7cbfab 100644
172 --- a/arch/s390/include/asm/processor.h
173 +++ b/arch/s390/include/asm/processor.h
174 @@ -148,11 +148,6 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
175 */
176 extern unsigned long thread_saved_pc(struct task_struct *t);
177
178 -/*
179 - * Print register of task into buffer. Used in fs/proc/array.c.
180 - */
181 -extern void task_show_regs(struct seq_file *m, struct task_struct *task);
182 -
183 extern void show_code(struct pt_regs *regs);
184
185 unsigned long get_wchan(struct task_struct *p);
186 diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
187 index 7064082..5aa4183 100644
188 --- a/arch/s390/kernel/traps.c
189 +++ b/arch/s390/kernel/traps.c
190 @@ -237,43 +237,6 @@ void show_regs(struct pt_regs *regs)
191 show_last_breaking_event(regs);
192 }
193
194 -/* This is called from fs/proc/array.c */
195 -void task_show_regs(struct seq_file *m, struct task_struct *task)
196 -{
197 - struct pt_regs *regs;
198 -
199 - regs = task_pt_regs(task);
200 - seq_printf(m, "task: %p, ksp: %p\n",
201 - task, (void *)task->thread.ksp);
202 - seq_printf(m, "User PSW : %p %p\n",
203 - (void *) regs->psw.mask, (void *)regs->psw.addr);
204 -
205 - seq_printf(m, "User GPRS: " FOURLONG,
206 - regs->gprs[0], regs->gprs[1],
207 - regs->gprs[2], regs->gprs[3]);
208 - seq_printf(m, " " FOURLONG,
209 - regs->gprs[4], regs->gprs[5],
210 - regs->gprs[6], regs->gprs[7]);
211 - seq_printf(m, " " FOURLONG,
212 - regs->gprs[8], regs->gprs[9],
213 - regs->gprs[10], regs->gprs[11]);
214 - seq_printf(m, " " FOURLONG,
215 - regs->gprs[12], regs->gprs[13],
216 - regs->gprs[14], regs->gprs[15]);
217 - seq_printf(m, "User ACRS: %08x %08x %08x %08x\n",
218 - task->thread.acrs[0], task->thread.acrs[1],
219 - task->thread.acrs[2], task->thread.acrs[3]);
220 - seq_printf(m, " %08x %08x %08x %08x\n",
221 - task->thread.acrs[4], task->thread.acrs[5],
222 - task->thread.acrs[6], task->thread.acrs[7]);
223 - seq_printf(m, " %08x %08x %08x %08x\n",
224 - task->thread.acrs[8], task->thread.acrs[9],
225 - task->thread.acrs[10], task->thread.acrs[11]);
226 - seq_printf(m, " %08x %08x %08x %08x\n",
227 - task->thread.acrs[12], task->thread.acrs[13],
228 - task->thread.acrs[14], task->thread.acrs[15]);
229 -}
230 -
231 static DEFINE_SPINLOCK(die_lock);
232
233 void die(const char * str, struct pt_regs * regs, long err)
234 diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
235 index 4fab24d..4564c8e 100644
236 --- a/arch/x86/include/asm/cpu.h
237 +++ b/arch/x86/include/asm/cpu.h
238 @@ -32,5 +32,6 @@ extern void arch_unregister_cpu(int);
239
240 DECLARE_PER_CPU(int, cpu_state);
241
242 +int mwait_usable(const struct cpuinfo_x86 *);
243
244 #endif /* _ASM_X86_CPU_H */
245 diff --git a/arch/x86/kernel/apb_timer.c b/arch/x86/kernel/apb_timer.c
246 index 92543c7..5181673 100644
247 --- a/arch/x86/kernel/apb_timer.c
248 +++ b/arch/x86/kernel/apb_timer.c
249 @@ -313,10 +313,12 @@ static void apbt_setup_irq(struct apbt_dev *adev)
250 if (adev->irq == 0)
251 return;
252
253 + irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT);
254 + irq_set_affinity(adev->irq, cpumask_of(adev->cpu));
255 + /* APB timer irqs are set up as mp_irqs, timer is edge type */
256 + __set_irq_handler(adev->irq, handle_edge_irq, 0, "edge");
257 +
258 if (system_state == SYSTEM_BOOTING) {
259 - irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT);
260 - /* APB timer irqs are set up as mp_irqs, timer is edge type */
261 - __set_irq_handler(adev->irq, handle_edge_irq, 0, "edge");
262 if (request_irq(adev->irq, apbt_interrupt_handler,
263 IRQF_TIMER | IRQF_DISABLED | IRQF_NOBALANCING,
264 adev->name, adev)) {
265 diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
266 index 96656f2..5206bb9 100644
267 --- a/arch/x86/kernel/irq_32.c
268 +++ b/arch/x86/kernel/irq_32.c
269 @@ -129,8 +129,7 @@ void __cpuinit irq_ctx_init(int cpu)
270 irqctx = page_address(alloc_pages_node(cpu_to_node(cpu),
271 THREAD_FLAGS,
272 THREAD_ORDER));
273 - irqctx->tinfo.task = NULL;
274 - irqctx->tinfo.exec_domain = NULL;
275 + memset(&irqctx->tinfo, 0, sizeof(struct thread_info));
276 irqctx->tinfo.cpu = cpu;
277 irqctx->tinfo.preempt_count = HARDIRQ_OFFSET;
278 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
279 @@ -140,10 +139,8 @@ void __cpuinit irq_ctx_init(int cpu)
280 irqctx = page_address(alloc_pages_node(cpu_to_node(cpu),
281 THREAD_FLAGS,
282 THREAD_ORDER));
283 - irqctx->tinfo.task = NULL;
284 - irqctx->tinfo.exec_domain = NULL;
285 + memset(&irqctx->tinfo, 0, sizeof(struct thread_info));
286 irqctx->tinfo.cpu = cpu;
287 - irqctx->tinfo.preempt_count = 0;
288 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
289
290 per_cpu(softirq_ctx, cpu) = irqctx;
291 diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
292 index 2502aaf..12d4bf1 100644
293 --- a/arch/x86/kernel/process.c
294 +++ b/arch/x86/kernel/process.c
295 @@ -14,6 +14,7 @@
296 #include <linux/utsname.h>
297 #include <trace/events/power.h>
298 #include <linux/hw_breakpoint.h>
299 +#include <asm/cpu.h>
300 #include <asm/system.h>
301 #include <asm/apic.h>
302 #include <asm/syscalls.h>
303 @@ -509,13 +510,13 @@ static void poll_idle(void)
304 *
305 * idle=mwait overrides this decision and forces the usage of mwait.
306 */
307 -static int __cpuinitdata force_mwait;
308 +static int force_mwait;
309
310 #define MWAIT_INFO 0x05
311 #define MWAIT_ECX_EXTENDED_INFO 0x01
312 #define MWAIT_EDX_C1 0xf0
313
314 -static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
315 +int mwait_usable(const struct cpuinfo_x86 *c)
316 {
317 u32 eax, ebx, ecx, edx;
318
319 diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
320 index 083e99d..d8fd571 100644
321 --- a/arch/x86/kernel/smpboot.c
322 +++ b/arch/x86/kernel/smpboot.c
323 @@ -1396,8 +1396,9 @@ static inline void mwait_play_dead(void)
324 unsigned int highest_subcstate = 0;
325 int i;
326 void *mwait_ptr;
327 + struct cpuinfo_x86 *c = &current_cpu_data;
328
329 - if (!cpu_has(&current_cpu_data, X86_FEATURE_MWAIT))
330 + if (!(cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)))
331 return;
332 if (!cpu_has(&current_cpu_data, X86_FEATURE_CLFLSH))
333 return;
334 diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
335 index 44924e5..198df8d 100644
336 --- a/arch/x86/xen/mmu.c
337 +++ b/arch/x86/xen/mmu.c
338 @@ -395,6 +395,18 @@ void __init xen_build_dynamic_phys_to_machine(void)
339 p2m_top[topidx] = mid;
340 }
341
342 + /*
343 + * As long as the mfn_list has enough entries to completely
344 + * fill a p2m page, pointing into the array is ok. But if
345 + * not the entries beyond the last pfn will be undefined.
346 + */
347 + if (unlikely(pfn + P2M_PER_PAGE > max_pfn)) {
348 + unsigned long p2midx;
349 +
350 + p2midx = max_pfn % P2M_PER_PAGE;
351 + for ( ; p2midx < P2M_PER_PAGE; p2midx++)
352 + mfn_list[pfn + p2midx] = INVALID_P2M_ENTRY;
353 + }
354 p2m_top[topidx][mididx] = &mfn_list[pfn];
355 }
356 }
357 diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c
358 index f62a50c..3f3ab8f 100644
359 --- a/drivers/acpi/wakeup.c
360 +++ b/drivers/acpi/wakeup.c
361 @@ -84,8 +84,12 @@ int __init acpi_wakeup_device_init(void)
362 struct acpi_device *dev = container_of(node,
363 struct acpi_device,
364 wakeup_list);
365 - if (dev->wakeup.flags.always_enabled)
366 + if (dev->wakeup.flags.always_enabled) {
367 + /* Button GPEs are supposed to be always enabled. */
368 + acpi_enable_gpe(dev->wakeup.gpe_device,
369 + dev->wakeup.gpe_number);
370 dev->wakeup.state.enabled = 1;
371 + }
372 }
373 mutex_unlock(&acpi_device_lock);
374 return 0;
375 diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
376 index 55d0466..d5284bc 100644
377 --- a/drivers/char/tpm/tpm.c
378 +++ b/drivers/char/tpm/tpm.c
379 @@ -577,11 +577,9 @@ duration:
380 if (rc)
381 return;
382
383 - if (be32_to_cpu(tpm_cmd.header.out.return_code) != 0 ||
384 - be32_to_cpu(tpm_cmd.header.out.length)
385 - != sizeof(tpm_cmd.header.out) + sizeof(u32) + 3 * sizeof(u32))
386 + if (be32_to_cpu(tpm_cmd.header.out.return_code)
387 + != 3 * sizeof(u32))
388 return;
389 -
390 duration_cap = &tpm_cmd.params.getcap_out.cap.duration;
391 chip->vendor.duration[TPM_SHORT] =
392 usecs_to_jiffies(be32_to_cpu(duration_cap->tpm_short));
393 @@ -925,18 +923,6 @@ ssize_t tpm_show_caps_1_2(struct device * dev,
394 }
395 EXPORT_SYMBOL_GPL(tpm_show_caps_1_2);
396
397 -ssize_t tpm_show_timeouts(struct device *dev, struct device_attribute *attr,
398 - char *buf)
399 -{
400 - struct tpm_chip *chip = dev_get_drvdata(dev);
401 -
402 - return sprintf(buf, "%d %d %d\n",
403 - jiffies_to_usecs(chip->vendor.duration[TPM_SHORT]),
404 - jiffies_to_usecs(chip->vendor.duration[TPM_MEDIUM]),
405 - jiffies_to_usecs(chip->vendor.duration[TPM_LONG]));
406 -}
407 -EXPORT_SYMBOL_GPL(tpm_show_timeouts);
408 -
409 ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr,
410 const char *buf, size_t count)
411 {
412 diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
413 index ba1779c..792868d 100644
414 --- a/drivers/char/tpm/tpm.h
415 +++ b/drivers/char/tpm/tpm.h
416 @@ -56,8 +56,6 @@ extern ssize_t tpm_show_owned(struct device *, struct device_attribute *attr,
417 char *);
418 extern ssize_t tpm_show_temp_deactivated(struct device *,
419 struct device_attribute *attr, char *);
420 -extern ssize_t tpm_show_timeouts(struct device *,
421 - struct device_attribute *attr, char *);
422
423 struct tpm_chip;
424
425 diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
426 index 0d1d38e..dd21df5 100644
427 --- a/drivers/char/tpm/tpm_tis.c
428 +++ b/drivers/char/tpm/tpm_tis.c
429 @@ -376,7 +376,6 @@ static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
430 NULL);
431 static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL);
432 static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
433 -static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL);
434
435 static struct attribute *tis_attrs[] = {
436 &dev_attr_pubek.attr,
437 @@ -386,8 +385,7 @@ static struct attribute *tis_attrs[] = {
438 &dev_attr_owned.attr,
439 &dev_attr_temp_deactivated.attr,
440 &dev_attr_caps.attr,
441 - &dev_attr_cancel.attr,
442 - &dev_attr_timeouts.attr, NULL,
443 + &dev_attr_cancel.attr, NULL,
444 };
445
446 static struct attribute_group tis_attr_grp = {
447 diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
448 index c1f13bf..5f08e2c 100644
449 --- a/drivers/gpu/drm/i915/intel_dp.c
450 +++ b/drivers/gpu/drm/i915/intel_dp.c
451 @@ -1343,17 +1343,24 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp)
452 struct drm_device *dev = intel_dp->base.base.dev;
453 struct drm_i915_private *dev_priv = dev->dev_private;
454 bool channel_eq = false;
455 - int tries;
456 + int tries, cr_tries;
457 u32 reg;
458 uint32_t DP = intel_dp->DP;
459
460 /* channel equalization */
461 tries = 0;
462 + cr_tries = 0;
463 channel_eq = false;
464 for (;;) {
465 /* Use intel_dp->train_set[0] to set the voltage and pre emphasis values */
466 uint32_t signal_levels;
467
468 + if (cr_tries > 5) {
469 + DRM_ERROR("failed to train DP, aborting\n");
470 + intel_dp_link_down(intel_dp);
471 + break;
472 + }
473 +
474 if (IS_GEN6(dev) && is_edp(intel_dp)) {
475 signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]);
476 DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels;
477 @@ -1376,14 +1383,26 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp)
478 if (!intel_dp_get_link_status(intel_dp))
479 break;
480
481 + /* Make sure clock is still ok */
482 + if (!intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) {
483 + intel_dp_start_link_train(intel_dp);
484 + cr_tries++;
485 + continue;
486 + }
487 +
488 if (intel_channel_eq_ok(intel_dp)) {
489 channel_eq = true;
490 break;
491 }
492
493 - /* Try 5 times */
494 - if (tries > 5)
495 - break;
496 + /* Try 5 times, then try clock recovery if that fails */
497 + if (tries > 5) {
498 + intel_dp_link_down(intel_dp);
499 + intel_dp_start_link_train(intel_dp);
500 + tries = 0;
501 + cr_tries++;
502 + continue;
503 + }
504
505 /* Compute new intel_dp->train_set as requested by target */
506 intel_get_adjust_train(intel_dp);
507 diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
508 index 920ca27..c0de519 100644
509 --- a/drivers/gpu/drm/i915/intel_sdvo.c
510 +++ b/drivers/gpu/drm/i915/intel_sdvo.c
511 @@ -46,6 +46,7 @@
512 SDVO_TV_MASK)
513
514 #define IS_TV(c) (c->output_flag & SDVO_TV_MASK)
515 +#define IS_TMDS(c) (c->output_flag & SDVO_TMDS_MASK)
516 #define IS_LVDS(c) (c->output_flag & SDVO_LVDS_MASK)
517 #define IS_TV_OR_LVDS(c) (c->output_flag & (SDVO_TV_MASK | SDVO_LVDS_MASK))
518
519 @@ -1356,7 +1357,8 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector)
520 intel_sdvo->has_hdmi_monitor = drm_detect_hdmi_monitor(edid);
521 intel_sdvo->has_hdmi_audio = drm_detect_monitor_audio(edid);
522 }
523 - }
524 + } else
525 + status = connector_status_disconnected;
526 connector->display_info.raw_edid = NULL;
527 kfree(edid);
528 }
529 @@ -1404,10 +1406,25 @@ intel_sdvo_detect(struct drm_connector *connector, bool force)
530
531 if ((intel_sdvo_connector->output_flag & response) == 0)
532 ret = connector_status_disconnected;
533 - else if (response & SDVO_TMDS_MASK)
534 + else if (IS_TMDS(intel_sdvo_connector))
535 ret = intel_sdvo_hdmi_sink_detect(connector);
536 - else
537 - ret = connector_status_connected;
538 + else {
539 + struct edid *edid;
540 +
541 + /* if we have an edid check it matches the connection */
542 + edid = intel_sdvo_get_edid(connector);
543 + if (edid == NULL)
544 + edid = intel_sdvo_get_analog_edid(connector);
545 + if (edid != NULL) {
546 + if (edid->input & DRM_EDID_INPUT_DIGITAL)
547 + ret = connector_status_disconnected;
548 + else
549 + ret = connector_status_connected;
550 + connector->display_info.raw_edid = NULL;
551 + kfree(edid);
552 + } else
553 + ret = connector_status_connected;
554 + }
555
556 /* May update encoder flag for like clock for SDVO TV, etc.*/
557 if (ret == connector_status_connected) {
558 @@ -1443,10 +1460,15 @@ static void intel_sdvo_get_ddc_modes(struct drm_connector *connector)
559 edid = intel_sdvo_get_analog_edid(connector);
560
561 if (edid != NULL) {
562 - if (edid->input & DRM_EDID_INPUT_DIGITAL) {
563 + struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector);
564 + bool monitor_is_digital = !!(edid->input & DRM_EDID_INPUT_DIGITAL);
565 + bool connector_is_digital = !!IS_TMDS(intel_sdvo_connector);
566 +
567 + if (connector_is_digital == monitor_is_digital) {
568 drm_mode_connector_update_edid_property(connector, edid);
569 drm_add_edid_modes(connector, edid);
570 }
571 +
572 connector->display_info.raw_edid = NULL;
573 kfree(edid);
574 }
575 diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
576 index 72730e9..21d6c29 100644
577 --- a/drivers/gpu/drm/nouveau/Kconfig
578 +++ b/drivers/gpu/drm/nouveau/Kconfig
579 @@ -10,7 +10,7 @@ config DRM_NOUVEAU
580 select FB
581 select FRAMEBUFFER_CONSOLE if !EMBEDDED
582 select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT
583 - select ACPI_VIDEO if ACPI
584 + select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT
585 help
586 Choose this option for open-source nVidia support.
587
588 diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
589 index 6b7fc4b..ee14b8a 100644
590 --- a/drivers/gpu/drm/radeon/atombios_crtc.c
591 +++ b/drivers/gpu/drm/radeon/atombios_crtc.c
592 @@ -514,7 +514,6 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
593 pll->flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
594 else
595 pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
596 -
597 }
598
599 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
600 @@ -531,29 +530,28 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
601 dp_clock = dig_connector->dp_clock;
602 }
603 }
604 -/* this might work properly with the new pll algo */
605 -#if 0 /* doesn't work properly on some laptops */
606 +
607 /* use recommended ref_div for ss */
608 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
609 if (ss_enabled) {
610 if (ss->refdiv) {
611 + pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
612 pll->flags |= RADEON_PLL_USE_REF_DIV;
613 pll->reference_div = ss->refdiv;
614 + if (ASIC_IS_AVIVO(rdev))
615 + pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV;
616 }
617 }
618 }
619 -#endif
620 +
621 if (ASIC_IS_AVIVO(rdev)) {
622 /* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */
623 if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1)
624 adjusted_clock = mode->clock * 2;
625 if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))
626 pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER;
627 - /* rv515 needs more testing with this option */
628 - if (rdev->family != CHIP_RV515) {
629 - if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
630 - pll->flags |= RADEON_PLL_IS_LCD;
631 - }
632 + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
633 + pll->flags |= RADEON_PLL_IS_LCD;
634 } else {
635 if (encoder->encoder_type != DRM_MODE_ENCODER_DAC)
636 pll->flags |= RADEON_PLL_NO_ODD_POST_DIV;
637 @@ -652,10 +650,12 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
638 index, (uint32_t *)&args);
639 adjusted_clock = le32_to_cpu(args.v3.sOutput.ulDispPllFreq) * 10;
640 if (args.v3.sOutput.ucRefDiv) {
641 + pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV;
642 pll->flags |= RADEON_PLL_USE_REF_DIV;
643 pll->reference_div = args.v3.sOutput.ucRefDiv;
644 }
645 if (args.v3.sOutput.ucPostDiv) {
646 + pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV;
647 pll->flags |= RADEON_PLL_USE_POST_DIV;
648 pll->post_div = args.v3.sOutput.ucPostDiv;
649 }
650 @@ -921,11 +921,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
651 /* adjust pixel clock as needed */
652 adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss);
653
654 - /* rv515 seems happier with the old algo */
655 - if (rdev->family == CHIP_RV515)
656 - radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
657 - &ref_div, &post_div);
658 - else if (ASIC_IS_AVIVO(rdev))
659 + if (ASIC_IS_AVIVO(rdev))
660 radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
661 &ref_div, &post_div);
662 else
663 @@ -959,9 +955,9 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
664 }
665 }
666
667 -static int evergreen_crtc_do_set_base(struct drm_crtc *crtc,
668 - struct drm_framebuffer *fb,
669 - int x, int y, int atomic)
670 +static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
671 + struct drm_framebuffer *fb,
672 + int x, int y, int atomic)
673 {
674 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
675 struct drm_device *dev = crtc->dev;
676 @@ -1093,12 +1089,6 @@ static int evergreen_crtc_do_set_base(struct drm_crtc *crtc,
677 WREG32(EVERGREEN_VIEWPORT_SIZE + radeon_crtc->crtc_offset,
678 (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay);
679
680 - if (crtc->mode.flags & DRM_MODE_FLAG_INTERLACE)
681 - WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset,
682 - EVERGREEN_INTERLEAVE_EN);
683 - else
684 - WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset, 0);
685 -
686 if (!atomic && fb && fb != crtc->fb) {
687 radeon_fb = to_radeon_framebuffer(fb);
688 rbo = radeon_fb->obj->driver_private;
689 @@ -1247,12 +1237,6 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
690 WREG32(AVIVO_D1MODE_VIEWPORT_SIZE + radeon_crtc->crtc_offset,
691 (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay);
692
693 - if (crtc->mode.flags & DRM_MODE_FLAG_INTERLACE)
694 - WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset,
695 - AVIVO_D1MODE_INTERLEAVE_EN);
696 - else
697 - WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, 0);
698 -
699 if (!atomic && fb && fb != crtc->fb) {
700 radeon_fb = to_radeon_framebuffer(fb);
701 rbo = radeon_fb->obj->driver_private;
702 @@ -1276,7 +1260,7 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
703 struct radeon_device *rdev = dev->dev_private;
704
705 if (ASIC_IS_DCE4(rdev))
706 - return evergreen_crtc_do_set_base(crtc, old_fb, x, y, 0);
707 + return dce4_crtc_do_set_base(crtc, old_fb, x, y, 0);
708 else if (ASIC_IS_AVIVO(rdev))
709 return avivo_crtc_do_set_base(crtc, old_fb, x, y, 0);
710 else
711 @@ -1291,7 +1275,7 @@ int atombios_crtc_set_base_atomic(struct drm_crtc *crtc,
712 struct radeon_device *rdev = dev->dev_private;
713
714 if (ASIC_IS_DCE4(rdev))
715 - return evergreen_crtc_do_set_base(crtc, fb, x, y, 1);
716 + return dce4_crtc_do_set_base(crtc, fb, x, y, 1);
717 else if (ASIC_IS_AVIVO(rdev))
718 return avivo_crtc_do_set_base(crtc, fb, x, y, 1);
719 else
720 diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
721 index 7831e08..153095f 100644
722 --- a/drivers/gpu/drm/radeon/r600_cs.c
723 +++ b/drivers/gpu/drm/radeon/r600_cs.c
724 @@ -295,17 +295,18 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i)
725 }
726
727 if (!IS_ALIGNED(pitch, pitch_align)) {
728 - dev_warn(p->dev, "%s:%d cb pitch (%d) invalid\n",
729 - __func__, __LINE__, pitch);
730 + dev_warn(p->dev, "%s:%d cb pitch (%d, 0x%x, %d) invalid\n",
731 + __func__, __LINE__, pitch, pitch_align, array_mode);
732 return -EINVAL;
733 }
734 if (!IS_ALIGNED(height, height_align)) {
735 - dev_warn(p->dev, "%s:%d cb height (%d) invalid\n",
736 - __func__, __LINE__, height);
737 + dev_warn(p->dev, "%s:%d cb height (%d, 0x%x, %d) invalid\n",
738 + __func__, __LINE__, height, height_align, array_mode);
739 return -EINVAL;
740 }
741 if (!IS_ALIGNED(base_offset, base_align)) {
742 - dev_warn(p->dev, "%s offset[%d] 0x%llx not aligned\n", __func__, i, base_offset);
743 + dev_warn(p->dev, "%s offset[%d] 0x%llx 0x%llx, %d not aligned\n", __func__, i,
744 + base_offset, base_align, array_mode);
745 return -EINVAL;
746 }
747
748 @@ -320,7 +321,10 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i)
749 * broken userspace.
750 */
751 } else {
752 - dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i]));
753 + dev_warn(p->dev, "%s offset[%d] %d %d %d %lu too big\n", __func__, i,
754 + array_mode,
755 + track->cb_color_bo_offset[i], tmp,
756 + radeon_bo_size(track->cb_color_bo[i]));
757 return -EINVAL;
758 }
759 }
760 @@ -455,17 +459,18 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
761 }
762
763 if (!IS_ALIGNED(pitch, pitch_align)) {
764 - dev_warn(p->dev, "%s:%d db pitch (%d) invalid\n",
765 - __func__, __LINE__, pitch);
766 + dev_warn(p->dev, "%s:%d db pitch (%d, 0x%x, %d) invalid\n",
767 + __func__, __LINE__, pitch, pitch_align, array_mode);
768 return -EINVAL;
769 }
770 if (!IS_ALIGNED(height, height_align)) {
771 - dev_warn(p->dev, "%s:%d db height (%d) invalid\n",
772 - __func__, __LINE__, height);
773 + dev_warn(p->dev, "%s:%d db height (%d, 0x%x, %d) invalid\n",
774 + __func__, __LINE__, height, height_align, array_mode);
775 return -EINVAL;
776 }
777 if (!IS_ALIGNED(base_offset, base_align)) {
778 - dev_warn(p->dev, "%s offset[%d] 0x%llx not aligned\n", __func__, i, base_offset);
779 + dev_warn(p->dev, "%s offset[%d] 0x%llx, 0x%llx, %d not aligned\n", __func__, i,
780 + base_offset, base_align, array_mode);
781 return -EINVAL;
782 }
783
784 @@ -473,9 +478,10 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
785 nviews = G_028004_SLICE_MAX(track->db_depth_view) + 1;
786 tmp = ntiles * bpe * 64 * nviews;
787 if ((tmp + track->db_offset) > radeon_bo_size(track->db_bo)) {
788 - dev_warn(p->dev, "z/stencil buffer too small (0x%08X %d %d %d -> %u have %lu)\n",
789 - track->db_depth_size, ntiles, nviews, bpe, tmp + track->db_offset,
790 - radeon_bo_size(track->db_bo));
791 + dev_warn(p->dev, "z/stencil buffer (%d) too small (0x%08X %d %d %d -> %u have %lu)\n",
792 + array_mode,
793 + track->db_depth_size, ntiles, nviews, bpe, tmp + track->db_offset,
794 + radeon_bo_size(track->db_bo));
795 return -EINVAL;
796 }
797 }
798 @@ -1227,18 +1233,18 @@ static inline int r600_check_texture_resource(struct radeon_cs_parser *p, u32 i
799 /* XXX check height as well... */
800
801 if (!IS_ALIGNED(pitch, pitch_align)) {
802 - dev_warn(p->dev, "%s:%d tex pitch (%d) invalid\n",
803 - __func__, __LINE__, pitch);
804 + dev_warn(p->dev, "%s:%d tex pitch (%d, 0x%x, %d) invalid\n",
805 + __func__, __LINE__, pitch, pitch_align, G_038000_TILE_MODE(word0));
806 return -EINVAL;
807 }
808 if (!IS_ALIGNED(base_offset, base_align)) {
809 - dev_warn(p->dev, "%s:%d tex base offset (0x%llx) invalid\n",
810 - __func__, __LINE__, base_offset);
811 + dev_warn(p->dev, "%s:%d tex base offset (0x%llx, 0x%llx, %d) invalid\n",
812 + __func__, __LINE__, base_offset, base_align, G_038000_TILE_MODE(word0));
813 return -EINVAL;
814 }
815 if (!IS_ALIGNED(mip_offset, base_align)) {
816 - dev_warn(p->dev, "%s:%d tex mip offset (0x%llx) invalid\n",
817 - __func__, __LINE__, mip_offset);
818 + dev_warn(p->dev, "%s:%d tex mip offset (0x%llx, 0x%llx, %d) invalid\n",
819 + __func__, __LINE__, mip_offset, base_align, G_038000_TILE_MODE(word0));
820 return -EINVAL;
821 }
822
823 diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
824 index 137b807..57bee7e 100644
825 --- a/drivers/gpu/drm/radeon/radeon_combios.c
826 +++ b/drivers/gpu/drm/radeon/radeon_combios.c
827 @@ -1503,6 +1503,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
828 (rdev->pdev->subsystem_device == 0x4a48)) {
829 /* Mac X800 */
830 rdev->mode_info.connector_table = CT_MAC_X800;
831 + } else if ((rdev->pdev->device == 0x4150) &&
832 + (rdev->pdev->subsystem_vendor == 0x1002) &&
833 + (rdev->pdev->subsystem_device == 0x4150)) {
834 + /* Mac G5 9600 */
835 + rdev->mode_info.connector_table = CT_MAC_G5_9600;
836 } else
837 #endif /* CONFIG_PPC_PMAC */
838 #ifdef CONFIG_PPC64
839 @@ -2021,6 +2026,48 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
840 CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I,
841 &hpd);
842 break;
843 + case CT_MAC_G5_9600:
844 + DRM_INFO("Connector Table: %d (mac g5 9600)\n",
845 + rdev->mode_info.connector_table);
846 + /* DVI - tv dac, dvo */
847 + ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
848 + hpd.hpd = RADEON_HPD_1; /* ??? */
849 + radeon_add_legacy_encoder(dev,
850 + radeon_get_encoder_enum(dev,
851 + ATOM_DEVICE_DFP2_SUPPORT,
852 + 0),
853 + ATOM_DEVICE_DFP2_SUPPORT);
854 + radeon_add_legacy_encoder(dev,
855 + radeon_get_encoder_enum(dev,
856 + ATOM_DEVICE_CRT2_SUPPORT,
857 + 2),
858 + ATOM_DEVICE_CRT2_SUPPORT);
859 + radeon_add_legacy_connector(dev, 0,
860 + ATOM_DEVICE_DFP2_SUPPORT |
861 + ATOM_DEVICE_CRT2_SUPPORT,
862 + DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
863 + CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I,
864 + &hpd);
865 + /* ADC - primary dac, internal tmds */
866 + ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
867 + hpd.hpd = RADEON_HPD_2; /* ??? */
868 + radeon_add_legacy_encoder(dev,
869 + radeon_get_encoder_enum(dev,
870 + ATOM_DEVICE_DFP1_SUPPORT,
871 + 0),
872 + ATOM_DEVICE_DFP1_SUPPORT);
873 + radeon_add_legacy_encoder(dev,
874 + radeon_get_encoder_enum(dev,
875 + ATOM_DEVICE_CRT1_SUPPORT,
876 + 1),
877 + ATOM_DEVICE_CRT1_SUPPORT);
878 + radeon_add_legacy_connector(dev, 1,
879 + ATOM_DEVICE_DFP1_SUPPORT |
880 + ATOM_DEVICE_CRT1_SUPPORT,
881 + DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
882 + CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I,
883 + &hpd);
884 + break;
885 default:
886 DRM_INFO("Connector table: %d (invalid)\n",
887 rdev->mode_info.connector_table);
888 diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
889 index a26a70d..c7d1fca 100644
890 --- a/drivers/gpu/drm/radeon/radeon_display.c
891 +++ b/drivers/gpu/drm/radeon/radeon_display.c
892 @@ -461,6 +461,11 @@ static void avivo_get_fb_div(struct radeon_pll *pll,
893 tmp *= target_clock;
894 *fb_div = tmp / pll->reference_freq;
895 *frac_fb_div = tmp % pll->reference_freq;
896 +
897 + if (*fb_div > pll->max_feedback_div)
898 + *fb_div = pll->max_feedback_div;
899 + else if (*fb_div < pll->min_feedback_div)
900 + *fb_div = pll->min_feedback_div;
901 }
902
903 static u32 avivo_get_post_div(struct radeon_pll *pll,
904 @@ -494,6 +499,11 @@ static u32 avivo_get_post_div(struct radeon_pll *pll,
905 post_div--;
906 }
907
908 + if (post_div > pll->max_post_div)
909 + post_div = pll->max_post_div;
910 + else if (post_div < pll->min_post_div)
911 + post_div = pll->min_post_div;
912 +
913 return post_div;
914 }
915
916 diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
917 index 041943d..6a3d063 100644
918 --- a/drivers/gpu/drm/radeon/radeon_encoders.c
919 +++ b/drivers/gpu/drm/radeon/radeon_encoders.c
920 @@ -1465,11 +1465,21 @@ atombios_apply_encoder_quirks(struct drm_encoder *encoder,
921 }
922
923 /* set scaler clears this on some chips */
924 - /* XXX check DCE4 */
925 - if (!(radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))) {
926 - if (ASIC_IS_AVIVO(rdev) && (mode->flags & DRM_MODE_FLAG_INTERLACE))
927 - WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset,
928 - AVIVO_D1MODE_INTERLEAVE_EN);
929 + if (ASIC_IS_AVIVO(rdev) &&
930 + (!(radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)))) {
931 + if (ASIC_IS_DCE4(rdev)) {
932 + if (mode->flags & DRM_MODE_FLAG_INTERLACE)
933 + WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset,
934 + EVERGREEN_INTERLEAVE_EN);
935 + else
936 + WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset, 0);
937 + } else {
938 + if (mode->flags & DRM_MODE_FLAG_INTERLACE)
939 + WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset,
940 + AVIVO_D1MODE_INTERLEAVE_EN);
941 + else
942 + WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, 0);
943 + }
944 }
945 }
946
947 diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
948 index aa22570..2615e51 100644
949 --- a/drivers/gpu/drm/radeon/radeon_mode.h
950 +++ b/drivers/gpu/drm/radeon/radeon_mode.h
951 @@ -209,6 +209,7 @@ enum radeon_connector_table {
952 CT_EMAC,
953 CT_RN50_POWER,
954 CT_MAC_X800,
955 + CT_MAC_G5_9600,
956 };
957
958 enum radeon_dvo_chip {
959 diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
960 index 1272e4b..e5b2cf1 100644
961 --- a/drivers/gpu/drm/radeon/radeon_ttm.c
962 +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
963 @@ -787,9 +787,9 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev)
964 radeon_mem_types_list[i].show = &radeon_mm_dump_table;
965 radeon_mem_types_list[i].driver_features = 0;
966 if (i == 0)
967 - radeon_mem_types_list[i].data = &rdev->mman.bdev.man[TTM_PL_VRAM].priv;
968 + radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_VRAM].priv;
969 else
970 - radeon_mem_types_list[i].data = &rdev->mman.bdev.man[TTM_PL_TT].priv;
971 + radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_TT].priv;
972
973 }
974 /* Add ttm page pool to debugfs */
975 diff --git a/drivers/hid/hid-cando.c b/drivers/hid/hid-cando.c
976 index 5925bdc..343c41b 100644
977 --- a/drivers/hid/hid-cando.c
978 +++ b/drivers/hid/hid-cando.c
979 @@ -236,6 +236,8 @@ static const struct hid_device_id cando_devices[] = {
980 { HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
981 USB_DEVICE_ID_CANDO_MULTI_TOUCH) },
982 { HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
983 + USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1) },
984 + { HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
985 USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) },
986 { HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
987 USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) },
988 diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
989 index 88cb04e..52cf7ca 100644
990 --- a/drivers/hid/hid-core.c
991 +++ b/drivers/hid/hid-core.c
992 @@ -1287,6 +1287,7 @@ static const struct hid_device_id hid_blacklist[] = {
993 { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },
994 { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE_2) },
995 { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH) },
996 + { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1) },
997 { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) },
998 { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) },
999 { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
1000 @@ -1390,6 +1391,7 @@ static const struct hid_device_id hid_blacklist[] = {
1001 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
1002 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) },
1003 { HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) },
1004 + { HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) },
1005 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209) },
1006 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U) },
1007 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U) },
1008 diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
1009 index 3341baa..f04789d 100644
1010 --- a/drivers/hid/hid-ids.h
1011 +++ b/drivers/hid/hid-ids.h
1012 @@ -135,6 +135,7 @@
1013
1014 #define USB_VENDOR_ID_CANDO 0x2087
1015 #define USB_DEVICE_ID_CANDO_MULTI_TOUCH 0x0a01
1016 +#define USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1 0x0a02
1017 #define USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6 0x0b03
1018 #define USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6 0x0f01
1019
1020 diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
1021 index e6dc151..ed732b7 100644
1022 --- a/drivers/hid/hid-magicmouse.c
1023 +++ b/drivers/hid/hid-magicmouse.c
1024 @@ -433,6 +433,11 @@ static int magicmouse_input_mapping(struct hid_device *hdev,
1025 if (!msc->input)
1026 msc->input = hi->input;
1027
1028 + /* Magic Trackpad does not give relative data after switching to MT */
1029 + if (hi->input->id.product == USB_DEVICE_ID_APPLE_MAGICTRACKPAD &&
1030 + field->flags & HID_MAIN_ITEM_RELATIVE)
1031 + return -1;
1032 +
1033 return 0;
1034 }
1035
1036 diff --git a/drivers/hid/hid-mosart.c b/drivers/hid/hid-mosart.c
1037 index ac5421d..251eaa4 100644
1038 --- a/drivers/hid/hid-mosart.c
1039 +++ b/drivers/hid/hid-mosart.c
1040 @@ -240,6 +240,7 @@ static void mosart_remove(struct hid_device *hdev)
1041 static const struct hid_device_id mosart_devices[] = {
1042 { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_T91MT) },
1043 { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUSTEK_MULTITOUCH_YFO) },
1044 + { HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) },
1045 { }
1046 };
1047 MODULE_DEVICE_TABLE(hid, mosart_devices);
1048 diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
1049 index 2c18547..af34376 100644
1050 --- a/drivers/hid/usbhid/hid-quirks.c
1051 +++ b/drivers/hid/usbhid/hid-quirks.c
1052 @@ -35,7 +35,6 @@ static const struct hid_blacklist {
1053 { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD },
1054 { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET },
1055 { USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER, HID_QUIRK_MULTI_INPUT },
1056 - { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART, HID_QUIRK_MULTI_INPUT },
1057 { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
1058 { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
1059 { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
1060 diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
1061 index a56f6ad..004ff55 100644
1062 --- a/drivers/hwmon/Kconfig
1063 +++ b/drivers/hwmon/Kconfig
1064 @@ -238,13 +238,13 @@ config SENSORS_K8TEMP
1065 will be called k8temp.
1066
1067 config SENSORS_K10TEMP
1068 - tristate "AMD Phenom/Sempron/Turion/Opteron temperature sensor"
1069 + tristate "AMD Family 10h/11h/12h/14h temperature sensor"
1070 depends on X86 && PCI
1071 help
1072 If you say yes here you get support for the temperature
1073 sensor(s) inside your CPU. Supported are later revisions of
1074 - the AMD Family 10h and all revisions of the AMD Family 11h
1075 - microarchitectures.
1076 + the AMD Family 10h and all revisions of the AMD Family 11h,
1077 + 12h (Llano), and 14h (Brazos) microarchitectures.
1078
1079 This driver can also be built as a module. If so, the module
1080 will be called k10temp.
1081 @@ -445,13 +445,14 @@ config SENSORS_JZ4740
1082 called jz4740-hwmon.
1083
1084 config SENSORS_JC42
1085 - tristate "JEDEC JC42.4 compliant temperature sensors"
1086 + tristate "JEDEC JC42.4 compliant memory module temperature sensors"
1087 depends on I2C
1088 help
1089 - If you say yes here you get support for Jedec JC42.4 compliant
1090 - temperature sensors. Support will include, but not be limited to,
1091 - ADT7408, CAT34TS02,, CAT6095, MAX6604, MCP9805, MCP98242, MCP98243,
1092 - MCP9843, SE97, SE98, STTS424, TSE2002B3, and TS3000B3.
1093 + If you say yes here, you get support for JEDEC JC42.4 compliant
1094 + temperature sensors, which are used on many DDR3 memory modules for
1095 + mobile devices and servers. Support will include, but not be limited
1096 + to, ADT7408, CAT34TS02, CAT6095, MAX6604, MCP9805, MCP98242, MCP98243,
1097 + MCP9843, SE97, SE98, STTS424(E), TSE2002B3, and TS3000B3.
1098
1099 This driver can also be built as a module. If so, the module
1100 will be called jc42.
1101 @@ -564,7 +565,7 @@ config SENSORS_LM85
1102 help
1103 If you say yes here you get support for National Semiconductor LM85
1104 sensor chips and clones: ADM1027, ADT7463, ADT7468, EMC6D100,
1105 - EMC6D101 and EMC6D102.
1106 + EMC6D101, EMC6D102, and EMC6D103.
1107
1108 This driver can also be built as a module. If so, the module
1109 will be called lm85.
1110 diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
1111 index 340fc78..9349912 100644
1112 --- a/drivers/hwmon/jc42.c
1113 +++ b/drivers/hwmon/jc42.c
1114 @@ -53,6 +53,8 @@ static const unsigned short normal_i2c[] = {
1115
1116 /* Configuration register defines */
1117 #define JC42_CFG_CRIT_ONLY (1 << 2)
1118 +#define JC42_CFG_TCRIT_LOCK (1 << 6)
1119 +#define JC42_CFG_EVENT_LOCK (1 << 7)
1120 #define JC42_CFG_SHUTDOWN (1 << 8)
1121 #define JC42_CFG_HYST_SHIFT 9
1122 #define JC42_CFG_HYST_MASK 0x03
1123 @@ -332,7 +334,7 @@ static ssize_t set_temp_crit_hyst(struct device *dev,
1124 {
1125 struct i2c_client *client = to_i2c_client(dev);
1126 struct jc42_data *data = i2c_get_clientdata(client);
1127 - long val;
1128 + unsigned long val;
1129 int diff, hyst;
1130 int err;
1131 int ret = count;
1132 @@ -380,14 +382,14 @@ static ssize_t show_alarm(struct device *dev,
1133
1134 static DEVICE_ATTR(temp1_input, S_IRUGO,
1135 show_temp_input, NULL);
1136 -static DEVICE_ATTR(temp1_crit, S_IWUSR | S_IRUGO,
1137 +static DEVICE_ATTR(temp1_crit, S_IRUGO,
1138 show_temp_crit, set_temp_crit);
1139 -static DEVICE_ATTR(temp1_min, S_IWUSR | S_IRUGO,
1140 +static DEVICE_ATTR(temp1_min, S_IRUGO,
1141 show_temp_min, set_temp_min);
1142 -static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO,
1143 +static DEVICE_ATTR(temp1_max, S_IRUGO,
1144 show_temp_max, set_temp_max);
1145
1146 -static DEVICE_ATTR(temp1_crit_hyst, S_IWUSR | S_IRUGO,
1147 +static DEVICE_ATTR(temp1_crit_hyst, S_IRUGO,
1148 show_temp_crit_hyst, set_temp_crit_hyst);
1149 static DEVICE_ATTR(temp1_max_hyst, S_IRUGO,
1150 show_temp_max_hyst, NULL);
1151 @@ -412,8 +414,31 @@ static struct attribute *jc42_attributes[] = {
1152 NULL
1153 };
1154
1155 +static mode_t jc42_attribute_mode(struct kobject *kobj,
1156 + struct attribute *attr, int index)
1157 +{
1158 + struct device *dev = container_of(kobj, struct device, kobj);
1159 + struct i2c_client *client = to_i2c_client(dev);
1160 + struct jc42_data *data = i2c_get_clientdata(client);
1161 + unsigned int config = data->config;
1162 + bool readonly;
1163 +
1164 + if (attr == &dev_attr_temp1_crit.attr)
1165 + readonly = config & JC42_CFG_TCRIT_LOCK;
1166 + else if (attr == &dev_attr_temp1_min.attr ||
1167 + attr == &dev_attr_temp1_max.attr)
1168 + readonly = config & JC42_CFG_EVENT_LOCK;
1169 + else if (attr == &dev_attr_temp1_crit_hyst.attr)
1170 + readonly = config & (JC42_CFG_EVENT_LOCK | JC42_CFG_TCRIT_LOCK);
1171 + else
1172 + readonly = true;
1173 +
1174 + return S_IRUGO | (readonly ? 0 : S_IWUSR);
1175 +}
1176 +
1177 static const struct attribute_group jc42_group = {
1178 .attrs = jc42_attributes,
1179 + .is_visible = jc42_attribute_mode,
1180 };
1181
1182 /* Return 0 if detection is successful, -ENODEV otherwise */
1183 diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
1184 index da5a240..82bf65a 100644
1185 --- a/drivers/hwmon/k10temp.c
1186 +++ b/drivers/hwmon/k10temp.c
1187 @@ -1,5 +1,5 @@
1188 /*
1189 - * k10temp.c - AMD Family 10h/11h processor hardware monitoring
1190 + * k10temp.c - AMD Family 10h/11h/12h/14h processor hardware monitoring
1191 *
1192 * Copyright (c) 2009 Clemens Ladisch <clemens@ladisch.de>
1193 *
1194 @@ -25,7 +25,7 @@
1195 #include <linux/pci.h>
1196 #include <asm/processor.h>
1197
1198 -MODULE_DESCRIPTION("AMD Family 10h/11h CPU core temperature monitor");
1199 +MODULE_DESCRIPTION("AMD Family 10h/11h/12h/14h CPU core temperature monitor");
1200 MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
1201 MODULE_LICENSE("GPL");
1202
1203 @@ -208,6 +208,7 @@ static void __devexit k10temp_remove(struct pci_dev *pdev)
1204 static const struct pci_device_id k10temp_id_table[] = {
1205 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) },
1206 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) },
1207 + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
1208 {}
1209 };
1210 MODULE_DEVICE_TABLE(pci, k10temp_id_table);
1211 diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
1212 index 1e22984..d2cc286 100644
1213 --- a/drivers/hwmon/lm85.c
1214 +++ b/drivers/hwmon/lm85.c
1215 @@ -41,7 +41,7 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
1216 enum chips {
1217 any_chip, lm85b, lm85c,
1218 adm1027, adt7463, adt7468,
1219 - emc6d100, emc6d102
1220 + emc6d100, emc6d102, emc6d103
1221 };
1222
1223 /* The LM85 registers */
1224 @@ -90,6 +90,9 @@ enum chips {
1225 #define LM85_VERSTEP_EMC6D100_A0 0x60
1226 #define LM85_VERSTEP_EMC6D100_A1 0x61
1227 #define LM85_VERSTEP_EMC6D102 0x65
1228 +#define LM85_VERSTEP_EMC6D103_A0 0x68
1229 +#define LM85_VERSTEP_EMC6D103_A1 0x69
1230 +#define LM85_VERSTEP_EMC6D103S 0x6A /* Also known as EMC6D103:A2 */
1231
1232 #define LM85_REG_CONFIG 0x40
1233
1234 @@ -348,6 +351,7 @@ static const struct i2c_device_id lm85_id[] = {
1235 { "emc6d100", emc6d100 },
1236 { "emc6d101", emc6d100 },
1237 { "emc6d102", emc6d102 },
1238 + { "emc6d103", emc6d103 },
1239 { }
1240 };
1241 MODULE_DEVICE_TABLE(i2c, lm85_id);
1242 @@ -1250,6 +1254,20 @@ static int lm85_detect(struct i2c_client *client, struct i2c_board_info *info)
1243 case LM85_VERSTEP_EMC6D102:
1244 type_name = "emc6d102";
1245 break;
1246 + case LM85_VERSTEP_EMC6D103_A0:
1247 + case LM85_VERSTEP_EMC6D103_A1:
1248 + type_name = "emc6d103";
1249 + break;
1250 + /*
1251 + * Registers apparently missing in EMC6D103S/EMC6D103:A2
1252 + * compared to EMC6D103:A0, EMC6D103:A1, and EMC6D102
1253 + * (according to the data sheets), but used unconditionally
1254 + * in the driver: 62[5:7], 6D[0:7], and 6E[0:7].
1255 + * So skip EMC6D103S for now.
1256 + case LM85_VERSTEP_EMC6D103S:
1257 + type_name = "emc6d103s";
1258 + break;
1259 + */
1260 }
1261 } else {
1262 dev_dbg(&adapter->dev,
1263 @@ -1283,6 +1301,7 @@ static int lm85_probe(struct i2c_client *client,
1264 case adt7468:
1265 case emc6d100:
1266 case emc6d102:
1267 + case emc6d103:
1268 data->freq_map = adm1027_freq_map;
1269 break;
1270 default:
1271 @@ -1468,7 +1487,7 @@ static struct lm85_data *lm85_update_device(struct device *dev)
1272 /* More alarm bits */
1273 data->alarms |= lm85_read_value(client,
1274 EMC6D100_REG_ALARM3) << 16;
1275 - } else if (data->type == emc6d102) {
1276 + } else if (data->type == emc6d102 || data->type == emc6d103) {
1277 /* Have to read LSB bits after the MSB ones because
1278 the reading of the MSB bits has frozen the
1279 LSBs (backward from the ADM1027).
1280 diff --git a/drivers/media/dvb/ttpci/av7110_ca.c b/drivers/media/dvb/ttpci/av7110_ca.c
1281 index 122c728..9fc1dd0 100644
1282 --- a/drivers/media/dvb/ttpci/av7110_ca.c
1283 +++ b/drivers/media/dvb/ttpci/av7110_ca.c
1284 @@ -277,7 +277,7 @@ static int dvb_ca_ioctl(struct file *file, unsigned int cmd, void *parg)
1285 {
1286 ca_slot_info_t *info=(ca_slot_info_t *)parg;
1287
1288 - if (info->num > 1)
1289 + if (info->num < 0 || info->num > 1)
1290 return -EINVAL;
1291 av7110->ci_slot[info->num].num = info->num;
1292 av7110->ci_slot[info->num].type = FW_CI_LL_SUPPORT(av7110->arm_app) ?
1293 diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c
1294 index 6cc5d13..4ce10db 100644
1295 --- a/drivers/media/radio/radio-aimslab.c
1296 +++ b/drivers/media/radio/radio-aimslab.c
1297 @@ -31,6 +31,7 @@
1298 #include <linux/module.h> /* Modules */
1299 #include <linux/init.h> /* Initdata */
1300 #include <linux/ioport.h> /* request_region */
1301 +#include <linux/delay.h> /* msleep */
1302 #include <linux/videodev2.h> /* kernel radio structs */
1303 #include <linux/version.h> /* for KERNEL_VERSION MACRO */
1304 #include <linux/io.h> /* outb, outb_p */
1305 diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
1306 index a3856ed..e8deb8e 100644
1307 --- a/drivers/message/fusion/mptctl.c
1308 +++ b/drivers/message/fusion/mptctl.c
1309 @@ -597,6 +597,13 @@ mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
1310 }
1311
1312 static int
1313 +mptctl_release(struct inode *inode, struct file *filep)
1314 +{
1315 + fasync_helper(-1, filep, 0, &async_queue);
1316 + return 0;
1317 +}
1318 +
1319 +static int
1320 mptctl_fasync(int fd, struct file *filep, int mode)
1321 {
1322 MPT_ADAPTER *ioc;
1323 @@ -2815,6 +2822,7 @@ static const struct file_operations mptctl_fops = {
1324 .llseek = no_llseek,
1325 .fasync = mptctl_fasync,
1326 .unlocked_ioctl = mptctl_ioctl,
1327 + .release = mptctl_release,
1328 #ifdef CONFIG_COMPAT
1329 .compat_ioctl = compat_mpctl_ioctl,
1330 #endif
1331 diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
1332 index 59b8f53..0d9b82a 100644
1333 --- a/drivers/message/fusion/mptscsih.c
1334 +++ b/drivers/message/fusion/mptscsih.c
1335 @@ -1873,8 +1873,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1336 }
1337
1338 out:
1339 - printk(MYIOC_s_INFO_FMT "task abort: %s (sc=%p)\n",
1340 - ioc->name, ((retval == SUCCESS) ? "SUCCESS" : "FAILED"), SCpnt);
1341 + printk(MYIOC_s_INFO_FMT "task abort: %s (rv=%04x) (sc=%p) (sn=%ld)\n",
1342 + ioc->name, ((retval == SUCCESS) ? "SUCCESS" : "FAILED"), retval,
1343 + SCpnt, SCpnt->serial_number);
1344
1345 return retval;
1346 }
1347 @@ -1911,7 +1912,7 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
1348
1349 vdevice = SCpnt->device->hostdata;
1350 if (!vdevice || !vdevice->vtarget) {
1351 - retval = SUCCESS;
1352 + retval = 0;
1353 goto out;
1354 }
1355
1356 diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
1357 index 6e533dc..e733f2c 100644
1358 --- a/drivers/net/can/janz-ican3.c
1359 +++ b/drivers/net/can/janz-ican3.c
1360 @@ -1627,7 +1627,7 @@ static ssize_t ican3_sysfs_set_term(struct device *dev,
1361 return count;
1362 }
1363
1364 -static DEVICE_ATTR(termination, S_IWUGO | S_IRUGO, ican3_sysfs_show_term,
1365 +static DEVICE_ATTR(termination, S_IWUSR | S_IRUGO, ican3_sysfs_show_term,
1366 ican3_sysfs_set_term);
1367
1368 static struct attribute *ican3_sysfs_attrs[] = {
1369 diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
1370 index 176e525..e7fe35c 100644
1371 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c
1372 +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
1373 @@ -2727,7 +2727,6 @@ static struct iwl_lib_ops iwl3945_lib = {
1374 .config_ap = iwl3945_config_ap,
1375 .manage_ibss_station = iwl3945_manage_ibss_station,
1376 .recover_from_tx_stall = iwl_bg_monitor_recover,
1377 - .check_plcp_health = iwl3945_good_plcp_health,
1378
1379 .debugfs_ops = {
1380 .rx_stats_read = iwl3945_ucode_rx_stats_read,
1381 diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
1382 index 63d5042..1539d2c 100644
1383 --- a/drivers/pci/pci-sysfs.c
1384 +++ b/drivers/pci/pci-sysfs.c
1385 @@ -23,6 +23,7 @@
1386 #include <linux/mm.h>
1387 #include <linux/fs.h>
1388 #include <linux/capability.h>
1389 +#include <linux/security.h>
1390 #include <linux/pci-aspm.h>
1391 #include <linux/slab.h>
1392 #include "pci.h"
1393 @@ -368,7 +369,7 @@ pci_read_config(struct file *filp, struct kobject *kobj,
1394 u8 *data = (u8*) buf;
1395
1396 /* Several chips lock up trying to read undefined config space */
1397 - if (cap_raised(filp->f_cred->cap_effective, CAP_SYS_ADMIN)) {
1398 + if (security_capable(filp->f_cred, CAP_SYS_ADMIN) == 0) {
1399 size = dev->cfg_size;
1400 } else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
1401 size = 128;
1402 diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
1403 index 0bdda5b..42fbf1a 100644
1404 --- a/drivers/pcmcia/pcmcia_resource.c
1405 +++ b/drivers/pcmcia/pcmcia_resource.c
1406 @@ -518,6 +518,8 @@ int pcmcia_enable_device(struct pcmcia_device *p_dev)
1407 flags |= CONF_ENABLE_IOCARD;
1408 if (flags & CONF_ENABLE_IOCARD)
1409 s->socket.flags |= SS_IOCARD;
1410 + if (flags & CONF_ENABLE_ZVCARD)
1411 + s->socket.flags |= SS_ZVCARD | SS_IOCARD;
1412 if (flags & CONF_ENABLE_SPKR) {
1413 s->socket.flags |= SS_SPKR_ENA;
1414 status = CCSR_AUDIO_ENA;
1415 diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
1416 index c8c6537..196a59e 100644
1417 --- a/drivers/platform/x86/acer-wmi.c
1418 +++ b/drivers/platform/x86/acer-wmi.c
1419 @@ -80,7 +80,7 @@ MODULE_LICENSE("GPL");
1420 */
1421 #define AMW0_GUID1 "67C3371D-95A3-4C37-BB61-DD47B491DAAB"
1422 #define AMW0_GUID2 "431F16ED-0C2B-444C-B267-27DEB140CF9C"
1423 -#define WMID_GUID1 "6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3"
1424 +#define WMID_GUID1 "6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3"
1425 #define WMID_GUID2 "95764E09-FB56-4e83-B31A-37761F60994A"
1426
1427 MODULE_ALIAS("wmi:67C3371D-95A3-4C37-BB61-DD47B491DAAB");
1428 @@ -1065,7 +1065,7 @@ static ssize_t set_bool_threeg(struct device *dev,
1429 return -EINVAL;
1430 return count;
1431 }
1432 -static DEVICE_ATTR(threeg, S_IWUGO | S_IRUGO | S_IWUSR, show_bool_threeg,
1433 +static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg,
1434 set_bool_threeg);
1435
1436 static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
1437 diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c
1438 index ca05aef..cfab7b1 100644
1439 --- a/drivers/platform/x86/asus_acpi.c
1440 +++ b/drivers/platform/x86/asus_acpi.c
1441 @@ -1081,14 +1081,8 @@ static int asus_hotk_add_fs(struct acpi_device *device)
1442 struct proc_dir_entry *proc;
1443 mode_t mode;
1444
1445 - /*
1446 - * If parameter uid or gid is not changed, keep the default setting for
1447 - * our proc entries (-rw-rw-rw-) else, it means we care about security,
1448 - * and then set to -rw-rw----
1449 - */
1450 -
1451 if ((asus_uid == 0) && (asus_gid == 0)) {
1452 - mode = S_IFREG | S_IRUGO | S_IWUGO;
1453 + mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP;
1454 } else {
1455 mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP;
1456 printk(KERN_WARNING " asus_uid and asus_gid parameters are "
1457 diff --git a/drivers/platform/x86/tc1100-wmi.c b/drivers/platform/x86/tc1100-wmi.c
1458 index 1fe0f1f..865ef78 100644
1459 --- a/drivers/platform/x86/tc1100-wmi.c
1460 +++ b/drivers/platform/x86/tc1100-wmi.c
1461 @@ -162,7 +162,7 @@ set_bool_##value(struct device *dev, struct device_attribute *attr, \
1462 return -EINVAL; \
1463 return count; \
1464 } \
1465 -static DEVICE_ATTR(value, S_IWUGO | S_IRUGO | S_IWUSR, \
1466 +static DEVICE_ATTR(value, S_IRUGO | S_IWUSR, \
1467 show_bool_##value, set_bool_##value);
1468
1469 show_set_bool(wireless, TC1100_INSTANCE_WIRELESS);
1470 diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
1471 index a8ec48e..9130699 100644
1472 --- a/drivers/tty/vt/vt.c
1473 +++ b/drivers/tty/vt/vt.c
1474 @@ -3524,7 +3524,7 @@ int register_con_driver(const struct consw *csw, int first, int last)
1475
1476 /* already registered */
1477 if (con_driver->con == csw)
1478 - retval = -EINVAL;
1479 + retval = -EBUSY;
1480 }
1481
1482 if (retval)
1483 @@ -3635,7 +3635,12 @@ int take_over_console(const struct consw *csw, int first, int last, int deflt)
1484 int err;
1485
1486 err = register_con_driver(csw, first, last);
1487 -
1488 + /* if we get an busy error we still want to bind the console driver
1489 + * and return success, as we may have unbound the console driver
1490 +  * but not unregistered it.
1491 + */
1492 + if (err == -EBUSY)
1493 + err = 0;
1494 if (!err)
1495 bind_con_driver(csw, first, last, deflt);
1496
1497 diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
1498 index 31edd87..32d0ad2 100644
1499 --- a/drivers/usb/core/hub.c
1500 +++ b/drivers/usb/core/hub.c
1501 @@ -2744,11 +2744,6 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
1502 udev->ttport = hdev->ttport;
1503 } else if (udev->speed != USB_SPEED_HIGH
1504 && hdev->speed == USB_SPEED_HIGH) {
1505 - if (!hub->tt.hub) {
1506 - dev_err(&udev->dev, "parent hub has no TT\n");
1507 - retval = -EINVAL;
1508 - goto fail;
1509 - }
1510 udev->tt = &hub->tt;
1511 udev->ttport = port1;
1512 }
1513 diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
1514 index f87552a..866a1d5 100644
1515 --- a/fs/btrfs/ioctl.c
1516 +++ b/fs/btrfs/ioctl.c
1517 @@ -2087,7 +2087,7 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
1518 int num_types = 4;
1519 int alloc_size;
1520 int ret = 0;
1521 - int slot_count = 0;
1522 + u64 slot_count = 0;
1523 int i, c;
1524
1525 if (copy_from_user(&space_args,
1526 @@ -2126,7 +2126,7 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
1527 goto out;
1528 }
1529
1530 - slot_count = min_t(int, space_args.space_slots, slot_count);
1531 + slot_count = min_t(u64, space_args.space_slots, slot_count);
1532
1533 alloc_size = sizeof(*dest) * slot_count;
1534
1535 @@ -2146,6 +2146,9 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
1536 for (i = 0; i < num_types; i++) {
1537 struct btrfs_space_info *tmp;
1538
1539 + if (!slot_count)
1540 + break;
1541 +
1542 info = NULL;
1543 rcu_read_lock();
1544 list_for_each_entry_rcu(tmp, &root->fs_info->space_info,
1545 @@ -2167,7 +2170,10 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
1546 memcpy(dest, &space, sizeof(space));
1547 dest++;
1548 space_args.total_spaces++;
1549 + slot_count--;
1550 }
1551 + if (!slot_count)
1552 + break;
1553 }
1554 up_read(&info->groups_sem);
1555 }
1556 diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
1557 index 9aad47a..23b741d 100644
1558 --- a/fs/cifs/netmisc.c
1559 +++ b/fs/cifs/netmisc.c
1560 @@ -170,7 +170,7 @@ cifs_convert_address(struct sockaddr *dst, const char *src, int len)
1561 {
1562 int rc, alen, slen;
1563 const char *pct;
1564 - char *endp, scope_id[13];
1565 + char scope_id[13];
1566 struct sockaddr_in *s4 = (struct sockaddr_in *) dst;
1567 struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) dst;
1568
1569 @@ -197,9 +197,9 @@ cifs_convert_address(struct sockaddr *dst, const char *src, int len)
1570 memcpy(scope_id, pct + 1, slen);
1571 scope_id[slen] = '\0';
1572
1573 - s6->sin6_scope_id = (u32) simple_strtoul(pct, &endp, 0);
1574 - if (endp != scope_id + slen)
1575 - return 0;
1576 + rc = strict_strtoul(scope_id, 0,
1577 + (unsigned long *)&s6->sin6_scope_id);
1578 + rc = (rc == 0) ? 1 : 0;
1579 }
1580
1581 return rc;
1582 diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
1583 index 7b01d3f..a91f8d2 100644
1584 --- a/fs/cifs/sess.c
1585 +++ b/fs/cifs/sess.c
1586 @@ -667,13 +667,13 @@ ssetup_ntlmssp_authenticate:
1587
1588 if (type == LANMAN) {
1589 #ifdef CONFIG_CIFS_WEAK_PW_HASH
1590 - char lnm_session_key[CIFS_SESS_KEY_SIZE];
1591 + char lnm_session_key[CIFS_AUTH_RESP_SIZE];
1592
1593 pSMB->req.hdr.Flags2 &= ~SMBFLG2_UNICODE;
1594
1595 /* no capabilities flags in old lanman negotiation */
1596
1597 - pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE);
1598 + pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_AUTH_RESP_SIZE);
1599
1600 /* Calculate hash with password and copy into bcc_ptr.
1601 * Encryption Key (stored as in cryptkey) gets used if the
1602 @@ -686,8 +686,8 @@ ssetup_ntlmssp_authenticate:
1603 true : false, lnm_session_key);
1604
1605 ses->flags |= CIFS_SES_LANMAN;
1606 - memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_SESS_KEY_SIZE);
1607 - bcc_ptr += CIFS_SESS_KEY_SIZE;
1608 + memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_AUTH_RESP_SIZE);
1609 + bcc_ptr += CIFS_AUTH_RESP_SIZE;
1610
1611 /* can not sign if LANMAN negotiated so no need
1612 to calculate signing key? but what if server
1613 diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
1614 index 9d1a22d..89edfe3 100644
1615 --- a/fs/ecryptfs/inode.c
1616 +++ b/fs/ecryptfs/inode.c
1617 @@ -1095,6 +1095,8 @@ int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
1618 rc = vfs_getattr(ecryptfs_dentry_to_lower_mnt(dentry),
1619 ecryptfs_dentry_to_lower(dentry), &lower_stat);
1620 if (!rc) {
1621 + fsstack_copy_attr_all(dentry->d_inode,
1622 + ecryptfs_inode_to_lower(dentry->d_inode));
1623 generic_fillattr(dentry->d_inode, stat);
1624 stat->blocks = lower_stat.blocks;
1625 }
1626 diff --git a/fs/file_table.c b/fs/file_table.c
1627 index c3dee38..079940a 100644
1628 --- a/fs/file_table.c
1629 +++ b/fs/file_table.c
1630 @@ -125,13 +125,13 @@ struct file *get_empty_filp(void)
1631 goto fail;
1632
1633 percpu_counter_inc(&nr_files);
1634 + f->f_cred = get_cred(cred);
1635 if (security_file_alloc(f))
1636 goto fail_sec;
1637
1638 INIT_LIST_HEAD(&f->f_u.fu_list);
1639 atomic_long_set(&f->f_count, 1);
1640 rwlock_init(&f->f_owner.lock);
1641 - f->f_cred = get_cred(cred);
1642 spin_lock_init(&f->f_lock);
1643 eventpoll_init_file(f);
1644 /* f->f_version: 0 */
1645 diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
1646 index f35a94a..67080e4 100644
1647 --- a/fs/nfsd/nfs4xdr.c
1648 +++ b/fs/nfsd/nfs4xdr.c
1649 @@ -316,8 +316,8 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
1650 READ_BUF(dummy32);
1651 len += (XDR_QUADLEN(dummy32) << 2);
1652 READMEM(buf, dummy32);
1653 - if ((host_err = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid)))
1654 - goto out_nfserr;
1655 + if ((status = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid)))
1656 + return status;
1657 iattr->ia_valid |= ATTR_UID;
1658 }
1659 if (bmval[1] & FATTR4_WORD1_OWNER_GROUP) {
1660 @@ -327,8 +327,8 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
1661 READ_BUF(dummy32);
1662 len += (XDR_QUADLEN(dummy32) << 2);
1663 READMEM(buf, dummy32);
1664 - if ((host_err = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid)))
1665 - goto out_nfserr;
1666 + if ((status = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid)))
1667 + return status;
1668 iattr->ia_valid |= ATTR_GID;
1669 }
1670 if (bmval[1] & FATTR4_WORD1_TIME_ACCESS_SET) {
1671 diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
1672 index 184938f..f1b0951 100644
1673 --- a/fs/nfsd/vfs.c
1674 +++ b/fs/nfsd/vfs.c
1675 @@ -809,7 +809,7 @@ nfsd_get_raparms(dev_t dev, ino_t ino)
1676 if (ra->p_count == 0)
1677 frap = rap;
1678 }
1679 - depth = nfsdstats.ra_size*11/10;
1680 + depth = nfsdstats.ra_size;
1681 if (!frap) {
1682 spin_unlock(&rab->pb_lock);
1683 return NULL;
1684 diff --git a/fs/partitions/mac.c b/fs/partitions/mac.c
1685 index 68d6a21..11f688b 100644
1686 --- a/fs/partitions/mac.c
1687 +++ b/fs/partitions/mac.c
1688 @@ -29,10 +29,9 @@ static inline void mac_fix_string(char *stg, int len)
1689
1690 int mac_partition(struct parsed_partitions *state)
1691 {
1692 - int slot = 1;
1693 Sector sect;
1694 unsigned char *data;
1695 - int blk, blocks_in_map;
1696 + int slot, blocks_in_map;
1697 unsigned secsize;
1698 #ifdef CONFIG_PPC_PMAC
1699 int found_root = 0;
1700 @@ -59,10 +58,14 @@ int mac_partition(struct parsed_partitions *state)
1701 put_dev_sector(sect);
1702 return 0; /* not a MacOS disk */
1703 }
1704 - strlcat(state->pp_buf, " [mac]", PAGE_SIZE);
1705 blocks_in_map = be32_to_cpu(part->map_count);
1706 - for (blk = 1; blk <= blocks_in_map; ++blk) {
1707 - int pos = blk * secsize;
1708 + if (blocks_in_map < 0 || blocks_in_map >= DISK_MAX_PARTS) {
1709 + put_dev_sector(sect);
1710 + return 0;
1711 + }
1712 + strlcat(state->pp_buf, " [mac]", PAGE_SIZE);
1713 + for (slot = 1; slot <= blocks_in_map; ++slot) {
1714 + int pos = slot * secsize;
1715 put_dev_sector(sect);
1716 data = read_part_sector(state, pos/512, &sect);
1717 if (!data)
1718 @@ -113,13 +116,11 @@ int mac_partition(struct parsed_partitions *state)
1719 }
1720
1721 if (goodness > found_root_goodness) {
1722 - found_root = blk;
1723 + found_root = slot;
1724 found_root_goodness = goodness;
1725 }
1726 }
1727 #endif /* CONFIG_PPC_PMAC */
1728 -
1729 - ++slot;
1730 }
1731 #ifdef CONFIG_PPC_PMAC
1732 if (found_root_goodness)
1733 diff --git a/fs/proc/array.c b/fs/proc/array.c
1734 index fff6572..3d88fe1 100644
1735 --- a/fs/proc/array.c
1736 +++ b/fs/proc/array.c
1737 @@ -353,9 +353,6 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
1738 task_cap(m, task);
1739 task_cpus_allowed(m, task);
1740 cpuset_task_status_allowed(m, task);
1741 -#if defined(CONFIG_S390)
1742 - task_show_regs(m, task);
1743 -#endif
1744 task_context_switch_counts(m, task);
1745 return 0;
1746 }
1747 diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
1748 index f8e854b..206a281 100644
1749 --- a/fs/xfs/quota/xfs_qm.c
1750 +++ b/fs/xfs/quota/xfs_qm.c
1751 @@ -1863,12 +1863,14 @@ xfs_qm_dqreclaim_one(void)
1752 xfs_dquot_t *dqpout;
1753 xfs_dquot_t *dqp;
1754 int restarts;
1755 + int startagain;
1756
1757 restarts = 0;
1758 dqpout = NULL;
1759
1760 /* lockorder: hashchainlock, freelistlock, mplistlock, dqlock, dqflock */
1761 -startagain:
1762 +again:
1763 + startagain = 0;
1764 mutex_lock(&xfs_Gqm->qm_dqfrlist_lock);
1765
1766 list_for_each_entry(dqp, &xfs_Gqm->qm_dqfrlist, q_freelist) {
1767 @@ -1885,13 +1887,10 @@ startagain:
1768 ASSERT(! (dqp->dq_flags & XFS_DQ_INACTIVE));
1769
1770 trace_xfs_dqreclaim_want(dqp);
1771 -
1772 - xfs_dqunlock(dqp);
1773 - mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
1774 - if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
1775 - return NULL;
1776 XQM_STATS_INC(xqmstats.xs_qm_dqwants);
1777 - goto startagain;
1778 + restarts++;
1779 + startagain = 1;
1780 + goto dqunlock;
1781 }
1782
1783 /*
1784 @@ -1906,23 +1905,20 @@ startagain:
1785 ASSERT(list_empty(&dqp->q_mplist));
1786 list_del_init(&dqp->q_freelist);
1787 xfs_Gqm->qm_dqfrlist_cnt--;
1788 - xfs_dqunlock(dqp);
1789 dqpout = dqp;
1790 XQM_STATS_INC(xqmstats.xs_qm_dqinact_reclaims);
1791 - break;
1792 + goto dqunlock;
1793 }
1794
1795 ASSERT(dqp->q_hash);
1796 ASSERT(!list_empty(&dqp->q_mplist));
1797
1798 /*
1799 - * Try to grab the flush lock. If this dquot is in the process of
1800 - * getting flushed to disk, we don't want to reclaim it.
1801 + * Try to grab the flush lock. If this dquot is in the process
1802 + * of getting flushed to disk, we don't want to reclaim it.
1803 */
1804 - if (!xfs_dqflock_nowait(dqp)) {
1805 - xfs_dqunlock(dqp);
1806 - continue;
1807 - }
1808 + if (!xfs_dqflock_nowait(dqp))
1809 + goto dqunlock;
1810
1811 /*
1812 * We have the flush lock so we know that this is not in the
1813 @@ -1944,8 +1940,7 @@ startagain:
1814 xfs_fs_cmn_err(CE_WARN, mp,
1815 "xfs_qm_dqreclaim: dquot %p flush failed", dqp);
1816 }
1817 - xfs_dqunlock(dqp); /* dqflush unlocks dqflock */
1818 - continue;
1819 + goto dqunlock;
1820 }
1821
1822 /*
1823 @@ -1967,13 +1962,8 @@ startagain:
1824 */
1825 if (!mutex_trylock(&mp->m_quotainfo->qi_dqlist_lock)) {
1826 restarts++;
1827 - mutex_unlock(&dqp->q_hash->qh_lock);
1828 - xfs_dqfunlock(dqp);
1829 - xfs_dqunlock(dqp);
1830 - mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
1831 - if (restarts++ >= XFS_QM_RECLAIM_MAX_RESTARTS)
1832 - return NULL;
1833 - goto startagain;
1834 + startagain = 1;
1835 + goto qhunlock;
1836 }
1837
1838 ASSERT(dqp->q_nrefs == 0);
1839 @@ -1986,14 +1976,20 @@ startagain:
1840 xfs_Gqm->qm_dqfrlist_cnt--;
1841 dqpout = dqp;
1842 mutex_unlock(&mp->m_quotainfo->qi_dqlist_lock);
1843 +qhunlock:
1844 mutex_unlock(&dqp->q_hash->qh_lock);
1845 dqfunlock:
1846 xfs_dqfunlock(dqp);
1847 +dqunlock:
1848 xfs_dqunlock(dqp);
1849 if (dqpout)
1850 break;
1851 if (restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
1852 - return NULL;
1853 + break;
1854 + if (startagain) {
1855 + mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
1856 + goto again;
1857 + }
1858 }
1859 mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
1860 return dqpout;
1861 diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
1862 index cb845c1..dd7d4e2 100644
1863 --- a/include/linux/pci_ids.h
1864 +++ b/include/linux/pci_ids.h
1865 @@ -518,6 +518,7 @@
1866 #define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303
1867 #define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304
1868 #define PCI_DEVICE_ID_AMD_15H_NB_MISC 0x1603
1869 +#define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703
1870 #define PCI_DEVICE_ID_AMD_LANCE 0x2000
1871 #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001
1872 #define PCI_DEVICE_ID_AMD_SCSI 0x2020
1873 diff --git a/include/linux/security.h b/include/linux/security.h
1874 index d47a4c2..b3f2f47 100644
1875 --- a/include/linux/security.h
1876 +++ b/include/linux/security.h
1877 @@ -1664,7 +1664,7 @@ int security_capset(struct cred *new, const struct cred *old,
1878 const kernel_cap_t *effective,
1879 const kernel_cap_t *inheritable,
1880 const kernel_cap_t *permitted);
1881 -int security_capable(int cap);
1882 +int security_capable(const struct cred *cred, int cap);
1883 int security_real_capable(struct task_struct *tsk, int cap);
1884 int security_real_capable_noaudit(struct task_struct *tsk, int cap);
1885 int security_sysctl(struct ctl_table *table, int op);
1886 @@ -1857,9 +1857,9 @@ static inline int security_capset(struct cred *new,
1887 return cap_capset(new, old, effective, inheritable, permitted);
1888 }
1889
1890 -static inline int security_capable(int cap)
1891 +static inline int security_capable(const struct cred *cred, int cap)
1892 {
1893 - return cap_capable(current, current_cred(), cap, SECURITY_CAP_AUDIT);
1894 + return cap_capable(current, cred, cap, SECURITY_CAP_AUDIT);
1895 }
1896
1897 static inline int security_real_capable(struct task_struct *tsk, int cap)
1898 diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
1899 index 8479b66..3fd5064 100644
1900 --- a/include/pcmcia/ds.h
1901 +++ b/include/pcmcia/ds.h
1902 @@ -261,6 +261,7 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev);
1903 #define CONF_ENABLE_ESR 0x0008
1904 #define CONF_ENABLE_IOCARD 0x0010 /* auto-enabled if IO resources or IRQ
1905 * (CONF_ENABLE_IRQ) in use */
1906 +#define CONF_ENABLE_ZVCARD 0x0020
1907
1908 /* flags used by pcmcia_loop_config() autoconfiguration */
1909 #define CONF_AUTO_CHECK_VCC 0x0100 /* check for matching Vcc? */
1910 diff --git a/kernel/capability.c b/kernel/capability.c
1911 index 2f05303..9e9385f 100644
1912 --- a/kernel/capability.c
1913 +++ b/kernel/capability.c
1914 @@ -306,7 +306,7 @@ int capable(int cap)
1915 BUG();
1916 }
1917
1918 - if (security_capable(cap) == 0) {
1919 + if (security_capable(current_cred(), cap) == 0) {
1920 current->flags |= PF_SUPERPRIV;
1921 return 1;
1922 }
1923 diff --git a/kernel/cred.c b/kernel/cred.c
1924 index 6a1aa00..3a9d6dd 100644
1925 --- a/kernel/cred.c
1926 +++ b/kernel/cred.c
1927 @@ -252,13 +252,13 @@ struct cred *cred_alloc_blank(void)
1928 #endif
1929
1930 atomic_set(&new->usage, 1);
1931 +#ifdef CONFIG_DEBUG_CREDENTIALS
1932 + new->magic = CRED_MAGIC;
1933 +#endif
1934
1935 if (security_cred_alloc_blank(new, GFP_KERNEL) < 0)
1936 goto error;
1937
1938 -#ifdef CONFIG_DEBUG_CREDENTIALS
1939 - new->magic = CRED_MAGIC;
1940 -#endif
1941 return new;
1942
1943 error:
1944 @@ -657,6 +657,8 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon)
1945 validate_creds(old);
1946
1947 *new = *old;
1948 + atomic_set(&new->usage, 1);
1949 + set_cred_subscribers(new, 0);
1950 get_uid(new->user);
1951 get_group_info(new->group_info);
1952
1953 @@ -674,8 +676,6 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon)
1954 if (security_prepare_creds(new, old, GFP_KERNEL) < 0)
1955 goto error;
1956
1957 - atomic_set(&new->usage, 1);
1958 - set_cred_subscribers(new, 0);
1959 put_cred(old);
1960 validate_creds(new);
1961 return new;
1962 @@ -748,7 +748,11 @@ bool creds_are_invalid(const struct cred *cred)
1963 if (cred->magic != CRED_MAGIC)
1964 return true;
1965 #ifdef CONFIG_SECURITY_SELINUX
1966 - if (selinux_is_enabled()) {
1967 + /*
1968 + * cred->security == NULL if security_cred_alloc_blank() or
1969 + * security_prepare_creds() returned an error.
1970 + */
1971 + if (selinux_is_enabled() && cred->security) {
1972 if ((unsigned long) cred->security < PAGE_SIZE)
1973 return true;
1974 if ((*(u32 *)cred->security & 0xffffff00) ==
1975 diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
1976 index 4571ae7..99c3bc8 100644
1977 --- a/kernel/irq/internals.h
1978 +++ b/kernel/irq/internals.h
1979 @@ -3,6 +3,12 @@
1980 */
1981 #include <linux/irqdesc.h>
1982
1983 +#ifdef CONFIG_SPARSE_IRQ
1984 +# define IRQ_BITMAP_BITS (NR_IRQS + 8196)
1985 +#else
1986 +# define IRQ_BITMAP_BITS NR_IRQS
1987 +#endif
1988 +
1989 extern int noirqdebug;
1990
1991 #define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data)
1992 diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
1993 index 9988d03..49b8394 100644
1994 --- a/kernel/irq/irqdesc.c
1995 +++ b/kernel/irq/irqdesc.c
1996 @@ -91,7 +91,7 @@ int nr_irqs = NR_IRQS;
1997 EXPORT_SYMBOL_GPL(nr_irqs);
1998
1999 static DEFINE_MUTEX(sparse_irq_lock);
2000 -static DECLARE_BITMAP(allocated_irqs, NR_IRQS);
2001 +static DECLARE_BITMAP(allocated_irqs, IRQ_BITMAP_BITS);
2002
2003 #ifdef CONFIG_SPARSE_IRQ
2004
2005 @@ -215,6 +215,15 @@ int __init early_irq_init(void)
2006 initcnt = arch_probe_nr_irqs();
2007 printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt);
2008
2009 + if (WARN_ON(nr_irqs > IRQ_BITMAP_BITS))
2010 + nr_irqs = IRQ_BITMAP_BITS;
2011 +
2012 + if (WARN_ON(initcnt > IRQ_BITMAP_BITS))
2013 + initcnt = IRQ_BITMAP_BITS;
2014 +
2015 + if (initcnt > nr_irqs)
2016 + nr_irqs = initcnt;
2017 +
2018 for (i = 0; i < initcnt; i++) {
2019 desc = alloc_desc(i, node);
2020 set_bit(i, allocated_irqs);
2021 diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
2022 index 5f92acc5..6f7c114 100644
2023 --- a/kernel/irq/manage.c
2024 +++ b/kernel/irq/manage.c
2025 @@ -1098,7 +1098,7 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
2026 if (retval)
2027 kfree(action);
2028
2029 -#ifdef CONFIG_DEBUG_SHIRQ
2030 +#ifdef CONFIG_DEBUG_SHIRQ_FIXME
2031 if (!retval && (irqflags & IRQF_SHARED)) {
2032 /*
2033 * It's a shared IRQ -- the driver ought to be prepared for it
2034 diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c
2035 index 891115a..dc49358 100644
2036 --- a/kernel/irq/resend.c
2037 +++ b/kernel/irq/resend.c
2038 @@ -23,7 +23,7 @@
2039 #ifdef CONFIG_HARDIRQS_SW_RESEND
2040
2041 /* Bitmap to handle software resend of interrupts: */
2042 -static DECLARE_BITMAP(irqs_resend, NR_IRQS);
2043 +static DECLARE_BITMAP(irqs_resend, IRQ_BITMAP_BITS);
2044
2045 /*
2046 * Run software resends of IRQ's
2047 diff --git a/kernel/perf_event.c b/kernel/perf_event.c
2048 index 64668bd..785c66a 100644
2049 --- a/kernel/perf_event.c
2050 +++ b/kernel/perf_event.c
2051 @@ -652,6 +652,10 @@ retry:
2052 raw_spin_unlock_irq(&ctx->lock);
2053 }
2054
2055 +#define MAX_INTERRUPTS (~0ULL)
2056 +
2057 +static void perf_log_throttle(struct perf_event *event, int enable);
2058 +
2059 static int
2060 event_sched_in(struct perf_event *event,
2061 struct perf_cpu_context *cpuctx,
2062 @@ -662,6 +666,17 @@ event_sched_in(struct perf_event *event,
2063
2064 event->state = PERF_EVENT_STATE_ACTIVE;
2065 event->oncpu = smp_processor_id();
2066 +
2067 + /*
2068 + * Unthrottle events, since we scheduled we might have missed several
2069 + * ticks already, also for a heavily scheduling task there is little
2070 + * guarantee it'll get a tick in a timely manner.
2071 + */
2072 + if (unlikely(event->hw.interrupts == MAX_INTERRUPTS)) {
2073 + perf_log_throttle(event, 1);
2074 + event->hw.interrupts = 0;
2075 + }
2076 +
2077 /*
2078 * The new state must be visible before we turn it on in the hardware:
2079 */
2080 @@ -1469,10 +1484,6 @@ void __perf_event_task_sched_in(struct task_struct *task)
2081 }
2082 }
2083
2084 -#define MAX_INTERRUPTS (~0ULL)
2085 -
2086 -static void perf_log_throttle(struct perf_event *event, int enable);
2087 -
2088 static u64 perf_calculate_period(struct perf_event *event, u64 nsec, u64 count)
2089 {
2090 u64 frequency = event->attr.sample_freq;
2091 diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
2092 index 0dac75e..64db648 100644
2093 --- a/kernel/power/snapshot.c
2094 +++ b/kernel/power/snapshot.c
2095 @@ -1519,11 +1519,8 @@ static int
2096 swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm,
2097 unsigned int nr_pages, unsigned int nr_highmem)
2098 {
2099 - int error = 0;
2100 -
2101 if (nr_highmem > 0) {
2102 - error = get_highmem_buffer(PG_ANY);
2103 - if (error)
2104 + if (get_highmem_buffer(PG_ANY))
2105 goto err_out;
2106 if (nr_highmem > alloc_highmem) {
2107 nr_highmem -= alloc_highmem;
2108 @@ -1546,7 +1543,7 @@ swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm,
2109
2110 err_out:
2111 swsusp_free();
2112 - return error;
2113 + return -ENOMEM;
2114 }
2115
2116 asmlinkage int swsusp_save(void)
2117 diff --git a/kernel/workqueue.c b/kernel/workqueue.c
2118 index 4be7fa5..c95f321 100644
2119 --- a/kernel/workqueue.c
2120 +++ b/kernel/workqueue.c
2121 @@ -79,7 +79,9 @@ enum {
2122 MAX_IDLE_WORKERS_RATIO = 4, /* 1/4 of busy can be idle */
2123 IDLE_WORKER_TIMEOUT = 300 * HZ, /* keep idle ones for 5 mins */
2124
2125 - MAYDAY_INITIAL_TIMEOUT = HZ / 100, /* call for help after 10ms */
2126 + MAYDAY_INITIAL_TIMEOUT = HZ / 100 >= 2 ? HZ / 100 : 2,
2127 + /* call for help after 10ms
2128 + (min two ticks) */
2129 MAYDAY_INTERVAL = HZ / 10, /* and then every 100ms */
2130 CREATE_COOLDOWN = HZ, /* time to breath after fail */
2131 TRUSTEE_COOLDOWN = HZ / 10, /* for trustee draining */
2132 @@ -2009,6 +2011,15 @@ repeat:
2133 move_linked_works(work, scheduled, &n);
2134
2135 process_scheduled_works(rescuer);
2136 +
2137 + /*
2138 + * Leave this gcwq. If keep_working() is %true, notify a
2139 + * regular worker; otherwise, we end up with 0 concurrency
2140 + * and stalling the execution.
2141 + */
2142 + if (keep_working(gcwq))
2143 + wake_up_worker(gcwq);
2144 +
2145 spin_unlock_irq(&gcwq->lock);
2146 }
2147
2148 diff --git a/net/core/dev.c b/net/core/dev.c
2149 index 0dd54a6..c0d3b5f 100644
2150 --- a/net/core/dev.c
2151 +++ b/net/core/dev.c
2152 @@ -4945,6 +4945,7 @@ static void rollback_registered(struct net_device *dev)
2153
2154 list_add(&dev->unreg_list, &single);
2155 rollback_registered_many(&single);
2156 + list_del(&single);
2157 }
2158
2159 unsigned long netdev_fix_features(unsigned long features, const char *name)
2160 @@ -6114,6 +6115,7 @@ static void __net_exit default_device_exit_batch(struct list_head *net_list)
2161 }
2162 }
2163 unregister_netdevice_many(&dev_kill_list);
2164 + list_del(&dev_kill_list);
2165 rtnl_unlock();
2166 }
2167
2168 diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
2169 index b729ace..742a6dc 100644
2170 --- a/net/netfilter/nf_conntrack_netlink.c
2171 +++ b/net/netfilter/nf_conntrack_netlink.c
2172 @@ -642,30 +642,29 @@ ctnetlink_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
2173 struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
2174 u_int8_t l3proto = nfmsg->nfgen_family;
2175
2176 - rcu_read_lock();
2177 + spin_lock_bh(&nf_conntrack_lock);
2178 last = (struct nf_conn *)cb->args[1];
2179 for (; cb->args[0] < net->ct.htable_size; cb->args[0]++) {
2180 restart:
2181 - hlist_nulls_for_each_entry_rcu(h, n, &net->ct.hash[cb->args[0]],
2182 + hlist_nulls_for_each_entry(h, n, &net->ct.hash[cb->args[0]],
2183 hnnode) {
2184 if (NF_CT_DIRECTION(h) != IP_CT_DIR_ORIGINAL)
2185 continue;
2186 ct = nf_ct_tuplehash_to_ctrack(h);
2187 - if (!atomic_inc_not_zero(&ct->ct_general.use))
2188 - continue;
2189 /* Dump entries of a given L3 protocol number.
2190 * If it is not specified, ie. l3proto == 0,
2191 * then dump everything. */
2192 if (l3proto && nf_ct_l3num(ct) != l3proto)
2193 - goto releasect;
2194 + continue;
2195 if (cb->args[1]) {
2196 if (ct != last)
2197 - goto releasect;
2198 + continue;
2199 cb->args[1] = 0;
2200 }
2201 if (ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).pid,
2202 cb->nlh->nlmsg_seq,
2203 IPCTNL_MSG_CT_NEW, ct) < 0) {
2204 + nf_conntrack_get(&ct->ct_general);
2205 cb->args[1] = (unsigned long)ct;
2206 goto out;
2207 }
2208 @@ -678,8 +677,6 @@ restart:
2209 if (acct)
2210 memset(acct, 0, sizeof(struct nf_conn_counter[IP_CT_DIR_MAX]));
2211 }
2212 -releasect:
2213 - nf_ct_put(ct);
2214 }
2215 if (cb->args[1]) {
2216 cb->args[1] = 0;
2217 @@ -687,7 +684,7 @@ releasect:
2218 }
2219 }
2220 out:
2221 - rcu_read_unlock();
2222 + spin_unlock_bh(&nf_conntrack_lock);
2223 if (last)
2224 nf_ct_put(last);
2225
2226 diff --git a/security/security.c b/security/security.c
2227 index e5fb07a..8d57dbb 100644
2228 --- a/security/security.c
2229 +++ b/security/security.c
2230 @@ -154,10 +154,9 @@ int security_capset(struct cred *new, const struct cred *old,
2231 effective, inheritable, permitted);
2232 }
2233
2234 -int security_capable(int cap)
2235 +int security_capable(const struct cred *cred, int cap)
2236 {
2237 - return security_ops->capable(current, current_cred(), cap,
2238 - SECURITY_CAP_AUDIT);
2239 + return security_ops->capable(current, cred, cap, SECURITY_CAP_AUDIT);
2240 }
2241
2242 int security_real_capable(struct task_struct *tsk, int cap)
2243 diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
2244 index 11d5c47..a373ab6 100644
2245 --- a/security/selinux/hooks.c
2246 +++ b/security/selinux/hooks.c
2247 @@ -3198,7 +3198,11 @@ static void selinux_cred_free(struct cred *cred)
2248 {
2249 struct task_security_struct *tsec = cred->security;
2250
2251 - BUG_ON((unsigned long) cred->security < PAGE_SIZE);
2252 + /*
2253 + * cred->security == NULL if security_cred_alloc_blank() or
2254 + * security_prepare_creds() returned an error.
2255 + */
2256 + BUG_ON(cred->security && (unsigned long) cred->security < PAGE_SIZE);
2257 cred->security = (void *) 0x7UL;
2258 kfree(tsec);
2259 }
2260 diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
2261 index a1c4008..5825d18 100644
2262 --- a/sound/pci/hda/hda_intel.c
2263 +++ b/sound/pci/hda/hda_intel.c
2264 @@ -2305,6 +2305,7 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = {
2265 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
2266 SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
2267 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB),
2268 + SND_PCI_QUIRK(0x1043, 0x8410, "ASUS", POS_FIX_LPIB),
2269 SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),
2270 SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),
2271 SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba A100-259", POS_FIX_LPIB),
2272 diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
2273 index 5667fb9..fc5e027 100644
2274 --- a/sound/pci/hda/patch_conexant.c
2275 +++ b/sound/pci/hda/patch_conexant.c
2276 @@ -3401,7 +3401,7 @@ static void cx_auto_parse_output(struct hda_codec *codec)
2277 }
2278 }
2279 spec->multiout.dac_nids = spec->private_dac_nids;
2280 - spec->multiout.max_channels = nums * 2;
2281 + spec->multiout.max_channels = spec->multiout.num_dacs * 2;
2282
2283 if (cfg->hp_outs > 0)
2284 spec->auto_mute = 1;
2285 diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
2286 index 622b602..8b87e04 100644
2287 --- a/sound/soc/codecs/wm8903.c
2288 +++ b/sound/soc/codecs/wm8903.c
2289 @@ -1479,7 +1479,7 @@ int wm8903_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
2290 WM8903_MICDET_EINT | WM8903_MICSHRT_EINT,
2291 irq_mask);
2292
2293 - if (det && shrt) {
2294 + if (det || shrt) {
2295 /* Enable mic detection, this may not have been set through
2296 * platform data (eg, if the defaults are OK). */
2297 snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0,
2298 diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
2299 index 68b9747..66eabaf 100644
2300 --- a/sound/usb/caiaq/audio.c
2301 +++ b/sound/usb/caiaq/audio.c
2302 @@ -785,7 +785,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
2303 }
2304
2305 dev->pcm->private_data = dev;
2306 - strcpy(dev->pcm->name, dev->product_name);
2307 + strlcpy(dev->pcm->name, dev->product_name, sizeof(dev->pcm->name));
2308
2309 memset(dev->sub_playback, 0, sizeof(dev->sub_playback));
2310 memset(dev->sub_capture, 0, sizeof(dev->sub_capture));
2311 diff --git a/sound/usb/caiaq/midi.c b/sound/usb/caiaq/midi.c
2312 index 2f218c7..a1a4708 100644
2313 --- a/sound/usb/caiaq/midi.c
2314 +++ b/sound/usb/caiaq/midi.c
2315 @@ -136,7 +136,7 @@ int snd_usb_caiaq_midi_init(struct snd_usb_caiaqdev *device)
2316 if (ret < 0)
2317 return ret;
2318
2319 - strcpy(rmidi->name, device->product_name);
2320 + strlcpy(rmidi->name, device->product_name, sizeof(rmidi->name));
2321
2322 rmidi->info_flags = SNDRV_RAWMIDI_INFO_DUPLEX;
2323 rmidi->private_data = device;
2324 diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
2325 index 9bcc38f..b3028eb 100644
2326 --- a/tools/perf/builtin-timechart.c
2327 +++ b/tools/perf/builtin-timechart.c
2328 @@ -502,7 +502,7 @@ static int process_sample_event(event_t *event, struct perf_session *session)
2329 c_state_start(pe->cpu_id, data.time, pe->value);
2330
2331 if (strcmp(event_str, "power:power_end") == 0)
2332 - c_state_end(pe->cpu_id, data.time);
2333 + c_state_end(data.cpu, data.time);
2334
2335 if (strcmp(event_str, "power:power_frequency") == 0)
2336 p_state_change(pe->cpu_id, data.time, pe->value);