diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-09-20 02:29:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-09-20 02:29:21 -0400 |
commit | b2c16e1efddeb517c62d242fb8ec30a383843468 (patch) | |
tree | fbfbe6f124a9423abf9a288ad46feb6db7469c42 | |
parent | 81539169f283329fd8bc58457cc15754f683ba69 (diff) | |
parent | d2ffb0103aaefa9b169da042cf39ce27bfb6cdbb (diff) |
Merge branch 'linus' into x86/asm, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
136 files changed, 1224 insertions, 835 deletions
diff --git a/Documentation/devicetree/bindings/mmc/sdhci-st.txt b/Documentation/devicetree/bindings/mmc/sdhci-st.txt index 88faa91125bf..3cd4c43a3260 100644 --- a/Documentation/devicetree/bindings/mmc/sdhci-st.txt +++ b/Documentation/devicetree/bindings/mmc/sdhci-st.txt | |||
@@ -10,7 +10,7 @@ Required properties: | |||
10 | subsystem (mmcss) inside the FlashSS (available in STiH407 SoC | 10 | subsystem (mmcss) inside the FlashSS (available in STiH407 SoC |
11 | family). | 11 | family). |
12 | 12 | ||
13 | - clock-names: Should be "mmc". | 13 | - clock-names: Should be "mmc" and "icn". (NB: The latter is not compulsory) |
14 | See: Documentation/devicetree/bindings/resource-names.txt | 14 | See: Documentation/devicetree/bindings/resource-names.txt |
15 | - clocks: Phandle to the clock. | 15 | - clocks: Phandle to the clock. |
16 | See: Documentation/devicetree/bindings/clock/clock-bindings.txt | 16 | See: Documentation/devicetree/bindings/clock/clock-bindings.txt |
diff --git a/MAINTAINERS b/MAINTAINERS index a5e1270dfbf1..a0ce40f4c66c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1625,6 +1625,7 @@ N: rockchip | |||
1625 | ARM/SAMSUNG EXYNOS ARM ARCHITECTURES | 1625 | ARM/SAMSUNG EXYNOS ARM ARCHITECTURES |
1626 | M: Kukjin Kim <kgene@kernel.org> | 1626 | M: Kukjin Kim <kgene@kernel.org> |
1627 | M: Krzysztof Kozlowski <krzk@kernel.org> | 1627 | M: Krzysztof Kozlowski <krzk@kernel.org> |
1628 | R: Javier Martinez Canillas <javier@osg.samsung.com> | ||
1628 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 1629 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
1629 | L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers) | 1630 | L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers) |
1630 | S: Maintained | 1631 | S: Maintained |
@@ -6102,7 +6103,7 @@ S: Supported | |||
6102 | F: drivers/cpufreq/intel_pstate.c | 6103 | F: drivers/cpufreq/intel_pstate.c |
6103 | 6104 | ||
6104 | INTEL FRAMEBUFFER DRIVER (excluding 810 and 815) | 6105 | INTEL FRAMEBUFFER DRIVER (excluding 810 and 815) |
6105 | M: Maik Broemme <mbroemme@plusserver.de> | 6106 | M: Maik Broemme <mbroemme@libmpq.org> |
6106 | L: linux-fbdev@vger.kernel.org | 6107 | L: linux-fbdev@vger.kernel.org |
6107 | S: Maintained | 6108 | S: Maintained |
6108 | F: Documentation/fb/intelfb.txt | 6109 | F: Documentation/fb/intelfb.txt |
@@ -12568,7 +12569,7 @@ F: include/linux/if_*vlan.h | |||
12568 | F: net/8021q/ | 12569 | F: net/8021q/ |
12569 | 12570 | ||
12570 | VLYNQ BUS | 12571 | VLYNQ BUS |
12571 | M: Florian Fainelli <florian@openwrt.org> | 12572 | M: Florian Fainelli <f.fainelli@gmail.com> |
12572 | L: openwrt-devel@lists.openwrt.org (subscribers-only) | 12573 | L: openwrt-devel@lists.openwrt.org (subscribers-only) |
12573 | S: Maintained | 12574 | S: Maintained |
12574 | F: drivers/vlynq/vlynq.c | 12575 | F: drivers/vlynq/vlynq.c |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 4 | 1 | VERSION = 4 |
2 | PATCHLEVEL = 8 | 2 | PATCHLEVEL = 8 |
3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
4 | EXTRAVERSION = -rc6 | 4 | EXTRAVERSION = -rc7 |
5 | NAME = Psychotic Stoned Sheep | 5 | NAME = Psychotic Stoned Sheep |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi index caf2707680c1..e9b47b2bbc33 100644 --- a/arch/arm/boot/dts/bcm2835-rpi.dtsi +++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | / { | 3 | / { |
4 | memory { | 4 | memory { |
5 | device_type = "memory"; | ||
5 | reg = <0 0x10000000>; | 6 | reg = <0 0x10000000>; |
6 | }; | 7 | }; |
7 | 8 | ||
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi index b98252232d20..445624a1a1de 100644 --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi | |||
@@ -2,7 +2,6 @@ | |||
2 | #include <dt-bindings/clock/bcm2835.h> | 2 | #include <dt-bindings/clock/bcm2835.h> |
3 | #include <dt-bindings/clock/bcm2835-aux.h> | 3 | #include <dt-bindings/clock/bcm2835-aux.h> |
4 | #include <dt-bindings/gpio/gpio.h> | 4 | #include <dt-bindings/gpio/gpio.h> |
5 | #include "skeleton.dtsi" | ||
6 | 5 | ||
7 | /* This include file covers the common peripherals and configuration between | 6 | /* This include file covers the common peripherals and configuration between |
8 | * bcm2835 and bcm2836 implementations, leaving the CPU configuration to | 7 | * bcm2835 and bcm2836 implementations, leaving the CPU configuration to |
@@ -13,6 +12,8 @@ | |||
13 | compatible = "brcm,bcm2835"; | 12 | compatible = "brcm,bcm2835"; |
14 | model = "BCM2835"; | 13 | model = "BCM2835"; |
15 | interrupt-parent = <&intc>; | 14 | interrupt-parent = <&intc>; |
15 | #address-cells = <1>; | ||
16 | #size-cells = <1>; | ||
16 | 17 | ||
17 | chosen { | 18 | chosen { |
18 | bootargs = "earlyprintk console=ttyAMA0"; | 19 | bootargs = "earlyprintk console=ttyAMA0"; |
diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi index d294e82447a2..8b063ab10c19 100644 --- a/arch/arm/boot/dts/stih407-family.dtsi +++ b/arch/arm/boot/dts/stih407-family.dtsi | |||
@@ -550,8 +550,9 @@ | |||
550 | interrupt-names = "mmcirq"; | 550 | interrupt-names = "mmcirq"; |
551 | pinctrl-names = "default"; | 551 | pinctrl-names = "default"; |
552 | pinctrl-0 = <&pinctrl_mmc0>; | 552 | pinctrl-0 = <&pinctrl_mmc0>; |
553 | clock-names = "mmc"; | 553 | clock-names = "mmc", "icn"; |
554 | clocks = <&clk_s_c0_flexgen CLK_MMC_0>; | 554 | clocks = <&clk_s_c0_flexgen CLK_MMC_0>, |
555 | <&clk_s_c0_flexgen CLK_RX_ICN_HVA>; | ||
555 | bus-width = <8>; | 556 | bus-width = <8>; |
556 | non-removable; | 557 | non-removable; |
557 | }; | 558 | }; |
@@ -565,8 +566,9 @@ | |||
565 | interrupt-names = "mmcirq"; | 566 | interrupt-names = "mmcirq"; |
566 | pinctrl-names = "default"; | 567 | pinctrl-names = "default"; |
567 | pinctrl-0 = <&pinctrl_sd1>; | 568 | pinctrl-0 = <&pinctrl_sd1>; |
568 | clock-names = "mmc"; | 569 | clock-names = "mmc", "icn"; |
569 | clocks = <&clk_s_c0_flexgen CLK_MMC_1>; | 570 | clocks = <&clk_s_c0_flexgen CLK_MMC_1>, |
571 | <&clk_s_c0_flexgen CLK_RX_ICN_HVA>; | ||
570 | resets = <&softreset STIH407_MMC1_SOFTRESET>; | 572 | resets = <&softreset STIH407_MMC1_SOFTRESET>; |
571 | bus-width = <4>; | 573 | bus-width = <4>; |
572 | }; | 574 | }; |
diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi index 18ed1ad10d32..40318869c733 100644 --- a/arch/arm/boot/dts/stih410.dtsi +++ b/arch/arm/boot/dts/stih410.dtsi | |||
@@ -41,7 +41,8 @@ | |||
41 | compatible = "st,st-ohci-300x"; | 41 | compatible = "st,st-ohci-300x"; |
42 | reg = <0x9a03c00 0x100>; | 42 | reg = <0x9a03c00 0x100>; |
43 | interrupts = <GIC_SPI 180 IRQ_TYPE_NONE>; | 43 | interrupts = <GIC_SPI 180 IRQ_TYPE_NONE>; |
44 | clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>; | 44 | clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>, |
45 | <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>; | ||
45 | resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>, | 46 | resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>, |
46 | <&softreset STIH407_USB2_PORT0_SOFTRESET>; | 47 | <&softreset STIH407_USB2_PORT0_SOFTRESET>; |
47 | reset-names = "power", "softreset"; | 48 | reset-names = "power", "softreset"; |
@@ -57,7 +58,8 @@ | |||
57 | interrupts = <GIC_SPI 151 IRQ_TYPE_NONE>; | 58 | interrupts = <GIC_SPI 151 IRQ_TYPE_NONE>; |
58 | pinctrl-names = "default"; | 59 | pinctrl-names = "default"; |
59 | pinctrl-0 = <&pinctrl_usb0>; | 60 | pinctrl-0 = <&pinctrl_usb0>; |
60 | clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>; | 61 | clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>, |
62 | <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>; | ||
61 | resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>, | 63 | resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>, |
62 | <&softreset STIH407_USB2_PORT0_SOFTRESET>; | 64 | <&softreset STIH407_USB2_PORT0_SOFTRESET>; |
63 | reset-names = "power", "softreset"; | 65 | reset-names = "power", "softreset"; |
@@ -71,7 +73,8 @@ | |||
71 | compatible = "st,st-ohci-300x"; | 73 | compatible = "st,st-ohci-300x"; |
72 | reg = <0x9a83c00 0x100>; | 74 | reg = <0x9a83c00 0x100>; |
73 | interrupts = <GIC_SPI 181 IRQ_TYPE_NONE>; | 75 | interrupts = <GIC_SPI 181 IRQ_TYPE_NONE>; |
74 | clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>; | 76 | clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>, |
77 | <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>; | ||
75 | resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>, | 78 | resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>, |
76 | <&softreset STIH407_USB2_PORT1_SOFTRESET>; | 79 | <&softreset STIH407_USB2_PORT1_SOFTRESET>; |
77 | reset-names = "power", "softreset"; | 80 | reset-names = "power", "softreset"; |
@@ -87,7 +90,8 @@ | |||
87 | interrupts = <GIC_SPI 153 IRQ_TYPE_NONE>; | 90 | interrupts = <GIC_SPI 153 IRQ_TYPE_NONE>; |
88 | pinctrl-names = "default"; | 91 | pinctrl-names = "default"; |
89 | pinctrl-0 = <&pinctrl_usb1>; | 92 | pinctrl-0 = <&pinctrl_usb1>; |
90 | clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>; | 93 | clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>, |
94 | <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>; | ||
91 | resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>, | 95 | resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>, |
92 | <&softreset STIH407_USB2_PORT1_SOFTRESET>; | 96 | <&softreset STIH407_USB2_PORT1_SOFTRESET>; |
93 | reset-names = "power", "softreset"; | 97 | reset-names = "power", "softreset"; |
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 0e97b4b871f9..6c7b06854fce 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c | |||
@@ -140,7 +140,7 @@ static struct locomo_dev_info locomo_devices[] = { | |||
140 | 140 | ||
141 | static void locomo_handler(struct irq_desc *desc) | 141 | static void locomo_handler(struct irq_desc *desc) |
142 | { | 142 | { |
143 | struct locomo *lchip = irq_desc_get_chip_data(desc); | 143 | struct locomo *lchip = irq_desc_get_handler_data(desc); |
144 | int req, i; | 144 | int req, i; |
145 | 145 | ||
146 | /* Acknowledge the parent IRQ */ | 146 | /* Acknowledge the parent IRQ */ |
@@ -200,8 +200,7 @@ static void locomo_setup_irq(struct locomo *lchip) | |||
200 | * Install handler for IRQ_LOCOMO_HW. | 200 | * Install handler for IRQ_LOCOMO_HW. |
201 | */ | 201 | */ |
202 | irq_set_irq_type(lchip->irq, IRQ_TYPE_EDGE_FALLING); | 202 | irq_set_irq_type(lchip->irq, IRQ_TYPE_EDGE_FALLING); |
203 | irq_set_chip_data(lchip->irq, lchip); | 203 | irq_set_chained_handler_and_data(lchip->irq, locomo_handler, lchip); |
204 | irq_set_chained_handler(lchip->irq, locomo_handler); | ||
205 | 204 | ||
206 | /* Install handlers for IRQ_LOCOMO_* */ | 205 | /* Install handlers for IRQ_LOCOMO_* */ |
207 | for ( ; irq <= lchip->irq_base + 3; irq++) { | 206 | for ( ; irq <= lchip->irq_base + 3; irq++) { |
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index fb0a0a4dfea4..2e076c492005 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c | |||
@@ -472,8 +472,8 @@ static int sa1111_setup_irq(struct sa1111 *sachip, unsigned irq_base) | |||
472 | * specifies that S0ReadyInt and S1ReadyInt should be '1'. | 472 | * specifies that S0ReadyInt and S1ReadyInt should be '1'. |
473 | */ | 473 | */ |
474 | sa1111_writel(0, irqbase + SA1111_INTPOL0); | 474 | sa1111_writel(0, irqbase + SA1111_INTPOL0); |
475 | sa1111_writel(SA1111_IRQMASK_HI(IRQ_S0_READY_NINT) | | 475 | sa1111_writel(BIT(IRQ_S0_READY_NINT & 31) | |
476 | SA1111_IRQMASK_HI(IRQ_S1_READY_NINT), | 476 | BIT(IRQ_S1_READY_NINT & 31), |
477 | irqbase + SA1111_INTPOL1); | 477 | irqbase + SA1111_INTPOL1); |
478 | 478 | ||
479 | /* clear all IRQs */ | 479 | /* clear all IRQs */ |
@@ -754,7 +754,7 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq) | |||
754 | if (sachip->irq != NO_IRQ) { | 754 | if (sachip->irq != NO_IRQ) { |
755 | ret = sa1111_setup_irq(sachip, pd->irq_base); | 755 | ret = sa1111_setup_irq(sachip, pd->irq_base); |
756 | if (ret) | 756 | if (ret) |
757 | goto err_unmap; | 757 | goto err_clk; |
758 | } | 758 | } |
759 | 759 | ||
760 | #ifdef CONFIG_ARCH_SA1100 | 760 | #ifdef CONFIG_ARCH_SA1100 |
@@ -799,6 +799,8 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq) | |||
799 | 799 | ||
800 | return 0; | 800 | return 0; |
801 | 801 | ||
802 | err_clk: | ||
803 | clk_disable(sachip->clk); | ||
802 | err_unmap: | 804 | err_unmap: |
803 | iounmap(sachip->base); | 805 | iounmap(sachip->base); |
804 | err_clk_unprep: | 806 | err_clk_unprep: |
@@ -869,9 +871,9 @@ struct sa1111_save_data { | |||
869 | 871 | ||
870 | #ifdef CONFIG_PM | 872 | #ifdef CONFIG_PM |
871 | 873 | ||
872 | static int sa1111_suspend(struct platform_device *dev, pm_message_t state) | 874 | static int sa1111_suspend_noirq(struct device *dev) |
873 | { | 875 | { |
874 | struct sa1111 *sachip = platform_get_drvdata(dev); | 876 | struct sa1111 *sachip = dev_get_drvdata(dev); |
875 | struct sa1111_save_data *save; | 877 | struct sa1111_save_data *save; |
876 | unsigned long flags; | 878 | unsigned long flags; |
877 | unsigned int val; | 879 | unsigned int val; |
@@ -934,9 +936,9 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state) | |||
934 | * restored by their respective drivers, and must be called | 936 | * restored by their respective drivers, and must be called |
935 | * via LDM after this function. | 937 | * via LDM after this function. |
936 | */ | 938 | */ |
937 | static int sa1111_resume(struct platform_device *dev) | 939 | static int sa1111_resume_noirq(struct device *dev) |
938 | { | 940 | { |
939 | struct sa1111 *sachip = platform_get_drvdata(dev); | 941 | struct sa1111 *sachip = dev_get_drvdata(dev); |
940 | struct sa1111_save_data *save; | 942 | struct sa1111_save_data *save; |
941 | unsigned long flags, id; | 943 | unsigned long flags, id; |
942 | void __iomem *base; | 944 | void __iomem *base; |
@@ -952,7 +954,7 @@ static int sa1111_resume(struct platform_device *dev) | |||
952 | id = sa1111_readl(sachip->base + SA1111_SKID); | 954 | id = sa1111_readl(sachip->base + SA1111_SKID); |
953 | if ((id & SKID_ID_MASK) != SKID_SA1111_ID) { | 955 | if ((id & SKID_ID_MASK) != SKID_SA1111_ID) { |
954 | __sa1111_remove(sachip); | 956 | __sa1111_remove(sachip); |
955 | platform_set_drvdata(dev, NULL); | 957 | dev_set_drvdata(dev, NULL); |
956 | kfree(save); | 958 | kfree(save); |
957 | return 0; | 959 | return 0; |
958 | } | 960 | } |
@@ -1003,8 +1005,8 @@ static int sa1111_resume(struct platform_device *dev) | |||
1003 | } | 1005 | } |
1004 | 1006 | ||
1005 | #else | 1007 | #else |
1006 | #define sa1111_suspend NULL | 1008 | #define sa1111_suspend_noirq NULL |
1007 | #define sa1111_resume NULL | 1009 | #define sa1111_resume_noirq NULL |
1008 | #endif | 1010 | #endif |
1009 | 1011 | ||
1010 | static int sa1111_probe(struct platform_device *pdev) | 1012 | static int sa1111_probe(struct platform_device *pdev) |
@@ -1017,7 +1019,7 @@ static int sa1111_probe(struct platform_device *pdev) | |||
1017 | return -EINVAL; | 1019 | return -EINVAL; |
1018 | irq = platform_get_irq(pdev, 0); | 1020 | irq = platform_get_irq(pdev, 0); |
1019 | if (irq < 0) | 1021 | if (irq < 0) |
1020 | return -ENXIO; | 1022 | return irq; |
1021 | 1023 | ||
1022 | return __sa1111_probe(&pdev->dev, mem, irq); | 1024 | return __sa1111_probe(&pdev->dev, mem, irq); |
1023 | } | 1025 | } |
@@ -1038,6 +1040,11 @@ static int sa1111_remove(struct platform_device *pdev) | |||
1038 | return 0; | 1040 | return 0; |
1039 | } | 1041 | } |
1040 | 1042 | ||
1043 | static struct dev_pm_ops sa1111_pm_ops = { | ||
1044 | .suspend_noirq = sa1111_suspend_noirq, | ||
1045 | .resume_noirq = sa1111_resume_noirq, | ||
1046 | }; | ||
1047 | |||
1041 | /* | 1048 | /* |
1042 | * Not sure if this should be on the system bus or not yet. | 1049 | * Not sure if this should be on the system bus or not yet. |
1043 | * We really want some way to register a system device at | 1050 | * We really want some way to register a system device at |
@@ -1050,10 +1057,9 @@ static int sa1111_remove(struct platform_device *pdev) | |||
1050 | static struct platform_driver sa1111_device_driver = { | 1057 | static struct platform_driver sa1111_device_driver = { |
1051 | .probe = sa1111_probe, | 1058 | .probe = sa1111_probe, |
1052 | .remove = sa1111_remove, | 1059 | .remove = sa1111_remove, |
1053 | .suspend = sa1111_suspend, | ||
1054 | .resume = sa1111_resume, | ||
1055 | .driver = { | 1060 | .driver = { |
1056 | .name = "sa1111", | 1061 | .name = "sa1111", |
1062 | .pm = &sa1111_pm_ops, | ||
1057 | }, | 1063 | }, |
1058 | }; | 1064 | }; |
1059 | 1065 | ||
diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig index 71b42e66488a..78cd2f197e01 100644 --- a/arch/arm/configs/keystone_defconfig +++ b/arch/arm/configs/keystone_defconfig | |||
@@ -161,6 +161,7 @@ CONFIG_USB_MON=y | |||
161 | CONFIG_USB_XHCI_HCD=y | 161 | CONFIG_USB_XHCI_HCD=y |
162 | CONFIG_USB_STORAGE=y | 162 | CONFIG_USB_STORAGE=y |
163 | CONFIG_USB_DWC3=y | 163 | CONFIG_USB_DWC3=y |
164 | CONFIG_NOP_USB_XCEIV=y | ||
164 | CONFIG_KEYSTONE_USB_PHY=y | 165 | CONFIG_KEYSTONE_USB_PHY=y |
165 | CONFIG_NEW_LEDS=y | 166 | CONFIG_NEW_LEDS=y |
166 | CONFIG_LEDS_CLASS=y | 167 | CONFIG_LEDS_CLASS=y |
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 2c8665cd9dc5..ea3566fb92e2 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig | |||
@@ -781,7 +781,7 @@ CONFIG_MXS_DMA=y | |||
781 | CONFIG_DMA_BCM2835=y | 781 | CONFIG_DMA_BCM2835=y |
782 | CONFIG_DMA_OMAP=y | 782 | CONFIG_DMA_OMAP=y |
783 | CONFIG_QCOM_BAM_DMA=y | 783 | CONFIG_QCOM_BAM_DMA=y |
784 | CONFIG_XILINX_VDMA=y | 784 | CONFIG_XILINX_DMA=y |
785 | CONFIG_DMA_SUN6I=y | 785 | CONFIG_DMA_SUN6I=y |
786 | CONFIG_STAGING=y | 786 | CONFIG_STAGING=y |
787 | CONFIG_SENSORS_ISL29018=y | 787 | CONFIG_SENSORS_ISL29018=y |
diff --git a/arch/arm/crypto/aes-ce-glue.c b/arch/arm/crypto/aes-ce-glue.c index da3c0428507b..aef022a87c53 100644 --- a/arch/arm/crypto/aes-ce-glue.c +++ b/arch/arm/crypto/aes-ce-glue.c | |||
@@ -284,7 +284,7 @@ static int ctr_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, | |||
284 | err = blkcipher_walk_done(desc, &walk, | 284 | err = blkcipher_walk_done(desc, &walk, |
285 | walk.nbytes % AES_BLOCK_SIZE); | 285 | walk.nbytes % AES_BLOCK_SIZE); |
286 | } | 286 | } |
287 | if (nbytes) { | 287 | if (walk.nbytes % AES_BLOCK_SIZE) { |
288 | u8 *tdst = walk.dst.virt.addr + blocks * AES_BLOCK_SIZE; | 288 | u8 *tdst = walk.dst.virt.addr + blocks * AES_BLOCK_SIZE; |
289 | u8 *tsrc = walk.src.virt.addr + blocks * AES_BLOCK_SIZE; | 289 | u8 *tsrc = walk.src.virt.addr + blocks * AES_BLOCK_SIZE; |
290 | u8 __aligned(8) tail[AES_BLOCK_SIZE]; | 290 | u8 __aligned(8) tail[AES_BLOCK_SIZE]; |
diff --git a/arch/arm/include/asm/pgtable-2level-hwdef.h b/arch/arm/include/asm/pgtable-2level-hwdef.h index d0131ee6f6af..3f82e9da7cec 100644 --- a/arch/arm/include/asm/pgtable-2level-hwdef.h +++ b/arch/arm/include/asm/pgtable-2level-hwdef.h | |||
@@ -47,6 +47,7 @@ | |||
47 | #define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) | 47 | #define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) |
48 | #define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE) | 48 | #define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE) |
49 | #define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) | 49 | #define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) |
50 | #define PMD_SECT_CACHE_MASK (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) | ||
50 | #define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2)) | 51 | #define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2)) |
51 | 52 | ||
52 | /* | 53 | /* |
diff --git a/arch/arm/include/asm/pgtable-3level-hwdef.h b/arch/arm/include/asm/pgtable-3level-hwdef.h index f8f1cff62065..4cd664abfcd3 100644 --- a/arch/arm/include/asm/pgtable-3level-hwdef.h +++ b/arch/arm/include/asm/pgtable-3level-hwdef.h | |||
@@ -62,6 +62,7 @@ | |||
62 | #define PMD_SECT_WT (_AT(pmdval_t, 2) << 2) /* normal inner write-through */ | 62 | #define PMD_SECT_WT (_AT(pmdval_t, 2) << 2) /* normal inner write-through */ |
63 | #define PMD_SECT_WB (_AT(pmdval_t, 3) << 2) /* normal inner write-back */ | 63 | #define PMD_SECT_WB (_AT(pmdval_t, 3) << 2) /* normal inner write-back */ |
64 | #define PMD_SECT_WBWA (_AT(pmdval_t, 7) << 2) /* normal inner write-alloc */ | 64 | #define PMD_SECT_WBWA (_AT(pmdval_t, 7) << 2) /* normal inner write-alloc */ |
65 | #define PMD_SECT_CACHE_MASK (_AT(pmdval_t, 7) << 2) | ||
65 | 66 | ||
66 | /* | 67 | /* |
67 | * + Level 3 descriptor (PTE) | 68 | * + Level 3 descriptor (PTE) |
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index 3750575c73c5..06332f626565 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c | |||
@@ -255,6 +255,12 @@ static int __init exynos_pmu_irq_init(struct device_node *node, | |||
255 | return -ENOMEM; | 255 | return -ENOMEM; |
256 | } | 256 | } |
257 | 257 | ||
258 | /* | ||
259 | * Clear the OF_POPULATED flag set in of_irq_init so that | ||
260 | * later the Exynos PMU platform device won't be skipped. | ||
261 | */ | ||
262 | of_node_clear_flag(node, OF_POPULATED); | ||
263 | |||
258 | return 0; | 264 | return 0; |
259 | } | 265 | } |
260 | 266 | ||
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 7245f3359564..d6159f8ef0c2 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c | |||
@@ -137,6 +137,18 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = { | |||
137 | // no D+ pullup; lubbock can't connect/disconnect in software | 137 | // no D+ pullup; lubbock can't connect/disconnect in software |
138 | }; | 138 | }; |
139 | 139 | ||
140 | static void lubbock_init_pcmcia(void) | ||
141 | { | ||
142 | struct clk *clk; | ||
143 | |||
144 | /* Add an alias for the SA1111 PCMCIA clock */ | ||
145 | clk = clk_get_sys("pxa2xx-pcmcia", NULL); | ||
146 | if (!IS_ERR(clk)) { | ||
147 | clkdev_create(clk, NULL, "1800"); | ||
148 | clk_put(clk); | ||
149 | } | ||
150 | } | ||
151 | |||
140 | static struct resource sa1111_resources[] = { | 152 | static struct resource sa1111_resources[] = { |
141 | [0] = { | 153 | [0] = { |
142 | .start = 0x10000000, | 154 | .start = 0x10000000, |
@@ -467,6 +479,8 @@ static void __init lubbock_init(void) | |||
467 | pxa_set_btuart_info(NULL); | 479 | pxa_set_btuart_info(NULL); |
468 | pxa_set_stuart_info(NULL); | 480 | pxa_set_stuart_info(NULL); |
469 | 481 | ||
482 | lubbock_init_pcmcia(); | ||
483 | |||
470 | clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL); | 484 | clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL); |
471 | pxa_set_udc_info(&udc_info); | 485 | pxa_set_udc_info(&udc_info); |
472 | pxa_set_fb_info(NULL, &sharp_lm8v31); | 486 | pxa_set_fb_info(NULL, &sharp_lm8v31); |
diff --git a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c index 62437b57813e..73e3adbc1330 100644 --- a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c +++ b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | |||
@@ -41,39 +41,26 @@ | |||
41 | 41 | ||
42 | #define REGULATOR_IRQ_MASK BIT(2) /* IRQ2, active low */ | 42 | #define REGULATOR_IRQ_MASK BIT(2) /* IRQ2, active low */ |
43 | 43 | ||
44 | static void __iomem *irqc; | 44 | /* start of DA9210 System Control and Event Registers */ |
45 | |||
46 | static const u8 da9063_mask_regs[] = { | ||
47 | DA9063_REG_IRQ_MASK_A, | ||
48 | DA9063_REG_IRQ_MASK_B, | ||
49 | DA9063_REG_IRQ_MASK_C, | ||
50 | DA9063_REG_IRQ_MASK_D, | ||
51 | }; | ||
52 | |||
53 | /* DA9210 System Control and Event Registers */ | ||
54 | #define DA9210_REG_MASK_A 0x54 | 45 | #define DA9210_REG_MASK_A 0x54 |
55 | #define DA9210_REG_MASK_B 0x55 | ||
56 | |||
57 | static const u8 da9210_mask_regs[] = { | ||
58 | DA9210_REG_MASK_A, | ||
59 | DA9210_REG_MASK_B, | ||
60 | }; | ||
61 | |||
62 | static void da9xxx_mask_irqs(struct i2c_client *client, const u8 regs[], | ||
63 | unsigned int nregs) | ||
64 | { | ||
65 | unsigned int i; | ||
66 | 46 | ||
67 | dev_info(&client->dev, "Masking %s interrupt sources\n", client->name); | 47 | static void __iomem *irqc; |
68 | 48 | ||
69 | for (i = 0; i < nregs; i++) { | 49 | /* first byte sets the memory pointer, following are consecutive reg values */ |
70 | int error = i2c_smbus_write_byte_data(client, regs[i], ~0); | 50 | static u8 da9063_irq_clr[] = { DA9063_REG_IRQ_MASK_A, 0xff, 0xff, 0xff, 0xff }; |
71 | if (error) { | 51 | static u8 da9210_irq_clr[] = { DA9210_REG_MASK_A, 0xff, 0xff }; |
72 | dev_err(&client->dev, "i2c error %d\n", error); | 52 | |
73 | return; | 53 | static struct i2c_msg da9xxx_msgs[2] = { |
74 | } | 54 | { |
75 | } | 55 | .addr = 0x58, |
76 | } | 56 | .len = ARRAY_SIZE(da9063_irq_clr), |
57 | .buf = da9063_irq_clr, | ||
58 | }, { | ||
59 | .addr = 0x68, | ||
60 | .len = ARRAY_SIZE(da9210_irq_clr), | ||
61 | .buf = da9210_irq_clr, | ||
62 | }, | ||
63 | }; | ||
77 | 64 | ||
78 | static int regulator_quirk_notify(struct notifier_block *nb, | 65 | static int regulator_quirk_notify(struct notifier_block *nb, |
79 | unsigned long action, void *data) | 66 | unsigned long action, void *data) |
@@ -93,12 +80,15 @@ static int regulator_quirk_notify(struct notifier_block *nb, | |||
93 | client = to_i2c_client(dev); | 80 | client = to_i2c_client(dev); |
94 | dev_dbg(dev, "Detected %s\n", client->name); | 81 | dev_dbg(dev, "Detected %s\n", client->name); |
95 | 82 | ||
96 | if ((client->addr == 0x58 && !strcmp(client->name, "da9063"))) | 83 | if ((client->addr == 0x58 && !strcmp(client->name, "da9063")) || |
97 | da9xxx_mask_irqs(client, da9063_mask_regs, | 84 | (client->addr == 0x68 && !strcmp(client->name, "da9210"))) { |
98 | ARRAY_SIZE(da9063_mask_regs)); | 85 | int ret; |
99 | else if (client->addr == 0x68 && !strcmp(client->name, "da9210")) | 86 | |
100 | da9xxx_mask_irqs(client, da9210_mask_regs, | 87 | dev_info(&client->dev, "clearing da9063/da9210 interrupts\n"); |
101 | ARRAY_SIZE(da9210_mask_regs)); | 88 | ret = i2c_transfer(client->adapter, da9xxx_msgs, ARRAY_SIZE(da9xxx_msgs)); |
89 | if (ret != ARRAY_SIZE(da9xxx_msgs)) | ||
90 | dev_err(&client->dev, "i2c error %d\n", ret); | ||
91 | } | ||
102 | 92 | ||
103 | mon = ioread32(irqc + IRQC_MONITOR); | 93 | mon = ioread32(irqc + IRQC_MONITOR); |
104 | if (mon & REGULATOR_IRQ_MASK) | 94 | if (mon & REGULATOR_IRQ_MASK) |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 6344913f0804..30fe03f95c85 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -137,7 +137,7 @@ void __init init_default_cache_policy(unsigned long pmd) | |||
137 | 137 | ||
138 | initial_pmd_value = pmd; | 138 | initial_pmd_value = pmd; |
139 | 139 | ||
140 | pmd &= PMD_SECT_TEX(1) | PMD_SECT_BUFFERABLE | PMD_SECT_CACHEABLE; | 140 | pmd &= PMD_SECT_CACHE_MASK; |
141 | 141 | ||
142 | for (i = 0; i < ARRAY_SIZE(cache_policies); i++) | 142 | for (i = 0; i < ARRAY_SIZE(cache_policies); i++) |
143 | if (cache_policies[i].pmd == pmd) { | 143 | if (cache_policies[i].pmd == pmd) { |
diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi index 445aa678f914..c2b9bcb0ef61 100644 --- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | |||
@@ -255,10 +255,10 @@ | |||
255 | /* Local timer */ | 255 | /* Local timer */ |
256 | timer { | 256 | timer { |
257 | compatible = "arm,armv8-timer"; | 257 | compatible = "arm,armv8-timer"; |
258 | interrupts = <1 13 0xf01>, | 258 | interrupts = <1 13 0xf08>, |
259 | <1 14 0xf01>, | 259 | <1 14 0xf08>, |
260 | <1 11 0xf01>, | 260 | <1 11 0xf08>, |
261 | <1 10 0xf01>; | 261 | <1 10 0xf08>; |
262 | }; | 262 | }; |
263 | 263 | ||
264 | timer0: timer0@ffc03000 { | 264 | timer0: timer0@ffc03000 { |
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi index e502c24b0ac7..bf6c8d051002 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | |||
@@ -102,13 +102,13 @@ | |||
102 | timer { | 102 | timer { |
103 | compatible = "arm,armv8-timer"; | 103 | compatible = "arm,armv8-timer"; |
104 | interrupts = <GIC_PPI 13 | 104 | interrupts = <GIC_PPI 13 |
105 | (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>, | 105 | (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>, |
106 | <GIC_PPI 14 | 106 | <GIC_PPI 14 |
107 | (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>, | 107 | (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>, |
108 | <GIC_PPI 11 | 108 | <GIC_PPI 11 |
109 | (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>, | 109 | (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>, |
110 | <GIC_PPI 10 | 110 | <GIC_PPI 10 |
111 | (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>; | 111 | (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>; |
112 | }; | 112 | }; |
113 | 113 | ||
114 | xtal: xtal-clk { | 114 | xtal: xtal-clk { |
diff --git a/arch/arm64/boot/dts/apm/apm-storm.dtsi b/arch/arm64/boot/dts/apm/apm-storm.dtsi index f1c2c713f9b0..c29dab9d1834 100644 --- a/arch/arm64/boot/dts/apm/apm-storm.dtsi +++ b/arch/arm64/boot/dts/apm/apm-storm.dtsi | |||
@@ -110,10 +110,10 @@ | |||
110 | 110 | ||
111 | timer { | 111 | timer { |
112 | compatible = "arm,armv8-timer"; | 112 | compatible = "arm,armv8-timer"; |
113 | interrupts = <1 0 0xff01>, /* Secure Phys IRQ */ | 113 | interrupts = <1 0 0xff08>, /* Secure Phys IRQ */ |
114 | <1 13 0xff01>, /* Non-secure Phys IRQ */ | 114 | <1 13 0xff08>, /* Non-secure Phys IRQ */ |
115 | <1 14 0xff01>, /* Virt IRQ */ | 115 | <1 14 0xff08>, /* Virt IRQ */ |
116 | <1 15 0xff01>; /* Hyp IRQ */ | 116 | <1 15 0xff08>; /* Hyp IRQ */ |
117 | clock-frequency = <50000000>; | 117 | clock-frequency = <50000000>; |
118 | }; | 118 | }; |
119 | 119 | ||
diff --git a/arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi b/arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi new file mode 120000 index 000000000000..3937b77cb310 --- /dev/null +++ b/arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi | |||
@@ -0,0 +1 @@ | |||
../../../../arm/boot/dts/bcm2835-rpi.dtsi \ No newline at end of file | |||
diff --git a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts index 6f47dd2bb1db..7841b724e340 100644 --- a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts +++ b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts | |||
@@ -1,7 +1,7 @@ | |||
1 | /dts-v1/; | 1 | /dts-v1/; |
2 | #include "bcm2837.dtsi" | 2 | #include "bcm2837.dtsi" |
3 | #include "../../../../arm/boot/dts/bcm2835-rpi.dtsi" | 3 | #include "bcm2835-rpi.dtsi" |
4 | #include "../../../../arm/boot/dts/bcm283x-rpi-smsc9514.dtsi" | 4 | #include "bcm283x-rpi-smsc9514.dtsi" |
5 | 5 | ||
6 | / { | 6 | / { |
7 | compatible = "raspberrypi,3-model-b", "brcm,bcm2837"; | 7 | compatible = "raspberrypi,3-model-b", "brcm,bcm2837"; |
diff --git a/arch/arm64/boot/dts/broadcom/bcm2837.dtsi b/arch/arm64/boot/dts/broadcom/bcm2837.dtsi index f2a31d06845d..8216bbb29fe0 100644 --- a/arch/arm64/boot/dts/broadcom/bcm2837.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcm2837.dtsi | |||
@@ -1,4 +1,4 @@ | |||
1 | #include "../../../../arm/boot/dts/bcm283x.dtsi" | 1 | #include "bcm283x.dtsi" |
2 | 2 | ||
3 | / { | 3 | / { |
4 | compatible = "brcm,bcm2836"; | 4 | compatible = "brcm,bcm2836"; |
diff --git a/arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi b/arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi new file mode 120000 index 000000000000..dca7c057d5a5 --- /dev/null +++ b/arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi | |||
@@ -0,0 +1 @@ | |||
../../../../arm/boot/dts/bcm283x-rpi-smsc9514.dtsi \ No newline at end of file | |||
diff --git a/arch/arm64/boot/dts/broadcom/bcm283x.dtsi b/arch/arm64/boot/dts/broadcom/bcm283x.dtsi new file mode 120000 index 000000000000..5f54e4cab99b --- /dev/null +++ b/arch/arm64/boot/dts/broadcom/bcm283x.dtsi | |||
@@ -0,0 +1 @@ | |||
../../../../arm/boot/dts/bcm283x.dtsi \ No newline at end of file | |||
diff --git a/arch/arm64/boot/dts/broadcom/ns2.dtsi b/arch/arm64/boot/dts/broadcom/ns2.dtsi index f53b0955bfd3..d4a12fad8afd 100644 --- a/arch/arm64/boot/dts/broadcom/ns2.dtsi +++ b/arch/arm64/boot/dts/broadcom/ns2.dtsi | |||
@@ -88,13 +88,13 @@ | |||
88 | timer { | 88 | timer { |
89 | compatible = "arm,armv8-timer"; | 89 | compatible = "arm,armv8-timer"; |
90 | interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(0xff) | | 90 | interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(0xff) | |
91 | IRQ_TYPE_EDGE_RISING)>, | 91 | IRQ_TYPE_LEVEL_LOW)>, |
92 | <GIC_PPI 14 (GIC_CPU_MASK_RAW(0xff) | | 92 | <GIC_PPI 14 (GIC_CPU_MASK_RAW(0xff) | |
93 | IRQ_TYPE_EDGE_RISING)>, | 93 | IRQ_TYPE_LEVEL_LOW)>, |
94 | <GIC_PPI 11 (GIC_CPU_MASK_RAW(0xff) | | 94 | <GIC_PPI 11 (GIC_CPU_MASK_RAW(0xff) | |
95 | IRQ_TYPE_EDGE_RISING)>, | 95 | IRQ_TYPE_LEVEL_LOW)>, |
96 | <GIC_PPI 10 (GIC_CPU_MASK_RAW(0xff) | | 96 | <GIC_PPI 10 (GIC_CPU_MASK_RAW(0xff) | |
97 | IRQ_TYPE_EDGE_RISING)>; | 97 | IRQ_TYPE_LEVEL_LOW)>; |
98 | }; | 98 | }; |
99 | 99 | ||
100 | pmu { | 100 | pmu { |
diff --git a/arch/arm64/boot/dts/cavium/thunder-88xx.dtsi b/arch/arm64/boot/dts/cavium/thunder-88xx.dtsi index 2eb9b225f0bc..04dc8a8d1539 100644 --- a/arch/arm64/boot/dts/cavium/thunder-88xx.dtsi +++ b/arch/arm64/boot/dts/cavium/thunder-88xx.dtsi | |||
@@ -354,10 +354,10 @@ | |||
354 | 354 | ||
355 | timer { | 355 | timer { |
356 | compatible = "arm,armv8-timer"; | 356 | compatible = "arm,armv8-timer"; |
357 | interrupts = <1 13 0xff01>, | 357 | interrupts = <1 13 4>, |
358 | <1 14 0xff01>, | 358 | <1 14 4>, |
359 | <1 11 0xff01>, | 359 | <1 11 4>, |
360 | <1 10 0xff01>; | 360 | <1 10 4>; |
361 | }; | 361 | }; |
362 | 362 | ||
363 | pmu { | 363 | pmu { |
diff --git a/arch/arm64/boot/dts/exynos/exynos7.dtsi b/arch/arm64/boot/dts/exynos/exynos7.dtsi index ca663dfe5189..162831546e18 100644 --- a/arch/arm64/boot/dts/exynos/exynos7.dtsi +++ b/arch/arm64/boot/dts/exynos/exynos7.dtsi | |||
@@ -473,10 +473,10 @@ | |||
473 | 473 | ||
474 | timer { | 474 | timer { |
475 | compatible = "arm,armv8-timer"; | 475 | compatible = "arm,armv8-timer"; |
476 | interrupts = <1 13 0xff01>, | 476 | interrupts = <1 13 0xff08>, |
477 | <1 14 0xff01>, | 477 | <1 14 0xff08>, |
478 | <1 11 0xff01>, | 478 | <1 11 0xff08>, |
479 | <1 10 0xff01>; | 479 | <1 10 0xff08>; |
480 | }; | 480 | }; |
481 | 481 | ||
482 | pmu_system_controller: system-controller@105c0000 { | 482 | pmu_system_controller: system-controller@105c0000 { |
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi index e669fbd7f9c3..a67e210e2019 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi | |||
@@ -119,10 +119,10 @@ | |||
119 | 119 | ||
120 | timer { | 120 | timer { |
121 | compatible = "arm,armv8-timer"; | 121 | compatible = "arm,armv8-timer"; |
122 | interrupts = <1 13 0x1>, /* Physical Secure PPI */ | 122 | interrupts = <1 13 0xf08>, /* Physical Secure PPI */ |
123 | <1 14 0x1>, /* Physical Non-Secure PPI */ | 123 | <1 14 0xf08>, /* Physical Non-Secure PPI */ |
124 | <1 11 0x1>, /* Virtual PPI */ | 124 | <1 11 0xf08>, /* Virtual PPI */ |
125 | <1 10 0x1>; /* Hypervisor PPI */ | 125 | <1 10 0xf08>; /* Hypervisor PPI */ |
126 | }; | 126 | }; |
127 | 127 | ||
128 | pmu { | 128 | pmu { |
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi index 21023a388c29..e3b6034ea5d9 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi | |||
@@ -191,10 +191,10 @@ | |||
191 | 191 | ||
192 | timer { | 192 | timer { |
193 | compatible = "arm,armv8-timer"; | 193 | compatible = "arm,armv8-timer"; |
194 | interrupts = <1 13 0x8>, /* Physical Secure PPI, active-low */ | 194 | interrupts = <1 13 4>, /* Physical Secure PPI, active-low */ |
195 | <1 14 0x8>, /* Physical Non-Secure PPI, active-low */ | 195 | <1 14 4>, /* Physical Non-Secure PPI, active-low */ |
196 | <1 11 0x8>, /* Virtual PPI, active-low */ | 196 | <1 11 4>, /* Virtual PPI, active-low */ |
197 | <1 10 0x8>; /* Hypervisor PPI, active-low */ | 197 | <1 10 4>; /* Hypervisor PPI, active-low */ |
198 | }; | 198 | }; |
199 | 199 | ||
200 | pmu { | 200 | pmu { |
diff --git a/arch/arm64/boot/dts/marvell/armada-ap806.dtsi b/arch/arm64/boot/dts/marvell/armada-ap806.dtsi index eab1a42fb934..c2a6745f168c 100644 --- a/arch/arm64/boot/dts/marvell/armada-ap806.dtsi +++ b/arch/arm64/boot/dts/marvell/armada-ap806.dtsi | |||
@@ -122,10 +122,10 @@ | |||
122 | 122 | ||
123 | timer { | 123 | timer { |
124 | compatible = "arm,armv8-timer"; | 124 | compatible = "arm,armv8-timer"; |
125 | interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>, | 125 | interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, |
126 | <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>, | 126 | <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, |
127 | <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>, | 127 | <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, |
128 | <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>; | 128 | <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; |
129 | }; | 129 | }; |
130 | 130 | ||
131 | odmi: odmi@300000 { | 131 | odmi: odmi@300000 { |
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ph1-ld20.dtsi b/arch/arm64/boot/dts/socionext/uniphier-ph1-ld20.dtsi index c223915f0907..d73bdc8c9115 100644 --- a/arch/arm64/boot/dts/socionext/uniphier-ph1-ld20.dtsi +++ b/arch/arm64/boot/dts/socionext/uniphier-ph1-ld20.dtsi | |||
@@ -129,10 +129,10 @@ | |||
129 | 129 | ||
130 | timer { | 130 | timer { |
131 | compatible = "arm,armv8-timer"; | 131 | compatible = "arm,armv8-timer"; |
132 | interrupts = <1 13 0xf01>, | 132 | interrupts = <1 13 4>, |
133 | <1 14 0xf01>, | 133 | <1 14 4>, |
134 | <1 11 0xf01>, | 134 | <1 11 4>, |
135 | <1 10 0xf01>; | 135 | <1 10 4>; |
136 | }; | 136 | }; |
137 | 137 | ||
138 | soc { | 138 | soc { |
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi index e595f22e7e4b..3e2e51fbd2bc 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi | |||
@@ -65,10 +65,10 @@ | |||
65 | timer { | 65 | timer { |
66 | compatible = "arm,armv8-timer"; | 66 | compatible = "arm,armv8-timer"; |
67 | interrupt-parent = <&gic>; | 67 | interrupt-parent = <&gic>; |
68 | interrupts = <1 13 0xf01>, | 68 | interrupts = <1 13 0xf08>, |
69 | <1 14 0xf01>, | 69 | <1 14 0xf08>, |
70 | <1 11 0xf01>, | 70 | <1 11 0xf08>, |
71 | <1 10 0xf01>; | 71 | <1 10 0xf08>; |
72 | }; | 72 | }; |
73 | 73 | ||
74 | amba_apu { | 74 | amba_apu { |
diff --git a/arch/arm64/crypto/aes-glue.c b/arch/arm64/crypto/aes-glue.c index 5c888049d061..6b2aa0fd6cd0 100644 --- a/arch/arm64/crypto/aes-glue.c +++ b/arch/arm64/crypto/aes-glue.c | |||
@@ -216,7 +216,7 @@ static int ctr_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, | |||
216 | err = blkcipher_walk_done(desc, &walk, | 216 | err = blkcipher_walk_done(desc, &walk, |
217 | walk.nbytes % AES_BLOCK_SIZE); | 217 | walk.nbytes % AES_BLOCK_SIZE); |
218 | } | 218 | } |
219 | if (nbytes) { | 219 | if (walk.nbytes % AES_BLOCK_SIZE) { |
220 | u8 *tdst = walk.dst.virt.addr + blocks * AES_BLOCK_SIZE; | 220 | u8 *tdst = walk.dst.virt.addr + blocks * AES_BLOCK_SIZE; |
221 | u8 *tsrc = walk.src.virt.addr + blocks * AES_BLOCK_SIZE; | 221 | u8 *tsrc = walk.src.virt.addr + blocks * AES_BLOCK_SIZE; |
222 | u8 __aligned(8) tail[AES_BLOCK_SIZE]; | 222 | u8 __aligned(8) tail[AES_BLOCK_SIZE]; |
diff --git a/arch/avr32/lib/copy_user.S b/arch/avr32/lib/copy_user.S index 96a6de9d578f..075373471da1 100644 --- a/arch/avr32/lib/copy_user.S +++ b/arch/avr32/lib/copy_user.S | |||
@@ -23,8 +23,8 @@ | |||
23 | */ | 23 | */ |
24 | .text | 24 | .text |
25 | .align 1 | 25 | .align 1 |
26 | .global copy_from_user | 26 | .global ___copy_from_user |
27 | .type copy_from_user, @function | 27 | .type ___copy_from_user, @function |
28 | ___copy_from_user: | 28 | ___copy_from_user: |
29 | branch_if_kernel r8, __copy_user | 29 | branch_if_kernel r8, __copy_user |
30 | ret_if_privileged r8, r11, r10, r10 | 30 | ret_if_privileged r8, r11, r10, r10 |
diff --git a/arch/openrisc/include/asm/uaccess.h b/arch/openrisc/include/asm/uaccess.h index cbad29b5a131..5cc6b4f1b795 100644 --- a/arch/openrisc/include/asm/uaccess.h +++ b/arch/openrisc/include/asm/uaccess.h | |||
@@ -276,7 +276,7 @@ copy_from_user(void *to, const void *from, unsigned long n) | |||
276 | unsigned long res = n; | 276 | unsigned long res = n; |
277 | 277 | ||
278 | if (likely(access_ok(VERIFY_READ, from, n))) | 278 | if (likely(access_ok(VERIFY_READ, from, n))) |
279 | n = __copy_tofrom_user(to, from, n); | 279 | res = __copy_tofrom_user(to, from, n); |
280 | if (unlikely(res)) | 280 | if (unlikely(res)) |
281 | memset(to + (n - res), 0, res); | 281 | memset(to + (n - res), 0, res); |
282 | return res; | 282 | return res; |
diff --git a/arch/powerpc/include/asm/cpu_has_feature.h b/arch/powerpc/include/asm/cpu_has_feature.h index 2ef55f8968a2..b312b152461b 100644 --- a/arch/powerpc/include/asm/cpu_has_feature.h +++ b/arch/powerpc/include/asm/cpu_has_feature.h | |||
@@ -15,7 +15,7 @@ static inline bool early_cpu_has_feature(unsigned long feature) | |||
15 | #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECKS | 15 | #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECKS |
16 | #include <linux/jump_label.h> | 16 | #include <linux/jump_label.h> |
17 | 17 | ||
18 | #define NUM_CPU_FTR_KEYS 64 | 18 | #define NUM_CPU_FTR_KEYS BITS_PER_LONG |
19 | 19 | ||
20 | extern struct static_key_true cpu_feature_keys[NUM_CPU_FTR_KEYS]; | 20 | extern struct static_key_true cpu_feature_keys[NUM_CPU_FTR_KEYS]; |
21 | 21 | ||
diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S index 2265c6398a17..bd739fed26e3 100644 --- a/arch/powerpc/kernel/idle_book3s.S +++ b/arch/powerpc/kernel/idle_book3s.S | |||
@@ -411,7 +411,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) | |||
411 | * | 411 | * |
412 | * r13 - PACA | 412 | * r13 - PACA |
413 | * cr3 - gt if waking up with partial/complete hypervisor state loss | 413 | * cr3 - gt if waking up with partial/complete hypervisor state loss |
414 | * cr4 - eq if waking up from complete hypervisor state loss. | 414 | * cr4 - gt or eq if waking up from complete hypervisor state loss. |
415 | */ | 415 | */ |
416 | _GLOBAL(pnv_wakeup_tb_loss) | 416 | _GLOBAL(pnv_wakeup_tb_loss) |
417 | ld r1,PACAR1(r13) | 417 | ld r1,PACAR1(r13) |
@@ -453,7 +453,7 @@ lwarx_loop2: | |||
453 | * At this stage | 453 | * At this stage |
454 | * cr2 - eq if first thread to wakeup in core | 454 | * cr2 - eq if first thread to wakeup in core |
455 | * cr3- gt if waking up with partial/complete hypervisor state loss | 455 | * cr3- gt if waking up with partial/complete hypervisor state loss |
456 | * cr4 - eq if waking up from complete hypervisor state loss. | 456 | * cr4 - gt or eq if waking up from complete hypervisor state loss. |
457 | */ | 457 | */ |
458 | 458 | ||
459 | ori r15,r15,PNV_CORE_IDLE_LOCK_BIT | 459 | ori r15,r15,PNV_CORE_IDLE_LOCK_BIT |
@@ -481,7 +481,7 @@ first_thread_in_subcore: | |||
481 | * If waking up from sleep, subcore state is not lost. Hence | 481 | * If waking up from sleep, subcore state is not lost. Hence |
482 | * skip subcore state restore | 482 | * skip subcore state restore |
483 | */ | 483 | */ |
484 | bne cr4,subcore_state_restored | 484 | blt cr4,subcore_state_restored |
485 | 485 | ||
486 | /* Restore per-subcore state */ | 486 | /* Restore per-subcore state */ |
487 | ld r4,_SDR1(r1) | 487 | ld r4,_SDR1(r1) |
@@ -526,7 +526,7 @@ timebase_resync: | |||
526 | * If waking up from sleep, per core state is not lost, skip to | 526 | * If waking up from sleep, per core state is not lost, skip to |
527 | * clear_lock. | 527 | * clear_lock. |
528 | */ | 528 | */ |
529 | bne cr4,clear_lock | 529 | blt cr4,clear_lock |
530 | 530 | ||
531 | /* | 531 | /* |
532 | * First thread in the core to wake up and its waking up with | 532 | * First thread in the core to wake up and its waking up with |
@@ -557,7 +557,7 @@ common_exit: | |||
557 | * If waking up from sleep, hypervisor state is not lost. Hence | 557 | * If waking up from sleep, hypervisor state is not lost. Hence |
558 | * skip hypervisor state restore. | 558 | * skip hypervisor state restore. |
559 | */ | 559 | */ |
560 | bne cr4,hypervisor_state_restored | 560 | blt cr4,hypervisor_state_restored |
561 | 561 | ||
562 | /* Waking up from winkle */ | 562 | /* Waking up from winkle */ |
563 | 563 | ||
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index c16d790808f1..bc0c91e84ca0 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -2217,7 +2217,7 @@ static long pnv_pci_ioda2_set_window(struct iommu_table_group *table_group, | |||
2217 | 2217 | ||
2218 | pnv_pci_link_table_and_group(phb->hose->node, num, | 2218 | pnv_pci_link_table_and_group(phb->hose->node, num, |
2219 | tbl, &pe->table_group); | 2219 | tbl, &pe->table_group); |
2220 | pnv_pci_phb3_tce_invalidate_pe(pe); | 2220 | pnv_pci_ioda2_tce_invalidate_pe(pe); |
2221 | 2221 | ||
2222 | return 0; | 2222 | return 0; |
2223 | } | 2223 | } |
@@ -2355,7 +2355,7 @@ static long pnv_pci_ioda2_unset_window(struct iommu_table_group *table_group, | |||
2355 | if (ret) | 2355 | if (ret) |
2356 | pe_warn(pe, "Unmapping failed, ret = %ld\n", ret); | 2356 | pe_warn(pe, "Unmapping failed, ret = %ld\n", ret); |
2357 | else | 2357 | else |
2358 | pnv_pci_phb3_tce_invalidate_pe(pe); | 2358 | pnv_pci_ioda2_tce_invalidate_pe(pe); |
2359 | 2359 | ||
2360 | pnv_pci_unlink_table_and_group(table_group->tables[num], table_group); | 2360 | pnv_pci_unlink_table_and_group(table_group->tables[num], table_group); |
2361 | 2361 | ||
@@ -3426,7 +3426,17 @@ static void pnv_ioda_release_pe(struct pnv_ioda_pe *pe) | |||
3426 | } | 3426 | } |
3427 | } | 3427 | } |
3428 | 3428 | ||
3429 | pnv_ioda_free_pe(pe); | 3429 | /* |
3430 | * The PE for root bus can be removed because of hotplug in EEH | ||
3431 | * recovery for fenced PHB error. We need to mark the PE dead so | ||
3432 | * that it can be populated again in PCI hot add path. The PE | ||
3433 | * shouldn't be destroyed as it's the global reserved resource. | ||
3434 | */ | ||
3435 | if (phb->ioda.root_pe_populated && | ||
3436 | phb->ioda.root_pe_idx == pe->pe_number) | ||
3437 | phb->ioda.root_pe_populated = false; | ||
3438 | else | ||
3439 | pnv_ioda_free_pe(pe); | ||
3430 | } | 3440 | } |
3431 | 3441 | ||
3432 | static void pnv_pci_release_device(struct pci_dev *pdev) | 3442 | static void pnv_pci_release_device(struct pci_dev *pdev) |
@@ -3442,7 +3452,17 @@ static void pnv_pci_release_device(struct pci_dev *pdev) | |||
3442 | if (!pdn || pdn->pe_number == IODA_INVALID_PE) | 3452 | if (!pdn || pdn->pe_number == IODA_INVALID_PE) |
3443 | return; | 3453 | return; |
3444 | 3454 | ||
3455 | /* | ||
3456 | * PCI hotplug can happen as part of EEH error recovery. The @pdn | ||
3457 | * isn't removed and added afterwards in this scenario. We should | ||
3458 | * set the PE number in @pdn to an invalid one. Otherwise, the PE's | ||
3459 | * device count is decreased on removing devices while failing to | ||
3460 | * be increased on adding devices. It leads to unbalanced PE's device | ||
3461 | * count and eventually make normal PCI hotplug path broken. | ||
3462 | */ | ||
3445 | pe = &phb->ioda.pe_array[pdn->pe_number]; | 3463 | pe = &phb->ioda.pe_array[pdn->pe_number]; |
3464 | pdn->pe_number = IODA_INVALID_PE; | ||
3465 | |||
3446 | WARN_ON(--pe->device_count < 0); | 3466 | WARN_ON(--pe->device_count < 0); |
3447 | if (pe->device_count == 0) | 3467 | if (pe->device_count == 0) |
3448 | pnv_ioda_release_pe(pe); | 3468 | pnv_ioda_release_pe(pe); |
diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c index e07a22bb9308..f5f4b3fbbbc2 100644 --- a/arch/x86/events/amd/core.c +++ b/arch/x86/events/amd/core.c | |||
@@ -119,8 +119,8 @@ static const u64 amd_perfmon_event_map[PERF_COUNT_HW_MAX] = | |||
119 | { | 119 | { |
120 | [PERF_COUNT_HW_CPU_CYCLES] = 0x0076, | 120 | [PERF_COUNT_HW_CPU_CYCLES] = 0x0076, |
121 | [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0, | 121 | [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0, |
122 | [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0080, | 122 | [PERF_COUNT_HW_CACHE_REFERENCES] = 0x077d, |
123 | [PERF_COUNT_HW_CACHE_MISSES] = 0x0081, | 123 | [PERF_COUNT_HW_CACHE_MISSES] = 0x077e, |
124 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2, | 124 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2, |
125 | [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3, | 125 | [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3, |
126 | [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x00d0, /* "Decoder empty" event */ | 126 | [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x00d0, /* "Decoder empty" event */ |
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 2cbde2f449aa..4c9a79b9cd69 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c | |||
@@ -1730,9 +1730,11 @@ static __initconst const u64 knl_hw_cache_extra_regs | |||
1730 | * disabled state if called consecutively. | 1730 | * disabled state if called consecutively. |
1731 | * | 1731 | * |
1732 | * During consecutive calls, the same disable value will be written to related | 1732 | * During consecutive calls, the same disable value will be written to related |
1733 | * registers, so the PMU state remains unchanged. hw.state in | 1733 | * registers, so the PMU state remains unchanged. |
1734 | * intel_bts_disable_local will remain PERF_HES_STOPPED too in consecutive | 1734 | * |
1735 | * calls. | 1735 | * intel_bts events don't coexist with intel PMU's BTS events because of |
1736 | * x86_add_exclusive(x86_lbr_exclusive_lbr); there's no need to keep them | ||
1737 | * disabled around intel PMU's event batching etc, only inside the PMI handler. | ||
1736 | */ | 1738 | */ |
1737 | static void __intel_pmu_disable_all(void) | 1739 | static void __intel_pmu_disable_all(void) |
1738 | { | 1740 | { |
@@ -1742,8 +1744,6 @@ static void __intel_pmu_disable_all(void) | |||
1742 | 1744 | ||
1743 | if (test_bit(INTEL_PMC_IDX_FIXED_BTS, cpuc->active_mask)) | 1745 | if (test_bit(INTEL_PMC_IDX_FIXED_BTS, cpuc->active_mask)) |
1744 | intel_pmu_disable_bts(); | 1746 | intel_pmu_disable_bts(); |
1745 | else | ||
1746 | intel_bts_disable_local(); | ||
1747 | 1747 | ||
1748 | intel_pmu_pebs_disable_all(); | 1748 | intel_pmu_pebs_disable_all(); |
1749 | } | 1749 | } |
@@ -1771,8 +1771,7 @@ static void __intel_pmu_enable_all(int added, bool pmi) | |||
1771 | return; | 1771 | return; |
1772 | 1772 | ||
1773 | intel_pmu_enable_bts(event->hw.config); | 1773 | intel_pmu_enable_bts(event->hw.config); |
1774 | } else | 1774 | } |
1775 | intel_bts_enable_local(); | ||
1776 | } | 1775 | } |
1777 | 1776 | ||
1778 | static void intel_pmu_enable_all(int added) | 1777 | static void intel_pmu_enable_all(int added) |
@@ -2073,6 +2072,7 @@ static int intel_pmu_handle_irq(struct pt_regs *regs) | |||
2073 | */ | 2072 | */ |
2074 | if (!x86_pmu.late_ack) | 2073 | if (!x86_pmu.late_ack) |
2075 | apic_write(APIC_LVTPC, APIC_DM_NMI); | 2074 | apic_write(APIC_LVTPC, APIC_DM_NMI); |
2075 | intel_bts_disable_local(); | ||
2076 | __intel_pmu_disable_all(); | 2076 | __intel_pmu_disable_all(); |
2077 | handled = intel_pmu_drain_bts_buffer(); | 2077 | handled = intel_pmu_drain_bts_buffer(); |
2078 | handled += intel_bts_interrupt(); | 2078 | handled += intel_bts_interrupt(); |
@@ -2172,6 +2172,7 @@ done: | |||
2172 | /* Only restore PMU state when it's active. See x86_pmu_disable(). */ | 2172 | /* Only restore PMU state when it's active. See x86_pmu_disable(). */ |
2173 | if (cpuc->enabled) | 2173 | if (cpuc->enabled) |
2174 | __intel_pmu_enable_all(0, true); | 2174 | __intel_pmu_enable_all(0, true); |
2175 | intel_bts_enable_local(); | ||
2175 | 2176 | ||
2176 | /* | 2177 | /* |
2177 | * Only unmask the NMI after the overflow counters | 2178 | * Only unmask the NMI after the overflow counters |
diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c index 04bb5fb5a8d7..861a7d9cb60f 100644 --- a/arch/x86/events/intel/pt.c +++ b/arch/x86/events/intel/pt.c | |||
@@ -1074,6 +1074,11 @@ static void pt_addr_filters_fini(struct perf_event *event) | |||
1074 | event->hw.addr_filters = NULL; | 1074 | event->hw.addr_filters = NULL; |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | static inline bool valid_kernel_ip(unsigned long ip) | ||
1078 | { | ||
1079 | return virt_addr_valid(ip) && kernel_ip(ip); | ||
1080 | } | ||
1081 | |||
1077 | static int pt_event_addr_filters_validate(struct list_head *filters) | 1082 | static int pt_event_addr_filters_validate(struct list_head *filters) |
1078 | { | 1083 | { |
1079 | struct perf_addr_filter *filter; | 1084 | struct perf_addr_filter *filter; |
@@ -1081,11 +1086,16 @@ static int pt_event_addr_filters_validate(struct list_head *filters) | |||
1081 | 1086 | ||
1082 | list_for_each_entry(filter, filters, entry) { | 1087 | list_for_each_entry(filter, filters, entry) { |
1083 | /* PT doesn't support single address triggers */ | 1088 | /* PT doesn't support single address triggers */ |
1084 | if (!filter->range) | 1089 | if (!filter->range || !filter->size) |
1085 | return -EOPNOTSUPP; | 1090 | return -EOPNOTSUPP; |
1086 | 1091 | ||
1087 | if (!filter->inode && !kernel_ip(filter->offset)) | 1092 | if (!filter->inode) { |
1088 | return -EINVAL; | 1093 | if (!valid_kernel_ip(filter->offset)) |
1094 | return -EINVAL; | ||
1095 | |||
1096 | if (!valid_kernel_ip(filter->offset + filter->size)) | ||
1097 | return -EINVAL; | ||
1098 | } | ||
1089 | 1099 | ||
1090 | if (++range > pt_cap_get(PT_CAP_num_address_ranges)) | 1100 | if (++range > pt_cap_get(PT_CAP_num_address_ranges)) |
1091 | return -EOPNOTSUPP; | 1101 | return -EOPNOTSUPP; |
@@ -1111,7 +1121,7 @@ static void pt_event_addr_filters_sync(struct perf_event *event) | |||
1111 | } else { | 1121 | } else { |
1112 | /* apply the offset */ | 1122 | /* apply the offset */ |
1113 | msr_a = filter->offset + offs[range]; | 1123 | msr_a = filter->offset + offs[range]; |
1114 | msr_b = filter->size + msr_a; | 1124 | msr_b = filter->size + msr_a - 1; |
1115 | } | 1125 | } |
1116 | 1126 | ||
1117 | filters->filter[range].msr_a = msr_a; | 1127 | filters->filter[range].msr_a = msr_a; |
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h index e3af86f58eaf..2131c4ce7d8a 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h | |||
@@ -433,7 +433,11 @@ do { \ | |||
433 | #define __get_user_asm_ex(x, addr, itype, rtype, ltype) \ | 433 | #define __get_user_asm_ex(x, addr, itype, rtype, ltype) \ |
434 | asm volatile("1: mov"itype" %1,%"rtype"0\n" \ | 434 | asm volatile("1: mov"itype" %1,%"rtype"0\n" \ |
435 | "2:\n" \ | 435 | "2:\n" \ |
436 | _ASM_EXTABLE_EX(1b, 2b) \ | 436 | ".section .fixup,\"ax\"\n" \ |
437 | "3:xor"itype" %"rtype"0,%"rtype"0\n" \ | ||
438 | " jmp 2b\n" \ | ||
439 | ".previous\n" \ | ||
440 | _ASM_EXTABLE_EX(1b, 3b) \ | ||
437 | : ltype(x) : "m" (__m(addr))) | 441 | : ltype(x) : "m" (__m(addr))) |
438 | 442 | ||
439 | #define __put_user_nocheck(x, ptr, size) \ | 443 | #define __put_user_nocheck(x, ptr, size) \ |
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c index 5f42d038fcb4..c7220ba94aa7 100644 --- a/arch/x86/kvm/ioapic.c +++ b/arch/x86/kvm/ioapic.c | |||
@@ -109,6 +109,7 @@ static void __rtc_irq_eoi_tracking_restore_one(struct kvm_vcpu *vcpu) | |||
109 | { | 109 | { |
110 | bool new_val, old_val; | 110 | bool new_val, old_val; |
111 | struct kvm_ioapic *ioapic = vcpu->kvm->arch.vioapic; | 111 | struct kvm_ioapic *ioapic = vcpu->kvm->arch.vioapic; |
112 | struct dest_map *dest_map = &ioapic->rtc_status.dest_map; | ||
112 | union kvm_ioapic_redirect_entry *e; | 113 | union kvm_ioapic_redirect_entry *e; |
113 | 114 | ||
114 | e = &ioapic->redirtbl[RTC_GSI]; | 115 | e = &ioapic->redirtbl[RTC_GSI]; |
@@ -117,16 +118,17 @@ static void __rtc_irq_eoi_tracking_restore_one(struct kvm_vcpu *vcpu) | |||
117 | return; | 118 | return; |
118 | 119 | ||
119 | new_val = kvm_apic_pending_eoi(vcpu, e->fields.vector); | 120 | new_val = kvm_apic_pending_eoi(vcpu, e->fields.vector); |
120 | old_val = test_bit(vcpu->vcpu_id, ioapic->rtc_status.dest_map.map); | 121 | old_val = test_bit(vcpu->vcpu_id, dest_map->map); |
121 | 122 | ||
122 | if (new_val == old_val) | 123 | if (new_val == old_val) |
123 | return; | 124 | return; |
124 | 125 | ||
125 | if (new_val) { | 126 | if (new_val) { |
126 | __set_bit(vcpu->vcpu_id, ioapic->rtc_status.dest_map.map); | 127 | __set_bit(vcpu->vcpu_id, dest_map->map); |
128 | dest_map->vectors[vcpu->vcpu_id] = e->fields.vector; | ||
127 | ioapic->rtc_status.pending_eoi++; | 129 | ioapic->rtc_status.pending_eoi++; |
128 | } else { | 130 | } else { |
129 | __clear_bit(vcpu->vcpu_id, ioapic->rtc_status.dest_map.map); | 131 | __clear_bit(vcpu->vcpu_id, dest_map->map); |
130 | ioapic->rtc_status.pending_eoi--; | 132 | ioapic->rtc_status.pending_eoi--; |
131 | rtc_status_pending_eoi_check_valid(ioapic); | 133 | rtc_status_pending_eoi_check_valid(ioapic); |
132 | } | 134 | } |
diff --git a/arch/x86/kvm/pmu_amd.c b/arch/x86/kvm/pmu_amd.c index 39b91127ef07..cd944435dfbd 100644 --- a/arch/x86/kvm/pmu_amd.c +++ b/arch/x86/kvm/pmu_amd.c | |||
@@ -23,8 +23,8 @@ | |||
23 | static struct kvm_event_hw_type_mapping amd_event_mapping[] = { | 23 | static struct kvm_event_hw_type_mapping amd_event_mapping[] = { |
24 | [0] = { 0x76, 0x00, PERF_COUNT_HW_CPU_CYCLES }, | 24 | [0] = { 0x76, 0x00, PERF_COUNT_HW_CPU_CYCLES }, |
25 | [1] = { 0xc0, 0x00, PERF_COUNT_HW_INSTRUCTIONS }, | 25 | [1] = { 0xc0, 0x00, PERF_COUNT_HW_INSTRUCTIONS }, |
26 | [2] = { 0x80, 0x00, PERF_COUNT_HW_CACHE_REFERENCES }, | 26 | [2] = { 0x7d, 0x07, PERF_COUNT_HW_CACHE_REFERENCES }, |
27 | [3] = { 0x81, 0x00, PERF_COUNT_HW_CACHE_MISSES }, | 27 | [3] = { 0x7e, 0x07, PERF_COUNT_HW_CACHE_MISSES }, |
28 | [4] = { 0xc2, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS }, | 28 | [4] = { 0xc2, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS }, |
29 | [5] = { 0xc3, 0x00, PERF_COUNT_HW_BRANCH_MISSES }, | 29 | [5] = { 0xc3, 0x00, PERF_COUNT_HW_BRANCH_MISSES }, |
30 | [6] = { 0xd0, 0x00, PERF_COUNT_HW_STALLED_CYCLES_FRONTEND }, | 30 | [6] = { 0xd0, 0x00, PERF_COUNT_HW_STALLED_CYCLES_FRONTEND }, |
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c index 369999530108..a832426820e8 100644 --- a/crypto/blkcipher.c +++ b/crypto/blkcipher.c | |||
@@ -233,6 +233,8 @@ static int blkcipher_walk_next(struct blkcipher_desc *desc, | |||
233 | return blkcipher_walk_done(desc, walk, -EINVAL); | 233 | return blkcipher_walk_done(desc, walk, -EINVAL); |
234 | } | 234 | } |
235 | 235 | ||
236 | bsize = min(walk->walk_blocksize, n); | ||
237 | |||
236 | walk->flags &= ~(BLKCIPHER_WALK_SLOW | BLKCIPHER_WALK_COPY | | 238 | walk->flags &= ~(BLKCIPHER_WALK_SLOW | BLKCIPHER_WALK_COPY | |
237 | BLKCIPHER_WALK_DIFF); | 239 | BLKCIPHER_WALK_DIFF); |
238 | if (!scatterwalk_aligned(&walk->in, walk->alignmask) || | 240 | if (!scatterwalk_aligned(&walk->in, walk->alignmask) || |
@@ -245,7 +247,6 @@ static int blkcipher_walk_next(struct blkcipher_desc *desc, | |||
245 | } | 247 | } |
246 | } | 248 | } |
247 | 249 | ||
248 | bsize = min(walk->walk_blocksize, n); | ||
249 | n = scatterwalk_clamp(&walk->in, n); | 250 | n = scatterwalk_clamp(&walk->in, n); |
250 | n = scatterwalk_clamp(&walk->out, n); | 251 | n = scatterwalk_clamp(&walk->out, n); |
251 | 252 | ||
diff --git a/crypto/echainiv.c b/crypto/echainiv.c index 1b01fe98e91f..e3d889b122e0 100644 --- a/crypto/echainiv.c +++ b/crypto/echainiv.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * echainiv: Encrypted Chain IV Generator | 2 | * echainiv: Encrypted Chain IV Generator |
3 | * | 3 | * |
4 | * This generator generates an IV based on a sequence number by xoring it | 4 | * This generator generates an IV based on a sequence number by multiplying |
5 | * with a salt and then encrypting it with the same key as used to encrypt | 5 | * it with a salt and then encrypting it with the same key as used to encrypt |
6 | * the plain text. This algorithm requires that the block size be equal | 6 | * the plain text. This algorithm requires that the block size be equal |
7 | * to the IV size. It is mainly useful for CBC. | 7 | * to the IV size. It is mainly useful for CBC. |
8 | * | 8 | * |
@@ -24,81 +24,17 @@ | |||
24 | #include <linux/err.h> | 24 | #include <linux/err.h> |
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
27 | #include <linux/mm.h> | ||
28 | #include <linux/module.h> | 27 | #include <linux/module.h> |
29 | #include <linux/percpu.h> | 28 | #include <linux/slab.h> |
30 | #include <linux/spinlock.h> | ||
31 | #include <linux/string.h> | 29 | #include <linux/string.h> |
32 | 30 | ||
33 | #define MAX_IV_SIZE 16 | ||
34 | |||
35 | static DEFINE_PER_CPU(u32 [MAX_IV_SIZE / sizeof(u32)], echainiv_iv); | ||
36 | |||
37 | /* We don't care if we get preempted and read/write IVs from the next CPU. */ | ||
38 | static void echainiv_read_iv(u8 *dst, unsigned size) | ||
39 | { | ||
40 | u32 *a = (u32 *)dst; | ||
41 | u32 __percpu *b = echainiv_iv; | ||
42 | |||
43 | for (; size >= 4; size -= 4) { | ||
44 | *a++ = this_cpu_read(*b); | ||
45 | b++; | ||
46 | } | ||
47 | } | ||
48 | |||
49 | static void echainiv_write_iv(const u8 *src, unsigned size) | ||
50 | { | ||
51 | const u32 *a = (const u32 *)src; | ||
52 | u32 __percpu *b = echainiv_iv; | ||
53 | |||
54 | for (; size >= 4; size -= 4) { | ||
55 | this_cpu_write(*b, *a); | ||
56 | a++; | ||
57 | b++; | ||
58 | } | ||
59 | } | ||
60 | |||
61 | static void echainiv_encrypt_complete2(struct aead_request *req, int err) | ||
62 | { | ||
63 | struct aead_request *subreq = aead_request_ctx(req); | ||
64 | struct crypto_aead *geniv; | ||
65 | unsigned int ivsize; | ||
66 | |||
67 | if (err == -EINPROGRESS) | ||
68 | return; | ||
69 | |||
70 | if (err) | ||
71 | goto out; | ||
72 | |||
73 | geniv = crypto_aead_reqtfm(req); | ||
74 | ivsize = crypto_aead_ivsize(geniv); | ||
75 | |||
76 | echainiv_write_iv(subreq->iv, ivsize); | ||
77 | |||
78 | if (req->iv != subreq->iv) | ||
79 | memcpy(req->iv, subreq->iv, ivsize); | ||
80 | |||
81 | out: | ||
82 | if (req->iv != subreq->iv) | ||
83 | kzfree(subreq->iv); | ||
84 | } | ||
85 | |||
86 | static void echainiv_encrypt_complete(struct crypto_async_request *base, | ||
87 | int err) | ||
88 | { | ||
89 | struct aead_request *req = base->data; | ||
90 | |||
91 | echainiv_encrypt_complete2(req, err); | ||
92 | aead_request_complete(req, err); | ||
93 | } | ||
94 | |||
95 | static int echainiv_encrypt(struct aead_request *req) | 31 | static int echainiv_encrypt(struct aead_request *req) |
96 | { | 32 | { |
97 | struct crypto_aead *geniv = crypto_aead_reqtfm(req); | 33 | struct crypto_aead *geniv = crypto_aead_reqtfm(req); |
98 | struct aead_geniv_ctx *ctx = crypto_aead_ctx(geniv); | 34 | struct aead_geniv_ctx *ctx = crypto_aead_ctx(geniv); |
99 | struct aead_request *subreq = aead_request_ctx(req); | 35 | struct aead_request *subreq = aead_request_ctx(req); |
100 | crypto_completion_t compl; | 36 | __be64 nseqno; |
101 | void *data; | 37 | u64 seqno; |
102 | u8 *info; | 38 | u8 *info; |
103 | unsigned int ivsize = crypto_aead_ivsize(geniv); | 39 | unsigned int ivsize = crypto_aead_ivsize(geniv); |
104 | int err; | 40 | int err; |
@@ -108,8 +44,6 @@ static int echainiv_encrypt(struct aead_request *req) | |||
108 | 44 | ||
109 | aead_request_set_tfm(subreq, ctx->child); | 45 | aead_request_set_tfm(subreq, ctx->child); |
110 | 46 | ||
111 | compl = echainiv_encrypt_complete; | ||
112 | data = req; | ||
113 | info = req->iv; | 47 | info = req->iv; |
114 | 48 | ||
115 | if (req->src != req->dst) { | 49 | if (req->src != req->dst) { |
@@ -127,29 +61,30 @@ static int echainiv_encrypt(struct aead_request *req) | |||
127 | return err; | 61 | return err; |
128 | } | 62 | } |
129 | 63 | ||
130 | if (unlikely(!IS_ALIGNED((unsigned long)info, | 64 | aead_request_set_callback(subreq, req->base.flags, |
131 | crypto_aead_alignmask(geniv) + 1))) { | 65 | req->base.complete, req->base.data); |
132 | info = kmalloc(ivsize, req->base.flags & | ||
133 | CRYPTO_TFM_REQ_MAY_SLEEP ? GFP_KERNEL: | ||
134 | GFP_ATOMIC); | ||
135 | if (!info) | ||
136 | return -ENOMEM; | ||
137 | |||
138 | memcpy(info, req->iv, ivsize); | ||
139 | } | ||
140 | |||
141 | aead_request_set_callback(subreq, req->base.flags, compl, data); | ||
142 | aead_request_set_crypt(subreq, req->dst, req->dst, | 66 | aead_request_set_crypt(subreq, req->dst, req->dst, |
143 | req->cryptlen, info); | 67 | req->cryptlen, info); |
144 | aead_request_set_ad(subreq, req->assoclen); | 68 | aead_request_set_ad(subreq, req->assoclen); |
145 | 69 | ||
146 | crypto_xor(info, ctx->salt, ivsize); | 70 | memcpy(&nseqno, info + ivsize - 8, 8); |
71 | seqno = be64_to_cpu(nseqno); | ||
72 | memset(info, 0, ivsize); | ||
73 | |||
147 | scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); | 74 | scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); |
148 | echainiv_read_iv(info, ivsize); | ||
149 | 75 | ||
150 | err = crypto_aead_encrypt(subreq); | 76 | do { |
151 | echainiv_encrypt_complete2(req, err); | 77 | u64 a; |
152 | return err; | 78 | |
79 | memcpy(&a, ctx->salt + ivsize - 8, 8); | ||
80 | |||
81 | a |= 1; | ||
82 | a *= seqno; | ||
83 | |||
84 | memcpy(info + ivsize - 8, &a, 8); | ||
85 | } while ((ivsize -= 8)); | ||
86 | |||
87 | return crypto_aead_encrypt(subreq); | ||
153 | } | 88 | } |
154 | 89 | ||
155 | static int echainiv_decrypt(struct aead_request *req) | 90 | static int echainiv_decrypt(struct aead_request *req) |
@@ -196,8 +131,7 @@ static int echainiv_aead_create(struct crypto_template *tmpl, | |||
196 | alg = crypto_spawn_aead_alg(spawn); | 131 | alg = crypto_spawn_aead_alg(spawn); |
197 | 132 | ||
198 | err = -EINVAL; | 133 | err = -EINVAL; |
199 | if (inst->alg.ivsize & (sizeof(u32) - 1) || | 134 | if (inst->alg.ivsize & (sizeof(u64) - 1) || !inst->alg.ivsize) |
200 | inst->alg.ivsize > MAX_IV_SIZE) | ||
201 | goto free_inst; | 135 | goto free_inst; |
202 | 136 | ||
203 | inst->alg.encrypt = echainiv_encrypt; | 137 | inst->alg.encrypt = echainiv_encrypt; |
@@ -206,7 +140,6 @@ static int echainiv_aead_create(struct crypto_template *tmpl, | |||
206 | inst->alg.init = aead_init_geniv; | 140 | inst->alg.init = aead_init_geniv; |
207 | inst->alg.exit = aead_exit_geniv; | 141 | inst->alg.exit = aead_exit_geniv; |
208 | 142 | ||
209 | inst->alg.base.cra_alignmask |= __alignof__(u32) - 1; | ||
210 | inst->alg.base.cra_ctxsize = sizeof(struct aead_geniv_ctx); | 143 | inst->alg.base.cra_ctxsize = sizeof(struct aead_geniv_ctx); |
211 | inst->alg.base.cra_ctxsize += inst->alg.ivsize; | 144 | inst->alg.base.cra_ctxsize += inst->alg.ivsize; |
212 | 145 | ||
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 17995fadebd7..82a081ea4317 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c | |||
@@ -419,7 +419,7 @@ static int rpm_suspend(struct device *dev, int rpmflags) | |||
419 | struct device *parent = NULL; | 419 | struct device *parent = NULL; |
420 | int retval; | 420 | int retval; |
421 | 421 | ||
422 | trace_rpm_suspend(dev, rpmflags); | 422 | trace_rpm_suspend_rcuidle(dev, rpmflags); |
423 | 423 | ||
424 | repeat: | 424 | repeat: |
425 | retval = rpm_check_suspend_allowed(dev); | 425 | retval = rpm_check_suspend_allowed(dev); |
@@ -549,7 +549,7 @@ static int rpm_suspend(struct device *dev, int rpmflags) | |||
549 | } | 549 | } |
550 | 550 | ||
551 | out: | 551 | out: |
552 | trace_rpm_return_int(dev, _THIS_IP_, retval); | 552 | trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval); |
553 | 553 | ||
554 | return retval; | 554 | return retval; |
555 | 555 | ||
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index a978381ef95b..9b17a66cf0e1 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | |||
@@ -387,7 +387,7 @@ void atmel_hlcdc_crtc_irq(struct drm_crtc *c) | |||
387 | atmel_hlcdc_crtc_finish_page_flip(drm_crtc_to_atmel_hlcdc_crtc(c)); | 387 | atmel_hlcdc_crtc_finish_page_flip(drm_crtc_to_atmel_hlcdc_crtc(c)); |
388 | } | 388 | } |
389 | 389 | ||
390 | void atmel_hlcdc_crtc_reset(struct drm_crtc *crtc) | 390 | static void atmel_hlcdc_crtc_reset(struct drm_crtc *crtc) |
391 | { | 391 | { |
392 | struct atmel_hlcdc_crtc_state *state; | 392 | struct atmel_hlcdc_crtc_state *state; |
393 | 393 | ||
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 016c191221f3..52c527f6642a 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | |||
@@ -320,19 +320,19 @@ atmel_hlcdc_plane_update_pos_and_size(struct atmel_hlcdc_plane *plane, | |||
320 | u32 *coeff_tab = heo_upscaling_ycoef; | 320 | u32 *coeff_tab = heo_upscaling_ycoef; |
321 | u32 max_memsize; | 321 | u32 max_memsize; |
322 | 322 | ||
323 | if (state->crtc_w < state->src_w) | 323 | if (state->crtc_h < state->src_h) |
324 | coeff_tab = heo_downscaling_ycoef; | 324 | coeff_tab = heo_downscaling_ycoef; |
325 | for (i = 0; i < ARRAY_SIZE(heo_upscaling_ycoef); i++) | 325 | for (i = 0; i < ARRAY_SIZE(heo_upscaling_ycoef); i++) |
326 | atmel_hlcdc_layer_update_cfg(&plane->layer, | 326 | atmel_hlcdc_layer_update_cfg(&plane->layer, |
327 | 33 + i, | 327 | 33 + i, |
328 | 0xffffffff, | 328 | 0xffffffff, |
329 | coeff_tab[i]); | 329 | coeff_tab[i]); |
330 | factor = ((8 * 256 * state->src_w) - (256 * 4)) / | 330 | factor = ((8 * 256 * state->src_h) - (256 * 4)) / |
331 | state->crtc_w; | 331 | state->crtc_h; |
332 | factor++; | 332 | factor++; |
333 | max_memsize = ((factor * state->crtc_w) + (256 * 4)) / | 333 | max_memsize = ((factor * state->crtc_h) + (256 * 4)) / |
334 | 2048; | 334 | 2048; |
335 | if (max_memsize > state->src_w) | 335 | if (max_memsize > state->src_h) |
336 | factor--; | 336 | factor--; |
337 | factor_reg |= (factor << 16) | 0x80000000; | 337 | factor_reg |= (factor << 16) | 0x80000000; |
338 | } | 338 | } |
diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c index 57676f8d7ecf..a6289752be16 100644 --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c | |||
@@ -1015,6 +1015,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, | |||
1015 | return 0; | 1015 | return 0; |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | #if defined(CONFIG_X86) || defined(CONFIG_IA64) | ||
1018 | typedef struct drm_mode_fb_cmd232 { | 1019 | typedef struct drm_mode_fb_cmd232 { |
1019 | u32 fb_id; | 1020 | u32 fb_id; |
1020 | u32 width; | 1021 | u32 width; |
@@ -1071,6 +1072,7 @@ static int compat_drm_mode_addfb2(struct file *file, unsigned int cmd, | |||
1071 | 1072 | ||
1072 | return 0; | 1073 | return 0; |
1073 | } | 1074 | } |
1075 | #endif | ||
1074 | 1076 | ||
1075 | static drm_ioctl_compat_t *drm_compat_ioctls[] = { | 1077 | static drm_ioctl_compat_t *drm_compat_ioctls[] = { |
1076 | [DRM_IOCTL_NR(DRM_IOCTL_VERSION32)] = compat_drm_version, | 1078 | [DRM_IOCTL_NR(DRM_IOCTL_VERSION32)] = compat_drm_version, |
@@ -1104,7 +1106,9 @@ static drm_ioctl_compat_t *drm_compat_ioctls[] = { | |||
1104 | [DRM_IOCTL_NR(DRM_IOCTL_UPDATE_DRAW32)] = compat_drm_update_draw, | 1106 | [DRM_IOCTL_NR(DRM_IOCTL_UPDATE_DRAW32)] = compat_drm_update_draw, |
1105 | #endif | 1107 | #endif |
1106 | [DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK32)] = compat_drm_wait_vblank, | 1108 | [DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK32)] = compat_drm_wait_vblank, |
1109 | #if defined(CONFIG_X86) || defined(CONFIG_IA64) | ||
1107 | [DRM_IOCTL_NR(DRM_IOCTL_MODE_ADDFB232)] = compat_drm_mode_addfb2, | 1110 | [DRM_IOCTL_NR(DRM_IOCTL_MODE_ADDFB232)] = compat_drm_mode_addfb2, |
1111 | #endif | ||
1108 | }; | 1112 | }; |
1109 | 1113 | ||
1110 | /** | 1114 | /** |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index e0166403b4bd..40ce841eb952 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c | |||
@@ -55,11 +55,11 @@ static int check_fb_gem_memory_type(struct drm_device *drm_dev, | |||
55 | flags = exynos_gem->flags; | 55 | flags = exynos_gem->flags; |
56 | 56 | ||
57 | /* | 57 | /* |
58 | * without iommu support, not support physically non-continuous memory | 58 | * Physically non-contiguous memory type for framebuffer is not |
59 | * for framebuffer. | 59 | * supported without IOMMU. |
60 | */ | 60 | */ |
61 | if (IS_NONCONTIG_BUFFER(flags)) { | 61 | if (IS_NONCONTIG_BUFFER(flags)) { |
62 | DRM_ERROR("cannot use this gem memory type for fb.\n"); | 62 | DRM_ERROR("Non-contiguous GEM memory is not supported.\n"); |
63 | return -EINVAL; | 63 | return -EINVAL; |
64 | } | 64 | } |
65 | 65 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 0525c56145db..147ef0d298cb 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c | |||
@@ -1753,32 +1753,6 @@ static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable) | |||
1753 | return 0; | 1753 | return 0; |
1754 | } | 1754 | } |
1755 | 1755 | ||
1756 | #ifdef CONFIG_PM_SLEEP | ||
1757 | static int fimc_suspend(struct device *dev) | ||
1758 | { | ||
1759 | struct fimc_context *ctx = get_fimc_context(dev); | ||
1760 | |||
1761 | DRM_DEBUG_KMS("id[%d]\n", ctx->id); | ||
1762 | |||
1763 | if (pm_runtime_suspended(dev)) | ||
1764 | return 0; | ||
1765 | |||
1766 | return fimc_clk_ctrl(ctx, false); | ||
1767 | } | ||
1768 | |||
1769 | static int fimc_resume(struct device *dev) | ||
1770 | { | ||
1771 | struct fimc_context *ctx = get_fimc_context(dev); | ||
1772 | |||
1773 | DRM_DEBUG_KMS("id[%d]\n", ctx->id); | ||
1774 | |||
1775 | if (!pm_runtime_suspended(dev)) | ||
1776 | return fimc_clk_ctrl(ctx, true); | ||
1777 | |||
1778 | return 0; | ||
1779 | } | ||
1780 | #endif | ||
1781 | |||
1782 | static int fimc_runtime_suspend(struct device *dev) | 1756 | static int fimc_runtime_suspend(struct device *dev) |
1783 | { | 1757 | { |
1784 | struct fimc_context *ctx = get_fimc_context(dev); | 1758 | struct fimc_context *ctx = get_fimc_context(dev); |
@@ -1799,7 +1773,8 @@ static int fimc_runtime_resume(struct device *dev) | |||
1799 | #endif | 1773 | #endif |
1800 | 1774 | ||
1801 | static const struct dev_pm_ops fimc_pm_ops = { | 1775 | static const struct dev_pm_ops fimc_pm_ops = { |
1802 | SET_SYSTEM_SLEEP_PM_OPS(fimc_suspend, fimc_resume) | 1776 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, |
1777 | pm_runtime_force_resume) | ||
1803 | SET_RUNTIME_PM_OPS(fimc_runtime_suspend, fimc_runtime_resume, NULL) | 1778 | SET_RUNTIME_PM_OPS(fimc_runtime_suspend, fimc_runtime_resume, NULL) |
1804 | }; | 1779 | }; |
1805 | 1780 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 4bf00f57ffe8..6eca8bb88648 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c | |||
@@ -1475,8 +1475,8 @@ static int g2d_remove(struct platform_device *pdev) | |||
1475 | return 0; | 1475 | return 0; |
1476 | } | 1476 | } |
1477 | 1477 | ||
1478 | #ifdef CONFIG_PM_SLEEP | 1478 | #ifdef CONFIG_PM |
1479 | static int g2d_suspend(struct device *dev) | 1479 | static int g2d_runtime_suspend(struct device *dev) |
1480 | { | 1480 | { |
1481 | struct g2d_data *g2d = dev_get_drvdata(dev); | 1481 | struct g2d_data *g2d = dev_get_drvdata(dev); |
1482 | 1482 | ||
@@ -1490,25 +1490,6 @@ static int g2d_suspend(struct device *dev) | |||
1490 | 1490 | ||
1491 | flush_work(&g2d->runqueue_work); | 1491 | flush_work(&g2d->runqueue_work); |
1492 | 1492 | ||
1493 | return 0; | ||
1494 | } | ||
1495 | |||
1496 | static int g2d_resume(struct device *dev) | ||
1497 | { | ||
1498 | struct g2d_data *g2d = dev_get_drvdata(dev); | ||
1499 | |||
1500 | g2d->suspended = false; | ||
1501 | g2d_exec_runqueue(g2d); | ||
1502 | |||
1503 | return 0; | ||
1504 | } | ||
1505 | #endif | ||
1506 | |||
1507 | #ifdef CONFIG_PM | ||
1508 | static int g2d_runtime_suspend(struct device *dev) | ||
1509 | { | ||
1510 | struct g2d_data *g2d = dev_get_drvdata(dev); | ||
1511 | |||
1512 | clk_disable_unprepare(g2d->gate_clk); | 1493 | clk_disable_unprepare(g2d->gate_clk); |
1513 | 1494 | ||
1514 | return 0; | 1495 | return 0; |
@@ -1523,12 +1504,16 @@ static int g2d_runtime_resume(struct device *dev) | |||
1523 | if (ret < 0) | 1504 | if (ret < 0) |
1524 | dev_warn(dev, "failed to enable clock.\n"); | 1505 | dev_warn(dev, "failed to enable clock.\n"); |
1525 | 1506 | ||
1507 | g2d->suspended = false; | ||
1508 | g2d_exec_runqueue(g2d); | ||
1509 | |||
1526 | return ret; | 1510 | return ret; |
1527 | } | 1511 | } |
1528 | #endif | 1512 | #endif |
1529 | 1513 | ||
1530 | static const struct dev_pm_ops g2d_pm_ops = { | 1514 | static const struct dev_pm_ops g2d_pm_ops = { |
1531 | SET_SYSTEM_SLEEP_PM_OPS(g2d_suspend, g2d_resume) | 1515 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, |
1516 | pm_runtime_force_resume) | ||
1532 | SET_RUNTIME_PM_OPS(g2d_runtime_suspend, g2d_runtime_resume, NULL) | 1517 | SET_RUNTIME_PM_OPS(g2d_runtime_suspend, g2d_runtime_resume, NULL) |
1533 | }; | 1518 | }; |
1534 | 1519 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 5d20da8f957e..52a9d269484e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c | |||
@@ -1760,34 +1760,7 @@ static int gsc_remove(struct platform_device *pdev) | |||
1760 | return 0; | 1760 | return 0; |
1761 | } | 1761 | } |
1762 | 1762 | ||
1763 | #ifdef CONFIG_PM_SLEEP | 1763 | static int __maybe_unused gsc_runtime_suspend(struct device *dev) |
1764 | static int gsc_suspend(struct device *dev) | ||
1765 | { | ||
1766 | struct gsc_context *ctx = get_gsc_context(dev); | ||
1767 | |||
1768 | DRM_DEBUG_KMS("id[%d]\n", ctx->id); | ||
1769 | |||
1770 | if (pm_runtime_suspended(dev)) | ||
1771 | return 0; | ||
1772 | |||
1773 | return gsc_clk_ctrl(ctx, false); | ||
1774 | } | ||
1775 | |||
1776 | static int gsc_resume(struct device *dev) | ||
1777 | { | ||
1778 | struct gsc_context *ctx = get_gsc_context(dev); | ||
1779 | |||
1780 | DRM_DEBUG_KMS("id[%d]\n", ctx->id); | ||
1781 | |||
1782 | if (!pm_runtime_suspended(dev)) | ||
1783 | return gsc_clk_ctrl(ctx, true); | ||
1784 | |||
1785 | return 0; | ||
1786 | } | ||
1787 | #endif | ||
1788 | |||
1789 | #ifdef CONFIG_PM | ||
1790 | static int gsc_runtime_suspend(struct device *dev) | ||
1791 | { | 1764 | { |
1792 | struct gsc_context *ctx = get_gsc_context(dev); | 1765 | struct gsc_context *ctx = get_gsc_context(dev); |
1793 | 1766 | ||
@@ -1796,7 +1769,7 @@ static int gsc_runtime_suspend(struct device *dev) | |||
1796 | return gsc_clk_ctrl(ctx, false); | 1769 | return gsc_clk_ctrl(ctx, false); |
1797 | } | 1770 | } |
1798 | 1771 | ||
1799 | static int gsc_runtime_resume(struct device *dev) | 1772 | static int __maybe_unused gsc_runtime_resume(struct device *dev) |
1800 | { | 1773 | { |
1801 | struct gsc_context *ctx = get_gsc_context(dev); | 1774 | struct gsc_context *ctx = get_gsc_context(dev); |
1802 | 1775 | ||
@@ -1804,10 +1777,10 @@ static int gsc_runtime_resume(struct device *dev) | |||
1804 | 1777 | ||
1805 | return gsc_clk_ctrl(ctx, true); | 1778 | return gsc_clk_ctrl(ctx, true); |
1806 | } | 1779 | } |
1807 | #endif | ||
1808 | 1780 | ||
1809 | static const struct dev_pm_ops gsc_pm_ops = { | 1781 | static const struct dev_pm_ops gsc_pm_ops = { |
1810 | SET_SYSTEM_SLEEP_PM_OPS(gsc_suspend, gsc_resume) | 1782 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, |
1783 | pm_runtime_force_resume) | ||
1811 | SET_RUNTIME_PM_OPS(gsc_runtime_suspend, gsc_runtime_resume, NULL) | 1784 | SET_RUNTIME_PM_OPS(gsc_runtime_suspend, gsc_runtime_resume, NULL) |
1812 | }; | 1785 | }; |
1813 | 1786 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 404367a430b5..6591e406084c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c | |||
@@ -794,29 +794,6 @@ static int rotator_clk_crtl(struct rot_context *rot, bool enable) | |||
794 | return 0; | 794 | return 0; |
795 | } | 795 | } |
796 | 796 | ||
797 | |||
798 | #ifdef CONFIG_PM_SLEEP | ||
799 | static int rotator_suspend(struct device *dev) | ||
800 | { | ||
801 | struct rot_context *rot = dev_get_drvdata(dev); | ||
802 | |||
803 | if (pm_runtime_suspended(dev)) | ||
804 | return 0; | ||
805 | |||
806 | return rotator_clk_crtl(rot, false); | ||
807 | } | ||
808 | |||
809 | static int rotator_resume(struct device *dev) | ||
810 | { | ||
811 | struct rot_context *rot = dev_get_drvdata(dev); | ||
812 | |||
813 | if (!pm_runtime_suspended(dev)) | ||
814 | return rotator_clk_crtl(rot, true); | ||
815 | |||
816 | return 0; | ||
817 | } | ||
818 | #endif | ||
819 | |||
820 | static int rotator_runtime_suspend(struct device *dev) | 797 | static int rotator_runtime_suspend(struct device *dev) |
821 | { | 798 | { |
822 | struct rot_context *rot = dev_get_drvdata(dev); | 799 | struct rot_context *rot = dev_get_drvdata(dev); |
@@ -833,7 +810,8 @@ static int rotator_runtime_resume(struct device *dev) | |||
833 | #endif | 810 | #endif |
834 | 811 | ||
835 | static const struct dev_pm_ops rotator_pm_ops = { | 812 | static const struct dev_pm_ops rotator_pm_ops = { |
836 | SET_SYSTEM_SLEEP_PM_OPS(rotator_suspend, rotator_resume) | 813 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, |
814 | pm_runtime_force_resume) | ||
837 | SET_RUNTIME_PM_OPS(rotator_runtime_suspend, rotator_runtime_resume, | 815 | SET_RUNTIME_PM_OPS(rotator_runtime_suspend, rotator_runtime_resume, |
838 | NULL) | 816 | NULL) |
839 | }; | 817 | }; |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 95ddd56b89f0..5de36d8dcc68 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -1281,6 +1281,11 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1281 | 1281 | ||
1282 | intel_runtime_pm_enable(dev_priv); | 1282 | intel_runtime_pm_enable(dev_priv); |
1283 | 1283 | ||
1284 | /* Everything is in place, we can now relax! */ | ||
1285 | DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n", | ||
1286 | driver.name, driver.major, driver.minor, driver.patchlevel, | ||
1287 | driver.date, pci_name(pdev), dev_priv->drm.primary->index); | ||
1288 | |||
1284 | intel_runtime_pm_put(dev_priv); | 1289 | intel_runtime_pm_put(dev_priv); |
1285 | 1290 | ||
1286 | return 0; | 1291 | return 0; |
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 7a30af79d799..f38ceffd82c3 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -122,8 +122,11 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv, | |||
122 | has_full_48bit_ppgtt = | 122 | has_full_48bit_ppgtt = |
123 | IS_BROADWELL(dev_priv) || INTEL_GEN(dev_priv) >= 9; | 123 | IS_BROADWELL(dev_priv) || INTEL_GEN(dev_priv) >= 9; |
124 | 124 | ||
125 | if (intel_vgpu_active(dev_priv)) | 125 | if (intel_vgpu_active(dev_priv)) { |
126 | has_full_ppgtt = false; /* emulation is too hard */ | 126 | /* emulation is too hard */ |
127 | has_full_ppgtt = false; | ||
128 | has_full_48bit_ppgtt = false; | ||
129 | } | ||
127 | 130 | ||
128 | if (!has_aliasing_ppgtt) | 131 | if (!has_aliasing_ppgtt) |
129 | return 0; | 132 | return 0; |
@@ -158,7 +161,7 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv, | |||
158 | return 0; | 161 | return 0; |
159 | } | 162 | } |
160 | 163 | ||
161 | if (INTEL_GEN(dev_priv) >= 8 && i915.enable_execlists) | 164 | if (INTEL_GEN(dev_priv) >= 8 && i915.enable_execlists && has_full_ppgtt) |
162 | return has_full_48bit_ppgtt ? 3 : 2; | 165 | return has_full_48bit_ppgtt ? 3 : 2; |
163 | else | 166 | else |
164 | return has_aliasing_ppgtt ? 1 : 0; | 167 | return has_aliasing_ppgtt ? 1 : 0; |
diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c index f6acb5a0e701..b81cfb3b22ec 100644 --- a/drivers/gpu/drm/i915/i915_vgpu.c +++ b/drivers/gpu/drm/i915/i915_vgpu.c | |||
@@ -65,9 +65,6 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv) | |||
65 | 65 | ||
66 | BUILD_BUG_ON(sizeof(struct vgt_if) != VGT_PVINFO_SIZE); | 66 | BUILD_BUG_ON(sizeof(struct vgt_if) != VGT_PVINFO_SIZE); |
67 | 67 | ||
68 | if (!IS_HASWELL(dev_priv)) | ||
69 | return; | ||
70 | |||
71 | magic = __raw_i915_read64(dev_priv, vgtif_reg(magic)); | 68 | magic = __raw_i915_read64(dev_priv, vgtif_reg(magic)); |
72 | if (magic != VGT_MAGIC) | 69 | if (magic != VGT_MAGIC) |
73 | return; | 70 | return; |
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c index 47bdf9dad0d3..b9e5a63a7c9e 100644 --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c | |||
@@ -554,7 +554,6 @@ void intel_dvo_init(struct drm_device *dev) | |||
554 | return; | 554 | return; |
555 | } | 555 | } |
556 | 556 | ||
557 | drm_encoder_cleanup(&intel_encoder->base); | ||
558 | kfree(intel_dvo); | 557 | kfree(intel_dvo); |
559 | kfree(intel_connector); | 558 | kfree(intel_connector); |
560 | } | 559 | } |
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c index adca262d591a..7acbbbf97833 100644 --- a/drivers/gpu/drm/i915/intel_opregion.c +++ b/drivers/gpu/drm/i915/intel_opregion.c | |||
@@ -1047,6 +1047,23 @@ err_out: | |||
1047 | return err; | 1047 | return err; |
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | static int intel_use_opregion_panel_type_callback(const struct dmi_system_id *id) | ||
1051 | { | ||
1052 | DRM_INFO("Using panel type from OpRegion on %s\n", id->ident); | ||
1053 | return 1; | ||
1054 | } | ||
1055 | |||
1056 | static const struct dmi_system_id intel_use_opregion_panel_type[] = { | ||
1057 | { | ||
1058 | .callback = intel_use_opregion_panel_type_callback, | ||
1059 | .ident = "Conrac GmbH IX45GM2", | ||
1060 | .matches = {DMI_MATCH(DMI_SYS_VENDOR, "Conrac GmbH"), | ||
1061 | DMI_MATCH(DMI_PRODUCT_NAME, "IX45GM2"), | ||
1062 | }, | ||
1063 | }, | ||
1064 | { } | ||
1065 | }; | ||
1066 | |||
1050 | int | 1067 | int |
1051 | intel_opregion_get_panel_type(struct drm_i915_private *dev_priv) | 1068 | intel_opregion_get_panel_type(struct drm_i915_private *dev_priv) |
1052 | { | 1069 | { |
@@ -1073,6 +1090,16 @@ intel_opregion_get_panel_type(struct drm_i915_private *dev_priv) | |||
1073 | } | 1090 | } |
1074 | 1091 | ||
1075 | /* | 1092 | /* |
1093 | * So far we know that some machined must use it, others must not use it. | ||
1094 | * There doesn't seem to be any way to determine which way to go, except | ||
1095 | * via a quirk list :( | ||
1096 | */ | ||
1097 | if (!dmi_check_system(intel_use_opregion_panel_type)) { | ||
1098 | DRM_DEBUG_KMS("Ignoring OpRegion panel type (%d)\n", ret - 1); | ||
1099 | return -ENODEV; | ||
1100 | } | ||
1101 | |||
1102 | /* | ||
1076 | * FIXME On Dell XPS 13 9350 the OpRegion panel type (0) gives us | 1103 | * FIXME On Dell XPS 13 9350 the OpRegion panel type (0) gives us |
1077 | * low vswing for eDP, whereas the VBT panel type (2) gives us normal | 1104 | * low vswing for eDP, whereas the VBT panel type (2) gives us normal |
1078 | * vswing instead. Low vswing results in some display flickers, so | 1105 | * vswing instead. Low vswing results in some display flickers, so |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 53e13c10e4ea..2d2481392824 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -7859,6 +7859,7 @@ static inline int gen6_check_mailbox_status(struct drm_i915_private *dev_priv) | |||
7859 | case GEN6_PCODE_ILLEGAL_CMD: | 7859 | case GEN6_PCODE_ILLEGAL_CMD: |
7860 | return -ENXIO; | 7860 | return -ENXIO; |
7861 | case GEN6_PCODE_MIN_FREQ_TABLE_GT_RATIO_OUT_OF_RANGE: | 7861 | case GEN6_PCODE_MIN_FREQ_TABLE_GT_RATIO_OUT_OF_RANGE: |
7862 | case GEN7_PCODE_MIN_FREQ_TABLE_GT_RATIO_OUT_OF_RANGE: | ||
7862 | return -EOVERFLOW; | 7863 | return -EOVERFLOW; |
7863 | case GEN6_PCODE_TIMEOUT: | 7864 | case GEN6_PCODE_TIMEOUT: |
7864 | return -ETIMEDOUT; | 7865 | return -ETIMEDOUT; |
diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c index 2b0d1baf15b3..cf171b4b8c67 100644 --- a/drivers/gpu/drm/i915/intel_psr.c +++ b/drivers/gpu/drm/i915/intel_psr.c | |||
@@ -255,14 +255,14 @@ static void hsw_psr_enable_source(struct intel_dp *intel_dp) | |||
255 | struct drm_i915_private *dev_priv = to_i915(dev); | 255 | struct drm_i915_private *dev_priv = to_i915(dev); |
256 | 256 | ||
257 | uint32_t max_sleep_time = 0x1f; | 257 | uint32_t max_sleep_time = 0x1f; |
258 | /* Lately it was identified that depending on panel idle frame count | 258 | /* |
259 | * calculated at HW can be off by 1. So let's use what came | 259 | * Let's respect VBT in case VBT asks a higher idle_frame value. |
260 | * from VBT + 1. | 260 | * Let's use 6 as the minimum to cover all known cases including |
261 | * There are also other cases where panel demands at least 4 | 261 | * the off-by-one issue that HW has in some cases. Also there are |
262 | * but VBT is not being set. To cover these 2 cases lets use | 262 | * cases where sink should be able to train |
263 | * at least 5 when VBT isn't set to be on the safest side. | 263 | * with the 5 or 6 idle patterns. |
264 | */ | 264 | */ |
265 | uint32_t idle_frames = dev_priv->vbt.psr.idle_frames + 1; | 265 | uint32_t idle_frames = max(6, dev_priv->vbt.psr.idle_frames); |
266 | uint32_t val = EDP_PSR_ENABLE; | 266 | uint32_t val = EDP_PSR_ENABLE; |
267 | 267 | ||
268 | val |= max_sleep_time << EDP_PSR_MAX_SLEEP_TIME_SHIFT; | 268 | val |= max_sleep_time << EDP_PSR_MAX_SLEEP_TIME_SHIFT; |
diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 59adcf8532dd..3f6704cf6608 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c | |||
@@ -144,7 +144,7 @@ static struct list_head *vc4_get_cache_list_for_size(struct drm_device *dev, | |||
144 | return &vc4->bo_cache.size_list[page_index]; | 144 | return &vc4->bo_cache.size_list[page_index]; |
145 | } | 145 | } |
146 | 146 | ||
147 | void vc4_bo_cache_purge(struct drm_device *dev) | 147 | static void vc4_bo_cache_purge(struct drm_device *dev) |
148 | { | 148 | { |
149 | struct vc4_dev *vc4 = to_vc4_dev(dev); | 149 | struct vc4_dev *vc4 = to_vc4_dev(dev); |
150 | 150 | ||
diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c index 46527e989ce3..2543cf5b8b51 100644 --- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c +++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c | |||
@@ -309,8 +309,14 @@ validate_uniform_address_write(struct vc4_validated_shader_info *validated_shade | |||
309 | * of uniforms on each side. However, this scheme is easy to | 309 | * of uniforms on each side. However, this scheme is easy to |
310 | * validate so it's all we allow for now. | 310 | * validate so it's all we allow for now. |
311 | */ | 311 | */ |
312 | 312 | switch (QPU_GET_FIELD(inst, QPU_SIG)) { | |
313 | if (QPU_GET_FIELD(inst, QPU_SIG) != QPU_SIG_NONE) { | 313 | case QPU_SIG_NONE: |
314 | case QPU_SIG_SCOREBOARD_UNLOCK: | ||
315 | case QPU_SIG_COLOR_LOAD: | ||
316 | case QPU_SIG_LOAD_TMU0: | ||
317 | case QPU_SIG_LOAD_TMU1: | ||
318 | break; | ||
319 | default: | ||
314 | DRM_ERROR("uniforms address change must be " | 320 | DRM_ERROR("uniforms address change must be " |
315 | "normal math\n"); | 321 | "normal math\n"); |
316 | return false; | 322 | return false; |
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index b6a953aed7e8..80f988984f44 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
@@ -333,6 +333,8 @@ static void remove_ep_tid(struct c4iw_ep *ep) | |||
333 | 333 | ||
334 | spin_lock_irqsave(&ep->com.dev->lock, flags); | 334 | spin_lock_irqsave(&ep->com.dev->lock, flags); |
335 | _remove_handle(ep->com.dev, &ep->com.dev->hwtid_idr, ep->hwtid, 0); | 335 | _remove_handle(ep->com.dev, &ep->com.dev->hwtid_idr, ep->hwtid, 0); |
336 | if (idr_is_empty(&ep->com.dev->hwtid_idr)) | ||
337 | wake_up(&ep->com.dev->wait); | ||
336 | spin_unlock_irqrestore(&ep->com.dev->lock, flags); | 338 | spin_unlock_irqrestore(&ep->com.dev->lock, flags); |
337 | } | 339 | } |
338 | 340 | ||
@@ -2117,8 +2119,10 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, | |||
2117 | } | 2119 | } |
2118 | ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t, | 2120 | ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t, |
2119 | n, pdev, rt_tos2priority(tos)); | 2121 | n, pdev, rt_tos2priority(tos)); |
2120 | if (!ep->l2t) | 2122 | if (!ep->l2t) { |
2123 | dev_put(pdev); | ||
2121 | goto out; | 2124 | goto out; |
2125 | } | ||
2122 | ep->mtu = pdev->mtu; | 2126 | ep->mtu = pdev->mtu; |
2123 | ep->tx_chan = cxgb4_port_chan(pdev); | 2127 | ep->tx_chan = cxgb4_port_chan(pdev); |
2124 | ep->smac_idx = cxgb4_tp_smt_idx(adapter_type, | 2128 | ep->smac_idx = cxgb4_tp_smt_idx(adapter_type, |
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c index 071d7332ec06..3c4b2126e0d1 100644 --- a/drivers/infiniband/hw/cxgb4/device.c +++ b/drivers/infiniband/hw/cxgb4/device.c | |||
@@ -872,9 +872,13 @@ static void c4iw_rdev_close(struct c4iw_rdev *rdev) | |||
872 | static void c4iw_dealloc(struct uld_ctx *ctx) | 872 | static void c4iw_dealloc(struct uld_ctx *ctx) |
873 | { | 873 | { |
874 | c4iw_rdev_close(&ctx->dev->rdev); | 874 | c4iw_rdev_close(&ctx->dev->rdev); |
875 | WARN_ON_ONCE(!idr_is_empty(&ctx->dev->cqidr)); | ||
875 | idr_destroy(&ctx->dev->cqidr); | 876 | idr_destroy(&ctx->dev->cqidr); |
877 | WARN_ON_ONCE(!idr_is_empty(&ctx->dev->qpidr)); | ||
876 | idr_destroy(&ctx->dev->qpidr); | 878 | idr_destroy(&ctx->dev->qpidr); |
879 | WARN_ON_ONCE(!idr_is_empty(&ctx->dev->mmidr)); | ||
877 | idr_destroy(&ctx->dev->mmidr); | 880 | idr_destroy(&ctx->dev->mmidr); |
881 | wait_event(ctx->dev->wait, idr_is_empty(&ctx->dev->hwtid_idr)); | ||
878 | idr_destroy(&ctx->dev->hwtid_idr); | 882 | idr_destroy(&ctx->dev->hwtid_idr); |
879 | idr_destroy(&ctx->dev->stid_idr); | 883 | idr_destroy(&ctx->dev->stid_idr); |
880 | idr_destroy(&ctx->dev->atid_idr); | 884 | idr_destroy(&ctx->dev->atid_idr); |
@@ -992,6 +996,7 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop) | |||
992 | mutex_init(&devp->rdev.stats.lock); | 996 | mutex_init(&devp->rdev.stats.lock); |
993 | mutex_init(&devp->db_mutex); | 997 | mutex_init(&devp->db_mutex); |
994 | INIT_LIST_HEAD(&devp->db_fc_list); | 998 | INIT_LIST_HEAD(&devp->db_fc_list); |
999 | init_waitqueue_head(&devp->wait); | ||
995 | devp->avail_ird = devp->rdev.lldi.max_ird_adapter; | 1000 | devp->avail_ird = devp->rdev.lldi.max_ird_adapter; |
996 | 1001 | ||
997 | if (c4iw_debugfs_root) { | 1002 | if (c4iw_debugfs_root) { |
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h index aa47e0ae80bc..4b83b84f7ddf 100644 --- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h +++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h | |||
@@ -263,6 +263,7 @@ struct c4iw_dev { | |||
263 | struct idr stid_idr; | 263 | struct idr stid_idr; |
264 | struct list_head db_fc_list; | 264 | struct list_head db_fc_list; |
265 | u32 avail_ird; | 265 | u32 avail_ird; |
266 | wait_queue_head_t wait; | ||
266 | }; | 267 | }; |
267 | 268 | ||
268 | static inline struct c4iw_dev *to_c4iw_dev(struct ib_device *ibdev) | 269 | static inline struct c4iw_dev *to_c4iw_dev(struct ib_device *ibdev) |
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c index 9c2e53d28f98..0f21c3a25552 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c | |||
@@ -1128,6 +1128,27 @@ void handle_port_mgmt_change_event(struct work_struct *work) | |||
1128 | 1128 | ||
1129 | /* Generate GUID changed event */ | 1129 | /* Generate GUID changed event */ |
1130 | if (changed_attr & MLX4_EQ_PORT_INFO_GID_PFX_CHANGE_MASK) { | 1130 | if (changed_attr & MLX4_EQ_PORT_INFO_GID_PFX_CHANGE_MASK) { |
1131 | if (mlx4_is_master(dev->dev)) { | ||
1132 | union ib_gid gid; | ||
1133 | int err = 0; | ||
1134 | |||
1135 | if (!eqe->event.port_mgmt_change.params.port_info.gid_prefix) | ||
1136 | err = __mlx4_ib_query_gid(&dev->ib_dev, port, 0, &gid, 1); | ||
1137 | else | ||
1138 | gid.global.subnet_prefix = | ||
1139 | eqe->event.port_mgmt_change.params.port_info.gid_prefix; | ||
1140 | if (err) { | ||
1141 | pr_warn("Could not change QP1 subnet prefix for port %d: query_gid error (%d)\n", | ||
1142 | port, err); | ||
1143 | } else { | ||
1144 | pr_debug("Changing QP1 subnet prefix for port %d. old=0x%llx. new=0x%llx\n", | ||
1145 | port, | ||
1146 | (u64)atomic64_read(&dev->sriov.demux[port - 1].subnet_prefix), | ||
1147 | be64_to_cpu(gid.global.subnet_prefix)); | ||
1148 | atomic64_set(&dev->sriov.demux[port - 1].subnet_prefix, | ||
1149 | be64_to_cpu(gid.global.subnet_prefix)); | ||
1150 | } | ||
1151 | } | ||
1131 | mlx4_ib_dispatch_event(dev, port, IB_EVENT_GID_CHANGE); | 1152 | mlx4_ib_dispatch_event(dev, port, IB_EVENT_GID_CHANGE); |
1132 | /*if master, notify all slaves*/ | 1153 | /*if master, notify all slaves*/ |
1133 | if (mlx4_is_master(dev->dev)) | 1154 | if (mlx4_is_master(dev->dev)) |
@@ -2202,6 +2223,8 @@ int mlx4_ib_init_sriov(struct mlx4_ib_dev *dev) | |||
2202 | if (err) | 2223 | if (err) |
2203 | goto demux_err; | 2224 | goto demux_err; |
2204 | dev->sriov.demux[i].guid_cache[0] = gid.global.interface_id; | 2225 | dev->sriov.demux[i].guid_cache[0] = gid.global.interface_id; |
2226 | atomic64_set(&dev->sriov.demux[i].subnet_prefix, | ||
2227 | be64_to_cpu(gid.global.subnet_prefix)); | ||
2205 | err = alloc_pv_object(dev, mlx4_master_func_num(dev->dev), i + 1, | 2228 | err = alloc_pv_object(dev, mlx4_master_func_num(dev->dev), i + 1, |
2206 | &dev->sriov.sqps[i]); | 2229 | &dev->sriov.sqps[i]); |
2207 | if (err) | 2230 | if (err) |
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 2af44c2de262..87ba9bca4181 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -2202,6 +2202,9 @@ static int mlx4_ib_alloc_diag_counters(struct mlx4_ib_dev *ibdev) | |||
2202 | bool per_port = !!(ibdev->dev->caps.flags2 & | 2202 | bool per_port = !!(ibdev->dev->caps.flags2 & |
2203 | MLX4_DEV_CAP_FLAG2_DIAG_PER_PORT); | 2203 | MLX4_DEV_CAP_FLAG2_DIAG_PER_PORT); |
2204 | 2204 | ||
2205 | if (mlx4_is_slave(ibdev->dev)) | ||
2206 | return 0; | ||
2207 | |||
2205 | for (i = 0; i < MLX4_DIAG_COUNTERS_TYPES; i++) { | 2208 | for (i = 0; i < MLX4_DIAG_COUNTERS_TYPES; i++) { |
2206 | /* i == 1 means we are building port counters */ | 2209 | /* i == 1 means we are building port counters */ |
2207 | if (i && !per_port) | 2210 | if (i && !per_port) |
diff --git a/drivers/infiniband/hw/mlx4/mcg.c b/drivers/infiniband/hw/mlx4/mcg.c index 8f7ad07915b0..097bfcc4ee99 100644 --- a/drivers/infiniband/hw/mlx4/mcg.c +++ b/drivers/infiniband/hw/mlx4/mcg.c | |||
@@ -489,7 +489,7 @@ static u8 get_leave_state(struct mcast_group *group) | |||
489 | if (!group->members[i]) | 489 | if (!group->members[i]) |
490 | leave_state |= (1 << i); | 490 | leave_state |= (1 << i); |
491 | 491 | ||
492 | return leave_state & (group->rec.scope_join_state & 7); | 492 | return leave_state & (group->rec.scope_join_state & 0xf); |
493 | } | 493 | } |
494 | 494 | ||
495 | static int join_group(struct mcast_group *group, int slave, u8 join_mask) | 495 | static int join_group(struct mcast_group *group, int slave, u8 join_mask) |
@@ -564,8 +564,8 @@ static void mlx4_ib_mcg_timeout_handler(struct work_struct *work) | |||
564 | } else | 564 | } else |
565 | mcg_warn_group(group, "DRIVER BUG\n"); | 565 | mcg_warn_group(group, "DRIVER BUG\n"); |
566 | } else if (group->state == MCAST_LEAVE_SENT) { | 566 | } else if (group->state == MCAST_LEAVE_SENT) { |
567 | if (group->rec.scope_join_state & 7) | 567 | if (group->rec.scope_join_state & 0xf) |
568 | group->rec.scope_join_state &= 0xf8; | 568 | group->rec.scope_join_state &= 0xf0; |
569 | group->state = MCAST_IDLE; | 569 | group->state = MCAST_IDLE; |
570 | mutex_unlock(&group->lock); | 570 | mutex_unlock(&group->lock); |
571 | if (release_group(group, 1)) | 571 | if (release_group(group, 1)) |
@@ -605,7 +605,7 @@ static int handle_leave_req(struct mcast_group *group, u8 leave_mask, | |||
605 | static int handle_join_req(struct mcast_group *group, u8 join_mask, | 605 | static int handle_join_req(struct mcast_group *group, u8 join_mask, |
606 | struct mcast_req *req) | 606 | struct mcast_req *req) |
607 | { | 607 | { |
608 | u8 group_join_state = group->rec.scope_join_state & 7; | 608 | u8 group_join_state = group->rec.scope_join_state & 0xf; |
609 | int ref = 0; | 609 | int ref = 0; |
610 | u16 status; | 610 | u16 status; |
611 | struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data; | 611 | struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data; |
@@ -690,8 +690,8 @@ static void mlx4_ib_mcg_work_handler(struct work_struct *work) | |||
690 | u8 cur_join_state; | 690 | u8 cur_join_state; |
691 | 691 | ||
692 | resp_join_state = ((struct ib_sa_mcmember_data *) | 692 | resp_join_state = ((struct ib_sa_mcmember_data *) |
693 | group->response_sa_mad.data)->scope_join_state & 7; | 693 | group->response_sa_mad.data)->scope_join_state & 0xf; |
694 | cur_join_state = group->rec.scope_join_state & 7; | 694 | cur_join_state = group->rec.scope_join_state & 0xf; |
695 | 695 | ||
696 | if (method == IB_MGMT_METHOD_GET_RESP) { | 696 | if (method == IB_MGMT_METHOD_GET_RESP) { |
697 | /* successfull join */ | 697 | /* successfull join */ |
@@ -710,7 +710,7 @@ process_requests: | |||
710 | req = list_first_entry(&group->pending_list, struct mcast_req, | 710 | req = list_first_entry(&group->pending_list, struct mcast_req, |
711 | group_list); | 711 | group_list); |
712 | sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data; | 712 | sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data; |
713 | req_join_state = sa_data->scope_join_state & 0x7; | 713 | req_join_state = sa_data->scope_join_state & 0xf; |
714 | 714 | ||
715 | /* For a leave request, we will immediately answer the VF, and | 715 | /* For a leave request, we will immediately answer the VF, and |
716 | * update our internal counters. The actual leave will be sent | 716 | * update our internal counters. The actual leave will be sent |
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h index 7c5832ede4bd..686ab48ff644 100644 --- a/drivers/infiniband/hw/mlx4/mlx4_ib.h +++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h | |||
@@ -448,7 +448,7 @@ struct mlx4_ib_demux_ctx { | |||
448 | struct workqueue_struct *wq; | 448 | struct workqueue_struct *wq; |
449 | struct workqueue_struct *ud_wq; | 449 | struct workqueue_struct *ud_wq; |
450 | spinlock_t ud_lock; | 450 | spinlock_t ud_lock; |
451 | __be64 subnet_prefix; | 451 | atomic64_t subnet_prefix; |
452 | __be64 guid_cache[128]; | 452 | __be64 guid_cache[128]; |
453 | struct mlx4_ib_dev *dev; | 453 | struct mlx4_ib_dev *dev; |
454 | /* the following lock protects both mcg_table and mcg_mgid0_list */ | 454 | /* the following lock protects both mcg_table and mcg_mgid0_list */ |
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 768085f59566..7fb9629bd12b 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
@@ -2493,24 +2493,27 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_ud_wr *wr, | |||
2493 | sqp->ud_header.grh.flow_label = | 2493 | sqp->ud_header.grh.flow_label = |
2494 | ah->av.ib.sl_tclass_flowlabel & cpu_to_be32(0xfffff); | 2494 | ah->av.ib.sl_tclass_flowlabel & cpu_to_be32(0xfffff); |
2495 | sqp->ud_header.grh.hop_limit = ah->av.ib.hop_limit; | 2495 | sqp->ud_header.grh.hop_limit = ah->av.ib.hop_limit; |
2496 | if (is_eth) | 2496 | if (is_eth) { |
2497 | memcpy(sqp->ud_header.grh.source_gid.raw, sgid.raw, 16); | 2497 | memcpy(sqp->ud_header.grh.source_gid.raw, sgid.raw, 16); |
2498 | else { | 2498 | } else { |
2499 | if (mlx4_is_mfunc(to_mdev(ib_dev)->dev)) { | 2499 | if (mlx4_is_mfunc(to_mdev(ib_dev)->dev)) { |
2500 | /* When multi-function is enabled, the ib_core gid | 2500 | /* When multi-function is enabled, the ib_core gid |
2501 | * indexes don't necessarily match the hw ones, so | 2501 | * indexes don't necessarily match the hw ones, so |
2502 | * we must use our own cache */ | 2502 | * we must use our own cache |
2503 | sqp->ud_header.grh.source_gid.global.subnet_prefix = | 2503 | */ |
2504 | to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1]. | 2504 | sqp->ud_header.grh.source_gid.global.subnet_prefix = |
2505 | subnet_prefix; | 2505 | cpu_to_be64(atomic64_read(&(to_mdev(ib_dev)->sriov. |
2506 | sqp->ud_header.grh.source_gid.global.interface_id = | 2506 | demux[sqp->qp.port - 1]. |
2507 | to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1]. | 2507 | subnet_prefix))); |
2508 | guid_cache[ah->av.ib.gid_index]; | 2508 | sqp->ud_header.grh.source_gid.global.interface_id = |
2509 | } else | 2509 | to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1]. |
2510 | ib_get_cached_gid(ib_dev, | 2510 | guid_cache[ah->av.ib.gid_index]; |
2511 | be32_to_cpu(ah->av.ib.port_pd) >> 24, | 2511 | } else { |
2512 | ah->av.ib.gid_index, | 2512 | ib_get_cached_gid(ib_dev, |
2513 | &sqp->ud_header.grh.source_gid, NULL); | 2513 | be32_to_cpu(ah->av.ib.port_pd) >> 24, |
2514 | ah->av.ib.gid_index, | ||
2515 | &sqp->ud_header.grh.source_gid, NULL); | ||
2516 | } | ||
2514 | } | 2517 | } |
2515 | memcpy(sqp->ud_header.grh.destination_gid.raw, | 2518 | memcpy(sqp->ud_header.grh.destination_gid.raw, |
2516 | ah->av.ib.dgid, 16); | 2519 | ah->av.ib.dgid, 16); |
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 8150ea372c53..e19537cf44ab 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
@@ -288,7 +288,9 @@ __be16 mlx5_get_roce_udp_sport(struct mlx5_ib_dev *dev, u8 port_num, | |||
288 | 288 | ||
289 | static int mlx5_use_mad_ifc(struct mlx5_ib_dev *dev) | 289 | static int mlx5_use_mad_ifc(struct mlx5_ib_dev *dev) |
290 | { | 290 | { |
291 | return !MLX5_CAP_GEN(dev->mdev, ib_virt); | 291 | if (MLX5_CAP_GEN(dev->mdev, port_type) == MLX5_CAP_PORT_TYPE_IB) |
292 | return !MLX5_CAP_GEN(dev->mdev, ib_virt); | ||
293 | return 0; | ||
292 | } | 294 | } |
293 | 295 | ||
294 | enum { | 296 | enum { |
@@ -1428,6 +1430,13 @@ static int parse_flow_attr(u32 *match_c, u32 *match_v, | |||
1428 | dmac_47_16), | 1430 | dmac_47_16), |
1429 | ib_spec->eth.val.dst_mac); | 1431 | ib_spec->eth.val.dst_mac); |
1430 | 1432 | ||
1433 | ether_addr_copy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, outer_headers_c, | ||
1434 | smac_47_16), | ||
1435 | ib_spec->eth.mask.src_mac); | ||
1436 | ether_addr_copy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, outer_headers_v, | ||
1437 | smac_47_16), | ||
1438 | ib_spec->eth.val.src_mac); | ||
1439 | |||
1431 | if (ib_spec->eth.mask.vlan_tag) { | 1440 | if (ib_spec->eth.mask.vlan_tag) { |
1432 | MLX5_SET(fte_match_set_lyr_2_4, outer_headers_c, | 1441 | MLX5_SET(fte_match_set_lyr_2_4, outer_headers_c, |
1433 | vlan_tag, 1); | 1442 | vlan_tag, 1); |
diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c index 80c4b6b401b8..46b64970058e 100644 --- a/drivers/infiniband/sw/rdmavt/mr.c +++ b/drivers/infiniband/sw/rdmavt/mr.c | |||
@@ -294,7 +294,7 @@ static void __rvt_free_mr(struct rvt_mr *mr) | |||
294 | { | 294 | { |
295 | rvt_deinit_mregion(&mr->mr); | 295 | rvt_deinit_mregion(&mr->mr); |
296 | rvt_free_lkey(&mr->mr); | 296 | rvt_free_lkey(&mr->mr); |
297 | vfree(mr); | 297 | kfree(mr); |
298 | } | 298 | } |
299 | 299 | ||
300 | /** | 300 | /** |
diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c index 55f0e8f0ca79..ddd59270ff6d 100644 --- a/drivers/infiniband/sw/rxe/rxe.c +++ b/drivers/infiniband/sw/rxe/rxe.c | |||
@@ -362,15 +362,34 @@ static int __init rxe_module_init(void) | |||
362 | return err; | 362 | return err; |
363 | } | 363 | } |
364 | 364 | ||
365 | err = rxe_net_init(); | 365 | err = rxe_net_ipv4_init(); |
366 | if (err) { | 366 | if (err) { |
367 | pr_err("rxe: unable to init\n"); | 367 | pr_err("rxe: unable to init ipv4 tunnel\n"); |
368 | rxe_cache_exit(); | 368 | rxe_cache_exit(); |
369 | return err; | 369 | goto exit; |
370 | } | ||
371 | |||
372 | err = rxe_net_ipv6_init(); | ||
373 | if (err) { | ||
374 | pr_err("rxe: unable to init ipv6 tunnel\n"); | ||
375 | rxe_cache_exit(); | ||
376 | goto exit; | ||
370 | } | 377 | } |
378 | |||
379 | err = register_netdevice_notifier(&rxe_net_notifier); | ||
380 | if (err) { | ||
381 | pr_err("rxe: Failed to rigister netdev notifier\n"); | ||
382 | goto exit; | ||
383 | } | ||
384 | |||
371 | pr_info("rxe: loaded\n"); | 385 | pr_info("rxe: loaded\n"); |
372 | 386 | ||
373 | return 0; | 387 | return 0; |
388 | |||
389 | exit: | ||
390 | rxe_release_udp_tunnel(recv_sockets.sk4); | ||
391 | rxe_release_udp_tunnel(recv_sockets.sk6); | ||
392 | return err; | ||
374 | } | 393 | } |
375 | 394 | ||
376 | static void __exit rxe_module_exit(void) | 395 | static void __exit rxe_module_exit(void) |
diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c index 36f67de44095..1c59ef2c67aa 100644 --- a/drivers/infiniband/sw/rxe/rxe_comp.c +++ b/drivers/infiniband/sw/rxe/rxe_comp.c | |||
@@ -689,7 +689,14 @@ int rxe_completer(void *arg) | |||
689 | qp->req.need_retry = 1; | 689 | qp->req.need_retry = 1; |
690 | rxe_run_task(&qp->req.task, 1); | 690 | rxe_run_task(&qp->req.task, 1); |
691 | } | 691 | } |
692 | |||
693 | if (pkt) { | ||
694 | rxe_drop_ref(pkt->qp); | ||
695 | kfree_skb(skb); | ||
696 | } | ||
697 | |||
692 | goto exit; | 698 | goto exit; |
699 | |||
693 | } else { | 700 | } else { |
694 | wqe->status = IB_WC_RETRY_EXC_ERR; | 701 | wqe->status = IB_WC_RETRY_EXC_ERR; |
695 | state = COMPST_ERROR; | 702 | state = COMPST_ERROR; |
@@ -716,6 +723,12 @@ int rxe_completer(void *arg) | |||
716 | case COMPST_ERROR: | 723 | case COMPST_ERROR: |
717 | do_complete(qp, wqe); | 724 | do_complete(qp, wqe); |
718 | rxe_qp_error(qp); | 725 | rxe_qp_error(qp); |
726 | |||
727 | if (pkt) { | ||
728 | rxe_drop_ref(pkt->qp); | ||
729 | kfree_skb(skb); | ||
730 | } | ||
731 | |||
719 | goto exit; | 732 | goto exit; |
720 | } | 733 | } |
721 | } | 734 | } |
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c index 0b8d2ea8b41d..eedf2f1cafdf 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.c +++ b/drivers/infiniband/sw/rxe/rxe_net.c | |||
@@ -275,9 +275,10 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port, | |||
275 | return sock; | 275 | return sock; |
276 | } | 276 | } |
277 | 277 | ||
278 | static void rxe_release_udp_tunnel(struct socket *sk) | 278 | void rxe_release_udp_tunnel(struct socket *sk) |
279 | { | 279 | { |
280 | udp_tunnel_sock_release(sk); | 280 | if (sk) |
281 | udp_tunnel_sock_release(sk); | ||
281 | } | 282 | } |
282 | 283 | ||
283 | static void prepare_udp_hdr(struct sk_buff *skb, __be16 src_port, | 284 | static void prepare_udp_hdr(struct sk_buff *skb, __be16 src_port, |
@@ -658,51 +659,45 @@ out: | |||
658 | return NOTIFY_OK; | 659 | return NOTIFY_OK; |
659 | } | 660 | } |
660 | 661 | ||
661 | static struct notifier_block rxe_net_notifier = { | 662 | struct notifier_block rxe_net_notifier = { |
662 | .notifier_call = rxe_notify, | 663 | .notifier_call = rxe_notify, |
663 | }; | 664 | }; |
664 | 665 | ||
665 | int rxe_net_init(void) | 666 | int rxe_net_ipv4_init(void) |
666 | { | 667 | { |
667 | int err; | ||
668 | |||
669 | spin_lock_init(&dev_list_lock); | 668 | spin_lock_init(&dev_list_lock); |
670 | 669 | ||
671 | recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net, | ||
672 | htons(ROCE_V2_UDP_DPORT), true); | ||
673 | if (IS_ERR(recv_sockets.sk6)) { | ||
674 | recv_sockets.sk6 = NULL; | ||
675 | pr_err("rxe: Failed to create IPv6 UDP tunnel\n"); | ||
676 | return -1; | ||
677 | } | ||
678 | |||
679 | recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net, | 670 | recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net, |
680 | htons(ROCE_V2_UDP_DPORT), false); | 671 | htons(ROCE_V2_UDP_DPORT), false); |
681 | if (IS_ERR(recv_sockets.sk4)) { | 672 | if (IS_ERR(recv_sockets.sk4)) { |
682 | rxe_release_udp_tunnel(recv_sockets.sk6); | ||
683 | recv_sockets.sk4 = NULL; | 673 | recv_sockets.sk4 = NULL; |
684 | recv_sockets.sk6 = NULL; | ||
685 | pr_err("rxe: Failed to create IPv4 UDP tunnel\n"); | 674 | pr_err("rxe: Failed to create IPv4 UDP tunnel\n"); |
686 | return -1; | 675 | return -1; |
687 | } | 676 | } |
688 | 677 | ||
689 | err = register_netdevice_notifier(&rxe_net_notifier); | 678 | return 0; |
690 | if (err) { | ||
691 | rxe_release_udp_tunnel(recv_sockets.sk6); | ||
692 | rxe_release_udp_tunnel(recv_sockets.sk4); | ||
693 | pr_err("rxe: Failed to rigister netdev notifier\n"); | ||
694 | } | ||
695 | |||
696 | return err; | ||
697 | } | 679 | } |
698 | 680 | ||
699 | void rxe_net_exit(void) | 681 | int rxe_net_ipv6_init(void) |
700 | { | 682 | { |
701 | if (recv_sockets.sk6) | 683 | #if IS_ENABLED(CONFIG_IPV6) |
702 | rxe_release_udp_tunnel(recv_sockets.sk6); | ||
703 | 684 | ||
704 | if (recv_sockets.sk4) | 685 | spin_lock_init(&dev_list_lock); |
705 | rxe_release_udp_tunnel(recv_sockets.sk4); | ||
706 | 686 | ||
687 | recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net, | ||
688 | htons(ROCE_V2_UDP_DPORT), true); | ||
689 | if (IS_ERR(recv_sockets.sk6)) { | ||
690 | recv_sockets.sk6 = NULL; | ||
691 | pr_err("rxe: Failed to create IPv6 UDP tunnel\n"); | ||
692 | return -1; | ||
693 | } | ||
694 | #endif | ||
695 | return 0; | ||
696 | } | ||
697 | |||
698 | void rxe_net_exit(void) | ||
699 | { | ||
700 | rxe_release_udp_tunnel(recv_sockets.sk6); | ||
701 | rxe_release_udp_tunnel(recv_sockets.sk4); | ||
707 | unregister_netdevice_notifier(&rxe_net_notifier); | 702 | unregister_netdevice_notifier(&rxe_net_notifier); |
708 | } | 703 | } |
diff --git a/drivers/infiniband/sw/rxe/rxe_net.h b/drivers/infiniband/sw/rxe/rxe_net.h index 7b06f76d16cc..0daf7f09e5b5 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.h +++ b/drivers/infiniband/sw/rxe/rxe_net.h | |||
@@ -44,10 +44,13 @@ struct rxe_recv_sockets { | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | extern struct rxe_recv_sockets recv_sockets; | 46 | extern struct rxe_recv_sockets recv_sockets; |
47 | extern struct notifier_block rxe_net_notifier; | ||
48 | void rxe_release_udp_tunnel(struct socket *sk); | ||
47 | 49 | ||
48 | struct rxe_dev *rxe_net_add(struct net_device *ndev); | 50 | struct rxe_dev *rxe_net_add(struct net_device *ndev); |
49 | 51 | ||
50 | int rxe_net_init(void); | 52 | int rxe_net_ipv4_init(void); |
53 | int rxe_net_ipv6_init(void); | ||
51 | void rxe_net_exit(void); | 54 | void rxe_net_exit(void); |
52 | 55 | ||
53 | #endif /* RXE_NET_H */ | 56 | #endif /* RXE_NET_H */ |
diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c index 3d464c23e08b..144d2f129fcd 100644 --- a/drivers/infiniband/sw/rxe/rxe_recv.c +++ b/drivers/infiniband/sw/rxe/rxe_recv.c | |||
@@ -312,7 +312,7 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb) | |||
312 | * make a copy of the skb to post to the next qp | 312 | * make a copy of the skb to post to the next qp |
313 | */ | 313 | */ |
314 | skb_copy = (mce->qp_list.next != &mcg->qp_list) ? | 314 | skb_copy = (mce->qp_list.next != &mcg->qp_list) ? |
315 | skb_clone(skb, GFP_KERNEL) : NULL; | 315 | skb_clone(skb, GFP_ATOMIC) : NULL; |
316 | 316 | ||
317 | pkt->qp = qp; | 317 | pkt->qp = qp; |
318 | rxe_add_ref(qp); | 318 | rxe_add_ref(qp); |
diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index 33b2d9d77021..13a848a518e8 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c | |||
@@ -511,24 +511,21 @@ static int fill_packet(struct rxe_qp *qp, struct rxe_send_wqe *wqe, | |||
511 | } | 511 | } |
512 | 512 | ||
513 | static void update_wqe_state(struct rxe_qp *qp, | 513 | static void update_wqe_state(struct rxe_qp *qp, |
514 | struct rxe_send_wqe *wqe, | 514 | struct rxe_send_wqe *wqe, |
515 | struct rxe_pkt_info *pkt, | 515 | struct rxe_pkt_info *pkt) |
516 | enum wqe_state *prev_state) | ||
517 | { | 516 | { |
518 | enum wqe_state prev_state_ = wqe->state; | ||
519 | |||
520 | if (pkt->mask & RXE_END_MASK) { | 517 | if (pkt->mask & RXE_END_MASK) { |
521 | if (qp_type(qp) == IB_QPT_RC) | 518 | if (qp_type(qp) == IB_QPT_RC) |
522 | wqe->state = wqe_state_pending; | 519 | wqe->state = wqe_state_pending; |
523 | } else { | 520 | } else { |
524 | wqe->state = wqe_state_processing; | 521 | wqe->state = wqe_state_processing; |
525 | } | 522 | } |
526 | |||
527 | *prev_state = prev_state_; | ||
528 | } | 523 | } |
529 | 524 | ||
530 | static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe, | 525 | static void update_wqe_psn(struct rxe_qp *qp, |
531 | struct rxe_pkt_info *pkt, int payload) | 526 | struct rxe_send_wqe *wqe, |
527 | struct rxe_pkt_info *pkt, | ||
528 | int payload) | ||
532 | { | 529 | { |
533 | /* number of packets left to send including current one */ | 530 | /* number of packets left to send including current one */ |
534 | int num_pkt = (wqe->dma.resid + payload + qp->mtu - 1) / qp->mtu; | 531 | int num_pkt = (wqe->dma.resid + payload + qp->mtu - 1) / qp->mtu; |
@@ -546,9 +543,34 @@ static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe, | |||
546 | qp->req.psn = (wqe->first_psn + num_pkt) & BTH_PSN_MASK; | 543 | qp->req.psn = (wqe->first_psn + num_pkt) & BTH_PSN_MASK; |
547 | else | 544 | else |
548 | qp->req.psn = (qp->req.psn + 1) & BTH_PSN_MASK; | 545 | qp->req.psn = (qp->req.psn + 1) & BTH_PSN_MASK; |
546 | } | ||
549 | 547 | ||
550 | qp->req.opcode = pkt->opcode; | 548 | static void save_state(struct rxe_send_wqe *wqe, |
549 | struct rxe_qp *qp, | ||
550 | struct rxe_send_wqe *rollback_wqe, | ||
551 | struct rxe_qp *rollback_qp) | ||
552 | { | ||
553 | rollback_wqe->state = wqe->state; | ||
554 | rollback_wqe->first_psn = wqe->first_psn; | ||
555 | rollback_wqe->last_psn = wqe->last_psn; | ||
556 | rollback_qp->req.psn = qp->req.psn; | ||
557 | } | ||
551 | 558 | ||
559 | static void rollback_state(struct rxe_send_wqe *wqe, | ||
560 | struct rxe_qp *qp, | ||
561 | struct rxe_send_wqe *rollback_wqe, | ||
562 | struct rxe_qp *rollback_qp) | ||
563 | { | ||
564 | wqe->state = rollback_wqe->state; | ||
565 | wqe->first_psn = rollback_wqe->first_psn; | ||
566 | wqe->last_psn = rollback_wqe->last_psn; | ||
567 | qp->req.psn = rollback_qp->req.psn; | ||
568 | } | ||
569 | |||
570 | static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe, | ||
571 | struct rxe_pkt_info *pkt, int payload) | ||
572 | { | ||
573 | qp->req.opcode = pkt->opcode; | ||
552 | 574 | ||
553 | if (pkt->mask & RXE_END_MASK) | 575 | if (pkt->mask & RXE_END_MASK) |
554 | qp->req.wqe_index = next_index(qp->sq.queue, qp->req.wqe_index); | 576 | qp->req.wqe_index = next_index(qp->sq.queue, qp->req.wqe_index); |
@@ -571,7 +593,8 @@ int rxe_requester(void *arg) | |||
571 | int mtu; | 593 | int mtu; |
572 | int opcode; | 594 | int opcode; |
573 | int ret; | 595 | int ret; |
574 | enum wqe_state prev_state; | 596 | struct rxe_qp rollback_qp; |
597 | struct rxe_send_wqe rollback_wqe; | ||
575 | 598 | ||
576 | next_wqe: | 599 | next_wqe: |
577 | if (unlikely(!qp->valid || qp->req.state == QP_STATE_ERROR)) | 600 | if (unlikely(!qp->valid || qp->req.state == QP_STATE_ERROR)) |
@@ -688,13 +711,21 @@ next_wqe: | |||
688 | goto err; | 711 | goto err; |
689 | } | 712 | } |
690 | 713 | ||
691 | update_wqe_state(qp, wqe, &pkt, &prev_state); | 714 | /* |
715 | * To prevent a race on wqe access between requester and completer, | ||
716 | * wqe members state and psn need to be set before calling | ||
717 | * rxe_xmit_packet(). | ||
718 | * Otherwise, completer might initiate an unjustified retry flow. | ||
719 | */ | ||
720 | save_state(wqe, qp, &rollback_wqe, &rollback_qp); | ||
721 | update_wqe_state(qp, wqe, &pkt); | ||
722 | update_wqe_psn(qp, wqe, &pkt, payload); | ||
692 | ret = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, &pkt, skb); | 723 | ret = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, &pkt, skb); |
693 | if (ret) { | 724 | if (ret) { |
694 | qp->need_req_skb = 1; | 725 | qp->need_req_skb = 1; |
695 | kfree_skb(skb); | 726 | kfree_skb(skb); |
696 | 727 | ||
697 | wqe->state = prev_state; | 728 | rollback_state(wqe, qp, &rollback_wqe, &rollback_qp); |
698 | 729 | ||
699 | if (ret == -EAGAIN) { | 730 | if (ret == -EAGAIN) { |
700 | rxe_run_task(&qp->req.task, 1); | 731 | rxe_run_task(&qp->req.task, 1); |
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index ebb03b46e2ad..3e0f0f2baace 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c | |||
@@ -972,11 +972,13 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt, | |||
972 | free_rd_atomic_resource(qp, res); | 972 | free_rd_atomic_resource(qp, res); |
973 | rxe_advance_resp_resource(qp); | 973 | rxe_advance_resp_resource(qp); |
974 | 974 | ||
975 | memcpy(SKB_TO_PKT(skb), &ack_pkt, sizeof(skb->cb)); | ||
976 | |||
975 | res->type = RXE_ATOMIC_MASK; | 977 | res->type = RXE_ATOMIC_MASK; |
976 | res->atomic.skb = skb; | 978 | res->atomic.skb = skb; |
977 | res->first_psn = qp->resp.psn; | 979 | res->first_psn = ack_pkt.psn; |
978 | res->last_psn = qp->resp.psn; | 980 | res->last_psn = ack_pkt.psn; |
979 | res->cur_psn = qp->resp.psn; | 981 | res->cur_psn = ack_pkt.psn; |
980 | 982 | ||
981 | rc = rxe_xmit_packet(rxe, qp, &ack_pkt, skb_copy); | 983 | rc = rxe_xmit_packet(rxe, qp, &ack_pkt, skb_copy); |
982 | if (rc) { | 984 | if (rc) { |
@@ -1116,8 +1118,7 @@ static enum resp_states duplicate_request(struct rxe_qp *qp, | |||
1116 | rc = RESPST_CLEANUP; | 1118 | rc = RESPST_CLEANUP; |
1117 | goto out; | 1119 | goto out; |
1118 | } | 1120 | } |
1119 | bth_set_psn(SKB_TO_PKT(skb_copy), | 1121 | |
1120 | qp->resp.psn - 1); | ||
1121 | /* Resend the result. */ | 1122 | /* Resend the result. */ |
1122 | rc = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, | 1123 | rc = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, |
1123 | pkt, skb_copy); | 1124 | pkt, skb_copy); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index dc6d241b9406..be11d5d5b8c1 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -1161,8 +1161,17 @@ static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv, | |||
1161 | } | 1161 | } |
1162 | 1162 | ||
1163 | if (level == IPOIB_FLUSH_LIGHT) { | 1163 | if (level == IPOIB_FLUSH_LIGHT) { |
1164 | int oper_up; | ||
1164 | ipoib_mark_paths_invalid(dev); | 1165 | ipoib_mark_paths_invalid(dev); |
1166 | /* Set IPoIB operation as down to prevent races between: | ||
1167 | * the flush flow which leaves MCG and on the fly joins | ||
1168 | * which can happen during that time. mcast restart task | ||
1169 | * should deal with join requests we missed. | ||
1170 | */ | ||
1171 | oper_up = test_and_clear_bit(IPOIB_FLAG_OPER_UP, &priv->flags); | ||
1165 | ipoib_mcast_dev_flush(dev); | 1172 | ipoib_mcast_dev_flush(dev); |
1173 | if (oper_up) | ||
1174 | set_bit(IPOIB_FLAG_OPER_UP, &priv->flags); | ||
1166 | ipoib_flush_ah(dev); | 1175 | ipoib_flush_ah(dev); |
1167 | } | 1176 | } |
1168 | 1177 | ||
diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c index 112e17c2768b..37f952dd9fc9 100644 --- a/drivers/irqchip/irq-atmel-aic.c +++ b/drivers/irqchip/irq-atmel-aic.c | |||
@@ -176,6 +176,7 @@ static int aic_irq_domain_xlate(struct irq_domain *d, | |||
176 | { | 176 | { |
177 | struct irq_domain_chip_generic *dgc = d->gc; | 177 | struct irq_domain_chip_generic *dgc = d->gc; |
178 | struct irq_chip_generic *gc; | 178 | struct irq_chip_generic *gc; |
179 | unsigned long flags; | ||
179 | unsigned smr; | 180 | unsigned smr; |
180 | int idx; | 181 | int idx; |
181 | int ret; | 182 | int ret; |
@@ -194,11 +195,11 @@ static int aic_irq_domain_xlate(struct irq_domain *d, | |||
194 | 195 | ||
195 | gc = dgc->gc[idx]; | 196 | gc = dgc->gc[idx]; |
196 | 197 | ||
197 | irq_gc_lock(gc); | 198 | irq_gc_lock_irqsave(gc, flags); |
198 | smr = irq_reg_readl(gc, AT91_AIC_SMR(*out_hwirq)); | 199 | smr = irq_reg_readl(gc, AT91_AIC_SMR(*out_hwirq)); |
199 | aic_common_set_priority(intspec[2], &smr); | 200 | aic_common_set_priority(intspec[2], &smr); |
200 | irq_reg_writel(gc, smr, AT91_AIC_SMR(*out_hwirq)); | 201 | irq_reg_writel(gc, smr, AT91_AIC_SMR(*out_hwirq)); |
201 | irq_gc_unlock(gc); | 202 | irq_gc_unlock_irqrestore(gc, flags); |
202 | 203 | ||
203 | return ret; | 204 | return ret; |
204 | } | 205 | } |
diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c index 4f0d068e1abe..2a624d87a035 100644 --- a/drivers/irqchip/irq-atmel-aic5.c +++ b/drivers/irqchip/irq-atmel-aic5.c | |||
@@ -258,6 +258,7 @@ static int aic5_irq_domain_xlate(struct irq_domain *d, | |||
258 | unsigned int *out_type) | 258 | unsigned int *out_type) |
259 | { | 259 | { |
260 | struct irq_chip_generic *bgc = irq_get_domain_generic_chip(d, 0); | 260 | struct irq_chip_generic *bgc = irq_get_domain_generic_chip(d, 0); |
261 | unsigned long flags; | ||
261 | unsigned smr; | 262 | unsigned smr; |
262 | int ret; | 263 | int ret; |
263 | 264 | ||
@@ -269,12 +270,12 @@ static int aic5_irq_domain_xlate(struct irq_domain *d, | |||
269 | if (ret) | 270 | if (ret) |
270 | return ret; | 271 | return ret; |
271 | 272 | ||
272 | irq_gc_lock(bgc); | 273 | irq_gc_lock_irqsave(bgc, flags); |
273 | irq_reg_writel(bgc, *out_hwirq, AT91_AIC5_SSR); | 274 | irq_reg_writel(bgc, *out_hwirq, AT91_AIC5_SSR); |
274 | smr = irq_reg_readl(bgc, AT91_AIC5_SMR); | 275 | smr = irq_reg_readl(bgc, AT91_AIC5_SMR); |
275 | aic_common_set_priority(intspec[2], &smr); | 276 | aic_common_set_priority(intspec[2], &smr); |
276 | irq_reg_writel(bgc, smr, AT91_AIC5_SMR); | 277 | irq_reg_writel(bgc, smr, AT91_AIC5_SMR); |
277 | irq_gc_unlock(bgc); | 278 | irq_gc_unlock_irqrestore(bgc, flags); |
278 | 279 | ||
279 | return ret; | 280 | return ret; |
280 | } | 281 | } |
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index f23d65eb070d..be3c49fa7382 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
@@ -1016,14 +1016,16 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req) | |||
1016 | 1016 | ||
1017 | /* Only reconfigure if we have a different burst size */ | 1017 | /* Only reconfigure if we have a different burst size */ |
1018 | if (*bp != burst) { | 1018 | if (*bp != burst) { |
1019 | struct dma_slave_config cfg; | 1019 | struct dma_slave_config cfg = { |
1020 | 1020 | .src_addr = host->phys_base + | |
1021 | cfg.src_addr = host->phys_base + OMAP_MMC_REG(host, DATA); | 1021 | OMAP_MMC_REG(host, DATA), |
1022 | cfg.dst_addr = host->phys_base + OMAP_MMC_REG(host, DATA); | 1022 | .dst_addr = host->phys_base + |
1023 | cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; | 1023 | OMAP_MMC_REG(host, DATA), |
1024 | cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; | 1024 | .src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES, |
1025 | cfg.src_maxburst = burst; | 1025 | .dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES, |
1026 | cfg.dst_maxburst = burst; | 1026 | .src_maxburst = burst, |
1027 | .dst_maxburst = burst, | ||
1028 | }; | ||
1027 | 1029 | ||
1028 | if (dmaengine_slave_config(c, &cfg)) | 1030 | if (dmaengine_slave_config(c, &cfg)) |
1029 | goto use_pio; | 1031 | goto use_pio; |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 24ebc9a8de89..5f2f24a7360d 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -1409,11 +1409,18 @@ static int omap_hsmmc_pre_dma_transfer(struct omap_hsmmc_host *host, | |||
1409 | static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host, | 1409 | static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host, |
1410 | struct mmc_request *req) | 1410 | struct mmc_request *req) |
1411 | { | 1411 | { |
1412 | struct dma_slave_config cfg; | ||
1413 | struct dma_async_tx_descriptor *tx; | 1412 | struct dma_async_tx_descriptor *tx; |
1414 | int ret = 0, i; | 1413 | int ret = 0, i; |
1415 | struct mmc_data *data = req->data; | 1414 | struct mmc_data *data = req->data; |
1416 | struct dma_chan *chan; | 1415 | struct dma_chan *chan; |
1416 | struct dma_slave_config cfg = { | ||
1417 | .src_addr = host->mapbase + OMAP_HSMMC_DATA, | ||
1418 | .dst_addr = host->mapbase + OMAP_HSMMC_DATA, | ||
1419 | .src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, | ||
1420 | .dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, | ||
1421 | .src_maxburst = data->blksz / 4, | ||
1422 | .dst_maxburst = data->blksz / 4, | ||
1423 | }; | ||
1417 | 1424 | ||
1418 | /* Sanity check: all the SG entries must be aligned by block size. */ | 1425 | /* Sanity check: all the SG entries must be aligned by block size. */ |
1419 | for (i = 0; i < data->sg_len; i++) { | 1426 | for (i = 0; i < data->sg_len; i++) { |
@@ -1433,13 +1440,6 @@ static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host, | |||
1433 | 1440 | ||
1434 | chan = omap_hsmmc_get_dma_chan(host, data); | 1441 | chan = omap_hsmmc_get_dma_chan(host, data); |
1435 | 1442 | ||
1436 | cfg.src_addr = host->mapbase + OMAP_HSMMC_DATA; | ||
1437 | cfg.dst_addr = host->mapbase + OMAP_HSMMC_DATA; | ||
1438 | cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; | ||
1439 | cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; | ||
1440 | cfg.src_maxburst = data->blksz / 4; | ||
1441 | cfg.dst_maxburst = data->blksz / 4; | ||
1442 | |||
1443 | ret = dmaengine_slave_config(chan, &cfg); | 1443 | ret = dmaengine_slave_config(chan, &cfg); |
1444 | if (ret) | 1444 | if (ret) |
1445 | return ret; | 1445 | return ret; |
diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c index c95ba83366a0..ed92ce729dde 100644 --- a/drivers/mmc/host/sdhci-st.c +++ b/drivers/mmc/host/sdhci-st.c | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | struct st_mmc_platform_data { | 29 | struct st_mmc_platform_data { |
30 | struct reset_control *rstc; | 30 | struct reset_control *rstc; |
31 | struct clk *icnclk; | ||
31 | void __iomem *top_ioaddr; | 32 | void __iomem *top_ioaddr; |
32 | }; | 33 | }; |
33 | 34 | ||
@@ -353,7 +354,7 @@ static int sdhci_st_probe(struct platform_device *pdev) | |||
353 | struct sdhci_host *host; | 354 | struct sdhci_host *host; |
354 | struct st_mmc_platform_data *pdata; | 355 | struct st_mmc_platform_data *pdata; |
355 | struct sdhci_pltfm_host *pltfm_host; | 356 | struct sdhci_pltfm_host *pltfm_host; |
356 | struct clk *clk; | 357 | struct clk *clk, *icnclk; |
357 | int ret = 0; | 358 | int ret = 0; |
358 | u16 host_version; | 359 | u16 host_version; |
359 | struct resource *res; | 360 | struct resource *res; |
@@ -365,6 +366,11 @@ static int sdhci_st_probe(struct platform_device *pdev) | |||
365 | return PTR_ERR(clk); | 366 | return PTR_ERR(clk); |
366 | } | 367 | } |
367 | 368 | ||
369 | /* ICN clock isn't compulsory, but use it if it's provided. */ | ||
370 | icnclk = devm_clk_get(&pdev->dev, "icn"); | ||
371 | if (IS_ERR(icnclk)) | ||
372 | icnclk = NULL; | ||
373 | |||
368 | rstc = devm_reset_control_get(&pdev->dev, NULL); | 374 | rstc = devm_reset_control_get(&pdev->dev, NULL); |
369 | if (IS_ERR(rstc)) | 375 | if (IS_ERR(rstc)) |
370 | rstc = NULL; | 376 | rstc = NULL; |
@@ -389,6 +395,7 @@ static int sdhci_st_probe(struct platform_device *pdev) | |||
389 | } | 395 | } |
390 | 396 | ||
391 | clk_prepare_enable(clk); | 397 | clk_prepare_enable(clk); |
398 | clk_prepare_enable(icnclk); | ||
392 | 399 | ||
393 | /* Configure the FlashSS Top registers for setting eMMC TX/RX delay */ | 400 | /* Configure the FlashSS Top registers for setting eMMC TX/RX delay */ |
394 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, | 401 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, |
@@ -400,6 +407,7 @@ static int sdhci_st_probe(struct platform_device *pdev) | |||
400 | } | 407 | } |
401 | 408 | ||
402 | pltfm_host->clk = clk; | 409 | pltfm_host->clk = clk; |
410 | pdata->icnclk = icnclk; | ||
403 | 411 | ||
404 | /* Configure the Arasan HC inside the flashSS */ | 412 | /* Configure the Arasan HC inside the flashSS */ |
405 | st_mmcss_cconfig(np, host); | 413 | st_mmcss_cconfig(np, host); |
@@ -422,6 +430,7 @@ static int sdhci_st_probe(struct platform_device *pdev) | |||
422 | return 0; | 430 | return 0; |
423 | 431 | ||
424 | err_out: | 432 | err_out: |
433 | clk_disable_unprepare(icnclk); | ||
425 | clk_disable_unprepare(clk); | 434 | clk_disable_unprepare(clk); |
426 | err_of: | 435 | err_of: |
427 | sdhci_pltfm_free(pdev); | 436 | sdhci_pltfm_free(pdev); |
@@ -442,6 +451,8 @@ static int sdhci_st_remove(struct platform_device *pdev) | |||
442 | 451 | ||
443 | ret = sdhci_pltfm_unregister(pdev); | 452 | ret = sdhci_pltfm_unregister(pdev); |
444 | 453 | ||
454 | clk_disable_unprepare(pdata->icnclk); | ||
455 | |||
445 | if (rstc) | 456 | if (rstc) |
446 | reset_control_assert(rstc); | 457 | reset_control_assert(rstc); |
447 | 458 | ||
@@ -462,6 +473,7 @@ static int sdhci_st_suspend(struct device *dev) | |||
462 | if (pdata->rstc) | 473 | if (pdata->rstc) |
463 | reset_control_assert(pdata->rstc); | 474 | reset_control_assert(pdata->rstc); |
464 | 475 | ||
476 | clk_disable_unprepare(pdata->icnclk); | ||
465 | clk_disable_unprepare(pltfm_host->clk); | 477 | clk_disable_unprepare(pltfm_host->clk); |
466 | out: | 478 | out: |
467 | return ret; | 479 | return ret; |
@@ -475,6 +487,7 @@ static int sdhci_st_resume(struct device *dev) | |||
475 | struct device_node *np = dev->of_node; | 487 | struct device_node *np = dev->of_node; |
476 | 488 | ||
477 | clk_prepare_enable(pltfm_host->clk); | 489 | clk_prepare_enable(pltfm_host->clk); |
490 | clk_prepare_enable(pdata->icnclk); | ||
478 | 491 | ||
479 | if (pdata->rstc) | 492 | if (pdata->rstc) |
480 | reset_control_deassert(pdata->rstc); | 493 | reset_control_deassert(pdata->rstc); |
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 8dcf5a960951..60f7eab11865 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
@@ -1693,7 +1693,12 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown) | |||
1693 | nvme_suspend_queue(dev->queues[i]); | 1693 | nvme_suspend_queue(dev->queues[i]); |
1694 | 1694 | ||
1695 | if (csts & NVME_CSTS_CFS || !(csts & NVME_CSTS_RDY)) { | 1695 | if (csts & NVME_CSTS_CFS || !(csts & NVME_CSTS_RDY)) { |
1696 | nvme_suspend_queue(dev->queues[0]); | 1696 | /* A device might become IO incapable very soon during |
1697 | * probe, before the admin queue is configured. Thus, | ||
1698 | * queue_count can be 0 here. | ||
1699 | */ | ||
1700 | if (dev->queue_count) | ||
1701 | nvme_suspend_queue(dev->queues[0]); | ||
1697 | } else { | 1702 | } else { |
1698 | nvme_disable_io_queues(dev); | 1703 | nvme_disable_io_queues(dev); |
1699 | nvme_disable_admin_queue(dev, shutdown); | 1704 | nvme_disable_admin_queue(dev, shutdown); |
@@ -2112,6 +2117,8 @@ static const struct pci_device_id nvme_id_table[] = { | |||
2112 | .driver_data = NVME_QUIRK_IDENTIFY_CNS, }, | 2117 | .driver_data = NVME_QUIRK_IDENTIFY_CNS, }, |
2113 | { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */ | 2118 | { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */ |
2114 | .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, | 2119 | .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, |
2120 | { PCI_DEVICE(0x1c5f, 0x0540), /* Memblaze Pblaze4 adapter */ | ||
2121 | .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, | ||
2115 | { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, | 2122 | { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, |
2116 | { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) }, | 2123 | { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) }, |
2117 | { 0, } | 2124 | { 0, } |
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index ab545fb347a0..c2c2c28e6eb5 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c | |||
@@ -82,6 +82,8 @@ struct nvme_rdma_request { | |||
82 | 82 | ||
83 | enum nvme_rdma_queue_flags { | 83 | enum nvme_rdma_queue_flags { |
84 | NVME_RDMA_Q_CONNECTED = (1 << 0), | 84 | NVME_RDMA_Q_CONNECTED = (1 << 0), |
85 | NVME_RDMA_IB_QUEUE_ALLOCATED = (1 << 1), | ||
86 | NVME_RDMA_Q_DELETING = (1 << 2), | ||
85 | }; | 87 | }; |
86 | 88 | ||
87 | struct nvme_rdma_queue { | 89 | struct nvme_rdma_queue { |
@@ -291,6 +293,7 @@ static int nvme_rdma_reinit_request(void *data, struct request *rq) | |||
291 | if (IS_ERR(req->mr)) { | 293 | if (IS_ERR(req->mr)) { |
292 | ret = PTR_ERR(req->mr); | 294 | ret = PTR_ERR(req->mr); |
293 | req->mr = NULL; | 295 | req->mr = NULL; |
296 | goto out; | ||
294 | } | 297 | } |
295 | 298 | ||
296 | req->mr->need_inval = false; | 299 | req->mr->need_inval = false; |
@@ -480,9 +483,14 @@ out_err: | |||
480 | 483 | ||
481 | static void nvme_rdma_destroy_queue_ib(struct nvme_rdma_queue *queue) | 484 | static void nvme_rdma_destroy_queue_ib(struct nvme_rdma_queue *queue) |
482 | { | 485 | { |
483 | struct nvme_rdma_device *dev = queue->device; | 486 | struct nvme_rdma_device *dev; |
484 | struct ib_device *ibdev = dev->dev; | 487 | struct ib_device *ibdev; |
488 | |||
489 | if (!test_and_clear_bit(NVME_RDMA_IB_QUEUE_ALLOCATED, &queue->flags)) | ||
490 | return; | ||
485 | 491 | ||
492 | dev = queue->device; | ||
493 | ibdev = dev->dev; | ||
486 | rdma_destroy_qp(queue->cm_id); | 494 | rdma_destroy_qp(queue->cm_id); |
487 | ib_free_cq(queue->ib_cq); | 495 | ib_free_cq(queue->ib_cq); |
488 | 496 | ||
@@ -533,6 +541,7 @@ static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue, | |||
533 | ret = -ENOMEM; | 541 | ret = -ENOMEM; |
534 | goto out_destroy_qp; | 542 | goto out_destroy_qp; |
535 | } | 543 | } |
544 | set_bit(NVME_RDMA_IB_QUEUE_ALLOCATED, &queue->flags); | ||
536 | 545 | ||
537 | return 0; | 546 | return 0; |
538 | 547 | ||
@@ -552,6 +561,7 @@ static int nvme_rdma_init_queue(struct nvme_rdma_ctrl *ctrl, | |||
552 | 561 | ||
553 | queue = &ctrl->queues[idx]; | 562 | queue = &ctrl->queues[idx]; |
554 | queue->ctrl = ctrl; | 563 | queue->ctrl = ctrl; |
564 | queue->flags = 0; | ||
555 | init_completion(&queue->cm_done); | 565 | init_completion(&queue->cm_done); |
556 | 566 | ||
557 | if (idx > 0) | 567 | if (idx > 0) |
@@ -590,6 +600,7 @@ static int nvme_rdma_init_queue(struct nvme_rdma_ctrl *ctrl, | |||
590 | return 0; | 600 | return 0; |
591 | 601 | ||
592 | out_destroy_cm_id: | 602 | out_destroy_cm_id: |
603 | nvme_rdma_destroy_queue_ib(queue); | ||
593 | rdma_destroy_id(queue->cm_id); | 604 | rdma_destroy_id(queue->cm_id); |
594 | return ret; | 605 | return ret; |
595 | } | 606 | } |
@@ -608,7 +619,7 @@ static void nvme_rdma_free_queue(struct nvme_rdma_queue *queue) | |||
608 | 619 | ||
609 | static void nvme_rdma_stop_and_free_queue(struct nvme_rdma_queue *queue) | 620 | static void nvme_rdma_stop_and_free_queue(struct nvme_rdma_queue *queue) |
610 | { | 621 | { |
611 | if (!test_and_clear_bit(NVME_RDMA_Q_CONNECTED, &queue->flags)) | 622 | if (test_and_set_bit(NVME_RDMA_Q_DELETING, &queue->flags)) |
612 | return; | 623 | return; |
613 | nvme_rdma_stop_queue(queue); | 624 | nvme_rdma_stop_queue(queue); |
614 | nvme_rdma_free_queue(queue); | 625 | nvme_rdma_free_queue(queue); |
@@ -652,7 +663,7 @@ static int nvme_rdma_init_io_queues(struct nvme_rdma_ctrl *ctrl) | |||
652 | return 0; | 663 | return 0; |
653 | 664 | ||
654 | out_free_queues: | 665 | out_free_queues: |
655 | for (; i >= 1; i--) | 666 | for (i--; i >= 1; i--) |
656 | nvme_rdma_stop_and_free_queue(&ctrl->queues[i]); | 667 | nvme_rdma_stop_and_free_queue(&ctrl->queues[i]); |
657 | 668 | ||
658 | return ret; | 669 | return ret; |
@@ -761,8 +772,13 @@ static void nvme_rdma_error_recovery_work(struct work_struct *work) | |||
761 | { | 772 | { |
762 | struct nvme_rdma_ctrl *ctrl = container_of(work, | 773 | struct nvme_rdma_ctrl *ctrl = container_of(work, |
763 | struct nvme_rdma_ctrl, err_work); | 774 | struct nvme_rdma_ctrl, err_work); |
775 | int i; | ||
764 | 776 | ||
765 | nvme_stop_keep_alive(&ctrl->ctrl); | 777 | nvme_stop_keep_alive(&ctrl->ctrl); |
778 | |||
779 | for (i = 0; i < ctrl->queue_count; i++) | ||
780 | clear_bit(NVME_RDMA_Q_CONNECTED, &ctrl->queues[i].flags); | ||
781 | |||
766 | if (ctrl->queue_count > 1) | 782 | if (ctrl->queue_count > 1) |
767 | nvme_stop_queues(&ctrl->ctrl); | 783 | nvme_stop_queues(&ctrl->ctrl); |
768 | blk_mq_stop_hw_queues(ctrl->ctrl.admin_q); | 784 | blk_mq_stop_hw_queues(ctrl->ctrl.admin_q); |
@@ -1305,58 +1321,6 @@ out_destroy_queue_ib: | |||
1305 | return ret; | 1321 | return ret; |
1306 | } | 1322 | } |
1307 | 1323 | ||
1308 | /** | ||
1309 | * nvme_rdma_device_unplug() - Handle RDMA device unplug | ||
1310 | * @queue: Queue that owns the cm_id that caught the event | ||
1311 | * | ||
1312 | * DEVICE_REMOVAL event notifies us that the RDMA device is about | ||
1313 | * to unplug so we should take care of destroying our RDMA resources. | ||
1314 | * This event will be generated for each allocated cm_id. | ||
1315 | * | ||
1316 | * In our case, the RDMA resources are managed per controller and not | ||
1317 | * only per queue. So the way we handle this is we trigger an implicit | ||
1318 | * controller deletion upon the first DEVICE_REMOVAL event we see, and | ||
1319 | * hold the event inflight until the controller deletion is completed. | ||
1320 | * | ||
1321 | * One exception that we need to handle is the destruction of the cm_id | ||
1322 | * that caught the event. Since we hold the callout until the controller | ||
1323 | * deletion is completed, we'll deadlock if the controller deletion will | ||
1324 | * call rdma_destroy_id on this queue's cm_id. Thus, we claim ownership | ||
1325 | * of destroying this queue before-hand, destroy the queue resources, | ||
1326 | * then queue the controller deletion which won't destroy this queue and | ||
1327 | * we destroy the cm_id implicitely by returning a non-zero rc to the callout. | ||
1328 | */ | ||
1329 | static int nvme_rdma_device_unplug(struct nvme_rdma_queue *queue) | ||
1330 | { | ||
1331 | struct nvme_rdma_ctrl *ctrl = queue->ctrl; | ||
1332 | int ret = 0; | ||
1333 | |||
1334 | /* Own the controller deletion */ | ||
1335 | if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_DELETING)) | ||
1336 | return 0; | ||
1337 | |||
1338 | dev_warn(ctrl->ctrl.device, | ||
1339 | "Got rdma device removal event, deleting ctrl\n"); | ||
1340 | |||
1341 | /* Get rid of reconnect work if its running */ | ||
1342 | cancel_delayed_work_sync(&ctrl->reconnect_work); | ||
1343 | |||
1344 | /* Disable the queue so ctrl delete won't free it */ | ||
1345 | if (test_and_clear_bit(NVME_RDMA_Q_CONNECTED, &queue->flags)) { | ||
1346 | /* Free this queue ourselves */ | ||
1347 | nvme_rdma_stop_queue(queue); | ||
1348 | nvme_rdma_destroy_queue_ib(queue); | ||
1349 | |||
1350 | /* Return non-zero so the cm_id will destroy implicitly */ | ||
1351 | ret = 1; | ||
1352 | } | ||
1353 | |||
1354 | /* Queue controller deletion */ | ||
1355 | queue_work(nvme_rdma_wq, &ctrl->delete_work); | ||
1356 | flush_work(&ctrl->delete_work); | ||
1357 | return ret; | ||
1358 | } | ||
1359 | |||
1360 | static int nvme_rdma_cm_handler(struct rdma_cm_id *cm_id, | 1324 | static int nvme_rdma_cm_handler(struct rdma_cm_id *cm_id, |
1361 | struct rdma_cm_event *ev) | 1325 | struct rdma_cm_event *ev) |
1362 | { | 1326 | { |
@@ -1398,8 +1362,8 @@ static int nvme_rdma_cm_handler(struct rdma_cm_id *cm_id, | |||
1398 | nvme_rdma_error_recovery(queue->ctrl); | 1362 | nvme_rdma_error_recovery(queue->ctrl); |
1399 | break; | 1363 | break; |
1400 | case RDMA_CM_EVENT_DEVICE_REMOVAL: | 1364 | case RDMA_CM_EVENT_DEVICE_REMOVAL: |
1401 | /* return 1 means impliciy CM ID destroy */ | 1365 | /* device removal is handled via the ib_client API */ |
1402 | return nvme_rdma_device_unplug(queue); | 1366 | break; |
1403 | default: | 1367 | default: |
1404 | dev_err(queue->ctrl->ctrl.device, | 1368 | dev_err(queue->ctrl->ctrl.device, |
1405 | "Unexpected RDMA CM event (%d)\n", ev->event); | 1369 | "Unexpected RDMA CM event (%d)\n", ev->event); |
@@ -1700,15 +1664,19 @@ static int __nvme_rdma_del_ctrl(struct nvme_rdma_ctrl *ctrl) | |||
1700 | static int nvme_rdma_del_ctrl(struct nvme_ctrl *nctrl) | 1664 | static int nvme_rdma_del_ctrl(struct nvme_ctrl *nctrl) |
1701 | { | 1665 | { |
1702 | struct nvme_rdma_ctrl *ctrl = to_rdma_ctrl(nctrl); | 1666 | struct nvme_rdma_ctrl *ctrl = to_rdma_ctrl(nctrl); |
1703 | int ret; | 1667 | int ret = 0; |
1704 | 1668 | ||
1669 | /* | ||
1670 | * Keep a reference until all work is flushed since | ||
1671 | * __nvme_rdma_del_ctrl can free the ctrl mem | ||
1672 | */ | ||
1673 | if (!kref_get_unless_zero(&ctrl->ctrl.kref)) | ||
1674 | return -EBUSY; | ||
1705 | ret = __nvme_rdma_del_ctrl(ctrl); | 1675 | ret = __nvme_rdma_del_ctrl(ctrl); |
1706 | if (ret) | 1676 | if (!ret) |
1707 | return ret; | 1677 | flush_work(&ctrl->delete_work); |
1708 | 1678 | nvme_put_ctrl(&ctrl->ctrl); | |
1709 | flush_work(&ctrl->delete_work); | 1679 | return ret; |
1710 | |||
1711 | return 0; | ||
1712 | } | 1680 | } |
1713 | 1681 | ||
1714 | static void nvme_rdma_remove_ctrl_work(struct work_struct *work) | 1682 | static void nvme_rdma_remove_ctrl_work(struct work_struct *work) |
@@ -2005,27 +1973,57 @@ static struct nvmf_transport_ops nvme_rdma_transport = { | |||
2005 | .create_ctrl = nvme_rdma_create_ctrl, | 1973 | .create_ctrl = nvme_rdma_create_ctrl, |
2006 | }; | 1974 | }; |
2007 | 1975 | ||
1976 | static void nvme_rdma_add_one(struct ib_device *ib_device) | ||
1977 | { | ||
1978 | } | ||
1979 | |||
1980 | static void nvme_rdma_remove_one(struct ib_device *ib_device, void *client_data) | ||
1981 | { | ||
1982 | struct nvme_rdma_ctrl *ctrl; | ||
1983 | |||
1984 | /* Delete all controllers using this device */ | ||
1985 | mutex_lock(&nvme_rdma_ctrl_mutex); | ||
1986 | list_for_each_entry(ctrl, &nvme_rdma_ctrl_list, list) { | ||
1987 | if (ctrl->device->dev != ib_device) | ||
1988 | continue; | ||
1989 | dev_info(ctrl->ctrl.device, | ||
1990 | "Removing ctrl: NQN \"%s\", addr %pISp\n", | ||
1991 | ctrl->ctrl.opts->subsysnqn, &ctrl->addr); | ||
1992 | __nvme_rdma_del_ctrl(ctrl); | ||
1993 | } | ||
1994 | mutex_unlock(&nvme_rdma_ctrl_mutex); | ||
1995 | |||
1996 | flush_workqueue(nvme_rdma_wq); | ||
1997 | } | ||
1998 | |||
1999 | static struct ib_client nvme_rdma_ib_client = { | ||
2000 | .name = "nvme_rdma", | ||
2001 | .add = nvme_rdma_add_one, | ||
2002 | .remove = nvme_rdma_remove_one | ||
2003 | }; | ||
2004 | |||
2008 | static int __init nvme_rdma_init_module(void) | 2005 | static int __init nvme_rdma_init_module(void) |
2009 | { | 2006 | { |
2007 | int ret; | ||
2008 | |||
2010 | nvme_rdma_wq = create_workqueue("nvme_rdma_wq"); | 2009 | nvme_rdma_wq = create_workqueue("nvme_rdma_wq"); |
2011 | if (!nvme_rdma_wq) | 2010 | if (!nvme_rdma_wq) |
2012 | return -ENOMEM; | 2011 | return -ENOMEM; |
2013 | 2012 | ||
2013 | ret = ib_register_client(&nvme_rdma_ib_client); | ||
2014 | if (ret) { | ||
2015 | destroy_workqueue(nvme_rdma_wq); | ||
2016 | return ret; | ||
2017 | } | ||
2018 | |||
2014 | nvmf_register_transport(&nvme_rdma_transport); | 2019 | nvmf_register_transport(&nvme_rdma_transport); |
2015 | return 0; | 2020 | return 0; |
2016 | } | 2021 | } |
2017 | 2022 | ||
2018 | static void __exit nvme_rdma_cleanup_module(void) | 2023 | static void __exit nvme_rdma_cleanup_module(void) |
2019 | { | 2024 | { |
2020 | struct nvme_rdma_ctrl *ctrl; | ||
2021 | |||
2022 | nvmf_unregister_transport(&nvme_rdma_transport); | 2025 | nvmf_unregister_transport(&nvme_rdma_transport); |
2023 | 2026 | ib_unregister_client(&nvme_rdma_ib_client); | |
2024 | mutex_lock(&nvme_rdma_ctrl_mutex); | ||
2025 | list_for_each_entry(ctrl, &nvme_rdma_ctrl_list, list) | ||
2026 | __nvme_rdma_del_ctrl(ctrl); | ||
2027 | mutex_unlock(&nvme_rdma_ctrl_mutex); | ||
2028 | |||
2029 | destroy_workqueue(nvme_rdma_wq); | 2027 | destroy_workqueue(nvme_rdma_wq); |
2030 | } | 2028 | } |
2031 | 2029 | ||
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 489ea1098c96..69b5e811ea2b 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -977,7 +977,7 @@ static int pcmcia_bus_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
977 | 977 | ||
978 | /************************ runtime PM support ***************************/ | 978 | /************************ runtime PM support ***************************/ |
979 | 979 | ||
980 | static int pcmcia_dev_suspend(struct device *dev, pm_message_t state); | 980 | static int pcmcia_dev_suspend(struct device *dev); |
981 | static int pcmcia_dev_resume(struct device *dev); | 981 | static int pcmcia_dev_resume(struct device *dev); |
982 | 982 | ||
983 | static int runtime_suspend(struct device *dev) | 983 | static int runtime_suspend(struct device *dev) |
@@ -985,7 +985,7 @@ static int runtime_suspend(struct device *dev) | |||
985 | int rc; | 985 | int rc; |
986 | 986 | ||
987 | device_lock(dev); | 987 | device_lock(dev); |
988 | rc = pcmcia_dev_suspend(dev, PMSG_SUSPEND); | 988 | rc = pcmcia_dev_suspend(dev); |
989 | device_unlock(dev); | 989 | device_unlock(dev); |
990 | return rc; | 990 | return rc; |
991 | } | 991 | } |
@@ -1135,7 +1135,7 @@ ATTRIBUTE_GROUPS(pcmcia_dev); | |||
1135 | 1135 | ||
1136 | /* PM support, also needed for reset */ | 1136 | /* PM support, also needed for reset */ |
1137 | 1137 | ||
1138 | static int pcmcia_dev_suspend(struct device *dev, pm_message_t state) | 1138 | static int pcmcia_dev_suspend(struct device *dev) |
1139 | { | 1139 | { |
1140 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); | 1140 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); |
1141 | struct pcmcia_driver *p_drv = NULL; | 1141 | struct pcmcia_driver *p_drv = NULL; |
@@ -1410,6 +1410,9 @@ static struct class_interface pcmcia_bus_interface __refdata = { | |||
1410 | .remove_dev = &pcmcia_bus_remove_socket, | 1410 | .remove_dev = &pcmcia_bus_remove_socket, |
1411 | }; | 1411 | }; |
1412 | 1412 | ||
1413 | static const struct dev_pm_ops pcmcia_bus_pm_ops = { | ||
1414 | SET_SYSTEM_SLEEP_PM_OPS(pcmcia_dev_suspend, pcmcia_dev_resume) | ||
1415 | }; | ||
1413 | 1416 | ||
1414 | struct bus_type pcmcia_bus_type = { | 1417 | struct bus_type pcmcia_bus_type = { |
1415 | .name = "pcmcia", | 1418 | .name = "pcmcia", |
@@ -1418,8 +1421,7 @@ struct bus_type pcmcia_bus_type = { | |||
1418 | .dev_groups = pcmcia_dev_groups, | 1421 | .dev_groups = pcmcia_dev_groups, |
1419 | .probe = pcmcia_device_probe, | 1422 | .probe = pcmcia_device_probe, |
1420 | .remove = pcmcia_device_remove, | 1423 | .remove = pcmcia_device_remove, |
1421 | .suspend = pcmcia_dev_suspend, | 1424 | .pm = &pcmcia_bus_pm_ops, |
1422 | .resume = pcmcia_dev_resume, | ||
1423 | }; | 1425 | }; |
1424 | 1426 | ||
1425 | 1427 | ||
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index 483f919e0d2e..91b5f5724cba 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
@@ -214,9 +214,8 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
214 | } | 214 | } |
215 | #endif | 215 | #endif |
216 | 216 | ||
217 | void pxa2xx_configure_sockets(struct device *dev) | 217 | void pxa2xx_configure_sockets(struct device *dev, struct pcmcia_low_level *ops) |
218 | { | 218 | { |
219 | struct pcmcia_low_level *ops = dev->platform_data; | ||
220 | /* | 219 | /* |
221 | * We have at least one socket, so set MECR:CIT | 220 | * We have at least one socket, so set MECR:CIT |
222 | * (Card Is There) | 221 | * (Card Is There) |
@@ -322,7 +321,7 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) | |||
322 | goto err1; | 321 | goto err1; |
323 | } | 322 | } |
324 | 323 | ||
325 | pxa2xx_configure_sockets(&dev->dev); | 324 | pxa2xx_configure_sockets(&dev->dev, ops); |
326 | dev_set_drvdata(&dev->dev, sinfo); | 325 | dev_set_drvdata(&dev->dev, sinfo); |
327 | 326 | ||
328 | return 0; | 327 | return 0; |
@@ -348,7 +347,9 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev) | |||
348 | 347 | ||
349 | static int pxa2xx_drv_pcmcia_resume(struct device *dev) | 348 | static int pxa2xx_drv_pcmcia_resume(struct device *dev) |
350 | { | 349 | { |
351 | pxa2xx_configure_sockets(dev); | 350 | struct pcmcia_low_level *ops = (struct pcmcia_low_level *)dev->platform_data; |
351 | |||
352 | pxa2xx_configure_sockets(dev, ops); | ||
352 | return 0; | 353 | return 0; |
353 | } | 354 | } |
354 | 355 | ||
diff --git a/drivers/pcmcia/pxa2xx_base.h b/drivers/pcmcia/pxa2xx_base.h index b609b45469ed..e58c7a415418 100644 --- a/drivers/pcmcia/pxa2xx_base.h +++ b/drivers/pcmcia/pxa2xx_base.h | |||
@@ -1,4 +1,4 @@ | |||
1 | int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt); | 1 | int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt); |
2 | void pxa2xx_drv_pcmcia_ops(struct pcmcia_low_level *ops); | 2 | void pxa2xx_drv_pcmcia_ops(struct pcmcia_low_level *ops); |
3 | void pxa2xx_configure_sockets(struct device *dev); | 3 | void pxa2xx_configure_sockets(struct device *dev, struct pcmcia_low_level *ops); |
4 | 4 | ||
diff --git a/drivers/pcmcia/sa1111_badge4.c b/drivers/pcmcia/sa1111_badge4.c index 12f0dd091477..2f490930430d 100644 --- a/drivers/pcmcia/sa1111_badge4.c +++ b/drivers/pcmcia/sa1111_badge4.c | |||
@@ -134,20 +134,14 @@ static struct pcmcia_low_level badge4_pcmcia_ops = { | |||
134 | 134 | ||
135 | int pcmcia_badge4_init(struct sa1111_dev *dev) | 135 | int pcmcia_badge4_init(struct sa1111_dev *dev) |
136 | { | 136 | { |
137 | int ret = -ENODEV; | 137 | printk(KERN_INFO |
138 | 138 | "%s: badge4_pcmvcc=%d, badge4_pcmvpp=%d, badge4_cfvcc=%d\n", | |
139 | if (machine_is_badge4()) { | 139 | __func__, |
140 | printk(KERN_INFO | 140 | badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc); |
141 | "%s: badge4_pcmvcc=%d, badge4_pcmvpp=%d, badge4_cfvcc=%d\n", | 141 | |
142 | __func__, | 142 | sa11xx_drv_pcmcia_ops(&badge4_pcmcia_ops); |
143 | badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc); | 143 | return sa1111_pcmcia_add(dev, &badge4_pcmcia_ops, |
144 | 144 | sa11xx_drv_pcmcia_add_one); | |
145 | sa11xx_drv_pcmcia_ops(&badge4_pcmcia_ops); | ||
146 | ret = sa1111_pcmcia_add(dev, &badge4_pcmcia_ops, | ||
147 | sa11xx_drv_pcmcia_add_one); | ||
148 | } | ||
149 | |||
150 | return ret; | ||
151 | } | 145 | } |
152 | 146 | ||
153 | static int __init pcmv_setup(char *s) | 147 | static int __init pcmv_setup(char *s) |
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c index a1531feb8460..3d95dffcff7a 100644 --- a/drivers/pcmcia/sa1111_generic.c +++ b/drivers/pcmcia/sa1111_generic.c | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
20 | #include <asm/hardware/sa1111.h> | 20 | #include <asm/hardware/sa1111.h> |
21 | #include <asm/mach-types.h> | ||
21 | #include <asm/irq.h> | 22 | #include <asm/irq.h> |
22 | 23 | ||
23 | #include "sa1111_generic.h" | 24 | #include "sa1111_generic.h" |
@@ -203,19 +204,30 @@ static int pcmcia_probe(struct sa1111_dev *dev) | |||
203 | sa1111_writel(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + PCSSR); | 204 | sa1111_writel(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + PCSSR); |
204 | sa1111_writel(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR); | 205 | sa1111_writel(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR); |
205 | 206 | ||
207 | ret = -ENODEV; | ||
206 | #ifdef CONFIG_SA1100_BADGE4 | 208 | #ifdef CONFIG_SA1100_BADGE4 |
207 | pcmcia_badge4_init(dev); | 209 | if (machine_is_badge4()) |
210 | ret = pcmcia_badge4_init(dev); | ||
208 | #endif | 211 | #endif |
209 | #ifdef CONFIG_SA1100_JORNADA720 | 212 | #ifdef CONFIG_SA1100_JORNADA720 |
210 | pcmcia_jornada720_init(dev); | 213 | if (machine_is_jornada720()) |
214 | ret = pcmcia_jornada720_init(dev); | ||
211 | #endif | 215 | #endif |
212 | #ifdef CONFIG_ARCH_LUBBOCK | 216 | #ifdef CONFIG_ARCH_LUBBOCK |
213 | pcmcia_lubbock_init(dev); | 217 | if (machine_is_lubbock()) |
218 | ret = pcmcia_lubbock_init(dev); | ||
214 | #endif | 219 | #endif |
215 | #ifdef CONFIG_ASSABET_NEPONSET | 220 | #ifdef CONFIG_ASSABET_NEPONSET |
216 | pcmcia_neponset_init(dev); | 221 | if (machine_is_assabet()) |
222 | ret = pcmcia_neponset_init(dev); | ||
217 | #endif | 223 | #endif |
218 | return 0; | 224 | |
225 | if (ret) { | ||
226 | release_mem_region(dev->res.start, 512); | ||
227 | sa1111_disable_device(dev); | ||
228 | } | ||
229 | |||
230 | return ret; | ||
219 | } | 231 | } |
220 | 232 | ||
221 | static int pcmcia_remove(struct sa1111_dev *dev) | 233 | static int pcmcia_remove(struct sa1111_dev *dev) |
diff --git a/drivers/pcmcia/sa1111_jornada720.c b/drivers/pcmcia/sa1111_jornada720.c index c2c30580c83f..480a3ede27c8 100644 --- a/drivers/pcmcia/sa1111_jornada720.c +++ b/drivers/pcmcia/sa1111_jornada720.c | |||
@@ -94,22 +94,17 @@ static struct pcmcia_low_level jornada720_pcmcia_ops = { | |||
94 | 94 | ||
95 | int pcmcia_jornada720_init(struct sa1111_dev *sadev) | 95 | int pcmcia_jornada720_init(struct sa1111_dev *sadev) |
96 | { | 96 | { |
97 | int ret = -ENODEV; | 97 | unsigned int pin = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3; |
98 | 98 | ||
99 | if (machine_is_jornada720()) { | 99 | /* Fixme: why messing around with SA11x0's GPIO1? */ |
100 | unsigned int pin = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3; | 100 | GRER |= 0x00000002; |
101 | 101 | ||
102 | GRER |= 0x00000002; | 102 | /* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */ |
103 | sa1111_set_io_dir(sadev, pin, 0, 0); | ||
104 | sa1111_set_io(sadev, pin, 0); | ||
105 | sa1111_set_sleep_io(sadev, pin, 0); | ||
103 | 106 | ||
104 | /* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */ | 107 | sa11xx_drv_pcmcia_ops(&jornada720_pcmcia_ops); |
105 | sa1111_set_io_dir(sadev, pin, 0, 0); | 108 | return sa1111_pcmcia_add(sadev, &jornada720_pcmcia_ops, |
106 | sa1111_set_io(sadev, pin, 0); | 109 | sa11xx_drv_pcmcia_add_one); |
107 | sa1111_set_sleep_io(sadev, pin, 0); | ||
108 | |||
109 | sa11xx_drv_pcmcia_ops(&jornada720_pcmcia_ops); | ||
110 | ret = sa1111_pcmcia_add(sadev, &jornada720_pcmcia_ops, | ||
111 | sa11xx_drv_pcmcia_add_one); | ||
112 | } | ||
113 | |||
114 | return ret; | ||
115 | } | 110 | } |
diff --git a/drivers/pcmcia/sa1111_lubbock.c b/drivers/pcmcia/sa1111_lubbock.c index c5caf5790451..e741f499c875 100644 --- a/drivers/pcmcia/sa1111_lubbock.c +++ b/drivers/pcmcia/sa1111_lubbock.c | |||
@@ -210,27 +210,21 @@ static struct pcmcia_low_level lubbock_pcmcia_ops = { | |||
210 | 210 | ||
211 | int pcmcia_lubbock_init(struct sa1111_dev *sadev) | 211 | int pcmcia_lubbock_init(struct sa1111_dev *sadev) |
212 | { | 212 | { |
213 | int ret = -ENODEV; | 213 | /* |
214 | 214 | * Set GPIO_A<3:0> to be outputs for the MAX1600, | |
215 | if (machine_is_lubbock()) { | 215 | * and switch to standby mode. |
216 | /* | 216 | */ |
217 | * Set GPIO_A<3:0> to be outputs for the MAX1600, | 217 | sa1111_set_io_dir(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0, 0); |
218 | * and switch to standby mode. | 218 | sa1111_set_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); |
219 | */ | 219 | sa1111_set_sleep_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); |
220 | sa1111_set_io_dir(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0, 0); | ||
221 | sa1111_set_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); | ||
222 | sa1111_set_sleep_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); | ||
223 | |||
224 | /* Set CF Socket 1 power to standby mode. */ | ||
225 | lubbock_set_misc_wr((1 << 15) | (1 << 14), 0); | ||
226 | 220 | ||
227 | pxa2xx_drv_pcmcia_ops(&lubbock_pcmcia_ops); | 221 | /* Set CF Socket 1 power to standby mode. */ |
228 | pxa2xx_configure_sockets(&sadev->dev); | 222 | lubbock_set_misc_wr((1 << 15) | (1 << 14), 0); |
229 | ret = sa1111_pcmcia_add(sadev, &lubbock_pcmcia_ops, | ||
230 | pxa2xx_drv_pcmcia_add_one); | ||
231 | } | ||
232 | 223 | ||
233 | return ret; | 224 | pxa2xx_drv_pcmcia_ops(&lubbock_pcmcia_ops); |
225 | pxa2xx_configure_sockets(&sadev->dev, &lubbock_pcmcia_ops); | ||
226 | return sa1111_pcmcia_add(sadev, &lubbock_pcmcia_ops, | ||
227 | pxa2xx_drv_pcmcia_add_one); | ||
234 | } | 228 | } |
235 | 229 | ||
236 | MODULE_LICENSE("GPL"); | 230 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/pcmcia/sa1111_neponset.c b/drivers/pcmcia/sa1111_neponset.c index 1d78739c4c07..019c395eb4bf 100644 --- a/drivers/pcmcia/sa1111_neponset.c +++ b/drivers/pcmcia/sa1111_neponset.c | |||
@@ -110,20 +110,14 @@ static struct pcmcia_low_level neponset_pcmcia_ops = { | |||
110 | 110 | ||
111 | int pcmcia_neponset_init(struct sa1111_dev *sadev) | 111 | int pcmcia_neponset_init(struct sa1111_dev *sadev) |
112 | { | 112 | { |
113 | int ret = -ENODEV; | 113 | /* |
114 | 114 | * Set GPIO_A<3:0> to be outputs for the MAX1600, | |
115 | if (machine_is_assabet()) { | 115 | * and switch to standby mode. |
116 | /* | 116 | */ |
117 | * Set GPIO_A<3:0> to be outputs for the MAX1600, | 117 | sa1111_set_io_dir(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0, 0); |
118 | * and switch to standby mode. | 118 | sa1111_set_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); |
119 | */ | 119 | sa1111_set_sleep_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); |
120 | sa1111_set_io_dir(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0, 0); | 120 | sa11xx_drv_pcmcia_ops(&neponset_pcmcia_ops); |
121 | sa1111_set_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); | 121 | return sa1111_pcmcia_add(sadev, &neponset_pcmcia_ops, |
122 | sa1111_set_sleep_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); | 122 | sa11xx_drv_pcmcia_add_one); |
123 | sa11xx_drv_pcmcia_ops(&neponset_pcmcia_ops); | ||
124 | ret = sa1111_pcmcia_add(sadev, &neponset_pcmcia_ops, | ||
125 | sa11xx_drv_pcmcia_add_one); | ||
126 | } | ||
127 | |||
128 | return ret; | ||
129 | } | 123 | } |
diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c index 9f6ec87b9f9e..48140ac73ed6 100644 --- a/drivers/pcmcia/sa11xx_base.c +++ b/drivers/pcmcia/sa11xx_base.c | |||
@@ -144,19 +144,19 @@ static int | |||
144 | sa1100_pcmcia_show_timing(struct soc_pcmcia_socket *skt, char *buf) | 144 | sa1100_pcmcia_show_timing(struct soc_pcmcia_socket *skt, char *buf) |
145 | { | 145 | { |
146 | struct soc_pcmcia_timing timing; | 146 | struct soc_pcmcia_timing timing; |
147 | unsigned int clock = clk_get_rate(skt->clk); | 147 | unsigned int clock = clk_get_rate(skt->clk) / 1000; |
148 | unsigned long mecr = MECR; | 148 | unsigned long mecr = MECR; |
149 | char *p = buf; | 149 | char *p = buf; |
150 | 150 | ||
151 | soc_common_pcmcia_get_timing(skt, &timing); | 151 | soc_common_pcmcia_get_timing(skt, &timing); |
152 | 152 | ||
153 | p+=sprintf(p, "I/O : %u (%u)\n", timing.io, | 153 | p+=sprintf(p, "I/O : %uns (%uns)\n", timing.io, |
154 | sa1100_pcmcia_cmd_time(clock, MECR_BSIO_GET(mecr, skt->nr))); | 154 | sa1100_pcmcia_cmd_time(clock, MECR_BSIO_GET(mecr, skt->nr))); |
155 | 155 | ||
156 | p+=sprintf(p, "attribute: %u (%u)\n", timing.attr, | 156 | p+=sprintf(p, "attribute: %uns (%uns)\n", timing.attr, |
157 | sa1100_pcmcia_cmd_time(clock, MECR_BSA_GET(mecr, skt->nr))); | 157 | sa1100_pcmcia_cmd_time(clock, MECR_BSA_GET(mecr, skt->nr))); |
158 | 158 | ||
159 | p+=sprintf(p, "common : %u (%u)\n", timing.mem, | 159 | p+=sprintf(p, "common : %uns (%uns)\n", timing.mem, |
160 | sa1100_pcmcia_cmd_time(clock, MECR_BSM_GET(mecr, skt->nr))); | 160 | sa1100_pcmcia_cmd_time(clock, MECR_BSM_GET(mecr, skt->nr))); |
161 | 161 | ||
162 | return p - buf; | 162 | return p - buf; |
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index eed5e9c05353..d5ca760c4eb2 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c | |||
@@ -235,7 +235,7 @@ static unsigned int soc_common_pcmcia_skt_state(struct soc_pcmcia_socket *skt) | |||
235 | stat |= skt->cs_state.Vcc ? SS_POWERON : 0; | 235 | stat |= skt->cs_state.Vcc ? SS_POWERON : 0; |
236 | 236 | ||
237 | if (skt->cs_state.flags & SS_IOCARD) | 237 | if (skt->cs_state.flags & SS_IOCARD) |
238 | stat |= state.bvd1 ? SS_STSCHG : 0; | 238 | stat |= state.bvd1 ? 0 : SS_STSCHG; |
239 | else { | 239 | else { |
240 | if (state.bvd1 == 0) | 240 | if (state.bvd1 == 0) |
241 | stat |= SS_BATDEAD; | 241 | stat |= SS_BATDEAD; |
diff --git a/drivers/rapidio/rio_cm.c b/drivers/rapidio/rio_cm.c index 3fa17ac8df54..cebc296463ad 100644 --- a/drivers/rapidio/rio_cm.c +++ b/drivers/rapidio/rio_cm.c | |||
@@ -2247,17 +2247,30 @@ static int rio_cm_shutdown(struct notifier_block *nb, unsigned long code, | |||
2247 | { | 2247 | { |
2248 | struct rio_channel *ch; | 2248 | struct rio_channel *ch; |
2249 | unsigned int i; | 2249 | unsigned int i; |
2250 | LIST_HEAD(list); | ||
2250 | 2251 | ||
2251 | riocm_debug(EXIT, "."); | 2252 | riocm_debug(EXIT, "."); |
2252 | 2253 | ||
2254 | /* | ||
2255 | * If there are any channels left in connected state send | ||
2256 | * close notification to the connection partner. | ||
2257 | * First build a list of channels that require a closing | ||
2258 | * notification because function riocm_send_close() should | ||
2259 | * be called outside of spinlock protected code. | ||
2260 | */ | ||
2253 | spin_lock_bh(&idr_lock); | 2261 | spin_lock_bh(&idr_lock); |
2254 | idr_for_each_entry(&ch_idr, ch, i) { | 2262 | idr_for_each_entry(&ch_idr, ch, i) { |
2255 | riocm_debug(EXIT, "close ch %d", ch->id); | 2263 | if (ch->state == RIO_CM_CONNECTED) { |
2256 | if (ch->state == RIO_CM_CONNECTED) | 2264 | riocm_debug(EXIT, "close ch %d", ch->id); |
2257 | riocm_send_close(ch); | 2265 | idr_remove(&ch_idr, ch->id); |
2266 | list_add(&ch->ch_node, &list); | ||
2267 | } | ||
2258 | } | 2268 | } |
2259 | spin_unlock_bh(&idr_lock); | 2269 | spin_unlock_bh(&idr_lock); |
2260 | 2270 | ||
2271 | list_for_each_entry(ch, &list, ch_node) | ||
2272 | riocm_send_close(ch); | ||
2273 | |||
2261 | return NOTIFY_DONE; | 2274 | return NOTIFY_DONE; |
2262 | } | 2275 | } |
2263 | 2276 | ||
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 15ce4ab11688..a2d90aca779f 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c | |||
@@ -240,8 +240,10 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, | |||
240 | memcpy(&endpoint->desc, d, n); | 240 | memcpy(&endpoint->desc, d, n); |
241 | INIT_LIST_HEAD(&endpoint->urb_list); | 241 | INIT_LIST_HEAD(&endpoint->urb_list); |
242 | 242 | ||
243 | /* Fix up bInterval values outside the legal range. Use 32 ms if no | 243 | /* |
244 | * proper value can be guessed. */ | 244 | * Fix up bInterval values outside the legal range. |
245 | * Use 10 or 8 ms if no proper value can be guessed. | ||
246 | */ | ||
245 | i = 0; /* i = min, j = max, n = default */ | 247 | i = 0; /* i = min, j = max, n = default */ |
246 | j = 255; | 248 | j = 255; |
247 | if (usb_endpoint_xfer_int(d)) { | 249 | if (usb_endpoint_xfer_int(d)) { |
@@ -250,13 +252,15 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, | |||
250 | case USB_SPEED_SUPER_PLUS: | 252 | case USB_SPEED_SUPER_PLUS: |
251 | case USB_SPEED_SUPER: | 253 | case USB_SPEED_SUPER: |
252 | case USB_SPEED_HIGH: | 254 | case USB_SPEED_HIGH: |
253 | /* Many device manufacturers are using full-speed | 255 | /* |
256 | * Many device manufacturers are using full-speed | ||
254 | * bInterval values in high-speed interrupt endpoint | 257 | * bInterval values in high-speed interrupt endpoint |
255 | * descriptors. Try to fix those and fall back to a | 258 | * descriptors. Try to fix those and fall back to an |
256 | * 32 ms default value otherwise. */ | 259 | * 8-ms default value otherwise. |
260 | */ | ||
257 | n = fls(d->bInterval*8); | 261 | n = fls(d->bInterval*8); |
258 | if (n == 0) | 262 | if (n == 0) |
259 | n = 9; /* 32 ms = 2^(9-1) uframes */ | 263 | n = 7; /* 8 ms = 2^(7-1) uframes */ |
260 | j = 16; | 264 | j = 16; |
261 | 265 | ||
262 | /* | 266 | /* |
@@ -271,10 +275,12 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, | |||
271 | } | 275 | } |
272 | break; | 276 | break; |
273 | default: /* USB_SPEED_FULL or _LOW */ | 277 | default: /* USB_SPEED_FULL or _LOW */ |
274 | /* For low-speed, 10 ms is the official minimum. | 278 | /* |
279 | * For low-speed, 10 ms is the official minimum. | ||
275 | * But some "overclocked" devices might want faster | 280 | * But some "overclocked" devices might want faster |
276 | * polling so we'll allow it. */ | 281 | * polling so we'll allow it. |
277 | n = 32; | 282 | */ |
283 | n = 10; | ||
278 | break; | 284 | break; |
279 | } | 285 | } |
280 | } else if (usb_endpoint_xfer_isoc(d)) { | 286 | } else if (usb_endpoint_xfer_isoc(d)) { |
@@ -282,10 +288,10 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, | |||
282 | j = 16; | 288 | j = 16; |
283 | switch (to_usb_device(ddev)->speed) { | 289 | switch (to_usb_device(ddev)->speed) { |
284 | case USB_SPEED_HIGH: | 290 | case USB_SPEED_HIGH: |
285 | n = 9; /* 32 ms = 2^(9-1) uframes */ | 291 | n = 7; /* 8 ms = 2^(7-1) uframes */ |
286 | break; | 292 | break; |
287 | default: /* USB_SPEED_FULL */ | 293 | default: /* USB_SPEED_FULL */ |
288 | n = 6; /* 32 ms = 2^(6-1) frames */ | 294 | n = 4; /* 8 ms = 2^(4-1) frames */ |
289 | break; | 295 | break; |
290 | } | 296 | } |
291 | } | 297 | } |
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index 886526b5fcdd..73cfa13fc0dc 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig | |||
@@ -87,7 +87,7 @@ config USB_MUSB_DA8XX | |||
87 | config USB_MUSB_TUSB6010 | 87 | config USB_MUSB_TUSB6010 |
88 | tristate "TUSB6010" | 88 | tristate "TUSB6010" |
89 | depends on HAS_IOMEM | 89 | depends on HAS_IOMEM |
90 | depends on ARCH_OMAP2PLUS || COMPILE_TEST | 90 | depends on (ARCH_OMAP2PLUS || COMPILE_TEST) && !BLACKFIN |
91 | depends on NOP_USB_XCEIV = USB_MUSB_HDRC # both built-in or both modules | 91 | depends on NOP_USB_XCEIV = USB_MUSB_HDRC # both built-in or both modules |
92 | 92 | ||
93 | config USB_MUSB_OMAP2PLUS | 93 | config USB_MUSB_OMAP2PLUS |
diff --git a/drivers/usb/serial/usb-serial-simple.c b/drivers/usb/serial/usb-serial-simple.c index a204782ae530..e98b6e57b703 100644 --- a/drivers/usb/serial/usb-serial-simple.c +++ b/drivers/usb/serial/usb-serial-simple.c | |||
@@ -54,7 +54,8 @@ DEVICE(funsoft, FUNSOFT_IDS); | |||
54 | /* Infineon Flashloader driver */ | 54 | /* Infineon Flashloader driver */ |
55 | #define FLASHLOADER_IDS() \ | 55 | #define FLASHLOADER_IDS() \ |
56 | { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, USB_CLASS_CDC_DATA) }, \ | 56 | { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, USB_CLASS_CDC_DATA) }, \ |
57 | { USB_DEVICE(0x8087, 0x0716) } | 57 | { USB_DEVICE(0x8087, 0x0716) }, \ |
58 | { USB_DEVICE(0x8087, 0x0801) } | ||
58 | DEVICE(flashloader, FLASHLOADER_IDS); | 59 | DEVICE(flashloader, FLASHLOADER_IDS); |
59 | 60 | ||
60 | /* Google Serial USB SubClass */ | 61 | /* Google Serial USB SubClass */ |
@@ -239,7 +239,12 @@ static struct dentry *aio_mount(struct file_system_type *fs_type, | |||
239 | static const struct dentry_operations ops = { | 239 | static const struct dentry_operations ops = { |
240 | .d_dname = simple_dname, | 240 | .d_dname = simple_dname, |
241 | }; | 241 | }; |
242 | return mount_pseudo(fs_type, "aio:", NULL, &ops, AIO_RING_MAGIC); | 242 | struct dentry *root = mount_pseudo(fs_type, "aio:", NULL, &ops, |
243 | AIO_RING_MAGIC); | ||
244 | |||
245 | if (!IS_ERR(root)) | ||
246 | root->d_sb->s_iflags |= SB_I_NOEXEC; | ||
247 | return root; | ||
243 | } | 248 | } |
244 | 249 | ||
245 | /* aio_setup | 250 | /* aio_setup |
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c index b493909e7492..d8e6d421c27f 100644 --- a/fs/autofs4/expire.c +++ b/fs/autofs4/expire.c | |||
@@ -417,6 +417,7 @@ static struct dentry *should_expire(struct dentry *dentry, | |||
417 | } | 417 | } |
418 | return NULL; | 418 | return NULL; |
419 | } | 419 | } |
420 | |||
420 | /* | 421 | /* |
421 | * Find an eligible tree to time-out | 422 | * Find an eligible tree to time-out |
422 | * A tree is eligible if :- | 423 | * A tree is eligible if :- |
@@ -432,6 +433,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb, | |||
432 | struct dentry *root = sb->s_root; | 433 | struct dentry *root = sb->s_root; |
433 | struct dentry *dentry; | 434 | struct dentry *dentry; |
434 | struct dentry *expired; | 435 | struct dentry *expired; |
436 | struct dentry *found; | ||
435 | struct autofs_info *ino; | 437 | struct autofs_info *ino; |
436 | 438 | ||
437 | if (!root) | 439 | if (!root) |
@@ -442,31 +444,46 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb, | |||
442 | 444 | ||
443 | dentry = NULL; | 445 | dentry = NULL; |
444 | while ((dentry = get_next_positive_subdir(dentry, root))) { | 446 | while ((dentry = get_next_positive_subdir(dentry, root))) { |
447 | int flags = how; | ||
448 | |||
445 | spin_lock(&sbi->fs_lock); | 449 | spin_lock(&sbi->fs_lock); |
446 | ino = autofs4_dentry_ino(dentry); | 450 | ino = autofs4_dentry_ino(dentry); |
447 | if (ino->flags & AUTOFS_INF_WANT_EXPIRE) | 451 | if (ino->flags & AUTOFS_INF_WANT_EXPIRE) { |
448 | expired = NULL; | ||
449 | else | ||
450 | expired = should_expire(dentry, mnt, timeout, how); | ||
451 | if (!expired) { | ||
452 | spin_unlock(&sbi->fs_lock); | 452 | spin_unlock(&sbi->fs_lock); |
453 | continue; | 453 | continue; |
454 | } | 454 | } |
455 | spin_unlock(&sbi->fs_lock); | ||
456 | |||
457 | expired = should_expire(dentry, mnt, timeout, flags); | ||
458 | if (!expired) | ||
459 | continue; | ||
460 | |||
461 | spin_lock(&sbi->fs_lock); | ||
455 | ino = autofs4_dentry_ino(expired); | 462 | ino = autofs4_dentry_ino(expired); |
456 | ino->flags |= AUTOFS_INF_WANT_EXPIRE; | 463 | ino->flags |= AUTOFS_INF_WANT_EXPIRE; |
457 | spin_unlock(&sbi->fs_lock); | 464 | spin_unlock(&sbi->fs_lock); |
458 | synchronize_rcu(); | 465 | synchronize_rcu(); |
459 | spin_lock(&sbi->fs_lock); | ||
460 | if (should_expire(expired, mnt, timeout, how)) { | ||
461 | if (expired != dentry) | ||
462 | dput(dentry); | ||
463 | goto found; | ||
464 | } | ||
465 | 466 | ||
467 | /* Make sure a reference is not taken on found if | ||
468 | * things have changed. | ||
469 | */ | ||
470 | flags &= ~AUTOFS_EXP_LEAVES; | ||
471 | found = should_expire(expired, mnt, timeout, how); | ||
472 | if (!found || found != expired) | ||
473 | /* Something has changed, continue */ | ||
474 | goto next; | ||
475 | |||
476 | if (expired != dentry) | ||
477 | dput(dentry); | ||
478 | |||
479 | spin_lock(&sbi->fs_lock); | ||
480 | goto found; | ||
481 | next: | ||
482 | spin_lock(&sbi->fs_lock); | ||
466 | ino->flags &= ~AUTOFS_INF_WANT_EXPIRE; | 483 | ino->flags &= ~AUTOFS_INF_WANT_EXPIRE; |
484 | spin_unlock(&sbi->fs_lock); | ||
467 | if (expired != dentry) | 485 | if (expired != dentry) |
468 | dput(expired); | 486 | dput(expired); |
469 | spin_unlock(&sbi->fs_lock); | ||
470 | } | 487 | } |
471 | return NULL; | 488 | return NULL; |
472 | 489 | ||
@@ -483,6 +500,7 @@ int autofs4_expire_wait(struct dentry *dentry, int rcu_walk) | |||
483 | struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); | 500 | struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); |
484 | struct autofs_info *ino = autofs4_dentry_ino(dentry); | 501 | struct autofs_info *ino = autofs4_dentry_ino(dentry); |
485 | int status; | 502 | int status; |
503 | int state; | ||
486 | 504 | ||
487 | /* Block on any pending expire */ | 505 | /* Block on any pending expire */ |
488 | if (!(ino->flags & AUTOFS_INF_WANT_EXPIRE)) | 506 | if (!(ino->flags & AUTOFS_INF_WANT_EXPIRE)) |
@@ -490,8 +508,19 @@ int autofs4_expire_wait(struct dentry *dentry, int rcu_walk) | |||
490 | if (rcu_walk) | 508 | if (rcu_walk) |
491 | return -ECHILD; | 509 | return -ECHILD; |
492 | 510 | ||
511 | retry: | ||
493 | spin_lock(&sbi->fs_lock); | 512 | spin_lock(&sbi->fs_lock); |
494 | if (ino->flags & AUTOFS_INF_EXPIRING) { | 513 | state = ino->flags & (AUTOFS_INF_WANT_EXPIRE | AUTOFS_INF_EXPIRING); |
514 | if (state == AUTOFS_INF_WANT_EXPIRE) { | ||
515 | spin_unlock(&sbi->fs_lock); | ||
516 | /* | ||
517 | * Possibly being selected for expire, wait until | ||
518 | * it's selected or not. | ||
519 | */ | ||
520 | schedule_timeout_uninterruptible(HZ/10); | ||
521 | goto retry; | ||
522 | } | ||
523 | if (state & AUTOFS_INF_EXPIRING) { | ||
495 | spin_unlock(&sbi->fs_lock); | 524 | spin_unlock(&sbi->fs_lock); |
496 | 525 | ||
497 | pr_debug("waiting for expire %p name=%pd\n", dentry, dentry); | 526 | pr_debug("waiting for expire %p name=%pd\n", dentry, dentry); |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 6bbec5e784cd..14ae4b8e1a3c 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -609,6 +609,9 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) | |||
609 | char *s, *p; | 609 | char *s, *p; |
610 | char sep; | 610 | char sep; |
611 | 611 | ||
612 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH) | ||
613 | return dget(sb->s_root); | ||
614 | |||
612 | full_path = cifs_build_path_to_root(vol, cifs_sb, | 615 | full_path = cifs_build_path_to_root(vol, cifs_sb, |
613 | cifs_sb_master_tcon(cifs_sb)); | 616 | cifs_sb_master_tcon(cifs_sb)); |
614 | if (full_path == NULL) | 617 | if (full_path == NULL) |
@@ -686,26 +689,22 @@ cifs_do_mount(struct file_system_type *fs_type, | |||
686 | cifs_sb->mountdata = kstrndup(data, PAGE_SIZE, GFP_KERNEL); | 689 | cifs_sb->mountdata = kstrndup(data, PAGE_SIZE, GFP_KERNEL); |
687 | if (cifs_sb->mountdata == NULL) { | 690 | if (cifs_sb->mountdata == NULL) { |
688 | root = ERR_PTR(-ENOMEM); | 691 | root = ERR_PTR(-ENOMEM); |
689 | goto out_cifs_sb; | 692 | goto out_free; |
690 | } | 693 | } |
691 | 694 | ||
692 | if (volume_info->prepath) { | 695 | rc = cifs_setup_cifs_sb(volume_info, cifs_sb); |
693 | cifs_sb->prepath = kstrdup(volume_info->prepath, GFP_KERNEL); | 696 | if (rc) { |
694 | if (cifs_sb->prepath == NULL) { | 697 | root = ERR_PTR(rc); |
695 | root = ERR_PTR(-ENOMEM); | 698 | goto out_free; |
696 | goto out_cifs_sb; | ||
697 | } | ||
698 | } | 699 | } |
699 | 700 | ||
700 | cifs_setup_cifs_sb(volume_info, cifs_sb); | ||
701 | |||
702 | rc = cifs_mount(cifs_sb, volume_info); | 701 | rc = cifs_mount(cifs_sb, volume_info); |
703 | if (rc) { | 702 | if (rc) { |
704 | if (!(flags & MS_SILENT)) | 703 | if (!(flags & MS_SILENT)) |
705 | cifs_dbg(VFS, "cifs_mount failed w/return code = %d\n", | 704 | cifs_dbg(VFS, "cifs_mount failed w/return code = %d\n", |
706 | rc); | 705 | rc); |
707 | root = ERR_PTR(rc); | 706 | root = ERR_PTR(rc); |
708 | goto out_mountdata; | 707 | goto out_free; |
709 | } | 708 | } |
710 | 709 | ||
711 | mnt_data.vol = volume_info; | 710 | mnt_data.vol = volume_info; |
@@ -735,11 +734,7 @@ cifs_do_mount(struct file_system_type *fs_type, | |||
735 | sb->s_flags |= MS_ACTIVE; | 734 | sb->s_flags |= MS_ACTIVE; |
736 | } | 735 | } |
737 | 736 | ||
738 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH) | 737 | root = cifs_get_root(volume_info, sb); |
739 | root = dget(sb->s_root); | ||
740 | else | ||
741 | root = cifs_get_root(volume_info, sb); | ||
742 | |||
743 | if (IS_ERR(root)) | 738 | if (IS_ERR(root)) |
744 | goto out_super; | 739 | goto out_super; |
745 | 740 | ||
@@ -752,9 +747,9 @@ out: | |||
752 | cifs_cleanup_volume_info(volume_info); | 747 | cifs_cleanup_volume_info(volume_info); |
753 | return root; | 748 | return root; |
754 | 749 | ||
755 | out_mountdata: | 750 | out_free: |
751 | kfree(cifs_sb->prepath); | ||
756 | kfree(cifs_sb->mountdata); | 752 | kfree(cifs_sb->mountdata); |
757 | out_cifs_sb: | ||
758 | kfree(cifs_sb); | 753 | kfree(cifs_sb); |
759 | out_nls: | 754 | out_nls: |
760 | unload_nls(volume_info->local_nls); | 755 | unload_nls(volume_info->local_nls); |
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 1243bd326591..95dab43646f0 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
@@ -184,7 +184,7 @@ extern int cifs_read_from_socket(struct TCP_Server_Info *server, char *buf, | |||
184 | unsigned int to_read); | 184 | unsigned int to_read); |
185 | extern int cifs_read_page_from_socket(struct TCP_Server_Info *server, | 185 | extern int cifs_read_page_from_socket(struct TCP_Server_Info *server, |
186 | struct page *page, unsigned int to_read); | 186 | struct page *page, unsigned int to_read); |
187 | extern void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, | 187 | extern int cifs_setup_cifs_sb(struct smb_vol *pvolume_info, |
188 | struct cifs_sb_info *cifs_sb); | 188 | struct cifs_sb_info *cifs_sb); |
189 | extern int cifs_match_super(struct super_block *, void *); | 189 | extern int cifs_match_super(struct super_block *, void *); |
190 | extern void cifs_cleanup_volume_info(struct smb_vol *pvolume_info); | 190 | extern void cifs_cleanup_volume_info(struct smb_vol *pvolume_info); |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 7ae03283bd61..2e4f4bad8b1e 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -2781,6 +2781,24 @@ compare_mount_options(struct super_block *sb, struct cifs_mnt_data *mnt_data) | |||
2781 | return 1; | 2781 | return 1; |
2782 | } | 2782 | } |
2783 | 2783 | ||
2784 | static int | ||
2785 | match_prepath(struct super_block *sb, struct cifs_mnt_data *mnt_data) | ||
2786 | { | ||
2787 | struct cifs_sb_info *old = CIFS_SB(sb); | ||
2788 | struct cifs_sb_info *new = mnt_data->cifs_sb; | ||
2789 | |||
2790 | if (old->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH) { | ||
2791 | if (!(new->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH)) | ||
2792 | return 0; | ||
2793 | /* The prepath should be null terminated strings */ | ||
2794 | if (strcmp(new->prepath, old->prepath)) | ||
2795 | return 0; | ||
2796 | |||
2797 | return 1; | ||
2798 | } | ||
2799 | return 0; | ||
2800 | } | ||
2801 | |||
2784 | int | 2802 | int |
2785 | cifs_match_super(struct super_block *sb, void *data) | 2803 | cifs_match_super(struct super_block *sb, void *data) |
2786 | { | 2804 | { |
@@ -2808,7 +2826,8 @@ cifs_match_super(struct super_block *sb, void *data) | |||
2808 | 2826 | ||
2809 | if (!match_server(tcp_srv, volume_info) || | 2827 | if (!match_server(tcp_srv, volume_info) || |
2810 | !match_session(ses, volume_info) || | 2828 | !match_session(ses, volume_info) || |
2811 | !match_tcon(tcon, volume_info->UNC)) { | 2829 | !match_tcon(tcon, volume_info->UNC) || |
2830 | !match_prepath(sb, mnt_data)) { | ||
2812 | rc = 0; | 2831 | rc = 0; |
2813 | goto out; | 2832 | goto out; |
2814 | } | 2833 | } |
@@ -3222,7 +3241,7 @@ void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon, | |||
3222 | } | 3241 | } |
3223 | } | 3242 | } |
3224 | 3243 | ||
3225 | void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, | 3244 | int cifs_setup_cifs_sb(struct smb_vol *pvolume_info, |
3226 | struct cifs_sb_info *cifs_sb) | 3245 | struct cifs_sb_info *cifs_sb) |
3227 | { | 3246 | { |
3228 | INIT_DELAYED_WORK(&cifs_sb->prune_tlinks, cifs_prune_tlinks); | 3247 | INIT_DELAYED_WORK(&cifs_sb->prune_tlinks, cifs_prune_tlinks); |
@@ -3316,6 +3335,14 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, | |||
3316 | 3335 | ||
3317 | if ((pvolume_info->cifs_acl) && (pvolume_info->dynperm)) | 3336 | if ((pvolume_info->cifs_acl) && (pvolume_info->dynperm)) |
3318 | cifs_dbg(VFS, "mount option dynperm ignored if cifsacl mount option supported\n"); | 3337 | cifs_dbg(VFS, "mount option dynperm ignored if cifsacl mount option supported\n"); |
3338 | |||
3339 | if (pvolume_info->prepath) { | ||
3340 | cifs_sb->prepath = kstrdup(pvolume_info->prepath, GFP_KERNEL); | ||
3341 | if (cifs_sb->prepath == NULL) | ||
3342 | return -ENOMEM; | ||
3343 | } | ||
3344 | |||
3345 | return 0; | ||
3319 | } | 3346 | } |
3320 | 3347 | ||
3321 | static void | 3348 | static void |
diff --git a/fs/ioctl.c b/fs/ioctl.c index 0f56deb24ce6..c415668c86d4 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c | |||
@@ -568,7 +568,7 @@ static int ioctl_fsthaw(struct file *filp) | |||
568 | return thaw_super(sb); | 568 | return thaw_super(sb); |
569 | } | 569 | } |
570 | 570 | ||
571 | static long ioctl_file_dedupe_range(struct file *file, void __user *arg) | 571 | static int ioctl_file_dedupe_range(struct file *file, void __user *arg) |
572 | { | 572 | { |
573 | struct file_dedupe_range __user *argp = arg; | 573 | struct file_dedupe_range __user *argp = arg; |
574 | struct file_dedupe_range *same = NULL; | 574 | struct file_dedupe_range *same = NULL; |
@@ -582,6 +582,10 @@ static long ioctl_file_dedupe_range(struct file *file, void __user *arg) | |||
582 | } | 582 | } |
583 | 583 | ||
584 | size = offsetof(struct file_dedupe_range __user, info[count]); | 584 | size = offsetof(struct file_dedupe_range __user, info[count]); |
585 | if (size > PAGE_SIZE) { | ||
586 | ret = -ENOMEM; | ||
587 | goto out; | ||
588 | } | ||
585 | 589 | ||
586 | same = memdup_user(argp, size); | 590 | same = memdup_user(argp, size); |
587 | if (IS_ERR(same)) { | 591 | if (IS_ERR(same)) { |
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index d2f97ecca6a5..e0e5f7c3c99f 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c | |||
@@ -67,18 +67,7 @@ static int fanotify_get_response(struct fsnotify_group *group, | |||
67 | 67 | ||
68 | pr_debug("%s: group=%p event=%p\n", __func__, group, event); | 68 | pr_debug("%s: group=%p event=%p\n", __func__, group, event); |
69 | 69 | ||
70 | wait_event(group->fanotify_data.access_waitq, event->response || | 70 | wait_event(group->fanotify_data.access_waitq, event->response); |
71 | atomic_read(&group->fanotify_data.bypass_perm)); | ||
72 | |||
73 | if (!event->response) { /* bypass_perm set */ | ||
74 | /* | ||
75 | * Event was canceled because group is being destroyed. Remove | ||
76 | * it from group's event list because we are responsible for | ||
77 | * freeing the permission event. | ||
78 | */ | ||
79 | fsnotify_remove_event(group, &event->fae.fse); | ||
80 | return 0; | ||
81 | } | ||
82 | 71 | ||
83 | /* userspace responded, convert to something usable */ | 72 | /* userspace responded, convert to something usable */ |
84 | switch (event->response) { | 73 | switch (event->response) { |
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 8e8e6bcd1d43..a64313868d3a 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -358,16 +358,20 @@ static int fanotify_release(struct inode *ignored, struct file *file) | |||
358 | 358 | ||
359 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS | 359 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS |
360 | struct fanotify_perm_event_info *event, *next; | 360 | struct fanotify_perm_event_info *event, *next; |
361 | struct fsnotify_event *fsn_event; | ||
361 | 362 | ||
362 | /* | 363 | /* |
363 | * There may be still new events arriving in the notification queue | 364 | * Stop new events from arriving in the notification queue. since |
364 | * but since userspace cannot use fanotify fd anymore, no event can | 365 | * userspace cannot use fanotify fd anymore, no event can enter or |
365 | * enter or leave access_list by now. | 366 | * leave access_list by now either. |
366 | */ | 367 | */ |
367 | spin_lock(&group->fanotify_data.access_lock); | 368 | fsnotify_group_stop_queueing(group); |
368 | |||
369 | atomic_inc(&group->fanotify_data.bypass_perm); | ||
370 | 369 | ||
370 | /* | ||
371 | * Process all permission events on access_list and notification queue | ||
372 | * and simulate reply from userspace. | ||
373 | */ | ||
374 | spin_lock(&group->fanotify_data.access_lock); | ||
371 | list_for_each_entry_safe(event, next, &group->fanotify_data.access_list, | 375 | list_for_each_entry_safe(event, next, &group->fanotify_data.access_list, |
372 | fae.fse.list) { | 376 | fae.fse.list) { |
373 | pr_debug("%s: found group=%p event=%p\n", __func__, group, | 377 | pr_debug("%s: found group=%p event=%p\n", __func__, group, |
@@ -379,12 +383,21 @@ static int fanotify_release(struct inode *ignored, struct file *file) | |||
379 | spin_unlock(&group->fanotify_data.access_lock); | 383 | spin_unlock(&group->fanotify_data.access_lock); |
380 | 384 | ||
381 | /* | 385 | /* |
382 | * Since bypass_perm is set, newly queued events will not wait for | 386 | * Destroy all non-permission events. For permission events just |
383 | * access response. Wake up the already sleeping ones now. | 387 | * dequeue them and set the response. They will be freed once the |
384 | * synchronize_srcu() in fsnotify_destroy_group() will wait for all | 388 | * response is consumed and fanotify_get_response() returns. |
385 | * processes sleeping in fanotify_handle_event() waiting for access | ||
386 | * response and thus also for all permission events to be freed. | ||
387 | */ | 389 | */ |
390 | mutex_lock(&group->notification_mutex); | ||
391 | while (!fsnotify_notify_queue_is_empty(group)) { | ||
392 | fsn_event = fsnotify_remove_first_event(group); | ||
393 | if (!(fsn_event->mask & FAN_ALL_PERM_EVENTS)) | ||
394 | fsnotify_destroy_event(group, fsn_event); | ||
395 | else | ||
396 | FANOTIFY_PE(fsn_event)->response = FAN_ALLOW; | ||
397 | } | ||
398 | mutex_unlock(&group->notification_mutex); | ||
399 | |||
400 | /* Response for all permission events it set, wakeup waiters */ | ||
388 | wake_up(&group->fanotify_data.access_waitq); | 401 | wake_up(&group->fanotify_data.access_waitq); |
389 | #endif | 402 | #endif |
390 | 403 | ||
@@ -755,7 +768,6 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags) | |||
755 | spin_lock_init(&group->fanotify_data.access_lock); | 768 | spin_lock_init(&group->fanotify_data.access_lock); |
756 | init_waitqueue_head(&group->fanotify_data.access_waitq); | 769 | init_waitqueue_head(&group->fanotify_data.access_waitq); |
757 | INIT_LIST_HEAD(&group->fanotify_data.access_list); | 770 | INIT_LIST_HEAD(&group->fanotify_data.access_list); |
758 | atomic_set(&group->fanotify_data.bypass_perm, 0); | ||
759 | #endif | 771 | #endif |
760 | switch (flags & FAN_ALL_CLASS_BITS) { | 772 | switch (flags & FAN_ALL_CLASS_BITS) { |
761 | case FAN_CLASS_NOTIF: | 773 | case FAN_CLASS_NOTIF: |
diff --git a/fs/notify/group.c b/fs/notify/group.c index 3e2dd85be5dd..b47f7cfdcaa4 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c | |||
@@ -40,6 +40,17 @@ static void fsnotify_final_destroy_group(struct fsnotify_group *group) | |||
40 | } | 40 | } |
41 | 41 | ||
42 | /* | 42 | /* |
43 | * Stop queueing new events for this group. Once this function returns | ||
44 | * fsnotify_add_event() will not add any new events to the group's queue. | ||
45 | */ | ||
46 | void fsnotify_group_stop_queueing(struct fsnotify_group *group) | ||
47 | { | ||
48 | mutex_lock(&group->notification_mutex); | ||
49 | group->shutdown = true; | ||
50 | mutex_unlock(&group->notification_mutex); | ||
51 | } | ||
52 | |||
53 | /* | ||
43 | * Trying to get rid of a group. Remove all marks, flush all events and release | 54 | * Trying to get rid of a group. Remove all marks, flush all events and release |
44 | * the group reference. | 55 | * the group reference. |
45 | * Note that another thread calling fsnotify_clear_marks_by_group() may still | 56 | * Note that another thread calling fsnotify_clear_marks_by_group() may still |
@@ -47,6 +58,14 @@ static void fsnotify_final_destroy_group(struct fsnotify_group *group) | |||
47 | */ | 58 | */ |
48 | void fsnotify_destroy_group(struct fsnotify_group *group) | 59 | void fsnotify_destroy_group(struct fsnotify_group *group) |
49 | { | 60 | { |
61 | /* | ||
62 | * Stop queueing new events. The code below is careful enough to not | ||
63 | * require this but fanotify needs to stop queuing events even before | ||
64 | * fsnotify_destroy_group() is called and this makes the other callers | ||
65 | * of fsnotify_destroy_group() to see the same behavior. | ||
66 | */ | ||
67 | fsnotify_group_stop_queueing(group); | ||
68 | |||
50 | /* clear all inode marks for this group, attach them to destroy_list */ | 69 | /* clear all inode marks for this group, attach them to destroy_list */ |
51 | fsnotify_detach_group_marks(group); | 70 | fsnotify_detach_group_marks(group); |
52 | 71 | ||
diff --git a/fs/notify/notification.c b/fs/notify/notification.c index a95d8e037aeb..e455e83ceeeb 100644 --- a/fs/notify/notification.c +++ b/fs/notify/notification.c | |||
@@ -82,7 +82,8 @@ void fsnotify_destroy_event(struct fsnotify_group *group, | |||
82 | * Add an event to the group notification queue. The group can later pull this | 82 | * Add an event to the group notification queue. The group can later pull this |
83 | * event off the queue to deal with. The function returns 0 if the event was | 83 | * event off the queue to deal with. The function returns 0 if the event was |
84 | * added to the queue, 1 if the event was merged with some other queued event, | 84 | * added to the queue, 1 if the event was merged with some other queued event, |
85 | * 2 if the queue of events has overflown. | 85 | * 2 if the event was not queued - either the queue of events has overflown |
86 | * or the group is shutting down. | ||
86 | */ | 87 | */ |
87 | int fsnotify_add_event(struct fsnotify_group *group, | 88 | int fsnotify_add_event(struct fsnotify_group *group, |
88 | struct fsnotify_event *event, | 89 | struct fsnotify_event *event, |
@@ -96,6 +97,11 @@ int fsnotify_add_event(struct fsnotify_group *group, | |||
96 | 97 | ||
97 | mutex_lock(&group->notification_mutex); | 98 | mutex_lock(&group->notification_mutex); |
98 | 99 | ||
100 | if (group->shutdown) { | ||
101 | mutex_unlock(&group->notification_mutex); | ||
102 | return 2; | ||
103 | } | ||
104 | |||
99 | if (group->q_len >= group->max_events) { | 105 | if (group->q_len >= group->max_events) { |
100 | ret = 2; | 106 | ret = 2; |
101 | /* Queue overflow event only if it isn't already queued */ | 107 | /* Queue overflow event only if it isn't already queued */ |
@@ -126,21 +132,6 @@ queue: | |||
126 | } | 132 | } |
127 | 133 | ||
128 | /* | 134 | /* |
129 | * Remove @event from group's notification queue. It is the responsibility of | ||
130 | * the caller to destroy the event. | ||
131 | */ | ||
132 | void fsnotify_remove_event(struct fsnotify_group *group, | ||
133 | struct fsnotify_event *event) | ||
134 | { | ||
135 | mutex_lock(&group->notification_mutex); | ||
136 | if (!list_empty(&event->list)) { | ||
137 | list_del_init(&event->list); | ||
138 | group->q_len--; | ||
139 | } | ||
140 | mutex_unlock(&group->notification_mutex); | ||
141 | } | ||
142 | |||
143 | /* | ||
144 | * Remove and return the first event from the notification list. It is the | 135 | * Remove and return the first event from the notification list. It is the |
145 | * responsibility of the caller to destroy the obtained event | 136 | * responsibility of the caller to destroy the obtained event |
146 | */ | 137 | */ |
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 7dabbc31060e..f165f867f332 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -5922,7 +5922,6 @@ bail: | |||
5922 | } | 5922 | } |
5923 | 5923 | ||
5924 | static int ocfs2_replay_truncate_records(struct ocfs2_super *osb, | 5924 | static int ocfs2_replay_truncate_records(struct ocfs2_super *osb, |
5925 | handle_t *handle, | ||
5926 | struct inode *data_alloc_inode, | 5925 | struct inode *data_alloc_inode, |
5927 | struct buffer_head *data_alloc_bh) | 5926 | struct buffer_head *data_alloc_bh) |
5928 | { | 5927 | { |
@@ -5935,11 +5934,19 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb, | |||
5935 | struct ocfs2_truncate_log *tl; | 5934 | struct ocfs2_truncate_log *tl; |
5936 | struct inode *tl_inode = osb->osb_tl_inode; | 5935 | struct inode *tl_inode = osb->osb_tl_inode; |
5937 | struct buffer_head *tl_bh = osb->osb_tl_bh; | 5936 | struct buffer_head *tl_bh = osb->osb_tl_bh; |
5937 | handle_t *handle; | ||
5938 | 5938 | ||
5939 | di = (struct ocfs2_dinode *) tl_bh->b_data; | 5939 | di = (struct ocfs2_dinode *) tl_bh->b_data; |
5940 | tl = &di->id2.i_dealloc; | 5940 | tl = &di->id2.i_dealloc; |
5941 | i = le16_to_cpu(tl->tl_used) - 1; | 5941 | i = le16_to_cpu(tl->tl_used) - 1; |
5942 | while (i >= 0) { | 5942 | while (i >= 0) { |
5943 | handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC); | ||
5944 | if (IS_ERR(handle)) { | ||
5945 | status = PTR_ERR(handle); | ||
5946 | mlog_errno(status); | ||
5947 | goto bail; | ||
5948 | } | ||
5949 | |||
5943 | /* Caller has given us at least enough credits to | 5950 | /* Caller has given us at least enough credits to |
5944 | * update the truncate log dinode */ | 5951 | * update the truncate log dinode */ |
5945 | status = ocfs2_journal_access_di(handle, INODE_CACHE(tl_inode), tl_bh, | 5952 | status = ocfs2_journal_access_di(handle, INODE_CACHE(tl_inode), tl_bh, |
@@ -5974,12 +5981,7 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb, | |||
5974 | } | 5981 | } |
5975 | } | 5982 | } |
5976 | 5983 | ||
5977 | status = ocfs2_extend_trans(handle, | 5984 | ocfs2_commit_trans(osb, handle); |
5978 | OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC); | ||
5979 | if (status < 0) { | ||
5980 | mlog_errno(status); | ||
5981 | goto bail; | ||
5982 | } | ||
5983 | i--; | 5985 | i--; |
5984 | } | 5986 | } |
5985 | 5987 | ||
@@ -5994,7 +5996,6 @@ int __ocfs2_flush_truncate_log(struct ocfs2_super *osb) | |||
5994 | { | 5996 | { |
5995 | int status; | 5997 | int status; |
5996 | unsigned int num_to_flush; | 5998 | unsigned int num_to_flush; |
5997 | handle_t *handle; | ||
5998 | struct inode *tl_inode = osb->osb_tl_inode; | 5999 | struct inode *tl_inode = osb->osb_tl_inode; |
5999 | struct inode *data_alloc_inode = NULL; | 6000 | struct inode *data_alloc_inode = NULL; |
6000 | struct buffer_head *tl_bh = osb->osb_tl_bh; | 6001 | struct buffer_head *tl_bh = osb->osb_tl_bh; |
@@ -6038,21 +6039,11 @@ int __ocfs2_flush_truncate_log(struct ocfs2_super *osb) | |||
6038 | goto out_mutex; | 6039 | goto out_mutex; |
6039 | } | 6040 | } |
6040 | 6041 | ||
6041 | handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC); | 6042 | status = ocfs2_replay_truncate_records(osb, data_alloc_inode, |
6042 | if (IS_ERR(handle)) { | ||
6043 | status = PTR_ERR(handle); | ||
6044 | mlog_errno(status); | ||
6045 | goto out_unlock; | ||
6046 | } | ||
6047 | |||
6048 | status = ocfs2_replay_truncate_records(osb, handle, data_alloc_inode, | ||
6049 | data_alloc_bh); | 6043 | data_alloc_bh); |
6050 | if (status < 0) | 6044 | if (status < 0) |
6051 | mlog_errno(status); | 6045 | mlog_errno(status); |
6052 | 6046 | ||
6053 | ocfs2_commit_trans(osb, handle); | ||
6054 | |||
6055 | out_unlock: | ||
6056 | brelse(data_alloc_bh); | 6047 | brelse(data_alloc_bh); |
6057 | ocfs2_inode_unlock(data_alloc_inode, 1); | 6048 | ocfs2_inode_unlock(data_alloc_inode, 1); |
6058 | 6049 | ||
@@ -6413,43 +6404,34 @@ static int ocfs2_free_cached_blocks(struct ocfs2_super *osb, | |||
6413 | goto out_mutex; | 6404 | goto out_mutex; |
6414 | } | 6405 | } |
6415 | 6406 | ||
6416 | handle = ocfs2_start_trans(osb, OCFS2_SUBALLOC_FREE); | ||
6417 | if (IS_ERR(handle)) { | ||
6418 | ret = PTR_ERR(handle); | ||
6419 | mlog_errno(ret); | ||
6420 | goto out_unlock; | ||
6421 | } | ||
6422 | |||
6423 | while (head) { | 6407 | while (head) { |
6424 | if (head->free_bg) | 6408 | if (head->free_bg) |
6425 | bg_blkno = head->free_bg; | 6409 | bg_blkno = head->free_bg; |
6426 | else | 6410 | else |
6427 | bg_blkno = ocfs2_which_suballoc_group(head->free_blk, | 6411 | bg_blkno = ocfs2_which_suballoc_group(head->free_blk, |
6428 | head->free_bit); | 6412 | head->free_bit); |
6413 | handle = ocfs2_start_trans(osb, OCFS2_SUBALLOC_FREE); | ||
6414 | if (IS_ERR(handle)) { | ||
6415 | ret = PTR_ERR(handle); | ||
6416 | mlog_errno(ret); | ||
6417 | goto out_unlock; | ||
6418 | } | ||
6419 | |||
6429 | trace_ocfs2_free_cached_blocks( | 6420 | trace_ocfs2_free_cached_blocks( |
6430 | (unsigned long long)head->free_blk, head->free_bit); | 6421 | (unsigned long long)head->free_blk, head->free_bit); |
6431 | 6422 | ||
6432 | ret = ocfs2_free_suballoc_bits(handle, inode, di_bh, | 6423 | ret = ocfs2_free_suballoc_bits(handle, inode, di_bh, |
6433 | head->free_bit, bg_blkno, 1); | 6424 | head->free_bit, bg_blkno, 1); |
6434 | if (ret) { | 6425 | if (ret) |
6435 | mlog_errno(ret); | 6426 | mlog_errno(ret); |
6436 | goto out_journal; | ||
6437 | } | ||
6438 | 6427 | ||
6439 | ret = ocfs2_extend_trans(handle, OCFS2_SUBALLOC_FREE); | 6428 | ocfs2_commit_trans(osb, handle); |
6440 | if (ret) { | ||
6441 | mlog_errno(ret); | ||
6442 | goto out_journal; | ||
6443 | } | ||
6444 | 6429 | ||
6445 | tmp = head; | 6430 | tmp = head; |
6446 | head = head->free_next; | 6431 | head = head->free_next; |
6447 | kfree(tmp); | 6432 | kfree(tmp); |
6448 | } | 6433 | } |
6449 | 6434 | ||
6450 | out_journal: | ||
6451 | ocfs2_commit_trans(osb, handle); | ||
6452 | |||
6453 | out_unlock: | 6435 | out_unlock: |
6454 | ocfs2_inode_unlock(inode, 1); | 6436 | ocfs2_inode_unlock(inode, 1); |
6455 | brelse(di_bh); | 6437 | brelse(di_bh); |
diff --git a/fs/ocfs2/cluster/tcp_internal.h b/fs/ocfs2/cluster/tcp_internal.h index 94b18369b1cc..b95e7df5b76a 100644 --- a/fs/ocfs2/cluster/tcp_internal.h +++ b/fs/ocfs2/cluster/tcp_internal.h | |||
@@ -44,9 +44,6 @@ | |||
44 | * version here in tcp_internal.h should not need to be bumped for | 44 | * version here in tcp_internal.h should not need to be bumped for |
45 | * filesystem locking changes. | 45 | * filesystem locking changes. |
46 | * | 46 | * |
47 | * New in version 12 | ||
48 | * - Negotiate hb timeout when storage is down. | ||
49 | * | ||
50 | * New in version 11 | 47 | * New in version 11 |
51 | * - Negotiation of filesystem locking in the dlm join. | 48 | * - Negotiation of filesystem locking in the dlm join. |
52 | * | 49 | * |
@@ -78,7 +75,7 @@ | |||
78 | * - full 64 bit i_size in the metadata lock lvbs | 75 | * - full 64 bit i_size in the metadata lock lvbs |
79 | * - introduction of "rw" lock and pushing meta/data locking down | 76 | * - introduction of "rw" lock and pushing meta/data locking down |
80 | */ | 77 | */ |
81 | #define O2NET_PROTOCOL_VERSION 12ULL | 78 | #define O2NET_PROTOCOL_VERSION 11ULL |
82 | struct o2net_handshake { | 79 | struct o2net_handshake { |
83 | __be64 protocol_version; | 80 | __be64 protocol_version; |
84 | __be64 connector_id; | 81 | __be64 connector_id; |
diff --git a/fs/ocfs2/dlm/dlmconvert.c b/fs/ocfs2/dlm/dlmconvert.c index cdeafb4e7ed6..0bb128659d4b 100644 --- a/fs/ocfs2/dlm/dlmconvert.c +++ b/fs/ocfs2/dlm/dlmconvert.c | |||
@@ -268,7 +268,6 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, | |||
268 | struct dlm_lock *lock, int flags, int type) | 268 | struct dlm_lock *lock, int flags, int type) |
269 | { | 269 | { |
270 | enum dlm_status status; | 270 | enum dlm_status status; |
271 | u8 old_owner = res->owner; | ||
272 | 271 | ||
273 | mlog(0, "type=%d, convert_type=%d, busy=%d\n", lock->ml.type, | 272 | mlog(0, "type=%d, convert_type=%d, busy=%d\n", lock->ml.type, |
274 | lock->ml.convert_type, res->state & DLM_LOCK_RES_IN_PROGRESS); | 273 | lock->ml.convert_type, res->state & DLM_LOCK_RES_IN_PROGRESS); |
@@ -335,7 +334,6 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, | |||
335 | 334 | ||
336 | spin_lock(&res->spinlock); | 335 | spin_lock(&res->spinlock); |
337 | res->state &= ~DLM_LOCK_RES_IN_PROGRESS; | 336 | res->state &= ~DLM_LOCK_RES_IN_PROGRESS; |
338 | lock->convert_pending = 0; | ||
339 | /* if it failed, move it back to granted queue. | 337 | /* if it failed, move it back to granted queue. |
340 | * if master returns DLM_NORMAL and then down before sending ast, | 338 | * if master returns DLM_NORMAL and then down before sending ast, |
341 | * it may have already been moved to granted queue, reset to | 339 | * it may have already been moved to granted queue, reset to |
@@ -344,12 +342,14 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, | |||
344 | if (status != DLM_NOTQUEUED) | 342 | if (status != DLM_NOTQUEUED) |
345 | dlm_error(status); | 343 | dlm_error(status); |
346 | dlm_revert_pending_convert(res, lock); | 344 | dlm_revert_pending_convert(res, lock); |
347 | } else if ((res->state & DLM_LOCK_RES_RECOVERING) || | 345 | } else if (!lock->convert_pending) { |
348 | (old_owner != res->owner)) { | 346 | mlog(0, "%s: res %.*s, owner died and lock has been moved back " |
349 | mlog(0, "res %.*s is in recovering or has been recovered.\n", | 347 | "to granted list, retry convert.\n", |
350 | res->lockname.len, res->lockname.name); | 348 | dlm->name, res->lockname.len, res->lockname.name); |
351 | status = DLM_RECOVERING; | 349 | status = DLM_RECOVERING; |
352 | } | 350 | } |
351 | |||
352 | lock->convert_pending = 0; | ||
353 | bail: | 353 | bail: |
354 | spin_unlock(&res->spinlock); | 354 | spin_unlock(&res->spinlock); |
355 | 355 | ||
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 4e7b0dc22450..0b055bfb8e86 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1506,7 +1506,8 @@ static int ocfs2_zero_partial_clusters(struct inode *inode, | |||
1506 | u64 start, u64 len) | 1506 | u64 start, u64 len) |
1507 | { | 1507 | { |
1508 | int ret = 0; | 1508 | int ret = 0; |
1509 | u64 tmpend, end = start + len; | 1509 | u64 tmpend = 0; |
1510 | u64 end = start + len; | ||
1510 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 1511 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
1511 | unsigned int csize = osb->s_clustersize; | 1512 | unsigned int csize = osb->s_clustersize; |
1512 | handle_t *handle; | 1513 | handle_t *handle; |
@@ -1538,18 +1539,31 @@ static int ocfs2_zero_partial_clusters(struct inode *inode, | |||
1538 | } | 1539 | } |
1539 | 1540 | ||
1540 | /* | 1541 | /* |
1541 | * We want to get the byte offset of the end of the 1st cluster. | 1542 | * If start is on a cluster boundary and end is somewhere in another |
1543 | * cluster, we have not COWed the cluster starting at start, unless | ||
1544 | * end is also within the same cluster. So, in this case, we skip this | ||
1545 | * first call to ocfs2_zero_range_for_truncate() truncate and move on | ||
1546 | * to the next one. | ||
1542 | */ | 1547 | */ |
1543 | tmpend = (u64)osb->s_clustersize + (start & ~(osb->s_clustersize - 1)); | 1548 | if ((start & (csize - 1)) != 0) { |
1544 | if (tmpend > end) | 1549 | /* |
1545 | tmpend = end; | 1550 | * We want to get the byte offset of the end of the 1st |
1551 | * cluster. | ||
1552 | */ | ||
1553 | tmpend = (u64)osb->s_clustersize + | ||
1554 | (start & ~(osb->s_clustersize - 1)); | ||
1555 | if (tmpend > end) | ||
1556 | tmpend = end; | ||
1546 | 1557 | ||
1547 | trace_ocfs2_zero_partial_clusters_range1((unsigned long long)start, | 1558 | trace_ocfs2_zero_partial_clusters_range1( |
1548 | (unsigned long long)tmpend); | 1559 | (unsigned long long)start, |
1560 | (unsigned long long)tmpend); | ||
1549 | 1561 | ||
1550 | ret = ocfs2_zero_range_for_truncate(inode, handle, start, tmpend); | 1562 | ret = ocfs2_zero_range_for_truncate(inode, handle, start, |
1551 | if (ret) | 1563 | tmpend); |
1552 | mlog_errno(ret); | 1564 | if (ret) |
1565 | mlog_errno(ret); | ||
1566 | } | ||
1553 | 1567 | ||
1554 | if (tmpend < end) { | 1568 | if (tmpend < end) { |
1555 | /* | 1569 | /* |
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index ea47120a85ff..6ad3533940ba 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -1199,14 +1199,24 @@ retry: | |||
1199 | inode_unlock((*ac)->ac_inode); | 1199 | inode_unlock((*ac)->ac_inode); |
1200 | 1200 | ||
1201 | ret = ocfs2_try_to_free_truncate_log(osb, bits_wanted); | 1201 | ret = ocfs2_try_to_free_truncate_log(osb, bits_wanted); |
1202 | if (ret == 1) | 1202 | if (ret == 1) { |
1203 | iput((*ac)->ac_inode); | ||
1204 | (*ac)->ac_inode = NULL; | ||
1203 | goto retry; | 1205 | goto retry; |
1206 | } | ||
1204 | 1207 | ||
1205 | if (ret < 0) | 1208 | if (ret < 0) |
1206 | mlog_errno(ret); | 1209 | mlog_errno(ret); |
1207 | 1210 | ||
1208 | inode_lock((*ac)->ac_inode); | 1211 | inode_lock((*ac)->ac_inode); |
1209 | ocfs2_inode_lock((*ac)->ac_inode, NULL, 1); | 1212 | ret = ocfs2_inode_lock((*ac)->ac_inode, NULL, 1); |
1213 | if (ret < 0) { | ||
1214 | mlog_errno(ret); | ||
1215 | inode_unlock((*ac)->ac_inode); | ||
1216 | iput((*ac)->ac_inode); | ||
1217 | (*ac)->ac_inode = NULL; | ||
1218 | goto bail; | ||
1219 | } | ||
1210 | } | 1220 | } |
1211 | if (status < 0) { | 1221 | if (status < 0) { |
1212 | if (status != -ENOSPC) | 1222 | if (status != -ENOSPC) |
diff --git a/fs/ramfs/file-mmu.c b/fs/ramfs/file-mmu.c index 183a212694bf..12af0490322f 100644 --- a/fs/ramfs/file-mmu.c +++ b/fs/ramfs/file-mmu.c | |||
@@ -27,9 +27,17 @@ | |||
27 | #include <linux/fs.h> | 27 | #include <linux/fs.h> |
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include <linux/ramfs.h> | 29 | #include <linux/ramfs.h> |
30 | #include <linux/sched.h> | ||
30 | 31 | ||
31 | #include "internal.h" | 32 | #include "internal.h" |
32 | 33 | ||
34 | static unsigned long ramfs_mmu_get_unmapped_area(struct file *file, | ||
35 | unsigned long addr, unsigned long len, unsigned long pgoff, | ||
36 | unsigned long flags) | ||
37 | { | ||
38 | return current->mm->get_unmapped_area(file, addr, len, pgoff, flags); | ||
39 | } | ||
40 | |||
33 | const struct file_operations ramfs_file_operations = { | 41 | const struct file_operations ramfs_file_operations = { |
34 | .read_iter = generic_file_read_iter, | 42 | .read_iter = generic_file_read_iter, |
35 | .write_iter = generic_file_write_iter, | 43 | .write_iter = generic_file_write_iter, |
@@ -38,6 +46,7 @@ const struct file_operations ramfs_file_operations = { | |||
38 | .splice_read = generic_file_splice_read, | 46 | .splice_read = generic_file_splice_read, |
39 | .splice_write = iter_file_splice_write, | 47 | .splice_write = iter_file_splice_write, |
40 | .llseek = generic_file_llseek, | 48 | .llseek = generic_file_llseek, |
49 | .get_unmapped_area = ramfs_mmu_get_unmapped_area, | ||
41 | }; | 50 | }; |
42 | 51 | ||
43 | const struct inode_operations ramfs_file_inode_operations = { | 52 | const struct inode_operations ramfs_file_inode_operations = { |
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 242bf530edfc..34bd80512a0c 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __CPUHOTPLUG_H | 1 | #ifndef __CPUHOTPLUG_H |
2 | #define __CPUHOTPLUG_H | 2 | #define __CPUHOTPLUG_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
4 | enum cpuhp_state { | 6 | enum cpuhp_state { |
5 | CPUHP_OFFLINE, | 7 | CPUHP_OFFLINE, |
6 | CPUHP_CREATE_THREADS, | 8 | CPUHP_CREATE_THREADS, |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 58205f33af02..7268ed076be8 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -148,6 +148,7 @@ struct fsnotify_group { | |||
148 | #define FS_PRIO_1 1 /* fanotify content based access control */ | 148 | #define FS_PRIO_1 1 /* fanotify content based access control */ |
149 | #define FS_PRIO_2 2 /* fanotify pre-content access */ | 149 | #define FS_PRIO_2 2 /* fanotify pre-content access */ |
150 | unsigned int priority; | 150 | unsigned int priority; |
151 | bool shutdown; /* group is being shut down, don't queue more events */ | ||
151 | 152 | ||
152 | /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */ | 153 | /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */ |
153 | struct mutex mark_mutex; /* protect marks_list */ | 154 | struct mutex mark_mutex; /* protect marks_list */ |
@@ -179,7 +180,6 @@ struct fsnotify_group { | |||
179 | spinlock_t access_lock; | 180 | spinlock_t access_lock; |
180 | struct list_head access_list; | 181 | struct list_head access_list; |
181 | wait_queue_head_t access_waitq; | 182 | wait_queue_head_t access_waitq; |
182 | atomic_t bypass_perm; | ||
183 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ | 183 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ |
184 | int f_flags; | 184 | int f_flags; |
185 | unsigned int max_marks; | 185 | unsigned int max_marks; |
@@ -292,6 +292,8 @@ extern struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *op | |||
292 | extern void fsnotify_get_group(struct fsnotify_group *group); | 292 | extern void fsnotify_get_group(struct fsnotify_group *group); |
293 | /* drop reference on a group from fsnotify_alloc_group */ | 293 | /* drop reference on a group from fsnotify_alloc_group */ |
294 | extern void fsnotify_put_group(struct fsnotify_group *group); | 294 | extern void fsnotify_put_group(struct fsnotify_group *group); |
295 | /* group destruction begins, stop queuing new events */ | ||
296 | extern void fsnotify_group_stop_queueing(struct fsnotify_group *group); | ||
295 | /* destroy group */ | 297 | /* destroy group */ |
296 | extern void fsnotify_destroy_group(struct fsnotify_group *group); | 298 | extern void fsnotify_destroy_group(struct fsnotify_group *group); |
297 | /* fasync handler function */ | 299 | /* fasync handler function */ |
@@ -304,8 +306,6 @@ extern int fsnotify_add_event(struct fsnotify_group *group, | |||
304 | struct fsnotify_event *event, | 306 | struct fsnotify_event *event, |
305 | int (*merge)(struct list_head *, | 307 | int (*merge)(struct list_head *, |
306 | struct fsnotify_event *)); | 308 | struct fsnotify_event *)); |
307 | /* Remove passed event from groups notification queue */ | ||
308 | extern void fsnotify_remove_event(struct fsnotify_group *group, struct fsnotify_event *event); | ||
309 | /* true if the group notification queue is empty */ | 309 | /* true if the group notification queue is empty */ |
310 | extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group); | 310 | extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group); |
311 | /* return, but do not dequeue the first event on the notification queue */ | 311 | /* return, but do not dequeue the first event on the notification queue */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index b52424eaa0ed..0ac26c892fe2 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -945,6 +945,16 @@ static inline void irq_gc_lock(struct irq_chip_generic *gc) { } | |||
945 | static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } | 945 | static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } |
946 | #endif | 946 | #endif |
947 | 947 | ||
948 | /* | ||
949 | * The irqsave variants are for usage in non interrupt code. Do not use | ||
950 | * them in irq_chip callbacks. Use irq_gc_lock() instead. | ||
951 | */ | ||
952 | #define irq_gc_lock_irqsave(gc, flags) \ | ||
953 | raw_spin_lock_irqsave(&(gc)->lock, flags) | ||
954 | |||
955 | #define irq_gc_unlock_irqrestore(gc, flags) \ | ||
956 | raw_spin_unlock_irqrestore(&(gc)->lock, flags) | ||
957 | |||
948 | static inline void irq_reg_writel(struct irq_chip_generic *gc, | 958 | static inline void irq_reg_writel(struct irq_chip_generic *gc, |
949 | u32 val, int reg_offset) | 959 | u32 val, int reg_offset) |
950 | { | 960 | { |
diff --git a/include/linux/uio.h b/include/linux/uio.h index 1b5d1cd796e2..75b4aaf31a9d 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
@@ -76,7 +76,7 @@ size_t iov_iter_copy_from_user_atomic(struct page *page, | |||
76 | struct iov_iter *i, unsigned long offset, size_t bytes); | 76 | struct iov_iter *i, unsigned long offset, size_t bytes); |
77 | void iov_iter_advance(struct iov_iter *i, size_t bytes); | 77 | void iov_iter_advance(struct iov_iter *i, size_t bytes); |
78 | int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes); | 78 | int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes); |
79 | int iov_iter_fault_in_multipages_readable(struct iov_iter *i, size_t bytes); | 79 | #define iov_iter_fault_in_multipages_readable iov_iter_fault_in_readable |
80 | size_t iov_iter_single_seg_count(const struct iov_iter *i); | 80 | size_t iov_iter_single_seg_count(const struct iov_iter *i); |
81 | size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes, | 81 | size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes, |
82 | struct iov_iter *i); | 82 | struct iov_iter *i); |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index d1c51b7f5221..5e8dab5bf9ad 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -6270,6 +6270,12 @@ void cgroup_sk_alloc(struct sock_cgroup_data *skcd) | |||
6270 | if (cgroup_sk_alloc_disabled) | 6270 | if (cgroup_sk_alloc_disabled) |
6271 | return; | 6271 | return; |
6272 | 6272 | ||
6273 | /* Socket clone path */ | ||
6274 | if (skcd->val) { | ||
6275 | cgroup_get(sock_cgroup_ptr(skcd)); | ||
6276 | return; | ||
6277 | } | ||
6278 | |||
6273 | rcu_read_lock(); | 6279 | rcu_read_lock(); |
6274 | 6280 | ||
6275 | while (true) { | 6281 | while (true) { |
diff --git a/lib/iov_iter.c b/lib/iov_iter.c index 9e8c7386b3a0..7e3138cfc8c9 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c | |||
@@ -291,33 +291,13 @@ done: | |||
291 | } | 291 | } |
292 | 292 | ||
293 | /* | 293 | /* |
294 | * Fault in the first iovec of the given iov_iter, to a maximum length | ||
295 | * of bytes. Returns 0 on success, or non-zero if the memory could not be | ||
296 | * accessed (ie. because it is an invalid address). | ||
297 | * | ||
298 | * writev-intensive code may want this to prefault several iovecs -- that | ||
299 | * would be possible (callers must not rely on the fact that _only_ the | ||
300 | * first iovec will be faulted with the current implementation). | ||
301 | */ | ||
302 | int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes) | ||
303 | { | ||
304 | if (!(i->type & (ITER_BVEC|ITER_KVEC))) { | ||
305 | char __user *buf = i->iov->iov_base + i->iov_offset; | ||
306 | bytes = min(bytes, i->iov->iov_len - i->iov_offset); | ||
307 | return fault_in_pages_readable(buf, bytes); | ||
308 | } | ||
309 | return 0; | ||
310 | } | ||
311 | EXPORT_SYMBOL(iov_iter_fault_in_readable); | ||
312 | |||
313 | /* | ||
314 | * Fault in one or more iovecs of the given iov_iter, to a maximum length of | 294 | * Fault in one or more iovecs of the given iov_iter, to a maximum length of |
315 | * bytes. For each iovec, fault in each page that constitutes the iovec. | 295 | * bytes. For each iovec, fault in each page that constitutes the iovec. |
316 | * | 296 | * |
317 | * Return 0 on success, or non-zero if the memory could not be accessed (i.e. | 297 | * Return 0 on success, or non-zero if the memory could not be accessed (i.e. |
318 | * because it is an invalid address). | 298 | * because it is an invalid address). |
319 | */ | 299 | */ |
320 | int iov_iter_fault_in_multipages_readable(struct iov_iter *i, size_t bytes) | 300 | int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes) |
321 | { | 301 | { |
322 | size_t skip = i->iov_offset; | 302 | size_t skip = i->iov_offset; |
323 | const struct iovec *iov; | 303 | const struct iovec *iov; |
@@ -334,7 +314,7 @@ int iov_iter_fault_in_multipages_readable(struct iov_iter *i, size_t bytes) | |||
334 | } | 314 | } |
335 | return 0; | 315 | return 0; |
336 | } | 316 | } |
337 | EXPORT_SYMBOL(iov_iter_fault_in_multipages_readable); | 317 | EXPORT_SYMBOL(iov_iter_fault_in_readable); |
338 | 318 | ||
339 | void iov_iter_init(struct iov_iter *i, int direction, | 319 | void iov_iter_init(struct iov_iter *i, int direction, |
340 | const struct iovec *iov, unsigned long nr_segs, | 320 | const struct iovec *iov, unsigned long nr_segs, |
diff --git a/mm/debug.c b/mm/debug.c index 8865bfb41b0b..74c7cae4f683 100644 --- a/mm/debug.c +++ b/mm/debug.c | |||
@@ -42,9 +42,11 @@ const struct trace_print_flags vmaflag_names[] = { | |||
42 | 42 | ||
43 | void __dump_page(struct page *page, const char *reason) | 43 | void __dump_page(struct page *page, const char *reason) |
44 | { | 44 | { |
45 | int mapcount = PageSlab(page) ? 0 : page_mapcount(page); | ||
46 | |||
45 | pr_emerg("page:%p count:%d mapcount:%d mapping:%p index:%#lx", | 47 | pr_emerg("page:%p count:%d mapcount:%d mapping:%p index:%#lx", |
46 | page, page_ref_count(page), page_mapcount(page), | 48 | page, page_ref_count(page), mapcount, |
47 | page->mapping, page->index); | 49 | page->mapping, page_to_pgoff(page)); |
48 | if (PageCompound(page)) | 50 | if (PageCompound(page)) |
49 | pr_cont(" compound_mapcount: %d", compound_mapcount(page)); | 51 | pr_cont(" compound_mapcount: %d", compound_mapcount(page)); |
50 | pr_cont("\n"); | 52 | pr_cont("\n"); |
diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 79c52d0061af..728d7790dc2d 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c | |||
@@ -838,7 +838,8 @@ static bool hugepage_vma_check(struct vm_area_struct *vma) | |||
838 | * value (scan code). | 838 | * value (scan code). |
839 | */ | 839 | */ |
840 | 840 | ||
841 | static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address) | 841 | static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address, |
842 | struct vm_area_struct **vmap) | ||
842 | { | 843 | { |
843 | struct vm_area_struct *vma; | 844 | struct vm_area_struct *vma; |
844 | unsigned long hstart, hend; | 845 | unsigned long hstart, hend; |
@@ -846,7 +847,7 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address) | |||
846 | if (unlikely(khugepaged_test_exit(mm))) | 847 | if (unlikely(khugepaged_test_exit(mm))) |
847 | return SCAN_ANY_PROCESS; | 848 | return SCAN_ANY_PROCESS; |
848 | 849 | ||
849 | vma = find_vma(mm, address); | 850 | *vmap = vma = find_vma(mm, address); |
850 | if (!vma) | 851 | if (!vma) |
851 | return SCAN_VMA_NULL; | 852 | return SCAN_VMA_NULL; |
852 | 853 | ||
@@ -881,6 +882,11 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm, | |||
881 | .pmd = pmd, | 882 | .pmd = pmd, |
882 | }; | 883 | }; |
883 | 884 | ||
885 | /* we only decide to swapin, if there is enough young ptes */ | ||
886 | if (referenced < HPAGE_PMD_NR/2) { | ||
887 | trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0); | ||
888 | return false; | ||
889 | } | ||
884 | fe.pte = pte_offset_map(pmd, address); | 890 | fe.pte = pte_offset_map(pmd, address); |
885 | for (; fe.address < address + HPAGE_PMD_NR*PAGE_SIZE; | 891 | for (; fe.address < address + HPAGE_PMD_NR*PAGE_SIZE; |
886 | fe.pte++, fe.address += PAGE_SIZE) { | 892 | fe.pte++, fe.address += PAGE_SIZE) { |
@@ -888,17 +894,12 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm, | |||
888 | if (!is_swap_pte(pteval)) | 894 | if (!is_swap_pte(pteval)) |
889 | continue; | 895 | continue; |
890 | swapped_in++; | 896 | swapped_in++; |
891 | /* we only decide to swapin, if there is enough young ptes */ | ||
892 | if (referenced < HPAGE_PMD_NR/2) { | ||
893 | trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0); | ||
894 | return false; | ||
895 | } | ||
896 | ret = do_swap_page(&fe, pteval); | 897 | ret = do_swap_page(&fe, pteval); |
897 | 898 | ||
898 | /* do_swap_page returns VM_FAULT_RETRY with released mmap_sem */ | 899 | /* do_swap_page returns VM_FAULT_RETRY with released mmap_sem */ |
899 | if (ret & VM_FAULT_RETRY) { | 900 | if (ret & VM_FAULT_RETRY) { |
900 | down_read(&mm->mmap_sem); | 901 | down_read(&mm->mmap_sem); |
901 | if (hugepage_vma_revalidate(mm, address)) { | 902 | if (hugepage_vma_revalidate(mm, address, &fe.vma)) { |
902 | /* vma is no longer available, don't continue to swapin */ | 903 | /* vma is no longer available, don't continue to swapin */ |
903 | trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0); | 904 | trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0); |
904 | return false; | 905 | return false; |
@@ -923,7 +924,6 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm, | |||
923 | static void collapse_huge_page(struct mm_struct *mm, | 924 | static void collapse_huge_page(struct mm_struct *mm, |
924 | unsigned long address, | 925 | unsigned long address, |
925 | struct page **hpage, | 926 | struct page **hpage, |
926 | struct vm_area_struct *vma, | ||
927 | int node, int referenced) | 927 | int node, int referenced) |
928 | { | 928 | { |
929 | pmd_t *pmd, _pmd; | 929 | pmd_t *pmd, _pmd; |
@@ -933,6 +933,7 @@ static void collapse_huge_page(struct mm_struct *mm, | |||
933 | spinlock_t *pmd_ptl, *pte_ptl; | 933 | spinlock_t *pmd_ptl, *pte_ptl; |
934 | int isolated = 0, result = 0; | 934 | int isolated = 0, result = 0; |
935 | struct mem_cgroup *memcg; | 935 | struct mem_cgroup *memcg; |
936 | struct vm_area_struct *vma; | ||
936 | unsigned long mmun_start; /* For mmu_notifiers */ | 937 | unsigned long mmun_start; /* For mmu_notifiers */ |
937 | unsigned long mmun_end; /* For mmu_notifiers */ | 938 | unsigned long mmun_end; /* For mmu_notifiers */ |
938 | gfp_t gfp; | 939 | gfp_t gfp; |
@@ -961,7 +962,7 @@ static void collapse_huge_page(struct mm_struct *mm, | |||
961 | } | 962 | } |
962 | 963 | ||
963 | down_read(&mm->mmap_sem); | 964 | down_read(&mm->mmap_sem); |
964 | result = hugepage_vma_revalidate(mm, address); | 965 | result = hugepage_vma_revalidate(mm, address, &vma); |
965 | if (result) { | 966 | if (result) { |
966 | mem_cgroup_cancel_charge(new_page, memcg, true); | 967 | mem_cgroup_cancel_charge(new_page, memcg, true); |
967 | up_read(&mm->mmap_sem); | 968 | up_read(&mm->mmap_sem); |
@@ -994,7 +995,7 @@ static void collapse_huge_page(struct mm_struct *mm, | |||
994 | * handled by the anon_vma lock + PG_lock. | 995 | * handled by the anon_vma lock + PG_lock. |
995 | */ | 996 | */ |
996 | down_write(&mm->mmap_sem); | 997 | down_write(&mm->mmap_sem); |
997 | result = hugepage_vma_revalidate(mm, address); | 998 | result = hugepage_vma_revalidate(mm, address, &vma); |
998 | if (result) | 999 | if (result) |
999 | goto out; | 1000 | goto out; |
1000 | /* check if the pmd is still valid */ | 1001 | /* check if the pmd is still valid */ |
@@ -1202,7 +1203,7 @@ out_unmap: | |||
1202 | if (ret) { | 1203 | if (ret) { |
1203 | node = khugepaged_find_target_node(); | 1204 | node = khugepaged_find_target_node(); |
1204 | /* collapse_huge_page will return with the mmap_sem released */ | 1205 | /* collapse_huge_page will return with the mmap_sem released */ |
1205 | collapse_huge_page(mm, address, hpage, vma, node, referenced); | 1206 | collapse_huge_page(mm, address, hpage, node, referenced); |
1206 | } | 1207 | } |
1207 | out: | 1208 | out: |
1208 | trace_mm_khugepaged_scan_pmd(mm, page, writable, referenced, | 1209 | trace_mm_khugepaged_scan_pmd(mm, page, writable, referenced, |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 9a6a51a7c416..4be518d4e68a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -1740,17 +1740,22 @@ static DEFINE_MUTEX(percpu_charge_mutex); | |||
1740 | static bool consume_stock(struct mem_cgroup *memcg, unsigned int nr_pages) | 1740 | static bool consume_stock(struct mem_cgroup *memcg, unsigned int nr_pages) |
1741 | { | 1741 | { |
1742 | struct memcg_stock_pcp *stock; | 1742 | struct memcg_stock_pcp *stock; |
1743 | unsigned long flags; | ||
1743 | bool ret = false; | 1744 | bool ret = false; |
1744 | 1745 | ||
1745 | if (nr_pages > CHARGE_BATCH) | 1746 | if (nr_pages > CHARGE_BATCH) |
1746 | return ret; | 1747 | return ret; |
1747 | 1748 | ||
1748 | stock = &get_cpu_var(memcg_stock); | 1749 | local_irq_save(flags); |
1750 | |||
1751 | stock = this_cpu_ptr(&memcg_stock); | ||
1749 | if (memcg == stock->cached && stock->nr_pages >= nr_pages) { | 1752 | if (memcg == stock->cached && stock->nr_pages >= nr_pages) { |
1750 | stock->nr_pages -= nr_pages; | 1753 | stock->nr_pages -= nr_pages; |
1751 | ret = true; | 1754 | ret = true; |
1752 | } | 1755 | } |
1753 | put_cpu_var(memcg_stock); | 1756 | |
1757 | local_irq_restore(flags); | ||
1758 | |||
1754 | return ret; | 1759 | return ret; |
1755 | } | 1760 | } |
1756 | 1761 | ||
@@ -1771,15 +1776,18 @@ static void drain_stock(struct memcg_stock_pcp *stock) | |||
1771 | stock->cached = NULL; | 1776 | stock->cached = NULL; |
1772 | } | 1777 | } |
1773 | 1778 | ||
1774 | /* | ||
1775 | * This must be called under preempt disabled or must be called by | ||
1776 | * a thread which is pinned to local cpu. | ||
1777 | */ | ||
1778 | static void drain_local_stock(struct work_struct *dummy) | 1779 | static void drain_local_stock(struct work_struct *dummy) |
1779 | { | 1780 | { |
1780 | struct memcg_stock_pcp *stock = this_cpu_ptr(&memcg_stock); | 1781 | struct memcg_stock_pcp *stock; |
1782 | unsigned long flags; | ||
1783 | |||
1784 | local_irq_save(flags); | ||
1785 | |||
1786 | stock = this_cpu_ptr(&memcg_stock); | ||
1781 | drain_stock(stock); | 1787 | drain_stock(stock); |
1782 | clear_bit(FLUSHING_CACHED_CHARGE, &stock->flags); | 1788 | clear_bit(FLUSHING_CACHED_CHARGE, &stock->flags); |
1789 | |||
1790 | local_irq_restore(flags); | ||
1783 | } | 1791 | } |
1784 | 1792 | ||
1785 | /* | 1793 | /* |
@@ -1788,14 +1796,19 @@ static void drain_local_stock(struct work_struct *dummy) | |||
1788 | */ | 1796 | */ |
1789 | static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) | 1797 | static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) |
1790 | { | 1798 | { |
1791 | struct memcg_stock_pcp *stock = &get_cpu_var(memcg_stock); | 1799 | struct memcg_stock_pcp *stock; |
1800 | unsigned long flags; | ||
1801 | |||
1802 | local_irq_save(flags); | ||
1792 | 1803 | ||
1804 | stock = this_cpu_ptr(&memcg_stock); | ||
1793 | if (stock->cached != memcg) { /* reset if necessary */ | 1805 | if (stock->cached != memcg) { /* reset if necessary */ |
1794 | drain_stock(stock); | 1806 | drain_stock(stock); |
1795 | stock->cached = memcg; | 1807 | stock->cached = memcg; |
1796 | } | 1808 | } |
1797 | stock->nr_pages += nr_pages; | 1809 | stock->nr_pages += nr_pages; |
1798 | put_cpu_var(memcg_stock); | 1810 | |
1811 | local_irq_restore(flags); | ||
1799 | } | 1812 | } |
1800 | 1813 | ||
1801 | /* | 1814 | /* |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 41266dc29f33..b58906b6215c 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -1567,7 +1567,9 @@ static struct page *new_node_page(struct page *page, unsigned long private, | |||
1567 | return alloc_huge_page_node(page_hstate(compound_head(page)), | 1567 | return alloc_huge_page_node(page_hstate(compound_head(page)), |
1568 | next_node_in(nid, nmask)); | 1568 | next_node_in(nid, nmask)); |
1569 | 1569 | ||
1570 | node_clear(nid, nmask); | 1570 | if (nid != next_node_in(nid, nmask)) |
1571 | node_clear(nid, nmask); | ||
1572 | |||
1571 | if (PageHighMem(page) | 1573 | if (PageHighMem(page) |
1572 | || (zone_idx(page_zone(page)) == ZONE_MOVABLE)) | 1574 | || (zone_idx(page_zone(page)) == ZONE_MOVABLE)) |
1573 | gfp_mask |= __GFP_HIGHMEM; | 1575 | gfp_mask |= __GFP_HIGHMEM; |
diff --git a/mm/page_io.c b/mm/page_io.c index 16bd82fad38c..eafe5ddc2b54 100644 --- a/mm/page_io.c +++ b/mm/page_io.c | |||
@@ -264,6 +264,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, | |||
264 | int ret; | 264 | int ret; |
265 | struct swap_info_struct *sis = page_swap_info(page); | 265 | struct swap_info_struct *sis = page_swap_info(page); |
266 | 266 | ||
267 | BUG_ON(!PageSwapCache(page)); | ||
267 | if (sis->flags & SWP_FILE) { | 268 | if (sis->flags & SWP_FILE) { |
268 | struct kiocb kiocb; | 269 | struct kiocb kiocb; |
269 | struct file *swap_file = sis->swap_file; | 270 | struct file *swap_file = sis->swap_file; |
@@ -337,6 +338,7 @@ int swap_readpage(struct page *page) | |||
337 | int ret = 0; | 338 | int ret = 0; |
338 | struct swap_info_struct *sis = page_swap_info(page); | 339 | struct swap_info_struct *sis = page_swap_info(page); |
339 | 340 | ||
341 | BUG_ON(!PageSwapCache(page)); | ||
340 | VM_BUG_ON_PAGE(!PageLocked(page), page); | 342 | VM_BUG_ON_PAGE(!PageLocked(page), page); |
341 | VM_BUG_ON_PAGE(PageUptodate(page), page); | 343 | VM_BUG_ON_PAGE(PageUptodate(page), page); |
342 | if (frontswap_load(page) == 0) { | 344 | if (frontswap_load(page) == 0) { |
@@ -386,6 +388,7 @@ int swap_set_page_dirty(struct page *page) | |||
386 | 388 | ||
387 | if (sis->flags & SWP_FILE) { | 389 | if (sis->flags & SWP_FILE) { |
388 | struct address_space *mapping = sis->swap_file->f_mapping; | 390 | struct address_space *mapping = sis->swap_file->f_mapping; |
391 | BUG_ON(!PageSwapCache(page)); | ||
389 | return mapping->a_ops->set_page_dirty(page); | 392 | return mapping->a_ops->set_page_dirty(page); |
390 | } else { | 393 | } else { |
391 | return __set_page_dirty_no_writeback(page); | 394 | return __set_page_dirty_no_writeback(page); |
diff --git a/mm/swapfile.c b/mm/swapfile.c index 78cfa292a29a..2657accc6e2b 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -2724,7 +2724,6 @@ int swapcache_prepare(swp_entry_t entry) | |||
2724 | struct swap_info_struct *page_swap_info(struct page *page) | 2724 | struct swap_info_struct *page_swap_info(struct page *page) |
2725 | { | 2725 | { |
2726 | swp_entry_t swap = { .val = page_private(page) }; | 2726 | swp_entry_t swap = { .val = page_private(page) }; |
2727 | BUG_ON(!PageSwapCache(page)); | ||
2728 | return swap_info[swp_type(swap)]; | 2727 | return swap_info[swp_type(swap)]; |
2729 | } | 2728 | } |
2730 | 2729 | ||
diff --git a/net/core/sock.c b/net/core/sock.c index 25dab8b60223..fd7b41edf1ce 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1362,7 +1362,6 @@ static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, | |||
1362 | if (!try_module_get(prot->owner)) | 1362 | if (!try_module_get(prot->owner)) |
1363 | goto out_free_sec; | 1363 | goto out_free_sec; |
1364 | sk_tx_queue_clear(sk); | 1364 | sk_tx_queue_clear(sk); |
1365 | cgroup_sk_alloc(&sk->sk_cgrp_data); | ||
1366 | } | 1365 | } |
1367 | 1366 | ||
1368 | return sk; | 1367 | return sk; |
@@ -1422,6 +1421,7 @@ struct sock *sk_alloc(struct net *net, int family, gfp_t priority, | |||
1422 | sock_net_set(sk, net); | 1421 | sock_net_set(sk, net); |
1423 | atomic_set(&sk->sk_wmem_alloc, 1); | 1422 | atomic_set(&sk->sk_wmem_alloc, 1); |
1424 | 1423 | ||
1424 | cgroup_sk_alloc(&sk->sk_cgrp_data); | ||
1425 | sock_update_classid(&sk->sk_cgrp_data); | 1425 | sock_update_classid(&sk->sk_cgrp_data); |
1426 | sock_update_netprioidx(&sk->sk_cgrp_data); | 1426 | sock_update_netprioidx(&sk->sk_cgrp_data); |
1427 | } | 1427 | } |
@@ -1566,6 +1566,9 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) | |||
1566 | newsk->sk_priority = 0; | 1566 | newsk->sk_priority = 0; |
1567 | newsk->sk_incoming_cpu = raw_smp_processor_id(); | 1567 | newsk->sk_incoming_cpu = raw_smp_processor_id(); |
1568 | atomic64_set(&newsk->sk_cookie, 0); | 1568 | atomic64_set(&newsk->sk_cookie, 0); |
1569 | |||
1570 | cgroup_sk_alloc(&newsk->sk_cgrp_data); | ||
1571 | |||
1569 | /* | 1572 | /* |
1570 | * Before updating sk_refcnt, we must commit prior changes to memory | 1573 | * Before updating sk_refcnt, we must commit prior changes to memory |
1571 | * (Documentation/RCU/rculist_nulls.txt for details) | 1574 | * (Documentation/RCU/rculist_nulls.txt for details) |
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 1d281816f2bf..d8582028b346 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -569,9 +569,10 @@ gss_svc_searchbyctx(struct cache_detail *cd, struct xdr_netobj *handle) | |||
569 | struct rsc *found; | 569 | struct rsc *found; |
570 | 570 | ||
571 | memset(&rsci, 0, sizeof(rsci)); | 571 | memset(&rsci, 0, sizeof(rsci)); |
572 | rsci.handle.data = handle->data; | 572 | if (dup_to_netobj(&rsci.handle, handle->data, handle->len)) |
573 | rsci.handle.len = handle->len; | 573 | return NULL; |
574 | found = rsc_lookup(cd, &rsci); | 574 | found = rsc_lookup(cd, &rsci); |
575 | rsc_free(&rsci); | ||
575 | if (!found) | 576 | if (!found) |
576 | return NULL; | 577 | return NULL; |
577 | if (cache_check(cd, &found->h, NULL)) | 578 | if (cache_check(cd, &found->h, NULL)) |
diff --git a/scripts/faddr2line b/scripts/faddr2line new file mode 100755 index 000000000000..450b33257339 --- /dev/null +++ b/scripts/faddr2line | |||
@@ -0,0 +1,177 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # Translate stack dump function offsets. | ||
4 | # | ||
5 | # addr2line doesn't work with KASLR addresses. This works similarly to | ||
6 | # addr2line, but instead takes the 'func+0x123' format as input: | ||
7 | # | ||
8 | # $ ./scripts/faddr2line ~/k/vmlinux meminfo_proc_show+0x5/0x568 | ||
9 | # meminfo_proc_show+0x5/0x568: | ||
10 | # meminfo_proc_show at fs/proc/meminfo.c:27 | ||
11 | # | ||
12 | # If the address is part of an inlined function, the full inline call chain is | ||
13 | # printed: | ||
14 | # | ||
15 | # $ ./scripts/faddr2line ~/k/vmlinux native_write_msr+0x6/0x27 | ||
16 | # native_write_msr+0x6/0x27: | ||
17 | # arch_static_branch at arch/x86/include/asm/msr.h:121 | ||
18 | # (inlined by) static_key_false at include/linux/jump_label.h:125 | ||
19 | # (inlined by) native_write_msr at arch/x86/include/asm/msr.h:125 | ||
20 | # | ||
21 | # The function size after the '/' in the input is optional, but recommended. | ||
22 | # It's used to help disambiguate any duplicate symbol names, which can occur | ||
23 | # rarely. If the size is omitted for a duplicate symbol then it's possible for | ||
24 | # multiple code sites to be printed: | ||
25 | # | ||
26 | # $ ./scripts/faddr2line ~/k/vmlinux raw_ioctl+0x5 | ||
27 | # raw_ioctl+0x5/0x20: | ||
28 | # raw_ioctl at drivers/char/raw.c:122 | ||
29 | # | ||
30 | # raw_ioctl+0x5/0xb1: | ||
31 | # raw_ioctl at net/ipv4/raw.c:876 | ||
32 | # | ||
33 | # Multiple addresses can be specified on a single command line: | ||
34 | # | ||
35 | # $ ./scripts/faddr2line ~/k/vmlinux type_show+0x10/45 free_reserved_area+0x90 | ||
36 | # type_show+0x10/0x2d: | ||
37 | # type_show at drivers/video/backlight/backlight.c:213 | ||
38 | # | ||
39 | # free_reserved_area+0x90/0x123: | ||
40 | # free_reserved_area at mm/page_alloc.c:6429 (discriminator 2) | ||
41 | |||
42 | |||
43 | set -o errexit | ||
44 | set -o nounset | ||
45 | |||
46 | command -v awk >/dev/null 2>&1 || die "awk isn't installed" | ||
47 | command -v readelf >/dev/null 2>&1 || die "readelf isn't installed" | ||
48 | command -v addr2line >/dev/null 2>&1 || die "addr2line isn't installed" | ||
49 | |||
50 | usage() { | ||
51 | echo "usage: faddr2line <object file> <func+offset> <func+offset>..." >&2 | ||
52 | exit 1 | ||
53 | } | ||
54 | |||
55 | warn() { | ||
56 | echo "$1" >&2 | ||
57 | } | ||
58 | |||
59 | die() { | ||
60 | echo "ERROR: $1" >&2 | ||
61 | exit 1 | ||
62 | } | ||
63 | |||
64 | # Try to figure out the source directory prefix so we can remove it from the | ||
65 | # addr2line output. HACK ALERT: This assumes that start_kernel() is in | ||
66 | # kernel/init.c! This only works for vmlinux. Otherwise it falls back to | ||
67 | # printing the absolute path. | ||
68 | find_dir_prefix() { | ||
69 | local objfile=$1 | ||
70 | |||
71 | local start_kernel_addr=$(readelf -sW $objfile | awk '$8 == "start_kernel" {printf "0x%s", $2}') | ||
72 | [[ -z $start_kernel_addr ]] && return | ||
73 | |||
74 | local file_line=$(addr2line -e $objfile $start_kernel_addr) | ||
75 | [[ -z $file_line ]] && return | ||
76 | |||
77 | local prefix=${file_line%init/main.c:*} | ||
78 | if [[ -z $prefix ]] || [[ $prefix = $file_line ]]; then | ||
79 | return | ||
80 | fi | ||
81 | |||
82 | DIR_PREFIX=$prefix | ||
83 | return 0 | ||
84 | } | ||
85 | |||
86 | __faddr2line() { | ||
87 | local objfile=$1 | ||
88 | local func_addr=$2 | ||
89 | local dir_prefix=$3 | ||
90 | local print_warnings=$4 | ||
91 | |||
92 | local func=${func_addr%+*} | ||
93 | local offset=${func_addr#*+} | ||
94 | offset=${offset%/*} | ||
95 | local size= | ||
96 | [[ $func_addr =~ "/" ]] && size=${func_addr#*/} | ||
97 | |||
98 | if [[ -z $func ]] || [[ -z $offset ]] || [[ $func = $func_addr ]]; then | ||
99 | warn "bad func+offset $func_addr" | ||
100 | DONE=1 | ||
101 | return | ||
102 | fi | ||
103 | |||
104 | # Go through each of the object's symbols which match the func name. | ||
105 | # In rare cases there might be duplicates. | ||
106 | while read symbol; do | ||
107 | local fields=($symbol) | ||
108 | local sym_base=0x${fields[1]} | ||
109 | local sym_size=${fields[2]} | ||
110 | local sym_type=${fields[3]} | ||
111 | |||
112 | # calculate the address | ||
113 | local addr=$(($sym_base + $offset)) | ||
114 | if [[ -z $addr ]] || [[ $addr = 0 ]]; then | ||
115 | warn "bad address: $sym_base + $offset" | ||
116 | DONE=1 | ||
117 | return | ||
118 | fi | ||
119 | local hexaddr=0x$(printf %x $addr) | ||
120 | |||
121 | # weed out non-function symbols | ||
122 | if [[ $sym_type != "FUNC" ]]; then | ||
123 | [[ $print_warnings = 1 ]] && | ||
124 | echo "skipping $func address at $hexaddr due to non-function symbol" | ||
125 | continue | ||
126 | fi | ||
127 | |||
128 | # if the user provided a size, make sure it matches the symbol's size | ||
129 | if [[ -n $size ]] && [[ $size -ne $sym_size ]]; then | ||
130 | [[ $print_warnings = 1 ]] && | ||
131 | echo "skipping $func address at $hexaddr due to size mismatch ($size != $sym_size)" | ||
132 | continue; | ||
133 | fi | ||
134 | |||
135 | # make sure the provided offset is within the symbol's range | ||
136 | if [[ $offset -gt $sym_size ]]; then | ||
137 | [[ $print_warnings = 1 ]] && | ||
138 | echo "skipping $func address at $hexaddr due to size mismatch ($offset > $sym_size)" | ||
139 | continue | ||
140 | fi | ||
141 | |||
142 | # separate multiple entries with a blank line | ||
143 | [[ $FIRST = 0 ]] && echo | ||
144 | FIRST=0 | ||
145 | |||
146 | local hexsize=0x$(printf %x $sym_size) | ||
147 | echo "$func+$offset/$hexsize:" | ||
148 | addr2line -fpie $objfile $hexaddr | sed "s; $dir_prefix\(\./\)*; ;" | ||
149 | DONE=1 | ||
150 | |||
151 | done < <(readelf -sW $objfile | awk -v f=$func '$8 == f {print}') | ||
152 | } | ||
153 | |||
154 | [[ $# -lt 2 ]] && usage | ||
155 | |||
156 | objfile=$1 | ||
157 | [[ ! -f $objfile ]] && die "can't find objfile $objfile" | ||
158 | shift | ||
159 | |||
160 | DIR_PREFIX=supercalifragilisticexpialidocious | ||
161 | find_dir_prefix $objfile | ||
162 | |||
163 | FIRST=1 | ||
164 | while [[ $# -gt 0 ]]; do | ||
165 | func_addr=$1 | ||
166 | shift | ||
167 | |||
168 | # print any matches found | ||
169 | DONE=0 | ||
170 | __faddr2line $objfile $func_addr $DIR_PREFIX 0 | ||
171 | |||
172 | # if no match was found, print warnings | ||
173 | if [[ $DONE = 0 ]]; then | ||
174 | __faddr2line $objfile $func_addr $DIR_PREFIX 1 | ||
175 | warn "no match for $func_addr" | ||
176 | fi | ||
177 | done | ||