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

Merge commit 'v2.6.36-rc7' into perf/core

Conflicts:
arch/x86/kernel/module.c

Merge reason: Resolve the conflict, pick up fixes.

Signed-off-by: Ingo Molnar <mingo@elte.hu>

+2601 -1390
+4 -4
CREDITS
··· 3554 3554 D: portions of the Linux Security Module (LSM) framework and security modules 3555 3555 3556 3556 N: Petr Vandrovec 3557 - E: vandrove@vc.cvut.cz 3557 + E: petr@vandrovec.name 3558 3558 D: Small contributions to ncpfs 3559 3559 D: Matrox framebuffer driver 3560 - S: Chudenicka 8 3561 - S: 10200 Prague 10, Hostivar 3562 - S: Czech Republic 3560 + S: 21513 Conradia Ct 3561 + S: Cupertino, CA 95014 3562 + S: USA 3563 3563 3564 3564 N: Thibaut Varene 3565 3565 E: T-Bone@parisc-linux.org
+27 -11
MAINTAINERS
··· 962 962 S: Maintained 963 963 F: arch/arm/mach-s3c6410/ 964 964 965 + ARM/S5P ARM ARCHITECTURES 966 + M: Kukjin Kim <kgene.kim@samsung.com> 967 + L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 968 + L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers) 969 + S: Maintained 970 + F: arch/arm/mach-s5p*/ 971 + 965 972 ARM/SHMOBILE ARM ARCHITECTURE 966 973 M: Paul Mundt <lethal@linux-sh.org> 967 974 M: Magnus Damm <magnus.damm@gmail.com> ··· 1227 1220 F: include/linux/cfag12864b.h 1228 1221 1229 1222 AVR32 ARCHITECTURE 1230 - M: Haavard Skinnemoen <hskinnemoen@atmel.com> 1223 + M: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> 1231 1224 W: http://www.atmel.com/products/AVR32/ 1232 1225 W: http://avr32linux.org/ 1233 1226 W: http://avrfreaks.net/ ··· 1235 1228 F: arch/avr32/ 1236 1229 1237 1230 AVR32/AT32AP MACHINE SUPPORT 1238 - M: Haavard Skinnemoen <hskinnemoen@atmel.com> 1231 + M: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> 1239 1232 S: Supported 1240 1233 F: arch/avr32/mach-at32ap/ 1241 1234 ··· 2206 2199 S: Maintained 2207 2200 F: drivers/platform/x86/eeepc-laptop.c 2208 2201 2202 + EFIFB FRAMEBUFFER DRIVER 2203 + L: linux-fbdev@vger.kernel.org 2204 + M: Peter Jones <pjones@redhat.com> 2205 + S: Maintained 2206 + F: drivers/video/efifb.c 2207 + 2209 2208 EFS FILESYSTEM 2210 2209 W: http://aeschi.ch.eu.org/efs/ 2211 2210 S: Orphan ··· 2675 2662 L: lm-sensors@lm-sensors.org 2676 2663 W: http://www.lm-sensors.org/ 2677 2664 T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/ 2665 + T: quilt kernel.org/pub/linux/kernel/people/groeck/linux-staging/ 2666 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git 2678 2667 S: Maintained 2679 2668 F: Documentation/hwmon/ 2680 2669 F: drivers/hwmon/ ··· 3788 3773 S: Supported 3789 3774 3790 3775 MATROX FRAMEBUFFER DRIVER 3791 - M: Petr Vandrovec <vandrove@vc.cvut.cz> 3792 3776 L: linux-fbdev@vger.kernel.org 3793 - S: Maintained 3777 + S: Orphan 3794 3778 F: drivers/video/matrox/matroxfb_* 3795 3779 F: include/linux/matroxfb.h 3796 3780 ··· 3913 3899 F: drivers/char/mxser.* 3914 3900 3915 3901 MSI LAPTOP SUPPORT 3916 - M: Lennart Poettering <mzxreary@0pointer.de> 3902 + M: Lee, Chun-Yi <jlee@novell.com> 3917 3903 L: platform-driver-x86@vger.kernel.org 3918 - W: https://tango.0pointer.de/mailman/listinfo/s270-linux 3919 - W: http://0pointer.de/lennart/tchibo.html 3920 3904 S: Maintained 3921 3905 F: drivers/platform/x86/msi-laptop.c 3922 3906 ··· 3931 3919 F: drivers/mfd/ 3932 3920 3933 3921 MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM 3934 - S: Orphan 3922 + M: Chris Ball <cjb@laptop.org> 3935 3923 L: linux-mmc@vger.kernel.org 3924 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git 3925 + S: Maintained 3936 3926 F: drivers/mmc/ 3937 3927 F: include/linux/mmc/ 3938 3928 ··· 3976 3962 F: drivers/net/natsemi.c 3977 3963 3978 3964 NCP FILESYSTEM 3979 - M: Petr Vandrovec <vandrove@vc.cvut.cz> 3980 - S: Maintained 3965 + M: Petr Vandrovec <petr@vandrovec.name> 3966 + S: Odd Fixes 3981 3967 F: fs/ncpfs/ 3982 3968 3983 3969 NCR DUAL 700 SCSI DRIVER (MICROCHANNEL) ··· 5105 5091 F: drivers/mmc/host/sdricoh_cs.c 5106 5092 5107 5093 SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER 5108 - S: Orphan 5094 + M: Chris Ball <cjb@laptop.org> 5109 5095 L: linux-mmc@vger.kernel.org 5096 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git 5097 + S: Maintained 5110 5098 F: drivers/mmc/host/sdhci.* 5111 5099 5112 5100 SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF)
+1 -1
Makefile
··· 1 1 VERSION = 2 2 2 PATCHLEVEL = 6 3 3 SUBLEVEL = 36 4 - EXTRAVERSION = -rc5 4 + EXTRAVERSION = -rc7 5 5 NAME = Sheep on Meth 6 6 7 7 # *DOCUMENTATION*
+7 -13
arch/alpha/kernel/entry.S
··· 73 73 ldq $20, HAE_REG($19); \ 74 74 stq $21, HAE_CACHE($19); \ 75 75 stq $21, 0($20); \ 76 - ldq $0, 0($sp); \ 77 - ldq $1, 8($sp); \ 78 76 99:; \ 79 77 ldq $19, 72($sp); \ 80 78 ldq $20, 80($sp); \ ··· 314 316 cmovne $26, 0, $19 /* $19 = 0 => non-restartable */ 315 317 ldq $0, SP_OFF($sp) 316 318 and $0, 8, $0 317 - beq $0, restore_all 319 + beq $0, ret_to_kernel 318 320 ret_to_user: 319 321 /* Make sure need_resched and sigpending don't change between 320 322 sampling and the rti. */ ··· 326 328 restore_all: 327 329 RESTORE_ALL 328 330 call_pal PAL_rti 331 + 332 + ret_to_kernel: 333 + lda $16, 7 334 + call_pal PAL_swpipl 335 + br restore_all 329 336 330 337 .align 3 331 338 $syscall_error: ··· 660 657 /* We don't actually care for a3 success widgetry in the kernel. 661 658 Not for positive errno values. */ 662 659 stq $0, 0($sp) /* $0 */ 663 - br restore_all 660 + br ret_to_kernel 664 661 .end kernel_thread 665 662 666 663 /* ··· 913 910 mov $sp, $19 914 911 jmp $31, do_sys_execve 915 912 .end sys_execve 916 - 917 - .align 4 918 - .globl osf_sigprocmask 919 - .ent osf_sigprocmask 920 - osf_sigprocmask: 921 - .prologue 0 922 - mov $sp, $18 923 - jmp $31, sys_osf_sigprocmask 924 - .end osf_sigprocmask 925 913 926 914 .align 4 927 915 .globl alpha_ni_syscall
+1 -1
arch/alpha/kernel/process.c
··· 356 356 dest[27] = pt->r27; 357 357 dest[28] = pt->r28; 358 358 dest[29] = pt->gp; 359 - dest[30] = rdusp(); 359 + dest[30] = ti == current_thread_info() ? rdusp() : ti->pcb.usp; 360 360 dest[31] = pt->pc; 361 361 362 362 /* Once upon a time this was the PS value. Which is stupid
+14 -40
arch/alpha/kernel/signal.c
··· 41 41 /* 42 42 * The OSF/1 sigprocmask calling sequence is different from the 43 43 * C sigprocmask() sequence.. 44 - * 45 - * how: 46 - * 1 - SIG_BLOCK 47 - * 2 - SIG_UNBLOCK 48 - * 3 - SIG_SETMASK 49 - * 50 - * We change the range to -1 .. 1 in order to let gcc easily 51 - * use the conditional move instructions. 52 - * 53 - * Note that we don't need to acquire the kernel lock for SMP 54 - * operation, as all of this is local to this thread. 55 44 */ 56 - SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask, 57 - struct pt_regs *, regs) 45 + SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask) 58 46 { 59 - unsigned long oldmask = -EINVAL; 47 + sigset_t oldmask; 48 + sigset_t mask; 49 + unsigned long res; 60 50 61 - if ((unsigned long)how-1 <= 2) { 62 - long sign = how-2; /* -1 .. 1 */ 63 - unsigned long block, unblock; 64 - 65 - newmask &= _BLOCKABLE; 66 - spin_lock_irq(&current->sighand->siglock); 67 - oldmask = current->blocked.sig[0]; 68 - 69 - unblock = oldmask & ~newmask; 70 - block = oldmask | newmask; 71 - if (!sign) 72 - block = unblock; 73 - if (sign <= 0) 74 - newmask = block; 75 - if (_NSIG_WORDS > 1 && sign > 0) 76 - sigemptyset(&current->blocked); 77 - current->blocked.sig[0] = newmask; 78 - recalc_sigpending(); 79 - spin_unlock_irq(&current->sighand->siglock); 80 - 81 - regs->r0 = 0; /* special no error return */ 51 + siginitset(&mask, newmask & _BLOCKABLE); 52 + res = sigprocmask(how, &mask, &oldmask); 53 + if (!res) { 54 + force_successful_syscall_return(); 55 + res = oldmask.sig[0]; 82 56 } 83 - return oldmask; 57 + return res; 84 58 } 85 59 86 60 SYSCALL_DEFINE3(osf_sigaction, int, sig, ··· 68 94 old_sigset_t mask; 69 95 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 70 96 __get_user(new_ka.sa.sa_handler, &act->sa_handler) || 71 - __get_user(new_ka.sa.sa_flags, &act->sa_flags)) 97 + __get_user(new_ka.sa.sa_flags, &act->sa_flags) || 98 + __get_user(mask, &act->sa_mask)) 72 99 return -EFAULT; 73 - __get_user(mask, &act->sa_mask); 74 100 siginitset(&new_ka.sa.sa_mask, mask); 75 101 new_ka.ka_restorer = NULL; 76 102 } ··· 80 106 if (!ret && oact) { 81 107 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 82 108 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || 83 - __put_user(old_ka.sa.sa_flags, &oact->sa_flags)) 109 + __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || 110 + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) 84 111 return -EFAULT; 85 - __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); 86 112 } 87 113 88 114 return ret;
+1 -1
arch/alpha/kernel/systbls.S
··· 58 58 .quad sys_open /* 45 */ 59 59 .quad alpha_ni_syscall 60 60 .quad sys_getxgid 61 - .quad osf_sigprocmask 61 + .quad sys_osf_sigprocmask 62 62 .quad alpha_ni_syscall 63 63 .quad alpha_ni_syscall /* 50 */ 64 64 .quad sys_acct
+26 -1
arch/arm/Kconfig
··· 271 271 bool "Atmel AT91" 272 272 select ARCH_REQUIRE_GPIOLIB 273 273 select HAVE_CLK 274 - select ARCH_USES_GETTIMEOFFSET 275 274 help 276 275 This enables support for systems based on the Atmel AT91RM9200, 277 276 AT91SAM9 and AT91CAP9 processors. ··· 1049 1050 workaround disables the write-allocate mode for the L2 cache via the 1050 1051 ACTLR register. Note that setting specific bits in the ACTLR register 1051 1052 may not be available in non-secure mode. 1053 + 1054 + config ARM_ERRATA_742230 1055 + bool "ARM errata: DMB operation may be faulty" 1056 + depends on CPU_V7 && SMP 1057 + help 1058 + This option enables the workaround for the 742230 Cortex-A9 1059 + (r1p0..r2p2) erratum. Under rare circumstances, a DMB instruction 1060 + between two write operations may not ensure the correct visibility 1061 + ordering of the two writes. This workaround sets a specific bit in 1062 + the diagnostic register of the Cortex-A9 which causes the DMB 1063 + instruction to behave as a DSB, ensuring the correct behaviour of 1064 + the two writes. 1065 + 1066 + config ARM_ERRATA_742231 1067 + bool "ARM errata: Incorrect hazard handling in the SCU may lead to data corruption" 1068 + depends on CPU_V7 && SMP 1069 + help 1070 + This option enables the workaround for the 742231 Cortex-A9 1071 + (r2p0..r2p2) erratum. Under certain conditions, specific to the 1072 + Cortex-A9 MPCore micro-architecture, two CPUs working in SMP mode, 1073 + accessing some data located in the same cache line, may get corrupted 1074 + data due to bad handling of the address hazard when the line gets 1075 + replaced from one of the CPUs at the same time as another CPU is 1076 + accessing it. This workaround sets specific bits in the diagnostic 1077 + register of the Cortex-A9 which reduces the linefill issuing 1078 + capabilities of the processor. 1052 1079 1053 1080 config PL310_ERRATA_588369 1054 1081 bool "Clean & Invalidate maintenance operations do not invalidate clean lines"
+1 -1
arch/arm/boot/compressed/Makefile
··· 116 116 $(obj)/font.c: $(FONTC) 117 117 $(call cmd,shipped) 118 118 119 - $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config 119 + $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG) 120 120 @sed "$(SEDFLAGS)" < $< > $@
+8
arch/arm/common/it8152.c
··· 271 271 ((dma_addr + size - PHYS_OFFSET) >= SZ_64M); 272 272 } 273 273 274 + int dma_set_coherent_mask(struct device *dev, u64 mask) 275 + { 276 + if (mask >= PHYS_OFFSET + SZ_64M - 1) 277 + return 0; 278 + 279 + return -EIO; 280 + } 281 + 274 282 int __init it8152_pci_setup(int nr, struct pci_sys_data *sys) 275 283 { 276 284 it8152_io.start = IT8152_IO_BASE + 0x12000;
+4
arch/arm/include/asm/pgtable.h
··· 317 317 #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE 318 318 #define pgprot_dmacoherent(prot) \ 319 319 __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) 320 + #define __HAVE_PHYS_MEM_ACCESS_PROT 321 + struct file; 322 + extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 323 + unsigned long size, pgprot_t vma_prot); 320 324 #else 321 325 #define pgprot_dmacoherent(prot) \ 322 326 __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_UNCACHED)
+2
arch/arm/kernel/entry-common.S
··· 48 48 beq no_work_pending 49 49 mov r0, sp @ 'regs' 50 50 mov r2, why @ 'syscall' 51 + tst r1, #_TIF_SIGPENDING @ delivering a signal? 52 + movne why, #0 @ prevent further restarts 51 53 bl do_notify_resume 52 54 b ret_slow_syscall @ Check work again 53 55
+2 -2
arch/arm/mach-at91/at91sam9g45_devices.c
··· 426 426 .sda_is_open_drain = 1, 427 427 .scl_pin = AT91_PIN_PA21, 428 428 .scl_is_open_drain = 1, 429 - .udelay = 2, /* ~100 kHz */ 429 + .udelay = 5, /* ~100 kHz */ 430 430 }; 431 431 432 432 static struct platform_device at91sam9g45_twi0_device = { ··· 440 440 .sda_is_open_drain = 1, 441 441 .scl_pin = AT91_PIN_PB11, 442 442 .scl_is_open_drain = 1, 443 - .udelay = 2, /* ~100 kHz */ 443 + .udelay = 5, /* ~100 kHz */ 444 444 }; 445 445 446 446 static struct platform_device at91sam9g45_twi1_device = {
+1 -2
arch/arm/mach-davinci/dm355.c
··· 769 769 .virtual = SRAM_VIRT, 770 770 .pfn = __phys_to_pfn(0x00010000), 771 771 .length = SZ_32K, 772 - /* MT_MEMORY_NONCACHED requires supersection alignment */ 773 - .type = MT_DEVICE, 772 + .type = MT_MEMORY_NONCACHED, 774 773 }, 775 774 }; 776 775
+1 -2
arch/arm/mach-davinci/dm365.c
··· 969 969 .virtual = SRAM_VIRT, 970 970 .pfn = __phys_to_pfn(0x00010000), 971 971 .length = SZ_32K, 972 - /* MT_MEMORY_NONCACHED requires supersection alignment */ 973 - .type = MT_DEVICE, 972 + .type = MT_MEMORY_NONCACHED, 974 973 }, 975 974 }; 976 975
+1 -2
arch/arm/mach-davinci/dm644x.c
··· 653 653 .virtual = SRAM_VIRT, 654 654 .pfn = __phys_to_pfn(0x00008000), 655 655 .length = SZ_16K, 656 - /* MT_MEMORY_NONCACHED requires supersection alignment */ 657 - .type = MT_DEVICE, 656 + .type = MT_MEMORY_NONCACHED, 658 657 }, 659 658 }; 660 659
+1 -2
arch/arm/mach-davinci/dm646x.c
··· 737 737 .virtual = SRAM_VIRT, 738 738 .pfn = __phys_to_pfn(0x00010000), 739 739 .length = SZ_32K, 740 - /* MT_MEMORY_NONCACHED requires supersection alignment */ 741 - .type = MT_DEVICE, 740 + .type = MT_MEMORY_NONCACHED, 742 741 }, 743 742 }; 744 743
+3 -3
arch/arm/mach-dove/include/mach/io.h
··· 13 13 14 14 #define IO_SPACE_LIMIT 0xffffffff 15 15 16 - #define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_PHYS_BASE) +\ 17 - DOVE_PCIE0_IO_VIRT_BASE)) 18 - #define __mem_pci(a) (a) 16 + #define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \ 17 + DOVE_PCIE0_IO_VIRT_BASE)) 18 + #define __mem_pci(a) (a) 19 19 20 20 #endif
+8
arch/arm/mach-ixp4xx/common-pci.c
··· 503 503 return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys); 504 504 } 505 505 506 + int dma_set_coherent_mask(struct device *dev, u64 mask) 507 + { 508 + if (mask >= SZ_64M - 1) 509 + return 0; 510 + 511 + return -EIO; 512 + } 513 + 506 514 EXPORT_SYMBOL(ixp4xx_pci_read); 507 515 EXPORT_SYMBOL(ixp4xx_pci_write); 508 516
+2
arch/arm/mach-ixp4xx/include/mach/hardware.h
··· 26 26 #define PCIBIOS_MAX_MEM 0x4BFFFFFF 27 27 #endif 28 28 29 + #define ARCH_HAS_DMA_SET_COHERENT_MASK 30 + 29 31 #define pcibios_assign_all_busses() 1 30 32 31 33 /* Register locations and bits */
+1 -1
arch/arm/mach-kirkwood/include/mach/kirkwood.h
··· 38 38 39 39 #define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000 40 40 #define KIRKWOOD_PCIE1_IO_VIRT_BASE 0xfef00000 41 - #define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00000000 41 + #define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00100000 42 42 #define KIRKWOOD_PCIE1_IO_SIZE SZ_1M 43 43 44 44 #define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000
+2 -2
arch/arm/mach-kirkwood/pcie.c
··· 117 117 * IORESOURCE_IO 118 118 */ 119 119 pp->res[0].name = "PCIe 0 I/O Space"; 120 - pp->res[0].start = KIRKWOOD_PCIE_IO_PHYS_BASE; 120 + pp->res[0].start = KIRKWOOD_PCIE_IO_BUS_BASE; 121 121 pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1; 122 122 pp->res[0].flags = IORESOURCE_IO; 123 123 ··· 139 139 * IORESOURCE_IO 140 140 */ 141 141 pp->res[0].name = "PCIe 1 I/O Space"; 142 - pp->res[0].start = KIRKWOOD_PCIE1_IO_PHYS_BASE; 142 + pp->res[0].start = KIRKWOOD_PCIE1_IO_BUS_BASE; 143 143 pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE1_IO_SIZE - 1; 144 144 pp->res[0].flags = IORESOURCE_IO; 145 145
+6 -1
arch/arm/mach-mmp/include/mach/system.h
··· 9 9 #ifndef __ASM_MACH_SYSTEM_H 10 10 #define __ASM_MACH_SYSTEM_H 11 11 12 + #include <mach/cputype.h> 13 + 12 14 static inline void arch_idle(void) 13 15 { 14 16 cpu_do_idle(); ··· 18 16 19 17 static inline void arch_reset(char mode, const char *cmd) 20 18 { 21 - cpu_reset(0); 19 + if (cpu_is_pxa168()) 20 + cpu_reset(0xffff0000); 21 + else 22 + cpu_reset(0); 22 23 } 23 24 #endif /* __ASM_MACH_SYSTEM_H */
+1 -2
arch/arm/mach-pxa/cpufreq-pxa2xx.c
··· 312 312 freqs.cpu = policy->cpu; 313 313 314 314 if (freq_debug) 315 - pr_debug(KERN_INFO "Changing CPU frequency to %d Mhz, " 316 - "(SDRAM %d Mhz)\n", 315 + pr_debug("Changing CPU frequency to %d Mhz, (SDRAM %d Mhz)\n", 317 316 freqs.new / 1000, (pxa_freq_settings[idx].div2) ? 318 317 (new_freq_mem / 2000) : (new_freq_mem / 1000)); 319 318
+13 -1
arch/arm/mach-pxa/include/mach/hardware.h
··· 264 264 * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x 265 265 * == 0x3 for pxa300/pxa310/pxa320 266 266 */ 267 + #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) 267 268 #define __cpu_is_pxa2xx(id) \ 268 269 ({ \ 269 270 unsigned int _id = (id) >> 13 & 0x7; \ 270 271 _id <= 0x2; \ 271 272 }) 273 + #else 274 + #define __cpu_is_pxa2xx(id) (0) 275 + #endif 272 276 277 + #ifdef CONFIG_PXA3xx 273 278 #define __cpu_is_pxa3xx(id) \ 274 279 ({ \ 275 280 unsigned int _id = (id) >> 13 & 0x7; \ 276 281 _id == 0x3; \ 277 282 }) 283 + #else 284 + #define __cpu_is_pxa3xx(id) (0) 285 + #endif 278 286 287 + #if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935) 279 288 #define __cpu_is_pxa93x(id) \ 280 289 ({ \ 281 290 unsigned int _id = (id) >> 4 & 0xfff; \ 282 291 _id == 0x683 || _id == 0x693; \ 283 292 }) 293 + #else 294 + #define __cpu_is_pxa93x(id) (0) 295 + #endif 284 296 285 297 #define cpu_is_pxa2xx() \ 286 298 ({ \ ··· 321 309 #define PCIBIOS_MIN_IO 0 322 310 #define PCIBIOS_MIN_MEM 0 323 311 #define pcibios_assign_all_busses() 1 312 + #define ARCH_HAS_DMA_SET_COHERENT_MASK 324 313 #endif 325 - 326 314 327 315 #endif /* _ASM_ARCH_HARDWARE_H */
+2
arch/arm/mach-pxa/include/mach/io.h
··· 6 6 #ifndef __ASM_ARM_ARCH_IO_H 7 7 #define __ASM_ARM_ARCH_IO_H 8 8 9 + #include <mach/hardware.h> 10 + 9 11 #define IO_SPACE_LIMIT 0xffffffff 10 12 11 13 /*
+5 -1
arch/arm/mach-pxa/palm27x.c
··· 469 469 }, 470 470 }; 471 471 472 + static struct i2c_pxa_platform_data palm27x_i2c_power_info = { 473 + .use_pio = 1, 474 + }; 475 + 472 476 void __init palm27x_pmic_init(void) 473 477 { 474 478 i2c_register_board_info(1, ARRAY_AND_SIZE(palm27x_pi2c_board_info)); 475 - pxa27x_set_i2c_power_info(NULL); 479 + pxa27x_set_i2c_power_info(&palm27x_i2c_power_info); 476 480 } 477 481 #endif
+1
arch/arm/mach-pxa/vpac270.c
··· 240 240 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) 241 241 static struct pxamci_platform_data vpac270_mci_platform_data = { 242 242 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 243 + .gpio_power = -1, 243 244 .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N, 244 245 .gpio_card_ro = GPIO52_VPAC270_SD_READONLY, 245 246 .detect_delay_ms = 200,
+3
arch/arm/mach-u300/include/mach/gpio.h
··· 273 273 extern int gpio_get_value(unsigned gpio); 274 274 extern void gpio_set_value(unsigned gpio, int value); 275 275 276 + #define gpio_get_value_cansleep gpio_get_value 277 + #define gpio_set_value_cansleep gpio_set_value 278 + 276 279 /* wrappers to sleep-enable the previous two functions */ 277 280 static inline unsigned gpio_to_irq(unsigned gpio) 278 281 {
+7 -1
arch/arm/mach-vexpress/ct-ca9x4.c
··· 227 227 int i; 228 228 229 229 #ifdef CONFIG_CACHE_L2X0 230 - l2x0_init(MMIO_P2V(CT_CA9X4_L2CC), 0x00000000, 0xfe0fffff); 230 + void __iomem *l2x0_base = MMIO_P2V(CT_CA9X4_L2CC); 231 + 232 + /* set RAM latencies to 1 cycle for this core tile. */ 233 + writel(0, l2x0_base + L2X0_TAG_LATENCY_CTRL); 234 + writel(0, l2x0_base + L2X0_DATA_LATENCY_CTRL); 235 + 236 + l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff); 231 237 #endif 232 238 233 239 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
+17 -2
arch/arm/mm/alignment.c
··· 885 885 886 886 if (ai_usermode & UM_SIGNAL) 887 887 force_sig(SIGBUS, current); 888 - else 889 - set_cr(cr_no_alignment); 888 + else { 889 + /* 890 + * We're about to disable the alignment trap and return to 891 + * user space. But if an interrupt occurs before actually 892 + * reaching user space, then the IRQ vector entry code will 893 + * notice that we were still in kernel space and therefore 894 + * the alignment trap won't be re-enabled in that case as it 895 + * is presumed to be always on from kernel space. 896 + * Let's prevent that race by disabling interrupts here (they 897 + * are disabled on the way back to user space anyway in 898 + * entry-common.S) and disable the alignment trap only if 899 + * there is no work pending for this thread. 900 + */ 901 + raw_local_irq_disable(); 902 + if (!(current_thread_info()->flags & _TIF_WORK_MASK)) 903 + set_cr(cr_no_alignment); 904 + } 890 905 891 906 return 0; 892 907 }
+29 -2
arch/arm/mm/mmu.c
··· 15 15 #include <linux/nodemask.h> 16 16 #include <linux/memblock.h> 17 17 #include <linux/sort.h> 18 + #include <linux/fs.h> 18 19 19 20 #include <asm/cputype.h> 20 21 #include <asm/sections.h> ··· 247 246 .domain = DOMAIN_USER, 248 247 }, 249 248 [MT_MEMORY] = { 249 + .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | 250 + L_PTE_USER | L_PTE_EXEC, 251 + .prot_l1 = PMD_TYPE_TABLE, 250 252 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, 251 253 .domain = DOMAIN_KERNEL, 252 254 }, ··· 258 254 .domain = DOMAIN_KERNEL, 259 255 }, 260 256 [MT_MEMORY_NONCACHED] = { 257 + .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | 258 + L_PTE_USER | L_PTE_EXEC | L_PTE_MT_BUFFERABLE, 259 + .prot_l1 = PMD_TYPE_TABLE, 261 260 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, 262 261 .domain = DOMAIN_KERNEL, 263 262 }, ··· 418 411 * Enable CPU-specific coherency if supported. 419 412 * (Only available on XSC3 at the moment.) 420 413 */ 421 - if (arch_is_coherent() && cpu_is_xsc3()) 414 + if (arch_is_coherent() && cpu_is_xsc3()) { 422 415 mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; 423 - 416 + mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED; 417 + mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S; 418 + mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED; 419 + } 424 420 /* 425 421 * ARMv6 and above have extended page tables. 426 422 */ ··· 448 438 mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S; 449 439 mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED; 450 440 mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; 441 + mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED; 451 442 mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S; 443 + mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED; 452 444 #endif 453 445 } 454 446 ··· 487 475 mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; 488 476 mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; 489 477 mem_types[MT_MEMORY].prot_sect |= ecc_mask | cp->pmd; 478 + mem_types[MT_MEMORY].prot_pte |= kern_pgprot; 479 + mem_types[MT_MEMORY_NONCACHED].prot_sect |= ecc_mask; 490 480 mem_types[MT_ROM].prot_sect |= cp->pmd; 491 481 492 482 switch (cp->pmd) { ··· 511 497 t->prot_sect |= PMD_DOMAIN(t->domain); 512 498 } 513 499 } 500 + 501 + #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE 502 + pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 503 + unsigned long size, pgprot_t vma_prot) 504 + { 505 + if (!pfn_valid(pfn)) 506 + return pgprot_noncached(vma_prot); 507 + else if (file->f_flags & O_SYNC) 508 + return pgprot_writecombine(vma_prot); 509 + return vma_prot; 510 + } 511 + EXPORT_SYMBOL(phys_mem_access_prot); 512 + #endif 514 513 515 514 #define vectors_base() (vectors_high() ? 0xffff0000 : 0) 516 515
+56 -6
arch/arm/mm/proc-v7.S
··· 186 186 * It is assumed that: 187 187 * - cache type register is implemented 188 188 */ 189 - __v7_setup: 189 + __v7_ca9mp_setup: 190 190 #ifdef CONFIG_SMP 191 191 mrc p15, 0, r0, c1, c0, 1 192 192 tst r0, #(1 << 6) @ SMP/nAMP mode enabled? 193 193 orreq r0, r0, #(1 << 6) | (1 << 0) @ Enable SMP/nAMP mode and 194 194 mcreq p15, 0, r0, c1, c0, 1 @ TLB ops broadcasting 195 195 #endif 196 + __v7_setup: 196 197 adr r12, __v7_setup_stack @ the local stack 197 198 stmia r12, {r0-r5, r7, r9, r11, lr} 198 199 bl v7_flush_dcache_all ··· 202 201 mrc p15, 0, r0, c0, c0, 0 @ read main ID register 203 202 and r10, r0, #0xff000000 @ ARM? 204 203 teq r10, #0x41000000 205 - bne 2f 204 + bne 3f 206 205 and r5, r0, #0x00f00000 @ variant 207 206 and r6, r0, #0x0000000f @ revision 208 - orr r0, r6, r5, lsr #20-4 @ combine variant and revision 207 + orr r6, r6, r5, lsr #20-4 @ combine variant and revision 208 + ubfx r0, r0, #4, #12 @ primary part number 209 209 210 + /* Cortex-A8 Errata */ 211 + ldr r10, =0x00000c08 @ Cortex-A8 primary part number 212 + teq r0, r10 213 + bne 2f 210 214 #ifdef CONFIG_ARM_ERRATA_430973 211 215 teq r5, #0x00100000 @ only present in r1p* 212 216 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register ··· 219 213 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register 220 214 #endif 221 215 #ifdef CONFIG_ARM_ERRATA_458693 222 - teq r0, #0x20 @ only present in r2p0 216 + teq r6, #0x20 @ only present in r2p0 223 217 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register 224 218 orreq r10, r10, #(1 << 5) @ set L1NEON to 1 225 219 orreq r10, r10, #(1 << 9) @ set PLDNOP to 1 226 220 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register 227 221 #endif 228 222 #ifdef CONFIG_ARM_ERRATA_460075 229 - teq r0, #0x20 @ only present in r2p0 223 + teq r6, #0x20 @ only present in r2p0 230 224 mrceq p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register 231 225 tsteq r10, #1 << 22 232 226 orreq r10, r10, #(1 << 22) @ set the Write Allocate disable bit 233 227 mcreq p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register 234 228 #endif 229 + b 3f 235 230 236 - 2: mov r10, #0 231 + /* Cortex-A9 Errata */ 232 + 2: ldr r10, =0x00000c09 @ Cortex-A9 primary part number 233 + teq r0, r10 234 + bne 3f 235 + #ifdef CONFIG_ARM_ERRATA_742230 236 + cmp r6, #0x22 @ only present up to r2p2 237 + mrcle p15, 0, r10, c15, c0, 1 @ read diagnostic register 238 + orrle r10, r10, #1 << 4 @ set bit #4 239 + mcrle p15, 0, r10, c15, c0, 1 @ write diagnostic register 240 + #endif 241 + #ifdef CONFIG_ARM_ERRATA_742231 242 + teq r6, #0x20 @ present in r2p0 243 + teqne r6, #0x21 @ present in r2p1 244 + teqne r6, #0x22 @ present in r2p2 245 + mrceq p15, 0, r10, c15, c0, 1 @ read diagnostic register 246 + orreq r10, r10, #1 << 12 @ set bit #12 247 + orreq r10, r10, #1 << 22 @ set bit #22 248 + mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register 249 + #endif 250 + 251 + 3: mov r10, #0 237 252 #ifdef HARVARD_CACHE 238 253 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate 239 254 #endif ··· 349 322 .align 350 323 351 324 .section ".proc.info.init", #alloc, #execinstr 325 + 326 + .type __v7_ca9mp_proc_info, #object 327 + __v7_ca9mp_proc_info: 328 + .long 0x410fc090 @ Required ID value 329 + .long 0xff0ffff0 @ Mask for ID 330 + .long PMD_TYPE_SECT | \ 331 + PMD_SECT_AP_WRITE | \ 332 + PMD_SECT_AP_READ | \ 333 + PMD_FLAGS 334 + .long PMD_TYPE_SECT | \ 335 + PMD_SECT_XN | \ 336 + PMD_SECT_AP_WRITE | \ 337 + PMD_SECT_AP_READ 338 + b __v7_ca9mp_setup 339 + .long cpu_arch_name 340 + .long cpu_elf_name 341 + .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP 342 + .long cpu_v7_name 343 + .long v7_processor_functions 344 + .long v7wbi_tlb_fns 345 + .long v6_user_fns 346 + .long v7_cache_fns 347 + .size __v7_ca9mp_proc_info, . - __v7_ca9mp_proc_info 352 348 353 349 /* 354 350 * Match any ARMv7 processor core.
+12 -21
arch/arm/plat-nomadik/timer.c
··· 1 1 /* 2 - * linux/arch/arm/mach-nomadik/timer.c 2 + * linux/arch/arm/plat-nomadik/timer.c 3 3 * 4 4 * Copyright (C) 2008 STMicroelectronics 5 5 * Copyright (C) 2010 Alessandro Rubini ··· 75 75 cr = readl(mtu_base + MTU_CR(1)); 76 76 writel(0, mtu_base + MTU_LR(1)); 77 77 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1)); 78 - writel(0x2, mtu_base + MTU_IMSC); 78 + writel(1 << 1, mtu_base + MTU_IMSC); 79 79 break; 80 80 case CLOCK_EVT_MODE_SHUTDOWN: 81 81 case CLOCK_EVT_MODE_UNUSED: ··· 131 131 { 132 132 unsigned long rate; 133 133 struct clk *clk0; 134 - struct clk *clk1; 135 - u32 cr; 134 + u32 cr = MTU_CRn_32BITS; 136 135 137 136 clk0 = clk_get_sys("mtu0", NULL); 138 137 BUG_ON(IS_ERR(clk0)); 139 138 140 - clk1 = clk_get_sys("mtu1", NULL); 141 - BUG_ON(IS_ERR(clk1)); 142 - 143 139 clk_enable(clk0); 144 - clk_enable(clk1); 145 140 146 141 /* 147 - * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500: 148 - * use a divide-by-16 counter if it's more than 16MHz 142 + * Tick rate is 2.4MHz for Nomadik and 2.4Mhz, 100MHz or 133 MHz 143 + * for ux500. 144 + * Use a divide-by-16 counter if the tick rate is more than 32MHz. 145 + * At 32 MHz, the timer (with 32 bit counter) can be programmed 146 + * to wake-up at a max 127s a head in time. Dividing a 2.4 MHz timer 147 + * with 16 gives too low timer resolution. 149 148 */ 150 - cr = MTU_CRn_32BITS;; 151 149 rate = clk_get_rate(clk0); 152 - if (rate > 16 << 20) { 150 + if (rate > 32000000) { 153 151 rate /= 16; 154 152 cr |= MTU_CRn_PRESCALE_16; 155 153 } else { ··· 168 170 pr_err("timer: failed to initialize clock source %s\n", 169 171 nmdk_clksrc.name); 170 172 171 - /* Timer 1 is used for events, fix according to rate */ 172 - cr = MTU_CRn_32BITS; 173 - rate = clk_get_rate(clk1); 174 - if (rate > 16 << 20) { 175 - rate /= 16; 176 - cr |= MTU_CRn_PRESCALE_16; 177 - } else { 178 - cr |= MTU_CRn_PRESCALE_1; 179 - } 173 + /* Timer 1 is used for events */ 174 + 180 175 clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE); 181 176 182 177 writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */
+1 -1
arch/arm/plat-omap/Kconfig
··· 33 33 config OMAP_DEBUG_LEDS 34 34 bool 35 35 depends on OMAP_DEBUG_DEVICES 36 - default y if LEDS 36 + default y if LEDS_CLASS 37 37 38 38 config OMAP_RESET_CLOCKS 39 39 bool "Reset unused clocks during boot"
+1 -1
arch/arm/plat-omap/mcbsp.c
··· 156 156 /* Writing zero to RSYNC_ERR clears the IRQ */ 157 157 MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1)); 158 158 } else { 159 - complete(&mcbsp_rx->tx_irq_completion); 159 + complete(&mcbsp_rx->rx_irq_completion); 160 160 } 161 161 162 162 return IRQ_HANDLED;
+5 -20
arch/arm/plat-omap/sram.c
··· 220 220 if (omap_sram_size == 0) 221 221 return; 222 222 223 - if (cpu_is_omap24xx()) { 224 - omap_sram_io_desc[0].virtual = OMAP2_SRAM_VA; 225 - 226 - base = OMAP2_SRAM_PA; 227 - base = ROUND_DOWN(base, PAGE_SIZE); 228 - omap_sram_io_desc[0].pfn = __phys_to_pfn(base); 229 - } 230 - 231 223 if (cpu_is_omap34xx()) { 232 - omap_sram_io_desc[0].virtual = OMAP3_SRAM_VA; 233 - base = OMAP3_SRAM_PA; 234 - base = ROUND_DOWN(base, PAGE_SIZE); 235 - omap_sram_io_desc[0].pfn = __phys_to_pfn(base); 236 - 237 224 /* 238 225 * SRAM must be marked as non-cached on OMAP3 since the 239 226 * CORE DPLL M2 divider change code (in SRAM) runs with the ··· 231 244 omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED; 232 245 } 233 246 234 - if (cpu_is_omap44xx()) { 235 - omap_sram_io_desc[0].virtual = OMAP4_SRAM_VA; 236 - base = OMAP4_SRAM_PA; 237 - base = ROUND_DOWN(base, PAGE_SIZE); 238 - omap_sram_io_desc[0].pfn = __phys_to_pfn(base); 239 - } 240 - omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */ 247 + omap_sram_io_desc[0].virtual = omap_sram_base; 248 + base = omap_sram_start; 249 + base = ROUND_DOWN(base, PAGE_SIZE); 250 + omap_sram_io_desc[0].pfn = __phys_to_pfn(base); 251 + omap_sram_io_desc[0].length = ROUND_DOWN(omap_sram_size, PAGE_SIZE); 241 252 iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc)); 242 253 243 254 printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n",
+1 -2
arch/avr32/kernel/module.c
··· 314 314 vfree(module->arch.syminfo); 315 315 module->arch.syminfo = NULL; 316 316 317 - return module_bug_finalize(hdr, sechdrs, module); 317 + return 0; 318 318 } 319 319 320 320 void module_arch_cleanup(struct module *module) 321 321 { 322 - module_bug_cleanup(module); 323 322 }
+1 -2
arch/h8300/kernel/module.c
··· 112 112 const Elf_Shdr *sechdrs, 113 113 struct module *me) 114 114 { 115 - return module_bug_finalize(hdr, sechdrs, me); 115 + return 0; 116 116 } 117 117 118 118 void module_arch_cleanup(struct module *mod) 119 119 { 120 - module_bug_cleanup(mod); 121 120 }
-1
arch/m32r/include/asm/signal.h
··· 157 157 #undef __HAVE_ARCH_SIG_BITOPS 158 158 159 159 struct pt_regs; 160 - extern int do_signal(struct pt_regs *regs, sigset_t *oldset); 161 160 162 161 #define ptrace_signal_deliver(regs, cookie) do { } while (0) 163 162
+1
arch/m32r/include/asm/unistd.h
··· 351 351 #define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/ 352 352 #define __ARCH_WANT_SYS_OLDUMOUNT 353 353 #define __ARCH_WANT_SYS_RT_SIGACTION 354 + #define __ARCH_WANT_SYS_RT_SIGSUSPEND 354 355 355 356 #define __IGNORE_lchown 356 357 #define __IGNORE_setuid
+2 -3
arch/m32r/kernel/entry.S
··· 235 235 work_notifysig: ; deal with pending signals and 236 236 ; notify-resume requests 237 237 mv r0, sp ; arg1 : struct pt_regs *regs 238 - ldi r1, #0 ; arg2 : sigset_t *oldset 239 - mv r2, r9 ; arg3 : __u32 thread_info_flags 238 + mv r1, r9 ; arg2 : __u32 thread_info_flags 240 239 bl do_notify_resume 241 - bra restore_all 240 + bra resume_userspace 242 241 243 242 ; perform syscall exit tracing 244 243 ALIGN
+4 -3
arch/m32r/kernel/ptrace.c
··· 592 592 593 593 if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0) 594 594 != sizeof(insn)) 595 - break; 595 + return -EIO; 596 596 597 597 compute_next_pc(insn, pc, &next_pc, child); 598 598 if (next_pc & 0x80000000) 599 - break; 599 + return -EIO; 600 600 601 601 if (embed_debug_trap(child, next_pc)) 602 - break; 602 + return -EIO; 603 603 604 604 invalidate_cache(); 605 + return 0; 605 606 } 606 607 607 608 void user_disable_single_step(struct task_struct *child)
+41 -64
arch/m32r/kernel/signal.c
··· 28 28 29 29 #define DEBUG_SIG 0 30 30 31 - #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 32 - 33 - int do_signal(struct pt_regs *, sigset_t *); 34 - 35 - asmlinkage int 36 - sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, 37 - unsigned long r2, unsigned long r3, unsigned long r4, 38 - unsigned long r5, unsigned long r6, struct pt_regs *regs) 39 - { 40 - sigset_t newset; 41 - 42 - /* XXX: Don't preclude handling different sized sigset_t's. */ 43 - if (sigsetsize != sizeof(sigset_t)) 44 - return -EINVAL; 45 - 46 - if (copy_from_user(&newset, unewset, sizeof(newset))) 47 - return -EFAULT; 48 - sigdelsetmask(&newset, sigmask(SIGKILL)|sigmask(SIGSTOP)); 49 - 50 - spin_lock_irq(&current->sighand->siglock); 51 - current->saved_sigmask = current->blocked; 52 - current->blocked = newset; 53 - recalc_sigpending(); 54 - spin_unlock_irq(&current->sighand->siglock); 55 - 56 - current->state = TASK_INTERRUPTIBLE; 57 - schedule(); 58 - set_thread_flag(TIF_RESTORE_SIGMASK); 59 - return -ERESTARTNOHAND; 60 - } 61 - 62 31 asmlinkage int 63 32 sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, 64 33 unsigned long r2, unsigned long r3, unsigned long r4, ··· 187 218 return (void __user *)((sp - frame_size) & -8ul); 188 219 } 189 220 190 - static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 221 + static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 191 222 sigset_t *set, struct pt_regs *regs) 192 223 { 193 224 struct rt_sigframe __user *frame; ··· 244 275 current->comm, current->pid, frame, regs->pc); 245 276 #endif 246 277 247 - return; 278 + return 0; 248 279 249 280 give_sigsegv: 250 281 force_sigsegv(sig, current); 282 + return -EFAULT; 283 + } 284 + 285 + static int prev_insn(struct pt_regs *regs) 286 + { 287 + u16 inst; 288 + if (get_user(&inst, (u16 __user *)(regs->bpc - 2))) 289 + return -EFAULT; 290 + if ((inst & 0xfff0) == 0x10f0) /* trap ? */ 291 + regs->bpc -= 2; 292 + else 293 + regs->bpc -= 4; 294 + regs->syscall_nr = -1; 295 + return 0; 251 296 } 252 297 253 298 /* 254 299 * OK, we're invoking a handler 255 300 */ 256 301 257 - static void 302 + static int 258 303 handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, 259 304 sigset_t *oldset, struct pt_regs *regs) 260 305 { 261 - unsigned short inst; 262 - 263 306 /* Are we from a system call? */ 264 307 if (regs->syscall_nr >= 0) { 265 308 /* If so, check system call restarting.. */ ··· 289 308 /* fallthrough */ 290 309 case -ERESTARTNOINTR: 291 310 regs->r0 = regs->orig_r0; 292 - inst = *(unsigned short *)(regs->bpc - 2); 293 - if ((inst & 0xfff0) == 0x10f0) /* trap ? */ 294 - regs->bpc -= 2; 295 - else 296 - regs->bpc -= 4; 311 + if (prev_insn(regs) < 0) 312 + return -EFAULT; 297 313 } 298 314 } 299 315 300 316 /* Set up the stack frame */ 301 - setup_rt_frame(sig, ka, info, oldset, regs); 317 + if (setup_rt_frame(sig, ka, info, oldset, regs)) 318 + return -EFAULT; 302 319 303 320 spin_lock_irq(&current->sighand->siglock); 304 321 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); ··· 304 325 sigaddset(&current->blocked,sig); 305 326 recalc_sigpending(); 306 327 spin_unlock_irq(&current->sighand->siglock); 328 + return 0; 307 329 } 308 330 309 331 /* ··· 312 332 * want to handle. Thus you cannot kill init even with a SIGKILL even by 313 333 * mistake. 314 334 */ 315 - int do_signal(struct pt_regs *regs, sigset_t *oldset) 335 + static void do_signal(struct pt_regs *regs) 316 336 { 317 337 siginfo_t info; 318 338 int signr; 319 339 struct k_sigaction ka; 320 - unsigned short inst; 340 + sigset_t *oldset; 321 341 322 342 /* 323 343 * We want the common case to go fast, which ··· 326 346 * if so. 327 347 */ 328 348 if (!user_mode(regs)) 329 - return 1; 349 + return; 330 350 331 351 if (try_to_freeze()) 332 352 goto no_signal; 333 353 334 - if (!oldset) 354 + if (test_thread_flag(TIF_RESTORE_SIGMASK)) 355 + oldset = &current->saved_sigmask; 356 + else 335 357 oldset = &current->blocked; 336 358 337 359 signr = get_signal_to_deliver(&info, &ka, regs, NULL); ··· 345 363 */ 346 364 347 365 /* Whee! Actually deliver the signal. */ 348 - handle_signal(signr, &ka, &info, oldset, regs); 349 - return 1; 366 + if (handle_signal(signr, &ka, &info, oldset, regs) == 0) 367 + clear_thread_flag(TIF_RESTORE_SIGMASK); 368 + 369 + return; 350 370 } 351 371 352 372 no_signal: ··· 359 375 regs->r0 == -ERESTARTSYS || 360 376 regs->r0 == -ERESTARTNOINTR) { 361 377 regs->r0 = regs->orig_r0; 362 - inst = *(unsigned short *)(regs->bpc - 2); 363 - if ((inst & 0xfff0) == 0x10f0) /* trap ? */ 364 - regs->bpc -= 2; 365 - else 366 - regs->bpc -= 4; 367 - } 368 - if (regs->r0 == -ERESTART_RESTARTBLOCK){ 378 + prev_insn(regs); 379 + } else if (regs->r0 == -ERESTART_RESTARTBLOCK){ 369 380 regs->r0 = regs->orig_r0; 370 381 regs->r7 = __NR_restart_syscall; 371 - inst = *(unsigned short *)(regs->bpc - 2); 372 - if ((inst & 0xfff0) == 0x10f0) /* trap ? */ 373 - regs->bpc -= 2; 374 - else 375 - regs->bpc -= 4; 382 + prev_insn(regs); 376 383 } 377 384 } 378 - return 0; 385 + if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 386 + clear_thread_flag(TIF_RESTORE_SIGMASK); 387 + sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 388 + } 379 389 } 380 390 381 391 /* 382 392 * notification of userspace execution resumption 383 393 * - triggered by current->work.notify_resume 384 394 */ 385 - void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, 386 - __u32 thread_info_flags) 395 + void do_notify_resume(struct pt_regs *regs, __u32 thread_info_flags) 387 396 { 388 397 /* Pending single-step? */ 389 398 if (thread_info_flags & _TIF_SINGLESTEP) ··· 384 407 385 408 /* deal with pending signal delivery */ 386 409 if (thread_info_flags & _TIF_SIGPENDING) 387 - do_signal(regs,oldset); 410 + do_signal(regs); 388 411 389 412 if (thread_info_flags & _TIF_NOTIFY_RESUME) { 390 413 clear_thread_flag(TIF_NOTIFY_RESUME);
+3 -3
arch/m68k/mac/macboing.c
··· 162 162 void mac_mksound( unsigned int freq, unsigned int length ) 163 163 { 164 164 __u32 cfreq = ( freq << 5 ) / 468; 165 - __u32 flags; 165 + unsigned long flags; 166 166 int i; 167 167 168 168 if ( mac_special_bell == NULL ) ··· 224 224 */ 225 225 static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsigned int volume ) 226 226 { 227 - __u32 flags; 227 + unsigned long flags; 228 228 229 229 /* if the bell is already ringing, ring longer */ 230 230 if ( mac_bell_duration > 0 ) ··· 271 271 static void mac_quadra_ring_bell( unsigned long ignored ) 272 272 { 273 273 int i, count = mac_asc_samplespersec / HZ; 274 - __u32 flags; 274 + unsigned long flags; 275 275 276 276 /* 277 277 * we neither want a sound buffer overflow nor underflow, so we need to match
+19 -2
arch/mips/Kconfig
··· 13 13 select HAVE_KPROBES 14 14 select HAVE_KRETPROBES 15 15 select RTC_LIB if !MACH_LOONGSON 16 + select GENERIC_ATOMIC64 if !64BIT 16 17 17 18 mainmenu "Linux/MIPS Kernel Configuration" 18 19 ··· 1647 1646 select SYS_SUPPORTS_SMP 1648 1647 select SMP_UP 1649 1648 help 1650 - This is a kernel model which is also known a VSMP or lately 1651 - has been marketesed into SMVP. 1649 + This is a kernel model which is known a VSMP but lately has been 1650 + marketesed into SMVP. 1651 + Virtual SMP uses the processor's VPEs to implement virtual 1652 + processors. In currently available configuration of the 34K processor 1653 + this allows for a dual processor. Both processors will share the same 1654 + primary caches; each will obtain the half of the TLB for it's own 1655 + exclusive use. For a layman this model can be described as similar to 1656 + what Intel calls Hyperthreading. 1657 + 1658 + For further information see http://www.linux-mips.org/wiki/34K#VSMP 1652 1659 1653 1660 config MIPS_MT_SMTC 1654 1661 bool "SMTC: Use all TCs on all VPEs for SMP" ··· 1673 1664 help 1674 1665 This is a kernel model which is known a SMTC or lately has been 1675 1666 marketesed into SMVP. 1667 + is presenting the available TC's of the core as processors to Linux. 1668 + On currently available 34K processors this means a Linux system will 1669 + see up to 5 processors. The implementation of the SMTC kernel differs 1670 + significantly from VSMP and cannot efficiently coexist in the same 1671 + kernel binary so the choice between VSMP and SMTC is a compile time 1672 + decision. 1673 + 1674 + For further information see http://www.linux-mips.org/wiki/34K#SMTC 1676 1675 1677 1676 endchoice 1678 1677
+2 -3
arch/mips/alchemy/common/prom.c
··· 43 43 char **prom_argv; 44 44 char **prom_envp; 45 45 46 - void prom_init_cmdline(void) 46 + void __init prom_init_cmdline(void) 47 47 { 48 48 int i; 49 49 ··· 104 104 } 105 105 } 106 106 107 - int prom_get_ethernet_addr(char *ethernet_addr) 107 + int __init prom_get_ethernet_addr(char *ethernet_addr) 108 108 { 109 109 char *ethaddr_str; 110 110 ··· 123 123 124 124 return 0; 125 125 } 126 - EXPORT_SYMBOL(prom_get_ethernet_addr); 127 126 128 127 void __init prom_free_prom_memory(void) 129 128 {
+1 -1
arch/mips/boot/compressed/Makefile
··· 59 59 hostprogs-y := calc_vmlinuz_load_addr 60 60 61 61 VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \ 62 - $(objtree)/$(KBUILD_IMAGE) $(VMLINUX_LOAD_ADDRESS)) 62 + $(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS)) 63 63 64 64 vmlinuzobjs-y += $(obj)/piggy.o 65 65
+4
arch/mips/cavium-octeon/Kconfig
··· 83 83 def_bool y 84 84 select SPARSEMEM_STATIC 85 85 depends on CPU_CAVIUM_OCTEON 86 + 87 + config CAVIUM_OCTEON_HELPER 88 + def_bool y 89 + depends on OCTEON_ETHERNET || PCI
+1 -1
arch/mips/cavium-octeon/cpu.c
··· 41 41 return NOTIFY_OK; /* Let default notifier send signals */ 42 42 } 43 43 44 - static int cnmips_cu2_setup(void) 44 + static int __init cnmips_cu2_setup(void) 45 45 { 46 46 return cu2_notifier(cnmips_cu2_call, 0); 47 47 }
+1 -1
arch/mips/cavium-octeon/executive/Makefile
··· 11 11 12 12 obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o 13 13 14 - obj-$(CONFIG_PCI) += cvmx-helper-errata.o cvmx-helper-jtag.o 14 + obj-$(CONFIG_CAVIUM_OCTEON_HELPER) += cvmx-helper-errata.o cvmx-helper-jtag.o
+4
arch/mips/include/asm/atomic.h
··· 782 782 */ 783 783 #define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0) 784 784 785 + #else /* !CONFIG_64BIT */ 786 + 787 + #include <asm-generic/atomic64.h> 788 + 785 789 #endif /* CONFIG_64BIT */ 786 790 787 791 /*
+1 -1
arch/mips/include/asm/cop2.h
··· 24 24 25 25 #define cu2_notifier(fn, pri) \ 26 26 ({ \ 27 - static struct notifier_block fn##_nb __cpuinitdata = { \ 27 + static struct notifier_block fn##_nb = { \ 28 28 .notifier_call = fn, \ 29 29 .priority = pri \ 30 30 }; \
+1
arch/mips/include/asm/gic.h
··· 321 321 */ 322 322 struct gic_intr_map { 323 323 unsigned int cpunum; /* Directed to this CPU */ 324 + #define GIC_UNUSED 0xdead /* Dummy data */ 324 325 unsigned int pin; /* Directed to this Pin */ 325 326 unsigned int polarity; /* Polarity : +/- */ 326 327 unsigned int trigtype; /* Trigger : Edge/Levl */
+1 -1
arch/mips/include/asm/mach-tx49xx/kmalloc.h
··· 1 1 #ifndef __ASM_MACH_TX49XX_KMALLOC_H 2 2 #define __ASM_MACH_TX49XX_KMALLOC_H 3 3 4 - #define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES 4 + #define ARCH_DMA_MINALIGN L1_CACHE_BYTES 5 5 6 6 #endif /* __ASM_MACH_TX49XX_KMALLOC_H */
-3
arch/mips/include/asm/mips-boards/maltaint.h
··· 88 88 89 89 #define GIC_EXT_INTR(x) x 90 90 91 - /* Dummy data */ 92 - #define X 0xdead 93 - 94 91 /* External Interrupts used for IPI */ 95 92 #define GIC_IPI_EXT_INTR_RESCHED_VPE0 16 96 93 #define GIC_IPI_EXT_INTR_CALLFNC_VPE0 17
+14
arch/mips/include/asm/page.h
··· 150 150 ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) 151 151 #endif 152 152 #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) 153 + 154 + /* 155 + * RELOC_HIDE was originally added by 6007b903dfe5f1d13e0c711ac2894bdd4a61b1ad 156 + * (lmo) rsp. 8431fd094d625b94d364fe393076ccef88e6ce18 (kernel.org). The 157 + * discussion can be found in lkml posting 158 + * <a2ebde260608230500o3407b108hc03debb9da6e62c@mail.gmail.com> which is 159 + * archived at http://lists.linuxcoding.com/kernel/2006-q3/msg17360.html 160 + * 161 + * It is unclear if the misscompilations mentioned in 162 + * http://lkml.org/lkml/2010/8/8/138 also affect MIPS so we keep this one 163 + * until GCC 3.x has been retired before we can apply 164 + * https://patchwork.linux-mips.org/patch/1541/ 165 + */ 166 + 153 167 #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) 154 168 155 169 #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
+2 -1
arch/mips/include/asm/thread_info.h
··· 146 146 #define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH) 147 147 148 148 /* work to do on interrupt/exception return */ 149 - #define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP) 149 + #define _TIF_WORK_MASK (0x0000ffef & \ 150 + ~(_TIF_SECCOMP | _TIF_SYSCALL_AUDIT)) 150 151 /* work to do on any return to u-space */ 151 152 #define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP) 152 153
+15 -6
arch/mips/include/asm/unistd.h
··· 356 356 #define __NR_perf_event_open (__NR_Linux + 333) 357 357 #define __NR_accept4 (__NR_Linux + 334) 358 358 #define __NR_recvmmsg (__NR_Linux + 335) 359 + #define __NR_fanotify_init (__NR_Linux + 336) 360 + #define __NR_fanotify_mark (__NR_Linux + 337) 361 + #define __NR_prlimit64 (__NR_Linux + 338) 359 362 360 363 /* 361 364 * Offset of the last Linux o32 flavoured syscall 362 365 */ 363 - #define __NR_Linux_syscalls 335 366 + #define __NR_Linux_syscalls 338 364 367 365 368 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 366 369 367 370 #define __NR_O32_Linux 4000 368 - #define __NR_O32_Linux_syscalls 335 371 + #define __NR_O32_Linux_syscalls 338 369 372 370 373 #if _MIPS_SIM == _MIPS_SIM_ABI64 371 374 ··· 671 668 #define __NR_perf_event_open (__NR_Linux + 292) 672 669 #define __NR_accept4 (__NR_Linux + 293) 673 670 #define __NR_recvmmsg (__NR_Linux + 294) 671 + #define __NR_fanotify_init (__NR_Linux + 295) 672 + #define __NR_fanotify_mark (__NR_Linux + 296) 673 + #define __NR_prlimit64 (__NR_Linux + 297) 674 674 675 675 /* 676 676 * Offset of the last Linux 64-bit flavoured syscall 677 677 */ 678 - #define __NR_Linux_syscalls 294 678 + #define __NR_Linux_syscalls 297 679 679 680 680 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 681 681 682 682 #define __NR_64_Linux 5000 683 - #define __NR_64_Linux_syscalls 294 683 + #define __NR_64_Linux_syscalls 297 684 684 685 685 #if _MIPS_SIM == _MIPS_SIM_NABI32 686 686 ··· 991 985 #define __NR_accept4 (__NR_Linux + 297) 992 986 #define __NR_recvmmsg (__NR_Linux + 298) 993 987 #define __NR_getdents64 (__NR_Linux + 299) 988 + #define __NR_fanotify_init (__NR_Linux + 300) 989 + #define __NR_fanotify_mark (__NR_Linux + 301) 990 + #define __NR_prlimit64 (__NR_Linux + 302) 994 991 995 992 /* 996 993 * Offset of the last N32 flavoured syscall 997 994 */ 998 - #define __NR_Linux_syscalls 299 995 + #define __NR_Linux_syscalls 302 999 996 1000 997 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 1001 998 1002 999 #define __NR_N32_Linux 6000 1003 - #define __NR_N32_Linux_syscalls 299 1000 + #define __NR_N32_Linux_syscalls 302 1004 1001 1005 1002 #ifdef __KERNEL__ 1006 1003
+2 -3
arch/mips/kernel/irq-gic.c
··· 7 7 #include <asm/io.h> 8 8 #include <asm/gic.h> 9 9 #include <asm/gcmpregs.h> 10 - #include <asm/mips-boards/maltaint.h> 11 10 #include <asm/irq.h> 12 11 #include <linux/hardirq.h> 13 12 #include <asm-generic/bitops/find.h> ··· 130 131 int i; 131 132 132 133 irq -= _irqbase; 133 - pr_debug(KERN_DEBUG "%s(%d) called\n", __func__, irq); 134 + pr_debug("%s(%d) called\n", __func__, irq); 134 135 cpumask_and(&tmp, cpumask, cpu_online_mask); 135 136 if (cpus_empty(tmp)) 136 137 return -1; ··· 221 222 /* Setup specifics */ 222 223 for (i = 0; i < mapsize; i++) { 223 224 cpu = intrmap[i].cpunum; 224 - if (cpu == X) 225 + if (cpu == GIC_UNUSED) 225 226 continue; 226 227 if (cpu == 0 && i != 0 && intrmap[i].flags == 0) 227 228 continue;
+1 -1
arch/mips/kernel/kgdb.c
··· 283 283 struct pt_regs *regs = args->regs; 284 284 int trap = (regs->cp0_cause & 0x7c) >> 2; 285 285 286 - /* Userpace events, ignore. */ 286 + /* Userspace events, ignore. */ 287 287 if (user_mode(regs)) 288 288 return NOTIFY_DONE; 289 289
+1 -1
arch/mips/kernel/kspd.c
··· 251 251 memset(&tz, 0, sizeof(tz)); 252 252 if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv, 253 253 (int)&tz, 0, 0)) == 0) 254 - ret.retval = tv.tv_sec; 254 + ret.retval = tv.tv_sec; 255 255 break; 256 256 257 257 case MTSP_SYSCALL_EXIT:
+7
arch/mips/kernel/linux32.c
··· 341 341 { 342 342 return sys_lookup_dcookie(merge_64(a0, a1), buf, len); 343 343 } 344 + 345 + SYSCALL_DEFINE6(32_fanotify_mark, int, fanotify_fd, unsigned int, flags, 346 + u64, a3, u64, a4, int, dfd, const char __user *, pathname) 347 + { 348 + return sys_fanotify_mark(fanotify_fd, flags, merge_64(a3, a4), 349 + dfd, pathname); 350 + }
+4 -1
arch/mips/kernel/scall32-o32.S
··· 583 583 sys sys_rt_tgsigqueueinfo 4 584 584 sys sys_perf_event_open 5 585 585 sys sys_accept4 4 586 - sys sys_recvmmsg 5 586 + sys sys_recvmmsg 5 /* 4335 */ 587 + sys sys_fanotify_init 2 588 + sys sys_fanotify_mark 6 589 + sys sys_prlimit64 4 587 590 .endm 588 591 589 592 /* We pre-compute the number of _instruction_ bytes needed to
+5 -2
arch/mips/kernel/scall64-64.S
··· 416 416 PTR sys_pipe2 417 417 PTR sys_inotify_init1 418 418 PTR sys_preadv 419 - PTR sys_pwritev /* 5390 */ 419 + PTR sys_pwritev /* 5290 */ 420 420 PTR sys_rt_tgsigqueueinfo 421 421 PTR sys_perf_event_open 422 422 PTR sys_accept4 423 - PTR sys_recvmmsg 423 + PTR sys_recvmmsg 424 + PTR sys_fanotify_init /* 5295 */ 425 + PTR sys_fanotify_mark 426 + PTR sys_prlimit64 424 427 .size sys_call_table,.-sys_call_table
+4 -1
arch/mips/kernel/scall64-n32.S
··· 419 419 PTR sys_perf_event_open 420 420 PTR sys_accept4 421 421 PTR compat_sys_recvmmsg 422 - PTR sys_getdents 422 + PTR sys_getdents64 423 + PTR sys_fanotify_init /* 6300 */ 424 + PTR sys_fanotify_mark 425 + PTR sys_prlimit64 423 426 .size sysn32_call_table,.-sysn32_call_table
+4 -1
arch/mips/kernel/scall64-o32.S
··· 538 538 PTR compat_sys_rt_tgsigqueueinfo 539 539 PTR sys_perf_event_open 540 540 PTR sys_accept4 541 - PTR compat_sys_recvmmsg 541 + PTR compat_sys_recvmmsg /* 4335 */ 542 + PTR sys_fanotify_init 543 + PTR sys_32_fanotify_mark 544 + PTR sys_prlimit64 542 545 .size sys_call_table,.-sys_call_table
+20 -8
arch/mips/mm/dma-default.c
··· 44 44 45 45 static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp) 46 46 { 47 + gfp_t dma_flag; 48 + 47 49 /* ignore region specifiers */ 48 50 gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); 49 51 50 - #ifdef CONFIG_ZONE_DMA 52 + #ifdef CONFIG_ISA 51 53 if (dev == NULL) 52 - gfp |= __GFP_DMA; 53 - else if (dev->coherent_dma_mask < DMA_BIT_MASK(24)) 54 - gfp |= __GFP_DMA; 54 + dma_flag = __GFP_DMA; 55 55 else 56 56 #endif 57 - #ifdef CONFIG_ZONE_DMA32 57 + #if defined(CONFIG_ZONE_DMA32) && defined(CONFIG_ZONE_DMA) 58 58 if (dev->coherent_dma_mask < DMA_BIT_MASK(32)) 59 - gfp |= __GFP_DMA32; 59 + dma_flag = __GFP_DMA; 60 + else if (dev->coherent_dma_mask < DMA_BIT_MASK(64)) 61 + dma_flag = __GFP_DMA32; 60 62 else 61 63 #endif 62 - ; 64 + #if defined(CONFIG_ZONE_DMA32) && !defined(CONFIG_ZONE_DMA) 65 + if (dev->coherent_dma_mask < DMA_BIT_MASK(64)) 66 + dma_flag = __GFP_DMA32; 67 + else 68 + #endif 69 + #if defined(CONFIG_ZONE_DMA) && !defined(CONFIG_ZONE_DMA32) 70 + if (dev->coherent_dma_mask < DMA_BIT_MASK(64)) 71 + dma_flag = __GFP_DMA; 72 + else 73 + #endif 74 + dma_flag = 0; 63 75 64 76 /* Don't invoke OOM killer */ 65 77 gfp |= __GFP_NORETRY; 66 78 67 - return gfp; 79 + return gfp | dma_flag; 68 80 } 69 81 70 82 void *dma_alloc_noncoherent(struct device *dev, size_t size,
+1 -1
arch/mips/mm/sc-rm7k.c
··· 30 30 #define tc_lsize 32 31 31 32 32 extern unsigned long icache_way_size, dcache_way_size; 33 - unsigned long tcache_size; 33 + static unsigned long tcache_size; 34 34 35 35 #include <asm/r4kcache.h> 36 36
+3
arch/mips/mti-malta/malta-int.c
··· 385 385 */ 386 386 387 387 #define GIC_CPU_NMI GIC_MAP_TO_NMI_MSK 388 + #define X GIC_UNUSED 389 + 388 390 static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = { 389 391 { X, X, X, X, 0 }, 390 392 { X, X, X, X, 0 }, ··· 406 404 { X, X, X, X, 0 }, 407 405 /* The remainder of this table is initialised by fill_ipi_map */ 408 406 }; 407 + #undef X 409 408 410 409 /* 411 410 * GCMP needs to be detected before any SMP initialisation
+1 -1
arch/mips/pci/pci-rc32434.c
··· 118 118 if (!((pcicvalue == PCIM_H_EA) || 119 119 (pcicvalue == PCIM_H_IA_FIX) || 120 120 (pcicvalue == PCIM_H_IA_RR))) { 121 - pr_err(KERN_ERR "PCI init error!!!\n"); 121 + pr_err("PCI init error!!!\n"); 122 122 /* Not in Host Mode, return ERROR */ 123 123 return -1; 124 124 }
+5 -15
arch/mips/pnx8550/common/reset.c
··· 22 22 */ 23 23 #include <linux/kernel.h> 24 24 25 + #include <asm/processor.h> 25 26 #include <asm/reboot.h> 26 27 #include <glb.h> 27 28 28 29 void pnx8550_machine_restart(char *command) 29 30 { 30 - char head[] = "************* Machine restart *************"; 31 - char foot[] = "*******************************************"; 32 - 33 - printk("\n\n"); 34 - printk("%s\n", head); 35 - if (command != NULL) 36 - printk("* %s\n", command); 37 - printk("%s\n", foot); 38 - 39 31 PNX8550_RST_CTL = PNX8550_RST_DO_SW_RST; 40 32 } 41 33 42 34 void pnx8550_machine_halt(void) 43 35 { 44 - printk("*** Machine halt. (Not implemented) ***\n"); 45 - } 46 - 47 - void pnx8550_machine_power_off(void) 48 - { 49 - printk("*** Machine power off. (Not implemented) ***\n"); 36 + while (1) { 37 + if (cpu_wait) 38 + cpu_wait(); 39 + } 50 40 }
+1 -2
arch/mips/pnx8550/common/setup.c
··· 44 44 extern void __init board_setup(void); 45 45 extern void pnx8550_machine_restart(char *); 46 46 extern void pnx8550_machine_halt(void); 47 - extern void pnx8550_machine_power_off(void); 48 47 extern struct resource ioport_resource; 49 48 extern struct resource iomem_resource; 50 49 extern char *prom_getcmdline(void); ··· 99 100 100 101 _machine_restart = pnx8550_machine_restart; 101 102 _machine_halt = pnx8550_machine_halt; 102 - pm_power_off = pnx8550_machine_power_off; 103 + pm_power_off = pnx8550_machine_halt; 103 104 104 105 /* Clear the Global 2 Register, PCI Inta Output Enable Registers 105 106 Bit 1:Enable DAC Powerdown
-1
arch/mn10300/Kconfig
··· 8 8 config MN10300 9 9 def_bool y 10 10 select HAVE_OPROFILE 11 - select HAVE_ARCH_TRACEHOOK 12 11 13 12 config AM33 14 13 def_bool y
+1 -1
arch/mn10300/Kconfig.debug
··· 101 101 102 102 choice 103 103 prompt "GDB stub port" 104 - default GDBSTUB_TTYSM0 104 + default GDBSTUB_ON_TTYSM0 105 105 depends on GDBSTUB 106 106 help 107 107 Select the serial port used for GDB-stub.
+2 -2
arch/mn10300/include/asm/bitops.h
··· 229 229 #include <asm-generic/bitops/hweight.h> 230 230 231 231 #define ext2_set_bit_atomic(lock, nr, addr) \ 232 - test_and_set_bit((nr) ^ 0x18, (addr)) 232 + test_and_set_bit((nr), (addr)) 233 233 #define ext2_clear_bit_atomic(lock, nr, addr) \ 234 - test_and_clear_bit((nr) ^ 0x18, (addr)) 234 + test_and_clear_bit((nr), (addr)) 235 235 236 236 #include <asm-generic/bitops/ext2-non-atomic.h> 237 237 #include <asm-generic/bitops/minix-le.h>
+1 -1
arch/mn10300/include/asm/signal.h
··· 78 78 79 79 /* These should not be considered constants from userland. */ 80 80 #define SIGRTMIN 32 81 - #define SIGRTMAX (_NSIG-1) 81 + #define SIGRTMAX _NSIG 82 82 83 83 /* 84 84 * SA_FLAGS values:
+1 -2
arch/mn10300/kernel/module.c
··· 206 206 const Elf_Shdr *sechdrs, 207 207 struct module *me) 208 208 { 209 - return module_bug_finalize(hdr, sechdrs, me); 209 + return 0; 210 210 } 211 211 212 212 /* ··· 214 214 */ 215 215 void module_arch_cleanup(struct module *mod) 216 216 { 217 - module_bug_cleanup(mod); 218 217 }
+20 -15
arch/mn10300/kernel/signal.c
··· 65 65 old_sigset_t mask; 66 66 if (verify_area(VERIFY_READ, act, sizeof(*act)) || 67 67 __get_user(new_ka.sa.sa_handler, &act->sa_handler) || 68 - __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) 68 + __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || 69 + __get_user(new_ka.sa.sa_flags, &act->sa_flags) || 70 + __get_user(mask, &act->sa_mask)) 69 71 return -EFAULT; 70 - __get_user(new_ka.sa.sa_flags, &act->sa_flags); 71 - __get_user(mask, &act->sa_mask); 72 72 siginitset(&new_ka.sa.sa_mask, mask); 73 73 } 74 74 ··· 77 77 if (!ret && oact) { 78 78 if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || 79 79 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || 80 - __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) 80 + __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || 81 + __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || 82 + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) 81 83 return -EFAULT; 82 - __put_user(old_ka.sa.sa_flags, &oact->sa_flags); 83 - __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); 84 84 } 85 85 86 86 return ret; ··· 101 101 struct sigcontext __user *sc, long *_d0) 102 102 { 103 103 unsigned int err = 0; 104 + 105 + /* Always make any pending restarted system calls return -EINTR */ 106 + current_thread_info()->restart_block.fn = do_no_restart_syscall; 104 107 105 108 if (is_using_fpu(current)) 106 109 fpu_kill_state(current); ··· 333 330 regs->d0 = sig; 334 331 regs->d1 = (unsigned long) &frame->sc; 335 332 336 - set_fs(USER_DS); 337 - 338 333 /* the tracer may want to single-step inside the handler */ 339 334 if (test_thread_flag(TIF_SINGLESTEP)) 340 335 ptrace_notify(SIGTRAP); ··· 346 345 return 0; 347 346 348 347 give_sigsegv: 349 - force_sig(SIGSEGV, current); 348 + force_sigsegv(sig, current); 350 349 return -EFAULT; 351 350 } 352 351 ··· 414 413 regs->d0 = sig; 415 414 regs->d1 = (long) &frame->info; 416 415 417 - set_fs(USER_DS); 418 - 419 416 /* the tracer may want to single-step inside the handler */ 420 417 if (test_thread_flag(TIF_SINGLESTEP)) 421 418 ptrace_notify(SIGTRAP); ··· 427 428 return 0; 428 429 429 430 give_sigsegv: 430 - force_sig(SIGSEGV, current); 431 + force_sigsegv(sig, current); 431 432 return -EFAULT; 433 + } 434 + 435 + static inline void stepback(struct pt_regs *regs) 436 + { 437 + regs->pc -= 2; 438 + regs->orig_d0 = -1; 432 439 } 433 440 434 441 /* ··· 464 459 /* fallthrough */ 465 460 case -ERESTARTNOINTR: 466 461 regs->d0 = regs->orig_d0; 467 - regs->pc -= 2; 462 + stepback(regs); 468 463 } 469 464 } 470 465 ··· 532 527 case -ERESTARTSYS: 533 528 case -ERESTARTNOINTR: 534 529 regs->d0 = regs->orig_d0; 535 - regs->pc -= 2; 530 + stepback(regs); 536 531 break; 537 532 538 533 case -ERESTART_RESTARTBLOCK: 539 534 regs->d0 = __NR_restart_syscall; 540 - regs->pc -= 2; 535 + stepback(regs); 541 536 break; 542 537 } 543 538 }
+6 -8
arch/mn10300/mm/Makefile
··· 2 2 # Makefile for the MN10300-specific memory management code 3 3 # 4 4 5 + cacheflush-y := cache.o cache-mn10300.o 6 + cacheflush-$(CONFIG_MN10300_CACHE_WBACK) += cache-flush-mn10300.o 7 + 8 + cacheflush-$(CONFIG_MN10300_CACHE_DISABLED) := cache-disabled.o 9 + 5 10 obj-y := \ 6 11 init.o fault.o pgtable.o extable.o tlb-mn10300.o mmu-context.o \ 7 - misalignment.o dma-alloc.o 8 - 9 - ifneq ($(CONFIG_MN10300_CACHE_DISABLED),y) 10 - obj-y += cache.o cache-mn10300.o 11 - ifeq ($(CONFIG_MN10300_CACHE_WBACK),y) 12 - obj-y += cache-flush-mn10300.o 13 - endif 14 - endif 12 + misalignment.o dma-alloc.o $(cacheflush-y)
+21
arch/mn10300/mm/cache-disabled.c
··· 1 + /* Handle the cache being disabled 2 + * 3 + * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved. 4 + * Written by David Howells (dhowells@redhat.com) 5 + * 6 + * This program is free software; you can redistribute it and/or 7 + * modify it under the terms of the GNU General Public Licence 8 + * as published by the Free Software Foundation; either version 9 + * 2 of the Licence, or (at your option) any later version. 10 + */ 11 + #include <linux/mm.h> 12 + 13 + /* 14 + * allow userspace to flush the instruction cache 15 + */ 16 + asmlinkage long sys_cacheflush(unsigned long start, unsigned long end) 17 + { 18 + if (end < start) 19 + return -EINVAL; 20 + return 0; 21 + }
+19 -1
arch/mn10300/mm/cache.c
··· 54 54 void flush_icache_range(unsigned long start, unsigned long end) 55 55 { 56 56 #ifdef CONFIG_MN10300_CACHE_WBACK 57 - unsigned long addr, size, off; 57 + unsigned long addr, size, base, off; 58 58 struct page *page; 59 59 pgd_t *pgd; 60 60 pud_t *pud; 61 61 pmd_t *pmd; 62 62 pte_t *ppte, pte; 63 + 64 + if (end > 0x80000000UL) { 65 + /* addresses above 0xa0000000 do not go through the cache */ 66 + if (end > 0xa0000000UL) { 67 + end = 0xa0000000UL; 68 + if (start >= end) 69 + return; 70 + } 71 + 72 + /* kernel addresses between 0x80000000 and 0x9fffffff do not 73 + * require page tables, so we just map such addresses directly */ 74 + base = (start >= 0x80000000UL) ? start : 0x80000000UL; 75 + mn10300_dcache_flush_range(base, end); 76 + if (base == start) 77 + goto invalidate; 78 + end = base; 79 + } 63 80 64 81 for (; start < end; start += size) { 65 82 /* work out how much of the page to flush */ ··· 121 104 } 122 105 #endif 123 106 107 + invalidate: 124 108 mn10300_icache_inv(); 125 109 } 126 110 EXPORT_SYMBOL(flush_icache_range);
+1 -2
arch/parisc/kernel/module.c
··· 941 941 nsyms = newptr - (Elf_Sym *)symhdr->sh_addr; 942 942 DEBUGP("NEW num_symtab %lu\n", nsyms); 943 943 symhdr->sh_size = nsyms * sizeof(Elf_Sym); 944 - return module_bug_finalize(hdr, sechdrs, me); 944 + return 0; 945 945 } 946 946 947 947 void module_arch_cleanup(struct module *mod) 948 948 { 949 949 deregister_unwind_table(mod); 950 - module_bug_cleanup(mod); 951 950 }
-6
arch/powerpc/kernel/module.c
··· 63 63 const Elf_Shdr *sechdrs, struct module *me) 64 64 { 65 65 const Elf_Shdr *sect; 66 - int err; 67 - 68 - err = module_bug_finalize(hdr, sechdrs, me); 69 - if (err) 70 - return err; 71 66 72 67 /* Apply feature fixups */ 73 68 sect = find_section(hdr, sechdrs, "__ftr_fixup"); ··· 96 101 97 102 void module_arch_cleanup(struct module *mod) 98 103 { 99 - module_bug_cleanup(mod); 100 104 }
+1 -1
arch/powerpc/platforms/512x/clock.c
··· 57 57 int id_match = 0; 58 58 59 59 if (dev == NULL || id == NULL) 60 - return NULL; 60 + return clk; 61 61 62 62 mutex_lock(&clocks_mutex); 63 63 list_for_each_entry(p, &clocks, node) {
+6 -3
arch/powerpc/platforms/52xx/efika.c
··· 99 99 if (bus_range == NULL || len < 2 * sizeof(int)) { 100 100 printk(KERN_WARNING EFIKA_PLATFORM_NAME 101 101 ": Can't get bus-range for %s\n", pcictrl->full_name); 102 - return; 102 + goto out_put; 103 103 } 104 104 105 105 if (bus_range[1] == bus_range[0]) ··· 111 111 printk(" controlled by %s\n", pcictrl->full_name); 112 112 printk("\n"); 113 113 114 - hose = pcibios_alloc_controller(of_node_get(pcictrl)); 114 + hose = pcibios_alloc_controller(pcictrl); 115 115 if (!hose) { 116 116 printk(KERN_WARNING EFIKA_PLATFORM_NAME 117 117 ": Can't allocate PCI controller structure for %s\n", 118 118 pcictrl->full_name); 119 - return; 119 + goto out_put; 120 120 } 121 121 122 122 hose->first_busno = bus_range[0]; ··· 124 124 hose->ops = &rtas_pci_ops; 125 125 126 126 pci_process_bridge_OF_ranges(hose, pcictrl, 0); 127 + return; 128 + out_put: 129 + of_node_put(pcictrl); 127 130 } 128 131 129 132 #else
+6 -2
arch/powerpc/platforms/52xx/mpc52xx_common.c
··· 325 325 clrbits32(&simple_gpio->simple_dvo, sync | out); 326 326 clrbits8(&wkup_gpio->wkup_dvo, reset); 327 327 328 - /* wait at lease 1 us */ 329 - udelay(2); 328 + /* wait for 1 us */ 329 + udelay(1); 330 330 331 331 /* Deassert reset */ 332 332 setbits8(&wkup_gpio->wkup_dvo, reset); 333 + 334 + /* wait at least 200ns */ 335 + /* 7 ~= (200ns * timebase) / ns2sec */ 336 + __delay(7); 333 337 334 338 /* Restore pin-muxing */ 335 339 out_be32(&simple_gpio->port_config, mux);
+1 -2
arch/s390/kernel/module.c
··· 407 407 { 408 408 vfree(me->arch.syminfo); 409 409 me->arch.syminfo = NULL; 410 - return module_bug_finalize(hdr, sechdrs, me); 410 + return 0; 411 411 } 412 412 413 413 void module_arch_cleanup(struct module *mod) 414 414 { 415 - module_bug_cleanup(mod); 416 415 }
-2
arch/sh/kernel/module.c
··· 149 149 int ret = 0; 150 150 151 151 ret |= module_dwarf_finalize(hdr, sechdrs, me); 152 - ret |= module_bug_finalize(hdr, sechdrs, me); 153 152 154 153 return ret; 155 154 } 156 155 157 156 void module_arch_cleanup(struct module *mod) 158 157 { 159 - module_bug_cleanup(mod); 160 158 module_dwarf_cleanup(mod); 161 159 }
-7
arch/tile/kernel/intvec_32.S
··· 1506 1506 } 1507 1507 STD_ENDPROC(handle_ill) 1508 1508 1509 - .pushsection .rodata, "a" 1510 - .align 8 1511 - bpt_code: 1512 - bpt 1513 - ENDPROC(bpt_code) 1514 - .popsection 1515 - 1516 1509 /* Various stub interrupt handlers and syscall handlers */ 1517 1510 1518 1511 STD_ENTRY_LOCAL(_kernel_double_fault)
+3 -14
arch/um/drivers/net_kern.c
··· 255 255 netif_wake_queue(dev); 256 256 } 257 257 258 - static int uml_net_set_mac(struct net_device *dev, void *addr) 259 - { 260 - struct uml_net_private *lp = netdev_priv(dev); 261 - struct sockaddr *hwaddr = addr; 262 - 263 - spin_lock_irq(&lp->lock); 264 - eth_mac_addr(dev, hwaddr->sa_data); 265 - spin_unlock_irq(&lp->lock); 266 - 267 - return 0; 268 - } 269 - 270 258 static int uml_net_change_mtu(struct net_device *dev, int new_mtu) 271 259 { 272 260 dev->mtu = new_mtu; ··· 361 373 .ndo_start_xmit = uml_net_start_xmit, 362 374 .ndo_set_multicast_list = uml_net_set_multicast_list, 363 375 .ndo_tx_timeout = uml_net_tx_timeout, 364 - .ndo_set_mac_address = uml_net_set_mac, 376 + .ndo_set_mac_address = eth_mac_addr, 365 377 .ndo_change_mtu = uml_net_change_mtu, 366 378 .ndo_validate_addr = eth_validate_addr, 367 379 }; ··· 460 472 ((*transport->user->init)(&lp->user, dev) != 0)) 461 473 goto out_unregister; 462 474 463 - eth_mac_addr(dev, device->mac); 475 + /* don't use eth_mac_addr, it will not work here */ 476 + memcpy(dev->dev_addr, device->mac, ETH_ALEN); 464 477 dev->mtu = transport->user->mtu; 465 478 dev->netdev_ops = &uml_netdev_ops; 466 479 dev->ethtool_ops = &uml_net_ethtool_ops;
+3 -3
arch/um/kernel/exec.c
··· 62 62 return error; 63 63 } 64 64 65 - long um_execve(const char *file, char __user *__user *argv, char __user *__user *env) 65 + long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env) 66 66 { 67 67 long err; 68 68 ··· 72 72 return err; 73 73 } 74 74 75 - long sys_execve(const char __user *file, char __user *__user *argv, 76 - char __user *__user *env) 75 + long sys_execve(const char __user *file, const char __user *const __user *argv, 76 + const char __user *const __user *env) 77 77 { 78 78 long error; 79 79 char *filename;
+1 -1
arch/um/kernel/internal.h
··· 1 - extern long um_execve(const char *file, char __user *__user *argv, char __user *__user *env); 1 + extern long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env);
+2 -2
arch/um/kernel/syscall.c
··· 60 60 61 61 fs = get_fs(); 62 62 set_fs(KERNEL_DS); 63 - ret = um_execve(filename, (char __user *__user *)argv, 64 - (char __user *__user *) envp); 63 + ret = um_execve(filename, (const char __user *const __user *)argv, 64 + (const char __user *const __user *) envp); 65 65 set_fs(fs); 66 66 67 67 return ret;
+13 -1
arch/x86/boot/early_serial_console.c
··· 58 58 if (arg[pos] == ',') 59 59 pos++; 60 60 61 - if (!strncmp(arg, "ttyS", 4)) { 61 + /* 62 + * make sure we have 63 + * "serial,0x3f8,115200" 64 + * "serial,ttyS0,115200" 65 + * "ttyS0,115200" 66 + */ 67 + if (pos == 7 && !strncmp(arg + pos, "0x", 2)) { 68 + port = simple_strtoull(arg + pos, &e, 16); 69 + if (port == 0 || arg + pos == e) 70 + port = DEFAULT_SERIAL_PORT; 71 + else 72 + pos = e - arg; 73 + } else if (!strncmp(arg + pos, "ttyS", 4)) { 62 74 static const int bases[] = { 0x3f8, 0x2f8 }; 63 75 int idx = 0; 64 76
+6
arch/x86/include/asm/amd_iommu_proto.h
··· 38 38 39 39 #endif /* !CONFIG_AMD_IOMMU_STATS */ 40 40 41 + static inline bool is_rd890_iommu(struct pci_dev *pdev) 42 + { 43 + return (pdev->vendor == PCI_VENDOR_ID_ATI) && 44 + (pdev->device == PCI_DEVICE_ID_RD890_IOMMU); 45 + } 46 + 41 47 #endif /* _ASM_X86_AMD_IOMMU_PROTO_H */
+12
arch/x86/include/asm/amd_iommu_types.h
··· 368 368 /* capabilities of that IOMMU read from ACPI */ 369 369 u32 cap; 370 370 371 + /* flags read from acpi table */ 372 + u8 acpi_flags; 373 + 371 374 /* 372 375 * Capability pointer. There could be more than one IOMMU per PCI 373 376 * device function if there are more than one AMD IOMMU capability ··· 414 411 415 412 /* default dma_ops domain for that IOMMU */ 416 413 struct dma_ops_domain *default_dom; 414 + 415 + /* 416 + * This array is required to work around a potential BIOS bug. 417 + * The BIOS may miss to restore parts of the PCI configuration 418 + * space when the system resumes from S3. The result is that the 419 + * IOMMU does not execute commands anymore which leads to system 420 + * failure. 421 + */ 422 + u32 cache_cfg[4]; 417 423 }; 418 424 419 425 /*
+1 -1
arch/x86/include/asm/bitops.h
··· 309 309 static __always_inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr) 310 310 { 311 311 return ((1UL << (nr % BITS_PER_LONG)) & 312 - (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0; 312 + (addr[nr / BITS_PER_LONG])) != 0; 313 313 } 314 314 315 315 static inline int variable_test_bit(int nr, volatile const unsigned long *addr)
+1
arch/x86/include/asm/cpufeature.h
··· 168 168 #define X86_FEATURE_XSAVEOPT (7*32+ 4) /* Optimized Xsave */ 169 169 #define X86_FEATURE_PLN (7*32+ 5) /* Intel Power Limit Notification */ 170 170 #define X86_FEATURE_PTS (7*32+ 6) /* Intel Package Thermal Status */ 171 + #define X86_FEATURE_DTS (7*32+ 7) /* Digital Thermal Sensor */ 171 172 172 173 /* Virtualization flags: Linux defined, word 8 */ 173 174 #define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */
+1 -1
arch/x86/kernel/acpi/cstate.c
··· 61 61 unsigned int ecx; 62 62 } states[ACPI_PROCESSOR_MAX_POWER]; 63 63 }; 64 - static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */ 64 + static struct cstate_entry __percpu *cpu_cstate_entry; /* per CPU ptr */ 65 65 66 66 static short mwait_supported[ACPI_PROCESSOR_MAX_POWER]; 67 67
+3 -1
arch/x86/kernel/amd_iommu.c
··· 1953 1953 size_t size, 1954 1954 int dir) 1955 1955 { 1956 + dma_addr_t flush_addr; 1956 1957 dma_addr_t i, start; 1957 1958 unsigned int pages; 1958 1959 ··· 1961 1960 (dma_addr + size > dma_dom->aperture_size)) 1962 1961 return; 1963 1962 1963 + flush_addr = dma_addr; 1964 1964 pages = iommu_num_pages(dma_addr, size, PAGE_SIZE); 1965 1965 dma_addr &= PAGE_MASK; 1966 1966 start = dma_addr; ··· 1976 1974 dma_ops_free_addresses(dma_dom, dma_addr, pages); 1977 1975 1978 1976 if (amd_iommu_unmap_flush || dma_dom->need_flush) { 1979 - iommu_flush_pages(&dma_dom->domain, dma_addr, size); 1977 + iommu_flush_pages(&dma_dom->domain, flush_addr, size); 1980 1978 dma_dom->need_flush = false; 1981 1979 } 1982 1980 }
+45 -22
arch/x86/kernel/amd_iommu_init.c
··· 632 632 iommu->last_device = calc_devid(MMIO_GET_BUS(range), 633 633 MMIO_GET_LD(range)); 634 634 iommu->evt_msi_num = MMIO_MSI_NUM(misc); 635 + 636 + if (is_rd890_iommu(iommu->dev)) { 637 + pci_read_config_dword(iommu->dev, 0xf0, &iommu->cache_cfg[0]); 638 + pci_read_config_dword(iommu->dev, 0xf4, &iommu->cache_cfg[1]); 639 + pci_read_config_dword(iommu->dev, 0xf8, &iommu->cache_cfg[2]); 640 + pci_read_config_dword(iommu->dev, 0xfc, &iommu->cache_cfg[3]); 641 + } 635 642 } 636 643 637 644 /* ··· 656 649 struct ivhd_entry *e; 657 650 658 651 /* 659 - * First set the recommended feature enable bits from ACPI 660 - * into the IOMMU control registers 652 + * First save the recommended feature enable bits from ACPI 661 653 */ 662 - h->flags & IVHD_FLAG_HT_TUN_EN_MASK ? 663 - iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) : 664 - iommu_feature_disable(iommu, CONTROL_HT_TUN_EN); 665 - 666 - h->flags & IVHD_FLAG_PASSPW_EN_MASK ? 667 - iommu_feature_enable(iommu, CONTROL_PASSPW_EN) : 668 - iommu_feature_disable(iommu, CONTROL_PASSPW_EN); 669 - 670 - h->flags & IVHD_FLAG_RESPASSPW_EN_MASK ? 671 - iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) : 672 - iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN); 673 - 674 - h->flags & IVHD_FLAG_ISOC_EN_MASK ? 675 - iommu_feature_enable(iommu, CONTROL_ISOC_EN) : 676 - iommu_feature_disable(iommu, CONTROL_ISOC_EN); 677 - 678 - /* 679 - * make IOMMU memory accesses cache coherent 680 - */ 681 - iommu_feature_enable(iommu, CONTROL_COHERENT_EN); 654 + iommu->acpi_flags = h->flags; 682 655 683 656 /* 684 657 * Done. Now parse the device entries ··· 1103 1116 } 1104 1117 } 1105 1118 1119 + static void iommu_init_flags(struct amd_iommu *iommu) 1120 + { 1121 + iommu->acpi_flags & IVHD_FLAG_HT_TUN_EN_MASK ? 1122 + iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) : 1123 + iommu_feature_disable(iommu, CONTROL_HT_TUN_EN); 1124 + 1125 + iommu->acpi_flags & IVHD_FLAG_PASSPW_EN_MASK ? 1126 + iommu_feature_enable(iommu, CONTROL_PASSPW_EN) : 1127 + iommu_feature_disable(iommu, CONTROL_PASSPW_EN); 1128 + 1129 + iommu->acpi_flags & IVHD_FLAG_RESPASSPW_EN_MASK ? 1130 + iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) : 1131 + iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN); 1132 + 1133 + iommu->acpi_flags & IVHD_FLAG_ISOC_EN_MASK ? 1134 + iommu_feature_enable(iommu, CONTROL_ISOC_EN) : 1135 + iommu_feature_disable(iommu, CONTROL_ISOC_EN); 1136 + 1137 + /* 1138 + * make IOMMU memory accesses cache coherent 1139 + */ 1140 + iommu_feature_enable(iommu, CONTROL_COHERENT_EN); 1141 + } 1142 + 1143 + static void iommu_apply_quirks(struct amd_iommu *iommu) 1144 + { 1145 + if (is_rd890_iommu(iommu->dev)) { 1146 + pci_write_config_dword(iommu->dev, 0xf0, iommu->cache_cfg[0]); 1147 + pci_write_config_dword(iommu->dev, 0xf4, iommu->cache_cfg[1]); 1148 + pci_write_config_dword(iommu->dev, 0xf8, iommu->cache_cfg[2]); 1149 + pci_write_config_dword(iommu->dev, 0xfc, iommu->cache_cfg[3]); 1150 + } 1151 + } 1152 + 1106 1153 /* 1107 1154 * This function finally enables all IOMMUs found in the system after 1108 1155 * they have been initialized ··· 1147 1126 1148 1127 for_each_iommu(iommu) { 1149 1128 iommu_disable(iommu); 1129 + iommu_apply_quirks(iommu); 1130 + iommu_init_flags(iommu); 1150 1131 iommu_set_device_table(iommu); 1151 1132 iommu_enable_command_buffer(iommu); 1152 1133 iommu_enable_event_buffer(iommu);
+8 -3
arch/x86/kernel/apic/io_apic.c
··· 306 306 307 307 old_cfg = old_desc->chip_data; 308 308 309 - memcpy(cfg, old_cfg, sizeof(struct irq_cfg)); 309 + cfg->vector = old_cfg->vector; 310 + cfg->move_in_progress = old_cfg->move_in_progress; 311 + cpumask_copy(cfg->domain, old_cfg->domain); 312 + cpumask_copy(cfg->old_domain, old_cfg->old_domain); 310 313 311 314 init_copy_irq_2_pin(old_cfg, cfg, node); 312 315 } 313 316 314 - static void free_irq_cfg(struct irq_cfg *old_cfg) 317 + static void free_irq_cfg(struct irq_cfg *cfg) 315 318 { 316 - kfree(old_cfg); 319 + free_cpumask_var(cfg->domain); 320 + free_cpumask_var(cfg->old_domain); 321 + kfree(cfg); 317 322 } 318 323 319 324 void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
+1 -1
arch/x86/kernel/cpu/common.c
··· 545 545 } 546 546 } 547 547 548 - static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) 548 + void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) 549 549 { 550 550 u32 tfms, xlvl; 551 551 u32 ebx;
+1
arch/x86/kernel/cpu/cpu.h
··· 33 33 *const __x86_cpu_dev_end[]; 34 34 35 35 extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); 36 + extern void get_cpu_cap(struct cpuinfo_x86 *c); 36 37 37 38 #endif
+12 -6
arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
··· 368 368 return -ENODEV; 369 369 370 370 out_obj = output.pointer; 371 - if (out_obj->type != ACPI_TYPE_BUFFER) 372 - return -ENODEV; 371 + if (out_obj->type != ACPI_TYPE_BUFFER) { 372 + ret = -ENODEV; 373 + goto out_free; 374 + } 373 375 374 376 errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); 375 - if (errors) 376 - return -ENODEV; 377 + if (errors) { 378 + ret = -ENODEV; 379 + goto out_free; 380 + } 377 381 378 382 supported = *((u32 *)(out_obj->buffer.pointer + 4)); 379 - if (!(supported & 0x1)) 380 - return -ENODEV; 383 + if (!(supported & 0x1)) { 384 + ret = -ENODEV; 385 + goto out_free; 386 + } 381 387 382 388 out_free: 383 389 kfree(output.pointer);
+1
arch/x86/kernel/cpu/intel.c
··· 39 39 misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID; 40 40 wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable); 41 41 c->cpuid_level = cpuid_eax(0); 42 + get_cpu_cap(c); 42 43 } 43 44 } 44 45
+1
arch/x86/kernel/cpu/scattered.c
··· 31 31 const struct cpuid_bit *cb; 32 32 33 33 static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { 34 + { X86_FEATURE_DTS, CR_EAX, 0, 0x00000006, 0 }, 34 35 { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006, 0 }, 35 36 { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006, 0 }, 36 37 { X86_FEATURE_PLN, CR_EAX, 4, 0x00000006, 0 },
+1 -1
arch/x86/kernel/hpet.c
··· 506 506 { 507 507 unsigned int irq; 508 508 509 - irq = create_irq(); 509 + irq = create_irq_nr(0, -1); 510 510 if (!irq) 511 511 return -EINVAL; 512 512
+1 -2
arch/x86/kernel/module.c
··· 242 242 /* make jump label nops */ 243 243 jump_label_apply_nops(me); 244 244 245 - return module_bug_finalize(hdr, sechdrs, me); 245 + return 0; 246 246 } 247 247 248 248 void module_arch_cleanup(struct module *mod) 249 249 { 250 250 alternatives_smp_module_del(mod); 251 - module_bug_cleanup(mod); 252 251 }
+3 -2
arch/x86/xen/time.c
··· 489 489 __init void xen_hvm_init_time_ops(void) 490 490 { 491 491 /* vector callback is needed otherwise we cannot receive interrupts 492 - * on cpu > 0 */ 493 - if (!xen_have_vector_callback && num_present_cpus() > 1) 492 + * on cpu > 0 and at this point we don't know how many cpus are 493 + * available */ 494 + if (!xen_have_vector_callback) 494 495 return; 495 496 if (!xen_feature(XENFEAT_hvm_safe_pvclock)) { 496 497 printk(KERN_INFO "Xen doesn't support pvclock on HVM,"
+12
block/blk-merge.c
··· 362 362 return 0; 363 363 364 364 /* 365 + * Don't merge file system requests and discard requests 366 + */ 367 + if ((req->cmd_flags & REQ_DISCARD) != (next->cmd_flags & REQ_DISCARD)) 368 + return 0; 369 + 370 + /* 371 + * Don't merge discard requests and secure discard requests 372 + */ 373 + if ((req->cmd_flags & REQ_SECURE) != (next->cmd_flags & REQ_SECURE)) 374 + return 0; 375 + 376 + /* 365 377 * not contiguous 366 378 */ 367 379 if (blk_rq_pos(req) + blk_rq_sectors(req) != blk_rq_pos(next))
+1 -1
drivers/acpi/Kconfig
··· 105 105 106 106 Be aware that using this interface can confuse your Embedded 107 107 Controller in a way that a normal reboot is not enough. You then 108 - have to power of your system, and remove the laptop battery for 108 + have to power off your system, and remove the laptop battery for 109 109 some seconds. 110 110 An Embedded Controller typically is available on laptops and reads 111 111 sensor values like battery state and temperature.
+18 -16
drivers/acpi/acpi_pad.c
··· 382 382 device_remove_file(&device->dev, &dev_attr_rrtime); 383 383 } 384 384 385 - /* Query firmware how many CPUs should be idle */ 386 - static int acpi_pad_pur(acpi_handle handle, int *num_cpus) 385 + /* 386 + * Query firmware how many CPUs should be idle 387 + * return -1 on failure 388 + */ 389 + static int acpi_pad_pur(acpi_handle handle) 387 390 { 388 391 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; 389 392 union acpi_object *package; 390 - int rev, num, ret = -EINVAL; 393 + int num = -1; 391 394 392 395 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer))) 393 - return -EINVAL; 396 + return num; 394 397 395 398 if (!buffer.length || !buffer.pointer) 396 - return -EINVAL; 399 + return num; 397 400 398 401 package = buffer.pointer; 399 - if (package->type != ACPI_TYPE_PACKAGE || package->package.count != 2) 400 - goto out; 401 - rev = package->package.elements[0].integer.value; 402 - num = package->package.elements[1].integer.value; 403 - if (rev != 1 || num < 0) 404 - goto out; 405 - *num_cpus = num; 406 - ret = 0; 407 - out: 402 + 403 + if (package->type == ACPI_TYPE_PACKAGE && 404 + package->package.count == 2 && 405 + package->package.elements[0].integer.value == 1) /* rev 1 */ 406 + 407 + num = package->package.elements[1].integer.value; 408 + 408 409 kfree(buffer.pointer); 409 - return ret; 410 + return num; 410 411 } 411 412 412 413 /* Notify firmware how many CPUs are idle */ ··· 434 433 uint32_t idle_cpus; 435 434 436 435 mutex_lock(&isolated_cpus_lock); 437 - if (acpi_pad_pur(handle, &num_cpus)) { 436 + num_cpus = acpi_pad_pur(handle); 437 + if (num_cpus < 0) { 438 438 mutex_unlock(&isolated_cpus_lock); 439 439 return; 440 440 }
+1
drivers/acpi/acpica/aclocal.h
··· 854 854 ACPI_BITMASK_POWER_BUTTON_STATUS | \ 855 855 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ 856 856 ACPI_BITMASK_RT_CLOCK_STATUS | \ 857 + ACPI_BITMASK_PCIEXP_WAKE_DISABLE | \ 857 858 ACPI_BITMASK_WAKE_STATUS) 858 859 859 860 #define ACPI_BITMASK_TIMER_ENABLE 0x0001
+1 -1
drivers/acpi/acpica/exutils.c
··· 109 109 * 110 110 * DESCRIPTION: Reacquire the interpreter execution region from within the 111 111 * interpreter code. Failure to enter the interpreter region is a 112 - * fatal system error. Used in conjuction with 112 + * fatal system error. Used in conjunction with 113 113 * relinquish_interpreter 114 114 * 115 115 ******************************************************************************/
+1 -1
drivers/acpi/acpica/rsutils.c
··· 149 149 150 150 /* 151 151 * 16-, 32-, and 64-bit cases must use the move macros that perform 152 - * endian conversion and/or accomodate hardware that cannot perform 152 + * endian conversion and/or accommodate hardware that cannot perform 153 153 * misaligned memory transfers 154 154 */ 155 155 case ACPI_RSC_MOVE16:
+1 -1
drivers/acpi/apei/Kconfig
··· 34 34 depends on ACPI_APEI 35 35 help 36 36 ERST is a way provided by APEI to save and retrieve hardware 37 - error infomation to and from a persistent store. Enable this 37 + error information to and from a persistent store. Enable this 38 38 if you want to debugging and testing the ERST kernel support 39 39 and firmware implementation.
+16 -5
drivers/acpi/apei/apei-base.c
··· 445 445 int apei_resources_request(struct apei_resources *resources, 446 446 const char *desc) 447 447 { 448 - struct apei_res *res, *res_bak; 448 + struct apei_res *res, *res_bak = NULL; 449 449 struct resource *r; 450 + int rc; 450 451 451 - apei_resources_sub(resources, &apei_resources_all); 452 + rc = apei_resources_sub(resources, &apei_resources_all); 453 + if (rc) 454 + return rc; 452 455 456 + rc = -EINVAL; 453 457 list_for_each_entry(res, &resources->iomem, list) { 454 458 r = request_mem_region(res->start, res->end - res->start, 455 459 desc); ··· 479 475 } 480 476 } 481 477 482 - apei_resources_merge(&apei_resources_all, resources); 478 + rc = apei_resources_merge(&apei_resources_all, resources); 479 + if (rc) { 480 + pr_err(APEI_PFX "Fail to merge resources!\n"); 481 + goto err_unmap_ioport; 482 + } 483 483 484 484 return 0; 485 485 err_unmap_ioport: ··· 499 491 break; 500 492 release_mem_region(res->start, res->end - res->start); 501 493 } 502 - return -EINVAL; 494 + return rc; 503 495 } 504 496 EXPORT_SYMBOL_GPL(apei_resources_request); 505 497 506 498 void apei_resources_release(struct apei_resources *resources) 507 499 { 500 + int rc; 508 501 struct apei_res *res; 509 502 510 503 list_for_each_entry(res, &resources->iomem, list) ··· 513 504 list_for_each_entry(res, &resources->ioport, list) 514 505 release_region(res->start, res->end - res->start); 515 506 516 - apei_resources_sub(&apei_resources_all, resources); 507 + rc = apei_resources_sub(&apei_resources_all, resources); 508 + if (rc) 509 + pr_err(APEI_PFX "Fail to sub resources!\n"); 517 510 } 518 511 EXPORT_SYMBOL_GPL(apei_resources_release); 519 512
+3 -1
drivers/acpi/apei/einj.c
··· 426 426 427 427 static int einj_check_table(struct acpi_table_einj *einj_tab) 428 428 { 429 - if (einj_tab->header_length != sizeof(struct acpi_table_einj)) 429 + if ((einj_tab->header_length != 430 + (sizeof(struct acpi_table_einj) - sizeof(einj_tab->header))) 431 + && (einj_tab->header_length != sizeof(struct acpi_table_einj))) 430 432 return -EINVAL; 431 433 if (einj_tab->header.length < sizeof(struct acpi_table_einj)) 432 434 return -EINVAL;
+11 -7
drivers/acpi/apei/erst-dbg.c
··· 2 2 * APEI Error Record Serialization Table debug support 3 3 * 4 4 * ERST is a way provided by APEI to save and retrieve hardware error 5 - * infomation to and from a persistent store. This file provide the 5 + * information to and from a persistent store. This file provide the 6 6 * debugging/testing support for ERST kernel support and firmware 7 7 * implementation. 8 8 * ··· 111 111 goto out; 112 112 } 113 113 if (len > erst_dbg_buf_len) { 114 - kfree(erst_dbg_buf); 114 + void *p; 115 115 rc = -ENOMEM; 116 - erst_dbg_buf = kmalloc(len, GFP_KERNEL); 117 - if (!erst_dbg_buf) 116 + p = kmalloc(len, GFP_KERNEL); 117 + if (!p) 118 118 goto out; 119 + kfree(erst_dbg_buf); 120 + erst_dbg_buf = p; 119 121 erst_dbg_buf_len = len; 120 122 goto retry; 121 123 } ··· 152 150 if (mutex_lock_interruptible(&erst_dbg_mutex)) 153 151 return -EINTR; 154 152 if (usize > erst_dbg_buf_len) { 155 - kfree(erst_dbg_buf); 153 + void *p; 156 154 rc = -ENOMEM; 157 - erst_dbg_buf = kmalloc(usize, GFP_KERNEL); 158 - if (!erst_dbg_buf) 155 + p = kmalloc(usize, GFP_KERNEL); 156 + if (!p) 159 157 goto out; 158 + kfree(erst_dbg_buf); 159 + erst_dbg_buf = p; 160 160 erst_dbg_buf_len = usize; 161 161 } 162 162 rc = copy_from_user(erst_dbg_buf, ubuf, usize);
+24 -5
drivers/acpi/apei/erst.c
··· 2 2 * APEI Error Record Serialization Table support 3 3 * 4 4 * ERST is a way provided by APEI to save and retrieve hardware error 5 - * infomation to and from a persistent store. 5 + * information to and from a persistent store. 6 6 * 7 7 * For more information about ERST, please refer to ACPI Specification 8 8 * version 4.0, section 17.4. ··· 266 266 { 267 267 int rc; 268 268 u64 offset; 269 + void *src, *dst; 270 + 271 + /* ioremap does not work in interrupt context */ 272 + if (in_interrupt()) { 273 + pr_warning(ERST_PFX 274 + "MOVE_DATA can not be used in interrupt context"); 275 + return -EBUSY; 276 + } 269 277 270 278 rc = __apei_exec_read_register(entry, &offset); 271 279 if (rc) 272 280 return rc; 273 - memmove((void *)ctx->dst_base + offset, 274 - (void *)ctx->src_base + offset, 275 - ctx->var2); 281 + 282 + src = ioremap(ctx->src_base + offset, ctx->var2); 283 + if (!src) 284 + return -ENOMEM; 285 + dst = ioremap(ctx->dst_base + offset, ctx->var2); 286 + if (!dst) 287 + return -ENOMEM; 288 + 289 + memmove(dst, src, ctx->var2); 290 + 291 + iounmap(src); 292 + iounmap(dst); 276 293 277 294 return 0; 278 295 } ··· 767 750 768 751 static int erst_check_table(struct acpi_table_erst *erst_tab) 769 752 { 770 - if (erst_tab->header_length != sizeof(struct acpi_table_erst)) 753 + if ((erst_tab->header_length != 754 + (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header))) 755 + && (erst_tab->header_length != sizeof(struct acpi_table_einj))) 771 756 return -EINVAL; 772 757 if (erst_tab->header.length < sizeof(struct acpi_table_erst)) 773 758 return -EINVAL;
+1 -1
drivers/acpi/apei/ghes.c
··· 302 302 struct ghes *ghes = NULL; 303 303 int rc = -EINVAL; 304 304 305 - generic = ghes_dev->dev.platform_data; 305 + generic = *(struct acpi_hest_generic **)ghes_dev->dev.platform_data; 306 306 if (!generic->enabled) 307 307 return -ENODEV; 308 308
+7 -4
drivers/acpi/apei/hest.c
··· 137 137 138 138 static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data) 139 139 { 140 - struct acpi_hest_generic *generic; 141 140 struct platform_device *ghes_dev; 142 141 struct ghes_arr *ghes_arr = data; 143 142 int rc; 144 143 145 144 if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR) 146 145 return 0; 147 - generic = (struct acpi_hest_generic *)hest_hdr; 148 - if (!generic->enabled) 146 + 147 + if (!((struct acpi_hest_generic *)hest_hdr)->enabled) 149 148 return 0; 150 149 ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id); 151 150 if (!ghes_dev) 152 151 return -ENOMEM; 153 - ghes_dev->dev.platform_data = generic; 152 + 153 + rc = platform_device_add_data(ghes_dev, &hest_hdr, sizeof(void *)); 154 + if (rc) 155 + goto err; 156 + 154 157 rc = platform_device_add(ghes_dev); 155 158 if (rc) 156 159 goto err;
+1 -1
drivers/acpi/atomicio.c
··· 142 142 list_add_tail_rcu(&map->list, &acpi_iomaps); 143 143 spin_unlock_irqrestore(&acpi_iomaps_lock, flags); 144 144 145 - return vaddr + (paddr - pg_off); 145 + return map->vaddr + (paddr - map->paddr); 146 146 err_unmap: 147 147 iounmap(vaddr); 148 148 return NULL;
-1
drivers/acpi/battery.c
··· 273 273 POWER_SUPPLY_PROP_CYCLE_COUNT, 274 274 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, 275 275 POWER_SUPPLY_PROP_VOLTAGE_NOW, 276 - POWER_SUPPLY_PROP_CURRENT_NOW, 277 276 POWER_SUPPLY_PROP_POWER_NOW, 278 277 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, 279 278 POWER_SUPPLY_PROP_ENERGY_FULL,
+18
drivers/acpi/blacklist.c
··· 183 183 { 184 184 printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); 185 185 acpi_osi_setup("!Windows 2006"); 186 + acpi_osi_setup("!Windows 2006 SP1"); 187 + acpi_osi_setup("!Windows 2006 SP2"); 186 188 return 0; 187 189 } 188 190 static int __init dmi_disable_osi_win7(const struct dmi_system_id *d) ··· 228 226 }, 229 227 }, 230 228 { 229 + .callback = dmi_disable_osi_vista, 230 + .ident = "Toshiba Satellite L355", 231 + .matches = { 232 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 233 + DMI_MATCH(DMI_PRODUCT_VERSION, "Satellite L355"), 234 + }, 235 + }, 236 + { 231 237 .callback = dmi_disable_osi_win7, 232 238 .ident = "ASUS K50IJ", 233 239 .matches = { 234 240 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), 235 241 DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"), 242 + }, 243 + }, 244 + { 245 + .callback = dmi_disable_osi_vista, 246 + .ident = "Toshiba P305D", 247 + .matches = { 248 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 249 + DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P305D"), 236 250 }, 237 251 }, 238 252
+5 -13
drivers/acpi/bus.c
··· 55 55 static int set_power_nocheck(const struct dmi_system_id *id) 56 56 { 57 57 printk(KERN_NOTICE PREFIX "%s detected - " 58 - "disable power check in power transistion\n", id->ident); 58 + "disable power check in power transition\n", id->ident); 59 59 acpi_power_nocheck = 1; 60 60 return 0; 61 61 } ··· 80 80 81 81 static struct dmi_system_id dsdt_dmi_table[] __initdata = { 82 82 /* 83 - * Insyde BIOS on some TOSHIBA machines corrupt the DSDT. 83 + * Invoke DSDT corruption work-around on all Toshiba Satellite. 84 84 * https://bugzilla.kernel.org/show_bug.cgi?id=14679 85 85 */ 86 86 { 87 87 .callback = set_copy_dsdt, 88 - .ident = "TOSHIBA Satellite A505", 88 + .ident = "TOSHIBA Satellite", 89 89 .matches = { 90 90 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 91 - DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A505"), 92 - }, 93 - }, 94 - { 95 - .callback = set_copy_dsdt, 96 - .ident = "TOSHIBA Satellite L505D", 97 - .matches = { 98 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 99 - DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L505D"), 91 + DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"), 100 92 }, 101 93 }, 102 94 {} ··· 1019 1027 1020 1028 /* 1021 1029 * If the laptop falls into the DMI check table, the power state check 1022 - * will be disabled in the course of device power transistion. 1030 + * will be disabled in the course of device power transition. 1023 1031 */ 1024 1032 dmi_check_system(power_nocheck_dmi_table); 1025 1033
+2
drivers/acpi/fan.c
··· 369 369 370 370 acpi_bus_unregister_driver(&acpi_fan_driver); 371 371 372 + #ifdef CONFIG_ACPI_PROCFS 372 373 remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); 374 + #endif 373 375 374 376 return; 375 377 }
-6
drivers/acpi/processor_core.c
··· 29 29 30 30 static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = { 31 31 { 32 - set_no_mwait, "IFL91 board", { 33 - DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"), 34 - DMI_MATCH(DMI_SYS_VENDOR, "ZEPTO"), 35 - DMI_MATCH(DMI_PRODUCT_VERSION, "3215W"), 36 - DMI_MATCH(DMI_BOARD_NAME, "IFL91") }, NULL}, 37 - { 38 32 set_no_mwait, "Extensa 5220", { 39 33 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), 40 34 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+1 -1
drivers/acpi/processor_driver.c
··· 850 850 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", 851 851 acpi_idle_driver.name); 852 852 } else { 853 - printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s", 853 + printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s\n", 854 854 cpuidle_get_driver()->name); 855 855 } 856 856
+2 -2
drivers/acpi/processor_perflib.c
··· 447 447 if (!try_module_get(calling_module)) 448 448 return -EINVAL; 449 449 450 - /* is_done is set to negative if an error occured, 451 - * and to postitive if _no_ error occured, but SMM 450 + /* is_done is set to negative if an error occurred, 451 + * and to postitive if _no_ error occurred, but SMM 452 452 * was already notified. This avoids double notification 453 453 * which might lead to unexpected results... 454 454 */
+22
drivers/acpi/sleep.c
··· 363 363 return 0; 364 364 } 365 365 366 + static int __init init_nvs_nosave(const struct dmi_system_id *d) 367 + { 368 + acpi_nvs_nosave(); 369 + return 0; 370 + } 371 + 366 372 static struct dmi_system_id __initdata acpisleep_dmi_table[] = { 367 373 { 368 374 .callback = init_old_suspend_ordering, ··· 401 395 DMI_MATCH(DMI_BOARD_VENDOR, 402 396 "Matsushita Electric Industrial Co.,Ltd."), 403 397 DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), 398 + }, 399 + }, 400 + { 401 + .callback = init_nvs_nosave, 402 + .ident = "Sony Vaio VGN-SR11M", 403 + .matches = { 404 + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 405 + DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"), 406 + }, 407 + }, 408 + { 409 + .callback = init_nvs_nosave, 410 + .ident = "Everex StepNote Series", 411 + .matches = { 412 + DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."), 413 + DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"), 404 414 }, 405 415 }, 406 416 {},
+14 -6
drivers/acpi/sysfs.c
··· 100 100 ACPI_DEBUG_INIT(ACPI_LV_EVENTS), 101 101 }; 102 102 103 - static int param_get_debug_layer(char *buffer, struct kernel_param *kp) 103 + static int param_get_debug_layer(char *buffer, const struct kernel_param *kp) 104 104 { 105 105 int result = 0; 106 106 int i; ··· 128 128 return result; 129 129 } 130 130 131 - static int param_get_debug_level(char *buffer, struct kernel_param *kp) 131 + static int param_get_debug_level(char *buffer, const struct kernel_param *kp) 132 132 { 133 133 int result = 0; 134 134 int i; ··· 149 149 return result; 150 150 } 151 151 152 - module_param_call(debug_layer, param_set_uint, param_get_debug_layer, 153 - &acpi_dbg_layer, 0644); 154 - module_param_call(debug_level, param_set_uint, param_get_debug_level, 155 - &acpi_dbg_level, 0644); 152 + static struct kernel_param_ops param_ops_debug_layer = { 153 + .set = param_set_uint, 154 + .get = param_get_debug_layer, 155 + }; 156 + 157 + static struct kernel_param_ops param_ops_debug_level = { 158 + .set = param_set_uint, 159 + .get = param_get_debug_level, 160 + }; 161 + 162 + module_param_cb(debug_layer, &param_ops_debug_layer, &acpi_dbg_layer, 0644); 163 + module_param_cb(debug_level, &param_ops_debug_level, &acpi_dbg_level, 0644); 156 164 157 165 static char trace_method_name[6]; 158 166 module_param_string(trace_method_name, trace_method_name, 6, 0644);
+2 -2
drivers/acpi/video_detect.c
··· 59 59 "support\n")); 60 60 *cap |= ACPI_VIDEO_BACKLIGHT; 61 61 if (ACPI_FAILURE(acpi_get_handle(handle, "_BQC", &h_dummy))) 62 - printk(KERN_WARNING FW_BUG PREFIX "ACPI brightness " 63 - "control misses _BQC function\n"); 62 + printk(KERN_WARNING FW_BUG PREFIX "No _BQC method, " 63 + "cannot determine initial brightness\n"); 64 64 /* We have backlight support, no need to scan further */ 65 65 return AE_CTRL_TERMINATE; 66 66 }
+4
drivers/ata/ahci.c
··· 90 90 static int ahci_pci_device_resume(struct pci_dev *pdev); 91 91 #endif 92 92 93 + static struct scsi_host_template ahci_sht = { 94 + AHCI_SHT("ahci"), 95 + }; 96 + 93 97 static struct ata_port_operations ahci_vt8251_ops = { 94 98 .inherits = &ahci_ops, 95 99 .hardreset = ahci_vt8251_hardreset,
+11 -1
drivers/ata/ahci.h
··· 298 298 299 299 extern int ahci_ignore_sss; 300 300 301 - extern struct scsi_host_template ahci_sht; 301 + extern struct device_attribute *ahci_shost_attrs[]; 302 + extern struct device_attribute *ahci_sdev_attrs[]; 303 + 304 + #define AHCI_SHT(drv_name) \ 305 + ATA_NCQ_SHT(drv_name), \ 306 + .can_queue = AHCI_MAX_CMDS - 1, \ 307 + .sg_tablesize = AHCI_MAX_SG, \ 308 + .dma_boundary = AHCI_DMA_BOUNDARY, \ 309 + .shost_attrs = ahci_shost_attrs, \ 310 + .sdev_attrs = ahci_sdev_attrs 311 + 302 312 extern struct ata_port_operations ahci_ops; 303 313 304 314 void ahci_save_initial_config(struct device *dev,
+5 -1
drivers/ata/ahci_platform.c
··· 23 23 #include <linux/ahci_platform.h> 24 24 #include "ahci.h" 25 25 26 + static struct scsi_host_template ahci_platform_sht = { 27 + AHCI_SHT("ahci_platform"), 28 + }; 29 + 26 30 static int __init ahci_probe(struct platform_device *pdev) 27 31 { 28 32 struct device *dev = &pdev->dev; ··· 149 145 ahci_print_info(host, "platform"); 150 146 151 147 rc = ata_host_activate(host, irq, ahci_interrupt, IRQF_SHARED, 152 - &ahci_sht); 148 + &ahci_platform_sht); 153 149 if (rc) 154 150 goto err0; 155 151
+4 -12
drivers/ata/libahci.c
··· 121 121 static DEVICE_ATTR(em_buffer, S_IWUSR | S_IRUGO, 122 122 ahci_read_em_buffer, ahci_store_em_buffer); 123 123 124 - static struct device_attribute *ahci_shost_attrs[] = { 124 + struct device_attribute *ahci_shost_attrs[] = { 125 125 &dev_attr_link_power_management_policy, 126 126 &dev_attr_em_message_type, 127 127 &dev_attr_em_message, ··· 132 132 &dev_attr_em_buffer, 133 133 NULL 134 134 }; 135 + EXPORT_SYMBOL_GPL(ahci_shost_attrs); 135 136 136 - static struct device_attribute *ahci_sdev_attrs[] = { 137 + struct device_attribute *ahci_sdev_attrs[] = { 137 138 &dev_attr_sw_activity, 138 139 &dev_attr_unload_heads, 139 140 NULL 140 141 }; 141 - 142 - struct scsi_host_template ahci_sht = { 143 - ATA_NCQ_SHT("ahci"), 144 - .can_queue = AHCI_MAX_CMDS - 1, 145 - .sg_tablesize = AHCI_MAX_SG, 146 - .dma_boundary = AHCI_DMA_BOUNDARY, 147 - .shost_attrs = ahci_shost_attrs, 148 - .sdev_attrs = ahci_sdev_attrs, 149 - }; 150 - EXPORT_SYMBOL_GPL(ahci_sht); 142 + EXPORT_SYMBOL_GPL(ahci_sdev_attrs); 151 143 152 144 struct ata_port_operations ahci_ops = { 153 145 .inherits = &sata_pmp_port_ops,
+1 -1
drivers/block/pktcdvd.c
··· 2369 2369 pkt_shrink_pktlist(pd); 2370 2370 } 2371 2371 2372 - static struct pktcdvd_device *pkt_find_dev_from_minor(int dev_minor) 2372 + static struct pktcdvd_device *pkt_find_dev_from_minor(unsigned int dev_minor) 2373 2373 { 2374 2374 if (dev_minor >= MAX_WRITERS) 2375 2375 return NULL;
+11 -6
drivers/char/ipmi/ipmi_si_intf.c
··· 305 305 #ifdef CONFIG_PCI 306 306 static int pci_registered; 307 307 #endif 308 + #ifdef CONFIG_ACPI 309 + static int pnp_registered; 310 + #endif 308 311 #ifdef CONFIG_PPC_OF 309 312 static int of_registered; 310 313 #endif ··· 2129 2126 { 2130 2127 struct acpi_device *acpi_dev; 2131 2128 struct smi_info *info; 2132 - struct resource *res; 2129 + struct resource *res, *res_second; 2133 2130 acpi_handle handle; 2134 2131 acpi_status status; 2135 2132 unsigned long long tmp; ··· 2185 2182 info->io.addr_data = res->start; 2186 2183 2187 2184 info->io.regspacing = DEFAULT_REGSPACING; 2188 - res = pnp_get_resource(dev, 2185 + res_second = pnp_get_resource(dev, 2189 2186 (info->io.addr_type == IPMI_IO_ADDR_SPACE) ? 2190 2187 IORESOURCE_IO : IORESOURCE_MEM, 2191 2188 1); 2192 - if (res) { 2193 - if (res->start > info->io.addr_data) 2194 - info->io.regspacing = res->start - info->io.addr_data; 2189 + if (res_second) { 2190 + if (res_second->start > info->io.addr_data) 2191 + info->io.regspacing = res_second->start - info->io.addr_data; 2195 2192 } 2196 2193 info->io.regsize = DEFAULT_REGSPACING; 2197 2194 info->io.regshift = 0; ··· 3362 3359 3363 3360 #ifdef CONFIG_ACPI 3364 3361 pnp_register_driver(&ipmi_pnp_driver); 3362 + pnp_registered = 1; 3365 3363 #endif 3366 3364 3367 3365 #ifdef CONFIG_DMI ··· 3530 3526 pci_unregister_driver(&ipmi_pci_driver); 3531 3527 #endif 3532 3528 #ifdef CONFIG_ACPI 3533 - pnp_unregister_driver(&ipmi_pnp_driver); 3529 + if (pnp_registered) 3530 + pnp_unregister_driver(&ipmi_pnp_driver); 3534 3531 #endif 3535 3532 3536 3533 #ifdef CONFIG_PPC_OF
+1 -1
drivers/cpuidle/governors/menu.c
··· 80 80 * Limiting Performance Impact 81 81 * --------------------------- 82 82 * C states, especially those with large exit latencies, can have a real 83 - * noticable impact on workloads, which is not acceptable for most sysadmins, 83 + * noticeable impact on workloads, which is not acceptable for most sysadmins, 84 84 * and in addition, less performance has a power price of its own. 85 85 * 86 86 * As a general rule of thumb, menu assumes that the following heuristic
+1 -1
drivers/dma/mv_xor.c
··· 162 162 163 163 static void mv_xor_device_clear_eoc_cause(struct mv_xor_chan *chan) 164 164 { 165 - u32 val = (1 << (1 + (chan->idx * 16))); 165 + u32 val = ~(1 << (chan->idx * 16)); 166 166 dev_dbg(chan->device->common.dev, "%s, val 0x%08x\n", __func__, val); 167 167 __raw_writel(val, XOR_INTR_CAUSE(chan)); 168 168 }
+2 -1
drivers/dma/shdma.c
··· 580 580 581 581 sh_chan = to_sh_chan(chan); 582 582 param = chan->private; 583 - slave_addr = param->config->addr; 584 583 585 584 /* Someone calling slave DMA on a public channel? */ 586 585 if (!param || !sg_len) { ··· 587 588 __func__, param, sg_len, param ? param->slave_id : -1); 588 589 return NULL; 589 590 } 591 + 592 + slave_addr = param->config->addr; 590 593 591 594 /* 592 595 * if (param != NULL), this is a successfully requested slave channel,
+3
drivers/edac/edac_mc.c
··· 339 339 { 340 340 int status; 341 341 342 + if (mci->op_state != OP_RUNNING_POLL) 343 + return; 344 + 342 345 status = cancel_delayed_work(&mci->work); 343 346 if (status == 0) { 344 347 debugf0("%s() not canceled, flush the queue\n",
+1
drivers/edac/i7core_edac.c
··· 1140 1140 ATTR_COUNTER(0), 1141 1141 ATTR_COUNTER(1), 1142 1142 ATTR_COUNTER(2), 1143 + { .attr = { .name = NULL } } 1143 1144 }; 1144 1145 1145 1146 static struct mcidev_sysfs_group i7core_udimm_counters = {
+3 -3
drivers/gpu/drm/drm_buffer.c
··· 98 98 * user_data: A pointer the data that is copied to the buffer. 99 99 * size: The Number of bytes to copy. 100 100 */ 101 - extern int drm_buffer_copy_from_user(struct drm_buffer *buf, 102 - void __user *user_data, int size) 101 + int drm_buffer_copy_from_user(struct drm_buffer *buf, 102 + void __user *user_data, int size) 103 103 { 104 104 int nr_pages = size / PAGE_SIZE + 1; 105 105 int idx; ··· 163 163 { 164 164 int idx = drm_buffer_index(buf); 165 165 int page = drm_buffer_page(buf); 166 - void *obj = 0; 166 + void *obj = NULL; 167 167 168 168 if (idx + objsize <= PAGE_SIZE) { 169 169 obj = &buf->data[page][idx];
+10 -29
drivers/gpu/drm/drm_gem.c
··· 148 148 return -ENOMEM; 149 149 150 150 kref_init(&obj->refcount); 151 - kref_init(&obj->handlecount); 151 + atomic_set(&obj->handle_count, 0); 152 152 obj->size = size; 153 153 154 154 atomic_inc(&dev->object_count); ··· 462 462 } 463 463 EXPORT_SYMBOL(drm_gem_object_free); 464 464 465 - /** 466 - * Called after the last reference to the object has been lost. 467 - * Must be called without holding struct_mutex 468 - * 469 - * Frees the object 470 - */ 471 - void 472 - drm_gem_object_free_unlocked(struct kref *kref) 473 - { 474 - struct drm_gem_object *obj = (struct drm_gem_object *) kref; 475 - struct drm_device *dev = obj->dev; 476 - 477 - if (dev->driver->gem_free_object_unlocked != NULL) 478 - dev->driver->gem_free_object_unlocked(obj); 479 - else if (dev->driver->gem_free_object != NULL) { 480 - mutex_lock(&dev->struct_mutex); 481 - dev->driver->gem_free_object(obj); 482 - mutex_unlock(&dev->struct_mutex); 483 - } 484 - } 485 - EXPORT_SYMBOL(drm_gem_object_free_unlocked); 486 - 487 465 static void drm_gem_object_ref_bug(struct kref *list_kref) 488 466 { 489 467 BUG(); ··· 474 496 * called before drm_gem_object_free or we'll be touching 475 497 * freed memory 476 498 */ 477 - void 478 - drm_gem_object_handle_free(struct kref *kref) 499 + void drm_gem_object_handle_free(struct drm_gem_object *obj) 479 500 { 480 - struct drm_gem_object *obj = container_of(kref, 481 - struct drm_gem_object, 482 - handlecount); 483 501 struct drm_device *dev = obj->dev; 484 502 485 503 /* Remove any name for this object */ ··· 502 528 struct drm_gem_object *obj = vma->vm_private_data; 503 529 504 530 drm_gem_object_reference(obj); 531 + 532 + mutex_lock(&obj->dev->struct_mutex); 533 + drm_vm_open_locked(vma); 534 + mutex_unlock(&obj->dev->struct_mutex); 505 535 } 506 536 EXPORT_SYMBOL(drm_gem_vm_open); 507 537 ··· 513 535 { 514 536 struct drm_gem_object *obj = vma->vm_private_data; 515 537 516 - drm_gem_object_unreference_unlocked(obj); 538 + mutex_lock(&obj->dev->struct_mutex); 539 + drm_vm_close_locked(vma); 540 + drm_gem_object_unreference(obj); 541 + mutex_unlock(&obj->dev->struct_mutex); 517 542 } 518 543 EXPORT_SYMBOL(drm_gem_vm_close); 519 544
+1 -1
drivers/gpu/drm/drm_info.c
··· 255 255 256 256 seq_printf(m, "%6d %8zd %7d %8d\n", 257 257 obj->name, obj->size, 258 - atomic_read(&obj->handlecount.refcount), 258 + atomic_read(&obj->handle_count), 259 259 atomic_read(&obj->refcount.refcount)); 260 260 return 0; 261 261 }
+20 -12
drivers/gpu/drm/drm_vm.c
··· 433 433 mutex_unlock(&dev->struct_mutex); 434 434 } 435 435 436 + void drm_vm_close_locked(struct vm_area_struct *vma) 437 + { 438 + struct drm_file *priv = vma->vm_file->private_data; 439 + struct drm_device *dev = priv->minor->dev; 440 + struct drm_vma_entry *pt, *temp; 441 + 442 + DRM_DEBUG("0x%08lx,0x%08lx\n", 443 + vma->vm_start, vma->vm_end - vma->vm_start); 444 + atomic_dec(&dev->vma_count); 445 + 446 + list_for_each_entry_safe(pt, temp, &dev->vmalist, head) { 447 + if (pt->vma == vma) { 448 + list_del(&pt->head); 449 + kfree(pt); 450 + break; 451 + } 452 + } 453 + } 454 + 436 455 /** 437 456 * \c close method for all virtual memory types. 438 457 * ··· 464 445 { 465 446 struct drm_file *priv = vma->vm_file->private_data; 466 447 struct drm_device *dev = priv->minor->dev; 467 - struct drm_vma_entry *pt, *temp; 468 - 469 - DRM_DEBUG("0x%08lx,0x%08lx\n", 470 - vma->vm_start, vma->vm_end - vma->vm_start); 471 - atomic_dec(&dev->vma_count); 472 448 473 449 mutex_lock(&dev->struct_mutex); 474 - list_for_each_entry_safe(pt, temp, &dev->vmalist, head) { 475 - if (pt->vma == vma) { 476 - list_del(&pt->head); 477 - kfree(pt); 478 - break; 479 - } 480 - } 450 + drm_vm_close_locked(vma); 481 451 mutex_unlock(&dev->struct_mutex); 482 452 } 483 453
+1 -1
drivers/gpu/drm/i810/i810_dma.c
··· 116 116 static const struct file_operations i810_buffer_fops = { 117 117 .open = drm_open, 118 118 .release = drm_release, 119 - .unlocked_ioctl = drm_ioctl, 119 + .unlocked_ioctl = i810_ioctl, 120 120 .mmap = i810_mmap_buffers, 121 121 .fasync = drm_fasync, 122 122 };
+1 -1
drivers/gpu/drm/i830/i830_dma.c
··· 118 118 static const struct file_operations i830_buffer_fops = { 119 119 .open = drm_open, 120 120 .release = drm_release, 121 - .unlocked_ioctl = drm_ioctl, 121 + .unlocked_ioctl = i830_ioctl, 122 122 .mmap = i830_mmap_buffers, 123 123 .fasync = drm_fasync, 124 124 };
+3 -3
drivers/gpu/drm/i915/i915_dma.c
··· 1787 1787 } 1788 1788 } 1789 1789 1790 - div_u64(diff, diff1); 1790 + diff = div_u64(diff, diff1); 1791 1791 ret = ((m * diff) + c); 1792 - div_u64(ret, 10); 1792 + ret = div_u64(ret, 10); 1793 1793 1794 1794 dev_priv->last_count1 = total_count; 1795 1795 dev_priv->last_time1 = now; ··· 1858 1858 1859 1859 /* More magic constants... */ 1860 1860 diff = diff * 1181; 1861 - div_u64(diff, diffms * 10); 1861 + diff = div_u64(diff, diffms * 10); 1862 1862 dev_priv->gfx_power = diff; 1863 1863 } 1864 1864
+29 -25
drivers/gpu/drm/i915/i915_gem.c
··· 136 136 return -ENOMEM; 137 137 138 138 ret = drm_gem_handle_create(file_priv, obj, &handle); 139 + /* drop reference from allocate - handle holds it now */ 140 + drm_gem_object_unreference_unlocked(obj); 139 141 if (ret) { 140 - drm_gem_object_unreference_unlocked(obj); 141 142 return ret; 142 143 } 143 - 144 - /* Sink the floating reference from kref_init(handlecount) */ 145 - drm_gem_object_handle_unreference_unlocked(obj); 146 144 147 145 args->handle = handle; 148 146 return 0; ··· 469 471 return -ENOENT; 470 472 obj_priv = to_intel_bo(obj); 471 473 472 - /* Bounds check source. 473 - * 474 - * XXX: This could use review for overflow issues... 475 - */ 476 - if (args->offset > obj->size || args->size > obj->size || 477 - args->offset + args->size > obj->size) { 478 - drm_gem_object_unreference_unlocked(obj); 479 - return -EINVAL; 474 + /* Bounds check source. */ 475 + if (args->offset > obj->size || args->size > obj->size - args->offset) { 476 + ret = -EINVAL; 477 + goto err; 478 + } 479 + 480 + if (!access_ok(VERIFY_WRITE, 481 + (char __user *)(uintptr_t)args->data_ptr, 482 + args->size)) { 483 + ret = -EFAULT; 484 + goto err; 480 485 } 481 486 482 487 if (i915_gem_object_needs_bit17_swizzle(obj)) { ··· 491 490 file_priv); 492 491 } 493 492 493 + err: 494 494 drm_gem_object_unreference_unlocked(obj); 495 - 496 495 return ret; 497 496 } 498 497 ··· 581 580 582 581 user_data = (char __user *) (uintptr_t) args->data_ptr; 583 582 remain = args->size; 584 - if (!access_ok(VERIFY_READ, user_data, remain)) 585 - return -EFAULT; 586 583 587 584 588 585 mutex_lock(&dev->struct_mutex); ··· 933 934 return -ENOENT; 934 935 obj_priv = to_intel_bo(obj); 935 936 936 - /* Bounds check destination. 937 - * 938 - * XXX: This could use review for overflow issues... 939 - */ 940 - if (args->offset > obj->size || args->size > obj->size || 941 - args->offset + args->size > obj->size) { 942 - drm_gem_object_unreference_unlocked(obj); 943 - return -EINVAL; 937 + /* Bounds check destination. */ 938 + if (args->offset > obj->size || args->size > obj->size - args->offset) { 939 + ret = -EINVAL; 940 + goto err; 941 + } 942 + 943 + if (!access_ok(VERIFY_READ, 944 + (char __user *)(uintptr_t)args->data_ptr, 945 + args->size)) { 946 + ret = -EFAULT; 947 + goto err; 944 948 } 945 949 946 950 /* We can only do the GTT pwrite on untiled buffers, as otherwise ··· 977 975 DRM_INFO("pwrite failed %d\n", ret); 978 976 #endif 979 977 978 + err: 980 979 drm_gem_object_unreference_unlocked(obj); 981 - 982 980 return ret; 983 981 } 984 982 ··· 2402 2400 I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0); 2403 2401 break; 2404 2402 case 3: 2405 - if (obj_priv->fence_reg > 8) 2403 + if (obj_priv->fence_reg >= 8) 2406 2404 fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - 8) * 4; 2407 2405 else 2408 2406 case 2: ··· 3260 3258 (int) reloc->offset, 3261 3259 reloc->read_domains, 3262 3260 reloc->write_domain); 3261 + drm_gem_object_unreference(target_obj); 3262 + i915_gem_object_unpin(obj); 3263 3263 return -EINVAL; 3264 3264 } 3265 3265 if (reloc->write_domain & I915_GEM_DOMAIN_CPU ||
+22 -27
drivers/gpu/drm/i915/i915_gem_evict.c
··· 93 93 { 94 94 drm_i915_private_t *dev_priv = dev->dev_private; 95 95 struct list_head eviction_list, unwind_list; 96 - struct drm_i915_gem_object *obj_priv, *tmp_obj_priv; 96 + struct drm_i915_gem_object *obj_priv; 97 97 struct list_head *render_iter, *bsd_iter; 98 98 int ret = 0; 99 99 ··· 175 175 return -ENOSPC; 176 176 177 177 found: 178 + /* drm_mm doesn't allow any other other operations while 179 + * scanning, therefore store to be evicted objects on a 180 + * temporary list. */ 178 181 INIT_LIST_HEAD(&eviction_list); 179 - list_for_each_entry_safe(obj_priv, tmp_obj_priv, 180 - &unwind_list, evict_list) { 182 + while (!list_empty(&unwind_list)) { 183 + obj_priv = list_first_entry(&unwind_list, 184 + struct drm_i915_gem_object, 185 + evict_list); 181 186 if (drm_mm_scan_remove_block(obj_priv->gtt_space)) { 182 - /* drm_mm doesn't allow any other other operations while 183 - * scanning, therefore store to be evicted objects on a 184 - * temporary list. */ 185 187 list_move(&obj_priv->evict_list, &eviction_list); 186 - } else 187 - drm_gem_object_unreference(&obj_priv->base); 188 - } 189 - 190 - /* Unbinding will emit any required flushes */ 191 - list_for_each_entry_safe(obj_priv, tmp_obj_priv, 192 - &eviction_list, evict_list) { 193 - #if WATCH_LRU 194 - DRM_INFO("%s: evicting %p\n", __func__, &obj_priv->base); 195 - #endif 196 - ret = i915_gem_object_unbind(&obj_priv->base); 197 - if (ret) 198 - return ret; 199 - 188 + continue; 189 + } 190 + list_del(&obj_priv->evict_list); 200 191 drm_gem_object_unreference(&obj_priv->base); 201 192 } 202 193 203 - /* The just created free hole should be on the top of the free stack 204 - * maintained by drm_mm, so this BUG_ON actually executes in O(1). 205 - * Furthermore all accessed data has just recently been used, so it 206 - * should be really fast, too. */ 207 - BUG_ON(!drm_mm_search_free(&dev_priv->mm.gtt_space, min_size, 208 - alignment, 0)); 194 + /* Unbinding will emit any required flushes */ 195 + while (!list_empty(&eviction_list)) { 196 + obj_priv = list_first_entry(&eviction_list, 197 + struct drm_i915_gem_object, 198 + evict_list); 199 + if (ret == 0) 200 + ret = i915_gem_object_unbind(&obj_priv->base); 201 + list_del(&obj_priv->evict_list); 202 + drm_gem_object_unreference(&obj_priv->base); 203 + } 209 204 210 - return 0; 205 + return ret; 211 206 } 212 207 213 208 int
+36 -22
drivers/gpu/drm/i915/intel_display.c
··· 1013 1013 DRM_DEBUG_KMS("vblank wait timed out\n"); 1014 1014 } 1015 1015 1016 - /** 1017 - * intel_wait_for_vblank_off - wait for vblank after disabling a pipe 1016 + /* 1017 + * intel_wait_for_pipe_off - wait for pipe to turn off 1018 1018 * @dev: drm device 1019 1019 * @pipe: pipe to wait for 1020 1020 * ··· 1022 1022 * spinning on the vblank interrupt status bit, since we won't actually 1023 1023 * see an interrupt when the pipe is disabled. 1024 1024 * 1025 - * So this function waits for the display line value to settle (it 1026 - * usually ends up stopping at the start of the next frame). 1025 + * On Gen4 and above: 1026 + * wait for the pipe register state bit to turn off 1027 + * 1028 + * Otherwise: 1029 + * wait for the display line value to settle (it usually 1030 + * ends up stopping at the start of the next frame). 1031 + * 1027 1032 */ 1028 - void intel_wait_for_vblank_off(struct drm_device *dev, int pipe) 1033 + static void intel_wait_for_pipe_off(struct drm_device *dev, int pipe) 1029 1034 { 1030 1035 struct drm_i915_private *dev_priv = dev->dev_private; 1031 - int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL); 1032 - unsigned long timeout = jiffies + msecs_to_jiffies(100); 1033 - u32 last_line; 1034 1036 1035 - /* Wait for the display line to settle */ 1036 - do { 1037 - last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK; 1038 - mdelay(5); 1039 - } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) && 1040 - time_after(timeout, jiffies)); 1037 + if (INTEL_INFO(dev)->gen >= 4) { 1038 + int pipeconf_reg = (pipe == 0 ? PIPEACONF : PIPEBCONF); 1041 1039 1042 - if (time_after(jiffies, timeout)) 1043 - DRM_DEBUG_KMS("vblank wait timed out\n"); 1040 + /* Wait for the Pipe State to go off */ 1041 + if (wait_for((I915_READ(pipeconf_reg) & I965_PIPECONF_ACTIVE) == 0, 1042 + 100, 0)) 1043 + DRM_DEBUG_KMS("pipe_off wait timed out\n"); 1044 + } else { 1045 + u32 last_line; 1046 + int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL); 1047 + unsigned long timeout = jiffies + msecs_to_jiffies(100); 1048 + 1049 + /* Wait for the display line to settle */ 1050 + do { 1051 + last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK; 1052 + mdelay(5); 1053 + } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) && 1054 + time_after(timeout, jiffies)); 1055 + if (time_after(jiffies, timeout)) 1056 + DRM_DEBUG_KMS("pipe_off wait timed out\n"); 1057 + } 1044 1058 } 1045 1059 1046 1060 /* Parameters have changed, update FBC info */ ··· 2342 2328 I915_READ(dspbase_reg); 2343 2329 } 2344 2330 2345 - /* Wait for vblank for the disable to take effect */ 2346 - intel_wait_for_vblank_off(dev, pipe); 2347 - 2348 2331 /* Don't disable pipe A or pipe A PLLs if needed */ 2349 2332 if (pipeconf_reg == PIPEACONF && 2350 - (dev_priv->quirks & QUIRK_PIPEA_FORCE)) 2333 + (dev_priv->quirks & QUIRK_PIPEA_FORCE)) { 2334 + /* Wait for vblank for the disable to take effect */ 2335 + intel_wait_for_vblank(dev, pipe); 2351 2336 goto skip_pipe_off; 2337 + } 2352 2338 2353 2339 /* Next, disable display pipes */ 2354 2340 temp = I915_READ(pipeconf_reg); ··· 2357 2343 I915_READ(pipeconf_reg); 2358 2344 } 2359 2345 2360 - /* Wait for vblank for the disable to take effect. */ 2361 - intel_wait_for_vblank_off(dev, pipe); 2346 + /* Wait for the pipe to turn off */ 2347 + intel_wait_for_pipe_off(dev, pipe); 2362 2348 2363 2349 temp = I915_READ(dpll_reg); 2364 2350 if ((temp & DPLL_VCO_ENABLE) != 0) {
+9 -10
drivers/gpu/drm/i915/intel_dp.c
··· 1138 1138 intel_dp_set_link_train(struct intel_dp *intel_dp, 1139 1139 uint32_t dp_reg_value, 1140 1140 uint8_t dp_train_pat, 1141 - uint8_t train_set[4], 1142 - bool first) 1141 + uint8_t train_set[4]) 1143 1142 { 1144 1143 struct drm_device *dev = intel_dp->base.enc.dev; 1145 1144 struct drm_i915_private *dev_priv = dev->dev_private; 1146 - struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc); 1147 1145 int ret; 1148 1146 1149 1147 I915_WRITE(intel_dp->output_reg, dp_reg_value); 1150 1148 POSTING_READ(intel_dp->output_reg); 1151 - if (first) 1152 - intel_wait_for_vblank(dev, intel_crtc->pipe); 1153 1149 1154 1150 intel_dp_aux_native_write_1(intel_dp, 1155 1151 DP_TRAINING_PATTERN_SET, ··· 1170 1174 uint8_t voltage; 1171 1175 bool clock_recovery = false; 1172 1176 bool channel_eq = false; 1173 - bool first = true; 1174 1177 int tries; 1175 1178 u32 reg; 1176 1179 uint32_t DP = intel_dp->DP; 1180 + struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc); 1181 + 1182 + /* Enable output, wait for it to become active */ 1183 + I915_WRITE(intel_dp->output_reg, intel_dp->DP); 1184 + POSTING_READ(intel_dp->output_reg); 1185 + intel_wait_for_vblank(dev, intel_crtc->pipe); 1177 1186 1178 1187 /* Write the link configuration data */ 1179 1188 intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, ··· 1211 1210 reg = DP | DP_LINK_TRAIN_PAT_1; 1212 1211 1213 1212 if (!intel_dp_set_link_train(intel_dp, reg, 1214 - DP_TRAINING_PATTERN_1, train_set, first)) 1213 + DP_TRAINING_PATTERN_1, train_set)) 1215 1214 break; 1216 - first = false; 1217 1215 /* Set training pattern 1 */ 1218 1216 1219 1217 udelay(100); ··· 1266 1266 1267 1267 /* channel eq pattern */ 1268 1268 if (!intel_dp_set_link_train(intel_dp, reg, 1269 - DP_TRAINING_PATTERN_2, train_set, 1270 - false)) 1269 + DP_TRAINING_PATTERN_2, train_set)) 1271 1270 break; 1272 1271 1273 1272 udelay(400);
-1
drivers/gpu/drm/i915/intel_drv.h
··· 229 229 struct drm_crtc *crtc); 230 230 int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, 231 231 struct drm_file *file_priv); 232 - extern void intel_wait_for_vblank_off(struct drm_device *dev, int pipe); 233 232 extern void intel_wait_for_vblank(struct drm_device *dev, int pipe); 234 233 extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe); 235 234 extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder,
+3 -1
drivers/gpu/drm/i915/intel_fb.c
··· 237 237 drm_fb_helper_fini(&ifbdev->helper); 238 238 239 239 drm_framebuffer_cleanup(&ifb->base); 240 - if (ifb->obj) 240 + if (ifb->obj) { 241 + drm_gem_object_handle_unreference(ifb->obj); 241 242 drm_gem_object_unreference(ifb->obj); 243 + } 242 244 243 245 return 0; 244 246 }
+6 -9
drivers/gpu/drm/i915/intel_sdvo.c
··· 2170 2170 return true; 2171 2171 2172 2172 err: 2173 - intel_sdvo_destroy_enhance_property(connector); 2174 - kfree(intel_sdvo_connector); 2173 + intel_sdvo_destroy(connector); 2175 2174 return false; 2176 2175 } 2177 2176 ··· 2242 2243 return true; 2243 2244 2244 2245 err: 2245 - intel_sdvo_destroy_enhance_property(connector); 2246 - kfree(intel_sdvo_connector); 2246 + intel_sdvo_destroy(connector); 2247 2247 return false; 2248 2248 } 2249 2249 ··· 2520 2522 uint16_t response; 2521 2523 } enhancements; 2522 2524 2523 - if (!intel_sdvo_get_value(intel_sdvo, 2524 - SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS, 2525 - &enhancements, sizeof(enhancements))) 2526 - return false; 2527 - 2525 + enhancements.response = 0; 2526 + intel_sdvo_get_value(intel_sdvo, 2527 + SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS, 2528 + &enhancements, sizeof(enhancements)); 2528 2529 if (enhancements.response == 0) { 2529 2530 DRM_DEBUG_KMS("No enhancement is supported\n"); 2530 2531 return true;
+4 -2
drivers/gpu/drm/nouveau/nouveau_connector.c
··· 558 558 if (nv_encoder->dcb->type == OUTPUT_LVDS && 559 559 (nv_encoder->dcb->lvdsconf.use_straps_for_mode || 560 560 dev_priv->vbios.fp_no_ddc) && nouveau_bios_fp_mode(dev, NULL)) { 561 - nv_connector->native_mode = drm_mode_create(dev); 562 - nouveau_bios_fp_mode(dev, nv_connector->native_mode); 561 + struct drm_display_mode mode; 562 + 563 + nouveau_bios_fp_mode(dev, &mode); 564 + nv_connector->native_mode = drm_mode_duplicate(dev, &mode); 563 565 } 564 566 565 567 /* Find the native mode if this is a digital panel, if we didn't
+1
drivers/gpu/drm/nouveau/nouveau_fbcon.c
··· 352 352 353 353 if (nouveau_fb->nvbo) { 354 354 nouveau_bo_unmap(nouveau_fb->nvbo); 355 + drm_gem_object_handle_unreference_unlocked(nouveau_fb->nvbo->gem); 355 356 drm_gem_object_unreference_unlocked(nouveau_fb->nvbo->gem); 356 357 nouveau_fb->nvbo = NULL; 357 358 }
+2 -4
drivers/gpu/drm/nouveau/nouveau_gem.c
··· 167 167 goto out; 168 168 169 169 ret = drm_gem_handle_create(file_priv, nvbo->gem, &req->info.handle); 170 + /* drop reference from allocate - handle holds it now */ 171 + drm_gem_object_unreference_unlocked(nvbo->gem); 170 172 out: 171 - drm_gem_object_handle_unreference_unlocked(nvbo->gem); 172 - 173 - if (ret) 174 - drm_gem_object_unreference_unlocked(nvbo->gem); 175 173 return ret; 176 174 } 177 175
+1
drivers/gpu/drm/nouveau/nouveau_notifier.c
··· 79 79 mutex_lock(&dev->struct_mutex); 80 80 nouveau_bo_unpin(chan->notifier_bo); 81 81 mutex_unlock(&dev->struct_mutex); 82 + drm_gem_object_handle_unreference_unlocked(chan->notifier_bo->gem); 82 83 drm_gem_object_unreference_unlocked(chan->notifier_bo->gem); 83 84 drm_mm_takedown(&chan->notifier_heap); 84 85 }
+1 -1
drivers/gpu/drm/radeon/atombios.h
··· 4999 4999 #define SW_I2C_CNTL_WRITE1BIT 6 5000 5000 5001 5001 //==============================VESA definition Portion=============================== 5002 - #define VESA_OEM_PRODUCT_REV '01.00' 5002 + #define VESA_OEM_PRODUCT_REV "01.00" 5003 5003 #define VESA_MODE_ATTRIBUTE_MODE_SUPPORT 0xBB //refer to VBE spec p.32, no TTY support 5004 5004 #define VESA_MODE_WIN_ATTRIBUTE 7 5005 5005 #define VESA_WIN_SIZE 64
+3 -2
drivers/gpu/drm/radeon/r600.c
··· 2729 2729 if (i < rdev->usec_timeout) { 2730 2730 DRM_INFO("ib test succeeded in %u usecs\n", i); 2731 2731 } else { 2732 - DRM_ERROR("radeon: ib test failed (sracth(0x%04X)=0x%08X)\n", 2732 + DRM_ERROR("radeon: ib test failed (scratch(0x%04X)=0x%08X)\n", 2733 2733 scratch, tmp); 2734 2734 r = -EINVAL; 2735 2735 } ··· 3528 3528 /* r7xx hw bug. write to HDP_DEBUG1 followed by fb read 3529 3529 * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL 3530 3530 */ 3531 - if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740)) { 3531 + if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740) && 3532 + rdev->vram_scratch.ptr) { 3532 3533 void __iomem *ptr = (void *)rdev->vram_scratch.ptr; 3533 3534 u32 tmp; 3534 3535
+9
drivers/gpu/drm/radeon/radeon_atombios.c
··· 317 317 *connector_type = DRM_MODE_CONNECTOR_DVID; 318 318 } 319 319 320 + /* MSI K9A2GM V2/V3 board has no HDMI or DVI */ 321 + if ((dev->pdev->device == 0x796e) && 322 + (dev->pdev->subsystem_vendor == 0x1462) && 323 + (dev->pdev->subsystem_device == 0x7302)) { 324 + if ((supported_device == ATOM_DEVICE_DFP2_SUPPORT) || 325 + (supported_device == ATOM_DEVICE_DFP3_SUPPORT)) 326 + return false; 327 + } 328 + 320 329 /* a-bit f-i90hd - ciaranm on #radeonhd - this board has no DVI */ 321 330 if ((dev->pdev->device == 0x7941) && 322 331 (dev->pdev->subsystem_vendor == 0x147b) &&
+4 -1
drivers/gpu/drm/radeon/radeon_display.c
··· 349 349 DRM_INFO(" DFP4: %s\n", encoder_names[radeon_encoder->encoder_id]); 350 350 if (devices & ATOM_DEVICE_DFP5_SUPPORT) 351 351 DRM_INFO(" DFP5: %s\n", encoder_names[radeon_encoder->encoder_id]); 352 + if (devices & ATOM_DEVICE_DFP6_SUPPORT) 353 + DRM_INFO(" DFP6: %s\n", encoder_names[radeon_encoder->encoder_id]); 352 354 if (devices & ATOM_DEVICE_TV1_SUPPORT) 353 355 DRM_INFO(" TV1: %s\n", encoder_names[radeon_encoder->encoder_id]); 354 356 if (devices & ATOM_DEVICE_CV_SUPPORT) ··· 843 841 { 844 842 struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb); 845 843 846 - if (radeon_fb->obj) 844 + if (radeon_fb->obj) { 847 845 drm_gem_object_unreference_unlocked(radeon_fb->obj); 846 + } 848 847 drm_framebuffer_cleanup(fb); 849 848 kfree(radeon_fb); 850 849 }
+4 -10
drivers/gpu/drm/radeon/radeon_fb.c
··· 94 94 ret = radeon_bo_reserve(rbo, false); 95 95 if (likely(ret == 0)) { 96 96 radeon_bo_kunmap(rbo); 97 + radeon_bo_unpin(rbo); 97 98 radeon_bo_unreserve(rbo); 98 99 } 100 + drm_gem_object_handle_unreference(gobj); 99 101 drm_gem_object_unreference_unlocked(gobj); 100 102 } 101 103 ··· 327 325 { 328 326 struct fb_info *info; 329 327 struct radeon_framebuffer *rfb = &rfbdev->rfb; 330 - struct radeon_bo *rbo; 331 - int r; 332 328 333 329 if (rfbdev->helper.fbdev) { 334 330 info = rfbdev->helper.fbdev; ··· 338 338 } 339 339 340 340 if (rfb->obj) { 341 - rbo = rfb->obj->driver_private; 342 - r = radeon_bo_reserve(rbo, false); 343 - if (likely(r == 0)) { 344 - radeon_bo_kunmap(rbo); 345 - radeon_bo_unpin(rbo); 346 - radeon_bo_unreserve(rbo); 347 - } 348 - drm_gem_object_unreference_unlocked(rfb->obj); 341 + radeonfb_destroy_pinned_object(rfb->obj); 342 + rfb->obj = NULL; 349 343 } 350 344 drm_fb_helper_fini(&rfbdev->helper); 351 345 drm_framebuffer_cleanup(&rfb->base);
+2 -2
drivers/gpu/drm/radeon/radeon_gem.c
··· 201 201 return r; 202 202 } 203 203 r = drm_gem_handle_create(filp, gobj, &handle); 204 + /* drop reference from allocate - handle holds it now */ 205 + drm_gem_object_unreference_unlocked(gobj); 204 206 if (r) { 205 - drm_gem_object_unreference_unlocked(gobj); 206 207 return r; 207 208 } 208 - drm_gem_object_handle_unreference_unlocked(gobj); 209 209 args->handle = handle; 210 210 return 0; 211 211 }
+4
drivers/gpu/drm/radeon/radeon_kms.c
··· 203 203 */ 204 204 int radeon_driver_firstopen_kms(struct drm_device *dev) 205 205 { 206 + struct radeon_device *rdev = dev->dev_private; 207 + 208 + if (rdev->powered_down) 209 + return -EINVAL; 206 210 return 0; 207 211 } 208 212
+1
drivers/gpu/drm/ttm/ttm_bo_util.c
··· 351 351 INIT_LIST_HEAD(&fbo->lru); 352 352 INIT_LIST_HEAD(&fbo->swap); 353 353 fbo->vm_node = NULL; 354 + atomic_set(&fbo->cpu_writers, 0); 354 355 355 356 fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj); 356 357 kref_init(&fbo->list_kref);
+4 -4
drivers/gpu/drm/ttm/ttm_page_alloc.c
··· 69 69 spinlock_t lock; 70 70 bool fill_lock; 71 71 struct list_head list; 72 - int gfp_flags; 72 + gfp_t gfp_flags; 73 73 unsigned npages; 74 74 char *name; 75 75 unsigned long nfrees; ··· 475 475 * This function is reentrant if caller updates count depending on number of 476 476 * pages returned in pages array. 477 477 */ 478 - static int ttm_alloc_new_pages(struct list_head *pages, int gfp_flags, 478 + static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags, 479 479 int ttm_flags, enum ttm_caching_state cstate, unsigned count) 480 480 { 481 481 struct page **caching_array; ··· 666 666 { 667 667 struct ttm_page_pool *pool = ttm_get_pool(flags, cstate); 668 668 struct page *p = NULL; 669 - int gfp_flags = GFP_USER; 669 + gfp_t gfp_flags = GFP_USER; 670 670 int r; 671 671 672 672 /* set zero flag for page allocation if required */ ··· 818 818 return 0; 819 819 } 820 820 821 - void ttm_page_alloc_fini() 821 + void ttm_page_alloc_fini(void) 822 822 { 823 823 int i; 824 824
+110 -35
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
··· 148 148 {0, 0, 0} 149 149 }; 150 150 151 - static char *vmw_devname = "vmwgfx"; 151 + static int enable_fbdev; 152 152 153 153 static int vmw_probe(struct pci_dev *, const struct pci_device_id *); 154 154 static void vmw_master_init(struct vmw_master *); 155 155 static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val, 156 156 void *ptr); 157 + 158 + MODULE_PARM_DESC(enable_fbdev, "Enable vmwgfx fbdev"); 159 + module_param_named(enable_fbdev, enable_fbdev, int, 0600); 157 160 158 161 static void vmw_print_capabilities(uint32_t capabilities) 159 162 { ··· 195 192 { 196 193 int ret; 197 194 198 - vmw_kms_save_vga(dev_priv); 199 - 200 195 ret = vmw_fifo_init(dev_priv, &dev_priv->fifo); 201 196 if (unlikely(ret != 0)) { 202 197 DRM_ERROR("Unable to initialize FIFO.\n"); ··· 207 206 static void vmw_release_device(struct vmw_private *dev_priv) 208 207 { 209 208 vmw_fifo_release(dev_priv, &dev_priv->fifo); 210 - vmw_kms_restore_vga(dev_priv); 211 209 } 212 210 211 + int vmw_3d_resource_inc(struct vmw_private *dev_priv) 212 + { 213 + int ret = 0; 214 + 215 + mutex_lock(&dev_priv->release_mutex); 216 + if (unlikely(dev_priv->num_3d_resources++ == 0)) { 217 + ret = vmw_request_device(dev_priv); 218 + if (unlikely(ret != 0)) 219 + --dev_priv->num_3d_resources; 220 + } 221 + mutex_unlock(&dev_priv->release_mutex); 222 + return ret; 223 + } 224 + 225 + 226 + void vmw_3d_resource_dec(struct vmw_private *dev_priv) 227 + { 228 + int32_t n3d; 229 + 230 + mutex_lock(&dev_priv->release_mutex); 231 + if (unlikely(--dev_priv->num_3d_resources == 0)) 232 + vmw_release_device(dev_priv); 233 + n3d = (int32_t) dev_priv->num_3d_resources; 234 + mutex_unlock(&dev_priv->release_mutex); 235 + 236 + BUG_ON(n3d < 0); 237 + } 213 238 214 239 static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) 215 240 { ··· 255 228 dev_priv->last_read_sequence = (uint32_t) -100; 256 229 mutex_init(&dev_priv->hw_mutex); 257 230 mutex_init(&dev_priv->cmdbuf_mutex); 231 + mutex_init(&dev_priv->release_mutex); 258 232 rwlock_init(&dev_priv->resource_lock); 259 233 idr_init(&dev_priv->context_idr); 260 234 idr_init(&dev_priv->surface_idr); ··· 271 243 dev_priv->io_start = pci_resource_start(dev->pdev, 0); 272 244 dev_priv->vram_start = pci_resource_start(dev->pdev, 1); 273 245 dev_priv->mmio_start = pci_resource_start(dev->pdev, 2); 246 + 247 + dev_priv->enable_fb = enable_fbdev; 274 248 275 249 mutex_lock(&dev_priv->hw_mutex); 276 250 ··· 373 343 374 344 dev->dev_private = dev_priv; 375 345 376 - if (!dev->devname) 377 - dev->devname = vmw_devname; 378 - 379 - if (dev_priv->capabilities & SVGA_CAP_IRQMASK) { 380 - ret = drm_irq_install(dev); 381 - if (unlikely(ret != 0)) { 382 - DRM_ERROR("Failed installing irq: %d\n", ret); 383 - goto out_no_irq; 384 - } 385 - } 386 - 387 346 ret = pci_request_regions(dev->pdev, "vmwgfx probe"); 388 347 dev_priv->stealth = (ret != 0); 389 348 if (dev_priv->stealth) { ··· 388 369 goto out_no_device; 389 370 } 390 371 } 391 - ret = vmw_request_device(dev_priv); 372 + ret = vmw_kms_init(dev_priv); 392 373 if (unlikely(ret != 0)) 393 - goto out_no_device; 394 - vmw_kms_init(dev_priv); 374 + goto out_no_kms; 395 375 vmw_overlay_init(dev_priv); 396 - vmw_fb_init(dev_priv); 376 + if (dev_priv->enable_fb) { 377 + ret = vmw_3d_resource_inc(dev_priv); 378 + if (unlikely(ret != 0)) 379 + goto out_no_fifo; 380 + vmw_kms_save_vga(dev_priv); 381 + vmw_fb_init(dev_priv); 382 + DRM_INFO("%s", vmw_fifo_have_3d(dev_priv) ? 383 + "Detected device 3D availability.\n" : 384 + "Detected no device 3D availability.\n"); 385 + } else { 386 + DRM_INFO("Delayed 3D detection since we're not " 387 + "running the device in SVGA mode yet.\n"); 388 + } 389 + 390 + if (dev_priv->capabilities & SVGA_CAP_IRQMASK) { 391 + ret = drm_irq_install(dev); 392 + if (unlikely(ret != 0)) { 393 + DRM_ERROR("Failed installing irq: %d\n", ret); 394 + goto out_no_irq; 395 + } 396 + } 397 397 398 398 dev_priv->pm_nb.notifier_call = vmwgfx_pm_notifier; 399 399 register_pm_notifier(&dev_priv->pm_nb); 400 400 401 - DRM_INFO("%s", vmw_fifo_have_3d(dev_priv) ? "Have 3D\n" : "No 3D\n"); 402 - 403 401 return 0; 404 402 405 - out_no_device: 406 - if (dev_priv->capabilities & SVGA_CAP_IRQMASK) 407 - drm_irq_uninstall(dev_priv->dev); 408 - if (dev->devname == vmw_devname) 409 - dev->devname = NULL; 410 403 out_no_irq: 404 + if (dev_priv->enable_fb) { 405 + vmw_fb_close(dev_priv); 406 + vmw_kms_restore_vga(dev_priv); 407 + vmw_3d_resource_dec(dev_priv); 408 + } 409 + out_no_fifo: 410 + vmw_overlay_close(dev_priv); 411 + vmw_kms_close(dev_priv); 412 + out_no_kms: 413 + if (dev_priv->stealth) 414 + pci_release_region(dev->pdev, 2); 415 + else 416 + pci_release_regions(dev->pdev); 417 + out_no_device: 411 418 ttm_object_device_release(&dev_priv->tdev); 412 419 out_err4: 413 420 iounmap(dev_priv->mmio_virt); ··· 460 415 461 416 unregister_pm_notifier(&dev_priv->pm_nb); 462 417 463 - vmw_fb_close(dev_priv); 418 + if (dev_priv->capabilities & SVGA_CAP_IRQMASK) 419 + drm_irq_uninstall(dev_priv->dev); 420 + if (dev_priv->enable_fb) { 421 + vmw_fb_close(dev_priv); 422 + vmw_kms_restore_vga(dev_priv); 423 + vmw_3d_resource_dec(dev_priv); 424 + } 464 425 vmw_kms_close(dev_priv); 465 426 vmw_overlay_close(dev_priv); 466 - vmw_release_device(dev_priv); 467 427 if (dev_priv->stealth) 468 428 pci_release_region(dev->pdev, 2); 469 429 else 470 430 pci_release_regions(dev->pdev); 471 431 472 - if (dev_priv->capabilities & SVGA_CAP_IRQMASK) 473 - drm_irq_uninstall(dev_priv->dev); 474 - if (dev->devname == vmw_devname) 475 - dev->devname = NULL; 476 432 ttm_object_device_release(&dev_priv->tdev); 477 433 iounmap(dev_priv->mmio_virt); 478 434 drm_mtrr_del(dev_priv->mmio_mtrr, dev_priv->mmio_start, ··· 546 500 struct drm_ioctl_desc *ioctl = 547 501 &vmw_ioctls[nr - DRM_COMMAND_BASE]; 548 502 549 - if (unlikely(ioctl->cmd != cmd)) { 503 + if (unlikely(ioctl->cmd_drv != cmd)) { 550 504 DRM_ERROR("Invalid command format, ioctl %d\n", 551 505 nr - DRM_COMMAND_BASE); 552 506 return -EINVAL; ··· 635 589 struct vmw_master *vmaster = vmw_master(file_priv->master); 636 590 int ret = 0; 637 591 592 + if (!dev_priv->enable_fb) { 593 + ret = vmw_3d_resource_inc(dev_priv); 594 + if (unlikely(ret != 0)) 595 + return ret; 596 + vmw_kms_save_vga(dev_priv); 597 + mutex_lock(&dev_priv->hw_mutex); 598 + vmw_write(dev_priv, SVGA_REG_TRACES, 0); 599 + mutex_unlock(&dev_priv->hw_mutex); 600 + } 601 + 638 602 if (active) { 639 603 BUG_ON(active != &dev_priv->fbdev_master); 640 604 ret = ttm_vt_lock(&active->lock, false, vmw_fp->tfile); ··· 673 617 return 0; 674 618 675 619 out_no_active_lock: 676 - vmw_release_device(dev_priv); 620 + if (!dev_priv->enable_fb) { 621 + mutex_lock(&dev_priv->hw_mutex); 622 + vmw_write(dev_priv, SVGA_REG_TRACES, 1); 623 + mutex_unlock(&dev_priv->hw_mutex); 624 + vmw_kms_restore_vga(dev_priv); 625 + vmw_3d_resource_dec(dev_priv); 626 + } 677 627 return ret; 678 628 } 679 629 ··· 707 645 708 646 ttm_lock_set_kill(&vmaster->lock, true, SIGTERM); 709 647 648 + if (!dev_priv->enable_fb) { 649 + ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM); 650 + if (unlikely(ret != 0)) 651 + DRM_ERROR("Unable to clean VRAM on master drop.\n"); 652 + mutex_lock(&dev_priv->hw_mutex); 653 + vmw_write(dev_priv, SVGA_REG_TRACES, 1); 654 + mutex_unlock(&dev_priv->hw_mutex); 655 + vmw_kms_restore_vga(dev_priv); 656 + vmw_3d_resource_dec(dev_priv); 657 + } 658 + 710 659 dev_priv->active_master = &dev_priv->fbdev_master; 711 660 ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM); 712 661 ttm_vt_unlock(&dev_priv->fbdev_master.lock); 713 662 714 - vmw_fb_on(dev_priv); 663 + if (dev_priv->enable_fb) 664 + vmw_fb_on(dev_priv); 715 665 } 716 666 717 667 ··· 796 722 .irq_postinstall = vmw_irq_postinstall, 797 723 .irq_uninstall = vmw_irq_uninstall, 798 724 .irq_handler = vmw_irq_handler, 725 + .get_vblank_counter = vmw_get_vblank_counter, 799 726 .reclaim_buffers_locked = NULL, 800 727 .get_map_ofs = drm_core_get_map_ofs, 801 728 .get_reg_ofs = drm_core_get_reg_ofs,
+8
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
··· 277 277 278 278 bool stealth; 279 279 bool is_opened; 280 + bool enable_fb; 280 281 281 282 /** 282 283 * Master management. ··· 286 285 struct vmw_master *active_master; 287 286 struct vmw_master fbdev_master; 288 287 struct notifier_block pm_nb; 288 + 289 + struct mutex release_mutex; 290 + uint32_t num_3d_resources; 289 291 }; 290 292 291 293 static inline struct vmw_private *vmw_priv(struct drm_device *dev) ··· 322 318 val = inl(dev_priv->io_start + VMWGFX_VALUE_PORT); 323 319 return val; 324 320 } 321 + 322 + int vmw_3d_resource_inc(struct vmw_private *dev_priv); 323 + void vmw_3d_resource_dec(struct vmw_private *dev_priv); 325 324 326 325 /** 327 326 * GMR utilities - vmwgfx_gmr.c ··· 518 511 unsigned bbp, unsigned depth); 519 512 int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, 520 513 struct drm_file *file_priv); 514 + u32 vmw_get_vblank_counter(struct drm_device *dev, int crtc); 521 515 522 516 /** 523 517 * Overlay control - vmwgfx_overlay.c
+5
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
··· 615 615 if (unlikely(ret != 0)) 616 616 goto err_unlock; 617 617 618 + if (bo->mem.mem_type == TTM_PL_VRAM && 619 + bo->mem.mm_node->start < bo->num_pages) 620 + (void) ttm_bo_validate(bo, &vmw_sys_placement, false, 621 + false, false); 622 + 618 623 ret = ttm_bo_validate(bo, &ne_placement, false, false, false); 619 624 620 625 /* Could probably bug on */
+3
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
··· 106 106 mutex_lock(&dev_priv->hw_mutex); 107 107 dev_priv->enable_state = vmw_read(dev_priv, SVGA_REG_ENABLE); 108 108 dev_priv->config_done_state = vmw_read(dev_priv, SVGA_REG_CONFIG_DONE); 109 + dev_priv->traces_state = vmw_read(dev_priv, SVGA_REG_TRACES); 109 110 vmw_write(dev_priv, SVGA_REG_ENABLE, 1); 110 111 111 112 min = 4; ··· 176 175 dev_priv->config_done_state); 177 176 vmw_write(dev_priv, SVGA_REG_ENABLE, 178 177 dev_priv->enable_state); 178 + vmw_write(dev_priv, SVGA_REG_TRACES, 179 + dev_priv->traces_state); 179 180 180 181 mutex_unlock(&dev_priv->hw_mutex); 181 182 vmw_fence_queue_takedown(&fifo->fence_queue);
+17
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
··· 898 898 save->width = vmw_read(vmw_priv, SVGA_REG_DISPLAY_WIDTH); 899 899 save->height = vmw_read(vmw_priv, SVGA_REG_DISPLAY_HEIGHT); 900 900 vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID); 901 + if (i == 0 && vmw_priv->num_displays == 1 && 902 + save->width == 0 && save->height == 0) { 903 + 904 + /* 905 + * It should be fairly safe to assume that these 906 + * values are uninitialized. 907 + */ 908 + 909 + save->width = vmw_priv->vga_width - save->pos_x; 910 + save->height = vmw_priv->vga_height - save->pos_y; 911 + } 901 912 } 913 + 902 914 return 0; 903 915 } 904 916 ··· 995 983 out_unlock: 996 984 ttm_read_unlock(&vmaster->lock); 997 985 return ret; 986 + } 987 + 988 + u32 vmw_get_vblank_counter(struct drm_device *dev, int crtc) 989 + { 990 + return 0; 998 991 }
+17 -10
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
··· 27 27 28 28 #include "vmwgfx_kms.h" 29 29 30 + #define VMWGFX_LDU_NUM_DU 8 31 + 30 32 #define vmw_crtc_to_ldu(x) \ 31 33 container_of(x, struct vmw_legacy_display_unit, base.crtc) 32 34 #define vmw_encoder_to_ldu(x) \ ··· 538 536 539 537 int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv) 540 538 { 539 + struct drm_device *dev = dev_priv->dev; 540 + int i; 541 + int ret; 542 + 541 543 if (dev_priv->ldu_priv) { 542 544 DRM_INFO("ldu system already on\n"); 543 545 return -EINVAL; ··· 559 553 560 554 drm_mode_create_dirty_info_property(dev_priv->dev); 561 555 562 - vmw_ldu_init(dev_priv, 0); 563 - /* for old hardware without multimon only enable one display */ 564 556 if (dev_priv->capabilities & SVGA_CAP_MULTIMON) { 565 - vmw_ldu_init(dev_priv, 1); 566 - vmw_ldu_init(dev_priv, 2); 567 - vmw_ldu_init(dev_priv, 3); 568 - vmw_ldu_init(dev_priv, 4); 569 - vmw_ldu_init(dev_priv, 5); 570 - vmw_ldu_init(dev_priv, 6); 571 - vmw_ldu_init(dev_priv, 7); 557 + for (i = 0; i < VMWGFX_LDU_NUM_DU; ++i) 558 + vmw_ldu_init(dev_priv, i); 559 + ret = drm_vblank_init(dev, VMWGFX_LDU_NUM_DU); 560 + } else { 561 + /* for old hardware without multimon only enable one display */ 562 + vmw_ldu_init(dev_priv, 0); 563 + ret = drm_vblank_init(dev, 1); 572 564 } 573 565 574 - return 0; 566 + return ret; 575 567 } 576 568 577 569 int vmw_kms_close_legacy_display_system(struct vmw_private *dev_priv) 578 570 { 571 + struct drm_device *dev = dev_priv->dev; 572 + 573 + drm_vblank_cleanup(dev); 579 574 if (!dev_priv->ldu_priv) 580 575 return -ENOSYS; 581 576
+4
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
··· 211 211 cmd->body.cid = cpu_to_le32(res->id); 212 212 213 213 vmw_fifo_commit(dev_priv, sizeof(*cmd)); 214 + vmw_3d_resource_dec(dev_priv); 214 215 } 215 216 216 217 static int vmw_context_init(struct vmw_private *dev_priv, ··· 248 247 cmd->body.cid = cpu_to_le32(res->id); 249 248 250 249 vmw_fifo_commit(dev_priv, sizeof(*cmd)); 250 + (void) vmw_3d_resource_inc(dev_priv); 251 251 vmw_resource_activate(res, vmw_hw_context_destroy); 252 252 return 0; 253 253 } ··· 408 406 cmd->body.sid = cpu_to_le32(res->id); 409 407 410 408 vmw_fifo_commit(dev_priv, sizeof(*cmd)); 409 + vmw_3d_resource_dec(dev_priv); 411 410 } 412 411 413 412 void vmw_surface_res_free(struct vmw_resource *res) ··· 476 473 } 477 474 478 475 vmw_fifo_commit(dev_priv, submit_size); 476 + (void) vmw_3d_resource_inc(dev_priv); 479 477 vmw_resource_activate(res, vmw_hw_surface_destroy); 480 478 return 0; 481 479 }
+1 -1
drivers/gpu/vga/vgaarb.c
··· 598 598 pr_debug("vgaarb: decoding count now is: %d\n", vga_decode_count); 599 599 } 600 600 601 - void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace) 601 + static void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace) 602 602 { 603 603 struct vga_device *vgadev; 604 604 unsigned long flags;
+1 -1
drivers/hwmon/Kconfig
··· 409 409 410 410 config SENSORS_PKGTEMP 411 411 tristate "Intel processor package temperature sensor" 412 - depends on X86 && PCI && EXPERIMENTAL 412 + depends on X86 && EXPERIMENTAL 413 413 help 414 414 If you say yes here you get support for the package level temperature 415 415 sensor inside your CPU. Check documentation/driver for details.
+33 -24
drivers/hwmon/coretemp.c
··· 36 36 #include <linux/pci.h> 37 37 #include <asm/msr.h> 38 38 #include <asm/processor.h> 39 + #include <asm/smp.h> 39 40 40 41 #define DRVNAME "coretemp" 41 42 ··· 424 423 int err; 425 424 struct platform_device *pdev; 426 425 struct pdev_entry *pdev_entry; 427 - #ifdef CONFIG_SMP 428 426 struct cpuinfo_x86 *c = &cpu_data(cpu); 429 - #endif 427 + 428 + /* 429 + * CPUID.06H.EAX[0] indicates whether the CPU has thermal 430 + * sensors. We check this bit only, all the early CPUs 431 + * without thermal sensors will be filtered out. 432 + */ 433 + if (!cpu_has(c, X86_FEATURE_DTS)) { 434 + printk(KERN_INFO DRVNAME ": CPU (model=0x%x)" 435 + " has no thermal sensor.\n", c->x86_model); 436 + return 0; 437 + } 430 438 431 439 mutex_lock(&pdev_list_mutex); 432 440 ··· 492 482 493 483 static void coretemp_device_remove(unsigned int cpu) 494 484 { 495 - struct pdev_entry *p, *n; 485 + struct pdev_entry *p; 486 + unsigned int i; 487 + 496 488 mutex_lock(&pdev_list_mutex); 497 - list_for_each_entry_safe(p, n, &pdev_list, list) { 498 - if (p->cpu == cpu) { 499 - platform_device_unregister(p->pdev); 500 - list_del(&p->list); 501 - kfree(p); 502 - } 489 + list_for_each_entry(p, &pdev_list, list) { 490 + if (p->cpu != cpu) 491 + continue; 492 + 493 + platform_device_unregister(p->pdev); 494 + list_del(&p->list); 495 + mutex_unlock(&pdev_list_mutex); 496 + kfree(p); 497 + for_each_cpu(i, cpu_sibling_mask(cpu)) 498 + if (i != cpu && !coretemp_device_add(i)) 499 + break; 500 + return; 503 501 } 504 502 mutex_unlock(&pdev_list_mutex); 505 503 } ··· 545 527 if (err) 546 528 goto exit; 547 529 548 - for_each_online_cpu(i) { 549 - struct cpuinfo_x86 *c = &cpu_data(i); 550 - /* 551 - * CPUID.06H.EAX[0] indicates whether the CPU has thermal 552 - * sensors. We check this bit only, all the early CPUs 553 - * without thermal sensors will be filtered out. 554 - */ 555 - if (c->cpuid_level >= 6 && (cpuid_eax(0x06) & 0x01)) 556 - coretemp_device_add(i); 557 - else { 558 - printk(KERN_INFO DRVNAME ": CPU (model=0x%x)" 559 - " has no thermal sensor.\n", c->x86_model); 560 - } 561 - } 530 + for_each_online_cpu(i) 531 + coretemp_device_add(i); 532 + 533 + #ifndef CONFIG_HOTPLUG_CPU 562 534 if (list_empty(&pdev_list)) { 563 535 err = -ENODEV; 564 536 goto exit_driver_unreg; 565 537 } 538 + #endif 566 539 567 540 register_hotcpu_notifier(&coretemp_cpu_notifier); 568 541 return 0; 569 542 570 - exit_driver_unreg: 571 543 #ifndef CONFIG_HOTPLUG_CPU 544 + exit_driver_unreg: 572 545 platform_driver_unregister(&coretemp_driver); 573 546 #endif 574 547 exit:
+19 -13
drivers/hwmon/f71882fg.c
··· 111 111 /* Super-I/O Function prototypes */ 112 112 static inline int superio_inb(int base, int reg); 113 113 static inline int superio_inw(int base, int reg); 114 - static inline void superio_enter(int base); 114 + static inline int superio_enter(int base); 115 115 static inline void superio_select(int base, int ld); 116 116 static inline void superio_exit(int base); 117 117 ··· 861 861 return val; 862 862 } 863 863 864 - static inline void superio_enter(int base) 864 + static inline int superio_enter(int base) 865 865 { 866 + /* Don't step on other drivers' I/O space by accident */ 867 + if (!request_muxed_region(base, 2, DRVNAME)) { 868 + printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n", 869 + base); 870 + return -EBUSY; 871 + } 872 + 866 873 /* according to the datasheet the key must be send twice! */ 867 874 outb(SIO_UNLOCK_KEY, base); 868 875 outb(SIO_UNLOCK_KEY, base); 876 + 877 + return 0; 869 878 } 870 879 871 880 static inline void superio_select(int base, int ld) ··· 886 877 static inline void superio_exit(int base) 887 878 { 888 879 outb(SIO_LOCK_KEY, base); 880 + release_region(base, 2); 889 881 } 890 882 891 883 static inline int fan_from_reg(u16 reg) ··· 2185 2175 static int __init f71882fg_find(int sioaddr, unsigned short *address, 2186 2176 struct f71882fg_sio_data *sio_data) 2187 2177 { 2188 - int err = -ENODEV; 2189 2178 u16 devid; 2190 - 2191 - /* Don't step on other drivers' I/O space by accident */ 2192 - if (!request_region(sioaddr, 2, DRVNAME)) { 2193 - printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n", 2194 - (int)sioaddr); 2195 - return -EBUSY; 2196 - } 2197 - 2198 - superio_enter(sioaddr); 2179 + int err = superio_enter(sioaddr); 2180 + if (err) 2181 + return err; 2199 2182 2200 2183 devid = superio_inw(sioaddr, SIO_REG_MANID); 2201 2184 if (devid != SIO_FINTEK_ID) { 2202 2185 pr_debug(DRVNAME ": Not a Fintek device\n"); 2186 + err = -ENODEV; 2203 2187 goto exit; 2204 2188 } 2205 2189 ··· 2217 2213 default: 2218 2214 printk(KERN_INFO DRVNAME ": Unsupported Fintek device: %04x\n", 2219 2215 (unsigned int)devid); 2216 + err = -ENODEV; 2220 2217 goto exit; 2221 2218 } 2222 2219 ··· 2228 2223 2229 2224 if (!(superio_inb(sioaddr, SIO_REG_ENABLE) & 0x01)) { 2230 2225 printk(KERN_WARNING DRVNAME ": Device not activated\n"); 2226 + err = -ENODEV; 2231 2227 goto exit; 2232 2228 } 2233 2229 2234 2230 *address = superio_inw(sioaddr, SIO_REG_ADDR); 2235 2231 if (*address == 0) { 2236 2232 printk(KERN_WARNING DRVNAME ": Base address not set\n"); 2233 + err = -ENODEV; 2237 2234 goto exit; 2238 2235 } 2239 2236 *address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */ ··· 2246 2239 (int)superio_inb(sioaddr, SIO_REG_DEVREV)); 2247 2240 exit: 2248 2241 superio_exit(sioaddr); 2249 - release_region(sioaddr, 2); 2250 2242 return err; 2251 2243 } 2252 2244
+2 -2
drivers/hwmon/lis3lv02d.c
··· 277 277 wake_up_interruptible(&lis3_dev.misc_wait); 278 278 kill_fasync(&lis3_dev.async_queue, SIGIO, POLL_IN); 279 279 out: 280 - if (lis3_dev.whoami == WAI_8B && lis3_dev.idev && 280 + if (lis3_dev.pdata && lis3_dev.whoami == WAI_8B && lis3_dev.idev && 281 281 lis3_dev.idev->input->users) 282 282 return IRQ_WAKE_THREAD; 283 283 return IRQ_HANDLED; ··· 718 718 * io-apic is not configurable (and generates a warning) but I keep it 719 719 * in case of support for other hardware. 720 720 */ 721 - if (dev->whoami == WAI_8B) 721 + if (dev->pdata && dev->whoami == WAI_8B) 722 722 thread_fn = lis302dl_interrupt_thread1_8b; 723 723 else 724 724 thread_fn = NULL;
+11 -12
drivers/hwmon/pkgtemp.c
··· 33 33 #include <linux/list.h> 34 34 #include <linux/platform_device.h> 35 35 #include <linux/cpu.h> 36 - #include <linux/pci.h> 37 36 #include <asm/msr.h> 38 37 #include <asm/processor.h> 39 38 ··· 223 224 224 225 err = sysfs_create_group(&pdev->dev.kobj, &pkgtemp_group); 225 226 if (err) 226 - goto exit_free; 227 + goto exit_dev; 227 228 228 229 data->hwmon_dev = hwmon_device_register(&pdev->dev); 229 230 if (IS_ERR(data->hwmon_dev)) { ··· 237 238 238 239 exit_class: 239 240 sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group); 241 + exit_dev: 242 + device_remove_file(&pdev->dev, &sensor_dev_attr_temp1_max.dev_attr); 240 243 exit_free: 241 244 kfree(data); 242 245 exit: ··· 251 250 252 251 hwmon_device_unregister(data->hwmon_dev); 253 252 sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group); 253 + device_remove_file(&pdev->dev, &sensor_dev_attr_temp1_max.dev_attr); 254 254 platform_set_drvdata(pdev, NULL); 255 255 kfree(data); 256 256 return 0; ··· 283 281 int err; 284 282 struct platform_device *pdev; 285 283 struct pdev_entry *pdev_entry; 286 - #ifdef CONFIG_SMP 287 284 struct cpuinfo_x86 *c = &cpu_data(cpu); 288 - #endif 285 + 286 + if (!cpu_has(c, X86_FEATURE_PTS)) 287 + return 0; 289 288 290 289 mutex_lock(&pdev_list_mutex); 291 290 ··· 342 339 #ifdef CONFIG_HOTPLUG_CPU 343 340 static void pkgtemp_device_remove(unsigned int cpu) 344 341 { 345 - struct pdev_entry *p, *n; 342 + struct pdev_entry *p; 346 343 unsigned int i; 347 344 int err; 348 345 349 346 mutex_lock(&pdev_list_mutex); 350 - list_for_each_entry_safe(p, n, &pdev_list, list) { 347 + list_for_each_entry(p, &pdev_list, list) { 351 348 if (p->cpu != cpu) 352 349 continue; 353 350 354 351 platform_device_unregister(p->pdev); 355 352 list_del(&p->list); 353 + mutex_unlock(&pdev_list_mutex); 356 354 kfree(p); 357 355 for_each_cpu(i, cpu_core_mask(cpu)) { 358 356 if (i != cpu) { ··· 362 358 break; 363 359 } 364 360 } 365 - break; 361 + return; 366 362 } 367 363 mutex_unlock(&pdev_list_mutex); 368 364 } ··· 403 399 goto exit; 404 400 405 401 for_each_online_cpu(i) { 406 - struct cpuinfo_x86 *c = &cpu_data(i); 407 - 408 - if (!cpu_has(c, X86_FEATURE_PTS)) 409 - continue; 410 - 411 402 err = pkgtemp_device_add(i); 412 403 if (err) 413 404 goto exit_devices_unreg;
+3 -3
drivers/i2c/busses/i2c-davinci.c
··· 357 357 358 358 dev->terminate = 0; 359 359 360 - /* write the data into mode register */ 361 - davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag); 362 - 363 360 /* 364 361 * First byte should be set here, not after interrupt, 365 362 * because transmit-data-ready interrupt can come before ··· 367 370 davinci_i2c_write_reg(dev, DAVINCI_I2C_DXR_REG, *dev->buf++); 368 371 dev->buf_len--; 369 372 } 373 + 374 + /* write the data into mode register; start transmitting */ 375 + davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag); 370 376 371 377 r = wait_for_completion_interruptible_timeout(&dev->cmd_complete, 372 378 dev->adapter.timeout);
+1 -1
drivers/i2c/busses/i2c-octeon.c
··· 218 218 return result; 219 219 } else if (result == 0) { 220 220 dev_dbg(i2c->dev, "%s: timeout\n", __func__); 221 - result = -ETIMEDOUT; 221 + return -ETIMEDOUT; 222 222 } 223 223 224 224 return 0;
+2 -2
drivers/i2c/busses/i2c-s3c2410.c
··· 662 662 unsigned long sda_delay; 663 663 664 664 if (pdata->sda_delay) { 665 - sda_delay = (freq / 1000) * pdata->sda_delay; 666 - sda_delay /= 1000000; 665 + sda_delay = clkin * pdata->sda_delay; 666 + sda_delay = DIV_ROUND_UP(sda_delay, 1000000); 667 667 sda_delay = DIV_ROUND_UP(sda_delay, 5); 668 668 if (sda_delay > 3) 669 669 sda_delay = 3;
+15 -5
drivers/idle/intel_idle.c
··· 83 83 /* Reliable LAPIC Timer States, bit 1 for C1 etc. */ 84 84 static unsigned int lapic_timer_reliable_states; 85 85 86 - static struct cpuidle_device *intel_idle_cpuidle_devices; 86 + static struct cpuidle_device __percpu *intel_idle_cpuidle_devices; 87 87 static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state); 88 88 89 89 static struct cpuidle_state *cpuidle_state_table; ··· 108 108 .name = "NHM-C3", 109 109 .desc = "MWAIT 0x10", 110 110 .driver_data = (void *) 0x10, 111 - .flags = CPUIDLE_FLAG_TIME_VALID, 111 + .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, 112 112 .exit_latency = 20, 113 113 .power_usage = 500, 114 114 .target_residency = 80, ··· 117 117 .name = "NHM-C6", 118 118 .desc = "MWAIT 0x20", 119 119 .driver_data = (void *) 0x20, 120 - .flags = CPUIDLE_FLAG_TIME_VALID, 120 + .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, 121 121 .exit_latency = 200, 122 122 .power_usage = 350, 123 123 .target_residency = 800, ··· 149 149 .name = "ATM-C4", 150 150 .desc = "MWAIT 0x30", 151 151 .driver_data = (void *) 0x30, 152 - .flags = CPUIDLE_FLAG_TIME_VALID, 152 + .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, 153 153 .exit_latency = 100, 154 154 .power_usage = 250, 155 155 .target_residency = 400, ··· 159 159 .name = "ATM-C6", 160 160 .desc = "MWAIT 0x40", 161 161 .driver_data = (void *) 0x40, 162 - .flags = CPUIDLE_FLAG_TIME_VALID, 162 + .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, 163 163 .exit_latency = 200, 164 164 .power_usage = 150, 165 165 .target_residency = 800, ··· 184 184 cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1; 185 185 186 186 local_irq_disable(); 187 + 188 + /* 189 + * If the state flag indicates that the TLB will be flushed or if this 190 + * is the deepest c-state supported, do a voluntary leave mm to avoid 191 + * costly and mostly unnecessary wakeups for flushing the user TLB's 192 + * associated with the active mm. 193 + */ 194 + if (state->flags & CPUIDLE_FLAG_TLB_FLUSHED || 195 + (&dev->states[dev->state_count - 1] == state)) 196 + leave_mm(cpu); 187 197 188 198 if (!(lapic_timer_reliable_states & (1 << (cstate)))) 189 199 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
+4 -2
drivers/infiniband/hw/cxgb3/iwch_cm.c
··· 463 463 V_MSS_IDX(mtu_idx) | 464 464 V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx); 465 465 opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10); 466 - opt2 = V_FLAVORS_VALID(1) | V_CONG_CONTROL_FLAVOR(cong_flavor); 466 + opt2 = F_RX_COALESCE_VALID | V_RX_COALESCE(0) | V_FLAVORS_VALID(1) | 467 + V_CONG_CONTROL_FLAVOR(cong_flavor); 467 468 skb->priority = CPL_PRIORITY_SETUP; 468 469 set_arp_failure_handler(skb, act_open_req_arp_failure); 469 470 ··· 1281 1280 V_MSS_IDX(mtu_idx) | 1282 1281 V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx); 1283 1282 opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10); 1284 - opt2 = V_FLAVORS_VALID(1) | V_CONG_CONTROL_FLAVOR(cong_flavor); 1283 + opt2 = F_RX_COALESCE_VALID | V_RX_COALESCE(0) | V_FLAVORS_VALID(1) | 1284 + V_CONG_CONTROL_FLAVOR(cong_flavor); 1285 1285 1286 1286 rpl = cplhdr(skb); 1287 1287 rpl->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
+5 -4
drivers/leds/leds-ns2.c
··· 81 81 int cmd_level; 82 82 int slow_level; 83 83 84 - read_lock(&led_dat->rw_lock); 84 + read_lock_irq(&led_dat->rw_lock); 85 85 86 86 cmd_level = gpio_get_value(led_dat->cmd); 87 87 slow_level = gpio_get_value(led_dat->slow); ··· 95 95 } 96 96 } 97 97 98 - read_unlock(&led_dat->rw_lock); 98 + read_unlock_irq(&led_dat->rw_lock); 99 99 100 100 return ret; 101 101 } ··· 104 104 enum ns2_led_modes mode) 105 105 { 106 106 int i; 107 + unsigned long flags; 107 108 108 - write_lock(&led_dat->rw_lock); 109 + write_lock_irqsave(&led_dat->rw_lock, flags); 109 110 110 111 for (i = 0; i < ARRAY_SIZE(ns2_led_modval); i++) { 111 112 if (mode == ns2_led_modval[i].mode) { ··· 117 116 } 118 117 } 119 118 120 - write_unlock(&led_dat->rw_lock); 119 + write_unlock_irqrestore(&led_dat->rw_lock, flags); 121 120 } 122 121 123 122 static void ns2_led_set(struct led_classdev *led_cdev,
+7 -6
drivers/mfd/max8925-core.c
··· 429 429 irq_tsc = cache_tsc; 430 430 for (i = 0; i < ARRAY_SIZE(max8925_irqs); i++) { 431 431 irq_data = &max8925_irqs[i]; 432 + /* 1 -- disable, 0 -- enable */ 432 433 switch (irq_data->mask_reg) { 433 434 case MAX8925_CHG_IRQ1_MASK: 434 - irq_chg[0] &= irq_data->enable; 435 + irq_chg[0] &= ~irq_data->enable; 435 436 break; 436 437 case MAX8925_CHG_IRQ2_MASK: 437 - irq_chg[1] &= irq_data->enable; 438 + irq_chg[1] &= ~irq_data->enable; 438 439 break; 439 440 case MAX8925_ON_OFF_IRQ1_MASK: 440 - irq_on[0] &= irq_data->enable; 441 + irq_on[0] &= ~irq_data->enable; 441 442 break; 442 443 case MAX8925_ON_OFF_IRQ2_MASK: 443 - irq_on[1] &= irq_data->enable; 444 + irq_on[1] &= ~irq_data->enable; 444 445 break; 445 446 case MAX8925_RTC_IRQ_MASK: 446 - irq_rtc &= irq_data->enable; 447 + irq_rtc &= ~irq_data->enable; 447 448 break; 448 449 case MAX8925_TSC_IRQ_MASK: 449 - irq_tsc &= irq_data->enable; 450 + irq_tsc &= ~irq_data->enable; 450 451 break; 451 452 default: 452 453 dev_err(chip->dev, "wrong IRQ\n");
+7 -2
drivers/mfd/wm831x-irq.c
··· 394 394 395 395 irq = irq - wm831x->irq_base; 396 396 397 - if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11) 398 - return -EINVAL; 397 + if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11) { 398 + /* Ignore internal-only IRQs */ 399 + if (irq >= 0 && irq < WM831X_NUM_IRQS) 400 + return 0; 401 + else 402 + return -EINVAL; 403 + } 399 404 400 405 switch (type) { 401 406 case IRQ_TYPE_EDGE_BOTH:
+1 -1
drivers/misc/Kconfig
··· 368 368 If unsure, say N. 369 369 370 370 To compile this driver as a module, choose M here: the 371 - module will be called vmware_balloon. 371 + module will be called vmw_balloon. 372 372 373 373 config ARM_CHARLCD 374 374 bool "ARM Ltd. Character LCD Driver"
+1 -1
drivers/misc/Makefile
··· 33 33 obj-$(CONFIG_HMC6352) += hmc6352.o 34 34 obj-y += eeprom/ 35 35 obj-y += cb710/ 36 - obj-$(CONFIG_VMWARE_BALLOON) += vmware_balloon.o 36 + obj-$(CONFIG_VMWARE_BALLOON) += vmw_balloon.o 37 37 obj-$(CONFIG_ARM_CHARLCD) += arm-charlcd.o
drivers/misc/vmware_balloon.c drivers/misc/vmw_balloon.c
+8 -4
drivers/mmc/host/sdhci-s3c.c
··· 241 241 static void sdhci_s3c_notify_change(struct platform_device *dev, int state) 242 242 { 243 243 struct sdhci_host *host = platform_get_drvdata(dev); 244 + unsigned long flags; 245 + 244 246 if (host) { 245 - spin_lock(&host->lock); 247 + spin_lock_irqsave(&host->lock, flags); 246 248 if (state) { 247 249 dev_dbg(&dev->dev, "card inserted.\n"); 248 250 host->flags &= ~SDHCI_DEVICE_DEAD; ··· 255 253 host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; 256 254 } 257 255 tasklet_schedule(&host->card_tasklet); 258 - spin_unlock(&host->lock); 256 + spin_unlock_irqrestore(&host->lock, flags); 259 257 } 260 258 } 261 259 ··· 483 481 sdhci_remove_host(host, 1); 484 482 485 483 for (ptr = 0; ptr < 3; ptr++) { 486 - clk_disable(sc->clk_bus[ptr]); 487 - clk_put(sc->clk_bus[ptr]); 484 + if (sc->clk_bus[ptr]) { 485 + clk_disable(sc->clk_bus[ptr]); 486 + clk_put(sc->clk_bus[ptr]); 487 + } 488 488 } 489 489 clk_disable(sc->clk_io); 490 490 clk_put(sc->clk_io);
+1 -1
drivers/mtd/nand/omap2.c
··· 413 413 prefetch_status = gpmc_read_status(GPMC_PREFETCH_COUNT); 414 414 } while (prefetch_status); 415 415 /* disable and stop the PFPW engine */ 416 - gpmc_prefetch_reset(); 416 + gpmc_prefetch_reset(info->gpmc_cs); 417 417 418 418 dma_unmap_single(&info->pdev->dev, dma_addr, len, dir); 419 419 return 0;
+10
drivers/net/3c59x.c
··· 2942 2942 { 2943 2943 struct vortex_private *vp = netdev_priv(dev); 2944 2944 2945 + if (!VORTEX_PCI(vp)) 2946 + return; 2947 + 2945 2948 wol->supported = WAKE_MAGIC; 2946 2949 2947 2950 wol->wolopts = 0; ··· 2955 2952 static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 2956 2953 { 2957 2954 struct vortex_private *vp = netdev_priv(dev); 2955 + 2956 + if (!VORTEX_PCI(vp)) 2957 + return -EOPNOTSUPP; 2958 + 2958 2959 if (wol->wolopts & ~WAKE_MAGIC) 2959 2960 return -EINVAL; 2960 2961 ··· 3207 3200 vp->enable_wol = 0; 3208 3201 return; 3209 3202 } 3203 + 3204 + if (VORTEX_PCI(vp)->current_state < PCI_D3hot) 3205 + return; 3210 3206 3211 3207 /* Change the power state to D3; RxEnable doesn't take effect. */ 3212 3208 pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot);
+9 -2
drivers/net/atlx/atl1.c
··· 1251 1251 1252 1252 rrd_ring->desc = NULL; 1253 1253 rrd_ring->dma = 0; 1254 + 1255 + adapter->cmb.dma = 0; 1256 + adapter->cmb.cmb = NULL; 1257 + 1258 + adapter->smb.dma = 0; 1259 + adapter->smb.smb = NULL; 1254 1260 } 1255 1261 1256 1262 static void atl1_setup_mac_ctrl(struct atl1_adapter *adapter) ··· 2853 2847 pci_enable_wake(pdev, PCI_D3cold, 0); 2854 2848 2855 2849 atl1_reset_hw(&adapter->hw); 2856 - adapter->cmb.cmb->int_stats = 0; 2857 2850 2858 - if (netif_running(netdev)) 2851 + if (netif_running(netdev)) { 2852 + adapter->cmb.cmb->int_stats = 0; 2859 2853 atl1_up(adapter); 2854 + } 2860 2855 netif_device_attach(netdev); 2861 2856 2862 2857 return 0;
+1
drivers/net/e1000e/hw.h
··· 57 57 E1000_SCTL = 0x00024, /* SerDes Control - RW */ 58 58 E1000_FCAL = 0x00028, /* Flow Control Address Low - RW */ 59 59 E1000_FCAH = 0x0002C, /* Flow Control Address High -RW */ 60 + E1000_FEXTNVM4 = 0x00024, /* Future Extended NVM 4 - RW */ 60 61 E1000_FEXTNVM = 0x00028, /* Future Extended NVM - RW */ 61 62 E1000_FCT = 0x00030, /* Flow Control Type - RW */ 62 63 E1000_VET = 0x00038, /* VLAN Ether Type - RW */
+164 -33
drivers/net/e1000e/ich8lan.c
··· 105 105 #define E1000_FEXTNVM_SW_CONFIG 1 106 106 #define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */ 107 107 108 + #define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7 109 + #define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7 110 + #define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3 111 + 108 112 #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL 109 113 110 114 #define E1000_ICH_RAR_ENTRIES 7 ··· 129 125 130 126 /* SMBus Address Phy Register */ 131 127 #define HV_SMB_ADDR PHY_REG(768, 26) 128 + #define HV_SMB_ADDR_MASK 0x007F 132 129 #define HV_SMB_ADDR_PEC_EN 0x0200 133 130 #define HV_SMB_ADDR_VALID 0x0080 134 131 ··· 242 237 static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); 243 238 static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); 244 239 static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); 240 + static s32 e1000_k1_workaround_lv(struct e1000_hw *hw); 241 + static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate); 245 242 246 243 static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) 247 244 { ··· 279 272 static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) 280 273 { 281 274 struct e1000_phy_info *phy = &hw->phy; 282 - u32 ctrl; 275 + u32 ctrl, fwsm; 283 276 s32 ret_val = 0; 284 277 285 278 phy->addr = 1; ··· 301 294 * disabled, then toggle the LANPHYPC Value bit to force 302 295 * the interconnect to PCIe mode. 303 296 */ 304 - if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { 297 + fwsm = er32(FWSM); 298 + if (!(fwsm & E1000_ICH_FWSM_FW_VALID)) { 305 299 ctrl = er32(CTRL); 306 300 ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE; 307 301 ctrl &= ~E1000_CTRL_LANPHYPC_VALUE; ··· 311 303 ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE; 312 304 ew32(CTRL, ctrl); 313 305 msleep(50); 306 + 307 + /* 308 + * Gate automatic PHY configuration by hardware on 309 + * non-managed 82579 310 + */ 311 + if (hw->mac.type == e1000_pch2lan) 312 + e1000_gate_hw_phy_config_ich8lan(hw, true); 314 313 } 315 314 316 315 /* ··· 329 314 ret_val = e1000e_phy_hw_reset_generic(hw); 330 315 if (ret_val) 331 316 goto out; 317 + 318 + /* Ungate automatic PHY configuration on non-managed 82579 */ 319 + if ((hw->mac.type == e1000_pch2lan) && 320 + !(fwsm & E1000_ICH_FWSM_FW_VALID)) { 321 + msleep(10); 322 + e1000_gate_hw_phy_config_ich8lan(hw, false); 323 + } 332 324 333 325 phy->id = e1000_phy_unknown; 334 326 ret_val = e1000e_get_phy_id(hw); ··· 583 561 if (mac->type == e1000_ich8lan) 584 562 e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); 585 563 586 - /* Disable PHY configuration by hardware, config by software */ 587 - if (mac->type == e1000_pch2lan) { 588 - u32 extcnf_ctrl = er32(EXTCNF_CTRL); 589 - 590 - extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG; 591 - ew32(EXTCNF_CTRL, extcnf_ctrl); 592 - } 564 + /* Gate automatic PHY configuration by hardware on managed 82579 */ 565 + if ((mac->type == e1000_pch2lan) && 566 + (er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) 567 + e1000_gate_hw_phy_config_ich8lan(hw, true); 593 568 594 569 return 0; 595 570 } ··· 667 648 668 649 if (hw->phy.type == e1000_phy_82578) { 669 650 ret_val = e1000_link_stall_workaround_hv(hw); 651 + if (ret_val) 652 + goto out; 653 + } 654 + 655 + if (hw->mac.type == e1000_pch2lan) { 656 + ret_val = e1000_k1_workaround_lv(hw); 670 657 if (ret_val) 671 658 goto out; 672 659 } ··· 920 895 } 921 896 922 897 /** 898 + * e1000_write_smbus_addr - Write SMBus address to PHY needed during Sx states 899 + * @hw: pointer to the HW structure 900 + * 901 + * Assumes semaphore already acquired. 902 + * 903 + **/ 904 + static s32 e1000_write_smbus_addr(struct e1000_hw *hw) 905 + { 906 + u16 phy_data; 907 + u32 strap = er32(STRAP); 908 + s32 ret_val = 0; 909 + 910 + strap &= E1000_STRAP_SMBUS_ADDRESS_MASK; 911 + 912 + ret_val = e1000_read_phy_reg_hv_locked(hw, HV_SMB_ADDR, &phy_data); 913 + if (ret_val) 914 + goto out; 915 + 916 + phy_data &= ~HV_SMB_ADDR_MASK; 917 + phy_data |= (strap >> E1000_STRAP_SMBUS_ADDRESS_SHIFT); 918 + phy_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; 919 + ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, phy_data); 920 + 921 + out: 922 + return ret_val; 923 + } 924 + 925 + /** 923 926 * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration 924 927 * @hw: pointer to the HW structure 925 928 * ··· 956 903 **/ 957 904 static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) 958 905 { 959 - struct e1000_adapter *adapter = hw->adapter; 960 906 struct e1000_phy_info *phy = &hw->phy; 961 907 u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask; 962 908 s32 ret_val = 0; ··· 973 921 if (phy->type != e1000_phy_igp_3) 974 922 return ret_val; 975 923 976 - if (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) { 924 + if ((hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) || 925 + (hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_C)) { 977 926 sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; 978 927 break; 979 928 } ··· 1014 961 cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; 1015 962 cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; 1016 963 1017 - if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && 1018 - ((hw->mac.type == e1000_pchlan) || 1019 - (hw->mac.type == e1000_pch2lan))) { 964 + if ((!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && 965 + (hw->mac.type == e1000_pchlan)) || 966 + (hw->mac.type == e1000_pch2lan)) { 1020 967 /* 1021 968 * HW configures the SMBus address and LEDs when the 1022 969 * OEM and LCD Write Enable bits are set in the NVM. 1023 970 * When both NVM bits are cleared, SW will configure 1024 971 * them instead. 1025 972 */ 1026 - data = er32(STRAP); 1027 - data &= E1000_STRAP_SMBUS_ADDRESS_MASK; 1028 - reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT; 1029 - reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; 1030 - ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, 1031 - reg_data); 973 + ret_val = e1000_write_smbus_addr(hw); 1032 974 if (ret_val) 1033 975 goto out; 1034 976 ··· 1488 1440 goto out; 1489 1441 1490 1442 /* Enable jumbo frame workaround in the PHY */ 1491 - e1e_rphy(hw, PHY_REG(769, 20), &data); 1492 - ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14)); 1493 - if (ret_val) 1494 - goto out; 1495 1443 e1e_rphy(hw, PHY_REG(769, 23), &data); 1496 1444 data &= ~(0x7F << 5); 1497 1445 data |= (0x37 << 5); ··· 1496 1452 goto out; 1497 1453 e1e_rphy(hw, PHY_REG(769, 16), &data); 1498 1454 data &= ~(1 << 13); 1499 - data |= (1 << 12); 1500 1455 ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); 1501 1456 if (ret_val) 1502 1457 goto out; ··· 1520 1477 1521 1478 mac_reg = er32(RCTL); 1522 1479 mac_reg &= ~E1000_RCTL_SECRC; 1523 - ew32(FFLT_DBG, mac_reg); 1480 + ew32(RCTL, mac_reg); 1524 1481 1525 1482 ret_val = e1000e_read_kmrn_reg(hw, 1526 1483 E1000_KMRNCTRLSTA_CTRL_OFFSET, ··· 1546 1503 goto out; 1547 1504 1548 1505 /* Write PHY register values back to h/w defaults */ 1549 - e1e_rphy(hw, PHY_REG(769, 20), &data); 1550 - ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14)); 1551 - if (ret_val) 1552 - goto out; 1553 1506 e1e_rphy(hw, PHY_REG(769, 23), &data); 1554 1507 data &= ~(0x7F << 5); 1555 1508 ret_val = e1e_wphy(hw, PHY_REG(769, 23), data); 1556 1509 if (ret_val) 1557 1510 goto out; 1558 1511 e1e_rphy(hw, PHY_REG(769, 16), &data); 1559 - data &= ~(1 << 12); 1560 1512 data |= (1 << 13); 1561 1513 ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); 1562 1514 if (ret_val) ··· 1594 1556 1595 1557 out: 1596 1558 return ret_val; 1559 + } 1560 + 1561 + /** 1562 + * e1000_k1_gig_workaround_lv - K1 Si workaround 1563 + * @hw: pointer to the HW structure 1564 + * 1565 + * Workaround to set the K1 beacon duration for 82579 parts 1566 + **/ 1567 + static s32 e1000_k1_workaround_lv(struct e1000_hw *hw) 1568 + { 1569 + s32 ret_val = 0; 1570 + u16 status_reg = 0; 1571 + u32 mac_reg; 1572 + 1573 + if (hw->mac.type != e1000_pch2lan) 1574 + goto out; 1575 + 1576 + /* Set K1 beacon duration based on 1Gbps speed or otherwise */ 1577 + ret_val = e1e_rphy(hw, HV_M_STATUS, &status_reg); 1578 + if (ret_val) 1579 + goto out; 1580 + 1581 + if ((status_reg & (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE)) 1582 + == (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE)) { 1583 + mac_reg = er32(FEXTNVM4); 1584 + mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK; 1585 + 1586 + if (status_reg & HV_M_STATUS_SPEED_1000) 1587 + mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_8USEC; 1588 + else 1589 + mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_16USEC; 1590 + 1591 + ew32(FEXTNVM4, mac_reg); 1592 + } 1593 + 1594 + out: 1595 + return ret_val; 1596 + } 1597 + 1598 + /** 1599 + * e1000_gate_hw_phy_config_ich8lan - disable PHY config via hardware 1600 + * @hw: pointer to the HW structure 1601 + * @gate: boolean set to true to gate, false to ungate 1602 + * 1603 + * Gate/ungate the automatic PHY configuration via hardware; perform 1604 + * the configuration via software instead. 1605 + **/ 1606 + static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate) 1607 + { 1608 + u32 extcnf_ctrl; 1609 + 1610 + if (hw->mac.type != e1000_pch2lan) 1611 + return; 1612 + 1613 + extcnf_ctrl = er32(EXTCNF_CTRL); 1614 + 1615 + if (gate) 1616 + extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG; 1617 + else 1618 + extcnf_ctrl &= ~E1000_EXTCNF_CTRL_GATE_PHY_CFG; 1619 + 1620 + ew32(EXTCNF_CTRL, extcnf_ctrl); 1621 + return; 1597 1622 } 1598 1623 1599 1624 /** ··· 1703 1602 if (e1000_check_reset_block(hw)) 1704 1603 goto out; 1705 1604 1605 + /* Allow time for h/w to get to quiescent state after reset */ 1606 + msleep(10); 1607 + 1706 1608 /* Perform any necessary post-reset workarounds */ 1707 1609 switch (hw->mac.type) { 1708 1610 case e1000_pchlan: ··· 1734 1630 /* Configure the LCD with the OEM bits in NVM */ 1735 1631 ret_val = e1000_oem_bits_config_ich8lan(hw, true); 1736 1632 1633 + /* Ungate automatic PHY configuration on non-managed 82579 */ 1634 + if ((hw->mac.type == e1000_pch2lan) && 1635 + !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { 1636 + msleep(10); 1637 + e1000_gate_hw_phy_config_ich8lan(hw, false); 1638 + } 1639 + 1737 1640 out: 1738 1641 return ret_val; 1739 1642 } ··· 1756 1645 static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) 1757 1646 { 1758 1647 s32 ret_val = 0; 1648 + 1649 + /* Gate automatic PHY configuration by hardware on non-managed 82579 */ 1650 + if ((hw->mac.type == e1000_pch2lan) && 1651 + !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) 1652 + e1000_gate_hw_phy_config_ich8lan(hw, true); 1759 1653 1760 1654 ret_val = e1000e_phy_hw_reset_generic(hw); 1761 1655 if (ret_val) ··· 3026 2910 * external PHY is reset. 3027 2911 */ 3028 2912 ctrl |= E1000_CTRL_PHY_RST; 2913 + 2914 + /* 2915 + * Gate automatic PHY configuration by hardware on 2916 + * non-managed 82579 2917 + */ 2918 + if ((hw->mac.type == e1000_pch2lan) && 2919 + !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) 2920 + e1000_gate_hw_phy_config_ich8lan(hw, true); 3029 2921 } 3030 2922 ret_val = e1000_acquire_swflag_ich8lan(hw); 3031 2923 e_dbg("Issuing a global reset to ich8lan\n"); ··· 3584 3460 void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw) 3585 3461 { 3586 3462 u32 phy_ctrl; 3463 + s32 ret_val; 3587 3464 3588 3465 phy_ctrl = er32(PHY_CTRL); 3589 3466 phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | E1000_PHY_CTRL_GBE_DISABLE; 3590 3467 ew32(PHY_CTRL, phy_ctrl); 3591 3468 3592 - if (hw->mac.type >= e1000_pchlan) 3593 - e1000_phy_hw_reset_ich8lan(hw); 3469 + if (hw->mac.type >= e1000_pchlan) { 3470 + e1000_oem_bits_config_ich8lan(hw, true); 3471 + ret_val = hw->phy.ops.acquire(hw); 3472 + if (ret_val) 3473 + return; 3474 + e1000_write_smbus_addr(hw); 3475 + hw->phy.ops.release(hw); 3476 + } 3594 3477 } 3595 3478 3596 3479 /**
+19 -10
drivers/net/e1000e/netdev.c
··· 2704 2704 u32 psrctl = 0; 2705 2705 u32 pages = 0; 2706 2706 2707 + /* Workaround Si errata on 82579 - configure jumbo frame flow */ 2708 + if (hw->mac.type == e1000_pch2lan) { 2709 + s32 ret_val; 2710 + 2711 + if (adapter->netdev->mtu > ETH_DATA_LEN) 2712 + ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); 2713 + else 2714 + ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); 2715 + } 2716 + 2707 2717 /* Program MC offset vector base */ 2708 2718 rctl = er32(RCTL); 2709 2719 rctl &= ~(3 << E1000_RCTL_MO_SHIFT); ··· 2752 2742 e1e_wphy(hw, 0x10, 0x2823); 2753 2743 e1e_wphy(hw, 0x11, 0x0003); 2754 2744 e1e_wphy(hw, 22, phy_data); 2755 - } 2756 - 2757 - /* Workaround Si errata on 82579 - configure jumbo frame flow */ 2758 - if (hw->mac.type == e1000_pch2lan) { 2759 - s32 ret_val; 2760 - 2761 - if (rctl & E1000_RCTL_LPE) 2762 - ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); 2763 - else 2764 - ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); 2765 2745 } 2766 2746 2767 2747 /* Setup buffer sizes */ ··· 4830 4830 if ((new_mtu < ETH_ZLEN + ETH_FCS_LEN + VLAN_HLEN) || 4831 4831 (max_frame > adapter->max_hw_frame_size)) { 4832 4832 e_err("Unsupported MTU setting\n"); 4833 + return -EINVAL; 4834 + } 4835 + 4836 + /* Jumbo frame workaround on 82579 requires CRC be stripped */ 4837 + if ((adapter->hw.mac.type == e1000_pch2lan) && 4838 + !(adapter->flags2 & FLAG2_CRC_STRIPPING) && 4839 + (new_mtu > ETH_DATA_LEN)) { 4840 + e_err("Jumbo Frames not supported on 82579 when CRC " 4841 + "stripping is disabled.\n"); 4833 4842 return -EINVAL; 4834 4843 } 4835 4844
+2 -2
drivers/net/ibm_newemac/core.c
··· 2928 2928 if (dev->emac_irq != NO_IRQ) 2929 2929 irq_dispose_mapping(dev->emac_irq); 2930 2930 err_free: 2931 - kfree(ndev); 2931 + free_netdev(ndev); 2932 2932 err_gone: 2933 2933 /* if we were on the bootlist, remove us as we won't show up and 2934 2934 * wake up all waiters to notify them in case they were waiting ··· 2971 2971 if (dev->emac_irq != NO_IRQ) 2972 2972 irq_dispose_mapping(dev->emac_irq); 2973 2973 2974 - kfree(dev->ndev); 2974 + free_netdev(dev->ndev); 2975 2975 2976 2976 return 0; 2977 2977 }
-3
drivers/net/netxen/netxen_nic_init.c
··· 1540 1540 if (pkt_offset) 1541 1541 skb_pull(skb, pkt_offset); 1542 1542 1543 - skb->truesize = skb->len + sizeof(struct sk_buff); 1544 1543 skb->protocol = eth_type_trans(skb, netdev); 1545 1544 1546 1545 napi_gro_receive(&sds_ring->napi, skb); ··· 1600 1601 data_offset = l4_hdr_offset + TCP_HDR_SIZE; 1601 1602 1602 1603 skb_put(skb, lro_length + data_offset); 1603 - 1604 - skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb); 1605 1604 1606 1605 skb_pull(skb, l2_hdr_offset); 1607 1606 skb->protocol = eth_type_trans(skb, netdev);
+1 -6
drivers/net/qlcnic/qlcnic_init.c
··· 1316 1316 return -ENOMEM; 1317 1317 } 1318 1318 1319 - skb_reserve(skb, 2); 1319 + skb_reserve(skb, NET_IP_ALIGN); 1320 1320 1321 1321 dma = pci_map_single(pdev, skb->data, 1322 1322 rds_ring->dma_size, PCI_DMA_FROMDEVICE); ··· 1404 1404 if (pkt_offset) 1405 1405 skb_pull(skb, pkt_offset); 1406 1406 1407 - skb->truesize = skb->len + sizeof(struct sk_buff); 1408 1407 skb->protocol = eth_type_trans(skb, netdev); 1409 1408 1410 1409 napi_gro_receive(&sds_ring->napi, skb); ··· 1464 1465 data_offset = l4_hdr_offset + QLC_TCP_HDR_SIZE; 1465 1466 1466 1467 skb_put(skb, lro_length + data_offset); 1467 - 1468 - skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb); 1469 1468 1470 1469 skb_pull(skb, l2_hdr_offset); 1471 1470 skb->protocol = eth_type_trans(skb, netdev); ··· 1696 1699 1697 1700 if (pkt_offset) 1698 1701 skb_pull(skb, pkt_offset); 1699 - 1700 - skb->truesize = skb->len + sizeof(struct sk_buff); 1701 1702 1702 1703 if (!qlcnic_check_loopback_buff(skb->data)) 1703 1704 adapter->diag_cnt++;
+1 -1
drivers/net/rionet.c
··· 384 384 free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? 385 385 __ilog2(sizeof(void *)) + 4 : 0); 386 386 unregister_netdev(ndev); 387 - kfree(ndev); 387 + free_netdev(ndev); 388 388 389 389 list_for_each_entry_safe(peer, tmp, &rionet_peers, node) { 390 390 list_del(&peer->node);
+1 -1
drivers/net/sgiseeq.c
··· 804 804 err_out_free_page: 805 805 free_page((unsigned long) sp->srings); 806 806 err_out_free_dev: 807 - kfree(dev); 807 + free_netdev(dev); 808 808 809 809 err_out: 810 810 return err;
+1
drivers/net/smsc911x.c
··· 58 58 59 59 MODULE_LICENSE("GPL"); 60 60 MODULE_VERSION(SMSC_DRV_VERSION); 61 + MODULE_ALIAS("platform:smsc911x"); 61 62 62 63 #if USE_DEBUG > 0 63 64 static int debug = 16;
+38 -5
drivers/net/tulip/de2104x.c
··· 243 243 NWayState = (1 << 14) | (1 << 13) | (1 << 12), 244 244 NWayRestart = (1 << 12), 245 245 NonselPortActive = (1 << 9), 246 + SelPortActive = (1 << 8), 246 247 LinkFailStatus = (1 << 2), 247 248 NetCxnErr = (1 << 1), 248 249 }; ··· 364 363 365 364 /* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/ 366 365 static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, }; 367 - static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, }; 366 + static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, }; 367 + /* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */ 368 + static u16 t21041_csr14_brk[] = { 0xFF3F, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, }; 368 369 static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; 369 370 370 371 ··· 1067 1064 unsigned int carrier; 1068 1065 unsigned long flags; 1069 1066 1067 + /* clear port active bits */ 1068 + dw32(SIAStatus, NonselPortActive | SelPortActive); 1069 + 1070 1070 carrier = (status & NetCxnErr) ? 0 : 1; 1071 1071 1072 1072 if (carrier) { ··· 1164 1158 static void de_media_interrupt (struct de_private *de, u32 status) 1165 1159 { 1166 1160 if (status & LinkPass) { 1161 + /* Ignore if current media is AUI or BNC and we can't use TP */ 1162 + if ((de->media_type == DE_MEDIA_AUI || 1163 + de->media_type == DE_MEDIA_BNC) && 1164 + (de->media_lock || 1165 + !de_ok_to_advertise(de, DE_MEDIA_TP_AUTO))) 1166 + return; 1167 + /* If current media is not TP, change it to TP */ 1168 + if ((de->media_type == DE_MEDIA_AUI || 1169 + de->media_type == DE_MEDIA_BNC)) { 1170 + de->media_type = DE_MEDIA_TP_AUTO; 1171 + de_stop_rxtx(de); 1172 + de_set_media(de); 1173 + de_start_rxtx(de); 1174 + } 1167 1175 de_link_up(de); 1168 1176 mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK); 1169 1177 return; 1170 1178 } 1171 1179 1172 1180 BUG_ON(!(status & LinkFail)); 1173 - 1174 - if (netif_carrier_ok(de->dev)) { 1181 + /* Mark the link as down only if current media is TP */ 1182 + if (netif_carrier_ok(de->dev) && de->media_type != DE_MEDIA_AUI && 1183 + de->media_type != DE_MEDIA_BNC) { 1175 1184 de_link_down(de); 1176 1185 mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK); 1177 1186 } ··· 1250 1229 if (de->de21040) 1251 1230 return; 1252 1231 1232 + dw32(CSR13, 0); /* Reset phy */ 1253 1233 pci_read_config_dword(de->pdev, PCIPM, &pmctl); 1254 1234 pmctl |= PM_Sleep; 1255 1235 pci_write_config_dword(de->pdev, PCIPM, pmctl); ··· 1596 1574 return 0; /* nothing to change */ 1597 1575 1598 1576 de_link_down(de); 1577 + mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK); 1599 1578 de_stop_rxtx(de); 1600 1579 1601 1580 de->media_type = new_media; 1602 1581 de->media_lock = media_lock; 1603 1582 de->media_advertise = ecmd->advertising; 1604 1583 de_set_media(de); 1584 + if (netif_running(de->dev)) 1585 + de_start_rxtx(de); 1605 1586 1606 1587 return 0; 1607 1588 } ··· 1936 1911 for (i = 0; i < DE_MAX_MEDIA; i++) { 1937 1912 if (de->media[i].csr13 == 0xffff) 1938 1913 de->media[i].csr13 = t21041_csr13[i]; 1939 - if (de->media[i].csr14 == 0xffff) 1940 - de->media[i].csr14 = t21041_csr14[i]; 1914 + if (de->media[i].csr14 == 0xffff) { 1915 + /* autonegotiation is broken at least on some chip 1916 + revisions - rev. 0x21 works, 0x11 does not */ 1917 + if (de->pdev->revision < 0x20) 1918 + de->media[i].csr14 = t21041_csr14_brk[i]; 1919 + else 1920 + de->media[i].csr14 = t21041_csr14[i]; 1921 + } 1941 1922 if (de->media[i].csr15 == 0xffff) 1942 1923 de->media[i].csr15 = t21041_csr15[i]; 1943 1924 } ··· 2189 2158 dev_err(&dev->dev, "pci_enable_device failed in resume\n"); 2190 2159 goto out; 2191 2160 } 2161 + pci_set_master(pdev); 2162 + de_init_rings(de); 2192 2163 de_init_hw(de); 2193 2164 out_attach: 2194 2165 netif_device_attach(dev);
+1 -1
drivers/net/wireless/iwlwifi/iwl-agn-lib.c
··· 1411 1411 clear_bit(STATUS_SCAN_HW, &priv->status); 1412 1412 clear_bit(STATUS_SCANNING, &priv->status); 1413 1413 /* inform mac80211 scan aborted */ 1414 - queue_work(priv->workqueue, &priv->scan_completed); 1414 + queue_work(priv->workqueue, &priv->abort_scan); 1415 1415 } 1416 1416 1417 1417 int iwlagn_manage_ibss_station(struct iwl_priv *priv,
+5
drivers/net/wireless/iwlwifi/iwl-core.c
··· 2613 2613 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 2614 2614 return -EINVAL; 2615 2615 2616 + if (test_bit(STATUS_SCANNING, &priv->status)) { 2617 + IWL_DEBUG_INFO(priv, "scan in progress.\n"); 2618 + return -EINVAL; 2619 + } 2620 + 2616 2621 if (mode >= IWL_MAX_FORCE_RESET) { 2617 2622 IWL_DEBUG_INFO(priv, "invalid reset request.\n"); 2618 2623 return -EINVAL;
+1 -1
drivers/net/wireless/iwlwifi/iwl3945-base.c
··· 3018 3018 clear_bit(STATUS_SCANNING, &priv->status); 3019 3019 3020 3020 /* inform mac80211 scan aborted */ 3021 - queue_work(priv->workqueue, &priv->scan_completed); 3021 + queue_work(priv->workqueue, &priv->abort_scan); 3022 3022 } 3023 3023 3024 3024 static void iwl3945_bg_restart(struct work_struct *data)
+70 -47
drivers/pci/intel-iommu.c
··· 71 71 #define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32)) 72 72 #define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64)) 73 73 74 + /* page table handling */ 75 + #define LEVEL_STRIDE (9) 76 + #define LEVEL_MASK (((u64)1 << LEVEL_STRIDE) - 1) 77 + 78 + static inline int agaw_to_level(int agaw) 79 + { 80 + return agaw + 2; 81 + } 82 + 83 + static inline int agaw_to_width(int agaw) 84 + { 85 + return 30 + agaw * LEVEL_STRIDE; 86 + } 87 + 88 + static inline int width_to_agaw(int width) 89 + { 90 + return (width - 30) / LEVEL_STRIDE; 91 + } 92 + 93 + static inline unsigned int level_to_offset_bits(int level) 94 + { 95 + return (level - 1) * LEVEL_STRIDE; 96 + } 97 + 98 + static inline int pfn_level_offset(unsigned long pfn, int level) 99 + { 100 + return (pfn >> level_to_offset_bits(level)) & LEVEL_MASK; 101 + } 102 + 103 + static inline unsigned long level_mask(int level) 104 + { 105 + return -1UL << level_to_offset_bits(level); 106 + } 107 + 108 + static inline unsigned long level_size(int level) 109 + { 110 + return 1UL << level_to_offset_bits(level); 111 + } 112 + 113 + static inline unsigned long align_to_level(unsigned long pfn, int level) 114 + { 115 + return (pfn + level_size(level) - 1) & level_mask(level); 116 + } 74 117 75 118 /* VT-d pages must always be _smaller_ than MM pages. Otherwise things 76 119 are never going to work. */ ··· 477 434 } 478 435 479 436 480 - static inline int width_to_agaw(int width); 481 - 482 437 static int __iommu_calculate_agaw(struct intel_iommu *iommu, int max_gaw) 483 438 { 484 439 unsigned long sagaw; ··· 685 644 iommu->root_entry = NULL; 686 645 out: 687 646 spin_unlock_irqrestore(&iommu->lock, flags); 688 - } 689 - 690 - /* page table handling */ 691 - #define LEVEL_STRIDE (9) 692 - #define LEVEL_MASK (((u64)1 << LEVEL_STRIDE) - 1) 693 - 694 - static inline int agaw_to_level(int agaw) 695 - { 696 - return agaw + 2; 697 - } 698 - 699 - static inline int agaw_to_width(int agaw) 700 - { 701 - return 30 + agaw * LEVEL_STRIDE; 702 - 703 - } 704 - 705 - static inline int width_to_agaw(int width) 706 - { 707 - return (width - 30) / LEVEL_STRIDE; 708 - } 709 - 710 - static inline unsigned int level_to_offset_bits(int level) 711 - { 712 - return (level - 1) * LEVEL_STRIDE; 713 - } 714 - 715 - static inline int pfn_level_offset(unsigned long pfn, int level) 716 - { 717 - return (pfn >> level_to_offset_bits(level)) & LEVEL_MASK; 718 - } 719 - 720 - static inline unsigned long level_mask(int level) 721 - { 722 - return -1UL << level_to_offset_bits(level); 723 - } 724 - 725 - static inline unsigned long level_size(int level) 726 - { 727 - return 1UL << level_to_offset_bits(level); 728 - } 729 - 730 - static inline unsigned long align_to_level(unsigned long pfn, int level) 731 - { 732 - return (pfn + level_size(level) - 1) & level_mask(level); 733 647 } 734 648 735 649 static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain, ··· 3756 3760 } 3757 3761 3758 3762 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf); 3763 + 3764 + #define GGC 0x52 3765 + #define GGC_MEMORY_SIZE_MASK (0xf << 8) 3766 + #define GGC_MEMORY_SIZE_NONE (0x0 << 8) 3767 + #define GGC_MEMORY_SIZE_1M (0x1 << 8) 3768 + #define GGC_MEMORY_SIZE_2M (0x3 << 8) 3769 + #define GGC_MEMORY_VT_ENABLED (0x8 << 8) 3770 + #define GGC_MEMORY_SIZE_2M_VT (0x9 << 8) 3771 + #define GGC_MEMORY_SIZE_3M_VT (0xa << 8) 3772 + #define GGC_MEMORY_SIZE_4M_VT (0xb << 8) 3773 + 3774 + static void __devinit quirk_calpella_no_shadow_gtt(struct pci_dev *dev) 3775 + { 3776 + unsigned short ggc; 3777 + 3778 + if (pci_read_config_word(dev, GGC, &ggc)) 3779 + return; 3780 + 3781 + if (!(ggc & GGC_MEMORY_VT_ENABLED)) { 3782 + printk(KERN_INFO "DMAR: BIOS has allocated no shadow GTT; disabling IOMMU for graphics\n"); 3783 + dmar_map_gfx = 0; 3784 + } 3785 + } 3786 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0040, quirk_calpella_no_shadow_gtt); 3787 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_gtt); 3788 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt); 3789 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt); 3759 3790 3760 3791 /* On Tylersburg chipsets, some BIOSes have been known to enable the 3761 3792 ISOCH DMAR unit for the Azalia sound device, but not give it any
+1 -1
drivers/pci/iov.c
··· 608 608 * the VF BAR size multiplied by the number of VFs. The alignment 609 609 * is just the VF BAR size. 610 610 */ 611 - int pci_sriov_resource_alignment(struct pci_dev *dev, int resno) 611 + resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno) 612 612 { 613 613 struct resource tmp; 614 614 enum pci_bar_type type;
+3 -2
drivers/pci/pci.h
··· 264 264 extern void pci_iov_release(struct pci_dev *dev); 265 265 extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, 266 266 enum pci_bar_type *type); 267 - extern int pci_sriov_resource_alignment(struct pci_dev *dev, int resno); 267 + extern resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, 268 + int resno); 268 269 extern void pci_restore_iov_state(struct pci_dev *dev); 269 270 extern int pci_iov_bus_range(struct pci_bus *bus); 270 271 ··· 321 320 } 322 321 #endif /* CONFIG_PCI_IOV */ 323 322 324 - static inline int pci_resource_alignment(struct pci_dev *dev, 323 + static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, 325 324 struct resource *res) 326 325 { 327 326 #ifdef CONFIG_PCI_IOV
+20
drivers/pci/quirks.c
··· 163 163 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs); 164 164 165 165 /* 166 + * Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear 167 + * for some HT machines to use C4 w/o hanging. 168 + */ 169 + static void __devinit quirk_tigerpoint_bm_sts(struct pci_dev *dev) 170 + { 171 + u32 pmbase; 172 + u16 pm1a; 173 + 174 + pci_read_config_dword(dev, 0x40, &pmbase); 175 + pmbase = pmbase & 0xff80; 176 + pm1a = inw(pmbase); 177 + 178 + if (pm1a & 0x10) { 179 + dev_info(&dev->dev, FW_BUG "TigerPoint LPC.BM_STS cleared\n"); 180 + outw(0x10, pmbase); 181 + } 182 + } 183 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk_tigerpoint_bm_sts); 184 + 185 + /* 166 186 * Chipsets where PCI->PCI transfers vanish or hang 167 187 */ 168 188 static void __devinit quirk_nopcipci(struct pci_dev *dev)
+6
drivers/pcmcia/pcmcia_resource.c
··· 595 595 if (c->io[1].end) { 596 596 ret = alloc_io_space(s, &c->io[1], p_dev->io_lines); 597 597 if (ret) { 598 + struct resource tmp = c->io[0]; 599 + /* release the previously allocated resource */ 598 600 release_io_space(s, &c->io[0]); 601 + /* but preserve the settings, for they worked... */ 602 + c->io[0].end = resource_size(&tmp); 603 + c->io[0].start = tmp.start; 604 + c->io[0].flags = tmp.flags; 599 605 goto out; 600 606 } 601 607 } else
+1 -1
drivers/pcmcia/pd6729.c
··· 646 646 if (!pci_resource_start(dev, 0)) { 647 647 dev_warn(&dev->dev, "refusing to load the driver as the " 648 648 "io_base is NULL.\n"); 649 - goto err_out_free_mem; 649 + goto err_out_disable; 650 650 } 651 651 652 652 dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx "
+3 -2
drivers/platform/x86/thinkpad_acpi.c
··· 3093 3093 TPACPI_Q_IBM('1', 'D', TPACPI_HK_Q_INIMASK), /* X22, X23, X24 */ 3094 3094 }; 3095 3095 3096 - typedef u16 tpacpi_keymap_t[TPACPI_HOTKEY_MAP_LEN]; 3096 + typedef u16 tpacpi_keymap_entry_t; 3097 + typedef tpacpi_keymap_entry_t tpacpi_keymap_t[TPACPI_HOTKEY_MAP_LEN]; 3097 3098 3098 3099 static int __init hotkey_init(struct ibm_init_struct *iibm) 3099 3100 { ··· 3231 3230 }; 3232 3231 3233 3232 #define TPACPI_HOTKEY_MAP_SIZE sizeof(tpacpi_keymap_t) 3234 - #define TPACPI_HOTKEY_MAP_TYPESIZE sizeof(tpacpi_keymap_t[0]) 3233 + #define TPACPI_HOTKEY_MAP_TYPESIZE sizeof(tpacpi_keymap_entry_t) 3235 3234 3236 3235 int res, i; 3237 3236 int status;
+4 -2
drivers/regulator/core.c
··· 700 700 constraints->min_uA != constraints->max_uA) { 701 701 ret = _regulator_get_current_limit(rdev); 702 702 if (ret > 0) 703 - count += sprintf(buf + count, "at %d uA ", ret / 1000); 703 + count += sprintf(buf + count, "at %d mA ", ret / 1000); 704 704 } 705 705 706 706 if (constraints->valid_modes_mask & REGULATOR_MODE_FAST) ··· 2302 2302 dev_set_name(&rdev->dev, "regulator.%d", 2303 2303 atomic_inc_return(&regulator_no) - 1); 2304 2304 ret = device_register(&rdev->dev); 2305 - if (ret != 0) 2305 + if (ret != 0) { 2306 + put_device(&rdev->dev); 2306 2307 goto clean; 2308 + } 2307 2309 2308 2310 dev_set_drvdata(&rdev->dev, rdev); 2309 2311
+1 -1
drivers/regulator/max8649.c
··· 330 330 /* set external clock frequency */ 331 331 info->extclk_freq = pdata->extclk_freq; 332 332 max8649_set_bits(info->i2c, MAX8649_SYNC, MAX8649_EXT_MASK, 333 - info->extclk_freq); 333 + info->extclk_freq << 6); 334 334 } 335 335 336 336 if (pdata->ramp_timing) {
+2
drivers/rtc/rtc-ab3100.c
··· 235 235 err = PTR_ERR(rtc); 236 236 return err; 237 237 } 238 + platform_set_drvdata(pdev, rtc); 238 239 239 240 return 0; 240 241 } ··· 245 244 struct rtc_device *rtc = platform_get_drvdata(pdev); 246 245 247 246 rtc_device_unregister(rtc); 247 + platform_set_drvdata(pdev, NULL); 248 248 return 0; 249 249 } 250 250
+8 -5
drivers/rtc/rtc-s3c.c
··· 310 310 311 311 s3c_rtc_setaie(alrm->enabled); 312 312 313 - if (alrm->enabled) 314 - enable_irq_wake(s3c_rtc_alarmno); 315 - else 316 - disable_irq_wake(s3c_rtc_alarmno); 317 - 318 313 return 0; 319 314 } 320 315 ··· 582 587 ticnt_en_save &= S3C64XX_RTCCON_TICEN; 583 588 } 584 589 s3c_rtc_enable(pdev, 0); 590 + 591 + if (device_may_wakeup(&pdev->dev)) 592 + enable_irq_wake(s3c_rtc_alarmno); 593 + 585 594 return 0; 586 595 } 587 596 ··· 599 600 tmp = readb(s3c_rtc_base + S3C2410_RTCCON); 600 601 writeb(tmp | ticnt_en_save, s3c_rtc_base + S3C2410_RTCCON); 601 602 } 603 + 604 + if (device_may_wakeup(&pdev->dev)) 605 + disable_irq_wake(s3c_rtc_alarmno); 606 + 602 607 return 0; 603 608 } 604 609 #else
+2 -2
drivers/s390/net/ctcm_main.c
··· 1154 1154 dev_fsm, dev_fsm_len, GFP_KERNEL); 1155 1155 if (priv->fsm == NULL) { 1156 1156 CTCMY_DBF_DEV(SETUP, dev, "init_fsm error"); 1157 - kfree(dev); 1157 + free_netdev(dev); 1158 1158 return NULL; 1159 1159 } 1160 1160 fsm_newstate(priv->fsm, DEV_STATE_STOPPED); ··· 1165 1165 grp = ctcmpc_init_mpc_group(priv); 1166 1166 if (grp == NULL) { 1167 1167 MPC_DBF_DEV(SETUP, dev, "init_mpc_group error"); 1168 - kfree(dev); 1168 + free_netdev(dev); 1169 1169 return NULL; 1170 1170 } 1171 1171 tasklet_init(&grp->mpc_tasklet2,
+1
drivers/serial/mfd.c
··· 27 27 #include <linux/init.h> 28 28 #include <linux/console.h> 29 29 #include <linux/sysrq.h> 30 + #include <linux/slab.h> 30 31 #include <linux/serial_reg.h> 31 32 #include <linux/circ_buf.h> 32 33 #include <linux/delay.h>
+1
drivers/serial/mrst_max3110.c
··· 29 29 30 30 #include <linux/module.h> 31 31 #include <linux/ioport.h> 32 + #include <linux/irq.h> 32 33 #include <linux/init.h> 33 34 #include <linux/console.h> 34 35 #include <linux/sysrq.h>
+5
drivers/spi/spi.c
··· 23 23 #include <linux/init.h> 24 24 #include <linux/cache.h> 25 25 #include <linux/mutex.h> 26 + #include <linux/of_device.h> 26 27 #include <linux/slab.h> 27 28 #include <linux/mod_devicetable.h> 28 29 #include <linux/spi/spi.h> ··· 86 85 { 87 86 const struct spi_device *spi = to_spi_device(dev); 88 87 const struct spi_driver *sdrv = to_spi_driver(drv); 88 + 89 + /* Attempt an OF style match */ 90 + if (of_driver_match_device(dev, drv)) 91 + return 1; 89 92 90 93 if (sdrv->id_table) 91 94 return !!spi_match_id(sdrv->id_table, spi);
+1 -1
drivers/spi/spi_gpio.c
··· 350 350 spi_gpio->bitbang.master = spi_master_get(master); 351 351 spi_gpio->bitbang.chipselect = spi_gpio_chipselect; 352 352 353 - if ((master_flags & (SPI_MASTER_NO_RX | SPI_MASTER_NO_RX)) == 0) { 353 + if ((master_flags & (SPI_MASTER_NO_TX | SPI_MASTER_NO_RX)) == 0) { 354 354 spi_gpio->bitbang.txrx_word[SPI_MODE_0] = spi_gpio_txrx_word_mode0; 355 355 spi_gpio->bitbang.txrx_word[SPI_MODE_1] = spi_gpio_txrx_word_mode1; 356 356 spi_gpio->bitbang.txrx_word[SPI_MODE_2] = spi_gpio_txrx_word_mode2;
+8 -2
drivers/spi/spi_mpc8xxx.c
··· 408 408 409 409 xfer_ofs = mspi->xfer_in_progress->len - mspi->count; 410 410 411 - out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma + xfer_ofs); 411 + if (mspi->rx_dma == mspi->dma_dummy_rx) 412 + out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma); 413 + else 414 + out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma + xfer_ofs); 412 415 out_be16(&rx_bd->cbd_datlen, 0); 413 416 out_be16(&rx_bd->cbd_sc, BD_SC_EMPTY | BD_SC_INTRPT | BD_SC_WRAP); 414 417 415 - out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma + xfer_ofs); 418 + if (mspi->tx_dma == mspi->dma_dummy_tx) 419 + out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma); 420 + else 421 + out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma + xfer_ofs); 416 422 out_be16(&tx_bd->cbd_datlen, xfer_len); 417 423 out_be16(&tx_bd->cbd_sc, BD_SC_READY | BD_SC_INTRPT | BD_SC_WRAP | 418 424 BD_SC_LAST);
-1
drivers/staging/ti-st/st.h
··· 80 80 extern long st_register(struct st_proto_s *); 81 81 extern long st_unregister(enum proto_type); 82 82 83 - extern struct platform_device *st_get_plat_device(void); 84 83 #endif /* ST_H */
+4 -5
drivers/staging/ti-st/st_core.c
··· 38 38 #include "st_ll.h" 39 39 #include "st.h" 40 40 41 - #define VERBOSE 42 41 /* strings to be used for rfkill entries and by 43 42 * ST Core to be used for sysfs debug entry 44 43 */ ··· 580 581 long err = 0; 581 582 unsigned long flags = 0; 582 583 583 - st_kim_ref(&st_gdata); 584 + st_kim_ref(&st_gdata, 0); 584 585 pr_info("%s(%d) ", __func__, new_proto->type); 585 586 if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL 586 587 || new_proto->reg_complete_cb == NULL) { ··· 712 713 713 714 pr_debug("%s: %d ", __func__, type); 714 715 715 - st_kim_ref(&st_gdata); 716 + st_kim_ref(&st_gdata, 0); 716 717 if (type < ST_BT || type >= ST_MAX) { 717 718 pr_err(" protocol %d not supported", type); 718 719 return -EPROTONOSUPPORT; ··· 766 767 #endif 767 768 long len; 768 769 769 - st_kim_ref(&st_gdata); 770 + st_kim_ref(&st_gdata, 0); 770 771 if (unlikely(skb == NULL || st_gdata == NULL 771 772 || st_gdata->tty == NULL)) { 772 773 pr_err("data/tty unavailable to perform write"); ··· 817 818 struct st_data_s *st_gdata; 818 819 pr_info("%s ", __func__); 819 820 820 - st_kim_ref(&st_gdata); 821 + st_kim_ref(&st_gdata, 0); 821 822 st_gdata->tty = tty; 822 823 tty->disc_data = st_gdata; 823 824
+1 -1
drivers/staging/ti-st/st_core.h
··· 117 117 void st_core_exit(struct st_data_s *); 118 118 119 119 /* ask for reference from KIM */ 120 - void st_kim_ref(struct st_data_s **); 120 + void st_kim_ref(struct st_data_s **, int); 121 121 122 122 #define GPS_STUB_TEST 123 123 #ifdef GPS_STUB_TEST
+19 -3
drivers/staging/ti-st/st_kim.c
··· 72 72 PROTO_ENTRY(ST_GPS, "GPS"), 73 73 }; 74 74 75 + #define MAX_ST_DEVICES 3 /* Imagine 1 on each UART for now */ 76 + struct platform_device *st_kim_devices[MAX_ST_DEVICES]; 75 77 76 78 /**********************************************************************/ 77 79 /* internal functions */ 80 + 81 + /** 82 + * st_get_plat_device - 83 + * function which returns the reference to the platform device 84 + * requested by id. As of now only 1 such device exists (id=0) 85 + * the context requesting for reference can get the id to be 86 + * requested by a. The protocol driver which is registering or 87 + * b. the tty device which is opened. 88 + */ 89 + static struct platform_device *st_get_plat_device(int id) 90 + { 91 + return st_kim_devices[id]; 92 + } 78 93 79 94 /** 80 95 * validate_firmware_response - ··· 368 353 struct kim_data_s *kim_gdata; 369 354 pr_info(" %s ", __func__); 370 355 371 - kim_pdev = st_get_plat_device(); 356 + kim_pdev = st_get_plat_device(0); 372 357 kim_gdata = dev_get_drvdata(&kim_pdev->dev); 373 358 374 359 if (kim_gdata->gpios[type] == -1) { ··· 589 574 * This would enable multiple such platform devices to exist 590 575 * on a given platform 591 576 */ 592 - void st_kim_ref(struct st_data_s **core_data) 577 + void st_kim_ref(struct st_data_s **core_data, int id) 593 578 { 594 579 struct platform_device *pdev; 595 580 struct kim_data_s *kim_gdata; 596 581 /* get kim_gdata reference from platform device */ 597 - pdev = st_get_plat_device(); 582 + pdev = st_get_plat_device(id); 598 583 kim_gdata = dev_get_drvdata(&pdev->dev); 599 584 *core_data = kim_gdata->core_data; 600 585 } ··· 638 623 long *gpios = pdev->dev.platform_data; 639 624 struct kim_data_s *kim_gdata; 640 625 626 + st_kim_devices[pdev->id] = pdev; 641 627 kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_ATOMIC); 642 628 if (!kim_gdata) { 643 629 pr_err("no mem to allocate");
+3 -3
drivers/usb/core/Kconfig
··· 91 91 If you are unsure about this, say N here. 92 92 93 93 config USB_SUSPEND 94 - bool "USB runtime power management (suspend/resume and wakeup)" 94 + bool "USB runtime power management (autosuspend) and wakeup" 95 95 depends on USB && PM_RUNTIME 96 96 help 97 97 If you say Y here, you can use driver calls or the sysfs 98 - "power/level" file to suspend or resume individual USB 99 - peripherals and to enable or disable autosuspend (see 98 + "power/control" file to enable or disable autosuspend for 99 + individual USB peripherals (see 100 100 Documentation/usb/power-management.txt for more details). 101 101 102 102 Also, USB "remote wakeup" signaling is supported, whereby some
+16 -19
drivers/usb/core/file.c
··· 159 159 int usb_register_dev(struct usb_interface *intf, 160 160 struct usb_class_driver *class_driver) 161 161 { 162 - int retval = -EINVAL; 162 + int retval; 163 163 int minor_base = class_driver->minor_base; 164 - int minor = 0; 164 + int minor; 165 165 char name[20]; 166 166 char *temp; 167 167 ··· 173 173 */ 174 174 minor_base = 0; 175 175 #endif 176 - intf->minor = -1; 177 - 178 - dbg ("looking for a minor, starting at %d", minor_base); 179 176 180 177 if (class_driver->fops == NULL) 181 - goto exit; 178 + return -EINVAL; 179 + if (intf->minor >= 0) 180 + return -EADDRINUSE; 181 + 182 + retval = init_usb_class(); 183 + if (retval) 184 + return retval; 185 + 186 + dev_dbg(&intf->dev, "looking for a minor, starting at %d", minor_base); 182 187 183 188 down_write(&minor_rwsem); 184 189 for (minor = minor_base; minor < MAX_USB_MINORS; ++minor) { ··· 191 186 continue; 192 187 193 188 usb_minors[minor] = class_driver->fops; 194 - 195 - retval = 0; 189 + intf->minor = minor; 196 190 break; 197 191 } 198 192 up_write(&minor_rwsem); 199 - 200 - if (retval) 201 - goto exit; 202 - 203 - retval = init_usb_class(); 204 - if (retval) 205 - goto exit; 206 - 207 - intf->minor = minor; 193 + if (intf->minor < 0) 194 + return -EXFULL; 208 195 209 196 /* create a usb class device for this usb interface */ 210 197 snprintf(name, sizeof(name), class_driver->name, minor - minor_base); ··· 210 213 "%s", temp); 211 214 if (IS_ERR(intf->usb_dev)) { 212 215 down_write(&minor_rwsem); 213 - usb_minors[intf->minor] = NULL; 216 + usb_minors[minor] = NULL; 217 + intf->minor = -1; 214 218 up_write(&minor_rwsem); 215 219 retval = PTR_ERR(intf->usb_dev); 216 220 } 217 - exit: 218 221 return retval; 219 222 } 220 223 EXPORT_SYMBOL_GPL(usb_register_dev);
+1
drivers/usb/core/message.c
··· 1802 1802 intf->dev.groups = usb_interface_groups; 1803 1803 intf->dev.dma_mask = dev->dev.dma_mask; 1804 1804 INIT_WORK(&intf->reset_ws, __usb_queue_reset_device); 1805 + intf->minor = -1; 1805 1806 device_initialize(&intf->dev); 1806 1807 dev_set_name(&intf->dev, "%d-%s:%d.%d", 1807 1808 dev->bus->busnum, dev->devpath,
+1
drivers/usb/musb/cppi_dma.c
··· 322 322 index, transmit ? 'T' : 'R', cppi_ch); 323 323 cppi_ch->hw_ep = ep; 324 324 cppi_ch->channel.status = MUSB_DMA_STATUS_FREE; 325 + cppi_ch->channel.max_len = 0x7fffffff; 325 326 326 327 DBG(4, "Allocate CPPI%d %cX\n", index, transmit ? 'T' : 'R'); 327 328 return &cppi_ch->channel;
+39 -36
drivers/usb/musb/musb_gadget.c
··· 300 300 #ifndef CONFIG_MUSB_PIO_ONLY 301 301 if (is_dma_capable() && musb_ep->dma) { 302 302 struct dma_controller *c = musb->dma_controller; 303 + size_t request_size; 304 + 305 + /* setup DMA, then program endpoint CSR */ 306 + request_size = min_t(size_t, request->length - request->actual, 307 + musb_ep->dma->max_len); 303 308 304 309 use_dma = (request->dma != DMA_ADDR_INVALID); 305 310 ··· 312 307 313 308 #ifdef CONFIG_USB_INVENTRA_DMA 314 309 { 315 - size_t request_size; 316 - 317 - /* setup DMA, then program endpoint CSR */ 318 - request_size = min_t(size_t, request->length, 319 - musb_ep->dma->max_len); 320 310 if (request_size < musb_ep->packet_sz) 321 311 musb_ep->dma->desired_mode = 0; 322 312 else ··· 373 373 use_dma = use_dma && c->channel_program( 374 374 musb_ep->dma, musb_ep->packet_sz, 375 375 0, 376 - request->dma, 377 - request->length); 376 + request->dma + request->actual, 377 + request_size); 378 378 if (!use_dma) { 379 379 c->channel_release(musb_ep->dma); 380 380 musb_ep->dma = NULL; ··· 386 386 use_dma = use_dma && c->channel_program( 387 387 musb_ep->dma, musb_ep->packet_sz, 388 388 request->zero, 389 - request->dma, 390 - request->length); 389 + request->dma + request->actual, 390 + request_size); 391 391 #endif 392 392 } 393 393 #endif ··· 501 501 request->zero = 0; 502 502 } 503 503 504 - /* ... or if not, then complete it. */ 505 - musb_g_giveback(musb_ep, request, 0); 506 - 507 - /* 508 - * Kickstart next transfer if appropriate; 509 - * the packet that just completed might not 510 - * be transmitted for hours or days. 511 - * REVISIT for double buffering... 512 - * FIXME revisit for stalls too... 513 - */ 514 - musb_ep_select(mbase, epnum); 515 - csr = musb_readw(epio, MUSB_TXCSR); 516 - if (csr & MUSB_TXCSR_FIFONOTEMPTY) 517 - return; 518 - 519 - request = musb_ep->desc ? next_request(musb_ep) : NULL; 520 - if (!request) { 521 - DBG(4, "%s idle now\n", 522 - musb_ep->end_point.name); 523 - return; 504 + if (request->actual == request->length) { 505 + musb_g_giveback(musb_ep, request, 0); 506 + request = musb_ep->desc ? next_request(musb_ep) : NULL; 507 + if (!request) { 508 + DBG(4, "%s idle now\n", 509 + musb_ep->end_point.name); 510 + return; 511 + } 524 512 } 525 513 } 526 514 ··· 556 568 { 557 569 const u8 epnum = req->epnum; 558 570 struct usb_request *request = &req->request; 559 - struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; 571 + struct musb_ep *musb_ep; 560 572 void __iomem *epio = musb->endpoints[epnum].regs; 561 573 unsigned fifo_count = 0; 562 - u16 len = musb_ep->packet_sz; 574 + u16 len; 563 575 u16 csr = musb_readw(epio, MUSB_RXCSR); 576 + struct musb_hw_ep *hw_ep = &musb->endpoints[epnum]; 577 + 578 + if (hw_ep->is_shared_fifo) 579 + musb_ep = &hw_ep->ep_in; 580 + else 581 + musb_ep = &hw_ep->ep_out; 582 + 583 + len = musb_ep->packet_sz; 564 584 565 585 /* We shouldn't get here while DMA is active, but we do... */ 566 586 if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) { ··· 643 647 */ 644 648 645 649 csr |= MUSB_RXCSR_DMAENAB; 646 - #ifdef USE_MODE1 647 650 csr |= MUSB_RXCSR_AUTOCLEAR; 651 + #ifdef USE_MODE1 648 652 /* csr |= MUSB_RXCSR_DMAMODE; */ 649 653 650 654 /* this special sequence (enabling and then ··· 659 663 if (request->actual < request->length) { 660 664 int transfer_size = 0; 661 665 #ifdef USE_MODE1 662 - transfer_size = min(request->length, 666 + transfer_size = min(request->length - request->actual, 663 667 channel->max_len); 664 668 #else 665 - transfer_size = len; 669 + transfer_size = min(request->length - request->actual, 670 + (unsigned)len); 666 671 #endif 667 672 if (transfer_size <= musb_ep->packet_sz) 668 673 musb_ep->dma->desired_mode = 0; ··· 737 740 u16 csr; 738 741 struct usb_request *request; 739 742 void __iomem *mbase = musb->mregs; 740 - struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; 743 + struct musb_ep *musb_ep; 741 744 void __iomem *epio = musb->endpoints[epnum].regs; 742 745 struct dma_channel *dma; 746 + struct musb_hw_ep *hw_ep = &musb->endpoints[epnum]; 747 + 748 + if (hw_ep->is_shared_fifo) 749 + musb_ep = &hw_ep->ep_in; 750 + else 751 + musb_ep = &hw_ep->ep_out; 743 752 744 753 musb_ep_select(mbase, epnum); 745 754 ··· 1084 1081 /* 1085 1082 * Context: controller locked, IRQs blocked. 1086 1083 */ 1087 - static void musb_ep_restart(struct musb *musb, struct musb_request *req) 1084 + void musb_ep_restart(struct musb *musb, struct musb_request *req) 1088 1085 { 1089 1086 DBG(3, "<== %s request %p len %u on hw_ep%d\n", 1090 1087 req->tx ? "TX/IN" : "RX/OUT",
+2
drivers/usb/musb/musb_gadget.h
··· 105 105 106 106 extern void musb_g_giveback(struct musb_ep *, struct usb_request *, int); 107 107 108 + extern void musb_ep_restart(struct musb *, struct musb_request *); 109 + 108 110 #endif /* __MUSB_GADGET_H */
+9
drivers/usb/musb/musb_gadget_ep0.c
··· 261 261 ctrlrequest->wIndex & 0x0f; 262 262 struct musb_ep *musb_ep; 263 263 struct musb_hw_ep *ep; 264 + struct musb_request *request; 264 265 void __iomem *regs; 265 266 int is_in; 266 267 u16 csr; ··· 301 300 csr &= ~(MUSB_RXCSR_P_SENDSTALL | 302 301 MUSB_RXCSR_P_SENTSTALL); 303 302 musb_writew(regs, MUSB_RXCSR, csr); 303 + } 304 + 305 + /* Maybe start the first request in the queue */ 306 + request = to_musb_request( 307 + next_request(musb_ep)); 308 + if (!musb_ep->busy && request) { 309 + DBG(3, "restarting the request\n"); 310 + musb_ep_restart(musb, request); 304 311 } 305 312 306 313 /* select ep0 again */
+6
drivers/usb/musb/musb_host.c
··· 660 660 661 661 qh->segsize = length; 662 662 663 + /* 664 + * Ensure the data reaches to main memory before starting 665 + * DMA transfer 666 + */ 667 + wmb(); 668 + 663 669 if (!dma->channel_program(channel, pkt_size, mode, 664 670 urb->transfer_dma + offset, length)) { 665 671 dma->channel_release(channel);
+1 -1
drivers/vhost/net.c
··· 243 243 int r, nlogs = 0; 244 244 245 245 while (datalen > 0) { 246 - if (unlikely(headcount >= VHOST_NET_MAX_SG)) { 246 + if (unlikely(seg >= VHOST_NET_MAX_SG)) { 247 247 r = -ENOBUFS; 248 248 goto err; 249 249 }
+4 -3
drivers/vhost/vhost.c
··· 858 858 if (r < 0) 859 859 return r; 860 860 len -= l; 861 - if (!len) 861 + if (!len) { 862 + if (vq->log_ctx) 863 + eventfd_signal(vq->log_ctx, 1); 862 864 return 0; 865 + } 863 866 } 864 - if (vq->log_ctx) 865 - eventfd_signal(vq->log_ctx, 1); 866 867 /* Length written exceeds what we have stored. This is a bug. */ 867 868 BUG(); 868 869 return 0;
+3 -2
drivers/video/console/fbcon.c
··· 3508 3508 softback_buf = 0UL; 3509 3509 3510 3510 for (i = 0; i < FB_MAX; i++) { 3511 - int pending; 3511 + int pending = 0; 3512 3512 3513 3513 mapped = 0; 3514 3514 info = registered_fb[i]; ··· 3516 3516 if (info == NULL) 3517 3517 continue; 3518 3518 3519 - pending = cancel_work_sync(&info->queue); 3519 + if (info->queue.func) 3520 + pending = cancel_work_sync(&info->queue); 3520 3521 DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" : 3521 3522 "no")); 3522 3523
+91 -12
drivers/video/efifb.c
··· 13 13 #include <linux/platform_device.h> 14 14 #include <linux/screen_info.h> 15 15 #include <linux/dmi.h> 16 - 16 + #include <linux/pci.h> 17 17 #include <video/vga.h> 18 18 19 19 static struct fb_var_screeninfo efifb_defined __devinitdata = { ··· 39 39 M_I20, /* 20-Inch iMac */ 40 40 M_I20_SR, /* 20-Inch iMac (Santa Rosa) */ 41 41 M_I24, /* 24-Inch iMac */ 42 + M_I24_8_1, /* 24-Inch iMac, 8,1th gen */ 43 + M_I24_10_1, /* 24-Inch iMac, 10,1th gen */ 44 + M_I27_11_1, /* 27-Inch iMac, 11,1th gen */ 42 45 M_MINI, /* Mac Mini */ 46 + M_MINI_3_1, /* Mac Mini, 3,1th gen */ 47 + M_MINI_4_1, /* Mac Mini, 4,1th gen */ 43 48 M_MB, /* MacBook */ 44 49 M_MB_2, /* MacBook, 2nd rev. */ 45 50 M_MB_3, /* MacBook, 3rd rev. */ 51 + M_MB_5_1, /* MacBook, 5th rev. */ 52 + M_MB_6_1, /* MacBook, 6th rev. */ 53 + M_MB_7_1, /* MacBook, 7th rev. */ 46 54 M_MB_SR, /* MacBook, 2nd gen, (Santa Rosa) */ 47 55 M_MBA, /* MacBook Air */ 48 56 M_MBP, /* MacBook Pro */ 49 57 M_MBP_2, /* MacBook Pro 2nd gen */ 58 + M_MBP_2_2, /* MacBook Pro 2,2nd gen */ 50 59 M_MBP_SR, /* MacBook Pro (Santa Rosa) */ 51 60 M_MBP_4, /* MacBook Pro, 4th gen */ 52 61 M_MBP_5_1, /* MacBook Pro, 5,1th gen */ 62 + M_MBP_5_2, /* MacBook Pro, 5,2th gen */ 63 + M_MBP_5_3, /* MacBook Pro, 5,3rd gen */ 64 + M_MBP_6_1, /* MacBook Pro, 6,1th gen */ 65 + M_MBP_6_2, /* MacBook Pro, 6,2th gen */ 66 + M_MBP_7_1, /* MacBook Pro, 7,1th gen */ 53 67 M_UNKNOWN /* placeholder */ 54 68 }; 55 69 ··· 78 64 [M_I20] = { "i20", 0x80010000, 1728 * 4, 1680, 1050 }, /* guess */ 79 65 [M_I20_SR] = { "imac7", 0x40010000, 1728 * 4, 1680, 1050 }, 80 66 [M_I24] = { "i24", 0x80010000, 2048 * 4, 1920, 1200 }, /* guess */ 67 + [M_I24_8_1] = { "imac8", 0xc0060000, 2048 * 4, 1920, 1200 }, 68 + [M_I24_10_1] = { "imac10", 0xc0010000, 2048 * 4, 1920, 1080 }, 69 + [M_I27_11_1] = { "imac11", 0xc0010000, 2560 * 4, 2560, 1440 }, 81 70 [M_MINI]= { "mini", 0x80000000, 2048 * 4, 1024, 768 }, 71 + [M_MINI_3_1] = { "mini31", 0x40010000, 1024 * 4, 1024, 768 }, 72 + [M_MINI_4_1] = { "mini41", 0xc0010000, 2048 * 4, 1920, 1200 }, 82 73 [M_MB] = { "macbook", 0x80000000, 2048 * 4, 1280, 800 }, 74 + [M_MB_5_1] = { "macbook51", 0x80010000, 2048 * 4, 1280, 800 }, 75 + [M_MB_6_1] = { "macbook61", 0x80010000, 2048 * 4, 1280, 800 }, 76 + [M_MB_7_1] = { "macbook71", 0x80010000, 2048 * 4, 1280, 800 }, 83 77 [M_MBA] = { "mba", 0x80000000, 2048 * 4, 1280, 800 }, 84 78 [M_MBP] = { "mbp", 0x80010000, 1472 * 4, 1440, 900 }, 85 79 [M_MBP_2] = { "mbp2", 0, 0, 0, 0 }, /* placeholder */ 80 + [M_MBP_2_2] = { "mbp22", 0x80010000, 1472 * 4, 1440, 900 }, 86 81 [M_MBP_SR] = { "mbp3", 0x80030000, 2048 * 4, 1440, 900 }, 87 82 [M_MBP_4] = { "mbp4", 0xc0060000, 2048 * 4, 1920, 1200 }, 88 83 [M_MBP_5_1] = { "mbp51", 0xc0010000, 2048 * 4, 1440, 900 }, 84 + [M_MBP_5_2] = { "mbp52", 0xc0010000, 2048 * 4, 1920, 1200 }, 85 + [M_MBP_5_3] = { "mbp53", 0xd0010000, 2048 * 4, 1440, 900 }, 86 + [M_MBP_6_1] = { "mbp61", 0x90030000, 2048 * 4, 1920, 1200 }, 87 + [M_MBP_6_2] = { "mbp62", 0x90030000, 2048 * 4, 1680, 1050 }, 88 + [M_MBP_7_1] = { "mbp71", 0xc0010000, 2048 * 4, 1280, 800 }, 89 89 [M_UNKNOWN] = { NULL, 0, 0, 0, 0 } 90 90 }; 91 91 ··· 120 92 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "iMac6,1", M_I24), 121 93 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac6,1", M_I24), 122 94 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac7,1", M_I20_SR), 95 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac8,1", M_I24_8_1), 96 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac10,1", M_I24_10_1), 97 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac11,1", M_I27_11_1), 123 98 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "Macmini1,1", M_MINI), 99 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "Macmini3,1", M_MINI_3_1), 100 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "Macmini4,1", M_MINI_4_1), 124 101 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook1,1", M_MB), 125 102 /* At least one of these two will be right; maybe both? */ 126 103 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook2,1", M_MB), ··· 134 101 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook3,1", M_MB), 135 102 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook3,1", M_MB), 136 103 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook4,1", M_MB), 104 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook5,1", M_MB_5_1), 105 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook6,1", M_MB_6_1), 106 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook7,1", M_MB_7_1), 137 107 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookAir1,1", M_MBA), 138 108 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro1,1", M_MBP), 139 109 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,1", M_MBP_2), 110 + EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,2", M_MBP_2_2), 140 111 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro2,1", M_MBP_2), 141 112 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro3,1", M_MBP_SR), 142 113 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro3,1", M_MBP_SR), 143 114 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro4,1", M_MBP_4), 144 115 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,1", M_MBP_5_1), 116 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,2", M_MBP_5_2), 117 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,3", M_MBP_5_3), 118 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro6,1", M_MBP_6_1), 119 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro6,2", M_MBP_6_2), 120 + EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro7,1", M_MBP_7_1), 145 121 {}, 146 122 }; 147 123 ··· 158 116 { 159 117 struct efifb_dmi_info *info = id->driver_data; 160 118 if (info->base == 0) 161 - return -ENODEV; 119 + return 0; 162 120 163 121 printk(KERN_INFO "efifb: dmi detected %s - framebuffer at %p " 164 122 "(%dx%d, stride %d)\n", id->ident, ··· 166 124 info->stride); 167 125 168 126 /* Trust the bootloader over the DMI tables */ 169 - if (screen_info.lfb_base == 0) 127 + if (screen_info.lfb_base == 0) { 128 + #if defined(CONFIG_PCI) 129 + struct pci_dev *dev = NULL; 130 + int found_bar = 0; 131 + #endif 170 132 screen_info.lfb_base = info->base; 171 - if (screen_info.lfb_linelength == 0) 172 - screen_info.lfb_linelength = info->stride; 173 - if (screen_info.lfb_width == 0) 174 - screen_info.lfb_width = info->width; 175 - if (screen_info.lfb_height == 0) 176 - screen_info.lfb_height = info->height; 177 - if (screen_info.orig_video_isVGA == 0) 178 - screen_info.orig_video_isVGA = VIDEO_TYPE_EFI; 179 133 180 - return 0; 134 + #if defined(CONFIG_PCI) 135 + /* make sure that the address in the table is actually on a 136 + * VGA device's PCI BAR */ 137 + 138 + for_each_pci_dev(dev) { 139 + int i; 140 + if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) 141 + continue; 142 + for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 143 + resource_size_t start, end; 144 + 145 + start = pci_resource_start(dev, i); 146 + if (start == 0) 147 + break; 148 + end = pci_resource_end(dev, i); 149 + if (screen_info.lfb_base >= start && 150 + screen_info.lfb_base < end) { 151 + found_bar = 1; 152 + } 153 + } 154 + } 155 + if (!found_bar) 156 + screen_info.lfb_base = 0; 157 + #endif 158 + } 159 + if (screen_info.lfb_base) { 160 + if (screen_info.lfb_linelength == 0) 161 + screen_info.lfb_linelength = info->stride; 162 + if (screen_info.lfb_width == 0) 163 + screen_info.lfb_width = info->width; 164 + if (screen_info.lfb_height == 0) 165 + screen_info.lfb_height = info->height; 166 + if (screen_info.orig_video_isVGA == 0) 167 + screen_info.orig_video_isVGA = VIDEO_TYPE_EFI; 168 + } else { 169 + screen_info.lfb_linelength = 0; 170 + screen_info.lfb_width = 0; 171 + screen_info.lfb_height = 0; 172 + screen_info.orig_video_isVGA = 0; 173 + return 0; 174 + } 175 + return 1; 181 176 } 182 177 183 178 static int efifb_setcolreg(unsigned regno, unsigned red, unsigned green,
+2 -2
drivers/video/pxa168fb.c
··· 298 298 * Set bit to enable graphics DMA. 299 299 */ 300 300 x = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0); 301 - x |= fbi->active ? 0x00000100 : 0; 302 - fbi->active = 0; 301 + x &= ~CFG_GRA_ENA_MASK; 302 + x |= fbi->active ? CFG_GRA_ENA(1) : CFG_GRA_ENA(0); 303 303 304 304 /* 305 305 * If we are in a pseudo-color mode, we need to enable
+3
drivers/video/sis/sis_main.c
··· 1701 1701 break; 1702 1702 1703 1703 case FBIOGET_VBLANK: 1704 + 1705 + memset(&sisvbblank, 0, sizeof(struct fb_vblank)); 1706 + 1704 1707 sisvbblank.count = 0; 1705 1708 sisvbblank.flags = sisfb_setupvbblankflags(ivideo, &sisvbblank.vcount, &sisvbblank.hcount); 1706 1709
+6 -3
drivers/xen/xenbus/xenbus_probe.c
··· 755 755 { 756 756 int ret = 0; 757 757 758 - blocking_notifier_chain_register(&xenstore_chain, nb); 758 + if (xenstored_ready > 0) 759 + ret = nb->notifier_call(nb, 0, NULL); 760 + else 761 + blocking_notifier_chain_register(&xenstore_chain, nb); 759 762 760 763 return ret; 761 764 } ··· 772 769 773 770 void xenbus_probe(struct work_struct *unused) 774 771 { 775 - BUG_ON((xenstored_ready <= 0)); 772 + xenstored_ready = 1; 776 773 777 774 /* Enumerate devices in xenstore and watch for changes. */ 778 775 xenbus_probe_devices(&xenbus_frontend); ··· 838 835 xen_store_evtchn = xen_start_info->store_evtchn; 839 836 xen_store_mfn = xen_start_info->store_mfn; 840 837 xen_store_interface = mfn_to_virt(xen_store_mfn); 838 + xenstored_ready = 1; 841 839 } 842 - xenstored_ready = 1; 843 840 } 844 841 845 842 /* Initialize the interface to xenstore. */
+9 -1
fs/aio.c
··· 712 712 */ 713 713 ret = retry(iocb); 714 714 715 - if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) 715 + if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) { 716 + /* 717 + * There's no easy way to restart the syscall since other AIO's 718 + * may be already running. Just fail this IO with EINTR. 719 + */ 720 + if (unlikely(ret == -ERESTARTSYS || ret == -ERESTARTNOINTR || 721 + ret == -ERESTARTNOHAND || ret == -ERESTART_RESTARTBLOCK)) 722 + ret = -EINTR; 716 723 aio_complete(iocb, ret, 0); 724 + } 717 725 out: 718 726 spin_lock_irq(&ctx->ctx_lock); 719 727
+33 -16
fs/cifs/cifssmb.c
··· 232 232 small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, 233 233 void **request_buf) 234 234 { 235 - int rc = 0; 235 + int rc; 236 236 237 237 rc = cifs_reconnect_tcon(tcon, smb_command); 238 238 if (rc) ··· 250 250 if (tcon != NULL) 251 251 cifs_stats_inc(&tcon->num_smbs_sent); 252 252 253 - return rc; 253 + return 0; 254 254 } 255 255 256 256 int ··· 281 281 282 282 /* If the return code is zero, this function must fill in request_buf pointer */ 283 283 static int 284 - smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, 285 - void **request_buf /* returned */ , 286 - void **response_buf /* returned */ ) 284 + __smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, 285 + void **request_buf, void **response_buf) 287 286 { 288 - int rc = 0; 289 - 290 - rc = cifs_reconnect_tcon(tcon, smb_command); 291 - if (rc) 292 - return rc; 293 - 294 287 *request_buf = cifs_buf_get(); 295 288 if (*request_buf == NULL) { 296 289 /* BB should we add a retry in here if not a writepage? */ ··· 302 309 if (tcon != NULL) 303 310 cifs_stats_inc(&tcon->num_smbs_sent); 304 311 305 - return rc; 312 + return 0; 313 + } 314 + 315 + /* If the return code is zero, this function must fill in request_buf pointer */ 316 + static int 317 + smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, 318 + void **request_buf, void **response_buf) 319 + { 320 + int rc; 321 + 322 + rc = cifs_reconnect_tcon(tcon, smb_command); 323 + if (rc) 324 + return rc; 325 + 326 + return __smb_init(smb_command, wct, tcon, request_buf, response_buf); 327 + } 328 + 329 + static int 330 + smb_init_no_reconnect(int smb_command, int wct, struct cifsTconInfo *tcon, 331 + void **request_buf, void **response_buf) 332 + { 333 + if (tcon->ses->need_reconnect || tcon->need_reconnect) 334 + return -EHOSTDOWN; 335 + 336 + return __smb_init(smb_command, wct, tcon, request_buf, response_buf); 306 337 } 307 338 308 339 static int validate_t2(struct smb_t2_rsp *pSMB) ··· 4551 4534 4552 4535 cFYI(1, "In QFSUnixInfo"); 4553 4536 QFSUnixRetry: 4554 - rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4555 - (void **) &pSMBr); 4537 + rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon, 4538 + (void **) &pSMB, (void **) &pSMBr); 4556 4539 if (rc) 4557 4540 return rc; 4558 4541 ··· 4621 4604 cFYI(1, "In SETFSUnixInfo"); 4622 4605 SETFSUnixRetry: 4623 4606 /* BB switch to small buf init to save memory */ 4624 - rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4625 - (void **) &pSMBr); 4607 + rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon, 4608 + (void **) &pSMB, (void **) &pSMBr); 4626 4609 if (rc) 4627 4610 return rc; 4628 4611
+2
fs/cifs/inode.c
··· 801 801 inode->i_flags |= S_NOATIME | S_NOCMTIME; 802 802 if (inode->i_state & I_NEW) { 803 803 inode->i_ino = hash; 804 + if (S_ISREG(inode->i_mode)) 805 + inode->i_data.backing_dev_info = sb->s_bdi; 804 806 #ifdef CONFIG_CIFS_FSCACHE 805 807 /* initialize per-inode cache cookie pointer */ 806 808 CIFS_I(inode)->fscache = NULL;
+1 -1
fs/compat.c
··· 1153 1153 { 1154 1154 compat_ssize_t tot_len; 1155 1155 struct iovec iovstack[UIO_FASTIOV]; 1156 - struct iovec *iov; 1156 + struct iovec *iov = iovstack; 1157 1157 ssize_t ret; 1158 1158 io_fn_t fn; 1159 1159 iov_fn_t fnv;
+4 -15
fs/fs-writeback.c
··· 72 72 static inline struct backing_dev_info *inode_to_bdi(struct inode *inode) 73 73 { 74 74 struct super_block *sb = inode->i_sb; 75 - struct backing_dev_info *bdi = inode->i_mapping->backing_dev_info; 76 75 77 - /* 78 - * For inodes on standard filesystems, we use superblock's bdi. For 79 - * inodes on virtual filesystems, we want to use inode mapping's bdi 80 - * because they can possibly point to something useful (think about 81 - * block_dev filesystem). 82 - */ 83 - if (sb->s_bdi && sb->s_bdi != &noop_backing_dev_info) { 84 - /* Some device inodes could play dirty tricks. Catch them... */ 85 - WARN(bdi != sb->s_bdi && bdi_cap_writeback_dirty(bdi), 86 - "Dirtiable inode bdi %s != sb bdi %s\n", 87 - bdi->name, sb->s_bdi->name); 88 - return sb->s_bdi; 89 - } 90 - return bdi; 76 + if (strcmp(sb->s_type->name, "bdev") == 0) 77 + return inode->i_mapping->backing_dev_info; 78 + 79 + return sb->s_bdi; 91 80 } 92 81 93 82 static void bdi_queue_work(struct backing_dev_info *bdi,
+1 -1
fs/fuse/dev.c
··· 1354 1354 loff_t file_size; 1355 1355 unsigned int num; 1356 1356 unsigned int offset; 1357 - size_t total_len; 1357 + size_t total_len = 0; 1358 1358 1359 1359 req = fuse_get_req(fc); 1360 1360 if (IS_ERR(req))
+3
fs/ocfs2/acl.c
··· 209 209 } 210 210 211 211 inode->i_mode = new_mode; 212 + inode->i_ctime = CURRENT_TIME; 212 213 di->i_mode = cpu_to_le16(inode->i_mode); 214 + di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); 215 + di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); 213 216 214 217 ocfs2_journal_dirty(handle, di_bh); 215 218
+1 -1
fs/ocfs2/cluster/tcp.c
··· 977 977 int o2net_send_message_vec(u32 msg_type, u32 key, struct kvec *caller_vec, 978 978 size_t caller_veclen, u8 target_node, int *status) 979 979 { 980 - int ret; 980 + int ret = 0; 981 981 struct o2net_msg *msg = NULL; 982 982 size_t veclen, caller_bytes = 0; 983 983 struct kvec *vec = NULL;
+16 -8
fs/ocfs2/dir.c
··· 3931 3931 goto out_commit; 3932 3932 } 3933 3933 3934 + cpos = split_hash; 3935 + ret = ocfs2_dx_dir_new_cluster(dir, &et, cpos, handle, 3936 + data_ac, meta_ac, new_dx_leaves, 3937 + num_dx_leaves); 3938 + if (ret) { 3939 + mlog_errno(ret); 3940 + goto out_commit; 3941 + } 3942 + 3934 3943 for (i = 0; i < num_dx_leaves; i++) { 3935 3944 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), 3936 3945 orig_dx_leaves[i], ··· 3948 3939 mlog_errno(ret); 3949 3940 goto out_commit; 3950 3941 } 3951 - } 3952 3942 3953 - cpos = split_hash; 3954 - ret = ocfs2_dx_dir_new_cluster(dir, &et, cpos, handle, 3955 - data_ac, meta_ac, new_dx_leaves, 3956 - num_dx_leaves); 3957 - if (ret) { 3958 - mlog_errno(ret); 3959 - goto out_commit; 3943 + ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), 3944 + new_dx_leaves[i], 3945 + OCFS2_JOURNAL_ACCESS_WRITE); 3946 + if (ret) { 3947 + mlog_errno(ret); 3948 + goto out_commit; 3949 + } 3960 3950 } 3961 3951 3962 3952 ocfs2_dx_dir_transfer_leaf(dir, split_hash, handle, tmp_dx_leaf,
+1
fs/ocfs2/dlm/dlmcommon.h
··· 1030 1030 struct dlm_lock_resource *res); 1031 1031 void dlm_clean_master_list(struct dlm_ctxt *dlm, 1032 1032 u8 dead_node); 1033 + void dlm_force_free_mles(struct dlm_ctxt *dlm); 1033 1034 int dlm_lock_basts_flushed(struct dlm_ctxt *dlm, struct dlm_lock *lock); 1034 1035 int __dlm_lockres_has_locks(struct dlm_lock_resource *res); 1035 1036 int __dlm_lockres_unused(struct dlm_lock_resource *res);
+8 -1
fs/ocfs2/dlm/dlmdebug.c
··· 636 636 spin_lock(&dlm->track_lock); 637 637 if (oldres) 638 638 track_list = &oldres->tracking; 639 - else 639 + else { 640 640 track_list = &dlm->tracking_list; 641 + if (list_empty(track_list)) { 642 + dl = NULL; 643 + spin_unlock(&dlm->track_lock); 644 + goto bail; 645 + } 646 + } 641 647 642 648 list_for_each_entry(res, track_list, tracking) { 643 649 if (&res->tracking == &dlm->tracking_list) ··· 666 660 } else 667 661 dl = NULL; 668 662 663 + bail: 669 664 /* passed to seq_show */ 670 665 return dl; 671 666 }
+1
fs/ocfs2/dlm/dlmdomain.c
··· 693 693 694 694 dlm_mark_domain_leaving(dlm); 695 695 dlm_leave_domain(dlm); 696 + dlm_force_free_mles(dlm); 696 697 dlm_complete_dlm_shutdown(dlm); 697 698 } 698 699 dlm_put(dlm);
+40
fs/ocfs2/dlm/dlmmaster.c
··· 3433 3433 wake_up(&res->wq); 3434 3434 wake_up(&dlm->migration_wq); 3435 3435 } 3436 + 3437 + void dlm_force_free_mles(struct dlm_ctxt *dlm) 3438 + { 3439 + int i; 3440 + struct hlist_head *bucket; 3441 + struct dlm_master_list_entry *mle; 3442 + struct hlist_node *tmp, *list; 3443 + 3444 + /* 3445 + * We notified all other nodes that we are exiting the domain and 3446 + * marked the dlm state to DLM_CTXT_LEAVING. If any mles are still 3447 + * around we force free them and wake any processes that are waiting 3448 + * on the mles 3449 + */ 3450 + spin_lock(&dlm->spinlock); 3451 + spin_lock(&dlm->master_lock); 3452 + 3453 + BUG_ON(dlm->dlm_state != DLM_CTXT_LEAVING); 3454 + BUG_ON((find_next_bit(dlm->domain_map, O2NM_MAX_NODES, 0) < O2NM_MAX_NODES)); 3455 + 3456 + for (i = 0; i < DLM_HASH_BUCKETS; i++) { 3457 + bucket = dlm_master_hash(dlm, i); 3458 + hlist_for_each_safe(list, tmp, bucket) { 3459 + mle = hlist_entry(list, struct dlm_master_list_entry, 3460 + master_hash_node); 3461 + if (mle->type != DLM_MLE_BLOCK) { 3462 + mlog(ML_ERROR, "bad mle: %p\n", mle); 3463 + dlm_print_one_mle(mle); 3464 + } 3465 + atomic_set(&mle->woken, 1); 3466 + wake_up(&mle->wq); 3467 + 3468 + __dlm_unlink_mle(dlm, mle); 3469 + __dlm_mle_detach_hb_events(dlm, mle); 3470 + __dlm_put_mle(mle); 3471 + } 3472 + } 3473 + spin_unlock(&dlm->master_lock); 3474 + spin_unlock(&dlm->spinlock); 3475 + }
+1
fs/ocfs2/dlmglue.h
··· 84 84 OI_LS_PARENT, 85 85 OI_LS_RENAME1, 86 86 OI_LS_RENAME2, 87 + OI_LS_REFLINK_TARGET, 87 88 }; 88 89 89 90 int ocfs2_dlm_init(struct ocfs2_super *osb);
+24 -11
fs/ocfs2/ocfs2_fs.h
··· 235 235 #define OCFS2_HAS_REFCOUNT_FL (0x0010) 236 236 237 237 /* Inode attributes, keep in sync with EXT2 */ 238 - #define OCFS2_SECRM_FL (0x00000001) /* Secure deletion */ 239 - #define OCFS2_UNRM_FL (0x00000002) /* Undelete */ 240 - #define OCFS2_COMPR_FL (0x00000004) /* Compress file */ 241 - #define OCFS2_SYNC_FL (0x00000008) /* Synchronous updates */ 242 - #define OCFS2_IMMUTABLE_FL (0x00000010) /* Immutable file */ 243 - #define OCFS2_APPEND_FL (0x00000020) /* writes to file may only append */ 244 - #define OCFS2_NODUMP_FL (0x00000040) /* do not dump file */ 245 - #define OCFS2_NOATIME_FL (0x00000080) /* do not update atime */ 246 - #define OCFS2_DIRSYNC_FL (0x00010000) /* dirsync behaviour (directories only) */ 238 + #define OCFS2_SECRM_FL FS_SECRM_FL /* Secure deletion */ 239 + #define OCFS2_UNRM_FL FS_UNRM_FL /* Undelete */ 240 + #define OCFS2_COMPR_FL FS_COMPR_FL /* Compress file */ 241 + #define OCFS2_SYNC_FL FS_SYNC_FL /* Synchronous updates */ 242 + #define OCFS2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */ 243 + #define OCFS2_APPEND_FL FS_APPEND_FL /* writes to file may only append */ 244 + #define OCFS2_NODUMP_FL FS_NODUMP_FL /* do not dump file */ 245 + #define OCFS2_NOATIME_FL FS_NOATIME_FL /* do not update atime */ 246 + /* Reserved for compression usage... */ 247 + #define OCFS2_DIRTY_FL FS_DIRTY_FL 248 + #define OCFS2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */ 249 + #define OCFS2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */ 250 + #define OCFS2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */ 251 + /* End compression flags --- maybe not all used */ 252 + #define OCFS2_BTREE_FL FS_BTREE_FL /* btree format dir */ 253 + #define OCFS2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */ 254 + #define OCFS2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */ 255 + #define OCFS2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */ 256 + #define OCFS2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */ 257 + #define OCFS2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */ 258 + #define OCFS2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/ 259 + #define OCFS2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */ 247 260 248 - #define OCFS2_FL_VISIBLE (0x000100FF) /* User visible flags */ 249 - #define OCFS2_FL_MODIFIABLE (0x000100FF) /* User modifiable flags */ 261 + #define OCFS2_FL_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */ 262 + #define OCFS2_FL_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */ 250 263 251 264 /* 252 265 * Extent record flags (e_node.leaf.flags)
+4 -4
fs/ocfs2/ocfs2_ioctl.h
··· 23 23 /* 24 24 * ioctl commands 25 25 */ 26 - #define OCFS2_IOC_GETFLAGS _IOR('f', 1, long) 27 - #define OCFS2_IOC_SETFLAGS _IOW('f', 2, long) 28 - #define OCFS2_IOC32_GETFLAGS _IOR('f', 1, int) 29 - #define OCFS2_IOC32_SETFLAGS _IOW('f', 2, int) 26 + #define OCFS2_IOC_GETFLAGS FS_IOC_GETFLAGS 27 + #define OCFS2_IOC_SETFLAGS FS_IOC_SETFLAGS 28 + #define OCFS2_IOC32_GETFLAGS FS_IOC32_GETFLAGS 29 + #define OCFS2_IOC32_SETFLAGS FS_IOC32_SETFLAGS 30 30 31 31 /* 32 32 * Space reservation / allocation / free ioctls and argument structure
+3 -2
fs/ocfs2/refcounttree.c
··· 4201 4201 goto out; 4202 4202 } 4203 4203 4204 - mutex_lock(&new_inode->i_mutex); 4205 - ret = ocfs2_inode_lock(new_inode, &new_bh, 1); 4204 + mutex_lock_nested(&new_inode->i_mutex, I_MUTEX_CHILD); 4205 + ret = ocfs2_inode_lock_nested(new_inode, &new_bh, 1, 4206 + OI_LS_REFLINK_TARGET); 4206 4207 if (ret) { 4207 4208 mlog_errno(ret); 4208 4209 goto out_unlock;
+10 -12
fs/ocfs2/reservations.c
··· 732 732 struct ocfs2_alloc_reservation *resv, 733 733 int *cstart, int *clen) 734 734 { 735 - unsigned int wanted = *clen; 736 - 737 735 if (resv == NULL || ocfs2_resmap_disabled(resmap)) 738 736 return -ENOSPC; 739 737 740 738 spin_lock(&resv_lock); 741 739 742 - /* 743 - * We don't want to over-allocate for temporary 744 - * windows. Otherwise, we run the risk of fragmenting the 745 - * allocation space. 746 - */ 747 - wanted = ocfs2_resv_window_bits(resmap, resv); 748 - if ((resv->r_flags & OCFS2_RESV_FLAG_TMP) || wanted < *clen) 749 - wanted = *clen; 750 - 751 740 if (ocfs2_resv_empty(resv)) { 752 - mlog(0, "empty reservation, find new window\n"); 741 + /* 742 + * We don't want to over-allocate for temporary 743 + * windows. Otherwise, we run the risk of fragmenting the 744 + * allocation space. 745 + */ 746 + unsigned int wanted = ocfs2_resv_window_bits(resmap, resv); 753 747 748 + if ((resv->r_flags & OCFS2_RESV_FLAG_TMP) || wanted < *clen) 749 + wanted = *clen; 750 + 751 + mlog(0, "empty reservation, find new window\n"); 754 752 /* 755 753 * Try to get a window here. If it works, we must fall 756 754 * through and test the bitmap . This avoids some
+2 -2
fs/ocfs2/suballoc.c
··· 357 357 static void ocfs2_bg_discontig_add_extent(struct ocfs2_super *osb, 358 358 struct ocfs2_group_desc *bg, 359 359 struct ocfs2_chain_list *cl, 360 - u64 p_blkno, u32 clusters) 360 + u64 p_blkno, unsigned int clusters) 361 361 { 362 362 struct ocfs2_extent_list *el = &bg->bg_list; 363 363 struct ocfs2_extent_rec *rec; ··· 369 369 rec->e_blkno = cpu_to_le64(p_blkno); 370 370 rec->e_cpos = cpu_to_le32(le16_to_cpu(bg->bg_bits) / 371 371 le16_to_cpu(cl->cl_bpc)); 372 - rec->e_leaf_clusters = cpu_to_le32(clusters); 372 + rec->e_leaf_clusters = cpu_to_le16(clusters); 373 373 le16_add_cpu(&bg->bg_bits, clusters * le16_to_cpu(cl->cl_bpc)); 374 374 le16_add_cpu(&bg->bg_free_bits_count, 375 375 clusters * le16_to_cpu(cl->cl_bpc));
+1 -1
fs/ocfs2/symlink.c
··· 128 128 } 129 129 130 130 /* Fast symlinks can't be large */ 131 - len = strlen(target); 131 + len = strnlen(target, ocfs2_fast_symlink_chars(inode->i_sb)); 132 132 link = kzalloc(len + 1, GFP_NOFS); 133 133 if (!link) { 134 134 status = -ENOMEM;
+2 -2
fs/ocfs2/xattr.c
··· 1286 1286 xis.inode_bh = xbs.inode_bh = di_bh; 1287 1287 di = (struct ocfs2_dinode *)di_bh->b_data; 1288 1288 1289 - down_read(&oi->ip_xattr_sem); 1290 1289 ret = ocfs2_xattr_ibody_get(inode, name_index, name, buffer, 1291 1290 buffer_size, &xis); 1292 1291 if (ret == -ENODATA && di->i_xattr_loc) 1293 1292 ret = ocfs2_xattr_block_get(inode, name_index, name, buffer, 1294 1293 buffer_size, &xbs); 1295 - up_read(&oi->ip_xattr_sem); 1296 1294 1297 1295 return ret; 1298 1296 } ··· 1314 1316 mlog_errno(ret); 1315 1317 return ret; 1316 1318 } 1319 + down_read(&OCFS2_I(inode)->ip_xattr_sem); 1317 1320 ret = ocfs2_xattr_get_nolock(inode, di_bh, name_index, 1318 1321 name, buffer, buffer_size); 1322 + up_read(&OCFS2_I(inode)->ip_xattr_sem); 1319 1323 1320 1324 ocfs2_inode_unlock(inode, 0); 1321 1325
+2 -2
fs/proc/base.c
··· 2675 2675 INF("auxv", S_IRUSR, proc_pid_auxv), 2676 2676 ONE("status", S_IRUGO, proc_pid_status), 2677 2677 ONE("personality", S_IRUSR, proc_pid_personality), 2678 - INF("limits", S_IRUSR, proc_pid_limits), 2678 + INF("limits", S_IRUGO, proc_pid_limits), 2679 2679 #ifdef CONFIG_SCHED_DEBUG 2680 2680 REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), 2681 2681 #endif ··· 3011 3011 INF("auxv", S_IRUSR, proc_pid_auxv), 3012 3012 ONE("status", S_IRUGO, proc_pid_status), 3013 3013 ONE("personality", S_IRUSR, proc_pid_personality), 3014 - INF("limits", S_IRUSR, proc_pid_limits), 3014 + INF("limits", S_IRUGO, proc_pid_limits), 3015 3015 #ifdef CONFIG_SCHED_DEBUG 3016 3016 REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), 3017 3017 #endif
+2 -2
fs/proc/task_mmu.c
··· 363 363 mss->referenced += PAGE_SIZE; 364 364 mapcount = page_mapcount(page); 365 365 if (mapcount >= 2) { 366 - if (pte_dirty(ptent)) 366 + if (pte_dirty(ptent) || PageDirty(page)) 367 367 mss->shared_dirty += PAGE_SIZE; 368 368 else 369 369 mss->shared_clean += PAGE_SIZE; 370 370 mss->pss += (PAGE_SIZE << PSS_SHIFT) / mapcount; 371 371 } else { 372 - if (pte_dirty(ptent)) 372 + if (pte_dirty(ptent) || PageDirty(page)) 373 373 mss->private_dirty += PAGE_SIZE; 374 374 else 375 375 mss->private_clean += PAGE_SIZE;
+1 -1
fs/proc/vmcore.c
··· 163 163 164 164 static const struct file_operations proc_vmcore_operations = { 165 165 .read = read_vmcore, 166 - .llseek = generic_file_llseek, 166 + .llseek = default_llseek, 167 167 }; 168 168 169 169 static struct vmcore* __init get_new_element(void)
+4 -3
fs/reiserfs/ioctl.c
··· 170 170 int reiserfs_unpack(struct inode *inode, struct file *filp) 171 171 { 172 172 int retval = 0; 173 + int depth; 173 174 int index; 174 175 struct page *page; 175 176 struct address_space *mapping; ··· 189 188 /* we need to make sure nobody is changing the file size beneath 190 189 ** us 191 190 */ 192 - mutex_lock(&inode->i_mutex); 193 - reiserfs_write_lock(inode->i_sb); 191 + reiserfs_mutex_lock_safe(&inode->i_mutex, inode->i_sb); 192 + depth = reiserfs_write_lock_once(inode->i_sb); 194 193 195 194 write_from = inode->i_size & (blocksize - 1); 196 195 /* if we are on a block boundary, we are already unpacked. */ ··· 225 224 226 225 out: 227 226 mutex_unlock(&inode->i_mutex); 228 - reiserfs_write_unlock(inode->i_sb); 227 + reiserfs_write_unlock_once(inode->i_sb, depth); 229 228 return retval; 230 229 }
+9 -3
fs/xfs/xfs_log_cil.c
··· 405 405 new_ctx = kmem_zalloc(sizeof(*new_ctx), KM_SLEEP|KM_NOFS); 406 406 new_ctx->ticket = xlog_cil_ticket_alloc(log); 407 407 408 - /* lock out transaction commit, but don't block on background push */ 408 + /* 409 + * Lock out transaction commit, but don't block for background pushes 410 + * unless we are well over the CIL space limit. See the definition of 411 + * XLOG_CIL_HARD_SPACE_LIMIT() for the full explanation of the logic 412 + * used here. 413 + */ 409 414 if (!down_write_trylock(&cil->xc_ctx_lock)) { 410 - if (!push_seq) 415 + if (!push_seq && 416 + cil->xc_ctx->space_used < XLOG_CIL_HARD_SPACE_LIMIT(log)) 411 417 goto out_free_ticket; 412 418 down_write(&cil->xc_ctx_lock); 413 419 } ··· 428 422 goto out_skip; 429 423 430 424 /* check for a previously pushed seqeunce */ 431 - if (push_seq < cil->xc_ctx->sequence) 425 + if (push_seq && push_seq < cil->xc_ctx->sequence) 432 426 goto out_skip; 433 427 434 428 /*
+21 -16
fs/xfs/xfs_log_priv.h
··· 426 426 }; 427 427 428 428 /* 429 - * The amount of log space we should the CIL to aggregate is difficult to size. 430 - * Whatever we chose we have to make we can get a reservation for the log space 431 - * effectively, that it is large enough to capture sufficient relogging to 432 - * reduce log buffer IO significantly, but it is not too large for the log or 433 - * induces too much latency when writing out through the iclogs. We track both 434 - * space consumed and the number of vectors in the checkpoint context, so we 435 - * need to decide which to use for limiting. 429 + * The amount of log space we allow the CIL to aggregate is difficult to size. 430 + * Whatever we choose, we have to make sure we can get a reservation for the 431 + * log space effectively, that it is large enough to capture sufficient 432 + * relogging to reduce log buffer IO significantly, but it is not too large for 433 + * the log or induces too much latency when writing out through the iclogs. We 434 + * track both space consumed and the number of vectors in the checkpoint 435 + * context, so we need to decide which to use for limiting. 436 436 * 437 437 * Every log buffer we write out during a push needs a header reserved, which 438 438 * is at least one sector and more for v2 logs. Hence we need a reservation of ··· 459 459 * checkpoint transaction ticket is specific to the checkpoint context, rather 460 460 * than the CIL itself. 461 461 * 462 - * With dynamic reservations, we can basically make up arbitrary limits for the 463 - * checkpoint size so long as they don't violate any other size rules. Hence 464 - * the initial maximum size for the checkpoint transaction will be set to a 465 - * quarter of the log or 8MB, which ever is smaller. 8MB is an arbitrary limit 466 - * right now based on the latency of writing out a large amount of data through 467 - * the circular iclog buffers. 462 + * With dynamic reservations, we can effectively make up arbitrary limits for 463 + * the checkpoint size so long as they don't violate any other size rules. 464 + * Recovery imposes a rule that no transaction exceed half the log, so we are 465 + * limited by that. Furthermore, the log transaction reservation subsystem 466 + * tries to keep 25% of the log free, so we need to keep below that limit or we 467 + * risk running out of free log space to start any new transactions. 468 + * 469 + * In order to keep background CIL push efficient, we will set a lower 470 + * threshold at which background pushing is attempted without blocking current 471 + * transaction commits. A separate, higher bound defines when CIL pushes are 472 + * enforced to ensure we stay within our maximum checkpoint size bounds. 473 + * threshold, yet give us plenty of space for aggregation on large logs. 468 474 */ 469 - 470 - #define XLOG_CIL_SPACE_LIMIT(log) \ 471 - (min((log->l_logsize >> 2), (8 * 1024 * 1024))) 475 + #define XLOG_CIL_SPACE_LIMIT(log) (log->l_logsize >> 3) 476 + #define XLOG_CIL_HARD_SPACE_LIMIT(log) (3 * (log->l_logsize >> 4)) 472 477 473 478 /* 474 479 * The reservation head lsn is not made up of a cycle number and block number.
+1 -1
include/acpi/acpixf.h
··· 55 55 extern u8 acpi_gbl_permanent_mmap; 56 56 57 57 /* 58 - * Globals that are publically available, allowing for 58 + * Globals that are publicly available, allowing for 59 59 * run time configuration 60 60 */ 61 61 extern u32 acpi_dbg_level;
+20 -9
include/drm/drmP.h
··· 612 612 struct kref refcount; 613 613 614 614 /** Handle count of this object. Each handle also holds a reference */ 615 - struct kref handlecount; 615 + atomic_t handle_count; /* number of handles on this object */ 616 616 617 617 /** Related drm device */ 618 618 struct drm_device *dev; ··· 808 808 */ 809 809 int (*gem_init_object) (struct drm_gem_object *obj); 810 810 void (*gem_free_object) (struct drm_gem_object *obj); 811 - void (*gem_free_object_unlocked) (struct drm_gem_object *obj); 812 811 813 812 /* vga arb irq handler */ 814 813 void (*vgaarb_irq)(struct drm_device *dev, bool state); ··· 1174 1175 extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); 1175 1176 extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); 1176 1177 extern void drm_vm_open_locked(struct vm_area_struct *vma); 1178 + extern void drm_vm_close_locked(struct vm_area_struct *vma); 1177 1179 extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map); 1178 1180 extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev); 1179 1181 extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); ··· 1455 1455 void drm_gem_destroy(struct drm_device *dev); 1456 1456 void drm_gem_object_release(struct drm_gem_object *obj); 1457 1457 void drm_gem_object_free(struct kref *kref); 1458 - void drm_gem_object_free_unlocked(struct kref *kref); 1459 1458 struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev, 1460 1459 size_t size); 1461 1460 int drm_gem_object_init(struct drm_device *dev, 1462 1461 struct drm_gem_object *obj, size_t size); 1463 - void drm_gem_object_handle_free(struct kref *kref); 1462 + void drm_gem_object_handle_free(struct drm_gem_object *obj); 1464 1463 void drm_gem_vm_open(struct vm_area_struct *vma); 1465 1464 void drm_gem_vm_close(struct vm_area_struct *vma); 1466 1465 int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); ··· 1482 1483 static inline void 1483 1484 drm_gem_object_unreference_unlocked(struct drm_gem_object *obj) 1484 1485 { 1485 - if (obj != NULL) 1486 - kref_put(&obj->refcount, drm_gem_object_free_unlocked); 1486 + if (obj != NULL) { 1487 + struct drm_device *dev = obj->dev; 1488 + mutex_lock(&dev->struct_mutex); 1489 + kref_put(&obj->refcount, drm_gem_object_free); 1490 + mutex_unlock(&dev->struct_mutex); 1491 + } 1487 1492 } 1488 1493 1489 1494 int drm_gem_handle_create(struct drm_file *file_priv, ··· 1498 1495 drm_gem_object_handle_reference(struct drm_gem_object *obj) 1499 1496 { 1500 1497 drm_gem_object_reference(obj); 1501 - kref_get(&obj->handlecount); 1498 + atomic_inc(&obj->handle_count); 1502 1499 } 1503 1500 1504 1501 static inline void ··· 1507 1504 if (obj == NULL) 1508 1505 return; 1509 1506 1507 + if (atomic_read(&obj->handle_count) == 0) 1508 + return; 1510 1509 /* 1511 1510 * Must bump handle count first as this may be the last 1512 1511 * ref, in which case the object would disappear before we 1513 1512 * checked for a name 1514 1513 */ 1515 - kref_put(&obj->handlecount, drm_gem_object_handle_free); 1514 + if (atomic_dec_and_test(&obj->handle_count)) 1515 + drm_gem_object_handle_free(obj); 1516 1516 drm_gem_object_unreference(obj); 1517 1517 } 1518 1518 ··· 1525 1519 if (obj == NULL) 1526 1520 return; 1527 1521 1522 + if (atomic_read(&obj->handle_count) == 0) 1523 + return; 1524 + 1528 1525 /* 1529 1526 * Must bump handle count first as this may be the last 1530 1527 * ref, in which case the object would disappear before we 1531 1528 * checked for a name 1532 1529 */ 1533 - kref_put(&obj->handlecount, drm_gem_object_handle_free); 1530 + 1531 + if (atomic_dec_and_test(&obj->handle_count)) 1532 + drm_gem_object_handle_free(obj); 1534 1533 drm_gem_object_unreference_unlocked(obj); 1535 1534 } 1536 1535
+1 -1
include/drm/drm_pciids.h
··· 85 85 {0x1002, 0x5460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ 86 86 {0x1002, 0x5462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ 87 87 {0x1002, 0x5464, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ 88 - {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 89 88 {0x1002, 0x5548, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ 90 89 {0x1002, 0x5549, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ 91 90 {0x1002, 0x554A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ ··· 102 103 {0x1002, 0x564F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 103 104 {0x1002, 0x5652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 104 105 {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 106 + {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ 105 107 {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \ 106 108 {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ 107 109 {0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
+1
include/linux/cpuidle.h
··· 53 53 #define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ 54 54 #define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ 55 55 #define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */ 56 + #define CPUIDLE_FLAG_TLB_FLUSHED (0x200) /* tlb will be flushed */ 56 57 57 58 #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 58 59
+4
include/linux/dma-mapping.h
··· 102 102 return DMA_BIT_MASK(32); 103 103 } 104 104 105 + #ifdef ARCH_HAS_DMA_SET_COHERENT_MASK 106 + int dma_set_coherent_mask(struct device *dev, u64 mask); 107 + #else 105 108 static inline int dma_set_coherent_mask(struct device *dev, u64 mask) 106 109 { 107 110 if (!dma_supported(dev, mask)) ··· 112 109 dev->coherent_dma_mask = mask; 113 110 return 0; 114 111 } 112 + #endif 115 113 116 114 extern u64 dma_get_required_mask(struct device *dev); 117 115
+1 -1
include/linux/dmaengine.h
··· 548 548 return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE; 549 549 } 550 550 551 - static unsigned short dma_dev_to_maxpq(struct dma_device *dma) 551 + static inline unsigned short dma_dev_to_maxpq(struct dma_device *dma) 552 552 { 553 553 return dma->max_pq & ~DMA_HAS_PQ_CONTINUE; 554 554 }
+2 -3
include/linux/module.h
··· 689 689 690 690 691 691 #ifdef CONFIG_GENERIC_BUG 692 - int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, 692 + void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, 693 693 struct module *); 694 694 void module_bug_cleanup(struct module *); 695 695 696 696 #else /* !CONFIG_GENERIC_BUG */ 697 697 698 - static inline int module_bug_finalize(const Elf_Ehdr *hdr, 698 + static inline void module_bug_finalize(const Elf_Ehdr *hdr, 699 699 const Elf_Shdr *sechdrs, 700 700 struct module *mod) 701 701 { 702 - return 0; 703 702 } 704 703 static inline void module_bug_cleanup(struct module *mod) {} 705 704 #endif /* CONFIG_GENERIC_BUG */
+2 -2
include/linux/netlink.h
··· 27 27 28 28 #define MAX_LINKS 32 29 29 30 - struct net; 31 - 32 30 struct sockaddr_nl { 33 31 sa_family_t nl_family; /* AF_NETLINK */ 34 32 unsigned short nl_pad; /* zero */ ··· 148 150 149 151 #include <linux/capability.h> 150 152 #include <linux/skbuff.h> 153 + 154 + struct net; 151 155 152 156 static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb) 153 157 {
+3
include/linux/pci_ids.h
··· 393 393 #define PCI_DEVICE_ID_VLSI_82C147 0x0105 394 394 #define PCI_DEVICE_ID_VLSI_VAS96011 0x0702 395 395 396 + /* AMD RD890 Chipset */ 397 + #define PCI_DEVICE_ID_RD890_IOMMU 0x5a23 398 + 396 399 #define PCI_VENDOR_ID_ADL 0x1005 397 400 #define PCI_DEVICE_ID_ADL_2301 0x2301 398 401
+1 -1
include/linux/rcupdate.h
··· 454 454 * Makes rcu_dereference_check() do the dirty work. 455 455 */ 456 456 #define rcu_dereference_bh(p) \ 457 - rcu_dereference_check(p, rcu_read_lock_bh_held()) 457 + rcu_dereference_check(p, rcu_read_lock_bh_held() || irqs_disabled()) 458 458 459 459 /** 460 460 * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched
+1 -1
include/linux/socket.h
··· 322 322 int offset, 323 323 unsigned int len, __wsum *csump); 324 324 325 - extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); 325 + extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); 326 326 extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); 327 327 extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, 328 328 int offset, int len);
+1
include/linux/wait.h
··· 614 614 (wait)->private = current; \ 615 615 (wait)->func = autoremove_wake_function; \ 616 616 INIT_LIST_HEAD(&(wait)->task_list); \ 617 + (wait)->flags = 0; \ 617 618 } while (0) 618 619 619 620 /**
+1
include/net/addrconf.h
··· 121 121 * IPv6 Address Label subsystem (addrlabel.c) 122 122 */ 123 123 extern int ipv6_addr_label_init(void); 124 + extern void ipv6_addr_label_cleanup(void); 124 125 extern void ipv6_addr_label_rtnl_register(void); 125 126 extern u32 ipv6_addr_label(struct net *net, 126 127 const struct in6_addr *addr,
+1
include/net/dst.h
··· 242 242 dev->stats.rx_packets++; 243 243 dev->stats.rx_bytes += skb->len; 244 244 skb->rxhash = 0; 245 + skb_set_queue_mapping(skb, 0); 245 246 skb_dst_drop(skb); 246 247 nf_reset(skb); 247 248 }
+2
include/net/route.h
··· 199 199 fl.fl_ip_sport = sport; 200 200 fl.fl_ip_dport = dport; 201 201 fl.proto = protocol; 202 + if (inet_sk(sk)->transparent) 203 + fl.flags |= FLOWI_FLAG_ANYSRC; 202 204 ip_rt_put(*rp); 203 205 *rp = NULL; 204 206 security_sk_classify_flow(sk, &fl);
+2 -2
include/net/xfrm.h
··· 298 298 const struct xfrm_type *type_map[IPPROTO_MAX]; 299 299 struct xfrm_mode *mode_map[XFRM_MODE_MAX]; 300 300 int (*init_flags)(struct xfrm_state *x); 301 - void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, 302 - struct xfrm_tmpl *tmpl, 301 + void (*init_tempsel)(struct xfrm_selector *sel, struct flowi *fl); 302 + void (*init_temprop)(struct xfrm_state *x, struct xfrm_tmpl *tmpl, 303 303 xfrm_address_t *daddr, xfrm_address_t *saddr); 304 304 int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n); 305 305 int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n);
+2
ipc/sem.c
··· 743 743 { 744 744 struct semid_ds out; 745 745 746 + memset(&out, 0, sizeof(out)); 747 + 746 748 ipc64_perm_to_ipc_perm(&in->sem_perm, &out.sem_perm); 747 749 748 750 out.sem_otime = in->sem_otime;
+1 -1
kernel/fork.c
··· 356 356 if (IS_ERR(pol)) 357 357 goto fail_nomem_policy; 358 358 vma_set_policy(tmp, pol); 359 + tmp->vm_mm = mm; 359 360 if (anon_vma_fork(tmp, mpnt)) 360 361 goto fail_nomem_anon_vma_fork; 361 362 tmp->vm_flags &= ~VM_LOCKED; 362 - tmp->vm_mm = mm; 363 363 tmp->vm_next = tmp->vm_prev = NULL; 364 364 file = tmp->vm_file; 365 365 if (file) {
-2
kernel/kfifo.c
··· 365 365 n = setup_sgl_buf(sgl, fifo->data + off, nents, l); 366 366 n += setup_sgl_buf(sgl + n, fifo->data, nents - n, len - l); 367 367 368 - if (n) 369 - sg_mark_end(sgl + n - 1); 370 368 return n; 371 369 } 372 370
+4
kernel/module.c
··· 1538 1538 { 1539 1539 struct module *mod = _mod; 1540 1540 list_del(&mod->list); 1541 + module_bug_cleanup(mod); 1541 1542 return 0; 1542 1543 } 1543 1544 ··· 2632 2631 if (err < 0) 2633 2632 goto ddebug; 2634 2633 2634 + module_bug_finalize(info.hdr, info.sechdrs, mod); 2635 2635 list_add_rcu(&mod->list, &modules); 2636 2636 mutex_unlock(&module_mutex); 2637 2637 ··· 2658 2656 mutex_lock(&module_mutex); 2659 2657 /* Unlink carefully: kallsyms could be walking list. */ 2660 2658 list_del_rcu(&mod->list); 2659 + module_bug_cleanup(mod); 2660 + 2661 2661 ddebug: 2662 2662 if (!mod->taints) 2663 2663 dynamic_debug_remove(info.debug);
+14 -3
kernel/smp.c
··· 365 365 EXPORT_SYMBOL_GPL(smp_call_function_any); 366 366 367 367 /** 368 - * __smp_call_function_single(): Run a function on another CPU 368 + * __smp_call_function_single(): Run a function on a specific CPU 369 369 * @cpu: The CPU to run on. 370 370 * @data: Pre-allocated and setup data structure 371 + * @wait: If true, wait until function has completed on specified CPU. 371 372 * 372 373 * Like smp_call_function_single(), but allow caller to pass in a 373 374 * pre-allocated data structure. Useful for embedding @data inside ··· 377 376 void __smp_call_function_single(int cpu, struct call_single_data *data, 378 377 int wait) 379 378 { 380 - csd_lock(data); 379 + unsigned int this_cpu; 380 + unsigned long flags; 381 381 382 + this_cpu = get_cpu(); 382 383 /* 383 384 * Can deadlock when called with interrupts disabled. 384 385 * We allow cpu's that are not yet online though, as no one else can ··· 390 387 WARN_ON_ONCE(cpu_online(smp_processor_id()) && wait && irqs_disabled() 391 388 && !oops_in_progress); 392 389 393 - generic_exec_single(cpu, data, wait); 390 + if (cpu == this_cpu) { 391 + local_irq_save(flags); 392 + data->func(data->info); 393 + local_irq_restore(flags); 394 + } else { 395 + csd_lock(data); 396 + generic_exec_single(cpu, data, wait); 397 + } 398 + put_cpu(); 394 399 } 395 400 396 401 /**
+2 -4
lib/bug.c
··· 72 72 return NULL; 73 73 } 74 74 75 - int module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, 76 - struct module *mod) 75 + void module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, 76 + struct module *mod) 77 77 { 78 78 char *secstrings; 79 79 unsigned int i; ··· 97 97 * could potentially lead to deadlock and thus be counter-productive. 98 98 */ 99 99 list_add(&mod->bug_list, &module_bug_list); 100 - 101 - return 0; 102 100 } 103 101 104 102 void module_bug_cleanup(struct module *mod)
+1 -1
lib/list_sort.c
··· 70 70 * element comparison is needed, so the client's cmp() 71 71 * routine can invoke cond_resched() periodically. 72 72 */ 73 - (*cmp)(priv, tail, tail); 73 + (*cmp)(priv, tail->next, tail->next); 74 74 75 75 tail->next->prev = tail; 76 76 tail = tail->next;
+5 -2
mm/fremap.c
··· 125 125 { 126 126 struct mm_struct *mm = current->mm; 127 127 struct address_space *mapping; 128 - unsigned long end = start + size; 129 128 struct vm_area_struct *vma; 130 129 int err = -EINVAL; 131 130 int has_write_lock = 0; ··· 139 140 140 141 /* Does the address range wrap, or is the span zero-sized? */ 141 142 if (start + size <= start) 143 + return err; 144 + 145 + /* Does pgoff wrap? */ 146 + if (pgoff + (size >> PAGE_SHIFT) < pgoff) 142 147 return err; 143 148 144 149 /* Can we represent this offset inside this architecture's pte's? */ ··· 171 168 if (!(vma->vm_flags & VM_CAN_NONLINEAR)) 172 169 goto out; 173 170 174 - if (end <= start || start < vma->vm_start || end > vma->vm_end) 171 + if (start < vma->vm_start || start + size > vma->vm_end) 175 172 goto out; 176 173 177 174 /* Must set VM_NONLINEAR before any pages are populated. */
+13 -11
mm/hugetlb.c
··· 2324 2324 * and just make the page writable */ 2325 2325 avoidcopy = (page_mapcount(old_page) == 1); 2326 2326 if (avoidcopy) { 2327 - if (!trylock_page(old_page)) { 2328 - if (PageAnon(old_page)) 2329 - page_move_anon_rmap(old_page, vma, address); 2330 - } else 2331 - unlock_page(old_page); 2327 + if (PageAnon(old_page)) 2328 + page_move_anon_rmap(old_page, vma, address); 2332 2329 set_huge_ptep_writable(vma, address, ptep); 2333 2330 return 0; 2334 2331 } ··· 2401 2404 set_huge_pte_at(mm, address, ptep, 2402 2405 make_huge_pte(vma, new_page, 1)); 2403 2406 page_remove_rmap(old_page); 2404 - hugepage_add_anon_rmap(new_page, vma, address); 2407 + hugepage_add_new_anon_rmap(new_page, vma, address); 2405 2408 /* Make the old page be freed below */ 2406 2409 new_page = old_page; 2407 2410 mmu_notifier_invalidate_range_end(mm, ··· 2628 2631 vma, address); 2629 2632 } 2630 2633 2631 - if (!pagecache_page) { 2632 - page = pte_page(entry); 2634 + /* 2635 + * hugetlb_cow() requires page locks of pte_page(entry) and 2636 + * pagecache_page, so here we need take the former one 2637 + * when page != pagecache_page or !pagecache_page. 2638 + * Note that locking order is always pagecache_page -> page, 2639 + * so no worry about deadlock. 2640 + */ 2641 + page = pte_page(entry); 2642 + if (page != pagecache_page) 2633 2643 lock_page(page); 2634 - } 2635 2644 2636 2645 spin_lock(&mm->page_table_lock); 2637 2646 /* Check for a racing update before calling hugetlb_cow */ ··· 2664 2661 if (pagecache_page) { 2665 2662 unlock_page(pagecache_page); 2666 2663 put_page(pagecache_page); 2667 - } else { 2668 - unlock_page(page); 2669 2664 } 2665 + unlock_page(page); 2670 2666 2671 2667 out_mutex: 2672 2668 mutex_unlock(&hugetlb_instantiation_mutex);
+4 -2
mm/ksm.c
··· 712 712 if (!ptep) 713 713 goto out; 714 714 715 - if (pte_write(*ptep)) { 715 + if (pte_write(*ptep) || pte_dirty(*ptep)) { 716 716 pte_t entry; 717 717 718 718 swapped = PageSwapCache(page); ··· 735 735 set_pte_at(mm, addr, ptep, entry); 736 736 goto out_unlock; 737 737 } 738 - entry = pte_wrprotect(entry); 738 + if (pte_dirty(entry)) 739 + set_page_dirty(page); 740 + entry = pte_mkclean(pte_wrprotect(entry)); 739 741 set_pte_at_notify(mm, addr, ptep, entry); 740 742 } 741 743 *orig_pte = *ptep;
+1
mm/mmap.c
··· 2009 2009 removed_exe_file_vma(mm); 2010 2010 fput(new->vm_file); 2011 2011 } 2012 + unlink_anon_vmas(new); 2012 2013 out_free_mpol: 2013 2014 mpol_put(pol); 2014 2015 out_free_vma:
+26 -23
mm/oom_kill.c
··· 121 121 } 122 122 123 123 /* return true if the task is not adequate as candidate victim task. */ 124 - static bool oom_unkillable_task(struct task_struct *p, struct mem_cgroup *mem, 125 - const nodemask_t *nodemask) 124 + static bool oom_unkillable_task(struct task_struct *p, 125 + const struct mem_cgroup *mem, const nodemask_t *nodemask) 126 126 { 127 127 if (is_global_init(p)) 128 128 return true; ··· 208 208 */ 209 209 points += p->signal->oom_score_adj; 210 210 211 - if (points < 0) 212 - return 0; 211 + /* 212 + * Never return 0 for an eligible task that may be killed since it's 213 + * possible that no single user task uses more than 0.1% of memory and 214 + * no single admin tasks uses more than 3.0%. 215 + */ 216 + if (points <= 0) 217 + return 1; 213 218 return (points < 1000) ? points : 1000; 214 219 } 215 220 ··· 344 339 /** 345 340 * dump_tasks - dump current memory state of all system tasks 346 341 * @mem: current's memory controller, if constrained 342 + * @nodemask: nodemask passed to page allocator for mempolicy ooms 347 343 * 348 - * Dumps the current memory state of all system tasks, excluding kernel threads. 344 + * Dumps the current memory state of all eligible tasks. Tasks not in the same 345 + * memcg, not in the same cpuset, or bound to a disjoint set of mempolicy nodes 346 + * are not shown. 349 347 * State information includes task's pid, uid, tgid, vm size, rss, cpu, oom_adj 350 348 * value, oom_score_adj value, and name. 351 349 * 352 - * If the actual is non-NULL, only tasks that are a member of the mem_cgroup are 353 - * shown. 354 - * 355 350 * Call with tasklist_lock read-locked. 356 351 */ 357 - static void dump_tasks(const struct mem_cgroup *mem) 352 + static void dump_tasks(const struct mem_cgroup *mem, const nodemask_t *nodemask) 358 353 { 359 354 struct task_struct *p; 360 355 struct task_struct *task; 361 356 362 357 pr_info("[ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name\n"); 363 358 for_each_process(p) { 364 - if (p->flags & PF_KTHREAD) 365 - continue; 366 - if (mem && !task_in_mem_cgroup(p, mem)) 359 + if (oom_unkillable_task(p, mem, nodemask)) 367 360 continue; 368 361 369 362 task = find_lock_task_mm(p); ··· 384 381 } 385 382 386 383 static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order, 387 - struct mem_cgroup *mem) 384 + struct mem_cgroup *mem, const nodemask_t *nodemask) 388 385 { 389 386 task_lock(current); 390 387 pr_warning("%s invoked oom-killer: gfp_mask=0x%x, order=%d, " ··· 397 394 mem_cgroup_print_oom_info(mem, p); 398 395 show_mem(); 399 396 if (sysctl_oom_dump_tasks) 400 - dump_tasks(mem); 397 + dump_tasks(mem, nodemask); 401 398 } 402 399 403 400 #define K(x) ((x) << (PAGE_SHIFT-10)) ··· 439 436 unsigned int victim_points = 0; 440 437 441 438 if (printk_ratelimit()) 442 - dump_header(p, gfp_mask, order, mem); 439 + dump_header(p, gfp_mask, order, mem, nodemask); 443 440 444 441 /* 445 442 * If the task is already exiting, don't alarm the sysadmin or kill ··· 485 482 * Determines whether the kernel must panic because of the panic_on_oom sysctl. 486 483 */ 487 484 static void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask, 488 - int order) 485 + int order, const nodemask_t *nodemask) 489 486 { 490 487 if (likely(!sysctl_panic_on_oom)) 491 488 return; ··· 499 496 return; 500 497 } 501 498 read_lock(&tasklist_lock); 502 - dump_header(NULL, gfp_mask, order, NULL); 499 + dump_header(NULL, gfp_mask, order, NULL, nodemask); 503 500 read_unlock(&tasklist_lock); 504 501 panic("Out of memory: %s panic_on_oom is enabled\n", 505 502 sysctl_panic_on_oom == 2 ? "compulsory" : "system-wide"); ··· 512 509 unsigned int points = 0; 513 510 struct task_struct *p; 514 511 515 - check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, 0); 512 + check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, 0, NULL); 516 513 limit = mem_cgroup_get_limit(mem) >> PAGE_SHIFT; 517 514 read_lock(&tasklist_lock); 518 515 retry: ··· 644 641 void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, 645 642 int order, nodemask_t *nodemask) 646 643 { 644 + const nodemask_t *mpol_mask; 647 645 struct task_struct *p; 648 646 unsigned long totalpages; 649 647 unsigned long freed = 0; ··· 674 670 */ 675 671 constraint = constrained_alloc(zonelist, gfp_mask, nodemask, 676 672 &totalpages); 677 - check_panic_on_oom(constraint, gfp_mask, order); 673 + mpol_mask = (constraint == CONSTRAINT_MEMORY_POLICY) ? nodemask : NULL; 674 + check_panic_on_oom(constraint, gfp_mask, order, mpol_mask); 678 675 679 676 read_lock(&tasklist_lock); 680 677 if (sysctl_oom_kill_allocating_task && ··· 693 688 } 694 689 695 690 retry: 696 - p = select_bad_process(&points, totalpages, NULL, 697 - constraint == CONSTRAINT_MEMORY_POLICY ? nodemask : 698 - NULL); 691 + p = select_bad_process(&points, totalpages, NULL, mpol_mask); 699 692 if (PTR_ERR(p) == -1UL) 700 693 goto out; 701 694 702 695 /* Found nothing?!?! Either we hang forever, or we panic. */ 703 696 if (!p) { 704 - dump_header(NULL, gfp_mask, order, NULL); 697 + dump_header(NULL, gfp_mask, order, NULL, mpol_mask); 705 698 read_unlock(&tasklist_lock); 706 699 panic("Out of memory and no killable processes...\n"); 707 700 }
+1 -1
mm/percpu.c
··· 1401 1401 1402 1402 if (pcpu_first_unit_cpu == NR_CPUS) 1403 1403 pcpu_first_unit_cpu = cpu; 1404 + pcpu_last_unit_cpu = cpu; 1404 1405 } 1405 1406 } 1406 - pcpu_last_unit_cpu = cpu; 1407 1407 pcpu_nr_units = unit; 1408 1408 1409 1409 for_each_possible_cpu(cpu)
+16 -7
mm/rmap.c
··· 381 381 unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) 382 382 { 383 383 if (PageAnon(page)) { 384 - if (vma->anon_vma->root != page_anon_vma(page)->root) 384 + struct anon_vma *page__anon_vma = page_anon_vma(page); 385 + /* 386 + * Note: swapoff's unuse_vma() is more efficient with this 387 + * check, and needs it to match anon_vma when KSM is active. 388 + */ 389 + if (!vma->anon_vma || !page__anon_vma || 390 + vma->anon_vma->root != page__anon_vma->root) 385 391 return -EFAULT; 386 392 } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { 387 393 if (!vma->vm_file || ··· 1570 1564 struct vm_area_struct *vma, unsigned long address, int exclusive) 1571 1565 { 1572 1566 struct anon_vma *anon_vma = vma->anon_vma; 1567 + 1573 1568 BUG_ON(!anon_vma); 1574 - if (!exclusive) { 1575 - struct anon_vma_chain *avc; 1576 - avc = list_entry(vma->anon_vma_chain.prev, 1577 - struct anon_vma_chain, same_vma); 1578 - anon_vma = avc->anon_vma; 1579 - } 1569 + 1570 + if (PageAnon(page)) 1571 + return; 1572 + if (!exclusive) 1573 + anon_vma = anon_vma->root; 1574 + 1580 1575 anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON; 1581 1576 page->mapping = (struct address_space *) anon_vma; 1582 1577 page->index = linear_page_index(vma, address); ··· 1588 1581 { 1589 1582 struct anon_vma *anon_vma = vma->anon_vma; 1590 1583 int first; 1584 + 1585 + BUG_ON(!PageLocked(page)); 1591 1586 BUG_ON(!anon_vma); 1592 1587 BUG_ON(address < vma->vm_start || address >= vma->vm_end); 1593 1588 first = atomic_inc_and_test(&page->_mapcount);
+35 -8
mm/vmscan.c
··· 1804 1804 * If a zone is deemed to be full of pinned pages then just give it a light 1805 1805 * scan then give up on it. 1806 1806 */ 1807 - static bool shrink_zones(int priority, struct zonelist *zonelist, 1807 + static void shrink_zones(int priority, struct zonelist *zonelist, 1808 1808 struct scan_control *sc) 1809 1809 { 1810 1810 struct zoneref *z; 1811 1811 struct zone *zone; 1812 - bool all_unreclaimable = true; 1813 1812 1814 1813 for_each_zone_zonelist_nodemask(zone, z, zonelist, 1815 1814 gfp_zone(sc->gfp_mask), sc->nodemask) { ··· 1826 1827 } 1827 1828 1828 1829 shrink_zone(priority, zone, sc); 1829 - all_unreclaimable = false; 1830 1830 } 1831 + } 1832 + 1833 + static bool zone_reclaimable(struct zone *zone) 1834 + { 1835 + return zone->pages_scanned < zone_reclaimable_pages(zone) * 6; 1836 + } 1837 + 1838 + /* 1839 + * As hibernation is going on, kswapd is freezed so that it can't mark 1840 + * the zone into all_unreclaimable. It can't handle OOM during hibernation. 1841 + * So let's check zone's unreclaimable in direct reclaim as well as kswapd. 1842 + */ 1843 + static bool all_unreclaimable(struct zonelist *zonelist, 1844 + struct scan_control *sc) 1845 + { 1846 + struct zoneref *z; 1847 + struct zone *zone; 1848 + bool all_unreclaimable = true; 1849 + 1850 + for_each_zone_zonelist_nodemask(zone, z, zonelist, 1851 + gfp_zone(sc->gfp_mask), sc->nodemask) { 1852 + if (!populated_zone(zone)) 1853 + continue; 1854 + if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) 1855 + continue; 1856 + if (zone_reclaimable(zone)) { 1857 + all_unreclaimable = false; 1858 + break; 1859 + } 1860 + } 1861 + 1831 1862 return all_unreclaimable; 1832 1863 } 1833 1864 ··· 1881 1852 struct scan_control *sc) 1882 1853 { 1883 1854 int priority; 1884 - bool all_unreclaimable; 1885 1855 unsigned long total_scanned = 0; 1886 1856 struct reclaim_state *reclaim_state = current->reclaim_state; 1887 1857 struct zoneref *z; ··· 1897 1869 sc->nr_scanned = 0; 1898 1870 if (!priority) 1899 1871 disable_swap_token(); 1900 - all_unreclaimable = shrink_zones(priority, zonelist, sc); 1872 + shrink_zones(priority, zonelist, sc); 1901 1873 /* 1902 1874 * Don't shrink slabs when reclaiming memory from 1903 1875 * over limit cgroups ··· 1959 1931 return sc->nr_reclaimed; 1960 1932 1961 1933 /* top priority shrink_zones still had more to do? don't OOM, then */ 1962 - if (scanning_global_lru(sc) && !all_unreclaimable) 1934 + if (scanning_global_lru(sc) && !all_unreclaimable(zonelist, sc)) 1963 1935 return 1; 1964 1936 1965 1937 return 0; ··· 2225 2197 total_scanned += sc.nr_scanned; 2226 2198 if (zone->all_unreclaimable) 2227 2199 continue; 2228 - if (nr_slab == 0 && 2229 - zone->pages_scanned >= (zone_reclaimable_pages(zone) * 6)) 2200 + if (nr_slab == 0 && !zone_reclaimable(zone)) 2230 2201 zone->all_unreclaimable = 1; 2231 2202 /* 2232 2203 * If we've done a decent amount of scanning and
+10 -4
net/8021q/vlan_core.c
··· 24 24 25 25 if (vlan_dev) 26 26 skb->dev = vlan_dev; 27 - else if (vlan_id) 28 - goto drop; 27 + else if (vlan_id) { 28 + if (!(skb->dev->flags & IFF_PROMISC)) 29 + goto drop; 30 + skb->pkt_type = PACKET_OTHERHOST; 31 + } 29 32 30 33 return (polling ? netif_receive_skb(skb) : netif_rx(skb)); 31 34 ··· 105 102 106 103 if (vlan_dev) 107 104 skb->dev = vlan_dev; 108 - else if (vlan_id) 109 - goto drop; 105 + else if (vlan_id) { 106 + if (!(skb->dev->flags & IFF_PROMISC)) 107 + goto drop; 108 + skb->pkt_type = PACKET_OTHERHOST; 109 + } 110 110 111 111 for (p = napi->gro_list; p; p = p->next) { 112 112 NAPI_GRO_CB(p)->same_flow =
+18 -11
net/9p/trans_rdma.c
··· 426 426 427 427 /* Allocate an fcall for the reply */ 428 428 rpl_context = kmalloc(sizeof *rpl_context, GFP_KERNEL); 429 - if (!rpl_context) 429 + if (!rpl_context) { 430 + err = -ENOMEM; 430 431 goto err_close; 432 + } 431 433 432 434 /* 433 435 * If the request has a buffer, steal it, otherwise ··· 447 445 } 448 446 rpl_context->rc = req->rc; 449 447 if (!rpl_context->rc) { 450 - kfree(rpl_context); 451 - goto err_close; 448 + err = -ENOMEM; 449 + goto err_free2; 452 450 } 453 451 454 452 /* ··· 460 458 */ 461 459 if (atomic_inc_return(&rdma->rq_count) <= rdma->rq_depth) { 462 460 err = post_recv(client, rpl_context); 463 - if (err) { 464 - kfree(rpl_context->rc); 465 - kfree(rpl_context); 466 - goto err_close; 467 - } 461 + if (err) 462 + goto err_free1; 468 463 } else 469 464 atomic_dec(&rdma->rq_count); 470 465 ··· 470 471 471 472 /* Post the request */ 472 473 c = kmalloc(sizeof *c, GFP_KERNEL); 473 - if (!c) 474 - goto err_close; 474 + if (!c) { 475 + err = -ENOMEM; 476 + goto err_free1; 477 + } 475 478 c->req = req; 476 479 477 480 c->busa = ib_dma_map_single(rdma->cm_id->device, ··· 500 499 return ib_post_send(rdma->qp, &wr, &bad_wr); 501 500 502 501 error: 502 + kfree(c); 503 + kfree(rpl_context->rc); 504 + kfree(rpl_context); 503 505 P9_DPRINTK(P9_DEBUG_ERROR, "EIO\n"); 504 506 return -EIO; 505 - 507 + err_free1: 508 + kfree(rpl_context->rc); 509 + err_free2: 510 + kfree(rpl_context); 506 511 err_close: 507 512 spin_lock_irqsave(&rdma->req_lock, flags); 508 513 if (rdma->state < P9_RDMA_CLOSING) {
+2 -1
net/9p/trans_virtio.c
··· 329 329 330 330 mutex_lock(&virtio_9p_lock); 331 331 list_for_each_entry(chan, &virtio_chan_list, chan_list) { 332 - if (!strncmp(devname, chan->tag, chan->tag_len)) { 332 + if (!strncmp(devname, chan->tag, chan->tag_len) && 333 + strlen(devname) == chan->tag_len) { 333 334 if (!chan->inuse) { 334 335 chan->inuse = true; 335 336 found = 1;
+2 -10
net/atm/br2684.c
··· 399 399 unregister_netdev(net_dev); 400 400 free_netdev(net_dev); 401 401 } 402 - read_lock_irq(&devs_lock); 403 - if (list_empty(&br2684_devs)) { 404 - /* last br2684 device */ 405 - unregister_atmdevice_notifier(&atm_dev_notifier); 406 - } 407 - read_unlock_irq(&devs_lock); 408 402 return; 409 403 } 410 404 ··· 669 675 670 676 if (list_empty(&br2684_devs)) { 671 677 /* 1st br2684 device */ 672 - register_atmdevice_notifier(&atm_dev_notifier); 673 678 brdev->number = 1; 674 679 } else 675 680 brdev->number = BRPRIV(list_entry_brdev(br2684_devs.prev))->number + 1; ··· 808 815 return -ENOMEM; 809 816 #endif 810 817 register_atm_ioctl(&br2684_ioctl_ops); 818 + register_atmdevice_notifier(&atm_dev_notifier); 811 819 return 0; 812 820 } 813 821 ··· 824 830 #endif 825 831 826 832 827 - /* if not already empty */ 828 - if (!list_empty(&br2684_devs)) 829 - unregister_atmdevice_notifier(&atm_dev_notifier); 833 + unregister_atmdevice_notifier(&atm_dev_notifier); 830 834 831 835 while (!list_empty(&br2684_devs)) { 832 836 net_dev = list_entry_brdev(br2684_devs.next);
+3 -2
net/core/iovec.c
··· 35 35 * in any case. 36 36 */ 37 37 38 - int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode) 38 + long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode) 39 39 { 40 - int size, err, ct; 40 + int size, ct; 41 + long err; 41 42 42 43 if (m->msg_namelen) { 43 44 if (mode == VERIFY_READ) {
+4 -4
net/core/sock.c
··· 1351 1351 { 1352 1352 int uid; 1353 1353 1354 - read_lock(&sk->sk_callback_lock); 1354 + read_lock_bh(&sk->sk_callback_lock); 1355 1355 uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : 0; 1356 - read_unlock(&sk->sk_callback_lock); 1356 + read_unlock_bh(&sk->sk_callback_lock); 1357 1357 return uid; 1358 1358 } 1359 1359 EXPORT_SYMBOL(sock_i_uid); ··· 1362 1362 { 1363 1363 unsigned long ino; 1364 1364 1365 - read_lock(&sk->sk_callback_lock); 1365 + read_lock_bh(&sk->sk_callback_lock); 1366 1366 ino = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_ino : 0; 1367 - read_unlock(&sk->sk_callback_lock); 1367 + read_unlock_bh(&sk->sk_callback_lock); 1368 1368 return ino; 1369 1369 } 1370 1370 EXPORT_SYMBOL(sock_i_ino);
+1
net/ipv4/Kconfig
··· 217 217 218 218 config NET_IPGRE 219 219 tristate "IP: GRE tunnels over IP" 220 + depends on IPV6 || IPV6=n 220 221 help 221 222 Tunneling means encapsulating data of one protocol type within 222 223 another protocol and sending it over a channel that understands the
+4 -4
net/ipv4/ip_gre.c
··· 45 45 #include <net/netns/generic.h> 46 46 #include <net/rtnetlink.h> 47 47 48 - #ifdef CONFIG_IPV6 48 + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 49 49 #include <net/ipv6.h> 50 50 #include <net/ip6_fib.h> 51 51 #include <net/ip6_route.h> ··· 699 699 if ((dst = rt->rt_gateway) == 0) 700 700 goto tx_error_icmp; 701 701 } 702 - #ifdef CONFIG_IPV6 702 + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 703 703 else if (skb->protocol == htons(ETH_P_IPV6)) { 704 704 struct in6_addr *addr6; 705 705 int addr_type; ··· 774 774 goto tx_error; 775 775 } 776 776 } 777 - #ifdef CONFIG_IPV6 777 + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 778 778 else if (skb->protocol == htons(ETH_P_IPV6)) { 779 779 struct rt6_info *rt6 = (struct rt6_info *)skb_dst(skb); 780 780 ··· 850 850 if ((iph->ttl = tiph->ttl) == 0) { 851 851 if (skb->protocol == htons(ETH_P_IP)) 852 852 iph->ttl = old_iph->ttl; 853 - #ifdef CONFIG_IPV6 853 + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 854 854 else if (skb->protocol == htons(ETH_P_IPV6)) 855 855 iph->ttl = ((struct ipv6hdr *)old_iph)->hop_limit; 856 856 #endif
+13 -6
net/ipv4/ip_output.c
··· 488 488 * we can switch to copy when see the first bad fragment. 489 489 */ 490 490 if (skb_has_frags(skb)) { 491 - struct sk_buff *frag; 491 + struct sk_buff *frag, *frag2; 492 492 int first_len = skb_pagelen(skb); 493 - int truesizes = 0; 494 493 495 494 if (first_len - hlen > mtu || 496 495 ((first_len - hlen) & 7) || ··· 502 503 if (frag->len > mtu || 503 504 ((frag->len & 7) && frag->next) || 504 505 skb_headroom(frag) < hlen) 505 - goto slow_path; 506 + goto slow_path_clean; 506 507 507 508 /* Partially cloned skb? */ 508 509 if (skb_shared(frag)) 509 - goto slow_path; 510 + goto slow_path_clean; 510 511 511 512 BUG_ON(frag->sk); 512 513 if (skb->sk) { 513 514 frag->sk = skb->sk; 514 515 frag->destructor = sock_wfree; 515 516 } 516 - truesizes += frag->truesize; 517 + skb->truesize -= frag->truesize; 517 518 } 518 519 519 520 /* Everything is OK. Generate! */ ··· 523 524 frag = skb_shinfo(skb)->frag_list; 524 525 skb_frag_list_init(skb); 525 526 skb->data_len = first_len - skb_headlen(skb); 526 - skb->truesize -= truesizes; 527 527 skb->len = first_len; 528 528 iph->tot_len = htons(first_len); 529 529 iph->frag_off = htons(IP_MF); ··· 574 576 } 575 577 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS); 576 578 return err; 579 + 580 + slow_path_clean: 581 + skb_walk_frags(skb, frag2) { 582 + if (frag2 == frag) 583 + break; 584 + frag2->sk = NULL; 585 + frag2->destructor = NULL; 586 + skb->truesize += frag2->truesize; 587 + } 577 588 } 578 589 579 590 slow_path:
+1
net/ipv4/netfilter/ipt_REJECT.c
··· 112 112 /* ip_route_me_harder expects skb->dst to be set */ 113 113 skb_dst_set_noref(nskb, skb_dst(oldskb)); 114 114 115 + nskb->protocol = htons(ETH_P_IP); 115 116 if (ip_route_me_harder(nskb, addr_type)) 116 117 goto free_nskb; 117 118
+3 -1
net/ipv4/netfilter/nf_defrag_ipv4.c
··· 66 66 const struct net_device *out, 67 67 int (*okfn)(struct sk_buff *)) 68 68 { 69 + struct sock *sk = skb->sk; 69 70 struct inet_sock *inet = inet_sk(skb->sk); 70 71 71 - if (inet && inet->nodefrag) 72 + if (sk && (sk->sk_family == PF_INET) && 73 + inet->nodefrag) 72 74 return NF_ACCEPT; 73 75 74 76 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
+4 -2
net/ipv4/netfilter/nf_nat_snmp_basic.c
··· 893 893 unsigned char s[4]; 894 894 895 895 if (offset & 1) { 896 - s[0] = s[2] = 0; 896 + s[0] = ~0; 897 897 s[1] = ~*optr; 898 + s[2] = 0; 898 899 s[3] = *nptr; 899 900 } else { 900 - s[1] = s[3] = 0; 901 901 s[0] = ~*optr; 902 + s[1] = ~0; 902 903 s[2] = *nptr; 904 + s[3] = 0; 903 905 } 904 906 905 907 *csum = csum_fold(csum_partial(s, 4, ~csum_unfold(*csum)));
+1 -1
net/ipv4/route.c
··· 1231 1231 } 1232 1232 1233 1233 if (net_ratelimit()) 1234 - printk(KERN_WARNING "Neighbour table overflow.\n"); 1234 + printk(KERN_WARNING "ipv4: Neighbour table overflow.\n"); 1235 1235 rt_drop(rt); 1236 1236 return -ENOBUFS; 1237 1237 }
+6 -3
net/ipv4/tcp.c
··· 386 386 */ 387 387 388 388 mask = 0; 389 - if (sk->sk_err) 390 - mask = POLLERR; 391 389 392 390 /* 393 391 * POLLHUP is certainly not done right. But poll() doesn't ··· 455 457 if (tp->urg_data & TCP_URG_VALID) 456 458 mask |= POLLPRI; 457 459 } 460 + /* This barrier is coupled with smp_wmb() in tcp_reset() */ 461 + smp_rmb(); 462 + if (sk->sk_err) 463 + mask |= POLLERR; 464 + 458 465 return mask; 459 466 } 460 467 EXPORT_SYMBOL(tcp_poll); ··· 943 940 sg = sk->sk_route_caps & NETIF_F_SG; 944 941 945 942 while (--iovlen >= 0) { 946 - int seglen = iov->iov_len; 943 + size_t seglen = iov->iov_len; 947 944 unsigned char __user *from = iov->iov_base; 948 945 949 946 iov++;
+4 -1
net/ipv4/tcp_input.c
··· 2545 2545 cnt += tcp_skb_pcount(skb); 2546 2546 2547 2547 if (cnt > packets) { 2548 - if (tcp_is_sack(tp) || (oldcnt >= packets)) 2548 + if ((tcp_is_sack(tp) && !tcp_is_fack(tp)) || 2549 + (oldcnt >= packets)) 2549 2550 break; 2550 2551 2551 2552 mss = skb_shinfo(skb)->gso_size; ··· 4049 4048 default: 4050 4049 sk->sk_err = ECONNRESET; 4051 4050 } 4051 + /* This barrier is coupled with smp_rmb() in tcp_poll() */ 4052 + smp_wmb(); 4052 4053 4053 4054 if (!sock_flag(sk, SOCK_DEAD)) 4054 4055 sk->sk_error_report(sk);
+14 -10
net/ipv4/tcp_timer.c
··· 135 135 136 136 /* This function calculates a "timeout" which is equivalent to the timeout of a 137 137 * TCP connection after "boundary" unsuccessful, exponentially backed-off 138 - * retransmissions with an initial RTO of TCP_RTO_MIN. 138 + * retransmissions with an initial RTO of TCP_RTO_MIN or TCP_TIMEOUT_INIT if 139 + * syn_set flag is set. 139 140 */ 140 141 static bool retransmits_timed_out(struct sock *sk, 141 - unsigned int boundary) 142 + unsigned int boundary, 143 + bool syn_set) 142 144 { 143 145 unsigned int timeout, linear_backoff_thresh; 144 146 unsigned int start_ts; 147 + unsigned int rto_base = syn_set ? TCP_TIMEOUT_INIT : TCP_RTO_MIN; 145 148 146 149 if (!inet_csk(sk)->icsk_retransmits) 147 150 return false; ··· 154 151 else 155 152 start_ts = tcp_sk(sk)->retrans_stamp; 156 153 157 - linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN); 154 + linear_backoff_thresh = ilog2(TCP_RTO_MAX/rto_base); 158 155 159 156 if (boundary <= linear_backoff_thresh) 160 - timeout = ((2 << boundary) - 1) * TCP_RTO_MIN; 157 + timeout = ((2 << boundary) - 1) * rto_base; 161 158 else 162 - timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN + 159 + timeout = ((2 << linear_backoff_thresh) - 1) * rto_base + 163 160 (boundary - linear_backoff_thresh) * TCP_RTO_MAX; 164 161 165 162 return (tcp_time_stamp - start_ts) >= timeout; ··· 170 167 { 171 168 struct inet_connection_sock *icsk = inet_csk(sk); 172 169 int retry_until; 173 - bool do_reset; 170 + bool do_reset, syn_set = 0; 174 171 175 172 if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) { 176 173 if (icsk->icsk_retransmits) 177 174 dst_negative_advice(sk); 178 175 retry_until = icsk->icsk_syn_retries ? : sysctl_tcp_syn_retries; 176 + syn_set = 1; 179 177 } else { 180 - if (retransmits_timed_out(sk, sysctl_tcp_retries1)) { 178 + if (retransmits_timed_out(sk, sysctl_tcp_retries1, 0)) { 181 179 /* Black hole detection */ 182 180 tcp_mtu_probing(icsk, sk); 183 181 ··· 191 187 192 188 retry_until = tcp_orphan_retries(sk, alive); 193 189 do_reset = alive || 194 - !retransmits_timed_out(sk, retry_until); 190 + !retransmits_timed_out(sk, retry_until, 0); 195 191 196 192 if (tcp_out_of_resources(sk, do_reset)) 197 193 return 1; 198 194 } 199 195 } 200 196 201 - if (retransmits_timed_out(sk, retry_until)) { 197 + if (retransmits_timed_out(sk, retry_until, syn_set)) { 202 198 /* Has it gone just too far? */ 203 199 tcp_write_err(sk); 204 200 return 1; ··· 440 436 icsk->icsk_rto = min(icsk->icsk_rto << 1, TCP_RTO_MAX); 441 437 } 442 438 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, TCP_RTO_MAX); 443 - if (retransmits_timed_out(sk, sysctl_tcp_retries1 + 1)) 439 + if (retransmits_timed_out(sk, sysctl_tcp_retries1 + 1, 0)) 444 440 __sk_dst_reset(sk); 445 441 446 442 out:;
+1 -1
net/ipv4/xfrm4_policy.c
··· 61 61 62 62 static int xfrm4_get_tos(struct flowi *fl) 63 63 { 64 - return fl->fl4_tos; 64 + return IPTOS_RT_MASK & fl->fl4_tos; /* Strip ECN bits */ 65 65 } 66 66 67 67 static int xfrm4_init_path(struct xfrm_dst *path, struct dst_entry *dst,
+19 -14
net/ipv4/xfrm4_state.c
··· 21 21 } 22 22 23 23 static void 24 - __xfrm4_init_tempsel(struct xfrm_state *x, struct flowi *fl, 25 - struct xfrm_tmpl *tmpl, 26 - xfrm_address_t *daddr, xfrm_address_t *saddr) 24 + __xfrm4_init_tempsel(struct xfrm_selector *sel, struct flowi *fl) 27 25 { 28 - x->sel.daddr.a4 = fl->fl4_dst; 29 - x->sel.saddr.a4 = fl->fl4_src; 30 - x->sel.dport = xfrm_flowi_dport(fl); 31 - x->sel.dport_mask = htons(0xffff); 32 - x->sel.sport = xfrm_flowi_sport(fl); 33 - x->sel.sport_mask = htons(0xffff); 34 - x->sel.family = AF_INET; 35 - x->sel.prefixlen_d = 32; 36 - x->sel.prefixlen_s = 32; 37 - x->sel.proto = fl->proto; 38 - x->sel.ifindex = fl->oif; 26 + sel->daddr.a4 = fl->fl4_dst; 27 + sel->saddr.a4 = fl->fl4_src; 28 + sel->dport = xfrm_flowi_dport(fl); 29 + sel->dport_mask = htons(0xffff); 30 + sel->sport = xfrm_flowi_sport(fl); 31 + sel->sport_mask = htons(0xffff); 32 + sel->family = AF_INET; 33 + sel->prefixlen_d = 32; 34 + sel->prefixlen_s = 32; 35 + sel->proto = fl->proto; 36 + sel->ifindex = fl->oif; 37 + } 38 + 39 + static void 40 + xfrm4_init_temprop(struct xfrm_state *x, struct xfrm_tmpl *tmpl, 41 + xfrm_address_t *daddr, xfrm_address_t *saddr) 42 + { 39 43 x->id = tmpl->id; 40 44 if (x->id.daddr.a4 == 0) 41 45 x->id.daddr.a4 = daddr->a4; ··· 74 70 .owner = THIS_MODULE, 75 71 .init_flags = xfrm4_init_flags, 76 72 .init_tempsel = __xfrm4_init_tempsel, 73 + .init_temprop = xfrm4_init_temprop, 77 74 .output = xfrm4_output, 78 75 .extract_input = xfrm4_extract_input, 79 76 .extract_output = xfrm4_extract_output,
+8 -3
net/ipv6/addrconf.c
··· 4637 4637 if (err < 0) { 4638 4638 printk(KERN_CRIT "IPv6 Addrconf:" 4639 4639 " cannot initialize default policy table: %d.\n", err); 4640 - return err; 4640 + goto out; 4641 4641 } 4642 4642 4643 - register_pernet_subsys(&addrconf_ops); 4643 + err = register_pernet_subsys(&addrconf_ops); 4644 + if (err < 0) 4645 + goto out_addrlabel; 4644 4646 4645 4647 /* The addrconf netdev notifier requires that loopback_dev 4646 4648 * has it's ipv6 private information allocated and setup ··· 4694 4692 unregister_netdevice_notifier(&ipv6_dev_notf); 4695 4693 errlo: 4696 4694 unregister_pernet_subsys(&addrconf_ops); 4697 - 4695 + out_addrlabel: 4696 + ipv6_addr_label_cleanup(); 4697 + out: 4698 4698 return err; 4699 4699 } 4700 4700 ··· 4707 4703 4708 4704 unregister_netdevice_notifier(&ipv6_dev_notf); 4709 4705 unregister_pernet_subsys(&addrconf_ops); 4706 + ipv6_addr_label_cleanup(); 4710 4707 4711 4708 rtnl_lock(); 4712 4709
+5
net/ipv6/addrlabel.c
··· 393 393 return register_pernet_subsys(&ipv6_addr_label_ops); 394 394 } 395 395 396 + void ipv6_addr_label_cleanup(void) 397 + { 398 + unregister_pernet_subsys(&ipv6_addr_label_ops); 399 + } 400 + 396 401 static const struct nla_policy ifal_policy[IFAL_MAX+1] = { 397 402 [IFAL_ADDRESS] = { .len = sizeof(struct in6_addr), }, 398 403 [IFAL_LABEL] = { .len = sizeof(u32), },
+13 -5
net/ipv6/ip6_output.c
··· 639 639 640 640 if (skb_has_frags(skb)) { 641 641 int first_len = skb_pagelen(skb); 642 - int truesizes = 0; 642 + struct sk_buff *frag2; 643 643 644 644 if (first_len - hlen > mtu || 645 645 ((first_len - hlen) & 7) || ··· 651 651 if (frag->len > mtu || 652 652 ((frag->len & 7) && frag->next) || 653 653 skb_headroom(frag) < hlen) 654 - goto slow_path; 654 + goto slow_path_clean; 655 655 656 656 /* Partially cloned skb? */ 657 657 if (skb_shared(frag)) 658 - goto slow_path; 658 + goto slow_path_clean; 659 659 660 660 BUG_ON(frag->sk); 661 661 if (skb->sk) { 662 662 frag->sk = skb->sk; 663 663 frag->destructor = sock_wfree; 664 - truesizes += frag->truesize; 665 664 } 665 + skb->truesize -= frag->truesize; 666 666 } 667 667 668 668 err = 0; ··· 693 693 694 694 first_len = skb_pagelen(skb); 695 695 skb->data_len = first_len - skb_headlen(skb); 696 - skb->truesize -= truesizes; 697 696 skb->len = first_len; 698 697 ipv6_hdr(skb)->payload_len = htons(first_len - 699 698 sizeof(struct ipv6hdr)); ··· 755 756 IPSTATS_MIB_FRAGFAILS); 756 757 dst_release(&rt->dst); 757 758 return err; 759 + 760 + slow_path_clean: 761 + skb_walk_frags(skb, frag2) { 762 + if (frag2 == frag) 763 + break; 764 + frag2->sk = NULL; 765 + frag2->destructor = NULL; 766 + skb->truesize += frag2->truesize; 767 + } 758 768 } 759 769 760 770 slow_path:
+1 -1
net/ipv6/route.c
··· 670 670 671 671 if (net_ratelimit()) 672 672 printk(KERN_WARNING 673 - "Neighbour table overflow.\n"); 673 + "ipv6: Neighbour table overflow.\n"); 674 674 dst_free(&rt->dst); 675 675 return NULL; 676 676 }
+19 -14
net/ipv6/xfrm6_state.c
··· 20 20 #include <net/addrconf.h> 21 21 22 22 static void 23 - __xfrm6_init_tempsel(struct xfrm_state *x, struct flowi *fl, 24 - struct xfrm_tmpl *tmpl, 25 - xfrm_address_t *daddr, xfrm_address_t *saddr) 23 + __xfrm6_init_tempsel(struct xfrm_selector *sel, struct flowi *fl) 26 24 { 27 25 /* Initialize temporary selector matching only 28 26 * to current session. */ 29 - ipv6_addr_copy((struct in6_addr *)&x->sel.daddr, &fl->fl6_dst); 30 - ipv6_addr_copy((struct in6_addr *)&x->sel.saddr, &fl->fl6_src); 31 - x->sel.dport = xfrm_flowi_dport(fl); 32 - x->sel.dport_mask = htons(0xffff); 33 - x->sel.sport = xfrm_flowi_sport(fl); 34 - x->sel.sport_mask = htons(0xffff); 35 - x->sel.family = AF_INET6; 36 - x->sel.prefixlen_d = 128; 37 - x->sel.prefixlen_s = 128; 38 - x->sel.proto = fl->proto; 39 - x->sel.ifindex = fl->oif; 27 + ipv6_addr_copy((struct in6_addr *)&sel->daddr, &fl->fl6_dst); 28 + ipv6_addr_copy((struct in6_addr *)&sel->saddr, &fl->fl6_src); 29 + sel->dport = xfrm_flowi_dport(fl); 30 + sel->dport_mask = htons(0xffff); 31 + sel->sport = xfrm_flowi_sport(fl); 32 + sel->sport_mask = htons(0xffff); 33 + sel->family = AF_INET6; 34 + sel->prefixlen_d = 128; 35 + sel->prefixlen_s = 128; 36 + sel->proto = fl->proto; 37 + sel->ifindex = fl->oif; 38 + } 39 + 40 + static void 41 + xfrm6_init_temprop(struct xfrm_state *x, struct xfrm_tmpl *tmpl, 42 + xfrm_address_t *daddr, xfrm_address_t *saddr) 43 + { 40 44 x->id = tmpl->id; 41 45 if (ipv6_addr_any((struct in6_addr*)&x->id.daddr)) 42 46 memcpy(&x->id.daddr, daddr, sizeof(x->sel.daddr)); ··· 172 168 .eth_proto = htons(ETH_P_IPV6), 173 169 .owner = THIS_MODULE, 174 170 .init_tempsel = __xfrm6_init_tempsel, 171 + .init_temprop = xfrm6_init_temprop, 175 172 .tmpl_sort = __xfrm6_tmpl_sort, 176 173 .state_sort = __xfrm6_state_sort, 177 174 .output = xfrm6_output,
-4
net/mac80211/rx.c
··· 2199 2199 struct net_device *prev_dev = NULL; 2200 2200 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 2201 2201 2202 - if (status->flag & RX_FLAG_INTERNAL_CMTR) 2203 - goto out_free_skb; 2204 - 2205 2202 if (skb_headroom(skb) < sizeof(*rthdr) && 2206 2203 pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC)) 2207 2204 goto out_free_skb; ··· 2257 2260 } else 2258 2261 goto out_free_skb; 2259 2262 2260 - status->flag |= RX_FLAG_INTERNAL_CMTR; 2261 2263 return; 2262 2264 2263 2265 out_free_skb:
+3 -1
net/netfilter/nf_conntrack_extend.c
··· 48 48 { 49 49 unsigned int off, len; 50 50 struct nf_ct_ext_type *t; 51 + size_t alloc_size; 51 52 52 53 rcu_read_lock(); 53 54 t = rcu_dereference(nf_ct_ext_types[id]); 54 55 BUG_ON(t == NULL); 55 56 off = ALIGN(sizeof(struct nf_ct_ext), t->align); 56 57 len = off + t->len; 58 + alloc_size = t->alloc_size; 57 59 rcu_read_unlock(); 58 60 59 - *ext = kzalloc(t->alloc_size, gfp); 61 + *ext = kzalloc(alloc_size, gfp); 60 62 if (!*ext) 61 63 return NULL; 62 64
+1 -1
net/netfilter/nf_conntrack_sip.c
··· 1376 1376 unsigned int msglen, origlen; 1377 1377 const char *dptr, *end; 1378 1378 s16 diff, tdiff = 0; 1379 - int ret; 1379 + int ret = NF_ACCEPT; 1380 1380 typeof(nf_nat_sip_seq_adjust_hook) nf_nat_sip_seq_adjust; 1381 1381 1382 1382 if (ctinfo != IP_CT_ESTABLISHED &&
+5 -1
net/netfilter/nf_tproxy_core.c
··· 70 70 int 71 71 nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk) 72 72 { 73 - if (inet_sk(sk)->transparent) { 73 + bool transparent = (sk->sk_state == TCP_TIME_WAIT) ? 74 + inet_twsk(sk)->tw_transparent : 75 + inet_sk(sk)->transparent; 76 + 77 + if (transparent) { 74 78 skb_orphan(skb); 75 79 skb->sk = sk; 76 80 skb->destructor = nf_tproxy_destructor;
+2 -1
net/phonet/pep.c
··· 225 225 static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb) 226 226 { 227 227 struct pep_sock *pn = pep_sk(sk); 228 - struct pnpipehdr *hdr = pnp_hdr(skb); 228 + struct pnpipehdr *hdr; 229 229 int wake = 0; 230 230 231 231 if (!pskb_may_pull(skb, sizeof(*hdr) + 4)) 232 232 return -EINVAL; 233 233 234 + hdr = pnp_hdr(skb); 234 235 if (hdr->data[0] != PN_PEP_TYPE_COMMON) { 235 236 LIMIT_NETDEBUG(KERN_DEBUG"Phonet unknown PEP type: %u\n", 236 237 (unsigned)hdr->data[0]);
+2 -2
net/rds/tcp_connect.c
··· 43 43 struct rds_connection *conn; 44 44 struct rds_tcp_connection *tc; 45 45 46 - read_lock(&sk->sk_callback_lock); 46 + read_lock_bh(&sk->sk_callback_lock); 47 47 conn = sk->sk_user_data; 48 48 if (conn == NULL) { 49 49 state_change = sk->sk_state_change; ··· 68 68 break; 69 69 } 70 70 out: 71 - read_unlock(&sk->sk_callback_lock); 71 + read_unlock_bh(&sk->sk_callback_lock); 72 72 state_change(sk); 73 73 } 74 74
+2 -2
net/rds/tcp_listen.c
··· 114 114 115 115 rdsdebug("listen data ready sk %p\n", sk); 116 116 117 - read_lock(&sk->sk_callback_lock); 117 + read_lock_bh(&sk->sk_callback_lock); 118 118 ready = sk->sk_user_data; 119 119 if (ready == NULL) { /* check for teardown race */ 120 120 ready = sk->sk_data_ready; ··· 131 131 queue_work(rds_wq, &rds_tcp_listen_work); 132 132 133 133 out: 134 - read_unlock(&sk->sk_callback_lock); 134 + read_unlock_bh(&sk->sk_callback_lock); 135 135 ready(sk, bytes); 136 136 } 137 137
+2 -2
net/rds/tcp_recv.c
··· 324 324 325 325 rdsdebug("data ready sk %p bytes %d\n", sk, bytes); 326 326 327 - read_lock(&sk->sk_callback_lock); 327 + read_lock_bh(&sk->sk_callback_lock); 328 328 conn = sk->sk_user_data; 329 329 if (conn == NULL) { /* check for teardown race */ 330 330 ready = sk->sk_data_ready; ··· 338 338 if (rds_tcp_read_sock(conn, GFP_ATOMIC, KM_SOFTIRQ0) == -ENOMEM) 339 339 queue_delayed_work(rds_wq, &conn->c_recv_w, 0); 340 340 out: 341 - read_unlock(&sk->sk_callback_lock); 341 + read_unlock_bh(&sk->sk_callback_lock); 342 342 ready(sk, bytes); 343 343 } 344 344
+2 -2
net/rds/tcp_send.c
··· 224 224 struct rds_connection *conn; 225 225 struct rds_tcp_connection *tc; 226 226 227 - read_lock(&sk->sk_callback_lock); 227 + read_lock_bh(&sk->sk_callback_lock); 228 228 conn = sk->sk_user_data; 229 229 if (conn == NULL) { 230 230 write_space = sk->sk_write_space; ··· 244 244 queue_delayed_work(rds_wq, &conn->c_send_w, 0); 245 245 246 246 out: 247 - read_unlock(&sk->sk_callback_lock); 247 + read_unlock_bh(&sk->sk_callback_lock); 248 248 249 249 /* 250 250 * write_space is only called when data leaves tcp's send queue if
+2 -2
net/rose/af_rose.c
··· 679 679 if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1) 680 680 return -EINVAL; 681 681 682 - if (addr->srose_ndigis > ROSE_MAX_DIGIS) 682 + if ((unsigned int) addr->srose_ndigis > ROSE_MAX_DIGIS) 683 683 return -EINVAL; 684 684 685 685 if ((dev = rose_dev_get(&addr->srose_addr)) == NULL) { ··· 739 739 if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1) 740 740 return -EINVAL; 741 741 742 - if (addr->srose_ndigis > ROSE_MAX_DIGIS) 742 + if ((unsigned int) addr->srose_ndigis > ROSE_MAX_DIGIS) 743 743 return -EINVAL; 744 744 745 745 /* Source + Destination digis should not exceed ROSE_MAX_DIGIS */
+14 -14
net/sunrpc/xprtsock.c
··· 800 800 u32 _xid; 801 801 __be32 *xp; 802 802 803 - read_lock(&sk->sk_callback_lock); 803 + read_lock_bh(&sk->sk_callback_lock); 804 804 dprintk("RPC: xs_udp_data_ready...\n"); 805 805 if (!(xprt = xprt_from_sock(sk))) 806 806 goto out; ··· 852 852 dropit: 853 853 skb_free_datagram(sk, skb); 854 854 out: 855 - read_unlock(&sk->sk_callback_lock); 855 + read_unlock_bh(&sk->sk_callback_lock); 856 856 } 857 857 858 858 static inline void xs_tcp_read_fraghdr(struct rpc_xprt *xprt, struct xdr_skb_reader *desc) ··· 1229 1229 1230 1230 dprintk("RPC: xs_tcp_data_ready...\n"); 1231 1231 1232 - read_lock(&sk->sk_callback_lock); 1232 + read_lock_bh(&sk->sk_callback_lock); 1233 1233 if (!(xprt = xprt_from_sock(sk))) 1234 1234 goto out; 1235 1235 if (xprt->shutdown) ··· 1248 1248 read = tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv); 1249 1249 } while (read > 0); 1250 1250 out: 1251 - read_unlock(&sk->sk_callback_lock); 1251 + read_unlock_bh(&sk->sk_callback_lock); 1252 1252 } 1253 1253 1254 1254 /* ··· 1301 1301 { 1302 1302 struct rpc_xprt *xprt; 1303 1303 1304 - read_lock(&sk->sk_callback_lock); 1304 + read_lock_bh(&sk->sk_callback_lock); 1305 1305 if (!(xprt = xprt_from_sock(sk))) 1306 1306 goto out; 1307 1307 dprintk("RPC: xs_tcp_state_change client %p...\n", xprt); ··· 1313 1313 1314 1314 switch (sk->sk_state) { 1315 1315 case TCP_ESTABLISHED: 1316 - spin_lock_bh(&xprt->transport_lock); 1316 + spin_lock(&xprt->transport_lock); 1317 1317 if (!xprt_test_and_set_connected(xprt)) { 1318 1318 struct sock_xprt *transport = container_of(xprt, 1319 1319 struct sock_xprt, xprt); ··· 1327 1327 1328 1328 xprt_wake_pending_tasks(xprt, -EAGAIN); 1329 1329 } 1330 - spin_unlock_bh(&xprt->transport_lock); 1330 + spin_unlock(&xprt->transport_lock); 1331 1331 break; 1332 1332 case TCP_FIN_WAIT1: 1333 1333 /* The client initiated a shutdown of the socket */ ··· 1365 1365 xs_sock_mark_closed(xprt); 1366 1366 } 1367 1367 out: 1368 - read_unlock(&sk->sk_callback_lock); 1368 + read_unlock_bh(&sk->sk_callback_lock); 1369 1369 } 1370 1370 1371 1371 /** ··· 1376 1376 { 1377 1377 struct rpc_xprt *xprt; 1378 1378 1379 - read_lock(&sk->sk_callback_lock); 1379 + read_lock_bh(&sk->sk_callback_lock); 1380 1380 if (!(xprt = xprt_from_sock(sk))) 1381 1381 goto out; 1382 1382 dprintk("RPC: %s client %p...\n" ··· 1384 1384 __func__, xprt, sk->sk_err); 1385 1385 xprt_wake_pending_tasks(xprt, -EAGAIN); 1386 1386 out: 1387 - read_unlock(&sk->sk_callback_lock); 1387 + read_unlock_bh(&sk->sk_callback_lock); 1388 1388 } 1389 1389 1390 1390 static void xs_write_space(struct sock *sk) ··· 1416 1416 */ 1417 1417 static void xs_udp_write_space(struct sock *sk) 1418 1418 { 1419 - read_lock(&sk->sk_callback_lock); 1419 + read_lock_bh(&sk->sk_callback_lock); 1420 1420 1421 1421 /* from net/core/sock.c:sock_def_write_space */ 1422 1422 if (sock_writeable(sk)) 1423 1423 xs_write_space(sk); 1424 1424 1425 - read_unlock(&sk->sk_callback_lock); 1425 + read_unlock_bh(&sk->sk_callback_lock); 1426 1426 } 1427 1427 1428 1428 /** ··· 1437 1437 */ 1438 1438 static void xs_tcp_write_space(struct sock *sk) 1439 1439 { 1440 - read_lock(&sk->sk_callback_lock); 1440 + read_lock_bh(&sk->sk_callback_lock); 1441 1441 1442 1442 /* from net/core/stream.c:sk_stream_write_space */ 1443 1443 if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk)) 1444 1444 xs_write_space(sk); 1445 1445 1446 - read_unlock(&sk->sk_callback_lock); 1446 + read_unlock_bh(&sk->sk_callback_lock); 1447 1447 } 1448 1448 1449 1449 static void xs_udp_do_set_buffer_size(struct rpc_xprt *xprt)
+1 -1
net/wireless/wext-priv.c
··· 152 152 } else if (!iwp->pointer) 153 153 return -EFAULT; 154 154 155 - extra = kmalloc(extra_size, GFP_KERNEL); 155 + extra = kzalloc(extra_size, GFP_KERNEL); 156 156 if (!extra) 157 157 return -ENOMEM; 158 158
+2 -3
net/xfrm/xfrm_policy.c
··· 1175 1175 tmpl->mode == XFRM_MODE_BEET) { 1176 1176 remote = &tmpl->id.daddr; 1177 1177 local = &tmpl->saddr; 1178 - family = tmpl->encap_family; 1179 - if (xfrm_addr_any(local, family)) { 1180 - error = xfrm_get_saddr(net, &tmp, remote, family); 1178 + if (xfrm_addr_any(local, tmpl->encap_family)) { 1179 + error = xfrm_get_saddr(net, &tmp, remote, tmpl->encap_family); 1181 1180 if (error) 1182 1181 goto fail; 1183 1182 local = &tmp;
+27 -18
net/xfrm/xfrm_state.c
··· 656 656 EXPORT_SYMBOL(xfrm_sad_getinfo); 657 657 658 658 static int 659 - xfrm_init_tempsel(struct xfrm_state *x, struct flowi *fl, 660 - struct xfrm_tmpl *tmpl, 661 - xfrm_address_t *daddr, xfrm_address_t *saddr, 662 - unsigned short family) 659 + xfrm_init_tempstate(struct xfrm_state *x, struct flowi *fl, 660 + struct xfrm_tmpl *tmpl, 661 + xfrm_address_t *daddr, xfrm_address_t *saddr, 662 + unsigned short family) 663 663 { 664 664 struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); 665 665 if (!afinfo) 666 666 return -1; 667 - afinfo->init_tempsel(x, fl, tmpl, daddr, saddr); 667 + afinfo->init_tempsel(&x->sel, fl); 668 + 669 + if (family != tmpl->encap_family) { 670 + xfrm_state_put_afinfo(afinfo); 671 + afinfo = xfrm_state_get_afinfo(tmpl->encap_family); 672 + if (!afinfo) 673 + return -1; 674 + } 675 + afinfo->init_temprop(x, tmpl, daddr, saddr); 668 676 xfrm_state_put_afinfo(afinfo); 669 677 return 0; 670 678 } ··· 798 790 int error = 0; 799 791 struct xfrm_state *best = NULL; 800 792 u32 mark = pol->mark.v & pol->mark.m; 793 + unsigned short encap_family = tmpl->encap_family; 801 794 802 795 to_put = NULL; 803 796 804 797 spin_lock_bh(&xfrm_state_lock); 805 - h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, family); 798 + h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family); 806 799 hlist_for_each_entry(x, entry, net->xfrm.state_bydst+h, bydst) { 807 - if (x->props.family == family && 800 + if (x->props.family == encap_family && 808 801 x->props.reqid == tmpl->reqid && 809 802 (mark & x->mark.m) == x->mark.v && 810 803 !(x->props.flags & XFRM_STATE_WILDRECV) && 811 - xfrm_state_addr_check(x, daddr, saddr, family) && 804 + xfrm_state_addr_check(x, daddr, saddr, encap_family) && 812 805 tmpl->mode == x->props.mode && 813 806 tmpl->id.proto == x->id.proto && 814 807 (tmpl->id.spi == x->id.spi || !tmpl->id.spi)) 815 - xfrm_state_look_at(pol, x, fl, family, daddr, saddr, 808 + xfrm_state_look_at(pol, x, fl, encap_family, daddr, saddr, 816 809 &best, &acquire_in_progress, &error); 817 810 } 818 811 if (best) 819 812 goto found; 820 813 821 - h_wildcard = xfrm_dst_hash(net, daddr, &saddr_wildcard, tmpl->reqid, family); 814 + h_wildcard = xfrm_dst_hash(net, daddr, &saddr_wildcard, tmpl->reqid, encap_family); 822 815 hlist_for_each_entry(x, entry, net->xfrm.state_bydst+h_wildcard, bydst) { 823 - if (x->props.family == family && 816 + if (x->props.family == encap_family && 824 817 x->props.reqid == tmpl->reqid && 825 818 (mark & x->mark.m) == x->mark.v && 826 819 !(x->props.flags & XFRM_STATE_WILDRECV) && 827 - xfrm_state_addr_check(x, daddr, saddr, family) && 820 + xfrm_state_addr_check(x, daddr, saddr, encap_family) && 828 821 tmpl->mode == x->props.mode && 829 822 tmpl->id.proto == x->id.proto && 830 823 (tmpl->id.spi == x->id.spi || !tmpl->id.spi)) 831 - xfrm_state_look_at(pol, x, fl, family, daddr, saddr, 824 + xfrm_state_look_at(pol, x, fl, encap_family, daddr, saddr, 832 825 &best, &acquire_in_progress, &error); 833 826 } 834 827 ··· 838 829 if (!x && !error && !acquire_in_progress) { 839 830 if (tmpl->id.spi && 840 831 (x0 = __xfrm_state_lookup(net, mark, daddr, tmpl->id.spi, 841 - tmpl->id.proto, family)) != NULL) { 832 + tmpl->id.proto, encap_family)) != NULL) { 842 833 to_put = x0; 843 834 error = -EEXIST; 844 835 goto out; ··· 848 839 error = -ENOMEM; 849 840 goto out; 850 841 } 851 - /* Initialize temporary selector matching only 842 + /* Initialize temporary state matching only 852 843 * to current session. */ 853 - xfrm_init_tempsel(x, fl, tmpl, daddr, saddr, family); 844 + xfrm_init_tempstate(x, fl, tmpl, daddr, saddr, family); 854 845 memcpy(&x->mark, &pol->mark, sizeof(x->mark)); 855 846 856 847 error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid); ··· 865 856 x->km.state = XFRM_STATE_ACQ; 866 857 list_add(&x->km.all, &net->xfrm.state_all); 867 858 hlist_add_head(&x->bydst, net->xfrm.state_bydst+h); 868 - h = xfrm_src_hash(net, daddr, saddr, family); 859 + h = xfrm_src_hash(net, daddr, saddr, encap_family); 869 860 hlist_add_head(&x->bysrc, net->xfrm.state_bysrc+h); 870 861 if (x->id.spi) { 871 - h = xfrm_spi_hash(net, &x->id.daddr, x->id.spi, x->id.proto, family); 862 + h = xfrm_spi_hash(net, &x->id.daddr, x->id.spi, x->id.proto, encap_family); 872 863 hlist_add_head(&x->byspi, net->xfrm.state_byspi+h); 873 864 } 874 865 x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires;
+9 -8
samples/kfifo/dma-example.c
··· 24 24 { 25 25 int i; 26 26 unsigned int ret; 27 + unsigned int nents; 27 28 struct scatterlist sg[10]; 28 29 29 30 printk(KERN_INFO "DMA fifo test start\n"); ··· 62 61 * byte at the beginning, after the kfifo_skip(). 63 62 */ 64 63 sg_init_table(sg, ARRAY_SIZE(sg)); 65 - ret = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE); 66 - printk(KERN_INFO "DMA sgl entries: %d\n", ret); 67 - if (!ret) { 64 + nents = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE); 65 + printk(KERN_INFO "DMA sgl entries: %d\n", nents); 66 + if (!nents) { 68 67 /* fifo is full and no sgl was created */ 69 68 printk(KERN_WARNING "error kfifo_dma_in_prepare\n"); 70 69 return -EIO; ··· 72 71 73 72 /* receive data */ 74 73 printk(KERN_INFO "scatterlist for receive:\n"); 75 - for (i = 0; i < ARRAY_SIZE(sg); i++) { 74 + for (i = 0; i < nents; i++) { 76 75 printk(KERN_INFO 77 76 "sg[%d] -> " 78 77 "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n", ··· 92 91 kfifo_dma_in_finish(&fifo, ret); 93 92 94 93 /* Prepare to transmit data, example: 8 bytes */ 95 - ret = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8); 96 - printk(KERN_INFO "DMA sgl entries: %d\n", ret); 97 - if (!ret) { 94 + nents = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8); 95 + printk(KERN_INFO "DMA sgl entries: %d\n", nents); 96 + if (!nents) { 98 97 /* no data was available and no sgl was created */ 99 98 printk(KERN_WARNING "error kfifo_dma_out_prepare\n"); 100 99 return -EIO; 101 100 } 102 101 103 102 printk(KERN_INFO "scatterlist for transmit:\n"); 104 - for (i = 0; i < ARRAY_SIZE(sg); i++) { 103 + for (i = 0; i < nents; i++) { 105 104 printk(KERN_INFO 106 105 "sg[%d] -> " 107 106 "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n",
+5 -1
security/tomoyo/common.c
··· 1416 1416 const pid_t gpid = task_pid_nr(current); 1417 1417 static const int tomoyo_buffer_len = 4096; 1418 1418 char *buffer = kmalloc(tomoyo_buffer_len, GFP_NOFS); 1419 + pid_t ppid; 1419 1420 if (!buffer) 1420 1421 return NULL; 1421 1422 do_gettimeofday(&tv); 1423 + rcu_read_lock(); 1424 + ppid = task_tgid_vnr(current->real_parent); 1425 + rcu_read_unlock(); 1422 1426 snprintf(buffer, tomoyo_buffer_len - 1, 1423 1427 "#timestamp=%lu profile=%u mode=%s (global-pid=%u)" 1424 1428 " task={ pid=%u ppid=%u uid=%u gid=%u euid=%u" 1425 1429 " egid=%u suid=%u sgid=%u fsuid=%u fsgid=%u }", 1426 1430 tv.tv_sec, r->profile, tomoyo_mode[r->mode], gpid, 1427 - (pid_t) sys_getpid(), (pid_t) sys_getppid(), 1431 + task_tgid_vnr(current), ppid, 1428 1432 current_uid(), current_gid(), current_euid(), 1429 1433 current_egid(), current_suid(), current_sgid(), 1430 1434 current_fsuid(), current_fsgid());
-3
security/tomoyo/common.h
··· 689 689 690 690 /********** Function prototypes. **********/ 691 691 692 - extern asmlinkage long sys_getpid(void); 693 - extern asmlinkage long sys_getppid(void); 694 - 695 692 /* Check whether the given string starts with the given keyword. */ 696 693 bool tomoyo_str_starts(char **src, const char *find); 697 694 /* Get tomoyo_realpath() of current process. */
+5
sound/core/control.c
··· 31 31 32 32 /* max number of user-defined controls */ 33 33 #define MAX_USER_CONTROLS 32 34 + #define MAX_CONTROL_COUNT 1028 34 35 35 36 struct snd_kctl_ioctl { 36 37 struct list_head list; /* list of all ioctls */ ··· 196 195 197 196 if (snd_BUG_ON(!control || !control->count)) 198 197 return NULL; 198 + 199 + if (control->count > MAX_CONTROL_COUNT) 200 + return NULL; 201 + 199 202 kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL); 200 203 if (kctl == NULL) { 201 204 snd_printk(KERN_ERR "Cannot allocate control instance\n");
+1 -1
sound/i2c/other/ak4xxx-adda.c
··· 900 900 return 0; 901 901 } 902 902 #else /* !CONFIG_PROC_FS */ 903 - static int proc_init(struct snd_akm4xxx *ak) {} 903 + static int proc_init(struct snd_akm4xxx *ak) { return 0; } 904 904 #endif 905 905 906 906 int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak)
+1
sound/pci/hda/patch_analog.c
··· 3641 3641 /* Lenovo Thinkpad T61/X61 */ 3642 3642 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD), 3643 3643 SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP), 3644 + SND_PCI_QUIRK(0x1028, 0x0233, "Dell Latitude E6400", AD1984_DELL_DESKTOP), 3644 3645 {} 3645 3646 }; 3646 3647
+16 -6
sound/pci/hda/patch_realtek.c
··· 1594 1594 } 1595 1595 1596 1596 if (spec->autocfg.dig_in_pin) { 1597 - hda_nid_t dig_nid; 1598 - err = snd_hda_get_connections(codec, 1599 - spec->autocfg.dig_in_pin, 1600 - &dig_nid, 1); 1601 - if (err > 0) 1602 - spec->dig_in_nid = dig_nid; 1597 + dig_nid = codec->start_nid; 1598 + for (i = 0; i < codec->num_nodes; i++, dig_nid++) { 1599 + unsigned int wcaps = get_wcaps(codec, dig_nid); 1600 + if (get_wcaps_type(wcaps) != AC_WID_AUD_IN) 1601 + continue; 1602 + if (!(wcaps & AC_WCAP_DIGITAL)) 1603 + continue; 1604 + if (!(wcaps & AC_WCAP_CONN_LIST)) 1605 + continue; 1606 + err = get_connection_index(codec, dig_nid, 1607 + spec->autocfg.dig_in_pin); 1608 + if (err >= 0) { 1609 + spec->dig_in_nid = dig_nid; 1610 + break; 1611 + } 1612 + } 1603 1613 } 1604 1614 } 1605 1615
+4
sound/pci/oxygen/oxygen.c
··· 543 543 chip->model.suspend = claro_suspend; 544 544 chip->model.resume = claro_resume; 545 545 chip->model.set_adc_params = set_ak5385_params; 546 + chip->model.device_config = PLAYBACK_0_TO_I2S | 547 + PLAYBACK_1_TO_SPDIF | 548 + CAPTURE_0_FROM_I2S_2 | 549 + CAPTURE_1_FROM_SPDIF; 546 550 break; 547 551 } 548 552 if (id->driver_data == MODEL_MERIDIAN ||
+1
sound/pci/rme9652/hdsp.c
··· 4609 4609 if (err < 0) 4610 4610 return err; 4611 4611 4612 + memset(&info, 0, sizeof(info)); 4612 4613 spin_lock_irqsave(&hdsp->lock, flags); 4613 4614 info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp); 4614 4615 info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp);
+1
sound/pci/rme9652/hdspm.c
··· 4127 4127 4128 4128 case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO: 4129 4129 4130 + memset(&info, 0, sizeof(info)); 4130 4131 spin_lock_irq(&hdspm->lock); 4131 4132 info.pref_sync_ref = hdspm_pref_sync_ref(hdspm); 4132 4133 info.wordclock_sync_check = hdspm_wc_sync_check(hdspm);
+13 -2
sound/soc/sh/migor.c
··· 12 12 #include <linux/firmware.h> 13 13 #include <linux/module.h> 14 14 15 + #include <asm/clkdev.h> 15 16 #include <asm/clock.h> 16 17 17 18 #include <cpu/sh7722.h> ··· 41 40 }; 42 41 43 42 static struct clk siumckb_clk = { 44 - .name = "siumckb_clk", 45 - .id = -1, 46 43 .ops = &siumckb_clk_ops, 47 44 .rate = 0, /* initialised at run-time */ 48 45 }; 46 + 47 + static struct clk_lookup *siumckb_lookup; 49 48 50 49 static int migor_hw_params(struct snd_pcm_substream *substream, 51 50 struct snd_pcm_hw_params *params) ··· 181 180 if (ret < 0) 182 181 return ret; 183 182 183 + siumckb_lookup = clkdev_alloc(&siumckb_clk, "siumckb_clk", NULL); 184 + if (!siumckb_lookup) { 185 + ret = -ENOMEM; 186 + goto eclkdevalloc; 187 + } 188 + clkdev_add(siumckb_lookup); 189 + 184 190 /* Port number used on this machine: port B */ 185 191 migor_snd_device = platform_device_alloc("soc-audio", 1); 186 192 if (!migor_snd_device) { ··· 208 200 epdevadd: 209 201 platform_device_put(migor_snd_device); 210 202 epdevalloc: 203 + clkdev_drop(siumckb_lookup); 204 + eclkdevalloc: 211 205 clk_unregister(&siumckb_clk); 212 206 return ret; 213 207 } 214 208 215 209 static void __exit migor_exit(void) 216 210 { 211 + clkdev_drop(siumckb_lookup); 217 212 clk_unregister(&siumckb_clk); 218 213 platform_device_unregister(migor_snd_device); 219 214 }
+3 -2
sound/soc/soc-cache.c
··· 203 203 data[1] = (value >> 8) & 0xff; 204 204 data[2] = value & 0xff; 205 205 206 - if (!snd_soc_codec_volatile_register(codec, reg)) 207 - reg_cache[reg] = value; 206 + if (!snd_soc_codec_volatile_register(codec, reg) 207 + && reg < codec->reg_cache_size) 208 + reg_cache[reg] = value; 208 209 209 210 if (codec->cache_only) { 210 211 codec->cache_sync = 1;
+2 -1
virt/kvm/eventfd.c
··· 218 218 events = file->f_op->poll(file, &irqfd->pt); 219 219 220 220 list_add_tail(&irqfd->list, &kvm->irqfds.items); 221 - spin_unlock_irq(&kvm->irqfds.lock); 222 221 223 222 /* 224 223 * Check if there was an event already pending on the eventfd ··· 225 226 */ 226 227 if (events & POLLIN) 227 228 schedule_work(&irqfd->inject); 229 + 230 + spin_unlock_irq(&kvm->irqfds.lock); 228 231 229 232 /* 230 233 * do not drop the file until the irqfd is fully initialized, otherwise
+3 -1
virt/kvm/kvm_main.c
··· 1970 1970 1971 1971 asmlinkage void kvm_handle_fault_on_reboot(void) 1972 1972 { 1973 - if (kvm_rebooting) 1973 + if (kvm_rebooting) { 1974 1974 /* spin while reset goes on */ 1975 + local_irq_enable(); 1975 1976 while (true) 1976 1977 ; 1978 + } 1977 1979 /* Fault while not rebooting. We want the trace. */ 1978 1980 BUG(); 1979 1981 }