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

Merge commit 'v3.3-rc6'

Merge v3.3-rc6 to get the latest DSS and OMAP arch fixes.

Conflicts:
arch/arm/mach-omap1/board-innovator.c
drivers/video/omap2/dss/apply.c

+2852 -1713
+6 -9
MAINTAINERS
··· 269 269 F: drivers/platform/x86/wmi.c 270 270 271 271 AD1889 ALSA SOUND DRIVER 272 - M: Kyle McMartin <kyle@mcmartin.ca> 273 272 M: Thibaut Varene <T-Bone@parisc-linux.org> 274 273 W: http://wiki.parisc-linux.org/AD1889 275 274 L: linux-parisc@vger.kernel.org ··· 3046 3047 F: include/linux/hwspinlock.h 3047 3048 3048 3049 HARMONY SOUND DRIVER 3049 - M: Kyle McMartin <kyle@mcmartin.ca> 3050 3050 L: linux-parisc@vger.kernel.org 3051 3051 S: Maintained 3052 3052 F: sound/parisc/harmony.* ··· 3780 3782 3781 3783 KERNEL AUTOMOUNTER v4 (AUTOFS4) 3782 3784 M: Ian Kent <raven@themaw.net> 3783 - L: autofs@linux.kernel.org 3785 + L: autofs@vger.kernel.org 3784 3786 S: Maintained 3785 3787 F: fs/autofs4/ 3786 3788 ··· 4685 4687 M: Anton Altaparmakov <anton@tuxera.com> 4686 4688 L: linux-ntfs-dev@lists.sourceforge.net 4687 4689 W: http://www.tuxera.com/ 4688 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git 4690 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs.git 4689 4691 S: Supported 4690 4692 F: Documentation/filesystems/ntfs.txt 4691 4693 F: fs/ntfs/ ··· 4998 5000 F: drivers/block/paride/ 4999 5001 5000 5002 PARISC ARCHITECTURE 5001 - M: Kyle McMartin <kyle@mcmartin.ca> 5002 - M: Helge Deller <deller@gmx.de> 5003 5003 M: "James E.J. Bottomley" <jejb@parisc-linux.org> 5004 + M: Helge Deller <deller@gmx.de> 5004 5005 L: linux-parisc@vger.kernel.org 5005 5006 W: http://www.parisc-linux.org/ 5006 5007 Q: http://patchwork.kernel.org/project/linux-parisc/list/ ··· 5858 5861 F: drivers/mmc/host/sdhci-spear.c 5859 5862 5860 5863 SECURITY SUBSYSTEM 5861 - M: James Morris <jmorris@namei.org> 5864 + M: James Morris <james.l.morris@oracle.com> 5862 5865 L: linux-security-module@vger.kernel.org (suggested Cc:) 5863 5866 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git 5864 5867 W: http://security.wiki.kernel.org/ ··· 5871 5874 5872 5875 SELINUX SECURITY MODULE 5873 5876 M: Stephen Smalley <sds@tycho.nsa.gov> 5874 - M: James Morris <jmorris@namei.org> 5877 + M: James Morris <james.l.morris@oracle.com> 5875 5878 M: Eric Paris <eparis@parisplace.org> 5876 5879 L: selinux@tycho.nsa.gov (subscribers-only, general discussion) 5877 5880 W: http://selinuxproject.org ··· 7271 7274 M: Wim Van Sebroeck <wim@iguana.be> 7272 7275 L: linux-watchdog@vger.kernel.org 7273 7276 W: http://www.linux-watchdog.org/ 7274 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git 7277 + T: git git://www.linux-watchdog.org/linux-watchdog.git 7275 7278 S: Maintained 7276 7279 F: Documentation/watchdog/ 7277 7280 F: drivers/watchdog/
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 3 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc4 4 + EXTRAVERSION = -rc6 5 5 NAME = Saber-toothed Squirrel 6 6 7 7 # *DOCUMENTATION*
-7
arch/arm/common/it8152.c
··· 320 320 return -EBUSY; 321 321 } 322 322 323 - /* 324 - * If we set up a device for bus mastering, we need to check the latency 325 - * timer as we don't have even crappy BIOSes to set it properly. 326 - * The implementation is from arch/i386/pci/i386.c 327 - */ 328 - unsigned int pcibios_max_latency = 255; 329 - 330 323 /* ITE bridge requires setting latency timer to avoid early bus access 331 324 termination by PCI bus master devices 332 325 */
+2 -1
arch/arm/common/pl330.c
··· 1502 1502 struct pl330_thread *thrd = ch_id; 1503 1503 struct pl330_dmac *pl330; 1504 1504 unsigned long flags; 1505 - int ret = 0, active = thrd->req_running; 1505 + int ret = 0, active; 1506 1506 1507 1507 if (!thrd || thrd->free || thrd->dmac->state == DYING) 1508 1508 return -EINVAL; 1509 1509 1510 1510 pl330 = thrd->dmac; 1511 + active = thrd->req_running; 1511 1512 1512 1513 spin_lock_irqsave(&pl330->lock, flags); 1513 1514
+5
arch/arm/include/asm/assembler.h
··· 137 137 disable_irq 138 138 .endm 139 139 140 + .macro save_and_disable_irqs_notrace, oldcpsr 141 + mrs \oldcpsr, cpsr 142 + disable_irq_notrace 143 + .endm 144 + 140 145 /* 141 146 * Restore interrupt state previously stored in a register. We don't 142 147 * guarantee that this will preserve the flags.
+1 -1
arch/arm/include/asm/hardware/pl330.h
··· 41 41 DCCTRL1, /* Bufferable only */ 42 42 DCCTRL2, /* Cacheable, but do not allocate */ 43 43 DCCTRL3, /* Cacheable and bufferable, but do not allocate */ 44 - DINVALID1 = 8, 44 + DINVALID1, /* AWCACHE = 0x1000 */ 45 45 DINVALID2, 46 46 DCCTRL6, /* Cacheable write-through, allocate on writes only */ 47 47 DCCTRL7, /* Cacheable write-back, allocate on writes only */
+1
arch/arm/include/asm/processor.h
··· 22 22 #include <asm/hw_breakpoint.h> 23 23 #include <asm/ptrace.h> 24 24 #include <asm/types.h> 25 + #include <asm/system.h> 25 26 26 27 #ifdef __KERNEL__ 27 28 #define STACK_TOP ((current->personality & ADDR_LIMIT_32BIT) ? \
+8 -1
arch/arm/kernel/ptrace.c
··· 23 23 #include <linux/perf_event.h> 24 24 #include <linux/hw_breakpoint.h> 25 25 #include <linux/regset.h> 26 + #include <linux/audit.h> 26 27 27 28 #include <asm/pgtable.h> 28 29 #include <asm/system.h> ··· 905 904 return ret; 906 905 } 907 906 907 + #ifdef __ARMEB__ 908 + #define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB 909 + #else 910 + #define AUDIT_ARCH_NR AUDIT_ARCH_ARM 911 + #endif 912 + 908 913 asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) 909 914 { 910 915 unsigned long ip; ··· 925 918 if (!ip) 926 919 audit_syscall_exit(regs); 927 920 else 928 - audit_syscall_entry(AUDIT_ARCH_ARMEB, scno, regs->ARM_r0, 921 + audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0, 929 922 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); 930 923 931 924 if (!test_thread_flag(TIF_SYSCALL_TRACE))
+1 -1
arch/arm/kernel/smp_twd.c
··· 129 129 130 130 static int twd_cpufreq_init(void) 131 131 { 132 - if (!IS_ERR(twd_clk)) 132 + if (twd_evt && *__this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk)) 133 133 return cpufreq_register_notifier(&twd_cpufreq_nb, 134 134 CPUFREQ_TRANSITION_NOTIFIER); 135 135
+1 -1
arch/arm/mach-lpc32xx/include/mach/irqs.h
··· 61 61 */ 62 62 #define IRQ_LPC32XX_JTAG_COMM_TX LPC32XX_SIC1_IRQ(1) 63 63 #define IRQ_LPC32XX_JTAG_COMM_RX LPC32XX_SIC1_IRQ(2) 64 - #define IRQ_LPC32XX_GPI_11 LPC32XX_SIC1_IRQ(4) 64 + #define IRQ_LPC32XX_GPI_28 LPC32XX_SIC1_IRQ(4) 65 65 #define IRQ_LPC32XX_TS_P LPC32XX_SIC1_IRQ(6) 66 66 #define IRQ_LPC32XX_TS_IRQ LPC32XX_SIC1_IRQ(7) 67 67 #define IRQ_LPC32XX_TS_AUX LPC32XX_SIC1_IRQ(8)
+20 -5
arch/arm/mach-lpc32xx/irq.c
··· 118 118 .event_group = &lpc32xx_event_pin_regs, 119 119 .mask = LPC32XX_CLKPWR_EXTSRC_GPI_06_BIT, 120 120 }, 121 + [IRQ_LPC32XX_GPI_28] = { 122 + .event_group = &lpc32xx_event_pin_regs, 123 + .mask = LPC32XX_CLKPWR_EXTSRC_GPI_28_BIT, 124 + }, 121 125 [IRQ_LPC32XX_GPIO_00] = { 122 126 .event_group = &lpc32xx_event_int_regs, 123 127 .mask = LPC32XX_CLKPWR_INTSRC_GPIO_00_BIT, ··· 309 305 310 306 if (state) 311 307 eventreg |= lpc32xx_events[d->irq].mask; 312 - else 308 + else { 313 309 eventreg &= ~lpc32xx_events[d->irq].mask; 310 + 311 + /* 312 + * When disabling the wakeup, clear the latched 313 + * event 314 + */ 315 + __raw_writel(lpc32xx_events[d->irq].mask, 316 + lpc32xx_events[d->irq]. 317 + event_group->rawstat_reg); 318 + } 314 319 315 320 __raw_writel(eventreg, 316 321 lpc32xx_events[d->irq].event_group->enab_reg); ··· 393 380 394 381 /* Setup SIC1 */ 395 382 __raw_writel(0, LPC32XX_INTC_MASK(LPC32XX_SIC1_BASE)); 396 - __raw_writel(MIC_APR_DEFAULT, LPC32XX_INTC_POLAR(LPC32XX_SIC1_BASE)); 397 - __raw_writel(MIC_ATR_DEFAULT, LPC32XX_INTC_ACT_TYPE(LPC32XX_SIC1_BASE)); 383 + __raw_writel(SIC1_APR_DEFAULT, LPC32XX_INTC_POLAR(LPC32XX_SIC1_BASE)); 384 + __raw_writel(SIC1_ATR_DEFAULT, 385 + LPC32XX_INTC_ACT_TYPE(LPC32XX_SIC1_BASE)); 398 386 399 387 /* Setup SIC2 */ 400 388 __raw_writel(0, LPC32XX_INTC_MASK(LPC32XX_SIC2_BASE)); 401 - __raw_writel(MIC_APR_DEFAULT, LPC32XX_INTC_POLAR(LPC32XX_SIC2_BASE)); 402 - __raw_writel(MIC_ATR_DEFAULT, LPC32XX_INTC_ACT_TYPE(LPC32XX_SIC2_BASE)); 389 + __raw_writel(SIC2_APR_DEFAULT, LPC32XX_INTC_POLAR(LPC32XX_SIC2_BASE)); 390 + __raw_writel(SIC2_ATR_DEFAULT, 391 + LPC32XX_INTC_ACT_TYPE(LPC32XX_SIC2_BASE)); 403 392 404 393 /* Configure supported IRQ's */ 405 394 for (i = 0; i < NR_IRQS; i++) {
+19 -1
arch/arm/mach-lpc32xx/serial.c
··· 88 88 char *uart_ck_name; 89 89 u32 ck_mode_mask; 90 90 void __iomem *pdiv_clk_reg; 91 + resource_size_t mapbase; 91 92 }; 92 93 93 94 static struct uartinit uartinit_data[] __initdata = { ··· 98 97 .ck_mode_mask = 99 98 LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 5), 100 99 .pdiv_clk_reg = LPC32XX_CLKPWR_UART5_CLK_CTRL, 100 + .mapbase = LPC32XX_UART5_BASE, 101 101 }, 102 102 #endif 103 103 #ifdef CONFIG_ARCH_LPC32XX_UART3_SELECT ··· 107 105 .ck_mode_mask = 108 106 LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 3), 109 107 .pdiv_clk_reg = LPC32XX_CLKPWR_UART3_CLK_CTRL, 108 + .mapbase = LPC32XX_UART3_BASE, 110 109 }, 111 110 #endif 112 111 #ifdef CONFIG_ARCH_LPC32XX_UART4_SELECT ··· 116 113 .ck_mode_mask = 117 114 LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 4), 118 115 .pdiv_clk_reg = LPC32XX_CLKPWR_UART4_CLK_CTRL, 116 + .mapbase = LPC32XX_UART4_BASE, 119 117 }, 120 118 #endif 121 119 #ifdef CONFIG_ARCH_LPC32XX_UART6_SELECT ··· 125 121 .ck_mode_mask = 126 122 LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 6), 127 123 .pdiv_clk_reg = LPC32XX_CLKPWR_UART6_CLK_CTRL, 124 + .mapbase = LPC32XX_UART6_BASE, 128 125 }, 129 126 #endif 130 127 }; ··· 170 165 171 166 /* pre-UART clock divider set to 1 */ 172 167 __raw_writel(0x0101, uartinit_data[i].pdiv_clk_reg); 168 + 169 + /* 170 + * Force a flush of the RX FIFOs to work around a 171 + * HW bug 172 + */ 173 + puart = uartinit_data[i].mapbase; 174 + __raw_writel(0xC1, LPC32XX_UART_IIR_FCR(puart)); 175 + __raw_writel(0x00, LPC32XX_UART_DLL_FIFO(puart)); 176 + j = LPC32XX_SUART_FIFO_SIZE; 177 + while (j--) 178 + tmp = __raw_readl( 179 + LPC32XX_UART_DLL_FIFO(puart)); 180 + __raw_writel(0, LPC32XX_UART_IIR_FCR(puart)); 173 181 } 174 182 175 183 /* This needs to be done after all UART clocks are setup */ 176 184 __raw_writel(clkmodes, LPC32XX_UARTCTL_CLKMODE); 177 - for (i = 0; i < ARRAY_SIZE(uartinit_data) - 1; i++) { 185 + for (i = 0; i < ARRAY_SIZE(uartinit_data); i++) { 178 186 /* Force a flush of the RX FIFOs to work around a HW bug */ 179 187 puart = serial_std_platform_data[i].mapbase; 180 188 __raw_writel(0xC1, LPC32XX_UART_IIR_FCR(puart));
-1
arch/arm/mach-mmp/aspenite.c
··· 17 17 #include <linux/mtd/partitions.h> 18 18 #include <linux/mtd/nand.h> 19 19 #include <linux/interrupt.h> 20 - #include <linux/gpio.h> 21 20 22 21 #include <asm/mach-types.h> 23 22 #include <asm/mach/arch.h>
-1
arch/arm/mach-mmp/pxa168.c
··· 24 24 #include <mach/dma.h> 25 25 #include <mach/devices.h> 26 26 #include <mach/mfp.h> 27 - #include <linux/platform_device.h> 28 27 #include <linux/dma-mapping.h> 29 28 #include <mach/pxa168.h> 30 29
-1
arch/arm/mach-mmp/tavorevb.c
··· 12 12 #include <linux/kernel.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/smc91x.h> 15 - #include <linux/gpio.h> 16 15 17 16 #include <asm/mach-types.h> 18 17 #include <asm/mach/arch.h>
+2 -2
arch/arm/mach-omap2/Kconfig
··· 364 364 going on could result in system crashes; 365 365 366 366 config OMAP4_ERRATA_I688 367 - bool "OMAP4 errata: Async Bridge Corruption (BROKEN)" 368 - depends on ARCH_OMAP4 && BROKEN 367 + bool "OMAP4 errata: Async Bridge Corruption" 368 + depends on ARCH_OMAP4 369 369 select ARCH_HAS_BARRIERS 370 370 help 371 371 If a data is stalled inside asynchronous bridge because of back
+4
arch/arm/mach-omap2/board-n8x0.c
··· 371 371 else 372 372 *openp = 0; 373 373 374 + #ifdef CONFIG_MMC_OMAP 374 375 omap_mmc_notify_cover_event(mmc_device, index, *openp); 376 + #else 377 + pr_warn("MMC: notify cover event not available\n"); 378 + #endif 375 379 } 376 380 377 381 static int n8x0_mmc_late_init(struct device *dev)
+1 -1
arch/arm/mach-omap2/board-omap3evm.c
··· 381 381 gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI"); 382 382 383 383 /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ 384 - gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; 384 + gpio_leds[0].gpio = gpio + TWL4030_GPIO_MAX + 1; 385 385 386 386 platform_device_register(&leds_gpio); 387 387
+1
arch/arm/mach-omap2/common.h
··· 132 132 void am33xx_map_io(void); 133 133 void omap4_map_io(void); 134 134 void ti81xx_map_io(void); 135 + void omap_barriers_init(void); 135 136 136 137 /** 137 138 * omap_test_timeout - busy-loop, testing a condition
+2 -3
arch/arm/mach-omap2/cpuidle44xx.c
··· 65 65 struct timespec ts_preidle, ts_postidle, ts_idle; 66 66 u32 cpu1_state; 67 67 int idle_time; 68 - int new_state_idx; 69 68 int cpu_id = smp_processor_id(); 70 69 71 70 /* Used to keep track of the total time in idle */ ··· 83 84 */ 84 85 cpu1_state = pwrdm_read_pwrst(cpu1_pd); 85 86 if (cpu1_state != PWRDM_POWER_OFF) { 86 - new_state_idx = drv->safe_state_index; 87 - cx = cpuidle_get_statedata(&dev->states_usage[new_state_idx]); 87 + index = drv->safe_state_index; 88 + cx = cpuidle_get_statedata(&dev->states_usage[index]); 88 89 } 89 90 90 91 if (index > 0)
+52
arch/arm/mach-omap2/gpmc-smsc911x.c
··· 19 19 #include <linux/interrupt.h> 20 20 #include <linux/io.h> 21 21 #include <linux/smsc911x.h> 22 + #include <linux/regulator/fixed.h> 23 + #include <linux/regulator/machine.h> 22 24 23 25 #include <plat/board.h> 24 26 #include <plat/gpmc.h> ··· 44 42 .flags = SMSC911X_USE_16BIT, 45 43 }; 46 44 45 + static struct regulator_consumer_supply gpmc_smsc911x_supply[] = { 46 + REGULATOR_SUPPLY("vddvario", "smsc911x.0"), 47 + REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), 48 + }; 49 + 50 + /* Generic regulator definition to satisfy smsc911x */ 51 + static struct regulator_init_data gpmc_smsc911x_reg_init_data = { 52 + .constraints = { 53 + .min_uV = 3300000, 54 + .max_uV = 3300000, 55 + .valid_modes_mask = REGULATOR_MODE_NORMAL 56 + | REGULATOR_MODE_STANDBY, 57 + .valid_ops_mask = REGULATOR_CHANGE_MODE 58 + | REGULATOR_CHANGE_STATUS, 59 + }, 60 + .num_consumer_supplies = ARRAY_SIZE(gpmc_smsc911x_supply), 61 + .consumer_supplies = gpmc_smsc911x_supply, 62 + }; 63 + 64 + static struct fixed_voltage_config gpmc_smsc911x_fixed_reg_data = { 65 + .supply_name = "gpmc_smsc911x", 66 + .microvolts = 3300000, 67 + .gpio = -EINVAL, 68 + .startup_delay = 0, 69 + .enable_high = 0, 70 + .enabled_at_boot = 1, 71 + .init_data = &gpmc_smsc911x_reg_init_data, 72 + }; 73 + 74 + /* 75 + * Platform device id of 42 is a temporary fix to avoid conflicts 76 + * with other reg-fixed-voltage devices. The real fix should 77 + * involve the driver core providing a way of dynamically 78 + * assigning a unique id on registration for platform devices 79 + * in the same name space. 80 + */ 81 + static struct platform_device gpmc_smsc911x_regulator = { 82 + .name = "reg-fixed-voltage", 83 + .id = 42, 84 + .dev = { 85 + .platform_data = &gpmc_smsc911x_fixed_reg_data, 86 + }, 87 + }; 88 + 47 89 /* 48 90 * Initialize smsc911x device connected to the GPMC. Note that we 49 91 * assume that pin multiplexing is done in the board-*.c file, ··· 100 54 int ret; 101 55 102 56 gpmc_cfg = board_data; 57 + 58 + ret = platform_device_register(&gpmc_smsc911x_regulator); 59 + if (ret < 0) { 60 + pr_err("Unable to register smsc911x regulators: %d\n", ret); 61 + return; 62 + } 103 63 104 64 if (gpmc_cs_request(gpmc_cfg->cs, SZ_16M, &cs_mem_base) < 0) { 105 65 pr_err("Failed to request GPMC mem region\n");
+6
arch/arm/mach-omap2/hsmmc.c
··· 428 428 return 0; 429 429 } 430 430 431 + static int omap_hsmmc_done; 431 432 #define MAX_OMAP_MMC_HWMOD_NAME_LEN 16 432 433 433 434 void omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr) ··· 491 490 void omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) 492 491 { 493 492 u32 reg; 493 + 494 + if (omap_hsmmc_done) 495 + return; 496 + 497 + omap_hsmmc_done = 1; 494 498 495 499 if (!cpu_is_omap44xx()) { 496 500 if (cpu_is_omap2430()) {
+1
arch/arm/mach-omap2/io.c
··· 306 306 void __init omap44xx_map_common_io(void) 307 307 { 308 308 iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc)); 309 + omap_barriers_init(); 309 310 } 310 311 #endif 311 312
+11 -2
arch/arm/mach-omap2/mailbox.c
··· 281 281 .ops = &omap2_mbox_ops, 282 282 .priv = &omap2_mbox_iva_priv, 283 283 }; 284 + #endif 284 285 285 - struct omap_mbox *omap2_mboxes[] = { &mbox_dsp_info, &mbox_iva_info, NULL }; 286 + #ifdef CONFIG_ARCH_OMAP2 287 + struct omap_mbox *omap2_mboxes[] = { 288 + &mbox_dsp_info, 289 + #ifdef CONFIG_SOC_OMAP2420 290 + &mbox_iva_info, 291 + #endif 292 + NULL 293 + }; 286 294 #endif 287 295 288 296 #if defined(CONFIG_ARCH_OMAP4) ··· 420 412 platform_driver_unregister(&omap2_mbox_driver); 421 413 } 422 414 423 - module_init(omap2_mbox_init); 415 + /* must be ready before omap3isp is probed */ 416 + subsys_initcall(omap2_mbox_init); 424 417 module_exit(omap2_mbox_exit); 425 418 426 419 MODULE_LICENSE("GPL v2");
+1 -1
arch/arm/mach-omap2/mux.c
··· 218 218 return -ENODEV; 219 219 } 220 220 221 - static int __init 221 + static int 222 222 omap_mux_get_by_name(const char *muxname, 223 223 struct omap_mux_partition **found_partition, 224 224 struct omap_mux **found_mux)
+16 -9
arch/arm/mach-omap2/omap4-common.c
··· 24 24 25 25 #include <plat/irqs.h> 26 26 #include <plat/sram.h> 27 + #include <plat/omap-secure.h> 27 28 28 29 #include <mach/hardware.h> 29 30 #include <mach/omap-wakeupgen.h> ··· 44 43 45 44 void __iomem *dram_sync, *sram_sync; 46 45 46 + static phys_addr_t paddr; 47 + static u32 size; 48 + 47 49 void omap_bus_sync(void) 48 50 { 49 51 if (dram_sync && sram_sync) { ··· 56 52 } 57 53 } 58 54 59 - static int __init omap_barriers_init(void) 55 + /* Steal one page physical memory for barrier implementation */ 56 + int __init omap_barrier_reserve_memblock(void) 60 57 { 61 - struct map_desc dram_io_desc[1]; 62 - phys_addr_t paddr; 63 - u32 size; 64 - 65 - if (!cpu_is_omap44xx()) 66 - return -ENODEV; 67 58 68 59 size = ALIGN(PAGE_SIZE, SZ_1M); 69 60 paddr = arm_memblock_steal(size, SZ_1M); 61 + 62 + return 0; 63 + } 64 + 65 + void __init omap_barriers_init(void) 66 + { 67 + struct map_desc dram_io_desc[1]; 70 68 71 69 dram_io_desc[0].virtual = OMAP4_DRAM_BARRIER_VA; 72 70 dram_io_desc[0].pfn = __phys_to_pfn(paddr); ··· 81 75 pr_info("OMAP4: Map 0x%08llx to 0x%08lx for dram barrier\n", 82 76 (long long) paddr, dram_io_desc[0].virtual); 83 77 84 - return 0; 85 78 } 86 - core_initcall(omap_barriers_init); 79 + #else 80 + void __init omap_barriers_init(void) 81 + {} 87 82 #endif 88 83 89 84 void __init gic_init_irq(void)
+3
arch/arm/mach-omap2/pm.c
··· 174 174 freq = clk->rate; 175 175 clk_put(clk); 176 176 177 + rcu_read_lock(); 177 178 opp = opp_find_freq_ceil(dev, &freq); 178 179 if (IS_ERR(opp)) { 180 + rcu_read_unlock(); 179 181 pr_err("%s: unable to find boot up OPP for vdd_%s\n", 180 182 __func__, vdd_name); 181 183 goto exit; 182 184 } 183 185 184 186 bootup_volt = opp_get_voltage(opp); 187 + rcu_read_unlock(); 185 188 if (!bootup_volt) { 186 189 pr_err("%s: unable to find voltage corresponding " 187 190 "to the bootup OPP for vdd_%s\n", __func__, vdd_name);
+3 -3
arch/arm/mach-omap2/usb-host.c
··· 486 486 void __init usbhs_init(const struct usbhs_omap_board_data *pdata) 487 487 { 488 488 struct omap_hwmod *oh[2]; 489 - struct omap_device *od; 489 + struct platform_device *pdev; 490 490 int bus_id = -1; 491 491 int i; 492 492 ··· 522 522 return; 523 523 } 524 524 525 - od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, 525 + pdev = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, 526 526 (void *)&usbhs_data, sizeof(usbhs_data), 527 527 omap_uhhtll_latency, 528 528 ARRAY_SIZE(omap_uhhtll_latency), false); 529 - if (IS_ERR(od)) { 529 + if (IS_ERR(pdev)) { 530 530 pr_err("Could not build hwmod devices %s,%s\n", 531 531 USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME); 532 532 return;
+2
arch/arm/mach-omap2/voltagedomains3xxx_data.c
··· 108 108 * XXX Will depend on the process, validation, and binning 109 109 * for the currently-running IC 110 110 */ 111 + #ifdef CONFIG_PM_OPP 111 112 if (cpu_is_omap3630()) { 112 113 omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data; 113 114 omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data; ··· 116 115 omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data; 117 116 omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data; 118 117 } 118 + #endif 119 119 120 120 if (cpu_is_omap3517() || cpu_is_omap3505()) 121 121 voltdms = voltagedomains_am35xx;
+2
arch/arm/mach-omap2/voltagedomains44xx_data.c
··· 100 100 * XXX Will depend on the process, validation, and binning 101 101 * for the currently-running IC 102 102 */ 103 + #ifdef CONFIG_PM_OPP 103 104 omap4_voltdm_mpu.volt_data = omap44xx_vdd_mpu_volt_data; 104 105 omap4_voltdm_iva.volt_data = omap44xx_vdd_iva_volt_data; 105 106 omap4_voltdm_core.volt_data = omap44xx_vdd_core_volt_data; 107 + #endif 106 108 107 109 for (i = 0; voltdm = voltagedomains_omap4[i], voltdm; i++) 108 110 voltdm->sys_clk.name = sys_clk_name;
+25
arch/arm/mach-pxa/hx4700.c
··· 45 45 #include <mach/hx4700.h> 46 46 #include <mach/irda.h> 47 47 48 + #include <sound/ak4641.h> 48 49 #include <video/platform_lcd.h> 49 50 #include <video/w100fb.h> 50 51 ··· 766 765 }; 767 766 768 767 /* 768 + * Asahi Kasei AK4641 on I2C 769 + */ 770 + 771 + static struct ak4641_platform_data ak4641_info = { 772 + .gpio_power = GPIO27_HX4700_CODEC_ON, 773 + .gpio_npdn = GPIO109_HX4700_CODEC_nPDN, 774 + }; 775 + 776 + static struct i2c_board_info i2c_board_info[] __initdata = { 777 + { 778 + I2C_BOARD_INFO("ak4641", 0x12), 779 + .platform_data = &ak4641_info, 780 + }, 781 + }; 782 + 783 + static struct platform_device audio = { 784 + .name = "hx4700-audio", 785 + .id = -1, 786 + }; 787 + 788 + 789 + /* 769 790 * PCMCIA 770 791 */ 771 792 ··· 813 790 &gpio_vbus, 814 791 &power_supply, 815 792 &strataflash, 793 + &audio, 816 794 &pcmcia, 817 795 }; 818 796 ··· 851 827 pxa_set_ficp_info(&ficp_info); 852 828 pxa27x_set_i2c_power_info(NULL); 853 829 pxa_set_i2c_info(NULL); 830 + i2c_register_board_info(0, ARRAY_AND_SIZE(i2c_board_info)); 854 831 i2c_register_board_info(1, ARRAY_AND_SIZE(pi2c_board_info)); 855 832 pxa2xx_set_spi_info(2, &pxa_ssp2_master_info); 856 833 spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info));
-1
arch/arm/mach-pxa/pxa25x.c
··· 25 25 #include <linux/suspend.h> 26 26 #include <linux/syscore_ops.h> 27 27 #include <linux/irq.h> 28 - #include <linux/gpio.h> 29 28 30 29 #include <asm/mach/map.h> 31 30 #include <asm/suspend.h>
-1
arch/arm/mach-pxa/pxa27x.c
··· 22 22 #include <linux/io.h> 23 23 #include <linux/irq.h> 24 24 #include <linux/i2c/pxa-i2c.h> 25 - #include <linux/gpio.h> 26 25 27 26 #include <asm/mach/map.h> 28 27 #include <mach/hardware.h>
-1
arch/arm/mach-pxa/saarb.c
··· 15 15 #include <linux/i2c.h> 16 16 #include <linux/i2c/pxa-i2c.h> 17 17 #include <linux/mfd/88pm860x.h> 18 - #include <linux/gpio.h> 19 18 20 19 #include <asm/mach-types.h> 21 20 #include <asm/mach/arch.h>
+1 -2
arch/arm/mach-pxa/sharpsl_pm.c
··· 168 168 #define MAXCTRL_SEL_SH 4 169 169 #define MAXCTRL_STR (1u << 7) 170 170 171 + extern int max1111_read_channel(int); 171 172 /* 172 173 * Read MAX1111 ADC 173 174 */ ··· 177 176 /* Ugly, better move this function into another module */ 178 177 if (machine_is_tosa()) 179 178 return 0; 180 - 181 - extern int max1111_read_channel(int); 182 179 183 180 /* max1111 accepts channels from 0-3, however, 184 181 * it is encoded from 0-7 here in the code.
+2 -3
arch/arm/mach-pxa/spitz_pm.c
··· 172 172 static unsigned long spitz_charger_wakeup(void) 173 173 { 174 174 unsigned long ret; 175 - ret = (!gpio_get_value(SPITZ_GPIO_KEY_INT) 175 + ret = ((!gpio_get_value(SPITZ_GPIO_KEY_INT) 176 176 << GPIO_bit(SPITZ_GPIO_KEY_INT)) 177 - | (!gpio_get_value(SPITZ_GPIO_SYNC) 178 - << GPIO_bit(SPITZ_GPIO_SYNC)); 177 + | gpio_get_value(SPITZ_GPIO_SYNC)); 179 178 return ret; 180 179 } 181 180
+15 -14
arch/arm/mach-shmobile/board-ag5evm.c
··· 30 30 #include <linux/serial_sci.h> 31 31 #include <linux/smsc911x.h> 32 32 #include <linux/gpio.h> 33 + #include <linux/videodev2.h> 33 34 #include <linux/input.h> 34 35 #include <linux/input/sh_keysc.h> 35 36 #include <linux/mmc/host.h> ··· 38 37 #include <linux/mmc/sh_mobile_sdhi.h> 39 38 #include <linux/mfd/tmio.h> 40 39 #include <linux/sh_clk.h> 41 - #include <linux/dma-mapping.h> 42 40 #include <video/sh_mobile_lcdc.h> 43 41 #include <video/sh_mipi_dsi.h> 44 42 #include <sound/sh_fsi.h> ··· 159 159 }, 160 160 }; 161 161 162 - static struct sh_mmcif_dma sh_mmcif_dma = { 163 - .chan_priv_rx = { 164 - .slave_id = SHDMA_SLAVE_MMCIF_RX, 165 - }, 166 - .chan_priv_tx = { 167 - .slave_id = SHDMA_SLAVE_MMCIF_TX, 168 - }, 169 - }; 170 162 static struct sh_mmcif_plat_data sh_mmcif_platdata = { 171 163 .sup_pclk = 0, 172 164 .ocr = MMC_VDD_165_195, 173 165 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE, 174 - .dma = &sh_mmcif_dma, 166 + .slave_id_tx = SHDMA_SLAVE_MMCIF_TX, 167 + .slave_id_rx = SHDMA_SLAVE_MMCIF_RX, 175 168 }; 176 169 177 170 static struct platform_device mmc_device = { ··· 314 321 }, 315 322 }; 316 323 317 - #define DSI0PHYCR 0xe615006c 318 324 static int sh_mipi_set_dot_clock(struct platform_device *pdev, 319 325 void __iomem *base, 320 326 int enable) 321 327 { 322 - struct clk *pck; 328 + struct clk *pck, *phy; 323 329 int ret; 324 330 325 331 pck = clk_get(&pdev->dev, "dsip_clk"); ··· 327 335 goto sh_mipi_set_dot_clock_pck_err; 328 336 } 329 337 338 + phy = clk_get(&pdev->dev, "dsiphy_clk"); 339 + if (IS_ERR(phy)) { 340 + ret = PTR_ERR(phy); 341 + goto sh_mipi_set_dot_clock_phy_err; 342 + } 343 + 330 344 if (enable) { 331 345 clk_set_rate(pck, clk_round_rate(pck, 24000000)); 332 - __raw_writel(0x2a809010, DSI0PHYCR); 346 + clk_set_rate(phy, clk_round_rate(pck, 510000000)); 333 347 clk_enable(pck); 348 + clk_enable(phy); 334 349 } else { 335 350 clk_disable(pck); 351 + clk_disable(phy); 336 352 } 337 353 338 354 ret = 0; 339 355 356 + clk_put(phy); 357 + sh_mipi_set_dot_clock_phy_err: 340 358 clk_put(pck); 341 - 342 359 sh_mipi_set_dot_clock_pck_err: 343 360 return ret; 344 361 }
+2 -10
arch/arm/mach-shmobile/board-ap4evb.c
··· 295 295 }, 296 296 }; 297 297 298 - static struct sh_mmcif_dma sh_mmcif_dma = { 299 - .chan_priv_rx = { 300 - .slave_id = SHDMA_SLAVE_MMCIF_RX, 301 - }, 302 - .chan_priv_tx = { 303 - .slave_id = SHDMA_SLAVE_MMCIF_TX, 304 - }, 305 - }; 306 - 307 298 static struct sh_mmcif_plat_data sh_mmcif_plat = { 308 299 .sup_pclk = 0, 309 300 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, ··· 302 311 MMC_CAP_8_BIT_DATA | 303 312 MMC_CAP_NEEDS_POLL, 304 313 .get_cd = slot_cn7_get_cd, 305 - .dma = &sh_mmcif_dma, 314 + .slave_id_tx = SHDMA_SLAVE_MMCIF_TX, 315 + .slave_id_rx = SHDMA_SLAVE_MMCIF_RX, 306 316 }; 307 317 308 318 static struct platform_device sh_mmcif_device = {
+1 -2
arch/arm/mach-shmobile/board-kota2.c
··· 143 143 static struct gpio_keys_platform_data gpio_key_info = { 144 144 .buttons = gpio_buttons, 145 145 .nbuttons = ARRAY_SIZE(gpio_buttons), 146 - .poll_interval = 250, /* polled for now */ 147 146 }; 148 147 149 148 static struct platform_device gpio_keys_device = { 150 - .name = "gpio-keys-polled", /* polled for now */ 149 + .name = "gpio-keys", 151 150 .id = -1, 152 151 .dev = { 153 152 .platform_data = &gpio_key_info,
+21 -74
arch/arm/mach-shmobile/board-mackerel.c
··· 43 43 #include <linux/smsc911x.h> 44 44 #include <linux/sh_intc.h> 45 45 #include <linux/tca6416_keypad.h> 46 - #include <linux/usb/r8a66597.h> 47 46 #include <linux/usb/renesas_usbhs.h> 48 47 #include <linux/dma-mapping.h> 49 48 ··· 144 145 * 1-2 short | VBUS 5V | Host 145 146 * open | external VBUS | Function 146 147 * 147 - * *1 148 - * CN31 is used as 149 - * CONFIG_USB_R8A66597_HCD Host 150 - * CONFIG_USB_RENESAS_USBHS Function 151 - * 152 148 * CAUTION 153 149 * 154 150 * renesas_usbhs driver can use external interrupt mode ··· 155 161 * mackerel can not use external interrupt (IRQ7-PORT167) mode on "USB0", 156 162 * because Touchscreen is using IRQ7-PORT40. 157 163 * It is impossible to use IRQ7 demux on this board. 158 - * 159 - * We can use external interrupt mode USB-Function on "USB1". 160 - * USB1 can become Host by r8a66597, and become Function by renesas_usbhs. 161 - * But don't select both drivers in same time. 162 - * These uses same IRQ number for request_irq(), and aren't supporting 163 - * IRQF_SHARED / IORESOURCE_IRQ_SHAREABLE. 164 - * 165 - * Actually these are old/new version of USB driver. 166 - * This mean its register will be broken if it supports shared IRQ, 167 164 */ 168 165 169 166 /* ··· 190 205 * 191 206 * microSD card sloct 192 207 * 208 + */ 209 + 210 + /* 211 + * FSI - AK4642 212 + * 213 + * it needs amixer settings for playing 214 + * 215 + * amixer set "Headphone" on 216 + * amixer set "HPOUTL Mixer DACH" on 217 + * amixer set "HPOUTR Mixer DACH" on 193 218 */ 194 219 195 220 /* ··· 671 676 * Use J30 to select between Host and Function. This setting 672 677 * can however not be detected by software. Hotplug of USBHS1 673 678 * is provided via IRQ8. 679 + * 680 + * Current USB1 works as "USB Host". 681 + * - set J30 "short" 682 + * 683 + * If you want to use it as "USB gadget", 684 + * - J30 "open" 685 + * - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET 686 + * - add .get_vbus = usbhs_get_vbus in usbhs1_private 674 687 */ 675 688 #define IRQ8 evt2irq(0x0300) 676 - 677 - /* USBHS1 USB Host support via r8a66597_hcd */ 678 - static void usb1_host_port_power(int port, int power) 679 - { 680 - if (!power) /* only power-on is supported for now */ 681 - return; 682 - 683 - /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */ 684 - __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008); 685 - } 686 - 687 - static struct r8a66597_platdata usb1_host_data = { 688 - .on_chip = 1, 689 - .port_power = usb1_host_port_power, 690 - }; 691 - 692 - static struct resource usb1_host_resources[] = { 693 - [0] = { 694 - .name = "USBHS1", 695 - .start = 0xe68b0000, 696 - .end = 0xe68b00e6 - 1, 697 - .flags = IORESOURCE_MEM, 698 - }, 699 - [1] = { 700 - .start = evt2irq(0x1ce0) /* USB1_USB1I0 */, 701 - .flags = IORESOURCE_IRQ, 702 - }, 703 - }; 704 - 705 - static struct platform_device usb1_host_device = { 706 - .name = "r8a66597_hcd", 707 - .id = 1, 708 - .dev = { 709 - .dma_mask = NULL, /* not use dma */ 710 - .coherent_dma_mask = 0xffffffff, 711 - .platform_data = &usb1_host_data, 712 - }, 713 - .num_resources = ARRAY_SIZE(usb1_host_resources), 714 - .resource = usb1_host_resources, 715 - }; 716 - 717 - /* USBHS1 USB Function support via renesas_usbhs */ 718 - 719 689 #define USB_PHY_MODE (1 << 4) 720 690 #define USB_PHY_INT_EN ((1 << 3) | (1 << 2)) 721 691 #define USB_PHY_ON (1 << 1) ··· 736 776 737 777 static int usbhs1_get_id(struct platform_device *pdev) 738 778 { 739 - return USBHS_GADGET; 779 + return USBHS_HOST; 740 780 } 741 781 742 782 static u32 usbhs1_pipe_cfg[] = { ··· 767 807 .hardware_exit = usbhs1_hardware_exit, 768 808 .get_id = usbhs1_get_id, 769 809 .phy_reset = usbhs_phy_reset, 770 - .get_vbus = usbhs_get_vbus, 771 810 }, 772 811 .driver_param = { 773 812 .buswait_bwait = 4, ··· 1143 1184 }, 1144 1185 }; 1145 1186 1146 - static struct sh_mmcif_dma sh_mmcif_dma = { 1147 - .chan_priv_rx = { 1148 - .slave_id = SHDMA_SLAVE_MMCIF_RX, 1149 - }, 1150 - .chan_priv_tx = { 1151 - .slave_id = SHDMA_SLAVE_MMCIF_TX, 1152 - }, 1153 - }; 1154 - 1155 1187 static struct sh_mmcif_plat_data sh_mmcif_plat = { 1156 1188 .sup_pclk = 0, 1157 1189 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, ··· 1150 1200 MMC_CAP_8_BIT_DATA | 1151 1201 MMC_CAP_NEEDS_POLL, 1152 1202 .get_cd = slot_cn7_get_cd, 1153 - .dma = &sh_mmcif_dma, 1203 + .slave_id_tx = SHDMA_SLAVE_MMCIF_TX, 1204 + .slave_id_rx = SHDMA_SLAVE_MMCIF_RX, 1154 1205 }; 1155 1206 1156 1207 static struct platform_device sh_mmcif_device = { ··· 1262 1311 &nor_flash_device, 1263 1312 &smc911x_device, 1264 1313 &lcdc_device, 1265 - &usb1_host_device, 1266 1314 &usbhs1_device, 1267 1315 &usbhs0_device, 1268 1316 &leds_device, ··· 1422 1472 gpio_request(GPIO_FN_VBUS0_1, NULL); 1423 1473 gpio_pull_down(GPIO_PORT167CR); /* VBUS0_1 pull down */ 1424 1474 gpio_request(GPIO_FN_IDIN_1_113, NULL); 1425 - 1426 - /* USB phy tweak to make the r8a66597_hcd host driver work */ 1427 - __raw_writew(0x8a0a, 0xe6058130); /* USBCR4 */ 1428 1475 1429 1476 /* enable FSI2 port A (ak4643) */ 1430 1477 gpio_request(GPIO_FN_FSIAIBT, NULL);
+113
arch/arm/mach-shmobile/clock-sh73a0.c
··· 365 365 dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3), 366 366 }; 367 367 368 + /* DSI DIV */ 369 + static unsigned long dsiphy_recalc(struct clk *clk) 370 + { 371 + u32 value; 372 + 373 + value = __raw_readl(clk->mapping->base); 374 + 375 + /* FIXME */ 376 + if (!(value & 0x000B8000)) 377 + return clk->parent->rate; 378 + 379 + value &= 0x3f; 380 + value += 1; 381 + 382 + if ((value < 12) || 383 + (value > 33)) { 384 + pr_err("DSIPHY has wrong value (%d)", value); 385 + return 0; 386 + } 387 + 388 + return clk->parent->rate / value; 389 + } 390 + 391 + static long dsiphy_round_rate(struct clk *clk, unsigned long rate) 392 + { 393 + return clk_rate_mult_range_round(clk, 12, 33, rate); 394 + } 395 + 396 + static void dsiphy_disable(struct clk *clk) 397 + { 398 + u32 value; 399 + 400 + value = __raw_readl(clk->mapping->base); 401 + value &= ~0x000B8000; 402 + 403 + __raw_writel(value , clk->mapping->base); 404 + } 405 + 406 + static int dsiphy_enable(struct clk *clk) 407 + { 408 + u32 value; 409 + int multi; 410 + 411 + value = __raw_readl(clk->mapping->base); 412 + multi = (value & 0x3f) + 1; 413 + 414 + if ((multi < 12) || (multi > 33)) 415 + return -EIO; 416 + 417 + __raw_writel(value | 0x000B8000, clk->mapping->base); 418 + 419 + return 0; 420 + } 421 + 422 + static int dsiphy_set_rate(struct clk *clk, unsigned long rate) 423 + { 424 + u32 value; 425 + int idx; 426 + 427 + idx = rate / clk->parent->rate; 428 + if ((idx < 12) || (idx > 33)) 429 + return -EINVAL; 430 + 431 + idx += -1; 432 + 433 + value = __raw_readl(clk->mapping->base); 434 + value = (value & ~0x3f) + idx; 435 + 436 + __raw_writel(value, clk->mapping->base); 437 + 438 + return 0; 439 + } 440 + 441 + static struct clk_ops dsiphy_clk_ops = { 442 + .recalc = dsiphy_recalc, 443 + .round_rate = dsiphy_round_rate, 444 + .set_rate = dsiphy_set_rate, 445 + .enable = dsiphy_enable, 446 + .disable = dsiphy_disable, 447 + }; 448 + 449 + static struct clk_mapping dsi0phy_clk_mapping = { 450 + .phys = DSI0PHYCR, 451 + .len = 4, 452 + }; 453 + 454 + static struct clk_mapping dsi1phy_clk_mapping = { 455 + .phys = DSI1PHYCR, 456 + .len = 4, 457 + }; 458 + 459 + static struct clk dsi0phy_clk = { 460 + .ops = &dsiphy_clk_ops, 461 + .parent = &div6_clks[DIV6_DSI0P], /* late install */ 462 + .mapping = &dsi0phy_clk_mapping, 463 + }; 464 + 465 + static struct clk dsi1phy_clk = { 466 + .ops = &dsiphy_clk_ops, 467 + .parent = &div6_clks[DIV6_DSI1P], /* late install */ 468 + .mapping = &dsi1phy_clk_mapping, 469 + }; 470 + 471 + static struct clk *late_main_clks[] = { 472 + &dsi0phy_clk, 473 + &dsi1phy_clk, 474 + }; 475 + 368 476 enum { MSTP001, 369 477 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100, 370 478 MSTP219, ··· 537 429 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]), 538 430 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]), 539 431 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]), 432 + CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk), 433 + CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk), 540 434 541 435 /* MSTP32 clocks */ 542 436 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ ··· 613 503 614 504 if (!ret) 615 505 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 506 + 507 + for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++) 508 + ret = clk_register(late_main_clks[k]); 616 509 617 510 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 618 511
+3 -3
arch/arm/mach-shmobile/include/mach/sh73a0.h
··· 515 515 SHDMA_SLAVE_MMCIF_RX, 516 516 }; 517 517 518 - /* PINT interrupts are located at Linux IRQ 768 and up */ 519 - #define SH73A0_PINT0_IRQ(irq) ((irq) + 768) 520 - #define SH73A0_PINT1_IRQ(irq) ((irq) + 800) 518 + /* PINT interrupts are located at Linux IRQ 800 and up */ 519 + #define SH73A0_PINT0_IRQ(irq) ((irq) + 800) 520 + #define SH73A0_PINT1_IRQ(irq) ((irq) + 832) 521 521 522 522 #endif /* __ASM_SH73A0_H__ */
+2
arch/arm/mach-shmobile/intc-sh73a0.c
··· 19 19 #include <linux/kernel.h> 20 20 #include <linux/init.h> 21 21 #include <linux/interrupt.h> 22 + #include <linux/module.h> 22 23 #include <linux/irq.h> 23 24 #include <linux/io.h> 24 25 #include <linux/sh_intc.h> ··· 446 445 setup_irq(gic_spi(1 + k), &sh73a0_irq_pin_cascade[k]); 447 446 448 447 n = intcs_evt2irq(to_intc_vect(gic_spi(1 + k))); 448 + WARN_ON(irq_alloc_desc_at(n, numa_node_id()) != n); 449 449 irq_set_chip_and_handler_name(n, &intca_gic_irq_chip, 450 450 handle_level_irq, "level"); 451 451 set_irq_flags(n, IRQF_VALID); /* yuck */
+1 -1
arch/arm/mach-shmobile/pfc-r8a7779.c
··· 2120 2120 FN_AUDATA3, 0, 0, 0 } 2121 2121 }, 2122 2122 { PINMUX_CFG_REG_VAR("IPSR4", 0xfffc0030, 32, 2123 - 3, 1, 1, 1, 1, 1, 1, 3, 3, 1, 2123 + 3, 1, 1, 1, 1, 1, 1, 3, 3, 2124 2124 1, 1, 1, 1, 1, 1, 3, 3, 3, 2) { 2125 2125 /* IP4_31_29 [3] */ 2126 2126 FN_DU1_DB0, FN_VI2_DATA4_VI2_B4, FN_SCL2_B, FN_SD3_DAT0,
+41
arch/arm/mach-shmobile/pfc-sh7372.c
··· 23 23 #include <linux/init.h> 24 24 #include <linux/kernel.h> 25 25 #include <linux/gpio.h> 26 + #include <mach/irqs.h> 26 27 #include <mach/sh7372.h> 27 28 28 29 #define CPU_ALL_PORT(fn, pfx, sfx) \ ··· 1595 1594 { }, 1596 1595 }; 1597 1596 1597 + #define EXT_IRQ16L(n) evt2irq(0x200 + ((n) << 5)) 1598 + #define EXT_IRQ16H(n) evt2irq(0x3200 + (((n) - 16) << 5)) 1599 + static struct pinmux_irq pinmux_irqs[] = { 1600 + PINMUX_IRQ(EXT_IRQ16L(0), PORT6_FN0, PORT162_FN0), 1601 + PINMUX_IRQ(EXT_IRQ16L(1), PORT12_FN0), 1602 + PINMUX_IRQ(EXT_IRQ16L(2), PORT4_FN0, PORT5_FN0), 1603 + PINMUX_IRQ(EXT_IRQ16L(3), PORT8_FN0, PORT16_FN0), 1604 + PINMUX_IRQ(EXT_IRQ16L(4), PORT17_FN0, PORT163_FN0), 1605 + PINMUX_IRQ(EXT_IRQ16L(5), PORT18_FN0), 1606 + PINMUX_IRQ(EXT_IRQ16L(6), PORT39_FN0, PORT164_FN0), 1607 + PINMUX_IRQ(EXT_IRQ16L(7), PORT40_FN0, PORT167_FN0), 1608 + PINMUX_IRQ(EXT_IRQ16L(8), PORT41_FN0, PORT168_FN0), 1609 + PINMUX_IRQ(EXT_IRQ16L(9), PORT42_FN0, PORT169_FN0), 1610 + PINMUX_IRQ(EXT_IRQ16L(10), PORT65_FN0), 1611 + PINMUX_IRQ(EXT_IRQ16L(11), PORT67_FN0), 1612 + PINMUX_IRQ(EXT_IRQ16L(12), PORT80_FN0, PORT137_FN0), 1613 + PINMUX_IRQ(EXT_IRQ16L(13), PORT81_FN0, PORT145_FN0), 1614 + PINMUX_IRQ(EXT_IRQ16L(14), PORT82_FN0, PORT146_FN0), 1615 + PINMUX_IRQ(EXT_IRQ16L(15), PORT83_FN0, PORT147_FN0), 1616 + PINMUX_IRQ(EXT_IRQ16H(16), PORT84_FN0, PORT170_FN0), 1617 + PINMUX_IRQ(EXT_IRQ16H(17), PORT85_FN0), 1618 + PINMUX_IRQ(EXT_IRQ16H(18), PORT86_FN0), 1619 + PINMUX_IRQ(EXT_IRQ16H(19), PORT87_FN0), 1620 + PINMUX_IRQ(EXT_IRQ16H(20), PORT92_FN0), 1621 + PINMUX_IRQ(EXT_IRQ16H(21), PORT93_FN0), 1622 + PINMUX_IRQ(EXT_IRQ16H(22), PORT94_FN0), 1623 + PINMUX_IRQ(EXT_IRQ16H(23), PORT95_FN0), 1624 + PINMUX_IRQ(EXT_IRQ16H(24), PORT112_FN0), 1625 + PINMUX_IRQ(EXT_IRQ16H(25), PORT119_FN0), 1626 + PINMUX_IRQ(EXT_IRQ16H(26), PORT121_FN0, PORT172_FN0), 1627 + PINMUX_IRQ(EXT_IRQ16H(27), PORT122_FN0, PORT180_FN0), 1628 + PINMUX_IRQ(EXT_IRQ16H(28), PORT123_FN0, PORT181_FN0), 1629 + PINMUX_IRQ(EXT_IRQ16H(29), PORT129_FN0, PORT182_FN0), 1630 + PINMUX_IRQ(EXT_IRQ16H(30), PORT130_FN0, PORT183_FN0), 1631 + PINMUX_IRQ(EXT_IRQ16H(31), PORT138_FN0, PORT184_FN0), 1632 + }; 1633 + 1598 1634 static struct pinmux_info sh7372_pinmux_info = { 1599 1635 .name = "sh7372_pfc", 1600 1636 .reserved_id = PINMUX_RESERVED, ··· 1652 1614 1653 1615 .gpio_data = pinmux_data, 1654 1616 .gpio_data_size = ARRAY_SIZE(pinmux_data), 1617 + 1618 + .gpio_irq = pinmux_irqs, 1619 + .gpio_irq_size = ARRAY_SIZE(pinmux_irqs), 1655 1620 }; 1656 1621 1657 1622 void sh7372_pinmux_init(void)
+1 -1
arch/arm/mach-shmobile/smp-sh73a0.c
··· 80 80 /* enable cache coherency */ 81 81 modify_scu_cpu_psr(0, 3 << (cpu * 8)); 82 82 83 - if (((__raw_readw(__io(PSTR)) >> (4 * cpu)) & 3) == 3) 83 + if (((__raw_readl(__io(PSTR)) >> (4 * cpu)) & 3) == 3) 84 84 __raw_writel(1 << cpu, __io(WUPCR)); /* wake up */ 85 85 else 86 86 __raw_writel(1 << cpu, __io(SRESCR)); /* reset */
+2 -1
arch/arm/mm/Kconfig
··· 631 631 632 632 config ARM_LPAE 633 633 bool "Support for the Large Physical Address Extension" 634 - depends on MMU && CPU_V7 634 + depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \ 635 + !CPU_32v4 && !CPU_32v3 635 636 help 636 637 Say Y if you have an ARMv7 processor supporting the LPAE page 637 638 table format and you would like to access memory beyond the
+1 -1
arch/arm/mm/cache-v7.S
··· 55 55 cmp r1, #2 @ see what cache we have at this level 56 56 blt skip @ skip if no cache, or just i-cache 57 57 #ifdef CONFIG_PREEMPT 58 - save_and_disable_irqs r9 @ make cssr&csidr read atomic 58 + save_and_disable_irqs_notrace r9 @ make cssr&csidr read atomic 59 59 #endif 60 60 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr 61 61 isb @ isb to sych the new cssr&csidr
+1
arch/arm/plat-omap/common.c
··· 67 67 omap_vram_reserve_sdram_memblock(); 68 68 omap_dsp_reserve_sdram_memblock(); 69 69 omap_secure_ram_reserve_memblock(); 70 + omap_barrier_reserve_memblock(); 70 71 } 71 72 72 73 void __init omap_init_consistent_dma_size(void)
+6
arch/arm/plat-omap/include/plat/omap-secure.h
··· 10 10 { } 11 11 #endif 12 12 13 + #ifdef CONFIG_OMAP4_ERRATA_I688 14 + extern int omap_barrier_reserve_memblock(void); 15 + #else 16 + static inline void omap_barrier_reserve_memblock(void) 17 + { } 18 + #endif 13 19 #endif /* __OMAP_SECURE_H__ */
+1 -1
arch/c6x/boot/Makefile
··· 13 13 endif 14 14 15 15 $(obj)/%.dtb: $(src)/dts/%.dts FORCE 16 - $(call cmd,dtc) 16 + $(call if_changed_dep,dtc) 17 17 18 18 quiet_cmd_cp = CP $< $@$2 19 19 cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
+2 -1
arch/m68k/include/asm/mcf_pgtable.h
··· 78 78 | CF_PAGE_READABLE \ 79 79 | CF_PAGE_WRITABLE \ 80 80 | CF_PAGE_EXEC \ 81 - | CF_PAGE_SYSTEM) 81 + | CF_PAGE_SYSTEM \ 82 + | CF_PAGE_SHARED) 82 83 83 84 #define PAGE_COPY __pgprot(CF_PAGE_VALID \ 84 85 | CF_PAGE_ACCESSED \
+5 -4
arch/m68k/mm/mcfmmu.c
··· 87 87 88 88 int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word) 89 89 { 90 - unsigned long flags, mmuar; 90 + unsigned long flags, mmuar, mmutr; 91 91 struct mm_struct *mm; 92 92 pgd_t *pgd; 93 93 pmd_t *pmd; ··· 137 137 if (!pte_dirty(*pte) && !KMAPAREA(mmuar)) 138 138 set_pte(pte, pte_wrprotect(*pte)); 139 139 140 - mmu_write(MMUTR, (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) | 141 - (((int)(pte->pte) & (int)CF_PAGE_MMUTR_MASK) 142 - >> CF_PAGE_MMUTR_SHIFT) | MMUTR_V); 140 + mmutr = (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) | MMUTR_V; 141 + if ((mmuar < TASK_UNMAPPED_BASE) || (mmuar >= TASK_SIZE)) 142 + mmutr |= (pte->pte & CF_PAGE_MMUTR_MASK) >> CF_PAGE_MMUTR_SHIFT; 143 + mmu_write(MMUTR, mmutr); 143 144 144 145 mmu_write(MMUDR, (pte_val(*pte) & PAGE_MASK) | 145 146 ((pte->pte) & CF_PAGE_MMUDR_MASK) | MMUDR_SZ_8KB | MMUDR_X);
+1 -3
arch/m68k/platform/coldfire/entry.S
··· 136 136 movel %sp,%d1 /* get thread_info pointer */ 137 137 andl #-THREAD_SIZE,%d1 /* at base of kernel stack */ 138 138 movel %d1,%a0 139 - movel %a0@(TINFO_FLAGS),%d1 /* get thread_info->flags */ 139 + moveb %a0@(TINFO_FLAGS+3),%d1 /* thread_info->flags (low 8 bits) */ 140 140 jne Lwork_to_do /* still work to do */ 141 141 142 142 Lreturn: ··· 147 147 move #0x2000,%sr /* enable intrs again */ 148 148 btst #TIF_NEED_RESCHED,%d1 149 149 jne reschedule 150 - 151 - /* GERG: do we need something here for TRACEing?? */ 152 150 153 151 Lsignal_return: 154 152 subql #4,%sp /* dummy return address */
+7 -1
arch/openrisc/include/asm/ptrace.h
··· 77 77 long syscallno; /* Syscall number (used by strace) */ 78 78 long dummy; /* Cheap alignment fix */ 79 79 }; 80 - #endif /* __ASSEMBLY__ */ 81 80 82 81 /* TODO: Rename this to REDZONE because that's what it is */ 83 82 #define STACK_FRAME_OVERHEAD 128 /* size of minimum stack frame */ ··· 85 86 #define user_mode(regs) (((regs)->sr & SPR_SR_SM) == 0) 86 87 #define user_stack_pointer(regs) ((unsigned long)(regs)->sp) 87 88 #define profile_pc(regs) instruction_pointer(regs) 89 + 90 + static inline long regs_return_value(struct pt_regs *regs) 91 + { 92 + return regs->gpr[11]; 93 + } 94 + 95 + #endif /* __ASSEMBLY__ */ 88 96 89 97 /* 90 98 * Offsets used by 'ptrace' system call interface.
+1
arch/openrisc/kernel/init_task.c
··· 17 17 18 18 #include <linux/init_task.h> 19 19 #include <linux/mqueue.h> 20 + #include <linux/export.h> 20 21 21 22 static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 22 23 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
+1
arch/openrisc/kernel/irq.c
··· 23 23 #include <linux/irq.h> 24 24 #include <linux/seq_file.h> 25 25 #include <linux/kernel_stat.h> 26 + #include <linux/export.h> 26 27 27 28 #include <linux/irqflags.h> 28 29
+4 -8
arch/openrisc/kernel/ptrace.c
··· 188 188 */ 189 189 ret = -1L; 190 190 191 - /* Are these regs right??? */ 192 - if (unlikely(current->audit_context)) 193 - audit_syscall_entry(audit_arch(), regs->syscallno, 194 - regs->gpr[3], regs->gpr[4], 195 - regs->gpr[5], regs->gpr[6]); 191 + audit_syscall_entry(audit_arch(), regs->syscallno, 192 + regs->gpr[3], regs->gpr[4], 193 + regs->gpr[5], regs->gpr[6]); 196 194 197 195 return ret ? : regs->syscallno; 198 196 } ··· 199 201 { 200 202 int step; 201 203 202 - if (unlikely(current->audit_context)) 203 - audit_syscall_exit(AUDITSC_RESULT(regs->gpr[11]), 204 - regs->gpr[11]); 204 + audit_syscall_exit(regs); 205 205 206 206 step = test_thread_flag(TIF_SINGLESTEP); 207 207 if (step || test_thread_flag(TIF_SYSCALL_TRACE))
+4
arch/parisc/Makefile
··· 31 31 UTS_MACHINE := parisc64 32 32 CHECKFLAGS += -D__LP64__=1 -m64 33 33 WIDTH := 64 34 + 35 + # FIXME: if no default set, should really try to locate dynamically 36 + ifeq ($(CROSS_COMPILE),) 34 37 CROSS_COMPILE := hppa64-linux-gnu- 38 + endif 35 39 else # 32-bit 36 40 WIDTH := 37 41 endif
+1 -1
arch/powerpc/kernel/entry_32.S
··· 1213 1213 stw r3,_TRAP(r1) 1214 1214 2: addi r3,r1,STACK_FRAME_OVERHEAD 1215 1215 mr r4,r9 1216 - bl do_signal 1216 + bl do_notify_resume 1217 1217 REST_NVGPRS(r1) 1218 1218 b recheck 1219 1219
+5 -1
arch/powerpc/kernel/entry_64.S
··· 751 751 752 752 andi. r0,r4,_TIF_NEED_RESCHED 753 753 beq 1f 754 + li r5,1 755 + TRACE_AND_RESTORE_IRQ(r5); 754 756 bl .schedule 755 757 b .ret_from_except_lite 756 758 757 759 1: bl .save_nvgprs 760 + li r5,1 761 + TRACE_AND_RESTORE_IRQ(r5); 758 762 addi r3,r1,STACK_FRAME_OVERHEAD 759 - bl .do_signal 763 + bl .do_notify_resume 760 764 b .ret_from_except 761 765 762 766 unrecov_restore:
+1 -1
arch/powerpc/kernel/exceptions-64s.S
··· 774 774 program_check_common: 775 775 EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN) 776 776 bl .save_nvgprs 777 - addi r3,r1,STACK_FRAME_OVERHEAD 778 777 DISABLE_INTS 778 + addi r3,r1,STACK_FRAME_OVERHEAD 779 779 bl .program_check_exception 780 780 b .ret_from_except 781 781
+8 -4
arch/powerpc/kernel/signal.c
··· 11 11 12 12 #include <linux/tracehook.h> 13 13 #include <linux/signal.h> 14 + #include <linux/key.h> 14 15 #include <asm/hw_breakpoint.h> 15 16 #include <asm/uaccess.h> 16 17 #include <asm/unistd.h> ··· 114 113 } 115 114 } 116 115 117 - static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs) 116 + static int do_signal(struct pt_regs *regs) 118 117 { 118 + sigset_t *oldset; 119 119 siginfo_t info; 120 120 int signr; 121 121 struct k_sigaction ka; ··· 125 123 126 124 if (current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK) 127 125 oldset = &current->saved_sigmask; 128 - else if (!oldset) 126 + else 129 127 oldset = &current->blocked; 130 128 131 129 signr = get_signal_to_deliver(&info, &ka, regs, NULL); ··· 193 191 return ret; 194 192 } 195 193 196 - void do_signal(struct pt_regs *regs, unsigned long thread_info_flags) 194 + void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) 197 195 { 198 196 if (thread_info_flags & _TIF_SIGPENDING) 199 - do_signal_pending(NULL, regs); 197 + do_signal(regs); 200 198 201 199 if (thread_info_flags & _TIF_NOTIFY_RESUME) { 202 200 clear_thread_flag(TIF_NOTIFY_RESUME); 203 201 tracehook_notify_resume(regs); 202 + if (current->replacement_session_keyring) 203 + key_replace_session_keyring(); 204 204 } 205 205 } 206 206
+1 -1
arch/powerpc/kernel/signal.h
··· 12 12 13 13 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 14 14 15 - extern void do_signal(struct pt_regs *regs, unsigned long thread_info_flags); 15 + extern void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags); 16 16 17 17 extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, 18 18 size_t frame_size, int is_32);
+1 -1
arch/powerpc/platforms/wsp/smp.c
··· 71 71 72 72 static int __init smp_a2_probe(void) 73 73 { 74 - return cpus_weight(cpu_possible_map); 74 + return num_possible_cpus(); 75 75 } 76 76 77 77 static struct smp_ops_t a2_smp_ops = {
+3
arch/s390/Kconfig
··· 227 227 config SYSVIPC_COMPAT 228 228 def_bool y if COMPAT && SYSVIPC 229 229 230 + config KEYS_COMPAT 231 + def_bool y if COMPAT && KEYS 232 + 230 233 config AUDIT_ARCH 231 234 def_bool y 232 235
-7
arch/s390/include/asm/compat.h
··· 172 172 return is_32bit_task(); 173 173 } 174 174 175 - #else 176 - 177 - static inline int is_compat_task(void) 178 - { 179 - return 0; 180 - } 181 - 182 175 #endif 183 176 184 177 static inline void __user *arch_compat_alloc_user_space(long len)
+1 -1
arch/s390/kernel/compat_wrapper.S
··· 662 662 ENTRY(sys32_poll_wrapper) 663 663 llgtr %r2,%r2 # struct pollfd * 664 664 llgfr %r3,%r3 # unsigned int 665 - lgfr %r4,%r4 # long 665 + lgfr %r4,%r4 # int 666 666 jg sys_poll # branch to system call 667 667 668 668 ENTRY(sys32_setresgid16_wrapper)
-1
arch/s390/kernel/crash_dump.c
··· 11 11 #include <linux/module.h> 12 12 #include <linux/gfp.h> 13 13 #include <linux/slab.h> 14 - #include <linux/crash_dump.h> 15 14 #include <linux/bootmem.h> 16 15 #include <linux/elf.h> 17 16 #include <asm/ipl.h>
+3 -3
arch/s390/kernel/process.c
··· 29 29 #include <asm/irq.h> 30 30 #include <asm/timer.h> 31 31 #include <asm/nmi.h> 32 - #include <asm/compat.h> 33 32 #include <asm/smp.h> 34 33 #include "entry.h" 35 34 ··· 75 76 if (test_thread_flag(TIF_MCCK_PENDING)) { 76 77 local_mcck_enable(); 77 78 local_irq_enable(); 78 - s390_handle_mcck(); 79 79 return; 80 80 } 81 81 trace_hardirqs_on(); ··· 91 93 for (;;) { 92 94 tick_nohz_idle_enter(); 93 95 rcu_idle_enter(); 94 - while (!need_resched()) 96 + while (!need_resched() && !test_thread_flag(TIF_MCCK_PENDING)) 95 97 default_idle(); 96 98 rcu_idle_exit(); 97 99 tick_nohz_idle_exit(); 100 + if (test_thread_flag(TIF_MCCK_PENDING)) 101 + s390_handle_mcck(); 98 102 preempt_enable_no_resched(); 99 103 schedule(); 100 104 preempt_disable();
+1 -1
arch/s390/kernel/ptrace.c
··· 20 20 #include <linux/regset.h> 21 21 #include <linux/tracehook.h> 22 22 #include <linux/seccomp.h> 23 + #include <linux/compat.h> 23 24 #include <trace/syscall.h> 24 - #include <asm/compat.h> 25 25 #include <asm/segment.h> 26 26 #include <asm/page.h> 27 27 #include <asm/pgtable.h>
+1 -1
arch/s390/kernel/setup.c
··· 46 46 #include <linux/kexec.h> 47 47 #include <linux/crash_dump.h> 48 48 #include <linux/memory.h> 49 + #include <linux/compat.h> 49 50 50 51 #include <asm/ipl.h> 51 52 #include <asm/uaccess.h> ··· 60 59 #include <asm/ptrace.h> 61 60 #include <asm/sections.h> 62 61 #include <asm/ebcdic.h> 63 - #include <asm/compat.h> 64 62 #include <asm/kvm_virtio.h> 65 63 #include <asm/diag.h> 66 64
-1
arch/s390/kernel/signal.c
··· 30 30 #include <asm/ucontext.h> 31 31 #include <asm/uaccess.h> 32 32 #include <asm/lowcore.h> 33 - #include <asm/compat.h> 34 33 #include "entry.h" 35 34 36 35 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
+5 -2
arch/s390/kernel/time.c
··· 113 113 static int s390_next_ktime(ktime_t expires, 114 114 struct clock_event_device *evt) 115 115 { 116 + struct timespec ts; 116 117 u64 nsecs; 117 118 118 - nsecs = ktime_to_ns(ktime_sub(expires, ktime_get_monotonic_offset())); 119 + ts.tv_sec = ts.tv_nsec = 0; 120 + monotonic_to_bootbased(&ts); 121 + nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires)); 119 122 do_div(nsecs, 125); 120 - S390_lowcore.clock_comparator = TOD_UNIX_EPOCH + (nsecs << 9); 123 + S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9); 121 124 set_clock_comparator(S390_lowcore.clock_comparator); 122 125 return 0; 123 126 }
-1
arch/s390/mm/fault.c
··· 36 36 #include <asm/pgtable.h> 37 37 #include <asm/irq.h> 38 38 #include <asm/mmu_context.h> 39 - #include <asm/compat.h> 40 39 #include "../kernel/entry.h" 41 40 42 41 #ifndef CONFIG_64BIT
+26 -4
arch/s390/mm/init.c
··· 223 223 #ifdef CONFIG_MEMORY_HOTPLUG 224 224 int arch_add_memory(int nid, u64 start, u64 size) 225 225 { 226 - struct pglist_data *pgdat; 226 + unsigned long zone_start_pfn, zone_end_pfn, nr_pages; 227 + unsigned long start_pfn = PFN_DOWN(start); 228 + unsigned long size_pages = PFN_DOWN(size); 227 229 struct zone *zone; 228 230 int rc; 229 231 230 - pgdat = NODE_DATA(nid); 231 - zone = pgdat->node_zones + ZONE_MOVABLE; 232 232 rc = vmem_add_mapping(start, size); 233 233 if (rc) 234 234 return rc; 235 - rc = __add_pages(nid, zone, PFN_DOWN(start), PFN_DOWN(size)); 235 + for_each_zone(zone) { 236 + if (zone_idx(zone) != ZONE_MOVABLE) { 237 + /* Add range within existing zone limits */ 238 + zone_start_pfn = zone->zone_start_pfn; 239 + zone_end_pfn = zone->zone_start_pfn + 240 + zone->spanned_pages; 241 + } else { 242 + /* Add remaining range to ZONE_MOVABLE */ 243 + zone_start_pfn = start_pfn; 244 + zone_end_pfn = start_pfn + size_pages; 245 + } 246 + if (start_pfn < zone_start_pfn || start_pfn >= zone_end_pfn) 247 + continue; 248 + nr_pages = (start_pfn + size_pages > zone_end_pfn) ? 249 + zone_end_pfn - start_pfn : size_pages; 250 + rc = __add_pages(nid, zone, start_pfn, nr_pages); 251 + if (rc) 252 + break; 253 + start_pfn += nr_pages; 254 + size_pages -= nr_pages; 255 + if (!size_pages) 256 + break; 257 + } 236 258 if (rc) 237 259 vmem_remove_mapping(start, size); 238 260 return rc;
+1 -1
arch/s390/mm/mmap.c
··· 29 29 #include <linux/mman.h> 30 30 #include <linux/module.h> 31 31 #include <linux/random.h> 32 + #include <linux/compat.h> 32 33 #include <asm/pgalloc.h> 33 - #include <asm/compat.h> 34 34 35 35 static unsigned long stack_maxrandom_size(void) 36 36 {
+1 -1
arch/s390/mm/pgtable.c
··· 574 574 page = pfn_to_page(__pa(table) >> PAGE_SHIFT); 575 575 mp = (struct gmap_pgtable *) page->index; 576 576 BUG_ON(!list_empty(&mp->mapper)); 577 - pgtable_page_ctor(page); 577 + pgtable_page_dtor(page); 578 578 atomic_set(&page->_mapcount, -1); 579 579 kfree(mp); 580 580 __free_page(page);
+9 -11
arch/sh/boards/board-sh7757lcr.c
··· 169 169 .end = 0xfee00fff, 170 170 .flags = IORESOURCE_MEM, 171 171 }, { 172 + /* TSU */ 173 + .start = 0xfee01800, 174 + .end = 0xfee01fff, 175 + .flags = IORESOURCE_MEM, 176 + }, { 172 177 .start = 316, 173 178 .end = 316, 174 179 .flags = IORESOURCE_IRQ, ··· 215 210 }, 216 211 }; 217 212 218 - static struct sh_mmcif_dma sh7757lcr_mmcif_dma = { 219 - .chan_priv_tx = { 220 - .slave_id = SHDMA_SLAVE_MMCIF_TX, 221 - }, 222 - .chan_priv_rx = { 223 - .slave_id = SHDMA_SLAVE_MMCIF_RX, 224 - } 225 - }; 226 - 227 213 static struct sh_mmcif_plat_data sh_mmcif_plat = { 228 - .dma = &sh7757lcr_mmcif_dma, 229 214 .sup_pclk = 0x0f, 230 - .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 215 + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | 216 + MMC_CAP_NONREMOVABLE, 231 217 .ocr = MMC_VDD_32_33 | MMC_VDD_33_34, 218 + .slave_id_tx = SHDMA_SLAVE_MMCIF_TX, 219 + .slave_id_rx = SHDMA_SLAVE_MMCIF_RX, 232 220 }; 233 221 234 222 static struct platform_device sh_mmcif_device = {
+1
arch/sh/boards/mach-ap325rxa/setup.c
··· 22 22 #include <linux/i2c.h> 23 23 #include <linux/smsc911x.h> 24 24 #include <linux/gpio.h> 25 + #include <linux/videodev2.h> 25 26 #include <media/ov772x.h> 26 27 #include <media/soc_camera.h> 27 28 #include <media/soc_camera_platform.h>
+2
arch/sh/boards/mach-ecovec24/setup.c
··· 29 29 #include <linux/input.h> 30 30 #include <linux/input/sh_keysc.h> 31 31 #include <linux/sh_eth.h> 32 + #include <linux/videodev2.h> 32 33 #include <video/sh_mobile_lcdc.h> 33 34 #include <sound/sh_fsi.h> 34 35 #include <media/sh_mobile_ceu.h> 36 + #include <media/soc_camera.h> 35 37 #include <media/tw9910.h> 36 38 #include <media/mt9t112.h> 37 39 #include <asm/heartbeat.h>
+1
arch/sh/boards/mach-kfr2r09/setup.c
··· 22 22 #include <linux/input/sh_keysc.h> 23 23 #include <linux/i2c.h> 24 24 #include <linux/usb/r8a66597.h> 25 + #include <linux/videodev2.h> 25 26 #include <media/rj54n1cb0c.h> 26 27 #include <media/soc_camera.h> 27 28 #include <media/sh_mobile_ceu.h>
+2
arch/sh/boards/mach-migor/setup.c
··· 21 21 #include <linux/delay.h> 22 22 #include <linux/clk.h> 23 23 #include <linux/gpio.h> 24 + #include <linux/videodev2.h> 24 25 #include <video/sh_mobile_lcdc.h> 25 26 #include <media/sh_mobile_ceu.h> 26 27 #include <media/ov772x.h> 28 + #include <media/soc_camera.h> 27 29 #include <media/tw9910.h> 28 30 #include <asm/clock.h> 29 31 #include <asm/machvec.h>
+1
arch/sh/boards/mach-se/7724/setup.c
··· 24 24 #include <linux/input/sh_keysc.h> 25 25 #include <linux/usb/r8a66597.h> 26 26 #include <linux/sh_eth.h> 27 + #include <linux/videodev2.h> 27 28 #include <video/sh_mobile_lcdc.h> 28 29 #include <media/sh_mobile_ceu.h> 29 30 #include <sound/sh_fsi.h>
+1 -1
arch/sh/drivers/pci/pci-sh7780.c
··· 74 74 { SH4_PCIINT_MLCK, "master lock error" }, 75 75 { SH4_PCIINT_TABT, "target-target abort" }, 76 76 { SH4_PCIINT_TRET, "target retry time out" }, 77 - { SH4_PCIINT_MFDE, "master function disable erorr" }, 77 + { SH4_PCIINT_MFDE, "master function disable error" }, 78 78 { SH4_PCIINT_PRTY, "address parity error" }, 79 79 { SH4_PCIINT_SERR, "SERR" }, 80 80 { SH4_PCIINT_TWDP, "data parity error for target write" },
+4 -4
arch/sh/include/asm/device.h
··· 3 3 * 4 4 * This file is released under the GPLv2 5 5 */ 6 + #ifndef __ASM_SH_DEVICE_H 7 + #define __ASM_SH_DEVICE_H 6 8 7 - struct dev_archdata { 8 - }; 9 + #include <asm-generic/device.h> 9 10 10 11 struct platform_device; 11 12 /* allocate contiguous memory chunk and fill in struct resource */ ··· 15 14 16 15 void plat_early_device_setup(void); 17 16 18 - struct pdev_archdata { 19 - }; 17 + #endif /* __ASM_SH_DEVICE_H */
+1 -1
arch/sh/kernel/cpu/sh4a/clock-sh7724.c
··· 343 343 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[HWBLK_CEU1]), 344 344 CLKDEV_CON_ID("beu1", &mstp_clks[HWBLK_BEU1]), 345 345 CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]), 346 - CLKDEV_CON_ID("spu0", &mstp_clks[HWBLK_SPU]), 346 + CLKDEV_DEV_ID("sh_fsi.0", &mstp_clks[HWBLK_SPU]), 347 347 CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]), 348 348 CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]), 349 349 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]),
+21 -1
arch/sh/kernel/cpu/sh4a/setup-sh7757.c
··· 133 133 [0] = { 134 134 .start = 0xfe002000, 135 135 .end = 0xfe0020ff, 136 - .flags = IORESOURCE_MEM, 136 + .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT, 137 137 }, 138 138 [1] = { 139 139 .start = 86, ··· 661 661 .resource = spi0_resources, 662 662 }; 663 663 664 + static struct resource spi1_resources[] = { 665 + { 666 + .start = 0xffd8ee70, 667 + .end = 0xffd8eeff, 668 + .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, 669 + }, 670 + { 671 + .start = 54, 672 + .flags = IORESOURCE_IRQ, 673 + }, 674 + }; 675 + 676 + static struct platform_device spi1_device = { 677 + .name = "sh_spi", 678 + .id = 1, 679 + .num_resources = ARRAY_SIZE(spi1_resources), 680 + .resource = spi1_resources, 681 + }; 682 + 664 683 static struct resource usb_ehci_resources[] = { 665 684 [0] = { 666 685 .start = 0xfe4f1000, ··· 739 720 &dma2_device, 740 721 &dma3_device, 741 722 &spi0_device, 723 + &spi1_device, 742 724 &usb_ehci_device, 743 725 &usb_ohci_device, 744 726 };
+1 -1
arch/sh/kernel/smp.c
··· 63 63 mp_ops->prepare_cpus(max_cpus); 64 64 65 65 #ifndef CONFIG_HOTPLUG_CPU 66 - init_cpu_present(&cpu_possible_map); 66 + init_cpu_present(cpu_possible_mask); 67 67 #endif 68 68 } 69 69
+1 -1
arch/sh/kernel/topology.c
··· 27 27 * Presently all SH-X3 SMP cores are multi-cores, so just keep it 28 28 * simple until we have a method for determining topology.. 29 29 */ 30 - return cpu_possible_map; 30 + return *cpu_possible_mask; 31 31 } 32 32 33 33 const struct cpumask *cpu_coregroup_mask(unsigned int cpu)
+2
arch/sh/mm/cache-sh2a.c
··· 23 23 #define MAX_OCACHE_PAGES 32 24 24 #define MAX_ICACHE_PAGES 32 25 25 26 + #ifdef CONFIG_CACHE_WRITEBACK 26 27 static void sh2a_flush_oc_line(unsigned long v, int way) 27 28 { 28 29 unsigned long addr = (v & 0x000007f0) | (way << 11); ··· 35 34 __raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr); 36 35 } 37 36 } 37 + #endif 38 38 39 39 static void sh2a_invalidate_line(unsigned long cache_addr, unsigned long v) 40 40 {
+38 -15
arch/x86/include/asm/i387.h
··· 29 29 extern void fpu_init(void); 30 30 extern void mxcsr_feature_mask_init(void); 31 31 extern int init_fpu(struct task_struct *child); 32 - extern void __math_state_restore(struct task_struct *); 33 32 extern void math_state_restore(void); 34 33 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *); 34 + 35 + DECLARE_PER_CPU(struct task_struct *, fpu_owner_task); 35 36 36 37 extern user_regset_active_fn fpregs_active, xfpregs_active; 37 38 extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get, ··· 270 269 271 270 static inline int restore_fpu_checking(struct task_struct *tsk) 272 271 { 272 + /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception 273 + is pending. Clear the x87 state here by setting it to fixed 274 + values. "m" is a random variable that should be in L1 */ 275 + alternative_input( 276 + ASM_NOP8 ASM_NOP2, 277 + "emms\n\t" /* clear stack tags */ 278 + "fildl %P[addr]", /* set F?P to defined value */ 279 + X86_FEATURE_FXSAVE_LEAK, 280 + [addr] "m" (tsk->thread.fpu.has_fpu)); 281 + 273 282 return fpu_restore_checking(&tsk->thread.fpu); 274 283 } 275 284 ··· 290 279 */ 291 280 static inline int __thread_has_fpu(struct task_struct *tsk) 292 281 { 293 - return tsk->thread.has_fpu; 282 + return tsk->thread.fpu.has_fpu; 294 283 } 295 284 296 285 /* Must be paired with an 'stts' after! */ 297 286 static inline void __thread_clear_has_fpu(struct task_struct *tsk) 298 287 { 299 - tsk->thread.has_fpu = 0; 288 + tsk->thread.fpu.has_fpu = 0; 289 + percpu_write(fpu_owner_task, NULL); 300 290 } 301 291 302 292 /* Must be paired with a 'clts' before! */ 303 293 static inline void __thread_set_has_fpu(struct task_struct *tsk) 304 294 { 305 - tsk->thread.has_fpu = 1; 295 + tsk->thread.fpu.has_fpu = 1; 296 + percpu_write(fpu_owner_task, tsk); 306 297 } 307 298 308 299 /* ··· 349 336 * We don't do that yet, so "fpu_lazy_restore()" always returns 350 337 * false, but some day.. 351 338 */ 352 - #define fpu_lazy_restore(tsk) (0) 353 - #define fpu_lazy_state_intact(tsk) do { } while (0) 339 + static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu) 340 + { 341 + return new == percpu_read_stable(fpu_owner_task) && 342 + cpu == new->thread.fpu.last_cpu; 343 + } 354 344 355 - static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct task_struct *new) 345 + static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct task_struct *new, int cpu) 356 346 { 357 347 fpu_switch_t fpu; 358 348 359 349 fpu.preload = tsk_used_math(new) && new->fpu_counter > 5; 360 350 if (__thread_has_fpu(old)) { 361 - if (__save_init_fpu(old)) 362 - fpu_lazy_state_intact(old); 363 - __thread_clear_has_fpu(old); 364 - old->fpu_counter++; 351 + if (!__save_init_fpu(old)) 352 + cpu = ~0; 353 + old->thread.fpu.last_cpu = cpu; 354 + old->thread.fpu.has_fpu = 0; /* But leave fpu_owner_task! */ 365 355 366 356 /* Don't change CR0.TS if we just switch! */ 367 357 if (fpu.preload) { 358 + new->fpu_counter++; 368 359 __thread_set_has_fpu(new); 369 360 prefetch(new->thread.fpu.state); 370 361 } else 371 362 stts(); 372 363 } else { 373 364 old->fpu_counter = 0; 365 + old->thread.fpu.last_cpu = ~0; 374 366 if (fpu.preload) { 375 - if (fpu_lazy_restore(new)) 367 + new->fpu_counter++; 368 + if (fpu_lazy_restore(new, cpu)) 376 369 fpu.preload = 0; 377 370 else 378 371 prefetch(new->thread.fpu.state); ··· 396 377 */ 397 378 static inline void switch_fpu_finish(struct task_struct *new, fpu_switch_t fpu) 398 379 { 399 - if (fpu.preload) 400 - __math_state_restore(new); 380 + if (fpu.preload) { 381 + if (unlikely(restore_fpu_checking(new))) 382 + __thread_fpu_end(new); 383 + } 401 384 } 402 385 403 386 /* ··· 472 451 __save_init_fpu(me); 473 452 __thread_clear_has_fpu(me); 474 453 /* We do 'stts()' in kernel_fpu_end() */ 475 - } else 454 + } else { 455 + percpu_write(fpu_owner_task, NULL); 476 456 clts(); 457 + } 477 458 } 478 459 479 460 static inline void kernel_fpu_end(void)
+8
arch/x86/include/asm/perf_event.h
··· 242 242 static inline void perf_events_lapic_init(void) { } 243 243 #endif 244 244 245 + #if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_AMD) 246 + extern void amd_pmu_enable_virt(void); 247 + extern void amd_pmu_disable_virt(void); 248 + #else 249 + static inline void amd_pmu_enable_virt(void) { } 250 + static inline void amd_pmu_disable_virt(void) { } 251 + #endif 252 + 245 253 #endif /* _ASM_X86_PERF_EVENT_H */
+2 -1
arch/x86/include/asm/processor.h
··· 374 374 }; 375 375 376 376 struct fpu { 377 + unsigned int last_cpu; 378 + unsigned int has_fpu; 377 379 union thread_xstate *state; 378 380 }; 379 381 ··· 456 454 unsigned long trap_no; 457 455 unsigned long error_code; 458 456 /* floating point and extended processor state */ 459 - unsigned long has_fpu; 460 457 struct fpu fpu; 461 458 #ifdef CONFIG_X86_32 462 459 /* Virtual 86 mode info */
+5
arch/x86/kernel/cpu/common.c
··· 1044 1044 1045 1045 DEFINE_PER_CPU(unsigned int, irq_count) = -1; 1046 1046 1047 + DEFINE_PER_CPU(struct task_struct *, fpu_owner_task); 1048 + EXPORT_PER_CPU_SYMBOL(fpu_owner_task); 1049 + 1047 1050 /* 1048 1051 * Special IST stacks which the CPU switches to when it calls 1049 1052 * an IST-marked descriptor entry. Up to 7 stacks (hardware ··· 1114 1111 1115 1112 DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task; 1116 1113 EXPORT_PER_CPU_SYMBOL(current_task); 1114 + DEFINE_PER_CPU(struct task_struct *, fpu_owner_task); 1115 + EXPORT_PER_CPU_SYMBOL(fpu_owner_task); 1117 1116 1118 1117 #ifdef CONFIG_CC_STACKPROTECTOR 1119 1118 DEFINE_PER_CPU_ALIGNED(struct stack_canary, stack_canary);
+36 -8
arch/x86/kernel/cpu/intel_cacheinfo.c
··· 326 326 l3->indices = (max(max3(sc0, sc1, sc2), sc3) << 10) - 1; 327 327 } 328 328 329 - static void __cpuinit amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, 330 - int index) 329 + static void __cpuinit amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index) 331 330 { 332 331 int node; 333 332 ··· 724 725 #define CPUID4_INFO_IDX(x, y) (&((per_cpu(ici_cpuid4_info, x))[y])) 725 726 726 727 #ifdef CONFIG_SMP 727 - static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) 728 + 729 + static int __cpuinit cache_shared_amd_cpu_map_setup(unsigned int cpu, int index) 728 730 { 729 - struct _cpuid4_info *this_leaf, *sibling_leaf; 730 - unsigned long num_threads_sharing; 731 - int index_msb, i, sibling; 731 + struct _cpuid4_info *this_leaf; 732 + int ret, i, sibling; 732 733 struct cpuinfo_x86 *c = &cpu_data(cpu); 733 734 734 - if ((index == 3) && (c->x86_vendor == X86_VENDOR_AMD)) { 735 + ret = 0; 736 + if (index == 3) { 737 + ret = 1; 735 738 for_each_cpu(i, cpu_llc_shared_mask(cpu)) { 736 739 if (!per_cpu(ici_cpuid4_info, i)) 737 740 continue; ··· 744 743 set_bit(sibling, this_leaf->shared_cpu_map); 745 744 } 746 745 } 747 - return; 746 + } else if ((c->x86 == 0x15) && ((index == 1) || (index == 2))) { 747 + ret = 1; 748 + for_each_cpu(i, cpu_sibling_mask(cpu)) { 749 + if (!per_cpu(ici_cpuid4_info, i)) 750 + continue; 751 + this_leaf = CPUID4_INFO_IDX(i, index); 752 + for_each_cpu(sibling, cpu_sibling_mask(cpu)) { 753 + if (!cpu_online(sibling)) 754 + continue; 755 + set_bit(sibling, this_leaf->shared_cpu_map); 756 + } 757 + } 748 758 } 759 + 760 + return ret; 761 + } 762 + 763 + static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) 764 + { 765 + struct _cpuid4_info *this_leaf, *sibling_leaf; 766 + unsigned long num_threads_sharing; 767 + int index_msb, i; 768 + struct cpuinfo_x86 *c = &cpu_data(cpu); 769 + 770 + if (c->x86_vendor == X86_VENDOR_AMD) { 771 + if (cache_shared_amd_cpu_map_setup(cpu, index)) 772 + return; 773 + } 774 + 749 775 this_leaf = CPUID4_INFO_IDX(cpu, index); 750 776 num_threads_sharing = 1 + this_leaf->base.eax.split.num_threads_sharing; 751 777
+2
arch/x86/kernel/cpu/mcheck/mce_amd.c
··· 528 528 529 529 sprintf(name, "threshold_bank%i", bank); 530 530 531 + #ifdef CONFIG_SMP 531 532 if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) { /* symlink */ 532 533 i = cpumask_first(cpu_llc_shared_mask(cpu)); 533 534 ··· 554 553 555 554 goto out; 556 555 } 556 + #endif 557 557 558 558 b = kzalloc(sizeof(struct threshold_bank), GFP_KERNEL); 559 559 if (!b) {
+6 -2
arch/x86/kernel/cpu/perf_event.h
··· 147 147 /* 148 148 * AMD specific bits 149 149 */ 150 - struct amd_nb *amd_nb; 150 + struct amd_nb *amd_nb; 151 + /* Inverted mask of bits to clear in the perf_ctr ctrl registers */ 152 + u64 perf_ctr_virt_mask; 151 153 152 154 void *kfree_on_online; 153 155 }; ··· 419 417 static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc, 420 418 u64 enable_mask) 421 419 { 420 + u64 disable_mask = __this_cpu_read(cpu_hw_events.perf_ctr_virt_mask); 421 + 422 422 if (hwc->extra_reg.reg) 423 423 wrmsrl(hwc->extra_reg.reg, hwc->extra_reg.config); 424 - wrmsrl(hwc->config_base, hwc->config | enable_mask); 424 + wrmsrl(hwc->config_base, (hwc->config | enable_mask) & ~disable_mask); 425 425 } 426 426 427 427 void x86_pmu_enable_all(int added);
+35 -2
arch/x86/kernel/cpu/perf_event_amd.c
··· 1 1 #include <linux/perf_event.h> 2 + #include <linux/export.h> 2 3 #include <linux/types.h> 3 4 #include <linux/init.h> 4 5 #include <linux/slab.h> ··· 358 357 struct amd_nb *nb; 359 358 int i, nb_id; 360 359 361 - if (boot_cpu_data.x86_max_cores < 2) 360 + cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY; 361 + 362 + if (boot_cpu_data.x86_max_cores < 2 || boot_cpu_data.x86 == 0x15) 362 363 return; 363 364 364 365 nb_id = amd_get_nb_id(cpu); ··· 590 587 .put_event_constraints = amd_put_event_constraints, 591 588 592 589 .cpu_prepare = amd_pmu_cpu_prepare, 593 - .cpu_starting = amd_pmu_cpu_starting, 594 590 .cpu_dead = amd_pmu_cpu_dead, 595 591 #endif 592 + .cpu_starting = amd_pmu_cpu_starting, 596 593 }; 597 594 598 595 __init int amd_pmu_init(void) ··· 624 621 625 622 return 0; 626 623 } 624 + 625 + void amd_pmu_enable_virt(void) 626 + { 627 + struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 628 + 629 + cpuc->perf_ctr_virt_mask = 0; 630 + 631 + /* Reload all events */ 632 + x86_pmu_disable_all(); 633 + x86_pmu_enable_all(0); 634 + } 635 + EXPORT_SYMBOL_GPL(amd_pmu_enable_virt); 636 + 637 + void amd_pmu_disable_virt(void) 638 + { 639 + struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 640 + 641 + /* 642 + * We only mask out the Host-only bit so that host-only counting works 643 + * when SVM is disabled. If someone sets up a guest-only counter when 644 + * SVM is disabled the Guest-only bits still gets set and the counter 645 + * will not count anything. 646 + */ 647 + cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY; 648 + 649 + /* Reload all events */ 650 + x86_pmu_disable_all(); 651 + x86_pmu_enable_all(0); 652 + } 653 + EXPORT_SYMBOL_GPL(amd_pmu_disable_virt);
+8 -1
arch/x86/kernel/entry_64.S
··· 1532 1532 pushq_cfi %rdx 1533 1533 1534 1534 /* 1535 + * If %cs was not the kernel segment, then the NMI triggered in user 1536 + * space, which means it is definitely not nested. 1537 + */ 1538 + cmpl $__KERNEL_CS, 16(%rsp) 1539 + jne first_nmi 1540 + 1541 + /* 1535 1542 * Check the special variable on the stack to see if NMIs are 1536 1543 * executing. 1537 1544 */ 1538 - cmp $1, -8(%rsp) 1545 + cmpl $1, -8(%rsp) 1539 1546 je nested_nmi 1540 1547 1541 1548 /*
-1
arch/x86/kernel/microcode_amd.c
··· 360 360 static enum ucode_state 361 361 request_microcode_user(int cpu, const void __user *buf, size_t size) 362 362 { 363 - pr_info("AMD microcode update via /dev/cpu/microcode not supported\n"); 364 363 return UCODE_ERROR; 365 364 } 366 365
+2 -1
arch/x86/kernel/process_32.c
··· 214 214 215 215 task_user_gs(p) = get_user_gs(regs); 216 216 217 + p->fpu_counter = 0; 217 218 p->thread.io_bitmap_ptr = NULL; 218 219 tsk = current; 219 220 err = -ENOMEM; ··· 304 303 305 304 /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */ 306 305 307 - fpu = switch_fpu_prepare(prev_p, next_p); 306 + fpu = switch_fpu_prepare(prev_p, next_p, cpu); 308 307 309 308 /* 310 309 * Reload esp0.
+2 -1
arch/x86/kernel/process_64.c
··· 286 286 287 287 set_tsk_thread_flag(p, TIF_FORK); 288 288 289 + p->fpu_counter = 0; 289 290 p->thread.io_bitmap_ptr = NULL; 290 291 291 292 savesegment(gs, p->thread.gsindex); ··· 389 388 unsigned fsindex, gsindex; 390 389 fpu_switch_t fpu; 391 390 392 - fpu = switch_fpu_prepare(prev_p, next_p); 391 + fpu = switch_fpu_prepare(prev_p, next_p, cpu); 393 392 394 393 /* 395 394 * Reload esp0, LDT and the page table pointer:
+8 -32
arch/x86/kernel/traps.c
··· 571 571 } 572 572 573 573 /* 574 - * This gets called with the process already owning the 575 - * FPU state, and with CR0.TS cleared. It just needs to 576 - * restore the FPU register state. 577 - */ 578 - void __math_state_restore(struct task_struct *tsk) 579 - { 580 - /* We need a safe address that is cheap to find and that is already 581 - in L1. We've just brought in "tsk->thread.has_fpu", so use that */ 582 - #define safe_address (tsk->thread.has_fpu) 583 - 584 - /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception 585 - is pending. Clear the x87 state here by setting it to fixed 586 - values. safe_address is a random variable that should be in L1 */ 587 - alternative_input( 588 - ASM_NOP8 ASM_NOP2, 589 - "emms\n\t" /* clear stack tags */ 590 - "fildl %P[addr]", /* set F?P to defined value */ 591 - X86_FEATURE_FXSAVE_LEAK, 592 - [addr] "m" (safe_address)); 593 - 594 - /* 595 - * Paranoid restore. send a SIGSEGV if we fail to restore the state. 596 - */ 597 - if (unlikely(restore_fpu_checking(tsk))) { 598 - __thread_fpu_end(tsk); 599 - force_sig(SIGSEGV, tsk); 600 - return; 601 - } 602 - } 603 - 604 - /* 605 574 * 'math_state_restore()' saves the current math information in the 606 575 * old math state array, and gets the new ones from the current task 607 576 * ··· 600 631 } 601 632 602 633 __thread_fpu_begin(tsk); 603 - __math_state_restore(tsk); 634 + /* 635 + * Paranoid restore. send a SIGSEGV if we fail to restore the state. 636 + */ 637 + if (unlikely(restore_fpu_checking(tsk))) { 638 + __thread_fpu_end(tsk); 639 + force_sig(SIGSEGV, tsk); 640 + return; 641 + } 604 642 605 643 tsk->fpu_counter++; 606 644 }
+5
arch/x86/kvm/svm.c
··· 29 29 #include <linux/ftrace_event.h> 30 30 #include <linux/slab.h> 31 31 32 + #include <asm/perf_event.h> 32 33 #include <asm/tlbflush.h> 33 34 #include <asm/desc.h> 34 35 #include <asm/kvm_para.h> ··· 576 575 wrmsrl(MSR_AMD64_TSC_RATIO, TSC_RATIO_DEFAULT); 577 576 578 577 cpu_svm_disable(); 578 + 579 + amd_pmu_disable_virt(); 579 580 } 580 581 581 582 static int svm_hardware_enable(void *garbage) ··· 624 621 } 625 622 626 623 svm_init_erratum_383(); 624 + 625 + amd_pmu_enable_virt(); 627 626 628 627 return 0; 629 628 }
+2 -4
arch/x86/xen/enlighten.c
··· 1141 1141 1142 1142 /* Prevent unwanted bits from being set in PTEs. */ 1143 1143 __supported_pte_mask &= ~_PAGE_GLOBAL; 1144 + #if 0 1144 1145 if (!xen_initial_domain()) 1146 + #endif 1145 1147 __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD); 1146 1148 1147 1149 __supported_pte_mask |= _PAGE_IOMAP; ··· 1206 1204 1207 1205 pgd = (pgd_t *)xen_start_info->pt_base; 1208 1206 1209 - if (!xen_initial_domain()) 1210 - __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD); 1211 - 1212 - __supported_pte_mask |= _PAGE_IOMAP; 1213 1207 /* Don't do the full vcpu_info placement stuff until we have a 1214 1208 possible map and a non-dummy shared_info. */ 1215 1209 per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
+4 -4
arch/x86/xen/mmu.c
··· 415 415 static pteval_t xen_pte_val(pte_t pte) 416 416 { 417 417 pteval_t pteval = pte.pte; 418 - 418 + #if 0 419 419 /* If this is a WC pte, convert back from Xen WC to Linux WC */ 420 420 if ((pteval & (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT)) == _PAGE_PAT) { 421 421 WARN_ON(!pat_enabled); 422 422 pteval = (pteval & ~_PAGE_PAT) | _PAGE_PWT; 423 423 } 424 - 424 + #endif 425 425 if (xen_initial_domain() && (pteval & _PAGE_IOMAP)) 426 426 return pteval; 427 427 ··· 463 463 static pte_t xen_make_pte(pteval_t pte) 464 464 { 465 465 phys_addr_t addr = (pte & PTE_PFN_MASK); 466 - 466 + #if 0 467 467 /* If Linux is trying to set a WC pte, then map to the Xen WC. 468 468 * If _PAGE_PAT is set, then it probably means it is really 469 469 * _PAGE_PSE, so avoid fiddling with the PAT mapping and hope ··· 476 476 if ((pte & (_PAGE_PCD | _PAGE_PWT)) == _PAGE_PWT) 477 477 pte = (pte & ~(_PAGE_PCD | _PAGE_PWT)) | _PAGE_PAT; 478 478 } 479 - 479 + #endif 480 480 /* 481 481 * Unprivileged domains are allowed to do IOMAPpings for 482 482 * PCI passthrough, but not map ISA space. The ISA
+4 -7
block/partitions/ldm.c
··· 2 2 * ldm - Support for Windows Logical Disk Manager (Dynamic Disks) 3 3 * 4 4 * Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org> 5 - * Copyright (c) 2001-2007 Anton Altaparmakov 5 + * Copyright (c) 2001-2012 Anton Altaparmakov 6 6 * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com> 7 7 * 8 8 * Documentation is available at http://www.linux-ntfs.org/doku.php?id=downloads ··· 1341 1341 ldm_error("REC value (%d) exceeds NUM value (%d)", rec, f->num); 1342 1342 return false; 1343 1343 } 1344 - 1345 1344 if (f->map & (1 << rec)) { 1346 1345 ldm_error ("Duplicate VBLK, part %d.", rec); 1347 1346 f->map &= 0x7F; /* Mark the group as broken */ 1348 1347 return false; 1349 1348 } 1350 - 1351 1349 f->map |= (1 << rec); 1352 - 1350 + if (!rec) 1351 + memcpy(f->data, data, VBLK_SIZE_HEAD); 1353 1352 data += VBLK_SIZE_HEAD; 1354 1353 size -= VBLK_SIZE_HEAD; 1355 - 1356 - memcpy (f->data+rec*(size-VBLK_SIZE_HEAD)+VBLK_SIZE_HEAD, data, size); 1357 - 1354 + memcpy(f->data + VBLK_SIZE_HEAD + rec * size, data, size); 1358 1355 return true; 1359 1356 } 1360 1357
+2 -2
drivers/atm/solos-pci.c
··· 1206 1206 1207 1207 out_unmap_both: 1208 1208 pci_set_drvdata(dev, NULL); 1209 - pci_iounmap(dev, card->config_regs); 1210 - out_unmap_config: 1211 1209 pci_iounmap(dev, card->buffers); 1210 + out_unmap_config: 1211 + pci_iounmap(dev, card->config_regs); 1212 1212 out_release_regions: 1213 1213 pci_release_regions(dev); 1214 1214 out:
+2
drivers/block/nvme.c
··· 41 41 #include <linux/types.h> 42 42 #include <linux/version.h> 43 43 44 + #include <asm-generic/io-64-nonatomic-lo-hi.h> 45 + 44 46 #define NVME_Q_DEPTH 1024 45 47 #define SQ_SIZE(depth) (depth * sizeof(struct nvme_command)) 46 48 #define CQ_SIZE(depth) (depth * sizeof(struct nvme_completion))
+1 -3
drivers/bluetooth/btusb.c
··· 102 102 103 103 /* Broadcom BCM20702A0 */ 104 104 { USB_DEVICE(0x0a5c, 0x21e3) }, 105 + { USB_DEVICE(0x0a5c, 0x21f3) }, 105 106 { USB_DEVICE(0x413c, 0x8197) }, 106 107 107 108 { } /* Terminating entry */ ··· 726 725 727 726 usb_fill_bulk_urb(urb, data->udev, pipe, 728 727 skb->data, skb->len, btusb_tx_complete, skb); 729 - 730 - if (skb->priority >= HCI_PRIO_MAX - 1) 731 - urb->transfer_flags = URB_ISO_ASAP; 732 728 733 729 hdev->stat.acl_tx++; 734 730 break;
+1 -1
drivers/cpuidle/Kconfig
··· 1 1 2 2 config CPU_IDLE 3 3 bool "CPU idle PM support" 4 - default ACPI 4 + default y if ACPI || PPC_PSERIES 5 5 help 6 6 CPU idle is a generic framework for supporting software-controlled 7 7 idle processor power management. It includes modular cross-platform
+1
drivers/crypto/mv_cesa.c
··· 714 714 { 715 715 struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); 716 716 717 + ahash_request_set_crypt(req, NULL, req->result, 0); 717 718 mv_update_hash_req_ctx(ctx, 1, 0); 718 719 return mv_handle_req(&req->base); 719 720 }
+2 -13
drivers/edac/i3200_edac.c
··· 15 15 #include <linux/io.h> 16 16 #include "edac_core.h" 17 17 18 + #include <asm-generic/io-64-nonatomic-lo-hi.h> 19 + 18 20 #define I3200_REVISION "1.1" 19 21 20 22 #define EDAC_MOD_STR "i3200_edac" ··· 102 100 }; 103 101 104 102 static int nr_channels; 105 - 106 - #ifndef readq 107 - static inline __u64 readq(const volatile void __iomem *addr) 108 - { 109 - const volatile u32 __iomem *p = addr; 110 - u32 low, high; 111 - 112 - low = readl(p); 113 - high = readl(p + 1); 114 - 115 - return low + ((u64)high << 32); 116 - } 117 - #endif 118 103 119 104 static int how_many_channels(struct pci_dev *pdev) 120 105 {
+11 -5
drivers/gpu/drm/exynos/exynos_drm_connector.c
··· 28 28 #include "drmP.h" 29 29 #include "drm_crtc_helper.h" 30 30 31 + #include <drm/exynos_drm.h> 31 32 #include "exynos_drm_drv.h" 32 33 #include "exynos_drm_encoder.h" 33 34 ··· 45 44 /* convert exynos_video_timings to drm_display_mode */ 46 45 static inline void 47 46 convert_to_display_mode(struct drm_display_mode *mode, 48 - struct fb_videomode *timing) 47 + struct exynos_drm_panel_info *panel) 49 48 { 49 + struct fb_videomode *timing = &panel->timing; 50 50 DRM_DEBUG_KMS("%s\n", __FILE__); 51 51 52 52 mode->clock = timing->pixclock / 1000; ··· 62 60 mode->vsync_start = mode->vdisplay + timing->upper_margin; 63 61 mode->vsync_end = mode->vsync_start + timing->vsync_len; 64 62 mode->vtotal = mode->vsync_end + timing->lower_margin; 63 + mode->width_mm = panel->width_mm; 64 + mode->height_mm = panel->height_mm; 65 65 66 66 if (timing->vmode & FB_VMODE_INTERLACED) 67 67 mode->flags |= DRM_MODE_FLAG_INTERLACE; ··· 152 148 connector->display_info.raw_edid = edid; 153 149 } else { 154 150 struct drm_display_mode *mode = drm_mode_create(connector->dev); 155 - struct fb_videomode *timing; 151 + struct exynos_drm_panel_info *panel; 156 152 157 - if (display_ops->get_timing) 158 - timing = display_ops->get_timing(manager->dev); 153 + if (display_ops->get_panel) 154 + panel = display_ops->get_panel(manager->dev); 159 155 else { 160 156 drm_mode_destroy(connector->dev, mode); 161 157 return 0; 162 158 } 163 159 164 - convert_to_display_mode(mode, timing); 160 + convert_to_display_mode(mode, panel); 161 + connector->display_info.width_mm = mode->width_mm; 162 + connector->display_info.height_mm = mode->height_mm; 165 163 166 164 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; 167 165 drm_mode_set_name(mode);
+3
drivers/gpu/drm/exynos/exynos_drm_core.c
··· 193 193 return err; 194 194 } 195 195 196 + /* setup possible_clones. */ 197 + exynos_drm_encoder_setup(drm_dev); 198 + 196 199 /* 197 200 * if any specific driver such as fimd or hdmi driver called 198 201 * exynos_drm_subdrv_register() later than drm_load(),
+3 -3
drivers/gpu/drm/exynos/exynos_drm_crtc.c
··· 307 307 */ 308 308 event->pipe = exynos_crtc->pipe; 309 309 310 - list_add_tail(&event->base.link, 311 - &dev_priv->pageflip_event_list); 312 - 313 310 ret = drm_vblank_get(dev, exynos_crtc->pipe); 314 311 if (ret) { 315 312 DRM_DEBUG("failed to acquire vblank counter\n"); ··· 314 317 315 318 goto out; 316 319 } 320 + 321 + list_add_tail(&event->base.link, 322 + &dev_priv->pageflip_event_list); 317 323 318 324 crtc->fb = fb; 319 325 ret = exynos_drm_crtc_update(crtc);
+18 -8
drivers/gpu/drm/exynos/exynos_drm_drv.c
··· 33 33 34 34 #include "exynos_drm_drv.h" 35 35 #include "exynos_drm_crtc.h" 36 + #include "exynos_drm_encoder.h" 36 37 #include "exynos_drm_fbdev.h" 37 38 #include "exynos_drm_fb.h" 38 39 #include "exynos_drm_gem.h" ··· 100 99 if (ret) 101 100 goto err_vblank; 102 101 102 + /* setup possible_clones. */ 103 + exynos_drm_encoder_setup(dev); 104 + 103 105 /* 104 106 * create and configure fb helper and also exynos specific 105 107 * fbdev object. ··· 145 141 } 146 142 147 143 static void exynos_drm_preclose(struct drm_device *dev, 148 - struct drm_file *file_priv) 144 + struct drm_file *file) 149 145 { 150 - struct exynos_drm_private *dev_priv = dev->dev_private; 146 + DRM_DEBUG_DRIVER("%s\n", __FILE__); 151 147 152 - /* 153 - * drm framework frees all events at release time, 154 - * so private event list should be cleared. 155 - */ 156 - if (!list_empty(&dev_priv->pageflip_event_list)) 157 - INIT_LIST_HEAD(&dev_priv->pageflip_event_list); 148 + } 149 + 150 + static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file) 151 + { 152 + DRM_DEBUG_DRIVER("%s\n", __FILE__); 153 + 154 + if (!file->driver_priv) 155 + return; 156 + 157 + kfree(file->driver_priv); 158 + file->driver_priv = NULL; 158 159 } 159 160 160 161 static void exynos_drm_lastclose(struct drm_device *dev) ··· 204 195 .unload = exynos_drm_unload, 205 196 .preclose = exynos_drm_preclose, 206 197 .lastclose = exynos_drm_lastclose, 198 + .postclose = exynos_drm_postclose, 207 199 .get_vblank_counter = drm_vblank_count, 208 200 .enable_vblank = exynos_drm_crtc_enable_vblank, 209 201 .disable_vblank = exynos_drm_crtc_disable_vblank,
+2 -2
drivers/gpu/drm/exynos/exynos_drm_drv.h
··· 136 136 * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI. 137 137 * @is_connected: check for that display is connected or not. 138 138 * @get_edid: get edid modes from display driver. 139 - * @get_timing: get timing object from display driver. 139 + * @get_panel: get panel object from display driver. 140 140 * @check_timing: check if timing is valid or not. 141 141 * @power_on: display device on or off. 142 142 */ ··· 145 145 bool (*is_connected)(struct device *dev); 146 146 int (*get_edid)(struct device *dev, struct drm_connector *connector, 147 147 u8 *edid, int len); 148 - void *(*get_timing)(struct device *dev); 148 + void *(*get_panel)(struct device *dev); 149 149 int (*check_timing)(struct device *dev, void *timing); 150 150 int (*power_on)(struct device *dev, int mode); 151 151 };
+34
drivers/gpu/drm/exynos/exynos_drm_encoder.c
··· 195 195 .destroy = exynos_drm_encoder_destroy, 196 196 }; 197 197 198 + static unsigned int exynos_drm_encoder_clones(struct drm_encoder *encoder) 199 + { 200 + struct drm_encoder *clone; 201 + struct drm_device *dev = encoder->dev; 202 + struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder); 203 + struct exynos_drm_display_ops *display_ops = 204 + exynos_encoder->manager->display_ops; 205 + unsigned int clone_mask = 0; 206 + int cnt = 0; 207 + 208 + list_for_each_entry(clone, &dev->mode_config.encoder_list, head) { 209 + switch (display_ops->type) { 210 + case EXYNOS_DISPLAY_TYPE_LCD: 211 + case EXYNOS_DISPLAY_TYPE_HDMI: 212 + clone_mask |= (1 << (cnt++)); 213 + break; 214 + default: 215 + continue; 216 + } 217 + } 218 + 219 + return clone_mask; 220 + } 221 + 222 + void exynos_drm_encoder_setup(struct drm_device *dev) 223 + { 224 + struct drm_encoder *encoder; 225 + 226 + DRM_DEBUG_KMS("%s\n", __FILE__); 227 + 228 + list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) 229 + encoder->possible_clones = exynos_drm_encoder_clones(encoder); 230 + } 231 + 198 232 struct drm_encoder * 199 233 exynos_drm_encoder_create(struct drm_device *dev, 200 234 struct exynos_drm_manager *manager,
+1
drivers/gpu/drm/exynos/exynos_drm_encoder.h
··· 30 30 31 31 struct exynos_drm_manager; 32 32 33 + void exynos_drm_encoder_setup(struct drm_device *dev); 33 34 struct drm_encoder *exynos_drm_encoder_create(struct drm_device *dev, 34 35 struct exynos_drm_manager *mgr, 35 36 unsigned int possible_crtcs);
+4 -66
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
··· 195 195 return ret; 196 196 } 197 197 198 - static bool 199 - exynos_drm_fbdev_is_samefb(struct drm_framebuffer *fb, 200 - struct drm_fb_helper_surface_size *sizes) 201 - { 202 - if (fb->width != sizes->surface_width) 203 - return false; 204 - if (fb->height != sizes->surface_height) 205 - return false; 206 - if (fb->bits_per_pixel != sizes->surface_bpp) 207 - return false; 208 - if (fb->depth != sizes->surface_depth) 209 - return false; 210 - 211 - return true; 212 - } 213 - 214 - static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper, 215 - struct drm_fb_helper_surface_size *sizes) 216 - { 217 - struct drm_device *dev = helper->dev; 218 - struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper); 219 - struct exynos_drm_gem_obj *exynos_gem_obj; 220 - struct drm_framebuffer *fb = helper->fb; 221 - struct drm_mode_fb_cmd2 mode_cmd = { 0 }; 222 - unsigned long size; 223 - 224 - DRM_DEBUG_KMS("%s\n", __FILE__); 225 - 226 - if (exynos_drm_fbdev_is_samefb(fb, sizes)) 227 - return 0; 228 - 229 - mode_cmd.width = sizes->surface_width; 230 - mode_cmd.height = sizes->surface_height; 231 - mode_cmd.pitches[0] = sizes->surface_width * (sizes->surface_bpp >> 3); 232 - mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, 233 - sizes->surface_depth); 234 - 235 - if (exynos_fbdev->exynos_gem_obj) 236 - exynos_drm_gem_destroy(exynos_fbdev->exynos_gem_obj); 237 - 238 - if (fb->funcs->destroy) 239 - fb->funcs->destroy(fb); 240 - 241 - size = mode_cmd.pitches[0] * mode_cmd.height; 242 - exynos_gem_obj = exynos_drm_gem_create(dev, size); 243 - if (IS_ERR(exynos_gem_obj)) 244 - return PTR_ERR(exynos_gem_obj); 245 - 246 - exynos_fbdev->exynos_gem_obj = exynos_gem_obj; 247 - 248 - helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd, 249 - &exynos_gem_obj->base); 250 - if (IS_ERR_OR_NULL(helper->fb)) { 251 - DRM_ERROR("failed to create drm framebuffer.\n"); 252 - return PTR_ERR(helper->fb); 253 - } 254 - 255 - return exynos_drm_fbdev_update(helper, helper->fb); 256 - } 257 - 258 198 static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper, 259 199 struct drm_fb_helper_surface_size *sizes) 260 200 { ··· 202 262 203 263 DRM_DEBUG_KMS("%s\n", __FILE__); 204 264 265 + /* 266 + * with !helper->fb, it means that this funcion is called first time 267 + * and after that, the helper->fb would be used as clone mode. 268 + */ 205 269 if (!helper->fb) { 206 270 ret = exynos_drm_fbdev_create(helper, sizes); 207 271 if (ret < 0) { ··· 218 274 * because register_framebuffer() should be called. 219 275 */ 220 276 ret = 1; 221 - } else { 222 - ret = exynos_drm_fbdev_recreate(helper, sizes); 223 - if (ret < 0) { 224 - DRM_ERROR("failed to reconfigure fbdev\n"); 225 - return ret; 226 - } 227 277 } 228 278 229 279 return ret;
+20 -14
drivers/gpu/drm/exynos/exynos_drm_fimd.c
··· 89 89 bool suspended; 90 90 struct mutex lock; 91 91 92 - struct fb_videomode *timing; 92 + struct exynos_drm_panel_info *panel; 93 93 }; 94 94 95 95 static bool fimd_display_is_connected(struct device *dev) ··· 101 101 return true; 102 102 } 103 103 104 - static void *fimd_get_timing(struct device *dev) 104 + static void *fimd_get_panel(struct device *dev) 105 105 { 106 106 struct fimd_context *ctx = get_fimd_context(dev); 107 107 108 108 DRM_DEBUG_KMS("%s\n", __FILE__); 109 109 110 - return ctx->timing; 110 + return ctx->panel; 111 111 } 112 112 113 113 static int fimd_check_timing(struct device *dev, void *timing) ··· 131 131 static struct exynos_drm_display_ops fimd_display_ops = { 132 132 .type = EXYNOS_DISPLAY_TYPE_LCD, 133 133 .is_connected = fimd_display_is_connected, 134 - .get_timing = fimd_get_timing, 134 + .get_panel = fimd_get_panel, 135 135 .check_timing = fimd_check_timing, 136 136 .power_on = fimd_display_power_on, 137 137 }; ··· 193 193 static void fimd_commit(struct device *dev) 194 194 { 195 195 struct fimd_context *ctx = get_fimd_context(dev); 196 - struct fb_videomode *timing = ctx->timing; 196 + struct exynos_drm_panel_info *panel = ctx->panel; 197 + struct fb_videomode *timing = &panel->timing; 197 198 u32 val; 198 199 199 200 if (ctx->suspended) ··· 605 604 } 606 605 607 606 if (is_checked) { 608 - drm_vblank_put(drm_dev, crtc); 607 + /* 608 + * call drm_vblank_put only in case that drm_vblank_get was 609 + * called. 610 + */ 611 + if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0) 612 + drm_vblank_put(drm_dev, crtc); 609 613 610 614 /* 611 615 * don't off vblank if vblank_disable_allowed is 1, ··· 787 781 struct fimd_context *ctx; 788 782 struct exynos_drm_subdrv *subdrv; 789 783 struct exynos_drm_fimd_pdata *pdata; 790 - struct fb_videomode *timing; 784 + struct exynos_drm_panel_info *panel; 791 785 struct resource *res; 792 786 int win; 793 787 int ret = -EINVAL; ··· 800 794 return -EINVAL; 801 795 } 802 796 803 - timing = &pdata->timing; 804 - if (!timing) { 805 - dev_err(dev, "timing is null.\n"); 797 + panel = &pdata->panel; 798 + if (!panel) { 799 + dev_err(dev, "panel is null.\n"); 806 800 return -EINVAL; 807 801 } 808 802 ··· 864 858 goto err_req_irq; 865 859 } 866 860 867 - ctx->clkdiv = fimd_calc_clkdiv(ctx, timing); 861 + ctx->clkdiv = fimd_calc_clkdiv(ctx, &panel->timing); 868 862 ctx->vidcon0 = pdata->vidcon0; 869 863 ctx->vidcon1 = pdata->vidcon1; 870 864 ctx->default_win = pdata->default_win; 871 - ctx->timing = timing; 865 + ctx->panel = panel; 872 866 873 - timing->pixclock = clk_get_rate(ctx->lcd_clk) / ctx->clkdiv; 867 + panel->timing.pixclock = clk_get_rate(ctx->lcd_clk) / ctx->clkdiv; 874 868 875 869 DRM_DEBUG_KMS("pixel clock = %d, clkdiv = %d\n", 876 - timing->pixclock, ctx->clkdiv); 870 + panel->timing.pixclock, ctx->clkdiv); 877 871 878 872 subdrv = &ctx->subdrv; 879 873
+12 -7
drivers/gpu/drm/exynos/exynos_mixer.c
··· 712 712 } 713 713 714 714 if (is_checked) 715 - drm_vblank_put(drm_dev, crtc); 715 + /* 716 + * call drm_vblank_put only in case that drm_vblank_get was 717 + * called. 718 + */ 719 + if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0) 720 + drm_vblank_put(drm_dev, crtc); 716 721 717 722 spin_unlock_irqrestore(&drm_dev->event_lock, flags); 718 723 } ··· 784 779 mixer_reg_writemask(res, MXR_STATUS, MXR_STATUS_16_BURST, 785 780 MXR_STATUS_BURST_MASK); 786 781 787 - /* setting default layer priority: layer1 > video > layer0 782 + /* setting default layer priority: layer1 > layer0 > video 788 783 * because typical usage scenario would be 784 + * layer1 - OSD 789 785 * layer0 - framebuffer 790 786 * video - video overlay 791 - * layer1 - OSD 792 787 */ 793 - val = MXR_LAYER_CFG_GRP0_VAL(1); 794 - val |= MXR_LAYER_CFG_VP_VAL(2); 795 - val |= MXR_LAYER_CFG_GRP1_VAL(3); 788 + val = MXR_LAYER_CFG_GRP1_VAL(3); 789 + val |= MXR_LAYER_CFG_GRP0_VAL(2); 790 + val |= MXR_LAYER_CFG_VP_VAL(1); 796 791 mixer_reg_write(res, MXR_LAYER_CFG, val); 797 792 798 793 /* setting background color */ ··· 1049 1044 platform_get_drvdata(pdev); 1050 1045 struct mixer_context *ctx = (struct mixer_context *)drm_hdmi_ctx->ctx; 1051 1046 1052 - dev_info(dev, "remove sucessful\n"); 1047 + dev_info(dev, "remove successful\n"); 1053 1048 1054 1049 mixer_resource_poweroff(ctx); 1055 1050 mixer_resources_cleanup(ctx);
+15
drivers/gpu/drm/i915/i915_reg.h
··· 3028 3028 #define DISP_TILE_SURFACE_SWIZZLING (1<<13) 3029 3029 #define DISP_FBC_WM_DIS (1<<15) 3030 3030 3031 + /* GEN7 chicken */ 3032 + #define GEN7_COMMON_SLICE_CHICKEN1 0x7010 3033 + # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC ((1<<10) | (1<<26)) 3034 + 3035 + #define GEN7_L3CNTLREG1 0xB01C 3036 + #define GEN7_WA_FOR_GEN7_L3_CONTROL 0x3C4FFF8C 3037 + 3038 + #define GEN7_L3_CHICKEN_MODE_REGISTER 0xB030 3039 + #define GEN7_WA_L3_CHICKEN_MODE 0x20000000 3040 + 3041 + /* WaCatErrorRejectionIssue */ 3042 + #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG 0x9030 3043 + #define GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB (1<<11) 3044 + 3031 3045 /* PCH */ 3032 3046 3033 3047 /* south display engine interrupt */ ··· 3632 3618 #define GT_FIFO_NUM_RESERVED_ENTRIES 20 3633 3619 3634 3620 #define GEN6_UCGCTL2 0x9404 3621 + # define GEN6_RCZUNIT_CLOCK_GATE_DISABLE (1 << 13) 3635 3622 # define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12) 3636 3623 # define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11) 3637 3624
+33 -4
drivers/gpu/drm/i915/intel_display.c
··· 4680 4680 4681 4681 crtc = intel_get_crtc_for_plane(dev, plane); 4682 4682 clock = crtc->mode.clock; 4683 + if (!clock) { 4684 + *sprite_wm = 0; 4685 + return false; 4686 + } 4683 4687 4684 4688 line_time_us = (sprite_width * 1000) / clock; 4689 + if (!line_time_us) { 4690 + *sprite_wm = 0; 4691 + return false; 4692 + } 4693 + 4685 4694 line_count = (latency_ns / line_time_us + 1000) / 1000; 4686 4695 line_size = sprite_width * pixel_size; 4687 4696 ··· 6184 6175 int i; 6185 6176 6186 6177 /* The clocks have to be on to load the palette. */ 6187 - if (!crtc->enabled) 6178 + if (!crtc->enabled || !intel_crtc->active) 6188 6179 return; 6189 6180 6190 6181 /* use legacy palette for Ironlake */ ··· 6570 6561 mode_cmd.height = mode->vdisplay; 6571 6562 mode_cmd.pitches[0] = intel_framebuffer_pitch_for_width(mode_cmd.width, 6572 6563 bpp); 6573 - mode_cmd.pixel_format = 0; 6564 + mode_cmd.pixel_format = drm_mode_legacy_fb_format(bpp, depth); 6574 6565 6575 6566 return intel_framebuffer_create(dev, &mode_cmd, obj); 6576 6567 } ··· 8193 8184 I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ 8194 8185 8195 8186 if (intel_enable_rc6(dev_priv->dev)) 8196 - rc6_mask = GEN6_RC_CTL_RC6p_ENABLE | 8197 - GEN6_RC_CTL_RC6_ENABLE; 8187 + rc6_mask = GEN6_RC_CTL_RC6_ENABLE | 8188 + ((IS_GEN7(dev_priv->dev)) ? GEN6_RC_CTL_RC6p_ENABLE : 0); 8198 8189 8199 8190 I915_WRITE(GEN6_RC_CONTROL, 8200 8191 rc6_mask | ··· 8472 8463 I915_WRITE(WM2_LP_ILK, 0); 8473 8464 I915_WRITE(WM1_LP_ILK, 0); 8474 8465 8466 + /* According to the spec, bit 13 (RCZUNIT) must be set on IVB. 8467 + * This implements the WaDisableRCZUnitClockGating workaround. 8468 + */ 8469 + I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE); 8470 + 8475 8471 I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE); 8476 8472 8477 8473 I915_WRITE(IVB_CHICKEN3, 8478 8474 CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE | 8479 8475 CHICKEN3_DGMG_DONE_FIX_DISABLE); 8476 + 8477 + /* Apply the WaDisableRHWOOptimizationForRenderHang workaround. */ 8478 + I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1, 8479 + GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC); 8480 + 8481 + /* WaApplyL3ControlAndL3ChickenMode requires those two on Ivy Bridge */ 8482 + I915_WRITE(GEN7_L3CNTLREG1, 8483 + GEN7_WA_FOR_GEN7_L3_CONTROL); 8484 + I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER, 8485 + GEN7_WA_L3_CHICKEN_MODE); 8486 + 8487 + /* This is required by WaCatErrorRejectionIssue */ 8488 + I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG, 8489 + I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) | 8490 + GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB); 8480 8491 8481 8492 for_each_pipe(pipe) { 8482 8493 I915_WRITE(DSPCNTR(pipe),
+1 -13
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 301 301 302 302 I915_WRITE_CTL(ring, 303 303 ((ring->size - PAGE_SIZE) & RING_NR_PAGES) 304 - | RING_REPORT_64K | RING_VALID); 304 + | RING_VALID); 305 305 306 306 /* If the head is still not zero, the ring is dead */ 307 307 if ((I915_READ_CTL(ring) & RING_VALID) == 0 || ··· 1132 1132 struct drm_device *dev = ring->dev; 1133 1133 struct drm_i915_private *dev_priv = dev->dev_private; 1134 1134 unsigned long end; 1135 - u32 head; 1136 - 1137 - /* If the reported head position has wrapped or hasn't advanced, 1138 - * fallback to the slow and accurate path. 1139 - */ 1140 - head = intel_read_status_page(ring, 4); 1141 - if (head > ring->head) { 1142 - ring->head = head; 1143 - ring->space = ring_space(ring); 1144 - if (ring->space >= n) 1145 - return 0; 1146 - } 1147 1135 1148 1136 trace_i915_ring_wait_begin(ring); 1149 1137 if (drm_core_check_feature(dev, DRIVER_GEM))
+1
drivers/gpu/drm/radeon/evergreen.c
··· 3223 3223 r = evergreen_startup(rdev); 3224 3224 if (r) { 3225 3225 DRM_ERROR("evergreen startup failed on resume\n"); 3226 + rdev->accel_working = false; 3226 3227 return r; 3227 3228 } 3228 3229
+1
drivers/gpu/drm/radeon/ni.c
··· 1547 1547 r = cayman_startup(rdev); 1548 1548 if (r) { 1549 1549 DRM_ERROR("cayman startup failed on resume\n"); 1550 + rdev->accel_working = false; 1550 1551 return r; 1551 1552 } 1552 1553 return r;
+7 -1
drivers/gpu/drm/radeon/r100.c
··· 3928 3928 3929 3929 int r100_resume(struct radeon_device *rdev) 3930 3930 { 3931 + int r; 3932 + 3931 3933 /* Make sur GART are not working */ 3932 3934 if (rdev->flags & RADEON_IS_PCI) 3933 3935 r100_pci_gart_disable(rdev); ··· 3949 3947 radeon_surface_init(rdev); 3950 3948 3951 3949 rdev->accel_working = true; 3952 - return r100_startup(rdev); 3950 + r = r100_startup(rdev); 3951 + if (r) { 3952 + rdev->accel_working = false; 3953 + } 3954 + return r; 3953 3955 } 3954 3956 3955 3957 int r100_suspend(struct radeon_device *rdev)
+7 -1
drivers/gpu/drm/radeon/r300.c
··· 1431 1431 1432 1432 int r300_resume(struct radeon_device *rdev) 1433 1433 { 1434 + int r; 1435 + 1434 1436 /* Make sur GART are not working */ 1435 1437 if (rdev->flags & RADEON_IS_PCIE) 1436 1438 rv370_pcie_gart_disable(rdev); ··· 1454 1452 radeon_surface_init(rdev); 1455 1453 1456 1454 rdev->accel_working = true; 1457 - return r300_startup(rdev); 1455 + r = r300_startup(rdev); 1456 + if (r) { 1457 + rdev->accel_working = false; 1458 + } 1459 + return r; 1458 1460 } 1459 1461 1460 1462 int r300_suspend(struct radeon_device *rdev)
+7 -1
drivers/gpu/drm/radeon/r420.c
··· 291 291 292 292 int r420_resume(struct radeon_device *rdev) 293 293 { 294 + int r; 295 + 294 296 /* Make sur GART are not working */ 295 297 if (rdev->flags & RADEON_IS_PCIE) 296 298 rv370_pcie_gart_disable(rdev); ··· 318 316 radeon_surface_init(rdev); 319 317 320 318 rdev->accel_working = true; 321 - return r420_startup(rdev); 319 + r = r420_startup(rdev); 320 + if (r) { 321 + rdev->accel_working = false; 322 + } 323 + return r; 322 324 } 323 325 324 326 int r420_suspend(struct radeon_device *rdev)
+7 -1
drivers/gpu/drm/radeon/r520.c
··· 218 218 219 219 int r520_resume(struct radeon_device *rdev) 220 220 { 221 + int r; 222 + 221 223 /* Make sur GART are not working */ 222 224 if (rdev->flags & RADEON_IS_PCIE) 223 225 rv370_pcie_gart_disable(rdev); ··· 239 237 radeon_surface_init(rdev); 240 238 241 239 rdev->accel_working = true; 242 - return r520_startup(rdev); 240 + r = r520_startup(rdev); 241 + if (r) { 242 + rdev->accel_working = false; 243 + } 244 + return r; 243 245 } 244 246 245 247 int r520_init(struct radeon_device *rdev)
+1
drivers/gpu/drm/radeon/r600.c
··· 2529 2529 r = r600_startup(rdev); 2530 2530 if (r) { 2531 2531 DRM_ERROR("r600 startup failed on resume\n"); 2532 + rdev->accel_working = false; 2532 2533 return r; 2533 2534 } 2534 2535
+1
drivers/gpu/drm/radeon/r600_cs.c
··· 1304 1304 h0 = G_038004_TEX_HEIGHT(word1) + 1; 1305 1305 d0 = G_038004_TEX_DEPTH(word1); 1306 1306 nfaces = 1; 1307 + array = 0; 1307 1308 switch (G_038000_DIM(word0)) { 1308 1309 case V_038000_SQ_TEX_DIM_1D: 1309 1310 case V_038000_SQ_TEX_DIM_2D:
+3
drivers/gpu/drm/radeon/radeon_atombios.c
··· 3020 3020 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 3021 3021 uint32_t bios_2_scratch; 3022 3022 3023 + if (ASIC_IS_DCE4(rdev)) 3024 + return; 3025 + 3023 3026 if (rdev->family >= CHIP_R600) 3024 3027 bios_2_scratch = RREG32(R600_BIOS_2_SCRATCH); 3025 3028 else
+17 -8
drivers/gpu/drm/radeon/radeon_connectors.c
··· 1117 1117 (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)) { 1118 1118 struct drm_display_mode *mode; 1119 1119 1120 - if (!radeon_dig_connector->edp_on) 1121 - atombios_set_edp_panel_power(connector, 1122 - ATOM_TRANSMITTER_ACTION_POWER_ON); 1123 - ret = radeon_ddc_get_modes(radeon_connector); 1124 - if (!radeon_dig_connector->edp_on) 1125 - atombios_set_edp_panel_power(connector, 1126 - ATOM_TRANSMITTER_ACTION_POWER_OFF); 1120 + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { 1121 + if (!radeon_dig_connector->edp_on) 1122 + atombios_set_edp_panel_power(connector, 1123 + ATOM_TRANSMITTER_ACTION_POWER_ON); 1124 + ret = radeon_ddc_get_modes(radeon_connector); 1125 + if (!radeon_dig_connector->edp_on) 1126 + atombios_set_edp_panel_power(connector, 1127 + ATOM_TRANSMITTER_ACTION_POWER_OFF); 1128 + } else { 1129 + /* need to setup ddc on the bridge */ 1130 + if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) != 1131 + ENCODER_OBJECT_ID_NONE) { 1132 + if (encoder) 1133 + radeon_atom_ext_encoder_setup_ddc(encoder); 1134 + } 1135 + ret = radeon_ddc_get_modes(radeon_connector); 1136 + } 1127 1137 1128 1138 if (ret > 0) { 1129 1139 if (encoder) { ··· 1144 1134 return ret; 1145 1135 } 1146 1136 1147 - encoder = radeon_best_single_encoder(connector); 1148 1137 if (!encoder) 1149 1138 return 0; 1150 1139
+4
drivers/gpu/drm/radeon/radeon_cs.c
··· 453 453 int r; 454 454 455 455 radeon_mutex_lock(&rdev->cs_mutex); 456 + if (!rdev->accel_working) { 457 + radeon_mutex_unlock(&rdev->cs_mutex); 458 + return -EBUSY; 459 + } 456 460 /* initialize parser */ 457 461 memset(&parser, 0, sizeof(struct radeon_cs_parser)); 458 462 parser.filp = filp;
+1 -1
drivers/gpu/drm/radeon/radeon_gart.c
··· 597 597 if (bo_va == NULL) 598 598 return 0; 599 599 600 - list_del(&bo_va->bo_list); 601 600 mutex_lock(&vm->mutex); 602 601 radeon_mutex_lock(&rdev->cs_mutex); 603 602 radeon_vm_bo_update_pte(rdev, vm, bo, NULL); 604 603 radeon_mutex_unlock(&rdev->cs_mutex); 605 604 list_del(&bo_va->vm_list); 606 605 mutex_unlock(&vm->mutex); 606 + list_del(&bo_va->bo_list); 607 607 608 608 kfree(bo_va); 609 609 return 0;
+5 -2
drivers/gpu/drm/radeon/radeon_ring.c
··· 500 500 int radeon_debugfs_ring_init(struct radeon_device *rdev) 501 501 { 502 502 #if defined(CONFIG_DEBUG_FS) 503 - return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list, 504 - ARRAY_SIZE(radeon_debugfs_ring_info_list)); 503 + if (rdev->family >= CHIP_CAYMAN) 504 + return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list, 505 + ARRAY_SIZE(radeon_debugfs_ring_info_list)); 506 + else 507 + return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list, 1); 505 508 #else 506 509 return 0; 507 510 #endif
+7 -1
drivers/gpu/drm/radeon/rs400.c
··· 442 442 443 443 int rs400_resume(struct radeon_device *rdev) 444 444 { 445 + int r; 446 + 445 447 /* Make sur GART are not working */ 446 448 rs400_gart_disable(rdev); 447 449 /* Resume clock before doing reset */ ··· 464 462 radeon_surface_init(rdev); 465 463 466 464 rdev->accel_working = true; 467 - return rs400_startup(rdev); 465 + r = rs400_startup(rdev); 466 + if (r) { 467 + rdev->accel_working = false; 468 + } 469 + return r; 468 470 } 469 471 470 472 int rs400_suspend(struct radeon_device *rdev)
+7 -1
drivers/gpu/drm/radeon/rs600.c
··· 876 876 877 877 int rs600_resume(struct radeon_device *rdev) 878 878 { 879 + int r; 880 + 879 881 /* Make sur GART are not working */ 880 882 rs600_gart_disable(rdev); 881 883 /* Resume clock before doing reset */ ··· 896 894 radeon_surface_init(rdev); 897 895 898 896 rdev->accel_working = true; 899 - return rs600_startup(rdev); 897 + r = rs600_startup(rdev); 898 + if (r) { 899 + rdev->accel_working = false; 900 + } 901 + return r; 900 902 } 901 903 902 904 int rs600_suspend(struct radeon_device *rdev)
+7 -1
drivers/gpu/drm/radeon/rs690.c
··· 659 659 660 660 int rs690_resume(struct radeon_device *rdev) 661 661 { 662 + int r; 663 + 662 664 /* Make sur GART are not working */ 663 665 rs400_gart_disable(rdev); 664 666 /* Resume clock before doing reset */ ··· 679 677 radeon_surface_init(rdev); 680 678 681 679 rdev->accel_working = true; 682 - return rs690_startup(rdev); 680 + r = rs690_startup(rdev); 681 + if (r) { 682 + rdev->accel_working = false; 683 + } 684 + return r; 683 685 } 684 686 685 687 int rs690_suspend(struct radeon_device *rdev)
+7 -1
drivers/gpu/drm/radeon/rv515.c
··· 424 424 425 425 int rv515_resume(struct radeon_device *rdev) 426 426 { 427 + int r; 428 + 427 429 /* Make sur GART are not working */ 428 430 if (rdev->flags & RADEON_IS_PCIE) 429 431 rv370_pcie_gart_disable(rdev); ··· 445 443 radeon_surface_init(rdev); 446 444 447 445 rdev->accel_working = true; 448 - return rv515_startup(rdev); 446 + r = rv515_startup(rdev); 447 + if (r) { 448 + rdev->accel_working = false; 449 + } 450 + return r; 449 451 } 450 452 451 453 int rv515_suspend(struct radeon_device *rdev)
+1
drivers/gpu/drm/radeon/rv770.c
··· 1139 1139 r = rv770_startup(rdev); 1140 1140 if (r) { 1141 1141 DRM_ERROR("r600 startup failed on resume\n"); 1142 + rdev->accel_working = false; 1142 1143 return r; 1143 1144 } 1144 1145
+1 -2
drivers/hwmon/ads1015.c
··· 271 271 continue; 272 272 err = device_create_file(&client->dev, &ads1015_in[k].dev_attr); 273 273 if (err) 274 - goto exit_free; 274 + goto exit_remove; 275 275 } 276 276 277 277 data->hwmon_dev = hwmon_device_register(&client->dev); ··· 285 285 exit_remove: 286 286 for (k = 0; k < ADS1015_CHANNELS; ++k) 287 287 device_remove_file(&client->dev, &ads1015_in[k].dev_attr); 288 - exit_free: 289 288 kfree(data); 290 289 exit: 291 290 return err;
+76 -16
drivers/hwmon/f75375s.c
··· 178 178 i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF)); 179 179 } 180 180 181 + static void f75375_write_pwm(struct i2c_client *client, int nr) 182 + { 183 + struct f75375_data *data = i2c_get_clientdata(client); 184 + if (data->kind == f75387) 185 + f75375_write16(client, F75375_REG_FAN_EXP(nr), data->pwm[nr]); 186 + else 187 + f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), 188 + data->pwm[nr]); 189 + } 190 + 181 191 static struct f75375_data *f75375_update_device(struct device *dev) 182 192 { 183 193 struct i2c_client *client = to_i2c_client(dev); ··· 264 254 return 1500000 / rpm; 265 255 } 266 256 257 + static bool duty_mode_enabled(u8 pwm_enable) 258 + { 259 + switch (pwm_enable) { 260 + case 0: /* Manual, duty mode (full speed) */ 261 + case 1: /* Manual, duty mode */ 262 + case 4: /* Auto, duty mode */ 263 + return true; 264 + case 2: /* Auto, speed mode */ 265 + case 3: /* Manual, speed mode */ 266 + return false; 267 + default: 268 + BUG(); 269 + } 270 + } 271 + 272 + static bool auto_mode_enabled(u8 pwm_enable) 273 + { 274 + switch (pwm_enable) { 275 + case 0: /* Manual, duty mode (full speed) */ 276 + case 1: /* Manual, duty mode */ 277 + case 3: /* Manual, speed mode */ 278 + return false; 279 + case 2: /* Auto, speed mode */ 280 + case 4: /* Auto, duty mode */ 281 + return true; 282 + default: 283 + BUG(); 284 + } 285 + } 286 + 267 287 static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr, 268 288 const char *buf, size_t count) 269 289 { ··· 327 287 if (err < 0) 328 288 return err; 329 289 290 + if (auto_mode_enabled(data->pwm_enable[nr])) 291 + return -EINVAL; 292 + if (data->kind == f75387 && duty_mode_enabled(data->pwm_enable[nr])) 293 + return -EINVAL; 294 + 330 295 mutex_lock(&data->update_lock); 331 296 data->fan_target[nr] = rpm_to_reg(val); 332 297 f75375_write16(client, F75375_REG_FAN_EXP(nr), data->fan_target[nr]); ··· 352 307 if (err < 0) 353 308 return err; 354 309 310 + if (auto_mode_enabled(data->pwm_enable[nr]) || 311 + !duty_mode_enabled(data->pwm_enable[nr])) 312 + return -EINVAL; 313 + 355 314 mutex_lock(&data->update_lock); 356 315 data->pwm[nr] = SENSORS_LIMIT(val, 0, 255); 357 - f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), data->pwm[nr]); 316 + f75375_write_pwm(client, nr); 358 317 mutex_unlock(&data->update_lock); 359 318 return count; 360 319 } ··· 376 327 struct f75375_data *data = i2c_get_clientdata(client); 377 328 u8 fanmode; 378 329 379 - if (val < 0 || val > 3) 330 + if (val < 0 || val > 4) 380 331 return -EINVAL; 381 332 382 333 fanmode = f75375_read8(client, F75375_REG_FAN_TIMER); 383 334 if (data->kind == f75387) { 335 + /* For now, deny dangerous toggling of duty mode */ 336 + if (duty_mode_enabled(data->pwm_enable[nr]) != 337 + duty_mode_enabled(val)) 338 + return -EOPNOTSUPP; 384 339 /* clear each fanX_mode bit before setting them properly */ 385 340 fanmode &= ~(1 << F75387_FAN_DUTY_MODE(nr)); 386 341 fanmode &= ~(1 << F75387_FAN_MANU_MODE(nr)); ··· 393 340 fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); 394 341 fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); 395 342 data->pwm[nr] = 255; 396 - f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), 397 - data->pwm[nr]); 398 343 break; 399 344 case 1: /* PWM */ 400 345 fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); 401 346 fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); 402 347 break; 403 - case 2: /* AUTOMATIC*/ 404 - fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); 348 + case 2: /* Automatic, speed mode */ 405 349 break; 406 350 case 3: /* fan speed */ 407 351 fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); 352 + break; 353 + case 4: /* Automatic, pwm */ 354 + fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); 408 355 break; 409 356 } 410 357 } else { ··· 414 361 case 0: /* full speed */ 415 362 fanmode |= (3 << FAN_CTRL_MODE(nr)); 416 363 data->pwm[nr] = 255; 417 - f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), 418 - data->pwm[nr]); 419 364 break; 420 365 case 1: /* PWM */ 421 366 fanmode |= (3 << FAN_CTRL_MODE(nr)); ··· 423 372 break; 424 373 case 3: /* fan speed */ 425 374 break; 375 + case 4: /* Automatic pwm */ 376 + return -EINVAL; 426 377 } 427 378 } 428 379 429 380 f75375_write8(client, F75375_REG_FAN_TIMER, fanmode); 430 381 data->pwm_enable[nr] = val; 382 + if (val == 0) 383 + f75375_write_pwm(client, nr); 431 384 return 0; 432 385 } 433 386 ··· 782 727 783 728 manu = ((mode >> F75387_FAN_MANU_MODE(nr)) & 1); 784 729 duty = ((mode >> F75387_FAN_DUTY_MODE(nr)) & 1); 785 - if (manu && duty) 786 - /* speed */ 730 + if (!manu && duty) 731 + /* auto, pwm */ 732 + data->pwm_enable[nr] = 4; 733 + else if (manu && !duty) 734 + /* manual, speed */ 787 735 data->pwm_enable[nr] = 3; 788 - else if (!manu && duty) 789 - /* automatic */ 736 + else if (!manu && !duty) 737 + /* automatic, speed */ 790 738 data->pwm_enable[nr] = 2; 791 739 else 792 - /* manual */ 740 + /* manual, pwm */ 793 741 data->pwm_enable[nr] = 1; 794 742 } else { 795 743 if (!(conf & (1 << F75375_FAN_CTRL_LINEAR(nr)))) ··· 817 759 set_pwm_enable_direct(client, 0, f75375s_pdata->pwm_enable[0]); 818 760 set_pwm_enable_direct(client, 1, f75375s_pdata->pwm_enable[1]); 819 761 for (nr = 0; nr < 2; nr++) { 762 + if (auto_mode_enabled(f75375s_pdata->pwm_enable[nr]) || 763 + !duty_mode_enabled(f75375s_pdata->pwm_enable[nr])) 764 + continue; 820 765 data->pwm[nr] = SENSORS_LIMIT(f75375s_pdata->pwm[nr], 0, 255); 821 - f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), 822 - data->pwm[nr]); 766 + f75375_write_pwm(client, nr); 823 767 } 824 768 825 769 } ··· 848 788 if (err) 849 789 goto exit_free; 850 790 851 - if (data->kind == f75375) { 791 + if (data->kind != f75373) { 852 792 err = sysfs_chmod_file(&client->dev.kobj, 853 793 &sensor_dev_attr_pwm1_mode.dev_attr.attr, 854 794 S_IRUGO | S_IWUSR);
+12 -10
drivers/hwmon/max6639.c
··· 72 72 73 73 static const int rpm_ranges[] = { 2000, 4000, 8000, 16000 }; 74 74 75 - #define FAN_FROM_REG(val, div, rpm_range) ((val) == 0 ? -1 : \ 76 - (val) == 255 ? 0 : (rpm_ranges[rpm_range] * 30) / ((div + 1) * (val))) 75 + #define FAN_FROM_REG(val, rpm_range) ((val) == 0 || (val) == 255 ? \ 76 + 0 : (rpm_ranges[rpm_range] * 30) / (val)) 77 77 #define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT((val) / 1000, 0, 255) 78 78 79 79 /* ··· 333 333 return PTR_ERR(data); 334 334 335 335 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[attr->index], 336 - data->ppr, data->rpm_range)); 336 + data->rpm_range)); 337 337 } 338 338 339 339 static ssize_t show_alarm(struct device *dev, ··· 429 429 struct max6639_data *data = i2c_get_clientdata(client); 430 430 struct max6639_platform_data *max6639_info = 431 431 client->dev.platform_data; 432 - int i = 0; 432 + int i; 433 433 int rpm_range = 1; /* default: 4000 RPM */ 434 - int err = 0; 434 + int err; 435 435 436 436 /* Reset chip to default values, see below for GCONFIG setup */ 437 437 err = i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG, ··· 446 446 else 447 447 data->ppr = 2; 448 448 data->ppr -= 1; 449 - err = i2c_smbus_write_byte_data(client, 450 - MAX6639_REG_FAN_PPR(i), 451 - data->ppr << 5); 452 - if (err) 453 - goto exit; 454 449 455 450 if (max6639_info) 456 451 rpm_range = rpm_range_to_reg(max6639_info->rpm_range); 457 452 data->rpm_range = rpm_range; 458 453 459 454 for (i = 0; i < 2; i++) { 455 + 456 + /* Set Fan pulse per revolution */ 457 + err = i2c_smbus_write_byte_data(client, 458 + MAX6639_REG_FAN_PPR(i), 459 + data->ppr << 6); 460 + if (err) 461 + goto exit; 460 462 461 463 /* Fans config PWM, RPM */ 462 464 err = i2c_smbus_write_byte_data(client,
+1 -1
drivers/hwmon/pmbus/max34440.c
··· 82 82 case PMBUS_VIRT_RESET_TEMP_HISTORY: 83 83 ret = pmbus_write_word_data(client, page, 84 84 MAX34440_MFR_TEMPERATURE_PEAK, 85 - 0xffff); 85 + 0x8000); 86 86 break; 87 87 default: 88 88 ret = -ENODATA;
+10 -3
drivers/i2c/busses/i2c-mxs.c
··· 72 72 73 73 #define MXS_I2C_QUEUESTAT (0x70) 74 74 #define MXS_I2C_QUEUESTAT_RD_QUEUE_EMPTY 0x00002000 75 + #define MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK 0x0000001F 75 76 76 77 #define MXS_I2C_QUEUECMD (0x80) 77 78 ··· 220 219 int ret; 221 220 int flags; 222 221 223 - init_completion(&i2c->cmd_complete); 224 - 225 222 dev_dbg(i2c->dev, "addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n", 226 223 msg->addr, msg->len, msg->flags, stop); 227 224 228 225 if (msg->len == 0) 229 226 return -EINVAL; 227 + 228 + init_completion(&i2c->cmd_complete); 230 229 231 230 flags = stop ? MXS_I2C_CTRL0_POST_SEND_STOP : 0; 232 231 ··· 287 286 { 288 287 struct mxs_i2c_dev *i2c = dev_id; 289 288 u32 stat = readl(i2c->regs + MXS_I2C_CTRL1) & MXS_I2C_IRQ_MASK; 289 + bool is_last_cmd; 290 290 291 291 if (!stat) 292 292 return IRQ_NONE; ··· 302 300 else 303 301 i2c->cmd_err = 0; 304 302 305 - complete(&i2c->cmd_complete); 303 + is_last_cmd = (readl(i2c->regs + MXS_I2C_QUEUESTAT) & 304 + MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK) == 0; 305 + 306 + if (is_last_cmd || i2c->cmd_err) 307 + complete(&i2c->cmd_complete); 306 308 307 309 writel(stat, i2c->regs + MXS_I2C_CTRL1_CLR); 310 + 308 311 return IRQ_HANDLED; 309 312 } 310 313
+45 -14
drivers/iommu/omap-iommu-debug.c
··· 44 44 static ssize_t debug_read_regs(struct file *file, char __user *userbuf, 45 45 size_t count, loff_t *ppos) 46 46 { 47 - struct omap_iommu *obj = file->private_data; 47 + struct device *dev = file->private_data; 48 + struct omap_iommu *obj = dev_to_omap_iommu(dev); 48 49 char *p, *buf; 49 50 ssize_t bytes; 50 51 ··· 68 67 static ssize_t debug_read_tlb(struct file *file, char __user *userbuf, 69 68 size_t count, loff_t *ppos) 70 69 { 71 - struct omap_iommu *obj = file->private_data; 70 + struct device *dev = file->private_data; 71 + struct omap_iommu *obj = dev_to_omap_iommu(dev); 72 72 char *p, *buf; 73 73 ssize_t bytes, rest; 74 74 ··· 99 97 struct iotlb_entry e; 100 98 struct cr_regs cr; 101 99 int err; 102 - struct omap_iommu *obj = file->private_data; 100 + struct device *dev = file->private_data; 101 + struct omap_iommu *obj = dev_to_omap_iommu(dev); 103 102 char buf[MAXCOLUMN], *p = buf; 104 103 105 104 count = min(count, sizeof(buf)); ··· 187 184 static ssize_t debug_read_pagetable(struct file *file, char __user *userbuf, 188 185 size_t count, loff_t *ppos) 189 186 { 190 - struct omap_iommu *obj = file->private_data; 187 + struct device *dev = file->private_data; 188 + struct omap_iommu *obj = dev_to_omap_iommu(dev); 191 189 char *p, *buf; 192 190 size_t bytes; 193 191 ··· 216 212 static ssize_t debug_read_mmap(struct file *file, char __user *userbuf, 217 213 size_t count, loff_t *ppos) 218 214 { 219 - struct omap_iommu *obj = file->private_data; 215 + struct device *dev = file->private_data; 216 + struct omap_iommu *obj = dev_to_omap_iommu(dev); 220 217 char *p, *buf; 221 218 struct iovm_struct *tmp; 222 219 int uninitialized_var(i); ··· 259 254 static ssize_t debug_read_mem(struct file *file, char __user *userbuf, 260 255 size_t count, loff_t *ppos) 261 256 { 262 - struct omap_iommu *obj = file->private_data; 257 + struct device *dev = file->private_data; 263 258 char *p, *buf; 264 259 struct iovm_struct *area; 265 260 ssize_t bytes; ··· 273 268 274 269 mutex_lock(&iommu_debug_lock); 275 270 276 - area = omap_find_iovm_area(obj, (u32)ppos); 277 - if (IS_ERR(area)) { 271 + area = omap_find_iovm_area(dev, (u32)ppos); 272 + if (!area) { 278 273 bytes = -EINVAL; 279 274 goto err_out; 280 275 } ··· 292 287 static ssize_t debug_write_mem(struct file *file, const char __user *userbuf, 293 288 size_t count, loff_t *ppos) 294 289 { 295 - struct omap_iommu *obj = file->private_data; 290 + struct device *dev = file->private_data; 296 291 struct iovm_struct *area; 297 292 char *p, *buf; 298 293 ··· 310 305 goto err_out; 311 306 } 312 307 313 - area = omap_find_iovm_area(obj, (u32)ppos); 314 - if (IS_ERR(area)) { 308 + area = omap_find_iovm_area(dev, (u32)ppos); 309 + if (!area) { 315 310 count = -EINVAL; 316 311 goto err_out; 317 312 } ··· 355 350 { \ 356 351 struct dentry *dent; \ 357 352 dent = debugfs_create_file(#attr, mode, parent, \ 358 - obj, &debug_##attr##_fops); \ 353 + dev, &debug_##attr##_fops); \ 359 354 if (!dent) \ 360 355 return -ENOMEM; \ 361 356 } ··· 367 362 { 368 363 struct platform_device *pdev = to_platform_device(dev); 369 364 struct omap_iommu *obj = platform_get_drvdata(pdev); 365 + struct omap_iommu_arch_data *arch_data; 370 366 struct dentry *d, *parent; 371 367 372 368 if (!obj || !obj->dev) 373 369 return -EINVAL; 374 370 371 + arch_data = kzalloc(sizeof(*arch_data), GFP_KERNEL); 372 + if (!arch_data) 373 + return -ENOMEM; 374 + 375 + arch_data->iommu_dev = obj; 376 + 377 + dev->archdata.iommu = arch_data; 378 + 375 379 d = debugfs_create_dir(obj->name, iommu_debug_root); 376 380 if (!d) 377 - return -ENOMEM; 381 + goto nomem; 378 382 parent = d; 379 383 380 384 d = debugfs_create_u8("nr_tlb_entries", 400, parent, 381 385 (u8 *)&obj->nr_tlb_entries); 382 386 if (!d) 383 - return -ENOMEM; 387 + goto nomem; 384 388 385 389 DEBUG_ADD_FILE_RO(ver); 386 390 DEBUG_ADD_FILE_RO(regs); ··· 397 383 DEBUG_ADD_FILE(pagetable); 398 384 DEBUG_ADD_FILE_RO(mmap); 399 385 DEBUG_ADD_FILE(mem); 386 + 387 + return 0; 388 + 389 + nomem: 390 + kfree(arch_data); 391 + return -ENOMEM; 392 + } 393 + 394 + static int iommu_debug_unregister(struct device *dev, void *data) 395 + { 396 + if (!dev->archdata.iommu) 397 + return 0; 398 + 399 + kfree(dev->archdata.iommu); 400 + 401 + dev->archdata.iommu = NULL; 400 402 401 403 return 0; 402 404 } ··· 441 411 static void __exit iommu_debugfs_exit(void) 442 412 { 443 413 debugfs_remove_recursive(iommu_debug_root); 414 + omap_foreach_iommu_device(NULL, iommu_debug_unregister); 444 415 } 445 416 module_exit(iommu_debugfs_exit) 446 417
+2 -1
drivers/iommu/omap-iommu.c
··· 1223 1223 1224 1224 return platform_driver_register(&omap_iommu_driver); 1225 1225 } 1226 - module_init(omap_iommu_init); 1226 + /* must be ready before omap3isp is probed */ 1227 + subsys_initcall(omap_iommu_init); 1227 1228 1228 1229 static void __exit omap_iommu_exit(void) 1229 1230 {
+2 -2
drivers/media/radio/wl128x/Kconfig
··· 4 4 menu "Texas Instruments WL128x FM driver (ST based)" 5 5 config RADIO_WL128X 6 6 tristate "Texas Instruments WL128x FM Radio" 7 - depends on VIDEO_V4L2 && RFKILL 8 - select TI_ST if NET && GPIOLIB 7 + depends on VIDEO_V4L2 && RFKILL && GPIOLIB 8 + select TI_ST if NET 9 9 help 10 10 Choose Y here if you have this FM radio chip. 11 11
+22 -4
drivers/media/rc/imon.c
··· 47 47 #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" 48 48 #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display" 49 49 #define MOD_NAME "imon" 50 - #define MOD_VERSION "0.9.3" 50 + #define MOD_VERSION "0.9.4" 51 51 52 52 #define DISPLAY_MINOR_BASE 144 53 53 #define DEVICE_NAME "lcd%d" ··· 1658 1658 return; 1659 1659 1660 1660 ictx = (struct imon_context *)urb->context; 1661 - if (!ictx || !ictx->dev_present_intf0) 1661 + if (!ictx) 1662 1662 return; 1663 + 1664 + /* 1665 + * if we get a callback before we're done configuring the hardware, we 1666 + * can't yet process the data, as there's nowhere to send it, but we 1667 + * still need to submit a new rx URB to avoid wedging the hardware 1668 + */ 1669 + if (!ictx->dev_present_intf0) 1670 + goto out; 1663 1671 1664 1672 switch (urb->status) { 1665 1673 case -ENOENT: /* usbcore unlink successful! */ ··· 1686 1678 break; 1687 1679 } 1688 1680 1681 + out: 1689 1682 usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC); 1690 1683 } 1691 1684 ··· 1699 1690 return; 1700 1691 1701 1692 ictx = (struct imon_context *)urb->context; 1702 - if (!ictx || !ictx->dev_present_intf1) 1693 + if (!ictx) 1703 1694 return; 1695 + 1696 + /* 1697 + * if we get a callback before we're done configuring the hardware, we 1698 + * can't yet process the data, as there's nowhere to send it, but we 1699 + * still need to submit a new rx URB to avoid wedging the hardware 1700 + */ 1701 + if (!ictx->dev_present_intf1) 1702 + goto out; 1704 1703 1705 1704 switch (urb->status) { 1706 1705 case -ENOENT: /* usbcore unlink successful! */ ··· 1727 1710 break; 1728 1711 } 1729 1712 1713 + out: 1730 1714 usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC); 1731 1715 } 1732 1716 ··· 2260 2242 mutex_unlock(&ictx->lock); 2261 2243 usb_free_urb(rx_urb); 2262 2244 rx_urb_alloc_failed: 2263 - dev_err(ictx->dev, "unable to initialize intf0, err %d\n", ret); 2245 + dev_err(ictx->dev, "unable to initialize intf1, err %d\n", ret); 2264 2246 2265 2247 return NULL; 2266 2248 }
+16 -4
drivers/media/video/hdpvr/hdpvr-core.c
··· 154 154 } 155 155 #endif 156 156 157 - v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n", 158 - dev->usbc_buf[1], &dev->usbc_buf[2]); 157 + dev->fw_ver = dev->usbc_buf[1]; 159 158 160 - switch (dev->usbc_buf[1]) { 159 + v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n", 160 + dev->fw_ver, &dev->usbc_buf[2]); 161 + 162 + if (dev->fw_ver > 0x15) { 163 + dev->options.brightness = 0x80; 164 + dev->options.contrast = 0x40; 165 + dev->options.hue = 0xf; 166 + dev->options.saturation = 0x40; 167 + dev->options.sharpness = 0x80; 168 + } 169 + 170 + switch (dev->fw_ver) { 161 171 case HDPVR_FIRMWARE_VERSION: 162 172 dev->flags &= ~HDPVR_FLAG_AC3_CAP; 163 173 break; ··· 179 169 default: 180 170 v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might" 181 171 " not work.\n"); 182 - if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3) 172 + if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3) 183 173 dev->flags |= HDPVR_FLAG_AC3_CAP; 184 174 else 185 175 dev->flags &= ~HDPVR_FLAG_AC3_CAP; ··· 280 270 .bitrate_mode = HDPVR_CONSTANT, 281 271 .gop_mode = HDPVR_SIMPLE_IDR_GOP, 282 272 .audio_codec = V4L2_MPEG_AUDIO_ENCODING_AAC, 273 + /* original picture controls for firmware version <= 0x15 */ 274 + /* updated in device_authorization() for newer firmware */ 283 275 .brightness = 0x86, 284 276 .contrast = 0x80, 285 277 .hue = 0x80,
+33 -13
drivers/media/video/hdpvr/hdpvr-video.c
··· 283 283 284 284 hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00); 285 285 286 + dev->status = STATUS_STREAMING; 287 + 286 288 INIT_WORK(&dev->worker, hdpvr_transmit_buffers); 287 289 queue_work(dev->workqueue, &dev->worker); 288 290 289 291 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev, 290 292 "streaming started\n"); 291 - dev->status = STATUS_STREAMING; 292 293 293 294 return 0; 294 295 } ··· 723 722 }; 724 723 725 724 static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc, 726 - int ac3) 725 + int ac3, int fw_ver) 727 726 { 728 727 int err; 729 728 729 + if (fw_ver > 0x15) { 730 + switch (qc->id) { 731 + case V4L2_CID_BRIGHTNESS: 732 + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); 733 + case V4L2_CID_CONTRAST: 734 + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40); 735 + case V4L2_CID_SATURATION: 736 + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40); 737 + case V4L2_CID_HUE: 738 + return v4l2_ctrl_query_fill(qc, 0x0, 0x1e, 1, 0xf); 739 + case V4L2_CID_SHARPNESS: 740 + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); 741 + } 742 + } else { 743 + switch (qc->id) { 744 + case V4L2_CID_BRIGHTNESS: 745 + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86); 746 + case V4L2_CID_CONTRAST: 747 + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); 748 + case V4L2_CID_SATURATION: 749 + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); 750 + case V4L2_CID_HUE: 751 + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); 752 + case V4L2_CID_SHARPNESS: 753 + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); 754 + } 755 + } 756 + 730 757 switch (qc->id) { 731 - case V4L2_CID_BRIGHTNESS: 732 - return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86); 733 - case V4L2_CID_CONTRAST: 734 - return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); 735 - case V4L2_CID_SATURATION: 736 - return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); 737 - case V4L2_CID_HUE: 738 - return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); 739 - case V4L2_CID_SHARPNESS: 740 - return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); 741 758 case V4L2_CID_MPEG_AUDIO_ENCODING: 742 759 return v4l2_ctrl_query_fill( 743 760 qc, V4L2_MPEG_AUDIO_ENCODING_AAC, ··· 813 794 814 795 if (qc->id == supported_v4l2_ctrls[i]) 815 796 return fill_queryctrl(&dev->options, qc, 816 - dev->flags & HDPVR_FLAG_AC3_CAP); 797 + dev->flags & HDPVR_FLAG_AC3_CAP, 798 + dev->fw_ver); 817 799 818 800 if (qc->id < supported_v4l2_ctrls[i]) 819 801 break;
+1
drivers/media/video/hdpvr/hdpvr.h
··· 113 113 /* usb control transfer buffer and lock */ 114 114 struct mutex usbc_mutex; 115 115 u8 *usbc_buf; 116 + u8 fw_ver; 116 117 }; 117 118 118 119 static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev)
+1 -1
drivers/media/video/omap3isp/ispccdc.c
··· 1407 1407 static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc) 1408 1408 { 1409 1409 struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); 1410 - struct video_device *vdev = &ccdc->subdev.devnode; 1410 + struct video_device *vdev = ccdc->subdev.devnode; 1411 1411 struct v4l2_event event; 1412 1412 1413 1413 memset(&event, 0, sizeof(event));
+12 -1
drivers/net/can/sja1000/sja1000.c
··· 95 95 spin_unlock_irqrestore(&priv->cmdreg_lock, flags); 96 96 } 97 97 98 + static int sja1000_is_absent(struct sja1000_priv *priv) 99 + { 100 + return (priv->read_reg(priv, REG_MOD) == 0xFF); 101 + } 102 + 98 103 static int sja1000_probe_chip(struct net_device *dev) 99 104 { 100 105 struct sja1000_priv *priv = netdev_priv(dev); 101 106 102 - if (priv->reg_base && (priv->read_reg(priv, 0) == 0xFF)) { 107 + if (priv->reg_base && sja1000_is_absent(priv)) { 103 108 printk(KERN_INFO "%s: probing @0x%lX failed\n", 104 109 DRV_NAME, dev->base_addr); 105 110 return 0; ··· 498 493 while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) { 499 494 n++; 500 495 status = priv->read_reg(priv, REG_SR); 496 + /* check for absent controller due to hw unplug */ 497 + if (status == 0xFF && sja1000_is_absent(priv)) 498 + return IRQ_NONE; 501 499 502 500 if (isrc & IRQ_WUI) 503 501 dev_warn(dev->dev.parent, "wakeup interrupt\n"); ··· 517 509 while (status & SR_RBS) { 518 510 sja1000_rx(dev); 519 511 status = priv->read_reg(priv, REG_SR); 512 + /* check for absent controller */ 513 + if (status == 0xFF && sja1000_is_absent(priv)) 514 + return IRQ_NONE; 520 515 } 521 516 } 522 517 if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) {
-4
drivers/net/ethernet/atheros/atl1c/atl1c_main.c
··· 2244 2244 dev_info(&adapter->pdev->dev, "tx locked\n"); 2245 2245 return NETDEV_TX_LOCKED; 2246 2246 } 2247 - if (skb->mark == 0x01) 2248 - type = atl1c_trans_high; 2249 - else 2250 - type = atl1c_trans_normal; 2251 2247 2252 2248 if (atl1c_tpd_avail(adapter, type) < tpd_req) { 2253 2249 /* no enough descriptor, just stop queue */
+1 -1
drivers/net/ethernet/broadcom/b44.c
··· 2339 2339 return err; 2340 2340 } 2341 2341 2342 - static inline void __exit b44_pci_exit(void) 2342 + static inline void b44_pci_exit(void) 2343 2343 { 2344 2344 #ifdef CONFIG_B44_PCI 2345 2345 ssb_pcihost_unregister(&b44_pci_driver);
+5 -1
drivers/net/ethernet/broadcom/cnic.c
··· 3584 3584 fl6.flowi6_oif = dst_addr->sin6_scope_id; 3585 3585 3586 3586 *dst = ip6_route_output(&init_net, NULL, &fl6); 3587 - if (*dst) 3587 + if ((*dst)->error) { 3588 + dst_release(*dst); 3589 + *dst = NULL; 3590 + return -ENETUNREACH; 3591 + } else 3588 3592 return 0; 3589 3593 #endif 3590 3594
+1 -1
drivers/net/ethernet/cisco/enic/cq_enet_desc.h
··· 157 157 CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK) ? 1 : 0; 158 158 *fcoe_enc_error = (desc->flags & 159 159 CQ_ENET_RQ_DESC_FCOE_ENC_ERROR) ? 1 : 0; 160 - *fcoe_eof = (u8)((desc->checksum_fcoe >> 160 + *fcoe_eof = (u8)((le16_to_cpu(desc->checksum_fcoe) >> 161 161 CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT) & 162 162 CQ_ENET_RQ_DESC_FCOE_EOF_MASK); 163 163 *checksum = 0;
+1 -1
drivers/net/ethernet/cisco/enic/enic_pp.c
··· 72 72 struct enic_port_profile *pp; 73 73 struct vic_provinfo *vp; 74 74 const u8 oui[3] = VIC_PROVINFO_CISCO_OUI; 75 - const u16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX); 75 + const __be16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX); 76 76 char uuid_str[38]; 77 77 char client_mac_str[18]; 78 78 u8 *client_mac;
+1 -9
drivers/net/ethernet/jme.c
··· 2328 2328 ((new_mtu) < IPV6_MIN_MTU)) 2329 2329 return -EINVAL; 2330 2330 2331 - if (new_mtu > 4000) { 2332 - jme->reg_rxcs &= ~RXCS_FIFOTHNP; 2333 - jme->reg_rxcs |= RXCS_FIFOTHNP_64QW; 2334 - jme_restart_rx_engine(jme); 2335 - } else { 2336 - jme->reg_rxcs &= ~RXCS_FIFOTHNP; 2337 - jme->reg_rxcs |= RXCS_FIFOTHNP_128QW; 2338 - jme_restart_rx_engine(jme); 2339 - } 2340 2331 2341 2332 netdev->mtu = new_mtu; 2342 2333 netdev_update_features(netdev); 2343 2334 2335 + jme_restart_rx_engine(jme); 2344 2336 jme_reset_link(jme); 2345 2337 2346 2338 return 0;
+1 -1
drivers/net/ethernet/jme.h
··· 730 730 RXCS_RETRYCNT_60 = 0x00000F00, 731 731 732 732 RXCS_DEFAULT = RXCS_FIFOTHTP_128T | 733 - RXCS_FIFOTHNP_128QW | 733 + RXCS_FIFOTHNP_16QW | 734 734 RXCS_DMAREQSZ_128B | 735 735 RXCS_RETRYGAP_256ns | 736 736 RXCS_RETRYCNT_32,
+4 -4
drivers/net/ethernet/mellanox/mlx4/eq.c
··· 1036 1036 struct mlx4_priv *priv = mlx4_priv(dev); 1037 1037 int vec = 0, err = 0, i; 1038 1038 1039 - spin_lock(&priv->msix_ctl.pool_lock); 1039 + mutex_lock(&priv->msix_ctl.pool_lock); 1040 1040 for (i = 0; !vec && i < dev->caps.comp_pool; i++) { 1041 1041 if (~priv->msix_ctl.pool_bm & 1ULL << i) { 1042 1042 priv->msix_ctl.pool_bm |= 1ULL << i; ··· 1058 1058 eq_set_ci(&priv->eq_table.eq[vec], 1); 1059 1059 } 1060 1060 } 1061 - spin_unlock(&priv->msix_ctl.pool_lock); 1061 + mutex_unlock(&priv->msix_ctl.pool_lock); 1062 1062 1063 1063 if (vec) { 1064 1064 *vector = vec; ··· 1079 1079 if (likely(i >= 0)) { 1080 1080 /*sanity check , making sure were not trying to free irq's 1081 1081 Belonging to a legacy EQ*/ 1082 - spin_lock(&priv->msix_ctl.pool_lock); 1082 + mutex_lock(&priv->msix_ctl.pool_lock); 1083 1083 if (priv->msix_ctl.pool_bm & 1ULL << i) { 1084 1084 free_irq(priv->eq_table.eq[vec].irq, 1085 1085 &priv->eq_table.eq[vec]); 1086 1086 priv->msix_ctl.pool_bm &= ~(1ULL << i); 1087 1087 } 1088 - spin_unlock(&priv->msix_ctl.pool_lock); 1088 + mutex_unlock(&priv->msix_ctl.pool_lock); 1089 1089 } 1090 1090 1091 1091 }
+1 -1
drivers/net/ethernet/mellanox/mlx4/fw.c
··· 685 685 return err; 686 686 } 687 687 688 - static int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port) 688 + int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port) 689 689 { 690 690 struct mlx4_cmd_mailbox *outbox = ptr; 691 691
+6 -4
drivers/net/ethernet/mellanox/mlx4/main.c
··· 531 531 for (port = 0; port < dev->caps.num_ports; port++) { 532 532 /* Change the port type only if the new type is different 533 533 * from the current, and not set to Auto */ 534 - if (port_types[port] != dev->caps.port_type[port + 1]) { 534 + if (port_types[port] != dev->caps.port_type[port + 1]) 535 535 change = 1; 536 - dev->caps.port_type[port + 1] = port_types[port]; 537 - } 538 536 } 539 537 if (change) { 540 538 mlx4_unregister_device(dev); 541 539 for (port = 1; port <= dev->caps.num_ports; port++) { 542 540 mlx4_CLOSE_PORT(dev, port); 541 + dev->caps.port_type[port] = port_types[port - 1]; 543 542 err = mlx4_SET_PORT(dev, port); 544 543 if (err) { 545 544 mlx4_err(dev, "Failed to set port %d, " ··· 984 985 resource_size_t bf_start; 985 986 resource_size_t bf_len; 986 987 int err = 0; 988 + 989 + if (!dev->caps.bf_reg_size) 990 + return -ENXIO; 987 991 988 992 bf_start = pci_resource_start(dev->pdev, 2) + 989 993 (dev->caps.num_uars << PAGE_SHIFT); ··· 1827 1825 goto err_master_mfunc; 1828 1826 1829 1827 priv->msix_ctl.pool_bm = 0; 1830 - spin_lock_init(&priv->msix_ctl.pool_lock); 1828 + mutex_init(&priv->msix_ctl.pool_lock); 1831 1829 1832 1830 mlx4_enable_msi_x(dev); 1833 1831 if ((mlx4_is_mfunc(dev)) &&
+1 -1
drivers/net/ethernet/mellanox/mlx4/mlx4.h
··· 697 697 698 698 struct mlx4_msix_ctl { 699 699 u64 pool_bm; 700 - spinlock_t pool_lock; 700 + struct mutex pool_lock; 701 701 }; 702 702 703 703 struct mlx4_steer {
+6 -6
drivers/net/ethernet/mellanox/mlx4/mr.c
··· 304 304 MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); 305 305 } 306 306 307 - static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, 307 + int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, 308 308 u32 *base_mridx) 309 309 { 310 310 struct mlx4_priv *priv = mlx4_priv(dev); ··· 320 320 } 321 321 EXPORT_SYMBOL_GPL(mlx4_mr_reserve_range); 322 322 323 - static void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt) 323 + void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt) 324 324 { 325 325 struct mlx4_priv *priv = mlx4_priv(dev); 326 326 mlx4_bitmap_free_range(&priv->mr_table.mpt_bitmap, base_mridx, cnt); 327 327 } 328 328 EXPORT_SYMBOL_GPL(mlx4_mr_release_range); 329 329 330 - static int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd, 330 + int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd, 331 331 u64 iova, u64 size, u32 access, int npages, 332 332 int page_shift, struct mlx4_mr *mr) 333 333 { ··· 457 457 } 458 458 EXPORT_SYMBOL_GPL(mlx4_mr_alloc); 459 459 460 - static void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr) 460 + void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr) 461 461 { 462 462 int err; 463 463 ··· 852 852 } 853 853 EXPORT_SYMBOL_GPL(mlx4_fmr_alloc); 854 854 855 - static int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, 855 + int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, 856 856 u32 pd, u32 access, int max_pages, 857 857 int max_maps, u8 page_shift, struct mlx4_fmr *fmr) 858 858 { ··· 954 954 } 955 955 EXPORT_SYMBOL_GPL(mlx4_fmr_free); 956 956 957 - static int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr) 957 + int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr) 958 958 { 959 959 if (fmr->maps) 960 960 return -EBUSY;
+1 -1
drivers/net/ethernet/micrel/ks8851_mll.c
··· 1545 1545 1546 1546 netdev->irq = platform_get_irq(pdev, 0); 1547 1547 1548 - if (netdev->irq < 0) { 1548 + if ((int)netdev->irq < 0) { 1549 1549 err = netdev->irq; 1550 1550 goto err_get_irq; 1551 1551 }
+2 -2
drivers/net/ethernet/sfc/rx.c
··· 156 156 if (unlikely(!skb)) 157 157 return -ENOMEM; 158 158 159 - /* Adjust the SKB for padding and checksum */ 159 + /* Adjust the SKB for padding */ 160 160 skb_reserve(skb, NET_IP_ALIGN); 161 161 rx_buf->len = skb_len - NET_IP_ALIGN; 162 162 rx_buf->is_page = false; 163 - skb->ip_summed = CHECKSUM_UNNECESSARY; 164 163 165 164 rx_buf->dma_addr = pci_map_single(efx->pci_dev, 166 165 skb->data, rx_buf->len, ··· 495 496 496 497 EFX_BUG_ON_PARANOID(!checksummed); 497 498 rx_buf->u.skb = NULL; 499 + skb->ip_summed = CHECKSUM_UNNECESSARY; 498 500 499 501 gro_result = napi_gro_receive(napi, skb); 500 502 }
+4 -2
drivers/net/ethernet/ti/davinci_emac.c
··· 1009 1009 int ret; 1010 1010 1011 1011 /* free and bail if we are shutting down */ 1012 - if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) { 1012 + if (unlikely(!netif_running(ndev))) { 1013 1013 dev_kfree_skb_any(skb); 1014 1014 return; 1015 1015 } ··· 1038 1038 recycle: 1039 1039 ret = cpdma_chan_submit(priv->rxchan, skb, skb->data, 1040 1040 skb_tailroom(skb), GFP_KERNEL); 1041 - if (WARN_ON(ret < 0)) 1041 + 1042 + WARN_ON(ret == -ENOMEM); 1043 + if (unlikely(ret < 0)) 1042 1044 dev_kfree_skb_any(skb); 1043 1045 } 1044 1046
+35 -20
drivers/net/phy/icplus.c
··· 30 30 #include <asm/irq.h> 31 31 #include <asm/uaccess.h> 32 32 33 - MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IC1001 PHY drivers"); 33 + MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IP101G/IC1001 PHY drivers"); 34 34 MODULE_AUTHOR("Michael Barkowski"); 35 35 MODULE_LICENSE("GPL"); 36 36 37 - /* IP101A/IP1001 */ 38 - #define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */ 39 - #define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */ 40 - #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ 41 - #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ 42 - #define IP101A_APS_ON 2 /* IP101A APS Mode bit */ 37 + /* IP101A/G - IP1001 */ 38 + #define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */ 39 + #define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */ 40 + #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ 41 + #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ 42 + #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */ 43 43 44 44 static int ip175c_config_init(struct phy_device *phydev) 45 45 { ··· 98 98 99 99 static int ip1xx_reset(struct phy_device *phydev) 100 100 { 101 - int err, bmcr; 101 + int bmcr; 102 102 103 103 /* Software Reset PHY */ 104 104 bmcr = phy_read(phydev, MII_BMCR); 105 + if (bmcr < 0) 106 + return bmcr; 105 107 bmcr |= BMCR_RESET; 106 - err = phy_write(phydev, MII_BMCR, bmcr); 107 - if (err < 0) 108 - return err; 108 + bmcr = phy_write(phydev, MII_BMCR, bmcr); 109 + if (bmcr < 0) 110 + return bmcr; 109 111 110 112 do { 111 113 bmcr = phy_read(phydev, MII_BMCR); 114 + if (bmcr < 0) 115 + return bmcr; 112 116 } while (bmcr & BMCR_RESET); 113 117 114 - return err; 118 + return 0; 115 119 } 116 120 117 121 static int ip1001_config_init(struct phy_device *phydev) ··· 128 124 129 125 /* Enable Auto Power Saving mode */ 130 126 c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2); 127 + if (c < 0) 128 + return c; 131 129 c |= IP1001_APS_ON; 130 + c = phy_write(phydev, IP1001_SPEC_CTRL_STATUS_2, c); 132 131 if (c < 0) 133 132 return c; 134 133 ··· 139 132 /* Additional delay (2ns) used to adjust RX clock phase 140 133 * at RGMII interface */ 141 134 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); 135 + if (c < 0) 136 + return c; 137 + 142 138 c |= IP1001_PHASE_SEL_MASK; 143 139 c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c); 140 + if (c < 0) 141 + return c; 144 142 } 145 143 146 - return c; 144 + return 0; 147 145 } 148 146 149 - static int ip101a_config_init(struct phy_device *phydev) 147 + static int ip101a_g_config_init(struct phy_device *phydev) 150 148 { 151 149 int c; 152 150 ··· 161 149 162 150 /* Enable Auto Power Saving mode */ 163 151 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); 164 - c |= IP101A_APS_ON; 152 + c |= IP101A_G_APS_ON; 165 153 return c; 166 154 } 167 155 ··· 203 191 .phy_id_mask = 0x0ffffff0, 204 192 .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | 205 193 SUPPORTED_Asym_Pause, 194 + .flags = PHY_HAS_INTERRUPT, 206 195 .config_init = &ip1001_config_init, 207 196 .config_aneg = &genphy_config_aneg, 208 197 .read_status = &genphy_read_status, ··· 212 199 .driver = { .owner = THIS_MODULE,}, 213 200 }; 214 201 215 - static struct phy_driver ip101a_driver = { 202 + static struct phy_driver ip101a_g_driver = { 216 203 .phy_id = 0x02430c54, 217 - .name = "ICPlus IP101A", 204 + .name = "ICPlus IP101A/G", 218 205 .phy_id_mask = 0x0ffffff0, 219 206 .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | 220 207 SUPPORTED_Asym_Pause, 221 - .config_init = &ip101a_config_init, 208 + .flags = PHY_HAS_INTERRUPT, 209 + .config_init = &ip101a_g_config_init, 222 210 .config_aneg = &genphy_config_aneg, 223 211 .read_status = &genphy_read_status, 224 212 .suspend = genphy_suspend, ··· 235 221 if (ret < 0) 236 222 return -ENODEV; 237 223 238 - ret = phy_driver_register(&ip101a_driver); 224 + ret = phy_driver_register(&ip101a_g_driver); 239 225 if (ret < 0) 240 226 return -ENODEV; 241 227 ··· 245 231 static void __exit icplus_exit(void) 246 232 { 247 233 phy_driver_unregister(&ip1001_driver); 248 - phy_driver_unregister(&ip101a_driver); 234 + phy_driver_unregister(&ip101a_g_driver); 249 235 phy_driver_unregister(&ip175c_driver); 250 236 } 251 237 ··· 255 241 static struct mdio_device_id __maybe_unused icplus_tbl[] = { 256 242 { 0x02430d80, 0x0ffffff0 }, 257 243 { 0x02430d90, 0x0ffffff0 }, 244 + { 0x02430c54, 0x0ffffff0 }, 258 245 { } 259 246 }; 260 247
+23
drivers/net/ppp/ppp_generic.c
··· 2024 2024 continue; 2025 2025 } 2026 2026 if (PPP_MP_CB(p)->sequence != seq) { 2027 + u32 oldseq; 2027 2028 /* Fragment `seq' is missing. If it is after 2028 2029 minseq, it might arrive later, so stop here. */ 2029 2030 if (seq_after(seq, minseq)) 2030 2031 break; 2031 2032 /* Fragment `seq' is lost, keep going. */ 2032 2033 lost = 1; 2034 + oldseq = seq; 2033 2035 seq = seq_before(minseq, PPP_MP_CB(p)->sequence)? 2034 2036 minseq + 1: PPP_MP_CB(p)->sequence; 2037 + 2038 + if (ppp->debug & 1) 2039 + netdev_printk(KERN_DEBUG, ppp->dev, 2040 + "lost frag %u..%u\n", 2041 + oldseq, seq-1); 2042 + 2035 2043 goto again; 2036 2044 } 2037 2045 ··· 2084 2076 struct sk_buff *tmp2; 2085 2077 2086 2078 skb_queue_reverse_walk_from_safe(list, p, tmp2) { 2079 + if (ppp->debug & 1) 2080 + netdev_printk(KERN_DEBUG, ppp->dev, 2081 + "discarding frag %u\n", 2082 + PPP_MP_CB(p)->sequence); 2087 2083 __skb_unlink(p, list); 2088 2084 kfree_skb(p); 2089 2085 } ··· 2103 2091 /* If we have discarded any fragments, 2104 2092 signal a receive error. */ 2105 2093 if (PPP_MP_CB(head)->sequence != ppp->nextseq) { 2094 + skb_queue_walk_safe(list, p, tmp) { 2095 + if (p == head) 2096 + break; 2097 + if (ppp->debug & 1) 2098 + netdev_printk(KERN_DEBUG, ppp->dev, 2099 + "discarding frag %u\n", 2100 + PPP_MP_CB(p)->sequence); 2101 + __skb_unlink(p, list); 2102 + kfree_skb(p); 2103 + } 2104 + 2106 2105 if (ppp->debug & 1) 2107 2106 netdev_printk(KERN_DEBUG, ppp->dev, 2108 2107 " missed pkts %u..%u\n",
+7
drivers/net/usb/cdc_ether.c
··· 573 573 .driver_info = 0, 574 574 }, 575 575 576 + /* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */ 577 + { 578 + USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM, 579 + USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), 580 + .driver_info = 0, 581 + }, 582 + 576 583 /* 577 584 * WHITELIST!!! 578 585 *
+1 -1
drivers/net/usb/hso.c
··· 1632 1632 struct hso_serial *serial = get_serial_by_tty(tty); 1633 1633 struct hso_tiocmget *tiocmget = serial->tiocmget; 1634 1634 1635 - memset(&icount, 0, sizeof(struct serial_icounter_struct)); 1635 + memset(icount, 0, sizeof(struct serial_icounter_struct)); 1636 1636 1637 1637 if (!tiocmget) 1638 1638 return -ENOENT;
+12
drivers/net/usb/zaurus.c
··· 316 316 ZAURUS_MASTER_INTERFACE, 317 317 .driver_info = ZAURUS_PXA_INFO, 318 318 }, { 319 + /* C-750/C-760/C-860/SL-C3000 PDA in MDLM mode */ 320 + USB_DEVICE_AND_INTERFACE_INFO(0x04DD, 0x9031, USB_CLASS_COMM, 321 + USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), 322 + .driver_info = (unsigned long) &bogus_mdlm_info, 323 + }, { 319 324 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO 320 325 | USB_DEVICE_ID_MATCH_DEVICE, 321 326 .idVendor = 0x04DD, ··· 353 348 .idProduct = 0x0F02, /* R-1000 */ 354 349 ZAURUS_MASTER_INTERFACE, 355 350 .driver_info = OLYMPUS_MXL_INFO, 351 + }, 352 + 353 + /* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */ 354 + { 355 + USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM, 356 + USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), 357 + .driver_info = (unsigned long) &bogus_mdlm_info, 356 358 }, 357 359 { }, // END 358 360 };
+2 -2
drivers/net/vmxnet3/vmxnet3_drv.c
··· 843 843 /* for simplicity, don't copy L4 headers */ 844 844 ctx->l4_hdr_size = 0; 845 845 } 846 - ctx->copy_size = ctx->eth_ip_hdr_size + 847 - ctx->l4_hdr_size; 846 + ctx->copy_size = min(ctx->eth_ip_hdr_size + 847 + ctx->l4_hdr_size, skb->len); 848 848 } else { 849 849 ctx->eth_ip_hdr_size = 0; 850 850 ctx->l4_hdr_size = 0;
+1 -1
drivers/net/wireless/ath/ath9k/rc.c
··· 1346 1346 fc = hdr->frame_control; 1347 1347 for (i = 0; i < sc->hw->max_rates; i++) { 1348 1348 struct ieee80211_tx_rate *rate = &tx_info->status.rates[i]; 1349 - if (!rate->count) 1349 + if (rate->idx < 0 || !rate->count) 1350 1350 break; 1351 1351 1352 1352 final_ts_idx = i;
+7 -1
drivers/net/wireless/mwifiex/cfg80211.c
··· 841 841 ret = mwifiex_set_rf_channel(priv, channel, 842 842 priv->adapter->channel_type); 843 843 844 - ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); /* Disable keys */ 844 + /* As this is new association, clear locally stored 845 + * keys and security related flags */ 846 + priv->sec_info.wpa_enabled = false; 847 + priv->sec_info.wpa2_enabled = false; 848 + priv->wep_key_curr_index = 0; 849 + ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); 845 850 846 851 if (mode == NL80211_IFTYPE_ADHOC) { 847 852 /* "privacy" is set only for ad-hoc mode */ ··· 891 886 dev_dbg(priv->adapter->dev, 892 887 "info: setting wep encryption" 893 888 " with key len %d\n", sme->key_len); 889 + priv->wep_key_curr_index = sme->key_idx; 894 890 ret = mwifiex_set_encode(priv, sme->key, sme->key_len, 895 891 sme->key_idx, 0); 896 892 }
+2
drivers/parisc/iommu-helpers.h
··· 1 + #include <linux/prefetch.h> 2 + 1 3 /** 2 4 * iommu_fill_pdir - Insert coalesced scatter/gather chunks into the I/O Pdir. 3 5 * @ioc: The I/O Controller.
+3 -9
drivers/pcmcia/pxa2xx_base.c
··· 328 328 goto err1; 329 329 } 330 330 331 - if (ret) { 332 - while (--i >= 0) 333 - soc_pcmcia_remove_one(&sinfo->skt[i]); 334 - kfree(sinfo); 335 - clk_put(clk); 336 - } else { 337 - pxa2xx_configure_sockets(&dev->dev); 338 - dev_set_drvdata(&dev->dev, sinfo); 339 - } 331 + pxa2xx_configure_sockets(&dev->dev); 332 + dev_set_drvdata(&dev->dev, sinfo); 340 333 341 334 return 0; 342 335 343 336 err1: 344 337 while (--i >= 0) 345 338 soc_pcmcia_remove_one(&sinfo->skt[i]); 339 + clk_put(clk); 346 340 kfree(sinfo); 347 341 err0: 348 342 return ret;
+2 -13
drivers/platform/x86/ibm_rtl.c
··· 33 33 #include <linux/mutex.h> 34 34 #include <asm/bios_ebda.h> 35 35 36 + #include <asm-generic/io-64-nonatomic-lo-hi.h> 37 + 36 38 static bool force; 37 39 module_param(force, bool, 0); 38 40 MODULE_PARM_DESC(force, "Force driver load, ignore DMI data"); ··· 84 82 static void __iomem *rtl_cmd_addr; 85 83 static u8 rtl_cmd_type; 86 84 static u8 rtl_cmd_width; 87 - 88 - #ifndef readq 89 - static inline __u64 readq(const volatile void __iomem *addr) 90 - { 91 - const volatile u32 __iomem *p = addr; 92 - u32 low, high; 93 - 94 - low = readl(p); 95 - high = readl(p + 1); 96 - 97 - return low + ((u64)high << 32); 98 - } 99 - #endif 100 85 101 86 static void __iomem *rtl_port_map(phys_addr_t addr, unsigned long len) 102 87 {
+2 -13
drivers/platform/x86/intel_ips.c
··· 77 77 #include <asm/processor.h> 78 78 #include "intel_ips.h" 79 79 80 + #include <asm-generic/io-64-nonatomic-lo-hi.h> 81 + 80 82 #define PCI_DEVICE_ID_INTEL_THERMAL_SENSOR 0x3b32 81 83 82 84 /* ··· 345 343 346 344 static bool 347 345 ips_gpu_turbo_enabled(struct ips_driver *ips); 348 - 349 - #ifndef readq 350 - static inline __u64 readq(const volatile void __iomem *addr) 351 - { 352 - const volatile u32 __iomem *p = addr; 353 - u32 low, high; 354 - 355 - low = readl(p); 356 - high = readl(p + 1); 357 - 358 - return low + ((u64)high << 32); 359 - } 360 - #endif 361 346 362 347 /** 363 348 * ips_cpu_busy - is CPU busy?
+3 -3
drivers/regulator/88pm8607.c
··· 196 196 }; 197 197 198 198 static const unsigned int LDO13_table[] = { 199 - 1300000, 1800000, 2000000, 2500000, 2800000, 3000000, 0, 0, 199 + 1200000, 1300000, 1800000, 2000000, 2500000, 2800000, 3000000, 0, 200 200 }; 201 201 202 202 static const unsigned int LDO13_suspend_table[] = { ··· 389 389 PM8607_LDO( 7, LDO7, 0, 3, SUPPLIES_EN12, 1), 390 390 PM8607_LDO( 8, LDO8, 0, 3, SUPPLIES_EN12, 2), 391 391 PM8607_LDO( 9, LDO9, 0, 3, SUPPLIES_EN12, 3), 392 - PM8607_LDO(10, LDO10, 0, 3, SUPPLIES_EN12, 4), 392 + PM8607_LDO(10, LDO10, 0, 4, SUPPLIES_EN12, 4), 393 393 PM8607_LDO(12, LDO12, 0, 4, SUPPLIES_EN12, 5), 394 394 PM8607_LDO(13, VIBRATOR_SET, 1, 3, VIBRATOR_SET, 0), 395 - PM8607_LDO(14, LDO14, 0, 4, SUPPLIES_EN12, 6), 395 + PM8607_LDO(14, LDO14, 0, 3, SUPPLIES_EN12, 6), 396 396 }; 397 397 398 398 static int __devinit pm8607_regulator_probe(struct platform_device *pdev)
+1 -1
drivers/s390/block/dasd_eckd.c
··· 18 18 #include <linux/hdreg.h> /* HDIO_GETGEO */ 19 19 #include <linux/bio.h> 20 20 #include <linux/module.h> 21 + #include <linux/compat.h> 21 22 #include <linux/init.h> 22 23 23 24 #include <asm/debug.h> 24 25 #include <asm/idals.h> 25 26 #include <asm/ebcdic.h> 26 - #include <asm/compat.h> 27 27 #include <asm/io.h> 28 28 #include <asm/uaccess.h> 29 29 #include <asm/cio.h>
+1
drivers/s390/block/dasd_ioctl.c
··· 13 13 #define KMSG_COMPONENT "dasd" 14 14 15 15 #include <linux/interrupt.h> 16 + #include <linux/compat.h> 16 17 #include <linux/major.h> 17 18 #include <linux/fs.h> 18 19 #include <linux/blkpg.h>
+15 -7
drivers/s390/char/con3215.c
··· 87 87 struct tty_struct *tty; /* pointer to tty structure if present */ 88 88 struct raw3215_req *queued_read; /* pointer to queued read requests */ 89 89 struct raw3215_req *queued_write;/* pointer to queued write requests */ 90 + struct tasklet_struct tlet; /* tasklet to invoke tty_wakeup */ 90 91 wait_queue_head_t empty_wait; /* wait queue for flushing */ 91 92 struct timer_list timer; /* timer for delayed output */ 92 93 int line_pos; /* position on the line (for tabs) */ ··· 335 334 } 336 335 337 336 /* 337 + * Call tty_wakeup from tasklet context 338 + */ 339 + static void raw3215_wakeup(unsigned long data) 340 + { 341 + struct raw3215_info *raw = (struct raw3215_info *) data; 342 + tty_wakeup(raw->tty); 343 + } 344 + 345 + /* 338 346 * Try to start the next IO and wake up processes waiting on the tty. 339 347 */ 340 348 static void raw3215_next_io(struct raw3215_info *raw) 341 349 { 342 - struct tty_struct *tty; 343 - 344 350 raw3215_mk_write_req(raw); 345 351 raw3215_try_io(raw); 346 - tty = raw->tty; 347 - if (tty != NULL && 348 - RAW3215_BUFFER_SIZE - raw->count >= RAW3215_MIN_SPACE) { 349 - tty_wakeup(tty); 350 - } 352 + if (raw->tty && RAW3215_BUFFER_SIZE - raw->count >= RAW3215_MIN_SPACE) 353 + tasklet_schedule(&raw->tlet); 351 354 } 352 355 353 356 /* ··· 687 682 return -ENOMEM; 688 683 } 689 684 init_waitqueue_head(&raw->empty_wait); 685 + tasklet_init(&raw->tlet, raw3215_wakeup, (unsigned long) raw); 690 686 691 687 dev_set_drvdata(&cdev->dev, raw); 692 688 cdev->handler = raw3215_irq; ··· 907 901 908 902 raw->flags |= RAW3215_FIXED; 909 903 init_waitqueue_head(&raw->empty_wait); 904 + tasklet_init(&raw->tlet, raw3215_wakeup, (unsigned long) raw); 910 905 911 906 /* Request the console irq */ 912 907 if (raw3215_startup(raw) != 0) { ··· 973 966 tty->closing = 1; 974 967 /* Shutdown the terminal */ 975 968 raw3215_shutdown(raw); 969 + tasklet_kill(&raw->tlet); 976 970 tty->closing = 0; 977 971 raw->tty = NULL; 978 972 }
+1
drivers/s390/char/fs3270.c
··· 11 11 #include <linux/console.h> 12 12 #include <linux/init.h> 13 13 #include <linux/interrupt.h> 14 + #include <linux/compat.h> 14 15 #include <linux/module.h> 15 16 #include <linux/list.h> 16 17 #include <linux/slab.h>
+1
drivers/s390/char/vmcp.c
··· 13 13 14 14 #include <linux/fs.h> 15 15 #include <linux/init.h> 16 + #include <linux/compat.h> 16 17 #include <linux/kernel.h> 17 18 #include <linux/miscdevice.h> 18 19 #include <linux/slab.h>
+1
drivers/s390/cio/chsc_sch.c
··· 8 8 */ 9 9 10 10 #include <linux/slab.h> 11 + #include <linux/compat.h> 11 12 #include <linux/device.h> 12 13 #include <linux/module.h> 13 14 #include <linux/uaccess.h>
+1
drivers/s390/scsi/zfcp_cfdc.c
··· 11 11 #define KMSG_COMPONENT "zfcp" 12 12 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 13 13 14 + #include <linux/compat.h> 14 15 #include <linux/slab.h> 15 16 #include <linux/types.h> 16 17 #include <linux/miscdevice.h>
+14 -11
drivers/scsi/device_handler/scsi_dh_rdac.c
··· 364 364 struct rdac_controller *ctlr; 365 365 ctlr = container_of(kref, struct rdac_controller, kref); 366 366 367 - flush_workqueue(kmpath_rdacd); 368 - spin_lock(&list_lock); 369 367 list_del(&ctlr->node); 370 - spin_unlock(&list_lock); 371 368 kfree(ctlr); 372 369 } 373 370 ··· 373 376 { 374 377 struct rdac_controller *ctlr, *tmp; 375 378 376 - spin_lock(&list_lock); 377 - 378 379 list_for_each_entry(tmp, &ctlr_list, node) { 379 380 if ((memcmp(tmp->array_id, array_id, UNIQUE_ID_LEN) == 0) && 380 381 (tmp->index == index) && 381 382 (tmp->host == sdev->host)) { 382 383 kref_get(&tmp->kref); 383 - spin_unlock(&list_lock); 384 384 return tmp; 385 385 } 386 386 } 387 387 ctlr = kmalloc(sizeof(*ctlr), GFP_ATOMIC); 388 388 if (!ctlr) 389 - goto done; 389 + return NULL; 390 390 391 391 /* initialize fields of controller */ 392 392 memcpy(ctlr->array_id, array_id, UNIQUE_ID_LEN); ··· 399 405 INIT_WORK(&ctlr->ms_work, send_mode_select); 400 406 INIT_LIST_HEAD(&ctlr->ms_head); 401 407 list_add(&ctlr->node, &ctlr_list); 402 - done: 403 - spin_unlock(&list_lock); 408 + 404 409 return ctlr; 405 410 } 406 411 ··· 510 517 index = 0; 511 518 else 512 519 index = 1; 520 + 521 + spin_lock(&list_lock); 513 522 h->ctlr = get_controller(index, array_name, array_id, sdev); 514 523 if (!h->ctlr) 515 524 err = SCSI_DH_RES_TEMP_UNAVAIL; 525 + spin_unlock(&list_lock); 516 526 } 517 527 return err; 518 528 } ··· 902 906 return 0; 903 907 904 908 clean_ctlr: 909 + spin_lock(&list_lock); 905 910 kref_put(&h->ctlr->kref, release_controller); 911 + spin_unlock(&list_lock); 906 912 907 913 failed: 908 914 kfree(scsi_dh_data); ··· 919 921 struct rdac_dh_data *h; 920 922 unsigned long flags; 921 923 922 - spin_lock_irqsave(sdev->request_queue->queue_lock, flags); 923 924 scsi_dh_data = sdev->scsi_dh_data; 925 + h = (struct rdac_dh_data *) scsi_dh_data->buf; 926 + if (h->ctlr && h->ctlr->ms_queued) 927 + flush_workqueue(kmpath_rdacd); 928 + 929 + spin_lock_irqsave(sdev->request_queue->queue_lock, flags); 924 930 sdev->scsi_dh_data = NULL; 925 931 spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); 926 932 927 - h = (struct rdac_dh_data *) scsi_dh_data->buf; 933 + spin_lock(&list_lock); 928 934 if (h->ctlr) 929 935 kref_put(&h->ctlr->kref, release_controller); 936 + spin_unlock(&list_lock); 930 937 kfree(scsi_dh_data); 931 938 module_put(THIS_MODULE); 932 939 sdev_printk(KERN_NOTICE, sdev, "%s: Detached\n", RDAC_NAME);
+18 -6
drivers/scsi/ipr.c
··· 4613 4613 ENTER; 4614 4614 ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata; 4615 4615 4616 - dev_err(&ioa_cfg->pdev->dev, 4617 - "Adapter being reset as a result of error recovery.\n"); 4616 + if (!ioa_cfg->in_reset_reload) { 4617 + dev_err(&ioa_cfg->pdev->dev, 4618 + "Adapter being reset as a result of error recovery.\n"); 4618 4619 4619 - if (WAIT_FOR_DUMP == ioa_cfg->sdt_state) 4620 - ioa_cfg->sdt_state = GET_DUMP; 4620 + if (WAIT_FOR_DUMP == ioa_cfg->sdt_state) 4621 + ioa_cfg->sdt_state = GET_DUMP; 4622 + } 4621 4623 4622 4624 rc = ipr_reset_reload(ioa_cfg, IPR_SHUTDOWN_ABBREV); 4623 4625 ··· 4909 4907 struct ipr_ioa_cfg *ioa_cfg; 4910 4908 struct ipr_resource_entry *res; 4911 4909 struct ipr_cmd_pkt *cmd_pkt; 4912 - u32 ioasc; 4910 + u32 ioasc, int_reg; 4913 4911 int op_found = 0; 4914 4912 4915 4913 ENTER; ··· 4922 4920 */ 4923 4921 if (ioa_cfg->in_reset_reload || ioa_cfg->ioa_is_dead) 4924 4922 return FAILED; 4925 - if (!res || !ipr_is_gscsi(res)) 4923 + if (!res) 4924 + return FAILED; 4925 + 4926 + /* 4927 + * If we are aborting a timed out op, chances are that the timeout was caused 4928 + * by a still not detected EEH error. In such cases, reading a register will 4929 + * trigger the EEH recovery infrastructure. 4930 + */ 4931 + int_reg = readl(ioa_cfg->regs.sense_interrupt_reg); 4932 + 4933 + if (!ipr_is_gscsi(res)) 4926 4934 return FAILED; 4927 4935 4928 4936 list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) {
+3 -1
drivers/scsi/isci/host.c
··· 1848 1848 if (state == SCIC_RESET || 1849 1849 state == SCIC_INITIALIZING || 1850 1850 state == SCIC_INITIALIZED) { 1851 + u8 oem_version = pci_info->orom ? pci_info->orom->hdr.version : 1852 + ISCI_ROM_VER_1_0; 1851 1853 1852 1854 if (sci_oem_parameters_validate(&ihost->oem_parameters, 1853 - pci_info->orom->hdr.version)) 1855 + oem_version)) 1854 1856 return SCI_FAILURE_INVALID_PARAMETER_VALUE; 1855 1857 1856 1858 return SCI_SUCCESS;
+2 -1
drivers/scsi/mpt2sas/mpt2sas_base.c
··· 4548 4548 printk(MPT2SAS_ERR_FMT "%s: pci error recovery reset\n", 4549 4549 ioc->name, __func__); 4550 4550 r = 0; 4551 - goto out; 4551 + goto out_unlocked; 4552 4552 } 4553 4553 4554 4554 if (mpt2sas_fwfault_debug) ··· 4604 4604 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 4605 4605 mutex_unlock(&ioc->reset_in_progress_mutex); 4606 4606 4607 + out_unlocked: 4607 4608 dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: exit\n", ioc->name, 4608 4609 __func__)); 4609 4610 return r;
+2 -2
drivers/scsi/osd/osd_uld.c
··· 69 69 #ifndef SCSI_OSD_MAJOR 70 70 # define SCSI_OSD_MAJOR 260 71 71 #endif 72 - #define SCSI_OSD_MAX_MINOR 64 72 + #define SCSI_OSD_MAX_MINOR MINORMASK 73 73 74 74 static const char osd_name[] = "osd"; 75 - static const char *osd_version_string = "open-osd 0.2.0"; 75 + static const char *osd_version_string = "open-osd 0.2.1"; 76 76 77 77 MODULE_AUTHOR("Boaz Harrosh <bharrosh@panasas.com>"); 78 78 MODULE_DESCRIPTION("open-osd Upper-Layer-Driver osd.ko");
+4 -9
drivers/scsi/qla2xxx/qla_attr.c
··· 1036 1036 vha->device_flags & DFLG_NO_CABLE) 1037 1037 len = snprintf(buf, PAGE_SIZE, "Link Down\n"); 1038 1038 else if (atomic_read(&vha->loop_state) != LOOP_READY || 1039 - test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || 1040 - test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) 1039 + qla2x00_reset_active(vha)) 1041 1040 len = snprintf(buf, PAGE_SIZE, "Unknown Link State\n"); 1042 1041 else { 1043 1042 len = snprintf(buf, PAGE_SIZE, "Link Up - "); ··· 1358 1359 return snprintf(buf, PAGE_SIZE, "\n"); 1359 1360 1360 1361 temp = frac = 0; 1361 - if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || 1362 - test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) 1362 + if (qla2x00_reset_active(vha)) 1363 1363 ql_log(ql_log_warn, vha, 0x707b, 1364 1364 "ISP reset active.\n"); 1365 1365 else if (!vha->hw->flags.eeh_busy) ··· 1377 1379 int rval = QLA_FUNCTION_FAILED; 1378 1380 uint16_t state[5]; 1379 1381 1380 - if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || 1381 - test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) 1382 + if (qla2x00_reset_active(vha)) 1382 1383 ql_log(ql_log_warn, vha, 0x707c, 1383 1384 "ISP reset active.\n"); 1384 1385 else if (!vha->hw->flags.eeh_busy) ··· 1690 1693 if (IS_FWI2_CAPABLE(ha)) { 1691 1694 rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma); 1692 1695 } else if (atomic_read(&base_vha->loop_state) == LOOP_READY && 1693 - !test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags) && 1694 - !test_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags) && 1695 - !ha->dpc_active) { 1696 + !qla2x00_reset_active(vha) && !ha->dpc_active) { 1696 1697 /* Must be in a 'READY' state for statistics retrieval. */ 1697 1698 rval = qla2x00_get_link_status(base_vha, base_vha->loop_id, 1698 1699 stats, stats_dma);
+9 -41
drivers/scsi/qla2xxx/qla_bsg.c
··· 108 108 goto exit_fcp_prio_cfg; 109 109 } 110 110 111 - if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || 112 - test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || 113 - test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { 114 - ret = -EBUSY; 115 - goto exit_fcp_prio_cfg; 116 - } 117 - 118 111 /* Get the sub command */ 119 112 oper = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1]; 120 113 ··· 639 646 dma_addr_t rsp_data_dma; 640 647 uint32_t rsp_data_len; 641 648 642 - if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || 643 - test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || 644 - test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { 645 - ql_log(ql_log_warn, vha, 0x7018, "Abort active or needed.\n"); 646 - return -EBUSY; 647 - } 648 - 649 649 if (!vha->flags.online) { 650 650 ql_log(ql_log_warn, vha, 0x7019, "Host is not online.\n"); 651 651 return -EIO; ··· 860 874 int rval = 0; 861 875 uint32_t flag; 862 876 863 - if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || 864 - test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || 865 - test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { 866 - ql_log(ql_log_warn, vha, 0x702e, "Abort active or needed.\n"); 867 - return -EBUSY; 868 - } 869 - 870 877 if (!IS_QLA84XX(ha)) { 871 878 ql_dbg(ql_dbg_user, vha, 0x702f, "Not 84xx, exiting.\n"); 872 879 return -EINVAL; ··· 900 921 uint16_t options; 901 922 uint32_t flag; 902 923 uint32_t fw_ver; 903 - 904 - if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || 905 - test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || 906 - test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) 907 - return -EBUSY; 908 924 909 925 if (!IS_QLA84XX(ha)) { 910 926 ql_dbg(ql_dbg_user, vha, 0x7032, ··· 1009 1035 uint32_t sg_cnt; 1010 1036 uint32_t data_len = 0; 1011 1037 uint32_t dma_direction = DMA_NONE; 1012 - 1013 - if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || 1014 - test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || 1015 - test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { 1016 - ql_log(ql_log_warn, vha, 0x7039, 1017 - "Abort active or needed.\n"); 1018 - return -EBUSY; 1019 - } 1020 1038 1021 1039 if (!IS_QLA84XX(ha)) { 1022 1040 ql_log(ql_log_warn, vha, 0x703a, ··· 1211 1245 uint8_t *rsp_ptr = NULL; 1212 1246 1213 1247 bsg_job->reply->reply_payload_rcv_len = 0; 1214 - 1215 - if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || 1216 - test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || 1217 - test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { 1218 - ql_log(ql_log_warn, vha, 0x7045, "abort active or needed.\n"); 1219 - return -EBUSY; 1220 - } 1221 1248 1222 1249 if (!IS_IIDMA_CAPABLE(vha->hw)) { 1223 1250 ql_log(ql_log_info, vha, 0x7046, "iiDMA not supported.\n"); ··· 1625 1666 } else { 1626 1667 host = bsg_job->shost; 1627 1668 vha = shost_priv(host); 1669 + } 1670 + 1671 + if (qla2x00_reset_active(vha)) { 1672 + ql_dbg(ql_dbg_user, vha, 0x709f, 1673 + "BSG: ISP abort active/needed -- cmd=%d.\n", 1674 + bsg_job->request->msgcode); 1675 + bsg_job->reply->result = (DID_ERROR << 16); 1676 + bsg_job->job_done(bsg_job); 1677 + return -EBUSY; 1628 1678 } 1629 1679 1630 1680 ql_dbg(ql_dbg_user, vha, 0x7000,
+2 -1
drivers/scsi/qla2xxx/qla_dbg.c
··· 19 19 * | DPC Thread | 0x401c | | 20 20 * | Async Events | 0x5057 | 0x5052 | 21 21 * | Timer Routines | 0x6011 | 0x600e,0x600f | 22 - * | User Space Interactions | 0x709e | | 22 + * | User Space Interactions | 0x709e | 0x7018,0x702e | 23 + * | | | 0x7039,0x7045 | 23 24 * | Task Management | 0x803c | 0x8025-0x8026 | 24 25 * | | | 0x800b,0x8039 | 25 26 * | AER/EEH | 0x900f | |
+1
drivers/scsi/qla2xxx/qla_def.h
··· 44 44 * ISP2100 HBAs. 45 45 */ 46 46 #define MAILBOX_REGISTER_COUNT_2100 8 47 + #define MAILBOX_REGISTER_COUNT_2200 24 47 48 #define MAILBOX_REGISTER_COUNT 32 48 49 49 50 #define QLA2200A_RISC_ROM_VER 4
+13
drivers/scsi/qla2xxx/qla_inline.h
··· 131 131 } 132 132 return 0; 133 133 } 134 + 135 + static inline int 136 + qla2x00_reset_active(scsi_qla_host_t *vha) 137 + { 138 + scsi_qla_host_t *base_vha = pci_get_drvdata(vha->hw->pdev); 139 + 140 + /* Test appropriate base-vha and vha flags. */ 141 + return test_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags) || 142 + test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags) || 143 + test_bit(ISP_ABORT_RETRY, &base_vha->dpc_flags) || 144 + test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || 145 + test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); 146 + }
-1
drivers/scsi/qla2xxx/qla_isr.c
··· 2090 2090 break; 2091 2091 case CT_IOCB_TYPE: 2092 2092 qla24xx_els_ct_entry(vha, rsp->req, pkt, CT_IOCB_TYPE); 2093 - clear_bit(MBX_INTERRUPT, &vha->hw->mbx_cmd_flags); 2094 2093 break; 2095 2094 case ELS_IOCB_TYPE: 2096 2095 qla24xx_els_ct_entry(vha, rsp->req, pkt, ELS_IOCB_TYPE);
+6 -1
drivers/scsi/qla2xxx/qla_mbx.c
··· 342 342 343 343 set_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); 344 344 clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); 345 + /* Allow next mbx cmd to come in. */ 346 + complete(&ha->mbx_cmd_comp); 345 347 if (ha->isp_ops->abort_isp(vha)) { 346 348 /* Failed. retry later. */ 347 349 set_bit(ISP_ABORT_NEEDED, ··· 352 350 clear_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); 353 351 ql_dbg(ql_dbg_mbx, base_vha, 0x101f, 354 352 "Finished abort_isp.\n"); 353 + goto mbx_done; 355 354 } 356 355 } 357 356 } ··· 361 358 /* Allow next mbx cmd to come in. */ 362 359 complete(&ha->mbx_cmd_comp); 363 360 361 + mbx_done: 364 362 if (rval) { 365 363 ql_dbg(ql_dbg_mbx, base_vha, 0x1020, 366 364 "**** Failed mbx[0]=%x, mb[1]=%x, mb[2]=%x, cmd=%x ****.\n", ··· 2585 2581 ql_dbg(ql_dbg_mbx, vha, 0x10a1, "Entered %s.\n", __func__); 2586 2582 2587 2583 mcp->mb[0] = MBC_STOP_FIRMWARE; 2588 - mcp->out_mb = MBX_0; 2584 + mcp->mb[1] = 0; 2585 + mcp->out_mb = MBX_1|MBX_0; 2589 2586 mcp->in_mb = MBX_0; 2590 2587 mcp->tov = 5; 2591 2588 mcp->flags = 0;
+1 -14
drivers/scsi/qla2xxx/qla_nx.c
··· 1165 1165 qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xfeffffff); 1166 1166 else 1167 1167 qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xffffffff); 1168 - 1169 - /* reset ms */ 1170 - val = qla82xx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4); 1171 - val |= (1 << 1); 1172 - qla82xx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val); 1173 - msleep(20); 1174 - 1175 - /* unreset ms */ 1176 - val = qla82xx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4); 1177 - val &= ~(1 << 1); 1178 - qla82xx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val); 1179 - msleep(20); 1180 - 1181 1168 qla82xx_rom_unlock(ha); 1182 1169 1183 1170 /* Read the signature value from the flash. ··· 3379 3392 QLA82XX_CRB_PEG_NET_3 + 0x3c), 3380 3393 qla82xx_rd_32(ha, 3381 3394 QLA82XX_CRB_PEG_NET_4 + 0x3c)); 3382 - if (LSW(MSB(halt_status)) == 0x67) 3395 + if (((halt_status & 0x1fffff00) >> 8) == 0x67) 3383 3396 ql_log(ql_log_warn, vha, 0xb052, 3384 3397 "Firmware aborted with " 3385 3398 "error code 0x00006700. Device is "
+8 -11
drivers/scsi/qla2xxx/qla_os.c
··· 625 625 cmd->result = DID_NO_CONNECT << 16; 626 626 goto qc24_fail_command; 627 627 } 628 + 629 + if (!fcport) { 630 + cmd->result = DID_NO_CONNECT << 16; 631 + goto qc24_fail_command; 632 + } 633 + 628 634 if (atomic_read(&fcport->state) != FCS_ONLINE) { 629 635 if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || 630 636 atomic_read(&base_vha->loop_state) == LOOP_DEAD) { ··· 883 877 884 878 spin_unlock_irqrestore(&ha->hardware_lock, flags); 885 879 if (ha->isp_ops->abort_command(sp)) { 880 + ret = FAILED; 886 881 ql_dbg(ql_dbg_taskm, vha, 0x8003, 887 882 "Abort command mbx failed cmd=%p.\n", cmd); 888 883 } else { ··· 1131 1124 qla2xxx_eh_host_reset(struct scsi_cmnd *cmd) 1132 1125 { 1133 1126 scsi_qla_host_t *vha = shost_priv(cmd->device->host); 1134 - fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; 1135 1127 struct qla_hw_data *ha = vha->hw; 1136 1128 int ret = FAILED; 1137 1129 unsigned int id, lun; ··· 1138 1132 1139 1133 id = cmd->device->id; 1140 1134 lun = cmd->device->lun; 1141 - 1142 - if (!fcport) { 1143 - return ret; 1144 - } 1145 - 1146 - ret = fc_block_scsi_eh(cmd); 1147 - if (ret != 0) 1148 - return ret; 1149 - ret = FAILED; 1150 1135 1151 1136 ql_log(ql_log_info, vha, 0x8018, 1152 1137 "ADAPTER RESET ISSUED nexus=%ld:%d:%d.\n", vha->host_no, id, lun); ··· 2044 2047 ha->nvram_data_off = ~0; 2045 2048 ha->isp_ops = &qla2100_isp_ops; 2046 2049 } else if (IS_QLA2200(ha)) { 2047 - ha->mbx_count = MAILBOX_REGISTER_COUNT; 2050 + ha->mbx_count = MAILBOX_REGISTER_COUNT_2200; 2048 2051 req_length = REQUEST_ENTRY_CNT_2200; 2049 2052 rsp_length = RESPONSE_ENTRY_CNT_2100; 2050 2053 ha->max_loop_id = SNS_LAST_LOOP_ID_2100;
+1 -1
drivers/scsi/qla2xxx/qla_version.h
··· 7 7 /* 8 8 * Driver version 9 9 */ 10 - #define QLA2XXX_VERSION "8.03.07.12-k" 10 + #define QLA2XXX_VERSION "8.03.07.13-k" 11 11 12 12 #define QLA_DRIVER_MAJOR_VER 8 13 13 #define QLA_DRIVER_MINOR_VER 3
+2 -21
drivers/scsi/qla4xxx/ql4_nx.c
··· 10 10 #include "ql4_def.h" 11 11 #include "ql4_glbl.h" 12 12 13 + #include <asm-generic/io-64-nonatomic-lo-hi.h> 14 + 13 15 #define MASK(n) DMA_BIT_MASK(n) 14 16 #define MN_WIN(addr) (((addr & 0x1fc0000) >> 1) | ((addr >> 25) & 0x3ff)) 15 17 #define OCM_WIN(addr) (((addr & 0x1ff0000) >> 1) | ((addr >> 25) & 0x3ff)) ··· 656 654 657 655 return 0; 658 656 } 659 - 660 - #ifndef readq 661 - static inline __u64 readq(const volatile void __iomem *addr) 662 - { 663 - const volatile u32 __iomem *p = addr; 664 - u32 low, high; 665 - 666 - low = readl(p); 667 - high = readl(p + 1); 668 - 669 - return low + ((u64)high << 32); 670 - } 671 - #endif 672 - 673 - #ifndef writeq 674 - static inline void writeq(__u64 val, volatile void __iomem *addr) 675 - { 676 - writel(val, addr); 677 - writel(val >> 32, addr+4); 678 - } 679 - #endif 680 657 681 658 static int qla4_8xxx_pci_mem_read_direct(struct scsi_qla_host *ha, 682 659 u64 off, void *data, int size)
+16
drivers/scsi/scsi_pm.c
··· 7 7 8 8 #include <linux/pm_runtime.h> 9 9 #include <linux/export.h> 10 + #include <linux/async.h> 10 11 11 12 #include <scsi/scsi.h> 12 13 #include <scsi/scsi_device.h> ··· 93 92 return err; 94 93 } 95 94 95 + static int scsi_bus_prepare(struct device *dev) 96 + { 97 + if (scsi_is_sdev_device(dev)) { 98 + /* sd probing uses async_schedule. Wait until it finishes. */ 99 + async_synchronize_full(); 100 + 101 + } else if (scsi_is_host_device(dev)) { 102 + /* Wait until async scanning is finished */ 103 + scsi_complete_async_scans(); 104 + } 105 + return 0; 106 + } 107 + 96 108 static int scsi_bus_suspend(struct device *dev) 97 109 { 98 110 return scsi_bus_suspend_common(dev, PMSG_SUSPEND); ··· 124 110 #else /* CONFIG_PM_SLEEP */ 125 111 126 112 #define scsi_bus_resume_common NULL 113 + #define scsi_bus_prepare NULL 127 114 #define scsi_bus_suspend NULL 128 115 #define scsi_bus_freeze NULL 129 116 #define scsi_bus_poweroff NULL ··· 233 218 #endif /* CONFIG_PM_RUNTIME */ 234 219 235 220 const struct dev_pm_ops scsi_bus_pm_ops = { 221 + .prepare = scsi_bus_prepare, 236 222 .suspend = scsi_bus_suspend, 237 223 .resume = scsi_bus_resume_common, 238 224 .freeze = scsi_bus_freeze,
+1
drivers/scsi/scsi_priv.h
··· 109 109 #endif /* CONFIG_PROC_FS */ 110 110 111 111 /* scsi_scan.c */ 112 + extern int scsi_complete_async_scans(void); 112 113 extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int, 113 114 unsigned int, unsigned int, int); 114 115 extern void scsi_forget_host(struct Scsi_Host *);
+2 -2
drivers/scsi/scsi_scan.c
··· 1815 1815 } 1816 1816 spin_unlock(&async_scan_lock); 1817 1817 1818 + scsi_autopm_put_host(shost); 1818 1819 scsi_host_put(shost); 1819 1820 kfree(data); 1820 1821 } ··· 1842 1841 1843 1842 do_scsi_scan_host(shost); 1844 1843 scsi_finish_async_scan(data); 1845 - scsi_autopm_put_host(shost); 1846 1844 return 0; 1847 1845 } 1848 1846 ··· 1869 1869 p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no); 1870 1870 if (IS_ERR(p)) 1871 1871 do_scan_async(data); 1872 - /* scsi_autopm_put_host(shost) is called in do_scan_async() */ 1872 + /* scsi_autopm_put_host(shost) is called in scsi_finish_async_scan() */ 1873 1873 } 1874 1874 EXPORT_SYMBOL(scsi_scan_host); 1875 1875
+1 -1
drivers/sh/clk/cpg.c
··· 190 190 return -EINVAL; 191 191 } 192 192 193 - clk->parent = clk->parent_table[val]; 193 + clk_reparent(clk, clk->parent_table[val]); 194 194 if (!clk->parent) { 195 195 pr_err("sh_clk_init_parent: unable to set parent"); 196 196 return -EINVAL;
+4 -1
drivers/usb/core/hcd-pci.c
··· 187 187 return -ENODEV; 188 188 dev->current_state = PCI_D0; 189 189 190 - if (!dev->irq) { 190 + /* The xHCI driver supports MSI and MSI-X, 191 + * so don't fail if the BIOS doesn't provide a legacy IRQ. 192 + */ 193 + if (!dev->irq && (driver->flags & HCD_MASK) != HCD_USB3) { 191 194 dev_err(&dev->dev, 192 195 "Found HC with no IRQ. Check BIOS/PCI %s setup!\n", 193 196 pci_name(dev));
+4 -2
drivers/usb/core/hcd.c
··· 2447 2447 && device_can_wakeup(&hcd->self.root_hub->dev)) 2448 2448 dev_dbg(hcd->self.controller, "supports USB remote wakeup\n"); 2449 2449 2450 - /* enable irqs just before we start the controller */ 2451 - if (usb_hcd_is_primary_hcd(hcd)) { 2450 + /* enable irqs just before we start the controller, 2451 + * if the BIOS provides legacy PCI irqs. 2452 + */ 2453 + if (usb_hcd_is_primary_hcd(hcd) && irqnum) { 2452 2454 retval = usb_hcd_request_irqs(hcd, irqnum, irqflags); 2453 2455 if (retval) 2454 2456 goto err_request_irq;
+17 -13
drivers/usb/core/hub.c
··· 705 705 if (type == HUB_INIT3) 706 706 goto init3; 707 707 708 - /* After a resume, port power should still be on. 708 + /* The superspeed hub except for root hub has to use Hub Depth 709 + * value as an offset into the route string to locate the bits 710 + * it uses to determine the downstream port number. So hub driver 711 + * should send a set hub depth request to superspeed hub after 712 + * the superspeed hub is set configuration in initialization or 713 + * reset procedure. 714 + * 715 + * After a resume, port power should still be on. 709 716 * For any other type of activation, turn it on. 710 717 */ 711 718 if (type != HUB_RESUME) { 719 + if (hdev->parent && hub_is_superspeed(hdev)) { 720 + ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), 721 + HUB_SET_DEPTH, USB_RT_HUB, 722 + hdev->level - 1, 0, NULL, 0, 723 + USB_CTRL_SET_TIMEOUT); 724 + if (ret < 0) 725 + dev_err(hub->intfdev, 726 + "set hub depth failed\n"); 727 + } 712 728 713 729 /* Speed up system boot by using a delayed_work for the 714 730 * hub's initial power-up delays. This is pretty awkward ··· 1001 985 if (!hub->descriptor) { 1002 986 ret = -ENOMEM; 1003 987 goto fail; 1004 - } 1005 - 1006 - if (hub_is_superspeed(hdev) && (hdev->parent != NULL)) { 1007 - ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), 1008 - HUB_SET_DEPTH, USB_RT_HUB, 1009 - hdev->level - 1, 0, NULL, 0, 1010 - USB_CTRL_SET_TIMEOUT); 1011 - 1012 - if (ret < 0) { 1013 - message = "can't set hub depth"; 1014 - goto fail; 1015 - } 1016 988 } 1017 989 1018 990 /* Request the entire hub descriptor.
+11
drivers/usb/host/pci-quirks.c
··· 872 872 */ 873 873 if (pdev->vendor == 0x184e) /* vendor Netlogic */ 874 874 return; 875 + if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI && 876 + pdev->class != PCI_CLASS_SERIAL_USB_OHCI && 877 + pdev->class != PCI_CLASS_SERIAL_USB_EHCI && 878 + pdev->class != PCI_CLASS_SERIAL_USB_XHCI) 879 + return; 875 880 881 + if (pci_enable_device(pdev) < 0) { 882 + dev_warn(&pdev->dev, "Can't enable PCI device, " 883 + "BIOS handoff failed.\n"); 884 + return; 885 + } 876 886 if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI) 877 887 quirk_usb_handoff_uhci(pdev); 878 888 else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI) ··· 891 881 quirk_usb_disable_ehci(pdev); 892 882 else if (pdev->class == PCI_CLASS_SERIAL_USB_XHCI) 893 883 quirk_usb_handoff_xhci(pdev); 884 + pci_disable_device(pdev); 894 885 } 895 886 DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff);
+1 -1
drivers/usb/host/xhci-hub.c
··· 93 93 */ 94 94 memset(port_removable, 0, sizeof(port_removable)); 95 95 for (i = 0; i < ports; i++) { 96 - portsc = xhci_readl(xhci, xhci->usb3_ports[i]); 96 + portsc = xhci_readl(xhci, xhci->usb2_ports[i]); 97 97 /* If a device is removable, PORTSC reports a 0, same as in the 98 98 * hub descriptor DeviceRemovable bits. 99 99 */
+24 -8
drivers/usb/host/xhci-mem.c
··· 1126 1126 } 1127 1127 1128 1128 /* 1129 - * Convert bInterval expressed in frames (in 1-255 range) to exponent of 1129 + * Convert bInterval expressed in microframes (in 1-255 range) to exponent of 1130 1130 * microframes, rounded down to nearest power of 2. 1131 1131 */ 1132 - static unsigned int xhci_parse_frame_interval(struct usb_device *udev, 1133 - struct usb_host_endpoint *ep) 1132 + static unsigned int xhci_microframes_to_exponent(struct usb_device *udev, 1133 + struct usb_host_endpoint *ep, unsigned int desc_interval, 1134 + unsigned int min_exponent, unsigned int max_exponent) 1134 1135 { 1135 1136 unsigned int interval; 1136 1137 1137 - interval = fls(8 * ep->desc.bInterval) - 1; 1138 - interval = clamp_val(interval, 3, 10); 1139 - if ((1 << interval) != 8 * ep->desc.bInterval) 1138 + interval = fls(desc_interval) - 1; 1139 + interval = clamp_val(interval, min_exponent, max_exponent); 1140 + if ((1 << interval) != desc_interval) 1140 1141 dev_warn(&udev->dev, 1141 1142 "ep %#x - rounding interval to %d microframes, ep desc says %d microframes\n", 1142 1143 ep->desc.bEndpointAddress, 1143 1144 1 << interval, 1144 - 8 * ep->desc.bInterval); 1145 + desc_interval); 1145 1146 1146 1147 return interval; 1148 + } 1149 + 1150 + static unsigned int xhci_parse_microframe_interval(struct usb_device *udev, 1151 + struct usb_host_endpoint *ep) 1152 + { 1153 + return xhci_microframes_to_exponent(udev, ep, 1154 + ep->desc.bInterval, 0, 15); 1155 + } 1156 + 1157 + 1158 + static unsigned int xhci_parse_frame_interval(struct usb_device *udev, 1159 + struct usb_host_endpoint *ep) 1160 + { 1161 + return xhci_microframes_to_exponent(udev, ep, 1162 + ep->desc.bInterval * 8, 3, 10); 1147 1163 } 1148 1164 1149 1165 /* Return the polling or NAK interval. ··· 1180 1164 /* Max NAK rate */ 1181 1165 if (usb_endpoint_xfer_control(&ep->desc) || 1182 1166 usb_endpoint_xfer_bulk(&ep->desc)) { 1183 - interval = ep->desc.bInterval; 1167 + interval = xhci_parse_microframe_interval(udev, ep); 1184 1168 break; 1185 1169 } 1186 1170 /* Fall through - SS and HS isoc/int have same decoding */
+5
drivers/usb/host/xhci.c
··· 352 352 /* hcd->irq is -1, we have MSI */ 353 353 return 0; 354 354 355 + if (!pdev->irq) { 356 + xhci_err(xhci, "No msi-x/msi found and no IRQ in BIOS\n"); 357 + return -EINVAL; 358 + } 359 + 355 360 /* fall back to legacy interrupt*/ 356 361 ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED, 357 362 hcd->irq_descr, hcd);
+2
drivers/usb/serial/cp210x.c
··· 136 136 { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ 137 137 { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */ 138 138 { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ 139 + { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */ 140 + { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */ 139 141 { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */ 140 142 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ 141 143 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
+13 -130
drivers/usb/serial/option.c
··· 788 788 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff), 789 789 .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, 790 790 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) }, 791 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, 792 791 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) }, 793 792 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) }, 794 793 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff), ··· 802 803 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) }, 803 804 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff), 804 805 .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, 805 - /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) }, */ 806 806 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) }, 807 807 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) }, 808 808 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) }, ··· 826 828 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) }, 827 829 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff), 828 830 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 829 - /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0053, 0xff, 0xff, 0xff) }, */ 830 831 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) }, 831 832 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff), 832 833 .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, ··· 833 836 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) }, 834 837 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff), 835 838 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 836 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) }, 837 839 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) }, 838 840 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) }, 839 841 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff), ··· 842 846 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) }, 843 847 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0067, 0xff, 0xff, 0xff) }, 844 848 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) }, 845 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) }, 846 849 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) }, 847 850 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0077, 0xff, 0xff, 0xff) }, 848 851 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) }, ··· 860 865 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0095, 0xff, 0xff, 0xff) }, 861 866 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0096, 0xff, 0xff, 0xff) }, 862 867 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0097, 0xff, 0xff, 0xff) }, 863 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0098, 0xff, 0xff, 0xff) }, 864 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0099, 0xff, 0xff, 0xff) }, 865 868 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff), 866 869 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 867 870 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xff) }, ··· 880 887 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) }, 881 888 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) }, 882 889 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0145, 0xff, 0xff, 0xff) }, 883 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0146, 0xff, 0xff, 0xff) }, 884 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) }, 885 890 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0148, 0xff, 0xff, 0xff) }, 886 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0149, 0xff, 0xff, 0xff) }, 887 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0150, 0xff, 0xff, 0xff) }, 888 891 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0151, 0xff, 0xff, 0xff) }, 889 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) }, 890 892 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0153, 0xff, 0xff, 0xff) }, 891 893 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0155, 0xff, 0xff, 0xff) }, 892 894 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xff) }, 893 895 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xff) }, 894 896 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff) }, 895 897 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0159, 0xff, 0xff, 0xff) }, 896 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0160, 0xff, 0xff, 0xff) }, 897 898 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) }, 898 899 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) }, 899 900 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0164, 0xff, 0xff, 0xff) }, 900 901 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) }, 901 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) }, 902 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) }, 903 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) }, 904 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) }, 905 902 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff) }, 906 903 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff) }, 907 904 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) }, ··· 1066 1083 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) }, 1067 1084 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) }, 1068 1085 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) }, 1069 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xff) }, 1070 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff) }, 1071 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1403, 0xff, 0xff, 0xff) }, 1072 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1404, 0xff, 0xff, 0xff) }, 1073 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1405, 0xff, 0xff, 0xff) }, 1074 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1406, 0xff, 0xff, 0xff) }, 1075 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1407, 0xff, 0xff, 0xff) }, 1076 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1408, 0xff, 0xff, 0xff) }, 1077 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1409, 0xff, 0xff, 0xff) }, 1078 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1410, 0xff, 0xff, 0xff) }, 1079 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1411, 0xff, 0xff, 0xff) }, 1080 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1412, 0xff, 0xff, 0xff) }, 1081 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1413, 0xff, 0xff, 0xff) }, 1082 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1414, 0xff, 0xff, 0xff) }, 1083 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1415, 0xff, 0xff, 0xff) }, 1084 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1416, 0xff, 0xff, 0xff) }, 1085 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1417, 0xff, 0xff, 0xff) }, 1086 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1418, 0xff, 0xff, 0xff) }, 1087 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1419, 0xff, 0xff, 0xff) }, 1088 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1420, 0xff, 0xff, 0xff) }, 1089 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1421, 0xff, 0xff, 0xff) }, 1090 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1422, 0xff, 0xff, 0xff) }, 1091 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1423, 0xff, 0xff, 0xff) }, 1092 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1424, 0xff, 0xff, 0xff) }, 1093 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1425, 0xff, 0xff, 0xff) }, 1094 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff) }, 1095 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1427, 0xff, 0xff, 0xff) }, 1096 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1428, 0xff, 0xff, 0xff) }, 1097 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1429, 0xff, 0xff, 0xff) }, 1098 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1430, 0xff, 0xff, 0xff) }, 1099 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1431, 0xff, 0xff, 0xff) }, 1100 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1432, 0xff, 0xff, 0xff) }, 1101 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1433, 0xff, 0xff, 0xff) }, 1102 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1434, 0xff, 0xff, 0xff) }, 1103 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1435, 0xff, 0xff, 0xff) }, 1104 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1436, 0xff, 0xff, 0xff) }, 1105 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1437, 0xff, 0xff, 0xff) }, 1106 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1438, 0xff, 0xff, 0xff) }, 1107 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1439, 0xff, 0xff, 0xff) }, 1108 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1440, 0xff, 0xff, 0xff) }, 1109 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1441, 0xff, 0xff, 0xff) }, 1110 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1442, 0xff, 0xff, 0xff) }, 1111 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1443, 0xff, 0xff, 0xff) }, 1112 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1444, 0xff, 0xff, 0xff) }, 1113 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1445, 0xff, 0xff, 0xff) }, 1114 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1446, 0xff, 0xff, 0xff) }, 1115 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1447, 0xff, 0xff, 0xff) }, 1116 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1448, 0xff, 0xff, 0xff) }, 1117 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1449, 0xff, 0xff, 0xff) }, 1118 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1450, 0xff, 0xff, 0xff) }, 1119 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1451, 0xff, 0xff, 0xff) }, 1120 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1452, 0xff, 0xff, 0xff) }, 1121 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1453, 0xff, 0xff, 0xff) }, 1122 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1454, 0xff, 0xff, 0xff) }, 1123 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1455, 0xff, 0xff, 0xff) }, 1124 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1456, 0xff, 0xff, 0xff) }, 1125 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1457, 0xff, 0xff, 0xff) }, 1126 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1458, 0xff, 0xff, 0xff) }, 1127 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1459, 0xff, 0xff, 0xff) }, 1128 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1460, 0xff, 0xff, 0xff) }, 1129 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1461, 0xff, 0xff, 0xff) }, 1130 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1462, 0xff, 0xff, 0xff) }, 1131 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1463, 0xff, 0xff, 0xff) }, 1132 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1464, 0xff, 0xff, 0xff) }, 1133 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1465, 0xff, 0xff, 0xff) }, 1134 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1466, 0xff, 0xff, 0xff) }, 1135 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1467, 0xff, 0xff, 0xff) }, 1136 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1468, 0xff, 0xff, 0xff) }, 1137 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1469, 0xff, 0xff, 0xff) }, 1138 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1470, 0xff, 0xff, 0xff) }, 1139 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1471, 0xff, 0xff, 0xff) }, 1140 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1472, 0xff, 0xff, 0xff) }, 1141 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1473, 0xff, 0xff, 0xff) }, 1142 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1474, 0xff, 0xff, 0xff) }, 1143 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1475, 0xff, 0xff, 0xff) }, 1144 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1476, 0xff, 0xff, 0xff) }, 1145 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1477, 0xff, 0xff, 0xff) }, 1146 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1478, 0xff, 0xff, 0xff) }, 1147 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1479, 0xff, 0xff, 0xff) }, 1148 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1480, 0xff, 0xff, 0xff) }, 1149 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1481, 0xff, 0xff, 0xff) }, 1150 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1482, 0xff, 0xff, 0xff) }, 1151 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1483, 0xff, 0xff, 0xff) }, 1152 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1484, 0xff, 0xff, 0xff) }, 1153 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1485, 0xff, 0xff, 0xff) }, 1154 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1486, 0xff, 0xff, 0xff) }, 1155 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1487, 0xff, 0xff, 0xff) }, 1156 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1488, 0xff, 0xff, 0xff) }, 1157 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1489, 0xff, 0xff, 0xff) }, 1158 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1490, 0xff, 0xff, 0xff) }, 1159 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1491, 0xff, 0xff, 0xff) }, 1160 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1492, 0xff, 0xff, 0xff) }, 1161 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1493, 0xff, 0xff, 0xff) }, 1162 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1494, 0xff, 0xff, 0xff) }, 1163 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1495, 0xff, 0xff, 0xff) }, 1164 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1496, 0xff, 0xff, 0xff) }, 1165 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1497, 0xff, 0xff, 0xff) }, 1166 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1498, 0xff, 0xff, 0xff) }, 1167 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1499, 0xff, 0xff, 0xff) }, 1168 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1500, 0xff, 0xff, 0xff) }, 1169 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1501, 0xff, 0xff, 0xff) }, 1170 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1502, 0xff, 0xff, 0xff) }, 1171 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1503, 0xff, 0xff, 0xff) }, 1172 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1504, 0xff, 0xff, 0xff) }, 1173 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1505, 0xff, 0xff, 0xff) }, 1174 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1506, 0xff, 0xff, 0xff) }, 1175 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1507, 0xff, 0xff, 0xff) }, 1176 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1508, 0xff, 0xff, 0xff) }, 1177 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1509, 0xff, 0xff, 0xff) }, 1178 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1510, 0xff, 0xff, 0xff) }, 1086 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 1087 + 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist }, 1088 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, 1089 + 1179 1090 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */ 1180 1091 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) }, 1181 1092 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) }, 1182 1093 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) }, 1183 1094 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) }, 1184 1095 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) }, 1096 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xff) }, 1185 1097 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) }, 1098 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0133, 0xff, 0xff, 0xff) }, 1186 1099 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) }, 1187 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 1188 - 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist }, 1189 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, 1100 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) }, 1101 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) }, 1102 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) }, 1103 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) }, 1104 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) }, 1105 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) }, 1106 + 1190 1107 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, 1191 1108 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, 1192 1109 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
+4 -2
drivers/usb/serial/ti_usb_3410_5052.c
··· 165 165 /* the array dimension is the number of default entries plus */ 166 166 /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */ 167 167 /* null entry */ 168 - static struct usb_device_id ti_id_table_3410[13+TI_EXTRA_VID_PID_COUNT+1] = { 168 + static struct usb_device_id ti_id_table_3410[14+TI_EXTRA_VID_PID_COUNT+1] = { 169 169 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, 170 170 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, 171 171 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, ··· 179 179 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, 180 180 { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, 181 181 { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, 182 + { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) }, 182 183 }; 183 184 184 185 static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = { ··· 189 188 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, 190 189 }; 191 190 192 - static struct usb_device_id ti_id_table_combined[17+2*TI_EXTRA_VID_PID_COUNT+1] = { 191 + static struct usb_device_id ti_id_table_combined[18+2*TI_EXTRA_VID_PID_COUNT+1] = { 193 192 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, 194 193 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, 195 194 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, ··· 207 206 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, 208 207 { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, 209 208 { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, 209 + { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) }, 210 210 { } 211 211 }; 212 212
+4
drivers/usb/serial/ti_usb_3410_5052.h
··· 49 49 #define MTS_MT9234ZBA_PRODUCT_ID 0xF115 50 50 #define MTS_MT9234ZBAOLD_PRODUCT_ID 0x0319 51 51 52 + /* Abbott Diabetics vendor and product ids */ 53 + #define ABBOTT_VENDOR_ID 0x1a61 54 + #define ABBOTT_PRODUCT_ID 0x3410 55 + 52 56 /* Commands */ 53 57 #define TI_GET_VERSION 0x01 54 58 #define TI_GET_PORT_STATUS 0x02
+31 -59
drivers/usb/storage/usb.c
··· 788 788 struct Scsi_Host *host = us_to_host(us); 789 789 790 790 /* If the device is really gone, cut short reset delays */ 791 - if (us->pusb_dev->state == USB_STATE_NOTATTACHED) 791 + if (us->pusb_dev->state == USB_STATE_NOTATTACHED) { 792 792 set_bit(US_FLIDX_DISCONNECTING, &us->dflags); 793 + wake_up(&us->delay_wait); 794 + } 793 795 794 - /* Prevent SCSI-scanning (if it hasn't started yet) 795 - * and wait for the SCSI-scanning thread to stop. 796 + /* Prevent SCSI scanning (if it hasn't started yet) 797 + * or wait for the SCSI-scanning routine to stop. 796 798 */ 797 - set_bit(US_FLIDX_DONT_SCAN, &us->dflags); 798 - wake_up(&us->delay_wait); 799 - wait_for_completion(&us->scanning_done); 799 + cancel_delayed_work_sync(&us->scan_dwork); 800 + 801 + /* Balance autopm calls if scanning was cancelled */ 802 + if (test_bit(US_FLIDX_SCAN_PENDING, &us->dflags)) 803 + usb_autopm_put_interface_no_suspend(us->pusb_intf); 800 804 801 805 /* Removing the host will perform an orderly shutdown: caches 802 806 * synchronized, disks spun down, etc. ··· 827 823 scsi_host_put(us_to_host(us)); 828 824 } 829 825 830 - /* Thread to carry out delayed SCSI-device scanning */ 831 - static int usb_stor_scan_thread(void * __us) 826 + /* Delayed-work routine to carry out SCSI-device scanning */ 827 + static void usb_stor_scan_dwork(struct work_struct *work) 832 828 { 833 - struct us_data *us = (struct us_data *)__us; 829 + struct us_data *us = container_of(work, struct us_data, 830 + scan_dwork.work); 834 831 struct device *dev = &us->pusb_intf->dev; 835 832 836 - dev_dbg(dev, "device found\n"); 833 + dev_dbg(dev, "starting scan\n"); 837 834 838 - set_freezable(); 839 - 840 - /* 841 - * Wait for the timeout to expire or for a disconnect 842 - * 843 - * We can't freeze in this thread or we risk causing khubd to 844 - * fail to freeze, but we can't be non-freezable either. Nor can 845 - * khubd freeze while waiting for scanning to complete as it may 846 - * hold the device lock, causing a hang when suspending devices. 847 - * So instead of using wait_event_freezable(), explicitly test 848 - * for (DONT_SCAN || freezing) in interruptible wait and proceed 849 - * if any of DONT_SCAN, freezing or timeout has happened. 850 - */ 851 - if (delay_use > 0) { 852 - dev_dbg(dev, "waiting for device to settle " 853 - "before scanning\n"); 854 - wait_event_interruptible_timeout(us->delay_wait, 855 - test_bit(US_FLIDX_DONT_SCAN, &us->dflags) || 856 - freezing(current), delay_use * HZ); 835 + /* For bulk-only devices, determine the max LUN value */ 836 + if (us->protocol == USB_PR_BULK && !(us->fflags & US_FL_SINGLE_LUN)) { 837 + mutex_lock(&us->dev_mutex); 838 + us->max_lun = usb_stor_Bulk_max_lun(us); 839 + mutex_unlock(&us->dev_mutex); 857 840 } 841 + scsi_scan_host(us_to_host(us)); 842 + dev_dbg(dev, "scan complete\n"); 858 843 859 - /* If the device is still connected, perform the scanning */ 860 - if (!test_bit(US_FLIDX_DONT_SCAN, &us->dflags)) { 861 - 862 - /* For bulk-only devices, determine the max LUN value */ 863 - if (us->protocol == USB_PR_BULK && 864 - !(us->fflags & US_FL_SINGLE_LUN)) { 865 - mutex_lock(&us->dev_mutex); 866 - us->max_lun = usb_stor_Bulk_max_lun(us); 867 - mutex_unlock(&us->dev_mutex); 868 - } 869 - scsi_scan_host(us_to_host(us)); 870 - dev_dbg(dev, "scan complete\n"); 871 - 872 - /* Should we unbind if no devices were detected? */ 873 - } 844 + /* Should we unbind if no devices were detected? */ 874 845 875 846 usb_autopm_put_interface(us->pusb_intf); 876 - complete_and_exit(&us->scanning_done, 0); 847 + clear_bit(US_FLIDX_SCAN_PENDING, &us->dflags); 877 848 } 878 849 879 850 static unsigned int usb_stor_sg_tablesize(struct usb_interface *intf) ··· 895 916 init_completion(&us->cmnd_ready); 896 917 init_completion(&(us->notify)); 897 918 init_waitqueue_head(&us->delay_wait); 898 - init_completion(&us->scanning_done); 919 + INIT_DELAYED_WORK(&us->scan_dwork, usb_stor_scan_dwork); 899 920 900 921 /* Associate the us_data structure with the USB device */ 901 922 result = associate_dev(us, intf); ··· 926 947 /* Second part of general USB mass-storage probing */ 927 948 int usb_stor_probe2(struct us_data *us) 928 949 { 929 - struct task_struct *th; 930 950 int result; 931 951 struct device *dev = &us->pusb_intf->dev; 932 952 ··· 966 988 goto BadDevice; 967 989 } 968 990 969 - /* Start up the thread for delayed SCSI-device scanning */ 970 - th = kthread_create(usb_stor_scan_thread, us, "usb-stor-scan"); 971 - if (IS_ERR(th)) { 972 - dev_warn(dev, 973 - "Unable to start the device-scanning thread\n"); 974 - complete(&us->scanning_done); 975 - quiesce_and_remove_host(us); 976 - result = PTR_ERR(th); 977 - goto BadDevice; 978 - } 979 - 991 + /* Submit the delayed_work for SCSI-device scanning */ 980 992 usb_autopm_get_interface_no_resume(us->pusb_intf); 981 - wake_up_process(th); 993 + set_bit(US_FLIDX_SCAN_PENDING, &us->dflags); 982 994 995 + if (delay_use > 0) 996 + dev_dbg(dev, "waiting for device to settle before scanning\n"); 997 + queue_delayed_work(system_freezable_wq, &us->scan_dwork, 998 + delay_use * HZ); 983 999 return 0; 984 1000 985 1001 /* We come here if there are any problems */
+4 -3
drivers/usb/storage/usb.h
··· 47 47 #include <linux/blkdev.h> 48 48 #include <linux/completion.h> 49 49 #include <linux/mutex.h> 50 + #include <linux/workqueue.h> 50 51 #include <scsi/scsi_host.h> 51 52 52 53 struct us_data; ··· 73 72 #define US_FLIDX_DISCONNECTING 3 /* disconnect in progress */ 74 73 #define US_FLIDX_RESETTING 4 /* device reset in progress */ 75 74 #define US_FLIDX_TIMED_OUT 5 /* SCSI midlayer timed out */ 76 - #define US_FLIDX_DONT_SCAN 6 /* don't scan (disconnect) */ 75 + #define US_FLIDX_SCAN_PENDING 6 /* scanning not yet done */ 77 76 #define US_FLIDX_REDO_READ10 7 /* redo READ(10) command */ 78 77 #define US_FLIDX_READ10_WORKED 8 /* previous READ(10) succeeded */ 79 78 ··· 148 147 /* mutual exclusion and synchronization structures */ 149 148 struct completion cmnd_ready; /* to sleep thread on */ 150 149 struct completion notify; /* thread begin/end */ 151 - wait_queue_head_t delay_wait; /* wait during scan, reset */ 152 - struct completion scanning_done; /* wait for scan thread */ 150 + wait_queue_head_t delay_wait; /* wait during reset */ 151 + struct delayed_work scan_dwork; /* for async scanning */ 153 152 154 153 /* subdriver information */ 155 154 void *extra; /* Any extra data */
+1 -1
drivers/video/omap2/displays/Kconfig
··· 12 12 13 13 config PANEL_DVI 14 14 tristate "DVI output" 15 - depends on OMAP2_DSS_DPI 15 + depends on OMAP2_DSS_DPI && I2C 16 16 help 17 17 Driver for external monitors, connected via DVI. The driver uses i2c 18 18 to read EDID information from the monitor.
+23 -1
drivers/video/omap2/dss/hdmi.c
··· 130 130 131 131 DSSDBG("hdmi_runtime_get\n"); 132 132 133 + /* 134 + * HACK: Add dss_runtime_get() to ensure DSS clock domain is enabled. 135 + * This should be removed later. 136 + */ 137 + r = dss_runtime_get(); 138 + if (r < 0) 139 + goto err_get_dss; 140 + 133 141 r = pm_runtime_get_sync(&hdmi.pdev->dev); 134 142 WARN_ON(r < 0); 135 - return r < 0 ? r : 0; 143 + if (r < 0) 144 + goto err_get_hdmi; 145 + 146 + return 0; 147 + 148 + err_get_hdmi: 149 + dss_runtime_put(); 150 + err_get_dss: 151 + return r; 136 152 } 137 153 138 154 static void hdmi_runtime_put(void) ··· 159 143 160 144 r = pm_runtime_put_sync(&hdmi.pdev->dev); 161 145 WARN_ON(r < 0); 146 + 147 + /* 148 + * HACK: This is added to complement the dss_runtime_get() call in 149 + * hdmi_runtime_get(). This should be removed later. 150 + */ 151 + dss_runtime_put(); 162 152 } 163 153 164 154 int hdmi_init_display(struct omap_dss_device *dssdev)
+1 -8
drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
··· 479 479 480 480 bool ti_hdmi_4xxx_detect(struct hdmi_ip_data *ip_data) 481 481 { 482 - int r; 483 - 484 - void __iomem *base = hdmi_core_sys_base(ip_data); 485 - 486 - /* HPD */ 487 - r = REG_GET(base, HDMI_CORE_SYS_SYS_STAT, 1, 1); 488 - 489 - return r == 1; 482 + return gpio_get_value(ip_data->hpd_gpio); 490 483 } 491 484 492 485 static void hdmi_core_init(struct hdmi_core_video_config *video_cfg,
+1 -1
drivers/video/pvr2fb.c
··· 1061 1061 int (*init)(void); 1062 1062 void (*exit)(void); 1063 1063 char name[16]; 1064 - } board_driver[] = { 1064 + } board_driver[] __refdata = { 1065 1065 #ifdef CONFIG_SH_DREAMCAST 1066 1066 { pvr2fb_dc_init, pvr2fb_dc_exit, "Sega DC PVR2" }, 1067 1067 #endif
+4
drivers/video/via/hw.c
··· 1810 1810 break; 1811 1811 } 1812 1812 1813 + /* magic required on VX900 for correct modesetting on IGA1 */ 1814 + via_write_reg_mask(VIACR, 0x45, 0x00, 0x01); 1815 + 1813 1816 /* probably this should go to the scaling code one day */ 1817 + via_write_reg_mask(VIACR, 0xFD, 0, 0x80); /* VX900 hw scale on IGA2 */ 1814 1818 viafb_write_regx(scaling_parameters, ARRAY_SIZE(scaling_parameters)); 1815 1819 1816 1820 /* Fill VPIT Parameters */
+22 -11
drivers/virtio/virtio_balloon.c
··· 367 367 #ifdef CONFIG_PM 368 368 static int virtballoon_freeze(struct virtio_device *vdev) 369 369 { 370 + struct virtio_balloon *vb = vdev->priv; 371 + 370 372 /* 371 373 * The kthread is already frozen by the PM core before this 372 374 * function is called. 373 375 */ 376 + 377 + while (vb->num_pages) 378 + leak_balloon(vb, vb->num_pages); 379 + update_balloon_size(vb); 374 380 375 381 /* Ensure we don't get any more requests from the host */ 376 382 vdev->config->reset(vdev); ··· 384 378 return 0; 385 379 } 386 380 381 + static int restore_common(struct virtio_device *vdev) 382 + { 383 + struct virtio_balloon *vb = vdev->priv; 384 + int ret; 385 + 386 + ret = init_vqs(vdev->priv); 387 + if (ret) 388 + return ret; 389 + 390 + fill_balloon(vb, towards_target(vb)); 391 + update_balloon_size(vb); 392 + return 0; 393 + } 394 + 387 395 static int virtballoon_thaw(struct virtio_device *vdev) 388 396 { 389 - return init_vqs(vdev->priv); 397 + return restore_common(vdev); 390 398 } 391 399 392 400 static int virtballoon_restore(struct virtio_device *vdev) 393 401 { 394 402 struct virtio_balloon *vb = vdev->priv; 395 - struct page *page, *page2; 396 - 397 - /* We're starting from a clean slate */ 398 - vb->num_pages = 0; 399 403 400 404 /* 401 405 * If a request wasn't complete at the time of freezing, this ··· 413 397 */ 414 398 vb->need_stats_update = 0; 415 399 416 - /* We don't have these pages in the balloon anymore! */ 417 - list_for_each_entry_safe(page, page2, &vb->pages, lru) { 418 - list_del(&page->lru); 419 - totalram_pages++; 420 - } 421 - return init_vqs(vdev->priv); 400 + return restore_common(vdev); 422 401 } 423 402 #endif 424 403
+1 -1
drivers/watchdog/Kconfig
··· 1098 1098 For Freescale Book-E processors, this is a number between 0 and 63. 1099 1099 For other Book-E processors, this is a number between 0 and 3. 1100 1100 1101 - The value can be overidden by the wdt_period command-line parameter. 1101 + The value can be overridden by the wdt_period command-line parameter. 1102 1102 1103 1103 # PPC64 Architecture 1104 1104
+5 -1
drivers/watchdog/booke_wdt.c
··· 198 198 booke_wdt_period = tmp; 199 199 #endif 200 200 booke_wdt_set(); 201 - return 0; 201 + /* Fall */ 202 202 case WDIOC_GETTIMEOUT: 203 + #ifdef CONFIG_FSL_BOOKE 204 + return put_user(period_to_sec(booke_wdt_period), p); 205 + #else 203 206 return put_user(booke_wdt_period, p); 207 + #endif 204 208 default: 205 209 return -ENOTTY; 206 210 }
+3 -2
drivers/watchdog/hpwdt.c
··· 231 231 232 232 cmn_regs.u1.reax = CRU_BIOS_SIGNATURE_VALUE; 233 233 234 - set_memory_x((unsigned long)bios32_entrypoint, (2 * PAGE_SIZE)); 234 + set_memory_x((unsigned long)bios32_map, 2); 235 235 asminline_call(&cmn_regs, bios32_entrypoint); 236 236 237 237 if (cmn_regs.u1.ral != 0) { ··· 250 250 cru_rom_addr = 251 251 ioremap(cru_physical_address, cru_length); 252 252 if (cru_rom_addr) { 253 - set_memory_x((unsigned long)cru_rom_addr, cru_length); 253 + set_memory_x((unsigned long)cru_rom_addr & PAGE_MASK, 254 + (cru_length + PAGE_SIZE - 1) >> PAGE_SHIFT); 254 255 retval = 0; 255 256 } 256 257 }
+1 -1
drivers/watchdog/pnx4008_wdt.c
··· 264 264 wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 265 265 if (wdt_mem == NULL) { 266 266 printk(KERN_INFO MODULE_NAME 267 - "failed to get memory region resouce\n"); 267 + "failed to get memory region resource\n"); 268 268 return -ENOENT; 269 269 } 270 270
+31 -26
drivers/watchdog/s3c2410_wdt.c
··· 312 312 dev = &pdev->dev; 313 313 wdt_dev = &pdev->dev; 314 314 315 - /* get the memory region for the watchdog timer */ 316 - 317 315 wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 318 316 if (wdt_mem == NULL) { 319 317 dev_err(dev, "no memory resource specified\n"); 320 318 return -ENOENT; 321 319 } 322 320 321 + wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 322 + if (wdt_irq == NULL) { 323 + dev_err(dev, "no irq resource specified\n"); 324 + ret = -ENOENT; 325 + goto err; 326 + } 327 + 328 + /* get the memory region for the watchdog timer */ 329 + 323 330 size = resource_size(wdt_mem); 324 331 if (!request_mem_region(wdt_mem->start, size, pdev->name)) { 325 332 dev_err(dev, "failed to get memory region\n"); 326 - return -EBUSY; 333 + ret = -EBUSY; 334 + goto err; 327 335 } 328 336 329 337 wdt_base = ioremap(wdt_mem->start, size); ··· 343 335 344 336 DBG("probe: mapped wdt_base=%p\n", wdt_base); 345 337 346 - wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 347 - if (wdt_irq == NULL) { 348 - dev_err(dev, "no irq resource specified\n"); 349 - ret = -ENOENT; 350 - goto err_map; 351 - } 352 - 353 - ret = request_irq(wdt_irq->start, s3c2410wdt_irq, 0, pdev->name, pdev); 354 - if (ret != 0) { 355 - dev_err(dev, "failed to install irq (%d)\n", ret); 356 - goto err_map; 357 - } 358 - 359 338 wdt_clock = clk_get(&pdev->dev, "watchdog"); 360 339 if (IS_ERR(wdt_clock)) { 361 340 dev_err(dev, "failed to find watchdog clock source\n"); 362 341 ret = PTR_ERR(wdt_clock); 363 - goto err_irq; 342 + goto err_map; 364 343 } 365 344 366 345 clk_enable(wdt_clock); 367 346 368 - if (s3c2410wdt_cpufreq_register() < 0) { 347 + ret = s3c2410wdt_cpufreq_register(); 348 + if (ret < 0) { 369 349 printk(KERN_ERR PFX "failed to register cpufreq\n"); 370 350 goto err_clk; 371 351 } ··· 374 378 "cannot start\n"); 375 379 } 376 380 381 + ret = request_irq(wdt_irq->start, s3c2410wdt_irq, 0, pdev->name, pdev); 382 + if (ret != 0) { 383 + dev_err(dev, "failed to install irq (%d)\n", ret); 384 + goto err_cpufreq; 385 + } 386 + 377 387 watchdog_set_nowayout(&s3c2410_wdd, nowayout); 378 388 379 389 ret = watchdog_register_device(&s3c2410_wdd); 380 390 if (ret) { 381 391 dev_err(dev, "cannot register watchdog (%d)\n", ret); 382 - goto err_cpufreq; 392 + goto err_irq; 383 393 } 384 394 385 395 if (tmr_atboot && started == 0) { ··· 410 408 411 409 return 0; 412 410 411 + err_irq: 412 + free_irq(wdt_irq->start, pdev); 413 + 413 414 err_cpufreq: 414 415 s3c2410wdt_cpufreq_deregister(); 415 416 416 417 err_clk: 417 418 clk_disable(wdt_clock); 418 419 clk_put(wdt_clock); 419 - 420 - err_irq: 421 - free_irq(wdt_irq->start, pdev); 420 + wdt_clock = NULL; 422 421 423 422 err_map: 424 423 iounmap(wdt_base); 425 424 426 425 err_req: 427 426 release_mem_region(wdt_mem->start, size); 428 - wdt_mem = NULL; 429 427 428 + err: 429 + wdt_irq = NULL; 430 + wdt_mem = NULL; 430 431 return ret; 431 432 } 432 433 ··· 437 432 { 438 433 watchdog_unregister_device(&s3c2410_wdd); 439 434 435 + free_irq(wdt_irq->start, dev); 436 + 440 437 s3c2410wdt_cpufreq_deregister(); 441 438 442 439 clk_disable(wdt_clock); 443 440 clk_put(wdt_clock); 444 441 wdt_clock = NULL; 445 442 446 - free_irq(wdt_irq->start, dev); 447 - wdt_irq = NULL; 448 - 449 443 iounmap(wdt_base); 450 444 451 445 release_mem_region(wdt_mem->start, resource_size(wdt_mem)); 446 + wdt_irq = NULL; 452 447 wdt_mem = NULL; 453 448 return 0; 454 449 }
+1
fs/autofs4/autofs_i.h
··· 110 110 int sub_version; 111 111 int min_proto; 112 112 int max_proto; 113 + int compat_daemon; 113 114 unsigned long exp_timeout; 114 115 unsigned int type; 115 116 int reghost_enabled;
+1
fs/autofs4/dev-ioctl.c
··· 385 385 sbi->pipefd = pipefd; 386 386 sbi->pipe = pipe; 387 387 sbi->catatonic = 0; 388 + sbi->compat_daemon = is_compat_task(); 388 389 } 389 390 out: 390 391 mutex_unlock(&sbi->wq_mutex);
+2
fs/autofs4/expire.c
··· 124 124 /* Negative dentry - try next */ 125 125 if (!simple_positive(q)) { 126 126 spin_unlock(&p->d_lock); 127 + lock_set_subclass(&q->d_lock.dep_map, 0, _RET_IP_); 127 128 p = q; 128 129 goto again; 129 130 } ··· 187 186 /* Negative dentry - try next */ 188 187 if (!simple_positive(ret)) { 189 188 spin_unlock(&p->d_lock); 189 + lock_set_subclass(&ret->d_lock.dep_map, 0, _RET_IP_); 190 190 p = ret; 191 191 goto again; 192 192 }
+2
fs/autofs4/inode.c
··· 19 19 #include <linux/parser.h> 20 20 #include <linux/bitops.h> 21 21 #include <linux/magic.h> 22 + #include <linux/compat.h> 22 23 #include "autofs_i.h" 23 24 #include <linux/module.h> 24 25 ··· 225 224 set_autofs_type_indirect(&sbi->type); 226 225 sbi->min_proto = 0; 227 226 sbi->max_proto = 0; 227 + sbi->compat_daemon = is_compat_task(); 228 228 mutex_init(&sbi->wq_mutex); 229 229 mutex_init(&sbi->pipe_mutex); 230 230 spin_lock_init(&sbi->fs_lock);
+19 -3
fs/autofs4/waitq.c
··· 91 91 92 92 return (bytes > 0); 93 93 } 94 - 94 + 95 + /* 96 + * The autofs_v5 packet was misdesigned. 97 + * 98 + * The packets are identical on x86-32 and x86-64, but have different 99 + * alignment. Which means that 'sizeof()' will give different results. 100 + * Fix it up for the case of running 32-bit user mode on a 64-bit kernel. 101 + */ 102 + static noinline size_t autofs_v5_packet_size(struct autofs_sb_info *sbi) 103 + { 104 + size_t pktsz = sizeof(struct autofs_v5_packet); 105 + #if defined(CONFIG_X86_64) && defined(CONFIG_COMPAT) 106 + if (sbi->compat_daemon > 0) 107 + pktsz -= 4; 108 + #endif 109 + return pktsz; 110 + } 111 + 95 112 static void autofs4_notify_daemon(struct autofs_sb_info *sbi, 96 113 struct autofs_wait_queue *wq, 97 114 int type) ··· 172 155 { 173 156 struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet; 174 157 175 - pktsz = sizeof(*packet); 176 - 158 + pktsz = autofs_v5_packet_size(sbi); 177 159 packet->wait_queue_token = wq->wait_queue_token; 178 160 packet->len = wq->name.len; 179 161 memcpy(packet->name, wq->name.name, wq->name.len);
+1 -1
fs/binfmt_elf.c
··· 1421 1421 for (i = 1; i < view->n; ++i) { 1422 1422 const struct user_regset *regset = &view->regsets[i]; 1423 1423 do_thread_regset_writeback(t->task, regset); 1424 - if (regset->core_note_type && 1424 + if (regset->core_note_type && regset->get && 1425 1425 (!regset->active || regset->active(t->task, regset))) { 1426 1426 int ret; 1427 1427 size_t size = regset->n * regset->size;
+2
fs/btrfs/backref.c
··· 892 892 if (eb != eb_in) 893 893 free_extent_buffer(eb); 894 894 ret = inode_ref_info(parent, 0, fs_root, path, &found_key); 895 + if (ret > 0) 896 + ret = -ENOENT; 895 897 if (ret) 896 898 break; 897 899 next_inum = found_key.offset;
+1 -1
fs/btrfs/check-integrity.c
··· 644 644 static int btrfsic_process_superblock(struct btrfsic_state *state, 645 645 struct btrfs_fs_devices *fs_devices) 646 646 { 647 - int ret; 647 + int ret = 0; 648 648 struct btrfs_super_block *selected_super; 649 649 struct list_head *dev_head = &fs_devices->devices; 650 650 struct btrfs_device *device;
+2
fs/btrfs/compression.c
··· 588 588 page_offset(bio->bi_io_vec->bv_page), 589 589 PAGE_CACHE_SIZE); 590 590 read_unlock(&em_tree->lock); 591 + if (!em) 592 + return -EIO; 591 593 592 594 compressed_len = em->block_len; 593 595 cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS);
+1 -1
fs/btrfs/ctree.h
··· 886 886 u64 reserved; 887 887 struct btrfs_space_info *space_info; 888 888 spinlock_t lock; 889 - unsigned int full:1; 889 + unsigned int full; 890 890 }; 891 891 892 892 /*
+12
fs/btrfs/disk-io.c
··· 2260 2260 goto fail_sb_buffer; 2261 2261 } 2262 2262 2263 + if (sectorsize < PAGE_SIZE) { 2264 + printk(KERN_WARNING "btrfs: Incompatible sector size " 2265 + "found on %s\n", sb->s_id); 2266 + goto fail_sb_buffer; 2267 + } 2268 + 2263 2269 mutex_lock(&fs_info->chunk_mutex); 2264 2270 ret = btrfs_read_sys_array(tree_root); 2265 2271 mutex_unlock(&fs_info->chunk_mutex); ··· 2306 2300 } 2307 2301 2308 2302 btrfs_close_extra_devices(fs_devices); 2303 + 2304 + if (!fs_devices->latest_bdev) { 2305 + printk(KERN_CRIT "btrfs: failed to read devices on %s\n", 2306 + sb->s_id); 2307 + goto fail_tree_roots; 2308 + } 2309 2309 2310 2310 retry_root_backup: 2311 2311 blocksize = btrfs_level_size(tree_root,
+32 -19
fs/btrfs/extent-tree.c
··· 3312 3312 } 3313 3313 data_sinfo->bytes_may_use += bytes; 3314 3314 trace_btrfs_space_reservation(root->fs_info, "space_info", 3315 - (u64)data_sinfo, bytes, 1); 3315 + (u64)(unsigned long)data_sinfo, 3316 + bytes, 1); 3316 3317 spin_unlock(&data_sinfo->lock); 3317 3318 3318 3319 return 0; ··· 3334 3333 spin_lock(&data_sinfo->lock); 3335 3334 data_sinfo->bytes_may_use -= bytes; 3336 3335 trace_btrfs_space_reservation(root->fs_info, "space_info", 3337 - (u64)data_sinfo, bytes, 0); 3336 + (u64)(unsigned long)data_sinfo, 3337 + bytes, 0); 3338 3338 spin_unlock(&data_sinfo->lock); 3339 3339 } 3340 3340 ··· 3613 3611 if (space_info != delayed_rsv->space_info) 3614 3612 return -ENOSPC; 3615 3613 3614 + spin_lock(&space_info->lock); 3616 3615 spin_lock(&delayed_rsv->lock); 3617 - if (delayed_rsv->size < bytes) { 3616 + if (space_info->bytes_pinned + delayed_rsv->size < bytes) { 3618 3617 spin_unlock(&delayed_rsv->lock); 3618 + spin_unlock(&space_info->lock); 3619 3619 return -ENOSPC; 3620 3620 } 3621 3621 spin_unlock(&delayed_rsv->lock); 3622 + spin_unlock(&space_info->lock); 3622 3623 3623 3624 commit: 3624 3625 trans = btrfs_join_transaction(root); ··· 3700 3695 if (used + orig_bytes <= space_info->total_bytes) { 3701 3696 space_info->bytes_may_use += orig_bytes; 3702 3697 trace_btrfs_space_reservation(root->fs_info, 3703 - "space_info", 3704 - (u64)space_info, 3705 - orig_bytes, 1); 3698 + "space_info", 3699 + (u64)(unsigned long)space_info, 3700 + orig_bytes, 1); 3706 3701 ret = 0; 3707 3702 } else { 3708 3703 /* ··· 3771 3766 if (used + num_bytes < space_info->total_bytes + avail) { 3772 3767 space_info->bytes_may_use += orig_bytes; 3773 3768 trace_btrfs_space_reservation(root->fs_info, 3774 - "space_info", 3775 - (u64)space_info, 3776 - orig_bytes, 1); 3769 + "space_info", 3770 + (u64)(unsigned long)space_info, 3771 + orig_bytes, 1); 3777 3772 ret = 0; 3778 3773 } else { 3779 3774 wait_ordered = true; ··· 3918 3913 spin_lock(&space_info->lock); 3919 3914 space_info->bytes_may_use -= num_bytes; 3920 3915 trace_btrfs_space_reservation(fs_info, "space_info", 3921 - (u64)space_info, 3922 - num_bytes, 0); 3916 + (u64)(unsigned long)space_info, 3917 + num_bytes, 0); 3923 3918 space_info->reservation_progress++; 3924 3919 spin_unlock(&space_info->lock); 3925 3920 } ··· 4110 4105 num_bytes += div64_u64(data_used + meta_used, 50); 4111 4106 4112 4107 if (num_bytes * 3 > meta_used) 4113 - num_bytes = div64_u64(meta_used, 3); 4108 + num_bytes = div64_u64(meta_used, 3) * 2; 4114 4109 4115 4110 return ALIGN(num_bytes, fs_info->extent_root->leafsize << 10); 4116 4111 } ··· 4137 4132 block_rsv->reserved += num_bytes; 4138 4133 sinfo->bytes_may_use += num_bytes; 4139 4134 trace_btrfs_space_reservation(fs_info, "space_info", 4140 - (u64)sinfo, num_bytes, 1); 4135 + (u64)(unsigned long)sinfo, num_bytes, 1); 4141 4136 } 4142 4137 4143 4138 if (block_rsv->reserved >= block_rsv->size) { 4144 4139 num_bytes = block_rsv->reserved - block_rsv->size; 4145 4140 sinfo->bytes_may_use -= num_bytes; 4146 4141 trace_btrfs_space_reservation(fs_info, "space_info", 4147 - (u64)sinfo, num_bytes, 0); 4142 + (u64)(unsigned long)sinfo, num_bytes, 0); 4148 4143 sinfo->reservation_progress++; 4149 4144 block_rsv->reserved = block_rsv->size; 4150 4145 block_rsv->full = 1; ··· 4197 4192 if (!trans->bytes_reserved) 4198 4193 return; 4199 4194 4200 - trace_btrfs_space_reservation(root->fs_info, "transaction", (u64)trans, 4195 + trace_btrfs_space_reservation(root->fs_info, "transaction", 4196 + (u64)(unsigned long)trans, 4201 4197 trans->bytes_reserved, 0); 4202 4198 btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved); 4203 4199 trans->bytes_reserved = 0; ··· 4716 4710 space_info->bytes_reserved += num_bytes; 4717 4711 if (reserve == RESERVE_ALLOC) { 4718 4712 trace_btrfs_space_reservation(cache->fs_info, 4719 - "space_info", 4720 - (u64)space_info, 4721 - num_bytes, 0); 4713 + "space_info", 4714 + (u64)(unsigned long)space_info, 4715 + num_bytes, 0); 4722 4716 space_info->bytes_may_use -= num_bytes; 4723 4717 } 4724 4718 } ··· 7892 7886 u64 start; 7893 7887 u64 end; 7894 7888 u64 trimmed = 0; 7889 + u64 total_bytes = btrfs_super_total_bytes(fs_info->super_copy); 7895 7890 int ret = 0; 7896 7891 7897 - cache = btrfs_lookup_block_group(fs_info, range->start); 7892 + /* 7893 + * try to trim all FS space, our block group may start from non-zero. 7894 + */ 7895 + if (range->len == total_bytes) 7896 + cache = btrfs_lookup_first_block_group(fs_info, range->start); 7897 + else 7898 + cache = btrfs_lookup_block_group(fs_info, range->start); 7898 7899 7899 7900 while (cache) { 7900 7901 if (cache->key.objectid >= (range->start + range->len)) {
+65 -48
fs/btrfs/extent_io.c
··· 513 513 WARN_ON(state->end < start); 514 514 last_end = state->end; 515 515 516 + if (state->end < end && !need_resched()) 517 + next_node = rb_next(&state->rb_node); 518 + else 519 + next_node = NULL; 520 + 521 + /* the state doesn't have the wanted bits, go ahead */ 522 + if (!(state->state & bits)) 523 + goto next; 524 + 516 525 /* 517 526 * | ---- desired range ---- | 518 527 * | state | or ··· 574 565 goto out; 575 566 } 576 567 577 - if (state->end < end && prealloc && !need_resched()) 578 - next_node = rb_next(&state->rb_node); 579 - else 580 - next_node = NULL; 581 - 582 568 set |= clear_state_bit(tree, state, &bits, wake); 569 + next: 583 570 if (last_end == (u64)-1) 584 571 goto out; 585 572 start = last_end + 1; 586 573 if (start <= end && next_node) { 587 574 state = rb_entry(next_node, struct extent_state, 588 575 rb_node); 589 - if (state->start == start) 590 - goto hit_next; 576 + goto hit_next; 591 577 } 592 578 goto search_again; 593 579 ··· 965 961 966 962 set_state_bits(tree, state, &bits); 967 963 clear_state_bit(tree, state, &clear_bits, 0); 968 - 969 - merge_state(tree, state); 970 964 if (last_end == (u64)-1) 971 965 goto out; 972 966 ··· 1009 1007 if (state->end <= end) { 1010 1008 set_state_bits(tree, state, &bits); 1011 1009 clear_state_bit(tree, state, &clear_bits, 0); 1012 - merge_state(tree, state); 1013 1010 if (last_end == (u64)-1) 1014 1011 goto out; 1015 1012 start = last_end + 1; ··· 1069 1068 1070 1069 set_state_bits(tree, prealloc, &bits); 1071 1070 clear_state_bit(tree, prealloc, &clear_bits, 0); 1072 - 1073 - merge_state(tree, prealloc); 1074 1071 prealloc = NULL; 1075 1072 goto out; 1076 1073 } ··· 2153 2154 "this_mirror=%d, num_copies=%d, in_validation=%d\n", read_mode, 2154 2155 failrec->this_mirror, num_copies, failrec->in_validation); 2155 2156 2156 - tree->ops->submit_bio_hook(inode, read_mode, bio, failrec->this_mirror, 2157 - failrec->bio_flags, 0); 2158 - return 0; 2157 + ret = tree->ops->submit_bio_hook(inode, read_mode, bio, 2158 + failrec->this_mirror, 2159 + failrec->bio_flags, 0); 2160 + return ret; 2159 2161 } 2160 2162 2161 2163 /* lots and lots of room for performance fixes in the end_bio funcs */ 2164 + 2165 + int end_extent_writepage(struct page *page, int err, u64 start, u64 end) 2166 + { 2167 + int uptodate = (err == 0); 2168 + struct extent_io_tree *tree; 2169 + int ret; 2170 + 2171 + tree = &BTRFS_I(page->mapping->host)->io_tree; 2172 + 2173 + if (tree->ops && tree->ops->writepage_end_io_hook) { 2174 + ret = tree->ops->writepage_end_io_hook(page, start, 2175 + end, NULL, uptodate); 2176 + if (ret) 2177 + uptodate = 0; 2178 + } 2179 + 2180 + if (!uptodate && tree->ops && 2181 + tree->ops->writepage_io_failed_hook) { 2182 + ret = tree->ops->writepage_io_failed_hook(NULL, page, 2183 + start, end, NULL); 2184 + /* Writeback already completed */ 2185 + if (ret == 0) 2186 + return 1; 2187 + } 2188 + 2189 + if (!uptodate) { 2190 + clear_extent_uptodate(tree, start, end, NULL, GFP_NOFS); 2191 + ClearPageUptodate(page); 2192 + SetPageError(page); 2193 + } 2194 + return 0; 2195 + } 2162 2196 2163 2197 /* 2164 2198 * after a writepage IO is done, we need to: ··· 2204 2172 */ 2205 2173 static void end_bio_extent_writepage(struct bio *bio, int err) 2206 2174 { 2207 - int uptodate = err == 0; 2208 2175 struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; 2209 2176 struct extent_io_tree *tree; 2210 2177 u64 start; 2211 2178 u64 end; 2212 2179 int whole_page; 2213 - int ret; 2214 2180 2215 2181 do { 2216 2182 struct page *page = bvec->bv_page; ··· 2225 2195 2226 2196 if (--bvec >= bio->bi_io_vec) 2227 2197 prefetchw(&bvec->bv_page->flags); 2228 - if (tree->ops && tree->ops->writepage_end_io_hook) { 2229 - ret = tree->ops->writepage_end_io_hook(page, start, 2230 - end, NULL, uptodate); 2231 - if (ret) 2232 - uptodate = 0; 2233 - } 2234 2198 2235 - if (!uptodate && tree->ops && 2236 - tree->ops->writepage_io_failed_hook) { 2237 - ret = tree->ops->writepage_io_failed_hook(bio, page, 2238 - start, end, NULL); 2239 - if (ret == 0) { 2240 - uptodate = (err == 0); 2241 - continue; 2242 - } 2243 - } 2244 - 2245 - if (!uptodate) { 2246 - clear_extent_uptodate(tree, start, end, NULL, GFP_NOFS); 2247 - ClearPageUptodate(page); 2248 - SetPageError(page); 2249 - } 2199 + if (end_extent_writepage(page, err, start, end)) 2200 + continue; 2250 2201 2251 2202 if (whole_page) 2252 2203 end_page_writeback(page); ··· 2790 2779 delalloc_start = delalloc_end + 1; 2791 2780 continue; 2792 2781 } 2793 - tree->ops->fill_delalloc(inode, page, delalloc_start, 2794 - delalloc_end, &page_started, 2795 - &nr_written); 2782 + ret = tree->ops->fill_delalloc(inode, page, 2783 + delalloc_start, 2784 + delalloc_end, 2785 + &page_started, 2786 + &nr_written); 2787 + BUG_ON(ret); 2796 2788 /* 2797 2789 * delalloc_end is already one less than the total 2798 2790 * length, so we don't subtract one from ··· 2832 2818 if (tree->ops && tree->ops->writepage_start_hook) { 2833 2819 ret = tree->ops->writepage_start_hook(page, start, 2834 2820 page_end); 2835 - if (ret == -EAGAIN) { 2836 - redirty_page_for_writepage(wbc, page); 2821 + if (ret) { 2822 + /* Fixup worker will requeue */ 2823 + if (ret == -EBUSY) 2824 + wbc->pages_skipped++; 2825 + else 2826 + redirty_page_for_writepage(wbc, page); 2837 2827 update_nr_written(page, wbc, nr_written); 2838 2828 unlock_page(page); 2839 2829 ret = 0; ··· 3307 3289 len = end - start + 1; 3308 3290 write_lock(&map->lock); 3309 3291 em = lookup_extent_mapping(map, start, len); 3310 - if (IS_ERR_OR_NULL(em)) { 3292 + if (!em) { 3311 3293 write_unlock(&map->lock); 3312 3294 break; 3313 3295 } ··· 3871 3853 num_pages = num_extent_pages(eb->start, eb->len); 3872 3854 clear_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags); 3873 3855 3874 - if (eb_straddles_pages(eb)) { 3875 - clear_extent_uptodate(tree, eb->start, eb->start + eb->len - 1, 3876 - cached_state, GFP_NOFS); 3877 - } 3856 + clear_extent_uptodate(tree, eb->start, eb->start + eb->len - 1, 3857 + cached_state, GFP_NOFS); 3858 + 3878 3859 for (i = 0; i < num_pages; i++) { 3879 3860 page = extent_buffer_page(eb, i); 3880 3861 if (page)
+1
fs/btrfs/extent_io.h
··· 319 319 int repair_io_failure(struct btrfs_mapping_tree *map_tree, u64 start, 320 320 u64 length, u64 logical, struct page *page, 321 321 int mirror_num); 322 + int end_extent_writepage(struct page *page, int err, u64 start, u64 end); 322 323 #endif
+2 -2
fs/btrfs/extent_map.h
··· 26 26 unsigned long flags; 27 27 struct block_device *bdev; 28 28 atomic_t refs; 29 - unsigned int in_tree:1; 30 - unsigned int compress_type:4; 29 + unsigned int in_tree; 30 + unsigned int compress_type; 31 31 }; 32 32 33 33 struct extent_map_tree {
+12 -17
fs/btrfs/file.c
··· 1605 1605 return -EOPNOTSUPP; 1606 1606 1607 1607 /* 1608 + * Make sure we have enough space before we do the 1609 + * allocation. 1610 + */ 1611 + ret = btrfs_check_data_free_space(inode, len); 1612 + if (ret) 1613 + return ret; 1614 + 1615 + /* 1608 1616 * wait for ordered IO before we have any locks. We'll loop again 1609 1617 * below with the locks held. 1610 1618 */ ··· 1675 1667 if (em->block_start == EXTENT_MAP_HOLE || 1676 1668 (cur_offset >= inode->i_size && 1677 1669 !test_bit(EXTENT_FLAG_PREALLOC, &em->flags))) { 1678 - 1679 - /* 1680 - * Make sure we have enough space before we do the 1681 - * allocation. 1682 - */ 1683 - ret = btrfs_check_data_free_space(inode, last_byte - 1684 - cur_offset); 1685 - if (ret) { 1686 - free_extent_map(em); 1687 - break; 1688 - } 1689 - 1690 1670 ret = btrfs_prealloc_file_range(inode, mode, cur_offset, 1691 1671 last_byte - cur_offset, 1692 1672 1 << inode->i_blkbits, 1693 1673 offset + len, 1694 1674 &alloc_hint); 1695 1675 1696 - /* Let go of our reservation. */ 1697 - btrfs_free_reserved_data_space(inode, last_byte - 1698 - cur_offset); 1699 1676 if (ret < 0) { 1700 1677 free_extent_map(em); 1701 1678 break; ··· 1708 1715 &cached_state, GFP_NOFS); 1709 1716 out: 1710 1717 mutex_unlock(&inode->i_mutex); 1718 + /* Let go of our reservation. */ 1719 + btrfs_free_reserved_data_space(inode, len); 1711 1720 return ret; 1712 1721 } 1713 1722 ··· 1756 1761 start - root->sectorsize, 1757 1762 root->sectorsize, 0); 1758 1763 if (IS_ERR(em)) { 1759 - ret = -ENXIO; 1764 + ret = PTR_ERR(em); 1760 1765 goto out; 1761 1766 } 1762 1767 last_end = em->start + em->len; ··· 1768 1773 while (1) { 1769 1774 em = btrfs_get_extent_fiemap(inode, NULL, 0, start, len, 0); 1770 1775 if (IS_ERR(em)) { 1771 - ret = -ENXIO; 1776 + ret = PTR_ERR(em); 1772 1777 break; 1773 1778 } 1774 1779
+1
fs/btrfs/free-space-cache.c
··· 777 777 spin_lock(&block_group->lock); 778 778 if (block_group->disk_cache_state != BTRFS_DC_WRITTEN) { 779 779 spin_unlock(&block_group->lock); 780 + btrfs_free_path(path); 780 781 goto out; 781 782 } 782 783 spin_unlock(&block_group->lock);
+4 -2
fs/btrfs/inode-map.c
··· 438 438 trans->bytes_reserved); 439 439 if (ret) 440 440 goto out; 441 - trace_btrfs_space_reservation(root->fs_info, "ino_cache", (u64)trans, 441 + trace_btrfs_space_reservation(root->fs_info, "ino_cache", 442 + (u64)(unsigned long)trans, 442 443 trans->bytes_reserved, 1); 443 444 again: 444 445 inode = lookup_free_ino_inode(root, path); ··· 501 500 out_put: 502 501 iput(inode); 503 502 out_release: 504 - trace_btrfs_space_reservation(root->fs_info, "ino_cache", (u64)trans, 503 + trace_btrfs_space_reservation(root->fs_info, "ino_cache", 504 + (u64)(unsigned long)trans, 505 505 trans->bytes_reserved, 0); 506 506 btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved); 507 507 out:
+35 -5
fs/btrfs/inode.c
··· 1555 1555 struct inode *inode; 1556 1556 u64 page_start; 1557 1557 u64 page_end; 1558 + int ret; 1558 1559 1559 1560 fixup = container_of(work, struct btrfs_writepage_fixup, work); 1560 1561 page = fixup->page; ··· 1583 1582 page_end, &cached_state, GFP_NOFS); 1584 1583 unlock_page(page); 1585 1584 btrfs_start_ordered_extent(inode, ordered, 1); 1585 + btrfs_put_ordered_extent(ordered); 1586 1586 goto again; 1587 1587 } 1588 1588 1589 - BUG(); 1589 + ret = btrfs_delalloc_reserve_space(inode, PAGE_CACHE_SIZE); 1590 + if (ret) { 1591 + mapping_set_error(page->mapping, ret); 1592 + end_extent_writepage(page, ret, page_start, page_end); 1593 + ClearPageChecked(page); 1594 + goto out; 1595 + } 1596 + 1590 1597 btrfs_set_extent_delalloc(inode, page_start, page_end, &cached_state); 1591 1598 ClearPageChecked(page); 1599 + set_page_dirty(page); 1592 1600 out: 1593 1601 unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start, page_end, 1594 1602 &cached_state, GFP_NOFS); ··· 1640 1630 fixup->work.func = btrfs_writepage_fixup_worker; 1641 1631 fixup->page = page; 1642 1632 btrfs_queue_worker(&root->fs_info->fixup_workers, &fixup->work); 1643 - return -EAGAIN; 1633 + return -EBUSY; 1644 1634 } 1645 1635 1646 1636 static int insert_reserved_file_extent(struct btrfs_trans_handle *trans, ··· 4585 4575 ret = btrfs_insert_dir_item(trans, root, name, name_len, 4586 4576 parent_inode, &key, 4587 4577 btrfs_inode_type(inode), index); 4588 - BUG_ON(ret); 4578 + if (ret) 4579 + goto fail_dir_item; 4589 4580 4590 4581 btrfs_i_size_write(parent_inode, parent_inode->i_size + 4591 4582 name_len * 2); 4592 4583 parent_inode->i_mtime = parent_inode->i_ctime = CURRENT_TIME; 4593 4584 ret = btrfs_update_inode(trans, root, parent_inode); 4585 + } 4586 + return ret; 4587 + 4588 + fail_dir_item: 4589 + if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) { 4590 + u64 local_index; 4591 + int err; 4592 + err = btrfs_del_root_ref(trans, root->fs_info->tree_root, 4593 + key.objectid, root->root_key.objectid, 4594 + parent_ino, &local_index, name, name_len); 4595 + 4596 + } else if (add_backref) { 4597 + u64 local_index; 4598 + int err; 4599 + 4600 + err = btrfs_del_inode_ref(trans, root, name, name_len, 4601 + ino, parent_ino, &local_index); 4594 4602 } 4595 4603 return ret; 4596 4604 } ··· 6724 6696 int err; 6725 6697 u64 index = 0; 6726 6698 6727 - inode = btrfs_new_inode(trans, new_root, NULL, "..", 2, new_dirid, 6728 - new_dirid, S_IFDIR | 0700, &index); 6699 + inode = btrfs_new_inode(trans, new_root, NULL, "..", 2, 6700 + new_dirid, new_dirid, 6701 + S_IFDIR | (~current_umask() & S_IRWXUGO), 6702 + &index); 6729 6703 if (IS_ERR(inode)) 6730 6704 return PTR_ERR(inode); 6731 6705 inode->i_op = &btrfs_dir_inode_operations;
+35 -24
fs/btrfs/ioctl.c
··· 861 861 int i_done; 862 862 struct btrfs_ordered_extent *ordered; 863 863 struct extent_state *cached_state = NULL; 864 + struct extent_io_tree *tree; 864 865 gfp_t mask = btrfs_alloc_write_mask(inode->i_mapping); 865 866 866 867 if (isize == 0) ··· 872 871 num_pages << PAGE_CACHE_SHIFT); 873 872 if (ret) 874 873 return ret; 875 - again: 876 - ret = 0; 877 874 i_done = 0; 875 + tree = &BTRFS_I(inode)->io_tree; 878 876 879 877 /* step one, lock all the pages */ 880 878 for (i = 0; i < num_pages; i++) { 881 879 struct page *page; 880 + again: 882 881 page = find_or_create_page(inode->i_mapping, 883 - start_index + i, mask); 882 + start_index + i, mask); 884 883 if (!page) 885 884 break; 885 + 886 + page_start = page_offset(page); 887 + page_end = page_start + PAGE_CACHE_SIZE - 1; 888 + while (1) { 889 + lock_extent(tree, page_start, page_end, GFP_NOFS); 890 + ordered = btrfs_lookup_ordered_extent(inode, 891 + page_start); 892 + unlock_extent(tree, page_start, page_end, GFP_NOFS); 893 + if (!ordered) 894 + break; 895 + 896 + unlock_page(page); 897 + btrfs_start_ordered_extent(inode, ordered, 1); 898 + btrfs_put_ordered_extent(ordered); 899 + lock_page(page); 900 + } 886 901 887 902 if (!PageUptodate(page)) { 888 903 btrfs_readpage(NULL, page); ··· 910 893 break; 911 894 } 912 895 } 896 + 913 897 isize = i_size_read(inode); 914 898 file_end = (isize - 1) >> PAGE_CACHE_SHIFT; 915 - if (!isize || page->index > file_end || 916 - page->mapping != inode->i_mapping) { 899 + if (!isize || page->index > file_end) { 917 900 /* whoops, we blew past eof, skip this page */ 918 901 unlock_page(page); 919 902 page_cache_release(page); 920 903 break; 921 904 } 905 + 906 + if (page->mapping != inode->i_mapping) { 907 + unlock_page(page); 908 + page_cache_release(page); 909 + goto again; 910 + } 911 + 922 912 pages[i] = page; 923 913 i_done++; 924 914 } ··· 948 924 lock_extent_bits(&BTRFS_I(inode)->io_tree, 949 925 page_start, page_end - 1, 0, &cached_state, 950 926 GFP_NOFS); 951 - ordered = btrfs_lookup_first_ordered_extent(inode, page_end - 1); 952 - if (ordered && 953 - ordered->file_offset + ordered->len > page_start && 954 - ordered->file_offset < page_end) { 955 - btrfs_put_ordered_extent(ordered); 956 - unlock_extent_cached(&BTRFS_I(inode)->io_tree, 957 - page_start, page_end - 1, 958 - &cached_state, GFP_NOFS); 959 - for (i = 0; i < i_done; i++) { 960 - unlock_page(pages[i]); 961 - page_cache_release(pages[i]); 962 - } 963 - btrfs_wait_ordered_range(inode, page_start, 964 - page_end - page_start); 965 - goto again; 966 - } 967 - if (ordered) 968 - btrfs_put_ordered_extent(ordered); 969 - 970 927 clear_extent_bit(&BTRFS_I(inode)->io_tree, page_start, 971 928 page_end - 1, EXTENT_DIRTY | EXTENT_DELALLOC | 972 929 EXTENT_DO_ACCOUNTING, 0, 0, &cached_state, ··· 1329 1324 namelen = strlen(name); 1330 1325 if (strchr(name, '/')) { 1331 1326 ret = -EINVAL; 1327 + goto out; 1328 + } 1329 + 1330 + if (name[0] == '.' && 1331 + (namelen == 1 || (name[1] == '.' && namelen == 2))) { 1332 + ret = -EEXIST; 1332 1333 goto out; 1333 1334 } 1334 1335
+5 -3
fs/btrfs/scrub.c
··· 1367 1367 } 1368 1368 1369 1369 static noinline_for_stack int scrub_chunk(struct scrub_dev *sdev, 1370 - u64 chunk_tree, u64 chunk_objectid, u64 chunk_offset, u64 length) 1370 + u64 chunk_tree, u64 chunk_objectid, u64 chunk_offset, u64 length, 1371 + u64 dev_offset) 1371 1372 { 1372 1373 struct btrfs_mapping_tree *map_tree = 1373 1374 &sdev->dev->dev_root->fs_info->mapping_tree; ··· 1392 1391 goto out; 1393 1392 1394 1393 for (i = 0; i < map->num_stripes; ++i) { 1395 - if (map->stripes[i].dev == sdev->dev) { 1394 + if (map->stripes[i].dev == sdev->dev && 1395 + map->stripes[i].physical == dev_offset) { 1396 1396 ret = scrub_stripe(sdev, map, i, chunk_offset, length); 1397 1397 if (ret) 1398 1398 goto out; ··· 1489 1487 break; 1490 1488 } 1491 1489 ret = scrub_chunk(sdev, chunk_tree, chunk_objectid, 1492 - chunk_offset, length); 1490 + chunk_offset, length, found_key.offset); 1493 1491 btrfs_put_block_group(cache); 1494 1492 if (ret) 1495 1493 break;
+9 -7
fs/btrfs/transaction.c
··· 327 327 328 328 if (num_bytes) { 329 329 trace_btrfs_space_reservation(root->fs_info, "transaction", 330 - (u64)h, num_bytes, 1); 330 + (u64)(unsigned long)h, 331 + num_bytes, 1); 331 332 h->block_rsv = &root->fs_info->trans_block_rsv; 332 333 h->bytes_reserved = num_bytes; 333 334 } ··· 916 915 dentry->d_name.name, dentry->d_name.len, 917 916 parent_inode, &key, 918 917 BTRFS_FT_DIR, index); 919 - BUG_ON(ret); 918 + if (ret) { 919 + pending->error = -EEXIST; 920 + dput(parent); 921 + goto fail; 922 + } 920 923 921 924 btrfs_i_size_write(parent_inode, parent_inode->i_size + 922 925 dentry->d_name.len * 2); ··· 998 993 { 999 994 struct btrfs_pending_snapshot *pending; 1000 995 struct list_head *head = &trans->transaction->pending_snapshots; 1001 - int ret; 1002 996 1003 - list_for_each_entry(pending, head, list) { 1004 - ret = create_pending_snapshot(trans, fs_info, pending); 1005 - BUG_ON(ret); 1006 - } 997 + list_for_each_entry(pending, head, list) 998 + create_pending_snapshot(trans, fs_info, pending); 1007 999 return 0; 1008 1000 } 1009 1001
+31 -2
fs/btrfs/volumes.c
··· 459 459 { 460 460 struct btrfs_device *device, *next; 461 461 462 + struct block_device *latest_bdev = NULL; 463 + u64 latest_devid = 0; 464 + u64 latest_transid = 0; 465 + 462 466 mutex_lock(&uuid_mutex); 463 467 again: 464 468 /* This is the initialized path, it is safe to release the devices. */ 465 469 list_for_each_entry_safe(device, next, &fs_devices->devices, dev_list) { 466 - if (device->in_fs_metadata) 470 + if (device->in_fs_metadata) { 471 + if (!latest_transid || 472 + device->generation > latest_transid) { 473 + latest_devid = device->devid; 474 + latest_transid = device->generation; 475 + latest_bdev = device->bdev; 476 + } 467 477 continue; 478 + } 468 479 469 480 if (device->bdev) { 470 481 blkdev_put(device->bdev, device->mode); ··· 497 486 fs_devices = fs_devices->seed; 498 487 goto again; 499 488 } 489 + 490 + fs_devices->latest_bdev = latest_bdev; 491 + fs_devices->latest_devid = latest_devid; 492 + fs_devices->latest_trans = latest_transid; 500 493 501 494 mutex_unlock(&uuid_mutex); 502 495 return 0; ··· 1968 1953 em = lookup_extent_mapping(em_tree, chunk_offset, 1); 1969 1954 read_unlock(&em_tree->lock); 1970 1955 1971 - BUG_ON(em->start > chunk_offset || 1956 + BUG_ON(!em || em->start > chunk_offset || 1972 1957 em->start + em->len < chunk_offset); 1973 1958 map = (struct map_lookup *)em->bdev; 1974 1959 ··· 4371 4356 return -ENOMEM; 4372 4357 btrfs_set_buffer_uptodate(sb); 4373 4358 btrfs_set_buffer_lockdep_class(root->root_key.objectid, sb, 0); 4359 + /* 4360 + * The sb extent buffer is artifical and just used to read the system array. 4361 + * btrfs_set_buffer_uptodate() call does not properly mark all it's 4362 + * pages up-to-date when the page is larger: extent does not cover the 4363 + * whole page and consequently check_page_uptodate does not find all 4364 + * the page's extents up-to-date (the hole beyond sb), 4365 + * write_extent_buffer then triggers a WARN_ON. 4366 + * 4367 + * Regular short extents go through mark_extent_buffer_dirty/writeback cycle, 4368 + * but sb spans only this function. Add an explicit SetPageUptodate call 4369 + * to silence the warning eg. on PowerPC 64. 4370 + */ 4371 + if (PAGE_CACHE_SIZE > BTRFS_SUPER_INFO_SIZE) 4372 + SetPageUptodate(sb->first_page); 4374 4373 4375 4374 write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE); 4376 4375 array_size = btrfs_super_sys_array_size(super_copy);
+26 -32
fs/compat.c
··· 131 131 132 132 static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf) 133 133 { 134 - compat_ino_t ino = stat->ino; 135 - typeof(ubuf->st_uid) uid = 0; 136 - typeof(ubuf->st_gid) gid = 0; 137 - int err; 134 + struct compat_stat tmp; 138 135 139 - SET_UID(uid, stat->uid); 140 - SET_GID(gid, stat->gid); 141 - 142 - if ((u64) stat->size > MAX_NON_LFS || 143 - !old_valid_dev(stat->dev) || 144 - !old_valid_dev(stat->rdev)) 145 - return -EOVERFLOW; 146 - if (sizeof(ino) < sizeof(stat->ino) && ino != stat->ino) 136 + if (!old_valid_dev(stat->dev) || !old_valid_dev(stat->rdev)) 147 137 return -EOVERFLOW; 148 138 149 - if (clear_user(ubuf, sizeof(*ubuf))) 150 - return -EFAULT; 151 - 152 - err = __put_user(old_encode_dev(stat->dev), &ubuf->st_dev); 153 - err |= __put_user(ino, &ubuf->st_ino); 154 - err |= __put_user(stat->mode, &ubuf->st_mode); 155 - err |= __put_user(stat->nlink, &ubuf->st_nlink); 156 - err |= __put_user(uid, &ubuf->st_uid); 157 - err |= __put_user(gid, &ubuf->st_gid); 158 - err |= __put_user(old_encode_dev(stat->rdev), &ubuf->st_rdev); 159 - err |= __put_user(stat->size, &ubuf->st_size); 160 - err |= __put_user(stat->atime.tv_sec, &ubuf->st_atime); 161 - err |= __put_user(stat->atime.tv_nsec, &ubuf->st_atime_nsec); 162 - err |= __put_user(stat->mtime.tv_sec, &ubuf->st_mtime); 163 - err |= __put_user(stat->mtime.tv_nsec, &ubuf->st_mtime_nsec); 164 - err |= __put_user(stat->ctime.tv_sec, &ubuf->st_ctime); 165 - err |= __put_user(stat->ctime.tv_nsec, &ubuf->st_ctime_nsec); 166 - err |= __put_user(stat->blksize, &ubuf->st_blksize); 167 - err |= __put_user(stat->blocks, &ubuf->st_blocks); 168 - return err; 139 + memset(&tmp, 0, sizeof(tmp)); 140 + tmp.st_dev = old_encode_dev(stat->dev); 141 + tmp.st_ino = stat->ino; 142 + if (sizeof(tmp.st_ino) < sizeof(stat->ino) && tmp.st_ino != stat->ino) 143 + return -EOVERFLOW; 144 + tmp.st_mode = stat->mode; 145 + tmp.st_nlink = stat->nlink; 146 + if (tmp.st_nlink != stat->nlink) 147 + return -EOVERFLOW; 148 + SET_UID(tmp.st_uid, stat->uid); 149 + SET_GID(tmp.st_gid, stat->gid); 150 + tmp.st_rdev = old_encode_dev(stat->rdev); 151 + if ((u64) stat->size > MAX_NON_LFS) 152 + return -EOVERFLOW; 153 + tmp.st_size = stat->size; 154 + tmp.st_atime = stat->atime.tv_sec; 155 + tmp.st_atime_nsec = stat->atime.tv_nsec; 156 + tmp.st_mtime = stat->mtime.tv_sec; 157 + tmp.st_mtime_nsec = stat->mtime.tv_nsec; 158 + tmp.st_ctime = stat->ctime.tv_sec; 159 + tmp.st_ctime_nsec = stat->ctime.tv_nsec; 160 + tmp.st_blocks = stat->blocks; 161 + tmp.st_blksize = stat->blksize; 162 + return copy_to_user(ubuf, &tmp, sizeof(tmp)) ? -EFAULT : 0; 169 163 } 170 164 171 165 asmlinkage long compat_sys_newstat(const char __user * filename,
+12 -9
fs/dcache.c
··· 104 104 105 105 static struct hlist_bl_head *dentry_hashtable __read_mostly; 106 106 107 - static inline struct hlist_bl_head *d_hash(struct dentry *parent, 107 + static inline struct hlist_bl_head *d_hash(const struct dentry *parent, 108 108 unsigned long hash) 109 109 { 110 110 hash += ((unsigned long) parent ^ GOLDEN_RATIO_PRIME) / L1_CACHE_BYTES; ··· 1717 1717 * child is looked up. Thus, an interlocking stepping of sequence lock checks 1718 1718 * is formed, giving integrity down the path walk. 1719 1719 */ 1720 - struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name, 1721 - unsigned *seq, struct inode **inode) 1720 + struct dentry *__d_lookup_rcu(const struct dentry *parent, 1721 + const struct qstr *name, 1722 + unsigned *seqp, struct inode **inode) 1722 1723 { 1723 1724 unsigned int len = name->len; 1724 1725 unsigned int hash = name->hash; ··· 1749 1748 * See Documentation/filesystems/path-lookup.txt for more details. 1750 1749 */ 1751 1750 hlist_bl_for_each_entry_rcu(dentry, node, b, d_hash) { 1751 + unsigned seq; 1752 1752 struct inode *i; 1753 1753 const char *tname; 1754 1754 int tlen; ··· 1758 1756 continue; 1759 1757 1760 1758 seqretry: 1761 - *seq = read_seqcount_begin(&dentry->d_seq); 1759 + seq = read_seqcount_begin(&dentry->d_seq); 1762 1760 if (dentry->d_parent != parent) 1763 1761 continue; 1764 1762 if (d_unhashed(dentry)) ··· 1773 1771 * edge of memory when walking. If we could load this 1774 1772 * atomically some other way, we could drop this check. 1775 1773 */ 1776 - if (read_seqcount_retry(&dentry->d_seq, *seq)) 1774 + if (read_seqcount_retry(&dentry->d_seq, seq)) 1777 1775 goto seqretry; 1778 1776 if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) { 1779 1777 if (parent->d_op->d_compare(parent, *inode, ··· 1790 1788 * order to do anything useful with the returned dentry 1791 1789 * anyway. 1792 1790 */ 1791 + *seqp = seq; 1793 1792 *inode = i; 1794 1793 return dentry; 1795 1794 } ··· 2971 2968 2972 2969 static void __init dcache_init_early(void) 2973 2970 { 2974 - int loop; 2971 + unsigned int loop; 2975 2972 2976 2973 /* If hashes are distributed across NUMA nodes, defer 2977 2974 * hash allocation until vmalloc space is available. ··· 2989 2986 &d_hash_mask, 2990 2987 0); 2991 2988 2992 - for (loop = 0; loop < (1 << d_hash_shift); loop++) 2989 + for (loop = 0; loop < (1U << d_hash_shift); loop++) 2993 2990 INIT_HLIST_BL_HEAD(dentry_hashtable + loop); 2994 2991 } 2995 2992 2996 2993 static void __init dcache_init(void) 2997 2994 { 2998 - int loop; 2995 + unsigned int loop; 2999 2996 3000 2997 /* 3001 2998 * A constructor could be added for stable state like the lists, ··· 3019 3016 &d_hash_mask, 3020 3017 0); 3021 3018 3022 - for (loop = 0; loop < (1 << d_hash_shift); loop++) 3019 + for (loop = 0; loop < (1U << d_hash_shift); loop++) 3023 3020 INIT_HLIST_BL_HEAD(dentry_hashtable + loop); 3024 3021 } 3025 3022
+2 -2
fs/direct-io.c
··· 173 173 if (atomic_read(&inode->i_dio_count)) 174 174 __inode_dio_wait(inode); 175 175 } 176 - EXPORT_SYMBOL_GPL(inode_dio_wait); 176 + EXPORT_SYMBOL(inode_dio_wait); 177 177 178 178 /* 179 179 * inode_dio_done - signal finish of a direct I/O requests ··· 187 187 if (atomic_dec_and_test(&inode->i_dio_count)) 188 188 wake_up_bit(&inode->i_state, __I_DIO_WAKEUP); 189 189 } 190 - EXPORT_SYMBOL_GPL(inode_dio_done); 190 + EXPORT_SYMBOL(inode_dio_done); 191 191 192 192 /* 193 193 * How many pages are in the queue?
+1 -1
fs/ecryptfs/miscdev.c
··· 429 429 goto memdup; 430 430 } else if (count < MIN_MSG_PKT_SIZE || count > MAX_MSG_PKT_SIZE) { 431 431 printk(KERN_WARNING "%s: Acceptable packet size range is " 432 - "[%d-%lu], but amount of data written is [%zu].", 432 + "[%d-%zu], but amount of data written is [%zu].", 433 433 __func__, MIN_MSG_PKT_SIZE, MAX_MSG_PKT_SIZE, count); 434 434 return -EINVAL; 435 435 }
+29 -1
fs/eventpoll.c
··· 320 320 return !list_empty(p); 321 321 } 322 322 323 + static inline struct eppoll_entry *ep_pwq_from_wait(wait_queue_t *p) 324 + { 325 + return container_of(p, struct eppoll_entry, wait); 326 + } 327 + 323 328 /* Get the "struct epitem" from a wait queue pointer */ 324 329 static inline struct epitem *ep_item_from_wait(wait_queue_t *p) 325 330 { ··· 472 467 put_cpu(); 473 468 } 474 469 470 + static void ep_remove_wait_queue(struct eppoll_entry *pwq) 471 + { 472 + wait_queue_head_t *whead; 473 + 474 + rcu_read_lock(); 475 + /* If it is cleared by POLLFREE, it should be rcu-safe */ 476 + whead = rcu_dereference(pwq->whead); 477 + if (whead) 478 + remove_wait_queue(whead, &pwq->wait); 479 + rcu_read_unlock(); 480 + } 481 + 475 482 /* 476 483 * This function unregisters poll callbacks from the associated file 477 484 * descriptor. Must be called with "mtx" held (or "epmutex" if called from ··· 498 481 pwq = list_first_entry(lsthead, struct eppoll_entry, llink); 499 482 500 483 list_del(&pwq->llink); 501 - remove_wait_queue(pwq->whead, &pwq->wait); 484 + ep_remove_wait_queue(pwq); 502 485 kmem_cache_free(pwq_cache, pwq); 503 486 } 504 487 } ··· 858 841 unsigned long flags; 859 842 struct epitem *epi = ep_item_from_wait(wait); 860 843 struct eventpoll *ep = epi->ep; 844 + 845 + if ((unsigned long)key & POLLFREE) { 846 + ep_pwq_from_wait(wait)->whead = NULL; 847 + /* 848 + * whead = NULL above can race with ep_remove_wait_queue() 849 + * which can do another remove_wait_queue() after us, so we 850 + * can't use __remove_wait_queue(). whead->lock is held by 851 + * the caller. 852 + */ 853 + list_del_init(&wait->task_list); 854 + } 861 855 862 856 spin_lock_irqsave(&ep->lock, flags); 863 857
+10 -4
fs/gfs2/glock.c
··· 167 167 spin_unlock(&lru_lock); 168 168 } 169 169 170 - static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl) 170 + static void __gfs2_glock_remove_from_lru(struct gfs2_glock *gl) 171 171 { 172 - spin_lock(&lru_lock); 173 172 if (!list_empty(&gl->gl_lru)) { 174 173 list_del_init(&gl->gl_lru); 175 174 atomic_dec(&lru_count); 176 175 clear_bit(GLF_LRU, &gl->gl_flags); 177 176 } 177 + } 178 + 179 + static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl) 180 + { 181 + spin_lock(&lru_lock); 182 + __gfs2_glock_remove_from_lru(gl); 178 183 spin_unlock(&lru_lock); 179 184 } 180 185 ··· 222 217 struct gfs2_sbd *sdp = gl->gl_sbd; 223 218 struct address_space *mapping = gfs2_glock2aspace(gl); 224 219 225 - if (atomic_dec_and_test(&gl->gl_ref)) { 220 + if (atomic_dec_and_lock(&gl->gl_ref, &lru_lock)) { 221 + __gfs2_glock_remove_from_lru(gl); 222 + spin_unlock(&lru_lock); 226 223 spin_lock_bucket(gl->gl_hash); 227 224 hlist_bl_del_rcu(&gl->gl_list); 228 225 spin_unlock_bucket(gl->gl_hash); 229 - gfs2_glock_remove_from_lru(gl); 230 226 GLOCK_BUG_ON(gl, !list_empty(&gl->gl_holders)); 231 227 GLOCK_BUG_ON(gl, mapping && mapping->nrpages); 232 228 trace_gfs2_glock_put(gl);
+1 -4
fs/gfs2/inode.c
··· 391 391 int error; 392 392 int dblocks = 1; 393 393 394 - error = gfs2_rindex_update(sdp); 395 - if (error) 396 - fs_warn(sdp, "rindex update returns %d\n", error); 397 - 398 394 error = gfs2_inplace_reserve(dip, RES_DINODE); 399 395 if (error) 400 396 goto out; ··· 1039 1043 rgd = gfs2_blk2rgrpd(sdp, ip->i_no_addr); 1040 1044 if (!rgd) 1041 1045 goto out_inodes; 1046 + 1042 1047 gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2); 1043 1048 1044 1049
+5
fs/gfs2/ops_fstype.c
··· 800 800 fs_err(sdp, "can't get quota file inode: %d\n", error); 801 801 goto fail_rindex; 802 802 } 803 + 804 + error = gfs2_rindex_update(sdp); 805 + if (error) 806 + goto fail_qinode; 807 + 803 808 return 0; 804 809 805 810 fail_qinode:
+9 -4
fs/gfs2/rgrp.c
··· 683 683 struct gfs2_glock *gl = ip->i_gl; 684 684 struct gfs2_holder ri_gh; 685 685 int error = 0; 686 + int unlock_required = 0; 686 687 687 688 /* Read new copy from disk if we don't have the latest */ 688 689 if (!sdp->sd_rindex_uptodate) { 689 690 mutex_lock(&sdp->sd_rindex_mutex); 690 - error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh); 691 - if (error) 692 - return error; 691 + if (!gfs2_glock_is_locked_by_me(gl)) { 692 + error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh); 693 + if (error) 694 + return error; 695 + unlock_required = 1; 696 + } 693 697 if (!sdp->sd_rindex_uptodate) 694 698 error = gfs2_ri_update(ip); 695 - gfs2_glock_dq_uninit(&ri_gh); 699 + if (unlock_required) 700 + gfs2_glock_dq_uninit(&ri_gh); 696 701 mutex_unlock(&sdp->sd_rindex_mutex); 697 702 } 698 703
+4 -4
fs/inode.c
··· 1651 1651 */ 1652 1652 void __init inode_init_early(void) 1653 1653 { 1654 - int loop; 1654 + unsigned int loop; 1655 1655 1656 1656 /* If hashes are distributed across NUMA nodes, defer 1657 1657 * hash allocation until vmalloc space is available. ··· 1669 1669 &i_hash_mask, 1670 1670 0); 1671 1671 1672 - for (loop = 0; loop < (1 << i_hash_shift); loop++) 1672 + for (loop = 0; loop < (1U << i_hash_shift); loop++) 1673 1673 INIT_HLIST_HEAD(&inode_hashtable[loop]); 1674 1674 } 1675 1675 1676 1676 void __init inode_init(void) 1677 1677 { 1678 - int loop; 1678 + unsigned int loop; 1679 1679 1680 1680 /* inode slab cache */ 1681 1681 inode_cachep = kmem_cache_create("inode_cache", ··· 1699 1699 &i_hash_mask, 1700 1700 0); 1701 1701 1702 - for (loop = 0; loop < (1 << i_hash_shift); loop++) 1702 + for (loop = 0; loop < (1U << i_hash_shift); loop++) 1703 1703 INIT_HLIST_HEAD(&inode_hashtable[loop]); 1704 1704 } 1705 1705
+47 -23
fs/namei.c
··· 1095 1095 struct dentry *old; 1096 1096 1097 1097 /* Don't create child dentry for a dead directory. */ 1098 - if (unlikely(IS_DEADDIR(inode))) 1098 + if (unlikely(IS_DEADDIR(inode))) { 1099 + dput(dentry); 1099 1100 return ERR_PTR(-ENOENT); 1101 + } 1100 1102 1101 1103 old = inode->i_op->lookup(inode, dentry, nd); 1102 1104 if (unlikely(old)) { ··· 1374 1372 return 1; 1375 1373 } 1376 1374 1375 + unsigned int full_name_hash(const unsigned char *name, unsigned int len) 1376 + { 1377 + unsigned long hash = init_name_hash(); 1378 + while (len--) 1379 + hash = partial_name_hash(*name++, hash); 1380 + return end_name_hash(hash); 1381 + } 1382 + EXPORT_SYMBOL(full_name_hash); 1383 + 1384 + /* 1385 + * We know there's a real path component here of at least 1386 + * one character. 1387 + */ 1388 + static inline unsigned long hash_name(const char *name, unsigned int *hashp) 1389 + { 1390 + unsigned long hash = init_name_hash(); 1391 + unsigned long len = 0, c; 1392 + 1393 + c = (unsigned char)*name; 1394 + do { 1395 + len++; 1396 + hash = partial_name_hash(c, hash); 1397 + c = (unsigned char)name[len]; 1398 + } while (c && c != '/'); 1399 + *hashp = end_name_hash(hash); 1400 + return len; 1401 + } 1402 + 1377 1403 /* 1378 1404 * Name resolution. 1379 1405 * This is the basic name resolution function, turning a pathname into ··· 1422 1392 1423 1393 /* At this point we know we have a real path component. */ 1424 1394 for(;;) { 1425 - unsigned long hash; 1426 1395 struct qstr this; 1427 - unsigned int c; 1396 + long len; 1428 1397 int type; 1429 1398 1430 1399 err = may_lookup(nd); 1431 1400 if (err) 1432 1401 break; 1433 1402 1403 + len = hash_name(name, &this.hash); 1434 1404 this.name = name; 1435 - c = *(const unsigned char *)name; 1436 - 1437 - hash = init_name_hash(); 1438 - do { 1439 - name++; 1440 - hash = partial_name_hash(c, hash); 1441 - c = *(const unsigned char *)name; 1442 - } while (c && (c != '/')); 1443 - this.len = name - (const char *) this.name; 1444 - this.hash = end_name_hash(hash); 1405 + this.len = len; 1445 1406 1446 1407 type = LAST_NORM; 1447 - if (this.name[0] == '.') switch (this.len) { 1408 + if (name[0] == '.') switch (len) { 1448 1409 case 2: 1449 - if (this.name[1] == '.') { 1410 + if (name[1] == '.') { 1450 1411 type = LAST_DOTDOT; 1451 1412 nd->flags |= LOOKUP_JUMPED; 1452 1413 } ··· 1456 1435 } 1457 1436 } 1458 1437 1459 - /* remove trailing slashes? */ 1460 - if (!c) 1438 + if (!name[len]) 1461 1439 goto last_component; 1462 - while (*++name == '/'); 1463 - if (!*name) 1440 + /* 1441 + * If it wasn't NUL, we know it was '/'. Skip that 1442 + * slash, and continue until no more slashes. 1443 + */ 1444 + do { 1445 + len++; 1446 + } while (unlikely(name[len] == '/')); 1447 + if (!name[len]) 1464 1448 goto last_component; 1449 + name += len; 1465 1450 1466 1451 err = walk_component(nd, &next, &this, type, LOOKUP_FOLLOW); 1467 1452 if (err < 0) ··· 1800 1773 struct dentry *lookup_one_len(const char *name, struct dentry *base, int len) 1801 1774 { 1802 1775 struct qstr this; 1803 - unsigned long hash; 1804 1776 unsigned int c; 1805 1777 1806 1778 WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex)); 1807 1779 1808 1780 this.name = name; 1809 1781 this.len = len; 1782 + this.hash = full_name_hash(name, len); 1810 1783 if (!len) 1811 1784 return ERR_PTR(-EACCES); 1812 1785 1813 - hash = init_name_hash(); 1814 1786 while (len--) { 1815 1787 c = *(const unsigned char *)name++; 1816 1788 if (c == '/' || c == '\0') 1817 1789 return ERR_PTR(-EACCES); 1818 - hash = partial_name_hash(c, hash); 1819 1790 } 1820 - this.hash = end_name_hash(hash); 1821 1791 /* 1822 1792 * See if the low-level filesystem might want 1823 1793 * to use its own hash..
+55 -75
fs/nfs/nfs4proc.c
··· 3575 3575 } 3576 3576 if (npages > 1) { 3577 3577 /* for decoding across pages */ 3578 - args.acl_scratch = alloc_page(GFP_KERNEL); 3579 - if (!args.acl_scratch) 3578 + res.acl_scratch = alloc_page(GFP_KERNEL); 3579 + if (!res.acl_scratch) 3580 3580 goto out_free; 3581 3581 } 3582 3582 args.acl_len = npages * PAGE_SIZE; ··· 3612 3612 for (i = 0; i < npages; i++) 3613 3613 if (pages[i]) 3614 3614 __free_page(pages[i]); 3615 - if (args.acl_scratch) 3616 - __free_page(args.acl_scratch); 3615 + if (res.acl_scratch) 3616 + __free_page(res.acl_scratch); 3617 3617 return ret; 3618 3618 } 3619 3619 ··· 4883 4883 clp->cl_rpcclient->cl_auth->au_flavor); 4884 4884 4885 4885 res.server_scope = kzalloc(sizeof(struct server_scope), GFP_KERNEL); 4886 - if (unlikely(!res.server_scope)) 4887 - return -ENOMEM; 4886 + if (unlikely(!res.server_scope)) { 4887 + status = -ENOMEM; 4888 + goto out; 4889 + } 4888 4890 4889 4891 status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT); 4890 4892 if (!status) ··· 4903 4901 clp->server_scope = NULL; 4904 4902 } 4905 4903 4906 - if (!clp->server_scope) 4904 + if (!clp->server_scope) { 4907 4905 clp->server_scope = res.server_scope; 4908 - else 4909 - kfree(res.server_scope); 4906 + goto out; 4907 + } 4910 4908 } 4911 - 4909 + kfree(res.server_scope); 4910 + out: 4912 4911 dprintk("<-- %s status= %d\n", __func__, status); 4913 4912 return status; 4914 4913 } ··· 5011 5008 return status; 5012 5009 } 5013 5010 5011 + static struct nfs4_slot *nfs4_alloc_slots(u32 max_slots, gfp_t gfp_flags) 5012 + { 5013 + return kcalloc(max_slots, sizeof(struct nfs4_slot), gfp_flags); 5014 + } 5015 + 5016 + static void nfs4_add_and_init_slots(struct nfs4_slot_table *tbl, 5017 + struct nfs4_slot *new, 5018 + u32 max_slots, 5019 + u32 ivalue) 5020 + { 5021 + struct nfs4_slot *old = NULL; 5022 + u32 i; 5023 + 5024 + spin_lock(&tbl->slot_tbl_lock); 5025 + if (new) { 5026 + old = tbl->slots; 5027 + tbl->slots = new; 5028 + tbl->max_slots = max_slots; 5029 + } 5030 + tbl->highest_used_slotid = -1; /* no slot is currently used */ 5031 + for (i = 0; i < tbl->max_slots; i++) 5032 + tbl->slots[i].seq_nr = ivalue; 5033 + spin_unlock(&tbl->slot_tbl_lock); 5034 + kfree(old); 5035 + } 5036 + 5014 5037 /* 5015 - * Reset a slot table 5038 + * (re)Initialise a slot table 5016 5039 */ 5017 - static int nfs4_reset_slot_table(struct nfs4_slot_table *tbl, u32 max_reqs, 5018 - int ivalue) 5040 + static int nfs4_realloc_slot_table(struct nfs4_slot_table *tbl, u32 max_reqs, 5041 + u32 ivalue) 5019 5042 { 5020 5043 struct nfs4_slot *new = NULL; 5021 - int i; 5022 - int ret = 0; 5044 + int ret = -ENOMEM; 5023 5045 5024 5046 dprintk("--> %s: max_reqs=%u, tbl->max_slots %d\n", __func__, 5025 5047 max_reqs, tbl->max_slots); 5026 5048 5027 5049 /* Does the newly negotiated max_reqs match the existing slot table? */ 5028 5050 if (max_reqs != tbl->max_slots) { 5029 - ret = -ENOMEM; 5030 - new = kmalloc(max_reqs * sizeof(struct nfs4_slot), 5031 - GFP_NOFS); 5051 + new = nfs4_alloc_slots(max_reqs, GFP_NOFS); 5032 5052 if (!new) 5033 5053 goto out; 5034 - ret = 0; 5035 - kfree(tbl->slots); 5036 5054 } 5037 - spin_lock(&tbl->slot_tbl_lock); 5038 - if (new) { 5039 - tbl->slots = new; 5040 - tbl->max_slots = max_reqs; 5041 - } 5042 - for (i = 0; i < tbl->max_slots; ++i) 5043 - tbl->slots[i].seq_nr = ivalue; 5044 - spin_unlock(&tbl->slot_tbl_lock); 5055 + ret = 0; 5056 + 5057 + nfs4_add_and_init_slots(tbl, new, max_reqs, ivalue); 5045 5058 dprintk("%s: tbl=%p slots=%p max_slots=%d\n", __func__, 5046 5059 tbl, tbl->slots, tbl->max_slots); 5047 5060 out: ··· 5080 5061 } 5081 5062 5082 5063 /* 5083 - * Initialize slot table 5084 - */ 5085 - static int nfs4_init_slot_table(struct nfs4_slot_table *tbl, 5086 - int max_slots, int ivalue) 5087 - { 5088 - struct nfs4_slot *slot; 5089 - int ret = -ENOMEM; 5090 - 5091 - BUG_ON(max_slots > NFS4_MAX_SLOT_TABLE); 5092 - 5093 - dprintk("--> %s: max_reqs=%u\n", __func__, max_slots); 5094 - 5095 - slot = kcalloc(max_slots, sizeof(struct nfs4_slot), GFP_NOFS); 5096 - if (!slot) 5097 - goto out; 5098 - ret = 0; 5099 - 5100 - spin_lock(&tbl->slot_tbl_lock); 5101 - tbl->max_slots = max_slots; 5102 - tbl->slots = slot; 5103 - tbl->highest_used_slotid = -1; /* no slot is currently used */ 5104 - spin_unlock(&tbl->slot_tbl_lock); 5105 - dprintk("%s: tbl=%p slots=%p max_slots=%d\n", __func__, 5106 - tbl, tbl->slots, tbl->max_slots); 5107 - out: 5108 - dprintk("<-- %s: return %d\n", __func__, ret); 5109 - return ret; 5110 - } 5111 - 5112 - /* 5113 5064 * Initialize or reset the forechannel and backchannel tables 5114 5065 */ 5115 5066 static int nfs4_setup_session_slot_tables(struct nfs4_session *ses) ··· 5090 5101 dprintk("--> %s\n", __func__); 5091 5102 /* Fore channel */ 5092 5103 tbl = &ses->fc_slot_table; 5093 - if (tbl->slots == NULL) { 5094 - status = nfs4_init_slot_table(tbl, ses->fc_attrs.max_reqs, 1); 5095 - if (status) /* -ENOMEM */ 5096 - return status; 5097 - } else { 5098 - status = nfs4_reset_slot_table(tbl, ses->fc_attrs.max_reqs, 1); 5099 - if (status) 5100 - return status; 5101 - } 5104 + status = nfs4_realloc_slot_table(tbl, ses->fc_attrs.max_reqs, 1); 5105 + if (status) /* -ENOMEM */ 5106 + return status; 5102 5107 /* Back channel */ 5103 5108 tbl = &ses->bc_slot_table; 5104 - if (tbl->slots == NULL) { 5105 - status = nfs4_init_slot_table(tbl, ses->bc_attrs.max_reqs, 0); 5106 - if (status) 5107 - /* Fore and back channel share a connection so get 5108 - * both slot tables or neither */ 5109 - nfs4_destroy_slot_tables(ses); 5110 - } else 5111 - status = nfs4_reset_slot_table(tbl, ses->bc_attrs.max_reqs, 0); 5109 + status = nfs4_realloc_slot_table(tbl, ses->bc_attrs.max_reqs, 0); 5110 + if (status && tbl->slots == NULL) 5111 + /* Fore and back channel share a connection so get 5112 + * both slot tables or neither */ 5113 + nfs4_destroy_slot_tables(ses); 5112 5114 return status; 5113 5115 } 5114 5116
+2
fs/nfs/nfs4state.c
··· 1132 1132 { 1133 1133 struct nfs_client *clp = server->nfs_client; 1134 1134 1135 + if (test_and_clear_bit(NFS_DELEGATED_STATE, &state->flags)) 1136 + nfs_async_inode_return_delegation(state->inode, &state->stateid); 1135 1137 nfs4_state_mark_reclaim_nograce(clp, state); 1136 1138 nfs4_schedule_state_manager(clp); 1137 1139 }
+4 -1
fs/nfs/nfs4xdr.c
··· 2522 2522 2523 2523 xdr_inline_pages(&req->rq_rcv_buf, replen << 2, 2524 2524 args->acl_pages, args->acl_pgbase, args->acl_len); 2525 - xdr_set_scratch_buffer(xdr, page_address(args->acl_scratch), PAGE_SIZE); 2526 2525 2527 2526 encode_nops(&hdr); 2528 2527 } ··· 6031 6032 struct compound_hdr hdr; 6032 6033 int status; 6033 6034 6035 + if (res->acl_scratch != NULL) { 6036 + void *p = page_address(res->acl_scratch); 6037 + xdr_set_scratch_buffer(xdr, p, PAGE_SIZE); 6038 + } 6034 6039 status = decode_compound_hdr(xdr, &hdr); 6035 6040 if (status) 6036 6041 goto out;
+3 -3
fs/ntfs/attrib.c
··· 1 1 /** 2 2 * attrib.c - NTFS attribute operations. Part of the Linux-NTFS project. 3 3 * 4 - * Copyright (c) 2001-2007 Anton Altaparmakov 4 + * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc. 5 5 * Copyright (c) 2002 Richard Russon 6 6 * 7 7 * This program/include file is free software; you can redistribute it and/or ··· 345 345 unsigned long flags; 346 346 bool is_retry = false; 347 347 348 + BUG_ON(!ni); 348 349 ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, %s_locked.", 349 350 ni->mft_no, (unsigned long long)vcn, 350 351 write_locked ? "write" : "read"); 351 - BUG_ON(!ni); 352 352 BUG_ON(!NInoNonResident(ni)); 353 353 BUG_ON(vcn < 0); 354 354 if (!ni->runlist.rl) { ··· 469 469 int err = 0; 470 470 bool is_retry = false; 471 471 472 + BUG_ON(!ni); 472 473 ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, with%s ctx.", 473 474 ni->mft_no, (unsigned long long)vcn, ctx ? "" : "out"); 474 - BUG_ON(!ni); 475 475 BUG_ON(!NInoNonResident(ni)); 476 476 BUG_ON(vcn < 0); 477 477 if (!ni->runlist.rl) {
+3 -3
fs/ntfs/mft.c
··· 1 1 /** 2 2 * mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project. 3 3 * 4 - * Copyright (c) 2001-2011 Anton Altaparmakov and Tuxera Inc. 4 + * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc. 5 5 * Copyright (c) 2002 Richard Russon 6 6 * 7 7 * This program/include file is free software; you can redistribute it and/or ··· 1367 1367 ntfs_error(vol->sb, "Failed to merge runlists for mft " 1368 1368 "bitmap."); 1369 1369 if (ntfs_cluster_free_from_rl(vol, rl2)) { 1370 - ntfs_error(vol->sb, "Failed to dealocate " 1370 + ntfs_error(vol->sb, "Failed to deallocate " 1371 1371 "allocated cluster.%s", es); 1372 1372 NVolSetErrors(vol); 1373 1373 } ··· 1805 1805 ntfs_error(vol->sb, "Failed to merge runlists for mft data " 1806 1806 "attribute."); 1807 1807 if (ntfs_cluster_free_from_rl(vol, rl2)) { 1808 - ntfs_error(vol->sb, "Failed to dealocate clusters " 1808 + ntfs_error(vol->sb, "Failed to deallocate clusters " 1809 1809 "from the mft data attribute.%s", es); 1810 1810 NVolSetErrors(vol); 1811 1811 }
+1 -3
fs/ntfs/super.c
··· 1 1 /* 2 2 * super.c - NTFS kernel super block handling. Part of the Linux-NTFS project. 3 3 * 4 - * Copyright (c) 2001-2011 Anton Altaparmakov and Tuxera Inc. 4 + * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc. 5 5 * Copyright (c) 2001,2002 Richard Russon 6 6 * 7 7 * This program/include file is free software; you can redistribute it and/or ··· 1239 1239 { 1240 1240 MFT_REF mref; 1241 1241 struct inode *vi; 1242 - ntfs_inode *ni; 1243 1242 struct page *page; 1244 1243 u32 *kaddr, *kend; 1245 1244 ntfs_name *name = NULL; ··· 1289 1290 "is not the system volume.", i_size_read(vi)); 1290 1291 goto iput_out; 1291 1292 } 1292 - ni = NTFS_I(vi); 1293 1293 page = ntfs_map_page(vi->i_mapping, 0); 1294 1294 if (IS_ERR(page)) { 1295 1295 ntfs_error(vol->sb, "Failed to read from hiberfil.sys.");
+1 -1
fs/ocfs2/namei.c
··· 1053 1053 handle_t *handle = NULL; 1054 1054 struct buffer_head *old_dir_bh = NULL; 1055 1055 struct buffer_head *new_dir_bh = NULL; 1056 - nlink_t old_dir_nlink = old_dir->i_nlink; 1056 + u32 old_dir_nlink = old_dir->i_nlink; 1057 1057 struct ocfs2_dinode *old_di; 1058 1058 struct ocfs2_dir_lookup_result old_inode_dot_dot_res = { NULL, }; 1059 1059 struct ocfs2_dir_lookup_result target_lookup_res = { NULL, };
+21 -3
fs/quota/quota.c
··· 292 292 } 293 293 } 294 294 295 + /* Return 1 if 'cmd' will block on frozen filesystem */ 296 + static int quotactl_cmd_write(int cmd) 297 + { 298 + switch (cmd) { 299 + case Q_GETFMT: 300 + case Q_GETINFO: 301 + case Q_SYNC: 302 + case Q_XGETQSTAT: 303 + case Q_XGETQUOTA: 304 + case Q_XQUOTASYNC: 305 + return 0; 306 + } 307 + return 1; 308 + } 309 + 295 310 /* 296 311 * look up a superblock on which quota ops will be performed 297 312 * - use the name of a block device to find the superblock thereon 298 313 */ 299 - static struct super_block *quotactl_block(const char __user *special) 314 + static struct super_block *quotactl_block(const char __user *special, int cmd) 300 315 { 301 316 #ifdef CONFIG_BLOCK 302 317 struct block_device *bdev; ··· 324 309 putname(tmp); 325 310 if (IS_ERR(bdev)) 326 311 return ERR_CAST(bdev); 327 - sb = get_super(bdev); 312 + if (quotactl_cmd_write(cmd)) 313 + sb = get_super_thawed(bdev); 314 + else 315 + sb = get_super(bdev); 328 316 bdput(bdev); 329 317 if (!sb) 330 318 return ERR_PTR(-ENODEV); ··· 379 361 pathp = &path; 380 362 } 381 363 382 - sb = quotactl_block(special); 364 + sb = quotactl_block(special, cmds); 383 365 if (IS_ERR(sb)) { 384 366 ret = PTR_ERR(sb); 385 367 goto out;
+1 -1
fs/select.c
··· 912 912 } 913 913 914 914 SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, 915 - long, timeout_msecs) 915 + int, timeout_msecs) 916 916 { 917 917 struct timespec end_time, *to = NULL; 918 918 int ret;
+15
fs/signalfd.c
··· 30 30 #include <linux/signalfd.h> 31 31 #include <linux/syscalls.h> 32 32 33 + void signalfd_cleanup(struct sighand_struct *sighand) 34 + { 35 + wait_queue_head_t *wqh = &sighand->signalfd_wqh; 36 + /* 37 + * The lockless check can race with remove_wait_queue() in progress, 38 + * but in this case its caller should run under rcu_read_lock() and 39 + * sighand_cachep is SLAB_DESTROY_BY_RCU, we can safely return. 40 + */ 41 + if (likely(!waitqueue_active(wqh))) 42 + return; 43 + 44 + /* wait_queue_t->func(POLLFREE) should do remove_wait_queue() */ 45 + wake_up_poll(wqh, POLLHUP | POLLFREE); 46 + } 47 + 33 48 struct signalfd_ctx { 34 49 sigset_t sigmask; 35 50 };
+22
fs/super.c
··· 634 634 EXPORT_SYMBOL(get_super); 635 635 636 636 /** 637 + * get_super_thawed - get thawed superblock of a device 638 + * @bdev: device to get the superblock for 639 + * 640 + * Scans the superblock list and finds the superblock of the file system 641 + * mounted on the device. The superblock is returned once it is thawed 642 + * (or immediately if it was not frozen). %NULL is returned if no match 643 + * is found. 644 + */ 645 + struct super_block *get_super_thawed(struct block_device *bdev) 646 + { 647 + while (1) { 648 + struct super_block *s = get_super(bdev); 649 + if (!s || s->s_frozen == SB_UNFROZEN) 650 + return s; 651 + up_read(&s->s_umount); 652 + vfs_check_frozen(s, SB_FREEZE_WRITE); 653 + put_super(s); 654 + } 655 + } 656 + EXPORT_SYMBOL(get_super_thawed); 657 + 658 + /** 637 659 * get_active_super - get an active reference to the superblock of a device 638 660 * @bdev: device to get the superblock for 639 661 *
+12 -12
fs/xfs/xfs_dquot.c
··· 139 139 140 140 if (!d->d_btimer) { 141 141 if ((d->d_blk_softlimit && 142 - (be64_to_cpu(d->d_bcount) >= 142 + (be64_to_cpu(d->d_bcount) > 143 143 be64_to_cpu(d->d_blk_softlimit))) || 144 144 (d->d_blk_hardlimit && 145 - (be64_to_cpu(d->d_bcount) >= 145 + (be64_to_cpu(d->d_bcount) > 146 146 be64_to_cpu(d->d_blk_hardlimit)))) { 147 147 d->d_btimer = cpu_to_be32(get_seconds() + 148 148 mp->m_quotainfo->qi_btimelimit); ··· 151 151 } 152 152 } else { 153 153 if ((!d->d_blk_softlimit || 154 - (be64_to_cpu(d->d_bcount) < 154 + (be64_to_cpu(d->d_bcount) <= 155 155 be64_to_cpu(d->d_blk_softlimit))) && 156 156 (!d->d_blk_hardlimit || 157 - (be64_to_cpu(d->d_bcount) < 157 + (be64_to_cpu(d->d_bcount) <= 158 158 be64_to_cpu(d->d_blk_hardlimit)))) { 159 159 d->d_btimer = 0; 160 160 } ··· 162 162 163 163 if (!d->d_itimer) { 164 164 if ((d->d_ino_softlimit && 165 - (be64_to_cpu(d->d_icount) >= 165 + (be64_to_cpu(d->d_icount) > 166 166 be64_to_cpu(d->d_ino_softlimit))) || 167 167 (d->d_ino_hardlimit && 168 - (be64_to_cpu(d->d_icount) >= 168 + (be64_to_cpu(d->d_icount) > 169 169 be64_to_cpu(d->d_ino_hardlimit)))) { 170 170 d->d_itimer = cpu_to_be32(get_seconds() + 171 171 mp->m_quotainfo->qi_itimelimit); ··· 174 174 } 175 175 } else { 176 176 if ((!d->d_ino_softlimit || 177 - (be64_to_cpu(d->d_icount) < 177 + (be64_to_cpu(d->d_icount) <= 178 178 be64_to_cpu(d->d_ino_softlimit))) && 179 179 (!d->d_ino_hardlimit || 180 - (be64_to_cpu(d->d_icount) < 180 + (be64_to_cpu(d->d_icount) <= 181 181 be64_to_cpu(d->d_ino_hardlimit)))) { 182 182 d->d_itimer = 0; 183 183 } ··· 185 185 186 186 if (!d->d_rtbtimer) { 187 187 if ((d->d_rtb_softlimit && 188 - (be64_to_cpu(d->d_rtbcount) >= 188 + (be64_to_cpu(d->d_rtbcount) > 189 189 be64_to_cpu(d->d_rtb_softlimit))) || 190 190 (d->d_rtb_hardlimit && 191 - (be64_to_cpu(d->d_rtbcount) >= 191 + (be64_to_cpu(d->d_rtbcount) > 192 192 be64_to_cpu(d->d_rtb_hardlimit)))) { 193 193 d->d_rtbtimer = cpu_to_be32(get_seconds() + 194 194 mp->m_quotainfo->qi_rtbtimelimit); ··· 197 197 } 198 198 } else { 199 199 if ((!d->d_rtb_softlimit || 200 - (be64_to_cpu(d->d_rtbcount) < 200 + (be64_to_cpu(d->d_rtbcount) <= 201 201 be64_to_cpu(d->d_rtb_softlimit))) && 202 202 (!d->d_rtb_hardlimit || 203 - (be64_to_cpu(d->d_rtbcount) < 203 + (be64_to_cpu(d->d_rtbcount) <= 204 204 be64_to_cpu(d->d_rtb_hardlimit)))) { 205 205 d->d_rtbtimer = 0; 206 206 }
+3 -3
fs/xfs/xfs_log_recover.c
··· 1981 1981 1982 1982 if (!errs && ddq->d_id) { 1983 1983 if (ddq->d_blk_softlimit && 1984 - be64_to_cpu(ddq->d_bcount) >= 1984 + be64_to_cpu(ddq->d_bcount) > 1985 1985 be64_to_cpu(ddq->d_blk_softlimit)) { 1986 1986 if (!ddq->d_btimer) { 1987 1987 if (flags & XFS_QMOPT_DOWARN) ··· 1992 1992 } 1993 1993 } 1994 1994 if (ddq->d_ino_softlimit && 1995 - be64_to_cpu(ddq->d_icount) >= 1995 + be64_to_cpu(ddq->d_icount) > 1996 1996 be64_to_cpu(ddq->d_ino_softlimit)) { 1997 1997 if (!ddq->d_itimer) { 1998 1998 if (flags & XFS_QMOPT_DOWARN) ··· 2003 2003 } 2004 2004 } 2005 2005 if (ddq->d_rtb_softlimit && 2006 - be64_to_cpu(ddq->d_rtbcount) >= 2006 + be64_to_cpu(ddq->d_rtbcount) > 2007 2007 be64_to_cpu(ddq->d_rtb_softlimit)) { 2008 2008 if (!ddq->d_rtbtimer) { 2009 2009 if (flags & XFS_QMOPT_DOWARN)
+2 -2
fs/xfs/xfs_qm_syscalls.c
··· 813 813 (XFS_IS_OQUOTA_ENFORCED(mp) && 814 814 (dst->d_flags & (FS_PROJ_QUOTA | FS_GROUP_QUOTA)))) && 815 815 dst->d_id != 0) { 816 - if (((int) dst->d_bcount >= (int) dst->d_blk_softlimit) && 816 + if (((int) dst->d_bcount > (int) dst->d_blk_softlimit) && 817 817 (dst->d_blk_softlimit > 0)) { 818 818 ASSERT(dst->d_btimer != 0); 819 819 } 820 - if (((int) dst->d_icount >= (int) dst->d_ino_softlimit) && 820 + if (((int) dst->d_icount > (int) dst->d_ino_softlimit) && 821 821 (dst->d_ino_softlimit > 0)) { 822 822 ASSERT(dst->d_itimer != 0); 823 823 }
+2 -2
fs/xfs/xfs_trans.c
··· 1151 1151 { 1152 1152 struct xfs_log_item_desc *lidp; 1153 1153 1154 - ASSERT(lip->li_mountp = tp->t_mountp); 1155 - ASSERT(lip->li_ailp = tp->t_mountp->m_ail); 1154 + ASSERT(lip->li_mountp == tp->t_mountp); 1155 + ASSERT(lip->li_ailp == tp->t_mountp->m_ail); 1156 1156 1157 1157 lidp = kmem_zone_zalloc(xfs_log_item_desc_zone, KM_SLEEP | KM_NOFS); 1158 1158
+6 -4
fs/xfs/xfs_trans_dquot.c
··· 649 649 * nblks. 650 650 */ 651 651 if (hardlimit > 0ULL && 652 - hardlimit <= nblks + *resbcountp) { 652 + hardlimit < nblks + *resbcountp) { 653 653 xfs_quota_warn(mp, dqp, QUOTA_NL_BHARDWARN); 654 654 goto error_return; 655 655 } 656 656 if (softlimit > 0ULL && 657 - softlimit <= nblks + *resbcountp) { 657 + softlimit < nblks + *resbcountp) { 658 658 if ((timer != 0 && get_seconds() > timer) || 659 659 (warns != 0 && warns >= warnlimit)) { 660 660 xfs_quota_warn(mp, dqp, ··· 677 677 if (!softlimit) 678 678 softlimit = q->qi_isoftlimit; 679 679 680 - if (hardlimit > 0ULL && count >= hardlimit) { 680 + if (hardlimit > 0ULL && 681 + hardlimit < ninos + count) { 681 682 xfs_quota_warn(mp, dqp, QUOTA_NL_IHARDWARN); 682 683 goto error_return; 683 684 } 684 - if (softlimit > 0ULL && count >= softlimit) { 685 + if (softlimit > 0ULL && 686 + softlimit < ninos + count) { 685 687 if ((timer != 0 && get_seconds() > timer) || 686 688 (warns != 0 && warns >= warnlimit)) { 687 689 xfs_quota_warn(mp, dqp,
+28
include/asm-generic/io-64-nonatomic-hi-lo.h
··· 1 + #ifndef _ASM_IO_64_NONATOMIC_HI_LO_H_ 2 + #define _ASM_IO_64_NONATOMIC_HI_LO_H_ 3 + 4 + #include <linux/io.h> 5 + #include <asm-generic/int-ll64.h> 6 + 7 + #ifndef readq 8 + static inline __u64 readq(const volatile void __iomem *addr) 9 + { 10 + const volatile u32 __iomem *p = addr; 11 + u32 low, high; 12 + 13 + high = readl(p + 1); 14 + low = readl(p); 15 + 16 + return low + ((u64)high << 32); 17 + } 18 + #endif 19 + 20 + #ifndef writeq 21 + static inline void writeq(__u64 val, volatile void __iomem *addr) 22 + { 23 + writel(val >> 32, addr + 4); 24 + writel(val, addr); 25 + } 26 + #endif 27 + 28 + #endif /* _ASM_IO_64_NONATOMIC_HI_LO_H_ */
+28
include/asm-generic/io-64-nonatomic-lo-hi.h
··· 1 + #ifndef _ASM_IO_64_NONATOMIC_LO_HI_H_ 2 + #define _ASM_IO_64_NONATOMIC_LO_HI_H_ 3 + 4 + #include <linux/io.h> 5 + #include <asm-generic/int-ll64.h> 6 + 7 + #ifndef readq 8 + static inline __u64 readq(const volatile void __iomem *addr) 9 + { 10 + const volatile u32 __iomem *p = addr; 11 + u32 low, high; 12 + 13 + low = readl(p); 14 + high = readl(p + 1); 15 + 16 + return low + ((u64)high << 32); 17 + } 18 + #endif 19 + 20 + #ifndef writeq 21 + static inline void writeq(__u64 val, volatile void __iomem *addr) 22 + { 23 + writel(val, addr); 24 + writel(val >> 32, addr + 4); 25 + } 26 + #endif 27 + 28 + #endif /* _ASM_IO_64_NONATOMIC_LO_HI_H_ */
+1 -1
include/asm-generic/iomap.h
··· 70 70 /* Destroy a virtual mapping cookie for a PCI BAR (memory or IO) */ 71 71 struct pci_dev; 72 72 extern void pci_iounmap(struct pci_dev *dev, void __iomem *); 73 - #else 73 + #elif defined(CONFIG_GENERIC_IOMAP) 74 74 struct pci_dev; 75 75 static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) 76 76 { }
+1 -1
include/asm-generic/pci_iomap.h
··· 25 25 #define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr)) 26 26 #endif 27 27 28 - #else 28 + #elif defined(CONFIG_GENERIC_PCI_IOMAP) 29 29 static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) 30 30 { 31 31 return NULL;
+2
include/asm-generic/poll.h
··· 28 28 #define POLLRDHUP 0x2000 29 29 #endif 30 30 31 + #define POLLFREE 0x4000 /* currently only for epoll */ 32 + 31 33 struct pollfd { 32 34 int fd; 33 35 short events;
+1
include/drm/Kbuild
··· 2 2 header-y += drm_fourcc.h 3 3 header-y += drm_mode.h 4 4 header-y += drm_sarea.h 5 + header-y += exynos_drm.h 5 6 header-y += i810_drm.h 6 7 header-y += i915_drm.h 7 8 header-y += mga_drm.h
+19 -3
include/drm/exynos_drm.h
··· 97 97 #define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS DRM_IOWR(DRM_COMMAND_BASE + \ 98 98 DRM_EXYNOS_PLANE_SET_ZPOS, struct drm_exynos_plane_set_zpos) 99 99 100 + #ifdef __KERNEL__ 101 + 102 + /** 103 + * A structure for lcd panel information. 104 + * 105 + * @timing: default video mode for initializing 106 + * @width_mm: physical size of lcd width. 107 + * @height_mm: physical size of lcd height. 108 + */ 109 + struct exynos_drm_panel_info { 110 + struct fb_videomode timing; 111 + u32 width_mm; 112 + u32 height_mm; 113 + }; 114 + 100 115 /** 101 116 * Platform Specific Structure for DRM based FIMD. 102 117 * 103 - * @timing: default video mode for initializing 118 + * @panel: default panel info for initializing 104 119 * @default_win: default window layer number to be used for UI. 105 120 * @bpp: default bit per pixel. 106 121 */ 107 122 struct exynos_drm_fimd_pdata { 108 - struct fb_videomode timing; 123 + struct exynos_drm_panel_info panel; 109 124 u32 vidcon0; 110 125 u32 vidcon1; 111 126 unsigned int default_win; ··· 154 139 unsigned int bpp; 155 140 }; 156 141 157 - #endif 142 + #endif /* __KERNEL__ */ 143 + #endif /* _EXYNOS_DRM_H_ */
+4
include/linux/compat.h
··· 561 561 unsigned long liovcnt, const struct compat_iovec __user *rvec, 562 562 unsigned long riovcnt, unsigned long flags); 563 563 564 + #else 565 + 566 + #define is_compat_task() (0) 567 + 564 568 #endif /* CONFIG_COMPAT */ 565 569 #endif /* _LINUX_COMPAT_H */
+7 -14
include/linux/dcache.h
··· 54 54 static inline int dentry_cmp(const unsigned char *cs, size_t scount, 55 55 const unsigned char *ct, size_t tcount) 56 56 { 57 - int ret; 58 57 if (scount != tcount) 59 58 return 1; 59 + 60 60 do { 61 - ret = (*cs != *ct); 62 - if (ret) 63 - break; 61 + if (*cs != *ct) 62 + return 1; 64 63 cs++; 65 64 ct++; 66 65 tcount--; 67 66 } while (tcount); 68 - return ret; 67 + return 0; 69 68 } 70 69 71 70 /* Name hashing routines. Initial hash value */ ··· 88 89 } 89 90 90 91 /* Compute the hash for a name string. */ 91 - static inline unsigned int 92 - full_name_hash(const unsigned char *name, unsigned int len) 93 - { 94 - unsigned long hash = init_name_hash(); 95 - while (len--) 96 - hash = partial_name_hash(*name++, hash); 97 - return end_name_hash(hash); 98 - } 92 + extern unsigned int full_name_hash(const unsigned char *, unsigned int); 99 93 100 94 /* 101 95 * Try to keep struct dentry aligned on 64 byte cachelines (this will ··· 301 309 extern struct dentry *d_lookup(struct dentry *, struct qstr *); 302 310 extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *); 303 311 extern struct dentry *__d_lookup(struct dentry *, struct qstr *); 304 - extern struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name, 312 + extern struct dentry *__d_lookup_rcu(const struct dentry *parent, 313 + const struct qstr *name, 305 314 unsigned *seq, struct inode **inode); 306 315 307 316 /**
+2 -2
include/linux/digsig.h
··· 30 30 31 31 struct pubkey_hdr { 32 32 uint8_t version; /* key format version */ 33 - time_t timestamp; /* key made, always 0 for now */ 33 + uint32_t timestamp; /* key made, always 0 for now */ 34 34 uint8_t algo; 35 35 uint8_t nmpi; 36 36 char mpi[0]; ··· 38 38 39 39 struct signature_hdr { 40 40 uint8_t version; /* signature format version */ 41 - time_t timestamp; /* signature made */ 41 + uint32_t timestamp; /* signature made */ 42 42 uint8_t algo; 43 43 uint8_t hash; 44 44 uint8_t keyid[8];
+1
include/linux/fs.h
··· 2496 2496 extern void put_filesystem(struct file_system_type *fs); 2497 2497 extern struct file_system_type *get_fs_type(const char *name); 2498 2498 extern struct super_block *get_super(struct block_device *); 2499 + extern struct super_block *get_super_thawed(struct block_device *); 2499 2500 extern struct super_block *get_active_super(struct block_device *bdev); 2500 2501 extern void drop_super(struct super_block *sb); 2501 2502 extern void iterate_supers(void (*)(struct super_block *, void *), void *);
+1
include/linux/if_link.h
··· 137 137 IFLA_AF_SPEC, 138 138 IFLA_GROUP, /* Group the device belongs to */ 139 139 IFLA_NET_NS_FD, 140 + IFLA_EXT_MASK, /* Extended info mask, VFs, etc */ 140 141 __IFLA_MAX 141 142 }; 142 143
+2 -2
include/linux/netfilter_bridge/ebtables.h
··· 285 285 struct module *me; 286 286 }; 287 287 288 - #define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \ 289 - ~(__alignof__(struct ebt_replace)-1)) 288 + #define EBT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) & \ 289 + ~(__alignof__(struct _xt_align)-1)) 290 290 extern struct ebt_table *ebt_register_table(struct net *net, 291 291 const struct ebt_table *table); 292 292 extern void ebt_unregister_table(struct net *net, struct ebt_table *table);
+1 -1
include/linux/nfs_xdr.h
··· 614 614 size_t acl_len; 615 615 unsigned int acl_pgbase; 616 616 struct page ** acl_pages; 617 - struct page * acl_scratch; 618 617 struct nfs4_sequence_args seq_args; 619 618 }; 620 619 ··· 623 624 size_t acl_len; 624 625 size_t acl_data_offset; 625 626 int acl_flags; 627 + struct page * acl_scratch; 626 628 struct nfs4_sequence_res seq_res; 627 629 }; 628 630
+8 -2
include/linux/regset.h
··· 335 335 { 336 336 const struct user_regset *regset = &view->regsets[setno]; 337 337 338 + if (!regset->get) 339 + return -EOPNOTSUPP; 340 + 338 341 if (!access_ok(VERIFY_WRITE, data, size)) 339 - return -EIO; 342 + return -EFAULT; 340 343 341 344 return regset->get(target, regset, offset, size, NULL, data); 342 345 } ··· 361 358 { 362 359 const struct user_regset *regset = &view->regsets[setno]; 363 360 361 + if (!regset->set) 362 + return -EOPNOTSUPP; 363 + 364 364 if (!access_ok(VERIFY_READ, data, size)) 365 - return -EIO; 365 + return -EFAULT; 366 366 367 367 return regset->set(target, regset, offset, size, NULL, data); 368 368 }
+3
include/linux/rtnetlink.h
··· 602 602 #define TCA_ACT_TAB 1 /* attr type must be >=1 */ 603 603 #define TCAA_MAX 1 604 604 605 + /* New extended info filters for IFLA_EXT_MASK */ 606 + #define RTEXT_FILTER_VF (1 << 0) 607 + 605 608 /* End of information exported to user level */ 606 609 607 610 #ifdef __KERNEL__
+4 -1
include/linux/signalfd.h
··· 61 61 wake_up(&tsk->sighand->signalfd_wqh); 62 62 } 63 63 64 + extern void signalfd_cleanup(struct sighand_struct *sighand); 65 + 64 66 #else /* CONFIG_SIGNALFD */ 65 67 66 68 static inline void signalfd_notify(struct task_struct *tsk, int sig) { } 69 + 70 + static inline void signalfd_cleanup(struct sighand_struct *sighand) { } 67 71 68 72 #endif /* CONFIG_SIGNALFD */ 69 73 70 74 #endif /* __KERNEL__ */ 71 75 72 76 #endif /* _LINUX_SIGNALFD_H */ 73 -
+10
include/linux/skbuff.h
··· 1465 1465 } 1466 1466 #endif /* NET_SKBUFF_DATA_USES_OFFSET */ 1467 1467 1468 + static inline void skb_mac_header_rebuild(struct sk_buff *skb) 1469 + { 1470 + if (skb_mac_header_was_set(skb)) { 1471 + const unsigned char *old_mac = skb_mac_header(skb); 1472 + 1473 + skb_set_mac_header(skb, -skb->mac_len); 1474 + memmove(skb_mac_header(skb), old_mac, skb->mac_len); 1475 + } 1476 + } 1477 + 1468 1478 static inline int skb_checksum_start_offset(const struct sk_buff *skb) 1469 1479 { 1470 1480 return skb->csum_start - skb_headroom(skb);
+1 -1
include/linux/syscalls.h
··· 624 624 asmlinkage long sys_socketcall(int call, unsigned long __user *args); 625 625 asmlinkage long sys_listen(int, int); 626 626 asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, 627 - long timeout); 627 + int timeout); 628 628 asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, 629 629 fd_set __user *exp, struct timeval __user *tvp); 630 630 asmlinkage long sys_old_select(struct sel_arg_struct __user *arg);
+2 -8
include/linux/usb/ch11.h
··· 61 61 #define USB_PORT_FEAT_TEST 21 62 62 #define USB_PORT_FEAT_INDICATOR 22 63 63 #define USB_PORT_FEAT_C_PORT_L1 23 64 - #define USB_PORT_FEAT_C_PORT_LINK_STATE 25 65 - #define USB_PORT_FEAT_C_PORT_CONFIG_ERROR 26 66 - #define USB_PORT_FEAT_PORT_REMOTE_WAKE_MASK 27 67 - #define USB_PORT_FEAT_BH_PORT_RESET 28 68 - #define USB_PORT_FEAT_C_BH_PORT_RESET 29 69 - #define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30 70 64 71 65 /* 72 66 * Port feature selectors added by USB 3.0 spec. ··· 69 75 #define USB_PORT_FEAT_LINK_STATE 5 70 76 #define USB_PORT_FEAT_U1_TIMEOUT 23 71 77 #define USB_PORT_FEAT_U2_TIMEOUT 24 72 - #define USB_PORT_FEAT_C_LINK_STATE 25 73 - #define USB_PORT_FEAT_C_CONFIG_ERR 26 78 + #define USB_PORT_FEAT_C_PORT_LINK_STATE 25 79 + #define USB_PORT_FEAT_C_PORT_CONFIG_ERROR 26 74 80 #define USB_PORT_FEAT_REMOTE_WAKE_MASK 27 75 81 #define USB_PORT_FEAT_BH_PORT_RESET 28 76 82 #define USB_PORT_FEAT_C_BH_PORT_RESET 29
+2
include/net/bluetooth/bluetooth.h
··· 256 256 int sco_init(void); 257 257 void sco_exit(void); 258 258 259 + void bt_sock_reclassify_lock(struct sock *sk, int proto); 260 + 259 261 #endif /* __BLUETOOTH_H */
+3 -3
include/net/bluetooth/hci_core.h
··· 540 540 static inline void hci_conn_hold(struct hci_conn *conn) 541 541 { 542 542 atomic_inc(&conn->refcnt); 543 - cancel_delayed_work_sync(&conn->disc_work); 543 + cancel_delayed_work(&conn->disc_work); 544 544 } 545 545 546 546 static inline void hci_conn_put(struct hci_conn *conn) ··· 559 559 } else { 560 560 timeo = msecs_to_jiffies(10); 561 561 } 562 - cancel_delayed_work_sync(&conn->disc_work); 562 + cancel_delayed_work(&conn->disc_work); 563 563 queue_delayed_work(conn->hdev->workqueue, 564 - &conn->disc_work, jiffies + timeo); 564 + &conn->disc_work, timeo); 565 565 } 566 566 } 567 567
+6 -6
include/net/bluetooth/l2cap.h
··· 611 611 { 612 612 BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout); 613 613 614 - if (!__cancel_delayed_work(work)) 614 + if (!cancel_delayed_work(work)) 615 615 l2cap_chan_hold(chan); 616 616 schedule_delayed_work(work, timeout); 617 617 } ··· 619 619 static inline void l2cap_clear_timer(struct l2cap_chan *chan, 620 620 struct delayed_work *work) 621 621 { 622 - if (__cancel_delayed_work(work)) 622 + if (cancel_delayed_work(work)) 623 623 l2cap_chan_put(chan); 624 624 } 625 625 626 626 #define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) 627 627 #define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer) 628 628 #define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \ 629 - L2CAP_DEFAULT_RETRANS_TO); 629 + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); 630 630 #define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer) 631 631 #define __set_monitor_timer(c) l2cap_set_timer(c, &c->monitor_timer, \ 632 - L2CAP_DEFAULT_MONITOR_TO); 632 + msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); 633 633 #define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer) 634 634 #define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \ 635 - L2CAP_DEFAULT_ACK_TO); 635 + msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); 636 636 #define __clear_ack_timer(c) l2cap_clear_timer(c, &c->ack_timer) 637 637 638 638 static inline int __seq_offset(struct l2cap_chan *chan, __u16 seq1, __u16 seq2) ··· 834 834 struct l2cap_chan *l2cap_chan_create(struct sock *sk); 835 835 void l2cap_chan_close(struct l2cap_chan *chan, int reason); 836 836 void l2cap_chan_destroy(struct l2cap_chan *chan); 837 - inline int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, 837 + int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, 838 838 bdaddr_t *dst); 839 839 int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, 840 840 u32 priority);
+1 -1
include/net/netfilter/nf_conntrack.h
··· 209 209 __nf_conntrack_find(struct net *net, u16 zone, 210 210 const struct nf_conntrack_tuple *tuple); 211 211 212 - extern void nf_conntrack_hash_insert(struct nf_conn *ct); 212 + extern int nf_conntrack_hash_check_insert(struct nf_conn *ct); 213 213 extern void nf_ct_delete_from_lists(struct nf_conn *ct); 214 214 extern void nf_ct_insert_dying_list(struct nf_conn *ct); 215 215
+1 -1
include/net/rtnetlink.h
··· 6 6 7 7 typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *); 8 8 typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *); 9 - typedef u16 (*rtnl_calcit_func)(struct sk_buff *); 9 + typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *); 10 10 11 11 extern int __rtnl_register(int protocol, int msgtype, 12 12 rtnl_doit_func, rtnl_dumpit_func,
-50
include/trace/events/sched.h
··· 370 370 (unsigned long long)__entry->vruntime) 371 371 ); 372 372 373 - #ifdef CREATE_TRACE_POINTS 374 - static inline u64 trace_get_sleeptime(struct task_struct *tsk) 375 - { 376 - #ifdef CONFIG_SCHEDSTATS 377 - u64 block, sleep; 378 - 379 - block = tsk->se.statistics.block_start; 380 - sleep = tsk->se.statistics.sleep_start; 381 - tsk->se.statistics.block_start = 0; 382 - tsk->se.statistics.sleep_start = 0; 383 - 384 - return block ? block : sleep ? sleep : 0; 385 - #else 386 - return 0; 387 - #endif 388 - } 389 - #endif 390 - 391 - /* 392 - * Tracepoint for accounting sleeptime (time the task is sleeping 393 - * or waiting for I/O). 394 - */ 395 - TRACE_EVENT(sched_stat_sleeptime, 396 - 397 - TP_PROTO(struct task_struct *tsk, u64 now), 398 - 399 - TP_ARGS(tsk, now), 400 - 401 - TP_STRUCT__entry( 402 - __array( char, comm, TASK_COMM_LEN ) 403 - __field( pid_t, pid ) 404 - __field( u64, sleeptime ) 405 - ), 406 - 407 - TP_fast_assign( 408 - memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); 409 - __entry->pid = tsk->pid; 410 - __entry->sleeptime = trace_get_sleeptime(tsk); 411 - __entry->sleeptime = __entry->sleeptime ? 412 - now - __entry->sleeptime : 0; 413 - ) 414 - TP_perf_assign( 415 - __perf_count(__entry->sleeptime); 416 - ), 417 - 418 - TP_printk("comm=%s pid=%d sleeptime=%Lu [ns]", 419 - __entry->comm, __entry->pid, 420 - (unsigned long long)__entry->sleeptime) 421 - ); 422 - 423 373 /* 424 374 * Tracepoint for showing priority inheritance modifying a tasks 425 375 * priority.
+2 -2
kernel/events/hw_breakpoint.c
··· 651 651 652 652 err_alloc: 653 653 for_each_possible_cpu(err_cpu) { 654 - if (err_cpu == cpu) 655 - break; 656 654 for (i = 0; i < TYPE_MAX; i++) 657 655 kfree(per_cpu(nr_task_bp_pinned[i], cpu)); 656 + if (err_cpu == cpu) 657 + break; 658 658 } 659 659 660 660 return -ENOMEM;
+4 -1
kernel/fork.c
··· 66 66 #include <linux/user-return-notifier.h> 67 67 #include <linux/oom.h> 68 68 #include <linux/khugepaged.h> 69 + #include <linux/signalfd.h> 69 70 70 71 #include <asm/pgtable.h> 71 72 #include <asm/pgalloc.h> ··· 936 935 937 936 void __cleanup_sighand(struct sighand_struct *sighand) 938 937 { 939 - if (atomic_dec_and_test(&sighand->count)) 938 + if (atomic_dec_and_test(&sighand->count)) { 939 + signalfd_cleanup(sighand); 940 940 kmem_cache_free(sighand_cachep, sighand); 941 + } 941 942 } 942 943 943 944
+2 -2
kernel/irq/autoprobe.c
··· 53 53 if (desc->irq_data.chip->irq_set_type) 54 54 desc->irq_data.chip->irq_set_type(&desc->irq_data, 55 55 IRQ_TYPE_PROBE); 56 - irq_startup(desc); 56 + irq_startup(desc, false); 57 57 } 58 58 raw_spin_unlock_irq(&desc->lock); 59 59 } ··· 70 70 raw_spin_lock_irq(&desc->lock); 71 71 if (!desc->action && irq_settings_can_probe(desc)) { 72 72 desc->istate |= IRQS_AUTODETECT | IRQS_WAITING; 73 - if (irq_startup(desc)) 73 + if (irq_startup(desc, false)) 74 74 desc->istate |= IRQS_PENDING; 75 75 } 76 76 raw_spin_unlock_irq(&desc->lock);
+33 -9
kernel/irq/chip.c
··· 157 157 irqd_set(&desc->irq_data, IRQD_IRQ_MASKED); 158 158 } 159 159 160 - int irq_startup(struct irq_desc *desc) 160 + int irq_startup(struct irq_desc *desc, bool resend) 161 161 { 162 + int ret = 0; 163 + 162 164 irq_state_clr_disabled(desc); 163 165 desc->depth = 0; 164 166 165 167 if (desc->irq_data.chip->irq_startup) { 166 - int ret = desc->irq_data.chip->irq_startup(&desc->irq_data); 168 + ret = desc->irq_data.chip->irq_startup(&desc->irq_data); 167 169 irq_state_clr_masked(desc); 168 - return ret; 170 + } else { 171 + irq_enable(desc); 169 172 } 170 - 171 - irq_enable(desc); 172 - return 0; 173 + if (resend) 174 + check_irq_resend(desc, desc->irq_data.irq); 175 + return ret; 173 176 } 174 177 175 178 void irq_shutdown(struct irq_desc *desc) ··· 333 330 } 334 331 EXPORT_SYMBOL_GPL(handle_simple_irq); 335 332 333 + /* 334 + * Called unconditionally from handle_level_irq() and only for oneshot 335 + * interrupts from handle_fasteoi_irq() 336 + */ 337 + static void cond_unmask_irq(struct irq_desc *desc) 338 + { 339 + /* 340 + * We need to unmask in the following cases: 341 + * - Standard level irq (IRQF_ONESHOT is not set) 342 + * - Oneshot irq which did not wake the thread (caused by a 343 + * spurious interrupt or a primary handler handling it 344 + * completely). 345 + */ 346 + if (!irqd_irq_disabled(&desc->irq_data) && 347 + irqd_irq_masked(&desc->irq_data) && !desc->threads_oneshot) 348 + unmask_irq(desc); 349 + } 350 + 336 351 /** 337 352 * handle_level_irq - Level type irq handler 338 353 * @irq: the interrupt number ··· 383 362 384 363 handle_irq_event(desc); 385 364 386 - if (!irqd_irq_disabled(&desc->irq_data) && !(desc->istate & IRQS_ONESHOT)) 387 - unmask_irq(desc); 365 + cond_unmask_irq(desc); 366 + 388 367 out_unlock: 389 368 raw_spin_unlock(&desc->lock); 390 369 } ··· 437 416 438 417 preflow_handler(desc); 439 418 handle_irq_event(desc); 419 + 420 + if (desc->istate & IRQS_ONESHOT) 421 + cond_unmask_irq(desc); 440 422 441 423 out_eoi: 442 424 desc->irq_data.chip->irq_eoi(&desc->irq_data); ··· 649 625 irq_settings_set_noprobe(desc); 650 626 irq_settings_set_norequest(desc); 651 627 irq_settings_set_nothread(desc); 652 - irq_startup(desc); 628 + irq_startup(desc, true); 653 629 } 654 630 out: 655 631 irq_put_desc_busunlock(desc, flags);
+1 -1
kernel/irq/internals.h
··· 67 67 extern void __disable_irq(struct irq_desc *desc, unsigned int irq, bool susp); 68 68 extern void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume); 69 69 70 - extern int irq_startup(struct irq_desc *desc); 70 + extern int irq_startup(struct irq_desc *desc, bool resend); 71 71 extern void irq_shutdown(struct irq_desc *desc); 72 72 extern void irq_enable(struct irq_desc *desc); 73 73 extern void irq_disable(struct irq_desc *desc);
+1 -1
kernel/irq/manage.c
··· 1027 1027 desc->istate |= IRQS_ONESHOT; 1028 1028 1029 1029 if (irq_settings_can_autoenable(desc)) 1030 - irq_startup(desc); 1030 + irq_startup(desc, true); 1031 1031 else 1032 1032 /* Undo nested disables: */ 1033 1033 desc->depth = 1;
+2 -2
kernel/pid.c
··· 543 543 */ 544 544 void __init pidhash_init(void) 545 545 { 546 - int i, pidhash_size; 546 + unsigned int i, pidhash_size; 547 547 548 548 pid_hash = alloc_large_system_hash("PID", sizeof(*pid_hash), 0, 18, 549 549 HASH_EARLY | HASH_SMALL, 550 550 &pidhash_shift, NULL, 4096); 551 - pidhash_size = 1 << pidhash_shift; 551 + pidhash_size = 1U << pidhash_shift; 552 552 553 553 for (i = 0; i < pidhash_size; i++) 554 554 INIT_HLIST_HEAD(&pid_hash[i]);
+2 -3
kernel/sched/core.c
··· 1932 1932 local_irq_enable(); 1933 1933 #endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */ 1934 1934 finish_lock_switch(rq, prev); 1935 - trace_sched_stat_sleeptime(current, rq->clock); 1936 1935 1937 1936 fire_sched_in_preempt_notifiers(current); 1938 1937 if (mm) ··· 6728 6729 static int cpuset_cpu_active(struct notifier_block *nfb, unsigned long action, 6729 6730 void *hcpu) 6730 6731 { 6731 - switch (action & ~CPU_TASKS_FROZEN) { 6732 + switch (action) { 6732 6733 case CPU_ONLINE: 6733 6734 case CPU_DOWN_FAILED: 6734 6735 cpuset_update_active_cpus(); ··· 6741 6742 static int cpuset_cpu_inactive(struct notifier_block *nfb, unsigned long action, 6742 6743 void *hcpu) 6743 6744 { 6744 - switch (action & ~CPU_TASKS_FROZEN) { 6745 + switch (action) { 6745 6746 case CPU_DOWN_PREPARE: 6746 6747 cpuset_update_active_cpus(); 6747 6748 return NOTIFY_OK;
+2
kernel/sched/fair.c
··· 1003 1003 if (unlikely(delta > se->statistics.sleep_max)) 1004 1004 se->statistics.sleep_max = delta; 1005 1005 1006 + se->statistics.sleep_start = 0; 1006 1007 se->statistics.sum_sleep_runtime += delta; 1007 1008 1008 1009 if (tsk) { ··· 1020 1019 if (unlikely(delta > se->statistics.block_max)) 1021 1020 se->statistics.block_max = delta; 1022 1021 1022 + se->statistics.block_start = 0; 1023 1023 se->statistics.sum_sleep_runtime += delta; 1024 1024 1025 1025 if (tsk) {
+3 -3
mm/memblock.c
··· 99 99 phys_addr_t this_start, this_end, cand; 100 100 u64 i; 101 101 102 - /* align @size to avoid excessive fragmentation on reserved array */ 103 - size = round_up(size, align); 104 - 105 102 /* pump up @end */ 106 103 if (end == MEMBLOCK_ALLOC_ACCESSIBLE) 107 104 end = memblock.current_limit; ··· 727 730 int nid) 728 731 { 729 732 phys_addr_t found; 733 + 734 + /* align @size to avoid excessive fragmentation on reserved array */ 735 + size = round_up(size, align); 730 736 731 737 found = memblock_find_in_range_node(0, max_addr, size, align, nid); 732 738 if (found && !memblock_reserve(found, size))
+4 -1
mm/memcontrol.c
··· 4414 4414 */ 4415 4415 BUG_ON(!thresholds); 4416 4416 4417 + if (!thresholds->primary) 4418 + goto unlock; 4419 + 4417 4420 usage = mem_cgroup_usage(memcg, type == _MEMSWAP); 4418 4421 4419 4422 /* Check if a threshold crossed before removing */ ··· 4465 4462 4466 4463 /* To be sure that nobody uses thresholds */ 4467 4464 synchronize_rcu(); 4468 - 4465 + unlock: 4469 4466 mutex_unlock(&memcg->thresholds_lock); 4470 4467 } 4471 4468
+7 -2
mm/nommu.c
··· 696 696 if (vma->vm_file) { 697 697 mapping = vma->vm_file->f_mapping; 698 698 699 + mutex_lock(&mapping->i_mmap_mutex); 699 700 flush_dcache_mmap_lock(mapping); 700 701 vma_prio_tree_insert(vma, &mapping->i_mmap); 701 702 flush_dcache_mmap_unlock(mapping); 703 + mutex_unlock(&mapping->i_mmap_mutex); 702 704 } 703 705 704 706 /* add the VMA to the tree */ ··· 762 760 if (vma->vm_file) { 763 761 mapping = vma->vm_file->f_mapping; 764 762 763 + mutex_lock(&mapping->i_mmap_mutex); 765 764 flush_dcache_mmap_lock(mapping); 766 765 vma_prio_tree_remove(vma, &mapping->i_mmap); 767 766 flush_dcache_mmap_unlock(mapping); 767 + mutex_unlock(&mapping->i_mmap_mutex); 768 768 } 769 769 770 770 /* remove from the MM's tree and list */ ··· 779 775 780 776 if (vma->vm_next) 781 777 vma->vm_next->vm_prev = vma->vm_prev; 782 - 783 - vma->vm_mm = NULL; 784 778 } 785 779 786 780 /* ··· 2054 2052 high = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; 2055 2053 2056 2054 down_write(&nommu_region_sem); 2055 + mutex_lock(&inode->i_mapping->i_mmap_mutex); 2057 2056 2058 2057 /* search for VMAs that fall within the dead zone */ 2059 2058 vma_prio_tree_foreach(vma, &iter, &inode->i_mapping->i_mmap, ··· 2062 2059 /* found one - only interested if it's shared out of the page 2063 2060 * cache */ 2064 2061 if (vma->vm_flags & VM_SHARED) { 2062 + mutex_unlock(&inode->i_mapping->i_mmap_mutex); 2065 2063 up_write(&nommu_region_sem); 2066 2064 return -ETXTBSY; /* not quite true, but near enough */ 2067 2065 } ··· 2090 2086 } 2091 2087 } 2092 2088 2089 + mutex_unlock(&inode->i_mapping->i_mmap_mutex); 2093 2090 up_write(&nommu_region_sem); 2094 2091 return 0; 2095 2092 }
+1
mm/page_alloc.c
··· 5236 5236 max = ((unsigned long long)nr_all_pages << PAGE_SHIFT) >> 4; 5237 5237 do_div(max, bucketsize); 5238 5238 } 5239 + max = min(max, 0x80000000ULL); 5239 5240 5240 5241 if (numentries > max) 5241 5242 numentries = max;
+6 -4
net/atm/clip.c
··· 46 46 47 47 static struct net_device *clip_devs; 48 48 static struct atm_vcc *atmarpd; 49 - static struct neigh_table clip_tbl; 50 49 static struct timer_list idle_timer; 50 + static const struct neigh_ops clip_neigh_ops; 51 51 52 52 static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip) 53 53 { ··· 123 123 struct atmarp_entry *entry = neighbour_priv(n); 124 124 struct clip_vcc *cv; 125 125 126 + if (n->ops != &clip_neigh_ops) 127 + return 0; 126 128 for (cv = entry->vccs; cv; cv = cv->next) { 127 129 unsigned long exp = cv->last_use + cv->idle_timeout; 128 130 ··· 156 154 157 155 static void idle_timer_check(unsigned long dummy) 158 156 { 159 - write_lock(&clip_tbl.lock); 160 - __neigh_for_each_release(&clip_tbl, neigh_check_cb); 157 + write_lock(&arp_tbl.lock); 158 + __neigh_for_each_release(&arp_tbl, neigh_check_cb); 161 159 mod_timer(&idle_timer, jiffies + CLIP_CHECK_INTERVAL * HZ); 162 - write_unlock(&clip_tbl.lock); 160 + write_unlock(&arp_tbl.lock); 163 161 } 164 162 165 163 static int clip_arp_rcv(struct sk_buff *skb)
+5 -7
net/bluetooth/af_bluetooth.c
··· 71 71 "slock-AF_BLUETOOTH-BTPROTO_AVDTP", 72 72 }; 73 73 74 - static inline void bt_sock_reclassify_lock(struct socket *sock, int proto) 74 + void bt_sock_reclassify_lock(struct sock *sk, int proto) 75 75 { 76 - struct sock *sk = sock->sk; 77 - 78 - if (!sk) 79 - return; 80 - 76 + BUG_ON(!sk); 81 77 BUG_ON(sock_owned_by_user(sk)); 82 78 83 79 sock_lock_init_class_and_name(sk, 84 80 bt_slock_key_strings[proto], &bt_slock_key[proto], 85 81 bt_key_strings[proto], &bt_lock_key[proto]); 86 82 } 83 + EXPORT_SYMBOL(bt_sock_reclassify_lock); 87 84 88 85 int bt_sock_register(int proto, const struct net_proto_family *ops) 89 86 { ··· 142 145 143 146 if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { 144 147 err = bt_proto[proto]->create(net, sock, proto, kern); 145 - bt_sock_reclassify_lock(sock, proto); 148 + if (!err) 149 + bt_sock_reclassify_lock(sock->sk, proto); 146 150 module_put(bt_proto[proto]->owner); 147 151 } 148 152
+4
net/bluetooth/hci_conn.c
··· 635 635 636 636 if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) { 637 637 struct hci_cp_auth_requested cp; 638 + 639 + /* encrypt must be pending if auth is also pending */ 640 + set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend); 641 + 638 642 cp.handle = cpu_to_le16(conn->handle); 639 643 hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED, 640 644 sizeof(cp), &cp);
+2 -1
net/bluetooth/hci_core.c
··· 640 640 /* Reset device */ 641 641 skb_queue_purge(&hdev->cmd_q); 642 642 atomic_set(&hdev->cmd_cnt, 1); 643 - if (!test_bit(HCI_RAW, &hdev->flags)) { 643 + if (!test_bit(HCI_RAW, &hdev->flags) && 644 + test_bit(HCI_QUIRK_NO_RESET, &hdev->quirks)) { 644 645 set_bit(HCI_INIT, &hdev->flags); 645 646 __hci_request(hdev, hci_reset_req, 0, 646 647 msecs_to_jiffies(250));
+14 -10
net/bluetooth/l2cap_core.c
··· 1018 1018 hci_chan_del(conn->hchan); 1019 1019 1020 1020 if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT) 1021 - __cancel_delayed_work(&conn->info_timer); 1021 + cancel_delayed_work_sync(&conn->info_timer); 1022 1022 1023 1023 if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &hcon->pend)) { 1024 - __cancel_delayed_work(&conn->security_timer); 1024 + cancel_delayed_work_sync(&conn->security_timer); 1025 1025 smp_chan_destroy(conn); 1026 1026 } 1027 1027 ··· 1120 1120 return c1; 1121 1121 } 1122 1122 1123 - inline int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, bdaddr_t *dst) 1123 + int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, bdaddr_t *dst) 1124 1124 { 1125 1125 struct sock *sk = chan->sk; 1126 1126 bdaddr_t *src = &bt_sk(sk)->src; ··· 2574 2574 2575 2575 if ((conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT) && 2576 2576 cmd->ident == conn->info_ident) { 2577 - __cancel_delayed_work(&conn->info_timer); 2577 + cancel_delayed_work(&conn->info_timer); 2578 2578 2579 2579 conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE; 2580 2580 conn->info_ident = 0; ··· 2970 2970 2971 2971 default: 2972 2972 sk->sk_err = ECONNRESET; 2973 - __set_chan_timer(chan, L2CAP_DISC_REJ_TIMEOUT); 2973 + __set_chan_timer(chan, 2974 + msecs_to_jiffies(L2CAP_DISC_REJ_TIMEOUT)); 2974 2975 l2cap_send_disconn_req(conn, chan, ECONNRESET); 2975 2976 goto done; 2976 2977 } ··· 3121 3120 conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE) 3122 3121 return 0; 3123 3122 3124 - __cancel_delayed_work(&conn->info_timer); 3123 + cancel_delayed_work(&conn->info_timer); 3125 3124 3126 3125 if (result != L2CAP_IR_SUCCESS) { 3127 3126 conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE; ··· 4479 4478 if (encrypt == 0x00) { 4480 4479 if (chan->sec_level == BT_SECURITY_MEDIUM) { 4481 4480 __clear_chan_timer(chan); 4482 - __set_chan_timer(chan, L2CAP_ENC_TIMEOUT); 4481 + __set_chan_timer(chan, 4482 + msecs_to_jiffies(L2CAP_ENC_TIMEOUT)); 4483 4483 } else if (chan->sec_level == BT_SECURITY_HIGH) 4484 4484 l2cap_chan_close(chan, ECONNREFUSED); 4485 4485 } else { ··· 4501 4499 4502 4500 if (hcon->type == LE_LINK) { 4503 4501 smp_distribute_keys(conn, 0); 4504 - __cancel_delayed_work(&conn->security_timer); 4502 + cancel_delayed_work(&conn->security_timer); 4505 4503 } 4506 4504 4507 4505 rcu_read_lock(); ··· 4548 4546 L2CAP_CONN_REQ, sizeof(req), &req); 4549 4547 } else { 4550 4548 __clear_chan_timer(chan); 4551 - __set_chan_timer(chan, L2CAP_DISC_TIMEOUT); 4549 + __set_chan_timer(chan, 4550 + msecs_to_jiffies(L2CAP_DISC_TIMEOUT)); 4552 4551 } 4553 4552 } else if (chan->state == BT_CONNECT2) { 4554 4553 struct l2cap_conn_rsp rsp; ··· 4569 4566 } 4570 4567 } else { 4571 4568 l2cap_state_change(chan, BT_DISCONN); 4572 - __set_chan_timer(chan, L2CAP_DISC_TIMEOUT); 4569 + __set_chan_timer(chan, 4570 + msecs_to_jiffies(L2CAP_DISC_TIMEOUT)); 4573 4571 res = L2CAP_CR_SEC_BLOCK; 4574 4572 stat = L2CAP_CS_NO_INFO; 4575 4573 }
+3 -1
net/bluetooth/l2cap_sock.c
··· 849 849 if (!sk) 850 850 return NULL; 851 851 852 + bt_sock_reclassify_lock(sk, BTPROTO_L2CAP); 853 + 852 854 l2cap_sock_init(sk, parent); 853 855 854 856 return l2cap_pi(sk)->chan; ··· 1004 1002 INIT_LIST_HEAD(&bt_sk(sk)->accept_q); 1005 1003 1006 1004 sk->sk_destruct = l2cap_sock_destruct; 1007 - sk->sk_sndtimeo = L2CAP_CONN_TIMEOUT; 1005 + sk->sk_sndtimeo = msecs_to_jiffies(L2CAP_CONN_TIMEOUT); 1008 1006 1009 1007 sock_reset_flag(sk, SOCK_ZAPPED); 1010 1008
+12 -6
net/bluetooth/rfcomm/core.c
··· 1164 1164 break; 1165 1165 1166 1166 case BT_DISCONN: 1167 - /* When socket is closed and we are not RFCOMM 1168 - * initiator rfcomm_process_rx already calls 1169 - * rfcomm_session_put() */ 1170 - if (s->sock->sk->sk_state != BT_CLOSED) 1171 - if (list_empty(&s->dlcs)) 1172 - rfcomm_session_put(s); 1167 + /* rfcomm_session_put is called later so don't do 1168 + * anything here otherwise we will mess up the session 1169 + * reference counter: 1170 + * 1171 + * (a) when we are the initiator dlc_unlink will drive 1172 + * the reference counter to 0 (there is no initial put 1173 + * after session_add) 1174 + * 1175 + * (b) when we are not the initiator rfcomm_rx_process 1176 + * will explicitly call put to balance the initial hold 1177 + * done after session add. 1178 + */ 1173 1179 break; 1174 1180 } 1175 1181 }
+2
net/bluetooth/rfcomm/sock.c
··· 956 956 if (!sk) 957 957 goto done; 958 958 959 + bt_sock_reclassify_lock(sk, BTPROTO_RFCOMM); 960 + 959 961 rfcomm_sock_init(sk, parent); 960 962 bacpy(&bt_sk(sk)->src, &src); 961 963 bacpy(&bt_sk(sk)->dst, &dst);
+2
net/core/neighbour.c
··· 826 826 write_unlock_bh(&tbl->lock); 827 827 cond_resched(); 828 828 write_lock_bh(&tbl->lock); 829 + nht = rcu_dereference_protected(tbl->nht, 830 + lockdep_is_held(&tbl->lock)); 829 831 } 830 832 /* Cycle through all hash buckets every base_reachable_time/2 ticks. 831 833 * ARP entry timeouts range from 1/2 base_reachable_time to 3/2
+57 -21
net/core/rtnetlink.c
··· 60 60 }; 61 61 62 62 static DEFINE_MUTEX(rtnl_mutex); 63 - static u16 min_ifinfo_dump_size; 64 63 65 64 void rtnl_lock(void) 66 65 { ··· 723 724 } 724 725 725 726 /* All VF info */ 726 - static inline int rtnl_vfinfo_size(const struct net_device *dev) 727 + static inline int rtnl_vfinfo_size(const struct net_device *dev, 728 + u32 ext_filter_mask) 727 729 { 728 - if (dev->dev.parent && dev_is_pci(dev->dev.parent)) { 729 - 730 + if (dev->dev.parent && dev_is_pci(dev->dev.parent) && 731 + (ext_filter_mask & RTEXT_FILTER_VF)) { 730 732 int num_vfs = dev_num_vf(dev->dev.parent); 731 733 size_t size = nla_total_size(sizeof(struct nlattr)); 732 734 size += nla_total_size(num_vfs * sizeof(struct nlattr)); ··· 766 766 return port_self_size; 767 767 } 768 768 769 - static noinline size_t if_nlmsg_size(const struct net_device *dev) 769 + static noinline size_t if_nlmsg_size(const struct net_device *dev, 770 + u32 ext_filter_mask) 770 771 { 771 772 return NLMSG_ALIGN(sizeof(struct ifinfomsg)) 772 773 + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */ ··· 785 784 + nla_total_size(4) /* IFLA_MASTER */ 786 785 + nla_total_size(1) /* IFLA_OPERSTATE */ 787 786 + nla_total_size(1) /* IFLA_LINKMODE */ 788 - + nla_total_size(4) /* IFLA_NUM_VF */ 789 - + rtnl_vfinfo_size(dev) /* IFLA_VFINFO_LIST */ 787 + + nla_total_size(ext_filter_mask 788 + & RTEXT_FILTER_VF ? 4 : 0) /* IFLA_NUM_VF */ 789 + + rtnl_vfinfo_size(dev, ext_filter_mask) /* IFLA_VFINFO_LIST */ 790 790 + rtnl_port_size(dev) /* IFLA_VF_PORTS + IFLA_PORT_SELF */ 791 791 + rtnl_link_get_size(dev) /* IFLA_LINKINFO */ 792 792 + rtnl_link_get_af_size(dev); /* IFLA_AF_SPEC */ ··· 870 868 871 869 static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, 872 870 int type, u32 pid, u32 seq, u32 change, 873 - unsigned int flags) 871 + unsigned int flags, u32 ext_filter_mask) 874 872 { 875 873 struct ifinfomsg *ifm; 876 874 struct nlmsghdr *nlh; ··· 943 941 goto nla_put_failure; 944 942 copy_rtnl_link_stats64(nla_data(attr), stats); 945 943 946 - if (dev->dev.parent) 944 + if (dev->dev.parent && (ext_filter_mask & RTEXT_FILTER_VF)) 947 945 NLA_PUT_U32(skb, IFLA_NUM_VF, dev_num_vf(dev->dev.parent)); 948 946 949 - if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) { 947 + if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent 948 + && (ext_filter_mask & RTEXT_FILTER_VF)) { 950 949 int i; 951 950 952 951 struct nlattr *vfinfo, *vf; ··· 1051 1048 struct net_device *dev; 1052 1049 struct hlist_head *head; 1053 1050 struct hlist_node *node; 1051 + struct nlattr *tb[IFLA_MAX+1]; 1052 + u32 ext_filter_mask = 0; 1054 1053 1055 1054 s_h = cb->args[0]; 1056 1055 s_idx = cb->args[1]; 1057 1056 1058 1057 rcu_read_lock(); 1059 1058 cb->seq = net->dev_base_seq; 1059 + 1060 + nlmsg_parse(cb->nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX, 1061 + ifla_policy); 1062 + 1063 + if (tb[IFLA_EXT_MASK]) 1064 + ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); 1060 1065 1061 1066 for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) { 1062 1067 idx = 0; ··· 1075 1064 if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK, 1076 1065 NETLINK_CB(cb->skb).pid, 1077 1066 cb->nlh->nlmsg_seq, 0, 1078 - NLM_F_MULTI) <= 0) 1067 + NLM_F_MULTI, 1068 + ext_filter_mask) <= 0) 1079 1069 goto out; 1080 1070 1081 1071 nl_dump_check_consistent(cb, nlmsg_hdr(skb)); ··· 1112 1100 [IFLA_VF_PORTS] = { .type = NLA_NESTED }, 1113 1101 [IFLA_PORT_SELF] = { .type = NLA_NESTED }, 1114 1102 [IFLA_AF_SPEC] = { .type = NLA_NESTED }, 1103 + [IFLA_EXT_MASK] = { .type = NLA_U32 }, 1115 1104 }; 1116 1105 EXPORT_SYMBOL(ifla_policy); 1117 1106 ··· 1522 1509 1523 1510 if (send_addr_notify) 1524 1511 call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); 1525 - min_ifinfo_dump_size = max_t(u16, if_nlmsg_size(dev), 1526 - min_ifinfo_dump_size); 1527 1512 1528 1513 return err; 1529 1514 } ··· 1853 1842 struct net_device *dev = NULL; 1854 1843 struct sk_buff *nskb; 1855 1844 int err; 1845 + u32 ext_filter_mask = 0; 1856 1846 1857 1847 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); 1858 1848 if (err < 0) ··· 1861 1849 1862 1850 if (tb[IFLA_IFNAME]) 1863 1851 nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ); 1852 + 1853 + if (tb[IFLA_EXT_MASK]) 1854 + ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); 1864 1855 1865 1856 ifm = nlmsg_data(nlh); 1866 1857 if (ifm->ifi_index > 0) ··· 1876 1861 if (dev == NULL) 1877 1862 return -ENODEV; 1878 1863 1879 - nskb = nlmsg_new(if_nlmsg_size(dev), GFP_KERNEL); 1864 + nskb = nlmsg_new(if_nlmsg_size(dev, ext_filter_mask), GFP_KERNEL); 1880 1865 if (nskb == NULL) 1881 1866 return -ENOBUFS; 1882 1867 1883 1868 err = rtnl_fill_ifinfo(nskb, dev, RTM_NEWLINK, NETLINK_CB(skb).pid, 1884 - nlh->nlmsg_seq, 0, 0); 1869 + nlh->nlmsg_seq, 0, 0, ext_filter_mask); 1885 1870 if (err < 0) { 1886 1871 /* -EMSGSIZE implies BUG in if_nlmsg_size */ 1887 1872 WARN_ON(err == -EMSGSIZE); ··· 1892 1877 return err; 1893 1878 } 1894 1879 1895 - static u16 rtnl_calcit(struct sk_buff *skb) 1880 + static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh) 1896 1881 { 1882 + struct net *net = sock_net(skb->sk); 1883 + struct net_device *dev; 1884 + struct nlattr *tb[IFLA_MAX+1]; 1885 + u32 ext_filter_mask = 0; 1886 + u16 min_ifinfo_dump_size = 0; 1887 + 1888 + nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX, ifla_policy); 1889 + 1890 + if (tb[IFLA_EXT_MASK]) 1891 + ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); 1892 + 1893 + if (!ext_filter_mask) 1894 + return NLMSG_GOODSIZE; 1895 + /* 1896 + * traverse the list of net devices and compute the minimum 1897 + * buffer size based upon the filter mask. 1898 + */ 1899 + list_for_each_entry(dev, &net->dev_base_head, dev_list) { 1900 + min_ifinfo_dump_size = max_t(u16, min_ifinfo_dump_size, 1901 + if_nlmsg_size(dev, 1902 + ext_filter_mask)); 1903 + } 1904 + 1897 1905 return min_ifinfo_dump_size; 1898 1906 } 1899 1907 ··· 1951 1913 int err = -ENOBUFS; 1952 1914 size_t if_info_size; 1953 1915 1954 - skb = nlmsg_new((if_info_size = if_nlmsg_size(dev)), GFP_KERNEL); 1916 + skb = nlmsg_new((if_info_size = if_nlmsg_size(dev, 0)), GFP_KERNEL); 1955 1917 if (skb == NULL) 1956 1918 goto errout; 1957 1919 1958 - min_ifinfo_dump_size = max_t(u16, if_info_size, min_ifinfo_dump_size); 1959 - 1960 - err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0); 1920 + err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0, 0); 1961 1921 if (err < 0) { 1962 1922 /* -EMSGSIZE implies BUG in if_nlmsg_size() */ 1963 1923 WARN_ON(err == -EMSGSIZE); ··· 2013 1977 return -EOPNOTSUPP; 2014 1978 calcit = rtnl_get_calcit(family, type); 2015 1979 if (calcit) 2016 - min_dump_alloc = calcit(skb); 1980 + min_dump_alloc = calcit(skb, nlh); 2017 1981 2018 1982 __rtnl_unlock(); 2019 1983 rtnl = net->rtnl;
+5 -5
net/ipv4/ip_gre.c
··· 65 65 it is infeasible task. The most general solutions would be 66 66 to keep skb->encapsulation counter (sort of local ttl), 67 67 and silently drop packet when it expires. It is a good 68 - solution, but it supposes maintaing new variable in ALL 68 + solution, but it supposes maintaining new variable in ALL 69 69 skb, even if no tunneling is used. 70 70 71 71 Current solution: xmit_recursion breaks dead loops. This is a percpu ··· 91 91 92 92 One of them is to parse packet trying to detect inner encapsulation 93 93 made by our node. It is difficult or even impossible, especially, 94 - taking into account fragmentation. TO be short, tt is not solution at all. 94 + taking into account fragmentation. TO be short, ttl is not solution at all. 95 95 96 96 Current solution: The solution was UNEXPECTEDLY SIMPLE. 97 97 We force DF flag on tunnels with preconfigured hop limit, 98 98 that is ALL. :-) Well, it does not remove the problem completely, 99 99 but exponential growth of network traffic is changed to linear 100 100 (branches, that exceed pmtu are pruned) and tunnel mtu 101 - fastly degrades to value <68, where looping stops. 101 + rapidly degrades to value <68, where looping stops. 102 102 Yes, it is not good if there exists a router in the loop, 103 103 which does not force DF, even when encapsulating packets have DF set. 104 104 But it is not our problem! Nobody could accuse us, we made ··· 457 457 GRE tunnels with enabled checksum. Tell them "thank you". 458 458 459 459 Well, I wonder, rfc1812 was written by Cisco employee, 460 - what the hell these idiots break standrads established 461 - by themself??? 460 + what the hell these idiots break standards established 461 + by themselves??? 462 462 */ 463 463 464 464 const struct iphdr *iph = (const struct iphdr *)skb->data;
+1
net/ipv4/ping.c
··· 630 630 631 631 pr_debug("ping_recvmsg(sk=%p,sk->num=%u)\n", isk, isk->inet_num); 632 632 633 + err = -EOPNOTSUPP; 633 634 if (flags & MSG_OOB) 634 635 goto out; 635 636
+3 -2
net/ipv4/tcp.c
··· 3240 3240 { 3241 3241 struct sk_buff *skb = NULL; 3242 3242 unsigned long limit; 3243 - int i, max_share, cnt; 3243 + int max_share, cnt; 3244 + unsigned int i; 3244 3245 unsigned long jiffy = jiffies; 3245 3246 3246 3247 BUILD_BUG_ON(sizeof(struct tcp_skb_cb) > sizeof(skb->cb)); ··· 3284 3283 &tcp_hashinfo.bhash_size, 3285 3284 NULL, 3286 3285 64 * 1024); 3287 - tcp_hashinfo.bhash_size = 1 << tcp_hashinfo.bhash_size; 3286 + tcp_hashinfo.bhash_size = 1U << tcp_hashinfo.bhash_size; 3288 3287 for (i = 0; i < tcp_hashinfo.bhash_size; i++) { 3289 3288 spin_lock_init(&tcp_hashinfo.bhash[i].lock); 3290 3289 INIT_HLIST_HEAD(&tcp_hashinfo.bhash[i].chain);
+1 -4
net/ipv4/xfrm4_mode_beet.c
··· 110 110 111 111 skb_push(skb, sizeof(*iph)); 112 112 skb_reset_network_header(skb); 113 - 114 - memmove(skb->data - skb->mac_len, skb_mac_header(skb), 115 - skb->mac_len); 116 - skb_set_mac_header(skb, -skb->mac_len); 113 + skb_mac_header_rebuild(skb); 117 114 118 115 xfrm4_beet_make_header(skb); 119 116
+2 -4
net/ipv4/xfrm4_mode_tunnel.c
··· 66 66 67 67 static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb) 68 68 { 69 - const unsigned char *old_mac; 70 69 int err = -EINVAL; 71 70 72 71 if (XFRM_MODE_SKB_CB(skb)->protocol != IPPROTO_IPIP) ··· 83 84 if (!(x->props.flags & XFRM_STATE_NOECN)) 84 85 ipip_ecn_decapsulate(skb); 85 86 86 - old_mac = skb_mac_header(skb); 87 - skb_set_mac_header(skb, -skb->mac_len); 88 - memmove(skb_mac_header(skb), old_mac, skb->mac_len); 89 87 skb_reset_network_header(skb); 88 + skb_mac_header_rebuild(skb); 89 + 90 90 err = 0; 91 91 92 92 out:
+3 -1
net/ipv6/ip6mr.c
··· 1926 1926 }; 1927 1927 1928 1928 dst = ip6_route_output(net, NULL, &fl6); 1929 - if (!dst) 1929 + if (dst->error) { 1930 + dst_release(dst); 1930 1931 goto out_free; 1932 + } 1931 1933 1932 1934 skb_dst_drop(skb); 1933 1935 skb_dst_set(skb, dst);
+3 -2
net/ipv6/ndisc.c
··· 1545 1545 &saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex); 1546 1546 1547 1547 dst = ip6_route_output(net, NULL, &fl6); 1548 - if (dst == NULL) 1548 + if (dst->error) { 1549 + dst_release(dst); 1549 1550 return; 1550 - 1551 + } 1551 1552 dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0); 1552 1553 if (IS_ERR(dst)) 1553 1554 return;
+1 -5
net/ipv6/xfrm6_mode_beet.c
··· 80 80 static int xfrm6_beet_input(struct xfrm_state *x, struct sk_buff *skb) 81 81 { 82 82 struct ipv6hdr *ip6h; 83 - const unsigned char *old_mac; 84 83 int size = sizeof(struct ipv6hdr); 85 84 int err; 86 85 ··· 89 90 90 91 __skb_push(skb, size); 91 92 skb_reset_network_header(skb); 92 - 93 - old_mac = skb_mac_header(skb); 94 - skb_set_mac_header(skb, -skb->mac_len); 95 - memmove(skb_mac_header(skb), old_mac, skb->mac_len); 93 + skb_mac_header_rebuild(skb); 96 94 97 95 xfrm6_beet_make_header(skb); 98 96
+2 -4
net/ipv6/xfrm6_mode_tunnel.c
··· 63 63 static int xfrm6_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb) 64 64 { 65 65 int err = -EINVAL; 66 - const unsigned char *old_mac; 67 66 68 67 if (XFRM_MODE_SKB_CB(skb)->protocol != IPPROTO_IPV6) 69 68 goto out; ··· 79 80 if (!(x->props.flags & XFRM_STATE_NOECN)) 80 81 ipip6_ecn_decapsulate(skb); 81 82 82 - old_mac = skb_mac_header(skb); 83 - skb_set_mac_header(skb, -skb->mac_len); 84 - memmove(skb_mac_header(skb), old_mac, skb->mac_len); 85 83 skb_reset_network_header(skb); 84 + skb_mac_header_rebuild(skb); 85 + 86 86 err = 0; 87 87 88 88 out:
+2 -2
net/mac80211/debugfs_sta.c
··· 63 63 test_sta_flag(sta, WLAN_STA_##flg) ? #flg "\n" : "" 64 64 65 65 int res = scnprintf(buf, sizeof(buf), 66 - "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", 66 + "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", 67 67 TEST(AUTH), TEST(ASSOC), TEST(PS_STA), 68 68 TEST(PS_DRIVER), TEST(AUTHORIZED), 69 69 TEST(SHORT_PREAMBLE), 70 70 TEST(WME), TEST(WDS), TEST(CLEAR_PS_FILT), 71 71 TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL), 72 72 TEST(UAPSD), TEST(SP), TEST(TDLS_PEER), 73 - TEST(TDLS_PEER_AUTH)); 73 + TEST(TDLS_PEER_AUTH), TEST(RATE_CONTROL)); 74 74 #undef TEST 75 75 return simple_read_from_buffer(userbuf, count, ppos, buf, res); 76 76 }
+1 -1
net/mac80211/rate.c
··· 336 336 int i; 337 337 u32 mask; 338 338 339 - if (sta) { 339 + if (sta && test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) { 340 340 ista = &sta->sta; 341 341 priv_sta = sta->rate_ctrl_priv; 342 342 }
+2 -1
net/mac80211/rate.h
··· 41 41 struct ieee80211_sta *ista = &sta->sta; 42 42 void *priv_sta = sta->rate_ctrl_priv; 43 43 44 - if (!ref) 44 + if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) 45 45 return; 46 46 47 47 ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb); ··· 62 62 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 63 63 64 64 ref->ops->rate_init(ref->priv, sband, ista, priv_sta); 65 + set_sta_flag(sta, WLAN_STA_RATE_CONTROL); 65 66 } 66 67 67 68 static inline void rate_control_rate_update(struct ieee80211_local *local,
+2
net/mac80211/sta_info.h
··· 52 52 * @WLAN_STA_SP: Station is in a service period, so don't try to 53 53 * reply to other uAPSD trigger frames or PS-Poll. 54 54 * @WLAN_STA_4ADDR_EVENT: 4-addr event was already sent for this frame. 55 + * @WLAN_STA_RATE_CONTROL: rate control was initialized for this station. 55 56 */ 56 57 enum ieee80211_sta_info_flags { 57 58 WLAN_STA_AUTH, ··· 72 71 WLAN_STA_UAPSD, 73 72 WLAN_STA_SP, 74 73 WLAN_STA_4ADDR_EVENT, 74 + WLAN_STA_RATE_CONTROL, 75 75 }; 76 76 77 77 enum ieee80211_sta_state {
+1 -1
net/netfilter/ipvs/ip_vs_core.c
··· 232 232 __be16 dport = 0; /* destination port to forward */ 233 233 unsigned int flags; 234 234 struct ip_vs_conn_param param; 235 + const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) }; 235 236 union nf_inet_addr snet; /* source network of the client, 236 237 after masking */ 237 238 ··· 268 267 { 269 268 int protocol = iph.protocol; 270 269 const union nf_inet_addr *vaddr = &iph.daddr; 271 - const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) }; 272 270 __be16 vport = 0; 273 271 274 272 if (dst_port == svc->port) {
+34 -4
net/netfilter/nf_conntrack_core.c
··· 404 404 &net->ct.hash[repl_hash]); 405 405 } 406 406 407 - void nf_conntrack_hash_insert(struct nf_conn *ct) 407 + int 408 + nf_conntrack_hash_check_insert(struct nf_conn *ct) 408 409 { 409 410 struct net *net = nf_ct_net(ct); 410 411 unsigned int hash, repl_hash; 412 + struct nf_conntrack_tuple_hash *h; 413 + struct hlist_nulls_node *n; 411 414 u16 zone; 412 415 413 416 zone = nf_ct_zone(ct); 414 - hash = hash_conntrack(net, zone, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); 415 - repl_hash = hash_conntrack(net, zone, &ct->tuplehash[IP_CT_DIR_REPLY].tuple); 417 + hash = hash_conntrack(net, zone, 418 + &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); 419 + repl_hash = hash_conntrack(net, zone, 420 + &ct->tuplehash[IP_CT_DIR_REPLY].tuple); 416 421 422 + spin_lock_bh(&nf_conntrack_lock); 423 + 424 + /* See if there's one in the list already, including reverse */ 425 + hlist_nulls_for_each_entry(h, n, &net->ct.hash[hash], hnnode) 426 + if (nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple, 427 + &h->tuple) && 428 + zone == nf_ct_zone(nf_ct_tuplehash_to_ctrack(h))) 429 + goto out; 430 + hlist_nulls_for_each_entry(h, n, &net->ct.hash[repl_hash], hnnode) 431 + if (nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_REPLY].tuple, 432 + &h->tuple) && 433 + zone == nf_ct_zone(nf_ct_tuplehash_to_ctrack(h))) 434 + goto out; 435 + 436 + add_timer(&ct->timeout); 437 + nf_conntrack_get(&ct->ct_general); 417 438 __nf_conntrack_hash_insert(ct, hash, repl_hash); 439 + NF_CT_STAT_INC(net, insert); 440 + spin_unlock_bh(&nf_conntrack_lock); 441 + 442 + return 0; 443 + 444 + out: 445 + NF_CT_STAT_INC(net, insert_failed); 446 + spin_unlock_bh(&nf_conntrack_lock); 447 + return -EEXIST; 418 448 } 419 - EXPORT_SYMBOL_GPL(nf_conntrack_hash_insert); 449 + EXPORT_SYMBOL_GPL(nf_conntrack_hash_check_insert); 420 450 421 451 /* Confirm a connection given skb; places it in hash table */ 422 452 int
+16 -30
net/netfilter/nf_conntrack_netlink.c
··· 1367 1367 nf_ct_protonum(ct)); 1368 1368 if (helper == NULL) { 1369 1369 rcu_read_unlock(); 1370 - spin_unlock_bh(&nf_conntrack_lock); 1371 1370 #ifdef CONFIG_MODULES 1372 1371 if (request_module("nfct-helper-%s", helpname) < 0) { 1373 - spin_lock_bh(&nf_conntrack_lock); 1374 1372 err = -EOPNOTSUPP; 1375 1373 goto err1; 1376 1374 } 1377 1375 1378 - spin_lock_bh(&nf_conntrack_lock); 1379 1376 rcu_read_lock(); 1380 1377 helper = __nf_conntrack_helper_find(helpname, 1381 1378 nf_ct_l3num(ct), ··· 1465 1468 if (tstamp) 1466 1469 tstamp->start = ktime_to_ns(ktime_get_real()); 1467 1470 1468 - add_timer(&ct->timeout); 1469 - nf_conntrack_hash_insert(ct); 1471 + err = nf_conntrack_hash_check_insert(ct); 1472 + if (err < 0) 1473 + goto err2; 1474 + 1470 1475 rcu_read_unlock(); 1471 1476 1472 1477 return ct; ··· 1489 1490 struct nf_conntrack_tuple otuple, rtuple; 1490 1491 struct nf_conntrack_tuple_hash *h = NULL; 1491 1492 struct nfgenmsg *nfmsg = nlmsg_data(nlh); 1493 + struct nf_conn *ct; 1492 1494 u_int8_t u3 = nfmsg->nfgen_family; 1493 1495 u16 zone; 1494 1496 int err; ··· 1510 1510 return err; 1511 1511 } 1512 1512 1513 - spin_lock_bh(&nf_conntrack_lock); 1514 1513 if (cda[CTA_TUPLE_ORIG]) 1515 - h = __nf_conntrack_find(net, zone, &otuple); 1514 + h = nf_conntrack_find_get(net, zone, &otuple); 1516 1515 else if (cda[CTA_TUPLE_REPLY]) 1517 - h = __nf_conntrack_find(net, zone, &rtuple); 1516 + h = nf_conntrack_find_get(net, zone, &rtuple); 1518 1517 1519 1518 if (h == NULL) { 1520 1519 err = -ENOENT; 1521 1520 if (nlh->nlmsg_flags & NLM_F_CREATE) { 1522 - struct nf_conn *ct; 1523 1521 enum ip_conntrack_events events; 1524 1522 1525 1523 ct = ctnetlink_create_conntrack(net, zone, cda, &otuple, 1526 1524 &rtuple, u3); 1527 - if (IS_ERR(ct)) { 1528 - err = PTR_ERR(ct); 1529 - goto out_unlock; 1530 - } 1525 + if (IS_ERR(ct)) 1526 + return PTR_ERR(ct); 1527 + 1531 1528 err = 0; 1532 - nf_conntrack_get(&ct->ct_general); 1533 - spin_unlock_bh(&nf_conntrack_lock); 1534 1529 if (test_bit(IPS_EXPECTED_BIT, &ct->status)) 1535 1530 events = IPCT_RELATED; 1536 1531 else ··· 1540 1545 ct, NETLINK_CB(skb).pid, 1541 1546 nlmsg_report(nlh)); 1542 1547 nf_ct_put(ct); 1543 - } else 1544 - spin_unlock_bh(&nf_conntrack_lock); 1548 + } 1545 1549 1546 1550 return err; 1547 1551 } 1548 1552 /* implicit 'else' */ 1549 1553 1550 - /* We manipulate the conntrack inside the global conntrack table lock, 1551 - * so there's no need to increase the refcount */ 1552 1554 err = -EEXIST; 1555 + ct = nf_ct_tuplehash_to_ctrack(h); 1553 1556 if (!(nlh->nlmsg_flags & NLM_F_EXCL)) { 1554 - struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(h); 1555 - 1557 + spin_lock_bh(&nf_conntrack_lock); 1556 1558 err = ctnetlink_change_conntrack(ct, cda); 1559 + spin_unlock_bh(&nf_conntrack_lock); 1557 1560 if (err == 0) { 1558 - nf_conntrack_get(&ct->ct_general); 1559 - spin_unlock_bh(&nf_conntrack_lock); 1560 1561 nf_conntrack_eventmask_report((1 << IPCT_REPLY) | 1561 1562 (1 << IPCT_ASSURED) | 1562 1563 (1 << IPCT_HELPER) | ··· 1561 1570 (1 << IPCT_MARK), 1562 1571 ct, NETLINK_CB(skb).pid, 1563 1572 nlmsg_report(nlh)); 1564 - nf_ct_put(ct); 1565 - } else 1566 - spin_unlock_bh(&nf_conntrack_lock); 1567 - 1568 - return err; 1573 + } 1569 1574 } 1570 1575 1571 - out_unlock: 1572 - spin_unlock_bh(&nf_conntrack_lock); 1576 + nf_ct_put(ct); 1573 1577 return err; 1574 1578 } 1575 1579
+32 -8
net/netfilter/nf_queue.c
··· 203 203 return status; 204 204 } 205 205 206 + #ifdef CONFIG_BRIDGE_NETFILTER 207 + /* When called from bridge netfilter, skb->data must point to MAC header 208 + * before calling skb_gso_segment(). Else, original MAC header is lost 209 + * and segmented skbs will be sent to wrong destination. 210 + */ 211 + static void nf_bridge_adjust_skb_data(struct sk_buff *skb) 212 + { 213 + if (skb->nf_bridge) 214 + __skb_push(skb, skb->network_header - skb->mac_header); 215 + } 216 + 217 + static void nf_bridge_adjust_segmented_data(struct sk_buff *skb) 218 + { 219 + if (skb->nf_bridge) 220 + __skb_pull(skb, skb->network_header - skb->mac_header); 221 + } 222 + #else 223 + #define nf_bridge_adjust_skb_data(s) do {} while (0) 224 + #define nf_bridge_adjust_segmented_data(s) do {} while (0) 225 + #endif 226 + 206 227 int nf_queue(struct sk_buff *skb, 207 228 struct list_head *elem, 208 229 u_int8_t pf, unsigned int hook, ··· 233 212 unsigned int queuenum) 234 213 { 235 214 struct sk_buff *segs; 236 - int err; 215 + int err = -EINVAL; 237 216 unsigned int queued; 238 217 239 218 if (!skb_is_gso(skb)) ··· 249 228 break; 250 229 } 251 230 231 + nf_bridge_adjust_skb_data(skb); 252 232 segs = skb_gso_segment(skb, 0); 253 233 /* Does not use PTR_ERR to limit the number of error codes that can be 254 234 * returned by nf_queue. For instance, callers rely on -ECANCELED to mean 255 235 * 'ignore this hook'. 256 236 */ 257 237 if (IS_ERR(segs)) 258 - return -EINVAL; 259 - 238 + goto out_err; 260 239 queued = 0; 261 240 err = 0; 262 241 do { 263 242 struct sk_buff *nskb = segs->next; 264 243 265 244 segs->next = NULL; 266 - if (err == 0) 245 + if (err == 0) { 246 + nf_bridge_adjust_segmented_data(segs); 267 247 err = __nf_queue(segs, elem, pf, hook, indev, 268 248 outdev, okfn, queuenum); 249 + } 269 250 if (err == 0) 270 251 queued++; 271 252 else ··· 275 252 segs = nskb; 276 253 } while (segs); 277 254 278 - /* also free orig skb if only some segments were queued */ 279 - if (unlikely(err && queued)) 280 - err = 0; 281 - if (err == 0) 255 + if (queued) { 282 256 kfree_skb(skb); 257 + return 0; 258 + } 259 + out_err: 260 + nf_bridge_adjust_segmented_data(skb); 283 261 return err; 284 262 } 285 263
+3 -2
net/netfilter/xt_TEE.c
··· 152 152 fl6.flowlabel = ((iph->flow_lbl[0] & 0xF) << 16) | 153 153 (iph->flow_lbl[1] << 8) | iph->flow_lbl[2]; 154 154 dst = ip6_route_output(net, NULL, &fl6); 155 - if (dst == NULL) 155 + if (dst->error) { 156 + dst_release(dst); 156 157 return false; 157 - 158 + } 158 159 skb_dst_drop(skb); 159 160 skb_dst_set(skb, dst); 160 161 skb->dev = dst->dev;
+2 -4
net/sched/sch_netem.c
··· 501 501 502 502 /* if more time remaining? */ 503 503 if (cb->time_to_send <= psched_get_time()) { 504 - skb = qdisc_dequeue_tail(sch); 505 - if (unlikely(!skb)) 506 - goto qdisc_dequeue; 504 + __skb_unlink(skb, &sch->q); 505 + sch->qstats.backlog -= qdisc_pkt_len(skb); 507 506 508 507 #ifdef CONFIG_NET_CLS_ACT 509 508 /* ··· 538 539 qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send); 539 540 } 540 541 541 - qdisc_dequeue: 542 542 if (q->qdisc) { 543 543 skb = q->qdisc->ops->dequeue(q->qdisc); 544 544 if (skb)
+4 -9
scripts/coccicheck
··· 9 9 # FLAGS="-ignore_unknown_options -very_quiet" 10 10 # OPTIONS=$* 11 11 12 - if [ "$KBUILD_EXTMOD" = "" ] ; then 13 - # Workaround for Coccinelle < 0.2.3 14 - FLAGS="-I $srctree/include -very_quiet" 15 - shift $(( $# - 1 )) 16 - OPTIONS=$1 17 - else 18 - echo M= is not currently supported when C=1 or C=2 19 - exit 1 20 - fi 12 + # Workaround for Coccinelle < 0.2.3 13 + FLAGS="-I $srctree/include -very_quiet" 14 + shift $(( $# - 1 )) 15 + OPTIONS=$1 21 16 else 22 17 ONLINE=0 23 18 FLAGS="-very_quiet"
-6
scripts/depmod.sh
··· 9 9 DEPMOD=$1 10 10 KERNELRELEASE=$2 11 11 12 - if ! "$DEPMOD" -V 2>/dev/null | grep -q module-init-tools; then 13 - echo "Warning: you may need to install module-init-tools" >&2 14 - echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt" >&2 15 - sleep 1 16 - fi 17 - 18 12 if ! test -r System.map -a -x "$DEPMOD"; then 19 13 exit 0 20 14 fi
+31 -4
scripts/mod/file2alias.c
··· 46 46 void *function; 47 47 }; 48 48 49 + #define ___cat(a,b) a ## b 50 + #define __cat(a,b) ___cat(a,b) 51 + 52 + /* we need some special handling for this host tool running eventually on 53 + * Darwin. The Mach-O section handling is a bit different than ELF section 54 + * handling. The differnces in detail are: 55 + * a) we have segments which have sections 56 + * b) we need a API call to get the respective section symbols */ 57 + #if defined(__MACH__) 58 + #include <mach-o/getsect.h> 59 + 60 + #define INIT_SECTION(name) do { \ 61 + unsigned long name ## _len; \ 62 + char *__cat(pstart_,name) = getsectdata("__TEXT", \ 63 + #name, &__cat(name,_len)); \ 64 + char *__cat(pstop_,name) = __cat(pstart_,name) + \ 65 + __cat(name, _len); \ 66 + __cat(__start_,name) = (void *)__cat(pstart_,name); \ 67 + __cat(__stop_,name) = (void *)__cat(pstop_,name); \ 68 + } while (0) 69 + #define SECTION(name) __attribute__((section("__TEXT, " #name))) 70 + 71 + struct devtable **__start___devtable, **__stop___devtable; 72 + #else 73 + #define INIT_SECTION(name) /* no-op for ELF */ 74 + #define SECTION(name) __attribute__((section(#name))) 75 + 49 76 /* We construct a table of pointers in an ELF section (pointers generally 50 77 * go unpadded by gcc). ld creates boundary syms for us. */ 51 78 extern struct devtable *__start___devtable[], *__stop___devtable[]; 52 - #define ___cat(a,b) a ## b 53 - #define __cat(a,b) ___cat(a,b) 79 + #endif /* __MACH__ */ 54 80 55 81 #if __GNUC__ == 3 && __GNUC_MINOR__ < 3 56 82 # define __used __attribute__((__unused__)) ··· 91 65 (type *)NULL, \ 92 66 (char *)NULL)), \ 93 67 sizeof(type), (function) }; \ 94 - static struct devtable *__attribute__((section("__devtable"))) \ 95 - __used __cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__) 68 + static struct devtable *SECTION(__devtable) __used \ 69 + __cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__) 96 70 97 71 #define ADD(str, sep, cond, field) \ 98 72 do { \ ··· 1106 1080 do_pnp_card_entries(symval, sym->st_size, mod); 1107 1081 else { 1108 1082 struct devtable **p; 1083 + INIT_SECTION(__devtable); 1109 1084 1110 1085 for (p = __start___devtable; p < __stop___devtable; p++) { 1111 1086 if (sym_is(name, namelen, (*p)->device_id)) {
+9
scripts/mod/modpost.c
··· 1494 1494 return 0; 1495 1495 } 1496 1496 1497 + #ifndef R_ARM_CALL 1498 + #define R_ARM_CALL 28 1499 + #endif 1500 + #ifndef R_ARM_JUMP24 1501 + #define R_ARM_JUMP24 29 1502 + #endif 1503 + 1497 1504 static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) 1498 1505 { 1499 1506 unsigned int r_typ = ELF_R_TYPE(r->r_info); ··· 1512 1505 (elf->symtab_start + ELF_R_SYM(r->r_info)); 1513 1506 break; 1514 1507 case R_ARM_PC24: 1508 + case R_ARM_CALL: 1509 + case R_ARM_JUMP24: 1515 1510 /* From ARM ABI: ((S + A) | T) - P */ 1516 1511 r->r_addend = (int)(long)(elf->hdr + 1517 1512 sechdr->sh_offset +
+6 -6
scripts/package/builddeb
··· 238 238 fi 239 239 240 240 # Build header package 241 - (cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$) 242 - (cd $srctree; find arch/$SRCARCH/include include scripts -type f >> /tmp/files$$) 243 - (cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$) 241 + (cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles") 242 + (cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles") 243 + (cd $objtree; find .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles") 244 244 destdir=$kernel_headers_dir/usr/src/linux-headers-$version 245 245 mkdir -p "$destdir" 246 - (cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -) 247 - (cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -) 248 - rm -f /tmp/files$$ /tmp/objfiles$$ 246 + (cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -) 247 + (cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -) 248 + rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles" 249 249 arch=$(dpkg --print-architecture) 250 250 251 251 cat <<EOF >> debian/control
+1 -2
sound/pci/azt3328.c
··· 2684 2684 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 2685 2685 if (err < 0) 2686 2686 goto out_err; 2687 + opl3->private_data = chip; 2687 2688 } 2688 - 2689 - opl3->private_data = chip; 2690 2689 2691 2690 sprintf(card->longname, "%s at 0x%lx, irq %i", 2692 2691 card->shortname, chip->ctrl_io, chip->irq);
+8 -4
sound/pci/hda/hda_codec.c
··· 1759 1759 parm = ch ? AC_AMP_SET_RIGHT : AC_AMP_SET_LEFT; 1760 1760 parm |= direction == HDA_OUTPUT ? AC_AMP_SET_OUTPUT : AC_AMP_SET_INPUT; 1761 1761 parm |= index << AC_AMP_SET_INDEX_SHIFT; 1762 - parm |= val; 1762 + if ((val & HDA_AMP_MUTE) && !(info->amp_caps & AC_AMPCAP_MUTE) && 1763 + (info->amp_caps & AC_AMPCAP_MIN_MUTE)) 1764 + ; /* set the zero value as a fake mute */ 1765 + else 1766 + parm |= val; 1763 1767 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, parm); 1764 1768 info->vol[ch] = val; 1765 1769 } ··· 2030 2026 val1 = -((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT); 2031 2027 val1 += ofs; 2032 2028 val1 = ((int)val1) * ((int)val2); 2033 - if (min_mute) 2029 + if (min_mute || (caps & AC_AMPCAP_MIN_MUTE)) 2034 2030 val2 |= TLV_DB_SCALE_MUTE; 2035 2031 if (put_user(SNDRV_CTL_TLVT_DB_SCALE, _tlv)) 2036 2032 return -EFAULT; ··· 5118 5114 const char *pfx = "", *sfx = ""; 5119 5115 5120 5116 /* handle as a speaker if it's a fixed line-out */ 5121 - if (!strcmp(name, "Line-Out") && attr == INPUT_PIN_ATTR_INT) 5117 + if (!strcmp(name, "Line Out") && attr == INPUT_PIN_ATTR_INT) 5122 5118 name = "Speaker"; 5123 5119 /* check the location */ 5124 5120 switch (attr) { ··· 5177 5173 5178 5174 switch (get_defcfg_device(def_conf)) { 5179 5175 case AC_JACK_LINE_OUT: 5180 - return fill_audio_out_name(codec, nid, cfg, "Line-Out", 5176 + return fill_audio_out_name(codec, nid, cfg, "Line Out", 5181 5177 label, maxlen, indexp); 5182 5178 case AC_JACK_SPEAKER: 5183 5179 return fill_audio_out_name(codec, nid, cfg, "Speaker",
+3
sound/pci/hda/hda_codec.h
··· 298 298 #define AC_AMPCAP_MUTE (1<<31) /* mute capable */ 299 299 #define AC_AMPCAP_MUTE_SHIFT 31 300 300 301 + /* driver-specific amp-caps: using bits 24-30 */ 302 + #define AC_AMPCAP_MIN_MUTE (1 << 30) /* min-volume = mute */ 303 + 301 304 /* Connection list */ 302 305 #define AC_CLIST_LENGTH (0x7f<<0) 303 306 #define AC_CLIST_LONG (1<<7)
+2 -2
sound/pci/hda/patch_cirrus.c
··· 609 609 "Front Speaker", "Surround Speaker", "Bass Speaker" 610 610 }; 611 611 static const char * const line_outs[] = { 612 - "Front Line-Out", "Surround Line-Out", "Bass Line-Out" 612 + "Front Line Out", "Surround Line Out", "Bass Line Out" 613 613 }; 614 614 615 615 fix_volume_caps(codec, dac); ··· 635 635 if (num_ctls > 1) 636 636 name = line_outs[idx]; 637 637 else 638 - name = "Line-Out"; 638 + name = "Line Out"; 639 639 break; 640 640 } 641 641
+22 -2
sound/pci/hda/patch_conexant.c
··· 3482 3482 "Disabled", "Enabled" 3483 3483 }; 3484 3484 static const char * const texts3[] = { 3485 - "Disabled", "Speaker Only", "Line-Out+Speaker" 3485 + "Disabled", "Speaker Only", "Line Out+Speaker" 3486 3486 }; 3487 3487 const char * const *texts; 3488 3488 ··· 4079 4079 err = snd_hda_ctl_add(codec, nid, kctl); 4080 4080 if (err < 0) 4081 4081 return err; 4082 - if (!(query_amp_caps(codec, nid, hda_dir) & AC_AMPCAP_MUTE)) 4082 + if (!(query_amp_caps(codec, nid, hda_dir) & 4083 + (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE))) 4083 4084 break; 4084 4085 } 4085 4086 return 0; ··· 4380 4379 {} 4381 4380 }; 4382 4381 4382 + /* add "fake" mute amp-caps to DACs on cx5051 so that mixer mute switches 4383 + * can be created (bko#42825) 4384 + */ 4385 + static void add_cx5051_fake_mutes(struct hda_codec *codec) 4386 + { 4387 + static hda_nid_t out_nids[] = { 4388 + 0x10, 0x11, 0 4389 + }; 4390 + hda_nid_t *p; 4391 + 4392 + for (p = out_nids; *p; p++) 4393 + snd_hda_override_amp_caps(codec, *p, HDA_OUTPUT, 4394 + AC_AMPCAP_MIN_MUTE | 4395 + query_amp_caps(codec, *p, HDA_OUTPUT)); 4396 + } 4397 + 4383 4398 static int patch_conexant_auto(struct hda_codec *codec) 4384 4399 { 4385 4400 struct conexant_spec *spec; ··· 4413 4396 switch (codec->vendor_id) { 4414 4397 case 0x14f15045: 4415 4398 spec->single_adc_amp = 1; 4399 + break; 4400 + case 0x14f15051: 4401 + add_cx5051_fake_mutes(codec); 4416 4402 break; 4417 4403 } 4418 4404
+20 -7
sound/pci/hda/patch_realtek.c
··· 80 80 ALC_AUTOMUTE_MIXER, /* mute/unmute mixer widget AMP */ 81 81 }; 82 82 83 + #define MAX_VOL_NIDS 0x40 84 + 83 85 struct alc_spec { 84 86 /* codec parameterization */ 85 87 const struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ ··· 120 118 const hda_nid_t *capsrc_nids; 121 119 hda_nid_t dig_in_nid; /* digital-in NID; optional */ 122 120 hda_nid_t mixer_nid; /* analog-mixer NID */ 123 - DECLARE_BITMAP(vol_ctls, 0x20 << 1); 124 - DECLARE_BITMAP(sw_ctls, 0x20 << 1); 121 + DECLARE_BITMAP(vol_ctls, MAX_VOL_NIDS << 1); 122 + DECLARE_BITMAP(sw_ctls, MAX_VOL_NIDS << 1); 125 123 126 124 /* capture setup for dynamic dual-adc switch */ 127 125 hda_nid_t cur_adc; ··· 802 800 "Disabled", "Enabled" 803 801 }; 804 802 static const char * const texts3[] = { 805 - "Disabled", "Speaker Only", "Line-Out+Speaker" 803 + "Disabled", "Speaker Only", "Line Out+Speaker" 806 804 }; 807 805 const char * const *texts; 808 806 ··· 1856 1854 "Headphone Playback Volume", 1857 1855 "Speaker Playback Volume", 1858 1856 "Mono Playback Volume", 1859 - "Line-Out Playback Volume", 1857 + "Line Out Playback Volume", 1860 1858 "CLFE Playback Volume", 1861 1859 "Bass Speaker Playback Volume", 1862 1860 "PCM Playback Volume", ··· 1873 1871 "Speaker Playback Switch", 1874 1872 "Mono Playback Switch", 1875 1873 "IEC958 Playback Switch", 1876 - "Line-Out Playback Switch", 1874 + "Line Out Playback Switch", 1877 1875 "CLFE Playback Switch", 1878 1876 "Bass Speaker Playback Switch", 1879 1877 "PCM Playback Switch", ··· 3151 3149 static inline unsigned int get_ctl_pos(unsigned int data) 3152 3150 { 3153 3151 hda_nid_t nid = get_amp_nid_(data); 3154 - unsigned int dir = get_amp_direction_(data); 3152 + unsigned int dir; 3153 + if (snd_BUG_ON(nid >= MAX_VOL_NIDS)) 3154 + return 0; 3155 + dir = get_amp_direction_(data); 3155 3156 return (nid << 1) | dir; 3156 3157 } 3157 3158 ··· 3797 3792 else 3798 3793 nums = spec->num_adc_nids; 3799 3794 for (c = 0; c < nums; c++) 3800 - alc_mux_select(codec, 0, spec->cur_mux[c], true); 3795 + alc_mux_select(codec, c, spec->cur_mux[c], true); 3801 3796 } 3802 3797 3803 3798 /* add mic boosts if needed */ ··· 4441 4436 const struct alc_fixup *fix, int action) 4442 4437 { 4443 4438 if (action == ALC_FIXUP_ACT_PRE_PROBE) { 4439 + /* fake the connections during parsing the tree */ 4444 4440 hda_nid_t conn1[2] = { 0x0c, 0x0d }; 4445 4441 hda_nid_t conn2[2] = { 0x0e, 0x0f }; 4446 4442 snd_hda_override_conn_list(codec, 0x14, 2, conn1); 4447 4443 snd_hda_override_conn_list(codec, 0x15, 2, conn1); 4448 4444 snd_hda_override_conn_list(codec, 0x18, 2, conn2); 4449 4445 snd_hda_override_conn_list(codec, 0x1a, 2, conn2); 4446 + } else if (action == ALC_FIXUP_ACT_PROBE) { 4447 + /* restore the connections */ 4448 + hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; 4449 + snd_hda_override_conn_list(codec, 0x14, 5, conn); 4450 + snd_hda_override_conn_list(codec, 0x15, 5, conn); 4451 + snd_hda_override_conn_list(codec, 0x18, 5, conn); 4452 + snd_hda_override_conn_list(codec, 0x1a, 5, conn); 4450 4453 } 4451 4454 } 4452 4455
+1 -1
sound/pci/hda/patch_sigmatel.c
··· 4629 4629 unsigned int val = AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN; 4630 4630 if (no_hp_sensing(spec, i)) 4631 4631 continue; 4632 - if (presence) 4632 + if (1 /*presence*/) 4633 4633 stac92xx_set_pinctl(codec, cfg->hp_pins[i], val); 4634 4634 #if 0 /* FIXME */ 4635 4635 /* Resetting the pinctl like below may lead to (a sort of) regressions
+16 -15
sound/soc/codecs/ak4642.c
··· 146 146 147 147 SOC_DOUBLE_R_TLV("Digital Playback Volume", L_DVC, R_DVC, 148 148 0, 0xFF, 1, out_tlv), 149 - 150 - SOC_SINGLE("Headphone Switch", PW_MGMT2, 6, 1, 0), 151 149 }; 152 150 153 - static const struct snd_kcontrol_new ak4642_hpout_mixer_controls[] = { 154 - SOC_DAPM_SINGLE("DACH", MD_CTL4, 0, 1, 0), 155 - }; 151 + static const struct snd_kcontrol_new ak4642_headphone_control = 152 + SOC_DAPM_SINGLE("Switch", PW_MGMT2, 6, 1, 0); 156 153 157 154 static const struct snd_kcontrol_new ak4642_lout_mixer_controls[] = { 158 155 SOC_DAPM_SINGLE("DACL", SG_SL1, 4, 1, 0), ··· 162 165 SND_SOC_DAPM_OUTPUT("HPOUTR"), 163 166 SND_SOC_DAPM_OUTPUT("LINEOUT"), 164 167 165 - SND_SOC_DAPM_MIXER("HPOUTL Mixer", PW_MGMT2, 5, 0, 166 - &ak4642_hpout_mixer_controls[0], 167 - ARRAY_SIZE(ak4642_hpout_mixer_controls)), 168 + SND_SOC_DAPM_PGA("HPL Out", PW_MGMT2, 5, 0, NULL, 0), 169 + SND_SOC_DAPM_PGA("HPR Out", PW_MGMT2, 4, 0, NULL, 0), 170 + SND_SOC_DAPM_SWITCH("Headphone Enable", SND_SOC_NOPM, 0, 0, 171 + &ak4642_headphone_control), 168 172 169 - SND_SOC_DAPM_MIXER("HPOUTR Mixer", PW_MGMT2, 4, 0, 170 - &ak4642_hpout_mixer_controls[0], 171 - ARRAY_SIZE(ak4642_hpout_mixer_controls)), 173 + SND_SOC_DAPM_PGA("DACH", MD_CTL4, 0, 0, NULL, 0), 172 174 173 175 SND_SOC_DAPM_MIXER("LINEOUT Mixer", PW_MGMT1, 3, 0, 174 176 &ak4642_lout_mixer_controls[0], ··· 180 184 static const struct snd_soc_dapm_route ak4642_intercon[] = { 181 185 182 186 /* Outputs */ 183 - {"HPOUTL", NULL, "HPOUTL Mixer"}, 184 - {"HPOUTR", NULL, "HPOUTR Mixer"}, 187 + {"HPOUTL", NULL, "HPL Out"}, 188 + {"HPOUTR", NULL, "HPR Out"}, 185 189 {"LINEOUT", NULL, "LINEOUT Mixer"}, 186 190 187 - {"HPOUTL Mixer", "DACH", "DAC"}, 188 - {"HPOUTR Mixer", "DACH", "DAC"}, 191 + {"HPL Out", NULL, "Headphone Enable"}, 192 + {"HPR Out", NULL, "Headphone Enable"}, 193 + 194 + {"Headphone Enable", "Switch", "DACH"}, 195 + 196 + {"DACH", NULL, "DAC"}, 197 + 189 198 {"LINEOUT Mixer", "DACL", "DAC"}, 190 199 }; 191 200
+1 -1
sound/soc/codecs/wm8962.c
··· 2564 2564 return 0; 2565 2565 } 2566 2566 2567 - static const char *st_text[] = { "None", "Right", "Left" }; 2567 + static const char *st_text[] = { "None", "Left", "Right" }; 2568 2568 2569 2569 static const struct soc_enum str_enum = 2570 2570 SOC_ENUM_SINGLE(WM8962_DAC_DSP_MIXING_1, 2, 3, st_text);
+1 -1
sound/soc/imx/imx-ssi.c
··· 112 112 break; 113 113 case SND_SOC_DAIFMT_DSP_A: 114 114 /* data on rising edge of bclk, frame high 1clk before data */ 115 - strcr |= SSI_STCR_TFSL | SSI_STCR_TEFS; 115 + strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0 | SSI_STCR_TEFS; 116 116 break; 117 117 } 118 118
+9 -3
sound/soc/soc-dapm.c
··· 3068 3068 * standby. 3069 3069 */ 3070 3070 if (powerdown) { 3071 - snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_PREPARE); 3071 + if (dapm->bias_level == SND_SOC_BIAS_ON) 3072 + snd_soc_dapm_set_bias_level(dapm, 3073 + SND_SOC_BIAS_PREPARE); 3072 3074 dapm_seq_run(dapm, &down_list, 0, false); 3073 - snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_STANDBY); 3075 + if (dapm->bias_level == SND_SOC_BIAS_PREPARE) 3076 + snd_soc_dapm_set_bias_level(dapm, 3077 + SND_SOC_BIAS_STANDBY); 3074 3078 } 3075 3079 } 3076 3080 ··· 3087 3083 3088 3084 list_for_each_entry(codec, &card->codec_dev_list, list) { 3089 3085 soc_dapm_shutdown_codec(&codec->dapm); 3090 - snd_soc_dapm_set_bias_level(&codec->dapm, SND_SOC_BIAS_OFF); 3086 + if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY) 3087 + snd_soc_dapm_set_bias_level(&codec->dapm, 3088 + SND_SOC_BIAS_OFF); 3091 3089 } 3092 3090 } 3093 3091
+4 -1
sound/usb/caiaq/audio.c
··· 311 311 312 312 spin_lock(&dev->spinlock); 313 313 314 - if (dev->input_panic || dev->output_panic) 314 + if (dev->input_panic || dev->output_panic) { 315 315 ptr = SNDRV_PCM_POS_XRUN; 316 + goto unlock; 317 + } 316 318 317 319 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) 318 320 ptr = bytes_to_frames(sub->runtime, ··· 323 321 ptr = bytes_to_frames(sub->runtime, 324 322 dev->audio_in_buf_pos[index]); 325 323 324 + unlock: 326 325 spin_unlock(&dev->spinlock); 327 326 return ptr; 328 327 }
+1
sound/usb/card.h
··· 1 1 #ifndef __USBAUDIO_CARD_H 2 2 #define __USBAUDIO_CARD_H 3 3 4 + #define MAX_NR_RATES 1024 4 5 #define MAX_PACKS 20 5 6 #define MAX_PACKS_HS (MAX_PACKS * 8) /* in high speed mode */ 6 7 #define MAX_URBS 8
+1 -3
sound/usb/format.c
··· 209 209 return 0; 210 210 } 211 211 212 - #define MAX_UAC2_NR_RATES 1024 213 - 214 212 /* 215 213 * Helper function to walk the array of sample rate triplets reported by 216 214 * the device. The problem is that we need to parse whole array first to ··· 253 255 fp->rates |= snd_pcm_rate_to_rate_bit(rate); 254 256 255 257 nr_rates++; 256 - if (nr_rates >= MAX_UAC2_NR_RATES) { 258 + if (nr_rates >= MAX_NR_RATES) { 257 259 snd_printk(KERN_ERR "invalid uac2 rates\n"); 258 260 break; 259 261 }
+5 -1
sound/usb/quirks.c
··· 132 132 unsigned *rate_table = NULL; 133 133 134 134 fp = kmemdup(quirk->data, sizeof(*fp), GFP_KERNEL); 135 - if (! fp) { 135 + if (!fp) { 136 136 snd_printk(KERN_ERR "cannot memdup\n"); 137 137 return -ENOMEM; 138 + } 139 + if (fp->nr_rates > MAX_NR_RATES) { 140 + kfree(fp); 141 + return -EINVAL; 138 142 } 139 143 if (fp->nr_rates > 0) { 140 144 rate_table = kmemdup(fp->rate_table,
+1
tools/perf/util/event.c
··· 74 74 if (size >= len) 75 75 size = len - 1; 76 76 memcpy(comm, name, size); 77 + comm[size] = '\0'; 77 78 78 79 } else if (memcmp(bf, "Tgid:", 5) == 0) { 79 80 char *tgids = bf + 5;
+4
tools/perf/util/evlist.c
··· 349 349 hlist_for_each_entry(sid, pos, head, node) 350 350 if (sid->id == id) 351 351 return sid->evsel; 352 + 353 + if (!perf_evlist__sample_id_all(evlist)) 354 + return list_entry(evlist->entries.next, struct perf_evsel, node); 355 + 352 356 return NULL; 353 357 } 354 358
+6
tools/perf/util/probe-event.c
··· 1867 1867 tev->point.symbol); 1868 1868 ret = -ENOENT; 1869 1869 goto error; 1870 + } else if (tev->point.offset > sym->end - sym->start) { 1871 + pr_warning("Offset specified is greater than size of %s\n", 1872 + tev->point.symbol); 1873 + ret = -ENOENT; 1874 + goto error; 1875 + 1870 1876 } 1871 1877 1872 1878 return 1;
+11 -1
tools/perf/util/probe-finder.c
··· 672 672 static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr, 673 673 bool retprobe, struct probe_trace_point *tp) 674 674 { 675 - Dwarf_Addr eaddr; 675 + Dwarf_Addr eaddr, highaddr; 676 676 const char *name; 677 677 678 678 /* Copy the name of probe point */ ··· 682 682 pr_warning("Failed to get entry address of %s\n", 683 683 dwarf_diename(sp_die)); 684 684 return -ENOENT; 685 + } 686 + if (dwarf_highpc(sp_die, &highaddr) != 0) { 687 + pr_warning("Failed to get end address of %s\n", 688 + dwarf_diename(sp_die)); 689 + return -ENOENT; 690 + } 691 + if (paddr > highaddr) { 692 + pr_warning("Offset specified is greater than size of %s\n", 693 + dwarf_diename(sp_die)); 694 + return -EINVAL; 685 695 } 686 696 tp->symbol = strdup(name); 687 697 if (tp->symbol == NULL)
+5 -3
tools/testing/ktest/ktest.pl
··· 3244 3244 $in_bisect = 1; 3245 3245 3246 3246 my $failed = 0; 3247 - build "oldconfig"; 3248 - start_monitor_and_boot or $failed = 1; 3249 - end_monitor; 3247 + build "oldconfig" or $failed = 1; 3248 + if (!$failed) { 3249 + start_monitor_and_boot or $failed = 1; 3250 + end_monitor; 3251 + } 3250 3252 3251 3253 $in_bisect = 0; 3252 3254