diff options
83 files changed, 809 insertions, 211 deletions
| @@ -1823,6 +1823,11 @@ S: Kattreinstr 38 | |||
| 1823 | S: D-64295 | 1823 | S: D-64295 |
| 1824 | S: Germany | 1824 | S: Germany |
| 1825 | 1825 | ||
| 1826 | N: Avi Kivity | ||
| 1827 | E: avi.kivity@gmail.com | ||
| 1828 | D: Kernel-based Virtual Machine (KVM) | ||
| 1829 | S: Ra'annana, Israel | ||
| 1830 | |||
| 1826 | N: Andi Kleen | 1831 | N: Andi Kleen |
| 1827 | E: andi@firstfloor.org | 1832 | E: andi@firstfloor.org |
| 1828 | U: http://www.halobates.de | 1833 | U: http://www.halobates.de |
diff --git a/Documentation/devicetree/bindings/net/mdio-gpio.txt b/Documentation/devicetree/bindings/net/mdio-gpio.txt index bc9549529014..c79bab025369 100644 --- a/Documentation/devicetree/bindings/net/mdio-gpio.txt +++ b/Documentation/devicetree/bindings/net/mdio-gpio.txt | |||
| @@ -8,9 +8,16 @@ gpios property as described in section VIII.1 in the following order: | |||
| 8 | 8 | ||
| 9 | MDC, MDIO. | 9 | MDC, MDIO. |
| 10 | 10 | ||
| 11 | Note: Each gpio-mdio bus should have an alias correctly numbered in "aliases" | ||
| 12 | node. | ||
| 13 | |||
| 11 | Example: | 14 | Example: |
| 12 | 15 | ||
| 13 | mdio { | 16 | aliases { |
| 17 | mdio-gpio0 = <&mdio0>; | ||
| 18 | }; | ||
| 19 | |||
| 20 | mdio0: mdio { | ||
| 14 | compatible = "virtual,mdio-gpio"; | 21 | compatible = "virtual,mdio-gpio"; |
| 15 | #address-cells = <1>; | 22 | #address-cells = <1>; |
| 16 | #size-cells = <0>; | 23 | #size-cells = <0>; |
diff --git a/MAINTAINERS b/MAINTAINERS index bb0b27db673f..244b2f229e5c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -526,10 +526,10 @@ F: drivers/video/geode/ | |||
| 526 | F: arch/x86/include/asm/geode.h | 526 | F: arch/x86/include/asm/geode.h |
| 527 | 527 | ||
| 528 | AMD IOMMU (AMD-VI) | 528 | AMD IOMMU (AMD-VI) |
| 529 | M: Joerg Roedel <joerg.roedel@amd.com> | 529 | M: Joerg Roedel <joro@8bytes.org> |
| 530 | L: iommu@lists.linux-foundation.org | 530 | L: iommu@lists.linux-foundation.org |
| 531 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git | 531 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git |
| 532 | S: Supported | 532 | S: Maintained |
| 533 | F: drivers/iommu/amd_iommu*.[ch] | 533 | F: drivers/iommu/amd_iommu*.[ch] |
| 534 | F: include/linux/amd-iommu.h | 534 | F: include/linux/amd-iommu.h |
| 535 | 535 | ||
| @@ -841,6 +841,14 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/kristoffer/linux-hpc.git | |||
| 841 | F: arch/arm/mach-sa1100/jornada720.c | 841 | F: arch/arm/mach-sa1100/jornada720.c |
| 842 | F: arch/arm/mach-sa1100/include/mach/jornada720.h | 842 | F: arch/arm/mach-sa1100/include/mach/jornada720.h |
| 843 | 843 | ||
| 844 | ARM/IGEP MACHINE SUPPORT | ||
| 845 | M: Enric Balletbo i Serra <eballetbo@gmail.com> | ||
| 846 | M: Javier Martinez Canillas <javier@dowhile0.org> | ||
| 847 | L: linux-omap@vger.kernel.org | ||
| 848 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | ||
| 849 | S: Maintained | ||
| 850 | F: arch/arm/mach-omap2/board-igep0020.c | ||
| 851 | |||
| 844 | ARM/INCOME PXA270 SUPPORT | 852 | ARM/INCOME PXA270 SUPPORT |
| 845 | M: Marek Vasut <marek.vasut@gmail.com> | 853 | M: Marek Vasut <marek.vasut@gmail.com> |
| 846 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 854 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| @@ -4280,8 +4288,8 @@ F: include/linux/lockd/ | |||
| 4280 | F: include/linux/sunrpc/ | 4288 | F: include/linux/sunrpc/ |
| 4281 | 4289 | ||
| 4282 | KERNEL VIRTUAL MACHINE (KVM) | 4290 | KERNEL VIRTUAL MACHINE (KVM) |
| 4283 | M: Avi Kivity <avi@redhat.com> | ||
| 4284 | M: Marcelo Tosatti <mtosatti@redhat.com> | 4291 | M: Marcelo Tosatti <mtosatti@redhat.com> |
| 4292 | M: Gleb Natapov <gleb@redhat.com> | ||
| 4285 | L: kvm@vger.kernel.org | 4293 | L: kvm@vger.kernel.org |
| 4286 | W: http://kvm.qumranet.com | 4294 | W: http://kvm.qumranet.com |
| 4287 | S: Supported | 4295 | S: Supported |
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 1e6956a90608..14db93e4c8a8 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
| @@ -445,7 +445,7 @@ struct procfs_args { | |||
| 445 | * unhappy with OSF UFS. [CHECKME] | 445 | * unhappy with OSF UFS. [CHECKME] |
| 446 | */ | 446 | */ |
| 447 | static int | 447 | static int |
| 448 | osf_ufs_mount(char *dirname, struct ufs_args __user *args, int flags) | 448 | osf_ufs_mount(const char *dirname, struct ufs_args __user *args, int flags) |
| 449 | { | 449 | { |
| 450 | int retval; | 450 | int retval; |
| 451 | struct cdfs_args tmp; | 451 | struct cdfs_args tmp; |
| @@ -465,7 +465,7 @@ osf_ufs_mount(char *dirname, struct ufs_args __user *args, int flags) | |||
| 465 | } | 465 | } |
| 466 | 466 | ||
| 467 | static int | 467 | static int |
| 468 | osf_cdfs_mount(char *dirname, struct cdfs_args __user *args, int flags) | 468 | osf_cdfs_mount(const char *dirname, struct cdfs_args __user *args, int flags) |
| 469 | { | 469 | { |
| 470 | int retval; | 470 | int retval; |
| 471 | struct cdfs_args tmp; | 471 | struct cdfs_args tmp; |
| @@ -485,7 +485,7 @@ osf_cdfs_mount(char *dirname, struct cdfs_args __user *args, int flags) | |||
| 485 | } | 485 | } |
| 486 | 486 | ||
| 487 | static int | 487 | static int |
| 488 | osf_procfs_mount(char *dirname, struct procfs_args __user *args, int flags) | 488 | osf_procfs_mount(const char *dirname, struct procfs_args __user *args, int flags) |
| 489 | { | 489 | { |
| 490 | struct procfs_args tmp; | 490 | struct procfs_args tmp; |
| 491 | 491 | ||
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index cd0c8b1e1ecf..14e9947bad6e 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
| @@ -713,8 +713,7 @@ static int dm644x_venc_setup_clock(enum vpbe_enc_timings_type type, | |||
| 713 | break; | 713 | break; |
| 714 | case VPBE_ENC_CUSTOM_TIMINGS: | 714 | case VPBE_ENC_CUSTOM_TIMINGS: |
| 715 | if (pclock <= 27000000) { | 715 | if (pclock <= 27000000) { |
| 716 | v |= DM644X_VPSS_MUXSEL_PLL2_MODE | | 716 | v |= DM644X_VPSS_DACCLKEN; |
| 717 | DM644X_VPSS_DACCLKEN; | ||
| 718 | writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL)); | 717 | writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL)); |
| 719 | } else { | 718 | } else { |
| 720 | /* | 719 | /* |
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 48d5e41dfbfa..378590694447 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
| @@ -580,6 +580,11 @@ static void __init igep_wlan_bt_init(void) | |||
| 580 | } else | 580 | } else |
| 581 | return; | 581 | return; |
| 582 | 582 | ||
| 583 | /* Make sure that the GPIO pins are muxed correctly */ | ||
| 584 | omap_mux_init_gpio(igep_wlan_bt_gpios[0].gpio, OMAP_PIN_OUTPUT); | ||
| 585 | omap_mux_init_gpio(igep_wlan_bt_gpios[1].gpio, OMAP_PIN_OUTPUT); | ||
| 586 | omap_mux_init_gpio(igep_wlan_bt_gpios[2].gpio, OMAP_PIN_OUTPUT); | ||
| 587 | |||
| 583 | err = gpio_request_array(igep_wlan_bt_gpios, | 588 | err = gpio_request_array(igep_wlan_bt_gpios, |
| 584 | ARRAY_SIZE(igep_wlan_bt_gpios)); | 589 | ARRAY_SIZE(igep_wlan_bt_gpios)); |
| 585 | if (err) { | 590 | if (err) { |
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index 44c42057b61c..a256135d8e48 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
| @@ -73,6 +73,7 @@ void __init omap4_pmic_init(const char *pmic_type, | |||
| 73 | { | 73 | { |
| 74 | /* PMIC part*/ | 74 | /* PMIC part*/ |
| 75 | omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); | 75 | omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); |
| 76 | omap_mux_init_signal("fref_clk0_out.sys_drm_msecure", OMAP_PIN_OUTPUT); | ||
| 76 | omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, pmic_data); | 77 | omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, pmic_data); |
| 77 | 78 | ||
| 78 | /* Register additional devices on i2c1 bus if needed */ | 79 | /* Register additional devices on i2c1 bus if needed */ |
diff --git a/arch/m68k/include/asm/signal.h b/arch/m68k/include/asm/signal.h index 67e489d8d1bd..2df26b57c26a 100644 --- a/arch/m68k/include/asm/signal.h +++ b/arch/m68k/include/asm/signal.h | |||
| @@ -41,7 +41,7 @@ struct k_sigaction { | |||
| 41 | static inline void sigaddset(sigset_t *set, int _sig) | 41 | static inline void sigaddset(sigset_t *set, int _sig) |
| 42 | { | 42 | { |
| 43 | asm ("bfset %0{%1,#1}" | 43 | asm ("bfset %0{%1,#1}" |
| 44 | : "+od" (*set) | 44 | : "+o" (*set) |
| 45 | : "id" ((_sig - 1) ^ 31) | 45 | : "id" ((_sig - 1) ^ 31) |
| 46 | : "cc"); | 46 | : "cc"); |
| 47 | } | 47 | } |
| @@ -49,7 +49,7 @@ static inline void sigaddset(sigset_t *set, int _sig) | |||
| 49 | static inline void sigdelset(sigset_t *set, int _sig) | 49 | static inline void sigdelset(sigset_t *set, int _sig) |
| 50 | { | 50 | { |
| 51 | asm ("bfclr %0{%1,#1}" | 51 | asm ("bfclr %0{%1,#1}" |
| 52 | : "+od" (*set) | 52 | : "+o" (*set) |
| 53 | : "id" ((_sig - 1) ^ 31) | 53 | : "id" ((_sig - 1) ^ 31) |
| 54 | : "cc"); | 54 | : "cc"); |
| 55 | } | 55 | } |
| @@ -65,7 +65,7 @@ static inline int __gen_sigismember(sigset_t *set, int _sig) | |||
| 65 | int ret; | 65 | int ret; |
| 66 | asm ("bfextu %1{%2,#1},%0" | 66 | asm ("bfextu %1{%2,#1},%0" |
| 67 | : "=d" (ret) | 67 | : "=d" (ret) |
| 68 | : "od" (*set), "id" ((_sig-1) ^ 31) | 68 | : "o" (*set), "id" ((_sig-1) ^ 31) |
| 69 | : "cc"); | 69 | : "cc"); |
| 70 | return ret; | 70 | return ret; |
| 71 | } | 71 | } |
diff --git a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c index fd49aeda9eb8..5dede04f2f3e 100644 --- a/arch/parisc/kernel/signal32.c +++ b/arch/parisc/kernel/signal32.c | |||
| @@ -65,7 +65,8 @@ put_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz) | |||
| 65 | { | 65 | { |
| 66 | compat_sigset_t s; | 66 | compat_sigset_t s; |
| 67 | 67 | ||
| 68 | if (sz != sizeof *set) panic("put_sigset32()"); | 68 | if (sz != sizeof *set) |
| 69 | return -EINVAL; | ||
| 69 | sigset_64to32(&s, set); | 70 | sigset_64to32(&s, set); |
| 70 | 71 | ||
| 71 | return copy_to_user(up, &s, sizeof s); | 72 | return copy_to_user(up, &s, sizeof s); |
| @@ -77,7 +78,8 @@ get_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz) | |||
| 77 | compat_sigset_t s; | 78 | compat_sigset_t s; |
| 78 | int r; | 79 | int r; |
| 79 | 80 | ||
| 80 | if (sz != sizeof *set) panic("put_sigset32()"); | 81 | if (sz != sizeof *set) |
| 82 | return -EINVAL; | ||
| 81 | 83 | ||
| 82 | if ((r = copy_from_user(&s, up, sz)) == 0) { | 84 | if ((r = copy_from_user(&s, up, sz)) == 0) { |
| 83 | sigset_32to64(set, &s); | 85 | sigset_32to64(set, &s); |
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c index 7426e40699bd..f76c10863c62 100644 --- a/arch/parisc/kernel/sys_parisc.c +++ b/arch/parisc/kernel/sys_parisc.c | |||
| @@ -73,6 +73,8 @@ static unsigned long get_shared_area(struct address_space *mapping, | |||
| 73 | struct vm_area_struct *vma; | 73 | struct vm_area_struct *vma; |
| 74 | int offset = mapping ? get_offset(mapping) : 0; | 74 | int offset = mapping ? get_offset(mapping) : 0; |
| 75 | 75 | ||
| 76 | offset = (offset + (pgoff << PAGE_SHIFT)) & 0x3FF000; | ||
| 77 | |||
| 76 | addr = DCACHE_ALIGN(addr - offset) + offset; | 78 | addr = DCACHE_ALIGN(addr - offset) + offset; |
| 77 | 79 | ||
| 78 | for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) { | 80 | for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) { |
diff --git a/arch/powerpc/boot/dts/mpc5200b.dtsi b/arch/powerpc/boot/dts/mpc5200b.dtsi index 7ab286ab5300..39ed65a44c5f 100644 --- a/arch/powerpc/boot/dts/mpc5200b.dtsi +++ b/arch/powerpc/boot/dts/mpc5200b.dtsi | |||
| @@ -231,6 +231,12 @@ | |||
| 231 | interrupts = <2 7 0>; | 231 | interrupts = <2 7 0>; |
| 232 | }; | 232 | }; |
| 233 | 233 | ||
| 234 | sclpc@3c00 { | ||
| 235 | compatible = "fsl,mpc5200-lpbfifo"; | ||
| 236 | reg = <0x3c00 0x60>; | ||
| 237 | interrupts = <2 23 0>; | ||
| 238 | }; | ||
| 239 | |||
| 234 | i2c@3d00 { | 240 | i2c@3d00 { |
| 235 | #address-cells = <1>; | 241 | #address-cells = <1>; |
| 236 | #size-cells = <0>; | 242 | #size-cells = <0>; |
diff --git a/arch/powerpc/boot/dts/o2d.dtsi b/arch/powerpc/boot/dts/o2d.dtsi index 3444eb8f0ade..24f668039295 100644 --- a/arch/powerpc/boot/dts/o2d.dtsi +++ b/arch/powerpc/boot/dts/o2d.dtsi | |||
| @@ -86,12 +86,6 @@ | |||
| 86 | reg = <0>; | 86 | reg = <0>; |
| 87 | }; | 87 | }; |
| 88 | }; | 88 | }; |
| 89 | |||
| 90 | sclpc@3c00 { | ||
| 91 | compatible = "fsl,mpc5200-lpbfifo"; | ||
| 92 | reg = <0x3c00 0x60>; | ||
| 93 | interrupts = <3 23 0>; | ||
| 94 | }; | ||
| 95 | }; | 89 | }; |
| 96 | 90 | ||
| 97 | localbus { | 91 | localbus { |
diff --git a/arch/powerpc/boot/dts/pcm030.dts b/arch/powerpc/boot/dts/pcm030.dts index 9e354997eb7e..96512c058033 100644 --- a/arch/powerpc/boot/dts/pcm030.dts +++ b/arch/powerpc/boot/dts/pcm030.dts | |||
| @@ -59,7 +59,7 @@ | |||
| 59 | #gpio-cells = <2>; | 59 | #gpio-cells = <2>; |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | psc@2000 { /* PSC1 in ac97 mode */ | 62 | audioplatform: psc@2000 { /* PSC1 in ac97 mode */ |
| 63 | compatible = "mpc5200b-psc-ac97","fsl,mpc5200b-psc-ac97"; | 63 | compatible = "mpc5200b-psc-ac97","fsl,mpc5200b-psc-ac97"; |
| 64 | cell-index = <0>; | 64 | cell-index = <0>; |
| 65 | }; | 65 | }; |
| @@ -134,4 +134,9 @@ | |||
| 134 | localbus { | 134 | localbus { |
| 135 | status = "disabled"; | 135 | status = "disabled"; |
| 136 | }; | 136 | }; |
| 137 | |||
| 138 | sound { | ||
| 139 | compatible = "phytec,pcm030-audio-fabric"; | ||
| 140 | asoc-platform = <&audioplatform>; | ||
| 141 | }; | ||
| 137 | }; | 142 | }; |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c index 8520b58a5e9a..b89ef65392dc 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c | |||
| @@ -372,10 +372,11 @@ static int mpc52xx_irqhost_map(struct irq_domain *h, unsigned int virq, | |||
| 372 | case MPC52xx_IRQ_L1_MAIN: irqchip = &mpc52xx_main_irqchip; break; | 372 | case MPC52xx_IRQ_L1_MAIN: irqchip = &mpc52xx_main_irqchip; break; |
| 373 | case MPC52xx_IRQ_L1_PERP: irqchip = &mpc52xx_periph_irqchip; break; | 373 | case MPC52xx_IRQ_L1_PERP: irqchip = &mpc52xx_periph_irqchip; break; |
| 374 | case MPC52xx_IRQ_L1_SDMA: irqchip = &mpc52xx_sdma_irqchip; break; | 374 | case MPC52xx_IRQ_L1_SDMA: irqchip = &mpc52xx_sdma_irqchip; break; |
| 375 | default: | 375 | case MPC52xx_IRQ_L1_CRIT: |
| 376 | pr_err("%s: invalid irq: virq=%i, l1=%i, l2=%i\n", | 376 | pr_warn("%s: Critical IRQ #%d is unsupported! Nopping it.\n", |
| 377 | __func__, virq, l1irq, l2irq); | 377 | __func__, l2irq); |
| 378 | return -EINVAL; | 378 | irq_set_chip(virq, &no_irq_chip); |
| 379 | return 0; | ||
| 379 | } | 380 | } |
| 380 | 381 | ||
| 381 | irq_set_chip_and_handler(virq, irqchip, handle_level_irq); | 382 | irq_set_chip_and_handler(virq, irqchip, handle_level_irq); |
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index b1ae48054dc5..b7078afddb74 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c | |||
| @@ -238,7 +238,7 @@ static int __devexit ahci_remove(struct platform_device *pdev) | |||
| 238 | return 0; | 238 | return 0; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | #ifdef CONFIG_PM | 241 | #ifdef CONFIG_PM_SLEEP |
| 242 | static int ahci_suspend(struct device *dev) | 242 | static int ahci_suspend(struct device *dev) |
| 243 | { | 243 | { |
| 244 | struct ahci_platform_data *pdata = dev_get_platdata(dev); | 244 | struct ahci_platform_data *pdata = dev_get_platdata(dev); |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index fd9ecf74e631..5b0ba3f20edc 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
| @@ -1105,10 +1105,15 @@ static int ata_acpi_bind_device(struct ata_port *ap, struct scsi_device *sdev, | |||
| 1105 | struct acpi_device *acpi_dev; | 1105 | struct acpi_device *acpi_dev; |
| 1106 | struct acpi_device_power_state *states; | 1106 | struct acpi_device_power_state *states; |
| 1107 | 1107 | ||
| 1108 | if (ap->flags & ATA_FLAG_ACPI_SATA) | 1108 | if (ap->flags & ATA_FLAG_ACPI_SATA) { |
| 1109 | ata_dev = &ap->link.device[sdev->channel]; | 1109 | if (!sata_pmp_attached(ap)) |
| 1110 | else | 1110 | ata_dev = &ap->link.device[sdev->id]; |
| 1111 | else | ||
| 1112 | ata_dev = &ap->pmp_link[sdev->channel].device[sdev->id]; | ||
| 1113 | } | ||
| 1114 | else { | ||
| 1111 | ata_dev = &ap->link.device[sdev->id]; | 1115 | ata_dev = &ap->link.device[sdev->id]; |
| 1116 | } | ||
| 1112 | 1117 | ||
| 1113 | *handle = ata_dev_acpi_handle(ata_dev); | 1118 | *handle = ata_dev_acpi_handle(ata_dev); |
| 1114 | 1119 | ||
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 3cc7096cfda7..f46fbd3bd3fb 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
| @@ -2942,6 +2942,10 @@ const struct ata_timing *ata_timing_find_mode(u8 xfer_mode) | |||
| 2942 | 2942 | ||
| 2943 | if (xfer_mode == t->mode) | 2943 | if (xfer_mode == t->mode) |
| 2944 | return t; | 2944 | return t; |
| 2945 | |||
| 2946 | WARN_ONCE(true, "%s: unable to find timing for xfer_mode 0x%x\n", | ||
| 2947 | __func__, xfer_mode); | ||
| 2948 | |||
| 2945 | return NULL; | 2949 | return NULL; |
| 2946 | } | 2950 | } |
| 2947 | 2951 | ||
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index e3bda074fa12..a6df6a351d6e 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
| @@ -1052,6 +1052,8 @@ static void ata_scsi_sdev_config(struct scsi_device *sdev) | |||
| 1052 | { | 1052 | { |
| 1053 | sdev->use_10_for_rw = 1; | 1053 | sdev->use_10_for_rw = 1; |
| 1054 | sdev->use_10_for_ms = 1; | 1054 | sdev->use_10_for_ms = 1; |
| 1055 | sdev->no_report_opcodes = 1; | ||
| 1056 | sdev->no_write_same = 1; | ||
| 1055 | 1057 | ||
| 1056 | /* Schedule policy is determined by ->qc_defer() callback and | 1058 | /* Schedule policy is determined by ->qc_defer() callback and |
| 1057 | * it needs to see every deferred qc. Set dev_blocked to 1 to | 1059 | * it needs to see every deferred qc. Set dev_blocked to 1 to |
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c index 26201ebef3ca..371fd2c698b7 100644 --- a/drivers/ata/pata_arasan_cf.c +++ b/drivers/ata/pata_arasan_cf.c | |||
| @@ -317,6 +317,12 @@ static int cf_init(struct arasan_cf_dev *acdev) | |||
| 317 | return ret; | 317 | return ret; |
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | ret = clk_set_rate(acdev->clk, 166000000); | ||
| 321 | if (ret) { | ||
| 322 | dev_warn(acdev->host->dev, "clock set rate failed"); | ||
| 323 | return ret; | ||
| 324 | } | ||
| 325 | |||
| 320 | spin_lock_irqsave(&acdev->host->lock, flags); | 326 | spin_lock_irqsave(&acdev->host->lock, flags); |
| 321 | /* configure CF interface clock */ | 327 | /* configure CF interface clock */ |
| 322 | writel((pdata->cf_if_clk <= CF_IF_CLK_200M) ? pdata->cf_if_clk : | 328 | writel((pdata->cf_if_clk <= CF_IF_CLK_200M) ? pdata->cf_if_clk : |
| @@ -908,7 +914,7 @@ static int __devexit arasan_cf_remove(struct platform_device *pdev) | |||
| 908 | return 0; | 914 | return 0; |
| 909 | } | 915 | } |
| 910 | 916 | ||
| 911 | #ifdef CONFIG_PM | 917 | #ifdef CONFIG_PM_SLEEP |
| 912 | static int arasan_cf_suspend(struct device *dev) | 918 | static int arasan_cf_suspend(struct device *dev) |
| 913 | { | 919 | { |
| 914 | struct ata_host *host = dev_get_drvdata(dev); | 920 | struct ata_host *host = dev_get_drvdata(dev); |
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c index 0d7c4c2cd26f..400bf1c3e982 100644 --- a/drivers/ata/sata_highbank.c +++ b/drivers/ata/sata_highbank.c | |||
| @@ -260,7 +260,7 @@ static const struct of_device_id ahci_of_match[] = { | |||
| 260 | }; | 260 | }; |
| 261 | MODULE_DEVICE_TABLE(of, ahci_of_match); | 261 | MODULE_DEVICE_TABLE(of, ahci_of_match); |
| 262 | 262 | ||
| 263 | static int __init ahci_highbank_probe(struct platform_device *pdev) | 263 | static int __devinit ahci_highbank_probe(struct platform_device *pdev) |
| 264 | { | 264 | { |
| 265 | struct device *dev = &pdev->dev; | 265 | struct device *dev = &pdev->dev; |
| 266 | struct ahci_host_priv *hpriv; | 266 | struct ahci_host_priv *hpriv; |
| @@ -378,7 +378,7 @@ static int __devexit ahci_highbank_remove(struct platform_device *pdev) | |||
| 378 | return 0; | 378 | return 0; |
| 379 | } | 379 | } |
| 380 | 380 | ||
| 381 | #ifdef CONFIG_PM | 381 | #ifdef CONFIG_PM_SLEEP |
| 382 | static int ahci_highbank_suspend(struct device *dev) | 382 | static int ahci_highbank_suspend(struct device *dev) |
| 383 | { | 383 | { |
| 384 | struct ata_host *host = dev_get_drvdata(dev); | 384 | struct ata_host *host = dev_get_drvdata(dev); |
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c index 44a4256533e1..08608de87e4e 100644 --- a/drivers/ata/sata_svw.c +++ b/drivers/ata/sata_svw.c | |||
| @@ -142,6 +142,39 @@ static int k2_sata_scr_write(struct ata_link *link, | |||
| 142 | return 0; | 142 | return 0; |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | static int k2_sata_softreset(struct ata_link *link, | ||
| 146 | unsigned int *class, unsigned long deadline) | ||
| 147 | { | ||
| 148 | u8 dmactl; | ||
| 149 | void __iomem *mmio = link->ap->ioaddr.bmdma_addr; | ||
| 150 | |||
| 151 | dmactl = readb(mmio + ATA_DMA_CMD); | ||
| 152 | |||
| 153 | /* Clear the start bit */ | ||
| 154 | if (dmactl & ATA_DMA_START) { | ||
| 155 | dmactl &= ~ATA_DMA_START; | ||
| 156 | writeb(dmactl, mmio + ATA_DMA_CMD); | ||
| 157 | } | ||
| 158 | |||
| 159 | return ata_sff_softreset(link, class, deadline); | ||
| 160 | } | ||
| 161 | |||
| 162 | static int k2_sata_hardreset(struct ata_link *link, | ||
| 163 | unsigned int *class, unsigned long deadline) | ||
| 164 | { | ||
| 165 | u8 dmactl; | ||
| 166 | void __iomem *mmio = link->ap->ioaddr.bmdma_addr; | ||
| 167 | |||
| 168 | dmactl = readb(mmio + ATA_DMA_CMD); | ||
| 169 | |||
| 170 | /* Clear the start bit */ | ||
| 171 | if (dmactl & ATA_DMA_START) { | ||
| 172 | dmactl &= ~ATA_DMA_START; | ||
| 173 | writeb(dmactl, mmio + ATA_DMA_CMD); | ||
| 174 | } | ||
| 175 | |||
| 176 | return sata_sff_hardreset(link, class, deadline); | ||
| 177 | } | ||
| 145 | 178 | ||
| 146 | static void k2_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) | 179 | static void k2_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) |
| 147 | { | 180 | { |
| @@ -346,6 +379,8 @@ static struct scsi_host_template k2_sata_sht = { | |||
| 346 | 379 | ||
| 347 | static struct ata_port_operations k2_sata_ops = { | 380 | static struct ata_port_operations k2_sata_ops = { |
| 348 | .inherits = &ata_bmdma_port_ops, | 381 | .inherits = &ata_bmdma_port_ops, |
| 382 | .softreset = k2_sata_softreset, | ||
| 383 | .hardreset = k2_sata_hardreset, | ||
| 349 | .sff_tf_load = k2_sata_tf_load, | 384 | .sff_tf_load = k2_sata_tf_load, |
| 350 | .sff_tf_read = k2_sata_tf_read, | 385 | .sff_tf_read = k2_sata_tf_read, |
| 351 | .sff_check_status = k2_stat_check_status, | 386 | .sff_check_status = k2_stat_check_status, |
diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index 1162d6b3bf85..bb1b392f5cda 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c | |||
| @@ -1546,6 +1546,8 @@ static int sbp2_scsi_slave_configure(struct scsi_device *sdev) | |||
| 1546 | struct sbp2_logical_unit *lu = sdev->hostdata; | 1546 | struct sbp2_logical_unit *lu = sdev->hostdata; |
| 1547 | 1547 | ||
| 1548 | sdev->use_10_for_rw = 1; | 1548 | sdev->use_10_for_rw = 1; |
| 1549 | sdev->no_report_opcodes = 1; | ||
| 1550 | sdev->no_write_same = 1; | ||
| 1549 | 1551 | ||
| 1550 | if (sbp2_param_exclusive_login) | 1552 | if (sbp2_param_exclusive_login) |
| 1551 | sdev->manage_start_stop = 1; | 1553 | sdev->manage_start_stop = 1; |
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index f11d8e3b4041..47150f5ded04 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
| @@ -466,7 +466,7 @@ config GPIO_ADP5588_IRQ | |||
| 466 | 466 | ||
| 467 | config GPIO_ADNP | 467 | config GPIO_ADNP |
| 468 | tristate "Avionic Design N-bit GPIO expander" | 468 | tristate "Avionic Design N-bit GPIO expander" |
| 469 | depends on I2C && OF | 469 | depends on I2C && OF_GPIO |
| 470 | help | 470 | help |
| 471 | This option enables support for N GPIOs found on Avionic Design | 471 | This option enables support for N GPIOs found on Avionic Design |
| 472 | I2C GPIO expanders. The register space will be extended by powers | 472 | I2C GPIO expanders. The register space will be extended by powers |
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c index 0f425189de11..ce1c84760076 100644 --- a/drivers/gpio/gpio-mcp23s08.c +++ b/drivers/gpio/gpio-mcp23s08.c | |||
| @@ -77,7 +77,7 @@ struct mcp23s08_driver_data { | |||
| 77 | 77 | ||
| 78 | /*----------------------------------------------------------------------*/ | 78 | /*----------------------------------------------------------------------*/ |
| 79 | 79 | ||
| 80 | #ifdef CONFIG_I2C | 80 | #if IS_ENABLED(CONFIG_I2C) |
| 81 | 81 | ||
| 82 | static int mcp23008_read(struct mcp23s08 *mcp, unsigned reg) | 82 | static int mcp23008_read(struct mcp23s08 *mcp, unsigned reg) |
| 83 | { | 83 | { |
| @@ -399,7 +399,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, | |||
| 399 | break; | 399 | break; |
| 400 | #endif /* CONFIG_SPI_MASTER */ | 400 | #endif /* CONFIG_SPI_MASTER */ |
| 401 | 401 | ||
| 402 | #ifdef CONFIG_I2C | 402 | #if IS_ENABLED(CONFIG_I2C) |
| 403 | case MCP_TYPE_008: | 403 | case MCP_TYPE_008: |
| 404 | mcp->ops = &mcp23008_ops; | 404 | mcp->ops = &mcp23008_ops; |
| 405 | mcp->chip.ngpio = 8; | 405 | mcp->chip.ngpio = 8; |
| @@ -473,7 +473,7 @@ fail: | |||
| 473 | 473 | ||
| 474 | /*----------------------------------------------------------------------*/ | 474 | /*----------------------------------------------------------------------*/ |
| 475 | 475 | ||
| 476 | #ifdef CONFIG_I2C | 476 | #if IS_ENABLED(CONFIG_I2C) |
| 477 | 477 | ||
| 478 | static int __devinit mcp230xx_probe(struct i2c_client *client, | 478 | static int __devinit mcp230xx_probe(struct i2c_client *client, |
| 479 | const struct i2c_device_id *id) | 479 | const struct i2c_device_id *id) |
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c index cf7afb9eb61a..be65c0451ad5 100644 --- a/drivers/gpio/gpio-mvebu.c +++ b/drivers/gpio/gpio-mvebu.c | |||
| @@ -92,6 +92,11 @@ static inline void __iomem *mvebu_gpioreg_out(struct mvebu_gpio_chip *mvchip) | |||
| 92 | return mvchip->membase + GPIO_OUT_OFF; | 92 | return mvchip->membase + GPIO_OUT_OFF; |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | static inline void __iomem *mvebu_gpioreg_blink(struct mvebu_gpio_chip *mvchip) | ||
| 96 | { | ||
| 97 | return mvchip->membase + GPIO_BLINK_EN_OFF; | ||
| 98 | } | ||
| 99 | |||
| 95 | static inline void __iomem *mvebu_gpioreg_io_conf(struct mvebu_gpio_chip *mvchip) | 100 | static inline void __iomem *mvebu_gpioreg_io_conf(struct mvebu_gpio_chip *mvchip) |
| 96 | { | 101 | { |
| 97 | return mvchip->membase + GPIO_IO_CONF_OFF; | 102 | return mvchip->membase + GPIO_IO_CONF_OFF; |
| @@ -206,6 +211,23 @@ static int mvebu_gpio_get(struct gpio_chip *chip, unsigned pin) | |||
| 206 | return (u >> pin) & 1; | 211 | return (u >> pin) & 1; |
| 207 | } | 212 | } |
| 208 | 213 | ||
| 214 | static void mvebu_gpio_blink(struct gpio_chip *chip, unsigned pin, int value) | ||
| 215 | { | ||
| 216 | struct mvebu_gpio_chip *mvchip = | ||
| 217 | container_of(chip, struct mvebu_gpio_chip, chip); | ||
| 218 | unsigned long flags; | ||
| 219 | u32 u; | ||
| 220 | |||
| 221 | spin_lock_irqsave(&mvchip->lock, flags); | ||
| 222 | u = readl_relaxed(mvebu_gpioreg_blink(mvchip)); | ||
| 223 | if (value) | ||
| 224 | u |= 1 << pin; | ||
| 225 | else | ||
| 226 | u &= ~(1 << pin); | ||
| 227 | writel_relaxed(u, mvebu_gpioreg_blink(mvchip)); | ||
| 228 | spin_unlock_irqrestore(&mvchip->lock, flags); | ||
| 229 | } | ||
| 230 | |||
| 209 | static int mvebu_gpio_direction_input(struct gpio_chip *chip, unsigned pin) | 231 | static int mvebu_gpio_direction_input(struct gpio_chip *chip, unsigned pin) |
| 210 | { | 232 | { |
| 211 | struct mvebu_gpio_chip *mvchip = | 233 | struct mvebu_gpio_chip *mvchip = |
| @@ -244,6 +266,7 @@ static int mvebu_gpio_direction_output(struct gpio_chip *chip, unsigned pin, | |||
| 244 | if (ret) | 266 | if (ret) |
| 245 | return ret; | 267 | return ret; |
| 246 | 268 | ||
| 269 | mvebu_gpio_blink(chip, pin, 0); | ||
| 247 | mvebu_gpio_set(chip, pin, value); | 270 | mvebu_gpio_set(chip, pin, value); |
| 248 | 271 | ||
| 249 | spin_lock_irqsave(&mvchip->lock, flags); | 272 | spin_lock_irqsave(&mvchip->lock, flags); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c index 05a909a17cee..15b182c84ce8 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c | |||
| @@ -49,13 +49,7 @@ nv50_disp_intr_vblank(struct nv50_disp_priv *priv, int crtc) | |||
| 49 | if (chan->vblank.crtc != crtc) | 49 | if (chan->vblank.crtc != crtc) |
| 50 | continue; | 50 | continue; |
| 51 | 51 | ||
| 52 | if (nv_device(priv)->chipset == 0x50) { | 52 | if (nv_device(priv)->chipset >= 0xc0) { |
| 53 | nv_wr32(priv, 0x001704, chan->vblank.channel); | ||
| 54 | nv_wr32(priv, 0x001710, 0x80000000 | chan->vblank.ctxdma); | ||
| 55 | bar->flush(bar); | ||
| 56 | nv_wr32(priv, 0x001570, chan->vblank.offset); | ||
| 57 | nv_wr32(priv, 0x001574, chan->vblank.value); | ||
| 58 | } else { | ||
| 59 | nv_wr32(priv, 0x001718, 0x80000000 | chan->vblank.channel); | 53 | nv_wr32(priv, 0x001718, 0x80000000 | chan->vblank.channel); |
| 60 | bar->flush(bar); | 54 | bar->flush(bar); |
| 61 | nv_wr32(priv, 0x06000c, | 55 | nv_wr32(priv, 0x06000c, |
| @@ -63,6 +57,17 @@ nv50_disp_intr_vblank(struct nv50_disp_priv *priv, int crtc) | |||
| 63 | nv_wr32(priv, 0x060010, | 57 | nv_wr32(priv, 0x060010, |
| 64 | lower_32_bits(chan->vblank.offset)); | 58 | lower_32_bits(chan->vblank.offset)); |
| 65 | nv_wr32(priv, 0x060014, chan->vblank.value); | 59 | nv_wr32(priv, 0x060014, chan->vblank.value); |
| 60 | } else { | ||
| 61 | nv_wr32(priv, 0x001704, chan->vblank.channel); | ||
| 62 | nv_wr32(priv, 0x001710, 0x80000000 | chan->vblank.ctxdma); | ||
| 63 | bar->flush(bar); | ||
| 64 | if (nv_device(priv)->chipset == 0x50) { | ||
| 65 | nv_wr32(priv, 0x001570, chan->vblank.offset); | ||
| 66 | nv_wr32(priv, 0x001574, chan->vblank.value); | ||
| 67 | } else { | ||
| 68 | nv_wr32(priv, 0x060010, chan->vblank.offset); | ||
| 69 | nv_wr32(priv, 0x060014, chan->vblank.value); | ||
| 70 | } | ||
| 66 | } | 71 | } |
| 67 | 72 | ||
| 68 | list_del(&chan->vblank.head); | 73 | list_del(&chan->vblank.head); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv40.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv40.c index e45035efb8ca..7bbb1e1b7a8d 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv40.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv40.c | |||
| @@ -669,21 +669,27 @@ nv40_grctx_fill(struct nouveau_device *device, struct nouveau_gpuobj *mem) | |||
| 669 | }); | 669 | }); |
| 670 | } | 670 | } |
| 671 | 671 | ||
| 672 | void | 672 | int |
| 673 | nv40_grctx_init(struct nouveau_device *device, u32 *size) | 673 | nv40_grctx_init(struct nouveau_device *device, u32 *size) |
| 674 | { | 674 | { |
| 675 | u32 ctxprog[256], i; | 675 | u32 *ctxprog = kmalloc(256 * 4, GFP_KERNEL), i; |
| 676 | struct nouveau_grctx ctx = { | 676 | struct nouveau_grctx ctx = { |
| 677 | .device = device, | 677 | .device = device, |
| 678 | .mode = NOUVEAU_GRCTX_PROG, | 678 | .mode = NOUVEAU_GRCTX_PROG, |
| 679 | .data = ctxprog, | 679 | .data = ctxprog, |
| 680 | .ctxprog_max = ARRAY_SIZE(ctxprog) | 680 | .ctxprog_max = 256, |
| 681 | }; | 681 | }; |
| 682 | 682 | ||
| 683 | if (!ctxprog) | ||
| 684 | return -ENOMEM; | ||
| 685 | |||
| 683 | nv40_grctx_generate(&ctx); | 686 | nv40_grctx_generate(&ctx); |
| 684 | 687 | ||
| 685 | nv_wr32(device, 0x400324, 0); | 688 | nv_wr32(device, 0x400324, 0); |
| 686 | for (i = 0; i < ctx.ctxprog_len; i++) | 689 | for (i = 0; i < ctx.ctxprog_len; i++) |
| 687 | nv_wr32(device, 0x400328, ctxprog[i]); | 690 | nv_wr32(device, 0x400328, ctxprog[i]); |
| 688 | *size = ctx.ctxvals_pos * 4; | 691 | *size = ctx.ctxvals_pos * 4; |
| 692 | |||
| 693 | kfree(ctxprog); | ||
| 694 | return 0; | ||
| 689 | } | 695 | } |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nv40.c b/drivers/gpu/drm/nouveau/core/engine/graph/nv40.c index 425001204a89..cc6574eeb80e 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/nv40.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nv40.c | |||
| @@ -346,7 +346,9 @@ nv40_graph_init(struct nouveau_object *object) | |||
| 346 | return ret; | 346 | return ret; |
| 347 | 347 | ||
| 348 | /* generate and upload context program */ | 348 | /* generate and upload context program */ |
| 349 | nv40_grctx_init(nv_device(priv), &priv->size); | 349 | ret = nv40_grctx_init(nv_device(priv), &priv->size); |
| 350 | if (ret) | ||
| 351 | return ret; | ||
| 350 | 352 | ||
| 351 | /* No context present currently */ | 353 | /* No context present currently */ |
| 352 | nv_wr32(priv, NV40_PGRAPH_CTXCTL_CUR, 0x00000000); | 354 | nv_wr32(priv, NV40_PGRAPH_CTXCTL_CUR, 0x00000000); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nv40.h b/drivers/gpu/drm/nouveau/core/engine/graph/nv40.h index d2ac975afc2e..7da35a4e7970 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/nv40.h +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nv40.h | |||
| @@ -15,7 +15,7 @@ nv44_graph_class(void *priv) | |||
| 15 | return !(0x0baf & (1 << (device->chipset & 0x0f))); | 15 | return !(0x0baf & (1 << (device->chipset & 0x0f))); |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | void nv40_grctx_init(struct nouveau_device *, u32 *size); | 18 | int nv40_grctx_init(struct nouveau_device *, u32 *size); |
| 19 | void nv40_grctx_fill(struct nouveau_device *, struct nouveau_gpuobj *); | 19 | void nv40_grctx_fill(struct nouveau_device *, struct nouveau_gpuobj *); |
| 20 | 20 | ||
| 21 | #endif | 21 | #endif |
diff --git a/drivers/gpu/drm/nouveau/core/include/core/object.h b/drivers/gpu/drm/nouveau/core/include/core/object.h index 818feabbf4a0..486f1a9217fd 100644 --- a/drivers/gpu/drm/nouveau/core/include/core/object.h +++ b/drivers/gpu/drm/nouveau/core/include/core/object.h | |||
| @@ -175,14 +175,18 @@ nv_mo32(void *obj, u32 addr, u32 mask, u32 data) | |||
| 175 | return temp; | 175 | return temp; |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | static inline bool | 178 | static inline int |
| 179 | nv_strncmp(void *obj, u32 addr, u32 len, const char *str) | 179 | nv_memcmp(void *obj, u32 addr, const char *str, u32 len) |
| 180 | { | 180 | { |
| 181 | unsigned char c1, c2; | ||
| 182 | |||
| 181 | while (len--) { | 183 | while (len--) { |
| 182 | if (nv_ro08(obj, addr++) != *(str++)) | 184 | c1 = nv_ro08(obj, addr++); |
| 183 | return false; | 185 | c2 = *(str++); |
| 186 | if (c1 != c2) | ||
| 187 | return c1 - c2; | ||
| 184 | } | 188 | } |
| 185 | return true; | 189 | return 0; |
| 186 | } | 190 | } |
| 187 | 191 | ||
| 188 | #endif | 192 | #endif |
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/clock.h b/drivers/gpu/drm/nouveau/core/include/subdev/clock.h index 39e73b91d360..41b7a6a76f19 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/clock.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/clock.h | |||
| @@ -54,6 +54,7 @@ int nv04_clock_pll_calc(struct nouveau_clock *, struct nvbios_pll *, | |||
| 54 | int clk, struct nouveau_pll_vals *); | 54 | int clk, struct nouveau_pll_vals *); |
| 55 | int nv04_clock_pll_prog(struct nouveau_clock *, u32 reg1, | 55 | int nv04_clock_pll_prog(struct nouveau_clock *, u32 reg1, |
| 56 | struct nouveau_pll_vals *); | 56 | struct nouveau_pll_vals *); |
| 57 | 57 | int nva3_clock_pll_calc(struct nouveau_clock *, struct nvbios_pll *, | |
| 58 | int clk, struct nouveau_pll_vals *); | ||
| 58 | 59 | ||
| 59 | #endif | 60 | #endif |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c b/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c index 7d750382a833..c51197157749 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c | |||
| @@ -64,7 +64,7 @@ dcb_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) | |||
| 64 | } | 64 | } |
| 65 | } else | 65 | } else |
| 66 | if (*ver >= 0x15) { | 66 | if (*ver >= 0x15) { |
| 67 | if (!nv_strncmp(bios, dcb - 7, 7, "DEV_REC")) { | 67 | if (!nv_memcmp(bios, dcb - 7, "DEV_REC", 7)) { |
| 68 | u16 i2c = nv_ro16(bios, dcb + 2); | 68 | u16 i2c = nv_ro16(bios, dcb + 2); |
| 69 | *hdr = 4; | 69 | *hdr = 4; |
| 70 | *cnt = (i2c - dcb) / 10; | 70 | *cnt = (i2c - dcb) / 10; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c b/drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c index cc8d7d162d7c..9068c98b96f6 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c +++ b/drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c | |||
| @@ -66,6 +66,24 @@ nva3_clock_pll_set(struct nouveau_clock *clk, u32 type, u32 freq) | |||
| 66 | return ret; | 66 | return ret; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | int | ||
| 70 | nva3_clock_pll_calc(struct nouveau_clock *clock, struct nvbios_pll *info, | ||
| 71 | int clk, struct nouveau_pll_vals *pv) | ||
| 72 | { | ||
| 73 | int ret, N, M, P; | ||
| 74 | |||
| 75 | ret = nva3_pll_calc(clock, info, clk, &N, NULL, &M, &P); | ||
| 76 | |||
| 77 | if (ret > 0) { | ||
| 78 | pv->refclk = info->refclk; | ||
| 79 | pv->N1 = N; | ||
| 80 | pv->M1 = M; | ||
| 81 | pv->log2P = P; | ||
| 82 | } | ||
| 83 | return ret; | ||
| 84 | } | ||
| 85 | |||
| 86 | |||
| 69 | static int | 87 | static int |
| 70 | nva3_clock_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | 88 | nva3_clock_ctor(struct nouveau_object *parent, struct nouveau_object *engine, |
| 71 | struct nouveau_oclass *oclass, void *data, u32 size, | 89 | struct nouveau_oclass *oclass, void *data, u32 size, |
| @@ -80,6 +98,7 @@ nva3_clock_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 80 | return ret; | 98 | return ret; |
| 81 | 99 | ||
| 82 | priv->base.pll_set = nva3_clock_pll_set; | 100 | priv->base.pll_set = nva3_clock_pll_set; |
| 101 | priv->base.pll_calc = nva3_clock_pll_calc; | ||
| 83 | return 0; | 102 | return 0; |
| 84 | } | 103 | } |
| 85 | 104 | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/clock/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/clock/nvc0.c index 5ccce0b17bf3..f6962c9b6c36 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/clock/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/subdev/clock/nvc0.c | |||
| @@ -79,6 +79,7 @@ nvc0_clock_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 79 | return ret; | 79 | return ret; |
| 80 | 80 | ||
| 81 | priv->base.pll_set = nvc0_clock_pll_set; | 81 | priv->base.pll_set = nvc0_clock_pll_set; |
| 82 | priv->base.pll_calc = nva3_clock_pll_calc; | ||
| 82 | return 0; | 83 | return 0; |
| 83 | } | 84 | } |
| 84 | 85 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c index cc79c796afee..cbf1fc60a386 100644 --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c | |||
| @@ -241,6 +241,10 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) | |||
| 241 | 241 | ||
| 242 | if (unlikely(!abi16)) | 242 | if (unlikely(!abi16)) |
| 243 | return -ENOMEM; | 243 | return -ENOMEM; |
| 244 | |||
| 245 | if (!drm->channel) | ||
| 246 | return nouveau_abi16_put(abi16, -ENODEV); | ||
| 247 | |||
| 244 | client = nv_client(abi16->client); | 248 | client = nv_client(abi16->client); |
| 245 | 249 | ||
| 246 | if (init->fb_ctxdma_handle == ~0 || init->tt_ctxdma_handle == ~0) | 250 | if (init->fb_ctxdma_handle == ~0 || init->tt_ctxdma_handle == ~0) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 0910125cbbc3..8503b2ea570a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
| @@ -129,7 +129,8 @@ nouveau_accel_init(struct nouveau_drm *drm) | |||
| 129 | 129 | ||
| 130 | /* initialise synchronisation routines */ | 130 | /* initialise synchronisation routines */ |
| 131 | if (device->card_type < NV_10) ret = nv04_fence_create(drm); | 131 | if (device->card_type < NV_10) ret = nv04_fence_create(drm); |
| 132 | else if (device->chipset < 0x84) ret = nv10_fence_create(drm); | 132 | else if (device->card_type < NV_50) ret = nv10_fence_create(drm); |
| 133 | else if (device->chipset < 0x84) ret = nv50_fence_create(drm); | ||
| 133 | else if (device->card_type < NV_C0) ret = nv84_fence_create(drm); | 134 | else if (device->card_type < NV_C0) ret = nv84_fence_create(drm); |
| 134 | else ret = nvc0_fence_create(drm); | 135 | else ret = nvc0_fence_create(drm); |
| 135 | if (ret) { | 136 | if (ret) { |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index af31f829f4a8..219942c660d7 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
| @@ -1330,6 +1330,8 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav | |||
| 1330 | break; | 1330 | break; |
| 1331 | udelay(1); | 1331 | udelay(1); |
| 1332 | } | 1332 | } |
| 1333 | } else { | ||
| 1334 | save->crtc_enabled[i] = false; | ||
| 1333 | } | 1335 | } |
| 1334 | } | 1336 | } |
| 1335 | 1337 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c index 10ea17a6b2a6..42433344cb1b 100644 --- a/drivers/gpu/drm/radeon/radeon_agp.c +++ b/drivers/gpu/drm/radeon/radeon_agp.c | |||
| @@ -69,9 +69,12 @@ static struct radeon_agpmode_quirk radeon_agpmode_quirk_list[] = { | |||
| 69 | /* Intel 82830 830 Chipset Host Bridge / Mobility M6 LY Needs AGPMode 2 (fdo #17360)*/ | 69 | /* Intel 82830 830 Chipset Host Bridge / Mobility M6 LY Needs AGPMode 2 (fdo #17360)*/ |
| 70 | { PCI_VENDOR_ID_INTEL, 0x3575, PCI_VENDOR_ID_ATI, 0x4c59, | 70 | { PCI_VENDOR_ID_INTEL, 0x3575, PCI_VENDOR_ID_ATI, 0x4c59, |
| 71 | PCI_VENDOR_ID_DELL, 0x00e3, 2}, | 71 | PCI_VENDOR_ID_DELL, 0x00e3, 2}, |
| 72 | /* Intel 82852/82855 host bridge / Mobility FireGL 9000 R250 Needs AGPMode 1 (lp #296617) */ | 72 | /* Intel 82852/82855 host bridge / Mobility FireGL 9000 RV250 Needs AGPMode 1 (lp #296617) */ |
| 73 | { PCI_VENDOR_ID_INTEL, 0x3580, PCI_VENDOR_ID_ATI, 0x4c66, | 73 | { PCI_VENDOR_ID_INTEL, 0x3580, PCI_VENDOR_ID_ATI, 0x4c66, |
| 74 | PCI_VENDOR_ID_DELL, 0x0149, 1}, | 74 | PCI_VENDOR_ID_DELL, 0x0149, 1}, |
| 75 | /* Intel 82855PM host bridge / Mobility FireGL 9000 RV250 Needs AGPMode 1 for suspend/resume */ | ||
| 76 | { PCI_VENDOR_ID_INTEL, 0x3340, PCI_VENDOR_ID_ATI, 0x4c66, | ||
| 77 | PCI_VENDOR_ID_IBM, 0x0531, 1}, | ||
| 75 | /* Intel 82852/82855 host bridge / Mobility 9600 M10 RV350 Needs AGPMode 1 (deb #467460) */ | 78 | /* Intel 82852/82855 host bridge / Mobility 9600 M10 RV350 Needs AGPMode 1 (deb #467460) */ |
| 76 | { PCI_VENDOR_ID_INTEL, 0x3580, PCI_VENDOR_ID_ATI, 0x4e50, | 79 | { PCI_VENDOR_ID_INTEL, 0x3580, PCI_VENDOR_ID_ATI, 0x4e50, |
| 77 | 0x1025, 0x0061, 1}, | 80 | 0x1025, 0x0061, 1}, |
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index d4a4cd445cab..0badfa48b32b 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
| @@ -4108,7 +4108,7 @@ static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to) | |||
| 4108 | static int intel_iommu_add_device(struct device *dev) | 4108 | static int intel_iommu_add_device(struct device *dev) |
| 4109 | { | 4109 | { |
| 4110 | struct pci_dev *pdev = to_pci_dev(dev); | 4110 | struct pci_dev *pdev = to_pci_dev(dev); |
| 4111 | struct pci_dev *bridge, *dma_pdev; | 4111 | struct pci_dev *bridge, *dma_pdev = NULL; |
| 4112 | struct iommu_group *group; | 4112 | struct iommu_group *group; |
| 4113 | int ret; | 4113 | int ret; |
| 4114 | 4114 | ||
| @@ -4122,7 +4122,7 @@ static int intel_iommu_add_device(struct device *dev) | |||
| 4122 | dma_pdev = pci_get_domain_bus_and_slot( | 4122 | dma_pdev = pci_get_domain_bus_and_slot( |
| 4123 | pci_domain_nr(pdev->bus), | 4123 | pci_domain_nr(pdev->bus), |
| 4124 | bridge->subordinate->number, 0); | 4124 | bridge->subordinate->number, 0); |
| 4125 | else | 4125 | if (!dma_pdev) |
| 4126 | dma_pdev = pci_dev_get(bridge); | 4126 | dma_pdev = pci_dev_get(bridge); |
| 4127 | } else | 4127 | } else |
| 4128 | dma_pdev = pci_dev_get(pdev); | 4128 | dma_pdev = pci_dev_get(pdev); |
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index a649f146d17b..c0f7a4266263 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c | |||
| @@ -1054,6 +1054,7 @@ static int smmu_debugfs_stats_show(struct seq_file *s, void *v) | |||
| 1054 | stats[i], val, offs); | 1054 | stats[i], val, offs); |
| 1055 | } | 1055 | } |
| 1056 | seq_printf(s, "\n"); | 1056 | seq_printf(s, "\n"); |
| 1057 | dput(dent); | ||
| 1057 | 1058 | ||
| 1058 | return 0; | 1059 | return 0; |
| 1059 | } | 1060 | } |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index b2530b002125..5f5b69f37d2e 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -1379,6 +1379,8 @@ static void bond_compute_features(struct bonding *bond) | |||
| 1379 | struct net_device *bond_dev = bond->dev; | 1379 | struct net_device *bond_dev = bond->dev; |
| 1380 | netdev_features_t vlan_features = BOND_VLAN_FEATURES; | 1380 | netdev_features_t vlan_features = BOND_VLAN_FEATURES; |
| 1381 | unsigned short max_hard_header_len = ETH_HLEN; | 1381 | unsigned short max_hard_header_len = ETH_HLEN; |
| 1382 | unsigned int gso_max_size = GSO_MAX_SIZE; | ||
| 1383 | u16 gso_max_segs = GSO_MAX_SEGS; | ||
| 1382 | int i; | 1384 | int i; |
| 1383 | unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE; | 1385 | unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE; |
| 1384 | 1386 | ||
| @@ -1394,11 +1396,16 @@ static void bond_compute_features(struct bonding *bond) | |||
| 1394 | dst_release_flag &= slave->dev->priv_flags; | 1396 | dst_release_flag &= slave->dev->priv_flags; |
| 1395 | if (slave->dev->hard_header_len > max_hard_header_len) | 1397 | if (slave->dev->hard_header_len > max_hard_header_len) |
| 1396 | max_hard_header_len = slave->dev->hard_header_len; | 1398 | max_hard_header_len = slave->dev->hard_header_len; |
| 1399 | |||
| 1400 | gso_max_size = min(gso_max_size, slave->dev->gso_max_size); | ||
| 1401 | gso_max_segs = min(gso_max_segs, slave->dev->gso_max_segs); | ||
| 1397 | } | 1402 | } |
| 1398 | 1403 | ||
| 1399 | done: | 1404 | done: |
| 1400 | bond_dev->vlan_features = vlan_features; | 1405 | bond_dev->vlan_features = vlan_features; |
| 1401 | bond_dev->hard_header_len = max_hard_header_len; | 1406 | bond_dev->hard_header_len = max_hard_header_len; |
| 1407 | bond_dev->gso_max_segs = gso_max_segs; | ||
| 1408 | netif_set_gso_max_size(bond_dev, gso_max_size); | ||
| 1402 | 1409 | ||
| 1403 | flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE; | 1410 | flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE; |
| 1404 | bond_dev->priv_flags = flags | dst_release_flag; | 1411 | bond_dev->priv_flags = flags | dst_release_flag; |
diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c index d04911d33b64..47618e505355 100644 --- a/drivers/net/ethernet/8390/ne.c +++ b/drivers/net/ethernet/8390/ne.c | |||
| @@ -813,6 +813,7 @@ static int __init ne_drv_probe(struct platform_device *pdev) | |||
| 813 | dev->irq = irq[this_dev]; | 813 | dev->irq = irq[this_dev]; |
| 814 | dev->mem_end = bad[this_dev]; | 814 | dev->mem_end = bad[this_dev]; |
| 815 | } | 815 | } |
| 816 | SET_NETDEV_DEV(dev, &pdev->dev); | ||
| 816 | err = do_ne_probe(dev); | 817 | err = do_ne_probe(dev); |
| 817 | if (err) { | 818 | if (err) { |
| 818 | free_netdev(dev); | 819 | free_netdev(dev); |
diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c index fb9f6b38511f..edf5edb13140 100644 --- a/drivers/net/ethernet/sis/sis900.c +++ b/drivers/net/ethernet/sis/sis900.c | |||
| @@ -2479,7 +2479,7 @@ static int sis900_resume(struct pci_dev *pci_dev) | |||
| 2479 | netif_start_queue(net_dev); | 2479 | netif_start_queue(net_dev); |
| 2480 | 2480 | ||
| 2481 | /* Workaround for EDB */ | 2481 | /* Workaround for EDB */ |
| 2482 | sis900_set_mode(ioaddr, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED); | 2482 | sis900_set_mode(sis_priv, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED); |
| 2483 | 2483 | ||
| 2484 | /* Enable all known interrupts by setting the interrupt mask. */ | 2484 | /* Enable all known interrupts by setting the interrupt mask. */ |
| 2485 | sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE); | 2485 | sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE); |
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 77e6db9dcfed..a788501e978e 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c | |||
| @@ -894,6 +894,8 @@ out: | |||
| 894 | return IRQ_HANDLED; | 894 | return IRQ_HANDLED; |
| 895 | } | 895 | } |
| 896 | 896 | ||
| 897 | static void axienet_dma_err_handler(unsigned long data); | ||
| 898 | |||
| 897 | /** | 899 | /** |
| 898 | * axienet_open - Driver open routine. | 900 | * axienet_open - Driver open routine. |
| 899 | * @ndev: Pointer to net_device structure | 901 | * @ndev: Pointer to net_device structure |
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index 98934bdf6acf..477d6729b17f 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c | |||
| @@ -1102,10 +1102,12 @@ static int init_queues(struct port *port) | |||
| 1102 | { | 1102 | { |
| 1103 | int i; | 1103 | int i; |
| 1104 | 1104 | ||
| 1105 | if (!ports_open) | 1105 | if (!ports_open) { |
| 1106 | if (!(dma_pool = dma_pool_create(DRV_NAME, NULL, | 1106 | dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev, |
| 1107 | POOL_ALLOC_SIZE, 32, 0))) | 1107 | POOL_ALLOC_SIZE, 32, 0); |
| 1108 | if (!dma_pool) | ||
| 1108 | return -ENOMEM; | 1109 | return -ENOMEM; |
| 1110 | } | ||
| 1109 | 1111 | ||
| 1110 | if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL, | 1112 | if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL, |
| 1111 | &port->desc_tab_phys))) | 1113 | &port->desc_tab_phys))) |
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c index 5039f08f5a5b..43e9ab4f4d7e 100644 --- a/drivers/net/irda/sir_dev.c +++ b/drivers/net/irda/sir_dev.c | |||
| @@ -222,7 +222,7 @@ static void sirdev_config_fsm(struct work_struct *work) | |||
| 222 | break; | 222 | break; |
| 223 | 223 | ||
| 224 | case SIRDEV_STATE_DONGLE_SPEED: | 224 | case SIRDEV_STATE_DONGLE_SPEED: |
| 225 | if (dev->dongle_drv->reset) { | 225 | if (dev->dongle_drv->set_speed) { |
| 226 | ret = dev->dongle_drv->set_speed(dev, fsm->param); | 226 | ret = dev->dongle_drv->set_speed(dev, fsm->param); |
| 227 | if (ret < 0) { | 227 | if (ret < 0) { |
| 228 | fsm->result = ret; | 228 | fsm->result = ret; |
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c index 899274f2f9b1..2ed1140df3e9 100644 --- a/drivers/net/phy/mdio-gpio.c +++ b/drivers/net/phy/mdio-gpio.c | |||
| @@ -185,17 +185,20 @@ static int __devinit mdio_gpio_probe(struct platform_device *pdev) | |||
| 185 | { | 185 | { |
| 186 | struct mdio_gpio_platform_data *pdata; | 186 | struct mdio_gpio_platform_data *pdata; |
| 187 | struct mii_bus *new_bus; | 187 | struct mii_bus *new_bus; |
| 188 | int ret; | 188 | int ret, bus_id; |
| 189 | 189 | ||
| 190 | if (pdev->dev.of_node) | 190 | if (pdev->dev.of_node) { |
| 191 | pdata = mdio_gpio_of_get_data(pdev); | 191 | pdata = mdio_gpio_of_get_data(pdev); |
| 192 | else | 192 | bus_id = of_alias_get_id(pdev->dev.of_node, "mdio-gpio"); |
| 193 | } else { | ||
| 193 | pdata = pdev->dev.platform_data; | 194 | pdata = pdev->dev.platform_data; |
| 195 | bus_id = pdev->id; | ||
| 196 | } | ||
| 194 | 197 | ||
| 195 | if (!pdata) | 198 | if (!pdata) |
| 196 | return -ENODEV; | 199 | return -ENODEV; |
| 197 | 200 | ||
| 198 | new_bus = mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id); | 201 | new_bus = mdio_gpio_bus_init(&pdev->dev, pdata, bus_id); |
| 199 | if (!new_bus) | 202 | if (!new_bus) |
| 200 | return -ENODEV; | 203 | return -ENODEV; |
| 201 | 204 | ||
diff --git a/drivers/net/team/team_mode_broadcast.c b/drivers/net/team/team_mode_broadcast.c index 9db0171e9366..c5db428e73fa 100644 --- a/drivers/net/team/team_mode_broadcast.c +++ b/drivers/net/team/team_mode_broadcast.c | |||
| @@ -29,8 +29,8 @@ static bool bc_transmit(struct team *team, struct sk_buff *skb) | |||
| 29 | if (last) { | 29 | if (last) { |
| 30 | skb2 = skb_clone(skb, GFP_ATOMIC); | 30 | skb2 = skb_clone(skb, GFP_ATOMIC); |
| 31 | if (skb2) { | 31 | if (skb2) { |
| 32 | ret = team_dev_queue_xmit(team, last, | 32 | ret = !team_dev_queue_xmit(team, last, |
| 33 | skb2); | 33 | skb2); |
| 34 | if (!sum_ret) | 34 | if (!sum_ret) |
| 35 | sum_ret = ret; | 35 | sum_ret = ret; |
| 36 | } | 36 | } |
| @@ -39,7 +39,7 @@ static bool bc_transmit(struct team *team, struct sk_buff *skb) | |||
| 39 | } | 39 | } |
| 40 | } | 40 | } |
| 41 | if (last) { | 41 | if (last) { |
| 42 | ret = team_dev_queue_xmit(team, last, skb); | 42 | ret = !team_dev_queue_xmit(team, last, skb); |
| 43 | if (!sum_ret) | 43 | if (!sum_ret) |
| 44 | sum_ret = ret; | 44 | sum_ret = ret; |
| 45 | } | 45 | } |
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index 3f575afd8cfc..e9a3da588e95 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c | |||
| @@ -969,10 +969,12 @@ static int init_hdlc_queues(struct port *port) | |||
| 969 | { | 969 | { |
| 970 | int i; | 970 | int i; |
| 971 | 971 | ||
| 972 | if (!ports_open) | 972 | if (!ports_open) { |
| 973 | if (!(dma_pool = dma_pool_create(DRV_NAME, NULL, | 973 | dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev, |
| 974 | POOL_ALLOC_SIZE, 32, 0))) | 974 | POOL_ALLOC_SIZE, 32, 0); |
| 975 | if (!dma_pool) | ||
| 975 | return -ENOMEM; | 976 | return -ENOMEM; |
| 977 | } | ||
| 976 | 978 | ||
| 977 | if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL, | 979 | if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL, |
| 978 | &port->desc_tab_phys))) | 980 | &port->desc_tab_phys))) |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 8e1559aba495..1829b445d0b0 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
| @@ -1456,7 +1456,7 @@ static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type) | |||
| 1456 | switch (type) { | 1456 | switch (type) { |
| 1457 | case ATH9K_RESET_POWER_ON: | 1457 | case ATH9K_RESET_POWER_ON: |
| 1458 | ret = ath9k_hw_set_reset_power_on(ah); | 1458 | ret = ath9k_hw_set_reset_power_on(ah); |
| 1459 | if (!ret) | 1459 | if (ret) |
| 1460 | ah->reset_power_on = true; | 1460 | ah->reset_power_on = true; |
| 1461 | break; | 1461 | break; |
| 1462 | case ATH9K_RESET_WARM: | 1462 | case ATH9K_RESET_WARM: |
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c index fa4d1b8cd9f6..2d9eee93c743 100644 --- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c | |||
| @@ -1354,6 +1354,20 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw, | |||
| 1354 | vif_priv->ctx = ctx; | 1354 | vif_priv->ctx = ctx; |
| 1355 | ctx->vif = vif; | 1355 | ctx->vif = vif; |
| 1356 | 1356 | ||
| 1357 | /* | ||
| 1358 | * In SNIFFER device type, the firmware reports the FCS to | ||
| 1359 | * the host, rather than snipping it off. Unfortunately, | ||
| 1360 | * mac80211 doesn't (yet) provide a per-packet flag for | ||
| 1361 | * this, so that we have to set the hardware flag based | ||
| 1362 | * on the interfaces added. As the monitor interface can | ||
| 1363 | * only be present by itself, and will be removed before | ||
| 1364 | * other interfaces are added, this is safe. | ||
| 1365 | */ | ||
| 1366 | if (vif->type == NL80211_IFTYPE_MONITOR) | ||
| 1367 | priv->hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS; | ||
| 1368 | else | ||
| 1369 | priv->hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS; | ||
| 1370 | |||
| 1357 | err = iwl_setup_interface(priv, ctx); | 1371 | err = iwl_setup_interface(priv, ctx); |
| 1358 | if (!err || reset) | 1372 | if (!err || reset) |
| 1359 | goto out; | 1373 | goto out; |
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index 105e3af3c621..79a4ddc002d3 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c | |||
| @@ -480,20 +480,12 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo, | |||
| 480 | void iwl_trans_pcie_txq_disable(struct iwl_trans *trans, int txq_id) | 480 | void iwl_trans_pcie_txq_disable(struct iwl_trans *trans, int txq_id) |
| 481 | { | 481 | { |
| 482 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 482 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
| 483 | u16 rd_ptr, wr_ptr; | ||
| 484 | int n_bd = trans_pcie->txq[txq_id].q.n_bd; | ||
| 485 | 483 | ||
| 486 | if (!test_and_clear_bit(txq_id, trans_pcie->queue_used)) { | 484 | if (!test_and_clear_bit(txq_id, trans_pcie->queue_used)) { |
| 487 | WARN_ONCE(1, "queue %d not used", txq_id); | 485 | WARN_ONCE(1, "queue %d not used", txq_id); |
| 488 | return; | 486 | return; |
| 489 | } | 487 | } |
| 490 | 488 | ||
| 491 | rd_ptr = iwl_read_prph(trans, SCD_QUEUE_RDPTR(txq_id)) & (n_bd - 1); | ||
| 492 | wr_ptr = iwl_read_prph(trans, SCD_QUEUE_WRPTR(txq_id)); | ||
| 493 | |||
| 494 | WARN_ONCE(rd_ptr != wr_ptr, "queue %d isn't empty: [%d,%d]", | ||
| 495 | txq_id, rd_ptr, wr_ptr); | ||
| 496 | |||
| 497 | iwl_txq_set_inactive(trans, txq_id); | 489 | iwl_txq_set_inactive(trans, txq_id); |
| 498 | IWL_DEBUG_TX_QUEUES(trans, "Deactivate queue %d\n", txq_id); | 490 | IWL_DEBUG_TX_QUEUES(trans, "Deactivate queue %d\n", txq_id); |
| 499 | } | 491 | } |
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 8d465107f52b..ae9010ed58de 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c | |||
| @@ -890,9 +890,6 @@ mwifiex_cmd_timeout_func(unsigned long function_context) | |||
| 890 | return; | 890 | return; |
| 891 | } | 891 | } |
| 892 | cmd_node = adapter->curr_cmd; | 892 | cmd_node = adapter->curr_cmd; |
| 893 | if (cmd_node->wait_q_enabled) | ||
| 894 | adapter->cmd_wait_q.status = -ETIMEDOUT; | ||
| 895 | |||
| 896 | if (cmd_node) { | 893 | if (cmd_node) { |
| 897 | adapter->dbg.timeout_cmd_id = | 894 | adapter->dbg.timeout_cmd_id = |
| 898 | adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index]; | 895 | adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index]; |
| @@ -938,6 +935,14 @@ mwifiex_cmd_timeout_func(unsigned long function_context) | |||
| 938 | 935 | ||
| 939 | dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n", | 936 | dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n", |
| 940 | adapter->ps_mode, adapter->ps_state); | 937 | adapter->ps_mode, adapter->ps_state); |
| 938 | |||
| 939 | if (cmd_node->wait_q_enabled) { | ||
| 940 | adapter->cmd_wait_q.status = -ETIMEDOUT; | ||
| 941 | wake_up_interruptible(&adapter->cmd_wait_q.wait); | ||
| 942 | mwifiex_cancel_pending_ioctl(adapter); | ||
| 943 | /* reset cmd_sent flag to unblock new commands */ | ||
| 944 | adapter->cmd_sent = false; | ||
| 945 | } | ||
| 941 | } | 946 | } |
| 942 | if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) | 947 | if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) |
| 943 | mwifiex_init_fw_complete(adapter); | 948 | mwifiex_init_fw_complete(adapter); |
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index fc8a9bfa1248..82cf0fa2d9f6 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c | |||
| @@ -161,7 +161,6 @@ static int mwifiex_sdio_suspend(struct device *dev) | |||
| 161 | struct sdio_mmc_card *card; | 161 | struct sdio_mmc_card *card; |
| 162 | struct mwifiex_adapter *adapter; | 162 | struct mwifiex_adapter *adapter; |
| 163 | mmc_pm_flag_t pm_flag = 0; | 163 | mmc_pm_flag_t pm_flag = 0; |
| 164 | int hs_actived = 0; | ||
| 165 | int i; | 164 | int i; |
| 166 | int ret = 0; | 165 | int ret = 0; |
| 167 | 166 | ||
| @@ -188,12 +187,14 @@ static int mwifiex_sdio_suspend(struct device *dev) | |||
| 188 | adapter = card->adapter; | 187 | adapter = card->adapter; |
| 189 | 188 | ||
| 190 | /* Enable the Host Sleep */ | 189 | /* Enable the Host Sleep */ |
| 191 | hs_actived = mwifiex_enable_hs(adapter); | 190 | if (!mwifiex_enable_hs(adapter)) { |
| 192 | if (hs_actived) { | 191 | dev_err(adapter->dev, "cmd: failed to suspend\n"); |
| 193 | pr_debug("cmd: suspend with MMC_PM_KEEP_POWER\n"); | 192 | return -EFAULT; |
| 194 | ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER); | ||
| 195 | } | 193 | } |
| 196 | 194 | ||
| 195 | dev_dbg(adapter->dev, "cmd: suspend with MMC_PM_KEEP_POWER\n"); | ||
| 196 | ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER); | ||
| 197 | |||
| 197 | /* Indicate device suspended */ | 198 | /* Indicate device suspended */ |
| 198 | adapter->is_suspended = true; | 199 | adapter->is_suspended = true; |
| 199 | 200 | ||
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c index 9970c2b1b199..b7e6607e6b6d 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | |||
| @@ -297,6 +297,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = { | |||
| 297 | /*=== Customer ID ===*/ | 297 | /*=== Customer ID ===*/ |
| 298 | /****** 8188CU ********/ | 298 | /****** 8188CU ********/ |
| 299 | {RTL_USB_DEVICE(0x050d, 0x1102, rtl92cu_hal_cfg)}, /*Belkin - Edimax*/ | 299 | {RTL_USB_DEVICE(0x050d, 0x1102, rtl92cu_hal_cfg)}, /*Belkin - Edimax*/ |
| 300 | {RTL_USB_DEVICE(0x050d, 0x11f2, rtl92cu_hal_cfg)}, /*Belkin - ISY*/ | ||
| 300 | {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/ | 301 | {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/ |
| 301 | {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ | 302 | {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ |
| 302 | {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ | 303 | {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index caa011008cd0..fc24eb9b3948 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
| @@ -452,29 +452,85 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev, | |||
| 452 | /* Grant backend access to each skb fragment page. */ | 452 | /* Grant backend access to each skb fragment page. */ |
| 453 | for (i = 0; i < frags; i++) { | 453 | for (i = 0; i < frags; i++) { |
| 454 | skb_frag_t *frag = skb_shinfo(skb)->frags + i; | 454 | skb_frag_t *frag = skb_shinfo(skb)->frags + i; |
| 455 | struct page *page = skb_frag_page(frag); | ||
| 455 | 456 | ||
| 456 | tx->flags |= XEN_NETTXF_more_data; | 457 | len = skb_frag_size(frag); |
| 458 | offset = frag->page_offset; | ||
| 457 | 459 | ||
| 458 | id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs); | 460 | /* Data must not cross a page boundary. */ |
| 459 | np->tx_skbs[id].skb = skb_get(skb); | 461 | BUG_ON(len + offset > PAGE_SIZE<<compound_order(page)); |
| 460 | tx = RING_GET_REQUEST(&np->tx, prod++); | ||
| 461 | tx->id = id; | ||
| 462 | ref = gnttab_claim_grant_reference(&np->gref_tx_head); | ||
| 463 | BUG_ON((signed short)ref < 0); | ||
| 464 | 462 | ||
| 465 | mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag))); | 463 | /* Skip unused frames from start of page */ |
| 466 | gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id, | 464 | page += offset >> PAGE_SHIFT; |
| 467 | mfn, GNTMAP_readonly); | 465 | offset &= ~PAGE_MASK; |
| 468 | 466 | ||
| 469 | tx->gref = np->grant_tx_ref[id] = ref; | 467 | while (len > 0) { |
| 470 | tx->offset = frag->page_offset; | 468 | unsigned long bytes; |
| 471 | tx->size = skb_frag_size(frag); | 469 | |
| 472 | tx->flags = 0; | 470 | BUG_ON(offset >= PAGE_SIZE); |
| 471 | |||
| 472 | bytes = PAGE_SIZE - offset; | ||
| 473 | if (bytes > len) | ||
| 474 | bytes = len; | ||
| 475 | |||
| 476 | tx->flags |= XEN_NETTXF_more_data; | ||
| 477 | |||
| 478 | id = get_id_from_freelist(&np->tx_skb_freelist, | ||
| 479 | np->tx_skbs); | ||
| 480 | np->tx_skbs[id].skb = skb_get(skb); | ||
| 481 | tx = RING_GET_REQUEST(&np->tx, prod++); | ||
| 482 | tx->id = id; | ||
| 483 | ref = gnttab_claim_grant_reference(&np->gref_tx_head); | ||
| 484 | BUG_ON((signed short)ref < 0); | ||
| 485 | |||
| 486 | mfn = pfn_to_mfn(page_to_pfn(page)); | ||
| 487 | gnttab_grant_foreign_access_ref(ref, | ||
| 488 | np->xbdev->otherend_id, | ||
| 489 | mfn, GNTMAP_readonly); | ||
| 490 | |||
| 491 | tx->gref = np->grant_tx_ref[id] = ref; | ||
| 492 | tx->offset = offset; | ||
| 493 | tx->size = bytes; | ||
| 494 | tx->flags = 0; | ||
| 495 | |||
| 496 | offset += bytes; | ||
| 497 | len -= bytes; | ||
| 498 | |||
| 499 | /* Next frame */ | ||
| 500 | if (offset == PAGE_SIZE && len) { | ||
| 501 | BUG_ON(!PageCompound(page)); | ||
| 502 | page++; | ||
| 503 | offset = 0; | ||
| 504 | } | ||
| 505 | } | ||
| 473 | } | 506 | } |
| 474 | 507 | ||
| 475 | np->tx.req_prod_pvt = prod; | 508 | np->tx.req_prod_pvt = prod; |
| 476 | } | 509 | } |
| 477 | 510 | ||
| 511 | /* | ||
| 512 | * Count how many ring slots are required to send the frags of this | ||
| 513 | * skb. Each frag might be a compound page. | ||
| 514 | */ | ||
| 515 | static int xennet_count_skb_frag_slots(struct sk_buff *skb) | ||
| 516 | { | ||
| 517 | int i, frags = skb_shinfo(skb)->nr_frags; | ||
| 518 | int pages = 0; | ||
| 519 | |||
| 520 | for (i = 0; i < frags; i++) { | ||
| 521 | skb_frag_t *frag = skb_shinfo(skb)->frags + i; | ||
| 522 | unsigned long size = skb_frag_size(frag); | ||
| 523 | unsigned long offset = frag->page_offset; | ||
| 524 | |||
| 525 | /* Skip unused frames from start of page */ | ||
| 526 | offset &= ~PAGE_MASK; | ||
| 527 | |||
| 528 | pages += PFN_UP(offset + size); | ||
| 529 | } | ||
| 530 | |||
| 531 | return pages; | ||
| 532 | } | ||
| 533 | |||
| 478 | static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev) | 534 | static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev) |
| 479 | { | 535 | { |
| 480 | unsigned short id; | 536 | unsigned short id; |
| @@ -487,23 +543,23 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 487 | grant_ref_t ref; | 543 | grant_ref_t ref; |
| 488 | unsigned long mfn; | 544 | unsigned long mfn; |
| 489 | int notify; | 545 | int notify; |
| 490 | int frags = skb_shinfo(skb)->nr_frags; | 546 | int slots; |
| 491 | unsigned int offset = offset_in_page(data); | 547 | unsigned int offset = offset_in_page(data); |
| 492 | unsigned int len = skb_headlen(skb); | 548 | unsigned int len = skb_headlen(skb); |
| 493 | unsigned long flags; | 549 | unsigned long flags; |
| 494 | 550 | ||
| 495 | frags += DIV_ROUND_UP(offset + len, PAGE_SIZE); | 551 | slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) + |
| 496 | if (unlikely(frags > MAX_SKB_FRAGS + 1)) { | 552 | xennet_count_skb_frag_slots(skb); |
| 497 | printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n", | 553 | if (unlikely(slots > MAX_SKB_FRAGS + 1)) { |
| 498 | frags); | 554 | net_alert_ratelimited( |
| 499 | dump_stack(); | 555 | "xennet: skb rides the rocket: %d slots\n", slots); |
| 500 | goto drop; | 556 | goto drop; |
| 501 | } | 557 | } |
| 502 | 558 | ||
| 503 | spin_lock_irqsave(&np->tx_lock, flags); | 559 | spin_lock_irqsave(&np->tx_lock, flags); |
| 504 | 560 | ||
| 505 | if (unlikely(!netif_carrier_ok(dev) || | 561 | if (unlikely(!netif_carrier_ok(dev) || |
| 506 | (frags > 1 && !xennet_can_sg(dev)) || | 562 | (slots > 1 && !xennet_can_sg(dev)) || |
| 507 | netif_needs_gso(skb, netif_skb_features(skb)))) { | 563 | netif_needs_gso(skb, netif_skb_features(skb)))) { |
| 508 | spin_unlock_irqrestore(&np->tx_lock, flags); | 564 | spin_unlock_irqrestore(&np->tx_lock, flags); |
| 509 | goto drop; | 565 | goto drop; |
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c index 97c440a8cd61..30ae18a03a9c 100644 --- a/drivers/nfc/pn533.c +++ b/drivers/nfc/pn533.c | |||
| @@ -698,13 +698,14 @@ static void pn533_wq_cmd(struct work_struct *work) | |||
| 698 | 698 | ||
| 699 | cmd = list_first_entry(&dev->cmd_queue, struct pn533_cmd, queue); | 699 | cmd = list_first_entry(&dev->cmd_queue, struct pn533_cmd, queue); |
| 700 | 700 | ||
| 701 | list_del(&cmd->queue); | ||
| 702 | |||
| 701 | mutex_unlock(&dev->cmd_lock); | 703 | mutex_unlock(&dev->cmd_lock); |
| 702 | 704 | ||
| 703 | __pn533_send_cmd_frame_async(dev, cmd->out_frame, cmd->in_frame, | 705 | __pn533_send_cmd_frame_async(dev, cmd->out_frame, cmd->in_frame, |
| 704 | cmd->in_frame_len, cmd->cmd_complete, | 706 | cmd->in_frame_len, cmd->cmd_complete, |
| 705 | cmd->arg, cmd->flags); | 707 | cmd->arg, cmd->flags); |
| 706 | 708 | ||
| 707 | list_del(&cmd->queue); | ||
| 708 | kfree(cmd); | 709 | kfree(cmd); |
| 709 | } | 710 | } |
| 710 | 711 | ||
| @@ -1678,11 +1679,14 @@ static void pn533_deactivate_target(struct nfc_dev *nfc_dev, | |||
| 1678 | static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg, | 1679 | static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg, |
| 1679 | u8 *params, int params_len) | 1680 | u8 *params, int params_len) |
| 1680 | { | 1681 | { |
| 1681 | struct pn533_cmd_jump_dep *cmd; | ||
| 1682 | struct pn533_cmd_jump_dep_response *resp; | 1682 | struct pn533_cmd_jump_dep_response *resp; |
| 1683 | struct nfc_target nfc_target; | 1683 | struct nfc_target nfc_target; |
| 1684 | u8 target_gt_len; | 1684 | u8 target_gt_len; |
| 1685 | int rc; | 1685 | int rc; |
| 1686 | struct pn533_cmd_jump_dep *cmd = (struct pn533_cmd_jump_dep *)arg; | ||
| 1687 | u8 active = cmd->active; | ||
| 1688 | |||
| 1689 | kfree(arg); | ||
| 1686 | 1690 | ||
| 1687 | if (params_len == -ENOENT) { | 1691 | if (params_len == -ENOENT) { |
| 1688 | nfc_dev_dbg(&dev->interface->dev, ""); | 1692 | nfc_dev_dbg(&dev->interface->dev, ""); |
| @@ -1704,7 +1708,6 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg, | |||
| 1704 | } | 1708 | } |
| 1705 | 1709 | ||
| 1706 | resp = (struct pn533_cmd_jump_dep_response *) params; | 1710 | resp = (struct pn533_cmd_jump_dep_response *) params; |
| 1707 | cmd = (struct pn533_cmd_jump_dep *) arg; | ||
| 1708 | rc = resp->status & PN533_CMD_RET_MASK; | 1711 | rc = resp->status & PN533_CMD_RET_MASK; |
| 1709 | if (rc != PN533_CMD_RET_SUCCESS) { | 1712 | if (rc != PN533_CMD_RET_SUCCESS) { |
| 1710 | nfc_dev_err(&dev->interface->dev, | 1713 | nfc_dev_err(&dev->interface->dev, |
| @@ -1734,7 +1737,7 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg, | |||
| 1734 | if (rc == 0) | 1737 | if (rc == 0) |
| 1735 | rc = nfc_dep_link_is_up(dev->nfc_dev, | 1738 | rc = nfc_dep_link_is_up(dev->nfc_dev, |
| 1736 | dev->nfc_dev->targets[0].idx, | 1739 | dev->nfc_dev->targets[0].idx, |
| 1737 | !cmd->active, NFC_RF_INITIATOR); | 1740 | !active, NFC_RF_INITIATOR); |
| 1738 | 1741 | ||
| 1739 | return 0; | 1742 | return 0; |
| 1740 | } | 1743 | } |
| @@ -1819,12 +1822,8 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target, | |||
| 1819 | rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame, | 1822 | rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame, |
| 1820 | dev->in_maxlen, pn533_in_dep_link_up_complete, | 1823 | dev->in_maxlen, pn533_in_dep_link_up_complete, |
| 1821 | cmd, GFP_KERNEL); | 1824 | cmd, GFP_KERNEL); |
| 1822 | if (rc) | 1825 | if (rc < 0) |
| 1823 | goto out; | 1826 | kfree(cmd); |
| 1824 | |||
| 1825 | |||
| 1826 | out: | ||
| 1827 | kfree(cmd); | ||
| 1828 | 1827 | ||
| 1829 | return rc; | 1828 | return rc; |
| 1830 | } | 1829 | } |
| @@ -2078,8 +2077,12 @@ error: | |||
| 2078 | static int pn533_tm_send_complete(struct pn533 *dev, void *arg, | 2077 | static int pn533_tm_send_complete(struct pn533 *dev, void *arg, |
| 2079 | u8 *params, int params_len) | 2078 | u8 *params, int params_len) |
| 2080 | { | 2079 | { |
| 2080 | struct sk_buff *skb_out = arg; | ||
| 2081 | |||
| 2081 | nfc_dev_dbg(&dev->interface->dev, "%s", __func__); | 2082 | nfc_dev_dbg(&dev->interface->dev, "%s", __func__); |
| 2082 | 2083 | ||
| 2084 | dev_kfree_skb(skb_out); | ||
| 2085 | |||
| 2083 | if (params_len < 0) { | 2086 | if (params_len < 0) { |
| 2084 | nfc_dev_err(&dev->interface->dev, | 2087 | nfc_dev_err(&dev->interface->dev, |
| 2085 | "Error %d when sending data", | 2088 | "Error %d when sending data", |
| @@ -2117,7 +2120,7 @@ static int pn533_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb) | |||
| 2117 | 2120 | ||
| 2118 | rc = pn533_send_cmd_frame_async(dev, out_frame, dev->in_frame, | 2121 | rc = pn533_send_cmd_frame_async(dev, out_frame, dev->in_frame, |
| 2119 | dev->in_maxlen, pn533_tm_send_complete, | 2122 | dev->in_maxlen, pn533_tm_send_complete, |
| 2120 | NULL, GFP_KERNEL); | 2123 | skb, GFP_KERNEL); |
| 2121 | if (rc) { | 2124 | if (rc) { |
| 2122 | nfc_dev_err(&dev->interface->dev, | 2125 | nfc_dev_err(&dev->interface->dev, |
| 2123 | "Error %d when trying to send data", rc); | 2126 | "Error %d when trying to send data", rc); |
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index d96caefd914a..aeecf0f72cad 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig | |||
| @@ -178,7 +178,7 @@ config PINCTRL_COH901 | |||
| 178 | ports of 8 GPIO pins each. | 178 | ports of 8 GPIO pins each. |
| 179 | 179 | ||
| 180 | config PINCTRL_SAMSUNG | 180 | config PINCTRL_SAMSUNG |
| 181 | bool "Samsung pinctrl driver" | 181 | bool |
| 182 | depends on OF && GPIOLIB | 182 | depends on OF && GPIOLIB |
| 183 | select PINMUX | 183 | select PINMUX |
| 184 | select PINCONF | 184 | select PINCONF |
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c index c1bafc3f3fb1..9594ab62702b 100644 --- a/drivers/scsi/isci/request.c +++ b/drivers/scsi/isci/request.c | |||
| @@ -1972,7 +1972,7 @@ sci_io_request_frame_handler(struct isci_request *ireq, | |||
| 1972 | frame_index, | 1972 | frame_index, |
| 1973 | (void **)&frame_buffer); | 1973 | (void **)&frame_buffer); |
| 1974 | 1974 | ||
| 1975 | sci_controller_copy_sata_response(&ireq->stp.req, | 1975 | sci_controller_copy_sata_response(&ireq->stp.rsp, |
| 1976 | frame_header, | 1976 | frame_header, |
| 1977 | frame_buffer); | 1977 | frame_buffer); |
| 1978 | 1978 | ||
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 2936b447cae9..2c0d0ec8150b 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
| @@ -55,6 +55,7 @@ | |||
| 55 | #include <linux/cpu.h> | 55 | #include <linux/cpu.h> |
| 56 | #include <linux/mutex.h> | 56 | #include <linux/mutex.h> |
| 57 | #include <linux/async.h> | 57 | #include <linux/async.h> |
| 58 | #include <asm/unaligned.h> | ||
| 58 | 59 | ||
| 59 | #include <scsi/scsi.h> | 60 | #include <scsi/scsi.h> |
| 60 | #include <scsi/scsi_cmnd.h> | 61 | #include <scsi/scsi_cmnd.h> |
| @@ -1062,6 +1063,50 @@ int scsi_get_vpd_page(struct scsi_device *sdev, u8 page, unsigned char *buf, | |||
| 1062 | EXPORT_SYMBOL_GPL(scsi_get_vpd_page); | 1063 | EXPORT_SYMBOL_GPL(scsi_get_vpd_page); |
| 1063 | 1064 | ||
| 1064 | /** | 1065 | /** |
| 1066 | * scsi_report_opcode - Find out if a given command opcode is supported | ||
| 1067 | * @sdev: scsi device to query | ||
| 1068 | * @buffer: scratch buffer (must be at least 20 bytes long) | ||
| 1069 | * @len: length of buffer | ||
| 1070 | * @opcode: opcode for command to look up | ||
| 1071 | * | ||
| 1072 | * Uses the REPORT SUPPORTED OPERATION CODES to look up the given | ||
| 1073 | * opcode. Returns 0 if RSOC fails or if the command opcode is | ||
| 1074 | * unsupported. Returns 1 if the device claims to support the command. | ||
| 1075 | */ | ||
| 1076 | int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, | ||
| 1077 | unsigned int len, unsigned char opcode) | ||
| 1078 | { | ||
| 1079 | unsigned char cmd[16]; | ||
| 1080 | struct scsi_sense_hdr sshdr; | ||
| 1081 | int result; | ||
| 1082 | |||
| 1083 | if (sdev->no_report_opcodes || sdev->scsi_level < SCSI_SPC_3) | ||
| 1084 | return 0; | ||
| 1085 | |||
| 1086 | memset(cmd, 0, 16); | ||
| 1087 | cmd[0] = MAINTENANCE_IN; | ||
| 1088 | cmd[1] = MI_REPORT_SUPPORTED_OPERATION_CODES; | ||
| 1089 | cmd[2] = 1; /* One command format */ | ||
| 1090 | cmd[3] = opcode; | ||
| 1091 | put_unaligned_be32(len, &cmd[6]); | ||
| 1092 | memset(buffer, 0, len); | ||
| 1093 | |||
| 1094 | result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, len, | ||
| 1095 | &sshdr, 30 * HZ, 3, NULL); | ||
| 1096 | |||
| 1097 | if (result && scsi_sense_valid(&sshdr) && | ||
| 1098 | sshdr.sense_key == ILLEGAL_REQUEST && | ||
| 1099 | (sshdr.asc == 0x20 || sshdr.asc == 0x24) && sshdr.ascq == 0x00) | ||
| 1100 | return 0; | ||
| 1101 | |||
| 1102 | if ((buffer[1] & 3) == 3) /* Command supported */ | ||
| 1103 | return 1; | ||
| 1104 | |||
| 1105 | return 0; | ||
| 1106 | } | ||
| 1107 | EXPORT_SYMBOL(scsi_report_opcode); | ||
| 1108 | |||
| 1109 | /** | ||
| 1065 | * scsi_device_get - get an additional reference to a scsi_device | 1110 | * scsi_device_get - get an additional reference to a scsi_device |
| 1066 | * @sdev: device to get a reference to | 1111 | * @sdev: device to get a reference to |
| 1067 | * | 1112 | * |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index da36a3a81a9e..9032e910bca3 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
| @@ -900,11 +900,23 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) | |||
| 900 | action = ACTION_FAIL; | 900 | action = ACTION_FAIL; |
| 901 | error = -EILSEQ; | 901 | error = -EILSEQ; |
| 902 | /* INVALID COMMAND OPCODE or INVALID FIELD IN CDB */ | 902 | /* INVALID COMMAND OPCODE or INVALID FIELD IN CDB */ |
| 903 | } else if ((sshdr.asc == 0x20 || sshdr.asc == 0x24) && | 903 | } else if (sshdr.asc == 0x20 || sshdr.asc == 0x24) { |
| 904 | (cmd->cmnd[0] == UNMAP || | 904 | switch (cmd->cmnd[0]) { |
| 905 | cmd->cmnd[0] == WRITE_SAME_16 || | 905 | case UNMAP: |
| 906 | cmd->cmnd[0] == WRITE_SAME)) { | 906 | description = "Discard failure"; |
| 907 | description = "Discard failure"; | 907 | break; |
| 908 | case WRITE_SAME: | ||
| 909 | case WRITE_SAME_16: | ||
| 910 | if (cmd->cmnd[1] & 0x8) | ||
| 911 | description = "Discard failure"; | ||
| 912 | else | ||
| 913 | description = | ||
| 914 | "Write same failure"; | ||
| 915 | break; | ||
| 916 | default: | ||
| 917 | description = "Invalid command failure"; | ||
| 918 | break; | ||
| 919 | } | ||
| 908 | action = ACTION_FAIL; | 920 | action = ACTION_FAIL; |
| 909 | error = -EREMOTEIO; | 921 | error = -EREMOTEIO; |
| 910 | } else | 922 | } else |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 12f6fdfc1147..352bc77b7c88 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
| @@ -99,6 +99,7 @@ MODULE_ALIAS_SCSI_DEVICE(TYPE_RBC); | |||
| 99 | #endif | 99 | #endif |
| 100 | 100 | ||
| 101 | static void sd_config_discard(struct scsi_disk *, unsigned int); | 101 | static void sd_config_discard(struct scsi_disk *, unsigned int); |
| 102 | static void sd_config_write_same(struct scsi_disk *); | ||
| 102 | static int sd_revalidate_disk(struct gendisk *); | 103 | static int sd_revalidate_disk(struct gendisk *); |
| 103 | static void sd_unlock_native_capacity(struct gendisk *disk); | 104 | static void sd_unlock_native_capacity(struct gendisk *disk); |
| 104 | static int sd_probe(struct device *); | 105 | static int sd_probe(struct device *); |
| @@ -395,6 +396,45 @@ sd_store_max_medium_access_timeouts(struct device *dev, | |||
| 395 | return err ? err : count; | 396 | return err ? err : count; |
| 396 | } | 397 | } |
| 397 | 398 | ||
| 399 | static ssize_t | ||
| 400 | sd_show_write_same_blocks(struct device *dev, struct device_attribute *attr, | ||
| 401 | char *buf) | ||
| 402 | { | ||
| 403 | struct scsi_disk *sdkp = to_scsi_disk(dev); | ||
| 404 | |||
| 405 | return snprintf(buf, 20, "%u\n", sdkp->max_ws_blocks); | ||
| 406 | } | ||
| 407 | |||
| 408 | static ssize_t | ||
| 409 | sd_store_write_same_blocks(struct device *dev, struct device_attribute *attr, | ||
| 410 | const char *buf, size_t count) | ||
| 411 | { | ||
| 412 | struct scsi_disk *sdkp = to_scsi_disk(dev); | ||
| 413 | struct scsi_device *sdp = sdkp->device; | ||
| 414 | unsigned long max; | ||
| 415 | int err; | ||
| 416 | |||
| 417 | if (!capable(CAP_SYS_ADMIN)) | ||
| 418 | return -EACCES; | ||
| 419 | |||
| 420 | if (sdp->type != TYPE_DISK) | ||
| 421 | return -EINVAL; | ||
| 422 | |||
| 423 | err = kstrtoul(buf, 10, &max); | ||
| 424 | |||
| 425 | if (err) | ||
| 426 | return err; | ||
| 427 | |||
| 428 | if (max == 0) | ||
| 429 | sdp->no_write_same = 1; | ||
| 430 | else if (max <= SD_MAX_WS16_BLOCKS) | ||
| 431 | sdkp->max_ws_blocks = max; | ||
| 432 | |||
| 433 | sd_config_write_same(sdkp); | ||
| 434 | |||
| 435 | return count; | ||
| 436 | } | ||
| 437 | |||
| 398 | static struct device_attribute sd_disk_attrs[] = { | 438 | static struct device_attribute sd_disk_attrs[] = { |
| 399 | __ATTR(cache_type, S_IRUGO|S_IWUSR, sd_show_cache_type, | 439 | __ATTR(cache_type, S_IRUGO|S_IWUSR, sd_show_cache_type, |
| 400 | sd_store_cache_type), | 440 | sd_store_cache_type), |
| @@ -410,6 +450,8 @@ static struct device_attribute sd_disk_attrs[] = { | |||
| 410 | __ATTR(thin_provisioning, S_IRUGO, sd_show_thin_provisioning, NULL), | 450 | __ATTR(thin_provisioning, S_IRUGO, sd_show_thin_provisioning, NULL), |
| 411 | __ATTR(provisioning_mode, S_IRUGO|S_IWUSR, sd_show_provisioning_mode, | 451 | __ATTR(provisioning_mode, S_IRUGO|S_IWUSR, sd_show_provisioning_mode, |
| 412 | sd_store_provisioning_mode), | 452 | sd_store_provisioning_mode), |
| 453 | __ATTR(max_write_same_blocks, S_IRUGO|S_IWUSR, | ||
| 454 | sd_show_write_same_blocks, sd_store_write_same_blocks), | ||
| 413 | __ATTR(max_medium_access_timeouts, S_IRUGO|S_IWUSR, | 455 | __ATTR(max_medium_access_timeouts, S_IRUGO|S_IWUSR, |
| 414 | sd_show_max_medium_access_timeouts, | 456 | sd_show_max_medium_access_timeouts, |
| 415 | sd_store_max_medium_access_timeouts), | 457 | sd_store_max_medium_access_timeouts), |
| @@ -561,19 +603,23 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode) | |||
| 561 | return; | 603 | return; |
| 562 | 604 | ||
| 563 | case SD_LBP_UNMAP: | 605 | case SD_LBP_UNMAP: |
| 564 | max_blocks = min_not_zero(sdkp->max_unmap_blocks, 0xffffffff); | 606 | max_blocks = min_not_zero(sdkp->max_unmap_blocks, |
| 607 | (u32)SD_MAX_WS16_BLOCKS); | ||
| 565 | break; | 608 | break; |
| 566 | 609 | ||
| 567 | case SD_LBP_WS16: | 610 | case SD_LBP_WS16: |
| 568 | max_blocks = min_not_zero(sdkp->max_ws_blocks, 0xffffffff); | 611 | max_blocks = min_not_zero(sdkp->max_ws_blocks, |
| 612 | (u32)SD_MAX_WS16_BLOCKS); | ||
| 569 | break; | 613 | break; |
| 570 | 614 | ||
| 571 | case SD_LBP_WS10: | 615 | case SD_LBP_WS10: |
| 572 | max_blocks = min_not_zero(sdkp->max_ws_blocks, (u32)0xffff); | 616 | max_blocks = min_not_zero(sdkp->max_ws_blocks, |
| 617 | (u32)SD_MAX_WS10_BLOCKS); | ||
| 573 | break; | 618 | break; |
| 574 | 619 | ||
| 575 | case SD_LBP_ZERO: | 620 | case SD_LBP_ZERO: |
| 576 | max_blocks = min_not_zero(sdkp->max_ws_blocks, (u32)0xffff); | 621 | max_blocks = min_not_zero(sdkp->max_ws_blocks, |
| 622 | (u32)SD_MAX_WS10_BLOCKS); | ||
| 577 | q->limits.discard_zeroes_data = 1; | 623 | q->limits.discard_zeroes_data = 1; |
| 578 | break; | 624 | break; |
| 579 | } | 625 | } |
| @@ -583,29 +629,26 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode) | |||
| 583 | } | 629 | } |
| 584 | 630 | ||
| 585 | /** | 631 | /** |
| 586 | * scsi_setup_discard_cmnd - unmap blocks on thinly provisioned device | 632 | * sd_setup_discard_cmnd - unmap blocks on thinly provisioned device |
| 587 | * @sdp: scsi device to operate one | 633 | * @sdp: scsi device to operate one |
| 588 | * @rq: Request to prepare | 634 | * @rq: Request to prepare |
| 589 | * | 635 | * |
| 590 | * Will issue either UNMAP or WRITE SAME(16) depending on preference | 636 | * Will issue either UNMAP or WRITE SAME(16) depending on preference |
| 591 | * indicated by target device. | 637 | * indicated by target device. |
| 592 | **/ | 638 | **/ |
| 593 | static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq) | 639 | static int sd_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq) |
| 594 | { | 640 | { |
| 595 | struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); | 641 | struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); |
| 596 | struct bio *bio = rq->bio; | 642 | sector_t sector = blk_rq_pos(rq); |
| 597 | sector_t sector = bio->bi_sector; | 643 | unsigned int nr_sectors = blk_rq_sectors(rq); |
| 598 | unsigned int nr_sectors = bio_sectors(bio); | 644 | unsigned int nr_bytes = blk_rq_bytes(rq); |
| 599 | unsigned int len; | 645 | unsigned int len; |
| 600 | int ret; | 646 | int ret; |
| 601 | char *buf; | 647 | char *buf; |
| 602 | struct page *page; | 648 | struct page *page; |
| 603 | 649 | ||
| 604 | if (sdkp->device->sector_size == 4096) { | 650 | sector >>= ilog2(sdp->sector_size) - 9; |
| 605 | sector >>= 3; | 651 | nr_sectors >>= ilog2(sdp->sector_size) - 9; |
| 606 | nr_sectors >>= 3; | ||
| 607 | } | ||
| 608 | |||
| 609 | rq->timeout = SD_TIMEOUT; | 652 | rq->timeout = SD_TIMEOUT; |
| 610 | 653 | ||
| 611 | memset(rq->cmd, 0, rq->cmd_len); | 654 | memset(rq->cmd, 0, rq->cmd_len); |
| @@ -660,6 +703,7 @@ static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq) | |||
| 660 | blk_add_request_payload(rq, page, len); | 703 | blk_add_request_payload(rq, page, len); |
| 661 | ret = scsi_setup_blk_pc_cmnd(sdp, rq); | 704 | ret = scsi_setup_blk_pc_cmnd(sdp, rq); |
| 662 | rq->buffer = page_address(page); | 705 | rq->buffer = page_address(page); |
| 706 | rq->__data_len = nr_bytes; | ||
| 663 | 707 | ||
| 664 | out: | 708 | out: |
| 665 | if (ret != BLKPREP_OK) { | 709 | if (ret != BLKPREP_OK) { |
| @@ -669,6 +713,83 @@ out: | |||
| 669 | return ret; | 713 | return ret; |
| 670 | } | 714 | } |
| 671 | 715 | ||
| 716 | static void sd_config_write_same(struct scsi_disk *sdkp) | ||
| 717 | { | ||
| 718 | struct request_queue *q = sdkp->disk->queue; | ||
| 719 | unsigned int logical_block_size = sdkp->device->sector_size; | ||
| 720 | unsigned int blocks = 0; | ||
| 721 | |||
| 722 | if (sdkp->device->no_write_same) { | ||
| 723 | sdkp->max_ws_blocks = 0; | ||
| 724 | goto out; | ||
| 725 | } | ||
| 726 | |||
| 727 | /* Some devices can not handle block counts above 0xffff despite | ||
| 728 | * supporting WRITE SAME(16). Consequently we default to 64k | ||
| 729 | * blocks per I/O unless the device explicitly advertises a | ||
| 730 | * bigger limit. | ||
| 731 | */ | ||
| 732 | if (sdkp->max_ws_blocks == 0) | ||
| 733 | sdkp->max_ws_blocks = SD_MAX_WS10_BLOCKS; | ||
| 734 | |||
| 735 | if (sdkp->ws16 || sdkp->max_ws_blocks > SD_MAX_WS10_BLOCKS) | ||
| 736 | blocks = min_not_zero(sdkp->max_ws_blocks, | ||
| 737 | (u32)SD_MAX_WS16_BLOCKS); | ||
| 738 | else | ||
| 739 | blocks = min_not_zero(sdkp->max_ws_blocks, | ||
| 740 | (u32)SD_MAX_WS10_BLOCKS); | ||
| 741 | |||
| 742 | out: | ||
| 743 | blk_queue_max_write_same_sectors(q, blocks * (logical_block_size >> 9)); | ||
| 744 | } | ||
| 745 | |||
| 746 | /** | ||
| 747 | * sd_setup_write_same_cmnd - write the same data to multiple blocks | ||
| 748 | * @sdp: scsi device to operate one | ||
| 749 | * @rq: Request to prepare | ||
| 750 | * | ||
| 751 | * Will issue either WRITE SAME(10) or WRITE SAME(16) depending on | ||
| 752 | * preference indicated by target device. | ||
| 753 | **/ | ||
| 754 | static int sd_setup_write_same_cmnd(struct scsi_device *sdp, struct request *rq) | ||
| 755 | { | ||
| 756 | struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); | ||
| 757 | struct bio *bio = rq->bio; | ||
| 758 | sector_t sector = blk_rq_pos(rq); | ||
| 759 | unsigned int nr_sectors = blk_rq_sectors(rq); | ||
| 760 | unsigned int nr_bytes = blk_rq_bytes(rq); | ||
| 761 | int ret; | ||
| 762 | |||
| 763 | if (sdkp->device->no_write_same) | ||
| 764 | return BLKPREP_KILL; | ||
| 765 | |||
| 766 | BUG_ON(bio_offset(bio) || bio_iovec(bio)->bv_len != sdp->sector_size); | ||
| 767 | |||
| 768 | sector >>= ilog2(sdp->sector_size) - 9; | ||
| 769 | nr_sectors >>= ilog2(sdp->sector_size) - 9; | ||
| 770 | |||
| 771 | rq->__data_len = sdp->sector_size; | ||
| 772 | rq->timeout = SD_WRITE_SAME_TIMEOUT; | ||
| 773 | memset(rq->cmd, 0, rq->cmd_len); | ||
| 774 | |||
| 775 | if (sdkp->ws16 || sector > 0xffffffff || nr_sectors > 0xffff) { | ||
| 776 | rq->cmd_len = 16; | ||
| 777 | rq->cmd[0] = WRITE_SAME_16; | ||
| 778 | put_unaligned_be64(sector, &rq->cmd[2]); | ||
| 779 | put_unaligned_be32(nr_sectors, &rq->cmd[10]); | ||
| 780 | } else { | ||
| 781 | rq->cmd_len = 10; | ||
| 782 | rq->cmd[0] = WRITE_SAME; | ||
| 783 | put_unaligned_be32(sector, &rq->cmd[2]); | ||
| 784 | put_unaligned_be16(nr_sectors, &rq->cmd[7]); | ||
| 785 | } | ||
| 786 | |||
| 787 | ret = scsi_setup_blk_pc_cmnd(sdp, rq); | ||
| 788 | rq->__data_len = nr_bytes; | ||
| 789 | |||
| 790 | return ret; | ||
| 791 | } | ||
| 792 | |||
| 672 | static int scsi_setup_flush_cmnd(struct scsi_device *sdp, struct request *rq) | 793 | static int scsi_setup_flush_cmnd(struct scsi_device *sdp, struct request *rq) |
| 673 | { | 794 | { |
| 674 | rq->timeout = SD_FLUSH_TIMEOUT; | 795 | rq->timeout = SD_FLUSH_TIMEOUT; |
| @@ -712,7 +833,10 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
| 712 | * block PC requests to make life easier. | 833 | * block PC requests to make life easier. |
| 713 | */ | 834 | */ |
| 714 | if (rq->cmd_flags & REQ_DISCARD) { | 835 | if (rq->cmd_flags & REQ_DISCARD) { |
| 715 | ret = scsi_setup_discard_cmnd(sdp, rq); | 836 | ret = sd_setup_discard_cmnd(sdp, rq); |
| 837 | goto out; | ||
| 838 | } else if (rq->cmd_flags & REQ_WRITE_SAME) { | ||
| 839 | ret = sd_setup_write_same_cmnd(sdp, rq); | ||
| 716 | goto out; | 840 | goto out; |
| 717 | } else if (rq->cmd_flags & REQ_FLUSH) { | 841 | } else if (rq->cmd_flags & REQ_FLUSH) { |
| 718 | ret = scsi_setup_flush_cmnd(sdp, rq); | 842 | ret = scsi_setup_flush_cmnd(sdp, rq); |
| @@ -1482,12 +1606,21 @@ static int sd_done(struct scsi_cmnd *SCpnt) | |||
| 1482 | unsigned int good_bytes = result ? 0 : scsi_bufflen(SCpnt); | 1606 | unsigned int good_bytes = result ? 0 : scsi_bufflen(SCpnt); |
| 1483 | struct scsi_sense_hdr sshdr; | 1607 | struct scsi_sense_hdr sshdr; |
| 1484 | struct scsi_disk *sdkp = scsi_disk(SCpnt->request->rq_disk); | 1608 | struct scsi_disk *sdkp = scsi_disk(SCpnt->request->rq_disk); |
| 1609 | struct request *req = SCpnt->request; | ||
| 1485 | int sense_valid = 0; | 1610 | int sense_valid = 0; |
| 1486 | int sense_deferred = 0; | 1611 | int sense_deferred = 0; |
| 1487 | unsigned char op = SCpnt->cmnd[0]; | 1612 | unsigned char op = SCpnt->cmnd[0]; |
| 1613 | unsigned char unmap = SCpnt->cmnd[1] & 8; | ||
| 1488 | 1614 | ||
| 1489 | if ((SCpnt->request->cmd_flags & REQ_DISCARD) && !result) | 1615 | if (req->cmd_flags & REQ_DISCARD || req->cmd_flags & REQ_WRITE_SAME) { |
| 1490 | scsi_set_resid(SCpnt, 0); | 1616 | if (!result) { |
| 1617 | good_bytes = blk_rq_bytes(req); | ||
| 1618 | scsi_set_resid(SCpnt, 0); | ||
| 1619 | } else { | ||
| 1620 | good_bytes = 0; | ||
| 1621 | scsi_set_resid(SCpnt, blk_rq_bytes(req)); | ||
| 1622 | } | ||
| 1623 | } | ||
| 1491 | 1624 | ||
| 1492 | if (result) { | 1625 | if (result) { |
| 1493 | sense_valid = scsi_command_normalize_sense(SCpnt, &sshdr); | 1626 | sense_valid = scsi_command_normalize_sense(SCpnt, &sshdr); |
| @@ -1536,9 +1669,25 @@ static int sd_done(struct scsi_cmnd *SCpnt) | |||
| 1536 | if (sshdr.asc == 0x10) /* DIX: Host detected corruption */ | 1669 | if (sshdr.asc == 0x10) /* DIX: Host detected corruption */ |
| 1537 | good_bytes = sd_completed_bytes(SCpnt); | 1670 | good_bytes = sd_completed_bytes(SCpnt); |
| 1538 | /* INVALID COMMAND OPCODE or INVALID FIELD IN CDB */ | 1671 | /* INVALID COMMAND OPCODE or INVALID FIELD IN CDB */ |
| 1539 | if ((sshdr.asc == 0x20 || sshdr.asc == 0x24) && | 1672 | if (sshdr.asc == 0x20 || sshdr.asc == 0x24) { |
| 1540 | (op == UNMAP || op == WRITE_SAME_16 || op == WRITE_SAME)) | 1673 | switch (op) { |
| 1541 | sd_config_discard(sdkp, SD_LBP_DISABLE); | 1674 | case UNMAP: |
| 1675 | sd_config_discard(sdkp, SD_LBP_DISABLE); | ||
| 1676 | break; | ||
| 1677 | case WRITE_SAME_16: | ||
| 1678 | case WRITE_SAME: | ||
| 1679 | if (unmap) | ||
| 1680 | sd_config_discard(sdkp, SD_LBP_DISABLE); | ||
| 1681 | else { | ||
| 1682 | sdkp->device->no_write_same = 1; | ||
| 1683 | sd_config_write_same(sdkp); | ||
| 1684 | |||
| 1685 | good_bytes = 0; | ||
| 1686 | req->__data_len = blk_rq_bytes(req); | ||
| 1687 | req->cmd_flags |= REQ_QUIET; | ||
| 1688 | } | ||
| 1689 | } | ||
| 1690 | } | ||
| 1542 | break; | 1691 | break; |
| 1543 | default: | 1692 | default: |
| 1544 | break; | 1693 | break; |
| @@ -2374,9 +2523,7 @@ static void sd_read_block_limits(struct scsi_disk *sdkp) | |||
| 2374 | if (buffer[3] == 0x3c) { | 2523 | if (buffer[3] == 0x3c) { |
| 2375 | unsigned int lba_count, desc_count; | 2524 | unsigned int lba_count, desc_count; |
| 2376 | 2525 | ||
| 2377 | sdkp->max_ws_blocks = | 2526 | sdkp->max_ws_blocks = (u32)get_unaligned_be64(&buffer[36]); |
| 2378 | (u32) min_not_zero(get_unaligned_be64(&buffer[36]), | ||
| 2379 | (u64)0xffffffff); | ||
| 2380 | 2527 | ||
| 2381 | if (!sdkp->lbpme) | 2528 | if (!sdkp->lbpme) |
| 2382 | goto out; | 2529 | goto out; |
| @@ -2469,6 +2616,13 @@ static void sd_read_block_provisioning(struct scsi_disk *sdkp) | |||
| 2469 | kfree(buffer); | 2616 | kfree(buffer); |
| 2470 | } | 2617 | } |
| 2471 | 2618 | ||
| 2619 | static void sd_read_write_same(struct scsi_disk *sdkp, unsigned char *buffer) | ||
| 2620 | { | ||
| 2621 | if (scsi_report_opcode(sdkp->device, buffer, SD_BUF_SIZE, | ||
| 2622 | WRITE_SAME_16)) | ||
| 2623 | sdkp->ws16 = 1; | ||
| 2624 | } | ||
| 2625 | |||
| 2472 | static int sd_try_extended_inquiry(struct scsi_device *sdp) | 2626 | static int sd_try_extended_inquiry(struct scsi_device *sdp) |
| 2473 | { | 2627 | { |
| 2474 | /* | 2628 | /* |
| @@ -2528,6 +2682,7 @@ static int sd_revalidate_disk(struct gendisk *disk) | |||
| 2528 | sd_read_write_protect_flag(sdkp, buffer); | 2682 | sd_read_write_protect_flag(sdkp, buffer); |
| 2529 | sd_read_cache_type(sdkp, buffer); | 2683 | sd_read_cache_type(sdkp, buffer); |
| 2530 | sd_read_app_tag_own(sdkp, buffer); | 2684 | sd_read_app_tag_own(sdkp, buffer); |
| 2685 | sd_read_write_same(sdkp, buffer); | ||
| 2531 | } | 2686 | } |
| 2532 | 2687 | ||
| 2533 | sdkp->first_scan = 0; | 2688 | sdkp->first_scan = 0; |
| @@ -2545,6 +2700,7 @@ static int sd_revalidate_disk(struct gendisk *disk) | |||
| 2545 | blk_queue_flush(sdkp->disk->queue, flush); | 2700 | blk_queue_flush(sdkp->disk->queue, flush); |
| 2546 | 2701 | ||
| 2547 | set_capacity(disk, sdkp->capacity); | 2702 | set_capacity(disk, sdkp->capacity); |
| 2703 | sd_config_write_same(sdkp); | ||
| 2548 | kfree(buffer); | 2704 | kfree(buffer); |
| 2549 | 2705 | ||
| 2550 | out: | 2706 | out: |
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h index 47c52a6d733c..74a1e4ca5401 100644 --- a/drivers/scsi/sd.h +++ b/drivers/scsi/sd.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #define SD_TIMEOUT (30 * HZ) | 14 | #define SD_TIMEOUT (30 * HZ) |
| 15 | #define SD_MOD_TIMEOUT (75 * HZ) | 15 | #define SD_MOD_TIMEOUT (75 * HZ) |
| 16 | #define SD_FLUSH_TIMEOUT (60 * HZ) | 16 | #define SD_FLUSH_TIMEOUT (60 * HZ) |
| 17 | #define SD_WRITE_SAME_TIMEOUT (120 * HZ) | ||
| 17 | 18 | ||
| 18 | /* | 19 | /* |
| 19 | * Number of allowed retries | 20 | * Number of allowed retries |
| @@ -39,6 +40,11 @@ enum { | |||
| 39 | }; | 40 | }; |
| 40 | 41 | ||
| 41 | enum { | 42 | enum { |
| 43 | SD_MAX_WS10_BLOCKS = 0xffff, | ||
| 44 | SD_MAX_WS16_BLOCKS = 0x7fffff, | ||
| 45 | }; | ||
| 46 | |||
| 47 | enum { | ||
| 42 | SD_LBP_FULL = 0, /* Full logical block provisioning */ | 48 | SD_LBP_FULL = 0, /* Full logical block provisioning */ |
| 43 | SD_LBP_UNMAP, /* Use UNMAP command */ | 49 | SD_LBP_UNMAP, /* Use UNMAP command */ |
| 44 | SD_LBP_WS16, /* Use WRITE SAME(16) with UNMAP bit */ | 50 | SD_LBP_WS16, /* Use WRITE SAME(16) with UNMAP bit */ |
| @@ -77,6 +83,7 @@ struct scsi_disk { | |||
| 77 | unsigned lbpws : 1; | 83 | unsigned lbpws : 1; |
| 78 | unsigned lbpws10 : 1; | 84 | unsigned lbpws10 : 1; |
| 79 | unsigned lbpvpd : 1; | 85 | unsigned lbpvpd : 1; |
| 86 | unsigned ws16 : 1; | ||
| 80 | }; | 87 | }; |
| 81 | #define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev) | 88 | #define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev) |
| 82 | 89 | ||
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index a3d54366afcc..92f35abee92d 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
| @@ -186,6 +186,12 @@ static int slave_configure(struct scsi_device *sdev) | |||
| 186 | /* Some devices don't handle VPD pages correctly */ | 186 | /* Some devices don't handle VPD pages correctly */ |
| 187 | sdev->skip_vpd_pages = 1; | 187 | sdev->skip_vpd_pages = 1; |
| 188 | 188 | ||
| 189 | /* Do not attempt to use REPORT SUPPORTED OPERATION CODES */ | ||
| 190 | sdev->no_report_opcodes = 1; | ||
| 191 | |||
| 192 | /* Do not attempt to use WRITE SAME */ | ||
| 193 | sdev->no_write_same = 1; | ||
| 194 | |||
| 189 | /* Some disks return the total number of blocks in response | 195 | /* Some disks return the total number of blocks in response |
| 190 | * to READ CAPACITY rather than the highest block number. | 196 | * to READ CAPACITY rather than the highest block number. |
| 191 | * If this device makes that mistake, tell the sd driver. */ | 197 | * If this device makes that mistake, tell the sd driver. */ |
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 8adb9cc267f9..71f5c459b088 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c | |||
| @@ -361,13 +361,13 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version) | |||
| 361 | down_write(&mm->mmap_sem); | 361 | down_write(&mm->mmap_sem); |
| 362 | 362 | ||
| 363 | vma = find_vma(mm, m.addr); | 363 | vma = find_vma(mm, m.addr); |
| 364 | ret = -EINVAL; | ||
| 365 | if (!vma || | 364 | if (!vma || |
| 366 | vma->vm_ops != &privcmd_vm_ops || | 365 | vma->vm_ops != &privcmd_vm_ops || |
| 367 | (m.addr != vma->vm_start) || | 366 | (m.addr != vma->vm_start) || |
| 368 | ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) || | 367 | ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) || |
| 369 | !privcmd_enforce_singleshot_mapping(vma)) { | 368 | !privcmd_enforce_singleshot_mapping(vma)) { |
| 370 | up_write(&mm->mmap_sem); | 369 | up_write(&mm->mmap_sem); |
| 370 | ret = -EINVAL; | ||
| 371 | goto out; | 371 | goto out; |
| 372 | } | 372 | } |
| 373 | 373 | ||
| @@ -383,12 +383,16 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version) | |||
| 383 | 383 | ||
| 384 | up_write(&mm->mmap_sem); | 384 | up_write(&mm->mmap_sem); |
| 385 | 385 | ||
| 386 | if (state.global_error && (version == 1)) { | 386 | if (version == 1) { |
| 387 | /* Write back errors in second pass. */ | 387 | if (state.global_error) { |
| 388 | state.user_mfn = (xen_pfn_t *)m.arr; | 388 | /* Write back errors in second pass. */ |
| 389 | state.err = err_array; | 389 | state.user_mfn = (xen_pfn_t *)m.arr; |
| 390 | ret = traverse_pages(m.num, sizeof(xen_pfn_t), | 390 | state.err = err_array; |
| 391 | &pagelist, mmap_return_errors_v1, &state); | 391 | ret = traverse_pages(m.num, sizeof(xen_pfn_t), |
| 392 | &pagelist, mmap_return_errors_v1, &state); | ||
| 393 | } else | ||
| 394 | ret = 0; | ||
| 395 | |||
| 392 | } else if (version == 2) { | 396 | } else if (version == 2) { |
| 393 | ret = __copy_to_user(m.err, err_array, m.num * sizeof(int)); | 397 | ret = __copy_to_user(m.err, err_array, m.num * sizeof(int)); |
| 394 | if (ret) | 398 | if (ret) |
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index 7320a66e958f..22548f56197b 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c | |||
| @@ -2101,8 +2101,9 @@ int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range) | |||
| 2101 | end = start + (range->len >> sb->s_blocksize_bits) - 1; | 2101 | end = start + (range->len >> sb->s_blocksize_bits) - 1; |
| 2102 | minlen = range->minlen >> sb->s_blocksize_bits; | 2102 | minlen = range->minlen >> sb->s_blocksize_bits; |
| 2103 | 2103 | ||
| 2104 | if (unlikely(minlen > EXT3_BLOCKS_PER_GROUP(sb)) || | 2104 | if (minlen > EXT3_BLOCKS_PER_GROUP(sb) || |
| 2105 | unlikely(start >= max_blks)) | 2105 | start >= max_blks || |
| 2106 | range->len < sb->s_blocksize) | ||
| 2106 | return -EINVAL; | 2107 | return -EINVAL; |
| 2107 | if (end >= max_blks) | 2108 | if (end >= max_blks) |
| 2108 | end = max_blks - 1; | 2109 | end = max_blks - 1; |
| @@ -685,7 +685,6 @@ void do_close_on_exec(struct files_struct *files) | |||
| 685 | struct fdtable *fdt; | 685 | struct fdtable *fdt; |
| 686 | 686 | ||
| 687 | /* exec unshares first */ | 687 | /* exec unshares first */ |
| 688 | BUG_ON(atomic_read(&files->count) != 1); | ||
| 689 | spin_lock(&files->file_lock); | 688 | spin_lock(&files->file_lock); |
| 690 | for (i = 0; ; i++) { | 689 | for (i = 0; ; i++) { |
| 691 | unsigned long set; | 690 | unsigned long set; |
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 721d692fa8d4..6fcaeb8c902e 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
| @@ -258,7 +258,8 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, | |||
| 258 | if (ret) | 258 | if (ret) |
| 259 | goto out_close_fd; | 259 | goto out_close_fd; |
| 260 | 260 | ||
| 261 | fd_install(fd, f); | 261 | if (fd != FAN_NOFD) |
| 262 | fd_install(fd, f); | ||
| 262 | return fanotify_event_metadata.event_len; | 263 | return fanotify_event_metadata.event_len; |
| 263 | 264 | ||
| 264 | out_close_fd: | 265 | out_close_fd: |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index f27f01a98aa2..d83736fbc26c 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
| @@ -1782,8 +1782,9 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
| 1782 | 1782 | ||
| 1783 | BUG_ON(!th->t_trans_id); | 1783 | BUG_ON(!th->t_trans_id); |
| 1784 | 1784 | ||
| 1785 | dquot_initialize(inode); | 1785 | reiserfs_write_unlock(inode->i_sb); |
| 1786 | err = dquot_alloc_inode(inode); | 1786 | err = dquot_alloc_inode(inode); |
| 1787 | reiserfs_write_lock(inode->i_sb); | ||
| 1787 | if (err) | 1788 | if (err) |
| 1788 | goto out_end_trans; | 1789 | goto out_end_trans; |
| 1789 | if (!dir->i_nlink) { | 1790 | if (!dir->i_nlink) { |
| @@ -1979,8 +1980,10 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
| 1979 | 1980 | ||
| 1980 | out_end_trans: | 1981 | out_end_trans: |
| 1981 | journal_end(th, th->t_super, th->t_blocks_allocated); | 1982 | journal_end(th, th->t_super, th->t_blocks_allocated); |
| 1983 | reiserfs_write_unlock(inode->i_sb); | ||
| 1982 | /* Drop can be outside and it needs more credits so it's better to have it outside */ | 1984 | /* Drop can be outside and it needs more credits so it's better to have it outside */ |
| 1983 | dquot_drop(inode); | 1985 | dquot_drop(inode); |
| 1986 | reiserfs_write_lock(inode->i_sb); | ||
| 1984 | inode->i_flags |= S_NOQUOTA; | 1987 | inode->i_flags |= S_NOQUOTA; |
| 1985 | make_bad_inode(inode); | 1988 | make_bad_inode(inode); |
| 1986 | 1989 | ||
| @@ -3103,10 +3106,9 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
| 3103 | /* must be turned off for recursive notify_change calls */ | 3106 | /* must be turned off for recursive notify_change calls */ |
| 3104 | ia_valid = attr->ia_valid &= ~(ATTR_KILL_SUID|ATTR_KILL_SGID); | 3107 | ia_valid = attr->ia_valid &= ~(ATTR_KILL_SUID|ATTR_KILL_SGID); |
| 3105 | 3108 | ||
| 3106 | depth = reiserfs_write_lock_once(inode->i_sb); | ||
| 3107 | if (is_quota_modification(inode, attr)) | 3109 | if (is_quota_modification(inode, attr)) |
| 3108 | dquot_initialize(inode); | 3110 | dquot_initialize(inode); |
| 3109 | 3111 | depth = reiserfs_write_lock_once(inode->i_sb); | |
| 3110 | if (attr->ia_valid & ATTR_SIZE) { | 3112 | if (attr->ia_valid & ATTR_SIZE) { |
| 3111 | /* version 2 items will be caught by the s_maxbytes check | 3113 | /* version 2 items will be caught by the s_maxbytes check |
| 3112 | ** done for us in vmtruncate | 3114 | ** done for us in vmtruncate |
| @@ -3170,7 +3172,9 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
| 3170 | error = journal_begin(&th, inode->i_sb, jbegin_count); | 3172 | error = journal_begin(&th, inode->i_sb, jbegin_count); |
| 3171 | if (error) | 3173 | if (error) |
| 3172 | goto out; | 3174 | goto out; |
| 3175 | reiserfs_write_unlock_once(inode->i_sb, depth); | ||
| 3173 | error = dquot_transfer(inode, attr); | 3176 | error = dquot_transfer(inode, attr); |
| 3177 | depth = reiserfs_write_lock_once(inode->i_sb); | ||
| 3174 | if (error) { | 3178 | if (error) { |
| 3175 | journal_end(&th, inode->i_sb, jbegin_count); | 3179 | journal_end(&th, inode->i_sb, jbegin_count); |
| 3176 | goto out; | 3180 | goto out; |
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index f8afa4b162b8..2f40a4c70a4d 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c | |||
| @@ -1968,7 +1968,9 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree | |||
| 1968 | key2type(&(key->on_disk_key))); | 1968 | key2type(&(key->on_disk_key))); |
| 1969 | #endif | 1969 | #endif |
| 1970 | 1970 | ||
| 1971 | reiserfs_write_unlock(inode->i_sb); | ||
| 1971 | retval = dquot_alloc_space_nodirty(inode, pasted_size); | 1972 | retval = dquot_alloc_space_nodirty(inode, pasted_size); |
| 1973 | reiserfs_write_lock(inode->i_sb); | ||
| 1972 | if (retval) { | 1974 | if (retval) { |
| 1973 | pathrelse(search_path); | 1975 | pathrelse(search_path); |
| 1974 | return retval; | 1976 | return retval; |
| @@ -2061,9 +2063,11 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, | |||
| 2061 | "reiserquota insert_item(): allocating %u id=%u type=%c", | 2063 | "reiserquota insert_item(): allocating %u id=%u type=%c", |
| 2062 | quota_bytes, inode->i_uid, head2type(ih)); | 2064 | quota_bytes, inode->i_uid, head2type(ih)); |
| 2063 | #endif | 2065 | #endif |
| 2066 | reiserfs_write_unlock(inode->i_sb); | ||
| 2064 | /* We can't dirty inode here. It would be immediately written but | 2067 | /* We can't dirty inode here. It would be immediately written but |
| 2065 | * appropriate stat item isn't inserted yet... */ | 2068 | * appropriate stat item isn't inserted yet... */ |
| 2066 | retval = dquot_alloc_space_nodirty(inode, quota_bytes); | 2069 | retval = dquot_alloc_space_nodirty(inode, quota_bytes); |
| 2070 | reiserfs_write_lock(inode->i_sb); | ||
| 2067 | if (retval) { | 2071 | if (retval) { |
| 2068 | pathrelse(path); | 2072 | pathrelse(path); |
| 2069 | return retval; | 2073 | return retval; |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 1078ae179993..418bdc3a57da 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
| @@ -298,7 +298,9 @@ static int finish_unfinished(struct super_block *s) | |||
| 298 | retval = remove_save_link_only(s, &save_link_key, 0); | 298 | retval = remove_save_link_only(s, &save_link_key, 0); |
| 299 | continue; | 299 | continue; |
| 300 | } | 300 | } |
| 301 | reiserfs_write_unlock(s); | ||
| 301 | dquot_initialize(inode); | 302 | dquot_initialize(inode); |
| 303 | reiserfs_write_lock(s); | ||
| 302 | 304 | ||
| 303 | if (truncate && S_ISDIR(inode->i_mode)) { | 305 | if (truncate && S_ISDIR(inode->i_mode)) { |
| 304 | /* We got a truncate request for a dir which is impossible. | 306 | /* We got a truncate request for a dir which is impossible. |
| @@ -1335,7 +1337,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
| 1335 | kfree(qf_names[i]); | 1337 | kfree(qf_names[i]); |
| 1336 | #endif | 1338 | #endif |
| 1337 | err = -EINVAL; | 1339 | err = -EINVAL; |
| 1338 | goto out_err; | 1340 | goto out_unlock; |
| 1339 | } | 1341 | } |
| 1340 | #ifdef CONFIG_QUOTA | 1342 | #ifdef CONFIG_QUOTA |
| 1341 | handle_quota_files(s, qf_names, &qfmt); | 1343 | handle_quota_files(s, qf_names, &qfmt); |
| @@ -1379,7 +1381,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
| 1379 | if (blocks) { | 1381 | if (blocks) { |
| 1380 | err = reiserfs_resize(s, blocks); | 1382 | err = reiserfs_resize(s, blocks); |
| 1381 | if (err != 0) | 1383 | if (err != 0) |
| 1382 | goto out_err; | 1384 | goto out_unlock; |
| 1383 | } | 1385 | } |
| 1384 | 1386 | ||
| 1385 | if (*mount_flags & MS_RDONLY) { | 1387 | if (*mount_flags & MS_RDONLY) { |
| @@ -1389,9 +1391,15 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
| 1389 | /* it is read-only already */ | 1391 | /* it is read-only already */ |
| 1390 | goto out_ok; | 1392 | goto out_ok; |
| 1391 | 1393 | ||
| 1394 | /* | ||
| 1395 | * Drop write lock. Quota will retake it when needed and lock | ||
| 1396 | * ordering requires calling dquot_suspend() without it. | ||
| 1397 | */ | ||
| 1398 | reiserfs_write_unlock(s); | ||
| 1392 | err = dquot_suspend(s, -1); | 1399 | err = dquot_suspend(s, -1); |
| 1393 | if (err < 0) | 1400 | if (err < 0) |
| 1394 | goto out_err; | 1401 | goto out_err; |
| 1402 | reiserfs_write_lock(s); | ||
| 1395 | 1403 | ||
| 1396 | /* try to remount file system with read-only permissions */ | 1404 | /* try to remount file system with read-only permissions */ |
| 1397 | if (sb_umount_state(rs) == REISERFS_VALID_FS | 1405 | if (sb_umount_state(rs) == REISERFS_VALID_FS |
| @@ -1401,7 +1409,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
| 1401 | 1409 | ||
| 1402 | err = journal_begin(&th, s, 10); | 1410 | err = journal_begin(&th, s, 10); |
| 1403 | if (err) | 1411 | if (err) |
| 1404 | goto out_err; | 1412 | goto out_unlock; |
| 1405 | 1413 | ||
| 1406 | /* Mounting a rw partition read-only. */ | 1414 | /* Mounting a rw partition read-only. */ |
| 1407 | reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1); | 1415 | reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1); |
| @@ -1416,7 +1424,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
| 1416 | 1424 | ||
| 1417 | if (reiserfs_is_journal_aborted(journal)) { | 1425 | if (reiserfs_is_journal_aborted(journal)) { |
| 1418 | err = journal->j_errno; | 1426 | err = journal->j_errno; |
| 1419 | goto out_err; | 1427 | goto out_unlock; |
| 1420 | } | 1428 | } |
| 1421 | 1429 | ||
| 1422 | handle_data_mode(s, mount_options); | 1430 | handle_data_mode(s, mount_options); |
| @@ -1425,7 +1433,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
| 1425 | s->s_flags &= ~MS_RDONLY; /* now it is safe to call journal_begin */ | 1433 | s->s_flags &= ~MS_RDONLY; /* now it is safe to call journal_begin */ |
| 1426 | err = journal_begin(&th, s, 10); | 1434 | err = journal_begin(&th, s, 10); |
| 1427 | if (err) | 1435 | if (err) |
| 1428 | goto out_err; | 1436 | goto out_unlock; |
| 1429 | 1437 | ||
| 1430 | /* Mount a partition which is read-only, read-write */ | 1438 | /* Mount a partition which is read-only, read-write */ |
| 1431 | reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1); | 1439 | reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1); |
| @@ -1442,10 +1450,16 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
| 1442 | SB_JOURNAL(s)->j_must_wait = 1; | 1450 | SB_JOURNAL(s)->j_must_wait = 1; |
| 1443 | err = journal_end(&th, s, 10); | 1451 | err = journal_end(&th, s, 10); |
| 1444 | if (err) | 1452 | if (err) |
| 1445 | goto out_err; | 1453 | goto out_unlock; |
| 1446 | 1454 | ||
| 1447 | if (!(*mount_flags & MS_RDONLY)) { | 1455 | if (!(*mount_flags & MS_RDONLY)) { |
| 1456 | /* | ||
| 1457 | * Drop write lock. Quota will retake it when needed and lock | ||
| 1458 | * ordering requires calling dquot_resume() without it. | ||
| 1459 | */ | ||
| 1460 | reiserfs_write_unlock(s); | ||
| 1448 | dquot_resume(s, -1); | 1461 | dquot_resume(s, -1); |
| 1462 | reiserfs_write_lock(s); | ||
| 1449 | finish_unfinished(s); | 1463 | finish_unfinished(s); |
| 1450 | reiserfs_xattr_init(s, *mount_flags); | 1464 | reiserfs_xattr_init(s, *mount_flags); |
| 1451 | } | 1465 | } |
| @@ -1455,9 +1469,10 @@ out_ok: | |||
| 1455 | reiserfs_write_unlock(s); | 1469 | reiserfs_write_unlock(s); |
| 1456 | return 0; | 1470 | return 0; |
| 1457 | 1471 | ||
| 1472 | out_unlock: | ||
| 1473 | reiserfs_write_unlock(s); | ||
| 1458 | out_err: | 1474 | out_err: |
| 1459 | kfree(new_opts); | 1475 | kfree(new_opts); |
| 1460 | reiserfs_write_unlock(s); | ||
| 1461 | return err; | 1476 | return err; |
| 1462 | } | 1477 | } |
| 1463 | 1478 | ||
| @@ -2095,13 +2110,15 @@ static int reiserfs_write_dquot(struct dquot *dquot) | |||
| 2095 | REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb)); | 2110 | REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb)); |
| 2096 | if (ret) | 2111 | if (ret) |
| 2097 | goto out; | 2112 | goto out; |
| 2113 | reiserfs_write_unlock(dquot->dq_sb); | ||
| 2098 | ret = dquot_commit(dquot); | 2114 | ret = dquot_commit(dquot); |
| 2115 | reiserfs_write_lock(dquot->dq_sb); | ||
| 2099 | err = | 2116 | err = |
| 2100 | journal_end(&th, dquot->dq_sb, | 2117 | journal_end(&th, dquot->dq_sb, |
| 2101 | REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb)); | 2118 | REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb)); |
| 2102 | if (!ret && err) | 2119 | if (!ret && err) |
| 2103 | ret = err; | 2120 | ret = err; |
| 2104 | out: | 2121 | out: |
| 2105 | reiserfs_write_unlock(dquot->dq_sb); | 2122 | reiserfs_write_unlock(dquot->dq_sb); |
| 2106 | return ret; | 2123 | return ret; |
| 2107 | } | 2124 | } |
| @@ -2117,13 +2134,15 @@ static int reiserfs_acquire_dquot(struct dquot *dquot) | |||
| 2117 | REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb)); | 2134 | REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb)); |
| 2118 | if (ret) | 2135 | if (ret) |
| 2119 | goto out; | 2136 | goto out; |
| 2137 | reiserfs_write_unlock(dquot->dq_sb); | ||
| 2120 | ret = dquot_acquire(dquot); | 2138 | ret = dquot_acquire(dquot); |
| 2139 | reiserfs_write_lock(dquot->dq_sb); | ||
| 2121 | err = | 2140 | err = |
| 2122 | journal_end(&th, dquot->dq_sb, | 2141 | journal_end(&th, dquot->dq_sb, |
| 2123 | REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb)); | 2142 | REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb)); |
| 2124 | if (!ret && err) | 2143 | if (!ret && err) |
| 2125 | ret = err; | 2144 | ret = err; |
| 2126 | out: | 2145 | out: |
| 2127 | reiserfs_write_unlock(dquot->dq_sb); | 2146 | reiserfs_write_unlock(dquot->dq_sb); |
| 2128 | return ret; | 2147 | return ret; |
| 2129 | } | 2148 | } |
| @@ -2137,19 +2156,21 @@ static int reiserfs_release_dquot(struct dquot *dquot) | |||
| 2137 | ret = | 2156 | ret = |
| 2138 | journal_begin(&th, dquot->dq_sb, | 2157 | journal_begin(&th, dquot->dq_sb, |
| 2139 | REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb)); | 2158 | REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb)); |
| 2159 | reiserfs_write_unlock(dquot->dq_sb); | ||
| 2140 | if (ret) { | 2160 | if (ret) { |
| 2141 | /* Release dquot anyway to avoid endless cycle in dqput() */ | 2161 | /* Release dquot anyway to avoid endless cycle in dqput() */ |
| 2142 | dquot_release(dquot); | 2162 | dquot_release(dquot); |
| 2143 | goto out; | 2163 | goto out; |
| 2144 | } | 2164 | } |
| 2145 | ret = dquot_release(dquot); | 2165 | ret = dquot_release(dquot); |
| 2166 | reiserfs_write_lock(dquot->dq_sb); | ||
| 2146 | err = | 2167 | err = |
| 2147 | journal_end(&th, dquot->dq_sb, | 2168 | journal_end(&th, dquot->dq_sb, |
| 2148 | REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb)); | 2169 | REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb)); |
| 2149 | if (!ret && err) | 2170 | if (!ret && err) |
| 2150 | ret = err; | 2171 | ret = err; |
| 2151 | out: | ||
| 2152 | reiserfs_write_unlock(dquot->dq_sb); | 2172 | reiserfs_write_unlock(dquot->dq_sb); |
| 2173 | out: | ||
| 2153 | return ret; | 2174 | return ret; |
| 2154 | } | 2175 | } |
| 2155 | 2176 | ||
| @@ -2174,11 +2195,13 @@ static int reiserfs_write_info(struct super_block *sb, int type) | |||
| 2174 | ret = journal_begin(&th, sb, 2); | 2195 | ret = journal_begin(&th, sb, 2); |
| 2175 | if (ret) | 2196 | if (ret) |
| 2176 | goto out; | 2197 | goto out; |
| 2198 | reiserfs_write_unlock(sb); | ||
| 2177 | ret = dquot_commit_info(sb, type); | 2199 | ret = dquot_commit_info(sb, type); |
| 2200 | reiserfs_write_lock(sb); | ||
| 2178 | err = journal_end(&th, sb, 2); | 2201 | err = journal_end(&th, sb, 2); |
| 2179 | if (!ret && err) | 2202 | if (!ret && err) |
| 2180 | ret = err; | 2203 | ret = err; |
| 2181 | out: | 2204 | out: |
| 2182 | reiserfs_write_unlock(sb); | 2205 | reiserfs_write_unlock(sb); |
| 2183 | return ret; | 2206 | return ret; |
| 2184 | } | 2207 | } |
| @@ -2203,8 +2226,11 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
| 2203 | struct reiserfs_transaction_handle th; | 2226 | struct reiserfs_transaction_handle th; |
| 2204 | int opt = type == USRQUOTA ? REISERFS_USRQUOTA : REISERFS_GRPQUOTA; | 2227 | int opt = type == USRQUOTA ? REISERFS_USRQUOTA : REISERFS_GRPQUOTA; |
| 2205 | 2228 | ||
| 2206 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << opt))) | 2229 | reiserfs_write_lock(sb); |
| 2207 | return -EINVAL; | 2230 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << opt))) { |
| 2231 | err = -EINVAL; | ||
| 2232 | goto out; | ||
| 2233 | } | ||
| 2208 | 2234 | ||
| 2209 | /* Quotafile not on the same filesystem? */ | 2235 | /* Quotafile not on the same filesystem? */ |
| 2210 | if (path->dentry->d_sb != sb) { | 2236 | if (path->dentry->d_sb != sb) { |
| @@ -2246,8 +2272,10 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
| 2246 | if (err) | 2272 | if (err) |
| 2247 | goto out; | 2273 | goto out; |
| 2248 | } | 2274 | } |
| 2249 | err = dquot_quota_on(sb, type, format_id, path); | 2275 | reiserfs_write_unlock(sb); |
| 2276 | return dquot_quota_on(sb, type, format_id, path); | ||
| 2250 | out: | 2277 | out: |
| 2278 | reiserfs_write_unlock(sb); | ||
| 2251 | return err; | 2279 | return err; |
| 2252 | } | 2280 | } |
| 2253 | 2281 | ||
| @@ -2320,7 +2348,9 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type, | |||
| 2320 | tocopy = sb->s_blocksize - offset < towrite ? | 2348 | tocopy = sb->s_blocksize - offset < towrite ? |
| 2321 | sb->s_blocksize - offset : towrite; | 2349 | sb->s_blocksize - offset : towrite; |
| 2322 | tmp_bh.b_state = 0; | 2350 | tmp_bh.b_state = 0; |
| 2351 | reiserfs_write_lock(sb); | ||
| 2323 | err = reiserfs_get_block(inode, blk, &tmp_bh, GET_BLOCK_CREATE); | 2352 | err = reiserfs_get_block(inode, blk, &tmp_bh, GET_BLOCK_CREATE); |
| 2353 | reiserfs_write_unlock(sb); | ||
| 2324 | if (err) | 2354 | if (err) |
| 2325 | goto out; | 2355 | goto out; |
| 2326 | if (offset || tocopy != sb->s_blocksize) | 2356 | if (offset || tocopy != sb->s_blocksize) |
| @@ -2336,10 +2366,12 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type, | |||
| 2336 | flush_dcache_page(bh->b_page); | 2366 | flush_dcache_page(bh->b_page); |
| 2337 | set_buffer_uptodate(bh); | 2367 | set_buffer_uptodate(bh); |
| 2338 | unlock_buffer(bh); | 2368 | unlock_buffer(bh); |
| 2369 | reiserfs_write_lock(sb); | ||
| 2339 | reiserfs_prepare_for_journal(sb, bh, 1); | 2370 | reiserfs_prepare_for_journal(sb, bh, 1); |
| 2340 | journal_mark_dirty(current->journal_info, sb, bh); | 2371 | journal_mark_dirty(current->journal_info, sb, bh); |
| 2341 | if (!journal_quota) | 2372 | if (!journal_quota) |
| 2342 | reiserfs_add_ordered_list(inode, bh); | 2373 | reiserfs_add_ordered_list(inode, bh); |
| 2374 | reiserfs_write_unlock(sb); | ||
| 2343 | brelse(bh); | 2375 | brelse(bh); |
| 2344 | offset = 0; | 2376 | offset = 0; |
| 2345 | towrite -= tocopy; | 2377 | towrite -= tocopy; |
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index e562dd43f41f..e57e2daa357c 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c | |||
| @@ -481,11 +481,17 @@ static inline int bio_add_buffer(struct bio *bio, struct buffer_head *bh) | |||
| 481 | * | 481 | * |
| 482 | * The fix is two passes across the ioend list - one to start writeback on the | 482 | * The fix is two passes across the ioend list - one to start writeback on the |
| 483 | * buffer_heads, and then submit them for I/O on the second pass. | 483 | * buffer_heads, and then submit them for I/O on the second pass. |
| 484 | * | ||
| 485 | * If @fail is non-zero, it means that we have a situation where some part of | ||
| 486 | * the submission process has failed after we have marked paged for writeback | ||
| 487 | * and unlocked them. In this situation, we need to fail the ioend chain rather | ||
| 488 | * than submit it to IO. This typically only happens on a filesystem shutdown. | ||
| 484 | */ | 489 | */ |
| 485 | STATIC void | 490 | STATIC void |
| 486 | xfs_submit_ioend( | 491 | xfs_submit_ioend( |
| 487 | struct writeback_control *wbc, | 492 | struct writeback_control *wbc, |
| 488 | xfs_ioend_t *ioend) | 493 | xfs_ioend_t *ioend, |
| 494 | int fail) | ||
| 489 | { | 495 | { |
| 490 | xfs_ioend_t *head = ioend; | 496 | xfs_ioend_t *head = ioend; |
| 491 | xfs_ioend_t *next; | 497 | xfs_ioend_t *next; |
| @@ -506,6 +512,18 @@ xfs_submit_ioend( | |||
| 506 | next = ioend->io_list; | 512 | next = ioend->io_list; |
| 507 | bio = NULL; | 513 | bio = NULL; |
| 508 | 514 | ||
| 515 | /* | ||
| 516 | * If we are failing the IO now, just mark the ioend with an | ||
| 517 | * error and finish it. This will run IO completion immediately | ||
| 518 | * as there is only one reference to the ioend at this point in | ||
| 519 | * time. | ||
| 520 | */ | ||
| 521 | if (fail) { | ||
| 522 | ioend->io_error = -fail; | ||
| 523 | xfs_finish_ioend(ioend); | ||
| 524 | continue; | ||
| 525 | } | ||
| 526 | |||
| 509 | for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) { | 527 | for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) { |
| 510 | 528 | ||
| 511 | if (!bio) { | 529 | if (!bio) { |
| @@ -1060,7 +1078,18 @@ xfs_vm_writepage( | |||
| 1060 | 1078 | ||
| 1061 | xfs_start_page_writeback(page, 1, count); | 1079 | xfs_start_page_writeback(page, 1, count); |
| 1062 | 1080 | ||
| 1063 | if (ioend && imap_valid) { | 1081 | /* if there is no IO to be submitted for this page, we are done */ |
| 1082 | if (!ioend) | ||
| 1083 | return 0; | ||
| 1084 | |||
| 1085 | ASSERT(iohead); | ||
| 1086 | |||
| 1087 | /* | ||
| 1088 | * Any errors from this point onwards need tobe reported through the IO | ||
| 1089 | * completion path as we have marked the initial page as under writeback | ||
| 1090 | * and unlocked it. | ||
| 1091 | */ | ||
| 1092 | if (imap_valid) { | ||
| 1064 | xfs_off_t end_index; | 1093 | xfs_off_t end_index; |
| 1065 | 1094 | ||
| 1066 | end_index = imap.br_startoff + imap.br_blockcount; | 1095 | end_index = imap.br_startoff + imap.br_blockcount; |
| @@ -1079,20 +1108,15 @@ xfs_vm_writepage( | |||
| 1079 | wbc, end_index); | 1108 | wbc, end_index); |
| 1080 | } | 1109 | } |
| 1081 | 1110 | ||
| 1082 | if (iohead) { | ||
| 1083 | /* | ||
| 1084 | * Reserve log space if we might write beyond the on-disk | ||
| 1085 | * inode size. | ||
| 1086 | */ | ||
| 1087 | if (ioend->io_type != XFS_IO_UNWRITTEN && | ||
| 1088 | xfs_ioend_is_append(ioend)) { | ||
| 1089 | err = xfs_setfilesize_trans_alloc(ioend); | ||
| 1090 | if (err) | ||
| 1091 | goto error; | ||
| 1092 | } | ||
| 1093 | 1111 | ||
| 1094 | xfs_submit_ioend(wbc, iohead); | 1112 | /* |
| 1095 | } | 1113 | * Reserve log space if we might write beyond the on-disk inode size. |
| 1114 | */ | ||
| 1115 | err = 0; | ||
| 1116 | if (ioend->io_type != XFS_IO_UNWRITTEN && xfs_ioend_is_append(ioend)) | ||
| 1117 | err = xfs_setfilesize_trans_alloc(ioend); | ||
| 1118 | |||
| 1119 | xfs_submit_ioend(wbc, iohead, err); | ||
| 1096 | 1120 | ||
| 1097 | return 0; | 1121 | return 0; |
| 1098 | 1122 | ||
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index d330111ca738..70eec1829776 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c | |||
| @@ -1291,6 +1291,7 @@ xfs_attr_leaf_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1, | |||
| 1291 | leaf2 = blk2->bp->b_addr; | 1291 | leaf2 = blk2->bp->b_addr; |
| 1292 | ASSERT(leaf1->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); | 1292 | ASSERT(leaf1->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); |
| 1293 | ASSERT(leaf2->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); | 1293 | ASSERT(leaf2->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); |
| 1294 | ASSERT(leaf2->hdr.count == 0); | ||
| 1294 | args = state->args; | 1295 | args = state->args; |
| 1295 | 1296 | ||
| 1296 | trace_xfs_attr_leaf_rebalance(args); | 1297 | trace_xfs_attr_leaf_rebalance(args); |
| @@ -1361,6 +1362,7 @@ xfs_attr_leaf_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1, | |||
| 1361 | * I assert that since all callers pass in an empty | 1362 | * I assert that since all callers pass in an empty |
| 1362 | * second buffer, this code should never execute. | 1363 | * second buffer, this code should never execute. |
| 1363 | */ | 1364 | */ |
| 1365 | ASSERT(0); | ||
| 1364 | 1366 | ||
| 1365 | /* | 1367 | /* |
| 1366 | * Figure the total bytes to be added to the destination leaf. | 1368 | * Figure the total bytes to be added to the destination leaf. |
| @@ -1422,10 +1424,24 @@ xfs_attr_leaf_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1, | |||
| 1422 | args->index2 = 0; | 1424 | args->index2 = 0; |
| 1423 | args->blkno2 = blk2->blkno; | 1425 | args->blkno2 = blk2->blkno; |
| 1424 | } else { | 1426 | } else { |
| 1427 | /* | ||
| 1428 | * On a double leaf split, the original attr location | ||
| 1429 | * is already stored in blkno2/index2, so don't | ||
| 1430 | * overwrite it overwise we corrupt the tree. | ||
| 1431 | */ | ||
| 1425 | blk2->index = blk1->index | 1432 | blk2->index = blk1->index |
| 1426 | - be16_to_cpu(leaf1->hdr.count); | 1433 | - be16_to_cpu(leaf1->hdr.count); |
| 1427 | args->index = args->index2 = blk2->index; | 1434 | args->index = blk2->index; |
| 1428 | args->blkno = args->blkno2 = blk2->blkno; | 1435 | args->blkno = blk2->blkno; |
| 1436 | if (!state->extravalid) { | ||
| 1437 | /* | ||
| 1438 | * set the new attr location to match the old | ||
| 1439 | * one and let the higher level split code | ||
| 1440 | * decide where in the leaf to place it. | ||
| 1441 | */ | ||
| 1442 | args->index2 = blk2->index; | ||
| 1443 | args->blkno2 = blk2->blkno; | ||
| 1444 | } | ||
| 1429 | } | 1445 | } |
| 1430 | } else { | 1446 | } else { |
| 1431 | ASSERT(state->inleaf == 1); | 1447 | ASSERT(state->inleaf == 1); |
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 933b7930b863..4b0b8dd1b7b0 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c | |||
| @@ -1197,9 +1197,14 @@ xfs_buf_bio_end_io( | |||
| 1197 | { | 1197 | { |
| 1198 | xfs_buf_t *bp = (xfs_buf_t *)bio->bi_private; | 1198 | xfs_buf_t *bp = (xfs_buf_t *)bio->bi_private; |
| 1199 | 1199 | ||
| 1200 | xfs_buf_ioerror(bp, -error); | 1200 | /* |
| 1201 | * don't overwrite existing errors - otherwise we can lose errors on | ||
| 1202 | * buffers that require multiple bios to complete. | ||
| 1203 | */ | ||
| 1204 | if (!bp->b_error) | ||
| 1205 | xfs_buf_ioerror(bp, -error); | ||
| 1201 | 1206 | ||
| 1202 | if (!error && xfs_buf_is_vmapped(bp) && (bp->b_flags & XBF_READ)) | 1207 | if (!bp->b_error && xfs_buf_is_vmapped(bp) && (bp->b_flags & XBF_READ)) |
| 1203 | invalidate_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp)); | 1208 | invalidate_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp)); |
| 1204 | 1209 | ||
| 1205 | _xfs_buf_ioend(bp, 1); | 1210 | _xfs_buf_ioend(bp, 1); |
| @@ -1279,6 +1284,11 @@ next_chunk: | |||
| 1279 | if (size) | 1284 | if (size) |
| 1280 | goto next_chunk; | 1285 | goto next_chunk; |
| 1281 | } else { | 1286 | } else { |
| 1287 | /* | ||
| 1288 | * This is guaranteed not to be the last io reference count | ||
| 1289 | * because the caller (xfs_buf_iorequest) holds a count itself. | ||
| 1290 | */ | ||
| 1291 | atomic_dec(&bp->b_io_remaining); | ||
| 1282 | xfs_buf_ioerror(bp, EIO); | 1292 | xfs_buf_ioerror(bp, EIO); |
| 1283 | bio_put(bio); | 1293 | bio_put(bio); |
| 1284 | } | 1294 | } |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index af1cbaf535ed..c5c35e629426 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
| @@ -210,6 +210,7 @@ | |||
| 210 | {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 210 | {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
| 211 | {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 211 | {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
| 212 | {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 212 | {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
| 213 | {0x1002, 0x679B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | ||
| 213 | {0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 214 | {0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
| 214 | {0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 215 | {0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
| 215 | {0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 216 | {0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 88fae8d20154..55367b04dc94 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
| @@ -135,6 +135,8 @@ struct scsi_device { | |||
| 135 | * because we did a bus reset. */ | 135 | * because we did a bus reset. */ |
| 136 | unsigned use_10_for_rw:1; /* first try 10-byte read / write */ | 136 | unsigned use_10_for_rw:1; /* first try 10-byte read / write */ |
| 137 | unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */ | 137 | unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */ |
| 138 | unsigned no_report_opcodes:1; /* no REPORT SUPPORTED OPERATION CODES */ | ||
| 139 | unsigned no_write_same:1; /* no WRITE SAME command */ | ||
| 138 | unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ | 140 | unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ |
| 139 | unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ | 141 | unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ |
| 140 | unsigned skip_vpd_pages:1; /* do not read VPD pages */ | 142 | unsigned skip_vpd_pages:1; /* do not read VPD pages */ |
| @@ -362,6 +364,8 @@ extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, | |||
| 362 | int retries, struct scsi_sense_hdr *sshdr); | 364 | int retries, struct scsi_sense_hdr *sshdr); |
| 363 | extern int scsi_get_vpd_page(struct scsi_device *, u8 page, unsigned char *buf, | 365 | extern int scsi_get_vpd_page(struct scsi_device *, u8 page, unsigned char *buf, |
| 364 | int buf_len); | 366 | int buf_len); |
| 367 | extern int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, | ||
| 368 | unsigned int len, unsigned char opcode); | ||
| 365 | extern int scsi_device_set_state(struct scsi_device *sdev, | 369 | extern int scsi_device_set_state(struct scsi_device *sdev, |
| 366 | enum scsi_device_state state); | 370 | enum scsi_device_state state); |
| 367 | extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, | 371 | extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 7bb35ac0964a..bcb72c6e2b2d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -1405,7 +1405,7 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype) | |||
| 1405 | 1405 | ||
| 1406 | mt = get_pageblock_migratetype(page); | 1406 | mt = get_pageblock_migratetype(page); |
| 1407 | if (unlikely(mt != MIGRATE_ISOLATE)) | 1407 | if (unlikely(mt != MIGRATE_ISOLATE)) |
| 1408 | __mod_zone_freepage_state(zone, -(1UL << order), mt); | 1408 | __mod_zone_freepage_state(zone, -(1UL << alloc_order), mt); |
| 1409 | 1409 | ||
| 1410 | if (alloc_order != order) | 1410 | if (alloc_order != order) |
| 1411 | expand(zone, page, alloc_order, order, | 1411 | expand(zone, page, alloc_order, order, |
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index bcf02f608cbf..017a8bacfb27 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
| @@ -429,6 +429,17 @@ static struct attribute_group netstat_group = { | |||
| 429 | .name = "statistics", | 429 | .name = "statistics", |
| 430 | .attrs = netstat_attrs, | 430 | .attrs = netstat_attrs, |
| 431 | }; | 431 | }; |
| 432 | |||
| 433 | #if IS_ENABLED(CONFIG_WIRELESS_EXT) || IS_ENABLED(CONFIG_CFG80211) | ||
| 434 | static struct attribute *wireless_attrs[] = { | ||
| 435 | NULL | ||
| 436 | }; | ||
| 437 | |||
| 438 | static struct attribute_group wireless_group = { | ||
| 439 | .name = "wireless", | ||
| 440 | .attrs = wireless_attrs, | ||
| 441 | }; | ||
| 442 | #endif | ||
| 432 | #endif /* CONFIG_SYSFS */ | 443 | #endif /* CONFIG_SYSFS */ |
| 433 | 444 | ||
| 434 | #ifdef CONFIG_RPS | 445 | #ifdef CONFIG_RPS |
| @@ -1409,6 +1420,15 @@ int netdev_register_kobject(struct net_device *net) | |||
| 1409 | groups++; | 1420 | groups++; |
| 1410 | 1421 | ||
| 1411 | *groups++ = &netstat_group; | 1422 | *groups++ = &netstat_group; |
| 1423 | |||
| 1424 | #if IS_ENABLED(CONFIG_WIRELESS_EXT) || IS_ENABLED(CONFIG_CFG80211) | ||
| 1425 | if (net->ieee80211_ptr) | ||
| 1426 | *groups++ = &wireless_group; | ||
| 1427 | #if IS_ENABLED(CONFIG_WIRELESS_EXT) | ||
| 1428 | else if (net->wireless_handlers) | ||
| 1429 | *groups++ = &wireless_group; | ||
| 1430 | #endif | ||
| 1431 | #endif | ||
| 1412 | #endif /* CONFIG_SYSFS */ | 1432 | #endif /* CONFIG_SYSFS */ |
| 1413 | 1433 | ||
| 1414 | error = device_add(dev); | 1434 | error = device_add(dev); |
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index c4f934176cab..30647857a375 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c | |||
| @@ -252,6 +252,7 @@ struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu) | |||
| 252 | return NULL; | 252 | return NULL; |
| 253 | dst->ops->update_pmtu(dst, sk, NULL, mtu); | 253 | dst->ops->update_pmtu(dst, sk, NULL, mtu); |
| 254 | 254 | ||
| 255 | return inet6_csk_route_socket(sk, &fl6); | 255 | dst = inet6_csk_route_socket(sk, &fl6); |
| 256 | return IS_ERR(dst) ? NULL : dst; | ||
| 256 | } | 257 | } |
| 257 | EXPORT_SYMBOL_GPL(inet6_csk_update_pmtu); | 258 | EXPORT_SYMBOL_GPL(inet6_csk_update_pmtu); |
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index bf87c70ac6c5..c21e33d1abd0 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
| @@ -1151,10 +1151,6 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata) | |||
| 1151 | 1151 | ||
| 1152 | mutex_lock(&sdata->u.ibss.mtx); | 1152 | mutex_lock(&sdata->u.ibss.mtx); |
| 1153 | 1153 | ||
| 1154 | sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH; | ||
| 1155 | memset(sdata->u.ibss.bssid, 0, ETH_ALEN); | ||
| 1156 | sdata->u.ibss.ssid_len = 0; | ||
| 1157 | |||
| 1158 | active_ibss = ieee80211_sta_active_ibss(sdata); | 1154 | active_ibss = ieee80211_sta_active_ibss(sdata); |
| 1159 | 1155 | ||
| 1160 | if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) { | 1156 | if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) { |
| @@ -1175,6 +1171,10 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata) | |||
| 1175 | } | 1171 | } |
| 1176 | } | 1172 | } |
| 1177 | 1173 | ||
| 1174 | ifibss->state = IEEE80211_IBSS_MLME_SEARCH; | ||
| 1175 | memset(ifibss->bssid, 0, ETH_ALEN); | ||
| 1176 | ifibss->ssid_len = 0; | ||
| 1177 | |||
| 1178 | sta_info_flush(sdata->local, sdata); | 1178 | sta_info_flush(sdata->local, sdata); |
| 1179 | 1179 | ||
| 1180 | spin_lock_bh(&ifibss->incomplete_lock); | 1180 | spin_lock_bh(&ifibss->incomplete_lock); |
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c index cc10d073c338..9e8f4b2801f6 100644 --- a/net/nfc/llcp/llcp.c +++ b/net/nfc/llcp/llcp.c | |||
| @@ -1210,7 +1210,7 @@ int nfc_llcp_register_device(struct nfc_dev *ndev) | |||
| 1210 | local->remote_miu = LLCP_DEFAULT_MIU; | 1210 | local->remote_miu = LLCP_DEFAULT_MIU; |
| 1211 | local->remote_lto = LLCP_DEFAULT_LTO; | 1211 | local->remote_lto = LLCP_DEFAULT_LTO; |
| 1212 | 1212 | ||
| 1213 | list_add(&llcp_devices, &local->list); | 1213 | list_add(&local->list, &llcp_devices); |
| 1214 | 1214 | ||
| 1215 | return 0; | 1215 | return 0; |
| 1216 | } | 1216 | } |
diff --git a/scripts/sign-file b/scripts/sign-file index 87ca59d36e7e..974a20b661b7 100755 --- a/scripts/sign-file +++ b/scripts/sign-file | |||
| @@ -156,12 +156,12 @@ sub asn1_extract($$@) | |||
| 156 | 156 | ||
| 157 | if ($l == 0x1) { | 157 | if ($l == 0x1) { |
| 158 | $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1)); | 158 | $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1)); |
| 159 | } elsif ($l = 0x2) { | 159 | } elsif ($l == 0x2) { |
| 160 | $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0], 2)); | 160 | $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0], 2)); |
| 161 | } elsif ($l = 0x3) { | 161 | } elsif ($l == 0x3) { |
| 162 | $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1)) << 16; | 162 | $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1)) << 16; |
| 163 | $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0] + 1, 2)); | 163 | $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0] + 1, 2)); |
| 164 | } elsif ($l = 0x4) { | 164 | } elsif ($l == 0x4) { |
| 165 | $len = unpack("N", substr(${$cursor->[2]}, $cursor->[0], 4)); | 165 | $len = unpack("N", substr(${$cursor->[2]}, $cursor->[0], 4)); |
| 166 | } else { | 166 | } else { |
| 167 | die $x509, ": ", $cursor->[0], ": ASN.1 element too long (", $l, ")\n"; | 167 | die $x509, ": ", $cursor->[0], ": ASN.1 element too long (", $l, ")\n"; |
diff --git a/security/selinux/netnode.c b/security/selinux/netnode.c index 28f911cdd7c7..c5454c0477c3 100644 --- a/security/selinux/netnode.c +++ b/security/selinux/netnode.c | |||
| @@ -174,7 +174,8 @@ static void sel_netnode_insert(struct sel_netnode *node) | |||
| 174 | if (sel_netnode_hash[idx].size == SEL_NETNODE_HASH_BKT_LIMIT) { | 174 | if (sel_netnode_hash[idx].size == SEL_NETNODE_HASH_BKT_LIMIT) { |
| 175 | struct sel_netnode *tail; | 175 | struct sel_netnode *tail; |
| 176 | tail = list_entry( | 176 | tail = list_entry( |
| 177 | rcu_dereference(sel_netnode_hash[idx].list.prev), | 177 | rcu_dereference_protected(sel_netnode_hash[idx].list.prev, |
| 178 | lockdep_is_held(&sel_netnode_lock)), | ||
| 178 | struct sel_netnode, list); | 179 | struct sel_netnode, list); |
| 179 | list_del_rcu(&tail->list); | 180 | list_del_rcu(&tail->list); |
| 180 | kfree_rcu(tail, rcu); | 181 | kfree_rcu(tail, rcu); |
