diff options
198 files changed, 1780 insertions, 695 deletions
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index f15f82bf3a50..e968a52e4881 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
| @@ -356,15 +356,15 @@ choice | |||
| 356 | is nothing connected to read from the DCC. | 356 | is nothing connected to read from the DCC. |
| 357 | 357 | ||
| 358 | config DEBUG_SEMIHOSTING | 358 | config DEBUG_SEMIHOSTING |
| 359 | bool "Kernel low-level debug output via semihosting I" | 359 | bool "Kernel low-level debug output via semihosting I/O" |
| 360 | help | 360 | help |
| 361 | Semihosting enables code running on an ARM target to use | 361 | Semihosting enables code running on an ARM target to use |
| 362 | the I/O facilities on a host debugger/emulator through a | 362 | the I/O facilities on a host debugger/emulator through a |
| 363 | simple SVC calls. The host debugger or emulator must have | 363 | simple SVC call. The host debugger or emulator must have |
| 364 | semihosting enabled for the special svc call to be trapped | 364 | semihosting enabled for the special svc call to be trapped |
| 365 | otherwise the kernel will crash. | 365 | otherwise the kernel will crash. |
| 366 | 366 | ||
| 367 | This is known to work with OpenOCD, as wellas | 367 | This is known to work with OpenOCD, as well as |
| 368 | ARM's Fast Models, or any other controlling environment | 368 | ARM's Fast Models, or any other controlling environment |
| 369 | that implements semihosting. | 369 | that implements semihosting. |
| 370 | 370 | ||
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 30eae87ead6d..a051dfbdd7db 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
| @@ -284,10 +284,10 @@ zImage Image xipImage bootpImage uImage: vmlinux | |||
| 284 | zinstall uinstall install: vmlinux | 284 | zinstall uinstall install: vmlinux |
| 285 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ | 285 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ |
| 286 | 286 | ||
| 287 | %.dtb: | 287 | %.dtb: scripts |
| 288 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ | 288 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ |
| 289 | 289 | ||
| 290 | dtbs: | 290 | dtbs: scripts |
| 291 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ | 291 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ |
| 292 | 292 | ||
| 293 | # We use MRPROPER_FILES and CLEAN_FILES now | 293 | # We use MRPROPER_FILES and CLEAN_FILES now |
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index b8c64b80bafc..81769c1341fa 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
| @@ -659,10 +659,14 @@ __armv7_mmu_cache_on: | |||
| 659 | #ifdef CONFIG_CPU_ENDIAN_BE8 | 659 | #ifdef CONFIG_CPU_ENDIAN_BE8 |
| 660 | orr r0, r0, #1 << 25 @ big-endian page tables | 660 | orr r0, r0, #1 << 25 @ big-endian page tables |
| 661 | #endif | 661 | #endif |
| 662 | mrcne p15, 0, r6, c2, c0, 2 @ read ttb control reg | ||
| 662 | orrne r0, r0, #1 @ MMU enabled | 663 | orrne r0, r0, #1 @ MMU enabled |
| 663 | movne r1, #0xfffffffd @ domain 0 = client | 664 | movne r1, #0xfffffffd @ domain 0 = client |
| 665 | bic r6, r6, #1 << 31 @ 32-bit translation system | ||
| 666 | bic r6, r6, #3 << 0 @ use only ttbr0 | ||
| 664 | mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer | 667 | mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer |
| 665 | mcrne p15, 0, r1, c3, c0, 0 @ load domain access control | 668 | mcrne p15, 0, r1, c3, c0, 0 @ load domain access control |
| 669 | mcrne p15, 0, r6, c2, c0, 2 @ load ttb control | ||
| 666 | #endif | 670 | #endif |
| 667 | mcr p15, 0, r0, c7, c5, 4 @ ISB | 671 | mcr p15, 0, r0, c7, c5, 4 @ ISB |
| 668 | mcr p15, 0, r0, c1, c0, 0 @ load control register | 672 | mcr p15, 0, r0, c1, c0, 0 @ load control register |
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 03fb93621d0d..5c8b3bf4d825 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h | |||
| @@ -320,4 +320,12 @@ | |||
| 320 | .size \name , . - \name | 320 | .size \name , . - \name |
| 321 | .endm | 321 | .endm |
| 322 | 322 | ||
| 323 | .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req | ||
| 324 | #ifndef CONFIG_CPU_USE_DOMAINS | ||
| 325 | adds \tmp, \addr, #\size - 1 | ||
| 326 | sbcccs \tmp, \tmp, \limit | ||
| 327 | bcs \bad | ||
| 328 | #endif | ||
| 329 | .endm | ||
| 330 | |||
| 323 | #endif /* __ASM_ASSEMBLER_H__ */ | 331 | #endif /* __ASM_ASSEMBLER_H__ */ |
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index e965f1b560f1..5f6ddcc56452 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h | |||
| @@ -187,6 +187,7 @@ static inline unsigned long __phys_to_virt(unsigned long x) | |||
| 187 | #define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) | 187 | #define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) |
| 188 | #endif | 188 | #endif |
| 189 | #endif | 189 | #endif |
| 190 | #endif /* __ASSEMBLY__ */ | ||
| 190 | 191 | ||
| 191 | #ifndef PHYS_OFFSET | 192 | #ifndef PHYS_OFFSET |
| 192 | #ifdef PLAT_PHYS_OFFSET | 193 | #ifdef PLAT_PHYS_OFFSET |
| @@ -196,6 +197,8 @@ static inline unsigned long __phys_to_virt(unsigned long x) | |||
| 196 | #endif | 197 | #endif |
| 197 | #endif | 198 | #endif |
| 198 | 199 | ||
| 200 | #ifndef __ASSEMBLY__ | ||
| 201 | |||
| 199 | /* | 202 | /* |
| 200 | * PFNs are used to describe any physical page; this means | 203 | * PFNs are used to describe any physical page; this means |
| 201 | * PFN 0 == physical address 0. | 204 | * PFN 0 == physical address 0. |
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h index 314d4664eae7..99a19512ee26 100644 --- a/arch/arm/include/asm/tlb.h +++ b/arch/arm/include/asm/tlb.h | |||
| @@ -199,6 +199,9 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, | |||
| 199 | { | 199 | { |
| 200 | pgtable_page_dtor(pte); | 200 | pgtable_page_dtor(pte); |
| 201 | 201 | ||
| 202 | #ifdef CONFIG_ARM_LPAE | ||
| 203 | tlb_add_flush(tlb, addr); | ||
| 204 | #else | ||
| 202 | /* | 205 | /* |
| 203 | * With the classic ARM MMU, a pte page has two corresponding pmd | 206 | * With the classic ARM MMU, a pte page has two corresponding pmd |
| 204 | * entries, each covering 1MB. | 207 | * entries, each covering 1MB. |
| @@ -206,6 +209,7 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, | |||
| 206 | addr &= PMD_MASK; | 209 | addr &= PMD_MASK; |
| 207 | tlb_add_flush(tlb, addr + SZ_1M - PAGE_SIZE); | 210 | tlb_add_flush(tlb, addr + SZ_1M - PAGE_SIZE); |
| 208 | tlb_add_flush(tlb, addr + SZ_1M); | 211 | tlb_add_flush(tlb, addr + SZ_1M); |
| 212 | #endif | ||
| 209 | 213 | ||
| 210 | tlb_remove_page(tlb, pte); | 214 | tlb_remove_page(tlb, pte); |
| 211 | } | 215 | } |
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 479a6352e0b5..77bd79f2ffdb 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h | |||
| @@ -101,28 +101,39 @@ extern int __get_user_1(void *); | |||
| 101 | extern int __get_user_2(void *); | 101 | extern int __get_user_2(void *); |
| 102 | extern int __get_user_4(void *); | 102 | extern int __get_user_4(void *); |
| 103 | 103 | ||
| 104 | #define __get_user_x(__r2,__p,__e,__s,__i...) \ | 104 | #define __GUP_CLOBBER_1 "lr", "cc" |
| 105 | #ifdef CONFIG_CPU_USE_DOMAINS | ||
| 106 | #define __GUP_CLOBBER_2 "ip", "lr", "cc" | ||
| 107 | #else | ||
| 108 | #define __GUP_CLOBBER_2 "lr", "cc" | ||
| 109 | #endif | ||
| 110 | #define __GUP_CLOBBER_4 "lr", "cc" | ||
| 111 | |||
| 112 | #define __get_user_x(__r2,__p,__e,__l,__s) \ | ||
| 105 | __asm__ __volatile__ ( \ | 113 | __asm__ __volatile__ ( \ |
| 106 | __asmeq("%0", "r0") __asmeq("%1", "r2") \ | 114 | __asmeq("%0", "r0") __asmeq("%1", "r2") \ |
| 115 | __asmeq("%3", "r1") \ | ||
| 107 | "bl __get_user_" #__s \ | 116 | "bl __get_user_" #__s \ |
| 108 | : "=&r" (__e), "=r" (__r2) \ | 117 | : "=&r" (__e), "=r" (__r2) \ |
| 109 | : "0" (__p) \ | 118 | : "0" (__p), "r" (__l) \ |
| 110 | : __i, "cc") | 119 | : __GUP_CLOBBER_##__s) |
| 111 | 120 | ||
| 112 | #define get_user(x,p) \ | 121 | #define __get_user_check(x,p) \ |
| 113 | ({ \ | 122 | ({ \ |
| 123 | unsigned long __limit = current_thread_info()->addr_limit - 1; \ | ||
| 114 | register const typeof(*(p)) __user *__p asm("r0") = (p);\ | 124 | register const typeof(*(p)) __user *__p asm("r0") = (p);\ |
| 115 | register unsigned long __r2 asm("r2"); \ | 125 | register unsigned long __r2 asm("r2"); \ |
| 126 | register unsigned long __l asm("r1") = __limit; \ | ||
| 116 | register int __e asm("r0"); \ | 127 | register int __e asm("r0"); \ |
| 117 | switch (sizeof(*(__p))) { \ | 128 | switch (sizeof(*(__p))) { \ |
| 118 | case 1: \ | 129 | case 1: \ |
| 119 | __get_user_x(__r2, __p, __e, 1, "lr"); \ | 130 | __get_user_x(__r2, __p, __e, __l, 1); \ |
| 120 | break; \ | 131 | break; \ |
| 121 | case 2: \ | 132 | case 2: \ |
| 122 | __get_user_x(__r2, __p, __e, 2, "r3", "lr"); \ | 133 | __get_user_x(__r2, __p, __e, __l, 2); \ |
| 123 | break; \ | 134 | break; \ |
| 124 | case 4: \ | 135 | case 4: \ |
| 125 | __get_user_x(__r2, __p, __e, 4, "lr"); \ | 136 | __get_user_x(__r2, __p, __e, __l, 4); \ |
| 126 | break; \ | 137 | break; \ |
| 127 | default: __e = __get_user_bad(); break; \ | 138 | default: __e = __get_user_bad(); break; \ |
| 128 | } \ | 139 | } \ |
| @@ -130,42 +141,57 @@ extern int __get_user_4(void *); | |||
| 130 | __e; \ | 141 | __e; \ |
| 131 | }) | 142 | }) |
| 132 | 143 | ||
| 144 | #define get_user(x,p) \ | ||
| 145 | ({ \ | ||
| 146 | might_fault(); \ | ||
| 147 | __get_user_check(x,p); \ | ||
| 148 | }) | ||
| 149 | |||
| 133 | extern int __put_user_1(void *, unsigned int); | 150 | extern int __put_user_1(void *, unsigned int); |
| 134 | extern int __put_user_2(void *, unsigned int); | 151 | extern int __put_user_2(void *, unsigned int); |
| 135 | extern int __put_user_4(void *, unsigned int); | 152 | extern int __put_user_4(void *, unsigned int); |
| 136 | extern int __put_user_8(void *, unsigned long long); | 153 | extern int __put_user_8(void *, unsigned long long); |
| 137 | 154 | ||
| 138 | #define __put_user_x(__r2,__p,__e,__s) \ | 155 | #define __put_user_x(__r2,__p,__e,__l,__s) \ |
| 139 | __asm__ __volatile__ ( \ | 156 | __asm__ __volatile__ ( \ |
| 140 | __asmeq("%0", "r0") __asmeq("%2", "r2") \ | 157 | __asmeq("%0", "r0") __asmeq("%2", "r2") \ |
| 158 | __asmeq("%3", "r1") \ | ||
| 141 | "bl __put_user_" #__s \ | 159 | "bl __put_user_" #__s \ |
| 142 | : "=&r" (__e) \ | 160 | : "=&r" (__e) \ |
| 143 | : "0" (__p), "r" (__r2) \ | 161 | : "0" (__p), "r" (__r2), "r" (__l) \ |
| 144 | : "ip", "lr", "cc") | 162 | : "ip", "lr", "cc") |
| 145 | 163 | ||
| 146 | #define put_user(x,p) \ | 164 | #define __put_user_check(x,p) \ |
| 147 | ({ \ | 165 | ({ \ |
| 166 | unsigned long __limit = current_thread_info()->addr_limit - 1; \ | ||
| 148 | register const typeof(*(p)) __r2 asm("r2") = (x); \ | 167 | register const typeof(*(p)) __r2 asm("r2") = (x); \ |
| 149 | register const typeof(*(p)) __user *__p asm("r0") = (p);\ | 168 | register const typeof(*(p)) __user *__p asm("r0") = (p);\ |
| 169 | register unsigned long __l asm("r1") = __limit; \ | ||
| 150 | register int __e asm("r0"); \ | 170 | register int __e asm("r0"); \ |
| 151 | switch (sizeof(*(__p))) { \ | 171 | switch (sizeof(*(__p))) { \ |
| 152 | case 1: \ | 172 | case 1: \ |
| 153 | __put_user_x(__r2, __p, __e, 1); \ | 173 | __put_user_x(__r2, __p, __e, __l, 1); \ |
| 154 | break; \ | 174 | break; \ |
| 155 | case 2: \ | 175 | case 2: \ |
| 156 | __put_user_x(__r2, __p, __e, 2); \ | 176 | __put_user_x(__r2, __p, __e, __l, 2); \ |
| 157 | break; \ | 177 | break; \ |
| 158 | case 4: \ | 178 | case 4: \ |
| 159 | __put_user_x(__r2, __p, __e, 4); \ | 179 | __put_user_x(__r2, __p, __e, __l, 4); \ |
| 160 | break; \ | 180 | break; \ |
| 161 | case 8: \ | 181 | case 8: \ |
| 162 | __put_user_x(__r2, __p, __e, 8); \ | 182 | __put_user_x(__r2, __p, __e, __l, 8); \ |
| 163 | break; \ | 183 | break; \ |
| 164 | default: __e = __put_user_bad(); break; \ | 184 | default: __e = __put_user_bad(); break; \ |
| 165 | } \ | 185 | } \ |
| 166 | __e; \ | 186 | __e; \ |
| 167 | }) | 187 | }) |
| 168 | 188 | ||
| 189 | #define put_user(x,p) \ | ||
| 190 | ({ \ | ||
| 191 | might_fault(); \ | ||
| 192 | __put_user_check(x,p); \ | ||
| 193 | }) | ||
| 194 | |||
| 169 | #else /* CONFIG_MMU */ | 195 | #else /* CONFIG_MMU */ |
| 170 | 196 | ||
| 171 | /* | 197 | /* |
| @@ -219,6 +245,7 @@ do { \ | |||
| 219 | unsigned long __gu_addr = (unsigned long)(ptr); \ | 245 | unsigned long __gu_addr = (unsigned long)(ptr); \ |
| 220 | unsigned long __gu_val; \ | 246 | unsigned long __gu_val; \ |
| 221 | __chk_user_ptr(ptr); \ | 247 | __chk_user_ptr(ptr); \ |
| 248 | might_fault(); \ | ||
| 222 | switch (sizeof(*(ptr))) { \ | 249 | switch (sizeof(*(ptr))) { \ |
| 223 | case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \ | 250 | case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \ |
| 224 | case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \ | 251 | case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \ |
| @@ -300,6 +327,7 @@ do { \ | |||
| 300 | unsigned long __pu_addr = (unsigned long)(ptr); \ | 327 | unsigned long __pu_addr = (unsigned long)(ptr); \ |
| 301 | __typeof__(*(ptr)) __pu_val = (x); \ | 328 | __typeof__(*(ptr)) __pu_val = (x); \ |
| 302 | __chk_user_ptr(ptr); \ | 329 | __chk_user_ptr(ptr); \ |
| 330 | might_fault(); \ | ||
| 303 | switch (sizeof(*(ptr))) { \ | 331 | switch (sizeof(*(ptr))) { \ |
| 304 | case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \ | 332 | case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \ |
| 305 | case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \ | 333 | case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \ |
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c index ba386bd94107..281bf3301241 100644 --- a/arch/arm/kernel/hw_breakpoint.c +++ b/arch/arm/kernel/hw_breakpoint.c | |||
| @@ -159,6 +159,12 @@ static int debug_arch_supported(void) | |||
| 159 | arch >= ARM_DEBUG_ARCH_V7_1; | 159 | arch >= ARM_DEBUG_ARCH_V7_1; |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | /* Can we determine the watchpoint access type from the fsr? */ | ||
| 163 | static int debug_exception_updates_fsr(void) | ||
| 164 | { | ||
| 165 | return 0; | ||
| 166 | } | ||
| 167 | |||
| 162 | /* Determine number of WRP registers available. */ | 168 | /* Determine number of WRP registers available. */ |
| 163 | static int get_num_wrp_resources(void) | 169 | static int get_num_wrp_resources(void) |
| 164 | { | 170 | { |
| @@ -604,13 +610,14 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) | |||
| 604 | /* Aligned */ | 610 | /* Aligned */ |
| 605 | break; | 611 | break; |
| 606 | case 1: | 612 | case 1: |
| 607 | /* Allow single byte watchpoint. */ | ||
| 608 | if (info->ctrl.len == ARM_BREAKPOINT_LEN_1) | ||
| 609 | break; | ||
| 610 | case 2: | 613 | case 2: |
| 611 | /* Allow halfword watchpoints and breakpoints. */ | 614 | /* Allow halfword watchpoints and breakpoints. */ |
| 612 | if (info->ctrl.len == ARM_BREAKPOINT_LEN_2) | 615 | if (info->ctrl.len == ARM_BREAKPOINT_LEN_2) |
| 613 | break; | 616 | break; |
| 617 | case 3: | ||
| 618 | /* Allow single byte watchpoint. */ | ||
| 619 | if (info->ctrl.len == ARM_BREAKPOINT_LEN_1) | ||
| 620 | break; | ||
| 614 | default: | 621 | default: |
| 615 | ret = -EINVAL; | 622 | ret = -EINVAL; |
| 616 | goto out; | 623 | goto out; |
| @@ -619,18 +626,35 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) | |||
| 619 | info->address &= ~alignment_mask; | 626 | info->address &= ~alignment_mask; |
| 620 | info->ctrl.len <<= offset; | 627 | info->ctrl.len <<= offset; |
| 621 | 628 | ||
| 622 | /* | 629 | if (!bp->overflow_handler) { |
| 623 | * Currently we rely on an overflow handler to take | 630 | /* |
| 624 | * care of single-stepping the breakpoint when it fires. | 631 | * Mismatch breakpoints are required for single-stepping |
| 625 | * In the case of userspace breakpoints on a core with V7 debug, | 632 | * breakpoints. |
| 626 | * we can use the mismatch feature as a poor-man's hardware | 633 | */ |
| 627 | * single-step, but this only works for per-task breakpoints. | 634 | if (!core_has_mismatch_brps()) |
| 628 | */ | 635 | return -EINVAL; |
| 629 | if (!bp->overflow_handler && (arch_check_bp_in_kernelspace(bp) || | 636 | |
| 630 | !core_has_mismatch_brps() || !bp->hw.bp_target)) { | 637 | /* We don't allow mismatch breakpoints in kernel space. */ |
| 631 | pr_warning("overflow handler required but none found\n"); | 638 | if (arch_check_bp_in_kernelspace(bp)) |
| 632 | ret = -EINVAL; | 639 | return -EPERM; |
| 640 | |||
| 641 | /* | ||
| 642 | * Per-cpu breakpoints are not supported by our stepping | ||
| 643 | * mechanism. | ||
| 644 | */ | ||
| 645 | if (!bp->hw.bp_target) | ||
| 646 | return -EINVAL; | ||
| 647 | |||
| 648 | /* | ||
| 649 | * We only support specific access types if the fsr | ||
| 650 | * reports them. | ||
| 651 | */ | ||
| 652 | if (!debug_exception_updates_fsr() && | ||
| 653 | (info->ctrl.type == ARM_BREAKPOINT_LOAD || | ||
| 654 | info->ctrl.type == ARM_BREAKPOINT_STORE)) | ||
| 655 | return -EINVAL; | ||
| 633 | } | 656 | } |
| 657 | |||
| 634 | out: | 658 | out: |
| 635 | return ret; | 659 | return ret; |
| 636 | } | 660 | } |
| @@ -706,10 +730,12 @@ static void watchpoint_handler(unsigned long addr, unsigned int fsr, | |||
| 706 | goto unlock; | 730 | goto unlock; |
| 707 | 731 | ||
| 708 | /* Check that the access type matches. */ | 732 | /* Check that the access type matches. */ |
| 709 | access = (fsr & ARM_FSR_ACCESS_MASK) ? HW_BREAKPOINT_W : | 733 | if (debug_exception_updates_fsr()) { |
| 710 | HW_BREAKPOINT_R; | 734 | access = (fsr & ARM_FSR_ACCESS_MASK) ? |
| 711 | if (!(access & hw_breakpoint_type(wp))) | 735 | HW_BREAKPOINT_W : HW_BREAKPOINT_R; |
| 712 | goto unlock; | 736 | if (!(access & hw_breakpoint_type(wp))) |
| 737 | goto unlock; | ||
| 738 | } | ||
| 713 | 739 | ||
| 714 | /* We have a winner. */ | 740 | /* We have a winner. */ |
| 715 | info->trigger = addr; | 741 | info->trigger = addr; |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index f7945218b8c6..b0179b89a04c 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
| @@ -420,20 +420,23 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs) | |||
| 420 | #endif | 420 | #endif |
| 421 | instr = *(u32 *) pc; | 421 | instr = *(u32 *) pc; |
| 422 | } else if (thumb_mode(regs)) { | 422 | } else if (thumb_mode(regs)) { |
| 423 | get_user(instr, (u16 __user *)pc); | 423 | if (get_user(instr, (u16 __user *)pc)) |
| 424 | goto die_sig; | ||
| 424 | if (is_wide_instruction(instr)) { | 425 | if (is_wide_instruction(instr)) { |
| 425 | unsigned int instr2; | 426 | unsigned int instr2; |
| 426 | get_user(instr2, (u16 __user *)pc+1); | 427 | if (get_user(instr2, (u16 __user *)pc+1)) |
| 428 | goto die_sig; | ||
| 427 | instr <<= 16; | 429 | instr <<= 16; |
| 428 | instr |= instr2; | 430 | instr |= instr2; |
| 429 | } | 431 | } |
| 430 | } else { | 432 | } else if (get_user(instr, (u32 __user *)pc)) { |
| 431 | get_user(instr, (u32 __user *)pc); | 433 | goto die_sig; |
| 432 | } | 434 | } |
| 433 | 435 | ||
| 434 | if (call_undef_hook(regs, instr) == 0) | 436 | if (call_undef_hook(regs, instr) == 0) |
| 435 | return; | 437 | return; |
| 436 | 438 | ||
| 439 | die_sig: | ||
| 437 | #ifdef CONFIG_DEBUG_USER | 440 | #ifdef CONFIG_DEBUG_USER |
| 438 | if (user_debug & UDBG_UNDEFINED) { | 441 | if (user_debug & UDBG_UNDEFINED) { |
| 439 | printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n", | 442 | printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n", |
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c index d6dacc69254e..395d5fbb8fa2 100644 --- a/arch/arm/lib/delay.c +++ b/arch/arm/lib/delay.c | |||
| @@ -59,6 +59,7 @@ void __init init_current_timer_delay(unsigned long freq) | |||
| 59 | { | 59 | { |
| 60 | pr_info("Switching to timer-based delay loop\n"); | 60 | pr_info("Switching to timer-based delay loop\n"); |
| 61 | lpj_fine = freq / HZ; | 61 | lpj_fine = freq / HZ; |
| 62 | loops_per_jiffy = lpj_fine; | ||
| 62 | arm_delay_ops.delay = __timer_delay; | 63 | arm_delay_ops.delay = __timer_delay; |
| 63 | arm_delay_ops.const_udelay = __timer_const_udelay; | 64 | arm_delay_ops.const_udelay = __timer_const_udelay; |
| 64 | arm_delay_ops.udelay = __timer_udelay; | 65 | arm_delay_ops.udelay = __timer_udelay; |
diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S index 11093a7c3e32..9b06bb41fca6 100644 --- a/arch/arm/lib/getuser.S +++ b/arch/arm/lib/getuser.S | |||
| @@ -16,8 +16,9 @@ | |||
| 16 | * __get_user_X | 16 | * __get_user_X |
| 17 | * | 17 | * |
| 18 | * Inputs: r0 contains the address | 18 | * Inputs: r0 contains the address |
| 19 | * r1 contains the address limit, which must be preserved | ||
| 19 | * Outputs: r0 is the error code | 20 | * Outputs: r0 is the error code |
| 20 | * r2, r3 contains the zero-extended value | 21 | * r2 contains the zero-extended value |
| 21 | * lr corrupted | 22 | * lr corrupted |
| 22 | * | 23 | * |
| 23 | * No other registers must be altered. (see <asm/uaccess.h> | 24 | * No other registers must be altered. (see <asm/uaccess.h> |
| @@ -27,33 +28,39 @@ | |||
| 27 | * Note also that it is intended that __get_user_bad is not global. | 28 | * Note also that it is intended that __get_user_bad is not global. |
| 28 | */ | 29 | */ |
| 29 | #include <linux/linkage.h> | 30 | #include <linux/linkage.h> |
| 31 | #include <asm/assembler.h> | ||
| 30 | #include <asm/errno.h> | 32 | #include <asm/errno.h> |
| 31 | #include <asm/domain.h> | 33 | #include <asm/domain.h> |
| 32 | 34 | ||
| 33 | ENTRY(__get_user_1) | 35 | ENTRY(__get_user_1) |
| 36 | check_uaccess r0, 1, r1, r2, __get_user_bad | ||
| 34 | 1: TUSER(ldrb) r2, [r0] | 37 | 1: TUSER(ldrb) r2, [r0] |
| 35 | mov r0, #0 | 38 | mov r0, #0 |
| 36 | mov pc, lr | 39 | mov pc, lr |
| 37 | ENDPROC(__get_user_1) | 40 | ENDPROC(__get_user_1) |
| 38 | 41 | ||
| 39 | ENTRY(__get_user_2) | 42 | ENTRY(__get_user_2) |
| 40 | #ifdef CONFIG_THUMB2_KERNEL | 43 | check_uaccess r0, 2, r1, r2, __get_user_bad |
| 41 | 2: TUSER(ldrb) r2, [r0] | 44 | #ifdef CONFIG_CPU_USE_DOMAINS |
| 42 | 3: TUSER(ldrb) r3, [r0, #1] | 45 | rb .req ip |
| 46 | 2: ldrbt r2, [r0], #1 | ||
| 47 | 3: ldrbt rb, [r0], #0 | ||
| 43 | #else | 48 | #else |
| 44 | 2: TUSER(ldrb) r2, [r0], #1 | 49 | rb .req r0 |
| 45 | 3: TUSER(ldrb) r3, [r0] | 50 | 2: ldrb r2, [r0] |
| 51 | 3: ldrb rb, [r0, #1] | ||
| 46 | #endif | 52 | #endif |
| 47 | #ifndef __ARMEB__ | 53 | #ifndef __ARMEB__ |
| 48 | orr r2, r2, r3, lsl #8 | 54 | orr r2, r2, rb, lsl #8 |
| 49 | #else | 55 | #else |
| 50 | orr r2, r3, r2, lsl #8 | 56 | orr r2, rb, r2, lsl #8 |
| 51 | #endif | 57 | #endif |
| 52 | mov r0, #0 | 58 | mov r0, #0 |
| 53 | mov pc, lr | 59 | mov pc, lr |
| 54 | ENDPROC(__get_user_2) | 60 | ENDPROC(__get_user_2) |
| 55 | 61 | ||
| 56 | ENTRY(__get_user_4) | 62 | ENTRY(__get_user_4) |
| 63 | check_uaccess r0, 4, r1, r2, __get_user_bad | ||
| 57 | 4: TUSER(ldr) r2, [r0] | 64 | 4: TUSER(ldr) r2, [r0] |
| 58 | mov r0, #0 | 65 | mov r0, #0 |
| 59 | mov pc, lr | 66 | mov pc, lr |
diff --git a/arch/arm/lib/putuser.S b/arch/arm/lib/putuser.S index 7db25990c589..3d73dcb959b0 100644 --- a/arch/arm/lib/putuser.S +++ b/arch/arm/lib/putuser.S | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | * __put_user_X | 16 | * __put_user_X |
| 17 | * | 17 | * |
| 18 | * Inputs: r0 contains the address | 18 | * Inputs: r0 contains the address |
| 19 | * r1 contains the address limit, which must be preserved | ||
| 19 | * r2, r3 contains the value | 20 | * r2, r3 contains the value |
| 20 | * Outputs: r0 is the error code | 21 | * Outputs: r0 is the error code |
| 21 | * lr corrupted | 22 | * lr corrupted |
| @@ -27,16 +28,19 @@ | |||
| 27 | * Note also that it is intended that __put_user_bad is not global. | 28 | * Note also that it is intended that __put_user_bad is not global. |
| 28 | */ | 29 | */ |
| 29 | #include <linux/linkage.h> | 30 | #include <linux/linkage.h> |
| 31 | #include <asm/assembler.h> | ||
| 30 | #include <asm/errno.h> | 32 | #include <asm/errno.h> |
| 31 | #include <asm/domain.h> | 33 | #include <asm/domain.h> |
| 32 | 34 | ||
| 33 | ENTRY(__put_user_1) | 35 | ENTRY(__put_user_1) |
| 36 | check_uaccess r0, 1, r1, ip, __put_user_bad | ||
| 34 | 1: TUSER(strb) r2, [r0] | 37 | 1: TUSER(strb) r2, [r0] |
| 35 | mov r0, #0 | 38 | mov r0, #0 |
| 36 | mov pc, lr | 39 | mov pc, lr |
| 37 | ENDPROC(__put_user_1) | 40 | ENDPROC(__put_user_1) |
| 38 | 41 | ||
| 39 | ENTRY(__put_user_2) | 42 | ENTRY(__put_user_2) |
| 43 | check_uaccess r0, 2, r1, ip, __put_user_bad | ||
| 40 | mov ip, r2, lsr #8 | 44 | mov ip, r2, lsr #8 |
| 41 | #ifdef CONFIG_THUMB2_KERNEL | 45 | #ifdef CONFIG_THUMB2_KERNEL |
| 42 | #ifndef __ARMEB__ | 46 | #ifndef __ARMEB__ |
| @@ -60,12 +64,14 @@ ENTRY(__put_user_2) | |||
| 60 | ENDPROC(__put_user_2) | 64 | ENDPROC(__put_user_2) |
| 61 | 65 | ||
| 62 | ENTRY(__put_user_4) | 66 | ENTRY(__put_user_4) |
| 67 | check_uaccess r0, 4, r1, ip, __put_user_bad | ||
| 63 | 4: TUSER(str) r2, [r0] | 68 | 4: TUSER(str) r2, [r0] |
| 64 | mov r0, #0 | 69 | mov r0, #0 |
| 65 | mov pc, lr | 70 | mov pc, lr |
| 66 | ENDPROC(__put_user_4) | 71 | ENDPROC(__put_user_4) |
| 67 | 72 | ||
| 68 | ENTRY(__put_user_8) | 73 | ENTRY(__put_user_8) |
| 74 | check_uaccess r0, 8, r1, ip, __put_user_bad | ||
| 69 | #ifdef CONFIG_THUMB2_KERNEL | 75 | #ifdef CONFIG_THUMB2_KERNEL |
| 70 | 5: TUSER(str) r2, [r0] | 76 | 5: TUSER(str) r2, [r0] |
| 71 | 6: TUSER(str) r3, [r0, #4] | 77 | 6: TUSER(str) r3, [r0, #4] |
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c index fdd8cc87c9fe..4431a62fff5b 100644 --- a/arch/arm/mach-imx/clk-imx25.c +++ b/arch/arm/mach-imx/clk-imx25.c | |||
| @@ -222,10 +222,8 @@ int __init mx25_clocks_init(void) | |||
| 222 | clk_register_clkdev(clk[lcdc_ipg], "ipg", "imx-fb.0"); | 222 | clk_register_clkdev(clk[lcdc_ipg], "ipg", "imx-fb.0"); |
| 223 | clk_register_clkdev(clk[lcdc_ahb], "ahb", "imx-fb.0"); | 223 | clk_register_clkdev(clk[lcdc_ahb], "ahb", "imx-fb.0"); |
| 224 | clk_register_clkdev(clk[wdt_ipg], NULL, "imx2-wdt.0"); | 224 | clk_register_clkdev(clk[wdt_ipg], NULL, "imx2-wdt.0"); |
| 225 | clk_register_clkdev(clk[ssi1_ipg_per], "per", "imx-ssi.0"); | 225 | clk_register_clkdev(clk[ssi1_ipg], NULL, "imx-ssi.0"); |
| 226 | clk_register_clkdev(clk[ssi1_ipg], "ipg", "imx-ssi.0"); | 226 | clk_register_clkdev(clk[ssi2_ipg], NULL, "imx-ssi.1"); |
| 227 | clk_register_clkdev(clk[ssi2_ipg_per], "per", "imx-ssi.1"); | ||
| 228 | clk_register_clkdev(clk[ssi2_ipg], "ipg", "imx-ssi.1"); | ||
| 229 | clk_register_clkdev(clk[esdhc1_ipg_per], "per", "sdhci-esdhc-imx25.0"); | 227 | clk_register_clkdev(clk[esdhc1_ipg_per], "per", "sdhci-esdhc-imx25.0"); |
| 230 | clk_register_clkdev(clk[esdhc1_ipg], "ipg", "sdhci-esdhc-imx25.0"); | 228 | clk_register_clkdev(clk[esdhc1_ipg], "ipg", "sdhci-esdhc-imx25.0"); |
| 231 | clk_register_clkdev(clk[esdhc1_ahb], "ahb", "sdhci-esdhc-imx25.0"); | 229 | clk_register_clkdev(clk[esdhc1_ahb], "ahb", "sdhci-esdhc-imx25.0"); |
diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c index c6422fb10bae..65fb8bcd86cb 100644 --- a/arch/arm/mach-imx/clk-imx35.c +++ b/arch/arm/mach-imx/clk-imx35.c | |||
| @@ -230,10 +230,8 @@ int __init mx35_clocks_init() | |||
| 230 | clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb"); | 230 | clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb"); |
| 231 | clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1"); | 231 | clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1"); |
| 232 | clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma"); | 232 | clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma"); |
| 233 | clk_register_clkdev(clk[ipg], "ipg", "imx-ssi.0"); | 233 | clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0"); |
| 234 | clk_register_clkdev(clk[ssi1_div_post], "per", "imx-ssi.0"); | 234 | clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1"); |
| 235 | clk_register_clkdev(clk[ipg], "ipg", "imx-ssi.1"); | ||
| 236 | clk_register_clkdev(clk[ssi2_div_post], "per", "imx-ssi.1"); | ||
| 237 | /* i.mx35 has the i.mx21 type uart */ | 235 | /* i.mx35 has the i.mx21 type uart */ |
| 238 | clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0"); | 236 | clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0"); |
| 239 | clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0"); | 237 | clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0"); |
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index fcd4e85c4ddc..346fd26f3aa6 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
| @@ -232,10 +232,11 @@ config MACH_OMAP3_PANDORA | |||
| 232 | select OMAP_PACKAGE_CBB | 232 | select OMAP_PACKAGE_CBB |
| 233 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | 233 | select REGULATOR_FIXED_VOLTAGE if REGULATOR |
| 234 | 234 | ||
| 235 | config MACH_OMAP3_TOUCHBOOK | 235 | config MACH_TOUCHBOOK |
| 236 | bool "OMAP3 Touch Book" | 236 | bool "OMAP3 Touch Book" |
| 237 | depends on ARCH_OMAP3 | 237 | depends on ARCH_OMAP3 |
| 238 | default y | 238 | default y |
| 239 | select OMAP_PACKAGE_CBB | ||
| 239 | 240 | ||
| 240 | config MACH_OMAP_3430SDP | 241 | config MACH_OMAP_3430SDP |
| 241 | bool "OMAP 3430 SDP board" | 242 | bool "OMAP 3430 SDP board" |
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index f6a24b3f9c4f..34c2c7f59f0a 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
| @@ -255,7 +255,7 @@ obj-$(CONFIG_MACH_OMAP_3630SDP) += board-zoom-display.o | |||
| 255 | obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o | 255 | obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o |
| 256 | obj-$(CONFIG_MACH_CM_T3517) += board-cm-t3517.o | 256 | obj-$(CONFIG_MACH_CM_T3517) += board-cm-t3517.o |
| 257 | obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o | 257 | obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o |
| 258 | obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o | 258 | obj-$(CONFIG_MACH_TOUCHBOOK) += board-omap3touchbook.o |
| 259 | obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o | 259 | obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o |
| 260 | obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o | 260 | obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o |
| 261 | 261 | ||
diff --git a/arch/arm/mach-omap2/clock33xx_data.c b/arch/arm/mach-omap2/clock33xx_data.c index 25bbcc7ca4dc..ae27de8899a6 100644 --- a/arch/arm/mach-omap2/clock33xx_data.c +++ b/arch/arm/mach-omap2/clock33xx_data.c | |||
| @@ -1036,13 +1036,13 @@ static struct omap_clk am33xx_clks[] = { | |||
| 1036 | CLK(NULL, "mmu_fck", &mmu_fck, CK_AM33XX), | 1036 | CLK(NULL, "mmu_fck", &mmu_fck, CK_AM33XX), |
| 1037 | CLK(NULL, "smartreflex0_fck", &smartreflex0_fck, CK_AM33XX), | 1037 | CLK(NULL, "smartreflex0_fck", &smartreflex0_fck, CK_AM33XX), |
| 1038 | CLK(NULL, "smartreflex1_fck", &smartreflex1_fck, CK_AM33XX), | 1038 | CLK(NULL, "smartreflex1_fck", &smartreflex1_fck, CK_AM33XX), |
| 1039 | CLK(NULL, "gpt1_fck", &timer1_fck, CK_AM33XX), | 1039 | CLK(NULL, "timer1_fck", &timer1_fck, CK_AM33XX), |
| 1040 | CLK(NULL, "gpt2_fck", &timer2_fck, CK_AM33XX), | 1040 | CLK(NULL, "timer2_fck", &timer2_fck, CK_AM33XX), |
| 1041 | CLK(NULL, "gpt3_fck", &timer3_fck, CK_AM33XX), | 1041 | CLK(NULL, "timer3_fck", &timer3_fck, CK_AM33XX), |
| 1042 | CLK(NULL, "gpt4_fck", &timer4_fck, CK_AM33XX), | 1042 | CLK(NULL, "timer4_fck", &timer4_fck, CK_AM33XX), |
| 1043 | CLK(NULL, "gpt5_fck", &timer5_fck, CK_AM33XX), | 1043 | CLK(NULL, "timer5_fck", &timer5_fck, CK_AM33XX), |
| 1044 | CLK(NULL, "gpt6_fck", &timer6_fck, CK_AM33XX), | 1044 | CLK(NULL, "timer6_fck", &timer6_fck, CK_AM33XX), |
| 1045 | CLK(NULL, "gpt7_fck", &timer7_fck, CK_AM33XX), | 1045 | CLK(NULL, "timer7_fck", &timer7_fck, CK_AM33XX), |
| 1046 | CLK(NULL, "usbotg_fck", &usbotg_fck, CK_AM33XX), | 1046 | CLK(NULL, "usbotg_fck", &usbotg_fck, CK_AM33XX), |
| 1047 | CLK(NULL, "ieee5000_fck", &ieee5000_fck, CK_AM33XX), | 1047 | CLK(NULL, "ieee5000_fck", &ieee5000_fck, CK_AM33XX), |
| 1048 | CLK(NULL, "wdt1_fck", &wdt1_fck, CK_AM33XX), | 1048 | CLK(NULL, "wdt1_fck", &wdt1_fck, CK_AM33XX), |
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c index a0d68dbecfa3..f99e65cfb862 100644 --- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c +++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c | |||
| @@ -241,6 +241,52 @@ static void omap3_clkdm_deny_idle(struct clockdomain *clkdm) | |||
| 241 | _clkdm_del_autodeps(clkdm); | 241 | _clkdm_del_autodeps(clkdm); |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | static int omap3xxx_clkdm_clk_enable(struct clockdomain *clkdm) | ||
| 245 | { | ||
| 246 | bool hwsup = false; | ||
| 247 | |||
| 248 | if (!clkdm->clktrctrl_mask) | ||
| 249 | return 0; | ||
| 250 | |||
| 251 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
| 252 | clkdm->clktrctrl_mask); | ||
| 253 | |||
| 254 | if (hwsup) { | ||
| 255 | /* Disable HW transitions when we are changing deps */ | ||
| 256 | _disable_hwsup(clkdm); | ||
| 257 | _clkdm_add_autodeps(clkdm); | ||
| 258 | _enable_hwsup(clkdm); | ||
| 259 | } else { | ||
| 260 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) | ||
| 261 | omap3_clkdm_wakeup(clkdm); | ||
| 262 | } | ||
| 263 | |||
| 264 | return 0; | ||
| 265 | } | ||
| 266 | |||
| 267 | static int omap3xxx_clkdm_clk_disable(struct clockdomain *clkdm) | ||
| 268 | { | ||
| 269 | bool hwsup = false; | ||
| 270 | |||
| 271 | if (!clkdm->clktrctrl_mask) | ||
| 272 | return 0; | ||
| 273 | |||
| 274 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
| 275 | clkdm->clktrctrl_mask); | ||
| 276 | |||
| 277 | if (hwsup) { | ||
| 278 | /* Disable HW transitions when we are changing deps */ | ||
| 279 | _disable_hwsup(clkdm); | ||
| 280 | _clkdm_del_autodeps(clkdm); | ||
| 281 | _enable_hwsup(clkdm); | ||
| 282 | } else { | ||
| 283 | if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP) | ||
| 284 | omap3_clkdm_sleep(clkdm); | ||
| 285 | } | ||
| 286 | |||
| 287 | return 0; | ||
| 288 | } | ||
| 289 | |||
| 244 | struct clkdm_ops omap2_clkdm_operations = { | 290 | struct clkdm_ops omap2_clkdm_operations = { |
| 245 | .clkdm_add_wkdep = omap2_clkdm_add_wkdep, | 291 | .clkdm_add_wkdep = omap2_clkdm_add_wkdep, |
| 246 | .clkdm_del_wkdep = omap2_clkdm_del_wkdep, | 292 | .clkdm_del_wkdep = omap2_clkdm_del_wkdep, |
| @@ -267,6 +313,6 @@ struct clkdm_ops omap3_clkdm_operations = { | |||
| 267 | .clkdm_wakeup = omap3_clkdm_wakeup, | 313 | .clkdm_wakeup = omap3_clkdm_wakeup, |
| 268 | .clkdm_allow_idle = omap3_clkdm_allow_idle, | 314 | .clkdm_allow_idle = omap3_clkdm_allow_idle, |
| 269 | .clkdm_deny_idle = omap3_clkdm_deny_idle, | 315 | .clkdm_deny_idle = omap3_clkdm_deny_idle, |
| 270 | .clkdm_clk_enable = omap2_clkdm_clk_enable, | 316 | .clkdm_clk_enable = omap3xxx_clkdm_clk_enable, |
| 271 | .clkdm_clk_disable = omap2_clkdm_clk_disable, | 317 | .clkdm_clk_disable = omap3xxx_clkdm_clk_disable, |
| 272 | }; | 318 | }; |
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h index 766338fe4d34..975f6bda0e0b 100644 --- a/arch/arm/mach-omap2/cm-regbits-34xx.h +++ b/arch/arm/mach-omap2/cm-regbits-34xx.h | |||
| @@ -67,6 +67,7 @@ | |||
| 67 | #define OMAP3430_EN_IVA2_DPLL_MASK (0x7 << 0) | 67 | #define OMAP3430_EN_IVA2_DPLL_MASK (0x7 << 0) |
| 68 | 68 | ||
| 69 | /* CM_IDLEST_IVA2 */ | 69 | /* CM_IDLEST_IVA2 */ |
| 70 | #define OMAP3430_ST_IVA2_SHIFT 0 | ||
| 70 | #define OMAP3430_ST_IVA2_MASK (1 << 0) | 71 | #define OMAP3430_ST_IVA2_MASK (1 << 0) |
| 71 | 72 | ||
| 72 | /* CM_IDLEST_PLL_IVA2 */ | 73 | /* CM_IDLEST_PLL_IVA2 */ |
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c index 05fdebfaa195..330d4c6e746b 100644 --- a/arch/arm/mach-omap2/omap-wakeupgen.c +++ b/arch/arm/mach-omap2/omap-wakeupgen.c | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | static void __iomem *wakeupgen_base; | 46 | static void __iomem *wakeupgen_base; |
| 47 | static void __iomem *sar_base; | 47 | static void __iomem *sar_base; |
| 48 | static DEFINE_SPINLOCK(wakeupgen_lock); | 48 | static DEFINE_SPINLOCK(wakeupgen_lock); |
| 49 | static unsigned int irq_target_cpu[NR_IRQS]; | 49 | static unsigned int irq_target_cpu[MAX_IRQS]; |
| 50 | static unsigned int irq_banks = MAX_NR_REG_BANKS; | 50 | static unsigned int irq_banks = MAX_NR_REG_BANKS; |
| 51 | static unsigned int max_irqs = MAX_IRQS; | 51 | static unsigned int max_irqs = MAX_IRQS; |
| 52 | static unsigned int omap_secure_apis; | 52 | static unsigned int omap_secure_apis; |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 6ca8e519968d..37afbd173c2c 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
| @@ -1889,6 +1889,7 @@ static int _enable(struct omap_hwmod *oh) | |||
| 1889 | _enable_sysc(oh); | 1889 | _enable_sysc(oh); |
| 1890 | } | 1890 | } |
| 1891 | } else { | 1891 | } else { |
| 1892 | _omap4_disable_module(oh); | ||
| 1892 | _disable_clocks(oh); | 1893 | _disable_clocks(oh); |
| 1893 | pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", | 1894 | pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", |
| 1894 | oh->name, r); | 1895 | oh->name, r); |
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index c9e38200216b..ce7e6068768f 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
| @@ -100,9 +100,9 @@ static struct omap_hwmod omap3xxx_mpu_hwmod = { | |||
| 100 | 100 | ||
| 101 | /* IVA2 (IVA2) */ | 101 | /* IVA2 (IVA2) */ |
| 102 | static struct omap_hwmod_rst_info omap3xxx_iva_resets[] = { | 102 | static struct omap_hwmod_rst_info omap3xxx_iva_resets[] = { |
| 103 | { .name = "logic", .rst_shift = 0 }, | 103 | { .name = "logic", .rst_shift = 0, .st_shift = 8 }, |
| 104 | { .name = "seq0", .rst_shift = 1 }, | 104 | { .name = "seq0", .rst_shift = 1, .st_shift = 9 }, |
| 105 | { .name = "seq1", .rst_shift = 2 }, | 105 | { .name = "seq1", .rst_shift = 2, .st_shift = 10 }, |
| 106 | }; | 106 | }; |
| 107 | 107 | ||
| 108 | static struct omap_hwmod omap3xxx_iva_hwmod = { | 108 | static struct omap_hwmod omap3xxx_iva_hwmod = { |
| @@ -112,6 +112,15 @@ static struct omap_hwmod omap3xxx_iva_hwmod = { | |||
| 112 | .rst_lines = omap3xxx_iva_resets, | 112 | .rst_lines = omap3xxx_iva_resets, |
| 113 | .rst_lines_cnt = ARRAY_SIZE(omap3xxx_iva_resets), | 113 | .rst_lines_cnt = ARRAY_SIZE(omap3xxx_iva_resets), |
| 114 | .main_clk = "iva2_ck", | 114 | .main_clk = "iva2_ck", |
| 115 | .prcm = { | ||
| 116 | .omap2 = { | ||
| 117 | .module_offs = OMAP3430_IVA2_MOD, | ||
| 118 | .prcm_reg_id = 1, | ||
| 119 | .module_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT, | ||
| 120 | .idlest_reg_id = 1, | ||
| 121 | .idlest_idle_bit = OMAP3430_ST_IVA2_SHIFT, | ||
| 122 | } | ||
| 123 | }, | ||
| 115 | }; | 124 | }; |
| 116 | 125 | ||
| 117 | /* timer class */ | 126 | /* timer class */ |
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 242aee498ceb..afb60917a948 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
| @@ -4210,7 +4210,7 @@ static struct omap_hwmod_ocp_if omap44xx_dsp__iva = { | |||
| 4210 | }; | 4210 | }; |
| 4211 | 4211 | ||
| 4212 | /* dsp -> sl2if */ | 4212 | /* dsp -> sl2if */ |
| 4213 | static struct omap_hwmod_ocp_if omap44xx_dsp__sl2if = { | 4213 | static struct omap_hwmod_ocp_if __maybe_unused omap44xx_dsp__sl2if = { |
| 4214 | .master = &omap44xx_dsp_hwmod, | 4214 | .master = &omap44xx_dsp_hwmod, |
| 4215 | .slave = &omap44xx_sl2if_hwmod, | 4215 | .slave = &omap44xx_sl2if_hwmod, |
| 4216 | .clk = "dpll_iva_m5x2_ck", | 4216 | .clk = "dpll_iva_m5x2_ck", |
| @@ -4828,7 +4828,7 @@ static struct omap_hwmod_ocp_if omap44xx_l3_main_2__iss = { | |||
| 4828 | }; | 4828 | }; |
| 4829 | 4829 | ||
| 4830 | /* iva -> sl2if */ | 4830 | /* iva -> sl2if */ |
| 4831 | static struct omap_hwmod_ocp_if omap44xx_iva__sl2if = { | 4831 | static struct omap_hwmod_ocp_if __maybe_unused omap44xx_iva__sl2if = { |
| 4832 | .master = &omap44xx_iva_hwmod, | 4832 | .master = &omap44xx_iva_hwmod, |
| 4833 | .slave = &omap44xx_sl2if_hwmod, | 4833 | .slave = &omap44xx_sl2if_hwmod, |
| 4834 | .clk = "dpll_iva_m5x2_ck", | 4834 | .clk = "dpll_iva_m5x2_ck", |
| @@ -5362,7 +5362,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_wkup__scrm = { | |||
| 5362 | }; | 5362 | }; |
| 5363 | 5363 | ||
| 5364 | /* l3_main_2 -> sl2if */ | 5364 | /* l3_main_2 -> sl2if */ |
| 5365 | static struct omap_hwmod_ocp_if omap44xx_l3_main_2__sl2if = { | 5365 | static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l3_main_2__sl2if = { |
| 5366 | .master = &omap44xx_l3_main_2_hwmod, | 5366 | .master = &omap44xx_l3_main_2_hwmod, |
| 5367 | .slave = &omap44xx_sl2if_hwmod, | 5367 | .slave = &omap44xx_sl2if_hwmod, |
| 5368 | .clk = "l3_div_ck", | 5368 | .clk = "l3_div_ck", |
| @@ -6032,7 +6032,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = { | |||
| 6032 | &omap44xx_l4_abe__dmic, | 6032 | &omap44xx_l4_abe__dmic, |
| 6033 | &omap44xx_l4_abe__dmic_dma, | 6033 | &omap44xx_l4_abe__dmic_dma, |
| 6034 | &omap44xx_dsp__iva, | 6034 | &omap44xx_dsp__iva, |
| 6035 | &omap44xx_dsp__sl2if, | 6035 | /* &omap44xx_dsp__sl2if, */ |
| 6036 | &omap44xx_l4_cfg__dsp, | 6036 | &omap44xx_l4_cfg__dsp, |
| 6037 | &omap44xx_l3_main_2__dss, | 6037 | &omap44xx_l3_main_2__dss, |
| 6038 | &omap44xx_l4_per__dss, | 6038 | &omap44xx_l4_per__dss, |
| @@ -6068,7 +6068,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = { | |||
| 6068 | &omap44xx_l4_per__i2c4, | 6068 | &omap44xx_l4_per__i2c4, |
| 6069 | &omap44xx_l3_main_2__ipu, | 6069 | &omap44xx_l3_main_2__ipu, |
| 6070 | &omap44xx_l3_main_2__iss, | 6070 | &omap44xx_l3_main_2__iss, |
| 6071 | &omap44xx_iva__sl2if, | 6071 | /* &omap44xx_iva__sl2if, */ |
| 6072 | &omap44xx_l3_main_2__iva, | 6072 | &omap44xx_l3_main_2__iva, |
| 6073 | &omap44xx_l4_wkup__kbd, | 6073 | &omap44xx_l4_wkup__kbd, |
| 6074 | &omap44xx_l4_cfg__mailbox, | 6074 | &omap44xx_l4_cfg__mailbox, |
| @@ -6099,7 +6099,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = { | |||
| 6099 | &omap44xx_l4_cfg__cm_core, | 6099 | &omap44xx_l4_cfg__cm_core, |
| 6100 | &omap44xx_l4_wkup__prm, | 6100 | &omap44xx_l4_wkup__prm, |
| 6101 | &omap44xx_l4_wkup__scrm, | 6101 | &omap44xx_l4_wkup__scrm, |
| 6102 | &omap44xx_l3_main_2__sl2if, | 6102 | /* &omap44xx_l3_main_2__sl2if, */ |
| 6103 | &omap44xx_l4_abe__slimbus1, | 6103 | &omap44xx_l4_abe__slimbus1, |
| 6104 | &omap44xx_l4_abe__slimbus1_dma, | 6104 | &omap44xx_l4_abe__slimbus1_dma, |
| 6105 | &omap44xx_l4_per__slimbus2, | 6105 | &omap44xx_l4_per__slimbus2, |
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 2ff6d41ec6c6..2ba4f57dda86 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
| @@ -260,6 +260,7 @@ static u32 notrace dmtimer_read_sched_clock(void) | |||
| 260 | return 0; | 260 | return 0; |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | #ifdef CONFIG_OMAP_32K_TIMER | ||
| 263 | /* Setup free-running counter for clocksource */ | 264 | /* Setup free-running counter for clocksource */ |
| 264 | static int __init omap2_sync32k_clocksource_init(void) | 265 | static int __init omap2_sync32k_clocksource_init(void) |
| 265 | { | 266 | { |
| @@ -299,6 +300,12 @@ static int __init omap2_sync32k_clocksource_init(void) | |||
| 299 | 300 | ||
| 300 | return ret; | 301 | return ret; |
| 301 | } | 302 | } |
| 303 | #else | ||
| 304 | static inline int omap2_sync32k_clocksource_init(void) | ||
| 305 | { | ||
| 306 | return -ENODEV; | ||
| 307 | } | ||
| 308 | #endif | ||
| 302 | 309 | ||
| 303 | static void __init omap2_gptimer_clocksource_init(int gptimer_id, | 310 | static void __init omap2_gptimer_clocksource_init(int gptimer_id, |
| 304 | const char *fck_source) | 311 | const char *fck_source) |
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index 119bc52ab93e..4e07eec1270d 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c | |||
| @@ -63,10 +63,11 @@ static int contextidr_notifier(struct notifier_block *unused, unsigned long cmd, | |||
| 63 | pid = task_pid_nr(thread->task) << ASID_BITS; | 63 | pid = task_pid_nr(thread->task) << ASID_BITS; |
| 64 | asm volatile( | 64 | asm volatile( |
| 65 | " mrc p15, 0, %0, c13, c0, 1\n" | 65 | " mrc p15, 0, %0, c13, c0, 1\n" |
| 66 | " bfi %1, %0, #0, %2\n" | 66 | " and %0, %0, %2\n" |
| 67 | " mcr p15, 0, %1, c13, c0, 1\n" | 67 | " orr %0, %0, %1\n" |
| 68 | " mcr p15, 0, %0, c13, c0, 1\n" | ||
| 68 | : "=r" (contextidr), "+r" (pid) | 69 | : "=r" (contextidr), "+r" (pid) |
| 69 | : "I" (ASID_BITS)); | 70 | : "I" (~ASID_MASK)); |
| 70 | isb(); | 71 | isb(); |
| 71 | 72 | ||
| 72 | return NOTIFY_OK; | 73 | return NOTIFY_OK; |
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h index 6776160618ef..a8ee92da3544 100644 --- a/arch/arm/mm/mm.h +++ b/arch/arm/mm/mm.h | |||
| @@ -55,6 +55,9 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page | |||
| 55 | /* permanent static mappings from iotable_init() */ | 55 | /* permanent static mappings from iotable_init() */ |
| 56 | #define VM_ARM_STATIC_MAPPING 0x40000000 | 56 | #define VM_ARM_STATIC_MAPPING 0x40000000 |
| 57 | 57 | ||
| 58 | /* empty mapping */ | ||
| 59 | #define VM_ARM_EMPTY_MAPPING 0x20000000 | ||
| 60 | |||
| 58 | /* mapping type (attributes) for permanent static mappings */ | 61 | /* mapping type (attributes) for permanent static mappings */ |
| 59 | #define VM_ARM_MTYPE(mt) ((mt) << 20) | 62 | #define VM_ARM_MTYPE(mt) ((mt) << 20) |
| 60 | #define VM_ARM_MTYPE_MASK (0x1f << 20) | 63 | #define VM_ARM_MTYPE_MASK (0x1f << 20) |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 4c2d0451e84a..c2fa21d0103e 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
| @@ -807,7 +807,7 @@ static void __init pmd_empty_section_gap(unsigned long addr) | |||
| 807 | vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm)); | 807 | vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm)); |
| 808 | vm->addr = (void *)addr; | 808 | vm->addr = (void *)addr; |
| 809 | vm->size = SECTION_SIZE; | 809 | vm->size = SECTION_SIZE; |
| 810 | vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING; | 810 | vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING; |
| 811 | vm->caller = pmd_empty_section_gap; | 811 | vm->caller = pmd_empty_section_gap; |
| 812 | vm_area_add_early(vm); | 812 | vm_area_add_early(vm); |
| 813 | } | 813 | } |
| @@ -820,7 +820,7 @@ static void __init fill_pmd_gaps(void) | |||
| 820 | 820 | ||
| 821 | /* we're still single threaded hence no lock needed here */ | 821 | /* we're still single threaded hence no lock needed here */ |
| 822 | for (vm = vmlist; vm; vm = vm->next) { | 822 | for (vm = vmlist; vm; vm = vm->next) { |
| 823 | if (!(vm->flags & VM_ARM_STATIC_MAPPING)) | 823 | if (!(vm->flags & (VM_ARM_STATIC_MAPPING | VM_ARM_EMPTY_MAPPING))) |
| 824 | continue; | 824 | continue; |
| 825 | addr = (unsigned long)vm->addr; | 825 | addr = (unsigned long)vm->addr; |
| 826 | if (addr < next) | 826 | if (addr < next) |
| @@ -961,8 +961,8 @@ void __init sanity_check_meminfo(void) | |||
| 961 | * Check whether this memory bank would partially overlap | 961 | * Check whether this memory bank would partially overlap |
| 962 | * the vmalloc area. | 962 | * the vmalloc area. |
| 963 | */ | 963 | */ |
| 964 | if (__va(bank->start + bank->size) > vmalloc_min || | 964 | if (__va(bank->start + bank->size - 1) >= vmalloc_min || |
| 965 | __va(bank->start + bank->size) < __va(bank->start)) { | 965 | __va(bank->start + bank->size - 1) <= __va(bank->start)) { |
| 966 | unsigned long newsize = vmalloc_min - __va(bank->start); | 966 | unsigned long newsize = vmalloc_min - __va(bank->start); |
| 967 | printk(KERN_NOTICE "Truncating RAM at %.8llx-%.8llx " | 967 | printk(KERN_NOTICE "Truncating RAM at %.8llx-%.8llx " |
| 968 | "to -%.8llx (vmalloc region overlap).\n", | 968 | "to -%.8llx (vmalloc region overlap).\n", |
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 766181cb5c95..024f3b08db29 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
| @@ -68,6 +68,7 @@ | |||
| 68 | 68 | ||
| 69 | static unsigned long omap_sram_start; | 69 | static unsigned long omap_sram_start; |
| 70 | static void __iomem *omap_sram_base; | 70 | static void __iomem *omap_sram_base; |
| 71 | static unsigned long omap_sram_skip; | ||
| 71 | static unsigned long omap_sram_size; | 72 | static unsigned long omap_sram_size; |
| 72 | static void __iomem *omap_sram_ceil; | 73 | static void __iomem *omap_sram_ceil; |
| 73 | 74 | ||
| @@ -106,6 +107,7 @@ static int is_sram_locked(void) | |||
| 106 | */ | 107 | */ |
| 107 | static void __init omap_detect_sram(void) | 108 | static void __init omap_detect_sram(void) |
| 108 | { | 109 | { |
| 110 | omap_sram_skip = SRAM_BOOTLOADER_SZ; | ||
| 109 | if (cpu_class_is_omap2()) { | 111 | if (cpu_class_is_omap2()) { |
| 110 | if (is_sram_locked()) { | 112 | if (is_sram_locked()) { |
| 111 | if (cpu_is_omap34xx()) { | 113 | if (cpu_is_omap34xx()) { |
| @@ -113,6 +115,7 @@ static void __init omap_detect_sram(void) | |||
| 113 | if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) || | 115 | if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) || |
| 114 | (omap_type() == OMAP2_DEVICE_TYPE_SEC)) { | 116 | (omap_type() == OMAP2_DEVICE_TYPE_SEC)) { |
| 115 | omap_sram_size = 0x7000; /* 28K */ | 117 | omap_sram_size = 0x7000; /* 28K */ |
| 118 | omap_sram_skip += SZ_16K; | ||
| 116 | } else { | 119 | } else { |
| 117 | omap_sram_size = 0x8000; /* 32K */ | 120 | omap_sram_size = 0x8000; /* 32K */ |
| 118 | } | 121 | } |
| @@ -175,8 +178,10 @@ static void __init omap_map_sram(void) | |||
| 175 | return; | 178 | return; |
| 176 | 179 | ||
| 177 | #ifdef CONFIG_OMAP4_ERRATA_I688 | 180 | #ifdef CONFIG_OMAP4_ERRATA_I688 |
| 181 | if (cpu_is_omap44xx()) { | ||
| 178 | omap_sram_start += PAGE_SIZE; | 182 | omap_sram_start += PAGE_SIZE; |
| 179 | omap_sram_size -= SZ_16K; | 183 | omap_sram_size -= SZ_16K; |
| 184 | } | ||
| 180 | #endif | 185 | #endif |
| 181 | if (cpu_is_omap34xx()) { | 186 | if (cpu_is_omap34xx()) { |
| 182 | /* | 187 | /* |
| @@ -203,8 +208,8 @@ static void __init omap_map_sram(void) | |||
| 203 | * Looks like we need to preserve some bootloader code at the | 208 | * Looks like we need to preserve some bootloader code at the |
| 204 | * beginning of SRAM for jumping to flash for reboot to work... | 209 | * beginning of SRAM for jumping to flash for reboot to work... |
| 205 | */ | 210 | */ |
| 206 | memset_io(omap_sram_base + SRAM_BOOTLOADER_SZ, 0, | 211 | memset_io(omap_sram_base + omap_sram_skip, 0, |
| 207 | omap_sram_size - SRAM_BOOTLOADER_SZ); | 212 | omap_sram_size - omap_sram_skip); |
| 208 | } | 213 | } |
| 209 | 214 | ||
| 210 | /* | 215 | /* |
| @@ -218,7 +223,7 @@ void *omap_sram_push_address(unsigned long size) | |||
| 218 | { | 223 | { |
| 219 | unsigned long available, new_ceil = (unsigned long)omap_sram_ceil; | 224 | unsigned long available, new_ceil = (unsigned long)omap_sram_ceil; |
| 220 | 225 | ||
| 221 | available = omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ); | 226 | available = omap_sram_ceil - (omap_sram_base + omap_sram_skip); |
| 222 | 227 | ||
| 223 | if (size > available) { | 228 | if (size > available) { |
| 224 | pr_err("Not enough space in SRAM\n"); | 229 | pr_err("Not enough space in SRAM\n"); |
diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c index a1e9d69a9c90..584b93674ea4 100644 --- a/arch/s390/oprofile/init.c +++ b/arch/s390/oprofile/init.c | |||
| @@ -169,7 +169,7 @@ static ssize_t hw_interval_write(struct file *file, char const __user *buf, | |||
| 169 | if (*offset) | 169 | if (*offset) |
| 170 | return -EINVAL; | 170 | return -EINVAL; |
| 171 | retval = oprofilefs_ulong_from_user(&val, buf, count); | 171 | retval = oprofilefs_ulong_from_user(&val, buf, count); |
| 172 | if (retval) | 172 | if (retval <= 0) |
| 173 | return retval; | 173 | return retval; |
| 174 | if (val < oprofile_min_interval) | 174 | if (val < oprofile_min_interval) |
| 175 | oprofile_hw_interval = oprofile_min_interval; | 175 | oprofile_hw_interval = oprofile_min_interval; |
| @@ -212,7 +212,7 @@ static ssize_t hwsampler_zero_write(struct file *file, char const __user *buf, | |||
| 212 | return -EINVAL; | 212 | return -EINVAL; |
| 213 | 213 | ||
| 214 | retval = oprofilefs_ulong_from_user(&val, buf, count); | 214 | retval = oprofilefs_ulong_from_user(&val, buf, count); |
| 215 | if (retval) | 215 | if (retval <= 0) |
| 216 | return retval; | 216 | return retval; |
| 217 | if (val != 0) | 217 | if (val != 0) |
| 218 | return -EINVAL; | 218 | return -EINVAL; |
| @@ -243,7 +243,7 @@ static ssize_t hwsampler_kernel_write(struct file *file, char const __user *buf, | |||
| 243 | return -EINVAL; | 243 | return -EINVAL; |
| 244 | 244 | ||
| 245 | retval = oprofilefs_ulong_from_user(&val, buf, count); | 245 | retval = oprofilefs_ulong_from_user(&val, buf, count); |
| 246 | if (retval) | 246 | if (retval <= 0) |
| 247 | return retval; | 247 | return retval; |
| 248 | 248 | ||
| 249 | if (val != 0 && val != 1) | 249 | if (val != 0 && val != 1) |
| @@ -278,7 +278,7 @@ static ssize_t hwsampler_user_write(struct file *file, char const __user *buf, | |||
| 278 | return -EINVAL; | 278 | return -EINVAL; |
| 279 | 279 | ||
| 280 | retval = oprofilefs_ulong_from_user(&val, buf, count); | 280 | retval = oprofilefs_ulong_from_user(&val, buf, count); |
| 281 | if (retval) | 281 | if (retval <= 0) |
| 282 | return retval; | 282 | return retval; |
| 283 | 283 | ||
| 284 | if (val != 0 && val != 1) | 284 | if (val != 0 && val != 1) |
| @@ -317,7 +317,7 @@ static ssize_t timer_enabled_write(struct file *file, char const __user *buf, | |||
| 317 | return -EINVAL; | 317 | return -EINVAL; |
| 318 | 318 | ||
| 319 | retval = oprofilefs_ulong_from_user(&val, buf, count); | 319 | retval = oprofilefs_ulong_from_user(&val, buf, count); |
| 320 | if (retval) | 320 | if (retval <= 0) |
| 321 | return retval; | 321 | return retval; |
| 322 | 322 | ||
| 323 | if (val != 0 && val != 1) | 323 | if (val != 0 && val != 1) |
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index 7f2739e03e79..0d3d63afa76a 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
| @@ -2008,6 +2008,7 @@ __init int intel_pmu_init(void) | |||
| 2008 | break; | 2008 | break; |
| 2009 | 2009 | ||
| 2010 | case 28: /* Atom */ | 2010 | case 28: /* Atom */ |
| 2011 | case 54: /* Cedariew */ | ||
| 2011 | memcpy(hw_cache_event_ids, atom_hw_cache_event_ids, | 2012 | memcpy(hw_cache_event_ids, atom_hw_cache_event_ids, |
| 2012 | sizeof(hw_cache_event_ids)); | 2013 | sizeof(hw_cache_event_ids)); |
| 2013 | 2014 | ||
diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c index 520b4265fcd2..da02e9cc3754 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c +++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c | |||
| @@ -686,7 +686,8 @@ void intel_pmu_lbr_init_atom(void) | |||
| 686 | * to have an operational LBR which can freeze | 686 | * to have an operational LBR which can freeze |
| 687 | * on PMU interrupt | 687 | * on PMU interrupt |
| 688 | */ | 688 | */ |
| 689 | if (boot_cpu_data.x86_mask < 10) { | 689 | if (boot_cpu_data.x86_model == 28 |
| 690 | && boot_cpu_data.x86_mask < 10) { | ||
| 690 | pr_cont("LBR disabled due to erratum"); | 691 | pr_cont("LBR disabled due to erratum"); |
| 691 | return; | 692 | return; |
| 692 | } | 693 | } |
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index 4873e62db6a1..9e5bcf1e2376 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c | |||
| @@ -225,6 +225,9 @@ static ssize_t microcode_write(struct file *file, const char __user *buf, | |||
| 225 | if (do_microcode_update(buf, len) == 0) | 225 | if (do_microcode_update(buf, len) == 0) |
| 226 | ret = (ssize_t)len; | 226 | ret = (ssize_t)len; |
| 227 | 227 | ||
| 228 | if (ret > 0) | ||
| 229 | perf_check_microcode(); | ||
| 230 | |||
| 228 | mutex_unlock(µcode_mutex); | 231 | mutex_unlock(µcode_mutex); |
| 229 | put_online_cpus(); | 232 | put_online_cpus(); |
| 230 | 233 | ||
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 50d5dea0ff59..7862d17976b7 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
| @@ -268,6 +268,9 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
| 268 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ | 268 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ |
| 269 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | 269 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
| 270 | PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci_ign_iferr }, | 270 | PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci_ign_iferr }, |
| 271 | /* JMicron 362B and 362C have an AHCI function with IDE class code */ | ||
| 272 | { PCI_VDEVICE(JMICRON, 0x2362), board_ahci_ign_iferr }, | ||
| 273 | { PCI_VDEVICE(JMICRON, 0x236f), board_ahci_ign_iferr }, | ||
| 271 | 274 | ||
| 272 | /* ATI */ | 275 | /* ATI */ |
| 273 | { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */ | 276 | { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */ |
| @@ -393,6 +396,8 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
| 393 | .driver_data = board_ahci_yes_fbs }, /* 88se9125 */ | 396 | .driver_data = board_ahci_yes_fbs }, /* 88se9125 */ |
| 394 | { PCI_DEVICE(0x1b4b, 0x917a), | 397 | { PCI_DEVICE(0x1b4b, 0x917a), |
| 395 | .driver_data = board_ahci_yes_fbs }, /* 88se9172 */ | 398 | .driver_data = board_ahci_yes_fbs }, /* 88se9172 */ |
| 399 | { PCI_DEVICE(0x1b4b, 0x9192), | ||
| 400 | .driver_data = board_ahci_yes_fbs }, /* 88se9172 on some Gigabyte */ | ||
| 396 | { PCI_DEVICE(0x1b4b, 0x91a3), | 401 | { PCI_DEVICE(0x1b4b, 0x91a3), |
| 397 | .driver_data = board_ahci_yes_fbs }, | 402 | .driver_data = board_ahci_yes_fbs }, |
| 398 | 403 | ||
| @@ -400,7 +405,10 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
| 400 | { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ | 405 | { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ |
| 401 | 406 | ||
| 402 | /* Asmedia */ | 407 | /* Asmedia */ |
| 403 | { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1061 */ | 408 | { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */ |
| 409 | { PCI_VDEVICE(ASMEDIA, 0x0602), board_ahci }, /* ASM1060 */ | ||
| 410 | { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */ | ||
| 411 | { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */ | ||
| 404 | 412 | ||
| 405 | /* Generic, PCI class code for AHCI */ | 413 | /* Generic, PCI class code for AHCI */ |
| 406 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | 414 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index 11f36e502136..fc2de5528dcc 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
| @@ -86,6 +86,7 @@ static struct usb_device_id ath3k_table[] = { | |||
| 86 | 86 | ||
| 87 | /* Atheros AR5BBU22 with sflash firmware */ | 87 | /* Atheros AR5BBU22 with sflash firmware */ |
| 88 | { USB_DEVICE(0x0489, 0xE03C) }, | 88 | { USB_DEVICE(0x0489, 0xE03C) }, |
| 89 | { USB_DEVICE(0x0489, 0xE036) }, | ||
| 89 | 90 | ||
| 90 | { } /* Terminating entry */ | 91 | { } /* Terminating entry */ |
| 91 | }; | 92 | }; |
| @@ -109,6 +110,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { | |||
| 109 | 110 | ||
| 110 | /* Atheros AR5BBU22 with sflash firmware */ | 111 | /* Atheros AR5BBU22 with sflash firmware */ |
| 111 | { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, | 112 | { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, |
| 113 | { USB_DEVICE(0x0489, 0xE036), .driver_info = BTUSB_ATH3012 }, | ||
| 112 | 114 | ||
| 113 | { } /* Terminating entry */ | 115 | { } /* Terminating entry */ |
| 114 | }; | 116 | }; |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index cef3bac1a543..654e248763ef 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
| @@ -52,6 +52,9 @@ static struct usb_device_id btusb_table[] = { | |||
| 52 | /* Generic Bluetooth USB device */ | 52 | /* Generic Bluetooth USB device */ |
| 53 | { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, | 53 | { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, |
| 54 | 54 | ||
| 55 | /* Apple-specific (Broadcom) devices */ | ||
| 56 | { USB_VENDOR_AND_INTERFACE_INFO(0x05ac, 0xff, 0x01, 0x01) }, | ||
| 57 | |||
| 55 | /* Broadcom SoftSailing reporting vendor specific */ | 58 | /* Broadcom SoftSailing reporting vendor specific */ |
| 56 | { USB_DEVICE(0x0a5c, 0x21e1) }, | 59 | { USB_DEVICE(0x0a5c, 0x21e1) }, |
| 57 | 60 | ||
| @@ -94,16 +97,14 @@ static struct usb_device_id btusb_table[] = { | |||
| 94 | 97 | ||
| 95 | /* Broadcom BCM20702A0 */ | 98 | /* Broadcom BCM20702A0 */ |
| 96 | { USB_DEVICE(0x0489, 0xe042) }, | 99 | { USB_DEVICE(0x0489, 0xe042) }, |
| 97 | { USB_DEVICE(0x0a5c, 0x21e3) }, | ||
| 98 | { USB_DEVICE(0x0a5c, 0x21e6) }, | ||
| 99 | { USB_DEVICE(0x0a5c, 0x21e8) }, | ||
| 100 | { USB_DEVICE(0x0a5c, 0x21f3) }, | ||
| 101 | { USB_DEVICE(0x0a5c, 0x21f4) }, | ||
| 102 | { USB_DEVICE(0x413c, 0x8197) }, | 100 | { USB_DEVICE(0x413c, 0x8197) }, |
| 103 | 101 | ||
| 104 | /* Foxconn - Hon Hai */ | 102 | /* Foxconn - Hon Hai */ |
| 105 | { USB_DEVICE(0x0489, 0xe033) }, | 103 | { USB_DEVICE(0x0489, 0xe033) }, |
| 106 | 104 | ||
| 105 | /*Broadcom devices with vendor specific id */ | ||
| 106 | { USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) }, | ||
| 107 | |||
| 107 | { } /* Terminating entry */ | 108 | { } /* Terminating entry */ |
| 108 | }; | 109 | }; |
| 109 | 110 | ||
| @@ -141,6 +142,7 @@ static struct usb_device_id blacklist_table[] = { | |||
| 141 | 142 | ||
| 142 | /* Atheros AR5BBU12 with sflash firmware */ | 143 | /* Atheros AR5BBU12 with sflash firmware */ |
| 143 | { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, | 144 | { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, |
| 145 | { USB_DEVICE(0x0489, 0xe036), .driver_info = BTUSB_ATH3012 }, | ||
| 144 | 146 | ||
| 145 | /* Broadcom BCM2035 */ | 147 | /* Broadcom BCM2035 */ |
| 146 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, | 148 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, |
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index f61780a02374..3bd5540238a7 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c | |||
| @@ -617,7 +617,7 @@ static int __devinit at91_adc_probe(struct platform_device *pdev) | |||
| 617 | st->adc_clk = clk_get(&pdev->dev, "adc_op_clk"); | 617 | st->adc_clk = clk_get(&pdev->dev, "adc_op_clk"); |
| 618 | if (IS_ERR(st->adc_clk)) { | 618 | if (IS_ERR(st->adc_clk)) { |
| 619 | dev_err(&pdev->dev, "Failed to get the ADC clock.\n"); | 619 | dev_err(&pdev->dev, "Failed to get the ADC clock.\n"); |
| 620 | ret = PTR_ERR(st->clk); | 620 | ret = PTR_ERR(st->adc_clk); |
| 621 | goto error_disable_clk; | 621 | goto error_disable_clk; |
| 622 | } | 622 | } |
| 623 | 623 | ||
diff --git a/drivers/isdn/hardware/mISDN/avmfritz.c b/drivers/isdn/hardware/mISDN/avmfritz.c index fa6ca4733725..dceaec821b0e 100644 --- a/drivers/isdn/hardware/mISDN/avmfritz.c +++ b/drivers/isdn/hardware/mISDN/avmfritz.c | |||
| @@ -857,8 +857,9 @@ avm_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg) | |||
| 857 | switch (cmd) { | 857 | switch (cmd) { |
| 858 | case CLOSE_CHANNEL: | 858 | case CLOSE_CHANNEL: |
| 859 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 859 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
| 860 | cancel_work_sync(&bch->workq); | ||
| 860 | spin_lock_irqsave(&fc->lock, flags); | 861 | spin_lock_irqsave(&fc->lock, flags); |
| 861 | mISDN_freebchannel(bch); | 862 | mISDN_clear_bchannel(bch); |
| 862 | modehdlc(bch, ISDN_P_NONE); | 863 | modehdlc(bch, ISDN_P_NONE); |
| 863 | spin_unlock_irqrestore(&fc->lock, flags); | 864 | spin_unlock_irqrestore(&fc->lock, flags); |
| 864 | ch->protocol = ISDN_P_NONE; | 865 | ch->protocol = ISDN_P_NONE; |
diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index 5e402cf2e795..f02794203bb1 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c | |||
| @@ -5059,6 +5059,7 @@ hfcmulti_init(struct hm_map *m, struct pci_dev *pdev, | |||
| 5059 | printk(KERN_INFO | 5059 | printk(KERN_INFO |
| 5060 | "HFC-E1 #%d has overlapping B-channels on fragment #%d\n", | 5060 | "HFC-E1 #%d has overlapping B-channels on fragment #%d\n", |
| 5061 | E1_cnt + 1, pt); | 5061 | E1_cnt + 1, pt); |
| 5062 | kfree(hc); | ||
| 5062 | return -EINVAL; | 5063 | return -EINVAL; |
| 5063 | } | 5064 | } |
| 5064 | maskcheck |= hc->bmask[pt]; | 5065 | maskcheck |= hc->bmask[pt]; |
| @@ -5086,6 +5087,7 @@ hfcmulti_init(struct hm_map *m, struct pci_dev *pdev, | |||
| 5086 | if ((poll >> 1) > sizeof(hc->silence_data)) { | 5087 | if ((poll >> 1) > sizeof(hc->silence_data)) { |
| 5087 | printk(KERN_ERR "HFCMULTI error: silence_data too small, " | 5088 | printk(KERN_ERR "HFCMULTI error: silence_data too small, " |
| 5088 | "please fix\n"); | 5089 | "please fix\n"); |
| 5090 | kfree(hc); | ||
| 5089 | return -EINVAL; | 5091 | return -EINVAL; |
| 5090 | } | 5092 | } |
| 5091 | for (i = 0; i < (poll >> 1); i++) | 5093 | for (i = 0; i < (poll >> 1); i++) |
diff --git a/drivers/isdn/hardware/mISDN/mISDNipac.c b/drivers/isdn/hardware/mISDN/mISDNipac.c index 752e0825591f..ccd7d851be26 100644 --- a/drivers/isdn/hardware/mISDN/mISDNipac.c +++ b/drivers/isdn/hardware/mISDN/mISDNipac.c | |||
| @@ -1406,8 +1406,9 @@ hscx_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg) | |||
| 1406 | switch (cmd) { | 1406 | switch (cmd) { |
| 1407 | case CLOSE_CHANNEL: | 1407 | case CLOSE_CHANNEL: |
| 1408 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 1408 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
| 1409 | cancel_work_sync(&bch->workq); | ||
| 1409 | spin_lock_irqsave(hx->ip->hwlock, flags); | 1410 | spin_lock_irqsave(hx->ip->hwlock, flags); |
| 1410 | mISDN_freebchannel(bch); | 1411 | mISDN_clear_bchannel(bch); |
| 1411 | hscx_mode(hx, ISDN_P_NONE); | 1412 | hscx_mode(hx, ISDN_P_NONE); |
| 1412 | spin_unlock_irqrestore(hx->ip->hwlock, flags); | 1413 | spin_unlock_irqrestore(hx->ip->hwlock, flags); |
| 1413 | ch->protocol = ISDN_P_NONE; | 1414 | ch->protocol = ISDN_P_NONE; |
diff --git a/drivers/isdn/hardware/mISDN/mISDNisar.c b/drivers/isdn/hardware/mISDN/mISDNisar.c index be5973ded6d6..182ecf0626c2 100644 --- a/drivers/isdn/hardware/mISDN/mISDNisar.c +++ b/drivers/isdn/hardware/mISDN/mISDNisar.c | |||
| @@ -1588,8 +1588,9 @@ isar_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg) | |||
| 1588 | switch (cmd) { | 1588 | switch (cmd) { |
| 1589 | case CLOSE_CHANNEL: | 1589 | case CLOSE_CHANNEL: |
| 1590 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 1590 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
| 1591 | cancel_work_sync(&bch->workq); | ||
| 1591 | spin_lock_irqsave(ich->is->hwlock, flags); | 1592 | spin_lock_irqsave(ich->is->hwlock, flags); |
| 1592 | mISDN_freebchannel(bch); | 1593 | mISDN_clear_bchannel(bch); |
| 1593 | modeisar(ich, ISDN_P_NONE); | 1594 | modeisar(ich, ISDN_P_NONE); |
| 1594 | spin_unlock_irqrestore(ich->is->hwlock, flags); | 1595 | spin_unlock_irqrestore(ich->is->hwlock, flags); |
| 1595 | ch->protocol = ISDN_P_NONE; | 1596 | ch->protocol = ISDN_P_NONE; |
diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c index c3e3e7686273..9bcade59eb73 100644 --- a/drivers/isdn/hardware/mISDN/netjet.c +++ b/drivers/isdn/hardware/mISDN/netjet.c | |||
| @@ -812,8 +812,9 @@ nj_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg) | |||
| 812 | switch (cmd) { | 812 | switch (cmd) { |
| 813 | case CLOSE_CHANNEL: | 813 | case CLOSE_CHANNEL: |
| 814 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 814 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
| 815 | cancel_work_sync(&bch->workq); | ||
| 815 | spin_lock_irqsave(&card->lock, flags); | 816 | spin_lock_irqsave(&card->lock, flags); |
| 816 | mISDN_freebchannel(bch); | 817 | mISDN_clear_bchannel(bch); |
| 817 | mode_tiger(bc, ISDN_P_NONE); | 818 | mode_tiger(bc, ISDN_P_NONE); |
| 818 | spin_unlock_irqrestore(&card->lock, flags); | 819 | spin_unlock_irqrestore(&card->lock, flags); |
| 819 | ch->protocol = ISDN_P_NONE; | 820 | ch->protocol = ISDN_P_NONE; |
diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c index 26a86b846099..335fe6455002 100644 --- a/drivers/isdn/hardware/mISDN/w6692.c +++ b/drivers/isdn/hardware/mISDN/w6692.c | |||
| @@ -1054,8 +1054,9 @@ w6692_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg) | |||
| 1054 | switch (cmd) { | 1054 | switch (cmd) { |
| 1055 | case CLOSE_CHANNEL: | 1055 | case CLOSE_CHANNEL: |
| 1056 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 1056 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
| 1057 | cancel_work_sync(&bch->workq); | ||
| 1057 | spin_lock_irqsave(&card->lock, flags); | 1058 | spin_lock_irqsave(&card->lock, flags); |
| 1058 | mISDN_freebchannel(bch); | 1059 | mISDN_clear_bchannel(bch); |
| 1059 | w6692_mode(bc, ISDN_P_NONE); | 1060 | w6692_mode(bc, ISDN_P_NONE); |
| 1060 | spin_unlock_irqrestore(&card->lock, flags); | 1061 | spin_unlock_irqrestore(&card->lock, flags); |
| 1061 | ch->protocol = ISDN_P_NONE; | 1062 | ch->protocol = ISDN_P_NONE; |
diff --git a/drivers/isdn/mISDN/hwchannel.c b/drivers/isdn/mISDN/hwchannel.c index ef34fd40867c..2602be23f341 100644 --- a/drivers/isdn/mISDN/hwchannel.c +++ b/drivers/isdn/mISDN/hwchannel.c | |||
| @@ -148,17 +148,16 @@ mISDN_clear_bchannel(struct bchannel *ch) | |||
| 148 | ch->next_minlen = ch->init_minlen; | 148 | ch->next_minlen = ch->init_minlen; |
| 149 | ch->maxlen = ch->init_maxlen; | 149 | ch->maxlen = ch->init_maxlen; |
| 150 | ch->next_maxlen = ch->init_maxlen; | 150 | ch->next_maxlen = ch->init_maxlen; |
| 151 | skb_queue_purge(&ch->rqueue); | ||
| 152 | ch->rcount = 0; | ||
| 151 | } | 153 | } |
| 152 | EXPORT_SYMBOL(mISDN_clear_bchannel); | 154 | EXPORT_SYMBOL(mISDN_clear_bchannel); |
| 153 | 155 | ||
| 154 | int | 156 | void |
| 155 | mISDN_freebchannel(struct bchannel *ch) | 157 | mISDN_freebchannel(struct bchannel *ch) |
| 156 | { | 158 | { |
| 159 | cancel_work_sync(&ch->workq); | ||
| 157 | mISDN_clear_bchannel(ch); | 160 | mISDN_clear_bchannel(ch); |
| 158 | skb_queue_purge(&ch->rqueue); | ||
| 159 | ch->rcount = 0; | ||
| 160 | flush_work_sync(&ch->workq); | ||
| 161 | return 0; | ||
| 162 | } | 161 | } |
| 163 | EXPORT_SYMBOL(mISDN_freebchannel); | 162 | EXPORT_SYMBOL(mISDN_freebchannel); |
| 164 | 163 | ||
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c index a580db29e503..26e7129332ab 100644 --- a/drivers/net/can/mcp251x.c +++ b/drivers/net/can/mcp251x.c | |||
| @@ -83,6 +83,11 @@ | |||
| 83 | #define INSTRUCTION_LOAD_TXB(n) (0x40 + 2 * (n)) | 83 | #define INSTRUCTION_LOAD_TXB(n) (0x40 + 2 * (n)) |
| 84 | #define INSTRUCTION_READ_RXB(n) (((n) == 0) ? 0x90 : 0x94) | 84 | #define INSTRUCTION_READ_RXB(n) (((n) == 0) ? 0x90 : 0x94) |
| 85 | #define INSTRUCTION_RESET 0xC0 | 85 | #define INSTRUCTION_RESET 0xC0 |
| 86 | #define RTS_TXB0 0x01 | ||
| 87 | #define RTS_TXB1 0x02 | ||
| 88 | #define RTS_TXB2 0x04 | ||
| 89 | #define INSTRUCTION_RTS(n) (0x80 | ((n) & 0x07)) | ||
| 90 | |||
| 86 | 91 | ||
| 87 | /* MPC251x registers */ | 92 | /* MPC251x registers */ |
| 88 | #define CANSTAT 0x0e | 93 | #define CANSTAT 0x0e |
| @@ -397,6 +402,7 @@ static void mcp251x_hw_tx_frame(struct spi_device *spi, u8 *buf, | |||
| 397 | static void mcp251x_hw_tx(struct spi_device *spi, struct can_frame *frame, | 402 | static void mcp251x_hw_tx(struct spi_device *spi, struct can_frame *frame, |
| 398 | int tx_buf_idx) | 403 | int tx_buf_idx) |
| 399 | { | 404 | { |
| 405 | struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev); | ||
| 400 | u32 sid, eid, exide, rtr; | 406 | u32 sid, eid, exide, rtr; |
| 401 | u8 buf[SPI_TRANSFER_BUF_LEN]; | 407 | u8 buf[SPI_TRANSFER_BUF_LEN]; |
| 402 | 408 | ||
| @@ -418,7 +424,10 @@ static void mcp251x_hw_tx(struct spi_device *spi, struct can_frame *frame, | |||
| 418 | buf[TXBDLC_OFF] = (rtr << DLC_RTR_SHIFT) | frame->can_dlc; | 424 | buf[TXBDLC_OFF] = (rtr << DLC_RTR_SHIFT) | frame->can_dlc; |
| 419 | memcpy(buf + TXBDAT_OFF, frame->data, frame->can_dlc); | 425 | memcpy(buf + TXBDAT_OFF, frame->data, frame->can_dlc); |
| 420 | mcp251x_hw_tx_frame(spi, buf, frame->can_dlc, tx_buf_idx); | 426 | mcp251x_hw_tx_frame(spi, buf, frame->can_dlc, tx_buf_idx); |
| 421 | mcp251x_write_reg(spi, TXBCTRL(tx_buf_idx), TXBCTRL_TXREQ); | 427 | |
| 428 | /* use INSTRUCTION_RTS, to avoid "repeated frame problem" */ | ||
| 429 | priv->spi_tx_buf[0] = INSTRUCTION_RTS(1 << tx_buf_idx); | ||
| 430 | mcp251x_spi_trans(priv->spi, 1); | ||
| 422 | } | 431 | } |
| 423 | 432 | ||
| 424 | static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf, | 433 | static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf, |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index 21b553229ea4..dfd86a55f1dc 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |||
| @@ -710,17 +710,15 @@ static inline u16 bnx2x_tx_avail(struct bnx2x *bp, | |||
| 710 | prod = txdata->tx_bd_prod; | 710 | prod = txdata->tx_bd_prod; |
| 711 | cons = txdata->tx_bd_cons; | 711 | cons = txdata->tx_bd_cons; |
| 712 | 712 | ||
| 713 | /* NUM_TX_RINGS = number of "next-page" entries | 713 | used = SUB_S16(prod, cons); |
| 714 | It will be used as a threshold */ | ||
| 715 | used = SUB_S16(prod, cons) + (s16)NUM_TX_RINGS; | ||
| 716 | 714 | ||
| 717 | #ifdef BNX2X_STOP_ON_ERROR | 715 | #ifdef BNX2X_STOP_ON_ERROR |
| 718 | WARN_ON(used < 0); | 716 | WARN_ON(used < 0); |
| 719 | WARN_ON(used > bp->tx_ring_size); | 717 | WARN_ON(used > txdata->tx_ring_size); |
| 720 | WARN_ON((bp->tx_ring_size - used) > MAX_TX_AVAIL); | 718 | WARN_ON((txdata->tx_ring_size - used) > MAX_TX_AVAIL); |
| 721 | #endif | 719 | #endif |
| 722 | 720 | ||
| 723 | return (s16)(bp->tx_ring_size) - used; | 721 | return (s16)(txdata->tx_ring_size) - used; |
| 724 | } | 722 | } |
| 725 | 723 | ||
| 726 | static inline int bnx2x_tx_queue_has_work(struct bnx2x_fp_txdata *txdata) | 724 | static inline int bnx2x_tx_queue_has_work(struct bnx2x_fp_txdata *txdata) |
| @@ -1088,6 +1086,7 @@ static inline void bnx2x_init_txdata(struct bnx2x *bp, | |||
| 1088 | txdata->txq_index = txq_index; | 1086 | txdata->txq_index = txq_index; |
| 1089 | txdata->tx_cons_sb = tx_cons_sb; | 1087 | txdata->tx_cons_sb = tx_cons_sb; |
| 1090 | txdata->parent_fp = fp; | 1088 | txdata->parent_fp = fp; |
| 1089 | txdata->tx_ring_size = IS_FCOE_FP(fp) ? MAX_TX_AVAIL : bp->tx_ring_size; | ||
| 1091 | 1090 | ||
| 1092 | DP(NETIF_MSG_IFUP, "created tx data cid %d, txq %d\n", | 1091 | DP(NETIF_MSG_IFUP, "created tx data cid %d, txq %d\n", |
| 1093 | txdata->cid, txdata->txq_index); | 1092 | txdata->cid, txdata->txq_index); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h index 3e4cff9b1ebe..b926f58e983b 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h | |||
| @@ -401,11 +401,11 @@ static const struct reg_addr reg_addrs[] = { | |||
| 401 | { 0x70000, 8, RI_ALL_ONLINE }, | 401 | { 0x70000, 8, RI_ALL_ONLINE }, |
| 402 | { 0x70020, 8184, RI_ALL_OFFLINE }, | 402 | { 0x70020, 8184, RI_ALL_OFFLINE }, |
| 403 | { 0x78000, 8192, RI_E3E3B0_OFFLINE }, | 403 | { 0x78000, 8192, RI_E3E3B0_OFFLINE }, |
| 404 | { 0x85000, 3, RI_ALL_ONLINE }, | 404 | { 0x85000, 3, RI_ALL_OFFLINE }, |
| 405 | { 0x8501c, 7, RI_ALL_ONLINE }, | 405 | { 0x8501c, 7, RI_ALL_OFFLINE }, |
| 406 | { 0x85048, 1, RI_ALL_ONLINE }, | 406 | { 0x85048, 1, RI_ALL_OFFLINE }, |
| 407 | { 0x85200, 32, RI_ALL_ONLINE }, | 407 | { 0x85200, 32, RI_ALL_OFFLINE }, |
| 408 | { 0xb0000, 16384, RI_E1H_ONLINE }, | 408 | { 0xb0000, 16384, RI_E1H_OFFLINE }, |
| 409 | { 0xc1000, 7, RI_ALL_ONLINE }, | 409 | { 0xc1000, 7, RI_ALL_ONLINE }, |
| 410 | { 0xc103c, 2, RI_E2E3E3B0_ONLINE }, | 410 | { 0xc103c, 2, RI_E2E3E3B0_ONLINE }, |
| 411 | { 0xc1800, 2, RI_ALL_ONLINE }, | 411 | { 0xc1800, 2, RI_ALL_ONLINE }, |
| @@ -581,17 +581,12 @@ static const struct reg_addr reg_addrs[] = { | |||
| 581 | { 0x140188, 3, RI_E1E1HE2E3_ONLINE }, | 581 | { 0x140188, 3, RI_E1E1HE2E3_ONLINE }, |
| 582 | { 0x140194, 13, RI_ALL_ONLINE }, | 582 | { 0x140194, 13, RI_ALL_ONLINE }, |
| 583 | { 0x140200, 6, RI_E1E1HE2E3_ONLINE }, | 583 | { 0x140200, 6, RI_E1E1HE2E3_ONLINE }, |
| 584 | { 0x140220, 4, RI_E2E3_ONLINE }, | ||
| 585 | { 0x140240, 4, RI_E2E3_ONLINE }, | ||
| 586 | { 0x140260, 4, RI_E2E3_ONLINE }, | 584 | { 0x140260, 4, RI_E2E3_ONLINE }, |
| 587 | { 0x140280, 4, RI_E2E3_ONLINE }, | 585 | { 0x140280, 4, RI_E2E3_ONLINE }, |
| 588 | { 0x1402a0, 4, RI_E2E3_ONLINE }, | ||
| 589 | { 0x1402c0, 4, RI_E2E3_ONLINE }, | ||
| 590 | { 0x1402e0, 2, RI_E2E3_ONLINE }, | 586 | { 0x1402e0, 2, RI_E2E3_ONLINE }, |
| 591 | { 0x1402e8, 2, RI_E2E3E3B0_ONLINE }, | 587 | { 0x1402e8, 2, RI_E2E3E3B0_ONLINE }, |
| 592 | { 0x1402f0, 9, RI_E2E3_ONLINE }, | 588 | { 0x1402f0, 9, RI_E2E3_ONLINE }, |
| 593 | { 0x140314, 44, RI_E3B0_ONLINE }, | 589 | { 0x140314, 44, RI_E3B0_ONLINE }, |
| 594 | { 0x1403d0, 70, RI_E3B0_ONLINE }, | ||
| 595 | { 0x144000, 4, RI_E1E1H_ONLINE }, | 590 | { 0x144000, 4, RI_E1E1H_ONLINE }, |
| 596 | { 0x148000, 4, RI_E1E1H_ONLINE }, | 591 | { 0x148000, 4, RI_E1E1H_ONLINE }, |
| 597 | { 0x14c000, 4, RI_E1E1H_ONLINE }, | 592 | { 0x14c000, 4, RI_E1E1H_ONLINE }, |
| @@ -704,7 +699,6 @@ static const struct reg_addr reg_addrs[] = { | |||
| 704 | { 0x180398, 1, RI_E2E3E3B0_ONLINE }, | 699 | { 0x180398, 1, RI_E2E3E3B0_ONLINE }, |
| 705 | { 0x1803a0, 5, RI_E2E3E3B0_ONLINE }, | 700 | { 0x1803a0, 5, RI_E2E3E3B0_ONLINE }, |
| 706 | { 0x1803b4, 2, RI_E3E3B0_ONLINE }, | 701 | { 0x1803b4, 2, RI_E3E3B0_ONLINE }, |
| 707 | { 0x180400, 1, RI_ALL_ONLINE }, | ||
| 708 | { 0x180404, 255, RI_E1E1H_OFFLINE }, | 702 | { 0x180404, 255, RI_E1E1H_OFFLINE }, |
| 709 | { 0x181000, 4, RI_ALL_ONLINE }, | 703 | { 0x181000, 4, RI_ALL_ONLINE }, |
| 710 | { 0x181010, 1020, RI_ALL_OFFLINE }, | 704 | { 0x181010, 1020, RI_ALL_OFFLINE }, |
| @@ -800,9 +794,9 @@ static const struct reg_addr reg_addrs[] = { | |||
| 800 | { 0x1b905c, 1, RI_E3E3B0_ONLINE }, | 794 | { 0x1b905c, 1, RI_E3E3B0_ONLINE }, |
| 801 | { 0x1b9064, 1, RI_E3B0_ONLINE }, | 795 | { 0x1b9064, 1, RI_E3B0_ONLINE }, |
| 802 | { 0x1b9080, 10, RI_E3B0_ONLINE }, | 796 | { 0x1b9080, 10, RI_E3B0_ONLINE }, |
| 803 | { 0x1b9400, 14, RI_E2E3E3B0_ONLINE }, | 797 | { 0x1b9400, 14, RI_E2E3E3B0_OFFLINE }, |
| 804 | { 0x1b943c, 19, RI_E2E3E3B0_ONLINE }, | 798 | { 0x1b943c, 19, RI_E2E3E3B0_OFFLINE }, |
| 805 | { 0x1b9490, 10, RI_E2E3E3B0_ONLINE }, | 799 | { 0x1b9490, 10, RI_E2E3E3B0_OFFLINE }, |
| 806 | { 0x1c0000, 2, RI_ALL_ONLINE }, | 800 | { 0x1c0000, 2, RI_ALL_ONLINE }, |
| 807 | { 0x200000, 65, RI_ALL_ONLINE }, | 801 | { 0x200000, 65, RI_ALL_ONLINE }, |
| 808 | { 0x20014c, 2, RI_E1HE2E3E3B0_ONLINE }, | 802 | { 0x20014c, 2, RI_E1HE2E3E3B0_ONLINE }, |
| @@ -814,7 +808,6 @@ static const struct reg_addr reg_addrs[] = { | |||
| 814 | { 0x200398, 1, RI_E2E3E3B0_ONLINE }, | 808 | { 0x200398, 1, RI_E2E3E3B0_ONLINE }, |
| 815 | { 0x2003a0, 1, RI_E2E3E3B0_ONLINE }, | 809 | { 0x2003a0, 1, RI_E2E3E3B0_ONLINE }, |
| 816 | { 0x2003a8, 2, RI_E2E3E3B0_ONLINE }, | 810 | { 0x2003a8, 2, RI_E2E3E3B0_ONLINE }, |
| 817 | { 0x200400, 1, RI_ALL_ONLINE }, | ||
| 818 | { 0x200404, 255, RI_E1E1H_OFFLINE }, | 811 | { 0x200404, 255, RI_E1E1H_OFFLINE }, |
| 819 | { 0x202000, 4, RI_ALL_ONLINE }, | 812 | { 0x202000, 4, RI_ALL_ONLINE }, |
| 820 | { 0x202010, 2044, RI_ALL_OFFLINE }, | 813 | { 0x202010, 2044, RI_ALL_OFFLINE }, |
| @@ -921,7 +914,6 @@ static const struct reg_addr reg_addrs[] = { | |||
| 921 | { 0x280398, 1, RI_E2E3E3B0_ONLINE }, | 914 | { 0x280398, 1, RI_E2E3E3B0_ONLINE }, |
| 922 | { 0x2803a0, 1, RI_E2E3E3B0_ONLINE }, | 915 | { 0x2803a0, 1, RI_E2E3E3B0_ONLINE }, |
| 923 | { 0x2803a8, 2, RI_E2E3E3B0_ONLINE }, | 916 | { 0x2803a8, 2, RI_E2E3E3B0_ONLINE }, |
| 924 | { 0x280400, 1, RI_ALL_ONLINE }, | ||
| 925 | { 0x280404, 255, RI_E1E1H_OFFLINE }, | 917 | { 0x280404, 255, RI_E1E1H_OFFLINE }, |
| 926 | { 0x282000, 4, RI_ALL_ONLINE }, | 918 | { 0x282000, 4, RI_ALL_ONLINE }, |
| 927 | { 0x282010, 2044, RI_ALL_OFFLINE }, | 919 | { 0x282010, 2044, RI_ALL_OFFLINE }, |
| @@ -1031,7 +1023,6 @@ static const struct reg_addr reg_addrs[] = { | |||
| 1031 | { 0x300398, 1, RI_E2E3E3B0_ONLINE }, | 1023 | { 0x300398, 1, RI_E2E3E3B0_ONLINE }, |
| 1032 | { 0x3003a0, 1, RI_E2E3E3B0_ONLINE }, | 1024 | { 0x3003a0, 1, RI_E2E3E3B0_ONLINE }, |
| 1033 | { 0x3003a8, 2, RI_E2E3E3B0_ONLINE }, | 1025 | { 0x3003a8, 2, RI_E2E3E3B0_ONLINE }, |
| 1034 | { 0x300400, 1, RI_ALL_ONLINE }, | ||
| 1035 | { 0x300404, 255, RI_E1E1H_OFFLINE }, | 1026 | { 0x300404, 255, RI_E1E1H_OFFLINE }, |
| 1036 | { 0x302000, 4, RI_ALL_ONLINE }, | 1027 | { 0x302000, 4, RI_ALL_ONLINE }, |
| 1037 | { 0x302010, 2044, RI_ALL_OFFLINE }, | 1028 | { 0x302010, 2044, RI_ALL_OFFLINE }, |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index c37a68d68090..ebf40cd7aa10 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
| @@ -775,7 +775,7 @@ static void bnx2x_get_regs(struct net_device *dev, | |||
| 775 | struct bnx2x *bp = netdev_priv(dev); | 775 | struct bnx2x *bp = netdev_priv(dev); |
| 776 | struct dump_hdr dump_hdr = {0}; | 776 | struct dump_hdr dump_hdr = {0}; |
| 777 | 777 | ||
| 778 | regs->version = 0; | 778 | regs->version = 1; |
| 779 | memset(p, 0, regs->len); | 779 | memset(p, 0, regs->len); |
| 780 | 780 | ||
| 781 | if (!netif_running(bp->dev)) | 781 | if (!netif_running(bp->dev)) |
| @@ -1587,6 +1587,12 @@ static int bnx2x_set_pauseparam(struct net_device *dev, | |||
| 1587 | bp->link_params.req_flow_ctrl[cfg_idx] = | 1587 | bp->link_params.req_flow_ctrl[cfg_idx] = |
| 1588 | BNX2X_FLOW_CTRL_AUTO; | 1588 | BNX2X_FLOW_CTRL_AUTO; |
| 1589 | } | 1589 | } |
| 1590 | bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_NONE; | ||
| 1591 | if (epause->rx_pause) | ||
| 1592 | bp->link_params.req_fc_auto_adv |= BNX2X_FLOW_CTRL_RX; | ||
| 1593 | |||
| 1594 | if (epause->tx_pause) | ||
| 1595 | bp->link_params.req_fc_auto_adv |= BNX2X_FLOW_CTRL_TX; | ||
| 1590 | } | 1596 | } |
| 1591 | 1597 | ||
| 1592 | DP(BNX2X_MSG_ETHTOOL, | 1598 | DP(BNX2X_MSG_ETHTOOL, |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index f4beb46c4709..b046beb435b2 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
| @@ -2667,9 +2667,11 @@ int bnx2x_update_pfc(struct link_params *params, | |||
| 2667 | return bnx2x_status; | 2667 | return bnx2x_status; |
| 2668 | 2668 | ||
| 2669 | DP(NETIF_MSG_LINK, "About to update PFC in BMAC\n"); | 2669 | DP(NETIF_MSG_LINK, "About to update PFC in BMAC\n"); |
| 2670 | if (CHIP_IS_E3(bp)) | 2670 | |
| 2671 | bnx2x_update_pfc_xmac(params, vars, 0); | 2671 | if (CHIP_IS_E3(bp)) { |
| 2672 | else { | 2672 | if (vars->mac_type == MAC_TYPE_XMAC) |
| 2673 | bnx2x_update_pfc_xmac(params, vars, 0); | ||
| 2674 | } else { | ||
| 2673 | val = REG_RD(bp, MISC_REG_RESET_REG_2); | 2675 | val = REG_RD(bp, MISC_REG_RESET_REG_2); |
| 2674 | if ((val & | 2676 | if ((val & |
| 2675 | (MISC_REGISTERS_RESET_REG_2_RST_BMAC0 << params->port)) | 2677 | (MISC_REGISTERS_RESET_REG_2_RST_BMAC0 << params->port)) |
| @@ -5432,7 +5434,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy, | |||
| 5432 | switch (speed_mask) { | 5434 | switch (speed_mask) { |
| 5433 | case GP_STATUS_10M: | 5435 | case GP_STATUS_10M: |
| 5434 | vars->line_speed = SPEED_10; | 5436 | vars->line_speed = SPEED_10; |
| 5435 | if (vars->duplex == DUPLEX_FULL) | 5437 | if (is_duplex == DUPLEX_FULL) |
| 5436 | vars->link_status |= LINK_10TFD; | 5438 | vars->link_status |= LINK_10TFD; |
| 5437 | else | 5439 | else |
| 5438 | vars->link_status |= LINK_10THD; | 5440 | vars->link_status |= LINK_10THD; |
| @@ -5440,7 +5442,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy, | |||
| 5440 | 5442 | ||
| 5441 | case GP_STATUS_100M: | 5443 | case GP_STATUS_100M: |
| 5442 | vars->line_speed = SPEED_100; | 5444 | vars->line_speed = SPEED_100; |
| 5443 | if (vars->duplex == DUPLEX_FULL) | 5445 | if (is_duplex == DUPLEX_FULL) |
| 5444 | vars->link_status |= LINK_100TXFD; | 5446 | vars->link_status |= LINK_100TXFD; |
| 5445 | else | 5447 | else |
| 5446 | vars->link_status |= LINK_100TXHD; | 5448 | vars->link_status |= LINK_100TXHD; |
| @@ -5449,7 +5451,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy, | |||
| 5449 | case GP_STATUS_1G: | 5451 | case GP_STATUS_1G: |
| 5450 | case GP_STATUS_1G_KX: | 5452 | case GP_STATUS_1G_KX: |
| 5451 | vars->line_speed = SPEED_1000; | 5453 | vars->line_speed = SPEED_1000; |
| 5452 | if (vars->duplex == DUPLEX_FULL) | 5454 | if (is_duplex == DUPLEX_FULL) |
| 5453 | vars->link_status |= LINK_1000TFD; | 5455 | vars->link_status |= LINK_1000TFD; |
| 5454 | else | 5456 | else |
| 5455 | vars->link_status |= LINK_1000THD; | 5457 | vars->link_status |= LINK_1000THD; |
| @@ -5457,7 +5459,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy, | |||
| 5457 | 5459 | ||
| 5458 | case GP_STATUS_2_5G: | 5460 | case GP_STATUS_2_5G: |
| 5459 | vars->line_speed = SPEED_2500; | 5461 | vars->line_speed = SPEED_2500; |
| 5460 | if (vars->duplex == DUPLEX_FULL) | 5462 | if (is_duplex == DUPLEX_FULL) |
| 5461 | vars->link_status |= LINK_2500TFD; | 5463 | vars->link_status |= LINK_2500TFD; |
| 5462 | else | 5464 | else |
| 5463 | vars->link_status |= LINK_2500THD; | 5465 | vars->link_status |= LINK_2500THD; |
| @@ -5531,6 +5533,7 @@ static int bnx2x_link_settings_status(struct bnx2x_phy *phy, | |||
| 5531 | 5533 | ||
| 5532 | if (gp_status & MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS) { | 5534 | if (gp_status & MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS) { |
| 5533 | if (SINGLE_MEDIA_DIRECT(params)) { | 5535 | if (SINGLE_MEDIA_DIRECT(params)) { |
| 5536 | vars->duplex = duplex; | ||
| 5534 | bnx2x_flow_ctrl_resolve(phy, params, vars, gp_status); | 5537 | bnx2x_flow_ctrl_resolve(phy, params, vars, gp_status); |
| 5535 | if (phy->req_line_speed == SPEED_AUTO_NEG) | 5538 | if (phy->req_line_speed == SPEED_AUTO_NEG) |
| 5536 | bnx2x_xgxs_an_resolve(phy, params, vars, | 5539 | bnx2x_xgxs_an_resolve(phy, params, vars, |
| @@ -5625,6 +5628,7 @@ static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy, | |||
| 5625 | LINK_STATUS_PARALLEL_DETECTION_USED; | 5628 | LINK_STATUS_PARALLEL_DETECTION_USED; |
| 5626 | } | 5629 | } |
| 5627 | bnx2x_ext_phy_resolve_fc(phy, params, vars); | 5630 | bnx2x_ext_phy_resolve_fc(phy, params, vars); |
| 5631 | vars->duplex = duplex; | ||
| 5628 | } | 5632 | } |
| 5629 | } | 5633 | } |
| 5630 | 5634 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 21054987257a..211753e01f81 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
| @@ -7561,8 +7561,14 @@ int bnx2x_set_mac_one(struct bnx2x *bp, u8 *mac, | |||
| 7561 | } | 7561 | } |
| 7562 | 7562 | ||
| 7563 | rc = bnx2x_config_vlan_mac(bp, &ramrod_param); | 7563 | rc = bnx2x_config_vlan_mac(bp, &ramrod_param); |
| 7564 | if (rc < 0) | 7564 | |
| 7565 | if (rc == -EEXIST) { | ||
| 7566 | DP(BNX2X_MSG_SP, "Failed to schedule ADD operations: %d\n", rc); | ||
| 7567 | /* do not treat adding same MAC as error */ | ||
| 7568 | rc = 0; | ||
| 7569 | } else if (rc < 0) | ||
| 7565 | BNX2X_ERR("%s MAC failed\n", (set ? "Set" : "Del")); | 7570 | BNX2X_ERR("%s MAC failed\n", (set ? "Set" : "Del")); |
| 7571 | |||
| 7566 | return rc; | 7572 | return rc; |
| 7567 | } | 7573 | } |
| 7568 | 7574 | ||
| @@ -10294,13 +10300,11 @@ static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp) | |||
| 10294 | dev_info.port_hw_config[port]. | 10300 | dev_info.port_hw_config[port]. |
| 10295 | fcoe_wwn_node_name_lower); | 10301 | fcoe_wwn_node_name_lower); |
| 10296 | } else if (!IS_MF_SD(bp)) { | 10302 | } else if (!IS_MF_SD(bp)) { |
| 10297 | u32 cfg = MF_CFG_RD(bp, func_ext_config[func].func_cfg); | ||
| 10298 | |||
| 10299 | /* | 10303 | /* |
| 10300 | * Read the WWN info only if the FCoE feature is enabled for | 10304 | * Read the WWN info only if the FCoE feature is enabled for |
| 10301 | * this function. | 10305 | * this function. |
| 10302 | */ | 10306 | */ |
| 10303 | if (cfg & MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) | 10307 | if (BNX2X_MF_EXT_PROTOCOL_FCOE(bp) && !CHIP_IS_E1x(bp)) |
| 10304 | bnx2x_get_ext_wwn_info(bp, func); | 10308 | bnx2x_get_ext_wwn_info(bp, func); |
| 10305 | 10309 | ||
| 10306 | } else if (IS_MF_FCOE_SD(bp)) | 10310 | } else if (IS_MF_FCOE_SD(bp)) |
| @@ -11073,7 +11077,14 @@ static int bnx2x_set_uc_list(struct bnx2x *bp) | |||
| 11073 | netdev_for_each_uc_addr(ha, dev) { | 11077 | netdev_for_each_uc_addr(ha, dev) { |
| 11074 | rc = bnx2x_set_mac_one(bp, bnx2x_uc_addr(ha), mac_obj, true, | 11078 | rc = bnx2x_set_mac_one(bp, bnx2x_uc_addr(ha), mac_obj, true, |
| 11075 | BNX2X_UC_LIST_MAC, &ramrod_flags); | 11079 | BNX2X_UC_LIST_MAC, &ramrod_flags); |
| 11076 | if (rc < 0) { | 11080 | if (rc == -EEXIST) { |
| 11081 | DP(BNX2X_MSG_SP, | ||
| 11082 | "Failed to schedule ADD operations: %d\n", rc); | ||
| 11083 | /* do not treat adding same MAC as error */ | ||
| 11084 | rc = 0; | ||
| 11085 | |||
| 11086 | } else if (rc < 0) { | ||
| 11087 | |||
| 11077 | BNX2X_ERR("Failed to schedule ADD operations: %d\n", | 11088 | BNX2X_ERR("Failed to schedule ADD operations: %d\n", |
| 11078 | rc); | 11089 | rc); |
| 11079 | return rc; | 11090 | return rc; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c index 332db64dd5be..a1d0446b39b3 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | |||
| @@ -101,6 +101,11 @@ static void bnx2x_hw_stats_post(struct bnx2x *bp) | |||
| 101 | if (CHIP_REV_IS_SLOW(bp)) | 101 | if (CHIP_REV_IS_SLOW(bp)) |
| 102 | return; | 102 | return; |
| 103 | 103 | ||
| 104 | /* Update MCP's statistics if possible */ | ||
| 105 | if (bp->func_stx) | ||
| 106 | memcpy(bnx2x_sp(bp, func_stats), &bp->func_stats, | ||
| 107 | sizeof(bp->func_stats)); | ||
| 108 | |||
| 104 | /* loader */ | 109 | /* loader */ |
| 105 | if (bp->executer_idx) { | 110 | if (bp->executer_idx) { |
| 106 | int loader_idx = PMF_DMAE_C(bp); | 111 | int loader_idx = PMF_DMAE_C(bp); |
| @@ -128,8 +133,6 @@ static void bnx2x_hw_stats_post(struct bnx2x *bp) | |||
| 128 | 133 | ||
| 129 | } else if (bp->func_stx) { | 134 | } else if (bp->func_stx) { |
| 130 | *stats_comp = 0; | 135 | *stats_comp = 0; |
| 131 | memcpy(bnx2x_sp(bp, func_stats), &bp->func_stats, | ||
| 132 | sizeof(bp->func_stats)); | ||
| 133 | bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp)); | 136 | bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp)); |
| 134 | } | 137 | } |
| 135 | } | 138 | } |
| @@ -1151,9 +1154,11 @@ static void bnx2x_stats_update(struct bnx2x *bp) | |||
| 1151 | if (bp->port.pmf) | 1154 | if (bp->port.pmf) |
| 1152 | bnx2x_hw_stats_update(bp); | 1155 | bnx2x_hw_stats_update(bp); |
| 1153 | 1156 | ||
| 1154 | if (bnx2x_storm_stats_update(bp) && (bp->stats_pending++ == 3)) { | 1157 | if (bnx2x_storm_stats_update(bp)) { |
| 1155 | BNX2X_ERR("storm stats were not updated for 3 times\n"); | 1158 | if (bp->stats_pending++ == 3) { |
| 1156 | bnx2x_panic(); | 1159 | BNX2X_ERR("storm stats were not updated for 3 times\n"); |
| 1160 | bnx2x_panic(); | ||
| 1161 | } | ||
| 1157 | return; | 1162 | return; |
| 1158 | } | 1163 | } |
| 1159 | 1164 | ||
diff --git a/drivers/net/ethernet/i825xx/znet.c b/drivers/net/ethernet/i825xx/znet.c index bd1f1ef91e19..ba4e0cea3506 100644 --- a/drivers/net/ethernet/i825xx/znet.c +++ b/drivers/net/ethernet/i825xx/znet.c | |||
| @@ -139,8 +139,11 @@ struct znet_private { | |||
| 139 | /* Only one can be built-in;-> */ | 139 | /* Only one can be built-in;-> */ |
| 140 | static struct net_device *znet_dev; | 140 | static struct net_device *znet_dev; |
| 141 | 141 | ||
| 142 | #define NETIDBLK_MAGIC "NETIDBLK" | ||
| 143 | #define NETIDBLK_MAGIC_SIZE 8 | ||
| 144 | |||
| 142 | struct netidblk { | 145 | struct netidblk { |
| 143 | char magic[8]; /* The magic number (string) "NETIDBLK" */ | 146 | char magic[NETIDBLK_MAGIC_SIZE]; /* The magic number (string) "NETIDBLK" */ |
| 144 | unsigned char netid[8]; /* The physical station address */ | 147 | unsigned char netid[8]; /* The physical station address */ |
| 145 | char nettype, globalopt; | 148 | char nettype, globalopt; |
| 146 | char vendor[8]; /* The machine vendor and product name. */ | 149 | char vendor[8]; /* The machine vendor and product name. */ |
| @@ -373,14 +376,16 @@ static int __init znet_probe (void) | |||
| 373 | struct znet_private *znet; | 376 | struct znet_private *znet; |
| 374 | struct net_device *dev; | 377 | struct net_device *dev; |
| 375 | char *p; | 378 | char *p; |
| 379 | char *plast = phys_to_virt(0x100000 - NETIDBLK_MAGIC_SIZE); | ||
| 376 | int err = -ENOMEM; | 380 | int err = -ENOMEM; |
| 377 | 381 | ||
| 378 | /* This code scans the region 0xf0000 to 0xfffff for a "NETIDBLK". */ | 382 | /* This code scans the region 0xf0000 to 0xfffff for a "NETIDBLK". */ |
| 379 | for(p = (char *)phys_to_virt(0xf0000); p < (char *)phys_to_virt(0x100000); p++) | 383 | for(p = (char *)phys_to_virt(0xf0000); p <= plast; p++) |
| 380 | if (*p == 'N' && strncmp(p, "NETIDBLK", 8) == 0) | 384 | if (*p == 'N' && |
| 385 | strncmp(p, NETIDBLK_MAGIC, NETIDBLK_MAGIC_SIZE) == 0) | ||
| 381 | break; | 386 | break; |
| 382 | 387 | ||
| 383 | if (p >= (char *)phys_to_virt(0x100000)) { | 388 | if (p > plast) { |
| 384 | if (znet_debug > 1) | 389 | if (znet_debug > 1) |
| 385 | printk(KERN_INFO "No Z-Note ethernet adaptor found.\n"); | 390 | printk(KERN_INFO "No Z-Note ethernet adaptor found.\n"); |
| 386 | return -ENODEV; | 391 | return -ENODEV; |
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index 9010cea68bc3..b68d28a130e6 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c | |||
| @@ -472,14 +472,9 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter) | |||
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | if (adapter->rx_queue.queue_addr != NULL) { | 474 | if (adapter->rx_queue.queue_addr != NULL) { |
| 475 | if (!dma_mapping_error(dev, adapter->rx_queue.queue_dma)) { | 475 | dma_free_coherent(dev, adapter->rx_queue.queue_len, |
| 476 | dma_unmap_single(dev, | 476 | adapter->rx_queue.queue_addr, |
| 477 | adapter->rx_queue.queue_dma, | 477 | adapter->rx_queue.queue_dma); |
| 478 | adapter->rx_queue.queue_len, | ||
| 479 | DMA_BIDIRECTIONAL); | ||
| 480 | adapter->rx_queue.queue_dma = DMA_ERROR_CODE; | ||
| 481 | } | ||
| 482 | kfree(adapter->rx_queue.queue_addr); | ||
| 483 | adapter->rx_queue.queue_addr = NULL; | 478 | adapter->rx_queue.queue_addr = NULL; |
| 484 | } | 479 | } |
| 485 | 480 | ||
| @@ -556,10 +551,13 @@ static int ibmveth_open(struct net_device *netdev) | |||
| 556 | goto err_out; | 551 | goto err_out; |
| 557 | } | 552 | } |
| 558 | 553 | ||
| 554 | dev = &adapter->vdev->dev; | ||
| 555 | |||
| 559 | adapter->rx_queue.queue_len = sizeof(struct ibmveth_rx_q_entry) * | 556 | adapter->rx_queue.queue_len = sizeof(struct ibmveth_rx_q_entry) * |
| 560 | rxq_entries; | 557 | rxq_entries; |
| 561 | adapter->rx_queue.queue_addr = kmalloc(adapter->rx_queue.queue_len, | 558 | adapter->rx_queue.queue_addr = |
| 562 | GFP_KERNEL); | 559 | dma_alloc_coherent(dev, adapter->rx_queue.queue_len, |
| 560 | &adapter->rx_queue.queue_dma, GFP_KERNEL); | ||
| 563 | 561 | ||
| 564 | if (!adapter->rx_queue.queue_addr) { | 562 | if (!adapter->rx_queue.queue_addr) { |
| 565 | netdev_err(netdev, "unable to allocate rx queue pages\n"); | 563 | netdev_err(netdev, "unable to allocate rx queue pages\n"); |
| @@ -567,19 +565,13 @@ static int ibmveth_open(struct net_device *netdev) | |||
| 567 | goto err_out; | 565 | goto err_out; |
| 568 | } | 566 | } |
| 569 | 567 | ||
| 570 | dev = &adapter->vdev->dev; | ||
| 571 | |||
| 572 | adapter->buffer_list_dma = dma_map_single(dev, | 568 | adapter->buffer_list_dma = dma_map_single(dev, |
| 573 | adapter->buffer_list_addr, 4096, DMA_BIDIRECTIONAL); | 569 | adapter->buffer_list_addr, 4096, DMA_BIDIRECTIONAL); |
| 574 | adapter->filter_list_dma = dma_map_single(dev, | 570 | adapter->filter_list_dma = dma_map_single(dev, |
| 575 | adapter->filter_list_addr, 4096, DMA_BIDIRECTIONAL); | 571 | adapter->filter_list_addr, 4096, DMA_BIDIRECTIONAL); |
| 576 | adapter->rx_queue.queue_dma = dma_map_single(dev, | ||
| 577 | adapter->rx_queue.queue_addr, | ||
| 578 | adapter->rx_queue.queue_len, DMA_BIDIRECTIONAL); | ||
| 579 | 572 | ||
| 580 | if ((dma_mapping_error(dev, adapter->buffer_list_dma)) || | 573 | if ((dma_mapping_error(dev, adapter->buffer_list_dma)) || |
| 581 | (dma_mapping_error(dev, adapter->filter_list_dma)) || | 574 | (dma_mapping_error(dev, adapter->filter_list_dma))) { |
| 582 | (dma_mapping_error(dev, adapter->rx_queue.queue_dma))) { | ||
| 583 | netdev_err(netdev, "unable to map filter or buffer list " | 575 | netdev_err(netdev, "unable to map filter or buffer list " |
| 584 | "pages\n"); | 576 | "pages\n"); |
| 585 | rc = -ENOMEM; | 577 | rc = -ENOMEM; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 827b72dfce99..2f816c6aed72 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
| @@ -1234,13 +1234,13 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
| 1234 | mlx4_info(dev, "non-primary physical function, skipping.\n"); | 1234 | mlx4_info(dev, "non-primary physical function, skipping.\n"); |
| 1235 | else | 1235 | else |
| 1236 | mlx4_err(dev, "QUERY_FW command failed, aborting.\n"); | 1236 | mlx4_err(dev, "QUERY_FW command failed, aborting.\n"); |
| 1237 | goto unmap_bf; | 1237 | return err; |
| 1238 | } | 1238 | } |
| 1239 | 1239 | ||
| 1240 | err = mlx4_load_fw(dev); | 1240 | err = mlx4_load_fw(dev); |
| 1241 | if (err) { | 1241 | if (err) { |
| 1242 | mlx4_err(dev, "Failed to start FW, aborting.\n"); | 1242 | mlx4_err(dev, "Failed to start FW, aborting.\n"); |
| 1243 | goto unmap_bf; | 1243 | return err; |
| 1244 | } | 1244 | } |
| 1245 | 1245 | ||
| 1246 | mlx4_cfg.log_pg_sz_m = 1; | 1246 | mlx4_cfg.log_pg_sz_m = 1; |
| @@ -1304,7 +1304,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
| 1304 | err = mlx4_init_slave(dev); | 1304 | err = mlx4_init_slave(dev); |
| 1305 | if (err) { | 1305 | if (err) { |
| 1306 | mlx4_err(dev, "Failed to initialize slave\n"); | 1306 | mlx4_err(dev, "Failed to initialize slave\n"); |
| 1307 | goto unmap_bf; | 1307 | return err; |
| 1308 | } | 1308 | } |
| 1309 | 1309 | ||
| 1310 | err = mlx4_slave_cap(dev); | 1310 | err = mlx4_slave_cap(dev); |
| @@ -1324,7 +1324,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
| 1324 | err = mlx4_QUERY_ADAPTER(dev, &adapter); | 1324 | err = mlx4_QUERY_ADAPTER(dev, &adapter); |
| 1325 | if (err) { | 1325 | if (err) { |
| 1326 | mlx4_err(dev, "QUERY_ADAPTER command failed, aborting.\n"); | 1326 | mlx4_err(dev, "QUERY_ADAPTER command failed, aborting.\n"); |
| 1327 | goto err_close; | 1327 | goto unmap_bf; |
| 1328 | } | 1328 | } |
| 1329 | 1329 | ||
| 1330 | priv->eq_table.inta_pin = adapter.inta_pin; | 1330 | priv->eq_table.inta_pin = adapter.inta_pin; |
| @@ -1332,6 +1332,9 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
| 1332 | 1332 | ||
| 1333 | return 0; | 1333 | return 0; |
| 1334 | 1334 | ||
| 1335 | unmap_bf: | ||
| 1336 | unmap_bf_area(dev); | ||
| 1337 | |||
| 1335 | err_close: | 1338 | err_close: |
| 1336 | mlx4_close_hca(dev); | 1339 | mlx4_close_hca(dev); |
| 1337 | 1340 | ||
| @@ -1344,8 +1347,6 @@ err_stop_fw: | |||
| 1344 | mlx4_UNMAP_FA(dev); | 1347 | mlx4_UNMAP_FA(dev); |
| 1345 | mlx4_free_icm(dev, priv->fw.fw_icm, 0); | 1348 | mlx4_free_icm(dev, priv->fw.fw_icm, 0); |
| 1346 | } | 1349 | } |
| 1347 | unmap_bf: | ||
| 1348 | unmap_bf_area(dev); | ||
| 1349 | return err; | 1350 | return err; |
| 1350 | } | 1351 | } |
| 1351 | 1352 | ||
| @@ -1996,7 +1997,8 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 1996 | } | 1997 | } |
| 1997 | 1998 | ||
| 1998 | slave_start: | 1999 | slave_start: |
| 1999 | if (mlx4_cmd_init(dev)) { | 2000 | err = mlx4_cmd_init(dev); |
| 2001 | if (err) { | ||
| 2000 | mlx4_err(dev, "Failed to init command interface, aborting.\n"); | 2002 | mlx4_err(dev, "Failed to init command interface, aborting.\n"); |
| 2001 | goto err_sriov; | 2003 | goto err_sriov; |
| 2002 | } | 2004 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c index a018ea2a43de..e151c21baf2b 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mcg.c +++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c | |||
| @@ -137,11 +137,11 @@ static int mlx4_GID_HASH(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox, | |||
| 137 | return err; | 137 | return err; |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | static struct mlx4_promisc_qp *get_promisc_qp(struct mlx4_dev *dev, u8 pf_num, | 140 | static struct mlx4_promisc_qp *get_promisc_qp(struct mlx4_dev *dev, u8 port, |
| 141 | enum mlx4_steer_type steer, | 141 | enum mlx4_steer_type steer, |
| 142 | u32 qpn) | 142 | u32 qpn) |
| 143 | { | 143 | { |
| 144 | struct mlx4_steer *s_steer = &mlx4_priv(dev)->steer[pf_num]; | 144 | struct mlx4_steer *s_steer = &mlx4_priv(dev)->steer[port - 1]; |
| 145 | struct mlx4_promisc_qp *pqp; | 145 | struct mlx4_promisc_qp *pqp; |
| 146 | 146 | ||
| 147 | list_for_each_entry(pqp, &s_steer->promisc_qps[steer], list) { | 147 | list_for_each_entry(pqp, &s_steer->promisc_qps[steer], list) { |
| @@ -182,7 +182,7 @@ static int new_steering_entry(struct mlx4_dev *dev, u8 port, | |||
| 182 | /* If the given qpn is also a promisc qp, | 182 | /* If the given qpn is also a promisc qp, |
| 183 | * it should be inserted to duplicates list | 183 | * it should be inserted to duplicates list |
| 184 | */ | 184 | */ |
| 185 | pqp = get_promisc_qp(dev, 0, steer, qpn); | 185 | pqp = get_promisc_qp(dev, port, steer, qpn); |
| 186 | if (pqp) { | 186 | if (pqp) { |
| 187 | dqp = kmalloc(sizeof *dqp, GFP_KERNEL); | 187 | dqp = kmalloc(sizeof *dqp, GFP_KERNEL); |
| 188 | if (!dqp) { | 188 | if (!dqp) { |
| @@ -256,7 +256,7 @@ static int existing_steering_entry(struct mlx4_dev *dev, u8 port, | |||
| 256 | 256 | ||
| 257 | s_steer = &mlx4_priv(dev)->steer[port - 1]; | 257 | s_steer = &mlx4_priv(dev)->steer[port - 1]; |
| 258 | 258 | ||
| 259 | pqp = get_promisc_qp(dev, 0, steer, qpn); | 259 | pqp = get_promisc_qp(dev, port, steer, qpn); |
| 260 | if (!pqp) | 260 | if (!pqp) |
| 261 | return 0; /* nothing to do */ | 261 | return 0; /* nothing to do */ |
| 262 | 262 | ||
| @@ -302,7 +302,7 @@ static bool check_duplicate_entry(struct mlx4_dev *dev, u8 port, | |||
| 302 | s_steer = &mlx4_priv(dev)->steer[port - 1]; | 302 | s_steer = &mlx4_priv(dev)->steer[port - 1]; |
| 303 | 303 | ||
| 304 | /* if qp is not promisc, it cannot be duplicated */ | 304 | /* if qp is not promisc, it cannot be duplicated */ |
| 305 | if (!get_promisc_qp(dev, 0, steer, qpn)) | 305 | if (!get_promisc_qp(dev, port, steer, qpn)) |
| 306 | return false; | 306 | return false; |
| 307 | 307 | ||
| 308 | /* The qp is promisc qp so it is a duplicate on this index | 308 | /* The qp is promisc qp so it is a duplicate on this index |
| @@ -352,7 +352,7 @@ static bool can_remove_steering_entry(struct mlx4_dev *dev, u8 port, | |||
| 352 | members_count = be32_to_cpu(mgm->members_count) & 0xffffff; | 352 | members_count = be32_to_cpu(mgm->members_count) & 0xffffff; |
| 353 | for (i = 0; i < members_count; i++) { | 353 | for (i = 0; i < members_count; i++) { |
| 354 | qpn = be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK; | 354 | qpn = be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK; |
| 355 | if (!get_promisc_qp(dev, 0, steer, qpn) && qpn != tqpn) { | 355 | if (!get_promisc_qp(dev, port, steer, qpn) && qpn != tqpn) { |
| 356 | /* the qp is not promisc, the entry can't be removed */ | 356 | /* the qp is not promisc, the entry can't be removed */ |
| 357 | goto out; | 357 | goto out; |
| 358 | } | 358 | } |
| @@ -398,7 +398,7 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port, | |||
| 398 | 398 | ||
| 399 | mutex_lock(&priv->mcg_table.mutex); | 399 | mutex_lock(&priv->mcg_table.mutex); |
| 400 | 400 | ||
| 401 | if (get_promisc_qp(dev, 0, steer, qpn)) { | 401 | if (get_promisc_qp(dev, port, steer, qpn)) { |
| 402 | err = 0; /* Noting to do, already exists */ | 402 | err = 0; /* Noting to do, already exists */ |
| 403 | goto out_mutex; | 403 | goto out_mutex; |
| 404 | } | 404 | } |
| @@ -503,7 +503,7 @@ static int remove_promisc_qp(struct mlx4_dev *dev, u8 port, | |||
| 503 | s_steer = &mlx4_priv(dev)->steer[port - 1]; | 503 | s_steer = &mlx4_priv(dev)->steer[port - 1]; |
| 504 | mutex_lock(&priv->mcg_table.mutex); | 504 | mutex_lock(&priv->mcg_table.mutex); |
| 505 | 505 | ||
| 506 | pqp = get_promisc_qp(dev, 0, steer, qpn); | 506 | pqp = get_promisc_qp(dev, port, steer, qpn); |
| 507 | if (unlikely(!pqp)) { | 507 | if (unlikely(!pqp)) { |
| 508 | mlx4_warn(dev, "QP %x is not promiscuous QP\n", qpn); | 508 | mlx4_warn(dev, "QP %x is not promiscuous QP\n", qpn); |
| 509 | /* nothing to do */ | 509 | /* nothing to do */ |
| @@ -650,13 +650,6 @@ static int find_entry(struct mlx4_dev *dev, u8 port, | |||
| 650 | return err; | 650 | return err; |
| 651 | } | 651 | } |
| 652 | 652 | ||
| 653 | struct mlx4_net_trans_rule_hw_ctrl { | ||
| 654 | __be32 ctrl; | ||
| 655 | __be32 vf_vep_port; | ||
| 656 | __be32 qpn; | ||
| 657 | __be32 reserved; | ||
| 658 | }; | ||
| 659 | |||
| 660 | static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl, | 653 | static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl, |
| 661 | struct mlx4_net_trans_rule_hw_ctrl *hw) | 654 | struct mlx4_net_trans_rule_hw_ctrl *hw) |
| 662 | { | 655 | { |
| @@ -680,87 +673,18 @@ static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl, | |||
| 680 | hw->qpn = cpu_to_be32(ctrl->qpn); | 673 | hw->qpn = cpu_to_be32(ctrl->qpn); |
| 681 | } | 674 | } |
| 682 | 675 | ||
| 683 | struct mlx4_net_trans_rule_hw_ib { | 676 | const u16 __sw_id_hw[] = { |
| 684 | u8 size; | 677 | [MLX4_NET_TRANS_RULE_ID_ETH] = 0xE001, |
| 685 | u8 rsvd1; | 678 | [MLX4_NET_TRANS_RULE_ID_IB] = 0xE005, |
| 686 | __be16 id; | 679 | [MLX4_NET_TRANS_RULE_ID_IPV6] = 0xE003, |
| 687 | u32 rsvd2; | 680 | [MLX4_NET_TRANS_RULE_ID_IPV4] = 0xE002, |
| 688 | __be32 qpn; | 681 | [MLX4_NET_TRANS_RULE_ID_TCP] = 0xE004, |
| 689 | __be32 qpn_mask; | 682 | [MLX4_NET_TRANS_RULE_ID_UDP] = 0xE006 |
| 690 | u8 dst_gid[16]; | ||
| 691 | u8 dst_gid_msk[16]; | ||
| 692 | } __packed; | ||
| 693 | |||
| 694 | struct mlx4_net_trans_rule_hw_eth { | ||
| 695 | u8 size; | ||
| 696 | u8 rsvd; | ||
| 697 | __be16 id; | ||
| 698 | u8 rsvd1[6]; | ||
| 699 | u8 dst_mac[6]; | ||
| 700 | u16 rsvd2; | ||
| 701 | u8 dst_mac_msk[6]; | ||
| 702 | u16 rsvd3; | ||
| 703 | u8 src_mac[6]; | ||
| 704 | u16 rsvd4; | ||
| 705 | u8 src_mac_msk[6]; | ||
| 706 | u8 rsvd5; | ||
| 707 | u8 ether_type_enable; | ||
| 708 | __be16 ether_type; | ||
| 709 | __be16 vlan_id_msk; | ||
| 710 | __be16 vlan_id; | ||
| 711 | } __packed; | ||
| 712 | |||
| 713 | struct mlx4_net_trans_rule_hw_tcp_udp { | ||
| 714 | u8 size; | ||
| 715 | u8 rsvd; | ||
| 716 | __be16 id; | ||
| 717 | __be16 rsvd1[3]; | ||
| 718 | __be16 dst_port; | ||
| 719 | __be16 rsvd2; | ||
| 720 | __be16 dst_port_msk; | ||
| 721 | __be16 rsvd3; | ||
| 722 | __be16 src_port; | ||
| 723 | __be16 rsvd4; | ||
| 724 | __be16 src_port_msk; | ||
| 725 | } __packed; | ||
| 726 | |||
| 727 | struct mlx4_net_trans_rule_hw_ipv4 { | ||
| 728 | u8 size; | ||
| 729 | u8 rsvd; | ||
| 730 | __be16 id; | ||
| 731 | __be32 rsvd1; | ||
| 732 | __be32 dst_ip; | ||
| 733 | __be32 dst_ip_msk; | ||
| 734 | __be32 src_ip; | ||
| 735 | __be32 src_ip_msk; | ||
| 736 | } __packed; | ||
| 737 | |||
| 738 | struct _rule_hw { | ||
| 739 | union { | ||
| 740 | struct { | ||
| 741 | u8 size; | ||
| 742 | u8 rsvd; | ||
| 743 | __be16 id; | ||
| 744 | }; | ||
| 745 | struct mlx4_net_trans_rule_hw_eth eth; | ||
| 746 | struct mlx4_net_trans_rule_hw_ib ib; | ||
| 747 | struct mlx4_net_trans_rule_hw_ipv4 ipv4; | ||
| 748 | struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp; | ||
| 749 | }; | ||
| 750 | }; | 683 | }; |
| 751 | 684 | ||
| 752 | static int parse_trans_rule(struct mlx4_dev *dev, struct mlx4_spec_list *spec, | 685 | static int parse_trans_rule(struct mlx4_dev *dev, struct mlx4_spec_list *spec, |
| 753 | struct _rule_hw *rule_hw) | 686 | struct _rule_hw *rule_hw) |
| 754 | { | 687 | { |
| 755 | static const u16 __sw_id_hw[] = { | ||
| 756 | [MLX4_NET_TRANS_RULE_ID_ETH] = 0xE001, | ||
| 757 | [MLX4_NET_TRANS_RULE_ID_IB] = 0xE005, | ||
| 758 | [MLX4_NET_TRANS_RULE_ID_IPV6] = 0xE003, | ||
| 759 | [MLX4_NET_TRANS_RULE_ID_IPV4] = 0xE002, | ||
| 760 | [MLX4_NET_TRANS_RULE_ID_TCP] = 0xE004, | ||
| 761 | [MLX4_NET_TRANS_RULE_ID_UDP] = 0xE006 | ||
| 762 | }; | ||
| 763 | |||
| 764 | static const size_t __rule_hw_sz[] = { | 688 | static const size_t __rule_hw_sz[] = { |
| 765 | [MLX4_NET_TRANS_RULE_ID_ETH] = | 689 | [MLX4_NET_TRANS_RULE_ID_ETH] = |
| 766 | sizeof(struct mlx4_net_trans_rule_hw_eth), | 690 | sizeof(struct mlx4_net_trans_rule_hw_eth), |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h index 4d9df8f2a126..dba69d98734a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h | |||
| @@ -690,6 +690,82 @@ struct mlx4_steer { | |||
| 690 | struct list_head steer_entries[MLX4_NUM_STEERS]; | 690 | struct list_head steer_entries[MLX4_NUM_STEERS]; |
| 691 | }; | 691 | }; |
| 692 | 692 | ||
| 693 | struct mlx4_net_trans_rule_hw_ctrl { | ||
| 694 | __be32 ctrl; | ||
| 695 | __be32 vf_vep_port; | ||
| 696 | __be32 qpn; | ||
| 697 | __be32 reserved; | ||
| 698 | }; | ||
| 699 | |||
| 700 | struct mlx4_net_trans_rule_hw_ib { | ||
| 701 | u8 size; | ||
| 702 | u8 rsvd1; | ||
| 703 | __be16 id; | ||
| 704 | u32 rsvd2; | ||
| 705 | __be32 qpn; | ||
| 706 | __be32 qpn_mask; | ||
| 707 | u8 dst_gid[16]; | ||
| 708 | u8 dst_gid_msk[16]; | ||
| 709 | } __packed; | ||
| 710 | |||
| 711 | struct mlx4_net_trans_rule_hw_eth { | ||
| 712 | u8 size; | ||
| 713 | u8 rsvd; | ||
| 714 | __be16 id; | ||
| 715 | u8 rsvd1[6]; | ||
| 716 | u8 dst_mac[6]; | ||
| 717 | u16 rsvd2; | ||
| 718 | u8 dst_mac_msk[6]; | ||
| 719 | u16 rsvd3; | ||
| 720 | u8 src_mac[6]; | ||
| 721 | u16 rsvd4; | ||
| 722 | u8 src_mac_msk[6]; | ||
| 723 | u8 rsvd5; | ||
| 724 | u8 ether_type_enable; | ||
| 725 | __be16 ether_type; | ||
| 726 | __be16 vlan_id_msk; | ||
| 727 | __be16 vlan_id; | ||
| 728 | } __packed; | ||
| 729 | |||
| 730 | struct mlx4_net_trans_rule_hw_tcp_udp { | ||
| 731 | u8 size; | ||
| 732 | u8 rsvd; | ||
| 733 | __be16 id; | ||
| 734 | __be16 rsvd1[3]; | ||
| 735 | __be16 dst_port; | ||
| 736 | __be16 rsvd2; | ||
| 737 | __be16 dst_port_msk; | ||
| 738 | __be16 rsvd3; | ||
| 739 | __be16 src_port; | ||
| 740 | __be16 rsvd4; | ||
| 741 | __be16 src_port_msk; | ||
| 742 | } __packed; | ||
| 743 | |||
| 744 | struct mlx4_net_trans_rule_hw_ipv4 { | ||
| 745 | u8 size; | ||
| 746 | u8 rsvd; | ||
| 747 | __be16 id; | ||
| 748 | __be32 rsvd1; | ||
| 749 | __be32 dst_ip; | ||
| 750 | __be32 dst_ip_msk; | ||
| 751 | __be32 src_ip; | ||
| 752 | __be32 src_ip_msk; | ||
| 753 | } __packed; | ||
| 754 | |||
| 755 | struct _rule_hw { | ||
| 756 | union { | ||
| 757 | struct { | ||
| 758 | u8 size; | ||
| 759 | u8 rsvd; | ||
| 760 | __be16 id; | ||
| 761 | }; | ||
| 762 | struct mlx4_net_trans_rule_hw_eth eth; | ||
| 763 | struct mlx4_net_trans_rule_hw_ib ib; | ||
| 764 | struct mlx4_net_trans_rule_hw_ipv4 ipv4; | ||
| 765 | struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp; | ||
| 766 | }; | ||
| 767 | }; | ||
| 768 | |||
| 693 | struct mlx4_priv { | 769 | struct mlx4_priv { |
| 694 | struct mlx4_dev dev; | 770 | struct mlx4_dev dev; |
| 695 | 771 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index 94ceddd17ab2..293c9e820c49 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | #include <linux/mlx4/cmd.h> | 42 | #include <linux/mlx4/cmd.h> |
| 43 | #include <linux/mlx4/qp.h> | 43 | #include <linux/mlx4/qp.h> |
| 44 | #include <linux/if_ether.h> | 44 | #include <linux/if_ether.h> |
| 45 | #include <linux/etherdevice.h> | ||
| 45 | 46 | ||
| 46 | #include "mlx4.h" | 47 | #include "mlx4.h" |
| 47 | #include "fw.h" | 48 | #include "fw.h" |
| @@ -2776,18 +2777,133 @@ ex_put: | |||
| 2776 | return err; | 2777 | return err; |
| 2777 | } | 2778 | } |
| 2778 | 2779 | ||
| 2780 | /* | ||
| 2781 | * MAC validation for Flow Steering rules. | ||
| 2782 | * VF can attach rules only with a mac address which is assigned to it. | ||
| 2783 | */ | ||
| 2784 | static int validate_eth_header_mac(int slave, struct _rule_hw *eth_header, | ||
| 2785 | struct list_head *rlist) | ||
| 2786 | { | ||
| 2787 | struct mac_res *res, *tmp; | ||
| 2788 | __be64 be_mac; | ||
| 2789 | |||
| 2790 | /* make sure it isn't multicast or broadcast mac*/ | ||
| 2791 | if (!is_multicast_ether_addr(eth_header->eth.dst_mac) && | ||
| 2792 | !is_broadcast_ether_addr(eth_header->eth.dst_mac)) { | ||
| 2793 | list_for_each_entry_safe(res, tmp, rlist, list) { | ||
| 2794 | be_mac = cpu_to_be64(res->mac << 16); | ||
| 2795 | if (!memcmp(&be_mac, eth_header->eth.dst_mac, ETH_ALEN)) | ||
| 2796 | return 0; | ||
| 2797 | } | ||
| 2798 | pr_err("MAC %pM doesn't belong to VF %d, Steering rule rejected\n", | ||
| 2799 | eth_header->eth.dst_mac, slave); | ||
| 2800 | return -EINVAL; | ||
| 2801 | } | ||
| 2802 | return 0; | ||
| 2803 | } | ||
| 2804 | |||
| 2805 | /* | ||
| 2806 | * In case of missing eth header, append eth header with a MAC address | ||
| 2807 | * assigned to the VF. | ||
| 2808 | */ | ||
| 2809 | static int add_eth_header(struct mlx4_dev *dev, int slave, | ||
| 2810 | struct mlx4_cmd_mailbox *inbox, | ||
| 2811 | struct list_head *rlist, int header_id) | ||
| 2812 | { | ||
| 2813 | struct mac_res *res, *tmp; | ||
| 2814 | u8 port; | ||
| 2815 | struct mlx4_net_trans_rule_hw_ctrl *ctrl; | ||
| 2816 | struct mlx4_net_trans_rule_hw_eth *eth_header; | ||
| 2817 | struct mlx4_net_trans_rule_hw_ipv4 *ip_header; | ||
| 2818 | struct mlx4_net_trans_rule_hw_tcp_udp *l4_header; | ||
| 2819 | __be64 be_mac = 0; | ||
| 2820 | __be64 mac_msk = cpu_to_be64(MLX4_MAC_MASK << 16); | ||
| 2821 | |||
| 2822 | ctrl = (struct mlx4_net_trans_rule_hw_ctrl *)inbox->buf; | ||
| 2823 | port = be32_to_cpu(ctrl->vf_vep_port) & 0xff; | ||
| 2824 | eth_header = (struct mlx4_net_trans_rule_hw_eth *)(ctrl + 1); | ||
| 2825 | |||
| 2826 | /* Clear a space in the inbox for eth header */ | ||
| 2827 | switch (header_id) { | ||
| 2828 | case MLX4_NET_TRANS_RULE_ID_IPV4: | ||
| 2829 | ip_header = | ||
| 2830 | (struct mlx4_net_trans_rule_hw_ipv4 *)(eth_header + 1); | ||
| 2831 | memmove(ip_header, eth_header, | ||
| 2832 | sizeof(*ip_header) + sizeof(*l4_header)); | ||
| 2833 | break; | ||
| 2834 | case MLX4_NET_TRANS_RULE_ID_TCP: | ||
| 2835 | case MLX4_NET_TRANS_RULE_ID_UDP: | ||
| 2836 | l4_header = (struct mlx4_net_trans_rule_hw_tcp_udp *) | ||
| 2837 | (eth_header + 1); | ||
| 2838 | memmove(l4_header, eth_header, sizeof(*l4_header)); | ||
| 2839 | break; | ||
| 2840 | default: | ||
| 2841 | return -EINVAL; | ||
| 2842 | } | ||
| 2843 | list_for_each_entry_safe(res, tmp, rlist, list) { | ||
| 2844 | if (port == res->port) { | ||
| 2845 | be_mac = cpu_to_be64(res->mac << 16); | ||
| 2846 | break; | ||
| 2847 | } | ||
| 2848 | } | ||
| 2849 | if (!be_mac) { | ||
| 2850 | pr_err("Failed adding eth header to FS rule, Can't find matching MAC for port %d .\n", | ||
| 2851 | port); | ||
| 2852 | return -EINVAL; | ||
| 2853 | } | ||
| 2854 | |||
| 2855 | memset(eth_header, 0, sizeof(*eth_header)); | ||
| 2856 | eth_header->size = sizeof(*eth_header) >> 2; | ||
| 2857 | eth_header->id = cpu_to_be16(__sw_id_hw[MLX4_NET_TRANS_RULE_ID_ETH]); | ||
| 2858 | memcpy(eth_header->dst_mac, &be_mac, ETH_ALEN); | ||
| 2859 | memcpy(eth_header->dst_mac_msk, &mac_msk, ETH_ALEN); | ||
| 2860 | |||
| 2861 | return 0; | ||
| 2862 | |||
| 2863 | } | ||
| 2864 | |||
| 2779 | int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | 2865 | int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, |
| 2780 | struct mlx4_vhcr *vhcr, | 2866 | struct mlx4_vhcr *vhcr, |
| 2781 | struct mlx4_cmd_mailbox *inbox, | 2867 | struct mlx4_cmd_mailbox *inbox, |
| 2782 | struct mlx4_cmd_mailbox *outbox, | 2868 | struct mlx4_cmd_mailbox *outbox, |
| 2783 | struct mlx4_cmd_info *cmd) | 2869 | struct mlx4_cmd_info *cmd) |
| 2784 | { | 2870 | { |
| 2871 | |||
| 2872 | struct mlx4_priv *priv = mlx4_priv(dev); | ||
| 2873 | struct mlx4_resource_tracker *tracker = &priv->mfunc.master.res_tracker; | ||
| 2874 | struct list_head *rlist = &tracker->slave_list[slave].res_list[RES_MAC]; | ||
| 2785 | int err; | 2875 | int err; |
| 2876 | struct mlx4_net_trans_rule_hw_ctrl *ctrl; | ||
| 2877 | struct _rule_hw *rule_header; | ||
| 2878 | int header_id; | ||
| 2786 | 2879 | ||
| 2787 | if (dev->caps.steering_mode != | 2880 | if (dev->caps.steering_mode != |
| 2788 | MLX4_STEERING_MODE_DEVICE_MANAGED) | 2881 | MLX4_STEERING_MODE_DEVICE_MANAGED) |
| 2789 | return -EOPNOTSUPP; | 2882 | return -EOPNOTSUPP; |
| 2790 | 2883 | ||
| 2884 | ctrl = (struct mlx4_net_trans_rule_hw_ctrl *)inbox->buf; | ||
| 2885 | rule_header = (struct _rule_hw *)(ctrl + 1); | ||
| 2886 | header_id = map_hw_to_sw_id(be16_to_cpu(rule_header->id)); | ||
| 2887 | |||
| 2888 | switch (header_id) { | ||
| 2889 | case MLX4_NET_TRANS_RULE_ID_ETH: | ||
| 2890 | if (validate_eth_header_mac(slave, rule_header, rlist)) | ||
| 2891 | return -EINVAL; | ||
| 2892 | break; | ||
| 2893 | case MLX4_NET_TRANS_RULE_ID_IPV4: | ||
| 2894 | case MLX4_NET_TRANS_RULE_ID_TCP: | ||
| 2895 | case MLX4_NET_TRANS_RULE_ID_UDP: | ||
| 2896 | pr_warn("Can't attach FS rule without L2 headers, adding L2 header.\n"); | ||
| 2897 | if (add_eth_header(dev, slave, inbox, rlist, header_id)) | ||
| 2898 | return -EINVAL; | ||
| 2899 | vhcr->in_modifier += | ||
| 2900 | sizeof(struct mlx4_net_trans_rule_hw_eth) >> 2; | ||
| 2901 | break; | ||
| 2902 | default: | ||
| 2903 | pr_err("Corrupted mailbox.\n"); | ||
| 2904 | return -EINVAL; | ||
| 2905 | } | ||
| 2906 | |||
| 2791 | err = mlx4_cmd_imm(dev, inbox->dma, &vhcr->out_param, | 2907 | err = mlx4_cmd_imm(dev, inbox->dma, &vhcr->out_param, |
| 2792 | vhcr->in_modifier, 0, | 2908 | vhcr->in_modifier, 0, |
| 2793 | MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A, | 2909 | MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A, |
diff --git a/drivers/net/ethernet/seeq/sgiseeq.c b/drivers/net/ethernet/seeq/sgiseeq.c index bb8c8222122b..4d15bf413bdc 100644 --- a/drivers/net/ethernet/seeq/sgiseeq.c +++ b/drivers/net/ethernet/seeq/sgiseeq.c | |||
| @@ -751,6 +751,7 @@ static int __devinit sgiseeq_probe(struct platform_device *pdev) | |||
| 751 | sp->srings = sr; | 751 | sp->srings = sr; |
| 752 | sp->rx_desc = sp->srings->rxvector; | 752 | sp->rx_desc = sp->srings->rxvector; |
| 753 | sp->tx_desc = sp->srings->txvector; | 753 | sp->tx_desc = sp->srings->txvector; |
| 754 | spin_lock_init(&sp->tx_lock); | ||
| 754 | 755 | ||
| 755 | /* A couple calculations now, saves many cycles later. */ | 756 | /* A couple calculations now, saves many cycles later. */ |
| 756 | setup_rx_ring(dev, sp->rx_desc, SEEQ_RX_BUFFERS); | 757 | setup_rx_ring(dev, sp->rx_desc, SEEQ_RX_BUFFERS); |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index adfab3fc5478..b1ba68f1a049 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
| @@ -297,7 +297,7 @@ static int qmi_wwan_suspend(struct usb_interface *intf, pm_message_t message) | |||
| 297 | if (ret < 0) | 297 | if (ret < 0) |
| 298 | goto err; | 298 | goto err; |
| 299 | 299 | ||
| 300 | if (info->subdriver && info->subdriver->suspend) | 300 | if (intf == info->control && info->subdriver && info->subdriver->suspend) |
| 301 | ret = info->subdriver->suspend(intf, message); | 301 | ret = info->subdriver->suspend(intf, message); |
| 302 | if (ret < 0) | 302 | if (ret < 0) |
| 303 | usbnet_resume(intf); | 303 | usbnet_resume(intf); |
| @@ -310,13 +310,14 @@ static int qmi_wwan_resume(struct usb_interface *intf) | |||
| 310 | struct usbnet *dev = usb_get_intfdata(intf); | 310 | struct usbnet *dev = usb_get_intfdata(intf); |
| 311 | struct qmi_wwan_state *info = (void *)&dev->data; | 311 | struct qmi_wwan_state *info = (void *)&dev->data; |
| 312 | int ret = 0; | 312 | int ret = 0; |
| 313 | bool callsub = (intf == info->control && info->subdriver && info->subdriver->resume); | ||
| 313 | 314 | ||
| 314 | if (info->subdriver && info->subdriver->resume) | 315 | if (callsub) |
| 315 | ret = info->subdriver->resume(intf); | 316 | ret = info->subdriver->resume(intf); |
| 316 | if (ret < 0) | 317 | if (ret < 0) |
| 317 | goto err; | 318 | goto err; |
| 318 | ret = usbnet_resume(intf); | 319 | ret = usbnet_resume(intf); |
| 319 | if (ret < 0 && info->subdriver && info->subdriver->resume && info->subdriver->suspend) | 320 | if (ret < 0 && callsub && info->subdriver->suspend) |
| 320 | info->subdriver->suspend(intf, PMSG_SUSPEND); | 321 | info->subdriver->suspend(intf, PMSG_SUSPEND); |
| 321 | err: | 322 | err: |
| 322 | return ret; | 323 | return ret; |
| @@ -398,7 +399,6 @@ static const struct usb_device_id products[] = { | |||
| 398 | /* 4. Gobi 1000 devices */ | 399 | /* 4. Gobi 1000 devices */ |
| 399 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 400 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
| 400 | {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ | 401 | {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ |
| 401 | {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ | ||
| 402 | {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ | 402 | {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ |
| 403 | {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ | 403 | {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ |
| 404 | {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ | 404 | {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ |
| @@ -440,6 +440,7 @@ static const struct usb_device_id products[] = { | |||
| 440 | {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */ | 440 | {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */ |
| 441 | {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */ | 441 | {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */ |
| 442 | {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ | 442 | {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ |
| 443 | {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ | ||
| 443 | {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ | 444 | {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ |
| 444 | {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ | 445 | {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ |
| 445 | {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */ | 446 | {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */ |
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index 7be49ea60b6d..8e22417fa6c1 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c | |||
| @@ -656,7 +656,7 @@ static int sierra_net_get_fw_attr(struct usbnet *dev, u16 *datap) | |||
| 656 | return -EIO; | 656 | return -EIO; |
| 657 | } | 657 | } |
| 658 | 658 | ||
| 659 | *datap = *attrdata; | 659 | *datap = le16_to_cpu(*attrdata); |
| 660 | 660 | ||
| 661 | kfree(attrdata); | 661 | kfree(attrdata); |
| 662 | return result; | 662 | return result; |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index fd4b26d46fd5..fc9f578a1e25 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
| @@ -1201,19 +1201,26 @@ deferred: | |||
| 1201 | } | 1201 | } |
| 1202 | EXPORT_SYMBOL_GPL(usbnet_start_xmit); | 1202 | EXPORT_SYMBOL_GPL(usbnet_start_xmit); |
| 1203 | 1203 | ||
| 1204 | static void rx_alloc_submit(struct usbnet *dev, gfp_t flags) | 1204 | static int rx_alloc_submit(struct usbnet *dev, gfp_t flags) |
| 1205 | { | 1205 | { |
| 1206 | struct urb *urb; | 1206 | struct urb *urb; |
| 1207 | int i; | 1207 | int i; |
| 1208 | int ret = 0; | ||
| 1208 | 1209 | ||
| 1209 | /* don't refill the queue all at once */ | 1210 | /* don't refill the queue all at once */ |
| 1210 | for (i = 0; i < 10 && dev->rxq.qlen < RX_QLEN(dev); i++) { | 1211 | for (i = 0; i < 10 && dev->rxq.qlen < RX_QLEN(dev); i++) { |
| 1211 | urb = usb_alloc_urb(0, flags); | 1212 | urb = usb_alloc_urb(0, flags); |
| 1212 | if (urb != NULL) { | 1213 | if (urb != NULL) { |
| 1213 | if (rx_submit(dev, urb, flags) == -ENOLINK) | 1214 | ret = rx_submit(dev, urb, flags); |
| 1214 | return; | 1215 | if (ret) |
| 1216 | goto err; | ||
| 1217 | } else { | ||
| 1218 | ret = -ENOMEM; | ||
| 1219 | goto err; | ||
| 1215 | } | 1220 | } |
| 1216 | } | 1221 | } |
| 1222 | err: | ||
| 1223 | return ret; | ||
| 1217 | } | 1224 | } |
| 1218 | 1225 | ||
| 1219 | /*-------------------------------------------------------------------------*/ | 1226 | /*-------------------------------------------------------------------------*/ |
| @@ -1257,7 +1264,8 @@ static void usbnet_bh (unsigned long param) | |||
| 1257 | int temp = dev->rxq.qlen; | 1264 | int temp = dev->rxq.qlen; |
| 1258 | 1265 | ||
| 1259 | if (temp < RX_QLEN(dev)) { | 1266 | if (temp < RX_QLEN(dev)) { |
| 1260 | rx_alloc_submit(dev, GFP_ATOMIC); | 1267 | if (rx_alloc_submit(dev, GFP_ATOMIC) == -ENOLINK) |
| 1268 | return; | ||
| 1261 | if (temp != dev->rxq.qlen) | 1269 | if (temp != dev->rxq.qlen) |
| 1262 | netif_dbg(dev, link, dev->net, | 1270 | netif_dbg(dev, link, dev->net, |
| 1263 | "rxqlen %d --> %d\n", | 1271 | "rxqlen %d --> %d\n", |
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index aaaca9aa2293..3f575afd8cfc 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 12 | 12 | ||
| 13 | #include <linux/module.h> | ||
| 13 | #include <linux/bitops.h> | 14 | #include <linux/bitops.h> |
| 14 | #include <linux/cdev.h> | 15 | #include <linux/cdev.h> |
| 15 | #include <linux/dma-mapping.h> | 16 | #include <linux/dma-mapping.h> |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c index 2c9f7d7ed4cc..0ed3846f9cbb 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c | |||
| @@ -142,6 +142,7 @@ static int ar9003_paprd_setup_single_table(struct ath_hw *ah) | |||
| 142 | }; | 142 | }; |
| 143 | int training_power; | 143 | int training_power; |
| 144 | int i, val; | 144 | int i, val; |
| 145 | u32 am2pm_mask = ah->paprd_ratemask; | ||
| 145 | 146 | ||
| 146 | if (IS_CHAN_2GHZ(ah->curchan)) | 147 | if (IS_CHAN_2GHZ(ah->curchan)) |
| 147 | training_power = ar9003_get_training_power_2g(ah); | 148 | training_power = ar9003_get_training_power_2g(ah); |
| @@ -158,10 +159,13 @@ static int ar9003_paprd_setup_single_table(struct ath_hw *ah) | |||
| 158 | } | 159 | } |
| 159 | ah->paprd_training_power = training_power; | 160 | ah->paprd_training_power = training_power; |
| 160 | 161 | ||
| 162 | if (AR_SREV_9330(ah)) | ||
| 163 | am2pm_mask = 0; | ||
| 164 | |||
| 161 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK, | 165 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK, |
| 162 | ah->paprd_ratemask); | 166 | ah->paprd_ratemask); |
| 163 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK, | 167 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK, |
| 164 | ah->paprd_ratemask); | 168 | am2pm_mask); |
| 165 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK, | 169 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK, |
| 166 | ah->paprd_ratemask_ht40); | 170 | ah->paprd_ratemask_ht40); |
| 167 | 171 | ||
| @@ -782,6 +786,102 @@ int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain) | |||
| 782 | } | 786 | } |
| 783 | EXPORT_SYMBOL(ar9003_paprd_setup_gain_table); | 787 | EXPORT_SYMBOL(ar9003_paprd_setup_gain_table); |
| 784 | 788 | ||
| 789 | static bool ar9003_paprd_retrain_pa_in(struct ath_hw *ah, | ||
| 790 | struct ath9k_hw_cal_data *caldata, | ||
| 791 | int chain) | ||
| 792 | { | ||
| 793 | u32 *pa_in = caldata->pa_table[chain]; | ||
| 794 | int capdiv_offset, quick_drop_offset; | ||
| 795 | int capdiv2g, quick_drop; | ||
| 796 | int count = 0; | ||
| 797 | int i; | ||
| 798 | |||
| 799 | if (!AR_SREV_9485(ah) && !AR_SREV_9330(ah)) | ||
| 800 | return false; | ||
| 801 | |||
| 802 | capdiv2g = REG_READ_FIELD(ah, AR_PHY_65NM_CH0_TXRF3, | ||
| 803 | AR_PHY_65NM_CH0_TXRF3_CAPDIV2G); | ||
| 804 | |||
| 805 | quick_drop = REG_READ_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3, | ||
| 806 | AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP); | ||
| 807 | |||
| 808 | if (quick_drop) | ||
| 809 | quick_drop -= 0x40; | ||
| 810 | |||
| 811 | for (i = 0; i < NUM_BIN + 1; i++) { | ||
| 812 | if (pa_in[i] == 1400) | ||
| 813 | count++; | ||
| 814 | } | ||
| 815 | |||
| 816 | if (AR_SREV_9485(ah)) { | ||
| 817 | if (pa_in[23] < 800) { | ||
| 818 | capdiv_offset = (int)((1000 - pa_in[23] + 75) / 150); | ||
| 819 | capdiv2g += capdiv_offset; | ||
| 820 | if (capdiv2g > 7) { | ||
| 821 | capdiv2g = 7; | ||
| 822 | if (pa_in[23] < 600) { | ||
| 823 | quick_drop++; | ||
| 824 | if (quick_drop > 0) | ||
| 825 | quick_drop = 0; | ||
| 826 | } | ||
| 827 | } | ||
| 828 | } else if (pa_in[23] == 1400) { | ||
| 829 | quick_drop_offset = min_t(int, count / 3, 2); | ||
| 830 | quick_drop += quick_drop_offset; | ||
| 831 | capdiv2g += quick_drop_offset / 2; | ||
| 832 | |||
| 833 | if (capdiv2g > 7) | ||
| 834 | capdiv2g = 7; | ||
| 835 | |||
| 836 | if (quick_drop > 0) { | ||
| 837 | quick_drop = 0; | ||
| 838 | capdiv2g -= quick_drop_offset; | ||
| 839 | if (capdiv2g < 0) | ||
| 840 | capdiv2g = 0; | ||
| 841 | } | ||
| 842 | } else { | ||
| 843 | return false; | ||
| 844 | } | ||
| 845 | } else if (AR_SREV_9330(ah)) { | ||
| 846 | if (pa_in[23] < 1000) { | ||
| 847 | capdiv_offset = (1000 - pa_in[23]) / 100; | ||
| 848 | capdiv2g += capdiv_offset; | ||
| 849 | if (capdiv_offset > 3) { | ||
| 850 | capdiv_offset = 1; | ||
| 851 | quick_drop--; | ||
| 852 | } | ||
| 853 | |||
| 854 | capdiv2g += capdiv_offset; | ||
| 855 | if (capdiv2g > 6) | ||
| 856 | capdiv2g = 6; | ||
| 857 | if (quick_drop < -4) | ||
| 858 | quick_drop = -4; | ||
| 859 | } else if (pa_in[23] == 1400) { | ||
| 860 | if (count > 3) { | ||
| 861 | quick_drop++; | ||
| 862 | capdiv2g -= count / 4; | ||
| 863 | if (quick_drop > -2) | ||
| 864 | quick_drop = -2; | ||
| 865 | } else { | ||
| 866 | capdiv2g--; | ||
| 867 | } | ||
| 868 | |||
| 869 | if (capdiv2g < 0) | ||
| 870 | capdiv2g = 0; | ||
| 871 | } else { | ||
| 872 | return false; | ||
| 873 | } | ||
| 874 | } | ||
| 875 | |||
| 876 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_TXRF3, | ||
| 877 | AR_PHY_65NM_CH0_TXRF3_CAPDIV2G, capdiv2g); | ||
| 878 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3, | ||
| 879 | AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP, | ||
| 880 | quick_drop); | ||
| 881 | |||
| 882 | return true; | ||
| 883 | } | ||
| 884 | |||
| 785 | int ar9003_paprd_create_curve(struct ath_hw *ah, | 885 | int ar9003_paprd_create_curve(struct ath_hw *ah, |
| 786 | struct ath9k_hw_cal_data *caldata, int chain) | 886 | struct ath9k_hw_cal_data *caldata, int chain) |
| 787 | { | 887 | { |
| @@ -817,6 +917,9 @@ int ar9003_paprd_create_curve(struct ath_hw *ah, | |||
| 817 | if (!create_pa_curve(data_L, data_U, pa_table, small_signal_gain)) | 917 | if (!create_pa_curve(data_L, data_U, pa_table, small_signal_gain)) |
| 818 | status = -2; | 918 | status = -2; |
| 819 | 919 | ||
| 920 | if (ar9003_paprd_retrain_pa_in(ah, caldata, chain)) | ||
| 921 | status = -EINPROGRESS; | ||
| 922 | |||
| 820 | REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, | 923 | REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, |
| 821 | AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); | 924 | AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); |
| 822 | 925 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h index 7bfbaf065a43..84d3d4956861 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h | |||
| @@ -625,6 +625,10 @@ | |||
| 625 | #define AR_PHY_AIC_CTRL_4_B0 (AR_SM_BASE + 0x4c0) | 625 | #define AR_PHY_AIC_CTRL_4_B0 (AR_SM_BASE + 0x4c0) |
| 626 | #define AR_PHY_AIC_STAT_2_B0 (AR_SM_BASE + 0x4cc) | 626 | #define AR_PHY_AIC_STAT_2_B0 (AR_SM_BASE + 0x4cc) |
| 627 | 627 | ||
| 628 | #define AR_PHY_65NM_CH0_TXRF3 0x16048 | ||
| 629 | #define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G 0x0000001e | ||
| 630 | #define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G_S 1 | ||
| 631 | |||
| 628 | #define AR_PHY_65NM_CH0_SYNTH4 0x1608c | 632 | #define AR_PHY_65NM_CH0_SYNTH4 0x1608c |
| 629 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT (AR_SREV_9462(ah) ? 0x00000001 : 0x00000002) | 633 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT (AR_SREV_9462(ah) ? 0x00000001 : 0x00000002) |
| 630 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S (AR_SREV_9462(ah) ? 0 : 1) | 634 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S (AR_SREV_9462(ah) ? 0 : 1) |
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c index bacdb8fb4ef4..9f83f71742a5 100644 --- a/drivers/net/wireless/ath/ath9k/gpio.c +++ b/drivers/net/wireless/ath/ath9k/gpio.c | |||
| @@ -341,7 +341,8 @@ void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc) | |||
| 341 | { | 341 | { |
| 342 | struct ath_btcoex *btcoex = &sc->btcoex; | 342 | struct ath_btcoex *btcoex = &sc->btcoex; |
| 343 | 343 | ||
| 344 | ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer); | 344 | if (btcoex->hw_timer_enabled) |
| 345 | ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer); | ||
| 345 | } | 346 | } |
| 346 | 347 | ||
| 347 | u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen) | 348 | u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen) |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 60b6a9daff7e..48af40151d23 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
| @@ -463,9 +463,6 @@ static void ath9k_hw_init_config(struct ath_hw *ah) | |||
| 463 | ah->config.spurchans[i][1] = AR_NO_SPUR; | 463 | ah->config.spurchans[i][1] = AR_NO_SPUR; |
| 464 | } | 464 | } |
| 465 | 465 | ||
| 466 | /* PAPRD needs some more work to be enabled */ | ||
| 467 | ah->config.paprd_disable = 1; | ||
| 468 | |||
| 469 | ah->config.rx_intr_mitigation = true; | 466 | ah->config.rx_intr_mitigation = true; |
| 470 | ah->config.pcieSerDesWrite = true; | 467 | ah->config.pcieSerDesWrite = true; |
| 471 | 468 | ||
| @@ -978,9 +975,6 @@ static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah, | |||
| 978 | else | 975 | else |
| 979 | imr_reg |= AR_IMR_TXOK; | 976 | imr_reg |= AR_IMR_TXOK; |
| 980 | 977 | ||
| 981 | if (opmode == NL80211_IFTYPE_AP) | ||
| 982 | imr_reg |= AR_IMR_MIB; | ||
| 983 | |||
| 984 | ENABLE_REGWRITE_BUFFER(ah); | 978 | ENABLE_REGWRITE_BUFFER(ah); |
| 985 | 979 | ||
| 986 | REG_WRITE(ah, AR_IMR, imr_reg); | 980 | REG_WRITE(ah, AR_IMR, imr_reg); |
| @@ -1778,6 +1772,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
| 1778 | /* Operating channel changed, reset channel calibration data */ | 1772 | /* Operating channel changed, reset channel calibration data */ |
| 1779 | memset(caldata, 0, sizeof(*caldata)); | 1773 | memset(caldata, 0, sizeof(*caldata)); |
| 1780 | ath9k_init_nfcal_hist_buffer(ah, chan); | 1774 | ath9k_init_nfcal_hist_buffer(ah, chan); |
| 1775 | } else if (caldata) { | ||
| 1776 | caldata->paprd_packet_sent = false; | ||
| 1781 | } | 1777 | } |
| 1782 | ah->noise = ath9k_hw_getchan_noise(ah, chan); | 1778 | ah->noise = ath9k_hw_getchan_noise(ah, chan); |
| 1783 | 1779 | ||
| @@ -2502,7 +2498,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
| 2502 | pCap->tx_desc_len = sizeof(struct ar9003_txc); | 2498 | pCap->tx_desc_len = sizeof(struct ar9003_txc); |
| 2503 | pCap->txs_len = sizeof(struct ar9003_txs); | 2499 | pCap->txs_len = sizeof(struct ar9003_txs); |
| 2504 | if (!ah->config.paprd_disable && | 2500 | if (!ah->config.paprd_disable && |
| 2505 | ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) | 2501 | ah->eep_ops->get_eeprom(ah, EEP_PAPRD) && |
| 2502 | !AR_SREV_9462(ah)) | ||
| 2506 | pCap->hw_caps |= ATH9K_HW_CAP_PAPRD; | 2503 | pCap->hw_caps |= ATH9K_HW_CAP_PAPRD; |
| 2507 | } else { | 2504 | } else { |
| 2508 | pCap->tx_desc_len = sizeof(struct ath_desc); | 2505 | pCap->tx_desc_len = sizeof(struct ath_desc); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index ce7332c64efb..6599a75f01fe 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
| @@ -405,6 +405,7 @@ struct ath9k_hw_cal_data { | |||
| 405 | int8_t iCoff; | 405 | int8_t iCoff; |
| 406 | int8_t qCoff; | 406 | int8_t qCoff; |
| 407 | bool rtt_done; | 407 | bool rtt_done; |
| 408 | bool paprd_packet_sent; | ||
| 408 | bool paprd_done; | 409 | bool paprd_done; |
| 409 | bool nfcal_pending; | 410 | bool nfcal_pending; |
| 410 | bool nfcal_interference; | 411 | bool nfcal_interference; |
diff --git a/drivers/net/wireless/ath/ath9k/link.c b/drivers/net/wireless/ath/ath9k/link.c index d4549e9aac5c..825a29cc9313 100644 --- a/drivers/net/wireless/ath/ath9k/link.c +++ b/drivers/net/wireless/ath/ath9k/link.c | |||
| @@ -254,8 +254,9 @@ void ath_paprd_calibrate(struct work_struct *work) | |||
| 254 | int chain_ok = 0; | 254 | int chain_ok = 0; |
| 255 | int chain; | 255 | int chain; |
| 256 | int len = 1800; | 256 | int len = 1800; |
| 257 | int ret; | ||
| 257 | 258 | ||
| 258 | if (!caldata) | 259 | if (!caldata || !caldata->paprd_packet_sent || caldata->paprd_done) |
| 259 | return; | 260 | return; |
| 260 | 261 | ||
| 261 | ath9k_ps_wakeup(sc); | 262 | ath9k_ps_wakeup(sc); |
| @@ -282,13 +283,6 @@ void ath_paprd_calibrate(struct work_struct *work) | |||
| 282 | continue; | 283 | continue; |
| 283 | 284 | ||
| 284 | chain_ok = 0; | 285 | chain_ok = 0; |
| 285 | |||
| 286 | ath_dbg(common, CALIBRATE, | ||
| 287 | "Sending PAPRD frame for thermal measurement on chain %d\n", | ||
| 288 | chain); | ||
| 289 | if (!ath_paprd_send_frame(sc, skb, chain)) | ||
| 290 | goto fail_paprd; | ||
| 291 | |||
| 292 | ar9003_paprd_setup_gain_table(ah, chain); | 286 | ar9003_paprd_setup_gain_table(ah, chain); |
| 293 | 287 | ||
| 294 | ath_dbg(common, CALIBRATE, | 288 | ath_dbg(common, CALIBRATE, |
| @@ -302,7 +296,13 @@ void ath_paprd_calibrate(struct work_struct *work) | |||
| 302 | break; | 296 | break; |
| 303 | } | 297 | } |
| 304 | 298 | ||
| 305 | if (ar9003_paprd_create_curve(ah, caldata, chain)) { | 299 | ret = ar9003_paprd_create_curve(ah, caldata, chain); |
| 300 | if (ret == -EINPROGRESS) { | ||
| 301 | ath_dbg(common, CALIBRATE, | ||
| 302 | "PAPRD curve on chain %d needs to be re-trained\n", | ||
| 303 | chain); | ||
| 304 | break; | ||
| 305 | } else if (ret) { | ||
| 306 | ath_dbg(common, CALIBRATE, | 306 | ath_dbg(common, CALIBRATE, |
| 307 | "PAPRD create curve failed on chain %d\n", | 307 | "PAPRD create curve failed on chain %d\n", |
| 308 | chain); | 308 | chain); |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 2c9da6b2ecb1..0d4155aec48d 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
| @@ -2018,6 +2018,9 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
| 2018 | 2018 | ||
| 2019 | ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb); | 2019 | ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb); |
| 2020 | 2020 | ||
| 2021 | if (sc->sc_ah->caldata) | ||
| 2022 | sc->sc_ah->caldata->paprd_packet_sent = true; | ||
| 2023 | |||
| 2021 | if (!(tx_flags & ATH_TX_ERROR)) | 2024 | if (!(tx_flags & ATH_TX_ERROR)) |
| 2022 | /* Frame was ACKed */ | 2025 | /* Frame was ACKed */ |
| 2023 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | 2026 | tx_info->flags |= IEEE80211_TX_STAT_ACK; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c index a299d42da8e7..58f89fa9c9f8 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c | |||
| @@ -519,7 +519,7 @@ static void brcmf_usb_tx_complete(struct urb *urb) | |||
| 519 | else | 519 | else |
| 520 | devinfo->bus_pub.bus->dstats.tx_errors++; | 520 | devinfo->bus_pub.bus->dstats.tx_errors++; |
| 521 | 521 | ||
| 522 | dev_kfree_skb(req->skb); | 522 | brcmu_pkt_buf_free_skb(req->skb); |
| 523 | req->skb = NULL; | 523 | req->skb = NULL; |
| 524 | brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req); | 524 | brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req); |
| 525 | 525 | ||
| @@ -540,7 +540,7 @@ static void brcmf_usb_rx_complete(struct urb *urb) | |||
| 540 | devinfo->bus_pub.bus->dstats.rx_packets++; | 540 | devinfo->bus_pub.bus->dstats.rx_packets++; |
| 541 | } else { | 541 | } else { |
| 542 | devinfo->bus_pub.bus->dstats.rx_errors++; | 542 | devinfo->bus_pub.bus->dstats.rx_errors++; |
| 543 | dev_kfree_skb(skb); | 543 | brcmu_pkt_buf_free_skb(skb); |
| 544 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); | 544 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); |
| 545 | return; | 545 | return; |
| 546 | } | 546 | } |
| @@ -550,13 +550,15 @@ static void brcmf_usb_rx_complete(struct urb *urb) | |||
| 550 | if (brcmf_proto_hdrpull(devinfo->dev, &ifidx, skb) != 0) { | 550 | if (brcmf_proto_hdrpull(devinfo->dev, &ifidx, skb) != 0) { |
| 551 | brcmf_dbg(ERROR, "rx protocol error\n"); | 551 | brcmf_dbg(ERROR, "rx protocol error\n"); |
| 552 | brcmu_pkt_buf_free_skb(skb); | 552 | brcmu_pkt_buf_free_skb(skb); |
| 553 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); | ||
| 553 | devinfo->bus_pub.bus->dstats.rx_errors++; | 554 | devinfo->bus_pub.bus->dstats.rx_errors++; |
| 554 | } else { | 555 | } else { |
| 555 | brcmf_rx_packet(devinfo->dev, ifidx, skb); | 556 | brcmf_rx_packet(devinfo->dev, ifidx, skb); |
| 556 | brcmf_usb_rx_refill(devinfo, req); | 557 | brcmf_usb_rx_refill(devinfo, req); |
| 557 | } | 558 | } |
| 558 | } else { | 559 | } else { |
| 559 | dev_kfree_skb(skb); | 560 | brcmu_pkt_buf_free_skb(skb); |
| 561 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); | ||
| 560 | } | 562 | } |
| 561 | return; | 563 | return; |
| 562 | 564 | ||
| @@ -581,14 +583,13 @@ static void brcmf_usb_rx_refill(struct brcmf_usbdev_info *devinfo, | |||
| 581 | usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->rx_pipe, | 583 | usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->rx_pipe, |
| 582 | skb->data, skb_tailroom(skb), brcmf_usb_rx_complete, | 584 | skb->data, skb_tailroom(skb), brcmf_usb_rx_complete, |
| 583 | req); | 585 | req); |
| 584 | req->urb->transfer_flags |= URB_ZERO_PACKET; | ||
| 585 | req->devinfo = devinfo; | 586 | req->devinfo = devinfo; |
| 587 | brcmf_usb_enq(devinfo, &devinfo->rx_postq, req); | ||
| 586 | 588 | ||
| 587 | ret = usb_submit_urb(req->urb, GFP_ATOMIC); | 589 | ret = usb_submit_urb(req->urb, GFP_ATOMIC); |
| 588 | if (ret == 0) { | 590 | if (ret) { |
| 589 | brcmf_usb_enq(devinfo, &devinfo->rx_postq, req); | 591 | brcmf_usb_del_fromq(devinfo, req); |
| 590 | } else { | 592 | brcmu_pkt_buf_free_skb(req->skb); |
| 591 | dev_kfree_skb(req->skb); | ||
| 592 | req->skb = NULL; | 593 | req->skb = NULL; |
| 593 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); | 594 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); |
| 594 | } | 595 | } |
| @@ -683,23 +684,22 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb) | |||
| 683 | 684 | ||
| 684 | req = brcmf_usb_deq(devinfo, &devinfo->tx_freeq); | 685 | req = brcmf_usb_deq(devinfo, &devinfo->tx_freeq); |
| 685 | if (!req) { | 686 | if (!req) { |
| 687 | brcmu_pkt_buf_free_skb(skb); | ||
| 686 | brcmf_dbg(ERROR, "no req to send\n"); | 688 | brcmf_dbg(ERROR, "no req to send\n"); |
| 687 | return -ENOMEM; | 689 | return -ENOMEM; |
| 688 | } | 690 | } |
| 689 | if (!req->urb) { | ||
| 690 | brcmf_dbg(ERROR, "no urb for req %p\n", req); | ||
| 691 | return -ENOBUFS; | ||
| 692 | } | ||
| 693 | 691 | ||
| 694 | req->skb = skb; | 692 | req->skb = skb; |
| 695 | req->devinfo = devinfo; | 693 | req->devinfo = devinfo; |
| 696 | usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->tx_pipe, | 694 | usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->tx_pipe, |
| 697 | skb->data, skb->len, brcmf_usb_tx_complete, req); | 695 | skb->data, skb->len, brcmf_usb_tx_complete, req); |
| 698 | req->urb->transfer_flags |= URB_ZERO_PACKET; | 696 | req->urb->transfer_flags |= URB_ZERO_PACKET; |
| 697 | brcmf_usb_enq(devinfo, &devinfo->tx_postq, req); | ||
| 699 | ret = usb_submit_urb(req->urb, GFP_ATOMIC); | 698 | ret = usb_submit_urb(req->urb, GFP_ATOMIC); |
| 700 | if (!ret) { | 699 | if (ret) { |
| 701 | brcmf_usb_enq(devinfo, &devinfo->tx_postq, req); | 700 | brcmf_dbg(ERROR, "brcmf_usb_tx usb_submit_urb FAILED\n"); |
| 702 | } else { | 701 | brcmf_usb_del_fromq(devinfo, req); |
| 702 | brcmu_pkt_buf_free_skb(req->skb); | ||
| 703 | req->skb = NULL; | 703 | req->skb = NULL; |
| 704 | brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req); | 704 | brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req); |
| 705 | } | 705 | } |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 28c5fbb4af26..c36e92312443 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
| @@ -1876,16 +1876,17 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, | |||
| 1876 | } | 1876 | } |
| 1877 | 1877 | ||
| 1878 | if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) { | 1878 | if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) { |
| 1879 | scb_val.val = cpu_to_le32(0); | 1879 | memset(&scb_val, 0, sizeof(scb_val)); |
| 1880 | err = brcmf_exec_dcmd(ndev, BRCMF_C_GET_RSSI, &scb_val, | 1880 | err = brcmf_exec_dcmd(ndev, BRCMF_C_GET_RSSI, &scb_val, |
| 1881 | sizeof(struct brcmf_scb_val_le)); | 1881 | sizeof(struct brcmf_scb_val_le)); |
| 1882 | if (err) | 1882 | if (err) { |
| 1883 | WL_ERR("Could not get rssi (%d)\n", err); | 1883 | WL_ERR("Could not get rssi (%d)\n", err); |
| 1884 | 1884 | } else { | |
| 1885 | rssi = le32_to_cpu(scb_val.val); | 1885 | rssi = le32_to_cpu(scb_val.val); |
| 1886 | sinfo->filled |= STATION_INFO_SIGNAL; | 1886 | sinfo->filled |= STATION_INFO_SIGNAL; |
| 1887 | sinfo->signal = rssi; | 1887 | sinfo->signal = rssi; |
| 1888 | WL_CONN("RSSI %d dBm\n", rssi); | 1888 | WL_CONN("RSSI %d dBm\n", rssi); |
| 1889 | } | ||
| 1889 | } | 1890 | } |
| 1890 | 1891 | ||
| 1891 | done: | 1892 | done: |
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index e970897f6ab5..4cb234349fbf 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
| @@ -1326,6 +1326,11 @@ static int if_sdio_suspend(struct device *dev) | |||
| 1326 | 1326 | ||
| 1327 | mmc_pm_flag_t flags = sdio_get_host_pm_caps(func); | 1327 | mmc_pm_flag_t flags = sdio_get_host_pm_caps(func); |
| 1328 | 1328 | ||
| 1329 | /* If we're powered off anyway, just let the mmc layer remove the | ||
| 1330 | * card. */ | ||
| 1331 | if (!lbs_iface_active(card->priv)) | ||
| 1332 | return -ENOSYS; | ||
| 1333 | |||
| 1329 | dev_info(dev, "%s: suspend: PM flags = 0x%x\n", | 1334 | dev_info(dev, "%s: suspend: PM flags = 0x%x\n", |
| 1330 | sdio_func_id(func), flags); | 1335 | sdio_func_id(func), flags); |
| 1331 | 1336 | ||
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index c68adec3cc8b..565527aee0ea 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c | |||
| @@ -170,7 +170,20 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, | |||
| 170 | cmd_code = le16_to_cpu(host_cmd->command); | 170 | cmd_code = le16_to_cpu(host_cmd->command); |
| 171 | cmd_size = le16_to_cpu(host_cmd->size); | 171 | cmd_size = le16_to_cpu(host_cmd->size); |
| 172 | 172 | ||
| 173 | skb_trim(cmd_node->cmd_skb, cmd_size); | 173 | /* Adjust skb length */ |
| 174 | if (cmd_node->cmd_skb->len > cmd_size) | ||
| 175 | /* | ||
| 176 | * cmd_size is less than sizeof(struct host_cmd_ds_command). | ||
| 177 | * Trim off the unused portion. | ||
| 178 | */ | ||
| 179 | skb_trim(cmd_node->cmd_skb, cmd_size); | ||
| 180 | else if (cmd_node->cmd_skb->len < cmd_size) | ||
| 181 | /* | ||
| 182 | * cmd_size is larger than sizeof(struct host_cmd_ds_command) | ||
| 183 | * because we have appended custom IE TLV. Increase skb length | ||
| 184 | * accordingly. | ||
| 185 | */ | ||
| 186 | skb_put(cmd_node->cmd_skb, cmd_size - cmd_node->cmd_skb->len); | ||
| 174 | 187 | ||
| 175 | do_gettimeofday(&tstamp); | 188 | do_gettimeofday(&tstamp); |
| 176 | dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d," | 189 | dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d," |
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 8b9dbd76a252..64328af496f5 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
| @@ -1611,6 +1611,7 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
| 1611 | static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev) | 1611 | static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev) |
| 1612 | { | 1612 | { |
| 1613 | int retval; | 1613 | int retval; |
| 1614 | u32 reg; | ||
| 1614 | 1615 | ||
| 1615 | /* | 1616 | /* |
| 1616 | * Allocate eeprom data. | 1617 | * Allocate eeprom data. |
| @@ -1624,6 +1625,14 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
| 1624 | return retval; | 1625 | return retval; |
| 1625 | 1626 | ||
| 1626 | /* | 1627 | /* |
| 1628 | * Enable rfkill polling by setting GPIO direction of the | ||
| 1629 | * rfkill switch GPIO pin correctly. | ||
| 1630 | */ | ||
| 1631 | rt2x00pci_register_read(rt2x00dev, GPIOCSR, ®); | ||
| 1632 | rt2x00_set_field32(®, GPIOCSR_BIT8, 1); | ||
| 1633 | rt2x00pci_register_write(rt2x00dev, GPIOCSR, reg); | ||
| 1634 | |||
| 1635 | /* | ||
| 1627 | * Initialize hw specifications. | 1636 | * Initialize hw specifications. |
| 1628 | */ | 1637 | */ |
| 1629 | retval = rt2400pci_probe_hw_mode(rt2x00dev); | 1638 | retval = rt2400pci_probe_hw_mode(rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.h b/drivers/net/wireless/rt2x00/rt2400pci.h index d3a4a68cc439..7564ae992b73 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.h +++ b/drivers/net/wireless/rt2x00/rt2400pci.h | |||
| @@ -670,6 +670,7 @@ | |||
| 670 | #define GPIOCSR_BIT5 FIELD32(0x00000020) | 670 | #define GPIOCSR_BIT5 FIELD32(0x00000020) |
| 671 | #define GPIOCSR_BIT6 FIELD32(0x00000040) | 671 | #define GPIOCSR_BIT6 FIELD32(0x00000040) |
| 672 | #define GPIOCSR_BIT7 FIELD32(0x00000080) | 672 | #define GPIOCSR_BIT7 FIELD32(0x00000080) |
| 673 | #define GPIOCSR_BIT8 FIELD32(0x00000100) | ||
| 673 | 674 | ||
| 674 | /* | 675 | /* |
| 675 | * BBPPCSR: BBP Pin control register. | 676 | * BBPPCSR: BBP Pin control register. |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index d2cf8a4bc8b5..3de0406735f6 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
| @@ -1929,6 +1929,7 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
| 1929 | static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev) | 1929 | static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev) |
| 1930 | { | 1930 | { |
| 1931 | int retval; | 1931 | int retval; |
| 1932 | u32 reg; | ||
| 1932 | 1933 | ||
| 1933 | /* | 1934 | /* |
| 1934 | * Allocate eeprom data. | 1935 | * Allocate eeprom data. |
| @@ -1942,6 +1943,14 @@ static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
| 1942 | return retval; | 1943 | return retval; |
| 1943 | 1944 | ||
| 1944 | /* | 1945 | /* |
| 1946 | * Enable rfkill polling by setting GPIO direction of the | ||
| 1947 | * rfkill switch GPIO pin correctly. | ||
| 1948 | */ | ||
| 1949 | rt2x00pci_register_read(rt2x00dev, GPIOCSR, ®); | ||
| 1950 | rt2x00_set_field32(®, GPIOCSR_DIR0, 1); | ||
| 1951 | rt2x00pci_register_write(rt2x00dev, GPIOCSR, reg); | ||
| 1952 | |||
| 1953 | /* | ||
| 1945 | * Initialize hw specifications. | 1954 | * Initialize hw specifications. |
| 1946 | */ | 1955 | */ |
| 1947 | retval = rt2500pci_probe_hw_mode(rt2x00dev); | 1956 | retval = rt2500pci_probe_hw_mode(rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 3aae36bb0a9e..89fee311d8fd 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
| @@ -283,7 +283,7 @@ static int rt2500usb_rfkill_poll(struct rt2x00_dev *rt2x00dev) | |||
| 283 | u16 reg; | 283 | u16 reg; |
| 284 | 284 | ||
| 285 | rt2500usb_register_read(rt2x00dev, MAC_CSR19, ®); | 285 | rt2500usb_register_read(rt2x00dev, MAC_CSR19, ®); |
| 286 | return rt2x00_get_field32(reg, MAC_CSR19_BIT7); | 286 | return rt2x00_get_field16(reg, MAC_CSR19_BIT7); |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | #ifdef CONFIG_RT2X00_LIB_LEDS | 289 | #ifdef CONFIG_RT2X00_LIB_LEDS |
| @@ -1768,6 +1768,7 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
| 1768 | static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) | 1768 | static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) |
| 1769 | { | 1769 | { |
| 1770 | int retval; | 1770 | int retval; |
| 1771 | u16 reg; | ||
| 1771 | 1772 | ||
| 1772 | /* | 1773 | /* |
| 1773 | * Allocate eeprom data. | 1774 | * Allocate eeprom data. |
| @@ -1781,6 +1782,14 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
| 1781 | return retval; | 1782 | return retval; |
| 1782 | 1783 | ||
| 1783 | /* | 1784 | /* |
| 1785 | * Enable rfkill polling by setting GPIO direction of the | ||
| 1786 | * rfkill switch GPIO pin correctly. | ||
| 1787 | */ | ||
| 1788 | rt2500usb_register_read(rt2x00dev, MAC_CSR19, ®); | ||
| 1789 | rt2x00_set_field16(®, MAC_CSR19_BIT8, 0); | ||
| 1790 | rt2500usb_register_write(rt2x00dev, MAC_CSR19, reg); | ||
| 1791 | |||
| 1792 | /* | ||
| 1784 | * Initialize hw specifications. | 1793 | * Initialize hw specifications. |
| 1785 | */ | 1794 | */ |
| 1786 | retval = rt2500usb_probe_hw_mode(rt2x00dev); | 1795 | retval = rt2500usb_probe_hw_mode(rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.h b/drivers/net/wireless/rt2x00/rt2500usb.h index b493306a7eed..196bd5103e4f 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.h +++ b/drivers/net/wireless/rt2x00/rt2500usb.h | |||
| @@ -189,14 +189,15 @@ | |||
| 189 | * MAC_CSR19: GPIO control register. | 189 | * MAC_CSR19: GPIO control register. |
| 190 | */ | 190 | */ |
| 191 | #define MAC_CSR19 0x0426 | 191 | #define MAC_CSR19 0x0426 |
| 192 | #define MAC_CSR19_BIT0 FIELD32(0x0001) | 192 | #define MAC_CSR19_BIT0 FIELD16(0x0001) |
| 193 | #define MAC_CSR19_BIT1 FIELD32(0x0002) | 193 | #define MAC_CSR19_BIT1 FIELD16(0x0002) |
| 194 | #define MAC_CSR19_BIT2 FIELD32(0x0004) | 194 | #define MAC_CSR19_BIT2 FIELD16(0x0004) |
| 195 | #define MAC_CSR19_BIT3 FIELD32(0x0008) | 195 | #define MAC_CSR19_BIT3 FIELD16(0x0008) |
| 196 | #define MAC_CSR19_BIT4 FIELD32(0x0010) | 196 | #define MAC_CSR19_BIT4 FIELD16(0x0010) |
| 197 | #define MAC_CSR19_BIT5 FIELD32(0x0020) | 197 | #define MAC_CSR19_BIT5 FIELD16(0x0020) |
| 198 | #define MAC_CSR19_BIT6 FIELD32(0x0040) | 198 | #define MAC_CSR19_BIT6 FIELD16(0x0040) |
| 199 | #define MAC_CSR19_BIT7 FIELD32(0x0080) | 199 | #define MAC_CSR19_BIT7 FIELD16(0x0080) |
| 200 | #define MAC_CSR19_BIT8 FIELD16(0x0100) | ||
| 200 | 201 | ||
| 201 | /* | 202 | /* |
| 202 | * MAC_CSR20: LED control register. | 203 | * MAC_CSR20: LED control register. |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index cb8c2aca54e4..b93516d832fb 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
| @@ -4089,6 +4089,7 @@ static int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) | |||
| 4089 | rt2800_register_write(rt2x00dev, LDO_CFG0, reg); | 4089 | rt2800_register_write(rt2x00dev, LDO_CFG0, reg); |
| 4090 | msleep(1); | 4090 | msleep(1); |
| 4091 | rt2800_register_read(rt2x00dev, LDO_CFG0, ®); | 4091 | rt2800_register_read(rt2x00dev, LDO_CFG0, ®); |
| 4092 | rt2x00_set_field32(®, LDO_CFG0_LDO_CORE_VLEVEL, 0); | ||
| 4092 | rt2x00_set_field32(®, LDO_CFG0_BGSEL, 1); | 4093 | rt2x00_set_field32(®, LDO_CFG0_BGSEL, 1); |
| 4093 | rt2800_register_write(rt2x00dev, LDO_CFG0, reg); | 4094 | rt2800_register_write(rt2x00dev, LDO_CFG0, reg); |
| 4094 | } | 4095 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 98aa426a3564..4765bbd654cd 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
| @@ -983,6 +983,7 @@ static int rt2800pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) | |||
| 983 | static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev) | 983 | static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev) |
| 984 | { | 984 | { |
| 985 | int retval; | 985 | int retval; |
| 986 | u32 reg; | ||
| 986 | 987 | ||
| 987 | /* | 988 | /* |
| 988 | * Allocate eeprom data. | 989 | * Allocate eeprom data. |
| @@ -996,6 +997,14 @@ static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
| 996 | return retval; | 997 | return retval; |
| 997 | 998 | ||
| 998 | /* | 999 | /* |
| 1000 | * Enable rfkill polling by setting GPIO direction of the | ||
| 1001 | * rfkill switch GPIO pin correctly. | ||
| 1002 | */ | ||
| 1003 | rt2x00pci_register_read(rt2x00dev, GPIO_CTRL_CFG, ®); | ||
| 1004 | rt2x00_set_field32(®, GPIO_CTRL_CFG_GPIOD_BIT2, 1); | ||
| 1005 | rt2x00pci_register_write(rt2x00dev, GPIO_CTRL_CFG, reg); | ||
| 1006 | |||
| 1007 | /* | ||
| 999 | * Initialize hw specifications. | 1008 | * Initialize hw specifications. |
| 1000 | */ | 1009 | */ |
| 1001 | retval = rt2800_probe_hw_mode(rt2x00dev); | 1010 | retval = rt2800_probe_hw_mode(rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 6cf336595e25..6b4226b71618 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
| @@ -667,8 +667,16 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry, | |||
| 667 | skb_pull(entry->skb, RXINFO_DESC_SIZE); | 667 | skb_pull(entry->skb, RXINFO_DESC_SIZE); |
| 668 | 668 | ||
| 669 | /* | 669 | /* |
| 670 | * FIXME: we need to check for rx_pkt_len validity | 670 | * Check for rx_pkt_len validity. Return if invalid, leaving |
| 671 | * rxdesc->size zeroed out by the upper level. | ||
| 671 | */ | 672 | */ |
| 673 | if (unlikely(rx_pkt_len == 0 || | ||
| 674 | rx_pkt_len > entry->queue->data_size)) { | ||
| 675 | ERROR(entry->queue->rt2x00dev, | ||
| 676 | "Bad frame size %d, forcing to 0\n", rx_pkt_len); | ||
| 677 | return; | ||
| 678 | } | ||
| 679 | |||
| 672 | rxd = (__le32 *)(entry->skb->data + rx_pkt_len); | 680 | rxd = (__le32 *)(entry->skb->data + rx_pkt_len); |
| 673 | 681 | ||
| 674 | /* | 682 | /* |
| @@ -736,6 +744,7 @@ static int rt2800usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) | |||
| 736 | static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev) | 744 | static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev) |
| 737 | { | 745 | { |
| 738 | int retval; | 746 | int retval; |
| 747 | u32 reg; | ||
| 739 | 748 | ||
| 740 | /* | 749 | /* |
| 741 | * Allocate eeprom data. | 750 | * Allocate eeprom data. |
| @@ -749,6 +758,14 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
| 749 | return retval; | 758 | return retval; |
| 750 | 759 | ||
| 751 | /* | 760 | /* |
| 761 | * Enable rfkill polling by setting GPIO direction of the | ||
| 762 | * rfkill switch GPIO pin correctly. | ||
| 763 | */ | ||
| 764 | rt2x00usb_register_read(rt2x00dev, GPIO_CTRL_CFG, ®); | ||
| 765 | rt2x00_set_field32(®, GPIO_CTRL_CFG_GPIOD_BIT2, 1); | ||
| 766 | rt2x00usb_register_write(rt2x00dev, GPIO_CTRL_CFG, reg); | ||
| 767 | |||
| 768 | /* | ||
| 752 | * Initialize hw specifications. | 769 | * Initialize hw specifications. |
| 753 | */ | 770 | */ |
| 754 | retval = rt2800_probe_hw_mode(rt2x00dev); | 771 | retval = rt2800_probe_hw_mode(rt2x00dev); |
| @@ -1157,6 +1174,8 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
| 1157 | { USB_DEVICE(0x1690, 0x0744) }, | 1174 | { USB_DEVICE(0x1690, 0x0744) }, |
| 1158 | { USB_DEVICE(0x1690, 0x0761) }, | 1175 | { USB_DEVICE(0x1690, 0x0761) }, |
| 1159 | { USB_DEVICE(0x1690, 0x0764) }, | 1176 | { USB_DEVICE(0x1690, 0x0764) }, |
| 1177 | /* ASUS */ | ||
| 1178 | { USB_DEVICE(0x0b05, 0x179d) }, | ||
| 1160 | /* Cisco */ | 1179 | /* Cisco */ |
| 1161 | { USB_DEVICE(0x167b, 0x4001) }, | 1180 | { USB_DEVICE(0x167b, 0x4001) }, |
| 1162 | /* EnGenius */ | 1181 | /* EnGenius */ |
| @@ -1222,7 +1241,6 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
| 1222 | { USB_DEVICE(0x0b05, 0x1760) }, | 1241 | { USB_DEVICE(0x0b05, 0x1760) }, |
| 1223 | { USB_DEVICE(0x0b05, 0x1761) }, | 1242 | { USB_DEVICE(0x0b05, 0x1761) }, |
| 1224 | { USB_DEVICE(0x0b05, 0x1790) }, | 1243 | { USB_DEVICE(0x0b05, 0x1790) }, |
| 1225 | { USB_DEVICE(0x0b05, 0x179d) }, | ||
| 1226 | /* AzureWave */ | 1244 | /* AzureWave */ |
| 1227 | { USB_DEVICE(0x13d3, 0x3262) }, | 1245 | { USB_DEVICE(0x13d3, 0x3262) }, |
| 1228 | { USB_DEVICE(0x13d3, 0x3284) }, | 1246 | { USB_DEVICE(0x13d3, 0x3284) }, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index a6b88bd4a1a5..3f07e36f462b 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
| @@ -629,7 +629,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp) | |||
| 629 | */ | 629 | */ |
| 630 | if (unlikely(rxdesc.size == 0 || | 630 | if (unlikely(rxdesc.size == 0 || |
| 631 | rxdesc.size > entry->queue->data_size)) { | 631 | rxdesc.size > entry->queue->data_size)) { |
| 632 | WARNING(rt2x00dev, "Wrong frame size %d max %d.\n", | 632 | ERROR(rt2x00dev, "Wrong frame size %d max %d.\n", |
| 633 | rxdesc.size, entry->queue->data_size); | 633 | rxdesc.size, entry->queue->data_size); |
| 634 | dev_kfree_skb(entry->skb); | 634 | dev_kfree_skb(entry->skb); |
| 635 | goto renew_skb; | 635 | goto renew_skb; |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 3f7bc5cadf9a..b8ec96163922 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
| @@ -2832,6 +2832,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
| 2832 | static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev) | 2832 | static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev) |
| 2833 | { | 2833 | { |
| 2834 | int retval; | 2834 | int retval; |
| 2835 | u32 reg; | ||
| 2835 | 2836 | ||
| 2836 | /* | 2837 | /* |
| 2837 | * Disable power saving. | 2838 | * Disable power saving. |
| @@ -2850,6 +2851,14 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
| 2850 | return retval; | 2851 | return retval; |
| 2851 | 2852 | ||
| 2852 | /* | 2853 | /* |
| 2854 | * Enable rfkill polling by setting GPIO direction of the | ||
| 2855 | * rfkill switch GPIO pin correctly. | ||
| 2856 | */ | ||
| 2857 | rt2x00pci_register_read(rt2x00dev, MAC_CSR13, ®); | ||
| 2858 | rt2x00_set_field32(®, MAC_CSR13_BIT13, 1); | ||
| 2859 | rt2x00pci_register_write(rt2x00dev, MAC_CSR13, reg); | ||
| 2860 | |||
| 2861 | /* | ||
| 2853 | * Initialize hw specifications. | 2862 | * Initialize hw specifications. |
| 2854 | */ | 2863 | */ |
| 2855 | retval = rt61pci_probe_hw_mode(rt2x00dev); | 2864 | retval = rt61pci_probe_hw_mode(rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.h b/drivers/net/wireless/rt2x00/rt61pci.h index e3cd6db76b0e..8f3da5a56766 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.h +++ b/drivers/net/wireless/rt2x00/rt61pci.h | |||
| @@ -372,6 +372,7 @@ struct hw_pairwise_ta_entry { | |||
| 372 | #define MAC_CSR13_BIT10 FIELD32(0x00000400) | 372 | #define MAC_CSR13_BIT10 FIELD32(0x00000400) |
| 373 | #define MAC_CSR13_BIT11 FIELD32(0x00000800) | 373 | #define MAC_CSR13_BIT11 FIELD32(0x00000800) |
| 374 | #define MAC_CSR13_BIT12 FIELD32(0x00001000) | 374 | #define MAC_CSR13_BIT12 FIELD32(0x00001000) |
| 375 | #define MAC_CSR13_BIT13 FIELD32(0x00002000) | ||
| 375 | 376 | ||
| 376 | /* | 377 | /* |
| 377 | * MAC_CSR14: LED control register. | 378 | * MAC_CSR14: LED control register. |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index ba6e434b859d..248436c13ce0 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
| @@ -2177,6 +2177,7 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
| 2177 | static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) | 2177 | static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) |
| 2178 | { | 2178 | { |
| 2179 | int retval; | 2179 | int retval; |
| 2180 | u32 reg; | ||
| 2180 | 2181 | ||
| 2181 | /* | 2182 | /* |
| 2182 | * Allocate eeprom data. | 2183 | * Allocate eeprom data. |
| @@ -2190,6 +2191,14 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
| 2190 | return retval; | 2191 | return retval; |
| 2191 | 2192 | ||
| 2192 | /* | 2193 | /* |
| 2194 | * Enable rfkill polling by setting GPIO direction of the | ||
| 2195 | * rfkill switch GPIO pin correctly. | ||
| 2196 | */ | ||
| 2197 | rt2x00usb_register_read(rt2x00dev, MAC_CSR13, ®); | ||
| 2198 | rt2x00_set_field32(®, MAC_CSR13_BIT15, 0); | ||
| 2199 | rt2x00usb_register_write(rt2x00dev, MAC_CSR13, reg); | ||
| 2200 | |||
| 2201 | /* | ||
| 2193 | * Initialize hw specifications. | 2202 | * Initialize hw specifications. |
| 2194 | */ | 2203 | */ |
| 2195 | retval = rt73usb_probe_hw_mode(rt2x00dev); | 2204 | retval = rt73usb_probe_hw_mode(rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.h b/drivers/net/wireless/rt2x00/rt73usb.h index 9f6b470414d3..df1cc116b83b 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.h +++ b/drivers/net/wireless/rt2x00/rt73usb.h | |||
| @@ -282,6 +282,9 @@ struct hw_pairwise_ta_entry { | |||
| 282 | #define MAC_CSR13_BIT10 FIELD32(0x00000400) | 282 | #define MAC_CSR13_BIT10 FIELD32(0x00000400) |
| 283 | #define MAC_CSR13_BIT11 FIELD32(0x00000800) | 283 | #define MAC_CSR13_BIT11 FIELD32(0x00000800) |
| 284 | #define MAC_CSR13_BIT12 FIELD32(0x00001000) | 284 | #define MAC_CSR13_BIT12 FIELD32(0x00001000) |
| 285 | #define MAC_CSR13_BIT13 FIELD32(0x00002000) | ||
| 286 | #define MAC_CSR13_BIT14 FIELD32(0x00004000) | ||
| 287 | #define MAC_CSR13_BIT15 FIELD32(0x00008000) | ||
| 285 | 288 | ||
| 286 | /* | 289 | /* |
| 287 | * MAC_CSR14: LED control register. | 290 | * MAC_CSR14: LED control register. |
diff --git a/drivers/staging/android/android_alarm.h b/drivers/staging/android/android_alarm.h index d0cafd637199..f2ffd963f1c3 100644 --- a/drivers/staging/android/android_alarm.h +++ b/drivers/staging/android/android_alarm.h | |||
| @@ -51,10 +51,12 @@ enum android_alarm_return_flags { | |||
| 51 | #define ANDROID_ALARM_WAIT _IO('a', 1) | 51 | #define ANDROID_ALARM_WAIT _IO('a', 1) |
| 52 | 52 | ||
| 53 | #define ALARM_IOW(c, type, size) _IOW('a', (c) | ((type) << 4), size) | 53 | #define ALARM_IOW(c, type, size) _IOW('a', (c) | ((type) << 4), size) |
| 54 | #define ALARM_IOR(c, type, size) _IOR('a', (c) | ((type) << 4), size) | ||
| 55 | |||
| 54 | /* Set alarm */ | 56 | /* Set alarm */ |
| 55 | #define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec) | 57 | #define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec) |
| 56 | #define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec) | 58 | #define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec) |
| 57 | #define ANDROID_ALARM_GET_TIME(type) ALARM_IOW(4, type, struct timespec) | 59 | #define ANDROID_ALARM_GET_TIME(type) ALARM_IOR(4, type, struct timespec) |
| 58 | #define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) | 60 | #define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) |
| 59 | #define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0))) | 61 | #define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0))) |
| 60 | #define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4) | 62 | #define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4) |
diff --git a/drivers/staging/comedi/drivers/amplc_dio200.c b/drivers/staging/comedi/drivers/amplc_dio200.c index 6c81e377262c..cc8931fde839 100644 --- a/drivers/staging/comedi/drivers/amplc_dio200.c +++ b/drivers/staging/comedi/drivers/amplc_dio200.c | |||
| @@ -1412,6 +1412,13 @@ static int __devinit dio200_attach_pci(struct comedi_device *dev, | |||
| 1412 | dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); | 1412 | dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); |
| 1413 | return -EINVAL; | 1413 | return -EINVAL; |
| 1414 | } | 1414 | } |
| 1415 | /* | ||
| 1416 | * Need to 'get' the PCI device to match the 'put' in dio200_detach(). | ||
| 1417 | * TODO: Remove the pci_dev_get() and matching pci_dev_put() once | ||
| 1418 | * support for manual attachment of PCI devices via dio200_attach() | ||
| 1419 | * has been removed. | ||
| 1420 | */ | ||
| 1421 | pci_dev_get(pci_dev); | ||
| 1415 | return dio200_pci_common_attach(dev, pci_dev); | 1422 | return dio200_pci_common_attach(dev, pci_dev); |
| 1416 | } | 1423 | } |
| 1417 | 1424 | ||
diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c b/drivers/staging/comedi/drivers/amplc_pc236.c index aabba9886b7d..f50287903038 100644 --- a/drivers/staging/comedi/drivers/amplc_pc236.c +++ b/drivers/staging/comedi/drivers/amplc_pc236.c | |||
| @@ -565,6 +565,13 @@ static int __devinit pc236_attach_pci(struct comedi_device *dev, | |||
| 565 | dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); | 565 | dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); |
| 566 | return -EINVAL; | 566 | return -EINVAL; |
| 567 | } | 567 | } |
| 568 | /* | ||
| 569 | * Need to 'get' the PCI device to match the 'put' in pc236_detach(). | ||
| 570 | * TODO: Remove the pci_dev_get() and matching pci_dev_put() once | ||
| 571 | * support for manual attachment of PCI devices via pc236_attach() | ||
| 572 | * has been removed. | ||
| 573 | */ | ||
| 574 | pci_dev_get(pci_dev); | ||
| 568 | return pc236_pci_common_attach(dev, pci_dev); | 575 | return pc236_pci_common_attach(dev, pci_dev); |
| 569 | } | 576 | } |
| 570 | 577 | ||
diff --git a/drivers/staging/comedi/drivers/amplc_pc263.c b/drivers/staging/comedi/drivers/amplc_pc263.c index 40ec1ffebba6..8191c4e28e0a 100644 --- a/drivers/staging/comedi/drivers/amplc_pc263.c +++ b/drivers/staging/comedi/drivers/amplc_pc263.c | |||
| @@ -298,6 +298,13 @@ static int __devinit pc263_attach_pci(struct comedi_device *dev, | |||
| 298 | dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); | 298 | dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); |
| 299 | return -EINVAL; | 299 | return -EINVAL; |
| 300 | } | 300 | } |
| 301 | /* | ||
| 302 | * Need to 'get' the PCI device to match the 'put' in pc263_detach(). | ||
| 303 | * TODO: Remove the pci_dev_get() and matching pci_dev_put() once | ||
| 304 | * support for manual attachment of PCI devices via pc263_attach() | ||
| 305 | * has been removed. | ||
| 306 | */ | ||
| 307 | pci_dev_get(pci_dev); | ||
| 301 | return pc263_pci_common_attach(dev, pci_dev); | 308 | return pc263_pci_common_attach(dev, pci_dev); |
| 302 | } | 309 | } |
| 303 | 310 | ||
diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c b/drivers/staging/comedi/drivers/amplc_pci224.c index 4e17f13e57f6..8bf109e7bb05 100644 --- a/drivers/staging/comedi/drivers/amplc_pci224.c +++ b/drivers/staging/comedi/drivers/amplc_pci224.c | |||
| @@ -1503,6 +1503,13 @@ pci224_attach_pci(struct comedi_device *dev, struct pci_dev *pci_dev) | |||
| 1503 | DRIVER_NAME ": BUG! cannot determine board type!\n"); | 1503 | DRIVER_NAME ": BUG! cannot determine board type!\n"); |
| 1504 | return -EINVAL; | 1504 | return -EINVAL; |
| 1505 | } | 1505 | } |
| 1506 | /* | ||
| 1507 | * Need to 'get' the PCI device to match the 'put' in pci224_detach(). | ||
| 1508 | * TODO: Remove the pci_dev_get() and matching pci_dev_put() once | ||
| 1509 | * support for manual attachment of PCI devices via pci224_attach() | ||
| 1510 | * has been removed. | ||
| 1511 | */ | ||
| 1512 | pci_dev_get(pci_dev); | ||
| 1506 | return pci224_attach_common(dev, pci_dev, NULL); | 1513 | return pci224_attach_common(dev, pci_dev, NULL); |
| 1507 | } | 1514 | } |
| 1508 | 1515 | ||
diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c index 1b67d0c61fa7..66e74bd12267 100644 --- a/drivers/staging/comedi/drivers/amplc_pci230.c +++ b/drivers/staging/comedi/drivers/amplc_pci230.c | |||
| @@ -2925,6 +2925,13 @@ static int __devinit pci230_attach_pci(struct comedi_device *dev, | |||
| 2925 | "amplc_pci230: BUG! cannot determine board type!\n"); | 2925 | "amplc_pci230: BUG! cannot determine board type!\n"); |
| 2926 | return -EINVAL; | 2926 | return -EINVAL; |
| 2927 | } | 2927 | } |
| 2928 | /* | ||
| 2929 | * Need to 'get' the PCI device to match the 'put' in pci230_detach(). | ||
| 2930 | * TODO: Remove the pci_dev_get() and matching pci_dev_put() once | ||
| 2931 | * support for manual attachment of PCI devices via pci230_attach() | ||
| 2932 | * has been removed. | ||
| 2933 | */ | ||
| 2934 | pci_dev_get(pci_dev); | ||
| 2928 | return pci230_attach_common(dev, pci_dev); | 2935 | return pci230_attach_common(dev, pci_dev); |
| 2929 | } | 2936 | } |
| 2930 | 2937 | ||
diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c index 874e02e47668..67a914a10b55 100644 --- a/drivers/staging/comedi/drivers/das08.c +++ b/drivers/staging/comedi/drivers/das08.c | |||
| @@ -378,7 +378,7 @@ das08jr_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s, | |||
| 378 | int chan; | 378 | int chan; |
| 379 | 379 | ||
| 380 | lsb = data[0] & 0xff; | 380 | lsb = data[0] & 0xff; |
| 381 | msb = (data[0] >> 8) & 0xf; | 381 | msb = (data[0] >> 8) & 0xff; |
| 382 | 382 | ||
| 383 | chan = CR_CHAN(insn->chanspec); | 383 | chan = CR_CHAN(insn->chanspec); |
| 384 | 384 | ||
| @@ -623,7 +623,7 @@ static const struct das08_board_struct das08_boards[] = { | |||
| 623 | .ai = das08_ai_rinsn, | 623 | .ai = das08_ai_rinsn, |
| 624 | .ai_nbits = 16, | 624 | .ai_nbits = 16, |
| 625 | .ai_pg = das08_pg_none, | 625 | .ai_pg = das08_pg_none, |
| 626 | .ai_encoding = das08_encode12, | 626 | .ai_encoding = das08_encode16, |
| 627 | .ao = das08jr_ao_winsn, | 627 | .ao = das08jr_ao_winsn, |
| 628 | .ao_nbits = 16, | 628 | .ao_nbits = 16, |
| 629 | .di = das08jr_di_rbits, | 629 | .di = das08jr_di_rbits, |
| @@ -922,6 +922,13 @@ das08_attach_pci(struct comedi_device *dev, struct pci_dev *pdev) | |||
| 922 | dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); | 922 | dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); |
| 923 | return -EINVAL; | 923 | return -EINVAL; |
| 924 | } | 924 | } |
| 925 | /* | ||
| 926 | * Need to 'get' the PCI device to match the 'put' in das08_detach(). | ||
| 927 | * TODO: Remove the pci_dev_get() and matching pci_dev_put() once | ||
| 928 | * support for manual attachment of PCI devices via das08_attach() | ||
| 929 | * has been removed. | ||
| 930 | */ | ||
| 931 | pci_dev_get(pdev); | ||
| 925 | return das08_pci_attach_common(dev, pdev); | 932 | return das08_pci_attach_common(dev, pdev); |
| 926 | } | 933 | } |
| 927 | 934 | ||
diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c b/drivers/staging/iio/accel/lis3l02dq_ring.c index 18d108fd967a..f3da59063ed2 100644 --- a/drivers/staging/iio/accel/lis3l02dq_ring.c +++ b/drivers/staging/iio/accel/lis3l02dq_ring.c | |||
| @@ -121,8 +121,10 @@ static int lis3l02dq_get_buffer_element(struct iio_dev *indio_dev, | |||
| 121 | if (rx_array == NULL) | 121 | if (rx_array == NULL) |
| 122 | return -ENOMEM; | 122 | return -ENOMEM; |
| 123 | ret = lis3l02dq_read_all(indio_dev, rx_array); | 123 | ret = lis3l02dq_read_all(indio_dev, rx_array); |
| 124 | if (ret < 0) | 124 | if (ret < 0) { |
| 125 | kfree(rx_array); | ||
| 125 | return ret; | 126 | return ret; |
| 127 | } | ||
| 126 | for (i = 0; i < scan_count; i++) | 128 | for (i = 0; i < scan_count; i++) |
| 127 | data[i] = combine_8_to_16(rx_array[i*4+1], | 129 | data[i] = combine_8_to_16(rx_array[i*4+1], |
| 128 | rx_array[i*4+3]); | 130 | rx_array[i*4+3]); |
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index 095837285f4f..19a064d649e3 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c | |||
| @@ -647,6 +647,8 @@ static ssize_t ad7192_write_frequency(struct device *dev, | |||
| 647 | ret = strict_strtoul(buf, 10, &lval); | 647 | ret = strict_strtoul(buf, 10, &lval); |
| 648 | if (ret) | 648 | if (ret) |
| 649 | return ret; | 649 | return ret; |
| 650 | if (lval == 0) | ||
| 651 | return -EINVAL; | ||
| 650 | 652 | ||
| 651 | mutex_lock(&indio_dev->mlock); | 653 | mutex_lock(&indio_dev->mlock); |
| 652 | if (iio_buffer_enabled(indio_dev)) { | 654 | if (iio_buffer_enabled(indio_dev)) { |
diff --git a/drivers/staging/iio/gyro/adis16260_core.c b/drivers/staging/iio/gyro/adis16260_core.c index 93aa431287ac..eb8e9d69efd3 100644 --- a/drivers/staging/iio/gyro/adis16260_core.c +++ b/drivers/staging/iio/gyro/adis16260_core.c | |||
| @@ -195,6 +195,8 @@ static ssize_t adis16260_write_frequency(struct device *dev, | |||
| 195 | ret = strict_strtol(buf, 10, &val); | 195 | ret = strict_strtol(buf, 10, &val); |
| 196 | if (ret) | 196 | if (ret) |
| 197 | return ret; | 197 | return ret; |
| 198 | if (val == 0) | ||
| 199 | return -EINVAL; | ||
| 198 | 200 | ||
| 199 | mutex_lock(&indio_dev->mlock); | 201 | mutex_lock(&indio_dev->mlock); |
| 200 | if (spi_get_device_id(st->us)) { | 202 | if (spi_get_device_id(st->us)) { |
diff --git a/drivers/staging/iio/imu/adis16400_core.c b/drivers/staging/iio/imu/adis16400_core.c index 1f4c17779b5a..a618327e06ed 100644 --- a/drivers/staging/iio/imu/adis16400_core.c +++ b/drivers/staging/iio/imu/adis16400_core.c | |||
| @@ -234,6 +234,8 @@ static ssize_t adis16400_write_frequency(struct device *dev, | |||
| 234 | ret = strict_strtol(buf, 10, &val); | 234 | ret = strict_strtol(buf, 10, &val); |
| 235 | if (ret) | 235 | if (ret) |
| 236 | return ret; | 236 | return ret; |
| 237 | if (val == 0) | ||
| 238 | return -EINVAL; | ||
| 237 | 239 | ||
| 238 | mutex_lock(&indio_dev->mlock); | 240 | mutex_lock(&indio_dev->mlock); |
| 239 | 241 | ||
diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c index f04ece7fbc2f..3ccff189f258 100644 --- a/drivers/staging/iio/meter/ade7753.c +++ b/drivers/staging/iio/meter/ade7753.c | |||
| @@ -425,6 +425,8 @@ static ssize_t ade7753_write_frequency(struct device *dev, | |||
| 425 | ret = strict_strtol(buf, 10, &val); | 425 | ret = strict_strtol(buf, 10, &val); |
| 426 | if (ret) | 426 | if (ret) |
| 427 | return ret; | 427 | return ret; |
| 428 | if (val == 0) | ||
| 429 | return -EINVAL; | ||
| 428 | 430 | ||
| 429 | mutex_lock(&indio_dev->mlock); | 431 | mutex_lock(&indio_dev->mlock); |
| 430 | 432 | ||
diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c index 6cee28a5e877..abb1e9c8d094 100644 --- a/drivers/staging/iio/meter/ade7754.c +++ b/drivers/staging/iio/meter/ade7754.c | |||
| @@ -445,6 +445,8 @@ static ssize_t ade7754_write_frequency(struct device *dev, | |||
| 445 | ret = strict_strtol(buf, 10, &val); | 445 | ret = strict_strtol(buf, 10, &val); |
| 446 | if (ret) | 446 | if (ret) |
| 447 | return ret; | 447 | return ret; |
| 448 | if (val == 0) | ||
| 449 | return -EINVAL; | ||
| 448 | 450 | ||
| 449 | mutex_lock(&indio_dev->mlock); | 451 | mutex_lock(&indio_dev->mlock); |
| 450 | 452 | ||
diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c index b3f7e0fa9612..eb0a2a98f388 100644 --- a/drivers/staging/iio/meter/ade7759.c +++ b/drivers/staging/iio/meter/ade7759.c | |||
| @@ -385,6 +385,8 @@ static ssize_t ade7759_write_frequency(struct device *dev, | |||
| 385 | ret = strict_strtol(buf, 10, &val); | 385 | ret = strict_strtol(buf, 10, &val); |
| 386 | if (ret) | 386 | if (ret) |
| 387 | return ret; | 387 | return ret; |
| 388 | if (val == 0) | ||
| 389 | return -EINVAL; | ||
| 388 | 390 | ||
| 389 | mutex_lock(&indio_dev->mlock); | 391 | mutex_lock(&indio_dev->mlock); |
| 390 | 392 | ||
diff --git a/drivers/staging/omapdrm/omap_connector.c b/drivers/staging/omapdrm/omap_connector.c index 5e2856c0e0bb..55e9c8655850 100644 --- a/drivers/staging/omapdrm/omap_connector.c +++ b/drivers/staging/omapdrm/omap_connector.c | |||
| @@ -48,13 +48,20 @@ static inline void copy_timings_omap_to_drm(struct drm_display_mode *mode, | |||
| 48 | mode->vsync_end = mode->vsync_start + timings->vsw; | 48 | mode->vsync_end = mode->vsync_start + timings->vsw; |
| 49 | mode->vtotal = mode->vsync_end + timings->vbp; | 49 | mode->vtotal = mode->vsync_end + timings->vbp; |
| 50 | 50 | ||
| 51 | /* note: whether or not it is interlaced, +/- h/vsync, etc, | 51 | mode->flags = 0; |
| 52 | * which should be set in the mode flags, is not exposed in | 52 | |
| 53 | * the omap_video_timings struct.. but hdmi driver tracks | 53 | if (timings->interlace) |
| 54 | * those separately so all we have to have to set the mode | 54 | mode->flags |= DRM_MODE_FLAG_INTERLACE; |
| 55 | * is the way to recover these timings values, and the | 55 | |
| 56 | * omap_dss_driver would do the rest. | 56 | if (timings->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH) |
| 57 | */ | 57 | mode->flags |= DRM_MODE_FLAG_PHSYNC; |
| 58 | else | ||
| 59 | mode->flags |= DRM_MODE_FLAG_NHSYNC; | ||
| 60 | |||
| 61 | if (timings->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH) | ||
| 62 | mode->flags |= DRM_MODE_FLAG_PVSYNC; | ||
| 63 | else | ||
| 64 | mode->flags |= DRM_MODE_FLAG_NVSYNC; | ||
| 58 | } | 65 | } |
| 59 | 66 | ||
| 60 | static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings, | 67 | static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings, |
| @@ -71,6 +78,22 @@ static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings, | |||
| 71 | timings->vfp = mode->vsync_start - mode->vdisplay; | 78 | timings->vfp = mode->vsync_start - mode->vdisplay; |
| 72 | timings->vsw = mode->vsync_end - mode->vsync_start; | 79 | timings->vsw = mode->vsync_end - mode->vsync_start; |
| 73 | timings->vbp = mode->vtotal - mode->vsync_end; | 80 | timings->vbp = mode->vtotal - mode->vsync_end; |
| 81 | |||
| 82 | timings->interlace = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); | ||
| 83 | |||
| 84 | if (mode->flags & DRM_MODE_FLAG_PHSYNC) | ||
| 85 | timings->hsync_level = OMAPDSS_SIG_ACTIVE_HIGH; | ||
| 86 | else | ||
| 87 | timings->hsync_level = OMAPDSS_SIG_ACTIVE_LOW; | ||
| 88 | |||
| 89 | if (mode->flags & DRM_MODE_FLAG_PVSYNC) | ||
| 90 | timings->vsync_level = OMAPDSS_SIG_ACTIVE_HIGH; | ||
| 91 | else | ||
| 92 | timings->vsync_level = OMAPDSS_SIG_ACTIVE_LOW; | ||
| 93 | |||
| 94 | timings->data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; | ||
| 95 | timings->de_level = OMAPDSS_SIG_ACTIVE_HIGH; | ||
| 96 | timings->sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES; | ||
| 74 | } | 97 | } |
| 75 | 98 | ||
| 76 | static void omap_connector_dpms(struct drm_connector *connector, int mode) | 99 | static void omap_connector_dpms(struct drm_connector *connector, int mode) |
| @@ -187,7 +210,7 @@ static int omap_connector_get_modes(struct drm_connector *connector) | |||
| 187 | } | 210 | } |
| 188 | } else { | 211 | } else { |
| 189 | struct drm_display_mode *mode = drm_mode_create(dev); | 212 | struct drm_display_mode *mode = drm_mode_create(dev); |
| 190 | struct omap_video_timings timings; | 213 | struct omap_video_timings timings = {0}; |
| 191 | 214 | ||
| 192 | dssdrv->get_timings(dssdev, &timings); | 215 | dssdrv->get_timings(dssdev, &timings); |
| 193 | 216 | ||
| @@ -291,7 +314,7 @@ void omap_connector_mode_set(struct drm_connector *connector, | |||
| 291 | struct omap_connector *omap_connector = to_omap_connector(connector); | 314 | struct omap_connector *omap_connector = to_omap_connector(connector); |
| 292 | struct omap_dss_device *dssdev = omap_connector->dssdev; | 315 | struct omap_dss_device *dssdev = omap_connector->dssdev; |
| 293 | struct omap_dss_driver *dssdrv = dssdev->driver; | 316 | struct omap_dss_driver *dssdrv = dssdev->driver; |
| 294 | struct omap_video_timings timings; | 317 | struct omap_video_timings timings = {0}; |
| 295 | 318 | ||
| 296 | copy_timings_drm_to_omap(&timings, mode); | 319 | copy_timings_drm_to_omap(&timings, mode); |
| 297 | 320 | ||
diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c index d98321945802..758ce0a8d82e 100644 --- a/drivers/staging/ozwpan/ozcdev.c +++ b/drivers/staging/ozwpan/ozcdev.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/cdev.h> | 8 | #include <linux/cdev.h> |
| 9 | #include <linux/uaccess.h> | 9 | #include <linux/uaccess.h> |
| 10 | #include <linux/netdevice.h> | 10 | #include <linux/netdevice.h> |
| 11 | #include <linux/etherdevice.h> | ||
| 11 | #include <linux/poll.h> | 12 | #include <linux/poll.h> |
| 12 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
| 13 | #include "ozconfig.h" | 14 | #include "ozconfig.h" |
| @@ -213,7 +214,7 @@ static int oz_set_active_pd(u8 *addr) | |||
| 213 | if (old_pd) | 214 | if (old_pd) |
| 214 | oz_pd_put(old_pd); | 215 | oz_pd_put(old_pd); |
| 215 | } else { | 216 | } else { |
| 216 | if (!memcmp(addr, "\0\0\0\0\0\0", sizeof(addr))) { | 217 | if (is_zero_ether_addr(addr)) { |
| 217 | spin_lock_bh(&g_cdev.lock); | 218 | spin_lock_bh(&g_cdev.lock); |
| 218 | pd = g_cdev.active_pd; | 219 | pd = g_cdev.active_pd; |
| 219 | g_cdev.active_pd = 0; | 220 | g_cdev.active_pd = 0; |
diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c index 0e26d5f6cf2d..495ee1205e02 100644 --- a/drivers/staging/rtl8712/recv_linux.c +++ b/drivers/staging/rtl8712/recv_linux.c | |||
| @@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter, | |||
| 117 | if (skb == NULL) | 117 | if (skb == NULL) |
| 118 | goto _recv_indicatepkt_drop; | 118 | goto _recv_indicatepkt_drop; |
| 119 | skb->data = precv_frame->u.hdr.rx_data; | 119 | skb->data = precv_frame->u.hdr.rx_data; |
| 120 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | ||
| 121 | skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail - | ||
| 122 | precv_frame->u.hdr.rx_head); | ||
| 123 | #else | ||
| 124 | skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail; | ||
| 125 | #endif | ||
| 126 | skb->len = precv_frame->u.hdr.len; | 120 | skb->len = precv_frame->u.hdr.len; |
| 121 | skb_set_tail_pointer(skb, skb->len); | ||
| 127 | if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1)) | 122 | if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1)) |
| 128 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 123 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
| 129 | else | 124 | else |
diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c index e4bdf2a2b582..3aa895ec6507 100644 --- a/drivers/staging/vt6656/dpc.c +++ b/drivers/staging/vt6656/dpc.c | |||
| @@ -200,7 +200,7 @@ s_vProcessRxMACHeader ( | |||
| 200 | } else if (!compare_ether_addr(pbyRxBuffer, &pDevice->abySNAP_RFC1042[0])) { | 200 | } else if (!compare_ether_addr(pbyRxBuffer, &pDevice->abySNAP_RFC1042[0])) { |
| 201 | cbHeaderSize += 6; | 201 | cbHeaderSize += 6; |
| 202 | pwType = (PWORD) (pbyRxBufferAddr + cbHeaderSize); | 202 | pwType = (PWORD) (pbyRxBufferAddr + cbHeaderSize); |
| 203 | if ((*pwType == cpu_to_le16(ETH_P_IPX)) || | 203 | if ((*pwType == cpu_to_be16(ETH_P_IPX)) || |
| 204 | (*pwType == cpu_to_le16(0xF380))) { | 204 | (*pwType == cpu_to_le16(0xF380))) { |
| 205 | cbHeaderSize -= 8; | 205 | cbHeaderSize -= 8; |
| 206 | pwType = (PWORD) (pbyRxBufferAddr + cbHeaderSize); | 206 | pwType = (PWORD) (pbyRxBufferAddr + cbHeaderSize); |
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index bb464527fc1b..b6e04e7b629b 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c | |||
| @@ -1699,7 +1699,7 @@ s_bPacketToWirelessUsb( | |||
| 1699 | // 802.1H | 1699 | // 802.1H |
| 1700 | if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) { | 1700 | if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) { |
| 1701 | if (pDevice->dwDiagRefCount == 0) { | 1701 | if (pDevice->dwDiagRefCount == 0) { |
| 1702 | if ((psEthHeader->wType == cpu_to_le16(ETH_P_IPX)) || | 1702 | if ((psEthHeader->wType == cpu_to_be16(ETH_P_IPX)) || |
| 1703 | (psEthHeader->wType == cpu_to_le16(0xF380))) { | 1703 | (psEthHeader->wType == cpu_to_le16(0xF380))) { |
| 1704 | memcpy((PBYTE) (pbyPayloadHead), | 1704 | memcpy((PBYTE) (pbyPayloadHead), |
| 1705 | abySNAP_Bridgetunnel, 6); | 1705 | abySNAP_Bridgetunnel, 6); |
| @@ -2838,10 +2838,10 @@ int nsDMA_tx_packet(PSDevice pDevice, unsigned int uDMAIdx, struct sk_buff *skb) | |||
| 2838 | Packet_Type = skb->data[ETH_HLEN+1]; | 2838 | Packet_Type = skb->data[ETH_HLEN+1]; |
| 2839 | Descriptor_type = skb->data[ETH_HLEN+1+1+2]; | 2839 | Descriptor_type = skb->data[ETH_HLEN+1+1+2]; |
| 2840 | Key_info = (skb->data[ETH_HLEN+1+1+2+1] << 8)|(skb->data[ETH_HLEN+1+1+2+2]); | 2840 | Key_info = (skb->data[ETH_HLEN+1+1+2+1] << 8)|(skb->data[ETH_HLEN+1+1+2+2]); |
| 2841 | if (pDevice->sTxEthHeader.wType == cpu_to_le16(ETH_P_PAE)) { | 2841 | if (pDevice->sTxEthHeader.wType == cpu_to_be16(ETH_P_PAE)) { |
| 2842 | /* 802.1x OR eapol-key challenge frame transfer */ | 2842 | /* 802.1x OR eapol-key challenge frame transfer */ |
| 2843 | if (((Protocol_Version == 1) || (Protocol_Version == 2)) && | 2843 | if (((Protocol_Version == 1) || (Protocol_Version == 2)) && |
| 2844 | (Packet_Type == 3)) { | 2844 | (Packet_Type == 3)) { |
| 2845 | bTxeapol_key = TRUE; | 2845 | bTxeapol_key = TRUE; |
| 2846 | if(!(Key_info & BIT3) && //WPA or RSN group-key challenge | 2846 | if(!(Key_info & BIT3) && //WPA or RSN group-key challenge |
| 2847 | (Key_info & BIT8) && (Key_info & BIT9)) { //send 2/2 key | 2847 | (Key_info & BIT8) && (Key_info & BIT9)) { //send 2/2 key |
| @@ -2987,19 +2987,19 @@ int nsDMA_tx_packet(PSDevice pDevice, unsigned int uDMAIdx, struct sk_buff *skb) | |||
| 2987 | } | 2987 | } |
| 2988 | } | 2988 | } |
| 2989 | 2989 | ||
| 2990 | if (pDevice->sTxEthHeader.wType == cpu_to_le16(ETH_P_PAE)) { | 2990 | if (pDevice->sTxEthHeader.wType == cpu_to_be16(ETH_P_PAE)) { |
| 2991 | if (pDevice->byBBType != BB_TYPE_11A) { | 2991 | if (pDevice->byBBType != BB_TYPE_11A) { |
| 2992 | pDevice->wCurrentRate = RATE_1M; | 2992 | pDevice->wCurrentRate = RATE_1M; |
| 2993 | pDevice->byACKRate = RATE_1M; | 2993 | pDevice->byACKRate = RATE_1M; |
| 2994 | pDevice->byTopCCKBasicRate = RATE_1M; | 2994 | pDevice->byTopCCKBasicRate = RATE_1M; |
| 2995 | pDevice->byTopOFDMBasicRate = RATE_6M; | 2995 | pDevice->byTopOFDMBasicRate = RATE_6M; |
| 2996 | } else { | 2996 | } else { |
| 2997 | pDevice->wCurrentRate = RATE_6M; | 2997 | pDevice->wCurrentRate = RATE_6M; |
| 2998 | pDevice->byACKRate = RATE_6M; | 2998 | pDevice->byACKRate = RATE_6M; |
| 2999 | pDevice->byTopCCKBasicRate = RATE_1M; | 2999 | pDevice->byTopCCKBasicRate = RATE_1M; |
| 3000 | pDevice->byTopOFDMBasicRate = RATE_6M; | 3000 | pDevice->byTopOFDMBasicRate = RATE_6M; |
| 3001 | } | 3001 | } |
| 3002 | } | 3002 | } |
| 3003 | 3003 | ||
| 3004 | DBG_PRT(MSG_LEVEL_DEBUG, | 3004 | DBG_PRT(MSG_LEVEL_DEBUG, |
| 3005 | KERN_INFO "dma_tx: pDevice->wCurrentRate = %d\n", | 3005 | KERN_INFO "dma_tx: pDevice->wCurrentRate = %d\n", |
| @@ -3015,7 +3015,7 @@ int nsDMA_tx_packet(PSDevice pDevice, unsigned int uDMAIdx, struct sk_buff *skb) | |||
| 3015 | 3015 | ||
| 3016 | if (bNeedEncryption == TRUE) { | 3016 | if (bNeedEncryption == TRUE) { |
| 3017 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ntohs Pkt Type=%04x\n", ntohs(pDevice->sTxEthHeader.wType)); | 3017 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ntohs Pkt Type=%04x\n", ntohs(pDevice->sTxEthHeader.wType)); |
| 3018 | if ((pDevice->sTxEthHeader.wType) == cpu_to_le16(ETH_P_PAE)) { | 3018 | if ((pDevice->sTxEthHeader.wType) == cpu_to_be16(ETH_P_PAE)) { |
| 3019 | bNeedEncryption = FALSE; | 3019 | bNeedEncryption = FALSE; |
| 3020 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Pkt Type=%04x\n", (pDevice->sTxEthHeader.wType)); | 3020 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Pkt Type=%04x\n", (pDevice->sTxEthHeader.wType)); |
| 3021 | if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) { | 3021 | if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) { |
diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index fabff4d650ef..0970127344e6 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c | |||
| @@ -327,9 +327,9 @@ int prism2_get_station(struct wiphy *wiphy, struct net_device *dev, | |||
| 327 | return result; | 327 | return result; |
| 328 | } | 328 | } |
| 329 | 329 | ||
| 330 | int prism2_scan(struct wiphy *wiphy, struct net_device *dev, | 330 | int prism2_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) |
| 331 | struct cfg80211_scan_request *request) | ||
| 332 | { | 331 | { |
| 332 | struct net_device *dev = request->wdev->netdev; | ||
| 333 | struct prism2_wiphy_private *priv = wiphy_priv(wiphy); | 333 | struct prism2_wiphy_private *priv = wiphy_priv(wiphy); |
| 334 | wlandevice_t *wlandev = dev->ml_priv; | 334 | wlandevice_t *wlandev = dev->ml_priv; |
| 335 | struct p80211msg_dot11req_scan msg1; | 335 | struct p80211msg_dot11req_scan msg1; |
diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c index c214977b4ab4..52b43b7b83d7 100644 --- a/drivers/staging/zcache/zcache-main.c +++ b/drivers/staging/zcache/zcache-main.c | |||
| @@ -1251,13 +1251,12 @@ static int zcache_pampd_get_data_and_free(char *data, size_t *bufsize, bool raw, | |||
| 1251 | void *pampd, struct tmem_pool *pool, | 1251 | void *pampd, struct tmem_pool *pool, |
| 1252 | struct tmem_oid *oid, uint32_t index) | 1252 | struct tmem_oid *oid, uint32_t index) |
| 1253 | { | 1253 | { |
| 1254 | int ret = 0; | ||
| 1255 | |||
| 1256 | BUG_ON(!is_ephemeral(pool)); | 1254 | BUG_ON(!is_ephemeral(pool)); |
| 1257 | zbud_decompress((struct page *)(data), pampd); | 1255 | if (zbud_decompress((struct page *)(data), pampd) < 0) |
| 1256 | return -EINVAL; | ||
| 1258 | zbud_free_and_delist((struct zbud_hdr *)pampd); | 1257 | zbud_free_and_delist((struct zbud_hdr *)pampd); |
| 1259 | atomic_dec(&zcache_curr_eph_pampd_count); | 1258 | atomic_dec(&zcache_curr_eph_pampd_count); |
| 1260 | return ret; | 1259 | return 0; |
| 1261 | } | 1260 | } |
| 1262 | 1261 | ||
| 1263 | /* | 1262 | /* |
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index d5c689d6217e..e309e8b0aaba 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
| @@ -132,6 +132,7 @@ | |||
| 132 | #define UCR4_OREN (1<<1) /* Receiver overrun interrupt enable */ | 132 | #define UCR4_OREN (1<<1) /* Receiver overrun interrupt enable */ |
| 133 | #define UCR4_DREN (1<<0) /* Recv data ready interrupt enable */ | 133 | #define UCR4_DREN (1<<0) /* Recv data ready interrupt enable */ |
| 134 | #define UFCR_RXTL_SHF 0 /* Receiver trigger level shift */ | 134 | #define UFCR_RXTL_SHF 0 /* Receiver trigger level shift */ |
| 135 | #define UFCR_DCEDTE (1<<6) /* DCE/DTE mode select */ | ||
| 135 | #define UFCR_RFDIV (7<<7) /* Reference freq divider mask */ | 136 | #define UFCR_RFDIV (7<<7) /* Reference freq divider mask */ |
| 136 | #define UFCR_RFDIV_REG(x) (((x) < 7 ? 6 - (x) : 6) << 7) | 137 | #define UFCR_RFDIV_REG(x) (((x) < 7 ? 6 - (x) : 6) << 7) |
| 137 | #define UFCR_TXTL_SHF 10 /* Transmitter trigger level shift */ | 138 | #define UFCR_TXTL_SHF 10 /* Transmitter trigger level shift */ |
| @@ -667,22 +668,11 @@ static void imx_break_ctl(struct uart_port *port, int break_state) | |||
| 667 | static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode) | 668 | static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode) |
| 668 | { | 669 | { |
| 669 | unsigned int val; | 670 | unsigned int val; |
| 670 | unsigned int ufcr_rfdiv; | ||
| 671 | |||
| 672 | /* set receiver / transmitter trigger level. | ||
| 673 | * RFDIV is set such way to satisfy requested uartclk value | ||
| 674 | */ | ||
| 675 | val = TXTL << 10 | RXTL; | ||
| 676 | ufcr_rfdiv = (clk_get_rate(sport->clk_per) + sport->port.uartclk / 2) | ||
| 677 | / sport->port.uartclk; | ||
| 678 | |||
| 679 | if(!ufcr_rfdiv) | ||
| 680 | ufcr_rfdiv = 1; | ||
| 681 | |||
| 682 | val |= UFCR_RFDIV_REG(ufcr_rfdiv); | ||
| 683 | 671 | ||
| 672 | /* set receiver / transmitter trigger level */ | ||
| 673 | val = readl(sport->port.membase + UFCR) & (UFCR_RFDIV | UFCR_DCEDTE); | ||
| 674 | val |= TXTL << UFCR_TXTL_SHF | RXTL; | ||
| 684 | writel(val, sport->port.membase + UFCR); | 675 | writel(val, sport->port.membase + UFCR); |
| 685 | |||
| 686 | return 0; | 676 | return 0; |
| 687 | } | 677 | } |
| 688 | 678 | ||
| @@ -754,6 +744,7 @@ static int imx_startup(struct uart_port *port) | |||
| 754 | } | 744 | } |
| 755 | } | 745 | } |
| 756 | 746 | ||
| 747 | spin_lock_irqsave(&sport->port.lock, flags); | ||
| 757 | /* | 748 | /* |
| 758 | * Finally, clear and enable interrupts | 749 | * Finally, clear and enable interrupts |
| 759 | */ | 750 | */ |
| @@ -807,7 +798,6 @@ static int imx_startup(struct uart_port *port) | |||
| 807 | /* | 798 | /* |
| 808 | * Enable modem status interrupts | 799 | * Enable modem status interrupts |
| 809 | */ | 800 | */ |
| 810 | spin_lock_irqsave(&sport->port.lock,flags); | ||
| 811 | imx_enable_ms(&sport->port); | 801 | imx_enable_ms(&sport->port); |
| 812 | spin_unlock_irqrestore(&sport->port.lock,flags); | 802 | spin_unlock_irqrestore(&sport->port.lock,flags); |
| 813 | 803 | ||
| @@ -837,10 +827,13 @@ static void imx_shutdown(struct uart_port *port) | |||
| 837 | { | 827 | { |
| 838 | struct imx_port *sport = (struct imx_port *)port; | 828 | struct imx_port *sport = (struct imx_port *)port; |
| 839 | unsigned long temp; | 829 | unsigned long temp; |
| 830 | unsigned long flags; | ||
| 840 | 831 | ||
| 832 | spin_lock_irqsave(&sport->port.lock, flags); | ||
| 841 | temp = readl(sport->port.membase + UCR2); | 833 | temp = readl(sport->port.membase + UCR2); |
| 842 | temp &= ~(UCR2_TXEN); | 834 | temp &= ~(UCR2_TXEN); |
| 843 | writel(temp, sport->port.membase + UCR2); | 835 | writel(temp, sport->port.membase + UCR2); |
| 836 | spin_unlock_irqrestore(&sport->port.lock, flags); | ||
| 844 | 837 | ||
| 845 | if (USE_IRDA(sport)) { | 838 | if (USE_IRDA(sport)) { |
| 846 | struct imxuart_platform_data *pdata; | 839 | struct imxuart_platform_data *pdata; |
| @@ -869,12 +862,14 @@ static void imx_shutdown(struct uart_port *port) | |||
| 869 | * Disable all interrupts, port and break condition. | 862 | * Disable all interrupts, port and break condition. |
| 870 | */ | 863 | */ |
| 871 | 864 | ||
| 865 | spin_lock_irqsave(&sport->port.lock, flags); | ||
| 872 | temp = readl(sport->port.membase + UCR1); | 866 | temp = readl(sport->port.membase + UCR1); |
| 873 | temp &= ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN); | 867 | temp &= ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN); |
| 874 | if (USE_IRDA(sport)) | 868 | if (USE_IRDA(sport)) |
| 875 | temp &= ~(UCR1_IREN); | 869 | temp &= ~(UCR1_IREN); |
| 876 | 870 | ||
| 877 | writel(temp, sport->port.membase + UCR1); | 871 | writel(temp, sport->port.membase + UCR1); |
| 872 | spin_unlock_irqrestore(&sport->port.lock, flags); | ||
| 878 | } | 873 | } |
| 879 | 874 | ||
| 880 | static void | 875 | static void |
| @@ -1217,6 +1212,9 @@ imx_console_write(struct console *co, const char *s, unsigned int count) | |||
| 1217 | struct imx_port *sport = imx_ports[co->index]; | 1212 | struct imx_port *sport = imx_ports[co->index]; |
| 1218 | struct imx_port_ucrs old_ucr; | 1213 | struct imx_port_ucrs old_ucr; |
| 1219 | unsigned int ucr1; | 1214 | unsigned int ucr1; |
| 1215 | unsigned long flags; | ||
| 1216 | |||
| 1217 | spin_lock_irqsave(&sport->port.lock, flags); | ||
| 1220 | 1218 | ||
| 1221 | /* | 1219 | /* |
| 1222 | * First, save UCR1/2/3 and then disable interrupts | 1220 | * First, save UCR1/2/3 and then disable interrupts |
| @@ -1242,6 +1240,8 @@ imx_console_write(struct console *co, const char *s, unsigned int count) | |||
| 1242 | while (!(readl(sport->port.membase + USR2) & USR2_TXDC)); | 1240 | while (!(readl(sport->port.membase + USR2) & USR2_TXDC)); |
| 1243 | 1241 | ||
| 1244 | imx_port_ucrs_restore(&sport->port, &old_ucr); | 1242 | imx_port_ucrs_restore(&sport->port, &old_ucr); |
| 1243 | |||
| 1244 | spin_unlock_irqrestore(&sport->port.lock, flags); | ||
| 1245 | } | 1245 | } |
| 1246 | 1246 | ||
| 1247 | /* | 1247 | /* |
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index c7a032a4f0c5..d214448b677e 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
| @@ -78,8 +78,7 @@ static inline int ep_to_bit(struct ci13xxx *ci, int n) | |||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | /** | 80 | /** |
| 81 | * hw_device_state: enables/disables interrupts & starts/stops device (execute | 81 | * hw_device_state: enables/disables interrupts (execute without interruption) |
| 82 | * without interruption) | ||
| 83 | * @dma: 0 => disable, !0 => enable and set dma engine | 82 | * @dma: 0 => disable, !0 => enable and set dma engine |
| 84 | * | 83 | * |
| 85 | * This function returns an error code | 84 | * This function returns an error code |
| @@ -91,9 +90,7 @@ static int hw_device_state(struct ci13xxx *ci, u32 dma) | |||
| 91 | /* interrupt, error, port change, reset, sleep/suspend */ | 90 | /* interrupt, error, port change, reset, sleep/suspend */ |
| 92 | hw_write(ci, OP_USBINTR, ~0, | 91 | hw_write(ci, OP_USBINTR, ~0, |
| 93 | USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI); | 92 | USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI); |
| 94 | hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS); | ||
| 95 | } else { | 93 | } else { |
| 96 | hw_write(ci, OP_USBCMD, USBCMD_RS, 0); | ||
| 97 | hw_write(ci, OP_USBINTR, ~0, 0); | 94 | hw_write(ci, OP_USBINTR, ~0, 0); |
| 98 | } | 95 | } |
| 99 | return 0; | 96 | return 0; |
| @@ -774,10 +771,7 @@ __acquires(mEp->lock) | |||
| 774 | { | 771 | { |
| 775 | struct ci13xxx_req *mReq, *mReqTemp; | 772 | struct ci13xxx_req *mReq, *mReqTemp; |
| 776 | struct ci13xxx_ep *mEpTemp = mEp; | 773 | struct ci13xxx_ep *mEpTemp = mEp; |
| 777 | int uninitialized_var(retval); | 774 | int retval = 0; |
| 778 | |||
| 779 | if (list_empty(&mEp->qh.queue)) | ||
| 780 | return -EINVAL; | ||
| 781 | 775 | ||
| 782 | list_for_each_entry_safe(mReq, mReqTemp, &mEp->qh.queue, | 776 | list_for_each_entry_safe(mReq, mReqTemp, &mEp->qh.queue, |
| 783 | queue) { | 777 | queue) { |
| @@ -1420,6 +1414,21 @@ static int ci13xxx_vbus_draw(struct usb_gadget *_gadget, unsigned mA) | |||
| 1420 | return -ENOTSUPP; | 1414 | return -ENOTSUPP; |
| 1421 | } | 1415 | } |
| 1422 | 1416 | ||
| 1417 | /* Change Data+ pullup status | ||
| 1418 | * this func is used by usb_gadget_connect/disconnet | ||
| 1419 | */ | ||
| 1420 | static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_on) | ||
| 1421 | { | ||
| 1422 | struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget); | ||
| 1423 | |||
| 1424 | if (is_on) | ||
| 1425 | hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS); | ||
| 1426 | else | ||
| 1427 | hw_write(ci, OP_USBCMD, USBCMD_RS, 0); | ||
| 1428 | |||
| 1429 | return 0; | ||
| 1430 | } | ||
| 1431 | |||
| 1423 | static int ci13xxx_start(struct usb_gadget *gadget, | 1432 | static int ci13xxx_start(struct usb_gadget *gadget, |
| 1424 | struct usb_gadget_driver *driver); | 1433 | struct usb_gadget_driver *driver); |
| 1425 | static int ci13xxx_stop(struct usb_gadget *gadget, | 1434 | static int ci13xxx_stop(struct usb_gadget *gadget, |
| @@ -1432,6 +1441,7 @@ static int ci13xxx_stop(struct usb_gadget *gadget, | |||
| 1432 | static const struct usb_gadget_ops usb_gadget_ops = { | 1441 | static const struct usb_gadget_ops usb_gadget_ops = { |
| 1433 | .vbus_session = ci13xxx_vbus_session, | 1442 | .vbus_session = ci13xxx_vbus_session, |
| 1434 | .wakeup = ci13xxx_wakeup, | 1443 | .wakeup = ci13xxx_wakeup, |
| 1444 | .pullup = ci13xxx_pullup, | ||
| 1435 | .vbus_draw = ci13xxx_vbus_draw, | 1445 | .vbus_draw = ci13xxx_vbus_draw, |
| 1436 | .udc_start = ci13xxx_start, | 1446 | .udc_start = ci13xxx_start, |
| 1437 | .udc_stop = ci13xxx_stop, | 1447 | .udc_stop = ci13xxx_stop, |
| @@ -1455,7 +1465,12 @@ static int init_eps(struct ci13xxx *ci) | |||
| 1455 | 1465 | ||
| 1456 | mEp->ep.name = mEp->name; | 1466 | mEp->ep.name = mEp->name; |
| 1457 | mEp->ep.ops = &usb_ep_ops; | 1467 | mEp->ep.ops = &usb_ep_ops; |
| 1458 | mEp->ep.maxpacket = CTRL_PAYLOAD_MAX; | 1468 | /* |
| 1469 | * for ep0: maxP defined in desc, for other | ||
| 1470 | * eps, maxP is set by epautoconfig() called | ||
| 1471 | * by gadget layer | ||
| 1472 | */ | ||
| 1473 | mEp->ep.maxpacket = (unsigned short)~0; | ||
| 1459 | 1474 | ||
| 1460 | INIT_LIST_HEAD(&mEp->qh.queue); | 1475 | INIT_LIST_HEAD(&mEp->qh.queue); |
| 1461 | mEp->qh.ptr = dma_pool_alloc(ci->qh_pool, GFP_KERNEL, | 1476 | mEp->qh.ptr = dma_pool_alloc(ci->qh_pool, GFP_KERNEL, |
| @@ -1475,6 +1490,7 @@ static int init_eps(struct ci13xxx *ci) | |||
| 1475 | else | 1490 | else |
| 1476 | ci->ep0in = mEp; | 1491 | ci->ep0in = mEp; |
| 1477 | 1492 | ||
| 1493 | mEp->ep.maxpacket = CTRL_PAYLOAD_MAX; | ||
| 1478 | continue; | 1494 | continue; |
| 1479 | } | 1495 | } |
| 1480 | 1496 | ||
| @@ -1484,6 +1500,17 @@ static int init_eps(struct ci13xxx *ci) | |||
| 1484 | return retval; | 1500 | return retval; |
| 1485 | } | 1501 | } |
| 1486 | 1502 | ||
| 1503 | static void destroy_eps(struct ci13xxx *ci) | ||
| 1504 | { | ||
| 1505 | int i; | ||
| 1506 | |||
| 1507 | for (i = 0; i < ci->hw_ep_max; i++) { | ||
| 1508 | struct ci13xxx_ep *mEp = &ci->ci13xxx_ep[i]; | ||
| 1509 | |||
| 1510 | dma_pool_free(ci->qh_pool, mEp->qh.ptr, mEp->qh.dma); | ||
| 1511 | } | ||
| 1512 | } | ||
| 1513 | |||
| 1487 | /** | 1514 | /** |
| 1488 | * ci13xxx_start: register a gadget driver | 1515 | * ci13xxx_start: register a gadget driver |
| 1489 | * @gadget: our gadget | 1516 | * @gadget: our gadget |
| @@ -1691,7 +1718,7 @@ static int udc_start(struct ci13xxx *ci) | |||
| 1691 | if (ci->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) { | 1718 | if (ci->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) { |
| 1692 | if (ci->transceiver == NULL) { | 1719 | if (ci->transceiver == NULL) { |
| 1693 | retval = -ENODEV; | 1720 | retval = -ENODEV; |
| 1694 | goto free_pools; | 1721 | goto destroy_eps; |
| 1695 | } | 1722 | } |
| 1696 | } | 1723 | } |
| 1697 | 1724 | ||
| @@ -1729,7 +1756,7 @@ static int udc_start(struct ci13xxx *ci) | |||
| 1729 | 1756 | ||
| 1730 | remove_trans: | 1757 | remove_trans: |
| 1731 | if (!IS_ERR_OR_NULL(ci->transceiver)) { | 1758 | if (!IS_ERR_OR_NULL(ci->transceiver)) { |
| 1732 | otg_set_peripheral(ci->transceiver->otg, &ci->gadget); | 1759 | otg_set_peripheral(ci->transceiver->otg, NULL); |
| 1733 | if (ci->global_phy) | 1760 | if (ci->global_phy) |
| 1734 | usb_put_phy(ci->transceiver); | 1761 | usb_put_phy(ci->transceiver); |
| 1735 | } | 1762 | } |
| @@ -1742,6 +1769,8 @@ unreg_device: | |||
| 1742 | put_transceiver: | 1769 | put_transceiver: |
| 1743 | if (!IS_ERR_OR_NULL(ci->transceiver) && ci->global_phy) | 1770 | if (!IS_ERR_OR_NULL(ci->transceiver) && ci->global_phy) |
| 1744 | usb_put_phy(ci->transceiver); | 1771 | usb_put_phy(ci->transceiver); |
| 1772 | destroy_eps: | ||
| 1773 | destroy_eps(ci); | ||
| 1745 | free_pools: | 1774 | free_pools: |
| 1746 | dma_pool_destroy(ci->td_pool); | 1775 | dma_pool_destroy(ci->td_pool); |
| 1747 | free_qh_pool: | 1776 | free_qh_pool: |
| @@ -1756,18 +1785,12 @@ free_qh_pool: | |||
| 1756 | */ | 1785 | */ |
| 1757 | static void udc_stop(struct ci13xxx *ci) | 1786 | static void udc_stop(struct ci13xxx *ci) |
| 1758 | { | 1787 | { |
| 1759 | int i; | ||
| 1760 | |||
| 1761 | if (ci == NULL) | 1788 | if (ci == NULL) |
| 1762 | return; | 1789 | return; |
| 1763 | 1790 | ||
| 1764 | usb_del_gadget_udc(&ci->gadget); | 1791 | usb_del_gadget_udc(&ci->gadget); |
| 1765 | 1792 | ||
| 1766 | for (i = 0; i < ci->hw_ep_max; i++) { | 1793 | destroy_eps(ci); |
| 1767 | struct ci13xxx_ep *mEp = &ci->ci13xxx_ep[i]; | ||
| 1768 | |||
| 1769 | dma_pool_free(ci->qh_pool, mEp->qh.ptr, mEp->qh.dma); | ||
| 1770 | } | ||
| 1771 | 1794 | ||
| 1772 | dma_pool_destroy(ci->td_pool); | 1795 | dma_pool_destroy(ci->td_pool); |
| 1773 | dma_pool_destroy(ci->qh_pool); | 1796 | dma_pool_destroy(ci->qh_pool); |
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 65a55abb791f..5f0cb417b736 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
| @@ -109,12 +109,14 @@ static struct usb_driver wdm_driver; | |||
| 109 | /* return intfdata if we own the interface, else look up intf in the list */ | 109 | /* return intfdata if we own the interface, else look up intf in the list */ |
| 110 | static struct wdm_device *wdm_find_device(struct usb_interface *intf) | 110 | static struct wdm_device *wdm_find_device(struct usb_interface *intf) |
| 111 | { | 111 | { |
| 112 | struct wdm_device *desc = NULL; | 112 | struct wdm_device *desc; |
| 113 | 113 | ||
| 114 | spin_lock(&wdm_device_list_lock); | 114 | spin_lock(&wdm_device_list_lock); |
| 115 | list_for_each_entry(desc, &wdm_device_list, device_list) | 115 | list_for_each_entry(desc, &wdm_device_list, device_list) |
| 116 | if (desc->intf == intf) | 116 | if (desc->intf == intf) |
| 117 | break; | 117 | goto found; |
| 118 | desc = NULL; | ||
| 119 | found: | ||
| 118 | spin_unlock(&wdm_device_list_lock); | 120 | spin_unlock(&wdm_device_list_lock); |
| 119 | 121 | ||
| 120 | return desc; | 122 | return desc; |
| @@ -122,12 +124,14 @@ static struct wdm_device *wdm_find_device(struct usb_interface *intf) | |||
| 122 | 124 | ||
| 123 | static struct wdm_device *wdm_find_device_by_minor(int minor) | 125 | static struct wdm_device *wdm_find_device_by_minor(int minor) |
| 124 | { | 126 | { |
| 125 | struct wdm_device *desc = NULL; | 127 | struct wdm_device *desc; |
| 126 | 128 | ||
| 127 | spin_lock(&wdm_device_list_lock); | 129 | spin_lock(&wdm_device_list_lock); |
| 128 | list_for_each_entry(desc, &wdm_device_list, device_list) | 130 | list_for_each_entry(desc, &wdm_device_list, device_list) |
| 129 | if (desc->intf->minor == minor) | 131 | if (desc->intf->minor == minor) |
| 130 | break; | 132 | goto found; |
| 133 | desc = NULL; | ||
| 134 | found: | ||
| 131 | spin_unlock(&wdm_device_list_lock); | 135 | spin_unlock(&wdm_device_list_lock); |
| 132 | 136 | ||
| 133 | return desc; | 137 | return desc; |
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index f15501f4c585..e77a8e8eaa23 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
| @@ -71,6 +71,10 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
| 71 | { USB_DEVICE(0x04b4, 0x0526), .driver_info = | 71 | { USB_DEVICE(0x04b4, 0x0526), .driver_info = |
| 72 | USB_QUIRK_CONFIG_INTF_STRINGS }, | 72 | USB_QUIRK_CONFIG_INTF_STRINGS }, |
| 73 | 73 | ||
| 74 | /* Microchip Joss Optical infrared touchboard device */ | ||
| 75 | { USB_DEVICE(0x04d8, 0x000c), .driver_info = | ||
| 76 | USB_QUIRK_CONFIG_INTF_STRINGS }, | ||
| 77 | |||
| 74 | /* Samsung Android phone modem - ID conflict with SPH-I500 */ | 78 | /* Samsung Android phone modem - ID conflict with SPH-I500 */ |
| 75 | { USB_DEVICE(0x04e8, 0x6601), .driver_info = | 79 | { USB_DEVICE(0x04e8, 0x6601), .driver_info = |
| 76 | USB_QUIRK_CONFIG_INTF_STRINGS }, | 80 | USB_QUIRK_CONFIG_INTF_STRINGS }, |
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index c34452a7304f..a68ff53124dc 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c | |||
| @@ -436,16 +436,21 @@ static int __devinit dwc3_probe(struct platform_device *pdev) | |||
| 436 | dev_err(dev, "missing IRQ\n"); | 436 | dev_err(dev, "missing IRQ\n"); |
| 437 | return -ENODEV; | 437 | return -ENODEV; |
| 438 | } | 438 | } |
| 439 | dwc->xhci_resources[1] = *res; | 439 | dwc->xhci_resources[1].start = res->start; |
| 440 | dwc->xhci_resources[1].end = res->end; | ||
| 441 | dwc->xhci_resources[1].flags = res->flags; | ||
| 442 | dwc->xhci_resources[1].name = res->name; | ||
| 440 | 443 | ||
| 441 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 444 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 442 | if (!res) { | 445 | if (!res) { |
| 443 | dev_err(dev, "missing memory resource\n"); | 446 | dev_err(dev, "missing memory resource\n"); |
| 444 | return -ENODEV; | 447 | return -ENODEV; |
| 445 | } | 448 | } |
| 446 | dwc->xhci_resources[0] = *res; | 449 | dwc->xhci_resources[0].start = res->start; |
| 447 | dwc->xhci_resources[0].end = dwc->xhci_resources[0].start + | 450 | dwc->xhci_resources[0].end = dwc->xhci_resources[0].start + |
| 448 | DWC3_XHCI_REGS_END; | 451 | DWC3_XHCI_REGS_END; |
| 452 | dwc->xhci_resources[0].flags = res->flags; | ||
| 453 | dwc->xhci_resources[0].name = res->name; | ||
| 449 | 454 | ||
| 450 | /* | 455 | /* |
| 451 | * Request memory region but exclude xHCI regs, | 456 | * Request memory region but exclude xHCI regs, |
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 9b94886b66e5..e4d5ca86b9da 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c | |||
| @@ -720,7 +720,6 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc, | |||
| 720 | transferred = min_t(u32, ur->length, | 720 | transferred = min_t(u32, ur->length, |
| 721 | transfer_size - length); | 721 | transfer_size - length); |
| 722 | memcpy(ur->buf, dwc->ep0_bounce, transferred); | 722 | memcpy(ur->buf, dwc->ep0_bounce, transferred); |
| 723 | dwc->ep0_bounced = false; | ||
| 724 | } else { | 723 | } else { |
| 725 | transferred = ur->length - length; | 724 | transferred = ur->length - length; |
| 726 | } | 725 | } |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 58fdfad96b4d..c2813c2b005a 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
| @@ -263,8 +263,11 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req, | |||
| 263 | if (req->request.status == -EINPROGRESS) | 263 | if (req->request.status == -EINPROGRESS) |
| 264 | req->request.status = status; | 264 | req->request.status = status; |
| 265 | 265 | ||
| 266 | usb_gadget_unmap_request(&dwc->gadget, &req->request, | 266 | if (dwc->ep0_bounced && dep->number == 0) |
| 267 | req->direction); | 267 | dwc->ep0_bounced = false; |
| 268 | else | ||
| 269 | usb_gadget_unmap_request(&dwc->gadget, &req->request, | ||
| 270 | req->direction); | ||
| 268 | 271 | ||
| 269 | dev_dbg(dwc->dev, "request %p from %s completed %d/%d ===> %d\n", | 272 | dev_dbg(dwc->dev, "request %p from %s completed %d/%d ===> %d\n", |
| 270 | req, dep->name, req->request.actual, | 273 | req, dep->name, req->request.actual, |
| @@ -1026,6 +1029,7 @@ static void __dwc3_gadget_start_isoc(struct dwc3 *dwc, | |||
| 1026 | if (list_empty(&dep->request_list)) { | 1029 | if (list_empty(&dep->request_list)) { |
| 1027 | dev_vdbg(dwc->dev, "ISOC ep %s run out for requests.\n", | 1030 | dev_vdbg(dwc->dev, "ISOC ep %s run out for requests.\n", |
| 1028 | dep->name); | 1031 | dep->name); |
| 1032 | dep->flags |= DWC3_EP_PENDING_REQUEST; | ||
| 1029 | return; | 1033 | return; |
| 1030 | } | 1034 | } |
| 1031 | 1035 | ||
| @@ -1089,6 +1093,17 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) | |||
| 1089 | if (dep->flags & DWC3_EP_PENDING_REQUEST) { | 1093 | if (dep->flags & DWC3_EP_PENDING_REQUEST) { |
| 1090 | int ret; | 1094 | int ret; |
| 1091 | 1095 | ||
| 1096 | /* | ||
| 1097 | * If xfernotready is already elapsed and it is a case | ||
| 1098 | * of isoc transfer, then issue END TRANSFER, so that | ||
| 1099 | * you can receive xfernotready again and can have | ||
| 1100 | * notion of current microframe. | ||
| 1101 | */ | ||
| 1102 | if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) { | ||
| 1103 | dwc3_stop_active_transfer(dwc, dep->number); | ||
| 1104 | return 0; | ||
| 1105 | } | ||
| 1106 | |||
| 1092 | ret = __dwc3_gadget_kick_transfer(dep, 0, true); | 1107 | ret = __dwc3_gadget_kick_transfer(dep, 0, true); |
| 1093 | if (ret && ret != -EBUSY) { | 1108 | if (ret && ret != -EBUSY) { |
| 1094 | struct dwc3 *dwc = dep->dwc; | 1109 | struct dwc3 *dwc = dep->dwc; |
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index c9e66dfb02e6..1e35963bd4ed 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
| @@ -475,8 +475,7 @@ static int at91_ep_enable(struct usb_ep *_ep, | |||
| 475 | unsigned long flags; | 475 | unsigned long flags; |
| 476 | 476 | ||
| 477 | if (!_ep || !ep | 477 | if (!_ep || !ep |
| 478 | || !desc || ep->ep.desc | 478 | || !desc || _ep->name == ep0name |
| 479 | || _ep->name == ep0name | ||
| 480 | || desc->bDescriptorType != USB_DT_ENDPOINT | 479 | || desc->bDescriptorType != USB_DT_ENDPOINT |
| 481 | || (maxpacket = usb_endpoint_maxp(desc)) == 0 | 480 | || (maxpacket = usb_endpoint_maxp(desc)) == 0 |
| 482 | || maxpacket > ep->maxpacket) { | 481 | || maxpacket > ep->maxpacket) { |
| @@ -530,7 +529,6 @@ ok: | |||
| 530 | tmp |= AT91_UDP_EPEDS; | 529 | tmp |= AT91_UDP_EPEDS; |
| 531 | __raw_writel(tmp, ep->creg); | 530 | __raw_writel(tmp, ep->creg); |
| 532 | 531 | ||
| 533 | ep->ep.desc = desc; | ||
| 534 | ep->ep.maxpacket = maxpacket; | 532 | ep->ep.maxpacket = maxpacket; |
| 535 | 533 | ||
| 536 | /* | 534 | /* |
| @@ -1635,7 +1633,6 @@ static int at91_start(struct usb_gadget *gadget, | |||
| 1635 | udc->driver = driver; | 1633 | udc->driver = driver; |
| 1636 | udc->gadget.dev.driver = &driver->driver; | 1634 | udc->gadget.dev.driver = &driver->driver; |
| 1637 | udc->gadget.dev.of_node = udc->pdev->dev.of_node; | 1635 | udc->gadget.dev.of_node = udc->pdev->dev.of_node; |
| 1638 | dev_set_drvdata(&udc->gadget.dev, &driver->driver); | ||
| 1639 | udc->enabled = 1; | 1636 | udc->enabled = 1; |
| 1640 | udc->selfpowered = 1; | 1637 | udc->selfpowered = 1; |
| 1641 | 1638 | ||
| @@ -1656,7 +1653,6 @@ static int at91_stop(struct usb_gadget *gadget, | |||
| 1656 | spin_unlock_irqrestore(&udc->lock, flags); | 1653 | spin_unlock_irqrestore(&udc->lock, flags); |
| 1657 | 1654 | ||
| 1658 | udc->gadget.dev.driver = NULL; | 1655 | udc->gadget.dev.driver = NULL; |
| 1659 | dev_set_drvdata(&udc->gadget.dev, NULL); | ||
| 1660 | udc->driver = NULL; | 1656 | udc->driver = NULL; |
| 1661 | 1657 | ||
| 1662 | DBG("unbound from %s\n", driver->driver.name); | 1658 | DBG("unbound from %s\n", driver->driver.name); |
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index b799106027ad..afdbb1cbf5d9 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c | |||
| @@ -1916,6 +1916,27 @@ done: | |||
| 1916 | return retval; | 1916 | return retval; |
| 1917 | } | 1917 | } |
| 1918 | 1918 | ||
| 1919 | /* usb 3.0 root hub device descriptor */ | ||
| 1920 | struct { | ||
| 1921 | struct usb_bos_descriptor bos; | ||
| 1922 | struct usb_ss_cap_descriptor ss_cap; | ||
| 1923 | } __packed usb3_bos_desc = { | ||
| 1924 | |||
| 1925 | .bos = { | ||
| 1926 | .bLength = USB_DT_BOS_SIZE, | ||
| 1927 | .bDescriptorType = USB_DT_BOS, | ||
| 1928 | .wTotalLength = cpu_to_le16(sizeof(usb3_bos_desc)), | ||
| 1929 | .bNumDeviceCaps = 1, | ||
| 1930 | }, | ||
| 1931 | .ss_cap = { | ||
| 1932 | .bLength = USB_DT_USB_SS_CAP_SIZE, | ||
| 1933 | .bDescriptorType = USB_DT_DEVICE_CAPABILITY, | ||
| 1934 | .bDevCapabilityType = USB_SS_CAP_TYPE, | ||
| 1935 | .wSpeedSupported = cpu_to_le16(USB_5GBPS_OPERATION), | ||
| 1936 | .bFunctionalitySupport = ilog2(USB_5GBPS_OPERATION), | ||
| 1937 | }, | ||
| 1938 | }; | ||
| 1939 | |||
| 1919 | static inline void | 1940 | static inline void |
| 1920 | ss_hub_descriptor(struct usb_hub_descriptor *desc) | 1941 | ss_hub_descriptor(struct usb_hub_descriptor *desc) |
| 1921 | { | 1942 | { |
| @@ -2006,6 +2027,18 @@ static int dummy_hub_control( | |||
| 2006 | else | 2027 | else |
| 2007 | hub_descriptor((struct usb_hub_descriptor *) buf); | 2028 | hub_descriptor((struct usb_hub_descriptor *) buf); |
| 2008 | break; | 2029 | break; |
| 2030 | |||
| 2031 | case DeviceRequest | USB_REQ_GET_DESCRIPTOR: | ||
| 2032 | if (hcd->speed != HCD_USB3) | ||
| 2033 | goto error; | ||
| 2034 | |||
| 2035 | if ((wValue >> 8) != USB_DT_BOS) | ||
| 2036 | goto error; | ||
| 2037 | |||
| 2038 | memcpy(buf, &usb3_bos_desc, sizeof(usb3_bos_desc)); | ||
| 2039 | retval = sizeof(usb3_bos_desc); | ||
| 2040 | break; | ||
| 2041 | |||
| 2009 | case GetHubStatus: | 2042 | case GetHubStatus: |
| 2010 | *(__le32 *) buf = cpu_to_le32(0); | 2043 | *(__le32 *) buf = cpu_to_le32(0); |
| 2011 | break; | 2044 | break; |
| @@ -2503,10 +2536,8 @@ static int dummy_hcd_probe(struct platform_device *pdev) | |||
| 2503 | hs_hcd->has_tt = 1; | 2536 | hs_hcd->has_tt = 1; |
| 2504 | 2537 | ||
| 2505 | retval = usb_add_hcd(hs_hcd, 0, 0); | 2538 | retval = usb_add_hcd(hs_hcd, 0, 0); |
| 2506 | if (retval != 0) { | 2539 | if (retval) |
| 2507 | usb_put_hcd(hs_hcd); | 2540 | goto put_usb2_hcd; |
| 2508 | return retval; | ||
| 2509 | } | ||
| 2510 | 2541 | ||
| 2511 | if (mod_data.is_super_speed) { | 2542 | if (mod_data.is_super_speed) { |
| 2512 | ss_hcd = usb_create_shared_hcd(&dummy_hcd, &pdev->dev, | 2543 | ss_hcd = usb_create_shared_hcd(&dummy_hcd, &pdev->dev, |
| @@ -2525,6 +2556,8 @@ static int dummy_hcd_probe(struct platform_device *pdev) | |||
| 2525 | put_usb3_hcd: | 2556 | put_usb3_hcd: |
| 2526 | usb_put_hcd(ss_hcd); | 2557 | usb_put_hcd(ss_hcd); |
| 2527 | dealloc_usb2_hcd: | 2558 | dealloc_usb2_hcd: |
| 2559 | usb_remove_hcd(hs_hcd); | ||
| 2560 | put_usb2_hcd: | ||
| 2528 | usb_put_hcd(hs_hcd); | 2561 | usb_put_hcd(hs_hcd); |
| 2529 | the_controller.hs_hcd = the_controller.ss_hcd = NULL; | 2562 | the_controller.hs_hcd = the_controller.ss_hcd = NULL; |
| 2530 | return retval; | 2563 | return retval; |
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 8adc79d1b402..829aba75a6df 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
| @@ -34,11 +34,15 @@ | |||
| 34 | /* Debugging ****************************************************************/ | 34 | /* Debugging ****************************************************************/ |
| 35 | 35 | ||
| 36 | #ifdef VERBOSE_DEBUG | 36 | #ifdef VERBOSE_DEBUG |
| 37 | #ifndef pr_vdebug | ||
| 37 | # define pr_vdebug pr_debug | 38 | # define pr_vdebug pr_debug |
| 39 | #endif /* pr_vdebug */ | ||
| 38 | # define ffs_dump_mem(prefix, ptr, len) \ | 40 | # define ffs_dump_mem(prefix, ptr, len) \ |
| 39 | print_hex_dump_bytes(pr_fmt(prefix ": "), DUMP_PREFIX_NONE, ptr, len) | 41 | print_hex_dump_bytes(pr_fmt(prefix ": "), DUMP_PREFIX_NONE, ptr, len) |
| 40 | #else | 42 | #else |
| 43 | #ifndef pr_vdebug | ||
| 41 | # define pr_vdebug(...) do { } while (0) | 44 | # define pr_vdebug(...) do { } while (0) |
| 45 | #endif /* pr_vdebug */ | ||
| 42 | # define ffs_dump_mem(prefix, ptr, len) do { } while (0) | 46 | # define ffs_dump_mem(prefix, ptr, len) do { } while (0) |
| 43 | #endif /* VERBOSE_DEBUG */ | 47 | #endif /* VERBOSE_DEBUG */ |
| 44 | 48 | ||
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index b13e0bb5f5b8..0bb617e1dda2 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
| @@ -3599,6 +3599,7 @@ static int __devinit s3c_hsotg_probe(struct platform_device *pdev) | |||
| 3599 | 3599 | ||
| 3600 | if (hsotg->num_of_eps == 0) { | 3600 | if (hsotg->num_of_eps == 0) { |
| 3601 | dev_err(dev, "wrong number of EPs (zero)\n"); | 3601 | dev_err(dev, "wrong number of EPs (zero)\n"); |
| 3602 | ret = -EINVAL; | ||
| 3602 | goto err_supplies; | 3603 | goto err_supplies; |
| 3603 | } | 3604 | } |
| 3604 | 3605 | ||
| @@ -3606,6 +3607,7 @@ static int __devinit s3c_hsotg_probe(struct platform_device *pdev) | |||
| 3606 | GFP_KERNEL); | 3607 | GFP_KERNEL); |
| 3607 | if (!eps) { | 3608 | if (!eps) { |
| 3608 | dev_err(dev, "cannot get memory\n"); | 3609 | dev_err(dev, "cannot get memory\n"); |
| 3610 | ret = -ENOMEM; | ||
| 3609 | goto err_supplies; | 3611 | goto err_supplies; |
| 3610 | } | 3612 | } |
| 3611 | 3613 | ||
| @@ -3622,6 +3624,7 @@ static int __devinit s3c_hsotg_probe(struct platform_device *pdev) | |||
| 3622 | GFP_KERNEL); | 3624 | GFP_KERNEL); |
| 3623 | if (!hsotg->ctrl_req) { | 3625 | if (!hsotg->ctrl_req) { |
| 3624 | dev_err(dev, "failed to allocate ctrl req\n"); | 3626 | dev_err(dev, "failed to allocate ctrl req\n"); |
| 3627 | ret = -ENOMEM; | ||
| 3625 | goto err_ep_mem; | 3628 | goto err_ep_mem; |
| 3626 | } | 3629 | } |
| 3627 | 3630 | ||
diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index 5b3f5fffea92..da6d479ff9a6 100644 --- a/drivers/usb/gadget/u_serial.c +++ b/drivers/usb/gadget/u_serial.c | |||
| @@ -132,11 +132,15 @@ static unsigned n_ports; | |||
| 132 | 132 | ||
| 133 | 133 | ||
| 134 | #ifdef VERBOSE_DEBUG | 134 | #ifdef VERBOSE_DEBUG |
| 135 | #ifndef pr_vdebug | ||
| 135 | #define pr_vdebug(fmt, arg...) \ | 136 | #define pr_vdebug(fmt, arg...) \ |
| 136 | pr_debug(fmt, ##arg) | 137 | pr_debug(fmt, ##arg) |
| 138 | #endif /* pr_vdebug */ | ||
| 137 | #else | 139 | #else |
| 140 | #ifndef pr_vdebig | ||
| 138 | #define pr_vdebug(fmt, arg...) \ | 141 | #define pr_vdebug(fmt, arg...) \ |
| 139 | ({ if (0) pr_debug(fmt, ##arg); }) | 142 | ({ if (0) pr_debug(fmt, ##arg); }) |
| 143 | #endif /* pr_vdebug */ | ||
| 140 | #endif | 144 | #endif |
| 141 | 145 | ||
| 142 | /*-------------------------------------------------------------------------*/ | 146 | /*-------------------------------------------------------------------------*/ |
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 9bc39ca460c8..4b66374bdc8e 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
| @@ -128,9 +128,17 @@ qh_refresh (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
| 128 | else { | 128 | else { |
| 129 | qtd = list_entry (qh->qtd_list.next, | 129 | qtd = list_entry (qh->qtd_list.next, |
| 130 | struct ehci_qtd, qtd_list); | 130 | struct ehci_qtd, qtd_list); |
| 131 | /* first qtd may already be partially processed */ | 131 | /* |
| 132 | if (cpu_to_hc32(ehci, qtd->qtd_dma) == qh->hw->hw_current) | 132 | * first qtd may already be partially processed. |
| 133 | * If we come here during unlink, the QH overlay region | ||
| 134 | * might have reference to the just unlinked qtd. The | ||
| 135 | * qtd is updated in qh_completions(). Update the QH | ||
| 136 | * overlay here. | ||
| 137 | */ | ||
| 138 | if (cpu_to_hc32(ehci, qtd->qtd_dma) == qh->hw->hw_current) { | ||
| 139 | qh->hw->hw_qtd_next = qtd->hw_next; | ||
| 133 | qtd = NULL; | 140 | qtd = NULL; |
| 141 | } | ||
| 134 | } | 142 | } |
| 135 | 143 | ||
| 136 | if (qtd) | 144 | if (qtd) |
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index a665b3eaa746..aaa8d2bce217 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
| @@ -570,6 +570,16 @@ static int __devinit ohci_hcd_at91_drv_probe(struct platform_device *pdev) | |||
| 570 | 570 | ||
| 571 | if (pdata) { | 571 | if (pdata) { |
| 572 | at91_for_each_port(i) { | 572 | at91_for_each_port(i) { |
| 573 | /* | ||
| 574 | * do not configure PIO if not in relation with | ||
| 575 | * real USB port on board | ||
| 576 | */ | ||
| 577 | if (i >= pdata->ports) { | ||
| 578 | pdata->vbus_pin[i] = -EINVAL; | ||
| 579 | pdata->overcurrent_pin[i] = -EINVAL; | ||
| 580 | break; | ||
| 581 | } | ||
| 582 | |||
| 573 | if (!gpio_is_valid(pdata->vbus_pin[i])) | 583 | if (!gpio_is_valid(pdata->vbus_pin[i])) |
| 574 | continue; | 584 | continue; |
| 575 | gpio = pdata->vbus_pin[i]; | 585 | gpio = pdata->vbus_pin[i]; |
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index c5e9e4a76f14..966d1484ee79 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c | |||
| @@ -75,7 +75,9 @@ | |||
| 75 | #define NB_PIF0_PWRDOWN_1 0x01100013 | 75 | #define NB_PIF0_PWRDOWN_1 0x01100013 |
| 76 | 76 | ||
| 77 | #define USB_INTEL_XUSB2PR 0xD0 | 77 | #define USB_INTEL_XUSB2PR 0xD0 |
| 78 | #define USB_INTEL_USB2PRM 0xD4 | ||
| 78 | #define USB_INTEL_USB3_PSSEN 0xD8 | 79 | #define USB_INTEL_USB3_PSSEN 0xD8 |
| 80 | #define USB_INTEL_USB3PRM 0xDC | ||
| 79 | 81 | ||
| 80 | static struct amd_chipset_info { | 82 | static struct amd_chipset_info { |
| 81 | struct pci_dev *nb_dev; | 83 | struct pci_dev *nb_dev; |
| @@ -772,10 +774,18 @@ void usb_enable_xhci_ports(struct pci_dev *xhci_pdev) | |||
| 772 | return; | 774 | return; |
| 773 | } | 775 | } |
| 774 | 776 | ||
| 775 | ports_available = 0xffffffff; | 777 | /* Read USB3PRM, the USB 3.0 Port Routing Mask Register |
| 778 | * Indicate the ports that can be changed from OS. | ||
| 779 | */ | ||
| 780 | pci_read_config_dword(xhci_pdev, USB_INTEL_USB3PRM, | ||
| 781 | &ports_available); | ||
| 782 | |||
| 783 | dev_dbg(&xhci_pdev->dev, "Configurable ports to enable SuperSpeed: 0x%x\n", | ||
| 784 | ports_available); | ||
| 785 | |||
| 776 | /* Write USB3_PSSEN, the USB 3.0 Port SuperSpeed Enable | 786 | /* Write USB3_PSSEN, the USB 3.0 Port SuperSpeed Enable |
| 777 | * Register, to turn on SuperSpeed terminations for all | 787 | * Register, to turn on SuperSpeed terminations for the |
| 778 | * available ports. | 788 | * switchable ports. |
| 779 | */ | 789 | */ |
| 780 | pci_write_config_dword(xhci_pdev, USB_INTEL_USB3_PSSEN, | 790 | pci_write_config_dword(xhci_pdev, USB_INTEL_USB3_PSSEN, |
| 781 | cpu_to_le32(ports_available)); | 791 | cpu_to_le32(ports_available)); |
| @@ -785,7 +795,16 @@ void usb_enable_xhci_ports(struct pci_dev *xhci_pdev) | |||
| 785 | dev_dbg(&xhci_pdev->dev, "USB 3.0 ports that are now enabled " | 795 | dev_dbg(&xhci_pdev->dev, "USB 3.0 ports that are now enabled " |
| 786 | "under xHCI: 0x%x\n", ports_available); | 796 | "under xHCI: 0x%x\n", ports_available); |
| 787 | 797 | ||
| 788 | ports_available = 0xffffffff; | 798 | /* Read XUSB2PRM, xHCI USB 2.0 Port Routing Mask Register |
| 799 | * Indicate the USB 2.0 ports to be controlled by the xHCI host. | ||
| 800 | */ | ||
| 801 | |||
| 802 | pci_read_config_dword(xhci_pdev, USB_INTEL_USB2PRM, | ||
| 803 | &ports_available); | ||
| 804 | |||
| 805 | dev_dbg(&xhci_pdev->dev, "Configurable USB 2.0 ports to hand over to xCHI: 0x%x\n", | ||
| 806 | ports_available); | ||
| 807 | |||
| 789 | /* Write XUSB2PR, the xHC USB 2.0 Port Routing Register, to | 808 | /* Write XUSB2PR, the xHC USB 2.0 Port Routing Register, to |
| 790 | * switch the USB 2.0 power and data lines over to the xHCI | 809 | * switch the USB 2.0 power and data lines over to the xHCI |
| 791 | * host. | 810 | * host. |
| @@ -822,12 +841,12 @@ static void __devinit quirk_usb_handoff_xhci(struct pci_dev *pdev) | |||
| 822 | void __iomem *op_reg_base; | 841 | void __iomem *op_reg_base; |
| 823 | u32 val; | 842 | u32 val; |
| 824 | int timeout; | 843 | int timeout; |
| 844 | int len = pci_resource_len(pdev, 0); | ||
| 825 | 845 | ||
| 826 | if (!mmio_resource_enabled(pdev, 0)) | 846 | if (!mmio_resource_enabled(pdev, 0)) |
| 827 | return; | 847 | return; |
| 828 | 848 | ||
| 829 | base = ioremap_nocache(pci_resource_start(pdev, 0), | 849 | base = ioremap_nocache(pci_resource_start(pdev, 0), len); |
| 830 | pci_resource_len(pdev, 0)); | ||
| 831 | if (base == NULL) | 850 | if (base == NULL) |
| 832 | return; | 851 | return; |
| 833 | 852 | ||
| @@ -837,9 +856,17 @@ static void __devinit quirk_usb_handoff_xhci(struct pci_dev *pdev) | |||
| 837 | */ | 856 | */ |
| 838 | ext_cap_offset = xhci_find_next_cap_offset(base, XHCI_HCC_PARAMS_OFFSET); | 857 | ext_cap_offset = xhci_find_next_cap_offset(base, XHCI_HCC_PARAMS_OFFSET); |
| 839 | do { | 858 | do { |
| 859 | if ((ext_cap_offset + sizeof(val)) > len) { | ||
| 860 | /* We're reading garbage from the controller */ | ||
| 861 | dev_warn(&pdev->dev, | ||
| 862 | "xHCI controller failing to respond"); | ||
| 863 | return; | ||
| 864 | } | ||
| 865 | |||
| 840 | if (!ext_cap_offset) | 866 | if (!ext_cap_offset) |
| 841 | /* We've reached the end of the extended capabilities */ | 867 | /* We've reached the end of the extended capabilities */ |
| 842 | goto hc_init; | 868 | goto hc_init; |
| 869 | |||
| 843 | val = readl(base + ext_cap_offset); | 870 | val = readl(base + ext_cap_offset); |
| 844 | if (XHCI_EXT_CAPS_ID(val) == XHCI_EXT_CAPS_LEGACY) | 871 | if (XHCI_EXT_CAPS_ID(val) == XHCI_EXT_CAPS_LEGACY) |
| 845 | break; | 872 | break; |
| @@ -870,9 +897,10 @@ static void __devinit quirk_usb_handoff_xhci(struct pci_dev *pdev) | |||
| 870 | /* Disable any BIOS SMIs and clear all SMI events*/ | 897 | /* Disable any BIOS SMIs and clear all SMI events*/ |
| 871 | writel(val, base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET); | 898 | writel(val, base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET); |
| 872 | 899 | ||
| 900 | hc_init: | ||
| 873 | if (usb_is_intel_switchable_xhci(pdev)) | 901 | if (usb_is_intel_switchable_xhci(pdev)) |
| 874 | usb_enable_xhci_ports(pdev); | 902 | usb_enable_xhci_ports(pdev); |
| 875 | hc_init: | 903 | |
| 876 | op_reg_base = base + XHCI_HC_LENGTH(readl(base)); | 904 | op_reg_base = base + XHCI_HC_LENGTH(readl(base)); |
| 877 | 905 | ||
| 878 | /* Wait for the host controller to be ready before writing any | 906 | /* Wait for the host controller to be ready before writing any |
diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h index ef004a5de20f..7f69a39163ce 100644 --- a/drivers/usb/host/pci-quirks.h +++ b/drivers/usb/host/pci-quirks.h | |||
| @@ -15,6 +15,7 @@ void usb_disable_xhci_ports(struct pci_dev *xhci_pdev); | |||
| 15 | static inline void usb_amd_quirk_pll_disable(void) {} | 15 | static inline void usb_amd_quirk_pll_disable(void) {} |
| 16 | static inline void usb_amd_quirk_pll_enable(void) {} | 16 | static inline void usb_amd_quirk_pll_enable(void) {} |
| 17 | static inline void usb_amd_dev_put(void) {} | 17 | static inline void usb_amd_dev_put(void) {} |
| 18 | static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {} | ||
| 18 | #endif /* CONFIG_PCI */ | 19 | #endif /* CONFIG_PCI */ |
| 19 | 20 | ||
| 20 | #endif /* __LINUX_USB_PCI_QUIRKS_H */ | 21 | #endif /* __LINUX_USB_PCI_QUIRKS_H */ |
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 74bfc868b7ad..d5eb357aa5c4 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
| @@ -493,11 +493,48 @@ static void xhci_hub_report_link_state(u32 *status, u32 status_reg) | |||
| 493 | * when this bit is set. | 493 | * when this bit is set. |
| 494 | */ | 494 | */ |
| 495 | pls |= USB_PORT_STAT_CONNECTION; | 495 | pls |= USB_PORT_STAT_CONNECTION; |
| 496 | } else { | ||
| 497 | /* | ||
| 498 | * If CAS bit isn't set but the Port is already at | ||
| 499 | * Compliance Mode, fake a connection so the USB core | ||
| 500 | * notices the Compliance state and resets the port. | ||
| 501 | * This resolves an issue generated by the SN65LVPE502CP | ||
| 502 | * in which sometimes the port enters compliance mode | ||
| 503 | * caused by a delay on the host-device negotiation. | ||
| 504 | */ | ||
| 505 | if (pls == USB_SS_PORT_LS_COMP_MOD) | ||
| 506 | pls |= USB_PORT_STAT_CONNECTION; | ||
| 496 | } | 507 | } |
| 508 | |||
| 497 | /* update status field */ | 509 | /* update status field */ |
| 498 | *status |= pls; | 510 | *status |= pls; |
| 499 | } | 511 | } |
| 500 | 512 | ||
| 513 | /* | ||
| 514 | * Function for Compliance Mode Quirk. | ||
| 515 | * | ||
| 516 | * This Function verifies if all xhc USB3 ports have entered U0, if so, | ||
| 517 | * the compliance mode timer is deleted. A port won't enter | ||
| 518 | * compliance mode if it has previously entered U0. | ||
| 519 | */ | ||
| 520 | void xhci_del_comp_mod_timer(struct xhci_hcd *xhci, u32 status, u16 wIndex) | ||
| 521 | { | ||
| 522 | u32 all_ports_seen_u0 = ((1 << xhci->num_usb3_ports)-1); | ||
| 523 | bool port_in_u0 = ((status & PORT_PLS_MASK) == XDEV_U0); | ||
| 524 | |||
| 525 | if (!(xhci->quirks & XHCI_COMP_MODE_QUIRK)) | ||
| 526 | return; | ||
| 527 | |||
| 528 | if ((xhci->port_status_u0 != all_ports_seen_u0) && port_in_u0) { | ||
| 529 | xhci->port_status_u0 |= 1 << wIndex; | ||
| 530 | if (xhci->port_status_u0 == all_ports_seen_u0) { | ||
| 531 | del_timer_sync(&xhci->comp_mode_recovery_timer); | ||
| 532 | xhci_dbg(xhci, "All USB3 ports have entered U0 already!\n"); | ||
| 533 | xhci_dbg(xhci, "Compliance Mode Recovery Timer Deleted.\n"); | ||
| 534 | } | ||
| 535 | } | ||
| 536 | } | ||
| 537 | |||
| 501 | int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | 538 | int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, |
| 502 | u16 wIndex, char *buf, u16 wLength) | 539 | u16 wIndex, char *buf, u16 wLength) |
| 503 | { | 540 | { |
| @@ -651,6 +688,11 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
| 651 | /* Update Port Link State for super speed ports*/ | 688 | /* Update Port Link State for super speed ports*/ |
| 652 | if (hcd->speed == HCD_USB3) { | 689 | if (hcd->speed == HCD_USB3) { |
| 653 | xhci_hub_report_link_state(&status, temp); | 690 | xhci_hub_report_link_state(&status, temp); |
| 691 | /* | ||
| 692 | * Verify if all USB3 Ports Have entered U0 already. | ||
| 693 | * Delete Compliance Mode Timer if so. | ||
| 694 | */ | ||
| 695 | xhci_del_comp_mod_timer(xhci, temp, wIndex); | ||
| 654 | } | 696 | } |
| 655 | if (bus_state->port_c_suspend & (1 << wIndex)) | 697 | if (bus_state->port_c_suspend & (1 << wIndex)) |
| 656 | status |= 1 << USB_PORT_FEAT_C_SUSPEND; | 698 | status |= 1 << USB_PORT_FEAT_C_SUSPEND; |
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 689bc18b051d..df90fe51b4aa 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c | |||
| @@ -118,7 +118,7 @@ static int xhci_plat_probe(struct platform_device *pdev) | |||
| 118 | goto put_hcd; | 118 | goto put_hcd; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); | 121 | hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len); |
| 122 | if (!hcd->regs) { | 122 | if (!hcd->regs) { |
| 123 | dev_dbg(&pdev->dev, "error mapping memory\n"); | 123 | dev_dbg(&pdev->dev, "error mapping memory\n"); |
| 124 | ret = -EFAULT; | 124 | ret = -EFAULT; |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index c59d5b5b6c7d..6ece0ed288d4 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
| 27 | #include <linux/moduleparam.h> | 27 | #include <linux/moduleparam.h> |
| 28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
| 29 | #include <linux/dmi.h> | ||
| 29 | 30 | ||
| 30 | #include "xhci.h" | 31 | #include "xhci.h" |
| 31 | 32 | ||
| @@ -398,6 +399,95 @@ static void xhci_msix_sync_irqs(struct xhci_hcd *xhci) | |||
| 398 | 399 | ||
| 399 | #endif | 400 | #endif |
| 400 | 401 | ||
| 402 | static void compliance_mode_recovery(unsigned long arg) | ||
| 403 | { | ||
| 404 | struct xhci_hcd *xhci; | ||
| 405 | struct usb_hcd *hcd; | ||
| 406 | u32 temp; | ||
| 407 | int i; | ||
| 408 | |||
| 409 | xhci = (struct xhci_hcd *)arg; | ||
| 410 | |||
| 411 | for (i = 0; i < xhci->num_usb3_ports; i++) { | ||
| 412 | temp = xhci_readl(xhci, xhci->usb3_ports[i]); | ||
| 413 | if ((temp & PORT_PLS_MASK) == USB_SS_PORT_LS_COMP_MOD) { | ||
| 414 | /* | ||
| 415 | * Compliance Mode Detected. Letting USB Core | ||
| 416 | * handle the Warm Reset | ||
| 417 | */ | ||
| 418 | xhci_dbg(xhci, "Compliance Mode Detected->Port %d!\n", | ||
| 419 | i + 1); | ||
| 420 | xhci_dbg(xhci, "Attempting Recovery routine!\n"); | ||
| 421 | hcd = xhci->shared_hcd; | ||
| 422 | |||
| 423 | if (hcd->state == HC_STATE_SUSPENDED) | ||
| 424 | usb_hcd_resume_root_hub(hcd); | ||
| 425 | |||
| 426 | usb_hcd_poll_rh_status(hcd); | ||
| 427 | } | ||
| 428 | } | ||
| 429 | |||
| 430 | if (xhci->port_status_u0 != ((1 << xhci->num_usb3_ports)-1)) | ||
| 431 | mod_timer(&xhci->comp_mode_recovery_timer, | ||
| 432 | jiffies + msecs_to_jiffies(COMP_MODE_RCVRY_MSECS)); | ||
| 433 | } | ||
| 434 | |||
| 435 | /* | ||
| 436 | * Quirk to work around issue generated by the SN65LVPE502CP USB3.0 re-driver | ||
| 437 | * that causes ports behind that hardware to enter compliance mode sometimes. | ||
| 438 | * The quirk creates a timer that polls every 2 seconds the link state of | ||
| 439 | * each host controller's port and recovers it by issuing a Warm reset | ||
| 440 | * if Compliance mode is detected, otherwise the port will become "dead" (no | ||
| 441 | * device connections or disconnections will be detected anymore). Becasue no | ||
| 442 | * status event is generated when entering compliance mode (per xhci spec), | ||
| 443 | * this quirk is needed on systems that have the failing hardware installed. | ||
| 444 | */ | ||
| 445 | static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci) | ||
| 446 | { | ||
| 447 | xhci->port_status_u0 = 0; | ||
| 448 | init_timer(&xhci->comp_mode_recovery_timer); | ||
| 449 | |||
| 450 | xhci->comp_mode_recovery_timer.data = (unsigned long) xhci; | ||
| 451 | xhci->comp_mode_recovery_timer.function = compliance_mode_recovery; | ||
| 452 | xhci->comp_mode_recovery_timer.expires = jiffies + | ||
| 453 | msecs_to_jiffies(COMP_MODE_RCVRY_MSECS); | ||
| 454 | |||
| 455 | set_timer_slack(&xhci->comp_mode_recovery_timer, | ||
| 456 | msecs_to_jiffies(COMP_MODE_RCVRY_MSECS)); | ||
| 457 | add_timer(&xhci->comp_mode_recovery_timer); | ||
| 458 | xhci_dbg(xhci, "Compliance Mode Recovery Timer Initialized.\n"); | ||
| 459 | } | ||
| 460 | |||
| 461 | /* | ||
| 462 | * This function identifies the systems that have installed the SN65LVPE502CP | ||
| 463 | * USB3.0 re-driver and that need the Compliance Mode Quirk. | ||
| 464 | * Systems: | ||
| 465 | * Vendor: Hewlett-Packard -> System Models: Z420, Z620 and Z820 | ||
| 466 | */ | ||
| 467 | static bool compliance_mode_recovery_timer_quirk_check(void) | ||
| 468 | { | ||
| 469 | const char *dmi_product_name, *dmi_sys_vendor; | ||
| 470 | |||
| 471 | dmi_product_name = dmi_get_system_info(DMI_PRODUCT_NAME); | ||
| 472 | dmi_sys_vendor = dmi_get_system_info(DMI_SYS_VENDOR); | ||
| 473 | |||
| 474 | if (!(strstr(dmi_sys_vendor, "Hewlett-Packard"))) | ||
| 475 | return false; | ||
| 476 | |||
| 477 | if (strstr(dmi_product_name, "Z420") || | ||
| 478 | strstr(dmi_product_name, "Z620") || | ||
| 479 | strstr(dmi_product_name, "Z820")) | ||
| 480 | return true; | ||
| 481 | |||
| 482 | return false; | ||
| 483 | } | ||
| 484 | |||
| 485 | static int xhci_all_ports_seen_u0(struct xhci_hcd *xhci) | ||
| 486 | { | ||
| 487 | return (xhci->port_status_u0 == ((1 << xhci->num_usb3_ports)-1)); | ||
| 488 | } | ||
| 489 | |||
| 490 | |||
| 401 | /* | 491 | /* |
| 402 | * Initialize memory for HCD and xHC (one-time init). | 492 | * Initialize memory for HCD and xHC (one-time init). |
| 403 | * | 493 | * |
| @@ -421,6 +511,12 @@ int xhci_init(struct usb_hcd *hcd) | |||
| 421 | retval = xhci_mem_init(xhci, GFP_KERNEL); | 511 | retval = xhci_mem_init(xhci, GFP_KERNEL); |
| 422 | xhci_dbg(xhci, "Finished xhci_init\n"); | 512 | xhci_dbg(xhci, "Finished xhci_init\n"); |
| 423 | 513 | ||
| 514 | /* Initializing Compliance Mode Recovery Data If Needed */ | ||
| 515 | if (compliance_mode_recovery_timer_quirk_check()) { | ||
| 516 | xhci->quirks |= XHCI_COMP_MODE_QUIRK; | ||
| 517 | compliance_mode_recovery_timer_init(xhci); | ||
| 518 | } | ||
| 519 | |||
| 424 | return retval; | 520 | return retval; |
| 425 | } | 521 | } |
| 426 | 522 | ||
| @@ -629,6 +725,11 @@ void xhci_stop(struct usb_hcd *hcd) | |||
| 629 | del_timer_sync(&xhci->event_ring_timer); | 725 | del_timer_sync(&xhci->event_ring_timer); |
| 630 | #endif | 726 | #endif |
| 631 | 727 | ||
| 728 | /* Deleting Compliance Mode Recovery Timer */ | ||
| 729 | if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && | ||
| 730 | (!(xhci_all_ports_seen_u0(xhci)))) | ||
| 731 | del_timer_sync(&xhci->comp_mode_recovery_timer); | ||
| 732 | |||
| 632 | if (xhci->quirks & XHCI_AMD_PLL_FIX) | 733 | if (xhci->quirks & XHCI_AMD_PLL_FIX) |
| 633 | usb_amd_dev_put(); | 734 | usb_amd_dev_put(); |
| 634 | 735 | ||
| @@ -659,7 +760,7 @@ void xhci_shutdown(struct usb_hcd *hcd) | |||
| 659 | { | 760 | { |
| 660 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | 761 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); |
| 661 | 762 | ||
| 662 | if (xhci->quirks && XHCI_SPURIOUS_REBOOT) | 763 | if (xhci->quirks & XHCI_SPURIOUS_REBOOT) |
| 663 | usb_disable_xhci_ports(to_pci_dev(hcd->self.controller)); | 764 | usb_disable_xhci_ports(to_pci_dev(hcd->self.controller)); |
| 664 | 765 | ||
| 665 | spin_lock_irq(&xhci->lock); | 766 | spin_lock_irq(&xhci->lock); |
| @@ -806,6 +907,16 @@ int xhci_suspend(struct xhci_hcd *xhci) | |||
| 806 | } | 907 | } |
| 807 | spin_unlock_irq(&xhci->lock); | 908 | spin_unlock_irq(&xhci->lock); |
| 808 | 909 | ||
| 910 | /* | ||
| 911 | * Deleting Compliance Mode Recovery Timer because the xHCI Host | ||
| 912 | * is about to be suspended. | ||
| 913 | */ | ||
| 914 | if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && | ||
| 915 | (!(xhci_all_ports_seen_u0(xhci)))) { | ||
| 916 | del_timer_sync(&xhci->comp_mode_recovery_timer); | ||
| 917 | xhci_dbg(xhci, "Compliance Mode Recovery Timer Deleted!\n"); | ||
| 918 | } | ||
| 919 | |||
| 809 | /* step 5: remove core well power */ | 920 | /* step 5: remove core well power */ |
| 810 | /* synchronize irq when using MSI-X */ | 921 | /* synchronize irq when using MSI-X */ |
| 811 | xhci_msix_sync_irqs(xhci); | 922 | xhci_msix_sync_irqs(xhci); |
| @@ -938,6 +1049,16 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
| 938 | usb_hcd_resume_root_hub(hcd); | 1049 | usb_hcd_resume_root_hub(hcd); |
| 939 | usb_hcd_resume_root_hub(xhci->shared_hcd); | 1050 | usb_hcd_resume_root_hub(xhci->shared_hcd); |
| 940 | } | 1051 | } |
| 1052 | |||
| 1053 | /* | ||
| 1054 | * If system is subject to the Quirk, Compliance Mode Timer needs to | ||
| 1055 | * be re-initialized Always after a system resume. Ports are subject | ||
| 1056 | * to suffer the Compliance Mode issue again. It doesn't matter if | ||
| 1057 | * ports have entered previously to U0 before system's suspension. | ||
| 1058 | */ | ||
| 1059 | if (xhci->quirks & XHCI_COMP_MODE_QUIRK) | ||
| 1060 | compliance_mode_recovery_timer_init(xhci); | ||
| 1061 | |||
| 941 | return retval; | 1062 | return retval; |
| 942 | } | 1063 | } |
| 943 | #endif /* CONFIG_PM */ | 1064 | #endif /* CONFIG_PM */ |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index c713256297ac..1a05908c6673 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
| @@ -1495,6 +1495,7 @@ struct xhci_hcd { | |||
| 1495 | #define XHCI_LPM_SUPPORT (1 << 11) | 1495 | #define XHCI_LPM_SUPPORT (1 << 11) |
| 1496 | #define XHCI_INTEL_HOST (1 << 12) | 1496 | #define XHCI_INTEL_HOST (1 << 12) |
| 1497 | #define XHCI_SPURIOUS_REBOOT (1 << 13) | 1497 | #define XHCI_SPURIOUS_REBOOT (1 << 13) |
| 1498 | #define XHCI_COMP_MODE_QUIRK (1 << 14) | ||
| 1498 | unsigned int num_active_eps; | 1499 | unsigned int num_active_eps; |
| 1499 | unsigned int limit_active_eps; | 1500 | unsigned int limit_active_eps; |
| 1500 | /* There are two roothubs to keep track of bus suspend info for */ | 1501 | /* There are two roothubs to keep track of bus suspend info for */ |
| @@ -1511,6 +1512,11 @@ struct xhci_hcd { | |||
| 1511 | unsigned sw_lpm_support:1; | 1512 | unsigned sw_lpm_support:1; |
| 1512 | /* support xHCI 1.0 spec USB2 hardware LPM */ | 1513 | /* support xHCI 1.0 spec USB2 hardware LPM */ |
| 1513 | unsigned hw_lpm_support:1; | 1514 | unsigned hw_lpm_support:1; |
| 1515 | /* Compliance Mode Recovery Data */ | ||
| 1516 | struct timer_list comp_mode_recovery_timer; | ||
| 1517 | u32 port_status_u0; | ||
| 1518 | /* Compliance Mode Timer Triggered every 2 seconds */ | ||
| 1519 | #define COMP_MODE_RCVRY_MSECS 2000 | ||
| 1514 | }; | 1520 | }; |
| 1515 | 1521 | ||
| 1516 | /* convert between an HCD pointer and the corresponding EHCI_HCD */ | 1522 | /* convert between an HCD pointer and the corresponding EHCI_HCD */ |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 4bb717d0bd41..1ae378d5fc6f 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
| @@ -2049,7 +2049,7 @@ static int musb_urb_enqueue( | |||
| 2049 | * we only have work to do in the former case. | 2049 | * we only have work to do in the former case. |
| 2050 | */ | 2050 | */ |
| 2051 | spin_lock_irqsave(&musb->lock, flags); | 2051 | spin_lock_irqsave(&musb->lock, flags); |
| 2052 | if (hep->hcpriv) { | 2052 | if (hep->hcpriv || !next_urb(qh)) { |
| 2053 | /* some concurrent activity submitted another urb to hep... | 2053 | /* some concurrent activity submitted another urb to hep... |
| 2054 | * odd, rare, error prone, but legal. | 2054 | * odd, rare, error prone, but legal. |
| 2055 | */ | 2055 | */ |
diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c index 57a608584e16..c1be687e00ec 100644 --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c | |||
| @@ -388,7 +388,7 @@ dma_controller_create(struct musb *musb, void __iomem *base) | |||
| 388 | struct platform_device *pdev = to_platform_device(dev); | 388 | struct platform_device *pdev = to_platform_device(dev); |
| 389 | int irq = platform_get_irq_byname(pdev, "dma"); | 389 | int irq = platform_get_irq_byname(pdev, "dma"); |
| 390 | 390 | ||
| 391 | if (irq == 0) { | 391 | if (irq <= 0) { |
| 392 | dev_err(dev, "No DMA interrupt line!\n"); | 392 | dev_err(dev, "No DMA interrupt line!\n"); |
| 393 | return NULL; | 393 | return NULL; |
| 394 | } | 394 | } |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 1a1bd9cf40c5..341625442377 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
| @@ -1215,7 +1215,7 @@ static int __devinit tusb_probe(struct platform_device *pdev) | |||
| 1215 | ret = platform_device_add(musb); | 1215 | ret = platform_device_add(musb); |
| 1216 | if (ret) { | 1216 | if (ret) { |
| 1217 | dev_err(&pdev->dev, "failed to register musb device\n"); | 1217 | dev_err(&pdev->dev, "failed to register musb device\n"); |
| 1218 | goto err1; | 1218 | goto err2; |
| 1219 | } | 1219 | } |
| 1220 | 1220 | ||
| 1221 | return 0; | 1221 | return 0; |
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index ecd173032fd4..143c4e9e1be4 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c | |||
| @@ -818,7 +818,7 @@ static int usbhsf_dma_prepare_push(struct usbhs_pkt *pkt, int *is_done) | |||
| 818 | usbhs_pipe_is_dcp(pipe)) | 818 | usbhs_pipe_is_dcp(pipe)) |
| 819 | goto usbhsf_pio_prepare_push; | 819 | goto usbhsf_pio_prepare_push; |
| 820 | 820 | ||
| 821 | if (len % 4) /* 32bit alignment */ | 821 | if (len & 0x7) /* 8byte alignment */ |
| 822 | goto usbhsf_pio_prepare_push; | 822 | goto usbhsf_pio_prepare_push; |
| 823 | 823 | ||
| 824 | if ((uintptr_t)(pkt->buf + pkt->actual) & 0x7) /* 8byte alignment */ | 824 | if ((uintptr_t)(pkt->buf + pkt->actual) & 0x7) /* 8byte alignment */ |
| @@ -905,7 +905,7 @@ static int usbhsf_dma_try_pop(struct usbhs_pkt *pkt, int *is_done) | |||
| 905 | /* use PIO if packet is less than pio_dma_border */ | 905 | /* use PIO if packet is less than pio_dma_border */ |
| 906 | len = usbhsf_fifo_rcv_len(priv, fifo); | 906 | len = usbhsf_fifo_rcv_len(priv, fifo); |
| 907 | len = min(pkt->length - pkt->actual, len); | 907 | len = min(pkt->length - pkt->actual, len); |
| 908 | if (len % 4) /* 32bit alignment */ | 908 | if (len & 0x7) /* 8byte alignment */ |
| 909 | goto usbhsf_pio_prepare_pop_unselect; | 909 | goto usbhsf_pio_prepare_pop_unselect; |
| 910 | 910 | ||
| 911 | if (len < usbhs_get_dparam(priv, pio_dma_border)) | 911 | if (len < usbhs_get_dparam(priv, pio_dma_border)) |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 5620db6469e5..f906b3aec217 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
| @@ -704,6 +704,7 @@ static struct usb_device_id id_table_combined [] = { | |||
| 704 | { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, | 704 | { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, |
| 705 | { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, | 705 | { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, |
| 706 | { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, | 706 | { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, |
| 707 | { USB_DEVICE(FTDI_VID, FTDI_NZR_SEM_USB_PID) }, | ||
| 707 | { USB_DEVICE(ICOM_VID, ICOM_ID_1_PID) }, | 708 | { USB_DEVICE(ICOM_VID, ICOM_ID_1_PID) }, |
| 708 | { USB_DEVICE(ICOM_VID, ICOM_OPC_U_UC_PID) }, | 709 | { USB_DEVICE(ICOM_VID, ICOM_OPC_U_UC_PID) }, |
| 709 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C1_PID) }, | 710 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C1_PID) }, |
| @@ -804,13 +805,32 @@ static struct usb_device_id id_table_combined [] = { | |||
| 804 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 805 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
| 805 | { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID), | 806 | { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID), |
| 806 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 807 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
| 807 | { USB_DEVICE(MICROCHIP_VID, MICROCHIP_USB_BOARD_PID) }, | 808 | { USB_DEVICE_AND_INTERFACE_INFO(MICROCHIP_VID, MICROCHIP_USB_BOARD_PID, |
| 809 | USB_CLASS_VENDOR_SPEC, | ||
| 810 | USB_SUBCLASS_VENDOR_SPEC, 0x00) }, | ||
| 808 | { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, | 811 | { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, |
| 809 | { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), | 812 | { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), |
| 810 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 813 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
| 811 | { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, | 814 | { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, |
| 812 | { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) }, | 815 | { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) }, |
| 816 | { USB_DEVICE(FTDI_VID, PI_C865_PID) }, | ||
| 817 | { USB_DEVICE(FTDI_VID, PI_C857_PID) }, | ||
| 818 | { USB_DEVICE(PI_VID, PI_C866_PID) }, | ||
| 819 | { USB_DEVICE(PI_VID, PI_C663_PID) }, | ||
| 820 | { USB_DEVICE(PI_VID, PI_C725_PID) }, | ||
| 821 | { USB_DEVICE(PI_VID, PI_E517_PID) }, | ||
| 822 | { USB_DEVICE(PI_VID, PI_C863_PID) }, | ||
| 813 | { USB_DEVICE(PI_VID, PI_E861_PID) }, | 823 | { USB_DEVICE(PI_VID, PI_E861_PID) }, |
| 824 | { USB_DEVICE(PI_VID, PI_C867_PID) }, | ||
| 825 | { USB_DEVICE(PI_VID, PI_E609_PID) }, | ||
| 826 | { USB_DEVICE(PI_VID, PI_E709_PID) }, | ||
| 827 | { USB_DEVICE(PI_VID, PI_100F_PID) }, | ||
| 828 | { USB_DEVICE(PI_VID, PI_1011_PID) }, | ||
| 829 | { USB_DEVICE(PI_VID, PI_1012_PID) }, | ||
| 830 | { USB_DEVICE(PI_VID, PI_1013_PID) }, | ||
| 831 | { USB_DEVICE(PI_VID, PI_1014_PID) }, | ||
| 832 | { USB_DEVICE(PI_VID, PI_1015_PID) }, | ||
| 833 | { USB_DEVICE(PI_VID, PI_1016_PID) }, | ||
| 814 | { USB_DEVICE(KONDO_VID, KONDO_USB_SERIAL_PID) }, | 834 | { USB_DEVICE(KONDO_VID, KONDO_USB_SERIAL_PID) }, |
| 815 | { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, | 835 | { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, |
| 816 | { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID), | 836 | { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID), |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 5dd96ca6c380..41fe5826100c 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
| @@ -75,6 +75,9 @@ | |||
| 75 | #define FTDI_OPENDCC_GATEWAY_PID 0xBFDB | 75 | #define FTDI_OPENDCC_GATEWAY_PID 0xBFDB |
| 76 | #define FTDI_OPENDCC_GBM_PID 0xBFDC | 76 | #define FTDI_OPENDCC_GBM_PID 0xBFDC |
| 77 | 77 | ||
| 78 | /* NZR SEM 16+ USB (http://www.nzr.de) */ | ||
| 79 | #define FTDI_NZR_SEM_USB_PID 0xC1E0 /* NZR SEM-LOG16+ */ | ||
| 80 | |||
| 78 | /* | 81 | /* |
| 79 | * RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com) | 82 | * RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com) |
| 80 | */ | 83 | */ |
| @@ -539,7 +542,10 @@ | |||
| 539 | /* | 542 | /* |
| 540 | * Microchip Technology, Inc. | 543 | * Microchip Technology, Inc. |
| 541 | * | 544 | * |
| 542 | * MICROCHIP_VID (0x04D8) and MICROCHIP_USB_BOARD_PID (0x000A) are also used by: | 545 | * MICROCHIP_VID (0x04D8) and MICROCHIP_USB_BOARD_PID (0x000A) are |
| 546 | * used by single function CDC ACM class based firmware demo | ||
| 547 | * applications. The VID/PID has also been used in firmware | ||
| 548 | * emulating FTDI serial chips by: | ||
| 543 | * Hornby Elite - Digital Command Control Console | 549 | * Hornby Elite - Digital Command Control Console |
| 544 | * http://www.hornby.com/hornby-dcc/controllers/ | 550 | * http://www.hornby.com/hornby-dcc/controllers/ |
| 545 | */ | 551 | */ |
| @@ -791,8 +797,27 @@ | |||
| 791 | * Physik Instrumente | 797 | * Physik Instrumente |
| 792 | * http://www.physikinstrumente.com/en/products/ | 798 | * http://www.physikinstrumente.com/en/products/ |
| 793 | */ | 799 | */ |
| 800 | /* These two devices use the VID of FTDI */ | ||
| 801 | #define PI_C865_PID 0xe0a0 /* PI C-865 Piezomotor Controller */ | ||
| 802 | #define PI_C857_PID 0xe0a1 /* PI Encoder Trigger Box */ | ||
| 803 | |||
| 794 | #define PI_VID 0x1a72 /* Vendor ID */ | 804 | #define PI_VID 0x1a72 /* Vendor ID */ |
| 795 | #define PI_E861_PID 0x1008 /* E-861 piezo controller USB connection */ | 805 | #define PI_C866_PID 0x1000 /* PI C-866 Piezomotor Controller */ |
| 806 | #define PI_C663_PID 0x1001 /* PI C-663 Mercury-Step */ | ||
| 807 | #define PI_C725_PID 0x1002 /* PI C-725 Piezomotor Controller */ | ||
| 808 | #define PI_E517_PID 0x1005 /* PI E-517 Digital Piezo Controller Operation Module */ | ||
| 809 | #define PI_C863_PID 0x1007 /* PI C-863 */ | ||
| 810 | #define PI_E861_PID 0x1008 /* PI E-861 Piezomotor Controller */ | ||
| 811 | #define PI_C867_PID 0x1009 /* PI C-867 Piezomotor Controller */ | ||
| 812 | #define PI_E609_PID 0x100D /* PI E-609 Digital Piezo Controller */ | ||
| 813 | #define PI_E709_PID 0x100E /* PI E-709 Digital Piezo Controller */ | ||
| 814 | #define PI_100F_PID 0x100F /* PI Digital Piezo Controller */ | ||
| 815 | #define PI_1011_PID 0x1011 /* PI Digital Piezo Controller */ | ||
| 816 | #define PI_1012_PID 0x1012 /* PI Motion Controller */ | ||
| 817 | #define PI_1013_PID 0x1013 /* PI Motion Controller */ | ||
| 818 | #define PI_1014_PID 0x1014 /* PI Device */ | ||
| 819 | #define PI_1015_PID 0x1015 /* PI Device */ | ||
| 820 | #define PI_1016_PID 0x1016 /* PI Digital Servo Module */ | ||
| 796 | 821 | ||
| 797 | /* | 822 | /* |
| 798 | * Kondo Kagaku Co.Ltd. | 823 | * Kondo Kagaku Co.Ltd. |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index cc40f47ecea1..5ce88d1bc6f1 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -886,8 +886,6 @@ static const struct usb_device_id option_ids[] = { | |||
| 886 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff), | 886 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff), |
| 887 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | 887 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
| 888 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) }, | 888 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) }, |
| 889 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1018, 0xff, 0xff, 0xff), | ||
| 890 | .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, | ||
| 891 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) }, | 889 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) }, |
| 892 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1058, 0xff, 0xff, 0xff) }, | 890 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1058, 0xff, 0xff, 0xff) }, |
| 893 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1059, 0xff, 0xff, 0xff) }, | 891 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1059, 0xff, 0xff, 0xff) }, |
| @@ -1092,6 +1090,10 @@ static const struct usb_device_id option_ids[] = { | |||
| 1092 | .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, | 1090 | .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, |
| 1093 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), | 1091 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), |
| 1094 | .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, | 1092 | .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, |
| 1093 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, | ||
| 1094 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, | ||
| 1095 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) }, | ||
| 1096 | |||
| 1095 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, | 1097 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, |
| 1096 | { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, | 1098 | { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, |
| 1097 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ | 1099 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 75d6d0a3d32e..6a7fcab7ecb3 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
| @@ -287,10 +287,12 @@ nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
| 287 | struct inode *inode = file->f_path.dentry->d_inode; | 287 | struct inode *inode = file->f_path.dentry->d_inode; |
| 288 | 288 | ||
| 289 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); | 289 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); |
| 290 | if (ret != 0) | ||
| 291 | goto out; | ||
| 290 | mutex_lock(&inode->i_mutex); | 292 | mutex_lock(&inode->i_mutex); |
| 291 | ret = nfs_file_fsync_commit(file, start, end, datasync); | 293 | ret = nfs_file_fsync_commit(file, start, end, datasync); |
| 292 | mutex_unlock(&inode->i_mutex); | 294 | mutex_unlock(&inode->i_mutex); |
| 293 | 295 | out: | |
| 294 | return ret; | 296 | return ret; |
| 295 | } | 297 | } |
| 296 | 298 | ||
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index c6e895f0fbf3..9b47610338f5 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
| @@ -154,7 +154,7 @@ static void nfs_zap_caches_locked(struct inode *inode) | |||
| 154 | nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); | 154 | nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); |
| 155 | nfsi->attrtimeo_timestamp = jiffies; | 155 | nfsi->attrtimeo_timestamp = jiffies; |
| 156 | 156 | ||
| 157 | memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode))); | 157 | memset(NFS_I(inode)->cookieverf, 0, sizeof(NFS_I(inode)->cookieverf)); |
| 158 | if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) | 158 | if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) |
| 159 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; | 159 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; |
| 160 | else | 160 | else |
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index d6b3b5f2d779..69322096c325 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
| @@ -643,7 +643,7 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, | |||
| 643 | u64 cookie, struct page **pages, unsigned int count, int plus) | 643 | u64 cookie, struct page **pages, unsigned int count, int plus) |
| 644 | { | 644 | { |
| 645 | struct inode *dir = dentry->d_inode; | 645 | struct inode *dir = dentry->d_inode; |
| 646 | __be32 *verf = NFS_COOKIEVERF(dir); | 646 | __be32 *verf = NFS_I(dir)->cookieverf; |
| 647 | struct nfs3_readdirargs arg = { | 647 | struct nfs3_readdirargs arg = { |
| 648 | .fh = NFS_FH(dir), | 648 | .fh = NFS_FH(dir), |
| 649 | .cookie = cookie, | 649 | .cookie = cookie, |
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index acb65e7887f8..eb5eb8eef4d3 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c | |||
| @@ -96,13 +96,15 @@ nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
| 96 | struct inode *inode = file->f_path.dentry->d_inode; | 96 | struct inode *inode = file->f_path.dentry->d_inode; |
| 97 | 97 | ||
| 98 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); | 98 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); |
| 99 | if (ret != 0) | ||
| 100 | goto out; | ||
| 99 | mutex_lock(&inode->i_mutex); | 101 | mutex_lock(&inode->i_mutex); |
| 100 | ret = nfs_file_fsync_commit(file, start, end, datasync); | 102 | ret = nfs_file_fsync_commit(file, start, end, datasync); |
| 101 | if (!ret && !datasync) | 103 | if (!ret && !datasync) |
| 102 | /* application has asked for meta-data sync */ | 104 | /* application has asked for meta-data sync */ |
| 103 | ret = pnfs_layoutcommit_inode(inode, true); | 105 | ret = pnfs_layoutcommit_inode(inode, true); |
| 104 | mutex_unlock(&inode->i_mutex); | 106 | mutex_unlock(&inode->i_mutex); |
| 105 | 107 | out: | |
| 106 | return ret; | 108 | return ret; |
| 107 | } | 109 | } |
| 108 | 110 | ||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 635274140b18..1e50326d00dd 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
| @@ -3215,11 +3215,11 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, | |||
| 3215 | dentry->d_parent->d_name.name, | 3215 | dentry->d_parent->d_name.name, |
| 3216 | dentry->d_name.name, | 3216 | dentry->d_name.name, |
| 3217 | (unsigned long long)cookie); | 3217 | (unsigned long long)cookie); |
| 3218 | nfs4_setup_readdir(cookie, NFS_COOKIEVERF(dir), dentry, &args); | 3218 | nfs4_setup_readdir(cookie, NFS_I(dir)->cookieverf, dentry, &args); |
| 3219 | res.pgbase = args.pgbase; | 3219 | res.pgbase = args.pgbase; |
| 3220 | status = nfs4_call_sync(NFS_SERVER(dir)->client, NFS_SERVER(dir), &msg, &args.seq_args, &res.seq_res, 0); | 3220 | status = nfs4_call_sync(NFS_SERVER(dir)->client, NFS_SERVER(dir), &msg, &args.seq_args, &res.seq_res, 0); |
| 3221 | if (status >= 0) { | 3221 | if (status >= 0) { |
| 3222 | memcpy(NFS_COOKIEVERF(dir), res.verifier.data, NFS4_VERIFIER_SIZE); | 3222 | memcpy(NFS_I(dir)->cookieverf, res.verifier.data, NFS4_VERIFIER_SIZE); |
| 3223 | status += args.pgbase; | 3223 | status += args.pgbase; |
| 3224 | } | 3224 | } |
| 3225 | 3225 | ||
| @@ -3653,11 +3653,11 @@ static inline int nfs4_server_supports_acls(struct nfs_server *server) | |||
| 3653 | && (server->acl_bitmask & ACL4_SUPPORT_DENY_ACL); | 3653 | && (server->acl_bitmask & ACL4_SUPPORT_DENY_ACL); |
| 3654 | } | 3654 | } |
| 3655 | 3655 | ||
| 3656 | /* Assuming that XATTR_SIZE_MAX is a multiple of PAGE_CACHE_SIZE, and that | 3656 | /* Assuming that XATTR_SIZE_MAX is a multiple of PAGE_SIZE, and that |
| 3657 | * it's OK to put sizeof(void) * (XATTR_SIZE_MAX/PAGE_CACHE_SIZE) bytes on | 3657 | * it's OK to put sizeof(void) * (XATTR_SIZE_MAX/PAGE_SIZE) bytes on |
| 3658 | * the stack. | 3658 | * the stack. |
| 3659 | */ | 3659 | */ |
| 3660 | #define NFS4ACL_MAXPAGES (XATTR_SIZE_MAX >> PAGE_CACHE_SHIFT) | 3660 | #define NFS4ACL_MAXPAGES DIV_ROUND_UP(XATTR_SIZE_MAX, PAGE_SIZE) |
| 3661 | 3661 | ||
| 3662 | static int buf_to_pages_noslab(const void *buf, size_t buflen, | 3662 | static int buf_to_pages_noslab(const void *buf, size_t buflen, |
| 3663 | struct page **pages, unsigned int *pgbase) | 3663 | struct page **pages, unsigned int *pgbase) |
| @@ -3668,7 +3668,7 @@ static int buf_to_pages_noslab(const void *buf, size_t buflen, | |||
| 3668 | spages = pages; | 3668 | spages = pages; |
| 3669 | 3669 | ||
| 3670 | do { | 3670 | do { |
| 3671 | len = min_t(size_t, PAGE_CACHE_SIZE, buflen); | 3671 | len = min_t(size_t, PAGE_SIZE, buflen); |
| 3672 | newpage = alloc_page(GFP_KERNEL); | 3672 | newpage = alloc_page(GFP_KERNEL); |
| 3673 | 3673 | ||
| 3674 | if (newpage == NULL) | 3674 | if (newpage == NULL) |
| @@ -3739,7 +3739,7 @@ static void nfs4_write_cached_acl(struct inode *inode, struct page **pages, size | |||
| 3739 | struct nfs4_cached_acl *acl; | 3739 | struct nfs4_cached_acl *acl; |
| 3740 | size_t buflen = sizeof(*acl) + acl_len; | 3740 | size_t buflen = sizeof(*acl) + acl_len; |
| 3741 | 3741 | ||
| 3742 | if (pages && buflen <= PAGE_SIZE) { | 3742 | if (buflen <= PAGE_SIZE) { |
| 3743 | acl = kmalloc(buflen, GFP_KERNEL); | 3743 | acl = kmalloc(buflen, GFP_KERNEL); |
| 3744 | if (acl == NULL) | 3744 | if (acl == NULL) |
| 3745 | goto out; | 3745 | goto out; |
| @@ -3782,17 +3782,15 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu | |||
| 3782 | .rpc_argp = &args, | 3782 | .rpc_argp = &args, |
| 3783 | .rpc_resp = &res, | 3783 | .rpc_resp = &res, |
| 3784 | }; | 3784 | }; |
| 3785 | int ret = -ENOMEM, npages, i; | 3785 | unsigned int npages = DIV_ROUND_UP(buflen, PAGE_SIZE); |
| 3786 | size_t acl_len = 0; | 3786 | int ret = -ENOMEM, i; |
| 3787 | 3787 | ||
| 3788 | npages = (buflen + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
| 3789 | /* As long as we're doing a round trip to the server anyway, | 3788 | /* As long as we're doing a round trip to the server anyway, |
| 3790 | * let's be prepared for a page of acl data. */ | 3789 | * let's be prepared for a page of acl data. */ |
| 3791 | if (npages == 0) | 3790 | if (npages == 0) |
| 3792 | npages = 1; | 3791 | npages = 1; |
| 3793 | 3792 | if (npages > ARRAY_SIZE(pages)) | |
| 3794 | /* Add an extra page to handle the bitmap returned */ | 3793 | return -ERANGE; |
| 3795 | npages++; | ||
| 3796 | 3794 | ||
| 3797 | for (i = 0; i < npages; i++) { | 3795 | for (i = 0; i < npages; i++) { |
| 3798 | pages[i] = alloc_page(GFP_KERNEL); | 3796 | pages[i] = alloc_page(GFP_KERNEL); |
| @@ -3808,11 +3806,6 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu | |||
| 3808 | args.acl_len = npages * PAGE_SIZE; | 3806 | args.acl_len = npages * PAGE_SIZE; |
| 3809 | args.acl_pgbase = 0; | 3807 | args.acl_pgbase = 0; |
| 3810 | 3808 | ||
| 3811 | /* Let decode_getfacl know not to fail if the ACL data is larger than | ||
| 3812 | * the page we send as a guess */ | ||
| 3813 | if (buf == NULL) | ||
| 3814 | res.acl_flags |= NFS4_ACL_LEN_REQUEST; | ||
| 3815 | |||
| 3816 | dprintk("%s buf %p buflen %zu npages %d args.acl_len %zu\n", | 3809 | dprintk("%s buf %p buflen %zu npages %d args.acl_len %zu\n", |
| 3817 | __func__, buf, buflen, npages, args.acl_len); | 3810 | __func__, buf, buflen, npages, args.acl_len); |
| 3818 | ret = nfs4_call_sync(NFS_SERVER(inode)->client, NFS_SERVER(inode), | 3811 | ret = nfs4_call_sync(NFS_SERVER(inode)->client, NFS_SERVER(inode), |
| @@ -3820,20 +3813,19 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu | |||
| 3820 | if (ret) | 3813 | if (ret) |
| 3821 | goto out_free; | 3814 | goto out_free; |
| 3822 | 3815 | ||
| 3823 | acl_len = res.acl_len; | 3816 | /* Handle the case where the passed-in buffer is too short */ |
| 3824 | if (acl_len > args.acl_len) | 3817 | if (res.acl_flags & NFS4_ACL_TRUNC) { |
| 3825 | nfs4_write_cached_acl(inode, NULL, 0, acl_len); | 3818 | /* Did the user only issue a request for the acl length? */ |
| 3826 | else | 3819 | if (buf == NULL) |
| 3827 | nfs4_write_cached_acl(inode, pages, res.acl_data_offset, | 3820 | goto out_ok; |
| 3828 | acl_len); | ||
| 3829 | if (buf) { | ||
| 3830 | ret = -ERANGE; | 3821 | ret = -ERANGE; |
| 3831 | if (acl_len > buflen) | 3822 | goto out_free; |
| 3832 | goto out_free; | ||
| 3833 | _copy_from_pages(buf, pages, res.acl_data_offset, | ||
| 3834 | acl_len); | ||
| 3835 | } | 3823 | } |
| 3836 | ret = acl_len; | 3824 | nfs4_write_cached_acl(inode, pages, res.acl_data_offset, res.acl_len); |
| 3825 | if (buf) | ||
| 3826 | _copy_from_pages(buf, pages, res.acl_data_offset, res.acl_len); | ||
| 3827 | out_ok: | ||
| 3828 | ret = res.acl_len; | ||
| 3837 | out_free: | 3829 | out_free: |
| 3838 | for (i = 0; i < npages; i++) | 3830 | for (i = 0; i < npages; i++) |
| 3839 | if (pages[i]) | 3831 | if (pages[i]) |
| @@ -3891,10 +3883,13 @@ static int __nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t bufl | |||
| 3891 | .rpc_argp = &arg, | 3883 | .rpc_argp = &arg, |
| 3892 | .rpc_resp = &res, | 3884 | .rpc_resp = &res, |
| 3893 | }; | 3885 | }; |
| 3886 | unsigned int npages = DIV_ROUND_UP(buflen, PAGE_SIZE); | ||
| 3894 | int ret, i; | 3887 | int ret, i; |
| 3895 | 3888 | ||
| 3896 | if (!nfs4_server_supports_acls(server)) | 3889 | if (!nfs4_server_supports_acls(server)) |
| 3897 | return -EOPNOTSUPP; | 3890 | return -EOPNOTSUPP; |
| 3891 | if (npages > ARRAY_SIZE(pages)) | ||
| 3892 | return -ERANGE; | ||
| 3898 | i = buf_to_pages_noslab(buf, buflen, arg.acl_pages, &arg.acl_pgbase); | 3893 | i = buf_to_pages_noslab(buf, buflen, arg.acl_pages, &arg.acl_pgbase); |
| 3899 | if (i < 0) | 3894 | if (i < 0) |
| 3900 | return i; | 3895 | return i; |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 1bfbd67c556d..8dba6bd48557 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
| @@ -5072,18 +5072,14 @@ static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req, | |||
| 5072 | * are stored with the acl data to handle the problem of | 5072 | * are stored with the acl data to handle the problem of |
| 5073 | * variable length bitmaps.*/ | 5073 | * variable length bitmaps.*/ |
| 5074 | res->acl_data_offset = xdr_stream_pos(xdr) - pg_offset; | 5074 | res->acl_data_offset = xdr_stream_pos(xdr) - pg_offset; |
| 5075 | |||
| 5076 | /* We ignore &savep and don't do consistency checks on | ||
| 5077 | * the attr length. Let userspace figure it out.... */ | ||
| 5078 | res->acl_len = attrlen; | 5075 | res->acl_len = attrlen; |
| 5079 | if (attrlen > (xdr->nwords << 2)) { | 5076 | |
| 5080 | if (res->acl_flags & NFS4_ACL_LEN_REQUEST) { | 5077 | /* Check for receive buffer overflow */ |
| 5081 | /* getxattr interface called with a NULL buf */ | 5078 | if (res->acl_len > (xdr->nwords << 2) || |
| 5082 | goto out; | 5079 | res->acl_len + res->acl_data_offset > xdr->buf->page_len) { |
| 5083 | } | 5080 | res->acl_flags |= NFS4_ACL_TRUNC; |
| 5084 | dprintk("NFS: acl reply: attrlen %u > page_len %u\n", | 5081 | dprintk("NFS: acl reply: attrlen %u > page_len %u\n", |
| 5085 | attrlen, xdr->nwords << 2); | 5082 | attrlen, xdr->nwords << 2); |
| 5086 | return -EINVAL; | ||
| 5087 | } | 5083 | } |
| 5088 | } else | 5084 | } else |
| 5089 | status = -EOPNOTSUPP; | 5085 | status = -EOPNOTSUPP; |
| @@ -6229,7 +6225,8 @@ static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
| 6229 | status = decode_open(xdr, res); | 6225 | status = decode_open(xdr, res); |
| 6230 | if (status) | 6226 | if (status) |
| 6231 | goto out; | 6227 | goto out; |
| 6232 | if (decode_getfh(xdr, &res->fh) != 0) | 6228 | status = decode_getfh(xdr, &res->fh); |
| 6229 | if (status) | ||
| 6233 | goto out; | 6230 | goto out; |
| 6234 | decode_getfattr(xdr, res->f_attr, res->server); | 6231 | decode_getfattr(xdr, res->f_attr, res->server); |
| 6235 | out: | 6232 | out: |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 239aff7338eb..b8eda700584b 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
| @@ -1867,6 +1867,7 @@ static int nfs23_validate_mount_data(void *options, | |||
| 1867 | 1867 | ||
| 1868 | memcpy(sap, &data->addr, sizeof(data->addr)); | 1868 | memcpy(sap, &data->addr, sizeof(data->addr)); |
| 1869 | args->nfs_server.addrlen = sizeof(data->addr); | 1869 | args->nfs_server.addrlen = sizeof(data->addr); |
| 1870 | args->nfs_server.port = ntohs(data->addr.sin_port); | ||
| 1870 | if (!nfs_verify_server_address(sap)) | 1871 | if (!nfs_verify_server_address(sap)) |
| 1871 | goto out_no_address; | 1872 | goto out_no_address; |
| 1872 | 1873 | ||
| @@ -2564,6 +2565,7 @@ static int nfs4_validate_mount_data(void *options, | |||
| 2564 | return -EFAULT; | 2565 | return -EFAULT; |
| 2565 | if (!nfs_verify_server_address(sap)) | 2566 | if (!nfs_verify_server_address(sap)) |
| 2566 | goto out_no_address; | 2567 | goto out_no_address; |
| 2568 | args->nfs_server.port = ntohs(((struct sockaddr_in *)sap)->sin_port); | ||
| 2567 | 2569 | ||
| 2568 | if (data->auth_flavourlen) { | 2570 | if (data->auth_flavourlen) { |
| 2569 | if (data->auth_flavourlen > 1) | 2571 | if (data->auth_flavourlen > 1) |
| @@ -58,7 +58,7 @@ EXPORT_SYMBOL(vfs_getattr); | |||
| 58 | int vfs_fstat(unsigned int fd, struct kstat *stat) | 58 | int vfs_fstat(unsigned int fd, struct kstat *stat) |
| 59 | { | 59 | { |
| 60 | int fput_needed; | 60 | int fput_needed; |
| 61 | struct file *f = fget_light(fd, &fput_needed); | 61 | struct file *f = fget_raw_light(fd, &fput_needed); |
| 62 | int error = -EBADF; | 62 | int error = -EBADF; |
| 63 | 63 | ||
| 64 | if (f) { | 64 | if (f) { |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index fc615a97e2d3..1e57449395b1 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
| @@ -224,7 +224,7 @@ static inline int kobject_uevent_env(struct kobject *kobj, | |||
| 224 | 224 | ||
| 225 | static inline __printf(2, 3) | 225 | static inline __printf(2, 3) |
| 226 | int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) | 226 | int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) |
| 227 | { return 0; } | 227 | { return -ENOMEM; } |
| 228 | 228 | ||
| 229 | static inline int kobject_action_type(const char *buf, size_t count, | 229 | static inline int kobject_action_type(const char *buf, size_t count, |
| 230 | enum kobject_action *type) | 230 | enum kobject_action *type) |
diff --git a/include/linux/mISDNhw.h b/include/linux/mISDNhw.h index d0752eca9b44..9d96d5d4dfed 100644 --- a/include/linux/mISDNhw.h +++ b/include/linux/mISDNhw.h | |||
| @@ -183,7 +183,7 @@ extern int mISDN_initbchannel(struct bchannel *, unsigned short, | |||
| 183 | unsigned short); | 183 | unsigned short); |
| 184 | extern int mISDN_freedchannel(struct dchannel *); | 184 | extern int mISDN_freedchannel(struct dchannel *); |
| 185 | extern void mISDN_clear_bchannel(struct bchannel *); | 185 | extern void mISDN_clear_bchannel(struct bchannel *); |
| 186 | extern int mISDN_freebchannel(struct bchannel *); | 186 | extern void mISDN_freebchannel(struct bchannel *); |
| 187 | extern int mISDN_ctrl_bchannel(struct bchannel *, struct mISDN_ctrl_req *); | 187 | extern int mISDN_ctrl_bchannel(struct bchannel *, struct mISDN_ctrl_req *); |
| 188 | extern void queue_ch_frame(struct mISDNchannel *, u_int, | 188 | extern void queue_ch_frame(struct mISDNchannel *, u_int, |
| 189 | int, struct sk_buff *); | 189 | int, struct sk_buff *); |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index bd6c9fcdf2dd..6e1b0f973a03 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -796,6 +796,19 @@ enum mlx4_net_trans_rule_id { | |||
| 796 | MLX4_NET_TRANS_RULE_NUM, /* should be last */ | 796 | MLX4_NET_TRANS_RULE_NUM, /* should be last */ |
| 797 | }; | 797 | }; |
| 798 | 798 | ||
| 799 | extern const u16 __sw_id_hw[]; | ||
| 800 | |||
| 801 | static inline int map_hw_to_sw_id(u16 header_id) | ||
| 802 | { | ||
| 803 | |||
| 804 | int i; | ||
| 805 | for (i = 0; i < MLX4_NET_TRANS_RULE_NUM; i++) { | ||
| 806 | if (header_id == __sw_id_hw[i]) | ||
| 807 | return i; | ||
| 808 | } | ||
| 809 | return -EINVAL; | ||
| 810 | } | ||
| 811 | |||
| 799 | enum mlx4_net_trans_promisc_mode { | 812 | enum mlx4_net_trans_promisc_mode { |
| 800 | MLX4_FS_PROMISC_NONE = 0, | 813 | MLX4_FS_PROMISC_NONE = 0, |
| 801 | MLX4_FS_PROMISC_UPLINK, | 814 | MLX4_FS_PROMISC_UPLINK, |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 1f8fc7f9bcd8..4b03f56e280e 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -265,11 +265,6 @@ static inline const struct nfs_rpc_ops *NFS_PROTO(const struct inode *inode) | |||
| 265 | return NFS_SERVER(inode)->nfs_client->rpc_ops; | 265 | return NFS_SERVER(inode)->nfs_client->rpc_ops; |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | static inline __be32 *NFS_COOKIEVERF(const struct inode *inode) | ||
| 269 | { | ||
| 270 | return NFS_I(inode)->cookieverf; | ||
| 271 | } | ||
| 272 | |||
| 273 | static inline unsigned NFS_MINATTRTIMEO(const struct inode *inode) | 268 | static inline unsigned NFS_MINATTRTIMEO(const struct inode *inode) |
| 274 | { | 269 | { |
| 275 | struct nfs_server *nfss = NFS_SERVER(inode); | 270 | struct nfs_server *nfss = NFS_SERVER(inode); |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index ac7c8ae254f2..be9cf3c7e79e 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -652,7 +652,7 @@ struct nfs_getaclargs { | |||
| 652 | }; | 652 | }; |
| 653 | 653 | ||
| 654 | /* getxattr ACL interface flags */ | 654 | /* getxattr ACL interface flags */ |
| 655 | #define NFS4_ACL_LEN_REQUEST 0x0001 /* zero length getxattr buffer */ | 655 | #define NFS4_ACL_TRUNC 0x0001 /* ACL was truncated */ |
| 656 | struct nfs_getaclres { | 656 | struct nfs_getaclres { |
| 657 | size_t acl_len; | 657 | size_t acl_len; |
| 658 | size_t acl_data_offset; | 658 | size_t acl_data_offset; |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 7602ccb3f40e..33ed9d605f91 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -926,7 +926,7 @@ struct perf_event { | |||
| 926 | struct hw_perf_event hw; | 926 | struct hw_perf_event hw; |
| 927 | 927 | ||
| 928 | struct perf_event_context *ctx; | 928 | struct perf_event_context *ctx; |
| 929 | struct file *filp; | 929 | atomic_long_t refcount; |
| 930 | 930 | ||
| 931 | /* | 931 | /* |
| 932 | * These accumulate total time (in nanoseconds) that children | 932 | * These accumulate total time (in nanoseconds) that children |
| @@ -1296,6 +1296,7 @@ extern int perf_swevent_get_recursion_context(void); | |||
| 1296 | extern void perf_swevent_put_recursion_context(int rctx); | 1296 | extern void perf_swevent_put_recursion_context(int rctx); |
| 1297 | extern void perf_event_enable(struct perf_event *event); | 1297 | extern void perf_event_enable(struct perf_event *event); |
| 1298 | extern void perf_event_disable(struct perf_event *event); | 1298 | extern void perf_event_disable(struct perf_event *event); |
| 1299 | extern int __perf_event_disable(void *info); | ||
| 1299 | extern void perf_event_task_tick(void); | 1300 | extern void perf_event_task_tick(void); |
| 1300 | #else | 1301 | #else |
| 1301 | static inline void | 1302 | static inline void |
| @@ -1334,6 +1335,7 @@ static inline int perf_swevent_get_recursion_context(void) { return -1; } | |||
| 1334 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 1335 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
| 1335 | static inline void perf_event_enable(struct perf_event *event) { } | 1336 | static inline void perf_event_enable(struct perf_event *event) { } |
| 1336 | static inline void perf_event_disable(struct perf_event *event) { } | 1337 | static inline void perf_event_disable(struct perf_event *event) { } |
| 1338 | static inline int __perf_event_disable(void *info) { return -1; } | ||
| 1337 | static inline void perf_event_task_tick(void) { } | 1339 | static inline void perf_event_task_tick(void) { } |
| 1338 | #endif | 1340 | #endif |
| 1339 | 1341 | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index cff40aa7db62..bf8c49ff7530 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -114,6 +114,7 @@ struct rpc_xprt_ops { | |||
| 114 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); | 114 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); |
| 115 | int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); | 115 | int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
| 116 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); | 116 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
| 117 | void (*alloc_slot)(struct rpc_xprt *xprt, struct rpc_task *task); | ||
| 117 | void (*rpcbind)(struct rpc_task *task); | 118 | void (*rpcbind)(struct rpc_task *task); |
| 118 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); | 119 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); |
| 119 | void (*connect)(struct rpc_task *task); | 120 | void (*connect)(struct rpc_task *task); |
| @@ -281,6 +282,8 @@ void xprt_connect(struct rpc_task *task); | |||
| 281 | void xprt_reserve(struct rpc_task *task); | 282 | void xprt_reserve(struct rpc_task *task); |
| 282 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); | 283 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); |
| 283 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); | 284 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); |
| 285 | void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); | ||
| 286 | void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); | ||
| 284 | int xprt_prepare_transmit(struct rpc_task *task); | 287 | int xprt_prepare_transmit(struct rpc_task *task); |
| 285 | void xprt_transmit(struct rpc_task *task); | 288 | void xprt_transmit(struct rpc_task *task); |
| 286 | void xprt_end_transmit(struct rpc_task *task); | 289 | void xprt_end_transmit(struct rpc_task *task); |
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h index ca356a734920..8b27927b2a55 100644 --- a/include/net/bluetooth/smp.h +++ b/include/net/bluetooth/smp.h | |||
| @@ -136,7 +136,7 @@ struct smp_chan { | |||
| 136 | }; | 136 | }; |
| 137 | 137 | ||
| 138 | /* SMP Commands */ | 138 | /* SMP Commands */ |
| 139 | int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level); | 139 | int smp_conn_security(struct hci_conn *hcon, __u8 sec_level); |
| 140 | int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); | 140 | int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); |
| 141 | int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); | 141 | int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); |
| 142 | int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey); | 142 | int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey); |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 976a81abe1a2..639dd1316d37 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -273,6 +273,9 @@ struct xfrm_replay { | |||
| 273 | int (*check)(struct xfrm_state *x, | 273 | int (*check)(struct xfrm_state *x, |
| 274 | struct sk_buff *skb, | 274 | struct sk_buff *skb, |
| 275 | __be32 net_seq); | 275 | __be32 net_seq); |
| 276 | int (*recheck)(struct xfrm_state *x, | ||
| 277 | struct sk_buff *skb, | ||
| 278 | __be32 net_seq); | ||
| 276 | void (*notify)(struct xfrm_state *x, int event); | 279 | void (*notify)(struct xfrm_state *x, int event); |
| 277 | int (*overflow)(struct xfrm_state *x, struct sk_buff *skb); | 280 | int (*overflow)(struct xfrm_state *x, struct sk_buff *skb); |
| 278 | }; | 281 | }; |
diff --git a/kernel/events/core.c b/kernel/events/core.c index b7935fcec7d9..7fee567153f0 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
| @@ -1253,7 +1253,7 @@ retry: | |||
| 1253 | /* | 1253 | /* |
| 1254 | * Cross CPU call to disable a performance event | 1254 | * Cross CPU call to disable a performance event |
| 1255 | */ | 1255 | */ |
| 1256 | static int __perf_event_disable(void *info) | 1256 | int __perf_event_disable(void *info) |
| 1257 | { | 1257 | { |
| 1258 | struct perf_event *event = info; | 1258 | struct perf_event *event = info; |
| 1259 | struct perf_event_context *ctx = event->ctx; | 1259 | struct perf_event_context *ctx = event->ctx; |
| @@ -2935,12 +2935,12 @@ EXPORT_SYMBOL_GPL(perf_event_release_kernel); | |||
| 2935 | /* | 2935 | /* |
| 2936 | * Called when the last reference to the file is gone. | 2936 | * Called when the last reference to the file is gone. |
| 2937 | */ | 2937 | */ |
| 2938 | static int perf_release(struct inode *inode, struct file *file) | 2938 | static void put_event(struct perf_event *event) |
| 2939 | { | 2939 | { |
| 2940 | struct perf_event *event = file->private_data; | ||
| 2941 | struct task_struct *owner; | 2940 | struct task_struct *owner; |
| 2942 | 2941 | ||
| 2943 | file->private_data = NULL; | 2942 | if (!atomic_long_dec_and_test(&event->refcount)) |
| 2943 | return; | ||
| 2944 | 2944 | ||
| 2945 | rcu_read_lock(); | 2945 | rcu_read_lock(); |
| 2946 | owner = ACCESS_ONCE(event->owner); | 2946 | owner = ACCESS_ONCE(event->owner); |
| @@ -2975,7 +2975,13 @@ static int perf_release(struct inode *inode, struct file *file) | |||
| 2975 | put_task_struct(owner); | 2975 | put_task_struct(owner); |
| 2976 | } | 2976 | } |
| 2977 | 2977 | ||
| 2978 | return perf_event_release_kernel(event); | 2978 | perf_event_release_kernel(event); |
| 2979 | } | ||
| 2980 | |||
| 2981 | static int perf_release(struct inode *inode, struct file *file) | ||
| 2982 | { | ||
| 2983 | put_event(file->private_data); | ||
| 2984 | return 0; | ||
| 2979 | } | 2985 | } |
| 2980 | 2986 | ||
| 2981 | u64 perf_event_read_value(struct perf_event *event, u64 *enabled, u64 *running) | 2987 | u64 perf_event_read_value(struct perf_event *event, u64 *enabled, u64 *running) |
| @@ -3227,7 +3233,7 @@ unlock: | |||
| 3227 | 3233 | ||
| 3228 | static const struct file_operations perf_fops; | 3234 | static const struct file_operations perf_fops; |
| 3229 | 3235 | ||
| 3230 | static struct perf_event *perf_fget_light(int fd, int *fput_needed) | 3236 | static struct file *perf_fget_light(int fd, int *fput_needed) |
| 3231 | { | 3237 | { |
| 3232 | struct file *file; | 3238 | struct file *file; |
| 3233 | 3239 | ||
| @@ -3241,7 +3247,7 @@ static struct perf_event *perf_fget_light(int fd, int *fput_needed) | |||
| 3241 | return ERR_PTR(-EBADF); | 3247 | return ERR_PTR(-EBADF); |
| 3242 | } | 3248 | } |
| 3243 | 3249 | ||
| 3244 | return file->private_data; | 3250 | return file; |
| 3245 | } | 3251 | } |
| 3246 | 3252 | ||
| 3247 | static int perf_event_set_output(struct perf_event *event, | 3253 | static int perf_event_set_output(struct perf_event *event, |
| @@ -3273,19 +3279,21 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 3273 | 3279 | ||
| 3274 | case PERF_EVENT_IOC_SET_OUTPUT: | 3280 | case PERF_EVENT_IOC_SET_OUTPUT: |
| 3275 | { | 3281 | { |
| 3282 | struct file *output_file = NULL; | ||
| 3276 | struct perf_event *output_event = NULL; | 3283 | struct perf_event *output_event = NULL; |
| 3277 | int fput_needed = 0; | 3284 | int fput_needed = 0; |
| 3278 | int ret; | 3285 | int ret; |
| 3279 | 3286 | ||
| 3280 | if (arg != -1) { | 3287 | if (arg != -1) { |
| 3281 | output_event = perf_fget_light(arg, &fput_needed); | 3288 | output_file = perf_fget_light(arg, &fput_needed); |
| 3282 | if (IS_ERR(output_event)) | 3289 | if (IS_ERR(output_file)) |
| 3283 | return PTR_ERR(output_event); | 3290 | return PTR_ERR(output_file); |
| 3291 | output_event = output_file->private_data; | ||
| 3284 | } | 3292 | } |
| 3285 | 3293 | ||
| 3286 | ret = perf_event_set_output(event, output_event); | 3294 | ret = perf_event_set_output(event, output_event); |
| 3287 | if (output_event) | 3295 | if (output_event) |
| 3288 | fput_light(output_event->filp, fput_needed); | 3296 | fput_light(output_file, fput_needed); |
| 3289 | 3297 | ||
| 3290 | return ret; | 3298 | return ret; |
| 3291 | } | 3299 | } |
| @@ -5950,6 +5958,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu, | |||
| 5950 | 5958 | ||
| 5951 | mutex_init(&event->mmap_mutex); | 5959 | mutex_init(&event->mmap_mutex); |
| 5952 | 5960 | ||
| 5961 | atomic_long_set(&event->refcount, 1); | ||
| 5953 | event->cpu = cpu; | 5962 | event->cpu = cpu; |
| 5954 | event->attr = *attr; | 5963 | event->attr = *attr; |
| 5955 | event->group_leader = group_leader; | 5964 | event->group_leader = group_leader; |
| @@ -6260,12 +6269,12 @@ SYSCALL_DEFINE5(perf_event_open, | |||
| 6260 | return event_fd; | 6269 | return event_fd; |
| 6261 | 6270 | ||
| 6262 | if (group_fd != -1) { | 6271 | if (group_fd != -1) { |
| 6263 | group_leader = perf_fget_light(group_fd, &fput_needed); | 6272 | group_file = perf_fget_light(group_fd, &fput_needed); |
| 6264 | if (IS_ERR(group_leader)) { | 6273 | if (IS_ERR(group_file)) { |
| 6265 | err = PTR_ERR(group_leader); | 6274 | err = PTR_ERR(group_file); |
| 6266 | goto err_fd; | 6275 | goto err_fd; |
| 6267 | } | 6276 | } |
| 6268 | group_file = group_leader->filp; | 6277 | group_leader = group_file->private_data; |
| 6269 | if (flags & PERF_FLAG_FD_OUTPUT) | 6278 | if (flags & PERF_FLAG_FD_OUTPUT) |
| 6270 | output_event = group_leader; | 6279 | output_event = group_leader; |
| 6271 | if (flags & PERF_FLAG_FD_NO_GROUP) | 6280 | if (flags & PERF_FLAG_FD_NO_GROUP) |
| @@ -6402,7 +6411,6 @@ SYSCALL_DEFINE5(perf_event_open, | |||
| 6402 | put_ctx(gctx); | 6411 | put_ctx(gctx); |
| 6403 | } | 6412 | } |
| 6404 | 6413 | ||
| 6405 | event->filp = event_file; | ||
| 6406 | WARN_ON_ONCE(ctx->parent_ctx); | 6414 | WARN_ON_ONCE(ctx->parent_ctx); |
| 6407 | mutex_lock(&ctx->mutex); | 6415 | mutex_lock(&ctx->mutex); |
| 6408 | 6416 | ||
| @@ -6496,7 +6504,6 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu, | |||
| 6496 | goto err_free; | 6504 | goto err_free; |
| 6497 | } | 6505 | } |
| 6498 | 6506 | ||
| 6499 | event->filp = NULL; | ||
| 6500 | WARN_ON_ONCE(ctx->parent_ctx); | 6507 | WARN_ON_ONCE(ctx->parent_ctx); |
| 6501 | mutex_lock(&ctx->mutex); | 6508 | mutex_lock(&ctx->mutex); |
| 6502 | perf_install_in_context(ctx, event, cpu); | 6509 | perf_install_in_context(ctx, event, cpu); |
| @@ -6578,7 +6585,7 @@ static void sync_child_event(struct perf_event *child_event, | |||
| 6578 | * Release the parent event, if this was the last | 6585 | * Release the parent event, if this was the last |
| 6579 | * reference to it. | 6586 | * reference to it. |
| 6580 | */ | 6587 | */ |
| 6581 | fput(parent_event->filp); | 6588 | put_event(parent_event); |
| 6582 | } | 6589 | } |
| 6583 | 6590 | ||
| 6584 | static void | 6591 | static void |
| @@ -6654,9 +6661,8 @@ static void perf_event_exit_task_context(struct task_struct *child, int ctxn) | |||
| 6654 | * | 6661 | * |
| 6655 | * __perf_event_exit_task() | 6662 | * __perf_event_exit_task() |
| 6656 | * sync_child_event() | 6663 | * sync_child_event() |
| 6657 | * fput(parent_event->filp) | 6664 | * put_event() |
| 6658 | * perf_release() | 6665 | * mutex_lock(&ctx->mutex) |
| 6659 | * mutex_lock(&ctx->mutex) | ||
| 6660 | * | 6666 | * |
| 6661 | * But since its the parent context it won't be the same instance. | 6667 | * But since its the parent context it won't be the same instance. |
| 6662 | */ | 6668 | */ |
| @@ -6724,7 +6730,7 @@ static void perf_free_event(struct perf_event *event, | |||
| 6724 | list_del_init(&event->child_list); | 6730 | list_del_init(&event->child_list); |
| 6725 | mutex_unlock(&parent->child_mutex); | 6731 | mutex_unlock(&parent->child_mutex); |
| 6726 | 6732 | ||
| 6727 | fput(parent->filp); | 6733 | put_event(parent); |
| 6728 | 6734 | ||
| 6729 | perf_group_detach(event); | 6735 | perf_group_detach(event); |
| 6730 | list_del_event(event, ctx); | 6736 | list_del_event(event, ctx); |
| @@ -6804,6 +6810,12 @@ inherit_event(struct perf_event *parent_event, | |||
| 6804 | NULL, NULL); | 6810 | NULL, NULL); |
| 6805 | if (IS_ERR(child_event)) | 6811 | if (IS_ERR(child_event)) |
| 6806 | return child_event; | 6812 | return child_event; |
| 6813 | |||
| 6814 | if (!atomic_long_inc_not_zero(&parent_event->refcount)) { | ||
| 6815 | free_event(child_event); | ||
| 6816 | return NULL; | ||
| 6817 | } | ||
| 6818 | |||
| 6807 | get_ctx(child_ctx); | 6819 | get_ctx(child_ctx); |
| 6808 | 6820 | ||
| 6809 | /* | 6821 | /* |
| @@ -6845,14 +6857,6 @@ inherit_event(struct perf_event *parent_event, | |||
| 6845 | raw_spin_unlock_irqrestore(&child_ctx->lock, flags); | 6857 | raw_spin_unlock_irqrestore(&child_ctx->lock, flags); |
| 6846 | 6858 | ||
| 6847 | /* | 6859 | /* |
| 6848 | * Get a reference to the parent filp - we will fput it | ||
| 6849 | * when the child event exits. This is safe to do because | ||
| 6850 | * we are in the parent and we know that the filp still | ||
| 6851 | * exists and has a nonzero count: | ||
| 6852 | */ | ||
| 6853 | atomic_long_inc(&parent_event->filp->f_count); | ||
| 6854 | |||
| 6855 | /* | ||
| 6856 | * Link this into the parent event's child list | 6860 | * Link this into the parent event's child list |
| 6857 | */ | 6861 | */ |
| 6858 | WARN_ON_ONCE(parent_event->ctx->parent_ctx); | 6862 | WARN_ON_ONCE(parent_event->ctx->parent_ctx); |
diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c index bb38c4d3ee12..9a7b487c6fe2 100644 --- a/kernel/events/hw_breakpoint.c +++ b/kernel/events/hw_breakpoint.c | |||
| @@ -453,7 +453,16 @@ int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *att | |||
| 453 | int old_type = bp->attr.bp_type; | 453 | int old_type = bp->attr.bp_type; |
| 454 | int err = 0; | 454 | int err = 0; |
| 455 | 455 | ||
| 456 | perf_event_disable(bp); | 456 | /* |
| 457 | * modify_user_hw_breakpoint can be invoked with IRQs disabled and hence it | ||
| 458 | * will not be possible to raise IPIs that invoke __perf_event_disable. | ||
| 459 | * So call the function directly after making sure we are targeting the | ||
| 460 | * current task. | ||
| 461 | */ | ||
| 462 | if (irqs_disabled() && bp->ctx && bp->ctx->task == current) | ||
| 463 | __perf_event_disable(bp); | ||
| 464 | else | ||
| 465 | perf_event_disable(bp); | ||
| 457 | 466 | ||
| 458 | bp->attr.bp_addr = attr->bp_addr; | 467 | bp->attr.bp_addr = attr->bp_addr; |
| 459 | bp->attr.bp_type = attr->bp_type; | 468 | bp->attr.bp_type = attr->bp_type; |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index fbf1fd098dc6..a4ea245f3d85 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -5304,27 +5304,17 @@ void idle_task_exit(void) | |||
| 5304 | } | 5304 | } |
| 5305 | 5305 | ||
| 5306 | /* | 5306 | /* |
| 5307 | * While a dead CPU has no uninterruptible tasks queued at this point, | 5307 | * Since this CPU is going 'away' for a while, fold any nr_active delta |
| 5308 | * it might still have a nonzero ->nr_uninterruptible counter, because | 5308 | * we might have. Assumes we're called after migrate_tasks() so that the |
| 5309 | * for performance reasons the counter is not stricly tracking tasks to | 5309 | * nr_active count is stable. |
| 5310 | * their home CPUs. So we just add the counter to another CPU's counter, | 5310 | * |
| 5311 | * to keep the global sum constant after CPU-down: | 5311 | * Also see the comment "Global load-average calculations". |
| 5312 | */ | ||
| 5313 | static void migrate_nr_uninterruptible(struct rq *rq_src) | ||
| 5314 | { | ||
| 5315 | struct rq *rq_dest = cpu_rq(cpumask_any(cpu_active_mask)); | ||
| 5316 | |||
| 5317 | rq_dest->nr_uninterruptible += rq_src->nr_uninterruptible; | ||
| 5318 | rq_src->nr_uninterruptible = 0; | ||
| 5319 | } | ||
| 5320 | |||
| 5321 | /* | ||
| 5322 | * remove the tasks which were accounted by rq from calc_load_tasks. | ||
| 5323 | */ | 5312 | */ |
| 5324 | static void calc_global_load_remove(struct rq *rq) | 5313 | static void calc_load_migrate(struct rq *rq) |
| 5325 | { | 5314 | { |
| 5326 | atomic_long_sub(rq->calc_load_active, &calc_load_tasks); | 5315 | long delta = calc_load_fold_active(rq); |
| 5327 | rq->calc_load_active = 0; | 5316 | if (delta) |
| 5317 | atomic_long_add(delta, &calc_load_tasks); | ||
| 5328 | } | 5318 | } |
| 5329 | 5319 | ||
| 5330 | /* | 5320 | /* |
| @@ -5352,9 +5342,6 @@ static void migrate_tasks(unsigned int dead_cpu) | |||
| 5352 | */ | 5342 | */ |
| 5353 | rq->stop = NULL; | 5343 | rq->stop = NULL; |
| 5354 | 5344 | ||
| 5355 | /* Ensure any throttled groups are reachable by pick_next_task */ | ||
| 5356 | unthrottle_offline_cfs_rqs(rq); | ||
| 5357 | |||
| 5358 | for ( ; ; ) { | 5345 | for ( ; ; ) { |
| 5359 | /* | 5346 | /* |
| 5360 | * There's this thread running, bail when that's the only | 5347 | * There's this thread running, bail when that's the only |
| @@ -5618,8 +5605,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) | |||
| 5618 | BUG_ON(rq->nr_running != 1); /* the migration thread */ | 5605 | BUG_ON(rq->nr_running != 1); /* the migration thread */ |
| 5619 | raw_spin_unlock_irqrestore(&rq->lock, flags); | 5606 | raw_spin_unlock_irqrestore(&rq->lock, flags); |
| 5620 | 5607 | ||
| 5621 | migrate_nr_uninterruptible(rq); | 5608 | calc_load_migrate(rq); |
| 5622 | calc_global_load_remove(rq); | ||
| 5623 | break; | 5609 | break; |
| 5624 | #endif | 5610 | #endif |
| 5625 | } | 5611 | } |
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c219bf8d704c..42d9df6a5ca4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
| @@ -2052,7 +2052,7 @@ static void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b) | |||
| 2052 | hrtimer_cancel(&cfs_b->slack_timer); | 2052 | hrtimer_cancel(&cfs_b->slack_timer); |
| 2053 | } | 2053 | } |
| 2054 | 2054 | ||
| 2055 | void unthrottle_offline_cfs_rqs(struct rq *rq) | 2055 | static void unthrottle_offline_cfs_rqs(struct rq *rq) |
| 2056 | { | 2056 | { |
| 2057 | struct cfs_rq *cfs_rq; | 2057 | struct cfs_rq *cfs_rq; |
| 2058 | 2058 | ||
| @@ -2106,7 +2106,7 @@ static inline struct cfs_bandwidth *tg_cfs_bandwidth(struct task_group *tg) | |||
| 2106 | return NULL; | 2106 | return NULL; |
| 2107 | } | 2107 | } |
| 2108 | static inline void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b) {} | 2108 | static inline void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b) {} |
| 2109 | void unthrottle_offline_cfs_rqs(struct rq *rq) {} | 2109 | static inline void unthrottle_offline_cfs_rqs(struct rq *rq) {} |
| 2110 | 2110 | ||
| 2111 | #endif /* CONFIG_CFS_BANDWIDTH */ | 2111 | #endif /* CONFIG_CFS_BANDWIDTH */ |
| 2112 | 2112 | ||
| @@ -3658,7 +3658,6 @@ fix_small_capacity(struct sched_domain *sd, struct sched_group *group) | |||
| 3658 | * @group: sched_group whose statistics are to be updated. | 3658 | * @group: sched_group whose statistics are to be updated. |
| 3659 | * @load_idx: Load index of sched_domain of this_cpu for load calc. | 3659 | * @load_idx: Load index of sched_domain of this_cpu for load calc. |
| 3660 | * @local_group: Does group contain this_cpu. | 3660 | * @local_group: Does group contain this_cpu. |
| 3661 | * @cpus: Set of cpus considered for load balancing. | ||
| 3662 | * @balance: Should we balance. | 3661 | * @balance: Should we balance. |
| 3663 | * @sgs: variable to hold the statistics for this group. | 3662 | * @sgs: variable to hold the statistics for this group. |
| 3664 | */ | 3663 | */ |
| @@ -3805,7 +3804,6 @@ static bool update_sd_pick_busiest(struct lb_env *env, | |||
| 3805 | /** | 3804 | /** |
| 3806 | * update_sd_lb_stats - Update sched_domain's statistics for load balancing. | 3805 | * update_sd_lb_stats - Update sched_domain's statistics for load balancing. |
| 3807 | * @env: The load balancing environment. | 3806 | * @env: The load balancing environment. |
| 3808 | * @cpus: Set of cpus considered for load balancing. | ||
| 3809 | * @balance: Should we balance. | 3807 | * @balance: Should we balance. |
| 3810 | * @sds: variable to hold the statistics for this sched_domain. | 3808 | * @sds: variable to hold the statistics for this sched_domain. |
| 3811 | */ | 3809 | */ |
| @@ -4956,6 +4954,9 @@ static void rq_online_fair(struct rq *rq) | |||
| 4956 | static void rq_offline_fair(struct rq *rq) | 4954 | static void rq_offline_fair(struct rq *rq) |
| 4957 | { | 4955 | { |
| 4958 | update_sysctl(); | 4956 | update_sysctl(); |
| 4957 | |||
| 4958 | /* Ensure any throttled groups are reachable by pick_next_task */ | ||
| 4959 | unthrottle_offline_cfs_rqs(rq); | ||
| 4959 | } | 4960 | } |
| 4960 | 4961 | ||
| 4961 | #endif /* CONFIG_SMP */ | 4962 | #endif /* CONFIG_SMP */ |
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 944cb68420e9..e0b7ba9c040f 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c | |||
| @@ -691,6 +691,7 @@ balanced: | |||
| 691 | * runtime - in which case borrowing doesn't make sense. | 691 | * runtime - in which case borrowing doesn't make sense. |
| 692 | */ | 692 | */ |
| 693 | rt_rq->rt_runtime = RUNTIME_INF; | 693 | rt_rq->rt_runtime = RUNTIME_INF; |
| 694 | rt_rq->rt_throttled = 0; | ||
| 694 | raw_spin_unlock(&rt_rq->rt_runtime_lock); | 695 | raw_spin_unlock(&rt_rq->rt_runtime_lock); |
| 695 | raw_spin_unlock(&rt_b->rt_runtime_lock); | 696 | raw_spin_unlock(&rt_b->rt_runtime_lock); |
| 696 | } | 697 | } |
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index f6714d009e77..0848fa36c383 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h | |||
| @@ -1144,7 +1144,6 @@ extern void print_rt_stats(struct seq_file *m, int cpu); | |||
| 1144 | 1144 | ||
| 1145 | extern void init_cfs_rq(struct cfs_rq *cfs_rq); | 1145 | extern void init_cfs_rq(struct cfs_rq *cfs_rq); |
| 1146 | extern void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq); | 1146 | extern void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq); |
| 1147 | extern void unthrottle_offline_cfs_rqs(struct rq *rq); | ||
| 1148 | 1147 | ||
| 1149 | extern void account_cfs_bandwidth_used(int enabled, int was_enabled); | 1148 | extern void account_cfs_bandwidth_used(int enabled, int was_enabled); |
| 1150 | 1149 | ||
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 024540f97f74..3a9e5d5c1091 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
| @@ -573,6 +573,7 @@ static void tick_nohz_restart_sched_tick(struct tick_sched *ts, ktime_t now) | |||
| 573 | tick_do_update_jiffies64(now); | 573 | tick_do_update_jiffies64(now); |
| 574 | update_cpu_load_nohz(); | 574 | update_cpu_load_nohz(); |
| 575 | 575 | ||
| 576 | calc_load_exit_idle(); | ||
| 576 | touch_softlockup_watchdog(); | 577 | touch_softlockup_watchdog(); |
| 577 | /* | 578 | /* |
| 578 | * Cancel the scheduled timer and restore the tick | 579 | * Cancel the scheduled timer and restore the tick |
diff --git a/lib/digsig.c b/lib/digsig.c index 286d558033e2..8c0e62975c88 100644 --- a/lib/digsig.c +++ b/lib/digsig.c | |||
| @@ -163,9 +163,11 @@ static int digsig_verify_rsa(struct key *key, | |||
| 163 | memcpy(out1 + head, p, l); | 163 | memcpy(out1 + head, p, l); |
| 164 | 164 | ||
| 165 | err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len); | 165 | err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len); |
| 166 | if (err) | ||
| 167 | goto err; | ||
| 166 | 168 | ||
| 167 | if (!err && len == hlen) | 169 | if (len != hlen || memcmp(out2, h, hlen)) |
| 168 | err = memcmp(out2, h, hlen); | 170 | err = -EINVAL; |
| 169 | 171 | ||
| 170 | err: | 172 | err: |
| 171 | mpi_free(in); | 173 | mpi_free(in); |
diff --git a/mm/memblock.c b/mm/memblock.c index 4d9393c7edc9..82aa349d2f7a 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
| @@ -246,7 +246,7 @@ static int __init_memblock memblock_double_array(struct memblock_type *type, | |||
| 246 | min(new_area_start, memblock.current_limit), | 246 | min(new_area_start, memblock.current_limit), |
| 247 | new_alloc_size, PAGE_SIZE); | 247 | new_alloc_size, PAGE_SIZE); |
| 248 | 248 | ||
| 249 | new_array = addr ? __va(addr) : 0; | 249 | new_array = addr ? __va(addr) : NULL; |
| 250 | } | 250 | } |
| 251 | if (!addr) { | 251 | if (!addr) { |
| 252 | pr_err("memblock: Failed to double %s array from %ld to %ld entries !\n", | 252 | pr_err("memblock: Failed to double %s array from %ld to %ld entries !\n", |
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 5ad7da217474..3c094e78dde9 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <net/bluetooth/bluetooth.h> | 29 | #include <net/bluetooth/bluetooth.h> |
| 30 | #include <net/bluetooth/hci_core.h> | 30 | #include <net/bluetooth/hci_core.h> |
| 31 | #include <net/bluetooth/a2mp.h> | 31 | #include <net/bluetooth/a2mp.h> |
| 32 | #include <net/bluetooth/smp.h> | ||
| 32 | 33 | ||
| 33 | static void hci_le_connect(struct hci_conn *conn) | 34 | static void hci_le_connect(struct hci_conn *conn) |
| 34 | { | 35 | { |
| @@ -619,6 +620,9 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | |||
| 619 | { | 620 | { |
| 620 | BT_DBG("hcon %p", conn); | 621 | BT_DBG("hcon %p", conn); |
| 621 | 622 | ||
| 623 | if (conn->type == LE_LINK) | ||
| 624 | return smp_conn_security(conn, sec_level); | ||
| 625 | |||
| 622 | /* For sdp we don't need the link key. */ | 626 | /* For sdp we don't need the link key. */ |
| 623 | if (sec_level == BT_SECURITY_SDP) | 627 | if (sec_level == BT_SECURITY_SDP) |
| 624 | return 1; | 628 | return 1; |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index daa149b7003c..4ea1710a4783 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
| @@ -1199,14 +1199,15 @@ clean: | |||
| 1199 | static void l2cap_conn_ready(struct l2cap_conn *conn) | 1199 | static void l2cap_conn_ready(struct l2cap_conn *conn) |
| 1200 | { | 1200 | { |
| 1201 | struct l2cap_chan *chan; | 1201 | struct l2cap_chan *chan; |
| 1202 | struct hci_conn *hcon = conn->hcon; | ||
| 1202 | 1203 | ||
| 1203 | BT_DBG("conn %p", conn); | 1204 | BT_DBG("conn %p", conn); |
| 1204 | 1205 | ||
| 1205 | if (!conn->hcon->out && conn->hcon->type == LE_LINK) | 1206 | if (!hcon->out && hcon->type == LE_LINK) |
| 1206 | l2cap_le_conn_ready(conn); | 1207 | l2cap_le_conn_ready(conn); |
| 1207 | 1208 | ||
| 1208 | if (conn->hcon->out && conn->hcon->type == LE_LINK) | 1209 | if (hcon->out && hcon->type == LE_LINK) |
| 1209 | smp_conn_security(conn, conn->hcon->pending_sec_level); | 1210 | smp_conn_security(hcon, hcon->pending_sec_level); |
| 1210 | 1211 | ||
| 1211 | mutex_lock(&conn->chan_lock); | 1212 | mutex_lock(&conn->chan_lock); |
| 1212 | 1213 | ||
| @@ -1219,8 +1220,8 @@ static void l2cap_conn_ready(struct l2cap_conn *conn) | |||
| 1219 | continue; | 1220 | continue; |
| 1220 | } | 1221 | } |
| 1221 | 1222 | ||
| 1222 | if (conn->hcon->type == LE_LINK) { | 1223 | if (hcon->type == LE_LINK) { |
| 1223 | if (smp_conn_security(conn, chan->sec_level)) | 1224 | if (smp_conn_security(hcon, chan->sec_level)) |
| 1224 | l2cap_chan_ready(chan); | 1225 | l2cap_chan_ready(chan); |
| 1225 | 1226 | ||
| 1226 | } else if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { | 1227 | } else if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 1497edd191a2..34bbe1c5e389 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
| @@ -616,7 +616,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch | |||
| 616 | break; | 616 | break; |
| 617 | } | 617 | } |
| 618 | 618 | ||
| 619 | if (smp_conn_security(conn, sec.level)) | 619 | if (smp_conn_security(conn->hcon, sec.level)) |
| 620 | break; | 620 | break; |
| 621 | sk->sk_state = BT_CONFIG; | 621 | sk->sk_state = BT_CONFIG; |
| 622 | chan->state = BT_CONFIG; | 622 | chan->state = BT_CONFIG; |
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 901a616c8083..8c225ef349cd 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
| @@ -267,10 +267,10 @@ static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send) | |||
| 267 | mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type, | 267 | mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type, |
| 268 | hcon->dst_type, reason); | 268 | hcon->dst_type, reason); |
| 269 | 269 | ||
| 270 | if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) { | 270 | cancel_delayed_work_sync(&conn->security_timer); |
| 271 | cancel_delayed_work_sync(&conn->security_timer); | 271 | |
| 272 | if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) | ||
| 272 | smp_chan_destroy(conn); | 273 | smp_chan_destroy(conn); |
| 273 | } | ||
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | #define JUST_WORKS 0x00 | 276 | #define JUST_WORKS 0x00 |
| @@ -760,9 +760,9 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb) | |||
| 760 | return 0; | 760 | return 0; |
| 761 | } | 761 | } |
| 762 | 762 | ||
| 763 | int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level) | 763 | int smp_conn_security(struct hci_conn *hcon, __u8 sec_level) |
| 764 | { | 764 | { |
| 765 | struct hci_conn *hcon = conn->hcon; | 765 | struct l2cap_conn *conn = hcon->l2cap_data; |
| 766 | struct smp_chan *smp = conn->smp_chan; | 766 | struct smp_chan *smp = conn->smp_chan; |
| 767 | __u8 authreq; | 767 | __u8 authreq; |
| 768 | 768 | ||
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c index f88ee537fb2b..92de5e5f9db2 100644 --- a/net/bridge/netfilter/ebt_log.c +++ b/net/bridge/netfilter/ebt_log.c | |||
| @@ -80,7 +80,7 @@ ebt_log_packet(u_int8_t pf, unsigned int hooknum, | |||
| 80 | unsigned int bitmask; | 80 | unsigned int bitmask; |
| 81 | 81 | ||
| 82 | spin_lock_bh(&ebt_log_lock); | 82 | spin_lock_bh(&ebt_log_lock); |
| 83 | printk("<%c>%s IN=%s OUT=%s MAC source = %pM MAC dest = %pM proto = 0x%04x", | 83 | printk(KERN_SOH "%c%s IN=%s OUT=%s MAC source = %pM MAC dest = %pM proto = 0x%04x", |
| 84 | '0' + loginfo->u.log.level, prefix, | 84 | '0' + loginfo->u.log.level, prefix, |
| 85 | in ? in->name : "", out ? out->name : "", | 85 | in ? in->name : "", out ? out->name : "", |
| 86 | eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest, | 86 | eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest, |
diff --git a/net/caif/cfsrvl.c b/net/caif/cfsrvl.c index dd485f6128e8..ba217e90765e 100644 --- a/net/caif/cfsrvl.c +++ b/net/caif/cfsrvl.c | |||
| @@ -211,9 +211,10 @@ void caif_client_register_refcnt(struct cflayer *adapt_layer, | |||
| 211 | void (*put)(struct cflayer *lyr)) | 211 | void (*put)(struct cflayer *lyr)) |
| 212 | { | 212 | { |
| 213 | struct cfsrvl *service; | 213 | struct cfsrvl *service; |
| 214 | service = container_of(adapt_layer->dn, struct cfsrvl, layer); | ||
| 215 | 214 | ||
| 216 | WARN_ON(adapt_layer == NULL || adapt_layer->dn == NULL); | 215 | if (WARN_ON(adapt_layer == NULL || adapt_layer->dn == NULL)) |
| 216 | return; | ||
| 217 | service = container_of(adapt_layer->dn, struct cfsrvl, layer); | ||
| 217 | service->hold = hold; | 218 | service->hold = hold; |
| 218 | service->put = put; | 219 | service->put = put; |
| 219 | } | 220 | } |
diff --git a/net/core/dev.c b/net/core/dev.c index 83988362805e..d7fe32c946c1 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -2647,15 +2647,16 @@ void __skb_get_rxhash(struct sk_buff *skb) | |||
| 2647 | if (!skb_flow_dissect(skb, &keys)) | 2647 | if (!skb_flow_dissect(skb, &keys)) |
| 2648 | return; | 2648 | return; |
| 2649 | 2649 | ||
| 2650 | if (keys.ports) { | 2650 | if (keys.ports) |
| 2651 | if ((__force u16)keys.port16[1] < (__force u16)keys.port16[0]) | ||
| 2652 | swap(keys.port16[0], keys.port16[1]); | ||
| 2653 | skb->l4_rxhash = 1; | 2651 | skb->l4_rxhash = 1; |
| 2654 | } | ||
| 2655 | 2652 | ||
| 2656 | /* get a consistent hash (same value on both flow directions) */ | 2653 | /* get a consistent hash (same value on both flow directions) */ |
| 2657 | if ((__force u32)keys.dst < (__force u32)keys.src) | 2654 | if (((__force u32)keys.dst < (__force u32)keys.src) || |
| 2655 | (((__force u32)keys.dst == (__force u32)keys.src) && | ||
| 2656 | ((__force u16)keys.port16[1] < (__force u16)keys.port16[0]))) { | ||
| 2658 | swap(keys.dst, keys.src); | 2657 | swap(keys.dst, keys.src); |
| 2658 | swap(keys.port16[0], keys.port16[1]); | ||
| 2659 | } | ||
| 2659 | 2660 | ||
| 2660 | hash = jhash_3words((__force u32)keys.dst, | 2661 | hash = jhash_3words((__force u32)keys.dst, |
| 2661 | (__force u32)keys.src, | 2662 | (__force u32)keys.src, |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index cce9e53528b1..148e73d2c451 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
| @@ -2721,7 +2721,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev, | |||
| 2721 | /* Eth + IPh + UDPh + mpls */ | 2721 | /* Eth + IPh + UDPh + mpls */ |
| 2722 | datalen = pkt_dev->cur_pkt_size - 14 - 20 - 8 - | 2722 | datalen = pkt_dev->cur_pkt_size - 14 - 20 - 8 - |
| 2723 | pkt_dev->pkt_overhead; | 2723 | pkt_dev->pkt_overhead; |
| 2724 | if (datalen < sizeof(struct pktgen_hdr)) | 2724 | if (datalen < 0 || datalen < sizeof(struct pktgen_hdr)) |
| 2725 | datalen = sizeof(struct pktgen_hdr); | 2725 | datalen = sizeof(struct pktgen_hdr); |
| 2726 | 2726 | ||
| 2727 | udph->source = htons(pkt_dev->cur_udp_src); | 2727 | udph->source = htons(pkt_dev->cur_udp_src); |
diff --git a/net/core/sock.c b/net/core/sock.c index 8f67ced8d6a8..305792076121 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
| @@ -1523,7 +1523,14 @@ EXPORT_SYMBOL(sock_rfree); | |||
| 1523 | 1523 | ||
| 1524 | void sock_edemux(struct sk_buff *skb) | 1524 | void sock_edemux(struct sk_buff *skb) |
| 1525 | { | 1525 | { |
| 1526 | sock_put(skb->sk); | 1526 | struct sock *sk = skb->sk; |
| 1527 | |||
| 1528 | #ifdef CONFIG_INET | ||
| 1529 | if (sk->sk_state == TCP_TIME_WAIT) | ||
| 1530 | inet_twsk_put(inet_twsk(sk)); | ||
| 1531 | else | ||
| 1532 | #endif | ||
| 1533 | sock_put(sk); | ||
| 1527 | } | 1534 | } |
| 1528 | EXPORT_SYMBOL(sock_edemux); | 1535 | EXPORT_SYMBOL(sock_edemux); |
| 1529 | 1536 | ||
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 6f6d1aca3c3d..2814f66dac64 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
| @@ -1226,6 +1226,11 @@ try_again: | |||
| 1226 | 1226 | ||
| 1227 | if (unlikely(err)) { | 1227 | if (unlikely(err)) { |
| 1228 | trace_kfree_skb(skb, udp_recvmsg); | 1228 | trace_kfree_skb(skb, udp_recvmsg); |
| 1229 | if (!peeked) { | ||
| 1230 | atomic_inc(&sk->sk_drops); | ||
| 1231 | UDP_INC_STATS_USER(sock_net(sk), | ||
| 1232 | UDP_MIB_INERRORS, is_udplite); | ||
| 1233 | } | ||
| 1229 | goto out_free; | 1234 | goto out_free; |
| 1230 | } | 1235 | } |
| 1231 | 1236 | ||
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index a3e60cc04a8a..acd32e3f1b68 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
| @@ -403,8 +403,9 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
| 403 | tp->mtu_info = ntohl(info); | 403 | tp->mtu_info = ntohl(info); |
| 404 | if (!sock_owned_by_user(sk)) | 404 | if (!sock_owned_by_user(sk)) |
| 405 | tcp_v6_mtu_reduced(sk); | 405 | tcp_v6_mtu_reduced(sk); |
| 406 | else | 406 | else if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED, |
| 407 | set_bit(TCP_MTU_REDUCED_DEFERRED, &tp->tsq_flags); | 407 | &tp->tsq_flags)) |
| 408 | sock_hold(sk); | ||
| 408 | goto out; | 409 | goto out; |
| 409 | } | 410 | } |
| 410 | 411 | ||
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 99d0077b56b8..07e2bfef6845 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
| @@ -394,6 +394,17 @@ try_again: | |||
| 394 | } | 394 | } |
| 395 | if (unlikely(err)) { | 395 | if (unlikely(err)) { |
| 396 | trace_kfree_skb(skb, udpv6_recvmsg); | 396 | trace_kfree_skb(skb, udpv6_recvmsg); |
| 397 | if (!peeked) { | ||
| 398 | atomic_inc(&sk->sk_drops); | ||
| 399 | if (is_udp4) | ||
| 400 | UDP_INC_STATS_USER(sock_net(sk), | ||
| 401 | UDP_MIB_INERRORS, | ||
| 402 | is_udplite); | ||
| 403 | else | ||
| 404 | UDP6_INC_STATS_USER(sock_net(sk), | ||
| 405 | UDP_MIB_INERRORS, | ||
| 406 | is_udplite); | ||
| 407 | } | ||
| 397 | goto out_free; | 408 | goto out_free; |
| 398 | } | 409 | } |
| 399 | if (!peeked) { | 410 | if (!peeked) { |
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 513cab08a986..1a9f3723c13c 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c | |||
| @@ -1501,6 +1501,8 @@ out: | |||
| 1501 | return err; | 1501 | return err; |
| 1502 | } | 1502 | } |
| 1503 | 1503 | ||
| 1504 | static struct lock_class_key l2tp_socket_class; | ||
| 1505 | |||
| 1504 | int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 peer_tunnel_id, struct l2tp_tunnel_cfg *cfg, struct l2tp_tunnel **tunnelp) | 1506 | int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 peer_tunnel_id, struct l2tp_tunnel_cfg *cfg, struct l2tp_tunnel **tunnelp) |
| 1505 | { | 1507 | { |
| 1506 | struct l2tp_tunnel *tunnel = NULL; | 1508 | struct l2tp_tunnel *tunnel = NULL; |
| @@ -1605,6 +1607,8 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 | |||
| 1605 | tunnel->old_sk_destruct = sk->sk_destruct; | 1607 | tunnel->old_sk_destruct = sk->sk_destruct; |
| 1606 | sk->sk_destruct = &l2tp_tunnel_destruct; | 1608 | sk->sk_destruct = &l2tp_tunnel_destruct; |
| 1607 | tunnel->sock = sk; | 1609 | tunnel->sock = sk; |
| 1610 | lockdep_set_class_and_name(&sk->sk_lock.slock, &l2tp_socket_class, "l2tp_sock"); | ||
| 1611 | |||
| 1608 | sk->sk_allocation = GFP_ATOMIC; | 1612 | sk->sk_allocation = GFP_ATOMIC; |
| 1609 | 1613 | ||
| 1610 | /* Add tunnel to our list */ | 1614 | /* Add tunnel to our list */ |
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c index f9ee74deeac2..3bfb34aaee29 100644 --- a/net/l2tp/l2tp_eth.c +++ b/net/l2tp/l2tp_eth.c | |||
| @@ -153,7 +153,7 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb, | |||
| 153 | print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, skb->data, length); | 153 | print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, skb->data, length); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | if (!pskb_may_pull(skb, sizeof(ETH_HLEN))) | 156 | if (!pskb_may_pull(skb, ETH_HLEN)) |
| 157 | goto error; | 157 | goto error; |
| 158 | 158 | ||
| 159 | secpath_reset(skb); | 159 | secpath_reset(skb); |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index d41974aacf51..a58c0b649ba1 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
| @@ -1378,6 +1378,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, | |||
| 1378 | else | 1378 | else |
| 1379 | memset(next_hop, 0, ETH_ALEN); | 1379 | memset(next_hop, 0, ETH_ALEN); |
| 1380 | 1380 | ||
| 1381 | memset(pinfo, 0, sizeof(*pinfo)); | ||
| 1382 | |||
| 1381 | pinfo->generation = mesh_paths_generation; | 1383 | pinfo->generation = mesh_paths_generation; |
| 1382 | 1384 | ||
| 1383 | pinfo->filled = MPATH_INFO_FRAME_QLEN | | 1385 | pinfo->filled = MPATH_INFO_FRAME_QLEN | |
| @@ -1396,7 +1398,6 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, | |||
| 1396 | pinfo->discovery_timeout = | 1398 | pinfo->discovery_timeout = |
| 1397 | jiffies_to_msecs(mpath->discovery_timeout); | 1399 | jiffies_to_msecs(mpath->discovery_timeout); |
| 1398 | pinfo->discovery_retries = mpath->discovery_retries; | 1400 | pinfo->discovery_retries = mpath->discovery_retries; |
| 1399 | pinfo->flags = 0; | ||
| 1400 | if (mpath->flags & MESH_PATH_ACTIVE) | 1401 | if (mpath->flags & MESH_PATH_ACTIVE) |
| 1401 | pinfo->flags |= NL80211_MPATH_FLAG_ACTIVE; | 1402 | pinfo->flags |= NL80211_MPATH_FLAG_ACTIVE; |
| 1402 | if (mpath->flags & MESH_PATH_RESOLVING) | 1403 | if (mpath->flags & MESH_PATH_RESOLVING) |
| @@ -1405,10 +1406,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, | |||
| 1405 | pinfo->flags |= NL80211_MPATH_FLAG_SN_VALID; | 1406 | pinfo->flags |= NL80211_MPATH_FLAG_SN_VALID; |
| 1406 | if (mpath->flags & MESH_PATH_FIXED) | 1407 | if (mpath->flags & MESH_PATH_FIXED) |
| 1407 | pinfo->flags |= NL80211_MPATH_FLAG_FIXED; | 1408 | pinfo->flags |= NL80211_MPATH_FLAG_FIXED; |
| 1408 | if (mpath->flags & MESH_PATH_RESOLVING) | 1409 | if (mpath->flags & MESH_PATH_RESOLVED) |
| 1409 | pinfo->flags |= NL80211_MPATH_FLAG_RESOLVING; | 1410 | pinfo->flags |= NL80211_MPATH_FLAG_RESOLVED; |
| 1410 | |||
| 1411 | pinfo->flags = mpath->flags; | ||
| 1412 | } | 1411 | } |
| 1413 | 1412 | ||
| 1414 | static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev, | 1413 | static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev, |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index a4a5acdbaa4d..f76b83341cf9 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
| @@ -3248,6 +3248,8 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, | |||
| 3248 | goto out_unlock; | 3248 | goto out_unlock; |
| 3249 | 3249 | ||
| 3250 | err_clear: | 3250 | err_clear: |
| 3251 | memset(ifmgd->bssid, 0, ETH_ALEN); | ||
| 3252 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID); | ||
| 3251 | ifmgd->auth_data = NULL; | 3253 | ifmgd->auth_data = NULL; |
| 3252 | err_free: | 3254 | err_free: |
| 3253 | kfree(auth_data); | 3255 | kfree(auth_data); |
| @@ -3439,6 +3441,8 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, | |||
| 3439 | err = 0; | 3441 | err = 0; |
| 3440 | goto out; | 3442 | goto out; |
| 3441 | err_clear: | 3443 | err_clear: |
| 3444 | memset(ifmgd->bssid, 0, ETH_ALEN); | ||
| 3445 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID); | ||
| 3442 | ifmgd->assoc_data = NULL; | 3446 | ifmgd->assoc_data = NULL; |
| 3443 | err_free: | 3447 | err_free: |
| 3444 | kfree(assoc_data); | 3448 | kfree(assoc_data); |
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index a5ac11ebef33..e046b3756aab 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c | |||
| @@ -158,21 +158,18 @@ static const u8 tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = { | |||
| 158 | * sCL -> sSS | 158 | * sCL -> sSS |
| 159 | */ | 159 | */ |
| 160 | /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sS2 */ | 160 | /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sS2 */ |
| 161 | /*synack*/ { sIV, sIV, sIG, sIG, sIG, sIG, sIG, sIG, sIG, sSR }, | 161 | /*synack*/ { sIV, sIV, sSR, sIV, sIV, sIV, sIV, sIV, sIV, sSR }, |
| 162 | /* | 162 | /* |
| 163 | * sNO -> sIV Too late and no reason to do anything | 163 | * sNO -> sIV Too late and no reason to do anything |
| 164 | * sSS -> sIV Client can't send SYN and then SYN/ACK | 164 | * sSS -> sIV Client can't send SYN and then SYN/ACK |
| 165 | * sS2 -> sSR SYN/ACK sent to SYN2 in simultaneous open | 165 | * sS2 -> sSR SYN/ACK sent to SYN2 in simultaneous open |
| 166 | * sSR -> sIG | 166 | * sSR -> sSR Late retransmitted SYN/ACK in simultaneous open |
| 167 | * sES -> sIG Error: SYNs in window outside the SYN_SENT state | 167 | * sES -> sIV Invalid SYN/ACK packets sent by the client |
| 168 | * are errors. Receiver will reply with RST | 168 | * sFW -> sIV |
| 169 | * and close the connection. | 169 | * sCW -> sIV |
| 170 | * Or we are not in sync and hold a dead connection. | 170 | * sLA -> sIV |
| 171 | * sFW -> sIG | 171 | * sTW -> sIV |
| 172 | * sCW -> sIG | 172 | * sCL -> sIV |
| 173 | * sLA -> sIG | ||
| 174 | * sTW -> sIG | ||
| 175 | * sCL -> sIG | ||
| 176 | */ | 173 | */ |
| 177 | /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sS2 */ | 174 | /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sS2 */ |
| 178 | /*fin*/ { sIV, sIV, sFW, sFW, sLA, sLA, sLA, sTW, sCL, sIV }, | 175 | /*fin*/ { sIV, sIV, sFW, sFW, sLA, sLA, sLA, sTW, sCL, sIV }, |
| @@ -633,15 +630,9 @@ static bool tcp_in_window(const struct nf_conn *ct, | |||
| 633 | ack = sack = receiver->td_end; | 630 | ack = sack = receiver->td_end; |
| 634 | } | 631 | } |
| 635 | 632 | ||
| 636 | if (seq == end | 633 | if (tcph->rst && seq == 0 && state->state == TCP_CONNTRACK_SYN_SENT) |
| 637 | && (!tcph->rst | ||
| 638 | || (seq == 0 && state->state == TCP_CONNTRACK_SYN_SENT))) | ||
| 639 | /* | 634 | /* |
| 640 | * Packets contains no data: we assume it is valid | 635 | * RST sent answering SYN. |
| 641 | * and check the ack value only. | ||
| 642 | * However RST segments are always validated by their | ||
| 643 | * SEQ number, except when seq == 0 (reset sent answering | ||
| 644 | * SYN. | ||
| 645 | */ | 636 | */ |
| 646 | seq = end = sender->td_end; | 637 | seq = end = sender->td_end; |
| 647 | 638 | ||
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 14e2f3903142..5cfb5bedb2b8 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
| @@ -381,6 +381,7 @@ __build_packet_message(struct nfulnl_instance *inst, | |||
| 381 | struct nlmsghdr *nlh; | 381 | struct nlmsghdr *nlh; |
| 382 | struct nfgenmsg *nfmsg; | 382 | struct nfgenmsg *nfmsg; |
| 383 | sk_buff_data_t old_tail = inst->skb->tail; | 383 | sk_buff_data_t old_tail = inst->skb->tail; |
| 384 | struct sock *sk; | ||
| 384 | 385 | ||
| 385 | nlh = nlmsg_put(inst->skb, 0, 0, | 386 | nlh = nlmsg_put(inst->skb, 0, 0, |
| 386 | NFNL_SUBSYS_ULOG << 8 | NFULNL_MSG_PACKET, | 387 | NFNL_SUBSYS_ULOG << 8 | NFULNL_MSG_PACKET, |
| @@ -499,18 +500,19 @@ __build_packet_message(struct nfulnl_instance *inst, | |||
| 499 | } | 500 | } |
| 500 | 501 | ||
| 501 | /* UID */ | 502 | /* UID */ |
| 502 | if (skb->sk) { | 503 | sk = skb->sk; |
| 503 | read_lock_bh(&skb->sk->sk_callback_lock); | 504 | if (sk && sk->sk_state != TCP_TIME_WAIT) { |
| 504 | if (skb->sk->sk_socket && skb->sk->sk_socket->file) { | 505 | read_lock_bh(&sk->sk_callback_lock); |
| 505 | struct file *file = skb->sk->sk_socket->file; | 506 | if (sk->sk_socket && sk->sk_socket->file) { |
| 507 | struct file *file = sk->sk_socket->file; | ||
| 506 | __be32 uid = htonl(file->f_cred->fsuid); | 508 | __be32 uid = htonl(file->f_cred->fsuid); |
| 507 | __be32 gid = htonl(file->f_cred->fsgid); | 509 | __be32 gid = htonl(file->f_cred->fsgid); |
| 508 | read_unlock_bh(&skb->sk->sk_callback_lock); | 510 | read_unlock_bh(&sk->sk_callback_lock); |
| 509 | if (nla_put_be32(inst->skb, NFULA_UID, uid) || | 511 | if (nla_put_be32(inst->skb, NFULA_UID, uid) || |
| 510 | nla_put_be32(inst->skb, NFULA_GID, gid)) | 512 | nla_put_be32(inst->skb, NFULA_GID, gid)) |
| 511 | goto nla_put_failure; | 513 | goto nla_put_failure; |
| 512 | } else | 514 | } else |
| 513 | read_unlock_bh(&skb->sk->sk_callback_lock); | 515 | read_unlock_bh(&sk->sk_callback_lock); |
| 514 | } | 516 | } |
| 515 | 517 | ||
| 516 | /* local sequence number */ | 518 | /* local sequence number */ |
diff --git a/net/netfilter/xt_LOG.c b/net/netfilter/xt_LOG.c index ff5f75fddb15..91e9af4d1f42 100644 --- a/net/netfilter/xt_LOG.c +++ b/net/netfilter/xt_LOG.c | |||
| @@ -145,6 +145,19 @@ static int dump_tcp_header(struct sbuff *m, const struct sk_buff *skb, | |||
| 145 | return 0; | 145 | return 0; |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | static void dump_sk_uid_gid(struct sbuff *m, struct sock *sk) | ||
| 149 | { | ||
| 150 | if (!sk || sk->sk_state == TCP_TIME_WAIT) | ||
| 151 | return; | ||
| 152 | |||
| 153 | read_lock_bh(&sk->sk_callback_lock); | ||
| 154 | if (sk->sk_socket && sk->sk_socket->file) | ||
| 155 | sb_add(m, "UID=%u GID=%u ", | ||
| 156 | sk->sk_socket->file->f_cred->fsuid, | ||
| 157 | sk->sk_socket->file->f_cred->fsgid); | ||
| 158 | read_unlock_bh(&sk->sk_callback_lock); | ||
| 159 | } | ||
| 160 | |||
| 148 | /* One level of recursion won't kill us */ | 161 | /* One level of recursion won't kill us */ |
| 149 | static void dump_ipv4_packet(struct sbuff *m, | 162 | static void dump_ipv4_packet(struct sbuff *m, |
| 150 | const struct nf_loginfo *info, | 163 | const struct nf_loginfo *info, |
| @@ -361,14 +374,8 @@ static void dump_ipv4_packet(struct sbuff *m, | |||
| 361 | } | 374 | } |
| 362 | 375 | ||
| 363 | /* Max length: 15 "UID=4294967295 " */ | 376 | /* Max length: 15 "UID=4294967295 " */ |
| 364 | if ((logflags & XT_LOG_UID) && !iphoff && skb->sk) { | 377 | if ((logflags & XT_LOG_UID) && !iphoff) |
| 365 | read_lock_bh(&skb->sk->sk_callback_lock); | 378 | dump_sk_uid_gid(m, skb->sk); |
| 366 | if (skb->sk->sk_socket && skb->sk->sk_socket->file) | ||
| 367 | sb_add(m, "UID=%u GID=%u ", | ||
| 368 | skb->sk->sk_socket->file->f_cred->fsuid, | ||
| 369 | skb->sk->sk_socket->file->f_cred->fsgid); | ||
| 370 | read_unlock_bh(&skb->sk->sk_callback_lock); | ||
| 371 | } | ||
| 372 | 379 | ||
| 373 | /* Max length: 16 "MARK=0xFFFFFFFF " */ | 380 | /* Max length: 16 "MARK=0xFFFFFFFF " */ |
| 374 | if (!iphoff && skb->mark) | 381 | if (!iphoff && skb->mark) |
| @@ -436,8 +443,8 @@ log_packet_common(struct sbuff *m, | |||
| 436 | const struct nf_loginfo *loginfo, | 443 | const struct nf_loginfo *loginfo, |
| 437 | const char *prefix) | 444 | const char *prefix) |
| 438 | { | 445 | { |
| 439 | sb_add(m, "<%d>%sIN=%s OUT=%s ", loginfo->u.log.level, | 446 | sb_add(m, KERN_SOH "%c%sIN=%s OUT=%s ", |
| 440 | prefix, | 447 | '0' + loginfo->u.log.level, prefix, |
| 441 | in ? in->name : "", | 448 | in ? in->name : "", |
| 442 | out ? out->name : ""); | 449 | out ? out->name : ""); |
| 443 | #ifdef CONFIG_BRIDGE_NETFILTER | 450 | #ifdef CONFIG_BRIDGE_NETFILTER |
| @@ -717,14 +724,8 @@ static void dump_ipv6_packet(struct sbuff *m, | |||
| 717 | } | 724 | } |
| 718 | 725 | ||
| 719 | /* Max length: 15 "UID=4294967295 " */ | 726 | /* Max length: 15 "UID=4294967295 " */ |
| 720 | if ((logflags & XT_LOG_UID) && recurse && skb->sk) { | 727 | if ((logflags & XT_LOG_UID) && recurse) |
| 721 | read_lock_bh(&skb->sk->sk_callback_lock); | 728 | dump_sk_uid_gid(m, skb->sk); |
| 722 | if (skb->sk->sk_socket && skb->sk->sk_socket->file) | ||
| 723 | sb_add(m, "UID=%u GID=%u ", | ||
| 724 | skb->sk->sk_socket->file->f_cred->fsuid, | ||
| 725 | skb->sk->sk_socket->file->f_cred->fsgid); | ||
| 726 | read_unlock_bh(&skb->sk->sk_callback_lock); | ||
| 727 | } | ||
| 728 | 729 | ||
| 729 | /* Max length: 16 "MARK=0xFFFFFFFF " */ | 730 | /* Max length: 16 "MARK=0xFFFFFFFF " */ |
| 730 | if (!recurse && skb->mark) | 731 | if (!recurse && skb->mark) |
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 06592d8b4a2b..1b9024ee963c 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
| @@ -1169,7 +1169,12 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
| 1169 | msg->msg_flags |= MSG_TRUNC; | 1169 | msg->msg_flags |= MSG_TRUNC; |
| 1170 | } | 1170 | } |
| 1171 | 1171 | ||
| 1172 | skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 1172 | er = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); |
| 1173 | if (er < 0) { | ||
| 1174 | skb_free_datagram(sk, skb); | ||
| 1175 | release_sock(sk); | ||
| 1176 | return er; | ||
| 1177 | } | ||
| 1173 | 1178 | ||
| 1174 | if (sax != NULL) { | 1179 | if (sax != NULL) { |
| 1175 | sax->sax25_family = AF_NETROM; | 1180 | sax->sax25_family = AF_NETROM; |
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index f3f96badf5aa..954405ceae9e 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c | |||
| @@ -45,7 +45,7 @@ static int make_writable(struct sk_buff *skb, int write_len) | |||
| 45 | return pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 45 | return pskb_expand_head(skb, 0, 0, GFP_ATOMIC); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | /* remove VLAN header from packet and update csum accrodingly. */ | 48 | /* remove VLAN header from packet and update csum accordingly. */ |
| 49 | static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci) | 49 | static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci) |
| 50 | { | 50 | { |
| 51 | struct vlan_hdr *vhdr; | 51 | struct vlan_hdr *vhdr; |
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index d8277d29e710..cf58cedad083 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
| @@ -425,10 +425,10 @@ static int validate_sample(const struct nlattr *attr, | |||
| 425 | static int validate_tp_port(const struct sw_flow_key *flow_key) | 425 | static int validate_tp_port(const struct sw_flow_key *flow_key) |
| 426 | { | 426 | { |
| 427 | if (flow_key->eth.type == htons(ETH_P_IP)) { | 427 | if (flow_key->eth.type == htons(ETH_P_IP)) { |
| 428 | if (flow_key->ipv4.tp.src && flow_key->ipv4.tp.dst) | 428 | if (flow_key->ipv4.tp.src || flow_key->ipv4.tp.dst) |
| 429 | return 0; | 429 | return 0; |
| 430 | } else if (flow_key->eth.type == htons(ETH_P_IPV6)) { | 430 | } else if (flow_key->eth.type == htons(ETH_P_IPV6)) { |
| 431 | if (flow_key->ipv6.tp.src && flow_key->ipv6.tp.dst) | 431 | if (flow_key->ipv6.tp.src || flow_key->ipv6.tp.dst) |
| 432 | return 0; | 432 | return 0; |
| 433 | } | 433 | } |
| 434 | 434 | ||
| @@ -460,7 +460,7 @@ static int validate_set(const struct nlattr *a, | |||
| 460 | if (flow_key->eth.type != htons(ETH_P_IP)) | 460 | if (flow_key->eth.type != htons(ETH_P_IP)) |
| 461 | return -EINVAL; | 461 | return -EINVAL; |
| 462 | 462 | ||
| 463 | if (!flow_key->ipv4.addr.src || !flow_key->ipv4.addr.dst) | 463 | if (!flow_key->ip.proto) |
| 464 | return -EINVAL; | 464 | return -EINVAL; |
| 465 | 465 | ||
| 466 | ipv4_key = nla_data(ovs_key); | 466 | ipv4_key = nla_data(ovs_key); |
diff --git a/net/openvswitch/flow.h b/net/openvswitch/flow.h index 9b75617ca4e0..c30df1a10c67 100644 --- a/net/openvswitch/flow.h +++ b/net/openvswitch/flow.h | |||
| @@ -145,15 +145,17 @@ u64 ovs_flow_used_time(unsigned long flow_jiffies); | |||
| 145 | * OVS_KEY_ATTR_PRIORITY 4 -- 4 8 | 145 | * OVS_KEY_ATTR_PRIORITY 4 -- 4 8 |
| 146 | * OVS_KEY_ATTR_IN_PORT 4 -- 4 8 | 146 | * OVS_KEY_ATTR_IN_PORT 4 -- 4 8 |
| 147 | * OVS_KEY_ATTR_ETHERNET 12 -- 4 16 | 147 | * OVS_KEY_ATTR_ETHERNET 12 -- 4 16 |
| 148 | * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (outer VLAN ethertype) | ||
| 148 | * OVS_KEY_ATTR_8021Q 4 -- 4 8 | 149 | * OVS_KEY_ATTR_8021Q 4 -- 4 8 |
| 149 | * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 | 150 | * OVS_KEY_ATTR_ENCAP 0 -- 4 4 (VLAN encapsulation) |
| 151 | * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (inner VLAN ethertype) | ||
| 150 | * OVS_KEY_ATTR_IPV6 40 -- 4 44 | 152 | * OVS_KEY_ATTR_IPV6 40 -- 4 44 |
| 151 | * OVS_KEY_ATTR_ICMPV6 2 2 4 8 | 153 | * OVS_KEY_ATTR_ICMPV6 2 2 4 8 |
| 152 | * OVS_KEY_ATTR_ND 28 -- 4 32 | 154 | * OVS_KEY_ATTR_ND 28 -- 4 32 |
| 153 | * ------------------------------------------------- | 155 | * ------------------------------------------------- |
| 154 | * total 132 | 156 | * total 144 |
| 155 | */ | 157 | */ |
| 156 | #define FLOW_BUFSIZE 132 | 158 | #define FLOW_BUFSIZE 144 |
| 157 | 159 | ||
| 158 | int ovs_flow_to_nlattrs(const struct sw_flow_key *, struct sk_buff *); | 160 | int ovs_flow_to_nlattrs(const struct sw_flow_key *, struct sk_buff *); |
| 159 | int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp, | 161 | int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp, |
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 6aabd77d1cfd..564b9fc8efd3 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
| @@ -250,10 +250,11 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) | |||
| 250 | else if ((cl = defmap[res.classid & TC_PRIO_MAX]) == NULL) | 250 | else if ((cl = defmap[res.classid & TC_PRIO_MAX]) == NULL) |
| 251 | cl = defmap[TC_PRIO_BESTEFFORT]; | 251 | cl = defmap[TC_PRIO_BESTEFFORT]; |
| 252 | 252 | ||
| 253 | if (cl == NULL || cl->level >= head->level) | 253 | if (cl == NULL) |
| 254 | goto fallback; | 254 | goto fallback; |
| 255 | } | 255 | } |
| 256 | 256 | if (cl->level >= head->level) | |
| 257 | goto fallback; | ||
| 257 | #ifdef CONFIG_NET_CLS_ACT | 258 | #ifdef CONFIG_NET_CLS_ACT |
| 258 | switch (result) { | 259 | switch (result) { |
| 259 | case TC_ACT_QUEUED: | 260 | case TC_ACT_QUEUED: |
diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index 9fc1c62ec80e..4e606fcb2534 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c | |||
| @@ -191,7 +191,6 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 191 | 191 | ||
| 192 | if (list_empty(&flow->flowchain)) { | 192 | if (list_empty(&flow->flowchain)) { |
| 193 | list_add_tail(&flow->flowchain, &q->new_flows); | 193 | list_add_tail(&flow->flowchain, &q->new_flows); |
| 194 | codel_vars_init(&flow->cvars); | ||
| 195 | q->new_flow_count++; | 194 | q->new_flow_count++; |
| 196 | flow->deficit = q->quantum; | 195 | flow->deficit = q->quantum; |
| 197 | flow->dropped = 0; | 196 | flow->dropped = 0; |
| @@ -418,6 +417,7 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt) | |||
| 418 | struct fq_codel_flow *flow = q->flows + i; | 417 | struct fq_codel_flow *flow = q->flows + i; |
| 419 | 418 | ||
| 420 | INIT_LIST_HEAD(&flow->flowchain); | 419 | INIT_LIST_HEAD(&flow->flowchain); |
| 420 | codel_vars_init(&flow->cvars); | ||
| 421 | } | 421 | } |
| 422 | } | 422 | } |
| 423 | if (sch->limit >= 1) | 423 | if (sch->limit >= 1) |
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index e901583e4ea5..d42234c0f13b 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c | |||
| @@ -102,9 +102,8 @@ static inline int gred_wred_mode_check(struct Qdisc *sch) | |||
| 102 | if (q == NULL) | 102 | if (q == NULL) |
| 103 | continue; | 103 | continue; |
| 104 | 104 | ||
| 105 | for (n = 0; n < table->DPs; n++) | 105 | for (n = i + 1; n < table->DPs; n++) |
| 106 | if (table->tab[n] && table->tab[n] != q && | 106 | if (table->tab[n] && table->tab[n]->prio == q->prio) |
| 107 | table->tab[n]->prio == q->prio) | ||
| 108 | return 1; | 107 | return 1; |
| 109 | } | 108 | } |
| 110 | 109 | ||
| @@ -137,6 +136,7 @@ static inline void gred_store_wred_set(struct gred_sched *table, | |||
| 137 | struct gred_sched_data *q) | 136 | struct gred_sched_data *q) |
| 138 | { | 137 | { |
| 139 | table->wred_set.qavg = q->vars.qavg; | 138 | table->wred_set.qavg = q->vars.qavg; |
| 139 | table->wred_set.qidlestart = q->vars.qidlestart; | ||
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | static inline int gred_use_ecn(struct gred_sched *t) | 142 | static inline int gred_use_ecn(struct gred_sched *t) |
| @@ -176,7 +176,7 @@ static int gred_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 176 | skb->tc_index = (skb->tc_index & ~GRED_VQ_MASK) | dp; | 176 | skb->tc_index = (skb->tc_index & ~GRED_VQ_MASK) | dp; |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | /* sum up all the qaves of prios <= to ours to get the new qave */ | 179 | /* sum up all the qaves of prios < ours to get the new qave */ |
| 180 | if (!gred_wred_mode(t) && gred_rio_mode(t)) { | 180 | if (!gred_wred_mode(t) && gred_rio_mode(t)) { |
| 181 | int i; | 181 | int i; |
| 182 | 182 | ||
| @@ -260,16 +260,18 @@ static struct sk_buff *gred_dequeue(struct Qdisc *sch) | |||
| 260 | } else { | 260 | } else { |
| 261 | q->backlog -= qdisc_pkt_len(skb); | 261 | q->backlog -= qdisc_pkt_len(skb); |
| 262 | 262 | ||
| 263 | if (!q->backlog && !gred_wred_mode(t)) | 263 | if (gred_wred_mode(t)) { |
| 264 | red_start_of_idle_period(&q->vars); | 264 | if (!sch->qstats.backlog) |
| 265 | red_start_of_idle_period(&t->wred_set); | ||
| 266 | } else { | ||
| 267 | if (!q->backlog) | ||
| 268 | red_start_of_idle_period(&q->vars); | ||
| 269 | } | ||
| 265 | } | 270 | } |
| 266 | 271 | ||
| 267 | return skb; | 272 | return skb; |
| 268 | } | 273 | } |
| 269 | 274 | ||
| 270 | if (gred_wred_mode(t) && !red_is_idling(&t->wred_set)) | ||
| 271 | red_start_of_idle_period(&t->wred_set); | ||
| 272 | |||
| 273 | return NULL; | 275 | return NULL; |
| 274 | } | 276 | } |
| 275 | 277 | ||
| @@ -291,19 +293,20 @@ static unsigned int gred_drop(struct Qdisc *sch) | |||
| 291 | q->backlog -= len; | 293 | q->backlog -= len; |
| 292 | q->stats.other++; | 294 | q->stats.other++; |
| 293 | 295 | ||
| 294 | if (!q->backlog && !gred_wred_mode(t)) | 296 | if (gred_wred_mode(t)) { |
| 295 | red_start_of_idle_period(&q->vars); | 297 | if (!sch->qstats.backlog) |
| 298 | red_start_of_idle_period(&t->wred_set); | ||
| 299 | } else { | ||
| 300 | if (!q->backlog) | ||
| 301 | red_start_of_idle_period(&q->vars); | ||
| 302 | } | ||
| 296 | } | 303 | } |
| 297 | 304 | ||
| 298 | qdisc_drop(skb, sch); | 305 | qdisc_drop(skb, sch); |
| 299 | return len; | 306 | return len; |
| 300 | } | 307 | } |
| 301 | 308 | ||
| 302 | if (gred_wred_mode(t) && !red_is_idling(&t->wred_set)) | ||
| 303 | red_start_of_idle_period(&t->wred_set); | ||
| 304 | |||
| 305 | return 0; | 309 | return 0; |
| 306 | |||
| 307 | } | 310 | } |
| 308 | 311 | ||
| 309 | static void gred_reset(struct Qdisc *sch) | 312 | static void gred_reset(struct Qdisc *sch) |
| @@ -535,6 +538,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb) | |||
| 535 | for (i = 0; i < MAX_DPs; i++) { | 538 | for (i = 0; i < MAX_DPs; i++) { |
| 536 | struct gred_sched_data *q = table->tab[i]; | 539 | struct gred_sched_data *q = table->tab[i]; |
| 537 | struct tc_gred_qopt opt; | 540 | struct tc_gred_qopt opt; |
| 541 | unsigned long qavg; | ||
| 538 | 542 | ||
| 539 | memset(&opt, 0, sizeof(opt)); | 543 | memset(&opt, 0, sizeof(opt)); |
| 540 | 544 | ||
| @@ -566,7 +570,9 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb) | |||
| 566 | if (gred_wred_mode(table)) | 570 | if (gred_wred_mode(table)) |
| 567 | gred_load_wred_set(table, q); | 571 | gred_load_wred_set(table, q); |
| 568 | 572 | ||
| 569 | opt.qave = red_calc_qavg(&q->parms, &q->vars, q->vars.qavg); | 573 | qavg = red_calc_qavg(&q->parms, &q->vars, |
| 574 | q->vars.qavg >> q->parms.Wlog); | ||
| 575 | opt.qave = qavg >> q->parms.Wlog; | ||
| 570 | 576 | ||
| 571 | append_opt: | 577 | append_opt: |
| 572 | if (nla_append(skb, sizeof(opt), &opt) < 0) | 578 | if (nla_append(skb, sizeof(opt), &opt) < 0) |
diff --git a/net/sctp/output.c b/net/sctp/output.c index 838e18b4d7ea..be50aa234dcd 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
| @@ -364,6 +364,25 @@ finish: | |||
| 364 | return retval; | 364 | return retval; |
| 365 | } | 365 | } |
| 366 | 366 | ||
| 367 | static void sctp_packet_release_owner(struct sk_buff *skb) | ||
| 368 | { | ||
| 369 | sk_free(skb->sk); | ||
| 370 | } | ||
| 371 | |||
| 372 | static void sctp_packet_set_owner_w(struct sk_buff *skb, struct sock *sk) | ||
| 373 | { | ||
| 374 | skb_orphan(skb); | ||
| 375 | skb->sk = sk; | ||
| 376 | skb->destructor = sctp_packet_release_owner; | ||
| 377 | |||
| 378 | /* | ||
| 379 | * The data chunks have already been accounted for in sctp_sendmsg(), | ||
| 380 | * therefore only reserve a single byte to keep socket around until | ||
| 381 | * the packet has been transmitted. | ||
| 382 | */ | ||
| 383 | atomic_inc(&sk->sk_wmem_alloc); | ||
| 384 | } | ||
| 385 | |||
| 367 | /* All packets are sent to the network through this function from | 386 | /* All packets are sent to the network through this function from |
| 368 | * sctp_outq_tail(). | 387 | * sctp_outq_tail(). |
| 369 | * | 388 | * |
| @@ -405,7 +424,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
| 405 | /* Set the owning socket so that we know where to get the | 424 | /* Set the owning socket so that we know where to get the |
| 406 | * destination IP address. | 425 | * destination IP address. |
| 407 | */ | 426 | */ |
| 408 | skb_set_owner_w(nskb, sk); | 427 | sctp_packet_set_owner_w(nskb, sk); |
| 409 | 428 | ||
| 410 | if (!sctp_transport_dst_check(tp)) { | 429 | if (!sctp_transport_dst_check(tp)) { |
| 411 | sctp_transport_route(tp, NULL, sctp_sk(sk)); | 430 | sctp_transport_route(tp, NULL, sctp_sk(sk)); |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index a5a402a7d21f..5d7f61d7559c 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
| @@ -969,11 +969,11 @@ static bool xprt_dynamic_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req) | |||
| 969 | return false; | 969 | return false; |
| 970 | } | 970 | } |
| 971 | 971 | ||
| 972 | static void xprt_alloc_slot(struct rpc_task *task) | 972 | void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task) |
| 973 | { | 973 | { |
| 974 | struct rpc_xprt *xprt = task->tk_xprt; | ||
| 975 | struct rpc_rqst *req; | 974 | struct rpc_rqst *req; |
| 976 | 975 | ||
| 976 | spin_lock(&xprt->reserve_lock); | ||
| 977 | if (!list_empty(&xprt->free)) { | 977 | if (!list_empty(&xprt->free)) { |
| 978 | req = list_entry(xprt->free.next, struct rpc_rqst, rq_list); | 978 | req = list_entry(xprt->free.next, struct rpc_rqst, rq_list); |
| 979 | list_del(&req->rq_list); | 979 | list_del(&req->rq_list); |
| @@ -994,12 +994,29 @@ static void xprt_alloc_slot(struct rpc_task *task) | |||
| 994 | default: | 994 | default: |
| 995 | task->tk_status = -EAGAIN; | 995 | task->tk_status = -EAGAIN; |
| 996 | } | 996 | } |
| 997 | spin_unlock(&xprt->reserve_lock); | ||
| 997 | return; | 998 | return; |
| 998 | out_init_req: | 999 | out_init_req: |
| 999 | task->tk_status = 0; | 1000 | task->tk_status = 0; |
| 1000 | task->tk_rqstp = req; | 1001 | task->tk_rqstp = req; |
| 1001 | xprt_request_init(task, xprt); | 1002 | xprt_request_init(task, xprt); |
| 1003 | spin_unlock(&xprt->reserve_lock); | ||
| 1004 | } | ||
| 1005 | EXPORT_SYMBOL_GPL(xprt_alloc_slot); | ||
| 1006 | |||
| 1007 | void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task) | ||
| 1008 | { | ||
| 1009 | /* Note: grabbing the xprt_lock_write() ensures that we throttle | ||
| 1010 | * new slot allocation if the transport is congested (i.e. when | ||
| 1011 | * reconnecting a stream transport or when out of socket write | ||
| 1012 | * buffer space). | ||
| 1013 | */ | ||
| 1014 | if (xprt_lock_write(xprt, task)) { | ||
| 1015 | xprt_alloc_slot(xprt, task); | ||
| 1016 | xprt_release_write(xprt, task); | ||
| 1017 | } | ||
| 1002 | } | 1018 | } |
| 1019 | EXPORT_SYMBOL_GPL(xprt_lock_and_alloc_slot); | ||
| 1003 | 1020 | ||
| 1004 | static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req) | 1021 | static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req) |
| 1005 | { | 1022 | { |
| @@ -1083,20 +1100,9 @@ void xprt_reserve(struct rpc_task *task) | |||
| 1083 | if (task->tk_rqstp != NULL) | 1100 | if (task->tk_rqstp != NULL) |
| 1084 | return; | 1101 | return; |
| 1085 | 1102 | ||
| 1086 | /* Note: grabbing the xprt_lock_write() here is not strictly needed, | ||
| 1087 | * but ensures that we throttle new slot allocation if the transport | ||
| 1088 | * is congested (e.g. if reconnecting or if we're out of socket | ||
| 1089 | * write buffer space). | ||
| 1090 | */ | ||
| 1091 | task->tk_timeout = 0; | 1103 | task->tk_timeout = 0; |
| 1092 | task->tk_status = -EAGAIN; | 1104 | task->tk_status = -EAGAIN; |
| 1093 | if (!xprt_lock_write(xprt, task)) | 1105 | xprt->ops->alloc_slot(xprt, task); |
| 1094 | return; | ||
| 1095 | |||
| 1096 | spin_lock(&xprt->reserve_lock); | ||
| 1097 | xprt_alloc_slot(task); | ||
| 1098 | spin_unlock(&xprt->reserve_lock); | ||
| 1099 | xprt_release_write(xprt, task); | ||
| 1100 | } | 1106 | } |
| 1101 | 1107 | ||
| 1102 | static inline __be32 xprt_alloc_xid(struct rpc_xprt *xprt) | 1108 | static inline __be32 xprt_alloc_xid(struct rpc_xprt *xprt) |
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 06cdbff79e4a..5d9202dc7cb1 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
| @@ -713,6 +713,7 @@ static void xprt_rdma_print_stats(struct rpc_xprt *xprt, struct seq_file *seq) | |||
| 713 | static struct rpc_xprt_ops xprt_rdma_procs = { | 713 | static struct rpc_xprt_ops xprt_rdma_procs = { |
| 714 | .reserve_xprt = xprt_rdma_reserve_xprt, | 714 | .reserve_xprt = xprt_rdma_reserve_xprt, |
| 715 | .release_xprt = xprt_release_xprt_cong, /* sunrpc/xprt.c */ | 715 | .release_xprt = xprt_release_xprt_cong, /* sunrpc/xprt.c */ |
| 716 | .alloc_slot = xprt_alloc_slot, | ||
| 716 | .release_request = xprt_release_rqst_cong, /* ditto */ | 717 | .release_request = xprt_release_rqst_cong, /* ditto */ |
| 717 | .set_retrans_timeout = xprt_set_retrans_timeout_def, /* ditto */ | 718 | .set_retrans_timeout = xprt_set_retrans_timeout_def, /* ditto */ |
| 718 | .rpcbind = rpcb_getport_async, /* sunrpc/rpcb_clnt.c */ | 719 | .rpcbind = rpcb_getport_async, /* sunrpc/rpcb_clnt.c */ |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 400567243f84..a35b8e52e551 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
| @@ -2473,6 +2473,7 @@ static void bc_destroy(struct rpc_xprt *xprt) | |||
| 2473 | static struct rpc_xprt_ops xs_local_ops = { | 2473 | static struct rpc_xprt_ops xs_local_ops = { |
| 2474 | .reserve_xprt = xprt_reserve_xprt, | 2474 | .reserve_xprt = xprt_reserve_xprt, |
| 2475 | .release_xprt = xs_tcp_release_xprt, | 2475 | .release_xprt = xs_tcp_release_xprt, |
| 2476 | .alloc_slot = xprt_alloc_slot, | ||
| 2476 | .rpcbind = xs_local_rpcbind, | 2477 | .rpcbind = xs_local_rpcbind, |
| 2477 | .set_port = xs_local_set_port, | 2478 | .set_port = xs_local_set_port, |
| 2478 | .connect = xs_connect, | 2479 | .connect = xs_connect, |
| @@ -2489,6 +2490,7 @@ static struct rpc_xprt_ops xs_udp_ops = { | |||
| 2489 | .set_buffer_size = xs_udp_set_buffer_size, | 2490 | .set_buffer_size = xs_udp_set_buffer_size, |
| 2490 | .reserve_xprt = xprt_reserve_xprt_cong, | 2491 | .reserve_xprt = xprt_reserve_xprt_cong, |
| 2491 | .release_xprt = xprt_release_xprt_cong, | 2492 | .release_xprt = xprt_release_xprt_cong, |
| 2493 | .alloc_slot = xprt_alloc_slot, | ||
| 2492 | .rpcbind = rpcb_getport_async, | 2494 | .rpcbind = rpcb_getport_async, |
| 2493 | .set_port = xs_set_port, | 2495 | .set_port = xs_set_port, |
| 2494 | .connect = xs_connect, | 2496 | .connect = xs_connect, |
| @@ -2506,6 +2508,7 @@ static struct rpc_xprt_ops xs_udp_ops = { | |||
| 2506 | static struct rpc_xprt_ops xs_tcp_ops = { | 2508 | static struct rpc_xprt_ops xs_tcp_ops = { |
| 2507 | .reserve_xprt = xprt_reserve_xprt, | 2509 | .reserve_xprt = xprt_reserve_xprt, |
| 2508 | .release_xprt = xs_tcp_release_xprt, | 2510 | .release_xprt = xs_tcp_release_xprt, |
| 2511 | .alloc_slot = xprt_lock_and_alloc_slot, | ||
| 2509 | .rpcbind = rpcb_getport_async, | 2512 | .rpcbind = rpcb_getport_async, |
| 2510 | .set_port = xs_set_port, | 2513 | .set_port = xs_set_port, |
| 2511 | .connect = xs_connect, | 2514 | .connect = xs_connect, |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 97026f3b215a..1e37dbf00cb3 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
| @@ -5633,8 +5633,10 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) | |||
| 5633 | sizeof(connect.ht_capa_mask)); | 5633 | sizeof(connect.ht_capa_mask)); |
| 5634 | 5634 | ||
| 5635 | if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) { | 5635 | if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) { |
| 5636 | if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) | 5636 | if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) { |
| 5637 | kfree(connkeys); | ||
| 5637 | return -EINVAL; | 5638 | return -EINVAL; |
| 5639 | } | ||
| 5638 | memcpy(&connect.ht_capa, | 5640 | memcpy(&connect.ht_capa, |
| 5639 | nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]), | 5641 | nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]), |
| 5640 | sizeof(connect.ht_capa)); | 5642 | sizeof(connect.ht_capa)); |
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index 54a0dc2e2f8d..ab2bb42fe094 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c | |||
| @@ -212,7 +212,7 @@ resume: | |||
| 212 | /* only the first xfrm gets the encap type */ | 212 | /* only the first xfrm gets the encap type */ |
| 213 | encap_type = 0; | 213 | encap_type = 0; |
| 214 | 214 | ||
| 215 | if (async && x->repl->check(x, skb, seq)) { | 215 | if (async && x->repl->recheck(x, skb, seq)) { |
| 216 | XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATESEQERROR); | 216 | XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATESEQERROR); |
| 217 | goto drop_unlock; | 217 | goto drop_unlock; |
| 218 | } | 218 | } |
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c index 2f6d11d04a2b..3efb07d3eb27 100644 --- a/net/xfrm/xfrm_replay.c +++ b/net/xfrm/xfrm_replay.c | |||
| @@ -420,6 +420,18 @@ err: | |||
| 420 | return -EINVAL; | 420 | return -EINVAL; |
| 421 | } | 421 | } |
| 422 | 422 | ||
| 423 | static int xfrm_replay_recheck_esn(struct xfrm_state *x, | ||
| 424 | struct sk_buff *skb, __be32 net_seq) | ||
| 425 | { | ||
| 426 | if (unlikely(XFRM_SKB_CB(skb)->seq.input.hi != | ||
| 427 | htonl(xfrm_replay_seqhi(x, net_seq)))) { | ||
| 428 | x->stats.replay_window++; | ||
| 429 | return -EINVAL; | ||
| 430 | } | ||
| 431 | |||
| 432 | return xfrm_replay_check_esn(x, skb, net_seq); | ||
| 433 | } | ||
| 434 | |||
| 423 | static void xfrm_replay_advance_esn(struct xfrm_state *x, __be32 net_seq) | 435 | static void xfrm_replay_advance_esn(struct xfrm_state *x, __be32 net_seq) |
| 424 | { | 436 | { |
| 425 | unsigned int bitnr, nr, i; | 437 | unsigned int bitnr, nr, i; |
| @@ -479,6 +491,7 @@ static void xfrm_replay_advance_esn(struct xfrm_state *x, __be32 net_seq) | |||
| 479 | static struct xfrm_replay xfrm_replay_legacy = { | 491 | static struct xfrm_replay xfrm_replay_legacy = { |
| 480 | .advance = xfrm_replay_advance, | 492 | .advance = xfrm_replay_advance, |
| 481 | .check = xfrm_replay_check, | 493 | .check = xfrm_replay_check, |
| 494 | .recheck = xfrm_replay_check, | ||
| 482 | .notify = xfrm_replay_notify, | 495 | .notify = xfrm_replay_notify, |
| 483 | .overflow = xfrm_replay_overflow, | 496 | .overflow = xfrm_replay_overflow, |
| 484 | }; | 497 | }; |
| @@ -486,6 +499,7 @@ static struct xfrm_replay xfrm_replay_legacy = { | |||
| 486 | static struct xfrm_replay xfrm_replay_bmp = { | 499 | static struct xfrm_replay xfrm_replay_bmp = { |
| 487 | .advance = xfrm_replay_advance_bmp, | 500 | .advance = xfrm_replay_advance_bmp, |
| 488 | .check = xfrm_replay_check_bmp, | 501 | .check = xfrm_replay_check_bmp, |
| 502 | .recheck = xfrm_replay_check_bmp, | ||
| 489 | .notify = xfrm_replay_notify_bmp, | 503 | .notify = xfrm_replay_notify_bmp, |
| 490 | .overflow = xfrm_replay_overflow_bmp, | 504 | .overflow = xfrm_replay_overflow_bmp, |
| 491 | }; | 505 | }; |
| @@ -493,6 +507,7 @@ static struct xfrm_replay xfrm_replay_bmp = { | |||
| 493 | static struct xfrm_replay xfrm_replay_esn = { | 507 | static struct xfrm_replay xfrm_replay_esn = { |
| 494 | .advance = xfrm_replay_advance_esn, | 508 | .advance = xfrm_replay_advance_esn, |
| 495 | .check = xfrm_replay_check_esn, | 509 | .check = xfrm_replay_check_esn, |
| 510 | .recheck = xfrm_replay_recheck_esn, | ||
| 496 | .notify = xfrm_replay_notify_bmp, | 511 | .notify = xfrm_replay_notify_bmp, |
| 497 | .overflow = xfrm_replay_overflow_esn, | 512 | .overflow = xfrm_replay_overflow_esn, |
| 498 | }; | 513 | }; |
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index ec2118d0e27a..eb60cb8dbb8a 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c | |||
| @@ -80,14 +80,12 @@ static int snd_compr_open(struct inode *inode, struct file *f) | |||
| 80 | int maj = imajor(inode); | 80 | int maj = imajor(inode); |
| 81 | int ret; | 81 | int ret; |
| 82 | 82 | ||
| 83 | if (f->f_flags & O_WRONLY) | 83 | if ((f->f_flags & O_ACCMODE) == O_WRONLY) |
| 84 | dirn = SND_COMPRESS_PLAYBACK; | 84 | dirn = SND_COMPRESS_PLAYBACK; |
| 85 | else if (f->f_flags & O_RDONLY) | 85 | else if ((f->f_flags & O_ACCMODE) == O_RDONLY) |
| 86 | dirn = SND_COMPRESS_CAPTURE; | 86 | dirn = SND_COMPRESS_CAPTURE; |
| 87 | else { | 87 | else |
| 88 | pr_err("invalid direction\n"); | ||
| 89 | return -EINVAL; | 88 | return -EINVAL; |
| 90 | } | ||
| 91 | 89 | ||
| 92 | if (maj == snd_major) | 90 | if (maj == snd_major) |
| 93 | compr = snd_lookup_minor_data(iminor(inode), | 91 | compr = snd_lookup_minor_data(iminor(inode), |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index f25c24c743f9..1c65cc5e3a31 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
| @@ -2353,6 +2353,7 @@ int snd_hda_codec_reset(struct hda_codec *codec) | |||
| 2353 | } | 2353 | } |
| 2354 | if (codec->patch_ops.free) | 2354 | if (codec->patch_ops.free) |
| 2355 | codec->patch_ops.free(codec); | 2355 | codec->patch_ops.free(codec); |
| 2356 | memset(&codec->patch_ops, 0, sizeof(codec->patch_ops)); | ||
| 2356 | snd_hda_jack_tbl_clear(codec); | 2357 | snd_hda_jack_tbl_clear(codec); |
| 2357 | codec->proc_widget_hook = NULL; | 2358 | codec->proc_widget_hook = NULL; |
| 2358 | codec->spec = NULL; | 2359 | codec->spec = NULL; |
| @@ -2368,7 +2369,6 @@ int snd_hda_codec_reset(struct hda_codec *codec) | |||
| 2368 | codec->num_pcms = 0; | 2369 | codec->num_pcms = 0; |
| 2369 | codec->pcm_info = NULL; | 2370 | codec->pcm_info = NULL; |
| 2370 | codec->preset = NULL; | 2371 | codec->preset = NULL; |
| 2371 | memset(&codec->patch_ops, 0, sizeof(codec->patch_ops)); | ||
| 2372 | codec->slave_dig_outs = NULL; | 2372 | codec->slave_dig_outs = NULL; |
| 2373 | codec->spdif_status_reset = 0; | 2373 | codec->spdif_status_reset = 0; |
| 2374 | module_put(codec->owner); | 2374 | module_put(codec->owner); |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 60882c62f180..228cdf93fa29 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
| @@ -2701,6 +2701,7 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = { | |||
| 2701 | SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), | 2701 | SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), |
| 2702 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), | 2702 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), |
| 2703 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), | 2703 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), |
| 2704 | SND_PCI_QUIRK(0x1043, 0x1b43, "ASUS K53E", POS_FIX_POSBUF), | ||
| 2704 | SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), | 2705 | SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), |
| 2705 | SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB), | 2706 | SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB), |
| 2706 | SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB), | 2707 | SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB), |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 6f806d3e56bb..3d4722f0a1ca 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
| @@ -1075,7 +1075,7 @@ static struct snd_kcontrol_new stac_smux_mixer = { | |||
| 1075 | 1075 | ||
| 1076 | static const char * const slave_pfxs[] = { | 1076 | static const char * const slave_pfxs[] = { |
| 1077 | "Front", "Surround", "Center", "LFE", "Side", | 1077 | "Front", "Surround", "Center", "LFE", "Side", |
| 1078 | "Headphone", "Speaker", "IEC958", | 1078 | "Headphone", "Speaker", "IEC958", "PCM", |
| 1079 | NULL | 1079 | NULL |
| 1080 | }; | 1080 | }; |
| 1081 | 1081 | ||
diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c index 764cc93dbca4..075d5aa1fee0 100644 --- a/sound/pci/ice1712/prodigy_hifi.c +++ b/sound/pci/ice1712/prodigy_hifi.c | |||
| @@ -297,6 +297,7 @@ static int ak4396_dac_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem | |||
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); | 299 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); |
| 300 | static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); | ||
| 300 | 301 | ||
| 301 | static struct snd_kcontrol_new prodigy_hd2_controls[] __devinitdata = { | 302 | static struct snd_kcontrol_new prodigy_hd2_controls[] __devinitdata = { |
| 302 | { | 303 | { |
| @@ -307,7 +308,7 @@ static struct snd_kcontrol_new prodigy_hd2_controls[] __devinitdata = { | |||
| 307 | .info = ak4396_dac_vol_info, | 308 | .info = ak4396_dac_vol_info, |
| 308 | .get = ak4396_dac_vol_get, | 309 | .get = ak4396_dac_vol_get, |
| 309 | .put = ak4396_dac_vol_put, | 310 | .put = ak4396_dac_vol_put, |
| 310 | .tlv = { .p = db_scale_wm_dac }, | 311 | .tlv = { .p = ak4396_db_scale }, |
| 311 | }, | 312 | }, |
| 312 | }; | 313 | }; |
| 313 | 314 | ||
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index fd5e982fc98c..f782ce19bf5a 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c | |||
| @@ -1140,6 +1140,12 @@ static void retire_playback_urb(struct snd_usb_substream *subs, | |||
| 1140 | int processed = urb->transfer_buffer_length / stride; | 1140 | int processed = urb->transfer_buffer_length / stride; |
| 1141 | int est_delay; | 1141 | int est_delay; |
| 1142 | 1142 | ||
| 1143 | /* ignore the delay accounting when procssed=0 is given, i.e. | ||
| 1144 | * silent payloads are procssed before handling the actual data | ||
| 1145 | */ | ||
| 1146 | if (!processed) | ||
| 1147 | return; | ||
| 1148 | |||
| 1143 | spin_lock_irqsave(&subs->lock, flags); | 1149 | spin_lock_irqsave(&subs->lock, flags); |
| 1144 | est_delay = snd_usb_pcm_delay(subs, runtime->rate); | 1150 | est_delay = snd_usb_pcm_delay(subs, runtime->rate); |
| 1145 | /* update delay with exact number of samples played */ | 1151 | /* update delay with exact number of samples played */ |
