/[linux-patches]/genpatches-2.6/tags/3.0-30/1028_linux-3.0.29.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1028_linux-3.0.29.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (22 months, 2 weeks ago) by mpagano
File size: 67246 byte(s)
3.0-30 release
1 diff --git a/Makefile b/Makefile
2 index b18b2b4..3b57cac 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 0
8 -SUBLEVEL = 28
9 +SUBLEVEL = 29
10 EXTRAVERSION =
11 NAME = Sneaky Weasel
12
13 diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
14 index 7e47888..21cd298 100644
15 --- a/arch/arm/mm/proc-v7.S
16 +++ b/arch/arm/mm/proc-v7.S
17 @@ -372,6 +372,18 @@ __v7_setup:
18 mcr p15, 0, r5, c10, c2, 0 @ write PRRR
19 mcr p15, 0, r6, c10, c2, 1 @ write NMRR
20 #endif
21 +#ifndef CONFIG_ARM_THUMBEE
22 + mrc p15, 0, r0, c0, c1, 0 @ read ID_PFR0 for ThumbEE
23 + and r0, r0, #(0xf << 12) @ ThumbEE enabled field
24 + teq r0, #(1 << 12) @ check if ThumbEE is present
25 + bne 1f
26 + mov r5, #0
27 + mcr p14, 6, r5, c1, c0, 0 @ Initialize TEEHBR to 0
28 + mrc p14, 6, r0, c0, c0, 0 @ load TEECR
29 + orr r0, r0, #1 @ set the 1st bit in order to
30 + mcr p14, 6, r0, c0, c0, 0 @ stop userspace TEEHBR access
31 +1:
32 +#endif
33 adr r5, v7_crval
34 ldmia r5, {r5, r6}
35 #ifdef CONFIG_CPU_ENDIAN_BE8
36 diff --git a/arch/ia64/include/asm/futex.h b/arch/ia64/include/asm/futex.h
37 index 8428525..21ab376 100644
38 --- a/arch/ia64/include/asm/futex.h
39 +++ b/arch/ia64/include/asm/futex.h
40 @@ -107,15 +107,16 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
41 return -EFAULT;
42
43 {
44 - register unsigned long r8 __asm ("r8") = 0;
45 + register unsigned long r8 __asm ("r8");
46 unsigned long prev;
47 __asm__ __volatile__(
48 " mf;; \n"
49 - " mov ar.ccv=%3;; \n"
50 - "[1:] cmpxchg4.acq %0=[%1],%2,ar.ccv \n"
51 + " mov %0=r0 \n"
52 + " mov ar.ccv=%4;; \n"
53 + "[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n"
54 " .xdata4 \"__ex_table\", 1b-., 2f-. \n"
55 "[2:]"
56 - : "=r" (prev)
57 + : "=r" (r8), "=r" (prev)
58 : "r" (uaddr), "r" (newval),
59 "rO" ((long) (unsigned) oldval)
60 : "memory");
61 diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
62 index 9b922b1..c395f71 100644
63 --- a/arch/s390/Kconfig
64 +++ b/arch/s390/Kconfig
65 @@ -89,7 +89,6 @@ config S390
66 select HAVE_GET_USER_PAGES_FAST
67 select HAVE_ARCH_MUTEX_CPU_RELAX
68 select HAVE_ARCH_JUMP_LABEL if !MARCH_G5
69 - select HAVE_RCU_TABLE_FREE if SMP
70 select ARCH_INLINE_SPIN_TRYLOCK
71 select ARCH_INLINE_SPIN_TRYLOCK_BH
72 select ARCH_INLINE_SPIN_LOCK
73 diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h
74 index 38e71eb..e4b6609 100644
75 --- a/arch/s390/include/asm/pgalloc.h
76 +++ b/arch/s390/include/asm/pgalloc.h
77 @@ -22,10 +22,7 @@ void crst_table_free(struct mm_struct *, unsigned long *);
78
79 unsigned long *page_table_alloc(struct mm_struct *);
80 void page_table_free(struct mm_struct *, unsigned long *);
81 -#ifdef CONFIG_HAVE_RCU_TABLE_FREE
82 void page_table_free_rcu(struct mmu_gather *, unsigned long *);
83 -void __tlb_remove_table(void *_table);
84 -#endif
85
86 static inline void clear_table(unsigned long *s, unsigned long val, size_t n)
87 {
88 diff --git a/arch/s390/include/asm/tlb.h b/arch/s390/include/asm/tlb.h
89 index c687a2c..775a5ee 100644
90 --- a/arch/s390/include/asm/tlb.h
91 +++ b/arch/s390/include/asm/tlb.h
92 @@ -30,14 +30,10 @@
93
94 struct mmu_gather {
95 struct mm_struct *mm;
96 -#ifdef CONFIG_HAVE_RCU_TABLE_FREE
97 struct mmu_table_batch *batch;
98 -#endif
99 unsigned int fullmm;
100 - unsigned int need_flush;
101 };
102
103 -#ifdef CONFIG_HAVE_RCU_TABLE_FREE
104 struct mmu_table_batch {
105 struct rcu_head rcu;
106 unsigned int nr;
107 @@ -49,7 +45,6 @@ struct mmu_table_batch {
108
109 extern void tlb_table_flush(struct mmu_gather *tlb);
110 extern void tlb_remove_table(struct mmu_gather *tlb, void *table);
111 -#endif
112
113 static inline void tlb_gather_mmu(struct mmu_gather *tlb,
114 struct mm_struct *mm,
115 @@ -57,29 +52,20 @@ static inline void tlb_gather_mmu(struct mmu_gather *tlb,
116 {
117 tlb->mm = mm;
118 tlb->fullmm = full_mm_flush;
119 - tlb->need_flush = 0;
120 -#ifdef CONFIG_HAVE_RCU_TABLE_FREE
121 tlb->batch = NULL;
122 -#endif
123 if (tlb->fullmm)
124 __tlb_flush_mm(mm);
125 }
126
127 static inline void tlb_flush_mmu(struct mmu_gather *tlb)
128 {
129 - if (!tlb->need_flush)
130 - return;
131 - tlb->need_flush = 0;
132 - __tlb_flush_mm(tlb->mm);
133 -#ifdef CONFIG_HAVE_RCU_TABLE_FREE
134 tlb_table_flush(tlb);
135 -#endif
136 }
137
138 static inline void tlb_finish_mmu(struct mmu_gather *tlb,
139 unsigned long start, unsigned long end)
140 {
141 - tlb_flush_mmu(tlb);
142 + tlb_table_flush(tlb);
143 }
144
145 /*
146 @@ -105,10 +91,8 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
147 static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
148 unsigned long address)
149 {
150 -#ifdef CONFIG_HAVE_RCU_TABLE_FREE
151 if (!tlb->fullmm)
152 return page_table_free_rcu(tlb, (unsigned long *) pte);
153 -#endif
154 page_table_free(tlb->mm, (unsigned long *) pte);
155 }
156
157 @@ -125,10 +109,8 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
158 #ifdef __s390x__
159 if (tlb->mm->context.asce_limit <= (1UL << 31))
160 return;
161 -#ifdef CONFIG_HAVE_RCU_TABLE_FREE
162 if (!tlb->fullmm)
163 return tlb_remove_table(tlb, pmd);
164 -#endif
165 crst_table_free(tlb->mm, (unsigned long *) pmd);
166 #endif
167 }
168 @@ -146,10 +128,8 @@ static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
169 #ifdef __s390x__
170 if (tlb->mm->context.asce_limit <= (1UL << 42))
171 return;
172 -#ifdef CONFIG_HAVE_RCU_TABLE_FREE
173 if (!tlb->fullmm)
174 return tlb_remove_table(tlb, pud);
175 -#endif
176 crst_table_free(tlb->mm, (unsigned long *) pud);
177 #endif
178 }
179 diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
180 index 458893f..51b80b9 100644
181 --- a/arch/s390/mm/pgtable.c
182 +++ b/arch/s390/mm/pgtable.c
183 @@ -243,8 +243,6 @@ void page_table_free(struct mm_struct *mm, unsigned long *table)
184 }
185 }
186
187 -#ifdef CONFIG_HAVE_RCU_TABLE_FREE
188 -
189 static void __page_table_free_rcu(void *table, unsigned bit)
190 {
191 struct page *page;
192 @@ -301,7 +299,66 @@ void __tlb_remove_table(void *_table)
193 free_pages((unsigned long) table, ALLOC_ORDER);
194 }
195
196 -#endif
197 +static void tlb_remove_table_smp_sync(void *arg)
198 +{
199 + /* Simply deliver the interrupt */
200 +}
201 +
202 +static void tlb_remove_table_one(void *table)
203 +{
204 + /*
205 + * This isn't an RCU grace period and hence the page-tables cannot be
206 + * assumed to be actually RCU-freed.
207 + *
208 + * It is however sufficient for software page-table walkers that rely
209 + * on IRQ disabling. See the comment near struct mmu_table_batch.
210 + */
211 + smp_call_function(tlb_remove_table_smp_sync, NULL, 1);
212 + __tlb_remove_table(table);
213 +}
214 +
215 +static void tlb_remove_table_rcu(struct rcu_head *head)
216 +{
217 + struct mmu_table_batch *batch;
218 + int i;
219 +
220 + batch = container_of(head, struct mmu_table_batch, rcu);
221 +
222 + for (i = 0; i < batch->nr; i++)
223 + __tlb_remove_table(batch->tables[i]);
224 +
225 + free_page((unsigned long)batch);
226 +}
227 +
228 +void tlb_table_flush(struct mmu_gather *tlb)
229 +{
230 + struct mmu_table_batch **batch = &tlb->batch;
231 +
232 + if (*batch) {
233 + __tlb_flush_mm(tlb->mm);
234 + call_rcu_sched(&(*batch)->rcu, tlb_remove_table_rcu);
235 + *batch = NULL;
236 + }
237 +}
238 +
239 +void tlb_remove_table(struct mmu_gather *tlb, void *table)
240 +{
241 + struct mmu_table_batch **batch = &tlb->batch;
242 +
243 + if (*batch == NULL) {
244 + *batch = (struct mmu_table_batch *)
245 + __get_free_page(GFP_NOWAIT | __GFP_NOWARN);
246 + if (*batch == NULL) {
247 + __tlb_flush_mm(tlb->mm);
248 + tlb_remove_table_one(table);
249 + return;
250 + }
251 + (*batch)->nr = 0;
252 + }
253 + (*batch)->tables[(*batch)->nr++] = table;
254 + if ((*batch)->nr == MAX_TABLE_BATCH)
255 + tlb_table_flush(tlb);
256 +}
257
258 /*
259 * switch on pgstes for its userspace process (for kvm)
260 diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c
261 index 7429b47..dcae702 100644
262 --- a/arch/sparc/kernel/ds.c
263 +++ b/arch/sparc/kernel/ds.c
264 @@ -1269,4 +1269,4 @@ static int __init ds_init(void)
265 return vio_register_driver(&ds_driver);
266 }
267
268 -subsys_initcall(ds_init);
269 +fs_initcall(ds_init);
270 diff --git a/arch/sparc/kernel/rtrap_64.S b/arch/sparc/kernel/rtrap_64.S
271 index 77f1b95..9171fc2 100644
272 --- a/arch/sparc/kernel/rtrap_64.S
273 +++ b/arch/sparc/kernel/rtrap_64.S
274 @@ -20,11 +20,6 @@
275
276 .text
277 .align 32
278 -__handle_softirq:
279 - call do_softirq
280 - nop
281 - ba,a,pt %xcc, __handle_softirq_continue
282 - nop
283 __handle_preemption:
284 call schedule
285 wrpr %g0, RTRAP_PSTATE, %pstate
286 @@ -89,9 +84,7 @@ rtrap:
287 cmp %l1, 0
288
289 /* mm/ultra.S:xcall_report_regs KNOWS about this load. */
290 - bne,pn %icc, __handle_softirq
291 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1
292 -__handle_softirq_continue:
293 rtrap_xcall:
294 sethi %hi(0xf << 20), %l4
295 and %l1, %l4, %l4
296 diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h
297 index 1055769..6d276c2 100644
298 --- a/drivers/acpi/acpica/acobject.h
299 +++ b/drivers/acpi/acpica/acobject.h
300 @@ -358,6 +358,7 @@ typedef enum {
301 */
302 struct acpi_object_extra {
303 ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */
304 + struct acpi_namespace_node *scope_node;
305 void *region_context; /* Region-specific data */
306 u8 *aml_start;
307 u32 aml_length;
308 diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c
309 index 42163d8..d69e4a5 100644
310 --- a/drivers/acpi/acpica/dsargs.c
311 +++ b/drivers/acpi/acpica/dsargs.c
312 @@ -384,7 +384,7 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc)
313
314 /* Execute the argument AML */
315
316 - status = acpi_ds_execute_arguments(node, node->parent,
317 + status = acpi_ds_execute_arguments(node, extra_desc->extra.scope_node,
318 extra_desc->extra.aml_length,
319 extra_desc->extra.aml_start);
320 if (ACPI_FAILURE(status)) {
321 diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c
322 index 110711a..8a06dc5 100644
323 --- a/drivers/acpi/acpica/excreate.c
324 +++ b/drivers/acpi/acpica/excreate.c
325 @@ -330,6 +330,12 @@ acpi_ex_create_region(u8 * aml_start,
326 region_obj2 = obj_desc->common.next_object;
327 region_obj2->extra.aml_start = aml_start;
328 region_obj2->extra.aml_length = aml_length;
329 + if (walk_state->scope_info) {
330 + region_obj2->extra.scope_node =
331 + walk_state->scope_info->scope.node;
332 + } else {
333 + region_obj2->extra.scope_node = node;
334 + }
335
336 /* Init the region from the operands */
337
338 diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
339 index 6961002..a552cab 100644
340 --- a/drivers/block/cciss_scsi.c
341 +++ b/drivers/block/cciss_scsi.c
342 @@ -866,6 +866,7 @@ cciss_scsi_detect(ctlr_info_t *h)
343 sh->can_queue = cciss_tape_cmds;
344 sh->sg_tablesize = h->maxsgentries;
345 sh->max_cmd_len = MAX_COMMAND_SIZE;
346 + sh->max_sectors = h->cciss_max_sectors;
347
348 ((struct cciss_scsi_adapter_data_t *)
349 h->scsi_ctlr)->scsi_host = sh;
350 @@ -1410,7 +1411,7 @@ static void cciss_scatter_gather(ctlr_info_t *h, CommandList_struct *c,
351 /* track how many SG entries we are using */
352 if (request_nsgs > h->maxSG)
353 h->maxSG = request_nsgs;
354 - c->Header.SGTotal = (__u8) request_nsgs + chained;
355 + c->Header.SGTotal = (u16) request_nsgs + chained;
356 if (request_nsgs > h->max_cmd_sgentries)
357 c->Header.SGList = h->max_cmd_sgentries;
358 else
359 diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
360 index 5c2a722..c08e874 100644
361 --- a/drivers/bluetooth/ath3k.c
362 +++ b/drivers/bluetooth/ath3k.c
363 @@ -71,6 +71,8 @@ static struct usb_device_id ath3k_table[] = {
364
365 /* Atheros AR3012 with sflash firmware*/
366 { USB_DEVICE(0x0CF3, 0x3004) },
367 + { USB_DEVICE(0x0CF3, 0x311D) },
368 + { USB_DEVICE(0x13d3, 0x3375) },
369
370 /* Atheros AR5BBU12 with sflash firmware */
371 { USB_DEVICE(0x0489, 0xE02C) },
372 @@ -87,6 +89,8 @@ static struct usb_device_id ath3k_blist_tbl[] = {
373
374 /* Atheros AR3012 with sflash firmware*/
375 { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
376 + { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
377 + { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
378
379 { } /* Terminating entry */
380 };
381 diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
382 index 9f3a8b3..72172a7 100644
383 --- a/drivers/bluetooth/btusb.c
384 +++ b/drivers/bluetooth/btusb.c
385 @@ -123,6 +123,8 @@ static struct usb_device_id blacklist_table[] = {
386
387 /* Atheros 3012 with sflash firmware */
388 { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
389 + { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
390 + { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
391
392 /* Atheros AR5BBU12 with sflash firmware */
393 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
394 diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
395 index 48ad2a7..8f3d6db 100644
396 --- a/drivers/bluetooth/hci_ldisc.c
397 +++ b/drivers/bluetooth/hci_ldisc.c
398 @@ -237,7 +237,6 @@ static void hci_uart_destruct(struct hci_dev *hdev)
399 return;
400
401 BT_DBG("%s", hdev->name);
402 - kfree(hdev->driver_data);
403 }
404
405 /* ------ LDISC part ------ */
406 @@ -310,12 +309,13 @@ static void hci_uart_tty_close(struct tty_struct *tty)
407 hci_uart_close(hdev);
408
409 if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
410 - hu->proto->close(hu);
411 if (hdev) {
412 hci_unregister_dev(hdev);
413 hci_free_dev(hdev);
414 }
415 + hu->proto->close(hu);
416 }
417 + kfree(hu);
418 }
419 }
420
421 diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
422 index 25cf327..6a718b7 100644
423 --- a/drivers/dma/Kconfig
424 +++ b/drivers/dma/Kconfig
425 @@ -200,18 +200,17 @@ config PL330_DMA
426 platform_data for a dma-pl330 device.
427
428 config PCH_DMA
429 - tristate "Intel EG20T PCH / OKI Semi IOH(ML7213/ML7223) DMA support"
430 + tristate "Intel EG20T PCH / OKI Semi IOH(ML7213/ML7223/ML7831) DMA support"
431 depends on PCI && X86
432 select DMA_ENGINE
433 help
434 Enable support for Intel EG20T PCH DMA engine.
435 -
436 This driver also can be used for OKI SEMICONDUCTOR IOH(Input/
437 - Output Hub), ML7213 and ML7223.
438 - ML7213 IOH is for IVI(In-Vehicle Infotainment) use and ML7223 IOH is
439 - for MP(Media Phone) use.
440 - ML7213/ML7223 is companion chip for Intel Atom E6xx series.
441 - ML7213/ML7223 is completely compatible for Intel EG20T PCH.
442 + Output Hub), ML7213, ML7223 and ML7831.
443 + ML7213 IOH is for IVI(In-Vehicle Infotainment) use, ML7223 IOH is
444 + for MP(Media Phone) use and ML7831 IOH is for general purpose use.
445 + ML7213/ML7223/ML7831 is companion chip for Intel Atom E6xx series.
446 + ML7213/ML7223/ML7831 is completely compatible for Intel EG20T PCH.
447
448 config IMX_SDMA
449 tristate "i.MX SDMA support"
450 diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c
451 index ff5b38f..1ed89d0 100644
452 --- a/drivers/dma/pch_dma.c
453 +++ b/drivers/dma/pch_dma.c
454 @@ -45,7 +45,8 @@
455 #define DMA_STATUS_MASK_BITS 0x3
456 #define DMA_STATUS_SHIFT_BITS 16
457 #define DMA_STATUS_IRQ(x) (0x1 << (x))
458 -#define DMA_STATUS_ERR(x) (0x1 << ((x) + 8))
459 +#define DMA_STATUS0_ERR(x) (0x1 << ((x) + 8))
460 +#define DMA_STATUS2_ERR(x) (0x1 << (x))
461
462 #define DMA_DESC_WIDTH_SHIFT_BITS 12
463 #define DMA_DESC_WIDTH_1_BYTE (0x3 << DMA_DESC_WIDTH_SHIFT_BITS)
464 @@ -59,7 +60,10 @@
465 #define DMA_DESC_FOLLOW_WITHOUT_IRQ 0x2
466 #define DMA_DESC_FOLLOW_WITH_IRQ 0x3
467
468 -#define MAX_CHAN_NR 8
469 +#define MAX_CHAN_NR 12
470 +
471 +#define DMA_MASK_CTL0_MODE 0x33333333
472 +#define DMA_MASK_CTL2_MODE 0x00003333
473
474 static unsigned int init_nr_desc_per_channel = 64;
475 module_param(init_nr_desc_per_channel, uint, 0644);
476 @@ -133,6 +137,7 @@ struct pch_dma {
477 #define PCH_DMA_CTL3 0x0C
478 #define PCH_DMA_STS0 0x10
479 #define PCH_DMA_STS1 0x14
480 +#define PCH_DMA_STS2 0x18
481
482 #define dma_readl(pd, name) \
483 readl((pd)->membase + PCH_DMA_##name)
484 @@ -183,13 +188,19 @@ static void pdc_enable_irq(struct dma_chan *chan, int enable)
485 {
486 struct pch_dma *pd = to_pd(chan->device);
487 u32 val;
488 + int pos;
489 +
490 + if (chan->chan_id < 8)
491 + pos = chan->chan_id;
492 + else
493 + pos = chan->chan_id + 8;
494
495 val = dma_readl(pd, CTL2);
496
497 if (enable)
498 - val |= 0x1 << chan->chan_id;
499 + val |= 0x1 << pos;
500 else
501 - val &= ~(0x1 << chan->chan_id);
502 + val &= ~(0x1 << pos);
503
504 dma_writel(pd, CTL2, val);
505
506 @@ -202,10 +213,17 @@ static void pdc_set_dir(struct dma_chan *chan)
507 struct pch_dma_chan *pd_chan = to_pd_chan(chan);
508 struct pch_dma *pd = to_pd(chan->device);
509 u32 val;
510 + u32 mask_mode;
511 + u32 mask_ctl;
512
513 if (chan->chan_id < 8) {
514 val = dma_readl(pd, CTL0);
515
516 + mask_mode = DMA_CTL0_MODE_MASK_BITS <<
517 + (DMA_CTL0_BITS_PER_CH * chan->chan_id);
518 + mask_ctl = DMA_MASK_CTL0_MODE & ~(DMA_CTL0_MODE_MASK_BITS <<
519 + (DMA_CTL0_BITS_PER_CH * chan->chan_id));
520 + val &= mask_mode;
521 if (pd_chan->dir == DMA_TO_DEVICE)
522 val |= 0x1 << (DMA_CTL0_BITS_PER_CH * chan->chan_id +
523 DMA_CTL0_DIR_SHIFT_BITS);
524 @@ -213,18 +231,24 @@ static void pdc_set_dir(struct dma_chan *chan)
525 val &= ~(0x1 << (DMA_CTL0_BITS_PER_CH * chan->chan_id +
526 DMA_CTL0_DIR_SHIFT_BITS));
527
528 + val |= mask_ctl;
529 dma_writel(pd, CTL0, val);
530 } else {
531 int ch = chan->chan_id - 8; /* ch8-->0 ch9-->1 ... ch11->3 */
532 val = dma_readl(pd, CTL3);
533
534 + mask_mode = DMA_CTL0_MODE_MASK_BITS <<
535 + (DMA_CTL0_BITS_PER_CH * ch);
536 + mask_ctl = DMA_MASK_CTL2_MODE & ~(DMA_CTL0_MODE_MASK_BITS <<
537 + (DMA_CTL0_BITS_PER_CH * ch));
538 + val &= mask_mode;
539 if (pd_chan->dir == DMA_TO_DEVICE)
540 val |= 0x1 << (DMA_CTL0_BITS_PER_CH * ch +
541 DMA_CTL0_DIR_SHIFT_BITS);
542 else
543 val &= ~(0x1 << (DMA_CTL0_BITS_PER_CH * ch +
544 DMA_CTL0_DIR_SHIFT_BITS));
545 -
546 + val |= mask_ctl;
547 dma_writel(pd, CTL3, val);
548 }
549
550 @@ -236,33 +260,37 @@ static void pdc_set_mode(struct dma_chan *chan, u32 mode)
551 {
552 struct pch_dma *pd = to_pd(chan->device);
553 u32 val;
554 + u32 mask_ctl;
555 + u32 mask_dir;
556
557 if (chan->chan_id < 8) {
558 + mask_ctl = DMA_MASK_CTL0_MODE & ~(DMA_CTL0_MODE_MASK_BITS <<
559 + (DMA_CTL0_BITS_PER_CH * chan->chan_id));
560 + mask_dir = 1 << (DMA_CTL0_BITS_PER_CH * chan->chan_id +\
561 + DMA_CTL0_DIR_SHIFT_BITS);
562 val = dma_readl(pd, CTL0);
563 -
564 - val &= ~(DMA_CTL0_MODE_MASK_BITS <<
565 - (DMA_CTL0_BITS_PER_CH * chan->chan_id));
566 + val &= mask_dir;
567 val |= mode << (DMA_CTL0_BITS_PER_CH * chan->chan_id);
568 -
569 + val |= mask_ctl;
570 dma_writel(pd, CTL0, val);
571 } else {
572 int ch = chan->chan_id - 8; /* ch8-->0 ch9-->1 ... ch11->3 */
573 -
574 + mask_ctl = DMA_MASK_CTL2_MODE & ~(DMA_CTL0_MODE_MASK_BITS <<
575 + (DMA_CTL0_BITS_PER_CH * ch));
576 + mask_dir = 1 << (DMA_CTL0_BITS_PER_CH * ch +\
577 + DMA_CTL0_DIR_SHIFT_BITS);
578 val = dma_readl(pd, CTL3);
579 -
580 - val &= ~(DMA_CTL0_MODE_MASK_BITS <<
581 - (DMA_CTL0_BITS_PER_CH * ch));
582 + val &= mask_dir;
583 val |= mode << (DMA_CTL0_BITS_PER_CH * ch);
584 -
585 + val |= mask_ctl;
586 dma_writel(pd, CTL3, val);
587 -
588 }
589
590 dev_dbg(chan2dev(chan), "pdc_set_mode: chan %d -> %x\n",
591 chan->chan_id, val);
592 }
593
594 -static u32 pdc_get_status(struct pch_dma_chan *pd_chan)
595 +static u32 pdc_get_status0(struct pch_dma_chan *pd_chan)
596 {
597 struct pch_dma *pd = to_pd(pd_chan->chan.device);
598 u32 val;
599 @@ -272,9 +300,27 @@ static u32 pdc_get_status(struct pch_dma_chan *pd_chan)
600 DMA_STATUS_BITS_PER_CH * pd_chan->chan.chan_id));
601 }
602
603 +static u32 pdc_get_status2(struct pch_dma_chan *pd_chan)
604 +{
605 + struct pch_dma *pd = to_pd(pd_chan->chan.device);
606 + u32 val;
607 +
608 + val = dma_readl(pd, STS2);
609 + return DMA_STATUS_MASK_BITS & (val >> (DMA_STATUS_SHIFT_BITS +
610 + DMA_STATUS_BITS_PER_CH * (pd_chan->chan.chan_id - 8)));
611 +}
612 +
613 static bool pdc_is_idle(struct pch_dma_chan *pd_chan)
614 {
615 - if (pdc_get_status(pd_chan) == DMA_STATUS_IDLE)
616 + u32 sts;
617 +
618 + if (pd_chan->chan.chan_id < 8)
619 + sts = pdc_get_status0(pd_chan);
620 + else
621 + sts = pdc_get_status2(pd_chan);
622 +
623 +
624 + if (sts == DMA_STATUS_IDLE)
625 return true;
626 else
627 return false;
628 @@ -495,11 +541,11 @@ static int pd_alloc_chan_resources(struct dma_chan *chan)
629 list_add_tail(&desc->desc_node, &tmp_list);
630 }
631
632 - spin_lock_bh(&pd_chan->lock);
633 + spin_lock_irq(&pd_chan->lock);
634 list_splice(&tmp_list, &pd_chan->free_list);
635 pd_chan->descs_allocated = i;
636 pd_chan->completed_cookie = chan->cookie = 1;
637 - spin_unlock_bh(&pd_chan->lock);
638 + spin_unlock_irq(&pd_chan->lock);
639
640 pdc_enable_irq(chan, 1);
641
642 @@ -517,10 +563,10 @@ static void pd_free_chan_resources(struct dma_chan *chan)
643 BUG_ON(!list_empty(&pd_chan->active_list));
644 BUG_ON(!list_empty(&pd_chan->queue));
645
646 - spin_lock_bh(&pd_chan->lock);
647 + spin_lock_irq(&pd_chan->lock);
648 list_splice_init(&pd_chan->free_list, &tmp_list);
649 pd_chan->descs_allocated = 0;
650 - spin_unlock_bh(&pd_chan->lock);
651 + spin_unlock_irq(&pd_chan->lock);
652
653 list_for_each_entry_safe(desc, _d, &tmp_list, desc_node)
654 pci_pool_free(pd->pool, desc, desc->txd.phys);
655 @@ -536,10 +582,10 @@ static enum dma_status pd_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
656 dma_cookie_t last_completed;
657 int ret;
658
659 - spin_lock_bh(&pd_chan->lock);
660 + spin_lock_irq(&pd_chan->lock);
661 last_completed = pd_chan->completed_cookie;
662 last_used = chan->cookie;
663 - spin_unlock_bh(&pd_chan->lock);
664 + spin_unlock_irq(&pd_chan->lock);
665
666 ret = dma_async_is_complete(cookie, last_completed, last_used);
667
668 @@ -654,7 +700,7 @@ static int pd_device_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
669 if (cmd != DMA_TERMINATE_ALL)
670 return -ENXIO;
671
672 - spin_lock_bh(&pd_chan->lock);
673 + spin_lock_irq(&pd_chan->lock);
674
675 pdc_set_mode(&pd_chan->chan, DMA_CTL0_DISABLE);
676
677 @@ -664,7 +710,7 @@ static int pd_device_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
678 list_for_each_entry_safe(desc, _d, &list, desc_node)
679 pdc_chain_complete(pd_chan, desc);
680
681 - spin_unlock_bh(&pd_chan->lock);
682 + spin_unlock_irq(&pd_chan->lock);
683
684 return 0;
685 }
686 @@ -693,30 +739,45 @@ static irqreturn_t pd_irq(int irq, void *devid)
687 struct pch_dma *pd = (struct pch_dma *)devid;
688 struct pch_dma_chan *pd_chan;
689 u32 sts0;
690 + u32 sts2;
691 int i;
692 - int ret = IRQ_NONE;
693 + int ret0 = IRQ_NONE;
694 + int ret2 = IRQ_NONE;
695
696 sts0 = dma_readl(pd, STS0);
697 + sts2 = dma_readl(pd, STS2);
698
699 dev_dbg(pd->dma.dev, "pd_irq sts0: %x\n", sts0);
700
701 for (i = 0; i < pd->dma.chancnt; i++) {
702 pd_chan = &pd->channels[i];
703
704 - if (sts0 & DMA_STATUS_IRQ(i)) {
705 - if (sts0 & DMA_STATUS_ERR(i))
706 - set_bit(0, &pd_chan->err_status);
707 + if (i < 8) {
708 + if (sts0 & DMA_STATUS_IRQ(i)) {
709 + if (sts0 & DMA_STATUS0_ERR(i))
710 + set_bit(0, &pd_chan->err_status);
711
712 - tasklet_schedule(&pd_chan->tasklet);
713 - ret = IRQ_HANDLED;
714 - }
715 + tasklet_schedule(&pd_chan->tasklet);
716 + ret0 = IRQ_HANDLED;
717 + }
718 + } else {
719 + if (sts2 & DMA_STATUS_IRQ(i - 8)) {
720 + if (sts2 & DMA_STATUS2_ERR(i))
721 + set_bit(0, &pd_chan->err_status);
722
723 + tasklet_schedule(&pd_chan->tasklet);
724 + ret2 = IRQ_HANDLED;
725 + }
726 + }
727 }
728
729 /* clear interrupt bits in status register */
730 - dma_writel(pd, STS0, sts0);
731 + if (ret0)
732 + dma_writel(pd, STS0, sts0);
733 + if (ret2)
734 + dma_writel(pd, STS2, sts2);
735
736 - return ret;
737 + return ret0 | ret2;
738 }
739
740 #ifdef CONFIG_PM
741 @@ -960,6 +1021,8 @@ static void __devexit pch_dma_remove(struct pci_dev *pdev)
742 #define PCI_DEVICE_ID_ML7223_DMA2_4CH 0x800E
743 #define PCI_DEVICE_ID_ML7223_DMA3_4CH 0x8017
744 #define PCI_DEVICE_ID_ML7223_DMA4_4CH 0x803B
745 +#define PCI_DEVICE_ID_ML7831_DMA1_8CH 0x8810
746 +#define PCI_DEVICE_ID_ML7831_DMA2_4CH 0x8815
747
748 DEFINE_PCI_DEVICE_TABLE(pch_dma_id_table) = {
749 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_8CH), 8 },
750 @@ -972,6 +1035,8 @@ DEFINE_PCI_DEVICE_TABLE(pch_dma_id_table) = {
751 { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA2_4CH), 4}, /* Video SPI */
752 { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA3_4CH), 4}, /* Security */
753 { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA4_4CH), 4}, /* FPGA */
754 + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA1_8CH), 8}, /* UART */
755 + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA2_4CH), 4}, /* SPI */
756 { 0, },
757 };
758
759 @@ -999,7 +1064,7 @@ static void __exit pch_dma_exit(void)
760 module_init(pch_dma_init);
761 module_exit(pch_dma_exit);
762
763 -MODULE_DESCRIPTION("Intel EG20T PCH / OKI SEMICONDUCTOR ML7213 IOH "
764 - "DMA controller driver");
765 +MODULE_DESCRIPTION("Intel EG20T PCH / OKI SEMICON ML7213/ML7223/ML7831 IOH"
766 + "DMA controller driver");
767 MODULE_AUTHOR("Yong Wang <yong.y.wang@intel.com>");
768 MODULE_LICENSE("GPL v2");
769 diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
770 index 1f61fc7..2d6039b 100644
771 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
772 +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
773 @@ -863,7 +863,7 @@ int intel_init_ring_buffer(struct drm_device *dev,
774 * of the buffer.
775 */
776 ring->effective_size = ring->size;
777 - if (IS_I830(ring->dev))
778 + if (IS_I830(ring->dev) || IS_845G(ring->dev))
779 ring->effective_size -= 128;
780
781 return 0;
782 diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
783 index 6ceb3c8..1f6a0f5 100644
784 --- a/drivers/gpu/drm/radeon/radeon_connectors.c
785 +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
786 @@ -990,7 +990,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
787
788 encoder = obj_to_encoder(obj);
789
790 - if (encoder->encoder_type != DRM_MODE_ENCODER_DAC ||
791 + if (encoder->encoder_type != DRM_MODE_ENCODER_DAC &&
792 encoder->encoder_type != DRM_MODE_ENCODER_TVDAC)
793 continue;
794
795 @@ -1020,6 +1020,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
796 * cases the DVI port is actually a virtual KVM port connected to the service
797 * processor.
798 */
799 +out:
800 if ((!rdev->is_atom_bios) &&
801 (ret == connector_status_disconnected) &&
802 rdev->mode_info.bios_hardcoded_edid_size) {
803 @@ -1027,7 +1028,6 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
804 ret = connector_status_connected;
805 }
806
807 -out:
808 /* updated in get modes as well since we need to know if it's analog or digital */
809 radeon_connector_update_scratch_regs(connector, ret);
810 return ret;
811 diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c
812 index 6c111c1..c90425c 100644
813 --- a/drivers/gpu/drm/radeon/radeon_i2c.c
814 +++ b/drivers/gpu/drm/radeon/radeon_i2c.c
815 @@ -898,6 +898,10 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev,
816 struct radeon_i2c_chan *i2c;
817 int ret;
818
819 + /* don't add the mm_i2c bus unless hw_i2c is enabled */
820 + if (rec->mm_i2c && (radeon_hw_i2c == 0))
821 + return NULL;
822 +
823 i2c = kzalloc(sizeof(struct radeon_i2c_chan), GFP_KERNEL);
824 if (i2c == NULL)
825 return NULL;
826 diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c
827 index 5feb6e9..eb6fe79 100644
828 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
829 +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
830 @@ -143,6 +143,12 @@ static bool radeon_msi_ok(struct radeon_device *rdev)
831 (rdev->pdev->subsystem_device == 0x01fd))
832 return true;
833
834 + /* RV515 seems to have MSI issues where it loses
835 + * MSI rearms occasionally. This leads to lockups and freezes.
836 + * disable it by default.
837 + */
838 + if (rdev->family == CHIP_RV515)
839 + return false;
840 if (rdev->flags & RADEON_IS_IGP) {
841 /* APUs work fine with MSIs */
842 if (rdev->family >= CHIP_PALM)
843 diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
844 index 703a3fa..2eba9a1 100644
845 --- a/drivers/md/bitmap.c
846 +++ b/drivers/md/bitmap.c
847 @@ -1897,7 +1897,9 @@ int bitmap_load(mddev_t *mddev)
848 * re-add of a missing device */
849 start = mddev->recovery_cp;
850
851 + mutex_lock(&mddev->bitmap_info.mutex);
852 err = bitmap_init_from_disk(bitmap, start);
853 + mutex_unlock(&mddev->bitmap_info.mutex);
854 }
855 if (err)
856 goto out;
857 diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
858 index 97e1a1f..f51c81e 100644
859 --- a/drivers/misc/pch_phub.c
860 +++ b/drivers/misc/pch_phub.c
861 @@ -93,6 +93,7 @@
862 #define PCH_PHUB_INTPIN_REG_WPERMIT_REG3 0x002C
863 #define PCH_PHUB_INT_REDUCE_CONTROL_REG_BASE 0x0040
864 #define CLKCFG_REG_OFFSET 0x500
865 +#define FUNCSEL_REG_OFFSET 0x508
866
867 #define PCH_PHUB_OROM_SIZE 15360
868
869 @@ -111,11 +112,13 @@
870 * @intpin_reg_wpermit_reg3: INTPIN_REG_WPERMIT register 3 val
871 * @int_reduce_control_reg: INT_REDUCE_CONTROL registers val
872 * @clkcfg_reg: CLK CFG register val
873 + * @funcsel_reg: Function select register value
874 * @pch_phub_base_address: Register base address
875 * @pch_phub_extrom_base_address: external rom base address
876 * @pch_mac_start_address: MAC address area start address
877 * @pch_opt_rom_start_address: Option ROM start address
878 * @ioh_type: Save IOH type
879 + * @pdev: pointer to pci device struct
880 */
881 struct pch_phub_reg {
882 u32 phub_id_reg;
883 @@ -131,11 +134,13 @@ struct pch_phub_reg {
884 u32 intpin_reg_wpermit_reg3;
885 u32 int_reduce_control_reg[MAX_NUM_INT_REDUCE_CONTROL_REG];
886 u32 clkcfg_reg;
887 + u32 funcsel_reg;
888 void __iomem *pch_phub_base_address;
889 void __iomem *pch_phub_extrom_base_address;
890 u32 pch_mac_start_address;
891 u32 pch_opt_rom_start_address;
892 int ioh_type;
893 + struct pci_dev *pdev;
894 };
895
896 /* SROM SPEC for MAC address assignment offset */
897 @@ -214,6 +219,8 @@ static void pch_phub_save_reg_conf(struct pci_dev *pdev)
898 __func__, i, chip->int_reduce_control_reg[i]);
899 }
900 chip->clkcfg_reg = ioread32(p + CLKCFG_REG_OFFSET);
901 + if ((chip->ioh_type == 2) || (chip->ioh_type == 4))
902 + chip->funcsel_reg = ioread32(p + FUNCSEL_REG_OFFSET);
903 }
904
905 /* pch_phub_restore_reg_conf - restore register configuration */
906 @@ -274,6 +281,8 @@ static void pch_phub_restore_reg_conf(struct pci_dev *pdev)
907 }
908
909 iowrite32(chip->clkcfg_reg, p + CLKCFG_REG_OFFSET);
910 + if ((chip->ioh_type == 2) || (chip->ioh_type == 4))
911 + iowrite32(chip->funcsel_reg, p + FUNCSEL_REG_OFFSET);
912 }
913
914 /**
915 @@ -494,6 +503,7 @@ static ssize_t pch_phub_bin_read(struct file *filp, struct kobject *kobj,
916 unsigned int orom_size;
917 int ret;
918 int err;
919 + ssize_t rom_size;
920
921 struct pch_phub_reg *chip =
922 dev_get_drvdata(container_of(kobj, struct device, kobj));
923 @@ -505,6 +515,10 @@ static ssize_t pch_phub_bin_read(struct file *filp, struct kobject *kobj,
924 }
925
926 /* Get Rom signature */
927 + chip->pch_phub_extrom_base_address = pci_map_rom(chip->pdev, &rom_size);
928 + if (!chip->pch_phub_extrom_base_address)
929 + goto exrom_map_err;
930 +
931 pch_phub_read_serial_rom(chip, chip->pch_opt_rom_start_address,
932 (unsigned char *)&rom_signature);
933 rom_signature &= 0xff;
934 @@ -535,10 +549,13 @@ static ssize_t pch_phub_bin_read(struct file *filp, struct kobject *kobj,
935 goto return_err;
936 }
937 return_ok:
938 + pci_unmap_rom(chip->pdev, chip->pch_phub_extrom_base_address);
939 mutex_unlock(&pch_phub_mutex);
940 return addr_offset;
941
942 return_err:
943 + pci_unmap_rom(chip->pdev, chip->pch_phub_extrom_base_address);
944 +exrom_map_err:
945 mutex_unlock(&pch_phub_mutex);
946 return_err_nomutex:
947 return err;
948 @@ -551,6 +568,7 @@ static ssize_t pch_phub_bin_write(struct file *filp, struct kobject *kobj,
949 int err;
950 unsigned int addr_offset;
951 int ret;
952 + ssize_t rom_size;
953 struct pch_phub_reg *chip =
954 dev_get_drvdata(container_of(kobj, struct device, kobj));
955
956 @@ -567,6 +585,12 @@ static ssize_t pch_phub_bin_write(struct file *filp, struct kobject *kobj,
957 goto return_ok;
958 }
959
960 + chip->pch_phub_extrom_base_address = pci_map_rom(chip->pdev, &rom_size);
961 + if (!chip->pch_phub_extrom_base_address) {
962 + err = -ENOMEM;
963 + goto exrom_map_err;
964 + }
965 +
966 for (addr_offset = 0; addr_offset < count; addr_offset++) {
967 if (PCH_PHUB_OROM_SIZE < off + addr_offset)
968 goto return_ok;
969 @@ -581,10 +605,14 @@ static ssize_t pch_phub_bin_write(struct file *filp, struct kobject *kobj,
970 }
971
972 return_ok:
973 + pci_unmap_rom(chip->pdev, chip->pch_phub_extrom_base_address);
974 mutex_unlock(&pch_phub_mutex);
975 return addr_offset;
976
977 return_err:
978 + pci_unmap_rom(chip->pdev, chip->pch_phub_extrom_base_address);
979 +
980 +exrom_map_err:
981 mutex_unlock(&pch_phub_mutex);
982 return err;
983 }
984 @@ -594,8 +622,14 @@ static ssize_t show_pch_mac(struct device *dev, struct device_attribute *attr,
985 {
986 u8 mac[8];
987 struct pch_phub_reg *chip = dev_get_drvdata(dev);
988 + ssize_t rom_size;
989 +
990 + chip->pch_phub_extrom_base_address = pci_map_rom(chip->pdev, &rom_size);
991 + if (!chip->pch_phub_extrom_base_address)
992 + return -ENOMEM;
993
994 pch_phub_read_gbe_mac_addr(chip, mac);
995 + pci_unmap_rom(chip->pdev, chip->pch_phub_extrom_base_address);
996
997 return sprintf(buf, "%02x:%02x:%02x:%02x:%02x:%02x\n",
998 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
999 @@ -605,6 +639,7 @@ static ssize_t store_pch_mac(struct device *dev, struct device_attribute *attr,
1000 const char *buf, size_t count)
1001 {
1002 u8 mac[6];
1003 + ssize_t rom_size;
1004 struct pch_phub_reg *chip = dev_get_drvdata(dev);
1005
1006 if (count != 18)
1007 @@ -614,7 +649,12 @@ static ssize_t store_pch_mac(struct device *dev, struct device_attribute *attr,
1008 (u32 *)&mac[0], (u32 *)&mac[1], (u32 *)&mac[2], (u32 *)&mac[3],
1009 (u32 *)&mac[4], (u32 *)&mac[5]);
1010
1011 + chip->pch_phub_extrom_base_address = pci_map_rom(chip->pdev, &rom_size);
1012 + if (!chip->pch_phub_extrom_base_address)
1013 + return -ENOMEM;
1014 +
1015 pch_phub_write_gbe_mac_addr(chip, mac);
1016 + pci_unmap_rom(chip->pdev, chip->pch_phub_extrom_base_address);
1017
1018 return count;
1019 }
1020 @@ -637,7 +677,6 @@ static int __devinit pch_phub_probe(struct pci_dev *pdev,
1021 int retval;
1022
1023 int ret;
1024 - ssize_t rom_size;
1025 struct pch_phub_reg *chip;
1026
1027 chip = kzalloc(sizeof(struct pch_phub_reg), GFP_KERNEL);
1028 @@ -674,19 +713,7 @@ static int __devinit pch_phub_probe(struct pci_dev *pdev,
1029 "in pch_phub_base_address variable is %p\n", __func__,
1030 chip->pch_phub_base_address);
1031
1032 - if (id->driver_data != 3) {
1033 - chip->pch_phub_extrom_base_address =\
1034 - pci_map_rom(pdev, &rom_size);
1035 - if (chip->pch_phub_extrom_base_address == 0) {
1036 - dev_err(&pdev->dev, "%s: pci_map_rom FAILED", __func__);
1037 - ret = -ENOMEM;
1038 - goto err_pci_map;
1039 - }
1040 - dev_dbg(&pdev->dev, "%s : "
1041 - "pci_map_rom SUCCESS and value in "
1042 - "pch_phub_extrom_base_address variable is %p\n",
1043 - __func__, chip->pch_phub_extrom_base_address);
1044 - }
1045 + chip->pdev = pdev; /* Save pci device struct */
1046
1047 if (id->driver_data == 1) { /* EG20T PCH */
1048 retval = sysfs_create_file(&pdev->dev.kobj,
1049 @@ -735,6 +762,8 @@ static int __devinit pch_phub_probe(struct pci_dev *pdev,
1050 * Device8(GbE)
1051 */
1052 iowrite32(0x000a0000, chip->pch_phub_base_address + 0x14);
1053 + /* set the interrupt delay value */
1054 + iowrite32(0x25, chip->pch_phub_base_address + 0x140);
1055 chip->pch_opt_rom_start_address =\
1056 PCH_PHUB_ROM_START_ADDR_ML7223;
1057 chip->pch_mac_start_address = PCH_PHUB_MAC_START_ADDR_ML7223;
1058 @@ -752,8 +781,6 @@ static int __devinit pch_phub_probe(struct pci_dev *pdev,
1059 * Device6(SATA 2):f
1060 */
1061 iowrite32(0x0000ffa0, chip->pch_phub_base_address + 0x14);
1062 - /* set the interrupt delay value */
1063 - iowrite32(0x25, chip->pch_phub_base_address + 0x140);
1064 chip->pch_opt_rom_start_address =\
1065 PCH_PHUB_ROM_START_ADDR_ML7223;
1066 chip->pch_mac_start_address = PCH_PHUB_MAC_START_ADDR_ML7223;
1067 @@ -783,8 +810,6 @@ exit_bin_attr:
1068 sysfs_remove_file(&pdev->dev.kobj, &dev_attr_pch_mac.attr);
1069
1070 err_sysfs_create:
1071 - pci_unmap_rom(pdev, chip->pch_phub_extrom_base_address);
1072 -err_pci_map:
1073 pci_iounmap(pdev, chip->pch_phub_base_address);
1074 err_pci_iomap:
1075 pci_release_regions(pdev);
1076 @@ -802,7 +827,6 @@ static void __devexit pch_phub_remove(struct pci_dev *pdev)
1077
1078 sysfs_remove_file(&pdev->dev.kobj, &dev_attr_pch_mac.attr);
1079 sysfs_remove_bin_file(&pdev->dev.kobj, &pch_bin_attr);
1080 - pci_unmap_rom(pdev, chip->pch_phub_extrom_base_address);
1081 pci_iounmap(pdev, chip->pch_phub_base_address);
1082 pci_release_regions(pdev);
1083 pci_disable_device(pdev);
1084 diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c
1085 index a1250c5..1f2f97f 100644
1086 --- a/drivers/net/wireless/ath/ath9k/calib.c
1087 +++ b/drivers/net/wireless/ath/ath9k/calib.c
1088 @@ -19,7 +19,6 @@
1089
1090 /* Common calibration code */
1091
1092 -#define ATH9K_NF_TOO_HIGH -60
1093
1094 static int16_t ath9k_hw_get_nf_hist_mid(int16_t *nfCalBuffer)
1095 {
1096 @@ -335,10 +334,10 @@ static void ath9k_hw_nf_sanitize(struct ath_hw *ah, s16 *nf)
1097 "NF calibrated [%s] [chain %d] is %d\n",
1098 (i >= 3 ? "ext" : "ctl"), i % 3, nf[i]);
1099
1100 - if (nf[i] > ATH9K_NF_TOO_HIGH) {
1101 + if (nf[i] > limit->max) {
1102 ath_dbg(common, ATH_DBG_CALIBRATE,
1103 "NF[%d] (%d) > MAX (%d), correcting to MAX\n",
1104 - i, nf[i], ATH9K_NF_TOO_HIGH);
1105 + i, nf[i], limit->max);
1106 nf[i] = limit->max;
1107 } else if (nf[i] < limit->min) {
1108 ath_dbg(common, ATH_DBG_CALIBRATE,
1109 diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
1110 index 6c56198..61291a1 100644
1111 --- a/drivers/net/wireless/rtlwifi/pci.c
1112 +++ b/drivers/net/wireless/rtlwifi/pci.c
1113 @@ -954,8 +954,13 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
1114 memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc));
1115 ring = &rtlpci->tx_ring[BEACON_QUEUE];
1116 pskb = __skb_dequeue(&ring->queue);
1117 - if (pskb)
1118 + if (pskb) {
1119 + struct rtl_tx_desc *entry = &ring->desc[ring->idx];
1120 + pci_unmap_single(rtlpci->pdev, rtlpriv->cfg->ops->get_desc(
1121 + (u8 *) entry, true, HW_DESC_TXBUFF_ADDR),
1122 + pskb->len, PCI_DMA_TODEVICE);
1123 kfree_skb(pskb);
1124 + }
1125
1126 /*NB: the beacon data buffer must be 32-bit aligned. */
1127 pskb = ieee80211_beacon_get(hw, mac->vif);
1128 diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
1129 index ff1b84b..e86edfc 100644
1130 --- a/drivers/rtc/rtc-pl031.c
1131 +++ b/drivers/rtc/rtc-pl031.c
1132 @@ -339,8 +339,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
1133 dev_dbg(&adev->dev, "revision = 0x%01x\n", ldata->hw_revision);
1134
1135 /* Enable the clockwatch on ST Variants */
1136 - if ((ldata->hw_designer == AMBA_VENDOR_ST) &&
1137 - (ldata->hw_revision > 1))
1138 + if (ldata->hw_designer == AMBA_VENDOR_ST)
1139 writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN,
1140 ldata->base + RTC_CR);
1141
1142 diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c
1143 index dd9a3bb..a1176d9 100644
1144 --- a/drivers/staging/iio/magnetometer/hmc5843.c
1145 +++ b/drivers/staging/iio/magnetometer/hmc5843.c
1146 @@ -520,7 +520,9 @@ static int hmc5843_detect(struct i2c_client *client,
1147 /* Called when we have found a new HMC5843. */
1148 static void hmc5843_init_client(struct i2c_client *client)
1149 {
1150 - struct hmc5843_data *data = i2c_get_clientdata(client);
1151 + struct iio_dev *indio_dev = i2c_get_clientdata(client);
1152 + struct hmc5843_data *data = iio_priv(indio_dev);
1153 +
1154 hmc5843_set_meas_conf(client, data->meas_conf);
1155 hmc5843_set_rate(client, data->rate);
1156 hmc5843_configure(client, data->operating_mode);
1157 diff --git a/drivers/tty/serial/8250_pci.c b/drivers/tty/serial/8250_pci.c
1158 index ff48fdb..21098ed 100644
1159 --- a/drivers/tty/serial/8250_pci.c
1160 +++ b/drivers/tty/serial/8250_pci.c
1161 @@ -1459,51 +1459,61 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
1162 .vendor = PCI_VENDOR_ID_INTEL,
1163 .device = 0x8811,
1164 .init = pci_eg20t_init,
1165 + .setup = pci_default_setup,
1166 },
1167 {
1168 .vendor = PCI_VENDOR_ID_INTEL,
1169 .device = 0x8812,
1170 .init = pci_eg20t_init,
1171 + .setup = pci_default_setup,
1172 },
1173 {
1174 .vendor = PCI_VENDOR_ID_INTEL,
1175 .device = 0x8813,
1176 .init = pci_eg20t_init,
1177 + .setup = pci_default_setup,
1178 },
1179 {
1180 .vendor = PCI_VENDOR_ID_INTEL,
1181 .device = 0x8814,
1182 .init = pci_eg20t_init,
1183 + .setup = pci_default_setup,
1184 },
1185 {
1186 .vendor = 0x10DB,
1187 .device = 0x8027,
1188 .init = pci_eg20t_init,
1189 + .setup = pci_default_setup,
1190 },
1191 {
1192 .vendor = 0x10DB,
1193 .device = 0x8028,
1194 .init = pci_eg20t_init,
1195 + .setup = pci_default_setup,
1196 },
1197 {
1198 .vendor = 0x10DB,
1199 .device = 0x8029,
1200 .init = pci_eg20t_init,
1201 + .setup = pci_default_setup,
1202 },
1203 {
1204 .vendor = 0x10DB,
1205 .device = 0x800C,
1206 .init = pci_eg20t_init,
1207 + .setup = pci_default_setup,
1208 },
1209 {
1210 .vendor = 0x10DB,
1211 .device = 0x800D,
1212 .init = pci_eg20t_init,
1213 + .setup = pci_default_setup,
1214 },
1215 {
1216 .vendor = 0x10DB,
1217 .device = 0x800D,
1218 .init = pci_eg20t_init,
1219 + .setup = pci_default_setup,
1220 },
1221 /*
1222 * Cronyx Omega PCI (PLX-chip based)
1223 diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
1224 index 50bc5a5..37db1d5 100644
1225 --- a/drivers/tty/serial/altera_uart.c
1226 +++ b/drivers/tty/serial/altera_uart.c
1227 @@ -555,7 +555,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
1228 res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1229 if (res_mem)
1230 port->mapbase = res_mem->start;
1231 - else if (platp->mapbase)
1232 + else if (platp)
1233 port->mapbase = platp->mapbase;
1234 else
1235 return -EINVAL;
1236 @@ -563,7 +563,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
1237 res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
1238 if (res_irq)
1239 port->irq = res_irq->start;
1240 - else if (platp->irq)
1241 + else if (platp)
1242 port->irq = platp->irq;
1243
1244 /* Check platform data first so we can override device node data */
1245 diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
1246 index 4a4733e..21dc4b7 100644
1247 --- a/drivers/tty/serial/amba-pl011.c
1248 +++ b/drivers/tty/serial/amba-pl011.c
1249 @@ -1376,6 +1376,10 @@ static int pl011_startup(struct uart_port *port)
1250
1251 uap->port.uartclk = clk_get_rate(uap->clk);
1252
1253 + /* Clear pending error and receive interrupts */
1254 + writew(UART011_OEIS | UART011_BEIS | UART011_PEIS | UART011_FEIS |
1255 + UART011_RTIS | UART011_RXIS, uap->port.membase + UART011_ICR);
1256 +
1257 /*
1258 * Allocate the IRQ
1259 */
1260 @@ -1410,10 +1414,6 @@ static int pl011_startup(struct uart_port *port)
1261 cr = UART01x_CR_UARTEN | UART011_CR_RXE | UART011_CR_TXE;
1262 writew(cr, uap->port.membase + UART011_CR);
1263
1264 - /* Clear pending error interrupts */
1265 - writew(UART011_OEIS | UART011_BEIS | UART011_PEIS | UART011_FEIS,
1266 - uap->port.membase + UART011_ICR);
1267 -
1268 /*
1269 * initialise the old status of the modem signals
1270 */
1271 @@ -1428,6 +1428,9 @@ static int pl011_startup(struct uart_port *port)
1272 * as well.
1273 */
1274 spin_lock_irq(&uap->port.lock);
1275 + /* Clear out any spuriously appearing RX interrupts */
1276 + writew(UART011_RTIS | UART011_RXIS,
1277 + uap->port.membase + UART011_ICR);
1278 uap->im = UART011_RTIM;
1279 if (!pl011_dma_rx_running(uap))
1280 uap->im |= UART011_RXIM;
1281 @@ -1920,6 +1923,10 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
1282 uap->port.line = i;
1283 pl011_dma_probe(uap);
1284
1285 + /* Ensure interrupts from this UART are masked and cleared */
1286 + writew(0, uap->port.membase + UART011_IMSC);
1287 + writew(0xffff, uap->port.membase + UART011_ICR);
1288 +
1289 snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev));
1290
1291 amba_ports[i] = uap;
1292 diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
1293 index 902588b..579ed6b 100644
1294 --- a/drivers/tty/serial/pch_uart.c
1295 +++ b/drivers/tty/serial/pch_uart.c
1296 @@ -602,7 +602,8 @@ static void pch_request_dma(struct uart_port *port)
1297 dma_cap_zero(mask);
1298 dma_cap_set(DMA_SLAVE, mask);
1299
1300 - dma_dev = pci_get_bus_and_slot(2, PCI_DEVFN(0xa, 0)); /* Get DMA's dev
1301 + dma_dev = pci_get_bus_and_slot(priv->pdev->bus->number,
1302 + PCI_DEVFN(0xa, 0)); /* Get DMA's dev
1303 information */
1304 /* Set Tx DMA */
1305 param = &priv->param_tx;
1306 diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
1307 index 0b5ec23..9223600 100644
1308 --- a/drivers/usb/core/message.c
1309 +++ b/drivers/usb/core/message.c
1310 @@ -308,7 +308,8 @@ static void sg_complete(struct urb *urb)
1311 retval = usb_unlink_urb(io->urbs [i]);
1312 if (retval != -EINPROGRESS &&
1313 retval != -ENODEV &&
1314 - retval != -EBUSY)
1315 + retval != -EBUSY &&
1316 + retval != -EIDRM)
1317 dev_err(&io->dev->dev,
1318 "%s, unlink --> %d\n",
1319 __func__, retval);
1320 @@ -317,7 +318,6 @@ static void sg_complete(struct urb *urb)
1321 }
1322 spin_lock(&io->lock);
1323 }
1324 - urb->dev = NULL;
1325
1326 /* on the last completion, signal usb_sg_wait() */
1327 io->bytes += urb->actual_length;
1328 @@ -524,7 +524,6 @@ void usb_sg_wait(struct usb_sg_request *io)
1329 case -ENXIO: /* hc didn't queue this one */
1330 case -EAGAIN:
1331 case -ENOMEM:
1332 - io->urbs[i]->dev = NULL;
1333 retval = 0;
1334 yield();
1335 break;
1336 @@ -542,7 +541,6 @@ void usb_sg_wait(struct usb_sg_request *io)
1337
1338 /* fail any uncompleted urbs */
1339 default:
1340 - io->urbs[i]->dev = NULL;
1341 io->urbs[i]->status = retval;
1342 dev_dbg(&io->dev->dev, "%s, submit --> %d\n",
1343 __func__, retval);
1344 @@ -593,7 +591,10 @@ void usb_sg_cancel(struct usb_sg_request *io)
1345 if (!io->urbs [i]->dev)
1346 continue;
1347 retval = usb_unlink_urb(io->urbs [i]);
1348 - if (retval != -EINPROGRESS && retval != -EBUSY)
1349 + if (retval != -EINPROGRESS
1350 + && retval != -ENODEV
1351 + && retval != -EBUSY
1352 + && retval != -EIDRM)
1353 dev_warn(&io->dev->dev, "%s, unlink --> %d\n",
1354 __func__, retval);
1355 }
1356 diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
1357 index 029e288..46f81ae 100644
1358 --- a/drivers/usb/gadget/Kconfig
1359 +++ b/drivers/usb/gadget/Kconfig
1360 @@ -544,7 +544,7 @@ config USB_LANGWELL
1361 select USB_GADGET_SELECTED
1362
1363 config USB_GADGET_EG20T
1364 - boolean "Intel EG20T PCH/OKI SEMICONDUCTOR ML7213 IOH UDC"
1365 + tristate "Intel EG20T PCH/OKI SEMICONDUCTOR IOH(ML7213/ML7831) UDC"
1366 depends on PCI
1367 select USB_GADGET_DUALSPEED
1368 help
1369 @@ -562,8 +562,9 @@ config USB_GADGET_EG20T
1370
1371 This driver also can be used for OKI SEMICONDUCTOR's ML7213 which is
1372 for IVI(In-Vehicle Infotainment) use.
1373 - ML7213 is companion chip for Intel Atom E6xx series.
1374 - ML7213 is completely compatible for Intel EG20T PCH.
1375 + ML7831 is for general purpose use.
1376 + ML7213/ML7831 is companion chip for Intel Atom E6xx series.
1377 + ML7213/ML7831 is completely compatible for Intel EG20T PCH.
1378
1379 config USB_EG20T
1380 tristate
1381 diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
1382 index 68dbcc3..1852c8a 100644
1383 --- a/drivers/usb/gadget/pch_udc.c
1384 +++ b/drivers/usb/gadget/pch_udc.c
1385 @@ -320,6 +320,7 @@ struct pch_udc_ep {
1386 * @registered: driver regsitered with system
1387 * @suspended: driver in suspended state
1388 * @connected: gadget driver associated
1389 + * @vbus_session: required vbus_session state
1390 * @set_cfg_not_acked: pending acknowledgement 4 setup
1391 * @waiting_zlp_ack: pending acknowledgement 4 ZLP
1392 * @data_requests: DMA pool for data requests
1393 @@ -346,6 +347,7 @@ struct pch_udc_dev {
1394 registered:1,
1395 suspended:1,
1396 connected:1,
1397 + vbus_session:1,
1398 set_cfg_not_acked:1,
1399 waiting_zlp_ack:1;
1400 struct pci_pool *data_requests;
1401 @@ -363,6 +365,7 @@ struct pch_udc_dev {
1402 #define PCI_DEVICE_ID_INTEL_EG20T_UDC 0x8808
1403 #define PCI_VENDOR_ID_ROHM 0x10DB
1404 #define PCI_DEVICE_ID_ML7213_IOH_UDC 0x801D
1405 +#define PCI_DEVICE_ID_ML7831_IOH_UDC 0x8808
1406
1407 static const char ep0_string[] = "ep0in";
1408 static DEFINE_SPINLOCK(udc_stall_spinlock); /* stall spin lock */
1409 @@ -562,6 +565,29 @@ static void pch_udc_clear_disconnect(struct pch_udc_dev *dev)
1410 }
1411
1412 /**
1413 + * pch_udc_reconnect() - This API initializes usb device controller,
1414 + * and clear the disconnect status.
1415 + * @dev: Reference to pch_udc_regs structure
1416 + */
1417 +static void pch_udc_init(struct pch_udc_dev *dev);
1418 +static void pch_udc_reconnect(struct pch_udc_dev *dev)
1419 +{
1420 + pch_udc_init(dev);
1421 +
1422 + /* enable device interrupts */
1423 + /* pch_udc_enable_interrupts() */
1424 + pch_udc_bit_clr(dev, UDC_DEVIRQMSK_ADDR,
1425 + UDC_DEVINT_UR | UDC_DEVINT_ENUM);
1426 +
1427 + /* Clear the disconnect */
1428 + pch_udc_bit_set(dev, UDC_DEVCTL_ADDR, UDC_DEVCTL_RES);
1429 + pch_udc_bit_clr(dev, UDC_DEVCTL_ADDR, UDC_DEVCTL_SD);
1430 + mdelay(1);
1431 + /* Resume USB signalling */
1432 + pch_udc_bit_clr(dev, UDC_DEVCTL_ADDR, UDC_DEVCTL_RES);
1433 +}
1434 +
1435 +/**
1436 * pch_udc_vbus_session() - set or clearr the disconnect status.
1437 * @dev: Reference to pch_udc_regs structure
1438 * @is_active: Parameter specifying the action
1439 @@ -571,10 +597,18 @@ static void pch_udc_clear_disconnect(struct pch_udc_dev *dev)
1440 static inline void pch_udc_vbus_session(struct pch_udc_dev *dev,
1441 int is_active)
1442 {
1443 - if (is_active)
1444 - pch_udc_clear_disconnect(dev);
1445 - else
1446 + if (is_active) {
1447 + pch_udc_reconnect(dev);
1448 + dev->vbus_session = 1;
1449 + } else {
1450 + if (dev->driver && dev->driver->disconnect) {
1451 + spin_unlock(&dev->lock);
1452 + dev->driver->disconnect(&dev->gadget);
1453 + spin_lock(&dev->lock);
1454 + }
1455 pch_udc_set_disconnect(dev);
1456 + dev->vbus_session = 0;
1457 + }
1458 }
1459
1460 /**
1461 @@ -1134,7 +1168,17 @@ static int pch_udc_pcd_pullup(struct usb_gadget *gadget, int is_on)
1462 if (!gadget)
1463 return -EINVAL;
1464 dev = container_of(gadget, struct pch_udc_dev, gadget);
1465 - pch_udc_vbus_session(dev, is_on);
1466 + if (is_on) {
1467 + pch_udc_reconnect(dev);
1468 + } else {
1469 + if (dev->driver && dev->driver->disconnect) {
1470 + spin_unlock(&dev->lock);
1471 + dev->driver->disconnect(&dev->gadget);
1472 + spin_lock(&dev->lock);
1473 + }
1474 + pch_udc_set_disconnect(dev);
1475 + }
1476 +
1477 return 0;
1478 }
1479
1480 @@ -2338,8 +2382,11 @@ static void pch_udc_svc_ur_interrupt(struct pch_udc_dev *dev)
1481 /* Complete request queue */
1482 empty_req_queue(ep);
1483 }
1484 - if (dev->driver && dev->driver->disconnect)
1485 + if (dev->driver && dev->driver->disconnect) {
1486 + spin_unlock(&dev->lock);
1487 dev->driver->disconnect(&dev->gadget);
1488 + spin_lock(&dev->lock);
1489 + }
1490 }
1491
1492 /**
1493 @@ -2374,6 +2421,11 @@ static void pch_udc_svc_enum_interrupt(struct pch_udc_dev *dev)
1494 pch_udc_set_dma(dev, DMA_DIR_TX);
1495 pch_udc_set_dma(dev, DMA_DIR_RX);
1496 pch_udc_ep_set_rrdy(&(dev->ep[UDC_EP0OUT_IDX]));
1497 +
1498 + /* enable device interrupts */
1499 + pch_udc_enable_interrupts(dev, UDC_DEVINT_UR | UDC_DEVINT_US |
1500 + UDC_DEVINT_ES | UDC_DEVINT_ENUM |
1501 + UDC_DEVINT_SI | UDC_DEVINT_SC);
1502 }
1503
1504 /**
1505 @@ -2475,8 +2527,24 @@ static void pch_udc_dev_isr(struct pch_udc_dev *dev, u32 dev_intr)
1506 if (dev_intr & UDC_DEVINT_SC)
1507 pch_udc_svc_cfg_interrupt(dev);
1508 /* USB Suspend interrupt */
1509 - if (dev_intr & UDC_DEVINT_US)
1510 + if (dev_intr & UDC_DEVINT_US) {
1511 + if (dev->driver
1512 + && dev->driver->suspend) {
1513 + spin_unlock(&dev->lock);
1514 + dev->driver->suspend(&dev->gadget);
1515 + spin_lock(&dev->lock);
1516 + }
1517 +
1518 + if (dev->vbus_session == 0) {
1519 + if (dev->driver && dev->driver->disconnect) {
1520 + spin_unlock(&dev->lock);
1521 + dev->driver->disconnect(&dev->gadget);
1522 + spin_lock(&dev->lock);
1523 + }
1524 + pch_udc_reconnect(dev);
1525 + }
1526 dev_dbg(&dev->pdev->dev, "USB_SUSPEND\n");
1527 + }
1528 /* Clear the SOF interrupt, if enabled */
1529 if (dev_intr & UDC_DEVINT_SOF)
1530 dev_dbg(&dev->pdev->dev, "SOF\n");
1531 @@ -2502,6 +2570,14 @@ static irqreturn_t pch_udc_isr(int irq, void *pdev)
1532 dev_intr = pch_udc_read_device_interrupts(dev);
1533 ep_intr = pch_udc_read_ep_interrupts(dev);
1534
1535 + /* For a hot plug, this find that the controller is hung up. */
1536 + if (dev_intr == ep_intr)
1537 + if (dev_intr == pch_udc_readl(dev, UDC_DEVCFG_ADDR)) {
1538 + dev_dbg(&dev->pdev->dev, "UDC: Hung up\n");
1539 + /* The controller is reset */
1540 + pch_udc_writel(dev, UDC_SRST, UDC_SRST_ADDR);
1541 + return IRQ_HANDLED;
1542 + }
1543 if (dev_intr)
1544 /* Clear device interrupts */
1545 pch_udc_write_device_interrupts(dev, dev_intr);
1546 @@ -2915,8 +2991,10 @@ static int pch_udc_probe(struct pci_dev *pdev,
1547 }
1548 pch_udc = dev;
1549 /* initialize the hardware */
1550 - if (pch_udc_pcd_init(dev))
1551 + if (pch_udc_pcd_init(dev)) {
1552 + retval = -ENODEV;
1553 goto finished;
1554 + }
1555 if (request_irq(pdev->irq, pch_udc_isr, IRQF_SHARED, KBUILD_MODNAME,
1556 dev)) {
1557 dev_err(&pdev->dev, "%s: request_irq(%d) fail\n", __func__,
1558 @@ -2971,6 +3049,11 @@ static DEFINE_PCI_DEVICE_TABLE(pch_udc_pcidev_id) = {
1559 .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
1560 .class_mask = 0xffffffff,
1561 },
1562 + {
1563 + PCI_DEVICE(PCI_VENDOR_ID_ROHM, PCI_DEVICE_ID_ML7831_IOH_UDC),
1564 + .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
1565 + .class_mask = 0xffffffff,
1566 + },
1567 { 0 },
1568 };
1569
1570 diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
1571 index 3f387b8..7fec8bd 100644
1572 --- a/drivers/usb/host/pci-quirks.c
1573 +++ b/drivers/usb/host/pci-quirks.c
1574 @@ -824,9 +824,13 @@ static void __devinit quirk_usb_handoff_xhci(struct pci_dev *pdev)
1575 }
1576 }
1577
1578 - /* Disable any BIOS SMIs */
1579 - writel(XHCI_LEGACY_DISABLE_SMI,
1580 - base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET);
1581 + val = readl(base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET);
1582 + /* Mask off (turn off) any enabled SMIs */
1583 + val &= XHCI_LEGACY_DISABLE_SMI;
1584 + /* Mask all SMI events bits, RW1C */
1585 + val |= XHCI_LEGACY_SMI_EVENTS;
1586 + /* Disable any BIOS SMIs and clear all SMI events*/
1587 + writel(val, base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET);
1588
1589 if (usb_is_intel_switchable_xhci(pdev))
1590 usb_enable_xhci_ports(pdev);
1591 diff --git a/drivers/usb/host/xhci-ext-caps.h b/drivers/usb/host/xhci-ext-caps.h
1592 index ce5c9e5..4206f6b 100644
1593 --- a/drivers/usb/host/xhci-ext-caps.h
1594 +++ b/drivers/usb/host/xhci-ext-caps.h
1595 @@ -62,8 +62,9 @@
1596 /* USB Legacy Support Control and Status Register - section 7.1.2 */
1597 /* Add this offset, plus the value of xECP in HCCPARAMS to the base address */
1598 #define XHCI_LEGACY_CONTROL_OFFSET (0x04)
1599 -/* bits 1:2, 5:12, and 17:19 need to be preserved; bits 21:28 should be zero */
1600 -#define XHCI_LEGACY_DISABLE_SMI ((0x3 << 1) + (0xff << 5) + (0x7 << 17))
1601 +/* bits 1:3, 5:12, and 17:19 need to be preserved; bits 21:28 should be zero */
1602 +#define XHCI_LEGACY_DISABLE_SMI ((0x7 << 1) + (0xff << 5) + (0x7 << 17))
1603 +#define XHCI_LEGACY_SMI_EVENTS (0x7 << 29)
1604
1605 /* command register values to disable interrupts and halt the HC */
1606 /* start/stop HC execution - do not write unless HC is halted*/
1607 diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
1608 index 64fbf6f..a4468d9 100644
1609 --- a/drivers/usb/host/xhci-mem.c
1610 +++ b/drivers/usb/host/xhci-mem.c
1611 @@ -1509,11 +1509,6 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
1612 int i;
1613
1614 /* Free the Event Ring Segment Table and the actual Event Ring */
1615 - if (xhci->ir_set) {
1616 - xhci_writel(xhci, 0, &xhci->ir_set->erst_size);
1617 - xhci_write_64(xhci, 0, &xhci->ir_set->erst_base);
1618 - xhci_write_64(xhci, 0, &xhci->ir_set->erst_dequeue);
1619 - }
1620 size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries);
1621 if (xhci->erst.entries)
1622 pci_free_consistent(pdev, size,
1623 @@ -1525,7 +1520,6 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
1624 xhci->event_ring = NULL;
1625 xhci_dbg(xhci, "Freed event ring\n");
1626
1627 - xhci_write_64(xhci, 0, &xhci->op_regs->cmd_ring);
1628 if (xhci->cmd_ring)
1629 xhci_ring_free(xhci, xhci->cmd_ring);
1630 xhci->cmd_ring = NULL;
1631 @@ -1554,7 +1548,6 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
1632 xhci->medium_streams_pool = NULL;
1633 xhci_dbg(xhci, "Freed medium stream array pool\n");
1634
1635 - xhci_write_64(xhci, 0, &xhci->op_regs->dcbaa_ptr);
1636 if (xhci->dcbaa)
1637 pci_free_consistent(pdev, sizeof(*xhci->dcbaa),
1638 xhci->dcbaa, xhci->dcbaa->dma);
1639 @@ -2123,6 +2116,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
1640
1641 fail:
1642 xhci_warn(xhci, "Couldn't initialize memory\n");
1643 + xhci_halt(xhci);
1644 + xhci_reset(xhci);
1645 xhci_mem_cleanup(xhci);
1646 return -ENOMEM;
1647 }
1648 diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
1649 index 50e7156..4509f69 100644
1650 --- a/drivers/usb/host/xhci-pci.c
1651 +++ b/drivers/usb/host/xhci-pci.c
1652 @@ -145,6 +145,8 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
1653 xhci->quirks |= XHCI_RESET_ON_RESUME;
1654 xhci_dbg(xhci, "QUIRK: Resetting on resume\n");
1655 }
1656 + if (pdev->vendor == PCI_VENDOR_ID_VIA)
1657 + xhci->quirks |= XHCI_RESET_ON_RESUME;
1658
1659 /* Make sure the HC is halted. */
1660 retval = xhci_halt(xhci);
1661 diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
1662 index edcedc4..c42fdff 100644
1663 --- a/drivers/usb/host/xhci-ring.c
1664 +++ b/drivers/usb/host/xhci-ring.c
1665 @@ -2352,7 +2352,7 @@ hw_died:
1666 u32 irq_pending;
1667 /* Acknowledge the PCI interrupt */
1668 irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending);
1669 - irq_pending |= 0x3;
1670 + irq_pending |= IMAN_IP;
1671 xhci_writel(xhci, irq_pending, &xhci->ir_set->irq_pending);
1672 }
1673
1674 diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
1675 index b4416d8..dbba936 100644
1676 --- a/drivers/usb/host/xhci.c
1677 +++ b/drivers/usb/host/xhci.c
1678 @@ -610,11 +610,11 @@ static void xhci_save_registers(struct xhci_hcd *xhci)
1679 xhci->s3.dev_nt = xhci_readl(xhci, &xhci->op_regs->dev_notification);
1680 xhci->s3.dcbaa_ptr = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr);
1681 xhci->s3.config_reg = xhci_readl(xhci, &xhci->op_regs->config_reg);
1682 - xhci->s3.irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending);
1683 - xhci->s3.irq_control = xhci_readl(xhci, &xhci->ir_set->irq_control);
1684 xhci->s3.erst_size = xhci_readl(xhci, &xhci->ir_set->erst_size);
1685 xhci->s3.erst_base = xhci_read_64(xhci, &xhci->ir_set->erst_base);
1686 xhci->s3.erst_dequeue = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
1687 + xhci->s3.irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending);
1688 + xhci->s3.irq_control = xhci_readl(xhci, &xhci->ir_set->irq_control);
1689 }
1690
1691 static void xhci_restore_registers(struct xhci_hcd *xhci)
1692 @@ -623,10 +623,11 @@ static void xhci_restore_registers(struct xhci_hcd *xhci)
1693 xhci_writel(xhci, xhci->s3.dev_nt, &xhci->op_regs->dev_notification);
1694 xhci_write_64(xhci, xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr);
1695 xhci_writel(xhci, xhci->s3.config_reg, &xhci->op_regs->config_reg);
1696 - xhci_writel(xhci, xhci->s3.irq_pending, &xhci->ir_set->irq_pending);
1697 - xhci_writel(xhci, xhci->s3.irq_control, &xhci->ir_set->irq_control);
1698 xhci_writel(xhci, xhci->s3.erst_size, &xhci->ir_set->erst_size);
1699 xhci_write_64(xhci, xhci->s3.erst_base, &xhci->ir_set->erst_base);
1700 + xhci_write_64(xhci, xhci->s3.erst_dequeue, &xhci->ir_set->erst_dequeue);
1701 + xhci_writel(xhci, xhci->s3.irq_pending, &xhci->ir_set->irq_pending);
1702 + xhci_writel(xhci, xhci->s3.irq_control, &xhci->ir_set->irq_control);
1703 }
1704
1705 static void xhci_set_cmd_ring_deq(struct xhci_hcd *xhci)
1706 diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
1707 index 3e7c3a6..dfd260a 100644
1708 --- a/drivers/usb/host/xhci.h
1709 +++ b/drivers/usb/host/xhci.h
1710 @@ -205,6 +205,10 @@ struct xhci_op_regs {
1711 #define CMD_PM_INDEX (1 << 11)
1712 /* bits 12:31 are reserved (and should be preserved on writes). */
1713
1714 +/* IMAN - Interrupt Management Register */
1715 +#define IMAN_IP (1 << 1)
1716 +#define IMAN_IE (1 << 0)
1717 +
1718 /* USBSTS - USB status - status bitmasks */
1719 /* HC not running - set to 1 when run/stop bit is cleared. */
1720 #define STS_HALT XHCI_STS_HALT
1721 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1722 index 54898c9..cbe3451 100644
1723 --- a/drivers/usb/serial/option.c
1724 +++ b/drivers/usb/serial/option.c
1725 @@ -708,6 +708,7 @@ static const struct usb_device_id option_ids[] = {
1726 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) },
1727 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) },
1728 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) },
1729 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED) },
1730 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED3) },
1731 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED4) },
1732 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED5) },
1733 diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
1734 index d44c669..5aa7172 100644
1735 --- a/drivers/usb/serial/pl2303.c
1736 +++ b/drivers/usb/serial/pl2303.c
1737 @@ -424,7 +424,7 @@ static void pl2303_set_termios(struct tty_struct *tty,
1738 control = priv->line_control;
1739 if ((cflag & CBAUD) == B0)
1740 priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS);
1741 - else
1742 + else if ((old_termios->c_cflag & CBAUD) == B0)
1743 priv->line_control |= (CONTROL_DTR | CONTROL_RTS);
1744 if (control != priv->line_control) {
1745 control = priv->line_control;
1746 diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
1747 index d5d136a..3781bdd 100644
1748 --- a/drivers/usb/serial/sierra.c
1749 +++ b/drivers/usb/serial/sierra.c
1750 @@ -289,6 +289,7 @@ static const struct usb_device_id id_table[] = {
1751 { USB_DEVICE(0x1199, 0x6856) }, /* Sierra Wireless AirCard 881 U */
1752 { USB_DEVICE(0x1199, 0x6859) }, /* Sierra Wireless AirCard 885 E */
1753 { USB_DEVICE(0x1199, 0x685A) }, /* Sierra Wireless AirCard 885 E */
1754 + { USB_DEVICE(0x1199, 0x68A2) }, /* Sierra Wireless MC7710 */
1755 /* Sierra Wireless C885 */
1756 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6880, 0xFF, 0xFF, 0xFF)},
1757 /* Sierra Wireless C888, Air Card 501, USB 303, USB 304 */
1758 diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
1759 index 1c03130..5d7b71b 100644
1760 --- a/drivers/usb/serial/usb-serial.c
1761 +++ b/drivers/usb/serial/usb-serial.c
1762 @@ -1059,6 +1059,12 @@ int usb_serial_probe(struct usb_interface *interface,
1763 serial->attached = 1;
1764 }
1765
1766 + /* Avoid race with tty_open and serial_install by setting the
1767 + * disconnected flag and not clearing it until all ports have been
1768 + * registered.
1769 + */
1770 + serial->disconnected = 1;
1771 +
1772 if (get_free_serial(serial, num_ports, &minor) == NULL) {
1773 dev_err(&interface->dev, "No more free serial devices\n");
1774 goto probe_error;
1775 @@ -1083,6 +1089,8 @@ int usb_serial_probe(struct usb_interface *interface,
1776 }
1777 }
1778
1779 + serial->disconnected = 0;
1780 +
1781 usb_serial_console_init(debug, minor);
1782
1783 exit:
1784 diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
1785 index 7f8472c..8813588 100644
1786 --- a/drivers/video/uvesafb.c
1787 +++ b/drivers/video/uvesafb.c
1788 @@ -815,8 +815,15 @@ static int __devinit uvesafb_vbe_init(struct fb_info *info)
1789 par->pmi_setpal = pmi_setpal;
1790 par->ypan = ypan;
1791
1792 - if (par->pmi_setpal || par->ypan)
1793 - uvesafb_vbe_getpmi(task, par);
1794 + if (par->pmi_setpal || par->ypan) {
1795 + if (__supported_pte_mask & _PAGE_NX) {
1796 + par->pmi_setpal = par->ypan = 0;
1797 + printk(KERN_WARNING "uvesafb: NX protection is actively."
1798 + "We have better not to use the PMI.\n");
1799 + } else {
1800 + uvesafb_vbe_getpmi(task, par);
1801 + }
1802 + }
1803 #else
1804 /* The protected mode interface is not available on non-x86. */
1805 par->pmi_setpal = par->ypan = 0;
1806 diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
1807 index 0c20227..e543734 100644
1808 --- a/include/net/bluetooth/hci.h
1809 +++ b/include/net/bluetooth/hci.h
1810 @@ -84,6 +84,7 @@ enum {
1811 HCI_SERVICE_CACHE,
1812 HCI_LINK_KEYS,
1813 HCI_DEBUG_KEYS,
1814 + HCI_UNREGISTER,
1815
1816 HCI_RESET,
1817 };
1818 diff --git a/kernel/futex.c b/kernel/futex.c
1819 index a2a01ef..11e8924 100644
1820 --- a/kernel/futex.c
1821 +++ b/kernel/futex.c
1822 @@ -59,6 +59,7 @@
1823 #include <linux/magic.h>
1824 #include <linux/pid.h>
1825 #include <linux/nsproxy.h>
1826 +#include <linux/ptrace.h>
1827
1828 #include <asm/futex.h>
1829
1830 @@ -2443,40 +2444,29 @@ SYSCALL_DEFINE3(get_robust_list, int, pid,
1831 {
1832 struct robust_list_head __user *head;
1833 unsigned long ret;
1834 - const struct cred *cred = current_cred(), *pcred;
1835 + struct task_struct *p;
1836
1837 if (!futex_cmpxchg_enabled)
1838 return -ENOSYS;
1839
1840 + rcu_read_lock();
1841 +
1842 + ret = -ESRCH;
1843 if (!pid)
1844 - head = current->robust_list;
1845 + p = current;
1846 else {
1847 - struct task_struct *p;
1848 -
1849 - ret = -ESRCH;
1850 - rcu_read_lock();
1851 p = find_task_by_vpid(pid);
1852 if (!p)
1853 goto err_unlock;
1854 - ret = -EPERM;
1855 - pcred = __task_cred(p);
1856 - /* If victim is in different user_ns, then uids are not
1857 - comparable, so we must have CAP_SYS_PTRACE */
1858 - if (cred->user->user_ns != pcred->user->user_ns) {
1859 - if (!ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
1860 - goto err_unlock;
1861 - goto ok;
1862 - }
1863 - /* If victim is in same user_ns, then uids are comparable */
1864 - if (cred->euid != pcred->euid &&
1865 - cred->euid != pcred->uid &&
1866 - !ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
1867 - goto err_unlock;
1868 -ok:
1869 - head = p->robust_list;
1870 - rcu_read_unlock();
1871 }
1872
1873 + ret = -EPERM;
1874 + if (!ptrace_may_access(p, PTRACE_MODE_READ))
1875 + goto err_unlock;
1876 +
1877 + head = p->robust_list;
1878 + rcu_read_unlock();
1879 +
1880 if (put_user(sizeof(*head), len_ptr))
1881 return -EFAULT;
1882 return put_user(head, head_ptr);
1883 diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
1884 index 5f9e689..a9642d5 100644
1885 --- a/kernel/futex_compat.c
1886 +++ b/kernel/futex_compat.c
1887 @@ -10,6 +10,7 @@
1888 #include <linux/compat.h>
1889 #include <linux/nsproxy.h>
1890 #include <linux/futex.h>
1891 +#include <linux/ptrace.h>
1892
1893 #include <asm/uaccess.h>
1894
1895 @@ -136,40 +137,29 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
1896 {
1897 struct compat_robust_list_head __user *head;
1898 unsigned long ret;
1899 - const struct cred *cred = current_cred(), *pcred;
1900 + struct task_struct *p;
1901
1902 if (!futex_cmpxchg_enabled)
1903 return -ENOSYS;
1904
1905 + rcu_read_lock();
1906 +
1907 + ret = -ESRCH;
1908 if (!pid)
1909 - head = current->compat_robust_list;
1910 + p = current;
1911 else {
1912 - struct task_struct *p;
1913 -
1914 - ret = -ESRCH;
1915 - rcu_read_lock();
1916 p = find_task_by_vpid(pid);
1917 if (!p)
1918 goto err_unlock;
1919 - ret = -EPERM;
1920 - pcred = __task_cred(p);
1921 - /* If victim is in different user_ns, then uids are not
1922 - comparable, so we must have CAP_SYS_PTRACE */
1923 - if (cred->user->user_ns != pcred->user->user_ns) {
1924 - if (!ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
1925 - goto err_unlock;
1926 - goto ok;
1927 - }
1928 - /* If victim is in same user_ns, then uids are comparable */
1929 - if (cred->euid != pcred->euid &&
1930 - cred->euid != pcred->uid &&
1931 - !ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
1932 - goto err_unlock;
1933 -ok:
1934 - head = p->compat_robust_list;
1935 - rcu_read_unlock();
1936 }
1937
1938 + ret = -EPERM;
1939 + if (!ptrace_may_access(p, PTRACE_MODE_READ))
1940 + goto err_unlock;
1941 +
1942 + head = p->compat_robust_list;
1943 + rcu_read_unlock();
1944 +
1945 if (put_user(sizeof(*head), len_ptr))
1946 return -EFAULT;
1947 return put_user(ptr_to_compat(head), head_ptr);
1948 diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
1949 index d5097c4..c473ce2 100644
1950 --- a/kernel/time/tick-sched.c
1951 +++ b/kernel/time/tick-sched.c
1952 @@ -484,9 +484,9 @@ static void tick_nohz_restart(struct tick_sched *ts, ktime_t now)
1953 hrtimer_get_expires(&ts->sched_timer), 0))
1954 break;
1955 }
1956 - /* Update jiffies and reread time */
1957 - tick_do_update_jiffies64(now);
1958 + /* Reread time and update jiffies */
1959 now = ktime_get();
1960 + tick_do_update_jiffies64(now);
1961 }
1962 }
1963
1964 diff --git a/mm/hugetlb.c b/mm/hugetlb.c
1965 index f9c5849..f7001ac 100644
1966 --- a/mm/hugetlb.c
1967 +++ b/mm/hugetlb.c
1968 @@ -2679,6 +2679,7 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
1969 * so no worry about deadlock.
1970 */
1971 page = pte_page(entry);
1972 + get_page(page);
1973 if (page != pagecache_page)
1974 lock_page(page);
1975
1976 @@ -2710,6 +2711,7 @@ out_page_table_lock:
1977 }
1978 if (page != pagecache_page)
1979 unlock_page(page);
1980 + put_page(page);
1981
1982 out_mutex:
1983 mutex_unlock(&hugetlb_instantiation_mutex);
1984 diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
1985 index 815269b..cb9cb48 100644
1986 --- a/net/bluetooth/hci_core.c
1987 +++ b/net/bluetooth/hci_core.c
1988 @@ -509,6 +509,11 @@ int hci_dev_open(__u16 dev)
1989
1990 hci_req_lock(hdev);
1991
1992 + if (test_bit(HCI_UNREGISTER, &hdev->flags)) {
1993 + ret = -ENODEV;
1994 + goto done;
1995 + }
1996 +
1997 if (hdev->rfkill && rfkill_blocked(hdev->rfkill)) {
1998 ret = -ERFKILL;
1999 goto done;
2000 @@ -1317,6 +1322,8 @@ int hci_unregister_dev(struct hci_dev *hdev)
2001
2002 BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus);
2003
2004 + set_bit(HCI_UNREGISTER, &hdev->flags);
2005 +
2006 write_lock_bh(&hci_dev_list_lock);
2007 list_del(&hdev->list);
2008 write_unlock_bh(&hci_dev_list_lock);
2009 diff --git a/security/commoncap.c b/security/commoncap.c
2010 index a93b3b7..44f0969 100644
2011 --- a/security/commoncap.c
2012 +++ b/security/commoncap.c
2013 @@ -28,6 +28,7 @@
2014 #include <linux/prctl.h>
2015 #include <linux/securebits.h>
2016 #include <linux/user_namespace.h>
2017 +#include <linux/personality.h>
2018
2019 /*
2020 * If a non-root user executes a setuid-root binary in
2021 @@ -510,6 +511,11 @@ int cap_bprm_set_creds(struct linux_binprm *bprm)
2022 }
2023 skip:
2024
2025 + /* if we have fs caps, clear dangerous personality flags */
2026 + if (!cap_issubset(new->cap_permitted, old->cap_permitted))
2027 + bprm->per_clear |= PER_CLEAR_ON_SETID;
2028 +
2029 +
2030 /* Don't let someone trace a set[ug]id/setpcap binary with the revised
2031 * credentials unless they have the appropriate permit
2032 */
2033 diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
2034 index 627a02e..d25fded 100644
2035 --- a/tools/perf/util/hist.c
2036 +++ b/tools/perf/util/hist.c
2037 @@ -158,6 +158,18 @@ struct hist_entry *__hists__add_entry(struct hists *self,
2038 if (!cmp) {
2039 he->period += period;
2040 ++he->nr_events;
2041 +
2042 + /* If the map of an existing hist_entry has
2043 + * become out-of-date due to an exec() or
2044 + * similar, update it. Otherwise we will
2045 + * mis-adjust symbol addresses when computing
2046 + * the history counter to increment.
2047 + */
2048 + if (he->ms.map != entry->ms.map) {
2049 + he->ms.map = entry->ms.map;
2050 + if (he->ms.map)
2051 + he->ms.map->referenced = true;
2052 + }
2053 goto out;
2054 }
2055

  ViewVC Help
Powered by ViewVC 1.1.20