Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Conflicts:
drivers/net/team/team.c
drivers/net/usb/qmi_wwan.c
net/batman-adv/bat_iv_ogm.c
net/ipv4/fib_frontend.c
net/ipv4/route.c
net/l2tp/l2tp_netlink.c

The team, fib_frontend, route, and l2tp_netlink conflicts were simply
overlapping changes.

qmi_wwan and bat_iv_ogm were of the "use HEAD" variety.

With help from Antonio Quartulli.

Signed-off-by: David S. Miller <davem@davemloft.net>

+2451 -1633
+1 -1
Documentation/vfio.txt
··· 133 133 $ lspci -n -s 0000:06:0d.0 134 134 06:0d.0 0401: 1102:0002 (rev 08) 135 135 # echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind 136 - # echo 1102 0002 > /sys/bus/pci/drivers/vfio/new_id 136 + # echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id 137 137 138 138 Now we need to look at what other devices are in the group to free 139 139 it for use by VFIO:
+9 -5
MAINTAINERS
··· 3552 3552 3553 3553 INTEL C600 SERIES SAS CONTROLLER DRIVER 3554 3554 M: Intel SCU Linux support <intel-linux-scu@intel.com> 3555 + M: Lukasz Dorau <lukasz.dorau@intel.com> 3556 + M: Maciej Patelczyk <maciej.patelczyk@intel.com> 3555 3557 M: Dave Jiang <dave.jiang@intel.com> 3556 - M: Ed Nadolski <edmund.nadolski@intel.com> 3557 3558 L: linux-scsi@vger.kernel.org 3558 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git 3559 - S: Maintained 3559 + T: git git://git.code.sf.net/p/intel-sas/isci 3560 + S: Supported 3560 3561 F: drivers/scsi/isci/ 3561 3562 F: firmware/isci/ 3562 3563 ··· 3667 3666 F: drivers/net/wireless/ipw2x00/ 3668 3667 3669 3668 INTEL(R) TRUSTED EXECUTION TECHNOLOGY (TXT) 3670 - M: Joseph Cihula <joseph.cihula@intel.com> 3669 + M: Richard L Maliszewski <richard.l.maliszewski@intel.com> 3670 + M: Gang Wei <gang.wei@intel.com> 3671 3671 M: Shane Wang <shane.wang@intel.com> 3672 3672 L: tboot-devel@lists.sourceforge.net 3673 3673 W: http://tboot.sourceforge.net 3674 - T: Mercurial http://www.bughost.org/repos.hg/tboot.hg 3674 + T: hg http://tboot.hg.sourceforge.net:8000/hgroot/tboot/tboot 3675 3675 S: Supported 3676 3676 F: Documentation/intel_txt.txt 3677 3677 F: include/linux/tboot.h ··· 5545 5543 F: include/linux/pwm.h 5546 5544 F: include/linux/of_pwm.h 5547 5545 F: drivers/pwm/ 5546 + F: drivers/video/backlight/pwm_bl.c 5547 + F: include/linux/pwm_backlight.h 5548 5548 5549 5549 PXA2xx/PXA3xx SUPPORT 5550 5550 M: Eric Miao <eric.y.miao@gmail.com>
+2 -2
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 6 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc5 5 - NAME = Saber-toothed Squirrel 4 + EXTRAVERSION = -rc7 5 + NAME = Terrified Chipmunk 6 6 7 7 # *DOCUMENTATION* 8 8 # To see a list of typical targets execute "make help"
+1
arch/arm/boot/compressed/head.S
··· 653 653 mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs 654 654 #endif 655 655 mrc p15, 0, r0, c1, c0, 0 @ read control reg 656 + bic r0, r0, #1 << 28 @ clear SCTLR.TRE 656 657 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement 657 658 orr r0, r0, #0x003c @ write buffer 658 659 #ifdef CONFIG_MMU
+3
arch/arm/boot/dts/at91sam9260.dtsi
··· 104 104 #gpio-cells = <2>; 105 105 gpio-controller; 106 106 interrupt-controller; 107 + #interrupt-cells = <2>; 107 108 }; 108 109 109 110 pioB: gpio@fffff600 { ··· 114 113 #gpio-cells = <2>; 115 114 gpio-controller; 116 115 interrupt-controller; 116 + #interrupt-cells = <2>; 117 117 }; 118 118 119 119 pioC: gpio@fffff800 { ··· 124 122 #gpio-cells = <2>; 125 123 gpio-controller; 126 124 interrupt-controller; 125 + #interrupt-cells = <2>; 127 126 }; 128 127 129 128 dbgu: serial@fffff200 {
+5
arch/arm/boot/dts/at91sam9263.dtsi
··· 95 95 #gpio-cells = <2>; 96 96 gpio-controller; 97 97 interrupt-controller; 98 + #interrupt-cells = <2>; 98 99 }; 99 100 100 101 pioB: gpio@fffff400 { ··· 105 104 #gpio-cells = <2>; 106 105 gpio-controller; 107 106 interrupt-controller; 107 + #interrupt-cells = <2>; 108 108 }; 109 109 110 110 pioC: gpio@fffff600 { ··· 115 113 #gpio-cells = <2>; 116 114 gpio-controller; 117 115 interrupt-controller; 116 + #interrupt-cells = <2>; 118 117 }; 119 118 120 119 pioD: gpio@fffff800 { ··· 125 122 #gpio-cells = <2>; 126 123 gpio-controller; 127 124 interrupt-controller; 125 + #interrupt-cells = <2>; 128 126 }; 129 127 130 128 pioE: gpio@fffffa00 { ··· 135 131 #gpio-cells = <2>; 136 132 gpio-controller; 137 133 interrupt-controller; 134 + #interrupt-cells = <2>; 138 135 }; 139 136 140 137 dbgu: serial@ffffee00 {
+5
arch/arm/boot/dts/at91sam9g45.dtsi
··· 113 113 #gpio-cells = <2>; 114 114 gpio-controller; 115 115 interrupt-controller; 116 + #interrupt-cells = <2>; 116 117 }; 117 118 118 119 pioB: gpio@fffff400 { ··· 123 122 #gpio-cells = <2>; 124 123 gpio-controller; 125 124 interrupt-controller; 125 + #interrupt-cells = <2>; 126 126 }; 127 127 128 128 pioC: gpio@fffff600 { ··· 133 131 #gpio-cells = <2>; 134 132 gpio-controller; 135 133 interrupt-controller; 134 + #interrupt-cells = <2>; 136 135 }; 137 136 138 137 pioD: gpio@fffff800 { ··· 143 140 #gpio-cells = <2>; 144 141 gpio-controller; 145 142 interrupt-controller; 143 + #interrupt-cells = <2>; 146 144 }; 147 145 148 146 pioE: gpio@fffffa00 { ··· 153 149 #gpio-cells = <2>; 154 150 gpio-controller; 155 151 interrupt-controller; 152 + #interrupt-cells = <2>; 156 153 }; 157 154 158 155 dbgu: serial@ffffee00 {
+4
arch/arm/boot/dts/at91sam9n12.dtsi
··· 107 107 #gpio-cells = <2>; 108 108 gpio-controller; 109 109 interrupt-controller; 110 + #interrupt-cells = <2>; 110 111 }; 111 112 112 113 pioB: gpio@fffff600 { ··· 117 116 #gpio-cells = <2>; 118 117 gpio-controller; 119 118 interrupt-controller; 119 + #interrupt-cells = <2>; 120 120 }; 121 121 122 122 pioC: gpio@fffff800 { ··· 127 125 #gpio-cells = <2>; 128 126 gpio-controller; 129 127 interrupt-controller; 128 + #interrupt-cells = <2>; 130 129 }; 131 130 132 131 pioD: gpio@fffffa00 { ··· 137 134 #gpio-cells = <2>; 138 135 gpio-controller; 139 136 interrupt-controller; 137 + #interrupt-cells = <2>; 140 138 }; 141 139 142 140 dbgu: serial@fffff200 {
+4
arch/arm/boot/dts/at91sam9x5.dtsi
··· 115 115 #gpio-cells = <2>; 116 116 gpio-controller; 117 117 interrupt-controller; 118 + #interrupt-cells = <2>; 118 119 }; 119 120 120 121 pioB: gpio@fffff600 { ··· 125 124 #gpio-cells = <2>; 126 125 gpio-controller; 127 126 interrupt-controller; 127 + #interrupt-cells = <2>; 128 128 }; 129 129 130 130 pioC: gpio@fffff800 { ··· 135 133 #gpio-cells = <2>; 136 134 gpio-controller; 137 135 interrupt-controller; 136 + #interrupt-cells = <2>; 138 137 }; 139 138 140 139 pioD: gpio@fffffa00 { ··· 145 142 #gpio-cells = <2>; 146 143 gpio-controller; 147 144 interrupt-controller; 145 + #interrupt-cells = <2>; 148 146 }; 149 147 150 148 dbgu: serial@fffff200 {
+2
arch/arm/include/asm/unistd.h
··· 404 404 #define __NR_setns (__NR_SYSCALL_BASE+375) 405 405 #define __NR_process_vm_readv (__NR_SYSCALL_BASE+376) 406 406 #define __NR_process_vm_writev (__NR_SYSCALL_BASE+377) 407 + /* 378 for kcmp */ 407 408 408 409 /* 409 410 * The following SWIs are ARM private. ··· 484 483 */ 485 484 #define __IGNORE_fadvise64_64 486 485 #define __IGNORE_migrate_pages 486 + #define __IGNORE_kcmp 487 487 488 488 #endif /* __KERNEL__ */ 489 489 #endif /* __ASM_ARM_UNISTD_H */
+1
arch/arm/kernel/calls.S
··· 387 387 /* 375 */ CALL(sys_setns) 388 388 CALL(sys_process_vm_readv) 389 389 CALL(sys_process_vm_writev) 390 + CALL(sys_ni_syscall) /* reserved for sys_kcmp */ 390 391 #ifndef syscalls_counted 391 392 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls 392 393 #define syscalls_counted
+46 -2
arch/arm/kernel/smp_twd.c
··· 11 11 #include <linux/init.h> 12 12 #include <linux/kernel.h> 13 13 #include <linux/clk.h> 14 - #include <linux/cpufreq.h> 15 14 #include <linux/delay.h> 16 15 #include <linux/device.h> 17 16 #include <linux/err.h> ··· 95 96 disable_percpu_irq(clk->irq); 96 97 } 97 98 98 - #ifdef CONFIG_CPU_FREQ 99 + #ifdef CONFIG_COMMON_CLK 100 + 101 + /* 102 + * Updates clockevent frequency when the cpu frequency changes. 103 + * Called on the cpu that is changing frequency with interrupts disabled. 104 + */ 105 + static void twd_update_frequency(void *new_rate) 106 + { 107 + twd_timer_rate = *((unsigned long *) new_rate); 108 + 109 + clockevents_update_freq(*__this_cpu_ptr(twd_evt), twd_timer_rate); 110 + } 111 + 112 + static int twd_rate_change(struct notifier_block *nb, 113 + unsigned long flags, void *data) 114 + { 115 + struct clk_notifier_data *cnd = data; 116 + 117 + /* 118 + * The twd clock events must be reprogrammed to account for the new 119 + * frequency. The timer is local to a cpu, so cross-call to the 120 + * changing cpu. 121 + */ 122 + if (flags == POST_RATE_CHANGE) 123 + smp_call_function(twd_update_frequency, 124 + (void *)&cnd->new_rate, 1); 125 + 126 + return NOTIFY_OK; 127 + } 128 + 129 + static struct notifier_block twd_clk_nb = { 130 + .notifier_call = twd_rate_change, 131 + }; 132 + 133 + static int twd_clk_init(void) 134 + { 135 + if (twd_evt && *__this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk)) 136 + return clk_notifier_register(twd_clk, &twd_clk_nb); 137 + 138 + return 0; 139 + } 140 + core_initcall(twd_clk_init); 141 + 142 + #elif defined (CONFIG_CPU_FREQ) 143 + 144 + #include <linux/cpufreq.h> 99 145 100 146 /* 101 147 * Updates clockevent frequency when the cpu frequency changes.
+1 -1
arch/arm/mach-imx/clk-imx25.c
··· 241 241 clk_register_clkdev(clk[sdma_ahb], "ahb", "imx35-sdma"); 242 242 clk_register_clkdev(clk[iim_ipg], "iim", NULL); 243 243 244 - mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); 244 + mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), MX25_INT_GPT1); 245 245 return 0; 246 246 }
+2 -1
arch/arm/mach-imx/mach-armadillo5x0.c
··· 526 526 imx31_add_mxc_nand(&armadillo5x0_nand_board_info); 527 527 528 528 /* set NAND page size to 2k if not configured via boot mode pins */ 529 - __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); 529 + __raw_writel(__raw_readl(mx3_ccm_base + MXC_CCM_RCSR) | 530 + (1 << 30), mx3_ccm_base + MXC_CCM_RCSR); 530 531 531 532 /* RTC */ 532 533 /* Get RTC IRQ and register the chip */
+1 -1
arch/arm/mach-mxs/mach-mxs.c
··· 261 261 enable_clk_enet_out(); 262 262 263 263 if (IS_BUILTIN(CONFIG_PHYLIB)) 264 - phy_register_fixup_for_uid(PHY_ID_KS8051, MICREL_PHY_ID_MASK, 264 + phy_register_fixup_for_uid(PHY_ID_KSZ8051, MICREL_PHY_ID_MASK, 265 265 apx4devkit_phy_fixup); 266 266 267 267 mxsfb_pdata.mode_list = apx4devkit_video_modes;
+7
arch/arm/mach-orion5x/common.c
··· 204 204 void __init orion5x_init_early(void) 205 205 { 206 206 orion_time_set_base(TIMER_VIRT_BASE); 207 + 208 + /* 209 + * Some Orion5x devices allocate their coherent buffers from atomic 210 + * context. Increase size of atomic coherent pool to make sure such 211 + * the allocations won't fail. 212 + */ 213 + init_dma_coherent_pool_size(SZ_1M); 207 214 } 208 215 209 216 int orion5x_tclk;
+2 -2
arch/arm/mach-shmobile/board-kzm9g.c
··· 346 346 .flags = IORESOURCE_MEM, 347 347 }, 348 348 [1] = { 349 - .start = gic_spi(141), 349 + .start = gic_spi(140), 350 350 .flags = IORESOURCE_IRQ, 351 351 }, 352 352 [2] = { 353 - .start = gic_spi(140), 353 + .start = gic_spi(141), 354 354 .flags = IORESOURCE_IRQ, 355 355 }, 356 356 };
+2
arch/arm/mm/dma-mapping.c
··· 346 346 (unsigned)pool->size / 1024); 347 347 return 0; 348 348 } 349 + 350 + kfree(pages); 349 351 no_pages: 350 352 kfree(bitmap); 351 353 no_bitmap:
+1
arch/arm/plat-mxc/include/mach/mx25.h
··· 98 98 #define MX25_INT_UART1 (NR_IRQS_LEGACY + 45) 99 99 #define MX25_INT_GPIO2 (NR_IRQS_LEGACY + 51) 100 100 #define MX25_INT_GPIO1 (NR_IRQS_LEGACY + 52) 101 + #define MX25_INT_GPT1 (NR_IRQS_LEGACY + 54) 101 102 #define MX25_INT_FEC (NR_IRQS_LEGACY + 57) 102 103 103 104 #define MX25_DMA_REQ_SSI2_RX1 22
+6 -4
arch/arm/plat-samsung/clock.c
··· 144 144 145 145 int clk_set_rate(struct clk *clk, unsigned long rate) 146 146 { 147 + unsigned long flags; 147 148 int ret; 148 149 149 150 if (IS_ERR(clk)) ··· 160 159 if (clk->ops == NULL || clk->ops->set_rate == NULL) 161 160 return -EINVAL; 162 161 163 - spin_lock(&clocks_lock); 162 + spin_lock_irqsave(&clocks_lock, flags); 164 163 ret = (clk->ops->set_rate)(clk, rate); 165 - spin_unlock(&clocks_lock); 164 + spin_unlock_irqrestore(&clocks_lock, flags); 166 165 167 166 return ret; 168 167 } ··· 174 173 175 174 int clk_set_parent(struct clk *clk, struct clk *parent) 176 175 { 176 + unsigned long flags; 177 177 int ret = 0; 178 178 179 179 if (IS_ERR(clk)) 180 180 return -EINVAL; 181 181 182 - spin_lock(&clocks_lock); 182 + spin_lock_irqsave(&clocks_lock, flags); 183 183 184 184 if (clk->ops && clk->ops->set_parent) 185 185 ret = (clk->ops->set_parent)(clk, parent); 186 186 187 - spin_unlock(&clocks_lock); 187 + spin_unlock_irqrestore(&clocks_lock, flags); 188 188 189 189 return ret; 190 190 }
+1
arch/c6x/include/asm/Kbuild
··· 2 2 3 3 generic-y += atomic.h 4 4 generic-y += auxvec.h 5 + generic-y += barrier.h 5 6 generic-y += bitsperlong.h 6 7 generic-y += bugs.h 7 8 generic-y += cputime.h
-27
arch/c6x/include/asm/barrier.h
··· 1 - /* 2 - * Port on Texas Instruments TMS320C6x architecture 3 - * 4 - * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated 5 - * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com) 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 - */ 11 - #ifndef _ASM_C6X_BARRIER_H 12 - #define _ASM_C6X_BARRIER_H 13 - 14 - #define nop() asm("NOP\n"); 15 - 16 - #define mb() barrier() 17 - #define rmb() barrier() 18 - #define wmb() barrier() 19 - #define set_mb(var, value) do { var = value; mb(); } while (0) 20 - #define set_wmb(var, value) do { var = value; wmb(); } while (0) 21 - 22 - #define smp_mb() barrier() 23 - #define smp_rmb() barrier() 24 - #define smp_wmb() barrier() 25 - #define smp_read_barrier_depends() do { } while (0) 26 - 27 - #endif /* _ASM_C6X_BARRIER_H */
-6
arch/m68k/platform/coldfire/clk.c
··· 146 146 }; 147 147 #endif /* MCFPM_PPMCR1 */ 148 148 #endif /* MCFPM_PPMCR0 */ 149 - 150 - struct clk *devm_clk_get(struct device *dev, const char *id) 151 - { 152 - return NULL; 153 - } 154 - EXPORT_SYMBOL(devm_clk_get);
+1 -1
arch/mips/kernel/smp-cmp.c
··· 102 102 c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE; 103 103 #endif 104 104 #ifdef CONFIG_MIPS_MT_SMTC 105 - c->tc_id = (read_c0_tcbind() >> TCBIND_CURTC_SHIFT) & TCBIND_CURTC; 105 + c->tc_id = (read_c0_tcbind() & TCBIND_CURTC) >> TCBIND_CURTC_SHIFT; 106 106 #endif 107 107 } 108 108
+2
arch/mips/mm/gup.c
··· 152 152 do { 153 153 VM_BUG_ON(compound_head(page) != head); 154 154 pages[*nr] = page; 155 + if (PageTail(page)) 156 + get_huge_page_tail(page); 155 157 (*nr)++; 156 158 page++; 157 159 refs++;
+6 -3
arch/mips/mti-malta/malta-int.c
··· 273 273 unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; 274 274 int irq; 275 275 276 + if (unlikely(!pending)) { 277 + spurious_interrupt(); 278 + return; 279 + } 280 + 276 281 irq = irq_ffs(pending); 277 282 278 283 if (irq == MIPSCPU_INT_I8259A) 279 284 malta_hw0_irqdispatch(); 280 285 else if (gic_present && ((1 << irq) & ipi_map[smp_processor_id()])) 281 286 malta_ipi_irqdispatch(); 282 - else if (irq >= 0) 283 - do_IRQ(MIPS_CPU_IRQ_BASE + irq); 284 287 else 285 - spurious_interrupt(); 288 + do_IRQ(MIPS_CPU_IRQ_BASE + irq); 286 289 } 287 290 288 291 #ifdef CONFIG_MIPS_MT_SMP
-5
arch/mips/mti-malta/malta-platform.c
··· 138 138 if (err) 139 139 return err; 140 140 141 - /* 142 - * Set RTC to BCD mode to support current alarm code. 143 - */ 144 - CMOS_WRITE(CMOS_READ(RTC_CONTROL) & ~RTC_DM_BINARY, RTC_CONTROL); 145 - 146 141 return 0; 147 142 } 148 143
+10 -14
arch/s390/include/asm/hugetlb.h
··· 66 66 return pte; 67 67 } 68 68 69 - static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, 70 - unsigned long addr, pte_t *ptep) 71 - { 72 - pte_t pte = huge_ptep_get(ptep); 73 - 74 - mm->context.flush_mm = 1; 75 - pmd_clear((pmd_t *) ptep); 76 - return pte; 77 - } 78 - 79 69 static inline void __pmd_csp(pmd_t *pmdp) 80 70 { 81 71 register unsigned long reg2 asm("2") = pmd_val(*pmdp); ··· 107 117 __pmd_csp(pmdp); 108 118 } 109 119 120 + static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, 121 + unsigned long addr, pte_t *ptep) 122 + { 123 + pte_t pte = huge_ptep_get(ptep); 124 + 125 + huge_ptep_invalidate(mm, addr, ptep); 126 + return pte; 127 + } 128 + 110 129 #define huge_ptep_set_access_flags(__vma, __addr, __ptep, __entry, __dirty) \ 111 130 ({ \ 112 131 int __changed = !pte_same(huge_ptep_get(__ptep), __entry); \ ··· 130 131 ({ \ 131 132 pte_t __pte = huge_ptep_get(__ptep); \ 132 133 if (pte_write(__pte)) { \ 133 - (__mm)->context.flush_mm = 1; \ 134 - if (atomic_read(&(__mm)->context.attach_count) > 1 || \ 135 - (__mm) != current->active_mm) \ 136 - huge_ptep_invalidate(__mm, __addr, __ptep); \ 134 + huge_ptep_invalidate(__mm, __addr, __ptep); \ 137 135 set_huge_pte_at(__mm, __addr, __ptep, \ 138 136 huge_pte_wrprotect(__pte)); \ 139 137 } \
-2
arch/s390/include/asm/tlbflush.h
··· 90 90 91 91 static inline void __tlb_flush_mm_cond(struct mm_struct * mm) 92 92 { 93 - spin_lock(&mm->page_table_lock); 94 93 if (mm->context.flush_mm) { 95 94 __tlb_flush_mm(mm); 96 95 mm->context.flush_mm = 0; 97 96 } 98 - spin_unlock(&mm->page_table_lock); 99 97 } 100 98 101 99 /*
+2
arch/s390/kernel/setup.c
··· 974 974 if (MACHINE_HAS_HPAGE) 975 975 elf_hwcap |= HWCAP_S390_HPAGE; 976 976 977 + #if defined(CONFIG_64BIT) 977 978 /* 978 979 * 64-bit register support for 31-bit processes 979 980 * HWCAP_S390_HIGH_GPRS is bit 9. 980 981 */ 981 982 elf_hwcap |= HWCAP_S390_HIGH_GPRS; 983 + #endif 982 984 983 985 get_cpu_id(&cpu_id); 984 986 switch (cpu_id.machine) {
+63 -79
arch/s390/lib/uaccess_pt.c
··· 2 2 * User access functions based on page table walks for enhanced 3 3 * system layout without hardware support. 4 4 * 5 - * Copyright IBM Corp. 2006 5 + * Copyright IBM Corp. 2006, 2012 6 6 * Author(s): Gerald Schaefer (gerald.schaefer@de.ibm.com) 7 7 */ 8 8 9 9 #include <linux/errno.h> 10 10 #include <linux/hardirq.h> 11 11 #include <linux/mm.h> 12 + #include <linux/hugetlb.h> 12 13 #include <asm/uaccess.h> 13 14 #include <asm/futex.h> 14 15 #include "uaccess.h" 15 16 16 - static inline pte_t *follow_table(struct mm_struct *mm, unsigned long addr) 17 + 18 + /* 19 + * Returns kernel address for user virtual address. If the returned address is 20 + * >= -4095 (IS_ERR_VALUE(x) returns true), a fault has occured and the address 21 + * contains the (negative) exception code. 22 + */ 23 + static __always_inline unsigned long follow_table(struct mm_struct *mm, 24 + unsigned long addr, int write) 17 25 { 18 26 pgd_t *pgd; 19 27 pud_t *pud; 20 28 pmd_t *pmd; 29 + pte_t *ptep; 21 30 22 31 pgd = pgd_offset(mm, addr); 23 32 if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd))) 24 - return (pte_t *) 0x3a; 33 + return -0x3aUL; 25 34 26 35 pud = pud_offset(pgd, addr); 27 36 if (pud_none(*pud) || unlikely(pud_bad(*pud))) 28 - return (pte_t *) 0x3b; 37 + return -0x3bUL; 29 38 30 39 pmd = pmd_offset(pud, addr); 31 - if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd))) 32 - return (pte_t *) 0x10; 40 + if (pmd_none(*pmd)) 41 + return -0x10UL; 42 + if (pmd_huge(*pmd)) { 43 + if (write && (pmd_val(*pmd) & _SEGMENT_ENTRY_RO)) 44 + return -0x04UL; 45 + return (pmd_val(*pmd) & HPAGE_MASK) + (addr & ~HPAGE_MASK); 46 + } 47 + if (unlikely(pmd_bad(*pmd))) 48 + return -0x10UL; 33 49 34 - return pte_offset_map(pmd, addr); 50 + ptep = pte_offset_map(pmd, addr); 51 + if (!pte_present(*ptep)) 52 + return -0x11UL; 53 + if (write && !pte_write(*ptep)) 54 + return -0x04UL; 55 + 56 + return (pte_val(*ptep) & PAGE_MASK) + (addr & ~PAGE_MASK); 35 57 } 36 58 37 59 static __always_inline size_t __user_copy_pt(unsigned long uaddr, void *kptr, 38 60 size_t n, int write_user) 39 61 { 40 62 struct mm_struct *mm = current->mm; 41 - unsigned long offset, pfn, done, size; 42 - pte_t *pte; 63 + unsigned long offset, done, size, kaddr; 43 64 void *from, *to; 44 65 45 66 done = 0; 46 67 retry: 47 68 spin_lock(&mm->page_table_lock); 48 69 do { 49 - pte = follow_table(mm, uaddr); 50 - if ((unsigned long) pte < 0x1000) 70 + kaddr = follow_table(mm, uaddr, write_user); 71 + if (IS_ERR_VALUE(kaddr)) 51 72 goto fault; 52 - if (!pte_present(*pte)) { 53 - pte = (pte_t *) 0x11; 54 - goto fault; 55 - } else if (write_user && !pte_write(*pte)) { 56 - pte = (pte_t *) 0x04; 57 - goto fault; 58 - } 59 73 60 - pfn = pte_pfn(*pte); 61 - offset = uaddr & (PAGE_SIZE - 1); 74 + offset = uaddr & ~PAGE_MASK; 62 75 size = min(n - done, PAGE_SIZE - offset); 63 76 if (write_user) { 64 - to = (void *)((pfn << PAGE_SHIFT) + offset); 77 + to = (void *) kaddr; 65 78 from = kptr + done; 66 79 } else { 67 - from = (void *)((pfn << PAGE_SHIFT) + offset); 80 + from = (void *) kaddr; 68 81 to = kptr + done; 69 82 } 70 83 memcpy(to, from, size); ··· 88 75 return n - done; 89 76 fault: 90 77 spin_unlock(&mm->page_table_lock); 91 - if (__handle_fault(uaddr, (unsigned long) pte, write_user)) 78 + if (__handle_fault(uaddr, -kaddr, write_user)) 92 79 return n - done; 93 80 goto retry; 94 81 } ··· 97 84 * Do DAT for user address by page table walk, return kernel address. 98 85 * This function needs to be called with current->mm->page_table_lock held. 99 86 */ 100 - static __always_inline unsigned long __dat_user_addr(unsigned long uaddr) 87 + static __always_inline unsigned long __dat_user_addr(unsigned long uaddr, 88 + int write) 101 89 { 102 90 struct mm_struct *mm = current->mm; 103 - unsigned long pfn; 104 - pte_t *pte; 91 + unsigned long kaddr; 105 92 int rc; 106 93 107 94 retry: 108 - pte = follow_table(mm, uaddr); 109 - if ((unsigned long) pte < 0x1000) 95 + kaddr = follow_table(mm, uaddr, write); 96 + if (IS_ERR_VALUE(kaddr)) 110 97 goto fault; 111 - if (!pte_present(*pte)) { 112 - pte = (pte_t *) 0x11; 113 - goto fault; 114 - } 115 98 116 - pfn = pte_pfn(*pte); 117 - return (pfn << PAGE_SHIFT) + (uaddr & (PAGE_SIZE - 1)); 99 + return kaddr; 118 100 fault: 119 101 spin_unlock(&mm->page_table_lock); 120 - rc = __handle_fault(uaddr, (unsigned long) pte, 0); 102 + rc = __handle_fault(uaddr, -kaddr, write); 121 103 spin_lock(&mm->page_table_lock); 122 104 if (!rc) 123 105 goto retry; ··· 167 159 168 160 static size_t strnlen_user_pt(size_t count, const char __user *src) 169 161 { 170 - char *addr; 171 162 unsigned long uaddr = (unsigned long) src; 172 163 struct mm_struct *mm = current->mm; 173 - unsigned long offset, pfn, done, len; 174 - pte_t *pte; 164 + unsigned long offset, done, len, kaddr; 175 165 size_t len_str; 176 166 177 167 if (segment_eq(get_fs(), KERNEL_DS)) ··· 178 172 retry: 179 173 spin_lock(&mm->page_table_lock); 180 174 do { 181 - pte = follow_table(mm, uaddr); 182 - if ((unsigned long) pte < 0x1000) 175 + kaddr = follow_table(mm, uaddr, 0); 176 + if (IS_ERR_VALUE(kaddr)) 183 177 goto fault; 184 - if (!pte_present(*pte)) { 185 - pte = (pte_t *) 0x11; 186 - goto fault; 187 - } 188 178 189 - pfn = pte_pfn(*pte); 190 - offset = uaddr & (PAGE_SIZE-1); 191 - addr = (char *)(pfn << PAGE_SHIFT) + offset; 179 + offset = uaddr & ~PAGE_MASK; 192 180 len = min(count - done, PAGE_SIZE - offset); 193 - len_str = strnlen(addr, len); 181 + len_str = strnlen((char *) kaddr, len); 194 182 done += len_str; 195 183 uaddr += len_str; 196 184 } while ((len_str == len) && (done < count)); ··· 192 192 return done + 1; 193 193 fault: 194 194 spin_unlock(&mm->page_table_lock); 195 - if (__handle_fault(uaddr, (unsigned long) pte, 0)) 195 + if (__handle_fault(uaddr, -kaddr, 0)) 196 196 return 0; 197 197 goto retry; 198 198 } ··· 225 225 const void __user *from) 226 226 { 227 227 struct mm_struct *mm = current->mm; 228 - unsigned long offset_from, offset_to, offset_max, pfn_from, pfn_to, 229 - uaddr, done, size, error_code; 228 + unsigned long offset_max, uaddr, done, size, error_code; 230 229 unsigned long uaddr_from = (unsigned long) from; 231 230 unsigned long uaddr_to = (unsigned long) to; 232 - pte_t *pte_from, *pte_to; 231 + unsigned long kaddr_to, kaddr_from; 233 232 int write_user; 234 233 235 234 if (segment_eq(get_fs(), KERNEL_DS)) { ··· 241 242 do { 242 243 write_user = 0; 243 244 uaddr = uaddr_from; 244 - pte_from = follow_table(mm, uaddr_from); 245 - error_code = (unsigned long) pte_from; 246 - if (error_code < 0x1000) 245 + kaddr_from = follow_table(mm, uaddr_from, 0); 246 + error_code = kaddr_from; 247 + if (IS_ERR_VALUE(error_code)) 247 248 goto fault; 248 - if (!pte_present(*pte_from)) { 249 - error_code = 0x11; 250 - goto fault; 251 - } 252 249 253 250 write_user = 1; 254 251 uaddr = uaddr_to; 255 - pte_to = follow_table(mm, uaddr_to); 256 - error_code = (unsigned long) pte_to; 257 - if (error_code < 0x1000) 252 + kaddr_to = follow_table(mm, uaddr_to, 1); 253 + error_code = (unsigned long) kaddr_to; 254 + if (IS_ERR_VALUE(error_code)) 258 255 goto fault; 259 - if (!pte_present(*pte_to)) { 260 - error_code = 0x11; 261 - goto fault; 262 - } else if (!pte_write(*pte_to)) { 263 - error_code = 0x04; 264 - goto fault; 265 - } 266 256 267 - pfn_from = pte_pfn(*pte_from); 268 - pfn_to = pte_pfn(*pte_to); 269 - offset_from = uaddr_from & (PAGE_SIZE-1); 270 - offset_to = uaddr_from & (PAGE_SIZE-1); 271 - offset_max = max(offset_from, offset_to); 257 + offset_max = max(uaddr_from & ~PAGE_MASK, 258 + uaddr_to & ~PAGE_MASK); 272 259 size = min(n - done, PAGE_SIZE - offset_max); 273 260 274 - memcpy((void *)(pfn_to << PAGE_SHIFT) + offset_to, 275 - (void *)(pfn_from << PAGE_SHIFT) + offset_from, size); 261 + memcpy((void *) kaddr_to, (void *) kaddr_from, size); 276 262 done += size; 277 263 uaddr_from += size; 278 264 uaddr_to += size; ··· 266 282 return n - done; 267 283 fault: 268 284 spin_unlock(&mm->page_table_lock); 269 - if (__handle_fault(uaddr, error_code, write_user)) 285 + if (__handle_fault(uaddr, -error_code, write_user)) 270 286 return n - done; 271 287 goto retry; 272 288 } ··· 325 341 return __futex_atomic_op_pt(op, uaddr, oparg, old); 326 342 spin_lock(&current->mm->page_table_lock); 327 343 uaddr = (u32 __force __user *) 328 - __dat_user_addr((__force unsigned long) uaddr); 344 + __dat_user_addr((__force unsigned long) uaddr, 1); 329 345 if (!uaddr) { 330 346 spin_unlock(&current->mm->page_table_lock); 331 347 return -EFAULT; ··· 362 378 return __futex_atomic_cmpxchg_pt(uval, uaddr, oldval, newval); 363 379 spin_lock(&current->mm->page_table_lock); 364 380 uaddr = (u32 __force __user *) 365 - __dat_user_addr((__force unsigned long) uaddr); 381 + __dat_user_addr((__force unsigned long) uaddr, 1); 366 382 if (!uaddr) { 367 383 spin_unlock(&current->mm->page_table_lock); 368 384 return -EFAULT;
+1 -1
arch/sh/kernel/cpu/sh5/entry.S
··· 933 933 934 934 pta restore_all, tr1 935 935 936 - movi _TIF_SIGPENDING, r8 936 + movi (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME), r8 937 937 and r8, r7, r8 938 938 pta work_notifysig, tr0 939 939 bne r8, ZERO, tr0
+1 -1
arch/sh/kernel/entry-common.S
··· 139 139 ! r8: current_thread_info 140 140 ! t: result of "tst #_TIF_NEED_RESCHED, r0" 141 141 bf/s work_resched 142 - tst #_TIF_SIGPENDING, r0 142 + tst #(_TIF_SIGPENDING | _TIF_NOTIFY_RESUME), r0 143 143 work_notifysig: 144 144 bt/s __restore_all 145 145 mov r15, r4
+5 -8
arch/sparc/kernel/module.c
··· 48 48 return NULL; 49 49 50 50 ret = module_map(size); 51 - if (!ret) 52 - ret = ERR_PTR(-ENOMEM); 53 - else 51 + if (ret) 54 52 memset(ret, 0, size); 55 53 56 54 return ret; ··· 114 116 v = sym->st_value + rel[i].r_addend; 115 117 116 118 switch (ELF_R_TYPE(rel[i].r_info) & 0xff) { 119 + case R_SPARC_DISP32: 120 + v -= (Elf_Addr) location; 121 + *loc32 = v; 122 + break; 117 123 #ifdef CONFIG_SPARC64 118 124 case R_SPARC_64: 119 125 location[0] = v >> 56; ··· 128 126 location[5] = v >> 16; 129 127 location[6] = v >> 8; 130 128 location[7] = v >> 0; 131 - break; 132 - 133 - case R_SPARC_DISP32: 134 - v -= (Elf_Addr) location; 135 - *loc32 = v; 136 129 break; 137 130 138 131 case R_SPARC_WDISP19:
+13 -11
arch/tile/include/gxio/iorpc_trio.h
··· 25 25 #include <linux/module.h> 26 26 #include <asm/pgtable.h> 27 27 28 - #define GXIO_TRIO_OP_ALLOC_ASIDS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1400) 28 + #define GXIO_TRIO_OP_DEALLOC_ASID IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1400) 29 + #define GXIO_TRIO_OP_ALLOC_ASIDS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1401) 29 30 30 - #define GXIO_TRIO_OP_ALLOC_MEMORY_MAPS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1402) 31 + #define GXIO_TRIO_OP_ALLOC_MEMORY_MAPS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1404) 31 32 32 - #define GXIO_TRIO_OP_ALLOC_PIO_REGIONS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x140e) 33 - #define GXIO_TRIO_OP_INIT_PIO_REGION_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x140f) 33 + #define GXIO_TRIO_OP_ALLOC_PIO_REGIONS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1412) 34 34 35 - #define GXIO_TRIO_OP_INIT_MEMORY_MAP_MMU_AUX IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1417) 36 - #define GXIO_TRIO_OP_GET_PORT_PROPERTY IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1418) 37 - #define GXIO_TRIO_OP_CONFIG_LEGACY_INTR IORPC_OPCODE(IORPC_FORMAT_KERNEL_INTERRUPT, 0x1419) 38 - #define GXIO_TRIO_OP_CONFIG_MSI_INTR IORPC_OPCODE(IORPC_FORMAT_KERNEL_INTERRUPT, 0x141a) 35 + #define GXIO_TRIO_OP_INIT_PIO_REGION_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1414) 39 36 40 - #define GXIO_TRIO_OP_SET_MPS_MRS IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141c) 41 - #define GXIO_TRIO_OP_FORCE_RC_LINK_UP IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141d) 42 - #define GXIO_TRIO_OP_FORCE_EP_LINK_UP IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141e) 37 + #define GXIO_TRIO_OP_INIT_MEMORY_MAP_MMU_AUX IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141e) 38 + #define GXIO_TRIO_OP_GET_PORT_PROPERTY IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141f) 39 + #define GXIO_TRIO_OP_CONFIG_LEGACY_INTR IORPC_OPCODE(IORPC_FORMAT_KERNEL_INTERRUPT, 0x1420) 40 + #define GXIO_TRIO_OP_CONFIG_MSI_INTR IORPC_OPCODE(IORPC_FORMAT_KERNEL_INTERRUPT, 0x1421) 41 + 42 + #define GXIO_TRIO_OP_SET_MPS_MRS IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1423) 43 + #define GXIO_TRIO_OP_FORCE_RC_LINK_UP IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1424) 44 + #define GXIO_TRIO_OP_FORCE_EP_LINK_UP IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1425) 43 45 #define GXIO_TRIO_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000) 44 46 #define GXIO_TRIO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001) 45 47
-9
arch/um/include/asm/processor-generic.h
··· 20 20 21 21 struct thread_struct { 22 22 struct task_struct *saved_task; 23 - /* 24 - * This flag is set to 1 before calling do_fork (and analyzed in 25 - * copy_thread) to mark that we are begin called from userspace (fork / 26 - * vfork / clone), and reset to 0 after. It is left to 0 when called 27 - * from kernelspace (i.e. kernel_thread() or fork_idle(), 28 - * as of 2.6.11). 29 - */ 30 - int forking; 31 23 struct pt_regs regs; 32 24 int singlestep_syscall; 33 25 void *fault_addr; ··· 50 58 51 59 #define INIT_THREAD \ 52 60 { \ 53 - .forking = 0, \ 54 61 .regs = EMPTY_REGS, \ 55 62 .fault_addr = NULL, \ 56 63 .prev_sched = NULL, \
-10
arch/um/include/shared/common-offsets.h
··· 7 7 DEFINE(UM_KERN_PAGE_SHIFT, PAGE_SHIFT); 8 8 DEFINE(UM_NSEC_PER_SEC, NSEC_PER_SEC); 9 9 10 - DEFINE_STR(UM_KERN_EMERG, KERN_EMERG); 11 - DEFINE_STR(UM_KERN_ALERT, KERN_ALERT); 12 - DEFINE_STR(UM_KERN_CRIT, KERN_CRIT); 13 - DEFINE_STR(UM_KERN_ERR, KERN_ERR); 14 - DEFINE_STR(UM_KERN_WARNING, KERN_WARNING); 15 - DEFINE_STR(UM_KERN_NOTICE, KERN_NOTICE); 16 - DEFINE_STR(UM_KERN_INFO, KERN_INFO); 17 - DEFINE_STR(UM_KERN_DEBUG, KERN_DEBUG); 18 - DEFINE_STR(UM_KERN_CONT, KERN_CONT); 19 - 20 10 DEFINE(UM_ELF_CLASS, ELF_CLASS); 21 11 DEFINE(UM_ELFCLASS32, ELFCLASS32); 22 12 DEFINE(UM_ELFCLASS64, ELFCLASS64);
+11
arch/um/include/shared/user.h
··· 26 26 extern void panic(const char *fmt, ...) 27 27 __attribute__ ((format (printf, 1, 2))); 28 28 29 + /* Requires preincluding include/linux/kern_levels.h */ 30 + #define UM_KERN_EMERG KERN_EMERG 31 + #define UM_KERN_ALERT KERN_ALERT 32 + #define UM_KERN_CRIT KERN_CRIT 33 + #define UM_KERN_ERR KERN_ERR 34 + #define UM_KERN_WARNING KERN_WARNING 35 + #define UM_KERN_NOTICE KERN_NOTICE 36 + #define UM_KERN_INFO KERN_INFO 37 + #define UM_KERN_DEBUG KERN_DEBUG 38 + #define UM_KERN_CONT KERN_CONT 39 + 29 40 #ifdef UML_CONFIG_PRINTK 30 41 extern int printk(const char *fmt, ...) 31 42 __attribute__ ((format (printf, 1, 2)));
+7 -20
arch/um/kernel/exec.c
··· 39 39 40 40 void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) 41 41 { 42 + get_safe_registers(regs->regs.gp, regs->regs.fp); 42 43 PT_REGS_IP(regs) = eip; 43 44 PT_REGS_SP(regs) = esp; 45 + current->ptrace &= ~PT_DTRACE; 46 + #ifdef SUBARCH_EXECVE1 47 + SUBARCH_EXECVE1(regs->regs); 48 + #endif 44 49 } 45 50 EXPORT_SYMBOL(start_thread); 46 - 47 - static long execve1(const char *file, 48 - const char __user *const __user *argv, 49 - const char __user *const __user *env) 50 - { 51 - long error; 52 - 53 - error = do_execve(file, argv, env, &current->thread.regs); 54 - if (error == 0) { 55 - task_lock(current); 56 - current->ptrace &= ~PT_DTRACE; 57 - #ifdef SUBARCH_EXECVE1 58 - SUBARCH_EXECVE1(&current->thread.regs.regs); 59 - #endif 60 - task_unlock(current); 61 - } 62 - return error; 63 - } 64 51 65 52 long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env) 66 53 { 67 54 long err; 68 55 69 - err = execve1(file, argv, env); 56 + err = do_execve(file, argv, env, &current->thread.regs); 70 57 if (!err) 71 58 UML_LONGJMP(current->thread.exec_buf, 1); 72 59 return err; ··· 68 81 filename = getname(file); 69 82 error = PTR_ERR(filename); 70 83 if (IS_ERR(filename)) goto out; 71 - error = execve1(filename, argv, env); 84 + error = do_execve(filename, argv, env, &current->thread.regs); 72 85 putname(filename); 73 86 out: 74 87 return error;
+4 -4
arch/um/kernel/process.c
··· 181 181 struct pt_regs *regs) 182 182 { 183 183 void (*handler)(void); 184 + int kthread = current->flags & PF_KTHREAD; 184 185 int ret = 0; 185 186 186 187 p->thread = (struct thread_struct) INIT_THREAD; 187 188 188 - if (current->thread.forking) { 189 + if (!kthread) { 189 190 memcpy(&p->thread.regs.regs, &regs->regs, 190 191 sizeof(p->thread.regs.regs)); 191 192 PT_REGS_SET_SYSCALL_RETURN(&p->thread.regs, 0); ··· 196 195 handler = fork_handler; 197 196 198 197 arch_copy_thread(&current->thread.arch, &p->thread.arch); 199 - } 200 - else { 198 + } else { 201 199 get_safe_registers(p->thread.regs.regs.gp, p->thread.regs.regs.fp); 202 200 p->thread.request.u.thread = current->thread.request.u.thread; 203 201 handler = new_thread_handler; ··· 204 204 205 205 new_thread(task_stack_page(p), &p->thread.switch_buf, handler); 206 206 207 - if (current->thread.forking) { 207 + if (!kthread) { 208 208 clear_flushed_tls(p); 209 209 210 210 /*
+5 -1
arch/um/kernel/signal.c
··· 22 22 struct k_sigaction *ka, siginfo_t *info) 23 23 { 24 24 sigset_t *oldset = sigmask_to_save(); 25 + int singlestep = 0; 25 26 unsigned long sp; 26 27 int err; 28 + 29 + if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED)) 30 + singlestep = 1; 27 31 28 32 /* Did we come from a system call? */ 29 33 if (PT_REGS_SYSCALL_NR(regs) >= 0) { ··· 65 61 if (err) 66 62 force_sigsegv(signr, current); 67 63 else 68 - signal_delivered(signr, info, ka, regs, 0); 64 + signal_delivered(signr, info, ka, regs, singlestep); 69 65 } 70 66 71 67 static int kern_do_signal(struct pt_regs *regs)
+12 -12
arch/um/kernel/syscall.c
··· 17 17 18 18 long sys_fork(void) 19 19 { 20 - long ret; 21 - 22 - current->thread.forking = 1; 23 - ret = do_fork(SIGCHLD, UPT_SP(&current->thread.regs.regs), 20 + return do_fork(SIGCHLD, UPT_SP(&current->thread.regs.regs), 24 21 &current->thread.regs, 0, NULL, NULL); 25 - current->thread.forking = 0; 26 - return ret; 27 22 } 28 23 29 24 long sys_vfork(void) 30 25 { 31 - long ret; 32 - 33 - current->thread.forking = 1; 34 - ret = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 26 + return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 35 27 UPT_SP(&current->thread.regs.regs), 36 28 &current->thread.regs, 0, NULL, NULL); 37 - current->thread.forking = 0; 38 - return ret; 29 + } 30 + 31 + long sys_clone(unsigned long clone_flags, unsigned long newsp, 32 + void __user *parent_tid, void __user *child_tid) 33 + { 34 + if (!newsp) 35 + newsp = UPT_SP(&current->thread.regs.regs); 36 + 37 + return do_fork(clone_flags, newsp, &current->thread.regs, 0, parent_tid, 38 + child_tid); 39 39 } 40 40 41 41 long old_mmap(unsigned long addr, unsigned long len,
+1 -1
arch/um/scripts/Makefile.rules
··· 8 8 USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) 9 9 10 10 $(USER_OBJS:.o=.%): \ 11 - c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) -include user.h $(CFLAGS_$(basetarget).o) 11 + c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) -include $(srctree)/include/linux/kern_levels.h -include user.h $(CFLAGS_$(basetarget).o) 12 12 13 13 # These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of 14 14 # using it directly.
+4 -4
arch/x86/Kconfig
··· 746 746 def_bool y if X86_64 747 747 ---help--- 748 748 Support for software bounce buffers used on x86-64 systems 749 - which don't have a hardware IOMMU (e.g. the current generation 750 - of Intel's x86-64 CPUs). Using this PCI devices which can only 751 - access 32-bits of memory can be used on systems with more than 752 - 3 GB of memory. If unsure, say Y. 749 + which don't have a hardware IOMMU. Using this PCI devices 750 + which can only access 32-bits of memory can be used on systems 751 + with more than 3 GB of memory. 752 + If unsure, say Y. 753 753 754 754 config IOMMU_HELPER 755 755 def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU)
+1 -1
arch/x86/Makefile
··· 142 142 KBUILD_CFLAGS += $(mflags-y) 143 143 KBUILD_AFLAGS += $(mflags-y) 144 144 145 - archscripts: 145 + archscripts: scripts_basic 146 146 $(Q)$(MAKE) $(build)=arch/x86/tools relocs 147 147 148 148 ###
+2 -1
arch/x86/include/asm/xen/page.h
··· 51 51 52 52 extern int m2p_add_override(unsigned long mfn, struct page *page, 53 53 struct gnttab_map_grant_ref *kmap_op); 54 - extern int m2p_remove_override(struct page *page, bool clear_pte); 54 + extern int m2p_remove_override(struct page *page, 55 + struct gnttab_map_grant_ref *kmap_op); 55 56 extern struct page *m2p_find_override(unsigned long mfn); 56 57 extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn); 57 58
+2
arch/x86/kernel/cpu/perf_event.h
··· 586 586 587 587 extern struct event_constraint intel_snb_pebs_event_constraints[]; 588 588 589 + extern struct event_constraint intel_ivb_pebs_event_constraints[]; 590 + 589 591 struct event_constraint *intel_pebs_constraints(struct perf_event *event); 590 592 591 593 void intel_pmu_pebs_enable(struct perf_event *event);
+12
arch/x86/kernel/cpu/perf_event_amd_ibs.c
··· 209 209 return -EOPNOTSUPP; 210 210 } 211 211 212 + static const struct perf_event_attr ibs_notsupp = { 213 + .exclude_user = 1, 214 + .exclude_kernel = 1, 215 + .exclude_hv = 1, 216 + .exclude_idle = 1, 217 + .exclude_host = 1, 218 + .exclude_guest = 1, 219 + }; 220 + 212 221 static int perf_ibs_init(struct perf_event *event) 213 222 { 214 223 struct hw_perf_event *hwc = &event->hw; ··· 237 228 238 229 if (event->pmu != &perf_ibs->pmu) 239 230 return -ENOENT; 231 + 232 + if (perf_flags(&event->attr) & perf_flags(&ibs_notsupp)) 233 + return -EINVAL; 240 234 241 235 if (config & ~perf_ibs->config_mask) 242 236 return -EINVAL;
+23 -1
arch/x86/kernel/cpu/perf_event_intel.c
··· 2048 2048 case 42: /* SandyBridge */ 2049 2049 case 45: /* SandyBridge, "Romely-EP" */ 2050 2050 x86_add_quirk(intel_sandybridge_quirk); 2051 - case 58: /* IvyBridge */ 2052 2051 memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, 2053 2052 sizeof(hw_cache_event_ids)); 2054 2053 memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, ··· 2072 2073 2073 2074 pr_cont("SandyBridge events, "); 2074 2075 break; 2076 + case 58: /* IvyBridge */ 2077 + memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, 2078 + sizeof(hw_cache_event_ids)); 2079 + memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, 2080 + sizeof(hw_cache_extra_regs)); 2081 + 2082 + intel_pmu_lbr_init_snb(); 2083 + 2084 + x86_pmu.event_constraints = intel_snb_event_constraints; 2085 + x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints; 2086 + x86_pmu.pebs_aliases = intel_pebs_aliases_snb; 2087 + x86_pmu.extra_regs = intel_snb_extra_regs; 2088 + /* all extra regs are per-cpu when HT is on */ 2089 + x86_pmu.er_flags |= ERF_HAS_RSP_1; 2090 + x86_pmu.er_flags |= ERF_NO_HT_SHARING; 2091 + 2092 + /* UOPS_ISSUED.ANY,c=1,i=1 to count stall cycles */ 2093 + intel_perfmon_event_map[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 2094 + X86_CONFIG(.event=0x0e, .umask=0x01, .inv=1, .cmask=1); 2095 + 2096 + pr_cont("IvyBridge events, "); 2097 + break; 2098 + 2075 2099 2076 2100 default: 2077 2101 switch (x86_pmu.version) {
+14
arch/x86/kernel/cpu/perf_event_intel_ds.c
··· 407 407 EVENT_CONSTRAINT_END 408 408 }; 409 409 410 + struct event_constraint intel_ivb_pebs_event_constraints[] = { 411 + INTEL_UEVENT_CONSTRAINT(0x01c0, 0x2), /* INST_RETIRED.PRECDIST */ 412 + INTEL_UEVENT_CONSTRAINT(0x01c2, 0xf), /* UOPS_RETIRED.ALL */ 413 + INTEL_UEVENT_CONSTRAINT(0x02c2, 0xf), /* UOPS_RETIRED.RETIRE_SLOTS */ 414 + INTEL_EVENT_CONSTRAINT(0xc4, 0xf), /* BR_INST_RETIRED.* */ 415 + INTEL_EVENT_CONSTRAINT(0xc5, 0xf), /* BR_MISP_RETIRED.* */ 416 + INTEL_EVENT_CONSTRAINT(0xcd, 0x8), /* MEM_TRANS_RETIRED.* */ 417 + INTEL_EVENT_CONSTRAINT(0xd0, 0xf), /* MEM_UOP_RETIRED.* */ 418 + INTEL_EVENT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */ 419 + INTEL_EVENT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */ 420 + INTEL_EVENT_CONSTRAINT(0xd3, 0xf), /* MEM_LOAD_UOPS_LLC_MISS_RETIRED.* */ 421 + EVENT_CONSTRAINT_END 422 + }; 423 + 410 424 struct event_constraint *intel_pebs_constraints(struct perf_event *event) 411 425 { 412 426 struct event_constraint *c;
+6
arch/x86/kernel/cpu/perf_event_intel_uncore.c
··· 661 661 } 662 662 } 663 663 664 + static struct uncore_event_desc snb_uncore_events[] = { 665 + INTEL_UNCORE_EVENT_DESC(clockticks, "event=0xff,umask=0x00"), 666 + { /* end: all zeroes */ }, 667 + }; 668 + 664 669 static struct attribute *snb_uncore_formats_attr[] = { 665 670 &format_attr_event.attr, 666 671 &format_attr_umask.attr, ··· 709 704 .constraints = snb_uncore_cbox_constraints, 710 705 .ops = &snb_uncore_msr_ops, 711 706 .format_group = &snb_uncore_format_group, 707 + .event_descs = snb_uncore_events, 712 708 }; 713 709 714 710 static struct intel_uncore_type *snb_msr_uncores[] = {
+1 -1
arch/x86/mm/init.c
··· 319 319 */ 320 320 int devmem_is_allowed(unsigned long pagenr) 321 321 { 322 - if (pagenr <= 256) 322 + if (pagenr < 256) 323 323 return 1; 324 324 if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) 325 325 return 0;
+1
arch/x86/um/Kconfig
··· 21 21 config X86_32 22 22 def_bool !64BIT 23 23 select HAVE_AOUT 24 + select ARCH_WANT_IPC_PARSE_VERSION 24 25 25 26 config X86_64 26 27 def_bool 64BIT
-3
arch/x86/um/shared/sysdep/kernel-offsets.h
··· 7 7 #define DEFINE(sym, val) \ 8 8 asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 9 9 10 - #define STR(x) #x 11 - #define DEFINE_STR(sym, val) asm volatile("\n->" #sym " " STR(val) " " #val: : ) 12 - 13 10 #define BLANK() asm volatile("\n->" : : ) 14 11 15 12 #define OFFSET(sym, str, mem) \
+2
arch/x86/um/shared/sysdep/syscalls.h
··· 1 + extern long sys_clone(unsigned long clone_flags, unsigned long newsp, 2 + void __user *parent_tid, void __user *child_tid); 1 3 #ifdef __i386__ 2 4 #include "syscalls_32.h" 3 5 #else
-6
arch/x86/um/signal.c
··· 416 416 PT_REGS_AX(regs) = (unsigned long) sig; 417 417 PT_REGS_DX(regs) = (unsigned long) 0; 418 418 PT_REGS_CX(regs) = (unsigned long) 0; 419 - 420 - if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED)) 421 - ptrace_notify(SIGTRAP); 422 419 return 0; 423 420 } 424 421 ··· 463 466 PT_REGS_AX(regs) = (unsigned long) sig; 464 467 PT_REGS_DX(regs) = (unsigned long) &frame->info; 465 468 PT_REGS_CX(regs) = (unsigned long) &frame->uc; 466 - 467 - if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED)) 468 - ptrace_notify(SIGTRAP); 469 469 return 0; 470 470 } 471 471
+1 -1
arch/x86/um/sys_call_table_32.c
··· 28 28 #define ptregs_execve sys_execve 29 29 #define ptregs_iopl sys_iopl 30 30 #define ptregs_vm86old sys_vm86old 31 - #define ptregs_clone sys_clone 31 + #define ptregs_clone i386_clone 32 32 #define ptregs_vm86 sys_vm86 33 33 #define ptregs_sigaltstack sys_sigaltstack 34 34 #define ptregs_vfork sys_vfork
+7 -20
arch/x86/um/syscalls_32.c
··· 3 3 * Licensed under the GPL 4 4 */ 5 5 6 - #include "linux/sched.h" 7 - #include "linux/shm.h" 8 - #include "linux/ipc.h" 9 - #include "linux/syscalls.h" 10 - #include "asm/mman.h" 11 - #include "asm/uaccess.h" 12 - #include "asm/unistd.h" 6 + #include <linux/syscalls.h> 7 + #include <sysdep/syscalls.h> 13 8 14 9 /* 15 10 * The prototype on i386 is: 16 11 * 17 - * int clone(int flags, void * child_stack, int * parent_tidptr, struct user_desc * newtls, int * child_tidptr) 12 + * int clone(int flags, void * child_stack, int * parent_tidptr, struct user_desc * newtls 18 13 * 19 14 * and the "newtls" arg. on i386 is read by copy_thread directly from the 20 15 * register saved on the stack. 21 16 */ 22 - long sys_clone(unsigned long clone_flags, unsigned long newsp, 23 - int __user *parent_tid, void *newtls, int __user *child_tid) 17 + long i386_clone(unsigned long clone_flags, unsigned long newsp, 18 + int __user *parent_tid, void *newtls, int __user *child_tid) 24 19 { 25 - long ret; 26 - 27 - if (!newsp) 28 - newsp = UPT_SP(&current->thread.regs.regs); 29 - 30 - current->thread.forking = 1; 31 - ret = do_fork(clone_flags, newsp, &current->thread.regs, 0, parent_tid, 32 - child_tid); 33 - current->thread.forking = 0; 34 - return ret; 20 + return sys_clone(clone_flags, newsp, parent_tid, child_tid); 35 21 } 22 + 36 23 37 24 long sys_sigaction(int sig, const struct old_sigaction __user *act, 38 25 struct old_sigaction __user *oact)
+3 -20
arch/x86/um/syscalls_64.c
··· 5 5 * Licensed under the GPL 6 6 */ 7 7 8 - #include "linux/linkage.h" 9 - #include "linux/personality.h" 10 - #include "linux/utsname.h" 11 - #include "asm/prctl.h" /* XXX This should get the constants from libc */ 12 - #include "asm/uaccess.h" 13 - #include "os.h" 8 + #include <linux/sched.h> 9 + #include <asm/prctl.h> /* XXX This should get the constants from libc */ 10 + #include <os.h> 14 11 15 12 long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) 16 13 { ··· 74 77 long sys_arch_prctl(int code, unsigned long addr) 75 78 { 76 79 return arch_prctl(current, code, (unsigned long __user *) addr); 77 - } 78 - 79 - long sys_clone(unsigned long clone_flags, unsigned long newsp, 80 - void __user *parent_tid, void __user *child_tid) 81 - { 82 - long ret; 83 - 84 - if (!newsp) 85 - newsp = UPT_SP(&current->thread.regs.regs); 86 - current->thread.forking = 1; 87 - ret = do_fork(clone_flags, newsp, &current->thread.regs, 0, parent_tid, 88 - child_tid); 89 - current->thread.forking = 0; 90 - return ret; 91 80 } 92 81 93 82 void arch_switch_to(struct task_struct *to)
+4
arch/x86/xen/enlighten.c
··· 1452 1452 pci_request_acs(); 1453 1453 1454 1454 xen_acpi_sleep_register(); 1455 + 1456 + /* Avoid searching for BIOS MP tables */ 1457 + x86_init.mpparse.find_smp_config = x86_init_noop; 1458 + x86_init.mpparse.get_smp_config = x86_init_uint_noop; 1455 1459 } 1456 1460 #ifdef CONFIG_PCI 1457 1461 /* PCI BIOS service won't work from a PV guest. */
+11 -16
arch/x86/xen/p2m.c
··· 828 828 829 829 xen_mc_issue(PARAVIRT_LAZY_MMU); 830 830 } 831 - /* let's use dev_bus_addr to record the old mfn instead */ 832 - kmap_op->dev_bus_addr = page->index; 833 - page->index = (unsigned long) kmap_op; 834 831 } 835 832 spin_lock_irqsave(&m2p_override_lock, flags); 836 833 list_add(&page->lru, &m2p_overrides[mfn_hash(mfn)]); ··· 854 857 return 0; 855 858 } 856 859 EXPORT_SYMBOL_GPL(m2p_add_override); 857 - int m2p_remove_override(struct page *page, bool clear_pte) 860 + int m2p_remove_override(struct page *page, 861 + struct gnttab_map_grant_ref *kmap_op) 858 862 { 859 863 unsigned long flags; 860 864 unsigned long mfn; ··· 885 887 WARN_ON(!PagePrivate(page)); 886 888 ClearPagePrivate(page); 887 889 888 - if (clear_pte) { 889 - struct gnttab_map_grant_ref *map_op = 890 - (struct gnttab_map_grant_ref *) page->index; 891 - set_phys_to_machine(pfn, map_op->dev_bus_addr); 890 + set_phys_to_machine(pfn, page->index); 891 + if (kmap_op != NULL) { 892 892 if (!PageHighMem(page)) { 893 893 struct multicall_space mcs; 894 894 struct gnttab_unmap_grant_ref *unmap_op; ··· 898 902 * issued. In this case handle is going to -1 because 899 903 * it hasn't been modified yet. 900 904 */ 901 - if (map_op->handle == -1) 905 + if (kmap_op->handle == -1) 902 906 xen_mc_flush(); 903 907 /* 904 - * Now if map_op->handle is negative it means that the 908 + * Now if kmap_op->handle is negative it means that the 905 909 * hypercall actually returned an error. 906 910 */ 907 - if (map_op->handle == GNTST_general_error) { 911 + if (kmap_op->handle == GNTST_general_error) { 908 912 printk(KERN_WARNING "m2p_remove_override: " 909 913 "pfn %lx mfn %lx, failed to modify kernel mappings", 910 914 pfn, mfn); ··· 914 918 mcs = xen_mc_entry( 915 919 sizeof(struct gnttab_unmap_grant_ref)); 916 920 unmap_op = mcs.args; 917 - unmap_op->host_addr = map_op->host_addr; 918 - unmap_op->handle = map_op->handle; 921 + unmap_op->host_addr = kmap_op->host_addr; 922 + unmap_op->handle = kmap_op->handle; 919 923 unmap_op->dev_bus_addr = 0; 920 924 921 925 MULTI_grant_table_op(mcs.mc, ··· 926 930 set_pte_at(&init_mm, address, ptep, 927 931 pfn_pte(pfn, PAGE_KERNEL)); 928 932 __flush_tlb_single(address); 929 - map_op->host_addr = 0; 933 + kmap_op->host_addr = 0; 930 934 } 931 - } else 932 - set_phys_to_machine(pfn, page->index); 935 + } 933 936 934 937 /* p2m(m2p(mfn)) == FOREIGN_FRAME(mfn): the mfn is already present 935 938 * somewhere in this domain, even before being added to the
+4
arch/x86/xen/setup.c
··· 17 17 #include <asm/e820.h> 18 18 #include <asm/setup.h> 19 19 #include <asm/acpi.h> 20 + #include <asm/numa.h> 20 21 #include <asm/xen/hypervisor.h> 21 22 #include <asm/xen/hypercall.h> 22 23 ··· 545 544 disable_cpufreq(); 546 545 WARN_ON(set_pm_idle_to_default()); 547 546 fiddle_vdso(); 547 + #ifdef CONFIG_NUMA 548 + numa_off = 1; 549 + #endif 548 550 }
+5 -3
block/blk-core.c
··· 2254 2254 error_type = "I/O"; 2255 2255 break; 2256 2256 } 2257 - printk(KERN_ERR "end_request: %s error, dev %s, sector %llu\n", 2258 - error_type, req->rq_disk ? req->rq_disk->disk_name : "?", 2259 - (unsigned long long)blk_rq_pos(req)); 2257 + printk_ratelimited(KERN_ERR "end_request: %s error, dev %s, sector %llu\n", 2258 + error_type, req->rq_disk ? 2259 + req->rq_disk->disk_name : "?", 2260 + (unsigned long long)blk_rq_pos(req)); 2261 + 2260 2262 } 2261 2263 2262 2264 blk_account_io_completion(req, nr_bytes);
+1 -1
block/ioctl.c
··· 41 41 sizeof(long long) > sizeof(long)) { 42 42 long pstart = start, plength = length; 43 43 if (pstart != start || plength != length 44 - || pstart < 0 || plength < 0) 44 + || pstart < 0 || plength < 0 || partno > 65535) 45 45 return -EINVAL; 46 46 } 47 47
+10
drivers/acpi/bus.c
··· 237 237 } else if (result == ACPI_STATE_D3_HOT) { 238 238 result = ACPI_STATE_D3; 239 239 } 240 + 241 + /* 242 + * If we were unsure about the device parent's power state up to this 243 + * point, the fact that the device is in D0 implies that the parent has 244 + * to be in D0 too. 245 + */ 246 + if (device->parent && device->parent->power.state == ACPI_STATE_UNKNOWN 247 + && result == ACPI_STATE_D0) 248 + device->parent->power.state = ACPI_STATE_D0; 249 + 240 250 *state = result; 241 251 242 252 out:
+24 -12
drivers/acpi/power.c
··· 107 107 108 108 /* List of devices relying on this power resource */ 109 109 struct acpi_power_resource_device *devices; 110 + struct mutex devices_lock; 110 111 }; 111 112 112 113 static struct list_head acpi_power_resource_list; ··· 226 225 227 226 static int __acpi_power_on(struct acpi_power_resource *resource) 228 227 { 229 - struct acpi_power_resource_device *device_list = resource->devices; 230 228 acpi_status status = AE_OK; 231 229 232 230 status = acpi_evaluate_object(resource->device->handle, "_ON", NULL, NULL); ··· 238 238 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n", 239 239 resource->name)); 240 240 241 - while (device_list) { 242 - acpi_power_on_device(device_list->device); 243 - 244 - device_list = device_list->next; 245 - } 246 - 247 241 return 0; 248 242 } 249 243 250 244 static int acpi_power_on(acpi_handle handle) 251 245 { 252 246 int result = 0; 247 + bool resume_device = false; 253 248 struct acpi_power_resource *resource = NULL; 249 + struct acpi_power_resource_device *device_list; 254 250 255 251 result = acpi_power_get_context(handle, &resource); 256 252 if (result) ··· 262 266 result = __acpi_power_on(resource); 263 267 if (result) 264 268 resource->ref_count--; 269 + else 270 + resume_device = true; 265 271 } 266 272 267 273 mutex_unlock(&resource->resource_lock); 274 + 275 + if (!resume_device) 276 + return result; 277 + 278 + mutex_lock(&resource->devices_lock); 279 + 280 + device_list = resource->devices; 281 + while (device_list) { 282 + acpi_power_on_device(device_list->device); 283 + device_list = device_list->next; 284 + } 285 + 286 + mutex_unlock(&resource->devices_lock); 268 287 269 288 return result; 270 289 } ··· 366 355 if (acpi_power_get_context(res_handle, &resource)) 367 356 return; 368 357 369 - mutex_lock(&resource->resource_lock); 358 + mutex_lock(&resource->devices_lock); 370 359 prev = NULL; 371 360 curr = resource->devices; 372 361 while (curr) { ··· 383 372 prev = curr; 384 373 curr = curr->next; 385 374 } 386 - mutex_unlock(&resource->resource_lock); 375 + mutex_unlock(&resource->devices_lock); 387 376 } 388 377 389 378 /* Unlink dev from all power resources in _PR0 */ ··· 425 414 426 415 power_resource_device->device = powered_device; 427 416 428 - mutex_lock(&resource->resource_lock); 417 + mutex_lock(&resource->devices_lock); 429 418 power_resource_device->next = resource->devices; 430 419 resource->devices = power_resource_device; 431 - mutex_unlock(&resource->resource_lock); 420 + mutex_unlock(&resource->devices_lock); 432 421 433 422 return 0; 434 423 } ··· 473 462 return ret; 474 463 475 464 no_power_resource: 476 - printk(KERN_WARNING PREFIX "Invalid Power Resource to register!"); 465 + printk(KERN_DEBUG PREFIX "Invalid Power Resource to register!"); 477 466 return -ENODEV; 478 467 } 479 468 EXPORT_SYMBOL_GPL(acpi_power_resource_register_device); ··· 732 721 733 722 resource->device = device; 734 723 mutex_init(&resource->resource_lock); 724 + mutex_init(&resource->devices_lock); 735 725 strcpy(resource->name, device->pnp.bus_id); 736 726 strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); 737 727 strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
+1
drivers/block/aoe/aoecmd.c
··· 35 35 skb_reset_mac_header(skb); 36 36 skb_reset_network_header(skb); 37 37 skb->protocol = __constant_htons(ETH_P_AOE); 38 + skb_checksum_none_assert(skb); 38 39 } 39 40 return skb; 40 41 }
+1
drivers/block/cciss_scsi.c
··· 795 795 } 796 796 break; 797 797 case CMD_PROTOCOL_ERR: 798 + cmd->result = DID_ERROR << 16; 798 799 dev_warn(&h->pdev->dev, 799 800 "%p has protocol error\n", c); 800 801 break;
+23 -15
drivers/block/mtip32xx/mtip32xx.c
··· 1148 1148 reply = port->rxfis + RX_FIS_D2H_REG; 1149 1149 task_file_data = readl(port->mmio+PORT_TFDATA); 1150 1150 1151 - if ((task_file_data & 1) || (fis->command == ATA_CMD_SEC_ERASE_UNIT)) 1151 + if (fis->command == ATA_CMD_SEC_ERASE_UNIT) 1152 + clear_bit(MTIP_DDF_SEC_LOCK_BIT, &port->dd->dd_flag); 1153 + 1154 + if ((task_file_data & 1)) 1152 1155 return false; 1153 1156 1154 1157 if (fis->command == ATA_CMD_SEC_ERASE_PREP) { 1155 1158 set_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags); 1159 + set_bit(MTIP_DDF_SEC_LOCK_BIT, &port->dd->dd_flag); 1156 1160 port->ic_pause_timer = jiffies; 1157 1161 return true; 1158 1162 } else if ((fis->command == ATA_CMD_DOWNLOAD_MICRO) && ··· 1904 1900 int rv = 0, xfer_sz = command[3]; 1905 1901 1906 1902 if (xfer_sz) { 1907 - if (user_buffer) 1903 + if (!user_buffer) 1908 1904 return -EFAULT; 1909 1905 1910 1906 buf = dmam_alloc_coherent(&port->dd->pdev->dev, ··· 2047 2043 *timeout = 240000; /* 4 minutes */ 2048 2044 break; 2049 2045 case ATA_CMD_STANDBYNOW1: 2050 - *timeout = 10000; /* 10 seconds */ 2046 + *timeout = 120000; /* 2 minutes */ 2051 2047 break; 2052 2048 case 0xF7: 2053 2049 case 0xFA: ··· 2592 2588 if (!len || size) 2593 2589 return 0; 2594 2590 2595 - if (size < 0) 2596 - return -EINVAL; 2597 - 2598 2591 size += sprintf(&buf[size], "H/ S ACTive : [ 0x"); 2599 2592 2600 2593 for (n = dd->slot_groups-1; n >= 0; n--) ··· 2660 2659 2661 2660 if (!len || size) 2662 2661 return 0; 2663 - 2664 - if (size < 0) 2665 - return -EINVAL; 2666 2662 2667 2663 size += sprintf(&buf[size], "Flag-port : [ %08lX ]\n", 2668 2664 dd->port->flags); ··· 3212 3214 "Unable to check write protect progress\n"); 3213 3215 else 3214 3216 dev_info(&dd->pdev->dev, 3215 - "Write protect progress: %d%% (%d blocks)\n", 3216 - attr242.cur, attr242.data); 3217 + "Write protect progress: %u%% (%u blocks)\n", 3218 + attr242.cur, le32_to_cpu(attr242.data)); 3217 3219 return rv; 3218 3220 3219 3221 out3: ··· 3614 3616 if (unlikely(test_bit(MTIP_DDF_WRITE_PROTECT_BIT, 3615 3617 &dd->dd_flag) && 3616 3618 bio_data_dir(bio))) { 3619 + bio_endio(bio, -ENODATA); 3620 + return; 3621 + } 3622 + if (unlikely(test_bit(MTIP_DDF_SEC_LOCK_BIT, &dd->dd_flag))) { 3617 3623 bio_endio(bio, -ENODATA); 3618 3624 return; 3619 3625 } ··· 4170 4168 4171 4169 /* Table of device ids supported by this driver. */ 4172 4170 static DEFINE_PCI_DEVICE_TABLE(mtip_pci_tbl) = { 4173 - { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P320_DEVICE_ID) }, 4171 + { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P320H_DEVICE_ID) }, 4172 + { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P320M_DEVICE_ID) }, 4173 + { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P320S_DEVICE_ID) }, 4174 + { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P325M_DEVICE_ID) }, 4175 + { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P420H_DEVICE_ID) }, 4176 + { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P420M_DEVICE_ID) }, 4177 + { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P425M_DEVICE_ID) }, 4174 4178 { 0 } 4175 4179 }; 4176 4180 ··· 4207 4199 { 4208 4200 int error; 4209 4201 4210 - printk(KERN_INFO MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n"); 4202 + pr_info(MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n"); 4211 4203 4212 4204 /* Allocate a major block device number to use with this driver. */ 4213 4205 error = register_blkdev(0, MTIP_DRV_NAME); 4214 4206 if (error <= 0) { 4215 - printk(KERN_ERR "Unable to register block device (%d)\n", 4207 + pr_err("Unable to register block device (%d)\n", 4216 4208 error); 4217 4209 return -EBUSY; 4218 4210 } ··· 4221 4213 if (!dfs_parent) { 4222 4214 dfs_parent = debugfs_create_dir("rssd", NULL); 4223 4215 if (IS_ERR_OR_NULL(dfs_parent)) { 4224 - printk(KERN_WARNING "Error creating debugfs parent\n"); 4216 + pr_warn("Error creating debugfs parent\n"); 4225 4217 dfs_parent = NULL; 4226 4218 } 4227 4219 }
+9 -1
drivers/block/mtip32xx/mtip32xx.h
··· 76 76 77 77 /* Micron Vendor ID & P320x SSD Device ID */ 78 78 #define PCI_VENDOR_ID_MICRON 0x1344 79 - #define P320_DEVICE_ID 0x5150 79 + #define P320H_DEVICE_ID 0x5150 80 + #define P320M_DEVICE_ID 0x5151 81 + #define P320S_DEVICE_ID 0x5152 82 + #define P325M_DEVICE_ID 0x5153 83 + #define P420H_DEVICE_ID 0x5160 84 + #define P420M_DEVICE_ID 0x5161 85 + #define P425M_DEVICE_ID 0x5163 80 86 81 87 /* Driver name and version strings */ 82 88 #define MTIP_DRV_NAME "mtip32xx" ··· 137 131 MTIP_PF_SVC_THD_STOP_BIT = 8, 138 132 139 133 /* below are bit numbers in 'dd_flag' defined in driver_data */ 134 + MTIP_DDF_SEC_LOCK_BIT = 0, 140 135 MTIP_DDF_REMOVE_PENDING_BIT = 1, 141 136 MTIP_DDF_OVER_TEMP_BIT = 2, 142 137 MTIP_DDF_WRITE_PROTECT_BIT = 3, 143 138 MTIP_DDF_STOP_IO = ((1 << MTIP_DDF_REMOVE_PENDING_BIT) | \ 139 + (1 << MTIP_DDF_SEC_LOCK_BIT) | \ 144 140 (1 << MTIP_DDF_OVER_TEMP_BIT) | \ 145 141 (1 << MTIP_DDF_WRITE_PROTECT_BIT)), 146 142
+9
drivers/block/nbd.c
··· 449 449 req->errors++; 450 450 nbd_end_request(req); 451 451 } 452 + 453 + while (!list_empty(&nbd->waiting_queue)) { 454 + req = list_entry(nbd->waiting_queue.next, struct request, 455 + queuelist); 456 + list_del_init(&req->queuelist); 457 + req->errors++; 458 + nbd_end_request(req); 459 + } 452 460 } 453 461 454 462 ··· 606 598 nbd->file = NULL; 607 599 nbd_clear_que(nbd); 608 600 BUG_ON(!list_empty(&nbd->queue_head)); 601 + BUG_ON(!list_empty(&nbd->waiting_queue)); 609 602 if (file) 610 603 fput(file); 611 604 return 0;
+3 -4
drivers/block/rbd.c
··· 246 246 { 247 247 struct rbd_device *rbd_dev = bdev->bd_disk->private_data; 248 248 249 - rbd_get_dev(rbd_dev); 250 - 251 - set_device_ro(bdev, rbd_dev->read_only); 252 - 253 249 if ((mode & FMODE_WRITE) && rbd_dev->read_only) 254 250 return -EROFS; 251 + 252 + rbd_get_dev(rbd_dev); 253 + set_device_ro(bdev, rbd_dev->read_only); 255 254 256 255 return 0; 257 256 }
+1 -1
drivers/block/xen-blkback/blkback.c
··· 337 337 invcount++; 338 338 } 339 339 340 - ret = gnttab_unmap_refs(unmap, pages, invcount, false); 340 + ret = gnttab_unmap_refs(unmap, NULL, pages, invcount); 341 341 BUG_ON(ret); 342 342 } 343 343
+1
drivers/clk/Makefile
··· 1 1 # common clock types 2 + obj-$(CONFIG_HAVE_CLK) += clk-devres.o 2 3 obj-$(CONFIG_CLKDEV_LOOKUP) += clkdev.o 3 4 obj-$(CONFIG_COMMON_CLK) += clk.o clk-fixed-rate.o clk-gate.o \ 4 5 clk-mux.o clk-divider.o clk-fixed-factor.o
+55
drivers/clk/clk-devres.c
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation. 5 + */ 6 + 7 + #include <linux/clk.h> 8 + #include <linux/device.h> 9 + #include <linux/export.h> 10 + #include <linux/gfp.h> 11 + 12 + static void devm_clk_release(struct device *dev, void *res) 13 + { 14 + clk_put(*(struct clk **)res); 15 + } 16 + 17 + struct clk *devm_clk_get(struct device *dev, const char *id) 18 + { 19 + struct clk **ptr, *clk; 20 + 21 + ptr = devres_alloc(devm_clk_release, sizeof(*ptr), GFP_KERNEL); 22 + if (!ptr) 23 + return ERR_PTR(-ENOMEM); 24 + 25 + clk = clk_get(dev, id); 26 + if (!IS_ERR(clk)) { 27 + *ptr = clk; 28 + devres_add(dev, ptr); 29 + } else { 30 + devres_free(ptr); 31 + } 32 + 33 + return clk; 34 + } 35 + EXPORT_SYMBOL(devm_clk_get); 36 + 37 + static int devm_clk_match(struct device *dev, void *res, void *data) 38 + { 39 + struct clk **c = res; 40 + if (!c || !*c) { 41 + WARN_ON(!c || !*c); 42 + return 0; 43 + } 44 + return *c == data; 45 + } 46 + 47 + void devm_clk_put(struct device *dev, struct clk *clk) 48 + { 49 + int ret; 50 + 51 + ret = devres_release(dev, devm_clk_release, devm_clk_match, clk); 52 + 53 + WARN_ON(ret); 54 + } 55 + EXPORT_SYMBOL(devm_clk_put);
-45
drivers/clk/clkdev.c
··· 171 171 } 172 172 EXPORT_SYMBOL(clk_put); 173 173 174 - static void devm_clk_release(struct device *dev, void *res) 175 - { 176 - clk_put(*(struct clk **)res); 177 - } 178 - 179 - struct clk *devm_clk_get(struct device *dev, const char *id) 180 - { 181 - struct clk **ptr, *clk; 182 - 183 - ptr = devres_alloc(devm_clk_release, sizeof(*ptr), GFP_KERNEL); 184 - if (!ptr) 185 - return ERR_PTR(-ENOMEM); 186 - 187 - clk = clk_get(dev, id); 188 - if (!IS_ERR(clk)) { 189 - *ptr = clk; 190 - devres_add(dev, ptr); 191 - } else { 192 - devres_free(ptr); 193 - } 194 - 195 - return clk; 196 - } 197 - EXPORT_SYMBOL(devm_clk_get); 198 - 199 - static int devm_clk_match(struct device *dev, void *res, void *data) 200 - { 201 - struct clk **c = res; 202 - if (!c || !*c) { 203 - WARN_ON(!c || !*c); 204 - return 0; 205 - } 206 - return *c == data; 207 - } 208 - 209 - void devm_clk_put(struct device *dev, struct clk *clk) 210 - { 211 - int ret; 212 - 213 - ret = devres_destroy(dev, devm_clk_release, devm_clk_match, clk); 214 - 215 - WARN_ON(ret); 216 - } 217 - EXPORT_SYMBOL(devm_clk_put); 218 - 219 174 void clkdev_add(struct clk_lookup *cl) 220 175 { 221 176 mutex_lock(&clocks_mutex);
+34 -29
drivers/cpufreq/powernow-k8.c
··· 35 35 #include <linux/slab.h> 36 36 #include <linux/string.h> 37 37 #include <linux/cpumask.h> 38 - #include <linux/sched.h> /* for current / set_cpus_allowed() */ 39 38 #include <linux/io.h> 40 39 #include <linux/delay.h> 41 40 ··· 1138 1139 return res; 1139 1140 } 1140 1141 1141 - /* Driver entry point to switch to the target frequency */ 1142 - static int powernowk8_target(struct cpufreq_policy *pol, 1143 - unsigned targfreq, unsigned relation) 1142 + struct powernowk8_target_arg { 1143 + struct cpufreq_policy *pol; 1144 + unsigned targfreq; 1145 + unsigned relation; 1146 + }; 1147 + 1148 + static long powernowk8_target_fn(void *arg) 1144 1149 { 1145 - cpumask_var_t oldmask; 1150 + struct powernowk8_target_arg *pta = arg; 1151 + struct cpufreq_policy *pol = pta->pol; 1152 + unsigned targfreq = pta->targfreq; 1153 + unsigned relation = pta->relation; 1146 1154 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); 1147 1155 u32 checkfid; 1148 1156 u32 checkvid; 1149 1157 unsigned int newstate; 1150 - int ret = -EIO; 1158 + int ret; 1151 1159 1152 1160 if (!data) 1153 1161 return -EINVAL; ··· 1162 1156 checkfid = data->currfid; 1163 1157 checkvid = data->currvid; 1164 1158 1165 - /* only run on specific CPU from here on. */ 1166 - /* This is poor form: use a workqueue or smp_call_function_single */ 1167 - if (!alloc_cpumask_var(&oldmask, GFP_KERNEL)) 1168 - return -ENOMEM; 1169 - 1170 - cpumask_copy(oldmask, tsk_cpus_allowed(current)); 1171 - set_cpus_allowed_ptr(current, cpumask_of(pol->cpu)); 1172 - 1173 - if (smp_processor_id() != pol->cpu) { 1174 - printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); 1175 - goto err_out; 1176 - } 1177 - 1178 1159 if (pending_bit_stuck()) { 1179 1160 printk(KERN_ERR PFX "failing targ, change pending bit set\n"); 1180 - goto err_out; 1161 + return -EIO; 1181 1162 } 1182 1163 1183 1164 pr_debug("targ: cpu %d, %d kHz, min %d, max %d, relation %d\n", 1184 1165 pol->cpu, targfreq, pol->min, pol->max, relation); 1185 1166 1186 1167 if (query_current_values_with_pending_wait(data)) 1187 - goto err_out; 1168 + return -EIO; 1188 1169 1189 1170 if (cpu_family != CPU_HW_PSTATE) { 1190 1171 pr_debug("targ: curr fid 0x%x, vid 0x%x\n", ··· 1189 1196 1190 1197 if (cpufreq_frequency_table_target(pol, data->powernow_table, 1191 1198 targfreq, relation, &newstate)) 1192 - goto err_out; 1199 + return -EIO; 1193 1200 1194 1201 mutex_lock(&fidvid_mutex); 1195 1202 ··· 1202 1209 ret = transition_frequency_fidvid(data, newstate); 1203 1210 if (ret) { 1204 1211 printk(KERN_ERR PFX "transition frequency failed\n"); 1205 - ret = 1; 1206 1212 mutex_unlock(&fidvid_mutex); 1207 - goto err_out; 1213 + return 1; 1208 1214 } 1209 1215 mutex_unlock(&fidvid_mutex); 1210 1216 ··· 1212 1220 data->powernow_table[newstate].index); 1213 1221 else 1214 1222 pol->cur = find_khz_freq_from_fid(data->currfid); 1215 - ret = 0; 1216 1223 1217 - err_out: 1218 - set_cpus_allowed_ptr(current, oldmask); 1219 - free_cpumask_var(oldmask); 1220 - return ret; 1224 + return 0; 1225 + } 1226 + 1227 + /* Driver entry point to switch to the target frequency */ 1228 + static int powernowk8_target(struct cpufreq_policy *pol, 1229 + unsigned targfreq, unsigned relation) 1230 + { 1231 + struct powernowk8_target_arg pta = { .pol = pol, .targfreq = targfreq, 1232 + .relation = relation }; 1233 + 1234 + /* 1235 + * Must run on @pol->cpu. cpufreq core is responsible for ensuring 1236 + * that we're bound to the current CPU and pol->cpu stays online. 1237 + */ 1238 + if (smp_processor_id() == pol->cpu) 1239 + return powernowk8_target_fn(&pta); 1240 + else 1241 + return work_on_cpu(pol->cpu, powernowk8_target_fn, &pta); 1221 1242 } 1222 1243 1223 1244 /* Driver entry point to verify the policy and range of frequencies */
+12 -1
drivers/dma/at_hdmac.c
··· 661 661 flags); 662 662 663 663 if (unlikely(!atslave || !sg_len)) { 664 - dev_dbg(chan2dev(chan), "prep_dma_memcpy: length is zero!\n"); 664 + dev_dbg(chan2dev(chan), "prep_slave_sg: sg length is zero!\n"); 665 665 return NULL; 666 666 } 667 667 ··· 689 689 690 690 mem = sg_dma_address(sg); 691 691 len = sg_dma_len(sg); 692 + if (unlikely(!len)) { 693 + dev_dbg(chan2dev(chan), 694 + "prep_slave_sg: sg(%d) data length is zero\n", i); 695 + goto err; 696 + } 692 697 mem_width = 2; 693 698 if (unlikely(mem & 3 || len & 3)) 694 699 mem_width = 0; ··· 729 724 730 725 mem = sg_dma_address(sg); 731 726 len = sg_dma_len(sg); 727 + if (unlikely(!len)) { 728 + dev_dbg(chan2dev(chan), 729 + "prep_slave_sg: sg(%d) data length is zero\n", i); 730 + goto err; 731 + } 732 732 mem_width = 2; 733 733 if (unlikely(mem & 3 || len & 3)) 734 734 mem_width = 0; ··· 767 757 768 758 err_desc_get: 769 759 dev_err(chan2dev(chan), "not enough descriptors available\n"); 760 + err: 770 761 atc_desc_put(atchan, first); 771 762 return NULL; 772 763 }
+14 -7
drivers/dma/pl330.c
··· 1567 1567 goto xfer_exit; 1568 1568 } 1569 1569 1570 - /* Prefer Secure Channel */ 1571 - if (!_manager_ns(thrd)) 1572 - r->cfg->nonsecure = 0; 1573 - else 1574 - r->cfg->nonsecure = 1; 1575 1570 1576 1571 /* Use last settings, if not provided */ 1577 - if (r->cfg) 1572 + if (r->cfg) { 1573 + /* Prefer Secure Channel */ 1574 + if (!_manager_ns(thrd)) 1575 + r->cfg->nonsecure = 0; 1576 + else 1577 + r->cfg->nonsecure = 1; 1578 + 1578 1579 ccr = _prepare_ccr(r->cfg); 1579 - else 1580 + } else { 1580 1581 ccr = readl(regs + CC(thrd->id)); 1582 + } 1581 1583 1582 1584 /* If this req doesn't have valid xfer settings */ 1583 1585 if (!_is_valid(ccr)) { ··· 2930 2928 num_chan = max_t(int, pi->pcfg.num_peri, pi->pcfg.num_chan); 2931 2929 2932 2930 pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL); 2931 + if (!pdmac->peripherals) { 2932 + ret = -ENOMEM; 2933 + dev_err(&adev->dev, "unable to allocate pdmac->peripherals\n"); 2934 + goto probe_err5; 2935 + } 2933 2936 2934 2937 for (i = 0; i < num_chan; i++) { 2935 2938 pch = &pdmac->peripherals[i];
+39 -18
drivers/edac/edac_mc.c
··· 199 199 return (void *)(((unsigned long)ptr) + align - r); 200 200 } 201 201 202 + static void _edac_mc_free(struct mem_ctl_info *mci) 203 + { 204 + int i, chn, row; 205 + struct csrow_info *csr; 206 + const unsigned int tot_dimms = mci->tot_dimms; 207 + const unsigned int tot_channels = mci->num_cschannel; 208 + const unsigned int tot_csrows = mci->nr_csrows; 209 + 210 + if (mci->dimms) { 211 + for (i = 0; i < tot_dimms; i++) 212 + kfree(mci->dimms[i]); 213 + kfree(mci->dimms); 214 + } 215 + if (mci->csrows) { 216 + for (row = 0; row < tot_csrows; row++) { 217 + csr = mci->csrows[row]; 218 + if (csr) { 219 + if (csr->channels) { 220 + for (chn = 0; chn < tot_channels; chn++) 221 + kfree(csr->channels[chn]); 222 + kfree(csr->channels); 223 + } 224 + kfree(csr); 225 + } 226 + } 227 + kfree(mci->csrows); 228 + } 229 + kfree(mci); 230 + } 231 + 202 232 /** 203 233 * edac_mc_alloc: Allocate and partially fill a struct mem_ctl_info structure 204 234 * @mc_num: Memory controller number ··· 443 413 return mci; 444 414 445 415 error: 446 - if (mci->dimms) { 447 - for (i = 0; i < tot_dimms; i++) 448 - kfree(mci->dimms[i]); 449 - kfree(mci->dimms); 450 - } 451 - if (mci->csrows) { 452 - for (chn = 0; chn < tot_channels; chn++) { 453 - csr = mci->csrows[chn]; 454 - if (csr) { 455 - for (chn = 0; chn < tot_channels; chn++) 456 - kfree(csr->channels[chn]); 457 - kfree(csr); 458 - } 459 - kfree(mci->csrows[i]); 460 - } 461 - kfree(mci->csrows); 462 - } 463 - kfree(mci); 416 + _edac_mc_free(mci); 464 417 465 418 return NULL; 466 419 } ··· 457 444 void edac_mc_free(struct mem_ctl_info *mci) 458 445 { 459 446 edac_dbg(1, "\n"); 447 + 448 + /* If we're not yet registered with sysfs free only what was allocated 449 + * in edac_mc_alloc(). 450 + */ 451 + if (!device_is_registered(&mci->dev)) { 452 + _edac_mc_free(mci); 453 + return; 454 + } 460 455 461 456 /* the mci instance is freed here, when the sysfs object is dropped */ 462 457 edac_unregister_sysfs(mci);
+1 -1
drivers/edac/i3200_edac.c
··· 391 391 for (j = 0; j < nr_channels; j++) { 392 392 struct dimm_info *dimm = csrow->channels[j]->dimm; 393 393 394 - dimm->nr_pages = nr_pages / nr_channels; 394 + dimm->nr_pages = nr_pages; 395 395 dimm->grain = nr_pages << PAGE_SHIFT; 396 396 dimm->mtype = MEM_DDR2; 397 397 dimm->dtype = DEV_UNKNOWN;
+4
drivers/edac/i5000_edac.c
··· 1012 1012 /* add the number of COLUMN bits */ 1013 1013 addrBits += MTR_DIMM_COLS_ADDR_BITS(mtr); 1014 1014 1015 + /* Dual-rank memories have twice the size */ 1016 + if (dinfo->dual_rank) 1017 + addrBits++; 1018 + 1015 1019 addrBits += 6; /* add 64 bits per DIMM */ 1016 1020 addrBits -= 20; /* divide by 2^^20 */ 1017 1021 addrBits -= 3; /* 8 bits per bytes */
+4 -3
drivers/edac/sb_edac.c
··· 513 513 { 514 514 struct sbridge_pvt *pvt = mci->pvt_info; 515 515 struct dimm_info *dimm; 516 - int i, j, banks, ranks, rows, cols, size, npages; 516 + unsigned i, j, banks, ranks, rows, cols, npages; 517 + u64 size; 517 518 u32 reg; 518 519 enum edac_type mode; 519 520 enum mem_type mtype; ··· 586 585 cols = numcol(mtr); 587 586 588 587 /* DDR3 has 8 I/O banks */ 589 - size = (rows * cols * banks * ranks) >> (20 - 3); 588 + size = ((u64)rows * cols * banks * ranks) >> (20 - 3); 590 589 npages = MiB_TO_PAGES(size); 591 590 592 - edac_dbg(0, "mc#%d: channel %d, dimm %d, %d Mb (%d pages) bank: %d, rank: %d, row: %#x, col: %#x\n", 591 + edac_dbg(0, "mc#%d: channel %d, dimm %d, %Ld Mb (%d pages) bank: %d, rank: %d, row: %#x, col: %#x\n", 593 592 pvt->sbridge_dev->mc, i, j, 594 593 size, npages, 595 594 banks, ranks, rows, cols);
+12 -7
drivers/extcon/extcon-max77693.c
··· 669 669 } 670 670 info->dev = &pdev->dev; 671 671 info->max77693 = max77693; 672 - info->max77693->regmap_muic = regmap_init_i2c(info->max77693->muic, 673 - &max77693_muic_regmap_config); 674 - if (IS_ERR(info->max77693->regmap_muic)) { 675 - ret = PTR_ERR(info->max77693->regmap_muic); 676 - dev_err(max77693->dev, 677 - "failed to allocate register map: %d\n", ret); 678 - goto err_regmap; 672 + if (info->max77693->regmap_muic) 673 + dev_dbg(&pdev->dev, "allocate register map\n"); 674 + else { 675 + info->max77693->regmap_muic = devm_regmap_init_i2c( 676 + info->max77693->muic, 677 + &max77693_muic_regmap_config); 678 + if (IS_ERR(info->max77693->regmap_muic)) { 679 + ret = PTR_ERR(info->max77693->regmap_muic); 680 + dev_err(max77693->dev, 681 + "failed to allocate register map: %d\n", ret); 682 + goto err_regmap; 683 + } 679 684 } 680 685 platform_set_drvdata(pdev, info); 681 686 mutex_init(&info->mutex);
+5
drivers/gpio/gpio-lpc32xx.c
··· 308 308 { 309 309 struct lpc32xx_gpio_chip *group = to_lpc32xx_gpio(chip); 310 310 311 + __set_gpio_level_p012(group, pin, value); 311 312 __set_gpio_dir_p012(group, pin, 0); 312 313 313 314 return 0; ··· 319 318 { 320 319 struct lpc32xx_gpio_chip *group = to_lpc32xx_gpio(chip); 321 320 321 + __set_gpio_level_p3(group, pin, value); 322 322 __set_gpio_dir_p3(group, pin, 0); 323 323 324 324 return 0; ··· 328 326 static int lpc32xx_gpio_dir_out_always(struct gpio_chip *chip, unsigned pin, 329 327 int value) 330 328 { 329 + struct lpc32xx_gpio_chip *group = to_lpc32xx_gpio(chip); 330 + 331 + __set_gpo_level_p3(group, pin, value); 331 332 return 0; 332 333 } 333 334
+2 -1
drivers/gpu/drm/i915/i915_gem.c
··· 3242 3242 { 3243 3243 int ret; 3244 3244 3245 - BUG_ON(obj->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT); 3245 + if (WARN_ON(obj->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT)) 3246 + return -EBUSY; 3246 3247 3247 3248 if (obj->gtt_space != NULL) { 3248 3249 if ((alignment && obj->gtt_offset & (alignment - 1)) ||
+6 -6
drivers/gpu/drm/i915/intel_display.c
··· 4191 4191 POSTING_READ(DPLL(pipe)); 4192 4192 udelay(150); 4193 4193 4194 - I915_WRITE(DPLL(pipe), dpll); 4195 - 4196 - /* Wait for the clocks to stabilize. */ 4197 - POSTING_READ(DPLL(pipe)); 4198 - udelay(150); 4199 - 4200 4194 /* The LVDS pin pair needs to be on before the DPLLs are enabled. 4201 4195 * This is an exception to the general rule that mode_set doesn't turn 4202 4196 * things on. 4203 4197 */ 4204 4198 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) 4205 4199 intel_update_lvds(crtc, clock, adjusted_mode); 4200 + 4201 + I915_WRITE(DPLL(pipe), dpll); 4202 + 4203 + /* Wait for the clocks to stabilize. */ 4204 + POSTING_READ(DPLL(pipe)); 4205 + udelay(150); 4206 4206 4207 4207 /* The pixel multiplier can only be updated once the 4208 4208 * DPLL is enabled and the clocks are stable.
+1 -1
drivers/gpu/drm/i915/intel_hdmi.c
··· 609 609 u32 temp; 610 610 u32 enable_bits = SDVO_ENABLE; 611 611 612 - if (intel_hdmi->has_audio) 612 + if (intel_hdmi->has_audio || mode != DRM_MODE_DPMS_ON) 613 613 enable_bits |= SDVO_AUDIO_ENABLE; 614 614 615 615 temp = I915_READ(intel_hdmi->sdvox_reg);
+1 -1
drivers/gpu/drm/nouveau/nouveau_abi16.c
··· 179 179 return 0; 180 180 } else 181 181 if (init->class == 0x906e) { 182 - NV_ERROR(dev, "906e not supported yet\n"); 182 + NV_DEBUG(dev, "906e not supported yet\n"); 183 183 return -EINVAL; 184 184 } 185 185
+14 -1
drivers/gpu/drm/nouveau/nv50_gpio.c
··· 22 22 * Authors: Ben Skeggs 23 23 */ 24 24 25 + #include <linux/dmi.h> 25 26 #include "drmP.h" 26 27 #include "nouveau_drv.h" 27 28 #include "nouveau_hw.h" ··· 111 110 nv_wr32(dev, 0xe074, intr1); 112 111 } 113 112 113 + static struct dmi_system_id gpio_reset_ids[] = { 114 + { 115 + .ident = "Apple Macbook 10,1", 116 + .matches = { 117 + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), 118 + DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro10,1"), 119 + } 120 + }, 121 + { } 122 + }; 123 + 114 124 int 115 125 nv50_gpio_init(struct drm_device *dev) 116 126 { 117 127 struct drm_nouveau_private *dev_priv = dev->dev_private; 118 128 119 129 /* initialise gpios and routing to vbios defaults */ 120 - nouveau_gpio_reset(dev); 130 + if (dmi_check_system(gpio_reset_ids)) 131 + nouveau_gpio_reset(dev); 121 132 122 133 /* disable, and ack any pending gpio interrupts */ 123 134 nv_wr32(dev, 0xe050, 0x00000000);
+1
drivers/gpu/drm/nouveau/nvc0_fb.c
··· 124 124 priv = dev_priv->engine.fb.priv; 125 125 126 126 nv_wr32(dev, 0x100c10, priv->r100c10 >> 8); 127 + nv_mask(dev, 0x17e820, 0x00100000, 0x00000000); /* NV_PLTCG_INTR_EN */ 127 128 return 0; 128 129 } 129 130
+2 -1
drivers/gpu/drm/nouveau/nvc0_fifo.c
··· 373 373 static void 374 374 nvc0_fifo_isr(struct drm_device *dev) 375 375 { 376 - u32 stat = nv_rd32(dev, 0x002100); 376 + u32 mask = nv_rd32(dev, 0x002140); 377 + u32 stat = nv_rd32(dev, 0x002100) & mask; 377 378 378 379 if (stat & 0x00000100) { 379 380 NV_INFO(dev, "PFIFO: unknown status 0x00000100\n");
+2 -1
drivers/gpu/drm/nouveau/nve0_fifo.c
··· 345 345 static void 346 346 nve0_fifo_isr(struct drm_device *dev) 347 347 { 348 - u32 stat = nv_rd32(dev, 0x002100); 348 + u32 mask = nv_rd32(dev, 0x002140); 349 + u32 stat = nv_rd32(dev, 0x002100) & mask; 349 350 350 351 if (stat & 0x00000100) { 351 352 NV_INFO(dev, "PFIFO: unknown status 0x00000100\n");
+34 -129
drivers/gpu/drm/radeon/atombios_crtc.c
··· 1479 1479 } 1480 1480 } 1481 1481 1482 - /** 1483 - * radeon_get_pll_use_mask - look up a mask of which pplls are in use 1484 - * 1485 - * @crtc: drm crtc 1486 - * 1487 - * Returns the mask of which PPLLs (Pixel PLLs) are in use. 1488 - */ 1489 - static u32 radeon_get_pll_use_mask(struct drm_crtc *crtc) 1490 - { 1491 - struct drm_device *dev = crtc->dev; 1492 - struct drm_crtc *test_crtc; 1493 - struct radeon_crtc *radeon_test_crtc; 1494 - u32 pll_in_use = 0; 1495 - 1496 - list_for_each_entry(test_crtc, &dev->mode_config.crtc_list, head) { 1497 - if (crtc == test_crtc) 1498 - continue; 1499 - 1500 - radeon_test_crtc = to_radeon_crtc(test_crtc); 1501 - if (radeon_test_crtc->pll_id != ATOM_PPLL_INVALID) 1502 - pll_in_use |= (1 << radeon_test_crtc->pll_id); 1503 - } 1504 - return pll_in_use; 1505 - } 1506 - 1507 - /** 1508 - * radeon_get_shared_dp_ppll - return the PPLL used by another crtc for DP 1509 - * 1510 - * @crtc: drm crtc 1511 - * 1512 - * Returns the PPLL (Pixel PLL) used by another crtc/encoder which is 1513 - * also in DP mode. For DP, a single PPLL can be used for all DP 1514 - * crtcs/encoders. 1515 - */ 1516 - static int radeon_get_shared_dp_ppll(struct drm_crtc *crtc) 1517 - { 1518 - struct drm_device *dev = crtc->dev; 1519 - struct drm_encoder *test_encoder; 1520 - struct radeon_crtc *radeon_test_crtc; 1521 - 1522 - list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { 1523 - if (test_encoder->crtc && (test_encoder->crtc != crtc)) { 1524 - if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(test_encoder))) { 1525 - /* for DP use the same PLL for all */ 1526 - radeon_test_crtc = to_radeon_crtc(test_encoder->crtc); 1527 - if (radeon_test_crtc->pll_id != ATOM_PPLL_INVALID) 1528 - return radeon_test_crtc->pll_id; 1529 - } 1530 - } 1531 - } 1532 - return ATOM_PPLL_INVALID; 1533 - } 1534 - 1535 - /** 1536 - * radeon_atom_pick_pll - Allocate a PPLL for use by the crtc. 1537 - * 1538 - * @crtc: drm crtc 1539 - * 1540 - * Returns the PPLL (Pixel PLL) to be used by the crtc. For DP monitors 1541 - * a single PPLL can be used for all DP crtcs/encoders. For non-DP 1542 - * monitors a dedicated PPLL must be used. If a particular board has 1543 - * an external DP PLL, return ATOM_PPLL_INVALID to skip PLL programming 1544 - * as there is no need to program the PLL itself. If we are not able to 1545 - * allocate a PLL, return ATOM_PPLL_INVALID to skip PLL programming to 1546 - * avoid messing up an existing monitor. 1547 - * 1548 - * Asic specific PLL information 1549 - * 1550 - * DCE 6.1 1551 - * - PPLL2 is only available to UNIPHYA (both DP and non-DP) 1552 - * - PPLL0, PPLL1 are available for UNIPHYB/C/D/E/F (both DP and non-DP) 1553 - * 1554 - * DCE 6.0 1555 - * - PPLL0 is available to all UNIPHY (DP only) 1556 - * - PPLL1, PPLL2 are available for all UNIPHY (both DP and non-DP) and DAC 1557 - * 1558 - * DCE 5.0 1559 - * - DCPLL is available to all UNIPHY (DP only) 1560 - * - PPLL1, PPLL2 are available for all UNIPHY (both DP and non-DP) and DAC 1561 - * 1562 - * DCE 3.0/4.0/4.1 1563 - * - PPLL1, PPLL2 are available for all UNIPHY (both DP and non-DP) and DAC 1564 - * 1565 - */ 1566 1482 static int radeon_atom_pick_pll(struct drm_crtc *crtc) 1567 1483 { 1568 1484 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); 1569 1485 struct drm_device *dev = crtc->dev; 1570 1486 struct radeon_device *rdev = dev->dev_private; 1571 1487 struct drm_encoder *test_encoder; 1572 - u32 pll_in_use; 1573 - int pll; 1488 + struct drm_crtc *test_crtc; 1489 + uint32_t pll_in_use = 0; 1574 1490 1575 1491 if (ASIC_IS_DCE61(rdev)) { 1576 1492 list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { ··· 1498 1582 1499 1583 if ((test_radeon_encoder->encoder_id == 1500 1584 ENCODER_OBJECT_ID_INTERNAL_UNIPHY) && 1501 - (dig->linkb == false)) 1502 - /* UNIPHY A uses PPLL2 */ 1585 + (dig->linkb == false)) /* UNIPHY A uses PPLL2 */ 1503 1586 return ATOM_PPLL2; 1504 - else if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(test_encoder))) { 1505 - /* UNIPHY B/C/D/E/F */ 1506 - if (rdev->clock.dp_extclk) 1507 - /* skip PPLL programming if using ext clock */ 1508 - return ATOM_PPLL_INVALID; 1509 - else { 1510 - /* use the same PPLL for all DP monitors */ 1511 - pll = radeon_get_shared_dp_ppll(crtc); 1512 - if (pll != ATOM_PPLL_INVALID) 1513 - return pll; 1514 - } 1515 - } 1516 - break; 1517 1587 } 1518 1588 } 1519 1589 /* UNIPHY B/C/D/E/F */ 1520 - pll_in_use = radeon_get_pll_use_mask(crtc); 1521 - if (!(pll_in_use & (1 << ATOM_PPLL0))) 1590 + list_for_each_entry(test_crtc, &dev->mode_config.crtc_list, head) { 1591 + struct radeon_crtc *radeon_test_crtc; 1592 + 1593 + if (crtc == test_crtc) 1594 + continue; 1595 + 1596 + radeon_test_crtc = to_radeon_crtc(test_crtc); 1597 + if ((radeon_test_crtc->pll_id == ATOM_PPLL0) || 1598 + (radeon_test_crtc->pll_id == ATOM_PPLL1)) 1599 + pll_in_use |= (1 << radeon_test_crtc->pll_id); 1600 + } 1601 + if (!(pll_in_use & 4)) 1522 1602 return ATOM_PPLL0; 1523 - if (!(pll_in_use & (1 << ATOM_PPLL1))) 1524 - return ATOM_PPLL1; 1525 - DRM_ERROR("unable to allocate a PPLL\n"); 1526 - return ATOM_PPLL_INVALID; 1603 + return ATOM_PPLL1; 1527 1604 } else if (ASIC_IS_DCE4(rdev)) { 1528 1605 list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { 1529 1606 if (test_encoder->crtc && (test_encoder->crtc == crtc)) { 1530 1607 /* in DP mode, the DP ref clock can come from PPLL, DCPLL, or ext clock, 1531 1608 * depending on the asic: 1532 1609 * DCE4: PPLL or ext clock 1533 - * DCE5: PPLL, DCPLL, or ext clock 1534 - * DCE6: PPLL, PPLL0, or ext clock 1610 + * DCE5: DCPLL or ext clock 1535 1611 * 1536 1612 * Setting ATOM_PPLL_INVALID will cause SetPixelClock to skip 1537 1613 * PPLL/DCPLL programming and only program the DP DTO for the ··· 1531 1623 */ 1532 1624 if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(test_encoder))) { 1533 1625 if (rdev->clock.dp_extclk) 1534 - /* skip PPLL programming if using ext clock */ 1535 1626 return ATOM_PPLL_INVALID; 1536 1627 else if (ASIC_IS_DCE6(rdev)) 1537 - /* use PPLL0 for all DP */ 1538 1628 return ATOM_PPLL0; 1539 1629 else if (ASIC_IS_DCE5(rdev)) 1540 - /* use DCPLL for all DP */ 1541 1630 return ATOM_DCPLL; 1542 - else { 1543 - /* use the same PPLL for all DP monitors */ 1544 - pll = radeon_get_shared_dp_ppll(crtc); 1545 - if (pll != ATOM_PPLL_INVALID) 1546 - return pll; 1547 - } 1548 1631 } 1549 - break; 1550 1632 } 1551 1633 } 1552 - /* all other cases */ 1553 - pll_in_use = radeon_get_pll_use_mask(crtc); 1554 - if (!(pll_in_use & (1 << ATOM_PPLL2))) 1555 - return ATOM_PPLL2; 1556 - if (!(pll_in_use & (1 << ATOM_PPLL1))) 1634 + 1635 + /* otherwise, pick one of the plls */ 1636 + list_for_each_entry(test_crtc, &dev->mode_config.crtc_list, head) { 1637 + struct radeon_crtc *radeon_test_crtc; 1638 + 1639 + if (crtc == test_crtc) 1640 + continue; 1641 + 1642 + radeon_test_crtc = to_radeon_crtc(test_crtc); 1643 + if ((radeon_test_crtc->pll_id >= ATOM_PPLL1) && 1644 + (radeon_test_crtc->pll_id <= ATOM_PPLL2)) 1645 + pll_in_use |= (1 << radeon_test_crtc->pll_id); 1646 + } 1647 + if (!(pll_in_use & 1)) 1557 1648 return ATOM_PPLL1; 1558 - DRM_ERROR("unable to allocate a PPLL\n"); 1559 - return ATOM_PPLL_INVALID; 1649 + return ATOM_PPLL2; 1560 1650 } else 1561 - /* use PPLL1 or PPLL2 */ 1562 1651 return radeon_crtc->crtc_id; 1563 1652 1564 1653 } ··· 1697 1792 break; 1698 1793 } 1699 1794 done: 1700 - radeon_crtc->pll_id = ATOM_PPLL_INVALID; 1795 + radeon_crtc->pll_id = -1; 1701 1796 } 1702 1797 1703 1798 static const struct drm_crtc_helper_funcs atombios_helper_funcs = { ··· 1746 1841 else 1747 1842 radeon_crtc->crtc_offset = 0; 1748 1843 } 1749 - radeon_crtc->pll_id = ATOM_PPLL_INVALID; 1844 + radeon_crtc->pll_id = -1; 1750 1845 drm_crtc_helper_add(&radeon_crtc->base, &atombios_helper_funcs); 1751 1846 }
+2 -1
drivers/gpu/drm/radeon/r100.c
··· 1182 1182 ring->ready = true; 1183 1183 radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size); 1184 1184 1185 - if (radeon_ring_supports_scratch_reg(rdev, ring)) { 1185 + if (!ring->rptr_save_reg /* not resuming from suspend */ 1186 + && radeon_ring_supports_scratch_reg(rdev, ring)) { 1186 1187 r = radeon_scratch_get(rdev, &ring->rptr_save_reg); 1187 1188 if (r) { 1188 1189 DRM_ERROR("failed to get scratch reg for rptr save (%d).\n", r);
+7
drivers/gpu/drm/udl/udl_connector.c
··· 69 69 static int udl_mode_valid(struct drm_connector *connector, 70 70 struct drm_display_mode *mode) 71 71 { 72 + struct udl_device *udl = connector->dev->dev_private; 73 + if (!udl->sku_pixel_limit) 74 + return 0; 75 + 76 + if (mode->vdisplay * mode->hdisplay > udl->sku_pixel_limit) 77 + return MODE_VIRTUAL_Y; 78 + 72 79 return 0; 73 80 } 74 81
+1 -1
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
··· 1018 1018 } 1019 1019 1020 1020 1021 - event = kzalloc(sizeof(event->event), GFP_KERNEL); 1021 + event = kzalloc(sizeof(*event), GFP_KERNEL); 1022 1022 if (unlikely(event == NULL)) { 1023 1023 DRM_ERROR("Failed to allocate an event.\n"); 1024 1024 ret = -ENOMEM;
+2
drivers/hid/hid-lenovo-tpkbd.c
··· 519 519 led_classdev_unregister(&data_pointer->led_mute); 520 520 521 521 hid_set_drvdata(hdev, NULL); 522 + kfree(data_pointer->led_micmute.name); 523 + kfree(data_pointer->led_mute.name); 522 524 kfree(data_pointer); 523 525 } 524 526
+45
drivers/hid/hid-logitech-dj.c
··· 193 193 static int logi_dj_output_hidraw_report(struct hid_device *hid, u8 * buf, 194 194 size_t count, 195 195 unsigned char report_type); 196 + static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev); 196 197 197 198 static void logi_dj_recv_destroy_djhid_device(struct dj_receiver_dev *djrcv_dev, 198 199 struct dj_report *dj_report) ··· 234 233 if (dj_report->report_params[DEVICE_PAIRED_PARAM_SPFUNCTION] & 235 234 SPFUNCTION_DEVICE_LIST_EMPTY) { 236 235 dbg_hid("%s: device list is empty\n", __func__); 236 + djrcv_dev->querying_devices = false; 237 237 return; 238 238 } 239 239 ··· 242 240 (dj_report->device_index > DJ_DEVICE_INDEX_MAX)) { 243 241 dev_err(&djrcv_hdev->dev, "%s: invalid device index:%d\n", 244 242 __func__, dj_report->device_index); 243 + return; 244 + } 245 + 246 + if (djrcv_dev->paired_dj_devices[dj_report->device_index]) { 247 + /* The device is already known. No need to reallocate it. */ 248 + dbg_hid("%s: device is already known\n", __func__); 245 249 return; 246 250 } 247 251 ··· 314 306 struct dj_report dj_report; 315 307 unsigned long flags; 316 308 int count; 309 + int retval; 317 310 318 311 dbg_hid("%s\n", __func__); 319 312 ··· 347 338 logi_dj_recv_destroy_djhid_device(djrcv_dev, &dj_report); 348 339 break; 349 340 default: 341 + /* A normal report (i. e. not belonging to a pair/unpair notification) 342 + * arriving here, means that the report arrived but we did not have a 343 + * paired dj_device associated to the report's device_index, this 344 + * means that the original "device paired" notification corresponding 345 + * to this dj_device never arrived to this driver. The reason is that 346 + * hid-core discards all packets coming from a device while probe() is 347 + * executing. */ 348 + if (!djrcv_dev->paired_dj_devices[dj_report.device_index]) { 349 + /* ok, we don't know the device, just re-ask the 350 + * receiver for the list of connected devices. */ 351 + retval = logi_dj_recv_query_paired_devices(djrcv_dev); 352 + if (!retval) { 353 + /* everything went fine, so just leave */ 354 + break; 355 + } 356 + dev_err(&djrcv_dev->hdev->dev, 357 + "%s:logi_dj_recv_query_paired_devices " 358 + "error:%d\n", __func__, retval); 359 + } 350 360 dbg_hid("%s: unexpected report type\n", __func__); 351 361 } 352 362 } ··· 396 368 if (!djdev) { 397 369 dbg_hid("djrcv_dev->paired_dj_devices[dj_report->device_index]" 398 370 " is NULL, index %d\n", dj_report->device_index); 371 + kfifo_in(&djrcv_dev->notif_fifo, dj_report, sizeof(struct dj_report)); 372 + 373 + if (schedule_work(&djrcv_dev->work) == 0) { 374 + dbg_hid("%s: did not schedule the work item, was already " 375 + "queued\n", __func__); 376 + } 399 377 return; 400 378 } 401 379 ··· 432 398 if (dj_device == NULL) { 433 399 dbg_hid("djrcv_dev->paired_dj_devices[dj_report->device_index]" 434 400 " is NULL, index %d\n", dj_report->device_index); 401 + kfifo_in(&djrcv_dev->notif_fifo, dj_report, sizeof(struct dj_report)); 402 + 403 + if (schedule_work(&djrcv_dev->work) == 0) { 404 + dbg_hid("%s: did not schedule the work item, was already " 405 + "queued\n", __func__); 406 + } 435 407 return; 436 408 } 437 409 ··· 479 439 struct dj_report *dj_report; 480 440 int retval; 481 441 442 + /* no need to protect djrcv_dev->querying_devices */ 443 + if (djrcv_dev->querying_devices) 444 + return 0; 445 + 482 446 dj_report = kzalloc(sizeof(struct dj_report), GFP_KERNEL); 483 447 if (!dj_report) 484 448 return -ENOMEM; ··· 493 449 kfree(dj_report); 494 450 return retval; 495 451 } 452 + 496 453 497 454 static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, 498 455 unsigned timeout)
+1
drivers/hid/hid-logitech-dj.h
··· 101 101 struct work_struct work; 102 102 struct kfifo notif_fifo; 103 103 spinlock_t lock; 104 + bool querying_devices; 104 105 }; 105 106 106 107 struct dj_device {
+8
drivers/hwmon/ad7314.c
··· 87 87 } 88 88 } 89 89 90 + static ssize_t ad7314_show_name(struct device *dev, 91 + struct device_attribute *devattr, char *buf) 92 + { 93 + return sprintf(buf, "%s\n", to_spi_device(dev)->modalias); 94 + } 95 + 96 + static DEVICE_ATTR(name, S_IRUGO, ad7314_show_name, NULL); 90 97 static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, 91 98 ad7314_show_temperature, NULL, 0); 92 99 93 100 static struct attribute *ad7314_attributes[] = { 101 + &dev_attr_name.attr, 94 102 &sensor_dev_attr_temp1_input.dev_attr.attr, 95 103 NULL, 96 104 };
+9
drivers/hwmon/ads7871.c
··· 139 139 } 140 140 } 141 141 142 + static ssize_t ads7871_show_name(struct device *dev, 143 + struct device_attribute *devattr, char *buf) 144 + { 145 + return sprintf(buf, "%s\n", to_spi_device(dev)->modalias); 146 + } 147 + 142 148 static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, show_voltage, NULL, 0); 143 149 static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, show_voltage, NULL, 1); 144 150 static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, show_voltage, NULL, 2); ··· 153 147 static SENSOR_DEVICE_ATTR(in5_input, S_IRUGO, show_voltage, NULL, 5); 154 148 static SENSOR_DEVICE_ATTR(in6_input, S_IRUGO, show_voltage, NULL, 6); 155 149 static SENSOR_DEVICE_ATTR(in7_input, S_IRUGO, show_voltage, NULL, 7); 150 + 151 + static DEVICE_ATTR(name, S_IRUGO, ads7871_show_name, NULL); 156 152 157 153 static struct attribute *ads7871_attributes[] = { 158 154 &sensor_dev_attr_in0_input.dev_attr.attr, ··· 165 157 &sensor_dev_attr_in5_input.dev_attr.attr, 166 158 &sensor_dev_attr_in6_input.dev_attr.attr, 167 159 &sensor_dev_attr_in7_input.dev_attr.attr, 160 + &dev_attr_name.attr, 168 161 NULL 169 162 }; 170 163
+2 -2
drivers/hwmon/applesmc.c
··· 53 53 54 54 #define APPLESMC_MAX_DATA_LENGTH 32 55 55 56 - /* wait up to 32 ms for a status change. */ 56 + /* wait up to 128 ms for a status change. */ 57 57 #define APPLESMC_MIN_WAIT 0x0010 58 58 #define APPLESMC_RETRY_WAIT 0x0100 59 - #define APPLESMC_MAX_WAIT 0x8000 59 + #define APPLESMC_MAX_WAIT 0x20000 60 60 61 61 #define APPLESMC_READ_CMD 0x10 62 62 #define APPLESMC_WRITE_CMD 0x11
+5
drivers/hwmon/coretemp.c
··· 815 815 if (err) 816 816 goto exit; 817 817 818 + get_online_cpus(); 818 819 for_each_online_cpu(i) 819 820 get_core_online(i); 820 821 821 822 #ifndef CONFIG_HOTPLUG_CPU 822 823 if (list_empty(&pdev_list)) { 824 + put_online_cpus(); 823 825 err = -ENODEV; 824 826 goto exit_driver_unreg; 825 827 } 826 828 #endif 827 829 828 830 register_hotcpu_notifier(&coretemp_cpu_notifier); 831 + put_online_cpus(); 829 832 return 0; 830 833 831 834 #ifndef CONFIG_HOTPLUG_CPU ··· 843 840 { 844 841 struct pdev_entry *p, *n; 845 842 843 + get_online_cpus(); 846 844 unregister_hotcpu_notifier(&coretemp_cpu_notifier); 847 845 mutex_lock(&pdev_list_mutex); 848 846 list_for_each_entry_safe(p, n, &pdev_list, list) { ··· 852 848 kfree(p); 853 849 } 854 850 mutex_unlock(&pdev_list_mutex); 851 + put_online_cpus(); 855 852 platform_driver_unregister(&coretemp_driver); 856 853 } 857 854
+13 -2
drivers/hwmon/fam15h_power.c
··· 129 129 * counter saturations resulting in bogus power readings. 130 130 * We correct this value ourselves to cope with older BIOSes. 131 131 */ 132 - static DEFINE_PCI_DEVICE_TABLE(affected_device) = { 132 + static const struct pci_device_id affected_device[] = { 133 133 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) }, 134 134 { 0 } 135 135 }; 136 136 137 - static void __devinit tweak_runavg_range(struct pci_dev *pdev) 137 + static void tweak_runavg_range(struct pci_dev *pdev) 138 138 { 139 139 u32 val; 140 140 ··· 157 157 PCI_DEVFN(PCI_SLOT(pdev->devfn), 5), 158 158 REG_TDP_RUNNING_AVERAGE, val); 159 159 } 160 + 161 + #ifdef CONFIG_PM 162 + static int fam15h_power_resume(struct pci_dev *pdev) 163 + { 164 + tweak_runavg_range(pdev); 165 + return 0; 166 + } 167 + #else 168 + #define fam15h_power_resume NULL 169 + #endif 160 170 161 171 static void __devinit fam15h_power_init_data(struct pci_dev *f4, 162 172 struct fam15h_power_data *data) ··· 266 256 .id_table = fam15h_power_id_table, 267 257 .probe = fam15h_power_probe, 268 258 .remove = __devexit_p(fam15h_power_remove), 259 + .resume = fam15h_power_resume, 269 260 }; 270 261 271 262 module_pci_driver(fam15h_power_driver);
+5
drivers/hwmon/via-cputemp.c
··· 328 328 if (err) 329 329 goto exit; 330 330 331 + get_online_cpus(); 331 332 for_each_online_cpu(i) { 332 333 struct cpuinfo_x86 *c = &cpu_data(i); 333 334 ··· 348 347 349 348 #ifndef CONFIG_HOTPLUG_CPU 350 349 if (list_empty(&pdev_list)) { 350 + put_online_cpus(); 351 351 err = -ENODEV; 352 352 goto exit_driver_unreg; 353 353 } 354 354 #endif 355 355 356 356 register_hotcpu_notifier(&via_cputemp_cpu_notifier); 357 + put_online_cpus(); 357 358 return 0; 358 359 359 360 #ifndef CONFIG_HOTPLUG_CPU ··· 370 367 { 371 368 struct pdev_entry *p, *n; 372 369 370 + get_online_cpus(); 373 371 unregister_hotcpu_notifier(&via_cputemp_cpu_notifier); 374 372 mutex_lock(&pdev_list_mutex); 375 373 list_for_each_entry_safe(p, n, &pdev_list, list) { ··· 379 375 kfree(p); 380 376 } 381 377 mutex_unlock(&pdev_list_mutex); 378 + put_online_cpus(); 382 379 platform_driver_unregister(&via_cputemp_driver); 383 380 } 384 381
+2 -1
drivers/hwspinlock/hwspinlock_core.c
··· 552 552 */ 553 553 int hwspin_lock_free(struct hwspinlock *hwlock) 554 554 { 555 - struct device *dev = hwlock->bank->dev; 555 + struct device *dev; 556 556 struct hwspinlock *tmp; 557 557 int ret; 558 558 ··· 561 561 return -EINVAL; 562 562 } 563 563 564 + dev = hwlock->bank->dev; 564 565 mutex_lock(&hwspinlock_tree_lock); 565 566 566 567 /* make sure the hwspinlock is used */
+1 -1
drivers/infiniband/hw/cxgb4/cm.c
··· 1361 1361 struct tid_info *t = dev->rdev.lldi.tids; 1362 1362 1363 1363 ep = lookup_tid(t, tid); 1364 - PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid); 1365 1364 if (!ep) { 1366 1365 printk(KERN_WARNING MOD "Abort rpl to freed endpoint\n"); 1367 1366 return 0; 1368 1367 } 1368 + PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid); 1369 1369 mutex_lock(&ep->com.mutex); 1370 1370 switch (ep->com.state) { 1371 1371 case ABORTING:
+4 -4
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
··· 2219 2219 u32 wqe_idx; 2220 2220 2221 2221 if (!qp->wqe_wr_id_tbl[tail].signaled) { 2222 - expand = true; /* CQE cannot be consumed yet */ 2223 2222 *polled = false; /* WC cannot be consumed yet */ 2224 2223 } else { 2225 2224 ibwc->status = IB_WC_SUCCESS; ··· 2226 2227 ibwc->qp = &qp->ibqp; 2227 2228 ocrdma_update_wc(qp, ibwc, tail); 2228 2229 *polled = true; 2229 - wqe_idx = le32_to_cpu(cqe->wq.wqeidx) & OCRDMA_CQE_WQEIDX_MASK; 2230 - if (tail != wqe_idx) 2231 - expand = true; /* Coalesced CQE can't be consumed yet */ 2232 2230 } 2231 + wqe_idx = le32_to_cpu(cqe->wq.wqeidx) & OCRDMA_CQE_WQEIDX_MASK; 2232 + if (tail != wqe_idx) 2233 + expand = true; /* Coalesced CQE can't be consumed yet */ 2234 + 2233 2235 ocrdma_hwq_inc_tail(&qp->sq); 2234 2236 return expand; 2235 2237 }
+2 -1
drivers/infiniband/hw/qib/qib_mad.c
··· 471 471 if (port_num != port) { 472 472 ibp = to_iport(ibdev, port_num); 473 473 ret = check_mkey(ibp, smp, 0); 474 - if (ret) 474 + if (ret) { 475 475 ret = IB_MAD_RESULT_FAILURE; 476 476 goto bail; 477 + } 477 478 } 478 479 } 479 480
+4 -1
drivers/infiniband/ulp/ipoib/ipoib.h
··· 266 266 u16 max_coalesced_frames; 267 267 }; 268 268 269 + struct ipoib_neigh_table; 270 + 269 271 struct ipoib_neigh_hash { 272 + struct ipoib_neigh_table *ntbl; 270 273 struct ipoib_neigh __rcu **buckets; 271 274 struct rcu_head rcu; 272 275 u32 mask; ··· 278 275 279 276 struct ipoib_neigh_table { 280 277 struct ipoib_neigh_hash __rcu *htbl; 281 - rwlock_t rwlock; 282 278 atomic_t entries; 283 279 struct completion flushed; 280 + struct completion deleted; 284 281 }; 285 282 286 283 /*
+44 -49
drivers/infiniband/ulp/ipoib/ipoib_main.c
··· 551 551 struct ipoib_neigh *neigh; 552 552 unsigned long flags; 553 553 554 + spin_lock_irqsave(&priv->lock, flags); 554 555 neigh = ipoib_neigh_alloc(daddr, dev); 555 556 if (!neigh) { 557 + spin_unlock_irqrestore(&priv->lock, flags); 556 558 ++dev->stats.tx_dropped; 557 559 dev_kfree_skb_any(skb); 558 560 return; 559 561 } 560 - 561 - spin_lock_irqsave(&priv->lock, flags); 562 562 563 563 path = __path_find(dev, daddr + 4); 564 564 if (!path) { ··· 868 868 if (test_bit(IPOIB_STOP_NEIGH_GC, &priv->flags)) 869 869 return; 870 870 871 - write_lock_bh(&ntbl->rwlock); 871 + spin_lock_irqsave(&priv->lock, flags); 872 872 873 873 htbl = rcu_dereference_protected(ntbl->htbl, 874 - lockdep_is_held(&ntbl->rwlock)); 874 + lockdep_is_held(&priv->lock)); 875 875 876 876 if (!htbl) 877 877 goto out_unlock; ··· 888 888 struct ipoib_neigh __rcu **np = &htbl->buckets[i]; 889 889 890 890 while ((neigh = rcu_dereference_protected(*np, 891 - lockdep_is_held(&ntbl->rwlock))) != NULL) { 891 + lockdep_is_held(&priv->lock))) != NULL) { 892 892 /* was the neigh idle for two GC periods */ 893 893 if (time_after(neigh_obsolete, neigh->alive)) { 894 894 rcu_assign_pointer(*np, 895 895 rcu_dereference_protected(neigh->hnext, 896 - lockdep_is_held(&ntbl->rwlock))); 896 + lockdep_is_held(&priv->lock))); 897 897 /* remove from path/mc list */ 898 - spin_lock_irqsave(&priv->lock, flags); 899 898 list_del(&neigh->list); 900 - spin_unlock_irqrestore(&priv->lock, flags); 901 899 call_rcu(&neigh->rcu, ipoib_neigh_reclaim); 902 900 } else { 903 901 np = &neigh->hnext; ··· 905 907 } 906 908 907 909 out_unlock: 908 - write_unlock_bh(&ntbl->rwlock); 910 + spin_unlock_irqrestore(&priv->lock, flags); 909 911 } 910 912 911 913 static void ipoib_reap_neigh(struct work_struct *work) ··· 950 952 struct ipoib_neigh *neigh; 951 953 u32 hash_val; 952 954 953 - write_lock_bh(&ntbl->rwlock); 954 - 955 955 htbl = rcu_dereference_protected(ntbl->htbl, 956 - lockdep_is_held(&ntbl->rwlock)); 956 + lockdep_is_held(&priv->lock)); 957 957 if (!htbl) { 958 958 neigh = NULL; 959 959 goto out_unlock; ··· 962 966 */ 963 967 hash_val = ipoib_addr_hash(htbl, daddr); 964 968 for (neigh = rcu_dereference_protected(htbl->buckets[hash_val], 965 - lockdep_is_held(&ntbl->rwlock)); 969 + lockdep_is_held(&priv->lock)); 966 970 neigh != NULL; 967 971 neigh = rcu_dereference_protected(neigh->hnext, 968 - lockdep_is_held(&ntbl->rwlock))) { 972 + lockdep_is_held(&priv->lock))) { 969 973 if (memcmp(daddr, neigh->daddr, INFINIBAND_ALEN) == 0) { 970 974 /* found, take one ref on behalf of the caller */ 971 975 if (!atomic_inc_not_zero(&neigh->refcnt)) { ··· 988 992 /* put in hash */ 989 993 rcu_assign_pointer(neigh->hnext, 990 994 rcu_dereference_protected(htbl->buckets[hash_val], 991 - lockdep_is_held(&ntbl->rwlock))); 995 + lockdep_is_held(&priv->lock))); 992 996 rcu_assign_pointer(htbl->buckets[hash_val], neigh); 993 997 atomic_inc(&ntbl->entries); 994 998 995 999 out_unlock: 996 - write_unlock_bh(&ntbl->rwlock); 997 1000 998 1001 return neigh; 999 1002 } ··· 1040 1045 struct ipoib_neigh *n; 1041 1046 u32 hash_val; 1042 1047 1043 - write_lock_bh(&ntbl->rwlock); 1044 - 1045 1048 htbl = rcu_dereference_protected(ntbl->htbl, 1046 - lockdep_is_held(&ntbl->rwlock)); 1049 + lockdep_is_held(&priv->lock)); 1047 1050 if (!htbl) 1048 - goto out_unlock; 1051 + return; 1049 1052 1050 1053 hash_val = ipoib_addr_hash(htbl, neigh->daddr); 1051 1054 np = &htbl->buckets[hash_val]; 1052 1055 for (n = rcu_dereference_protected(*np, 1053 - lockdep_is_held(&ntbl->rwlock)); 1056 + lockdep_is_held(&priv->lock)); 1054 1057 n != NULL; 1055 1058 n = rcu_dereference_protected(*np, 1056 - lockdep_is_held(&ntbl->rwlock))) { 1059 + lockdep_is_held(&priv->lock))) { 1057 1060 if (n == neigh) { 1058 1061 /* found */ 1059 1062 rcu_assign_pointer(*np, 1060 1063 rcu_dereference_protected(neigh->hnext, 1061 - lockdep_is_held(&ntbl->rwlock))); 1064 + lockdep_is_held(&priv->lock))); 1062 1065 call_rcu(&neigh->rcu, ipoib_neigh_reclaim); 1063 - goto out_unlock; 1066 + return; 1064 1067 } else { 1065 1068 np = &n->hnext; 1066 1069 } 1067 1070 } 1068 - 1069 - out_unlock: 1070 - write_unlock_bh(&ntbl->rwlock); 1071 - 1072 1071 } 1073 1072 1074 1073 static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv) ··· 1074 1085 1075 1086 clear_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags); 1076 1087 ntbl->htbl = NULL; 1077 - rwlock_init(&ntbl->rwlock); 1078 1088 htbl = kzalloc(sizeof(*htbl), GFP_KERNEL); 1079 1089 if (!htbl) 1080 1090 return -ENOMEM; ··· 1088 1100 htbl->mask = (size - 1); 1089 1101 htbl->buckets = buckets; 1090 1102 ntbl->htbl = htbl; 1103 + htbl->ntbl = ntbl; 1091 1104 atomic_set(&ntbl->entries, 0); 1092 1105 1093 1106 /* start garbage collection */ ··· 1105 1116 struct ipoib_neigh_hash, 1106 1117 rcu); 1107 1118 struct ipoib_neigh __rcu **buckets = htbl->buckets; 1119 + struct ipoib_neigh_table *ntbl = htbl->ntbl; 1108 1120 1109 1121 kfree(buckets); 1110 1122 kfree(htbl); 1123 + complete(&ntbl->deleted); 1111 1124 } 1112 1125 1113 1126 void ipoib_del_neighs_by_gid(struct net_device *dev, u8 *gid) ··· 1121 1130 int i; 1122 1131 1123 1132 /* remove all neigh connected to a given path or mcast */ 1124 - write_lock_bh(&ntbl->rwlock); 1133 + spin_lock_irqsave(&priv->lock, flags); 1125 1134 1126 1135 htbl = rcu_dereference_protected(ntbl->htbl, 1127 - lockdep_is_held(&ntbl->rwlock)); 1136 + lockdep_is_held(&priv->lock)); 1128 1137 1129 1138 if (!htbl) 1130 1139 goto out_unlock; ··· 1134 1143 struct ipoib_neigh __rcu **np = &htbl->buckets[i]; 1135 1144 1136 1145 while ((neigh = rcu_dereference_protected(*np, 1137 - lockdep_is_held(&ntbl->rwlock))) != NULL) { 1146 + lockdep_is_held(&priv->lock))) != NULL) { 1138 1147 /* delete neighs belong to this parent */ 1139 1148 if (!memcmp(gid, neigh->daddr + 4, sizeof (union ib_gid))) { 1140 1149 rcu_assign_pointer(*np, 1141 1150 rcu_dereference_protected(neigh->hnext, 1142 - lockdep_is_held(&ntbl->rwlock))); 1151 + lockdep_is_held(&priv->lock))); 1143 1152 /* remove from parent list */ 1144 - spin_lock_irqsave(&priv->lock, flags); 1145 1153 list_del(&neigh->list); 1146 - spin_unlock_irqrestore(&priv->lock, flags); 1147 1154 call_rcu(&neigh->rcu, ipoib_neigh_reclaim); 1148 1155 } else { 1149 1156 np = &neigh->hnext; ··· 1150 1161 } 1151 1162 } 1152 1163 out_unlock: 1153 - write_unlock_bh(&ntbl->rwlock); 1164 + spin_unlock_irqrestore(&priv->lock, flags); 1154 1165 } 1155 1166 1156 1167 static void ipoib_flush_neighs(struct ipoib_dev_priv *priv) ··· 1158 1169 struct ipoib_neigh_table *ntbl = &priv->ntbl; 1159 1170 struct ipoib_neigh_hash *htbl; 1160 1171 unsigned long flags; 1161 - int i; 1172 + int i, wait_flushed = 0; 1162 1173 1163 - write_lock_bh(&ntbl->rwlock); 1174 + init_completion(&priv->ntbl.flushed); 1175 + 1176 + spin_lock_irqsave(&priv->lock, flags); 1164 1177 1165 1178 htbl = rcu_dereference_protected(ntbl->htbl, 1166 - lockdep_is_held(&ntbl->rwlock)); 1179 + lockdep_is_held(&priv->lock)); 1167 1180 if (!htbl) 1168 1181 goto out_unlock; 1182 + 1183 + wait_flushed = atomic_read(&priv->ntbl.entries); 1184 + if (!wait_flushed) 1185 + goto free_htbl; 1169 1186 1170 1187 for (i = 0; i < htbl->size; i++) { 1171 1188 struct ipoib_neigh *neigh; 1172 1189 struct ipoib_neigh __rcu **np = &htbl->buckets[i]; 1173 1190 1174 1191 while ((neigh = rcu_dereference_protected(*np, 1175 - lockdep_is_held(&ntbl->rwlock))) != NULL) { 1192 + lockdep_is_held(&priv->lock))) != NULL) { 1176 1193 rcu_assign_pointer(*np, 1177 1194 rcu_dereference_protected(neigh->hnext, 1178 - lockdep_is_held(&ntbl->rwlock))); 1195 + lockdep_is_held(&priv->lock))); 1179 1196 /* remove from path/mc list */ 1180 - spin_lock_irqsave(&priv->lock, flags); 1181 1197 list_del(&neigh->list); 1182 - spin_unlock_irqrestore(&priv->lock, flags); 1183 1198 call_rcu(&neigh->rcu, ipoib_neigh_reclaim); 1184 1199 } 1185 1200 } 1186 1201 1202 + free_htbl: 1187 1203 rcu_assign_pointer(ntbl->htbl, NULL); 1188 1204 call_rcu(&htbl->rcu, neigh_hash_free_rcu); 1189 1205 1190 1206 out_unlock: 1191 - write_unlock_bh(&ntbl->rwlock); 1207 + spin_unlock_irqrestore(&priv->lock, flags); 1208 + if (wait_flushed) 1209 + wait_for_completion(&priv->ntbl.flushed); 1192 1210 } 1193 1211 1194 1212 static void ipoib_neigh_hash_uninit(struct net_device *dev) ··· 1204 1208 int stopped; 1205 1209 1206 1210 ipoib_dbg(priv, "ipoib_neigh_hash_uninit\n"); 1207 - init_completion(&priv->ntbl.flushed); 1211 + init_completion(&priv->ntbl.deleted); 1208 1212 set_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags); 1209 1213 1210 1214 /* Stop GC if called at init fail need to cancel work */ ··· 1212 1216 if (!stopped) 1213 1217 cancel_delayed_work(&priv->neigh_reap_task); 1214 1218 1215 - if (atomic_read(&priv->ntbl.entries)) { 1216 - ipoib_flush_neighs(priv); 1217 - wait_for_completion(&priv->ntbl.flushed); 1218 - } 1219 + ipoib_flush_neighs(priv); 1220 + 1221 + wait_for_completion(&priv->ntbl.deleted); 1219 1222 } 1220 1223 1221 1224
-2
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
··· 707 707 neigh = ipoib_neigh_get(dev, daddr); 708 708 spin_lock_irqsave(&priv->lock, flags); 709 709 if (!neigh) { 710 - spin_unlock_irqrestore(&priv->lock, flags); 711 710 neigh = ipoib_neigh_alloc(daddr, dev); 712 - spin_lock_irqsave(&priv->lock, flags); 713 711 if (neigh) { 714 712 kref_get(&mcast->ah->ref); 715 713 neigh->ah = mcast->ah;
+2 -2
drivers/input/keyboard/imx_keypad.c
··· 516 516 input_set_drvdata(input_dev, keypad); 517 517 518 518 /* Ensure that the keypad will stay dormant until opened */ 519 - clk_enable(keypad->clk); 519 + clk_prepare_enable(keypad->clk); 520 520 imx_keypad_inhibit(keypad); 521 - clk_disable(keypad->clk); 521 + clk_disable_unprepare(keypad->clk); 522 522 523 523 error = request_irq(irq, imx_keypad_irq_handler, 0, 524 524 pdev->name, keypad);
+2 -2
drivers/input/misc/ab8500-ponkey.c
··· 74 74 75 75 ponkey->idev = input; 76 76 ponkey->ab8500 = ab8500; 77 - ponkey->irq_dbf = ab8500_irq_get_virq(ab8500, irq_dbf); 78 - ponkey->irq_dbr = ab8500_irq_get_virq(ab8500, irq_dbr); 77 + ponkey->irq_dbf = irq_dbf; 78 + ponkey->irq_dbr = irq_dbr; 79 79 80 80 input->name = "AB8500 POn(PowerOn) Key"; 81 81 input->dev.parent = &pdev->dev;
+11
drivers/input/mouse/sentelic.c
··· 721 721 722 722 switch (psmouse->packet[0] >> FSP_PKT_TYPE_SHIFT) { 723 723 case FSP_PKT_TYPE_ABS: 724 + 725 + if ((packet[0] == 0x48 || packet[0] == 0x49) && 726 + packet[1] == 0 && packet[2] == 0) { 727 + /* 728 + * Ignore coordinate noise when finger leaving the 729 + * surface, otherwise cursor may jump to upper-left 730 + * corner. 731 + */ 732 + packet[3] &= 0xf0; 733 + } 734 + 724 735 abs_x = GET_ABS_X(packet); 725 736 abs_y = GET_ABS_Y(packet); 726 737
+3 -3
drivers/input/serio/ambakmi.c
··· 72 72 unsigned int divisor; 73 73 int ret; 74 74 75 - ret = clk_enable(kmi->clk); 75 + ret = clk_prepare_enable(kmi->clk); 76 76 if (ret) 77 77 goto out; 78 78 ··· 92 92 return 0; 93 93 94 94 clk_disable: 95 - clk_disable(kmi->clk); 95 + clk_disable_unprepare(kmi->clk); 96 96 out: 97 97 return ret; 98 98 } ··· 104 104 writeb(0, KMICR); 105 105 106 106 free_irq(kmi->irq, kmi); 107 - clk_disable(kmi->clk); 107 + clk_disable_unprepare(kmi->clk); 108 108 } 109 109 110 110 static int __devinit amba_kmi_probe(struct amba_device *dev,
+6
drivers/input/serio/i8042-x86ia64io.h
··· 335 335 }, 336 336 { 337 337 .matches = { 338 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 339 + DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"), 340 + }, 341 + }, 342 + { 343 + .matches = { 338 344 DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"), 339 345 DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"), 340 346 },
+6 -3
drivers/input/touchscreen/edt-ft5x06.c
··· 566 566 } 567 567 568 568 read = min_t(size_t, count, tsdata->raw_bufsize - *off); 569 - error = copy_to_user(buf, tsdata->raw_buffer + *off, read); 570 - if (!error) 571 - *off += read; 569 + if (copy_to_user(buf, tsdata->raw_buffer + *off, read)) { 570 + error = -EFAULT; 571 + goto out; 572 + } 573 + 574 + *off += read; 572 575 out: 573 576 mutex_unlock(&tsdata->mutex); 574 577 return error ?: read;
+40
drivers/input/touchscreen/usbtouchscreen.c
··· 304 304 #define EGALAX_PKT_TYPE_REPT 0x80 305 305 #define EGALAX_PKT_TYPE_DIAG 0x0A 306 306 307 + static int egalax_init(struct usbtouch_usb *usbtouch) 308 + { 309 + int ret, i; 310 + unsigned char *buf; 311 + struct usb_device *udev = interface_to_usbdev(usbtouch->interface); 312 + 313 + /* 314 + * An eGalax diagnostic packet kicks the device into using the right 315 + * protocol. We send a "check active" packet. The response will be 316 + * read later and ignored. 317 + */ 318 + 319 + buf = kmalloc(3, GFP_KERNEL); 320 + if (!buf) 321 + return -ENOMEM; 322 + 323 + buf[0] = EGALAX_PKT_TYPE_DIAG; 324 + buf[1] = 1; /* length */ 325 + buf[2] = 'A'; /* command - check active */ 326 + 327 + for (i = 0; i < 3; i++) { 328 + ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 329 + 0, 330 + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 331 + 0, 0, buf, 3, 332 + USB_CTRL_SET_TIMEOUT); 333 + if (ret >= 0) { 334 + ret = 0; 335 + break; 336 + } 337 + if (ret != -EPIPE) 338 + break; 339 + } 340 + 341 + kfree(buf); 342 + 343 + return ret; 344 + } 345 + 307 346 static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 308 347 { 309 348 if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT) ··· 1095 1056 .process_pkt = usbtouch_process_multi, 1096 1057 .get_pkt_len = egalax_get_pkt_len, 1097 1058 .read_data = egalax_read_data, 1059 + .init = egalax_init, 1098 1060 }, 1099 1061 #endif 1100 1062
+7 -4
drivers/md/dm-mpath.c
··· 1555 1555 unsigned long arg) 1556 1556 { 1557 1557 struct multipath *m = ti->private; 1558 + struct pgpath *pgpath; 1558 1559 struct block_device *bdev; 1559 1560 fmode_t mode; 1560 1561 unsigned long flags; ··· 1571 1570 if (!m->current_pgpath) 1572 1571 __choose_pgpath(m, 0); 1573 1572 1574 - if (m->current_pgpath) { 1575 - bdev = m->current_pgpath->path.dev->bdev; 1576 - mode = m->current_pgpath->path.dev->mode; 1573 + pgpath = m->current_pgpath; 1574 + 1575 + if (pgpath) { 1576 + bdev = pgpath->path.dev->bdev; 1577 + mode = pgpath->path.dev->mode; 1577 1578 } 1578 1579 1579 - if (m->queue_io) 1580 + if ((pgpath && m->queue_io) || (!pgpath && m->queue_if_no_path)) 1580 1581 r = -EAGAIN; 1581 1582 else if (!bdev) 1582 1583 r = -EIO;
+57 -4
drivers/md/dm-table.c
··· 1212 1212 return &t->targets[(KEYS_PER_NODE * n) + k]; 1213 1213 } 1214 1214 1215 + static int count_device(struct dm_target *ti, struct dm_dev *dev, 1216 + sector_t start, sector_t len, void *data) 1217 + { 1218 + unsigned *num_devices = data; 1219 + 1220 + (*num_devices)++; 1221 + 1222 + return 0; 1223 + } 1224 + 1225 + /* 1226 + * Check whether a table has no data devices attached using each 1227 + * target's iterate_devices method. 1228 + * Returns false if the result is unknown because a target doesn't 1229 + * support iterate_devices. 1230 + */ 1231 + bool dm_table_has_no_data_devices(struct dm_table *table) 1232 + { 1233 + struct dm_target *uninitialized_var(ti); 1234 + unsigned i = 0, num_devices = 0; 1235 + 1236 + while (i < dm_table_get_num_targets(table)) { 1237 + ti = dm_table_get_target(table, i++); 1238 + 1239 + if (!ti->type->iterate_devices) 1240 + return false; 1241 + 1242 + ti->type->iterate_devices(ti, count_device, &num_devices); 1243 + if (num_devices) 1244 + return false; 1245 + } 1246 + 1247 + return true; 1248 + } 1249 + 1215 1250 /* 1216 1251 * Establish the new table's queue_limits and validate them. 1217 1252 */ ··· 1389 1354 return q && blk_queue_nonrot(q); 1390 1355 } 1391 1356 1392 - static bool dm_table_is_nonrot(struct dm_table *t) 1357 + static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev, 1358 + sector_t start, sector_t len, void *data) 1359 + { 1360 + struct request_queue *q = bdev_get_queue(dev->bdev); 1361 + 1362 + return q && !blk_queue_add_random(q); 1363 + } 1364 + 1365 + static bool dm_table_all_devices_attribute(struct dm_table *t, 1366 + iterate_devices_callout_fn func) 1393 1367 { 1394 1368 struct dm_target *ti; 1395 1369 unsigned i = 0; 1396 1370 1397 - /* Ensure that all underlying device are non-rotational. */ 1398 1371 while (i < dm_table_get_num_targets(t)) { 1399 1372 ti = dm_table_get_target(t, i++); 1400 1373 1401 1374 if (!ti->type->iterate_devices || 1402 - !ti->type->iterate_devices(ti, device_is_nonrot, NULL)) 1375 + !ti->type->iterate_devices(ti, func, NULL)) 1403 1376 return 0; 1404 1377 } 1405 1378 ··· 1439 1396 if (!dm_table_discard_zeroes_data(t)) 1440 1397 q->limits.discard_zeroes_data = 0; 1441 1398 1442 - if (dm_table_is_nonrot(t)) 1399 + /* Ensure that all underlying devices are non-rotational. */ 1400 + if (dm_table_all_devices_attribute(t, device_is_nonrot)) 1443 1401 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); 1444 1402 else 1445 1403 queue_flag_clear_unlocked(QUEUE_FLAG_NONROT, q); 1446 1404 1447 1405 dm_table_set_integrity(t); 1406 + 1407 + /* 1408 + * Determine whether or not this queue's I/O timings contribute 1409 + * to the entropy pool, Only request-based targets use this. 1410 + * Clear QUEUE_FLAG_ADD_RANDOM if any underlying device does not 1411 + * have it set. 1412 + */ 1413 + if (blk_queue_add_random(q) && dm_table_all_devices_attribute(t, device_is_not_random)) 1414 + queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, q); 1448 1415 1449 1416 /* 1450 1417 * QUEUE_FLAG_STACKABLE must be set after all queue settings are
+88 -47
drivers/md/dm-thin.c
··· 509 509 struct pool_features { 510 510 enum pool_mode mode; 511 511 512 - unsigned zero_new_blocks:1; 513 - unsigned discard_enabled:1; 514 - unsigned discard_passdown:1; 512 + bool zero_new_blocks:1; 513 + bool discard_enabled:1; 514 + bool discard_passdown:1; 515 515 }; 516 516 517 517 struct thin_c; ··· 580 580 struct dm_target_callbacks callbacks; 581 581 582 582 dm_block_t low_water_blocks; 583 - struct pool_features pf; 583 + struct pool_features requested_pf; /* Features requested during table load */ 584 + struct pool_features adjusted_pf; /* Features used after adjusting for constituent devices */ 584 585 }; 585 586 586 587 /* ··· 1840 1839 /*---------------------------------------------------------------- 1841 1840 * Binding of control targets to a pool object 1842 1841 *--------------------------------------------------------------*/ 1842 + static bool data_dev_supports_discard(struct pool_c *pt) 1843 + { 1844 + struct request_queue *q = bdev_get_queue(pt->data_dev->bdev); 1845 + 1846 + return q && blk_queue_discard(q); 1847 + } 1848 + 1849 + /* 1850 + * If discard_passdown was enabled verify that the data device 1851 + * supports discards. Disable discard_passdown if not. 1852 + */ 1853 + static void disable_passdown_if_not_supported(struct pool_c *pt) 1854 + { 1855 + struct pool *pool = pt->pool; 1856 + struct block_device *data_bdev = pt->data_dev->bdev; 1857 + struct queue_limits *data_limits = &bdev_get_queue(data_bdev)->limits; 1858 + sector_t block_size = pool->sectors_per_block << SECTOR_SHIFT; 1859 + const char *reason = NULL; 1860 + char buf[BDEVNAME_SIZE]; 1861 + 1862 + if (!pt->adjusted_pf.discard_passdown) 1863 + return; 1864 + 1865 + if (!data_dev_supports_discard(pt)) 1866 + reason = "discard unsupported"; 1867 + 1868 + else if (data_limits->max_discard_sectors < pool->sectors_per_block) 1869 + reason = "max discard sectors smaller than a block"; 1870 + 1871 + else if (data_limits->discard_granularity > block_size) 1872 + reason = "discard granularity larger than a block"; 1873 + 1874 + else if (block_size & (data_limits->discard_granularity - 1)) 1875 + reason = "discard granularity not a factor of block size"; 1876 + 1877 + if (reason) { 1878 + DMWARN("Data device (%s) %s: Disabling discard passdown.", bdevname(data_bdev, buf), reason); 1879 + pt->adjusted_pf.discard_passdown = false; 1880 + } 1881 + } 1882 + 1843 1883 static int bind_control_target(struct pool *pool, struct dm_target *ti) 1844 1884 { 1845 1885 struct pool_c *pt = ti->private; ··· 1889 1847 * We want to make sure that degraded pools are never upgraded. 1890 1848 */ 1891 1849 enum pool_mode old_mode = pool->pf.mode; 1892 - enum pool_mode new_mode = pt->pf.mode; 1850 + enum pool_mode new_mode = pt->adjusted_pf.mode; 1893 1851 1894 1852 if (old_mode > new_mode) 1895 1853 new_mode = old_mode; 1896 1854 1897 1855 pool->ti = ti; 1898 1856 pool->low_water_blocks = pt->low_water_blocks; 1899 - pool->pf = pt->pf; 1900 - set_pool_mode(pool, new_mode); 1857 + pool->pf = pt->adjusted_pf; 1901 1858 1902 - /* 1903 - * If discard_passdown was enabled verify that the data device 1904 - * supports discards. Disable discard_passdown if not; otherwise 1905 - * -EOPNOTSUPP will be returned. 1906 - */ 1907 - /* FIXME: pull this out into a sep fn. */ 1908 - if (pt->pf.discard_passdown) { 1909 - struct request_queue *q = bdev_get_queue(pt->data_dev->bdev); 1910 - if (!q || !blk_queue_discard(q)) { 1911 - char buf[BDEVNAME_SIZE]; 1912 - DMWARN("Discard unsupported by data device (%s): Disabling discard passdown.", 1913 - bdevname(pt->data_dev->bdev, buf)); 1914 - pool->pf.discard_passdown = 0; 1915 - } 1916 - } 1859 + set_pool_mode(pool, new_mode); 1917 1860 1918 1861 return 0; 1919 1862 } ··· 1916 1889 static void pool_features_init(struct pool_features *pf) 1917 1890 { 1918 1891 pf->mode = PM_WRITE; 1919 - pf->zero_new_blocks = 1; 1920 - pf->discard_enabled = 1; 1921 - pf->discard_passdown = 1; 1892 + pf->zero_new_blocks = true; 1893 + pf->discard_enabled = true; 1894 + pf->discard_passdown = true; 1922 1895 } 1923 1896 1924 1897 static void __pool_destroy(struct pool *pool) ··· 2146 2119 argc--; 2147 2120 2148 2121 if (!strcasecmp(arg_name, "skip_block_zeroing")) 2149 - pf->zero_new_blocks = 0; 2122 + pf->zero_new_blocks = false; 2150 2123 2151 2124 else if (!strcasecmp(arg_name, "ignore_discard")) 2152 - pf->discard_enabled = 0; 2125 + pf->discard_enabled = false; 2153 2126 2154 2127 else if (!strcasecmp(arg_name, "no_discard_passdown")) 2155 - pf->discard_passdown = 0; 2128 + pf->discard_passdown = false; 2156 2129 2157 2130 else if (!strcasecmp(arg_name, "read_only")) 2158 2131 pf->mode = PM_READ_ONLY; ··· 2286 2259 pt->metadata_dev = metadata_dev; 2287 2260 pt->data_dev = data_dev; 2288 2261 pt->low_water_blocks = low_water_blocks; 2289 - pt->pf = pf; 2262 + pt->adjusted_pf = pt->requested_pf = pf; 2290 2263 ti->num_flush_requests = 1; 2264 + 2291 2265 /* 2292 2266 * Only need to enable discards if the pool should pass 2293 2267 * them down to the data device. The thin device's discard ··· 2296 2268 */ 2297 2269 if (pf.discard_enabled && pf.discard_passdown) { 2298 2270 ti->num_discard_requests = 1; 2271 + 2299 2272 /* 2300 2273 * Setting 'discards_supported' circumvents the normal 2301 2274 * stacking of discard limits (this keeps the pool and 2302 2275 * thin devices' discard limits consistent). 2303 2276 */ 2304 2277 ti->discards_supported = true; 2278 + ti->discard_zeroes_data_unsupported = true; 2305 2279 } 2306 2280 ti->private = pt; 2307 2281 ··· 2733 2703 format_dev_t(buf2, pt->data_dev->bdev->bd_dev), 2734 2704 (unsigned long)pool->sectors_per_block, 2735 2705 (unsigned long long)pt->low_water_blocks); 2736 - emit_flags(&pt->pf, result, sz, maxlen); 2706 + emit_flags(&pt->requested_pf, result, sz, maxlen); 2737 2707 break; 2738 2708 } 2739 2709 ··· 2762 2732 return min(max_size, q->merge_bvec_fn(q, bvm, biovec)); 2763 2733 } 2764 2734 2765 - static void set_discard_limits(struct pool *pool, struct queue_limits *limits) 2735 + static void set_discard_limits(struct pool_c *pt, struct queue_limits *limits) 2766 2736 { 2767 - /* 2768 - * FIXME: these limits may be incompatible with the pool's data device 2769 - */ 2737 + struct pool *pool = pt->pool; 2738 + struct queue_limits *data_limits; 2739 + 2770 2740 limits->max_discard_sectors = pool->sectors_per_block; 2771 2741 2772 2742 /* 2773 - * This is just a hint, and not enforced. We have to cope with 2774 - * bios that cover a block partially. A discard that spans a block 2775 - * boundary is not sent to this target. 2743 + * discard_granularity is just a hint, and not enforced. 2776 2744 */ 2777 - limits->discard_granularity = pool->sectors_per_block << SECTOR_SHIFT; 2778 - limits->discard_zeroes_data = pool->pf.zero_new_blocks; 2745 + if (pt->adjusted_pf.discard_passdown) { 2746 + data_limits = &bdev_get_queue(pt->data_dev->bdev)->limits; 2747 + limits->discard_granularity = data_limits->discard_granularity; 2748 + } else 2749 + limits->discard_granularity = pool->sectors_per_block << SECTOR_SHIFT; 2779 2750 } 2780 2751 2781 2752 static void pool_io_hints(struct dm_target *ti, struct queue_limits *limits) ··· 2786 2755 2787 2756 blk_limits_io_min(limits, 0); 2788 2757 blk_limits_io_opt(limits, pool->sectors_per_block << SECTOR_SHIFT); 2789 - if (pool->pf.discard_enabled) 2790 - set_discard_limits(pool, limits); 2758 + 2759 + /* 2760 + * pt->adjusted_pf is a staging area for the actual features to use. 2761 + * They get transferred to the live pool in bind_control_target() 2762 + * called from pool_preresume(). 2763 + */ 2764 + if (!pt->adjusted_pf.discard_enabled) 2765 + return; 2766 + 2767 + disable_passdown_if_not_supported(pt); 2768 + 2769 + set_discard_limits(pt, limits); 2791 2770 } 2792 2771 2793 2772 static struct target_type pool_target = { 2794 2773 .name = "thin-pool", 2795 2774 .features = DM_TARGET_SINGLETON | DM_TARGET_ALWAYS_WRITEABLE | 2796 2775 DM_TARGET_IMMUTABLE, 2797 - .version = {1, 3, 0}, 2776 + .version = {1, 4, 0}, 2798 2777 .module = THIS_MODULE, 2799 2778 .ctr = pool_ctr, 2800 2779 .dtr = pool_dtr, ··· 3083 3042 return 0; 3084 3043 } 3085 3044 3045 + /* 3046 + * A thin device always inherits its queue limits from its pool. 3047 + */ 3086 3048 static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits) 3087 3049 { 3088 3050 struct thin_c *tc = ti->private; 3089 - struct pool *pool = tc->pool; 3090 3051 3091 - blk_limits_io_min(limits, 0); 3092 - blk_limits_io_opt(limits, pool->sectors_per_block << SECTOR_SHIFT); 3093 - set_discard_limits(pool, limits); 3052 + *limits = bdev_get_queue(tc->pool_dev->bdev)->limits; 3094 3053 } 3095 3054 3096 3055 static struct target_type thin_target = { 3097 3056 .name = "thin", 3098 - .version = {1, 3, 0}, 3057 + .version = {1, 4, 0}, 3099 3058 .module = THIS_MODULE, 3100 3059 .ctr = thin_ctr, 3101 3060 .dtr = thin_dtr,
+4 -4
drivers/md/dm-verity.c
··· 718 718 v->hash_dev_block_bits = ffs(num) - 1; 719 719 720 720 if (sscanf(argv[5], "%llu%c", &num_ll, &dummy) != 1 || 721 - num_ll << (v->data_dev_block_bits - SECTOR_SHIFT) != 722 - (sector_t)num_ll << (v->data_dev_block_bits - SECTOR_SHIFT)) { 721 + (sector_t)(num_ll << (v->data_dev_block_bits - SECTOR_SHIFT)) 722 + >> (v->data_dev_block_bits - SECTOR_SHIFT) != num_ll) { 723 723 ti->error = "Invalid data blocks"; 724 724 r = -EINVAL; 725 725 goto bad; ··· 733 733 } 734 734 735 735 if (sscanf(argv[6], "%llu%c", &num_ll, &dummy) != 1 || 736 - num_ll << (v->hash_dev_block_bits - SECTOR_SHIFT) != 737 - (sector_t)num_ll << (v->hash_dev_block_bits - SECTOR_SHIFT)) { 736 + (sector_t)(num_ll << (v->hash_dev_block_bits - SECTOR_SHIFT)) 737 + >> (v->hash_dev_block_bits - SECTOR_SHIFT) != num_ll) { 738 738 ti->error = "Invalid hash start"; 739 739 r = -EINVAL; 740 740 goto bad;
+52 -19
drivers/md/dm.c
··· 865 865 { 866 866 int r = error; 867 867 struct dm_rq_target_io *tio = clone->end_io_data; 868 - dm_request_endio_fn rq_end_io = tio->ti->type->rq_end_io; 868 + dm_request_endio_fn rq_end_io = NULL; 869 869 870 - if (mapped && rq_end_io) 871 - r = rq_end_io(tio->ti, clone, error, &tio->info); 870 + if (tio->ti) { 871 + rq_end_io = tio->ti->type->rq_end_io; 872 + 873 + if (mapped && rq_end_io) 874 + r = rq_end_io(tio->ti, clone, error, &tio->info); 875 + } 872 876 873 877 if (r <= 0) 874 878 /* The target wants to complete the I/O */ ··· 1592 1588 int r, requeued = 0; 1593 1589 struct dm_rq_target_io *tio = clone->end_io_data; 1594 1590 1595 - /* 1596 - * Hold the md reference here for the in-flight I/O. 1597 - * We can't rely on the reference count by device opener, 1598 - * because the device may be closed during the request completion 1599 - * when all bios are completed. 1600 - * See the comment in rq_completed() too. 1601 - */ 1602 - dm_get(md); 1603 - 1604 1591 tio->ti = ti; 1605 1592 r = ti->type->map_rq(ti, clone, &tio->info); 1606 1593 switch (r) { ··· 1623 1628 return requeued; 1624 1629 } 1625 1630 1631 + static struct request *dm_start_request(struct mapped_device *md, struct request *orig) 1632 + { 1633 + struct request *clone; 1634 + 1635 + blk_start_request(orig); 1636 + clone = orig->special; 1637 + atomic_inc(&md->pending[rq_data_dir(clone)]); 1638 + 1639 + /* 1640 + * Hold the md reference here for the in-flight I/O. 1641 + * We can't rely on the reference count by device opener, 1642 + * because the device may be closed during the request completion 1643 + * when all bios are completed. 1644 + * See the comment in rq_completed() too. 1645 + */ 1646 + dm_get(md); 1647 + 1648 + return clone; 1649 + } 1650 + 1626 1651 /* 1627 1652 * q->request_fn for request-based dm. 1628 1653 * Called with the queue lock held. ··· 1672 1657 pos = blk_rq_pos(rq); 1673 1658 1674 1659 ti = dm_table_find_target(map, pos); 1675 - BUG_ON(!dm_target_is_valid(ti)); 1660 + if (!dm_target_is_valid(ti)) { 1661 + /* 1662 + * Must perform setup, that dm_done() requires, 1663 + * before calling dm_kill_unmapped_request 1664 + */ 1665 + DMERR_LIMIT("request attempted access beyond the end of device"); 1666 + clone = dm_start_request(md, rq); 1667 + dm_kill_unmapped_request(clone, -EIO); 1668 + continue; 1669 + } 1676 1670 1677 1671 if (ti->type->busy && ti->type->busy(ti)) 1678 1672 goto delay_and_out; 1679 1673 1680 - blk_start_request(rq); 1681 - clone = rq->special; 1682 - atomic_inc(&md->pending[rq_data_dir(clone)]); 1674 + clone = dm_start_request(md, rq); 1683 1675 1684 1676 spin_unlock(q->queue_lock); 1685 1677 if (map_request(ti, clone, md)) ··· 1706 1684 blk_delay_queue(q, HZ / 10); 1707 1685 out: 1708 1686 dm_table_put(map); 1709 - 1710 - return; 1711 1687 } 1712 1688 1713 1689 int dm_underlying_device_busy(struct request_queue *q) ··· 2429 2409 */ 2430 2410 struct dm_table *dm_swap_table(struct mapped_device *md, struct dm_table *table) 2431 2411 { 2432 - struct dm_table *map = ERR_PTR(-EINVAL); 2412 + struct dm_table *live_map, *map = ERR_PTR(-EINVAL); 2433 2413 struct queue_limits limits; 2434 2414 int r; 2435 2415 ··· 2438 2418 /* device must be suspended */ 2439 2419 if (!dm_suspended_md(md)) 2440 2420 goto out; 2421 + 2422 + /* 2423 + * If the new table has no data devices, retain the existing limits. 2424 + * This helps multipath with queue_if_no_path if all paths disappear, 2425 + * then new I/O is queued based on these limits, and then some paths 2426 + * reappear. 2427 + */ 2428 + if (dm_table_has_no_data_devices(table)) { 2429 + live_map = dm_get_live_table(md); 2430 + if (live_map) 2431 + limits = md->queue->limits; 2432 + dm_table_put(live_map); 2433 + } 2441 2434 2442 2435 r = dm_calculate_queue_limits(table, &limits); 2443 2436 if (r) {
+1
drivers/md/dm.h
··· 54 54 void (*fn)(void *), void *context); 55 55 struct dm_target *dm_table_get_target(struct dm_table *t, unsigned int index); 56 56 struct dm_target *dm_table_find_target(struct dm_table *t, sector_t sector); 57 + bool dm_table_has_no_data_devices(struct dm_table *table); 57 58 int dm_calculate_queue_limits(struct dm_table *table, 58 59 struct queue_limits *limits); 59 60 void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
+5 -1
drivers/md/md.c
··· 7619 7619 } 7620 7620 } 7621 7621 } 7622 + if (removed) 7623 + set_bit(MD_CHANGE_DEVS, &mddev->flags); 7622 7624 return spares; 7623 7625 } 7624 7626 ··· 7634 7632 !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { 7635 7633 /* success...*/ 7636 7634 /* activate any spares */ 7637 - if (mddev->pers->spare_active(mddev)) 7635 + if (mddev->pers->spare_active(mddev)) { 7638 7636 sysfs_notify(&mddev->kobj, NULL, 7639 7637 "degraded"); 7638 + set_bit(MD_CHANGE_DEVS, &mddev->flags); 7639 + } 7640 7640 } 7641 7641 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && 7642 7642 mddev->pers->finish_reshape)
+5 -3
drivers/md/raid10.c
··· 1512 1512 do { 1513 1513 int n = conf->copies; 1514 1514 int cnt = 0; 1515 + int this = first; 1515 1516 while (n--) { 1516 - if (conf->mirrors[first].rdev && 1517 - first != ignore) 1517 + if (conf->mirrors[this].rdev && 1518 + this != ignore) 1518 1519 cnt++; 1519 - first = (first+1) % geo->raid_disks; 1520 + this = (this+1) % geo->raid_disks; 1520 1521 } 1521 1522 if (cnt == 0) 1522 1523 return 0; 1524 + first = (first + geo->near_copies) % geo->raid_disks; 1523 1525 } while (first != 0); 1524 1526 return 1; 1525 1527 }
+6 -1
drivers/md/raid5.c
··· 393 393 degraded = 0; 394 394 for (i = 0; i < conf->previous_raid_disks; i++) { 395 395 struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev); 396 + if (rdev && test_bit(Faulty, &rdev->flags)) 397 + rdev = rcu_dereference(conf->disks[i].replacement); 396 398 if (!rdev || test_bit(Faulty, &rdev->flags)) 397 399 degraded++; 398 400 else if (test_bit(In_sync, &rdev->flags)) ··· 419 417 degraded2 = 0; 420 418 for (i = 0; i < conf->raid_disks; i++) { 421 419 struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev); 420 + if (rdev && test_bit(Faulty, &rdev->flags)) 421 + rdev = rcu_dereference(conf->disks[i].replacement); 422 422 if (!rdev || test_bit(Faulty, &rdev->flags)) 423 423 degraded2++; 424 424 else if (test_bit(In_sync, &rdev->flags)) ··· 1591 1587 #ifdef CONFIG_MULTICORE_RAID456 1592 1588 init_waitqueue_head(&nsh->ops.wait_for_ops); 1593 1589 #endif 1590 + spin_lock_init(&nsh->stripe_lock); 1594 1591 1595 1592 list_add(&nsh->lru, &newstripes); 1596 1593 } ··· 4197 4192 finish_wait(&conf->wait_for_overlap, &w); 4198 4193 set_bit(STRIPE_HANDLE, &sh->state); 4199 4194 clear_bit(STRIPE_DELAYED, &sh->state); 4200 - if ((bi->bi_rw & REQ_NOIDLE) && 4195 + if ((bi->bi_rw & REQ_SYNC) && 4201 4196 !test_and_set_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) 4202 4197 atomic_inc(&conf->preread_active_stripes); 4203 4198 release_stripe_plug(mddev, sh);
+3 -2
drivers/mfd/88pm800.c
··· 470 470 471 471 ret = 472 472 mfd_add_devices(chip->dev, 0, &onkey_devs[0], 473 - ARRAY_SIZE(onkey_devs), &onkey_resources[0], 0); 473 + ARRAY_SIZE(onkey_devs), &onkey_resources[0], 0, 474 + NULL); 474 475 if (ret < 0) { 475 476 dev_err(chip->dev, "Failed to add onkey subdev\n"); 476 477 goto out_dev; ··· 482 481 rtc_devs[0].platform_data = pdata->rtc; 483 482 rtc_devs[0].pdata_size = sizeof(struct pm80x_rtc_pdata); 484 483 ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0], 485 - ARRAY_SIZE(rtc_devs), NULL, 0); 484 + ARRAY_SIZE(rtc_devs), NULL, 0, NULL); 486 485 if (ret < 0) { 487 486 dev_err(chip->dev, "Failed to add rtc subdev\n"); 488 487 goto out_dev;
+2 -1
drivers/mfd/88pm805.c
··· 216 216 } 217 217 218 218 ret = mfd_add_devices(chip->dev, 0, &codec_devs[0], 219 - ARRAY_SIZE(codec_devs), &codec_resources[0], 0); 219 + ARRAY_SIZE(codec_devs), &codec_resources[0], 0, 220 + NULL); 220 221 if (ret < 0) { 221 222 dev_err(chip->dev, "Failed to add codec subdev\n"); 222 223 goto out_codec;
+11 -10
drivers/mfd/88pm860x-core.c
··· 637 637 bk_devs[i].resources = &bk_resources[j]; 638 638 ret = mfd_add_devices(chip->dev, 0, 639 639 &bk_devs[i], 1, 640 - &bk_resources[j], 0); 640 + &bk_resources[j], 0, NULL); 641 641 if (ret < 0) { 642 642 dev_err(chip->dev, "Failed to add " 643 643 "backlight subdev\n"); ··· 672 672 led_devs[i].resources = &led_resources[j], 673 673 ret = mfd_add_devices(chip->dev, 0, 674 674 &led_devs[i], 1, 675 - &led_resources[j], 0); 675 + &led_resources[j], 0, NULL); 676 676 if (ret < 0) { 677 677 dev_err(chip->dev, "Failed to add " 678 678 "led subdev\n"); ··· 709 709 regulator_devs[i].resources = &regulator_resources[seq]; 710 710 711 711 ret = mfd_add_devices(chip->dev, 0, &regulator_devs[i], 1, 712 - &regulator_resources[seq], 0); 712 + &regulator_resources[seq], 0, NULL); 713 713 if (ret < 0) { 714 714 dev_err(chip->dev, "Failed to add regulator subdev\n"); 715 715 goto out; ··· 733 733 rtc_devs[0].resources = &rtc_resources[0]; 734 734 ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0], 735 735 ARRAY_SIZE(rtc_devs), &rtc_resources[0], 736 - chip->irq_base); 736 + chip->irq_base, NULL); 737 737 if (ret < 0) 738 738 dev_err(chip->dev, "Failed to add rtc subdev\n"); 739 739 } ··· 752 752 touch_devs[0].resources = &touch_resources[0]; 753 753 ret = mfd_add_devices(chip->dev, 0, &touch_devs[0], 754 754 ARRAY_SIZE(touch_devs), &touch_resources[0], 755 - chip->irq_base); 755 + chip->irq_base, NULL); 756 756 if (ret < 0) 757 757 dev_err(chip->dev, "Failed to add touch subdev\n"); 758 758 } ··· 770 770 power_devs[0].num_resources = ARRAY_SIZE(battery_resources); 771 771 power_devs[0].resources = &battery_resources[0], 772 772 ret = mfd_add_devices(chip->dev, 0, &power_devs[0], 1, 773 - &battery_resources[0], chip->irq_base); 773 + &battery_resources[0], chip->irq_base, NULL); 774 774 if (ret < 0) 775 775 dev_err(chip->dev, "Failed to add battery subdev\n"); 776 776 ··· 779 779 power_devs[1].num_resources = ARRAY_SIZE(charger_resources); 780 780 power_devs[1].resources = &charger_resources[0], 781 781 ret = mfd_add_devices(chip->dev, 0, &power_devs[1], 1, 782 - &charger_resources[0], chip->irq_base); 782 + &charger_resources[0], chip->irq_base, NULL); 783 783 if (ret < 0) 784 784 dev_err(chip->dev, "Failed to add charger subdev\n"); 785 785 ··· 788 788 power_devs[2].num_resources = ARRAY_SIZE(preg_resources); 789 789 power_devs[2].resources = &preg_resources[0], 790 790 ret = mfd_add_devices(chip->dev, 0, &power_devs[2], 1, 791 - &preg_resources[0], chip->irq_base); 791 + &preg_resources[0], chip->irq_base, NULL); 792 792 if (ret < 0) 793 793 dev_err(chip->dev, "Failed to add preg subdev\n"); 794 794 } ··· 802 802 onkey_devs[0].resources = &onkey_resources[0], 803 803 ret = mfd_add_devices(chip->dev, 0, &onkey_devs[0], 804 804 ARRAY_SIZE(onkey_devs), &onkey_resources[0], 805 - chip->irq_base); 805 + chip->irq_base, NULL); 806 806 if (ret < 0) 807 807 dev_err(chip->dev, "Failed to add onkey subdev\n"); 808 808 } ··· 815 815 codec_devs[0].num_resources = ARRAY_SIZE(codec_resources); 816 816 codec_devs[0].resources = &codec_resources[0], 817 817 ret = mfd_add_devices(chip->dev, 0, &codec_devs[0], 818 - ARRAY_SIZE(codec_devs), &codec_resources[0], 0); 818 + ARRAY_SIZE(codec_devs), &codec_resources[0], 0, 819 + NULL); 819 820 if (ret < 0) 820 821 dev_err(chip->dev, "Failed to add codec subdev\n"); 821 822 }
+1 -1
drivers/mfd/aat2870-core.c
··· 424 424 } 425 425 426 426 ret = mfd_add_devices(aat2870->dev, 0, aat2870_devs, 427 - ARRAY_SIZE(aat2870_devs), NULL, 0); 427 + ARRAY_SIZE(aat2870_devs), NULL, 0, NULL); 428 428 if (ret != 0) { 429 429 dev_err(aat2870->dev, "Failed to add subdev: %d\n", ret); 430 430 goto out_disable;
+1 -1
drivers/mfd/ab3100-core.c
··· 946 946 } 947 947 948 948 err = mfd_add_devices(&client->dev, 0, ab3100_devs, 949 - ARRAY_SIZE(ab3100_devs), NULL, 0); 949 + ARRAY_SIZE(ab3100_devs), NULL, 0, NULL); 950 950 951 951 ab3100_setup_debugfs(ab3100); 952 952
+5 -5
drivers/mfd/ab8500-core.c
··· 1418 1418 1419 1419 ret = mfd_add_devices(ab8500->dev, 0, abx500_common_devs, 1420 1420 ARRAY_SIZE(abx500_common_devs), NULL, 1421 - ab8500->irq_base); 1421 + ab8500->irq_base, ab8500->domain); 1422 1422 if (ret) 1423 1423 goto out_freeirq; 1424 1424 1425 1425 if (is_ab9540(ab8500)) 1426 1426 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, 1427 1427 ARRAY_SIZE(ab9540_devs), NULL, 1428 - ab8500->irq_base); 1428 + ab8500->irq_base, ab8500->domain); 1429 1429 else 1430 1430 ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs, 1431 1431 ARRAY_SIZE(ab8500_devs), NULL, 1432 - ab8500->irq_base); 1432 + ab8500->irq_base, ab8500->domain); 1433 1433 if (ret) 1434 1434 goto out_freeirq; 1435 1435 1436 1436 if (is_ab9540(ab8500) || is_ab8505(ab8500)) 1437 1437 ret = mfd_add_devices(ab8500->dev, 0, ab9540_ab8505_devs, 1438 1438 ARRAY_SIZE(ab9540_ab8505_devs), NULL, 1439 - ab8500->irq_base); 1439 + ab8500->irq_base, ab8500->domain); 1440 1440 if (ret) 1441 1441 goto out_freeirq; 1442 1442 ··· 1444 1444 /* Add battery management devices */ 1445 1445 ret = mfd_add_devices(ab8500->dev, 0, ab8500_bm_devs, 1446 1446 ARRAY_SIZE(ab8500_bm_devs), NULL, 1447 - ab8500->irq_base); 1447 + ab8500->irq_base, ab8500->domain); 1448 1448 if (ret) 1449 1449 dev_err(ab8500->dev, "error adding bm devices\n"); 1450 1450 }
+3 -3
drivers/mfd/arizona-core.c
··· 316 316 } 317 317 318 318 ret = mfd_add_devices(arizona->dev, -1, early_devs, 319 - ARRAY_SIZE(early_devs), NULL, 0); 319 + ARRAY_SIZE(early_devs), NULL, 0, NULL); 320 320 if (ret != 0) { 321 321 dev_err(dev, "Failed to add early children: %d\n", ret); 322 322 return ret; ··· 516 516 switch (arizona->type) { 517 517 case WM5102: 518 518 ret = mfd_add_devices(arizona->dev, -1, wm5102_devs, 519 - ARRAY_SIZE(wm5102_devs), NULL, 0); 519 + ARRAY_SIZE(wm5102_devs), NULL, 0, NULL); 520 520 break; 521 521 case WM5110: 522 522 ret = mfd_add_devices(arizona->dev, -1, wm5110_devs, 523 - ARRAY_SIZE(wm5102_devs), NULL, 0); 523 + ARRAY_SIZE(wm5102_devs), NULL, 0, NULL); 524 524 break; 525 525 } 526 526
+3 -3
drivers/mfd/asic3.c
··· 913 913 if (pdata->clock_rate) { 914 914 ds1wm_pdata.clock_rate = pdata->clock_rate; 915 915 ret = mfd_add_devices(&pdev->dev, pdev->id, 916 - &asic3_cell_ds1wm, 1, mem, asic->irq_base); 916 + &asic3_cell_ds1wm, 1, mem, asic->irq_base, NULL); 917 917 if (ret < 0) 918 918 goto out; 919 919 } 920 920 921 921 if (mem_sdio && (irq >= 0)) { 922 922 ret = mfd_add_devices(&pdev->dev, pdev->id, 923 - &asic3_cell_mmc, 1, mem_sdio, irq); 923 + &asic3_cell_mmc, 1, mem_sdio, irq, NULL); 924 924 if (ret < 0) 925 925 goto out; 926 926 } ··· 934 934 asic3_cell_leds[i].pdata_size = sizeof(pdata->leds[i]); 935 935 } 936 936 ret = mfd_add_devices(&pdev->dev, 0, 937 - asic3_cell_leds, ASIC3_NUM_LEDS, NULL, 0); 937 + asic3_cell_leds, ASIC3_NUM_LEDS, NULL, 0, NULL); 938 938 } 939 939 940 940 out:
+1 -1
drivers/mfd/cs5535-mfd.c
··· 149 149 } 150 150 151 151 err = mfd_add_devices(&pdev->dev, -1, cs5535_mfd_cells, 152 - ARRAY_SIZE(cs5535_mfd_cells), NULL, 0); 152 + ARRAY_SIZE(cs5535_mfd_cells), NULL, 0, NULL); 153 153 if (err) { 154 154 dev_err(&pdev->dev, "MFD add devices failed: %d\n", err); 155 155 goto err_disable;
+1 -1
drivers/mfd/da9052-core.c
··· 803 803 dev_err(da9052->dev, "DA9052 ADC IRQ failed ret=%d\n", ret); 804 804 805 805 ret = mfd_add_devices(da9052->dev, -1, da9052_subdev_info, 806 - ARRAY_SIZE(da9052_subdev_info), NULL, 0); 806 + ARRAY_SIZE(da9052_subdev_info), NULL, 0, NULL); 807 807 if (ret) 808 808 goto err; 809 809
+1 -1
drivers/mfd/davinci_voicecodec.c
··· 129 129 cell->pdata_size = sizeof(*davinci_vc); 130 130 131 131 ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells, 132 - DAVINCI_VC_CELLS, NULL, 0); 132 + DAVINCI_VC_CELLS, NULL, 0, NULL); 133 133 if (ret != 0) { 134 134 dev_err(&pdev->dev, "fail to register client devices\n"); 135 135 goto fail4;
+1 -1
drivers/mfd/db8500-prcmu.c
··· 3010 3010 prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET); 3011 3011 3012 3012 err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, 3013 - ARRAY_SIZE(db8500_prcmu_devs), NULL, 0); 3013 + ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, NULL); 3014 3014 if (err) { 3015 3015 pr_err("prcmu: Failed to add subdevices\n"); 3016 3016 return err;
+3 -2
drivers/mfd/htc-pasic3.c
··· 168 168 /* the first 5 PASIC3 registers control the DS1WM */ 169 169 ds1wm_resources[0].end = (5 << asic->bus_shift) - 1; 170 170 ret = mfd_add_devices(&pdev->dev, pdev->id, 171 - &ds1wm_cell, 1, r, irq); 171 + &ds1wm_cell, 1, r, irq, NULL); 172 172 if (ret < 0) 173 173 dev_warn(dev, "failed to register DS1WM\n"); 174 174 } ··· 176 176 if (pdata && pdata->led_pdata) { 177 177 led_cell.platform_data = pdata->led_pdata; 178 178 led_cell.pdata_size = sizeof(struct pasic3_leds_machinfo); 179 - ret = mfd_add_devices(&pdev->dev, pdev->id, &led_cell, 1, r, 0); 179 + ret = mfd_add_devices(&pdev->dev, pdev->id, &led_cell, 1, r, 180 + 0, NULL); 180 181 if (ret < 0) 181 182 dev_warn(dev, "failed to register LED device\n"); 182 183 }
+2 -2
drivers/mfd/intel_msic.c
··· 344 344 continue; 345 345 346 346 ret = mfd_add_devices(&pdev->dev, -1, &msic_devs[i], 1, NULL, 347 - pdata->irq[i]); 347 + pdata->irq[i], NULL); 348 348 if (ret) 349 349 goto fail; 350 350 } 351 351 352 352 ret = mfd_add_devices(&pdev->dev, 0, msic_other_devs, 353 - ARRAY_SIZE(msic_other_devs), NULL, 0); 353 + ARRAY_SIZE(msic_other_devs), NULL, 0, NULL); 354 354 if (ret) 355 355 goto fail; 356 356
+1 -1
drivers/mfd/janz-cmodio.c
··· 147 147 } 148 148 149 149 return mfd_add_devices(&pdev->dev, 0, priv->cells, 150 - num_probed, NULL, pdev->irq); 150 + num_probed, NULL, pdev->irq, NULL); 151 151 } 152 152 153 153 /*
+2 -1
drivers/mfd/jz4740-adc.c
··· 287 287 writeb(0xff, adc->base + JZ_REG_ADC_CTRL); 288 288 289 289 ret = mfd_add_devices(&pdev->dev, 0, jz4740_adc_cells, 290 - ARRAY_SIZE(jz4740_adc_cells), mem_base, irq_base); 290 + ARRAY_SIZE(jz4740_adc_cells), mem_base, 291 + irq_base, NULL); 291 292 if (ret < 0) 292 293 goto err_clk_put; 293 294
+4 -3
drivers/mfd/lm3533-core.c
··· 393 393 lm3533_als_devs[0].platform_data = pdata->als; 394 394 lm3533_als_devs[0].pdata_size = sizeof(*pdata->als); 395 395 396 - ret = mfd_add_devices(lm3533->dev, 0, lm3533_als_devs, 1, NULL, 0); 396 + ret = mfd_add_devices(lm3533->dev, 0, lm3533_als_devs, 1, NULL, 397 + 0, NULL); 397 398 if (ret) { 398 399 dev_err(lm3533->dev, "failed to add ALS device\n"); 399 400 return ret; ··· 423 422 } 424 423 425 424 ret = mfd_add_devices(lm3533->dev, 0, lm3533_bl_devs, 426 - pdata->num_backlights, NULL, 0); 425 + pdata->num_backlights, NULL, 0, NULL); 427 426 if (ret) { 428 427 dev_err(lm3533->dev, "failed to add backlight devices\n"); 429 428 return ret; ··· 452 451 } 453 452 454 453 ret = mfd_add_devices(lm3533->dev, 0, lm3533_led_devs, 455 - pdata->num_leds, NULL, 0); 454 + pdata->num_leds, NULL, 0, NULL); 456 455 if (ret) { 457 456 dev_err(lm3533->dev, "failed to add LED devices\n"); 458 457 return ret;
+3 -21
drivers/mfd/lpc_ich.c
··· 750 750 751 751 lpc_ich_finalize_cell(&lpc_ich_cells[LPC_GPIO], id); 752 752 ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_GPIO], 753 - 1, NULL, 0); 753 + 1, NULL, 0, NULL); 754 754 755 755 gpio_done: 756 756 if (acpi_conflict) ··· 765 765 u32 base_addr_cfg; 766 766 u32 base_addr; 767 767 int ret; 768 - bool acpi_conflict = false; 769 768 struct resource *res; 770 769 771 770 /* Setup power management base register */ ··· 779 780 res = wdt_io_res(ICH_RES_IO_TCO); 780 781 res->start = base_addr + ACPIBASE_TCO_OFF; 781 782 res->end = base_addr + ACPIBASE_TCO_END; 782 - ret = acpi_check_resource_conflict(res); 783 - if (ret) { 784 - acpi_conflict = true; 785 - goto wdt_done; 786 - } 787 783 788 784 res = wdt_io_res(ICH_RES_IO_SMI); 789 785 res->start = base_addr + ACPIBASE_SMI_OFF; 790 786 res->end = base_addr + ACPIBASE_SMI_END; 791 - ret = acpi_check_resource_conflict(res); 792 - if (ret) { 793 - acpi_conflict = true; 794 - goto wdt_done; 795 - } 787 + 796 788 lpc_ich_enable_acpi_space(dev); 797 789 798 790 /* ··· 803 813 res = wdt_mem_res(ICH_RES_MEM_GCS); 804 814 res->start = base_addr + ACPIBASE_GCS_OFF; 805 815 res->end = base_addr + ACPIBASE_GCS_END; 806 - ret = acpi_check_resource_conflict(res); 807 - if (ret) { 808 - acpi_conflict = true; 809 - goto wdt_done; 810 - } 811 816 } 812 817 813 818 lpc_ich_finalize_cell(&lpc_ich_cells[LPC_WDT], id); 814 819 ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_WDT], 815 - 1, NULL, 0); 820 + 1, NULL, 0, NULL); 816 821 817 822 wdt_done: 818 - if (acpi_conflict) 819 - pr_warn("Resource conflict(s) found affecting %s\n", 820 - lpc_ich_cells[LPC_WDT].name); 821 823 return ret; 822 824 } 823 825
+4 -2
drivers/mfd/lpc_sch.c
··· 127 127 lpc_sch_cells[i].id = id->device; 128 128 129 129 ret = mfd_add_devices(&dev->dev, 0, 130 - lpc_sch_cells, ARRAY_SIZE(lpc_sch_cells), NULL, 0); 130 + lpc_sch_cells, ARRAY_SIZE(lpc_sch_cells), NULL, 131 + 0, NULL); 131 132 if (ret) 132 133 goto out_dev; 133 134 ··· 154 153 tunnelcreek_cells[i].id = id->device; 155 154 156 155 ret = mfd_add_devices(&dev->dev, 0, tunnelcreek_cells, 157 - ARRAY_SIZE(tunnelcreek_cells), NULL, 0); 156 + ARRAY_SIZE(tunnelcreek_cells), NULL, 157 + 0, NULL); 158 158 } 159 159 160 160 return ret;
+1 -1
drivers/mfd/max77686.c
··· 126 126 max77686_irq_init(max77686); 127 127 128 128 ret = mfd_add_devices(max77686->dev, -1, max77686_devs, 129 - ARRAY_SIZE(max77686_devs), NULL, 0); 129 + ARRAY_SIZE(max77686_devs), NULL, 0, NULL); 130 130 131 131 if (ret < 0) 132 132 goto err_mfd;
+31 -5
drivers/mfd/max77693-irq.c
··· 137 137 const struct max77693_irq_data *irq_data = 138 138 irq_to_max77693_irq(max77693, data->irq); 139 139 140 + if (irq_data->group >= MAX77693_IRQ_GROUP_NR) 141 + return; 142 + 140 143 if (irq_data->group >= MUIC_INT1 && irq_data->group <= MUIC_INT3) 141 144 max77693->irq_masks_cur[irq_data->group] &= ~irq_data->mask; 142 145 else ··· 151 148 struct max77693_dev *max77693 = irq_get_chip_data(data->irq); 152 149 const struct max77693_irq_data *irq_data = 153 150 irq_to_max77693_irq(max77693, data->irq); 151 + 152 + if (irq_data->group >= MAX77693_IRQ_GROUP_NR) 153 + return; 154 154 155 155 if (irq_data->group >= MUIC_INT1 && irq_data->group <= MUIC_INT3) 156 156 max77693->irq_masks_cur[irq_data->group] |= irq_data->mask; ··· 206 200 207 201 if (irq_src & MAX77693_IRQSRC_MUIC) 208 202 /* MUIC INT1 ~ INT3 */ 209 - max77693_bulk_read(max77693->regmap, MAX77693_MUIC_REG_INT1, 203 + max77693_bulk_read(max77693->regmap_muic, MAX77693_MUIC_REG_INT1, 210 204 MAX77693_NUM_IRQ_MUIC_REGS, &irq_reg[MUIC_INT1]); 211 205 212 206 /* Apply masking */ ··· 261 255 { 262 256 struct irq_domain *domain; 263 257 int i; 264 - int ret; 258 + int ret = 0; 259 + u8 intsrc_mask; 265 260 266 261 mutex_init(&max77693->irqlock); 267 262 ··· 294 287 &max77693_irq_domain_ops, max77693); 295 288 if (!domain) { 296 289 dev_err(max77693->dev, "could not create irq domain\n"); 297 - return -ENODEV; 290 + ret = -ENODEV; 291 + goto err_irq; 298 292 } 299 293 max77693->irq_domain = domain; 294 + 295 + /* Unmask max77693 interrupt */ 296 + ret = max77693_read_reg(max77693->regmap, 297 + MAX77693_PMIC_REG_INTSRC_MASK, &intsrc_mask); 298 + if (ret < 0) { 299 + dev_err(max77693->dev, "fail to read PMIC register\n"); 300 + goto err_irq; 301 + } 302 + 303 + intsrc_mask &= ~(MAX77693_IRQSRC_CHG); 304 + intsrc_mask &= ~(MAX77693_IRQSRC_FLASH); 305 + intsrc_mask &= ~(MAX77693_IRQSRC_MUIC); 306 + ret = max77693_write_reg(max77693->regmap, 307 + MAX77693_PMIC_REG_INTSRC_MASK, intsrc_mask); 308 + if (ret < 0) { 309 + dev_err(max77693->dev, "fail to write PMIC register\n"); 310 + goto err_irq; 311 + } 300 312 301 313 ret = request_threaded_irq(max77693->irq, NULL, max77693_irq_thread, 302 314 IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 303 315 "max77693-irq", max77693); 304 - 305 316 if (ret) 306 317 dev_err(max77693->dev, "Failed to request IRQ %d: %d\n", 307 318 max77693->irq, ret); 308 319 309 - return 0; 320 + err_irq: 321 + return ret; 310 322 } 311 323 312 324 void max77693_irq_exit(struct max77693_dev *max77693)
+15 -1
drivers/mfd/max77693.c
··· 152 152 max77693->haptic = i2c_new_dummy(i2c->adapter, I2C_ADDR_HAPTIC); 153 153 i2c_set_clientdata(max77693->haptic, max77693); 154 154 155 + /* 156 + * Initialize register map for MUIC device because use regmap-muic 157 + * instance of MUIC device when irq of max77693 is initialized 158 + * before call max77693-muic probe() function. 159 + */ 160 + max77693->regmap_muic = devm_regmap_init_i2c(max77693->muic, 161 + &max77693_regmap_config); 162 + if (IS_ERR(max77693->regmap_muic)) { 163 + ret = PTR_ERR(max77693->regmap_muic); 164 + dev_err(max77693->dev, 165 + "failed to allocate register map: %d\n", ret); 166 + goto err_regmap; 167 + } 168 + 155 169 ret = max77693_irq_init(max77693); 156 170 if (ret < 0) 157 171 goto err_irq; ··· 173 159 pm_runtime_set_active(max77693->dev); 174 160 175 161 ret = mfd_add_devices(max77693->dev, -1, max77693_devs, 176 - ARRAY_SIZE(max77693_devs), NULL, 0); 162 + ARRAY_SIZE(max77693_devs), NULL, 0, NULL); 177 163 if (ret < 0) 178 164 goto err_mfd; 179 165
+6 -6
drivers/mfd/max8925-core.c
··· 598 598 599 599 ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0], 600 600 ARRAY_SIZE(rtc_devs), 601 - &rtc_resources[0], chip->irq_base); 601 + &rtc_resources[0], chip->irq_base, NULL); 602 602 if (ret < 0) { 603 603 dev_err(chip->dev, "Failed to add rtc subdev\n"); 604 604 goto out; ··· 606 606 607 607 ret = mfd_add_devices(chip->dev, 0, &onkey_devs[0], 608 608 ARRAY_SIZE(onkey_devs), 609 - &onkey_resources[0], 0); 609 + &onkey_resources[0], 0, NULL); 610 610 if (ret < 0) { 611 611 dev_err(chip->dev, "Failed to add onkey subdev\n"); 612 612 goto out_dev; ··· 615 615 if (pdata) { 616 616 ret = mfd_add_devices(chip->dev, 0, &regulator_devs[0], 617 617 ARRAY_SIZE(regulator_devs), 618 - &regulator_resources[0], 0); 618 + &regulator_resources[0], 0, NULL); 619 619 if (ret < 0) { 620 620 dev_err(chip->dev, "Failed to add regulator subdev\n"); 621 621 goto out_dev; ··· 625 625 if (pdata && pdata->backlight) { 626 626 ret = mfd_add_devices(chip->dev, 0, &backlight_devs[0], 627 627 ARRAY_SIZE(backlight_devs), 628 - &backlight_resources[0], 0); 628 + &backlight_resources[0], 0, NULL); 629 629 if (ret < 0) { 630 630 dev_err(chip->dev, "Failed to add backlight subdev\n"); 631 631 goto out_dev; ··· 635 635 if (pdata && pdata->power) { 636 636 ret = mfd_add_devices(chip->dev, 0, &power_devs[0], 637 637 ARRAY_SIZE(power_devs), 638 - &power_supply_resources[0], 0); 638 + &power_supply_resources[0], 0, NULL); 639 639 if (ret < 0) { 640 640 dev_err(chip->dev, "Failed to add power supply " 641 641 "subdev\n"); ··· 646 646 if (pdata && pdata->touch) { 647 647 ret = mfd_add_devices(chip->dev, 0, &touch_devs[0], 648 648 ARRAY_SIZE(touch_devs), 649 - &touch_resources[0], 0); 649 + &touch_resources[0], 0, NULL); 650 650 if (ret < 0) { 651 651 dev_err(chip->dev, "Failed to add touch subdev\n"); 652 652 goto out_dev;
+1 -1
drivers/mfd/max8997.c
··· 160 160 161 161 mfd_add_devices(max8997->dev, -1, max8997_devs, 162 162 ARRAY_SIZE(max8997_devs), 163 - NULL, 0); 163 + NULL, 0, NULL); 164 164 165 165 /* 166 166 * TODO: enable others (flash, muic, rtc, battery, ...) and
+4 -4
drivers/mfd/max8998.c
··· 161 161 switch (id->driver_data) { 162 162 case TYPE_LP3974: 163 163 ret = mfd_add_devices(max8998->dev, -1, 164 - lp3974_devs, ARRAY_SIZE(lp3974_devs), 165 - NULL, 0); 164 + lp3974_devs, ARRAY_SIZE(lp3974_devs), 165 + NULL, 0, NULL); 166 166 break; 167 167 case TYPE_MAX8998: 168 168 ret = mfd_add_devices(max8998->dev, -1, 169 - max8998_devs, ARRAY_SIZE(max8998_devs), 170 - NULL, 0); 169 + max8998_devs, ARRAY_SIZE(max8998_devs), 170 + NULL, 0, NULL); 171 171 break; 172 172 default: 173 173 ret = -EINVAL;
+1 -1
drivers/mfd/mc13xxx-core.c
··· 612 612 if (!cell.name) 613 613 return -ENOMEM; 614 614 615 - return mfd_add_devices(mc13xxx->dev, -1, &cell, 1, NULL, 0); 615 + return mfd_add_devices(mc13xxx->dev, -1, &cell, 1, NULL, 0, NULL); 616 616 } 617 617 618 618 static int mc13xxx_add_subdevice(struct mc13xxx *mc13xxx, const char *format)
+6 -6
drivers/mfd/mfd-core.c
··· 74 74 static int mfd_add_device(struct device *parent, int id, 75 75 const struct mfd_cell *cell, 76 76 struct resource *mem_base, 77 - int irq_base) 77 + int irq_base, struct irq_domain *domain) 78 78 { 79 79 struct resource *res; 80 80 struct platform_device *pdev; 81 81 struct device_node *np = NULL; 82 - struct irq_domain *domain = NULL; 83 82 int ret = -ENOMEM; 84 83 int r; 85 84 ··· 96 97 for_each_child_of_node(parent->of_node, np) { 97 98 if (of_device_is_compatible(np, cell->of_compatible)) { 98 99 pdev->dev.of_node = np; 99 - domain = irq_find_host(parent->of_node); 100 100 break; 101 101 } 102 102 } ··· 175 177 int mfd_add_devices(struct device *parent, int id, 176 178 struct mfd_cell *cells, int n_devs, 177 179 struct resource *mem_base, 178 - int irq_base) 180 + int irq_base, struct irq_domain *domain) 179 181 { 180 182 int i; 181 183 int ret = 0; ··· 189 191 for (i = 0; i < n_devs; i++) { 190 192 atomic_set(&cnts[i], 0); 191 193 cells[i].usage_count = &cnts[i]; 192 - ret = mfd_add_device(parent, id, cells + i, mem_base, irq_base); 194 + ret = mfd_add_device(parent, id, cells + i, mem_base, 195 + irq_base, domain); 193 196 if (ret) 194 197 break; 195 198 } ··· 246 247 for (i = 0; i < n_clones; i++) { 247 248 cell_entry.name = clones[i]; 248 249 /* don't give up if a single call fails; just report error */ 249 - if (mfd_add_device(pdev->dev.parent, -1, &cell_entry, NULL, 0)) 250 + if (mfd_add_device(pdev->dev.parent, -1, &cell_entry, NULL, 0, 251 + NULL)) 250 252 dev_err(dev, "failed to create platform device '%s'\n", 251 253 clones[i]); 252 254 }
+2 -1
drivers/mfd/palmas.c
··· 453 453 454 454 ret = mfd_add_devices(palmas->dev, -1, 455 455 children, ARRAY_SIZE(palmas_children), 456 - NULL, regmap_irq_chip_get_base(palmas->irq_data)); 456 + NULL, regmap_irq_chip_get_base(palmas->irq_data), 457 + NULL); 457 458 kfree(children); 458 459 459 460 if (ret < 0)
+1 -1
drivers/mfd/rc5t583.c
··· 289 289 } 290 290 291 291 ret = mfd_add_devices(rc5t583->dev, -1, rc5t583_subdevs, 292 - ARRAY_SIZE(rc5t583_subdevs), NULL, 0); 292 + ARRAY_SIZE(rc5t583_subdevs), NULL, 0, NULL); 293 293 if (ret) { 294 294 dev_err(&i2c->dev, "add mfd devices failed: %d\n", ret); 295 295 goto err_add_devs;
+2 -1
drivers/mfd/rdc321x-southbridge.c
··· 87 87 rdc321x_wdt_pdata.sb_pdev = pdev; 88 88 89 89 return mfd_add_devices(&pdev->dev, -1, 90 - rdc321x_sb_cells, ARRAY_SIZE(rdc321x_sb_cells), NULL, 0); 90 + rdc321x_sb_cells, ARRAY_SIZE(rdc321x_sb_cells), 91 + NULL, 0, NULL); 91 92 } 92 93 93 94 static void __devexit rdc321x_sb_remove(struct pci_dev *pdev)
+4 -4
drivers/mfd/sec-core.c
··· 141 141 switch (sec_pmic->device_type) { 142 142 case S5M8751X: 143 143 ret = mfd_add_devices(sec_pmic->dev, -1, s5m8751_devs, 144 - ARRAY_SIZE(s5m8751_devs), NULL, 0); 144 + ARRAY_SIZE(s5m8751_devs), NULL, 0, NULL); 145 145 break; 146 146 case S5M8763X: 147 147 ret = mfd_add_devices(sec_pmic->dev, -1, s5m8763_devs, 148 - ARRAY_SIZE(s5m8763_devs), NULL, 0); 148 + ARRAY_SIZE(s5m8763_devs), NULL, 0, NULL); 149 149 break; 150 150 case S5M8767X: 151 151 ret = mfd_add_devices(sec_pmic->dev, -1, s5m8767_devs, 152 - ARRAY_SIZE(s5m8767_devs), NULL, 0); 152 + ARRAY_SIZE(s5m8767_devs), NULL, 0, NULL); 153 153 break; 154 154 case S2MPS11X: 155 155 ret = mfd_add_devices(sec_pmic->dev, -1, s2mps11_devs, 156 - ARRAY_SIZE(s2mps11_devs), NULL, 0); 156 + ARRAY_SIZE(s2mps11_devs), NULL, 0, NULL); 157 157 break; 158 158 default: 159 159 /* If this happens the probe function is problem */
+2 -2
drivers/mfd/sta2x11-mfd.c
··· 407 407 sta2x11_mfd_bar0, 408 408 ARRAY_SIZE(sta2x11_mfd_bar0), 409 409 &pdev->resource[0], 410 - 0); 410 + 0, NULL); 411 411 if (err) { 412 412 dev_err(&pdev->dev, "mfd_add_devices[0] failed: %d\n", err); 413 413 goto err_disable; ··· 417 417 sta2x11_mfd_bar1, 418 418 ARRAY_SIZE(sta2x11_mfd_bar1), 419 419 &pdev->resource[1], 420 - 0); 420 + 0, NULL); 421 421 if (err) { 422 422 dev_err(&pdev->dev, "mfd_add_devices[1] failed: %d\n", err); 423 423 goto err_disable;
+1 -1
drivers/mfd/stmpe.c
··· 962 962 struct mfd_cell *cell, int irq) 963 963 { 964 964 return mfd_add_devices(stmpe->dev, stmpe->pdata->id, cell, 1, 965 - NULL, stmpe->irq_base + irq); 965 + NULL, stmpe->irq_base + irq, NULL); 966 966 } 967 967 968 968 static int __devinit stmpe_devices_init(struct stmpe *stmpe)
+1 -1
drivers/mfd/t7l66xb.c
··· 388 388 389 389 ret = mfd_add_devices(&dev->dev, dev->id, 390 390 t7l66xb_cells, ARRAY_SIZE(t7l66xb_cells), 391 - iomem, t7l66xb->irq_base); 391 + iomem, t7l66xb->irq_base, NULL); 392 392 393 393 if (!ret) 394 394 return 0;
+4 -4
drivers/mfd/tc3589x.c
··· 262 262 263 263 if (blocks & TC3589x_BLOCK_GPIO) { 264 264 ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_gpio, 265 - ARRAY_SIZE(tc3589x_dev_gpio), NULL, 266 - tc3589x->irq_base); 265 + ARRAY_SIZE(tc3589x_dev_gpio), NULL, 266 + tc3589x->irq_base, NULL); 267 267 if (ret) { 268 268 dev_err(tc3589x->dev, "failed to add gpio child\n"); 269 269 return ret; ··· 273 273 274 274 if (blocks & TC3589x_BLOCK_KEYPAD) { 275 275 ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_keypad, 276 - ARRAY_SIZE(tc3589x_dev_keypad), NULL, 277 - tc3589x->irq_base); 276 + ARRAY_SIZE(tc3589x_dev_keypad), NULL, 277 + tc3589x->irq_base, NULL); 278 278 if (ret) { 279 279 dev_err(tc3589x->dev, "failed to keypad child\n"); 280 280 return ret;
+1 -1
drivers/mfd/tc6387xb.c
··· 192 192 printk(KERN_INFO "Toshiba tc6387xb initialised\n"); 193 193 194 194 ret = mfd_add_devices(&dev->dev, dev->id, tc6387xb_cells, 195 - ARRAY_SIZE(tc6387xb_cells), iomem, irq); 195 + ARRAY_SIZE(tc6387xb_cells), iomem, irq, NULL); 196 196 197 197 if (!ret) 198 198 return 0;
+2 -2
drivers/mfd/tc6393xb.c
··· 700 700 tc6393xb_cells[TC6393XB_CELL_FB].pdata_size = sizeof(*tcpd->fb_data); 701 701 702 702 ret = mfd_add_devices(&dev->dev, dev->id, 703 - tc6393xb_cells, ARRAY_SIZE(tc6393xb_cells), 704 - iomem, tcpd->irq_base); 703 + tc6393xb_cells, ARRAY_SIZE(tc6393xb_cells), 704 + iomem, tcpd->irq_base, NULL); 705 705 706 706 if (!ret) 707 707 return 0;
+1 -1
drivers/mfd/ti-ssp.c
··· 412 412 cells[id].data_size = data->pdata_size; 413 413 } 414 414 415 - error = mfd_add_devices(dev, 0, cells, 2, NULL, 0); 415 + error = mfd_add_devices(dev, 0, cells, 2, NULL, 0, NULL); 416 416 if (error < 0) { 417 417 dev_err(dev, "cannot add mfd cells\n"); 418 418 goto error_enable;
+6 -6
drivers/mfd/timberdale.c
··· 757 757 err = mfd_add_devices(&dev->dev, -1, 758 758 timberdale_cells_bar0_cfg0, 759 759 ARRAY_SIZE(timberdale_cells_bar0_cfg0), 760 - &dev->resource[0], msix_entries[0].vector); 760 + &dev->resource[0], msix_entries[0].vector, NULL); 761 761 break; 762 762 case TIMB_HW_VER1: 763 763 err = mfd_add_devices(&dev->dev, -1, 764 764 timberdale_cells_bar0_cfg1, 765 765 ARRAY_SIZE(timberdale_cells_bar0_cfg1), 766 - &dev->resource[0], msix_entries[0].vector); 766 + &dev->resource[0], msix_entries[0].vector, NULL); 767 767 break; 768 768 case TIMB_HW_VER2: 769 769 err = mfd_add_devices(&dev->dev, -1, 770 770 timberdale_cells_bar0_cfg2, 771 771 ARRAY_SIZE(timberdale_cells_bar0_cfg2), 772 - &dev->resource[0], msix_entries[0].vector); 772 + &dev->resource[0], msix_entries[0].vector, NULL); 773 773 break; 774 774 case TIMB_HW_VER3: 775 775 err = mfd_add_devices(&dev->dev, -1, 776 776 timberdale_cells_bar0_cfg3, 777 777 ARRAY_SIZE(timberdale_cells_bar0_cfg3), 778 - &dev->resource[0], msix_entries[0].vector); 778 + &dev->resource[0], msix_entries[0].vector, NULL); 779 779 break; 780 780 default: 781 781 dev_err(&dev->dev, "Uknown IP setup: %d.%d.%d\n", ··· 792 792 793 793 err = mfd_add_devices(&dev->dev, 0, 794 794 timberdale_cells_bar1, ARRAY_SIZE(timberdale_cells_bar1), 795 - &dev->resource[1], msix_entries[0].vector); 795 + &dev->resource[1], msix_entries[0].vector, NULL); 796 796 if (err) { 797 797 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); 798 798 goto err_mfd2; ··· 803 803 ((priv->fw.config & TIMB_HW_VER_MASK) == TIMB_HW_VER3)) { 804 804 err = mfd_add_devices(&dev->dev, 1, timberdale_cells_bar2, 805 805 ARRAY_SIZE(timberdale_cells_bar2), 806 - &dev->resource[2], msix_entries[0].vector); 806 + &dev->resource[2], msix_entries[0].vector, NULL); 807 807 if (err) { 808 808 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); 809 809 goto err_mfd2;
+1 -1
drivers/mfd/tps6105x.c
··· 188 188 } 189 189 190 190 ret = mfd_add_devices(&client->dev, 0, tps6105x_cells, 191 - ARRAY_SIZE(tps6105x_cells), NULL, 0); 191 + ARRAY_SIZE(tps6105x_cells), NULL, 0, NULL); 192 192 if (ret) 193 193 goto fail; 194 194
+1 -1
drivers/mfd/tps6507x.c
··· 100 100 101 101 ret = mfd_add_devices(tps6507x->dev, -1, 102 102 tps6507x_devs, ARRAY_SIZE(tps6507x_devs), 103 - NULL, 0); 103 + NULL, 0, NULL); 104 104 105 105 if (ret < 0) 106 106 goto err;
+1 -1
drivers/mfd/tps65090.c
··· 292 292 } 293 293 294 294 ret = mfd_add_devices(tps65090->dev, -1, tps65090s, 295 - ARRAY_SIZE(tps65090s), NULL, 0); 295 + ARRAY_SIZE(tps65090s), NULL, 0, NULL); 296 296 if (ret) { 297 297 dev_err(&client->dev, "add mfd devices failed with err: %d\n", 298 298 ret);
+43 -87
drivers/mfd/tps65217.c
··· 24 24 #include <linux/slab.h> 25 25 #include <linux/regmap.h> 26 26 #include <linux/err.h> 27 - #include <linux/regulator/of_regulator.h> 27 + #include <linux/of.h> 28 + #include <linux/of_device.h> 28 29 29 30 #include <linux/mfd/core.h> 30 31 #include <linux/mfd/tps65217.h> 32 + 33 + static struct mfd_cell tps65217s[] = { 34 + { 35 + .name = "tps65217-pmic", 36 + }, 37 + }; 31 38 32 39 /** 33 40 * tps65217_reg_read: Read a single tps65217 register. ··· 140 133 } 141 134 EXPORT_SYMBOL_GPL(tps65217_clear_bits); 142 135 143 - #ifdef CONFIG_OF 144 - static struct of_regulator_match reg_matches[] = { 145 - { .name = "dcdc1", .driver_data = (void *)TPS65217_DCDC_1 }, 146 - { .name = "dcdc2", .driver_data = (void *)TPS65217_DCDC_2 }, 147 - { .name = "dcdc3", .driver_data = (void *)TPS65217_DCDC_3 }, 148 - { .name = "ldo1", .driver_data = (void *)TPS65217_LDO_1 }, 149 - { .name = "ldo2", .driver_data = (void *)TPS65217_LDO_2 }, 150 - { .name = "ldo3", .driver_data = (void *)TPS65217_LDO_3 }, 151 - { .name = "ldo4", .driver_data = (void *)TPS65217_LDO_4 }, 152 - }; 153 - 154 - static struct tps65217_board *tps65217_parse_dt(struct i2c_client *client) 155 - { 156 - struct device_node *node = client->dev.of_node; 157 - struct tps65217_board *pdata; 158 - struct device_node *regs; 159 - int count = ARRAY_SIZE(reg_matches); 160 - int ret, i; 161 - 162 - regs = of_find_node_by_name(node, "regulators"); 163 - if (!regs) 164 - return NULL; 165 - 166 - ret = of_regulator_match(&client->dev, regs, reg_matches, count); 167 - of_node_put(regs); 168 - if ((ret < 0) || (ret > count)) 169 - return NULL; 170 - 171 - count = ret; 172 - pdata = devm_kzalloc(&client->dev, count * sizeof(*pdata), GFP_KERNEL); 173 - if (!pdata) 174 - return NULL; 175 - 176 - for (i = 0; i < count; i++) { 177 - if (!reg_matches[i].init_data || !reg_matches[i].of_node) 178 - continue; 179 - 180 - pdata->tps65217_init_data[i] = reg_matches[i].init_data; 181 - pdata->of_node[i] = reg_matches[i].of_node; 182 - } 183 - 184 - return pdata; 185 - } 186 - 187 - static struct of_device_id tps65217_of_match[] = { 188 - { .compatible = "ti,tps65217", }, 189 - { }, 190 - }; 191 - #else 192 - static struct tps65217_board *tps65217_parse_dt(struct i2c_client *client) 193 - { 194 - return NULL; 195 - } 196 - #endif 197 - 198 136 static struct regmap_config tps65217_regmap_config = { 199 137 .reg_bits = 8, 200 138 .val_bits = 8, 139 + }; 140 + 141 + static const struct of_device_id tps65217_of_match[] = { 142 + { .compatible = "ti,tps65217", .data = (void *)TPS65217 }, 143 + { /* sentinel */ }, 201 144 }; 202 145 203 146 static int __devinit tps65217_probe(struct i2c_client *client, 204 147 const struct i2c_device_id *ids) 205 148 { 206 149 struct tps65217 *tps; 207 - struct regulator_init_data *reg_data; 208 - struct tps65217_board *pdata = client->dev.platform_data; 209 - int i, ret; 210 150 unsigned int version; 151 + unsigned int chip_id = ids->driver_data; 152 + const struct of_device_id *match; 153 + int ret; 211 154 212 - if (!pdata && client->dev.of_node) 213 - pdata = tps65217_parse_dt(client); 155 + if (client->dev.of_node) { 156 + match = of_match_device(tps65217_of_match, &client->dev); 157 + if (!match) { 158 + dev_err(&client->dev, 159 + "Failed to find matching dt id\n"); 160 + return -EINVAL; 161 + } 162 + chip_id = (unsigned int)match->data; 163 + } 164 + 165 + if (!chip_id) { 166 + dev_err(&client->dev, "id is null.\n"); 167 + return -ENODEV; 168 + } 214 169 215 170 tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); 216 171 if (!tps) 217 172 return -ENOMEM; 218 173 219 - tps->pdata = pdata; 174 + i2c_set_clientdata(client, tps); 175 + tps->dev = &client->dev; 176 + tps->id = chip_id; 177 + 220 178 tps->regmap = devm_regmap_init_i2c(client, &tps65217_regmap_config); 221 179 if (IS_ERR(tps->regmap)) { 222 180 ret = PTR_ERR(tps->regmap); ··· 190 218 return ret; 191 219 } 192 220 193 - i2c_set_clientdata(client, tps); 194 - tps->dev = &client->dev; 221 + ret = mfd_add_devices(tps->dev, -1, tps65217s, 222 + ARRAY_SIZE(tps65217s), NULL, 0, NULL); 223 + if (ret < 0) { 224 + dev_err(tps->dev, "mfd_add_devices failed: %d\n", ret); 225 + return ret; 226 + } 195 227 196 228 ret = tps65217_reg_read(tps, TPS65217_REG_CHIPID, &version); 197 229 if (ret < 0) { ··· 208 232 (version & TPS65217_CHIPID_CHIP_MASK) >> 4, 209 233 version & TPS65217_CHIPID_REV_MASK); 210 234 211 - for (i = 0; i < TPS65217_NUM_REGULATOR; i++) { 212 - struct platform_device *pdev; 213 - 214 - pdev = platform_device_alloc("tps65217-pmic", i); 215 - if (!pdev) { 216 - dev_err(tps->dev, "Cannot create regulator %d\n", i); 217 - continue; 218 - } 219 - 220 - pdev->dev.parent = tps->dev; 221 - pdev->dev.of_node = pdata->of_node[i]; 222 - reg_data = pdata->tps65217_init_data[i]; 223 - platform_device_add_data(pdev, reg_data, sizeof(*reg_data)); 224 - tps->regulator_pdev[i] = pdev; 225 - 226 - platform_device_add(pdev); 227 - } 228 - 229 235 return 0; 230 236 } 231 237 232 238 static int __devexit tps65217_remove(struct i2c_client *client) 233 239 { 234 240 struct tps65217 *tps = i2c_get_clientdata(client); 235 - int i; 236 241 237 - for (i = 0; i < TPS65217_NUM_REGULATOR; i++) 238 - platform_device_unregister(tps->regulator_pdev[i]); 242 + mfd_remove_devices(tps->dev); 239 243 240 244 return 0; 241 245 } 242 246 243 247 static const struct i2c_device_id tps65217_id_table[] = { 244 - {"tps65217", 0xF0}, 245 - {/* end of list */} 248 + {"tps65217", TPS65217}, 249 + { /* sentinel */ } 246 250 }; 247 251 MODULE_DEVICE_TABLE(i2c, tps65217_id_table); 248 252
+2 -1
drivers/mfd/tps6586x.c
··· 493 493 } 494 494 495 495 ret = mfd_add_devices(tps6586x->dev, -1, 496 - tps6586x_cell, ARRAY_SIZE(tps6586x_cell), NULL, 0); 496 + tps6586x_cell, ARRAY_SIZE(tps6586x_cell), 497 + NULL, 0, NULL); 497 498 if (ret < 0) { 498 499 dev_err(&client->dev, "mfd_add_devices failed: %d\n", ret); 499 500 goto err_mfd_add;
+1 -1
drivers/mfd/tps65910.c
··· 254 254 255 255 ret = mfd_add_devices(tps65910->dev, -1, 256 256 tps65910s, ARRAY_SIZE(tps65910s), 257 - NULL, 0); 257 + NULL, 0, NULL); 258 258 if (ret < 0) { 259 259 dev_err(&i2c->dev, "mfd_add_devices failed: %d\n", ret); 260 260 return ret;
+1 -1
drivers/mfd/tps65912-core.c
··· 146 146 147 147 ret = mfd_add_devices(tps65912->dev, -1, 148 148 tps65912s, ARRAY_SIZE(tps65912s), 149 - NULL, 0); 149 + NULL, 0, NULL); 150 150 if (ret < 0) 151 151 goto err; 152 152
+1 -1
drivers/mfd/twl4030-audio.c
··· 223 223 224 224 if (childs) 225 225 ret = mfd_add_devices(&pdev->dev, pdev->id, audio->cells, 226 - childs, NULL, 0); 226 + childs, NULL, 0, NULL); 227 227 else { 228 228 dev_err(&pdev->dev, "No platform data found for childs\n"); 229 229 ret = -ENODEV;
+1 -1
drivers/mfd/twl6040-core.c
··· 632 632 } 633 633 634 634 ret = mfd_add_devices(&client->dev, -1, twl6040->cells, children, 635 - NULL, 0); 635 + NULL, 0, NULL); 636 636 if (ret) 637 637 goto mfd_err; 638 638
+1 -1
drivers/mfd/vx855.c
··· 102 102 vx855_gpio_resources[1].end = vx855_gpio_resources[1].start + 3; 103 103 104 104 ret = mfd_add_devices(&pdev->dev, -1, vx855_cells, ARRAY_SIZE(vx855_cells), 105 - NULL, 0); 105 + NULL, 0, NULL); 106 106 107 107 /* we always return -ENODEV here in order to enable other 108 108 * drivers like old, not-yet-platform_device ported i2c-viapro */
+1 -1
drivers/mfd/wl1273-core.c
··· 241 241 __func__, children); 242 242 243 243 r = mfd_add_devices(&client->dev, -1, core->cells, 244 - children, NULL, 0); 244 + children, NULL, 0, NULL); 245 245 if (r) 246 246 goto err; 247 247
+8 -8
drivers/mfd/wm831x-core.c
··· 1813 1813 case WM8310: 1814 1814 ret = mfd_add_devices(wm831x->dev, wm831x_num, 1815 1815 wm8310_devs, ARRAY_SIZE(wm8310_devs), 1816 - NULL, 0); 1816 + NULL, 0, NULL); 1817 1817 break; 1818 1818 1819 1819 case WM8311: 1820 1820 ret = mfd_add_devices(wm831x->dev, wm831x_num, 1821 1821 wm8311_devs, ARRAY_SIZE(wm8311_devs), 1822 - NULL, 0); 1822 + NULL, 0, NULL); 1823 1823 if (!pdata || !pdata->disable_touch) 1824 1824 mfd_add_devices(wm831x->dev, wm831x_num, 1825 1825 touch_devs, ARRAY_SIZE(touch_devs), 1826 - NULL, 0); 1826 + NULL, 0, NULL); 1827 1827 break; 1828 1828 1829 1829 case WM8312: 1830 1830 ret = mfd_add_devices(wm831x->dev, wm831x_num, 1831 1831 wm8312_devs, ARRAY_SIZE(wm8312_devs), 1832 - NULL, 0); 1832 + NULL, 0, NULL); 1833 1833 if (!pdata || !pdata->disable_touch) 1834 1834 mfd_add_devices(wm831x->dev, wm831x_num, 1835 1835 touch_devs, ARRAY_SIZE(touch_devs), 1836 - NULL, 0); 1836 + NULL, 0, NULL); 1837 1837 break; 1838 1838 1839 1839 case WM8320: ··· 1842 1842 case WM8326: 1843 1843 ret = mfd_add_devices(wm831x->dev, wm831x_num, 1844 1844 wm8320_devs, ARRAY_SIZE(wm8320_devs), 1845 - NULL, 0); 1845 + NULL, 0, NULL); 1846 1846 break; 1847 1847 1848 1848 default: ··· 1867 1867 if (ret & WM831X_XTAL_ENA) { 1868 1868 ret = mfd_add_devices(wm831x->dev, wm831x_num, 1869 1869 rtc_devs, ARRAY_SIZE(rtc_devs), 1870 - NULL, 0); 1870 + NULL, 0, NULL); 1871 1871 if (ret != 0) { 1872 1872 dev_err(wm831x->dev, "Failed to add RTC: %d\n", ret); 1873 1873 goto err_irq; ··· 1880 1880 /* Treat errors as non-critical */ 1881 1881 ret = mfd_add_devices(wm831x->dev, wm831x_num, backlight_devs, 1882 1882 ARRAY_SIZE(backlight_devs), NULL, 1883 - 0); 1883 + 0, NULL); 1884 1884 if (ret < 0) 1885 1885 dev_err(wm831x->dev, "Failed to add backlight: %d\n", 1886 1886 ret);
+1 -1
drivers/mfd/wm8400-core.c
··· 70 70 .pdata_size = sizeof(*wm8400), 71 71 }; 72 72 73 - return mfd_add_devices(wm8400->dev, -1, &cell, 1, NULL, 0); 73 + return mfd_add_devices(wm8400->dev, -1, &cell, 1, NULL, 0, NULL); 74 74 } 75 75 76 76 /*
+2 -2
drivers/mfd/wm8994-core.c
··· 414 414 ret = mfd_add_devices(wm8994->dev, -1, 415 415 wm8994_regulator_devs, 416 416 ARRAY_SIZE(wm8994_regulator_devs), 417 - NULL, 0); 417 + NULL, 0, NULL); 418 418 if (ret != 0) { 419 419 dev_err(wm8994->dev, "Failed to add children: %d\n", ret); 420 420 goto err; ··· 648 648 649 649 ret = mfd_add_devices(wm8994->dev, -1, 650 650 wm8994_devs, ARRAY_SIZE(wm8994_devs), 651 - NULL, 0); 651 + NULL, 0, NULL); 652 652 if (ret != 0) { 653 653 dev_err(wm8994->dev, "Failed to add children: %d\n", ret); 654 654 goto err_irq;
+1 -3
drivers/net/can/janz-ican3.c
··· 1391 1391 */ 1392 1392 static int ican3_reset_module(struct ican3_dev *mod) 1393 1393 { 1394 - u8 val = 1 << mod->num; 1395 1394 unsigned long start; 1396 1395 u8 runold, runnew; 1397 1396 ··· 1404 1405 runold = ioread8(mod->dpm + TARGET_RUNNING); 1405 1406 1406 1407 /* reset the module */ 1407 - iowrite8(val, &mod->ctrl->reset_assert); 1408 - iowrite8(val, &mod->ctrl->reset_deassert); 1408 + iowrite8(0x00, &mod->dpmctrl->hwreset); 1409 1409 1410 1410 /* wait until the module has finished resetting and is running */ 1411 1411 start = jiffies;
+1 -1
drivers/net/can/ti_hecc.c
··· 984 984 struct net_device *ndev = platform_get_drvdata(pdev); 985 985 struct ti_hecc_priv *priv = netdev_priv(ndev); 986 986 987 + unregister_candev(ndev); 987 988 clk_disable(priv->clk); 988 989 clk_put(priv->clk); 989 990 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 990 991 iounmap(priv->base); 991 992 release_mem_region(res->start, resource_size(res)); 992 - unregister_candev(ndev); 993 993 free_candev(ndev); 994 994 platform_set_drvdata(pdev, NULL); 995 995
+1 -1
drivers/net/ethernet/broadcom/bnx2.c
··· 8564 8564 return 0; 8565 8565 8566 8566 error: 8567 - iounmap(bp->regview); 8567 + pci_iounmap(pdev, bp->regview); 8568 8568 pci_release_regions(pdev); 8569 8569 pci_disable_device(pdev); 8570 8570 pci_set_drvdata(pdev, NULL);
+7 -5
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 662 662 struct bnx2x_fastpath *fp, 663 663 struct bnx2x_eth_q_stats *qstats) 664 664 { 665 - /* Do nothing if no IP/L4 csum validation was done */ 666 - 665 + /* Do nothing if no L4 csum validation was done. 666 + * We do not check whether IP csum was validated. For IPv4 we assume 667 + * that if the card got as far as validating the L4 csum, it also 668 + * validated the IP csum. IPv6 has no IP csum. 669 + */ 667 670 if (cqe->fast_path_cqe.status_flags & 668 - (ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG | 669 - ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG)) 671 + ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG) 670 672 return; 671 673 672 - /* If both IP/L4 validation were done, check if an error was found. */ 674 + /* If L4 validation was done, check if an error was found. */ 673 675 674 676 if (cqe->fast_path_cqe.type_error_flags & 675 677 (ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG |
+6 -5
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 9841 9841 } 9842 9842 9843 9843 #ifdef CONFIG_PCI_MSI 9844 - /* 9845 - * It's expected that number of CAM entries for this functions is equal 9846 - * to the number evaluated based on the MSI-X table size. We want a 9847 - * harsh warning if these values are different! 9844 + /* Due to new PF resource allocation by MFW T7.4 and above, it's 9845 + * optional that number of CAM entries will not be equal to the value 9846 + * advertised in PCI. 9847 + * Driver should use the minimal value of both as the actual status 9848 + * block count 9848 9849 */ 9849 - WARN_ON(bp->igu_sb_cnt != igu_sb_cnt); 9850 + bp->igu_sb_cnt = min_t(int, bp->igu_sb_cnt, igu_sb_cnt); 9850 9851 #endif 9851 9852 9852 9853 if (igu_sb_cnt == 0)
+1 -1
drivers/net/ethernet/cadence/at91_ether.c
··· 1086 1086 /* Clock */ 1087 1087 lp->ether_clk = clk_get(&pdev->dev, "ether_clk"); 1088 1088 if (IS_ERR(lp->ether_clk)) { 1089 - res = -ENODEV; 1089 + res = PTR_ERR(lp->ether_clk); 1090 1090 goto err_ioumap; 1091 1091 } 1092 1092 clk_enable(lp->ether_clk);
+1
drivers/net/ethernet/freescale/gianfar_ethtool.c
··· 1773 1773 } 1774 1774 1775 1775 int gfar_phc_index = -1; 1776 + EXPORT_SYMBOL(gfar_phc_index); 1776 1777 1777 1778 static int gfar_get_ts_info(struct net_device *dev, 1778 1779 struct ethtool_ts_info *info)
+2 -2
drivers/net/ethernet/freescale/gianfar_ptp.c
··· 515 515 err = PTR_ERR(etsects->clock); 516 516 goto no_clock; 517 517 } 518 - gfar_phc_clock = ptp_clock_index(etsects->clock); 518 + gfar_phc_index = ptp_clock_index(etsects->clock); 519 519 520 520 dev_set_drvdata(&dev->dev, etsects); 521 521 ··· 539 539 gfar_write(&etsects->regs->tmr_temask, 0); 540 540 gfar_write(&etsects->regs->tmr_ctrl, 0); 541 541 542 - gfar_phc_clock = -1; 542 + gfar_phc_index = -1; 543 543 ptp_clock_unregister(etsects->clock); 544 544 iounmap(etsects->regs); 545 545 release_resource(etsects->rsrc);
+11
drivers/net/ethernet/intel/e1000/e1000_main.c
··· 3150 3150 return NETDEV_TX_OK; 3151 3151 } 3152 3152 3153 + /* On PCI/PCI-X HW, if packet size is less than ETH_ZLEN, 3154 + * packets may get corrupted during padding by HW. 3155 + * To WA this issue, pad all small packets manually. 3156 + */ 3157 + if (skb->len < ETH_ZLEN) { 3158 + if (skb_pad(skb, ETH_ZLEN - skb->len)) 3159 + return NETDEV_TX_OK; 3160 + skb->len = ETH_ZLEN; 3161 + skb_set_tail_pointer(skb, ETH_ZLEN); 3162 + } 3163 + 3153 3164 mss = skb_shinfo(skb)->gso_size; 3154 3165 /* The controller does a simple calculation to 3155 3166 * make sure there is enough room in the FIFO before
+18 -12
drivers/net/ethernet/mellanox/mlx4/icm.c
··· 227 227 MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); 228 228 } 229 229 230 - int mlx4_table_get(struct mlx4_dev *dev, struct mlx4_icm_table *table, int obj) 230 + int mlx4_table_get(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 obj) 231 231 { 232 - int i = (obj & (table->num_obj - 1)) / (MLX4_TABLE_CHUNK_SIZE / table->obj_size); 232 + u32 i = (obj & (table->num_obj - 1)) / 233 + (MLX4_TABLE_CHUNK_SIZE / table->obj_size); 233 234 int ret = 0; 234 235 235 236 mutex_lock(&table->mutex); ··· 263 262 return ret; 264 263 } 265 264 266 - void mlx4_table_put(struct mlx4_dev *dev, struct mlx4_icm_table *table, int obj) 265 + void mlx4_table_put(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 obj) 267 266 { 268 - int i; 267 + u32 i; 268 + u64 offset; 269 269 270 270 i = (obj & (table->num_obj - 1)) / (MLX4_TABLE_CHUNK_SIZE / table->obj_size); 271 271 272 272 mutex_lock(&table->mutex); 273 273 274 274 if (--table->icm[i]->refcount == 0) { 275 - mlx4_UNMAP_ICM(dev, table->virt + i * MLX4_TABLE_CHUNK_SIZE, 275 + offset = (u64) i * MLX4_TABLE_CHUNK_SIZE; 276 + mlx4_UNMAP_ICM(dev, table->virt + offset, 276 277 MLX4_TABLE_CHUNK_SIZE / MLX4_ICM_PAGE_SIZE); 277 278 mlx4_free_icm(dev, table->icm[i], table->coherent); 278 279 table->icm[i] = NULL; ··· 283 280 mutex_unlock(&table->mutex); 284 281 } 285 282 286 - void *mlx4_table_find(struct mlx4_icm_table *table, int obj, dma_addr_t *dma_handle) 283 + void *mlx4_table_find(struct mlx4_icm_table *table, u32 obj, 284 + dma_addr_t *dma_handle) 287 285 { 288 - int idx, offset, dma_offset, i; 286 + int offset, dma_offset, i; 287 + u64 idx; 289 288 struct mlx4_icm_chunk *chunk; 290 289 struct mlx4_icm *icm; 291 290 struct page *page = NULL; ··· 297 292 298 293 mutex_lock(&table->mutex); 299 294 300 - idx = (obj & (table->num_obj - 1)) * table->obj_size; 295 + idx = (u64) (obj & (table->num_obj - 1)) * table->obj_size; 301 296 icm = table->icm[idx / MLX4_TABLE_CHUNK_SIZE]; 302 297 dma_offset = offset = idx % MLX4_TABLE_CHUNK_SIZE; 303 298 ··· 331 326 } 332 327 333 328 int mlx4_table_get_range(struct mlx4_dev *dev, struct mlx4_icm_table *table, 334 - int start, int end) 329 + u32 start, u32 end) 335 330 { 336 331 int inc = MLX4_TABLE_CHUNK_SIZE / table->obj_size; 337 - int i, err; 332 + int err; 333 + u32 i; 338 334 339 335 for (i = start; i <= end; i += inc) { 340 336 err = mlx4_table_get(dev, table, i); ··· 355 349 } 356 350 357 351 void mlx4_table_put_range(struct mlx4_dev *dev, struct mlx4_icm_table *table, 358 - int start, int end) 352 + u32 start, u32 end) 359 353 { 360 - int i; 354 + u32 i; 361 355 362 356 for (i = start; i <= end; i += MLX4_TABLE_CHUNK_SIZE / table->obj_size) 363 357 mlx4_table_put(dev, table, i);
+5 -5
drivers/net/ethernet/mellanox/mlx4/icm.h
··· 71 71 gfp_t gfp_mask, int coherent); 72 72 void mlx4_free_icm(struct mlx4_dev *dev, struct mlx4_icm *icm, int coherent); 73 73 74 - int mlx4_table_get(struct mlx4_dev *dev, struct mlx4_icm_table *table, int obj); 75 - void mlx4_table_put(struct mlx4_dev *dev, struct mlx4_icm_table *table, int obj); 74 + int mlx4_table_get(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 obj); 75 + void mlx4_table_put(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 obj); 76 76 int mlx4_table_get_range(struct mlx4_dev *dev, struct mlx4_icm_table *table, 77 - int start, int end); 77 + u32 start, u32 end); 78 78 void mlx4_table_put_range(struct mlx4_dev *dev, struct mlx4_icm_table *table, 79 - int start, int end); 79 + u32 start, u32 end); 80 80 int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table, 81 81 u64 virt, int obj_size, u32 nobj, int reserved, 82 82 int use_lowmem, int use_coherent); 83 83 void mlx4_cleanup_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table); 84 - void *mlx4_table_find(struct mlx4_icm_table *table, int obj, dma_addr_t *dma_handle); 84 + void *mlx4_table_find(struct mlx4_icm_table *table, u32 obj, dma_addr_t *dma_handle); 85 85 86 86 static inline void mlx4_icm_first(struct mlx4_icm *icm, 87 87 struct mlx4_icm_iter *iter)
+1 -3
drivers/net/ethernet/octeon/octeon_mgmt.c
··· 722 722 octeon_mgmt_adjust_link, 0, 723 723 PHY_INTERFACE_MODE_MII); 724 724 725 - if (IS_ERR(p->phydev)) { 726 - p->phydev = NULL; 725 + if (!p->phydev) 727 726 return -1; 728 - } 729 727 730 728 phy_start_aneg(p->phydev); 731 729
+2 -2
drivers/net/ethernet/pasemi/pasemi_mac.c
··· 1101 1101 phydev = of_phy_connect(dev, phy_dn, &pasemi_adjust_link, 0, 1102 1102 PHY_INTERFACE_MODE_SGMII); 1103 1103 1104 - if (IS_ERR(phydev)) { 1104 + if (!phydev) { 1105 1105 printk(KERN_ERR "%s: Could not attach to phy\n", dev->name); 1106 - return PTR_ERR(phydev); 1106 + return -ENODEV; 1107 1107 } 1108 1108 1109 1109 mac->phydev = phydev;
+4
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
··· 1378 1378 struct pci_dev *root = pdev->bus->self; 1379 1379 u32 aer_pos; 1380 1380 1381 + /* root bus? */ 1382 + if (!root) 1383 + return; 1384 + 1381 1385 if (adapter->ahw.board_type != NETXEN_BRDTYPE_P3_4_GB_MM && 1382 1386 adapter->ahw.board_type != NETXEN_BRDTYPE_P3_10G_TP) 1383 1387 return;
+2 -2
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
··· 15 15 16 16 do { 17 17 /* give atleast 1ms for firmware to respond */ 18 - msleep(1); 18 + mdelay(1); 19 19 20 20 if (++timeout > QLCNIC_OS_CRB_RETRY_COUNT) 21 21 return QLCNIC_CDRP_RSP_TIMEOUT; ··· 601 601 qlcnic_fw_cmd_destroy_tx_ctx(adapter); 602 602 603 603 /* Allow dma queues to drain after context reset */ 604 - msleep(20); 604 + mdelay(20); 605 605 } 606 606 } 607 607
+5 -5
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 1066 1066 } else 1067 1067 priv->tm->enable = 1; 1068 1068 #endif 1069 - clk_enable(priv->stmmac_clk); 1069 + clk_prepare_enable(priv->stmmac_clk); 1070 1070 1071 1071 stmmac_check_ether_addr(priv); 1072 1072 ··· 1188 1188 if (priv->phydev) 1189 1189 phy_disconnect(priv->phydev); 1190 1190 1191 - clk_disable(priv->stmmac_clk); 1191 + clk_disable_unprepare(priv->stmmac_clk); 1192 1192 1193 1193 return ret; 1194 1194 } ··· 1246 1246 #ifdef CONFIG_STMMAC_DEBUG_FS 1247 1247 stmmac_exit_fs(); 1248 1248 #endif 1249 - clk_disable(priv->stmmac_clk); 1249 + clk_disable_unprepare(priv->stmmac_clk); 1250 1250 1251 1251 return 0; 1252 1252 } ··· 2178 2178 else { 2179 2179 stmmac_set_mac(priv->ioaddr, false); 2180 2180 /* Disable clock in case of PWM is off */ 2181 - clk_disable(priv->stmmac_clk); 2181 + clk_disable_unprepare(priv->stmmac_clk); 2182 2182 } 2183 2183 spin_unlock_irqrestore(&priv->lock, flags); 2184 2184 return 0; ··· 2203 2203 priv->hw->mac->pmt(priv->ioaddr, 0); 2204 2204 else 2205 2205 /* enable the clk prevously disabled */ 2206 - clk_enable(priv->stmmac_clk); 2206 + clk_prepare_enable(priv->stmmac_clk); 2207 2207 2208 2208 netif_device_attach(ndev); 2209 2209
+4 -4
drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c
··· 97 97 static void stmmac_tmu_start(unsigned int new_freq) 98 98 { 99 99 clk_set_rate(timer_clock, new_freq); 100 - clk_enable(timer_clock); 100 + clk_prepare_enable(timer_clock); 101 101 } 102 102 103 103 static void stmmac_tmu_stop(void) 104 104 { 105 - clk_disable(timer_clock); 105 + clk_disable_unprepare(timer_clock); 106 106 } 107 107 108 108 int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm) 109 109 { 110 110 timer_clock = clk_get(NULL, TMU_CHANNEL); 111 111 112 - if (timer_clock == NULL) 112 + if (IS_ERR(timer_clock)) 113 113 return -1; 114 114 115 115 if (tmu2_register_user(stmmac_timer_handler, (void *)dev) < 0) { ··· 126 126 127 127 int stmmac_close_ext_timer(void) 128 128 { 129 - clk_disable(timer_clock); 129 + clk_disable_unprepare(timer_clock); 130 130 tmu2_unregister_user(); 131 131 clk_put(timer_clock); 132 132 return 0;
+1 -1
drivers/net/irda/sh_sir.c
··· 280 280 } 281 281 282 282 clk = clk_get(NULL, "irda_clk"); 283 - if (!clk) { 283 + if (IS_ERR(clk)) { 284 284 dev_err(dev, "can not get irda_clk\n"); 285 285 return -EIO; 286 286 }
+2
drivers/net/phy/bcm87xx.c
··· 229 229 ARRAY_SIZE(bcm87xx_driver)); 230 230 } 231 231 module_exit(bcm87xx_exit); 232 + 233 + MODULE_LICENSE("GPL");
+36 -9
drivers/net/phy/micrel.c
··· 21 21 #include <linux/phy.h> 22 22 #include <linux/micrel_phy.h> 23 23 24 + /* Operation Mode Strap Override */ 25 + #define MII_KSZPHY_OMSO 0x16 26 + #define KSZPHY_OMSO_B_CAST_OFF (1 << 9) 27 + #define KSZPHY_OMSO_RMII_OVERRIDE (1 << 1) 28 + #define KSZPHY_OMSO_MII_OVERRIDE (1 << 0) 29 + 24 30 /* general Interrupt control/status reg in vendor specific block. */ 25 31 #define MII_KSZPHY_INTCS 0x1B 26 32 #define KSZPHY_INTCS_JABBER (1 << 15) ··· 107 101 return 0; 108 102 } 109 103 104 + static int ksz8021_config_init(struct phy_device *phydev) 105 + { 106 + const u16 val = KSZPHY_OMSO_B_CAST_OFF | KSZPHY_OMSO_RMII_OVERRIDE; 107 + phy_write(phydev, MII_KSZPHY_OMSO, val); 108 + return 0; 109 + } 110 + 110 111 static int ks8051_config_init(struct phy_device *phydev) 111 112 { 112 113 int regval; ··· 141 128 .config_intr = ks8737_config_intr, 142 129 .driver = { .owner = THIS_MODULE,}, 143 130 }, { 144 - .phy_id = PHY_ID_KS8041, 131 + .phy_id = PHY_ID_KSZ8021, 132 + .phy_id_mask = 0x00ffffff, 133 + .name = "Micrel KSZ8021", 134 + .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause | 135 + SUPPORTED_Asym_Pause), 136 + .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 137 + .config_init = ksz8021_config_init, 138 + .config_aneg = genphy_config_aneg, 139 + .read_status = genphy_read_status, 140 + .ack_interrupt = kszphy_ack_interrupt, 141 + .config_intr = kszphy_config_intr, 142 + .driver = { .owner = THIS_MODULE,}, 143 + }, { 144 + .phy_id = PHY_ID_KSZ8041, 145 145 .phy_id_mask = 0x00fffff0, 146 - .name = "Micrel KS8041", 146 + .name = "Micrel KSZ8041", 147 147 .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause 148 148 | SUPPORTED_Asym_Pause), 149 149 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, ··· 167 141 .config_intr = kszphy_config_intr, 168 142 .driver = { .owner = THIS_MODULE,}, 169 143 }, { 170 - .phy_id = PHY_ID_KS8051, 144 + .phy_id = PHY_ID_KSZ8051, 171 145 .phy_id_mask = 0x00fffff0, 172 - .name = "Micrel KS8051", 146 + .name = "Micrel KSZ8051", 173 147 .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause 174 148 | SUPPORTED_Asym_Pause), 175 149 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, ··· 180 154 .config_intr = kszphy_config_intr, 181 155 .driver = { .owner = THIS_MODULE,}, 182 156 }, { 183 - .phy_id = PHY_ID_KS8001, 184 - .name = "Micrel KS8001 or KS8721", 157 + .phy_id = PHY_ID_KSZ8001, 158 + .name = "Micrel KSZ8001 or KS8721", 185 159 .phy_id_mask = 0x00ffffff, 186 160 .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), 187 161 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, ··· 227 201 228 202 static struct mdio_device_id __maybe_unused micrel_tbl[] = { 229 203 { PHY_ID_KSZ9021, 0x000ffffe }, 230 - { PHY_ID_KS8001, 0x00ffffff }, 204 + { PHY_ID_KSZ8001, 0x00ffffff }, 231 205 { PHY_ID_KS8737, 0x00fffff0 }, 232 - { PHY_ID_KS8041, 0x00fffff0 }, 233 - { PHY_ID_KS8051, 0x00fffff0 }, 206 + { PHY_ID_KSZ8021, 0x00ffffff }, 207 + { PHY_ID_KSZ8041, 0x00fffff0 }, 208 + { PHY_ID_KSZ8051, 0x00fffff0 }, 234 209 { } 235 210 }; 236 211
+27 -1
drivers/net/phy/smsc.c
··· 56 56 return smsc_phy_ack_interrupt (phydev); 57 57 } 58 58 59 + static int lan87xx_config_init(struct phy_device *phydev) 60 + { 61 + /* 62 + * Make sure the EDPWRDOWN bit is NOT set. Setting this bit on 63 + * LAN8710/LAN8720 PHY causes the PHY to misbehave, likely due 64 + * to a bug on the chip. 65 + * 66 + * When the system is powered on with the network cable being 67 + * disconnected all the way until after ifconfig ethX up is 68 + * issued for the LAN port with this PHY, connecting the cable 69 + * afterwards does not cause LINK change detection, while the 70 + * expected behavior is the Link UP being detected. 71 + */ 72 + int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); 73 + if (rc < 0) 74 + return rc; 75 + 76 + rc &= ~MII_LAN83C185_EDPWRDOWN; 77 + 78 + rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS, rc); 79 + if (rc < 0) 80 + return rc; 81 + 82 + return smsc_phy_ack_interrupt(phydev); 83 + } 84 + 59 85 static int lan911x_config_init(struct phy_device *phydev) 60 86 { 61 87 return smsc_phy_ack_interrupt(phydev); ··· 188 162 /* basic functions */ 189 163 .config_aneg = genphy_config_aneg, 190 164 .read_status = genphy_read_status, 191 - .config_init = smsc_phy_config_init, 165 + .config_init = lan87xx_config_init, 192 166 193 167 /* IRQ related */ 194 168 .ack_interrupt = smsc_phy_ack_interrupt,
+1 -1
drivers/net/ppp/pppoe.c
··· 570 570 571 571 po = pppox_sk(sk); 572 572 573 - if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) { 573 + if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) { 574 574 dev_put(po->pppoe_dev); 575 575 po->pppoe_dev = NULL; 576 576 }
+6 -7
drivers/net/team/team.c
··· 967 967 #endif 968 968 969 969 static void __team_port_change_port_added(struct team_port *port, bool linkup); 970 - 971 970 static int team_dev_type_check_change(struct net_device *dev, 972 971 struct net_device *port_dev); 973 972 ··· 1889 1890 1890 1891 hdr = genlmsg_put(msg, info->snd_portid, info->snd_seq, 1891 1892 &team_nl_family, 0, TEAM_CMD_NOOP); 1892 - if (IS_ERR(hdr)) { 1893 - err = PTR_ERR(hdr); 1893 + if (!hdr) { 1894 + err = -EMSGSIZE; 1894 1895 goto err_msg_put; 1895 1896 } 1896 1897 ··· 2090 2091 2091 2092 hdr = genlmsg_put(skb, portid, seq, &team_nl_family, flags | NLM_F_MULTI, 2092 2093 TEAM_CMD_OPTIONS_GET); 2093 - if (IS_ERR(hdr)) 2094 - return PTR_ERR(hdr); 2094 + if (!hdr) 2095 + return -EMSGSIZE; 2095 2096 2096 2097 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex)) 2097 2098 goto nla_put_failure; ··· 2316 2317 2317 2318 hdr = genlmsg_put(skb, portid, seq, &team_nl_family, flags, 2318 2319 TEAM_CMD_PORT_LIST_GET); 2319 - if (IS_ERR(hdr)) 2320 - return PTR_ERR(hdr); 2320 + if (!hdr) 2321 + return -EMSGSIZE; 2321 2322 2322 2323 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex)) 2323 2324 goto nla_put_failure;
+4
drivers/net/usb/asix_devices.c
··· 966 966 USB_DEVICE (0x2001, 0x3c05), 967 967 .driver_info = (unsigned long) &ax88772_info, 968 968 }, { 969 + // DLink DUB-E100 H/W Ver C1 970 + USB_DEVICE (0x2001, 0x1a02), 971 + .driver_info = (unsigned long) &ax88772_info, 972 + }, { 969 973 // Linksys USB1000 970 974 USB_DEVICE (0x1737, 0x0039), 971 975 .driver_info = (unsigned long) &ax88178_info,
+2 -2
drivers/net/usb/qmi_wwan.c
··· 353 353 }, 354 354 355 355 /* 2. Combined interface devices matching on class+protocol */ 356 - { /* Huawei E367 and possibly others in "Windows mode" */ 356 + { /* Huawei E367 and possibly others in "Windows mode" */ 357 357 USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 7), 358 358 .driver_info = (unsigned long)&qmi_wwan_info, 359 359 }, ··· 361 361 USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17), 362 362 .driver_info = (unsigned long)&qmi_wwan_info, 363 363 }, 364 - { /* Pantech UML290, P4200 and more */ 364 + { /* Pantech UML290, P4200 and more */ 365 365 USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff), 366 366 .driver_info = (unsigned long)&qmi_wwan_info, 367 367 },
+1
drivers/net/usb/smsc75xx.c
··· 1253 1253 .probe = usbnet_probe, 1254 1254 .suspend = usbnet_suspend, 1255 1255 .resume = usbnet_resume, 1256 + .reset_resume = usbnet_resume, 1256 1257 .disconnect = usbnet_disconnect, 1257 1258 .disable_hub_initiated_lpm = 1, 1258 1259 };
+4
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
··· 2987 2987 case EEP_RX_MASK: 2988 2988 return pBase->txrxMask & 0xf; 2989 2989 case EEP_PAPRD: 2990 + if (AR_SREV_9462(ah)) 2991 + return false; 2992 + if (!ah->config.enable_paprd); 2993 + return false; 2990 2994 return !!(pBase->featureEnable & BIT(5)); 2991 2995 case EEP_CHAIN_MASK_REDUCE: 2992 2996 return (pBase->miscConfiguration >> 0x3) & 0x1;
+2
drivers/net/wireless/ath/ath9k/debug.c
··· 1580 1580 sc->debug.debugfs_phy, sc, &fops_tx_chainmask); 1581 1581 debugfs_create_file("disable_ani", S_IRUSR | S_IWUSR, 1582 1582 sc->debug.debugfs_phy, sc, &fops_disable_ani); 1583 + debugfs_create_bool("paprd", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, 1584 + &sc->sc_ah->config.enable_paprd); 1583 1585 debugfs_create_file("regidx", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, 1584 1586 sc, &fops_regidx); 1585 1587 debugfs_create_file("regval", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
-4
drivers/net/wireless/ath/ath9k/hw.c
··· 2507 2507 pCap->rx_status_len = sizeof(struct ar9003_rxs); 2508 2508 pCap->tx_desc_len = sizeof(struct ar9003_txc); 2509 2509 pCap->txs_len = sizeof(struct ar9003_txs); 2510 - if (!ah->config.paprd_disable && 2511 - ah->eep_ops->get_eeprom(ah, EEP_PAPRD) && 2512 - !AR_SREV_9462(ah)) 2513 - pCap->hw_caps |= ATH9K_HW_CAP_PAPRD; 2514 2510 } else { 2515 2511 pCap->tx_desc_len = sizeof(struct ath_desc); 2516 2512 if (AR_SREV_9280_20(ah))
+1 -2
drivers/net/wireless/ath/ath9k/hw.h
··· 237 237 ATH9K_HW_CAP_LDPC = BIT(6), 238 238 ATH9K_HW_CAP_FASTCLOCK = BIT(7), 239 239 ATH9K_HW_CAP_SGI_20 = BIT(8), 240 - ATH9K_HW_CAP_PAPRD = BIT(9), 241 240 ATH9K_HW_CAP_ANT_DIV_COMB = BIT(10), 242 241 ATH9K_HW_CAP_2GHZ = BIT(11), 243 242 ATH9K_HW_CAP_5GHZ = BIT(12), ··· 287 288 u8 pcie_clock_req; 288 289 u32 pcie_waen; 289 290 u8 analog_shiftreg; 290 - u8 paprd_disable; 291 291 u32 ofdm_trig_low; 292 292 u32 ofdm_trig_high; 293 293 u32 cck_trig_high; 294 294 u32 cck_trig_low; 295 295 u32 enable_ani; 296 + u32 enable_paprd; 296 297 int serialize_regmode; 297 298 bool rx_intr_mitigation; 298 299 bool tx_intr_mitigation;
+1 -1
drivers/net/wireless/ath/ath9k/link.c
··· 423 423 cal_interval = min(cal_interval, (u32)short_cal_interval); 424 424 425 425 mod_timer(&common->ani.timer, jiffies + msecs_to_jiffies(cal_interval)); 426 - if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_PAPRD) && ah->caldata) { 426 + if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD) && ah->caldata) { 427 427 if (!ah->caldata->paprd_done) 428 428 ieee80211_queue_work(sc->hw, &sc->paprd_work); 429 429 else if (!ah->paprd_table_write_done)
+2
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
··· 640 640 641 641 oobirq_entry = kzalloc(sizeof(struct brcmf_sdio_oobirq), 642 642 GFP_KERNEL); 643 + if (!oobirq_entry) 644 + return -ENOMEM; 643 645 oobirq_entry->irq = res->start; 644 646 oobirq_entry->flags = res->flags & IRQF_TRIGGER_MASK; 645 647 list_add_tail(&oobirq_entry->list, &oobirq_lh);
+16 -10
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
··· 770 770 { 771 771 char iovbuf[32]; 772 772 int retcode; 773 + __le32 arp_mode_le; 773 774 774 - brcmf_c_mkiovar("arp_ol", (char *)&arp_mode, 4, iovbuf, sizeof(iovbuf)); 775 + arp_mode_le = cpu_to_le32(arp_mode); 776 + brcmf_c_mkiovar("arp_ol", (char *)&arp_mode_le, 4, iovbuf, 777 + sizeof(iovbuf)); 775 778 retcode = brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, 776 779 iovbuf, sizeof(iovbuf)); 777 780 retcode = retcode >= 0 ? 0 : retcode; ··· 790 787 { 791 788 char iovbuf[32]; 792 789 int retcode; 790 + __le32 arp_enable_le; 793 791 794 - brcmf_c_mkiovar("arpoe", (char *)&arp_enable, 4, 792 + arp_enable_le = cpu_to_le32(arp_enable); 793 + 794 + brcmf_c_mkiovar("arpoe", (char *)&arp_enable_le, 4, 795 795 iovbuf, sizeof(iovbuf)); 796 796 retcode = brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, 797 797 iovbuf, sizeof(iovbuf)); ··· 812 806 char iovbuf[BRCMF_EVENTING_MASK_LEN + 12]; /* Room for 813 807 "event_msgs" + '\0' + bitvec */ 814 808 char buf[128], *ptr; 815 - u32 roaming = 1; 816 - uint bcn_timeout = 3; 817 - int scan_assoc_time = 40; 818 - int scan_unassoc_time = 40; 809 + __le32 roaming_le = cpu_to_le32(1); 810 + __le32 bcn_timeout_le = cpu_to_le32(3); 811 + __le32 scan_assoc_time_le = cpu_to_le32(40); 812 + __le32 scan_unassoc_time_le = cpu_to_le32(40); 819 813 int i; 820 814 struct brcmf_bus_dcmd *cmdlst; 821 815 struct list_head *cur, *q; ··· 841 835 842 836 /* Setup timeout if Beacons are lost and roam is off to report 843 837 link down */ 844 - brcmf_c_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf, 838 + brcmf_c_mkiovar("bcn_timeout", (char *)&bcn_timeout_le, 4, iovbuf, 845 839 sizeof(iovbuf)); 846 840 brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, iovbuf, 847 841 sizeof(iovbuf)); 848 842 849 843 /* Enable/Disable build-in roaming to allowed ext supplicant to take 850 844 of romaing */ 851 - brcmf_c_mkiovar("roam_off", (char *)&roaming, 4, 845 + brcmf_c_mkiovar("roam_off", (char *)&roaming_le, 4, 852 846 iovbuf, sizeof(iovbuf)); 853 847 brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, iovbuf, 854 848 sizeof(iovbuf)); ··· 860 854 sizeof(iovbuf)); 861 855 862 856 brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_SCAN_CHANNEL_TIME, 863 - (char *)&scan_assoc_time, sizeof(scan_assoc_time)); 857 + (char *)&scan_assoc_time_le, sizeof(scan_assoc_time_le)); 864 858 brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME, 865 - (char *)&scan_unassoc_time, sizeof(scan_unassoc_time)); 859 + (char *)&scan_unassoc_time_le, sizeof(scan_unassoc_time_le)); 866 860 867 861 /* Set and enable ARP offload feature */ 868 862 brcmf_c_arp_offload_set(drvr, BRCMF_ARPOL_MODE);
+4 -2
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
··· 501 501 params_le->active_time = cpu_to_le32(-1); 502 502 params_le->passive_time = cpu_to_le32(-1); 503 503 params_le->home_time = cpu_to_le32(-1); 504 - if (ssid && ssid->SSID_len) 505 - memcpy(&params_le->ssid_le, ssid, sizeof(struct brcmf_ssid)); 504 + if (ssid && ssid->SSID_len) { 505 + params_le->ssid_le.SSID_len = cpu_to_le32(ssid->SSID_len); 506 + memcpy(&params_le->ssid_le.SSID, ssid->SSID, ssid->SSID_len); 507 + } 506 508 } 507 509 508 510 static s32
+1 -1
drivers/net/wireless/brcm80211/brcmsmac/channel.c
··· 77 77 NL80211_RRF_NO_IBSS) 78 78 79 79 static const struct ieee80211_regdomain brcms_regdom_x2 = { 80 - .n_reg_rules = 7, 80 + .n_reg_rules = 6, 81 81 .alpha2 = "X2", 82 82 .reg_rules = { 83 83 BRCM_2GHZ_2412_2462,
+1
drivers/net/wireless/iwlwifi/pcie/trans.c
··· 1442 1442 return err; 1443 1443 1444 1444 err_free_irq: 1445 + trans_pcie->irq_requested = false; 1445 1446 free_irq(trans_pcie->irq, trans); 1446 1447 error: 1447 1448 iwl_free_isr_ict(trans);
+1
drivers/net/wireless/rtlwifi/rtl8192ce/def.h
··· 117 117 118 118 #define CHIP_VER_B BIT(4) 119 119 #define CHIP_92C_BITMASK BIT(0) 120 + #define CHIP_UNKNOWN BIT(7) 120 121 #define CHIP_92C_1T2R 0x03 121 122 #define CHIP_92C 0x01 122 123 #define CHIP_88C 0x00
+10 -2
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
··· 994 994 version = (value32 & TYPE_ID) ? VERSION_A_CHIP_92C : 995 995 VERSION_A_CHIP_88C; 996 996 } else { 997 - version = (value32 & TYPE_ID) ? VERSION_B_CHIP_92C : 998 - VERSION_B_CHIP_88C; 997 + version = (enum version_8192c) (CHIP_VER_B | 998 + ((value32 & TYPE_ID) ? CHIP_92C_BITMASK : 0) | 999 + ((value32 & VENDOR_ID) ? CHIP_VENDOR_UMC : 0)); 1000 + if ((!IS_CHIP_VENDOR_UMC(version)) && (value32 & 1001 + CHIP_VER_RTL_MASK)) { 1002 + version = (enum version_8192c)(version | 1003 + ((((value32 & CHIP_VER_RTL_MASK) == BIT(12)) 1004 + ? CHIP_VENDOR_UMC_B_CUT : CHIP_UNKNOWN) | 1005 + CHIP_VENDOR_UMC)); 1006 + } 999 1007 } 1000 1008 1001 1009 switch (version) {
+4 -2
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
··· 162 162 163 163 /* request fw */ 164 164 if (IS_VENDOR_UMC_A_CUT(rtlhal->version) && 165 - !IS_92C_SERIAL(rtlhal->version)) 165 + !IS_92C_SERIAL(rtlhal->version)) { 166 166 rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cfwU.bin"; 167 - else if (IS_81xxC_VENDOR_UMC_B_CUT(rtlhal->version)) 167 + } else if (IS_81xxC_VENDOR_UMC_B_CUT(rtlhal->version)) { 168 168 rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cfwU_B.bin"; 169 + pr_info("****** This B_CUT device may not work with kernels 3.6 and earlier\n"); 170 + } 169 171 170 172 rtlpriv->max_fw_size = 0x4000; 171 173 pr_info("Using firmware %s\n", rtlpriv->cfg->fw_name);
+7
drivers/pwm/pwm-tiecap.c
··· 100 100 writel(period_cycles, pc->mmio_base + CAP3); 101 101 } 102 102 103 + if (!test_bit(PWMF_ENABLED, &pwm->flags)) { 104 + reg_val = readw(pc->mmio_base + ECCTL2); 105 + /* Disable APWM mode to put APWM output Low */ 106 + reg_val &= ~ECCTL2_APWM_MODE; 107 + writew(reg_val, pc->mmio_base + ECCTL2); 108 + } 109 + 103 110 pm_runtime_put_sync(pc->chip.dev); 104 111 return 0; 105 112 }
+29
drivers/pwm/pwm-tiehrpwm.c
··· 104 104 struct pwm_chip chip; 105 105 unsigned int clk_rate; 106 106 void __iomem *mmio_base; 107 + unsigned long period_cycles[NUM_PWM_CHANNEL]; 107 108 }; 108 109 109 110 static inline struct ehrpwm_pwm_chip *to_ehrpwm_pwm_chip(struct pwm_chip *chip) ··· 211 210 unsigned long long c; 212 211 unsigned long period_cycles, duty_cycles; 213 212 unsigned short ps_divval, tb_divval; 213 + int i; 214 214 215 215 if (period_ns < 0 || duty_ns < 0 || period_ns > NSEC_PER_SEC) 216 216 return -ERANGE; ··· 230 228 do_div(c, NSEC_PER_SEC); 231 229 duty_cycles = (unsigned long)c; 232 230 } 231 + 232 + /* 233 + * Period values should be same for multiple PWM channels as IP uses 234 + * same period register for multiple channels. 235 + */ 236 + for (i = 0; i < NUM_PWM_CHANNEL; i++) { 237 + if (pc->period_cycles[i] && 238 + (pc->period_cycles[i] != period_cycles)) { 239 + /* 240 + * Allow channel to reconfigure period if no other 241 + * channels being configured. 242 + */ 243 + if (i == pwm->hwpwm) 244 + continue; 245 + 246 + dev_err(chip->dev, "Period value conflicts with channel %d\n", 247 + i); 248 + return -EINVAL; 249 + } 250 + } 251 + 252 + pc->period_cycles[pwm->hwpwm] = period_cycles; 233 253 234 254 /* Configure clock prescaler to support Low frequency PWM wave */ 235 255 if (set_prescale_div(period_cycles/PERIOD_MAX, &ps_divval, ··· 344 320 345 321 static void ehrpwm_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) 346 322 { 323 + struct ehrpwm_pwm_chip *pc = to_ehrpwm_pwm_chip(chip); 324 + 347 325 if (test_bit(PWMF_ENABLED, &pwm->flags)) { 348 326 dev_warn(chip->dev, "Removing PWM device without disabling\n"); 349 327 pm_runtime_put_sync(chip->dev); 350 328 } 329 + 330 + /* set period value to zero on free */ 331 + pc->period_cycles[pwm->hwpwm] = 0; 351 332 } 352 333 353 334 static const struct pwm_ops ehrpwm_pwm_ops = {
+109 -15
drivers/regulator/tps65217-regulator.c
··· 22 22 #include <linux/err.h> 23 23 #include <linux/platform_device.h> 24 24 25 + #include <linux/regulator/of_regulator.h> 25 26 #include <linux/regulator/driver.h> 26 27 #include <linux/regulator/machine.h> 27 28 #include <linux/mfd/tps65217.h> ··· 282 281 NULL), 283 282 }; 284 283 284 + #ifdef CONFIG_OF 285 + static struct of_regulator_match reg_matches[] = { 286 + { .name = "dcdc1", .driver_data = (void *)TPS65217_DCDC_1 }, 287 + { .name = "dcdc2", .driver_data = (void *)TPS65217_DCDC_2 }, 288 + { .name = "dcdc3", .driver_data = (void *)TPS65217_DCDC_3 }, 289 + { .name = "ldo1", .driver_data = (void *)TPS65217_LDO_1 }, 290 + { .name = "ldo2", .driver_data = (void *)TPS65217_LDO_2 }, 291 + { .name = "ldo3", .driver_data = (void *)TPS65217_LDO_3 }, 292 + { .name = "ldo4", .driver_data = (void *)TPS65217_LDO_4 }, 293 + }; 294 + 295 + static struct tps65217_board *tps65217_parse_dt(struct platform_device *pdev) 296 + { 297 + struct tps65217 *tps = dev_get_drvdata(pdev->dev.parent); 298 + struct device_node *node = tps->dev->of_node; 299 + struct tps65217_board *pdata; 300 + struct device_node *regs; 301 + int i, count; 302 + 303 + regs = of_find_node_by_name(node, "regulators"); 304 + if (!regs) 305 + return NULL; 306 + 307 + count = of_regulator_match(pdev->dev.parent, regs, 308 + reg_matches, TPS65217_NUM_REGULATOR); 309 + of_node_put(regs); 310 + if ((count < 0) || (count > TPS65217_NUM_REGULATOR)) 311 + return NULL; 312 + 313 + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 314 + if (!pdata) 315 + return NULL; 316 + 317 + for (i = 0; i < count; i++) { 318 + if (!reg_matches[i].init_data || !reg_matches[i].of_node) 319 + continue; 320 + 321 + pdata->tps65217_init_data[i] = reg_matches[i].init_data; 322 + pdata->of_node[i] = reg_matches[i].of_node; 323 + } 324 + 325 + return pdata; 326 + } 327 + #else 328 + static struct tps65217_board *tps65217_parse_dt(struct platform_device *pdev) 329 + { 330 + return NULL; 331 + } 332 + #endif 333 + 285 334 static int __devinit tps65217_regulator_probe(struct platform_device *pdev) 286 335 { 336 + struct tps65217 *tps = dev_get_drvdata(pdev->dev.parent); 337 + struct tps65217_board *pdata = dev_get_platdata(tps->dev); 338 + struct regulator_init_data *reg_data; 287 339 struct regulator_dev *rdev; 288 - struct tps65217 *tps; 289 - struct tps_info *info = &tps65217_pmic_regs[pdev->id]; 290 340 struct regulator_config config = { }; 341 + int i, ret; 291 342 292 - /* Already set by core driver */ 293 - tps = dev_to_tps65217(pdev->dev.parent); 294 - tps->info[pdev->id] = info; 343 + if (tps->dev->of_node) 344 + pdata = tps65217_parse_dt(pdev); 295 345 296 - config.dev = &pdev->dev; 297 - config.of_node = pdev->dev.of_node; 298 - config.init_data = pdev->dev.platform_data; 299 - config.driver_data = tps; 346 + if (!pdata) { 347 + dev_err(&pdev->dev, "Platform data not found\n"); 348 + return -EINVAL; 349 + } 300 350 301 - rdev = regulator_register(&regulators[pdev->id], &config); 302 - if (IS_ERR(rdev)) 303 - return PTR_ERR(rdev); 351 + if (tps65217_chip_id(tps) != TPS65217) { 352 + dev_err(&pdev->dev, "Invalid tps chip version\n"); 353 + return -ENODEV; 354 + } 304 355 305 - platform_set_drvdata(pdev, rdev); 356 + platform_set_drvdata(pdev, tps); 306 357 358 + for (i = 0; i < TPS65217_NUM_REGULATOR; i++) { 359 + 360 + reg_data = pdata->tps65217_init_data[i]; 361 + 362 + /* 363 + * Regulator API handles empty constraints but not NULL 364 + * constraints 365 + */ 366 + if (!reg_data) 367 + continue; 368 + 369 + /* Register the regulators */ 370 + tps->info[i] = &tps65217_pmic_regs[i]; 371 + 372 + config.dev = tps->dev; 373 + config.init_data = reg_data; 374 + config.driver_data = tps; 375 + config.regmap = tps->regmap; 376 + if (tps->dev->of_node) 377 + config.of_node = pdata->of_node[i]; 378 + 379 + rdev = regulator_register(&regulators[i], &config); 380 + if (IS_ERR(rdev)) { 381 + dev_err(tps->dev, "failed to register %s regulator\n", 382 + pdev->name); 383 + ret = PTR_ERR(rdev); 384 + goto err_unregister_regulator; 385 + } 386 + 387 + /* Save regulator for cleanup */ 388 + tps->rdev[i] = rdev; 389 + } 307 390 return 0; 391 + 392 + err_unregister_regulator: 393 + while (--i >= 0) 394 + regulator_unregister(tps->rdev[i]); 395 + 396 + return ret; 308 397 } 309 398 310 399 static int __devexit tps65217_regulator_remove(struct platform_device *pdev) 311 400 { 312 - struct regulator_dev *rdev = platform_get_drvdata(pdev); 401 + struct tps65217 *tps = platform_get_drvdata(pdev); 402 + unsigned int i; 403 + 404 + for (i = 0; i < TPS65217_NUM_REGULATOR; i++) 405 + regulator_unregister(tps->rdev[i]); 313 406 314 407 platform_set_drvdata(pdev, NULL); 315 - regulator_unregister(rdev); 316 408 317 409 return 0; 318 410 }
+3 -3
drivers/rpmsg/virtio_rpmsg_bus.c
··· 1008 1008 return 0; 1009 1009 1010 1010 free_coherent: 1011 - dma_free_coherent(vdev->dev.parent, RPMSG_TOTAL_BUF_SPACE, bufs_va, 1012 - vrp->bufs_dma); 1011 + dma_free_coherent(vdev->dev.parent->parent, RPMSG_TOTAL_BUF_SPACE, 1012 + bufs_va, vrp->bufs_dma); 1013 1013 vqs_del: 1014 1014 vdev->config->del_vqs(vrp->vdev); 1015 1015 free_vrp: ··· 1043 1043 1044 1044 vdev->config->del_vqs(vrp->vdev); 1045 1045 1046 - dma_free_coherent(vdev->dev.parent, RPMSG_TOTAL_BUF_SPACE, 1046 + dma_free_coherent(vdev->dev.parent->parent, RPMSG_TOTAL_BUF_SPACE, 1047 1047 vrp->rbufs, vrp->bufs_dma); 1048 1048 1049 1049 kfree(vrp);
+5
drivers/rtc/rtc-twl.c
··· 495 495 if (ret < 0) 496 496 goto out1; 497 497 498 + /* ensure interrupts are disabled, bootloaders can be strange */ 499 + ret = twl_rtc_write_u8(0, REG_RTC_INTERRUPTS_REG); 500 + if (ret < 0) 501 + dev_warn(&pdev->dev, "unable to disable interrupt\n"); 502 + 498 503 /* init cached IRQ enable bits */ 499 504 ret = twl_rtc_read_u8(&rtc_irq_bits, REG_RTC_INTERRUPTS_REG); 500 505 if (ret < 0)
+14 -3
drivers/s390/block/dasd.c
··· 534 534 if (rc) 535 535 device->target = device->state; 536 536 537 - if (device->state == device->target) 538 - wake_up(&dasd_init_waitq); 539 - 540 537 /* let user-space know that the device status changed */ 541 538 kobject_uevent(&device->cdev->dev.kobj, KOBJ_CHANGE); 539 + 540 + if (device->state == device->target) 541 + wake_up(&dasd_init_waitq); 542 542 } 543 543 544 544 /* ··· 2157 2157 test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) && 2158 2158 (!dasd_eer_enabled(device))) { 2159 2159 cqr->status = DASD_CQR_FAILED; 2160 + cqr->intrc = -EAGAIN; 2160 2161 continue; 2161 2162 } 2162 2163 /* Don't try to start requests if device is stopped */ ··· 3271 3270 dasd_schedule_device_bh(device); 3272 3271 } 3273 3272 if (path_event[chp] & PE_PATHGROUP_ESTABLISHED) { 3273 + if (!(device->path_data.opm & eventlpm) && 3274 + !(device->path_data.tbvpm & eventlpm)) { 3275 + /* 3276 + * we can not establish a pathgroup on an 3277 + * unavailable path, so trigger a path 3278 + * verification first 3279 + */ 3280 + device->path_data.tbvpm |= eventlpm; 3281 + dasd_schedule_device_bh(device); 3282 + } 3274 3283 DBF_DEV_EVENT(DBF_WARNING, device, "%s", 3275 3284 "Pathgroup re-established\n"); 3276 3285 if (device->discipline->kick_validate)
+26 -1
drivers/s390/block/dasd_alias.c
··· 384 384 group->next = NULL; 385 385 }; 386 386 387 + static int 388 + suborder_not_supported(struct dasd_ccw_req *cqr) 389 + { 390 + char *sense; 391 + char reason; 392 + char msg_format; 393 + char msg_no; 394 + 395 + sense = dasd_get_sense(&cqr->irb); 396 + if (!sense) 397 + return 0; 398 + 399 + reason = sense[0]; 400 + msg_format = (sense[7] & 0xF0); 401 + msg_no = (sense[7] & 0x0F); 402 + 403 + /* command reject, Format 0 MSG 4 - invalid parameter */ 404 + if ((reason == 0x80) && (msg_format == 0x00) && (msg_no == 0x04)) 405 + return 1; 406 + 407 + return 0; 408 + } 409 + 387 410 static int read_unit_address_configuration(struct dasd_device *device, 388 411 struct alias_lcu *lcu) 389 412 { ··· 458 435 459 436 do { 460 437 rc = dasd_sleep_on(cqr); 438 + if (rc && suborder_not_supported(cqr)) 439 + return -EOPNOTSUPP; 461 440 } while (rc && (cqr->retries > 0)); 462 441 if (rc) { 463 442 spin_lock_irqsave(&lcu->lock, flags); ··· 546 521 * processing the data 547 522 */ 548 523 spin_lock_irqsave(&lcu->lock, flags); 549 - if (rc || (lcu->flags & NEED_UAC_UPDATE)) { 524 + if ((rc && (rc != -EOPNOTSUPP)) || (lcu->flags & NEED_UAC_UPDATE)) { 550 525 DBF_DEV_EVENT(DBF_WARNING, device, "could not update" 551 526 " alias data in lcu (rc = %d), retry later", rc); 552 527 schedule_delayed_work(&lcu->ruac_data.dwork, 30*HZ);
+25 -7
drivers/s390/block/dasd_eckd.c
··· 1507 1507 * call might change behaviour of DASD devices. 1508 1508 */ 1509 1509 static int 1510 - dasd_eckd_psf_ssc(struct dasd_device *device, int enable_pav) 1510 + dasd_eckd_psf_ssc(struct dasd_device *device, int enable_pav, 1511 + unsigned long flags) 1511 1512 { 1512 1513 struct dasd_ccw_req *cqr; 1513 1514 int rc; ··· 1517 1516 if (IS_ERR(cqr)) 1518 1517 return PTR_ERR(cqr); 1519 1518 1519 + /* 1520 + * set flags e.g. turn on failfast, to prevent blocking 1521 + * the calling function should handle failed requests 1522 + */ 1523 + cqr->flags |= flags; 1524 + 1520 1525 rc = dasd_sleep_on(cqr); 1521 1526 if (!rc) 1522 1527 /* trigger CIO to reprobe devices */ 1523 1528 css_schedule_reprobe(); 1529 + else if (cqr->intrc == -EAGAIN) 1530 + rc = -EAGAIN; 1531 + 1524 1532 dasd_sfree_request(cqr, cqr->memdev); 1525 1533 return rc; 1526 1534 } ··· 1537 1527 /* 1538 1528 * Valide storage server of current device. 1539 1529 */ 1540 - static void dasd_eckd_validate_server(struct dasd_device *device) 1530 + static int dasd_eckd_validate_server(struct dasd_device *device, 1531 + unsigned long flags) 1541 1532 { 1542 1533 int rc; 1543 1534 struct dasd_eckd_private *private; ··· 1547 1536 private = (struct dasd_eckd_private *) device->private; 1548 1537 if (private->uid.type == UA_BASE_PAV_ALIAS || 1549 1538 private->uid.type == UA_HYPER_PAV_ALIAS) 1550 - return; 1539 + return 0; 1551 1540 if (dasd_nopav || MACHINE_IS_VM) 1552 1541 enable_pav = 0; 1553 1542 else 1554 1543 enable_pav = 1; 1555 - rc = dasd_eckd_psf_ssc(device, enable_pav); 1544 + rc = dasd_eckd_psf_ssc(device, enable_pav, flags); 1556 1545 1557 1546 /* may be requested feature is not available on server, 1558 1547 * therefore just report error and go ahead */ 1559 1548 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "PSF-SSC for SSID %04x " 1560 1549 "returned rc=%d", private->uid.ssid, rc); 1550 + return rc; 1561 1551 } 1562 1552 1563 1553 /* ··· 1568 1556 { 1569 1557 struct dasd_device *device = container_of(work, struct dasd_device, 1570 1558 kick_validate); 1571 - dasd_eckd_validate_server(device); 1559 + if (dasd_eckd_validate_server(device, DASD_CQR_FLAGS_FAILFAST) 1560 + == -EAGAIN) { 1561 + /* schedule worker again if failed */ 1562 + schedule_work(&device->kick_validate); 1563 + return; 1564 + } 1565 + 1572 1566 dasd_put_device(device); 1573 1567 } 1574 1568 ··· 1703 1685 if (rc) 1704 1686 goto out_err2; 1705 1687 1706 - dasd_eckd_validate_server(device); 1688 + dasd_eckd_validate_server(device, 0); 1707 1689 1708 1690 /* device may report different configuration data after LCU setup */ 1709 1691 rc = dasd_eckd_read_conf(device); ··· 4171 4153 rc = dasd_alias_make_device_known_to_lcu(device); 4172 4154 if (rc) 4173 4155 return rc; 4174 - dasd_eckd_validate_server(device); 4156 + dasd_eckd_validate_server(device, DASD_CQR_FLAGS_FAILFAST); 4175 4157 4176 4158 /* RE-Read Configuration Data */ 4177 4159 rc = dasd_eckd_read_conf(device);
+6 -1
drivers/s390/cio/device.c
··· 1426 1426 return IO_SCH_REPROBE; 1427 1427 if (cdev->online) 1428 1428 return IO_SCH_VERIFY; 1429 + if (cdev->private->state == DEV_STATE_NOT_OPER) 1430 + return IO_SCH_UNREG_ATTACH; 1429 1431 return IO_SCH_NOP; 1430 1432 } 1431 1433 ··· 1521 1519 goto out; 1522 1520 break; 1523 1521 case IO_SCH_UNREG_ATTACH: 1522 + spin_lock_irqsave(sch->lock, flags); 1524 1523 if (cdev->private->flags.resuming) { 1525 1524 /* Device will be handled later. */ 1526 1525 rc = 0; 1527 - goto out; 1526 + goto out_unlock; 1528 1527 } 1528 + sch_set_cdev(sch, NULL); 1529 + spin_unlock_irqrestore(sch->lock, flags); 1529 1530 /* Unregister ccw device. */ 1530 1531 ccw_device_unregister(cdev); 1531 1532 break;
+3
drivers/scsi/bnx2i/bnx2i_hwi.c
··· 1264 1264 int rc = 0; 1265 1265 u64 mask64; 1266 1266 1267 + memset(&iscsi_init, 0x00, sizeof(struct iscsi_kwqe_init1)); 1268 + memset(&iscsi_init2, 0x00, sizeof(struct iscsi_kwqe_init2)); 1269 + 1267 1270 bnx2i_adjust_qp_size(hba); 1268 1271 1269 1272 iscsi_init.flags =
+2 -1
drivers/scsi/hpsa.c
··· 1315 1315 } 1316 1316 break; 1317 1317 case CMD_PROTOCOL_ERR: 1318 + cmd->result = DID_ERROR << 16; 1318 1319 dev_warn(&h->pdev->dev, "cp %p has " 1319 - "protocol error \n", cp); 1320 + "protocol error\n", cp); 1320 1321 break; 1321 1322 case CMD_HARDWARE_ERR: 1322 1323 cmd->result = DID_ERROR << 16;
+7
drivers/scsi/mpt2sas/mpt2sas_base.c
··· 1209 1209 u16 message_control; 1210 1210 1211 1211 1212 + /* Check whether controller SAS2008 B0 controller, 1213 + if it is SAS2008 B0 controller use IO-APIC instead of MSIX */ 1214 + if (ioc->pdev->device == MPI2_MFGPAGE_DEVID_SAS2008 && 1215 + ioc->pdev->revision == 0x01) { 1216 + return -EINVAL; 1217 + } 1218 + 1212 1219 base = pci_find_capability(ioc->pdev, PCI_CAP_ID_MSIX); 1213 1220 if (!base) { 1214 1221 dfailprintk(ioc, printk(MPT2SAS_INFO_FMT "msix not "
+1 -1
drivers/scsi/virtio_scsi.c
··· 331 331 int i; 332 332 333 333 for_each_sg(table->sgl, sg_elem, table->nents, i) 334 - sg_set_buf(&sg[idx++], sg_virt(sg_elem), sg_elem->length); 334 + sg[idx++] = *sg_elem; 335 335 336 336 *p_idx = idx; 337 337 }
+1 -1
drivers/sh/intc/core.c
··· 355 355 if (unlikely(res)) { 356 356 if (res == -EEXIST) { 357 357 res = irq_domain_associate(d->domain, 358 - irq, irq); 358 + irq2, irq2); 359 359 if (unlikely(res)) { 360 360 pr_err("domain association " 361 361 "failure\n");
+4 -1
drivers/sh/pfc/pinctrl.c
··· 208 208 209 209 break; 210 210 case PINMUX_TYPE_GPIO: 211 + case PINMUX_TYPE_INPUT: 212 + case PINMUX_TYPE_OUTPUT: 211 213 break; 212 214 default: 213 215 pr_err("Unsupported mux type (%d), bailing...\n", pinmux_type); 214 - return -ENOTSUPP; 216 + ret = -ENOTSUPP; 217 + goto err; 215 218 } 216 219 217 220 ret = 0;
+1 -1
drivers/staging/nvec/nvec.c
··· 837 837 } 838 838 839 839 ret = mfd_add_devices(nvec->dev, -1, nvec_devices, 840 - ARRAY_SIZE(nvec_devices), base, 0); 840 + ARRAY_SIZE(nvec_devices), base, 0, NULL); 841 841 if (ret) 842 842 dev_err(nvec->dev, "error adding subdevices\n"); 843 843
+10 -1
drivers/target/iscsi/iscsi_target_login.c
··· 221 221 { 222 222 struct iscsi_session *sess = NULL; 223 223 struct iscsi_login_req *pdu = (struct iscsi_login_req *)buf; 224 + int ret; 224 225 225 226 sess = kzalloc(sizeof(struct iscsi_session), GFP_KERNEL); 226 227 if (!sess) { ··· 258 257 return -ENOMEM; 259 258 } 260 259 spin_lock(&sess_idr_lock); 261 - idr_get_new(&sess_idr, NULL, &sess->session_index); 260 + ret = idr_get_new(&sess_idr, NULL, &sess->session_index); 262 261 spin_unlock(&sess_idr_lock); 262 + 263 + if (ret < 0) { 264 + pr_err("idr_get_new() for sess_idr failed\n"); 265 + iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, 266 + ISCSI_LOGIN_STATUS_NO_RESOURCES); 267 + kfree(sess); 268 + return -ENOMEM; 269 + } 263 270 264 271 sess->creation_time = get_jiffies_64(); 265 272 spin_lock_init(&sess->session_stats_lock);
+7
drivers/target/target_core_alua.c
··· 218 218 cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 219 219 return -EINVAL; 220 220 } 221 + if (cmd->data_length < 4) { 222 + pr_warn("SET TARGET PORT GROUPS parameter list length %u too" 223 + " small\n", cmd->data_length); 224 + cmd->scsi_sense_reason = TCM_INVALID_PARAMETER_LIST; 225 + return -EINVAL; 226 + } 227 + 221 228 buf = transport_kmap_data_sg(cmd); 222 229 223 230 /*
+7
drivers/target/target_core_device.c
··· 669 669 unsigned char *buf; 670 670 u32 lun_count = 0, offset = 8, i; 671 671 672 + if (se_cmd->data_length < 16) { 673 + pr_warn("REPORT LUNS allocation length %u too small\n", 674 + se_cmd->data_length); 675 + se_cmd->scsi_sense_reason = TCM_INVALID_CDB_FIELD; 676 + return -EINVAL; 677 + } 678 + 672 679 buf = transport_kmap_data_sg(se_cmd); 673 680 if (!buf) 674 681 return -ENOMEM;
+15 -2
drivers/target/target_core_iblock.c
··· 325 325 struct iblock_dev *ibd = dev->dev_ptr; 326 326 unsigned char *buf, *ptr = NULL; 327 327 sector_t lba; 328 - int size = cmd->data_length; 328 + int size; 329 329 u32 range; 330 330 int ret = 0; 331 331 int dl, bd_dl; 332 + 333 + if (cmd->data_length < 8) { 334 + pr_warn("UNMAP parameter list length %u too small\n", 335 + cmd->data_length); 336 + cmd->scsi_sense_reason = TCM_INVALID_PARAMETER_LIST; 337 + return -EINVAL; 338 + } 332 339 333 340 buf = transport_kmap_data_sg(cmd); 334 341 335 342 dl = get_unaligned_be16(&buf[0]); 336 343 bd_dl = get_unaligned_be16(&buf[2]); 337 344 338 - size = min(size - 8, bd_dl); 345 + size = cmd->data_length - 8; 346 + if (bd_dl > size) 347 + pr_warn("UNMAP parameter list length %u too small, ignoring bd_dl %u\n", 348 + cmd->data_length, bd_dl); 349 + else 350 + size = bd_dl; 351 + 339 352 if (size / 16 > dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count) { 340 353 cmd->scsi_sense_reason = TCM_INVALID_PARAMETER_LIST; 341 354 ret = -EINVAL;
+8
drivers/target/target_core_pr.c
··· 1540 1540 tidh_new->dest_local_nexus = 1; 1541 1541 list_add_tail(&tidh_new->dest_list, &tid_dest_list); 1542 1542 1543 + if (cmd->data_length < 28) { 1544 + pr_warn("SPC-PR: Received PR OUT parameter list" 1545 + " length too small: %u\n", cmd->data_length); 1546 + cmd->scsi_sense_reason = TCM_INVALID_PARAMETER_LIST; 1547 + ret = -EINVAL; 1548 + goto out; 1549 + } 1550 + 1543 1551 buf = transport_kmap_data_sg(cmd); 1544 1552 /* 1545 1553 * For a PERSISTENT RESERVE OUT specify initiator ports payload,
+11 -18
drivers/target/target_core_pscsi.c
··· 667 667 kfree(pdv); 668 668 } 669 669 670 - static int pscsi_transport_complete(struct se_cmd *cmd, struct scatterlist *sg) 670 + static void pscsi_transport_complete(struct se_cmd *cmd, struct scatterlist *sg, 671 + unsigned char *sense_buffer) 671 672 { 672 673 struct pscsi_dev_virt *pdv = cmd->se_dev->dev_ptr; 673 674 struct scsi_device *sd = pdv->pdv_sd; ··· 680 679 * not been allocated because TCM is handling the emulation directly. 681 680 */ 682 681 if (!pt) 683 - return 0; 682 + return; 684 683 685 684 cdb = &pt->pscsi_cdb[0]; 686 685 result = pt->pscsi_result; ··· 688 687 * Hack to make sure that Write-Protect modepage is set if R/O mode is 689 688 * forced. 690 689 */ 690 + if (!cmd->se_deve || !cmd->data_length) 691 + goto after_mode_sense; 692 + 691 693 if (((cdb[0] == MODE_SENSE) || (cdb[0] == MODE_SENSE_10)) && 692 694 (status_byte(result) << 1) == SAM_STAT_GOOD) { 693 - if (!cmd->se_deve) 694 - goto after_mode_sense; 695 - 696 695 if (cmd->se_deve->lun_flags & TRANSPORT_LUNFLAGS_READ_ONLY) { 697 696 unsigned char *buf = transport_kmap_data_sg(cmd); 698 697 ··· 709 708 } 710 709 after_mode_sense: 711 710 712 - if (sd->type != TYPE_TAPE) 711 + if (sd->type != TYPE_TAPE || !cmd->data_length) 713 712 goto after_mode_select; 714 713 715 714 /* ··· 751 750 } 752 751 after_mode_select: 753 752 754 - if (status_byte(result) & CHECK_CONDITION) 755 - return 1; 756 - 757 - return 0; 753 + if (sense_buffer && (status_byte(result) & CHECK_CONDITION)) { 754 + memcpy(sense_buffer, pt->pscsi_sense, TRANSPORT_SENSE_BUFFER); 755 + cmd->se_cmd_flags |= SCF_TRANSPORT_TASK_SENSE; 756 + } 758 757 } 759 758 760 759 enum { ··· 1185 1184 return -ENOMEM; 1186 1185 } 1187 1186 1188 - static unsigned char *pscsi_get_sense_buffer(struct se_cmd *cmd) 1189 - { 1190 - struct pscsi_plugin_task *pt = cmd->priv; 1191 - 1192 - return pt->pscsi_sense; 1193 - } 1194 - 1195 1187 /* pscsi_get_device_rev(): 1196 1188 * 1197 1189 * ··· 1267 1273 .check_configfs_dev_params = pscsi_check_configfs_dev_params, 1268 1274 .set_configfs_dev_params = pscsi_set_configfs_dev_params, 1269 1275 .show_configfs_dev_params = pscsi_show_configfs_dev_params, 1270 - .get_sense_buffer = pscsi_get_sense_buffer, 1271 1276 .get_device_rev = pscsi_get_device_rev, 1272 1277 .get_device_type = pscsi_get_device_type, 1273 1278 .get_blocks = pscsi_get_blocks,
+18 -17
drivers/target/target_core_spc.c
··· 877 877 static int spc_emulate_request_sense(struct se_cmd *cmd) 878 878 { 879 879 unsigned char *cdb = cmd->t_task_cdb; 880 - unsigned char *buf; 880 + unsigned char *rbuf; 881 881 u8 ua_asc = 0, ua_ascq = 0; 882 - int err = 0; 882 + unsigned char buf[SE_SENSE_BUF]; 883 + 884 + memset(buf, 0, SE_SENSE_BUF); 883 885 884 886 if (cdb[1] & 0x01) { 885 887 pr_err("REQUEST_SENSE description emulation not" ··· 890 888 return -ENOSYS; 891 889 } 892 890 893 - buf = transport_kmap_data_sg(cmd); 894 - 895 - if (!core_scsi3_ua_clear_for_request_sense(cmd, &ua_asc, &ua_ascq)) { 891 + rbuf = transport_kmap_data_sg(cmd); 892 + if (cmd->scsi_sense_reason != 0) { 893 + /* 894 + * Out of memory. We will fail with CHECK CONDITION, so 895 + * we must not clear the unit attention condition. 896 + */ 897 + target_complete_cmd(cmd, CHECK_CONDITION); 898 + return 0; 899 + } else if (!core_scsi3_ua_clear_for_request_sense(cmd, &ua_asc, &ua_ascq)) { 896 900 /* 897 901 * CURRENT ERROR, UNIT ATTENTION 898 902 */ 899 903 buf[0] = 0x70; 900 904 buf[SPC_SENSE_KEY_OFFSET] = UNIT_ATTENTION; 901 905 902 - if (cmd->data_length < 18) { 903 - buf[7] = 0x00; 904 - err = -EINVAL; 905 - goto end; 906 - } 907 906 /* 908 907 * The Additional Sense Code (ASC) from the UNIT ATTENTION 909 908 */ ··· 918 915 buf[0] = 0x70; 919 916 buf[SPC_SENSE_KEY_OFFSET] = NO_SENSE; 920 917 921 - if (cmd->data_length < 18) { 922 - buf[7] = 0x00; 923 - err = -EINVAL; 924 - goto end; 925 - } 926 918 /* 927 919 * NO ADDITIONAL SENSE INFORMATION 928 920 */ ··· 925 927 buf[7] = 0x0A; 926 928 } 927 929 928 - end: 929 - transport_kunmap_data_sg(cmd); 930 + if (rbuf) { 931 + memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); 932 + transport_kunmap_data_sg(cmd); 933 + } 934 + 930 935 target_complete_cmd(cmd, GOOD); 931 936 return 0; 932 937 }
+61 -87
drivers/target/target_core_transport.c
··· 567 567 transport_generic_request_failure(cmd); 568 568 } 569 569 570 + /* 571 + * Used when asking transport to copy Sense Data from the underlying 572 + * Linux/SCSI struct scsi_cmnd 573 + */ 574 + static unsigned char *transport_get_sense_buffer(struct se_cmd *cmd) 575 + { 576 + unsigned char *buffer = cmd->sense_buffer; 577 + struct se_device *dev = cmd->se_dev; 578 + u32 offset = 0; 579 + 580 + WARN_ON(!cmd->se_lun); 581 + 582 + if (!dev) 583 + return NULL; 584 + 585 + if (cmd->se_cmd_flags & SCF_SENT_CHECK_CONDITION) 586 + return NULL; 587 + 588 + offset = cmd->se_tfo->set_fabric_sense_len(cmd, TRANSPORT_SENSE_BUFFER); 589 + 590 + /* Automatically padded */ 591 + cmd->scsi_sense_length = TRANSPORT_SENSE_BUFFER + offset; 592 + 593 + pr_debug("HBA_[%u]_PLUG[%s]: Requesting sense for SAM STATUS: 0x%02x\n", 594 + dev->se_hba->hba_id, dev->transport->name, cmd->scsi_status); 595 + return &buffer[offset]; 596 + } 597 + 570 598 void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status) 571 599 { 572 600 struct se_device *dev = cmd->se_dev; ··· 608 580 cmd->transport_state &= ~CMD_T_BUSY; 609 581 610 582 if (dev && dev->transport->transport_complete) { 611 - if (dev->transport->transport_complete(cmd, 612 - cmd->t_data_sg) != 0) { 613 - cmd->se_cmd_flags |= SCF_TRANSPORT_TASK_SENSE; 583 + dev->transport->transport_complete(cmd, 584 + cmd->t_data_sg, 585 + transport_get_sense_buffer(cmd)); 586 + if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) 614 587 success = 1; 615 - } 616 588 } 617 589 618 590 /* ··· 1209 1181 /* Returns CHECK_CONDITION + INVALID_CDB_FIELD */ 1210 1182 goto out_invalid_cdb_field; 1211 1183 } 1212 - 1184 + /* 1185 + * For the overflow case keep the existing fabric provided 1186 + * ->data_length. Otherwise for the underflow case, reset 1187 + * ->data_length to the smaller SCSI expected data transfer 1188 + * length. 1189 + */ 1213 1190 if (size > cmd->data_length) { 1214 1191 cmd->se_cmd_flags |= SCF_OVERFLOW_BIT; 1215 1192 cmd->residual_count = (size - cmd->data_length); 1216 1193 } else { 1217 1194 cmd->se_cmd_flags |= SCF_UNDERFLOW_BIT; 1218 1195 cmd->residual_count = (cmd->data_length - size); 1196 + cmd->data_length = size; 1219 1197 } 1220 - cmd->data_length = size; 1221 1198 } 1222 1199 1223 1200 return 0; ··· 1849 1816 EXPORT_SYMBOL(target_execute_cmd); 1850 1817 1851 1818 /* 1852 - * Used to obtain Sense Data from underlying Linux/SCSI struct scsi_cmnd 1853 - */ 1854 - static int transport_get_sense_data(struct se_cmd *cmd) 1855 - { 1856 - unsigned char *buffer = cmd->sense_buffer, *sense_buffer = NULL; 1857 - struct se_device *dev = cmd->se_dev; 1858 - unsigned long flags; 1859 - u32 offset = 0; 1860 - 1861 - WARN_ON(!cmd->se_lun); 1862 - 1863 - if (!dev) 1864 - return 0; 1865 - 1866 - spin_lock_irqsave(&cmd->t_state_lock, flags); 1867 - if (cmd->se_cmd_flags & SCF_SENT_CHECK_CONDITION) { 1868 - spin_unlock_irqrestore(&cmd->t_state_lock, flags); 1869 - return 0; 1870 - } 1871 - 1872 - if (!(cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE)) 1873 - goto out; 1874 - 1875 - if (!dev->transport->get_sense_buffer) { 1876 - pr_err("dev->transport->get_sense_buffer is NULL\n"); 1877 - goto out; 1878 - } 1879 - 1880 - sense_buffer = dev->transport->get_sense_buffer(cmd); 1881 - if (!sense_buffer) { 1882 - pr_err("ITT 0x%08x cmd %p: Unable to locate" 1883 - " sense buffer for task with sense\n", 1884 - cmd->se_tfo->get_task_tag(cmd), cmd); 1885 - goto out; 1886 - } 1887 - 1888 - spin_unlock_irqrestore(&cmd->t_state_lock, flags); 1889 - 1890 - offset = cmd->se_tfo->set_fabric_sense_len(cmd, TRANSPORT_SENSE_BUFFER); 1891 - 1892 - memcpy(&buffer[offset], sense_buffer, TRANSPORT_SENSE_BUFFER); 1893 - 1894 - /* Automatically padded */ 1895 - cmd->scsi_sense_length = TRANSPORT_SENSE_BUFFER + offset; 1896 - 1897 - pr_debug("HBA_[%u]_PLUG[%s]: Set SAM STATUS: 0x%02x and sense\n", 1898 - dev->se_hba->hba_id, dev->transport->name, cmd->scsi_status); 1899 - return 0; 1900 - 1901 - out: 1902 - spin_unlock_irqrestore(&cmd->t_state_lock, flags); 1903 - return -1; 1904 - } 1905 - 1906 - /* 1907 1819 * Process all commands up to the last received ORDERED task attribute which 1908 1820 * requires another blocking boundary 1909 1821 */ ··· 1963 1985 static void target_complete_ok_work(struct work_struct *work) 1964 1986 { 1965 1987 struct se_cmd *cmd = container_of(work, struct se_cmd, work); 1966 - int reason = 0, ret; 1988 + int ret; 1967 1989 1968 1990 /* 1969 1991 * Check if we need to move delayed/dormant tasks from cmds on the ··· 1980 2002 schedule_work(&cmd->se_dev->qf_work_queue); 1981 2003 1982 2004 /* 1983 - * Check if we need to retrieve a sense buffer from 2005 + * Check if we need to send a sense buffer from 1984 2006 * the struct se_cmd in question. 1985 2007 */ 1986 2008 if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) { 1987 - if (transport_get_sense_data(cmd) < 0) 1988 - reason = TCM_NON_EXISTENT_LUN; 2009 + WARN_ON(!cmd->scsi_status); 2010 + ret = transport_send_check_condition_and_sense( 2011 + cmd, 0, 1); 2012 + if (ret == -EAGAIN || ret == -ENOMEM) 2013 + goto queue_full; 1989 2014 1990 - if (cmd->scsi_status) { 1991 - ret = transport_send_check_condition_and_sense( 1992 - cmd, reason, 1); 1993 - if (ret == -EAGAIN || ret == -ENOMEM) 1994 - goto queue_full; 1995 - 1996 - transport_lun_remove_cmd(cmd); 1997 - transport_cmd_check_stop_to_fabric(cmd); 1998 - return; 1999 - } 2015 + transport_lun_remove_cmd(cmd); 2016 + transport_cmd_check_stop_to_fabric(cmd); 2017 + return; 2000 2018 } 2001 2019 /* 2002 2020 * Check for a callback, used by amongst other things ··· 2190 2216 struct page **pages; 2191 2217 int i; 2192 2218 2193 - BUG_ON(!sg); 2194 2219 /* 2195 2220 * We need to take into account a possible offset here for fabrics like 2196 2221 * tcm_loop who may be using a contig buffer from the SCSI midlayer for ··· 2197 2224 */ 2198 2225 if (!cmd->t_data_nents) 2199 2226 return NULL; 2200 - else if (cmd->t_data_nents == 1) 2227 + 2228 + BUG_ON(!sg); 2229 + if (cmd->t_data_nents == 1) 2201 2230 return kmap(sg_page(sg)) + sg->offset; 2202 2231 2203 2232 /* >1 page. use vmap */ 2204 2233 pages = kmalloc(sizeof(*pages) * cmd->t_data_nents, GFP_KERNEL); 2205 - if (!pages) 2234 + if (!pages) { 2235 + cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 2206 2236 return NULL; 2237 + } 2207 2238 2208 2239 /* convert sg[] to pages[] */ 2209 2240 for_each_sg(cmd->t_data_sg, sg, cmd->t_data_nents, i) { ··· 2216 2239 2217 2240 cmd->t_data_vmap = vmap(pages, cmd->t_data_nents, VM_MAP, PAGE_KERNEL); 2218 2241 kfree(pages); 2219 - if (!cmd->t_data_vmap) 2242 + if (!cmd->t_data_vmap) { 2243 + cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 2220 2244 return NULL; 2245 + } 2221 2246 2222 2247 return cmd->t_data_vmap + cmd->t_data_sg[0].offset; 2223 2248 } ··· 2305 2326 * into the fabric for data transfers, go ahead and complete it right 2306 2327 * away. 2307 2328 */ 2308 - if (!cmd->data_length) { 2329 + if (!cmd->data_length && 2330 + cmd->t_task_cdb[0] != REQUEST_SENSE && 2331 + cmd->se_dev->transport->transport_type != TRANSPORT_PLUGIN_PHBA_PDEV) { 2309 2332 spin_lock_irq(&cmd->t_state_lock); 2310 2333 cmd->t_state = TRANSPORT_COMPLETE; 2311 2334 cmd->transport_state |= CMD_T_ACTIVE; 2312 2335 spin_unlock_irq(&cmd->t_state_lock); 2313 - 2314 - if (cmd->t_task_cdb[0] == REQUEST_SENSE) { 2315 - u8 ua_asc = 0, ua_ascq = 0; 2316 - 2317 - core_scsi3_ua_clear_for_request_sense(cmd, 2318 - &ua_asc, &ua_ascq); 2319 - } 2320 2336 2321 2337 INIT_WORK(&cmd->work, target_complete_ok_work); 2322 2338 queue_work(target_completion_wq, &cmd->work);
+1 -1
drivers/usb/core/devices.c
··· 624 624 /* print devices for all busses */ 625 625 list_for_each_entry(bus, &usb_bus_list, bus_list) { 626 626 /* recurse through all children of the root hub */ 627 - if (!bus->root_hub) 627 + if (!bus_to_hcd(bus)->rh_registered) 628 628 continue; 629 629 usb_lock_device(bus->root_hub); 630 630 ret = usb_device_dump(&buf, &nbytes, &skip_bytes, ppos,
+2 -4
drivers/usb/core/hcd.c
··· 1011 1011 if (retval) { 1012 1012 dev_err (parent_dev, "can't register root hub for %s, %d\n", 1013 1013 dev_name(&usb_dev->dev), retval); 1014 - } 1015 - mutex_unlock(&usb_bus_list_lock); 1016 - 1017 - if (retval == 0) { 1014 + } else { 1018 1015 spin_lock_irq (&hcd_root_hub_lock); 1019 1016 hcd->rh_registered = 1; 1020 1017 spin_unlock_irq (&hcd_root_hub_lock); ··· 1020 1023 if (HCD_DEAD(hcd)) 1021 1024 usb_hc_died (hcd); /* This time clean up */ 1022 1025 } 1026 + mutex_unlock(&usb_bus_list_lock); 1023 1027 1024 1028 return retval; 1025 1029 }
+2 -1
drivers/usb/host/ohci-at91.c
··· 467 467 /* From the GPIO notifying the over-current situation, find 468 468 * out the corresponding port */ 469 469 at91_for_each_port(port) { 470 - if (gpio_to_irq(pdata->overcurrent_pin[port]) == irq) { 470 + if (gpio_is_valid(pdata->overcurrent_pin[port]) && 471 + gpio_to_irq(pdata->overcurrent_pin[port]) == irq) { 471 472 gpio = pdata->overcurrent_pin[port]; 472 473 break; 473 474 }
+56 -20
drivers/vfio/pci/vfio_pci_intrs.c
··· 76 76 schedule_work(&virqfd->inject); 77 77 } 78 78 79 - if (flags & POLLHUP) 80 - /* The eventfd is closing, detach from VFIO */ 81 - virqfd_deactivate(virqfd); 79 + if (flags & POLLHUP) { 80 + unsigned long flags; 81 + spin_lock_irqsave(&virqfd->vdev->irqlock, flags); 82 + 83 + /* 84 + * The eventfd is closing, if the virqfd has not yet been 85 + * queued for release, as determined by testing whether the 86 + * vdev pointer to it is still valid, queue it now. As 87 + * with kvm irqfds, we know we won't race against the virqfd 88 + * going away because we hold wqh->lock to get here. 89 + */ 90 + if (*(virqfd->pvirqfd) == virqfd) { 91 + *(virqfd->pvirqfd) = NULL; 92 + virqfd_deactivate(virqfd); 93 + } 94 + 95 + spin_unlock_irqrestore(&virqfd->vdev->irqlock, flags); 96 + } 82 97 83 98 return 0; 84 99 } ··· 108 93 static void virqfd_shutdown(struct work_struct *work) 109 94 { 110 95 struct virqfd *virqfd = container_of(work, struct virqfd, shutdown); 111 - struct virqfd **pvirqfd = virqfd->pvirqfd; 112 96 u64 cnt; 113 97 114 98 eventfd_ctx_remove_wait_queue(virqfd->eventfd, &virqfd->wait, &cnt); ··· 115 101 eventfd_ctx_put(virqfd->eventfd); 116 102 117 103 kfree(virqfd); 118 - *pvirqfd = NULL; 119 104 } 120 105 121 106 static void virqfd_inject(struct work_struct *work) ··· 135 122 int ret = 0; 136 123 unsigned int events; 137 124 138 - if (*pvirqfd) 139 - return -EBUSY; 140 - 141 125 virqfd = kzalloc(sizeof(*virqfd), GFP_KERNEL); 142 126 if (!virqfd) 143 127 return -ENOMEM; 144 128 145 129 virqfd->pvirqfd = pvirqfd; 146 - *pvirqfd = virqfd; 147 130 virqfd->vdev = vdev; 148 131 virqfd->handler = handler; 149 132 virqfd->thread = thread; ··· 161 152 } 162 153 163 154 virqfd->eventfd = ctx; 155 + 156 + /* 157 + * virqfds can be released by closing the eventfd or directly 158 + * through ioctl. These are both done through a workqueue, so 159 + * we update the pointer to the virqfd under lock to avoid 160 + * pushing multiple jobs to release the same virqfd. 161 + */ 162 + spin_lock_irq(&vdev->irqlock); 163 + 164 + if (*pvirqfd) { 165 + spin_unlock_irq(&vdev->irqlock); 166 + ret = -EBUSY; 167 + goto fail; 168 + } 169 + *pvirqfd = virqfd; 170 + 171 + spin_unlock_irq(&vdev->irqlock); 164 172 165 173 /* 166 174 * Install our own custom wake-up handling so we are notified via ··· 213 187 fput(file); 214 188 215 189 kfree(virqfd); 216 - *pvirqfd = NULL; 217 190 218 191 return ret; 219 192 } 220 193 221 - static void virqfd_disable(struct virqfd *virqfd) 194 + static void virqfd_disable(struct vfio_pci_device *vdev, 195 + struct virqfd **pvirqfd) 222 196 { 223 - if (!virqfd) 224 - return; 197 + unsigned long flags; 225 198 226 - virqfd_deactivate(virqfd); 199 + spin_lock_irqsave(&vdev->irqlock, flags); 227 200 228 - /* Block until we know all outstanding shutdown jobs have completed. */ 201 + if (*pvirqfd) { 202 + virqfd_deactivate(*pvirqfd); 203 + *pvirqfd = NULL; 204 + } 205 + 206 + spin_unlock_irqrestore(&vdev->irqlock, flags); 207 + 208 + /* 209 + * Block until we know all outstanding shutdown jobs have completed. 210 + * Even if we don't queue the job, flush the wq to be sure it's 211 + * been released. 212 + */ 229 213 flush_workqueue(vfio_irqfd_cleanup_wq); 230 214 } 231 215 ··· 428 392 static void vfio_intx_disable(struct vfio_pci_device *vdev) 429 393 { 430 394 vfio_intx_set_signal(vdev, -1); 431 - virqfd_disable(vdev->ctx[0].unmask); 432 - virqfd_disable(vdev->ctx[0].mask); 395 + virqfd_disable(vdev, &vdev->ctx[0].unmask); 396 + virqfd_disable(vdev, &vdev->ctx[0].mask); 433 397 vdev->irq_type = VFIO_PCI_NUM_IRQS; 434 398 vdev->num_ctx = 0; 435 399 kfree(vdev->ctx); ··· 575 539 vfio_msi_set_block(vdev, 0, vdev->num_ctx, NULL, msix); 576 540 577 541 for (i = 0; i < vdev->num_ctx; i++) { 578 - virqfd_disable(vdev->ctx[i].unmask); 579 - virqfd_disable(vdev->ctx[i].mask); 542 + virqfd_disable(vdev, &vdev->ctx[i].unmask); 543 + virqfd_disable(vdev, &vdev->ctx[i].mask); 580 544 } 581 545 582 546 if (msix) { ··· 613 577 vfio_send_intx_eventfd, NULL, 614 578 &vdev->ctx[0].unmask, fd); 615 579 616 - virqfd_disable(vdev->ctx[0].unmask); 580 + virqfd_disable(vdev, &vdev->ctx[0].unmask); 617 581 } 618 582 619 583 return 0;
+3
drivers/watchdog/hpwdt.c
··· 814 814 hpwdt_timer_reg = pci_mem_addr + 0x70; 815 815 hpwdt_timer_con = pci_mem_addr + 0x72; 816 816 817 + /* Make sure that timer is disabled until /dev/watchdog is opened */ 818 + hpwdt_stop(); 819 + 817 820 /* Make sure that we have a valid soft_margin */ 818 821 if (hpwdt_change_timer(soft_margin)) 819 822 hpwdt_change_timer(DEFAULT_MARGIN);
+2 -1
drivers/watchdog/watchdog_core.c
··· 128 128 void watchdog_unregister_device(struct watchdog_device *wdd) 129 129 { 130 130 int ret; 131 - int devno = wdd->cdev.dev; 131 + int devno; 132 132 133 133 if (wdd == NULL) 134 134 return; 135 135 136 + devno = wdd->cdev.dev; 136 137 ret = watchdog_dev_unregister(wdd); 137 138 if (ret) 138 139 pr_err("error unregistering /dev/watchdog (err=%d)\n", ret);
+3 -2
drivers/xen/gntdev.c
··· 314 314 } 315 315 } 316 316 317 - err = gnttab_unmap_refs(map->unmap_ops + offset, map->pages + offset, 318 - pages, true); 317 + err = gnttab_unmap_refs(map->unmap_ops + offset, 318 + use_ptemod ? map->kmap_ops + offset : NULL, map->pages + offset, 319 + pages); 319 320 if (err) 320 321 return err; 321 322
+4 -2
drivers/xen/grant-table.c
··· 870 870 EXPORT_SYMBOL_GPL(gnttab_map_refs); 871 871 872 872 int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, 873 - struct page **pages, unsigned int count, bool clear_pte) 873 + struct gnttab_map_grant_ref *kmap_ops, 874 + struct page **pages, unsigned int count) 874 875 { 875 876 int i, ret; 876 877 bool lazy = false; ··· 889 888 } 890 889 891 890 for (i = 0; i < count; i++) { 892 - ret = m2p_remove_override(pages[i], clear_pte); 891 + ret = m2p_remove_override(pages[i], kmap_ops ? 892 + &kmap_ops[i] : NULL); 893 893 if (ret) 894 894 return ret; 895 895 }
+2 -6
fs/btrfs/qgroup.c
··· 1371 1371 1372 1372 if (srcid) { 1373 1373 srcgroup = find_qgroup_rb(fs_info, srcid); 1374 - if (!srcgroup) { 1375 - ret = -EINVAL; 1374 + if (!srcgroup) 1376 1375 goto unlock; 1377 - } 1378 1376 dstgroup->rfer = srcgroup->rfer - level_size; 1379 1377 dstgroup->rfer_cmpr = srcgroup->rfer_cmpr - level_size; 1380 1378 srcgroup->excl = level_size; ··· 1381 1383 qgroup_dirty(fs_info, srcgroup); 1382 1384 } 1383 1385 1384 - if (!inherit) { 1385 - ret = -EINVAL; 1386 + if (!inherit) 1386 1387 goto unlock; 1387 - } 1388 1388 1389 1389 i_qgroups = (u64 *)(inherit + 1); 1390 1390 for (i = 0; i < inherit->num_qgroups; ++i) {
+1 -1
fs/cifs/cifs_unicode.c
··· 328 328 } 329 329 330 330 ctoUTF16_out: 331 - return i; 331 + return j; 332 332 } 333 333 334 334 #ifdef CONFIG_CIFS_SMB2
+3 -3
fs/dcache.c
··· 389 389 * Inform try_to_ascend() that we are no longer attached to the 390 390 * dentry tree 391 391 */ 392 - dentry->d_flags |= DCACHE_DISCONNECTED; 392 + dentry->d_flags |= DCACHE_DENTRY_KILLED; 393 393 if (parent) 394 394 spin_unlock(&parent->d_lock); 395 395 dentry_iput(dentry); ··· 1048 1048 * or deletion 1049 1049 */ 1050 1050 if (new != old->d_parent || 1051 - (old->d_flags & DCACHE_DISCONNECTED) || 1051 + (old->d_flags & DCACHE_DENTRY_KILLED) || 1052 1052 (!locked && read_seqretry(&rename_lock, seq))) { 1053 1053 spin_unlock(&new->d_lock); 1054 1054 new = NULL; ··· 1141 1141 EXPORT_SYMBOL(have_submounts); 1142 1142 1143 1143 /* 1144 - * Search the dentry child list for the specified parent, 1144 + * Search the dentry child list of the specified parent, 1145 1145 * and move any unused dentries to the end of the unused 1146 1146 * list for prune_dcache(). We descend to the next level 1147 1147 * whenever the d_subdirs list is non-empty and continue
+26 -48
fs/debugfs/file.c
··· 526 526 u32 elements; 527 527 }; 528 528 529 - static int u32_array_open(struct inode *inode, struct file *file) 530 - { 531 - file->private_data = NULL; 532 - return nonseekable_open(inode, file); 533 - } 534 - 535 - static size_t format_array(char *buf, size_t bufsize, const char *fmt, 536 - u32 *array, u32 array_size) 529 + static size_t u32_format_array(char *buf, size_t bufsize, 530 + u32 *array, int array_size) 537 531 { 538 532 size_t ret = 0; 539 - u32 i; 540 533 541 - for (i = 0; i < array_size; i++) { 534 + while (--array_size >= 0) { 542 535 size_t len; 536 + char term = array_size ? ' ' : '\n'; 543 537 544 - len = snprintf(buf, bufsize, fmt, array[i]); 545 - len++; /* ' ' or '\n' */ 538 + len = snprintf(buf, bufsize, "%u%c", *array++, term); 546 539 ret += len; 547 540 548 - if (buf) { 549 - buf += len; 550 - bufsize -= len; 551 - buf[-1] = (i == array_size-1) ? '\n' : ' '; 552 - } 541 + buf += len; 542 + bufsize -= len; 553 543 } 554 - 555 - ret++; /* \0 */ 556 - if (buf) 557 - *buf = '\0'; 558 - 559 544 return ret; 560 545 } 561 546 562 - static char *format_array_alloc(const char *fmt, u32 *array, 563 - u32 array_size) 547 + static int u32_array_open(struct inode *inode, struct file *file) 564 548 { 565 - size_t len = format_array(NULL, 0, fmt, array, array_size); 566 - char *ret; 549 + struct array_data *data = inode->i_private; 550 + int size, elements = data->elements; 551 + char *buf; 567 552 568 - ret = kmalloc(len, GFP_KERNEL); 569 - if (ret == NULL) 570 - return NULL; 553 + /* 554 + * Max size: 555 + * - 10 digits + ' '/'\n' = 11 bytes per number 556 + * - terminating NUL character 557 + */ 558 + size = elements*11; 559 + buf = kmalloc(size+1, GFP_KERNEL); 560 + if (!buf) 561 + return -ENOMEM; 562 + buf[size] = 0; 571 563 572 - format_array(ret, len, fmt, array, array_size); 573 - return ret; 564 + file->private_data = buf; 565 + u32_format_array(buf, size, data->array, data->elements); 566 + 567 + return nonseekable_open(inode, file); 574 568 } 575 569 576 570 static ssize_t u32_array_read(struct file *file, char __user *buf, size_t len, 577 571 loff_t *ppos) 578 572 { 579 - struct inode *inode = file->f_path.dentry->d_inode; 580 - struct array_data *data = inode->i_private; 581 - size_t size; 582 - 583 - if (*ppos == 0) { 584 - if (file->private_data) { 585 - kfree(file->private_data); 586 - file->private_data = NULL; 587 - } 588 - 589 - file->private_data = format_array_alloc("%u", data->array, 590 - data->elements); 591 - } 592 - 593 - size = 0; 594 - if (file->private_data) 595 - size = strlen(file->private_data); 573 + size_t size = strlen(file->private_data); 596 574 597 575 return simple_read_from_buffer(buf, len, ppos, 598 576 file->private_data, size);
+1 -2
fs/lockd/svclock.c
··· 289 289 dprintk("lockd: freeing block %p...\n", block); 290 290 291 291 /* Remove block from file's list of blocks */ 292 - mutex_lock(&file->f_mutex); 293 292 list_del_init(&block->b_flist); 294 293 mutex_unlock(&file->f_mutex); 295 294 ··· 302 303 static void nlmsvc_release_block(struct nlm_block *block) 303 304 { 304 305 if (block != NULL) 305 - kref_put(&block->b_count, nlmsvc_free_block); 306 + kref_put_mutex(&block->b_count, nlmsvc_free_block, &block->b_file->f_mutex); 306 307 } 307 308 308 309 /*
+8 -2
fs/namespace.c
··· 1886 1886 return err; 1887 1887 1888 1888 err = -EINVAL; 1889 - if (!(mnt_flags & MNT_SHRINKABLE) && !check_mnt(real_mount(path->mnt))) 1890 - goto unlock; 1889 + if (unlikely(!check_mnt(real_mount(path->mnt)))) { 1890 + /* that's acceptable only for automounts done in private ns */ 1891 + if (!(mnt_flags & MNT_SHRINKABLE)) 1892 + goto unlock; 1893 + /* ... and for those we'd better have mountpoint still alive */ 1894 + if (!real_mount(path->mnt)->mnt_ns) 1895 + goto unlock; 1896 + } 1891 1897 1892 1898 /* Refuse the same filesystem on the same mount point */ 1893 1899 err = -EBUSY;
+2 -3
fs/proc/proc_sysctl.c
··· 462 462 463 463 err = ERR_PTR(-ENOMEM); 464 464 inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p); 465 - if (h) 466 - sysctl_head_finish(h); 467 - 468 465 if (!inode) 469 466 goto out; 470 467 ··· 470 473 d_add(dentry, inode); 471 474 472 475 out: 476 + if (h) 477 + sysctl_head_finish(h); 473 478 sysctl_head_finish(head); 474 479 return err; 475 480 }
+4 -1
fs/xfs/xfs_buf.c
··· 96 96 atomic_inc(&bp->b_hold); 97 97 list_add_tail(&bp->b_lru, &btp->bt_lru); 98 98 btp->bt_lru_nr++; 99 + bp->b_lru_flags &= ~_XBF_LRU_DISPOSE; 99 100 } 100 101 spin_unlock(&btp->bt_lru_lock); 101 102 } ··· 155 154 struct xfs_buftarg *btp = bp->b_target; 156 155 157 156 spin_lock(&btp->bt_lru_lock); 158 - if (!list_empty(&bp->b_lru)) { 157 + if (!list_empty(&bp->b_lru) && 158 + !(bp->b_lru_flags & _XBF_LRU_DISPOSE)) { 159 159 list_del_init(&bp->b_lru); 160 160 btp->bt_lru_nr--; 161 161 atomic_dec(&bp->b_hold); ··· 1503 1501 */ 1504 1502 list_move(&bp->b_lru, &dispose); 1505 1503 btp->bt_lru_nr--; 1504 + bp->b_lru_flags |= _XBF_LRU_DISPOSE; 1506 1505 } 1507 1506 spin_unlock(&btp->bt_lru_lock); 1508 1507
+24 -17
fs/xfs/xfs_buf.h
··· 38 38 XBRW_ZERO = 3, /* Zero target memory */ 39 39 } xfs_buf_rw_t; 40 40 41 - #define XBF_READ (1 << 0) /* buffer intended for reading from device */ 42 - #define XBF_WRITE (1 << 1) /* buffer intended for writing to device */ 43 - #define XBF_READ_AHEAD (1 << 2) /* asynchronous read-ahead */ 44 - #define XBF_ASYNC (1 << 4) /* initiator will not wait for completion */ 45 - #define XBF_DONE (1 << 5) /* all pages in the buffer uptodate */ 46 - #define XBF_STALE (1 << 6) /* buffer has been staled, do not find it */ 41 + #define XBF_READ (1 << 0) /* buffer intended for reading from device */ 42 + #define XBF_WRITE (1 << 1) /* buffer intended for writing to device */ 43 + #define XBF_READ_AHEAD (1 << 2) /* asynchronous read-ahead */ 44 + #define XBF_ASYNC (1 << 4) /* initiator will not wait for completion */ 45 + #define XBF_DONE (1 << 5) /* all pages in the buffer uptodate */ 46 + #define XBF_STALE (1 << 6) /* buffer has been staled, do not find it */ 47 47 48 48 /* I/O hints for the BIO layer */ 49 - #define XBF_SYNCIO (1 << 10)/* treat this buffer as synchronous I/O */ 50 - #define XBF_FUA (1 << 11)/* force cache write through mode */ 51 - #define XBF_FLUSH (1 << 12)/* flush the disk cache before a write */ 49 + #define XBF_SYNCIO (1 << 10)/* treat this buffer as synchronous I/O */ 50 + #define XBF_FUA (1 << 11)/* force cache write through mode */ 51 + #define XBF_FLUSH (1 << 12)/* flush the disk cache before a write */ 52 52 53 53 /* flags used only as arguments to access routines */ 54 - #define XBF_TRYLOCK (1 << 16)/* lock requested, but do not wait */ 55 - #define XBF_UNMAPPED (1 << 17)/* do not map the buffer */ 54 + #define XBF_TRYLOCK (1 << 16)/* lock requested, but do not wait */ 55 + #define XBF_UNMAPPED (1 << 17)/* do not map the buffer */ 56 56 57 57 /* flags used only internally */ 58 - #define _XBF_PAGES (1 << 20)/* backed by refcounted pages */ 59 - #define _XBF_KMEM (1 << 21)/* backed by heap memory */ 60 - #define _XBF_DELWRI_Q (1 << 22)/* buffer on a delwri queue */ 61 - #define _XBF_COMPOUND (1 << 23)/* compound buffer */ 58 + #define _XBF_PAGES (1 << 20)/* backed by refcounted pages */ 59 + #define _XBF_KMEM (1 << 21)/* backed by heap memory */ 60 + #define _XBF_DELWRI_Q (1 << 22)/* buffer on a delwri queue */ 61 + #define _XBF_COMPOUND (1 << 23)/* compound buffer */ 62 + #define _XBF_LRU_DISPOSE (1 << 24)/* buffer being discarded */ 62 63 63 64 typedef unsigned int xfs_buf_flags_t; 64 65 ··· 73 72 { XBF_SYNCIO, "SYNCIO" }, \ 74 73 { XBF_FUA, "FUA" }, \ 75 74 { XBF_FLUSH, "FLUSH" }, \ 76 - { XBF_TRYLOCK, "TRYLOCK" }, /* should never be set */\ 75 + { XBF_TRYLOCK, "TRYLOCK" }, /* should never be set */\ 77 76 { XBF_UNMAPPED, "UNMAPPED" }, /* ditto */\ 78 77 { _XBF_PAGES, "PAGES" }, \ 79 78 { _XBF_KMEM, "KMEM" }, \ 80 79 { _XBF_DELWRI_Q, "DELWRI_Q" }, \ 81 - { _XBF_COMPOUND, "COMPOUND" } 80 + { _XBF_COMPOUND, "COMPOUND" }, \ 81 + { _XBF_LRU_DISPOSE, "LRU_DISPOSE" } 82 82 83 83 typedef struct xfs_buftarg { 84 84 dev_t bt_dev; ··· 126 124 xfs_buf_flags_t b_flags; /* status flags */ 127 125 struct semaphore b_sema; /* semaphore for lockables */ 128 126 127 + /* 128 + * concurrent access to b_lru and b_lru_flags are protected by 129 + * bt_lru_lock and not by b_sema 130 + */ 129 131 struct list_head b_lru; /* lru list */ 132 + xfs_buf_flags_t b_lru_flags; /* internal lru status flags */ 130 133 wait_queue_head_t b_waiters; /* unpin waiters */ 131 134 struct list_head b_list; 132 135 struct xfs_perag *b_pag; /* contains rbtree root */
+1
fs/xfs/xfs_super.c
··· 919 919 struct xfs_mount *mp = XFS_M(sb); 920 920 921 921 xfs_filestream_unmount(mp); 922 + cancel_delayed_work_sync(&mp->m_sync_work); 922 923 xfs_unmountfs(mp); 923 924 xfs_syncd_stop(mp); 924 925 xfs_freesb(mp);
+3 -1
include/asm-generic/unistd.h
··· 691 691 #define __NR_process_vm_writev 271 692 692 __SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \ 693 693 compat_sys_process_vm_writev) 694 + #define __NR_kcmp 272 695 + __SYSCALL(__NR_kcmp, sys_kcmp) 694 696 695 697 #undef __NR_syscalls 696 - #define __NR_syscalls 272 698 + #define __NR_syscalls 273 697 699 698 700 /* 699 701 * All syscalls below here should go away really,
+1
include/linux/atmel-ssc.h
··· 3 3 4 4 #include <linux/platform_device.h> 5 5 #include <linux/list.h> 6 + #include <linux/io.h> 6 7 7 8 struct ssc_device { 8 9 struct list_head list;
+7
include/linux/compiler-gcc4.h
··· 49 49 #endif 50 50 #endif 51 51 52 + #if __GNUC_MINOR__ >= 6 53 + /* 54 + * Tell the optimizer that something else uses this function or variable. 55 + */ 56 + #define __visible __attribute__((externally_visible)) 57 + #endif 58 + 52 59 #if __GNUC_MINOR__ > 0 53 60 #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) 54 61 #endif
+4
include/linux/compiler.h
··· 278 278 # define __section(S) __attribute__ ((__section__(#S))) 279 279 #endif 280 280 281 + #ifndef __visible 282 + #define __visible 283 + #endif 284 + 281 285 /* Are two types/vars the same type (ignoring qualifiers)? */ 282 286 #ifndef __same_type 283 287 # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
+2
include/linux/dcache.h
··· 206 206 #define DCACHE_MANAGED_DENTRY \ 207 207 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) 208 208 209 + #define DCACHE_DENTRY_KILLED 0x100000 210 + 209 211 extern seqlock_t rename_lock; 210 212 211 213 static inline int dname_external(struct dentry *dentry)
+1 -1
include/linux/kernel.h
··· 91 91 { \ 92 92 typeof(x) __x = x; \ 93 93 typeof(divisor) __d = divisor; \ 94 - (((typeof(x))-1) >= 0 || (__x) >= 0) ? \ 94 + (((typeof(x))-1) > 0 || (__x) > 0) ? \ 95 95 (((__x) + ((__d) / 2)) / (__d)) : \ 96 96 (((__x) - ((__d) / 2)) / (__d)); \ 97 97 } \
+1 -1
include/linux/memory.h
··· 19 19 #include <linux/compiler.h> 20 20 #include <linux/mutex.h> 21 21 22 - #define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS) 22 + #define MIN_MEMORY_BLOCK_SIZE (1UL << SECTION_SIZE_BITS) 23 23 24 24 struct memory_block { 25 25 unsigned long start_section_nr;
+3 -1
include/linux/mfd/core.h
··· 16 16 17 17 #include <linux/platform_device.h> 18 18 19 + struct irq_domain; 20 + 19 21 /* 20 22 * This struct describes the MFD part ("cell"). 21 23 * After registration the copy of this structure will become the platform data ··· 100 98 extern int mfd_add_devices(struct device *parent, int id, 101 99 struct mfd_cell *cells, int n_devs, 102 100 struct resource *mem_base, 103 - int irq_base); 101 + int irq_base, struct irq_domain *irq_domain); 104 102 105 103 extern void mfd_remove_devices(struct device *parent); 106 104
+9 -3
include/linux/mfd/tps65217.h
··· 22 22 #include <linux/regulator/driver.h> 23 23 #include <linux/regulator/machine.h> 24 24 25 + /* TPS chip id list */ 26 + #define TPS65217 0xF0 27 + 25 28 /* I2C ID for TPS65217 part */ 26 29 #define TPS65217_I2C_ID 0x24 27 30 ··· 251 248 struct tps65217 { 252 249 struct device *dev; 253 250 struct tps65217_board *pdata; 251 + unsigned int id; 254 252 struct regulator_desc desc[TPS65217_NUM_REGULATOR]; 255 253 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; 256 254 struct tps_info *info[TPS65217_NUM_REGULATOR]; 257 255 struct regmap *regmap; 258 - 259 - /* Client devices */ 260 - struct platform_device *regulator_pdev[TPS65217_NUM_REGULATOR]; 261 256 }; 262 257 263 258 static inline struct tps65217 *dev_to_tps65217(struct device *dev) 264 259 { 265 260 return dev_get_drvdata(dev); 261 + } 262 + 263 + static inline int tps65217_chip_id(struct tps65217 *tps65217) 264 + { 265 + return tps65217->id; 266 266 } 267 267 268 268 int tps65217_reg_read(struct tps65217 *tps, unsigned int reg,
+16 -3
include/linux/micrel_phy.h
··· 1 + /* 2 + * include/linux/micrel_phy.h 3 + * 4 + * Micrel PHY IDs 5 + * 6 + * This program is free software; you can redistribute it and/or modify it 7 + * under the terms of the GNU General Public License as published by the 8 + * Free Software Foundation; either version 2 of the License, or (at your 9 + * option) any later version. 10 + * 11 + */ 12 + 1 13 #ifndef _MICREL_PHY_H 2 14 #define _MICREL_PHY_H 3 15 ··· 17 5 18 6 #define PHY_ID_KSZ9021 0x00221610 19 7 #define PHY_ID_KS8737 0x00221720 20 - #define PHY_ID_KS8041 0x00221510 21 - #define PHY_ID_KS8051 0x00221550 8 + #define PHY_ID_KSZ8021 0x00221555 9 + #define PHY_ID_KSZ8041 0x00221510 10 + #define PHY_ID_KSZ8051 0x00221550 22 11 /* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */ 23 - #define PHY_ID_KS8001 0x0022161A 12 + #define PHY_ID_KSZ8001 0x0022161A 24 13 25 14 /* struct phy_device dev_flags definitions */ 26 15 #define MICREL_PHY_50MHZ_CLK 0x00000001
+2
include/linux/perf_event.h
··· 274 274 __u64 branch_sample_type; /* enum branch_sample_type */ 275 275 }; 276 276 277 + #define perf_flags(attr) (*(&(attr)->read_format + 1)) 278 + 277 279 /* 278 280 * Ioctls that can be done on a perf event fd: 279 281 */
-1
include/linux/sched.h
··· 954 954 unsigned int smt_gain; 955 955 int flags; /* See SD_* */ 956 956 int level; 957 - int idle_buddy; /* cpu assigned to select_idle_sibling() */ 958 957 959 958 /* Runtime fields. */ 960 959 unsigned long last_balance; /* init to jiffies. units in jiffies */
+1
include/linux/security.h
··· 118 118 extern unsigned long mmap_min_addr; 119 119 extern unsigned long dac_mmap_min_addr; 120 120 #else 121 + #define mmap_min_addr 0UL 121 122 #define dac_mmap_min_addr 0UL 122 123 #endif 123 124
+2
include/linux/xfrm.h
··· 84 84 __u32 bitmap; 85 85 }; 86 86 87 + #define XFRMA_REPLAY_ESN_MAX 4096 88 + 87 89 struct xfrm_replay_state_esn { 88 90 unsigned int bmp_len; 89 91 __u32 oseq;
+2 -3
include/net/ip6_fib.h
··· 112 112 struct inet6_dev *rt6i_idev; 113 113 unsigned long _rt6i_peer; 114 114 115 - #ifdef CONFIG_XFRM 116 - u32 rt6i_flow_cache_genid; 117 - #endif 115 + u32 rt6i_genid; 116 + 118 117 /* more non-fragment space at head required */ 119 118 unsigned short rt6i_nfheader_len; 120 119
+10
include/net/net_namespace.h
··· 110 110 #endif 111 111 struct netns_ipvs *ipvs; 112 112 struct sock *diag_nlsk; 113 + atomic_t rt_genid; 113 114 }; 114 115 115 116 /* ··· 316 315 } 317 316 #endif 318 317 318 + static inline int rt_genid(struct net *net) 319 + { 320 + return atomic_read(&net->rt_genid); 321 + } 322 + 323 + static inline void rt_genid_bump(struct net *net) 324 + { 325 + atomic_inc(&net->rt_genid); 326 + } 319 327 320 328 #endif /* __NET_NET_NAMESPACE_H */
-1
include/net/netns/ipv4.h
··· 64 64 kgid_t sysctl_ping_group_range[2]; 65 65 long sysctl_tcp_mem[3]; 66 66 67 - atomic_t rt_genid; 68 67 atomic_t dev_addr_genid; 69 68 70 69 #ifdef CONFIG_IP_MROUTE
+1 -1
include/net/sock.h
··· 1339 1339 } 1340 1340 1341 1341 static inline bool 1342 - sk_rmem_schedule(struct sock *sk, struct sk_buff *skb, unsigned int size) 1342 + sk_rmem_schedule(struct sock *sk, struct sk_buff *skb, int size) 1343 1343 { 1344 1344 if (!sk_has_account(sk)) 1345 1345 return true;
+3 -1
include/target/target_core_backend.h
··· 23 23 struct se_device *(*create_virtdevice)(struct se_hba *, 24 24 struct se_subsystem_dev *, void *); 25 25 void (*free_device)(void *); 26 - int (*transport_complete)(struct se_cmd *cmd, struct scatterlist *); 26 + void (*transport_complete)(struct se_cmd *cmd, 27 + struct scatterlist *, 28 + unsigned char *); 27 29 28 30 int (*parse_cdb)(struct se_cmd *cmd); 29 31 ssize_t (*check_configfs_dev_params)(struct se_hba *,
+1
include/target/target_core_base.h
··· 121 121 122 122 #define SE_INQUIRY_BUF 512 123 123 #define SE_MODE_PAGE_BUF 512 124 + #define SE_SENSE_BUF 96 124 125 125 126 /* struct se_hba->hba_flags */ 126 127 enum hba_flags_table {
+2 -2
include/trace/events/kmem.h
··· 214 214 215 215 TP_printk("page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s", 216 216 __entry->page, 217 - page_to_pfn(__entry->page), 217 + __entry->page ? page_to_pfn(__entry->page) : 0, 218 218 __entry->order, 219 219 __entry->migratetype, 220 220 show_gfp_flags(__entry->gfp_flags)) ··· 240 240 241 241 TP_printk("page=%p pfn=%lu order=%u migratetype=%d percpu_refill=%d", 242 242 __entry->page, 243 - page_to_pfn(__entry->page), 243 + __entry->page ? page_to_pfn(__entry->page) : 0, 244 244 __entry->order, 245 245 __entry->migratetype, 246 246 __entry->order == 0)
+2 -1
include/xen/grant_table.h
··· 187 187 struct gnttab_map_grant_ref *kmap_ops, 188 188 struct page **pages, unsigned int count); 189 189 int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, 190 - struct page **pages, unsigned int count, bool clear_pte); 190 + struct gnttab_map_grant_ref *kunmap_ops, 191 + struct page **pages, unsigned int count); 191 192 192 193 #endif /* __ASM_GNTTAB_H__ */
+5 -1
kernel/pid_namespace.c
··· 234 234 */ 235 235 236 236 tmp.data = &current->nsproxy->pid_ns->last_pid; 237 - return proc_dointvec(&tmp, write, buffer, lenp, ppos); 237 + return proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); 238 238 } 239 239 240 + extern int pid_max; 241 + static int zero = 0; 240 242 static struct ctl_table pid_ns_ctl_table[] = { 241 243 { 242 244 .procname = "ns_last_pid", 243 245 .maxlen = sizeof(int), 244 246 .mode = 0666, /* permissions are checked in the handler */ 245 247 .proc_handler = pid_ns_ctl_handler, 248 + .extra1 = &zero, 249 + .extra2 = &pid_max, 246 250 }, 247 251 { } 248 252 };
+1 -38
kernel/sched/core.c
··· 6014 6014 * SD_SHARE_PKG_RESOURCE set (Last Level Cache Domain) for this 6015 6015 * allows us to avoid some pointer chasing select_idle_sibling(). 6016 6016 * 6017 - * Iterate domains and sched_groups downward, assigning CPUs to be 6018 - * select_idle_sibling() hw buddy. Cross-wiring hw makes bouncing 6019 - * due to random perturbation self canceling, ie sw buddies pull 6020 - * their counterpart to their CPU's hw counterpart. 6021 - * 6022 6017 * Also keep a unique ID per domain (we use the first cpu number in 6023 6018 * the cpumask of the domain), this allows us to quickly tell if 6024 6019 * two cpus are in the same cache domain, see cpus_share_cache(). ··· 6027 6032 int id = cpu; 6028 6033 6029 6034 sd = highest_flag_domain(cpu, SD_SHARE_PKG_RESOURCES); 6030 - if (sd) { 6031 - struct sched_domain *tmp = sd; 6032 - struct sched_group *sg, *prev; 6033 - bool right; 6034 - 6035 - /* 6036 - * Traverse to first CPU in group, and count hops 6037 - * to cpu from there, switching direction on each 6038 - * hop, never ever pointing the last CPU rightward. 6039 - */ 6040 - do { 6041 - id = cpumask_first(sched_domain_span(tmp)); 6042 - prev = sg = tmp->groups; 6043 - right = 1; 6044 - 6045 - while (cpumask_first(sched_group_cpus(sg)) != id) 6046 - sg = sg->next; 6047 - 6048 - while (!cpumask_test_cpu(cpu, sched_group_cpus(sg))) { 6049 - prev = sg; 6050 - sg = sg->next; 6051 - right = !right; 6052 - } 6053 - 6054 - /* A CPU went down, never point back to domain start. */ 6055 - if (right && cpumask_first(sched_group_cpus(sg->next)) == id) 6056 - right = false; 6057 - 6058 - sg = right ? sg->next : prev; 6059 - tmp->idle_buddy = cpumask_first(sched_group_cpus(sg)); 6060 - } while ((tmp = tmp->child)); 6061 - 6035 + if (sd) 6062 6036 id = cpumask_first(sched_domain_span(sd)); 6063 - } 6064 6037 6065 6038 rcu_assign_pointer(per_cpu(sd_llc, cpu), sd); 6066 6039 per_cpu(sd_llc_id, cpu) = id;
+21 -7
kernel/sched/fair.c
··· 2637 2637 int cpu = smp_processor_id(); 2638 2638 int prev_cpu = task_cpu(p); 2639 2639 struct sched_domain *sd; 2640 + struct sched_group *sg; 2641 + int i; 2640 2642 2641 2643 /* 2642 2644 * If the task is going to be woken-up on this cpu and if it is ··· 2655 2653 return prev_cpu; 2656 2654 2657 2655 /* 2658 - * Otherwise, check assigned siblings to find an elegible idle cpu. 2656 + * Otherwise, iterate the domains and find an elegible idle cpu. 2659 2657 */ 2660 2658 sd = rcu_dereference(per_cpu(sd_llc, target)); 2661 - 2662 2659 for_each_lower_domain(sd) { 2663 - if (!cpumask_test_cpu(sd->idle_buddy, tsk_cpus_allowed(p))) 2664 - continue; 2665 - if (idle_cpu(sd->idle_buddy)) 2666 - return sd->idle_buddy; 2667 - } 2660 + sg = sd->groups; 2661 + do { 2662 + if (!cpumask_intersects(sched_group_cpus(sg), 2663 + tsk_cpus_allowed(p))) 2664 + goto next; 2668 2665 2666 + for_each_cpu(i, sched_group_cpus(sg)) { 2667 + if (!idle_cpu(i)) 2668 + goto next; 2669 + } 2670 + 2671 + target = cpumask_first_and(sched_group_cpus(sg), 2672 + tsk_cpus_allowed(p)); 2673 + goto done; 2674 + next: 2675 + sg = sg->next; 2676 + } while (sg != sd->groups); 2677 + } 2678 + done: 2669 2679 return target; 2670 2680 } 2671 2681
+12 -7
kernel/time/timekeeping.c
··· 303 303 seq = read_seqbegin(&tk->lock); 304 304 305 305 ts->tv_sec = tk->xtime_sec; 306 - ts->tv_nsec = timekeeping_get_ns(tk); 306 + nsecs = timekeeping_get_ns(tk); 307 307 308 308 } while (read_seqretry(&tk->lock, seq)); 309 309 310 + ts->tv_nsec = 0; 310 311 timespec_add_ns(ts, nsecs); 311 312 } 312 313 EXPORT_SYMBOL(getnstimeofday); ··· 346 345 { 347 346 struct timekeeper *tk = &timekeeper; 348 347 struct timespec tomono; 348 + s64 nsec; 349 349 unsigned int seq; 350 350 351 351 WARN_ON(timekeeping_suspended); ··· 354 352 do { 355 353 seq = read_seqbegin(&tk->lock); 356 354 ts->tv_sec = tk->xtime_sec; 357 - ts->tv_nsec = timekeeping_get_ns(tk); 355 + nsec = timekeeping_get_ns(tk); 358 356 tomono = tk->wall_to_monotonic; 359 357 360 358 } while (read_seqretry(&tk->lock, seq)); 361 359 362 - set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec, 363 - ts->tv_nsec + tomono.tv_nsec); 360 + ts->tv_sec += tomono.tv_sec; 361 + ts->tv_nsec = 0; 362 + timespec_add_ns(ts, nsec + tomono.tv_nsec); 364 363 } 365 364 EXPORT_SYMBOL_GPL(ktime_get_ts); 366 365 ··· 1247 1244 { 1248 1245 struct timekeeper *tk = &timekeeper; 1249 1246 struct timespec tomono, sleep; 1247 + s64 nsec; 1250 1248 unsigned int seq; 1251 1249 1252 1250 WARN_ON(timekeeping_suspended); ··· 1255 1251 do { 1256 1252 seq = read_seqbegin(&tk->lock); 1257 1253 ts->tv_sec = tk->xtime_sec; 1258 - ts->tv_nsec = timekeeping_get_ns(tk); 1254 + nsec = timekeeping_get_ns(tk); 1259 1255 tomono = tk->wall_to_monotonic; 1260 1256 sleep = tk->total_sleep_time; 1261 1257 1262 1258 } while (read_seqretry(&tk->lock, seq)); 1263 1259 1264 - set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec + sleep.tv_sec, 1265 - ts->tv_nsec + tomono.tv_nsec + sleep.tv_nsec); 1260 + ts->tv_sec += tomono.tv_sec + sleep.tv_sec; 1261 + ts->tv_nsec = 0; 1262 + timespec_add_ns(ts, nsec + tomono.tv_nsec + sleep.tv_nsec); 1266 1263 } 1267 1264 EXPORT_SYMBOL_GPL(get_monotonic_boottime); 1268 1265
+18 -19
kernel/workqueue.c
··· 1349 1349 struct worker *worker = container_of(work, struct worker, rebind_work); 1350 1350 struct global_cwq *gcwq = worker->pool->gcwq; 1351 1351 1352 - if (worker_maybe_bind_and_lock(worker)) 1353 - worker_clr_flags(worker, WORKER_REBIND); 1352 + worker_maybe_bind_and_lock(worker); 1353 + 1354 + /* 1355 + * %WORKER_REBIND must be cleared even if the above binding failed; 1356 + * otherwise, we may confuse the next CPU_UP cycle or oops / get 1357 + * stuck by calling idle_worker_rebind() prematurely. If CPU went 1358 + * down again inbetween, %WORKER_UNBOUND would be set, so clearing 1359 + * %WORKER_REBIND is always safe. 1360 + */ 1361 + worker_clr_flags(worker, WORKER_REBIND); 1354 1362 1355 1363 spin_unlock_irq(&gcwq->lock); 1356 1364 } ··· 3576 3568 #ifdef CONFIG_SMP 3577 3569 3578 3570 struct work_for_cpu { 3579 - struct completion completion; 3571 + struct work_struct work; 3580 3572 long (*fn)(void *); 3581 3573 void *arg; 3582 3574 long ret; 3583 3575 }; 3584 3576 3585 - static int do_work_for_cpu(void *_wfc) 3577 + static void work_for_cpu_fn(struct work_struct *work) 3586 3578 { 3587 - struct work_for_cpu *wfc = _wfc; 3579 + struct work_for_cpu *wfc = container_of(work, struct work_for_cpu, work); 3580 + 3588 3581 wfc->ret = wfc->fn(wfc->arg); 3589 - complete(&wfc->completion); 3590 - return 0; 3591 3582 } 3592 3583 3593 3584 /** ··· 3601 3594 */ 3602 3595 long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) 3603 3596 { 3604 - struct task_struct *sub_thread; 3605 - struct work_for_cpu wfc = { 3606 - .completion = COMPLETION_INITIALIZER_ONSTACK(wfc.completion), 3607 - .fn = fn, 3608 - .arg = arg, 3609 - }; 3597 + struct work_for_cpu wfc = { .fn = fn, .arg = arg }; 3610 3598 3611 - sub_thread = kthread_create(do_work_for_cpu, &wfc, "work_for_cpu"); 3612 - if (IS_ERR(sub_thread)) 3613 - return PTR_ERR(sub_thread); 3614 - kthread_bind(sub_thread, cpu); 3615 - wake_up_process(sub_thread); 3616 - wait_for_completion(&wfc.completion); 3599 + INIT_WORK_ONSTACK(&wfc.work, work_for_cpu_fn); 3600 + schedule_work_on(cpu, &wfc.work); 3601 + flush_work(&wfc.work); 3617 3602 return wfc.ret; 3618 3603 } 3619 3604 EXPORT_SYMBOL_GPL(work_on_cpu);
+1 -1
lib/flex_proportions.c
··· 62 62 */ 63 63 bool fprop_new_period(struct fprop_global *p, int periods) 64 64 { 65 - u64 events; 65 + s64 events; 66 66 unsigned long flags; 67 67 68 68 local_irq_save(flags);
-1
mm/huge_memory.c
··· 1811 1811 src_page = pte_page(pteval); 1812 1812 copy_user_highpage(page, src_page, address, vma); 1813 1813 VM_BUG_ON(page_mapcount(src_page) != 1); 1814 - VM_BUG_ON(page_count(src_page) != 2); 1815 1814 release_pte_page(src_page); 1816 1815 /* 1817 1816 * ptl mostly unnecessary, but preempt has to
+10 -6
mm/memory_hotplug.c
··· 126 126 struct mem_section *ms; 127 127 struct page *page, *memmap; 128 128 129 - if (!pfn_valid(start_pfn)) 130 - return; 131 - 132 129 section_nr = pfn_to_section_nr(start_pfn); 133 130 ms = __nr_to_section(section_nr); 134 131 ··· 184 187 end_pfn = pfn + pgdat->node_spanned_pages; 185 188 186 189 /* register_section info */ 187 - for (; pfn < end_pfn; pfn += PAGES_PER_SECTION) 188 - register_page_bootmem_info_section(pfn); 189 - 190 + for (; pfn < end_pfn; pfn += PAGES_PER_SECTION) { 191 + /* 192 + * Some platforms can assign the same pfn to multiple nodes - on 193 + * node0 as well as nodeN. To avoid registering a pfn against 194 + * multiple nodes we check that this pfn does not already 195 + * reside in some other node. 196 + */ 197 + if (pfn_valid(pfn) && (pfn_to_nid(pfn) == node)) 198 + register_page_bootmem_info_section(pfn); 199 + } 190 200 } 191 201 #endif /* !CONFIG_SPARSEMEM_VMEMMAP */ 192 202
+1 -1
mm/page_alloc.c
··· 584 584 combined_idx = buddy_idx & page_idx; 585 585 higher_page = page + (combined_idx - page_idx); 586 586 buddy_idx = __find_buddy_index(combined_idx, order + 1); 587 - higher_buddy = page + (buddy_idx - combined_idx); 587 + higher_buddy = higher_page + (buddy_idx - combined_idx); 588 588 if (page_is_buddy(higher_page, higher_buddy, order + 1)) { 589 589 list_add_tail(&page->lru, 590 590 &zone->free_area[order].free_list[migratetype]);
+3 -3
mm/slab.c
··· 983 983 } 984 984 985 985 /* The caller cannot use PFMEMALLOC objects, find another one */ 986 - for (i = 1; i < ac->avail; i++) { 986 + for (i = 0; i < ac->avail; i++) { 987 987 /* If a !PFMEMALLOC object is found, swap them */ 988 988 if (!is_obj_pfmemalloc(ac->entry[i])) { 989 989 objp = ac->entry[i]; ··· 1000 1000 l3 = cachep->nodelists[numa_mem_id()]; 1001 1001 if (!list_empty(&l3->slabs_free) && force_refill) { 1002 1002 struct slab *slabp = virt_to_slab(objp); 1003 - ClearPageSlabPfmemalloc(virt_to_page(slabp->s_mem)); 1003 + ClearPageSlabPfmemalloc(virt_to_head_page(slabp->s_mem)); 1004 1004 clear_obj_pfmemalloc(&objp); 1005 1005 recheck_pfmemalloc_active(cachep, ac); 1006 1006 return objp; ··· 1032 1032 { 1033 1033 if (unlikely(pfmemalloc_active)) { 1034 1034 /* Some pfmemalloc slabs exist, check if this is one */ 1035 - struct page *page = virt_to_page(objp); 1035 + struct page *page = virt_to_head_page(objp); 1036 1036 if (PageSlabPfmemalloc(page)) 1037 1037 set_obj_pfmemalloc(&objp); 1038 1038 }
+10 -5
mm/slub.c
··· 1524 1524 } 1525 1525 1526 1526 static int put_cpu_partial(struct kmem_cache *s, struct page *page, int drain); 1527 + static inline bool pfmemalloc_match(struct page *page, gfp_t gfpflags); 1527 1528 1528 1529 /* 1529 1530 * Try to allocate a partial slab from a specific node. 1530 1531 */ 1531 - static void *get_partial_node(struct kmem_cache *s, 1532 - struct kmem_cache_node *n, struct kmem_cache_cpu *c) 1532 + static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, 1533 + struct kmem_cache_cpu *c, gfp_t flags) 1533 1534 { 1534 1535 struct page *page, *page2; 1535 1536 void *object = NULL; ··· 1546 1545 1547 1546 spin_lock(&n->list_lock); 1548 1547 list_for_each_entry_safe(page, page2, &n->partial, lru) { 1549 - void *t = acquire_slab(s, n, page, object == NULL); 1548 + void *t; 1550 1549 int available; 1551 1550 1551 + if (!pfmemalloc_match(page, flags)) 1552 + continue; 1553 + 1554 + t = acquire_slab(s, n, page, object == NULL); 1552 1555 if (!t) 1553 1556 break; 1554 1557 ··· 1619 1614 1620 1615 if (n && cpuset_zone_allowed_hardwall(zone, flags) && 1621 1616 n->nr_partial > s->min_partial) { 1622 - object = get_partial_node(s, n, c); 1617 + object = get_partial_node(s, n, c, flags); 1623 1618 if (object) { 1624 1619 /* 1625 1620 * Return the object even if ··· 1648 1643 void *object; 1649 1644 int searchnode = (node == NUMA_NO_NODE) ? numa_node_id() : node; 1650 1645 1651 - object = get_partial_node(s, get_node(s, searchnode), c); 1646 + object = get_partial_node(s, get_node(s, searchnode), c, flags); 1652 1647 if (object || node != NUMA_NO_NODE) 1653 1648 return object; 1654 1649
+1
mm/vmscan.c
··· 3102 3102 /* failure at boot is fatal */ 3103 3103 BUG_ON(system_state == SYSTEM_BOOTING); 3104 3104 printk("Failed to start kswapd on node %d\n",nid); 3105 + pgdat->kswapd = NULL; 3105 3106 ret = -1; 3106 3107 } 3107 3108 return ret;
+5 -2
net/batman-adv/bat_iv_ogm.c
··· 652 652 struct batadv_neigh_node *router = NULL; 653 653 struct batadv_orig_node *orig_node_tmp; 654 654 struct hlist_node *node; 655 + int if_num; 655 656 uint8_t sum_orig, sum_neigh; 656 657 uint8_t *neigh_addr; 657 658 uint8_t tq_avg; ··· 739 738 if (router && (neigh_node->tq_avg == router->tq_avg)) { 740 739 orig_node_tmp = router->orig_node; 741 740 spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); 742 - sum_orig = orig_node_tmp->bcast_own_sum[if_incoming->if_num]; 741 + if_num = router->if_incoming->if_num; 742 + sum_orig = orig_node_tmp->bcast_own_sum[if_num]; 743 743 spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); 744 744 745 745 orig_node_tmp = neigh_node->orig_node; 746 746 spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); 747 - sum_neigh = orig_node_tmp->bcast_own_sum[if_incoming->if_num]; 747 + if_num = neigh_node->if_incoming->if_num; 748 + sum_neigh = orig_node_tmp->bcast_own_sum[if_num]; 748 749 spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); 749 750 750 751 if (sum_orig >= sum_neigh)
+3 -3
net/batman-adv/bitarray.h
··· 20 20 #ifndef _NET_BATMAN_ADV_BITARRAY_H_ 21 21 #define _NET_BATMAN_ADV_BITARRAY_H_ 22 22 23 - /* returns true if the corresponding bit in the given seq_bits indicates true 24 - * and curr_seqno is within range of last_seqno 23 + /* Returns 1 if the corresponding bit in the given seq_bits indicates true 24 + * and curr_seqno is within range of last_seqno. Otherwise returns 0. 25 25 */ 26 26 static inline int batadv_test_bit(const unsigned long *seq_bits, 27 27 uint32_t last_seqno, uint32_t curr_seqno) ··· 32 32 if (diff < 0 || diff >= BATADV_TQ_LOCAL_WINDOW_SIZE) 33 33 return 0; 34 34 else 35 - return test_bit(diff, seq_bits); 35 + return test_bit(diff, seq_bits) != 0; 36 36 } 37 37 38 38 /* turn corresponding bit on, so we can remember that we got the packet */
+5 -2
net/batman-adv/soft-interface.c
··· 107 107 { 108 108 struct batadv_priv *bat_priv = netdev_priv(dev); 109 109 struct sockaddr *addr = p; 110 + uint8_t old_addr[ETH_ALEN]; 110 111 111 112 if (!is_valid_ether_addr(addr->sa_data)) 112 113 return -EADDRNOTAVAIL; 113 114 115 + memcpy(old_addr, dev->dev_addr, ETH_ALEN); 116 + memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); 117 + 114 118 /* only modify transtable if it has been initialized before */ 115 119 if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_ACTIVE) { 116 - batadv_tt_local_remove(bat_priv, dev->dev_addr, 120 + batadv_tt_local_remove(bat_priv, old_addr, 117 121 "mac address changed", false); 118 122 batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX); 119 123 } 120 124 121 - memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); 122 125 dev->addr_assign_type &= ~NET_ADDR_RANDOM; 123 126 return 0; 124 127 }
+2 -2
net/bluetooth/bnep/sock.c
··· 64 64 switch (cmd) { 65 65 case BNEPCONNADD: 66 66 if (!capable(CAP_NET_ADMIN)) 67 - return -EACCES; 67 + return -EPERM; 68 68 69 69 if (copy_from_user(&ca, argp, sizeof(ca))) 70 70 return -EFAULT; ··· 90 90 91 91 case BNEPCONNDEL: 92 92 if (!capable(CAP_NET_ADMIN)) 93 - return -EACCES; 93 + return -EPERM; 94 94 95 95 if (copy_from_user(&cd, argp, sizeof(cd))) 96 96 return -EFAULT;
+2 -2
net/bluetooth/cmtp/sock.c
··· 78 78 switch (cmd) { 79 79 case CMTPCONNADD: 80 80 if (!capable(CAP_NET_ADMIN)) 81 - return -EACCES; 81 + return -EPERM; 82 82 83 83 if (copy_from_user(&ca, argp, sizeof(ca))) 84 84 return -EFAULT; ··· 103 103 104 104 case CMTPCONNDEL: 105 105 if (!capable(CAP_NET_ADMIN)) 106 - return -EACCES; 106 + return -EPERM; 107 107 108 108 if (copy_from_user(&cd, argp, sizeof(cd))) 109 109 return -EFAULT;
+2
net/bluetooth/hci_core.c
··· 735 735 736 736 cancel_work_sync(&hdev->le_scan); 737 737 738 + cancel_delayed_work(&hdev->power_off); 739 + 738 740 hci_req_cancel(hdev, ENODEV); 739 741 hci_req_lock(hdev); 740 742
+8 -8
net/bluetooth/hci_sock.c
··· 490 490 switch (cmd) { 491 491 case HCISETRAW: 492 492 if (!capable(CAP_NET_ADMIN)) 493 - return -EACCES; 493 + return -EPERM; 494 494 495 495 if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) 496 496 return -EPERM; ··· 510 510 511 511 case HCIBLOCKADDR: 512 512 if (!capable(CAP_NET_ADMIN)) 513 - return -EACCES; 513 + return -EPERM; 514 514 return hci_sock_blacklist_add(hdev, (void __user *) arg); 515 515 516 516 case HCIUNBLOCKADDR: 517 517 if (!capable(CAP_NET_ADMIN)) 518 - return -EACCES; 518 + return -EPERM; 519 519 return hci_sock_blacklist_del(hdev, (void __user *) arg); 520 520 521 521 default: ··· 546 546 547 547 case HCIDEVUP: 548 548 if (!capable(CAP_NET_ADMIN)) 549 - return -EACCES; 549 + return -EPERM; 550 550 return hci_dev_open(arg); 551 551 552 552 case HCIDEVDOWN: 553 553 if (!capable(CAP_NET_ADMIN)) 554 - return -EACCES; 554 + return -EPERM; 555 555 return hci_dev_close(arg); 556 556 557 557 case HCIDEVRESET: 558 558 if (!capable(CAP_NET_ADMIN)) 559 - return -EACCES; 559 + return -EPERM; 560 560 return hci_dev_reset(arg); 561 561 562 562 case HCIDEVRESTAT: 563 563 if (!capable(CAP_NET_ADMIN)) 564 - return -EACCES; 564 + return -EPERM; 565 565 return hci_dev_reset_stat(arg); 566 566 567 567 case HCISETSCAN: ··· 573 573 case HCISETACLMTU: 574 574 case HCISETSCOMTU: 575 575 if (!capable(CAP_NET_ADMIN)) 576 - return -EACCES; 576 + return -EPERM; 577 577 return hci_dev_cmd(cmd, argp); 578 578 579 579 case HCIINQUIRY:
+2 -2
net/bluetooth/hidp/sock.c
··· 62 62 switch (cmd) { 63 63 case HIDPCONNADD: 64 64 if (!capable(CAP_NET_ADMIN)) 65 - return -EACCES; 65 + return -EPERM; 66 66 67 67 if (copy_from_user(&ca, argp, sizeof(ca))) 68 68 return -EFAULT; ··· 97 97 98 98 case HIDPCONNDEL: 99 99 if (!capable(CAP_NET_ADMIN)) 100 - return -EACCES; 100 + return -EPERM; 101 101 102 102 if (copy_from_user(&cd, argp, sizeof(cd))) 103 103 return -EFAULT;
+1 -1
net/bluetooth/l2cap_core.c
··· 1025 1025 if (!conn) 1026 1026 return; 1027 1027 1028 - if (chan->mode == L2CAP_MODE_ERTM) { 1028 + if (chan->mode == L2CAP_MODE_ERTM && chan->state == BT_CONNECTED) { 1029 1029 __clear_retrans_timer(chan); 1030 1030 __clear_monitor_timer(chan); 1031 1031 __clear_ack_timer(chan);
+16
net/bluetooth/mgmt.c
··· 2891 2891 if (scan) 2892 2892 hci_send_cmd(hdev, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan); 2893 2893 2894 + if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) { 2895 + u8 ssp = 1; 2896 + 2897 + hci_send_cmd(hdev, HCI_OP_WRITE_SSP_MODE, 1, &ssp); 2898 + } 2899 + 2900 + if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) { 2901 + struct hci_cp_write_le_host_supported cp; 2902 + 2903 + cp.le = 1; 2904 + cp.simul = !!(hdev->features[6] & LMP_SIMUL_LE_BR); 2905 + 2906 + hci_send_cmd(hdev, HCI_OP_WRITE_LE_HOST_SUPPORTED, 2907 + sizeof(cp), &cp); 2908 + } 2909 + 2894 2910 update_class(hdev); 2895 2911 update_name(hdev, hdev->dev_name); 2896 2912 update_eir(hdev);
+1 -4
net/ceph/messenger.c
··· 1073 1073 BUG_ON(kaddr == NULL); 1074 1074 base = kaddr + con->out_msg_pos.page_pos + bio_offset; 1075 1075 crc = crc32c(crc, base, len); 1076 + kunmap(page); 1076 1077 msg->footer.data_crc = cpu_to_le32(crc); 1077 1078 con->out_msg_pos.did_page_crc = true; 1078 1079 } 1079 1080 ret = ceph_tcp_sendpage(con->sock, page, 1080 1081 con->out_msg_pos.page_pos + bio_offset, 1081 1082 len, 1); 1082 - 1083 - if (do_datacrc) 1084 - kunmap(page); 1085 - 1086 1083 if (ret <= 0) 1087 1084 goto out; 1088 1085
+3 -2
net/core/dev.c
··· 2156 2156 static netdev_features_t harmonize_features(struct sk_buff *skb, 2157 2157 __be16 protocol, netdev_features_t features) 2158 2158 { 2159 - if (!can_checksum_protocol(features, protocol)) { 2159 + if (skb->ip_summed != CHECKSUM_NONE && 2160 + !can_checksum_protocol(features, protocol)) { 2160 2161 features &= ~NETIF_F_ALL_CSUM; 2161 2162 features &= ~NETIF_F_SG; 2162 2163 } else if (illegal_highdma(skb->dev, skb)) { ··· 3346 3345 3347 3346 if (pt_prev) { 3348 3347 if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC))) 3349 - ret = -ENOMEM; 3348 + goto drop; 3350 3349 else 3351 3350 ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev); 3352 3351 } else {
+3 -1
net/core/skbuff.c
··· 3497 3497 if (!skb_cloned(from)) 3498 3498 skb_shinfo(from)->nr_frags = 0; 3499 3499 3500 - /* if the skb is cloned this does nothing since we set nr_frags to 0 */ 3500 + /* if the skb is not cloned this does nothing 3501 + * since we set nr_frags to 0. 3502 + */ 3501 3503 for (i = 0; i < skb_shinfo(from)->nr_frags; i++) 3502 3504 skb_frag_ref(from, i); 3503 3505
+2 -1
net/core/sock.c
··· 691 691 692 692 case SO_KEEPALIVE: 693 693 #ifdef CONFIG_INET 694 - if (sk->sk_protocol == IPPROTO_TCP) 694 + if (sk->sk_protocol == IPPROTO_TCP && 695 + sk->sk_type == SOCK_STREAM) 695 696 tcp_set_keepalive(sk, valbool); 696 697 #endif 697 698 sock_valbool_flag(sk, SOCK_KEEPOPEN, valbool);
+2 -2
net/ipv4/devinet.c
··· 722 722 break; 723 723 724 724 case SIOCSIFFLAGS: 725 - ret = -EACCES; 725 + ret = -EPERM; 726 726 if (!capable(CAP_NET_ADMIN)) 727 727 goto out; 728 728 break; ··· 730 730 case SIOCSIFBRDADDR: /* Set the broadcast address */ 731 731 case SIOCSIFDSTADDR: /* Set the destination address */ 732 732 case SIOCSIFNETMASK: /* Set the netmask for the interface */ 733 - ret = -EACCES; 733 + ret = -EPERM; 734 734 if (!capable(CAP_NET_ADMIN)) 735 735 goto out; 736 736 ret = -EINVAL;
+4 -1
net/ipv4/inetpeer.c
··· 510 510 secure_ipv6_id(daddr->addr.a6)); 511 511 p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW; 512 512 p->rate_tokens = 0; 513 - p->rate_last = 0; 513 + /* 60*HZ is arbitrary, but chosen enough high so that the first 514 + * calculation of tokens is at its maximum. 515 + */ 516 + p->rate_last = jiffies - 60*HZ; 514 517 INIT_LIST_HEAD(&p->gc_list); 515 518 516 519 /* Link the node. */
+8 -6
net/ipv4/raw.c
··· 131 131 * 0 - deliver 132 132 * 1 - block 133 133 */ 134 - static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb) 134 + static int icmp_filter(const struct sock *sk, const struct sk_buff *skb) 135 135 { 136 - int type; 136 + struct icmphdr _hdr; 137 + const struct icmphdr *hdr; 137 138 138 - if (!pskb_may_pull(skb, sizeof(struct icmphdr))) 139 + hdr = skb_header_pointer(skb, skb_transport_offset(skb), 140 + sizeof(_hdr), &_hdr); 141 + if (!hdr) 139 142 return 1; 140 143 141 - type = icmp_hdr(skb)->type; 142 - if (type < 32) { 144 + if (hdr->type < 32) { 143 145 __u32 data = raw_sk(sk)->filter.data; 144 146 145 - return ((1 << type) & data) != 0; 147 + return ((1U << hdr->type) & data) != 0; 146 148 } 147 149 148 150 /* Do not block unknown ICMP types */
+2 -7
net/ipv4/route.c
··· 202 202 static DEFINE_PER_CPU(struct rt_cache_stat, rt_cache_stat); 203 203 #define RT_CACHE_STAT_INC(field) __this_cpu_inc(rt_cache_stat.field) 204 204 205 - static inline int rt_genid(struct net *net) 206 - { 207 - return atomic_read(&net->ipv4.rt_genid); 208 - } 209 - 210 205 #ifdef CONFIG_PROC_FS 211 206 static void *rt_cache_seq_start(struct seq_file *seq, loff_t *pos) 212 207 { ··· 444 449 445 450 void rt_cache_flush(struct net *net) 446 451 { 447 - atomic_inc(&net->ipv4.rt_genid); 452 + rt_genid_bump(net); 448 453 } 449 454 450 455 static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst, ··· 2501 2506 2502 2507 static __net_init int rt_genid_init(struct net *net) 2503 2508 { 2504 - atomic_set(&net->ipv4.rt_genid, 0); 2509 + atomic_set(&net->rt_genid, 0); 2505 2510 get_random_bytes(&net->ipv4.dev_addr_genid, 2506 2511 sizeof(net->ipv4.dev_addr_genid)); 2507 2512 return 0;
+18 -5
net/ipv4/tcp.c
··· 1738 1738 } 1739 1739 1740 1740 #ifdef CONFIG_NET_DMA 1741 - if (tp->ucopy.dma_chan) 1742 - dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); 1741 + if (tp->ucopy.dma_chan) { 1742 + if (tp->rcv_wnd == 0 && 1743 + !skb_queue_empty(&sk->sk_async_wait_queue)) { 1744 + tcp_service_net_dma(sk, true); 1745 + tcp_cleanup_rbuf(sk, copied); 1746 + } else 1747 + dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); 1748 + } 1743 1749 #endif 1744 1750 if (copied >= target) { 1745 1751 /* Do not sleep, just process backlog. */ ··· 2326 2320 tp->rx_opt.mss_clamp = opt.opt_val; 2327 2321 break; 2328 2322 case TCPOPT_WINDOW: 2329 - if (opt.opt_val > 14) 2330 - return -EFBIG; 2323 + { 2324 + u16 snd_wscale = opt.opt_val & 0xFFFF; 2325 + u16 rcv_wscale = opt.opt_val >> 16; 2331 2326 2332 - tp->rx_opt.snd_wscale = opt.opt_val; 2327 + if (snd_wscale > 14 || rcv_wscale > 14) 2328 + return -EFBIG; 2329 + 2330 + tp->rx_opt.snd_wscale = snd_wscale; 2331 + tp->rx_opt.rcv_wscale = rcv_wscale; 2332 + tp->rx_opt.wscale_ok = 1; 2333 + } 2333 2334 break; 2334 2335 case TCPOPT_SACK_PERM: 2335 2336 if (opt.opt_val != 0)
+2 -3
net/ipv4/tcp_input.c
··· 4634 4634 4635 4635 if (eaten > 0) 4636 4636 kfree_skb_partial(skb, fragstolen); 4637 - else if (!sock_flag(sk, SOCK_DEAD)) 4637 + if (!sock_flag(sk, SOCK_DEAD)) 4638 4638 sk->sk_data_ready(sk, 0); 4639 4639 return; 4640 4640 } ··· 5529 5529 #endif 5530 5530 if (eaten) 5531 5531 kfree_skb_partial(skb, fragstolen); 5532 - else 5533 - sk->sk_data_ready(sk, 0); 5532 + sk->sk_data_ready(sk, 0); 5534 5533 return 0; 5535 5534 } 5536 5535 }
+1 -22
net/ipv6/inet6_connection_sock.c
··· 175 175 const struct in6_addr *saddr) 176 176 { 177 177 __ip6_dst_store(sk, dst, daddr, saddr); 178 - 179 - #ifdef CONFIG_XFRM 180 - { 181 - struct rt6_info *rt = (struct rt6_info *)dst; 182 - rt->rt6i_flow_cache_genid = atomic_read(&flow_cache_genid); 183 - } 184 - #endif 185 178 } 186 179 187 180 static inline 188 181 struct dst_entry *__inet6_csk_dst_check(struct sock *sk, u32 cookie) 189 182 { 190 - struct dst_entry *dst; 191 - 192 - dst = __sk_dst_check(sk, cookie); 193 - 194 - #ifdef CONFIG_XFRM 195 - if (dst) { 196 - struct rt6_info *rt = (struct rt6_info *)dst; 197 - if (rt->rt6i_flow_cache_genid != atomic_read(&flow_cache_genid)) { 198 - __sk_dst_reset(sk); 199 - dst = NULL; 200 - } 201 - } 202 - #endif 203 - 204 - return dst; 183 + return __sk_dst_check(sk, cookie); 205 184 } 206 185 207 186 static struct dst_entry *inet6_csk_route_socket(struct sock *sk,
+4
net/ipv6/ip6_fib.c
··· 819 819 offsetof(struct rt6_info, rt6i_src), 820 820 allow_create, replace_required); 821 821 822 + if (IS_ERR(sn)) { 823 + err = PTR_ERR(sn); 824 + sn = NULL; 825 + } 822 826 if (!sn) { 823 827 /* If it is failed, discard just allocated 824 828 root, and then (in st_failure) stale node
+11 -9
net/ipv6/mip6.c
··· 86 86 87 87 static int mip6_mh_filter(struct sock *sk, struct sk_buff *skb) 88 88 { 89 - struct ip6_mh *mh; 89 + struct ip6_mh _hdr; 90 + const struct ip6_mh *mh; 90 91 91 - if (!pskb_may_pull(skb, (skb_transport_offset(skb)) + 8) || 92 - !pskb_may_pull(skb, (skb_transport_offset(skb) + 93 - ((skb_transport_header(skb)[1] + 1) << 3)))) 92 + mh = skb_header_pointer(skb, skb_transport_offset(skb), 93 + sizeof(_hdr), &_hdr); 94 + if (!mh) 94 95 return -1; 95 96 96 - mh = (struct ip6_mh *)skb_transport_header(skb); 97 + if (((mh->ip6mh_hdrlen + 1) << 3) > skb->len) 98 + return -1; 97 99 98 100 if (mh->ip6mh_hdrlen < mip6_mh_len(mh->ip6mh_type)) { 99 101 LIMIT_NETDEBUG(KERN_DEBUG "mip6: MH message too short: %d vs >=%d\n", 100 102 mh->ip6mh_hdrlen, mip6_mh_len(mh->ip6mh_type)); 101 - mip6_param_prob(skb, 0, ((&mh->ip6mh_hdrlen) - 102 - skb_network_header(skb))); 103 + mip6_param_prob(skb, 0, offsetof(struct ip6_mh, ip6mh_hdrlen) + 104 + skb_network_header_len(skb)); 103 105 return -1; 104 106 } 105 107 106 108 if (mh->ip6mh_proto != IPPROTO_NONE) { 107 109 LIMIT_NETDEBUG(KERN_DEBUG "mip6: MH invalid payload proto = %d\n", 108 110 mh->ip6mh_proto); 109 - mip6_param_prob(skb, 0, ((&mh->ip6mh_proto) - 110 - skb_network_header(skb))); 111 + mip6_param_prob(skb, 0, offsetof(struct ip6_mh, ip6mh_proto) + 112 + skb_network_header_len(skb)); 111 113 return -1; 112 114 } 113 115
+10 -11
net/ipv6/raw.c
··· 107 107 * 0 - deliver 108 108 * 1 - block 109 109 */ 110 - static __inline__ int icmpv6_filter(struct sock *sk, struct sk_buff *skb) 110 + static int icmpv6_filter(const struct sock *sk, const struct sk_buff *skb) 111 111 { 112 - struct icmp6hdr *icmph; 113 - struct raw6_sock *rp = raw6_sk(sk); 112 + struct icmp6hdr *_hdr; 113 + const struct icmp6hdr *hdr; 114 114 115 - if (pskb_may_pull(skb, sizeof(struct icmp6hdr))) { 116 - __u32 *data = &rp->filter.data[0]; 117 - int bit_nr; 115 + hdr = skb_header_pointer(skb, skb_transport_offset(skb), 116 + sizeof(_hdr), &_hdr); 117 + if (hdr) { 118 + const __u32 *data = &raw6_sk(sk)->filter.data[0]; 119 + unsigned int type = hdr->icmp6_type; 118 120 119 - icmph = (struct icmp6hdr *) skb->data; 120 - bit_nr = icmph->icmp6_type; 121 - 122 - return (data[bit_nr >> 5] & (1 << (bit_nr & 31))) != 0; 121 + return (data[type >> 5] & (1U << (type & 31))) != 0; 123 122 } 124 - return 0; 123 + return 1; 125 124 } 126 125 127 126 #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
+12 -7
net/ipv6/route.c
··· 226 226 .dst = { 227 227 .__refcnt = ATOMIC_INIT(1), 228 228 .__use = 1, 229 - .obsolete = -1, 229 + .obsolete = DST_OBSOLETE_FORCE_CHK, 230 230 .error = -ENETUNREACH, 231 231 .input = ip6_pkt_discard, 232 232 .output = ip6_pkt_discard_out, ··· 246 246 .dst = { 247 247 .__refcnt = ATOMIC_INIT(1), 248 248 .__use = 1, 249 - .obsolete = -1, 249 + .obsolete = DST_OBSOLETE_FORCE_CHK, 250 250 .error = -EACCES, 251 251 .input = ip6_pkt_prohibit, 252 252 .output = ip6_pkt_prohibit_out, ··· 261 261 .dst = { 262 262 .__refcnt = ATOMIC_INIT(1), 263 263 .__use = 1, 264 - .obsolete = -1, 264 + .obsolete = DST_OBSOLETE_FORCE_CHK, 265 265 .error = -EINVAL, 266 266 .input = dst_discard, 267 267 .output = dst_discard, ··· 281 281 struct fib6_table *table) 282 282 { 283 283 struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev, 284 - 0, DST_OBSOLETE_NONE, flags); 284 + 0, DST_OBSOLETE_FORCE_CHK, flags); 285 285 286 286 if (rt) { 287 287 struct dst_entry *dst = &rt->dst; 288 288 289 289 memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); 290 290 rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers); 291 + rt->rt6i_genid = rt_genid(net); 291 292 } 292 293 return rt; 293 294 } ··· 1023 1022 1024 1023 rt = (struct rt6_info *) dst; 1025 1024 1025 + /* All IPV6 dsts are created with ->obsolete set to the value 1026 + * DST_OBSOLETE_FORCE_CHK which forces validation calls down 1027 + * into this function always. 1028 + */ 1029 + if (rt->rt6i_genid != rt_genid(dev_net(rt->dst.dev))) 1030 + return NULL; 1031 + 1026 1032 if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) { 1027 1033 if (rt->rt6i_peer_genid != rt6_peer_genid()) { 1028 1034 if (!rt6_has_peer(rt)) ··· 1395 1387 err = -ENOMEM; 1396 1388 goto out; 1397 1389 } 1398 - 1399 - rt->dst.obsolete = -1; 1400 1390 1401 1391 if (cfg->fc_flags & RTF_EXPIRES) 1402 1392 rt6_set_expires(rt, jiffies + ··· 2090 2084 rt->dst.input = ip6_input; 2091 2085 rt->dst.output = ip6_output; 2092 2086 rt->rt6i_idev = idev; 2093 - rt->dst.obsolete = -1; 2094 2087 2095 2088 rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP; 2096 2089 if (anycast)
+6 -6
net/l2tp/l2tp_netlink.c
··· 80 80 81 81 hdr = genlmsg_put(msg, info->snd_portid, info->snd_seq, 82 82 &l2tp_nl_family, 0, L2TP_CMD_NOOP); 83 - if (IS_ERR(hdr)) { 84 - ret = PTR_ERR(hdr); 83 + if (!hdr) { 84 + ret = -EMSGSIZE; 85 85 goto err_out; 86 86 } 87 87 ··· 250 250 251 251 hdr = genlmsg_put(skb, portid, seq, &l2tp_nl_family, flags, 252 252 L2TP_CMD_TUNNEL_GET); 253 - if (IS_ERR(hdr)) 254 - return PTR_ERR(hdr); 253 + if (!hdr) 254 + return -EMSGSIZE; 255 255 256 256 if (nla_put_u8(skb, L2TP_ATTR_PROTO_VERSION, tunnel->version) || 257 257 nla_put_u32(skb, L2TP_ATTR_CONN_ID, tunnel->tunnel_id) || ··· 617 617 sk = tunnel->sock; 618 618 619 619 hdr = genlmsg_put(skb, portid, seq, &l2tp_nl_family, flags, L2TP_CMD_SESSION_GET); 620 - if (IS_ERR(hdr)) 621 - return PTR_ERR(hdr); 620 + if (!hdr) 621 + return -EMSGSIZE; 622 622 623 623 if (nla_put_u32(skb, L2TP_ATTR_CONN_ID, tunnel->tunnel_id) || 624 624 nla_put_u32(skb, L2TP_ATTR_SESSION_ID, session->session_id) ||
+4 -4
net/netfilter/xt_limit.c
··· 117 117 118 118 /* For SMP, we only want to use one set of state. */ 119 119 r->master = priv; 120 + /* User avg in seconds * XT_LIMIT_SCALE: convert to jiffies * 121 + 128. */ 122 + priv->prev = jiffies; 123 + priv->credit = user2credits(r->avg * r->burst); /* Credits full. */ 120 124 if (r->cost == 0) { 121 - /* User avg in seconds * XT_LIMIT_SCALE: convert to jiffies * 122 - 128. */ 123 - priv->prev = jiffies; 124 - priv->credit = user2credits(r->avg * r->burst); /* Credits full. */ 125 125 r->credit_cap = priv->credit; /* Credits full. */ 126 126 r->cost = user2credits(r->avg); 127 127 }
+1 -1
net/netrom/af_netrom.c
··· 601 601 if (!capable(CAP_NET_BIND_SERVICE)) { 602 602 dev_put(dev); 603 603 release_sock(sk); 604 - return -EACCES; 604 + return -EPERM; 605 605 } 606 606 nr->user_addr = addr->fsa_digipeater[0]; 607 607 nr->source_addr = addr->fsa_ax25.sax25_call;
+4 -1
net/sched/sch_qfq.c
··· 865 865 if (mask) { 866 866 struct qfq_group *next = qfq_ffs(q, mask); 867 867 if (qfq_gt(roundedF, next->F)) { 868 - cl->S = next->F; 868 + if (qfq_gt(limit, next->F)) 869 + cl->S = next->F; 870 + else /* preserve timestamp correctness */ 871 + cl->S = limit; 869 872 return; 870 873 } 871 874 }
+9 -3
net/wireless/reg.c
··· 350 350 struct reg_regdb_search_request *request; 351 351 const struct ieee80211_regdomain *curdom, *regdom; 352 352 int i, r; 353 + bool set_reg = false; 354 + 355 + mutex_lock(&cfg80211_mutex); 353 356 354 357 mutex_lock(&reg_regdb_search_mutex); 355 358 while (!list_empty(&reg_regdb_search_list)) { ··· 368 365 r = reg_copy_regd(&regdom, curdom); 369 366 if (r) 370 367 break; 371 - mutex_lock(&cfg80211_mutex); 372 - set_regdom(regdom); 373 - mutex_unlock(&cfg80211_mutex); 368 + set_reg = true; 374 369 break; 375 370 } 376 371 } ··· 376 375 kfree(request); 377 376 } 378 377 mutex_unlock(&reg_regdb_search_mutex); 378 + 379 + if (set_reg) 380 + set_regdom(regdom); 381 + 382 + mutex_unlock(&cfg80211_mutex); 379 383 } 380 384 381 385 static DECLARE_WORK(reg_regdb_work, reg_regdb_search);
+2 -1
net/xfrm/xfrm_policy.c
··· 602 602 xfrm_pol_hold(policy); 603 603 net->xfrm.policy_count[dir]++; 604 604 atomic_inc(&flow_cache_genid); 605 + rt_genid_bump(net); 605 606 if (delpol) 606 607 __xfrm_policy_unlink(delpol, dir); 607 608 policy->index = delpol ? delpol->index : xfrm_gen_index(net, dir); ··· 1781 1780 1782 1781 if (!afinfo) { 1783 1782 dst_release(dst_orig); 1784 - ret = ERR_PTR(-EINVAL); 1783 + return ERR_PTR(-EINVAL); 1785 1784 } else { 1786 1785 ret = afinfo->blackhole_route(net, dst_orig); 1787 1786 }
+42 -15
net/xfrm/xfrm_user.c
··· 123 123 struct nlattr **attrs) 124 124 { 125 125 struct nlattr *rt = attrs[XFRMA_REPLAY_ESN_VAL]; 126 + struct xfrm_replay_state_esn *rs; 126 127 127 - if ((p->flags & XFRM_STATE_ESN) && !rt) 128 - return -EINVAL; 128 + if (p->flags & XFRM_STATE_ESN) { 129 + if (!rt) 130 + return -EINVAL; 131 + 132 + rs = nla_data(rt); 133 + 134 + if (rs->bmp_len > XFRMA_REPLAY_ESN_MAX / sizeof(rs->bmp[0]) / 8) 135 + return -EINVAL; 136 + 137 + if (nla_len(rt) < xfrm_replay_state_esn_len(rs) && 138 + nla_len(rt) != sizeof(*rs)) 139 + return -EINVAL; 140 + } 129 141 130 142 if (!rt) 131 143 return 0; ··· 382 370 struct nlattr *rp) 383 371 { 384 372 struct xfrm_replay_state_esn *up; 373 + int ulen; 385 374 386 375 if (!replay_esn || !rp) 387 376 return 0; 388 377 389 378 up = nla_data(rp); 379 + ulen = xfrm_replay_state_esn_len(up); 390 380 391 - if (xfrm_replay_state_esn_len(replay_esn) != 392 - xfrm_replay_state_esn_len(up)) 381 + if (nla_len(rp) < ulen || xfrm_replay_state_esn_len(replay_esn) != ulen) 393 382 return -EINVAL; 394 383 395 384 return 0; ··· 401 388 struct nlattr *rta) 402 389 { 403 390 struct xfrm_replay_state_esn *p, *pp, *up; 391 + int klen, ulen; 404 392 405 393 if (!rta) 406 394 return 0; 407 395 408 396 up = nla_data(rta); 397 + klen = xfrm_replay_state_esn_len(up); 398 + ulen = nla_len(rta) >= klen ? klen : sizeof(*up); 409 399 410 - p = kmemdup(up, xfrm_replay_state_esn_len(up), GFP_KERNEL); 400 + p = kzalloc(klen, GFP_KERNEL); 411 401 if (!p) 412 402 return -ENOMEM; 413 403 414 - pp = kmemdup(up, xfrm_replay_state_esn_len(up), GFP_KERNEL); 404 + pp = kzalloc(klen, GFP_KERNEL); 415 405 if (!pp) { 416 406 kfree(p); 417 407 return -ENOMEM; 418 408 } 409 + 410 + memcpy(p, up, ulen); 411 + memcpy(pp, up, ulen); 419 412 420 413 *replay_esn = p; 421 414 *preplay_esn = pp; ··· 461 442 * somehow made shareable and move it to xfrm_state.c - JHS 462 443 * 463 444 */ 464 - static void xfrm_update_ae_params(struct xfrm_state *x, struct nlattr **attrs) 445 + static void xfrm_update_ae_params(struct xfrm_state *x, struct nlattr **attrs, 446 + int update_esn) 465 447 { 466 448 struct nlattr *rp = attrs[XFRMA_REPLAY_VAL]; 467 - struct nlattr *re = attrs[XFRMA_REPLAY_ESN_VAL]; 449 + struct nlattr *re = update_esn ? attrs[XFRMA_REPLAY_ESN_VAL] : NULL; 468 450 struct nlattr *lt = attrs[XFRMA_LTIME_VAL]; 469 451 struct nlattr *et = attrs[XFRMA_ETIMER_THRESH]; 470 452 struct nlattr *rt = attrs[XFRMA_REPLAY_THRESH]; ··· 575 555 goto error; 576 556 577 557 /* override default values from above */ 578 - xfrm_update_ae_params(x, attrs); 558 + xfrm_update_ae_params(x, attrs, 0); 579 559 580 560 return x; 581 561 ··· 709 689 710 690 static void copy_to_user_state(struct xfrm_state *x, struct xfrm_usersa_info *p) 711 691 { 692 + memset(p, 0, sizeof(*p)); 712 693 memcpy(&p->id, &x->id, sizeof(p->id)); 713 694 memcpy(&p->sel, &x->sel, sizeof(p->sel)); 714 695 memcpy(&p->lft, &x->lft, sizeof(p->lft)); ··· 763 742 return -EMSGSIZE; 764 743 765 744 algo = nla_data(nla); 766 - strcpy(algo->alg_name, auth->alg_name); 745 + strncpy(algo->alg_name, auth->alg_name, sizeof(algo->alg_name)); 767 746 memcpy(algo->alg_key, auth->alg_key, (auth->alg_key_len + 7) / 8); 768 747 algo->alg_key_len = auth->alg_key_len; 769 748 ··· 899 878 { 900 879 struct xfrm_dump_info info; 901 880 struct sk_buff *skb; 881 + int err; 902 882 903 883 skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); 904 884 if (!skb) ··· 910 888 info.nlmsg_seq = seq; 911 889 info.nlmsg_flags = 0; 912 890 913 - if (dump_one_state(x, 0, &info)) { 891 + err = dump_one_state(x, 0, &info); 892 + if (err) { 914 893 kfree_skb(skb); 915 - return NULL; 894 + return ERR_PTR(err); 916 895 } 917 896 918 897 return skb; ··· 1340 1317 1341 1318 static void copy_to_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy_info *p, int dir) 1342 1319 { 1320 + memset(p, 0, sizeof(*p)); 1343 1321 memcpy(&p->sel, &xp->selector, sizeof(p->sel)); 1344 1322 memcpy(&p->lft, &xp->lft, sizeof(p->lft)); 1345 1323 memcpy(&p->curlft, &xp->curlft, sizeof(p->curlft)); ··· 1445 1421 struct xfrm_user_tmpl *up = &vec[i]; 1446 1422 struct xfrm_tmpl *kp = &xp->xfrm_vec[i]; 1447 1423 1424 + memset(up, 0, sizeof(*up)); 1448 1425 memcpy(&up->id, &kp->id, sizeof(up->id)); 1449 1426 up->family = kp->encap_family; 1450 1427 memcpy(&up->saddr, &kp->saddr, sizeof(up->saddr)); ··· 1571 1546 { 1572 1547 struct xfrm_dump_info info; 1573 1548 struct sk_buff *skb; 1549 + int err; 1574 1550 1575 1551 skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); 1576 1552 if (!skb) ··· 1582 1556 info.nlmsg_seq = seq; 1583 1557 info.nlmsg_flags = 0; 1584 1558 1585 - if (dump_one_policy(xp, dir, 0, &info) < 0) { 1559 + err = dump_one_policy(xp, dir, 0, &info); 1560 + if (err) { 1586 1561 kfree_skb(skb); 1587 - return NULL; 1562 + return ERR_PTR(err); 1588 1563 } 1589 1564 1590 1565 return skb; ··· 1849 1822 goto out; 1850 1823 1851 1824 spin_lock_bh(&x->lock); 1852 - xfrm_update_ae_params(x, attrs); 1825 + xfrm_update_ae_params(x, attrs, 1); 1853 1826 spin_unlock_bh(&x->lock); 1854 1827 1855 1828 c.event = nlh->nlmsg_type;
+2 -2
scripts/Makefile.fwinst
··· 27 27 installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) 28 28 29 29 installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) 30 - installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/. 30 + installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./ 31 31 32 32 # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. 33 33 PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs ··· 42 42 $(installed-fw-dirs): 43 43 $(call cmd,mkdir) 44 44 45 - $(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $$(dir $(INSTALL_FW_PATH)/%) 45 + $(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %) 46 46 $(call cmd,install) 47 47 48 48 PHONY += __fw_install __fw_modinst FORCE
+1 -1
scripts/checksyscalls.sh
··· 200 200 syscall_list() { 201 201 grep '^[0-9]' "$1" | sort -n | ( 202 202 while read nr abi name entry ; do 203 - echo <<EOF 203 + cat <<EOF 204 204 #if !defined(__NR_${name}) && !defined(__IGNORE_${name}) 205 205 #warning syscall ${name} not implemented 206 206 #endif
+1
security/selinux/include/xfrm.h
··· 51 51 static inline void selinux_xfrm_notify_policyload(void) 52 52 { 53 53 atomic_inc(&flow_cache_genid); 54 + rt_genid_bump(&init_net); 54 55 } 55 56 #else 56 57 static inline int selinux_xfrm_enabled(void)
+1
sound/pci/hda/hda_intel.c
··· 2701 2701 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), 2702 2702 SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), 2703 2703 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), 2704 + SND_PCI_QUIRK(0x1043, 0x1ac3, "ASUS X53S", POS_FIX_POSBUF), 2704 2705 SND_PCI_QUIRK(0x1043, 0x1b43, "ASUS K53E", POS_FIX_POSBUF), 2705 2706 SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), 2706 2707 SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB),
+1 -1
sound/soc/codecs/arizona.c
··· 426 426 940800, 427 427 1411200, 428 428 1881600, 429 - 2882400, 429 + 2822400, 430 430 3763200, 431 431 5644800, 432 432 7526400,
+4 -4
sound/soc/codecs/mc13783.c
··· 659 659 .id = MC13783_ID_STEREO_DAC, 660 660 .playback = { 661 661 .stream_name = "Playback", 662 - .channels_min = 1, 662 + .channels_min = 2, 663 663 .channels_max = 2, 664 664 .rates = SNDRV_PCM_RATE_8000_96000, 665 665 .formats = MC13783_FORMATS, ··· 670 670 .id = MC13783_ID_STEREO_CODEC, 671 671 .capture = { 672 672 .stream_name = "Capture", 673 - .channels_min = 1, 673 + .channels_min = 2, 674 674 .channels_max = 2, 675 675 .rates = MC13783_RATES_RECORD, 676 676 .formats = MC13783_FORMATS, ··· 692 692 .id = MC13783_ID_SYNC, 693 693 .playback = { 694 694 .stream_name = "Playback", 695 - .channels_min = 1, 695 + .channels_min = 2, 696 696 .channels_max = 2, 697 697 .rates = SNDRV_PCM_RATE_8000_96000, 698 698 .formats = MC13783_FORMATS, 699 699 }, 700 700 .capture = { 701 701 .stream_name = "Capture", 702 - .channels_min = 1, 702 + .channels_min = 2, 703 703 .channels_max = 2, 704 704 .rates = MC13783_RATES_RECORD, 705 705 .formats = MC13783_FORMATS,
+1 -1
sound/soc/codecs/wm2000.c
··· 702 702 } 703 703 704 704 static const struct regmap_config wm2000_regmap = { 705 - .reg_bits = 8, 705 + .reg_bits = 16, 706 706 .val_bits = 8, 707 707 708 708 .max_register = WM2000_REG_IF_CTL,
+1 -1
sound/soc/codecs/wm8904.c
··· 100 100 { 14, 0x0000 }, /* R14 - Power Management 2 */ 101 101 { 15, 0x0000 }, /* R15 - Power Management 3 */ 102 102 { 18, 0x0000 }, /* R18 - Power Management 6 */ 103 - { 19, 0x945E }, /* R20 - Clock Rates 0 */ 103 + { 20, 0x945E }, /* R20 - Clock Rates 0 */ 104 104 { 21, 0x0C05 }, /* R21 - Clock Rates 1 */ 105 105 { 22, 0x0006 }, /* R22 - Clock Rates 2 */ 106 106 { 24, 0x0050 }, /* R24 - Audio Interface 0 */
+1 -1
sound/soc/fsl/imx-sgtl5000.c
··· 94 94 dev_err(&pdev->dev, "audmux internal port setup failed\n"); 95 95 return ret; 96 96 } 97 - imx_audmux_v2_configure_port(ext_port, 97 + ret = imx_audmux_v2_configure_port(ext_port, 98 98 IMX_AUDMUX_V2_PTCR_SYN, 99 99 IMX_AUDMUX_V2_PDCR_RXDSEL(int_port)); 100 100 if (ret) {
+1 -1
sound/soc/omap/am3517evm.c
··· 59 59 return ret; 60 60 } 61 61 62 - snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_FSR_SRC_FSX, 0, 62 + ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_FSR_SRC_FSX, 0, 63 63 SND_SOC_CLOCK_IN); 64 64 if (ret < 0) { 65 65 printk(KERN_ERR "can't set CPU system clock OMAP_MCBSP_FSR_SRC_FSX\n");
+1 -7
sound/soc/samsung/dma.c
··· 34 34 .info = SNDRV_PCM_INFO_INTERLEAVED | 35 35 SNDRV_PCM_INFO_BLOCK_TRANSFER | 36 36 SNDRV_PCM_INFO_MMAP | 37 - SNDRV_PCM_INFO_MMAP_VALID | 38 - SNDRV_PCM_INFO_PAUSE | 39 - SNDRV_PCM_INFO_RESUME, 37 + SNDRV_PCM_INFO_MMAP_VALID, 40 38 .formats = SNDRV_PCM_FMTBIT_S16_LE | 41 39 SNDRV_PCM_FMTBIT_U16_LE | 42 40 SNDRV_PCM_FMTBIT_U8 | ··· 246 248 247 249 switch (cmd) { 248 250 case SNDRV_PCM_TRIGGER_START: 249 - case SNDRV_PCM_TRIGGER_RESUME: 250 - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 251 251 prtd->state |= ST_RUNNING; 252 252 prtd->params->ops->trigger(prtd->params->ch); 253 253 break; 254 254 255 255 case SNDRV_PCM_TRIGGER_STOP: 256 - case SNDRV_PCM_TRIGGER_SUSPEND: 257 - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 258 256 prtd->state &= ~ST_RUNNING; 259 257 prtd->params->ops->stop(prtd->params->ch); 260 258 break;
+4 -1
sound/soc/soc-dapm.c
··· 291 291 if (dapm->codec->driver->set_bias_level) 292 292 ret = dapm->codec->driver->set_bias_level(dapm->codec, 293 293 level); 294 - } else 294 + else 295 + dapm->bias_level = level; 296 + } else if (!card || dapm != &card->dapm) { 295 297 dapm->bias_level = level; 298 + } 296 299 297 300 if (ret != 0) 298 301 goto out;
+1 -1
sound/soc/spear/spear_pcm.c
··· 138 138 continue; 139 139 140 140 buf = &substream->dma_buffer; 141 - if (!buf && !buf->area) 141 + if (!buf || !buf->area) 142 142 continue; 143 143 144 144 dma_free_writecombine(pcm->card->dev, buf->bytes,
-1
sound/soc/tegra/tegra_alc5632.c
··· 89 89 .name = "Headset detection", 90 90 .report = SND_JACK_HEADSET, 91 91 .debounce_time = 150, 92 - .invert = 1, 93 92 }; 94 93 95 94 static const struct snd_soc_dapm_widget tegra_alc5632_dapm_widgets[] = {
+2 -2
sound/soc/tegra/tegra_pcm.c
··· 334 334 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 335 335 slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 336 336 slave_config.dst_addr = dmap->addr; 337 - slave_config.src_maxburst = 0; 337 + slave_config.dst_maxburst = 4; 338 338 } else { 339 339 slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 340 340 slave_config.src_addr = dmap->addr; 341 - slave_config.dst_maxburst = 0; 341 + slave_config.src_maxburst = 4; 342 342 } 343 343 slave_config.slave_id = dmap->req_sel; 344 344
+5 -20
sound/soc/ux500/ux500_msp_i2s.c
··· 663 663 struct ux500_msp **msp_p, 664 664 struct msp_i2s_platform_data *platform_data) 665 665 { 666 - int ret = 0; 667 666 struct resource *res = NULL; 668 667 struct i2s_controller *i2s_cont; 669 668 struct ux500_msp *msp; ··· 684 685 if (res == NULL) { 685 686 dev_err(&pdev->dev, "%s: ERROR: Unable to get resource!\n", 686 687 __func__); 687 - ret = -ENOMEM; 688 - goto err_res; 688 + return -ENOMEM; 689 689 } 690 690 691 - msp->registers = ioremap(res->start, (res->end - res->start + 1)); 691 + msp->registers = devm_ioremap(&pdev->dev, res->start, 692 + resource_size(res)); 692 693 if (msp->registers == NULL) { 693 694 dev_err(&pdev->dev, "%s: ERROR: ioremap failed!\n", __func__); 694 - ret = -ENOMEM; 695 - goto err_res; 695 + return -ENOMEM; 696 696 } 697 697 698 698 msp->msp_state = MSP_STATE_IDLE; ··· 703 705 dev_err(&pdev->dev, 704 706 "%s: ERROR: Failed to allocate I2S-controller!\n", 705 707 __func__); 706 - goto err_i2s_cont; 708 + return -ENOMEM; 707 709 } 708 710 i2s_cont->dev.parent = &pdev->dev; 709 711 i2s_cont->data = (void *)msp; ··· 714 716 msp->i2s_cont = i2s_cont; 715 717 716 718 return 0; 717 - 718 - err_i2s_cont: 719 - iounmap(msp->registers); 720 - 721 - err_res: 722 - devm_kfree(&pdev->dev, msp); 723 - 724 - return ret; 725 719 } 726 720 727 721 void ux500_msp_i2s_cleanup_msp(struct platform_device *pdev, ··· 722 732 dev_dbg(msp->dev, "%s: Enter (id = %d).\n", __func__, msp->id); 723 733 724 734 device_unregister(&msp->i2s_cont->dev); 725 - devm_kfree(&pdev->dev, msp->i2s_cont); 726 - 727 - iounmap(msp->registers); 728 - 729 - devm_kfree(&pdev->dev, msp); 730 735 } 731 736 732 737 MODULE_LICENSE("GPL v2");
+7 -1
sound/usb/endpoint.c
··· 197 197 /* no data provider, so send silence */ 198 198 unsigned int offs = 0; 199 199 for (i = 0; i < ctx->packets; ++i) { 200 - int counts = ctx->packet_size[i]; 200 + int counts; 201 + 202 + if (ctx->packet_size[i]) 203 + counts = ctx->packet_size[i]; 204 + else 205 + counts = snd_usb_endpoint_next_packet_size(ep); 206 + 201 207 urb->iso_frame_desc[i].offset = offs * ep->stride; 202 208 urb->iso_frame_desc[i].length = counts * ep->stride; 203 209 offs += counts;