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

Merge 3.17-rc6 into staging-next.

We want the fixes in there, and it resolves a merge issue with
drivers/iio/accel/bma180.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+1078 -612
-4
Documentation/devicetree/bindings/input/atmel,maxtouch.txt
··· 11 11 12 12 Optional properties for main touchpad device: 13 13 14 - - linux,gpio-keymap: An array of up to 4 entries indicating the Linux 15 - keycode generated by each GPIO. Linux keycodes are defined in 16 - <dt-bindings/input/input.h>. 17 - 18 14 - linux,gpio-keymap: When enabled, the SPT_GPIOPWN_T19 object sends messages 19 15 on GPIO bit changes. An array of up to 8 entries can be provided 20 16 indicating the Linux keycode mapped to each bit of the status byte,
+1 -1
Documentation/devicetree/bindings/sound/rockchip-i2s.txt
··· 31 31 #address-cells = <1>; 32 32 #size-cells = <0>; 33 33 dmas = <&pdma1 0>, <&pdma1 1>; 34 - dma-names = "rx", "tx"; 34 + dma-names = "tx", "rx"; 35 35 clock-names = "i2s_hclk", "i2s_clk"; 36 36 clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>; 37 37 };
+6 -2
Documentation/devicetree/bindings/spi/spi-rockchip.txt
··· 16 16 - clocks: Must contain an entry for each entry in clock-names. 17 17 - clock-names: Shall be "spiclk" for the transfer-clock, and "apb_pclk" for 18 18 the peripheral clock. 19 + - #address-cells: should be 1. 20 + - #size-cells: should be 0. 21 + 22 + Optional Properties: 23 + 19 24 - dmas: DMA specifiers for tx and rx dma. See the DMA client binding, 20 25 Documentation/devicetree/bindings/dma/dma.txt 21 26 - dma-names: DMA request names should include "tx" and "rx" if present. 22 - - #address-cells: should be 1. 23 - - #size-cells: should be 0. 27 + 24 28 25 29 Example: 26 30
+1 -1
MAINTAINERS
··· 6890 6890 6891 6891 PCI DRIVER FOR IMX6 6892 6892 M: Richard Zhu <r65037@freescale.com> 6893 - M: Shawn Guo <shawn.guo@freescale.com> 6893 + M: Lucas Stach <l.stach@pengutronix.de> 6894 6894 L: linux-pci@vger.kernel.org 6895 6895 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 6896 6896 S: Maintained
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 17 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc5 4 + EXTRAVERSION = -rc6 5 5 NAME = Shuffling Zombie Juror 6 6 7 7 # *DOCUMENTATION*
+62
arch/arm/include/asm/tls.h
··· 1 1 #ifndef __ASMARM_TLS_H 2 2 #define __ASMARM_TLS_H 3 3 4 + #include <linux/compiler.h> 5 + #include <asm/thread_info.h> 6 + 4 7 #ifdef __ASSEMBLY__ 5 8 #include <asm/asm-offsets.h> 6 9 .macro switch_tls_none, base, tp, tpuser, tmp1, tmp2 ··· 53 50 #endif 54 51 55 52 #ifndef __ASSEMBLY__ 53 + 54 + static inline void set_tls(unsigned long val) 55 + { 56 + struct thread_info *thread; 57 + 58 + thread = current_thread_info(); 59 + 60 + thread->tp_value[0] = val; 61 + 62 + /* 63 + * This code runs with preemption enabled and therefore must 64 + * be reentrant with respect to switch_tls. 65 + * 66 + * We need to ensure ordering between the shadow state and the 67 + * hardware state, so that we don't corrupt the hardware state 68 + * with a stale shadow state during context switch. 69 + * 70 + * If we're preempted here, switch_tls will load TPIDRURO from 71 + * thread_info upon resuming execution and the following mcr 72 + * is merely redundant. 73 + */ 74 + barrier(); 75 + 76 + if (!tls_emu) { 77 + if (has_tls_reg) { 78 + asm("mcr p15, 0, %0, c13, c0, 3" 79 + : : "r" (val)); 80 + } else { 81 + /* 82 + * User space must never try to access this 83 + * directly. Expect your app to break 84 + * eventually if you do so. The user helper 85 + * at 0xffff0fe0 must be used instead. (see 86 + * entry-armv.S for details) 87 + */ 88 + *((unsigned int *)0xffff0ff0) = val; 89 + } 90 + 91 + } 92 + } 93 + 56 94 static inline unsigned long get_tpuser(void) 57 95 { 58 96 unsigned long reg = 0; ··· 103 59 104 60 return reg; 105 61 } 62 + 63 + static inline void set_tpuser(unsigned long val) 64 + { 65 + /* Since TPIDRURW is fully context-switched (unlike TPIDRURO), 66 + * we need not update thread_info. 67 + */ 68 + if (has_tls_reg && !tls_emu) { 69 + asm("mcr p15, 0, %0, c13, c0, 2" 70 + : : "r" (val)); 71 + } 72 + } 73 + 74 + static inline void flush_tls(void) 75 + { 76 + set_tls(0); 77 + set_tpuser(0); 78 + } 79 + 106 80 #endif 107 81 #endif /* __ASMARM_TLS_H */
+39 -9
arch/arm/include/asm/uaccess.h
··· 107 107 extern int __get_user_1(void *); 108 108 extern int __get_user_2(void *); 109 109 extern int __get_user_4(void *); 110 - extern int __get_user_lo8(void *); 110 + extern int __get_user_32t_8(void *); 111 111 extern int __get_user_8(void *); 112 + extern int __get_user_64t_1(void *); 113 + extern int __get_user_64t_2(void *); 114 + extern int __get_user_64t_4(void *); 112 115 113 116 #define __GUP_CLOBBER_1 "lr", "cc" 114 117 #ifdef CONFIG_CPU_USE_DOMAINS ··· 120 117 #define __GUP_CLOBBER_2 "lr", "cc" 121 118 #endif 122 119 #define __GUP_CLOBBER_4 "lr", "cc" 123 - #define __GUP_CLOBBER_lo8 "lr", "cc" 120 + #define __GUP_CLOBBER_32t_8 "lr", "cc" 124 121 #define __GUP_CLOBBER_8 "lr", "cc" 125 122 126 123 #define __get_user_x(__r2,__p,__e,__l,__s) \ ··· 134 131 135 132 /* narrowing a double-word get into a single 32bit word register: */ 136 133 #ifdef __ARMEB__ 137 - #define __get_user_xb(__r2, __p, __e, __l, __s) \ 138 - __get_user_x(__r2, __p, __e, __l, lo8) 134 + #define __get_user_x_32t(__r2, __p, __e, __l, __s) \ 135 + __get_user_x(__r2, __p, __e, __l, 32t_8) 139 136 #else 140 - #define __get_user_xb __get_user_x 137 + #define __get_user_x_32t __get_user_x 141 138 #endif 139 + 140 + /* 141 + * storing result into proper least significant word of 64bit target var, 142 + * different only for big endian case where 64 bit __r2 lsw is r3: 143 + */ 144 + #ifdef __ARMEB__ 145 + #define __get_user_x_64t(__r2, __p, __e, __l, __s) \ 146 + __asm__ __volatile__ ( \ 147 + __asmeq("%0", "r0") __asmeq("%1", "r2") \ 148 + __asmeq("%3", "r1") \ 149 + "bl __get_user_64t_" #__s \ 150 + : "=&r" (__e), "=r" (__r2) \ 151 + : "0" (__p), "r" (__l) \ 152 + : __GUP_CLOBBER_##__s) 153 + #else 154 + #define __get_user_x_64t __get_user_x 155 + #endif 156 + 142 157 143 158 #define __get_user_check(x,p) \ 144 159 ({ \ ··· 167 146 register int __e asm("r0"); \ 168 147 switch (sizeof(*(__p))) { \ 169 148 case 1: \ 170 - __get_user_x(__r2, __p, __e, __l, 1); \ 149 + if (sizeof((x)) >= 8) \ 150 + __get_user_x_64t(__r2, __p, __e, __l, 1); \ 151 + else \ 152 + __get_user_x(__r2, __p, __e, __l, 1); \ 171 153 break; \ 172 154 case 2: \ 173 - __get_user_x(__r2, __p, __e, __l, 2); \ 155 + if (sizeof((x)) >= 8) \ 156 + __get_user_x_64t(__r2, __p, __e, __l, 2); \ 157 + else \ 158 + __get_user_x(__r2, __p, __e, __l, 2); \ 174 159 break; \ 175 160 case 4: \ 176 - __get_user_x(__r2, __p, __e, __l, 4); \ 161 + if (sizeof((x)) >= 8) \ 162 + __get_user_x_64t(__r2, __p, __e, __l, 4); \ 163 + else \ 164 + __get_user_x(__r2, __p, __e, __l, 4); \ 177 165 break; \ 178 166 case 8: \ 179 167 if (sizeof((x)) < 8) \ 180 - __get_user_xb(__r2, __p, __e, __l, 4); \ 168 + __get_user_x_32t(__r2, __p, __e, __l, 4); \ 181 169 else \ 182 170 __get_user_x(__r2, __p, __e, __l, 8); \ 183 171 break; \
+8
arch/arm/kernel/armksyms.c
··· 98 98 EXPORT_SYMBOL(__get_user_1); 99 99 EXPORT_SYMBOL(__get_user_2); 100 100 EXPORT_SYMBOL(__get_user_4); 101 + EXPORT_SYMBOL(__get_user_8); 102 + 103 + #ifdef __ARMEB__ 104 + EXPORT_SYMBOL(__get_user_64t_1); 105 + EXPORT_SYMBOL(__get_user_64t_2); 106 + EXPORT_SYMBOL(__get_user_64t_4); 107 + EXPORT_SYMBOL(__get_user_32t_8); 108 + #endif 101 109 102 110 EXPORT_SYMBOL(__put_user_1); 103 111 EXPORT_SYMBOL(__put_user_2);
+1 -1
arch/arm/kernel/irq.c
··· 175 175 c = irq_data_get_irq_chip(d); 176 176 if (!c->irq_set_affinity) 177 177 pr_debug("IRQ%u: unable to set affinity\n", d->irq); 178 - else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret) 178 + else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret) 179 179 cpumask_copy(d->affinity, affinity); 180 180 181 181 return ret;
+4 -10
arch/arm/kernel/perf_event_cpu.c
··· 76 76 77 77 static void cpu_pmu_enable_percpu_irq(void *data) 78 78 { 79 - struct arm_pmu *cpu_pmu = data; 80 - struct platform_device *pmu_device = cpu_pmu->plat_device; 81 - int irq = platform_get_irq(pmu_device, 0); 79 + int irq = *(int *)data; 82 80 83 81 enable_percpu_irq(irq, IRQ_TYPE_NONE); 84 - cpumask_set_cpu(smp_processor_id(), &cpu_pmu->active_irqs); 85 82 } 86 83 87 84 static void cpu_pmu_disable_percpu_irq(void *data) 88 85 { 89 - struct arm_pmu *cpu_pmu = data; 90 - struct platform_device *pmu_device = cpu_pmu->plat_device; 91 - int irq = platform_get_irq(pmu_device, 0); 86 + int irq = *(int *)data; 92 87 93 - cpumask_clear_cpu(smp_processor_id(), &cpu_pmu->active_irqs); 94 88 disable_percpu_irq(irq); 95 89 } 96 90 ··· 97 103 98 104 irq = platform_get_irq(pmu_device, 0); 99 105 if (irq >= 0 && irq_is_percpu(irq)) { 100 - on_each_cpu(cpu_pmu_disable_percpu_irq, cpu_pmu, 1); 106 + on_each_cpu(cpu_pmu_disable_percpu_irq, &irq, 1); 101 107 free_percpu_irq(irq, &percpu_pmu); 102 108 } else { 103 109 for (i = 0; i < irqs; ++i) { ··· 132 138 irq); 133 139 return err; 134 140 } 135 - on_each_cpu(cpu_pmu_enable_percpu_irq, cpu_pmu, 1); 141 + on_each_cpu(cpu_pmu_enable_percpu_irq, &irq, 1); 136 142 } else { 137 143 for (i = 0; i < irqs; ++i) { 138 144 err = 0;
+2
arch/arm/kernel/process.c
··· 334 334 memset(&tsk->thread.debug, 0, sizeof(struct debug_info)); 335 335 memset(&thread->fpstate, 0, sizeof(union fp_state)); 336 336 337 + flush_tls(); 338 + 337 339 thread_notify(THREAD_NOTIFY_FLUSH, thread); 338 340 } 339 341
-15
arch/arm/kernel/swp_emulate.c
··· 142 142 while (1) { 143 143 unsigned long temp; 144 144 145 - /* 146 - * Barrier required between accessing protected resource and 147 - * releasing a lock for it. Legacy code might not have done 148 - * this, and we cannot determine that this is not the case 149 - * being emulated, so insert always. 150 - */ 151 - smp_mb(); 152 - 153 145 if (type == TYPE_SWPB) 154 146 __user_swpb_asm(*data, address, res, temp); 155 147 else ··· 154 162 } 155 163 156 164 if (res == 0) { 157 - /* 158 - * Barrier also required between acquiring a lock for a 159 - * protected resource and accessing the resource. Inserted for 160 - * same reason as above. 161 - */ 162 - smp_mb(); 163 - 164 165 if (type == TYPE_SWPB) 165 166 swpbcounter++; 166 167 else
+1 -1
arch/arm/kernel/thumbee.c
··· 45 45 46 46 switch (cmd) { 47 47 case THREAD_NOTIFY_FLUSH: 48 - thread->thumbee_state = 0; 48 + teehbr_write(0); 49 49 break; 50 50 case THREAD_NOTIFY_SWITCH: 51 51 current_thread_info()->thumbee_state = teehbr_read();
+1 -16
arch/arm/kernel/traps.c
··· 581 581 #define NR(x) ((__ARM_NR_##x) - __ARM_NR_BASE) 582 582 asmlinkage int arm_syscall(int no, struct pt_regs *regs) 583 583 { 584 - struct thread_info *thread = current_thread_info(); 585 584 siginfo_t info; 586 585 587 586 if ((no >> 16) != (__ARM_NR_BASE>> 16)) ··· 631 632 return regs->ARM_r0; 632 633 633 634 case NR(set_tls): 634 - thread->tp_value[0] = regs->ARM_r0; 635 - if (tls_emu) 636 - return 0; 637 - if (has_tls_reg) { 638 - asm ("mcr p15, 0, %0, c13, c0, 3" 639 - : : "r" (regs->ARM_r0)); 640 - } else { 641 - /* 642 - * User space must never try to access this directly. 643 - * Expect your app to break eventually if you do so. 644 - * The user helper at 0xffff0fe0 must be used instead. 645 - * (see entry-armv.S for details) 646 - */ 647 - *((unsigned int *)0xffff0ff0) = regs->ARM_r0; 648 - } 635 + set_tls(regs->ARM_r0); 649 636 return 0; 650 637 651 638 #ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG
+36 -2
arch/arm/lib/getuser.S
··· 80 80 ENDPROC(__get_user_8) 81 81 82 82 #ifdef __ARMEB__ 83 - ENTRY(__get_user_lo8) 83 + ENTRY(__get_user_32t_8) 84 84 check_uaccess r0, 8, r1, r2, __get_user_bad 85 85 #ifdef CONFIG_CPU_USE_DOMAINS 86 86 add r0, r0, #4 ··· 90 90 #endif 91 91 mov r0, #0 92 92 ret lr 93 - ENDPROC(__get_user_lo8) 93 + ENDPROC(__get_user_32t_8) 94 + 95 + ENTRY(__get_user_64t_1) 96 + check_uaccess r0, 1, r1, r2, __get_user_bad8 97 + 8: TUSER(ldrb) r3, [r0] 98 + mov r0, #0 99 + ret lr 100 + ENDPROC(__get_user_64t_1) 101 + 102 + ENTRY(__get_user_64t_2) 103 + check_uaccess r0, 2, r1, r2, __get_user_bad8 104 + #ifdef CONFIG_CPU_USE_DOMAINS 105 + rb .req ip 106 + 9: ldrbt r3, [r0], #1 107 + 10: ldrbt rb, [r0], #0 108 + #else 109 + rb .req r0 110 + 9: ldrb r3, [r0] 111 + 10: ldrb rb, [r0, #1] 112 + #endif 113 + orr r3, rb, r3, lsl #8 114 + mov r0, #0 115 + ret lr 116 + ENDPROC(__get_user_64t_2) 117 + 118 + ENTRY(__get_user_64t_4) 119 + check_uaccess r0, 4, r1, r2, __get_user_bad8 120 + 11: TUSER(ldr) r3, [r0] 121 + mov r0, #0 122 + ret lr 123 + ENDPROC(__get_user_64t_4) 94 124 #endif 95 125 96 126 __get_user_bad8: ··· 141 111 .long 6b, __get_user_bad8 142 112 #ifdef __ARMEB__ 143 113 .long 7b, __get_user_bad 114 + .long 8b, __get_user_bad8 115 + .long 9b, __get_user_bad8 116 + .long 10b, __get_user_bad8 117 + .long 11b, __get_user_bad8 144 118 #endif 145 119 .popsection
-1
arch/arm/mm/proc-v7-3level.S
··· 146 146 mov \tmp, \ttbr1, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits 147 147 mov \ttbr1, \ttbr1, lsl #ARCH_PGD_SHIFT @ lower bits 148 148 addls \ttbr1, \ttbr1, #TTBR1_OFFSET 149 - adcls \tmp, \tmp, #0 150 149 mcrr p15, 1, \ttbr1, \tmp, c2 @ load TTBR1 151 150 mov \tmp, \ttbr0, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits 152 151 mov \ttbr0, \ttbr0, lsl #ARCH_PGD_SHIFT @ lower bits
+1 -2
arch/arm64/mm/init.c
··· 149 149 memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start); 150 150 #endif 151 151 152 - if (!efi_enabled(EFI_MEMMAP)) 153 - early_init_fdt_scan_reserved_mem(); 152 + early_init_fdt_scan_reserved_mem(); 154 153 155 154 /* 4GB maximum for 32-bit only capable devices */ 156 155 if (IS_ENABLED(CONFIG_ZONE_DMA))
+1 -1
arch/ia64/include/uapi/asm/unistd.h
··· 329 329 #define __NR_sched_getattr 1337 330 330 #define __NR_renameat2 1338 331 331 #define __NR_getrandom 1339 332 - #define __NR_memfd_create 1339 332 + #define __NR_memfd_create 1340 333 333 334 334 #endif /* _UAPI_ASM_IA64_UNISTD_H */
+1 -23
arch/ia64/pci/fixup.c
··· 38 38 return; 39 39 /* Maybe, this machine supports legacy memory map. */ 40 40 41 - if (!vga_default_device()) { 42 - resource_size_t start, end; 43 - int i; 44 - 45 - /* Does firmware framebuffer belong to us? */ 46 - for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 47 - if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM)) 48 - continue; 49 - 50 - start = pci_resource_start(pdev, i); 51 - end = pci_resource_end(pdev, i); 52 - 53 - if (!start || !end) 54 - continue; 55 - 56 - if (screen_info.lfb_base >= start && 57 - (screen_info.lfb_base + screen_info.lfb_size) < end) 58 - vga_set_default_device(pdev); 59 - } 60 - } 61 - 62 41 /* Is VGA routed to us? */ 63 42 bus = pdev->bus; 64 43 while (bus) { ··· 62 83 pci_read_config_word(pdev, PCI_COMMAND, &config); 63 84 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { 64 85 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; 65 - dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); 66 - vga_set_default_device(pdev); 86 + dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n"); 67 87 } 68 88 } 69 89 }
+3
arch/mips/Kconfig
··· 546 546 # select SYS_HAS_EARLY_PRINTK 547 547 select SYS_SUPPORTS_64BIT_KERNEL 548 548 select SYS_SUPPORTS_BIG_ENDIAN 549 + select MIPS_L1_CACHE_SHIFT_7 549 550 help 550 551 This is the SGI Indigo2 with R10000 processor. To compile a Linux 551 552 kernel that runs on these, say Y here. ··· 2030 2029 bool "MIPS CMP framework support (DEPRECATED)" 2031 2030 depends on SYS_SUPPORTS_MIPS_CMP 2032 2031 select MIPS_GIC_IPI 2032 + select SMP 2033 2033 select SYNC_R4K 2034 + select SYS_SUPPORTS_SMP 2034 2035 select WEAK_ORDERING 2035 2036 default n 2036 2037 help
+10 -1
arch/mips/Makefile
··· 113 113 cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be)) 114 114 cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le)) 115 115 116 - cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) 116 + # For smartmips configurations, there are hundreds of warnings due to ISA overrides 117 + # in assembly and header files. smartmips is only supported for MIPS32r1 onwards 118 + # and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or 119 + # similar directives in the kernel will spam the build logs with the following warnings: 120 + # Warning: the `smartmips' extension requires MIPS32 revision 1 or greater 121 + # or 122 + # Warning: the 64-bit MIPS architecture does not support the `smartmips' extension 123 + # Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has 124 + # been fixed properly. 125 + cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) -Wa,--no-warn 117 126 cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips) 118 127 119 128 cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \
+2 -2
arch/mips/bcm63xx/irq.c
··· 434 434 irq_stat_addr[0] += PERF_IRQSTAT_3368_REG; 435 435 irq_mask_addr[0] += PERF_IRQMASK_3368_REG; 436 436 irq_stat_addr[1] = 0; 437 - irq_stat_addr[1] = 0; 437 + irq_mask_addr[1] = 0; 438 438 irq_bits = 32; 439 439 ext_irq_count = 4; 440 440 ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368; ··· 443 443 irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0); 444 444 irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0); 445 445 irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1); 446 - irq_stat_addr[1] += PERF_IRQMASK_6328_REG(1); 446 + irq_mask_addr[1] += PERF_IRQMASK_6328_REG(1); 447 447 irq_bits = 64; 448 448 ext_irq_count = 4; 449 449 is_ext_irq_cascaded = 1;
+1
arch/mips/boot/compressed/decompress.c
··· 13 13 14 14 #include <linux/types.h> 15 15 #include <linux/kernel.h> 16 + #include <linux/string.h> 16 17 17 18 #include <asm/addrspace.h> 18 19
+9 -9
arch/mips/include/asm/cop2.h
··· 16 16 extern void octeon_cop2_save(struct octeon_cop2_state *); 17 17 extern void octeon_cop2_restore(struct octeon_cop2_state *); 18 18 19 - #define cop2_save(r) octeon_cop2_save(r) 20 - #define cop2_restore(r) octeon_cop2_restore(r) 19 + #define cop2_save(r) octeon_cop2_save(&(r)->thread.cp2) 20 + #define cop2_restore(r) octeon_cop2_restore(&(r)->thread.cp2) 21 21 22 22 #define cop2_present 1 23 23 #define cop2_lazy_restore 1 ··· 26 26 27 27 extern void nlm_cop2_save(struct nlm_cop2_state *); 28 28 extern void nlm_cop2_restore(struct nlm_cop2_state *); 29 - #define cop2_save(r) nlm_cop2_save(r) 30 - #define cop2_restore(r) nlm_cop2_restore(r) 29 + 30 + #define cop2_save(r) nlm_cop2_save(&(r)->thread.cp2) 31 + #define cop2_restore(r) nlm_cop2_restore(&(r)->thread.cp2) 31 32 32 33 #define cop2_present 1 33 34 #define cop2_lazy_restore 0 34 35 35 36 #elif defined(CONFIG_CPU_LOONGSON3) 36 37 37 - #define cop2_save(r) 38 - #define cop2_restore(r) 39 - 40 38 #define cop2_present 1 41 39 #define cop2_lazy_restore 1 40 + #define cop2_save(r) do { (r); } while (0) 41 + #define cop2_restore(r) do { (r); } while (0) 42 42 43 43 #else 44 44 45 45 #define cop2_present 0 46 46 #define cop2_lazy_restore 0 47 - #define cop2_save(r) 48 - #define cop2_restore(r) 47 + #define cop2_save(r) do { (r); } while (0) 48 + #define cop2_restore(r) do { (r); } while (0) 49 49 #endif 50 50 51 51 enum cu2_ops {
-7
arch/mips/include/asm/mach-ip28/spaces.h
··· 11 11 #ifndef _ASM_MACH_IP28_SPACES_H 12 12 #define _ASM_MACH_IP28_SPACES_H 13 13 14 - #define CAC_BASE _AC(0xa800000000000000, UL) 15 - 16 - #define HIGHMEM_START (~0UL) 17 - 18 14 #define PHYS_OFFSET _AC(0x20000000, UL) 19 - 20 - #define UNCAC_BASE _AC(0xc0000000, UL) /* 0xa0000000 + PHYS_OFFSET */ 21 - #define IO_BASE UNCAC_BASE 22 15 23 16 #include <asm/mach-generic/spaces.h> 24 17
+3 -2
arch/mips/include/asm/page.h
··· 37 37 38 38 /* 39 39 * This is used for calculating the real page sizes 40 - * for FTLB or VTLB + FTLB confugrations. 40 + * for FTLB or VTLB + FTLB configurations. 41 41 */ 42 42 static inline unsigned int page_size_ftlb(unsigned int mmuextdef) 43 43 { ··· 223 223 224 224 #endif 225 225 226 - #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) 226 + #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \ 227 + (kaddr)))) 227 228 228 229 extern int __virt_addr_valid(const volatile void *kaddr); 229 230 #define virt_addr_valid(kaddr) \
-5
arch/mips/include/asm/smp.h
··· 37 37 38 38 #define NO_PROC_ID (-1) 39 39 40 - #define topology_physical_package_id(cpu) (cpu_data[cpu].package) 41 - #define topology_core_id(cpu) (cpu_data[cpu].core) 42 - #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) 43 - #define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu]) 44 - 45 40 #define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */ 46 41 #define SMP_CALL_FUNCTION 0x2 47 42 /* Octeon - Tell another core to flush its icache */
+2 -2
arch/mips/include/asm/switch_to.h
··· 92 92 KSTK_STATUS(prev) &= ~ST0_CU2; \ 93 93 __c0_stat = read_c0_status(); \ 94 94 write_c0_status(__c0_stat | ST0_CU2); \ 95 - cop2_save(&prev->thread.cp2); \ 95 + cop2_save(prev); \ 96 96 write_c0_status(__c0_stat & ~ST0_CU2); \ 97 97 } \ 98 98 __clear_software_ll_bit(); \ ··· 111 111 (KSTK_STATUS(current) & ST0_CU2)) { \ 112 112 __c0_stat = read_c0_status(); \ 113 113 write_c0_status(__c0_stat | ST0_CU2); \ 114 - cop2_restore(&current->thread.cp2); \ 114 + cop2_restore(current); \ 115 115 write_c0_status(__c0_stat & ~ST0_CU2); \ 116 116 } \ 117 117 if (cpu_has_dsp) \
+8
arch/mips/include/asm/topology.h
··· 9 9 #define __ASM_TOPOLOGY_H 10 10 11 11 #include <topology.h> 12 + #include <linux/smp.h> 13 + 14 + #ifdef CONFIG_SMP 15 + #define topology_physical_package_id(cpu) (cpu_data[cpu].package) 16 + #define topology_core_id(cpu) (cpu_data[cpu].core) 17 + #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) 18 + #define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu]) 19 + #endif 12 20 13 21 #endif /* __ASM_TOPOLOGY_H */
+12 -6
arch/mips/include/uapi/asm/unistd.h
··· 373 373 #define __NR_sched_getattr (__NR_Linux + 350) 374 374 #define __NR_renameat2 (__NR_Linux + 351) 375 375 #define __NR_seccomp (__NR_Linux + 352) 376 + #define __NR_getrandom (__NR_Linux + 353) 377 + #define __NR_memfd_create (__NR_Linux + 354) 376 378 377 379 /* 378 380 * Offset of the last Linux o32 flavoured syscall 379 381 */ 380 - #define __NR_Linux_syscalls 352 382 + #define __NR_Linux_syscalls 354 381 383 382 384 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 383 385 384 386 #define __NR_O32_Linux 4000 385 - #define __NR_O32_Linux_syscalls 352 387 + #define __NR_O32_Linux_syscalls 354 386 388 387 389 #if _MIPS_SIM == _MIPS_SIM_ABI64 388 390 ··· 705 703 #define __NR_sched_getattr (__NR_Linux + 310) 706 704 #define __NR_renameat2 (__NR_Linux + 311) 707 705 #define __NR_seccomp (__NR_Linux + 312) 706 + #define __NR_getrandom (__NR_Linux + 313) 707 + #define __NR_memfd_create (__NR_Linux + 314) 708 708 709 709 /* 710 710 * Offset of the last Linux 64-bit flavoured syscall 711 711 */ 712 - #define __NR_Linux_syscalls 312 712 + #define __NR_Linux_syscalls 314 713 713 714 714 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 715 715 716 716 #define __NR_64_Linux 5000 717 - #define __NR_64_Linux_syscalls 312 717 + #define __NR_64_Linux_syscalls 314 718 718 719 719 #if _MIPS_SIM == _MIPS_SIM_NABI32 720 720 ··· 1041 1037 #define __NR_sched_getattr (__NR_Linux + 314) 1042 1038 #define __NR_renameat2 (__NR_Linux + 315) 1043 1039 #define __NR_seccomp (__NR_Linux + 316) 1040 + #define __NR_getrandom (__NR_Linux + 317) 1041 + #define __NR_memfd_create (__NR_Linux + 318) 1044 1042 1045 1043 /* 1046 1044 * Offset of the last N32 flavoured syscall 1047 1045 */ 1048 - #define __NR_Linux_syscalls 316 1046 + #define __NR_Linux_syscalls 318 1049 1047 1050 1048 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 1051 1049 1052 1050 #define __NR_N32_Linux 6000 1053 - #define __NR_N32_Linux_syscalls 316 1051 + #define __NR_N32_Linux_syscalls 318 1054 1052 1055 1053 #endif /* _UAPI_ASM_UNISTD_H */
+6 -2
arch/mips/kernel/machine_kexec.c
··· 71 71 kexec_start_address = 72 72 (unsigned long) phys_to_virt(image->start); 73 73 74 - kexec_indirection_page = 75 - (unsigned long) phys_to_virt(image->head & PAGE_MASK); 74 + if (image->type == KEXEC_TYPE_DEFAULT) { 75 + kexec_indirection_page = 76 + (unsigned long) phys_to_virt(image->head & PAGE_MASK); 77 + } else { 78 + kexec_indirection_page = (unsigned long)&image->head; 79 + } 76 80 77 81 memcpy((void*)reboot_code_buffer, relocate_new_kernel, 78 82 relocate_new_kernel_size);
+2
arch/mips/kernel/scall32-o32.S
··· 577 577 PTR sys_sched_getattr /* 4350 */ 578 578 PTR sys_renameat2 579 579 PTR sys_seccomp 580 + PTR sys_getrandom 581 + PTR sys_memfd_create
+2
arch/mips/kernel/scall64-64.S
··· 432 432 PTR sys_sched_getattr /* 5310 */ 433 433 PTR sys_renameat2 434 434 PTR sys_seccomp 435 + PTR sys_getrandom 436 + PTR sys_memfd_create 435 437 .size sys_call_table,.-sys_call_table
+2
arch/mips/kernel/scall64-n32.S
··· 425 425 PTR sys_sched_getattr 426 426 PTR sys_renameat2 /* 6315 */ 427 427 PTR sys_seccomp 428 + PTR sys_getrandom 429 + PTR sys_memfd_create 428 430 .size sysn32_call_table,.-sysn32_call_table
+2
arch/mips/kernel/scall64-o32.S
··· 562 562 PTR sys_sched_getattr /* 4350 */ 563 563 PTR sys_renameat2 564 564 PTR sys_seccomp 565 + PTR sys_getrandom 566 + PTR sys_memfd_create 565 567 .size sys32_call_table,.-sys32_call_table
+3 -2
arch/mips/net/bpf_jit.c
··· 793 793 const struct sock_filter *inst; 794 794 unsigned int i, off, load_order, condt; 795 795 u32 k, b_off __maybe_unused; 796 + int tmp; 796 797 797 798 for (i = 0; i < prog->len; i++) { 798 799 u16 code; ··· 1333 1332 case BPF_ANC | SKF_AD_PKTTYPE: 1334 1333 ctx->flags |= SEEN_SKB; 1335 1334 1336 - off = pkt_type_offset(); 1335 + tmp = off = pkt_type_offset(); 1337 1336 1338 - if (off < 0) 1337 + if (tmp < 0) 1339 1338 return -1; 1340 1339 emit_load_byte(r_tmp, r_skb, off, ctx); 1341 1340 /* Keep only the last 3 bits */
+11 -7
arch/x86/boot/compressed/eboot.c
··· 1032 1032 int i; 1033 1033 unsigned long ramdisk_addr; 1034 1034 unsigned long ramdisk_size; 1035 - unsigned long initrd_addr_max; 1036 1035 1037 1036 efi_early = c; 1038 1037 sys_table = (efi_system_table_t *)(unsigned long)efi_early->table; ··· 1094 1095 1095 1096 memset(sdt, 0, sizeof(*sdt)); 1096 1097 1097 - if (hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) 1098 - initrd_addr_max = -1UL; 1099 - else 1100 - initrd_addr_max = hdr->initrd_addr_max; 1101 - 1102 1098 status = handle_cmdline_files(sys_table, image, 1103 1099 (char *)(unsigned long)hdr->cmd_line_ptr, 1104 - "initrd=", initrd_addr_max, 1100 + "initrd=", hdr->initrd_addr_max, 1105 1101 &ramdisk_addr, &ramdisk_size); 1102 + 1103 + if (status != EFI_SUCCESS && 1104 + hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) { 1105 + efi_printk(sys_table, "Trying to load files to higher address\n"); 1106 + status = handle_cmdline_files(sys_table, image, 1107 + (char *)(unsigned long)hdr->cmd_line_ptr, 1108 + "initrd=", -1UL, 1109 + &ramdisk_addr, &ramdisk_size); 1110 + } 1111 + 1106 1112 if (status != EFI_SUCCESS) 1107 1113 goto fail2; 1108 1114 hdr->ramdisk_image = ramdisk_addr & 0xffffffff;
+40 -14
arch/x86/boot/compressed/head_32.S
··· 30 30 #include <asm/boot.h> 31 31 #include <asm/asm-offsets.h> 32 32 33 + /* 34 + * Adjust our own GOT 35 + * 36 + * The relocation base must be in %ebx 37 + * 38 + * It is safe to call this macro more than once, because in some of the 39 + * code paths multiple invocations are inevitable, e.g. via the efi* 40 + * entry points. 41 + * 42 + * Relocation is only performed the first time. 43 + */ 44 + .macro FIXUP_GOT 45 + cmpb $1, got_fixed(%ebx) 46 + je 2f 47 + 48 + leal _got(%ebx), %edx 49 + leal _egot(%ebx), %ecx 50 + 1: 51 + cmpl %ecx, %edx 52 + jae 2f 53 + addl %ebx, (%edx) 54 + addl $4, %edx 55 + jmp 1b 56 + 2: 57 + movb $1, got_fixed(%ebx) 58 + .endm 59 + 33 60 __HEAD 34 61 ENTRY(startup_32) 35 62 #ifdef CONFIG_EFI_STUB ··· 83 56 add %esi, 88(%eax) 84 57 pushl %eax 85 58 59 + movl %esi, %ebx 60 + FIXUP_GOT 61 + 86 62 call make_boot_params 87 63 cmpl $0, %eax 88 64 je fail ··· 111 81 leal efi32_config(%esi), %eax 112 82 add %esi, 88(%eax) 113 83 pushl %eax 84 + 85 + movl %esi, %ebx 86 + FIXUP_GOT 87 + 114 88 2: 115 89 call efi_main 116 90 cmpl $0, %eax ··· 224 190 shrl $2, %ecx 225 191 rep stosl 226 192 227 - /* 228 - * Adjust our own GOT 229 - */ 230 - leal _got(%ebx), %edx 231 - leal _egot(%ebx), %ecx 232 - 1: 233 - cmpl %ecx, %edx 234 - jae 2f 235 - addl %ebx, (%edx) 236 - addl $4, %edx 237 - jmp 1b 238 - 2: 239 - 193 + FIXUP_GOT 240 194 /* 241 195 * Do the decompression, and jump to the new kernel.. 242 196 */ ··· 247 225 xorl %ebx, %ebx 248 226 jmp *%eax 249 227 250 - #ifdef CONFIG_EFI_STUB 251 228 .data 229 + /* Have we relocated the GOT? */ 230 + got_fixed: 231 + .byte 0 232 + 233 + #ifdef CONFIG_EFI_STUB 252 234 efi32_config: 253 235 .fill 11,8,0 254 236 .long efi_call_phys
+41 -15
arch/x86/boot/compressed/head_64.S
··· 32 32 #include <asm/processor-flags.h> 33 33 #include <asm/asm-offsets.h> 34 34 35 + /* 36 + * Adjust our own GOT 37 + * 38 + * The relocation base must be in %rbx 39 + * 40 + * It is safe to call this macro more than once, because in some of the 41 + * code paths multiple invocations are inevitable, e.g. via the efi* 42 + * entry points. 43 + * 44 + * Relocation is only performed the first time. 45 + */ 46 + .macro FIXUP_GOT 47 + cmpb $1, got_fixed(%rip) 48 + je 2f 49 + 50 + leaq _got(%rip), %rdx 51 + leaq _egot(%rip), %rcx 52 + 1: 53 + cmpq %rcx, %rdx 54 + jae 2f 55 + addq %rbx, (%rdx) 56 + addq $8, %rdx 57 + jmp 1b 58 + 2: 59 + movb $1, got_fixed(%rip) 60 + .endm 61 + 35 62 __HEAD 36 63 .code32 37 64 ENTRY(startup_32) ··· 279 252 subq $1b, %rbp 280 253 281 254 /* 282 - * Relocate efi_config->call(). 255 + * Relocate efi_config->call() and the GOT entries. 283 256 */ 284 257 addq %rbp, efi64_config+88(%rip) 258 + 259 + movq %rbp, %rbx 260 + FIXUP_GOT 285 261 286 262 movq %rax, %rdi 287 263 call make_boot_params ··· 301 271 subq $1b, %rbp 302 272 303 273 /* 304 - * Relocate efi_config->call(). 274 + * Relocate efi_config->call() and the GOT entries. 305 275 */ 306 276 movq efi_config(%rip), %rax 307 277 addq %rbp, 88(%rax) 278 + 279 + movq %rbp, %rbx 280 + FIXUP_GOT 308 281 2: 309 282 movq efi_config(%rip), %rdi 310 283 call efi_main ··· 418 385 shrq $3, %rcx 419 386 rep stosq 420 387 421 - /* 422 - * Adjust our own GOT 423 - */ 424 - leaq _got(%rip), %rdx 425 - leaq _egot(%rip), %rcx 426 - 1: 427 - cmpq %rcx, %rdx 428 - jae 2f 429 - addq %rbx, (%rdx) 430 - addq $8, %rdx 431 - jmp 1b 432 - 2: 433 - 388 + FIXUP_GOT 389 + 434 390 /* 435 391 * Do the decompression, and jump to the new kernel.. 436 392 */ ··· 458 436 .quad 0x0080890000000000 /* TS descriptor */ 459 437 .quad 0x0000000000000000 /* TS continued */ 460 438 gdt_end: 439 + 440 + /* Have we relocated the GOT? */ 441 + got_fixed: 442 + .byte 0 461 443 462 444 #ifdef CONFIG_EFI_STUB 463 445 efi_config:
+1
arch/x86/include/asm/io_apic.h
··· 239 239 static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; } 240 240 static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags) { return gsi; } 241 241 static inline void mp_unmap_irq(int irq) { } 242 + static inline bool mp_should_keep_irq(struct device *dev) { return 1; } 242 243 243 244 static inline int save_ioapic_entries(void) 244 245 {
+3 -1
arch/x86/kernel/kprobes/opt.c
··· 338 338 * a relative jump. 339 339 */ 340 340 rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE; 341 - if (abs(rel) > 0x7fffffff) 341 + if (abs(rel) > 0x7fffffff) { 342 + __arch_remove_optimized_kprobe(op, 0); 342 343 return -ERANGE; 344 + } 343 345 344 346 buf = (u8 *)op->optinsn.insn; 345 347
+4
arch/x86/mm/dump_pagetables.c
··· 48 48 LOW_KERNEL_NR, 49 49 VMALLOC_START_NR, 50 50 VMEMMAP_START_NR, 51 + # ifdef CONFIG_X86_ESPFIX64 51 52 ESPFIX_START_NR, 53 + # endif 52 54 HIGH_KERNEL_NR, 53 55 MODULES_VADDR_NR, 54 56 MODULES_END_NR, ··· 73 71 { PAGE_OFFSET, "Low Kernel Mapping" }, 74 72 { VMALLOC_START, "vmalloc() Area" }, 75 73 { VMEMMAP_START, "Vmemmap" }, 74 + # ifdef CONFIG_X86_ESPFIX64 76 75 { ESPFIX_BASE_ADDR, "ESPfix Area", 16 }, 76 + # endif 77 77 { __START_KERNEL_map, "High Kernel Mapping" }, 78 78 { MODULES_VADDR, "Modules" }, 79 79 { MODULES_END, "End Modules" },
+1 -1
arch/x86/mm/mmap.c
··· 31 31 #include <linux/sched.h> 32 32 #include <asm/elf.h> 33 33 34 - struct __read_mostly va_alignment va_align = { 34 + struct va_alignment __read_mostly va_align = { 35 35 .flags = -1, 36 36 }; 37 37
+1 -23
arch/x86/pci/fixup.c
··· 326 326 struct pci_bus *bus; 327 327 u16 config; 328 328 329 - if (!vga_default_device()) { 330 - resource_size_t start, end; 331 - int i; 332 - 333 - /* Does firmware framebuffer belong to us? */ 334 - for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 335 - if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM)) 336 - continue; 337 - 338 - start = pci_resource_start(pdev, i); 339 - end = pci_resource_end(pdev, i); 340 - 341 - if (!start || !end) 342 - continue; 343 - 344 - if (screen_info.lfb_base >= start && 345 - (screen_info.lfb_base + screen_info.lfb_size) < end) 346 - vga_set_default_device(pdev); 347 - } 348 - } 349 - 350 329 /* Is VGA routed to us? */ 351 330 bus = pdev->bus; 352 331 while (bus) { ··· 350 371 pci_read_config_word(pdev, PCI_COMMAND, &config); 351 372 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { 352 373 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; 353 - dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); 354 - vga_set_default_device(pdev); 374 + dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n"); 355 375 } 356 376 } 357 377 }
-3
crypto/drbg.c
··· 1922 1922 /* overflow max addtllen with personalization string */ 1923 1923 ret = drbg_instantiate(drbg, &addtl, coreref, pr); 1924 1924 BUG_ON(0 == ret); 1925 - /* test uninstantated DRBG */ 1926 - len = drbg_generate(drbg, buf, (max_request_bytes + 1), NULL); 1927 - BUG_ON(0 < len); 1928 1925 /* all tests passed */ 1929 1926 rc = 0; 1930 1927
-10
drivers/acpi/bus.c
··· 177 177 } 178 178 EXPORT_SYMBOL_GPL(acpi_bus_detach_private_data); 179 179 180 - void acpi_bus_no_hotplug(acpi_handle handle) 181 - { 182 - struct acpi_device *adev = NULL; 183 - 184 - acpi_bus_get_device(handle, &adev); 185 - if (adev) 186 - adev->flags.no_hotplug = true; 187 - } 188 - EXPORT_SYMBOL_GPL(acpi_bus_no_hotplug); 189 - 190 180 static void acpi_print_osc_error(acpi_handle handle, 191 181 struct acpi_osc_context *context, char *error) 192 182 {
+8 -1
drivers/base/regmap/regmap-debugfs.c
··· 512 512 map, &regmap_reg_ranges_fops); 513 513 514 514 if (map->max_register || regmap_readable(map, 0)) { 515 - debugfs_create_file("registers", 0400, map->debugfs, 515 + umode_t registers_mode; 516 + 517 + if (IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS)) 518 + registers_mode = 0600; 519 + else 520 + registers_mode = 0400; 521 + 522 + debugfs_create_file("registers", registers_mode, map->debugfs, 516 523 map, &regmap_map_fops); 517 524 debugfs_create_file("access", 0400, map->debugfs, 518 525 map, &regmap_access_fops);
+7
drivers/char/hw_random/virtio-rng.c
··· 36 36 int index; 37 37 bool busy; 38 38 bool hwrng_register_done; 39 + bool hwrng_removed; 39 40 }; 40 41 41 42 ··· 68 67 { 69 68 int ret; 70 69 struct virtrng_info *vi = (struct virtrng_info *)rng->priv; 70 + 71 + if (vi->hwrng_removed) 72 + return -ENODEV; 71 73 72 74 if (!vi->busy) { 73 75 vi->busy = true; ··· 141 137 { 142 138 struct virtrng_info *vi = vdev->priv; 143 139 140 + vi->hwrng_removed = true; 141 + vi->data_avail = 0; 142 + complete(&vi->have_data); 144 143 vdev->config->reset(vdev); 145 144 vi->busy = false; 146 145 if (vi->hwrng_register_done)
+9 -1
drivers/firmware/efi/libstub/fdt.c
··· 22 22 unsigned long map_size, unsigned long desc_size, 23 23 u32 desc_ver) 24 24 { 25 - int node, prev; 25 + int node, prev, num_rsv; 26 26 int status; 27 27 u32 fdt_val32; 28 28 u64 fdt_val64; ··· 72 72 73 73 prev = node; 74 74 } 75 + 76 + /* 77 + * Delete all memory reserve map entries. When booting via UEFI, 78 + * kernel will use the UEFI memory map to find reserved regions. 79 + */ 80 + num_rsv = fdt_num_mem_rsv(fdt); 81 + while (num_rsv-- > 0) 82 + fdt_del_mem_rsv(fdt, num_rsv); 75 83 76 84 node = fdt_subnode_offset(fdt, 0, "chosen"); 77 85 if (node < 0) {
+1
drivers/gpu/drm/bochs/bochs_kms.c
··· 250 250 DRM_MODE_CONNECTOR_VIRTUAL); 251 251 drm_connector_helper_add(connector, 252 252 &bochs_connector_connector_helper_funcs); 253 + drm_connector_register(connector); 253 254 } 254 255 255 256
+1
drivers/gpu/drm/cirrus/cirrus_mode.c
··· 555 555 556 556 drm_connector_helper_add(connector, &cirrus_vga_connector_helper_funcs); 557 557 558 + drm_connector_register(connector); 558 559 return connector; 559 560 } 560 561
+4
drivers/gpu/drm/i915/intel_dp.c
··· 1631 1631 1632 1632 pipe_config->adjusted_mode.flags |= flags; 1633 1633 1634 + if (!HAS_PCH_SPLIT(dev) && !IS_VALLEYVIEW(dev) && 1635 + tmp & DP_COLOR_RANGE_16_235) 1636 + pipe_config->limited_color_range = true; 1637 + 1634 1638 pipe_config->has_dp_encoder = true; 1635 1639 1636 1640 intel_dp_get_m_n(crtc, pipe_config);
+6 -1
drivers/gpu/drm/i915/intel_hdmi.c
··· 712 712 struct intel_crtc_config *pipe_config) 713 713 { 714 714 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); 715 - struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; 715 + struct drm_device *dev = encoder->base.dev; 716 + struct drm_i915_private *dev_priv = dev->dev_private; 716 717 u32 tmp, flags = 0; 717 718 int dotclock; 718 719 ··· 734 733 735 734 if (tmp & HDMI_MODE_SELECT_HDMI) 736 735 pipe_config->has_audio = true; 736 + 737 + if (!HAS_PCH_SPLIT(dev) && 738 + tmp & HDMI_COLOR_RANGE_16_235) 739 + pipe_config->limited_color_range = true; 737 740 738 741 pipe_config->adjusted_mode.flags |= flags; 739 742
+1 -1
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 1400 1400 */ 1401 1401 intel_ring_emit(ring, SRC_COPY_BLT_CMD | BLT_WRITE_RGBA); 1402 1402 intel_ring_emit(ring, BLT_DEPTH_32 | BLT_ROP_SRC_COPY | 4096); 1403 - intel_ring_emit(ring, DIV_ROUND_UP(len, 4096) << 16 | 1024); 1403 + intel_ring_emit(ring, DIV_ROUND_UP(len, 4096) << 16 | 4096); 1404 1404 intel_ring_emit(ring, cs_offset); 1405 1405 intel_ring_emit(ring, 4096); 1406 1406 intel_ring_emit(ring, offset);
-1
drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c
··· 200 200 201 201 nv_mask(priv, 0x000200, 0x00000100, 0x00000000); 202 202 nv_mask(priv, 0x000200, 0x00000100, 0x00000100); 203 - nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); 204 203 205 204 nv_wr32(priv, 0x001704, 0x80000000 | priv->bar[1].mem->addr >> 12); 206 205 if (priv->bar[0].mem)
+1
drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c
··· 60 60 61 61 if (priv->r100c10_page) 62 62 nv_wr32(priv, 0x100c10, priv->r100c10 >> 8); 63 + nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */ 63 64 return 0; 64 65 } 65 66
+2
drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c
··· 98 98 gf100_ltc_init(struct nouveau_object *object) 99 99 { 100 100 struct nvkm_ltc_priv *priv = (void *)object; 101 + u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); 101 102 int ret; 102 103 103 104 ret = nvkm_ltc_init(priv); ··· 108 107 nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */ 109 108 nv_wr32(priv, 0x17e8d8, priv->ltc_nr); 110 109 nv_wr32(priv, 0x17e8d4, priv->tag_base); 110 + nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000); 111 111 return 0; 112 112 } 113 113
+2
drivers/gpu/drm/nouveau/core/subdev/ltc/gk104.c
··· 28 28 gk104_ltc_init(struct nouveau_object *object) 29 29 { 30 30 struct nvkm_ltc_priv *priv = (void *)object; 31 + u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); 31 32 int ret; 32 33 33 34 ret = nvkm_ltc_init(priv); ··· 38 37 nv_wr32(priv, 0x17e8d8, priv->ltc_nr); 39 38 nv_wr32(priv, 0x17e000, priv->ltc_nr); 40 39 nv_wr32(priv, 0x17e8d4, priv->tag_base); 40 + nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000); 41 41 return 0; 42 42 } 43 43
+2
drivers/gpu/drm/nouveau/core/subdev/ltc/gm107.c
··· 98 98 gm107_ltc_init(struct nouveau_object *object) 99 99 { 100 100 struct nvkm_ltc_priv *priv = (void *)object; 101 + u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); 101 102 int ret; 102 103 103 104 ret = nvkm_ltc_init(priv); ··· 107 106 108 107 nv_wr32(priv, 0x17e27c, priv->ltc_nr); 109 108 nv_wr32(priv, 0x17e278, priv->tag_base); 109 + nv_mask(priv, 0x17e264, 0x00000002, lpg128 ? 0x00000002 : 0x00000000); 110 110 return 0; 111 111 } 112 112
+2 -14
drivers/gpu/drm/nouveau/nouveau_acpi.c
··· 46 46 bool dsm_detected; 47 47 bool optimus_detected; 48 48 acpi_handle dhandle; 49 - acpi_handle other_handle; 50 49 acpi_handle rom_handle; 51 50 } nouveau_dsm_priv; 52 51 ··· 221 222 if (!dhandle) 222 223 return false; 223 224 224 - if (!acpi_has_method(dhandle, "_DSM")) { 225 - nouveau_dsm_priv.other_handle = dhandle; 225 + if (!acpi_has_method(dhandle, "_DSM")) 226 226 return false; 227 - } 227 + 228 228 if (acpi_check_dsm(dhandle, nouveau_dsm_muid, 0x00000102, 229 229 1 << NOUVEAU_DSM_POWER)) 230 230 retval |= NOUVEAU_DSM_HAS_MUX; ··· 299 301 printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n", 300 302 acpi_method_name); 301 303 nouveau_dsm_priv.dsm_detected = true; 302 - /* 303 - * On some systems hotplug events are generated for the device 304 - * being switched off when _DSM is executed. They cause ACPI 305 - * hotplug to trigger and attempt to remove the device from 306 - * the system, which causes it to break down. Prevent that from 307 - * happening by setting the no_hotplug flag for the involved 308 - * ACPI device objects. 309 - */ 310 - acpi_bus_no_hotplug(nouveau_dsm_priv.dhandle); 311 - acpi_bus_no_hotplug(nouveau_dsm_priv.other_handle); 312 304 ret = true; 313 305 } 314 306
+1
drivers/gpu/drm/nouveau/nouveau_drm.c
··· 627 627 628 628 pci_save_state(pdev); 629 629 pci_disable_device(pdev); 630 + pci_ignore_hotplug(pdev); 630 631 pci_set_power_state(pdev, PCI_D3hot); 631 632 return 0; 632 633 }
+9
drivers/gpu/drm/nouveau/nouveau_vga.c
··· 108 108 nouveau_vga_fini(struct nouveau_drm *drm) 109 109 { 110 110 struct drm_device *dev = drm->dev; 111 + bool runtime = false; 112 + 113 + if (nouveau_runtime_pm == 1) 114 + runtime = true; 115 + if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm())) 116 + runtime = true; 117 + 111 118 vga_switcheroo_unregister_client(dev->pdev); 119 + if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus()) 120 + vga_switcheroo_fini_domain_pm_ops(drm->dev->dev); 112 121 vga_client_register(dev->pdev, NULL, NULL, NULL); 113 122 } 114 123
-7
drivers/gpu/drm/radeon/cik_sdma.c
··· 489 489 { 490 490 int r; 491 491 492 - /* Reset dma */ 493 - WREG32(SRBM_SOFT_RESET, SOFT_RESET_SDMA | SOFT_RESET_SDMA1); 494 - RREG32(SRBM_SOFT_RESET); 495 - udelay(50); 496 - WREG32(SRBM_SOFT_RESET, 0); 497 - RREG32(SRBM_SOFT_RESET); 498 - 499 492 r = cik_sdma_load_microcode(rdev); 500 493 if (r) 501 494 return r;
+21 -7
drivers/gpu/drm/radeon/kv_dpm.c
··· 33 33 #define KV_MINIMUM_ENGINE_CLOCK 800 34 34 #define SMC_RAM_END 0x40000 35 35 36 + static int kv_enable_nb_dpm(struct radeon_device *rdev, 37 + bool enable); 36 38 static void kv_init_graphics_levels(struct radeon_device *rdev); 37 39 static int kv_calculate_ds_divider(struct radeon_device *rdev); 38 40 static int kv_calculate_nbps_level_settings(struct radeon_device *rdev); ··· 1297 1295 { 1298 1296 kv_smc_bapm_enable(rdev, false); 1299 1297 1298 + if (rdev->family == CHIP_MULLINS) 1299 + kv_enable_nb_dpm(rdev, false); 1300 + 1300 1301 /* powerup blocks */ 1301 1302 kv_dpm_powergate_acp(rdev, false); 1302 1303 kv_dpm_powergate_samu(rdev, false); ··· 1774 1769 return ret; 1775 1770 } 1776 1771 1777 - static int kv_enable_nb_dpm(struct radeon_device *rdev) 1772 + static int kv_enable_nb_dpm(struct radeon_device *rdev, 1773 + bool enable) 1778 1774 { 1779 1775 struct kv_power_info *pi = kv_get_pi(rdev); 1780 1776 int ret = 0; 1781 1777 1782 - if (pi->enable_nb_dpm && !pi->nb_dpm_enabled) { 1783 - ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Enable); 1784 - if (ret == 0) 1785 - pi->nb_dpm_enabled = true; 1778 + if (enable) { 1779 + if (pi->enable_nb_dpm && !pi->nb_dpm_enabled) { 1780 + ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Enable); 1781 + if (ret == 0) 1782 + pi->nb_dpm_enabled = true; 1783 + } 1784 + } else { 1785 + if (pi->enable_nb_dpm && pi->nb_dpm_enabled) { 1786 + ret = kv_notify_message_to_smu(rdev, PPSMC_MSG_NBDPM_Disable); 1787 + if (ret == 0) 1788 + pi->nb_dpm_enabled = false; 1789 + } 1786 1790 } 1787 1791 1788 1792 return ret; ··· 1878 1864 } 1879 1865 kv_update_sclk_t(rdev); 1880 1866 if (rdev->family == CHIP_MULLINS) 1881 - kv_enable_nb_dpm(rdev); 1867 + kv_enable_nb_dpm(rdev, true); 1882 1868 } 1883 1869 } else { 1884 1870 if (pi->enable_dpm) { ··· 1903 1889 } 1904 1890 kv_update_acp_boot_level(rdev); 1905 1891 kv_update_sclk_t(rdev); 1906 - kv_enable_nb_dpm(rdev); 1892 + kv_enable_nb_dpm(rdev, true); 1907 1893 } 1908 1894 } 1909 1895
-6
drivers/gpu/drm/radeon/ni_dma.c
··· 191 191 u32 reg_offset, wb_offset; 192 192 int i, r; 193 193 194 - /* Reset dma */ 195 - WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA | SOFT_RESET_DMA1); 196 - RREG32(SRBM_SOFT_RESET); 197 - udelay(50); 198 - WREG32(SRBM_SOFT_RESET, 0); 199 - 200 194 for (i = 0; i < 2; i++) { 201 195 if (i == 0) { 202 196 ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX];
+14 -14
drivers/gpu/drm/radeon/r100.c
··· 821 821 return RREG32(RADEON_CRTC2_CRNT_FRAME); 822 822 } 823 823 824 + /** 825 + * r100_ring_hdp_flush - flush Host Data Path via the ring buffer 826 + * rdev: radeon device structure 827 + * ring: ring buffer struct for emitting packets 828 + */ 829 + static void r100_ring_hdp_flush(struct radeon_device *rdev, struct radeon_ring *ring) 830 + { 831 + radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); 832 + radeon_ring_write(ring, rdev->config.r100.hdp_cntl | 833 + RADEON_HDP_READ_BUFFER_INVALIDATE); 834 + radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); 835 + radeon_ring_write(ring, rdev->config.r100.hdp_cntl); 836 + } 837 + 824 838 /* Who ever call radeon_fence_emit should call ring_lock and ask 825 839 * for enough space (today caller are ib schedule and buffer move) */ 826 840 void r100_fence_ring_emit(struct radeon_device *rdev, ··· 1068 1054 { 1069 1055 WREG32(RADEON_CP_RB_WPTR, ring->wptr); 1070 1056 (void)RREG32(RADEON_CP_RB_WPTR); 1071 - } 1072 - 1073 - /** 1074 - * r100_ring_hdp_flush - flush Host Data Path via the ring buffer 1075 - * rdev: radeon device structure 1076 - * ring: ring buffer struct for emitting packets 1077 - */ 1078 - void r100_ring_hdp_flush(struct radeon_device *rdev, struct radeon_ring *ring) 1079 - { 1080 - radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); 1081 - radeon_ring_write(ring, rdev->config.r100.hdp_cntl | 1082 - RADEON_HDP_READ_BUFFER_INVALIDATE); 1083 - radeon_ring_write(ring, PACKET0(RADEON_HOST_PATH_CNTL, 0)); 1084 - radeon_ring_write(ring, rdev->config.r100.hdp_cntl); 1085 1057 } 1086 1058 1087 1059 static void r100_cp_load_microcode(struct radeon_device *rdev)
-9
drivers/gpu/drm/radeon/r600_dma.c
··· 124 124 u32 rb_bufsz; 125 125 int r; 126 126 127 - /* Reset dma */ 128 - if (rdev->family >= CHIP_RV770) 129 - WREG32(SRBM_SOFT_RESET, RV770_SOFT_RESET_DMA); 130 - else 131 - WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA); 132 - RREG32(SRBM_SOFT_RESET); 133 - udelay(50); 134 - WREG32(SRBM_SOFT_RESET, 0); 135 - 136 127 WREG32(DMA_SEM_INCOMPLETE_TIMER_CNTL, 0); 137 128 WREG32(DMA_SEM_WAIT_FAIL_TIMER_CNTL, 0); 138 129
-7
drivers/gpu/drm/radeon/r600d.h
··· 44 44 #define R6XX_MAX_PIPES 8 45 45 #define R6XX_MAX_PIPES_MASK 0xff 46 46 47 - /* PTE flags */ 48 - #define PTE_VALID (1 << 0) 49 - #define PTE_SYSTEM (1 << 1) 50 - #define PTE_SNOOPED (1 << 2) 51 - #define PTE_READABLE (1 << 5) 52 - #define PTE_WRITEABLE (1 << 6) 53 - 54 47 /* tiling bits */ 55 48 #define ARRAY_LINEAR_GENERAL 0x00000000 56 49 #define ARRAY_LINEAR_ALIGNED 0x00000001
-2
drivers/gpu/drm/radeon/radeon_asic.c
··· 185 185 .get_rptr = &r100_gfx_get_rptr, 186 186 .get_wptr = &r100_gfx_get_wptr, 187 187 .set_wptr = &r100_gfx_set_wptr, 188 - .hdp_flush = &r100_ring_hdp_flush, 189 188 }; 190 189 191 190 static struct radeon_asic r100_asic = { ··· 331 332 .get_rptr = &r100_gfx_get_rptr, 332 333 .get_wptr = &r100_gfx_get_wptr, 333 334 .set_wptr = &r100_gfx_set_wptr, 334 - .hdp_flush = &r100_ring_hdp_flush, 335 335 }; 336 336 337 337 static struct radeon_asic r300_asic = {
+1 -2
drivers/gpu/drm/radeon/radeon_asic.h
··· 148 148 struct radeon_ring *ring); 149 149 void r100_gfx_set_wptr(struct radeon_device *rdev, 150 150 struct radeon_ring *ring); 151 - void r100_ring_hdp_flush(struct radeon_device *rdev, 152 - struct radeon_ring *ring); 151 + 153 152 /* 154 153 * r200,rv250,rs300,rv280 155 154 */
+2 -14
drivers/gpu/drm/radeon/radeon_atpx_handler.c
··· 33 33 bool atpx_detected; 34 34 /* handle for device - and atpx */ 35 35 acpi_handle dhandle; 36 - acpi_handle other_handle; 37 36 struct radeon_atpx atpx; 38 37 } radeon_atpx_priv; 39 38 ··· 452 453 return false; 453 454 454 455 status = acpi_get_handle(dhandle, "ATPX", &atpx_handle); 455 - if (ACPI_FAILURE(status)) { 456 - radeon_atpx_priv.other_handle = dhandle; 456 + if (ACPI_FAILURE(status)) 457 457 return false; 458 - } 458 + 459 459 radeon_atpx_priv.dhandle = dhandle; 460 460 radeon_atpx_priv.atpx.handle = atpx_handle; 461 461 return true; ··· 538 540 printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n", 539 541 acpi_method_name); 540 542 radeon_atpx_priv.atpx_detected = true; 541 - /* 542 - * On some systems hotplug events are generated for the device 543 - * being switched off when ATPX is executed. They cause ACPI 544 - * hotplug to trigger and attempt to remove the device from 545 - * the system, which causes it to break down. Prevent that from 546 - * happening by setting the no_hotplug flag for the involved 547 - * ACPI device objects. 548 - */ 549 - acpi_bus_no_hotplug(radeon_atpx_priv.dhandle); 550 - acpi_bus_no_hotplug(radeon_atpx_priv.other_handle); 551 543 return true; 552 544 } 553 545 return false;
+9 -2
drivers/gpu/drm/radeon/radeon_device.c
··· 1393 1393 1394 1394 r = radeon_init(rdev); 1395 1395 if (r) 1396 - return r; 1396 + goto failed; 1397 1397 1398 1398 r = radeon_ib_ring_tests(rdev); 1399 1399 if (r) ··· 1413 1413 radeon_agp_disable(rdev); 1414 1414 r = radeon_init(rdev); 1415 1415 if (r) 1416 - return r; 1416 + goto failed; 1417 1417 } 1418 1418 1419 1419 if ((radeon_testing & 1)) { ··· 1435 1435 DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n"); 1436 1436 } 1437 1437 return 0; 1438 + 1439 + failed: 1440 + if (runtime) 1441 + vga_switcheroo_fini_domain_pm_ops(rdev->dev); 1442 + return r; 1438 1443 } 1439 1444 1440 1445 static void radeon_debugfs_remove_files(struct radeon_device *rdev); ··· 1460 1455 radeon_bo_evict_vram(rdev); 1461 1456 radeon_fini(rdev); 1462 1457 vga_switcheroo_unregister_client(rdev->pdev); 1458 + if (rdev->flags & RADEON_IS_PX) 1459 + vga_switcheroo_fini_domain_pm_ops(rdev->dev); 1463 1460 vga_client_register(rdev->pdev, NULL, NULL, NULL); 1464 1461 if (rdev->rio_mem) 1465 1462 pci_iounmap(rdev->pdev, rdev->rio_mem);
+2 -1
drivers/gpu/drm/radeon/radeon_drv.c
··· 83 83 * CIK: 1D and linear tiling modes contain valid PIPE_CONFIG 84 84 * 2.39.0 - Add INFO query for number of active CUs 85 85 * 2.40.0 - Add RADEON_GEM_GTT_WC/UC, flush HDP cache before submitting 86 - * CS to GPU 86 + * CS to GPU on >= r600 87 87 */ 88 88 #define KMS_DRIVER_MAJOR 2 89 89 #define KMS_DRIVER_MINOR 40 ··· 440 440 ret = radeon_suspend_kms(drm_dev, false, false); 441 441 pci_save_state(pdev); 442 442 pci_disable_device(pdev); 443 + pci_ignore_hotplug(pdev); 443 444 pci_set_power_state(pdev, PCI_D3cold); 444 445 drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; 445 446
+2 -2
drivers/gpu/drm/radeon/rs400.c
··· 221 221 entry = (lower_32_bits(addr) & PAGE_MASK) | 222 222 ((upper_32_bits(addr) & 0xff) << 4); 223 223 if (flags & RADEON_GART_PAGE_READ) 224 - addr |= RS400_PTE_READABLE; 224 + entry |= RS400_PTE_READABLE; 225 225 if (flags & RADEON_GART_PAGE_WRITE) 226 - addr |= RS400_PTE_WRITEABLE; 226 + entry |= RS400_PTE_WRITEABLE; 227 227 if (!(flags & RADEON_GART_PAGE_SNOOP)) 228 228 entry |= RS400_PTE_UNSNOOPED; 229 229 entry = cpu_to_le32(entry);
-1
drivers/gpu/drm/sti/sti_hdmi.c
··· 298 298 hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD2(HDMI_IFRAME_SLOT_AVI)); 299 299 300 300 val = frame[0xC]; 301 - val |= frame[0xD] << 8; 302 301 hdmi_write(hdmi, val, HDMI_SW_DI_N_PKT_WORD3(HDMI_IFRAME_SLOT_AVI)); 303 302 304 303 /* Enable transmission slot for AVI infoframe
+6
drivers/gpu/vga/vga_switcheroo.c
··· 660 660 } 661 661 EXPORT_SYMBOL(vga_switcheroo_init_domain_pm_ops); 662 662 663 + void vga_switcheroo_fini_domain_pm_ops(struct device *dev) 664 + { 665 + dev->pm_domain = NULL; 666 + } 667 + EXPORT_SYMBOL(vga_switcheroo_fini_domain_pm_ops); 668 + 663 669 static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev) 664 670 { 665 671 struct pci_dev *pdev = to_pci_dev(dev);
+37 -9
drivers/gpu/vga/vgaarb.c
··· 41 41 #include <linux/poll.h> 42 42 #include <linux/miscdevice.h> 43 43 #include <linux/slab.h> 44 + #include <linux/screen_info.h> 44 45 45 46 #include <linux/uaccess.h> 46 47 ··· 113 112 return 1; 114 113 } 115 114 116 - #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE 117 115 /* this is only used a cookie - it should not be dereferenced */ 118 116 static struct pci_dev *vga_default; 119 - #endif 120 117 121 118 static void vga_arb_device_card_gone(struct pci_dev *pdev); 122 119 ··· 130 131 } 131 132 132 133 /* Returns the default VGA device (vgacon's babe) */ 133 - #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE 134 134 struct pci_dev *vga_default_device(void) 135 135 { 136 136 return vga_default; ··· 145 147 pci_dev_put(vga_default); 146 148 vga_default = pci_dev_get(pdev); 147 149 } 148 - #endif 149 150 150 151 static inline void vga_irq_set_state(struct vga_device *vgadev, bool state) 151 152 { ··· 580 583 /* Deal with VGA default device. Use first enabled one 581 584 * by default if arch doesn't have it's own hook 582 585 */ 583 - #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE 584 586 if (vga_default == NULL && 585 - ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) 587 + ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) { 588 + pr_info("vgaarb: setting as boot device: PCI:%s\n", 589 + pci_name(pdev)); 586 590 vga_set_default_device(pdev); 587 - #endif 591 + } 588 592 589 593 vga_arbiter_check_bridge_sharing(vgadev); 590 594 ··· 619 621 goto bail; 620 622 } 621 623 622 - #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE 623 624 if (vga_default == pdev) 624 625 vga_set_default_device(NULL); 625 - #endif 626 626 627 627 if (vgadev->decodes & (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM)) 628 628 vga_decode_count--; ··· 1316 1320 pr_info("vgaarb: loaded\n"); 1317 1321 1318 1322 list_for_each_entry(vgadev, &vga_list, list) { 1323 + #if defined(CONFIG_X86) || defined(CONFIG_IA64) 1324 + /* Override I/O based detection done by vga_arbiter_add_pci_device() 1325 + * as it may take the wrong device (e.g. on Apple system under EFI). 1326 + * 1327 + * Select the device owning the boot framebuffer if there is one. 1328 + */ 1329 + resource_size_t start, end; 1330 + int i; 1331 + 1332 + /* Does firmware framebuffer belong to us? */ 1333 + for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 1334 + if (!(pci_resource_flags(vgadev->pdev, i) & IORESOURCE_MEM)) 1335 + continue; 1336 + 1337 + start = pci_resource_start(vgadev->pdev, i); 1338 + end = pci_resource_end(vgadev->pdev, i); 1339 + 1340 + if (!start || !end) 1341 + continue; 1342 + 1343 + if (screen_info.lfb_base < start || 1344 + (screen_info.lfb_base + screen_info.lfb_size) >= end) 1345 + continue; 1346 + if (!vga_default_device()) 1347 + pr_info("vgaarb: setting as boot device: PCI:%s\n", 1348 + pci_name(vgadev->pdev)); 1349 + else if (vgadev->pdev != vga_default_device()) 1350 + pr_info("vgaarb: overriding boot device: PCI:%s\n", 1351 + pci_name(vgadev->pdev)); 1352 + vga_set_default_device(vgadev->pdev); 1353 + } 1354 + #endif 1319 1355 if (vgadev->bridge_has_one_vga) 1320 1356 pr_info("vgaarb: bridge control possible %s\n", pci_name(vgadev->pdev)); 1321 1357 else
+1 -1
drivers/iio/accel/bma180.c
··· 748 748 data->trig->dev.parent = &client->dev; 749 749 data->trig->ops = &bma180_trigger_ops; 750 750 iio_trigger_set_drvdata(data->trig, indio_dev); 751 - indio_dev->trig = data->trig; 751 + indio_dev->trig = iio_trigger_get(trig); 752 752 753 753 ret = iio_trigger_register(data->trig); 754 754 if (ret)
+1 -1
drivers/iio/adc/ad_sigma_delta.c
··· 472 472 goto error_free_irq; 473 473 474 474 /* select default trigger */ 475 - indio_dev->trig = sigma_delta->trig; 475 + indio_dev->trig = iio_trigger_get(sigma_delta->trig); 476 476 477 477 return 0; 478 478
+7 -5
drivers/iio/adc/at91_adc.c
··· 196 196 bool done; 197 197 int irq; 198 198 u16 last_value; 199 + int chnb; 199 200 struct mutex lock; 200 201 u8 num_channels; 201 202 void __iomem *reg_base; ··· 275 274 disable_irq_nosync(irq); 276 275 iio_trigger_poll(idev->trig); 277 276 } else { 278 - st->last_value = at91_adc_readl(st, AT91_ADC_LCDR); 277 + st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb)); 279 278 st->done = true; 280 279 wake_up_interruptible(&st->wq_data_avail); 281 280 } ··· 352 351 unsigned int reg; 353 352 354 353 status &= at91_adc_readl(st, AT91_ADC_IMR); 355 - if (status & st->registers->drdy_mask) 354 + if (status & GENMASK(st->num_channels - 1, 0)) 356 355 handle_adc_eoc_trigger(irq, idev); 357 356 358 357 if (status & AT91RL_ADC_IER_PEN) { ··· 419 418 AT91_ADC_IER_YRDY | 420 419 AT91_ADC_IER_PRDY; 421 420 422 - if (status & st->registers->drdy_mask) 421 + if (status & GENMASK(st->num_channels - 1, 0)) 423 422 handle_adc_eoc_trigger(irq, idev); 424 423 425 424 if (status & AT91_ADC_IER_PEN) { ··· 690 689 case IIO_CHAN_INFO_RAW: 691 690 mutex_lock(&st->lock); 692 691 692 + st->chnb = chan->channel; 693 693 at91_adc_writel(st, AT91_ADC_CHER, 694 694 AT91_ADC_CH(chan->channel)); 695 - at91_adc_writel(st, AT91_ADC_IER, st->registers->drdy_mask); 695 + at91_adc_writel(st, AT91_ADC_IER, BIT(chan->channel)); 696 696 at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_START); 697 697 698 698 ret = wait_event_interruptible_timeout(st->wq_data_avail, ··· 710 708 711 709 at91_adc_writel(st, AT91_ADC_CHDR, 712 710 AT91_ADC_CH(chan->channel)); 713 - at91_adc_writel(st, AT91_ADC_IDR, st->registers->drdy_mask); 711 + at91_adc_writel(st, AT91_ADC_IDR, BIT(chan->channel)); 714 712 715 713 st->last_value = 0; 716 714 st->done = false;
+1 -1
drivers/iio/adc/xilinx-xadc-core.c
··· 1126 1126 chan->address = XADC_REG_VPVN; 1127 1127 } else { 1128 1128 chan->scan_index = 15 + reg; 1129 - chan->scan_index = XADC_REG_VAUX(reg - 1); 1129 + chan->address = XADC_REG_VAUX(reg - 1); 1130 1130 } 1131 1131 num_channels++; 1132 1132 chan++;
+2 -1
drivers/iio/common/hid-sensors/hid-sensor-trigger.c
··· 122 122 dev_err(&indio_dev->dev, "Trigger Register Failed\n"); 123 123 goto error_free_trig; 124 124 } 125 - indio_dev->trig = attrb->trigger = trig; 125 + attrb->trigger = trig; 126 + indio_dev->trig = iio_trigger_get(trig); 126 127 127 128 return ret; 128 129
+1 -1
drivers/iio/common/st_sensors/st_sensors_trigger.c
··· 49 49 dev_err(&indio_dev->dev, "failed to register iio trigger.\n"); 50 50 goto iio_trigger_register_error; 51 51 } 52 - indio_dev->trig = sdata->trig; 52 + indio_dev->trig = iio_trigger_get(sdata->trig); 53 53 54 54 return 0; 55 55
+1 -1
drivers/iio/gyro/itg3200_buffer.c
··· 132 132 goto error_free_irq; 133 133 134 134 /* select default trigger */ 135 - indio_dev->trig = st->trig; 135 + indio_dev->trig = iio_trigger_get(st->trig); 136 136 137 137 return 0; 138 138
+1 -1
drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
··· 135 135 ret = iio_trigger_register(st->trig); 136 136 if (ret) 137 137 goto error_free_irq; 138 - indio_dev->trig = st->trig; 138 + indio_dev->trig = iio_trigger_get(st->trig); 139 139 140 140 return 0; 141 141
+1 -1
drivers/iio/inkern.c
··· 178 178 index = of_property_match_string(np, "io-channel-names", 179 179 name); 180 180 chan = of_iio_channel_get(np, index); 181 - if (!IS_ERR(chan)) 181 + if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) 182 182 break; 183 183 else if (name && index >= 0) { 184 184 pr_err("ERROR: could not get IIO channel %s:%s(%i)\n",
+30 -22
drivers/iio/magnetometer/st_magn_core.c
··· 42 42 #define ST_MAGN_FS_AVL_5600MG 5600 43 43 #define ST_MAGN_FS_AVL_8000MG 8000 44 44 #define ST_MAGN_FS_AVL_8100MG 8100 45 - #define ST_MAGN_FS_AVL_10000MG 10000 45 + #define ST_MAGN_FS_AVL_12000MG 12000 46 + #define ST_MAGN_FS_AVL_16000MG 16000 46 47 47 48 /* CUSTOM VALUES FOR SENSOR 1 */ 48 49 #define ST_MAGN_1_WAI_EXP 0x3c ··· 70 69 #define ST_MAGN_1_FS_AVL_4700_VAL 0x05 71 70 #define ST_MAGN_1_FS_AVL_5600_VAL 0x06 72 71 #define ST_MAGN_1_FS_AVL_8100_VAL 0x07 73 - #define ST_MAGN_1_FS_AVL_1300_GAIN_XY 1100 74 - #define ST_MAGN_1_FS_AVL_1900_GAIN_XY 855 75 - #define ST_MAGN_1_FS_AVL_2500_GAIN_XY 670 76 - #define ST_MAGN_1_FS_AVL_4000_GAIN_XY 450 77 - #define ST_MAGN_1_FS_AVL_4700_GAIN_XY 400 78 - #define ST_MAGN_1_FS_AVL_5600_GAIN_XY 330 79 - #define ST_MAGN_1_FS_AVL_8100_GAIN_XY 230 80 - #define ST_MAGN_1_FS_AVL_1300_GAIN_Z 980 81 - #define ST_MAGN_1_FS_AVL_1900_GAIN_Z 760 82 - #define ST_MAGN_1_FS_AVL_2500_GAIN_Z 600 83 - #define ST_MAGN_1_FS_AVL_4000_GAIN_Z 400 84 - #define ST_MAGN_1_FS_AVL_4700_GAIN_Z 355 85 - #define ST_MAGN_1_FS_AVL_5600_GAIN_Z 295 86 - #define ST_MAGN_1_FS_AVL_8100_GAIN_Z 205 72 + #define ST_MAGN_1_FS_AVL_1300_GAIN_XY 909 73 + #define ST_MAGN_1_FS_AVL_1900_GAIN_XY 1169 74 + #define ST_MAGN_1_FS_AVL_2500_GAIN_XY 1492 75 + #define ST_MAGN_1_FS_AVL_4000_GAIN_XY 2222 76 + #define ST_MAGN_1_FS_AVL_4700_GAIN_XY 2500 77 + #define ST_MAGN_1_FS_AVL_5600_GAIN_XY 3030 78 + #define ST_MAGN_1_FS_AVL_8100_GAIN_XY 4347 79 + #define ST_MAGN_1_FS_AVL_1300_GAIN_Z 1020 80 + #define ST_MAGN_1_FS_AVL_1900_GAIN_Z 1315 81 + #define ST_MAGN_1_FS_AVL_2500_GAIN_Z 1666 82 + #define ST_MAGN_1_FS_AVL_4000_GAIN_Z 2500 83 + #define ST_MAGN_1_FS_AVL_4700_GAIN_Z 2816 84 + #define ST_MAGN_1_FS_AVL_5600_GAIN_Z 3389 85 + #define ST_MAGN_1_FS_AVL_8100_GAIN_Z 4878 87 86 #define ST_MAGN_1_MULTIREAD_BIT false 88 87 89 88 /* CUSTOM VALUES FOR SENSOR 2 */ ··· 106 105 #define ST_MAGN_2_FS_MASK 0x60 107 106 #define ST_MAGN_2_FS_AVL_4000_VAL 0x00 108 107 #define ST_MAGN_2_FS_AVL_8000_VAL 0x01 109 - #define ST_MAGN_2_FS_AVL_10000_VAL 0x02 110 - #define ST_MAGN_2_FS_AVL_4000_GAIN 430 111 - #define ST_MAGN_2_FS_AVL_8000_GAIN 230 112 - #define ST_MAGN_2_FS_AVL_10000_GAIN 230 108 + #define ST_MAGN_2_FS_AVL_12000_VAL 0x02 109 + #define ST_MAGN_2_FS_AVL_16000_VAL 0x03 110 + #define ST_MAGN_2_FS_AVL_4000_GAIN 146 111 + #define ST_MAGN_2_FS_AVL_8000_GAIN 292 112 + #define ST_MAGN_2_FS_AVL_12000_GAIN 438 113 + #define ST_MAGN_2_FS_AVL_16000_GAIN 584 113 114 #define ST_MAGN_2_MULTIREAD_BIT false 114 115 #define ST_MAGN_2_OUT_X_L_ADDR 0x28 115 116 #define ST_MAGN_2_OUT_Y_L_ADDR 0x2a ··· 269 266 .gain = ST_MAGN_2_FS_AVL_8000_GAIN, 270 267 }, 271 268 [2] = { 272 - .num = ST_MAGN_FS_AVL_10000MG, 273 - .value = ST_MAGN_2_FS_AVL_10000_VAL, 274 - .gain = ST_MAGN_2_FS_AVL_10000_GAIN, 269 + .num = ST_MAGN_FS_AVL_12000MG, 270 + .value = ST_MAGN_2_FS_AVL_12000_VAL, 271 + .gain = ST_MAGN_2_FS_AVL_12000_GAIN, 272 + }, 273 + [3] = { 274 + .num = ST_MAGN_FS_AVL_16000MG, 275 + .value = ST_MAGN_2_FS_AVL_16000_VAL, 276 + .gain = ST_MAGN_2_FS_AVL_16000_GAIN, 275 277 }, 276 278 }, 277 279 },
+11 -9
drivers/infiniband/ulp/isert/ib_isert.c
··· 586 586 init_completion(&isert_conn->conn_wait); 587 587 init_completion(&isert_conn->conn_wait_comp_err); 588 588 kref_init(&isert_conn->conn_kref); 589 - kref_get(&isert_conn->conn_kref); 590 589 mutex_init(&isert_conn->conn_mutex); 591 590 spin_lock_init(&isert_conn->conn_lock); 592 591 INIT_LIST_HEAD(&isert_conn->conn_fr_pool); 593 592 594 593 cma_id->context = isert_conn; 595 594 isert_conn->conn_cm_id = cma_id; 596 - isert_conn->responder_resources = event->param.conn.responder_resources; 597 - isert_conn->initiator_depth = event->param.conn.initiator_depth; 598 - pr_debug("Using responder_resources: %u initiator_depth: %u\n", 599 - isert_conn->responder_resources, isert_conn->initiator_depth); 600 595 601 596 isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN + 602 597 ISER_RX_LOGIN_SIZE, GFP_KERNEL); ··· 637 642 ret = PTR_ERR(device); 638 643 goto out_rsp_dma_map; 639 644 } 645 + 646 + /* Set max inflight RDMA READ requests */ 647 + isert_conn->initiator_depth = min_t(u8, 648 + event->param.conn.initiator_depth, 649 + device->dev_attr.max_qp_init_rd_atom); 650 + pr_debug("Using initiator_depth: %u\n", isert_conn->initiator_depth); 640 651 641 652 isert_conn->conn_device = device; 642 653 isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device); ··· 747 746 static void 748 747 isert_connected_handler(struct rdma_cm_id *cma_id) 749 748 { 750 - return; 749 + struct isert_conn *isert_conn = cma_id->context; 750 + 751 + kref_get(&isert_conn->conn_kref); 751 752 } 752 753 753 754 static void ··· 801 798 802 799 wake_up: 803 800 complete(&isert_conn->conn_wait); 804 - isert_put_conn(isert_conn); 805 801 } 806 802 807 803 static void ··· 3069 3067 int ret; 3070 3068 3071 3069 memset(&cp, 0, sizeof(struct rdma_conn_param)); 3072 - cp.responder_resources = isert_conn->responder_resources; 3073 3070 cp.initiator_depth = isert_conn->initiator_depth; 3074 3071 cp.retry_count = 7; 3075 3072 cp.rnr_retry_count = 7; ··· 3216 3215 pr_debug("isert_wait_conn: Starting \n"); 3217 3216 3218 3217 mutex_lock(&isert_conn->conn_mutex); 3219 - if (isert_conn->conn_cm_id) { 3218 + if (isert_conn->conn_cm_id && !isert_conn->disconnect) { 3220 3219 pr_debug("Calling rdma_disconnect from isert_wait_conn\n"); 3221 3220 rdma_disconnect(isert_conn->conn_cm_id); 3222 3221 } ··· 3235 3234 wait_for_completion(&isert_conn->conn_wait_comp_err); 3236 3235 3237 3236 wait_for_completion(&isert_conn->conn_wait); 3237 + isert_put_conn(isert_conn); 3238 3238 } 3239 3239 3240 3240 static void isert_free_conn(struct iscsi_conn *conn)
-8
drivers/input/keyboard/atkbd.c
··· 1791 1791 { 1792 1792 .matches = { 1793 1793 DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), 1794 - DMI_MATCH(DMI_PRODUCT_NAME, "LW25-B7HV"), 1795 - }, 1796 - .callback = atkbd_deactivate_fixup, 1797 - }, 1798 - { 1799 - .matches = { 1800 - DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), 1801 - DMI_MATCH(DMI_PRODUCT_NAME, "P1-J273B"), 1802 1794 }, 1803 1795 .callback = atkbd_deactivate_fixup, 1804 1796 },
+15
drivers/input/serio/i8042-x86ia64io.h
··· 465 465 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), 466 466 }, 467 467 }, 468 + { 469 + /* Avatar AVIU-145A6 */ 470 + .matches = { 471 + DMI_MATCH(DMI_SYS_VENDOR, "Intel"), 472 + DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"), 473 + }, 474 + }, 468 475 { } 469 476 }; 470 477 ··· 613 606 .matches = { 614 607 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 615 608 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), 609 + }, 610 + }, 611 + { 612 + /* Fujitsu U574 laptop */ 613 + /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */ 614 + .matches = { 615 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 616 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"), 616 617 }, 617 618 }, 618 619 { }
+2
drivers/input/serio/i8042.c
··· 1254 1254 } else { 1255 1255 snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx); 1256 1256 snprintf(serio->phys, sizeof(serio->phys), I8042_MUX_PHYS_DESC, idx + 1); 1257 + strlcpy(serio->firmware_id, i8042_aux_firmware_id, 1258 + sizeof(serio->firmware_id)); 1257 1259 } 1258 1260 1259 1261 port->serio = serio;
-1
drivers/media/Kconfig
··· 182 182 depends on HAS_IOMEM 183 183 select I2C 184 184 select I2C_MUX 185 - select SPI 186 185 default y 187 186 help 188 187 By default, a media driver auto-selects all possible ancillary
+2
drivers/media/dvb-core/dvb-usb-ids.h
··· 280 280 #define USB_PID_PCTV_400E 0x020f 281 281 #define USB_PID_PCTV_450E 0x0222 282 282 #define USB_PID_PCTV_452E 0x021f 283 + #define USB_PID_PCTV_78E 0x025a 284 + #define USB_PID_PCTV_79E 0x0262 283 285 #define USB_PID_REALTEK_RTL2831U 0x2831 284 286 #define USB_PID_REALTEK_RTL2832U 0x2832 285 287 #define USB_PID_TECHNOTREND_CONNECT_S2_3600 0x3007
+13
drivers/media/dvb-frontends/af9033.c
··· 314 314 goto err; 315 315 } 316 316 317 + /* feed clock to RF tuner */ 318 + switch (state->cfg.tuner) { 319 + case AF9033_TUNER_IT9135_38: 320 + case AF9033_TUNER_IT9135_51: 321 + case AF9033_TUNER_IT9135_52: 322 + case AF9033_TUNER_IT9135_60: 323 + case AF9033_TUNER_IT9135_61: 324 + case AF9033_TUNER_IT9135_62: 325 + ret = af9033_wr_reg(state, 0x80fba8, 0x00); 326 + if (ret < 0) 327 + goto err; 328 + } 329 + 317 330 /* settings for TS interface */ 318 331 if (state->cfg.ts_mode == AF9033_TS_MODE_USB) { 319 332 ret = af9033_wr_reg_mask(state, 0x80f9a5, 0x00, 0x01);
+9 -11
drivers/media/dvb-frontends/af9033_priv.h
··· 1418 1418 { 0x800068, 0x0a }, 1419 1419 { 0x80006a, 0x03 }, 1420 1420 { 0x800070, 0x0a }, 1421 - { 0x800071, 0x05 }, 1421 + { 0x800071, 0x0a }, 1422 1422 { 0x800072, 0x02 }, 1423 1423 { 0x800075, 0x8c }, 1424 1424 { 0x800076, 0x8c }, ··· 1484 1484 { 0x800104, 0x02 }, 1485 1485 { 0x800105, 0xbe }, 1486 1486 { 0x800106, 0x00 }, 1487 - { 0x800109, 0x02 }, 1488 1487 { 0x800115, 0x0a }, 1489 1488 { 0x800116, 0x03 }, 1490 1489 { 0x80011a, 0xbe }, ··· 1509 1510 { 0x80014b, 0x8c }, 1510 1511 { 0x80014d, 0xac }, 1511 1512 { 0x80014e, 0xc6 }, 1512 - { 0x80014f, 0x03 }, 1513 1513 { 0x800151, 0x1e }, 1514 1514 { 0x800153, 0xbc }, 1515 1515 { 0x800178, 0x09 }, ··· 1520 1522 { 0x80018d, 0x5f }, 1521 1523 { 0x80018f, 0xa0 }, 1522 1524 { 0x800190, 0x5a }, 1523 - { 0x80ed02, 0xff }, 1524 - { 0x80ee42, 0xff }, 1525 - { 0x80ee82, 0xff }, 1525 + { 0x800191, 0x00 }, 1526 + { 0x80ed02, 0x40 }, 1527 + { 0x80ee42, 0x40 }, 1528 + { 0x80ee82, 0x40 }, 1526 1529 { 0x80f000, 0x0f }, 1527 1530 { 0x80f01f, 0x8c }, 1528 1531 { 0x80f020, 0x00 }, ··· 1698 1699 { 0x800104, 0x02 }, 1699 1700 { 0x800105, 0xc8 }, 1700 1701 { 0x800106, 0x00 }, 1701 - { 0x800109, 0x02 }, 1702 1702 { 0x800115, 0x0a }, 1703 1703 { 0x800116, 0x03 }, 1704 1704 { 0x80011a, 0xc6 }, ··· 1723 1725 { 0x80014b, 0x8c }, 1724 1726 { 0x80014d, 0xa8 }, 1725 1727 { 0x80014e, 0xc6 }, 1726 - { 0x80014f, 0x03 }, 1727 1728 { 0x800151, 0x28 }, 1728 1729 { 0x800153, 0xcc }, 1729 1730 { 0x800178, 0x09 }, ··· 1734 1737 { 0x80018d, 0x5f }, 1735 1738 { 0x80018f, 0xfb }, 1736 1739 { 0x800190, 0x5c }, 1737 - { 0x80ed02, 0xff }, 1738 - { 0x80ee42, 0xff }, 1739 - { 0x80ee82, 0xff }, 1740 + { 0x800191, 0x00 }, 1741 + { 0x80ed02, 0x40 }, 1742 + { 0x80ee42, 0x40 }, 1743 + { 0x80ee82, 0x40 }, 1740 1744 { 0x80f000, 0x0f }, 1741 1745 { 0x80f01f, 0x8c }, 1742 1746 { 0x80f020, 0x00 },
+3 -10
drivers/media/i2c/smiapp/smiapp-core.c
··· 1282 1282 1283 1283 mutex_lock(&sensor->power_mutex); 1284 1284 1285 - /* 1286 - * If the power count is modified from 0 to != 0 or from != 0 1287 - * to 0, update the power state. 1288 - */ 1289 - if (!sensor->power_count == !on) 1290 - goto out; 1291 - 1292 - if (on) { 1285 + if (on && !sensor->power_count) { 1293 1286 /* Power on and perform initialisation. */ 1294 1287 ret = smiapp_power_on(sensor); 1295 1288 if (ret < 0) 1296 1289 goto out; 1297 - } else { 1290 + } else if (!on && sensor->power_count == 1) { 1298 1291 smiapp_power_off(sensor); 1299 1292 } 1300 1293 ··· 2565 2572 2566 2573 this->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 2567 2574 this->sd.internal_ops = &smiapp_internal_ops; 2568 - this->sd.owner = NULL; 2575 + this->sd.owner = THIS_MODULE; 2569 2576 v4l2_set_subdevdata(&this->sd, client); 2570 2577 2571 2578 rval = media_entity_init(&this->sd.entity,
+1
drivers/media/pci/cx18/cx18-driver.c
··· 1091 1091 setup.addr = ADDR_UNSET; 1092 1092 setup.type = cx->options.tuner; 1093 1093 setup.mode_mask = T_ANALOG_TV; /* matches TV tuners */ 1094 + setup.config = NULL; 1094 1095 if (cx->options.radio > 0) 1095 1096 setup.mode_mask |= T_RADIO; 1096 1097 setup.tuner_callback = (setup.type == TUNER_XC2028) ?
+6
drivers/media/tuners/tuner_it913x.c
··· 396 396 struct i2c_adapter *i2c_adap, u8 i2c_addr, u8 config) 397 397 { 398 398 struct it913x_state *state = NULL; 399 + int ret; 399 400 400 401 /* allocate memory for the internal state */ 401 402 state = kzalloc(sizeof(struct it913x_state), GFP_KERNEL); ··· 425 424 426 425 state->tuner_type = config; 427 426 state->firmware_ver = 1; 427 + 428 + /* tuner RF initial */ 429 + ret = it913x_wr_reg(state, PRO_DMOD, 0xec4c, 0x68); 430 + if (ret < 0) 431 + goto error; 428 432 429 433 fe->tuner_priv = state; 430 434 memcpy(&fe->ops.tuner_ops, &it913x_tuner_ops,
+4
drivers/media/usb/dvb-usb-v2/af9035.c
··· 1575 1575 &af9035_props, "Leadtek WinFast DTV Dongle Dual", NULL) }, 1576 1576 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xf900, 1577 1577 &af9035_props, "Hauppauge WinTV-MiniStick 2", NULL) }, 1578 + { DVB_USB_DEVICE(USB_VID_PCTV, USB_PID_PCTV_78E, 1579 + &af9035_props, "PCTV 78e", RC_MAP_IT913X_V1) }, 1580 + { DVB_USB_DEVICE(USB_VID_PCTV, USB_PID_PCTV_79E, 1581 + &af9035_props, "PCTV 79e", RC_MAP_IT913X_V2) }, 1578 1582 { } 1579 1583 }; 1580 1584 MODULE_DEVICE_TABLE(usb, af9035_id_table);
+38
drivers/pci/host/pci-imx6.c
··· 49 49 50 50 /* PCIe Port Logic registers (memory-mapped) */ 51 51 #define PL_OFFSET 0x700 52 + #define PCIE_PL_PFLR (PL_OFFSET + 0x08) 53 + #define PCIE_PL_PFLR_LINK_STATE_MASK (0x3f << 16) 54 + #define PCIE_PL_PFLR_FORCE_LINK (1 << 15) 52 55 #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) 53 56 #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) 54 57 #define PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING (1 << 29) ··· 217 214 static int imx6_pcie_assert_core_reset(struct pcie_port *pp) 218 215 { 219 216 struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); 217 + u32 val, gpr1, gpr12; 218 + 219 + /* 220 + * If the bootloader already enabled the link we need some special 221 + * handling to get the core back into a state where it is safe to 222 + * touch it for configuration. As there is no dedicated reset signal 223 + * wired up for MX6QDL, we need to manually force LTSSM into "detect" 224 + * state before completely disabling LTSSM, which is a prerequisite 225 + * for core configuration. 226 + * 227 + * If both LTSSM_ENABLE and REF_SSP_ENABLE are active we have a strong 228 + * indication that the bootloader activated the link. 229 + */ 230 + regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, &gpr1); 231 + regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, &gpr12); 232 + 233 + if ((gpr1 & IMX6Q_GPR1_PCIE_REF_CLK_EN) && 234 + (gpr12 & IMX6Q_GPR12_PCIE_CTL_2)) { 235 + val = readl(pp->dbi_base + PCIE_PL_PFLR); 236 + val &= ~PCIE_PL_PFLR_LINK_STATE_MASK; 237 + val |= PCIE_PL_PFLR_FORCE_LINK; 238 + writel(val, pp->dbi_base + PCIE_PL_PFLR); 239 + 240 + regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, 241 + IMX6Q_GPR12_PCIE_CTL_2, 0 << 10); 242 + } 220 243 221 244 regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, 222 245 IMX6Q_GPR1_PCIE_TEST_PD, 1 << 18); ··· 618 589 return 0; 619 590 } 620 591 592 + static void imx6_pcie_shutdown(struct platform_device *pdev) 593 + { 594 + struct imx6_pcie *imx6_pcie = platform_get_drvdata(pdev); 595 + 596 + /* bring down link, so bootloader gets clean state in case of reboot */ 597 + imx6_pcie_assert_core_reset(&imx6_pcie->pp); 598 + } 599 + 621 600 static const struct of_device_id imx6_pcie_of_match[] = { 622 601 { .compatible = "fsl,imx6q-pcie", }, 623 602 {}, ··· 638 601 .owner = THIS_MODULE, 639 602 .of_match_table = imx6_pcie_of_match, 640 603 }, 604 + .shutdown = imx6_pcie_shutdown, 641 605 }; 642 606 643 607 /* Freescale PCIe driver does not allow module unload */
+6 -10
drivers/pci/hotplug/acpiphp_glue.c
··· 560 560 slot->flags &= (~SLOT_ENABLED); 561 561 } 562 562 563 - static bool acpiphp_no_hotplug(struct acpi_device *adev) 564 - { 565 - return adev && adev->flags.no_hotplug; 566 - } 567 - 568 563 static bool slot_no_hotplug(struct acpiphp_slot *slot) 569 564 { 570 - struct acpiphp_func *func; 565 + struct pci_bus *bus = slot->bus; 566 + struct pci_dev *dev; 571 567 572 - list_for_each_entry(func, &slot->funcs, sibling) 573 - if (acpiphp_no_hotplug(func_to_acpi_device(func))) 568 + list_for_each_entry(dev, &bus->devices, bus_list) { 569 + if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug) 574 570 return true; 575 - 571 + } 576 572 return false; 577 573 } 578 574 ··· 641 645 642 646 status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta); 643 647 alive = (ACPI_SUCCESS(status) && device_status_valid(sta)) 644 - || acpiphp_no_hotplug(adev); 648 + || dev->ignore_hotplug; 645 649 } 646 650 if (!alive) 647 651 alive = pci_device_is_present(dev);
+12
drivers/pci/hotplug/pciehp_hpc.c
··· 506 506 { 507 507 struct controller *ctrl = (struct controller *)dev_id; 508 508 struct pci_dev *pdev = ctrl_dev(ctrl); 509 + struct pci_bus *subordinate = pdev->subordinate; 510 + struct pci_dev *dev; 509 511 struct slot *slot = ctrl->slot; 510 512 u16 detected, intr_loc; 511 513 ··· 539 537 ctrl->cmd_busy = 0; 540 538 smp_mb(); 541 539 wake_up(&ctrl->queue); 540 + } 541 + 542 + if (subordinate) { 543 + list_for_each_entry(dev, &subordinate->devices, bus_list) { 544 + if (dev->ignore_hotplug) { 545 + ctrl_dbg(ctrl, "ignoring hotplug event %#06x (%s requested no hotplug)\n", 546 + intr_loc, pci_name(dev)); 547 + return IRQ_HANDLED; 548 + } 549 + } 542 550 } 543 551 544 552 if (!(intr_loc & ~PCI_EXP_SLTSTA_CC))
+1 -5
drivers/pci/hotplug/pcihp_slot.c
··· 46 46 */ 47 47 if (pci_is_pcie(dev)) 48 48 return; 49 - dev_info(&dev->dev, "using default PCI settings\n"); 50 49 hpp = &pci_default_type0; 51 50 } 52 51 ··· 152 153 { 153 154 struct pci_dev *cdev; 154 155 struct hotplug_params hpp; 155 - int ret; 156 156 157 157 if (!(dev->hdr_type == PCI_HEADER_TYPE_NORMAL || 158 158 (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE && ··· 161 163 pcie_bus_configure_settings(dev->bus); 162 164 163 165 memset(&hpp, 0, sizeof(hpp)); 164 - ret = pci_get_hp_params(dev, &hpp); 165 - if (ret) 166 - dev_warn(&dev->dev, "no hotplug settings from platform\n"); 166 + pci_get_hp_params(dev, &hpp); 167 167 168 168 program_hpp_type2(dev, hpp.t2); 169 169 program_hpp_type1(dev, hpp.t1);
+2
drivers/phy/Kconfig
··· 214 214 config PHY_ST_SPEAR1310_MIPHY 215 215 tristate "ST SPEAR1310-MIPHY driver" 216 216 select GENERIC_PHY 217 + depends on MACH_SPEAR1310 || COMPILE_TEST 217 218 help 218 219 Support for ST SPEAr1310 MIPHY which can be used for PCIe and SATA. 219 220 220 221 config PHY_ST_SPEAR1340_MIPHY 221 222 tristate "ST SPEAR1340-MIPHY driver" 222 223 select GENERIC_PHY 224 + depends on MACH_SPEAR1340 || COMPILE_TEST 223 225 help 224 226 Support for ST SPEAr1340 MIPHY which can be used for PCIe and SATA. 225 227
+1
drivers/phy/phy-miphy365x.c
··· 163 163 }; 164 164 165 165 static u8 rx_tx_spd[] = { 166 + 0, /* GEN0 doesn't exist. */ 166 167 TX_SPDSEL_GEN1_VAL | RX_SPDSEL_GEN1_VAL, 167 168 TX_SPDSEL_GEN2_VAL | RX_SPDSEL_GEN2_VAL, 168 169 TX_SPDSEL_GEN3_VAL | RX_SPDSEL_GEN3_VAL
+1 -1
drivers/regulator/88pm8607.c
··· 319 319 struct regulator_config *config) 320 320 { 321 321 struct device_node *nproot, *np; 322 - nproot = of_node_get(pdev->dev.parent->of_node); 322 + nproot = pdev->dev.parent->of_node; 323 323 if (!nproot) 324 324 return -ENODEV; 325 325 nproot = of_get_child_by_name(nproot, "regulators");
+2 -2
drivers/regulator/da9052-regulator.c
··· 422 422 config.init_data = pdata->regulators[pdev->id]; 423 423 } else { 424 424 #ifdef CONFIG_OF 425 - struct device_node *nproot, *np; 425 + struct device_node *nproot = da9052->dev->of_node; 426 + struct device_node *np; 426 427 427 - nproot = of_node_get(da9052->dev->of_node); 428 428 if (!nproot) 429 429 return -ENODEV; 430 430
+1 -1
drivers/regulator/max8907-regulator.c
··· 226 226 struct device_node *np, *regulators; 227 227 int ret; 228 228 229 - np = of_node_get(pdev->dev.parent->of_node); 229 + np = pdev->dev.parent->of_node; 230 230 if (!np) 231 231 return 0; 232 232
+1 -1
drivers/regulator/max8925-regulator.c
··· 250 250 struct device_node *nproot, *np; 251 251 int rcount; 252 252 253 - nproot = of_node_get(pdev->dev.parent->of_node); 253 + nproot = pdev->dev.parent->of_node; 254 254 if (!nproot) 255 255 return -ENODEV; 256 256 np = of_get_child_by_name(nproot, "regulators");
+1 -1
drivers/regulator/max8997.c
··· 917 917 struct max8997_regulator_data *rdata; 918 918 unsigned int i, dvs_voltage_nr = 1, ret; 919 919 920 - pmic_np = of_node_get(iodev->dev->of_node); 920 + pmic_np = iodev->dev->of_node; 921 921 if (!pmic_np) { 922 922 dev_err(&pdev->dev, "could not find pmic sub-node\n"); 923 923 return -ENODEV;
-1
drivers/regulator/palmas-regulator.c
··· 1427 1427 u32 prop; 1428 1428 int idx, ret; 1429 1429 1430 - node = of_node_get(node); 1431 1430 regulators = of_get_child_by_name(node, "regulators"); 1432 1431 if (!regulators) { 1433 1432 dev_info(dev, "regulator node not found\n");
+1 -1
drivers/regulator/tps65910-regulator.c
··· 1014 1014 if (!pmic_plat_data) 1015 1015 return NULL; 1016 1016 1017 - np = of_node_get(pdev->dev.parent->of_node); 1017 + np = pdev->dev.parent->of_node; 1018 1018 regulators = of_get_child_by_name(np, "regulators"); 1019 1019 if (!regulators) { 1020 1020 dev_err(&pdev->dev, "regulator node not found\n");
+10
drivers/scsi/libiscsi.c
··· 717 717 return NULL; 718 718 } 719 719 720 + if (data_size > ISCSI_DEF_MAX_RECV_SEG_LEN) { 721 + iscsi_conn_printk(KERN_ERR, conn, "Invalid buffer len of %u for login task. Max len is %u\n", data_size, ISCSI_DEF_MAX_RECV_SEG_LEN); 722 + return NULL; 723 + } 724 + 720 725 task = conn->login_task; 721 726 } else { 722 727 if (session->state != ISCSI_STATE_LOGGED_IN) 723 728 return NULL; 729 + 730 + if (data_size != 0) { 731 + iscsi_conn_printk(KERN_ERR, conn, "Can not send data buffer of len %u for op 0x%x\n", data_size, opcode); 732 + return NULL; 733 + } 724 734 725 735 BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE); 726 736 BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED);
+3 -2
drivers/scsi/scsi_lib.c
··· 733 733 } else { 734 734 unsigned long flags; 735 735 736 + if (bidi_bytes) 737 + scsi_release_bidi_buffers(cmd); 738 + 736 739 spin_lock_irqsave(q->queue_lock, flags); 737 740 blk_finish_request(req, error); 738 741 spin_unlock_irqrestore(q->queue_lock, flags); 739 742 740 - if (bidi_bytes) 741 - scsi_release_bidi_buffers(cmd); 742 743 scsi_release_buffers(cmd); 743 744 scsi_next_command(cmd); 744 745 }
+25 -14
drivers/spi/spi-davinci.c
··· 397 397 struct spi_master *master = spi->master; 398 398 struct device_node *np = spi->dev.of_node; 399 399 bool internal_cs = true; 400 - unsigned long flags = GPIOF_DIR_OUT; 401 400 402 401 dspi = spi_master_get_devdata(spi->master); 403 402 pdata = &dspi->pdata; 404 403 405 - flags |= (spi->mode & SPI_CS_HIGH) ? GPIOF_INIT_LOW : GPIOF_INIT_HIGH; 406 - 407 404 if (!(spi->mode & SPI_NO_CS)) { 408 405 if (np && (master->cs_gpios != NULL) && (spi->cs_gpio >= 0)) { 409 - retval = gpio_request_one(spi->cs_gpio, 410 - flags, dev_name(&spi->dev)); 406 + retval = gpio_direction_output( 407 + spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); 411 408 internal_cs = false; 412 409 } else if (pdata->chip_sel && 413 410 spi->chip_select < pdata->num_chipselect && 414 411 pdata->chip_sel[spi->chip_select] != SPI_INTERN_CS) { 415 412 spi->cs_gpio = pdata->chip_sel[spi->chip_select]; 416 - retval = gpio_request_one(spi->cs_gpio, 417 - flags, dev_name(&spi->dev)); 413 + retval = gpio_direction_output( 414 + spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); 418 415 internal_cs = false; 419 416 } 420 417 ··· 434 437 clear_io_bits(dspi->base + SPIGCR1, SPIGCR1_LOOPBACK_MASK); 435 438 436 439 return retval; 437 - } 438 - 439 - static void davinci_spi_cleanup(struct spi_device *spi) 440 - { 441 - if (spi->cs_gpio >= 0) 442 - gpio_free(spi->cs_gpio); 443 440 } 444 441 445 442 static int davinci_spi_check_error(struct davinci_spi *dspi, int int_status) ··· 947 956 master->num_chipselect = pdata->num_chipselect; 948 957 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16); 949 958 master->setup = davinci_spi_setup; 950 - master->cleanup = davinci_spi_cleanup; 951 959 952 960 dspi->bitbang.chipselect = davinci_spi_chipselect; 953 961 dspi->bitbang.setup_transfer = davinci_spi_setup_transfer; ··· 956 966 dspi->bitbang.flags = SPI_NO_CS | SPI_LSB_FIRST | SPI_LOOP; 957 967 if (dspi->version == SPI_VERSION_2) 958 968 dspi->bitbang.flags |= SPI_READY; 969 + 970 + if (pdev->dev.of_node) { 971 + int i; 972 + 973 + for (i = 0; i < pdata->num_chipselect; i++) { 974 + int cs_gpio = of_get_named_gpio(pdev->dev.of_node, 975 + "cs-gpios", i); 976 + 977 + if (cs_gpio == -EPROBE_DEFER) { 978 + ret = cs_gpio; 979 + goto free_clk; 980 + } 981 + 982 + if (gpio_is_valid(cs_gpio)) { 983 + ret = devm_gpio_request(&pdev->dev, cs_gpio, 984 + dev_name(&pdev->dev)); 985 + if (ret) 986 + goto free_clk; 987 + } 988 + } 989 + } 959 990 960 991 r = platform_get_resource(pdev, IORESOURCE_DMA, 0); 961 992 if (r)
+10 -2
drivers/spi/spi-dw.c
··· 547 547 /* Only alloc on first setup */ 548 548 chip = spi_get_ctldata(spi); 549 549 if (!chip) { 550 - chip = devm_kzalloc(&spi->dev, sizeof(struct chip_data), 551 - GFP_KERNEL); 550 + chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); 552 551 if (!chip) 553 552 return -ENOMEM; 554 553 spi_set_ctldata(spi, chip); ··· 605 606 return 0; 606 607 } 607 608 609 + static void dw_spi_cleanup(struct spi_device *spi) 610 + { 611 + struct chip_data *chip = spi_get_ctldata(spi); 612 + 613 + kfree(chip); 614 + spi_set_ctldata(spi, NULL); 615 + } 616 + 608 617 /* Restart the controller, disable all interrupts, clean rx fifo */ 609 618 static void spi_hw_init(struct dw_spi *dws) 610 619 { ··· 668 661 master->bus_num = dws->bus_num; 669 662 master->num_chipselect = dws->num_cs; 670 663 master->setup = dw_spi_setup; 664 + master->cleanup = dw_spi_cleanup; 671 665 master->transfer_one_message = dw_spi_transfer_one_message; 672 666 master->max_speed_hz = dws->max_freq; 673 667
+12 -3
drivers/spi/spi-fsl-espi.c
··· 452 452 int retval; 453 453 u32 hw_mode; 454 454 u32 loop_mode; 455 - struct spi_mpc8xxx_cs *cs = spi->controller_state; 455 + struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); 456 456 457 457 if (!spi->max_speed_hz) 458 458 return -EINVAL; 459 459 460 460 if (!cs) { 461 - cs = devm_kzalloc(&spi->dev, sizeof(*cs), GFP_KERNEL); 461 + cs = kzalloc(sizeof(*cs), GFP_KERNEL); 462 462 if (!cs) 463 463 return -ENOMEM; 464 - spi->controller_state = cs; 464 + spi_set_ctldata(spi, cs); 465 465 } 466 466 467 467 mpc8xxx_spi = spi_master_get_devdata(spi->master); ··· 494 494 return retval; 495 495 } 496 496 return 0; 497 + } 498 + 499 + static void fsl_espi_cleanup(struct spi_device *spi) 500 + { 501 + struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); 502 + 503 + kfree(cs); 504 + spi_set_ctldata(spi, NULL); 497 505 } 498 506 499 507 void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) ··· 613 605 614 606 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16); 615 607 master->setup = fsl_espi_setup; 608 + master->cleanup = fsl_espi_cleanup; 616 609 617 610 mpc8xxx_spi = spi_master_get_devdata(master); 618 611 mpc8xxx_spi->spi_do_one_msg = fsl_espi_do_one_msg;
+7 -3
drivers/spi/spi-fsl-spi.c
··· 425 425 struct fsl_spi_reg *reg_base; 426 426 int retval; 427 427 u32 hw_mode; 428 - struct spi_mpc8xxx_cs *cs = spi->controller_state; 428 + struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); 429 429 430 430 if (!spi->max_speed_hz) 431 431 return -EINVAL; 432 432 433 433 if (!cs) { 434 - cs = devm_kzalloc(&spi->dev, sizeof(*cs), GFP_KERNEL); 434 + cs = kzalloc(sizeof(*cs), GFP_KERNEL); 435 435 if (!cs) 436 436 return -ENOMEM; 437 - spi->controller_state = cs; 437 + spi_set_ctldata(spi, cs); 438 438 } 439 439 mpc8xxx_spi = spi_master_get_devdata(spi->master); 440 440 ··· 496 496 static void fsl_spi_cleanup(struct spi_device *spi) 497 497 { 498 498 struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); 499 + struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); 499 500 500 501 if (mpc8xxx_spi->type == TYPE_GRLIB && gpio_is_valid(spi->cs_gpio)) 501 502 gpio_free(spi->cs_gpio); 503 + 504 + kfree(cs); 505 + spi_set_ctldata(spi, NULL); 502 506 } 503 507 504 508 static void fsl_spi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events)
+1 -1
drivers/spi/spi-pl022.c
··· 2136 2136 cs_gpio); 2137 2137 else if (gpio_direction_output(cs_gpio, 1)) 2138 2138 dev_err(&adev->dev, 2139 - "could set gpio %d as output\n", 2139 + "could not set gpio %d as output\n", 2140 2140 cs_gpio); 2141 2141 } 2142 2142 }
+3 -2
drivers/spi/spi-rockchip.c
··· 220 220 do { 221 221 if (!(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)) 222 222 return; 223 - } while (time_before(jiffies, timeout)); 223 + } while (!time_after(jiffies, timeout)); 224 224 225 225 dev_warn(rs->dev, "spi controller is in busy state!\n"); 226 226 } ··· 529 529 int ret = 0; 530 530 struct rockchip_spi *rs = spi_master_get_devdata(master); 531 531 532 - WARN_ON((readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)); 532 + WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) && 533 + (readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)); 533 534 534 535 if (!xfer->tx_buf && !xfer->rx_buf) { 535 536 dev_err(rs->dev, "No buffer for transfer\n");
+4 -1
drivers/spi/spi-sirf.c
··· 312 312 u32 cmd; 313 313 314 314 sspi = spi_master_get_devdata(spi->master); 315 + writel(SIRFSOC_SPI_FIFO_RESET, sspi->base + SIRFSOC_SPI_TXFIFO_OP); 316 + writel(SIRFSOC_SPI_FIFO_START, sspi->base + SIRFSOC_SPI_TXFIFO_OP); 315 317 memcpy(&cmd, sspi->tx, t->len); 316 318 if (sspi->word_width == 1 && !(spi->mode & SPI_LSB_FIRST)) 317 319 cmd = cpu_to_be32(cmd) >> ··· 440 438 sspi->tx_word(sspi); 441 439 writel(SIRFSOC_SPI_TXFIFO_EMPTY_INT_EN | 442 440 SIRFSOC_SPI_TX_UFLOW_INT_EN | 443 - SIRFSOC_SPI_RX_OFLOW_INT_EN, 441 + SIRFSOC_SPI_RX_OFLOW_INT_EN | 442 + SIRFSOC_SPI_RX_IO_DMA_INT_EN, 444 443 sspi->base + SIRFSOC_SPI_INT_EN); 445 444 writel(SIRFSOC_SPI_RX_EN | SIRFSOC_SPI_TX_EN, 446 445 sspi->base + SIRFSOC_SPI_TX_RX_EN);
+1 -1
drivers/staging/iio/meter/ade7758_trigger.c
··· 85 85 ret = iio_trigger_register(st->trig); 86 86 87 87 /* select default trigger */ 88 - indio_dev->trig = st->trig; 88 + indio_dev->trig = iio_trigger_get(st->trig); 89 89 if (ret) 90 90 goto error_free_irq; 91 91
+3
drivers/staging/vt6655/hostap.c
··· 341 341 { 342 342 PSMgmtObject pMgmt = pDevice->pMgmt; 343 343 344 + if (param->u.generic_elem.len > sizeof(pMgmt->abyWPAIE)) 345 + return -EINVAL; 346 + 344 347 memcpy(pMgmt->abyWPAIE, 345 348 param->u.generic_elem.data, 346 349 param->u.generic_elem.len
+3 -1
drivers/target/iscsi/iscsi_target.c
··· 4540 4540 { 4541 4541 struct iscsi_conn *l_conn; 4542 4542 struct iscsi_session *sess = conn->sess; 4543 + bool conn_found = false; 4543 4544 4544 4545 if (!sess) 4545 4546 return; ··· 4549 4548 list_for_each_entry(l_conn, &sess->sess_conn_list, conn_list) { 4550 4549 if (l_conn->cid == cid) { 4551 4550 iscsit_inc_conn_usage_count(l_conn); 4551 + conn_found = true; 4552 4552 break; 4553 4553 } 4554 4554 } 4555 4555 spin_unlock_bh(&sess->conn_lock); 4556 4556 4557 - if (!l_conn) 4557 + if (!conn_found) 4558 4558 return; 4559 4559 4560 4560 if (l_conn->sock)
+1 -1
drivers/target/iscsi/iscsi_target_parameters.c
··· 601 601 param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL); 602 602 if (!param_list) { 603 603 pr_err("Unable to allocate memory for struct iscsi_param_list.\n"); 604 - goto err_out; 604 + return -1; 605 605 } 606 606 INIT_LIST_HEAD(&param_list->param_list); 607 607 INIT_LIST_HEAD(&param_list->extra_response_list);
+2
drivers/target/iscsi/iscsi_target_util.c
··· 400 400 401 401 spin_lock_bh(&conn->cmd_lock); 402 402 list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) { 403 + if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT) 404 + continue; 403 405 if (cmd->init_task_tag == init_task_tag) { 404 406 spin_unlock_bh(&conn->cmd_lock); 405 407 return cmd;
+1 -1
drivers/target/target_core_configfs.c
··· 2363 2363 pr_err("Invalid value '%ld', must be '0' or '1'\n", tmp); \ 2364 2364 return -EINVAL; \ 2365 2365 } \ 2366 - if (!tmp) \ 2366 + if (tmp) \ 2367 2367 t->_var |= _bit; \ 2368 2368 else \ 2369 2369 t->_var &= ~_bit; \
+1 -1
drivers/target/target_core_spc.c
··· 664 664 buf[0] = dev->transport->get_device_type(dev); 665 665 buf[3] = 0x0c; 666 666 put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[8]); 667 - put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[12]); 667 + put_unaligned_be32(dev->t10_alua.lba_map_segment_multiplier, &buf[12]); 668 668 669 669 return 0; 670 670 }
-2
drivers/usb/host/ehci-hcd.c
··· 965 965 } 966 966 967 967 qh->exception = 1; 968 - if (ehci->rh_state < EHCI_RH_RUNNING) 969 - qh->qh_state = QH_STATE_IDLE; 970 968 switch (qh->qh_state) { 971 969 case QH_STATE_LINKED: 972 970 WARN_ON(!list_empty(&qh->qtd_list));
+32
drivers/usb/storage/unusual_devs.h
··· 101 101 "PhotoSmart R707", 102 102 USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), 103 103 104 + UNUSUAL_DEV( 0x03f3, 0x0001, 0x0000, 0x9999, 105 + "Adaptec", 106 + "USBConnect 2000", 107 + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, 108 + US_FL_SCM_MULT_TARG ), 109 + 104 110 /* Reported by Sebastian Kapfer <sebastian_kapfer@gmx.net> 105 111 * and Olaf Hering <olh@suse.de> (different bcd's, same vendor/product) 106 112 * for USB floppies that need the SINGLE_LUN enforcement. ··· 1131 1125 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 1132 1126 US_FL_NOT_LOCKABLE), 1133 1127 1128 + UNUSUAL_DEV( 0x085a, 0x0026, 0x0100, 0x0133, 1129 + "Xircom", 1130 + "PortGear USB-SCSI (Mac USB Dock)", 1131 + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, 1132 + US_FL_SCM_MULT_TARG ), 1133 + 1134 + UNUSUAL_DEV( 0x085a, 0x0028, 0x0100, 0x0133, 1135 + "Xircom", 1136 + "PortGear USB to SCSI Converter", 1137 + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, 1138 + US_FL_SCM_MULT_TARG ), 1139 + 1134 1140 /* Submitted by Jan De Luyck <lkml@kcore.org> */ 1135 1141 UNUSUAL_DEV( 0x08bd, 0x1100, 0x0000, 0x0000, 1136 1142 "CITIZEN", ··· 1982 1964 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 1983 1965 US_FL_IGNORE_RESIDUE | US_FL_SANE_SENSE ), 1984 1966 1967 + /* Entrega Technologies U1-SC25 (later Xircom PortGear PGSCSI) 1968 + * and Mac USB Dock USB-SCSI */ 1969 + UNUSUAL_DEV( 0x1645, 0x0007, 0x0100, 0x0133, 1970 + "Entrega Technologies", 1971 + "USB to SCSI Converter", 1972 + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, 1973 + US_FL_SCM_MULT_TARG ), 1974 + 1985 1975 /* Reported by Robert Schedel <r.schedel@yahoo.de> 1986 1976 * Note: this is a 'super top' device like the above 14cd/6600 device */ 1987 1977 UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201, ··· 2011 1985 "PMP400", 2012 1986 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 2013 1987 US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ), 1988 + 1989 + UNUSUAL_DEV( 0x1822, 0x0001, 0x0000, 0x9999, 1990 + "Ariston Technologies", 1991 + "iConnect USB to SCSI adapter", 1992 + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, 1993 + US_FL_SCM_MULT_TARG ), 2014 1994 2015 1995 /* Reported by Hans de Goede <hdegoede@redhat.com> 2016 1996 * These Appotech controllers are found in Picture Frames, they provide a
+11 -2
fs/btrfs/btrfs_inode.h
··· 234 234 BTRFS_I(inode)->last_sub_trans <= 235 235 BTRFS_I(inode)->last_log_commit && 236 236 BTRFS_I(inode)->last_sub_trans <= 237 - BTRFS_I(inode)->root->last_log_commit) 238 - return 1; 237 + BTRFS_I(inode)->root->last_log_commit) { 238 + /* 239 + * After a ranged fsync we might have left some extent maps 240 + * (that fall outside the fsync's range). So return false 241 + * here if the list isn't empty, to make sure btrfs_log_inode() 242 + * will be called and process those extent maps. 243 + */ 244 + smp_mb(); 245 + if (list_empty(&BTRFS_I(inode)->extent_tree.modified_extents)) 246 + return 1; 247 + } 239 248 return 0; 240 249 } 241 250
+2 -12
fs/btrfs/tree-log.c
··· 4093 4093 } 4094 4094 } 4095 4095 4096 - write_lock(&em_tree->lock); 4097 - /* 4098 - * If we're doing a ranged fsync and there are still modified extents 4099 - * in the list, we must run on the next fsync call as it might cover 4100 - * those extents (a full fsync or an fsync for other range). 4101 - */ 4102 - if (list_empty(&em_tree->modified_extents)) { 4103 - BTRFS_I(inode)->logged_trans = trans->transid; 4104 - BTRFS_I(inode)->last_log_commit = 4105 - BTRFS_I(inode)->last_sub_trans; 4106 - } 4107 - write_unlock(&em_tree->lock); 4096 + BTRFS_I(inode)->logged_trans = trans->transid; 4097 + BTRFS_I(inode)->last_log_commit = BTRFS_I(inode)->last_sub_trans; 4108 4098 out_unlock: 4109 4099 if (unlikely(err)) 4110 4100 btrfs_put_logged_extents(&logged_list);
+6 -7
fs/btrfs/volumes.c
··· 529 529 */ 530 530 531 531 /* 532 - * As of now don't allow update to btrfs_fs_device through 533 - * the btrfs dev scan cli, after FS has been mounted. 532 + * For now, we do allow update to btrfs_fs_device through the 533 + * btrfs dev scan cli after FS has been mounted. We're still 534 + * tracking a problem where systems fail mount by subvolume id 535 + * when we reject replacement on a mounted FS. 534 536 */ 535 - if (fs_devices->opened) { 536 - return -EBUSY; 537 - } else { 537 + if (!fs_devices->opened && found_transid < device->generation) { 538 538 /* 539 539 * That is if the FS is _not_ mounted and if you 540 540 * are here, that means there is more than one ··· 542 542 * with larger generation number or the last-in if 543 543 * generation are equal. 544 544 */ 545 - if (found_transid < device->generation) 546 - return -EEXIST; 545 + return -EEXIST; 547 546 } 548 547 549 548 name = rcu_string_strdup(path, GFP_NOFS);
+1 -1
fs/cifs/cifsfs.h
··· 136 136 extern const struct export_operations cifs_export_ops; 137 137 #endif /* CONFIG_CIFS_NFSD_EXPORT */ 138 138 139 - #define CIFS_VERSION "2.04" 139 + #define CIFS_VERSION "2.05" 140 140 #endif /* _CIFSFS_H */
+19
fs/cifs/connect.c
··· 837 837 struct TCP_Server_Info *server = p; 838 838 unsigned int pdu_length; 839 839 char *buf = NULL; 840 + struct task_struct *task_to_wake = NULL; 840 841 struct mid_q_entry *mid_entry; 841 842 842 843 current->flags |= PF_MEMALLOC; ··· 928 927 if (server->smallbuf) /* no sense logging a debug message if NULL */ 929 928 cifs_small_buf_release(server->smallbuf); 930 929 930 + task_to_wake = xchg(&server->tsk, NULL); 931 931 clean_demultiplex_info(server); 932 + 933 + /* if server->tsk was NULL then wait for a signal before exiting */ 934 + if (!task_to_wake) { 935 + set_current_state(TASK_INTERRUPTIBLE); 936 + while (!signal_pending(current)) { 937 + schedule(); 938 + set_current_state(TASK_INTERRUPTIBLE); 939 + } 940 + set_current_state(TASK_RUNNING); 941 + } 942 + 932 943 module_put_and_exit(0); 933 944 } 934 945 ··· 2063 2050 static void 2064 2051 cifs_put_tcp_session(struct TCP_Server_Info *server) 2065 2052 { 2053 + struct task_struct *task; 2054 + 2066 2055 spin_lock(&cifs_tcp_ses_lock); 2067 2056 if (--server->srv_count > 0) { 2068 2057 spin_unlock(&cifs_tcp_ses_lock); ··· 2088 2073 kfree(server->session_key.response); 2089 2074 server->session_key.response = NULL; 2090 2075 server->session_key.len = 0; 2076 + 2077 + task = xchg(&server->tsk, NULL); 2078 + if (task) 2079 + force_sig(SIGKILL, task); 2091 2080 } 2092 2081 2093 2082 static struct TCP_Server_Info *
+9 -3
fs/cifs/link.c
··· 213 213 if (rc) 214 214 goto out; 215 215 216 - rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb, 217 - fromName, buf, &bytes_written); 216 + if (tcon->ses->server->ops->create_mf_symlink) 217 + rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, 218 + cifs_sb, fromName, buf, &bytes_written); 219 + else 220 + rc = -EOPNOTSUPP; 221 + 218 222 if (rc) 219 223 goto out; 220 224 ··· 343 339 if (rc) 344 340 return rc; 345 341 346 - if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) 342 + if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) { 343 + rc = -ENOENT; 347 344 /* it's not a symlink */ 348 345 goto out; 346 + } 349 347 350 348 io_parms.netfid = fid.netfid; 351 349 io_parms.pid = current->tgid;
+16 -4
fs/cifs/netmisc.c
··· 925 925 /* BB what about the timezone? BB */ 926 926 927 927 /* Subtract the NTFS time offset, then convert to 1s intervals. */ 928 - u64 t; 928 + s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET; 929 929 930 - t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET; 931 - ts.tv_nsec = do_div(t, 10000000) * 100; 932 - ts.tv_sec = t; 930 + /* 931 + * Unfortunately can not use normal 64 bit division on 32 bit arch, but 932 + * the alternative, do_div, does not work with negative numbers so have 933 + * to special case them 934 + */ 935 + if (t < 0) { 936 + t = -t; 937 + ts.tv_nsec = (long)(do_div(t, 10000000) * 100); 938 + ts.tv_nsec = -ts.tv_nsec; 939 + ts.tv_sec = -t; 940 + } else { 941 + ts.tv_nsec = (long)do_div(t, 10000000) * 100; 942 + ts.tv_sec = t; 943 + } 944 + 933 945 return ts; 934 946 } 935 947
-17
fs/cifs/sess.c
··· 745 745 sess_free_buffer(sess_data); 746 746 } 747 747 748 - #else 749 - 750 - static void 751 - sess_auth_lanman(struct sess_data *sess_data) 752 - { 753 - sess_data->result = -EOPNOTSUPP; 754 - sess_data->func = NULL; 755 - } 756 748 #endif 757 749 758 750 static void ··· 1095 1103 ses->auth_key.response = NULL; 1096 1104 } 1097 1105 1098 - #else 1099 - 1100 - static void 1101 - sess_auth_kerberos(struct sess_data *sess_data) 1102 - { 1103 - cifs_dbg(VFS, "Kerberos negotiated but upcall support disabled!\n"); 1104 - sess_data->result = -ENOSYS; 1105 - sess_data->func = NULL; 1106 - } 1107 1106 #endif /* ! CONFIG_CIFS_UPCALL */ 1108 1107 1109 1108 /*
+5 -4
fs/gfs2/bmap.c
··· 359 359 * Returns: The length of the extent (minimum of one block) 360 360 */ 361 361 362 - static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, unsigned limit, int *eob) 362 + static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, size_t limit, int *eob) 363 363 { 364 364 const __be64 *end = (start + len); 365 365 const __be64 *first = ptr; ··· 449 449 struct buffer_head *bh_map, struct metapath *mp, 450 450 const unsigned int sheight, 451 451 const unsigned int height, 452 - const unsigned int maxlen) 452 + const size_t maxlen) 453 453 { 454 454 struct gfs2_inode *ip = GFS2_I(inode); 455 455 struct gfs2_sbd *sdp = GFS2_SB(inode); ··· 483 483 } else { 484 484 /* Need to allocate indirect blocks */ 485 485 ptrs_per_blk = height > 1 ? sdp->sd_inptrs : sdp->sd_diptrs; 486 - dblks = min(maxlen, ptrs_per_blk - mp->mp_list[end_of_metadata]); 486 + dblks = min(maxlen, (size_t)(ptrs_per_blk - 487 + mp->mp_list[end_of_metadata])); 487 488 if (height == ip->i_height) { 488 489 /* Writing into existing tree, extend tree down */ 489 490 iblks = height - sheight; ··· 606 605 struct gfs2_inode *ip = GFS2_I(inode); 607 606 struct gfs2_sbd *sdp = GFS2_SB(inode); 608 607 unsigned int bsize = sdp->sd_sb.sb_bsize; 609 - const unsigned int maxlen = bh_map->b_size >> inode->i_blkbits; 608 + const size_t maxlen = bh_map->b_size >> inode->i_blkbits; 610 609 const u64 *arr = sdp->sd_heightsize; 611 610 __be64 *ptr; 612 611 u64 size;
+12 -3
fs/gfs2/file.c
··· 26 26 #include <linux/dlm.h> 27 27 #include <linux/dlm_plock.h> 28 28 #include <linux/aio.h> 29 + #include <linux/delay.h> 29 30 30 31 #include "gfs2.h" 31 32 #include "incore.h" ··· 980 979 unsigned int state; 981 980 int flags; 982 981 int error = 0; 982 + int sleeptime; 983 983 984 984 state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; 985 - flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY) | GL_EXACT; 985 + flags = (IS_SETLKW(cmd) ? 0 : LM_FLAG_TRY_1CB) | GL_EXACT; 986 986 987 987 mutex_lock(&fp->f_fl_mutex); 988 988 ··· 1003 1001 gfs2_holder_init(gl, state, flags, fl_gh); 1004 1002 gfs2_glock_put(gl); 1005 1003 } 1006 - error = gfs2_glock_nq(fl_gh); 1004 + for (sleeptime = 1; sleeptime <= 4; sleeptime <<= 1) { 1005 + error = gfs2_glock_nq(fl_gh); 1006 + if (error != GLR_TRYFAILED) 1007 + break; 1008 + fl_gh->gh_flags = LM_FLAG_TRY | GL_EXACT; 1009 + fl_gh->gh_error = 0; 1010 + msleep(sleeptime); 1011 + } 1007 1012 if (error) { 1008 1013 gfs2_holder_uninit(fl_gh); 1009 1014 if (error == GLR_TRYFAILED) ··· 1033 1024 mutex_lock(&fp->f_fl_mutex); 1034 1025 flock_lock_file_wait(file, fl); 1035 1026 if (fl_gh->gh_gl) { 1036 - gfs2_glock_dq_wait(fl_gh); 1027 + gfs2_glock_dq(fl_gh); 1037 1028 gfs2_holder_uninit(fl_gh); 1038 1029 } 1039 1030 mutex_unlock(&fp->f_fl_mutex);
+5 -2
fs/gfs2/incore.h
··· 262 262 unsigned long gh_ip; 263 263 }; 264 264 265 + /* Number of quota types we support */ 266 + #define GFS2_MAXQUOTAS 2 267 + 265 268 /* Resource group multi-block reservation, in order of appearance: 266 269 267 270 Step 1. Function prepares to write, allocates a mb, sets the size hint. ··· 285 282 u64 rs_inum; /* Inode number for reservation */ 286 283 287 284 /* ancillary quota stuff */ 288 - struct gfs2_quota_data *rs_qa_qd[2 * MAXQUOTAS]; 289 - struct gfs2_holder rs_qa_qd_ghs[2 * MAXQUOTAS]; 285 + struct gfs2_quota_data *rs_qa_qd[2 * GFS2_MAXQUOTAS]; 286 + struct gfs2_holder rs_qa_qd_ghs[2 * GFS2_MAXQUOTAS]; 290 287 unsigned int rs_qa_qd_num; 291 288 }; 292 289
+6 -3
fs/gfs2/inode.c
··· 626 626 if (!IS_ERR(inode)) { 627 627 d = d_splice_alias(inode, dentry); 628 628 error = PTR_ERR(d); 629 - if (IS_ERR(d)) 629 + if (IS_ERR(d)) { 630 + inode = ERR_CAST(d); 630 631 goto fail_gunlock; 632 + } 631 633 error = 0; 632 634 if (file) { 633 635 if (S_ISREG(inode->i_mode)) { ··· 842 840 int error; 843 841 844 842 inode = gfs2_lookupi(dir, &dentry->d_name, 0); 845 - if (!inode) 843 + if (inode == NULL) { 844 + d_add(dentry, NULL); 846 845 return NULL; 846 + } 847 847 if (IS_ERR(inode)) 848 848 return ERR_CAST(inode); 849 849 ··· 858 854 859 855 d = d_splice_alias(inode, dentry); 860 856 if (IS_ERR(d)) { 861 - iput(inode); 862 857 gfs2_glock_dq_uninit(&gh); 863 858 return d; 864 859 }
+10 -10
fs/gfs2/super.c
··· 1294 1294 int val; 1295 1295 1296 1296 if (is_ancestor(root, sdp->sd_master_dir)) 1297 - seq_printf(s, ",meta"); 1297 + seq_puts(s, ",meta"); 1298 1298 if (args->ar_lockproto[0]) 1299 1299 seq_printf(s, ",lockproto=%s", args->ar_lockproto); 1300 1300 if (args->ar_locktable[0]) ··· 1302 1302 if (args->ar_hostdata[0]) 1303 1303 seq_printf(s, ",hostdata=%s", args->ar_hostdata); 1304 1304 if (args->ar_spectator) 1305 - seq_printf(s, ",spectator"); 1305 + seq_puts(s, ",spectator"); 1306 1306 if (args->ar_localflocks) 1307 - seq_printf(s, ",localflocks"); 1307 + seq_puts(s, ",localflocks"); 1308 1308 if (args->ar_debug) 1309 - seq_printf(s, ",debug"); 1309 + seq_puts(s, ",debug"); 1310 1310 if (args->ar_posix_acl) 1311 - seq_printf(s, ",acl"); 1311 + seq_puts(s, ",acl"); 1312 1312 if (args->ar_quota != GFS2_QUOTA_DEFAULT) { 1313 1313 char *state; 1314 1314 switch (args->ar_quota) { ··· 1328 1328 seq_printf(s, ",quota=%s", state); 1329 1329 } 1330 1330 if (args->ar_suiddir) 1331 - seq_printf(s, ",suiddir"); 1331 + seq_puts(s, ",suiddir"); 1332 1332 if (args->ar_data != GFS2_DATA_DEFAULT) { 1333 1333 char *state; 1334 1334 switch (args->ar_data) { ··· 1345 1345 seq_printf(s, ",data=%s", state); 1346 1346 } 1347 1347 if (args->ar_discard) 1348 - seq_printf(s, ",discard"); 1348 + seq_puts(s, ",discard"); 1349 1349 val = sdp->sd_tune.gt_logd_secs; 1350 1350 if (val != 30) 1351 1351 seq_printf(s, ",commit=%d", val); ··· 1376 1376 seq_printf(s, ",errors=%s", state); 1377 1377 } 1378 1378 if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags)) 1379 - seq_printf(s, ",nobarrier"); 1379 + seq_puts(s, ",nobarrier"); 1380 1380 if (test_bit(SDF_DEMOTE, &sdp->sd_flags)) 1381 - seq_printf(s, ",demote_interface_used"); 1381 + seq_puts(s, ",demote_interface_used"); 1382 1382 if (args->ar_rgrplvb) 1383 - seq_printf(s, ",rgrplvb"); 1383 + seq_puts(s, ",rgrplvb"); 1384 1384 return 0; 1385 1385 } 1386 1386
+18 -21
fs/namei.c
··· 1674 1674 1675 1675 /* 1676 1676 * Calculate the length and hash of the path component, and 1677 - * fill in the qstr. return the "len" as the result. 1677 + * return the "hash_len" as the result. 1678 1678 */ 1679 - static inline unsigned long hash_name(const char *name, struct qstr *res) 1679 + static inline u64 hash_name(const char *name) 1680 1680 { 1681 1681 unsigned long a, b, adata, bdata, mask, hash, len; 1682 1682 const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; 1683 1683 1684 - res->name = name; 1685 1684 hash = a = 0; 1686 1685 len = -sizeof(unsigned long); 1687 1686 do { ··· 1697 1698 1698 1699 hash += a & zero_bytemask(mask); 1699 1700 len += find_zero(mask); 1700 - res->hash_len = hashlen_create(fold_hash(hash), len); 1701 - 1702 - return len; 1701 + return hashlen_create(fold_hash(hash), len); 1703 1702 } 1704 1703 1705 1704 #else ··· 1715 1718 * We know there's a real path component here of at least 1716 1719 * one character. 1717 1720 */ 1718 - static inline long hash_name(const char *name, struct qstr *res) 1721 + static inline u64 hash_name(const char *name) 1719 1722 { 1720 1723 unsigned long hash = init_name_hash(); 1721 1724 unsigned long len = 0, c; 1722 1725 1723 - res->name = name; 1724 1726 c = (unsigned char)*name; 1725 1727 do { 1726 1728 len++; 1727 1729 hash = partial_name_hash(c, hash); 1728 1730 c = (unsigned char)name[len]; 1729 1731 } while (c && c != '/'); 1730 - res->hash_len = hashlen_create(end_name_hash(hash), len); 1731 - return len; 1732 + return hashlen_create(end_name_hash(hash), len); 1732 1733 } 1733 1734 1734 1735 #endif ··· 1751 1756 1752 1757 /* At this point we know we have a real path component. */ 1753 1758 for(;;) { 1754 - struct qstr this; 1755 - long len; 1759 + u64 hash_len; 1756 1760 int type; 1757 1761 1758 1762 err = may_lookup(nd); 1759 1763 if (err) 1760 1764 break; 1761 1765 1762 - len = hash_name(name, &this); 1766 + hash_len = hash_name(name); 1763 1767 1764 1768 type = LAST_NORM; 1765 - if (name[0] == '.') switch (len) { 1769 + if (name[0] == '.') switch (hashlen_len(hash_len)) { 1766 1770 case 2: 1767 1771 if (name[1] == '.') { 1768 1772 type = LAST_DOTDOT; ··· 1775 1781 struct dentry *parent = nd->path.dentry; 1776 1782 nd->flags &= ~LOOKUP_JUMPED; 1777 1783 if (unlikely(parent->d_flags & DCACHE_OP_HASH)) { 1784 + struct qstr this = { { .hash_len = hash_len }, .name = name }; 1778 1785 err = parent->d_op->d_hash(parent, &this); 1779 1786 if (err < 0) 1780 1787 break; 1788 + hash_len = this.hash_len; 1789 + name = this.name; 1781 1790 } 1782 1791 } 1783 1792 1784 - nd->last = this; 1793 + nd->last.hash_len = hash_len; 1794 + nd->last.name = name; 1785 1795 nd->last_type = type; 1786 1796 1787 - if (!name[len]) 1797 + name += hashlen_len(hash_len); 1798 + if (!*name) 1788 1799 return 0; 1789 1800 /* 1790 1801 * If it wasn't NUL, we know it was '/'. Skip that 1791 1802 * slash, and continue until no more slashes. 1792 1803 */ 1793 1804 do { 1794 - len++; 1795 - } while (unlikely(name[len] == '/')); 1796 - if (!name[len]) 1805 + name++; 1806 + } while (unlikely(*name == '/')); 1807 + if (!*name) 1797 1808 return 0; 1798 - 1799 - name += len; 1800 1809 1801 1810 err = walk_component(nd, &next, LOOKUP_FOLLOW); 1802 1811 if (err < 0)
+20 -18
fs/nfs/nfs4client.c
··· 482 482 483 483 spin_lock(&nn->nfs_client_lock); 484 484 list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) { 485 + 486 + if (pos->rpc_ops != new->rpc_ops) 487 + continue; 488 + 489 + if (pos->cl_proto != new->cl_proto) 490 + continue; 491 + 492 + if (pos->cl_minorversion != new->cl_minorversion) 493 + continue; 494 + 485 495 /* If "pos" isn't marked ready, we can't trust the 486 496 * remaining fields in "pos" */ 487 497 if (pos->cl_cons_state > NFS_CS_READY) { ··· 509 499 spin_lock(&nn->nfs_client_lock); 510 500 } 511 501 if (pos->cl_cons_state != NFS_CS_READY) 512 - continue; 513 - 514 - if (pos->rpc_ops != new->rpc_ops) 515 - continue; 516 - 517 - if (pos->cl_proto != new->cl_proto) 518 - continue; 519 - 520 - if (pos->cl_minorversion != new->cl_minorversion) 521 502 continue; 522 503 523 504 if (pos->cl_clientid != new->cl_clientid) ··· 623 622 624 623 spin_lock(&nn->nfs_client_lock); 625 624 list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) { 625 + 626 + if (pos->rpc_ops != new->rpc_ops) 627 + continue; 628 + 629 + if (pos->cl_proto != new->cl_proto) 630 + continue; 631 + 632 + if (pos->cl_minorversion != new->cl_minorversion) 633 + continue; 634 + 626 635 /* If "pos" isn't marked ready, we can't trust the 627 636 * remaining fields in "pos", especially the client 628 637 * ID and serverowner fields. Wait for CREATE_SESSION ··· 656 645 status = -NFS4ERR_STALE_CLIENTID; 657 646 } 658 647 if (pos->cl_cons_state != NFS_CS_READY) 659 - continue; 660 - 661 - if (pos->rpc_ops != new->rpc_ops) 662 - continue; 663 - 664 - if (pos->cl_proto != new->cl_proto) 665 - continue; 666 - 667 - if (pos->cl_minorversion != new->cl_minorversion) 668 648 continue; 669 649 670 650 if (!nfs4_match_clientids(pos, new))
+22 -18
fs/nfs/nfs4proc.c
··· 2226 2226 ret = _nfs4_proc_open(opendata); 2227 2227 if (ret != 0) { 2228 2228 if (ret == -ENOENT) { 2229 - d_drop(opendata->dentry); 2230 - d_add(opendata->dentry, NULL); 2231 - nfs_set_verifier(opendata->dentry, 2229 + dentry = opendata->dentry; 2230 + if (dentry->d_inode) 2231 + d_delete(dentry); 2232 + else if (d_unhashed(dentry)) 2233 + d_add(dentry, NULL); 2234 + 2235 + nfs_set_verifier(dentry, 2232 2236 nfs_save_change_attribute(opendata->dir->d_inode)); 2233 2237 } 2234 2238 goto out; ··· 2618 2614 is_rdwr = test_bit(NFS_O_RDWR_STATE, &state->flags); 2619 2615 is_rdonly = test_bit(NFS_O_RDONLY_STATE, &state->flags); 2620 2616 is_wronly = test_bit(NFS_O_WRONLY_STATE, &state->flags); 2621 - /* Calculate the current open share mode */ 2622 - calldata->arg.fmode = 0; 2623 - if (is_rdonly || is_rdwr) 2624 - calldata->arg.fmode |= FMODE_READ; 2625 - if (is_wronly || is_rdwr) 2626 - calldata->arg.fmode |= FMODE_WRITE; 2627 2617 /* Calculate the change in open mode */ 2618 + calldata->arg.fmode = 0; 2628 2619 if (state->n_rdwr == 0) { 2629 - if (state->n_rdonly == 0) { 2630 - call_close |= is_rdonly || is_rdwr; 2631 - calldata->arg.fmode &= ~FMODE_READ; 2632 - } 2633 - if (state->n_wronly == 0) { 2634 - call_close |= is_wronly || is_rdwr; 2635 - calldata->arg.fmode &= ~FMODE_WRITE; 2636 - } 2637 - } 2620 + if (state->n_rdonly == 0) 2621 + call_close |= is_rdonly; 2622 + else if (is_rdonly) 2623 + calldata->arg.fmode |= FMODE_READ; 2624 + if (state->n_wronly == 0) 2625 + call_close |= is_wronly; 2626 + else if (is_wronly) 2627 + calldata->arg.fmode |= FMODE_WRITE; 2628 + } else if (is_rdwr) 2629 + calldata->arg.fmode |= FMODE_READ|FMODE_WRITE; 2630 + 2631 + if (calldata->arg.fmode == 0) 2632 + call_close |= is_rdwr; 2633 + 2638 2634 if (!nfs4_valid_open_stateid(state)) 2639 2635 call_close = 0; 2640 2636 spin_unlock(&state->owner->so_lock);
+1 -3
include/acpi/acpi_bus.h
··· 204 204 u32 match_driver:1; 205 205 u32 initialized:1; 206 206 u32 visited:1; 207 - u32 no_hotplug:1; 208 207 u32 hotplug_notify:1; 209 208 u32 is_dock_station:1; 210 - u32 reserved:22; 209 + u32 reserved:23; 211 210 }; 212 211 213 212 /* File System */ ··· 410 411 int acpi_bus_get_private_data(acpi_handle, void **); 411 412 int acpi_bus_attach_private_data(acpi_handle, void *); 412 413 void acpi_bus_detach_private_data(acpi_handle); 413 - void acpi_bus_no_hotplug(acpi_handle handle); 414 414 extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); 415 415 extern int register_acpi_notifier(struct notifier_block *); 416 416 extern int unregister_acpi_notifier(struct notifier_block *);
+13
include/crypto/drbg.h
··· 162 162 163 163 static inline size_t drbg_max_addtl(struct drbg_state *drbg) 164 164 { 165 + #if (__BITS_PER_LONG == 32) 166 + /* 167 + * SP800-90A allows smaller maximum numbers to be returned -- we 168 + * return SIZE_MAX - 1 to allow the verification of the enforcement 169 + * of this value in drbg_healthcheck_sanity. 170 + */ 171 + return (SIZE_MAX - 1); 172 + #else 165 173 return (1UL<<(drbg->core->max_addtllen)); 174 + #endif 166 175 } 167 176 168 177 static inline size_t drbg_max_requests(struct drbg_state *drbg) 169 178 { 179 + #if (__BITS_PER_LONG == 32) 180 + return SIZE_MAX; 181 + #else 170 182 return (1UL<<(drbg->core->max_req)); 183 + #endif 171 184 } 172 185 173 186 /*
+3 -1
include/linux/iio/trigger.h
··· 84 84 put_device(&trig->dev); 85 85 } 86 86 87 - static inline void iio_trigger_get(struct iio_trigger *trig) 87 + static inline struct iio_trigger *iio_trigger_get(struct iio_trigger *trig) 88 88 { 89 89 get_device(&trig->dev); 90 90 __module_get(trig->ops->owner); 91 + 92 + return trig; 91 93 } 92 94 93 95 /**
+6
include/linux/pci.h
··· 303 303 D3cold, not set for devices 304 304 powered on/off by the 305 305 corresponding bridge */ 306 + unsigned int ignore_hotplug:1; /* Ignore hotplug events */ 306 307 unsigned int d3_delay; /* D3->D0 transition time in ms */ 307 308 unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ 308 309 ··· 1021 1020 bool pci_dev_run_wake(struct pci_dev *dev); 1022 1021 bool pci_check_pme_status(struct pci_dev *dev); 1023 1022 void pci_pme_wakeup_bus(struct pci_bus *bus); 1023 + 1024 + static inline void pci_ignore_hotplug(struct pci_dev *dev) 1025 + { 1026 + dev->ignore_hotplug = 1; 1027 + } 1024 1028 1025 1029 static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, 1026 1030 bool enable)
+2
include/linux/vga_switcheroo.h
··· 64 64 void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic); 65 65 66 66 int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain); 67 + void vga_switcheroo_fini_domain_pm_ops(struct device *dev); 67 68 int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain); 68 69 #else 69 70 ··· 83 82 static inline void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) {} 84 83 85 84 static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; } 85 + static inline void vga_switcheroo_fini_domain_pm_ops(struct device *dev) {} 86 86 static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; } 87 87 88 88 #endif
-2
include/linux/vgaarb.h
··· 182 182 * vga_get()... 183 183 */ 184 184 185 - #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE 186 185 #ifdef CONFIG_VGA_ARB 187 186 extern struct pci_dev *vga_default_device(void); 188 187 extern void vga_set_default_device(struct pci_dev *pdev); 189 188 #else 190 189 static inline struct pci_dev *vga_default_device(void) { return NULL; }; 191 190 static inline void vga_set_default_device(struct pci_dev *pdev) { }; 192 - #endif 193 191 #endif 194 192 195 193 /**
+1 -1
include/scsi/scsi_tcq.h
··· 68 68 return; 69 69 70 70 if (!shost_use_blk_mq(sdev->host) && 71 - blk_queue_tagged(sdev->request_queue)) 71 + !blk_queue_tagged(sdev->request_queue)) 72 72 blk_queue_init_tags(sdev->request_queue, depth, 73 73 sdev->host->bqt); 74 74
+6 -6
init/do_mounts.c
··· 539 539 { 540 540 int is_floppy; 541 541 542 + if (root_delay) { 543 + printk(KERN_INFO "Waiting %d sec before mounting root device...\n", 544 + root_delay); 545 + ssleep(root_delay); 546 + } 547 + 542 548 /* 543 549 * wait for the known devices to complete their probing 544 550 * ··· 570 564 571 565 if (initrd_load()) 572 566 goto out; 573 - 574 - if (root_delay) { 575 - pr_info("Waiting %d sec before mounting root device...\n", 576 - root_delay); 577 - ssleep(root_delay); 578 - } 579 567 580 568 /* wait for any asynchronous scanning to complete */ 581 569 if ((ROOT_DEV == 0) && root_wait) {
+10
kernel/events/core.c
··· 1524 1524 */ 1525 1525 if (ctx->is_active) { 1526 1526 raw_spin_unlock_irq(&ctx->lock); 1527 + /* 1528 + * Reload the task pointer, it might have been changed by 1529 + * a concurrent perf_event_context_sched_out(). 1530 + */ 1531 + task = ctx->task; 1527 1532 goto retry; 1528 1533 } 1529 1534 ··· 1972 1967 */ 1973 1968 if (ctx->is_active) { 1974 1969 raw_spin_unlock_irq(&ctx->lock); 1970 + /* 1971 + * Reload the task pointer, it might have been changed by 1972 + * a concurrent perf_event_context_sched_out(). 1973 + */ 1974 + task = ctx->task; 1975 1975 goto retry; 1976 1976 } 1977 1977
+1 -1
mm/dmapool.c
··· 176 176 if (list_empty(&dev->dma_pools) && 177 177 device_create_file(dev, &dev_attr_pools)) { 178 178 kfree(retval); 179 - return NULL; 179 + retval = NULL; 180 180 } else 181 181 list_add(&retval->pools, &dev->dma_pools); 182 182 mutex_unlock(&pools_lock);
+12 -5
sound/pci/hda/patch_sigmatel.c
··· 566 566 if (snd_hda_jack_tbl_get(codec, nid)) 567 567 continue; 568 568 if (def_conf == AC_JACK_PORT_COMPLEX && 569 - !(spec->vref_mute_led_nid == nid || 570 - is_jack_detectable(codec, nid))) { 569 + spec->vref_mute_led_nid != nid && 570 + is_jack_detectable(codec, nid)) { 571 571 snd_hda_jack_detect_enable_callback(codec, nid, 572 572 STAC_PWR_EVENT, 573 573 jack_update_power); ··· 4276 4276 return err; 4277 4277 } 4278 4278 4279 - stac_init_power_map(codec); 4280 - 4281 4279 return 0; 4282 4280 } 4283 4281 4282 + static int stac_build_controls(struct hda_codec *codec) 4283 + { 4284 + int err = snd_hda_gen_build_controls(codec); 4285 + 4286 + if (err < 0) 4287 + return err; 4288 + stac_init_power_map(codec); 4289 + return 0; 4290 + } 4284 4291 4285 4292 static int stac_init(struct hda_codec *codec) 4286 4293 { ··· 4399 4392 #endif /* CONFIG_PM */ 4400 4393 4401 4394 static const struct hda_codec_ops stac_patch_ops = { 4402 - .build_controls = snd_hda_gen_build_controls, 4395 + .build_controls = stac_build_controls, 4403 4396 .build_pcms = snd_hda_gen_build_pcms, 4404 4397 .init = stac_init, 4405 4398 .free = stac_free,
+3 -3
sound/soc/codecs/cs4265.c
··· 458 458 if (params_width(params) == 16) { 459 459 snd_soc_update_bits(codec, CS4265_DAC_CTL, 460 460 CS4265_DAC_CTL_DIF, (1 << 5)); 461 - snd_soc_update_bits(codec, CS4265_ADC_CTL, 461 + snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, 462 462 CS4265_SPDIF_CTL2_DIF, (1 << 7)); 463 463 } else { 464 464 snd_soc_update_bits(codec, CS4265_DAC_CTL, 465 465 CS4265_DAC_CTL_DIF, (3 << 5)); 466 - snd_soc_update_bits(codec, CS4265_ADC_CTL, 466 + snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, 467 467 CS4265_SPDIF_CTL2_DIF, (1 << 7)); 468 468 } 469 469 break; ··· 472 472 CS4265_DAC_CTL_DIF, 0); 473 473 snd_soc_update_bits(codec, CS4265_ADC_CTL, 474 474 CS4265_ADC_DIF, 0); 475 - snd_soc_update_bits(codec, CS4265_ADC_CTL, 475 + snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, 476 476 CS4265_SPDIF_CTL2_DIF, (1 << 6)); 477 477 478 478 break;
+2 -2
sound/soc/codecs/sta529.c
··· 4 4 * sound/soc/codecs/sta529.c -- spear ALSA Soc codec driver 5 5 * 6 6 * Copyright (C) 2012 ST Microelectronics 7 - * Rajeev Kumar <rajeev-dlh.kumar@st.com> 7 + * Rajeev Kumar <rajeevkumar.linux@gmail.com> 8 8 * 9 9 * This file is licensed under the terms of the GNU General Public 10 10 * License version 2. This program is licensed "as is" without any ··· 426 426 module_i2c_driver(sta529_i2c_driver); 427 427 428 428 MODULE_DESCRIPTION("ASoC STA529 codec driver"); 429 - MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); 429 + MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); 430 430 MODULE_LICENSE("GPL");
+39 -12
sound/soc/codecs/tlv320aic31xx.c
··· 189 189 /* mclk rate pll: p j d dosr ndac mdac aors nadc madc */ 190 190 /* 8k rate */ 191 191 {12000000, 8000, 1, 8, 1920, 128, 48, 2, 128, 48, 2}, 192 + {12000000, 8000, 1, 8, 1920, 128, 32, 3, 128, 32, 3}, 192 193 {24000000, 8000, 2, 8, 1920, 128, 48, 2, 128, 48, 2}, 193 194 {25000000, 8000, 2, 7, 8643, 128, 48, 2, 128, 48, 2}, 194 195 /* 11.025k rate */ 195 196 {12000000, 11025, 1, 7, 5264, 128, 32, 2, 128, 32, 2}, 197 + {12000000, 11025, 1, 8, 4672, 128, 24, 3, 128, 24, 3}, 196 198 {24000000, 11025, 2, 7, 5264, 128, 32, 2, 128, 32, 2}, 197 199 {25000000, 11025, 2, 7, 2253, 128, 32, 2, 128, 32, 2}, 198 200 /* 16k rate */ 199 201 {12000000, 16000, 1, 8, 1920, 128, 24, 2, 128, 24, 2}, 202 + {12000000, 16000, 1, 8, 1920, 128, 16, 3, 128, 16, 3}, 200 203 {24000000, 16000, 2, 8, 1920, 128, 24, 2, 128, 24, 2}, 201 204 {25000000, 16000, 2, 7, 8643, 128, 24, 2, 128, 24, 2}, 202 205 /* 22.05k rate */ 203 206 {12000000, 22050, 1, 7, 5264, 128, 16, 2, 128, 16, 2}, 207 + {12000000, 22050, 1, 8, 4672, 128, 12, 3, 128, 12, 3}, 204 208 {24000000, 22050, 2, 7, 5264, 128, 16, 2, 128, 16, 2}, 205 209 {25000000, 22050, 2, 7, 2253, 128, 16, 2, 128, 16, 2}, 206 210 /* 32k rate */ 207 211 {12000000, 32000, 1, 8, 1920, 128, 12, 2, 128, 12, 2}, 212 + {12000000, 32000, 1, 8, 1920, 128, 8, 3, 128, 8, 3}, 208 213 {24000000, 32000, 2, 8, 1920, 128, 12, 2, 128, 12, 2}, 209 214 {25000000, 32000, 2, 7, 8643, 128, 12, 2, 128, 12, 2}, 210 215 /* 44.1k rate */ 211 216 {12000000, 44100, 1, 7, 5264, 128, 8, 2, 128, 8, 2}, 217 + {12000000, 44100, 1, 8, 4672, 128, 6, 3, 128, 6, 3}, 212 218 {24000000, 44100, 2, 7, 5264, 128, 8, 2, 128, 8, 2}, 213 219 {25000000, 44100, 2, 7, 2253, 128, 8, 2, 128, 8, 2}, 214 220 /* 48k rate */ 215 221 {12000000, 48000, 1, 8, 1920, 128, 8, 2, 128, 8, 2}, 222 + {12000000, 48000, 1, 7, 6800, 96, 5, 4, 96, 5, 4}, 216 223 {24000000, 48000, 2, 8, 1920, 128, 8, 2, 128, 8, 2}, 217 224 {25000000, 48000, 2, 7, 8643, 128, 8, 2, 128, 8, 2}, 218 225 /* 88.2k rate */ 219 226 {12000000, 88200, 1, 7, 5264, 64, 8, 2, 64, 8, 2}, 227 + {12000000, 88200, 1, 8, 4672, 64, 6, 3, 64, 6, 3}, 220 228 {24000000, 88200, 2, 7, 5264, 64, 8, 2, 64, 8, 2}, 221 229 {25000000, 88200, 2, 7, 2253, 64, 8, 2, 64, 8, 2}, 222 230 /* 96k rate */ 223 231 {12000000, 96000, 1, 8, 1920, 64, 8, 2, 64, 8, 2}, 232 + {12000000, 96000, 1, 7, 6800, 48, 5, 4, 48, 5, 4}, 224 233 {24000000, 96000, 2, 8, 1920, 64, 8, 2, 64, 8, 2}, 225 234 {25000000, 96000, 2, 7, 8643, 64, 8, 2, 64, 8, 2}, 226 235 /* 176.4k rate */ 227 236 {12000000, 176400, 1, 7, 5264, 32, 8, 2, 32, 8, 2}, 237 + {12000000, 176400, 1, 8, 4672, 32, 6, 3, 32, 6, 3}, 228 238 {24000000, 176400, 2, 7, 5264, 32, 8, 2, 32, 8, 2}, 229 239 {25000000, 176400, 2, 7, 2253, 32, 8, 2, 32, 8, 2}, 230 240 /* 192k rate */ 231 241 {12000000, 192000, 1, 8, 1920, 32, 8, 2, 32, 8, 2}, 242 + {12000000, 192000, 1, 7, 6800, 24, 5, 4, 24, 5, 4}, 232 243 {24000000, 192000, 2, 8, 1920, 32, 8, 2, 32, 8, 2}, 233 244 {25000000, 192000, 2, 7, 8643, 32, 8, 2, 32, 8, 2}, 234 245 }; ··· 691 680 struct snd_pcm_hw_params *params) 692 681 { 693 682 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); 683 + int bclk_score = snd_soc_params_to_frame_size(params); 694 684 int bclk_n = 0; 685 + int match = -1; 695 686 int i; 696 687 697 688 /* Use PLL as CODEC_CLKIN and DAC_CLK as BDIV_CLKIN */ ··· 704 691 705 692 for (i = 0; i < ARRAY_SIZE(aic31xx_divs); i++) { 706 693 if (aic31xx_divs[i].rate == params_rate(params) && 707 - aic31xx_divs[i].mclk == aic31xx->sysclk) 708 - break; 694 + aic31xx_divs[i].mclk == aic31xx->sysclk) { 695 + int s = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) % 696 + snd_soc_params_to_frame_size(params); 697 + int bn = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) / 698 + snd_soc_params_to_frame_size(params); 699 + if (s < bclk_score && bn > 0) { 700 + match = i; 701 + bclk_n = bn; 702 + bclk_score = s; 703 + } 704 + } 709 705 } 710 706 711 - if (i == ARRAY_SIZE(aic31xx_divs)) { 712 - dev_err(codec->dev, "%s: Sampling rate %u not supported\n", 707 + if (match == -1) { 708 + dev_err(codec->dev, 709 + "%s: Sample rate (%u) and format not supported\n", 713 710 __func__, params_rate(params)); 711 + /* See bellow for details how fix this. */ 714 712 return -EINVAL; 715 713 } 714 + if (bclk_score != 0) { 715 + dev_warn(codec->dev, "Can not produce exact bitclock"); 716 + /* This is fine if using dsp format, but if using i2s 717 + there may be trouble. To fix the issue edit the 718 + aic31xx_divs table for your mclk and sample 719 + rate. Details can be found from: 720 + http://www.ti.com/lit/ds/symlink/tlv320aic3100.pdf 721 + Section: 5.6 CLOCK Generation and PLL 722 + */ 723 + } 724 + i = match; 716 725 717 726 /* PLL configuration */ 718 727 snd_soc_update_bits(codec, AIC31XX_PLLPR, AIC31XX_PLL_MASK, ··· 764 729 snd_soc_write(codec, AIC31XX_AOSR, aic31xx_divs[i].aosr); 765 730 766 731 /* Bit clock divider configuration. */ 767 - bclk_n = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) 768 - / snd_soc_params_to_frame_size(params); 769 - if (bclk_n == 0) { 770 - dev_err(codec->dev, "%s: Not enough BLCK bandwidth\n", 771 - __func__); 772 - return -EINVAL; 773 - } 774 - 775 732 snd_soc_update_bits(codec, AIC31XX_BCLKN, 776 733 AIC31XX_PLL_MASK, bclk_n); 777 734
+10 -1
sound/soc/davinci/davinci-mcasp.c
··· 467 467 { 468 468 u32 fmt; 469 469 u32 tx_rotate = (word_length / 4) & 0x7; 470 - u32 rx_rotate = (32 - word_length) / 4; 471 470 u32 mask = (1ULL << word_length) - 1; 471 + /* 472 + * For captured data we should not rotate, inversion and masking is 473 + * enoguh to get the data to the right position: 474 + * Format data from bus after reverse (XRBUF) 475 + * S16_LE: |LSB|MSB|xxx|xxx| |xxx|xxx|MSB|LSB| 476 + * S24_3LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| 477 + * S24_LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| 478 + * S32_LE: |LSB|DAT|DAT|MSB| |MSB|DAT|DAT|LSB| 479 + */ 480 + u32 rx_rotate = 0; 472 481 473 482 /* 474 483 * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv()
+2 -2
sound/soc/dwc/designware_i2s.c
··· 4 4 * sound/soc/dwc/designware_i2s.c 5 5 * 6 6 * Copyright (C) 2010 ST Microelectronics 7 - * Rajeev Kumar <rajeev-dlh.kumar@st.com> 7 + * Rajeev Kumar <rajeevkumar.linux@gmail.com> 8 8 * 9 9 * This file is licensed under the terms of the GNU General Public 10 10 * License version 2. This program is licensed "as is" without any ··· 455 455 456 456 module_platform_driver(dw_i2s_driver); 457 457 458 - MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); 458 + MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); 459 459 MODULE_DESCRIPTION("DESIGNWARE I2S SoC Interface"); 460 460 MODULE_LICENSE("GPL"); 461 461 MODULE_ALIAS("platform:designware_i2s");
+7 -6
sound/soc/rockchip/rockchip_i2s.c
··· 165 165 struct rk_i2s_dev *i2s = to_info(cpu_dai); 166 166 unsigned int mask = 0, val = 0; 167 167 168 - mask = I2S_CKR_MSS_SLAVE; 168 + mask = I2S_CKR_MSS_MASK; 169 169 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { 170 170 case SND_SOC_DAIFMT_CBS_CFS: 171 - val = I2S_CKR_MSS_SLAVE; 171 + /* Set source clock in Master mode */ 172 + val = I2S_CKR_MSS_MASTER; 172 173 break; 173 174 case SND_SOC_DAIFMT_CBM_CFM: 174 - val = I2S_CKR_MSS_MASTER; 175 + val = I2S_CKR_MSS_SLAVE; 175 176 break; 176 177 default: 177 178 return -EINVAL; ··· 362 361 case I2S_XFER: 363 362 case I2S_CLR: 364 363 case I2S_RXDR: 364 + case I2S_FIFOLR: 365 + case I2S_INTSR: 365 366 return true; 366 367 default: 367 368 return false; ··· 373 370 static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg) 374 371 { 375 372 switch (reg) { 376 - case I2S_FIFOLR: 377 373 case I2S_INTSR: 374 + case I2S_CLR: 378 375 return true; 379 376 default: 380 377 return false; ··· 384 381 static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg) 385 382 { 386 383 switch (reg) { 387 - case I2S_FIFOLR: 388 - return true; 389 384 default: 390 385 return false; 391 386 }
+3 -2
sound/soc/samsung/i2s.c
··· 462 462 if (dir == SND_SOC_CLOCK_IN) 463 463 rfs = 0; 464 464 465 - if ((rfs && other->rfs && (other->rfs != rfs)) || 465 + if ((rfs && other && other->rfs && (other->rfs != rfs)) || 466 466 (any_active(i2s) && 467 467 (((dir == SND_SOC_CLOCK_IN) 468 468 && !(mod & MOD_CDCLKCON)) || ··· 762 762 } else { 763 763 u32 mod = readl(i2s->addr + I2SMOD); 764 764 i2s->cdclk_out = !(mod & MOD_CDCLKCON); 765 - other->cdclk_out = i2s->cdclk_out; 765 + if (other) 766 + other->cdclk_out = i2s->cdclk_out; 766 767 } 767 768 /* Reset any constraint on RFS and BFS */ 768 769 i2s->rfs = 0;
+5 -1
sound/soc/soc-compress.c
··· 101 101 102 102 fe->dpcm[stream].runtime = fe_substream->runtime; 103 103 104 - if (dpcm_path_get(fe, stream, &list) <= 0) { 104 + ret = dpcm_path_get(fe, stream, &list); 105 + if (ret < 0) { 106 + mutex_unlock(&fe->card->mutex); 107 + goto fe_err; 108 + } else if (ret == 0) { 105 109 dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", 106 110 fe->dai_link->name, stream ? "capture" : "playback"); 107 111 }
+5 -1
sound/soc/soc-pcm.c
··· 2352 2352 mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME); 2353 2353 fe->dpcm[stream].runtime = fe_substream->runtime; 2354 2354 2355 - if (dpcm_path_get(fe, stream, &list) <= 0) { 2355 + ret = dpcm_path_get(fe, stream, &list); 2356 + if (ret < 0) { 2357 + mutex_unlock(&fe->card->mutex); 2358 + return ret; 2359 + } else if (ret == 0) { 2356 2360 dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", 2357 2361 fe->dai_link->name, stream ? "capture" : "playback"); 2358 2362 }
+2 -2
sound/soc/spear/spear_pcm.c
··· 4 4 * sound/soc/spear/spear_pcm.c 5 5 * 6 6 * Copyright (C) 2012 ST Microelectronics 7 - * Rajeev Kumar<rajeev-dlh.kumar@st.com> 7 + * Rajeev Kumar<rajeevkumar.linux@gmail.com> 8 8 * 9 9 * This file is licensed under the terms of the GNU General Public 10 10 * License version 2. This program is licensed "as is" without any ··· 50 50 } 51 51 EXPORT_SYMBOL_GPL(devm_spear_pcm_platform_register); 52 52 53 - MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); 53 + MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); 54 54 MODULE_DESCRIPTION("SPEAr PCM DMA module"); 55 55 MODULE_LICENSE("GPL");