diff options
67 files changed, 513 insertions, 282 deletions
diff --git a/Documentation/i2c/busses/i2c-ocores b/Documentation/i2c/busses/i2c-ocores index c269aaa2f26a..9e1dfe7553ad 100644 --- a/Documentation/i2c/busses/i2c-ocores +++ b/Documentation/i2c/busses/i2c-ocores | |||
| @@ -2,7 +2,7 @@ Kernel driver i2c-ocores | |||
| 2 | 2 | ||
| 3 | Supported adapters: | 3 | Supported adapters: |
| 4 | * OpenCores.org I2C controller by Richard Herveille (see datasheet link) | 4 | * OpenCores.org I2C controller by Richard Herveille (see datasheet link) |
| 5 | Datasheet: http://www.opencores.org/projects.cgi/web/i2c/overview | 5 | https://opencores.org/project/i2c/overview |
| 6 | 6 | ||
| 7 | Author: Peter Korsgaard <jacmet@sunsite.dk> | 7 | Author: Peter Korsgaard <jacmet@sunsite.dk> |
| 8 | 8 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index ca4afd68530c..9c125f705f78 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -15513,6 +15513,14 @@ L: linux-kernel@vger.kernel.org | |||
| 15513 | S: Supported | 15513 | S: Supported |
| 15514 | F: drivers/char/xillybus/ | 15514 | F: drivers/char/xillybus/ |
| 15515 | 15515 | ||
| 15516 | XLP9XX I2C DRIVER | ||
| 15517 | M: George Cherian <george.cherian@cavium.com> | ||
| 15518 | M: Jan Glauber <jglauber@cavium.com> | ||
| 15519 | L: linux-i2c@vger.kernel.org | ||
| 15520 | W: http://www.cavium.com | ||
| 15521 | S: Supported | ||
| 15522 | F: drivers/i2c/busses/i2c-xlp9xx.c | ||
| 15523 | |||
| 15516 | XRA1403 GPIO EXPANDER | 15524 | XRA1403 GPIO EXPANDER |
| 15517 | M: Nandor Han <nandor.han@ge.com> | 15525 | M: Nandor Han <nandor.han@ge.com> |
| 15518 | M: Semi Malinen <semi.malinen@ge.com> | 15526 | M: Semi Malinen <semi.malinen@ge.com> |
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index b9e9bf628849..3775a8d694fb 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
| @@ -721,6 +721,10 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value) | |||
| 721 | if (value & ~known_bits) | 721 | if (value & ~known_bits) |
| 722 | return -EOPNOTSUPP; | 722 | return -EOPNOTSUPP; |
| 723 | 723 | ||
| 724 | /* Setting FRE without FR is not supported. */ | ||
| 725 | if ((value & (PR_FP_MODE_FR | PR_FP_MODE_FRE)) == PR_FP_MODE_FRE) | ||
| 726 | return -EOPNOTSUPP; | ||
| 727 | |||
| 724 | /* Avoid inadvertently triggering emulation */ | 728 | /* Avoid inadvertently triggering emulation */ |
| 725 | if ((value & PR_FP_MODE_FR) && raw_cpu_has_fpu && | 729 | if ((value & PR_FP_MODE_FR) && raw_cpu_has_fpu && |
| 726 | !(raw_current_cpu_data.fpu_id & MIPS_FPIR_F64)) | 730 | !(raw_current_cpu_data.fpu_id & MIPS_FPIR_F64)) |
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 8d098b9f395c..0c0c23c9c9f5 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c | |||
| @@ -818,7 +818,7 @@ long arch_ptrace(struct task_struct *child, long request, | |||
| 818 | break; | 818 | break; |
| 819 | } | 819 | } |
| 820 | #endif | 820 | #endif |
| 821 | tmp = get_fpr32(&fregs[addr - FPR_BASE], 0); | 821 | tmp = get_fpr64(&fregs[addr - FPR_BASE], 0); |
| 822 | break; | 822 | break; |
| 823 | case PC: | 823 | case PC: |
| 824 | tmp = regs->cp0_epc; | 824 | tmp = regs->cp0_epc; |
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c index 656a137c1fe2..f30c381d3e1c 100644 --- a/arch/mips/kernel/ptrace32.c +++ b/arch/mips/kernel/ptrace32.c | |||
| @@ -109,7 +109,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
| 109 | addr & 1); | 109 | addr & 1); |
| 110 | break; | 110 | break; |
| 111 | } | 111 | } |
| 112 | tmp = get_fpr32(&fregs[addr - FPR_BASE], 0); | 112 | tmp = get_fpr64(&fregs[addr - FPR_BASE], 0); |
| 113 | break; | 113 | break; |
| 114 | case PC: | 114 | case PC: |
| 115 | tmp = regs->cp0_epc; | 115 | tmp = regs->cp0_epc; |
diff --git a/arch/nds32/Kconfig b/arch/nds32/Kconfig index 249f38d3388f..b7404f2dcf5b 100644 --- a/arch/nds32/Kconfig +++ b/arch/nds32/Kconfig | |||
| @@ -9,6 +9,12 @@ config NDS32 | |||
| 9 | select CLKSRC_MMIO | 9 | select CLKSRC_MMIO |
| 10 | select CLONE_BACKWARDS | 10 | select CLONE_BACKWARDS |
| 11 | select COMMON_CLK | 11 | select COMMON_CLK |
| 12 | select GENERIC_ASHLDI3 | ||
| 13 | select GENERIC_ASHRDI3 | ||
| 14 | select GENERIC_LSHRDI3 | ||
| 15 | select GENERIC_CMPDI2 | ||
| 16 | select GENERIC_MULDI3 | ||
| 17 | select GENERIC_UCMPDI2 | ||
| 12 | select GENERIC_ATOMIC64 | 18 | select GENERIC_ATOMIC64 |
| 13 | select GENERIC_CPU_DEVICES | 19 | select GENERIC_CPU_DEVICES |
| 14 | select GENERIC_CLOCKEVENTS | 20 | select GENERIC_CLOCKEVENTS |
| @@ -82,6 +88,7 @@ endmenu | |||
| 82 | 88 | ||
| 83 | menu "Kernel Features" | 89 | menu "Kernel Features" |
| 84 | source "kernel/Kconfig.preempt" | 90 | source "kernel/Kconfig.preempt" |
| 91 | source "kernel/Kconfig.freezer" | ||
| 85 | source "mm/Kconfig" | 92 | source "mm/Kconfig" |
| 86 | source "kernel/Kconfig.hz" | 93 | source "kernel/Kconfig.hz" |
| 87 | endmenu | 94 | endmenu |
diff --git a/arch/nds32/Kconfig.cpu b/arch/nds32/Kconfig.cpu index ba44cc539da9..b8c8984d1456 100644 --- a/arch/nds32/Kconfig.cpu +++ b/arch/nds32/Kconfig.cpu | |||
| @@ -1,10 +1,11 @@ | |||
| 1 | comment "Processor Features" | 1 | comment "Processor Features" |
| 2 | 2 | ||
| 3 | config CPU_BIG_ENDIAN | 3 | config CPU_BIG_ENDIAN |
| 4 | bool "Big endian" | 4 | def_bool !CPU_LITTLE_ENDIAN |
| 5 | 5 | ||
| 6 | config CPU_LITTLE_ENDIAN | 6 | config CPU_LITTLE_ENDIAN |
| 7 | def_bool !CPU_BIG_ENDIAN | 7 | bool "Little endian" |
| 8 | default y | ||
| 8 | 9 | ||
| 9 | config HWZOL | 10 | config HWZOL |
| 10 | bool "hardware zero overhead loop support" | 11 | bool "hardware zero overhead loop support" |
diff --git a/arch/nds32/Makefile b/arch/nds32/Makefile index 91f933d5a962..513bb2e9baf9 100644 --- a/arch/nds32/Makefile +++ b/arch/nds32/Makefile | |||
| @@ -23,9 +23,6 @@ export TEXTADDR | |||
| 23 | # If we have a machine-specific directory, then include it in the build. | 23 | # If we have a machine-specific directory, then include it in the build. |
| 24 | core-y += arch/nds32/kernel/ arch/nds32/mm/ | 24 | core-y += arch/nds32/kernel/ arch/nds32/mm/ |
| 25 | libs-y += arch/nds32/lib/ | 25 | libs-y += arch/nds32/lib/ |
| 26 | LIBGCC_PATH := \ | ||
| 27 | $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name) | ||
| 28 | libs-y += $(LIBGCC_PATH) | ||
| 29 | 26 | ||
| 30 | ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""' | 27 | ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""' |
| 31 | BUILTIN_DTB := y | 28 | BUILTIN_DTB := y |
| @@ -35,8 +32,12 @@ endif | |||
| 35 | 32 | ||
| 36 | ifdef CONFIG_CPU_LITTLE_ENDIAN | 33 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
| 37 | KBUILD_CFLAGS += $(call cc-option, -EL) | 34 | KBUILD_CFLAGS += $(call cc-option, -EL) |
| 35 | KBUILD_AFLAGS += $(call cc-option, -EL) | ||
| 36 | LDFLAGS += $(call cc-option, -EL) | ||
| 38 | else | 37 | else |
| 39 | KBUILD_CFLAGS += $(call cc-option, -EB) | 38 | KBUILD_CFLAGS += $(call cc-option, -EB) |
| 39 | KBUILD_AFLAGS += $(call cc-option, -EB) | ||
| 40 | LDFLAGS += $(call cc-option, -EB) | ||
| 40 | endif | 41 | endif |
| 41 | 42 | ||
| 42 | boot := arch/nds32/boot | 43 | boot := arch/nds32/boot |
diff --git a/arch/nds32/include/asm/Kbuild b/arch/nds32/include/asm/Kbuild index 06bdf8167f5a..142e612aa639 100644 --- a/arch/nds32/include/asm/Kbuild +++ b/arch/nds32/include/asm/Kbuild | |||
| @@ -16,6 +16,7 @@ generic-y += dma.h | |||
| 16 | generic-y += emergency-restart.h | 16 | generic-y += emergency-restart.h |
| 17 | generic-y += errno.h | 17 | generic-y += errno.h |
| 18 | generic-y += exec.h | 18 | generic-y += exec.h |
| 19 | generic-y += export.h | ||
| 19 | generic-y += fb.h | 20 | generic-y += fb.h |
| 20 | generic-y += fcntl.h | 21 | generic-y += fcntl.h |
| 21 | generic-y += ftrace.h | 22 | generic-y += ftrace.h |
| @@ -49,6 +50,7 @@ generic-y += switch_to.h | |||
| 49 | generic-y += timex.h | 50 | generic-y += timex.h |
| 50 | generic-y += topology.h | 51 | generic-y += topology.h |
| 51 | generic-y += trace_clock.h | 52 | generic-y += trace_clock.h |
| 53 | generic-y += xor.h | ||
| 52 | generic-y += unaligned.h | 54 | generic-y += unaligned.h |
| 53 | generic-y += user.h | 55 | generic-y += user.h |
| 54 | generic-y += vga.h | 56 | generic-y += vga.h |
diff --git a/arch/nds32/include/asm/bitfield.h b/arch/nds32/include/asm/bitfield.h index c73f71d67744..8e84fc385b94 100644 --- a/arch/nds32/include/asm/bitfield.h +++ b/arch/nds32/include/asm/bitfield.h | |||
| @@ -336,7 +336,7 @@ | |||
| 336 | #define INT_MASK_mskIDIVZE ( 0x1 << INT_MASK_offIDIVZE ) | 336 | #define INT_MASK_mskIDIVZE ( 0x1 << INT_MASK_offIDIVZE ) |
| 337 | #define INT_MASK_mskDSSIM ( 0x1 << INT_MASK_offDSSIM ) | 337 | #define INT_MASK_mskDSSIM ( 0x1 << INT_MASK_offDSSIM ) |
| 338 | 338 | ||
| 339 | #define INT_MASK_INITAIAL_VAL 0x10003 | 339 | #define INT_MASK_INITAIAL_VAL (INT_MASK_mskDSSIM|INT_MASK_mskIDIVZE) |
| 340 | 340 | ||
| 341 | /****************************************************************************** | 341 | /****************************************************************************** |
| 342 | * ir15: INT_PEND (Interrupt Pending Register) | 342 | * ir15: INT_PEND (Interrupt Pending Register) |
| @@ -396,6 +396,7 @@ | |||
| 396 | #define MMU_CTL_D8KB 1 | 396 | #define MMU_CTL_D8KB 1 |
| 397 | #define MMU_CTL_UNA ( 0x1 << MMU_CTL_offUNA ) | 397 | #define MMU_CTL_UNA ( 0x1 << MMU_CTL_offUNA ) |
| 398 | 398 | ||
| 399 | #define MMU_CTL_CACHEABLE_NON 0 | ||
| 399 | #define MMU_CTL_CACHEABLE_WB 2 | 400 | #define MMU_CTL_CACHEABLE_WB 2 |
| 400 | #define MMU_CTL_CACHEABLE_WT 3 | 401 | #define MMU_CTL_CACHEABLE_WT 3 |
| 401 | 402 | ||
diff --git a/arch/nds32/include/asm/cacheflush.h b/arch/nds32/include/asm/cacheflush.h index 1240f148ec0f..10b48f0d8e85 100644 --- a/arch/nds32/include/asm/cacheflush.h +++ b/arch/nds32/include/asm/cacheflush.h | |||
| @@ -32,6 +32,8 @@ void flush_anon_page(struct vm_area_struct *vma, | |||
| 32 | 32 | ||
| 33 | #define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE | 33 | #define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE |
| 34 | void flush_kernel_dcache_page(struct page *page); | 34 | void flush_kernel_dcache_page(struct page *page); |
| 35 | void flush_kernel_vmap_range(void *addr, int size); | ||
| 36 | void invalidate_kernel_vmap_range(void *addr, int size); | ||
| 35 | void flush_icache_range(unsigned long start, unsigned long end); | 37 | void flush_icache_range(unsigned long start, unsigned long end); |
| 36 | void flush_icache_page(struct vm_area_struct *vma, struct page *page); | 38 | void flush_icache_page(struct vm_area_struct *vma, struct page *page); |
| 37 | #define flush_dcache_mmap_lock(mapping) xa_lock_irq(&(mapping)->i_pages) | 39 | #define flush_dcache_mmap_lock(mapping) xa_lock_irq(&(mapping)->i_pages) |
diff --git a/arch/nds32/include/asm/io.h b/arch/nds32/include/asm/io.h index 966e71b3c960..71cd226d6863 100644 --- a/arch/nds32/include/asm/io.h +++ b/arch/nds32/include/asm/io.h | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | #ifndef __ASM_NDS32_IO_H | 4 | #ifndef __ASM_NDS32_IO_H |
| 5 | #define __ASM_NDS32_IO_H | 5 | #define __ASM_NDS32_IO_H |
| 6 | 6 | ||
| 7 | #include <linux/types.h> | ||
| 8 | |||
| 7 | extern void iounmap(volatile void __iomem *addr); | 9 | extern void iounmap(volatile void __iomem *addr); |
| 8 | #define __raw_writeb __raw_writeb | 10 | #define __raw_writeb __raw_writeb |
| 9 | static inline void __raw_writeb(u8 val, volatile void __iomem *addr) | 11 | static inline void __raw_writeb(u8 val, volatile void __iomem *addr) |
diff --git a/arch/nds32/include/asm/page.h b/arch/nds32/include/asm/page.h index e27365c097b6..947f0491c9a7 100644 --- a/arch/nds32/include/asm/page.h +++ b/arch/nds32/include/asm/page.h | |||
| @@ -27,6 +27,9 @@ extern void copy_user_highpage(struct page *to, struct page *from, | |||
| 27 | unsigned long vaddr, struct vm_area_struct *vma); | 27 | unsigned long vaddr, struct vm_area_struct *vma); |
| 28 | extern void clear_user_highpage(struct page *page, unsigned long vaddr); | 28 | extern void clear_user_highpage(struct page *page, unsigned long vaddr); |
| 29 | 29 | ||
| 30 | void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, | ||
| 31 | struct page *to); | ||
| 32 | void clear_user_page(void *addr, unsigned long vaddr, struct page *page); | ||
| 30 | #define __HAVE_ARCH_COPY_USER_HIGHPAGE | 33 | #define __HAVE_ARCH_COPY_USER_HIGHPAGE |
| 31 | #define clear_user_highpage clear_user_highpage | 34 | #define clear_user_highpage clear_user_highpage |
| 32 | #else | 35 | #else |
diff --git a/arch/nds32/include/asm/pgtable.h b/arch/nds32/include/asm/pgtable.h index 6783937edbeb..d3e19a55cf53 100644 --- a/arch/nds32/include/asm/pgtable.h +++ b/arch/nds32/include/asm/pgtable.h | |||
| @@ -152,6 +152,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
| 152 | #define PAGE_CACHE_L1 __pgprot(_HAVE_PAGE_L | _PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE) | 152 | #define PAGE_CACHE_L1 __pgprot(_HAVE_PAGE_L | _PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE) |
| 153 | #define PAGE_MEMORY __pgprot(_HAVE_PAGE_L | _PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE_SHRD) | 153 | #define PAGE_MEMORY __pgprot(_HAVE_PAGE_L | _PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE_SHRD) |
| 154 | #define PAGE_KERNEL __pgprot(_PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE_SHRD) | 154 | #define PAGE_KERNEL __pgprot(_PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE_SHRD) |
| 155 | #define PAGE_SHARED __pgprot(_PAGE_V | _PAGE_M_URW_KRW | _PAGE_D | _PAGE_CACHE_SHRD) | ||
| 155 | #define PAGE_DEVICE __pgprot(_PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_G | _PAGE_C_DEV) | 156 | #define PAGE_DEVICE __pgprot(_PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_G | _PAGE_C_DEV) |
| 156 | #endif /* __ASSEMBLY__ */ | 157 | #endif /* __ASSEMBLY__ */ |
| 157 | 158 | ||
diff --git a/arch/nds32/kernel/ex-entry.S b/arch/nds32/kernel/ex-entry.S index a72e83d804f5..b8ae4e9a6b93 100644 --- a/arch/nds32/kernel/ex-entry.S +++ b/arch/nds32/kernel/ex-entry.S | |||
| @@ -118,7 +118,7 @@ common_exception_handler: | |||
| 118 | /* interrupt */ | 118 | /* interrupt */ |
| 119 | 2: | 119 | 2: |
| 120 | #ifdef CONFIG_TRACE_IRQFLAGS | 120 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 121 | jal arch_trace_hardirqs_off | 121 | jal trace_hardirqs_off |
| 122 | #endif | 122 | #endif |
| 123 | move $r0, $sp | 123 | move $r0, $sp |
| 124 | sethi $lp, hi20(ret_from_intr) | 124 | sethi $lp, hi20(ret_from_intr) |
diff --git a/arch/nds32/kernel/head.S b/arch/nds32/kernel/head.S index 71f57bd70f3b..c5fdae174ced 100644 --- a/arch/nds32/kernel/head.S +++ b/arch/nds32/kernel/head.S | |||
| @@ -57,14 +57,32 @@ _nodtb: | |||
| 57 | isb | 57 | isb |
| 58 | mtsr $r4, $L1_PPTB ! load page table pointer\n" | 58 | mtsr $r4, $L1_PPTB ! load page table pointer\n" |
| 59 | 59 | ||
| 60 | /* set NTC0 cacheable/writeback, mutliple page size in use */ | 60 | #ifdef CONFIG_CPU_DCACHE_DISABLE |
| 61 | #define MMU_CTL_NTCC MMU_CTL_CACHEABLE_NON | ||
| 62 | #else | ||
| 63 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH | ||
| 64 | #define MMU_CTL_NTCC MMU_CTL_CACHEABLE_WT | ||
| 65 | #else | ||
| 66 | #define MMU_CTL_NTCC MMU_CTL_CACHEABLE_WB | ||
| 67 | #endif | ||
| 68 | #endif | ||
| 69 | |||
| 70 | /* set NTC cacheability, mutliple page size in use */ | ||
| 61 | mfsr $r3, $MMU_CTL | 71 | mfsr $r3, $MMU_CTL |
| 62 | li $r0, #~MMU_CTL_mskNTC0 | 72 | #if CONFIG_MEMORY_START >= 0xc0000000 |
| 63 | and $r3, $r3, $r0 | 73 | ori $r3, $r3, (MMU_CTL_NTCC << MMU_CTL_offNTC3) |
| 74 | #elif CONFIG_MEMORY_START >= 0x80000000 | ||
| 75 | ori $r3, $r3, (MMU_CTL_NTCC << MMU_CTL_offNTC2) | ||
| 76 | #elif CONFIG_MEMORY_START >= 0x40000000 | ||
| 77 | ori $r3, $r3, (MMU_CTL_NTCC << MMU_CTL_offNTC1) | ||
| 78 | #else | ||
| 79 | ori $r3, $r3, (MMU_CTL_NTCC << MMU_CTL_offNTC0) | ||
| 80 | #endif | ||
| 81 | |||
| 64 | #ifdef CONFIG_ANDES_PAGE_SIZE_4KB | 82 | #ifdef CONFIG_ANDES_PAGE_SIZE_4KB |
| 65 | ori $r3, $r3, #(MMU_CTL_mskMPZIU|(MMU_CTL_CACHEABLE_WB << MMU_CTL_offNTC0)) | 83 | ori $r3, $r3, #(MMU_CTL_mskMPZIU) |
| 66 | #else | 84 | #else |
| 67 | ori $r3, $r3, #(MMU_CTL_mskMPZIU|(MMU_CTL_CACHEABLE_WB << MMU_CTL_offNTC0)|MMU_CTL_D8KB) | 85 | ori $r3, $r3, #(MMU_CTL_mskMPZIU|MMU_CTL_D8KB) |
| 68 | #endif | 86 | #endif |
| 69 | #ifdef CONFIG_HW_SUPPORT_UNALIGNMENT_ACCESS | 87 | #ifdef CONFIG_HW_SUPPORT_UNALIGNMENT_ACCESS |
| 70 | li $r0, #MMU_CTL_UNA | 88 | li $r0, #MMU_CTL_UNA |
diff --git a/arch/nds32/kernel/setup.c b/arch/nds32/kernel/setup.c index ba910e9e4ecb..2f5b2ccebe47 100644 --- a/arch/nds32/kernel/setup.c +++ b/arch/nds32/kernel/setup.c | |||
| @@ -293,6 +293,9 @@ void __init setup_arch(char **cmdline_p) | |||
| 293 | /* paging_init() sets up the MMU and marks all pages as reserved */ | 293 | /* paging_init() sets up the MMU and marks all pages as reserved */ |
| 294 | paging_init(); | 294 | paging_init(); |
| 295 | 295 | ||
| 296 | /* invalidate all TLB entries because the new mapping is created */ | ||
| 297 | __nds32__tlbop_flua(); | ||
| 298 | |||
| 296 | /* use generic way to parse */ | 299 | /* use generic way to parse */ |
| 297 | parse_early_param(); | 300 | parse_early_param(); |
| 298 | 301 | ||
diff --git a/arch/nds32/kernel/stacktrace.c b/arch/nds32/kernel/stacktrace.c index bc70113c0e84..8b231e910ea6 100644 --- a/arch/nds32/kernel/stacktrace.c +++ b/arch/nds32/kernel/stacktrace.c | |||
| @@ -9,6 +9,7 @@ void save_stack_trace(struct stack_trace *trace) | |||
| 9 | { | 9 | { |
| 10 | save_stack_trace_tsk(current, trace); | 10 | save_stack_trace_tsk(current, trace); |
| 11 | } | 11 | } |
| 12 | EXPORT_SYMBOL_GPL(save_stack_trace); | ||
| 12 | 13 | ||
| 13 | void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) | 14 | void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) |
| 14 | { | 15 | { |
| @@ -45,3 +46,4 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) | |||
| 45 | fpn = (unsigned long *)fpp; | 46 | fpn = (unsigned long *)fpp; |
| 46 | } | 47 | } |
| 47 | } | 48 | } |
| 49 | EXPORT_SYMBOL_GPL(save_stack_trace_tsk); | ||
diff --git a/arch/nds32/kernel/vdso.c b/arch/nds32/kernel/vdso.c index f1198d7a5654..016f15891f6d 100644 --- a/arch/nds32/kernel/vdso.c +++ b/arch/nds32/kernel/vdso.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | #include <asm/vdso_timer_info.h> | 23 | #include <asm/vdso_timer_info.h> |
| 24 | #include <asm/cache_info.h> | 24 | #include <asm/cache_info.h> |
| 25 | extern struct cache_info L1_cache_info[2]; | 25 | extern struct cache_info L1_cache_info[2]; |
| 26 | extern char vdso_start, vdso_end; | 26 | extern char vdso_start[], vdso_end[]; |
| 27 | static unsigned long vdso_pages __ro_after_init; | 27 | static unsigned long vdso_pages __ro_after_init; |
| 28 | static unsigned long timer_mapping_base; | 28 | static unsigned long timer_mapping_base; |
| 29 | 29 | ||
| @@ -66,16 +66,16 @@ static int __init vdso_init(void) | |||
| 66 | int i; | 66 | int i; |
| 67 | struct page **vdso_pagelist; | 67 | struct page **vdso_pagelist; |
| 68 | 68 | ||
| 69 | if (memcmp(&vdso_start, "\177ELF", 4)) { | 69 | if (memcmp(vdso_start, "\177ELF", 4)) { |
| 70 | pr_err("vDSO is not a valid ELF object!\n"); | 70 | pr_err("vDSO is not a valid ELF object!\n"); |
| 71 | return -EINVAL; | 71 | return -EINVAL; |
| 72 | } | 72 | } |
| 73 | /* Creat a timer io mapping to get clock cycles counter */ | 73 | /* Creat a timer io mapping to get clock cycles counter */ |
| 74 | get_timer_node_info(); | 74 | get_timer_node_info(); |
| 75 | 75 | ||
| 76 | vdso_pages = (&vdso_end - &vdso_start) >> PAGE_SHIFT; | 76 | vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT; |
| 77 | pr_info("vdso: %ld pages (%ld code @ %p, %ld data @ %p)\n", | 77 | pr_info("vdso: %ld pages (%ld code @ %p, %ld data @ %p)\n", |
| 78 | vdso_pages + 1, vdso_pages, &vdso_start, 1L, vdso_data); | 78 | vdso_pages + 1, vdso_pages, vdso_start, 1L, vdso_data); |
| 79 | 79 | ||
| 80 | /* Allocate the vDSO pagelist */ | 80 | /* Allocate the vDSO pagelist */ |
| 81 | vdso_pagelist = kcalloc(vdso_pages, sizeof(struct page *), GFP_KERNEL); | 81 | vdso_pagelist = kcalloc(vdso_pages, sizeof(struct page *), GFP_KERNEL); |
| @@ -83,7 +83,7 @@ static int __init vdso_init(void) | |||
| 83 | return -ENOMEM; | 83 | return -ENOMEM; |
| 84 | 84 | ||
| 85 | for (i = 0; i < vdso_pages; i++) | 85 | for (i = 0; i < vdso_pages; i++) |
| 86 | vdso_pagelist[i] = virt_to_page(&vdso_start + i * PAGE_SIZE); | 86 | vdso_pagelist[i] = virt_to_page(vdso_start + i * PAGE_SIZE); |
| 87 | vdso_spec[1].pages = &vdso_pagelist[0]; | 87 | vdso_spec[1].pages = &vdso_pagelist[0]; |
| 88 | 88 | ||
| 89 | return 0; | 89 | return 0; |
diff --git a/arch/nds32/lib/copy_page.S b/arch/nds32/lib/copy_page.S index 4a2ff85f17ee..f8701ed161a8 100644 --- a/arch/nds32/lib/copy_page.S +++ b/arch/nds32/lib/copy_page.S | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Copyright (C) 2005-2017 Andes Technology Corporation | 2 | // Copyright (C) 2005-2017 Andes Technology Corporation |
| 3 | 3 | ||
| 4 | #include <linux/linkage.h> | 4 | #include <linux/linkage.h> |
| 5 | #include <asm/export.h> | ||
| 5 | #include <asm/page.h> | 6 | #include <asm/page.h> |
| 6 | 7 | ||
| 7 | .text | 8 | .text |
| @@ -16,6 +17,7 @@ ENTRY(copy_page) | |||
| 16 | popm $r2, $r10 | 17 | popm $r2, $r10 |
| 17 | ret | 18 | ret |
| 18 | ENDPROC(copy_page) | 19 | ENDPROC(copy_page) |
| 20 | EXPORT_SYMBOL(copy_page) | ||
| 19 | 21 | ||
| 20 | ENTRY(clear_page) | 22 | ENTRY(clear_page) |
| 21 | pushm $r1, $r9 | 23 | pushm $r1, $r9 |
| @@ -35,3 +37,4 @@ ENTRY(clear_page) | |||
| 35 | popm $r1, $r9 | 37 | popm $r1, $r9 |
| 36 | ret | 38 | ret |
| 37 | ENDPROC(clear_page) | 39 | ENDPROC(clear_page) |
| 40 | EXPORT_SYMBOL(clear_page) | ||
diff --git a/arch/nds32/mm/alignment.c b/arch/nds32/mm/alignment.c index b96a01b10ca7..e1aed9dc692d 100644 --- a/arch/nds32/mm/alignment.c +++ b/arch/nds32/mm/alignment.c | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | #define RA(inst) (((inst) >> 15) & 0x1FUL) | 19 | #define RA(inst) (((inst) >> 15) & 0x1FUL) |
| 20 | #define RB(inst) (((inst) >> 10) & 0x1FUL) | 20 | #define RB(inst) (((inst) >> 10) & 0x1FUL) |
| 21 | #define SV(inst) (((inst) >> 8) & 0x3UL) | 21 | #define SV(inst) (((inst) >> 8) & 0x3UL) |
| 22 | #define IMM(inst) (((inst) >> 0) & 0x3FFFUL) | 22 | #define IMM(inst) (((inst) >> 0) & 0x7FFFUL) |
| 23 | 23 | ||
| 24 | #define RA3(inst) (((inst) >> 3) & 0x7UL) | 24 | #define RA3(inst) (((inst) >> 3) & 0x7UL) |
| 25 | #define RT3(inst) (((inst) >> 6) & 0x7UL) | 25 | #define RT3(inst) (((inst) >> 6) & 0x7UL) |
| @@ -28,6 +28,9 @@ | |||
| 28 | #define RA5(inst) (((inst) >> 0) & 0x1FUL) | 28 | #define RA5(inst) (((inst) >> 0) & 0x1FUL) |
| 29 | #define RT4(inst) (((inst) >> 5) & 0xFUL) | 29 | #define RT4(inst) (((inst) >> 5) & 0xFUL) |
| 30 | 30 | ||
| 31 | #define GET_IMMSVAL(imm_value) \ | ||
| 32 | (((imm_value >> 14) & 0x1) ? (imm_value - 0x8000) : imm_value) | ||
| 33 | |||
| 31 | #define __get8_data(val,addr,err) \ | 34 | #define __get8_data(val,addr,err) \ |
| 32 | __asm__( \ | 35 | __asm__( \ |
| 33 | "1: lbi.bi %1, [%2], #1\n" \ | 36 | "1: lbi.bi %1, [%2], #1\n" \ |
| @@ -467,7 +470,7 @@ static inline int do_32(unsigned long inst, struct pt_regs *regs) | |||
| 467 | } | 470 | } |
| 468 | 471 | ||
| 469 | if (imm) | 472 | if (imm) |
| 470 | shift = IMM(inst) * len; | 473 | shift = GET_IMMSVAL(IMM(inst)) * len; |
| 471 | else | 474 | else |
| 472 | shift = *idx_to_addr(regs, RB(inst)) << SV(inst); | 475 | shift = *idx_to_addr(regs, RB(inst)) << SV(inst); |
| 473 | 476 | ||
| @@ -552,7 +555,7 @@ static struct ctl_table alignment_tbl[3] = { | |||
| 552 | 555 | ||
| 553 | static struct ctl_table nds32_sysctl_table[2] = { | 556 | static struct ctl_table nds32_sysctl_table[2] = { |
| 554 | { | 557 | { |
| 555 | .procname = "unaligned_acess", | 558 | .procname = "unaligned_access", |
| 556 | .mode = 0555, | 559 | .mode = 0555, |
| 557 | .child = alignment_tbl}, | 560 | .child = alignment_tbl}, |
| 558 | {} | 561 | {} |
diff --git a/arch/nds32/mm/cacheflush.c b/arch/nds32/mm/cacheflush.c index 6eb786a399a2..ce8fd34497bf 100644 --- a/arch/nds32/mm/cacheflush.c +++ b/arch/nds32/mm/cacheflush.c | |||
| @@ -147,6 +147,25 @@ void flush_cache_vunmap(unsigned long start, unsigned long end) | |||
| 147 | cpu_icache_inval_all(); | 147 | cpu_icache_inval_all(); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, | ||
| 151 | struct page *to) | ||
| 152 | { | ||
| 153 | cpu_dcache_wbinval_page((unsigned long)vaddr); | ||
| 154 | cpu_icache_inval_page((unsigned long)vaddr); | ||
| 155 | copy_page(vto, vfrom); | ||
| 156 | cpu_dcache_wbinval_page((unsigned long)vto); | ||
| 157 | cpu_icache_inval_page((unsigned long)vto); | ||
| 158 | } | ||
| 159 | |||
| 160 | void clear_user_page(void *addr, unsigned long vaddr, struct page *page) | ||
| 161 | { | ||
| 162 | cpu_dcache_wbinval_page((unsigned long)vaddr); | ||
| 163 | cpu_icache_inval_page((unsigned long)vaddr); | ||
| 164 | clear_page(addr); | ||
| 165 | cpu_dcache_wbinval_page((unsigned long)addr); | ||
| 166 | cpu_icache_inval_page((unsigned long)addr); | ||
| 167 | } | ||
| 168 | |||
| 150 | void copy_user_highpage(struct page *to, struct page *from, | 169 | void copy_user_highpage(struct page *to, struct page *from, |
| 151 | unsigned long vaddr, struct vm_area_struct *vma) | 170 | unsigned long vaddr, struct vm_area_struct *vma) |
| 152 | { | 171 | { |
| @@ -156,11 +175,9 @@ void copy_user_highpage(struct page *to, struct page *from, | |||
| 156 | pto = page_to_phys(to); | 175 | pto = page_to_phys(to); |
| 157 | pfrom = page_to_phys(from); | 176 | pfrom = page_to_phys(from); |
| 158 | 177 | ||
| 178 | local_irq_save(flags); | ||
| 159 | if (aliasing(vaddr, (unsigned long)kfrom)) | 179 | if (aliasing(vaddr, (unsigned long)kfrom)) |
| 160 | cpu_dcache_wb_page((unsigned long)kfrom); | 180 | cpu_dcache_wb_page((unsigned long)kfrom); |
| 161 | if (aliasing(vaddr, (unsigned long)kto)) | ||
| 162 | cpu_dcache_inval_page((unsigned long)kto); | ||
| 163 | local_irq_save(flags); | ||
| 164 | vto = kremap0(vaddr, pto); | 181 | vto = kremap0(vaddr, pto); |
| 165 | vfrom = kremap1(vaddr, pfrom); | 182 | vfrom = kremap1(vaddr, pfrom); |
| 166 | copy_page((void *)vto, (void *)vfrom); | 183 | copy_page((void *)vto, (void *)vfrom); |
| @@ -198,21 +215,25 @@ void flush_dcache_page(struct page *page) | |||
| 198 | if (mapping && !mapping_mapped(mapping)) | 215 | if (mapping && !mapping_mapped(mapping)) |
| 199 | set_bit(PG_dcache_dirty, &page->flags); | 216 | set_bit(PG_dcache_dirty, &page->flags); |
| 200 | else { | 217 | else { |
| 201 | int i, pc; | 218 | unsigned long kaddr, flags; |
| 202 | unsigned long vto, kaddr, flags; | 219 | |
| 203 | kaddr = (unsigned long)page_address(page); | 220 | kaddr = (unsigned long)page_address(page); |
| 204 | cpu_dcache_wbinval_page(kaddr); | ||
| 205 | pc = CACHE_SET(DCACHE) * CACHE_LINE_SIZE(DCACHE) / PAGE_SIZE; | ||
| 206 | local_irq_save(flags); | 221 | local_irq_save(flags); |
| 207 | for (i = 0; i < pc; i++) { | 222 | cpu_dcache_wbinval_page(kaddr); |
| 208 | vto = | 223 | if (mapping) { |
| 209 | kremap0(kaddr + i * PAGE_SIZE, page_to_phys(page)); | 224 | unsigned long vaddr, kto; |
| 210 | cpu_dcache_wbinval_page(vto); | 225 | |
| 211 | kunmap01(vto); | 226 | vaddr = page->index << PAGE_SHIFT; |
| 227 | if (aliasing(vaddr, kaddr)) { | ||
| 228 | kto = kremap0(vaddr, page_to_phys(page)); | ||
| 229 | cpu_dcache_wbinval_page(kto); | ||
| 230 | kunmap01(kto); | ||
| 231 | } | ||
| 212 | } | 232 | } |
| 213 | local_irq_restore(flags); | 233 | local_irq_restore(flags); |
| 214 | } | 234 | } |
| 215 | } | 235 | } |
| 236 | EXPORT_SYMBOL(flush_dcache_page); | ||
| 216 | 237 | ||
| 217 | void copy_to_user_page(struct vm_area_struct *vma, struct page *page, | 238 | void copy_to_user_page(struct vm_area_struct *vma, struct page *page, |
| 218 | unsigned long vaddr, void *dst, void *src, int len) | 239 | unsigned long vaddr, void *dst, void *src, int len) |
| @@ -251,7 +272,7 @@ void copy_from_user_page(struct vm_area_struct *vma, struct page *page, | |||
| 251 | void flush_anon_page(struct vm_area_struct *vma, | 272 | void flush_anon_page(struct vm_area_struct *vma, |
| 252 | struct page *page, unsigned long vaddr) | 273 | struct page *page, unsigned long vaddr) |
| 253 | { | 274 | { |
| 254 | unsigned long flags; | 275 | unsigned long kaddr, flags, ktmp; |
| 255 | if (!PageAnon(page)) | 276 | if (!PageAnon(page)) |
| 256 | return; | 277 | return; |
| 257 | 278 | ||
| @@ -261,7 +282,12 @@ void flush_anon_page(struct vm_area_struct *vma, | |||
| 261 | local_irq_save(flags); | 282 | local_irq_save(flags); |
| 262 | if (vma->vm_flags & VM_EXEC) | 283 | if (vma->vm_flags & VM_EXEC) |
| 263 | cpu_icache_inval_page(vaddr & PAGE_MASK); | 284 | cpu_icache_inval_page(vaddr & PAGE_MASK); |
| 264 | cpu_dcache_wbinval_page((unsigned long)page_address(page)); | 285 | kaddr = (unsigned long)page_address(page); |
| 286 | if (aliasing(vaddr, kaddr)) { | ||
| 287 | ktmp = kremap0(vaddr, page_to_phys(page)); | ||
| 288 | cpu_dcache_wbinval_page(ktmp); | ||
| 289 | kunmap01(ktmp); | ||
| 290 | } | ||
| 265 | local_irq_restore(flags); | 291 | local_irq_restore(flags); |
| 266 | } | 292 | } |
| 267 | 293 | ||
| @@ -272,6 +298,25 @@ void flush_kernel_dcache_page(struct page *page) | |||
| 272 | cpu_dcache_wbinval_page((unsigned long)page_address(page)); | 298 | cpu_dcache_wbinval_page((unsigned long)page_address(page)); |
| 273 | local_irq_restore(flags); | 299 | local_irq_restore(flags); |
| 274 | } | 300 | } |
| 301 | EXPORT_SYMBOL(flush_kernel_dcache_page); | ||
| 302 | |||
| 303 | void flush_kernel_vmap_range(void *addr, int size) | ||
| 304 | { | ||
| 305 | unsigned long flags; | ||
| 306 | local_irq_save(flags); | ||
| 307 | cpu_dcache_wb_range((unsigned long)addr, (unsigned long)addr + size); | ||
| 308 | local_irq_restore(flags); | ||
| 309 | } | ||
| 310 | EXPORT_SYMBOL(flush_kernel_vmap_range); | ||
| 311 | |||
| 312 | void invalidate_kernel_vmap_range(void *addr, int size) | ||
| 313 | { | ||
| 314 | unsigned long flags; | ||
| 315 | local_irq_save(flags); | ||
| 316 | cpu_dcache_inval_range((unsigned long)addr, (unsigned long)addr + size); | ||
| 317 | local_irq_restore(flags); | ||
| 318 | } | ||
| 319 | EXPORT_SYMBOL(invalidate_kernel_vmap_range); | ||
| 275 | 320 | ||
| 276 | void flush_icache_range(unsigned long start, unsigned long end) | 321 | void flush_icache_range(unsigned long start, unsigned long end) |
| 277 | { | 322 | { |
| @@ -283,6 +328,7 @@ void flush_icache_range(unsigned long start, unsigned long end) | |||
| 283 | cpu_cache_wbinval_range(start, end, 1); | 328 | cpu_cache_wbinval_range(start, end, 1); |
| 284 | local_irq_restore(flags); | 329 | local_irq_restore(flags); |
| 285 | } | 330 | } |
| 331 | EXPORT_SYMBOL(flush_icache_range); | ||
| 286 | 332 | ||
| 287 | void flush_icache_page(struct vm_area_struct *vma, struct page *page) | 333 | void flush_icache_page(struct vm_area_struct *vma, struct page *page) |
| 288 | { | 334 | { |
diff --git a/arch/nds32/mm/init.c b/arch/nds32/mm/init.c index 93ee0160720b..c713d2ad55dc 100644 --- a/arch/nds32/mm/init.c +++ b/arch/nds32/mm/init.c | |||
| @@ -30,6 +30,7 @@ extern unsigned long phys_initrd_size; | |||
| 30 | * zero-initialized data and COW. | 30 | * zero-initialized data and COW. |
| 31 | */ | 31 | */ |
| 32 | struct page *empty_zero_page; | 32 | struct page *empty_zero_page; |
| 33 | EXPORT_SYMBOL(empty_zero_page); | ||
| 33 | 34 | ||
| 34 | static void __init zone_sizes_init(void) | 35 | static void __init zone_sizes_init(void) |
| 35 | { | 36 | { |
diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile index e9525bc1b4a6..1ace023cbdce 100644 --- a/arch/s390/purgatory/Makefile +++ b/arch/s390/purgatory/Makefile | |||
| @@ -21,7 +21,7 @@ LDFLAGS_purgatory.ro += -z nodefaultlib | |||
| 21 | KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes | 21 | KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes |
| 22 | KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare | 22 | KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare |
| 23 | KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding | 23 | KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding |
| 24 | KBUILD_CFLAGS += -c -MD -Os -m64 | 24 | KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float |
| 25 | KBUILD_CFLAGS += $(call cc-option,-fno-PIE) | 25 | KBUILD_CFLAGS += $(call cc-option,-fno-PIE) |
| 26 | 26 | ||
| 27 | $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE | 27 | $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE |
diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c index d4a81be0d7d2..b6be62025325 100644 --- a/drivers/crypto/inside-secure/safexcel.c +++ b/drivers/crypto/inside-secure/safexcel.c | |||
| @@ -152,8 +152,8 @@ static int eip197_load_firmwares(struct safexcel_crypto_priv *priv) | |||
| 152 | EIP197_PE_ICE_SCRATCH_CTRL_CHANGE_ACCESS; | 152 | EIP197_PE_ICE_SCRATCH_CTRL_CHANGE_ACCESS; |
| 153 | writel(val, EIP197_PE(priv) + EIP197_PE_ICE_SCRATCH_CTRL); | 153 | writel(val, EIP197_PE(priv) + EIP197_PE_ICE_SCRATCH_CTRL); |
| 154 | 154 | ||
| 155 | memset(EIP197_PE(priv) + EIP197_PE_ICE_SCRATCH_RAM, 0, | 155 | memset_io(EIP197_PE(priv) + EIP197_PE_ICE_SCRATCH_RAM, 0, |
| 156 | EIP197_NUM_OF_SCRATCH_BLOCKS * sizeof(u32)); | 156 | EIP197_NUM_OF_SCRATCH_BLOCKS * sizeof(u32)); |
| 157 | 157 | ||
| 158 | eip197_write_firmware(priv, fw[FW_IFPP], EIP197_PE_ICE_FPP_CTRL, | 158 | eip197_write_firmware(priv, fw[FW_IFPP], EIP197_PE_ICE_FPP_CTRL, |
| 159 | EIP197_PE_ICE_RAM_CTRL_FPP_PROG_EN); | 159 | EIP197_PE_ICE_RAM_CTRL_FPP_PROG_EN); |
diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c index ede388309376..634f58042c77 100644 --- a/drivers/hwtracing/intel_th/msu.c +++ b/drivers/hwtracing/intel_th/msu.c | |||
| @@ -733,8 +733,8 @@ err_nomem: | |||
| 733 | /* Reset the page to write-back before releasing */ | 733 | /* Reset the page to write-back before releasing */ |
| 734 | set_memory_wb((unsigned long)win->block[i].bdesc, 1); | 734 | set_memory_wb((unsigned long)win->block[i].bdesc, 1); |
| 735 | #endif | 735 | #endif |
| 736 | dma_free_coherent(msc_dev(msc), size, win->block[i].bdesc, | 736 | dma_free_coherent(msc_dev(msc)->parent->parent, size, |
| 737 | win->block[i].addr); | 737 | win->block[i].bdesc, win->block[i].addr); |
| 738 | } | 738 | } |
| 739 | kfree(win); | 739 | kfree(win); |
| 740 | 740 | ||
| @@ -769,7 +769,7 @@ static void msc_buffer_win_free(struct msc *msc, struct msc_window *win) | |||
| 769 | /* Reset the page to write-back before releasing */ | 769 | /* Reset the page to write-back before releasing */ |
| 770 | set_memory_wb((unsigned long)win->block[i].bdesc, 1); | 770 | set_memory_wb((unsigned long)win->block[i].bdesc, 1); |
| 771 | #endif | 771 | #endif |
| 772 | dma_free_coherent(msc_dev(win->msc), PAGE_SIZE, | 772 | dma_free_coherent(msc_dev(win->msc)->parent->parent, PAGE_SIZE, |
| 773 | win->block[i].bdesc, win->block[i].addr); | 773 | win->block[i].bdesc, win->block[i].addr); |
| 774 | } | 774 | } |
| 775 | 775 | ||
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index 05386b76465e..10bcb5d73f90 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/stm.h> | 19 | #include <linux/stm.h> |
| 20 | #include <linux/fs.h> | 20 | #include <linux/fs.h> |
| 21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
| 22 | #include <linux/vmalloc.h> | ||
| 22 | #include "stm.h" | 23 | #include "stm.h" |
| 23 | 24 | ||
| 24 | #include <uapi/linux/stm.h> | 25 | #include <uapi/linux/stm.h> |
| @@ -674,7 +675,7 @@ static void stm_device_release(struct device *dev) | |||
| 674 | { | 675 | { |
| 675 | struct stm_device *stm = to_stm_device(dev); | 676 | struct stm_device *stm = to_stm_device(dev); |
| 676 | 677 | ||
| 677 | kfree(stm); | 678 | vfree(stm); |
| 678 | } | 679 | } |
| 679 | 680 | ||
| 680 | int stm_register_device(struct device *parent, struct stm_data *stm_data, | 681 | int stm_register_device(struct device *parent, struct stm_data *stm_data, |
| @@ -691,7 +692,7 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data, | |||
| 691 | return -EINVAL; | 692 | return -EINVAL; |
| 692 | 693 | ||
| 693 | nmasters = stm_data->sw_end - stm_data->sw_start + 1; | 694 | nmasters = stm_data->sw_end - stm_data->sw_start + 1; |
| 694 | stm = kzalloc(sizeof(*stm) + nmasters * sizeof(void *), GFP_KERNEL); | 695 | stm = vzalloc(sizeof(*stm) + nmasters * sizeof(void *)); |
| 695 | if (!stm) | 696 | if (!stm) |
| 696 | return -ENOMEM; | 697 | return -ENOMEM; |
| 697 | 698 | ||
| @@ -744,7 +745,7 @@ err_device: | |||
| 744 | /* matches device_initialize() above */ | 745 | /* matches device_initialize() above */ |
| 745 | put_device(&stm->dev); | 746 | put_device(&stm->dev); |
| 746 | err_free: | 747 | err_free: |
| 747 | kfree(stm); | 748 | vfree(stm); |
| 748 | 749 | ||
| 749 | return err; | 750 | return err; |
| 750 | } | 751 | } |
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c index 8c42ca7107b2..45ae3c025bf6 100644 --- a/drivers/i2c/busses/i2c-ocores.c +++ b/drivers/i2c/busses/i2c-ocores.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * i2c-ocores.c: I2C bus driver for OpenCores I2C controller | 2 | * i2c-ocores.c: I2C bus driver for OpenCores I2C controller |
| 3 | * (http://www.opencores.org/projects.cgi/web/i2c/overview). | 3 | * (https://opencores.org/project/i2c/overview) |
| 4 | * | 4 | * |
| 5 | * Peter Korsgaard <jacmet@sunsite.dk> | 5 | * Peter Korsgaard <jacmet@sunsite.dk> |
| 6 | * | 6 | * |
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index 15606f237480..9da79070357c 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig | |||
| @@ -158,6 +158,7 @@ config AT91_SAMA5D2_ADC | |||
| 158 | depends on ARCH_AT91 || COMPILE_TEST | 158 | depends on ARCH_AT91 || COMPILE_TEST |
| 159 | depends on HAS_IOMEM | 159 | depends on HAS_IOMEM |
| 160 | depends on HAS_DMA | 160 | depends on HAS_DMA |
| 161 | select IIO_BUFFER | ||
| 161 | select IIO_TRIGGERED_BUFFER | 162 | select IIO_TRIGGERED_BUFFER |
| 162 | help | 163 | help |
| 163 | Say yes here to build support for Atmel SAMA5D2 ADC which is | 164 | Say yes here to build support for Atmel SAMA5D2 ADC which is |
diff --git a/drivers/iio/adc/ad7793.c b/drivers/iio/adc/ad7793.c index 801afb61310b..d4bbe5b53318 100644 --- a/drivers/iio/adc/ad7793.c +++ b/drivers/iio/adc/ad7793.c | |||
| @@ -348,55 +348,6 @@ static const u16 ad7793_sample_freq_avail[16] = {0, 470, 242, 123, 62, 50, 39, | |||
| 348 | static const u16 ad7797_sample_freq_avail[16] = {0, 0, 0, 123, 62, 50, 0, | 348 | static const u16 ad7797_sample_freq_avail[16] = {0, 0, 0, 123, 62, 50, 0, |
| 349 | 33, 0, 17, 16, 12, 10, 8, 6, 4}; | 349 | 33, 0, 17, 16, 12, 10, 8, 6, 4}; |
| 350 | 350 | ||
| 351 | static ssize_t ad7793_read_frequency(struct device *dev, | ||
| 352 | struct device_attribute *attr, | ||
| 353 | char *buf) | ||
| 354 | { | ||
| 355 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | ||
| 356 | struct ad7793_state *st = iio_priv(indio_dev); | ||
| 357 | |||
| 358 | return sprintf(buf, "%d\n", | ||
| 359 | st->chip_info->sample_freq_avail[AD7793_MODE_RATE(st->mode)]); | ||
| 360 | } | ||
| 361 | |||
| 362 | static ssize_t ad7793_write_frequency(struct device *dev, | ||
| 363 | struct device_attribute *attr, | ||
| 364 | const char *buf, | ||
| 365 | size_t len) | ||
| 366 | { | ||
| 367 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | ||
| 368 | struct ad7793_state *st = iio_priv(indio_dev); | ||
| 369 | long lval; | ||
| 370 | int i, ret; | ||
| 371 | |||
| 372 | ret = kstrtol(buf, 10, &lval); | ||
| 373 | if (ret) | ||
| 374 | return ret; | ||
| 375 | |||
| 376 | if (lval == 0) | ||
| 377 | return -EINVAL; | ||
| 378 | |||
| 379 | for (i = 0; i < 16; i++) | ||
| 380 | if (lval == st->chip_info->sample_freq_avail[i]) | ||
| 381 | break; | ||
| 382 | if (i == 16) | ||
| 383 | return -EINVAL; | ||
| 384 | |||
| 385 | ret = iio_device_claim_direct_mode(indio_dev); | ||
| 386 | if (ret) | ||
| 387 | return ret; | ||
| 388 | st->mode &= ~AD7793_MODE_RATE(-1); | ||
| 389 | st->mode |= AD7793_MODE_RATE(i); | ||
| 390 | ad_sd_write_reg(&st->sd, AD7793_REG_MODE, sizeof(st->mode), st->mode); | ||
| 391 | iio_device_release_direct_mode(indio_dev); | ||
| 392 | |||
| 393 | return len; | ||
| 394 | } | ||
| 395 | |||
| 396 | static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO, | ||
| 397 | ad7793_read_frequency, | ||
| 398 | ad7793_write_frequency); | ||
| 399 | |||
| 400 | static IIO_CONST_ATTR_SAMP_FREQ_AVAIL( | 351 | static IIO_CONST_ATTR_SAMP_FREQ_AVAIL( |
| 401 | "470 242 123 62 50 39 33 19 17 16 12 10 8 6 4"); | 352 | "470 242 123 62 50 39 33 19 17 16 12 10 8 6 4"); |
| 402 | 353 | ||
| @@ -424,7 +375,6 @@ static IIO_DEVICE_ATTR_NAMED(in_m_in_scale_available, | |||
| 424 | ad7793_show_scale_available, NULL, 0); | 375 | ad7793_show_scale_available, NULL, 0); |
| 425 | 376 | ||
| 426 | static struct attribute *ad7793_attributes[] = { | 377 | static struct attribute *ad7793_attributes[] = { |
| 427 | &iio_dev_attr_sampling_frequency.dev_attr.attr, | ||
| 428 | &iio_const_attr_sampling_frequency_available.dev_attr.attr, | 378 | &iio_const_attr_sampling_frequency_available.dev_attr.attr, |
| 429 | &iio_dev_attr_in_m_in_scale_available.dev_attr.attr, | 379 | &iio_dev_attr_in_m_in_scale_available.dev_attr.attr, |
| 430 | NULL | 380 | NULL |
| @@ -435,7 +385,6 @@ static const struct attribute_group ad7793_attribute_group = { | |||
| 435 | }; | 385 | }; |
| 436 | 386 | ||
| 437 | static struct attribute *ad7797_attributes[] = { | 387 | static struct attribute *ad7797_attributes[] = { |
| 438 | &iio_dev_attr_sampling_frequency.dev_attr.attr, | ||
| 439 | &iio_const_attr_sampling_frequency_available_ad7797.dev_attr.attr, | 388 | &iio_const_attr_sampling_frequency_available_ad7797.dev_attr.attr, |
| 440 | NULL | 389 | NULL |
| 441 | }; | 390 | }; |
| @@ -505,6 +454,10 @@ static int ad7793_read_raw(struct iio_dev *indio_dev, | |||
| 505 | *val -= offset; | 454 | *val -= offset; |
| 506 | } | 455 | } |
| 507 | return IIO_VAL_INT; | 456 | return IIO_VAL_INT; |
| 457 | case IIO_CHAN_INFO_SAMP_FREQ: | ||
| 458 | *val = st->chip_info | ||
| 459 | ->sample_freq_avail[AD7793_MODE_RATE(st->mode)]; | ||
| 460 | return IIO_VAL_INT; | ||
| 508 | } | 461 | } |
| 509 | return -EINVAL; | 462 | return -EINVAL; |
| 510 | } | 463 | } |
| @@ -542,6 +495,26 @@ static int ad7793_write_raw(struct iio_dev *indio_dev, | |||
| 542 | break; | 495 | break; |
| 543 | } | 496 | } |
| 544 | break; | 497 | break; |
| 498 | case IIO_CHAN_INFO_SAMP_FREQ: | ||
| 499 | if (!val) { | ||
| 500 | ret = -EINVAL; | ||
| 501 | break; | ||
| 502 | } | ||
| 503 | |||
| 504 | for (i = 0; i < 16; i++) | ||
| 505 | if (val == st->chip_info->sample_freq_avail[i]) | ||
| 506 | break; | ||
| 507 | |||
| 508 | if (i == 16) { | ||
| 509 | ret = -EINVAL; | ||
| 510 | break; | ||
| 511 | } | ||
| 512 | |||
| 513 | st->mode &= ~AD7793_MODE_RATE(-1); | ||
| 514 | st->mode |= AD7793_MODE_RATE(i); | ||
| 515 | ad_sd_write_reg(&st->sd, AD7793_REG_MODE, sizeof(st->mode), | ||
| 516 | st->mode); | ||
| 517 | break; | ||
| 545 | default: | 518 | default: |
| 546 | ret = -EINVAL; | 519 | ret = -EINVAL; |
| 547 | } | 520 | } |
diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c index 4eff8351ce29..8729d6524b4d 100644 --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c | |||
| @@ -333,6 +333,27 @@ static const struct iio_chan_spec at91_adc_channels[] = { | |||
| 333 | + AT91_SAMA5D2_DIFF_CHAN_CNT + 1), | 333 | + AT91_SAMA5D2_DIFF_CHAN_CNT + 1), |
| 334 | }; | 334 | }; |
| 335 | 335 | ||
| 336 | static int at91_adc_chan_xlate(struct iio_dev *indio_dev, int chan) | ||
| 337 | { | ||
| 338 | int i; | ||
| 339 | |||
| 340 | for (i = 0; i < indio_dev->num_channels; i++) { | ||
| 341 | if (indio_dev->channels[i].scan_index == chan) | ||
| 342 | return i; | ||
| 343 | } | ||
| 344 | return -EINVAL; | ||
| 345 | } | ||
| 346 | |||
| 347 | static inline struct iio_chan_spec const * | ||
| 348 | at91_adc_chan_get(struct iio_dev *indio_dev, int chan) | ||
| 349 | { | ||
| 350 | int index = at91_adc_chan_xlate(indio_dev, chan); | ||
| 351 | |||
| 352 | if (index < 0) | ||
| 353 | return NULL; | ||
| 354 | return indio_dev->channels + index; | ||
| 355 | } | ||
| 356 | |||
| 336 | static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) | 357 | static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) |
| 337 | { | 358 | { |
| 338 | struct iio_dev *indio = iio_trigger_get_drvdata(trig); | 359 | struct iio_dev *indio = iio_trigger_get_drvdata(trig); |
| @@ -350,8 +371,10 @@ static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) | |||
| 350 | at91_adc_writel(st, AT91_SAMA5D2_TRGR, status); | 371 | at91_adc_writel(st, AT91_SAMA5D2_TRGR, status); |
| 351 | 372 | ||
| 352 | for_each_set_bit(bit, indio->active_scan_mask, indio->num_channels) { | 373 | for_each_set_bit(bit, indio->active_scan_mask, indio->num_channels) { |
| 353 | struct iio_chan_spec const *chan = indio->channels + bit; | 374 | struct iio_chan_spec const *chan = at91_adc_chan_get(indio, bit); |
| 354 | 375 | ||
| 376 | if (!chan) | ||
| 377 | continue; | ||
| 355 | if (state) { | 378 | if (state) { |
| 356 | at91_adc_writel(st, AT91_SAMA5D2_CHER, | 379 | at91_adc_writel(st, AT91_SAMA5D2_CHER, |
| 357 | BIT(chan->channel)); | 380 | BIT(chan->channel)); |
| @@ -448,7 +471,11 @@ static int at91_adc_dma_start(struct iio_dev *indio_dev) | |||
| 448 | 471 | ||
| 449 | for_each_set_bit(bit, indio_dev->active_scan_mask, | 472 | for_each_set_bit(bit, indio_dev->active_scan_mask, |
| 450 | indio_dev->num_channels) { | 473 | indio_dev->num_channels) { |
| 451 | struct iio_chan_spec const *chan = indio_dev->channels + bit; | 474 | struct iio_chan_spec const *chan = |
| 475 | at91_adc_chan_get(indio_dev, bit); | ||
| 476 | |||
| 477 | if (!chan) | ||
| 478 | continue; | ||
| 452 | 479 | ||
| 453 | st->dma_st.rx_buf_sz += chan->scan_type.storagebits / 8; | 480 | st->dma_st.rx_buf_sz += chan->scan_type.storagebits / 8; |
| 454 | } | 481 | } |
| @@ -526,8 +553,11 @@ static int at91_adc_buffer_predisable(struct iio_dev *indio_dev) | |||
| 526 | */ | 553 | */ |
| 527 | for_each_set_bit(bit, indio_dev->active_scan_mask, | 554 | for_each_set_bit(bit, indio_dev->active_scan_mask, |
| 528 | indio_dev->num_channels) { | 555 | indio_dev->num_channels) { |
| 529 | struct iio_chan_spec const *chan = indio_dev->channels + bit; | 556 | struct iio_chan_spec const *chan = |
| 557 | at91_adc_chan_get(indio_dev, bit); | ||
| 530 | 558 | ||
| 559 | if (!chan) | ||
| 560 | continue; | ||
| 531 | if (st->dma_st.dma_chan) | 561 | if (st->dma_st.dma_chan) |
| 532 | at91_adc_readl(st, chan->address); | 562 | at91_adc_readl(st, chan->address); |
| 533 | } | 563 | } |
| @@ -587,8 +617,11 @@ static void at91_adc_trigger_handler_nodma(struct iio_dev *indio_dev, | |||
| 587 | 617 | ||
| 588 | for_each_set_bit(bit, indio_dev->active_scan_mask, | 618 | for_each_set_bit(bit, indio_dev->active_scan_mask, |
| 589 | indio_dev->num_channels) { | 619 | indio_dev->num_channels) { |
| 590 | struct iio_chan_spec const *chan = indio_dev->channels + bit; | 620 | struct iio_chan_spec const *chan = |
| 621 | at91_adc_chan_get(indio_dev, bit); | ||
| 591 | 622 | ||
| 623 | if (!chan) | ||
| 624 | continue; | ||
| 592 | st->buffer[i] = at91_adc_readl(st, chan->address); | 625 | st->buffer[i] = at91_adc_readl(st, chan->address); |
| 593 | i++; | 626 | i++; |
| 594 | } | 627 | } |
diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c index 01422d11753c..b28a716a23b2 100644 --- a/drivers/iio/adc/stm32-dfsdm-adc.c +++ b/drivers/iio/adc/stm32-dfsdm-adc.c | |||
| @@ -144,6 +144,7 @@ static int stm32_dfsdm_set_osrs(struct stm32_dfsdm_filter *fl, | |||
| 144 | * Leave as soon as if exact resolution if reached. | 144 | * Leave as soon as if exact resolution if reached. |
| 145 | * Otherwise the higher resolution below 32 bits is kept. | 145 | * Otherwise the higher resolution below 32 bits is kept. |
| 146 | */ | 146 | */ |
| 147 | fl->res = 0; | ||
| 147 | for (fosr = 1; fosr <= DFSDM_MAX_FL_OVERSAMPLING; fosr++) { | 148 | for (fosr = 1; fosr <= DFSDM_MAX_FL_OVERSAMPLING; fosr++) { |
| 148 | for (iosr = 1; iosr <= DFSDM_MAX_INT_OVERSAMPLING; iosr++) { | 149 | for (iosr = 1; iosr <= DFSDM_MAX_INT_OVERSAMPLING; iosr++) { |
| 149 | if (fast) | 150 | if (fast) |
| @@ -193,7 +194,7 @@ static int stm32_dfsdm_set_osrs(struct stm32_dfsdm_filter *fl, | |||
| 193 | } | 194 | } |
| 194 | } | 195 | } |
| 195 | 196 | ||
| 196 | if (!fl->fosr) | 197 | if (!fl->res) |
| 197 | return -EINVAL; | 198 | return -EINVAL; |
| 198 | 199 | ||
| 199 | return 0; | 200 | return 0; |
| @@ -770,7 +771,7 @@ static int stm32_dfsdm_write_raw(struct iio_dev *indio_dev, | |||
| 770 | struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); | 771 | struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); |
| 771 | struct stm32_dfsdm_filter *fl = &adc->dfsdm->fl_list[adc->fl_id]; | 772 | struct stm32_dfsdm_filter *fl = &adc->dfsdm->fl_list[adc->fl_id]; |
| 772 | struct stm32_dfsdm_channel *ch = &adc->dfsdm->ch_list[chan->channel]; | 773 | struct stm32_dfsdm_channel *ch = &adc->dfsdm->ch_list[chan->channel]; |
| 773 | unsigned int spi_freq = adc->spi_freq; | 774 | unsigned int spi_freq; |
| 774 | int ret = -EINVAL; | 775 | int ret = -EINVAL; |
| 775 | 776 | ||
| 776 | switch (mask) { | 777 | switch (mask) { |
| @@ -784,8 +785,18 @@ static int stm32_dfsdm_write_raw(struct iio_dev *indio_dev, | |||
| 784 | case IIO_CHAN_INFO_SAMP_FREQ: | 785 | case IIO_CHAN_INFO_SAMP_FREQ: |
| 785 | if (!val) | 786 | if (!val) |
| 786 | return -EINVAL; | 787 | return -EINVAL; |
| 787 | if (ch->src != DFSDM_CHANNEL_SPI_CLOCK_EXTERNAL) | 788 | |
| 789 | switch (ch->src) { | ||
| 790 | case DFSDM_CHANNEL_SPI_CLOCK_INTERNAL: | ||
| 788 | spi_freq = adc->dfsdm->spi_master_freq; | 791 | spi_freq = adc->dfsdm->spi_master_freq; |
| 792 | break; | ||
| 793 | case DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_FALLING: | ||
| 794 | case DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_RISING: | ||
| 795 | spi_freq = adc->dfsdm->spi_master_freq / 2; | ||
| 796 | break; | ||
| 797 | default: | ||
| 798 | spi_freq = adc->spi_freq; | ||
| 799 | } | ||
| 789 | 800 | ||
| 790 | if (spi_freq % val) | 801 | if (spi_freq % val) |
| 791 | dev_warn(&indio_dev->dev, | 802 | dev_warn(&indio_dev->dev, |
diff --git a/drivers/iio/buffer/industrialio-buffer-dma.c b/drivers/iio/buffer/industrialio-buffer-dma.c index 05e0c353e089..b32bf57910ca 100644 --- a/drivers/iio/buffer/industrialio-buffer-dma.c +++ b/drivers/iio/buffer/industrialio-buffer-dma.c | |||
| @@ -587,7 +587,7 @@ EXPORT_SYMBOL_GPL(iio_dma_buffer_set_bytes_per_datum); | |||
| 587 | * Should be used as the set_length callback for iio_buffer_access_ops | 587 | * Should be used as the set_length callback for iio_buffer_access_ops |
| 588 | * struct for DMA buffers. | 588 | * struct for DMA buffers. |
| 589 | */ | 589 | */ |
| 590 | int iio_dma_buffer_set_length(struct iio_buffer *buffer, int length) | 590 | int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length) |
| 591 | { | 591 | { |
| 592 | /* Avoid an invalid state */ | 592 | /* Avoid an invalid state */ |
| 593 | if (length < 2) | 593 | if (length < 2) |
diff --git a/drivers/iio/buffer/kfifo_buf.c b/drivers/iio/buffer/kfifo_buf.c index 047fe757ab97..70c302a93d7f 100644 --- a/drivers/iio/buffer/kfifo_buf.c +++ b/drivers/iio/buffer/kfifo_buf.c | |||
| @@ -22,11 +22,18 @@ struct iio_kfifo { | |||
| 22 | #define iio_to_kfifo(r) container_of(r, struct iio_kfifo, buffer) | 22 | #define iio_to_kfifo(r) container_of(r, struct iio_kfifo, buffer) |
| 23 | 23 | ||
| 24 | static inline int __iio_allocate_kfifo(struct iio_kfifo *buf, | 24 | static inline int __iio_allocate_kfifo(struct iio_kfifo *buf, |
| 25 | int bytes_per_datum, int length) | 25 | size_t bytes_per_datum, unsigned int length) |
| 26 | { | 26 | { |
| 27 | if ((length == 0) || (bytes_per_datum == 0)) | 27 | if ((length == 0) || (bytes_per_datum == 0)) |
| 28 | return -EINVAL; | 28 | return -EINVAL; |
| 29 | 29 | ||
| 30 | /* | ||
| 31 | * Make sure we don't overflow an unsigned int after kfifo rounds up to | ||
| 32 | * the next power of 2. | ||
| 33 | */ | ||
| 34 | if (roundup_pow_of_two(length) > UINT_MAX / bytes_per_datum) | ||
| 35 | return -EINVAL; | ||
| 36 | |||
| 30 | return __kfifo_alloc((struct __kfifo *)&buf->kf, length, | 37 | return __kfifo_alloc((struct __kfifo *)&buf->kf, length, |
| 31 | bytes_per_datum, GFP_KERNEL); | 38 | bytes_per_datum, GFP_KERNEL); |
| 32 | } | 39 | } |
| @@ -67,7 +74,7 @@ static int iio_set_bytes_per_datum_kfifo(struct iio_buffer *r, size_t bpd) | |||
| 67 | return 0; | 74 | return 0; |
| 68 | } | 75 | } |
| 69 | 76 | ||
| 70 | static int iio_set_length_kfifo(struct iio_buffer *r, int length) | 77 | static int iio_set_length_kfifo(struct iio_buffer *r, unsigned int length) |
| 71 | { | 78 | { |
| 72 | /* Avoid an invalid state */ | 79 | /* Avoid an invalid state */ |
| 73 | if (length < 2) | 80 | if (length < 2) |
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index cfb6588565ba..4905a997a7ec 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c | |||
| @@ -178,14 +178,14 @@ int hid_sensor_power_state(struct hid_sensor_common *st, bool state) | |||
| 178 | #ifdef CONFIG_PM | 178 | #ifdef CONFIG_PM |
| 179 | int ret; | 179 | int ret; |
| 180 | 180 | ||
| 181 | atomic_set(&st->user_requested_state, state); | ||
| 182 | |||
| 183 | if (atomic_add_unless(&st->runtime_pm_enable, 1, 1)) | 181 | if (atomic_add_unless(&st->runtime_pm_enable, 1, 1)) |
| 184 | pm_runtime_enable(&st->pdev->dev); | 182 | pm_runtime_enable(&st->pdev->dev); |
| 185 | 183 | ||
| 186 | if (state) | 184 | if (state) { |
| 185 | atomic_inc(&st->user_requested_state); | ||
| 187 | ret = pm_runtime_get_sync(&st->pdev->dev); | 186 | ret = pm_runtime_get_sync(&st->pdev->dev); |
| 188 | else { | 187 | } else { |
| 188 | atomic_dec(&st->user_requested_state); | ||
| 189 | pm_runtime_mark_last_busy(&st->pdev->dev); | 189 | pm_runtime_mark_last_busy(&st->pdev->dev); |
| 190 | pm_runtime_use_autosuspend(&st->pdev->dev); | 190 | pm_runtime_use_autosuspend(&st->pdev->dev); |
| 191 | ret = pm_runtime_put_autosuspend(&st->pdev->dev); | 191 | ret = pm_runtime_put_autosuspend(&st->pdev->dev); |
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index fb2d347f760f..ecc55e98ddd3 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c | |||
| @@ -502,7 +502,7 @@ static int __ib_cache_gid_get(struct ib_device *ib_dev, u8 port, int index, | |||
| 502 | return -EINVAL; | 502 | return -EINVAL; |
| 503 | 503 | ||
| 504 | if (table->data_vec[index].props & GID_TABLE_ENTRY_INVALID) | 504 | if (table->data_vec[index].props & GID_TABLE_ENTRY_INVALID) |
| 505 | return -EAGAIN; | 505 | return -EINVAL; |
| 506 | 506 | ||
| 507 | memcpy(gid, &table->data_vec[index].gid, sizeof(*gid)); | 507 | memcpy(gid, &table->data_vec[index].gid, sizeof(*gid)); |
| 508 | if (attr) { | 508 | if (attr) { |
diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index f6c739ec8b62..20b9f31052bf 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c | |||
| @@ -185,12 +185,65 @@ static void bnxt_re_shutdown(void *p) | |||
| 185 | bnxt_re_ib_unreg(rdev, false); | 185 | bnxt_re_ib_unreg(rdev, false); |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | static void bnxt_re_stop_irq(void *handle) | ||
| 189 | { | ||
| 190 | struct bnxt_re_dev *rdev = (struct bnxt_re_dev *)handle; | ||
| 191 | struct bnxt_qplib_rcfw *rcfw = &rdev->rcfw; | ||
| 192 | struct bnxt_qplib_nq *nq; | ||
| 193 | int indx; | ||
| 194 | |||
| 195 | for (indx = BNXT_RE_NQ_IDX; indx < rdev->num_msix; indx++) { | ||
| 196 | nq = &rdev->nq[indx - 1]; | ||
| 197 | bnxt_qplib_nq_stop_irq(nq, false); | ||
| 198 | } | ||
| 199 | |||
| 200 | bnxt_qplib_rcfw_stop_irq(rcfw, false); | ||
| 201 | } | ||
| 202 | |||
| 203 | static void bnxt_re_start_irq(void *handle, struct bnxt_msix_entry *ent) | ||
| 204 | { | ||
| 205 | struct bnxt_re_dev *rdev = (struct bnxt_re_dev *)handle; | ||
| 206 | struct bnxt_msix_entry *msix_ent = rdev->msix_entries; | ||
| 207 | struct bnxt_qplib_rcfw *rcfw = &rdev->rcfw; | ||
| 208 | struct bnxt_qplib_nq *nq; | ||
| 209 | int indx, rc; | ||
| 210 | |||
| 211 | if (!ent) { | ||
| 212 | /* Not setting the f/w timeout bit in rcfw. | ||
| 213 | * During the driver unload the first command | ||
| 214 | * to f/w will timeout and that will set the | ||
| 215 | * timeout bit. | ||
| 216 | */ | ||
| 217 | dev_err(rdev_to_dev(rdev), "Failed to re-start IRQs\n"); | ||
| 218 | return; | ||
| 219 | } | ||
| 220 | |||
| 221 | /* Vectors may change after restart, so update with new vectors | ||
| 222 | * in device sctructure. | ||
| 223 | */ | ||
| 224 | for (indx = 0; indx < rdev->num_msix; indx++) | ||
| 225 | rdev->msix_entries[indx].vector = ent[indx].vector; | ||
| 226 | |||
| 227 | bnxt_qplib_rcfw_start_irq(rcfw, msix_ent[BNXT_RE_AEQ_IDX].vector, | ||
| 228 | false); | ||
| 229 | for (indx = BNXT_RE_NQ_IDX ; indx < rdev->num_msix; indx++) { | ||
| 230 | nq = &rdev->nq[indx - 1]; | ||
| 231 | rc = bnxt_qplib_nq_start_irq(nq, indx - 1, | ||
| 232 | msix_ent[indx].vector, false); | ||
| 233 | if (rc) | ||
| 234 | dev_warn(rdev_to_dev(rdev), | ||
| 235 | "Failed to reinit NQ index %d\n", indx - 1); | ||
| 236 | } | ||
| 237 | } | ||
| 238 | |||
| 188 | static struct bnxt_ulp_ops bnxt_re_ulp_ops = { | 239 | static struct bnxt_ulp_ops bnxt_re_ulp_ops = { |
| 189 | .ulp_async_notifier = NULL, | 240 | .ulp_async_notifier = NULL, |
| 190 | .ulp_stop = bnxt_re_stop, | 241 | .ulp_stop = bnxt_re_stop, |
| 191 | .ulp_start = bnxt_re_start, | 242 | .ulp_start = bnxt_re_start, |
| 192 | .ulp_sriov_config = bnxt_re_sriov_config, | 243 | .ulp_sriov_config = bnxt_re_sriov_config, |
| 193 | .ulp_shutdown = bnxt_re_shutdown | 244 | .ulp_shutdown = bnxt_re_shutdown, |
| 245 | .ulp_irq_stop = bnxt_re_stop_irq, | ||
| 246 | .ulp_irq_restart = bnxt_re_start_irq | ||
| 194 | }; | 247 | }; |
| 195 | 248 | ||
| 196 | /* RoCE -> Net driver */ | 249 | /* RoCE -> Net driver */ |
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index 3a78faba8d91..50d8f1fc98d5 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c | |||
| @@ -336,22 +336,32 @@ static irqreturn_t bnxt_qplib_nq_irq(int irq, void *dev_instance) | |||
| 336 | return IRQ_HANDLED; | 336 | return IRQ_HANDLED; |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | void bnxt_qplib_nq_stop_irq(struct bnxt_qplib_nq *nq, bool kill) | ||
| 340 | { | ||
| 341 | tasklet_disable(&nq->worker); | ||
| 342 | /* Mask h/w interrupt */ | ||
| 343 | NQ_DB(nq->bar_reg_iomem, nq->hwq.cons, nq->hwq.max_elements); | ||
| 344 | /* Sync with last running IRQ handler */ | ||
| 345 | synchronize_irq(nq->vector); | ||
| 346 | if (kill) | ||
| 347 | tasklet_kill(&nq->worker); | ||
| 348 | if (nq->requested) { | ||
| 349 | irq_set_affinity_hint(nq->vector, NULL); | ||
| 350 | free_irq(nq->vector, nq); | ||
| 351 | nq->requested = false; | ||
| 352 | } | ||
| 353 | } | ||
| 354 | |||
| 339 | void bnxt_qplib_disable_nq(struct bnxt_qplib_nq *nq) | 355 | void bnxt_qplib_disable_nq(struct bnxt_qplib_nq *nq) |
| 340 | { | 356 | { |
| 341 | if (nq->cqn_wq) { | 357 | if (nq->cqn_wq) { |
| 342 | destroy_workqueue(nq->cqn_wq); | 358 | destroy_workqueue(nq->cqn_wq); |
| 343 | nq->cqn_wq = NULL; | 359 | nq->cqn_wq = NULL; |
| 344 | } | 360 | } |
| 361 | |||
| 345 | /* Make sure the HW is stopped! */ | 362 | /* Make sure the HW is stopped! */ |
| 346 | synchronize_irq(nq->vector); | 363 | bnxt_qplib_nq_stop_irq(nq, true); |
| 347 | tasklet_disable(&nq->worker); | ||
| 348 | tasklet_kill(&nq->worker); | ||
| 349 | 364 | ||
| 350 | if (nq->requested) { | ||
| 351 | irq_set_affinity_hint(nq->vector, NULL); | ||
| 352 | free_irq(nq->vector, nq); | ||
| 353 | nq->requested = false; | ||
| 354 | } | ||
| 355 | if (nq->bar_reg_iomem) | 365 | if (nq->bar_reg_iomem) |
| 356 | iounmap(nq->bar_reg_iomem); | 366 | iounmap(nq->bar_reg_iomem); |
| 357 | nq->bar_reg_iomem = NULL; | 367 | nq->bar_reg_iomem = NULL; |
| @@ -361,6 +371,40 @@ void bnxt_qplib_disable_nq(struct bnxt_qplib_nq *nq) | |||
| 361 | nq->vector = 0; | 371 | nq->vector = 0; |
| 362 | } | 372 | } |
| 363 | 373 | ||
| 374 | int bnxt_qplib_nq_start_irq(struct bnxt_qplib_nq *nq, int nq_indx, | ||
| 375 | int msix_vector, bool need_init) | ||
| 376 | { | ||
| 377 | int rc; | ||
| 378 | |||
| 379 | if (nq->requested) | ||
| 380 | return -EFAULT; | ||
| 381 | |||
| 382 | nq->vector = msix_vector; | ||
| 383 | if (need_init) | ||
| 384 | tasklet_init(&nq->worker, bnxt_qplib_service_nq, | ||
| 385 | (unsigned long)nq); | ||
| 386 | else | ||
| 387 | tasklet_enable(&nq->worker); | ||
| 388 | |||
| 389 | snprintf(nq->name, sizeof(nq->name), "bnxt_qplib_nq-%d", nq_indx); | ||
| 390 | rc = request_irq(nq->vector, bnxt_qplib_nq_irq, 0, nq->name, nq); | ||
| 391 | if (rc) | ||
| 392 | return rc; | ||
| 393 | |||
| 394 | cpumask_clear(&nq->mask); | ||
| 395 | cpumask_set_cpu(nq_indx, &nq->mask); | ||
| 396 | rc = irq_set_affinity_hint(nq->vector, &nq->mask); | ||
| 397 | if (rc) { | ||
| 398 | dev_warn(&nq->pdev->dev, | ||
| 399 | "QPLIB: set affinity failed; vector: %d nq_idx: %d\n", | ||
| 400 | nq->vector, nq_indx); | ||
| 401 | } | ||
| 402 | nq->requested = true; | ||
| 403 | NQ_DB_REARM(nq->bar_reg_iomem, nq->hwq.cons, nq->hwq.max_elements); | ||
| 404 | |||
| 405 | return rc; | ||
| 406 | } | ||
| 407 | |||
| 364 | int bnxt_qplib_enable_nq(struct pci_dev *pdev, struct bnxt_qplib_nq *nq, | 408 | int bnxt_qplib_enable_nq(struct pci_dev *pdev, struct bnxt_qplib_nq *nq, |
| 365 | int nq_idx, int msix_vector, int bar_reg_offset, | 409 | int nq_idx, int msix_vector, int bar_reg_offset, |
| 366 | int (*cqn_handler)(struct bnxt_qplib_nq *nq, | 410 | int (*cqn_handler)(struct bnxt_qplib_nq *nq, |
| @@ -372,41 +416,17 @@ int bnxt_qplib_enable_nq(struct pci_dev *pdev, struct bnxt_qplib_nq *nq, | |||
| 372 | resource_size_t nq_base; | 416 | resource_size_t nq_base; |
| 373 | int rc = -1; | 417 | int rc = -1; |
| 374 | 418 | ||
| 375 | nq->pdev = pdev; | ||
| 376 | nq->vector = msix_vector; | ||
| 377 | if (cqn_handler) | 419 | if (cqn_handler) |
| 378 | nq->cqn_handler = cqn_handler; | 420 | nq->cqn_handler = cqn_handler; |
| 379 | 421 | ||
| 380 | if (srqn_handler) | 422 | if (srqn_handler) |
| 381 | nq->srqn_handler = srqn_handler; | 423 | nq->srqn_handler = srqn_handler; |
| 382 | 424 | ||
| 383 | tasklet_init(&nq->worker, bnxt_qplib_service_nq, (unsigned long)nq); | ||
| 384 | |||
| 385 | /* Have a task to schedule CQ notifiers in post send case */ | 425 | /* Have a task to schedule CQ notifiers in post send case */ |
| 386 | nq->cqn_wq = create_singlethread_workqueue("bnxt_qplib_nq"); | 426 | nq->cqn_wq = create_singlethread_workqueue("bnxt_qplib_nq"); |
| 387 | if (!nq->cqn_wq) | 427 | if (!nq->cqn_wq) |
| 388 | goto fail; | 428 | return -ENOMEM; |
| 389 | |||
| 390 | nq->requested = false; | ||
| 391 | memset(nq->name, 0, 32); | ||
| 392 | sprintf(nq->name, "bnxt_qplib_nq-%d", nq_idx); | ||
| 393 | rc = request_irq(nq->vector, bnxt_qplib_nq_irq, 0, nq->name, nq); | ||
| 394 | if (rc) { | ||
| 395 | dev_err(&nq->pdev->dev, | ||
| 396 | "Failed to request IRQ for NQ: %#x", rc); | ||
| 397 | goto fail; | ||
| 398 | } | ||
| 399 | |||
| 400 | cpumask_clear(&nq->mask); | ||
| 401 | cpumask_set_cpu(nq_idx, &nq->mask); | ||
| 402 | rc = irq_set_affinity_hint(nq->vector, &nq->mask); | ||
| 403 | if (rc) { | ||
| 404 | dev_warn(&nq->pdev->dev, | ||
| 405 | "QPLIB: set affinity failed; vector: %d nq_idx: %d\n", | ||
| 406 | nq->vector, nq_idx); | ||
| 407 | } | ||
| 408 | 429 | ||
| 409 | nq->requested = true; | ||
| 410 | nq->bar_reg = NQ_CONS_PCI_BAR_REGION; | 430 | nq->bar_reg = NQ_CONS_PCI_BAR_REGION; |
| 411 | nq->bar_reg_off = bar_reg_offset; | 431 | nq->bar_reg_off = bar_reg_offset; |
| 412 | nq_base = pci_resource_start(pdev, nq->bar_reg); | 432 | nq_base = pci_resource_start(pdev, nq->bar_reg); |
| @@ -419,7 +439,13 @@ int bnxt_qplib_enable_nq(struct pci_dev *pdev, struct bnxt_qplib_nq *nq, | |||
| 419 | rc = -ENOMEM; | 439 | rc = -ENOMEM; |
| 420 | goto fail; | 440 | goto fail; |
| 421 | } | 441 | } |
| 422 | NQ_DB_REARM(nq->bar_reg_iomem, nq->hwq.cons, nq->hwq.max_elements); | 442 | |
| 443 | rc = bnxt_qplib_nq_start_irq(nq, nq_idx, msix_vector, true); | ||
| 444 | if (rc) { | ||
| 445 | dev_err(&nq->pdev->dev, | ||
| 446 | "QPLIB: Failed to request irq for nq-idx %d", nq_idx); | ||
| 447 | goto fail; | ||
| 448 | } | ||
| 423 | 449 | ||
| 424 | return 0; | 450 | return 0; |
| 425 | fail: | 451 | fail: |
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.h b/drivers/infiniband/hw/bnxt_re/qplib_fp.h index ade9f13c0fd1..72352ca80ace 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.h | |||
| @@ -467,7 +467,10 @@ struct bnxt_qplib_nq_work { | |||
| 467 | struct bnxt_qplib_cq *cq; | 467 | struct bnxt_qplib_cq *cq; |
| 468 | }; | 468 | }; |
| 469 | 469 | ||
| 470 | void bnxt_qplib_nq_stop_irq(struct bnxt_qplib_nq *nq, bool kill); | ||
| 470 | void bnxt_qplib_disable_nq(struct bnxt_qplib_nq *nq); | 471 | void bnxt_qplib_disable_nq(struct bnxt_qplib_nq *nq); |
| 472 | int bnxt_qplib_nq_start_irq(struct bnxt_qplib_nq *nq, int nq_indx, | ||
| 473 | int msix_vector, bool need_init); | ||
| 471 | int bnxt_qplib_enable_nq(struct pci_dev *pdev, struct bnxt_qplib_nq *nq, | 474 | int bnxt_qplib_enable_nq(struct pci_dev *pdev, struct bnxt_qplib_nq *nq, |
| 472 | int nq_idx, int msix_vector, int bar_reg_offset, | 475 | int nq_idx, int msix_vector, int bar_reg_offset, |
| 473 | int (*cqn_handler)(struct bnxt_qplib_nq *nq, | 476 | int (*cqn_handler)(struct bnxt_qplib_nq *nq, |
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c index 80027a494730..2852d350ada1 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | |||
| @@ -582,19 +582,29 @@ fail: | |||
| 582 | return -ENOMEM; | 582 | return -ENOMEM; |
| 583 | } | 583 | } |
| 584 | 584 | ||
| 585 | void bnxt_qplib_disable_rcfw_channel(struct bnxt_qplib_rcfw *rcfw) | 585 | void bnxt_qplib_rcfw_stop_irq(struct bnxt_qplib_rcfw *rcfw, bool kill) |
| 586 | { | 586 | { |
| 587 | unsigned long indx; | ||
| 588 | |||
| 589 | /* Make sure the HW channel is stopped! */ | ||
| 590 | synchronize_irq(rcfw->vector); | ||
| 591 | tasklet_disable(&rcfw->worker); | 587 | tasklet_disable(&rcfw->worker); |
| 592 | tasklet_kill(&rcfw->worker); | 588 | /* Mask h/w interrupts */ |
| 589 | CREQ_DB(rcfw->creq_bar_reg_iomem, rcfw->creq.cons, | ||
| 590 | rcfw->creq.max_elements); | ||
| 591 | /* Sync with last running IRQ-handler */ | ||
| 592 | synchronize_irq(rcfw->vector); | ||
| 593 | if (kill) | ||
| 594 | tasklet_kill(&rcfw->worker); | ||
| 593 | 595 | ||
| 594 | if (rcfw->requested) { | 596 | if (rcfw->requested) { |
| 595 | free_irq(rcfw->vector, rcfw); | 597 | free_irq(rcfw->vector, rcfw); |
| 596 | rcfw->requested = false; | 598 | rcfw->requested = false; |
| 597 | } | 599 | } |
| 600 | } | ||
| 601 | |||
| 602 | void bnxt_qplib_disable_rcfw_channel(struct bnxt_qplib_rcfw *rcfw) | ||
| 603 | { | ||
| 604 | unsigned long indx; | ||
| 605 | |||
| 606 | bnxt_qplib_rcfw_stop_irq(rcfw, true); | ||
| 607 | |||
| 598 | if (rcfw->cmdq_bar_reg_iomem) | 608 | if (rcfw->cmdq_bar_reg_iomem) |
| 599 | iounmap(rcfw->cmdq_bar_reg_iomem); | 609 | iounmap(rcfw->cmdq_bar_reg_iomem); |
| 600 | rcfw->cmdq_bar_reg_iomem = NULL; | 610 | rcfw->cmdq_bar_reg_iomem = NULL; |
| @@ -614,6 +624,31 @@ void bnxt_qplib_disable_rcfw_channel(struct bnxt_qplib_rcfw *rcfw) | |||
| 614 | rcfw->vector = 0; | 624 | rcfw->vector = 0; |
| 615 | } | 625 | } |
| 616 | 626 | ||
| 627 | int bnxt_qplib_rcfw_start_irq(struct bnxt_qplib_rcfw *rcfw, int msix_vector, | ||
| 628 | bool need_init) | ||
| 629 | { | ||
| 630 | int rc; | ||
| 631 | |||
| 632 | if (rcfw->requested) | ||
| 633 | return -EFAULT; | ||
| 634 | |||
| 635 | rcfw->vector = msix_vector; | ||
| 636 | if (need_init) | ||
| 637 | tasklet_init(&rcfw->worker, | ||
| 638 | bnxt_qplib_service_creq, (unsigned long)rcfw); | ||
| 639 | else | ||
| 640 | tasklet_enable(&rcfw->worker); | ||
| 641 | rc = request_irq(rcfw->vector, bnxt_qplib_creq_irq, 0, | ||
| 642 | "bnxt_qplib_creq", rcfw); | ||
| 643 | if (rc) | ||
| 644 | return rc; | ||
| 645 | rcfw->requested = true; | ||
| 646 | CREQ_DB_REARM(rcfw->creq_bar_reg_iomem, rcfw->creq.cons, | ||
| 647 | rcfw->creq.max_elements); | ||
| 648 | |||
| 649 | return 0; | ||
| 650 | } | ||
| 651 | |||
| 617 | int bnxt_qplib_enable_rcfw_channel(struct pci_dev *pdev, | 652 | int bnxt_qplib_enable_rcfw_channel(struct pci_dev *pdev, |
| 618 | struct bnxt_qplib_rcfw *rcfw, | 653 | struct bnxt_qplib_rcfw *rcfw, |
| 619 | int msix_vector, | 654 | int msix_vector, |
| @@ -675,27 +710,17 @@ int bnxt_qplib_enable_rcfw_channel(struct pci_dev *pdev, | |||
| 675 | rcfw->creq_qp_event_processed = 0; | 710 | rcfw->creq_qp_event_processed = 0; |
| 676 | rcfw->creq_func_event_processed = 0; | 711 | rcfw->creq_func_event_processed = 0; |
| 677 | 712 | ||
| 678 | rcfw->vector = msix_vector; | ||
| 679 | if (aeq_handler) | 713 | if (aeq_handler) |
| 680 | rcfw->aeq_handler = aeq_handler; | 714 | rcfw->aeq_handler = aeq_handler; |
| 715 | init_waitqueue_head(&rcfw->waitq); | ||
| 681 | 716 | ||
| 682 | tasklet_init(&rcfw->worker, bnxt_qplib_service_creq, | 717 | rc = bnxt_qplib_rcfw_start_irq(rcfw, msix_vector, true); |
| 683 | (unsigned long)rcfw); | ||
| 684 | |||
| 685 | rcfw->requested = false; | ||
| 686 | rc = request_irq(rcfw->vector, bnxt_qplib_creq_irq, 0, | ||
| 687 | "bnxt_qplib_creq", rcfw); | ||
| 688 | if (rc) { | 718 | if (rc) { |
| 689 | dev_err(&rcfw->pdev->dev, | 719 | dev_err(&rcfw->pdev->dev, |
| 690 | "QPLIB: Failed to request IRQ for CREQ rc = 0x%x", rc); | 720 | "QPLIB: Failed to request IRQ for CREQ rc = 0x%x", rc); |
| 691 | bnxt_qplib_disable_rcfw_channel(rcfw); | 721 | bnxt_qplib_disable_rcfw_channel(rcfw); |
| 692 | return rc; | 722 | return rc; |
| 693 | } | 723 | } |
| 694 | rcfw->requested = true; | ||
| 695 | |||
| 696 | init_waitqueue_head(&rcfw->waitq); | ||
| 697 | |||
| 698 | CREQ_DB_REARM(rcfw->creq_bar_reg_iomem, 0, rcfw->creq.max_elements); | ||
| 699 | 724 | ||
| 700 | init.cmdq_pbl = cpu_to_le64(rcfw->cmdq.pbl[PBL_LVL_0].pg_map_arr[0]); | 725 | init.cmdq_pbl = cpu_to_le64(rcfw->cmdq.pbl[PBL_LVL_0].pg_map_arr[0]); |
| 701 | init.cmdq_size_cmdq_lvl = cpu_to_le16( | 726 | init.cmdq_size_cmdq_lvl = cpu_to_le16( |
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h index c7cce2e4185e..46416dfe8830 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | |||
| @@ -195,7 +195,10 @@ struct bnxt_qplib_rcfw { | |||
| 195 | void bnxt_qplib_free_rcfw_channel(struct bnxt_qplib_rcfw *rcfw); | 195 | void bnxt_qplib_free_rcfw_channel(struct bnxt_qplib_rcfw *rcfw); |
| 196 | int bnxt_qplib_alloc_rcfw_channel(struct pci_dev *pdev, | 196 | int bnxt_qplib_alloc_rcfw_channel(struct pci_dev *pdev, |
| 197 | struct bnxt_qplib_rcfw *rcfw, int qp_tbl_sz); | 197 | struct bnxt_qplib_rcfw *rcfw, int qp_tbl_sz); |
| 198 | void bnxt_qplib_rcfw_stop_irq(struct bnxt_qplib_rcfw *rcfw, bool kill); | ||
| 198 | void bnxt_qplib_disable_rcfw_channel(struct bnxt_qplib_rcfw *rcfw); | 199 | void bnxt_qplib_disable_rcfw_channel(struct bnxt_qplib_rcfw *rcfw); |
| 200 | int bnxt_qplib_rcfw_start_irq(struct bnxt_qplib_rcfw *rcfw, int msix_vector, | ||
| 201 | bool need_init); | ||
| 199 | int bnxt_qplib_enable_rcfw_channel(struct pci_dev *pdev, | 202 | int bnxt_qplib_enable_rcfw_channel(struct pci_dev *pdev, |
| 200 | struct bnxt_qplib_rcfw *rcfw, | 203 | struct bnxt_qplib_rcfw *rcfw, |
| 201 | int msix_vector, | 204 | int msix_vector, |
diff --git a/drivers/infiniband/ulp/srpt/Kconfig b/drivers/infiniband/ulp/srpt/Kconfig index 25bf6955b6d0..fb8b7182f05e 100644 --- a/drivers/infiniband/ulp/srpt/Kconfig +++ b/drivers/infiniband/ulp/srpt/Kconfig | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | config INFINIBAND_SRPT | 1 | config INFINIBAND_SRPT |
| 2 | tristate "InfiniBand SCSI RDMA Protocol target support" | 2 | tristate "InfiniBand SCSI RDMA Protocol target support" |
| 3 | depends on INFINIBAND_ADDR_TRANS && TARGET_CORE | 3 | depends on INFINIBAND && INFINIBAND_ADDR_TRANS && TARGET_CORE |
| 4 | ---help--- | 4 | ---help--- |
| 5 | 5 | ||
| 6 | Support for the SCSI RDMA Protocol (SRP) Target driver. The | 6 | Support for the SCSI RDMA Protocol (SRP) Target driver. The |
diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c index 29f99529b187..cfcb32559925 100644 --- a/drivers/input/mouse/elan_i2c_smbus.c +++ b/drivers/input/mouse/elan_i2c_smbus.c | |||
| @@ -130,7 +130,7 @@ static int elan_smbus_get_baseline_data(struct i2c_client *client, | |||
| 130 | bool max_baseline, u8 *value) | 130 | bool max_baseline, u8 *value) |
| 131 | { | 131 | { |
| 132 | int error; | 132 | int error; |
| 133 | u8 val[3]; | 133 | u8 val[I2C_SMBUS_BLOCK_MAX] = {0}; |
| 134 | 134 | ||
| 135 | error = i2c_smbus_read_block_data(client, | 135 | error = i2c_smbus_read_block_data(client, |
| 136 | max_baseline ? | 136 | max_baseline ? |
| @@ -149,7 +149,7 @@ static int elan_smbus_get_version(struct i2c_client *client, | |||
| 149 | bool iap, u8 *version) | 149 | bool iap, u8 *version) |
| 150 | { | 150 | { |
| 151 | int error; | 151 | int error; |
| 152 | u8 val[3]; | 152 | u8 val[I2C_SMBUS_BLOCK_MAX] = {0}; |
| 153 | 153 | ||
| 154 | error = i2c_smbus_read_block_data(client, | 154 | error = i2c_smbus_read_block_data(client, |
| 155 | iap ? ETP_SMBUS_IAP_VERSION_CMD : | 155 | iap ? ETP_SMBUS_IAP_VERSION_CMD : |
| @@ -170,7 +170,7 @@ static int elan_smbus_get_sm_version(struct i2c_client *client, | |||
| 170 | u8 *clickpad) | 170 | u8 *clickpad) |
| 171 | { | 171 | { |
| 172 | int error; | 172 | int error; |
| 173 | u8 val[3]; | 173 | u8 val[I2C_SMBUS_BLOCK_MAX] = {0}; |
| 174 | 174 | ||
| 175 | error = i2c_smbus_read_block_data(client, | 175 | error = i2c_smbus_read_block_data(client, |
| 176 | ETP_SMBUS_SM_VERSION_CMD, val); | 176 | ETP_SMBUS_SM_VERSION_CMD, val); |
| @@ -188,7 +188,7 @@ static int elan_smbus_get_sm_version(struct i2c_client *client, | |||
| 188 | static int elan_smbus_get_product_id(struct i2c_client *client, u16 *id) | 188 | static int elan_smbus_get_product_id(struct i2c_client *client, u16 *id) |
| 189 | { | 189 | { |
| 190 | int error; | 190 | int error; |
| 191 | u8 val[3]; | 191 | u8 val[I2C_SMBUS_BLOCK_MAX] = {0}; |
| 192 | 192 | ||
| 193 | error = i2c_smbus_read_block_data(client, | 193 | error = i2c_smbus_read_block_data(client, |
| 194 | ETP_SMBUS_UNIQUEID_CMD, val); | 194 | ETP_SMBUS_UNIQUEID_CMD, val); |
| @@ -205,7 +205,7 @@ static int elan_smbus_get_checksum(struct i2c_client *client, | |||
| 205 | bool iap, u16 *csum) | 205 | bool iap, u16 *csum) |
| 206 | { | 206 | { |
| 207 | int error; | 207 | int error; |
| 208 | u8 val[3]; | 208 | u8 val[I2C_SMBUS_BLOCK_MAX] = {0}; |
| 209 | 209 | ||
| 210 | error = i2c_smbus_read_block_data(client, | 210 | error = i2c_smbus_read_block_data(client, |
| 211 | iap ? ETP_SMBUS_FW_CHECKSUM_CMD : | 211 | iap ? ETP_SMBUS_FW_CHECKSUM_CMD : |
| @@ -226,7 +226,7 @@ static int elan_smbus_get_max(struct i2c_client *client, | |||
| 226 | { | 226 | { |
| 227 | int ret; | 227 | int ret; |
| 228 | int error; | 228 | int error; |
| 229 | u8 val[3]; | 229 | u8 val[I2C_SMBUS_BLOCK_MAX] = {0}; |
| 230 | 230 | ||
| 231 | ret = i2c_smbus_read_block_data(client, ETP_SMBUS_RANGE_CMD, val); | 231 | ret = i2c_smbus_read_block_data(client, ETP_SMBUS_RANGE_CMD, val); |
| 232 | if (ret != 3) { | 232 | if (ret != 3) { |
| @@ -246,7 +246,7 @@ static int elan_smbus_get_resolution(struct i2c_client *client, | |||
| 246 | { | 246 | { |
| 247 | int ret; | 247 | int ret; |
| 248 | int error; | 248 | int error; |
| 249 | u8 val[3]; | 249 | u8 val[I2C_SMBUS_BLOCK_MAX] = {0}; |
| 250 | 250 | ||
| 251 | ret = i2c_smbus_read_block_data(client, ETP_SMBUS_RESOLUTION_CMD, val); | 251 | ret = i2c_smbus_read_block_data(client, ETP_SMBUS_RESOLUTION_CMD, val); |
| 252 | if (ret != 3) { | 252 | if (ret != 3) { |
| @@ -267,7 +267,7 @@ static int elan_smbus_get_num_traces(struct i2c_client *client, | |||
| 267 | { | 267 | { |
| 268 | int ret; | 268 | int ret; |
| 269 | int error; | 269 | int error; |
| 270 | u8 val[3]; | 270 | u8 val[I2C_SMBUS_BLOCK_MAX] = {0}; |
| 271 | 271 | ||
| 272 | ret = i2c_smbus_read_block_data(client, ETP_SMBUS_XY_TRACENUM_CMD, val); | 272 | ret = i2c_smbus_read_block_data(client, ETP_SMBUS_XY_TRACENUM_CMD, val); |
| 273 | if (ret != 3) { | 273 | if (ret != 3) { |
| @@ -294,7 +294,7 @@ static int elan_smbus_iap_get_mode(struct i2c_client *client, | |||
| 294 | { | 294 | { |
| 295 | int error; | 295 | int error; |
| 296 | u16 constant; | 296 | u16 constant; |
| 297 | u8 val[3]; | 297 | u8 val[I2C_SMBUS_BLOCK_MAX] = {0}; |
| 298 | 298 | ||
| 299 | error = i2c_smbus_read_block_data(client, ETP_SMBUS_IAP_CTRL_CMD, val); | 299 | error = i2c_smbus_read_block_data(client, ETP_SMBUS_IAP_CTRL_CMD, val); |
| 300 | if (error < 0) { | 300 | if (error < 0) { |
| @@ -345,7 +345,7 @@ static int elan_smbus_prepare_fw_update(struct i2c_client *client) | |||
| 345 | int len; | 345 | int len; |
| 346 | int error; | 346 | int error; |
| 347 | enum tp_mode mode; | 347 | enum tp_mode mode; |
| 348 | u8 val[3]; | 348 | u8 val[I2C_SMBUS_BLOCK_MAX] = {0}; |
| 349 | u8 cmd[4] = {0x0F, 0x78, 0x00, 0x06}; | 349 | u8 cmd[4] = {0x0F, 0x78, 0x00, 0x06}; |
| 350 | u16 password; | 350 | u16 password; |
| 351 | 351 | ||
| @@ -419,7 +419,7 @@ static int elan_smbus_write_fw_block(struct i2c_client *client, | |||
| 419 | struct device *dev = &client->dev; | 419 | struct device *dev = &client->dev; |
| 420 | int error; | 420 | int error; |
| 421 | u16 result; | 421 | u16 result; |
| 422 | u8 val[3]; | 422 | u8 val[I2C_SMBUS_BLOCK_MAX] = {0}; |
| 423 | 423 | ||
| 424 | /* | 424 | /* |
| 425 | * Due to the limitation of smbus protocol limiting | 425 | * Due to the limitation of smbus protocol limiting |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 60f2c463d1cc..a9591d278145 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
| @@ -172,6 +172,12 @@ static const char * const smbus_pnp_ids[] = { | |||
| 172 | "LEN0048", /* X1 Carbon 3 */ | 172 | "LEN0048", /* X1 Carbon 3 */ |
| 173 | "LEN0046", /* X250 */ | 173 | "LEN0046", /* X250 */ |
| 174 | "LEN004a", /* W541 */ | 174 | "LEN004a", /* W541 */ |
| 175 | "LEN0071", /* T480 */ | ||
| 176 | "LEN0072", /* X1 Carbon Gen 5 (2017) - Elan/ALPS trackpoint */ | ||
| 177 | "LEN0073", /* X1 Carbon G5 (Elantech) */ | ||
| 178 | "LEN0092", /* X1 Carbon 6 */ | ||
| 179 | "LEN0096", /* X280 */ | ||
| 180 | "LEN0097", /* X280 -> ALPS trackpoint */ | ||
| 175 | "LEN200f", /* T450s */ | 181 | "LEN200f", /* T450s */ |
| 176 | NULL | 182 | NULL |
| 177 | }; | 183 | }; |
diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig index dbb7464c018c..88a8b5916624 100644 --- a/drivers/nvme/host/Kconfig +++ b/drivers/nvme/host/Kconfig | |||
| @@ -27,7 +27,7 @@ config NVME_FABRICS | |||
| 27 | 27 | ||
| 28 | config NVME_RDMA | 28 | config NVME_RDMA |
| 29 | tristate "NVM Express over Fabrics RDMA host driver" | 29 | tristate "NVM Express over Fabrics RDMA host driver" |
| 30 | depends on INFINIBAND_ADDR_TRANS && BLOCK | 30 | depends on INFINIBAND && INFINIBAND_ADDR_TRANS && BLOCK |
| 31 | select NVME_CORE | 31 | select NVME_CORE |
| 32 | select NVME_FABRICS | 32 | select NVME_FABRICS |
| 33 | select SG_POOL | 33 | select SG_POOL |
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 99b857e5a7a9..b9ca782fe82d 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
| @@ -1447,8 +1447,8 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id) | |||
| 1447 | if (ns->lba_shift == 0) | 1447 | if (ns->lba_shift == 0) |
| 1448 | ns->lba_shift = 9; | 1448 | ns->lba_shift = 9; |
| 1449 | ns->noiob = le16_to_cpu(id->noiob); | 1449 | ns->noiob = le16_to_cpu(id->noiob); |
| 1450 | ns->ext = ns->ms && (id->flbas & NVME_NS_FLBAS_META_EXT); | ||
| 1451 | ns->ms = le16_to_cpu(id->lbaf[id->flbas & NVME_NS_FLBAS_LBA_MASK].ms); | 1450 | ns->ms = le16_to_cpu(id->lbaf[id->flbas & NVME_NS_FLBAS_LBA_MASK].ms); |
| 1451 | ns->ext = ns->ms && (id->flbas & NVME_NS_FLBAS_META_EXT); | ||
| 1452 | /* the PI implementation requires metadata equal t10 pi tuple size */ | 1452 | /* the PI implementation requires metadata equal t10 pi tuple size */ |
| 1453 | if (ns->ms == sizeof(struct t10_pi_tuple)) | 1453 | if (ns->ms == sizeof(struct t10_pi_tuple)) |
| 1454 | ns->pi_type = id->dps & NVME_NS_DPS_PI_MASK; | 1454 | ns->pi_type = id->dps & NVME_NS_DPS_PI_MASK; |
diff --git a/drivers/nvme/target/Kconfig b/drivers/nvme/target/Kconfig index 7595664ee753..3c7b61ddb0d1 100644 --- a/drivers/nvme/target/Kconfig +++ b/drivers/nvme/target/Kconfig | |||
| @@ -27,7 +27,7 @@ config NVME_TARGET_LOOP | |||
| 27 | 27 | ||
| 28 | config NVME_TARGET_RDMA | 28 | config NVME_TARGET_RDMA |
| 29 | tristate "NVMe over Fabrics RDMA target support" | 29 | tristate "NVMe over Fabrics RDMA target support" |
| 30 | depends on INFINIBAND_ADDR_TRANS | 30 | depends on INFINIBAND && INFINIBAND_ADDR_TRANS |
| 31 | depends on NVME_TARGET | 31 | depends on NVME_TARGET |
| 32 | select SGL_ALLOC | 32 | select SGL_ALLOC |
| 33 | help | 33 | help |
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index a32c5c00e0e7..ffffb9909ae1 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
| @@ -163,6 +163,16 @@ MODULE_LICENSE("GPL"); | |||
| 163 | 163 | ||
| 164 | static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL }; | 164 | static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL }; |
| 165 | 165 | ||
| 166 | static bool ashs_present(void) | ||
| 167 | { | ||
| 168 | int i = 0; | ||
| 169 | while (ashs_ids[i]) { | ||
| 170 | if (acpi_dev_found(ashs_ids[i++])) | ||
| 171 | return true; | ||
| 172 | } | ||
| 173 | return false; | ||
| 174 | } | ||
| 175 | |||
| 166 | struct bios_args { | 176 | struct bios_args { |
| 167 | u32 arg0; | 177 | u32 arg0; |
| 168 | u32 arg1; | 178 | u32 arg1; |
| @@ -1025,6 +1035,9 @@ static int asus_new_rfkill(struct asus_wmi *asus, | |||
| 1025 | 1035 | ||
| 1026 | static void asus_wmi_rfkill_exit(struct asus_wmi *asus) | 1036 | static void asus_wmi_rfkill_exit(struct asus_wmi *asus) |
| 1027 | { | 1037 | { |
| 1038 | if (asus->driver->wlan_ctrl_by_user && ashs_present()) | ||
| 1039 | return; | ||
| 1040 | |||
| 1028 | asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P5"); | 1041 | asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P5"); |
| 1029 | asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P6"); | 1042 | asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P6"); |
| 1030 | asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P7"); | 1043 | asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P7"); |
| @@ -2121,16 +2134,6 @@ static int asus_wmi_fan_init(struct asus_wmi *asus) | |||
| 2121 | return 0; | 2134 | return 0; |
| 2122 | } | 2135 | } |
| 2123 | 2136 | ||
| 2124 | static bool ashs_present(void) | ||
| 2125 | { | ||
| 2126 | int i = 0; | ||
| 2127 | while (ashs_ids[i]) { | ||
| 2128 | if (acpi_dev_found(ashs_ids[i++])) | ||
| 2129 | return true; | ||
| 2130 | } | ||
| 2131 | return false; | ||
| 2132 | } | ||
| 2133 | |||
| 2134 | /* | 2137 | /* |
| 2135 | * WMI Driver | 2138 | * WMI Driver |
| 2136 | */ | 2139 | */ |
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 04143c08bd6e..02c03e418c27 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
| @@ -3034,7 +3034,8 @@ static blk_status_t do_dasd_request(struct blk_mq_hw_ctx *hctx, | |||
| 3034 | cqr->callback_data = req; | 3034 | cqr->callback_data = req; |
| 3035 | cqr->status = DASD_CQR_FILLED; | 3035 | cqr->status = DASD_CQR_FILLED; |
| 3036 | cqr->dq = dq; | 3036 | cqr->dq = dq; |
| 3037 | req->completion_data = cqr; | 3037 | *((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req)) = cqr; |
| 3038 | |||
| 3038 | blk_mq_start_request(req); | 3039 | blk_mq_start_request(req); |
| 3039 | spin_lock(&block->queue_lock); | 3040 | spin_lock(&block->queue_lock); |
| 3040 | list_add_tail(&cqr->blocklist, &block->ccw_queue); | 3041 | list_add_tail(&cqr->blocklist, &block->ccw_queue); |
| @@ -3058,12 +3059,13 @@ out: | |||
| 3058 | */ | 3059 | */ |
| 3059 | enum blk_eh_timer_return dasd_times_out(struct request *req, bool reserved) | 3060 | enum blk_eh_timer_return dasd_times_out(struct request *req, bool reserved) |
| 3060 | { | 3061 | { |
| 3061 | struct dasd_ccw_req *cqr = req->completion_data; | ||
| 3062 | struct dasd_block *block = req->q->queuedata; | 3062 | struct dasd_block *block = req->q->queuedata; |
| 3063 | struct dasd_device *device; | 3063 | struct dasd_device *device; |
| 3064 | struct dasd_ccw_req *cqr; | ||
| 3064 | unsigned long flags; | 3065 | unsigned long flags; |
| 3065 | int rc = 0; | 3066 | int rc = 0; |
| 3066 | 3067 | ||
| 3068 | cqr = *((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req)); | ||
| 3067 | if (!cqr) | 3069 | if (!cqr) |
| 3068 | return BLK_EH_NOT_HANDLED; | 3070 | return BLK_EH_NOT_HANDLED; |
| 3069 | 3071 | ||
| @@ -3169,6 +3171,7 @@ static int dasd_alloc_queue(struct dasd_block *block) | |||
| 3169 | int rc; | 3171 | int rc; |
| 3170 | 3172 | ||
| 3171 | block->tag_set.ops = &dasd_mq_ops; | 3173 | block->tag_set.ops = &dasd_mq_ops; |
| 3174 | block->tag_set.cmd_size = sizeof(struct dasd_ccw_req *); | ||
| 3172 | block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES; | 3175 | block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES; |
| 3173 | block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV; | 3176 | block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV; |
| 3174 | block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; | 3177 | block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; |
diff --git a/drivers/soc/lantiq/gphy.c b/drivers/soc/lantiq/gphy.c index 8d8659463b3e..feeb17cebc25 100644 --- a/drivers/soc/lantiq/gphy.c +++ b/drivers/soc/lantiq/gphy.c | |||
| @@ -30,7 +30,6 @@ struct xway_gphy_priv { | |||
| 30 | struct clk *gphy_clk_gate; | 30 | struct clk *gphy_clk_gate; |
| 31 | struct reset_control *gphy_reset; | 31 | struct reset_control *gphy_reset; |
| 32 | struct reset_control *gphy_reset2; | 32 | struct reset_control *gphy_reset2; |
| 33 | struct notifier_block gphy_reboot_nb; | ||
| 34 | void __iomem *membase; | 33 | void __iomem *membase; |
| 35 | char *fw_name; | 34 | char *fw_name; |
| 36 | }; | 35 | }; |
| @@ -64,24 +63,6 @@ static const struct of_device_id xway_gphy_match[] = { | |||
| 64 | }; | 63 | }; |
| 65 | MODULE_DEVICE_TABLE(of, xway_gphy_match); | 64 | MODULE_DEVICE_TABLE(of, xway_gphy_match); |
| 66 | 65 | ||
| 67 | static struct xway_gphy_priv *to_xway_gphy_priv(struct notifier_block *nb) | ||
| 68 | { | ||
| 69 | return container_of(nb, struct xway_gphy_priv, gphy_reboot_nb); | ||
| 70 | } | ||
| 71 | |||
| 72 | static int xway_gphy_reboot_notify(struct notifier_block *reboot_nb, | ||
| 73 | unsigned long code, void *unused) | ||
| 74 | { | ||
| 75 | struct xway_gphy_priv *priv = to_xway_gphy_priv(reboot_nb); | ||
| 76 | |||
| 77 | if (priv) { | ||
| 78 | reset_control_assert(priv->gphy_reset); | ||
| 79 | reset_control_assert(priv->gphy_reset2); | ||
| 80 | } | ||
| 81 | |||
| 82 | return NOTIFY_DONE; | ||
| 83 | } | ||
| 84 | |||
| 85 | static int xway_gphy_load(struct device *dev, struct xway_gphy_priv *priv, | 66 | static int xway_gphy_load(struct device *dev, struct xway_gphy_priv *priv, |
| 86 | dma_addr_t *dev_addr) | 67 | dma_addr_t *dev_addr) |
| 87 | { | 68 | { |
| @@ -205,14 +186,6 @@ static int xway_gphy_probe(struct platform_device *pdev) | |||
| 205 | reset_control_deassert(priv->gphy_reset); | 186 | reset_control_deassert(priv->gphy_reset); |
| 206 | reset_control_deassert(priv->gphy_reset2); | 187 | reset_control_deassert(priv->gphy_reset2); |
| 207 | 188 | ||
| 208 | /* assert the gphy reset because it can hang after a reboot: */ | ||
| 209 | priv->gphy_reboot_nb.notifier_call = xway_gphy_reboot_notify; | ||
| 210 | priv->gphy_reboot_nb.priority = -1; | ||
| 211 | |||
| 212 | ret = register_reboot_notifier(&priv->gphy_reboot_nb); | ||
| 213 | if (ret) | ||
| 214 | dev_warn(dev, "Failed to register reboot notifier\n"); | ||
| 215 | |||
| 216 | platform_set_drvdata(pdev, priv); | 189 | platform_set_drvdata(pdev, priv); |
| 217 | 190 | ||
| 218 | return ret; | 191 | return ret; |
| @@ -220,21 +193,12 @@ static int xway_gphy_probe(struct platform_device *pdev) | |||
| 220 | 193 | ||
| 221 | static int xway_gphy_remove(struct platform_device *pdev) | 194 | static int xway_gphy_remove(struct platform_device *pdev) |
| 222 | { | 195 | { |
| 223 | struct device *dev = &pdev->dev; | ||
| 224 | struct xway_gphy_priv *priv = platform_get_drvdata(pdev); | 196 | struct xway_gphy_priv *priv = platform_get_drvdata(pdev); |
| 225 | int ret; | ||
| 226 | |||
| 227 | reset_control_assert(priv->gphy_reset); | ||
| 228 | reset_control_assert(priv->gphy_reset2); | ||
| 229 | 197 | ||
| 230 | iowrite32be(0, priv->membase); | 198 | iowrite32be(0, priv->membase); |
| 231 | 199 | ||
| 232 | clk_disable_unprepare(priv->gphy_clk_gate); | 200 | clk_disable_unprepare(priv->gphy_clk_gate); |
| 233 | 201 | ||
| 234 | ret = unregister_reboot_notifier(&priv->gphy_reboot_nb); | ||
| 235 | if (ret) | ||
| 236 | dev_warn(dev, "Failed to unregister reboot notifier\n"); | ||
| 237 | |||
| 238 | return 0; | 202 | return 0; |
| 239 | } | 203 | } |
| 240 | 204 | ||
diff --git a/drivers/staging/lustre/lnet/Kconfig b/drivers/staging/lustre/lnet/Kconfig index f3b1ad4bd3dc..ad049e6f24e4 100644 --- a/drivers/staging/lustre/lnet/Kconfig +++ b/drivers/staging/lustre/lnet/Kconfig | |||
| @@ -34,7 +34,7 @@ config LNET_SELFTEST | |||
| 34 | 34 | ||
| 35 | config LNET_XPRT_IB | 35 | config LNET_XPRT_IB |
| 36 | tristate "LNET infiniband support" | 36 | tristate "LNET infiniband support" |
| 37 | depends on LNET && PCI && INFINIBAND_ADDR_TRANS | 37 | depends on LNET && PCI && INFINIBAND && INFINIBAND_ADDR_TRANS |
| 38 | default LNET && INFINIBAND | 38 | default LNET && INFINIBAND |
| 39 | help | 39 | help |
| 40 | This option allows the LNET users to use infiniband as an | 40 | This option allows the LNET users to use infiniband as an |
diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c index 2d2ceda9aa26..500911f16498 100644 --- a/drivers/thunderbolt/icm.c +++ b/drivers/thunderbolt/icm.c | |||
| @@ -1255,7 +1255,7 @@ static int icm_ar_get_boot_acl(struct tb *tb, uuid_t *uuids, size_t nuuids) | |||
| 1255 | /* Map empty entries to null UUID */ | 1255 | /* Map empty entries to null UUID */ |
| 1256 | uuid[0] = 0; | 1256 | uuid[0] = 0; |
| 1257 | uuid[1] = 0; | 1257 | uuid[1] = 0; |
| 1258 | } else { | 1258 | } else if (uuid[0] != 0 || uuid[1] != 0) { |
| 1259 | /* Upper two DWs are always one's */ | 1259 | /* Upper two DWs are always one's */ |
| 1260 | uuid[2] = 0xffffffff; | 1260 | uuid[2] = 0xffffffff; |
| 1261 | uuid[3] = 0xffffffff; | 1261 | uuid[3] = 0xffffffff; |
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 5c212bf29640..3c082451ab1a 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c | |||
| @@ -404,6 +404,7 @@ static long vfio_pin_pages_remote(struct vfio_dma *dma, unsigned long vaddr, | |||
| 404 | { | 404 | { |
| 405 | unsigned long pfn = 0; | 405 | unsigned long pfn = 0; |
| 406 | long ret, pinned = 0, lock_acct = 0; | 406 | long ret, pinned = 0, lock_acct = 0; |
| 407 | bool rsvd; | ||
| 407 | dma_addr_t iova = vaddr - dma->vaddr + dma->iova; | 408 | dma_addr_t iova = vaddr - dma->vaddr + dma->iova; |
| 408 | 409 | ||
| 409 | /* This code path is only user initiated */ | 410 | /* This code path is only user initiated */ |
| @@ -414,23 +415,14 @@ static long vfio_pin_pages_remote(struct vfio_dma *dma, unsigned long vaddr, | |||
| 414 | if (ret) | 415 | if (ret) |
| 415 | return ret; | 416 | return ret; |
| 416 | 417 | ||
| 417 | if (is_invalid_reserved_pfn(*pfn_base)) { | ||
| 418 | struct vm_area_struct *vma; | ||
| 419 | |||
| 420 | down_read(¤t->mm->mmap_sem); | ||
| 421 | vma = find_vma_intersection(current->mm, vaddr, vaddr + 1); | ||
| 422 | pinned = min_t(long, npage, vma_pages(vma)); | ||
| 423 | up_read(¤t->mm->mmap_sem); | ||
| 424 | return pinned; | ||
| 425 | } | ||
| 426 | |||
| 427 | pinned++; | 418 | pinned++; |
| 419 | rsvd = is_invalid_reserved_pfn(*pfn_base); | ||
| 428 | 420 | ||
| 429 | /* | 421 | /* |
| 430 | * Reserved pages aren't counted against the user, externally pinned | 422 | * Reserved pages aren't counted against the user, externally pinned |
| 431 | * pages are already counted against the user. | 423 | * pages are already counted against the user. |
| 432 | */ | 424 | */ |
| 433 | if (!vfio_find_vpfn(dma, iova)) { | 425 | if (!rsvd && !vfio_find_vpfn(dma, iova)) { |
| 434 | if (!lock_cap && current->mm->locked_vm + 1 > limit) { | 426 | if (!lock_cap && current->mm->locked_vm + 1 > limit) { |
| 435 | put_pfn(*pfn_base, dma->prot); | 427 | put_pfn(*pfn_base, dma->prot); |
| 436 | pr_warn("%s: RLIMIT_MEMLOCK (%ld) exceeded\n", __func__, | 428 | pr_warn("%s: RLIMIT_MEMLOCK (%ld) exceeded\n", __func__, |
| @@ -450,12 +442,13 @@ static long vfio_pin_pages_remote(struct vfio_dma *dma, unsigned long vaddr, | |||
| 450 | if (ret) | 442 | if (ret) |
| 451 | break; | 443 | break; |
| 452 | 444 | ||
| 453 | if (pfn != *pfn_base + pinned) { | 445 | if (pfn != *pfn_base + pinned || |
| 446 | rsvd != is_invalid_reserved_pfn(pfn)) { | ||
| 454 | put_pfn(pfn, dma->prot); | 447 | put_pfn(pfn, dma->prot); |
| 455 | break; | 448 | break; |
| 456 | } | 449 | } |
| 457 | 450 | ||
| 458 | if (!vfio_find_vpfn(dma, iova)) { | 451 | if (!rsvd && !vfio_find_vpfn(dma, iova)) { |
| 459 | if (!lock_cap && | 452 | if (!lock_cap && |
| 460 | current->mm->locked_vm + lock_acct + 1 > limit) { | 453 | current->mm->locked_vm + lock_acct + 1 > limit) { |
| 461 | put_pfn(pfn, dma->prot); | 454 | put_pfn(pfn, dma->prot); |
| @@ -473,8 +466,10 @@ out: | |||
| 473 | 466 | ||
| 474 | unpin_out: | 467 | unpin_out: |
| 475 | if (ret) { | 468 | if (ret) { |
| 476 | for (pfn = *pfn_base ; pinned ; pfn++, pinned--) | 469 | if (!rsvd) { |
| 477 | put_pfn(pfn, dma->prot); | 470 | for (pfn = *pfn_base ; pinned ; pfn++, pinned--) |
| 471 | put_pfn(pfn, dma->prot); | ||
| 472 | } | ||
| 478 | 473 | ||
| 479 | return ret; | 474 | return ret; |
| 480 | } | 475 | } |
diff --git a/fs/afs/security.c b/fs/afs/security.c index 1992b0ffa543..81dfedb7879f 100644 --- a/fs/afs/security.c +++ b/fs/afs/security.c | |||
| @@ -372,18 +372,14 @@ int afs_permission(struct inode *inode, int mask) | |||
| 372 | mask, access, S_ISDIR(inode->i_mode) ? "dir" : "file"); | 372 | mask, access, S_ISDIR(inode->i_mode) ? "dir" : "file"); |
| 373 | 373 | ||
| 374 | if (S_ISDIR(inode->i_mode)) { | 374 | if (S_ISDIR(inode->i_mode)) { |
| 375 | if (mask & MAY_EXEC) { | 375 | if (mask & (MAY_EXEC | MAY_READ | MAY_CHDIR)) { |
| 376 | if (!(access & AFS_ACE_LOOKUP)) | 376 | if (!(access & AFS_ACE_LOOKUP)) |
| 377 | goto permission_denied; | 377 | goto permission_denied; |
| 378 | } else if (mask & MAY_READ) { | 378 | } |
| 379 | if (!(access & AFS_ACE_LOOKUP)) | 379 | if (mask & MAY_WRITE) { |
| 380 | goto permission_denied; | ||
| 381 | } else if (mask & MAY_WRITE) { | ||
| 382 | if (!(access & (AFS_ACE_DELETE | /* rmdir, unlink, rename from */ | 380 | if (!(access & (AFS_ACE_DELETE | /* rmdir, unlink, rename from */ |
| 383 | AFS_ACE_INSERT))) /* create, mkdir, symlink, rename to */ | 381 | AFS_ACE_INSERT))) /* create, mkdir, symlink, rename to */ |
| 384 | goto permission_denied; | 382 | goto permission_denied; |
| 385 | } else { | ||
| 386 | BUG(); | ||
| 387 | } | 383 | } |
| 388 | } else { | 384 | } else { |
| 389 | if (!(access & AFS_ACE_LOOKUP)) | 385 | if (!(access & AFS_ACE_LOOKUP)) |
diff --git a/fs/afs/vlclient.c b/fs/afs/vlclient.c index 1ed7e2fd2f35..c3b740813fc7 100644 --- a/fs/afs/vlclient.c +++ b/fs/afs/vlclient.c | |||
| @@ -23,7 +23,7 @@ static int afs_deliver_vl_get_entry_by_name_u(struct afs_call *call) | |||
| 23 | struct afs_uvldbentry__xdr *uvldb; | 23 | struct afs_uvldbentry__xdr *uvldb; |
| 24 | struct afs_vldb_entry *entry; | 24 | struct afs_vldb_entry *entry; |
| 25 | bool new_only = false; | 25 | bool new_only = false; |
| 26 | u32 tmp, nr_servers; | 26 | u32 tmp, nr_servers, vlflags; |
| 27 | int i, ret; | 27 | int i, ret; |
| 28 | 28 | ||
| 29 | _enter(""); | 29 | _enter(""); |
| @@ -55,6 +55,7 @@ static int afs_deliver_vl_get_entry_by_name_u(struct afs_call *call) | |||
| 55 | new_only = true; | 55 | new_only = true; |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | vlflags = ntohl(uvldb->flags); | ||
| 58 | for (i = 0; i < nr_servers; i++) { | 59 | for (i = 0; i < nr_servers; i++) { |
| 59 | struct afs_uuid__xdr *xdr; | 60 | struct afs_uuid__xdr *xdr; |
| 60 | struct afs_uuid *uuid; | 61 | struct afs_uuid *uuid; |
| @@ -64,12 +65,13 @@ static int afs_deliver_vl_get_entry_by_name_u(struct afs_call *call) | |||
| 64 | if (tmp & AFS_VLSF_DONTUSE || | 65 | if (tmp & AFS_VLSF_DONTUSE || |
| 65 | (new_only && !(tmp & AFS_VLSF_NEWREPSITE))) | 66 | (new_only && !(tmp & AFS_VLSF_NEWREPSITE))) |
| 66 | continue; | 67 | continue; |
| 67 | if (tmp & AFS_VLSF_RWVOL) | 68 | if (tmp & AFS_VLSF_RWVOL) { |
| 68 | entry->fs_mask[i] |= AFS_VOL_VTM_RW; | 69 | entry->fs_mask[i] |= AFS_VOL_VTM_RW; |
| 70 | if (vlflags & AFS_VLF_BACKEXISTS) | ||
| 71 | entry->fs_mask[i] |= AFS_VOL_VTM_BAK; | ||
| 72 | } | ||
| 69 | if (tmp & AFS_VLSF_ROVOL) | 73 | if (tmp & AFS_VLSF_ROVOL) |
| 70 | entry->fs_mask[i] |= AFS_VOL_VTM_RO; | 74 | entry->fs_mask[i] |= AFS_VOL_VTM_RO; |
| 71 | if (tmp & AFS_VLSF_BACKVOL) | ||
| 72 | entry->fs_mask[i] |= AFS_VOL_VTM_BAK; | ||
| 73 | if (!entry->fs_mask[i]) | 75 | if (!entry->fs_mask[i]) |
| 74 | continue; | 76 | continue; |
| 75 | 77 | ||
| @@ -89,15 +91,14 @@ static int afs_deliver_vl_get_entry_by_name_u(struct afs_call *call) | |||
| 89 | for (i = 0; i < AFS_MAXTYPES; i++) | 91 | for (i = 0; i < AFS_MAXTYPES; i++) |
| 90 | entry->vid[i] = ntohl(uvldb->volumeId[i]); | 92 | entry->vid[i] = ntohl(uvldb->volumeId[i]); |
| 91 | 93 | ||
| 92 | tmp = ntohl(uvldb->flags); | 94 | if (vlflags & AFS_VLF_RWEXISTS) |
| 93 | if (tmp & AFS_VLF_RWEXISTS) | ||
| 94 | __set_bit(AFS_VLDB_HAS_RW, &entry->flags); | 95 | __set_bit(AFS_VLDB_HAS_RW, &entry->flags); |
| 95 | if (tmp & AFS_VLF_ROEXISTS) | 96 | if (vlflags & AFS_VLF_ROEXISTS) |
| 96 | __set_bit(AFS_VLDB_HAS_RO, &entry->flags); | 97 | __set_bit(AFS_VLDB_HAS_RO, &entry->flags); |
| 97 | if (tmp & AFS_VLF_BACKEXISTS) | 98 | if (vlflags & AFS_VLF_BACKEXISTS) |
| 98 | __set_bit(AFS_VLDB_HAS_BAK, &entry->flags); | 99 | __set_bit(AFS_VLDB_HAS_BAK, &entry->flags); |
| 99 | 100 | ||
| 100 | if (!(tmp & (AFS_VLF_RWEXISTS | AFS_VLF_ROEXISTS | AFS_VLF_BACKEXISTS))) { | 101 | if (!(vlflags & (AFS_VLF_RWEXISTS | AFS_VLF_ROEXISTS | AFS_VLF_BACKEXISTS))) { |
| 101 | entry->error = -ENOMEDIUM; | 102 | entry->error = -ENOMEDIUM; |
| 102 | __set_bit(AFS_VLDB_QUERY_ERROR, &entry->flags); | 103 | __set_bit(AFS_VLDB_QUERY_ERROR, &entry->flags); |
| 103 | } | 104 | } |
diff --git a/fs/cifs/Kconfig b/fs/cifs/Kconfig index d61e2de8d0eb..5f132d59dfc2 100644 --- a/fs/cifs/Kconfig +++ b/fs/cifs/Kconfig | |||
| @@ -197,7 +197,7 @@ config CIFS_SMB311 | |||
| 197 | 197 | ||
| 198 | config CIFS_SMB_DIRECT | 198 | config CIFS_SMB_DIRECT |
| 199 | bool "SMB Direct support (Experimental)" | 199 | bool "SMB Direct support (Experimental)" |
| 200 | depends on CIFS=m && INFINIBAND_ADDR_TRANS || CIFS=y && INFINIBAND_ADDR_TRANS=y | 200 | depends on CIFS=m && INFINIBAND && INFINIBAND_ADDR_TRANS || CIFS=y && INFINIBAND=y && INFINIBAND_ADDR_TRANS=y |
| 201 | help | 201 | help |
| 202 | Enables SMB Direct experimental support for SMB 3.0, 3.02 and 3.1.1. | 202 | Enables SMB Direct experimental support for SMB 3.0, 3.02 and 3.1.1. |
| 203 | SMB Direct allows transferring SMB packets over RDMA. If unsure, | 203 | SMB Direct allows transferring SMB packets over RDMA. If unsure, |
diff --git a/fs/inode.c b/fs/inode.c index 13ceb98c3bd3..3b55391072f3 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
| @@ -178,6 +178,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) | |||
| 178 | mapping->a_ops = &empty_aops; | 178 | mapping->a_ops = &empty_aops; |
| 179 | mapping->host = inode; | 179 | mapping->host = inode; |
| 180 | mapping->flags = 0; | 180 | mapping->flags = 0; |
| 181 | mapping->wb_err = 0; | ||
| 181 | atomic_set(&mapping->i_mmap_writable, 0); | 182 | atomic_set(&mapping->i_mmap_writable, 0); |
| 182 | mapping_set_gfp_mask(mapping, GFP_HIGHUSER_MOVABLE); | 183 | mapping_set_gfp_mask(mapping, GFP_HIGHUSER_MOVABLE); |
| 183 | mapping->private_data = NULL; | 184 | mapping->private_data = NULL; |
diff --git a/include/linux/iio/buffer_impl.h b/include/linux/iio/buffer_impl.h index b9e22b7e2f28..d1171db23742 100644 --- a/include/linux/iio/buffer_impl.h +++ b/include/linux/iio/buffer_impl.h | |||
| @@ -53,7 +53,7 @@ struct iio_buffer_access_funcs { | |||
| 53 | int (*request_update)(struct iio_buffer *buffer); | 53 | int (*request_update)(struct iio_buffer *buffer); |
| 54 | 54 | ||
| 55 | int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd); | 55 | int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd); |
| 56 | int (*set_length)(struct iio_buffer *buffer, int length); | 56 | int (*set_length)(struct iio_buffer *buffer, unsigned int length); |
| 57 | 57 | ||
| 58 | int (*enable)(struct iio_buffer *buffer, struct iio_dev *indio_dev); | 58 | int (*enable)(struct iio_buffer *buffer, struct iio_dev *indio_dev); |
| 59 | int (*disable)(struct iio_buffer *buffer, struct iio_dev *indio_dev); | 59 | int (*disable)(struct iio_buffer *buffer, struct iio_dev *indio_dev); |
| @@ -72,10 +72,10 @@ struct iio_buffer_access_funcs { | |||
| 72 | */ | 72 | */ |
| 73 | struct iio_buffer { | 73 | struct iio_buffer { |
| 74 | /** @length: Number of datums in buffer. */ | 74 | /** @length: Number of datums in buffer. */ |
| 75 | int length; | 75 | unsigned int length; |
| 76 | 76 | ||
| 77 | /** @bytes_per_datum: Size of individual datum including timestamp. */ | 77 | /** @bytes_per_datum: Size of individual datum including timestamp. */ |
| 78 | int bytes_per_datum; | 78 | size_t bytes_per_datum; |
| 79 | 79 | ||
| 80 | /** | 80 | /** |
| 81 | * @access: Buffer access functions associated with the | 81 | * @access: Buffer access functions associated with the |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 414d7210b2ec..bcd93031d042 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
| @@ -893,7 +893,7 @@ int __trace_bputs(unsigned long ip, const char *str) | |||
| 893 | EXPORT_SYMBOL_GPL(__trace_bputs); | 893 | EXPORT_SYMBOL_GPL(__trace_bputs); |
| 894 | 894 | ||
| 895 | #ifdef CONFIG_TRACER_SNAPSHOT | 895 | #ifdef CONFIG_TRACER_SNAPSHOT |
| 896 | static void tracing_snapshot_instance(struct trace_array *tr) | 896 | void tracing_snapshot_instance(struct trace_array *tr) |
| 897 | { | 897 | { |
| 898 | struct tracer *tracer = tr->current_trace; | 898 | struct tracer *tracer = tr->current_trace; |
| 899 | unsigned long flags; | 899 | unsigned long flags; |
| @@ -949,7 +949,7 @@ static int resize_buffer_duplicate_size(struct trace_buffer *trace_buf, | |||
| 949 | struct trace_buffer *size_buf, int cpu_id); | 949 | struct trace_buffer *size_buf, int cpu_id); |
| 950 | static void set_buffer_entries(struct trace_buffer *buf, unsigned long val); | 950 | static void set_buffer_entries(struct trace_buffer *buf, unsigned long val); |
| 951 | 951 | ||
| 952 | static int alloc_snapshot(struct trace_array *tr) | 952 | int tracing_alloc_snapshot_instance(struct trace_array *tr) |
| 953 | { | 953 | { |
| 954 | int ret; | 954 | int ret; |
| 955 | 955 | ||
| @@ -995,7 +995,7 @@ int tracing_alloc_snapshot(void) | |||
| 995 | struct trace_array *tr = &global_trace; | 995 | struct trace_array *tr = &global_trace; |
| 996 | int ret; | 996 | int ret; |
| 997 | 997 | ||
| 998 | ret = alloc_snapshot(tr); | 998 | ret = tracing_alloc_snapshot_instance(tr); |
| 999 | WARN_ON(ret < 0); | 999 | WARN_ON(ret < 0); |
| 1000 | 1000 | ||
| 1001 | return ret; | 1001 | return ret; |
| @@ -5408,7 +5408,7 @@ static int tracing_set_tracer(struct trace_array *tr, const char *buf) | |||
| 5408 | 5408 | ||
| 5409 | #ifdef CONFIG_TRACER_MAX_TRACE | 5409 | #ifdef CONFIG_TRACER_MAX_TRACE |
| 5410 | if (t->use_max_tr && !had_max_tr) { | 5410 | if (t->use_max_tr && !had_max_tr) { |
| 5411 | ret = alloc_snapshot(tr); | 5411 | ret = tracing_alloc_snapshot_instance(tr); |
| 5412 | if (ret < 0) | 5412 | if (ret < 0) |
| 5413 | goto out; | 5413 | goto out; |
| 5414 | } | 5414 | } |
| @@ -6451,7 +6451,7 @@ tracing_snapshot_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
| 6451 | } | 6451 | } |
| 6452 | #endif | 6452 | #endif |
| 6453 | if (!tr->allocated_snapshot) { | 6453 | if (!tr->allocated_snapshot) { |
| 6454 | ret = alloc_snapshot(tr); | 6454 | ret = tracing_alloc_snapshot_instance(tr); |
| 6455 | if (ret < 0) | 6455 | if (ret < 0) |
| 6456 | break; | 6456 | break; |
| 6457 | } | 6457 | } |
| @@ -7179,7 +7179,7 @@ ftrace_trace_snapshot_callback(struct trace_array *tr, struct ftrace_hash *hash, | |||
| 7179 | return ret; | 7179 | return ret; |
| 7180 | 7180 | ||
| 7181 | out_reg: | 7181 | out_reg: |
| 7182 | ret = alloc_snapshot(tr); | 7182 | ret = tracing_alloc_snapshot_instance(tr); |
| 7183 | if (ret < 0) | 7183 | if (ret < 0) |
| 7184 | goto out; | 7184 | goto out; |
| 7185 | 7185 | ||
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 6fb46a06c9dc..507954b4e058 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
| @@ -1817,6 +1817,17 @@ static inline void __init trace_event_init(void) { } | |||
| 1817 | static inline void trace_event_eval_update(struct trace_eval_map **map, int len) { } | 1817 | static inline void trace_event_eval_update(struct trace_eval_map **map, int len) { } |
| 1818 | #endif | 1818 | #endif |
| 1819 | 1819 | ||
| 1820 | #ifdef CONFIG_TRACER_SNAPSHOT | ||
| 1821 | void tracing_snapshot_instance(struct trace_array *tr); | ||
| 1822 | int tracing_alloc_snapshot_instance(struct trace_array *tr); | ||
| 1823 | #else | ||
| 1824 | static inline void tracing_snapshot_instance(struct trace_array *tr) { } | ||
| 1825 | static inline int tracing_alloc_snapshot_instance(struct trace_array *tr) | ||
| 1826 | { | ||
| 1827 | return 0; | ||
| 1828 | } | ||
| 1829 | #endif | ||
| 1830 | |||
| 1820 | extern struct trace_iterator *tracepoint_print_iter; | 1831 | extern struct trace_iterator *tracepoint_print_iter; |
| 1821 | 1832 | ||
| 1822 | #endif /* _LINUX_KERNEL_TRACE_H */ | 1833 | #endif /* _LINUX_KERNEL_TRACE_H */ |
diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c index d251cabcf69a..8b5bdcf64871 100644 --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c | |||
| @@ -483,9 +483,10 @@ clear_event_triggers(struct trace_array *tr) | |||
| 483 | struct trace_event_file *file; | 483 | struct trace_event_file *file; |
| 484 | 484 | ||
| 485 | list_for_each_entry(file, &tr->events, list) { | 485 | list_for_each_entry(file, &tr->events, list) { |
| 486 | struct event_trigger_data *data; | 486 | struct event_trigger_data *data, *n; |
| 487 | list_for_each_entry_rcu(data, &file->triggers, list) { | 487 | list_for_each_entry_safe(data, n, &file->triggers, list) { |
| 488 | trace_event_trigger_enable_disable(file, 0); | 488 | trace_event_trigger_enable_disable(file, 0); |
| 489 | list_del_rcu(&data->list); | ||
| 489 | if (data->ops->free) | 490 | if (data->ops->free) |
| 490 | data->ops->free(data->ops, data); | 491 | data->ops->free(data->ops, data); |
| 491 | } | 492 | } |
| @@ -642,6 +643,7 @@ event_trigger_callback(struct event_command *cmd_ops, | |||
| 642 | trigger_data->count = -1; | 643 | trigger_data->count = -1; |
| 643 | trigger_data->ops = trigger_ops; | 644 | trigger_data->ops = trigger_ops; |
| 644 | trigger_data->cmd_ops = cmd_ops; | 645 | trigger_data->cmd_ops = cmd_ops; |
| 646 | trigger_data->private_data = file; | ||
| 645 | INIT_LIST_HEAD(&trigger_data->list); | 647 | INIT_LIST_HEAD(&trigger_data->list); |
| 646 | INIT_LIST_HEAD(&trigger_data->named_list); | 648 | INIT_LIST_HEAD(&trigger_data->named_list); |
| 647 | 649 | ||
| @@ -1053,7 +1055,12 @@ static void | |||
| 1053 | snapshot_trigger(struct event_trigger_data *data, void *rec, | 1055 | snapshot_trigger(struct event_trigger_data *data, void *rec, |
| 1054 | struct ring_buffer_event *event) | 1056 | struct ring_buffer_event *event) |
| 1055 | { | 1057 | { |
| 1056 | tracing_snapshot(); | 1058 | struct trace_event_file *file = data->private_data; |
| 1059 | |||
| 1060 | if (file) | ||
| 1061 | tracing_snapshot_instance(file->tr); | ||
| 1062 | else | ||
| 1063 | tracing_snapshot(); | ||
| 1057 | } | 1064 | } |
| 1058 | 1065 | ||
| 1059 | static void | 1066 | static void |
| @@ -1076,7 +1083,7 @@ register_snapshot_trigger(char *glob, struct event_trigger_ops *ops, | |||
| 1076 | { | 1083 | { |
| 1077 | int ret = register_trigger(glob, ops, data, file); | 1084 | int ret = register_trigger(glob, ops, data, file); |
| 1078 | 1085 | ||
| 1079 | if (ret > 0 && tracing_alloc_snapshot() != 0) { | 1086 | if (ret > 0 && tracing_alloc_snapshot_instance(file->tr) != 0) { |
| 1080 | unregister_trigger(glob, ops, data, file); | 1087 | unregister_trigger(glob, ops, data, file); |
| 1081 | ret = 0; | 1088 | ret = 0; |
| 1082 | } | 1089 | } |
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index a3a1815f8e11..b9f3dbd885bd 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
| @@ -2431,7 +2431,7 @@ static void __split_huge_page(struct page *page, struct list_head *list, | |||
| 2431 | __split_huge_page_tail(head, i, lruvec, list); | 2431 | __split_huge_page_tail(head, i, lruvec, list); |
| 2432 | /* Some pages can be beyond i_size: drop them from page cache */ | 2432 | /* Some pages can be beyond i_size: drop them from page cache */ |
| 2433 | if (head[i].index >= end) { | 2433 | if (head[i].index >= end) { |
| 2434 | __ClearPageDirty(head + i); | 2434 | ClearPageDirty(head + i); |
| 2435 | __delete_from_page_cache(head + i, NULL); | 2435 | __delete_from_page_cache(head + i, NULL); |
| 2436 | if (IS_ENABLED(CONFIG_SHMEM) && PageSwapBacked(head)) | 2436 | if (IS_ENABLED(CONFIG_SHMEM) && PageSwapBacked(head)) |
| 2437 | shmem_uncharge(head->mapping->host, 1); | 2437 | shmem_uncharge(head->mapping->host, 1); |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 9b697323a88c..9270a4370d54 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
| @@ -1418,7 +1418,7 @@ int __isolate_lru_page(struct page *page, isolate_mode_t mode) | |||
| 1418 | return ret; | 1418 | return ret; |
| 1419 | 1419 | ||
| 1420 | mapping = page_mapping(page); | 1420 | mapping = page_mapping(page); |
| 1421 | migrate_dirty = mapping && mapping->a_ops->migratepage; | 1421 | migrate_dirty = !mapping || mapping->a_ops->migratepage; |
| 1422 | unlock_page(page); | 1422 | unlock_page(page); |
| 1423 | if (!migrate_dirty) | 1423 | if (!migrate_dirty) |
| 1424 | return ret; | 1424 | return ret; |
diff --git a/net/9p/Kconfig b/net/9p/Kconfig index 46c39f7da444..e6014e0e51f7 100644 --- a/net/9p/Kconfig +++ b/net/9p/Kconfig | |||
| @@ -32,7 +32,7 @@ config NET_9P_XEN | |||
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | config NET_9P_RDMA | 34 | config NET_9P_RDMA |
| 35 | depends on INET && INFINIBAND_ADDR_TRANS | 35 | depends on INET && INFINIBAND && INFINIBAND_ADDR_TRANS |
| 36 | tristate "9P RDMA Transport (Experimental)" | 36 | tristate "9P RDMA Transport (Experimental)" |
| 37 | help | 37 | help |
| 38 | This builds support for an RDMA transport. | 38 | This builds support for an RDMA transport. |
diff --git a/net/rds/Kconfig b/net/rds/Kconfig index 1a31502ee7db..bffde4b46c5d 100644 --- a/net/rds/Kconfig +++ b/net/rds/Kconfig | |||
| @@ -8,7 +8,7 @@ config RDS | |||
| 8 | 8 | ||
| 9 | config RDS_RDMA | 9 | config RDS_RDMA |
| 10 | tristate "RDS over Infiniband" | 10 | tristate "RDS over Infiniband" |
| 11 | depends on RDS && INFINIBAND_ADDR_TRANS | 11 | depends on RDS && INFINIBAND && INFINIBAND_ADDR_TRANS |
| 12 | ---help--- | 12 | ---help--- |
| 13 | Allow RDS to use Infiniband as a transport. | 13 | Allow RDS to use Infiniband as a transport. |
| 14 | This transport supports RDMA operations. | 14 | This transport supports RDMA operations. |
diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig index 6358e5271070..ac09ca803296 100644 --- a/net/sunrpc/Kconfig +++ b/net/sunrpc/Kconfig | |||
| @@ -50,7 +50,7 @@ config SUNRPC_DEBUG | |||
| 50 | 50 | ||
| 51 | config SUNRPC_XPRT_RDMA | 51 | config SUNRPC_XPRT_RDMA |
| 52 | tristate "RPC-over-RDMA transport" | 52 | tristate "RPC-over-RDMA transport" |
| 53 | depends on SUNRPC && INFINIBAND_ADDR_TRANS | 53 | depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS |
| 54 | default SUNRPC && INFINIBAND | 54 | default SUNRPC && INFINIBAND |
| 55 | select SG_POOL | 55 | select SG_POOL |
| 56 | help | 56 | help |
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 8057e19dc15f..3ce225e3f142 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
| @@ -1494,7 +1494,7 @@ static int security_context_to_sid_core(struct selinux_state *state, | |||
| 1494 | scontext_len, &context, def_sid); | 1494 | scontext_len, &context, def_sid); |
| 1495 | if (rc == -EINVAL && force) { | 1495 | if (rc == -EINVAL && force) { |
| 1496 | context.str = str; | 1496 | context.str = str; |
| 1497 | context.len = scontext_len; | 1497 | context.len = strlen(str) + 1; |
| 1498 | str = NULL; | 1498 | str = NULL; |
| 1499 | } else if (rc) | 1499 | } else if (rc) |
| 1500 | goto out_unlock; | 1500 | goto out_unlock; |
