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

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

Synchronize with 'net' in order to sort out some l2tp, wireless, and
ipv6 GRE fixes that will be built on top of in 'net-next'.

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

+2114 -1437
Documentation/hid/hid-sensor.txt
+1 -1
Documentation/kernel-parameters.txt
··· 2438 2438 real-time workloads. It can also improve energy 2439 2439 efficiency for asymmetric multiprocessors. 2440 2440 2441 - rcu_nocbs_poll [KNL,BOOT] 2441 + rcu_nocb_poll [KNL,BOOT] 2442 2442 Rather than requiring that offloaded CPUs 2443 2443 (specified by rcu_nocbs= above) explicitly 2444 2444 awaken the corresponding "rcuoN" kthreads,
+26 -1
Documentation/x86/boot.txt
··· 57 57 Protocol 2.11: (Kernel 3.6) Added a field for offset of EFI handover 58 58 protocol entry point. 59 59 60 + Protocol 2.12: (Kernel 3.8) Added the xloadflags field and extension fields 61 + to struct boot_params for for loading bzImage and ramdisk 62 + above 4G in 64bit. 63 + 60 64 **** MEMORY LAYOUT 61 65 62 66 The traditional memory map for the kernel loader, used for Image or ··· 186 182 0230/4 2.05+ kernel_alignment Physical addr alignment required for kernel 187 183 0234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not 188 184 0235/1 2.10+ min_alignment Minimum alignment, as a power of two 189 - 0236/2 N/A pad3 Unused 185 + 0236/2 2.12+ xloadflags Boot protocol option flags 190 186 0238/4 2.06+ cmdline_size Maximum size of the kernel command line 191 187 023C/4 2.07+ hardware_subarch Hardware subarchitecture 192 188 0240/8 2.07+ hardware_subarch_data Subarchitecture-specific data ··· 585 581 There may be a considerable performance cost with an excessively 586 582 misaligned kernel. Therefore, a loader should typically try each 587 583 power-of-two alignment from kernel_alignment down to this alignment. 584 + 585 + Field name: xloadflags 586 + Type: read 587 + Offset/size: 0x236/2 588 + Protocol: 2.12+ 589 + 590 + This field is a bitmask. 591 + 592 + Bit 0 (read): XLF_KERNEL_64 593 + - If 1, this kernel has the legacy 64-bit entry point at 0x200. 594 + 595 + Bit 1 (read): XLF_CAN_BE_LOADED_ABOVE_4G 596 + - If 1, kernel/boot_params/cmdline/ramdisk can be above 4G. 597 + 598 + Bit 2 (read): XLF_EFI_HANDOVER_32 599 + - If 1, the kernel supports the 32-bit EFI handoff entry point 600 + given at handover_offset. 601 + 602 + Bit 3 (read): XLF_EFI_HANDOVER_64 603 + - If 1, the kernel supports the 64-bit EFI handoff entry point 604 + given at handover_offset + 0x200. 588 605 589 606 Field name: cmdline_size 590 607 Type: read
+4
Documentation/x86/zero-page.txt
··· 19 19 090/010 ALL hd1_info hd1 disk parameter, OBSOLETE!! 20 20 0A0/010 ALL sys_desc_table System description table (struct sys_desc_table) 21 21 0B0/010 ALL olpc_ofw_header OLPC's OpenFirmware CIF and friends 22 + 0C0/004 ALL ext_ramdisk_image ramdisk_image high 32bits 23 + 0C4/004 ALL ext_ramdisk_size ramdisk_size high 32bits 24 + 0C8/004 ALL ext_cmd_line_ptr cmd_line_ptr high 32bits 22 25 140/080 ALL edid_info Video mode setup (struct edid_info) 23 26 1C0/020 ALL efi_info EFI 32 information (struct efi_info) 24 27 1E0/004 ALL alk_mem_k Alternative mem check, in KB ··· 30 27 1E9/001 ALL eddbuf_entries Number of entries in eddbuf (below) 31 28 1EA/001 ALL edd_mbr_sig_buf_entries Number of entries in edd_mbr_sig_buffer 32 29 (below) 30 + 1EF/001 ALL sentinel Used to detect broken bootloaders 33 31 290/040 ALL edd_mbr_sig_buffer EDD MBR signatures 34 32 2D0/A00 ALL e820_map E820 memory map table 35 33 (array of struct e820entry)
+2 -2
MAINTAINERS
··· 1489 1489 M: Haavard Skinnemoen <hskinnemoen@gmail.com> 1490 1490 M: Hans-Christian Egtvedt <egtvedt@samfundet.no> 1491 1491 W: http://www.atmel.com/products/AVR32/ 1492 - W: http://avr32linux.org/ 1492 + W: http://mirror.egtvedt.no/avr32linux.org/ 1493 1493 W: http://avrfreaks.net/ 1494 1494 S: Maintained 1495 1495 F: arch/avr32/ ··· 7076 7076 F: sound/ 7077 7077 7078 7078 SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC) 7079 - M: Liam Girdwood <lrg@ti.com> 7079 + M: Liam Girdwood <lgirdwood@gmail.com> 7080 7080 M: Mark Brown <broonie@opensource.wolfsonmicro.com> 7081 7081 T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 7082 7082 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
+2 -2
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 8 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc5 5 - NAME = Terrified Chipmunk 4 + EXTRAVERSION = -rc7 5 + NAME = Unicycling Gorilla 6 6 7 7 # *DOCUMENTATION* 8 8 # To see a list of typical targets execute "make help"
+23 -2
arch/arm/common/gic.c
··· 351 351 irq_set_chained_handler(irq, gic_handle_cascade_irq); 352 352 } 353 353 354 + static u8 gic_get_cpumask(struct gic_chip_data *gic) 355 + { 356 + void __iomem *base = gic_data_dist_base(gic); 357 + u32 mask, i; 358 + 359 + for (i = mask = 0; i < 32; i += 4) { 360 + mask = readl_relaxed(base + GIC_DIST_TARGET + i); 361 + mask |= mask >> 16; 362 + mask |= mask >> 8; 363 + if (mask) 364 + break; 365 + } 366 + 367 + if (!mask) 368 + pr_crit("GIC CPU mask not found - kernel will fail to boot.\n"); 369 + 370 + return mask; 371 + } 372 + 354 373 static void __init gic_dist_init(struct gic_chip_data *gic) 355 374 { 356 375 unsigned int i; ··· 388 369 /* 389 370 * Set all global interrupts to this CPU only. 390 371 */ 391 - cpumask = readl_relaxed(base + GIC_DIST_TARGET + 0); 372 + cpumask = gic_get_cpumask(gic); 373 + cpumask |= cpumask << 8; 374 + cpumask |= cpumask << 16; 392 375 for (i = 32; i < gic_irqs; i += 4) 393 376 writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); 394 377 ··· 421 400 * Get what the GIC says our CPU mask is. 422 401 */ 423 402 BUG_ON(cpu >= NR_GIC_CPU_IF); 424 - cpu_mask = readl_relaxed(dist_base + GIC_DIST_TARGET + 0); 403 + cpu_mask = gic_get_cpumask(gic); 425 404 gic_cpu_map[cpu] = cpu_mask; 426 405 427 406 /*
+1 -1
arch/arm/include/asm/memory.h
··· 37 37 */ 38 38 #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) 39 39 #define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(0x01000000)) 40 - #define TASK_UNMAPPED_BASE (UL(CONFIG_PAGE_OFFSET) / 3) 40 + #define TASK_UNMAPPED_BASE ALIGN(TASK_SIZE / 3, SZ_16M) 41 41 42 42 /* 43 43 * The maximum size of a 26-bit user space task.
+1 -1
arch/arm/mach-exynos/Kconfig
··· 414 414 select CPU_EXYNOS4210 415 415 select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD 416 416 select PINCTRL 417 - select PINCTRL_EXYNOS4 417 + select PINCTRL_EXYNOS 418 418 select USE_OF 419 419 help 420 420 Machine support for Samsung Exynos4 machine with device tree enabled.
+1 -1
arch/arm/mach-realview/include/mach/irqs-eb.h
··· 115 115 /* 116 116 * Only define NR_IRQS if less than NR_IRQS_EB 117 117 */ 118 - #define NR_IRQS_EB (IRQ_EB_GIC_START + 96) 118 + #define NR_IRQS_EB (IRQ_EB_GIC_START + 128) 119 119 120 120 #if defined(CONFIG_MACH_REALVIEW_EB) \ 121 121 && (!defined(NR_IRQS) || (NR_IRQS < NR_IRQS_EB))
+1 -1
arch/arm/mm/dma-mapping.c
··· 640 640 641 641 if (is_coherent || nommu()) 642 642 addr = __alloc_simple_buffer(dev, size, gfp, &page); 643 - else if (gfp & GFP_ATOMIC) 643 + else if (!(gfp & __GFP_WAIT)) 644 644 addr = __alloc_from_pool(size, &page); 645 645 else if (!IS_ENABLED(CONFIG_CMA)) 646 646 addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller);
+10
arch/avr32/include/asm/dma-mapping.h
··· 336 336 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 337 337 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 338 338 339 + /* drivers/base/dma-mapping.c */ 340 + extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, 341 + void *cpu_addr, dma_addr_t dma_addr, size_t size); 342 + extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, 343 + void *cpu_addr, dma_addr_t dma_addr, 344 + size_t size); 345 + 346 + #define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s) 347 + #define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s) 348 + 339 349 #endif /* __ASM_AVR32_DMA_MAPPING_H */
+10
arch/blackfin/include/asm/dma-mapping.h
··· 154 154 _dma_sync((dma_addr_t)vaddr, size, dir); 155 155 } 156 156 157 + /* drivers/base/dma-mapping.c */ 158 + extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, 159 + void *cpu_addr, dma_addr_t dma_addr, size_t size); 160 + extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, 161 + void *cpu_addr, dma_addr_t dma_addr, 162 + size_t size); 163 + 164 + #define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s) 165 + #define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s) 166 + 157 167 #endif /* _BLACKFIN_DMA_MAPPING_H */
+15
arch/c6x/include/asm/dma-mapping.h
··· 89 89 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent((d), (s), (h), (f)) 90 90 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent((d), (s), (v), (h)) 91 91 92 + /* Not supported for now */ 93 + static inline int dma_mmap_coherent(struct device *dev, 94 + struct vm_area_struct *vma, void *cpu_addr, 95 + dma_addr_t dma_addr, size_t size) 96 + { 97 + return -EINVAL; 98 + } 99 + 100 + static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt, 101 + void *cpu_addr, dma_addr_t dma_addr, 102 + size_t size) 103 + { 104 + return -EINVAL; 105 + } 106 + 92 107 #endif /* _ASM_C6X_DMA_MAPPING_H */
+10
arch/cris/include/asm/dma-mapping.h
··· 158 158 { 159 159 } 160 160 161 + /* drivers/base/dma-mapping.c */ 162 + extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, 163 + void *cpu_addr, dma_addr_t dma_addr, size_t size); 164 + extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, 165 + void *cpu_addr, dma_addr_t dma_addr, 166 + size_t size); 167 + 168 + #define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s) 169 + #define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s) 170 + 161 171 162 172 #endif
+15
arch/frv/include/asm/dma-mapping.h
··· 132 132 flush_write_buffers(); 133 133 } 134 134 135 + /* Not supported for now */ 136 + static inline int dma_mmap_coherent(struct device *dev, 137 + struct vm_area_struct *vma, void *cpu_addr, 138 + dma_addr_t dma_addr, size_t size) 139 + { 140 + return -EINVAL; 141 + } 142 + 143 + static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt, 144 + void *cpu_addr, dma_addr_t dma_addr, 145 + size_t size) 146 + { 147 + return -EINVAL; 148 + } 149 + 135 150 #endif /* _ASM_DMA_MAPPING_H */
+10
arch/m68k/include/asm/dma-mapping.h
··· 115 115 #include <asm-generic/dma-mapping-broken.h> 116 116 #endif 117 117 118 + /* drivers/base/dma-mapping.c */ 119 + extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, 120 + void *cpu_addr, dma_addr_t dma_addr, size_t size); 121 + extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, 122 + void *cpu_addr, dma_addr_t dma_addr, 123 + size_t size); 124 + 125 + #define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s) 126 + #define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s) 127 + 118 128 #endif /* _M68K_DMA_MAPPING_H */
+3
arch/mips/bcm47xx/Kconfig
··· 8 8 select SSB_DRIVER_EXTIF 9 9 select SSB_EMBEDDED 10 10 select SSB_B43_PCI_BRIDGE if PCI 11 + select SSB_DRIVER_PCICORE if PCI 11 12 select SSB_PCICORE_HOSTMODE if PCI 12 13 select SSB_DRIVER_GPIO 14 + select GPIOLIB 13 15 default y 14 16 help 15 17 Add support for old Broadcom BCM47xx boards with Sonics Silicon Backplane support. ··· 27 25 select BCMA_HOST_PCI if PCI 28 26 select BCMA_DRIVER_PCI_HOSTMODE if PCI 29 27 select BCMA_DRIVER_GPIO 28 + select GPIOLIB 30 29 default y 31 30 help 32 31 Add support for new Broadcom BCM47xx boards with Broadcom specific Advanced Microcontroller Bus.
+5 -4
arch/mips/cavium-octeon/executive/cvmx-l2c.c
··· 30 30 * measurement, and debugging facilities. 31 31 */ 32 32 33 + #include <linux/compiler.h> 33 34 #include <linux/irqflags.h> 34 35 #include <asm/octeon/cvmx.h> 35 36 #include <asm/octeon/cvmx-l2c.h> ··· 286 285 */ 287 286 static void fault_in(uint64_t addr, int len) 288 287 { 289 - volatile char *ptr; 290 - volatile char dummy; 288 + char *ptr; 289 + 291 290 /* 292 291 * Adjust addr and length so we get all cache lines even for 293 292 * small ranges spanning two cache lines. 294 293 */ 295 294 len += addr & CVMX_CACHE_LINE_MASK; 296 295 addr &= ~CVMX_CACHE_LINE_MASK; 297 - ptr = (volatile char *)cvmx_phys_to_ptr(addr); 296 + ptr = cvmx_phys_to_ptr(addr); 298 297 /* 299 298 * Invalidate L1 cache to make sure all loads result in data 300 299 * being in L2. 301 300 */ 302 301 CVMX_DCACHE_INVALIDATE; 303 302 while (len > 0) { 304 - dummy += *ptr; 303 + ACCESS_ONCE(*ptr); 305 304 len -= CVMX_CACHE_LINE_SIZE; 306 305 ptr += CVMX_CACHE_LINE_SIZE; 307 306 }
arch/mips/include/asm/break.h arch/mips/include/uapi/asm/break.h
+1 -1
arch/mips/include/asm/dsp.h
··· 16 16 #include <asm/mipsregs.h> 17 17 18 18 #define DSP_DEFAULT 0x00000000 19 - #define DSP_MASK 0x3ff 19 + #define DSP_MASK 0x3f 20 20 21 21 #define __enable_dsp_hazard() \ 22 22 do { \
+1
arch/mips/include/asm/inst.h
··· 353 353 struct u_format u_format; 354 354 struct c_format c_format; 355 355 struct r_format r_format; 356 + struct p_format p_format; 356 357 struct f_format f_format; 357 358 struct ma_format ma_format; 358 359 struct b_format b_format;
+1 -1
arch/mips/include/asm/mach-pnx833x/war.h
··· 21 21 #define R10000_LLSC_WAR 0 22 22 #define MIPS34K_MISSED_ITLB_WAR 0 23 23 24 - #endif /* __ASM_MIPS_MACH_PNX8550_WAR_H */ 24 + #endif /* __ASM_MIPS_MACH_PNX833X_WAR_H */
+1
arch/mips/include/asm/pgtable-64.h
··· 230 230 #else 231 231 #define pte_pfn(x) ((unsigned long)((x).pte >> _PFN_SHIFT)) 232 232 #define pfn_pte(pfn, prot) __pte(((pfn) << _PFN_SHIFT) | pgprot_val(prot)) 233 + #define pfn_pmd(pfn, prot) __pmd(((pfn) << _PFN_SHIFT) | pgprot_val(prot)) 233 234 #endif 234 235 235 236 #define __pgd_offset(address) pgd_index(address)
+1
arch/mips/include/uapi/asm/Kbuild
··· 3 3 4 4 header-y += auxvec.h 5 5 header-y += bitsperlong.h 6 + header-y += break.h 6 7 header-y += byteorder.h 7 8 header-y += cachectl.h 8 9 header-y += errno.h
+35 -1
arch/mips/kernel/ftrace.c
··· 25 25 #define MCOUNT_OFFSET_INSNS 4 26 26 #endif 27 27 28 + /* Arch override because MIPS doesn't need to run this from stop_machine() */ 29 + void arch_ftrace_update_code(int command) 30 + { 31 + ftrace_modify_all_code(command); 32 + } 33 + 28 34 /* 29 35 * Check if the address is in kernel space 30 36 * ··· 95 89 return 0; 96 90 } 97 91 92 + #ifndef CONFIG_64BIT 93 + static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1, 94 + unsigned int new_code2) 95 + { 96 + int faulted; 97 + 98 + safe_store_code(new_code1, ip, faulted); 99 + if (unlikely(faulted)) 100 + return -EFAULT; 101 + ip += 4; 102 + safe_store_code(new_code2, ip, faulted); 103 + if (unlikely(faulted)) 104 + return -EFAULT; 105 + flush_icache_range(ip, ip + 8); /* original ip + 12 */ 106 + return 0; 107 + } 108 + #endif 109 + 98 110 /* 99 111 * The details about the calling site of mcount on MIPS 100 112 * ··· 155 131 * needed. 156 132 */ 157 133 new = in_kernel_space(ip) ? INSN_NOP : INSN_B_1F; 158 - 134 + #ifdef CONFIG_64BIT 159 135 return ftrace_modify_code(ip, new); 136 + #else 137 + /* 138 + * On 32 bit MIPS platforms, gcc adds a stack adjust 139 + * instruction in the delay slot after the branch to 140 + * mcount and expects mcount to restore the sp on return. 141 + * This is based on a legacy API and does nothing but 142 + * waste instructions so it's being removed at runtime. 143 + */ 144 + return ftrace_modify_code_2(ip, new, INSN_NOP); 145 + #endif 160 146 } 161 147 162 148 int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
+4 -3
arch/mips/kernel/mcount.S
··· 46 46 PTR_L a5, PT_R9(sp) 47 47 PTR_L a6, PT_R10(sp) 48 48 PTR_L a7, PT_R11(sp) 49 - PTR_ADDIU sp, PT_SIZE 50 49 #else 51 - PTR_ADDIU sp, (PT_SIZE + 8) 50 + PTR_ADDIU sp, PT_SIZE 52 51 #endif 53 52 .endm 54 53 ··· 68 69 .globl _mcount 69 70 _mcount: 70 71 b ftrace_stub 71 - nop 72 + addiu sp,sp,8 73 + 74 + /* When tracing is activated, it calls ftrace_caller+8 (aka here) */ 72 75 lw t1, function_trace_stop 73 76 bnez t1, ftrace_stub 74 77 nop
+1 -1
arch/mips/kernel/vpe.c
··· 705 705 706 706 printk(KERN_WARNING 707 707 "VPE loader: TC %d is already in use.\n", 708 - t->index); 708 + v->tc->index); 709 709 return -ENOEXEC; 710 710 } 711 711 } else {
+1 -1
arch/mips/lantiq/irq.c
··· 408 408 #endif 409 409 410 410 /* tell oprofile which irq to use */ 411 - cp0_perfcount_irq = LTQ_PERF_IRQ; 411 + cp0_perfcount_irq = irq_create_mapping(ltq_domain, LTQ_PERF_IRQ); 412 412 413 413 /* 414 414 * if the timer irq is not one of the mips irqs we need to
+1 -1
arch/mips/lib/delay.c
··· 21 21 " .set noreorder \n" 22 22 " .align 3 \n" 23 23 "1: bnez %0, 1b \n" 24 - #if __SIZEOF_LONG__ == 4 24 + #if BITS_PER_LONG == 32 25 25 " subu %0, 1 \n" 26 26 #else 27 27 " dsubu %0, 1 \n"
-6
arch/mips/mm/ioremap.c
··· 190 190 191 191 EXPORT_SYMBOL(__ioremap); 192 192 EXPORT_SYMBOL(__iounmap); 193 - 194 - int __virt_addr_valid(const volatile void *kaddr) 195 - { 196 - return pfn_valid(PFN_DOWN(virt_to_phys(kaddr))); 197 - } 198 - EXPORT_SYMBOL_GPL(__virt_addr_valid);
+6
arch/mips/mm/mmap.c
··· 192 192 193 193 return ret; 194 194 } 195 + 196 + int __virt_addr_valid(const volatile void *kaddr) 197 + { 198 + return pfn_valid(PFN_DOWN(virt_to_phys(kaddr))); 199 + } 200 + EXPORT_SYMBOL_GPL(__virt_addr_valid);
+4 -1
arch/mips/netlogic/xlr/setup.c
··· 193 193 194 194 void __init prom_init(void) 195 195 { 196 - int i, *argv, *envp; /* passed as 32 bit ptrs */ 196 + int *argv, *envp; /* passed as 32 bit ptrs */ 197 197 struct psb_info *prom_infop; 198 + #ifdef CONFIG_SMP 199 + int i; 200 + #endif 198 201 199 202 /* truncate to 32 bit and sign extend all args */ 200 203 argv = (int *)(long)(int)fw_arg1;
+1 -1
arch/mips/pci/pci-ar71xx.c
··· 24 24 #include <asm/mach-ath79/pci.h> 25 25 26 26 #define AR71XX_PCI_MEM_BASE 0x10000000 27 - #define AR71XX_PCI_MEM_SIZE 0x08000000 27 + #define AR71XX_PCI_MEM_SIZE 0x07000000 28 28 29 29 #define AR71XX_PCI_WIN0_OFFS 0x10000000 30 30 #define AR71XX_PCI_WIN1_OFFS 0x11000000
+1 -1
arch/mips/pci/pci-ar724x.c
··· 21 21 #define AR724X_PCI_CTRL_SIZE 0x100 22 22 23 23 #define AR724X_PCI_MEM_BASE 0x10000000 24 - #define AR724X_PCI_MEM_SIZE 0x08000000 24 + #define AR724X_PCI_MEM_SIZE 0x04000000 25 25 26 26 #define AR724X_PCI_REG_RESET 0x18 27 27 #define AR724X_PCI_REG_INT_STATUS 0x4c
+15
arch/mn10300/include/asm/dma-mapping.h
··· 168 168 mn10300_dcache_flush_inv(); 169 169 } 170 170 171 + /* Not supported for now */ 172 + static inline int dma_mmap_coherent(struct device *dev, 173 + struct vm_area_struct *vma, void *cpu_addr, 174 + dma_addr_t dma_addr, size_t size) 175 + { 176 + return -EINVAL; 177 + } 178 + 179 + static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt, 180 + void *cpu_addr, dma_addr_t dma_addr, 181 + size_t size) 182 + { 183 + return -EINVAL; 184 + } 185 + 171 186 #endif
+15
arch/parisc/include/asm/dma-mapping.h
··· 238 238 /* At the moment, we panic on error for IOMMU resource exaustion */ 239 239 #define dma_mapping_error(dev, x) 0 240 240 241 + /* This API cannot be supported on PA-RISC */ 242 + static inline int dma_mmap_coherent(struct device *dev, 243 + struct vm_area_struct *vma, void *cpu_addr, 244 + dma_addr_t dma_addr, size_t size) 245 + { 246 + return -EINVAL; 247 + } 248 + 249 + static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt, 250 + void *cpu_addr, dma_addr_t dma_addr, 251 + size_t size) 252 + { 253 + return -EINVAL; 254 + } 255 + 241 256 #endif
+35 -27
arch/powerpc/mm/hash_low_64.S
··· 115 115 sldi r29,r5,SID_SHIFT - VPN_SHIFT 116 116 rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT - VPN_SHIFT) 117 117 or r29,r28,r29 118 - 119 - /* Calculate hash value for primary slot and store it in r28 */ 120 - rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */ 121 - rldicl r0,r3,64-12,48 /* (ea >> 12) & 0xffff */ 122 - xor r28,r5,r0 118 + /* 119 + * Calculate hash value for primary slot and store it in r28 120 + * r3 = va, r5 = vsid 121 + * r0 = (va >> 12) & ((1ul << (28 - 12)) -1) 122 + */ 123 + rldicl r0,r3,64-12,48 124 + xor r28,r5,r0 /* hash */ 123 125 b 4f 124 126 125 127 3: /* Calc vpn and put it in r29 */ ··· 132 130 /* 133 131 * calculate hash value for primary slot and 134 132 * store it in r28 for 1T segment 133 + * r3 = va, r5 = vsid 135 134 */ 136 - rldic r28,r5,25,25 /* (vsid << 25) & 0x7fffffffff */ 137 - clrldi r5,r5,40 /* vsid & 0xffffff */ 138 - rldicl r0,r3,64-12,36 /* (ea >> 12) & 0xfffffff */ 139 - xor r28,r28,r5 135 + sldi r28,r5,25 /* vsid << 25 */ 136 + /* r0 = (va >> 12) & ((1ul << (40 - 12)) -1) */ 137 + rldicl r0,r3,64-12,36 138 + xor r28,r28,r5 /* vsid ^ ( vsid << 25) */ 140 139 xor r28,r28,r0 /* hash */ 141 140 142 141 /* Convert linux PTE bits into HW equivalents */ ··· 410 407 */ 411 408 rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT - VPN_SHIFT) 412 409 or r29,r28,r29 413 - 414 - /* Calculate hash value for primary slot and store it in r28 */ 415 - rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */ 416 - rldicl r0,r3,64-12,48 /* (ea >> 12) & 0xffff */ 417 - xor r28,r5,r0 410 + /* 411 + * Calculate hash value for primary slot and store it in r28 412 + * r3 = va, r5 = vsid 413 + * r0 = (va >> 12) & ((1ul << (28 - 12)) -1) 414 + */ 415 + rldicl r0,r3,64-12,48 416 + xor r28,r5,r0 /* hash */ 418 417 b 4f 419 418 420 419 3: /* Calc vpn and put it in r29 */ ··· 431 426 /* 432 427 * Calculate hash value for primary slot and 433 428 * store it in r28 for 1T segment 429 + * r3 = va, r5 = vsid 434 430 */ 435 - rldic r28,r5,25,25 /* (vsid << 25) & 0x7fffffffff */ 436 - clrldi r5,r5,40 /* vsid & 0xffffff */ 437 - rldicl r0,r3,64-12,36 /* (ea >> 12) & 0xfffffff */ 438 - xor r28,r28,r5 431 + sldi r28,r5,25 /* vsid << 25 */ 432 + /* r0 = (va >> 12) & ((1ul << (40 - 12)) -1) */ 433 + rldicl r0,r3,64-12,36 434 + xor r28,r28,r5 /* vsid ^ ( vsid << 25) */ 439 435 xor r28,r28,r0 /* hash */ 440 436 441 437 /* Convert linux PTE bits into HW equivalents */ ··· 758 752 rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT - VPN_SHIFT) 759 753 or r29,r28,r29 760 754 761 - /* Calculate hash value for primary slot and store it in r28 */ 762 - rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */ 763 - rldicl r0,r3,64-16,52 /* (ea >> 16) & 0xfff */ 764 - xor r28,r5,r0 755 + /* Calculate hash value for primary slot and store it in r28 756 + * r3 = va, r5 = vsid 757 + * r0 = (va >> 16) & ((1ul << (28 - 16)) -1) 758 + */ 759 + rldicl r0,r3,64-16,52 760 + xor r28,r5,r0 /* hash */ 765 761 b 4f 766 762 767 763 3: /* Calc vpn and put it in r29 */ 768 764 sldi r29,r5,SID_SHIFT_1T - VPN_SHIFT 769 765 rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT_1T - VPN_SHIFT) 770 766 or r29,r28,r29 771 - 772 767 /* 773 768 * calculate hash value for primary slot and 774 769 * store it in r28 for 1T segment 770 + * r3 = va, r5 = vsid 775 771 */ 776 - rldic r28,r5,25,25 /* (vsid << 25) & 0x7fffffffff */ 777 - clrldi r5,r5,40 /* vsid & 0xffffff */ 778 - rldicl r0,r3,64-16,40 /* (ea >> 16) & 0xffffff */ 779 - xor r28,r28,r5 772 + sldi r28,r5,25 /* vsid << 25 */ 773 + /* r0 = (va >> 16) & ((1ul << (40 - 16)) -1) */ 774 + rldicl r0,r3,64-16,40 775 + xor r28,r28,r5 /* vsid ^ ( vsid << 25) */ 780 776 xor r28,r28,r0 /* hash */ 781 777 782 778 /* Convert linux PTE bits into HW equivalents */
+12
arch/s390/include/asm/pgtable.h
··· 1365 1365 __pmd_idte(address, pmdp); 1366 1366 } 1367 1367 1368 + #define __HAVE_ARCH_PMDP_SET_WRPROTECT 1369 + static inline void pmdp_set_wrprotect(struct mm_struct *mm, 1370 + unsigned long address, pmd_t *pmdp) 1371 + { 1372 + pmd_t pmd = *pmdp; 1373 + 1374 + if (pmd_write(pmd)) { 1375 + __pmd_idte(address, pmdp); 1376 + set_pmd_at(mm, address, pmdp, pmd_wrprotect(pmd)); 1377 + } 1378 + } 1379 + 1368 1380 static inline pmd_t mk_pmd_phys(unsigned long physpage, pgprot_t pgprot) 1369 1381 { 1370 1382 pmd_t __pmd;
+1
arch/x86/Kconfig
··· 2138 2138 config OLPC_XO1_SCI 2139 2139 bool "OLPC XO-1 SCI extras" 2140 2140 depends on OLPC && OLPC_XO1_PM 2141 + depends on INPUT=y 2141 2142 select POWER_SUPPLY 2142 2143 select GPIO_CS5535 2143 2144 select MFD_CORE
+2 -2
arch/x86/boot/Makefile
··· 71 71 $(obj)/bzImage: asflags-y := $(SVGA_MODE) 72 72 73 73 quiet_cmd_image = BUILD $@ 74 - cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin > $@ 74 + cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/zoffset.h > $@ 75 75 76 76 $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE 77 77 $(call if_changed,image) ··· 92 92 $(obj)/voffset.h: vmlinux FORCE 93 93 $(call if_changed,voffset) 94 94 95 - sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p' 95 + sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|startup_64\|efi_pe_entry\|efi_stub_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p' 96 96 97 97 quiet_cmd_zoffset = ZOFFSET $@ 98 98 cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@
+11 -10
arch/x86/boot/compressed/eboot.c
··· 256 256 int i; 257 257 struct setup_data *data; 258 258 259 - data = (struct setup_data *)params->hdr.setup_data; 259 + data = (struct setup_data *)(unsigned long)params->hdr.setup_data; 260 260 261 261 while (data && data->next) 262 - data = (struct setup_data *)data->next; 262 + data = (struct setup_data *)(unsigned long)data->next; 263 263 264 264 status = efi_call_phys5(sys_table->boottime->locate_handle, 265 265 EFI_LOCATE_BY_PROTOCOL, &pci_proto, ··· 295 295 if (!pci) 296 296 continue; 297 297 298 + #ifdef CONFIG_X86_64 298 299 status = efi_call_phys4(pci->attributes, pci, 299 300 EfiPciIoAttributeOperationGet, 0, 300 301 &attributes); 301 - 302 + #else 303 + status = efi_call_phys5(pci->attributes, pci, 304 + EfiPciIoAttributeOperationGet, 0, 0, 305 + &attributes); 306 + #endif 302 307 if (status != EFI_SUCCESS) 303 - continue; 304 - 305 - if (!(attributes & EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM)) 306 308 continue; 307 309 308 310 if (!pci->romimage || !pci->romsize) ··· 347 345 memcpy(rom->romdata, pci->romimage, pci->romsize); 348 346 349 347 if (data) 350 - data->next = (uint64_t)rom; 348 + data->next = (unsigned long)rom; 351 349 else 352 - params->hdr.setup_data = (uint64_t)rom; 350 + params->hdr.setup_data = (unsigned long)rom; 353 351 354 352 data = (struct setup_data *)rom; 355 353 ··· 434 432 * Once we've found a GOP supporting ConOut, 435 433 * don't bother looking any further. 436 434 */ 435 + first_gop = gop; 437 436 if (conout_found) 438 437 break; 439 - 440 - first_gop = gop; 441 438 } 442 439 } 443 440
+5 -3
arch/x86/boot/compressed/head_32.S
··· 35 35 #ifdef CONFIG_EFI_STUB 36 36 jmp preferred_addr 37 37 38 - .balign 0x10 39 38 /* 40 39 * We don't need the return address, so set up the stack so 41 - * efi_main() can find its arugments. 40 + * efi_main() can find its arguments. 42 41 */ 42 + ENTRY(efi_pe_entry) 43 43 add $0x4, %esp 44 44 45 45 call make_boot_params ··· 50 50 pushl %eax 51 51 pushl %esi 52 52 pushl %ecx 53 + sub $0x4, %esp 53 54 54 - .org 0x30,0x90 55 + ENTRY(efi_stub_entry) 56 + add $0x4, %esp 55 57 call efi_main 56 58 cmpl $0, %eax 57 59 movl %eax, %esi
+4 -4
arch/x86/boot/compressed/head_64.S
··· 201 201 */ 202 202 #ifdef CONFIG_EFI_STUB 203 203 /* 204 - * The entry point for the PE/COFF executable is 0x210, so only 205 - * legacy boot loaders will execute this jmp. 204 + * The entry point for the PE/COFF executable is efi_pe_entry, so 205 + * only legacy boot loaders will execute this jmp. 206 206 */ 207 207 jmp preferred_addr 208 208 209 - .org 0x210 209 + ENTRY(efi_pe_entry) 210 210 mov %rcx, %rdi 211 211 mov %rdx, %rsi 212 212 pushq %rdi ··· 218 218 popq %rsi 219 219 popq %rdi 220 220 221 - .org 0x230,0x90 221 + ENTRY(efi_stub_entry) 222 222 call efi_main 223 223 movq %rax,%rsi 224 224 cmpq $0,%rax
+29 -10
arch/x86/boot/header.S
··· 21 21 #include <asm/e820.h> 22 22 #include <asm/page_types.h> 23 23 #include <asm/setup.h> 24 + #include <asm/bootparam.h> 24 25 #include "boot.h" 25 26 #include "voffset.h" 26 27 #include "zoffset.h" ··· 256 255 # header, from the old boot sector. 257 256 258 257 .section ".header", "a" 258 + .globl sentinel 259 + sentinel: .byte 0xff, 0xff /* Used to detect broken loaders */ 260 + 259 261 .globl hdr 260 262 hdr: 261 263 setup_sects: .byte 0 /* Filled in by build.c */ ··· 283 279 # Part 2 of the header, from the old setup.S 284 280 285 281 .ascii "HdrS" # header signature 286 - .word 0x020b # header version number (>= 0x0105) 282 + .word 0x020c # header version number (>= 0x0105) 287 283 # or else old loadlin-1.5 will fail) 288 284 .globl realmode_swtch 289 285 realmode_swtch: .word 0, 0 # default_switch, SETUPSEG ··· 301 297 302 298 # flags, unused bits must be zero (RFU) bit within loadflags 303 299 loadflags: 304 - LOADED_HIGH = 1 # If set, the kernel is loaded high 305 - CAN_USE_HEAP = 0x80 # If set, the loader also has set 306 - # heap_end_ptr to tell how much 307 - # space behind setup.S can be used for 308 - # heap purposes. 309 - # Only the loader knows what is free 310 - .byte LOADED_HIGH 300 + .byte LOADED_HIGH # The kernel is to be loaded high 311 301 312 302 setup_move_size: .word 0x8000 # size to move, when setup is not 313 303 # loaded at 0x90000. We will move setup ··· 367 369 relocatable_kernel: .byte 0 368 370 #endif 369 371 min_alignment: .byte MIN_KERNEL_ALIGN_LG2 # minimum alignment 370 - pad3: .word 0 372 + 373 + xloadflags: 374 + #ifdef CONFIG_X86_64 375 + # define XLF0 XLF_KERNEL_64 /* 64-bit kernel */ 376 + #else 377 + # define XLF0 0 378 + #endif 379 + #ifdef CONFIG_EFI_STUB 380 + # ifdef CONFIG_X86_64 381 + # define XLF23 XLF_EFI_HANDOVER_64 /* 64-bit EFI handover ok */ 382 + # else 383 + # define XLF23 XLF_EFI_HANDOVER_32 /* 32-bit EFI handover ok */ 384 + # endif 385 + #else 386 + # define XLF23 0 387 + #endif 388 + .word XLF0 | XLF23 371 389 372 390 cmdline_size: .long COMMAND_LINE_SIZE-1 #length of the command line, 373 391 #added with boot protocol ··· 411 397 #define INIT_SIZE VO_INIT_SIZE 412 398 #endif 413 399 init_size: .long INIT_SIZE # kernel initialization size 414 - handover_offset: .long 0x30 # offset to the handover 400 + handover_offset: 401 + #ifdef CONFIG_EFI_STUB 402 + .long 0x30 # offset to the handover 415 403 # protocol entry point 404 + #else 405 + .long 0 406 + #endif 416 407 417 408 # End of setup header ##################################################### 418 409
+1 -1
arch/x86/boot/setup.ld
··· 13 13 .bstext : { *(.bstext) } 14 14 .bsdata : { *(.bsdata) } 15 15 16 - . = 497; 16 + . = 495; 17 17 .header : { *(.header) } 18 18 .entrytext : { *(.entrytext) } 19 19 .inittext : { *(.inittext) }
+63 -18
arch/x86/boot/tools/build.c
··· 52 52 53 53 #define PECOFF_RELOC_RESERVE 0x20 54 54 55 + unsigned long efi_stub_entry; 56 + unsigned long efi_pe_entry; 57 + unsigned long startup_64; 58 + 55 59 /*----------------------------------------------------------------------*/ 56 60 57 61 static const u32 crctab32[] = { ··· 136 132 137 133 static void usage(void) 138 134 { 139 - die("Usage: build setup system [> image]"); 135 + die("Usage: build setup system [zoffset.h] [> image]"); 140 136 } 141 137 142 138 #ifdef CONFIG_EFI_STUB ··· 210 206 */ 211 207 put_unaligned_le32(file_sz - 512, &buf[pe_header + 0x1c]); 212 208 213 - #ifdef CONFIG_X86_32 214 209 /* 215 - * Address of entry point. 216 - * 217 - * The EFI stub entry point is +16 bytes from the start of 218 - * the .text section. 210 + * Address of entry point for PE/COFF executable 219 211 */ 220 - put_unaligned_le32(text_start + 16, &buf[pe_header + 0x28]); 221 - #else 222 - /* 223 - * Address of entry point. startup_32 is at the beginning and 224 - * the 64-bit entry point (startup_64) is always 512 bytes 225 - * after. The EFI stub entry point is 16 bytes after that, as 226 - * the first instruction allows legacy loaders to jump over 227 - * the EFI stub initialisation 228 - */ 229 - put_unaligned_le32(text_start + 528, &buf[pe_header + 0x28]); 230 - #endif /* CONFIG_X86_32 */ 212 + put_unaligned_le32(text_start + efi_pe_entry, &buf[pe_header + 0x28]); 231 213 232 214 update_pecoff_section_header(".text", text_start, text_sz); 233 215 } 234 216 235 217 #endif /* CONFIG_EFI_STUB */ 218 + 219 + 220 + /* 221 + * Parse zoffset.h and find the entry points. We could just #include zoffset.h 222 + * but that would mean tools/build would have to be rebuilt every time. It's 223 + * not as if parsing it is hard... 224 + */ 225 + #define PARSE_ZOFS(p, sym) do { \ 226 + if (!strncmp(p, "#define ZO_" #sym " ", 11+sizeof(#sym))) \ 227 + sym = strtoul(p + 11 + sizeof(#sym), NULL, 16); \ 228 + } while (0) 229 + 230 + static void parse_zoffset(char *fname) 231 + { 232 + FILE *file; 233 + char *p; 234 + int c; 235 + 236 + file = fopen(fname, "r"); 237 + if (!file) 238 + die("Unable to open `%s': %m", fname); 239 + c = fread(buf, 1, sizeof(buf) - 1, file); 240 + if (ferror(file)) 241 + die("read-error on `zoffset.h'"); 242 + buf[c] = 0; 243 + 244 + p = (char *)buf; 245 + 246 + while (p && *p) { 247 + PARSE_ZOFS(p, efi_stub_entry); 248 + PARSE_ZOFS(p, efi_pe_entry); 249 + PARSE_ZOFS(p, startup_64); 250 + 251 + p = strchr(p, '\n'); 252 + while (p && (*p == '\r' || *p == '\n')) 253 + p++; 254 + } 255 + } 236 256 237 257 int main(int argc, char ** argv) 238 258 { ··· 269 241 void *kernel; 270 242 u32 crc = 0xffffffffUL; 271 243 272 - if (argc != 3) 244 + /* Defaults for old kernel */ 245 + #ifdef CONFIG_X86_32 246 + efi_pe_entry = 0x10; 247 + efi_stub_entry = 0x30; 248 + #else 249 + efi_pe_entry = 0x210; 250 + efi_stub_entry = 0x230; 251 + startup_64 = 0x200; 252 + #endif 253 + 254 + if (argc == 4) 255 + parse_zoffset(argv[3]); 256 + else if (argc != 3) 273 257 usage(); 274 258 275 259 /* Copy the setup code */ ··· 339 299 340 300 #ifdef CONFIG_EFI_STUB 341 301 update_pecoff_text(setup_sectors * 512, sz + i + ((sys_size * 16) - sz)); 302 + 303 + #ifdef CONFIG_X86_64 /* Yes, this is really how we defined it :( */ 304 + efi_stub_entry -= 0x200; 305 + #endif 306 + put_unaligned_le32(efi_stub_entry, &buf[0x264]); 342 307 #endif 343 308 344 309 crc = partial_crc32(buf, i, crc);
+2 -2
arch/x86/ia32/ia32entry.S
··· 207 207 testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) 208 208 jnz ia32_ret_from_sys_call 209 209 TRACE_IRQS_ON 210 - sti 210 + ENABLE_INTERRUPTS(CLBR_NONE) 211 211 movl %eax,%esi /* second arg, syscall return value */ 212 212 cmpl $-MAX_ERRNO,%eax /* is it an error ? */ 213 213 jbe 1f ··· 217 217 call __audit_syscall_exit 218 218 movq RAX-ARGOFFSET(%rsp),%rax /* reload syscall return value */ 219 219 movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi 220 - cli 220 + DISABLE_INTERRUPTS(CLBR_NONE) 221 221 TRACE_IRQS_OFF 222 222 testl %edi,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) 223 223 jz \exit
+1
arch/x86/include/asm/efi.h
··· 94 94 #endif /* CONFIG_X86_32 */ 95 95 96 96 extern int add_efi_memmap; 97 + extern unsigned long x86_efi_facility; 97 98 extern void efi_set_executable(efi_memory_desc_t *md, bool executable); 98 99 extern int efi_memblock_x86_reserve_range(void); 99 100 extern void efi_call_phys_prelog(void);
+1 -1
arch/x86/include/asm/uv/uv.h
··· 16 16 extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, 17 17 struct mm_struct *mm, 18 18 unsigned long start, 19 - unsigned end, 19 + unsigned long end, 20 20 unsigned int cpu); 21 21 22 22 #else /* X86_UV */
+46 -17
arch/x86/include/uapi/asm/bootparam.h
··· 1 1 #ifndef _ASM_X86_BOOTPARAM_H 2 2 #define _ASM_X86_BOOTPARAM_H 3 3 4 + /* setup_data types */ 5 + #define SETUP_NONE 0 6 + #define SETUP_E820_EXT 1 7 + #define SETUP_DTB 2 8 + #define SETUP_PCI 3 9 + 10 + /* ram_size flags */ 11 + #define RAMDISK_IMAGE_START_MASK 0x07FF 12 + #define RAMDISK_PROMPT_FLAG 0x8000 13 + #define RAMDISK_LOAD_FLAG 0x4000 14 + 15 + /* loadflags */ 16 + #define LOADED_HIGH (1<<0) 17 + #define QUIET_FLAG (1<<5) 18 + #define KEEP_SEGMENTS (1<<6) 19 + #define CAN_USE_HEAP (1<<7) 20 + 21 + /* xloadflags */ 22 + #define XLF_KERNEL_64 (1<<0) 23 + #define XLF_CAN_BE_LOADED_ABOVE_4G (1<<1) 24 + #define XLF_EFI_HANDOVER_32 (1<<2) 25 + #define XLF_EFI_HANDOVER_64 (1<<3) 26 + 27 + #ifndef __ASSEMBLY__ 28 + 4 29 #include <linux/types.h> 5 30 #include <linux/screen_info.h> 6 31 #include <linux/apm_bios.h> ··· 33 8 #include <asm/e820.h> 34 9 #include <asm/ist.h> 35 10 #include <video/edid.h> 36 - 37 - /* setup data types */ 38 - #define SETUP_NONE 0 39 - #define SETUP_E820_EXT 1 40 - #define SETUP_DTB 2 41 - #define SETUP_PCI 3 42 11 43 12 /* extensible setup data list node */ 44 13 struct setup_data { ··· 47 28 __u16 root_flags; 48 29 __u32 syssize; 49 30 __u16 ram_size; 50 - #define RAMDISK_IMAGE_START_MASK 0x07FF 51 - #define RAMDISK_PROMPT_FLAG 0x8000 52 - #define RAMDISK_LOAD_FLAG 0x4000 53 31 __u16 vid_mode; 54 32 __u16 root_dev; 55 33 __u16 boot_flag; ··· 58 42 __u16 kernel_version; 59 43 __u8 type_of_loader; 60 44 __u8 loadflags; 61 - #define LOADED_HIGH (1<<0) 62 - #define QUIET_FLAG (1<<5) 63 - #define KEEP_SEGMENTS (1<<6) 64 - #define CAN_USE_HEAP (1<<7) 65 45 __u16 setup_move_size; 66 46 __u32 code32_start; 67 47 __u32 ramdisk_image; ··· 70 58 __u32 initrd_addr_max; 71 59 __u32 kernel_alignment; 72 60 __u8 relocatable_kernel; 73 - __u8 _pad2[3]; 61 + __u8 min_alignment; 62 + __u16 xloadflags; 74 63 __u32 cmdline_size; 75 64 __u32 hardware_subarch; 76 65 __u64 hardware_subarch_data; ··· 119 106 __u8 hd1_info[16]; /* obsolete! */ /* 0x090 */ 120 107 struct sys_desc_table sys_desc_table; /* 0x0a0 */ 121 108 struct olpc_ofw_header olpc_ofw_header; /* 0x0b0 */ 122 - __u8 _pad4[128]; /* 0x0c0 */ 109 + __u32 ext_ramdisk_image; /* 0x0c0 */ 110 + __u32 ext_ramdisk_size; /* 0x0c4 */ 111 + __u32 ext_cmd_line_ptr; /* 0x0c8 */ 112 + __u8 _pad4[116]; /* 0x0cc */ 123 113 struct edid_info edid_info; /* 0x140 */ 124 114 struct efi_info efi_info; /* 0x1c0 */ 125 115 __u32 alt_mem_k; /* 0x1e0 */ ··· 131 115 __u8 eddbuf_entries; /* 0x1e9 */ 132 116 __u8 edd_mbr_sig_buf_entries; /* 0x1ea */ 133 117 __u8 kbd_status; /* 0x1eb */ 134 - __u8 _pad6[5]; /* 0x1ec */ 118 + __u8 _pad5[3]; /* 0x1ec */ 119 + /* 120 + * The sentinel is set to a nonzero value (0xff) in header.S. 121 + * 122 + * A bootloader is supposed to only take setup_header and put 123 + * it into a clean boot_params buffer. If it turns out that 124 + * it is clumsy or too generous with the buffer, it most 125 + * probably will pick up the sentinel variable too. The fact 126 + * that this variable then is still 0xff will let kernel 127 + * know that some variables in boot_params are invalid and 128 + * kernel should zero out certain portions of boot_params. 129 + */ 130 + __u8 sentinel; /* 0x1ef */ 131 + __u8 _pad6[1]; /* 0x1f0 */ 135 132 struct setup_header hdr; /* setup header */ /* 0x1f1 */ 136 133 __u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)]; 137 134 __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */ ··· 163 134 X86_NR_SUBARCHS, 164 135 }; 165 136 166 - 137 + #endif /* __ASSEMBLY__ */ 167 138 168 139 #endif /* _ASM_X86_BOOTPARAM_H */
+3 -4
arch/x86/kernel/cpu/intel_cacheinfo.c
··· 298 298 unsigned int); 299 299 }; 300 300 301 - #ifdef CONFIG_AMD_NB 302 - 301 + #if defined(CONFIG_AMD_NB) && defined(CONFIG_SYSFS) 303 302 /* 304 303 * L3 cache descriptors 305 304 */ ··· 523 524 static struct _cache_attr subcaches = 524 525 __ATTR(subcaches, 0644, show_subcaches, store_subcaches); 525 526 526 - #else /* CONFIG_AMD_NB */ 527 + #else 527 528 #define amd_init_l3_cache(x, y) 528 - #endif /* CONFIG_AMD_NB */ 529 + #endif /* CONFIG_AMD_NB && CONFIG_SYSFS */ 529 530 530 531 static int 531 532 __cpuinit cpuid4_cache_lookup_regs(int index,
+5 -1
arch/x86/kernel/cpu/perf_event_intel.c
··· 2019 2019 break; 2020 2020 2021 2021 case 28: /* Atom */ 2022 - case 54: /* Cedariew */ 2022 + case 38: /* Lincroft */ 2023 + case 39: /* Penwell */ 2024 + case 53: /* Cloverview */ 2025 + case 54: /* Cedarview */ 2023 2026 memcpy(hw_cache_event_ids, atom_hw_cache_event_ids, 2024 2027 sizeof(hw_cache_event_ids)); 2025 2028 ··· 2087 2084 pr_cont("SandyBridge events, "); 2088 2085 break; 2089 2086 case 58: /* IvyBridge */ 2087 + case 62: /* IvyBridge EP */ 2090 2088 memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, 2091 2089 sizeof(hw_cache_event_ids)); 2092 2090 memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs,
+1 -1
arch/x86/kernel/cpu/perf_event_p6.c
··· 19 19 20 20 }; 21 21 22 - static __initconst u64 p6_hw_cache_event_ids 22 + static u64 p6_hw_cache_event_ids 23 23 [PERF_COUNT_HW_CACHE_MAX] 24 24 [PERF_COUNT_HW_CACHE_OP_MAX] 25 25 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
+3 -4
arch/x86/kernel/entry_64.S
··· 1781 1781 * Leave room for the "copied" frame 1782 1782 */ 1783 1783 subq $(5*8), %rsp 1784 + CFI_ADJUST_CFA_OFFSET 5*8 1784 1785 1785 1786 /* Copy the stack frame to the Saved frame */ 1786 1787 .rept 5 ··· 1864 1863 nmi_swapgs: 1865 1864 SWAPGS_UNSAFE_STACK 1866 1865 nmi_restore: 1867 - RESTORE_ALL 8 1868 - 1869 - /* Pop the extra iret frame */ 1870 - addq $(5*8), %rsp 1866 + /* Pop the extra iret frame at once */ 1867 + RESTORE_ALL 6*8 1871 1868 1872 1869 /* Clear the NMI executing stack variable */ 1873 1870 movq $0, 5*8(%rsp)
+7 -2
arch/x86/kernel/head_32.S
··· 300 300 leal -__PAGE_OFFSET(%ecx),%esp 301 301 302 302 default_entry: 303 + #define CR0_STATE (X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | \ 304 + X86_CR0_NE | X86_CR0_WP | X86_CR0_AM | \ 305 + X86_CR0_PG) 306 + movl $(CR0_STATE & ~X86_CR0_PG),%eax 307 + movl %eax,%cr0 308 + 303 309 /* 304 310 * New page tables may be in 4Mbyte page mode and may 305 311 * be using the global pages. ··· 370 364 */ 371 365 movl $pa(initial_page_table), %eax 372 366 movl %eax,%cr3 /* set the page table pointer.. */ 373 - movl %cr0,%eax 374 - orl $X86_CR0_PG,%eax 367 + movl $CR0_STATE,%eax 375 368 movl %eax,%cr0 /* ..and set paging (PG) bit */ 376 369 ljmp $__BOOT_CS,$1f /* Clear prefetch and normalize %eip */ 377 370 1:
+3
arch/x86/kernel/msr.c
··· 174 174 unsigned int cpu; 175 175 struct cpuinfo_x86 *c; 176 176 177 + if (!capable(CAP_SYS_RAWIO)) 178 + return -EPERM; 179 + 177 180 cpu = iminor(file->f_path.dentry->d_inode); 178 181 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) 179 182 return -ENXIO; /* No such CPU */
+1 -1
arch/x86/kernel/pci-dma.c
··· 56 56 EXPORT_SYMBOL(x86_dma_fallback_dev); 57 57 58 58 /* Number of entries preallocated for DMA-API debugging */ 59 - #define PREALLOC_DMA_DEBUG_ENTRIES 32768 59 + #define PREALLOC_DMA_DEBUG_ENTRIES 65536 60 60 61 61 int dma_set_mask(struct device *dev, u64 mask) 62 62 {
+1 -1
arch/x86/kernel/reboot.c
··· 584 584 break; 585 585 586 586 case BOOT_EFI: 587 - if (efi_enabled) 587 + if (efi_enabled(EFI_RUNTIME_SERVICES)) 588 588 efi.reset_system(reboot_mode ? 589 589 EFI_RESET_WARM : 590 590 EFI_RESET_COLD,
+14 -14
arch/x86/kernel/setup.c
··· 807 807 #ifdef CONFIG_EFI 808 808 if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature, 809 809 "EL32", 4)) { 810 - efi_enabled = 1; 811 - efi_64bit = false; 810 + set_bit(EFI_BOOT, &x86_efi_facility); 812 811 } else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature, 813 812 "EL64", 4)) { 814 - efi_enabled = 1; 815 - efi_64bit = true; 813 + set_bit(EFI_BOOT, &x86_efi_facility); 814 + set_bit(EFI_64BIT, &x86_efi_facility); 816 815 } 817 - if (efi_enabled && efi_memblock_x86_reserve_range()) 818 - efi_enabled = 0; 816 + 817 + if (efi_enabled(EFI_BOOT)) 818 + efi_memblock_x86_reserve_range(); 819 819 #endif 820 820 821 821 x86_init.oem.arch_setup(); ··· 888 888 889 889 finish_e820_parsing(); 890 890 891 - if (efi_enabled) 891 + if (efi_enabled(EFI_BOOT)) 892 892 efi_init(); 893 893 894 894 dmi_scan_machine(); ··· 971 971 * The EFI specification says that boot service code won't be called 972 972 * after ExitBootServices(). This is, in fact, a lie. 973 973 */ 974 - if (efi_enabled) 974 + if (efi_enabled(EFI_MEMMAP)) 975 975 efi_reserve_boot_services(); 976 976 977 977 /* preallocate 4k for mptable mpc */ ··· 1114 1114 1115 1115 #ifdef CONFIG_VT 1116 1116 #if defined(CONFIG_VGA_CONSOLE) 1117 - if (!efi_enabled || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY)) 1117 + if (!efi_enabled(EFI_BOOT) || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY)) 1118 1118 conswitchp = &vga_con; 1119 1119 #elif defined(CONFIG_DUMMY_CONSOLE) 1120 1120 conswitchp = &dummy_con; ··· 1131 1131 register_refined_jiffies(CLOCK_TICK_RATE); 1132 1132 1133 1133 #ifdef CONFIG_EFI 1134 - /* Once setup is done above, disable efi_enabled on mismatched 1135 - * firmware/kernel archtectures since there is no support for 1136 - * runtime services. 1134 + /* Once setup is done above, unmap the EFI memory map on 1135 + * mismatched firmware/kernel archtectures since there is no 1136 + * support for runtime services. 1137 1137 */ 1138 - if (efi_enabled && IS_ENABLED(CONFIG_X86_64) != efi_64bit) { 1138 + if (efi_enabled(EFI_BOOT) && 1139 + IS_ENABLED(CONFIG_X86_64) != efi_enabled(EFI_64BIT)) { 1139 1140 pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n"); 1140 1141 efi_unmap_memmap(); 1141 - efi_enabled = 0; 1142 1142 } 1143 1143 #endif 1144 1144 }
+35 -24
arch/x86/platform/efi/efi.c
··· 51 51 52 52 #define EFI_DEBUG 1 53 53 54 - int efi_enabled; 55 - EXPORT_SYMBOL(efi_enabled); 56 - 57 54 struct efi __read_mostly efi = { 58 55 .mps = EFI_INVALID_TABLE_ADDR, 59 56 .acpi = EFI_INVALID_TABLE_ADDR, ··· 66 69 67 70 struct efi_memory_map memmap; 68 71 69 - bool efi_64bit; 70 - 71 72 static struct efi efi_phys __initdata; 72 73 static efi_system_table_t efi_systab __initdata; 73 74 74 75 static inline bool efi_is_native(void) 75 76 { 76 - return IS_ENABLED(CONFIG_X86_64) == efi_64bit; 77 + return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT); 77 78 } 79 + 80 + unsigned long x86_efi_facility; 81 + 82 + /* 83 + * Returns 1 if 'facility' is enabled, 0 otherwise. 84 + */ 85 + int efi_enabled(int facility) 86 + { 87 + return test_bit(facility, &x86_efi_facility) != 0; 88 + } 89 + EXPORT_SYMBOL(efi_enabled); 78 90 79 91 static int __init setup_noefi(char *arg) 80 92 { 81 - efi_enabled = 0; 93 + clear_bit(EFI_BOOT, &x86_efi_facility); 82 94 return 0; 83 95 } 84 96 early_param("noefi", setup_noefi); ··· 432 426 433 427 void __init efi_unmap_memmap(void) 434 428 { 429 + clear_bit(EFI_MEMMAP, &x86_efi_facility); 435 430 if (memmap.map) { 436 431 early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size); 437 432 memmap.map = NULL; ··· 467 460 468 461 static int __init efi_systab_init(void *phys) 469 462 { 470 - if (efi_64bit) { 463 + if (efi_enabled(EFI_64BIT)) { 471 464 efi_system_table_64_t *systab64; 472 465 u64 tmp = 0; 473 466 ··· 559 552 void *config_tables, *tablep; 560 553 int i, sz; 561 554 562 - if (efi_64bit) 555 + if (efi_enabled(EFI_64BIT)) 563 556 sz = sizeof(efi_config_table_64_t); 564 557 else 565 558 sz = sizeof(efi_config_table_32_t); ··· 579 572 efi_guid_t guid; 580 573 unsigned long table; 581 574 582 - if (efi_64bit) { 575 + if (efi_enabled(EFI_64BIT)) { 583 576 u64 table64; 584 577 guid = ((efi_config_table_64_t *)tablep)->guid; 585 578 table64 = ((efi_config_table_64_t *)tablep)->table; ··· 691 684 if (boot_params.efi_info.efi_systab_hi || 692 685 boot_params.efi_info.efi_memmap_hi) { 693 686 pr_info("Table located above 4GB, disabling EFI.\n"); 694 - efi_enabled = 0; 695 687 return; 696 688 } 697 689 efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab; ··· 700 694 ((__u64)boot_params.efi_info.efi_systab_hi<<32)); 701 695 #endif 702 696 703 - if (efi_systab_init(efi_phys.systab)) { 704 - efi_enabled = 0; 697 + if (efi_systab_init(efi_phys.systab)) 705 698 return; 706 - } 699 + 700 + set_bit(EFI_SYSTEM_TABLES, &x86_efi_facility); 707 701 708 702 /* 709 703 * Show what we know for posterity ··· 721 715 efi.systab->hdr.revision >> 16, 722 716 efi.systab->hdr.revision & 0xffff, vendor); 723 717 724 - if (efi_config_init(efi.systab->tables, efi.systab->nr_tables)) { 725 - efi_enabled = 0; 718 + if (efi_config_init(efi.systab->tables, efi.systab->nr_tables)) 726 719 return; 727 - } 720 + 721 + set_bit(EFI_CONFIG_TABLES, &x86_efi_facility); 728 722 729 723 /* 730 724 * Note: We currently don't support runtime services on an EFI ··· 733 727 734 728 if (!efi_is_native()) 735 729 pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n"); 736 - else if (efi_runtime_init()) { 737 - efi_enabled = 0; 738 - return; 730 + else { 731 + if (efi_runtime_init()) 732 + return; 733 + set_bit(EFI_RUNTIME_SERVICES, &x86_efi_facility); 739 734 } 740 735 741 - if (efi_memmap_init()) { 742 - efi_enabled = 0; 736 + if (efi_memmap_init()) 743 737 return; 744 - } 738 + 739 + set_bit(EFI_MEMMAP, &x86_efi_facility); 740 + 745 741 #ifdef CONFIG_X86_32 746 742 if (efi_is_native()) { 747 743 x86_platform.get_wallclock = efi_get_time; ··· 949 941 * 950 942 * Call EFI services through wrapper functions. 951 943 */ 952 - efi.runtime_version = efi_systab.fw_revision; 944 + efi.runtime_version = efi_systab.hdr.revision; 953 945 efi.get_time = virt_efi_get_time; 954 946 efi.set_time = virt_efi_set_time; 955 947 efi.get_wakeup_time = virt_efi_get_wakeup_time; ··· 976 968 { 977 969 efi_memory_desc_t *md; 978 970 void *p; 971 + 972 + if (!efi_enabled(EFI_MEMMAP)) 973 + return 0; 979 974 980 975 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { 981 976 md = p;
+17 -5
arch/x86/platform/efi/efi_64.c
··· 38 38 #include <asm/cacheflush.h> 39 39 #include <asm/fixmap.h> 40 40 41 - static pgd_t save_pgd __initdata; 41 + static pgd_t *save_pgd __initdata; 42 42 static unsigned long efi_flags __initdata; 43 43 44 44 static void __init early_code_mapping_set_exec(int executable) ··· 61 61 void __init efi_call_phys_prelog(void) 62 62 { 63 63 unsigned long vaddress; 64 + int pgd; 65 + int n_pgds; 64 66 65 67 early_code_mapping_set_exec(1); 66 68 local_irq_save(efi_flags); 67 - vaddress = (unsigned long)__va(0x0UL); 68 - save_pgd = *pgd_offset_k(0x0UL); 69 - set_pgd(pgd_offset_k(0x0UL), *pgd_offset_k(vaddress)); 69 + 70 + n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT), PGDIR_SIZE); 71 + save_pgd = kmalloc(n_pgds * sizeof(pgd_t), GFP_KERNEL); 72 + 73 + for (pgd = 0; pgd < n_pgds; pgd++) { 74 + save_pgd[pgd] = *pgd_offset_k(pgd * PGDIR_SIZE); 75 + vaddress = (unsigned long)__va(pgd * PGDIR_SIZE); 76 + set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress)); 77 + } 70 78 __flush_tlb_all(); 71 79 } 72 80 ··· 83 75 /* 84 76 * After the lock is released, the original page table is restored. 85 77 */ 86 - set_pgd(pgd_offset_k(0x0UL), save_pgd); 78 + int pgd; 79 + int n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT) , PGDIR_SIZE); 80 + for (pgd = 0; pgd < n_pgds; pgd++) 81 + set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), save_pgd[pgd]); 82 + kfree(save_pgd); 87 83 __flush_tlb_all(); 88 84 local_irq_restore(efi_flags); 89 85 early_code_mapping_set_exec(0);
+7 -3
arch/x86/platform/uv/tlb_uv.c
··· 1034 1034 * globally purge translation cache of a virtual address or all TLB's 1035 1035 * @cpumask: mask of all cpu's in which the address is to be removed 1036 1036 * @mm: mm_struct containing virtual address range 1037 - * @va: virtual address to be removed (or TLB_FLUSH_ALL for all TLB's on cpu) 1037 + * @start: start virtual address to be removed from TLB 1038 + * @end: end virtual address to be remove from TLB 1038 1039 * @cpu: the current cpu 1039 1040 * 1040 1041 * This is the entry point for initiating any UV global TLB shootdown. ··· 1057 1056 */ 1058 1057 const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, 1059 1058 struct mm_struct *mm, unsigned long start, 1060 - unsigned end, unsigned int cpu) 1059 + unsigned long end, unsigned int cpu) 1061 1060 { 1062 1061 int locals = 0; 1063 1062 int remotes = 0; ··· 1114 1113 1115 1114 record_send_statistics(stat, locals, hubs, remotes, bau_desc); 1116 1115 1117 - bau_desc->payload.address = start; 1116 + if (!end || (end - start) <= PAGE_SIZE) 1117 + bau_desc->payload.address = start; 1118 + else 1119 + bau_desc->payload.address = TLB_FLUSH_ALL; 1118 1120 bau_desc->payload.sending_cpu = cpu; 1119 1121 /* 1120 1122 * uv_flush_send_and_wait returns 0 if all cpu's were messaged,
+8 -2
arch/x86/tools/insn_sanity.c
··· 55 55 static void usage(const char *err) 56 56 { 57 57 if (err) 58 - fprintf(stderr, "Error: %s\n\n", err); 58 + fprintf(stderr, "%s: Error: %s\n\n", prog, err); 59 59 fprintf(stderr, "Usage: %s [-y|-n|-v] [-s seed[,no]] [-m max] [-i input]\n", prog); 60 60 fprintf(stderr, "\t-y 64bit mode\n"); 61 61 fprintf(stderr, "\t-n 32bit mode\n"); ··· 269 269 insns++; 270 270 } 271 271 272 - fprintf(stdout, "%s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n", (errors) ? "Failure" : "Success", insns, (input_file) ? "given" : "random", errors, seed); 272 + fprintf(stdout, "%s: %s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n", 273 + prog, 274 + (errors) ? "Failure" : "Success", 275 + insns, 276 + (input_file) ? "given" : "random", 277 + errors, 278 + seed); 273 279 274 280 return errors ? 1 : 0; 275 281 }
+4 -2
arch/x86/tools/relocs.c
··· 814 814 read_relocs(fp); 815 815 if (show_absolute_syms) { 816 816 print_absolute_symbols(); 817 - return 0; 817 + goto out; 818 818 } 819 819 if (show_absolute_relocs) { 820 820 print_absolute_relocs(); 821 - return 0; 821 + goto out; 822 822 } 823 823 emit_relocs(as_text, use_real_mode); 824 + out: 825 + fclose(fp); 824 826 return 0; 825 827 }
+15
arch/xtensa/include/asm/dma-mapping.h
··· 170 170 consistent_sync(vaddr, size, direction); 171 171 } 172 172 173 + /* Not supported for now */ 174 + static inline int dma_mmap_coherent(struct device *dev, 175 + struct vm_area_struct *vma, void *cpu_addr, 176 + dma_addr_t dma_addr, size_t size) 177 + { 178 + return -EINVAL; 179 + } 180 + 181 + static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt, 182 + void *cpu_addr, dma_addr_t dma_addr, 183 + size_t size) 184 + { 185 + return -EINVAL; 186 + } 187 + 173 188 #endif /* _XTENSA_DMA_MAPPING_H */
+32 -10
block/genhd.c
··· 35 35 36 36 static struct device_type disk_type; 37 37 38 + static void disk_check_events(struct disk_events *ev, 39 + unsigned int *clearing_ptr); 38 40 static void disk_alloc_events(struct gendisk *disk); 39 41 static void disk_add_events(struct gendisk *disk); 40 42 static void disk_del_events(struct gendisk *disk); ··· 1551 1549 const struct block_device_operations *bdops = disk->fops; 1552 1550 struct disk_events *ev = disk->ev; 1553 1551 unsigned int pending; 1552 + unsigned int clearing = mask; 1554 1553 1555 1554 if (!ev) { 1556 1555 /* for drivers still using the old ->media_changed method */ ··· 1561 1558 return 0; 1562 1559 } 1563 1560 1564 - /* tell the workfn about the events being cleared */ 1561 + disk_block_events(disk); 1562 + 1563 + /* 1564 + * store the union of mask and ev->clearing on the stack so that the 1565 + * race with disk_flush_events does not cause ambiguity (ev->clearing 1566 + * can still be modified even if events are blocked). 1567 + */ 1565 1568 spin_lock_irq(&ev->lock); 1566 - ev->clearing |= mask; 1569 + clearing |= ev->clearing; 1570 + ev->clearing = 0; 1567 1571 spin_unlock_irq(&ev->lock); 1568 1572 1569 - /* uncondtionally schedule event check and wait for it to finish */ 1570 - disk_block_events(disk); 1571 - queue_delayed_work(system_freezable_wq, &ev->dwork, 0); 1572 - flush_delayed_work(&ev->dwork); 1573 - __disk_unblock_events(disk, false); 1573 + disk_check_events(ev, &clearing); 1574 + /* 1575 + * if ev->clearing is not 0, the disk_flush_events got called in the 1576 + * middle of this function, so we want to run the workfn without delay. 1577 + */ 1578 + __disk_unblock_events(disk, ev->clearing ? true : false); 1574 1579 1575 1580 /* then, fetch and clear pending events */ 1576 1581 spin_lock_irq(&ev->lock); 1577 - WARN_ON_ONCE(ev->clearing & mask); /* cleared by workfn */ 1578 1582 pending = ev->pending & mask; 1579 1583 ev->pending &= ~mask; 1580 1584 spin_unlock_irq(&ev->lock); 1585 + WARN_ON_ONCE(clearing & mask); 1581 1586 1582 1587 return pending; 1583 1588 } 1584 1589 1590 + /* 1591 + * Separate this part out so that a different pointer for clearing_ptr can be 1592 + * passed in for disk_clear_events. 1593 + */ 1585 1594 static void disk_events_workfn(struct work_struct *work) 1586 1595 { 1587 1596 struct delayed_work *dwork = to_delayed_work(work); 1588 1597 struct disk_events *ev = container_of(dwork, struct disk_events, dwork); 1598 + 1599 + disk_check_events(ev, &ev->clearing); 1600 + } 1601 + 1602 + static void disk_check_events(struct disk_events *ev, 1603 + unsigned int *clearing_ptr) 1604 + { 1589 1605 struct gendisk *disk = ev->disk; 1590 1606 char *envp[ARRAY_SIZE(disk_uevents) + 1] = { }; 1591 - unsigned int clearing = ev->clearing; 1607 + unsigned int clearing = *clearing_ptr; 1592 1608 unsigned int events; 1593 1609 unsigned long intv; 1594 1610 int nr_events = 0, i; ··· 1620 1598 1621 1599 events &= ~ev->pending; 1622 1600 ev->pending |= events; 1623 - ev->clearing &= ~clearing; 1601 + *clearing_ptr &= ~clearing; 1624 1602 1625 1603 intv = disk_events_poll_jiffies(disk); 1626 1604 if (!ev->block && intv)
+1 -1
drivers/acpi/osl.c
··· 250 250 return acpi_rsdp; 251 251 #endif 252 252 253 - if (efi_enabled) { 253 + if (efi_enabled(EFI_CONFIG_TABLES)) { 254 254 if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) 255 255 return efi.acpi20; 256 256 else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
+73 -73
drivers/atm/iphase.h
··· 636 636 #define SEG_BASE IPHASE5575_FRAG_CONTROL_REG_BASE 637 637 #define REASS_BASE IPHASE5575_REASS_CONTROL_REG_BASE 638 638 639 - typedef volatile u_int freg_t; 639 + typedef volatile u_int ffreg_t; 640 640 typedef u_int rreg_t; 641 641 642 642 typedef struct _ffredn_t { 643 - freg_t idlehead_high; /* Idle cell header (high) */ 644 - freg_t idlehead_low; /* Idle cell header (low) */ 645 - freg_t maxrate; /* Maximum rate */ 646 - freg_t stparms; /* Traffic Management Parameters */ 647 - freg_t abrubr_abr; /* ABRUBR Priority Byte 1, TCR Byte 0 */ 648 - freg_t rm_type; /* */ 649 - u_int filler5[0x17 - 0x06]; 650 - freg_t cmd_reg; /* Command register */ 651 - u_int filler18[0x20 - 0x18]; 652 - freg_t cbr_base; /* CBR Pointer Base */ 653 - freg_t vbr_base; /* VBR Pointer Base */ 654 - freg_t abr_base; /* ABR Pointer Base */ 655 - freg_t ubr_base; /* UBR Pointer Base */ 656 - u_int filler24; 657 - freg_t vbrwq_base; /* VBR Wait Queue Base */ 658 - freg_t abrwq_base; /* ABR Wait Queue Base */ 659 - freg_t ubrwq_base; /* UBR Wait Queue Base */ 660 - freg_t vct_base; /* Main VC Table Base */ 661 - freg_t vcte_base; /* Extended Main VC Table Base */ 662 - u_int filler2a[0x2C - 0x2A]; 663 - freg_t cbr_tab_beg; /* CBR Table Begin */ 664 - freg_t cbr_tab_end; /* CBR Table End */ 665 - freg_t cbr_pointer; /* CBR Pointer */ 666 - u_int filler2f[0x30 - 0x2F]; 667 - freg_t prq_st_adr; /* Packet Ready Queue Start Address */ 668 - freg_t prq_ed_adr; /* Packet Ready Queue End Address */ 669 - freg_t prq_rd_ptr; /* Packet Ready Queue read pointer */ 670 - freg_t prq_wr_ptr; /* Packet Ready Queue write pointer */ 671 - freg_t tcq_st_adr; /* Transmit Complete Queue Start Address*/ 672 - freg_t tcq_ed_adr; /* Transmit Complete Queue End Address */ 673 - freg_t tcq_rd_ptr; /* Transmit Complete Queue read pointer */ 674 - freg_t tcq_wr_ptr; /* Transmit Complete Queue write pointer*/ 675 - u_int filler38[0x40 - 0x38]; 676 - freg_t queue_base; /* Base address for PRQ and TCQ */ 677 - freg_t desc_base; /* Base address of descriptor table */ 678 - u_int filler42[0x45 - 0x42]; 679 - freg_t mode_reg_0; /* Mode register 0 */ 680 - freg_t mode_reg_1; /* Mode register 1 */ 681 - freg_t intr_status_reg;/* Interrupt Status register */ 682 - freg_t mask_reg; /* Mask Register */ 683 - freg_t cell_ctr_high1; /* Total cell transfer count (high) */ 684 - freg_t cell_ctr_lo1; /* Total cell transfer count (low) */ 685 - freg_t state_reg; /* Status register */ 686 - u_int filler4c[0x58 - 0x4c]; 687 - freg_t curr_desc_num; /* Contains the current descriptor num */ 688 - freg_t next_desc; /* Next descriptor */ 689 - freg_t next_vc; /* Next VC */ 690 - u_int filler5b[0x5d - 0x5b]; 691 - freg_t present_slot_cnt;/* Present slot count */ 692 - u_int filler5e[0x6a - 0x5e]; 693 - freg_t new_desc_num; /* New descriptor number */ 694 - freg_t new_vc; /* New VC */ 695 - freg_t sched_tbl_ptr; /* Schedule table pointer */ 696 - freg_t vbrwq_wptr; /* VBR wait queue write pointer */ 697 - freg_t vbrwq_rptr; /* VBR wait queue read pointer */ 698 - freg_t abrwq_wptr; /* ABR wait queue write pointer */ 699 - freg_t abrwq_rptr; /* ABR wait queue read pointer */ 700 - freg_t ubrwq_wptr; /* UBR wait queue write pointer */ 701 - freg_t ubrwq_rptr; /* UBR wait queue read pointer */ 702 - freg_t cbr_vc; /* CBR VC */ 703 - freg_t vbr_sb_vc; /* VBR SB VC */ 704 - freg_t abr_sb_vc; /* ABR SB VC */ 705 - freg_t ubr_sb_vc; /* UBR SB VC */ 706 - freg_t vbr_next_link; /* VBR next link */ 707 - freg_t abr_next_link; /* ABR next link */ 708 - freg_t ubr_next_link; /* UBR next link */ 709 - u_int filler7a[0x7c-0x7a]; 710 - freg_t out_rate_head; /* Out of rate head */ 711 - u_int filler7d[0xca-0x7d]; /* pad out to full address space */ 712 - freg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */ 713 - freg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */ 714 - u_int fillercc[0x100-0xcc]; /* pad out to full address space */ 643 + ffreg_t idlehead_high; /* Idle cell header (high) */ 644 + ffreg_t idlehead_low; /* Idle cell header (low) */ 645 + ffreg_t maxrate; /* Maximum rate */ 646 + ffreg_t stparms; /* Traffic Management Parameters */ 647 + ffreg_t abrubr_abr; /* ABRUBR Priority Byte 1, TCR Byte 0 */ 648 + ffreg_t rm_type; /* */ 649 + u_int filler5[0x17 - 0x06]; 650 + ffreg_t cmd_reg; /* Command register */ 651 + u_int filler18[0x20 - 0x18]; 652 + ffreg_t cbr_base; /* CBR Pointer Base */ 653 + ffreg_t vbr_base; /* VBR Pointer Base */ 654 + ffreg_t abr_base; /* ABR Pointer Base */ 655 + ffreg_t ubr_base; /* UBR Pointer Base */ 656 + u_int filler24; 657 + ffreg_t vbrwq_base; /* VBR Wait Queue Base */ 658 + ffreg_t abrwq_base; /* ABR Wait Queue Base */ 659 + ffreg_t ubrwq_base; /* UBR Wait Queue Base */ 660 + ffreg_t vct_base; /* Main VC Table Base */ 661 + ffreg_t vcte_base; /* Extended Main VC Table Base */ 662 + u_int filler2a[0x2C - 0x2A]; 663 + ffreg_t cbr_tab_beg; /* CBR Table Begin */ 664 + ffreg_t cbr_tab_end; /* CBR Table End */ 665 + ffreg_t cbr_pointer; /* CBR Pointer */ 666 + u_int filler2f[0x30 - 0x2F]; 667 + ffreg_t prq_st_adr; /* Packet Ready Queue Start Address */ 668 + ffreg_t prq_ed_adr; /* Packet Ready Queue End Address */ 669 + ffreg_t prq_rd_ptr; /* Packet Ready Queue read pointer */ 670 + ffreg_t prq_wr_ptr; /* Packet Ready Queue write pointer */ 671 + ffreg_t tcq_st_adr; /* Transmit Complete Queue Start Address*/ 672 + ffreg_t tcq_ed_adr; /* Transmit Complete Queue End Address */ 673 + ffreg_t tcq_rd_ptr; /* Transmit Complete Queue read pointer */ 674 + ffreg_t tcq_wr_ptr; /* Transmit Complete Queue write pointer*/ 675 + u_int filler38[0x40 - 0x38]; 676 + ffreg_t queue_base; /* Base address for PRQ and TCQ */ 677 + ffreg_t desc_base; /* Base address of descriptor table */ 678 + u_int filler42[0x45 - 0x42]; 679 + ffreg_t mode_reg_0; /* Mode register 0 */ 680 + ffreg_t mode_reg_1; /* Mode register 1 */ 681 + ffreg_t intr_status_reg;/* Interrupt Status register */ 682 + ffreg_t mask_reg; /* Mask Register */ 683 + ffreg_t cell_ctr_high1; /* Total cell transfer count (high) */ 684 + ffreg_t cell_ctr_lo1; /* Total cell transfer count (low) */ 685 + ffreg_t state_reg; /* Status register */ 686 + u_int filler4c[0x58 - 0x4c]; 687 + ffreg_t curr_desc_num; /* Contains the current descriptor num */ 688 + ffreg_t next_desc; /* Next descriptor */ 689 + ffreg_t next_vc; /* Next VC */ 690 + u_int filler5b[0x5d - 0x5b]; 691 + ffreg_t present_slot_cnt;/* Present slot count */ 692 + u_int filler5e[0x6a - 0x5e]; 693 + ffreg_t new_desc_num; /* New descriptor number */ 694 + ffreg_t new_vc; /* New VC */ 695 + ffreg_t sched_tbl_ptr; /* Schedule table pointer */ 696 + ffreg_t vbrwq_wptr; /* VBR wait queue write pointer */ 697 + ffreg_t vbrwq_rptr; /* VBR wait queue read pointer */ 698 + ffreg_t abrwq_wptr; /* ABR wait queue write pointer */ 699 + ffreg_t abrwq_rptr; /* ABR wait queue read pointer */ 700 + ffreg_t ubrwq_wptr; /* UBR wait queue write pointer */ 701 + ffreg_t ubrwq_rptr; /* UBR wait queue read pointer */ 702 + ffreg_t cbr_vc; /* CBR VC */ 703 + ffreg_t vbr_sb_vc; /* VBR SB VC */ 704 + ffreg_t abr_sb_vc; /* ABR SB VC */ 705 + ffreg_t ubr_sb_vc; /* UBR SB VC */ 706 + ffreg_t vbr_next_link; /* VBR next link */ 707 + ffreg_t abr_next_link; /* ABR next link */ 708 + ffreg_t ubr_next_link; /* UBR next link */ 709 + u_int filler7a[0x7c-0x7a]; 710 + ffreg_t out_rate_head; /* Out of rate head */ 711 + u_int filler7d[0xca-0x7d]; /* pad out to full address space */ 712 + ffreg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */ 713 + ffreg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */ 714 + u_int fillercc[0x100-0xcc]; /* pad out to full address space */ 715 715 } ffredn_t; 716 716 717 717 typedef struct _rfredn_t {
+5
drivers/bcma/bcma_private.h
··· 97 97 #ifdef CONFIG_BCMA_DRIVER_GPIO 98 98 /* driver_gpio.c */ 99 99 int bcma_gpio_init(struct bcma_drv_cc *cc); 100 + int bcma_gpio_unregister(struct bcma_drv_cc *cc); 100 101 #else 101 102 static inline int bcma_gpio_init(struct bcma_drv_cc *cc) 102 103 { 103 104 return -ENOTSUPP; 105 + } 106 + static inline int bcma_gpio_unregister(struct bcma_drv_cc *cc) 107 + { 108 + return 0; 104 109 } 105 110 #endif /* CONFIG_BCMA_DRIVER_GPIO */ 106 111
+5
drivers/bcma/driver_gpio.c
··· 107 107 108 108 return gpiochip_add(chip); 109 109 } 110 + 111 + int bcma_gpio_unregister(struct bcma_drv_cc *cc) 112 + { 113 + return gpiochip_remove(&cc->gpio); 114 + }
+7
drivers/bcma/main.c
··· 276 276 void bcma_bus_unregister(struct bcma_bus *bus) 277 277 { 278 278 struct bcma_device *cores[3]; 279 + int err; 280 + 281 + err = bcma_gpio_unregister(&bus->drv_cc); 282 + if (err == -EBUSY) 283 + bcma_err(bus, "Some GPIOs are still in use.\n"); 284 + else if (err) 285 + bcma_err(bus, "Can not unregister GPIO driver: %i\n", err); 279 286 280 287 cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K); 281 288 cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE);
+1 -1
drivers/block/drbd/drbd_req.c
··· 168 168 } 169 169 170 170 /* must hold resource->req_lock */ 171 - static void start_new_tl_epoch(struct drbd_tconn *tconn) 171 + void start_new_tl_epoch(struct drbd_tconn *tconn) 172 172 { 173 173 /* no point closing an epoch, if it is empty, anyways. */ 174 174 if (tconn->current_tle_writes == 0)
+1
drivers/block/drbd/drbd_req.h
··· 267 267 int error; 268 268 }; 269 269 270 + extern void start_new_tl_epoch(struct drbd_tconn *tconn); 270 271 extern void drbd_req_destroy(struct kref *kref); 271 272 extern void _req_may_be_done(struct drbd_request *req, 272 273 struct bio_and_error *m);
+7
drivers/block/drbd/drbd_state.c
··· 931 931 enum drbd_state_rv rv = SS_SUCCESS; 932 932 enum sanitize_state_warnings ssw; 933 933 struct after_state_chg_work *ascw; 934 + bool did_remote, should_do_remote; 934 935 935 936 os = drbd_read_state(mdev); 936 937 ··· 982 981 (os.disk != D_DISKLESS && ns.disk == D_DISKLESS)) 983 982 atomic_inc(&mdev->local_cnt); 984 983 984 + did_remote = drbd_should_do_remote(mdev->state); 985 985 mdev->state.i = ns.i; 986 + should_do_remote = drbd_should_do_remote(mdev->state); 986 987 mdev->tconn->susp = ns.susp; 987 988 mdev->tconn->susp_nod = ns.susp_nod; 988 989 mdev->tconn->susp_fen = ns.susp_fen; 990 + 991 + /* put replicated vs not-replicated requests in seperate epochs */ 992 + if (did_remote != should_do_remote) 993 + start_new_tl_epoch(mdev->tconn); 989 994 990 995 if (os.disk == D_ATTACHING && ns.disk >= D_NEGOTIATING) 991 996 drbd_print_uuids(mdev, "attached to UUIDs");
+18 -6
drivers/block/mtip32xx/mtip32xx.c
··· 626 626 } 627 627 } 628 628 629 - if (cmdto_cnt && !test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags)) { 629 + if (cmdto_cnt) { 630 630 print_tags(port->dd, "timed out", tagaccum, cmdto_cnt); 631 - 632 - mtip_restart_port(port); 631 + if (!test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags)) { 632 + mtip_restart_port(port); 633 + wake_up_interruptible(&port->svc_wait); 634 + } 633 635 clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags); 634 - wake_up_interruptible(&port->svc_wait); 635 636 } 636 637 637 638 if (port->ic_pause_timer) { ··· 3888 3887 * Delete our gendisk structure. This also removes the device 3889 3888 * from /dev 3890 3889 */ 3891 - del_gendisk(dd->disk); 3890 + if (dd->disk) { 3891 + if (dd->disk->queue) 3892 + del_gendisk(dd->disk); 3893 + else 3894 + put_disk(dd->disk); 3895 + } 3892 3896 3893 3897 spin_lock(&rssd_index_lock); 3894 3898 ida_remove(&rssd_index_ida, dd->index); ··· 3927 3921 "Shutting down %s ...\n", dd->disk->disk_name); 3928 3922 3929 3923 /* Delete our gendisk structure, and cleanup the blk queue. */ 3930 - del_gendisk(dd->disk); 3924 + if (dd->disk) { 3925 + if (dd->disk->queue) 3926 + del_gendisk(dd->disk); 3927 + else 3928 + put_disk(dd->disk); 3929 + } 3930 + 3931 3931 3932 3932 spin_lock(&rssd_index_lock); 3933 3933 ida_remove(&rssd_index_ida, dd->index);
+11 -7
drivers/block/xen-blkback/blkback.c
··· 161 161 static void make_response(struct xen_blkif *blkif, u64 id, 162 162 unsigned short op, int st); 163 163 164 - #define foreach_grant(pos, rbtree, node) \ 165 - for ((pos) = container_of(rb_first((rbtree)), typeof(*(pos)), node); \ 164 + #define foreach_grant_safe(pos, n, rbtree, node) \ 165 + for ((pos) = container_of(rb_first((rbtree)), typeof(*(pos)), node), \ 166 + (n) = rb_next(&(pos)->node); \ 166 167 &(pos)->node != NULL; \ 167 - (pos) = container_of(rb_next(&(pos)->node), typeof(*(pos)), node)) 168 + (pos) = container_of(n, typeof(*(pos)), node), \ 169 + (n) = (&(pos)->node != NULL) ? rb_next(&(pos)->node) : NULL) 168 170 169 171 170 172 static void add_persistent_gnt(struct rb_root *root, ··· 219 217 struct gnttab_unmap_grant_ref unmap[BLKIF_MAX_SEGMENTS_PER_REQUEST]; 220 218 struct page *pages[BLKIF_MAX_SEGMENTS_PER_REQUEST]; 221 219 struct persistent_gnt *persistent_gnt; 220 + struct rb_node *n; 222 221 int ret = 0; 223 222 int segs_to_unmap = 0; 224 223 225 - foreach_grant(persistent_gnt, root, node) { 224 + foreach_grant_safe(persistent_gnt, n, root, node) { 226 225 BUG_ON(persistent_gnt->handle == 227 226 BLKBACK_INVALID_HANDLE); 228 227 gnttab_set_unmap_op(&unmap[segs_to_unmap], ··· 233 230 persistent_gnt->handle); 234 231 235 232 pages[segs_to_unmap] = persistent_gnt->page; 236 - rb_erase(&persistent_gnt->node, root); 237 - kfree(persistent_gnt); 238 - num--; 239 233 240 234 if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST || 241 235 !rb_next(&persistent_gnt->node)) { ··· 241 241 BUG_ON(ret); 242 242 segs_to_unmap = 0; 243 243 } 244 + 245 + rb_erase(&persistent_gnt->node, root); 246 + kfree(persistent_gnt); 247 + num--; 244 248 } 245 249 BUG_ON(num != 0); 246 250 }
+6 -4
drivers/block/xen-blkfront.c
··· 792 792 { 793 793 struct llist_node *all_gnts; 794 794 struct grant *persistent_gnt; 795 + struct llist_node *n; 795 796 796 797 /* Prevent new requests being issued until we fix things up. */ 797 798 spin_lock_irq(&info->io_lock); ··· 805 804 /* Remove all persistent grants */ 806 805 if (info->persistent_gnts_c) { 807 806 all_gnts = llist_del_all(&info->persistent_gnts); 808 - llist_for_each_entry(persistent_gnt, all_gnts, node) { 807 + llist_for_each_entry_safe(persistent_gnt, n, all_gnts, node) { 809 808 gnttab_end_foreign_access(persistent_gnt->gref, 0, 0UL); 810 809 __free_page(pfn_to_page(persistent_gnt->pfn)); 811 810 kfree(persistent_gnt); ··· 836 835 static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info, 837 836 struct blkif_response *bret) 838 837 { 839 - int i; 838 + int i = 0; 840 839 struct bio_vec *bvec; 841 840 struct req_iterator iter; 842 841 unsigned long flags; ··· 853 852 */ 854 853 rq_for_each_segment(bvec, s->request, iter) { 855 854 BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE); 856 - i = offset >> PAGE_SHIFT; 855 + if (bvec->bv_offset < offset) 856 + i++; 857 857 BUG_ON(i >= s->req.u.rw.nr_segments); 858 858 shared_data = kmap_atomic( 859 859 pfn_to_page(s->grants_used[i]->pfn)); ··· 863 861 bvec->bv_len); 864 862 bvec_kunmap_irq(bvec_data, &flags); 865 863 kunmap_atomic(shared_data); 866 - offset += bvec->bv_len; 864 + offset = bvec->bv_offset + bvec->bv_len; 867 865 } 868 866 } 869 867 /* Add the persistent grant into the list of free grants */
+2 -1
drivers/char/virtio_console.c
··· 2062 2062 /* Disable interrupts for vqs */ 2063 2063 vdev->config->reset(vdev); 2064 2064 /* Finish up work that's lined up */ 2065 - cancel_work_sync(&portdev->control_work); 2065 + if (use_multiport(portdev)) 2066 + cancel_work_sync(&portdev->control_work); 2066 2067 2067 2068 list_for_each_entry_safe(port, port2, &portdev->ports, list) 2068 2069 unplug_port(port);
+3 -3
drivers/edac/edac_mc.c
··· 340 340 /* 341 341 * Alocate and fill the csrow/channels structs 342 342 */ 343 - mci->csrows = kcalloc(sizeof(*mci->csrows), tot_csrows, GFP_KERNEL); 343 + mci->csrows = kcalloc(tot_csrows, sizeof(*mci->csrows), GFP_KERNEL); 344 344 if (!mci->csrows) 345 345 goto error; 346 346 for (row = 0; row < tot_csrows; row++) { ··· 351 351 csr->csrow_idx = row; 352 352 csr->mci = mci; 353 353 csr->nr_channels = tot_channels; 354 - csr->channels = kcalloc(sizeof(*csr->channels), tot_channels, 354 + csr->channels = kcalloc(tot_channels, sizeof(*csr->channels), 355 355 GFP_KERNEL); 356 356 if (!csr->channels) 357 357 goto error; ··· 369 369 /* 370 370 * Allocate and fill the dimm structs 371 371 */ 372 - mci->dimms = kcalloc(sizeof(*mci->dimms), tot_dimms, GFP_KERNEL); 372 + mci->dimms = kcalloc(tot_dimms, sizeof(*mci->dimms), GFP_KERNEL); 373 373 if (!mci->dimms) 374 374 goto error; 375 375
+1 -1
drivers/edac/edac_pci_sysfs.c
··· 256 256 struct edac_pci_dev_attribute *edac_pci_dev; 257 257 edac_pci_dev = (struct edac_pci_dev_attribute *)attr; 258 258 259 - if (edac_pci_dev->show) 259 + if (edac_pci_dev->store) 260 260 return edac_pci_dev->store(edac_pci_dev->value, buffer, count); 261 261 return -EIO; 262 262 }
+1 -1
drivers/firmware/dmi_scan.c
··· 471 471 char __iomem *p, *q; 472 472 int rc; 473 473 474 - if (efi_enabled) { 474 + if (efi_enabled(EFI_CONFIG_TABLES)) { 475 475 if (efi.smbios == EFI_INVALID_TABLE_ADDR) 476 476 goto error; 477 477
+5 -4
drivers/firmware/efivars.c
··· 674 674 err = -EACCES; 675 675 break; 676 676 case EFI_NOT_FOUND: 677 - err = -ENOENT; 677 + err = -EIO; 678 678 break; 679 679 default: 680 680 err = -EINVAL; ··· 793 793 spin_unlock(&efivars->lock); 794 794 efivar_unregister(var); 795 795 drop_nlink(inode); 796 + d_delete(file->f_dentry); 796 797 dput(file->f_dentry); 797 798 798 799 } else { ··· 995 994 list_del(&var->list); 996 995 spin_unlock(&efivars->lock); 997 996 efivar_unregister(var); 998 - drop_nlink(dir); 997 + drop_nlink(dentry->d_inode); 999 998 dput(dentry); 1000 999 return 0; 1001 1000 } ··· 1783 1782 printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION, 1784 1783 EFIVARS_DATE); 1785 1784 1786 - if (!efi_enabled) 1785 + if (!efi_enabled(EFI_RUNTIME_SERVICES)) 1787 1786 return 0; 1788 1787 1789 1788 /* For now we'll register the efi directory at /sys/firmware/efi */ ··· 1823 1822 static void __exit 1824 1823 efivars_exit(void) 1825 1824 { 1826 - if (efi_enabled) { 1825 + if (efi_enabled(EFI_RUNTIME_SERVICES)) { 1827 1826 unregister_efivars(&__efivars); 1828 1827 kobject_put(efi_kobj); 1829 1828 }
+1 -1
drivers/firmware/iscsi_ibft_find.c
··· 99 99 /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will 100 100 * only use ACPI for this */ 101 101 102 - if (!efi_enabled) 102 + if (!efi_enabled(EFI_BOOT)) 103 103 find_ibft_in_mem(); 104 104 105 105 if (ibft_addr) {
+2 -2
drivers/gpu/drm/exynos/Kconfig
··· 24 24 25 25 config DRM_EXYNOS_FIMD 26 26 bool "Exynos DRM FIMD" 27 - depends on DRM_EXYNOS && !FB_S3C 27 + depends on DRM_EXYNOS && !FB_S3C && !ARCH_MULTIPLATFORM 28 28 help 29 29 Choose this option if you want to use Exynos FIMD for DRM. 30 30 ··· 48 48 49 49 config DRM_EXYNOS_IPP 50 50 bool "Exynos DRM IPP" 51 - depends on DRM_EXYNOS 51 + depends on DRM_EXYNOS && !ARCH_MULTIPLATFORM 52 52 help 53 53 Choose this option if you want to use IPP feature for DRM. 54 54
+15 -18
drivers/gpu/drm/exynos/exynos_drm_connector.c
··· 18 18 #include "exynos_drm_drv.h" 19 19 #include "exynos_drm_encoder.h" 20 20 21 - #define MAX_EDID 256 22 21 #define to_exynos_connector(x) container_of(x, struct exynos_drm_connector,\ 23 22 drm_connector) 24 23 ··· 95 96 to_exynos_connector(connector); 96 97 struct exynos_drm_manager *manager = exynos_connector->manager; 97 98 struct exynos_drm_display_ops *display_ops = manager->display_ops; 98 - unsigned int count; 99 + struct edid *edid = NULL; 100 + unsigned int count = 0; 101 + int ret; 99 102 100 103 DRM_DEBUG_KMS("%s\n", __FILE__); 101 104 ··· 115 114 * because lcd panel has only one mode. 116 115 */ 117 116 if (display_ops->get_edid) { 118 - int ret; 119 - void *edid; 120 - 121 - edid = kzalloc(MAX_EDID, GFP_KERNEL); 122 - if (!edid) { 123 - DRM_ERROR("failed to allocate edid\n"); 124 - return 0; 117 + edid = display_ops->get_edid(manager->dev, connector); 118 + if (IS_ERR_OR_NULL(edid)) { 119 + ret = PTR_ERR(edid); 120 + edid = NULL; 121 + DRM_ERROR("Panel operation get_edid failed %d\n", ret); 122 + goto out; 125 123 } 126 124 127 - ret = display_ops->get_edid(manager->dev, connector, 128 - edid, MAX_EDID); 129 - if (ret < 0) { 130 - DRM_ERROR("failed to get edid data.\n"); 131 - kfree(edid); 132 - edid = NULL; 133 - return 0; 125 + count = drm_add_edid_modes(connector, edid); 126 + if (count < 0) { 127 + DRM_ERROR("Add edid modes failed %d\n", count); 128 + goto out; 134 129 } 135 130 136 131 drm_mode_connector_update_edid_property(connector, edid); 137 - count = drm_add_edid_modes(connector, edid); 138 - kfree(edid); 139 132 } else { 140 133 struct exynos_drm_panel_info *panel; 141 134 struct drm_display_mode *mode = drm_mode_create(connector->dev); ··· 156 161 count = 1; 157 162 } 158 163 164 + out: 165 + kfree(edid); 159 166 return count; 160 167 } 161 168
+11 -13
drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
··· 19 19 struct exynos_drm_dmabuf_attachment { 20 20 struct sg_table sgt; 21 21 enum dma_data_direction dir; 22 + bool is_mapped; 22 23 }; 23 24 24 25 static int exynos_gem_attach_dma_buf(struct dma_buf *dmabuf, ··· 73 72 74 73 DRM_DEBUG_PRIME("%s\n", __FILE__); 75 74 76 - if (WARN_ON(dir == DMA_NONE)) 77 - return ERR_PTR(-EINVAL); 78 - 79 75 /* just return current sgt if already requested. */ 80 - if (exynos_attach->dir == dir) 76 + if (exynos_attach->dir == dir && exynos_attach->is_mapped) 81 77 return &exynos_attach->sgt; 82 - 83 - /* reattaching is not allowed. */ 84 - if (WARN_ON(exynos_attach->dir != DMA_NONE)) 85 - return ERR_PTR(-EBUSY); 86 78 87 79 buf = gem_obj->buffer; 88 80 if (!buf) { ··· 101 107 wr = sg_next(wr); 102 108 } 103 109 104 - nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir); 105 - if (!nents) { 106 - DRM_ERROR("failed to map sgl with iommu.\n"); 107 - sgt = ERR_PTR(-EIO); 108 - goto err_unlock; 110 + if (dir != DMA_NONE) { 111 + nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir); 112 + if (!nents) { 113 + DRM_ERROR("failed to map sgl with iommu.\n"); 114 + sg_free_table(sgt); 115 + sgt = ERR_PTR(-EIO); 116 + goto err_unlock; 117 + } 109 118 } 110 119 120 + exynos_attach->is_mapped = true; 111 121 exynos_attach->dir = dir; 112 122 attach->priv = exynos_attach; 113 123
+2 -2
drivers/gpu/drm/exynos/exynos_drm_drv.h
··· 148 148 struct exynos_drm_display_ops { 149 149 enum exynos_drm_output_type type; 150 150 bool (*is_connected)(struct device *dev); 151 - int (*get_edid)(struct device *dev, struct drm_connector *connector, 152 - u8 *edid, int len); 151 + struct edid *(*get_edid)(struct device *dev, 152 + struct drm_connector *connector); 153 153 void *(*get_panel)(struct device *dev); 154 154 int (*check_timing)(struct device *dev, void *timing); 155 155 int (*power_on)(struct device *dev, int mode);
+1 -1
drivers/gpu/drm/exynos/exynos_drm_g2d.c
··· 324 324 g2d_userptr = NULL; 325 325 } 326 326 327 - dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev, 327 + static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev, 328 328 unsigned long userptr, 329 329 unsigned long size, 330 330 struct drm_file *filp,
+4 -5
drivers/gpu/drm/exynos/exynos_drm_hdmi.c
··· 108 108 return false; 109 109 } 110 110 111 - static int drm_hdmi_get_edid(struct device *dev, 112 - struct drm_connector *connector, u8 *edid, int len) 111 + static struct edid *drm_hdmi_get_edid(struct device *dev, 112 + struct drm_connector *connector) 113 113 { 114 114 struct drm_hdmi_context *ctx = to_context(dev); 115 115 116 116 DRM_DEBUG_KMS("%s\n", __FILE__); 117 117 118 118 if (hdmi_ops && hdmi_ops->get_edid) 119 - return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector, edid, 120 - len); 119 + return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector); 121 120 122 - return 0; 121 + return NULL; 123 122 } 124 123 125 124 static int drm_hdmi_check_timing(struct device *dev, void *timing)
+2 -2
drivers/gpu/drm/exynos/exynos_drm_hdmi.h
··· 30 30 struct exynos_hdmi_ops { 31 31 /* display */ 32 32 bool (*is_connected)(void *ctx); 33 - int (*get_edid)(void *ctx, struct drm_connector *connector, 34 - u8 *edid, int len); 33 + struct edid *(*get_edid)(void *ctx, 34 + struct drm_connector *connector); 35 35 int (*check_timing)(void *ctx, void *timing); 36 36 int (*power_on)(void *ctx, int mode); 37 37
+1 -1
drivers/gpu/drm/exynos/exynos_drm_ipp.c
··· 869 869 } 870 870 } 871 871 872 - void ipp_handle_cmd_work(struct device *dev, 872 + static void ipp_handle_cmd_work(struct device *dev, 873 873 struct exynos_drm_ippdrv *ippdrv, 874 874 struct drm_exynos_ipp_cmd_work *cmd_work, 875 875 struct drm_exynos_ipp_cmd_node *c_node)
+2 -2
drivers/gpu/drm/exynos/exynos_drm_rotator.c
··· 734 734 return 0; 735 735 } 736 736 737 - struct rot_limit_table rot_limit_tbl = { 737 + static struct rot_limit_table rot_limit_tbl = { 738 738 .ycbcr420_2p = { 739 739 .min_w = 32, 740 740 .min_h = 32, ··· 751 751 }, 752 752 }; 753 753 754 - struct platform_device_id rotator_driver_ids[] = { 754 + static struct platform_device_id rotator_driver_ids[] = { 755 755 { 756 756 .name = "exynos-rot", 757 757 .driver_data = (unsigned long)&rot_limit_tbl,
+16 -10
drivers/gpu/drm/exynos/exynos_drm_vidi.c
··· 98 98 return ctx->connected ? true : false; 99 99 } 100 100 101 - static int vidi_get_edid(struct device *dev, struct drm_connector *connector, 102 - u8 *edid, int len) 101 + static struct edid *vidi_get_edid(struct device *dev, 102 + struct drm_connector *connector) 103 103 { 104 104 struct vidi_context *ctx = get_vidi_context(dev); 105 + struct edid *edid; 106 + int edid_len; 105 107 106 108 DRM_DEBUG_KMS("%s\n", __FILE__); 107 109 ··· 113 111 */ 114 112 if (!ctx->raw_edid) { 115 113 DRM_DEBUG_KMS("raw_edid is null.\n"); 116 - return -EFAULT; 114 + return ERR_PTR(-EFAULT); 117 115 } 118 116 119 - memcpy(edid, ctx->raw_edid, min((1 + ctx->raw_edid->extensions) 120 - * EDID_LENGTH, len)); 117 + edid_len = (1 + ctx->raw_edid->extensions) * EDID_LENGTH; 118 + edid = kzalloc(edid_len, GFP_KERNEL); 119 + if (!edid) { 120 + DRM_DEBUG_KMS("failed to allocate edid\n"); 121 + return ERR_PTR(-ENOMEM); 122 + } 121 123 122 - return 0; 124 + memcpy(edid, ctx->raw_edid, edid_len); 125 + return edid; 123 126 } 124 127 125 128 static void *vidi_get_panel(struct device *dev) ··· 521 514 struct exynos_drm_manager *manager; 522 515 struct exynos_drm_display_ops *display_ops; 523 516 struct drm_exynos_vidi_connection *vidi = data; 524 - struct edid *raw_edid; 525 517 int edid_len; 526 518 527 519 DRM_DEBUG_KMS("%s\n", __FILE__); ··· 557 551 } 558 552 559 553 if (vidi->connection) { 560 - if (!vidi->edid) { 561 - DRM_DEBUG_KMS("edid data is null.\n"); 554 + struct edid *raw_edid = (struct edid *)(uint32_t)vidi->edid; 555 + if (!drm_edid_is_valid(raw_edid)) { 556 + DRM_DEBUG_KMS("edid data is invalid.\n"); 562 557 return -EINVAL; 563 558 } 564 - raw_edid = (struct edid *)(uint32_t)vidi->edid; 565 559 edid_len = (1 + raw_edid->extensions) * EDID_LENGTH; 566 560 ctx->raw_edid = kzalloc(edid_len, GFP_KERNEL); 567 561 if (!ctx->raw_edid) {
+38 -83
drivers/gpu/drm/exynos/exynos_hdmi.c
··· 34 34 #include <linux/regulator/consumer.h> 35 35 #include <linux/io.h> 36 36 #include <linux/of_gpio.h> 37 - #include <plat/gpio-cfg.h> 38 37 39 38 #include <drm/exynos_drm.h> 40 39 ··· 97 98 98 99 void __iomem *regs; 99 100 void *parent_ctx; 100 - int external_irq; 101 - int internal_irq; 101 + int irq; 102 102 103 103 struct i2c_client *ddc_port; 104 104 struct i2c_client *hdmiphy_port; ··· 1389 1391 return hdata->hpd; 1390 1392 } 1391 1393 1392 - static int hdmi_get_edid(void *ctx, struct drm_connector *connector, 1393 - u8 *edid, int len) 1394 + static struct edid *hdmi_get_edid(void *ctx, struct drm_connector *connector) 1394 1395 { 1395 1396 struct edid *raw_edid; 1396 1397 struct hdmi_context *hdata = ctx; ··· 1397 1400 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); 1398 1401 1399 1402 if (!hdata->ddc_port) 1400 - return -ENODEV; 1403 + return ERR_PTR(-ENODEV); 1401 1404 1402 1405 raw_edid = drm_get_edid(connector, hdata->ddc_port->adapter); 1403 - if (raw_edid) { 1404 - hdata->dvi_mode = !drm_detect_hdmi_monitor(raw_edid); 1405 - memcpy(edid, raw_edid, min((1 + raw_edid->extensions) 1406 - * EDID_LENGTH, len)); 1407 - DRM_DEBUG_KMS("%s : width[%d] x height[%d]\n", 1408 - (hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"), 1409 - raw_edid->width_cm, raw_edid->height_cm); 1410 - kfree(raw_edid); 1411 - } else { 1412 - return -ENODEV; 1413 - } 1406 + if (!raw_edid) 1407 + return ERR_PTR(-ENODEV); 1414 1408 1415 - return 0; 1409 + hdata->dvi_mode = !drm_detect_hdmi_monitor(raw_edid); 1410 + DRM_DEBUG_KMS("%s : width[%d] x height[%d]\n", 1411 + (hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"), 1412 + raw_edid->width_cm, raw_edid->height_cm); 1413 + 1414 + return raw_edid; 1416 1415 } 1417 1416 1418 1417 static int hdmi_v13_check_timing(struct fb_videomode *check_timing) ··· 1645 1652 1646 1653 /* resetting HDMI core */ 1647 1654 hdmi_reg_writemask(hdata, reg, 0, HDMI_CORE_SW_RSTOUT); 1648 - mdelay(10); 1655 + usleep_range(10000, 12000); 1649 1656 hdmi_reg_writemask(hdata, reg, ~0, HDMI_CORE_SW_RSTOUT); 1650 - mdelay(10); 1657 + usleep_range(10000, 12000); 1651 1658 } 1652 1659 1653 1660 static void hdmi_conf_init(struct hdmi_context *hdata) 1654 1661 { 1655 1662 struct hdmi_infoframe infoframe; 1656 1663 1657 - /* disable HPD interrupts */ 1664 + /* disable HPD interrupts from HDMI IP block, use GPIO instead */ 1658 1665 hdmi_reg_writemask(hdata, HDMI_INTC_CON, 0, HDMI_INTC_EN_GLOBAL | 1659 1666 HDMI_INTC_EN_HPD_PLUG | HDMI_INTC_EN_HPD_UNPLUG); 1660 1667 ··· 1772 1779 u32 val = hdmi_reg_read(hdata, HDMI_V13_PHY_STATUS); 1773 1780 if (val & HDMI_PHY_STATUS_READY) 1774 1781 break; 1775 - mdelay(1); 1782 + usleep_range(1000, 2000); 1776 1783 } 1777 1784 /* steady state not achieved */ 1778 1785 if (tries == 0) { ··· 1939 1946 u32 val = hdmi_reg_read(hdata, HDMI_PHY_STATUS_0); 1940 1947 if (val & HDMI_PHY_STATUS_READY) 1941 1948 break; 1942 - mdelay(1); 1949 + usleep_range(1000, 2000); 1943 1950 } 1944 1951 /* steady state not achieved */ 1945 1952 if (tries == 0) { ··· 1991 1998 1992 1999 /* reset hdmiphy */ 1993 2000 hdmi_reg_writemask(hdata, reg, ~0, HDMI_PHY_SW_RSTOUT); 1994 - mdelay(10); 2001 + usleep_range(10000, 12000); 1995 2002 hdmi_reg_writemask(hdata, reg, 0, HDMI_PHY_SW_RSTOUT); 1996 - mdelay(10); 2003 + usleep_range(10000, 12000); 1997 2004 } 1998 2005 1999 2006 static void hdmiphy_poweron(struct hdmi_context *hdata) ··· 2041 2048 return; 2042 2049 } 2043 2050 2044 - mdelay(10); 2051 + usleep_range(10000, 12000); 2045 2052 2046 2053 /* operation mode */ 2047 2054 operation[0] = 0x1f; ··· 2163 2170 2164 2171 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); 2165 2172 2173 + mutex_lock(&hdata->hdmi_mutex); 2174 + if (!hdata->powered) { 2175 + mutex_unlock(&hdata->hdmi_mutex); 2176 + return; 2177 + } 2178 + mutex_unlock(&hdata->hdmi_mutex); 2179 + 2166 2180 hdmi_conf_apply(hdata); 2167 2181 } 2168 2182 ··· 2265 2265 .dpms = hdmi_dpms, 2266 2266 }; 2267 2267 2268 - static irqreturn_t hdmi_external_irq_thread(int irq, void *arg) 2268 + static irqreturn_t hdmi_irq_thread(int irq, void *arg) 2269 2269 { 2270 2270 struct exynos_drm_hdmi_context *ctx = arg; 2271 2271 struct hdmi_context *hdata = ctx->ctx; ··· 2273 2273 mutex_lock(&hdata->hdmi_mutex); 2274 2274 hdata->hpd = gpio_get_value(hdata->hpd_gpio); 2275 2275 mutex_unlock(&hdata->hdmi_mutex); 2276 - 2277 - if (ctx->drm_dev) 2278 - drm_helper_hpd_irq_event(ctx->drm_dev); 2279 - 2280 - return IRQ_HANDLED; 2281 - } 2282 - 2283 - static irqreturn_t hdmi_internal_irq_thread(int irq, void *arg) 2284 - { 2285 - struct exynos_drm_hdmi_context *ctx = arg; 2286 - struct hdmi_context *hdata = ctx->ctx; 2287 - u32 intc_flag; 2288 - 2289 - intc_flag = hdmi_reg_read(hdata, HDMI_INTC_FLAG); 2290 - /* clearing flags for HPD plug/unplug */ 2291 - if (intc_flag & HDMI_INTC_FLAG_HPD_UNPLUG) { 2292 - DRM_DEBUG_KMS("unplugged\n"); 2293 - hdmi_reg_writemask(hdata, HDMI_INTC_FLAG, ~0, 2294 - HDMI_INTC_FLAG_HPD_UNPLUG); 2295 - } 2296 - if (intc_flag & HDMI_INTC_FLAG_HPD_PLUG) { 2297 - DRM_DEBUG_KMS("plugged\n"); 2298 - hdmi_reg_writemask(hdata, HDMI_INTC_FLAG, ~0, 2299 - HDMI_INTC_FLAG_HPD_PLUG); 2300 - } 2301 2276 2302 2277 if (ctx->drm_dev) 2303 2278 drm_helper_hpd_irq_event(ctx->drm_dev); ··· 2530 2555 2531 2556 hdata->hdmiphy_port = hdmi_hdmiphy; 2532 2557 2533 - hdata->external_irq = gpio_to_irq(hdata->hpd_gpio); 2534 - if (hdata->external_irq < 0) { 2535 - DRM_ERROR("failed to get GPIO external irq\n"); 2536 - ret = hdata->external_irq; 2537 - goto err_hdmiphy; 2538 - } 2539 - 2540 - hdata->internal_irq = platform_get_irq(pdev, 0); 2541 - if (hdata->internal_irq < 0) { 2542 - DRM_ERROR("failed to get platform internal irq\n"); 2543 - ret = hdata->internal_irq; 2558 + hdata->irq = gpio_to_irq(hdata->hpd_gpio); 2559 + if (hdata->irq < 0) { 2560 + DRM_ERROR("failed to get GPIO irq\n"); 2561 + ret = hdata->irq; 2544 2562 goto err_hdmiphy; 2545 2563 } 2546 2564 2547 2565 hdata->hpd = gpio_get_value(hdata->hpd_gpio); 2548 2566 2549 - ret = request_threaded_irq(hdata->external_irq, NULL, 2550 - hdmi_external_irq_thread, IRQF_TRIGGER_RISING | 2567 + ret = request_threaded_irq(hdata->irq, NULL, 2568 + hdmi_irq_thread, IRQF_TRIGGER_RISING | 2551 2569 IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 2552 - "hdmi_external", drm_hdmi_ctx); 2570 + "hdmi", drm_hdmi_ctx); 2553 2571 if (ret) { 2554 - DRM_ERROR("failed to register hdmi external interrupt\n"); 2572 + DRM_ERROR("failed to register hdmi interrupt\n"); 2555 2573 goto err_hdmiphy; 2556 - } 2557 - 2558 - ret = request_threaded_irq(hdata->internal_irq, NULL, 2559 - hdmi_internal_irq_thread, IRQF_ONESHOT, 2560 - "hdmi_internal", drm_hdmi_ctx); 2561 - if (ret) { 2562 - DRM_ERROR("failed to register hdmi internal interrupt\n"); 2563 - goto err_free_irq; 2564 2574 } 2565 2575 2566 2576 /* Attach HDMI Driver to common hdmi. */ ··· 2558 2598 2559 2599 return 0; 2560 2600 2561 - err_free_irq: 2562 - free_irq(hdata->external_irq, drm_hdmi_ctx); 2563 2601 err_hdmiphy: 2564 2602 i2c_del_driver(&hdmiphy_driver); 2565 2603 err_ddc: ··· 2575 2617 2576 2618 pm_runtime_disable(dev); 2577 2619 2578 - free_irq(hdata->internal_irq, hdata); 2579 - free_irq(hdata->external_irq, hdata); 2620 + free_irq(hdata->irq, hdata); 2580 2621 2581 2622 2582 2623 /* hdmiphy i2c driver */ ··· 2594 2637 2595 2638 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); 2596 2639 2597 - disable_irq(hdata->internal_irq); 2598 - disable_irq(hdata->external_irq); 2640 + disable_irq(hdata->irq); 2599 2641 2600 2642 hdata->hpd = false; 2601 2643 if (ctx->drm_dev) ··· 2619 2663 2620 2664 hdata->hpd = gpio_get_value(hdata->hpd_gpio); 2621 2665 2622 - enable_irq(hdata->external_irq); 2623 - enable_irq(hdata->internal_irq); 2666 + enable_irq(hdata->irq); 2624 2667 2625 2668 if (!pm_runtime_suspended(dev)) { 2626 2669 DRM_DEBUG_KMS("%s : Already resumed\n", __func__);
+8 -1
drivers/gpu/drm/exynos/exynos_mixer.c
··· 600 600 /* waiting until VP_SRESET_PROCESSING is 0 */ 601 601 if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING) 602 602 break; 603 - mdelay(10); 603 + usleep_range(10000, 12000); 604 604 } 605 605 WARN(tries == 0, "failed to reset Video Processor\n"); 606 606 } ··· 775 775 struct mixer_context *mixer_ctx = ctx; 776 776 777 777 DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win); 778 + 779 + mutex_lock(&mixer_ctx->mixer_mutex); 780 + if (!mixer_ctx->powered) { 781 + mutex_unlock(&mixer_ctx->mixer_mutex); 782 + return; 783 + } 784 + mutex_unlock(&mixer_ctx->mixer_mutex); 778 785 779 786 if (win > 1 && mixer_ctx->vp_enabled) 780 787 vp_video_buffer(mixer_ctx, win);
+2
drivers/gpu/drm/i915/i915_debugfs.c
··· 30 30 #include <linux/debugfs.h> 31 31 #include <linux/slab.h> 32 32 #include <linux/export.h> 33 + #include <generated/utsrelease.h> 33 34 #include <drm/drmP.h> 34 35 #include "intel_drv.h" 35 36 #include "intel_ringbuffer.h" ··· 691 690 692 691 seq_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec, 693 692 error->time.tv_usec); 693 + seq_printf(m, "Kernel: " UTS_RELEASE); 694 694 seq_printf(m, "PCI ID: 0x%04x\n", dev->pci_device); 695 695 seq_printf(m, "EIR: 0x%08x\n", error->eir); 696 696 seq_printf(m, "IER: 0x%08x\n", error->ier);
+1
drivers/gpu/drm/i915/i915_reg.h
··· 533 533 #define MI_MODE 0x0209c 534 534 # define VS_TIMER_DISPATCH (1 << 6) 535 535 # define MI_FLUSH_ENABLE (1 << 12) 536 + # define ASYNC_FLIP_PERF_DISABLE (1 << 14) 536 537 537 538 #define GEN6_GT_MODE 0x20d0 538 539 #define GEN6_GT_MODE_HI (1 << 9)
+18 -6
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 505 505 struct drm_i915_private *dev_priv = dev->dev_private; 506 506 int ret = init_ring_common(ring); 507 507 508 - if (INTEL_INFO(dev)->gen > 3) { 508 + if (INTEL_INFO(dev)->gen > 3) 509 509 I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(VS_TIMER_DISPATCH)); 510 - if (IS_GEN7(dev)) 511 - I915_WRITE(GFX_MODE_GEN7, 512 - _MASKED_BIT_DISABLE(GFX_TLB_INVALIDATE_ALWAYS) | 513 - _MASKED_BIT_ENABLE(GFX_REPLAY_MODE)); 514 - } 510 + 511 + /* We need to disable the AsyncFlip performance optimisations in order 512 + * to use MI_WAIT_FOR_EVENT within the CS. It should already be 513 + * programmed to '1' on all products. 514 + */ 515 + if (INTEL_INFO(dev)->gen >= 6) 516 + I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(ASYNC_FLIP_PERF_DISABLE)); 517 + 518 + /* Required for the hardware to program scanline values for waiting */ 519 + if (INTEL_INFO(dev)->gen == 6) 520 + I915_WRITE(GFX_MODE, 521 + _MASKED_BIT_ENABLE(GFX_TLB_INVALIDATE_ALWAYS)); 522 + 523 + if (IS_GEN7(dev)) 524 + I915_WRITE(GFX_MODE_GEN7, 525 + _MASKED_BIT_DISABLE(GFX_TLB_INVALIDATE_ALWAYS) | 526 + _MASKED_BIT_ENABLE(GFX_REPLAY_MODE)); 515 527 516 528 if (INTEL_INFO(dev)->gen >= 5) { 517 529 ret = init_pipe_control(ring);
+24 -3
drivers/gpu/drm/radeon/evergreen.c
··· 1313 1313 if (!(tmp & EVERGREEN_CRTC_BLANK_DATA_EN)) { 1314 1314 radeon_wait_for_vblank(rdev, i); 1315 1315 tmp |= EVERGREEN_CRTC_BLANK_DATA_EN; 1316 + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1); 1316 1317 WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp); 1318 + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0); 1317 1319 } 1318 1320 } else { 1319 1321 tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]); 1320 1322 if (!(tmp & EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE)) { 1321 1323 radeon_wait_for_vblank(rdev, i); 1322 1324 tmp |= EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE; 1325 + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1); 1323 1326 WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp); 1327 + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0); 1324 1328 } 1325 1329 } 1326 1330 /* wait for the next frame */ ··· 1349 1345 blackout &= ~BLACKOUT_MODE_MASK; 1350 1346 WREG32(MC_SHARED_BLACKOUT_CNTL, blackout | 1); 1351 1347 } 1348 + /* wait for the MC to settle */ 1349 + udelay(100); 1352 1350 } 1353 1351 1354 1352 void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save) ··· 1384 1378 if (ASIC_IS_DCE6(rdev)) { 1385 1379 tmp = RREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i]); 1386 1380 tmp |= EVERGREEN_CRTC_BLANK_DATA_EN; 1381 + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1); 1387 1382 WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp); 1383 + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0); 1388 1384 } else { 1389 1385 tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]); 1390 1386 tmp &= ~EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE; 1387 + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1); 1391 1388 WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp); 1389 + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0); 1392 1390 } 1393 1391 /* wait for the next frame */ 1394 1392 frame_count = radeon_get_vblank_counter(rdev, i); ··· 2046 2036 WREG32(HDP_ADDR_CONFIG, gb_addr_config); 2047 2037 WREG32(DMA_TILING_CONFIG, gb_addr_config); 2048 2038 2049 - tmp = gb_addr_config & NUM_PIPES_MASK; 2050 - tmp = r6xx_remap_render_backend(rdev, tmp, rdev->config.evergreen.max_backends, 2051 - EVERGREEN_MAX_BACKENDS, disabled_rb_mask); 2039 + if ((rdev->config.evergreen.max_backends == 1) && 2040 + (rdev->flags & RADEON_IS_IGP)) { 2041 + if ((disabled_rb_mask & 3) == 1) { 2042 + /* RB0 disabled, RB1 enabled */ 2043 + tmp = 0x11111111; 2044 + } else { 2045 + /* RB1 disabled, RB0 enabled */ 2046 + tmp = 0x00000000; 2047 + } 2048 + } else { 2049 + tmp = gb_addr_config & NUM_PIPES_MASK; 2050 + tmp = r6xx_remap_render_backend(rdev, tmp, rdev->config.evergreen.max_backends, 2051 + EVERGREEN_MAX_BACKENDS, disabled_rb_mask); 2052 + } 2052 2053 WREG32(GB_BACKEND_MAP, tmp); 2053 2054 2054 2055 WREG32(CGTS_SYS_TCC_DISABLE, 0);
+6 -2
drivers/gpu/drm/radeon/ni.c
··· 1216 1216 int cayman_dma_resume(struct radeon_device *rdev) 1217 1217 { 1218 1218 struct radeon_ring *ring; 1219 - u32 rb_cntl, dma_cntl; 1219 + u32 rb_cntl, dma_cntl, ib_cntl; 1220 1220 u32 rb_bufsz; 1221 1221 u32 reg_offset, wb_offset; 1222 1222 int i, r; ··· 1265 1265 WREG32(DMA_RB_BASE + reg_offset, ring->gpu_addr >> 8); 1266 1266 1267 1267 /* enable DMA IBs */ 1268 - WREG32(DMA_IB_CNTL + reg_offset, DMA_IB_ENABLE | CMD_VMID_FORCE); 1268 + ib_cntl = DMA_IB_ENABLE | CMD_VMID_FORCE; 1269 + #ifdef __BIG_ENDIAN 1270 + ib_cntl |= DMA_IB_SWAP_ENABLE; 1271 + #endif 1272 + WREG32(DMA_IB_CNTL + reg_offset, ib_cntl); 1269 1273 1270 1274 dma_cntl = RREG32(DMA_CNTL + reg_offset); 1271 1275 dma_cntl &= ~CTXEMPTY_INT_ENABLE;
+11 -4
drivers/gpu/drm/radeon/r600.c
··· 1462 1462 u32 disabled_rb_mask) 1463 1463 { 1464 1464 u32 rendering_pipe_num, rb_num_width, req_rb_num; 1465 - u32 pipe_rb_ratio, pipe_rb_remain; 1465 + u32 pipe_rb_ratio, pipe_rb_remain, tmp; 1466 1466 u32 data = 0, mask = 1 << (max_rb_num - 1); 1467 1467 unsigned i, j; 1468 1468 1469 1469 /* mask out the RBs that don't exist on that asic */ 1470 - disabled_rb_mask |= (0xff << max_rb_num) & 0xff; 1470 + tmp = disabled_rb_mask | ((0xff << max_rb_num) & 0xff); 1471 + /* make sure at least one RB is available */ 1472 + if ((tmp & 0xff) != 0xff) 1473 + disabled_rb_mask = tmp; 1471 1474 1472 1475 rendering_pipe_num = 1 << tiling_pipe_num; 1473 1476 req_rb_num = total_max_rb_num - r600_count_pipe_bits(disabled_rb_mask); ··· 2316 2313 int r600_dma_resume(struct radeon_device *rdev) 2317 2314 { 2318 2315 struct radeon_ring *ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX]; 2319 - u32 rb_cntl, dma_cntl; 2316 + u32 rb_cntl, dma_cntl, ib_cntl; 2320 2317 u32 rb_bufsz; 2321 2318 int r; 2322 2319 ··· 2356 2353 WREG32(DMA_RB_BASE, ring->gpu_addr >> 8); 2357 2354 2358 2355 /* enable DMA IBs */ 2359 - WREG32(DMA_IB_CNTL, DMA_IB_ENABLE); 2356 + ib_cntl = DMA_IB_ENABLE; 2357 + #ifdef __BIG_ENDIAN 2358 + ib_cntl |= DMA_IB_SWAP_ENABLE; 2359 + #endif 2360 + WREG32(DMA_IB_CNTL, ib_cntl); 2360 2361 2361 2362 dma_cntl = RREG32(DMA_CNTL); 2362 2363 dma_cntl &= ~CTXEMPTY_INT_ENABLE;
+3 -3
drivers/gpu/drm/radeon/radeon_asic.c
··· 1445 1445 .vm = { 1446 1446 .init = &cayman_vm_init, 1447 1447 .fini = &cayman_vm_fini, 1448 - .pt_ring_index = R600_RING_TYPE_DMA_INDEX, 1448 + .pt_ring_index = RADEON_RING_TYPE_GFX_INDEX, 1449 1449 .set_page = &cayman_vm_set_page, 1450 1450 }, 1451 1451 .ring = { ··· 1572 1572 .vm = { 1573 1573 .init = &cayman_vm_init, 1574 1574 .fini = &cayman_vm_fini, 1575 - .pt_ring_index = R600_RING_TYPE_DMA_INDEX, 1575 + .pt_ring_index = RADEON_RING_TYPE_GFX_INDEX, 1576 1576 .set_page = &cayman_vm_set_page, 1577 1577 }, 1578 1578 .ring = { ··· 1699 1699 .vm = { 1700 1700 .init = &si_vm_init, 1701 1701 .fini = &si_vm_fini, 1702 - .pt_ring_index = R600_RING_TYPE_DMA_INDEX, 1702 + .pt_ring_index = RADEON_RING_TYPE_GFX_INDEX, 1703 1703 .set_page = &si_vm_set_page, 1704 1704 }, 1705 1705 .ring = {
+8
drivers/gpu/drm/radeon/radeon_combios.c
··· 2470 2470 1), 2471 2471 ATOM_DEVICE_CRT1_SUPPORT); 2472 2472 } 2473 + /* RV100 board with external TDMS bit mis-set. 2474 + * Actually uses internal TMDS, clear the bit. 2475 + */ 2476 + if (dev->pdev->device == 0x5159 && 2477 + dev->pdev->subsystem_vendor == 0x1014 && 2478 + dev->pdev->subsystem_device == 0x029A) { 2479 + tmp &= ~(1 << 4); 2480 + } 2473 2481 if ((tmp >> 4) & 0x1) { 2474 2482 devices |= ATOM_DEVICE_DFP2_SUPPORT; 2475 2483 radeon_add_legacy_encoder(dev,
+2
drivers/gpu/drm/radeon/radeon_cs.c
··· 286 286 p->chunks[p->chunk_ib_idx].kpage[1] == NULL) { 287 287 kfree(p->chunks[p->chunk_ib_idx].kpage[0]); 288 288 kfree(p->chunks[p->chunk_ib_idx].kpage[1]); 289 + p->chunks[p->chunk_ib_idx].kpage[0] = NULL; 290 + p->chunks[p->chunk_ib_idx].kpage[1] = NULL; 289 291 return -ENOMEM; 290 292 } 291 293 }
+2 -1
drivers/gpu/drm/radeon/radeon_cursor.c
··· 241 241 y = 0; 242 242 } 243 243 244 - if (ASIC_IS_AVIVO(rdev)) { 244 + /* fixed on DCE6 and newer */ 245 + if (ASIC_IS_AVIVO(rdev) && !ASIC_IS_DCE6(rdev)) { 245 246 int i = 0; 246 247 struct drm_crtc *crtc_p; 247 248
+2 -1
drivers/gpu/drm/radeon/radeon_device.c
··· 429 429 { 430 430 uint32_t reg; 431 431 432 - if (efi_enabled && rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) 432 + if (efi_enabled(EFI_BOOT) && 433 + rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) 433 434 return false; 434 435 435 436 /* first check CRTCs */
+4 -2
drivers/gpu/drm/radeon/radeon_display.c
··· 1115 1115 } 1116 1116 1117 1117 radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL); 1118 - if (radeon_fb == NULL) 1118 + if (radeon_fb == NULL) { 1119 + drm_gem_object_unreference_unlocked(obj); 1119 1120 return ERR_PTR(-ENOMEM); 1121 + } 1120 1122 1121 1123 ret = radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj); 1122 1124 if (ret) { 1123 1125 kfree(radeon_fb); 1124 1126 drm_gem_object_unreference_unlocked(obj); 1125 - return NULL; 1127 + return ERR_PTR(ret); 1126 1128 } 1127 1129 1128 1130 return &radeon_fb->base;
+3
drivers/gpu/drm/radeon/radeon_ring.c
··· 377 377 { 378 378 int r; 379 379 380 + /* make sure we aren't trying to allocate more space than there is on the ring */ 381 + if (ndw > (ring->ring_size / 4)) 382 + return -ENOMEM; 380 383 /* Align requested size with padding so unlock_commit can 381 384 * pad safely */ 382 385 ndw = (ndw + ring->align_mask) & ~ring->align_mask;
+1
drivers/gpu/drm/radeon/reg_srcs/cayman
··· 1 1 cayman 0x9400 2 2 0x0000802C GRBM_GFX_INDEX 3 + 0x00008040 WAIT_UNTIL 3 4 0x000084FC CP_STRMOUT_CNTL 4 5 0x000085F0 CP_COHER_CNTL 5 6 0x000085F4 CP_COHER_SIZE
+2
drivers/gpu/drm/radeon/rv515.c
··· 336 336 WREG32(R600_CITF_CNTL, blackout); 337 337 } 338 338 } 339 + /* wait for the MC to settle */ 340 + udelay(100); 339 341 } 340 342 341 343 void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save)
+8 -5
drivers/gpu/drm/ttm/ttm_bo_util.c
··· 429 429 struct ttm_bo_device *bdev = bo->bdev; 430 430 struct ttm_bo_driver *driver = bdev->driver; 431 431 432 - fbo = kzalloc(sizeof(*fbo), GFP_KERNEL); 432 + fbo = kmalloc(sizeof(*fbo), GFP_KERNEL); 433 433 if (!fbo) 434 434 return -ENOMEM; 435 435 ··· 448 448 fbo->vm_node = NULL; 449 449 atomic_set(&fbo->cpu_writers, 0); 450 450 451 - fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj); 451 + spin_lock(&bdev->fence_lock); 452 + if (bo->sync_obj) 453 + fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj); 454 + else 455 + fbo->sync_obj = NULL; 456 + spin_unlock(&bdev->fence_lock); 452 457 kref_init(&fbo->list_kref); 453 458 kref_init(&fbo->kref); 454 459 fbo->destroy = &ttm_transfered_destroy; ··· 666 661 */ 667 662 668 663 set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); 669 - 670 - /* ttm_buffer_object_transfer accesses bo->sync_obj */ 671 - ret = ttm_buffer_object_transfer(bo, &ghost_obj); 672 664 spin_unlock(&bdev->fence_lock); 673 665 if (tmp_obj) 674 666 driver->sync_obj_unref(&tmp_obj); 675 667 668 + ret = ttm_buffer_object_transfer(bo, &ghost_obj); 676 669 if (ret) 677 670 return ret; 678 671
+3
drivers/hid/hid-ids.h
··· 306 306 #define USB_VENDOR_ID_EZKEY 0x0518 307 307 #define USB_DEVICE_ID_BTC_8193 0x0002 308 308 309 + #define USB_VENDOR_ID_FORMOSA 0x147a 310 + #define USB_DEVICE_ID_FORMOSA_IR_RECEIVER 0xe03e 311 + 309 312 #define USB_VENDOR_ID_FREESCALE 0x15A2 310 313 #define USB_DEVICE_ID_FREESCALE_MX28 0x004F 311 314
+12 -1
drivers/hid/i2c-hid/i2c-hid.c
··· 540 540 { 541 541 struct i2c_client *client = hid->driver_data; 542 542 int report_id = buf[0]; 543 + int ret; 543 544 544 545 if (report_type == HID_INPUT_REPORT) 545 546 return -EINVAL; 546 547 547 - return i2c_hid_set_report(client, 548 + if (report_id) { 549 + buf++; 550 + count--; 551 + } 552 + 553 + ret = i2c_hid_set_report(client, 548 554 report_type == HID_FEATURE_REPORT ? 0x03 : 0x02, 549 555 report_id, buf, count); 556 + 557 + if (report_id && ret >= 0) 558 + ret++; /* add report_id to the number of transfered bytes */ 559 + 560 + return ret; 550 561 } 551 562 552 563 static int i2c_hid_parse(struct hid_device *hid)
+1
drivers/hid/usbhid/hid-quirks.c
··· 70 70 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, 71 71 { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, 72 72 { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, 73 + { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS }, 73 74 { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, 74 75 { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, 75 76 { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS },
+3 -8
drivers/infiniband/hw/qib/qib_qp.c
··· 263 263 struct qib_qp __rcu **qpp; 264 264 265 265 qpp = &dev->qp_table[n]; 266 - q = rcu_dereference_protected(*qpp, 267 - lockdep_is_held(&dev->qpt_lock)); 268 - for (; q; qpp = &q->next) { 266 + for (; (q = rcu_dereference_protected(*qpp, 267 + lockdep_is_held(&dev->qpt_lock))) != NULL; 268 + qpp = &q->next) 269 269 if (q == qp) { 270 270 atomic_dec(&qp->refcount); 271 271 *qpp = qp->next; 272 272 rcu_assign_pointer(qp->next, NULL); 273 - q = rcu_dereference_protected(*qpp, 274 - lockdep_is_held(&dev->qpt_lock)); 275 273 break; 276 274 } 277 - q = rcu_dereference_protected(*qpp, 278 - lockdep_is_held(&dev->qpt_lock)); 279 - } 280 275 } 281 276 282 277 spin_unlock_irqrestore(&dev->qpt_lock, flags);
+3 -3
drivers/infiniband/ulp/ipoib/ipoib_cm.c
··· 741 741 742 742 tx_req->mapping = addr; 743 743 744 + skb_orphan(skb); 745 + skb_dst_drop(skb); 746 + 744 747 rc = post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1), 745 748 addr, skb->len); 746 749 if (unlikely(rc)) { ··· 754 751 } else { 755 752 dev->trans_start = jiffies; 756 753 ++tx->tx_head; 757 - 758 - skb_orphan(skb); 759 - skb_dst_drop(skb); 760 754 761 755 if (++priv->tx_outstanding == ipoib_sendq_size) { 762 756 ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n",
+3 -3
drivers/infiniband/ulp/ipoib/ipoib_ib.c
··· 600 600 netif_stop_queue(dev); 601 601 } 602 602 603 + skb_orphan(skb); 604 + skb_dst_drop(skb); 605 + 603 606 rc = post_send(priv, priv->tx_head & (ipoib_sendq_size - 1), 604 607 address->ah, qpn, tx_req, phead, hlen); 605 608 if (unlikely(rc)) { ··· 618 615 619 616 address->last_send = priv->tx_head; 620 617 ++priv->tx_head; 621 - 622 - skb_orphan(skb); 623 - skb_dst_drop(skb); 624 618 } 625 619 626 620 if (unlikely(priv->tx_outstanding > MAX_SEND_CQE))
+15 -6
drivers/iommu/intel-iommu.c
··· 4234 4234 .pgsize_bitmap = INTEL_IOMMU_PGSIZES, 4235 4235 }; 4236 4236 4237 + static void quirk_iommu_g4x_gfx(struct pci_dev *dev) 4238 + { 4239 + /* G4x/GM45 integrated gfx dmar support is totally busted. */ 4240 + printk(KERN_INFO "DMAR: Disabling IOMMU for graphics on this chipset\n"); 4241 + dmar_map_gfx = 0; 4242 + } 4243 + 4244 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_g4x_gfx); 4245 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e00, quirk_iommu_g4x_gfx); 4246 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e10, quirk_iommu_g4x_gfx); 4247 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e20, quirk_iommu_g4x_gfx); 4248 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e30, quirk_iommu_g4x_gfx); 4249 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e40, quirk_iommu_g4x_gfx); 4250 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e90, quirk_iommu_g4x_gfx); 4251 + 4237 4252 static void quirk_iommu_rwbf(struct pci_dev *dev) 4238 4253 { 4239 4254 /* ··· 4257 4242 */ 4258 4243 printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n"); 4259 4244 rwbf_quirk = 1; 4260 - 4261 - /* https://bugzilla.redhat.com/show_bug.cgi?id=538163 */ 4262 - if (dev->revision == 0x07) { 4263 - printk(KERN_INFO "DMAR: Disabling IOMMU for graphics on this chipset\n"); 4264 - dmar_map_gfx = 0; 4265 - } 4266 4245 } 4267 4246 4268 4247 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);
+1 -12
drivers/md/dm-thin.c
··· 2746 2746 return 0; 2747 2747 } 2748 2748 2749 - /* 2750 - * A thin device always inherits its queue limits from its pool. 2751 - */ 2752 - static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits) 2753 - { 2754 - struct thin_c *tc = ti->private; 2755 - 2756 - *limits = bdev_get_queue(tc->pool_dev->bdev)->limits; 2757 - } 2758 - 2759 2749 static struct target_type thin_target = { 2760 2750 .name = "thin", 2761 - .version = {1, 6, 0}, 2751 + .version = {1, 7, 0}, 2762 2752 .module = THIS_MODULE, 2763 2753 .ctr = thin_ctr, 2764 2754 .dtr = thin_dtr, ··· 2757 2767 .postsuspend = thin_postsuspend, 2758 2768 .status = thin_status, 2759 2769 .iterate_devices = thin_iterate_devices, 2760 - .io_hints = thin_io_hints, 2761 2770 }; 2762 2771 2763 2772 /*----------------------------------------------------------------*/
+4 -2
drivers/md/dm.c
··· 1188 1188 { 1189 1189 struct dm_target *ti; 1190 1190 sector_t len; 1191 + unsigned num_requests; 1191 1192 1192 1193 do { 1193 1194 ti = dm_table_find_target(ci->map, ci->sector); ··· 1201 1200 * reconfiguration might also have changed that since the 1202 1201 * check was performed. 1203 1202 */ 1204 - if (!get_num_requests || !get_num_requests(ti)) 1203 + num_requests = get_num_requests ? get_num_requests(ti) : 0; 1204 + if (!num_requests) 1205 1205 return -EOPNOTSUPP; 1206 1206 1207 1207 if (is_split_required && !is_split_required(ti)) ··· 1210 1208 else 1211 1209 len = min(ci->sector_count, max_io_len(ci->sector, ti)); 1212 1210 1213 - __issue_target_requests(ci, ti, ti->num_discard_requests, len); 1211 + __issue_target_requests(ci, ti, num_requests, len); 1214 1212 1215 1213 ci->sector += len; 1216 1214 } while (ci->sector_count -= len);
+1
drivers/media/radio/radio-keene.c
··· 374 374 radio->vdev.ioctl_ops = &usb_keene_ioctl_ops; 375 375 radio->vdev.lock = &radio->lock; 376 376 radio->vdev.release = video_device_release_empty; 377 + radio->vdev.vfl_dir = VFL_DIR_TX; 377 378 378 379 radio->usbdev = interface_to_usbdev(intf); 379 380 radio->intf = intf;
+1
drivers/media/radio/radio-si4713.c
··· 250 250 .name = "radio-si4713", 251 251 .release = video_device_release, 252 252 .ioctl_ops = &radio_si4713_ioctl_ops, 253 + .vfl_dir = VFL_DIR_TX, 253 254 }; 254 255 255 256 /* Platform driver interface */
+1
drivers/media/radio/radio-wl1273.c
··· 1971 1971 .ioctl_ops = &wl1273_ioctl_ops, 1972 1972 .name = WL1273_FM_DRIVER_NAME, 1973 1973 .release = wl1273_vdev_release, 1974 + .vfl_dir = VFL_DIR_TX, 1974 1975 }; 1975 1976 1976 1977 static int wl1273_fm_radio_remove(struct platform_device *pdev)
+10
drivers/media/radio/wl128x/fmdrv_v4l2.c
··· 518 518 .ioctl_ops = &fm_drv_ioctl_ops, 519 519 .name = FM_DRV_NAME, 520 520 .release = video_device_release, 521 + /* 522 + * To ensure both the tuner and modulator ioctls are accessible we 523 + * set the vfl_dir to M2M to indicate this. 524 + * 525 + * It is not really a mem2mem device of course, but it can both receive 526 + * and transmit using the same radio device. It's the only radio driver 527 + * that does this and it should really be split in two radio devices, 528 + * but that would affect applications using this driver. 529 + */ 530 + .vfl_dir = VFL_DIR_M2M, 521 531 }; 522 532 523 533 int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
+1
drivers/mtd/devices/Kconfig
··· 272 272 tristate "M-Systems Disk-On-Chip G3" 273 273 select BCH 274 274 select BCH_CONST_PARAMS 275 + select BITREVERSE 275 276 ---help--- 276 277 This provides an MTD device driver for the M-Systems DiskOnChip 277 278 G3 devices.
+1 -1
drivers/mtd/maps/physmap_of.c
··· 170 170 resource_size_t res_size; 171 171 struct mtd_part_parser_data ppdata; 172 172 bool map_indirect; 173 - const char *mtd_name; 173 + const char *mtd_name = NULL; 174 174 175 175 match = of_match_device(of_flash_match, &dev->dev); 176 176 if (!match)
+2 -2
drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c
··· 17 17 #include "bcm47xxnflash.h" 18 18 19 19 /* Broadcom uses 1'000'000 but it seems to be too many. Tests on WNDR4500 has 20 - * shown 164 retries as maxiumum. */ 21 - #define NFLASH_READY_RETRIES 1000 20 + * shown ~1000 retries as maxiumum. */ 21 + #define NFLASH_READY_RETRIES 10000 22 22 23 23 #define NFLASH_SECTOR_SIZE 512 24 24
+1 -1
drivers/mtd/nand/davinci_nand.c
··· 523 523 static const struct of_device_id davinci_nand_of_match[] = { 524 524 {.compatible = "ti,davinci-nand", }, 525 525 {}, 526 - } 526 + }; 527 527 MODULE_DEVICE_TABLE(of, davinci_nand_of_match); 528 528 529 529 static struct davinci_nand_pdata
+5 -2
drivers/mtd/nand/nand_base.c
··· 2857 2857 int i; 2858 2858 int val; 2859 2859 2860 - /* ONFI need to be probed in 8 bits mode */ 2861 - WARN_ON(chip->options & NAND_BUSWIDTH_16); 2860 + /* ONFI need to be probed in 8 bits mode, and 16 bits should be selected with NAND_BUSWIDTH_AUTO */ 2861 + if (chip->options & NAND_BUSWIDTH_16) { 2862 + pr_err("Trying ONFI probe in 16 bits mode, aborting !\n"); 2863 + return 0; 2864 + } 2862 2865 /* Try ONFI for unknown chip or LP */ 2863 2866 chip->cmdfunc(mtd, NAND_CMD_READID, 0x20, -1); 2864 2867 if (chip->read_byte(mtd) != 'O' || chip->read_byte(mtd) != 'N' ||
+1 -1
drivers/net/ethernet/mellanox/mlx4/main.c
··· 380 380 } 381 381 } 382 382 383 - if ((dev_cap->flags & 383 + if ((dev->caps.flags & 384 384 (MLX4_DEV_CAP_FLAG_64B_CQE | MLX4_DEV_CAP_FLAG_64B_EQE)) && 385 385 mlx4_is_master(dev)) 386 386 dev->caps.function_caps |= MLX4_FUNC_CAP_64B_EQE_CQE;
+3
drivers/net/usb/cdc_ncm.c
··· 1215 1215 { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46), 1216 1216 .driver_info = (unsigned long)&wwan_info, 1217 1217 }, 1218 + { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), 1219 + .driver_info = (unsigned long)&wwan_info, 1220 + }, 1218 1221 1219 1222 /* Infineon(now Intel) HSPA Modem platform */ 1220 1223 { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443,
+12
drivers/net/usb/qmi_wwan.c
··· 351 351 USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 57), 352 352 .driver_info = (unsigned long)&qmi_wwan_info, 353 353 }, 354 + { /* HUAWEI_INTERFACE_NDIS_CONTROL_QUALCOMM */ 355 + USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x69), 356 + .driver_info = (unsigned long)&qmi_wwan_info, 357 + }, 354 358 355 359 /* 2. Combined interface devices matching on class+protocol */ 356 360 { /* Huawei E367 and possibly others in "Windows mode" */ ··· 363 359 }, 364 360 { /* Huawei E392, E398 and possibly others in "Windows mode" */ 365 361 USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17), 362 + .driver_info = (unsigned long)&qmi_wwan_info, 363 + }, 364 + { /* HUAWEI_NDIS_SINGLE_INTERFACE_VDF */ 365 + USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x37), 366 + .driver_info = (unsigned long)&qmi_wwan_info, 367 + }, 368 + { /* HUAWEI_INTERFACE_NDIS_HW_QUALCOMM */ 369 + USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x67), 366 370 .driver_info = (unsigned long)&qmi_wwan_info, 367 371 }, 368 372 { /* Pantech UML290, P4200 and more */
+21 -14
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
··· 36 36 #include "debug.h" 37 37 38 38 #define N_TX_QUEUES 4 /* #tx queues on mac80211<->driver interface */ 39 + #define BRCMS_FLUSH_TIMEOUT 500 /* msec */ 39 40 40 41 /* Flags we support */ 41 42 #define MAC_FILTERS (FIF_PROMISC_IN_BSS | \ ··· 713 712 wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked); 714 713 } 715 714 715 + static bool brcms_tx_flush_completed(struct brcms_info *wl) 716 + { 717 + bool result; 718 + 719 + spin_lock_bh(&wl->lock); 720 + result = brcms_c_tx_flush_completed(wl->wlc); 721 + spin_unlock_bh(&wl->lock); 722 + return result; 723 + } 724 + 716 725 static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop) 717 726 { 718 727 struct brcms_info *wl = hw->priv; 728 + int ret; 719 729 720 730 no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false"); 721 731 722 - /* wait for packet queue and dma fifos to run empty */ 723 - spin_lock_bh(&wl->lock); 724 - brcms_c_wait_for_tx_completion(wl->wlc, drop); 725 - spin_unlock_bh(&wl->lock); 732 + ret = wait_event_timeout(wl->tx_flush_wq, 733 + brcms_tx_flush_completed(wl), 734 + msecs_to_jiffies(BRCMS_FLUSH_TIMEOUT)); 735 + 736 + brcms_dbg_mac80211(wl->wlc->hw->d11core, 737 + "ret=%d\n", jiffies_to_msecs(ret)); 726 738 } 727 739 728 740 static const struct ieee80211_ops brcms_ops = { ··· 790 776 791 777 done: 792 778 spin_unlock_bh(&wl->lock); 779 + wake_up(&wl->tx_flush_wq); 793 780 } 794 781 795 782 /* ··· 1038 1023 wl->wiphy = hw->wiphy; 1039 1024 1040 1025 atomic_set(&wl->callbacks, 0); 1026 + 1027 + init_waitqueue_head(&wl->tx_flush_wq); 1041 1028 1042 1029 /* setup the bottom half handler */ 1043 1030 tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl); ··· 1629 1612 wiphy_rfkill_start_polling(wl->pub->ieee_hw->wiphy); 1630 1613 spin_lock_bh(&wl->lock); 1631 1614 return blocked; 1632 - } 1633 - 1634 - /* 1635 - * precondition: perimeter lock has been acquired 1636 - */ 1637 - void brcms_msleep(struct brcms_info *wl, uint ms) 1638 - { 1639 - spin_unlock_bh(&wl->lock); 1640 - msleep(ms); 1641 - spin_lock_bh(&wl->lock); 1642 1615 }
+2 -1
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
··· 68 68 spinlock_t lock; /* per-device perimeter lock */ 69 69 spinlock_t isr_lock; /* per-device ISR synchronization lock */ 70 70 71 + /* tx flush */ 72 + wait_queue_head_t tx_flush_wq; 71 73 72 74 /* timer related fields */ 73 75 atomic_t callbacks; /* # outstanding callback functions */ ··· 102 100 extern void brcms_free_timer(struct brcms_timer *timer); 103 101 extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic); 104 102 extern bool brcms_del_timer(struct brcms_timer *timer); 105 - extern void brcms_msleep(struct brcms_info *wl, uint ms); 106 103 extern void brcms_dpc(unsigned long data); 107 104 extern void brcms_timer(struct brcms_timer *t); 108 105 extern void brcms_fatal_error(struct brcms_info *wl);
+3 -12
drivers/net/wireless/brcm80211/brcmsmac/main.c
··· 7510 7510 return wlc->band->bandunit; 7511 7511 } 7512 7512 7513 - void brcms_c_wait_for_tx_completion(struct brcms_c_info *wlc, bool drop) 7513 + bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc) 7514 7514 { 7515 - int timeout = 20; 7516 7515 int i; 7517 7516 7518 7517 /* Kick DMA to send any pending AMPDU */ 7519 7518 for (i = 0; i < ARRAY_SIZE(wlc->hw->di); i++) 7520 7519 if (wlc->hw->di[i]) 7521 - dma_txflush(wlc->hw->di[i]); 7520 + dma_kick_tx(wlc->hw->di[i]); 7522 7521 7523 - /* wait for queue and DMA fifos to run dry */ 7524 - while (brcms_txpktpendtot(wlc) > 0) { 7525 - brcms_msleep(wlc->wl, 1); 7526 - 7527 - if (--timeout == 0) 7528 - break; 7529 - } 7530 - 7531 - WARN_ON_ONCE(timeout == 0); 7522 + return !brcms_txpktpendtot(wlc); 7532 7523 } 7533 7524 7534 7525 void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, u8 interval)
+1 -2
drivers/net/wireless/brcm80211/brcmsmac/pub.h
··· 314 314 extern void brcms_c_scan_start(struct brcms_c_info *wlc); 315 315 extern void brcms_c_scan_stop(struct brcms_c_info *wlc); 316 316 extern int brcms_c_get_curband(struct brcms_c_info *wlc); 317 - extern void brcms_c_wait_for_tx_completion(struct brcms_c_info *wlc, 318 - bool drop); 319 317 extern int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel); 320 318 extern int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl); 321 319 extern void brcms_c_get_current_rateset(struct brcms_c_info *wlc, ··· 330 332 extern int brcms_c_get_tx_power(struct brcms_c_info *wlc); 331 333 extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc); 332 334 extern void brcms_c_mute(struct brcms_c_info *wlc, bool on); 335 + extern bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc); 333 336 334 337 #endif /* _BRCM_PUB_H_ */
+4 -3
drivers/net/wireless/rtlwifi/base.c
··· 1004 1004 is_tx ? "Tx" : "Rx"); 1005 1005 1006 1006 if (is_tx) { 1007 - rtl_lps_leave(hw); 1007 + schedule_work(&rtlpriv-> 1008 + works.lps_leave_work); 1008 1009 ppsc->last_delaylps_stamp_jiffies = 1009 1010 jiffies; 1010 1011 } ··· 1015 1014 } 1016 1015 } else if (ETH_P_ARP == ether_type) { 1017 1016 if (is_tx) { 1018 - rtl_lps_leave(hw); 1017 + schedule_work(&rtlpriv->works.lps_leave_work); 1019 1018 ppsc->last_delaylps_stamp_jiffies = jiffies; 1020 1019 } 1021 1020 ··· 1025 1024 "802.1X %s EAPOL pkt!!\n", is_tx ? "Tx" : "Rx"); 1026 1025 1027 1026 if (is_tx) { 1028 - rtl_lps_leave(hw); 1027 + schedule_work(&rtlpriv->works.lps_leave_work); 1029 1028 ppsc->last_delaylps_stamp_jiffies = jiffies; 1030 1029 } 1031 1030
+3
drivers/net/xen-netback/common.h
··· 151 151 /* Notify xenvif that ring now has space to send an skb to the frontend */ 152 152 void xenvif_notify_tx_completion(struct xenvif *vif); 153 153 154 + /* Prevent the device from generating any further traffic. */ 155 + void xenvif_carrier_off(struct xenvif *vif); 156 + 154 157 /* Returns number of ring slots required to send an skb to the frontend */ 155 158 unsigned int xen_netbk_count_skb_slots(struct xenvif *vif, struct sk_buff *skb); 156 159
+14 -9
drivers/net/xen-netback/interface.c
··· 345 345 return err; 346 346 } 347 347 348 - void xenvif_disconnect(struct xenvif *vif) 348 + void xenvif_carrier_off(struct xenvif *vif) 349 349 { 350 350 struct net_device *dev = vif->dev; 351 - if (netif_carrier_ok(dev)) { 352 - rtnl_lock(); 353 - netif_carrier_off(dev); /* discard queued packets */ 354 - if (netif_running(dev)) 355 - xenvif_down(vif); 356 - rtnl_unlock(); 357 - xenvif_put(vif); 358 - } 351 + 352 + rtnl_lock(); 353 + netif_carrier_off(dev); /* discard queued packets */ 354 + if (netif_running(dev)) 355 + xenvif_down(vif); 356 + rtnl_unlock(); 357 + xenvif_put(vif); 358 + } 359 + 360 + void xenvif_disconnect(struct xenvif *vif) 361 + { 362 + if (netif_carrier_ok(vif->dev)) 363 + xenvif_carrier_off(vif); 359 364 360 365 atomic_dec(&vif->refcnt); 361 366 wait_event(vif->waiting_to_free, atomic_read(&vif->refcnt) == 0);
+71 -44
drivers/net/xen-netback/netback.c
··· 147 147 atomic_dec(&netbk->netfront_count); 148 148 } 149 149 150 - static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx); 150 + static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx, 151 + u8 status); 151 152 static void make_tx_response(struct xenvif *vif, 152 153 struct xen_netif_tx_request *txp, 153 154 s8 st); ··· 880 879 881 880 do { 882 881 make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR); 883 - if (cons >= end) 882 + if (cons == end) 884 883 break; 885 884 txp = RING_GET_REQUEST(&vif->tx, cons++); 886 885 } while (1); 887 886 vif->tx.req_cons = cons; 888 887 xen_netbk_check_rx_xenvif(vif); 888 + xenvif_put(vif); 889 + } 890 + 891 + static void netbk_fatal_tx_err(struct xenvif *vif) 892 + { 893 + netdev_err(vif->dev, "fatal error; disabling device\n"); 894 + xenvif_carrier_off(vif); 889 895 xenvif_put(vif); 890 896 } 891 897 ··· 909 901 910 902 do { 911 903 if (frags >= work_to_do) { 912 - netdev_dbg(vif->dev, "Need more frags\n"); 904 + netdev_err(vif->dev, "Need more frags\n"); 905 + netbk_fatal_tx_err(vif); 913 906 return -frags; 914 907 } 915 908 916 909 if (unlikely(frags >= MAX_SKB_FRAGS)) { 917 - netdev_dbg(vif->dev, "Too many frags\n"); 910 + netdev_err(vif->dev, "Too many frags\n"); 911 + netbk_fatal_tx_err(vif); 918 912 return -frags; 919 913 } 920 914 921 915 memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + frags), 922 916 sizeof(*txp)); 923 917 if (txp->size > first->size) { 924 - netdev_dbg(vif->dev, "Frags galore\n"); 918 + netdev_err(vif->dev, "Frag is bigger than frame.\n"); 919 + netbk_fatal_tx_err(vif); 925 920 return -frags; 926 921 } 927 922 ··· 932 921 frags++; 933 922 934 923 if (unlikely((txp->offset + txp->size) > PAGE_SIZE)) { 935 - netdev_dbg(vif->dev, "txp->offset: %x, size: %u\n", 924 + netdev_err(vif->dev, "txp->offset: %x, size: %u\n", 936 925 txp->offset, txp->size); 926 + netbk_fatal_tx_err(vif); 937 927 return -frags; 938 928 } 939 929 } while ((txp++)->flags & XEN_NETTXF_more_data); ··· 978 966 pending_idx = netbk->pending_ring[index]; 979 967 page = xen_netbk_alloc_page(netbk, skb, pending_idx); 980 968 if (!page) 981 - return NULL; 969 + goto err; 982 970 983 971 gop->source.u.ref = txp->gref; 984 972 gop->source.domid = vif->domid; ··· 1000 988 } 1001 989 1002 990 return gop; 991 + err: 992 + /* Unwind, freeing all pages and sending error responses. */ 993 + while (i-- > start) { 994 + xen_netbk_idx_release(netbk, frag_get_pending_idx(&frags[i]), 995 + XEN_NETIF_RSP_ERROR); 996 + } 997 + /* The head too, if necessary. */ 998 + if (start) 999 + xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR); 1000 + 1001 + return NULL; 1003 1002 } 1004 1003 1005 1004 static int xen_netbk_tx_check_gop(struct xen_netbk *netbk, ··· 1019 996 { 1020 997 struct gnttab_copy *gop = *gopp; 1021 998 u16 pending_idx = *((u16 *)skb->data); 1022 - struct pending_tx_info *pending_tx_info = netbk->pending_tx_info; 1023 - struct xenvif *vif = pending_tx_info[pending_idx].vif; 1024 - struct xen_netif_tx_request *txp; 1025 999 struct skb_shared_info *shinfo = skb_shinfo(skb); 1026 1000 int nr_frags = shinfo->nr_frags; 1027 1001 int i, err, start; 1028 1002 1029 1003 /* Check status of header. */ 1030 1004 err = gop->status; 1031 - if (unlikely(err)) { 1032 - pending_ring_idx_t index; 1033 - index = pending_index(netbk->pending_prod++); 1034 - txp = &pending_tx_info[pending_idx].req; 1035 - make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR); 1036 - netbk->pending_ring[index] = pending_idx; 1037 - xenvif_put(vif); 1038 - } 1005 + if (unlikely(err)) 1006 + xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR); 1039 1007 1040 1008 /* Skip first skb fragment if it is on same page as header fragment. */ 1041 1009 start = (frag_get_pending_idx(&shinfo->frags[0]) == pending_idx); 1042 1010 1043 1011 for (i = start; i < nr_frags; i++) { 1044 1012 int j, newerr; 1045 - pending_ring_idx_t index; 1046 1013 1047 1014 pending_idx = frag_get_pending_idx(&shinfo->frags[i]); 1048 1015 ··· 1041 1028 if (likely(!newerr)) { 1042 1029 /* Had a previous error? Invalidate this fragment. */ 1043 1030 if (unlikely(err)) 1044 - xen_netbk_idx_release(netbk, pending_idx); 1031 + xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY); 1045 1032 continue; 1046 1033 } 1047 1034 1048 1035 /* Error on this fragment: respond to client with an error. */ 1049 - txp = &netbk->pending_tx_info[pending_idx].req; 1050 - make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR); 1051 - index = pending_index(netbk->pending_prod++); 1052 - netbk->pending_ring[index] = pending_idx; 1053 - xenvif_put(vif); 1036 + xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR); 1054 1037 1055 1038 /* Not the first error? Preceding frags already invalidated. */ 1056 1039 if (err) ··· 1054 1045 1055 1046 /* First error: invalidate header and preceding fragments. */ 1056 1047 pending_idx = *((u16 *)skb->data); 1057 - xen_netbk_idx_release(netbk, pending_idx); 1048 + xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY); 1058 1049 for (j = start; j < i; j++) { 1059 1050 pending_idx = frag_get_pending_idx(&shinfo->frags[j]); 1060 - xen_netbk_idx_release(netbk, pending_idx); 1051 + xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY); 1061 1052 } 1062 1053 1063 1054 /* Remember the error: invalidate all subsequent fragments. */ ··· 1091 1082 1092 1083 /* Take an extra reference to offset xen_netbk_idx_release */ 1093 1084 get_page(netbk->mmap_pages[pending_idx]); 1094 - xen_netbk_idx_release(netbk, pending_idx); 1085 + xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY); 1095 1086 } 1096 1087 } 1097 1088 ··· 1104 1095 1105 1096 do { 1106 1097 if (unlikely(work_to_do-- <= 0)) { 1107 - netdev_dbg(vif->dev, "Missing extra info\n"); 1098 + netdev_err(vif->dev, "Missing extra info\n"); 1099 + netbk_fatal_tx_err(vif); 1108 1100 return -EBADR; 1109 1101 } 1110 1102 ··· 1114 1104 if (unlikely(!extra.type || 1115 1105 extra.type >= XEN_NETIF_EXTRA_TYPE_MAX)) { 1116 1106 vif->tx.req_cons = ++cons; 1117 - netdev_dbg(vif->dev, 1107 + netdev_err(vif->dev, 1118 1108 "Invalid extra type: %d\n", extra.type); 1109 + netbk_fatal_tx_err(vif); 1119 1110 return -EINVAL; 1120 1111 } 1121 1112 ··· 1132 1121 struct xen_netif_extra_info *gso) 1133 1122 { 1134 1123 if (!gso->u.gso.size) { 1135 - netdev_dbg(vif->dev, "GSO size must not be zero.\n"); 1124 + netdev_err(vif->dev, "GSO size must not be zero.\n"); 1125 + netbk_fatal_tx_err(vif); 1136 1126 return -EINVAL; 1137 1127 } 1138 1128 1139 1129 /* Currently only TCPv4 S.O. is supported. */ 1140 1130 if (gso->u.gso.type != XEN_NETIF_GSO_TYPE_TCPV4) { 1141 - netdev_dbg(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type); 1131 + netdev_err(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type); 1132 + netbk_fatal_tx_err(vif); 1142 1133 return -EINVAL; 1143 1134 } 1144 1135 ··· 1277 1264 1278 1265 /* Get a netif from the list with work to do. */ 1279 1266 vif = poll_net_schedule_list(netbk); 1267 + /* This can sometimes happen because the test of 1268 + * list_empty(net_schedule_list) at the top of the 1269 + * loop is unlocked. Just go back and have another 1270 + * look. 1271 + */ 1280 1272 if (!vif) 1281 1273 continue; 1274 + 1275 + if (vif->tx.sring->req_prod - vif->tx.req_cons > 1276 + XEN_NETIF_TX_RING_SIZE) { 1277 + netdev_err(vif->dev, 1278 + "Impossible number of requests. " 1279 + "req_prod %d, req_cons %d, size %ld\n", 1280 + vif->tx.sring->req_prod, vif->tx.req_cons, 1281 + XEN_NETIF_TX_RING_SIZE); 1282 + netbk_fatal_tx_err(vif); 1283 + continue; 1284 + } 1282 1285 1283 1286 RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, work_to_do); 1284 1287 if (!work_to_do) { ··· 1323 1294 work_to_do = xen_netbk_get_extras(vif, extras, 1324 1295 work_to_do); 1325 1296 idx = vif->tx.req_cons; 1326 - if (unlikely(work_to_do < 0)) { 1327 - netbk_tx_err(vif, &txreq, idx); 1297 + if (unlikely(work_to_do < 0)) 1328 1298 continue; 1329 - } 1330 1299 } 1331 1300 1332 1301 ret = netbk_count_requests(vif, &txreq, txfrags, work_to_do); 1333 - if (unlikely(ret < 0)) { 1334 - netbk_tx_err(vif, &txreq, idx - ret); 1302 + if (unlikely(ret < 0)) 1335 1303 continue; 1336 - } 1304 + 1337 1305 idx += ret; 1338 1306 1339 1307 if (unlikely(txreq.size < ETH_HLEN)) { ··· 1342 1316 1343 1317 /* No crossing a page as the payload mustn't fragment. */ 1344 1318 if (unlikely((txreq.offset + txreq.size) > PAGE_SIZE)) { 1345 - netdev_dbg(vif->dev, 1319 + netdev_err(vif->dev, 1346 1320 "txreq.offset: %x, size: %u, end: %lu\n", 1347 1321 txreq.offset, txreq.size, 1348 1322 (txreq.offset&~PAGE_MASK) + txreq.size); 1349 - netbk_tx_err(vif, &txreq, idx); 1323 + netbk_fatal_tx_err(vif); 1350 1324 continue; 1351 1325 } 1352 1326 ··· 1374 1348 gso = &extras[XEN_NETIF_EXTRA_TYPE_GSO - 1]; 1375 1349 1376 1350 if (netbk_set_skb_gso(vif, skb, gso)) { 1351 + /* Failure in netbk_set_skb_gso is fatal. */ 1377 1352 kfree_skb(skb); 1378 - netbk_tx_err(vif, &txreq, idx); 1379 1353 continue; 1380 1354 } 1381 1355 } ··· 1474 1448 txp->size -= data_len; 1475 1449 } else { 1476 1450 /* Schedule a response immediately. */ 1477 - xen_netbk_idx_release(netbk, pending_idx); 1451 + xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY); 1478 1452 } 1479 1453 1480 1454 if (txp->flags & XEN_NETTXF_csum_blank) ··· 1526 1500 xen_netbk_tx_submit(netbk); 1527 1501 } 1528 1502 1529 - static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx) 1503 + static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx, 1504 + u8 status) 1530 1505 { 1531 1506 struct xenvif *vif; 1532 1507 struct pending_tx_info *pending_tx_info; ··· 1541 1514 1542 1515 vif = pending_tx_info->vif; 1543 1516 1544 - make_tx_response(vif, &pending_tx_info->req, XEN_NETIF_RSP_OKAY); 1517 + make_tx_response(vif, &pending_tx_info->req, status); 1545 1518 1546 1519 index = pending_index(netbk->pending_prod++); 1547 1520 netbk->pending_ring[index] = pending_idx;
+2 -3
drivers/pinctrl/Kconfig
··· 181 181 182 182 config PINCTRL_SAMSUNG 183 183 bool 184 - depends on OF && GPIOLIB 185 184 select PINMUX 186 185 select PINCONF 187 186 188 - config PINCTRL_EXYNOS4 189 - bool "Pinctrl driver data for Exynos4 SoC" 187 + config PINCTRL_EXYNOS 188 + bool "Pinctrl driver data for Samsung EXYNOS SoCs" 190 189 depends on OF && GPIOLIB 191 190 select PINCTRL_SAMSUNG 192 191
+1 -1
drivers/pinctrl/Makefile
··· 36 36 obj-$(CONFIG_PINCTRL_U300) += pinctrl-u300.o 37 37 obj-$(CONFIG_PINCTRL_COH901) += pinctrl-coh901.o 38 38 obj-$(CONFIG_PINCTRL_SAMSUNG) += pinctrl-samsung.o 39 - obj-$(CONFIG_PINCTRL_EXYNOS4) += pinctrl-exynos.o 39 + obj-$(CONFIG_PINCTRL_EXYNOS) += pinctrl-exynos.o 40 40 obj-$(CONFIG_PINCTRL_EXYNOS5440) += pinctrl-exynos5440.o 41 41 obj-$(CONFIG_PINCTRL_XWAY) += pinctrl-xway.o 42 42 obj-$(CONFIG_PINCTRL_LANTIQ) += pinctrl-lantiq.o
+1 -1
drivers/pinctrl/mvebu/pinctrl-dove.c
··· 588 588 { 589 589 const struct of_device_id *match = 590 590 of_match_device(dove_pinctrl_of_match, &pdev->dev); 591 - pdev->dev.platform_data = match->data; 591 + pdev->dev.platform_data = (void *)match->data; 592 592 593 593 /* 594 594 * General MPP Configuration Register is part of pdma registers.
+4 -4
drivers/pinctrl/mvebu/pinctrl-kirkwood.c
··· 66 66 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)), 67 67 MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))), 68 68 MPP_MODE(6, 69 - MPP_VAR_FUNCTION(0x0, "sysrst", "out", V(1, 1, 1, 1, 1, 1)), 70 - MPP_VAR_FUNCTION(0x1, "spi", "mosi", V(1, 1, 1, 1, 1, 1)), 71 - MPP_VAR_FUNCTION(0x2, "ptp", "trig", V(1, 1, 1, 1, 0, 0))), 69 + MPP_VAR_FUNCTION(0x1, "sysrst", "out", V(1, 1, 1, 1, 1, 1)), 70 + MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1)), 71 + MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0))), 72 72 MPP_MODE(7, 73 73 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), 74 74 MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0, 1)), ··· 458 458 { 459 459 const struct of_device_id *match = 460 460 of_match_device(kirkwood_pinctrl_of_match, &pdev->dev); 461 - pdev->dev.platform_data = match->data; 461 + pdev->dev.platform_data = (void *)match->data; 462 462 return mvebu_pinctrl_probe(pdev); 463 463 } 464 464
+5 -5
drivers/pinctrl/pinctrl-exynos5440.c
··· 599 599 } 600 600 601 601 /* parse the pin numbers listed in the 'samsung,exynos5440-pins' property */ 602 - static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev, 602 + static int exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev, 603 603 struct device_node *cfg_np, unsigned int **pin_list, 604 604 unsigned int *npins) 605 605 { ··· 630 630 * Parse the information about all the available pin groups and pin functions 631 631 * from device node of the pin-controller. 632 632 */ 633 - static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev, 633 + static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev, 634 634 struct exynos5440_pinctrl_priv_data *priv) 635 635 { 636 636 struct device *dev = &pdev->dev; ··· 723 723 } 724 724 725 725 /* register the pinctrl interface with the pinctrl subsystem */ 726 - static int __init exynos5440_pinctrl_register(struct platform_device *pdev, 726 + static int exynos5440_pinctrl_register(struct platform_device *pdev, 727 727 struct exynos5440_pinctrl_priv_data *priv) 728 728 { 729 729 struct device *dev = &pdev->dev; ··· 798 798 } 799 799 800 800 /* register the gpiolib interface with the gpiolib subsystem */ 801 - static int __init exynos5440_gpiolib_register(struct platform_device *pdev, 801 + static int exynos5440_gpiolib_register(struct platform_device *pdev, 802 802 struct exynos5440_pinctrl_priv_data *priv) 803 803 { 804 804 struct gpio_chip *gc; ··· 831 831 } 832 832 833 833 /* unregister the gpiolib interface with the gpiolib subsystem */ 834 - static int __init exynos5440_gpiolib_unregister(struct platform_device *pdev, 834 + static int exynos5440_gpiolib_unregister(struct platform_device *pdev, 835 835 struct exynos5440_pinctrl_priv_data *priv) 836 836 { 837 837 int ret = gpiochip_remove(priv->gc);
+4 -5
drivers/pinctrl/pinctrl-mxs.c
··· 146 146 static void mxs_dt_free_map(struct pinctrl_dev *pctldev, 147 147 struct pinctrl_map *map, unsigned num_maps) 148 148 { 149 - int i; 149 + u32 i; 150 150 151 151 for (i = 0; i < num_maps; i++) { 152 152 if (map[i].type == PIN_MAP_TYPE_MUX_GROUP) ··· 203 203 void __iomem *reg; 204 204 u8 bank, shift; 205 205 u16 pin; 206 - int i; 206 + u32 i; 207 207 208 208 for (i = 0; i < g->npins; i++) { 209 209 bank = PINID_TO_BANK(g->pins[i]); ··· 256 256 void __iomem *reg; 257 257 u8 ma, vol, pull, bank, shift; 258 258 u16 pin; 259 - int i; 259 + u32 i; 260 260 261 261 ma = CONFIG_TO_MA(config); 262 262 vol = CONFIG_TO_VOL(config); ··· 345 345 const char *propname = "fsl,pinmux-ids"; 346 346 char *group; 347 347 int length = strlen(np->name) + SUFFIX_LEN; 348 - int i; 349 - u32 val; 348 + u32 val, i; 350 349 351 350 group = devm_kzalloc(&pdev->dev, length, GFP_KERNEL); 352 351 if (!group)
+1 -1
drivers/pinctrl/pinctrl-nomadik.c
··· 676 676 } 677 677 EXPORT_SYMBOL(nmk_gpio_set_mode); 678 678 679 - static int nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio) 679 + static int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio) 680 680 { 681 681 int i; 682 682 u16 reg;
+2 -77
drivers/pinctrl/pinctrl-single.c
··· 30 30 #define PCS_MUX_BITS_NAME "pinctrl-single,bits" 31 31 #define PCS_REG_NAME_LEN ((sizeof(unsigned long) * 2) + 1) 32 32 #define PCS_OFF_DISABLED ~0U 33 - #define PCS_MAX_GPIO_VALUES 2 34 33 35 34 /** 36 35 * struct pcs_pingroup - pingroups for a function ··· 74 75 const char **pgnames; 75 76 int npgnames; 76 77 struct list_head node; 77 - }; 78 - 79 - /** 80 - * struct pcs_gpio_range - pinctrl gpio range 81 - * @range: subrange of the GPIO number space 82 - * @gpio_func: gpio function value in the pinmux register 83 - */ 84 - struct pcs_gpio_range { 85 - struct pinctrl_gpio_range range; 86 - int gpio_func; 87 78 }; 88 79 89 80 /** ··· 403 414 } 404 415 405 416 static int pcs_request_gpio(struct pinctrl_dev *pctldev, 406 - struct pinctrl_gpio_range *range, unsigned pin) 417 + struct pinctrl_gpio_range *range, unsigned offset) 407 418 { 408 - struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev); 409 - struct pcs_gpio_range *gpio = NULL; 410 - int end, mux_bytes; 411 - unsigned data; 412 - 413 - gpio = container_of(range, struct pcs_gpio_range, range); 414 - end = range->pin_base + range->npins - 1; 415 - if (pin < range->pin_base || pin > end) { 416 - dev_err(pctldev->dev, 417 - "pin %d isn't in the range of %d to %d\n", 418 - pin, range->pin_base, end); 419 - return -EINVAL; 420 - } 421 - mux_bytes = pcs->width / BITS_PER_BYTE; 422 - data = pcs->read(pcs->base + pin * mux_bytes) & ~pcs->fmask; 423 - data |= gpio->gpio_func; 424 - pcs->write(data, pcs->base + pin * mux_bytes); 425 - return 0; 419 + return -ENOTSUPP; 426 420 } 427 421 428 422 static struct pinmux_ops pcs_pinmux_ops = { ··· 879 907 880 908 static struct of_device_id pcs_of_match[]; 881 909 882 - static int pcs_add_gpio_range(struct device_node *node, struct pcs_device *pcs) 883 - { 884 - struct pcs_gpio_range *gpio; 885 - struct device_node *child; 886 - struct resource r; 887 - const char name[] = "pinctrl-single"; 888 - u32 gpiores[PCS_MAX_GPIO_VALUES]; 889 - int ret, i = 0, mux_bytes = 0; 890 - 891 - for_each_child_of_node(node, child) { 892 - ret = of_address_to_resource(child, 0, &r); 893 - if (ret < 0) 894 - continue; 895 - memset(gpiores, 0, sizeof(u32) * PCS_MAX_GPIO_VALUES); 896 - ret = of_property_read_u32_array(child, "pinctrl-single,gpio", 897 - gpiores, PCS_MAX_GPIO_VALUES); 898 - if (ret < 0) 899 - continue; 900 - gpio = devm_kzalloc(pcs->dev, sizeof(*gpio), GFP_KERNEL); 901 - if (!gpio) { 902 - dev_err(pcs->dev, "failed to allocate pcs gpio\n"); 903 - return -ENOMEM; 904 - } 905 - gpio->range.name = devm_kzalloc(pcs->dev, sizeof(name), 906 - GFP_KERNEL); 907 - if (!gpio->range.name) { 908 - dev_err(pcs->dev, "failed to allocate range name\n"); 909 - return -ENOMEM; 910 - } 911 - memcpy((char *)gpio->range.name, name, sizeof(name)); 912 - 913 - gpio->range.id = i++; 914 - gpio->range.base = gpiores[0]; 915 - gpio->gpio_func = gpiores[1]; 916 - mux_bytes = pcs->width / BITS_PER_BYTE; 917 - gpio->range.pin_base = (r.start - pcs->res->start) / mux_bytes; 918 - gpio->range.npins = (r.end - r.start) / mux_bytes + 1; 919 - 920 - pinctrl_add_gpio_range(pcs->pctl, &gpio->range); 921 - } 922 - return 0; 923 - } 924 - 925 910 static int pcs_probe(struct platform_device *pdev) 926 911 { 927 912 struct device_node *np = pdev->dev.of_node; ··· 974 1045 ret = -EINVAL; 975 1046 goto free; 976 1047 } 977 - 978 - ret = pcs_add_gpio_range(np, pcs); 979 - if (ret < 0) 980 - goto free; 981 1048 982 1049 dev_info(pcs->dev, "%i pins at pa %p size %u\n", 983 1050 pcs->desc.npins, pcs->base, pcs->size);
+18
drivers/pinctrl/pinctrl-sirf.c
··· 1246 1246 return of_iomap(np, 0); 1247 1247 } 1248 1248 1249 + static int sirfsoc_gpio_of_xlate(struct gpio_chip *gc, 1250 + const struct of_phandle_args *gpiospec, 1251 + u32 *flags) 1252 + { 1253 + if (gpiospec->args[0] > SIRFSOC_GPIO_NO_OF_BANKS * SIRFSOC_GPIO_BANK_SIZE) 1254 + return -EINVAL; 1255 + 1256 + if (gc != &sgpio_bank[gpiospec->args[0] / SIRFSOC_GPIO_BANK_SIZE].chip.gc) 1257 + return -EINVAL; 1258 + 1259 + if (flags) 1260 + *flags = gpiospec->args[1]; 1261 + 1262 + return gpiospec->args[0] % SIRFSOC_GPIO_BANK_SIZE; 1263 + } 1264 + 1249 1265 static int sirfsoc_pinmux_probe(struct platform_device *pdev) 1250 1266 { 1251 1267 int ret; ··· 1752 1736 bank->chip.gc.ngpio = SIRFSOC_GPIO_BANK_SIZE; 1753 1737 bank->chip.gc.label = kstrdup(np->full_name, GFP_KERNEL); 1754 1738 bank->chip.gc.of_node = np; 1739 + bank->chip.gc.of_xlate = sirfsoc_gpio_of_xlate; 1740 + bank->chip.gc.of_gpio_n_cells = 2; 1755 1741 bank->chip.regs = regs; 1756 1742 bank->id = i; 1757 1743 bank->is_marco = is_marco;
+1 -1
drivers/platform/x86/ibm_rtl.c
··· 244 244 if (force) 245 245 pr_warn("module loaded by force\n"); 246 246 /* first ensure that we are running on IBM HW */ 247 - else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table)) 247 + else if (efi_enabled(EFI_BOOT) || !dmi_check_system(ibm_rtl_dmi_table)) 248 248 return -ENODEV; 249 249 250 250 /* Get the address for the Extended BIOS Data Area */
+4
drivers/platform/x86/samsung-laptop.c
··· 26 26 #include <linux/seq_file.h> 27 27 #include <linux/debugfs.h> 28 28 #include <linux/ctype.h> 29 + #include <linux/efi.h> 29 30 #include <acpi/video.h> 30 31 31 32 /* ··· 1544 1543 { 1545 1544 struct samsung_laptop *samsung; 1546 1545 int ret; 1546 + 1547 + if (efi_enabled(EFI_BOOT)) 1548 + return -ENODEV; 1547 1549 1548 1550 quirks = &samsung_unknown; 1549 1551 if (!force && !dmi_check_system(samsung_dmi_table))
+1
drivers/regulator/dbx500-prcmu.c
··· 14 14 #include <linux/debugfs.h> 15 15 #include <linux/seq_file.h> 16 16 #include <linux/slab.h> 17 + #include <linux/module.h> 17 18 18 19 #include "dbx500-prcmu.h" 19 20
+8 -7
drivers/regulator/max77686.c
··· 379 379 }; 380 380 381 381 #ifdef CONFIG_OF 382 - static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, 382 + static int max77686_pmic_dt_parse_pdata(struct platform_device *pdev, 383 383 struct max77686_platform_data *pdata) 384 384 { 385 + struct max77686_dev *iodev = dev_get_drvdata(pdev->dev.parent); 385 386 struct device_node *pmic_np, *regulators_np; 386 387 struct max77686_regulator_data *rdata; 387 388 struct of_regulator_match rmatch; ··· 391 390 pmic_np = iodev->dev->of_node; 392 391 regulators_np = of_find_node_by_name(pmic_np, "voltage-regulators"); 393 392 if (!regulators_np) { 394 - dev_err(iodev->dev, "could not find regulators sub-node\n"); 393 + dev_err(&pdev->dev, "could not find regulators sub-node\n"); 395 394 return -EINVAL; 396 395 } 397 396 398 397 pdata->num_regulators = ARRAY_SIZE(regulators); 399 - rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * 398 + rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * 400 399 pdata->num_regulators, GFP_KERNEL); 401 400 if (!rdata) { 402 - dev_err(iodev->dev, 401 + dev_err(&pdev->dev, 403 402 "could not allocate memory for regulator data\n"); 404 403 return -ENOMEM; 405 404 } ··· 408 407 rmatch.name = regulators[i].name; 409 408 rmatch.init_data = NULL; 410 409 rmatch.of_node = NULL; 411 - of_regulator_match(iodev->dev, regulators_np, &rmatch, 1); 410 + of_regulator_match(&pdev->dev, regulators_np, &rmatch, 1); 412 411 rdata[i].initdata = rmatch.init_data; 413 412 rdata[i].of_node = rmatch.of_node; 414 413 } ··· 418 417 return 0; 419 418 } 420 419 #else 421 - static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, 420 + static int max77686_pmic_dt_parse_pdata(struct platform_device *pdev, 422 421 struct max77686_platform_data *pdata) 423 422 { 424 423 return 0; ··· 441 440 } 442 441 443 442 if (iodev->dev->of_node) { 444 - ret = max77686_pmic_dt_parse_pdata(iodev, pdata); 443 + ret = max77686_pmic_dt_parse_pdata(pdev, pdata); 445 444 if (ret) 446 445 return ret; 447 446 }
+1 -2
drivers/regulator/max8907-regulator.c
··· 237 237 return -EINVAL; 238 238 } 239 239 240 - ret = of_regulator_match(pdev->dev.parent, regulators, 241 - max8907_matches, 240 + ret = of_regulator_match(&pdev->dev, regulators, max8907_matches, 242 241 ARRAY_SIZE(max8907_matches)); 243 242 if (ret < 0) { 244 243 dev_err(&pdev->dev, "Error parsing regulator init data: %d\n",
+19 -20
drivers/regulator/max8997.c
··· 934 934 }; 935 935 936 936 #ifdef CONFIG_OF 937 - static int max8997_pmic_dt_parse_dvs_gpio(struct max8997_dev *iodev, 937 + static int max8997_pmic_dt_parse_dvs_gpio(struct platform_device *pdev, 938 938 struct max8997_platform_data *pdata, 939 939 struct device_node *pmic_np) 940 940 { ··· 944 944 gpio = of_get_named_gpio(pmic_np, 945 945 "max8997,pmic-buck125-dvs-gpios", i); 946 946 if (!gpio_is_valid(gpio)) { 947 - dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio); 947 + dev_err(&pdev->dev, "invalid gpio[%d]: %d\n", i, gpio); 948 948 return -EINVAL; 949 949 } 950 950 pdata->buck125_gpios[i] = gpio; ··· 952 952 return 0; 953 953 } 954 954 955 - static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, 955 + static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, 956 956 struct max8997_platform_data *pdata) 957 957 { 958 + struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent); 958 959 struct device_node *pmic_np, *regulators_np, *reg_np; 959 960 struct max8997_regulator_data *rdata; 960 961 unsigned int i, dvs_voltage_nr = 1, ret; 961 962 962 963 pmic_np = iodev->dev->of_node; 963 964 if (!pmic_np) { 964 - dev_err(iodev->dev, "could not find pmic sub-node\n"); 965 + dev_err(&pdev->dev, "could not find pmic sub-node\n"); 965 966 return -ENODEV; 966 967 } 967 968 968 969 regulators_np = of_find_node_by_name(pmic_np, "regulators"); 969 970 if (!regulators_np) { 970 - dev_err(iodev->dev, "could not find regulators sub-node\n"); 971 + dev_err(&pdev->dev, "could not find regulators sub-node\n"); 971 972 return -EINVAL; 972 973 } 973 974 ··· 977 976 for_each_child_of_node(regulators_np, reg_np) 978 977 pdata->num_regulators++; 979 978 980 - rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * 979 + rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * 981 980 pdata->num_regulators, GFP_KERNEL); 982 981 if (!rdata) { 983 - dev_err(iodev->dev, "could not allocate memory for " 984 - "regulator data\n"); 982 + dev_err(&pdev->dev, "could not allocate memory for regulator data\n"); 985 983 return -ENOMEM; 986 984 } 987 985 ··· 991 991 break; 992 992 993 993 if (i == ARRAY_SIZE(regulators)) { 994 - dev_warn(iodev->dev, "don't know how to configure " 995 - "regulator %s\n", reg_np->name); 994 + dev_warn(&pdev->dev, "don't know how to configure regulator %s\n", 995 + reg_np->name); 996 996 continue; 997 997 } 998 998 999 999 rdata->id = i; 1000 - rdata->initdata = of_get_regulator_init_data( 1001 - iodev->dev, reg_np); 1000 + rdata->initdata = of_get_regulator_init_data(&pdev->dev, 1001 + reg_np); 1002 1002 rdata->reg_node = reg_np; 1003 1003 rdata++; 1004 1004 } ··· 1014 1014 1015 1015 if (pdata->buck1_gpiodvs || pdata->buck2_gpiodvs || 1016 1016 pdata->buck5_gpiodvs) { 1017 - ret = max8997_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np); 1017 + ret = max8997_pmic_dt_parse_dvs_gpio(pdev, pdata, pmic_np); 1018 1018 if (ret) 1019 1019 return -EINVAL; 1020 1020 ··· 1025 1025 } else { 1026 1026 if (pdata->buck125_default_idx >= 8) { 1027 1027 pdata->buck125_default_idx = 0; 1028 - dev_info(iodev->dev, "invalid value for " 1029 - "default dvs index, using 0 instead\n"); 1028 + dev_info(&pdev->dev, "invalid value for default dvs index, using 0 instead\n"); 1030 1029 } 1031 1030 } 1032 1031 ··· 1039 1040 if (of_property_read_u32_array(pmic_np, 1040 1041 "max8997,pmic-buck1-dvs-voltage", 1041 1042 pdata->buck1_voltage, dvs_voltage_nr)) { 1042 - dev_err(iodev->dev, "buck1 voltages not specified\n"); 1043 + dev_err(&pdev->dev, "buck1 voltages not specified\n"); 1043 1044 return -EINVAL; 1044 1045 } 1045 1046 1046 1047 if (of_property_read_u32_array(pmic_np, 1047 1048 "max8997,pmic-buck2-dvs-voltage", 1048 1049 pdata->buck2_voltage, dvs_voltage_nr)) { 1049 - dev_err(iodev->dev, "buck2 voltages not specified\n"); 1050 + dev_err(&pdev->dev, "buck2 voltages not specified\n"); 1050 1051 return -EINVAL; 1051 1052 } 1052 1053 1053 1054 if (of_property_read_u32_array(pmic_np, 1054 1055 "max8997,pmic-buck5-dvs-voltage", 1055 1056 pdata->buck5_voltage, dvs_voltage_nr)) { 1056 - dev_err(iodev->dev, "buck5 voltages not specified\n"); 1057 + dev_err(&pdev->dev, "buck5 voltages not specified\n"); 1057 1058 return -EINVAL; 1058 1059 } 1059 1060 1060 1061 return 0; 1061 1062 } 1062 1063 #else 1063 - static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, 1064 + static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, 1064 1065 struct max8997_platform_data *pdata) 1065 1066 { 1066 1067 return 0; ··· 1084 1085 } 1085 1086 1086 1087 if (iodev->dev->of_node) { 1087 - ret = max8997_pmic_dt_parse_pdata(iodev, pdata); 1088 + ret = max8997_pmic_dt_parse_pdata(pdev, pdata); 1088 1089 if (ret) 1089 1090 return ret; 1090 1091 }
+1 -1
drivers/regulator/max8998.c
··· 65 65 .min = 2800000, .step = 100000, .max = 3100000, 66 66 }; 67 67 static const struct voltage_map_desc ldo10_voltage_map_desc = { 68 - .min = 95000, .step = 50000, .max = 1300000, 68 + .min = 950000, .step = 50000, .max = 1300000, 69 69 }; 70 70 static const struct voltage_map_desc ldo1213_voltage_map_desc = { 71 71 .min = 800000, .step = 100000, .max = 3300000,
+6
drivers/regulator/of_regulator.c
··· 120 120 if (!dev || !node) 121 121 return -EINVAL; 122 122 123 + for (i = 0; i < num_matches; i++) { 124 + struct of_regulator_match *match = &matches[i]; 125 + match->init_data = NULL; 126 + match->of_node = NULL; 127 + } 128 + 123 129 for_each_child_of_node(node, child) { 124 130 name = of_get_property(child, 125 131 "regulator-compatible", NULL);
+2 -2
drivers/regulator/s2mps11.c
··· 174 174 .min_uV = S2MPS11_BUCK_MIN2, \ 175 175 .uV_step = S2MPS11_BUCK_STEP2, \ 176 176 .n_voltages = S2MPS11_BUCK_N_VOLTAGES, \ 177 - .vsel_reg = S2MPS11_REG_B9CTRL2, \ 177 + .vsel_reg = S2MPS11_REG_B10CTRL2, \ 178 178 .vsel_mask = S2MPS11_BUCK_VSEL_MASK, \ 179 - .enable_reg = S2MPS11_REG_B9CTRL1, \ 179 + .enable_reg = S2MPS11_REG_B10CTRL1, \ 180 180 .enable_mask = S2MPS11_ENABLE_MASK \ 181 181 } 182 182
+2 -2
drivers/regulator/tps65217-regulator.c
··· 305 305 if (!regs) 306 306 return NULL; 307 307 308 - count = of_regulator_match(pdev->dev.parent, regs, 309 - reg_matches, TPS65217_NUM_REGULATOR); 308 + count = of_regulator_match(&pdev->dev, regs, reg_matches, 309 + TPS65217_NUM_REGULATOR); 310 310 of_node_put(regs); 311 311 if ((count < 0) || (count > TPS65217_NUM_REGULATOR)) 312 312 return NULL;
+1 -1
drivers/regulator/tps65910-regulator.c
··· 998 998 return NULL; 999 999 } 1000 1000 1001 - ret = of_regulator_match(pdev->dev.parent, regulators, matches, count); 1001 + ret = of_regulator_match(&pdev->dev, regulators, matches, count); 1002 1002 if (ret < 0) { 1003 1003 dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", 1004 1004 ret);
+1 -1
drivers/regulator/tps80031-regulator.c
··· 728 728 } 729 729 } 730 730 rdev = regulator_register(&ri->rinfo->desc, &config); 731 - if (IS_ERR_OR_NULL(rdev)) { 731 + if (IS_ERR(rdev)) { 732 732 dev_err(&pdev->dev, 733 733 "register regulator failed %s\n", 734 734 ri->rinfo->desc.name);
+3
drivers/rtc/rtc-isl1208.c
··· 506 506 { 507 507 unsigned long timeout = jiffies + msecs_to_jiffies(1000); 508 508 struct i2c_client *client = data; 509 + struct rtc_device *rtc = i2c_get_clientdata(client); 509 510 int handled = 0, sr, err; 510 511 511 512 /* ··· 528 527 529 528 if (sr & ISL1208_REG_SR_ALM) { 530 529 dev_dbg(&client->dev, "alarm!\n"); 530 + 531 + rtc_update_irq(rtc, 1, RTC_IRQF | RTC_AF); 531 532 532 533 /* Clear the alarm */ 533 534 sr &= ~ISL1208_REG_SR_ALM;
+5 -3
drivers/rtc/rtc-pl031.c
··· 44 44 #define RTC_YMR 0x34 /* Year match register */ 45 45 #define RTC_YLR 0x38 /* Year data load register */ 46 46 47 + #define RTC_CR_EN (1 << 0) /* counter enable bit */ 47 48 #define RTC_CR_CWEN (1 << 26) /* Clockwatch enable bit */ 48 49 49 50 #define RTC_TCR_EN (1 << 1) /* Periodic timer enable bit */ ··· 321 320 struct pl031_local *ldata; 322 321 struct pl031_vendor_data *vendor = id->data; 323 322 struct rtc_class_ops *ops = &vendor->ops; 324 - unsigned long time; 323 + unsigned long time, data; 325 324 326 325 ret = amba_request_regions(adev, NULL); 327 326 if (ret) ··· 346 345 dev_dbg(&adev->dev, "designer ID = 0x%02x\n", amba_manf(adev)); 347 346 dev_dbg(&adev->dev, "revision = 0x%01x\n", amba_rev(adev)); 348 347 348 + data = readl(ldata->base + RTC_CR); 349 349 /* Enable the clockwatch on ST Variants */ 350 350 if (vendor->clockwatch) 351 - writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN, 352 - ldata->base + RTC_CR); 351 + data |= RTC_CR_CWEN; 352 + writel(data | RTC_CR_EN, ldata->base + RTC_CR); 353 353 354 354 /* 355 355 * On ST PL031 variants, the RTC reset value does not provide correct
+1 -1
drivers/rtc/rtc-vt8500.c
··· 137 137 return -EINVAL; 138 138 } 139 139 140 - writel((bin2bcd(tm->tm_year - 100) << DATE_YEAR_S) 140 + writel((bin2bcd(tm->tm_year % 100) << DATE_YEAR_S) 141 141 | (bin2bcd(tm->tm_mon + 1) << DATE_MONTH_S) 142 142 | (bin2bcd(tm->tm_mday)) 143 143 | ((tm->tm_year >= 200) << DATE_CENTURY_S),
+1 -1
drivers/scsi/isci/init.c
··· 633 633 return -ENOMEM; 634 634 pci_set_drvdata(pdev, pci_info); 635 635 636 - if (efi_enabled) 636 + if (efi_enabled(EFI_RUNTIME_SERVICES)) 637 637 orom = isci_get_efi_var(pdev); 638 638 639 639 if (!orom)
+12
drivers/ssb/driver_gpio.c
··· 196 196 197 197 return -1; 198 198 } 199 + 200 + int ssb_gpio_unregister(struct ssb_bus *bus) 201 + { 202 + if (ssb_chipco_available(&bus->chipco) || 203 + ssb_extif_available(&bus->extif)) { 204 + return gpiochip_remove(&bus->gpio); 205 + } else { 206 + SSB_WARN_ON(1); 207 + } 208 + 209 + return -1; 210 + }
+9
drivers/ssb/main.c
··· 443 443 444 444 void ssb_bus_unregister(struct ssb_bus *bus) 445 445 { 446 + int err; 447 + 448 + err = ssb_gpio_unregister(bus); 449 + if (err == -EBUSY) 450 + ssb_dprintk(KERN_ERR PFX "Some GPIOs are still in use.\n"); 451 + else if (err) 452 + ssb_dprintk(KERN_ERR PFX 453 + "Can not unregister GPIO driver: %i\n", err); 454 + 446 455 ssb_buses_lock(); 447 456 ssb_devices_unregister(bus); 448 457 list_del(&bus->list);
+5
drivers/ssb/ssb_private.h
··· 267 267 268 268 #ifdef CONFIG_SSB_DRIVER_GPIO 269 269 extern int ssb_gpio_init(struct ssb_bus *bus); 270 + extern int ssb_gpio_unregister(struct ssb_bus *bus); 270 271 #else /* CONFIG_SSB_DRIVER_GPIO */ 271 272 static inline int ssb_gpio_init(struct ssb_bus *bus) 272 273 { 273 274 return -ENOTSUPP; 275 + } 276 + static inline int ssb_gpio_unregister(struct ssb_bus *bus) 277 + { 278 + return 0; 274 279 } 275 280 #endif /* CONFIG_SSB_DRIVER_GPIO */ 276 281
+7 -1
drivers/target/target_core_device.c
··· 941 941 942 942 int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors) 943 943 { 944 + int block_size = dev->dev_attrib.block_size; 945 + 944 946 if (dev->export_count) { 945 947 pr_err("dev[%p]: Unable to change SE Device" 946 948 " fabric_max_sectors while export_count is %d\n", ··· 980 978 /* 981 979 * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks() 982 980 */ 981 + if (!block_size) { 982 + block_size = 512; 983 + pr_warn("Defaulting to 512 for zero block_size\n"); 984 + } 983 985 fabric_max_sectors = se_dev_align_max_sectors(fabric_max_sectors, 984 - dev->dev_attrib.block_size); 986 + block_size); 985 987 986 988 dev->dev_attrib.fabric_max_sectors = fabric_max_sectors; 987 989 pr_debug("dev[%p]: SE Device max_sectors changed to %u\n",
+5
drivers/target/target_core_fabric_configfs.c
··· 754 754 return -EFAULT; 755 755 } 756 756 757 + if (!(dev->dev_flags & DF_CONFIGURED)) { 758 + pr_err("se_device not configured yet, cannot port link\n"); 759 + return -ENODEV; 760 + } 761 + 757 762 tpg_ci = &lun_ci->ci_parent->ci_group->cg_item; 758 763 se_tpg = container_of(to_config_group(tpg_ci), 759 764 struct se_portal_group, tpg_group);
+8 -10
drivers/target/target_core_sbc.c
··· 58 58 buf[7] = dev->dev_attrib.block_size & 0xff; 59 59 60 60 rbuf = transport_kmap_data_sg(cmd); 61 - if (!rbuf) 62 - return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 63 - 64 - memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); 65 - transport_kunmap_data_sg(cmd); 61 + if (rbuf) { 62 + memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); 63 + transport_kunmap_data_sg(cmd); 64 + } 66 65 67 66 target_complete_cmd(cmd, GOOD); 68 67 return 0; ··· 96 97 buf[14] = 0x80; 97 98 98 99 rbuf = transport_kmap_data_sg(cmd); 99 - if (!rbuf) 100 - return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 101 - 102 - memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); 103 - transport_kunmap_data_sg(cmd); 100 + if (rbuf) { 101 + memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); 102 + transport_kunmap_data_sg(cmd); 103 + } 104 104 105 105 target_complete_cmd(cmd, GOOD); 106 106 return 0;
+11 -33
drivers/target/target_core_spc.c
··· 641 641 642 642 out: 643 643 rbuf = transport_kmap_data_sg(cmd); 644 - if (!rbuf) 645 - return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 646 - 647 - memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); 648 - transport_kunmap_data_sg(cmd); 644 + if (rbuf) { 645 + memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); 646 + transport_kunmap_data_sg(cmd); 647 + } 649 648 650 649 if (!ret) 651 650 target_complete_cmd(cmd, GOOD); ··· 850 851 { 851 852 struct se_device *dev = cmd->se_dev; 852 853 char *cdb = cmd->t_task_cdb; 853 - unsigned char *buf, *map_buf; 854 + unsigned char buf[SE_MODE_PAGE_BUF], *rbuf; 854 855 int type = dev->transport->get_device_type(dev); 855 856 int ten = (cmd->t_task_cdb[0] == MODE_SENSE_10); 856 857 bool dbd = !!(cdb[1] & 0x08); ··· 862 863 int ret; 863 864 int i; 864 865 865 - map_buf = transport_kmap_data_sg(cmd); 866 - if (!map_buf) 867 - return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 868 - /* 869 - * If SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC is not set, then we 870 - * know we actually allocated a full page. Otherwise, if the 871 - * data buffer is too small, allocate a temporary buffer so we 872 - * don't have to worry about overruns in all our INQUIRY 873 - * emulation handling. 874 - */ 875 - if (cmd->data_length < SE_MODE_PAGE_BUF && 876 - (cmd->se_cmd_flags & SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC)) { 877 - buf = kzalloc(SE_MODE_PAGE_BUF, GFP_KERNEL); 878 - if (!buf) { 879 - transport_kunmap_data_sg(cmd); 880 - return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 881 - } 882 - } else { 883 - buf = map_buf; 884 - } 866 + memset(buf, 0, SE_MODE_PAGE_BUF); 867 + 885 868 /* 886 869 * Skip over MODE DATA LENGTH + MEDIUM TYPE fields to byte 3 for 887 870 * MODE_SENSE_10 and byte 2 for MODE_SENSE (6). ··· 915 934 if (page == 0x3f) { 916 935 if (subpage != 0x00 && subpage != 0xff) { 917 936 pr_warn("MODE_SENSE: Invalid subpage code: 0x%02x\n", subpage); 918 - kfree(buf); 919 - transport_kunmap_data_sg(cmd); 920 937 return TCM_INVALID_CDB_FIELD; 921 938 } 922 939 ··· 951 972 pr_err("MODE SENSE: unimplemented page/subpage: 0x%02x/0x%02x\n", 952 973 page, subpage); 953 974 954 - transport_kunmap_data_sg(cmd); 955 975 return TCM_UNKNOWN_MODE_PAGE; 956 976 957 977 set_length: ··· 959 981 else 960 982 buf[0] = length - 1; 961 983 962 - if (buf != map_buf) { 963 - memcpy(map_buf, buf, cmd->data_length); 964 - kfree(buf); 984 + rbuf = transport_kmap_data_sg(cmd); 985 + if (rbuf) { 986 + memcpy(rbuf, buf, min_t(u32, SE_MODE_PAGE_BUF, cmd->data_length)); 987 + transport_kunmap_data_sg(cmd); 965 988 } 966 989 967 - transport_kunmap_data_sg(cmd); 968 990 target_complete_cmd(cmd, GOOD); 969 991 return 0; 970 992 }
+44
drivers/usb/core/hcd.c
··· 39 39 #include <asm/unaligned.h> 40 40 #include <linux/platform_device.h> 41 41 #include <linux/workqueue.h> 42 + #include <linux/pm_runtime.h> 42 43 43 44 #include <linux/usb.h> 44 45 #include <linux/usb/hcd.h> ··· 1026 1025 return retval; 1027 1026 } 1028 1027 1028 + /* 1029 + * usb_hcd_start_port_resume - a root-hub port is sending a resume signal 1030 + * @bus: the bus which the root hub belongs to 1031 + * @portnum: the port which is being resumed 1032 + * 1033 + * HCDs should call this function when they know that a resume signal is 1034 + * being sent to a root-hub port. The root hub will be prevented from 1035 + * going into autosuspend until usb_hcd_end_port_resume() is called. 1036 + * 1037 + * The bus's private lock must be held by the caller. 1038 + */ 1039 + void usb_hcd_start_port_resume(struct usb_bus *bus, int portnum) 1040 + { 1041 + unsigned bit = 1 << portnum; 1042 + 1043 + if (!(bus->resuming_ports & bit)) { 1044 + bus->resuming_ports |= bit; 1045 + pm_runtime_get_noresume(&bus->root_hub->dev); 1046 + } 1047 + } 1048 + EXPORT_SYMBOL_GPL(usb_hcd_start_port_resume); 1049 + 1050 + /* 1051 + * usb_hcd_end_port_resume - a root-hub port has stopped sending a resume signal 1052 + * @bus: the bus which the root hub belongs to 1053 + * @portnum: the port which is being resumed 1054 + * 1055 + * HCDs should call this function when they know that a resume signal has 1056 + * stopped being sent to a root-hub port. The root hub will be allowed to 1057 + * autosuspend again. 1058 + * 1059 + * The bus's private lock must be held by the caller. 1060 + */ 1061 + void usb_hcd_end_port_resume(struct usb_bus *bus, int portnum) 1062 + { 1063 + unsigned bit = 1 << portnum; 1064 + 1065 + if (bus->resuming_ports & bit) { 1066 + bus->resuming_ports &= ~bit; 1067 + pm_runtime_put_noidle(&bus->root_hub->dev); 1068 + } 1069 + } 1070 + EXPORT_SYMBOL_GPL(usb_hcd_end_port_resume); 1029 1071 1030 1072 /*-------------------------------------------------------------------------*/ 1031 1073
+52 -18
drivers/usb/core/hub.c
··· 2838 2838 EXPORT_SYMBOL_GPL(usb_enable_ltm); 2839 2839 2840 2840 #ifdef CONFIG_USB_SUSPEND 2841 + /* 2842 + * usb_disable_function_remotewakeup - disable usb3.0 2843 + * device's function remote wakeup 2844 + * @udev: target device 2845 + * 2846 + * Assume there's only one function on the USB 3.0 2847 + * device and disable remote wake for the first 2848 + * interface. FIXME if the interface association 2849 + * descriptor shows there's more than one function. 2850 + */ 2851 + static int usb_disable_function_remotewakeup(struct usb_device *udev) 2852 + { 2853 + return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 2854 + USB_REQ_CLEAR_FEATURE, USB_RECIP_INTERFACE, 2855 + USB_INTRF_FUNC_SUSPEND, 0, NULL, 0, 2856 + USB_CTRL_SET_TIMEOUT); 2857 + } 2841 2858 2842 2859 /* 2843 2860 * usb_port_suspend - suspend a usb device's upstream port ··· 2972 2955 dev_dbg(hub->intfdev, "can't suspend port %d, status %d\n", 2973 2956 port1, status); 2974 2957 /* paranoia: "should not happen" */ 2975 - if (udev->do_remote_wakeup) 2976 - (void) usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 2977 - USB_REQ_CLEAR_FEATURE, USB_RECIP_DEVICE, 2978 - USB_DEVICE_REMOTE_WAKEUP, 0, 2979 - NULL, 0, 2980 - USB_CTRL_SET_TIMEOUT); 2958 + if (udev->do_remote_wakeup) { 2959 + if (!hub_is_superspeed(hub->hdev)) { 2960 + (void) usb_control_msg(udev, 2961 + usb_sndctrlpipe(udev, 0), 2962 + USB_REQ_CLEAR_FEATURE, 2963 + USB_RECIP_DEVICE, 2964 + USB_DEVICE_REMOTE_WAKEUP, 0, 2965 + NULL, 0, 2966 + USB_CTRL_SET_TIMEOUT); 2967 + } else 2968 + (void) usb_disable_function_remotewakeup(udev); 2969 + 2970 + } 2981 2971 2982 2972 /* Try to enable USB2 hardware LPM again */ 2983 2973 if (udev->usb2_hw_lpm_capable == 1) ··· 3076 3052 * udev->reset_resume 3077 3053 */ 3078 3054 } else if (udev->actconfig && !udev->reset_resume) { 3079 - le16_to_cpus(&devstatus); 3080 - if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) { 3081 - status = usb_control_msg(udev, 3082 - usb_sndctrlpipe(udev, 0), 3083 - USB_REQ_CLEAR_FEATURE, 3055 + if (!hub_is_superspeed(udev->parent)) { 3056 + le16_to_cpus(&devstatus); 3057 + if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) 3058 + status = usb_control_msg(udev, 3059 + usb_sndctrlpipe(udev, 0), 3060 + USB_REQ_CLEAR_FEATURE, 3084 3061 USB_RECIP_DEVICE, 3085 - USB_DEVICE_REMOTE_WAKEUP, 0, 3086 - NULL, 0, 3087 - USB_CTRL_SET_TIMEOUT); 3088 - if (status) 3089 - dev_dbg(&udev->dev, 3090 - "disable remote wakeup, status %d\n", 3091 - status); 3062 + USB_DEVICE_REMOTE_WAKEUP, 0, 3063 + NULL, 0, 3064 + USB_CTRL_SET_TIMEOUT); 3065 + } else { 3066 + status = usb_get_status(udev, USB_RECIP_INTERFACE, 0, 3067 + &devstatus); 3068 + le16_to_cpus(&devstatus); 3069 + if (!status && devstatus & (USB_INTRF_STAT_FUNC_RW_CAP 3070 + | USB_INTRF_STAT_FUNC_RW)) 3071 + status = 3072 + usb_disable_function_remotewakeup(udev); 3092 3073 } 3074 + 3075 + if (status) 3076 + dev_dbg(&udev->dev, 3077 + "disable remote wakeup, status %d\n", 3078 + status); 3093 3079 status = 0; 3094 3080 } 3095 3081 return status;
+1
drivers/usb/host/ehci-hcd.c
··· 797 797 ehci->reset_done[i] = jiffies + msecs_to_jiffies(25); 798 798 set_bit(i, &ehci->resuming_ports); 799 799 ehci_dbg (ehci, "port %d remote wakeup\n", i + 1); 800 + usb_hcd_start_port_resume(&hcd->self, i); 800 801 mod_timer(&hcd->rh_timer, ehci->reset_done[i]); 801 802 } 802 803 }
+8 -1
drivers/usb/host/ehci-hub.c
··· 649 649 status = STS_PCD; 650 650 } 651 651 } 652 - /* FIXME autosuspend idle root hubs */ 652 + 653 + /* If a resume is in progress, make sure it can finish */ 654 + if (ehci->resuming_ports) 655 + mod_timer(&hcd->rh_timer, jiffies + msecs_to_jiffies(25)); 656 + 653 657 spin_unlock_irqrestore (&ehci->lock, flags); 654 658 return status ? retval : 0; 655 659 } ··· 855 851 /* resume signaling for 20 msec */ 856 852 ehci->reset_done[wIndex] = jiffies 857 853 + msecs_to_jiffies(20); 854 + usb_hcd_start_port_resume(&hcd->self, wIndex); 858 855 /* check the port again */ 859 856 mod_timer(&ehci_to_hcd(ehci)->rh_timer, 860 857 ehci->reset_done[wIndex]); ··· 867 862 clear_bit(wIndex, &ehci->suspended_ports); 868 863 set_bit(wIndex, &ehci->port_c_suspend); 869 864 ehci->reset_done[wIndex] = 0; 865 + usb_hcd_end_port_resume(&hcd->self, wIndex); 870 866 871 867 /* stop resume signaling */ 872 868 temp = ehci_readl(ehci, status_reg); ··· 956 950 ehci->reset_done[wIndex] = 0; 957 951 if (temp & PORT_PE) 958 952 set_bit(wIndex, &ehci->port_c_suspend); 953 + usb_hcd_end_port_resume(&hcd->self, wIndex); 959 954 } 960 955 961 956 if (temp & PORT_OC)
+30 -20
drivers/usb/host/ehci-q.c
··· 1197 1197 if (ehci->async_iaa || ehci->async_unlinking) 1198 1198 return; 1199 1199 1200 - /* Do all the waiting QHs at once */ 1201 - ehci->async_iaa = ehci->async_unlink; 1202 - ehci->async_unlink = NULL; 1203 - 1204 1200 /* If the controller isn't running, we don't have to wait for it */ 1205 1201 if (unlikely(ehci->rh_state < EHCI_RH_RUNNING)) { 1202 + 1203 + /* Do all the waiting QHs */ 1204 + ehci->async_iaa = ehci->async_unlink; 1205 + ehci->async_unlink = NULL; 1206 + 1206 1207 if (!nested) /* Avoid recursion */ 1207 1208 end_unlink_async(ehci); 1208 1209 1209 1210 /* Otherwise start a new IAA cycle */ 1210 1211 } else if (likely(ehci->rh_state == EHCI_RH_RUNNING)) { 1212 + struct ehci_qh *qh; 1213 + 1214 + /* Do only the first waiting QH (nVidia bug?) */ 1215 + qh = ehci->async_unlink; 1216 + ehci->async_iaa = qh; 1217 + ehci->async_unlink = qh->unlink_next; 1218 + qh->unlink_next = NULL; 1219 + 1211 1220 /* Make sure the unlinks are all visible to the hardware */ 1212 1221 wmb(); 1213 1222 ··· 1264 1255 } 1265 1256 } 1266 1257 1258 + static void start_unlink_async(struct ehci_hcd *ehci, struct ehci_qh *qh); 1259 + 1267 1260 static void unlink_empty_async(struct ehci_hcd *ehci) 1268 1261 { 1269 - struct ehci_qh *qh, *next; 1270 - bool stopped = (ehci->rh_state < EHCI_RH_RUNNING); 1262 + struct ehci_qh *qh; 1263 + struct ehci_qh *qh_to_unlink = NULL; 1271 1264 bool check_unlinks_later = false; 1265 + int count = 0; 1272 1266 1273 - /* Unlink all the async QHs that have been empty for a timer cycle */ 1274 - next = ehci->async->qh_next.qh; 1275 - while (next) { 1276 - qh = next; 1277 - next = qh->qh_next.qh; 1278 - 1267 + /* Find the last async QH which has been empty for a timer cycle */ 1268 + for (qh = ehci->async->qh_next.qh; qh; qh = qh->qh_next.qh) { 1279 1269 if (list_empty(&qh->qtd_list) && 1280 1270 qh->qh_state == QH_STATE_LINKED) { 1281 - if (!stopped && qh->unlink_cycle == 1282 - ehci->async_unlink_cycle) 1271 + ++count; 1272 + if (qh->unlink_cycle == ehci->async_unlink_cycle) 1283 1273 check_unlinks_later = true; 1284 1274 else 1285 - single_unlink_async(ehci, qh); 1275 + qh_to_unlink = qh; 1286 1276 } 1287 1277 } 1288 1278 1289 - /* Start a new IAA cycle if any QHs are waiting for it */ 1290 - if (ehci->async_unlink) 1291 - start_iaa_cycle(ehci, false); 1279 + /* If nothing else is being unlinked, unlink the last empty QH */ 1280 + if (!ehci->async_iaa && !ehci->async_unlink && qh_to_unlink) { 1281 + start_unlink_async(ehci, qh_to_unlink); 1282 + --count; 1283 + } 1292 1284 1293 - /* QHs that haven't been empty for long enough will be handled later */ 1294 - if (check_unlinks_later) { 1285 + /* Other QHs will be handled later */ 1286 + if (count > 0) { 1295 1287 ehci_enable_event(ehci, EHCI_HRTIMER_ASYNC_UNLINKS, true); 1296 1288 ++ehci->async_unlink_cycle; 1297 1289 }
+6 -3
drivers/usb/host/ehci-sched.c
··· 213 213 } 214 214 215 215 static const unsigned char 216 - max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 30, 0 }; 216 + max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 125, 25 }; 217 217 218 218 /* carryover low/fullspeed bandwidth that crosses uframe boundries */ 219 219 static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8]) ··· 2212 2212 } 2213 2213 ehci->now_frame = now_frame; 2214 2214 2215 + frame = ehci->last_iso_frame; 2215 2216 for (;;) { 2216 2217 union ehci_shadow q, *q_p; 2217 2218 __hc32 type, *hw_p; 2218 2219 2219 - frame = ehci->last_iso_frame; 2220 2220 restart: 2221 2221 /* scan each element in frame's queue for completions */ 2222 2222 q_p = &ehci->pshadow [frame]; ··· 2321 2321 /* Stop when we have reached the current frame */ 2322 2322 if (frame == now_frame) 2323 2323 break; 2324 - ehci->last_iso_frame = (frame + 1) & fmask; 2324 + 2325 + /* The last frame may still have active siTDs */ 2326 + ehci->last_iso_frame = frame; 2327 + frame = (frame + 1) & fmask; 2325 2328 } 2326 2329 }
+15 -14
drivers/usb/host/ehci-timer.c
··· 113 113 114 114 if (want != actual) { 115 115 116 - /* Poll again later, but give up after about 20 ms */ 117 - if (ehci->ASS_poll_count++ < 20) { 118 - ehci_enable_event(ehci, EHCI_HRTIMER_POLL_ASS, true); 119 - return; 120 - } 121 - ehci_dbg(ehci, "Waited too long for the async schedule status (%x/%x), giving up\n", 122 - want, actual); 116 + /* Poll again later */ 117 + ehci_enable_event(ehci, EHCI_HRTIMER_POLL_ASS, true); 118 + ++ehci->ASS_poll_count; 119 + return; 123 120 } 121 + 122 + if (ehci->ASS_poll_count > 20) 123 + ehci_dbg(ehci, "ASS poll count reached %d\n", 124 + ehci->ASS_poll_count); 124 125 ehci->ASS_poll_count = 0; 125 126 126 127 /* The status is up-to-date; restart or stop the schedule as needed */ ··· 160 159 161 160 if (want != actual) { 162 161 163 - /* Poll again later, but give up after about 20 ms */ 164 - if (ehci->PSS_poll_count++ < 20) { 165 - ehci_enable_event(ehci, EHCI_HRTIMER_POLL_PSS, true); 166 - return; 167 - } 168 - ehci_dbg(ehci, "Waited too long for the periodic schedule status (%x/%x), giving up\n", 169 - want, actual); 162 + /* Poll again later */ 163 + ehci_enable_event(ehci, EHCI_HRTIMER_POLL_PSS, true); 164 + return; 170 165 } 166 + 167 + if (ehci->PSS_poll_count > 20) 168 + ehci_dbg(ehci, "PSS poll count reached %d\n", 169 + ehci->PSS_poll_count); 171 170 ehci->PSS_poll_count = 0; 172 171 173 172 /* The status is up-to-date; restart or stop the schedule as needed */
+1
drivers/usb/host/pci-quirks.c
··· 780 780 "defaulting to EHCI.\n"); 781 781 dev_warn(&xhci_pdev->dev, 782 782 "USB 3.0 devices will work at USB 2.0 speeds.\n"); 783 + usb_disable_xhci_ports(xhci_pdev); 783 784 return; 784 785 } 785 786
+3
drivers/usb/host/uhci-hub.c
··· 116 116 } 117 117 } 118 118 clear_bit(port, &uhci->resuming_ports); 119 + usb_hcd_end_port_resume(&uhci_to_hcd(uhci)->self, port); 119 120 } 120 121 121 122 /* Wait for the UHCI controller in HP's iLO2 server management chip. ··· 168 167 set_bit(port, &uhci->resuming_ports); 169 168 uhci->ports_timeout = jiffies + 170 169 msecs_to_jiffies(25); 170 + usb_hcd_start_port_resume( 171 + &uhci_to_hcd(uhci)->self, port); 171 172 172 173 /* Make sure we see the port again 173 174 * after the resuming period is over. */
+9 -4
drivers/usb/host/xhci-ring.c
··· 1698 1698 faked_port_index + 1); 1699 1699 if (slot_id && xhci->devs[slot_id]) 1700 1700 xhci_ring_device(xhci, slot_id); 1701 - if (bus_state->port_remote_wakeup && (1 << faked_port_index)) { 1701 + if (bus_state->port_remote_wakeup & (1 << faked_port_index)) { 1702 1702 bus_state->port_remote_wakeup &= 1703 1703 ~(1 << faked_port_index); 1704 1704 xhci_test_and_clear_bit(xhci, port_array, ··· 2589 2589 (trb_comp_code != COMP_STALL && 2590 2590 trb_comp_code != COMP_BABBLE)) 2591 2591 xhci_urb_free_priv(xhci, urb_priv); 2592 + else 2593 + kfree(urb_priv); 2592 2594 2593 2595 usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb); 2594 2596 if ((urb->actual_length != urb->transfer_buffer_length && ··· 3110 3108 * running_total. 3111 3109 */ 3112 3110 packets_transferred = (running_total + trb_buff_len) / 3113 - usb_endpoint_maxp(&urb->ep->desc); 3111 + GET_MAX_PACKET(usb_endpoint_maxp(&urb->ep->desc)); 3114 3112 3115 3113 if ((total_packet_count - packets_transferred) > 31) 3116 3114 return 31 << 17; ··· 3644 3642 td_len = urb->iso_frame_desc[i].length; 3645 3643 td_remain_len = td_len; 3646 3644 total_packet_count = DIV_ROUND_UP(td_len, 3647 - usb_endpoint_maxp(&urb->ep->desc)); 3645 + GET_MAX_PACKET( 3646 + usb_endpoint_maxp(&urb->ep->desc))); 3648 3647 /* A zero-length transfer still involves at least one packet. */ 3649 3648 if (total_packet_count == 0) 3650 3649 total_packet_count++; ··· 3667 3664 td = urb_priv->td[i]; 3668 3665 for (j = 0; j < trbs_per_td; j++) { 3669 3666 u32 remainder = 0; 3670 - field = TRB_TBC(burst_count) | TRB_TLBPC(residue); 3667 + field = 0; 3671 3668 3672 3669 if (first_trb) { 3670 + field = TRB_TBC(burst_count) | 3671 + TRB_TLBPC(residue); 3673 3672 /* Queue the isoc TRB */ 3674 3673 field |= TRB_TYPE(TRB_ISOC); 3675 3674 /* Assume URB_ISO_ASAP is set */
+1
drivers/usb/serial/cp210x.c
··· 60 60 { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */ 61 61 { USB_DEVICE(0x0FCF, 0x1004) }, /* Dynastream ANT2USB */ 62 62 { USB_DEVICE(0x0FCF, 0x1006) }, /* Dynastream ANT development board */ 63 + { USB_DEVICE(0x0FDE, 0xCA05) }, /* OWL Wireless Electricity Monitor CM-160 */ 63 64 { USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */ 64 65 { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */ 65 66 { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */
+2
drivers/usb/serial/ftdi_sio.c
··· 584 584 /* 585 585 * ELV devices: 586 586 */ 587 + { USB_DEVICE(FTDI_ELV_VID, FTDI_ELV_WS300_PID) }, 587 588 { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) }, 588 589 { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) }, 589 590 { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) }, ··· 671 670 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) }, 672 671 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) }, 673 672 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, 673 + { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, 674 674 { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, 675 675 { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, 676 676 { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) },
+8 -1
drivers/usb/serial/ftdi_sio_ids.h
··· 147 147 #define XSENS_CONVERTER_6_PID 0xD38E 148 148 #define XSENS_CONVERTER_7_PID 0xD38F 149 149 150 + /** 151 + * Zolix (www.zolix.com.cb) product ids 152 + */ 153 + #define FTDI_OMNI1509 0xD491 /* Omni1509 embedded USB-serial */ 154 + 150 155 /* 151 156 * NDI (www.ndigital.com) product ids 152 157 */ ··· 209 204 210 205 /* 211 206 * ELV USB devices submitted by Christian Abt of ELV (www.elv.de). 212 - * All of these devices use FTDI's vendor ID (0x0403). 207 + * Almost all of these devices use FTDI's vendor ID (0x0403). 213 208 * Further IDs taken from ELV Windows .inf file. 214 209 * 215 210 * The previously included PID for the UO 100 module was incorrect. ··· 217 212 * 218 213 * Armin Laeuger originally sent the PID for the UM 100 module. 219 214 */ 215 + #define FTDI_ELV_VID 0x1B1F /* ELV AG */ 216 + #define FTDI_ELV_WS300_PID 0xC006 /* eQ3 WS 300 PC II */ 220 217 #define FTDI_ELV_USR_PID 0xE000 /* ELV Universal-Sound-Recorder */ 221 218 #define FTDI_ELV_MSM1_PID 0xE001 /* ELV Mini-Sound-Modul */ 222 219 #define FTDI_ELV_KL100_PID 0xE002 /* ELV Kfz-Leistungsmesser KL 100 */
+13
drivers/usb/serial/option.c
··· 242 242 #define TELIT_PRODUCT_CC864_DUAL 0x1005 243 243 #define TELIT_PRODUCT_CC864_SINGLE 0x1006 244 244 #define TELIT_PRODUCT_DE910_DUAL 0x1010 245 + #define TELIT_PRODUCT_LE920 0x1200 245 246 246 247 /* ZTE PRODUCTS */ 247 248 #define ZTE_VENDOR_ID 0x19d2 ··· 454 453 #define TPLINK_VENDOR_ID 0x2357 455 454 #define TPLINK_PRODUCT_MA180 0x0201 456 455 456 + /* Changhong products */ 457 + #define CHANGHONG_VENDOR_ID 0x2077 458 + #define CHANGHONG_PRODUCT_CH690 0x7001 459 + 457 460 /* some devices interfaces need special handling due to a number of reasons */ 458 461 enum option_blacklist_reason { 459 462 OPTION_BLACKLIST_NONE = 0, ··· 537 532 538 533 static const struct option_blacklist_info zte_1255_blacklist = { 539 534 .reserved = BIT(3) | BIT(4), 535 + }; 536 + 537 + static const struct option_blacklist_info telit_le920_blacklist = { 538 + .sendsetup = BIT(0), 539 + .reserved = BIT(1) | BIT(5), 540 540 }; 541 541 542 542 static const struct usb_device_id option_ids[] = { ··· 794 784 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_DUAL) }, 795 785 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) }, 796 786 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) }, 787 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920), 788 + .driver_info = (kernel_ulong_t)&telit_le920_blacklist }, 797 789 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ 798 790 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff), 799 791 .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, ··· 1330 1318 { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) }, 1331 1319 { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), 1332 1320 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1321 + { USB_DEVICE(CHANGHONG_VENDOR_ID, CHANGHONG_PRODUCT_CH690) }, 1333 1322 { } /* Terminating entry */ 1334 1323 }; 1335 1324 MODULE_DEVICE_TABLE(usb, option_ids);
+1
drivers/usb/serial/qcserial.c
··· 53 53 {DEVICE_G1K(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ 54 54 {DEVICE_G1K(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ 55 55 {DEVICE_G1K(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ 56 + {DEVICE_G1K(0x1bc7, 0x900e)}, /* Telit Gobi QDL device */ 56 57 57 58 /* Gobi 2000 devices */ 58 59 {USB_DEVICE(0x1410, 0xa010)}, /* Novatel Gobi 2000 QDL device */
+74 -2
drivers/usb/storage/initializers.c
··· 92 92 return 0; 93 93 } 94 94 95 - /* This places the HUAWEI E220 devices in multi-port mode */ 96 - int usb_stor_huawei_e220_init(struct us_data *us) 95 + /* This places the HUAWEI usb dongles in multi-port mode */ 96 + static int usb_stor_huawei_feature_init(struct us_data *us) 97 97 { 98 98 int result; 99 99 ··· 103 103 0x01, 0x0, NULL, 0x0, 1000); 104 104 US_DEBUGP("Huawei mode set result is %d\n", result); 105 105 return 0; 106 + } 107 + 108 + /* 109 + * It will send a scsi switch command called rewind' to huawei dongle. 110 + * When the dongle receives this command at the first time, 111 + * it will reboot immediately. After rebooted, it will ignore this command. 112 + * So it is unnecessary to read its response. 113 + */ 114 + static int usb_stor_huawei_scsi_init(struct us_data *us) 115 + { 116 + int result = 0; 117 + int act_len = 0; 118 + struct bulk_cb_wrap *bcbw = (struct bulk_cb_wrap *) us->iobuf; 119 + char rewind_cmd[] = {0x11, 0x06, 0x20, 0x00, 0x00, 0x01, 0x01, 0x00, 120 + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 121 + 122 + bcbw->Signature = cpu_to_le32(US_BULK_CB_SIGN); 123 + bcbw->Tag = 0; 124 + bcbw->DataTransferLength = 0; 125 + bcbw->Flags = bcbw->Lun = 0; 126 + bcbw->Length = sizeof(rewind_cmd); 127 + memset(bcbw->CDB, 0, sizeof(bcbw->CDB)); 128 + memcpy(bcbw->CDB, rewind_cmd, sizeof(rewind_cmd)); 129 + 130 + result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcbw, 131 + US_BULK_CB_WRAP_LEN, &act_len); 132 + US_DEBUGP("transfer actual length=%d, result=%d\n", act_len, result); 133 + return result; 134 + } 135 + 136 + /* 137 + * It tries to find the supported Huawei USB dongles. 138 + * In Huawei, they assign the following product IDs 139 + * for all of their mobile broadband dongles, 140 + * including the new dongles in the future. 141 + * So if the product ID is not included in this list, 142 + * it means it is not Huawei's mobile broadband dongles. 143 + */ 144 + static int usb_stor_huawei_dongles_pid(struct us_data *us) 145 + { 146 + struct usb_interface_descriptor *idesc; 147 + int idProduct; 148 + 149 + idesc = &us->pusb_intf->cur_altsetting->desc; 150 + idProduct = us->pusb_dev->descriptor.idProduct; 151 + /* The first port is CDROM, 152 + * means the dongle in the single port mode, 153 + * and a switch command is required to be sent. */ 154 + if (idesc && idesc->bInterfaceNumber == 0) { 155 + if ((idProduct == 0x1001) 156 + || (idProduct == 0x1003) 157 + || (idProduct == 0x1004) 158 + || (idProduct >= 0x1401 && idProduct <= 0x1500) 159 + || (idProduct >= 0x1505 && idProduct <= 0x1600) 160 + || (idProduct >= 0x1c02 && idProduct <= 0x2202)) { 161 + return 1; 162 + } 163 + } 164 + return 0; 165 + } 166 + 167 + int usb_stor_huawei_init(struct us_data *us) 168 + { 169 + int result = 0; 170 + 171 + if (usb_stor_huawei_dongles_pid(us)) { 172 + if (us->pusb_dev->descriptor.idProduct >= 0x1446) 173 + result = usb_stor_huawei_scsi_init(us); 174 + else 175 + result = usb_stor_huawei_feature_init(us); 176 + } 177 + return result; 106 178 }
+2 -2
drivers/usb/storage/initializers.h
··· 46 46 * flash reader */ 47 47 int usb_stor_ucr61s2b_init(struct us_data *us); 48 48 49 - /* This places the HUAWEI E220 devices in multi-port mode */ 50 - int usb_stor_huawei_e220_init(struct us_data *us); 49 + /* This places the HUAWEI usb dongles in multi-port mode */ 50 + int usb_stor_huawei_init(struct us_data *us);
+2 -327
drivers/usb/storage/unusual_devs.h
··· 1527 1527 /* Reported by fangxiaozhi <huananhu@huawei.com> 1528 1528 * This brings the HUAWEI data card devices into multi-port mode 1529 1529 */ 1530 - UNUSUAL_DEV( 0x12d1, 0x1001, 0x0000, 0x0000, 1530 + UNUSUAL_VENDOR_INTF(0x12d1, 0x08, 0x06, 0x50, 1531 1531 "HUAWEI MOBILE", 1532 1532 "Mass Storage", 1533 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1534 - 0), 1535 - UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0x0000, 1536 - "HUAWEI MOBILE", 1537 - "Mass Storage", 1538 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1539 - 0), 1540 - UNUSUAL_DEV( 0x12d1, 0x1004, 0x0000, 0x0000, 1541 - "HUAWEI MOBILE", 1542 - "Mass Storage", 1543 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1544 - 0), 1545 - UNUSUAL_DEV( 0x12d1, 0x1401, 0x0000, 0x0000, 1546 - "HUAWEI MOBILE", 1547 - "Mass Storage", 1548 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1549 - 0), 1550 - UNUSUAL_DEV( 0x12d1, 0x1402, 0x0000, 0x0000, 1551 - "HUAWEI MOBILE", 1552 - "Mass Storage", 1553 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1554 - 0), 1555 - UNUSUAL_DEV( 0x12d1, 0x1403, 0x0000, 0x0000, 1556 - "HUAWEI MOBILE", 1557 - "Mass Storage", 1558 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1559 - 0), 1560 - UNUSUAL_DEV( 0x12d1, 0x1404, 0x0000, 0x0000, 1561 - "HUAWEI MOBILE", 1562 - "Mass Storage", 1563 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1564 - 0), 1565 - UNUSUAL_DEV( 0x12d1, 0x1405, 0x0000, 0x0000, 1566 - "HUAWEI MOBILE", 1567 - "Mass Storage", 1568 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1569 - 0), 1570 - UNUSUAL_DEV( 0x12d1, 0x1406, 0x0000, 0x0000, 1571 - "HUAWEI MOBILE", 1572 - "Mass Storage", 1573 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1574 - 0), 1575 - UNUSUAL_DEV( 0x12d1, 0x1407, 0x0000, 0x0000, 1576 - "HUAWEI MOBILE", 1577 - "Mass Storage", 1578 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1579 - 0), 1580 - UNUSUAL_DEV( 0x12d1, 0x1408, 0x0000, 0x0000, 1581 - "HUAWEI MOBILE", 1582 - "Mass Storage", 1583 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1584 - 0), 1585 - UNUSUAL_DEV( 0x12d1, 0x1409, 0x0000, 0x0000, 1586 - "HUAWEI MOBILE", 1587 - "Mass Storage", 1588 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1589 - 0), 1590 - UNUSUAL_DEV( 0x12d1, 0x140A, 0x0000, 0x0000, 1591 - "HUAWEI MOBILE", 1592 - "Mass Storage", 1593 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1594 - 0), 1595 - UNUSUAL_DEV( 0x12d1, 0x140B, 0x0000, 0x0000, 1596 - "HUAWEI MOBILE", 1597 - "Mass Storage", 1598 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1599 - 0), 1600 - UNUSUAL_DEV( 0x12d1, 0x140C, 0x0000, 0x0000, 1601 - "HUAWEI MOBILE", 1602 - "Mass Storage", 1603 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1604 - 0), 1605 - UNUSUAL_DEV( 0x12d1, 0x140D, 0x0000, 0x0000, 1606 - "HUAWEI MOBILE", 1607 - "Mass Storage", 1608 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1609 - 0), 1610 - UNUSUAL_DEV( 0x12d1, 0x140E, 0x0000, 0x0000, 1611 - "HUAWEI MOBILE", 1612 - "Mass Storage", 1613 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1614 - 0), 1615 - UNUSUAL_DEV( 0x12d1, 0x140F, 0x0000, 0x0000, 1616 - "HUAWEI MOBILE", 1617 - "Mass Storage", 1618 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1619 - 0), 1620 - UNUSUAL_DEV( 0x12d1, 0x1410, 0x0000, 0x0000, 1621 - "HUAWEI MOBILE", 1622 - "Mass Storage", 1623 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1624 - 0), 1625 - UNUSUAL_DEV( 0x12d1, 0x1411, 0x0000, 0x0000, 1626 - "HUAWEI MOBILE", 1627 - "Mass Storage", 1628 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1629 - 0), 1630 - UNUSUAL_DEV( 0x12d1, 0x1412, 0x0000, 0x0000, 1631 - "HUAWEI MOBILE", 1632 - "Mass Storage", 1633 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1634 - 0), 1635 - UNUSUAL_DEV( 0x12d1, 0x1413, 0x0000, 0x0000, 1636 - "HUAWEI MOBILE", 1637 - "Mass Storage", 1638 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1639 - 0), 1640 - UNUSUAL_DEV( 0x12d1, 0x1414, 0x0000, 0x0000, 1641 - "HUAWEI MOBILE", 1642 - "Mass Storage", 1643 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1644 - 0), 1645 - UNUSUAL_DEV( 0x12d1, 0x1415, 0x0000, 0x0000, 1646 - "HUAWEI MOBILE", 1647 - "Mass Storage", 1648 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1649 - 0), 1650 - UNUSUAL_DEV( 0x12d1, 0x1416, 0x0000, 0x0000, 1651 - "HUAWEI MOBILE", 1652 - "Mass Storage", 1653 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1654 - 0), 1655 - UNUSUAL_DEV( 0x12d1, 0x1417, 0x0000, 0x0000, 1656 - "HUAWEI MOBILE", 1657 - "Mass Storage", 1658 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1659 - 0), 1660 - UNUSUAL_DEV( 0x12d1, 0x1418, 0x0000, 0x0000, 1661 - "HUAWEI MOBILE", 1662 - "Mass Storage", 1663 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1664 - 0), 1665 - UNUSUAL_DEV( 0x12d1, 0x1419, 0x0000, 0x0000, 1666 - "HUAWEI MOBILE", 1667 - "Mass Storage", 1668 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1669 - 0), 1670 - UNUSUAL_DEV( 0x12d1, 0x141A, 0x0000, 0x0000, 1671 - "HUAWEI MOBILE", 1672 - "Mass Storage", 1673 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1674 - 0), 1675 - UNUSUAL_DEV( 0x12d1, 0x141B, 0x0000, 0x0000, 1676 - "HUAWEI MOBILE", 1677 - "Mass Storage", 1678 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1679 - 0), 1680 - UNUSUAL_DEV( 0x12d1, 0x141C, 0x0000, 0x0000, 1681 - "HUAWEI MOBILE", 1682 - "Mass Storage", 1683 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1684 - 0), 1685 - UNUSUAL_DEV( 0x12d1, 0x141D, 0x0000, 0x0000, 1686 - "HUAWEI MOBILE", 1687 - "Mass Storage", 1688 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1689 - 0), 1690 - UNUSUAL_DEV( 0x12d1, 0x141E, 0x0000, 0x0000, 1691 - "HUAWEI MOBILE", 1692 - "Mass Storage", 1693 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1694 - 0), 1695 - UNUSUAL_DEV( 0x12d1, 0x141F, 0x0000, 0x0000, 1696 - "HUAWEI MOBILE", 1697 - "Mass Storage", 1698 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1699 - 0), 1700 - UNUSUAL_DEV( 0x12d1, 0x1420, 0x0000, 0x0000, 1701 - "HUAWEI MOBILE", 1702 - "Mass Storage", 1703 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1704 - 0), 1705 - UNUSUAL_DEV( 0x12d1, 0x1421, 0x0000, 0x0000, 1706 - "HUAWEI MOBILE", 1707 - "Mass Storage", 1708 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1709 - 0), 1710 - UNUSUAL_DEV( 0x12d1, 0x1422, 0x0000, 0x0000, 1711 - "HUAWEI MOBILE", 1712 - "Mass Storage", 1713 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1714 - 0), 1715 - UNUSUAL_DEV( 0x12d1, 0x1423, 0x0000, 0x0000, 1716 - "HUAWEI MOBILE", 1717 - "Mass Storage", 1718 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1719 - 0), 1720 - UNUSUAL_DEV( 0x12d1, 0x1424, 0x0000, 0x0000, 1721 - "HUAWEI MOBILE", 1722 - "Mass Storage", 1723 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1724 - 0), 1725 - UNUSUAL_DEV( 0x12d1, 0x1425, 0x0000, 0x0000, 1726 - "HUAWEI MOBILE", 1727 - "Mass Storage", 1728 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1729 - 0), 1730 - UNUSUAL_DEV( 0x12d1, 0x1426, 0x0000, 0x0000, 1731 - "HUAWEI MOBILE", 1732 - "Mass Storage", 1733 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1734 - 0), 1735 - UNUSUAL_DEV( 0x12d1, 0x1427, 0x0000, 0x0000, 1736 - "HUAWEI MOBILE", 1737 - "Mass Storage", 1738 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1739 - 0), 1740 - UNUSUAL_DEV( 0x12d1, 0x1428, 0x0000, 0x0000, 1741 - "HUAWEI MOBILE", 1742 - "Mass Storage", 1743 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1744 - 0), 1745 - UNUSUAL_DEV( 0x12d1, 0x1429, 0x0000, 0x0000, 1746 - "HUAWEI MOBILE", 1747 - "Mass Storage", 1748 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1749 - 0), 1750 - UNUSUAL_DEV( 0x12d1, 0x142A, 0x0000, 0x0000, 1751 - "HUAWEI MOBILE", 1752 - "Mass Storage", 1753 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1754 - 0), 1755 - UNUSUAL_DEV( 0x12d1, 0x142B, 0x0000, 0x0000, 1756 - "HUAWEI MOBILE", 1757 - "Mass Storage", 1758 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1759 - 0), 1760 - UNUSUAL_DEV( 0x12d1, 0x142C, 0x0000, 0x0000, 1761 - "HUAWEI MOBILE", 1762 - "Mass Storage", 1763 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1764 - 0), 1765 - UNUSUAL_DEV( 0x12d1, 0x142D, 0x0000, 0x0000, 1766 - "HUAWEI MOBILE", 1767 - "Mass Storage", 1768 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1769 - 0), 1770 - UNUSUAL_DEV( 0x12d1, 0x142E, 0x0000, 0x0000, 1771 - "HUAWEI MOBILE", 1772 - "Mass Storage", 1773 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1774 - 0), 1775 - UNUSUAL_DEV( 0x12d1, 0x142F, 0x0000, 0x0000, 1776 - "HUAWEI MOBILE", 1777 - "Mass Storage", 1778 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1779 - 0), 1780 - UNUSUAL_DEV( 0x12d1, 0x1430, 0x0000, 0x0000, 1781 - "HUAWEI MOBILE", 1782 - "Mass Storage", 1783 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1784 - 0), 1785 - UNUSUAL_DEV( 0x12d1, 0x1431, 0x0000, 0x0000, 1786 - "HUAWEI MOBILE", 1787 - "Mass Storage", 1788 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1789 - 0), 1790 - UNUSUAL_DEV( 0x12d1, 0x1432, 0x0000, 0x0000, 1791 - "HUAWEI MOBILE", 1792 - "Mass Storage", 1793 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1794 - 0), 1795 - UNUSUAL_DEV( 0x12d1, 0x1433, 0x0000, 0x0000, 1796 - "HUAWEI MOBILE", 1797 - "Mass Storage", 1798 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1799 - 0), 1800 - UNUSUAL_DEV( 0x12d1, 0x1434, 0x0000, 0x0000, 1801 - "HUAWEI MOBILE", 1802 - "Mass Storage", 1803 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1804 - 0), 1805 - UNUSUAL_DEV( 0x12d1, 0x1435, 0x0000, 0x0000, 1806 - "HUAWEI MOBILE", 1807 - "Mass Storage", 1808 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1809 - 0), 1810 - UNUSUAL_DEV( 0x12d1, 0x1436, 0x0000, 0x0000, 1811 - "HUAWEI MOBILE", 1812 - "Mass Storage", 1813 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1814 - 0), 1815 - UNUSUAL_DEV( 0x12d1, 0x1437, 0x0000, 0x0000, 1816 - "HUAWEI MOBILE", 1817 - "Mass Storage", 1818 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1819 - 0), 1820 - UNUSUAL_DEV( 0x12d1, 0x1438, 0x0000, 0x0000, 1821 - "HUAWEI MOBILE", 1822 - "Mass Storage", 1823 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1824 - 0), 1825 - UNUSUAL_DEV( 0x12d1, 0x1439, 0x0000, 0x0000, 1826 - "HUAWEI MOBILE", 1827 - "Mass Storage", 1828 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1829 - 0), 1830 - UNUSUAL_DEV( 0x12d1, 0x143A, 0x0000, 0x0000, 1831 - "HUAWEI MOBILE", 1832 - "Mass Storage", 1833 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1834 - 0), 1835 - UNUSUAL_DEV( 0x12d1, 0x143B, 0x0000, 0x0000, 1836 - "HUAWEI MOBILE", 1837 - "Mass Storage", 1838 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1839 - 0), 1840 - UNUSUAL_DEV( 0x12d1, 0x143C, 0x0000, 0x0000, 1841 - "HUAWEI MOBILE", 1842 - "Mass Storage", 1843 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1844 - 0), 1845 - UNUSUAL_DEV( 0x12d1, 0x143D, 0x0000, 0x0000, 1846 - "HUAWEI MOBILE", 1847 - "Mass Storage", 1848 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1849 - 0), 1850 - UNUSUAL_DEV( 0x12d1, 0x143E, 0x0000, 0x0000, 1851 - "HUAWEI MOBILE", 1852 - "Mass Storage", 1853 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1854 - 0), 1855 - UNUSUAL_DEV( 0x12d1, 0x143F, 0x0000, 0x0000, 1856 - "HUAWEI MOBILE", 1857 - "Mass Storage", 1858 - USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, 1533 + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_init, 1859 1534 0), 1860 1535 1861 1536 /* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */
+12
drivers/usb/storage/usb.c
··· 120 120 .useTransport = use_transport, \ 121 121 } 122 122 123 + #define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \ 124 + vendor_name, product_name, use_protocol, use_transport, \ 125 + init_function, Flags) \ 126 + { \ 127 + .vendorName = vendor_name, \ 128 + .productName = product_name, \ 129 + .useProtocol = use_protocol, \ 130 + .useTransport = use_transport, \ 131 + .initFunction = init_function, \ 132 + } 133 + 123 134 static struct us_unusual_dev us_unusual_dev_list[] = { 124 135 # include "unusual_devs.h" 125 136 { } /* Terminating entry */ ··· 142 131 #undef UNUSUAL_DEV 143 132 #undef COMPLIANT_DEV 144 133 #undef USUAL_DEV 134 + #undef UNUSUAL_VENDOR_INTF 145 135 146 136 #ifdef CONFIG_LOCKDEP 147 137
+15
drivers/usb/storage/usual-tables.c
··· 41 41 #define USUAL_DEV(useProto, useTrans) \ 42 42 { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) } 43 43 44 + /* Define the device is matched with Vendor ID and interface descriptors */ 45 + #define UNUSUAL_VENDOR_INTF(id_vendor, cl, sc, pr, \ 46 + vendorName, productName, useProtocol, useTransport, \ 47 + initFunction, flags) \ 48 + { \ 49 + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ 50 + | USB_DEVICE_ID_MATCH_VENDOR, \ 51 + .idVendor = (id_vendor), \ 52 + .bInterfaceClass = (cl), \ 53 + .bInterfaceSubClass = (sc), \ 54 + .bInterfaceProtocol = (pr), \ 55 + .driver_info = (flags) \ 56 + } 57 + 44 58 struct usb_device_id usb_storage_usb_ids[] = { 45 59 # include "unusual_devs.h" 46 60 { } /* Terminating entry */ ··· 64 50 #undef UNUSUAL_DEV 65 51 #undef COMPLIANT_DEV 66 52 #undef USUAL_DEV 53 + #undef UNUSUAL_VENDOR_INTF 67 54 68 55 /* 69 56 * The table of devices to ignore
+1 -3
drivers/vhost/tcm_vhost.c
··· 575 575 576 576 /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */ 577 577 tv_tpg = vs->vs_tpg; 578 - if (unlikely(!tv_tpg)) { 579 - pr_err("%s endpoint not set\n", __func__); 578 + if (unlikely(!tv_tpg)) 580 579 return; 581 - } 582 580 583 581 mutex_lock(&vq->mutex); 584 582 vhost_disable_notify(&vs->dev, vq);
+2 -2
drivers/xen/events.c
··· 840 840 841 841 if (irq == -1) { 842 842 irq = xen_allocate_irq_dynamic(); 843 - if (irq == -1) 843 + if (irq < 0) 844 844 goto out; 845 845 846 846 irq_set_chip_and_handler_name(irq, &xen_dynamic_chip, ··· 944 944 945 945 if (irq == -1) { 946 946 irq = xen_allocate_irq_dynamic(); 947 - if (irq == -1) 947 + if (irq < 0) 948 948 goto out; 949 949 950 950 irq_set_chip_and_handler_name(irq, &xen_percpu_chip,
+7 -7
drivers/xen/xen-pciback/pciback_ops.c
··· 135 135 struct pci_dev *dev, struct xen_pci_op *op) 136 136 { 137 137 struct xen_pcibk_dev_data *dev_data; 138 - int otherend = pdev->xdev->otherend_id; 139 138 int status; 140 139 141 140 if (unlikely(verbose_request)) ··· 143 144 status = pci_enable_msi(dev); 144 145 145 146 if (status) { 146 - printk(KERN_ERR "error enable msi for guest %x status %x\n", 147 - otherend, status); 147 + pr_warn_ratelimited(DRV_NAME ": %s: error enabling MSI for guest %u: err %d\n", 148 + pci_name(dev), pdev->xdev->otherend_id, 149 + status); 148 150 op->value = 0; 149 151 return XEN_PCI_ERR_op_failed; 150 152 } ··· 223 223 pci_name(dev), i, 224 224 op->msix_entries[i].vector); 225 225 } 226 - } else { 227 - printk(KERN_WARNING DRV_NAME ": %s: failed to enable MSI-X: err %d!\n", 228 - pci_name(dev), result); 229 - } 226 + } else 227 + pr_warn_ratelimited(DRV_NAME ": %s: error enabling MSI-X for guest %u: err %d!\n", 228 + pci_name(dev), pdev->xdev->otherend_id, 229 + result); 230 230 kfree(entries); 231 231 232 232 op->value = result;
+10 -12
fs/btrfs/extent-tree.c
··· 4534 4534 unsigned nr_extents = 0; 4535 4535 int extra_reserve = 0; 4536 4536 enum btrfs_reserve_flush_enum flush = BTRFS_RESERVE_FLUSH_ALL; 4537 - int ret; 4537 + int ret = 0; 4538 4538 bool delalloc_lock = true; 4539 4539 4540 4540 /* If we are a free space inode we need to not flush since we will be in ··· 4579 4579 csum_bytes = BTRFS_I(inode)->csum_bytes; 4580 4580 spin_unlock(&BTRFS_I(inode)->lock); 4581 4581 4582 - if (root->fs_info->quota_enabled) { 4582 + if (root->fs_info->quota_enabled) 4583 4583 ret = btrfs_qgroup_reserve(root, num_bytes + 4584 4584 nr_extents * root->leafsize); 4585 - if (ret) { 4586 - spin_lock(&BTRFS_I(inode)->lock); 4587 - calc_csum_metadata_size(inode, num_bytes, 0); 4588 - spin_unlock(&BTRFS_I(inode)->lock); 4589 - if (delalloc_lock) 4590 - mutex_unlock(&BTRFS_I(inode)->delalloc_mutex); 4591 - return ret; 4592 - } 4593 - } 4594 4585 4595 - ret = reserve_metadata_bytes(root, block_rsv, to_reserve, flush); 4586 + /* 4587 + * ret != 0 here means the qgroup reservation failed, we go straight to 4588 + * the shared error handling then. 4589 + */ 4590 + if (ret == 0) 4591 + ret = reserve_metadata_bytes(root, block_rsv, 4592 + to_reserve, flush); 4593 + 4596 4594 if (ret) { 4597 4595 u64 to_free = 0; 4598 4596 unsigned dropped;
+2 -1
fs/btrfs/extent_map.c
··· 288 288 void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em) 289 289 { 290 290 clear_bit(EXTENT_FLAG_LOGGING, &em->flags); 291 - try_merge_map(tree, em); 291 + if (em->in_tree) 292 + try_merge_map(tree, em); 292 293 } 293 294 294 295 /**
+20 -5
fs/btrfs/file.c
··· 293 293 struct btrfs_key key; 294 294 struct btrfs_ioctl_defrag_range_args range; 295 295 int num_defrag; 296 + int index; 297 + int ret; 296 298 297 299 /* get the inode */ 298 300 key.objectid = defrag->root; 299 301 btrfs_set_key_type(&key, BTRFS_ROOT_ITEM_KEY); 300 302 key.offset = (u64)-1; 303 + 304 + index = srcu_read_lock(&fs_info->subvol_srcu); 305 + 301 306 inode_root = btrfs_read_fs_root_no_name(fs_info, &key); 302 307 if (IS_ERR(inode_root)) { 303 - kmem_cache_free(btrfs_inode_defrag_cachep, defrag); 304 - return PTR_ERR(inode_root); 308 + ret = PTR_ERR(inode_root); 309 + goto cleanup; 310 + } 311 + if (btrfs_root_refs(&inode_root->root_item) == 0) { 312 + ret = -ENOENT; 313 + goto cleanup; 305 314 } 306 315 307 316 key.objectid = defrag->ino; ··· 318 309 key.offset = 0; 319 310 inode = btrfs_iget(fs_info->sb, &key, inode_root, NULL); 320 311 if (IS_ERR(inode)) { 321 - kmem_cache_free(btrfs_inode_defrag_cachep, defrag); 322 - return PTR_ERR(inode); 312 + ret = PTR_ERR(inode); 313 + goto cleanup; 323 314 } 315 + srcu_read_unlock(&fs_info->subvol_srcu, index); 324 316 325 317 /* do a chunk of defrag */ 326 318 clear_bit(BTRFS_INODE_IN_DEFRAG, &BTRFS_I(inode)->runtime_flags); ··· 356 346 357 347 iput(inode); 358 348 return 0; 349 + cleanup: 350 + srcu_read_unlock(&fs_info->subvol_srcu, index); 351 + kmem_cache_free(btrfs_inode_defrag_cachep, defrag); 352 + return ret; 359 353 } 360 354 361 355 /* ··· 1608 1594 if (err < 0 && num_written > 0) 1609 1595 num_written = err; 1610 1596 } 1611 - out: 1597 + 1612 1598 if (sync) 1613 1599 atomic_dec(&BTRFS_I(inode)->sync_writers); 1600 + out: 1614 1601 sb_end_write(inode->i_sb); 1615 1602 current->backing_dev_info = NULL; 1616 1603 return num_written ? num_written : err;
+4 -1
fs/btrfs/ioctl.c
··· 515 515 516 516 BUG_ON(ret); 517 517 518 - d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry)); 519 518 fail: 520 519 if (async_transid) { 521 520 *async_transid = trans->transid; ··· 524 525 } 525 526 if (err && !ret) 526 527 ret = err; 528 + 529 + if (!ret) 530 + d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry)); 531 + 527 532 return ret; 528 533 } 529 534
+10 -3
fs/btrfs/ordered-data.c
··· 836 836 * if the disk i_size is already at the inode->i_size, or 837 837 * this ordered extent is inside the disk i_size, we're done 838 838 */ 839 - if (disk_i_size == i_size || offset <= disk_i_size) { 839 + if (disk_i_size == i_size) 840 840 goto out; 841 - } 841 + 842 + /* 843 + * We still need to update disk_i_size if outstanding_isize is greater 844 + * than disk_i_size. 845 + */ 846 + if (offset <= disk_i_size && 847 + (!ordered || ordered->outstanding_isize <= disk_i_size)) 848 + goto out; 842 849 843 850 /* 844 851 * walk backward from this ordered extent to disk_i_size. ··· 877 870 break; 878 871 if (test->file_offset >= i_size) 879 872 break; 880 - if (test->file_offset >= disk_i_size) { 873 + if (entry_end(test) > disk_i_size) { 881 874 /* 882 875 * we don't update disk_i_size now, so record this 883 876 * undealt i_size. Or we will not know the real
+20 -5
fs/btrfs/scrub.c
··· 580 580 int corrected = 0; 581 581 struct btrfs_key key; 582 582 struct inode *inode = NULL; 583 + struct btrfs_fs_info *fs_info; 583 584 u64 end = offset + PAGE_SIZE - 1; 584 585 struct btrfs_root *local_root; 586 + int srcu_index; 585 587 586 588 key.objectid = root; 587 589 key.type = BTRFS_ROOT_ITEM_KEY; 588 590 key.offset = (u64)-1; 589 - local_root = btrfs_read_fs_root_no_name(fixup->root->fs_info, &key); 590 - if (IS_ERR(local_root)) 591 + 592 + fs_info = fixup->root->fs_info; 593 + srcu_index = srcu_read_lock(&fs_info->subvol_srcu); 594 + 595 + local_root = btrfs_read_fs_root_no_name(fs_info, &key); 596 + if (IS_ERR(local_root)) { 597 + srcu_read_unlock(&fs_info->subvol_srcu, srcu_index); 591 598 return PTR_ERR(local_root); 599 + } 592 600 593 601 key.type = BTRFS_INODE_ITEM_KEY; 594 602 key.objectid = inum; 595 603 key.offset = 0; 596 - inode = btrfs_iget(fixup->root->fs_info->sb, &key, local_root, NULL); 604 + inode = btrfs_iget(fs_info->sb, &key, local_root, NULL); 605 + srcu_read_unlock(&fs_info->subvol_srcu, srcu_index); 597 606 if (IS_ERR(inode)) 598 607 return PTR_ERR(inode); 599 608 ··· 615 606 } 616 607 617 608 if (PageUptodate(page)) { 618 - struct btrfs_fs_info *fs_info; 619 609 if (PageDirty(page)) { 620 610 /* 621 611 * we need to write the data to the defect sector. the ··· 3188 3180 u64 physical_for_dev_replace; 3189 3181 u64 len; 3190 3182 struct btrfs_fs_info *fs_info = nocow_ctx->sctx->dev_root->fs_info; 3183 + int srcu_index; 3191 3184 3192 3185 key.objectid = root; 3193 3186 key.type = BTRFS_ROOT_ITEM_KEY; 3194 3187 key.offset = (u64)-1; 3188 + 3189 + srcu_index = srcu_read_lock(&fs_info->subvol_srcu); 3190 + 3195 3191 local_root = btrfs_read_fs_root_no_name(fs_info, &key); 3196 - if (IS_ERR(local_root)) 3192 + if (IS_ERR(local_root)) { 3193 + srcu_read_unlock(&fs_info->subvol_srcu, srcu_index); 3197 3194 return PTR_ERR(local_root); 3195 + } 3198 3196 3199 3197 key.type = BTRFS_INODE_ITEM_KEY; 3200 3198 key.objectid = inum; 3201 3199 key.offset = 0; 3202 3200 inode = btrfs_iget(fs_info->sb, &key, local_root, NULL); 3201 + srcu_read_unlock(&fs_info->subvol_srcu, srcu_index); 3203 3202 if (IS_ERR(inode)) 3204 3203 return PTR_ERR(inode); 3205 3204
+19 -8
fs/btrfs/transaction.c
··· 333 333 &root->fs_info->trans_block_rsv, 334 334 num_bytes, flush); 335 335 if (ret) 336 - return ERR_PTR(ret); 336 + goto reserve_fail; 337 337 } 338 338 again: 339 339 h = kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS); 340 - if (!h) 341 - return ERR_PTR(-ENOMEM); 340 + if (!h) { 341 + ret = -ENOMEM; 342 + goto alloc_fail; 343 + } 342 344 343 345 /* 344 346 * If we are JOIN_NOLOCK we're already committing a transaction and ··· 367 365 if (ret < 0) { 368 366 /* We must get the transaction if we are JOIN_NOLOCK. */ 369 367 BUG_ON(type == TRANS_JOIN_NOLOCK); 370 - 371 - if (type < TRANS_JOIN_NOLOCK) 372 - sb_end_intwrite(root->fs_info->sb); 373 - kmem_cache_free(btrfs_trans_handle_cachep, h); 374 - return ERR_PTR(ret); 368 + goto join_fail; 375 369 } 376 370 377 371 cur_trans = root->fs_info->running_transaction; ··· 408 410 if (!current->journal_info && type != TRANS_USERSPACE) 409 411 current->journal_info = h; 410 412 return h; 413 + 414 + join_fail: 415 + if (type < TRANS_JOIN_NOLOCK) 416 + sb_end_intwrite(root->fs_info->sb); 417 + kmem_cache_free(btrfs_trans_handle_cachep, h); 418 + alloc_fail: 419 + if (num_bytes) 420 + btrfs_block_rsv_release(root, &root->fs_info->trans_block_rsv, 421 + num_bytes); 422 + reserve_fail: 423 + if (qgroup_reserved) 424 + btrfs_qgroup_free(root, qgroup_reserved); 425 + return ERR_PTR(ret); 411 426 } 412 427 413 428 struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root,
+2 -1
fs/btrfs/volumes.c
··· 1556 1556 ret = 0; 1557 1557 1558 1558 /* Notify udev that device has changed */ 1559 - btrfs_kobject_uevent(bdev, KOBJ_CHANGE); 1559 + if (bdev) 1560 + btrfs_kobject_uevent(bdev, KOBJ_CHANGE); 1560 1561 1561 1562 error_brelse: 1562 1563 brelse(bh);
+4 -4
fs/dlm/user.c
··· 503 503 #endif 504 504 return -EINVAL; 505 505 506 - #ifdef CONFIG_COMPAT 507 - if (count > sizeof(struct dlm_write_request32) + DLM_RESNAME_MAXLEN) 508 - #else 506 + /* 507 + * can't compare against COMPAT/dlm_write_request32 because 508 + * we don't yet know if is64bit is zero 509 + */ 509 510 if (count > sizeof(struct dlm_write_request) + DLM_RESNAME_MAXLEN) 510 - #endif 511 511 return -EINVAL; 512 512 513 513 kbuf = kzalloc(count + 1, GFP_NOFS);
+20
fs/nfs/namespace.c
··· 177 177 return mnt; 178 178 } 179 179 180 + static int 181 + nfs_namespace_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) 182 + { 183 + if (NFS_FH(dentry->d_inode)->size != 0) 184 + return nfs_getattr(mnt, dentry, stat); 185 + generic_fillattr(dentry->d_inode, stat); 186 + return 0; 187 + } 188 + 189 + static int 190 + nfs_namespace_setattr(struct dentry *dentry, struct iattr *attr) 191 + { 192 + if (NFS_FH(dentry->d_inode)->size != 0) 193 + return nfs_setattr(dentry, attr); 194 + return -EACCES; 195 + } 196 + 180 197 const struct inode_operations nfs_mountpoint_inode_operations = { 181 198 .getattr = nfs_getattr, 199 + .setattr = nfs_setattr, 182 200 }; 183 201 184 202 const struct inode_operations nfs_referral_inode_operations = { 203 + .getattr = nfs_namespace_getattr, 204 + .setattr = nfs_namespace_setattr, 185 205 }; 186 206 187 207 static void nfs_expire_automounts(struct work_struct *work)
+26 -36
fs/nfs/nfs4client.c
··· 236 236 error = nfs4_discover_server_trunking(clp, &old); 237 237 if (error < 0) 238 238 goto error; 239 + nfs_put_client(clp); 239 240 if (clp != old) { 240 241 clp->cl_preserve_clid = true; 241 - nfs_put_client(clp); 242 242 clp = old; 243 - atomic_inc(&clp->cl_count); 244 243 } 245 244 246 245 return clp; ··· 305 306 .clientid = new->cl_clientid, 306 307 .confirm = new->cl_confirm, 307 308 }; 308 - int status; 309 + int status = -NFS4ERR_STALE_CLIENTID; 309 310 310 311 spin_lock(&nn->nfs_client_lock); 311 312 list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) { ··· 331 332 332 333 if (prev) 333 334 nfs_put_client(prev); 335 + prev = pos; 334 336 335 337 status = nfs4_proc_setclientid_confirm(pos, &clid, cred); 336 - if (status == 0) { 338 + switch (status) { 339 + case -NFS4ERR_STALE_CLIENTID: 340 + break; 341 + case 0: 337 342 nfs4_swap_callback_idents(pos, new); 338 343 339 - nfs_put_client(pos); 344 + prev = NULL; 340 345 *result = pos; 341 346 dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n", 342 347 __func__, pos, atomic_read(&pos->cl_count)); 343 - return 0; 344 - } 345 - if (status != -NFS4ERR_STALE_CLIENTID) { 346 - nfs_put_client(pos); 347 - dprintk("NFS: <-- %s status = %d, no result\n", 348 - __func__, status); 349 - return status; 348 + default: 349 + goto out; 350 350 } 351 351 352 352 spin_lock(&nn->nfs_client_lock); 353 - prev = pos; 354 353 } 354 + spin_unlock(&nn->nfs_client_lock); 355 355 356 - /* 357 - * No matching nfs_client found. This should be impossible, 358 - * because the new nfs_client has already been added to 359 - * nfs_client_list by nfs_get_client(). 360 - * 361 - * Don't BUG(), since the caller is holding a mutex. 362 - */ 356 + /* No match found. The server lost our clientid */ 357 + out: 363 358 if (prev) 364 359 nfs_put_client(prev); 365 - spin_unlock(&nn->nfs_client_lock); 366 - pr_err("NFS: %s Error: no matching nfs_client found\n", __func__); 367 - return -NFS4ERR_STALE_CLIENTID; 360 + dprintk("NFS: <-- %s status = %d\n", __func__, status); 361 + return status; 368 362 } 369 363 370 364 #ifdef CONFIG_NFS_V4_1 ··· 424 432 { 425 433 struct nfs_net *nn = net_generic(new->cl_net, nfs_net_id); 426 434 struct nfs_client *pos, *n, *prev = NULL; 427 - int error; 435 + int status = -NFS4ERR_STALE_CLIENTID; 428 436 429 437 spin_lock(&nn->nfs_client_lock); 430 438 list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) { ··· 440 448 nfs_put_client(prev); 441 449 prev = pos; 442 450 443 - error = nfs_wait_client_init_complete(pos); 444 - if (error < 0) { 451 + nfs4_schedule_lease_recovery(pos); 452 + status = nfs_wait_client_init_complete(pos); 453 + if (status < 0) { 445 454 nfs_put_client(pos); 446 455 spin_lock(&nn->nfs_client_lock); 447 456 continue; 448 457 } 449 - 458 + status = pos->cl_cons_state; 450 459 spin_lock(&nn->nfs_client_lock); 460 + if (status < 0) 461 + continue; 451 462 } 452 463 453 464 if (pos->rpc_ops != new->rpc_ops) ··· 468 473 if (!nfs4_match_serverowners(pos, new)) 469 474 continue; 470 475 476 + atomic_inc(&pos->cl_count); 471 477 spin_unlock(&nn->nfs_client_lock); 472 478 dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n", 473 479 __func__, pos, atomic_read(&pos->cl_count)); ··· 477 481 return 0; 478 482 } 479 483 480 - /* 481 - * No matching nfs_client found. This should be impossible, 482 - * because the new nfs_client has already been added to 483 - * nfs_client_list by nfs_get_client(). 484 - * 485 - * Don't BUG(), since the caller is holding a mutex. 486 - */ 484 + /* No matching nfs_client found. */ 487 485 spin_unlock(&nn->nfs_client_lock); 488 - pr_err("NFS: %s Error: no matching nfs_client found\n", __func__); 489 - return -NFS4ERR_STALE_CLIENTID; 486 + dprintk("NFS: <-- %s status = %d\n", __func__, status); 487 + return status; 490 488 } 491 489 #endif /* CONFIG_NFS_V4_1 */ 492 490
+14 -8
fs/nfs/nfs4state.c
··· 136 136 clp->cl_confirm = clid.confirm; 137 137 138 138 status = nfs40_walk_client_list(clp, result, cred); 139 - switch (status) { 140 - case -NFS4ERR_STALE_CLIENTID: 141 - set_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); 142 - case 0: 139 + if (status == 0) { 143 140 /* Sustain the lease, even if it's empty. If the clientid4 144 141 * goes stale it's of no use for trunking discovery. */ 145 142 nfs4_schedule_state_renewal(*result); 146 - break; 147 143 } 148 - 149 144 out: 150 145 return status; 151 146 } ··· 1858 1863 case -ETIMEDOUT: 1859 1864 case -EAGAIN: 1860 1865 ssleep(1); 1866 + case -NFS4ERR_STALE_CLIENTID: 1861 1867 dprintk("NFS: %s after status %d, retrying\n", 1862 1868 __func__, status); 1863 1869 goto again; ··· 2018 2022 nfs4_begin_drain_session(clp); 2019 2023 cred = nfs4_get_exchange_id_cred(clp); 2020 2024 status = nfs4_proc_destroy_session(clp->cl_session, cred); 2021 - if (status && status != -NFS4ERR_BADSESSION && 2022 - status != -NFS4ERR_DEADSESSION) { 2025 + switch (status) { 2026 + case 0: 2027 + case -NFS4ERR_BADSESSION: 2028 + case -NFS4ERR_DEADSESSION: 2029 + break; 2030 + case -NFS4ERR_BACK_CHAN_BUSY: 2031 + case -NFS4ERR_DELAY: 2032 + set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); 2033 + status = 0; 2034 + ssleep(1); 2035 + goto out; 2036 + default: 2023 2037 status = nfs4_recovery_handle_error(clp, status); 2024 2038 goto out; 2025 2039 }
+9 -13
fs/nfs/super.c
··· 2589 2589 struct nfs_server *server; 2590 2590 struct dentry *mntroot = ERR_PTR(-ENOMEM); 2591 2591 struct nfs_subversion *nfs_mod = NFS_SB(data->sb)->nfs_client->cl_nfs_mod; 2592 - int error; 2593 2592 2594 - dprintk("--> nfs_xdev_mount_common()\n"); 2593 + dprintk("--> nfs_xdev_mount()\n"); 2595 2594 2596 2595 mount_info.mntfh = mount_info.cloned->fh; 2597 2596 2598 2597 /* create a new volume representation */ 2599 2598 server = nfs_mod->rpc_ops->clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor); 2600 - if (IS_ERR(server)) { 2601 - error = PTR_ERR(server); 2602 - goto out_err; 2603 - } 2604 2599 2605 - mntroot = nfs_fs_mount_common(server, flags, dev_name, &mount_info, nfs_mod); 2606 - dprintk("<-- nfs_xdev_mount_common() = 0\n"); 2607 - out: 2600 + if (IS_ERR(server)) 2601 + mntroot = ERR_CAST(server); 2602 + else 2603 + mntroot = nfs_fs_mount_common(server, flags, 2604 + dev_name, &mount_info, nfs_mod); 2605 + 2606 + dprintk("<-- nfs_xdev_mount() = %ld\n", 2607 + IS_ERR(mntroot) ? PTR_ERR(mntroot) : 0L); 2608 2608 return mntroot; 2609 - 2610 - out_err: 2611 - dprintk("<-- nfs_xdev_mount_common() = %d [error]\n", error); 2612 - goto out; 2613 2609 } 2614 2610 2615 2611 #if IS_ENABLED(CONFIG_NFS_V4)
+4 -1
fs/nilfs2/ioctl.c
··· 664 664 if (ret < 0) 665 665 printk(KERN_ERR "NILFS: GC failed during preparation: " 666 666 "cannot read source blocks: err=%d\n", ret); 667 - else 667 + else { 668 + if (nilfs_sb_need_update(nilfs)) 669 + set_nilfs_discontinued(nilfs); 668 670 ret = nilfs_clean_segments(inode->i_sb, argv, kbufs); 671 + } 669 672 670 673 nilfs_remove_all_gcinodes(nilfs); 671 674 clear_nilfs_gc_running(nilfs);
+1 -1
fs/xfs/xfs_aops.c
··· 86 86 } 87 87 88 88 if (ioend->io_iocb) { 89 + inode_dio_done(ioend->io_inode); 89 90 if (ioend->io_isasync) { 90 91 aio_complete(ioend->io_iocb, ioend->io_error ? 91 92 ioend->io_error : ioend->io_result, 0); 92 93 } 93 - inode_dio_done(ioend->io_inode); 94 94 } 95 95 96 96 mempool_free(ioend, xfs_ioend_pool);
+3 -3
fs/xfs/xfs_bmap.c
··· 4680 4680 return error; 4681 4681 } 4682 4682 4683 - if (bma->flags & XFS_BMAPI_STACK_SWITCH) 4684 - bma->stack_switch = 1; 4685 - 4686 4683 error = xfs_bmap_alloc(bma); 4687 4684 if (error) 4688 4685 return error; ··· 4952 4955 bma.userdata = 0; 4953 4956 bma.flist = flist; 4954 4957 bma.firstblock = firstblock; 4958 + 4959 + if (flags & XFS_BMAPI_STACK_SWITCH) 4960 + bma.stack_switch = 1; 4955 4961 4956 4962 while (bno < end && n < *nmap) { 4957 4963 inhole = eof || bma.got.br_startoff > bno;
+20
fs/xfs/xfs_buf.c
··· 487 487 struct rb_node *parent; 488 488 xfs_buf_t *bp; 489 489 xfs_daddr_t blkno = map[0].bm_bn; 490 + xfs_daddr_t eofs; 490 491 int numblks = 0; 491 492 int i; 492 493 ··· 498 497 /* Check for IOs smaller than the sector size / not sector aligned */ 499 498 ASSERT(!(numbytes < (1 << btp->bt_sshift))); 500 499 ASSERT(!(BBTOB(blkno) & (xfs_off_t)btp->bt_smask)); 500 + 501 + /* 502 + * Corrupted block numbers can get through to here, unfortunately, so we 503 + * have to check that the buffer falls within the filesystem bounds. 504 + */ 505 + eofs = XFS_FSB_TO_BB(btp->bt_mount, btp->bt_mount->m_sb.sb_dblocks); 506 + if (blkno >= eofs) { 507 + /* 508 + * XXX (dgc): we should really be returning EFSCORRUPTED here, 509 + * but none of the higher level infrastructure supports 510 + * returning a specific error on buffer lookup failures. 511 + */ 512 + xfs_alert(btp->bt_mount, 513 + "%s: Block out of range: block 0x%llx, EOFS 0x%llx ", 514 + __func__, blkno, eofs); 515 + return NULL; 516 + } 501 517 502 518 /* get tree root */ 503 519 pag = xfs_perag_get(btp->bt_mount, ··· 1505 1487 while (!list_empty(&btp->bt_lru)) { 1506 1488 bp = list_first_entry(&btp->bt_lru, struct xfs_buf, b_lru); 1507 1489 if (atomic_read(&bp->b_hold) > 1) { 1490 + trace_xfs_buf_wait_buftarg(bp, _RET_IP_); 1491 + list_move_tail(&bp->b_lru, &btp->bt_lru); 1508 1492 spin_unlock(&btp->bt_lru_lock); 1509 1493 delay(100); 1510 1494 goto restart;
+10 -2
fs/xfs/xfs_buf_item.c
··· 652 652 653 653 /* 654 654 * If the buf item isn't tracking any data, free it, otherwise drop the 655 - * reference we hold to it. 655 + * reference we hold to it. If we are aborting the transaction, this may 656 + * be the only reference to the buf item, so we free it anyway 657 + * regardless of whether it is dirty or not. A dirty abort implies a 658 + * shutdown, anyway. 656 659 */ 657 660 clean = 1; 658 661 for (i = 0; i < bip->bli_format_count; i++) { ··· 667 664 } 668 665 if (clean) 669 666 xfs_buf_item_relse(bp); 670 - else 667 + else if (aborted) { 668 + if (atomic_dec_and_test(&bip->bli_refcount)) { 669 + ASSERT(XFS_FORCED_SHUTDOWN(lip->li_mountp)); 670 + xfs_buf_item_relse(bp); 671 + } 672 + } else 671 673 atomic_dec(&bip->bli_refcount); 672 674 673 675 if (!hold)
+2 -2
fs/xfs/xfs_dfrag.c
··· 246 246 goto out_unlock; 247 247 } 248 248 249 - error = -filemap_write_and_wait(VFS_I(ip)->i_mapping); 249 + error = -filemap_write_and_wait(VFS_I(tip)->i_mapping); 250 250 if (error) 251 251 goto out_unlock; 252 - truncate_pagecache_range(VFS_I(ip), 0, -1); 252 + truncate_pagecache_range(VFS_I(tip), 0, -1); 253 253 254 254 /* Verify O_DIRECT for ftmp */ 255 255 if (VN_CACHED(VFS_I(tip)) != 0) {
+9
fs/xfs/xfs_iomap.c
··· 351 351 } 352 352 if (shift) 353 353 alloc_blocks >>= shift; 354 + 355 + /* 356 + * If we are still trying to allocate more space than is 357 + * available, squash the prealloc hard. This can happen if we 358 + * have a large file on a small filesystem and the above 359 + * lowspace thresholds are smaller than MAXEXTLEN. 360 + */ 361 + while (alloc_blocks >= freesp) 362 + alloc_blocks >>= 4; 354 363 } 355 364 356 365 if (alloc_blocks < mp->m_writeio_blocks)
+1 -1
fs/xfs/xfs_mount.c
··· 658 658 return; 659 659 } 660 660 /* quietly fail */ 661 - xfs_buf_ioerror(bp, EFSCORRUPTED); 661 + xfs_buf_ioerror(bp, EWRONGFS); 662 662 } 663 663 664 664 static void
+1
fs/xfs/xfs_trace.h
··· 341 341 DEFINE_BUF_EVENT(xfs_buf_item_iodone); 342 342 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async); 343 343 DEFINE_BUF_EVENT(xfs_buf_error_relse); 344 + DEFINE_BUF_EVENT(xfs_buf_wait_buftarg); 344 345 DEFINE_BUF_EVENT(xfs_trans_read_buf_io); 345 346 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut); 346 347
+18 -6
include/linux/efi.h
··· 618 618 #endif 619 619 620 620 /* 621 - * We play games with efi_enabled so that the compiler will, if possible, remove 622 - * EFI-related code altogether. 621 + * We play games with efi_enabled so that the compiler will, if 622 + * possible, remove EFI-related code altogether. 623 623 */ 624 + #define EFI_BOOT 0 /* Were we booted from EFI? */ 625 + #define EFI_SYSTEM_TABLES 1 /* Can we use EFI system tables? */ 626 + #define EFI_CONFIG_TABLES 2 /* Can we use EFI config tables? */ 627 + #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ 628 + #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ 629 + #define EFI_64BIT 5 /* Is the firmware 64-bit? */ 630 + 624 631 #ifdef CONFIG_EFI 625 632 # ifdef CONFIG_X86 626 - extern int efi_enabled; 627 - extern bool efi_64bit; 633 + extern int efi_enabled(int facility); 628 634 # else 629 - # define efi_enabled 1 635 + static inline int efi_enabled(int facility) 636 + { 637 + return 1; 638 + } 630 639 # endif 631 640 #else 632 - # define efi_enabled 0 641 + static inline int efi_enabled(int facility) 642 + { 643 + return 0; 644 + } 633 645 #endif 634 646 635 647 /*
+25
include/linux/llist.h
··· 125 125 (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) 126 126 127 127 /** 128 + * llist_for_each_entry_safe - iterate safely against remove over some entries 129 + * of lock-less list of given type. 130 + * @pos: the type * to use as a loop cursor. 131 + * @n: another type * to use as a temporary storage. 132 + * @node: the fist entry of deleted list entries. 133 + * @member: the name of the llist_node with the struct. 134 + * 135 + * In general, some entries of the lock-less list can be traversed 136 + * safely only after being removed from list, so start with an entry 137 + * instead of list head. This variant allows removal of entries 138 + * as we iterate. 139 + * 140 + * If being used on entries deleted from lock-less list directly, the 141 + * traverse order is from the newest to the oldest added entry. If 142 + * you want to traverse from the oldest to the newest, you must 143 + * reverse the order by yourself before traversing. 144 + */ 145 + #define llist_for_each_entry_safe(pos, n, node, member) \ 146 + for ((pos) = llist_entry((node), typeof(*(pos)), member), \ 147 + (n) = (pos)->member.next; \ 148 + &(pos)->member != NULL; \ 149 + (pos) = llist_entry(n, typeof(*(pos)), member), \ 150 + (n) = (&(pos)->member != NULL) ? (pos)->member.next : NULL) 151 + 152 + /** 128 153 * llist_empty - tests whether a lock-less list is empty 129 154 * @head: the list to test 130 155 *
+1 -1
include/linux/memcontrol.h
··· 429 429 * the slab_mutex must be held when looping through those caches 430 430 */ 431 431 #define for_each_memcg_cache_index(_idx) \ 432 - for ((_idx) = 0; i < memcg_limited_groups_array_size; (_idx)++) 432 + for ((_idx) = 0; (_idx) < memcg_limited_groups_array_size; (_idx)++) 433 433 434 434 static inline bool memcg_kmem_enabled(void) 435 435 {
+1 -1
include/linux/mmu_notifier.h
··· 151 151 * Therefore notifier chains can only be traversed when either 152 152 * 153 153 * 1. mmap_sem is held. 154 - * 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->mutex). 154 + * 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->rwsem). 155 155 * 3. No other concurrent thread can access the list (release) 156 156 */ 157 157 struct mmu_notifier {
+2
include/linux/usb.h
··· 357 357 int bandwidth_int_reqs; /* number of Interrupt requests */ 358 358 int bandwidth_isoc_reqs; /* number of Isoc. requests */ 359 359 360 + unsigned resuming_ports; /* bit array: resuming root-hub ports */ 361 + 360 362 #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) 361 363 struct mon_bus *mon_bus; /* non-null when associated */ 362 364 int monitored; /* non-zero when monitored */
+3
include/linux/usb/hcd.h
··· 430 430 extern void usb_wakeup_notification(struct usb_device *hdev, 431 431 unsigned int portnum); 432 432 433 + extern void usb_hcd_start_port_resume(struct usb_bus *bus, int portnum); 434 + extern void usb_hcd_end_port_resume(struct usb_bus *bus, int portnum); 435 + 433 436 /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ 434 437 #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) 435 438 #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep)))
+1 -1
include/linux/usb/usbnet.h
··· 102 102 #define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ 103 103 104 104 #define FLAG_POINTTOPOINT 0x1000 /* possibly use "usb%d" names */ 105 - #define FLAG_NOARP 0x2000 /* device can't do ARP */ 106 105 107 106 /* 108 107 * Indicates to usbnet, that USB driver accumulates multiple IP packets. ··· 109 110 */ 110 111 #define FLAG_MULTI_PACKET 0x2000 111 112 #define FLAG_RX_ASSEMBLE 0x4000 /* rx packets may span >1 frames */ 113 + #define FLAG_NOARP 0x8000 /* device can't do ARP */ 112 114 113 115 /* init device ... can sleep, or cause probe() failure */ 114 116 int (*bind)(struct usbnet *, struct usb_interface *);
+6
include/uapi/linux/usb/ch9.h
··· 152 152 #define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0)) 153 153 #define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1)) 154 154 155 + /* 156 + * Interface status, Figure 9-5 USB 3.0 spec 157 + */ 158 + #define USB_INTRF_STAT_FUNC_RW_CAP 1 159 + #define USB_INTRF_STAT_FUNC_RW 2 160 + 155 161 #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ 156 162 157 163 /* Bit array elements as returned by the USB_REQ_GET_STATUS request. */
+2 -2
init/main.c
··· 604 604 pidmap_init(); 605 605 anon_vma_init(); 606 606 #ifdef CONFIG_X86 607 - if (efi_enabled) 607 + if (efi_enabled(EFI_RUNTIME_SERVICES)) 608 608 efi_enter_virtual_mode(); 609 609 #endif 610 610 thread_info_cache_init(); ··· 632 632 acpi_early_init(); /* before LAPIC and SMP init */ 633 633 sfi_init_late(); 634 634 635 - if (efi_enabled) { 635 + if (efi_enabled(EFI_RUNTIME_SERVICES)) { 636 636 efi_late_init(); 637 637 efi_free_boot_services(); 638 638 }
+18 -2
kernel/events/core.c
··· 908 908 } 909 909 910 910 /* 911 + * Initialize event state based on the perf_event_attr::disabled. 912 + */ 913 + static inline void perf_event__state_init(struct perf_event *event) 914 + { 915 + event->state = event->attr.disabled ? PERF_EVENT_STATE_OFF : 916 + PERF_EVENT_STATE_INACTIVE; 917 + } 918 + 919 + /* 911 920 * Called at perf_event creation and when events are attached/detached from a 912 921 * group. 913 922 */ ··· 6188 6179 event->overflow_handler = overflow_handler; 6189 6180 event->overflow_handler_context = context; 6190 6181 6191 - if (attr->disabled) 6192 - event->state = PERF_EVENT_STATE_OFF; 6182 + perf_event__state_init(event); 6193 6183 6194 6184 pmu = NULL; 6195 6185 ··· 6617 6609 6618 6610 mutex_lock(&gctx->mutex); 6619 6611 perf_remove_from_context(group_leader); 6612 + 6613 + /* 6614 + * Removing from the context ends up with disabled 6615 + * event. What we want here is event in the initial 6616 + * startup state, ready to be add into new context. 6617 + */ 6618 + perf_event__state_init(group_leader); 6620 6619 list_for_each_entry(sibling, &group_leader->sibling_list, 6621 6620 group_entry) { 6622 6621 perf_remove_from_context(sibling); 6622 + perf_event__state_init(sibling); 6623 6623 put_ctx(gctx); 6624 6624 } 6625 6625 mutex_unlock(&gctx->mutex);
-9
kernel/printk.c
··· 87 87 struct console *console_drivers; 88 88 EXPORT_SYMBOL_GPL(console_drivers); 89 89 90 - #ifdef CONFIG_LOCKDEP 91 - static struct lockdep_map console_lock_dep_map = { 92 - .name = "console_lock" 93 - }; 94 - #endif 95 - 96 90 /* 97 91 * This is used for debugging the mess that is the VT code by 98 92 * keeping track if we have the console semaphore held. It's ··· 1918 1924 return; 1919 1925 console_locked = 1; 1920 1926 console_may_schedule = 1; 1921 - mutex_acquire(&console_lock_dep_map, 0, 0, _RET_IP_); 1922 1927 } 1923 1928 EXPORT_SYMBOL(console_lock); 1924 1929 ··· 1939 1946 } 1940 1947 console_locked = 1; 1941 1948 console_may_schedule = 0; 1942 - mutex_acquire(&console_lock_dep_map, 0, 1, _RET_IP_); 1943 1949 return 1; 1944 1950 } 1945 1951 EXPORT_SYMBOL(console_trylock); ··· 2099 2107 local_irq_restore(flags); 2100 2108 } 2101 2109 console_locked = 0; 2102 - mutex_release(&console_lock_dep_map, 1, _RET_IP_); 2103 2110 2104 2111 /* Release the exclusive_console once it is used */ 2105 2112 if (unlikely(exclusive_console))
+10 -3
kernel/rcutree_plugin.h
··· 40 40 #ifdef CONFIG_RCU_NOCB_CPU 41 41 static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */ 42 42 static bool have_rcu_nocb_mask; /* Was rcu_nocb_mask allocated? */ 43 - static bool rcu_nocb_poll; /* Offload kthread are to poll. */ 44 - module_param(rcu_nocb_poll, bool, 0444); 43 + static bool __read_mostly rcu_nocb_poll; /* Offload kthread are to poll. */ 45 44 static char __initdata nocb_buf[NR_CPUS * 5]; 46 45 #endif /* #ifdef CONFIG_RCU_NOCB_CPU */ 47 46 ··· 2158 2159 } 2159 2160 __setup("rcu_nocbs=", rcu_nocb_setup); 2160 2161 2162 + static int __init parse_rcu_nocb_poll(char *arg) 2163 + { 2164 + rcu_nocb_poll = 1; 2165 + return 0; 2166 + } 2167 + early_param("rcu_nocb_poll", parse_rcu_nocb_poll); 2168 + 2161 2169 /* Is the specified CPU a no-CPUs CPU? */ 2162 2170 static bool is_nocb_cpu(int cpu) 2163 2171 { ··· 2372 2366 for (;;) { 2373 2367 /* If not polling, wait for next batch of callbacks. */ 2374 2368 if (!rcu_nocb_poll) 2375 - wait_event(rdp->nocb_wq, rdp->nocb_head); 2369 + wait_event_interruptible(rdp->nocb_wq, rdp->nocb_head); 2376 2370 list = ACCESS_ONCE(rdp->nocb_head); 2377 2371 if (!list) { 2378 2372 schedule_timeout_interruptible(1); 2373 + flush_signals(current); 2379 2374 continue; 2380 2375 } 2381 2376
+2 -2
kernel/sched/debug.c
··· 222 222 cfs_rq->runnable_load_avg); 223 223 SEQ_printf(m, " .%-30s: %lld\n", "blocked_load_avg", 224 224 cfs_rq->blocked_load_avg); 225 - SEQ_printf(m, " .%-30s: %ld\n", "tg_load_avg", 226 - atomic64_read(&cfs_rq->tg->load_avg)); 225 + SEQ_printf(m, " .%-30s: %lld\n", "tg_load_avg", 226 + (unsigned long long)atomic64_read(&cfs_rq->tg->load_avg)); 227 227 SEQ_printf(m, " .%-30s: %lld\n", "tg_load_contrib", 228 228 cfs_rq->tg_load_contrib); 229 229 SEQ_printf(m, " .%-30s: %d\n", "tg_runnable_contrib",
+1 -1
kernel/sched/fair.c
··· 2663 2663 hrtimer_cancel(&cfs_b->slack_timer); 2664 2664 } 2665 2665 2666 - static void unthrottle_offline_cfs_rqs(struct rq *rq) 2666 + static void __maybe_unused unthrottle_offline_cfs_rqs(struct rq *rq) 2667 2667 { 2668 2668 struct cfs_rq *cfs_rq; 2669 2669
+1 -1
kernel/sched/rt.c
··· 566 566 static int do_balance_runtime(struct rt_rq *rt_rq) 567 567 { 568 568 struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); 569 - struct root_domain *rd = cpu_rq(smp_processor_id())->rd; 569 + struct root_domain *rd = rq_of_rt_rq(rt_rq)->rd; 570 570 int i, weight, more = 0; 571 571 u64 rt_period; 572 572
+12 -1
kernel/smp.c
··· 33 33 struct call_single_data csd; 34 34 atomic_t refs; 35 35 cpumask_var_t cpumask; 36 + cpumask_var_t cpumask_ipi; 36 37 }; 37 38 38 39 static DEFINE_PER_CPU_SHARED_ALIGNED(struct call_function_data, cfd_data); ··· 57 56 if (!zalloc_cpumask_var_node(&cfd->cpumask, GFP_KERNEL, 58 57 cpu_to_node(cpu))) 59 58 return notifier_from_errno(-ENOMEM); 59 + if (!zalloc_cpumask_var_node(&cfd->cpumask_ipi, GFP_KERNEL, 60 + cpu_to_node(cpu))) 61 + return notifier_from_errno(-ENOMEM); 60 62 break; 61 63 62 64 #ifdef CONFIG_HOTPLUG_CPU ··· 69 65 case CPU_DEAD: 70 66 case CPU_DEAD_FROZEN: 71 67 free_cpumask_var(cfd->cpumask); 68 + free_cpumask_var(cfd->cpumask_ipi); 72 69 break; 73 70 #endif 74 71 }; ··· 531 526 return; 532 527 } 533 528 529 + /* 530 + * After we put an entry into the list, data->cpumask 531 + * may be cleared again when another CPU sends another IPI for 532 + * a SMP function call, so data->cpumask will be zero. 533 + */ 534 + cpumask_copy(data->cpumask_ipi, data->cpumask); 534 535 raw_spin_lock_irqsave(&call_function.lock, flags); 535 536 /* 536 537 * Place entry at the _HEAD_ of the list, so that any cpu still ··· 560 549 smp_mb(); 561 550 562 551 /* Send a message to all CPUs in the map */ 563 - arch_send_call_function_ipi_mask(data->cpumask); 552 + arch_send_call_function_ipi_mask(data->cpumask_ipi); 564 553 565 554 /* Optionally wait for the CPUs to complete */ 566 555 if (wait)
+2
lib/digsig.c
··· 162 162 memset(out1, 0, head); 163 163 memcpy(out1 + head, p, l); 164 164 165 + kfree(p); 166 + 165 167 err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len); 166 168 if (err) 167 169 goto err;
+4
mm/huge_memory.c
··· 1257 1257 if (flags & FOLL_WRITE && !pmd_write(*pmd)) 1258 1258 goto out; 1259 1259 1260 + /* Avoid dumping huge zero page */ 1261 + if ((flags & FOLL_DUMP) && is_huge_zero_pmd(*pmd)) 1262 + return ERR_PTR(-EFAULT); 1263 + 1260 1264 page = pmd_page(*pmd); 1261 1265 VM_BUG_ON(!PageHead(page)); 1262 1266 if (flags & FOLL_TOUCH) {
+1
mm/hugetlb.c
··· 3033 3033 if (!huge_pte_none(huge_ptep_get(ptep))) { 3034 3034 pte = huge_ptep_get_and_clear(mm, address, ptep); 3035 3035 pte = pte_mkhuge(pte_modify(pte, newprot)); 3036 + pte = arch_make_huge_pte(pte, vma, NULL, 0); 3036 3037 set_huge_pte_at(mm, address, ptep, pte); 3037 3038 pages++; 3038 3039 }
+3 -1
mm/migrate.c
··· 160 160 if (is_write_migration_entry(entry)) 161 161 pte = pte_mkwrite(pte); 162 162 #ifdef CONFIG_HUGETLB_PAGE 163 - if (PageHuge(new)) 163 + if (PageHuge(new)) { 164 164 pte = pte_mkhuge(pte); 165 + pte = arch_make_huge_pte(pte, vma, new, 0); 166 + } 165 167 #endif 166 168 flush_cache_page(vma, addr, pte_pfn(pte)); 167 169 set_pte_at(mm, addr, ptep, pte);
+1 -1
mm/mmap.c
··· 2943 2943 * vma in this mm is backed by the same anon_vma or address_space. 2944 2944 * 2945 2945 * We can take all the locks in random order because the VM code 2946 - * taking i_mmap_mutex or anon_vma->mutex outside the mmap_sem never 2946 + * taking i_mmap_mutex or anon_vma->rwsem outside the mmap_sem never 2947 2947 * takes more than one of them in a row. Secondly we're protected 2948 2948 * against a concurrent mm_take_all_locks() by the mm_all_locks_mutex. 2949 2949 *
+3 -3
net/bluetooth/hci_conn.c
··· 249 249 __u8 reason = hci_proto_disconn_ind(conn); 250 250 251 251 switch (conn->type) { 252 - case ACL_LINK: 253 - hci_acl_disconn(conn, reason); 254 - break; 255 252 case AMP_LINK: 256 253 hci_amp_disconn(conn, reason); 254 + break; 255 + default: 256 + hci_acl_disconn(conn, reason); 257 257 break; 258 258 } 259 259 }
+13
net/bluetooth/smp.c
··· 859 859 860 860 skb_pull(skb, sizeof(code)); 861 861 862 + /* 863 + * The SMP context must be initialized for all other PDUs except 864 + * pairing and security requests. If we get any other PDU when 865 + * not initialized simply disconnect (done if this function 866 + * returns an error). 867 + */ 868 + if (code != SMP_CMD_PAIRING_REQ && code != SMP_CMD_SECURITY_REQ && 869 + !conn->smp_chan) { 870 + BT_ERR("Unexpected SMP command 0x%02x. Disconnecting.", code); 871 + kfree_skb(skb); 872 + return -ENOTSUPP; 873 + } 874 + 862 875 switch (code) { 863 876 case SMP_CMD_PAIRING_REQ: 864 877 reason = smp_cmd_pairing_req(conn, skb);
+6 -2
net/ipv4/tcp_input.c
··· 3476 3476 ((tp->frto_counter >= 2) && (flag & FLAG_RETRANS_DATA_ACKED))) 3477 3477 tp->undo_marker = 0; 3478 3478 3479 - if (!before(tp->snd_una, tp->frto_highmark) || 3480 - !tcp_packets_in_flight(tp)) { 3479 + if (!before(tp->snd_una, tp->frto_highmark)) { 3481 3480 tcp_enter_frto_loss(sk, (tp->frto_counter == 1 ? 2 : 3), flag); 3482 3481 return true; 3483 3482 } ··· 3496 3497 } 3497 3498 } else { 3498 3499 if (!(flag & FLAG_DATA_ACKED) && (tp->frto_counter == 1)) { 3500 + if (!tcp_packets_in_flight(tp)) { 3501 + tcp_enter_frto_loss(sk, 2, flag); 3502 + return true; 3503 + } 3504 + 3499 3505 /* Prevent sending of new data. */ 3500 3506 tp->snd_cwnd = min(tp->snd_cwnd, 3501 3507 tcp_packets_in_flight(tp));
+1 -1
net/ipv6/ip6_gre.c
··· 958 958 int ret; 959 959 960 960 if (!ip6_tnl_xmit_ctl(t)) 961 - return -1; 961 + goto tx_err; 962 962 963 963 switch (skb->protocol) { 964 964 case htons(ETH_P_IP):
-6
net/l2tp/l2tp_core.c
··· 1168 1168 struct udphdr *uh; 1169 1169 struct inet_sock *inet; 1170 1170 __wsum csum; 1171 - int old_headroom; 1172 - int new_headroom; 1173 1171 int headroom; 1174 1172 int uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; 1175 1173 int udp_len; ··· 1179 1181 */ 1180 1182 headroom = NET_SKB_PAD + sizeof(struct iphdr) + 1181 1183 uhlen + hdr_len; 1182 - old_headroom = skb_headroom(skb); 1183 1184 if (skb_cow_head(skb, headroom)) { 1184 1185 kfree_skb(skb); 1185 1186 return NET_XMIT_DROP; 1186 1187 } 1187 1188 1188 - new_headroom = skb_headroom(skb); 1189 1189 skb_orphan(skb); 1190 - skb->truesize += new_headroom - old_headroom; 1191 - 1192 1190 /* Setup L2TP header */ 1193 1191 session->build_header(session, __skb_push(skb, hdr_len)); 1194 1192
-6
net/l2tp/l2tp_ppp.c
··· 388 388 struct l2tp_session *session; 389 389 struct l2tp_tunnel *tunnel; 390 390 struct pppol2tp_session *ps; 391 - int old_headroom; 392 - int new_headroom; 393 391 int uhlen, headroom; 394 392 395 393 if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) ··· 406 408 if (tunnel == NULL) 407 409 goto abort_put_sess; 408 410 409 - old_headroom = skb_headroom(skb); 410 411 uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; 411 412 headroom = NET_SKB_PAD + 412 413 sizeof(struct iphdr) + /* IP header */ ··· 414 417 sizeof(ppph); /* PPP header */ 415 418 if (skb_cow_head(skb, headroom)) 416 419 goto abort_put_sess_tun; 417 - 418 - new_headroom = skb_headroom(skb); 419 - skb->truesize += new_headroom - old_headroom; 420 420 421 421 /* Setup PPP header */ 422 422 __skb_push(skb, sizeof(ppph));
+9 -7
net/openvswitch/vport-netdev.c
··· 35 35 /* Must be called with rcu_read_lock. */ 36 36 static void netdev_port_receive(struct vport *vport, struct sk_buff *skb) 37 37 { 38 - if (unlikely(!vport)) { 39 - kfree_skb(skb); 40 - return; 41 - } 38 + if (unlikely(!vport)) 39 + goto error; 40 + 41 + if (unlikely(skb_warn_if_lro(skb))) 42 + goto error; 42 43 43 44 /* Make our own copy of the packet. Otherwise we will mangle the 44 45 * packet for anyone who came before us (e.g. tcpdump via AF_PACKET). ··· 51 50 52 51 skb_push(skb, ETH_HLEN); 53 52 ovs_vport_receive(vport, skb); 53 + return; 54 + 55 + error: 56 + kfree_skb(skb); 54 57 } 55 58 56 59 /* Called with rcu_read_lock and bottom-halves disabled. */ ··· 173 168 packet_length(skb), mtu); 174 169 goto error; 175 170 } 176 - 177 - if (unlikely(skb_warn_if_lro(skb))) 178 - goto error; 179 171 180 172 skb->dev = netdev_vport->dev; 181 173 len = skb->len;
+1 -1
net/sctp/auth.c
··· 71 71 return; 72 72 73 73 if (atomic_dec_and_test(&key->refcnt)) { 74 - kfree(key); 74 + kzfree(key); 75 75 SCTP_DBG_OBJCNT_DEC(keys); 76 76 } 77 77 }
+5
net/sctp/endpointola.c
··· 249 249 /* Final destructor for endpoint. */ 250 250 static void sctp_endpoint_destroy(struct sctp_endpoint *ep) 251 251 { 252 + int i; 253 + 252 254 SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return); 253 255 254 256 /* Free up the HMAC transform. */ ··· 272 270 /* Cleanup. */ 273 271 sctp_inq_free(&ep->base.inqueue); 274 272 sctp_bind_addr_free(&ep->base.bind_addr); 273 + 274 + for (i = 0; i < SCTP_HOW_MANY_SECRETS; ++i) 275 + memset(&ep->secret_key[i], 0, SCTP_SECRET_SIZE); 275 276 276 277 /* Remove and free the port */ 277 278 if (sctp_sk(ep->base.sk)->bind_hash)
+1 -1
net/sctp/socket.c
··· 3390 3390 3391 3391 ret = sctp_auth_set_key(sctp_sk(sk)->ep, asoc, authkey); 3392 3392 out: 3393 - kfree(authkey); 3393 + kzfree(authkey); 3394 3394 return ret; 3395 3395 } 3396 3396
+17 -1
net/sunrpc/sched.c
··· 98 98 list_add(&task->u.tk_wait.timer_list, &queue->timer_list.list); 99 99 } 100 100 101 + static void rpc_rotate_queue_owner(struct rpc_wait_queue *queue) 102 + { 103 + struct list_head *q = &queue->tasks[queue->priority]; 104 + struct rpc_task *task; 105 + 106 + if (!list_empty(q)) { 107 + task = list_first_entry(q, struct rpc_task, u.tk_wait.list); 108 + if (task->tk_owner == queue->owner) 109 + list_move_tail(&task->u.tk_wait.list, q); 110 + } 111 + } 112 + 101 113 static void rpc_set_waitqueue_priority(struct rpc_wait_queue *queue, int priority) 102 114 { 103 - queue->priority = priority; 115 + if (queue->priority != priority) { 116 + /* Fairness: rotate the list when changing priority */ 117 + rpc_rotate_queue_owner(queue); 118 + queue->priority = priority; 119 + } 104 120 } 105 121 106 122 static void rpc_set_waitqueue_owner(struct rpc_wait_queue *queue, pid_t pid)
+2
samples/seccomp/Makefile
··· 19 19 20 20 # Try to match the kernel target. 21 21 ifndef CONFIG_64BIT 22 + ifndef CROSS_COMPILE 22 23 23 24 # s390 has -m31 flag to build 31 bit binaries 24 25 ifndef CONFIG_S390 ··· 35 34 HOSTLOADLIBES_bpf-direct += $(MFLAG) 36 35 HOSTLOADLIBES_bpf-fancy += $(MFLAG) 37 36 HOSTLOADLIBES_dropper += $(MFLAG) 37 + endif 38 38 endif 39 39 40 40 # Tell kbuild to always build the programs
+5 -5
scripts/checkpatch.pl
··· 230 230 our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; 231 231 our $Lval = qr{$Ident(?:$Member)*}; 232 232 233 - our $Float_hex = qr{(?i:0x[0-9a-f]+p-?[0-9]+[fl]?)}; 234 - our $Float_dec = qr{(?i:((?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?))}; 235 - our $Float_int = qr{(?i:[0-9]+e-?[0-9]+[fl]?)}; 233 + our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?}; 234 + our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?}; 235 + our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; 236 236 our $Float = qr{$Float_hex|$Float_dec|$Float_int}; 237 - our $Constant = qr{(?:$Float|(?i:(?:0x[0-9a-f]+|[0-9]+)[ul]*))}; 238 - our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)}; 237 + our $Constant = qr{$Float|(?i)(?:0x[0-9a-f]+|[0-9]+)[ul]*}; 238 + our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; 239 239 our $Compare = qr{<=|>=|==|!=|<|>}; 240 240 our $Operators = qr{ 241 241 <=|>=|==|!=|
+30 -19
sound/pci/hda/hda_intel.c
··· 656 656 #define get_azx_dev(substream) (substream->runtime->private_data) 657 657 658 658 #ifdef CONFIG_X86 659 - static void __mark_pages_wc(struct azx *chip, void *addr, size_t size, bool on) 659 + static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool on) 660 660 { 661 + int pages; 662 + 661 663 if (azx_snoop(chip)) 662 664 return; 663 - if (addr && size) { 664 - int pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; 665 + if (!dmab || !dmab->area || !dmab->bytes) 666 + return; 667 + 668 + #ifdef CONFIG_SND_DMA_SGBUF 669 + if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_SG) { 670 + struct snd_sg_buf *sgbuf = dmab->private_data; 665 671 if (on) 666 - set_memory_wc((unsigned long)addr, pages); 672 + set_pages_array_wc(sgbuf->page_table, sgbuf->pages); 667 673 else 668 - set_memory_wb((unsigned long)addr, pages); 674 + set_pages_array_wb(sgbuf->page_table, sgbuf->pages); 675 + return; 669 676 } 677 + #endif 678 + 679 + pages = (dmab->bytes + PAGE_SIZE - 1) >> PAGE_SHIFT; 680 + if (on) 681 + set_memory_wc((unsigned long)dmab->area, pages); 682 + else 683 + set_memory_wb((unsigned long)dmab->area, pages); 670 684 } 671 685 672 686 static inline void mark_pages_wc(struct azx *chip, struct snd_dma_buffer *buf, 673 687 bool on) 674 688 { 675 - __mark_pages_wc(chip, buf->area, buf->bytes, on); 689 + __mark_pages_wc(chip, buf, on); 676 690 } 677 691 static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev, 678 - struct snd_pcm_runtime *runtime, bool on) 692 + struct snd_pcm_substream *substream, bool on) 679 693 { 680 694 if (azx_dev->wc_marked != on) { 681 - __mark_pages_wc(chip, runtime->dma_area, runtime->dma_bytes, on); 695 + __mark_pages_wc(chip, snd_pcm_get_dma_buf(substream), on); 682 696 azx_dev->wc_marked = on; 683 697 } 684 698 } ··· 703 689 { 704 690 } 705 691 static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev, 706 - struct snd_pcm_runtime *runtime, bool on) 692 + struct snd_pcm_substream *substream, bool on) 707 693 { 708 694 } 709 695 #endif ··· 1982 1968 { 1983 1969 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); 1984 1970 struct azx *chip = apcm->chip; 1985 - struct snd_pcm_runtime *runtime = substream->runtime; 1986 1971 struct azx_dev *azx_dev = get_azx_dev(substream); 1987 1972 int ret; 1988 1973 1989 - mark_runtime_wc(chip, azx_dev, runtime, false); 1974 + mark_runtime_wc(chip, azx_dev, substream, false); 1990 1975 azx_dev->bufsize = 0; 1991 1976 azx_dev->period_bytes = 0; 1992 1977 azx_dev->format_val = 0; ··· 1993 1980 params_buffer_bytes(hw_params)); 1994 1981 if (ret < 0) 1995 1982 return ret; 1996 - mark_runtime_wc(chip, azx_dev, runtime, true); 1983 + mark_runtime_wc(chip, azx_dev, substream, true); 1997 1984 return ret; 1998 1985 } 1999 1986 ··· 2002 1989 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); 2003 1990 struct azx_dev *azx_dev = get_azx_dev(substream); 2004 1991 struct azx *chip = apcm->chip; 2005 - struct snd_pcm_runtime *runtime = substream->runtime; 2006 1992 struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream]; 2007 1993 2008 1994 /* reset BDL address */ ··· 2014 2002 2015 2003 snd_hda_codec_cleanup(apcm->codec, hinfo, substream); 2016 2004 2017 - mark_runtime_wc(chip, azx_dev, runtime, false); 2005 + mark_runtime_wc(chip, azx_dev, substream, false); 2018 2006 return snd_pcm_lib_free_pages(substream); 2019 2007 } 2020 2008 ··· 3625 3613 /* 5 Series/3400 */ 3626 3614 { PCI_DEVICE(0x8086, 0x3b56), 3627 3615 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH }, 3628 - /* SCH */ 3616 + /* Poulsbo */ 3629 3617 { PCI_DEVICE(0x8086, 0x811b), 3630 - .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3631 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_POSFIX_LPIB }, /* Poulsbo */ 3618 + .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM }, 3619 + /* Oaktrail */ 3632 3620 { PCI_DEVICE(0x8086, 0x080a), 3633 - .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3634 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_POSFIX_LPIB }, /* Oaktrail */ 3621 + .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM }, 3635 3622 /* ICH */ 3636 3623 { PCI_DEVICE(0x8086, 0x2668), 3637 3624 .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_OLD_SSYNC |
+2
sound/pci/hda/patch_realtek.c
··· 4694 4694 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), 4695 4695 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), 4696 4696 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), 4697 + SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST), 4697 4698 SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_FIXUP_F1734), 4698 4699 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), 4699 4700 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), ··· 5709 5708 }; 5710 5709 5711 5710 static const struct snd_pci_quirk alc268_fixup_tbl[] = { 5711 + SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC), 5712 5712 /* below is codec SSID since multiple Toshiba laptops have the 5713 5713 * same PCI SSID 1179:ff00 5714 5714 */
+4 -1
sound/soc/codecs/arizona.c
··· 685 685 } 686 686 sr_val = i; 687 687 688 - lrclk = snd_soc_params_to_bclk(params) / params_rate(params); 688 + lrclk = rates[bclk] / params_rate(params); 689 689 690 690 arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n", 691 691 rates[bclk], rates[bclk] / lrclk); ··· 1081 1081 dev_err(arizona->dev, "Failed to get FLL%d clock OK IRQ: %d\n", 1082 1082 id, ret); 1083 1083 } 1084 + 1085 + regmap_update_bits(arizona->regmap, fll->base + 1, 1086 + ARIZONA_FLL1_FREERUN, 0); 1084 1087 1085 1088 return 0; 1086 1089 }
-3
sound/soc/codecs/wm2200.c
··· 1019 1019 "EQR", 1020 1020 "LHPF1", 1021 1021 "LHPF2", 1022 - "LHPF3", 1023 - "LHPF4", 1024 1022 "DSP1.1", 1025 1023 "DSP1.2", 1026 1024 "DSP1.3", ··· 1051 1053 0x25, 1052 1054 0x50, /* EQ */ 1053 1055 0x51, 1054 - 0x52, 1055 1056 0x60, /* LHPF1 */ 1056 1057 0x61, /* LHPF2 */ 1057 1058 0x68, /* DSP1 */
+1 -2
sound/soc/codecs/wm5102.c
··· 896 896 897 897 static const struct soc_enum wm5102_aec_loopback = 898 898 SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, 899 - ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 900 - ARIZONA_AEC_LOOPBACK_SRC_MASK, 899 + ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf, 901 900 ARRAY_SIZE(wm5102_aec_loopback_texts), 902 901 wm5102_aec_loopback_texts, 903 902 wm5102_aec_loopback_values);
+1 -2
sound/soc/codecs/wm5110.c
··· 344 344 345 345 static const struct soc_enum wm5110_aec_loopback = 346 346 SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, 347 - ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 348 - ARIZONA_AEC_LOOPBACK_SRC_MASK, 347 + ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf, 349 348 ARRAY_SIZE(wm5110_aec_loopback_texts), 350 349 wm5110_aec_loopback_texts, 351 350 wm5110_aec_loopback_values);
+3 -3
sound/soc/codecs/wm_adsp.c
··· 324 324 325 325 if (reg) { 326 326 buf = kmemdup(region->data, le32_to_cpu(region->len), 327 - GFP_KERNEL); 327 + GFP_KERNEL | GFP_DMA); 328 328 if (!buf) { 329 329 adsp_err(dsp, "Out of memory\n"); 330 330 return -ENOMEM; ··· 396 396 hdr = (void*)&firmware->data[0]; 397 397 if (memcmp(hdr->magic, "WMDR", 4) != 0) { 398 398 adsp_err(dsp, "%s: invalid magic\n", file); 399 - return -EINVAL; 399 + goto out_fw; 400 400 } 401 401 402 402 adsp_dbg(dsp, "%s: v%d.%d.%d\n", file, ··· 439 439 440 440 if (reg) { 441 441 buf = kmemdup(blk->data, le32_to_cpu(blk->len), 442 - GFP_KERNEL); 442 + GFP_KERNEL | GFP_DMA); 443 443 if (!buf) { 444 444 adsp_err(dsp, "Out of memory\n"); 445 445 return -ENOMEM;
+1 -20
sound/soc/fsl/imx-pcm-dma.c
··· 154 154 .pcm_free = imx_pcm_free, 155 155 }; 156 156 157 - static int imx_soc_platform_probe(struct platform_device *pdev) 157 + int imx_pcm_dma_init(struct platform_device *pdev) 158 158 { 159 159 return snd_soc_register_platform(&pdev->dev, &imx_soc_platform_mx2); 160 160 } 161 - 162 - static int imx_soc_platform_remove(struct platform_device *pdev) 163 - { 164 - snd_soc_unregister_platform(&pdev->dev); 165 - return 0; 166 - } 167 - 168 - static struct platform_driver imx_pcm_driver = { 169 - .driver = { 170 - .name = "imx-pcm-audio", 171 - .owner = THIS_MODULE, 172 - }, 173 - .probe = imx_soc_platform_probe, 174 - .remove = imx_soc_platform_remove, 175 - }; 176 - 177 - module_platform_driver(imx_pcm_driver); 178 - MODULE_LICENSE("GPL"); 179 - MODULE_ALIAS("platform:imx-pcm-audio");
+1 -21
sound/soc/fsl/imx-pcm-fiq.c
··· 281 281 .pcm_free = imx_pcm_fiq_free, 282 282 }; 283 283 284 - static int imx_soc_platform_probe(struct platform_device *pdev) 284 + int imx_pcm_fiq_init(struct platform_device *pdev) 285 285 { 286 286 struct imx_ssi *ssi = platform_get_drvdata(pdev); 287 287 int ret; ··· 314 314 315 315 return ret; 316 316 } 317 - 318 - static int imx_soc_platform_remove(struct platform_device *pdev) 319 - { 320 - snd_soc_unregister_platform(&pdev->dev); 321 - return 0; 322 - } 323 - 324 - static struct platform_driver imx_pcm_driver = { 325 - .driver = { 326 - .name = "imx-fiq-pcm-audio", 327 - .owner = THIS_MODULE, 328 - }, 329 - 330 - .probe = imx_soc_platform_probe, 331 - .remove = imx_soc_platform_remove, 332 - }; 333 - 334 - module_platform_driver(imx_pcm_driver); 335 - 336 - MODULE_LICENSE("GPL");
+32
sound/soc/fsl/imx-pcm.c
··· 104 104 } 105 105 EXPORT_SYMBOL_GPL(imx_pcm_free); 106 106 107 + static int imx_pcm_probe(struct platform_device *pdev) 108 + { 109 + if (strcmp(pdev->id_entry->name, "imx-fiq-pcm-audio") == 0) 110 + return imx_pcm_fiq_init(pdev); 111 + 112 + return imx_pcm_dma_init(pdev); 113 + } 114 + 115 + static int imx_pcm_remove(struct platform_device *pdev) 116 + { 117 + snd_soc_unregister_platform(&pdev->dev); 118 + return 0; 119 + } 120 + 121 + static struct platform_device_id imx_pcm_devtype[] = { 122 + { .name = "imx-pcm-audio", }, 123 + { .name = "imx-fiq-pcm-audio", }, 124 + { /* sentinel */ } 125 + }; 126 + MODULE_DEVICE_TABLE(platform, imx_pcm_devtype); 127 + 128 + static struct platform_driver imx_pcm_driver = { 129 + .driver = { 130 + .name = "imx-pcm", 131 + .owner = THIS_MODULE, 132 + }, 133 + .id_table = imx_pcm_devtype, 134 + .probe = imx_pcm_probe, 135 + .remove = imx_pcm_remove, 136 + }; 137 + module_platform_driver(imx_pcm_driver); 138 + 107 139 MODULE_DESCRIPTION("Freescale i.MX PCM driver"); 108 140 MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>"); 109 141 MODULE_LICENSE("GPL");
+18
sound/soc/fsl/imx-pcm.h
··· 30 30 int imx_pcm_new(struct snd_soc_pcm_runtime *rtd); 31 31 void imx_pcm_free(struct snd_pcm *pcm); 32 32 33 + #ifdef CONFIG_SND_SOC_IMX_PCM_DMA 34 + int imx_pcm_dma_init(struct platform_device *pdev); 35 + #else 36 + static inline int imx_pcm_dma_init(struct platform_device *pdev) 37 + { 38 + return -ENODEV; 39 + } 40 + #endif 41 + 42 + #ifdef CONFIG_SND_SOC_IMX_PCM_FIQ 43 + int imx_pcm_fiq_init(struct platform_device *pdev); 44 + #else 45 + static inline int imx_pcm_fiq_init(struct platform_device *pdev) 46 + { 47 + return -ENODEV; 48 + } 49 + #endif 50 + 33 51 #endif /* _IMX_PCM_H */
+10 -2
sound/soc/soc-dapm.c
··· 1023 1023 1024 1024 if (SND_SOC_DAPM_EVENT_ON(event)) { 1025 1025 if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) { 1026 - ret = regulator_allow_bypass(w->regulator, true); 1026 + ret = regulator_allow_bypass(w->regulator, false); 1027 1027 if (ret != 0) 1028 1028 dev_warn(w->dapm->dev, 1029 1029 "ASoC: Failed to bypass %s: %d\n", ··· 1033 1033 return regulator_enable(w->regulator); 1034 1034 } else { 1035 1035 if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) { 1036 - ret = regulator_allow_bypass(w->regulator, false); 1036 + ret = regulator_allow_bypass(w->regulator, true); 1037 1037 if (ret != 0) 1038 1038 dev_warn(w->dapm->dev, 1039 1039 "ASoC: Failed to unbypass %s: %d\n", ··· 3038 3038 dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n", 3039 3039 w->name, ret); 3040 3040 return NULL; 3041 + } 3042 + 3043 + if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) { 3044 + ret = regulator_allow_bypass(w->regulator, true); 3045 + if (ret != 0) 3046 + dev_warn(w->dapm->dev, 3047 + "ASoC: Failed to unbypass %s: %d\n", 3048 + w->name, ret); 3041 3049 } 3042 3050 break; 3043 3051 case snd_soc_dapm_clock_supply:
+12 -5
sound/usb/mixer.c
··· 1331 1331 } 1332 1332 channels = (hdr->bLength - 7) / csize - 1; 1333 1333 bmaControls = hdr->bmaControls; 1334 + if (hdr->bLength < 7 + csize) { 1335 + snd_printk(KERN_ERR "usbaudio: unit %u: " 1336 + "invalid UAC_FEATURE_UNIT descriptor\n", 1337 + unitid); 1338 + return -EINVAL; 1339 + } 1334 1340 } else { 1335 1341 struct uac2_feature_unit_descriptor *ftr = _ftr; 1336 1342 csize = 4; 1337 1343 channels = (hdr->bLength - 6) / 4 - 1; 1338 1344 bmaControls = ftr->bmaControls; 1339 - } 1340 - 1341 - if (hdr->bLength < 7 || !csize || hdr->bLength < 7 + csize) { 1342 - snd_printk(KERN_ERR "usbaudio: unit %u: invalid UAC_FEATURE_UNIT descriptor\n", unitid); 1343 - return -EINVAL; 1345 + if (hdr->bLength < 6 + csize) { 1346 + snd_printk(KERN_ERR "usbaudio: unit %u: " 1347 + "invalid UAC_FEATURE_UNIT descriptor\n", 1348 + unitid); 1349 + return -EINVAL; 1350 + } 1344 1351 } 1345 1352 1346 1353 /* parse the source unit */
+2
tools/vm/.gitignore
··· 1 + slabinfo 2 + page-types