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

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

+1485 -1057
+2
Documentation/devicetree/bindings/sound/sgtl5000.txt
··· 3 3 Required properties: 4 4 - compatible : "fsl,sgtl5000". 5 5 6 + - reg : the I2C address of the device 7 + 6 8 Example: 7 9 8 10 codec: sgtl5000@0a {
+10
Documentation/feature-removal-schedule.txt
··· 539 539 Why: setitimer is not returning -EFAULT if user pointer is NULL. This 540 540 violates the spec. 541 541 Who: Sasikantha Babu <sasikanth.v19@gmail.com> 542 + 543 + ---------------------------- 544 + 545 + What: V4L2_CID_HCENTER, V4L2_CID_VCENTER V4L2 controls 546 + When: 3.7 547 + Why: The V4L2_CID_VCENTER, V4L2_CID_HCENTER controls have been deprecated 548 + for about 4 years and they are not used by any mainline driver. 549 + There are newer controls (V4L2_CID_PAN*, V4L2_CID_TILT*) that provide 550 + similar functionality. 551 + Who: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
+3 -3
MAINTAINERS
··· 1969 1969 F: drivers/net/ethernet/ti/cpmac.c 1970 1970 1971 1971 CPU FREQUENCY DRIVERS 1972 - M: Dave Jones <davej@redhat.com> 1972 + M: Rafael J. Wysocki <rjw@sisk.pl> 1973 1973 L: cpufreq@vger.kernel.org 1974 - W: http://www.codemonkey.org.uk/projects/cpufreq/ 1975 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git 1974 + L: linux-pm@vger.kernel.org 1976 1975 S: Maintained 1977 1976 F: drivers/cpufreq/ 1978 1977 F: include/linux/cpufreq.h ··· 4031 4032 F: drivers/scsi/53c700* 4032 4033 4033 4034 LED SUBSYSTEM 4035 + M: Bryan Wu <bryan.wu@canonical.com> 4034 4036 M: Richard Purdie <rpurdie@rpsys.net> 4035 4037 S: Maintained 4036 4038 F: drivers/leds/
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 4 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc5 4 + EXTRAVERSION = -rc7 5 5 NAME = Saber-toothed Squirrel 6 6 7 7 # *DOCUMENTATION*
+1 -1
arch/alpha/Kconfig
··· 477 477 478 478 config VGA_HOSE 479 479 bool 480 - depends on ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL || ALPHA_TSUNAMI 480 + depends on VGA_CONSOLE && (ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL || ALPHA_TSUNAMI) 481 481 default y 482 482 help 483 483 Support VGA on an arbitrary hose; needed for several platforms
+2 -6
arch/alpha/include/asm/rtc.h
··· 1 1 #ifndef _ALPHA_RTC_H 2 2 #define _ALPHA_RTC_H 3 3 4 - #if defined(CONFIG_ALPHA_GENERIC) 4 + #if defined(CONFIG_ALPHA_MARVEL) && defined(CONFIG_SMP) \ 5 + || defined(CONFIG_ALPHA_GENERIC) 5 6 # define get_rtc_time alpha_mv.rtc_get_time 6 7 # define set_rtc_time alpha_mv.rtc_set_time 7 - #else 8 - # if defined(CONFIG_ALPHA_MARVEL) && defined(CONFIG_SMP) 9 - # define get_rtc_time marvel_get_rtc_time 10 - # define set_rtc_time marvel_set_rtc_time 11 - # endif 12 8 #endif 13 9 14 10 #include <asm-generic/rtc.h>
+1
arch/alpha/kernel/core_tsunami.c
··· 11 11 #include <asm/core_tsunami.h> 12 12 #undef __EXTERN_INLINE 13 13 14 + #include <linux/module.h> 14 15 #include <linux/types.h> 15 16 #include <linux/pci.h> 16 17 #include <linux/sched.h>
+1 -1
arch/alpha/kernel/sys_marvel.c
··· 317 317 } 318 318 319 319 static int 320 - marvel_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 320 + marvel_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 321 321 { 322 322 struct pci_controller *hose = dev->sysdata; 323 323 struct io7_port *io7_port = hose->sysdata;
+9 -15
arch/arm/kernel/ptrace.c
··· 906 906 return ret; 907 907 } 908 908 909 - #ifdef __ARMEB__ 910 - #define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB 911 - #else 912 - #define AUDIT_ARCH_NR AUDIT_ARCH_ARM 913 - #endif 914 - 915 909 asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) 916 910 { 917 911 unsigned long ip; 918 912 919 - /* 920 - * Save IP. IP is used to denote syscall entry/exit: 921 - * IP = 0 -> entry, = 1 -> exit 922 - */ 923 - ip = regs->ARM_ip; 924 - regs->ARM_ip = why; 925 - 926 - if (!ip) 913 + if (why) 927 914 audit_syscall_exit(regs); 928 915 else 929 - audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0, 916 + audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, 930 917 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); 931 918 932 919 if (!test_thread_flag(TIF_SYSCALL_TRACE)) ··· 922 935 return scno; 923 936 924 937 current_thread_info()->syscall = scno; 938 + 939 + /* 940 + * IP is used to denote syscall entry/exit: 941 + * IP = 0 -> entry, =1 -> exit 942 + */ 943 + ip = regs->ARM_ip; 944 + regs->ARM_ip = why; 925 945 926 946 /* the 0x80 provides a way for the tracing parent to distinguish 927 947 between a syscall stop and SIGTRAP delivery */
+2 -2
arch/arm/kernel/smp.c
··· 251 251 struct mm_struct *mm = &init_mm; 252 252 unsigned int cpu = smp_processor_id(); 253 253 254 - printk("CPU%u: Booted secondary processor\n", cpu); 255 - 256 254 /* 257 255 * All kernel threads share the same mm context; grab a 258 256 * reference and switch to it. ··· 261 263 cpu_switch_mm(mm->pgd, mm); 262 264 enter_lazy_tlb(mm, current); 263 265 local_flush_tlb_all(); 266 + 267 + printk("CPU%u: Booted secondary processor\n", cpu); 264 268 265 269 cpu_init(); 266 270 preempt_disable();
+1 -1
arch/arm/kernel/sys_arm.c
··· 115 115 "Ir" (THREAD_START_SP - sizeof(regs)), 116 116 "r" (&regs), 117 117 "Ir" (sizeof(regs)) 118 - : "r0", "r1", "r2", "r3", "ip", "lr", "memory"); 118 + : "r0", "r1", "r2", "r3", "r8", "r9", "ip", "lr", "memory"); 119 119 120 120 out: 121 121 return ret;
+3
arch/arm/mach-exynos/Kconfig
··· 232 232 config MACH_UNIVERSAL_C210 233 233 bool "Mobile UNIVERSAL_C210 Board" 234 234 select CPU_EXYNOS4210 235 + select S5P_HRT 236 + select CLKSRC_MMIO 237 + select HAVE_SCHED_CLOCK 235 238 select S5P_GPIO_INT 236 239 select S5P_DEV_FIMC0 237 240 select S5P_DEV_FIMC1
+1 -1
arch/arm/mach-exynos/clock-exynos5.c
··· 678 678 .name = "dma", 679 679 .devname = "dma-pl330.1", 680 680 .enable = exynos5_clk_ip_fsys_ctrl, 681 - .ctrlbit = (1 << 1), 681 + .ctrlbit = (1 << 2), 682 682 }; 683 683 684 684 static struct clk exynos5_clk_mdma1 = {
+3 -1
arch/arm/mach-exynos/mach-universal_c210.c
··· 40 40 #include <plat/pd.h> 41 41 #include <plat/regs-fb-v4.h> 42 42 #include <plat/fimc-core.h> 43 + #include <plat/s5p-time.h> 43 44 #include <plat/camport.h> 44 45 #include <plat/mipi_csis.h> 45 46 ··· 1064 1063 exynos_init_io(NULL, 0); 1065 1064 s3c24xx_init_clocks(24000000); 1066 1065 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); 1066 + s5p_set_timer_source(S5P_PWM2, S5P_PWM4); 1067 1067 } 1068 1068 1069 1069 static void s5p_tv_setup(void) ··· 1115 1113 .map_io = universal_map_io, 1116 1114 .handle_irq = gic_handle_irq, 1117 1115 .init_machine = universal_machine_init, 1118 - .timer = &exynos4_timer, 1116 + .timer = &s5p_timer, 1119 1117 .reserve = &universal_reserve, 1120 1118 .restart = exynos4_restart, 1121 1119 MACHINE_END
+1
arch/arm/mach-kirkwood/board-dt.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/of.h> 16 16 #include <linux/of_platform.h> 17 + #include <linux/kexec.h> 17 18 #include <asm/mach/arch.h> 18 19 #include <asm/mach/map.h> 19 20 #include <mach/bridge-regs.h>
+1 -1
arch/arm/mach-omap1/ams-delta-fiq.c
··· 48 48 struct irq_chip *irq_chip = NULL; 49 49 int gpio, irq_num, fiq_count; 50 50 51 - irq_desc = irq_to_desc(IH_GPIO_BASE); 51 + irq_desc = irq_to_desc(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); 52 52 if (irq_desc) 53 53 irq_chip = irq_desc->irq_data.chip; 54 54
+1 -1
arch/arm/mach-omap2/board-igep0020.c
··· 641 641 642 642 static void __init igep_init(void) 643 643 { 644 - regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 644 + regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 645 645 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 646 646 647 647 /* Get IGEP2 hardware revision */
+4 -4
arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h
··· 941 941 #define OMAP4_DSI2_LANEENABLE_MASK (0x7 << 29) 942 942 #define OMAP4_DSI1_LANEENABLE_SHIFT 24 943 943 #define OMAP4_DSI1_LANEENABLE_MASK (0x1f << 24) 944 - #define OMAP4_DSI2_PIPD_SHIFT 19 945 - #define OMAP4_DSI2_PIPD_MASK (0x1f << 19) 946 - #define OMAP4_DSI1_PIPD_SHIFT 14 947 - #define OMAP4_DSI1_PIPD_MASK (0x1f << 14) 944 + #define OMAP4_DSI1_PIPD_SHIFT 19 945 + #define OMAP4_DSI1_PIPD_MASK (0x1f << 19) 946 + #define OMAP4_DSI2_PIPD_SHIFT 14 947 + #define OMAP4_DSI2_PIPD_MASK (0x1f << 14) 948 948 949 949 /* CONTROL_MCBSPLP */ 950 950 #define OMAP4_ALBCTRLRX_FSX_SHIFT 31
+2 -2
arch/arm/mach-orion5x/mpp.h
··· 65 65 #define MPP8_GIGE MPP(8, 0x1, 0, 0, 1, 1, 1) 66 66 67 67 #define MPP9_UNUSED MPP(9, 0x0, 0, 0, 1, 1, 1) 68 - #define MPP9_GPIO MPP(9, 0x0, 0, 0, 1, 1, 1) 69 - #define MPP9_GIGE MPP(9, 0x1, 1, 1, 1, 1, 1) 68 + #define MPP9_GPIO MPP(9, 0x0, 1, 1, 1, 1, 1) 69 + #define MPP9_GIGE MPP(9, 0x1, 0, 0, 1, 1, 1) 70 70 71 71 #define MPP10_UNUSED MPP(10, 0x0, 0, 0, 1, 1, 1) 72 72 #define MPP10_GPIO MPP(10, 0x0, 1, 1, 1, 1, 1)
+2 -20
arch/arm/mach-shmobile/board-ag5evm.c
··· 365 365 }; 366 366 367 367 /* SDHI0 */ 368 - static irqreturn_t ag5evm_sdhi0_gpio_cd(int irq, void *arg) 369 - { 370 - struct device *dev = arg; 371 - struct sh_mobile_sdhi_info *info = dev->platform_data; 372 - struct tmio_mmc_data *pdata = info->pdata; 373 - 374 - tmio_mmc_cd_wakeup(pdata); 375 - 376 - return IRQ_HANDLED; 377 - } 378 - 379 368 static struct sh_mobile_sdhi_info sdhi0_info = { 380 369 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 381 370 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 382 - .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, 371 + .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD, 383 372 .tmio_caps = MMC_CAP_SD_HIGHSPEED, 384 373 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, 374 + .cd_gpio = GPIO_PORT251, 385 375 }; 386 376 387 377 static struct resource sdhi0_resources[] = { ··· 547 557 lcd_backlight_reset(); 548 558 549 559 /* enable SDHI0 on CN15 [SD I/F] */ 550 - gpio_request(GPIO_FN_SDHICD0, NULL); 551 560 gpio_request(GPIO_FN_SDHIWP0, NULL); 552 561 gpio_request(GPIO_FN_SDHICMD0, NULL); 553 562 gpio_request(GPIO_FN_SDHICLK0, NULL); ··· 554 565 gpio_request(GPIO_FN_SDHID0_2, NULL); 555 566 gpio_request(GPIO_FN_SDHID0_1, NULL); 556 567 gpio_request(GPIO_FN_SDHID0_0, NULL); 557 - 558 - if (!request_irq(intcs_evt2irq(0x3c0), ag5evm_sdhi0_gpio_cd, 559 - IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, 560 - "sdhi0 cd", &sdhi0_device.dev)) 561 - sdhi0_info.tmio_flags |= TMIO_MMC_HAS_COLD_CD; 562 - else 563 - pr_warn("Unable to setup SDHI0 GPIO IRQ\n"); 564 568 565 569 /* enable SDHI1 on CN4 [WLAN I/F] */ 566 570 gpio_request(GPIO_FN_SDHICLK1, NULL);
+2 -20
arch/arm/mach-shmobile/board-mackerel.c
··· 1011 1011 } 1012 1012 1013 1013 /* SDHI0 */ 1014 - static irqreturn_t mackerel_sdhi0_gpio_cd(int irq, void *arg) 1015 - { 1016 - struct device *dev = arg; 1017 - struct sh_mobile_sdhi_info *info = dev->platform_data; 1018 - struct tmio_mmc_data *pdata = info->pdata; 1019 - 1020 - tmio_mmc_cd_wakeup(pdata); 1021 - 1022 - return IRQ_HANDLED; 1023 - } 1024 - 1025 1014 static struct sh_mobile_sdhi_info sdhi0_info = { 1026 1015 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 1027 1016 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 1017 + .tmio_flags = TMIO_MMC_USE_GPIO_CD, 1028 1018 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, 1019 + .cd_gpio = GPIO_PORT172, 1029 1020 }; 1030 1021 1031 1022 static struct resource sdhi0_resources[] = { ··· 1375 1384 { 1376 1385 u32 srcr4; 1377 1386 struct clk *clk; 1378 - int ret; 1379 1387 1380 1388 /* External clock source */ 1381 1389 clk_set_rate(&sh7372_dv_clki_clk, 27000000); ··· 1471 1481 irq_set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH); 1472 1482 1473 1483 /* enable SDHI0 */ 1474 - gpio_request(GPIO_FN_SDHICD0, NULL); 1475 1484 gpio_request(GPIO_FN_SDHIWP0, NULL); 1476 1485 gpio_request(GPIO_FN_SDHICMD0, NULL); 1477 1486 gpio_request(GPIO_FN_SDHICLK0, NULL); ··· 1478 1489 gpio_request(GPIO_FN_SDHID0_2, NULL); 1479 1490 gpio_request(GPIO_FN_SDHID0_1, NULL); 1480 1491 gpio_request(GPIO_FN_SDHID0_0, NULL); 1481 - 1482 - ret = request_irq(evt2irq(0x3340), mackerel_sdhi0_gpio_cd, 1483 - IRQF_TRIGGER_FALLING, "sdhi0 cd", &sdhi0_device.dev); 1484 - if (!ret) 1485 - sdhi0_info.tmio_flags |= TMIO_MMC_HAS_COLD_CD; 1486 - else 1487 - pr_err("Cannot get IRQ #%d: %d\n", evt2irq(0x3340), ret); 1488 1492 1489 1493 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1490 1494 /* enable SDHI1 */
+55 -1
arch/arm/mach-shmobile/headsmp.S
··· 16 16 17 17 __CPUINIT 18 18 19 + /* Cache invalidation nicked from arch/arm/mach-imx/head-v7.S, thanks! 20 + * 21 + * The secondary kernel init calls v7_flush_dcache_all before it enables 22 + * the L1; however, the L1 comes out of reset in an undefined state, so 23 + * the clean + invalidate performed by v7_flush_dcache_all causes a bunch 24 + * of cache lines with uninitialized data and uninitialized tags to get 25 + * written out to memory, which does really unpleasant things to the main 26 + * processor. We fix this by performing an invalidate, rather than a 27 + * clean + invalidate, before jumping into the kernel. 28 + * 29 + * This funciton is cloned from arch/arm/mach-tegra/headsmp.S, and needs 30 + * to be called for both secondary cores startup and primary core resume 31 + * procedures. Ideally, it should be moved into arch/arm/mm/cache-v7.S. 32 + */ 33 + ENTRY(v7_invalidate_l1) 34 + mov r0, #0 35 + mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache 36 + mcr p15, 2, r0, c0, c0, 0 37 + mrc p15, 1, r0, c0, c0, 0 38 + 39 + ldr r1, =0x7fff 40 + and r2, r1, r0, lsr #13 41 + 42 + ldr r1, =0x3ff 43 + 44 + and r3, r1, r0, lsr #3 @ NumWays - 1 45 + add r2, r2, #1 @ NumSets 46 + 47 + and r0, r0, #0x7 48 + add r0, r0, #4 @ SetShift 49 + 50 + clz r1, r3 @ WayShift 51 + add r4, r3, #1 @ NumWays 52 + 1: sub r2, r2, #1 @ NumSets-- 53 + mov r3, r4 @ Temp = NumWays 54 + 2: subs r3, r3, #1 @ Temp-- 55 + mov r5, r3, lsl r1 56 + mov r6, r2, lsl r0 57 + orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift) 58 + mcr p15, 0, r5, c7, c6, 2 59 + bgt 2b 60 + cmp r2, #0 61 + bgt 1b 62 + dsb 63 + isb 64 + mov pc, lr 65 + ENDPROC(v7_invalidate_l1) 66 + 67 + ENTRY(shmobile_invalidate_start) 68 + bl v7_invalidate_l1 69 + b secondary_startup 70 + ENDPROC(shmobile_invalidate_start) 71 + 19 72 /* 20 73 * Reset vector for secondary CPUs. 21 74 * This will be mapped at address 0 by SBAR register. ··· 77 24 .align 12 78 25 ENTRY(shmobile_secondary_vector) 79 26 ldr pc, 1f 80 - 1: .long secondary_startup - PAGE_OFFSET + PLAT_PHYS_OFFSET 27 + 1: .long shmobile_invalidate_start - PAGE_OFFSET + PLAT_PHYS_OFFSET 28 + ENDPROC(shmobile_secondary_vector)
+1 -1
arch/arm/mach-shmobile/include/mach/common.h
··· 4 4 extern void shmobile_earlytimer_init(void); 5 5 extern struct sys_timer shmobile_timer; 6 6 struct twd_local_timer; 7 - void shmobile_twd_init(struct twd_local_timer *twd_local_timer); 8 7 extern void shmobile_setup_console(void); 9 8 extern void shmobile_secondary_vector(void); 10 9 extern int shmobile_platform_cpu_kill(unsigned int cpu); ··· 81 82 extern void r8a7779_secondary_init(unsigned int cpu); 82 83 extern int r8a7779_boot_secondary(unsigned int cpu); 83 84 extern void r8a7779_smp_prepare_cpus(void); 85 + extern void r8a7779_register_twd(void); 84 86 85 87 #endif /* __ARCH_MACH_COMMON_H */
+4
arch/arm/mach-shmobile/setup-r8a7779.c
··· 262 262 ARRAY_SIZE(r8a7779_late_devices)); 263 263 } 264 264 265 + /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ 266 + void __init __weak r8a7779_register_twd(void) { } 267 + 265 268 static void __init r8a7779_earlytimer_init(void) 266 269 { 267 270 r8a7779_clock_init(); 268 271 shmobile_earlytimer_init(); 272 + r8a7779_register_twd(); 269 273 } 270 274 271 275 void __init r8a7779_add_early_devices(void)
+4
arch/arm/mach-shmobile/setup-sh73a0.c
··· 688 688 ARRAY_SIZE(sh73a0_late_devices)); 689 689 } 690 690 691 + /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ 692 + void __init __weak sh73a0_register_twd(void) { } 693 + 691 694 static void __init sh73a0_earlytimer_init(void) 692 695 { 693 696 sh73a0_clock_init(); 694 697 shmobile_earlytimer_init(); 698 + sh73a0_register_twd(); 695 699 } 696 700 697 701 void __init sh73a0_add_early_devices(void)
+7 -1
arch/arm/mach-shmobile/smp-r8a7779.c
··· 64 64 static DEFINE_SPINLOCK(scu_lock); 65 65 static unsigned long tmp; 66 66 67 + #ifdef CONFIG_HAVE_ARM_TWD 67 68 static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); 69 + 70 + void __init r8a7779_register_twd(void) 71 + { 72 + twd_local_timer_register(&twd_local_timer); 73 + } 74 + #endif 68 75 69 76 static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) 70 77 { ··· 91 84 { 92 85 void __iomem *scu_base = scu_base_addr(); 93 86 94 - shmobile_twd_init(&twd_local_timer); 95 87 return scu_get_core_count(scu_base); 96 88 } 97 89
+6 -1
arch/arm/mach-shmobile/smp-sh73a0.c
··· 42 42 static DEFINE_SPINLOCK(scu_lock); 43 43 static unsigned long tmp; 44 44 45 + #ifdef CONFIG_HAVE_ARM_TWD 45 46 static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); 47 + void __init sh73a0_register_twd(void) 48 + { 49 + twd_local_timer_register(&twd_local_timer); 50 + } 51 + #endif 46 52 47 53 static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) 48 54 { ··· 68 62 { 69 63 void __iomem *scu_base = scu_base_addr(); 70 64 71 - shmobile_twd_init(&twd_local_timer); 72 65 return scu_get_core_count(scu_base); 73 66 } 74 67
-9
arch/arm/mach-shmobile/timer.c
··· 46 46 { 47 47 } 48 48 49 - void __init shmobile_twd_init(struct twd_local_timer *twd_local_timer) 50 - { 51 - #ifdef CONFIG_HAVE_ARM_TWD 52 - int err = twd_local_timer_register(twd_local_timer); 53 - if (err) 54 - pr_err("twd_local_timer_register failed %d\n", err); 55 - #endif 56 - } 57 - 58 49 struct sys_timer shmobile_timer = { 59 50 .init = shmobile_timer_init, 60 51 };
+1 -1
arch/ia64/kvm/kvm-ia64.c
··· 1174 1174 1175 1175 bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu) 1176 1176 { 1177 - return irqchip_in_kernel(vcpu->kcm) == (vcpu->arch.apic != NULL); 1177 + return irqchip_in_kernel(vcpu->kvm) == (vcpu->arch.apic != NULL); 1178 1178 } 1179 1179 1180 1180 int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
+3 -3
arch/m68k/platform/520x/config.c
··· 22 22 23 23 /***************************************************************************/ 24 24 25 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 25 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 26 26 27 27 static void __init m520x_qspi_init(void) 28 28 { ··· 35 35 writew(par, MCF_GPIO_PAR_UART); 36 36 } 37 37 38 - #endif /* CONFIG_SPI_COLDFIRE_QSPI */ 38 + #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 39 39 40 40 /***************************************************************************/ 41 41 ··· 79 79 mach_sched_init = hw_timer_init; 80 80 m520x_uarts_init(); 81 81 m520x_fec_init(); 82 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 82 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 83 83 m520x_qspi_init(); 84 84 #endif 85 85 }
+3 -3
arch/m68k/platform/523x/config.c
··· 22 22 23 23 /***************************************************************************/ 24 24 25 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 25 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 26 26 27 27 static void __init m523x_qspi_init(void) 28 28 { ··· 36 36 writew(par, MCFGPIO_PAR_TIMER); 37 37 } 38 38 39 - #endif /* CONFIG_SPI_COLDFIRE_QSPI */ 39 + #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 40 40 41 41 /***************************************************************************/ 42 42 ··· 58 58 { 59 59 mach_sched_init = hw_timer_init; 60 60 m523x_fec_init(); 61 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 61 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 62 62 m523x_qspi_init(); 63 63 #endif 64 64 }
+3 -3
arch/m68k/platform/5249/config.c
··· 51 51 52 52 /***************************************************************************/ 53 53 54 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 54 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 55 55 56 56 static void __init m5249_qspi_init(void) 57 57 { ··· 61 61 mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI); 62 62 } 63 63 64 - #endif /* CONFIG_SPI_COLDFIRE_QSPI */ 64 + #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 65 65 66 66 /***************************************************************************/ 67 67 ··· 90 90 #ifdef CONFIG_M5249C3 91 91 m5249_smc91x_init(); 92 92 #endif 93 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 93 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 94 94 m5249_qspi_init(); 95 95 #endif 96 96 }
+3 -3
arch/m68k/platform/527x/config.c
··· 23 23 24 24 /***************************************************************************/ 25 25 26 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 26 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 27 27 28 28 static void __init m527x_qspi_init(void) 29 29 { ··· 42 42 #endif 43 43 } 44 44 45 - #endif /* CONFIG_SPI_COLDFIRE_QSPI */ 45 + #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 46 46 47 47 /***************************************************************************/ 48 48 ··· 90 90 mach_sched_init = hw_timer_init; 91 91 m527x_uarts_init(); 92 92 m527x_fec_init(); 93 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 93 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 94 94 m527x_qspi_init(); 95 95 #endif 96 96 }
+3 -3
arch/m68k/platform/528x/config.c
··· 24 24 25 25 /***************************************************************************/ 26 26 27 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 27 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 28 28 29 29 static void __init m528x_qspi_init(void) 30 30 { ··· 32 32 __raw_writeb(0x07, MCFGPIO_PQSPAR); 33 33 } 34 34 35 - #endif /* CONFIG_SPI_COLDFIRE_QSPI */ 35 + #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 36 36 37 37 /***************************************************************************/ 38 38 ··· 98 98 mach_sched_init = hw_timer_init; 99 99 m528x_uarts_init(); 100 100 m528x_fec_init(); 101 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 101 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 102 102 m528x_qspi_init(); 103 103 #endif 104 104 }
+3 -3
arch/m68k/platform/532x/config.c
··· 30 30 31 31 /***************************************************************************/ 32 32 33 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 33 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 34 34 35 35 static void __init m532x_qspi_init(void) 36 36 { ··· 38 38 writew(0x01f0, MCF_GPIO_PAR_QSPI); 39 39 } 40 40 41 - #endif /* CONFIG_SPI_COLDFIRE_QSPI */ 41 + #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 42 42 43 43 /***************************************************************************/ 44 44 ··· 77 77 mach_sched_init = hw_timer_init; 78 78 m532x_uarts_init(); 79 79 m532x_fec_init(); 80 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 80 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 81 81 m532x_qspi_init(); 82 82 #endif 83 83
+3 -3
arch/m68k/platform/coldfire/device.c
··· 121 121 #endif /* MCFFEC_BASE1 */ 122 122 #endif /* CONFIG_FEC */ 123 123 124 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 124 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 125 125 /* 126 126 * The ColdFire QSPI module is an SPI protocol hardware block used 127 127 * on a number of different ColdFire CPUs. ··· 274 274 .resource = mcf_qspi_resources, 275 275 .dev.platform_data = &mcf_qspi_data, 276 276 }; 277 - #endif /* CONFIG_SPI_COLDFIRE_QSPI */ 277 + #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 278 278 279 279 static struct platform_device *mcf_devices[] __initdata = { 280 280 &mcf_uart, ··· 284 284 &mcf_fec1, 285 285 #endif 286 286 #endif 287 - #ifdef CONFIG_SPI_COLDFIRE_QSPI 287 + #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) 288 288 &mcf_qspi, 289 289 #endif 290 290 };
+6 -3
arch/mn10300/kernel/smp.c
··· 24 24 #include <linux/sched.h> 25 25 #include <linux/profile.h> 26 26 #include <linux/smp.h> 27 + #include <linux/cpu.h> 27 28 #include <asm/tlbflush.h> 28 29 #include <asm/bitops.h> 29 30 #include <asm/processor.h> ··· 39 38 #include "internal.h" 40 39 41 40 #ifdef CONFIG_HOTPLUG_CPU 42 - #include <linux/cpu.h> 43 41 #include <asm/cacheflush.h> 44 42 45 43 static unsigned long sleep_mode[NR_CPUS]; ··· 874 874 875 875 cpu = smp_processor_id(); 876 876 877 - local_irq_enable(); 877 + notify_cpu_starting(cpu); 878 878 879 + ipi_call_lock(); 879 880 set_cpu_online(cpu, true); 880 - smp_wmb(); 881 + ipi_call_unlock(); 882 + 883 + local_irq_enable(); 881 884 } 882 885 883 886 /**
+2 -1
arch/parisc/include/asm/hardware.h
··· 2 2 #define _PARISC_HARDWARE_H 3 3 4 4 #include <linux/mod_devicetable.h> 5 - #include <asm/pdc.h> 6 5 7 6 #define HWTYPE_ANY_ID PA_HWTYPE_ANY_ID 8 7 #define HVERSION_ANY_ID PA_HVERSION_ANY_ID ··· 94 95 #define HPHW_MC 15 95 96 #define HPHW_FAULTY 31 96 97 98 + struct parisc_device_id; 97 99 98 100 /* hardware.c: */ 99 101 extern const char *parisc_hardware_description(struct parisc_device_id *id); 100 102 extern enum cpu_type parisc_get_cpu_type(unsigned long hversion); 101 103 102 104 struct pci_dev; 105 + struct hardware_path; 103 106 104 107 /* drivers.c: */ 105 108 extern struct parisc_device *alloc_pa_dev(unsigned long hpa,
+6
arch/parisc/include/asm/page.h
··· 160 160 161 161 #include <asm-generic/memory_model.h> 162 162 #include <asm-generic/getorder.h> 163 + #include <asm/pdc.h> 164 + 165 + #define PAGE0 ((struct zeropage *)__PAGE_OFFSET) 166 + 167 + /* DEFINITION OF THE ZERO-PAGE (PAG0) */ 168 + /* based on work by Jason Eckhardt (jason@equator.com) */ 163 169 164 170 #endif /* _PARISC_PAGE_H */
-7
arch/parisc/include/asm/pdc.h
··· 343 343 344 344 #ifdef __KERNEL__ 345 345 346 - #include <asm/page.h> /* for __PAGE_OFFSET */ 347 - 348 346 extern int pdc_type; 349 347 350 348 /* Values for pdc_type */ ··· 674 676 } 675 677 676 678 #endif /* __KERNEL__ */ 677 - 678 - #define PAGE0 ((struct zeropage *)__PAGE_OFFSET) 679 - 680 - /* DEFINITION OF THE ZERO-PAGE (PAG0) */ 681 - /* based on work by Jason Eckhardt (jason@equator.com) */ 682 679 683 680 /* flags of the device_path */ 684 681 #define PF_AUTOBOOT 0x80
+2
arch/parisc/include/asm/pgtable.h
··· 44 44 45 45 #endif /* !__ASSEMBLY__ */ 46 46 47 + #include <asm/page.h> 48 + 47 49 #define pte_ERROR(e) \ 48 50 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) 49 51 #define pmd_ERROR(e) \
+2
arch/parisc/include/asm/spinlock.h
··· 1 1 #ifndef __ASM_SPINLOCK_H 2 2 #define __ASM_SPINLOCK_H 3 3 4 + #include <asm/barrier.h> 5 + #include <asm/ldcw.h> 4 6 #include <asm/processor.h> 5 7 #include <asm/spinlock_types.h> 6 8
+2 -1
arch/parisc/kernel/pdc_cons.c
··· 50 50 #include <linux/init.h> 51 51 #include <linux/major.h> 52 52 #include <linux/tty.h> 53 + #include <asm/page.h> /* for PAGE0 */ 53 54 #include <asm/pdc.h> /* for iodc_call() proto and friends */ 54 55 55 56 static DEFINE_SPINLOCK(pdc_console_lock); ··· 105 104 106 105 static void pdc_console_tty_close(struct tty_struct *tty, struct file *filp) 107 106 { 108 - if (!tty->count) { 107 + if (tty->count == 1) { 109 108 del_timer_sync(&pdc_console_timer); 110 109 tty_port_tty_set(&tty_port, NULL); 111 110 }
+7 -1
arch/parisc/kernel/smp.c
··· 31 31 #include <linux/delay.h> 32 32 #include <linux/bitops.h> 33 33 #include <linux/ftrace.h> 34 + #include <linux/cpu.h> 34 35 35 36 #include <linux/atomic.h> 36 37 #include <asm/current.h> ··· 296 295 297 296 printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum); 298 297 machine_halt(); 299 - } 298 + } 299 + 300 + notify_cpu_starting(cpunum); 301 + 302 + ipi_call_lock(); 300 303 set_cpu_online(cpunum, true); 304 + ipi_call_unlock(); 301 305 302 306 /* Initialise the idle task for this CPU */ 303 307 atomic_inc(&init_mm.mm_count);
+1
arch/parisc/kernel/time.c
··· 29 29 #include <asm/uaccess.h> 30 30 #include <asm/io.h> 31 31 #include <asm/irq.h> 32 + #include <asm/page.h> 32 33 #include <asm/param.h> 33 34 #include <asm/pdc.h> 34 35 #include <asm/led.h>
-7
arch/powerpc/include/asm/exception-64s.h
··· 288 288 /* Exception addition: Hard disable interrupts */ 289 289 #define DISABLE_INTS SOFT_DISABLE_INTS(r10,r11) 290 290 291 - /* Exception addition: Keep interrupt state */ 292 - #define ENABLE_INTS \ 293 - ld r11,PACAKMSR(r13); \ 294 - ld r12,_MSR(r1); \ 295 - rlwimi r11,r12,0,MSR_EE; \ 296 - mtmsrd r11,1 297 - 298 291 #define ADD_NVGPRS \ 299 292 bl .save_nvgprs 300 293
+4 -3
arch/powerpc/include/asm/kvm_book3s.h
··· 81 81 u64 sdr1; 82 82 u64 hior; 83 83 u64 msr_mask; 84 - u64 vsid_next; 85 84 #ifdef CONFIG_PPC_BOOK3S_32 86 85 u32 vsid_pool[VSID_POOL_SIZE]; 86 + u32 vsid_next; 87 87 #else 88 - u64 vsid_first; 89 - u64 vsid_max; 88 + u64 proto_vsid_first; 89 + u64 proto_vsid_max; 90 + u64 proto_vsid_next; 90 91 #endif 91 92 int context_id[SID_CONTEXTS]; 92 93
+31 -31
arch/powerpc/kernel/entry_64.S
··· 588 588 fast_exc_return_irq: 589 589 restore: 590 590 /* 591 - * This is the main kernel exit path, we first check if we 592 - * have to change our interrupt state. 591 + * This is the main kernel exit path. First we check if we 592 + * are about to re-enable interrupts 593 593 */ 594 594 ld r5,SOFTE(r1) 595 595 lbz r6,PACASOFTIRQEN(r13) 596 - cmpwi cr1,r5,0 597 - cmpw cr0,r5,r6 598 - beq cr0,4f 596 + cmpwi cr0,r5,0 597 + beq restore_irq_off 599 598 600 - /* We do, handle disable first, which is easy */ 601 - bne cr1,3f; 602 - li r0,0 603 - stb r0,PACASOFTIRQEN(r13); 604 - TRACE_DISABLE_INTS 605 - b 4f 599 + /* We are enabling, were we already enabled ? Yes, just return */ 600 + cmpwi cr0,r6,1 601 + beq cr0,do_restore 606 602 607 - 3: /* 603 + /* 608 604 * We are about to soft-enable interrupts (we are hard disabled 609 605 * at this point). We check if there's anything that needs to 610 606 * be replayed first. ··· 622 626 /* 623 627 * Final return path. BookE is handled in a different file 624 628 */ 625 - 4: 629 + do_restore: 626 630 #ifdef CONFIG_PPC_BOOK3E 627 631 b .exception_return_book3e 628 632 #else ··· 696 700 #endif /* CONFIG_PPC_BOOK3E */ 697 701 698 702 /* 703 + * We are returning to a context with interrupts soft disabled. 704 + * 705 + * However, we may also about to hard enable, so we need to 706 + * make sure that in this case, we also clear PACA_IRQ_HARD_DIS 707 + * or that bit can get out of sync and bad things will happen 708 + */ 709 + restore_irq_off: 710 + ld r3,_MSR(r1) 711 + lbz r7,PACAIRQHAPPENED(r13) 712 + andi. r0,r3,MSR_EE 713 + beq 1f 714 + rlwinm r7,r7,0,~PACA_IRQ_HARD_DIS 715 + stb r7,PACAIRQHAPPENED(r13) 716 + 1: li r0,0 717 + stb r0,PACASOFTIRQEN(r13); 718 + TRACE_DISABLE_INTS 719 + b do_restore 720 + 721 + /* 699 722 * Something did happen, check if a re-emit is needed 700 723 * (this also clears paca->irq_happened) 701 724 */ ··· 763 748 #endif /* CONFIG_PPC_BOOK3E */ 764 749 1: b .ret_from_except /* What else to do here ? */ 765 750 751 + 752 + 753 + 3: 766 754 do_work: 767 755 #ifdef CONFIG_PREEMPT 768 756 andi. r0,r3,MSR_PR /* Returning to user mode? */ ··· 785 767 SOFT_DISABLE_INTS(r3,r4) 786 768 1: bl .preempt_schedule_irq 787 769 788 - /* Hard-disable interrupts again (and update PACA) */ 789 - #ifdef CONFIG_PPC_BOOK3E 790 - wrteei 0 791 - #else 792 - ld r10,PACAKMSR(r13) /* Get kernel MSR without EE */ 793 - mtmsrd r10,1 794 - #endif /* CONFIG_PPC_BOOK3E */ 795 - li r0,PACA_IRQ_HARD_DIS 796 - stb r0,PACAIRQHAPPENED(r13) 797 - 798 770 /* Re-test flags and eventually loop */ 799 771 clrrdi r9,r1,THREAD_SHIFT 800 772 ld r4,TI_FLAGS(r9) ··· 794 786 795 787 user_work: 796 788 #endif /* CONFIG_PREEMPT */ 797 - 798 - /* Enable interrupts */ 799 - #ifdef CONFIG_PPC_BOOK3E 800 - wrteei 1 801 - #else 802 - ori r10,r10,MSR_EE 803 - mtmsrd r10,1 804 - #endif /* CONFIG_PPC_BOOK3E */ 805 789 806 790 andi. r0,r4,_TIF_NEED_RESCHED 807 791 beq 1f
+1 -1
arch/powerpc/kernel/exceptions-64s.S
··· 768 768 std r3,_DAR(r1) 769 769 std r4,_DSISR(r1) 770 770 bl .save_nvgprs 771 + DISABLE_INTS 771 772 addi r3,r1,STACK_FRAME_OVERHEAD 772 - ENABLE_INTS 773 773 bl .alignment_exception 774 774 b .ret_from_except 775 775
+20 -1
arch/powerpc/kernel/irq.c
··· 229 229 */ 230 230 if (unlikely(irq_happened != PACA_IRQ_HARD_DIS)) 231 231 __hard_irq_disable(); 232 + #ifdef CONFIG_TRACE_IRQFLAG 233 + else { 234 + /* 235 + * We should already be hard disabled here. We had bugs 236 + * where that wasn't the case so let's dbl check it and 237 + * warn if we are wrong. Only do that when IRQ tracing 238 + * is enabled as mfmsr() can be costly. 239 + */ 240 + if (WARN_ON(mfmsr() & MSR_EE)) 241 + __hard_irq_disable(); 242 + } 243 + #endif /* CONFIG_TRACE_IRQFLAG */ 244 + 232 245 set_soft_enabled(0); 233 246 234 247 /* ··· 273 260 * if they are currently disabled. This is typically called before 274 261 * schedule() or do_signal() when returning to userspace. We do it 275 262 * in C to avoid the burden of dealing with lockdep etc... 263 + * 264 + * NOTE: This is called with interrupts hard disabled but not marked 265 + * as such in paca->irq_happened, so we need to resync this. 276 266 */ 277 267 void restore_interrupts(void) 278 268 { 279 - if (irqs_disabled()) 269 + if (irqs_disabled()) { 270 + local_paca->irq_happened |= PACA_IRQ_HARD_DIS; 280 271 local_irq_enable(); 272 + } else 273 + __hard_irq_enable(); 281 274 } 282 275 283 276 #endif /* CONFIG_PPC64 */
+8 -2
arch/powerpc/kernel/traps.c
··· 248 248 addr, regs->nip, regs->link, code); 249 249 } 250 250 251 - if (!arch_irq_disabled_regs(regs)) 251 + if (arch_irqs_disabled() && !arch_irq_disabled_regs(regs)) 252 252 local_irq_enable(); 253 253 254 254 memset(&info, 0, sizeof(info)); ··· 1019 1019 return; 1020 1020 } 1021 1021 1022 - local_irq_enable(); 1022 + /* We restore the interrupt state now */ 1023 + if (!arch_irq_disabled_regs(regs)) 1024 + local_irq_enable(); 1023 1025 1024 1026 #ifdef CONFIG_MATH_EMULATION 1025 1027 /* (reason & REASON_ILLEGAL) would be the obvious thing here, ··· 1070 1068 void alignment_exception(struct pt_regs *regs) 1071 1069 { 1072 1070 int sig, code, fixed = 0; 1071 + 1072 + /* We restore the interrupt state now */ 1073 + if (!arch_irq_disabled_regs(regs)) 1074 + local_irq_enable(); 1073 1075 1074 1076 /* we don't implement logging of alignment exceptions */ 1075 1077 if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
+7 -6
arch/powerpc/kvm/book3s_64_mmu_host.c
··· 194 194 backwards_map = !backwards_map; 195 195 196 196 /* Uh-oh ... out of mappings. Let's flush! */ 197 - if (vcpu_book3s->vsid_next == vcpu_book3s->vsid_max) { 198 - vcpu_book3s->vsid_next = vcpu_book3s->vsid_first; 197 + if (vcpu_book3s->proto_vsid_next == vcpu_book3s->proto_vsid_max) { 198 + vcpu_book3s->proto_vsid_next = vcpu_book3s->proto_vsid_first; 199 199 memset(vcpu_book3s->sid_map, 0, 200 200 sizeof(struct kvmppc_sid_map) * SID_MAP_NUM); 201 201 kvmppc_mmu_pte_flush(vcpu, 0, 0); 202 202 kvmppc_mmu_flush_segments(vcpu); 203 203 } 204 - map->host_vsid = vcpu_book3s->vsid_next++; 204 + map->host_vsid = vsid_scramble(vcpu_book3s->proto_vsid_next++, 256M); 205 205 206 206 map->guest_vsid = gvsid; 207 207 map->valid = true; ··· 319 319 return -1; 320 320 vcpu3s->context_id[0] = err; 321 321 322 - vcpu3s->vsid_max = ((vcpu3s->context_id[0] + 1) << USER_ESID_BITS) - 1; 323 - vcpu3s->vsid_first = vcpu3s->context_id[0] << USER_ESID_BITS; 324 - vcpu3s->vsid_next = vcpu3s->vsid_first; 322 + vcpu3s->proto_vsid_max = ((vcpu3s->context_id[0] + 1) 323 + << USER_ESID_BITS) - 1; 324 + vcpu3s->proto_vsid_first = vcpu3s->context_id[0] << USER_ESID_BITS; 325 + vcpu3s->proto_vsid_next = vcpu3s->proto_vsid_first; 325 326 326 327 kvmppc_mmu_hpte_init(vcpu); 327 328
+13 -9
arch/powerpc/kvm/book3s_64_mmu_hv.c
··· 258 258 !(memslot->userspace_addr & (s - 1))) { 259 259 start &= ~(s - 1); 260 260 pgsize = s; 261 + get_page(hpage); 262 + put_page(page); 261 263 page = hpage; 262 264 } 263 265 } ··· 283 281 err = 0; 284 282 285 283 out: 286 - if (got) { 287 - if (PageHuge(page)) 288 - page = compound_head(page); 284 + if (got) 289 285 put_page(page); 290 - } 291 286 return err; 292 287 293 288 up_err: ··· 677 678 SetPageDirty(page); 678 679 679 680 out_put: 680 - if (page) 681 - put_page(page); 681 + if (page) { 682 + /* 683 + * We drop pages[0] here, not page because page might 684 + * have been set to the head page of a compound, but 685 + * we have to drop the reference on the correct tail 686 + * page to match the get inside gup() 687 + */ 688 + put_page(pages[0]); 689 + } 682 690 return ret; 683 691 684 692 out_unlock: ··· 985 979 pa = *physp; 986 980 } 987 981 page = pfn_to_page(pa >> PAGE_SHIFT); 982 + get_page(page); 988 983 } else { 989 984 hva = gfn_to_hva_memslot(memslot, gfn); 990 985 npages = get_user_pages_fast(hva, 1, 1, pages); ··· 998 991 page = compound_head(page); 999 992 psize <<= compound_order(page); 1000 993 } 1001 - if (!kvm->arch.using_mmu_notifiers) 1002 - get_page(page); 1003 994 offset = gpa & (psize - 1); 1004 995 if (nb_ret) 1005 996 *nb_ret = psize - offset; ··· 1008 1003 { 1009 1004 struct page *page = virt_to_page(va); 1010 1005 1011 - page = compound_head(page); 1012 1006 put_page(page); 1013 1007 } 1014 1008
-2
arch/powerpc/kvm/book3s_hv.c
··· 1192 1192 continue; 1193 1193 pfn = physp[j] >> PAGE_SHIFT; 1194 1194 page = pfn_to_page(pfn); 1195 - if (PageHuge(page)) 1196 - page = compound_head(page); 1197 1195 SetPageDirty(page); 1198 1196 put_page(page); 1199 1197 }
+1
arch/powerpc/kvm/book3s_hv_rm_mmu.c
··· 463 463 /* insert R and C bits from PTE */ 464 464 rcbits = rev->guest_rpte & (HPTE_R_R|HPTE_R_C); 465 465 args[j] |= rcbits << (56 - 5); 466 + hp[0] = 0; 466 467 continue; 467 468 } 468 469
+28 -14
arch/powerpc/kvm/book3s_segment.S
··· 197 197 /* Save guest PC and MSR */ 198 198 #ifdef CONFIG_PPC64 199 199 BEGIN_FTR_SECTION 200 - andi. r0,r12,0x2 200 + andi. r0, r12, 0x2 201 + cmpwi cr1, r0, 0 201 202 beq 1f 202 203 mfspr r3,SPRN_HSRR0 203 204 mfspr r4,SPRN_HSRR1 ··· 251 250 beq ld_last_prev_inst 252 251 cmpwi r12, BOOK3S_INTERRUPT_ALIGNMENT 253 252 beq- ld_last_inst 253 + #ifdef CONFIG_PPC64 254 + BEGIN_FTR_SECTION 255 + cmpwi r12, BOOK3S_INTERRUPT_H_EMUL_ASSIST 256 + beq- ld_last_inst 257 + END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) 258 + #endif 254 259 255 260 b no_ld_last_inst 256 261 ··· 323 316 * Having set up SRR0/1 with the address where we want 324 317 * to continue with relocation on (potentially in module 325 318 * space), we either just go straight there with rfi[d], 326 - * or we jump to an interrupt handler with bctr if there 327 - * is an interrupt to be handled first. In the latter 328 - * case, the rfi[d] at the end of the interrupt handler 329 - * will get us back to where we want to continue. 319 + * or we jump to an interrupt handler if there is an 320 + * interrupt to be handled first. In the latter case, 321 + * the rfi[d] at the end of the interrupt handler will 322 + * get us back to where we want to continue. 330 323 */ 331 - 332 - cmpwi r12, BOOK3S_INTERRUPT_EXTERNAL 333 - beq 1f 334 - cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER 335 - beq 1f 336 - cmpwi r12, BOOK3S_INTERRUPT_PERFMON 337 - 1: mtctr r12 338 324 339 325 /* Register usage at this point: 340 326 * 341 327 * R1 = host R1 342 328 * R2 = host R2 329 + * R10 = raw exit handler id 343 330 * R12 = exit handler id 344 331 * R13 = shadow vcpu (32-bit) or PACA (64-bit) 345 332 * SVCPU.* = guest * ··· 343 342 PPC_LL r6, HSTATE_HOST_MSR(r13) 344 343 PPC_LL r8, HSTATE_VMHANDLER(r13) 345 344 346 - /* Restore host msr -> SRR1 */ 345 + #ifdef CONFIG_PPC64 346 + BEGIN_FTR_SECTION 347 + beq cr1, 1f 348 + mtspr SPRN_HSRR1, r6 349 + mtspr SPRN_HSRR0, r8 350 + END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) 351 + #endif 352 + 1: /* Restore host msr -> SRR1 */ 347 353 mtsrr1 r6 348 354 /* Load highmem handler address */ 349 355 mtsrr0 r8 350 356 351 357 /* RFI into the highmem handler, or jump to interrupt handler */ 352 - beqctr 358 + cmpwi r12, BOOK3S_INTERRUPT_EXTERNAL 359 + beqa BOOK3S_INTERRUPT_EXTERNAL 360 + cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER 361 + beqa BOOK3S_INTERRUPT_DECREMENTER 362 + cmpwi r12, BOOK3S_INTERRUPT_PERFMON 363 + beqa BOOK3S_INTERRUPT_PERFMON 364 + 353 365 RFI 354 366 kvmppc_handler_trampoline_exit_end:
+1 -1
arch/sparc/kernel/central.c
··· 269 269 return 0; 270 270 } 271 271 272 - subsys_initcall(sunfire_init); 272 + fs_initcall(sunfire_init);
+3 -3
arch/sparc/mm/ultra.S
··· 495 495 stx %o7, [%g1 + GR_SNAP_O7] 496 496 stx %i7, [%g1 + GR_SNAP_I7] 497 497 /* Don't try this at home kids... */ 498 - rdpr %cwp, %g2 499 - sub %g2, 1, %g7 498 + rdpr %cwp, %g3 499 + sub %g3, 1, %g7 500 500 wrpr %g7, %cwp 501 501 mov %i7, %g7 502 - wrpr %g2, %cwp 502 + wrpr %g3, %cwp 503 503 stx %g7, [%g1 + GR_SNAP_RPC] 504 504 sethi %hi(trap_block), %g7 505 505 or %g7, %lo(trap_block), %g7
+7 -2
arch/tile/include/asm/thread_info.h
··· 100 100 101 101 #else /* __ASSEMBLY__ */ 102 102 103 - /* how to get the thread information struct from ASM */ 103 + /* 104 + * How to get the thread information struct from assembly. 105 + * Note that we use different macros since different architectures 106 + * have different semantics in their "mm" instruction and we would 107 + * like to guarantee that the macro expands to exactly one instruction. 108 + */ 104 109 #ifdef __tilegx__ 105 - #define GET_THREAD_INFO(reg) move reg, sp; mm reg, zero, LOG2_THREAD_SIZE, 63 110 + #define EXTRACT_THREAD_INFO(reg) mm reg, zero, LOG2_THREAD_SIZE, 63 106 111 #else 107 112 #define GET_THREAD_INFO(reg) mm reg, sp, zero, LOG2_THREAD_SIZE, 31 108 113 #endif
+5 -7
arch/tile/kernel/compat_signal.c
··· 403 403 * Set up registers for signal handler. 404 404 * Registers that we don't modify keep the value they had from 405 405 * user-space at the time we took the signal. 406 + * We always pass siginfo and mcontext, regardless of SA_SIGINFO, 407 + * since some things rely on this (e.g. glibc's debug/segfault.c). 406 408 */ 407 409 regs->pc = ptr_to_compat_reg(ka->sa.sa_handler); 408 410 regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */ 409 411 regs->sp = ptr_to_compat_reg(frame); 410 412 regs->lr = restorer; 411 413 regs->regs[0] = (unsigned long) usig; 412 - 413 - if (ka->sa.sa_flags & SA_SIGINFO) { 414 - /* Need extra arguments, so mark to restore caller-saves. */ 415 - regs->regs[1] = ptr_to_compat_reg(&frame->info); 416 - regs->regs[2] = ptr_to_compat_reg(&frame->uc); 417 - regs->flags |= PT_FLAGS_CALLER_SAVES; 418 - } 414 + regs->regs[1] = ptr_to_compat_reg(&frame->info); 415 + regs->regs[2] = ptr_to_compat_reg(&frame->uc); 416 + regs->flags |= PT_FLAGS_CALLER_SAVES; 419 417 420 418 /* 421 419 * Notify any tracer that was single-stepping it.
+28 -13
arch/tile/kernel/intvec_32.S
··· 839 839 FEEDBACK_REENTER(interrupt_return) 840 840 841 841 /* 842 + * Use r33 to hold whether we have already loaded the callee-saves 843 + * into ptregs. We don't want to do it twice in this loop, since 844 + * then we'd clobber whatever changes are made by ptrace, etc. 845 + * Get base of stack in r32. 846 + */ 847 + { 848 + GET_THREAD_INFO(r32) 849 + movei r33, 0 850 + } 851 + 852 + .Lretry_work_pending: 853 + /* 842 854 * Disable interrupts so as to make sure we don't 843 855 * miss an interrupt that sets any of the thread flags (like 844 856 * need_resched or sigpending) between sampling and the iret. ··· 859 847 */ 860 848 IRQ_DISABLE(r20, r21) 861 849 TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ 862 - 863 - /* Get base of stack in r32; note r30/31 are used as arguments here. */ 864 - GET_THREAD_INFO(r32) 865 850 866 851 867 852 /* Check to see if there is any work to do before returning to user. */ ··· 875 866 876 867 /* 877 868 * Make sure we have all the registers saved for signal 878 - * handling or single-step. Call out to C code to figure out 879 - * exactly what we need to do for each flag bit, then if 880 - * necessary, reload the flags and recheck. 869 + * handling, notify-resume, or single-step. Call out to C 870 + * code to figure out exactly what we need to do for each flag bit, 871 + * then if necessary, reload the flags and recheck. 881 872 */ 882 - push_extra_callee_saves r0 883 873 { 884 874 PTREGS_PTR(r0, PTREGS_OFFSET_BASE) 885 - jal do_work_pending 875 + bnz r33, 1f 886 876 } 887 - bnz r0, .Lresume_userspace 877 + push_extra_callee_saves r0 878 + movei r33, 1 879 + 1: jal do_work_pending 880 + bnz r0, .Lretry_work_pending 888 881 889 882 /* 890 883 * In the NMI case we ··· 1191 1180 add r20, r20, tp 1192 1181 lw r21, r20 1193 1182 addi r21, r21, 1 1194 - sw r20, r21 1183 + { 1184 + sw r20, r21 1185 + GET_THREAD_INFO(r31) 1186 + } 1195 1187 1196 1188 /* Trace syscalls, if requested. */ 1197 - GET_THREAD_INFO(r31) 1198 1189 addi r31, r31, THREAD_INFO_FLAGS_OFFSET 1199 1190 lw r30, r31 1200 1191 andi r30, r30, _TIF_SYSCALL_TRACE ··· 1375 1362 3: 1376 1363 /* set PC and continue */ 1377 1364 lw r26, r24 1378 - sw r28, r26 1365 + { 1366 + sw r28, r26 1367 + GET_THREAD_INFO(r0) 1368 + } 1379 1369 1380 1370 /* 1381 1371 * Clear TIF_SINGLESTEP to prevent recursion if we execute an ill. ··· 1386 1370 * need to clear it here and can't really impose on all other arches. 1387 1371 * So what's another write between friends? 1388 1372 */ 1389 - GET_THREAD_INFO(r0) 1390 1373 1391 1374 addi r1, r0, THREAD_INFO_FLAGS_OFFSET 1392 1375 {
+28 -10
arch/tile/kernel/intvec_64.S
··· 647 647 FEEDBACK_REENTER(interrupt_return) 648 648 649 649 /* 650 + * Use r33 to hold whether we have already loaded the callee-saves 651 + * into ptregs. We don't want to do it twice in this loop, since 652 + * then we'd clobber whatever changes are made by ptrace, etc. 653 + */ 654 + { 655 + movei r33, 0 656 + move r32, sp 657 + } 658 + 659 + /* Get base of stack in r32. */ 660 + EXTRACT_THREAD_INFO(r32) 661 + 662 + .Lretry_work_pending: 663 + /* 650 664 * Disable interrupts so as to make sure we don't 651 665 * miss an interrupt that sets any of the thread flags (like 652 666 * need_resched or sigpending) between sampling and the iret. ··· 669 655 */ 670 656 IRQ_DISABLE(r20, r21) 671 657 TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ 672 - 673 - /* Get base of stack in r32; note r30/31 are used as arguments here. */ 674 - GET_THREAD_INFO(r32) 675 658 676 659 677 660 /* Check to see if there is any work to do before returning to user. */ ··· 685 674 686 675 /* 687 676 * Make sure we have all the registers saved for signal 688 - * handling or single-step. Call out to C code to figure out 677 + * handling or notify-resume. Call out to C code to figure out 689 678 * exactly what we need to do for each flag bit, then if 690 679 * necessary, reload the flags and recheck. 691 680 */ 692 - push_extra_callee_saves r0 693 681 { 694 682 PTREGS_PTR(r0, PTREGS_OFFSET_BASE) 695 - jal do_work_pending 683 + bnez r33, 1f 696 684 } 697 - bnez r0, .Lresume_userspace 685 + push_extra_callee_saves r0 686 + movei r33, 1 687 + 1: jal do_work_pending 688 + bnez r0, .Lretry_work_pending 698 689 699 690 /* 700 691 * In the NMI case we ··· 981 968 shl16insli r20, r20, hw0(irq_stat + IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET) 982 969 add r20, r20, tp 983 970 ld4s r21, r20 984 - addi r21, r21, 1 985 - st4 r20, r21 971 + { 972 + addi r21, r21, 1 973 + move r31, sp 974 + } 975 + { 976 + st4 r20, r21 977 + EXTRACT_THREAD_INFO(r31) 978 + } 986 979 987 980 /* Trace syscalls, if requested. */ 988 - GET_THREAD_INFO(r31) 989 981 addi r31, r31, THREAD_INFO_FLAGS_OFFSET 990 982 ld r30, r31 991 983 andi r30, r30, _TIF_SYSCALL_TRACE
+5 -2
arch/tile/kernel/process.c
··· 567 567 */ 568 568 int do_work_pending(struct pt_regs *regs, u32 thread_info_flags) 569 569 { 570 + /* If we enter in kernel mode, do nothing and exit the caller loop. */ 571 + if (!user_mode(regs)) 572 + return 0; 573 + 570 574 if (thread_info_flags & _TIF_NEED_RESCHED) { 571 575 schedule(); 572 576 return 1; ··· 593 589 return 1; 594 590 } 595 591 if (thread_info_flags & _TIF_SINGLESTEP) { 596 - if ((regs->ex1 & SPR_EX_CONTEXT_1_1__PL_MASK) == 0) 597 - single_step_once(regs); 592 + single_step_once(regs); 598 593 return 0; 599 594 } 600 595 panic("work_pending: bad flags %#x\n", thread_info_flags);
+1 -1
arch/x86/Kconfig
··· 81 81 select CLKEVT_I8253 82 82 select ARCH_HAVE_NMI_SAFE_CMPXCHG 83 83 select GENERIC_IOMAP 84 - select DCACHE_WORD_ACCESS if !DEBUG_PAGEALLOC 84 + select DCACHE_WORD_ACCESS 85 85 86 86 config INSTRUCTION_DECODER 87 87 def_bool (KPROBES || PERF_EVENTS)
-2
arch/x86/boot/compressed/relocs.c
··· 403 403 for (i = 0; i < ehdr.e_shnum; i++) { 404 404 struct section *sec = &secs[i]; 405 405 char *sym_strtab; 406 - Elf32_Sym *sh_symtab; 407 406 int j; 408 407 409 408 if (sec->shdr.sh_type != SHT_SYMTAB) { 410 409 continue; 411 410 } 412 - sh_symtab = sec->symtab; 413 411 sym_strtab = sec->link->strtab; 414 412 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Sym); j++) { 415 413 Elf32_Sym *sym;
+1 -2
arch/x86/ia32/ia32_aout.c
··· 294 294 295 295 /* OK, This is the point of no return */ 296 296 set_personality(PER_LINUX); 297 - set_thread_flag(TIF_IA32); 298 - current->mm->context.ia32_compat = 1; 297 + set_personality_ia32(false); 299 298 300 299 setup_new_exec(bprm); 301 300
+33
arch/x86/include/asm/word-at-a-time.h
··· 43 43 return ((a - REPEAT_BYTE(0x01)) & ~a) & REPEAT_BYTE(0x80); 44 44 } 45 45 46 + /* 47 + * Load an unaligned word from kernel space. 48 + * 49 + * In the (very unlikely) case of the word being a page-crosser 50 + * and the next page not being mapped, take the exception and 51 + * return zeroes in the non-existing part. 52 + */ 53 + static inline unsigned long load_unaligned_zeropad(const void *addr) 54 + { 55 + unsigned long ret, dummy; 56 + 57 + asm( 58 + "1:\tmov %2,%0\n" 59 + "2:\n" 60 + ".section .fixup,\"ax\"\n" 61 + "3:\t" 62 + "lea %2,%1\n\t" 63 + "and %3,%1\n\t" 64 + "mov (%1),%0\n\t" 65 + "leal %2,%%ecx\n\t" 66 + "andl %4,%%ecx\n\t" 67 + "shll $3,%%ecx\n\t" 68 + "shr %%cl,%0\n\t" 69 + "jmp 2b\n" 70 + ".previous\n" 71 + _ASM_EXTABLE(1b, 3b) 72 + :"=&r" (ret),"=&c" (dummy) 73 + :"m" (*(unsigned long *)addr), 74 + "i" (-sizeof(unsigned long)), 75 + "i" (sizeof(unsigned long)-1)); 76 + return ret; 77 + } 78 + 46 79 #endif /* _ASM_WORD_AT_A_TIME_H */
+18
arch/x86/kernel/cpu/amd.c
··· 580 580 } 581 581 } 582 582 583 + /* re-enable TopologyExtensions if switched off by BIOS */ 584 + if ((c->x86 == 0x15) && 585 + (c->x86_model >= 0x10) && (c->x86_model <= 0x1f) && 586 + !cpu_has(c, X86_FEATURE_TOPOEXT)) { 587 + u64 val; 588 + 589 + if (!rdmsrl_amd_safe(0xc0011005, &val)) { 590 + val |= 1ULL << 54; 591 + wrmsrl_amd_safe(0xc0011005, val); 592 + rdmsrl(0xc0011005, val); 593 + if (val & (1ULL << 54)) { 594 + set_cpu_cap(c, X86_FEATURE_TOPOEXT); 595 + printk(KERN_INFO FW_INFO "CPU: Re-enabling " 596 + "disabled Topology Extensions Support\n"); 597 + } 598 + } 599 + } 600 + 583 601 cpu_detect_cache_sizes(c); 584 602 585 603 /* Multi core CPU? */
+1 -8
arch/x86/kernel/kvm.c
··· 79 79 u32 token; 80 80 int cpu; 81 81 bool halted; 82 - struct mm_struct *mm; 83 82 }; 84 83 85 84 static struct kvm_task_sleep_head { ··· 125 126 126 127 n.token = token; 127 128 n.cpu = smp_processor_id(); 128 - n.mm = current->active_mm; 129 129 n.halted = idle || preempt_count() > 1; 130 - atomic_inc(&n.mm->mm_count); 131 130 init_waitqueue_head(&n.wq); 132 131 hlist_add_head(&n.link, &b->list); 133 132 spin_unlock(&b->lock); ··· 158 161 static void apf_task_wake_one(struct kvm_task_sleep_node *n) 159 162 { 160 163 hlist_del_init(&n->link); 161 - if (!n->mm) 162 - return; 163 - mmdrop(n->mm); 164 164 if (n->halted) 165 165 smp_send_reschedule(n->cpu); 166 166 else if (waitqueue_active(&n->wq)) ··· 201 207 * async PF was not yet handled. 202 208 * Add dummy entry for the token. 203 209 */ 204 - n = kmalloc(sizeof(*n), GFP_ATOMIC); 210 + n = kzalloc(sizeof(*n), GFP_ATOMIC); 205 211 if (!n) { 206 212 /* 207 213 * Allocation failed! Busy wait while other cpu ··· 213 219 } 214 220 n->token = token; 215 221 n->cpu = smp_processor_id(); 216 - n->mm = NULL; 217 222 init_waitqueue_head(&n->wq); 218 223 hlist_add_head(&n->link, &b->list); 219 224 } else
+1
arch/x86/kernel/process_64.c
··· 423 423 current_thread_info()->status |= TS_COMPAT; 424 424 } 425 425 } 426 + EXPORT_SYMBOL_GPL(set_personality_ia32); 426 427 427 428 unsigned long get_wchan(struct task_struct *p) 428 429 {
+13 -1
arch/x86/kernel/setup_percpu.c
··· 185 185 #endif 186 186 rc = -EINVAL; 187 187 if (pcpu_chosen_fc != PCPU_FC_PAGE) { 188 - const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE; 189 188 const size_t dyn_size = PERCPU_MODULE_RESERVE + 190 189 PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE; 190 + size_t atom_size; 191 191 192 + /* 193 + * On 64bit, use PMD_SIZE for atom_size so that embedded 194 + * percpu areas are aligned to PMD. This, in the future, 195 + * can also allow using PMD mappings in vmalloc area. Use 196 + * PAGE_SIZE on 32bit as vmalloc space is highly contended 197 + * and large vmalloc area allocs can easily fail. 198 + */ 199 + #ifdef CONFIG_X86_64 200 + atom_size = PMD_SIZE; 201 + #else 202 + atom_size = PAGE_SIZE; 203 + #endif 192 204 rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE, 193 205 dyn_size, atom_size, 194 206 pcpu_cpu_distance,
+1
arch/x86/kvm/x86.c
··· 6581 6581 kvm_inject_page_fault(vcpu, &fault); 6582 6582 } 6583 6583 vcpu->arch.apf.halted = false; 6584 + vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; 6584 6585 } 6585 6586 6586 6587 bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu)
+1 -1
arch/x86/platform/geode/net5501.c
··· 63 63 .name = "net5501:1", 64 64 .gpio = 6, 65 65 .default_trigger = "default-on", 66 - .active_low = 1, 66 + .active_low = 0, 67 67 }, 68 68 }; 69 69
+39 -3
arch/x86/xen/enlighten.c
··· 63 63 #include <asm/stackprotector.h> 64 64 #include <asm/hypervisor.h> 65 65 #include <asm/mwait.h> 66 + #include <asm/pci_x86.h> 66 67 67 68 #ifdef CONFIG_ACPI 68 69 #include <linux/acpi.h> ··· 810 809 } 811 810 812 811 #ifdef CONFIG_X86_LOCAL_APIC 812 + static unsigned long xen_set_apic_id(unsigned int x) 813 + { 814 + WARN_ON(1); 815 + return x; 816 + } 817 + static unsigned int xen_get_apic_id(unsigned long x) 818 + { 819 + return ((x)>>24) & 0xFFu; 820 + } 813 821 static u32 xen_apic_read(u32 reg) 814 822 { 815 - return 0; 823 + struct xen_platform_op op = { 824 + .cmd = XENPF_get_cpuinfo, 825 + .interface_version = XENPF_INTERFACE_VERSION, 826 + .u.pcpu_info.xen_cpuid = 0, 827 + }; 828 + int ret = 0; 829 + 830 + /* Shouldn't need this as APIC is turned off for PV, and we only 831 + * get called on the bootup processor. But just in case. */ 832 + if (!xen_initial_domain() || smp_processor_id()) 833 + return 0; 834 + 835 + if (reg == APIC_LVR) 836 + return 0x10; 837 + 838 + if (reg != APIC_ID) 839 + return 0; 840 + 841 + ret = HYPERVISOR_dom0_op(&op); 842 + if (ret) 843 + return 0; 844 + 845 + return op.u.pcpu_info.apic_id << 24; 816 846 } 817 847 818 848 static void xen_apic_write(u32 reg, u32 val) ··· 881 849 apic->icr_write = xen_apic_icr_write; 882 850 apic->wait_icr_idle = xen_apic_wait_icr_idle; 883 851 apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle; 852 + apic->set_apic_id = xen_set_apic_id; 853 + apic->get_apic_id = xen_get_apic_id; 884 854 } 885 855 886 856 #endif ··· 1399 1365 /* Make sure ACS will be enabled */ 1400 1366 pci_request_acs(); 1401 1367 } 1402 - 1403 - 1368 + #ifdef CONFIG_PCI 1369 + /* PCI BIOS service won't work from a PV guest. */ 1370 + pci_probe &= ~PCI_PROBE_BIOS; 1371 + #endif 1404 1372 xen_raw_console_write("about to get started...\n"); 1405 1373 1406 1374 xen_setup_runstate_info(0);
+6 -1
arch/x86/xen/mmu.c
··· 353 353 { 354 354 if (val & _PAGE_PRESENT) { 355 355 unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; 356 + unsigned long pfn = mfn_to_pfn(mfn); 357 + 356 358 pteval_t flags = val & PTE_FLAGS_MASK; 357 - val = ((pteval_t)mfn_to_pfn(mfn) << PAGE_SHIFT) | flags; 359 + if (unlikely(pfn == ~0)) 360 + val = flags & ~_PAGE_PRESENT; 361 + else 362 + val = ((pteval_t)pfn << PAGE_SHIFT) | flags; 358 363 } 359 364 360 365 return val;
+1 -1
drivers/acpi/power.c
··· 631 631 * We know a device's inferred power state when all the resources 632 632 * required for a given D-state are 'on'. 633 633 */ 634 - for (i = ACPI_STATE_D0; i < ACPI_STATE_D3; i++) { 634 + for (i = ACPI_STATE_D0; i < ACPI_STATE_D3_HOT; i++) { 635 635 list = &device->power.states[i].resources; 636 636 if (list->count < 1) 637 637 continue;
+7 -10
drivers/acpi/scan.c
··· 869 869 /* 870 870 * Enumerate supported power management states 871 871 */ 872 - for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3; i++) { 872 + for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) { 873 873 struct acpi_device_power_state *ps = &device->power.states[i]; 874 874 char object_name[5] = { '_', 'P', 'R', '0' + i, '\0' }; 875 875 ··· 884 884 acpi_bus_add_power_resource(ps->resources.handles[j]); 885 885 } 886 886 887 - /* The exist of _PR3 indicates D3Cold support */ 888 - if (i == ACPI_STATE_D3) { 889 - status = acpi_get_handle(device->handle, object_name, &handle); 890 - if (ACPI_SUCCESS(status)) 891 - device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1; 892 - } 893 - 894 887 /* Evaluate "_PSx" to see if we can do explicit sets */ 895 888 object_name[2] = 'S'; 896 889 status = acpi_get_handle(device->handle, object_name, &handle); 897 890 if (ACPI_SUCCESS(status)) 898 891 ps->flags.explicit_set = 1; 899 892 900 - /* State is valid if we have some power control */ 901 - if (ps->resources.count || ps->flags.explicit_set) 893 + /* 894 + * State is valid if there are means to put the device into it. 895 + * D3hot is only valid if _PR3 present. 896 + */ 897 + if (ps->resources.count || 898 + (ps->flags.explicit_set && i < ACPI_STATE_D3_HOT)) 902 899 ps->flags.valid = 1; 903 900 904 901 ps->power = -1; /* Unknown - driver assigned */
+3 -1
drivers/base/regmap/regmap.c
··· 775 775 map->format.parse_val(val + i); 776 776 } else { 777 777 for (i = 0; i < val_count; i++) { 778 - ret = regmap_read(map, reg + i, val + (i * val_bytes)); 778 + unsigned int ival; 779 + ret = regmap_read(map, reg + i, &ival); 779 780 if (ret != 0) 780 781 return ret; 782 + memcpy(val + (i * val_bytes), &ival, val_bytes); 781 783 } 782 784 } 783 785
+1 -1
drivers/block/drbd/drbd_nl.c
··· 2297 2297 return; 2298 2298 } 2299 2299 2300 - if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) { 2300 + if (!capable(CAP_SYS_ADMIN)) { 2301 2301 retcode = ERR_PERM; 2302 2302 goto fail; 2303 2303 }
+3 -6
drivers/gpio/gpio-omap.c
··· 965 965 } 966 966 967 967 _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->irqenable_inv); 968 - _gpio_rmw(base, bank->regs->irqstatus, l, 969 - bank->regs->irqenable_inv == false); 970 - _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->debounce_en != 0); 971 - _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->ctrl != 0); 968 + _gpio_rmw(base, bank->regs->irqstatus, l, !bank->regs->irqenable_inv); 972 969 if (bank->regs->debounce_en) 973 - _gpio_rmw(base, bank->regs->debounce_en, 0, 1); 970 + __raw_writel(0, base + bank->regs->debounce_en); 974 971 975 972 /* Save OE default value (0xffffffff) in the context */ 976 973 bank->context.oe = __raw_readl(bank->base + bank->regs->direction); 977 974 /* Initialize interface clk ungated, module enabled */ 978 975 if (bank->regs->ctrl) 979 - _gpio_rmw(base, bank->regs->ctrl, 0, 1); 976 + __raw_writel(0, base + bank->regs->ctrl); 980 977 } 981 978 982 979 static __devinit void
+28 -29
drivers/gpio/gpio-pch.c
··· 230 230 231 231 static int pch_irq_type(struct irq_data *d, unsigned int type) 232 232 { 233 - u32 im; 234 - u32 __iomem *im_reg; 235 - u32 ien; 236 - u32 im_pos; 237 - int ch; 238 - unsigned long flags; 239 - u32 val; 240 - int irq = d->irq; 241 233 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 242 234 struct pch_gpio *chip = gc->private; 235 + u32 im, im_pos, val; 236 + u32 __iomem *im_reg; 237 + unsigned long flags; 238 + int ch, irq = d->irq; 243 239 244 240 ch = irq - chip->irq_base; 245 241 if (irq <= chip->irq_base + 7) { ··· 266 270 case IRQ_TYPE_LEVEL_LOW: 267 271 val = PCH_LEVEL_L; 268 272 break; 269 - case IRQ_TYPE_PROBE: 270 - goto end; 271 273 default: 272 - dev_warn(chip->dev, "%s: unknown type(%dd)", 273 - __func__, type); 274 - goto end; 274 + goto unlock; 275 275 } 276 276 277 277 /* Set interrupt mode */ 278 278 im = ioread32(im_reg) & ~(PCH_IM_MASK << (im_pos * 4)); 279 279 iowrite32(im | (val << (im_pos * 4)), im_reg); 280 280 281 - /* iclr */ 282 - iowrite32(BIT(ch), &chip->reg->iclr); 281 + /* And the handler */ 282 + if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) 283 + __irq_set_handler_locked(d->irq, handle_level_irq); 284 + else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 285 + __irq_set_handler_locked(d->irq, handle_edge_irq); 283 286 284 - /* IMASKCLR */ 285 - iowrite32(BIT(ch), &chip->reg->imaskclr); 286 - 287 - /* Enable interrupt */ 288 - ien = ioread32(&chip->reg->ien); 289 - iowrite32(ien | BIT(ch), &chip->reg->ien); 290 - end: 287 + unlock: 291 288 spin_unlock_irqrestore(&chip->spinlock, flags); 292 - 293 289 return 0; 294 290 } 295 291 ··· 301 313 iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->imask); 302 314 } 303 315 316 + static void pch_irq_ack(struct irq_data *d) 317 + { 318 + struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 319 + struct pch_gpio *chip = gc->private; 320 + 321 + iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->iclr); 322 + } 323 + 304 324 static irqreturn_t pch_gpio_handler(int irq, void *dev_id) 305 325 { 306 326 struct pch_gpio *chip = dev_id; 307 327 u32 reg_val = ioread32(&chip->reg->istatus); 308 - int i; 309 - int ret = IRQ_NONE; 328 + int i, ret = IRQ_NONE; 310 329 311 330 for (i = 0; i < gpio_pins[chip->ioh]; i++) { 312 331 if (reg_val & BIT(i)) { 313 332 dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%x\n", 314 333 __func__, i, irq, reg_val); 315 - iowrite32(BIT(i), &chip->reg->iclr); 316 334 generic_handle_irq(chip->irq_base + i); 317 335 ret = IRQ_HANDLED; 318 336 } ··· 337 343 gc->private = chip; 338 344 ct = gc->chip_types; 339 345 346 + ct->chip.irq_ack = pch_irq_ack; 340 347 ct->chip.irq_mask = pch_irq_mask; 341 348 ct->chip.irq_unmask = pch_irq_unmask; 342 349 ct->chip.irq_set_type = pch_irq_type; ··· 352 357 s32 ret; 353 358 struct pch_gpio *chip; 354 359 int irq_base; 360 + u32 msk; 355 361 356 362 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 357 363 if (chip == NULL) ··· 404 408 } 405 409 chip->irq_base = irq_base; 406 410 411 + /* Mask all interrupts, but enable them */ 412 + msk = (1 << gpio_pins[chip->ioh]) - 1; 413 + iowrite32(msk, &chip->reg->imask); 414 + iowrite32(msk, &chip->reg->ien); 415 + 407 416 ret = request_irq(pdev->irq, pch_gpio_handler, 408 - IRQF_SHARED, KBUILD_MODNAME, chip); 417 + IRQF_SHARED, KBUILD_MODNAME, chip); 409 418 if (ret != 0) { 410 419 dev_err(&pdev->dev, 411 420 "%s request_irq failed\n", __func__); ··· 419 418 420 419 pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); 421 420 422 - /* Initialize interrupt ien register */ 423 - iowrite32(0, &chip->reg->ien); 424 421 end: 425 422 return 0; 426 423
+12 -6
drivers/gpio/gpio-samsung.c
··· 452 452 }; 453 453 #endif 454 454 455 + #if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5) 455 456 static struct samsung_gpio_cfg exynos_gpio_cfg = { 456 457 .set_pull = exynos_gpio_setpull, 457 458 .get_pull = exynos_gpio_getpull, 458 459 .set_config = samsung_gpio_setcfg_4bit, 459 460 .get_config = samsung_gpio_getcfg_4bit, 460 461 }; 462 + #endif 461 463 462 464 #if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) 463 465 static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { ··· 2125 2123 * uses the above macro and depends on the banks being listed in order here. 2126 2124 */ 2127 2125 2128 - static struct samsung_gpio_chip exynos4_gpios_1[] = { 2129 2126 #ifdef CONFIG_ARCH_EXYNOS4 2127 + static struct samsung_gpio_chip exynos4_gpios_1[] = { 2130 2128 { 2131 2129 .chip = { 2132 2130 .base = EXYNOS4_GPA0(0), ··· 2224 2222 .label = "GPF3", 2225 2223 }, 2226 2224 }, 2227 - #endif 2228 2225 }; 2226 + #endif 2229 2227 2230 - static struct samsung_gpio_chip exynos4_gpios_2[] = { 2231 2228 #ifdef CONFIG_ARCH_EXYNOS4 2229 + static struct samsung_gpio_chip exynos4_gpios_2[] = { 2232 2230 { 2233 2231 .chip = { 2234 2232 .base = EXYNOS4_GPJ0(0), ··· 2369 2367 .to_irq = samsung_gpiolib_to_irq, 2370 2368 }, 2371 2369 }, 2372 - #endif 2373 2370 }; 2371 + #endif 2374 2372 2375 - static struct samsung_gpio_chip exynos4_gpios_3[] = { 2376 2373 #ifdef CONFIG_ARCH_EXYNOS4 2374 + static struct samsung_gpio_chip exynos4_gpios_3[] = { 2377 2375 { 2378 2376 .chip = { 2379 2377 .base = EXYNOS4_GPZ(0), ··· 2381 2379 .label = "GPZ", 2382 2380 }, 2383 2381 }, 2384 - #endif 2385 2382 }; 2383 + #endif 2386 2384 2387 2385 #ifdef CONFIG_ARCH_EXYNOS5 2388 2386 static struct samsung_gpio_chip exynos5_gpios_1[] = { ··· 2721 2719 { 2722 2720 struct samsung_gpio_chip *chip; 2723 2721 int i, nr_chips; 2722 + #if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250) 2724 2723 void __iomem *gpio_base1, *gpio_base2, *gpio_base3, *gpio_base4; 2724 + #endif 2725 2725 int group = 0; 2726 2726 2727 2727 samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); ··· 2975 2971 2976 2972 return 0; 2977 2973 2974 + #if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250) 2978 2975 err_ioremap4: 2979 2976 iounmap(gpio_base3); 2980 2977 err_ioremap3: ··· 2984 2979 iounmap(gpio_base1); 2985 2980 err_ioremap1: 2986 2981 return -ENOMEM; 2982 + #endif 2987 2983 } 2988 2984 core_initcall(samsung_gpiolib_init); 2989 2985
+3
drivers/gpu/drm/i915/i915_debugfs.c
··· 1224 1224 unsigned long temp, chipset, gfx; 1225 1225 int ret; 1226 1226 1227 + if (!IS_GEN5(dev)) 1228 + return -ENODEV; 1229 + 1227 1230 ret = mutex_lock_interruptible(&dev->struct_mutex); 1228 1231 if (ret) 1229 1232 return ret;
+10 -5
drivers/gpu/drm/i915/i915_dma.c
··· 1701 1701 unsigned long diffms; 1702 1702 u32 count; 1703 1703 1704 + if (dev_priv->info->gen != 5) 1705 + return; 1706 + 1704 1707 getrawmonotonic(&now); 1705 1708 diff1 = timespec_sub(now, dev_priv->last_time2); 1706 1709 ··· 2124 2121 setup_timer(&dev_priv->hangcheck_timer, i915_hangcheck_elapsed, 2125 2122 (unsigned long) dev); 2126 2123 2127 - spin_lock(&mchdev_lock); 2128 - i915_mch_dev = dev_priv; 2129 - dev_priv->mchdev_lock = &mchdev_lock; 2130 - spin_unlock(&mchdev_lock); 2124 + if (IS_GEN5(dev)) { 2125 + spin_lock(&mchdev_lock); 2126 + i915_mch_dev = dev_priv; 2127 + dev_priv->mchdev_lock = &mchdev_lock; 2128 + spin_unlock(&mchdev_lock); 2131 2129 2132 - ips_ping_for_i915_load(); 2130 + ips_ping_for_i915_load(); 2131 + } 2133 2132 2134 2133 return 0; 2135 2134
+5 -4
drivers/gpu/drm/i915/intel_display.c
··· 7072 7072 struct drm_device *dev = crtc->dev; 7073 7073 drm_i915_private_t *dev_priv = dev->dev_private; 7074 7074 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 7075 - int pipe = intel_crtc->pipe; 7076 - int dpll_reg = DPLL(pipe); 7077 - int dpll = I915_READ(dpll_reg); 7078 7075 7079 7076 if (HAS_PCH_SPLIT(dev)) 7080 7077 return; ··· 7084 7087 * the manual case. 7085 7088 */ 7086 7089 if (!HAS_PIPE_CXSR(dev) && intel_crtc->lowfreq_avail) { 7090 + int pipe = intel_crtc->pipe; 7091 + int dpll_reg = DPLL(pipe); 7092 + u32 dpll; 7093 + 7087 7094 DRM_DEBUG_DRIVER("downclocking LVDS\n"); 7088 7095 7089 7096 assert_panel_unlocked(dev_priv, pipe); 7090 7097 7098 + dpll = I915_READ(dpll_reg); 7091 7099 dpll |= DISPLAY_RATE_SELECT_FPA1; 7092 7100 I915_WRITE(dpll_reg, dpll); 7093 7101 intel_wait_for_vblank(dev, pipe); ··· 7100 7098 if (!(dpll & DISPLAY_RATE_SELECT_FPA1)) 7101 7099 DRM_DEBUG_DRIVER("failed to downclock LVDS!\n"); 7102 7100 } 7103 - 7104 7101 } 7105 7102 7106 7103 /**
+1 -1
drivers/gpu/drm/i915/intel_hdmi.c
··· 136 136 137 137 val &= ~VIDEO_DIP_SELECT_MASK; 138 138 139 - I915_WRITE(VIDEO_DIP_CTL, val | port | flags); 139 + I915_WRITE(VIDEO_DIP_CTL, VIDEO_DIP_ENABLE | val | port | flags); 140 140 141 141 for (i = 0; i < len; i += 4) { 142 142 I915_WRITE(VIDEO_DIP_DATA, *data);
+2 -2
drivers/gpu/drm/i915/intel_lvds.c
··· 750 750 .ident = "Hewlett-Packard t5745", 751 751 .matches = { 752 752 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), 753 - DMI_MATCH(DMI_BOARD_NAME, "hp t5745"), 753 + DMI_MATCH(DMI_PRODUCT_NAME, "hp t5745"), 754 754 }, 755 755 }, 756 756 { ··· 758 758 .ident = "Hewlett-Packard st5747", 759 759 .matches = { 760 760 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), 761 - DMI_MATCH(DMI_BOARD_NAME, "hp st5747"), 761 + DMI_MATCH(DMI_PRODUCT_NAME, "hp st5747"), 762 762 }, 763 763 }, 764 764 {
+6 -3
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 398 398 return ret; 399 399 } 400 400 401 - if (INTEL_INFO(dev)->gen >= 6) { 402 - I915_WRITE(INSTPM, 403 - INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING); 404 401 402 + if (IS_GEN6(dev)) { 405 403 /* From the Sandybridge PRM, volume 1 part 3, page 24: 406 404 * "If this bit is set, STCunit will have LRA as replacement 407 405 * policy. [...] This bit must be reset. LRA replacement ··· 407 409 */ 408 410 I915_WRITE(CACHE_MODE_0, 409 411 CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT); 412 + } 413 + 414 + if (INTEL_INFO(dev)->gen >= 6) { 415 + I915_WRITE(INSTPM, 416 + INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING); 410 417 } 411 418 412 419 return ret;
+6
drivers/gpu/drm/i915/intel_sdvo.c
··· 1220 1220 1221 1221 static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo) 1222 1222 { 1223 + struct drm_device *dev = intel_sdvo->base.base.dev; 1223 1224 u8 response[2]; 1225 + 1226 + /* HW Erratum: SDVO Hotplug is broken on all i945G chips, there's noise 1227 + * on the line. */ 1228 + if (IS_I945G(dev) || IS_I945GM(dev)) 1229 + return false; 1224 1230 1225 1231 return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, 1226 1232 &response, 2) && response[0];
+21 -178
drivers/gpu/drm/nouveau/nouveau_i2c.c
··· 29 29 #include "nouveau_i2c.h" 30 30 #include "nouveau_hw.h" 31 31 32 - #define T_TIMEOUT 2200000 33 - #define T_RISEFALL 1000 34 - #define T_HOLD 5000 35 - 36 32 static void 37 33 i2c_drive_scl(void *data, int state) 38 34 { ··· 108 112 } 109 113 return 0; 110 114 } 111 - 112 - static void 113 - i2c_delay(struct nouveau_i2c_chan *port, u32 nsec) 114 - { 115 - udelay((nsec + 500) / 1000); 116 - } 117 - 118 - static bool 119 - i2c_raise_scl(struct nouveau_i2c_chan *port) 120 - { 121 - u32 timeout = T_TIMEOUT / T_RISEFALL; 122 - 123 - i2c_drive_scl(port, 1); 124 - do { 125 - i2c_delay(port, T_RISEFALL); 126 - } while (!i2c_sense_scl(port) && --timeout); 127 - 128 - return timeout != 0; 129 - } 130 - 131 - static int 132 - i2c_start(struct nouveau_i2c_chan *port) 133 - { 134 - int ret = 0; 135 - 136 - port->state = i2c_sense_scl(port); 137 - port->state |= i2c_sense_sda(port) << 1; 138 - if (port->state != 3) { 139 - i2c_drive_scl(port, 0); 140 - i2c_drive_sda(port, 1); 141 - if (!i2c_raise_scl(port)) 142 - ret = -EBUSY; 143 - } 144 - 145 - i2c_drive_sda(port, 0); 146 - i2c_delay(port, T_HOLD); 147 - i2c_drive_scl(port, 0); 148 - i2c_delay(port, T_HOLD); 149 - return ret; 150 - } 151 - 152 - static void 153 - i2c_stop(struct nouveau_i2c_chan *port) 154 - { 155 - i2c_drive_scl(port, 0); 156 - i2c_drive_sda(port, 0); 157 - i2c_delay(port, T_RISEFALL); 158 - 159 - i2c_drive_scl(port, 1); 160 - i2c_delay(port, T_HOLD); 161 - i2c_drive_sda(port, 1); 162 - i2c_delay(port, T_HOLD); 163 - } 164 - 165 - static int 166 - i2c_bitw(struct nouveau_i2c_chan *port, int sda) 167 - { 168 - i2c_drive_sda(port, sda); 169 - i2c_delay(port, T_RISEFALL); 170 - 171 - if (!i2c_raise_scl(port)) 172 - return -ETIMEDOUT; 173 - i2c_delay(port, T_HOLD); 174 - 175 - i2c_drive_scl(port, 0); 176 - i2c_delay(port, T_HOLD); 177 - return 0; 178 - } 179 - 180 - static int 181 - i2c_bitr(struct nouveau_i2c_chan *port) 182 - { 183 - int sda; 184 - 185 - i2c_drive_sda(port, 1); 186 - i2c_delay(port, T_RISEFALL); 187 - 188 - if (!i2c_raise_scl(port)) 189 - return -ETIMEDOUT; 190 - i2c_delay(port, T_HOLD); 191 - 192 - sda = i2c_sense_sda(port); 193 - 194 - i2c_drive_scl(port, 0); 195 - i2c_delay(port, T_HOLD); 196 - return sda; 197 - } 198 - 199 - static int 200 - i2c_get_byte(struct nouveau_i2c_chan *port, u8 *byte, bool last) 201 - { 202 - int i, bit; 203 - 204 - *byte = 0; 205 - for (i = 7; i >= 0; i--) { 206 - bit = i2c_bitr(port); 207 - if (bit < 0) 208 - return bit; 209 - *byte |= bit << i; 210 - } 211 - 212 - return i2c_bitw(port, last ? 1 : 0); 213 - } 214 - 215 - static int 216 - i2c_put_byte(struct nouveau_i2c_chan *port, u8 byte) 217 - { 218 - int i, ret; 219 - for (i = 7; i >= 0; i--) { 220 - ret = i2c_bitw(port, !!(byte & (1 << i))); 221 - if (ret < 0) 222 - return ret; 223 - } 224 - 225 - ret = i2c_bitr(port); 226 - if (ret == 1) /* nack */ 227 - ret = -EIO; 228 - return ret; 229 - } 230 - 231 - static int 232 - i2c_addr(struct nouveau_i2c_chan *port, struct i2c_msg *msg) 233 - { 234 - u32 addr = msg->addr << 1; 235 - if (msg->flags & I2C_M_RD) 236 - addr |= 1; 237 - return i2c_put_byte(port, addr); 238 - } 239 - 240 - static int 241 - i2c_bit_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) 242 - { 243 - struct nouveau_i2c_chan *port = (struct nouveau_i2c_chan *)adap; 244 - struct i2c_msg *msg = msgs; 245 - int ret = 0, mcnt = num; 246 - 247 - while (!ret && mcnt--) { 248 - u8 remaining = msg->len; 249 - u8 *ptr = msg->buf; 250 - 251 - ret = i2c_start(port); 252 - if (ret == 0) 253 - ret = i2c_addr(port, msg); 254 - 255 - if (msg->flags & I2C_M_RD) { 256 - while (!ret && remaining--) 257 - ret = i2c_get_byte(port, ptr++, !remaining); 258 - } else { 259 - while (!ret && remaining--) 260 - ret = i2c_put_byte(port, *ptr++); 261 - } 262 - 263 - msg++; 264 - } 265 - 266 - i2c_stop(port); 267 - return (ret < 0) ? ret : num; 268 - } 269 - 270 - static u32 271 - i2c_bit_func(struct i2c_adapter *adap) 272 - { 273 - return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; 274 - } 275 - 276 - const struct i2c_algorithm nouveau_i2c_bit_algo = { 277 - .master_xfer = i2c_bit_xfer, 278 - .functionality = i2c_bit_func 279 - }; 280 115 281 116 static const uint32_t nv50_i2c_port[] = { 282 117 0x00e138, 0x00e150, 0x00e168, 0x00e180, ··· 211 384 case 0: /* NV04:NV50 */ 212 385 port->drive = entry[0]; 213 386 port->sense = entry[1]; 214 - port->adapter.algo = &nouveau_i2c_bit_algo; 215 387 break; 216 388 case 4: /* NV4E */ 217 389 port->drive = 0x600800 + entry[1]; 218 390 port->sense = port->drive; 219 - port->adapter.algo = &nouveau_i2c_bit_algo; 220 391 break; 221 392 case 5: /* NV50- */ 222 393 port->drive = entry[0] & 0x0f; ··· 227 402 port->drive = 0x00d014 + (port->drive * 0x20); 228 403 port->sense = port->drive; 229 404 } 230 - port->adapter.algo = &nouveau_i2c_bit_algo; 231 405 break; 232 406 case 6: /* NV50- DP AUX */ 233 407 port->drive = entry[0]; ··· 237 413 break; 238 414 } 239 415 240 - if (!port->adapter.algo) { 416 + if (!port->adapter.algo && !port->drive) { 241 417 NV_ERROR(dev, "I2C%d: type %d index %x/%x unknown\n", 242 418 i, port->type, port->drive, port->sense); 243 419 kfree(port); ··· 253 429 port->dcb = ROM32(entry[0]); 254 430 i2c_set_adapdata(&port->adapter, i2c); 255 431 256 - ret = i2c_add_adapter(&port->adapter); 432 + if (port->adapter.algo != &nouveau_dp_i2c_algo) { 433 + port->adapter.algo_data = &port->bit; 434 + port->bit.udelay = 10; 435 + port->bit.timeout = usecs_to_jiffies(2200); 436 + port->bit.data = port; 437 + port->bit.setsda = i2c_drive_sda; 438 + port->bit.setscl = i2c_drive_scl; 439 + port->bit.getsda = i2c_sense_sda; 440 + port->bit.getscl = i2c_sense_scl; 441 + 442 + i2c_drive_scl(port, 0); 443 + i2c_drive_sda(port, 1); 444 + i2c_drive_scl(port, 1); 445 + 446 + ret = i2c_bit_add_bus(&port->adapter); 447 + } else { 448 + port->adapter.algo = &nouveau_dp_i2c_algo; 449 + ret = i2c_add_adapter(&port->adapter); 450 + } 451 + 257 452 if (ret) { 258 453 NV_ERROR(dev, "I2C%d: failed register: %d\n", i, ret); 259 454 kfree(port);
+1
drivers/gpu/drm/nouveau/nouveau_i2c.h
··· 34 34 struct nouveau_i2c_chan { 35 35 struct i2c_adapter adapter; 36 36 struct drm_device *dev; 37 + struct i2c_algo_bit_data bit; 37 38 struct list_head head; 38 39 u8 index; 39 40 u8 type;
+2 -2
drivers/gpu/drm/radeon/radeon_device.c
··· 241 241 rdev->wb.use_event = true; 242 242 } 243 243 } 244 - /* always use writeback/events on NI */ 245 - if (ASIC_IS_DCE5(rdev)) { 244 + /* always use writeback/events on NI, APUs */ 245 + if (rdev->family >= CHIP_PALM) { 246 246 rdev->wb.enabled = true; 247 247 rdev->wb.use_event = true; 248 248 }
+2 -2
drivers/leds/leds-netxbig.c
··· 112 112 return err; 113 113 } 114 114 115 - static void __devexit gpio_ext_free(struct netxbig_gpio_ext *gpio_ext) 115 + static void gpio_ext_free(struct netxbig_gpio_ext *gpio_ext) 116 116 { 117 117 int i; 118 118 ··· 294 294 295 295 static DEVICE_ATTR(sata, 0644, netxbig_led_sata_show, netxbig_led_sata_store); 296 296 297 - static void __devexit delete_netxbig_led(struct netxbig_led_data *led_dat) 297 + static void delete_netxbig_led(struct netxbig_led_data *led_dat) 298 298 { 299 299 if (led_dat->mode_val[NETXBIG_LED_SATA] != NETXBIG_LED_INVALID_MODE) 300 300 device_remove_file(led_dat->cdev.dev, &dev_attr_sata);
+1 -1
drivers/leds/leds-ns2.c
··· 255 255 return ret; 256 256 } 257 257 258 - static void __devexit delete_ns2_led(struct ns2_led_data *led_dat) 258 + static void delete_ns2_led(struct ns2_led_data *led_dat) 259 259 { 260 260 device_remove_file(led_dat->cdev.dev, &dev_attr_sata); 261 261 led_classdev_unregister(&led_dat->cdev);
+1 -2
drivers/md/bitmap.c
··· 1727 1727 bitmap->chunkshift = (ffz(~mddev->bitmap_info.chunksize) 1728 1728 - BITMAP_BLOCK_SHIFT); 1729 1729 1730 - /* now that chunksize and chunkshift are set, we can use these macros */ 1731 - chunks = (blocks + bitmap->chunkshift - 1) >> 1730 + chunks = (blocks + (1 << bitmap->chunkshift) - 1) >> 1732 1731 bitmap->chunkshift; 1733 1732 pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO; 1734 1733
-3
drivers/md/bitmap.h
··· 101 101 102 102 #define BITMAP_BLOCK_SHIFT 9 103 103 104 - /* how many blocks per chunk? (this is variable) */ 105 - #define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->mddev->bitmap_info.chunksize >> BITMAP_BLOCK_SHIFT) 106 - 107 104 #endif 108 105 109 106 /*
+1 -1
drivers/md/dm-log-userspace-transfer.c
··· 134 134 { 135 135 struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1); 136 136 137 - if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) 137 + if (!capable(CAP_SYS_ADMIN)) 138 138 return; 139 139 140 140 spin_lock(&receiving_list_lock);
+2 -2
drivers/md/dm-mpath.c
··· 718 718 return 0; 719 719 720 720 m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL); 721 - request_module("scsi_dh_%s", m->hw_handler_name); 722 - if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { 721 + if (!try_then_request_module(scsi_dh_handler_exist(m->hw_handler_name), 722 + "scsi_dh_%s", m->hw_handler_name)) { 723 723 ti->error = "unknown hardware handler type"; 724 724 ret = -EINVAL; 725 725 goto fail;
+12 -4
drivers/md/dm-thin.c
··· 279 279 280 280 hlist_del(&cell->list); 281 281 282 - bio_list_add(inmates, cell->holder); 283 - bio_list_merge(inmates, &cell->bios); 282 + if (inmates) { 283 + bio_list_add(inmates, cell->holder); 284 + bio_list_merge(inmates, &cell->bios); 285 + } 284 286 285 287 mempool_free(cell, prison->cell_pool); 286 288 } ··· 305 303 */ 306 304 static void __cell_release_singleton(struct cell *cell, struct bio *bio) 307 305 { 308 - hlist_del(&cell->list); 309 306 BUG_ON(cell->holder != bio); 310 307 BUG_ON(!bio_list_empty(&cell->bios)); 308 + 309 + __cell_release(cell, NULL); 311 310 } 312 311 313 312 static void cell_release_singleton(struct cell *cell, struct bio *bio) ··· 1180 1177 static void process_discard(struct thin_c *tc, struct bio *bio) 1181 1178 { 1182 1179 int r; 1180 + unsigned long flags; 1183 1181 struct pool *pool = tc->pool; 1184 1182 struct cell *cell, *cell2; 1185 1183 struct cell_key key, key2; ··· 1222 1218 m->bio = bio; 1223 1219 1224 1220 if (!ds_add_work(&pool->all_io_ds, &m->list)) { 1221 + spin_lock_irqsave(&pool->lock, flags); 1225 1222 list_add(&m->list, &pool->prepared_discards); 1223 + spin_unlock_irqrestore(&pool->lock, flags); 1226 1224 wake_worker(pool); 1227 1225 } 1228 1226 } else { ··· 2632 2626 if (h->all_io_entry) { 2633 2627 INIT_LIST_HEAD(&work); 2634 2628 ds_dec(h->all_io_entry, &work); 2629 + spin_lock_irqsave(&pool->lock, flags); 2635 2630 list_for_each_entry_safe(m, tmp, &work, list) 2636 2631 list_add(&m->list, &pool->prepared_discards); 2632 + spin_unlock_irqrestore(&pool->lock, flags); 2637 2633 } 2638 2634 2639 2635 mempool_free(h, pool->endio_hook_pool); ··· 2767 2759 module_init(dm_thin_init); 2768 2760 module_exit(dm_thin_exit); 2769 2761 2770 - MODULE_DESCRIPTION(DM_NAME "device-mapper thin provisioning target"); 2762 + MODULE_DESCRIPTION(DM_NAME " thin provisioning target"); 2771 2763 MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>"); 2772 2764 MODULE_LICENSE("GPL");
+4
drivers/media/dvb/dvb-core/dvb_frontend.c
··· 1921 1921 } else { 1922 1922 /* default values */ 1923 1923 switch (c->delivery_system) { 1924 + case SYS_DVBS: 1925 + case SYS_DVBS2: 1926 + case SYS_ISDBS: 1927 + case SYS_TURBO: 1924 1928 case SYS_DVBC_ANNEX_A: 1925 1929 case SYS_DVBC_ANNEX_C: 1926 1930 fepriv->min_delay = HZ / 20;
+16 -16
drivers/media/rc/ene_ir.c
··· 1018 1018 1019 1019 spin_lock_init(&dev->hw_lock); 1020 1020 1021 - /* claim the resources */ 1022 - error = -EBUSY; 1023 - dev->hw_io = pnp_port_start(pnp_dev, 0); 1024 - if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { 1025 - dev->hw_io = -1; 1026 - dev->irq = -1; 1027 - goto error; 1028 - } 1029 - 1030 - dev->irq = pnp_irq(pnp_dev, 0); 1031 - if (request_irq(dev->irq, ene_isr, 1032 - IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) { 1033 - dev->irq = -1; 1034 - goto error; 1035 - } 1036 - 1037 1021 pnp_set_drvdata(pnp_dev, dev); 1038 1022 dev->pnp_dev = pnp_dev; 1039 1023 ··· 1069 1085 1070 1086 device_set_wakeup_capable(&pnp_dev->dev, true); 1071 1087 device_set_wakeup_enable(&pnp_dev->dev, true); 1088 + 1089 + /* claim the resources */ 1090 + error = -EBUSY; 1091 + dev->hw_io = pnp_port_start(pnp_dev, 0); 1092 + if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { 1093 + dev->hw_io = -1; 1094 + dev->irq = -1; 1095 + goto error; 1096 + } 1097 + 1098 + dev->irq = pnp_irq(pnp_dev, 0); 1099 + if (request_irq(dev->irq, ene_isr, 1100 + IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) { 1101 + dev->irq = -1; 1102 + goto error; 1103 + } 1072 1104 1073 1105 error = rc_register_device(rdev); 1074 1106 if (error < 0)
+11 -11
drivers/media/rc/fintek-cir.c
··· 197 197 /* 198 198 * Newer reviews of this chipset uses port 8 instead of 5 199 199 */ 200 - if ((chip != 0x0408) || (chip != 0x0804)) 200 + if ((chip != 0x0408) && (chip != 0x0804)) 201 201 fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2; 202 202 else 203 203 fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV1; ··· 514 514 515 515 spin_lock_init(&fintek->fintek_lock); 516 516 517 - ret = -EBUSY; 518 - /* now claim resources */ 519 - if (!request_region(fintek->cir_addr, 520 - fintek->cir_port_len, FINTEK_DRIVER_NAME)) 521 - goto failure; 522 - 523 - if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED, 524 - FINTEK_DRIVER_NAME, (void *)fintek)) 525 - goto failure; 526 - 527 517 pnp_set_drvdata(pdev, fintek); 528 518 fintek->pdev = pdev; 529 519 ··· 547 557 rdev->timeout = US_TO_NS(1000); 548 558 /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ 549 559 rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); 560 + 561 + ret = -EBUSY; 562 + /* now claim resources */ 563 + if (!request_region(fintek->cir_addr, 564 + fintek->cir_port_len, FINTEK_DRIVER_NAME)) 565 + goto failure; 566 + 567 + if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED, 568 + FINTEK_DRIVER_NAME, (void *)fintek)) 569 + goto failure; 550 570 551 571 ret = rc_register_device(rdev); 552 572 if (ret)
+10 -10
drivers/media/rc/ite-cir.c
··· 1515 1515 /* initialize raw event */ 1516 1516 init_ir_raw_event(&itdev->rawir); 1517 1517 1518 - ret = -EBUSY; 1519 - /* now claim resources */ 1520 - if (!request_region(itdev->cir_addr, 1521 - dev_desc->io_region_size, ITE_DRIVER_NAME)) 1522 - goto failure; 1523 - 1524 - if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, 1525 - ITE_DRIVER_NAME, (void *)itdev)) 1526 - goto failure; 1527 - 1528 1518 /* set driver data into the pnp device */ 1529 1519 pnp_set_drvdata(pdev, itdev); 1530 1520 itdev->pdev = pdev; ··· 1589 1599 rdev->input_id.version = 0; 1590 1600 rdev->driver_name = ITE_DRIVER_NAME; 1591 1601 rdev->map_name = RC_MAP_RC6_MCE; 1602 + 1603 + ret = -EBUSY; 1604 + /* now claim resources */ 1605 + if (!request_region(itdev->cir_addr, 1606 + dev_desc->io_region_size, ITE_DRIVER_NAME)) 1607 + goto failure; 1608 + 1609 + if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, 1610 + ITE_DRIVER_NAME, (void *)itdev)) 1611 + goto failure; 1592 1612 1593 1613 ret = rc_register_device(rdev); 1594 1614 if (ret)
+18 -18
drivers/media/rc/nuvoton-cir.c
··· 1021 1021 spin_lock_init(&nvt->nvt_lock); 1022 1022 spin_lock_init(&nvt->tx.lock); 1023 1023 1024 - ret = -EBUSY; 1025 - /* now claim resources */ 1026 - if (!request_region(nvt->cir_addr, 1027 - CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) 1028 - goto failure; 1029 - 1030 - if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED, 1031 - NVT_DRIVER_NAME, (void *)nvt)) 1032 - goto failure; 1033 - 1034 - if (!request_region(nvt->cir_wake_addr, 1035 - CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) 1036 - goto failure; 1037 - 1038 - if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED, 1039 - NVT_DRIVER_NAME, (void *)nvt)) 1040 - goto failure; 1041 - 1042 1024 pnp_set_drvdata(pdev, nvt); 1043 1025 nvt->pdev = pdev; 1044 1026 ··· 1066 1084 /* tx bits */ 1067 1085 rdev->tx_resolution = XYZ; 1068 1086 #endif 1087 + 1088 + ret = -EBUSY; 1089 + /* now claim resources */ 1090 + if (!request_region(nvt->cir_addr, 1091 + CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) 1092 + goto failure; 1093 + 1094 + if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED, 1095 + NVT_DRIVER_NAME, (void *)nvt)) 1096 + goto failure; 1097 + 1098 + if (!request_region(nvt->cir_wake_addr, 1099 + CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) 1100 + goto failure; 1101 + 1102 + if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED, 1103 + NVT_DRIVER_NAME, (void *)nvt)) 1104 + goto failure; 1069 1105 1070 1106 ret = rc_register_device(rdev); 1071 1107 if (ret)
+39 -39
drivers/media/rc/winbond-cir.c
··· 991 991 "(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n", 992 992 data->wbase, data->ebase, data->sbase, data->irq); 993 993 994 - if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { 995 - dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", 996 - data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1); 997 - err = -EBUSY; 998 - goto exit_free_data; 999 - } 1000 - 1001 - if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) { 1002 - dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", 1003 - data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1); 1004 - err = -EBUSY; 1005 - goto exit_release_wbase; 1006 - } 1007 - 1008 - if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) { 1009 - dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", 1010 - data->sbase, data->sbase + SP_IOMEM_LEN - 1); 1011 - err = -EBUSY; 1012 - goto exit_release_ebase; 1013 - } 1014 - 1015 - err = request_irq(data->irq, wbcir_irq_handler, 1016 - IRQF_DISABLED, DRVNAME, device); 1017 - if (err) { 1018 - dev_err(dev, "Failed to claim IRQ %u\n", data->irq); 1019 - err = -EBUSY; 1020 - goto exit_release_sbase; 1021 - } 1022 - 1023 994 led_trigger_register_simple("cir-tx", &data->txtrigger); 1024 995 if (!data->txtrigger) { 1025 996 err = -ENOMEM; 1026 - goto exit_free_irq; 997 + goto exit_free_data; 1027 998 } 1028 999 1029 1000 led_trigger_register_simple("cir-rx", &data->rxtrigger); ··· 1033 1062 data->dev->priv = data; 1034 1063 data->dev->dev.parent = &device->dev; 1035 1064 1065 + if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { 1066 + dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", 1067 + data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1); 1068 + err = -EBUSY; 1069 + goto exit_free_rc; 1070 + } 1071 + 1072 + if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) { 1073 + dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", 1074 + data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1); 1075 + err = -EBUSY; 1076 + goto exit_release_wbase; 1077 + } 1078 + 1079 + if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) { 1080 + dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", 1081 + data->sbase, data->sbase + SP_IOMEM_LEN - 1); 1082 + err = -EBUSY; 1083 + goto exit_release_ebase; 1084 + } 1085 + 1086 + err = request_irq(data->irq, wbcir_irq_handler, 1087 + IRQF_DISABLED, DRVNAME, device); 1088 + if (err) { 1089 + dev_err(dev, "Failed to claim IRQ %u\n", data->irq); 1090 + err = -EBUSY; 1091 + goto exit_release_sbase; 1092 + } 1093 + 1036 1094 err = rc_register_device(data->dev); 1037 1095 if (err) 1038 - goto exit_free_rc; 1096 + goto exit_free_irq; 1039 1097 1040 1098 device_init_wakeup(&device->dev, 1); 1041 1099 ··· 1072 1072 1073 1073 return 0; 1074 1074 1075 - exit_free_rc: 1076 - rc_free_device(data->dev); 1077 - exit_unregister_led: 1078 - led_classdev_unregister(&data->led); 1079 - exit_unregister_rxtrigger: 1080 - led_trigger_unregister_simple(data->rxtrigger); 1081 - exit_unregister_txtrigger: 1082 - led_trigger_unregister_simple(data->txtrigger); 1083 1075 exit_free_irq: 1084 1076 free_irq(data->irq, device); 1085 1077 exit_release_sbase: ··· 1080 1088 release_region(data->ebase, EHFUNC_IOMEM_LEN); 1081 1089 exit_release_wbase: 1082 1090 release_region(data->wbase, WAKEUP_IOMEM_LEN); 1091 + exit_free_rc: 1092 + rc_free_device(data->dev); 1093 + exit_unregister_led: 1094 + led_classdev_unregister(&data->led); 1095 + exit_unregister_rxtrigger: 1096 + led_trigger_unregister_simple(data->rxtrigger); 1097 + exit_unregister_txtrigger: 1098 + led_trigger_unregister_simple(data->txtrigger); 1083 1099 exit_free_data: 1084 1100 kfree(data); 1085 1101 pnp_set_drvdata(device, NULL);
+4 -4
drivers/media/video/gspca/sonixj.c
··· 2923 2923 * not the JPEG end of frame ('ff d9'). 2924 2924 */ 2925 2925 2926 + /* count the packets and their size */ 2927 + sd->npkt++; 2928 + sd->pktsz += len; 2929 + 2926 2930 /*fixme: assumption about the following code: 2927 2931 * - there can be only one marker in a packet 2928 2932 */ ··· 2948 2944 return; 2949 2945 data += i; 2950 2946 } 2951 - 2952 - /* count the packets and their size */ 2953 - sd->npkt++; 2954 - sd->pktsz += len; 2955 2947 2956 2948 /* search backwards if there is a marker in the packet */ 2957 2949 for (i = len - 1; --i >= 0; ) {
-1
drivers/media/video/marvell-ccic/mmp-driver.c
··· 181 181 INIT_LIST_HEAD(&cam->devlist); 182 182 183 183 mcam = &cam->mcam; 184 - mcam->platform = MHP_Armada610; 185 184 mcam->plat_power_up = mmpcam_power_up; 186 185 mcam->plat_power_down = mmpcam_power_down; 187 186 mcam->dev = &pdev->dev;
+21 -12
drivers/media/video/s5p-fimc/fimc-capture.c
··· 246 246 247 247 } 248 248 249 - static unsigned int get_plane_size(struct fimc_frame *fr, unsigned int plane) 250 - { 251 - if (!fr || plane >= fr->fmt->memplanes) 252 - return 0; 253 - return fr->f_width * fr->f_height * fr->fmt->depth[plane] / 8; 254 - } 255 - 256 - static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, 249 + static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, 257 250 unsigned int *num_buffers, unsigned int *num_planes, 258 251 unsigned int sizes[], void *allocators[]) 259 252 { 253 + const struct v4l2_pix_format_mplane *pixm = NULL; 260 254 struct fimc_ctx *ctx = vq->drv_priv; 261 - struct fimc_fmt *fmt = ctx->d_frame.fmt; 255 + struct fimc_frame *frame = &ctx->d_frame; 256 + struct fimc_fmt *fmt = frame->fmt; 257 + unsigned long wh; 262 258 int i; 263 259 264 - if (!fmt) 260 + if (pfmt) { 261 + pixm = &pfmt->fmt.pix_mp; 262 + fmt = fimc_find_format(&pixm->pixelformat, NULL, 263 + FMT_FLAGS_CAM | FMT_FLAGS_M2M, -1); 264 + wh = pixm->width * pixm->height; 265 + } else { 266 + wh = frame->f_width * frame->f_height; 267 + } 268 + 269 + if (fmt == NULL) 265 270 return -EINVAL; 266 271 267 272 *num_planes = fmt->memplanes; 268 273 269 274 for (i = 0; i < fmt->memplanes; i++) { 270 - sizes[i] = get_plane_size(&ctx->d_frame, i); 275 + unsigned int size = (wh * fmt->depth[i]) / 8; 276 + if (pixm) 277 + sizes[i] = max(size, pixm->plane_fmt[i].sizeimage); 278 + else 279 + sizes[i] = size; 271 280 allocators[i] = ctx->fimc_dev->alloc_ctx; 272 281 } 273 282 ··· 1392 1383 fimc_capture_try_crop(ctx, r, crop->pad); 1393 1384 1394 1385 if (crop->which == V4L2_SUBDEV_FORMAT_TRY) { 1395 - mutex_lock(&fimc->lock); 1386 + mutex_unlock(&fimc->lock); 1396 1387 *v4l2_subdev_get_try_crop(fh, crop->pad) = *r; 1397 1388 return 0; 1398 1389 }
+2 -2
drivers/media/video/s5p-fimc/fimc-core.c
··· 1048 1048 * @mask: the color flags to match 1049 1049 * @index: offset in the fimc_formats array, ignored if negative 1050 1050 */ 1051 - struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code, 1051 + struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code, 1052 1052 unsigned int mask, int index) 1053 1053 { 1054 1054 struct fimc_fmt *fmt, *def_fmt = NULL; 1055 1055 unsigned int i; 1056 1056 int id = 0; 1057 1057 1058 - if (index >= ARRAY_SIZE(fimc_formats)) 1058 + if (index >= (int)ARRAY_SIZE(fimc_formats)) 1059 1059 return NULL; 1060 1060 1061 1061 for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) {
+1 -1
drivers/media/video/s5p-fimc/fimc-core.h
··· 718 718 int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f); 719 719 void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, 720 720 struct v4l2_pix_format_mplane *pix); 721 - struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code, 721 + struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code, 722 722 unsigned int mask, int index); 723 723 724 724 int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh,
+6 -2
drivers/media/video/soc_camera.c
··· 530 530 if (icl->reset) 531 531 icl->reset(icd->pdev); 532 532 533 + /* Don't mess with the host during probe */ 534 + mutex_lock(&ici->host_lock); 533 535 ret = ici->ops->add(icd); 536 + mutex_unlock(&ici->host_lock); 534 537 if (ret < 0) { 535 538 dev_err(icd->pdev, "Couldn't activate the camera: %d\n", ret); 536 539 goto eiciadd; ··· 959 956 { 960 957 struct soc_camera_device *icd; 961 958 962 - mutex_lock(&list_lock); 959 + mutex_lock(&ici->host_lock); 963 960 964 961 list_for_each_entry(icd, &devices, list) { 965 962 if (icd->iface == ici->nr) { ··· 970 967 } 971 968 } 972 969 973 - mutex_unlock(&list_lock); 970 + mutex_unlock(&ici->host_lock); 974 971 } 975 972 976 973 #ifdef CONFIG_I2C_BOARDINFO ··· 1316 1313 list_add_tail(&ici->list, &hosts); 1317 1314 mutex_unlock(&list_lock); 1318 1315 1316 + mutex_init(&ici->host_lock); 1319 1317 scan_add_host(ici); 1320 1318 1321 1319 return 0;
+2 -1
drivers/media/video/videobuf2-dma-contig.c
··· 15 15 #include <linux/dma-mapping.h> 16 16 17 17 #include <media/videobuf2-core.h> 18 + #include <media/videobuf2-dma-contig.h> 18 19 #include <media/videobuf2-memops.h> 19 20 20 21 struct vb2_dc_conf { ··· 86 85 { 87 86 struct vb2_dc_buf *buf = buf_priv; 88 87 if (!buf) 89 - return 0; 88 + return NULL; 90 89 91 90 return buf->vaddr; 92 91 }
+1
drivers/media/video/videobuf2-memops.c
··· 55 55 56 56 return vma_copy; 57 57 } 58 + EXPORT_SYMBOL_GPL(vb2_get_vma); 58 59 59 60 /** 60 61 * vb2_put_userptr() - release a userspace virtual memory area
+1 -1
drivers/mtd/mtdchar.c
··· 376 376 * Make a fake call to mtd_read_fact_prot_reg() to check if OTP 377 377 * operations are supported. 378 378 */ 379 - if (mtd_read_fact_prot_reg(mtd, -1, -1, &retlen, NULL) == -EOPNOTSUPP) 379 + if (mtd_read_fact_prot_reg(mtd, -1, 0, &retlen, NULL) == -EOPNOTSUPP) 380 380 return -EOPNOTSUPP; 381 381 382 382 switch (mode) {
+6 -11
drivers/mtd/nand/ams-delta.c
··· 212 212 /* Link the private data with the MTD structure */ 213 213 ams_delta_mtd->priv = this; 214 214 215 - if (!request_mem_region(res->start, resource_size(res), 216 - dev_name(&pdev->dev))) { 217 - dev_err(&pdev->dev, "request_mem_region failed\n"); 218 - err = -EBUSY; 219 - goto out_free; 220 - } 215 + /* 216 + * Don't try to request the memory region from here, 217 + * it should have been already requested from the 218 + * gpio-omap driver and requesting it again would fail. 219 + */ 221 220 222 221 io_base = ioremap(res->start, resource_size(res)); 223 222 if (io_base == NULL) { 224 223 dev_err(&pdev->dev, "ioremap failed\n"); 225 224 err = -EIO; 226 - goto out_release_io; 225 + goto out_free; 227 226 } 228 227 229 228 this->priv = io_base; ··· 270 271 platform_set_drvdata(pdev, NULL); 271 272 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); 272 273 iounmap(io_base); 273 - out_release_io: 274 - release_mem_region(res->start, resource_size(res)); 275 274 out_free: 276 275 kfree(ams_delta_mtd); 277 276 out: ··· 282 285 static int __devexit ams_delta_cleanup(struct platform_device *pdev) 283 286 { 284 287 void __iomem *io_base = platform_get_drvdata(pdev); 285 - struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 286 288 287 289 /* Release resources, unregister device */ 288 290 nand_release(ams_delta_mtd); ··· 289 293 gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); 290 294 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); 291 295 iounmap(io_base); 292 - release_mem_region(res->start, resource_size(res)); 293 296 294 297 /* Free the MTD device structure */ 295 298 kfree(ams_delta_mtd);
+12 -6
drivers/net/bonding/bond_3ad.c
··· 2173 2173 * received frames (loopback). Since only the payload is given to this 2174 2174 * function, it check for loopback. 2175 2175 */ 2176 - static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) 2176 + static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) 2177 2177 { 2178 2178 struct port *port; 2179 + int ret = RX_HANDLER_ANOTHER; 2179 2180 2180 2181 if (length >= sizeof(struct lacpdu)) { 2181 2182 ··· 2185 2184 if (!port->slave) { 2186 2185 pr_warning("%s: Warning: port of slave %s is uninitialized\n", 2187 2186 slave->dev->name, slave->dev->master->name); 2188 - return; 2187 + return ret; 2189 2188 } 2190 2189 2191 2190 switch (lacpdu->subtype) { 2192 2191 case AD_TYPE_LACPDU: 2192 + ret = RX_HANDLER_CONSUMED; 2193 2193 pr_debug("Received LACPDU on port %d\n", 2194 2194 port->actor_port_number); 2195 2195 /* Protect against concurrent state machines */ ··· 2200 2198 break; 2201 2199 2202 2200 case AD_TYPE_MARKER: 2201 + ret = RX_HANDLER_CONSUMED; 2203 2202 // No need to convert fields to Little Endian since we don't use the marker's fields. 2204 2203 2205 2204 switch (((struct bond_marker *)lacpdu)->tlv_type) { ··· 2222 2219 } 2223 2220 } 2224 2221 } 2222 + return ret; 2225 2223 } 2226 2224 2227 2225 /** ··· 2460 2456 return NETDEV_TX_OK; 2461 2457 } 2462 2458 2463 - void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, 2459 + int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, 2464 2460 struct slave *slave) 2465 2461 { 2462 + int ret = RX_HANDLER_ANOTHER; 2466 2463 if (skb->protocol != PKT_TYPE_LACPDU) 2467 - return; 2464 + return ret; 2468 2465 2469 2466 if (!pskb_may_pull(skb, sizeof(struct lacpdu))) 2470 - return; 2467 + return ret; 2471 2468 2472 2469 read_lock(&bond->lock); 2473 - bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); 2470 + ret = bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); 2474 2471 read_unlock(&bond->lock); 2472 + return ret; 2475 2473 } 2476 2474 2477 2475 /*
+1 -1
drivers/net/bonding/bond_3ad.h
··· 274 274 void bond_3ad_handle_link_change(struct slave *slave, char link); 275 275 int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); 276 276 int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); 277 - void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, 277 + int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, 278 278 struct slave *slave); 279 279 int bond_3ad_set_carrier(struct bonding *bond); 280 280 void bond_3ad_update_lacp_rate(struct bonding *bond);
+7 -5
drivers/net/bonding/bond_alb.c
··· 342 342 _unlock_rx_hashtbl_bh(bond); 343 343 } 344 344 345 - static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond, 345 + static int rlb_arp_recv(struct sk_buff *skb, struct bonding *bond, 346 346 struct slave *slave) 347 347 { 348 348 struct arp_pkt *arp; 349 349 350 350 if (skb->protocol != cpu_to_be16(ETH_P_ARP)) 351 - return; 351 + goto out; 352 352 353 353 arp = (struct arp_pkt *) skb->data; 354 354 if (!arp) { 355 355 pr_debug("Packet has no ARP data\n"); 356 - return; 356 + goto out; 357 357 } 358 358 359 359 if (!pskb_may_pull(skb, arp_hdr_len(bond->dev))) 360 - return; 360 + goto out; 361 361 362 362 if (skb->len < sizeof(struct arp_pkt)) { 363 363 pr_debug("Packet is too small to be an ARP\n"); 364 - return; 364 + goto out; 365 365 } 366 366 367 367 if (arp->op_code == htons(ARPOP_REPLY)) { ··· 369 369 rlb_update_entry_from_arp(bond, arp); 370 370 pr_debug("Server received an ARP Reply from client\n"); 371 371 } 372 + out: 373 + return RX_HANDLER_ANOTHER; 372 374 } 373 375 374 376 /* Caller must hold bond lock for read */
+11 -5
drivers/net/bonding/bond_main.c
··· 1444 1444 struct sk_buff *skb = *pskb; 1445 1445 struct slave *slave; 1446 1446 struct bonding *bond; 1447 - void (*recv_probe)(struct sk_buff *, struct bonding *, 1447 + int (*recv_probe)(struct sk_buff *, struct bonding *, 1448 1448 struct slave *); 1449 + int ret = RX_HANDLER_ANOTHER; 1449 1450 1450 1451 skb = skb_share_check(skb, GFP_ATOMIC); 1451 1452 if (unlikely(!skb)) ··· 1465 1464 struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); 1466 1465 1467 1466 if (likely(nskb)) { 1468 - recv_probe(nskb, bond, slave); 1467 + ret = recv_probe(nskb, bond, slave); 1469 1468 dev_kfree_skb(nskb); 1469 + if (ret == RX_HANDLER_CONSUMED) { 1470 + consume_skb(skb); 1471 + return ret; 1472 + } 1470 1473 } 1471 1474 } 1472 1475 ··· 1492 1487 memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN); 1493 1488 } 1494 1489 1495 - return RX_HANDLER_ANOTHER; 1490 + return ret; 1496 1491 } 1497 1492 1498 1493 /* enslave device <slave> to bond device <master> */ ··· 2737 2732 } 2738 2733 } 2739 2734 2740 - static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, 2735 + static int bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, 2741 2736 struct slave *slave) 2742 2737 { 2743 2738 struct arphdr *arp; ··· 2745 2740 __be32 sip, tip; 2746 2741 2747 2742 if (skb->protocol != __cpu_to_be16(ETH_P_ARP)) 2748 - return; 2743 + return RX_HANDLER_ANOTHER; 2749 2744 2750 2745 read_lock(&bond->lock); 2751 2746 ··· 2790 2785 2791 2786 out_unlock: 2792 2787 read_unlock(&bond->lock); 2788 + return RX_HANDLER_ANOTHER; 2793 2789 } 2794 2790 2795 2791 /*
+1 -1
drivers/net/bonding/bonding.h
··· 218 218 struct slave *primary_slave; 219 219 bool force_primary; 220 220 s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ 221 - void (*recv_probe)(struct sk_buff *, struct bonding *, 221 + int (*recv_probe)(struct sk_buff *, struct bonding *, 222 222 struct slave *); 223 223 rwlock_t lock; 224 224 rwlock_t curr_slave_lock;
+2
drivers/net/ethernet/ibm/ehea/ehea_main.c
··· 3335 3335 goto out_shutdown_ports; 3336 3336 } 3337 3337 3338 + /* Handle any events that might be pending. */ 3339 + tasklet_hi_schedule(&adapter->neq_tasklet); 3338 3340 3339 3341 ret = 0; 3340 3342 goto out;
+6 -14
drivers/net/ethernet/intel/igb/igb_main.c
··· 1103 1103 adapter->flags |= IGB_FLAG_HAS_MSI; 1104 1104 out: 1105 1105 /* Notify the stack of the (possibly) reduced queue counts. */ 1106 + rtnl_lock(); 1106 1107 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); 1107 - return netif_set_real_num_rx_queues(adapter->netdev, 1108 - adapter->num_rx_queues); 1108 + err = netif_set_real_num_rx_queues(adapter->netdev, 1109 + adapter->num_rx_queues); 1110 + rtnl_unlock(); 1111 + return err; 1109 1112 } 1110 1113 1111 1114 /** ··· 6709 6706 pci_enable_wake(pdev, PCI_D3hot, 0); 6710 6707 pci_enable_wake(pdev, PCI_D3cold, 0); 6711 6708 6712 - if (!rtnl_is_locked()) { 6713 - /* 6714 - * shut up ASSERT_RTNL() warning in 6715 - * netif_set_real_num_tx/rx_queues. 6716 - */ 6717 - rtnl_lock(); 6718 - err = igb_init_interrupt_scheme(adapter); 6719 - rtnl_unlock(); 6720 - } else { 6721 - err = igb_init_interrupt_scheme(adapter); 6722 - } 6723 - if (err) { 6709 + if (igb_init_interrupt_scheme(adapter)) { 6724 6710 dev_err(&pdev->dev, "Unable to allocate memory for queues\n"); 6725 6711 return -ENOMEM; 6726 6712 }
+4 -3
drivers/net/ethernet/micrel/ks8851.c
··· 618 618 netif_dbg(ks, intr, ks->netdev, 619 619 "%s: status 0x%04x\n", __func__, status); 620 620 621 - if (status & IRQ_LCI) { 622 - /* should do something about checking link status */ 621 + if (status & IRQ_LCI) 623 622 handled |= IRQ_LCI; 624 - } 625 623 626 624 if (status & IRQ_LDI) { 627 625 u16 pmecr = ks8851_rdreg16(ks, KS_PMECR); ··· 681 683 } 682 684 683 685 mutex_unlock(&ks->lock); 686 + 687 + if (status & IRQ_LCI) 688 + mii_check_link(&ks->mii); 684 689 685 690 if (status & IRQ_TXI) 686 691 netif_wake_queue(ks->netdev);
-2
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
··· 584 584 /** 585 585 * struct pch_gbe_adapter - board specific private data structure 586 586 * @stats_lock: Spinlock structure for status 587 - * @tx_queue_lock: Spinlock structure for transmit 588 587 * @ethtool_lock: Spinlock structure for ethtool 589 588 * @irq_sem: Semaphore for interrupt 590 589 * @netdev: Pointer of network device structure ··· 608 609 609 610 struct pch_gbe_adapter { 610 611 spinlock_t stats_lock; 611 - spinlock_t tx_queue_lock; 612 612 spinlock_t ethtool_lock; 613 613 atomic_t irq_sem; 614 614 struct net_device *netdev;
+11 -14
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
··· 645 645 */ 646 646 static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter) 647 647 { 648 - int size; 649 - 650 - size = (int)sizeof(struct pch_gbe_tx_ring); 651 - adapter->tx_ring = kzalloc(size, GFP_KERNEL); 648 + adapter->tx_ring = kzalloc(sizeof(*adapter->tx_ring), GFP_KERNEL); 652 649 if (!adapter->tx_ring) 653 650 return -ENOMEM; 654 - size = (int)sizeof(struct pch_gbe_rx_ring); 655 - adapter->rx_ring = kzalloc(size, GFP_KERNEL); 651 + 652 + adapter->rx_ring = kzalloc(sizeof(*adapter->rx_ring), GFP_KERNEL); 656 653 if (!adapter->rx_ring) { 657 654 kfree(adapter->tx_ring); 658 655 return -ENOMEM; ··· 1166 1169 struct sk_buff *tmp_skb; 1167 1170 unsigned int frame_ctrl; 1168 1171 unsigned int ring_num; 1169 - unsigned long flags; 1170 1172 1171 1173 /*-- Set frame control --*/ 1172 1174 frame_ctrl = 0; ··· 1212 1216 } 1213 1217 } 1214 1218 } 1215 - spin_lock_irqsave(&tx_ring->tx_lock, flags); 1219 + 1216 1220 ring_num = tx_ring->next_to_use; 1217 1221 if (unlikely((ring_num + 1) == tx_ring->count)) 1218 1222 tx_ring->next_to_use = 0; 1219 1223 else 1220 1224 tx_ring->next_to_use = ring_num + 1; 1221 1225 1222 - spin_unlock_irqrestore(&tx_ring->tx_lock, flags); 1226 + 1223 1227 buffer_info = &tx_ring->buffer_info[ring_num]; 1224 1228 tmp_skb = buffer_info->skb; 1225 1229 ··· 1521 1525 &rx_ring->rx_buff_pool_logic, 1522 1526 GFP_KERNEL); 1523 1527 if (!rx_ring->rx_buff_pool) { 1524 - pr_err("Unable to allocate memory for the receive poll buffer\n"); 1528 + pr_err("Unable to allocate memory for the receive pool buffer\n"); 1525 1529 return -ENOMEM; 1526 1530 } 1527 1531 memset(rx_ring->rx_buff_pool, 0, size); ··· 1640 1644 pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n", 1641 1645 cleaned_count); 1642 1646 /* Recover from running out of Tx resources in xmit_frame */ 1647 + spin_lock(&tx_ring->tx_lock); 1643 1648 if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) { 1644 1649 netif_wake_queue(adapter->netdev); 1645 1650 adapter->stats.tx_restart_count++; 1646 1651 pr_debug("Tx wake queue\n"); 1647 1652 } 1648 - spin_lock(&adapter->tx_queue_lock); 1653 + 1649 1654 tx_ring->next_to_clean = i; 1650 - spin_unlock(&adapter->tx_queue_lock); 1655 + 1651 1656 pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean); 1657 + spin_unlock(&tx_ring->tx_lock); 1652 1658 return cleaned; 1653 1659 } 1654 1660 ··· 2041 2043 return -ENOMEM; 2042 2044 } 2043 2045 spin_lock_init(&adapter->hw.miim_lock); 2044 - spin_lock_init(&adapter->tx_queue_lock); 2045 2046 spin_lock_init(&adapter->stats_lock); 2046 2047 spin_lock_init(&adapter->ethtool_lock); 2047 2048 atomic_set(&adapter->irq_sem, 0); ··· 2145 2148 tx_ring->next_to_use, tx_ring->next_to_clean); 2146 2149 return NETDEV_TX_BUSY; 2147 2150 } 2148 - spin_unlock_irqrestore(&tx_ring->tx_lock, flags); 2149 2151 2150 2152 /* CRC,ITAG no support */ 2151 2153 pch_gbe_tx_queue(adapter, tx_ring, skb); 2154 + spin_unlock_irqrestore(&tx_ring->tx_lock, flags); 2152 2155 return NETDEV_TX_OK; 2153 2156 } 2154 2157
+10 -6
drivers/net/ethernet/realtek/r8169.c
··· 63 63 #define R8169_MSG_DEFAULT \ 64 64 (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN) 65 65 66 - #define TX_BUFFS_AVAIL(tp) \ 67 - (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1) 66 + #define TX_SLOTS_AVAIL(tp) \ 67 + (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx) 68 + 69 + /* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */ 70 + #define TX_FRAGS_READY_FOR(tp,nr_frags) \ 71 + (TX_SLOTS_AVAIL(tp) >= (nr_frags + 1)) 68 72 69 73 /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). 70 74 The RTL chips use a 64 element hash table based on the Ethernet CRC. */ ··· 5498 5494 u32 opts[2]; 5499 5495 int frags; 5500 5496 5501 - if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) { 5497 + if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) { 5502 5498 netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n"); 5503 5499 goto err_stop_0; 5504 5500 } ··· 5552 5548 5553 5549 mmiowb(); 5554 5550 5555 - if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) { 5551 + if (!TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) { 5556 5552 /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must 5557 5553 * not miss a ring update when it notices a stopped queue. 5558 5554 */ ··· 5566 5562 * can't. 5567 5563 */ 5568 5564 smp_mb(); 5569 - if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS) 5565 + if (TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) 5570 5566 netif_wake_queue(dev); 5571 5567 } 5572 5568 ··· 5689 5685 */ 5690 5686 smp_mb(); 5691 5687 if (netif_queue_stopped(dev) && 5692 - (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { 5688 + TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) { 5693 5689 netif_wake_queue(dev); 5694 5690 } 5695 5691 /*
+1 -1
drivers/net/ethernet/sfc/efx.c
··· 1354 1354 } 1355 1355 1356 1356 /* RSS might be usable on VFs even if it is disabled on the PF */ 1357 - efx->rss_spread = (efx->n_rx_channels > 1 ? 1357 + efx->rss_spread = ((efx->n_rx_channels > 1 || !efx_sriov_wanted(efx)) ? 1358 1358 efx->n_rx_channels : efx_vf_size(efx)); 1359 1359 1360 1360 return 0;
+1 -1
drivers/net/macvlan.c
··· 258 258 259 259 xmit_world: 260 260 skb->ip_summed = ip_summed; 261 - skb_set_dev(skb, vlan->lowerdev); 261 + skb->dev = vlan->lowerdev; 262 262 return dev_queue_xmit(skb); 263 263 } 264 264
+37 -4
drivers/net/macvtap.c
··· 1 1 #include <linux/etherdevice.h> 2 2 #include <linux/if_macvlan.h> 3 + #include <linux/if_vlan.h> 3 4 #include <linux/interrupt.h> 4 5 #include <linux/nsproxy.h> 5 6 #include <linux/compat.h> ··· 783 782 struct macvlan_dev *vlan; 784 783 int ret; 785 784 int vnet_hdr_len = 0; 785 + int vlan_offset = 0; 786 + int copied; 786 787 787 788 if (q->flags & IFF_VNET_HDR) { 788 789 struct virtio_net_hdr vnet_hdr; ··· 799 796 if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr))) 800 797 return -EFAULT; 801 798 } 799 + copied = vnet_hdr_len; 802 800 803 - len = min_t(int, skb->len, len); 801 + if (!vlan_tx_tag_present(skb)) 802 + len = min_t(int, skb->len, len); 803 + else { 804 + int copy; 805 + struct { 806 + __be16 h_vlan_proto; 807 + __be16 h_vlan_TCI; 808 + } veth; 809 + veth.h_vlan_proto = htons(ETH_P_8021Q); 810 + veth.h_vlan_TCI = htons(vlan_tx_tag_get(skb)); 804 811 805 - ret = skb_copy_datagram_const_iovec(skb, 0, iv, vnet_hdr_len, len); 812 + vlan_offset = offsetof(struct vlan_ethhdr, h_vlan_proto); 813 + len = min_t(int, skb->len + VLAN_HLEN, len); 806 814 815 + copy = min_t(int, vlan_offset, len); 816 + ret = skb_copy_datagram_const_iovec(skb, 0, iv, copied, copy); 817 + len -= copy; 818 + copied += copy; 819 + if (ret || !len) 820 + goto done; 821 + 822 + copy = min_t(int, sizeof(veth), len); 823 + ret = memcpy_toiovecend(iv, (void *)&veth, copied, copy); 824 + len -= copy; 825 + copied += copy; 826 + if (ret || !len) 827 + goto done; 828 + } 829 + 830 + ret = skb_copy_datagram_const_iovec(skb, vlan_offset, iv, copied, len); 831 + copied += len; 832 + 833 + done: 807 834 rcu_read_lock_bh(); 808 835 vlan = rcu_dereference_bh(q->vlan); 809 836 if (vlan) 810 - macvlan_count_rx(vlan, len, ret == 0, 0); 837 + macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0); 811 838 rcu_read_unlock_bh(); 812 839 813 - return ret ? ret : (len + vnet_hdr_len); 840 + return ret ? ret : copied; 814 841 } 815 842 816 843 static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb,
+16
drivers/net/usb/cdc_ether.c
··· 485 485 /*-------------------------------------------------------------------------*/ 486 486 487 487 #define HUAWEI_VENDOR_ID 0x12D1 488 + #define NOVATEL_VENDOR_ID 0x1410 488 489 489 490 static const struct usb_device_id products [] = { 490 491 /* ··· 603 602 * because of bugs/quirks in a given product (like Zaurus, above). 604 603 */ 605 604 { 605 + /* Novatel USB551L */ 606 + /* This match must come *before* the generic CDC-ETHER match so that 607 + * we get FLAG_WWAN set on the device, since it's descriptors are 608 + * generic CDC-ETHER. 609 + */ 610 + .match_flags = USB_DEVICE_ID_MATCH_VENDOR 611 + | USB_DEVICE_ID_MATCH_PRODUCT 612 + | USB_DEVICE_ID_MATCH_INT_INFO, 613 + .idVendor = NOVATEL_VENDOR_ID, 614 + .idProduct = 0xB001, 615 + .bInterfaceClass = USB_CLASS_COMM, 616 + .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, 617 + .bInterfaceProtocol = USB_CDC_PROTO_NONE, 618 + .driver_info = (unsigned long)&wwan_info, 619 + }, { 606 620 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET, 607 621 USB_CDC_PROTO_NONE), 608 622 .driver_info = (unsigned long) &cdc_info,
+38 -16
drivers/net/usb/usbnet.c
··· 282 282 } 283 283 EXPORT_SYMBOL_GPL(usbnet_change_mtu); 284 284 285 + /* The caller must hold list->lock */ 286 + static void __usbnet_queue_skb(struct sk_buff_head *list, 287 + struct sk_buff *newsk, enum skb_state state) 288 + { 289 + struct skb_data *entry = (struct skb_data *) newsk->cb; 290 + 291 + __skb_queue_tail(list, newsk); 292 + entry->state = state; 293 + } 294 + 285 295 /*-------------------------------------------------------------------------*/ 286 296 287 297 /* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from 288 298 * completion callbacks. 2.5 should have fixed those bugs... 289 299 */ 290 300 291 - static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_head *list) 301 + static enum skb_state defer_bh(struct usbnet *dev, struct sk_buff *skb, 302 + struct sk_buff_head *list, enum skb_state state) 292 303 { 293 304 unsigned long flags; 305 + enum skb_state old_state; 306 + struct skb_data *entry = (struct skb_data *) skb->cb; 294 307 295 308 spin_lock_irqsave(&list->lock, flags); 309 + old_state = entry->state; 310 + entry->state = state; 296 311 __skb_unlink(skb, list); 297 312 spin_unlock(&list->lock); 298 313 spin_lock(&dev->done.lock); ··· 315 300 if (dev->done.qlen == 1) 316 301 tasklet_schedule(&dev->bh); 317 302 spin_unlock_irqrestore(&dev->done.lock, flags); 303 + return old_state; 318 304 } 319 305 320 306 /* some work can't be done in tasklets, so we use keventd ··· 356 340 entry = (struct skb_data *) skb->cb; 357 341 entry->urb = urb; 358 342 entry->dev = dev; 359 - entry->state = rx_start; 360 343 entry->length = 0; 361 344 362 345 usb_fill_bulk_urb (urb, dev->udev, dev->in, ··· 387 372 tasklet_schedule (&dev->bh); 388 373 break; 389 374 case 0: 390 - __skb_queue_tail (&dev->rxq, skb); 375 + __usbnet_queue_skb(&dev->rxq, skb, rx_start); 391 376 } 392 377 } else { 393 378 netif_dbg(dev, ifdown, dev->net, "rx: stopped\n"); ··· 438 423 struct skb_data *entry = (struct skb_data *) skb->cb; 439 424 struct usbnet *dev = entry->dev; 440 425 int urb_status = urb->status; 426 + enum skb_state state; 441 427 442 428 skb_put (skb, urb->actual_length); 443 - entry->state = rx_done; 429 + state = rx_done; 444 430 entry->urb = NULL; 445 431 446 432 switch (urb_status) { 447 433 /* success */ 448 434 case 0: 449 435 if (skb->len < dev->net->hard_header_len) { 450 - entry->state = rx_cleanup; 436 + state = rx_cleanup; 451 437 dev->net->stats.rx_errors++; 452 438 dev->net->stats.rx_length_errors++; 453 439 netif_dbg(dev, rx_err, dev->net, ··· 487 471 "rx throttle %d\n", urb_status); 488 472 } 489 473 block: 490 - entry->state = rx_cleanup; 474 + state = rx_cleanup; 491 475 entry->urb = urb; 492 476 urb = NULL; 493 477 break; ··· 498 482 // FALLTHROUGH 499 483 500 484 default: 501 - entry->state = rx_cleanup; 485 + state = rx_cleanup; 502 486 dev->net->stats.rx_errors++; 503 487 netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status); 504 488 break; 505 489 } 506 490 507 - defer_bh(dev, skb, &dev->rxq); 491 + state = defer_bh(dev, skb, &dev->rxq, state); 508 492 509 493 if (urb) { 510 494 if (netif_running (dev->net) && 511 - !test_bit (EVENT_RX_HALT, &dev->flags)) { 495 + !test_bit (EVENT_RX_HALT, &dev->flags) && 496 + state != unlink_start) { 512 497 rx_submit (dev, urb, GFP_ATOMIC); 513 498 usb_mark_last_busy(dev->udev); 514 499 return; ··· 596 579 static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) 597 580 { 598 581 unsigned long flags; 599 - struct sk_buff *skb, *skbnext; 582 + struct sk_buff *skb; 600 583 int count = 0; 601 584 602 585 spin_lock_irqsave (&q->lock, flags); 603 - skb_queue_walk_safe(q, skb, skbnext) { 586 + while (!skb_queue_empty(q)) { 604 587 struct skb_data *entry; 605 588 struct urb *urb; 606 589 int retval; 607 590 608 - entry = (struct skb_data *) skb->cb; 591 + skb_queue_walk(q, skb) { 592 + entry = (struct skb_data *) skb->cb; 593 + if (entry->state != unlink_start) 594 + goto found; 595 + } 596 + break; 597 + found: 598 + entry->state = unlink_start; 609 599 urb = entry->urb; 610 600 611 601 /* ··· 1064 1040 } 1065 1041 1066 1042 usb_autopm_put_interface_async(dev->intf); 1067 - entry->state = tx_done; 1068 - defer_bh(dev, skb, &dev->txq); 1043 + (void) defer_bh(dev, skb, &dev->txq, tx_done); 1069 1044 } 1070 1045 1071 1046 /*-------------------------------------------------------------------------*/ ··· 1120 1097 entry = (struct skb_data *) skb->cb; 1121 1098 entry->urb = urb; 1122 1099 entry->dev = dev; 1123 - entry->state = tx_start; 1124 1100 entry->length = length; 1125 1101 1126 1102 usb_fill_bulk_urb (urb, dev->udev, dev->out, ··· 1178 1156 break; 1179 1157 case 0: 1180 1158 net->trans_start = jiffies; 1181 - __skb_queue_tail (&dev->txq, skb); 1159 + __usbnet_queue_skb(&dev->txq, skb, tx_start); 1182 1160 if (dev->txq.qlen >= TX_QLEN (dev)) 1183 1161 netif_stop_queue (net); 1184 1162 }
+8 -8
drivers/net/wireless/rtlwifi/pci.c
··· 1853 1853 /*like read eeprom and so on */ 1854 1854 rtlpriv->cfg->ops->read_eeprom_info(hw); 1855 1855 1856 - if (rtlpriv->cfg->ops->init_sw_vars(hw)) { 1857 - RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); 1858 - err = -ENODEV; 1859 - goto fail3; 1860 - } 1861 - 1862 - rtlpriv->cfg->ops->init_sw_leds(hw); 1863 - 1864 1856 /*aspm */ 1865 1857 rtl_pci_init_aspm(hw); 1866 1858 ··· 1870 1878 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n"); 1871 1879 goto fail3; 1872 1880 } 1881 + 1882 + if (rtlpriv->cfg->ops->init_sw_vars(hw)) { 1883 + RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); 1884 + err = -ENODEV; 1885 + goto fail3; 1886 + } 1887 + 1888 + rtlpriv->cfg->ops->init_sw_leds(hw); 1873 1889 1874 1890 err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); 1875 1891 if (err) {
+5 -5
drivers/net/wireless/rtlwifi/usb.c
··· 971 971 rtlpriv->cfg->ops->read_chip_version(hw); 972 972 /*like read eeprom and so on */ 973 973 rtlpriv->cfg->ops->read_eeprom_info(hw); 974 - if (rtlpriv->cfg->ops->init_sw_vars(hw)) { 975 - RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); 976 - goto error_out; 977 - } 978 - rtlpriv->cfg->ops->init_sw_leds(hw); 979 974 err = _rtl_usb_init(hw); 980 975 if (err) 981 976 goto error_out; ··· 982 987 "Can't allocate sw for mac80211\n"); 983 988 goto error_out; 984 989 } 990 + if (rtlpriv->cfg->ops->init_sw_vars(hw)) { 991 + RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); 992 + goto error_out; 993 + } 994 + rtlpriv->cfg->ops->init_sw_leds(hw); 985 995 986 996 return 0; 987 997 error_out:
+1
drivers/parisc/sba_iommu.c
··· 44 44 #include <asm/ropes.h> 45 45 #include <asm/mckinley.h> /* for proc_mckinley_root */ 46 46 #include <asm/runway.h> /* for proc_runway_root */ 47 + #include <asm/page.h> /* for PAGE0 */ 47 48 #include <asm/pdc.h> /* for PDC_MODEL_* */ 48 49 #include <asm/pdcpat.h> /* for is_pdc_pat() */ 49 50 #include <asm/parisc-device.h>
+2 -2
drivers/pci/pci-acpi.c
··· 200 200 return PCI_D1; 201 201 case ACPI_STATE_D2: 202 202 return PCI_D2; 203 - case ACPI_STATE_D3: 203 + case ACPI_STATE_D3_HOT: 204 204 return PCI_D3hot; 205 205 case ACPI_STATE_D3_COLD: 206 206 return PCI_D3cold; ··· 223 223 [PCI_D0] = ACPI_STATE_D0, 224 224 [PCI_D1] = ACPI_STATE_D1, 225 225 [PCI_D2] = ACPI_STATE_D2, 226 - [PCI_D3hot] = ACPI_STATE_D3, 226 + [PCI_D3hot] = ACPI_STATE_D3_HOT, 227 227 [PCI_D3cold] = ACPI_STATE_D3 228 228 }; 229 229 int error = -EINVAL;
+1 -1
drivers/platform/x86/intel_mid_powerbtn.c
··· 78 78 79 79 input_set_capability(input, EV_KEY, KEY_POWER); 80 80 81 - error = request_threaded_irq(irq, NULL, mfld_pb_isr, 0, 81 + error = request_threaded_irq(irq, NULL, mfld_pb_isr, IRQF_NO_SUSPEND, 82 82 DRIVER_NAME, input); 83 83 if (error) { 84 84 dev_err(&pdev->dev, "Unable to request irq %d for mfld power"
+1
drivers/ptp/ptp_pch.c
··· 30 30 #include <linux/module.h> 31 31 #include <linux/pci.h> 32 32 #include <linux/ptp_clock_kernel.h> 33 + #include <linux/slab.h> 33 34 34 35 #define STATION_ADDR_LEN 20 35 36 #define PCI_DEVICE_ID_PCH_1588 0x8819
+4 -1
drivers/regulator/core.c
··· 1431 1431 1432 1432 rc = devres_destroy(regulator->dev, devm_regulator_release, 1433 1433 devm_regulator_match, regulator); 1434 - WARN_ON(rc); 1434 + if (rc == 0) 1435 + regulator_put(regulator); 1436 + else 1437 + WARN_ON(rc); 1435 1438 } 1436 1439 EXPORT_SYMBOL_GPL(devm_regulator_put); 1437 1440
+1 -1
drivers/regulator/max8997.c
··· 684 684 } 685 685 686 686 new_val++; 687 - } while (desc->min + desc->step + new_val <= desc->max); 687 + } while (desc->min + desc->step * new_val <= desc->max); 688 688 689 689 new_idx = tmp_idx; 690 690 new_val = tmp_val;
+1 -1
drivers/remoteproc/remoteproc_core.c
··· 354 354 { 355 355 struct rproc *rproc = rvdev->rproc; 356 356 357 - for (i--; i > 0; i--) { 357 + for (i--; i >= 0; i--) { 358 358 struct rproc_vring *rvring = &rvdev->vring[i]; 359 359 int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align)); 360 360
+1 -2
drivers/rtc/rtc-mpc5121.c
··· 360 360 &mpc5200_rtc_ops, THIS_MODULE); 361 361 } 362 362 363 - rtc->rtc->uie_unsupported = 1; 364 - 365 363 if (IS_ERR(rtc->rtc)) { 366 364 err = PTR_ERR(rtc->rtc); 367 365 goto out_free_irq; 368 366 } 367 + rtc->rtc->uie_unsupported = 1; 369 368 370 369 return 0; 371 370
+3
drivers/scsi/hosts.c
··· 218 218 219 219 if (!shost->shost_gendev.parent) 220 220 shost->shost_gendev.parent = dev ? dev : &platform_bus; 221 + if (!dma_dev) 222 + dma_dev = shost->shost_gendev.parent; 223 + 221 224 shost->dma_dev = dma_dev; 222 225 223 226 error = device_add(&shost->shost_gendev);
+3
drivers/scsi/qla2xxx/qla_bsg.c
··· 1367 1367 struct qla_hw_data *ha = vha->hw; 1368 1368 int rval = 0; 1369 1369 1370 + if (ha->flags.isp82xx_reset_hdlr_active) 1371 + return -EBUSY; 1372 + 1370 1373 rval = qla2x00_optrom_setup(bsg_job, vha, 0); 1371 1374 if (rval) 1372 1375 return rval;
+1 -1
drivers/scsi/qla2xxx/qla_dbg.c
··· 15 15 * | Mailbox commands | 0x113e | 0x112c-0x112e | 16 16 * | | | 0x113a | 17 17 * | Device Discovery | 0x2086 | 0x2020-0x2022 | 18 - * | Queue Command and IO tracing | 0x302f | 0x3006,0x3008 | 18 + * | Queue Command and IO tracing | 0x3030 | 0x3006,0x3008 | 19 19 * | | | 0x302d-0x302e | 20 20 * | DPC Thread | 0x401c | | 21 21 * | Async Events | 0x505d | 0x502b-0x502f |
+13 -2
drivers/scsi/qla2xxx/qla_isr.c
··· 1715 1715 res = DID_ERROR << 16; 1716 1716 break; 1717 1717 } 1718 - } else { 1718 + } else if (lscsi_status != SAM_STAT_TASK_SET_FULL && 1719 + lscsi_status != SAM_STAT_BUSY) { 1720 + /* 1721 + * scsi status of task set and busy are considered to be 1722 + * task not completed. 1723 + */ 1724 + 1719 1725 ql_dbg(ql_dbg_io, fcport->vha, 0x301f, 1720 1726 "Dropped frame(s) detected (0x%x " 1721 - "of 0x%x bytes).\n", resid, scsi_bufflen(cp)); 1727 + "of 0x%x bytes).\n", resid, 1728 + scsi_bufflen(cp)); 1722 1729 1723 1730 res = DID_ERROR << 16 | lscsi_status; 1724 1731 goto check_scsi_status; 1732 + } else { 1733 + ql_dbg(ql_dbg_io, fcport->vha, 0x3030, 1734 + "scsi_status: 0x%x, lscsi_status: 0x%x\n", 1735 + scsi_status, lscsi_status); 1725 1736 } 1726 1737 1727 1738 res = DID_OK << 16 | lscsi_status;
+1
drivers/scsi/qla2xxx/qla_nx.c
··· 3125 3125 ql_log(ql_log_info, vha, 0x00b7, 3126 3126 "HW State: COLD/RE-INIT.\n"); 3127 3127 qla82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE, QLA82XX_DEV_COLD); 3128 + qla82xx_set_rst_ready(ha); 3128 3129 if (ql2xmdenable) { 3129 3130 if (qla82xx_md_collect(vha)) 3130 3131 ql_log(ql_log_warn, vha, 0xb02c,
+17 -1
drivers/scsi/qla2xxx/qla_os.c
··· 3577 3577 continue; 3578 3578 /* Attempt a retry. */ 3579 3579 status = 1; 3580 - } else 3580 + } else { 3581 3581 status = qla2x00_fabric_login(vha, 3582 3582 fcport, &next_loopid); 3583 + if (status == QLA_SUCCESS) { 3584 + int status2; 3585 + uint8_t opts; 3586 + 3587 + opts = 0; 3588 + if (fcport->flags & 3589 + FCF_FCP2_DEVICE) 3590 + opts |= BIT_1; 3591 + status2 = 3592 + qla2x00_get_port_database( 3593 + vha, fcport, 3594 + opts); 3595 + if (status2 != QLA_SUCCESS) 3596 + status = 1; 3597 + } 3598 + } 3583 3599 } else 3584 3600 status = qla2x00_local_device_login(vha, 3585 3601 fcport);
+3
drivers/scsi/qla2xxx/qla_sup.c
··· 1017 1017 !IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha)) 1018 1018 return; 1019 1019 1020 + if (ha->flags.isp82xx_reset_hdlr_active) 1021 + return; 1022 + 1020 1023 ha->isp_ops->read_optrom(vha, (uint8_t *)&hdr, 1021 1024 ha->flt_region_npiv_conf << 2, sizeof(struct qla_npiv_header)); 1022 1025 if (hdr.version == __constant_cpu_to_le16(0xffff))
+3 -3
drivers/scsi/qla2xxx/qla_version.h
··· 7 7 /* 8 8 * Driver version 9 9 */ 10 - #define QLA2XXX_VERSION "8.03.07.13-k" 10 + #define QLA2XXX_VERSION "8.04.00.03-k" 11 11 12 12 #define QLA_DRIVER_MAJOR_VER 8 13 - #define QLA_DRIVER_MINOR_VER 3 14 - #define QLA_DRIVER_PATCH_VER 7 13 + #define QLA_DRIVER_MINOR_VER 4 14 + #define QLA_DRIVER_PATCH_VER 0 15 15 #define QLA_DRIVER_BETA_VER 3
+13 -11
drivers/scsi/virtio_scsi.c
··· 175 175 176 176 if (cmd->comp) 177 177 complete_all(cmd->comp); 178 - mempool_free(cmd, virtscsi_cmd_pool); 178 + else 179 + mempool_free(cmd, virtscsi_cmd_pool); 179 180 } 180 181 181 182 static void virtscsi_ctrl_done(struct virtqueue *vq) ··· 312 311 static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd) 313 312 { 314 313 DECLARE_COMPLETION_ONSTACK(comp); 315 - int ret; 314 + int ret = FAILED; 316 315 317 316 cmd->comp = &comp; 318 - ret = virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd, 319 - sizeof cmd->req.tmf, sizeof cmd->resp.tmf, 320 - GFP_NOIO); 321 - if (ret < 0) 322 - return FAILED; 317 + if (virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd, 318 + sizeof cmd->req.tmf, sizeof cmd->resp.tmf, 319 + GFP_NOIO) < 0) 320 + goto out; 323 321 324 322 wait_for_completion(&comp); 325 - if (cmd->resp.tmf.response != VIRTIO_SCSI_S_OK && 326 - cmd->resp.tmf.response != VIRTIO_SCSI_S_FUNCTION_SUCCEEDED) 327 - return FAILED; 323 + if (cmd->resp.tmf.response == VIRTIO_SCSI_S_OK || 324 + cmd->resp.tmf.response == VIRTIO_SCSI_S_FUNCTION_SUCCEEDED) 325 + ret = SUCCESS; 328 326 329 - return SUCCESS; 327 + out: 328 + mempool_free(cmd, virtscsi_cmd_pool); 329 + return ret; 330 330 } 331 331 332 332 static int virtscsi_device_reset(struct scsi_cmnd *sc)
-22
drivers/target/target_core_tpg.c
··· 60 60 int i; 61 61 struct se_dev_entry *deve; 62 62 struct se_lun *lun; 63 - struct se_lun_acl *acl, *acl_tmp; 64 63 65 64 spin_lock_irq(&nacl->device_list_lock); 66 65 for (i = 0; i < TRANSPORT_MAX_LUNS_PER_TPG; i++) { ··· 80 81 core_update_device_list_for_node(lun, NULL, deve->mapped_lun, 81 82 TRANSPORT_LUNFLAGS_NO_ACCESS, nacl, tpg, 0); 82 83 83 - spin_lock(&lun->lun_acl_lock); 84 - list_for_each_entry_safe(acl, acl_tmp, 85 - &lun->lun_acl_list, lacl_list) { 86 - if (!strcmp(acl->initiatorname, nacl->initiatorname) && 87 - (acl->mapped_lun == deve->mapped_lun)) 88 - break; 89 - } 90 - 91 - if (!acl) { 92 - pr_err("Unable to locate struct se_lun_acl for %s," 93 - " mapped_lun: %u\n", nacl->initiatorname, 94 - deve->mapped_lun); 95 - spin_unlock(&lun->lun_acl_lock); 96 - spin_lock_irq(&nacl->device_list_lock); 97 - continue; 98 - } 99 - 100 - list_del(&acl->lacl_list); 101 - spin_unlock(&lun->lun_acl_lock); 102 - 103 84 spin_lock_irq(&nacl->device_list_lock); 104 - kfree(acl); 105 85 } 106 86 spin_unlock_irq(&nacl->device_list_lock); 107 87 }
+1 -1
drivers/tty/vt/keyboard.c
··· 2044 2044 kbd->default_ledflagstate = ((arg >> 4) & 7); 2045 2045 set_leds(); 2046 2046 spin_unlock_irqrestore(&kbd_event_lock, flags); 2047 - break; 2047 + return 0; 2048 2048 2049 2049 /* the ioctls below only set the lights, not the functions */ 2050 2050 /* for those, see KDGKBLED and KDSKBLED above */
+6 -1
drivers/vhost/net.c
··· 24 24 #include <linux/if_arp.h> 25 25 #include <linux/if_tun.h> 26 26 #include <linux/if_macvlan.h> 27 + #include <linux/if_vlan.h> 27 28 28 29 #include <net/sock.h> 29 30 ··· 287 286 288 287 spin_lock_irqsave(&sk->sk_receive_queue.lock, flags); 289 288 head = skb_peek(&sk->sk_receive_queue); 290 - if (likely(head)) 289 + if (likely(head)) { 291 290 len = head->len; 291 + if (vlan_tx_tag_present(head)) 292 + len += VLAN_HLEN; 293 + } 294 + 292 295 spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags); 293 296 return len; 294 297 }
+2
drivers/video/console/sticore.c
··· 22 22 #include <linux/font.h> 23 23 24 24 #include <asm/hardware.h> 25 + #include <asm/page.h> 25 26 #include <asm/parisc-device.h> 27 + #include <asm/pdc.h> 26 28 #include <asm/cacheflush.h> 27 29 #include <asm/grfioctl.h> 28 30
+1 -1
drivers/video/uvesafb.c
··· 73 73 struct uvesafb_task *utask; 74 74 struct uvesafb_ktask *task; 75 75 76 - if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) 76 + if (!capable(CAP_SYS_ADMIN)) 77 77 return; 78 78 79 79 if (msg->seq >= UVESAFB_TASKS_MAX)
+16 -11
drivers/video/xen-fbfront.c
··· 365 365 struct fb_info *fb_info; 366 366 int fb_size; 367 367 int val; 368 - int ret; 368 + int ret = 0; 369 369 370 370 info = kzalloc(sizeof(*info), GFP_KERNEL); 371 371 if (info == NULL) { ··· 458 458 xenfb_init_shared_page(info, fb_info); 459 459 460 460 ret = xenfb_connect_backend(dev, info); 461 - if (ret < 0) 462 - goto error; 461 + if (ret < 0) { 462 + xenbus_dev_fatal(dev, ret, "xenfb_connect_backend"); 463 + goto error_fb; 464 + } 463 465 464 466 ret = register_framebuffer(fb_info); 465 467 if (ret) { 466 - fb_deferred_io_cleanup(fb_info); 467 - fb_dealloc_cmap(&fb_info->cmap); 468 - framebuffer_release(fb_info); 469 468 xenbus_dev_fatal(dev, ret, "register_framebuffer"); 470 - goto error; 469 + goto error_fb; 471 470 } 472 471 info->fb_info = fb_info; 473 472 474 473 xenfb_make_preferred_console(); 475 474 return 0; 476 475 477 - error_nomem: 478 - ret = -ENOMEM; 479 - xenbus_dev_fatal(dev, ret, "allocating device memory"); 480 - error: 476 + error_fb: 477 + fb_deferred_io_cleanup(fb_info); 478 + fb_dealloc_cmap(&fb_info->cmap); 479 + framebuffer_release(fb_info); 480 + error_nomem: 481 + if (!ret) { 482 + ret = -ENOMEM; 483 + xenbus_dev_fatal(dev, ret, "allocating device memory"); 484 + } 485 + error: 481 486 xenfb_remove(dev); 482 487 return ret; 483 488 }
+10 -8
drivers/xen/Kconfig
··· 183 183 depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ 184 184 default m 185 185 help 186 - This ACPI processor uploads Power Management information to the Xen hypervisor. 186 + This ACPI processor uploads Power Management information to the Xen 187 + hypervisor. 187 188 188 - To do that the driver parses the Power Management data and uploads said 189 - information to the Xen hypervisor. Then the Xen hypervisor can select the 190 - proper Cx and Pxx states. It also registers itslef as the SMM so that 191 - other drivers (such as ACPI cpufreq scaling driver) will not load. 189 + To do that the driver parses the Power Management data and uploads 190 + said information to the Xen hypervisor. Then the Xen hypervisor can 191 + select the proper Cx and Pxx states. It also registers itslef as the 192 + SMM so that other drivers (such as ACPI cpufreq scaling driver) will 193 + not load. 192 194 193 - To compile this driver as a module, choose M here: the 194 - module will be called xen_acpi_processor If you do not know what to choose, 195 - select M here. If the CPUFREQ drivers are built in, select Y here. 195 + To compile this driver as a module, choose M here: the module will be 196 + called xen_acpi_processor If you do not know what to choose, select 197 + M here. If the CPUFREQ drivers are built in, select Y here. 196 198 197 199 endmenu
+19 -9
fs/btrfs/ctree.c
··· 220 220 */ 221 221 static void add_root_to_dirty_list(struct btrfs_root *root) 222 222 { 223 + spin_lock(&root->fs_info->trans_lock); 223 224 if (root->track_dirty && list_empty(&root->dirty_list)) { 224 225 list_add(&root->dirty_list, 225 226 &root->fs_info->dirty_cowonly_roots); 226 227 } 228 + spin_unlock(&root->fs_info->trans_lock); 227 229 } 228 230 229 231 /* ··· 725 723 726 724 cur = btrfs_find_tree_block(root, blocknr, blocksize); 727 725 if (cur) 728 - uptodate = btrfs_buffer_uptodate(cur, gen); 726 + uptodate = btrfs_buffer_uptodate(cur, gen, 0); 729 727 else 730 728 uptodate = 0; 731 729 if (!cur || !uptodate) { ··· 1360 1358 block1 = btrfs_node_blockptr(parent, slot - 1); 1361 1359 gen = btrfs_node_ptr_generation(parent, slot - 1); 1362 1360 eb = btrfs_find_tree_block(root, block1, blocksize); 1363 - if (eb && btrfs_buffer_uptodate(eb, gen)) 1361 + /* 1362 + * if we get -eagain from btrfs_buffer_uptodate, we 1363 + * don't want to return eagain here. That will loop 1364 + * forever 1365 + */ 1366 + if (eb && btrfs_buffer_uptodate(eb, gen, 1) != 0) 1364 1367 block1 = 0; 1365 1368 free_extent_buffer(eb); 1366 1369 } ··· 1373 1366 block2 = btrfs_node_blockptr(parent, slot + 1); 1374 1367 gen = btrfs_node_ptr_generation(parent, slot + 1); 1375 1368 eb = btrfs_find_tree_block(root, block2, blocksize); 1376 - if (eb && btrfs_buffer_uptodate(eb, gen)) 1369 + if (eb && btrfs_buffer_uptodate(eb, gen, 1) != 0) 1377 1370 block2 = 0; 1378 1371 free_extent_buffer(eb); 1379 1372 } ··· 1511 1504 1512 1505 tmp = btrfs_find_tree_block(root, blocknr, blocksize); 1513 1506 if (tmp) { 1514 - if (btrfs_buffer_uptodate(tmp, 0)) { 1515 - if (btrfs_buffer_uptodate(tmp, gen)) { 1507 + /* first we do an atomic uptodate check */ 1508 + if (btrfs_buffer_uptodate(tmp, 0, 1) > 0) { 1509 + if (btrfs_buffer_uptodate(tmp, gen, 1) > 0) { 1516 1510 /* 1517 1511 * we found an up to date block without 1518 1512 * sleeping, return ··· 1531 1523 free_extent_buffer(tmp); 1532 1524 btrfs_set_path_blocking(p); 1533 1525 1526 + /* now we're allowed to do a blocking uptodate check */ 1534 1527 tmp = read_tree_block(root, blocknr, blocksize, gen); 1535 - if (tmp && btrfs_buffer_uptodate(tmp, gen)) { 1528 + if (tmp && btrfs_buffer_uptodate(tmp, gen, 0) > 0) { 1536 1529 *eb_ret = tmp; 1537 1530 return 0; 1538 1531 } ··· 1568 1559 * and give up so that our caller doesn't loop forever 1569 1560 * on our EAGAINs. 1570 1561 */ 1571 - if (!btrfs_buffer_uptodate(tmp, 0)) 1562 + if (!btrfs_buffer_uptodate(tmp, 0, 0)) 1572 1563 ret = -EIO; 1573 1564 free_extent_buffer(tmp); 1574 1565 } ··· 4052 4043 tmp = btrfs_find_tree_block(root, blockptr, 4053 4044 btrfs_level_size(root, level - 1)); 4054 4045 4055 - if (tmp && btrfs_buffer_uptodate(tmp, gen)) { 4046 + if (tmp && btrfs_buffer_uptodate(tmp, gen, 1) > 0) { 4056 4047 free_extent_buffer(tmp); 4057 4048 break; 4058 4049 } ··· 4175 4166 struct extent_buffer *cur; 4176 4167 cur = btrfs_find_tree_block(root, blockptr, 4177 4168 btrfs_level_size(root, level - 1)); 4178 - if (!cur || !btrfs_buffer_uptodate(cur, gen)) { 4169 + if (!cur || 4170 + btrfs_buffer_uptodate(cur, gen, 1) <= 0) { 4179 4171 slot++; 4180 4172 if (cur) 4181 4173 free_extent_buffer(cur);
+13 -5
fs/btrfs/disk-io.c
··· 323 323 * in the wrong place. 324 324 */ 325 325 static int verify_parent_transid(struct extent_io_tree *io_tree, 326 - struct extent_buffer *eb, u64 parent_transid) 326 + struct extent_buffer *eb, u64 parent_transid, 327 + int atomic) 327 328 { 328 329 struct extent_state *cached_state = NULL; 329 330 int ret; 330 331 331 332 if (!parent_transid || btrfs_header_generation(eb) == parent_transid) 332 333 return 0; 334 + 335 + if (atomic) 336 + return -EAGAIN; 333 337 334 338 lock_extent_bits(io_tree, eb->start, eb->start + eb->len - 1, 335 339 0, &cached_state); ··· 376 372 ret = read_extent_buffer_pages(io_tree, eb, start, 377 373 WAIT_COMPLETE, 378 374 btree_get_extent, mirror_num); 379 - if (!ret && !verify_parent_transid(io_tree, eb, parent_transid)) 375 + if (!ret && !verify_parent_transid(io_tree, eb, 376 + parent_transid, 0)) 380 377 break; 381 378 382 379 /* ··· 1207 1202 root->commit_root = NULL; 1208 1203 root->node = read_tree_block(root, btrfs_root_bytenr(&root->root_item), 1209 1204 blocksize, generation); 1210 - if (!root->node || !btrfs_buffer_uptodate(root->node, generation)) { 1205 + if (!root->node || !btrfs_buffer_uptodate(root->node, generation, 0)) { 1211 1206 free_extent_buffer(root->node); 1212 1207 root->node = NULL; 1213 1208 return -EIO; ··· 3148 3143 return 0; 3149 3144 } 3150 3145 3151 - int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid) 3146 + int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid, 3147 + int atomic) 3152 3148 { 3153 3149 int ret; 3154 3150 struct inode *btree_inode = buf->pages[0]->mapping->host; ··· 3159 3153 return ret; 3160 3154 3161 3155 ret = verify_parent_transid(&BTRFS_I(btree_inode)->io_tree, buf, 3162 - parent_transid); 3156 + parent_transid, atomic); 3157 + if (ret == -EAGAIN) 3158 + return ret; 3163 3159 return !ret; 3164 3160 } 3165 3161
+2 -1
fs/btrfs/disk-io.h
··· 66 66 void __btrfs_btree_balance_dirty(struct btrfs_root *root, unsigned long nr); 67 67 void btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root); 68 68 void btrfs_mark_buffer_dirty(struct extent_buffer *buf); 69 - int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid); 69 + int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid, 70 + int atomic); 70 71 int btrfs_set_buffer_uptodate(struct extent_buffer *buf); 71 72 int btrfs_read_buffer(struct extent_buffer *buf, u64 parent_transid); 72 73 u32 btrfs_csum_data(struct btrfs_root *root, char *data, u32 seed, size_t len);
+1 -1
fs/btrfs/extent-tree.c
··· 6568 6568 goto skip; 6569 6569 } 6570 6570 6571 - if (!btrfs_buffer_uptodate(next, generation)) { 6571 + if (!btrfs_buffer_uptodate(next, generation, 0)) { 6572 6572 btrfs_tree_unlock(next); 6573 6573 free_extent_buffer(next); 6574 6574 next = NULL;
+2 -2
fs/btrfs/extent_io.c
··· 4120 4120 if (atomic_inc_not_zero(&exists->refs)) { 4121 4121 spin_unlock(&mapping->private_lock); 4122 4122 unlock_page(p); 4123 + page_cache_release(p); 4123 4124 mark_extent_buffer_accessed(exists); 4124 4125 goto free_eb; 4125 4126 } ··· 4200 4199 unlock_page(eb->pages[i]); 4201 4200 } 4202 4201 4203 - if (!atomic_dec_and_test(&eb->refs)) 4204 - return exists; 4202 + WARN_ON(!atomic_dec_and_test(&eb->refs)); 4205 4203 btrfs_release_extent_buffer(eb); 4206 4204 return exists; 4207 4205 }
+2 -2
fs/btrfs/ioctl.h
··· 252 252 253 253 struct btrfs_ioctl_ino_path_args { 254 254 __u64 inum; /* in */ 255 - __u32 size; /* in */ 255 + __u64 size; /* in */ 256 256 __u64 reserved[4]; 257 257 /* struct btrfs_data_container *fspath; out */ 258 258 __u64 fspath; /* out */ ··· 260 260 261 261 struct btrfs_ioctl_logical_ino_args { 262 262 __u64 logical; /* in */ 263 - __u32 size; /* in */ 263 + __u64 size; /* in */ 264 264 __u64 reserved[4]; 265 265 /* struct btrfs_data_container *inodes; out */ 266 266 __u64 inodes;
+7
fs/btrfs/scrub.c
··· 998 998 page = sblock->pagev + page_index; 999 999 page->logical = logical; 1000 1000 page->physical = bbio->stripes[mirror_index].physical; 1001 + /* for missing devices, bdev is NULL */ 1001 1002 page->bdev = bbio->stripes[mirror_index].dev->bdev; 1002 1003 page->mirror_num = mirror_index + 1; 1003 1004 page->page = alloc_page(GFP_NOFS); ··· 1042 1041 int ret; 1043 1042 struct scrub_page *page = sblock->pagev + page_num; 1044 1043 DECLARE_COMPLETION_ONSTACK(complete); 1044 + 1045 + if (page->bdev == NULL) { 1046 + page->io_error = 1; 1047 + sblock->no_io_error_seen = 0; 1048 + continue; 1049 + } 1045 1050 1046 1051 BUG_ON(!page->page); 1047 1052 bio = bio_alloc(GFP_NOFS, 1);
+1 -1
fs/btrfs/tree-log.c
··· 279 279 log->fs_info->extent_root, 280 280 eb->start, eb->len); 281 281 282 - if (btrfs_buffer_uptodate(eb, gen)) { 282 + if (btrfs_buffer_uptodate(eb, gen, 0)) { 283 283 if (wc->write) 284 284 btrfs_write_tree_block(eb); 285 285 if (wc->wait)
+2 -2
fs/cifs/cifsfs.c
··· 442 442 seq_printf(s, ",rsize=%u", cifs_sb->rsize); 443 443 seq_printf(s, ",wsize=%u", cifs_sb->wsize); 444 444 /* convert actimeo and display it in seconds */ 445 - seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ); 445 + seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ); 446 446 447 447 return 0; 448 448 } ··· 699 699 * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate 700 700 * the cached file length 701 701 */ 702 - if (origin != SEEK_SET || origin != SEEK_CUR) { 702 + if (origin != SEEK_SET && origin != SEEK_CUR) { 703 703 int rc; 704 704 struct inode *inode = file->f_path.dentry->d_inode; 705 705
+1 -1
fs/cifs/cifsfs.h
··· 125 125 extern const struct export_operations cifs_export_ops; 126 126 #endif /* CONFIG_CIFS_NFSD_EXPORT */ 127 127 128 - #define CIFS_VERSION "1.77" 128 + #define CIFS_VERSION "1.78" 129 129 #endif /* _CIFSFS_H */
+5 -1
fs/cifs/cifssmb.c
··· 4844 4844 max_len = data_end - temp; 4845 4845 node->node_name = cifs_strndup_from_utf16(temp, max_len, 4846 4846 is_unicode, nls_codepage); 4847 - if (!node->node_name) 4847 + if (!node->node_name) { 4848 4848 rc = -ENOMEM; 4849 + goto parse_DFS_referrals_exit; 4850 + } 4851 + 4852 + ref++; 4849 4853 } 4850 4854 4851 4855 parse_DFS_referrals_exit:
+6 -18
fs/cifs/connect.c
··· 164 164 { Opt_sign, "sign" }, 165 165 { Opt_seal, "seal" }, 166 166 { Opt_direct, "direct" }, 167 - { Opt_direct, "forceddirectio" }, 167 + { Opt_direct, "directio" }, 168 + { Opt_direct, "forcedirectio" }, 168 169 { Opt_strictcache, "strictcache" }, 169 170 { Opt_noac, "noac" }, 170 171 { Opt_fsc, "fsc" }, ··· 216 215 217 216 { Opt_ignore, "cred" }, 218 217 { Opt_ignore, "credentials" }, 218 + { Opt_ignore, "cred=%s" }, 219 + { Opt_ignore, "credentials=%s" }, 219 220 { Opt_ignore, "guest" }, 220 221 { Opt_ignore, "rw" }, 221 222 { Opt_ignore, "ro" }, ··· 2186 2183 tcp_ses->session_estab = false; 2187 2184 tcp_ses->sequence_number = 0; 2188 2185 tcp_ses->lstrp = jiffies; 2186 + spin_lock_init(&tcp_ses->req_lock); 2189 2187 INIT_LIST_HEAD(&tcp_ses->tcp_ses_list); 2190 2188 INIT_LIST_HEAD(&tcp_ses->smb_ses_list); 2191 2189 INIT_DELAYED_WORK(&tcp_ses->echo, cifs_echo_request); ··· 3618 3614 return volume_info; 3619 3615 } 3620 3616 3621 - /* make sure ra_pages is a multiple of rsize */ 3622 - static inline unsigned int 3623 - cifs_ra_pages(struct cifs_sb_info *cifs_sb) 3624 - { 3625 - unsigned int reads; 3626 - unsigned int rsize_pages = cifs_sb->rsize / PAGE_CACHE_SIZE; 3627 - 3628 - if (rsize_pages >= default_backing_dev_info.ra_pages) 3629 - return default_backing_dev_info.ra_pages; 3630 - else if (rsize_pages == 0) 3631 - return rsize_pages; 3632 - 3633 - reads = default_backing_dev_info.ra_pages / rsize_pages; 3634 - return reads * rsize_pages; 3635 - } 3636 - 3637 3617 int 3638 3618 cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) 3639 3619 { ··· 3705 3717 cifs_sb->rsize = cifs_negotiate_rsize(tcon, volume_info); 3706 3718 3707 3719 /* tune readahead according to rsize */ 3708 - cifs_sb->bdi.ra_pages = cifs_ra_pages(cifs_sb); 3720 + cifs_sb->bdi.ra_pages = cifs_sb->rsize / PAGE_CACHE_SIZE; 3709 3721 3710 3722 remote_path_check: 3711 3723 #ifdef CONFIG_CIFS_DFS_UPCALL
+12 -5
fs/cifs/dir.c
··· 668 668 return 0; 669 669 else { 670 670 /* 671 - * Forcibly invalidate automounting directory inodes 672 - * (remote DFS directories) so to have them 673 - * instantiated again for automount 671 + * If the inode wasn't known to be a dfs entry when 672 + * the dentry was instantiated, such as when created 673 + * via ->readdir(), it needs to be set now since the 674 + * attributes will have been updated by 675 + * cifs_revalidate_dentry(). 674 676 */ 675 - if (IS_AUTOMOUNT(direntry->d_inode)) 676 - return 0; 677 + if (IS_AUTOMOUNT(direntry->d_inode) && 678 + !(direntry->d_flags & DCACHE_NEED_AUTOMOUNT)) { 679 + spin_lock(&direntry->d_lock); 680 + direntry->d_flags |= DCACHE_NEED_AUTOMOUNT; 681 + spin_unlock(&direntry->d_lock); 682 + } 683 + 677 684 return 1; 678 685 } 679 686 }
+22 -4
fs/dcache.c
··· 141 141 * Compare 2 name strings, return 0 if they match, otherwise non-zero. 142 142 * The strings are both count bytes long, and count is non-zero. 143 143 */ 144 + #ifdef CONFIG_DCACHE_WORD_ACCESS 145 + 146 + #include <asm/word-at-a-time.h> 147 + /* 148 + * NOTE! 'cs' and 'scount' come from a dentry, so it has a 149 + * aligned allocation for this particular component. We don't 150 + * strictly need the load_unaligned_zeropad() safety, but it 151 + * doesn't hurt either. 152 + * 153 + * In contrast, 'ct' and 'tcount' can be from a pathname, and do 154 + * need the careful unaligned handling. 155 + */ 144 156 static inline int dentry_cmp(const unsigned char *cs, size_t scount, 145 157 const unsigned char *ct, size_t tcount) 146 158 { 147 - #ifdef CONFIG_DCACHE_WORD_ACCESS 148 159 unsigned long a,b,mask; 149 160 150 161 if (unlikely(scount != tcount)) 151 162 return 1; 152 163 153 164 for (;;) { 154 - a = *(unsigned long *)cs; 155 - b = *(unsigned long *)ct; 165 + a = load_unaligned_zeropad(cs); 166 + b = load_unaligned_zeropad(ct); 156 167 if (tcount < sizeof(unsigned long)) 157 168 break; 158 169 if (unlikely(a != b)) ··· 176 165 } 177 166 mask = ~(~0ul << tcount*8); 178 167 return unlikely(!!((a ^ b) & mask)); 168 + } 169 + 179 170 #else 171 + 172 + static inline int dentry_cmp(const unsigned char *cs, size_t scount, 173 + const unsigned char *ct, size_t tcount) 174 + { 180 175 if (scount != tcount) 181 176 return 1; 182 177 ··· 194 177 tcount--; 195 178 } while (tcount); 196 179 return 0; 197 - #endif 198 180 } 181 + 182 + #endif 199 183 200 184 static void __d_free(struct rcu_head *head) 201 185 {
+4
fs/hfsplus/catalog.c
··· 366 366 err = hfs_brec_find(&src_fd); 367 367 if (err) 368 368 goto out; 369 + if (src_fd.entrylength > sizeof(entry) || src_fd.entrylength < 0) { 370 + err = -EIO; 371 + goto out; 372 + } 369 373 370 374 hfs_bnode_read(src_fd.bnode, &entry, src_fd.entryoffset, 371 375 src_fd.entrylength);
+11
fs/hfsplus/dir.c
··· 150 150 filp->f_pos++; 151 151 /* fall through */ 152 152 case 1: 153 + if (fd.entrylength > sizeof(entry) || fd.entrylength < 0) { 154 + err = -EIO; 155 + goto out; 156 + } 157 + 153 158 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, 154 159 fd.entrylength); 155 160 if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) { ··· 186 181 err = -EIO; 187 182 goto out; 188 183 } 184 + 185 + if (fd.entrylength > sizeof(entry) || fd.entrylength < 0) { 186 + err = -EIO; 187 + goto out; 188 + } 189 + 189 190 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, 190 191 fd.entrylength); 191 192 type = be16_to_cpu(entry.type);
+1 -1
fs/jffs2/gc.c
··· 234 234 return 0; 235 235 236 236 jffs2_dbg(1, "No progress from erasing block; doing GC anyway\n"); 237 - spin_lock(&c->erase_completion_lock); 238 237 mutex_lock(&c->alloc_sem); 238 + spin_lock(&c->erase_completion_lock); 239 239 } 240 240 241 241 /* First, work out which block we're garbage-collecting */
+2 -2
fs/namei.c
··· 1429 1429 unsigned long hash = 0; 1430 1430 1431 1431 for (;;) { 1432 - a = *(unsigned long *)name; 1432 + a = load_unaligned_zeropad(name); 1433 1433 if (len < sizeof(unsigned long)) 1434 1434 break; 1435 1435 hash += a; ··· 1459 1459 do { 1460 1460 hash = (hash + a) * 9; 1461 1461 len += sizeof(unsigned long); 1462 - a = *(unsigned long *)(name+len); 1462 + a = load_unaligned_zeropad(name+len); 1463 1463 /* Do we have any NUL or '/' bytes in this word? */ 1464 1464 mask = has_zero(a) | has_zero(a ^ REPEAT_BYTE('/')); 1465 1465 } while (!mask);
+10 -2
fs/proc/task_mmu.c
··· 747 747 else if (pte_present(pte)) 748 748 *pme = make_pme(PM_PFRAME(pte_pfn(pte)) 749 749 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 750 + else 751 + *pme = make_pme(PM_NOT_PRESENT); 750 752 } 751 753 752 754 #ifdef CONFIG_TRANSPARENT_HUGEPAGE ··· 763 761 if (pmd_present(pmd)) 764 762 *pme = make_pme(PM_PFRAME(pmd_pfn(pmd) + offset) 765 763 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 764 + else 765 + *pme = make_pme(PM_NOT_PRESENT); 766 766 } 767 767 #else 768 768 static inline void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme, ··· 805 801 806 802 /* check to see if we've left 'vma' behind 807 803 * and need a new, higher one */ 808 - if (vma && (addr >= vma->vm_end)) 804 + if (vma && (addr >= vma->vm_end)) { 809 805 vma = find_vma(walk->mm, addr); 806 + pme = make_pme(PM_NOT_PRESENT); 807 + } 810 808 811 809 /* check that 'vma' actually covers this address, 812 810 * and that it isn't a huge page vma */ ··· 836 830 if (pte_present(pte)) 837 831 *pme = make_pme(PM_PFRAME(pte_pfn(pte) + offset) 838 832 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 833 + else 834 + *pme = make_pme(PM_NOT_PRESENT); 839 835 } 840 836 841 837 /* This function walks within one hugetlb entry in the single call */ ··· 847 839 { 848 840 struct pagemapread *pm = walk->private; 849 841 int err = 0; 850 - pagemap_entry_t pme = make_pme(PM_NOT_PRESENT); 842 + pagemap_entry_t pme; 851 843 852 844 for (; addr != end; addr += PAGE_SIZE) { 853 845 int offset = (addr & ~hmask) >> PAGE_SHIFT;
+4 -3
include/acpi/actypes.h
··· 499 499 #define ACPI_STATE_D0 (u8) 0 500 500 #define ACPI_STATE_D1 (u8) 1 501 501 #define ACPI_STATE_D2 (u8) 2 502 - #define ACPI_STATE_D3 (u8) 3 503 - #define ACPI_STATE_D3_COLD (u8) 4 504 - #define ACPI_D_STATES_MAX ACPI_STATE_D3_COLD 502 + #define ACPI_STATE_D3_HOT (u8) 3 503 + #define ACPI_STATE_D3 (u8) 4 504 + #define ACPI_STATE_D3_COLD ACPI_STATE_D3 505 + #define ACPI_D_STATES_MAX ACPI_STATE_D3 505 506 #define ACPI_D_STATE_COUNT 5 506 507 507 508 #define ACPI_STATE_C0 (u8) 0
+1 -1
include/asm-generic/statfs.h
··· 15 15 * with a 10' pole. 16 16 */ 17 17 #ifndef __statfs_word 18 - #if BITS_PER_LONG == 64 18 + #if __BITS_PER_LONG == 64 19 19 #define __statfs_word long 20 20 #else 21 21 #define __statfs_word __u32
-9
include/linux/netdevice.h
··· 1426 1426 return 0; 1427 1427 } 1428 1428 1429 - #ifndef CONFIG_NET_NS 1430 - static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev) 1431 - { 1432 - skb->dev = dev; 1433 - } 1434 - #else /* CONFIG_NET_NS */ 1435 - void skb_set_dev(struct sk_buff *skb, struct net_device *dev); 1436 - #endif 1437 - 1438 1429 static inline bool netdev_uses_trailer_tags(struct net_device *dev) 1439 1430 { 1440 1431 #ifdef CONFIG_NET_DSA_TAG_TRAILER
+16
include/linux/netfilter/ipset/ip_set_ahash.h
··· 99 99 #endif 100 100 }; 101 101 102 + static size_t 103 + htable_size(u8 hbits) 104 + { 105 + size_t hsize; 106 + 107 + /* We must fit both into u32 in jhash and size_t */ 108 + if (hbits > 31) 109 + return 0; 110 + hsize = jhash_size(hbits); 111 + if ((((size_t)-1) - sizeof(struct htable))/sizeof(struct hbucket) 112 + < hsize) 113 + return 0; 114 + 115 + return hsize * sizeof(struct hbucket) + sizeof(struct htable); 116 + } 117 + 102 118 /* Compute htable_bits from the user input parameter hashsize */ 103 119 static u8 104 120 htable_bits(u32 hashsize)
+22 -1
include/linux/seqlock.h
··· 141 141 unsigned ret; 142 142 143 143 repeat: 144 - ret = s->sequence; 144 + ret = ACCESS_ONCE(s->sequence); 145 145 if (unlikely(ret & 1)) { 146 146 cpu_relax(); 147 147 goto repeat; ··· 163 163 unsigned ret = __read_seqcount_begin(s); 164 164 smp_rmb(); 165 165 return ret; 166 + } 167 + 168 + /** 169 + * raw_seqcount_begin - begin a seq-read critical section 170 + * @s: pointer to seqcount_t 171 + * Returns: count to be passed to read_seqcount_retry 172 + * 173 + * raw_seqcount_begin opens a read critical section of the given seqcount. 174 + * Validity of the critical section is tested by checking read_seqcount_retry 175 + * function. 176 + * 177 + * Unlike read_seqcount_begin(), this function will not wait for the count 178 + * to stabilize. If a writer is active when we begin, we will fail the 179 + * read_seqcount_retry() instead of stabilizing at the beginning of the 180 + * critical section. 181 + */ 182 + static inline unsigned raw_seqcount_begin(const seqcount_t *s) 183 + { 184 + unsigned ret = ACCESS_ONCE(s->sequence); 185 + smp_rmb(); 186 + return ret & ~1; 166 187 } 167 188 168 189 /**
+2 -1
include/linux/usb/usbnet.h
··· 191 191 enum skb_state { 192 192 illegal = 0, 193 193 tx_start, tx_done, 194 - rx_start, rx_done, rx_cleanup 194 + rx_start, rx_done, rx_cleanup, 195 + unlink_start 195 196 }; 196 197 197 198 struct skb_data { /* skb->cb is one of these */
+2 -1
include/media/soc_camera.h
··· 59 59 struct soc_camera_host { 60 60 struct v4l2_device v4l2_dev; 61 61 struct list_head list; 62 - unsigned char nr; /* Host number */ 62 + struct mutex host_lock; /* Protect during probing */ 63 + unsigned char nr; /* Host number */ 63 64 void *priv; 64 65 const char *drv_name; 65 66 struct soc_camera_host_ops *ops;
+1
include/net/bluetooth/bluetooth.h
··· 191 191 struct list_head accept_q; 192 192 struct sock *parent; 193 193 u32 defer_setup; 194 + bool suspended; 194 195 }; 195 196 196 197 struct bt_sock_list {
+13
include/net/sctp/sctp.h
··· 704 704 addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); 705 705 } 706 706 707 + /* The cookie is always 0 since this is how it's used in the 708 + * pmtu code. 709 + */ 710 + static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) 711 + { 712 + if (t->dst && !dst_check(t->dst, 0)) { 713 + dst_release(t->dst); 714 + t->dst = NULL; 715 + } 716 + 717 + return t->dst; 718 + } 719 + 707 720 #endif /* __net_sctp_h__ */
+1 -1
init/do_mounts.c
··· 472 472 void __init mount_root(void) 473 473 { 474 474 #ifdef CONFIG_ROOT_NFS 475 - if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) { 475 + if (ROOT_DEV == Root_NFS) { 476 476 if (mount_nfs_root()) 477 477 return; 478 478
+46 -17
kernel/compat.c
··· 372 372 373 373 #ifdef __ARCH_WANT_SYS_SIGPROCMASK 374 374 375 - asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set, 376 - compat_old_sigset_t __user *oset) 375 + /* 376 + * sys_sigprocmask SIG_SETMASK sets the first (compat) word of the 377 + * blocked set of signals to the supplied signal set 378 + */ 379 + static inline void compat_sig_setmask(sigset_t *blocked, compat_sigset_word set) 377 380 { 378 - old_sigset_t s; 379 - long ret; 380 - mm_segment_t old_fs; 381 + memcpy(blocked->sig, &set, sizeof(set)); 382 + } 381 383 382 - if (set && get_user(s, set)) 383 - return -EFAULT; 384 - old_fs = get_fs(); 385 - set_fs(KERNEL_DS); 386 - ret = sys_sigprocmask(how, 387 - set ? (old_sigset_t __user *) &s : NULL, 388 - oset ? (old_sigset_t __user *) &s : NULL); 389 - set_fs(old_fs); 390 - if (ret == 0) 391 - if (oset) 392 - ret = put_user(s, oset); 393 - return ret; 384 + asmlinkage long compat_sys_sigprocmask(int how, 385 + compat_old_sigset_t __user *nset, 386 + compat_old_sigset_t __user *oset) 387 + { 388 + old_sigset_t old_set, new_set; 389 + sigset_t new_blocked; 390 + 391 + old_set = current->blocked.sig[0]; 392 + 393 + if (nset) { 394 + if (get_user(new_set, nset)) 395 + return -EFAULT; 396 + new_set &= ~(sigmask(SIGKILL) | sigmask(SIGSTOP)); 397 + 398 + new_blocked = current->blocked; 399 + 400 + switch (how) { 401 + case SIG_BLOCK: 402 + sigaddsetmask(&new_blocked, new_set); 403 + break; 404 + case SIG_UNBLOCK: 405 + sigdelsetmask(&new_blocked, new_set); 406 + break; 407 + case SIG_SETMASK: 408 + compat_sig_setmask(&new_blocked, new_set); 409 + break; 410 + default: 411 + return -EINVAL; 412 + } 413 + 414 + set_current_blocked(&new_blocked); 415 + } 416 + 417 + if (oset) { 418 + if (put_user(old_set, oset)) 419 + return -EFAULT; 420 + } 421 + 422 + return 0; 394 423 } 395 424 396 425 #endif
+3
kernel/fork.c
··· 47 47 #include <linux/audit.h> 48 48 #include <linux/memcontrol.h> 49 49 #include <linux/ftrace.h> 50 + #include <linux/proc_fs.h> 50 51 #include <linux/profile.h> 51 52 #include <linux/rmap.h> 52 53 #include <linux/ksm.h> ··· 1465 1464 if (p->io_context) 1466 1465 exit_io_context(p); 1467 1466 bad_fork_cleanup_namespaces: 1467 + if (unlikely(clone_flags & CLONE_NEWPID)) 1468 + pid_ns_release_proc(p->nsproxy->pid_ns); 1468 1469 exit_task_namespaces(p); 1469 1470 bad_fork_cleanup_mm: 1470 1471 if (p->mm)
+1
kernel/irq/chip.c
··· 518 518 out_unlock: 519 519 raw_spin_unlock(&desc->lock); 520 520 } 521 + EXPORT_SYMBOL(handle_edge_irq); 521 522 522 523 #ifdef CONFIG_IRQ_EDGE_EOI_HANDLER 523 524 /**
+1
kernel/irq/irqdesc.c
··· 112 112 { 113 113 return radix_tree_lookup(&irq_desc_tree, irq); 114 114 } 115 + EXPORT_SYMBOL(irq_to_desc); 115 116 116 117 static void delete_irq_desc(unsigned int irq) 117 118 {
-1
mm/hugetlb.c
··· 2498 2498 if (outside_reserve) { 2499 2499 BUG_ON(huge_pte_none(pte)); 2500 2500 if (unmap_ref_private(mm, vma, old_page, address)) { 2501 - BUG_ON(page_count(old_page) != 1); 2502 2501 BUG_ON(huge_pte_none(pte)); 2503 2502 spin_lock(&mm->page_table_lock); 2504 2503 ptep = huge_pte_offset(mm, address & huge_page_mask(h));
+6
mm/memcontrol.c
··· 4507 4507 swap_buffers: 4508 4508 /* Swap primary and spare array */ 4509 4509 thresholds->spare = thresholds->primary; 4510 + /* If all events are unregistered, free the spare array */ 4511 + if (!new) { 4512 + kfree(thresholds->spare); 4513 + thresholds->spare = NULL; 4514 + } 4515 + 4510 4516 rcu_assign_pointer(thresholds->primary, new); 4511 4517 4512 4518 /* To be sure that nobody uses thresholds */
+1 -2
mm/nobootmem.c
··· 82 82 83 83 static void __init __free_pages_memory(unsigned long start, unsigned long end) 84 84 { 85 - int i; 86 - unsigned long start_aligned, end_aligned; 85 + unsigned long i, start_aligned, end_aligned; 87 86 int order = ilog2(BITS_PER_LONG); 88 87 89 88 start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1);
+1 -1
mm/page_alloc.c
··· 5203 5203 int ret; 5204 5204 5205 5205 ret = proc_dointvec_minmax(table, write, buffer, length, ppos); 5206 - if (!write || (ret == -EINVAL)) 5206 + if (!write || (ret < 0)) 5207 5207 return ret; 5208 5208 for_each_populated_zone(zone) { 5209 5209 for_each_possible_cpu(cpu) {
+17 -5
mm/percpu.c
··· 1132 1132 for (alloc_end += gi->nr_units / upa; 1133 1133 alloc < alloc_end; alloc++) { 1134 1134 if (!(alloc % apl)) { 1135 - printk("\n"); 1135 + printk(KERN_CONT "\n"); 1136 1136 printk("%spcpu-alloc: ", lvl); 1137 1137 } 1138 - printk("[%0*d] ", group_width, group); 1138 + printk(KERN_CONT "[%0*d] ", group_width, group); 1139 1139 1140 1140 for (unit_end += upa; unit < unit_end; unit++) 1141 1141 if (gi->cpu_map[unit] != NR_CPUS) 1142 - printk("%0*d ", cpu_width, 1142 + printk(KERN_CONT "%0*d ", cpu_width, 1143 1143 gi->cpu_map[unit]); 1144 1144 else 1145 - printk("%s ", empty_str); 1145 + printk(KERN_CONT "%s ", empty_str); 1146 1146 } 1147 1147 } 1148 - printk("\n"); 1148 + printk(KERN_CONT "\n"); 1149 1149 } 1150 1150 1151 1151 /** ··· 1650 1650 areas[group] = ptr; 1651 1651 1652 1652 base = min(ptr, base); 1653 + } 1654 + 1655 + /* 1656 + * Copy data and free unused parts. This should happen after all 1657 + * allocations are complete; otherwise, we may end up with 1658 + * overlapping groups. 1659 + */ 1660 + for (group = 0; group < ai->nr_groups; group++) { 1661 + struct pcpu_group_info *gi = &ai->groups[group]; 1662 + void *ptr = areas[group]; 1653 1663 1654 1664 for (i = 0; i < gi->nr_units; i++, ptr += ai->unit_size) { 1655 1665 if (gi->cpu_map[i] == NR_CPUS) { ··· 1895 1885 fc = __alloc_bootmem(unit_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); 1896 1886 if (!ai || !fc) 1897 1887 panic("Failed to allocate memory for percpu areas."); 1888 + /* kmemleak tracks the percpu allocations separately */ 1889 + kmemleak_free(fc); 1898 1890 1899 1891 ai->dyn_size = unit_size; 1900 1892 ai->unit_size = unit_size;
+1 -1
net/8021q/vlan_dev.c
··· 157 157 skb = __vlan_hwaccel_put_tag(skb, vlan_tci); 158 158 } 159 159 160 - skb_set_dev(skb, vlan_dev_priv(dev)->real_dev); 160 + skb->dev = vlan_dev_priv(dev)->real_dev; 161 161 len = skb->len; 162 162 if (netpoll_tx_running(dev)) 163 163 return skb->dev->netdev_ops->ndo_start_xmit(skb, skb->dev);
+1 -1
net/bluetooth/af_bluetooth.c
··· 450 450 sk->sk_state == BT_CONFIG) 451 451 return mask; 452 452 453 - if (sock_writeable(sk)) 453 + if (!bt_sk(sk)->suspended && sock_writeable(sk)) 454 454 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 455 455 else 456 456 set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
+8
net/bluetooth/hci_core.c
··· 2784 2784 if (conn) { 2785 2785 hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF); 2786 2786 2787 + hci_dev_lock(hdev); 2788 + if (test_bit(HCI_MGMT, &hdev->dev_flags) && 2789 + !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) 2790 + mgmt_device_connected(hdev, &conn->dst, conn->type, 2791 + conn->dst_type, 0, NULL, 0, 2792 + conn->dev_class); 2793 + hci_dev_unlock(hdev); 2794 + 2787 2795 /* Send to upper protocol */ 2788 2796 l2cap_recv_acldata(conn, skb, flags); 2789 2797 return;
+9 -2
net/bluetooth/hci_event.c
··· 2039 2039 2040 2040 clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); 2041 2041 2042 + if (ev->status && conn->state == BT_CONNECTED) { 2043 + hci_acl_disconn(conn, 0x13); 2044 + hci_conn_put(conn); 2045 + goto unlock; 2046 + } 2047 + 2042 2048 if (conn->state == BT_CONFIG) { 2043 2049 if (!ev->status) 2044 2050 conn->state = BT_CONNECTED; ··· 2055 2049 hci_encrypt_cfm(conn, ev->status, ev->encrypt); 2056 2050 } 2057 2051 2052 + unlock: 2058 2053 hci_dev_unlock(hdev); 2059 2054 } 2060 2055 ··· 2109 2102 goto unlock; 2110 2103 } 2111 2104 2112 - if (!ev->status) { 2105 + if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { 2113 2106 struct hci_cp_remote_name_req cp; 2114 2107 memset(&cp, 0, sizeof(cp)); 2115 2108 bacpy(&cp.bdaddr, &conn->dst); ··· 2878 2871 if (conn->state != BT_CONFIG) 2879 2872 goto unlock; 2880 2873 2881 - if (!ev->status) { 2874 + if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { 2882 2875 struct hci_cp_remote_name_req cp; 2883 2876 memset(&cp, 0, sizeof(cp)); 2884 2877 bacpy(&cp.bdaddr, &conn->dst);
+5
net/bluetooth/l2cap_core.c
··· 4589 4589 4590 4590 if (!status && (chan->state == BT_CONNECTED || 4591 4591 chan->state == BT_CONFIG)) { 4592 + struct sock *sk = chan->sk; 4593 + 4594 + bt_sk(sk)->suspended = false; 4595 + sk->sk_state_change(sk); 4596 + 4592 4597 l2cap_check_encryption(chan, encrypt); 4593 4598 l2cap_chan_unlock(chan); 4594 4599 continue;
+8 -4
net/bluetooth/l2cap_sock.c
··· 592 592 sk->sk_state = BT_CONFIG; 593 593 chan->state = BT_CONFIG; 594 594 595 - /* or for ACL link, under defer_setup time */ 596 - } else if (sk->sk_state == BT_CONNECT2 && 597 - bt_sk(sk)->defer_setup) { 598 - err = l2cap_chan_check_security(chan); 595 + /* or for ACL link */ 596 + } else if ((sk->sk_state == BT_CONNECT2 && 597 + bt_sk(sk)->defer_setup) || 598 + sk->sk_state == BT_CONNECTED) { 599 + if (!l2cap_chan_check_security(chan)) 600 + bt_sk(sk)->suspended = true; 601 + else 602 + sk->sk_state_change(sk); 599 603 } else { 600 604 err = -EINVAL; 601 605 }
+5 -31
net/core/dev.c
··· 1616 1616 return NET_RX_DROP; 1617 1617 } 1618 1618 skb->skb_iif = 0; 1619 - skb_set_dev(skb, dev); 1619 + skb->dev = dev; 1620 + skb_dst_drop(skb); 1620 1621 skb->tstamp.tv64 = 0; 1621 1622 skb->pkt_type = PACKET_HOST; 1622 1623 skb->protocol = eth_type_trans(skb, dev); 1624 + skb->mark = 0; 1625 + secpath_reset(skb); 1626 + nf_reset(skb); 1623 1627 return netif_rx(skb); 1624 1628 } 1625 1629 EXPORT_SYMBOL_GPL(dev_forward_skb); ··· 1870 1866 } 1871 1867 } 1872 1868 EXPORT_SYMBOL(netif_device_attach); 1873 - 1874 - /** 1875 - * skb_dev_set -- assign a new device to a buffer 1876 - * @skb: buffer for the new device 1877 - * @dev: network device 1878 - * 1879 - * If an skb is owned by a device already, we have to reset 1880 - * all data private to the namespace a device belongs to 1881 - * before assigning it a new device. 1882 - */ 1883 - #ifdef CONFIG_NET_NS 1884 - void skb_set_dev(struct sk_buff *skb, struct net_device *dev) 1885 - { 1886 - skb_dst_drop(skb); 1887 - if (skb->dev && !net_eq(dev_net(skb->dev), dev_net(dev))) { 1888 - secpath_reset(skb); 1889 - nf_reset(skb); 1890 - skb_init_secmark(skb); 1891 - skb->mark = 0; 1892 - skb->priority = 0; 1893 - skb->nf_trace = 0; 1894 - skb->ipvs_property = 0; 1895 - #ifdef CONFIG_NET_SCHED 1896 - skb->tc_index = 0; 1897 - #endif 1898 - } 1899 - skb->dev = dev; 1900 - } 1901 - EXPORT_SYMBOL(skb_set_dev); 1902 - #endif /* CONFIG_NET_NS */ 1903 1869 1904 1870 static void skb_warn_bad_offload(const struct sk_buff *skb) 1905 1871 {
+8 -2
net/core/pktgen.c
··· 1931 1931 { 1932 1932 struct net_device *dev = ptr; 1933 1933 1934 - if (!net_eq(dev_net(dev), &init_net)) 1934 + if (!net_eq(dev_net(dev), &init_net) || pktgen_exiting) 1935 1935 return NOTIFY_DONE; 1936 1936 1937 1937 /* It is OK that we do not hold the group lock right now, ··· 3754 3754 { 3755 3755 struct pktgen_thread *t; 3756 3756 struct list_head *q, *n; 3757 + struct list_head list; 3757 3758 3758 3759 /* Stop all interfaces & threads */ 3759 3760 pktgen_exiting = true; 3760 3761 3761 - list_for_each_safe(q, n, &pktgen_threads) { 3762 + mutex_lock(&pktgen_thread_lock); 3763 + list_splice(&list, &pktgen_threads); 3764 + mutex_unlock(&pktgen_thread_lock); 3765 + 3766 + list_for_each_safe(q, n, &list) { 3762 3767 t = list_entry(q, struct pktgen_thread, th_list); 3768 + list_del(&t->th_list); 3763 3769 kthread_stop(t->tsk); 3764 3770 kfree(t); 3765 3771 }
+2
net/ipv4/fib_trie.c
··· 1370 1370 1371 1371 if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos) 1372 1372 continue; 1373 + if (fi->fib_dead) 1374 + continue; 1373 1375 if (fa->fa_info->fib_scope < flp->flowi4_scope) 1374 1376 continue; 1375 1377 fib_alias_accessed(fa);
+7 -3
net/netfilter/ipset/ip_set_hash_ip.c
··· 368 368 { 369 369 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; 370 370 u8 netmask, hbits; 371 + size_t hsize; 371 372 struct ip_set_hash *h; 372 373 373 374 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) ··· 410 409 h->timeout = IPSET_NO_TIMEOUT; 411 410 412 411 hbits = htable_bits(hashsize); 413 - h->table = ip_set_alloc( 414 - sizeof(struct htable) 415 - + jhash_size(hbits) * sizeof(struct hbucket)); 412 + hsize = htable_size(hbits); 413 + if (hsize == 0) { 414 + kfree(h); 415 + return -ENOMEM; 416 + } 417 + h->table = ip_set_alloc(hsize); 416 418 if (!h->table) { 417 419 kfree(h); 418 420 return -ENOMEM;
+7 -3
net/netfilter/ipset/ip_set_hash_ipport.c
··· 452 452 struct ip_set_hash *h; 453 453 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; 454 454 u8 hbits; 455 + size_t hsize; 455 456 456 457 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) 457 458 return -IPSET_ERR_INVALID_FAMILY; ··· 480 479 h->timeout = IPSET_NO_TIMEOUT; 481 480 482 481 hbits = htable_bits(hashsize); 483 - h->table = ip_set_alloc( 484 - sizeof(struct htable) 485 - + jhash_size(hbits) * sizeof(struct hbucket)); 482 + hsize = htable_size(hbits); 483 + if (hsize == 0) { 484 + kfree(h); 485 + return -ENOMEM; 486 + } 487 + h->table = ip_set_alloc(hsize); 486 488 if (!h->table) { 487 489 kfree(h); 488 490 return -ENOMEM;
+7 -3
net/netfilter/ipset/ip_set_hash_ipportip.c
··· 470 470 struct ip_set_hash *h; 471 471 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; 472 472 u8 hbits; 473 + size_t hsize; 473 474 474 475 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) 475 476 return -IPSET_ERR_INVALID_FAMILY; ··· 498 497 h->timeout = IPSET_NO_TIMEOUT; 499 498 500 499 hbits = htable_bits(hashsize); 501 - h->table = ip_set_alloc( 502 - sizeof(struct htable) 503 - + jhash_size(hbits) * sizeof(struct hbucket)); 500 + hsize = htable_size(hbits); 501 + if (hsize == 0) { 502 + kfree(h); 503 + return -ENOMEM; 504 + } 505 + h->table = ip_set_alloc(hsize); 504 506 if (!h->table) { 505 507 kfree(h); 506 508 return -ENOMEM;
+7 -3
net/netfilter/ipset/ip_set_hash_ipportnet.c
··· 619 619 struct ip_set_hash *h; 620 620 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; 621 621 u8 hbits; 622 + size_t hsize; 622 623 623 624 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) 624 625 return -IPSET_ERR_INVALID_FAMILY; ··· 649 648 h->timeout = IPSET_NO_TIMEOUT; 650 649 651 650 hbits = htable_bits(hashsize); 652 - h->table = ip_set_alloc( 653 - sizeof(struct htable) 654 - + jhash_size(hbits) * sizeof(struct hbucket)); 651 + hsize = htable_size(hbits); 652 + if (hsize == 0) { 653 + kfree(h); 654 + return -ENOMEM; 655 + } 656 + h->table = ip_set_alloc(hsize); 655 657 if (!h->table) { 656 658 kfree(h); 657 659 return -ENOMEM;
+7 -3
net/netfilter/ipset/ip_set_hash_net.c
··· 463 463 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; 464 464 struct ip_set_hash *h; 465 465 u8 hbits; 466 + size_t hsize; 466 467 467 468 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) 468 469 return -IPSET_ERR_INVALID_FAMILY; ··· 493 492 h->timeout = IPSET_NO_TIMEOUT; 494 493 495 494 hbits = htable_bits(hashsize); 496 - h->table = ip_set_alloc( 497 - sizeof(struct htable) 498 - + jhash_size(hbits) * sizeof(struct hbucket)); 495 + hsize = htable_size(hbits); 496 + if (hsize == 0) { 497 + kfree(h); 498 + return -ENOMEM; 499 + } 500 + h->table = ip_set_alloc(hsize); 499 501 if (!h->table) { 500 502 kfree(h); 501 503 return -ENOMEM;
+7 -3
net/netfilter/ipset/ip_set_hash_netiface.c
··· 726 726 struct ip_set_hash *h; 727 727 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; 728 728 u8 hbits; 729 + size_t hsize; 729 730 730 731 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) 731 732 return -IPSET_ERR_INVALID_FAMILY; ··· 757 756 h->ahash_max = AHASH_MAX_SIZE; 758 757 759 758 hbits = htable_bits(hashsize); 760 - h->table = ip_set_alloc( 761 - sizeof(struct htable) 762 - + jhash_size(hbits) * sizeof(struct hbucket)); 759 + hsize = htable_size(hbits); 760 + if (hsize == 0) { 761 + kfree(h); 762 + return -ENOMEM; 763 + } 764 + h->table = ip_set_alloc(hsize); 763 765 if (!h->table) { 764 766 kfree(h); 765 767 return -ENOMEM;
+7 -3
net/netfilter/ipset/ip_set_hash_netport.c
··· 575 575 struct ip_set_hash *h; 576 576 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; 577 577 u8 hbits; 578 + size_t hsize; 578 579 579 580 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) 580 581 return -IPSET_ERR_INVALID_FAMILY; ··· 605 604 h->timeout = IPSET_NO_TIMEOUT; 606 605 607 606 hbits = htable_bits(hashsize); 608 - h->table = ip_set_alloc( 609 - sizeof(struct htable) 610 - + jhash_size(hbits) * sizeof(struct hbucket)); 607 + hsize = htable_size(hbits); 608 + if (hsize == 0) { 609 + kfree(h); 610 + return -ENOMEM; 611 + } 612 + h->table = ip_set_alloc(hsize); 611 613 if (!h->table) { 612 614 kfree(h); 613 615 return -ENOMEM;
+18 -11
net/openvswitch/datapath.c
··· 321 321 return -ENOMEM; 322 322 323 323 nskb = __vlan_put_tag(nskb, vlan_tx_tag_get(nskb)); 324 - if (!skb) 324 + if (!nskb) 325 325 return -ENOMEM; 326 326 327 327 nskb->vlan_tci = 0; ··· 421 421 return validate_actions(actions, key, depth + 1); 422 422 } 423 423 424 + static int validate_tp_port(const struct sw_flow_key *flow_key) 425 + { 426 + if (flow_key->eth.type == htons(ETH_P_IP)) { 427 + if (flow_key->ipv4.tp.src && flow_key->ipv4.tp.dst) 428 + return 0; 429 + } else if (flow_key->eth.type == htons(ETH_P_IPV6)) { 430 + if (flow_key->ipv6.tp.src && flow_key->ipv6.tp.dst) 431 + return 0; 432 + } 433 + 434 + return -EINVAL; 435 + } 436 + 424 437 static int validate_set(const struct nlattr *a, 425 438 const struct sw_flow_key *flow_key) 426 439 { ··· 475 462 if (flow_key->ip.proto != IPPROTO_TCP) 476 463 return -EINVAL; 477 464 478 - if (!flow_key->ipv4.tp.src || !flow_key->ipv4.tp.dst) 479 - return -EINVAL; 480 - 481 - break; 465 + return validate_tp_port(flow_key); 482 466 483 467 case OVS_KEY_ATTR_UDP: 484 468 if (flow_key->ip.proto != IPPROTO_UDP) 485 469 return -EINVAL; 486 470 487 - if (!flow_key->ipv4.tp.src || !flow_key->ipv4.tp.dst) 488 - return -EINVAL; 489 - break; 471 + return validate_tp_port(flow_key); 490 472 491 473 default: 492 474 return -EINVAL; ··· 1655 1647 reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, 1656 1648 OVS_VPORT_CMD_NEW); 1657 1649 if (IS_ERR(reply)) { 1658 - err = PTR_ERR(reply); 1659 1650 netlink_set_err(init_net.genl_sock, 0, 1660 - ovs_dp_vport_multicast_group.id, err); 1661 - return 0; 1651 + ovs_dp_vport_multicast_group.id, PTR_ERR(reply)); 1652 + goto exit_unlock; 1662 1653 } 1663 1654 1664 1655 genl_notify(reply, genl_info_net(info), info->snd_pid,
+2 -1
net/openvswitch/flow.c
··· 183 183 u8 tcp_flags = 0; 184 184 185 185 if (flow->key.eth.type == htons(ETH_P_IP) && 186 - flow->key.ip.proto == IPPROTO_TCP) { 186 + flow->key.ip.proto == IPPROTO_TCP && 187 + likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) { 187 188 u8 *tcp = (u8 *)tcp_hdr(skb); 188 189 tcp_flags = *(tcp + TCP_FLAGS_OFFSET) & TCP_FLAG_MASK; 189 190 }
+1 -3
net/sctp/output.c
··· 377 377 */ 378 378 skb_set_owner_w(nskb, sk); 379 379 380 - /* The 'obsolete' field of dst is set to 2 when a dst is freed. */ 381 - if (!dst || (dst->obsolete > 1)) { 382 - dst_release(dst); 380 + if (!sctp_transport_dst_check(tp)) { 383 381 sctp_transport_route(tp, NULL, sctp_sk(sk)); 384 382 if (asoc && (asoc->param_flags & SPP_PMTUD_ENABLE)) { 385 383 sctp_assoc_sync_pmtu(asoc);
-17
net/sctp/transport.c
··· 226 226 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; 227 227 } 228 228 229 - /* this is a complete rip-off from __sk_dst_check 230 - * the cookie is always 0 since this is how it's used in the 231 - * pmtu code 232 - */ 233 - static struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) 234 - { 235 - struct dst_entry *dst = t->dst; 236 - 237 - if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) { 238 - dst_release(t->dst); 239 - t->dst = NULL; 240 - return NULL; 241 - } 242 - 243 - return dst; 244 - } 245 - 246 229 void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu) 247 230 { 248 231 struct dst_entry *dst;
+4 -3
net/sunrpc/auth_gss/gss_mech_switch.c
··· 242 242 int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr) 243 243 { 244 244 struct gss_api_mech *pos = NULL; 245 - int i = 0; 245 + int j, i = 0; 246 246 247 247 spin_lock(&registered_mechs_lock); 248 248 list_for_each_entry(pos, &registered_mechs, gm_list) { 249 - array_ptr[i] = pos->gm_pfs->pseudoflavor; 250 - i++; 249 + for (j=0; j < pos->gm_pf_num; j++) { 250 + array_ptr[i++] = pos->gm_pfs[j].pseudoflavor; 251 + } 251 252 } 252 253 spin_unlock(&registered_mechs_lock); 253 254 return i;
+1 -1
sound/pci/echoaudio/echoaudio_dsp.c
··· 475 475 const struct firmware *fw; 476 476 int box_type, err; 477 477 478 - if (snd_BUG_ON(!chip->dsp_code_to_load || !chip->comm_page)) 478 + if (snd_BUG_ON(!chip->comm_page)) 479 479 return -EPERM; 480 480 481 481 /* See if the ASIC is present and working - only if the DSP is already loaded */
-4
sound/pci/hda/hda_codec.c
··· 5444 5444 list_for_each_entry(codec, &bus->codec_list, list) { 5445 5445 if (hda_codec_is_power_on(codec)) 5446 5446 hda_call_codec_suspend(codec); 5447 - else /* forcibly change the power to D3 even if not used */ 5448 - hda_set_power_state(codec, 5449 - codec->afg ? codec->afg : codec->mfg, 5450 - AC_PWRST_D3); 5451 5447 if (codec->patch_ops.post_suspend) 5452 5448 codec->patch_ops.post_suspend(codec); 5453 5449 }
+17 -3
sound/pci/hda/hda_intel.c
··· 783 783 { 784 784 struct azx *chip = bus->private_data; 785 785 unsigned long timeout; 786 + unsigned long loopcounter; 786 787 int do_poll = 0; 787 788 788 789 again: 789 790 timeout = jiffies + msecs_to_jiffies(1000); 790 - for (;;) { 791 + 792 + for (loopcounter = 0;; loopcounter++) { 791 793 if (chip->polling_mode || do_poll) { 792 794 spin_lock_irq(&chip->reg_lock); 793 795 azx_update_rirb(chip); ··· 805 803 } 806 804 if (time_after(jiffies, timeout)) 807 805 break; 808 - if (bus->needs_damn_long_delay) 806 + if (bus->needs_damn_long_delay || loopcounter > 3000) 809 807 msleep(2); /* temporary workaround */ 810 808 else { 811 809 udelay(10); ··· 2353 2351 * power management 2354 2352 */ 2355 2353 2354 + static int snd_hda_codecs_inuse(struct hda_bus *bus) 2355 + { 2356 + struct hda_codec *codec; 2357 + 2358 + list_for_each_entry(codec, &bus->codec_list, list) { 2359 + if (snd_hda_codec_needs_resume(codec)) 2360 + return 1; 2361 + } 2362 + return 0; 2363 + } 2364 + 2356 2365 static int azx_suspend(struct pci_dev *pci, pm_message_t state) 2357 2366 { 2358 2367 struct snd_card *card = pci_get_drvdata(pci); ··· 2410 2397 return -EIO; 2411 2398 azx_init_pci(chip); 2412 2399 2413 - azx_init_chip(chip, 1); 2400 + if (snd_hda_codecs_inuse(chip->bus)) 2401 + azx_init_chip(chip, 1); 2414 2402 2415 2403 snd_hda_resume(chip->bus); 2416 2404 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
+10 -6
sound/pci/hda/patch_realtek.c
··· 5405 5405 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", 5406 5406 ALC882_FIXUP_ACER_ASPIRE_4930G), 5407 5407 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), 5408 + SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", 5409 + ALC882_FIXUP_ACER_ASPIRE_4930G), 5408 5410 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), 5409 5411 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), 5410 5412 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), ··· 5440 5438 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), 5441 5439 5442 5440 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), 5441 + SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), 5443 5442 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), 5444 5443 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3", ALC889_FIXUP_CD), 5445 5444 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), ··· 5641 5638 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80); 5642 5639 } 5643 5640 #endif 5644 - alc_auto_parse_customize_define(codec); 5645 - 5646 5641 alc_fix_pll_init(codec, 0x20, 0x0a, 10); 5647 5642 5648 5643 alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups); 5649 5644 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 5645 + 5646 + alc_auto_parse_customize_define(codec); 5650 5647 5651 5648 /* automatic parse from the BIOS config */ 5652 5649 err = alc262_parse_auto_config(codec); ··· 6252 6249 6253 6250 spec->mixer_nid = 0x0b; 6254 6251 6255 - alc_auto_parse_customize_define(codec); 6256 - 6257 6252 err = alc_codec_rename_from_preset(codec); 6258 6253 if (err < 0) 6259 6254 goto error; ··· 6283 6282 alc_pick_fixup(codec, alc269_fixup_models, 6284 6283 alc269_fixup_tbl, alc269_fixups); 6285 6284 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 6285 + 6286 + alc_auto_parse_customize_define(codec); 6286 6287 6287 6288 /* automatic parse from the BIOS config */ 6288 6289 err = alc269_parse_auto_config(codec); ··· 6862 6859 /* handle multiple HPs as is */ 6863 6860 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 6864 6861 6865 - alc_auto_parse_customize_define(codec); 6866 - 6867 6862 alc_fix_pll_init(codec, 0x20, 0x04, 15); 6868 6863 6869 6864 err = alc_codec_rename_from_preset(codec); ··· 6878 6877 alc_pick_fixup(codec, alc662_fixup_models, 6879 6878 alc662_fixup_tbl, alc662_fixups); 6880 6879 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 6880 + 6881 + alc_auto_parse_customize_define(codec); 6882 + 6881 6883 /* automatic parse from the BIOS config */ 6882 6884 err = alc662_parse_auto_config(codec); 6883 6885 if (err < 0)
+3 -3
sound/pci/hda/patch_sigmatel.c
··· 4415 4415 def_conf = get_defcfg_connect(def_conf); 4416 4416 /* skip any ports that don't have jacks since presence 4417 4417 * detection is useless */ 4418 - if (def_conf != AC_JACK_PORT_COMPLEX) { 4419 - if (def_conf != AC_JACK_PORT_NONE) 4420 - stac_toggle_power_map(codec, nid, 1); 4418 + if (def_conf != AC_JACK_PORT_NONE && 4419 + !is_jack_detectable(codec, nid)) { 4420 + stac_toggle_power_map(codec, nid, 1); 4421 4421 continue; 4422 4422 } 4423 4423 if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) {
+1
sound/pci/rme9652/hdsp.c
··· 5170 5170 strcpy(hw->name, "HDSP hwdep interface"); 5171 5171 5172 5172 hw->ops.ioctl = snd_hdsp_hwdep_ioctl; 5173 + hw->ops.ioctl_compat = snd_hdsp_hwdep_ioctl; 5173 5174 5174 5175 return 0; 5175 5176 }
+2
sound/soc/blackfin/bf5xx-ssm2602.c
··· 99 99 .platform_name = "bfin-i2s-pcm-audio", 100 100 .codec_name = "ssm2602.0-001b", 101 101 .ops = &bf5xx_ssm2602_ops, 102 + .dai_fmt = BF5XX_SSM2602_DAIFMT, 102 103 }, 103 104 { 104 105 .name = "ssm2602", ··· 109 108 .platform_name = "bfin-i2s-pcm-audio", 110 109 .codec_name = "ssm2602.0-001b", 111 110 .ops = &bf5xx_ssm2602_ops, 111 + .dai_fmt = BF5XX_SSM2602_DAIFMT, 112 112 }, 113 113 }; 114 114
+8 -8
sound/soc/codecs/cs42l73.c
··· 568 568 attn_tlv), 569 569 570 570 SOC_SINGLE_TLV("SPK-IP Mono Volume", 571 - CS42L73_SPKMIPMA, 0, 0x3E, 1, attn_tlv), 571 + CS42L73_SPKMIPMA, 0, 0x3F, 1, attn_tlv), 572 572 SOC_SINGLE_TLV("SPK-XSP Mono Volume", 573 - CS42L73_SPKMXSPA, 0, 0x3E, 1, attn_tlv), 573 + CS42L73_SPKMXSPA, 0, 0x3F, 1, attn_tlv), 574 574 SOC_SINGLE_TLV("SPK-ASP Mono Volume", 575 - CS42L73_SPKMASPA, 0, 0x3E, 1, attn_tlv), 575 + CS42L73_SPKMASPA, 0, 0x3F, 1, attn_tlv), 576 576 SOC_SINGLE_TLV("SPK-VSP Mono Volume", 577 - CS42L73_SPKMVSPMA, 0, 0x3E, 1, attn_tlv), 577 + CS42L73_SPKMVSPMA, 0, 0x3F, 1, attn_tlv), 578 578 579 579 SOC_SINGLE_TLV("ESL-IP Mono Volume", 580 - CS42L73_ESLMIPMA, 0, 0x3E, 1, attn_tlv), 580 + CS42L73_ESLMIPMA, 0, 0x3F, 1, attn_tlv), 581 581 SOC_SINGLE_TLV("ESL-XSP Mono Volume", 582 - CS42L73_ESLMXSPA, 0, 0x3E, 1, attn_tlv), 582 + CS42L73_ESLMXSPA, 0, 0x3F, 1, attn_tlv), 583 583 SOC_SINGLE_TLV("ESL-ASP Mono Volume", 584 - CS42L73_ESLMASPA, 0, 0x3E, 1, attn_tlv), 584 + CS42L73_ESLMASPA, 0, 0x3F, 1, attn_tlv), 585 585 SOC_SINGLE_TLV("ESL-VSP Mono Volume", 586 - CS42L73_ESLMVSPMA, 0, 0x3E, 1, attn_tlv), 586 + CS42L73_ESLMVSPMA, 0, 0x3F, 1, attn_tlv), 587 587 588 588 SOC_ENUM("IP Digital Swap/Mono Select", ip_swap_enum), 589 589
+2 -2
sound/soc/codecs/tlv320aic23.c
··· 472 472 static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec, 473 473 enum snd_soc_bias_level level) 474 474 { 475 - u16 reg = snd_soc_read(codec, TLV320AIC23_PWR) & 0xff7f; 475 + u16 reg = snd_soc_read(codec, TLV320AIC23_PWR) & 0x17f; 476 476 477 477 switch (level) { 478 478 case SND_SOC_BIAS_ON: ··· 491 491 case SND_SOC_BIAS_OFF: 492 492 /* everything off, dac mute, inactive */ 493 493 snd_soc_write(codec, TLV320AIC23_ACTIVE, 0x0); 494 - snd_soc_write(codec, TLV320AIC23_PWR, 0xffff); 494 + snd_soc_write(codec, TLV320AIC23_PWR, 0x1ff); 495 495 break; 496 496 } 497 497 codec->dapm.bias_level = level;
+6 -5
sound/soc/codecs/wm8350.c
··· 60 60 }; 61 61 62 62 struct wm8350_data { 63 - struct snd_soc_codec codec; 63 + struct wm8350 *wm8350; 64 64 struct wm8350_output out1; 65 65 struct wm8350_output out2; 66 66 struct wm8350_jack_data hpl; ··· 1309 1309 struct wm8350_jack_data *jack, 1310 1310 u16 mask) 1311 1311 { 1312 - struct wm8350 *wm8350 = priv->codec.control_data; 1312 + struct wm8350 *wm8350 = priv->wm8350; 1313 1313 u16 reg; 1314 1314 int report; 1315 1315 ··· 1342 1342 static irqreturn_t wm8350_hp_jack_handler(int irq, void *data) 1343 1343 { 1344 1344 struct wm8350_data *priv = data; 1345 - struct wm8350 *wm8350 = priv->codec.control_data; 1345 + struct wm8350 *wm8350 = priv->wm8350; 1346 1346 struct wm8350_jack_data *jack = NULL; 1347 1347 1348 1348 switch (irq - wm8350->irq_base) { ··· 1427 1427 static irqreturn_t wm8350_mic_handler(int irq, void *data) 1428 1428 { 1429 1429 struct wm8350_data *priv = data; 1430 - struct wm8350 *wm8350 = priv->codec.control_data; 1430 + struct wm8350 *wm8350 = priv->wm8350; 1431 1431 u16 reg; 1432 1432 int report = 0; 1433 1433 ··· 1536 1536 return -ENOMEM; 1537 1537 snd_soc_codec_set_drvdata(codec, priv); 1538 1538 1539 + priv->wm8350 = wm8350; 1540 + 1539 1541 for (i = 0; i < ARRAY_SIZE(supply_names); i++) 1540 1542 priv->supplies[i].supply = supply_names[i]; 1541 1543 ··· 1546 1544 if (ret != 0) 1547 1545 return ret; 1548 1546 1549 - wm8350->codec.codec = codec; 1550 1547 codec->control_data = wm8350; 1551 1548 1552 1549 /* Put the codec into reset if it wasn't already */
+1 -1
sound/soc/codecs/wm8994.c
··· 1144 1144 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 1145 1145 WM8994_AIF2DACL_ENA | 1146 1146 WM8994_AIF2DACR_ENA, 0); 1147 - snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 1147 + snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4, 1148 1148 WM8994_AIF2ADCL_ENA | 1149 1149 WM8994_AIF2ADCR_ENA, 0); 1150 1150
+9 -6
sound/soc/codecs/wm_hubs.c
··· 1035 1035 enum snd_soc_bias_level level) 1036 1036 { 1037 1037 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); 1038 - int val; 1038 + int mask, val; 1039 1039 1040 1040 switch (level) { 1041 1041 case SND_SOC_BIAS_STANDBY: ··· 1047 1047 case SND_SOC_BIAS_ON: 1048 1048 /* Turn off any unneded single ended outputs */ 1049 1049 val = 0; 1050 + mask = 0; 1051 + 1052 + if (hubs->lineout1_se) 1053 + mask |= WM8993_LINEOUT1N_ENA | WM8993_LINEOUT1P_ENA; 1054 + 1055 + if (hubs->lineout2_se) 1056 + mask |= WM8993_LINEOUT2N_ENA | WM8993_LINEOUT2P_ENA; 1050 1057 1051 1058 if (hubs->lineout1_se && hubs->lineout1n_ena) 1052 1059 val |= WM8993_LINEOUT1N_ENA; ··· 1068 1061 val |= WM8993_LINEOUT2P_ENA; 1069 1062 1070 1063 snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_3, 1071 - WM8993_LINEOUT1N_ENA | 1072 - WM8993_LINEOUT1P_ENA | 1073 - WM8993_LINEOUT2N_ENA | 1074 - WM8993_LINEOUT2P_ENA, 1075 - val); 1064 + mask, val); 1076 1065 1077 1066 /* Remove the input clamps */ 1078 1067 snd_soc_update_bits(codec, WM8993_INPUTS_CLAMP_REG,
+4
sound/soc/omap/omap-pcm.c
··· 401 401 } 402 402 403 403 out: 404 + /* free preallocated buffers in case of error */ 405 + if (ret) 406 + omap_pcm_free_dma_buffers(pcm); 407 + 404 408 return ret; 405 409 } 406 410
+1 -1
sound/soc/samsung/s3c2412-i2s.c
··· 166 166 167 167 static __devinit int s3c2412_iis_dev_probe(struct platform_device *pdev) 168 168 { 169 - return snd_soc_register_dai(&pdev->dev, &s3c2412_i2s_dai); 169 + return s3c_i2sv2_register_dai(&pdev->dev, -1, &s3c2412_i2s_dai); 170 170 } 171 171 172 172 static __devexit int s3c2412_iis_dev_remove(struct platform_device *pdev)
+1 -1
sound/soc/sh/migor.c
··· 35 35 return codec_freq; 36 36 } 37 37 38 - static struct clk_ops siumckb_clk_ops = { 38 + static struct sh_clk_ops siumckb_clk_ops = { 39 39 .recalc = siumckb_recalc, 40 40 }; 41 41
+3 -3
sound/soc/soc-core.c
··· 3625 3625 int i, ret; 3626 3626 3627 3627 num_routes = of_property_count_strings(np, propname); 3628 - if (num_routes & 1) { 3628 + if (num_routes < 0 || num_routes & 1) { 3629 3629 dev_err(card->dev, 3630 - "Property '%s's length is not even\n", 3631 - propname); 3630 + "Property '%s' does not exist or its length is not even\n", 3631 + propname); 3632 3632 return -EINVAL; 3633 3633 } 3634 3634 num_routes /= 2;