- Linux 3.0.74.
[opensuse:kernel-source.git] / patches.kernel.org / patch-3.0.73-74
1 From: Jiri Slaby <jslaby@suse.cz>
2 Subject: Linux 3.0.74
3 Patch-mainline: 3.0.74
4 Git-commit: f5cf8f07423b2677cebebcebc863af77223a4972
5 Git-commit: e2409d83434d77874b461b78af6a19cd6e6a1280
6 Git-commit: 9c603e53d380459fb62fec7cd085acb0b74ac18f
7 Git-commit: 511ba86e1d386f671084b5d0e6f110bb30b8eeb2
8 Git-commit: 1160c2779b826c6f5c08e5cc542de58fd1f667d5
9 Git-commit: a1cbcaa9ea87b87a96b9fc465951dcf36e459ca2
10 Git-commit: 30f359a6f9da65a66de8cadf959f0f4a0d498bba
11 Git-commit: 6f389a8f1dd22a24f3d9afc2812b30d639e94625
12 Git-commit: 83e03b3fe4daffdebbb42151d5410d730ae50bd1
13 Git-commit: f1ca493b0b5e8f42d3b2dc8877860db2983f47b6
14 Git-commit: f03574f2d5b2d6229dcdf2d322848065f72953c7
15 Git-commit: 889d66848b12d891248b03abcb2a42047f8e172a
16
17 Signed-off-by: Jiri Slaby <jslaby@suse.cz>
18 ---
19 diff --git a/Makefile b/Makefile
20 index f82a70f..71e8efa 100644
21 --- a/Makefile
22 +++ b/Makefile
23 @@ -1,6 +1,6 @@
24  VERSION = 3
25  PATCHLEVEL = 0
26 -SUBLEVEL = 73
27 +SUBLEVEL = 74
28  EXTRAVERSION =
29  NAME = Sneaky Weasel
30  
31 diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
32 index ebbc4d8..2fdfe31 100644
33 --- a/arch/x86/include/asm/paravirt.h
34 +++ b/arch/x86/include/asm/paravirt.h
35 @@ -731,7 +731,10 @@ static inline void arch_leave_lazy_mmu_mode(void)
36         PVOP_VCALL0(pv_mmu_ops.lazy_mode.leave);
37  }
38  
39 -void arch_flush_lazy_mmu_mode(void);
40 +static inline void arch_flush_lazy_mmu_mode(void)
41 +{
42 +       PVOP_VCALL0(pv_mmu_ops.lazy_mode.flush);
43 +}
44  
45  static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
46                                 phys_addr_t phys, pgprot_t flags)
47 diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
48 index 8288509..4b67ec9 100644
49 --- a/arch/x86/include/asm/paravirt_types.h
50 +++ b/arch/x86/include/asm/paravirt_types.h
51 @@ -85,6 +85,7 @@ struct pv_lazy_ops {
52         /* Set deferred update mode, used for batching operations. */
53         void (*enter)(void);
54         void (*leave)(void);
55 +       void (*flush)(void);
56  };
57  
58  struct pv_time_ops {
59 @@ -673,6 +674,7 @@ void paravirt_end_context_switch(struct task_struct *next);
60  
61  void paravirt_enter_lazy_mmu(void);
62  void paravirt_leave_lazy_mmu(void);
63 +void paravirt_flush_lazy_mmu(void);
64  
65  void _paravirt_nop(void);
66  u32 _paravirt_ident_32(u32);
67 diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
68 index 869e1ae..704faba 100644
69 --- a/arch/x86/kernel/paravirt.c
70 +++ b/arch/x86/kernel/paravirt.c
71 @@ -253,6 +253,18 @@ void paravirt_leave_lazy_mmu(void)
72         leave_lazy(PARAVIRT_LAZY_MMU);
73  }
74  
75 +void paravirt_flush_lazy_mmu(void)
76 +{
77 +       preempt_disable();
78 +
79 +       if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
80 +               arch_leave_lazy_mmu_mode();
81 +               arch_enter_lazy_mmu_mode();
82 +       }
83 +
84 +       preempt_enable();
85 +}
86 +
87  void paravirt_start_context_switch(struct task_struct *prev)
88  {
89         BUG_ON(preemptible());
90 @@ -282,18 +294,6 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
91         return percpu_read(paravirt_lazy_mode);
92  }
93  
94 -void arch_flush_lazy_mmu_mode(void)
95 -{
96 -       preempt_disable();
97 -
98 -       if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
99 -               arch_leave_lazy_mmu_mode();
100 -               arch_enter_lazy_mmu_mode();
101 -       }
102 -
103 -       preempt_enable();
104 -}
105 -
106  struct pv_info pv_info = {
107         .name = "bare hardware",
108         .paravirt_enabled = 0,
109 @@ -462,6 +462,7 @@ struct pv_mmu_ops pv_mmu_ops = {
110         .lazy_mode = {
111                 .enter = paravirt_nop,
112                 .leave = paravirt_nop,
113 +               .flush = paravirt_nop,
114         },
115  
116         .set_fixmap = native_set_fixmap,
117 diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
118 index db832fd..2d45247 100644
119 --- a/arch/x86/lguest/boot.c
120 +++ b/arch/x86/lguest/boot.c
121 @@ -1309,6 +1309,7 @@ __init void lguest_init(void)
122         pv_mmu_ops.read_cr3 = lguest_read_cr3;
123         pv_mmu_ops.lazy_mode.enter = paravirt_enter_lazy_mmu;
124         pv_mmu_ops.lazy_mode.leave = lguest_leave_lazy_mmu_mode;
125 +       pv_mmu_ops.lazy_mode.flush = paravirt_flush_lazy_mmu;
126         pv_mmu_ops.pte_update = lguest_pte_update;
127         pv_mmu_ops.pte_update_defer = lguest_pte_update;
128  
129 diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
130 index 3b2ad91..7653f14 100644
131 --- a/arch/x86/mm/fault.c
132 +++ b/arch/x86/mm/fault.c
133 @@ -376,10 +376,12 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
134         if (pgd_none(*pgd_ref))
135                 return -1;
136  
137 -       if (pgd_none(*pgd))
138 +       if (pgd_none(*pgd)) {
139                 set_pgd(pgd, *pgd_ref);
140 -       else
141 +               arch_flush_lazy_mmu_mode();
142 +       } else {
143                 BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref));
144 +       }
145  
146         /*
147          * Below here mismatches are bugs because these lower tables
148 diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
149 index 849a975..025d469 100644
150 --- a/arch/x86/mm/numa_32.c
151 +++ b/arch/x86/mm/numa_32.c
152 @@ -73,167 +73,6 @@ unsigned long node_memmap_size_bytes(int nid, unsigned long start_pfn,
153  
154  extern unsigned long highend_pfn, highstart_pfn;
155  
156 -#define LARGE_PAGE_BYTES (PTRS_PER_PTE * PAGE_SIZE)
157 -
158 -static void *node_remap_start_vaddr[MAX_NUMNODES];
159 -void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags);
160 -
161 -/*
162 - * Remap memory allocator
163 - */
164 -static unsigned long node_remap_start_pfn[MAX_NUMNODES];
165 -static void *node_remap_end_vaddr[MAX_NUMNODES];
166 -static void *node_remap_alloc_vaddr[MAX_NUMNODES];
167 -
168 -/**
169 - * alloc_remap - Allocate remapped memory
170 - * @nid: NUMA node to allocate memory from
171 - * @size: The size of allocation
172 - *
173 - * Allocate @size bytes from the remap area of NUMA node @nid.  The
174 - * size of the remap area is predetermined by init_alloc_remap() and
175 - * only the callers considered there should call this function.  For
176 - * more info, please read the comment on top of init_alloc_remap().
177 - *
178 - * The caller must be ready to handle allocation failure from this
179 - * function and fall back to regular memory allocator in such cases.
180 - *
181 - * CONTEXT:
182 - * Single CPU early boot context.
183 - *
184 - * RETURNS:
185 - * Pointer to the allocated memory on success, %NULL on failure.
186 - */
187 -void *alloc_remap(int nid, unsigned long size)
188 -{
189 -       void *allocation = node_remap_alloc_vaddr[nid];
190 -
191 -       size = ALIGN(size, L1_CACHE_BYTES);
192 -
193 -       if (!allocation || (allocation + size) > node_remap_end_vaddr[nid])
194 -               return NULL;
195 -
196 -       node_remap_alloc_vaddr[nid] += size;
197 -       memset(allocation, 0, size);
198 -
199 -       return allocation;
200 -}
201 -
202 -#ifdef CONFIG_HIBERNATION
203 -/**
204 - * resume_map_numa_kva - add KVA mapping to the temporary page tables created
205 - *                       during resume from hibernation
206 - * @pgd_base - temporary resume page directory
207 - */
208 -void resume_map_numa_kva(pgd_t *pgd_base)
209 -{
210 -       int node;
211 -
212 -       for_each_online_node(node) {
213 -               unsigned long start_va, start_pfn, nr_pages, pfn;
214 -
215 -               start_va = (unsigned long)node_remap_start_vaddr[node];
216 -               start_pfn = node_remap_start_pfn[node];
217 -               nr_pages = (node_remap_end_vaddr[node] -
218 -                           node_remap_start_vaddr[node]) >> PAGE_SHIFT;
219 -
220 -               printk(KERN_DEBUG "%s: node %d\n", __func__, node);
221 -
222 -               for (pfn = 0; pfn < nr_pages; pfn += PTRS_PER_PTE) {
223 -                       unsigned long vaddr = start_va + (pfn << PAGE_SHIFT);
224 -                       pgd_t *pgd = pgd_base + pgd_index(vaddr);
225 -                       pud_t *pud = pud_offset(pgd, vaddr);
226 -                       pmd_t *pmd = pmd_offset(pud, vaddr);
227 -
228 -                       set_pmd(pmd, pfn_pmd(start_pfn + pfn,
229 -                                               PAGE_KERNEL_LARGE_EXEC));
230 -
231 -                       printk(KERN_DEBUG "%s: %08lx -> pfn %08lx\n",
232 -                               __func__, vaddr, start_pfn + pfn);
233 -               }
234 -       }
235 -}
236 -#endif
237 -
238 -/**
239 - * init_alloc_remap - Initialize remap allocator for a NUMA node
240 - * @nid: NUMA node to initizlie remap allocator for
241 - *
242 - * NUMA nodes may end up without any lowmem.  As allocating pgdat and
243 - * memmap on a different node with lowmem is inefficient, a special
244 - * remap allocator is implemented which can be used by alloc_remap().
245 - *
246 - * For each node, the amount of memory which will be necessary for
247 - * pgdat and memmap is calculated and two memory areas of the size are
248 - * allocated - one in the node and the other in lowmem; then, the area
249 - * in the node is remapped to the lowmem area.
250 - *
251 - * As pgdat and memmap must be allocated in lowmem anyway, this
252 - * doesn't waste lowmem address space; however, the actual lowmem
253 - * which gets remapped over is wasted.  The amount shouldn't be
254 - * problematic on machines this feature will be used.
255 - *
256 - * Initialization failure isn't fatal.  alloc_remap() is used
257 - * opportunistically and the callers will fall back to other memory
258 - * allocation mechanisms on failure.
259 - */
260 -void __init init_alloc_remap(int nid, u64 start, u64 end)
261 -{
262 -       unsigned long start_pfn = start >> PAGE_SHIFT;
263 -       unsigned long end_pfn = end >> PAGE_SHIFT;
264 -       unsigned long size, pfn;
265 -       u64 node_pa, remap_pa;
266 -       void *remap_va;
267 -
268 -       /*
269 -        * The acpi/srat node info can show hot-add memroy zones where
270 -        * memory could be added but not currently present.
271 -        */
272 -       printk(KERN_DEBUG "node %d pfn: [%lx - %lx]\n",
273 -              nid, start_pfn, end_pfn);
274 -
275 -       /* calculate the necessary space aligned to large page size */
276 -       size = node_memmap_size_bytes(nid, start_pfn, end_pfn);
277 -       size += ALIGN(sizeof(pg_data_t), PAGE_SIZE);
278 -       size = ALIGN(size, LARGE_PAGE_BYTES);
279 -
280 -       /* allocate node memory and the lowmem remap area */
281 -       node_pa = memblock_find_in_range(start, end, size, LARGE_PAGE_BYTES);
282 -       if (node_pa == MEMBLOCK_ERROR) {
283 -               pr_warning("remap_alloc: failed to allocate %lu bytes for node %d\n",
284 -                          size, nid);
285 -               return;
286 -       }
287 -       memblock_x86_reserve_range(node_pa, node_pa + size, "KVA RAM");
288 -
289 -       remap_pa = memblock_find_in_range(min_low_pfn << PAGE_SHIFT,
290 -                                         max_low_pfn << PAGE_SHIFT,
291 -                                         size, LARGE_PAGE_BYTES);
292 -       if (remap_pa == MEMBLOCK_ERROR) {
293 -               pr_warning("remap_alloc: failed to allocate %lu bytes remap area for node %d\n",
294 -                          size, nid);
295 -               memblock_x86_free_range(node_pa, node_pa + size);
296 -               return;
297 -       }
298 -       memblock_x86_reserve_range(remap_pa, remap_pa + size, "KVA PG");
299 -       remap_va = phys_to_virt(remap_pa);
300 -
301 -       /* perform actual remap */
302 -       for (pfn = 0; pfn < size >> PAGE_SHIFT; pfn += PTRS_PER_PTE)
303 -               set_pmd_pfn((unsigned long)remap_va + (pfn << PAGE_SHIFT),
304 -                           (node_pa >> PAGE_SHIFT) + pfn,
305 -                           PAGE_KERNEL_LARGE);
306 -
307 -       /* initialize remap allocator parameters */
308 -       node_remap_start_pfn[nid] = node_pa >> PAGE_SHIFT;
309 -       node_remap_start_vaddr[nid] = remap_va;
310 -       node_remap_end_vaddr[nid] = remap_va + size;
311 -       node_remap_alloc_vaddr[nid] = remap_va;
312 -
313 -       printk(KERN_DEBUG "remap_alloc: node %d [%08llx-%08llx) -> [%p-%p)\n",
314 -              nid, node_pa, node_pa + size, remap_va, remap_va + size);
315 -}
316 -
317  void __init initmem_init(void)
318  {
319         x86_numa_init();
320 diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
321 index d957dce..a0aed70 100644
322 --- a/arch/x86/xen/mmu.c
323 +++ b/arch/x86/xen/mmu.c
324 @@ -2011,6 +2011,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = {
325         .lazy_mode = {
326                 .enter = paravirt_enter_lazy_mmu,
327                 .leave = xen_leave_lazy_mmu,
328 +               .flush = paravirt_flush_lazy_mmu,
329         },
330  
331         .set_fixmap = xen_set_fixmap,
332 diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
333 index 9f8658e..9892dcc 100644
334 --- a/drivers/mtd/mtdchar.c
335 +++ b/drivers/mtd/mtdchar.c
336 @@ -1064,6 +1064,33 @@ static unsigned long mtd_get_unmapped_area(struct file *file,
337  }
338  #endif
339  
340 +static inline unsigned long get_vm_size(struct vm_area_struct *vma)
341 +{
342 +       return vma->vm_end - vma->vm_start;
343 +}
344 +
345 +static inline resource_size_t get_vm_offset(struct vm_area_struct *vma)
346 +{
347 +       return (resource_size_t) vma->vm_pgoff << PAGE_SHIFT;
348 +}
349 +
350 +/*
351 + * Set a new vm offset.
352 + *
353 + * Verify that the incoming offset really works as a page offset,
354 + * and that the offset and size fit in a resource_size_t.
355 + */
356 +static inline int set_vm_offset(struct vm_area_struct *vma, resource_size_t off)
357 +{
358 +       pgoff_t pgoff = off >> PAGE_SHIFT;
359 +       if (off != (resource_size_t) pgoff << PAGE_SHIFT)
360 +               return -EINVAL;
361 +       if (off + get_vm_size(vma) - 1 < off)
362 +               return -EINVAL;
363 +       vma->vm_pgoff = pgoff;
364 +       return 0;
365 +}
366 +
367  /*
368   * set up a mapping for shared memory segments
369   */
370 @@ -1073,20 +1100,33 @@ static int mtd_mmap(struct file *file, struct vm_area_struct *vma)
371         struct mtd_file_info *mfi = file->private_data;
372         struct mtd_info *mtd = mfi->mtd;
373         struct map_info *map = mtd->priv;
374 -       unsigned long start;
375 -       unsigned long off;
376 -       u32 len;
377 -
378 -       if (mtd->type == MTD_RAM || mtd->type == MTD_ROM) {
379 -               off = vma->vm_pgoff << PAGE_SHIFT;
380 +       resource_size_t start, off;
381 +       unsigned long len, vma_len;
382 +
383 +        /* This is broken because it assumes the MTD device is map-based
384 +          and that mtd->priv is a valid struct map_info.  It should be
385 +          replaced with something that uses the mtd_get_unmapped_area()
386 +          operation properly. */
387 +       if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/) {
388 +               off = get_vm_offset(vma);
389                 start = map->phys;
390                 len = PAGE_ALIGN((start & ~PAGE_MASK) + map->size);
391                 start &= PAGE_MASK;
392 -               if ((vma->vm_end - vma->vm_start + off) > len)
393 +               vma_len = get_vm_size(vma);
394 +
395 +               /* Overflow in off+len? */
396 +               if (vma_len + off < off)
397 +                       return -EINVAL;
398 +               /* Does it fit in the mapping? */
399 +               if (vma_len + off > len)
400                         return -EINVAL;
401  
402                 off += start;
403 -               vma->vm_pgoff = off >> PAGE_SHIFT;
404 +               /* Did that overflow? */
405 +               if (off < start)
406 +                       return -EINVAL;
407 +               if (set_vm_offset(vma, off) < 0)
408 +                       return -EINVAL;
409                 vma->vm_flags |= VM_IO | VM_RESERVED;
410  
411  #ifdef pgprot_noncached
412 diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
413 index 80b230e..8350f8d 100644
414 --- a/drivers/net/r8169.c
415 +++ b/drivers/net/r8169.c
416 @@ -3105,11 +3105,34 @@ static void r810x_phy_power_up(struct rtl8169_private *tp)
417         rtl_writephy(tp, MII_BMCR, BMCR_ANENABLE);
418  }
419  
420 +static void rtl_speed_down(struct rtl8169_private *tp)
421 +{
422 +       u32 adv;
423 +       int lpa;
424 +
425 +       rtl_writephy(tp, 0x1f, 0x0000);
426 +       lpa = rtl_readphy(tp, MII_LPA);
427 +
428 +       if (lpa & (LPA_10HALF | LPA_10FULL))
429 +               adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full;
430 +       else if (lpa & (LPA_100HALF | LPA_100FULL))
431 +               adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
432 +                     ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full;
433 +       else
434 +               adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
435 +                     ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full |
436 +                     (tp->mii.supports_gmii ?
437 +                      ADVERTISED_1000baseT_Half |
438 +                      ADVERTISED_1000baseT_Full : 0);
439 +
440 +       rtl8169_set_speed(tp->dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL,
441 +                         adv);
442 +}
443 +
444  static void r810x_pll_power_down(struct rtl8169_private *tp)
445  {
446         if (__rtl8169_get_wol(tp) & WAKE_ANY) {
447 -               rtl_writephy(tp, 0x1f, 0x0000);
448 -               rtl_writephy(tp, MII_BMCR, 0x0000);
449 +               rtl_speed_down(tp);
450                 return;
451         }
452  
453 @@ -3201,8 +3224,7 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
454                 rtl_ephy_write(ioaddr, 0x19, 0xff64);
455  
456         if (__rtl8169_get_wol(tp) & WAKE_ANY) {
457 -               rtl_writephy(tp, 0x1f, 0x0000);
458 -               rtl_writephy(tp, MII_BMCR, 0x0000);
459 +               rtl_speed_down(tp);
460  
461                 if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
462                     tp->mac_version == RTL_GIGA_MAC_VER_33)
463 diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
464 index c967405..527bda4 100644
465 --- a/drivers/target/target_core_alua.c
466 +++ b/drivers/target/target_core_alua.c
467 @@ -351,6 +351,7 @@ static inline int core_alua_state_standby(
468         case REPORT_LUNS:
469         case RECEIVE_DIAGNOSTIC:
470         case SEND_DIAGNOSTIC:
471 +               return 0;
472         case MAINTENANCE_IN:
473                 switch (cdb[1]) {
474                 case MI_REPORT_TARGET_PGS:
475 @@ -393,6 +394,7 @@ static inline int core_alua_state_unavailable(
476         switch (cdb[0]) {
477         case INQUIRY:
478         case REPORT_LUNS:
479 +               return 0;
480         case MAINTENANCE_IN:
481                 switch (cdb[1]) {
482                 case MI_REPORT_TARGET_PGS:
483 @@ -433,6 +435,7 @@ static inline int core_alua_state_transition(
484         switch (cdb[0]) {
485         case INQUIRY:
486         case REPORT_LUNS:
487 +               return 0;
488         case MAINTENANCE_IN:
489                 switch (cdb[1]) {
490                 case MI_REPORT_TARGET_PGS:
491 diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
492 index 9d8af0b..1eeaf74 100644
493 --- a/kernel/sched_clock.c
494 +++ b/kernel/sched_clock.c
495 @@ -176,10 +176,36 @@ static u64 sched_clock_remote(struct sched_clock_data *scd)
496         u64 this_clock, remote_clock;
497         u64 *ptr, old_val, val;
498  
499 +#if BITS_PER_LONG != 64
500 +again:
501 +       /*
502 +        * Careful here: The local and the remote clock values need to
503 +        * be read out atomic as we need to compare the values and
504 +        * then update either the local or the remote side. So the
505 +        * cmpxchg64 below only protects one readout.
506 +        *
507 +        * We must reread via sched_clock_local() in the retry case on
508 +        * 32bit as an NMI could use sched_clock_local() via the
509 +        * tracer and hit between the readout of
510 +        * the low32bit and the high 32bit portion.
511 +        */
512 +       this_clock = sched_clock_local(my_scd);
513 +       /*
514 +        * We must enforce atomic readout on 32bit, otherwise the
515 +        * update on the remote cpu can hit inbetween the readout of
516 +        * the low32bit and the high 32bit portion.
517 +        */
518 +       remote_clock = cmpxchg64(&scd->clock, 0, 0);
519 +#else
520 +       /*
521 +        * On 64bit the read of [my]scd->clock is atomic versus the
522 +        * update, so we can avoid the above 32bit dance.
523 +        */
524         sched_clock_local(my_scd);
525  again:
526         this_clock = my_scd->clock;
527         remote_clock = scd->clock;
528 +#endif
529  
530         /*
531          * Use the opportunity that we have both locks
532 diff --git a/kernel/sys.c b/kernel/sys.c
533 index 84e353b1..1c69aa7 100644
534 --- a/kernel/sys.c
535 +++ b/kernel/sys.c
536 @@ -320,7 +320,6 @@ void kernel_restart_prepare(char *cmd)
537         system_state = SYSTEM_RESTART;
538         usermodehelper_disable();
539         device_shutdown();
540 -       syscore_shutdown();
541  }
542  
543  /**
544 @@ -335,6 +334,7 @@ void kernel_restart(char *cmd)
545  {
546         kernel_restart_prepare(cmd);
547         disable_nonboot_cpus();
548 +       syscore_shutdown();
549         if (!cmd)
550                 printk(KERN_EMERG "Restarting system.\n");
551         else
552 @@ -360,6 +360,7 @@ static void kernel_shutdown_prepare(enum system_states state)
553  void kernel_halt(void)
554  {
555         kernel_shutdown_prepare(SYSTEM_HALT);
556 +       disable_nonboot_cpus();
557         syscore_shutdown();
558         printk(KERN_EMERG "System halted.\n");
559         kmsg_dump(KMSG_DUMP_HALT);
560 diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
561 index 63ce76f..5312d96 100644
562 --- a/kernel/trace/ftrace.c
563 +++ b/kernel/trace/ftrace.c
564 @@ -566,7 +566,6 @@ int ftrace_profile_pages_init(struct ftrace_profile_stat *stat)
565                 free_page(tmp);
566         }
567  
568 -       free_page((unsigned long)stat->pages);
569         stat->pages = NULL;
570         stat->start = NULL;
571  
572 diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
573 index 43e3d76..fea5b7a 100644
574 --- a/sound/soc/codecs/wm8903.c
575 +++ b/sound/soc/codecs/wm8903.c
576 @@ -1101,6 +1101,8 @@ static const struct snd_soc_dapm_route wm8903_intercon[] = {
577         { "ROP", NULL, "Right Speaker PGA" },
578         { "RON", NULL, "Right Speaker PGA" },
579  
580 +       { "Charge Pump", NULL, "CLK_DSP" },
581 +
582         { "Left Headphone Output PGA", NULL, "Charge Pump" },
583         { "Right Headphone Output PGA", NULL, "Charge Pump" },
584         { "Left Line Output PGA", NULL, "Charge Pump" },
585 diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
586 index b4c516a..2d224f4 100644
587 --- a/sound/usb/mixer_quirks.c
588 +++ b/sound/usb/mixer_quirks.c
589 @@ -396,7 +396,7 @@ static int snd_nativeinstruments_control_get(struct snd_kcontrol *kcontrol,
590         else
591                 ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), bRequest,
592                                   USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
593 -                                 0, cpu_to_le16(wIndex),
594 +                                 0, wIndex,
595                                   &tmp, sizeof(tmp), 1000);
596         up_read(&mixer->chip->shutdown_rwsem);
597  
598 @@ -427,7 +427,7 @@ static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol,
599         else
600                 ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), bRequest,
601                                   USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
602 -                                 cpu_to_le16(wValue), cpu_to_le16(wIndex),
603 +                                 wValue, wIndex,
604                                   NULL, 0, 1000);
605         up_read(&mixer->chip->shutdown_rwsem);
606  
607 diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
608 index 090e193..eb22768 100644
609 --- a/sound/usb/quirks.c
610 +++ b/sound/usb/quirks.c
611 @@ -455,7 +455,7 @@ static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev)
612  {
613         int ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
614                                   0xaf, USB_TYPE_VENDOR | USB_RECIP_DEVICE,
615 -                                 cpu_to_le16(1), 0, NULL, 0, 1000);
616 +                                 1, 0, NULL, 0, 1000);
617  
618         if (ret < 0)
619                 return ret;