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

Merge 3.14-rc5 into char-misc-next

We want these fixes in here as well.

+1891 -1153
+10 -6
Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
··· 1 1 * Freescale Smart Direct Memory Access (SDMA) Controller for i.MX 2 2 3 3 Required properties: 4 - - compatible : Should be "fsl,imx31-sdma", "fsl,imx31-to1-sdma", 5 - "fsl,imx31-to2-sdma", "fsl,imx35-sdma", "fsl,imx35-to1-sdma", 6 - "fsl,imx35-to2-sdma", "fsl,imx51-sdma", "fsl,imx53-sdma" or 7 - "fsl,imx6q-sdma". The -to variants should be preferred since they 8 - allow to determnine the correct ROM script addresses needed for 9 - the driver to work without additional firmware. 4 + - compatible : Should be one of 5 + "fsl,imx25-sdma" 6 + "fsl,imx31-sdma", "fsl,imx31-to1-sdma", "fsl,imx31-to2-sdma" 7 + "fsl,imx35-sdma", "fsl,imx35-to1-sdma", "fsl,imx35-to2-sdma" 8 + "fsl,imx51-sdma" 9 + "fsl,imx53-sdma" 10 + "fsl,imx6q-sdma" 11 + The -to variants should be preferred since they allow to determnine the 12 + correct ROM script addresses needed for the driver to work without additional 13 + firmware. 10 14 - reg : Should contain SDMA registers location and length 11 15 - interrupts : Should contain SDMA interrupt 12 16 - #dma-cells : Must be <3>.
+20 -5
MAINTAINERS
··· 538 538 ALTERA UART/JTAG UART SERIAL DRIVERS 539 539 M: Tobias Klauser <tklauser@distanz.ch> 540 540 L: linux-serial@vger.kernel.org 541 - L: nios2-dev@sopc.et.ntust.edu.tw (moderated for non-subscribers) 541 + L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers) 542 542 S: Maintained 543 543 F: drivers/tty/serial/altera_uart.c 544 544 F: drivers/tty/serial/altera_jtaguart.c ··· 2611 2611 M: Oliver Neukum <oliver@neukum.org> 2612 2612 M: Ali Akcaagac <aliakc@web.de> 2613 2613 M: Jamie Lenehan <lenehan@twibble.org> 2614 - W: http://twibble.org/dist/dc395x/ 2615 2614 L: dc395x@twibble.org 2616 - L: http://lists.twibble.org/mailman/listinfo/dc395x/ 2615 + W: http://twibble.org/dist/dc395x/ 2616 + W: http://lists.twibble.org/mailman/listinfo/dc395x/ 2617 2617 S: Maintained 2618 2618 F: Documentation/scsi/dc395x.txt 2619 2619 F: drivers/scsi/dc395x.* ··· 2848 2848 DRM DRIVERS 2849 2849 M: David Airlie <airlied@linux.ie> 2850 2850 L: dri-devel@lists.freedesktop.org 2851 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git 2851 + T: git git://people.freedesktop.org/~airlied/linux 2852 2852 S: Maintained 2853 2853 F: drivers/gpu/drm/ 2854 2854 F: include/drm/ 2855 2855 F: include/uapi/drm/ 2856 + 2857 + RADEON DRM DRIVERS 2858 + M: Alex Deucher <alexander.deucher@amd.com> 2859 + M: Christian König <christian.koenig@amd.com> 2860 + L: dri-devel@lists.freedesktop.org 2861 + T: git git://people.freedesktop.org/~agd5f/linux 2862 + S: Supported 2863 + F: drivers/gpu/drm/radeon/ 2864 + F: include/drm/radeon* 2865 + F: include/uapi/drm/radeon* 2856 2866 2857 2867 INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets) 2858 2868 M: Daniel Vetter <daniel.vetter@ffwll.ch> ··· 5510 5500 W: http://www.kernel.org/doc/man-pages 5511 5501 L: linux-man@vger.kernel.org 5512 5502 S: Maintained 5503 + 5504 + MARVELL ARMADA DRM SUPPORT 5505 + M: Russell King <rmk+kernel@arm.linux.org.uk> 5506 + S: Maintained 5507 + F: drivers/gpu/drm/armada/ 5513 5508 5514 5509 MARVELL GIGABIT ETHERNET DRIVERS (skge/sky2) 5515 5510 M: Mirko Lindner <mlindner@marvell.com> ··· 8464 8449 M: Nicholas A. Bellinger <nab@linux-iscsi.org> 8465 8450 L: linux-scsi@vger.kernel.org 8466 8451 L: target-devel@vger.kernel.org 8467 - L: http://groups.google.com/group/linux-iscsi-target-dev 8468 8452 W: http://www.linux-iscsi.org 8453 + W: http://groups.google.com/group/linux-iscsi-target-dev 8469 8454 T: git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master 8470 8455 S: Supported 8471 8456 F: drivers/target/
+6 -4
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 14 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc4 4 + EXTRAVERSION = -rc5 5 5 NAME = Shuffling Zombie Juror 6 6 7 7 # *DOCUMENTATION* ··· 605 605 ifdef CONFIG_CC_STACKPROTECTOR_REGULAR 606 606 stackp-flag := -fstack-protector 607 607 ifeq ($(call cc-option, $(stackp-flag)),) 608 - $(warning Cannot use CONFIG_CC_STACKPROTECTOR: \ 609 - -fstack-protector not supported by compiler)) 608 + $(warning Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: \ 609 + -fstack-protector not supported by compiler) 610 610 endif 611 - else ifdef CONFIG_CC_STACKPROTECTOR_STRONG 611 + else 612 + ifdef CONFIG_CC_STACKPROTECTOR_STRONG 612 613 stackp-flag := -fstack-protector-strong 613 614 ifeq ($(call cc-option, $(stackp-flag)),) 614 615 $(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \ ··· 618 617 else 619 618 # Force off for distro compilers that enable stack protector by default. 620 619 stackp-flag := $(call cc-option, -fno-stack-protector) 620 + endif 621 621 endif 622 622 KBUILD_CFLAGS += $(stackp-flag) 623 623
+2 -1
arch/arm/kvm/arm.c
··· 878 878 unsigned long cmd, 879 879 void *v) 880 880 { 881 - if (cmd == CPU_PM_EXIT) { 881 + if (cmd == CPU_PM_EXIT && 882 + __hyp_get_vectors() == hyp_default_vectors) { 882 883 cpu_init_hyp_mode(NULL); 883 884 return NOTIFY_OK; 884 885 }
+10 -1
arch/arm/kvm/interrupts.S
··· 220 220 * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are 221 221 * passed in r0 and r1. 222 222 * 223 + * A function pointer with a value of 0xffffffff has a special meaning, 224 + * and is used to implement __hyp_get_vectors in the same way as in 225 + * arch/arm/kernel/hyp_stub.S. 226 + * 223 227 * The calling convention follows the standard AAPCS: 224 228 * r0 - r3: caller save 225 229 * r12: caller save ··· 367 363 host_switch_to_hyp: 368 364 pop {r0, r1, r2} 369 365 366 + /* Check for __hyp_get_vectors */ 367 + cmp r0, #-1 368 + mrceq p15, 4, r0, c12, c0, 0 @ get HVBAR 369 + beq 1f 370 + 370 371 push {lr} 371 372 mrs lr, SPSR 372 373 push {lr} ··· 387 378 pop {lr} 388 379 msr SPSR_csxf, lr 389 380 pop {lr} 390 - eret 381 + 1: eret 391 382 392 383 guest_trap: 393 384 load_vcpu @ Load VCPU pointer to r0
+8
arch/arm64/include/asm/percpu.h
··· 16 16 #ifndef __ASM_PERCPU_H 17 17 #define __ASM_PERCPU_H 18 18 19 + #ifdef CONFIG_SMP 20 + 19 21 static inline void set_my_cpu_offset(unsigned long off) 20 22 { 21 23 asm volatile("msr tpidr_el1, %0" :: "r" (off) : "memory"); ··· 37 35 return off; 38 36 } 39 37 #define __my_cpu_offset __my_cpu_offset() 38 + 39 + #else /* !CONFIG_SMP */ 40 + 41 + #define set_my_cpu_offset(x) do { } while (0) 42 + 43 + #endif /* CONFIG_SMP */ 40 44 41 45 #include <asm-generic/percpu.h> 42 46
+5 -5
arch/arm64/include/asm/pgtable.h
··· 136 136 /* 137 137 * The following only work if pte_present(). Undefined behaviour otherwise. 138 138 */ 139 - #define pte_present(pte) (pte_val(pte) & (PTE_VALID | PTE_PROT_NONE)) 140 - #define pte_dirty(pte) (pte_val(pte) & PTE_DIRTY) 141 - #define pte_young(pte) (pte_val(pte) & PTE_AF) 142 - #define pte_special(pte) (pte_val(pte) & PTE_SPECIAL) 143 - #define pte_write(pte) (pte_val(pte) & PTE_WRITE) 139 + #define pte_present(pte) (!!(pte_val(pte) & (PTE_VALID | PTE_PROT_NONE))) 140 + #define pte_dirty(pte) (!!(pte_val(pte) & PTE_DIRTY)) 141 + #define pte_young(pte) (!!(pte_val(pte) & PTE_AF)) 142 + #define pte_special(pte) (!!(pte_val(pte) & PTE_SPECIAL)) 143 + #define pte_write(pte) (!!(pte_val(pte) & PTE_WRITE)) 144 144 #define pte_exec(pte) (!(pte_val(pte) & PTE_UXN)) 145 145 146 146 #define pte_valid_user(pte) \
+5 -1
arch/arm64/kernel/stacktrace.c
··· 48 48 49 49 frame->sp = fp + 0x10; 50 50 frame->fp = *(unsigned long *)(fp); 51 - frame->pc = *(unsigned long *)(fp + 8); 51 + /* 52 + * -4 here because we care about the PC at time of bl, 53 + * not where the return will go. 54 + */ 55 + frame->pc = *(unsigned long *)(fp + 8) - 4; 52 56 53 57 return 0; 54 58 }
+25 -2
arch/arm64/kvm/hyp.S
··· 694 694 695 695 .align 2 696 696 697 + /* 698 + * u64 kvm_call_hyp(void *hypfn, ...); 699 + * 700 + * This is not really a variadic function in the classic C-way and care must 701 + * be taken when calling this to ensure parameters are passed in registers 702 + * only, since the stack will change between the caller and the callee. 703 + * 704 + * Call the function with the first argument containing a pointer to the 705 + * function you wish to call in Hyp mode, and subsequent arguments will be 706 + * passed as x0, x1, and x2 (a maximum of 3 arguments in addition to the 707 + * function pointer can be passed). The function being called must be mapped 708 + * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are 709 + * passed in r0 and r1. 710 + * 711 + * A function pointer with a value of 0 has a special meaning, and is 712 + * used to implement __hyp_get_vectors in the same way as in 713 + * arch/arm64/kernel/hyp_stub.S. 714 + */ 697 715 ENTRY(kvm_call_hyp) 698 716 hvc #0 699 717 ret ··· 755 737 pop x2, x3 756 738 pop x0, x1 757 739 758 - push lr, xzr 740 + /* Check for __hyp_get_vectors */ 741 + cbnz x0, 1f 742 + mrs x0, vbar_el2 743 + b 2f 744 + 745 + 1: push lr, xzr 759 746 760 747 /* 761 748 * Compute the function address in EL2, and shuffle the parameters. ··· 773 750 blr lr 774 751 775 752 pop lr, xzr 776 - eret 753 + 2: eret 777 754 778 755 el1_trap: 779 756 /*
+3 -3
arch/m68k/include/asm/Kbuild
··· 1 - 1 + generic-y += barrier.h 2 2 generic-y += bitsperlong.h 3 3 generic-y += clkdev.h 4 4 generic-y += cputime.h ··· 6 6 generic-y += emergency-restart.h 7 7 generic-y += errno.h 8 8 generic-y += exec.h 9 + generic-y += hash.h 9 10 generic-y += hw_irq.h 10 11 generic-y += ioctl.h 11 12 generic-y += ipcbuf.h ··· 19 18 generic-y += mman.h 20 19 generic-y += mutex.h 21 20 generic-y += percpu.h 21 + generic-y += preempt.h 22 22 generic-y += resource.h 23 23 generic-y += scatterlist.h 24 24 generic-y += sections.h ··· 33 31 generic-y += types.h 34 32 generic-y += word-at-a-time.h 35 33 generic-y += xor.h 36 - generic-y += preempt.h 37 - generic-y += hash.h
-8
arch/m68k/include/asm/barrier.h
··· 1 - #ifndef _M68K_BARRIER_H 2 - #define _M68K_BARRIER_H 3 - 4 - #define nop() do { asm volatile ("nop"); barrier(); } while (0) 5 - 6 - #include <asm-generic/barrier.h> 7 - 8 - #endif /* _M68K_BARRIER_H */
+1 -1
arch/m68k/include/asm/unistd.h
··· 4 4 #include <uapi/asm/unistd.h> 5 5 6 6 7 - #define NR_syscalls 349 7 + #define NR_syscalls 351 8 8 9 9 #define __ARCH_WANT_OLD_READDIR 10 10 #define __ARCH_WANT_OLD_STAT
+2
arch/m68k/include/uapi/asm/unistd.h
··· 354 354 #define __NR_process_vm_writev 346 355 355 #define __NR_kcmp 347 356 356 #define __NR_finit_module 348 357 + #define __NR_sched_setattr 349 358 + #define __NR_sched_getattr 350 357 359 358 360 #endif /* _UAPI_ASM_M68K_UNISTD_H_ */
+2
arch/m68k/kernel/syscalltable.S
··· 369 369 .long sys_process_vm_writev 370 370 .long sys_kcmp 371 371 .long sys_finit_module 372 + .long sys_sched_setattr 373 + .long sys_sched_getattr /* 350 */ 372 374
+3 -2
arch/powerpc/include/asm/compat.h
··· 200 200 201 201 /* 202 202 * We can't access below the stack pointer in the 32bit ABI and 203 - * can access 288 bytes in the 64bit ABI 203 + * can access 288 bytes in the 64bit big-endian ABI, 204 + * or 512 bytes with the new ELFv2 little-endian ABI. 204 205 */ 205 206 if (!is_32bit_task()) 206 - usp -= 288; 207 + usp -= USER_REDZONE_SIZE; 207 208 208 209 return (void __user *) (usp - len); 209 210 }
+2 -2
arch/powerpc/include/asm/opal.h
··· 816 816 int64_t opal_pci_poll(uint64_t phb_id); 817 817 int64_t opal_return_cpu(void); 818 818 819 - int64_t opal_xscom_read(uint32_t gcid, uint32_t pcb_addr, __be64 *val); 820 - int64_t opal_xscom_write(uint32_t gcid, uint32_t pcb_addr, uint64_t val); 819 + int64_t opal_xscom_read(uint32_t gcid, uint64_t pcb_addr, __be64 *val); 820 + int64_t opal_xscom_write(uint32_t gcid, uint64_t pcb_addr, uint64_t val); 821 821 822 822 int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type, 823 823 uint32_t addr, uint32_t data, uint32_t sz);
+15 -1
arch/powerpc/include/asm/ptrace.h
··· 28 28 29 29 #ifdef __powerpc64__ 30 30 31 + /* 32 + * Size of redzone that userspace is allowed to use below the stack 33 + * pointer. This is 288 in the 64-bit big-endian ELF ABI, and 512 in 34 + * the new ELFv2 little-endian ABI, so we allow the larger amount. 35 + * 36 + * For kernel code we allow a 288-byte redzone, in order to conserve 37 + * kernel stack space; gcc currently only uses 288 bytes, and will 38 + * hopefully allow explicit control of the redzone size in future. 39 + */ 40 + #define USER_REDZONE_SIZE 512 41 + #define KERNEL_REDZONE_SIZE 288 42 + 31 43 #define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */ 32 44 #define STACK_FRAME_LR_SAVE 2 /* Location of LR in stack frame */ 33 45 #define STACK_FRAME_REGS_MARKER ASM_CONST(0x7265677368657265) 34 46 #define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + \ 35 - STACK_FRAME_OVERHEAD + 288) 47 + STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE) 36 48 #define STACK_FRAME_MARKER 12 37 49 38 50 /* Size of dummy stack frame allocated when calling signal handler. */ ··· 53 41 54 42 #else /* __powerpc64__ */ 55 43 44 + #define USER_REDZONE_SIZE 0 45 + #define KERNEL_REDZONE_SIZE 0 56 46 #define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */ 57 47 #define STACK_FRAME_LR_SAVE 1 /* Location of LR in stack frame */ 58 48 #define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773)
+5 -3
arch/powerpc/kernel/crash_dump.c
··· 98 98 size_t csize, unsigned long offset, int userbuf) 99 99 { 100 100 void *vaddr; 101 + phys_addr_t paddr; 101 102 102 103 if (!csize) 103 104 return 0; 104 105 105 106 csize = min_t(size_t, csize, PAGE_SIZE); 107 + paddr = pfn << PAGE_SHIFT; 106 108 107 - if ((min_low_pfn < pfn) && (pfn < max_pfn)) { 108 - vaddr = __va(pfn << PAGE_SHIFT); 109 + if (memblock_is_region_memory(paddr, csize)) { 110 + vaddr = __va(paddr); 109 111 csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); 110 112 } else { 111 - vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0); 113 + vaddr = __ioremap(paddr, PAGE_SIZE, 0); 112 114 csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); 113 115 iounmap(vaddr); 114 116 }
+1
arch/powerpc/kernel/ftrace.c
··· 74 74 */ 75 75 static int test_24bit_addr(unsigned long ip, unsigned long addr) 76 76 { 77 + addr = ppc_function_entry((void *)addr); 77 78 78 79 /* use the create_branch to verify that this offset can be branched */ 79 80 return create_branch((unsigned int *)ip, addr, 0);
+2 -2
arch/powerpc/kernel/signal_64.c
··· 65 65 struct siginfo __user *pinfo; 66 66 void __user *puc; 67 67 struct siginfo info; 68 - /* 64 bit ABI allows for 288 bytes below sp before decrementing it. */ 69 - char abigap[288]; 68 + /* New 64 bit little-endian ABI allows redzone of 512 bytes below sp */ 69 + char abigap[USER_REDZONE_SIZE]; 70 70 } __attribute__ ((aligned (16))); 71 71 72 72 static const char fmt32[] = KERN_INFO \
+43 -53
arch/powerpc/platforms/powernv/eeh-ioda.c
··· 114 114 ioda_eeh_inbB_dbgfs_set, "0x%llx\n"); 115 115 #endif /* CONFIG_DEBUG_FS */ 116 116 117 + 117 118 /** 118 119 * ioda_eeh_post_init - Chip dependent post initialization 119 120 * @hose: PCI controller ··· 222 221 return ret; 223 222 } 224 223 224 + static void ioda_eeh_phb_diag(struct pci_controller *hose) 225 + { 226 + struct pnv_phb *phb = hose->private_data; 227 + long rc; 228 + 229 + rc = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag.blob, 230 + PNV_PCI_DIAG_BUF_SIZE); 231 + if (rc != OPAL_SUCCESS) { 232 + pr_warning("%s: Failed to get diag-data for PHB#%x (%ld)\n", 233 + __func__, hose->global_number, rc); 234 + return; 235 + } 236 + 237 + pnv_pci_dump_phb_diag_data(hose, phb->diag.blob); 238 + } 239 + 225 240 /** 226 241 * ioda_eeh_get_state - Retrieve the state of PE 227 242 * @pe: EEH PE ··· 289 272 result |= EEH_STATE_DMA_ACTIVE; 290 273 result |= EEH_STATE_MMIO_ENABLED; 291 274 result |= EEH_STATE_DMA_ENABLED; 275 + } else if (!(pe->state & EEH_PE_ISOLATED)) { 276 + eeh_pe_state_mark(pe, EEH_PE_ISOLATED); 277 + ioda_eeh_phb_diag(hose); 292 278 } 293 279 294 280 return result; ··· 333 313 pr_warning("%s: Unexpected EEH status 0x%x " 334 314 "on PHB#%x-PE#%x\n", 335 315 __func__, fstate, hose->global_number, pe_no); 316 + } 317 + 318 + /* Dump PHB diag-data for frozen PE */ 319 + if (result != EEH_STATE_NOT_SUPPORT && 320 + (result & (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE)) != 321 + (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE) && 322 + !(pe->state & EEH_PE_ISOLATED)) { 323 + eeh_pe_state_mark(pe, EEH_PE_ISOLATED); 324 + ioda_eeh_phb_diag(hose); 336 325 } 337 326 338 327 return result; ··· 559 530 } 560 531 561 532 /** 562 - * ioda_eeh_get_log - Retrieve error log 563 - * @pe: EEH PE 564 - * @severity: Severity level of the log 565 - * @drv_log: buffer to store the log 566 - * @len: space of the log buffer 567 - * 568 - * The function is used to retrieve error log from P7IOC. 569 - */ 570 - static int ioda_eeh_get_log(struct eeh_pe *pe, int severity, 571 - char *drv_log, unsigned long len) 572 - { 573 - s64 ret; 574 - unsigned long flags; 575 - struct pci_controller *hose = pe->phb; 576 - struct pnv_phb *phb = hose->private_data; 577 - 578 - spin_lock_irqsave(&phb->lock, flags); 579 - 580 - ret = opal_pci_get_phb_diag_data2(phb->opal_id, 581 - phb->diag.blob, PNV_PCI_DIAG_BUF_SIZE); 582 - if (ret) { 583 - spin_unlock_irqrestore(&phb->lock, flags); 584 - pr_warning("%s: Can't get log for PHB#%x-PE#%x (%lld)\n", 585 - __func__, hose->global_number, pe->addr, ret); 586 - return -EIO; 587 - } 588 - 589 - /* The PHB diag-data is always indicative */ 590 - pnv_pci_dump_phb_diag_data(hose, phb->diag.blob); 591 - 592 - spin_unlock_irqrestore(&phb->lock, flags); 593 - 594 - return 0; 595 - } 596 - 597 - /** 598 533 * ioda_eeh_configure_bridge - Configure the PCI bridges for the indicated PE 599 534 * @pe: EEH PE 600 535 * ··· 637 644 pr_warning("%s: Invalid type of HUB#%llx diag-data (%d)\n", 638 645 __func__, phb->hub_id, data->type); 639 646 } 640 - } 641 - 642 - static void ioda_eeh_phb_diag(struct pci_controller *hose) 643 - { 644 - struct pnv_phb *phb = hose->private_data; 645 - long rc; 646 - 647 - rc = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag.blob, 648 - PNV_PCI_DIAG_BUF_SIZE); 649 - if (rc != OPAL_SUCCESS) { 650 - pr_warning("%s: Failed to get diag-data for PHB#%x (%ld)\n", 651 - __func__, hose->global_number, rc); 652 - return; 653 - } 654 - 655 - pnv_pci_dump_phb_diag_data(hose, phb->diag.blob); 656 647 } 657 648 658 649 static int ioda_eeh_get_phb_pe(struct pci_controller *hose, ··· 812 835 } 813 836 814 837 /* 838 + * EEH core will try recover from fenced PHB or 839 + * frozen PE. In the time for frozen PE, EEH core 840 + * enable IO path for that before collecting logs, 841 + * but it ruins the site. So we have to dump the 842 + * log in advance here. 843 + */ 844 + if ((ret == EEH_NEXT_ERR_FROZEN_PE || 845 + ret == EEH_NEXT_ERR_FENCED_PHB) && 846 + !((*pe)->state & EEH_PE_ISOLATED)) { 847 + eeh_pe_state_mark(*pe, EEH_PE_ISOLATED); 848 + ioda_eeh_phb_diag(hose); 849 + } 850 + 851 + /* 815 852 * If we have no errors on the specific PHB or only 816 853 * informative error there, we continue poking it. 817 854 * Otherwise, we need actions to be taken by upper ··· 843 852 .set_option = ioda_eeh_set_option, 844 853 .get_state = ioda_eeh_get_state, 845 854 .reset = ioda_eeh_reset, 846 - .get_log = ioda_eeh_get_log, 847 855 .configure_bridge = ioda_eeh_configure_bridge, 848 856 .next_error = ioda_eeh_next_error 849 857 };
+12 -9
arch/powerpc/platforms/powernv/opal-xscom.c
··· 71 71 } 72 72 } 73 73 74 - static u64 opal_scom_unmangle(u64 reg) 74 + static u64 opal_scom_unmangle(u64 addr) 75 75 { 76 76 /* 77 77 * XSCOM indirect addresses have the top bit set. Additionally 78 - * the reset of the top 3 nibbles is always 0. 78 + * the rest of the top 3 nibbles is always 0. 79 79 * 80 80 * Because the debugfs interface uses signed offsets and shifts 81 81 * the address left by 3, we basically cannot use the top 4 bits ··· 86 86 * conversion here. To leave room for further xscom address 87 87 * expansion, we only clear out the top byte 88 88 * 89 + * For in-kernel use, we also support the real indirect bit, so 90 + * we test for any of the top 5 bits 91 + * 89 92 */ 90 - if (reg & (1ull << 59)) 91 - reg = (reg & ~(0xffull << 56)) | (1ull << 63); 92 - return reg; 93 + if (addr & (0x1full << 59)) 94 + addr = (addr & ~(0xffull << 56)) | (1ull << 63); 95 + return addr; 93 96 } 94 97 95 98 static int opal_scom_read(scom_map_t map, u64 reg, u64 *value) ··· 101 98 int64_t rc; 102 99 __be64 v; 103 100 104 - reg = opal_scom_unmangle(reg); 105 - rc = opal_xscom_read(m->chip, m->addr + reg, (__be64 *)__pa(&v)); 101 + reg = opal_scom_unmangle(m->addr + reg); 102 + rc = opal_xscom_read(m->chip, reg, (__be64 *)__pa(&v)); 106 103 *value = be64_to_cpu(v); 107 104 return opal_xscom_err_xlate(rc); 108 105 } ··· 112 109 struct opal_scom_map *m = map; 113 110 int64_t rc; 114 111 115 - reg = opal_scom_unmangle(reg); 116 - rc = opal_xscom_write(m->chip, m->addr + reg, value); 112 + reg = opal_scom_unmangle(m->addr + reg); 113 + rc = opal_xscom_write(m->chip, reg, value); 117 114 return opal_xscom_err_xlate(rc); 118 115 } 119 116
+125 -95
arch/powerpc/platforms/powernv/pci.c
··· 134 134 pr_info("P7IOC PHB#%d Diag-data (Version: %d)\n\n", 135 135 hose->global_number, common->version); 136 136 137 - pr_info(" brdgCtl: %08x\n", data->brdgCtl); 138 - 139 - pr_info(" portStatusReg: %08x\n", data->portStatusReg); 140 - pr_info(" rootCmplxStatus: %08x\n", data->rootCmplxStatus); 141 - pr_info(" busAgentStatus: %08x\n", data->busAgentStatus); 142 - 143 - pr_info(" deviceStatus: %08x\n", data->deviceStatus); 144 - pr_info(" slotStatus: %08x\n", data->slotStatus); 145 - pr_info(" linkStatus: %08x\n", data->linkStatus); 146 - pr_info(" devCmdStatus: %08x\n", data->devCmdStatus); 147 - pr_info(" devSecStatus: %08x\n", data->devSecStatus); 148 - 149 - pr_info(" rootErrorStatus: %08x\n", data->rootErrorStatus); 150 - pr_info(" uncorrErrorStatus: %08x\n", data->uncorrErrorStatus); 151 - pr_info(" corrErrorStatus: %08x\n", data->corrErrorStatus); 152 - pr_info(" tlpHdr1: %08x\n", data->tlpHdr1); 153 - pr_info(" tlpHdr2: %08x\n", data->tlpHdr2); 154 - pr_info(" tlpHdr3: %08x\n", data->tlpHdr3); 155 - pr_info(" tlpHdr4: %08x\n", data->tlpHdr4); 156 - pr_info(" sourceId: %08x\n", data->sourceId); 157 - pr_info(" errorClass: %016llx\n", data->errorClass); 158 - pr_info(" correlator: %016llx\n", data->correlator); 159 - pr_info(" p7iocPlssr: %016llx\n", data->p7iocPlssr); 160 - pr_info(" p7iocCsr: %016llx\n", data->p7iocCsr); 161 - pr_info(" lemFir: %016llx\n", data->lemFir); 162 - pr_info(" lemErrorMask: %016llx\n", data->lemErrorMask); 163 - pr_info(" lemWOF: %016llx\n", data->lemWOF); 164 - pr_info(" phbErrorStatus: %016llx\n", data->phbErrorStatus); 165 - pr_info(" phbFirstErrorStatus: %016llx\n", data->phbFirstErrorStatus); 166 - pr_info(" phbErrorLog0: %016llx\n", data->phbErrorLog0); 167 - pr_info(" phbErrorLog1: %016llx\n", data->phbErrorLog1); 168 - pr_info(" mmioErrorStatus: %016llx\n", data->mmioErrorStatus); 169 - pr_info(" mmioFirstErrorStatus: %016llx\n", data->mmioFirstErrorStatus); 170 - pr_info(" mmioErrorLog0: %016llx\n", data->mmioErrorLog0); 171 - pr_info(" mmioErrorLog1: %016llx\n", data->mmioErrorLog1); 172 - pr_info(" dma0ErrorStatus: %016llx\n", data->dma0ErrorStatus); 173 - pr_info(" dma0FirstErrorStatus: %016llx\n", data->dma0FirstErrorStatus); 174 - pr_info(" dma0ErrorLog0: %016llx\n", data->dma0ErrorLog0); 175 - pr_info(" dma0ErrorLog1: %016llx\n", data->dma0ErrorLog1); 176 - pr_info(" dma1ErrorStatus: %016llx\n", data->dma1ErrorStatus); 177 - pr_info(" dma1FirstErrorStatus: %016llx\n", data->dma1FirstErrorStatus); 178 - pr_info(" dma1ErrorLog0: %016llx\n", data->dma1ErrorLog0); 179 - pr_info(" dma1ErrorLog1: %016llx\n", data->dma1ErrorLog1); 137 + if (data->brdgCtl) 138 + pr_info(" brdgCtl: %08x\n", 139 + data->brdgCtl); 140 + if (data->portStatusReg || data->rootCmplxStatus || 141 + data->busAgentStatus) 142 + pr_info(" UtlSts: %08x %08x %08x\n", 143 + data->portStatusReg, data->rootCmplxStatus, 144 + data->busAgentStatus); 145 + if (data->deviceStatus || data->slotStatus || 146 + data->linkStatus || data->devCmdStatus || 147 + data->devSecStatus) 148 + pr_info(" RootSts: %08x %08x %08x %08x %08x\n", 149 + data->deviceStatus, data->slotStatus, 150 + data->linkStatus, data->devCmdStatus, 151 + data->devSecStatus); 152 + if (data->rootErrorStatus || data->uncorrErrorStatus || 153 + data->corrErrorStatus) 154 + pr_info(" RootErrSts: %08x %08x %08x\n", 155 + data->rootErrorStatus, data->uncorrErrorStatus, 156 + data->corrErrorStatus); 157 + if (data->tlpHdr1 || data->tlpHdr2 || 158 + data->tlpHdr3 || data->tlpHdr4) 159 + pr_info(" RootErrLog: %08x %08x %08x %08x\n", 160 + data->tlpHdr1, data->tlpHdr2, 161 + data->tlpHdr3, data->tlpHdr4); 162 + if (data->sourceId || data->errorClass || 163 + data->correlator) 164 + pr_info(" RootErrLog1: %08x %016llx %016llx\n", 165 + data->sourceId, data->errorClass, 166 + data->correlator); 167 + if (data->p7iocPlssr || data->p7iocCsr) 168 + pr_info(" PhbSts: %016llx %016llx\n", 169 + data->p7iocPlssr, data->p7iocCsr); 170 + if (data->lemFir || data->lemErrorMask || 171 + data->lemWOF) 172 + pr_info(" Lem: %016llx %016llx %016llx\n", 173 + data->lemFir, data->lemErrorMask, 174 + data->lemWOF); 175 + if (data->phbErrorStatus || data->phbFirstErrorStatus || 176 + data->phbErrorLog0 || data->phbErrorLog1) 177 + pr_info(" PhbErr: %016llx %016llx %016llx %016llx\n", 178 + data->phbErrorStatus, data->phbFirstErrorStatus, 179 + data->phbErrorLog0, data->phbErrorLog1); 180 + if (data->mmioErrorStatus || data->mmioFirstErrorStatus || 181 + data->mmioErrorLog0 || data->mmioErrorLog1) 182 + pr_info(" OutErr: %016llx %016llx %016llx %016llx\n", 183 + data->mmioErrorStatus, data->mmioFirstErrorStatus, 184 + data->mmioErrorLog0, data->mmioErrorLog1); 185 + if (data->dma0ErrorStatus || data->dma0FirstErrorStatus || 186 + data->dma0ErrorLog0 || data->dma0ErrorLog1) 187 + pr_info(" InAErr: %016llx %016llx %016llx %016llx\n", 188 + data->dma0ErrorStatus, data->dma0FirstErrorStatus, 189 + data->dma0ErrorLog0, data->dma0ErrorLog1); 190 + if (data->dma1ErrorStatus || data->dma1FirstErrorStatus || 191 + data->dma1ErrorLog0 || data->dma1ErrorLog1) 192 + pr_info(" InBErr: %016llx %016llx %016llx %016llx\n", 193 + data->dma1ErrorStatus, data->dma1FirstErrorStatus, 194 + data->dma1ErrorLog0, data->dma1ErrorLog1); 180 195 181 196 for (i = 0; i < OPAL_P7IOC_NUM_PEST_REGS; i++) { 182 197 if ((data->pestA[i] >> 63) == 0 && 183 198 (data->pestB[i] >> 63) == 0) 184 199 continue; 185 200 186 - pr_info(" PE[%3d] PESTA: %016llx\n", i, data->pestA[i]); 187 - pr_info(" PESTB: %016llx\n", data->pestB[i]); 201 + pr_info(" PE[%3d] A/B: %016llx %016llx\n", 202 + i, data->pestA[i], data->pestB[i]); 188 203 } 189 204 } 190 205 ··· 212 197 data = (struct OpalIoPhb3ErrorData*)common; 213 198 pr_info("PHB3 PHB#%d Diag-data (Version: %d)\n\n", 214 199 hose->global_number, common->version); 215 - 216 - pr_info(" brdgCtl: %08x\n", data->brdgCtl); 217 - 218 - pr_info(" portStatusReg: %08x\n", data->portStatusReg); 219 - pr_info(" rootCmplxStatus: %08x\n", data->rootCmplxStatus); 220 - pr_info(" busAgentStatus: %08x\n", data->busAgentStatus); 221 - 222 - pr_info(" deviceStatus: %08x\n", data->deviceStatus); 223 - pr_info(" slotStatus: %08x\n", data->slotStatus); 224 - pr_info(" linkStatus: %08x\n", data->linkStatus); 225 - pr_info(" devCmdStatus: %08x\n", data->devCmdStatus); 226 - pr_info(" devSecStatus: %08x\n", data->devSecStatus); 227 - 228 - pr_info(" rootErrorStatus: %08x\n", data->rootErrorStatus); 229 - pr_info(" uncorrErrorStatus: %08x\n", data->uncorrErrorStatus); 230 - pr_info(" corrErrorStatus: %08x\n", data->corrErrorStatus); 231 - pr_info(" tlpHdr1: %08x\n", data->tlpHdr1); 232 - pr_info(" tlpHdr2: %08x\n", data->tlpHdr2); 233 - pr_info(" tlpHdr3: %08x\n", data->tlpHdr3); 234 - pr_info(" tlpHdr4: %08x\n", data->tlpHdr4); 235 - pr_info(" sourceId: %08x\n", data->sourceId); 236 - pr_info(" errorClass: %016llx\n", data->errorClass); 237 - pr_info(" correlator: %016llx\n", data->correlator); 238 - 239 - pr_info(" nFir: %016llx\n", data->nFir); 240 - pr_info(" nFirMask: %016llx\n", data->nFirMask); 241 - pr_info(" nFirWOF: %016llx\n", data->nFirWOF); 242 - pr_info(" PhbPlssr: %016llx\n", data->phbPlssr); 243 - pr_info(" PhbCsr: %016llx\n", data->phbCsr); 244 - pr_info(" lemFir: %016llx\n", data->lemFir); 245 - pr_info(" lemErrorMask: %016llx\n", data->lemErrorMask); 246 - pr_info(" lemWOF: %016llx\n", data->lemWOF); 247 - pr_info(" phbErrorStatus: %016llx\n", data->phbErrorStatus); 248 - pr_info(" phbFirstErrorStatus: %016llx\n", data->phbFirstErrorStatus); 249 - pr_info(" phbErrorLog0: %016llx\n", data->phbErrorLog0); 250 - pr_info(" phbErrorLog1: %016llx\n", data->phbErrorLog1); 251 - pr_info(" mmioErrorStatus: %016llx\n", data->mmioErrorStatus); 252 - pr_info(" mmioFirstErrorStatus: %016llx\n", data->mmioFirstErrorStatus); 253 - pr_info(" mmioErrorLog0: %016llx\n", data->mmioErrorLog0); 254 - pr_info(" mmioErrorLog1: %016llx\n", data->mmioErrorLog1); 255 - pr_info(" dma0ErrorStatus: %016llx\n", data->dma0ErrorStatus); 256 - pr_info(" dma0FirstErrorStatus: %016llx\n", data->dma0FirstErrorStatus); 257 - pr_info(" dma0ErrorLog0: %016llx\n", data->dma0ErrorLog0); 258 - pr_info(" dma0ErrorLog1: %016llx\n", data->dma0ErrorLog1); 259 - pr_info(" dma1ErrorStatus: %016llx\n", data->dma1ErrorStatus); 260 - pr_info(" dma1FirstErrorStatus: %016llx\n", data->dma1FirstErrorStatus); 261 - pr_info(" dma1ErrorLog0: %016llx\n", data->dma1ErrorLog0); 262 - pr_info(" dma1ErrorLog1: %016llx\n", data->dma1ErrorLog1); 200 + if (data->brdgCtl) 201 + pr_info(" brdgCtl: %08x\n", 202 + data->brdgCtl); 203 + if (data->portStatusReg || data->rootCmplxStatus || 204 + data->busAgentStatus) 205 + pr_info(" UtlSts: %08x %08x %08x\n", 206 + data->portStatusReg, data->rootCmplxStatus, 207 + data->busAgentStatus); 208 + if (data->deviceStatus || data->slotStatus || 209 + data->linkStatus || data->devCmdStatus || 210 + data->devSecStatus) 211 + pr_info(" RootSts: %08x %08x %08x %08x %08x\n", 212 + data->deviceStatus, data->slotStatus, 213 + data->linkStatus, data->devCmdStatus, 214 + data->devSecStatus); 215 + if (data->rootErrorStatus || data->uncorrErrorStatus || 216 + data->corrErrorStatus) 217 + pr_info(" RootErrSts: %08x %08x %08x\n", 218 + data->rootErrorStatus, data->uncorrErrorStatus, 219 + data->corrErrorStatus); 220 + if (data->tlpHdr1 || data->tlpHdr2 || 221 + data->tlpHdr3 || data->tlpHdr4) 222 + pr_info(" RootErrLog: %08x %08x %08x %08x\n", 223 + data->tlpHdr1, data->tlpHdr2, 224 + data->tlpHdr3, data->tlpHdr4); 225 + if (data->sourceId || data->errorClass || 226 + data->correlator) 227 + pr_info(" RootErrLog1: %08x %016llx %016llx\n", 228 + data->sourceId, data->errorClass, 229 + data->correlator); 230 + if (data->nFir || data->nFirMask || 231 + data->nFirWOF) 232 + pr_info(" nFir: %016llx %016llx %016llx\n", 233 + data->nFir, data->nFirMask, 234 + data->nFirWOF); 235 + if (data->phbPlssr || data->phbCsr) 236 + pr_info(" PhbSts: %016llx %016llx\n", 237 + data->phbPlssr, data->phbCsr); 238 + if (data->lemFir || data->lemErrorMask || 239 + data->lemWOF) 240 + pr_info(" Lem: %016llx %016llx %016llx\n", 241 + data->lemFir, data->lemErrorMask, 242 + data->lemWOF); 243 + if (data->phbErrorStatus || data->phbFirstErrorStatus || 244 + data->phbErrorLog0 || data->phbErrorLog1) 245 + pr_info(" PhbErr: %016llx %016llx %016llx %016llx\n", 246 + data->phbErrorStatus, data->phbFirstErrorStatus, 247 + data->phbErrorLog0, data->phbErrorLog1); 248 + if (data->mmioErrorStatus || data->mmioFirstErrorStatus || 249 + data->mmioErrorLog0 || data->mmioErrorLog1) 250 + pr_info(" OutErr: %016llx %016llx %016llx %016llx\n", 251 + data->mmioErrorStatus, data->mmioFirstErrorStatus, 252 + data->mmioErrorLog0, data->mmioErrorLog1); 253 + if (data->dma0ErrorStatus || data->dma0FirstErrorStatus || 254 + data->dma0ErrorLog0 || data->dma0ErrorLog1) 255 + pr_info(" InAErr: %016llx %016llx %016llx %016llx\n", 256 + data->dma0ErrorStatus, data->dma0FirstErrorStatus, 257 + data->dma0ErrorLog0, data->dma0ErrorLog1); 258 + if (data->dma1ErrorStatus || data->dma1FirstErrorStatus || 259 + data->dma1ErrorLog0 || data->dma1ErrorLog1) 260 + pr_info(" InBErr: %016llx %016llx %016llx %016llx\n", 261 + data->dma1ErrorStatus, data->dma1FirstErrorStatus, 262 + data->dma1ErrorLog0, data->dma1ErrorLog1); 263 263 264 264 for (i = 0; i < OPAL_PHB3_NUM_PEST_REGS; i++) { 265 265 if ((data->pestA[i] >> 63) == 0 && 266 266 (data->pestB[i] >> 63) == 0) 267 267 continue; 268 268 269 - pr_info(" PE[%3d] PESTA: %016llx\n", i, data->pestA[i]); 270 - pr_info(" PESTB: %016llx\n", data->pestB[i]); 269 + pr_info(" PE[%3d] A/B: %016llx %016llx\n", 270 + i, data->pestA[i], data->pestB[i]); 271 271 } 272 272 } 273 273
+11 -11
arch/powerpc/platforms/pseries/hotplug-cpu.c
··· 35 35 #include "offline_states.h" 36 36 37 37 /* This version can't take the spinlock, because it never returns */ 38 - static struct rtas_args rtas_stop_self_args = { 39 - .token = RTAS_UNKNOWN_SERVICE, 40 - .nargs = 0, 41 - .nret = 1, 42 - .rets = &rtas_stop_self_args.args[0], 43 - }; 38 + static int rtas_stop_self_token = RTAS_UNKNOWN_SERVICE; 44 39 45 40 static DEFINE_PER_CPU(enum cpu_state_vals, preferred_offline_state) = 46 41 CPU_STATE_OFFLINE; ··· 88 93 89 94 static void rtas_stop_self(void) 90 95 { 91 - struct rtas_args *args = &rtas_stop_self_args; 96 + struct rtas_args args = { 97 + .token = cpu_to_be32(rtas_stop_self_token), 98 + .nargs = 0, 99 + .nret = 1, 100 + .rets = &args.args[0], 101 + }; 92 102 93 103 local_irq_disable(); 94 104 95 - BUG_ON(args->token == RTAS_UNKNOWN_SERVICE); 105 + BUG_ON(rtas_stop_self_token == RTAS_UNKNOWN_SERVICE); 96 106 97 107 printk("cpu %u (hwid %u) Ready to die...\n", 98 108 smp_processor_id(), hard_smp_processor_id()); 99 - enter_rtas(__pa(args)); 109 + enter_rtas(__pa(&args)); 100 110 101 111 panic("Alas, I survived.\n"); 102 112 } ··· 392 392 } 393 393 } 394 394 395 - rtas_stop_self_args.token = rtas_token("stop-self"); 395 + rtas_stop_self_token = rtas_token("stop-self"); 396 396 qcss_tok = rtas_token("query-cpu-stopped-state"); 397 397 398 - if (rtas_stop_self_args.token == RTAS_UNKNOWN_SERVICE || 398 + if (rtas_stop_self_token == RTAS_UNKNOWN_SERVICE || 399 399 qcss_tok == RTAS_UNKNOWN_SERVICE) { 400 400 printk(KERN_INFO "CPU Hotplug not supported by firmware " 401 401 "- disabling.\n");
+1 -1
arch/s390/kernel/compat_wrapper.S
··· 1421 1421 ENTRY(sys_sched_getattr_wrapper) 1422 1422 lgfr %r2,%r2 # pid_t 1423 1423 llgtr %r3,%r3 # const char __user * 1424 - llgfr %r3,%r3 # unsigned int 1424 + llgfr %r4,%r4 # unsigned int 1425 1425 jg sys_sched_getattr
+5 -3
arch/s390/pci/pci_dma.c
··· 206 206 zdev->dma_table = NULL; 207 207 } 208 208 209 - static unsigned long __dma_alloc_iommu(struct zpci_dev *zdev, unsigned long start, 210 - int size) 209 + static unsigned long __dma_alloc_iommu(struct zpci_dev *zdev, 210 + unsigned long start, int size) 211 211 { 212 - unsigned long boundary_size = 0x1000000; 212 + unsigned long boundary_size; 213 213 214 + boundary_size = ALIGN(dma_get_seg_boundary(&zdev->pdev->dev) + 1, 215 + PAGE_SIZE) >> PAGE_SHIFT; 214 216 return iommu_area_alloc(zdev->iommu_bitmap, zdev->iommu_pages, 215 217 start, size, 0, boundary_size, 0); 216 218 }
+5 -4
arch/x86/boot/compressed/aslr.c
··· 111 111 }; 112 112 113 113 #define MEM_AVOID_MAX 5 114 - struct mem_vector mem_avoid[MEM_AVOID_MAX]; 114 + static struct mem_vector mem_avoid[MEM_AVOID_MAX]; 115 115 116 116 static bool mem_contains(struct mem_vector *region, struct mem_vector *item) 117 117 { ··· 180 180 } 181 181 182 182 /* Does this memory vector overlap a known avoided area? */ 183 - bool mem_avoid_overlap(struct mem_vector *img) 183 + static bool mem_avoid_overlap(struct mem_vector *img) 184 184 { 185 185 int i; 186 186 ··· 192 192 return false; 193 193 } 194 194 195 - unsigned long slots[CONFIG_RANDOMIZE_BASE_MAX_OFFSET / CONFIG_PHYSICAL_ALIGN]; 196 - unsigned long slot_max = 0; 195 + static unsigned long slots[CONFIG_RANDOMIZE_BASE_MAX_OFFSET / 196 + CONFIG_PHYSICAL_ALIGN]; 197 + static unsigned long slot_max; 197 198 198 199 static void slots_append(unsigned long addr) 199 200 {
+3
arch/x86/kernel/cpu/perf_event.c
··· 1192 1192 for (i = 0; i < cpuc->n_events; i++) { 1193 1193 if (event == cpuc->event_list[i]) { 1194 1194 1195 + if (i >= cpuc->n_events - cpuc->n_added) 1196 + --cpuc->n_added; 1197 + 1195 1198 if (x86_pmu.put_event_constraints) 1196 1199 x86_pmu.put_event_constraints(cpuc, event); 1197 1200
+2
arch/x86/kernel/machine_kexec_64.c
··· 279 279 VMCOREINFO_SYMBOL(node_data); 280 280 VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); 281 281 #endif 282 + vmcoreinfo_append_str("KERNELOFFSET=%lx\n", 283 + (unsigned long)&_text - __START_KERNEL); 282 284 } 283 285
+1
arch/x86/kvm/mmu.c
··· 2672 2672 break; 2673 2673 } 2674 2674 2675 + drop_large_spte(vcpu, iterator.sptep); 2675 2676 if (!is_shadow_present_pte(*iterator.sptep)) { 2676 2677 u64 base_addr = iterator.addr; 2677 2678
+1 -1
arch/x86/kvm/vmx.c
··· 6688 6688 else if (is_page_fault(intr_info)) 6689 6689 return enable_ept; 6690 6690 else if (is_no_device(intr_info) && 6691 - !(nested_read_cr0(vmcs12) & X86_CR0_TS)) 6691 + !(vmcs12->guest_cr0 & X86_CR0_TS)) 6692 6692 return 0; 6693 6693 return vmcs12->exception_bitmap & 6694 6694 (1u << (intr_info & INTR_INFO_VECTOR_MASK));
+1 -1
arch/x86/kvm/x86.c
··· 6186 6186 frag->len -= len; 6187 6187 } 6188 6188 6189 - if (vcpu->mmio_cur_fragment == vcpu->mmio_nr_fragments) { 6189 + if (vcpu->mmio_cur_fragment >= vcpu->mmio_nr_fragments) { 6190 6190 vcpu->mmio_needed = 0; 6191 6191 6192 6192 /* FIXME: return into emulator if single-stepping. */
+1 -2
arch/xtensa/Kconfig
··· 20 20 select HAVE_FUNCTION_TRACER 21 21 select HAVE_IRQ_TIME_ACCOUNTING 22 22 select HAVE_PERF_EVENTS 23 + select COMMON_CLK 23 24 help 24 25 Xtensa processors are 32-bit RISC machines designed by Tensilica 25 26 primarily for embedded systems. These processors are both ··· 81 80 config XTENSA_VARIANT_FSF 82 81 bool "fsf - default (not generic) configuration" 83 82 select MMU 84 - select HAVE_XTENSA_GPIO32 85 83 86 84 config XTENSA_VARIANT_DC232B 87 85 bool "dc232b - Diamond 232L Standard Core Rev.B (LE)" ··· 135 135 config SMP 136 136 bool "Enable Symmetric multi-processing support" 137 137 depends on HAVE_SMP 138 - select USE_GENERIC_SMP_HELPERS 139 138 select GENERIC_SMP_IDLE_THREAD 140 139 help 141 140 Enabled SMP Software; allows more than one CPU/CORE
+9 -3
arch/xtensa/boot/dts/xtfpga.dtsi
··· 35 35 interrupt-controller; 36 36 }; 37 37 38 + clocks { 39 + osc: main-oscillator { 40 + #clock-cells = <0>; 41 + compatible = "fixed-clock"; 42 + }; 43 + }; 44 + 38 45 serial0: serial@fd050020 { 39 46 device_type = "serial"; 40 47 compatible = "ns16550a"; ··· 49 42 reg = <0xfd050020 0x20>; 50 43 reg-shift = <2>; 51 44 interrupts = <0 1>; /* external irq 0 */ 52 - /* Filled in by platform_setup from FPGA register 53 - * clock-frequency = <100000000>; 54 - */ 45 + clocks = <&osc>; 55 46 }; 56 47 57 48 enet0: ethoc@fd030000 { ··· 57 52 reg = <0xfd030000 0x4000 0xfd800000 0x4000>; 58 53 interrupts = <1 1>; /* external irq 1 */ 59 54 local-mac-address = [00 50 c2 13 6f 00]; 55 + clocks = <&osc>; 60 56 }; 61 57 };
+1 -1
arch/xtensa/include/asm/io.h
··· 25 25 26 26 #ifdef CONFIG_MMU 27 27 28 - #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && CONFIG_OF 28 + #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF) 29 29 extern unsigned long xtensa_kio_paddr; 30 30 31 31 static inline unsigned long xtensa_get_kio_paddr(void)
+29 -17
arch/xtensa/include/asm/traps.h
··· 23 23 24 24 static inline void spill_registers(void) 25 25 { 26 - 26 + #if XCHAL_NUM_AREGS > 16 27 27 __asm__ __volatile__ ( 28 - "movi a14, "__stringify((1 << PS_EXCM_BIT) | LOCKLEVEL)"\n\t" 29 - "mov a12, a0\n\t" 30 - "rsr a13, sar\n\t" 31 - "xsr a14, ps\n\t" 32 - "movi a0, _spill_registers\n\t" 33 - "rsync\n\t" 34 - "callx0 a0\n\t" 35 - "mov a0, a12\n\t" 36 - "wsr a13, sar\n\t" 37 - "wsr a14, ps\n\t" 38 - : : 39 - #if defined(CONFIG_FRAME_POINTER) 40 - : "a2", "a3", "a4", "a11", "a12", "a13", "a14", "a15", 41 - #else 42 - : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", 28 + " call12 1f\n" 29 + " _j 2f\n" 30 + " retw\n" 31 + " .align 4\n" 32 + "1:\n" 33 + " _entry a1, 48\n" 34 + " addi a12, a0, 3\n" 35 + #if XCHAL_NUM_AREGS > 32 36 + " .rept (" __stringify(XCHAL_NUM_AREGS) " - 32) / 12\n" 37 + " _entry a1, 48\n" 38 + " mov a12, a0\n" 39 + " .endr\n" 43 40 #endif 44 - "memory"); 41 + " _entry a1, 48\n" 42 + #if XCHAL_NUM_AREGS % 12 == 0 43 + " mov a8, a8\n" 44 + #elif XCHAL_NUM_AREGS % 12 == 4 45 + " mov a12, a12\n" 46 + #elif XCHAL_NUM_AREGS % 12 == 8 47 + " mov a4, a4\n" 48 + #endif 49 + " retw\n" 50 + "2:\n" 51 + : : : "a12", "a13", "memory"); 52 + #else 53 + __asm__ __volatile__ ( 54 + " mov a12, a12\n" 55 + : : : "memory"); 56 + #endif 45 57 } 46 58 47 59 #endif /* _XTENSA_TRAPS_H */
+1 -1
arch/xtensa/include/asm/vectors.h
··· 25 25 #define XCHAL_KIO_DEFAULT_PADDR 0xf0000000 26 26 #define XCHAL_KIO_SIZE 0x10000000 27 27 28 - #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && CONFIG_OF 28 + #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF) 29 29 #define XCHAL_KIO_PADDR xtensa_get_kio_paddr() 30 30 #else 31 31 #define XCHAL_KIO_PADDR XCHAL_KIO_DEFAULT_PADDR
+6 -1
arch/xtensa/include/uapi/asm/unistd.h
··· 734 734 #define __NR_accept4 333 735 735 __SYSCALL(333, sys_accept4, 4) 736 736 737 - #define __NR_syscall_count 334 737 + #define __NR_sched_setattr 334 738 + __SYSCALL(334, sys_sched_setattr, 2) 739 + #define __NR_sched_getattr 335 740 + __SYSCALL(335, sys_sched_getattr, 3) 741 + 742 + #define __NR_syscall_count 336 738 743 739 744 /* 740 745 * sysxtensa syscall handler
+235 -222
arch/xtensa/kernel/entry.S
··· 1081 1081 1082 1082 rsr a0, sar 1083 1083 s32i a3, a2, PT_AREG3 1084 + s32i a0, a2, PT_SAR 1085 + 1086 + /* The spill routine might clobber a4, a7, a8, a11, a12, and a15. */ 1087 + 1084 1088 s32i a4, a2, PT_AREG4 1085 - s32i a0, a2, PT_AREG5 # store SAR to PT_AREG5 1086 - 1087 - /* The spill routine might clobber a7, a11, and a15. */ 1088 - 1089 1089 s32i a7, a2, PT_AREG7 1090 + s32i a8, a2, PT_AREG8 1090 1091 s32i a11, a2, PT_AREG11 1092 + s32i a12, a2, PT_AREG12 1091 1093 s32i a15, a2, PT_AREG15 1092 1094 1093 - call0 _spill_registers # destroys a3, a4, and SAR 1095 + /* 1096 + * Rotate ws so that the current windowbase is at bit 0. 1097 + * Assume ws = xxxwww1yy (www1 current window frame). 1098 + * Rotate ws right so that a4 = yyxxxwww1. 1099 + */ 1100 + 1101 + rsr a0, windowbase 1102 + rsr a3, windowstart # a3 = xxxwww1yy 1103 + ssr a0 # holds WB 1104 + slli a0, a3, WSBITS 1105 + or a3, a3, a0 # a3 = xxxwww1yyxxxwww1yy 1106 + srl a3, a3 # a3 = 00xxxwww1yyxxxwww1 1107 + 1108 + /* We are done if there are no more than the current register frame. */ 1109 + 1110 + extui a3, a3, 1, WSBITS-1 # a3 = 0yyxxxwww 1111 + movi a0, (1 << (WSBITS-1)) 1112 + _beqz a3, .Lnospill # only one active frame? jump 1113 + 1114 + /* We want 1 at the top, so that we return to the current windowbase */ 1115 + 1116 + or a3, a3, a0 # 1yyxxxwww 1117 + 1118 + /* Skip empty frames - get 'oldest' WINDOWSTART-bit. */ 1119 + 1120 + wsr a3, windowstart # save shifted windowstart 1121 + neg a0, a3 1122 + and a3, a0, a3 # first bit set from right: 000010000 1123 + 1124 + ffs_ws a0, a3 # a0: shifts to skip empty frames 1125 + movi a3, WSBITS 1126 + sub a0, a3, a0 # WSBITS-a0:number of 0-bits from right 1127 + ssr a0 # save in SAR for later. 1128 + 1129 + rsr a3, windowbase 1130 + add a3, a3, a0 1131 + wsr a3, windowbase 1132 + rsync 1133 + 1134 + rsr a3, windowstart 1135 + srl a3, a3 # shift windowstart 1136 + 1137 + /* WB is now just one frame below the oldest frame in the register 1138 + window. WS is shifted so the oldest frame is in bit 0, thus, WB 1139 + and WS differ by one 4-register frame. */ 1140 + 1141 + /* Save frames. Depending what call was used (call4, call8, call12), 1142 + * we have to save 4,8. or 12 registers. 1143 + */ 1144 + 1145 + 1146 + .Lloop: _bbsi.l a3, 1, .Lc4 1147 + _bbci.l a3, 2, .Lc12 1148 + 1149 + .Lc8: s32e a4, a13, -16 1150 + l32e a4, a5, -12 1151 + s32e a8, a4, -32 1152 + s32e a5, a13, -12 1153 + s32e a6, a13, -8 1154 + s32e a7, a13, -4 1155 + s32e a9, a4, -28 1156 + s32e a10, a4, -24 1157 + s32e a11, a4, -20 1158 + srli a11, a3, 2 # shift windowbase by 2 1159 + rotw 2 1160 + _bnei a3, 1, .Lloop 1161 + j .Lexit 1162 + 1163 + .Lc4: s32e a4, a9, -16 1164 + s32e a5, a9, -12 1165 + s32e a6, a9, -8 1166 + s32e a7, a9, -4 1167 + 1168 + srli a7, a3, 1 1169 + rotw 1 1170 + _bnei a3, 1, .Lloop 1171 + j .Lexit 1172 + 1173 + .Lc12: _bbci.l a3, 3, .Linvalid_mask # bit 2 shouldn't be zero! 1174 + 1175 + /* 12-register frame (call12) */ 1176 + 1177 + l32e a0, a5, -12 1178 + s32e a8, a0, -48 1179 + mov a8, a0 1180 + 1181 + s32e a9, a8, -44 1182 + s32e a10, a8, -40 1183 + s32e a11, a8, -36 1184 + s32e a12, a8, -32 1185 + s32e a13, a8, -28 1186 + s32e a14, a8, -24 1187 + s32e a15, a8, -20 1188 + srli a15, a3, 3 1189 + 1190 + /* The stack pointer for a4..a7 is out of reach, so we rotate the 1191 + * window, grab the stackpointer, and rotate back. 1192 + * Alternatively, we could also use the following approach, but that 1193 + * makes the fixup routine much more complicated: 1194 + * rotw 1 1195 + * s32e a0, a13, -16 1196 + * ... 1197 + * rotw 2 1198 + */ 1199 + 1200 + rotw 1 1201 + mov a4, a13 1202 + rotw -1 1203 + 1204 + s32e a4, a8, -16 1205 + s32e a5, a8, -12 1206 + s32e a6, a8, -8 1207 + s32e a7, a8, -4 1208 + 1209 + rotw 3 1210 + 1211 + _beqi a3, 1, .Lexit 1212 + j .Lloop 1213 + 1214 + .Lexit: 1215 + 1216 + /* Done. Do the final rotation and set WS */ 1217 + 1218 + rotw 1 1219 + rsr a3, windowbase 1220 + ssl a3 1221 + movi a3, 1 1222 + sll a3, a3 1223 + wsr a3, windowstart 1224 + .Lnospill: 1094 1225 1095 1226 /* Advance PC, restore registers and SAR, and return from exception. */ 1096 1227 1097 - l32i a3, a2, PT_AREG5 1098 - l32i a4, a2, PT_AREG4 1228 + l32i a3, a2, PT_SAR 1099 1229 l32i a0, a2, PT_AREG0 1100 1230 wsr a3, sar 1101 1231 l32i a3, a2, PT_AREG3 1102 1232 1103 1233 /* Restore clobbered registers. */ 1104 1234 1235 + l32i a4, a2, PT_AREG4 1105 1236 l32i a7, a2, PT_AREG7 1237 + l32i a8, a2, PT_AREG8 1106 1238 l32i a11, a2, PT_AREG11 1239 + l32i a12, a2, PT_AREG12 1107 1240 l32i a15, a2, PT_AREG15 1108 1241 1109 1242 movi a2, 0 1110 1243 rfe 1244 + 1245 + .Linvalid_mask: 1246 + 1247 + /* We get here because of an unrecoverable error in the window 1248 + * registers, so set up a dummy frame and kill the user application. 1249 + * Note: We assume EXC_TABLE_KSTK contains a valid stack pointer. 1250 + */ 1251 + 1252 + movi a0, 1 1253 + movi a1, 0 1254 + 1255 + wsr a0, windowstart 1256 + wsr a1, windowbase 1257 + rsync 1258 + 1259 + movi a0, 0 1260 + 1261 + rsr a3, excsave1 1262 + l32i a1, a3, EXC_TABLE_KSTK 1263 + 1264 + movi a4, (1 << PS_WOE_BIT) | LOCKLEVEL 1265 + wsr a4, ps 1266 + rsync 1267 + 1268 + movi a6, SIGSEGV 1269 + movi a4, do_exit 1270 + callx4 a4 1271 + 1272 + /* shouldn't return, so panic */ 1273 + 1274 + wsr a0, excsave1 1275 + movi a0, unrecoverable_exception 1276 + callx0 a0 # should not return 1277 + 1: j 1b 1278 + 1111 1279 1112 1280 ENDPROC(fast_syscall_spill_registers) 1113 1281 ··· 1284 1116 * We get here if the spill routine causes an exception, e.g. tlb miss. 1285 1117 * We basically restore WINDOWBASE and WINDOWSTART to the condition when 1286 1118 * we entered the spill routine and jump to the user exception handler. 1119 + * 1120 + * Note that we only need to restore the bits in windowstart that have not 1121 + * been spilled yet by the _spill_register routine. Luckily, a3 contains a 1122 + * rotated windowstart with only those bits set for frames that haven't been 1123 + * spilled yet. Because a3 is rotated such that bit 0 represents the register 1124 + * frame for the current windowbase - 1, we need to rotate a3 left by the 1125 + * value of the current windowbase + 1 and move it to windowstart. 1287 1126 * 1288 1127 * a0: value of depc, original value in depc 1289 1128 * a2: trashed, original value in EXC_TABLE_DOUBLE_SAVE ··· 1306 1131 /* We need to make sure the current registers (a0-a3) are preserved. 1307 1132 * To do this, we simply set the bit for the current window frame 1308 1133 * in WS, so that the exception handlers save them to the task stack. 1134 + * 1135 + * Note: we use a3 to set the windowbase, so we take a special care 1136 + * of it, saving it in the original _spill_registers frame across 1137 + * the exception handler call. 1309 1138 */ 1310 1139 1311 1140 xsr a3, excsave1 # get spill-mask 1312 1141 slli a3, a3, 1 # shift left by one 1142 + addi a3, a3, 1 # set the bit for the current window frame 1313 1143 1314 1144 slli a2, a3, 32-WSBITS 1315 1145 src a2, a3, a2 # a2 = xxwww1yyxxxwww1yy...... ··· 1399 1219 rfde 1400 1220 1401 1221 ENDPROC(fast_syscall_spill_registers_fixup_return) 1402 - 1403 - /* 1404 - * spill all registers. 1405 - * 1406 - * This is not a real function. The following conditions must be met: 1407 - * 1408 - * - must be called with call0. 1409 - * - uses a3, a4 and SAR. 1410 - * - the last 'valid' register of each frame are clobbered. 1411 - * - the caller must have registered a fixup handler 1412 - * (or be inside a critical section) 1413 - * - PS_EXCM must be set (PS_WOE cleared?) 1414 - */ 1415 - 1416 - ENTRY(_spill_registers) 1417 - 1418 - /* 1419 - * Rotate ws so that the current windowbase is at bit 0. 1420 - * Assume ws = xxxwww1yy (www1 current window frame). 1421 - * Rotate ws right so that a4 = yyxxxwww1. 1422 - */ 1423 - 1424 - rsr a4, windowbase 1425 - rsr a3, windowstart # a3 = xxxwww1yy 1426 - ssr a4 # holds WB 1427 - slli a4, a3, WSBITS 1428 - or a3, a3, a4 # a3 = xxxwww1yyxxxwww1yy 1429 - srl a3, a3 # a3 = 00xxxwww1yyxxxwww1 1430 - 1431 - /* We are done if there are no more than the current register frame. */ 1432 - 1433 - extui a3, a3, 1, WSBITS-1 # a3 = 0yyxxxwww 1434 - movi a4, (1 << (WSBITS-1)) 1435 - _beqz a3, .Lnospill # only one active frame? jump 1436 - 1437 - /* We want 1 at the top, so that we return to the current windowbase */ 1438 - 1439 - or a3, a3, a4 # 1yyxxxwww 1440 - 1441 - /* Skip empty frames - get 'oldest' WINDOWSTART-bit. */ 1442 - 1443 - wsr a3, windowstart # save shifted windowstart 1444 - neg a4, a3 1445 - and a3, a4, a3 # first bit set from right: 000010000 1446 - 1447 - ffs_ws a4, a3 # a4: shifts to skip empty frames 1448 - movi a3, WSBITS 1449 - sub a4, a3, a4 # WSBITS-a4:number of 0-bits from right 1450 - ssr a4 # save in SAR for later. 1451 - 1452 - rsr a3, windowbase 1453 - add a3, a3, a4 1454 - wsr a3, windowbase 1455 - rsync 1456 - 1457 - rsr a3, windowstart 1458 - srl a3, a3 # shift windowstart 1459 - 1460 - /* WB is now just one frame below the oldest frame in the register 1461 - window. WS is shifted so the oldest frame is in bit 0, thus, WB 1462 - and WS differ by one 4-register frame. */ 1463 - 1464 - /* Save frames. Depending what call was used (call4, call8, call12), 1465 - * we have to save 4,8. or 12 registers. 1466 - */ 1467 - 1468 - _bbsi.l a3, 1, .Lc4 1469 - _bbsi.l a3, 2, .Lc8 1470 - 1471 - /* Special case: we have a call12-frame starting at a4. */ 1472 - 1473 - _bbci.l a3, 3, .Lc12 # bit 3 shouldn't be zero! (Jump to Lc12 first) 1474 - 1475 - s32e a4, a1, -16 # a1 is valid with an empty spill area 1476 - l32e a4, a5, -12 1477 - s32e a8, a4, -48 1478 - mov a8, a4 1479 - l32e a4, a1, -16 1480 - j .Lc12c 1481 - 1482 - .Lnospill: 1483 - ret 1484 - 1485 - .Lloop: _bbsi.l a3, 1, .Lc4 1486 - _bbci.l a3, 2, .Lc12 1487 - 1488 - .Lc8: s32e a4, a13, -16 1489 - l32e a4, a5, -12 1490 - s32e a8, a4, -32 1491 - s32e a5, a13, -12 1492 - s32e a6, a13, -8 1493 - s32e a7, a13, -4 1494 - s32e a9, a4, -28 1495 - s32e a10, a4, -24 1496 - s32e a11, a4, -20 1497 - 1498 - srli a11, a3, 2 # shift windowbase by 2 1499 - rotw 2 1500 - _bnei a3, 1, .Lloop 1501 - 1502 - .Lexit: /* Done. Do the final rotation, set WS, and return. */ 1503 - 1504 - rotw 1 1505 - rsr a3, windowbase 1506 - ssl a3 1507 - movi a3, 1 1508 - sll a3, a3 1509 - wsr a3, windowstart 1510 - ret 1511 - 1512 - .Lc4: s32e a4, a9, -16 1513 - s32e a5, a9, -12 1514 - s32e a6, a9, -8 1515 - s32e a7, a9, -4 1516 - 1517 - srli a7, a3, 1 1518 - rotw 1 1519 - _bnei a3, 1, .Lloop 1520 - j .Lexit 1521 - 1522 - .Lc12: _bbci.l a3, 3, .Linvalid_mask # bit 2 shouldn't be zero! 1523 - 1524 - /* 12-register frame (call12) */ 1525 - 1526 - l32e a2, a5, -12 1527 - s32e a8, a2, -48 1528 - mov a8, a2 1529 - 1530 - .Lc12c: s32e a9, a8, -44 1531 - s32e a10, a8, -40 1532 - s32e a11, a8, -36 1533 - s32e a12, a8, -32 1534 - s32e a13, a8, -28 1535 - s32e a14, a8, -24 1536 - s32e a15, a8, -20 1537 - srli a15, a3, 3 1538 - 1539 - /* The stack pointer for a4..a7 is out of reach, so we rotate the 1540 - * window, grab the stackpointer, and rotate back. 1541 - * Alternatively, we could also use the following approach, but that 1542 - * makes the fixup routine much more complicated: 1543 - * rotw 1 1544 - * s32e a0, a13, -16 1545 - * ... 1546 - * rotw 2 1547 - */ 1548 - 1549 - rotw 1 1550 - mov a5, a13 1551 - rotw -1 1552 - 1553 - s32e a4, a9, -16 1554 - s32e a5, a9, -12 1555 - s32e a6, a9, -8 1556 - s32e a7, a9, -4 1557 - 1558 - rotw 3 1559 - 1560 - _beqi a3, 1, .Lexit 1561 - j .Lloop 1562 - 1563 - .Linvalid_mask: 1564 - 1565 - /* We get here because of an unrecoverable error in the window 1566 - * registers. If we are in user space, we kill the application, 1567 - * however, this condition is unrecoverable in kernel space. 1568 - */ 1569 - 1570 - rsr a0, ps 1571 - _bbci.l a0, PS_UM_BIT, 1f 1572 - 1573 - /* User space: Setup a dummy frame and kill application. 1574 - * Note: We assume EXC_TABLE_KSTK contains a valid stack pointer. 1575 - */ 1576 - 1577 - movi a0, 1 1578 - movi a1, 0 1579 - 1580 - wsr a0, windowstart 1581 - wsr a1, windowbase 1582 - rsync 1583 - 1584 - movi a0, 0 1585 - 1586 - rsr a3, excsave1 1587 - l32i a1, a3, EXC_TABLE_KSTK 1588 - 1589 - movi a4, (1 << PS_WOE_BIT) | LOCKLEVEL 1590 - wsr a4, ps 1591 - rsync 1592 - 1593 - movi a6, SIGSEGV 1594 - movi a4, do_exit 1595 - callx4 a4 1596 - 1597 - 1: /* Kernel space: PANIC! */ 1598 - 1599 - wsr a0, excsave1 1600 - movi a0, unrecoverable_exception 1601 - callx0 a0 # should not return 1602 - 1: j 1b 1603 - 1604 - ENDPROC(_spill_registers) 1605 1222 1606 1223 #ifdef CONFIG_MMU 1607 1224 /* ··· 1771 1794 1772 1795 ENDPROC(system_call) 1773 1796 1797 + /* 1798 + * Spill live registers on the kernel stack macro. 1799 + * 1800 + * Entry condition: ps.woe is set, ps.excm is cleared 1801 + * Exit condition: windowstart has single bit set 1802 + * May clobber: a12, a13 1803 + */ 1804 + .macro spill_registers_kernel 1805 + 1806 + #if XCHAL_NUM_AREGS > 16 1807 + call12 1f 1808 + _j 2f 1809 + retw 1810 + .align 4 1811 + 1: 1812 + _entry a1, 48 1813 + addi a12, a0, 3 1814 + #if XCHAL_NUM_AREGS > 32 1815 + .rept (XCHAL_NUM_AREGS - 32) / 12 1816 + _entry a1, 48 1817 + mov a12, a0 1818 + .endr 1819 + #endif 1820 + _entry a1, 48 1821 + #if XCHAL_NUM_AREGS % 12 == 0 1822 + mov a8, a8 1823 + #elif XCHAL_NUM_AREGS % 12 == 4 1824 + mov a12, a12 1825 + #elif XCHAL_NUM_AREGS % 12 == 8 1826 + mov a4, a4 1827 + #endif 1828 + retw 1829 + 2: 1830 + #else 1831 + mov a12, a12 1832 + #endif 1833 + .endm 1774 1834 1775 1835 /* 1776 1836 * Task switch. ··· 1820 1806 1821 1807 entry a1, 16 1822 1808 1823 - mov a12, a2 # preserve 'prev' (a2) 1824 - mov a13, a3 # and 'next' (a3) 1809 + mov a10, a2 # preserve 'prev' (a2) 1810 + mov a11, a3 # and 'next' (a3) 1825 1811 1826 1812 l32i a4, a2, TASK_THREAD_INFO 1827 1813 l32i a5, a3, TASK_THREAD_INFO 1828 1814 1829 - save_xtregs_user a4 a6 a8 a9 a10 a11 THREAD_XTREGS_USER 1815 + save_xtregs_user a4 a6 a8 a9 a12 a13 THREAD_XTREGS_USER 1830 1816 1831 - s32i a0, a12, THREAD_RA # save return address 1832 - s32i a1, a12, THREAD_SP # save stack pointer 1817 + s32i a0, a10, THREAD_RA # save return address 1818 + s32i a1, a10, THREAD_SP # save stack pointer 1833 1819 1834 1820 /* Disable ints while we manipulate the stack pointer. */ 1835 1821 1836 - movi a14, (1 << PS_EXCM_BIT) | LOCKLEVEL 1837 - xsr a14, ps 1822 + rsil a14, LOCKLEVEL 1838 1823 rsr a3, excsave1 1839 1824 rsync 1840 1825 s32i a3, a3, EXC_TABLE_FIXUP /* enter critical section */ ··· 1848 1835 1849 1836 /* Flush register file. */ 1850 1837 1851 - call0 _spill_registers # destroys a3, a4, and SAR 1838 + spill_registers_kernel 1852 1839 1853 1840 /* Set kernel stack (and leave critical section) 1854 1841 * Note: It's save to set it here. The stack will not be overwritten ··· 1864 1851 1865 1852 /* restore context of the task 'next' */ 1866 1853 1867 - l32i a0, a13, THREAD_RA # restore return address 1868 - l32i a1, a13, THREAD_SP # restore stack pointer 1854 + l32i a0, a11, THREAD_RA # restore return address 1855 + l32i a1, a11, THREAD_SP # restore stack pointer 1869 1856 1870 - load_xtregs_user a5 a6 a8 a9 a10 a11 THREAD_XTREGS_USER 1857 + load_xtregs_user a5 a6 a8 a9 a12 a13 THREAD_XTREGS_USER 1871 1858 1872 1859 wsr a14, ps 1873 - mov a2, a12 # return 'prev' 1860 + mov a2, a10 # return 'prev' 1874 1861 rsync 1875 1862 1876 1863 retw
+2
arch/xtensa/kernel/setup.c
··· 22 22 #include <linux/bootmem.h> 23 23 #include <linux/kernel.h> 24 24 #include <linux/percpu.h> 25 + #include <linux/clk-provider.h> 25 26 #include <linux/cpu.h> 26 27 #include <linux/of_fdt.h> 27 28 #include <linux/of_platform.h> ··· 277 276 278 277 static int __init xtensa_device_probe(void) 279 278 { 279 + of_clk_init(NULL); 280 280 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 281 281 return 0; 282 282 }
+1
arch/xtensa/kernel/time.c
··· 30 30 #include <asm/platform.h> 31 31 32 32 unsigned long ccount_freq; /* ccount Hz */ 33 + EXPORT_SYMBOL(ccount_freq); 33 34 34 35 static cycle_t ccount_read(struct clocksource *cs) 35 36 {
+1 -1
arch/xtensa/kernel/vectors.S
··· 235 235 236 236 /* Check for overflow/underflow exception, jump if overflow. */ 237 237 238 - _bbci.l a0, 6, _DoubleExceptionVector_WindowOverflow 238 + bbci.l a0, 6, _DoubleExceptionVector_WindowOverflow 239 239 240 240 /* 241 241 * Restart window underflow exception.
-2
arch/xtensa/kernel/xtensa_ksyms.c
··· 122 122 EXPORT_SYMBOL(insl); 123 123 124 124 extern long common_exception_return; 125 - extern long _spill_registers; 126 125 EXPORT_SYMBOL(common_exception_return); 127 - EXPORT_SYMBOL(_spill_registers); 128 126 129 127 #ifdef CONFIG_FUNCTION_TRACER 130 128 EXPORT_SYMBOL(_mcount);
+9 -4
arch/xtensa/mm/init.c
··· 90 90 91 91 92 92 /* 93 - * Initialize the bootmem system and give it all the memory we have available. 93 + * Initialize the bootmem system and give it all low memory we have available. 94 94 */ 95 95 96 96 void __init bootmem_init(void) ··· 142 142 143 143 /* Add all remaining memory pieces into the bootmem map */ 144 144 145 - for (i=0; i<sysmem.nr_banks; i++) 146 - free_bootmem(sysmem.bank[i].start, 147 - sysmem.bank[i].end - sysmem.bank[i].start); 145 + for (i = 0; i < sysmem.nr_banks; i++) { 146 + if (sysmem.bank[i].start >> PAGE_SHIFT < max_low_pfn) { 147 + unsigned long end = min(max_low_pfn << PAGE_SHIFT, 148 + sysmem.bank[i].end); 149 + free_bootmem(sysmem.bank[i].start, 150 + end - sysmem.bank[i].start); 151 + } 152 + } 148 153 149 154 } 150 155
+1 -1
arch/xtensa/mm/mmu.c
··· 39 39 set_itlbcfg_register(0); 40 40 set_dtlbcfg_register(0); 41 41 #endif 42 - #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && CONFIG_OF 42 + #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF) 43 43 /* 44 44 * Update the IO area mapping in case xtensa_kio_paddr has changed 45 45 */
+4 -3
arch/xtensa/platforms/xtfpga/setup.c
··· 135 135 136 136 static int __init machine_setup(void) 137 137 { 138 - struct device_node *serial; 138 + struct device_node *clock; 139 139 struct device_node *eth = NULL; 140 140 141 - for_each_compatible_node(serial, NULL, "ns16550a") 142 - update_clock_frequency(serial); 141 + for_each_node_by_name(clock, "main-oscillator") 142 + update_clock_frequency(clock); 143 143 144 144 if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc"))) 145 145 update_local_mac(eth); ··· 290 290 * knows whether they set it correctly on the DIP switches. 291 291 */ 292 292 pr_info("XTFPGA: Ethernet MAC %pM\n", ethoc_pdata.hwaddr); 293 + ethoc_pdata.eth_clkfreq = *(long *)XTFPGA_CLKFRQ_VADDR; 293 294 294 295 return 0; 295 296 }
+2 -7
arch/xtensa/variants/fsf/include/variant/tie.h
··· 18 18 #define XCHAL_CP_MASK 0x00 /* bitmask of all CPs by ID */ 19 19 #define XCHAL_CP_PORT_MASK 0x00 /* bitmask of only port CPs */ 20 20 21 - /* Basic parameters of each coprocessor: */ 22 - #define XCHAL_CP7_NAME "XTIOP" 23 - #define XCHAL_CP7_IDENT XTIOP 24 - #define XCHAL_CP7_SA_SIZE 0 /* size of state save area */ 25 - #define XCHAL_CP7_SA_ALIGN 1 /* min alignment of save area */ 26 - #define XCHAL_CP_ID_XTIOP 7 /* coprocessor ID (0..7) */ 27 - 28 21 /* Filler info for unassigned coprocessors, to simplify arrays etc: */ 29 22 #define XCHAL_NCP_SA_SIZE 0 30 23 #define XCHAL_NCP_SA_ALIGN 1 ··· 35 42 #define XCHAL_CP5_SA_ALIGN 1 36 43 #define XCHAL_CP6_SA_SIZE 0 37 44 #define XCHAL_CP6_SA_ALIGN 1 45 + #define XCHAL_CP7_SA_SIZE 0 46 + #define XCHAL_CP7_SA_ALIGN 1 38 47 39 48 /* Save area for non-coprocessor optional and custom (TIE) state: */ 40 49 #define XCHAL_NCP_SA_SIZE 0
+32 -37
drivers/acpi/processor_throttling.c
··· 56 56 int target_state; /* target T-state */ 57 57 }; 58 58 59 + struct acpi_processor_throttling_arg { 60 + struct acpi_processor *pr; 61 + int target_state; 62 + bool force; 63 + }; 64 + 59 65 #define THROTTLING_PRECHANGE (1) 60 66 #define THROTTLING_POSTCHANGE (2) 61 67 ··· 1066 1060 return 0; 1067 1061 } 1068 1062 1063 + static long acpi_processor_throttling_fn(void *data) 1064 + { 1065 + struct acpi_processor_throttling_arg *arg = data; 1066 + struct acpi_processor *pr = arg->pr; 1067 + 1068 + return pr->throttling.acpi_processor_set_throttling(pr, 1069 + arg->target_state, arg->force); 1070 + } 1071 + 1069 1072 int acpi_processor_set_throttling(struct acpi_processor *pr, 1070 1073 int state, bool force) 1071 1074 { 1072 - cpumask_var_t saved_mask; 1073 1075 int ret = 0; 1074 1076 unsigned int i; 1075 1077 struct acpi_processor *match_pr; 1076 1078 struct acpi_processor_throttling *p_throttling; 1079 + struct acpi_processor_throttling_arg arg; 1077 1080 struct throttling_tstate t_state; 1078 - cpumask_var_t online_throttling_cpus; 1079 1081 1080 1082 if (!pr) 1081 1083 return -EINVAL; ··· 1094 1080 if ((state < 0) || (state > (pr->throttling.state_count - 1))) 1095 1081 return -EINVAL; 1096 1082 1097 - if (!alloc_cpumask_var(&saved_mask, GFP_KERNEL)) 1098 - return -ENOMEM; 1099 - 1100 - if (!alloc_cpumask_var(&online_throttling_cpus, GFP_KERNEL)) { 1101 - free_cpumask_var(saved_mask); 1102 - return -ENOMEM; 1103 - } 1104 - 1105 1083 if (cpu_is_offline(pr->id)) { 1106 1084 /* 1107 1085 * the cpu pointed by pr->id is offline. Unnecessary to change ··· 1102 1096 return -ENODEV; 1103 1097 } 1104 1098 1105 - cpumask_copy(saved_mask, &current->cpus_allowed); 1106 1099 t_state.target_state = state; 1107 1100 p_throttling = &(pr->throttling); 1108 - cpumask_and(online_throttling_cpus, cpu_online_mask, 1109 - p_throttling->shared_cpu_map); 1101 + 1110 1102 /* 1111 1103 * The throttling notifier will be called for every 1112 1104 * affected cpu in order to get one proper T-state. 1113 1105 * The notifier event is THROTTLING_PRECHANGE. 1114 1106 */ 1115 - for_each_cpu(i, online_throttling_cpus) { 1107 + for_each_cpu_and(i, cpu_online_mask, p_throttling->shared_cpu_map) { 1116 1108 t_state.cpu = i; 1117 1109 acpi_processor_throttling_notifier(THROTTLING_PRECHANGE, 1118 1110 &t_state); ··· 1122 1118 * it can be called only for the cpu pointed by pr. 1123 1119 */ 1124 1120 if (p_throttling->shared_type == DOMAIN_COORD_TYPE_SW_ANY) { 1125 - /* FIXME: use work_on_cpu() */ 1126 - if (set_cpus_allowed_ptr(current, cpumask_of(pr->id))) { 1127 - /* Can't migrate to the pr->id CPU. Exit */ 1128 - ret = -ENODEV; 1129 - goto exit; 1130 - } 1131 - ret = p_throttling->acpi_processor_set_throttling(pr, 1132 - t_state.target_state, force); 1121 + arg.pr = pr; 1122 + arg.target_state = state; 1123 + arg.force = force; 1124 + ret = work_on_cpu(pr->id, acpi_processor_throttling_fn, &arg); 1133 1125 } else { 1134 1126 /* 1135 1127 * When the T-state coordination is SW_ALL or HW_ALL, 1136 1128 * it is necessary to set T-state for every affected 1137 1129 * cpus. 1138 1130 */ 1139 - for_each_cpu(i, online_throttling_cpus) { 1131 + for_each_cpu_and(i, cpu_online_mask, 1132 + p_throttling->shared_cpu_map) { 1140 1133 match_pr = per_cpu(processors, i); 1141 1134 /* 1142 1135 * If the pointer is invalid, we will report the ··· 1154 1153 "on CPU %d\n", i)); 1155 1154 continue; 1156 1155 } 1157 - t_state.cpu = i; 1158 - /* FIXME: use work_on_cpu() */ 1159 - if (set_cpus_allowed_ptr(current, cpumask_of(i))) 1160 - continue; 1161 - ret = match_pr->throttling. 1162 - acpi_processor_set_throttling( 1163 - match_pr, t_state.target_state, force); 1156 + 1157 + arg.pr = match_pr; 1158 + arg.target_state = state; 1159 + arg.force = force; 1160 + ret = work_on_cpu(pr->id, acpi_processor_throttling_fn, 1161 + &arg); 1164 1162 } 1165 1163 } 1166 1164 /* ··· 1168 1168 * affected cpu to update the T-states. 1169 1169 * The notifier event is THROTTLING_POSTCHANGE 1170 1170 */ 1171 - for_each_cpu(i, online_throttling_cpus) { 1171 + for_each_cpu_and(i, cpu_online_mask, p_throttling->shared_cpu_map) { 1172 1172 t_state.cpu = i; 1173 1173 acpi_processor_throttling_notifier(THROTTLING_POSTCHANGE, 1174 1174 &t_state); 1175 1175 } 1176 - /* restore the previous state */ 1177 - /* FIXME: use work_on_cpu() */ 1178 - set_cpus_allowed_ptr(current, saved_mask); 1179 - exit: 1180 - free_cpumask_var(online_throttling_cpus); 1181 - free_cpumask_var(saved_mask); 1176 + 1182 1177 return ret; 1183 1178 } 1184 1179
+1
drivers/base/firmware_class.c
··· 1580 1580 switch (mode) { 1581 1581 case PM_HIBERNATION_PREPARE: 1582 1582 case PM_SUSPEND_PREPARE: 1583 + case PM_RESTORE_PREPARE: 1583 1584 kill_requests_without_uevent(); 1584 1585 device_cache_fw_images(); 1585 1586 break;
+18 -10
drivers/cpufreq/intel_pstate.c
··· 39 39 #define BYT_TURBO_RATIOS 0x66c 40 40 41 41 42 - #define FRAC_BITS 8 42 + #define FRAC_BITS 6 43 43 #define int_tofp(X) ((int64_t)(X) << FRAC_BITS) 44 44 #define fp_toint(X) ((X) >> FRAC_BITS) 45 + #define FP_ROUNDUP(X) ((X) += 1 << FRAC_BITS) 45 46 46 47 static inline int32_t mul_fp(int32_t x, int32_t y) 47 48 { ··· 557 556 static inline void intel_pstate_calc_busy(struct cpudata *cpu, 558 557 struct sample *sample) 559 558 { 560 - u64 core_pct; 561 - u64 c0_pct; 559 + int32_t core_pct; 560 + int32_t c0_pct; 562 561 563 - core_pct = div64_u64(sample->aperf * 100, sample->mperf); 562 + core_pct = div_fp(int_tofp((sample->aperf)), 563 + int_tofp((sample->mperf))); 564 + core_pct = mul_fp(core_pct, int_tofp(100)); 565 + FP_ROUNDUP(core_pct); 564 566 565 - c0_pct = div64_u64(sample->mperf * 100, sample->tsc); 567 + c0_pct = div_fp(int_tofp(sample->mperf), int_tofp(sample->tsc)); 568 + 566 569 sample->freq = fp_toint( 567 - mul_fp(int_tofp(cpu->pstate.max_pstate), 568 - int_tofp(core_pct * 1000))); 570 + mul_fp(int_tofp(cpu->pstate.max_pstate * 1000), core_pct)); 569 571 570 - sample->core_pct_busy = mul_fp(int_tofp(core_pct), 571 - div_fp(int_tofp(c0_pct + 1), int_tofp(100))); 572 + sample->core_pct_busy = mul_fp(core_pct, c0_pct); 572 573 } 573 574 574 575 static inline void intel_pstate_sample(struct cpudata *cpu) ··· 581 578 rdmsrl(MSR_IA32_APERF, aperf); 582 579 rdmsrl(MSR_IA32_MPERF, mperf); 583 580 tsc = native_read_tsc(); 581 + 582 + aperf = aperf >> FRAC_BITS; 583 + mperf = mperf >> FRAC_BITS; 584 + tsc = tsc >> FRAC_BITS; 584 585 585 586 cpu->sample_ptr = (cpu->sample_ptr + 1) % SAMPLE_COUNT; 586 587 cpu->samples[cpu->sample_ptr].aperf = aperf; ··· 617 610 core_busy = cpu->samples[cpu->sample_ptr].core_pct_busy; 618 611 max_pstate = int_tofp(cpu->pstate.max_pstate); 619 612 current_pstate = int_tofp(cpu->pstate.current_pstate); 620 - return mul_fp(core_busy, div_fp(max_pstate, current_pstate)); 613 + core_busy = mul_fp(core_busy, div_fp(max_pstate, current_pstate)); 614 + return FP_ROUNDUP(core_busy); 621 615 } 622 616 623 617 static inline void intel_pstate_adjust_busy_pstate(struct cpudata *cpu)
+1
drivers/dma/imx-sdma.c
··· 449 449 { .compatible = "fsl,imx51-sdma", .data = &sdma_imx51, }, 450 450 { .compatible = "fsl,imx35-sdma", .data = &sdma_imx35, }, 451 451 { .compatible = "fsl,imx31-sdma", .data = &sdma_imx31, }, 452 + { .compatible = "fsl,imx25-sdma", .data = &sdma_imx25, }, 452 453 { /* sentinel */ } 453 454 }; 454 455 MODULE_DEVICE_TABLE(of, sdma_dt_ids);
+45 -7
drivers/dma/ioat/dma.c
··· 77 77 attnstatus = readl(instance->reg_base + IOAT_ATTNSTATUS_OFFSET); 78 78 for_each_set_bit(bit, &attnstatus, BITS_PER_LONG) { 79 79 chan = ioat_chan_by_index(instance, bit); 80 - tasklet_schedule(&chan->cleanup_task); 80 + if (test_bit(IOAT_RUN, &chan->state)) 81 + tasklet_schedule(&chan->cleanup_task); 81 82 } 82 83 83 84 writeb(intrctrl, instance->reg_base + IOAT_INTRCTRL_OFFSET); ··· 94 93 { 95 94 struct ioat_chan_common *chan = data; 96 95 97 - tasklet_schedule(&chan->cleanup_task); 96 + if (test_bit(IOAT_RUN, &chan->state)) 97 + tasklet_schedule(&chan->cleanup_task); 98 98 99 99 return IRQ_HANDLED; 100 100 } ··· 118 116 chan->timer.function = device->timer_fn; 119 117 chan->timer.data = data; 120 118 tasklet_init(&chan->cleanup_task, device->cleanup_fn, data); 121 - tasklet_disable(&chan->cleanup_task); 122 119 } 123 120 124 121 /** ··· 355 354 writel(((u64) chan->completion_dma) >> 32, 356 355 chan->reg_base + IOAT_CHANCMP_OFFSET_HIGH); 357 356 358 - tasklet_enable(&chan->cleanup_task); 357 + set_bit(IOAT_RUN, &chan->state); 359 358 ioat1_dma_start_null_desc(ioat); /* give chain to dma device */ 360 359 dev_dbg(to_dev(chan), "%s: allocated %d descriptors\n", 361 360 __func__, ioat->desccount); 362 361 return ioat->desccount; 362 + } 363 + 364 + void ioat_stop(struct ioat_chan_common *chan) 365 + { 366 + struct ioatdma_device *device = chan->device; 367 + struct pci_dev *pdev = device->pdev; 368 + int chan_id = chan_num(chan); 369 + struct msix_entry *msix; 370 + 371 + /* 1/ stop irq from firing tasklets 372 + * 2/ stop the tasklet from re-arming irqs 373 + */ 374 + clear_bit(IOAT_RUN, &chan->state); 375 + 376 + /* flush inflight interrupts */ 377 + switch (device->irq_mode) { 378 + case IOAT_MSIX: 379 + msix = &device->msix_entries[chan_id]; 380 + synchronize_irq(msix->vector); 381 + break; 382 + case IOAT_MSI: 383 + case IOAT_INTX: 384 + synchronize_irq(pdev->irq); 385 + break; 386 + default: 387 + break; 388 + } 389 + 390 + /* flush inflight timers */ 391 + del_timer_sync(&chan->timer); 392 + 393 + /* flush inflight tasklet runs */ 394 + tasklet_kill(&chan->cleanup_task); 395 + 396 + /* final cleanup now that everything is quiesced and can't re-arm */ 397 + device->cleanup_fn((unsigned long) &chan->common); 363 398 } 364 399 365 400 /** ··· 416 379 if (ioat->desccount == 0) 417 380 return; 418 381 419 - tasklet_disable(&chan->cleanup_task); 420 - del_timer_sync(&chan->timer); 421 - ioat1_cleanup(ioat); 382 + ioat_stop(chan); 422 383 423 384 /* Delay 100ms after reset to allow internal DMA logic to quiesce 424 385 * before removing DMA descriptor resources. ··· 561 526 static void ioat1_cleanup_event(unsigned long data) 562 527 { 563 528 struct ioat_dma_chan *ioat = to_ioat_chan((void *) data); 529 + struct ioat_chan_common *chan = &ioat->base; 564 530 565 531 ioat1_cleanup(ioat); 532 + if (!test_bit(IOAT_RUN, &chan->state)) 533 + return; 566 534 writew(IOAT_CHANCTRL_RUN, ioat->base.reg_base + IOAT_CHANCTRL_OFFSET); 567 535 } 568 536
+1
drivers/dma/ioat/dma.h
··· 356 356 void ioat_kobject_add(struct ioatdma_device *device, struct kobj_type *type); 357 357 void ioat_kobject_del(struct ioatdma_device *device); 358 358 int ioat_dma_setup_interrupts(struct ioatdma_device *device); 359 + void ioat_stop(struct ioat_chan_common *chan); 359 360 extern const struct sysfs_ops ioat_sysfs_ops; 360 361 extern struct ioat_sysfs_entry ioat_version_attr; 361 362 extern struct ioat_sysfs_entry ioat_cap_attr;
+5 -6
drivers/dma/ioat/dma_v2.c
··· 190 190 void ioat2_cleanup_event(unsigned long data) 191 191 { 192 192 struct ioat2_dma_chan *ioat = to_ioat2_chan((void *) data); 193 + struct ioat_chan_common *chan = &ioat->base; 193 194 194 195 ioat2_cleanup(ioat); 196 + if (!test_bit(IOAT_RUN, &chan->state)) 197 + return; 195 198 writew(IOAT_CHANCTRL_RUN, ioat->base.reg_base + IOAT_CHANCTRL_OFFSET); 196 199 } 197 200 ··· 556 553 ioat->issued = 0; 557 554 ioat->tail = 0; 558 555 ioat->alloc_order = order; 556 + set_bit(IOAT_RUN, &chan->state); 559 557 spin_unlock_bh(&ioat->prep_lock); 560 558 spin_unlock_bh(&chan->cleanup_lock); 561 559 562 - tasklet_enable(&chan->cleanup_task); 563 560 ioat2_start_null_desc(ioat); 564 561 565 562 /* check that we got off the ground */ ··· 569 566 } while (i++ < 20 && !is_ioat_active(status) && !is_ioat_idle(status)); 570 567 571 568 if (is_ioat_active(status) || is_ioat_idle(status)) { 572 - set_bit(IOAT_RUN, &chan->state); 573 569 return 1 << ioat->alloc_order; 574 570 } else { 575 571 u32 chanerr = readl(chan->reg_base + IOAT_CHANERR_OFFSET); ··· 811 809 if (!ioat->ring) 812 810 return; 813 811 814 - tasklet_disable(&chan->cleanup_task); 815 - del_timer_sync(&chan->timer); 816 - device->cleanup_fn((unsigned long) c); 812 + ioat_stop(chan); 817 813 device->reset_hw(chan); 818 - clear_bit(IOAT_RUN, &chan->state); 819 814 820 815 spin_lock_bh(&chan->cleanup_lock); 821 816 spin_lock_bh(&ioat->prep_lock);
+3
drivers/dma/ioat/dma_v3.c
··· 464 464 static void ioat3_cleanup_event(unsigned long data) 465 465 { 466 466 struct ioat2_dma_chan *ioat = to_ioat2_chan((void *) data); 467 + struct ioat_chan_common *chan = &ioat->base; 467 468 468 469 ioat3_cleanup(ioat); 470 + if (!test_bit(IOAT_RUN, &chan->state)) 471 + return; 469 472 writew(IOAT_CHANCTRL_RUN, ioat->base.reg_base + IOAT_CHANCTRL_OFFSET); 470 473 } 471 474
+3 -1
drivers/dma/ste_dma40.c
··· 1641 1641 struct d40_chan *d40c = (struct d40_chan *) data; 1642 1642 struct d40_desc *d40d; 1643 1643 unsigned long flags; 1644 + bool callback_active; 1644 1645 dma_async_tx_callback callback; 1645 1646 void *callback_param; 1646 1647 ··· 1669 1668 } 1670 1669 1671 1670 /* Callback to client */ 1671 + callback_active = !!(d40d->txd.flags & DMA_PREP_INTERRUPT); 1672 1672 callback = d40d->txd.callback; 1673 1673 callback_param = d40d->txd.callback_param; 1674 1674 ··· 1692 1690 1693 1691 spin_unlock_irqrestore(&d40c->lock, flags); 1694 1692 1695 - if (callback && (d40d->txd.flags & DMA_PREP_INTERRUPT)) 1693 + if (callback_active && callback) 1696 1694 callback(callback_param); 1697 1695 1698 1696 return;
+20 -18
drivers/edac/i7300_edac.c
··· 943 943 944 944 /* Attempt to 'get' the MCH register we want */ 945 945 pdev = NULL; 946 - while (!pvt->pci_dev_16_1_fsb_addr_map || 947 - !pvt->pci_dev_16_2_fsb_err_regs) { 948 - pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 949 - PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, pdev); 950 - if (!pdev) { 951 - /* End of list, leave */ 952 - i7300_printk(KERN_ERR, 953 - "'system address,Process Bus' " 954 - "device not found:" 955 - "vendor 0x%x device 0x%x ERR funcs " 956 - "(broken BIOS?)\n", 957 - PCI_VENDOR_ID_INTEL, 958 - PCI_DEVICE_ID_INTEL_I7300_MCH_ERR); 959 - goto error; 960 - } 961 - 946 + while ((pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 947 + PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, 948 + pdev))) { 962 949 /* Store device 16 funcs 1 and 2 */ 963 950 switch (PCI_FUNC(pdev->devfn)) { 964 951 case 1: 965 - pvt->pci_dev_16_1_fsb_addr_map = pdev; 952 + if (!pvt->pci_dev_16_1_fsb_addr_map) 953 + pvt->pci_dev_16_1_fsb_addr_map = 954 + pci_dev_get(pdev); 966 955 break; 967 956 case 2: 968 - pvt->pci_dev_16_2_fsb_err_regs = pdev; 957 + if (!pvt->pci_dev_16_2_fsb_err_regs) 958 + pvt->pci_dev_16_2_fsb_err_regs = 959 + pci_dev_get(pdev); 969 960 break; 970 961 } 962 + } 963 + 964 + if (!pvt->pci_dev_16_1_fsb_addr_map || 965 + !pvt->pci_dev_16_2_fsb_err_regs) { 966 + /* At least one device was not found */ 967 + i7300_printk(KERN_ERR, 968 + "'system address,Process Bus' device not found:" 969 + "vendor 0x%x device 0x%x ERR funcs (broken BIOS?)\n", 970 + PCI_VENDOR_ID_INTEL, 971 + PCI_DEVICE_ID_INTEL_I7300_MCH_ERR); 972 + goto error; 971 973 } 972 974 973 975 edac_dbg(1, "System Address, processor bus- PCI Bus ID: %s %x:%x\n",
+7 -2
drivers/edac/i7core_edac.c
··· 1334 1334 * is at addr 8086:2c40, instead of 8086:2c41. So, we need 1335 1335 * to probe for the alternate address in case of failure 1336 1336 */ 1337 - if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) 1337 + if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) { 1338 + pci_dev_get(*prev); /* pci_get_device will put it */ 1338 1339 pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 1339 1340 PCI_DEVICE_ID_INTEL_I7_NONCORE_ALT, *prev); 1341 + } 1340 1342 1341 - if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && !pdev) 1343 + if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && 1344 + !pdev) { 1345 + pci_dev_get(*prev); /* pci_get_device will put it */ 1342 1346 pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 1343 1347 PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_ALT, 1344 1348 *prev); 1349 + } 1345 1350 1346 1351 if (!pdev) { 1347 1352 if (*prev) {
-12
drivers/extcon/extcon-arizona.c
··· 222 222 struct snd_soc_dapm_context *dapm = arizona->dapm; 223 223 int ret; 224 224 225 - mutex_lock(&dapm->card->dapm_mutex); 226 - 227 225 ret = snd_soc_dapm_force_enable_pin(dapm, widget); 228 226 if (ret != 0) 229 227 dev_warn(arizona->dev, "Failed to enable %s: %d\n", 230 228 widget, ret); 231 229 232 - mutex_unlock(&dapm->card->dapm_mutex); 233 - 234 230 snd_soc_dapm_sync(dapm); 235 231 236 232 if (!arizona->pdata.micd_force_micbias) { 237 - mutex_lock(&dapm->card->dapm_mutex); 238 - 239 233 ret = snd_soc_dapm_disable_pin(arizona->dapm, widget); 240 234 if (ret != 0) 241 235 dev_warn(arizona->dev, "Failed to disable %s: %d\n", 242 236 widget, ret); 243 - 244 - mutex_unlock(&dapm->card->dapm_mutex); 245 237 246 238 snd_soc_dapm_sync(dapm); 247 239 } ··· 296 304 ARIZONA_MICD_ENA, 0, 297 305 &change); 298 306 299 - mutex_lock(&dapm->card->dapm_mutex); 300 - 301 307 ret = snd_soc_dapm_disable_pin(dapm, widget); 302 308 if (ret != 0) 303 309 dev_warn(arizona->dev, 304 310 "Failed to disable %s: %d\n", 305 311 widget, ret); 306 - 307 - mutex_unlock(&dapm->card->dapm_mutex); 308 312 309 313 snd_soc_dapm_sync(dapm); 310 314
+1 -1
drivers/fmc/fmc-write-eeprom.c
··· 27 27 /* The "file=" is like the generic "gateware=" used elsewhere */ 28 28 static char *fwe_file[FMC_MAX_CARDS]; 29 29 static int fwe_file_n; 30 - module_param_array_named(file, fwe_file, charp, &fwe_file_n, 444); 30 + module_param_array_named(file, fwe_file, charp, &fwe_file_n, 0444); 31 31 32 32 static int fwe_run_tlv(struct fmc_device *fmc, const struct firmware *fw, 33 33 int write)
+15 -1
drivers/gpu/drm/radeon/atombios_crtc.c
··· 1774 1774 return ATOM_PPLL1; 1775 1775 DRM_ERROR("unable to allocate a PPLL\n"); 1776 1776 return ATOM_PPLL_INVALID; 1777 + } else if (ASIC_IS_DCE41(rdev)) { 1778 + /* Don't share PLLs on DCE4.1 chips */ 1779 + if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(radeon_crtc->encoder))) { 1780 + if (rdev->clock.dp_extclk) 1781 + /* skip PPLL programming if using ext clock */ 1782 + return ATOM_PPLL_INVALID; 1783 + } 1784 + pll_in_use = radeon_get_pll_use_mask(crtc); 1785 + if (!(pll_in_use & (1 << ATOM_PPLL1))) 1786 + return ATOM_PPLL1; 1787 + if (!(pll_in_use & (1 << ATOM_PPLL2))) 1788 + return ATOM_PPLL2; 1789 + DRM_ERROR("unable to allocate a PPLL\n"); 1790 + return ATOM_PPLL_INVALID; 1777 1791 } else if (ASIC_IS_DCE4(rdev)) { 1778 1792 /* in DP mode, the DP ref clock can come from PPLL, DCPLL, or ext clock, 1779 1793 * depending on the asic: ··· 1815 1801 if (pll != ATOM_PPLL_INVALID) 1816 1802 return pll; 1817 1803 } 1818 - } else if (!ASIC_IS_DCE41(rdev)) { /* Don't share PLLs on DCE4.1 chips */ 1804 + } else { 1819 1805 /* use the same PPLL for all monitors with the same clock */ 1820 1806 pll = radeon_get_shared_nondp_ppll(crtc); 1821 1807 if (pll != ATOM_PPLL_INVALID)
+9 -6
drivers/gpu/drm/radeon/dce6_afmt.c
··· 278 278 return !ASIC_IS_NODCE(rdev); 279 279 } 280 280 281 - static void dce6_audio_enable(struct radeon_device *rdev, 282 - struct r600_audio_pin *pin, 283 - bool enable) 281 + void dce6_audio_enable(struct radeon_device *rdev, 282 + struct r600_audio_pin *pin, 283 + bool enable) 284 284 { 285 + if (!pin) 286 + return; 287 + 285 288 WREG32_ENDPOINT(pin->offset, AZ_F0_CODEC_PIN_CONTROL_HOTPLUG_CONTROL, 286 - AUDIO_ENABLED); 287 - DRM_INFO("%s audio %d support\n", enable ? "Enabling" : "Disabling", pin->id); 289 + enable ? AUDIO_ENABLED : 0); 288 290 } 289 291 290 292 static const u32 pin_offsets[7] = ··· 325 323 rdev->audio.pin[i].connected = false; 326 324 rdev->audio.pin[i].offset = pin_offsets[i]; 327 325 rdev->audio.pin[i].id = i; 328 - dce6_audio_enable(rdev, &rdev->audio.pin[i], true); 326 + /* disable audio. it will be set up later */ 327 + dce6_audio_enable(rdev, &rdev->audio.pin[i], false); 329 328 } 330 329 331 330 return 0;
+1 -1
drivers/gpu/drm/radeon/evergreen.c
··· 5475 5475 radeon_wb_fini(rdev); 5476 5476 radeon_ib_pool_fini(rdev); 5477 5477 radeon_irq_kms_fini(rdev); 5478 - evergreen_pcie_gart_fini(rdev); 5479 5478 uvd_v1_0_fini(rdev); 5480 5479 radeon_uvd_fini(rdev); 5480 + evergreen_pcie_gart_fini(rdev); 5481 5481 r600_vram_scratch_fini(rdev); 5482 5482 radeon_gem_fini(rdev); 5483 5483 radeon_fence_driver_fini(rdev);
+15 -11
drivers/gpu/drm/radeon/evergreen_hdmi.c
··· 306 306 return; 307 307 offset = dig->afmt->offset; 308 308 309 + /* disable audio prior to setting up hw */ 310 + if (ASIC_IS_DCE6(rdev)) { 311 + dig->afmt->pin = dce6_audio_get_pin(rdev); 312 + dce6_audio_enable(rdev, dig->afmt->pin, false); 313 + } else { 314 + dig->afmt->pin = r600_audio_get_pin(rdev); 315 + r600_audio_enable(rdev, dig->afmt->pin, false); 316 + } 317 + 309 318 evergreen_audio_set_dto(encoder, mode->clock); 310 319 311 320 WREG32(HDMI_VBI_PACKET_CONTROL + offset, ··· 418 409 WREG32(AFMT_RAMP_CONTROL1 + offset, 0x007FFFFF); 419 410 WREG32(AFMT_RAMP_CONTROL2 + offset, 0x00000001); 420 411 WREG32(AFMT_RAMP_CONTROL3 + offset, 0x00000001); 412 + 413 + /* enable audio after to setting up hw */ 414 + if (ASIC_IS_DCE6(rdev)) 415 + dce6_audio_enable(rdev, dig->afmt->pin, true); 416 + else 417 + r600_audio_enable(rdev, dig->afmt->pin, true); 421 418 } 422 419 423 420 void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable) 424 421 { 425 - struct drm_device *dev = encoder->dev; 426 - struct radeon_device *rdev = dev->dev_private; 427 422 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 428 423 struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; 429 424 ··· 439 426 return; 440 427 if (!enable && !dig->afmt->enabled) 441 428 return; 442 - 443 - if (enable) { 444 - if (ASIC_IS_DCE6(rdev)) 445 - dig->afmt->pin = dce6_audio_get_pin(rdev); 446 - else 447 - dig->afmt->pin = r600_audio_get_pin(rdev); 448 - } else { 449 - dig->afmt->pin = NULL; 450 - } 451 429 452 430 dig->afmt->enabled = enable; 453 431
+8 -6
drivers/gpu/drm/radeon/r600_audio.c
··· 142 142 } 143 143 144 144 /* enable the audio stream */ 145 - static void r600_audio_enable(struct radeon_device *rdev, 146 - struct r600_audio_pin *pin, 147 - bool enable) 145 + void r600_audio_enable(struct radeon_device *rdev, 146 + struct r600_audio_pin *pin, 147 + bool enable) 148 148 { 149 149 u32 value = 0; 150 + 151 + if (!pin) 152 + return; 150 153 151 154 if (ASIC_IS_DCE4(rdev)) { 152 155 if (enable) { ··· 161 158 WREG32_P(R600_AUDIO_ENABLE, 162 159 enable ? 0x81000000 : 0x0, ~0x81000000); 163 160 } 164 - DRM_INFO("%s audio %d support\n", enable ? "Enabling" : "Disabling", pin->id); 165 161 } 166 162 167 163 /* ··· 180 178 rdev->audio.pin[0].status_bits = 0; 181 179 rdev->audio.pin[0].category_code = 0; 182 180 rdev->audio.pin[0].id = 0; 183 - 184 - r600_audio_enable(rdev, &rdev->audio.pin[0], true); 181 + /* disable audio. it will be set up later */ 182 + r600_audio_enable(rdev, &rdev->audio.pin[0], false); 185 183 186 184 return 0; 187 185 }
+7 -8
drivers/gpu/drm/radeon/r600_hdmi.c
··· 329 329 u8 *sadb; 330 330 int sad_count; 331 331 332 - /* XXX: setting this register causes hangs on some asics */ 333 - return; 334 - 335 332 list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) { 336 333 if (connector->encoder == encoder) { 337 334 radeon_connector = to_radeon_connector(connector); ··· 457 460 return; 458 461 offset = dig->afmt->offset; 459 462 463 + /* disable audio prior to setting up hw */ 464 + dig->afmt->pin = r600_audio_get_pin(rdev); 465 + r600_audio_enable(rdev, dig->afmt->pin, false); 466 + 460 467 r600_audio_set_dto(encoder, mode->clock); 461 468 462 469 WREG32(HDMI0_VBI_PACKET_CONTROL + offset, ··· 532 531 WREG32(HDMI0_RAMP_CONTROL3 + offset, 0x00000001); 533 532 534 533 r600_hdmi_audio_workaround(encoder); 534 + 535 + /* enable audio after to setting up hw */ 536 + r600_audio_enable(rdev, dig->afmt->pin, true); 535 537 } 536 538 537 539 /* ··· 654 650 return; 655 651 if (!enable && !dig->afmt->enabled) 656 652 return; 657 - 658 - if (enable) 659 - dig->afmt->pin = r600_audio_get_pin(rdev); 660 - else 661 - dig->afmt->pin = NULL; 662 653 663 654 /* Older chipsets require setting HDMI and routing manually */ 664 655 if (!ASIC_IS_DCE3(rdev)) {
+6
drivers/gpu/drm/radeon/radeon.h
··· 2747 2747 void r600_audio_update_hdmi(struct work_struct *work); 2748 2748 struct r600_audio_pin *r600_audio_get_pin(struct radeon_device *rdev); 2749 2749 struct r600_audio_pin *dce6_audio_get_pin(struct radeon_device *rdev); 2750 + void r600_audio_enable(struct radeon_device *rdev, 2751 + struct r600_audio_pin *pin, 2752 + bool enable); 2753 + void dce6_audio_enable(struct radeon_device *rdev, 2754 + struct r600_audio_pin *pin, 2755 + bool enable); 2750 2756 2751 2757 /* 2752 2758 * R600 vram scratch functions
+2 -1
drivers/gpu/drm/radeon/radeon_atpx_handler.c
··· 219 219 memcpy(&output, info->buffer.pointer, size); 220 220 221 221 /* TODO: check version? */ 222 - printk("ATPX version %u\n", output.version); 222 + printk("ATPX version %u, functions 0x%08x\n", 223 + output.version, output.function_bits); 223 224 224 225 radeon_atpx_parse_functions(&atpx->functions, output.function_bits); 225 226
+6
drivers/gpu/drm/radeon/radeon_kms.c
··· 537 537 538 538 radeon_vm_init(rdev, &fpriv->vm); 539 539 540 + r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); 541 + if (r) 542 + return r; 543 + 540 544 /* map the ib pool buffer read only into 541 545 * virtual address space */ 542 546 bo_va = radeon_vm_bo_add(rdev, &fpriv->vm, ··· 548 544 r = radeon_vm_bo_set_addr(rdev, bo_va, RADEON_VA_IB_OFFSET, 549 545 RADEON_VM_PAGE_READABLE | 550 546 RADEON_VM_PAGE_SNOOPED); 547 + 548 + radeon_bo_unreserve(rdev->ring_tmp_bo.bo); 551 549 if (r) { 552 550 radeon_vm_fini(rdev, &fpriv->vm); 553 551 kfree(fpriv);
+2
drivers/gpu/drm/radeon/radeon_uvd.c
··· 171 171 172 172 radeon_bo_unref(&rdev->uvd.vcpu_bo); 173 173 174 + radeon_ring_fini(rdev, &rdev->ring[R600_RING_TYPE_UVD_INDEX]); 175 + 174 176 release_firmware(rdev->uvd_fw); 175 177 } 176 178
+1 -1
drivers/gpu/drm/radeon/rv770.c
··· 1955 1955 radeon_wb_fini(rdev); 1956 1956 radeon_ib_pool_fini(rdev); 1957 1957 radeon_irq_kms_fini(rdev); 1958 - rv770_pcie_gart_fini(rdev); 1959 1958 uvd_v1_0_fini(rdev); 1960 1959 radeon_uvd_fini(rdev); 1960 + rv770_pcie_gart_fini(rdev); 1961 1961 r600_vram_scratch_fini(rdev); 1962 1962 radeon_gem_fini(rdev); 1963 1963 radeon_fence_driver_fini(rdev);
+1 -1
drivers/gpu/drm/tegra/drm.c
··· 104 104 105 105 static void tegra_drm_lastclose(struct drm_device *drm) 106 106 { 107 - #ifdef CONFIG_TEGRA_DRM_FBDEV 107 + #ifdef CONFIG_DRM_TEGRA_FBDEV 108 108 struct tegra_drm *tegra = drm->dev_private; 109 109 110 110 tegra_fbdev_restore_mode(tegra->fbdev);
+11
drivers/gpu/drm/tegra/rgb.c
··· 15 15 struct tegra_rgb { 16 16 struct tegra_output output; 17 17 struct tegra_dc *dc; 18 + bool enabled; 18 19 19 20 struct clk *clk_parent; 20 21 struct clk *clk; ··· 90 89 struct tegra_rgb *rgb = to_rgb(output); 91 90 unsigned long value; 92 91 92 + if (rgb->enabled) 93 + return 0; 94 + 93 95 tegra_dc_write_regs(rgb->dc, rgb_enable, ARRAY_SIZE(rgb_enable)); 94 96 95 97 value = DE_SELECT_ACTIVE | DE_CONTROL_NORMAL; ··· 126 122 tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ << 8, DC_CMD_STATE_CONTROL); 127 123 tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); 128 124 125 + rgb->enabled = true; 126 + 129 127 return 0; 130 128 } 131 129 ··· 135 129 { 136 130 struct tegra_rgb *rgb = to_rgb(output); 137 131 unsigned long value; 132 + 133 + if (!rgb->enabled) 134 + return 0; 138 135 139 136 value = tegra_dc_readl(rgb->dc, DC_CMD_DISPLAY_POWER_CONTROL); 140 137 value &= ~(PW0_ENABLE | PW1_ENABLE | PW2_ENABLE | PW3_ENABLE | ··· 152 143 tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); 153 144 154 145 tegra_dc_write_regs(rgb->dc, rgb_disable, ARRAY_SIZE(rgb_disable)); 146 + 147 + rgb->enabled = false; 155 148 156 149 return 0; 157 150 }
+1 -6
drivers/gpu/drm/vmwgfx/svga3d_reg.h
··· 261 261 /* Planar video formats. */ 262 262 SVGA3D_YV12 = 121, 263 263 264 - /* Shader constant formats. */ 265 - SVGA3D_SURFACE_SHADERCONST_FLOAT = 122, 266 - SVGA3D_SURFACE_SHADERCONST_INT = 123, 267 - SVGA3D_SURFACE_SHADERCONST_BOOL = 124, 268 - 269 - SVGA3D_FORMAT_MAX = 125, 264 + SVGA3D_FORMAT_MAX = 122, 270 265 } SVGA3dSurfaceFormat; 271 266 272 267 typedef uint32 SVGA3dColor; /* a, r, g, b */
+1 -1
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
··· 40 40 #include <drm/ttm/ttm_module.h> 41 41 #include "vmwgfx_fence.h" 42 42 43 - #define VMWGFX_DRIVER_DATE "20121114" 43 + #define VMWGFX_DRIVER_DATE "20140228" 44 44 #define VMWGFX_DRIVER_MAJOR 2 45 45 #define VMWGFX_DRIVER_MINOR 5 46 46 #define VMWGFX_DRIVER_PATCHLEVEL 0
+19 -16
drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
··· 188 188 189 189 bo = otable->page_table->pt_bo; 190 190 cmd = vmw_fifo_reserve(dev_priv, sizeof(*cmd)); 191 - if (unlikely(cmd == NULL)) 192 - DRM_ERROR("Failed reserving FIFO space for OTable setup.\n"); 193 - 194 - memset(cmd, 0, sizeof(*cmd)); 195 - cmd->header.id = SVGA_3D_CMD_SET_OTABLE_BASE; 196 - cmd->header.size = sizeof(cmd->body); 197 - cmd->body.type = type; 198 - cmd->body.baseAddress = 0; 199 - cmd->body.sizeInBytes = 0; 200 - cmd->body.validSizeInBytes = 0; 201 - cmd->body.ptDepth = SVGA3D_MOBFMT_INVALID; 202 - vmw_fifo_commit(dev_priv, sizeof(*cmd)); 191 + if (unlikely(cmd == NULL)) { 192 + DRM_ERROR("Failed reserving FIFO space for OTable " 193 + "takedown.\n"); 194 + } else { 195 + memset(cmd, 0, sizeof(*cmd)); 196 + cmd->header.id = SVGA_3D_CMD_SET_OTABLE_BASE; 197 + cmd->header.size = sizeof(cmd->body); 198 + cmd->body.type = type; 199 + cmd->body.baseAddress = 0; 200 + cmd->body.sizeInBytes = 0; 201 + cmd->body.validSizeInBytes = 0; 202 + cmd->body.ptDepth = SVGA3D_MOBFMT_INVALID; 203 + vmw_fifo_commit(dev_priv, sizeof(*cmd)); 204 + } 203 205 204 206 if (bo) { 205 207 int ret; ··· 564 562 if (unlikely(cmd == NULL)) { 565 563 DRM_ERROR("Failed reserving FIFO space for Memory " 566 564 "Object unbinding.\n"); 565 + } else { 566 + cmd->header.id = SVGA_3D_CMD_DESTROY_GB_MOB; 567 + cmd->header.size = sizeof(cmd->body); 568 + cmd->body.mobid = mob->id; 569 + vmw_fifo_commit(dev_priv, sizeof(*cmd)); 567 570 } 568 - cmd->header.id = SVGA_3D_CMD_DESTROY_GB_MOB; 569 - cmd->header.size = sizeof(cmd->body); 570 - cmd->body.mobid = mob->id; 571 - vmw_fifo_commit(dev_priv, sizeof(*cmd)); 572 571 if (bo) { 573 572 vmw_fence_single_bo(bo, NULL); 574 573 ttm_bo_unreserve(bo);
+1 -2
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
··· 427 427 INIT_LIST_HEAD(&vmw_bo->res_list); 428 428 429 429 ret = ttm_bo_init(bdev, &vmw_bo->base, size, 430 - (user) ? ttm_bo_type_device : 431 - ttm_bo_type_kernel, placement, 430 + ttm_bo_type_device, placement, 432 431 0, interruptible, 433 432 NULL, acc_size, NULL, bo_free); 434 433 return ret;
+1 -1
drivers/gpu/host1x/job.c
··· 538 538 539 539 g->base = job->gather_addr_phys[i]; 540 540 541 - for (j = 0; j < job->num_gathers; j++) 541 + for (j = i + 1; j < job->num_gathers; j++) 542 542 if (job->gathers[j].bo == g->bo) 543 543 job->gathers[j].handled = true; 544 544
+1 -1
drivers/iio/gyro/Kconfig
··· 70 70 select IIO_TRIGGERED_BUFFER if (IIO_BUFFER) 71 71 help 72 72 Say yes here to build support for STMicroelectronics gyroscopes: 73 - L3G4200D, LSM330DL, L3GD20, L3GD20H, LSM330DLC, L3G4IS, LSM330. 73 + L3G4200D, LSM330DL, L3GD20, LSM330DLC, L3G4IS, LSM330. 74 74 75 75 This driver can also be built as a module. If so, these modules 76 76 will be created:
-1
drivers/iio/gyro/st_gyro.h
··· 19 19 #define LSM330DL_GYRO_DEV_NAME "lsm330dl_gyro" 20 20 #define LSM330DLC_GYRO_DEV_NAME "lsm330dlc_gyro" 21 21 #define L3GD20_GYRO_DEV_NAME "l3gd20" 22 - #define L3GD20H_GYRO_DEV_NAME "l3gd20h" 23 22 #define L3G4IS_GYRO_DEV_NAME "l3g4is_ui" 24 23 #define LSM330_GYRO_DEV_NAME "lsm330_gyro" 25 24
+4 -5
drivers/iio/gyro/st_gyro_core.c
··· 167 167 .wai = ST_GYRO_2_WAI_EXP, 168 168 .sensors_supported = { 169 169 [0] = L3GD20_GYRO_DEV_NAME, 170 - [1] = L3GD20H_GYRO_DEV_NAME, 171 - [2] = LSM330D_GYRO_DEV_NAME, 172 - [3] = LSM330DLC_GYRO_DEV_NAME, 173 - [4] = L3G4IS_GYRO_DEV_NAME, 174 - [5] = LSM330_GYRO_DEV_NAME, 170 + [1] = LSM330D_GYRO_DEV_NAME, 171 + [2] = LSM330DLC_GYRO_DEV_NAME, 172 + [3] = L3G4IS_GYRO_DEV_NAME, 173 + [4] = LSM330_GYRO_DEV_NAME, 175 174 }, 176 175 .ch = (struct iio_chan_spec *)st_gyro_16bit_channels, 177 176 .odr = {
-1
drivers/iio/gyro/st_gyro_i2c.c
··· 55 55 { LSM330DL_GYRO_DEV_NAME }, 56 56 { LSM330DLC_GYRO_DEV_NAME }, 57 57 { L3GD20_GYRO_DEV_NAME }, 58 - { L3GD20H_GYRO_DEV_NAME }, 59 58 { L3G4IS_GYRO_DEV_NAME }, 60 59 { LSM330_GYRO_DEV_NAME }, 61 60 {},
-1
drivers/iio/gyro/st_gyro_spi.c
··· 54 54 { LSM330DL_GYRO_DEV_NAME }, 55 55 { LSM330DLC_GYRO_DEV_NAME }, 56 56 { L3GD20_GYRO_DEV_NAME }, 57 - { L3GD20H_GYRO_DEV_NAME }, 58 57 { L3G4IS_GYRO_DEV_NAME }, 59 58 { LSM330_GYRO_DEV_NAME }, 60 59 {},
+8 -8
drivers/iio/light/cm32181.c
··· 103 103 /** 104 104 * cm32181_read_als_it() - Get sensor integration time (ms) 105 105 * @cm32181: pointer of struct cm32181 106 - * @val: pointer of int to load the als_it value. 106 + * @val2: pointer of int to load the als_it value. 107 107 * 108 108 * Report the current integartion time by millisecond. 109 109 * 110 - * Return: IIO_VAL_INT for success, otherwise -EINVAL. 110 + * Return: IIO_VAL_INT_PLUS_MICRO for success, otherwise -EINVAL. 111 111 */ 112 - static int cm32181_read_als_it(struct cm32181_chip *cm32181, int *val) 112 + static int cm32181_read_als_it(struct cm32181_chip *cm32181, int *val2) 113 113 { 114 114 u16 als_it; 115 115 int i; ··· 119 119 als_it >>= CM32181_CMD_ALS_IT_SHIFT; 120 120 for (i = 0; i < ARRAY_SIZE(als_it_bits); i++) { 121 121 if (als_it == als_it_bits[i]) { 122 - *val = als_it_value[i]; 123 - return IIO_VAL_INT; 122 + *val2 = als_it_value[i]; 123 + return IIO_VAL_INT_PLUS_MICRO; 124 124 } 125 125 } 126 126 ··· 221 221 *val = cm32181->calibscale; 222 222 return IIO_VAL_INT; 223 223 case IIO_CHAN_INFO_INT_TIME: 224 - ret = cm32181_read_als_it(cm32181, val); 224 + ret = cm32181_read_als_it(cm32181, val2); 225 225 return ret; 226 226 } 227 227 ··· 240 240 cm32181->calibscale = val; 241 241 return val; 242 242 case IIO_CHAN_INFO_INT_TIME: 243 - ret = cm32181_write_als_it(cm32181, val); 243 + ret = cm32181_write_als_it(cm32181, val2); 244 244 return ret; 245 245 } 246 246 ··· 264 264 265 265 n = ARRAY_SIZE(als_it_value); 266 266 for (i = 0, len = 0; i < n; i++) 267 - len += sprintf(buf + len, "%d ", als_it_value[i]); 267 + len += sprintf(buf + len, "0.%06u ", als_it_value[i]); 268 268 return len + sprintf(buf + len, "\n"); 269 269 } 270 270
+23 -22
drivers/iio/light/cm36651.c
··· 50 50 #define CM36651_CS_CONF2_DEFAULT_BIT 0x08 51 51 52 52 /* CS_CONF3 channel integration time */ 53 - #define CM36651_CS_IT1 0x00 /* Integration time 80000 usec */ 54 - #define CM36651_CS_IT2 0x40 /* Integration time 160000 usec */ 55 - #define CM36651_CS_IT3 0x80 /* Integration time 320000 usec */ 56 - #define CM36651_CS_IT4 0xC0 /* Integration time 640000 usec */ 53 + #define CM36651_CS_IT1 0x00 /* Integration time 80 msec */ 54 + #define CM36651_CS_IT2 0x40 /* Integration time 160 msec */ 55 + #define CM36651_CS_IT3 0x80 /* Integration time 320 msec */ 56 + #define CM36651_CS_IT4 0xC0 /* Integration time 640 msec */ 57 57 58 58 /* PS_CONF1 command code */ 59 59 #define CM36651_PS_ENABLE 0x00 ··· 64 64 #define CM36651_PS_PERS4 0x0C 65 65 66 66 /* PS_CONF1 command code: integration time */ 67 - #define CM36651_PS_IT1 0x00 /* Integration time 320 usec */ 68 - #define CM36651_PS_IT2 0x10 /* Integration time 420 usec */ 69 - #define CM36651_PS_IT3 0x20 /* Integration time 520 usec */ 70 - #define CM36651_PS_IT4 0x30 /* Integration time 640 usec */ 67 + #define CM36651_PS_IT1 0x00 /* Integration time 0.32 msec */ 68 + #define CM36651_PS_IT2 0x10 /* Integration time 0.42 msec */ 69 + #define CM36651_PS_IT3 0x20 /* Integration time 0.52 msec */ 70 + #define CM36651_PS_IT4 0x30 /* Integration time 0.64 msec */ 71 71 72 72 /* PS_CONF1 command code: duty ratio */ 73 73 #define CM36651_PS_DR1 0x00 /* Duty ratio 1/80 */ ··· 93 93 #define CM36651_CLOSE_PROXIMITY 0x32 94 94 #define CM36651_FAR_PROXIMITY 0x33 95 95 96 - #define CM36651_CS_INT_TIME_AVAIL "80000 160000 320000 640000" 97 - #define CM36651_PS_INT_TIME_AVAIL "320 420 520 640" 96 + #define CM36651_CS_INT_TIME_AVAIL "0.08 0.16 0.32 0.64" 97 + #define CM36651_PS_INT_TIME_AVAIL "0.000320 0.000420 0.000520 0.000640" 98 98 99 99 enum cm36651_operation_mode { 100 100 CM36651_LIGHT_EN, ··· 356 356 } 357 357 358 358 static int cm36651_read_int_time(struct cm36651_data *cm36651, 359 - struct iio_chan_spec const *chan, int *val) 359 + struct iio_chan_spec const *chan, int *val2) 360 360 { 361 361 switch (chan->type) { 362 362 case IIO_LIGHT: 363 363 if (cm36651->cs_int_time[chan->address] == CM36651_CS_IT1) 364 - *val = 80000; 364 + *val2 = 80000; 365 365 else if (cm36651->cs_int_time[chan->address] == CM36651_CS_IT2) 366 - *val = 160000; 366 + *val2 = 160000; 367 367 else if (cm36651->cs_int_time[chan->address] == CM36651_CS_IT3) 368 - *val = 320000; 368 + *val2 = 320000; 369 369 else if (cm36651->cs_int_time[chan->address] == CM36651_CS_IT4) 370 - *val = 640000; 370 + *val2 = 640000; 371 371 else 372 372 return -EINVAL; 373 373 break; 374 374 case IIO_PROXIMITY: 375 375 if (cm36651->ps_int_time == CM36651_PS_IT1) 376 - *val = 320; 376 + *val2 = 320; 377 377 else if (cm36651->ps_int_time == CM36651_PS_IT2) 378 - *val = 420; 378 + *val2 = 420; 379 379 else if (cm36651->ps_int_time == CM36651_PS_IT3) 380 - *val = 520; 380 + *val2 = 520; 381 381 else if (cm36651->ps_int_time == CM36651_PS_IT4) 382 - *val = 640; 382 + *val2 = 640; 383 383 else 384 384 return -EINVAL; 385 385 break; ··· 387 387 return -EINVAL; 388 388 } 389 389 390 - return IIO_VAL_INT; 390 + return IIO_VAL_INT_PLUS_MICRO; 391 391 } 392 392 393 393 static int cm36651_write_int_time(struct cm36651_data *cm36651, ··· 459 459 ret = cm36651_read_channel(cm36651, chan, val); 460 460 break; 461 461 case IIO_CHAN_INFO_INT_TIME: 462 - ret = cm36651_read_int_time(cm36651, chan, val); 462 + *val = 0; 463 + ret = cm36651_read_int_time(cm36651, chan, val2); 463 464 break; 464 465 default: 465 466 ret = -EINVAL; ··· 480 479 int ret = -EINVAL; 481 480 482 481 if (mask == IIO_CHAN_INFO_INT_TIME) { 483 - ret = cm36651_write_int_time(cm36651, chan, val); 482 + ret = cm36651_write_int_time(cm36651, chan, val2); 484 483 if (ret < 0) 485 484 dev_err(&client->dev, "Integration time write failed\n"); 486 485 }
-19
drivers/input/misc/arizona-haptics.c
··· 37 37 struct arizona_haptics, 38 38 work); 39 39 struct arizona *arizona = haptics->arizona; 40 - struct mutex *dapm_mutex = &arizona->dapm->card->dapm_mutex; 41 40 int ret; 42 41 43 42 if (!haptics->arizona->dapm) { ··· 66 67 return; 67 68 } 68 69 69 - mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 70 - 71 70 ret = snd_soc_dapm_enable_pin(arizona->dapm, "HAPTICS"); 72 71 if (ret != 0) { 73 72 dev_err(arizona->dev, "Failed to start HAPTICS: %d\n", 74 73 ret); 75 - mutex_unlock(dapm_mutex); 76 74 return; 77 75 } 78 76 ··· 77 81 if (ret != 0) { 78 82 dev_err(arizona->dev, "Failed to sync DAPM: %d\n", 79 83 ret); 80 - mutex_unlock(dapm_mutex); 81 84 return; 82 85 } 83 - 84 - mutex_unlock(dapm_mutex); 85 - 86 86 } else { 87 87 /* This disable sequence will be a noop if already enabled */ 88 - mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 89 - 90 88 ret = snd_soc_dapm_disable_pin(arizona->dapm, "HAPTICS"); 91 89 if (ret != 0) { 92 90 dev_err(arizona->dev, "Failed to disable HAPTICS: %d\n", 93 91 ret); 94 - mutex_unlock(dapm_mutex); 95 92 return; 96 93 } 97 94 ··· 92 103 if (ret != 0) { 93 104 dev_err(arizona->dev, "Failed to sync DAPM: %d\n", 94 105 ret); 95 - mutex_unlock(dapm_mutex); 96 106 return; 97 107 } 98 - 99 - mutex_unlock(dapm_mutex); 100 108 101 109 ret = regmap_update_bits(arizona->regmap, 102 110 ARIZONA_HAPTICS_CONTROL_1, ··· 141 155 static void arizona_haptics_close(struct input_dev *input) 142 156 { 143 157 struct arizona_haptics *haptics = input_get_drvdata(input); 144 - struct mutex *dapm_mutex = &haptics->arizona->dapm->card->dapm_mutex; 145 158 146 159 cancel_work_sync(&haptics->work); 147 160 148 - mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 149 - 150 161 if (haptics->arizona->dapm) 151 162 snd_soc_dapm_disable_pin(haptics->arizona->dapm, "HAPTICS"); 152 - 153 - mutex_unlock(dapm_mutex); 154 163 } 155 164 156 165 static int arizona_haptics_probe(struct platform_device *pdev)
+2 -2
drivers/iommu/omap-iommu-debug.c
··· 354 354 return -ENOMEM; \ 355 355 } 356 356 357 - #define DEBUG_ADD_FILE(name) __DEBUG_ADD_FILE(name, 600) 358 - #define DEBUG_ADD_FILE_RO(name) __DEBUG_ADD_FILE(name, 400) 357 + #define DEBUG_ADD_FILE(name) __DEBUG_ADD_FILE(name, 0600) 358 + #define DEBUG_ADD_FILE_RO(name) __DEBUG_ADD_FILE(name, 0400) 359 359 360 360 static int iommu_debug_register(struct device *dev, void *data) 361 361 {
+1 -1
drivers/irqchip/irq-metag-ext.c
··· 515 515 * one cpu (the interrupt code doesn't support it), so we just 516 516 * pick the first cpu we find in 'cpumask'. 517 517 */ 518 - cpu = cpumask_any(cpumask); 518 + cpu = cpumask_any_and(cpumask, cpu_online_mask); 519 519 thread = cpu_2_hwthread_id[cpu]; 520 520 521 521 metag_out32(TBI_TRIG_VEC(TBID_SIGNUM_TR2(thread)), vec_addr);
+1 -1
drivers/irqchip/irq-metag.c
··· 201 201 * one cpu (the interrupt code doesn't support it), so we just 202 202 * pick the first cpu we find in 'cpumask'. 203 203 */ 204 - cpu = cpumask_any(cpumask); 204 + cpu = cpumask_any_and(cpumask, cpu_online_mask); 205 205 thread = cpu_2_hwthread_id[cpu]; 206 206 207 207 metag_out32(TBI_TRIG_VEC(TBID_SIGNUM_TR1(thread)),
+8 -5
drivers/md/dm-cache-target.c
··· 289 289 bool tick:1; 290 290 unsigned req_nr:2; 291 291 struct dm_deferred_entry *all_io_entry; 292 + struct dm_hook_info hook_info; 292 293 293 294 /* 294 295 * writethrough fields. These MUST remain at the end of this ··· 298 297 */ 299 298 struct cache *cache; 300 299 dm_cblock_t cblock; 301 - struct dm_hook_info hook_info; 302 300 struct dm_bio_details bio_details; 303 301 }; 304 302 ··· 671 671 dm_cblock_t cblock) 672 672 { 673 673 sector_t bi_sector = bio->bi_iter.bi_sector; 674 + sector_t block = from_cblock(cblock); 674 675 675 676 bio->bi_bdev = cache->cache_dev->bdev; 676 677 if (!block_size_is_power_of_two(cache)) 677 678 bio->bi_iter.bi_sector = 678 - (from_cblock(cblock) * cache->sectors_per_block) + 679 + (block * cache->sectors_per_block) + 679 680 sector_div(bi_sector, cache->sectors_per_block); 680 681 else 681 682 bio->bi_iter.bi_sector = 682 - (from_cblock(cblock) << cache->sectors_per_block_shift) | 683 + (block << cache->sectors_per_block_shift) | 683 684 (bi_sector & (cache->sectors_per_block - 1)); 684 685 } 685 686 ··· 1011 1010 struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size); 1012 1011 unsigned long flags; 1013 1012 1013 + dm_unhook_bio(&pb->hook_info, bio); 1014 + 1014 1015 if (err) 1015 1016 mg->err = true; 1016 1017 1018 + mg->requeue_holder = false; 1019 + 1017 1020 spin_lock_irqsave(&cache->lock, flags); 1018 1021 list_add_tail(&mg->list, &cache->completed_migrations); 1019 - dm_unhook_bio(&pb->hook_info, bio); 1020 - mg->requeue_holder = false; 1021 1022 spin_unlock_irqrestore(&cache->lock, flags); 1022 1023 1023 1024 wake_worker(cache);
+11 -12
drivers/md/dm-io.c
··· 201 201 /* 202 202 * Functions for getting the pages from a bvec. 203 203 */ 204 - static void bio_get_page(struct dpages *dp, 205 - struct page **p, unsigned long *len, unsigned *offset) 204 + static void bio_get_page(struct dpages *dp, struct page **p, 205 + unsigned long *len, unsigned *offset) 206 206 { 207 - struct bio *bio = dp->context_ptr; 208 - struct bio_vec bvec = bio_iovec(bio); 209 - *p = bvec.bv_page; 210 - *len = bvec.bv_len; 211 - *offset = bvec.bv_offset; 207 + struct bio_vec *bvec = dp->context_ptr; 208 + *p = bvec->bv_page; 209 + *len = bvec->bv_len - dp->context_u; 210 + *offset = bvec->bv_offset + dp->context_u; 212 211 } 213 212 214 213 static void bio_next_page(struct dpages *dp) 215 214 { 216 - struct bio *bio = dp->context_ptr; 217 - struct bio_vec bvec = bio_iovec(bio); 218 - 219 - bio_advance(bio, bvec.bv_len); 215 + struct bio_vec *bvec = dp->context_ptr; 216 + dp->context_ptr = bvec + 1; 217 + dp->context_u = 0; 220 218 } 221 219 222 220 static void bio_dp_init(struct dpages *dp, struct bio *bio) 223 221 { 224 222 dp->get_page = bio_get_page; 225 223 dp->next_page = bio_next_page; 226 - dp->context_ptr = bio; 224 + dp->context_ptr = __bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter); 225 + dp->context_u = bio->bi_iter.bi_bvec_done; 227 226 } 228 227 229 228 /*
+5 -2
drivers/md/dm-mpath.c
··· 1626 1626 /* 1627 1627 * Only pass ioctls through if the device sizes match exactly. 1628 1628 */ 1629 - if (!r && ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT) 1630 - r = scsi_verify_blk_ioctl(NULL, cmd); 1629 + if (!bdev || ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT) { 1630 + int err = scsi_verify_blk_ioctl(NULL, cmd); 1631 + if (err) 1632 + r = err; 1633 + } 1631 1634 1632 1635 if (r == -ENOTCONN && !fatal_signal_pending(current)) 1633 1636 queue_work(kmultipathd, &m->process_queued_ios);
+3
drivers/md/dm-raid1.c
··· 1244 1244 1245 1245 dm_bio_restore(bd, bio); 1246 1246 bio_record->details.bi_bdev = NULL; 1247 + 1248 + atomic_inc(&bio->bi_remaining); 1249 + 1247 1250 queue_bio(ms, bio, rw); 1248 1251 return DM_ENDIO_INCOMPLETE; 1249 1252 }
+19 -2
drivers/md/dm-thin-metadata.c
··· 483 483 484 484 disk_super->data_mapping_root = cpu_to_le64(pmd->root); 485 485 disk_super->device_details_root = cpu_to_le64(pmd->details_root); 486 - disk_super->metadata_block_size = cpu_to_le32(THIN_METADATA_BLOCK_SIZE >> SECTOR_SHIFT); 486 + disk_super->metadata_block_size = cpu_to_le32(THIN_METADATA_BLOCK_SIZE); 487 487 disk_super->metadata_nr_blocks = cpu_to_le64(bdev_size >> SECTOR_TO_BLOCK_SHIFT); 488 488 disk_super->data_block_size = cpu_to_le32(pmd->data_block_size); 489 489 ··· 651 651 { 652 652 int r; 653 653 654 - pmd->bm = dm_block_manager_create(pmd->bdev, THIN_METADATA_BLOCK_SIZE, 654 + pmd->bm = dm_block_manager_create(pmd->bdev, THIN_METADATA_BLOCK_SIZE << SECTOR_SHIFT, 655 655 THIN_METADATA_CACHE_SIZE, 656 656 THIN_MAX_CONCURRENT_LOCKS); 657 657 if (IS_ERR(pmd->bm)) { ··· 1485 1485 down_read(&td->pmd->root_lock); 1486 1486 r = td->changed; 1487 1487 up_read(&td->pmd->root_lock); 1488 + 1489 + return r; 1490 + } 1491 + 1492 + bool dm_pool_changed_this_transaction(struct dm_pool_metadata *pmd) 1493 + { 1494 + bool r = false; 1495 + struct dm_thin_device *td, *tmp; 1496 + 1497 + down_read(&pmd->root_lock); 1498 + list_for_each_entry_safe(td, tmp, &pmd->thin_devices, list) { 1499 + if (td->changed) { 1500 + r = td->changed; 1501 + break; 1502 + } 1503 + } 1504 + up_read(&pmd->root_lock); 1488 1505 1489 1506 return r; 1490 1507 }
+5 -5
drivers/md/dm-thin-metadata.h
··· 9 9 10 10 #include "persistent-data/dm-block-manager.h" 11 11 #include "persistent-data/dm-space-map.h" 12 + #include "persistent-data/dm-space-map-metadata.h" 12 13 13 - #define THIN_METADATA_BLOCK_SIZE 4096 14 + #define THIN_METADATA_BLOCK_SIZE DM_SM_METADATA_BLOCK_SIZE 14 15 15 16 /* 16 17 * The metadata device is currently limited in size. 17 - * 18 - * We have one block of index, which can hold 255 index entries. Each 19 - * index entry contains allocation info about 16k metadata blocks. 20 18 */ 21 - #define THIN_METADATA_MAX_SECTORS (255 * (1 << 14) * (THIN_METADATA_BLOCK_SIZE / (1 << SECTOR_SHIFT))) 19 + #define THIN_METADATA_MAX_SECTORS DM_SM_METADATA_MAX_SECTORS 22 20 23 21 /* 24 22 * A metadata device larger than 16GB triggers a warning. ··· 158 160 * Queries. 159 161 */ 160 162 bool dm_thin_changed_this_transaction(struct dm_thin_device *td); 163 + 164 + bool dm_pool_changed_this_transaction(struct dm_pool_metadata *pmd); 161 165 162 166 bool dm_thin_aborted_changes(struct dm_thin_device *td); 163 167
+25 -14
drivers/md/dm-thin.c
··· 1357 1357 bio_list_init(&pool->deferred_flush_bios); 1358 1358 spin_unlock_irqrestore(&pool->lock, flags); 1359 1359 1360 - if (bio_list_empty(&bios) && !need_commit_due_to_time(pool)) 1360 + if (bio_list_empty(&bios) && 1361 + !(dm_pool_changed_this_transaction(pool->pmd) && need_commit_due_to_time(pool))) 1361 1362 return; 1362 1363 1363 1364 if (commit(pool)) { ··· 2000 1999 dm_table_event(pool->ti->table); 2001 2000 } 2002 2001 2003 - static sector_t get_metadata_dev_size(struct block_device *bdev) 2002 + static sector_t get_dev_size(struct block_device *bdev) 2004 2003 { 2005 - sector_t metadata_dev_size = i_size_read(bdev->bd_inode) >> SECTOR_SHIFT; 2004 + return i_size_read(bdev->bd_inode) >> SECTOR_SHIFT; 2005 + } 2006 + 2007 + static void warn_if_metadata_device_too_big(struct block_device *bdev) 2008 + { 2009 + sector_t metadata_dev_size = get_dev_size(bdev); 2006 2010 char buffer[BDEVNAME_SIZE]; 2007 2011 2008 - if (metadata_dev_size > THIN_METADATA_MAX_SECTORS_WARNING) { 2012 + if (metadata_dev_size > THIN_METADATA_MAX_SECTORS_WARNING) 2009 2013 DMWARN("Metadata device %s is larger than %u sectors: excess space will not be used.", 2010 2014 bdevname(bdev, buffer), THIN_METADATA_MAX_SECTORS); 2011 - metadata_dev_size = THIN_METADATA_MAX_SECTORS_WARNING; 2012 - } 2015 + } 2016 + 2017 + static sector_t get_metadata_dev_size(struct block_device *bdev) 2018 + { 2019 + sector_t metadata_dev_size = get_dev_size(bdev); 2020 + 2021 + if (metadata_dev_size > THIN_METADATA_MAX_SECTORS) 2022 + metadata_dev_size = THIN_METADATA_MAX_SECTORS; 2013 2023 2014 2024 return metadata_dev_size; 2015 2025 } ··· 2029 2017 { 2030 2018 sector_t metadata_dev_size = get_metadata_dev_size(bdev); 2031 2019 2032 - sector_div(metadata_dev_size, THIN_METADATA_BLOCK_SIZE >> SECTOR_SHIFT); 2020 + sector_div(metadata_dev_size, THIN_METADATA_BLOCK_SIZE); 2033 2021 2034 2022 return metadata_dev_size; 2035 2023 } ··· 2107 2095 ti->error = "Error opening metadata block device"; 2108 2096 goto out_unlock; 2109 2097 } 2110 - 2111 - /* 2112 - * Run for the side-effect of possibly issuing a warning if the 2113 - * device is too big. 2114 - */ 2115 - (void) get_metadata_dev_size(metadata_dev->bdev); 2098 + warn_if_metadata_device_too_big(metadata_dev->bdev); 2116 2099 2117 2100 r = dm_get_device(ti, argv[1], FMODE_READ | FMODE_WRITE, &data_dev); 2118 2101 if (r) { ··· 2294 2287 return -EINVAL; 2295 2288 2296 2289 } else if (metadata_dev_size > sb_metadata_dev_size) { 2290 + warn_if_metadata_device_too_big(pool->md_dev); 2297 2291 DMINFO("%s: growing the metadata device from %llu to %llu blocks", 2298 2292 dm_device_name(pool->pool_md), 2299 2293 sb_metadata_dev_size, metadata_dev_size); ··· 2902 2894 2903 2895 if (get_pool_mode(tc->pool) == PM_FAIL) { 2904 2896 ti->error = "Couldn't open thin device, Pool is in fail mode"; 2897 + r = -EINVAL; 2905 2898 goto bad_thin_open; 2906 2899 } 2907 2900 ··· 2914 2905 2915 2906 r = dm_set_target_max_io_len(ti, tc->pool->sectors_per_block); 2916 2907 if (r) 2917 - goto bad_thin_open; 2908 + goto bad_target_max_io_len; 2918 2909 2919 2910 ti->num_flush_bios = 1; 2920 2911 ti->flush_supported = true; ··· 2935 2926 2936 2927 return 0; 2937 2928 2929 + bad_target_max_io_len: 2930 + dm_pool_close_thin_device(tc->td); 2938 2931 bad_thin_open: 2939 2932 __pool_dec(tc->pool); 2940 2933 bad_pool_lookup:
+2
drivers/md/persistent-data/dm-space-map-metadata.c
··· 680 680 if (r) 681 681 return r; 682 682 683 + if (nr_blocks > DM_SM_METADATA_MAX_BLOCKS) 684 + nr_blocks = DM_SM_METADATA_MAX_BLOCKS; 683 685 r = sm_ll_extend(&smm->ll, nr_blocks); 684 686 if (r) 685 687 return r;
+11
drivers/md/persistent-data/dm-space-map-metadata.h
··· 9 9 10 10 #include "dm-transaction-manager.h" 11 11 12 + #define DM_SM_METADATA_BLOCK_SIZE (4096 >> SECTOR_SHIFT) 13 + 14 + /* 15 + * The metadata device is currently limited in size. 16 + * 17 + * We have one block of index, which can hold 255 index entries. Each 18 + * index entry contains allocation info about ~16k metadata blocks. 19 + */ 20 + #define DM_SM_METADATA_MAX_BLOCKS (255 * ((1 << 14) - 64)) 21 + #define DM_SM_METADATA_MAX_SECTORS (DM_SM_METADATA_MAX_BLOCKS * DM_SM_METADATA_BLOCK_SIZE) 22 + 12 23 /* 13 24 * Unfortunately we have to use two-phase construction due to the cycle 14 25 * between the tm and sm.
+1 -1
drivers/mtd/nand/nand_base.c
··· 1584 1584 } 1585 1585 1586 1586 if (mtd->ecc_stats.failed - ecc_failures) { 1587 - if (retry_mode + 1 <= chip->read_retries) { 1587 + if (retry_mode + 1 < chip->read_retries) { 1588 1588 retry_mode++; 1589 1589 ret = nand_setup_read_retry(mtd, 1590 1590 retry_mode);
+40 -21
drivers/mtd/nand/omap2.c
··· 1633 1633 int i; 1634 1634 dma_cap_mask_t mask; 1635 1635 unsigned sig; 1636 + unsigned oob_index; 1636 1637 struct resource *res; 1637 1638 struct mtd_part_parser_data ppdata = {}; 1638 1639 ··· 1827 1826 (mtd->writesize / 1828 1827 nand_chip->ecc.size); 1829 1828 if (nand_chip->options & NAND_BUSWIDTH_16) 1830 - ecclayout->eccpos[0] = BADBLOCK_MARKER_LENGTH; 1829 + oob_index = BADBLOCK_MARKER_LENGTH; 1831 1830 else 1832 - ecclayout->eccpos[0] = 1; 1833 - ecclayout->oobfree->offset = ecclayout->eccpos[0] + 1834 - ecclayout->eccbytes; 1831 + oob_index = 1; 1832 + for (i = 0; i < ecclayout->eccbytes; i++, oob_index++) 1833 + ecclayout->eccpos[i] = oob_index; 1834 + /* no reserved-marker in ecclayout for this ecc-scheme */ 1835 + ecclayout->oobfree->offset = 1836 + ecclayout->eccpos[ecclayout->eccbytes - 1] + 1; 1835 1837 break; 1836 1838 1837 1839 case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW: ··· 1851 1847 ecclayout->eccbytes = nand_chip->ecc.bytes * 1852 1848 (mtd->writesize / 1853 1849 nand_chip->ecc.size); 1854 - ecclayout->eccpos[0] = BADBLOCK_MARKER_LENGTH; 1855 - ecclayout->oobfree->offset = ecclayout->eccpos[0] + 1856 - ecclayout->eccbytes; 1850 + oob_index = BADBLOCK_MARKER_LENGTH; 1851 + for (i = 0; i < ecclayout->eccbytes; i++, oob_index++) { 1852 + ecclayout->eccpos[i] = oob_index; 1853 + if (((i + 1) % nand_chip->ecc.bytes) == 0) 1854 + oob_index++; 1855 + } 1856 + /* include reserved-marker in ecclayout->oobfree calculation */ 1857 + ecclayout->oobfree->offset = 1 + 1858 + ecclayout->eccpos[ecclayout->eccbytes - 1] + 1; 1857 1859 /* software bch library is used for locating errors */ 1858 1860 nand_chip->ecc.priv = nand_bch_init(mtd, 1859 1861 nand_chip->ecc.size, ··· 1893 1883 ecclayout->eccbytes = nand_chip->ecc.bytes * 1894 1884 (mtd->writesize / 1895 1885 nand_chip->ecc.size); 1896 - ecclayout->eccpos[0] = BADBLOCK_MARKER_LENGTH; 1897 - ecclayout->oobfree->offset = ecclayout->eccpos[0] + 1898 - ecclayout->eccbytes; 1886 + oob_index = BADBLOCK_MARKER_LENGTH; 1887 + for (i = 0; i < ecclayout->eccbytes; i++, oob_index++) 1888 + ecclayout->eccpos[i] = oob_index; 1889 + /* reserved marker already included in ecclayout->eccbytes */ 1890 + ecclayout->oobfree->offset = 1891 + ecclayout->eccpos[ecclayout->eccbytes - 1] + 1; 1899 1892 /* This ECC scheme requires ELM H/W block */ 1900 1893 if (is_elm_present(info, pdata->elm_of_node, BCH4_ECC) < 0) { 1901 1894 pr_err("nand: error: could not initialize ELM\n"); ··· 1926 1913 ecclayout->eccbytes = nand_chip->ecc.bytes * 1927 1914 (mtd->writesize / 1928 1915 nand_chip->ecc.size); 1929 - ecclayout->eccpos[0] = BADBLOCK_MARKER_LENGTH; 1930 - ecclayout->oobfree->offset = ecclayout->eccpos[0] + 1931 - ecclayout->eccbytes; 1916 + oob_index = BADBLOCK_MARKER_LENGTH; 1917 + for (i = 0; i < ecclayout->eccbytes; i++, oob_index++) { 1918 + ecclayout->eccpos[i] = oob_index; 1919 + if (((i + 1) % nand_chip->ecc.bytes) == 0) 1920 + oob_index++; 1921 + } 1922 + /* include reserved-marker in ecclayout->oobfree calculation */ 1923 + ecclayout->oobfree->offset = 1 + 1924 + ecclayout->eccpos[ecclayout->eccbytes - 1] + 1; 1932 1925 /* software bch library is used for locating errors */ 1933 1926 nand_chip->ecc.priv = nand_bch_init(mtd, 1934 1927 nand_chip->ecc.size, ··· 1975 1956 ecclayout->eccbytes = nand_chip->ecc.bytes * 1976 1957 (mtd->writesize / 1977 1958 nand_chip->ecc.size); 1978 - ecclayout->eccpos[0] = BADBLOCK_MARKER_LENGTH; 1979 - ecclayout->oobfree->offset = ecclayout->eccpos[0] + 1980 - ecclayout->eccbytes; 1959 + oob_index = BADBLOCK_MARKER_LENGTH; 1960 + for (i = 0; i < ecclayout->eccbytes; i++, oob_index++) 1961 + ecclayout->eccpos[i] = oob_index; 1962 + /* reserved marker already included in ecclayout->eccbytes */ 1963 + ecclayout->oobfree->offset = 1964 + ecclayout->eccpos[ecclayout->eccbytes - 1] + 1; 1981 1965 break; 1982 1966 #else 1983 1967 pr_err("nand: error: CONFIG_MTD_NAND_OMAP_BCH not enabled\n"); ··· 1994 1972 goto return_error; 1995 1973 } 1996 1974 1997 - /* populate remaining ECC layout data */ 1998 - ecclayout->oobfree->length = mtd->oobsize - (BADBLOCK_MARKER_LENGTH + 1999 - ecclayout->eccbytes); 2000 - for (i = 1; i < ecclayout->eccbytes; i++) 2001 - ecclayout->eccpos[i] = ecclayout->eccpos[0] + i; 1975 + /* all OOB bytes from oobfree->offset till end off OOB are free */ 1976 + ecclayout->oobfree->length = mtd->oobsize - ecclayout->oobfree->offset; 2002 1977 /* check if NAND device's OOB is enough to store ECC signatures */ 2003 1978 if (mtd->oobsize < (ecclayout->eccbytes + BADBLOCK_MARKER_LENGTH)) { 2004 1979 pr_err("not enough OOB bytes required = %d, available=%d\n",
+4 -4
drivers/mtd/ubi/fastmap.c
··· 463 463 } 464 464 } 465 465 if (found_orphan) { 466 - kmem_cache_free(ai->aeb_slab_cache, tmp_aeb); 467 466 list_del(&tmp_aeb->u.list); 467 + kmem_cache_free(ai->aeb_slab_cache, tmp_aeb); 468 468 } 469 469 470 470 new_aeb = kmem_cache_alloc(ai->aeb_slab_cache, ··· 846 846 ret = UBI_BAD_FASTMAP; 847 847 fail: 848 848 list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &used, u.list) { 849 - kmem_cache_free(ai->aeb_slab_cache, tmp_aeb); 850 849 list_del(&tmp_aeb->u.list); 850 + kmem_cache_free(ai->aeb_slab_cache, tmp_aeb); 851 851 } 852 852 list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &eba_orphans, u.list) { 853 - kmem_cache_free(ai->aeb_slab_cache, tmp_aeb); 854 853 list_del(&tmp_aeb->u.list); 854 + kmem_cache_free(ai->aeb_slab_cache, tmp_aeb); 855 855 } 856 856 list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &free, u.list) { 857 - kmem_cache_free(ai->aeb_slab_cache, tmp_aeb); 858 857 list_del(&tmp_aeb->u.list); 858 + kmem_cache_free(ai->aeb_slab_cache, tmp_aeb); 859 859 } 860 860 861 861 return ret;
+3 -1
drivers/pwm/pwm-lp3943.c
··· 52 52 offset = pwm_map->output[i]; 53 53 54 54 /* Return an error if the pin is already assigned */ 55 - if (test_and_set_bit(offset, &lp3943->pin_used)) 55 + if (test_and_set_bit(offset, &lp3943->pin_used)) { 56 + kfree(pwm_map); 56 57 return ERR_PTR(-EBUSY); 58 + } 57 59 } 58 60 59 61 return pwm_map;
+1
drivers/s390/cio/chsc.c
··· 610 610 css_wait_for_slow_path(); 611 611 for_each_subchannel_staged(__s390_process_res_acc, NULL, 612 612 &link); 613 + css_schedule_reprobe(); 613 614 } 614 615 } 615 616
+23 -1
drivers/s390/crypto/zcrypt_msgtype6.c
··· 311 311 } __packed * msg = ap_msg->message; 312 312 313 313 int rcblen = CEIL4(xcRB->request_control_blk_length); 314 - int replylen; 314 + int replylen, req_sumlen, resp_sumlen; 315 315 char *req_data = ap_msg->message + sizeof(struct type6_hdr) + rcblen; 316 316 char *function_code; 317 317 ··· 321 321 xcRB->request_data_length; 322 322 if (ap_msg->length > MSGTYPE06_MAX_MSG_SIZE) 323 323 return -EINVAL; 324 + 325 + /* Overflow check 326 + sum must be greater (or equal) than the largest operand */ 327 + req_sumlen = CEIL4(xcRB->request_control_blk_length) + 328 + xcRB->request_data_length; 329 + if ((CEIL4(xcRB->request_control_blk_length) <= 330 + xcRB->request_data_length) ? 331 + (req_sumlen < xcRB->request_data_length) : 332 + (req_sumlen < CEIL4(xcRB->request_control_blk_length))) { 333 + return -EINVAL; 334 + } 335 + 324 336 replylen = sizeof(struct type86_fmt2_msg) + 325 337 CEIL4(xcRB->reply_control_blk_length) + 326 338 xcRB->reply_data_length; 327 339 if (replylen > MSGTYPE06_MAX_MSG_SIZE) 328 340 return -EINVAL; 341 + 342 + /* Overflow check 343 + sum must be greater (or equal) than the largest operand */ 344 + resp_sumlen = CEIL4(xcRB->reply_control_blk_length) + 345 + xcRB->reply_data_length; 346 + if ((CEIL4(xcRB->reply_control_blk_length) <= xcRB->reply_data_length) ? 347 + (resp_sumlen < xcRB->reply_data_length) : 348 + (resp_sumlen < CEIL4(xcRB->reply_control_blk_length))) { 349 + return -EINVAL; 350 + } 329 351 330 352 /* prepare type6 header */ 331 353 msg->hdr = static_type6_hdrX;
+36 -6
drivers/scsi/qla2xxx/qla_target.c
··· 790 790 } 791 791 792 792 /* Called by tcm_qla2xxx configfs code */ 793 - void qlt_stop_phase1(struct qla_tgt *tgt) 793 + int qlt_stop_phase1(struct qla_tgt *tgt) 794 794 { 795 795 struct scsi_qla_host *vha = tgt->vha; 796 796 struct qla_hw_data *ha = tgt->ha; 797 797 unsigned long flags; 798 798 799 + mutex_lock(&qla_tgt_mutex); 800 + if (!vha->fc_vport) { 801 + struct Scsi_Host *sh = vha->host; 802 + struct fc_host_attrs *fc_host = shost_to_fc_host(sh); 803 + bool npiv_vports; 804 + 805 + spin_lock_irqsave(sh->host_lock, flags); 806 + npiv_vports = (fc_host->npiv_vports_inuse); 807 + spin_unlock_irqrestore(sh->host_lock, flags); 808 + 809 + if (npiv_vports) { 810 + mutex_unlock(&qla_tgt_mutex); 811 + return -EPERM; 812 + } 813 + } 799 814 if (tgt->tgt_stop || tgt->tgt_stopped) { 800 815 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf04e, 801 816 "Already in tgt->tgt_stop or tgt_stopped state\n"); 802 - dump_stack(); 803 - return; 817 + mutex_unlock(&qla_tgt_mutex); 818 + return -EPERM; 804 819 } 805 820 806 821 ql_dbg(ql_dbg_tgt, vha, 0xe003, "Stopping target for host %ld(%p)\n", ··· 830 815 qlt_clear_tgt_db(tgt, true); 831 816 spin_unlock_irqrestore(&ha->hardware_lock, flags); 832 817 mutex_unlock(&vha->vha_tgt.tgt_mutex); 818 + mutex_unlock(&qla_tgt_mutex); 833 819 834 820 flush_delayed_work(&tgt->sess_del_work); 835 821 ··· 857 841 858 842 /* Wait for sessions to clear out (just in case) */ 859 843 wait_event(tgt->waitQ, test_tgt_sess_count(tgt)); 844 + return 0; 860 845 } 861 846 EXPORT_SYMBOL(qlt_stop_phase1); 862 847 ··· 3202 3185 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf02c, 3203 3186 "SRR cmd %p (se_cmd %p, tag %d, op %x), " 3204 3187 "sg_cnt=%d, offset=%d", cmd, &cmd->se_cmd, cmd->tag, 3205 - se_cmd->t_task_cdb[0], cmd->sg_cnt, cmd->offset); 3188 + se_cmd->t_task_cdb ? se_cmd->t_task_cdb[0] : 0, 3189 + cmd->sg_cnt, cmd->offset); 3206 3190 3207 3191 qlt_handle_srr(vha, sctio, imm); 3208 3192 ··· 4199 4181 tgt->datasegs_per_cmd = QLA_TGT_DATASEGS_PER_CMD_24XX; 4200 4182 tgt->datasegs_per_cont = QLA_TGT_DATASEGS_PER_CONT_24XX; 4201 4183 4184 + if (base_vha->fc_vport) 4185 + return 0; 4186 + 4202 4187 mutex_lock(&qla_tgt_mutex); 4203 4188 list_add_tail(&tgt->tgt_list_entry, &qla_tgt_glist); 4204 4189 mutex_unlock(&qla_tgt_mutex); ··· 4215 4194 if (!vha->vha_tgt.qla_tgt) 4216 4195 return 0; 4217 4196 4197 + if (vha->fc_vport) { 4198 + qlt_release(vha->vha_tgt.qla_tgt); 4199 + return 0; 4200 + } 4218 4201 mutex_lock(&qla_tgt_mutex); 4219 4202 list_del(&vha->vha_tgt.qla_tgt->tgt_list_entry); 4220 4203 mutex_unlock(&qla_tgt_mutex); ··· 4290 4265 spin_unlock_irqrestore(&ha->hardware_lock, flags); 4291 4266 continue; 4292 4267 } 4268 + if (tgt->tgt_stop) { 4269 + pr_debug("MODE_TARGET in shutdown on qla2xxx(%d)\n", 4270 + host->host_no); 4271 + spin_unlock_irqrestore(&ha->hardware_lock, flags); 4272 + continue; 4273 + } 4293 4274 spin_unlock_irqrestore(&ha->hardware_lock, flags); 4294 4275 4295 4276 if (!scsi_host_get(host)) { ··· 4310 4279 scsi_host_put(host); 4311 4280 continue; 4312 4281 } 4313 - mutex_unlock(&qla_tgt_mutex); 4314 - 4315 4282 rc = (*callback)(vha, target_lport_ptr, npiv_wwpn, npiv_wwnn); 4316 4283 if (rc != 0) 4317 4284 scsi_host_put(host); 4318 4285 4286 + mutex_unlock(&qla_tgt_mutex); 4319 4287 return rc; 4320 4288 } 4321 4289 mutex_unlock(&qla_tgt_mutex);
+1 -1
drivers/scsi/qla2xxx/qla_target.h
··· 1001 1001 extern void qlt_probe_one_stage1(struct scsi_qla_host *, struct qla_hw_data *); 1002 1002 extern int qlt_mem_alloc(struct qla_hw_data *); 1003 1003 extern void qlt_mem_free(struct qla_hw_data *); 1004 - extern void qlt_stop_phase1(struct qla_tgt *); 1004 + extern int qlt_stop_phase1(struct qla_tgt *); 1005 1005 extern void qlt_stop_phase2(struct qla_tgt *); 1006 1006 extern irqreturn_t qla83xx_msix_atio_q(int, void *); 1007 1007 extern void qlt_83xx_iospace_config(struct qla_hw_data *);
+115 -43
drivers/scsi/qla2xxx/tcm_qla2xxx.c
··· 182 182 return 0; 183 183 } 184 184 185 - static ssize_t tcm_qla2xxx_npiv_format_wwn(char *buf, size_t len, 186 - u64 wwpn, u64 wwnn) 187 - { 188 - u8 b[8], b2[8]; 189 - 190 - put_unaligned_be64(wwpn, b); 191 - put_unaligned_be64(wwnn, b2); 192 - return snprintf(buf, len, 193 - "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x," 194 - "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x", 195 - b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], 196 - b2[0], b2[1], b2[2], b2[3], b2[4], b2[5], b2[6], b2[7]); 197 - } 198 - 199 185 static char *tcm_qla2xxx_npiv_get_fabric_name(void) 200 186 { 201 187 return "qla2xxx_npiv"; ··· 211 225 struct tcm_qla2xxx_lport *lport = tpg->lport; 212 226 213 227 return lport->lport_naa_name; 214 - } 215 - 216 - static char *tcm_qla2xxx_npiv_get_fabric_wwn(struct se_portal_group *se_tpg) 217 - { 218 - struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, 219 - struct tcm_qla2xxx_tpg, se_tpg); 220 - struct tcm_qla2xxx_lport *lport = tpg->lport; 221 - 222 - return &lport->lport_npiv_name[0]; 223 228 } 224 229 225 230 static u16 tcm_qla2xxx_get_tag(struct se_portal_group *se_tpg) ··· 918 941 atomic_read(&tpg->lport_tpg_enabled)); 919 942 } 920 943 944 + static void tcm_qla2xxx_depend_tpg(struct work_struct *work) 945 + { 946 + struct tcm_qla2xxx_tpg *base_tpg = container_of(work, 947 + struct tcm_qla2xxx_tpg, tpg_base_work); 948 + struct se_portal_group *se_tpg = &base_tpg->se_tpg; 949 + struct scsi_qla_host *base_vha = base_tpg->lport->qla_vha; 950 + 951 + if (!configfs_depend_item(se_tpg->se_tpg_tfo->tf_subsys, 952 + &se_tpg->tpg_group.cg_item)) { 953 + atomic_set(&base_tpg->lport_tpg_enabled, 1); 954 + qlt_enable_vha(base_vha); 955 + } 956 + complete(&base_tpg->tpg_base_comp); 957 + } 958 + 959 + static void tcm_qla2xxx_undepend_tpg(struct work_struct *work) 960 + { 961 + struct tcm_qla2xxx_tpg *base_tpg = container_of(work, 962 + struct tcm_qla2xxx_tpg, tpg_base_work); 963 + struct se_portal_group *se_tpg = &base_tpg->se_tpg; 964 + struct scsi_qla_host *base_vha = base_tpg->lport->qla_vha; 965 + 966 + if (!qlt_stop_phase1(base_vha->vha_tgt.qla_tgt)) { 967 + atomic_set(&base_tpg->lport_tpg_enabled, 0); 968 + configfs_undepend_item(se_tpg->se_tpg_tfo->tf_subsys, 969 + &se_tpg->tpg_group.cg_item); 970 + } 971 + complete(&base_tpg->tpg_base_comp); 972 + } 973 + 921 974 static ssize_t tcm_qla2xxx_tpg_store_enable( 922 975 struct se_portal_group *se_tpg, 923 976 const char *page, 924 977 size_t count) 925 978 { 926 - struct se_wwn *se_wwn = se_tpg->se_tpg_wwn; 927 - struct tcm_qla2xxx_lport *lport = container_of(se_wwn, 928 - struct tcm_qla2xxx_lport, lport_wwn); 929 - struct scsi_qla_host *vha = lport->qla_vha; 930 979 struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, 931 980 struct tcm_qla2xxx_tpg, se_tpg); 932 981 unsigned long op; ··· 967 964 pr_err("Illegal value for tpg_enable: %lu\n", op); 968 965 return -EINVAL; 969 966 } 967 + if (op) { 968 + if (atomic_read(&tpg->lport_tpg_enabled)) 969 + return -EEXIST; 970 + 971 + INIT_WORK(&tpg->tpg_base_work, tcm_qla2xxx_depend_tpg); 972 + } else { 973 + if (!atomic_read(&tpg->lport_tpg_enabled)) 974 + return count; 975 + 976 + INIT_WORK(&tpg->tpg_base_work, tcm_qla2xxx_undepend_tpg); 977 + } 978 + init_completion(&tpg->tpg_base_comp); 979 + schedule_work(&tpg->tpg_base_work); 980 + wait_for_completion(&tpg->tpg_base_comp); 970 981 971 982 if (op) { 972 - atomic_set(&tpg->lport_tpg_enabled, 1); 973 - qlt_enable_vha(vha); 974 - } else { 975 - if (!vha->vha_tgt.qla_tgt) { 976 - pr_err("struct qla_hw_data *vha->vha_tgt.qla_tgt is NULL\n"); 983 + if (!atomic_read(&tpg->lport_tpg_enabled)) 977 984 return -ENODEV; 978 - } 979 - atomic_set(&tpg->lport_tpg_enabled, 0); 980 - qlt_stop_phase1(vha->vha_tgt.qla_tgt); 985 + } else { 986 + if (atomic_read(&tpg->lport_tpg_enabled)) 987 + return -EPERM; 981 988 } 982 - 983 989 return count; 984 990 } 985 991 ··· 1065 1053 /* 1066 1054 * Clear local TPG=1 pointer for non NPIV mode. 1067 1055 */ 1068 - lport->tpg_1 = NULL; 1069 - 1056 + lport->tpg_1 = NULL; 1070 1057 kfree(tpg); 1071 1058 } 1059 + 1060 + static ssize_t tcm_qla2xxx_npiv_tpg_show_enable( 1061 + struct se_portal_group *se_tpg, 1062 + char *page) 1063 + { 1064 + return tcm_qla2xxx_tpg_show_enable(se_tpg, page); 1065 + } 1066 + 1067 + static ssize_t tcm_qla2xxx_npiv_tpg_store_enable( 1068 + struct se_portal_group *se_tpg, 1069 + const char *page, 1070 + size_t count) 1071 + { 1072 + struct se_wwn *se_wwn = se_tpg->se_tpg_wwn; 1073 + struct tcm_qla2xxx_lport *lport = container_of(se_wwn, 1074 + struct tcm_qla2xxx_lport, lport_wwn); 1075 + struct scsi_qla_host *vha = lport->qla_vha; 1076 + struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, 1077 + struct tcm_qla2xxx_tpg, se_tpg); 1078 + unsigned long op; 1079 + int rc; 1080 + 1081 + rc = kstrtoul(page, 0, &op); 1082 + if (rc < 0) { 1083 + pr_err("kstrtoul() returned %d\n", rc); 1084 + return -EINVAL; 1085 + } 1086 + if ((op != 1) && (op != 0)) { 1087 + pr_err("Illegal value for tpg_enable: %lu\n", op); 1088 + return -EINVAL; 1089 + } 1090 + if (op) { 1091 + if (atomic_read(&tpg->lport_tpg_enabled)) 1092 + return -EEXIST; 1093 + 1094 + atomic_set(&tpg->lport_tpg_enabled, 1); 1095 + qlt_enable_vha(vha); 1096 + } else { 1097 + if (!atomic_read(&tpg->lport_tpg_enabled)) 1098 + return count; 1099 + 1100 + atomic_set(&tpg->lport_tpg_enabled, 0); 1101 + qlt_stop_phase1(vha->vha_tgt.qla_tgt); 1102 + } 1103 + 1104 + return count; 1105 + } 1106 + 1107 + TF_TPG_BASE_ATTR(tcm_qla2xxx_npiv, enable, S_IRUGO | S_IWUSR); 1108 + 1109 + static struct configfs_attribute *tcm_qla2xxx_npiv_tpg_attrs[] = { 1110 + &tcm_qla2xxx_npiv_tpg_enable.attr, 1111 + NULL, 1112 + }; 1072 1113 1073 1114 static struct se_portal_group *tcm_qla2xxx_npiv_make_tpg( 1074 1115 struct se_wwn *wwn, ··· 1715 1650 struct scsi_qla_host *npiv_vha; 1716 1651 struct tcm_qla2xxx_lport *lport = 1717 1652 (struct tcm_qla2xxx_lport *)target_lport_ptr; 1653 + struct tcm_qla2xxx_lport *base_lport = 1654 + (struct tcm_qla2xxx_lport *)base_vha->vha_tgt.target_lport_ptr; 1655 + struct tcm_qla2xxx_tpg *base_tpg; 1718 1656 struct fc_vport_identifiers vport_id; 1719 1657 1720 1658 if (!qla_tgt_mode_enabled(base_vha)) { 1721 1659 pr_err("qla2xxx base_vha not enabled for target mode\n"); 1722 1660 return -EPERM; 1723 1661 } 1662 + 1663 + if (!base_lport || !base_lport->tpg_1 || 1664 + !atomic_read(&base_lport->tpg_1->lport_tpg_enabled)) { 1665 + pr_err("qla2xxx base_lport or tpg_1 not available\n"); 1666 + return -EPERM; 1667 + } 1668 + base_tpg = base_lport->tpg_1; 1724 1669 1725 1670 memset(&vport_id, 0, sizeof(vport_id)); 1726 1671 vport_id.port_name = npiv_wwpn; ··· 1750 1675 npiv_vha = (struct scsi_qla_host *)vport->dd_data; 1751 1676 npiv_vha->vha_tgt.target_lport_ptr = target_lport_ptr; 1752 1677 lport->qla_vha = npiv_vha; 1753 - 1754 1678 scsi_host_get(npiv_vha->host); 1755 1679 return 0; 1756 1680 } ··· 1788 1714 } 1789 1715 lport->lport_npiv_wwpn = npiv_wwpn; 1790 1716 lport->lport_npiv_wwnn = npiv_wwnn; 1791 - tcm_qla2xxx_npiv_format_wwn(&lport->lport_npiv_name[0], 1792 - TCM_QLA2XXX_NAMELEN, npiv_wwpn, npiv_wwnn); 1793 1717 sprintf(lport->lport_naa_name, "naa.%016llx", (unsigned long long) npiv_wwpn); 1794 1718 1795 1719 ret = tcm_qla2xxx_init_lport(lport); ··· 1896 1824 static struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { 1897 1825 .get_fabric_name = tcm_qla2xxx_npiv_get_fabric_name, 1898 1826 .get_fabric_proto_ident = tcm_qla2xxx_get_fabric_proto_ident, 1899 - .tpg_get_wwn = tcm_qla2xxx_npiv_get_fabric_wwn, 1827 + .tpg_get_wwn = tcm_qla2xxx_get_fabric_wwn, 1900 1828 .tpg_get_tag = tcm_qla2xxx_get_tag, 1901 1829 .tpg_get_default_depth = tcm_qla2xxx_get_default_depth, 1902 1830 .tpg_get_pr_transport_id = tcm_qla2xxx_get_pr_transport_id, ··· 2007 1935 */ 2008 1936 npiv_fabric->tf_cit_tmpl.tfc_wwn_cit.ct_attrs = tcm_qla2xxx_wwn_attrs; 2009 1937 npiv_fabric->tf_cit_tmpl.tfc_tpg_base_cit.ct_attrs = 2010 - tcm_qla2xxx_tpg_attrs; 1938 + tcm_qla2xxx_npiv_tpg_attrs; 2011 1939 npiv_fabric->tf_cit_tmpl.tfc_tpg_attrib_cit.ct_attrs = NULL; 2012 1940 npiv_fabric->tf_cit_tmpl.tfc_tpg_param_cit.ct_attrs = NULL; 2013 1941 npiv_fabric->tf_cit_tmpl.tfc_tpg_np_base_cit.ct_attrs = NULL;
+3 -4
drivers/scsi/qla2xxx/tcm_qla2xxx.h
··· 4 4 #define TCM_QLA2XXX_VERSION "v0.1" 5 5 /* length of ASCII WWPNs including pad */ 6 6 #define TCM_QLA2XXX_NAMELEN 32 7 - /* lenth of ASCII NPIV 'WWPN+WWNN' including pad */ 8 - #define TCM_QLA2XXX_NPIV_NAMELEN 66 9 7 10 8 #include "qla_target.h" 11 9 ··· 41 43 struct tcm_qla2xxx_tpg_attrib tpg_attrib; 42 44 /* Returned by tcm_qla2xxx_make_tpg() */ 43 45 struct se_portal_group se_tpg; 46 + /* Items for dealing with configfs_depend_item */ 47 + struct completion tpg_base_comp; 48 + struct work_struct tpg_base_work; 44 49 }; 45 50 46 51 struct tcm_qla2xxx_fc_loopid { ··· 63 62 char lport_name[TCM_QLA2XXX_NAMELEN]; 64 63 /* ASCII formatted naa WWPN for VPD page 83 etc */ 65 64 char lport_naa_name[TCM_QLA2XXX_NAMELEN]; 66 - /* ASCII formatted WWPN+WWNN for NPIV FC Target Lport */ 67 - char lport_npiv_name[TCM_QLA2XXX_NPIV_NAMELEN]; 68 65 /* map for fc_port pointers in 24-bit FC Port ID space */ 69 66 struct btree_head32 lport_fcport_map; 70 67 /* vmalloc-ed memory for fc_port pointers for 16-bit FC loop ID */
+1
drivers/staging/iio/adc/mxs-lradc.c
··· 757 757 } 758 758 759 759 /* if it is released, wait for the next touch via IRQ */ 760 + lradc->cur_plate = LRADC_TOUCH; 760 761 mxs_lradc_reg_clear(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ, LRADC_CTRL1); 761 762 mxs_lradc_reg_set(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, LRADC_CTRL1); 762 763 }
+1
drivers/staging/rtl8188eu/os_dep/usb_intf.c
··· 55 55 /****** 8188EUS ********/ 56 56 {USB_DEVICE(0x07b8, 0x8179)}, /* Abocom - Abocom */ 57 57 {USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */ 58 + {USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */ 58 59 {} /* Terminating entry */ 59 60 }; 60 61
+7 -8
drivers/target/target_core_sbc.c
··· 1074 1074 struct scatterlist *psg; 1075 1075 void *paddr, *addr; 1076 1076 unsigned int i, len, left; 1077 - unsigned int offset = 0; 1077 + unsigned int offset = sg_off; 1078 1078 1079 1079 left = sectors * dev->prot_length; 1080 1080 ··· 1084 1084 if (offset >= sg->length) { 1085 1085 sg = sg_next(sg); 1086 1086 offset = 0; 1087 - sg_off = sg->offset; 1088 1087 } 1089 1088 1090 1089 paddr = kmap_atomic(sg_page(psg)) + psg->offset; 1091 - addr = kmap_atomic(sg_page(sg)) + sg_off; 1090 + addr = kmap_atomic(sg_page(sg)) + sg->offset + offset; 1092 1091 1093 1092 if (read) 1094 1093 memcpy(paddr, addr, len); ··· 1162 1163 { 1163 1164 struct se_device *dev = cmd->se_dev; 1164 1165 struct se_dif_v1_tuple *sdt; 1165 - struct scatterlist *dsg; 1166 + struct scatterlist *dsg, *psg = sg; 1166 1167 sector_t sector = start; 1167 1168 void *daddr, *paddr; 1168 1169 int i, j, offset = sg_off; ··· 1170 1171 1171 1172 for_each_sg(cmd->t_data_sg, dsg, cmd->t_data_nents, i) { 1172 1173 daddr = kmap_atomic(sg_page(dsg)) + dsg->offset; 1173 - paddr = kmap_atomic(sg_page(sg)) + sg->offset; 1174 + paddr = kmap_atomic(sg_page(psg)) + sg->offset; 1174 1175 1175 1176 for (j = 0; j < dsg->length; j += dev->dev_attrib.block_size) { 1176 1177 1177 - if (offset >= sg->length) { 1178 + if (offset >= psg->length) { 1178 1179 kunmap_atomic(paddr); 1179 - sg = sg_next(sg); 1180 - paddr = kmap_atomic(sg_page(sg)) + sg->offset; 1180 + psg = sg_next(psg); 1181 + paddr = kmap_atomic(sg_page(psg)) + psg->offset; 1181 1182 offset = 0; 1182 1183 } 1183 1184
+3
drivers/target/target_core_transport.c
··· 1601 1601 case TCM_CHECK_CONDITION_ABORT_CMD: 1602 1602 case TCM_CHECK_CONDITION_UNIT_ATTENTION: 1603 1603 case TCM_CHECK_CONDITION_NOT_READY: 1604 + case TCM_LOGICAL_BLOCK_GUARD_CHECK_FAILED: 1605 + case TCM_LOGICAL_BLOCK_APP_TAG_CHECK_FAILED: 1606 + case TCM_LOGICAL_BLOCK_REF_TAG_CHECK_FAILED: 1604 1607 break; 1605 1608 case TCM_OUT_OF_RESOURCES: 1606 1609 sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
+10 -3
drivers/usb/host/ehci-hcd.c
··· 685 685 struct ehci_hcd *ehci = hcd_to_ehci (hcd); 686 686 u32 status, masked_status, pcd_status = 0, cmd; 687 687 int bh; 688 + unsigned long flags; 688 689 689 - spin_lock (&ehci->lock); 690 + /* 691 + * For threadirqs option we use spin_lock_irqsave() variant to prevent 692 + * deadlock with ehci hrtimer callback, because hrtimer callbacks run 693 + * in interrupt context even when threadirqs is specified. We can go 694 + * back to spin_lock() variant when hrtimer callbacks become threaded. 695 + */ 696 + spin_lock_irqsave(&ehci->lock, flags); 690 697 691 698 status = ehci_readl(ehci, &ehci->regs->status); 692 699 ··· 711 704 712 705 /* Shared IRQ? */ 713 706 if (!masked_status || unlikely(ehci->rh_state == EHCI_RH_HALTED)) { 714 - spin_unlock(&ehci->lock); 707 + spin_unlock_irqrestore(&ehci->lock, flags); 715 708 return IRQ_NONE; 716 709 } 717 710 ··· 822 815 823 816 if (bh) 824 817 ehci_work (ehci); 825 - spin_unlock (&ehci->lock); 818 + spin_unlock_irqrestore(&ehci->lock, flags); 826 819 if (pcd_status) 827 820 usb_hcd_poll_rh_status(hcd); 828 821 return IRQ_HANDLED;
+2
drivers/usb/serial/ftdi_sio.c
··· 907 907 /* Crucible Devices */ 908 908 { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, 909 909 { USB_DEVICE(FTDI_VID, FTDI_Z3X_PID) }, 910 + /* Cressi Devices */ 911 + { USB_DEVICE(FTDI_VID, FTDI_CRESSI_PID) }, 910 912 { } /* Terminating entry */ 911 913 }; 912 914
+6
drivers/usb/serial/ftdi_sio_ids.h
··· 1320 1320 * Manufacturer: Smart GSM Team 1321 1321 */ 1322 1322 #define FTDI_Z3X_PID 0x0011 1323 + 1324 + /* 1325 + * Product: Cressi PC Interface 1326 + * Manufacturer: Cressi 1327 + */ 1328 + #define FTDI_CRESSI_PID 0x87d0
+6
drivers/vhost/scsi.c
··· 1001 1001 break; 1002 1002 } 1003 1003 1004 + /* virtio-scsi spec requires byte 0 of the lun to be 1 */ 1005 + if (unlikely(v_req.lun[0] != 1)) { 1006 + vhost_scsi_send_bad_target(vs, vq, head, out); 1007 + continue; 1008 + } 1009 + 1004 1010 /* Extract the tpgt */ 1005 1011 target = v_req.lun[1]; 1006 1012 tpg = ACCESS_ONCE(vs_tpg[target]);
+11 -22
fs/fs-writeback.c
··· 40 40 struct wb_writeback_work { 41 41 long nr_pages; 42 42 struct super_block *sb; 43 - /* 44 - * Write only inodes dirtied before this time. Don't forget to set 45 - * older_than_this_is_set when you set this. 46 - */ 47 - unsigned long older_than_this; 43 + unsigned long *older_than_this; 48 44 enum writeback_sync_modes sync_mode; 49 45 unsigned int tagged_writepages:1; 50 46 unsigned int for_kupdate:1; 51 47 unsigned int range_cyclic:1; 52 48 unsigned int for_background:1; 53 49 unsigned int for_sync:1; /* sync(2) WB_SYNC_ALL writeback */ 54 - unsigned int older_than_this_is_set:1; 55 50 enum wb_reason reason; /* why was writeback initiated? */ 56 51 57 52 struct list_head list; /* pending work list */ ··· 247 252 int do_sb_sort = 0; 248 253 int moved = 0; 249 254 250 - WARN_ON_ONCE(!work->older_than_this_is_set); 251 255 while (!list_empty(delaying_queue)) { 252 256 inode = wb_inode(delaying_queue->prev); 253 - if (inode_dirtied_after(inode, work->older_than_this)) 257 + if (work->older_than_this && 258 + inode_dirtied_after(inode, *work->older_than_this)) 254 259 break; 255 260 list_move(&inode->i_wb_list, &tmp); 256 261 moved++; ··· 737 742 .sync_mode = WB_SYNC_NONE, 738 743 .range_cyclic = 1, 739 744 .reason = reason, 740 - .older_than_this = jiffies, 741 - .older_than_this_is_set = 1, 742 745 }; 743 746 744 747 spin_lock(&wb->list_lock); ··· 795 802 { 796 803 unsigned long wb_start = jiffies; 797 804 long nr_pages = work->nr_pages; 805 + unsigned long oldest_jif; 798 806 struct inode *inode; 799 807 long progress; 800 808 801 - if (!work->older_than_this_is_set) { 802 - work->older_than_this = jiffies; 803 - work->older_than_this_is_set = 1; 804 - } 809 + oldest_jif = jiffies; 810 + work->older_than_this = &oldest_jif; 805 811 806 812 spin_lock(&wb->list_lock); 807 813 for (;;) { ··· 834 842 * safe. 835 843 */ 836 844 if (work->for_kupdate) { 837 - work->older_than_this = jiffies - 845 + oldest_jif = jiffies - 838 846 msecs_to_jiffies(dirty_expire_interval * 10); 839 847 } else if (work->for_background) 840 - work->older_than_this = jiffies; 848 + oldest_jif = jiffies; 841 849 842 850 trace_writeback_start(wb->bdi, work); 843 851 if (list_empty(&wb->b_io)) ··· 1349 1357 1350 1358 /** 1351 1359 * sync_inodes_sb - sync sb inode pages 1352 - * @sb: the superblock 1353 - * @older_than_this: timestamp 1360 + * @sb: the superblock 1354 1361 * 1355 1362 * This function writes and waits on any dirty inode belonging to this 1356 - * superblock that has been dirtied before given timestamp. 1363 + * super_block. 1357 1364 */ 1358 - void sync_inodes_sb(struct super_block *sb, unsigned long older_than_this) 1365 + void sync_inodes_sb(struct super_block *sb) 1359 1366 { 1360 1367 DECLARE_COMPLETION_ONSTACK(done); 1361 1368 struct wb_writeback_work work = { 1362 1369 .sb = sb, 1363 1370 .sync_mode = WB_SYNC_ALL, 1364 1371 .nr_pages = LONG_MAX, 1365 - .older_than_this = older_than_this, 1366 - .older_than_this_is_set = 1, 1367 1372 .range_cyclic = 0, 1368 1373 .done = &done, 1369 1374 .reason = WB_REASON_SYNC,
+7 -1
fs/kernfs/mount.c
··· 94 94 * @fs_type: file_system_type of the fs being mounted 95 95 * @flags: mount flags specified for the mount 96 96 * @root: kernfs_root of the hierarchy being mounted 97 + * @new_sb_created: tell the caller if we allocated a new superblock 97 98 * @ns: optional namespace tag of the mount 98 99 * 99 100 * This is to be called from each kernfs user's file_system_type->mount() ··· 105 104 * The return value can be passed to the vfs layer verbatim. 106 105 */ 107 106 struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, 108 - struct kernfs_root *root, const void *ns) 107 + struct kernfs_root *root, bool *new_sb_created, 108 + const void *ns) 109 109 { 110 110 struct super_block *sb; 111 111 struct kernfs_super_info *info; ··· 124 122 kfree(info); 125 123 if (IS_ERR(sb)) 126 124 return ERR_CAST(sb); 125 + 126 + if (new_sb_created) 127 + *new_sb_created = !sb->s_root; 128 + 127 129 if (!sb->s_root) { 128 130 error = kernfs_fill_super(sb); 129 131 if (error) {
+1 -1
fs/notify/dnotify/dnotify.c
··· 86 86 struct fsnotify_mark *inode_mark, 87 87 struct fsnotify_mark *vfsmount_mark, 88 88 u32 mask, void *data, int data_type, 89 - const unsigned char *file_name) 89 + const unsigned char *file_name, u32 cookie) 90 90 { 91 91 struct dnotify_mark *dn_mark; 92 92 struct dnotify_struct *dn;
+5 -3
fs/notify/fanotify/fanotify.c
··· 147 147 struct fsnotify_mark *inode_mark, 148 148 struct fsnotify_mark *fanotify_mark, 149 149 u32 mask, void *data, int data_type, 150 - const unsigned char *file_name) 150 + const unsigned char *file_name, u32 cookie) 151 151 { 152 152 int ret = 0; 153 153 struct fanotify_event_info *event; ··· 192 192 193 193 ret = fsnotify_add_notify_event(group, fsn_event, fanotify_merge); 194 194 if (ret) { 195 - BUG_ON(mask & FAN_ALL_PERM_EVENTS); 195 + /* Permission events shouldn't be merged */ 196 + BUG_ON(ret == 1 && mask & FAN_ALL_PERM_EVENTS); 196 197 /* Our event wasn't used in the end. Free it. */ 197 198 fsnotify_destroy_event(group, fsn_event); 198 - ret = 0; 199 + 200 + return 0; 199 201 } 200 202 201 203 #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
+13
fs/notify/fanotify/fanotify_user.c
··· 698 698 struct fsnotify_group *group; 699 699 int f_flags, fd; 700 700 struct user_struct *user; 701 + struct fanotify_event_info *oevent; 701 702 702 703 pr_debug("%s: flags=%d event_f_flags=%d\n", 703 704 __func__, flags, event_f_flags); ··· 731 730 group->fanotify_data.user = user; 732 731 atomic_inc(&user->fanotify_listeners); 733 732 733 + oevent = kmem_cache_alloc(fanotify_event_cachep, GFP_KERNEL); 734 + if (unlikely(!oevent)) { 735 + fd = -ENOMEM; 736 + goto out_destroy_group; 737 + } 738 + group->overflow_event = &oevent->fse; 739 + fsnotify_init_event(group->overflow_event, NULL, FS_Q_OVERFLOW); 740 + oevent->tgid = get_pid(task_tgid(current)); 741 + oevent->path.mnt = NULL; 742 + oevent->path.dentry = NULL; 743 + 734 744 group->fanotify_data.f_flags = event_f_flags; 735 745 #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS 746 + oevent->response = 0; 736 747 mutex_init(&group->fanotify_data.access_mutex); 737 748 init_waitqueue_head(&group->fanotify_data.access_waitq); 738 749 INIT_LIST_HEAD(&group->fanotify_data.access_list);
+1 -1
fs/notify/fsnotify.c
··· 179 179 180 180 return group->ops->handle_event(group, to_tell, inode_mark, 181 181 vfsmount_mark, mask, data, data_is, 182 - file_name); 182 + file_name, cookie); 183 183 } 184 184 185 185 /*
+7 -1
fs/notify/group.c
··· 55 55 /* clear the notification queue of all events */ 56 56 fsnotify_flush_notify(group); 57 57 58 + /* 59 + * Destroy overflow event (we cannot use fsnotify_destroy_event() as 60 + * that deliberately ignores overflow events. 61 + */ 62 + if (group->overflow_event) 63 + group->ops->free_event(group->overflow_event); 64 + 58 65 fsnotify_put_group(group); 59 66 } 60 67 ··· 106 99 INIT_LIST_HEAD(&group->marks_list); 107 100 108 101 group->ops = ops; 109 - fsnotify_init_event(&group->overflow_event, NULL, FS_Q_OVERFLOW); 110 102 111 103 return group; 112 104 }
+1 -1
fs/notify/inotify/inotify.h
··· 27 27 struct fsnotify_mark *inode_mark, 28 28 struct fsnotify_mark *vfsmount_mark, 29 29 u32 mask, void *data, int data_type, 30 - const unsigned char *file_name); 30 + const unsigned char *file_name, u32 cookie); 31 31 32 32 extern const struct fsnotify_ops inotify_fsnotify_ops;
+2 -1
fs/notify/inotify/inotify_fsnotify.c
··· 67 67 struct fsnotify_mark *inode_mark, 68 68 struct fsnotify_mark *vfsmount_mark, 69 69 u32 mask, void *data, int data_type, 70 - const unsigned char *file_name) 70 + const unsigned char *file_name, u32 cookie) 71 71 { 72 72 struct inotify_inode_mark *i_mark; 73 73 struct inotify_event_info *event; ··· 103 103 fsn_event = &event->fse; 104 104 fsnotify_init_event(fsn_event, inode, mask); 105 105 event->wd = i_mark->wd; 106 + event->sync_cookie = cookie; 106 107 event->name_len = len; 107 108 if (len) 108 109 strcpy(event->name, file_name);
+13 -1
fs/notify/inotify/inotify_user.c
··· 495 495 496 496 /* Queue ignore event for the watch */ 497 497 inotify_handle_event(group, NULL, fsn_mark, NULL, FS_IN_IGNORED, 498 - NULL, FSNOTIFY_EVENT_NONE, NULL); 498 + NULL, FSNOTIFY_EVENT_NONE, NULL, 0); 499 499 500 500 i_mark = container_of(fsn_mark, struct inotify_inode_mark, fsn_mark); 501 501 /* remove this mark from the idr */ ··· 633 633 static struct fsnotify_group *inotify_new_group(unsigned int max_events) 634 634 { 635 635 struct fsnotify_group *group; 636 + struct inotify_event_info *oevent; 636 637 637 638 group = fsnotify_alloc_group(&inotify_fsnotify_ops); 638 639 if (IS_ERR(group)) 639 640 return group; 641 + 642 + oevent = kmalloc(sizeof(struct inotify_event_info), GFP_KERNEL); 643 + if (unlikely(!oevent)) { 644 + fsnotify_destroy_group(group); 645 + return ERR_PTR(-ENOMEM); 646 + } 647 + group->overflow_event = &oevent->fse; 648 + fsnotify_init_event(group->overflow_event, NULL, FS_Q_OVERFLOW); 649 + oevent->wd = -1; 650 + oevent->sync_cookie = 0; 651 + oevent->name_len = 0; 640 652 641 653 group->max_events = max_events; 642 654
+15 -5
fs/notify/notification.c
··· 80 80 /* 81 81 * Add an event to the group notification queue. The group can later pull this 82 82 * event off the queue to deal with. The function returns 0 if the event was 83 - * added to the queue, 1 if the event was merged with some other queued event. 83 + * added to the queue, 1 if the event was merged with some other queued event, 84 + * 2 if the queue of events has overflown. 84 85 */ 85 86 int fsnotify_add_notify_event(struct fsnotify_group *group, 86 87 struct fsnotify_event *event, ··· 96 95 mutex_lock(&group->notification_mutex); 97 96 98 97 if (group->q_len >= group->max_events) { 98 + ret = 2; 99 99 /* Queue overflow event only if it isn't already queued */ 100 - if (list_empty(&group->overflow_event.list)) 101 - event = &group->overflow_event; 102 - ret = 1; 100 + if (!list_empty(&group->overflow_event->list)) { 101 + mutex_unlock(&group->notification_mutex); 102 + return ret; 103 + } 104 + event = group->overflow_event; 105 + goto queue; 103 106 } 104 107 105 108 if (!list_empty(list) && merge) { ··· 114 109 } 115 110 } 116 111 112 + queue: 117 113 group->q_len++; 118 114 list_add_tail(&event->list, list); 119 115 mutex_unlock(&group->notification_mutex); ··· 138 132 139 133 event = list_first_entry(&group->notification_list, 140 134 struct fsnotify_event, list); 141 - list_del(&event->list); 135 + /* 136 + * We need to init list head for the case of overflow event so that 137 + * check in fsnotify_add_notify_events() works 138 + */ 139 + list_del_init(&event->list); 142 140 group->q_len--; 143 141 144 142 return event;
+11 -3
fs/quota/dquot.c
··· 581 581 dqstats_inc(DQST_LOOKUPS); 582 582 dqput(old_dquot); 583 583 old_dquot = dquot; 584 - ret = fn(dquot, priv); 585 - if (ret < 0) 586 - goto out; 584 + /* 585 + * ->release_dquot() can be racing with us. Our reference 586 + * protects us from new calls to it so just wait for any 587 + * outstanding call and recheck the DQ_ACTIVE_B after that. 588 + */ 589 + wait_on_dquot(dquot); 590 + if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) { 591 + ret = fn(dquot, priv); 592 + if (ret < 0) 593 + goto out; 594 + } 587 595 spin_lock(&dq_list_lock); 588 596 /* We are safe to continue now because our dquot could not 589 597 * be moved out of the inuse list while we hold the reference */
+6 -9
fs/sync.c
··· 27 27 * wait == 1 case since in that case write_inode() functions do 28 28 * sync_dirty_buffer() and thus effectively write one block at a time. 29 29 */ 30 - static int __sync_filesystem(struct super_block *sb, int wait, 31 - unsigned long start) 30 + static int __sync_filesystem(struct super_block *sb, int wait) 32 31 { 33 32 if (wait) 34 - sync_inodes_sb(sb, start); 33 + sync_inodes_sb(sb); 35 34 else 36 35 writeback_inodes_sb(sb, WB_REASON_SYNC); 37 36 ··· 47 48 int sync_filesystem(struct super_block *sb) 48 49 { 49 50 int ret; 50 - unsigned long start = jiffies; 51 51 52 52 /* 53 53 * We need to be protected against the filesystem going from ··· 60 62 if (sb->s_flags & MS_RDONLY) 61 63 return 0; 62 64 63 - ret = __sync_filesystem(sb, 0, start); 65 + ret = __sync_filesystem(sb, 0); 64 66 if (ret < 0) 65 67 return ret; 66 - return __sync_filesystem(sb, 1, start); 68 + return __sync_filesystem(sb, 1); 67 69 } 68 70 EXPORT_SYMBOL_GPL(sync_filesystem); 69 71 70 72 static void sync_inodes_one_sb(struct super_block *sb, void *arg) 71 73 { 72 74 if (!(sb->s_flags & MS_RDONLY)) 73 - sync_inodes_sb(sb, *((unsigned long *)arg)); 75 + sync_inodes_sb(sb); 74 76 } 75 77 76 78 static void sync_fs_one_sb(struct super_block *sb, void *arg) ··· 102 104 SYSCALL_DEFINE0(sync) 103 105 { 104 106 int nowait = 0, wait = 1; 105 - unsigned long start = jiffies; 106 107 107 108 wakeup_flusher_threads(0, WB_REASON_SYNC); 108 - iterate_supers(sync_inodes_one_sb, &start); 109 + iterate_supers(sync_inodes_one_sb, NULL); 109 110 iterate_supers(sync_fs_one_sb, &nowait); 110 111 iterate_supers(sync_fs_one_sb, &wait); 111 112 iterate_bdevs(fdatawrite_one_bdev, NULL);
+3 -2
fs/sysfs/mount.c
··· 27 27 { 28 28 struct dentry *root; 29 29 void *ns; 30 + bool new_sb; 30 31 31 32 if (!(flags & MS_KERNMOUNT)) { 32 33 if (!capable(CAP_SYS_ADMIN) && !fs_fully_visible(fs_type)) ··· 38 37 } 39 38 40 39 ns = kobj_ns_grab_current(KOBJ_NS_TYPE_NET); 41 - root = kernfs_mount_ns(fs_type, flags, sysfs_root, ns); 42 - if (IS_ERR(root)) 40 + root = kernfs_mount_ns(fs_type, flags, sysfs_root, &new_sb, ns); 41 + if (IS_ERR(root) || !new_sb) 43 42 kobj_ns_drop(KOBJ_NS_TYPE_NET, ns); 44 43 return root; 45 44 }
+12 -2
fs/udf/file.c
··· 144 144 size_t count = iocb->ki_nbytes; 145 145 struct udf_inode_info *iinfo = UDF_I(inode); 146 146 147 + mutex_lock(&inode->i_mutex); 147 148 down_write(&iinfo->i_data_sem); 148 149 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { 149 150 if (file->f_flags & O_APPEND) ··· 157 156 pos + count)) { 158 157 err = udf_expand_file_adinicb(inode); 159 158 if (err) { 159 + mutex_unlock(&inode->i_mutex); 160 160 udf_debug("udf_expand_adinicb: err=%d\n", err); 161 161 return err; 162 162 } ··· 171 169 } else 172 170 up_write(&iinfo->i_data_sem); 173 171 174 - retval = generic_file_aio_write(iocb, iov, nr_segs, ppos); 175 - if (retval > 0) 172 + retval = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); 173 + mutex_unlock(&inode->i_mutex); 174 + 175 + if (retval > 0) { 176 + ssize_t err; 177 + 176 178 mark_inode_dirty(inode); 179 + err = generic_write_sync(file, iocb->ki_pos - retval, retval); 180 + if (err < 0) 181 + retval = err; 182 + } 177 183 178 184 return retval; 179 185 }
+1
fs/udf/inode.c
··· 265 265 .nr_to_write = 1, 266 266 }; 267 267 268 + WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex)); 268 269 if (!iinfo->i_lenAlloc) { 269 270 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD)) 270 271 iinfo->i_alloc_type = ICBTAG_FLAG_AD_SHORT;
+1 -1
fs/xfs/xfs_super.c
··· 913 913 struct super_block *sb = mp->m_super; 914 914 915 915 if (down_read_trylock(&sb->s_umount)) { 916 - sync_inodes_sb(sb, jiffies); 916 + sync_inodes_sb(sb); 917 917 up_read(&sb->s_umount); 918 918 } 919 919 }
+2 -2
include/linux/fsnotify_backend.h
··· 99 99 struct fsnotify_mark *inode_mark, 100 100 struct fsnotify_mark *vfsmount_mark, 101 101 u32 mask, void *data, int data_type, 102 - const unsigned char *file_name); 102 + const unsigned char *file_name, u32 cookie); 103 103 void (*free_group_priv)(struct fsnotify_group *group); 104 104 void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group); 105 105 void (*free_event)(struct fsnotify_event *event); ··· 160 160 161 161 struct fasync_struct *fsn_fa; /* async notification */ 162 162 163 - struct fsnotify_event overflow_event; /* Event we queue when the 163 + struct fsnotify_event *overflow_event; /* Event we queue when the 164 164 * notification list is too 165 165 * full */ 166 166
-2
include/linux/ipc_namespace.h
··· 118 118 * the new maximum will handle anyone else. I may have to revisit this 119 119 * in the future. 120 120 */ 121 - #define MIN_QUEUESMAX 1 122 121 #define DFLT_QUEUESMAX 256 123 - #define HARD_QUEUESMAX 1024 124 122 #define MIN_MSGMAX 1 125 123 #define DFLT_MSG 10U 126 124 #define DFLT_MSGMAX 10
+5 -4
include/linux/kernfs.h
··· 249 249 250 250 const void *kernfs_super_ns(struct super_block *sb); 251 251 struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, 252 - struct kernfs_root *root, const void *ns); 252 + struct kernfs_root *root, bool *new_sb_created, 253 + const void *ns); 253 254 void kernfs_kill_sb(struct super_block *sb); 254 255 255 256 void kernfs_init(void); ··· 318 317 319 318 static inline struct dentry * 320 319 kernfs_mount_ns(struct file_system_type *fs_type, int flags, 321 - struct kernfs_root *root, const void *ns) 320 + struct kernfs_root *root, bool *new_sb_created, const void *ns) 322 321 { return ERR_PTR(-ENOSYS); } 323 322 324 323 static inline void kernfs_kill_sb(struct super_block *sb) { } ··· 369 368 370 369 static inline struct dentry * 371 370 kernfs_mount(struct file_system_type *fs_type, int flags, 372 - struct kernfs_root *root) 371 + struct kernfs_root *root, bool *new_sb_created) 373 372 { 374 - return kernfs_mount_ns(fs_type, flags, root, NULL); 373 + return kernfs_mount_ns(fs_type, flags, root, new_sb_created, NULL); 375 374 } 376 375 377 376 #endif /* __LINUX_KERNFS_H */
+1 -1
include/linux/writeback.h
··· 97 97 int try_to_writeback_inodes_sb(struct super_block *, enum wb_reason reason); 98 98 int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr, 99 99 enum wb_reason reason); 100 - void sync_inodes_sb(struct super_block *sb, unsigned long older_than_this); 100 + void sync_inodes_sb(struct super_block *); 101 101 void wakeup_flusher_threads(long nr_pages, enum wb_reason reason); 102 102 void inode_wait_for_writeback(struct inode *inode); 103 103
+8
include/sound/soc-dapm.h
··· 449 449 /* dapm audio pin control and status */ 450 450 int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, 451 451 const char *pin); 452 + int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, 453 + const char *pin); 452 454 int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, 453 455 const char *pin); 456 + int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, 457 + const char *pin); 454 458 int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin); 459 + int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, 460 + const char *pin); 455 461 int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, 456 462 const char *pin); 457 463 int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); 458 464 int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, 459 465 const char *pin); 466 + int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, 467 + const char *pin); 460 468 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, 461 469 const char *pin); 462 470 void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec);
+3 -3
include/trace/events/writeback.h
··· 287 287 __field(int, reason) 288 288 ), 289 289 TP_fast_assign( 290 - unsigned long older_than_this = work->older_than_this; 290 + unsigned long *older_than_this = work->older_than_this; 291 291 strncpy(__entry->name, dev_name(wb->bdi->dev), 32); 292 - __entry->older = older_than_this; 292 + __entry->older = older_than_this ? *older_than_this : 0; 293 293 __entry->age = older_than_this ? 294 - (jiffies - older_than_this) * 1000 / HZ : -1; 294 + (jiffies - *older_than_this) * 1000 / HZ : -1; 295 295 __entry->moved = moved; 296 296 __entry->reason = work->reason; 297 297 ),
+5 -1
include/uapi/asm-generic/unistd.h
··· 692 692 __SYSCALL(__NR_kcmp, sys_kcmp) 693 693 #define __NR_finit_module 273 694 694 __SYSCALL(__NR_finit_module, sys_finit_module) 695 + #define __NR_sched_setattr 274 696 + __SYSCALL(__NR_sched_setattr, sys_sched_setattr) 697 + #define __NR_sched_getattr 275 698 + __SYSCALL(__NR_sched_getattr, sys_sched_getattr) 695 699 696 700 #undef __NR_syscalls 697 - #define __NR_syscalls 274 701 + #define __NR_syscalls 276 698 702 699 703 /* 700 704 * All syscalls below here should go away really,
+12 -6
ipc/mq_sysctl.c
··· 22 22 return which; 23 23 } 24 24 25 + static int proc_mq_dointvec(ctl_table *table, int write, 26 + void __user *buffer, size_t *lenp, loff_t *ppos) 27 + { 28 + struct ctl_table mq_table; 29 + memcpy(&mq_table, table, sizeof(mq_table)); 30 + mq_table.data = get_mq(table); 31 + 32 + return proc_dointvec(&mq_table, write, buffer, lenp, ppos); 33 + } 34 + 25 35 static int proc_mq_dointvec_minmax(ctl_table *table, int write, 26 36 void __user *buffer, size_t *lenp, loff_t *ppos) 27 37 { ··· 43 33 lenp, ppos); 44 34 } 45 35 #else 36 + #define proc_mq_dointvec NULL 46 37 #define proc_mq_dointvec_minmax NULL 47 38 #endif 48 - 49 - static int msg_queues_limit_min = MIN_QUEUESMAX; 50 - static int msg_queues_limit_max = HARD_QUEUESMAX; 51 39 52 40 static int msg_max_limit_min = MIN_MSGMAX; 53 41 static int msg_max_limit_max = HARD_MSGMAX; ··· 59 51 .data = &init_ipc_ns.mq_queues_max, 60 52 .maxlen = sizeof(int), 61 53 .mode = 0644, 62 - .proc_handler = proc_mq_dointvec_minmax, 63 - .extra1 = &msg_queues_limit_min, 64 - .extra2 = &msg_queues_limit_max, 54 + .proc_handler = proc_mq_dointvec, 65 55 }, 66 56 { 67 57 .procname = "msg_max",
+3 -3
ipc/mqueue.c
··· 433 433 error = -EACCES; 434 434 goto out_unlock; 435 435 } 436 - if (ipc_ns->mq_queues_count >= HARD_QUEUESMAX || 437 - (ipc_ns->mq_queues_count >= ipc_ns->mq_queues_max && 438 - !capable(CAP_SYS_RESOURCE))) { 436 + 437 + if (ipc_ns->mq_queues_count >= ipc_ns->mq_queues_max && 438 + !capable(CAP_SYS_RESOURCE)) { 439 439 error = -ENOSPC; 440 440 goto out_unlock; 441 441 }
+1 -1
kernel/audit_tree.c
··· 916 916 struct fsnotify_mark *inode_mark, 917 917 struct fsnotify_mark *vfsmount_mark, 918 918 u32 mask, void *data, int data_type, 919 - const unsigned char *file_name) 919 + const unsigned char *file_name, u32 cookie) 920 920 { 921 921 return 0; 922 922 }
+1 -1
kernel/audit_watch.c
··· 471 471 struct fsnotify_mark *inode_mark, 472 472 struct fsnotify_mark *vfsmount_mark, 473 473 u32 mask, void *data, int data_type, 474 - const unsigned char *dname) 474 + const unsigned char *dname, u32 cookie) 475 475 { 476 476 struct inode *inode; 477 477 struct audit_parent *parent;
+6 -6
kernel/events/core.c
··· 7856 7856 static void __perf_event_exit_context(void *__info) 7857 7857 { 7858 7858 struct perf_event_context *ctx = __info; 7859 - struct perf_event *event, *tmp; 7859 + struct perf_event *event; 7860 7860 7861 7861 perf_pmu_rotate_stop(ctx->pmu); 7862 7862 7863 - list_for_each_entry_safe(event, tmp, &ctx->pinned_groups, group_entry) 7863 + rcu_read_lock(); 7864 + list_for_each_entry_rcu(event, &ctx->event_list, event_entry) 7864 7865 __perf_remove_from_context(event); 7865 - list_for_each_entry_safe(event, tmp, &ctx->flexible_groups, group_entry) 7866 - __perf_remove_from_context(event); 7866 + rcu_read_unlock(); 7867 7867 } 7868 7868 7869 7869 static void perf_event_exit_cpu_context(int cpu) ··· 7887 7887 { 7888 7888 struct swevent_htable *swhash = &per_cpu(swevent_htable, cpu); 7889 7889 7890 + perf_event_exit_cpu_context(cpu); 7891 + 7890 7892 mutex_lock(&swhash->hlist_mutex); 7891 7893 swevent_hlist_release(swhash); 7892 7894 mutex_unlock(&swhash->hlist_mutex); 7893 - 7894 - perf_event_exit_cpu_context(cpu); 7895 7895 } 7896 7896 #else 7897 7897 static inline void perf_event_exit_cpu(int cpu) { }
+6 -3
mm/huge_memory.c
··· 1166 1166 } else { 1167 1167 ret = do_huge_pmd_wp_page_fallback(mm, vma, address, 1168 1168 pmd, orig_pmd, page, haddr); 1169 - if (ret & VM_FAULT_OOM) 1169 + if (ret & VM_FAULT_OOM) { 1170 1170 split_huge_page(page); 1171 + ret |= VM_FAULT_FALLBACK; 1172 + } 1171 1173 put_page(page); 1172 1174 } 1173 1175 count_vm_event(THP_FAULT_FALLBACK); ··· 1181 1179 if (page) { 1182 1180 split_huge_page(page); 1183 1181 put_page(page); 1184 - } 1182 + } else 1183 + split_huge_page_pmd(vma, address, pmd); 1184 + ret |= VM_FAULT_FALLBACK; 1185 1185 count_vm_event(THP_FAULT_FALLBACK); 1186 - ret |= VM_FAULT_OOM; 1187 1186 goto out; 1188 1187 } 1189 1188
+3 -3
mm/memcontrol.c
··· 1687 1687 * protects memcg_name and makes sure that parallel ooms do not 1688 1688 * interleave 1689 1689 */ 1690 - static DEFINE_SPINLOCK(oom_info_lock); 1690 + static DEFINE_MUTEX(oom_info_lock); 1691 1691 struct cgroup *task_cgrp; 1692 1692 struct cgroup *mem_cgrp; 1693 1693 static char memcg_name[PATH_MAX]; ··· 1698 1698 if (!p) 1699 1699 return; 1700 1700 1701 - spin_lock(&oom_info_lock); 1701 + mutex_lock(&oom_info_lock); 1702 1702 rcu_read_lock(); 1703 1703 1704 1704 mem_cgrp = memcg->css.cgroup; ··· 1767 1767 1768 1768 pr_cont("\n"); 1769 1769 } 1770 - spin_unlock(&oom_info_lock); 1770 + mutex_unlock(&oom_info_lock); 1771 1771 } 1772 1772 1773 1773 /*
+4 -11
mm/memory.c
··· 3348 3348 if (ret & VM_FAULT_LOCKED) 3349 3349 unlock_page(vmf.page); 3350 3350 ret = VM_FAULT_HWPOISON; 3351 + page_cache_release(vmf.page); 3351 3352 goto uncharge_out; 3352 3353 } 3353 3354 ··· 3704 3703 if (unlikely(is_vm_hugetlb_page(vma))) 3705 3704 return hugetlb_fault(mm, vma, address, flags); 3706 3705 3707 - retry: 3708 3706 pgd = pgd_offset(mm, address); 3709 3707 pud = pud_alloc(mm, pgd, address); 3710 3708 if (!pud) ··· 3741 3741 if (dirty && !pmd_write(orig_pmd)) { 3742 3742 ret = do_huge_pmd_wp_page(mm, vma, address, pmd, 3743 3743 orig_pmd); 3744 - /* 3745 - * If COW results in an oom, the huge pmd will 3746 - * have been split, so retry the fault on the 3747 - * pte for a smaller charge. 3748 - */ 3749 - if (unlikely(ret & VM_FAULT_OOM)) 3750 - goto retry; 3751 - return ret; 3744 + if (!(ret & VM_FAULT_FALLBACK)) 3745 + return ret; 3752 3746 } else { 3753 3747 huge_pmd_set_accessed(mm, vma, address, pmd, 3754 3748 orig_pmd, dirty); 3749 + return 0; 3755 3750 } 3756 - 3757 - return 0; 3758 3751 } 3759 3752 } 3760 3753
+4 -4
security/selinux/ss/policydb.c
··· 3338 3338 if (rc) 3339 3339 return rc; 3340 3340 3341 - buf[0] = ft->stype; 3342 - buf[1] = ft->ttype; 3343 - buf[2] = ft->tclass; 3344 - buf[3] = otype->otype; 3341 + buf[0] = cpu_to_le32(ft->stype); 3342 + buf[1] = cpu_to_le32(ft->ttype); 3343 + buf[2] = cpu_to_le32(ft->tclass); 3344 + buf[3] = cpu_to_le32(otype->otype); 3345 3345 3346 3346 rc = put_entry(buf, sizeof(u32), 4, fp); 3347 3347 if (rc)
+48
sound/pci/hda/patch_realtek.c
··· 4319 4319 SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4320 4320 SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4321 4321 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), 4322 + /* ALC282 */ 4323 + SND_PCI_QUIRK(0x103c, 0x220f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4324 + SND_PCI_QUIRK(0x103c, 0x2213, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4325 + SND_PCI_QUIRK(0x103c, 0x2266, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4326 + SND_PCI_QUIRK(0x103c, 0x2267, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4327 + SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4328 + SND_PCI_QUIRK(0x103c, 0x2269, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4329 + SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4330 + SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4331 + SND_PCI_QUIRK(0x103c, 0x227a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4332 + SND_PCI_QUIRK(0x103c, 0x227b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4333 + SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4334 + SND_PCI_QUIRK(0x103c, 0x22a0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4335 + SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4336 + SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4337 + SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4338 + SND_PCI_QUIRK(0x103c, 0x22c0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4339 + SND_PCI_QUIRK(0x103c, 0x22c1, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4340 + SND_PCI_QUIRK(0x103c, 0x22c2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4341 + SND_PCI_QUIRK(0x103c, 0x22cd, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4342 + SND_PCI_QUIRK(0x103c, 0x22ce, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4343 + SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4344 + SND_PCI_QUIRK(0x103c, 0x22d0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4345 + /* ALC290 */ 4346 + SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4347 + SND_PCI_QUIRK(0x103c, 0x2261, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4348 + SND_PCI_QUIRK(0x103c, 0x2262, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4349 + SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4350 + SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4351 + SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4352 + SND_PCI_QUIRK(0x103c, 0x227d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4353 + SND_PCI_QUIRK(0x103c, 0x227e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4354 + SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4355 + SND_PCI_QUIRK(0x103c, 0x2280, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4356 + SND_PCI_QUIRK(0x103c, 0x2281, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4357 + SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4358 + SND_PCI_QUIRK(0x103c, 0x2289, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4359 + SND_PCI_QUIRK(0x103c, 0x228a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4360 + SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4361 + SND_PCI_QUIRK(0x103c, 0x228c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4362 + SND_PCI_QUIRK(0x103c, 0x228d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4363 + SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4364 + SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4365 + SND_PCI_QUIRK(0x103c, 0x22c6, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4366 + SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4367 + SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4368 + SND_PCI_QUIRK(0x103c, 0x22c3, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4369 + SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4322 4370 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), 4323 4371 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), 4324 4372 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
+20
sound/pci/hda/patch_sigmatel.c
··· 98 98 STAC_92HD83XXX_HP_LED, 99 99 STAC_92HD83XXX_HP_INV_LED, 100 100 STAC_92HD83XXX_HP_MIC_LED, 101 + STAC_HP_LED_GPIO10, 101 102 STAC_92HD83XXX_HEADSET_JACK, 102 103 STAC_92HD83XXX_HP, 103 104 STAC_HP_ENVY_BASS, ··· 2131 2130 } 2132 2131 } 2133 2132 2133 + static void stac92hd83xxx_fixup_hp_led_gpio10(struct hda_codec *codec, 2134 + const struct hda_fixup *fix, int action) 2135 + { 2136 + struct sigmatel_spec *spec = codec->spec; 2137 + 2138 + if (action == HDA_FIXUP_ACT_PRE_PROBE) { 2139 + spec->gpio_led = 0x10; /* GPIO4 */ 2140 + spec->default_polarity = 0; 2141 + } 2142 + } 2143 + 2134 2144 static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec, 2135 2145 const struct hda_fixup *fix, int action) 2136 2146 { ··· 2636 2624 .chained = true, 2637 2625 .chain_id = STAC_92HD83XXX_HP, 2638 2626 }, 2627 + [STAC_HP_LED_GPIO10] = { 2628 + .type = HDA_FIXUP_FUNC, 2629 + .v.func = stac92hd83xxx_fixup_hp_led_gpio10, 2630 + .chained = true, 2631 + .chain_id = STAC_92HD83XXX_HP, 2632 + }, 2639 2633 [STAC_92HD83XXX_HEADSET_JACK] = { 2640 2634 .type = HDA_FIXUP_FUNC, 2641 2635 .v.func = stac92hd83xxx_fixup_headset_jack, ··· 2720 2702 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), 2721 2703 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1888, 2722 2704 "HP Envy Spectre", STAC_HP_ENVY_BASS), 2705 + SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1899, 2706 + "HP Folio 13", STAC_HP_LED_GPIO10), 2723 2707 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18df, 2724 2708 "HP Folio", STAC_HP_BNB13_EQ), 2725 2709 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18F8,
+2 -2
sound/soc/codecs/ad1980.c
··· 57 57 static const char *ad1980_rec_sel[] = {"Mic", "CD", "NC", "AUX", "Line", 58 58 "Stereo Mix", "Mono Mix", "Phone"}; 59 59 60 - static const struct soc_enum ad1980_cap_src = 61 - SOC_ENUM_DOUBLE(AC97_REC_SEL, 8, 0, 7, ad1980_rec_sel); 60 + static SOC_ENUM_DOUBLE_DECL(ad1980_cap_src, 61 + AC97_REC_SEL, 8, 0, ad1980_rec_sel); 62 62 63 63 static const struct snd_kcontrol_new ad1980_snd_ac97_controls[] = { 64 64 SOC_DOUBLE("Master Playback Volume", AC97_MASTER, 8, 0, 31, 1),
+12
sound/soc/codecs/da732x.c
··· 1268 1268 }, 1269 1269 }; 1270 1270 1271 + static bool da732x_volatile(struct device *dev, unsigned int reg) 1272 + { 1273 + switch (reg) { 1274 + case DA732X_REG_HPL_DAC_OFF_CNTL: 1275 + case DA732X_REG_HPR_DAC_OFF_CNTL: 1276 + return true; 1277 + default: 1278 + return false; 1279 + } 1280 + } 1281 + 1271 1282 static const struct regmap_config da732x_regmap = { 1272 1283 .reg_bits = 8, 1273 1284 .val_bits = 8, 1274 1285 1275 1286 .max_register = DA732X_MAX_REG, 1287 + .volatile_reg = da732x_volatile, 1276 1288 .reg_defaults = da732x_reg_cache, 1277 1289 .num_reg_defaults = ARRAY_SIZE(da732x_reg_cache), 1278 1290 .cache_type = REGCACHE_RBTREE,
+30 -22
sound/soc/codecs/isabelle.c
··· 140 140 static const char *isabelle_rx2_texts[] = {"VRX2", "ARX2"}; 141 141 142 142 static const struct soc_enum isabelle_rx1_enum[] = { 143 - SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 3, 1, isabelle_rx1_texts), 144 - SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 5, 1, isabelle_rx1_texts), 143 + SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 3, 144 + ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts), 145 + SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 5, 146 + ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts), 145 147 }; 146 148 147 149 static const struct soc_enum isabelle_rx2_enum[] = { 148 - SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 2, 1, isabelle_rx2_texts), 149 - SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 4, 1, isabelle_rx2_texts), 150 + SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 2, 151 + ARRAY_SIZE(isabelle_rx2_texts), isabelle_rx2_texts), 152 + SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 4, 153 + ARRAY_SIZE(isabelle_rx2_texts), isabelle_rx2_texts), 150 154 }; 151 155 152 156 /* Headset DAC playback switches */ ··· 165 161 static const char *isabelle_vtx_texts[] = {"AMIC2", "DMIC"}; 166 162 167 163 static const struct soc_enum isabelle_atx_enum[] = { 168 - SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 7, 1, isabelle_atx_texts), 169 - SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 1, isabelle_atx_texts), 164 + SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 7, 165 + ARRAY_SIZE(isabelle_atx_texts), isabelle_atx_texts), 166 + SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 167 + ARRAY_SIZE(isabelle_atx_texts), isabelle_atx_texts), 170 168 }; 171 169 172 170 static const struct soc_enum isabelle_vtx_enum[] = { 173 - SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 6, 1, isabelle_vtx_texts), 174 - SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 1, isabelle_vtx_texts), 171 + SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 6, 172 + ARRAY_SIZE(isabelle_vtx_texts), isabelle_vtx_texts), 173 + SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 174 + ARRAY_SIZE(isabelle_vtx_texts), isabelle_vtx_texts), 175 175 }; 176 176 177 177 static const struct snd_kcontrol_new atx_mux_controls = ··· 191 183 /* Left analog microphone selection */ 192 184 static const char *isabelle_amic2_texts[] = {"Sub Mic", "Aux/FM Right"}; 193 185 194 - static const struct soc_enum isabelle_amic1_enum[] = { 195 - SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 5, 196 - ARRAY_SIZE(isabelle_amic1_texts), 197 - isabelle_amic1_texts), 198 - }; 186 + static SOC_ENUM_SINGLE_DECL(isabelle_amic1_enum, 187 + ISABELLE_AMIC_CFG_REG, 5, 188 + isabelle_amic1_texts); 199 189 200 - static const struct soc_enum isabelle_amic2_enum[] = { 201 - SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 4, 202 - ARRAY_SIZE(isabelle_amic2_texts), 203 - isabelle_amic2_texts), 204 - }; 190 + static SOC_ENUM_SINGLE_DECL(isabelle_amic2_enum, 191 + ISABELLE_AMIC_CFG_REG, 4, 192 + isabelle_amic2_texts); 205 193 206 194 static const struct snd_kcontrol_new amic1_control = 207 195 SOC_DAPM_ENUM("Route", isabelle_amic1_enum); ··· 210 206 static const char *isabelle_st_voice_texts[] = {"VTX1", "VTX2"}; 211 207 212 208 static const struct soc_enum isabelle_st_audio_enum[] = { 213 - SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA1_CFG_REG, 7, 1, 209 + SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA1_CFG_REG, 7, 210 + ARRAY_SIZE(isabelle_st_audio_texts), 214 211 isabelle_st_audio_texts), 215 - SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA2_CFG_REG, 7, 1, 212 + SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA2_CFG_REG, 7, 213 + ARRAY_SIZE(isabelle_st_audio_texts), 216 214 isabelle_st_audio_texts), 217 215 }; 218 216 219 217 static const struct soc_enum isabelle_st_voice_enum[] = { 220 - SOC_ENUM_SINGLE(ISABELLE_VTX_STPGA1_CFG_REG, 7, 1, 218 + SOC_ENUM_SINGLE(ISABELLE_VTX_STPGA1_CFG_REG, 7, 219 + ARRAY_SIZE(isabelle_st_voice_texts), 221 220 isabelle_st_voice_texts), 222 - SOC_ENUM_SINGLE(ISABELLE_VTX2_STPGA2_CFG_REG, 7, 1, 221 + SOC_ENUM_SINGLE(ISABELLE_VTX2_STPGA2_CFG_REG, 7, 222 + ARRAY_SIZE(isabelle_st_voice_texts), 223 223 isabelle_st_voice_texts), 224 224 }; 225 225
+38 -38
sound/soc/codecs/sta32x.c
··· 187 187 13, 16, TLV_DB_SCALE_ITEM(-1500, 300, 0), 188 188 }; 189 189 190 - static const struct soc_enum sta32x_drc_ac_enum = 191 - SOC_ENUM_SINGLE(STA32X_CONFD, STA32X_CONFD_DRC_SHIFT, 192 - 2, sta32x_drc_ac); 193 - static const struct soc_enum sta32x_auto_eq_enum = 194 - SOC_ENUM_SINGLE(STA32X_AUTO1, STA32X_AUTO1_AMEQ_SHIFT, 195 - 3, sta32x_auto_eq_mode); 196 - static const struct soc_enum sta32x_auto_gc_enum = 197 - SOC_ENUM_SINGLE(STA32X_AUTO1, STA32X_AUTO1_AMGC_SHIFT, 198 - 4, sta32x_auto_gc_mode); 199 - static const struct soc_enum sta32x_auto_xo_enum = 200 - SOC_ENUM_SINGLE(STA32X_AUTO2, STA32X_AUTO2_XO_SHIFT, 201 - 16, sta32x_auto_xo_mode); 202 - static const struct soc_enum sta32x_preset_eq_enum = 203 - SOC_ENUM_SINGLE(STA32X_AUTO3, STA32X_AUTO3_PEQ_SHIFT, 204 - 32, sta32x_preset_eq_mode); 205 - static const struct soc_enum sta32x_limiter_ch1_enum = 206 - SOC_ENUM_SINGLE(STA32X_C1CFG, STA32X_CxCFG_LS_SHIFT, 207 - 3, sta32x_limiter_select); 208 - static const struct soc_enum sta32x_limiter_ch2_enum = 209 - SOC_ENUM_SINGLE(STA32X_C2CFG, STA32X_CxCFG_LS_SHIFT, 210 - 3, sta32x_limiter_select); 211 - static const struct soc_enum sta32x_limiter_ch3_enum = 212 - SOC_ENUM_SINGLE(STA32X_C3CFG, STA32X_CxCFG_LS_SHIFT, 213 - 3, sta32x_limiter_select); 214 - static const struct soc_enum sta32x_limiter1_attack_rate_enum = 215 - SOC_ENUM_SINGLE(STA32X_L1AR, STA32X_LxA_SHIFT, 216 - 16, sta32x_limiter_attack_rate); 217 - static const struct soc_enum sta32x_limiter2_attack_rate_enum = 218 - SOC_ENUM_SINGLE(STA32X_L2AR, STA32X_LxA_SHIFT, 219 - 16, sta32x_limiter_attack_rate); 220 - static const struct soc_enum sta32x_limiter1_release_rate_enum = 221 - SOC_ENUM_SINGLE(STA32X_L1AR, STA32X_LxR_SHIFT, 222 - 16, sta32x_limiter_release_rate); 223 - static const struct soc_enum sta32x_limiter2_release_rate_enum = 224 - SOC_ENUM_SINGLE(STA32X_L2AR, STA32X_LxR_SHIFT, 225 - 16, sta32x_limiter_release_rate); 190 + static SOC_ENUM_SINGLE_DECL(sta32x_drc_ac_enum, 191 + STA32X_CONFD, STA32X_CONFD_DRC_SHIFT, 192 + sta32x_drc_ac); 193 + static SOC_ENUM_SINGLE_DECL(sta32x_auto_eq_enum, 194 + STA32X_AUTO1, STA32X_AUTO1_AMEQ_SHIFT, 195 + sta32x_auto_eq_mode); 196 + static SOC_ENUM_SINGLE_DECL(sta32x_auto_gc_enum, 197 + STA32X_AUTO1, STA32X_AUTO1_AMGC_SHIFT, 198 + sta32x_auto_gc_mode); 199 + static SOC_ENUM_SINGLE_DECL(sta32x_auto_xo_enum, 200 + STA32X_AUTO2, STA32X_AUTO2_XO_SHIFT, 201 + sta32x_auto_xo_mode); 202 + static SOC_ENUM_SINGLE_DECL(sta32x_preset_eq_enum, 203 + STA32X_AUTO3, STA32X_AUTO3_PEQ_SHIFT, 204 + sta32x_preset_eq_mode); 205 + static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch1_enum, 206 + STA32X_C1CFG, STA32X_CxCFG_LS_SHIFT, 207 + sta32x_limiter_select); 208 + static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch2_enum, 209 + STA32X_C2CFG, STA32X_CxCFG_LS_SHIFT, 210 + sta32x_limiter_select); 211 + static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch3_enum, 212 + STA32X_C3CFG, STA32X_CxCFG_LS_SHIFT, 213 + sta32x_limiter_select); 214 + static SOC_ENUM_SINGLE_DECL(sta32x_limiter1_attack_rate_enum, 215 + STA32X_L1AR, STA32X_LxA_SHIFT, 216 + sta32x_limiter_attack_rate); 217 + static SOC_ENUM_SINGLE_DECL(sta32x_limiter2_attack_rate_enum, 218 + STA32X_L2AR, STA32X_LxA_SHIFT, 219 + sta32x_limiter_attack_rate); 220 + static SOC_ENUM_SINGLE_DECL(sta32x_limiter1_release_rate_enum, 221 + STA32X_L1AR, STA32X_LxR_SHIFT, 222 + sta32x_limiter_release_rate); 223 + static SOC_ENUM_SINGLE_DECL(sta32x_limiter2_release_rate_enum, 224 + STA32X_L2AR, STA32X_LxR_SHIFT, 225 + sta32x_limiter_release_rate); 226 226 227 227 /* byte array controls for setting biquad, mixer, scaling coefficients; 228 228 * for biquads all five coefficients need to be set in one go, ··· 331 331 332 332 static int sta32x_cache_sync(struct snd_soc_codec *codec) 333 333 { 334 - struct sta32x_priv *sta32x = codec->control_data; 334 + struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); 335 335 unsigned int mute; 336 336 int rc; 337 337 ··· 434 434 SOC_ENUM("Limiter1 Attack Rate (dB/ms)", sta32x_limiter1_attack_rate_enum), 435 435 SOC_ENUM("Limiter2 Attack Rate (dB/ms)", sta32x_limiter2_attack_rate_enum), 436 436 SOC_ENUM("Limiter1 Release Rate (dB/ms)", sta32x_limiter1_release_rate_enum), 437 - SOC_ENUM("Limiter2 Release Rate (dB/ms)", sta32x_limiter1_release_rate_enum), 437 + SOC_ENUM("Limiter2 Release Rate (dB/ms)", sta32x_limiter2_release_rate_enum), 438 438 439 439 /* depending on mode, the attack/release thresholds have 440 440 * two different enum definitions; provide both
+20 -14
sound/soc/codecs/wm8400.c
··· 117 117 static const char *wm8400_digital_sidetone[] = 118 118 {"None", "Left ADC", "Right ADC", "Reserved"}; 119 119 120 - static const struct soc_enum wm8400_left_digital_sidetone_enum = 121 - SOC_ENUM_SINGLE(WM8400_DIGITAL_SIDE_TONE, 122 - WM8400_ADC_TO_DACL_SHIFT, 2, wm8400_digital_sidetone); 120 + static SOC_ENUM_SINGLE_DECL(wm8400_left_digital_sidetone_enum, 121 + WM8400_DIGITAL_SIDE_TONE, 122 + WM8400_ADC_TO_DACL_SHIFT, 123 + wm8400_digital_sidetone); 123 124 124 - static const struct soc_enum wm8400_right_digital_sidetone_enum = 125 - SOC_ENUM_SINGLE(WM8400_DIGITAL_SIDE_TONE, 126 - WM8400_ADC_TO_DACR_SHIFT, 2, wm8400_digital_sidetone); 125 + static SOC_ENUM_SINGLE_DECL(wm8400_right_digital_sidetone_enum, 126 + WM8400_DIGITAL_SIDE_TONE, 127 + WM8400_ADC_TO_DACR_SHIFT, 128 + wm8400_digital_sidetone); 127 129 128 130 static const char *wm8400_adcmode[] = 129 131 {"Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3"}; 130 132 131 - static const struct soc_enum wm8400_right_adcmode_enum = 132 - SOC_ENUM_SINGLE(WM8400_ADC_CTRL, WM8400_ADC_HPF_CUT_SHIFT, 3, wm8400_adcmode); 133 + static SOC_ENUM_SINGLE_DECL(wm8400_right_adcmode_enum, 134 + WM8400_ADC_CTRL, 135 + WM8400_ADC_HPF_CUT_SHIFT, 136 + wm8400_adcmode); 133 137 134 138 static const struct snd_kcontrol_new wm8400_snd_controls[] = { 135 139 /* INMIXL */ ··· 426 422 static const char *wm8400_ainlmux[] = 427 423 {"INMIXL Mix", "RXVOICE Mix", "DIFFINL Mix"}; 428 424 429 - static const struct soc_enum wm8400_ainlmux_enum = 430 - SOC_ENUM_SINGLE( WM8400_INPUT_MIXER1, WM8400_AINLMODE_SHIFT, 431 - ARRAY_SIZE(wm8400_ainlmux), wm8400_ainlmux); 425 + static SOC_ENUM_SINGLE_DECL(wm8400_ainlmux_enum, 426 + WM8400_INPUT_MIXER1, 427 + WM8400_AINLMODE_SHIFT, 428 + wm8400_ainlmux); 432 429 433 430 static const struct snd_kcontrol_new wm8400_dapm_ainlmux_controls = 434 431 SOC_DAPM_ENUM("Route", wm8400_ainlmux_enum); ··· 440 435 static const char *wm8400_ainrmux[] = 441 436 {"INMIXR Mix", "RXVOICE Mix", "DIFFINR Mix"}; 442 437 443 - static const struct soc_enum wm8400_ainrmux_enum = 444 - SOC_ENUM_SINGLE( WM8400_INPUT_MIXER1, WM8400_AINRMODE_SHIFT, 445 - ARRAY_SIZE(wm8400_ainrmux), wm8400_ainrmux); 438 + static SOC_ENUM_SINGLE_DECL(wm8400_ainrmux_enum, 439 + WM8400_INPUT_MIXER1, 440 + WM8400_AINRMODE_SHIFT, 441 + wm8400_ainrmux); 446 442 447 443 static const struct snd_kcontrol_new wm8400_dapm_ainrmux_controls = 448 444 SOC_DAPM_ENUM("Route", wm8400_ainrmux_enum);
+2 -2
sound/soc/codecs/wm8770.c
··· 196 196 "AIN5", "AIN6", "AIN7", "AIN8" 197 197 }; 198 198 199 - static const struct soc_enum ain_enum = 200 - SOC_ENUM_DOUBLE(WM8770_ADCMUX, 0, 4, 8, ain_text); 199 + static SOC_ENUM_DOUBLE_DECL(ain_enum, 200 + WM8770_ADCMUX, 0, 4, ain_text); 201 201 202 202 static const struct snd_kcontrol_new ain_mux = 203 203 SOC_DAPM_ENUM("Capture Mux", ain_enum);
+22 -22
sound/soc/codecs/wm8900.c
··· 304 304 305 305 static const char *mic_bias_level_txt[] = { "0.9*AVDD", "0.65*AVDD" }; 306 306 307 - static const struct soc_enum mic_bias_level = 308 - SOC_ENUM_SINGLE(WM8900_REG_INCTL, 8, 2, mic_bias_level_txt); 307 + static SOC_ENUM_SINGLE_DECL(mic_bias_level, 308 + WM8900_REG_INCTL, 8, mic_bias_level_txt); 309 309 310 310 static const char *dac_mute_rate_txt[] = { "Fast", "Slow" }; 311 311 312 - static const struct soc_enum dac_mute_rate = 313 - SOC_ENUM_SINGLE(WM8900_REG_DACCTRL, 7, 2, dac_mute_rate_txt); 312 + static SOC_ENUM_SINGLE_DECL(dac_mute_rate, 313 + WM8900_REG_DACCTRL, 7, dac_mute_rate_txt); 314 314 315 315 static const char *dac_deemphasis_txt[] = { 316 316 "Disabled", "32kHz", "44.1kHz", "48kHz" 317 317 }; 318 318 319 - static const struct soc_enum dac_deemphasis = 320 - SOC_ENUM_SINGLE(WM8900_REG_DACCTRL, 4, 4, dac_deemphasis_txt); 319 + static SOC_ENUM_SINGLE_DECL(dac_deemphasis, 320 + WM8900_REG_DACCTRL, 4, dac_deemphasis_txt); 321 321 322 322 static const char *adc_hpf_cut_txt[] = { 323 323 "Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3" 324 324 }; 325 325 326 - static const struct soc_enum adc_hpf_cut = 327 - SOC_ENUM_SINGLE(WM8900_REG_ADCCTRL, 5, 4, adc_hpf_cut_txt); 326 + static SOC_ENUM_SINGLE_DECL(adc_hpf_cut, 327 + WM8900_REG_ADCCTRL, 5, adc_hpf_cut_txt); 328 328 329 329 static const char *lr_txt[] = { 330 330 "Left", "Right" 331 331 }; 332 332 333 - static const struct soc_enum aifl_src = 334 - SOC_ENUM_SINGLE(WM8900_REG_AUDIO1, 15, 2, lr_txt); 333 + static SOC_ENUM_SINGLE_DECL(aifl_src, 334 + WM8900_REG_AUDIO1, 15, lr_txt); 335 335 336 - static const struct soc_enum aifr_src = 337 - SOC_ENUM_SINGLE(WM8900_REG_AUDIO1, 14, 2, lr_txt); 336 + static SOC_ENUM_SINGLE_DECL(aifr_src, 337 + WM8900_REG_AUDIO1, 14, lr_txt); 338 338 339 - static const struct soc_enum dacl_src = 340 - SOC_ENUM_SINGLE(WM8900_REG_AUDIO2, 15, 2, lr_txt); 339 + static SOC_ENUM_SINGLE_DECL(dacl_src, 340 + WM8900_REG_AUDIO2, 15, lr_txt); 341 341 342 - static const struct soc_enum dacr_src = 343 - SOC_ENUM_SINGLE(WM8900_REG_AUDIO2, 14, 2, lr_txt); 342 + static SOC_ENUM_SINGLE_DECL(dacr_src, 343 + WM8900_REG_AUDIO2, 14, lr_txt); 344 344 345 345 static const char *sidetone_txt[] = { 346 346 "Disabled", "Left ADC", "Right ADC" 347 347 }; 348 348 349 - static const struct soc_enum dacl_sidetone = 350 - SOC_ENUM_SINGLE(WM8900_REG_SIDETONE, 2, 3, sidetone_txt); 349 + static SOC_ENUM_SINGLE_DECL(dacl_sidetone, 350 + WM8900_REG_SIDETONE, 2, sidetone_txt); 351 351 352 - static const struct soc_enum dacr_sidetone = 353 - SOC_ENUM_SINGLE(WM8900_REG_SIDETONE, 0, 3, sidetone_txt); 352 + static SOC_ENUM_SINGLE_DECL(dacr_sidetone, 353 + WM8900_REG_SIDETONE, 0, sidetone_txt); 354 354 355 355 static const struct snd_kcontrol_new wm8900_snd_controls[] = { 356 356 SOC_ENUM("Mic Bias Level", mic_bias_level), ··· 496 496 497 497 static const char *wm8900_lp_mux[] = { "Disabled", "Enabled" }; 498 498 499 - static const struct soc_enum wm8900_lineout2_lp_mux = 500 - SOC_ENUM_SINGLE(WM8900_REG_LOUTMIXCTL1, 1, 2, wm8900_lp_mux); 499 + static SOC_ENUM_SINGLE_DECL(wm8900_lineout2_lp_mux, 500 + WM8900_REG_LOUTMIXCTL1, 1, wm8900_lp_mux); 501 501 502 502 static const struct snd_kcontrol_new wm8900_lineout2_lp = 503 503 SOC_DAPM_ENUM("Route", wm8900_lineout2_lp_mux);
+1 -1
sound/soc/codecs/wm8958-dsp2.c
··· 153 153 154 154 data32 &= 0xffffff; 155 155 156 - wm8994_bulk_write(codec->control_data, 156 + wm8994_bulk_write(wm8994->wm8994, 157 157 data32 & 0xffffff, 158 158 block_len / 2, 159 159 (void *)(data + 8));
+70 -65
sound/soc/codecs/wm8994.c
··· 265 265 "2.7kHz", "1.35kHz", "675Hz", "370Hz", "180Hz", "90Hz", "45Hz" 266 266 }; 267 267 268 - static const struct soc_enum sidetone_hpf = 269 - SOC_ENUM_SINGLE(WM8994_SIDETONE, 7, 7, sidetone_hpf_text); 268 + static SOC_ENUM_SINGLE_DECL(sidetone_hpf, 269 + WM8994_SIDETONE, 7, sidetone_hpf_text); 270 270 271 271 static const char *adc_hpf_text[] = { 272 272 "HiFi", "Voice 1", "Voice 2", "Voice 3" 273 273 }; 274 274 275 - static const struct soc_enum aif1adc1_hpf = 276 - SOC_ENUM_SINGLE(WM8994_AIF1_ADC1_FILTERS, 13, 4, adc_hpf_text); 275 + static SOC_ENUM_SINGLE_DECL(aif1adc1_hpf, 276 + WM8994_AIF1_ADC1_FILTERS, 13, adc_hpf_text); 277 277 278 - static const struct soc_enum aif1adc2_hpf = 279 - SOC_ENUM_SINGLE(WM8994_AIF1_ADC2_FILTERS, 13, 4, adc_hpf_text); 278 + static SOC_ENUM_SINGLE_DECL(aif1adc2_hpf, 279 + WM8994_AIF1_ADC2_FILTERS, 13, adc_hpf_text); 280 280 281 - static const struct soc_enum aif2adc_hpf = 282 - SOC_ENUM_SINGLE(WM8994_AIF2_ADC_FILTERS, 13, 4, adc_hpf_text); 281 + static SOC_ENUM_SINGLE_DECL(aif2adc_hpf, 282 + WM8994_AIF2_ADC_FILTERS, 13, adc_hpf_text); 283 283 284 284 static const DECLARE_TLV_DB_SCALE(aif_tlv, 0, 600, 0); 285 285 static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1); ··· 501 501 "Left", "Right" 502 502 }; 503 503 504 - static const struct soc_enum aif1adcl_src = 505 - SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 15, 2, aif_chan_src_text); 504 + static SOC_ENUM_SINGLE_DECL(aif1adcl_src, 505 + WM8994_AIF1_CONTROL_1, 15, aif_chan_src_text); 506 506 507 - static const struct soc_enum aif1adcr_src = 508 - SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 14, 2, aif_chan_src_text); 507 + static SOC_ENUM_SINGLE_DECL(aif1adcr_src, 508 + WM8994_AIF1_CONTROL_1, 14, aif_chan_src_text); 509 509 510 - static const struct soc_enum aif2adcl_src = 511 - SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 15, 2, aif_chan_src_text); 510 + static SOC_ENUM_SINGLE_DECL(aif2adcl_src, 511 + WM8994_AIF2_CONTROL_1, 15, aif_chan_src_text); 512 512 513 - static const struct soc_enum aif2adcr_src = 514 - SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 14, 2, aif_chan_src_text); 513 + static SOC_ENUM_SINGLE_DECL(aif2adcr_src, 514 + WM8994_AIF2_CONTROL_1, 14, aif_chan_src_text); 515 515 516 - static const struct soc_enum aif1dacl_src = 517 - SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 15, 2, aif_chan_src_text); 516 + static SOC_ENUM_SINGLE_DECL(aif1dacl_src, 517 + WM8994_AIF1_CONTROL_2, 15, aif_chan_src_text); 518 518 519 - static const struct soc_enum aif1dacr_src = 520 - SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 14, 2, aif_chan_src_text); 519 + static SOC_ENUM_SINGLE_DECL(aif1dacr_src, 520 + WM8994_AIF1_CONTROL_2, 14, aif_chan_src_text); 521 521 522 - static const struct soc_enum aif2dacl_src = 523 - SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 15, 2, aif_chan_src_text); 522 + static SOC_ENUM_SINGLE_DECL(aif2dacl_src, 523 + WM8994_AIF2_CONTROL_2, 15, aif_chan_src_text); 524 524 525 - static const struct soc_enum aif2dacr_src = 526 - SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 14, 2, aif_chan_src_text); 525 + static SOC_ENUM_SINGLE_DECL(aif2dacr_src, 526 + WM8994_AIF2_CONTROL_2, 14, aif_chan_src_text); 527 527 528 528 static const char *osr_text[] = { 529 529 "Low Power", "High Performance", 530 530 }; 531 531 532 - static const struct soc_enum dac_osr = 533 - SOC_ENUM_SINGLE(WM8994_OVERSAMPLING, 0, 2, osr_text); 532 + static SOC_ENUM_SINGLE_DECL(dac_osr, 533 + WM8994_OVERSAMPLING, 0, osr_text); 534 534 535 - static const struct soc_enum adc_osr = 536 - SOC_ENUM_SINGLE(WM8994_OVERSAMPLING, 1, 2, osr_text); 535 + static SOC_ENUM_SINGLE_DECL(adc_osr, 536 + WM8994_OVERSAMPLING, 1, osr_text); 537 537 538 538 static const struct snd_kcontrol_new wm8994_snd_controls[] = { 539 539 SOC_DOUBLE_R_TLV("AIF1ADC1 Volume", WM8994_AIF1_ADC1_LEFT_VOLUME, ··· 690 690 "30ms", "125ms", "250ms", "500ms", 691 691 }; 692 692 693 - static const struct soc_enum wm8958_aif1dac1_ng_hold = 694 - SOC_ENUM_SINGLE(WM8958_AIF1_DAC1_NOISE_GATE, 695 - WM8958_AIF1DAC1_NG_THR_SHIFT, 4, wm8958_ng_text); 693 + static SOC_ENUM_SINGLE_DECL(wm8958_aif1dac1_ng_hold, 694 + WM8958_AIF1_DAC1_NOISE_GATE, 695 + WM8958_AIF1DAC1_NG_THR_SHIFT, 696 + wm8958_ng_text); 696 697 697 - static const struct soc_enum wm8958_aif1dac2_ng_hold = 698 - SOC_ENUM_SINGLE(WM8958_AIF1_DAC2_NOISE_GATE, 699 - WM8958_AIF1DAC2_NG_THR_SHIFT, 4, wm8958_ng_text); 698 + static SOC_ENUM_SINGLE_DECL(wm8958_aif1dac2_ng_hold, 699 + WM8958_AIF1_DAC2_NOISE_GATE, 700 + WM8958_AIF1DAC2_NG_THR_SHIFT, 701 + wm8958_ng_text); 700 702 701 - static const struct soc_enum wm8958_aif2dac_ng_hold = 702 - SOC_ENUM_SINGLE(WM8958_AIF2_DAC_NOISE_GATE, 703 - WM8958_AIF2DAC_NG_THR_SHIFT, 4, wm8958_ng_text); 703 + static SOC_ENUM_SINGLE_DECL(wm8958_aif2dac_ng_hold, 704 + WM8958_AIF2_DAC_NOISE_GATE, 705 + WM8958_AIF2DAC_NG_THR_SHIFT, 706 + wm8958_ng_text); 704 707 705 708 static const struct snd_kcontrol_new wm8958_snd_controls[] = { 706 709 SOC_SINGLE_TLV("AIF3 Boost Volume", WM8958_AIF3_CONTROL_2, 10, 3, 0, aif_tlv), ··· 1344 1341 "DMIC", 1345 1342 }; 1346 1343 1347 - static const struct soc_enum adc_enum = 1348 - SOC_ENUM_SINGLE(0, 0, 2, adc_mux_text); 1344 + static SOC_ENUM_SINGLE_DECL(adc_enum, 1345 + 0, 0, adc_mux_text); 1349 1346 1350 1347 static const struct snd_kcontrol_new adcl_mux = 1351 1348 SOC_DAPM_ENUM_VIRT("ADCL Mux", adc_enum); ··· 1481 1478 "ADC/DMIC1", "DMIC2", 1482 1479 }; 1483 1480 1484 - static const struct soc_enum sidetone1_enum = 1485 - SOC_ENUM_SINGLE(WM8994_SIDETONE, 0, 2, sidetone_text); 1481 + static SOC_ENUM_SINGLE_DECL(sidetone1_enum, 1482 + WM8994_SIDETONE, 0, sidetone_text); 1486 1483 1487 1484 static const struct snd_kcontrol_new sidetone1_mux = 1488 1485 SOC_DAPM_ENUM("Left Sidetone Mux", sidetone1_enum); 1489 1486 1490 - static const struct soc_enum sidetone2_enum = 1491 - SOC_ENUM_SINGLE(WM8994_SIDETONE, 1, 2, sidetone_text); 1487 + static SOC_ENUM_SINGLE_DECL(sidetone2_enum, 1488 + WM8994_SIDETONE, 1, sidetone_text); 1492 1489 1493 1490 static const struct snd_kcontrol_new sidetone2_mux = 1494 1491 SOC_DAPM_ENUM("Right Sidetone Mux", sidetone2_enum); ··· 1501 1498 "None", "ADCDAT", 1502 1499 }; 1503 1500 1504 - static const struct soc_enum aif1_loopback_enum = 1505 - SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, WM8994_AIF1_LOOPBACK_SHIFT, 2, 1506 - loopback_text); 1501 + static SOC_ENUM_SINGLE_DECL(aif1_loopback_enum, 1502 + WM8994_AIF1_CONTROL_2, 1503 + WM8994_AIF1_LOOPBACK_SHIFT, 1504 + loopback_text); 1507 1505 1508 1506 static const struct snd_kcontrol_new aif1_loopback = 1509 1507 SOC_DAPM_ENUM("AIF1 Loopback", aif1_loopback_enum); 1510 1508 1511 - static const struct soc_enum aif2_loopback_enum = 1512 - SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, WM8994_AIF2_LOOPBACK_SHIFT, 2, 1513 - loopback_text); 1509 + static SOC_ENUM_SINGLE_DECL(aif2_loopback_enum, 1510 + WM8994_AIF2_CONTROL_2, 1511 + WM8994_AIF2_LOOPBACK_SHIFT, 1512 + loopback_text); 1514 1513 1515 1514 static const struct snd_kcontrol_new aif2_loopback = 1516 1515 SOC_DAPM_ENUM("AIF2 Loopback", aif2_loopback_enum); 1517 1516 1518 - static const struct soc_enum aif1dac_enum = 1519 - SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 0, 2, aif1dac_text); 1517 + static SOC_ENUM_SINGLE_DECL(aif1dac_enum, 1518 + WM8994_POWER_MANAGEMENT_6, 0, aif1dac_text); 1520 1519 1521 1520 static const struct snd_kcontrol_new aif1dac_mux = 1522 1521 SOC_DAPM_ENUM("AIF1DAC Mux", aif1dac_enum); ··· 1527 1522 "AIF2DACDAT", "AIF3DACDAT", 1528 1523 }; 1529 1524 1530 - static const struct soc_enum aif2dac_enum = 1531 - SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 1, 2, aif2dac_text); 1525 + static SOC_ENUM_SINGLE_DECL(aif2dac_enum, 1526 + WM8994_POWER_MANAGEMENT_6, 1, aif2dac_text); 1532 1527 1533 1528 static const struct snd_kcontrol_new aif2dac_mux = 1534 1529 SOC_DAPM_ENUM("AIF2DAC Mux", aif2dac_enum); ··· 1537 1532 "AIF2ADCDAT", "AIF3DACDAT", 1538 1533 }; 1539 1534 1540 - static const struct soc_enum aif2adc_enum = 1541 - SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 2, 2, aif2adc_text); 1535 + static SOC_ENUM_SINGLE_DECL(aif2adc_enum, 1536 + WM8994_POWER_MANAGEMENT_6, 2, aif2adc_text); 1542 1537 1543 1538 static const struct snd_kcontrol_new aif2adc_mux = 1544 1539 SOC_DAPM_ENUM("AIF2ADC Mux", aif2adc_enum); ··· 1547 1542 "AIF1ADCDAT", "AIF2ADCDAT", "AIF2DACDAT", "Mono PCM", 1548 1543 }; 1549 1544 1550 - static const struct soc_enum wm8994_aif3adc_enum = 1551 - SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 3, 3, aif3adc_text); 1545 + static SOC_ENUM_SINGLE_DECL(wm8994_aif3adc_enum, 1546 + WM8994_POWER_MANAGEMENT_6, 3, aif3adc_text); 1552 1547 1553 1548 static const struct snd_kcontrol_new wm8994_aif3adc_mux = 1554 1549 SOC_DAPM_ENUM("AIF3ADC Mux", wm8994_aif3adc_enum); 1555 1550 1556 - static const struct soc_enum wm8958_aif3adc_enum = 1557 - SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 3, 4, aif3adc_text); 1551 + static SOC_ENUM_SINGLE_DECL(wm8958_aif3adc_enum, 1552 + WM8994_POWER_MANAGEMENT_6, 3, aif3adc_text); 1558 1553 1559 1554 static const struct snd_kcontrol_new wm8958_aif3adc_mux = 1560 1555 SOC_DAPM_ENUM("AIF3ADC Mux", wm8958_aif3adc_enum); ··· 1563 1558 "None", "AIF2ADCL", "AIF2ADCR", 1564 1559 }; 1565 1560 1566 - static const struct soc_enum mono_pcm_out_enum = 1567 - SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 9, 3, mono_pcm_out_text); 1561 + static SOC_ENUM_SINGLE_DECL(mono_pcm_out_enum, 1562 + WM8994_POWER_MANAGEMENT_6, 9, mono_pcm_out_text); 1568 1563 1569 1564 static const struct snd_kcontrol_new mono_pcm_out_mux = 1570 1565 SOC_DAPM_ENUM("Mono PCM Out Mux", mono_pcm_out_enum); ··· 1574 1569 }; 1575 1570 1576 1571 /* Note that these two control shouldn't be simultaneously switched to AIF3 */ 1577 - static const struct soc_enum aif2dacl_src_enum = 1578 - SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 7, 2, aif2dac_src_text); 1572 + static SOC_ENUM_SINGLE_DECL(aif2dacl_src_enum, 1573 + WM8994_POWER_MANAGEMENT_6, 7, aif2dac_src_text); 1579 1574 1580 1575 static const struct snd_kcontrol_new aif2dacl_src_mux = 1581 1576 SOC_DAPM_ENUM("AIF2DACL Mux", aif2dacl_src_enum); 1582 1577 1583 - static const struct soc_enum aif2dacr_src_enum = 1584 - SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 8, 2, aif2dac_src_text); 1578 + static SOC_ENUM_SINGLE_DECL(aif2dacr_src_enum, 1579 + WM8994_POWER_MANAGEMENT_6, 8, aif2dac_src_text); 1585 1580 1586 1581 static const struct snd_kcontrol_new aif2dacr_src_mux = 1587 1582 SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum);
+133 -20
sound/soc/soc-dapm.c
··· 1218 1218 ret = regulator_allow_bypass(w->regulator, false); 1219 1219 if (ret != 0) 1220 1220 dev_warn(w->dapm->dev, 1221 - "ASoC: Failed to bypass %s: %d\n", 1221 + "ASoC: Failed to unbypass %s: %d\n", 1222 1222 w->name, ret); 1223 1223 } 1224 1224 ··· 1228 1228 ret = regulator_allow_bypass(w->regulator, true); 1229 1229 if (ret != 0) 1230 1230 dev_warn(w->dapm->dev, 1231 - "ASoC: Failed to unbypass %s: %d\n", 1231 + "ASoC: Failed to bypass %s: %d\n", 1232 1232 w->name, ret); 1233 1233 } 1234 1234 ··· 3210 3210 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 3211 3211 const char *pin = (const char *)kcontrol->private_value; 3212 3212 3213 - mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 3214 - 3215 3213 if (ucontrol->value.integer.value[0]) 3216 3214 snd_soc_dapm_enable_pin(&card->dapm, pin); 3217 3215 else 3218 3216 snd_soc_dapm_disable_pin(&card->dapm, pin); 3219 - 3220 - mutex_unlock(&card->dapm_mutex); 3221 3217 3222 3218 snd_soc_dapm_sync(&card->dapm); 3223 3219 return 0; ··· 3244 3248 ret = regulator_allow_bypass(w->regulator, true); 3245 3249 if (ret != 0) 3246 3250 dev_warn(w->dapm->dev, 3247 - "ASoC: Failed to unbypass %s: %d\n", 3251 + "ASoC: Failed to bypass %s: %d\n", 3248 3252 w->name, ret); 3249 3253 } 3250 3254 break; ··· 3763 3767 } 3764 3768 3765 3769 /** 3770 + * snd_soc_dapm_enable_pin_unlocked - enable pin. 3771 + * @dapm: DAPM context 3772 + * @pin: pin name 3773 + * 3774 + * Enables input/output pin and its parents or children widgets iff there is 3775 + * a valid audio route and active audio stream. 3776 + * 3777 + * Requires external locking. 3778 + * 3779 + * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to 3780 + * do any widget power switching. 3781 + */ 3782 + int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, 3783 + const char *pin) 3784 + { 3785 + return snd_soc_dapm_set_pin(dapm, pin, 1); 3786 + } 3787 + EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin_unlocked); 3788 + 3789 + /** 3766 3790 * snd_soc_dapm_enable_pin - enable pin. 3767 3791 * @dapm: DAPM context 3768 3792 * @pin: pin name 3769 3793 * 3770 3794 * Enables input/output pin and its parents or children widgets iff there is 3771 3795 * a valid audio route and active audio stream. 3796 + * 3772 3797 * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to 3773 3798 * do any widget power switching. 3774 3799 */ 3775 3800 int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin) 3776 3801 { 3777 - return snd_soc_dapm_set_pin(dapm, pin, 1); 3802 + int ret; 3803 + 3804 + mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 3805 + 3806 + ret = snd_soc_dapm_set_pin(dapm, pin, 1); 3807 + 3808 + mutex_unlock(&dapm->card->dapm_mutex); 3809 + 3810 + return ret; 3778 3811 } 3779 3812 EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin); 3813 + 3814 + /** 3815 + * snd_soc_dapm_force_enable_pin_unlocked - force a pin to be enabled 3816 + * @dapm: DAPM context 3817 + * @pin: pin name 3818 + * 3819 + * Enables input/output pin regardless of any other state. This is 3820 + * intended for use with microphone bias supplies used in microphone 3821 + * jack detection. 3822 + * 3823 + * Requires external locking. 3824 + * 3825 + * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to 3826 + * do any widget power switching. 3827 + */ 3828 + int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, 3829 + const char *pin) 3830 + { 3831 + struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); 3832 + 3833 + if (!w) { 3834 + dev_err(dapm->dev, "ASoC: unknown pin %s\n", pin); 3835 + return -EINVAL; 3836 + } 3837 + 3838 + dev_dbg(w->dapm->dev, "ASoC: force enable pin %s\n", pin); 3839 + w->connected = 1; 3840 + w->force = 1; 3841 + dapm_mark_dirty(w, "force enable"); 3842 + 3843 + return 0; 3844 + } 3845 + EXPORT_SYMBOL_GPL(snd_soc_dapm_force_enable_pin_unlocked); 3780 3846 3781 3847 /** 3782 3848 * snd_soc_dapm_force_enable_pin - force a pin to be enabled ··· 3855 3797 int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, 3856 3798 const char *pin) 3857 3799 { 3858 - struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); 3800 + int ret; 3859 3801 3860 - if (!w) { 3861 - dev_err(dapm->dev, "ASoC: unknown pin %s\n", pin); 3862 - return -EINVAL; 3863 - } 3802 + mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 3864 3803 3865 - dev_dbg(w->dapm->dev, "ASoC: force enable pin %s\n", pin); 3866 - w->connected = 1; 3867 - w->force = 1; 3868 - dapm_mark_dirty(w, "force enable"); 3804 + ret = snd_soc_dapm_force_enable_pin_unlocked(dapm, pin); 3869 3805 3870 - return 0; 3806 + mutex_unlock(&dapm->card->dapm_mutex); 3807 + 3808 + return ret; 3871 3809 } 3872 3810 EXPORT_SYMBOL_GPL(snd_soc_dapm_force_enable_pin); 3811 + 3812 + /** 3813 + * snd_soc_dapm_disable_pin_unlocked - disable pin. 3814 + * @dapm: DAPM context 3815 + * @pin: pin name 3816 + * 3817 + * Disables input/output pin and its parents or children widgets. 3818 + * 3819 + * Requires external locking. 3820 + * 3821 + * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to 3822 + * do any widget power switching. 3823 + */ 3824 + int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, 3825 + const char *pin) 3826 + { 3827 + return snd_soc_dapm_set_pin(dapm, pin, 0); 3828 + } 3829 + EXPORT_SYMBOL_GPL(snd_soc_dapm_disable_pin_unlocked); 3873 3830 3874 3831 /** 3875 3832 * snd_soc_dapm_disable_pin - disable pin. ··· 3892 3819 * @pin: pin name 3893 3820 * 3894 3821 * Disables input/output pin and its parents or children widgets. 3822 + * 3895 3823 * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to 3896 3824 * do any widget power switching. 3897 3825 */ 3898 3826 int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, 3899 3827 const char *pin) 3900 3828 { 3901 - return snd_soc_dapm_set_pin(dapm, pin, 0); 3829 + int ret; 3830 + 3831 + mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 3832 + 3833 + ret = snd_soc_dapm_set_pin(dapm, pin, 0); 3834 + 3835 + mutex_unlock(&dapm->card->dapm_mutex); 3836 + 3837 + return ret; 3902 3838 } 3903 3839 EXPORT_SYMBOL_GPL(snd_soc_dapm_disable_pin); 3840 + 3841 + /** 3842 + * snd_soc_dapm_nc_pin_unlocked - permanently disable pin. 3843 + * @dapm: DAPM context 3844 + * @pin: pin name 3845 + * 3846 + * Marks the specified pin as being not connected, disabling it along 3847 + * any parent or child widgets. At present this is identical to 3848 + * snd_soc_dapm_disable_pin() but in future it will be extended to do 3849 + * additional things such as disabling controls which only affect 3850 + * paths through the pin. 3851 + * 3852 + * Requires external locking. 3853 + * 3854 + * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to 3855 + * do any widget power switching. 3856 + */ 3857 + int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, 3858 + const char *pin) 3859 + { 3860 + return snd_soc_dapm_set_pin(dapm, pin, 0); 3861 + } 3862 + EXPORT_SYMBOL_GPL(snd_soc_dapm_nc_pin_unlocked); 3904 3863 3905 3864 /** 3906 3865 * snd_soc_dapm_nc_pin - permanently disable pin. ··· 3950 3845 */ 3951 3846 int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin) 3952 3847 { 3953 - return snd_soc_dapm_set_pin(dapm, pin, 0); 3848 + int ret; 3849 + 3850 + mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 3851 + 3852 + ret = snd_soc_dapm_set_pin(dapm, pin, 0); 3853 + 3854 + mutex_unlock(&dapm->card->dapm_mutex); 3855 + 3856 + return ret; 3954 3857 } 3955 3858 EXPORT_SYMBOL_GPL(snd_soc_dapm_nc_pin); 3956 3859
+23 -15
tools/perf/builtin-report.c
··· 113 113 if (!he) 114 114 return -ENOMEM; 115 115 116 - err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); 117 - if (err) 118 - goto out; 116 + if (ui__has_annotation()) { 117 + err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); 118 + if (err) 119 + goto out; 119 120 120 - mx = he->mem_info; 121 - err = addr_map_symbol__inc_samples(&mx->daddr, evsel->idx); 122 - if (err) 123 - goto out; 121 + mx = he->mem_info; 122 + err = addr_map_symbol__inc_samples(&mx->daddr, evsel->idx); 123 + if (err) 124 + goto out; 125 + } 124 126 125 127 evsel->hists.stats.total_period += cost; 126 128 hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); ··· 166 164 he = __hists__add_entry(&evsel->hists, al, parent, &bi[i], NULL, 167 165 1, 1, 0); 168 166 if (he) { 169 - bx = he->branch_info; 170 - err = addr_map_symbol__inc_samples(&bx->from, evsel->idx); 171 - if (err) 172 - goto out; 167 + if (ui__has_annotation()) { 168 + bx = he->branch_info; 169 + err = addr_map_symbol__inc_samples(&bx->from, 170 + evsel->idx); 171 + if (err) 172 + goto out; 173 173 174 - err = addr_map_symbol__inc_samples(&bx->to, evsel->idx); 175 - if (err) 176 - goto out; 174 + err = addr_map_symbol__inc_samples(&bx->to, 175 + evsel->idx); 176 + if (err) 177 + goto out; 178 + } 177 179 178 180 evsel->hists.stats.total_period += 1; 179 181 hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); ··· 211 205 if (err) 212 206 goto out; 213 207 214 - err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); 208 + if (ui__has_annotation()) 209 + err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); 210 + 215 211 evsel->hists.stats.total_period += sample->period; 216 212 hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); 217 213 out:
+4 -2
tools/perf/builtin-top.c
··· 176 176 { 177 177 struct annotation *notes; 178 178 struct symbol *sym; 179 - int err; 179 + int err = 0; 180 180 181 181 if (he == NULL || he->ms.sym == NULL || 182 182 ((top->sym_filter_entry == NULL || ··· 190 190 return; 191 191 192 192 ip = he->ms.map->map_ip(he->ms.map, ip); 193 - err = hist_entry__inc_addr_samples(he, counter, ip); 193 + 194 + if (ui__has_annotation()) 195 + err = hist_entry__inc_addr_samples(he, counter, ip); 194 196 195 197 pthread_mutex_unlock(&notes->lock); 196 198
+1 -1
tools/perf/config/Makefile
··· 478 478 endif 479 479 480 480 ifeq ($(feature-libbfd), 1) 481 - EXTLIBS += -lbfd 481 + EXTLIBS += -lbfd -lz -liberty 482 482 endif 483 483 484 484 ifdef NO_DEMANGLE
+1 -1
tools/perf/config/feature-checks/Makefile
··· 121 121 $(BUILD) $(FLAGS_PYTHON_EMBED) 122 122 123 123 test-libbfd.bin: 124 - $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl 124 + $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl 125 125 126 126 test-liberty.bin: 127 127 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
+8 -1
tools/perf/util/annotate.c
··· 8 8 */ 9 9 10 10 #include "util.h" 11 + #include "ui/ui.h" 12 + #include "sort.h" 11 13 #include "build-id.h" 12 14 #include "color.h" 13 15 #include "cache.h" ··· 491 489 { 492 490 struct annotation *notes; 493 491 494 - if (sym == NULL || use_browser != 1 || !sort__has_sym) 492 + if (sym == NULL) 495 493 return 0; 496 494 497 495 notes = symbol__annotation(sym); ··· 1400 1398 int hist_entry__annotate(struct hist_entry *he, size_t privsize) 1401 1399 { 1402 1400 return symbol__annotate(he->ms.sym, he->ms.map, privsize); 1401 + } 1402 + 1403 + bool ui__has_annotation(void) 1404 + { 1405 + return use_browser == 1 && sort__has_sym; 1403 1406 }
+2
tools/perf/util/annotate.h
··· 151 151 void symbol__annotate_decay_histogram(struct symbol *sym, int evidx); 152 152 void disasm__purge(struct list_head *head); 153 153 154 + bool ui__has_annotation(void); 155 + 154 156 int symbol__tty_annotate(struct symbol *sym, struct map *map, 155 157 struct perf_evsel *evsel, bool print_lines, 156 158 bool full_paths, int min_pcnt, int max_lines);
+3 -1
tools/perf/util/include/linux/bitops.h
··· 87 87 return num; 88 88 } 89 89 90 + typedef const unsigned long __attribute__((__may_alias__)) long_alias_t; 91 + 90 92 /* 91 93 * Find the first set bit in a memory region. 92 94 */ 93 95 static inline unsigned long 94 96 find_first_bit(const unsigned long *addr, unsigned long size) 95 97 { 96 - const unsigned long *p = addr; 98 + long_alias_t *p = (long_alias_t *) addr; 97 99 unsigned long result = 0; 98 100 unsigned long tmp; 99 101
+2
tools/perf/util/symbol.c
··· 1336 1336 1337 1337 if (syms_ss && runtime_ss) 1338 1338 break; 1339 + } else { 1340 + symsrc__destroy(ss); 1339 1341 } 1340 1342 1341 1343 }