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

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

Conflicts:
drivers/net/ethernet/sfc/rx.c

Overlapping changes in drivers/net/ethernet/sfc/rx.c, one to change
the rx_buf->is_page boolean into a set of u16 flags, and another to
adjust how ->ip_summed is initialized.

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

+1868 -1262
+3 -6
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 ··· 3048 3049 F: include/linux/hwspinlock.h 3049 3050 3050 3051 HARMONY SOUND DRIVER 3051 - M: Kyle McMartin <kyle@mcmartin.ca> 3052 3052 L: linux-parisc@vger.kernel.org 3053 3053 S: Maintained 3054 3054 F: sound/parisc/harmony.* ··· 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
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 3 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc4 4 + EXTRAVERSION = -rc5 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
+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;
+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 -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 */
+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 = {
+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)
+3 -2
arch/s390/kernel/process.c
··· 76 76 if (test_thread_flag(TIF_MCCK_PENDING)) { 77 77 local_mcck_enable(); 78 78 local_irq_enable(); 79 - s390_handle_mcck(); 80 79 return; 81 80 } 82 81 trace_hardirqs_on(); ··· 92 93 for (;;) { 93 94 tick_nohz_idle_enter(); 94 95 rcu_idle_enter(); 95 - while (!need_resched()) 96 + while (!need_resched() && !test_thread_flag(TIF_MCCK_PENDING)) 96 97 default_idle(); 97 98 rcu_idle_exit(); 98 99 tick_nohz_idle_exit(); 100 + if (test_thread_flag(TIF_MCCK_PENDING)) 101 + s390_handle_mcck(); 99 102 preempt_enable_no_resched(); 100 103 schedule(); 101 104 preempt_disable();
+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 -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)
+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);
+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 }
+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 -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
+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 {
+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,
+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;
+6 -1
drivers/gpu/drm/exynos/exynos_drm_fimd.c
··· 604 604 } 605 605 606 606 if (is_checked) { 607 - 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); 608 613 609 614 /* 610 615 * don't off vblank if vblank_disable_allowed is 1,
+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
+22 -2
drivers/gpu/drm/i915/intel_display.c
··· 8184 8184 I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ 8185 8185 8186 8186 if (intel_enable_rc6(dev_priv->dev)) 8187 - rc6_mask = GEN6_RC_CTL_RC6p_ENABLE | 8188 - 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; 8189 8189 8190 8190 I915_WRITE(GEN6_RC_CONTROL, 8191 8191 rc6_mask | ··· 8463 8463 I915_WRITE(WM2_LP_ILK, 0); 8464 8464 I915_WRITE(WM1_LP_ILK, 0); 8465 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 + 8466 8471 I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE); 8467 8472 8468 8473 I915_WRITE(IVB_CHICKEN3, 8469 8474 CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE | 8470 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); 8471 8491 8472 8492 for_each_pipe(pipe) { 8473 8493 I915_WRITE(DSPCNTR(pipe),
+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
+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
+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;
+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;
+3 -4
drivers/hwmon/f75375s.c
··· 340 340 fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); 341 341 fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); 342 342 data->pwm[nr] = 255; 343 - f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), 344 - data->pwm[nr]); 345 343 break; 346 344 case 1: /* PWM */ 347 345 fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); ··· 359 361 case 0: /* full speed */ 360 362 fanmode |= (3 << FAN_CTRL_MODE(nr)); 361 363 data->pwm[nr] = 255; 362 - f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), 363 - data->pwm[nr]); 364 364 break; 365 365 case 1: /* PWM */ 366 366 fanmode |= (3 << FAN_CTRL_MODE(nr)); ··· 373 377 374 378 f75375_write8(client, F75375_REG_FAN_TIMER, fanmode); 375 379 data->pwm_enable[nr] = val; 380 + if (val == 0) 381 + f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), 382 + data->pwm[nr]); 376 383 return 0; 377 384 } 378 385
+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;
+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; ··· 497 492 while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) { 498 493 n++; 499 494 status = priv->read_reg(priv, REG_SR); 495 + /* check for absent controller due to hw unplug */ 496 + if (status == 0xFF && sja1000_is_absent(priv)) 497 + return IRQ_NONE; 500 498 501 499 if (isrc & IRQ_WUI) 502 500 netdev_warn(dev, "wakeup interrupt\n"); ··· 516 508 while (status & SR_RBS) { 517 509 sja1000_rx(dev); 518 510 status = priv->read_reg(priv, REG_SR); 511 + /* check for absent controller */ 512 + if (status == 0xFF && sja1000_is_absent(priv)) 513 + return IRQ_NONE; 519 514 } 520 515 } 521 516 if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) {
-4
drivers/net/ethernet/atheros/atl1c/atl1c_main.c
··· 2245 2245 dev_info(&adapter->pdev->dev, "tx locked\n"); 2246 2246 return NETDEV_TX_LOCKED; 2247 2247 } 2248 - if (skb->mark == 0x01) 2249 - type = atl1c_trans_high; 2250 - else 2251 - type = atl1c_trans_normal; 2252 2248 2253 2249 if (atl1c_tpd_avail(adapter, type) < tpd_req) { 2254 2250 /* no enough descriptor, just stop queue */
+1 -1
drivers/net/ethernet/broadcom/b44.c
··· 2338 2338 return err; 2339 2339 } 2340 2340 2341 - static inline void __exit b44_pci_exit(void) 2341 + static inline void b44_pci_exit(void) 2342 2342 { 2343 2343 #ifdef CONFIG_B44_PCI 2344 2344 ssb_pcihost_unregister(&b44_pci_driver);
+5 -1
drivers/net/ethernet/broadcom/cnic.c
··· 3616 3616 fl6.flowi6_oif = dst_addr->sin6_scope_id; 3617 3617 3618 3618 *dst = ip6_route_output(&init_net, NULL, &fl6); 3619 - if (*dst) 3619 + if ((*dst)->error) { 3620 + dst_release(*dst); 3621 + *dst = NULL; 3622 + return -ENETUNREACH; 3623 + } else 3620 3624 return 0; 3621 3625 #endif 3622 3626
+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); ··· 1825 1823 goto err_master_mfunc; 1826 1824 1827 1825 priv->msix_ctl.pool_bm = 0; 1828 - spin_lock_init(&priv->msix_ctl.pool_lock); 1826 + mutex_init(&priv->msix_ctl.pool_lock); 1829 1827 1830 1828 mlx4_enable_msi_x(dev); 1831 1829 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
··· 1544 1544 1545 1545 netdev->irq = platform_get_irq(pdev, 0); 1546 1546 1547 - if (netdev->irq < 0) { 1547 + if ((int)netdev->irq < 0) { 1548 1548 err = netdev->irq; 1549 1549 goto err_get_irq; 1550 1550 }
+2 -2
drivers/net/ethernet/sfc/rx.c
··· 155 155 if (unlikely(!skb)) 156 156 return -ENOMEM; 157 157 158 - /* Adjust the SKB for padding and checksum */ 158 + /* Adjust the SKB for padding */ 159 159 skb_reserve(skb, NET_IP_ALIGN); 160 160 rx_buf->len = skb_len - NET_IP_ALIGN; 161 161 rx_buf->flags = 0; 162 - skb->ip_summed = CHECKSUM_UNNECESSARY; 163 162 164 163 rx_buf->dma_addr = pci_map_single(efx->pci_dev, 165 164 skb->data, rx_buf->len, ··· 495 496 496 497 EFX_BUG_ON_PARANOID(!(rx_buf->flags & EFX_RX_PKT_CSUMMED)); 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
··· 1008 1008 int ret; 1009 1009 1010 1010 /* free and bail if we are shutting down */ 1011 - if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) { 1011 + if (unlikely(!netif_running(ndev))) { 1012 1012 dev_kfree_skb_any(skb); 1013 1013 return; 1014 1014 } ··· 1037 1037 recycle: 1038 1038 ret = cpdma_chan_submit(priv->rxchan, skb, skb->data, 1039 1039 skb_tailroom(skb), GFP_KERNEL); 1040 - if (WARN_ON(ret < 0)) 1040 + 1041 + WARN_ON(ret == -ENOMEM); 1042 + if (unlikely(ret < 0)) 1041 1043 dev_kfree_skb_any(skb); 1042 1044 } 1043 1045
+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
··· 837 837 /* for simplicity, don't copy L4 headers */ 838 838 ctx->l4_hdr_size = 0; 839 839 } 840 - ctx->copy_size = ctx->eth_ip_hdr_size + 841 - ctx->l4_hdr_size; 840 + ctx->copy_size = min(ctx->eth_ip_hdr_size + 841 + ctx->l4_hdr_size, skb->len); 842 842 } else { 843 843 ctx->eth_ip_hdr_size = 0; 844 844 ctx->l4_hdr_size = 0;
+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?
+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 }
+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;
+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/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
+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);
+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,
+4 -4
fs/dcache.c
··· 2968 2968 2969 2969 static void __init dcache_init_early(void) 2970 2970 { 2971 - int loop; 2971 + unsigned int loop; 2972 2972 2973 2973 /* If hashes are distributed across NUMA nodes, defer 2974 2974 * hash allocation until vmalloc space is available. ··· 2986 2986 &d_hash_mask, 2987 2987 0); 2988 2988 2989 - for (loop = 0; loop < (1 << d_hash_shift); loop++) 2989 + for (loop = 0; loop < (1U << d_hash_shift); loop++) 2990 2990 INIT_HLIST_BL_HEAD(dentry_hashtable + loop); 2991 2991 } 2992 2992 2993 2993 static void __init dcache_init(void) 2994 2994 { 2995 - int loop; 2995 + unsigned int loop; 2996 2996 2997 2997 /* 2998 2998 * A constructor could be added for stable state like the lists, ··· 3016 3016 &d_hash_mask, 3017 3017 0); 3018 3018 3019 - for (loop = 0; loop < (1 << d_hash_shift); loop++) 3019 + for (loop = 0; loop < (1U << d_hash_shift); loop++) 3020 3020 INIT_HLIST_BL_HEAD(dentry_hashtable + loop); 3021 3021 } 3022 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?
+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
+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
+3 -1
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)) {
+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;
+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_ */
+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;
+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 */
+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
+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
··· 1486 1486 } 1487 1487 #endif /* NET_SKBUFF_DATA_USES_OFFSET */ 1488 1488 1489 + static inline void skb_mac_header_rebuild(struct sk_buff *skb) 1490 + { 1491 + if (skb_mac_header_was_set(skb)) { 1492 + const unsigned char *old_mac = skb_mac_header(skb); 1493 + 1494 + skb_set_mac_header(skb, -skb->mac_len); 1495 + memmove(skb_mac_header(skb), old_mac, skb->mac_len); 1496 + } 1497 + } 1498 + 1489 1499 static inline int skb_checksum_start_offset(const struct sk_buff *skb) 1490 1500 { 1491 1501 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
+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,
+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/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]);
+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)
+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
··· 631 631 632 632 pr_debug("ping_recvmsg(sk=%p,sk->num=%u)\n", isk, isk->inet_num); 633 633 634 + err = -EOPNOTSUPP; 634 635 if (flags & MSG_OOB) 635 636 goto out; 636 637
+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
··· 1550 1550 &saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex); 1551 1551 1552 1552 dst = ip6_route_output(net, NULL, &fl6); 1553 - if (dst == NULL) 1553 + if (dst->error) { 1554 + dst_release(dst); 1554 1555 return; 1555 - 1556 + } 1556 1557 dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0); 1557 1558 if (IS_ERR(dst)) 1558 1559 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:
+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
··· 1404 1404 nf_ct_protonum(ct)); 1405 1405 if (helper == NULL) { 1406 1406 rcu_read_unlock(); 1407 - spin_unlock_bh(&nf_conntrack_lock); 1408 1407 #ifdef CONFIG_MODULES 1409 1408 if (request_module("nfct-helper-%s", helpname) < 0) { 1410 - spin_lock_bh(&nf_conntrack_lock); 1411 1409 err = -EOPNOTSUPP; 1412 1410 goto err1; 1413 1411 } 1414 1412 1415 - spin_lock_bh(&nf_conntrack_lock); 1416 1413 rcu_read_lock(); 1417 1414 helper = __nf_conntrack_helper_find(helpname, 1418 1415 nf_ct_l3num(ct), ··· 1502 1505 if (tstamp) 1503 1506 tstamp->start = ktime_to_ns(ktime_get_real()); 1504 1507 1505 - add_timer(&ct->timeout); 1506 - nf_conntrack_hash_insert(ct); 1508 + err = nf_conntrack_hash_check_insert(ct); 1509 + if (err < 0) 1510 + goto err2; 1511 + 1507 1512 rcu_read_unlock(); 1508 1513 1509 1514 return ct; ··· 1526 1527 struct nf_conntrack_tuple otuple, rtuple; 1527 1528 struct nf_conntrack_tuple_hash *h = NULL; 1528 1529 struct nfgenmsg *nfmsg = nlmsg_data(nlh); 1530 + struct nf_conn *ct; 1529 1531 u_int8_t u3 = nfmsg->nfgen_family; 1530 1532 u16 zone; 1531 1533 int err; ··· 1547 1547 return err; 1548 1548 } 1549 1549 1550 - spin_lock_bh(&nf_conntrack_lock); 1551 1550 if (cda[CTA_TUPLE_ORIG]) 1552 - h = __nf_conntrack_find(net, zone, &otuple); 1551 + h = nf_conntrack_find_get(net, zone, &otuple); 1553 1552 else if (cda[CTA_TUPLE_REPLY]) 1554 - h = __nf_conntrack_find(net, zone, &rtuple); 1553 + h = nf_conntrack_find_get(net, zone, &rtuple); 1555 1554 1556 1555 if (h == NULL) { 1557 1556 err = -ENOENT; 1558 1557 if (nlh->nlmsg_flags & NLM_F_CREATE) { 1559 - struct nf_conn *ct; 1560 1558 enum ip_conntrack_events events; 1561 1559 1562 1560 ct = ctnetlink_create_conntrack(net, zone, cda, &otuple, 1563 1561 &rtuple, u3); 1564 - if (IS_ERR(ct)) { 1565 - err = PTR_ERR(ct); 1566 - goto out_unlock; 1567 - } 1562 + if (IS_ERR(ct)) 1563 + return PTR_ERR(ct); 1564 + 1568 1565 err = 0; 1569 - nf_conntrack_get(&ct->ct_general); 1570 - spin_unlock_bh(&nf_conntrack_lock); 1571 1566 if (test_bit(IPS_EXPECTED_BIT, &ct->status)) 1572 1567 events = IPCT_RELATED; 1573 1568 else ··· 1577 1582 ct, NETLINK_CB(skb).pid, 1578 1583 nlmsg_report(nlh)); 1579 1584 nf_ct_put(ct); 1580 - } else 1581 - spin_unlock_bh(&nf_conntrack_lock); 1585 + } 1582 1586 1583 1587 return err; 1584 1588 } 1585 1589 /* implicit 'else' */ 1586 1590 1587 - /* We manipulate the conntrack inside the global conntrack table lock, 1588 - * so there's no need to increase the refcount */ 1589 1591 err = -EEXIST; 1592 + ct = nf_ct_tuplehash_to_ctrack(h); 1590 1593 if (!(nlh->nlmsg_flags & NLM_F_EXCL)) { 1591 - struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(h); 1592 - 1594 + spin_lock_bh(&nf_conntrack_lock); 1593 1595 err = ctnetlink_change_conntrack(ct, cda); 1596 + spin_unlock_bh(&nf_conntrack_lock); 1594 1597 if (err == 0) { 1595 - nf_conntrack_get(&ct->ct_general); 1596 - spin_unlock_bh(&nf_conntrack_lock); 1597 1598 nf_conntrack_eventmask_report((1 << IPCT_REPLY) | 1598 1599 (1 << IPCT_ASSURED) | 1599 1600 (1 << IPCT_HELPER) | ··· 1598 1607 (1 << IPCT_MARK), 1599 1608 ct, NETLINK_CB(skb).pid, 1600 1609 nlmsg_report(nlh)); 1601 - nf_ct_put(ct); 1602 - } else 1603 - spin_unlock_bh(&nf_conntrack_lock); 1604 - 1605 - return err; 1610 + } 1606 1611 } 1607 1612 1608 - out_unlock: 1609 - spin_unlock_bh(&nf_conntrack_lock); 1613 + nf_ct_put(ct); 1610 1614 return err; 1611 1615 } 1612 1616
+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
+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
+16 -3
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; ··· 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 ··· 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
+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);
+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,