diff options
130 files changed, 1024 insertions, 503 deletions
diff --git a/Documentation/devicetree/bindings/input/gpio-keys.txt b/Documentation/devicetree/bindings/input/gpio-keys.txt index 996ce84352cb..7cccc49b6bea 100644 --- a/Documentation/devicetree/bindings/input/gpio-keys.txt +++ b/Documentation/devicetree/bindings/input/gpio-keys.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | Device-Tree bindings for input/gpio_keys.c keyboard driver | 1 | Device-Tree bindings for input/keyboard/gpio_keys.c keyboard driver |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible = "gpio-keys"; | 4 | - compatible = "gpio-keys"; |
diff --git a/Documentation/fb/uvesafb.txt b/Documentation/fb/uvesafb.txt index f6362d88763b..aa924196c366 100644 --- a/Documentation/fb/uvesafb.txt +++ b/Documentation/fb/uvesafb.txt | |||
@@ -15,7 +15,8 @@ than x86. Check the v86d documentation for a list of currently supported | |||
15 | arches. | 15 | arches. |
16 | 16 | ||
17 | v86d source code can be downloaded from the following website: | 17 | v86d source code can be downloaded from the following website: |
18 | http://dev.gentoo.org/~spock/projects/uvesafb | 18 | |
19 | https://github.com/mjanusz/v86d | ||
19 | 20 | ||
20 | Please refer to the v86d documentation for detailed configuration and | 21 | Please refer to the v86d documentation for detailed configuration and |
21 | installation instructions. | 22 | installation instructions. |
@@ -177,7 +178,7 @@ from the Video BIOS if you set pixclock to 0 in fb_var_screeninfo. | |||
177 | 178 | ||
178 | -- | 179 | -- |
179 | Michal Januszewski <spock@gentoo.org> | 180 | Michal Januszewski <spock@gentoo.org> |
180 | Last updated: 2009-03-30 | 181 | Last updated: 2017-10-10 |
181 | 182 | ||
182 | Documentation of the uvesafb options is loosely based on vesafb.txt. | 183 | Documentation of the uvesafb options is loosely based on vesafb.txt. |
183 | 184 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index dcb0191c4f54..22065048d89d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1251,7 +1251,7 @@ N: meson | |||
1251 | 1251 | ||
1252 | ARM/Annapurna Labs ALPINE ARCHITECTURE | 1252 | ARM/Annapurna Labs ALPINE ARCHITECTURE |
1253 | M: Tsahee Zidenberg <tsahee@annapurnalabs.com> | 1253 | M: Tsahee Zidenberg <tsahee@annapurnalabs.com> |
1254 | M: Antoine Tenart <antoine.tenart@free-electrons.com> | 1254 | M: Antoine Tenart <antoine.tenart@bootlin.com> |
1255 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 1255 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
1256 | S: Maintained | 1256 | S: Maintained |
1257 | F: arch/arm/mach-alpine/ | 1257 | F: arch/arm/mach-alpine/ |
@@ -9717,13 +9717,6 @@ Q: http://patchwork.linuxtv.org/project/linux-media/list/ | |||
9717 | S: Maintained | 9717 | S: Maintained |
9718 | F: drivers/media/dvb-frontends/mn88473* | 9718 | F: drivers/media/dvb-frontends/mn88473* |
9719 | 9719 | ||
9720 | PCI DRIVER FOR MOBIVEIL PCIE IP | ||
9721 | M: Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in> | ||
9722 | L: linux-pci@vger.kernel.org | ||
9723 | S: Supported | ||
9724 | F: Documentation/devicetree/bindings/pci/mobiveil-pcie.txt | ||
9725 | F: drivers/pci/controller/pcie-mobiveil.c | ||
9726 | |||
9727 | MODULE SUPPORT | 9720 | MODULE SUPPORT |
9728 | M: Jessica Yu <jeyu@kernel.org> | 9721 | M: Jessica Yu <jeyu@kernel.org> |
9729 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git modules-next | 9722 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git modules-next |
@@ -10950,7 +10943,7 @@ M: Willy Tarreau <willy@haproxy.com> | |||
10950 | M: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> | 10943 | M: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> |
10951 | S: Odd Fixes | 10944 | S: Odd Fixes |
10952 | F: Documentation/auxdisplay/lcd-panel-cgram.txt | 10945 | F: Documentation/auxdisplay/lcd-panel-cgram.txt |
10953 | F: drivers/misc/panel.c | 10946 | F: drivers/auxdisplay/panel.c |
10954 | 10947 | ||
10955 | PARALLEL PORT SUBSYSTEM | 10948 | PARALLEL PORT SUBSYSTEM |
10956 | M: Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 10949 | M: Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
@@ -11138,6 +11131,13 @@ F: include/uapi/linux/switchtec_ioctl.h | |||
11138 | F: include/linux/switchtec.h | 11131 | F: include/linux/switchtec.h |
11139 | F: drivers/ntb/hw/mscc/ | 11132 | F: drivers/ntb/hw/mscc/ |
11140 | 11133 | ||
11134 | PCI DRIVER FOR MOBIVEIL PCIE IP | ||
11135 | M: Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in> | ||
11136 | L: linux-pci@vger.kernel.org | ||
11137 | S: Supported | ||
11138 | F: Documentation/devicetree/bindings/pci/mobiveil-pcie.txt | ||
11139 | F: drivers/pci/controller/pcie-mobiveil.c | ||
11140 | |||
11141 | PCI DRIVER FOR MVEBU (Marvell Armada 370 and Armada XP SOC support) | 11141 | PCI DRIVER FOR MVEBU (Marvell Armada 370 and Armada XP SOC support) |
11142 | M: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 11142 | M: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> |
11143 | M: Jason Cooper <jason@lakedaemon.net> | 11143 | M: Jason Cooper <jason@lakedaemon.net> |
@@ -11204,8 +11204,14 @@ F: tools/pci/ | |||
11204 | 11204 | ||
11205 | PCI ENHANCED ERROR HANDLING (EEH) FOR POWERPC | 11205 | PCI ENHANCED ERROR HANDLING (EEH) FOR POWERPC |
11206 | M: Russell Currey <ruscur@russell.cc> | 11206 | M: Russell Currey <ruscur@russell.cc> |
11207 | M: Sam Bobroff <sbobroff@linux.ibm.com> | ||
11208 | M: Oliver O'Halloran <oohall@gmail.com> | ||
11207 | L: linuxppc-dev@lists.ozlabs.org | 11209 | L: linuxppc-dev@lists.ozlabs.org |
11208 | S: Supported | 11210 | S: Supported |
11211 | F: Documentation/PCI/pci-error-recovery.txt | ||
11212 | F: drivers/pci/pcie/aer.c | ||
11213 | F: drivers/pci/pcie/dpc.c | ||
11214 | F: drivers/pci/pcie/err.c | ||
11209 | F: Documentation/powerpc/eeh-pci-error-recovery.txt | 11215 | F: Documentation/powerpc/eeh-pci-error-recovery.txt |
11210 | F: arch/powerpc/kernel/eeh*.c | 11216 | F: arch/powerpc/kernel/eeh*.c |
11211 | F: arch/powerpc/platforms/*/eeh*.c | 11217 | F: arch/powerpc/platforms/*/eeh*.c |
@@ -15389,7 +15395,7 @@ S: Maintained | |||
15389 | UVESAFB DRIVER | 15395 | UVESAFB DRIVER |
15390 | M: Michal Januszewski <spock@gentoo.org> | 15396 | M: Michal Januszewski <spock@gentoo.org> |
15391 | L: linux-fbdev@vger.kernel.org | 15397 | L: linux-fbdev@vger.kernel.org |
15392 | W: http://dev.gentoo.org/~spock/projects/uvesafb/ | 15398 | W: https://github.com/mjanusz/v86d |
15393 | S: Maintained | 15399 | S: Maintained |
15394 | F: Documentation/fb/uvesafb.txt | 15400 | F: Documentation/fb/uvesafb.txt |
15395 | F: drivers/video/fbdev/uvesafb.* | 15401 | F: drivers/video/fbdev/uvesafb.* |
@@ -2,7 +2,7 @@ | |||
2 | VERSION = 4 | 2 | VERSION = 4 |
3 | PATCHLEVEL = 19 | 3 | PATCHLEVEL = 19 |
4 | SUBLEVEL = 0 | 4 | SUBLEVEL = 0 |
5 | EXTRAVERSION = -rc5 | 5 | EXTRAVERSION = -rc6 |
6 | NAME = Merciless Moray | 6 | NAME = Merciless Moray |
7 | 7 | ||
8 | # *DOCUMENTATION* | 8 | # *DOCUMENTATION* |
diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts index b10dccd0958f..3b1baa8605a7 100644 --- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts +++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "sama5d2-pinfunc.h" | 11 | #include "sama5d2-pinfunc.h" |
12 | #include <dt-bindings/mfd/atmel-flexcom.h> | 12 | #include <dt-bindings/mfd/atmel-flexcom.h> |
13 | #include <dt-bindings/gpio/gpio.h> | 13 | #include <dt-bindings/gpio/gpio.h> |
14 | #include <dt-bindings/pinctrl/at91.h> | ||
14 | 15 | ||
15 | / { | 16 | / { |
16 | model = "Atmel SAMA5D2 PTC EK"; | 17 | model = "Atmel SAMA5D2 PTC EK"; |
@@ -299,6 +300,7 @@ | |||
299 | <PIN_PA30__NWE_NANDWE>, | 300 | <PIN_PA30__NWE_NANDWE>, |
300 | <PIN_PB2__NRD_NANDOE>; | 301 | <PIN_PB2__NRD_NANDOE>; |
301 | bias-pull-up; | 302 | bias-pull-up; |
303 | atmel,drive-strength = <ATMEL_PIO_DRVSTR_ME>; | ||
302 | }; | 304 | }; |
303 | 305 | ||
304 | ale_cle_rdy_cs { | 306 | ale_cle_rdy_cs { |
diff --git a/arch/arm/boot/dts/bcm63138.dtsi b/arch/arm/boot/dts/bcm63138.dtsi index 43ee992ccdcf..6df61518776f 100644 --- a/arch/arm/boot/dts/bcm63138.dtsi +++ b/arch/arm/boot/dts/bcm63138.dtsi | |||
@@ -106,21 +106,23 @@ | |||
106 | global_timer: timer@1e200 { | 106 | global_timer: timer@1e200 { |
107 | compatible = "arm,cortex-a9-global-timer"; | 107 | compatible = "arm,cortex-a9-global-timer"; |
108 | reg = <0x1e200 0x20>; | 108 | reg = <0x1e200 0x20>; |
109 | interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>; | 109 | interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>; |
110 | clocks = <&axi_clk>; | 110 | clocks = <&axi_clk>; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | local_timer: local-timer@1e600 { | 113 | local_timer: local-timer@1e600 { |
114 | compatible = "arm,cortex-a9-twd-timer"; | 114 | compatible = "arm,cortex-a9-twd-timer"; |
115 | reg = <0x1e600 0x20>; | 115 | reg = <0x1e600 0x20>; |
116 | interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>; | 116 | interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | |
117 | IRQ_TYPE_EDGE_RISING)>; | ||
117 | clocks = <&axi_clk>; | 118 | clocks = <&axi_clk>; |
118 | }; | 119 | }; |
119 | 120 | ||
120 | twd_watchdog: watchdog@1e620 { | 121 | twd_watchdog: watchdog@1e620 { |
121 | compatible = "arm,cortex-a9-twd-wdt"; | 122 | compatible = "arm,cortex-a9-twd-wdt"; |
122 | reg = <0x1e620 0x20>; | 123 | reg = <0x1e620 0x20>; |
123 | interrupts = <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>; | 124 | interrupts = <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | |
125 | IRQ_TYPE_LEVEL_HIGH)>; | ||
124 | }; | 126 | }; |
125 | 127 | ||
126 | armpll: armpll { | 128 | armpll: armpll { |
@@ -158,7 +160,7 @@ | |||
158 | serial0: serial@600 { | 160 | serial0: serial@600 { |
159 | compatible = "brcm,bcm6345-uart"; | 161 | compatible = "brcm,bcm6345-uart"; |
160 | reg = <0x600 0x1b>; | 162 | reg = <0x600 0x1b>; |
161 | interrupts = <GIC_SPI 32 0>; | 163 | interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; |
162 | clocks = <&periph_clk>; | 164 | clocks = <&periph_clk>; |
163 | clock-names = "periph"; | 165 | clock-names = "periph"; |
164 | status = "disabled"; | 166 | status = "disabled"; |
@@ -167,7 +169,7 @@ | |||
167 | serial1: serial@620 { | 169 | serial1: serial@620 { |
168 | compatible = "brcm,bcm6345-uart"; | 170 | compatible = "brcm,bcm6345-uart"; |
169 | reg = <0x620 0x1b>; | 171 | reg = <0x620 0x1b>; |
170 | interrupts = <GIC_SPI 33 0>; | 172 | interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; |
171 | clocks = <&periph_clk>; | 173 | clocks = <&periph_clk>; |
172 | clock-names = "periph"; | 174 | clock-names = "periph"; |
173 | status = "disabled"; | 175 | status = "disabled"; |
@@ -180,7 +182,7 @@ | |||
180 | reg = <0x2000 0x600>, <0xf0 0x10>; | 182 | reg = <0x2000 0x600>, <0xf0 0x10>; |
181 | reg-names = "nand", "nand-int-base"; | 183 | reg-names = "nand", "nand-int-base"; |
182 | status = "disabled"; | 184 | status = "disabled"; |
183 | interrupts = <GIC_SPI 38 0>; | 185 | interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>; |
184 | interrupt-names = "nand"; | 186 | interrupt-names = "nand"; |
185 | }; | 187 | }; |
186 | 188 | ||
diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi index 661be948ab74..185541a5b69f 100644 --- a/arch/arm/boot/dts/stm32mp157c.dtsi +++ b/arch/arm/boot/dts/stm32mp157c.dtsi | |||
@@ -1078,8 +1078,8 @@ | |||
1078 | interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; | 1078 | interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; |
1079 | clocks = <&rcc SPI6_K>; | 1079 | clocks = <&rcc SPI6_K>; |
1080 | resets = <&rcc SPI6_R>; | 1080 | resets = <&rcc SPI6_R>; |
1081 | dmas = <&mdma1 34 0x0 0x40008 0x0 0x0 0>, | 1081 | dmas = <&mdma1 34 0x0 0x40008 0x0 0x0>, |
1082 | <&mdma1 35 0x0 0x40002 0x0 0x0 0>; | 1082 | <&mdma1 35 0x0 0x40002 0x0 0x0>; |
1083 | dma-names = "rx", "tx"; | 1083 | dma-names = "rx", "tx"; |
1084 | status = "disabled"; | 1084 | status = "disabled"; |
1085 | }; | 1085 | }; |
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi index ffd9f00f74a4..5f547c161baf 100644 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi | |||
@@ -800,8 +800,7 @@ | |||
800 | }; | 800 | }; |
801 | 801 | ||
802 | hdmi_phy: hdmi-phy@1ef0000 { | 802 | hdmi_phy: hdmi-phy@1ef0000 { |
803 | compatible = "allwinner,sun8i-r40-hdmi-phy", | 803 | compatible = "allwinner,sun8i-r40-hdmi-phy"; |
804 | "allwinner,sun50i-a64-hdmi-phy"; | ||
805 | reg = <0x01ef0000 0x10000>; | 804 | reg = <0x01ef0000 0x10000>; |
806 | clocks = <&ccu CLK_BUS_HDMI1>, <&ccu CLK_HDMI_SLOW>, | 805 | clocks = <&ccu CLK_BUS_HDMI1>, <&ccu CLK_HDMI_SLOW>, |
807 | <&ccu 7>, <&ccu 16>; | 806 | <&ccu 7>, <&ccu 16>; |
diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 07256b08226c..a6c9fbaeaefc 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c | |||
@@ -57,6 +57,45 @@ static u64 core_reg_offset_from_id(u64 id) | |||
57 | return id & ~(KVM_REG_ARCH_MASK | KVM_REG_SIZE_MASK | KVM_REG_ARM_CORE); | 57 | return id & ~(KVM_REG_ARCH_MASK | KVM_REG_SIZE_MASK | KVM_REG_ARM_CORE); |
58 | } | 58 | } |
59 | 59 | ||
60 | static int validate_core_offset(const struct kvm_one_reg *reg) | ||
61 | { | ||
62 | u64 off = core_reg_offset_from_id(reg->id); | ||
63 | int size; | ||
64 | |||
65 | switch (off) { | ||
66 | case KVM_REG_ARM_CORE_REG(regs.regs[0]) ... | ||
67 | KVM_REG_ARM_CORE_REG(regs.regs[30]): | ||
68 | case KVM_REG_ARM_CORE_REG(regs.sp): | ||
69 | case KVM_REG_ARM_CORE_REG(regs.pc): | ||
70 | case KVM_REG_ARM_CORE_REG(regs.pstate): | ||
71 | case KVM_REG_ARM_CORE_REG(sp_el1): | ||
72 | case KVM_REG_ARM_CORE_REG(elr_el1): | ||
73 | case KVM_REG_ARM_CORE_REG(spsr[0]) ... | ||
74 | KVM_REG_ARM_CORE_REG(spsr[KVM_NR_SPSR - 1]): | ||
75 | size = sizeof(__u64); | ||
76 | break; | ||
77 | |||
78 | case KVM_REG_ARM_CORE_REG(fp_regs.vregs[0]) ... | ||
79 | KVM_REG_ARM_CORE_REG(fp_regs.vregs[31]): | ||
80 | size = sizeof(__uint128_t); | ||
81 | break; | ||
82 | |||
83 | case KVM_REG_ARM_CORE_REG(fp_regs.fpsr): | ||
84 | case KVM_REG_ARM_CORE_REG(fp_regs.fpcr): | ||
85 | size = sizeof(__u32); | ||
86 | break; | ||
87 | |||
88 | default: | ||
89 | return -EINVAL; | ||
90 | } | ||
91 | |||
92 | if (KVM_REG_SIZE(reg->id) == size && | ||
93 | IS_ALIGNED(off, size / sizeof(__u32))) | ||
94 | return 0; | ||
95 | |||
96 | return -EINVAL; | ||
97 | } | ||
98 | |||
60 | static int get_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) | 99 | static int get_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) |
61 | { | 100 | { |
62 | /* | 101 | /* |
@@ -76,6 +115,9 @@ static int get_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) | |||
76 | (off + (KVM_REG_SIZE(reg->id) / sizeof(__u32))) >= nr_regs) | 115 | (off + (KVM_REG_SIZE(reg->id) / sizeof(__u32))) >= nr_regs) |
77 | return -ENOENT; | 116 | return -ENOENT; |
78 | 117 | ||
118 | if (validate_core_offset(reg)) | ||
119 | return -EINVAL; | ||
120 | |||
79 | if (copy_to_user(uaddr, ((u32 *)regs) + off, KVM_REG_SIZE(reg->id))) | 121 | if (copy_to_user(uaddr, ((u32 *)regs) + off, KVM_REG_SIZE(reg->id))) |
80 | return -EFAULT; | 122 | return -EFAULT; |
81 | 123 | ||
@@ -98,6 +140,9 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) | |||
98 | (off + (KVM_REG_SIZE(reg->id) / sizeof(__u32))) >= nr_regs) | 140 | (off + (KVM_REG_SIZE(reg->id) / sizeof(__u32))) >= nr_regs) |
99 | return -ENOENT; | 141 | return -ENOENT; |
100 | 142 | ||
143 | if (validate_core_offset(reg)) | ||
144 | return -EINVAL; | ||
145 | |||
101 | if (KVM_REG_SIZE(reg->id) > sizeof(tmp)) | 146 | if (KVM_REG_SIZE(reg->id) > sizeof(tmp)) |
102 | return -EINVAL; | 147 | return -EINVAL; |
103 | 148 | ||
@@ -107,17 +152,25 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) | |||
107 | } | 152 | } |
108 | 153 | ||
109 | if (off == KVM_REG_ARM_CORE_REG(regs.pstate)) { | 154 | if (off == KVM_REG_ARM_CORE_REG(regs.pstate)) { |
110 | u32 mode = (*(u32 *)valp) & PSR_AA32_MODE_MASK; | 155 | u64 mode = (*(u64 *)valp) & PSR_AA32_MODE_MASK; |
111 | switch (mode) { | 156 | switch (mode) { |
112 | case PSR_AA32_MODE_USR: | 157 | case PSR_AA32_MODE_USR: |
158 | if (!system_supports_32bit_el0()) | ||
159 | return -EINVAL; | ||
160 | break; | ||
113 | case PSR_AA32_MODE_FIQ: | 161 | case PSR_AA32_MODE_FIQ: |
114 | case PSR_AA32_MODE_IRQ: | 162 | case PSR_AA32_MODE_IRQ: |
115 | case PSR_AA32_MODE_SVC: | 163 | case PSR_AA32_MODE_SVC: |
116 | case PSR_AA32_MODE_ABT: | 164 | case PSR_AA32_MODE_ABT: |
117 | case PSR_AA32_MODE_UND: | 165 | case PSR_AA32_MODE_UND: |
166 | if (!vcpu_el1_is_32bit(vcpu)) | ||
167 | return -EINVAL; | ||
168 | break; | ||
118 | case PSR_MODE_EL0t: | 169 | case PSR_MODE_EL0t: |
119 | case PSR_MODE_EL1t: | 170 | case PSR_MODE_EL1t: |
120 | case PSR_MODE_EL1h: | 171 | case PSR_MODE_EL1h: |
172 | if (vcpu_el1_is_32bit(vcpu)) | ||
173 | return -EINVAL; | ||
121 | break; | 174 | break; |
122 | default: | 175 | default: |
123 | err = -EINVAL; | 176 | err = -EINVAL; |
diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 192b3ba07075..f58ea503ad01 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c | |||
@@ -117,11 +117,14 @@ static pte_t get_clear_flush(struct mm_struct *mm, | |||
117 | 117 | ||
118 | /* | 118 | /* |
119 | * If HW_AFDBM is enabled, then the HW could turn on | 119 | * If HW_AFDBM is enabled, then the HW could turn on |
120 | * the dirty bit for any page in the set, so check | 120 | * the dirty or accessed bit for any page in the set, |
121 | * them all. All hugetlb entries are already young. | 121 | * so check them all. |
122 | */ | 122 | */ |
123 | if (pte_dirty(pte)) | 123 | if (pte_dirty(pte)) |
124 | orig_pte = pte_mkdirty(orig_pte); | 124 | orig_pte = pte_mkdirty(orig_pte); |
125 | |||
126 | if (pte_young(pte)) | ||
127 | orig_pte = pte_mkyoung(orig_pte); | ||
125 | } | 128 | } |
126 | 129 | ||
127 | if (valid) { | 130 | if (valid) { |
@@ -320,11 +323,40 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, | |||
320 | return get_clear_flush(mm, addr, ptep, pgsize, ncontig); | 323 | return get_clear_flush(mm, addr, ptep, pgsize, ncontig); |
321 | } | 324 | } |
322 | 325 | ||
326 | /* | ||
327 | * huge_ptep_set_access_flags will update access flags (dirty, accesssed) | ||
328 | * and write permission. | ||
329 | * | ||
330 | * For a contiguous huge pte range we need to check whether or not write | ||
331 | * permission has to change only on the first pte in the set. Then for | ||
332 | * all the contiguous ptes we need to check whether or not there is a | ||
333 | * discrepancy between dirty or young. | ||
334 | */ | ||
335 | static int __cont_access_flags_changed(pte_t *ptep, pte_t pte, int ncontig) | ||
336 | { | ||
337 | int i; | ||
338 | |||
339 | if (pte_write(pte) != pte_write(huge_ptep_get(ptep))) | ||
340 | return 1; | ||
341 | |||
342 | for (i = 0; i < ncontig; i++) { | ||
343 | pte_t orig_pte = huge_ptep_get(ptep + i); | ||
344 | |||
345 | if (pte_dirty(pte) != pte_dirty(orig_pte)) | ||
346 | return 1; | ||
347 | |||
348 | if (pte_young(pte) != pte_young(orig_pte)) | ||
349 | return 1; | ||
350 | } | ||
351 | |||
352 | return 0; | ||
353 | } | ||
354 | |||
323 | int huge_ptep_set_access_flags(struct vm_area_struct *vma, | 355 | int huge_ptep_set_access_flags(struct vm_area_struct *vma, |
324 | unsigned long addr, pte_t *ptep, | 356 | unsigned long addr, pte_t *ptep, |
325 | pte_t pte, int dirty) | 357 | pte_t pte, int dirty) |
326 | { | 358 | { |
327 | int ncontig, i, changed = 0; | 359 | int ncontig, i; |
328 | size_t pgsize = 0; | 360 | size_t pgsize = 0; |
329 | unsigned long pfn = pte_pfn(pte), dpfn; | 361 | unsigned long pfn = pte_pfn(pte), dpfn; |
330 | pgprot_t hugeprot; | 362 | pgprot_t hugeprot; |
@@ -336,19 +368,23 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma, | |||
336 | ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize); | 368 | ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize); |
337 | dpfn = pgsize >> PAGE_SHIFT; | 369 | dpfn = pgsize >> PAGE_SHIFT; |
338 | 370 | ||
371 | if (!__cont_access_flags_changed(ptep, pte, ncontig)) | ||
372 | return 0; | ||
373 | |||
339 | orig_pte = get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig); | 374 | orig_pte = get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig); |
340 | if (!pte_same(orig_pte, pte)) | ||
341 | changed = 1; | ||
342 | 375 | ||
343 | /* Make sure we don't lose the dirty state */ | 376 | /* Make sure we don't lose the dirty or young state */ |
344 | if (pte_dirty(orig_pte)) | 377 | if (pte_dirty(orig_pte)) |
345 | pte = pte_mkdirty(pte); | 378 | pte = pte_mkdirty(pte); |
346 | 379 | ||
380 | if (pte_young(orig_pte)) | ||
381 | pte = pte_mkyoung(pte); | ||
382 | |||
347 | hugeprot = pte_pgprot(pte); | 383 | hugeprot = pte_pgprot(pte); |
348 | for (i = 0; i < ncontig; i++, ptep++, addr += pgsize, pfn += dpfn) | 384 | for (i = 0; i < ncontig; i++, ptep++, addr += pgsize, pfn += dpfn) |
349 | set_pte_at(vma->vm_mm, addr, ptep, pfn_pte(pfn, hugeprot)); | 385 | set_pte_at(vma->vm_mm, addr, ptep, pfn_pte(pfn, hugeprot)); |
350 | 386 | ||
351 | return changed; | 387 | return 1; |
352 | } | 388 | } |
353 | 389 | ||
354 | void huge_ptep_set_wrprotect(struct mm_struct *mm, | 390 | void huge_ptep_set_wrprotect(struct mm_struct *mm, |
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h index 1a951b00465d..1fffbba8d6a5 100644 --- a/arch/powerpc/include/asm/setup.h +++ b/arch/powerpc/include/asm/setup.h | |||
@@ -9,6 +9,7 @@ extern void ppc_printk_progress(char *s, unsigned short hex); | |||
9 | 9 | ||
10 | extern unsigned int rtas_data; | 10 | extern unsigned int rtas_data; |
11 | extern unsigned long long memory_limit; | 11 | extern unsigned long long memory_limit; |
12 | extern bool init_mem_is_free; | ||
12 | extern unsigned long klimit; | 13 | extern unsigned long klimit; |
13 | extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); | 14 | extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); |
14 | 15 | ||
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index ea04dfb8c092..2d8fc8c9da7a 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -1314,9 +1314,7 @@ EXC_REAL_BEGIN(denorm_exception_hv, 0x1500, 0x100) | |||
1314 | 1314 | ||
1315 | #ifdef CONFIG_PPC_DENORMALISATION | 1315 | #ifdef CONFIG_PPC_DENORMALISATION |
1316 | mfspr r10,SPRN_HSRR1 | 1316 | mfspr r10,SPRN_HSRR1 |
1317 | mfspr r11,SPRN_HSRR0 /* save HSRR0 */ | ||
1318 | andis. r10,r10,(HSRR1_DENORM)@h /* denorm? */ | 1317 | andis. r10,r10,(HSRR1_DENORM)@h /* denorm? */ |
1319 | addi r11,r11,-4 /* HSRR0 is next instruction */ | ||
1320 | bne+ denorm_assist | 1318 | bne+ denorm_assist |
1321 | #endif | 1319 | #endif |
1322 | 1320 | ||
@@ -1382,6 +1380,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) | |||
1382 | */ | 1380 | */ |
1383 | XVCPSGNDP32(32) | 1381 | XVCPSGNDP32(32) |
1384 | denorm_done: | 1382 | denorm_done: |
1383 | mfspr r11,SPRN_HSRR0 | ||
1384 | subi r11,r11,4 | ||
1385 | mtspr SPRN_HSRR0,r11 | 1385 | mtspr SPRN_HSRR0,r11 |
1386 | mtcrf 0x80,r9 | 1386 | mtcrf 0x80,r9 |
1387 | ld r9,PACA_EXGEN+EX_R9(r13) | 1387 | ld r9,PACA_EXGEN+EX_R9(r13) |
diff --git a/arch/powerpc/kernel/tm.S b/arch/powerpc/kernel/tm.S index 6bffbc5affe7..7716374786bd 100644 --- a/arch/powerpc/kernel/tm.S +++ b/arch/powerpc/kernel/tm.S | |||
@@ -176,13 +176,27 @@ _GLOBAL(tm_reclaim) | |||
176 | std r1, PACATMSCRATCH(r13) | 176 | std r1, PACATMSCRATCH(r13) |
177 | ld r1, PACAR1(r13) | 177 | ld r1, PACAR1(r13) |
178 | 178 | ||
179 | /* Store the PPR in r11 and reset to decent value */ | ||
180 | std r11, GPR11(r1) /* Temporary stash */ | 179 | std r11, GPR11(r1) /* Temporary stash */ |
181 | 180 | ||
181 | /* | ||
182 | * Move the saved user r1 to the kernel stack in case PACATMSCRATCH is | ||
183 | * clobbered by an exception once we turn on MSR_RI below. | ||
184 | */ | ||
185 | ld r11, PACATMSCRATCH(r13) | ||
186 | std r11, GPR1(r1) | ||
187 | |||
188 | /* | ||
189 | * Store r13 away so we can free up the scratch SPR for the SLB fault | ||
190 | * handler (needed once we start accessing the thread_struct). | ||
191 | */ | ||
192 | GET_SCRATCH0(r11) | ||
193 | std r11, GPR13(r1) | ||
194 | |||
182 | /* Reset MSR RI so we can take SLB faults again */ | 195 | /* Reset MSR RI so we can take SLB faults again */ |
183 | li r11, MSR_RI | 196 | li r11, MSR_RI |
184 | mtmsrd r11, 1 | 197 | mtmsrd r11, 1 |
185 | 198 | ||
199 | /* Store the PPR in r11 and reset to decent value */ | ||
186 | mfspr r11, SPRN_PPR | 200 | mfspr r11, SPRN_PPR |
187 | HMT_MEDIUM | 201 | HMT_MEDIUM |
188 | 202 | ||
@@ -207,11 +221,11 @@ _GLOBAL(tm_reclaim) | |||
207 | SAVE_GPR(8, r7) /* user r8 */ | 221 | SAVE_GPR(8, r7) /* user r8 */ |
208 | SAVE_GPR(9, r7) /* user r9 */ | 222 | SAVE_GPR(9, r7) /* user r9 */ |
209 | SAVE_GPR(10, r7) /* user r10 */ | 223 | SAVE_GPR(10, r7) /* user r10 */ |
210 | ld r3, PACATMSCRATCH(r13) /* user r1 */ | 224 | ld r3, GPR1(r1) /* user r1 */ |
211 | ld r4, GPR7(r1) /* user r7 */ | 225 | ld r4, GPR7(r1) /* user r7 */ |
212 | ld r5, GPR11(r1) /* user r11 */ | 226 | ld r5, GPR11(r1) /* user r11 */ |
213 | ld r6, GPR12(r1) /* user r12 */ | 227 | ld r6, GPR12(r1) /* user r12 */ |
214 | GET_SCRATCH0(8) /* user r13 */ | 228 | ld r8, GPR13(r1) /* user r13 */ |
215 | std r3, GPR1(r7) | 229 | std r3, GPR1(r7) |
216 | std r4, GPR7(r7) | 230 | std r4, GPR7(r7) |
217 | std r5, GPR11(r7) | 231 | std r5, GPR11(r7) |
diff --git a/arch/powerpc/lib/checksum_64.S b/arch/powerpc/lib/checksum_64.S index 886ed94b9c13..d05c8af4ac51 100644 --- a/arch/powerpc/lib/checksum_64.S +++ b/arch/powerpc/lib/checksum_64.S | |||
@@ -443,6 +443,9 @@ _GLOBAL(csum_ipv6_magic) | |||
443 | addc r0, r8, r9 | 443 | addc r0, r8, r9 |
444 | ld r10, 0(r4) | 444 | ld r10, 0(r4) |
445 | ld r11, 8(r4) | 445 | ld r11, 8(r4) |
446 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
447 | rotldi r5, r5, 8 | ||
448 | #endif | ||
446 | adde r0, r0, r10 | 449 | adde r0, r0, r10 |
447 | add r5, r5, r7 | 450 | add r5, r5, r7 |
448 | adde r0, r0, r11 | 451 | adde r0, r0, r11 |
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index 850f3b8f4da5..6ae2777c220d 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c | |||
@@ -28,6 +28,12 @@ static int __patch_instruction(unsigned int *exec_addr, unsigned int instr, | |||
28 | { | 28 | { |
29 | int err; | 29 | int err; |
30 | 30 | ||
31 | /* Make sure we aren't patching a freed init section */ | ||
32 | if (init_mem_is_free && init_section_contains(exec_addr, 4)) { | ||
33 | pr_debug("Skipping init section patching addr: 0x%px\n", exec_addr); | ||
34 | return 0; | ||
35 | } | ||
36 | |||
31 | __put_user_size(instr, patch_addr, 4, err); | 37 | __put_user_size(instr, patch_addr, 4, err); |
32 | if (err) | 38 | if (err) |
33 | return err; | 39 | return err; |
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 5c8530d0c611..04ccb274a620 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | unsigned long long memory_limit; | 65 | unsigned long long memory_limit; |
66 | bool init_mem_is_free; | ||
66 | 67 | ||
67 | #ifdef CONFIG_HIGHMEM | 68 | #ifdef CONFIG_HIGHMEM |
68 | pte_t *kmap_pte; | 69 | pte_t *kmap_pte; |
@@ -396,6 +397,7 @@ void free_initmem(void) | |||
396 | { | 397 | { |
397 | ppc_md.progress = ppc_printk_progress; | 398 | ppc_md.progress = ppc_printk_progress; |
398 | mark_initmem_nx(); | 399 | mark_initmem_nx(); |
400 | init_mem_is_free = true; | ||
399 | free_initmem_default(POISON_FREE_INITMEM); | 401 | free_initmem_default(POISON_FREE_INITMEM); |
400 | } | 402 | } |
401 | 403 | ||
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 35ac5422903a..59d07bd5374a 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -1204,7 +1204,9 @@ int find_and_online_cpu_nid(int cpu) | |||
1204 | int new_nid; | 1204 | int new_nid; |
1205 | 1205 | ||
1206 | /* Use associativity from first thread for all siblings */ | 1206 | /* Use associativity from first thread for all siblings */ |
1207 | vphn_get_associativity(cpu, associativity); | 1207 | if (vphn_get_associativity(cpu, associativity)) |
1208 | return cpu_to_node(cpu); | ||
1209 | |||
1208 | new_nid = associativity_to_nid(associativity); | 1210 | new_nid = associativity_to_nid(associativity); |
1209 | if (new_nid < 0 || !node_possible(new_nid)) | 1211 | if (new_nid < 0 || !node_possible(new_nid)) |
1210 | new_nid = first_online_node; | 1212 | new_nid = first_online_node; |
@@ -1452,7 +1454,8 @@ static struct timer_list topology_timer; | |||
1452 | 1454 | ||
1453 | static void reset_topology_timer(void) | 1455 | static void reset_topology_timer(void) |
1454 | { | 1456 | { |
1455 | mod_timer(&topology_timer, jiffies + topology_timer_secs * HZ); | 1457 | if (vphn_enabled) |
1458 | mod_timer(&topology_timer, jiffies + topology_timer_secs * HZ); | ||
1456 | } | 1459 | } |
1457 | 1460 | ||
1458 | #ifdef CONFIG_SMP | 1461 | #ifdef CONFIG_SMP |
diff --git a/arch/powerpc/mm/pkeys.c b/arch/powerpc/mm/pkeys.c index 333b1f80c435..b271b283c785 100644 --- a/arch/powerpc/mm/pkeys.c +++ b/arch/powerpc/mm/pkeys.c | |||
@@ -45,7 +45,7 @@ static void scan_pkey_feature(void) | |||
45 | * Since any pkey can be used for data or execute, we will just treat | 45 | * Since any pkey can be used for data or execute, we will just treat |
46 | * all keys as equal and track them as one entity. | 46 | * all keys as equal and track them as one entity. |
47 | */ | 47 | */ |
48 | pkeys_total = be32_to_cpu(vals[0]); | 48 | pkeys_total = vals[0]; |
49 | pkeys_devtree_defined = true; | 49 | pkeys_devtree_defined = true; |
50 | } | 50 | } |
51 | 51 | ||
diff --git a/arch/powerpc/platforms/powernv/pci-ioda-tce.c b/arch/powerpc/platforms/powernv/pci-ioda-tce.c index 6c5db1acbe8d..fe9691040f54 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda-tce.c +++ b/arch/powerpc/platforms/powernv/pci-ioda-tce.c | |||
@@ -276,7 +276,7 @@ long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset, | |||
276 | level_shift = entries_shift + 3; | 276 | level_shift = entries_shift + 3; |
277 | level_shift = max_t(unsigned int, level_shift, PAGE_SHIFT); | 277 | level_shift = max_t(unsigned int, level_shift, PAGE_SHIFT); |
278 | 278 | ||
279 | if ((level_shift - 3) * levels + page_shift >= 60) | 279 | if ((level_shift - 3) * levels + page_shift >= 55) |
280 | return -EINVAL; | 280 | return -EINVAL; |
281 | 281 | ||
282 | /* Allocate TCE table */ | 282 | /* Allocate TCE table */ |
diff --git a/arch/riscv/include/asm/asm-prototypes.h b/arch/riscv/include/asm/asm-prototypes.h new file mode 100644 index 000000000000..c9fecd120d18 --- /dev/null +++ b/arch/riscv/include/asm/asm-prototypes.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
2 | #ifndef _ASM_RISCV_PROTOTYPES_H | ||
3 | |||
4 | #include <linux/ftrace.h> | ||
5 | #include <asm-generic/asm-prototypes.h> | ||
6 | |||
7 | #endif /* _ASM_RISCV_PROTOTYPES_H */ | ||
diff --git a/arch/x86/boot/compressed/mem_encrypt.S b/arch/x86/boot/compressed/mem_encrypt.S index eaa843a52907..a480356e0ed8 100644 --- a/arch/x86/boot/compressed/mem_encrypt.S +++ b/arch/x86/boot/compressed/mem_encrypt.S | |||
@@ -25,20 +25,6 @@ ENTRY(get_sev_encryption_bit) | |||
25 | push %ebx | 25 | push %ebx |
26 | push %ecx | 26 | push %ecx |
27 | push %edx | 27 | push %edx |
28 | push %edi | ||
29 | |||
30 | /* | ||
31 | * RIP-relative addressing is needed to access the encryption bit | ||
32 | * variable. Since we are running in 32-bit mode we need this call/pop | ||
33 | * sequence to get the proper relative addressing. | ||
34 | */ | ||
35 | call 1f | ||
36 | 1: popl %edi | ||
37 | subl $1b, %edi | ||
38 | |||
39 | movl enc_bit(%edi), %eax | ||
40 | cmpl $0, %eax | ||
41 | jge .Lsev_exit | ||
42 | 28 | ||
43 | /* Check if running under a hypervisor */ | 29 | /* Check if running under a hypervisor */ |
44 | movl $1, %eax | 30 | movl $1, %eax |
@@ -69,15 +55,12 @@ ENTRY(get_sev_encryption_bit) | |||
69 | 55 | ||
70 | movl %ebx, %eax | 56 | movl %ebx, %eax |
71 | andl $0x3f, %eax /* Return the encryption bit location */ | 57 | andl $0x3f, %eax /* Return the encryption bit location */ |
72 | movl %eax, enc_bit(%edi) | ||
73 | jmp .Lsev_exit | 58 | jmp .Lsev_exit |
74 | 59 | ||
75 | .Lno_sev: | 60 | .Lno_sev: |
76 | xor %eax, %eax | 61 | xor %eax, %eax |
77 | movl %eax, enc_bit(%edi) | ||
78 | 62 | ||
79 | .Lsev_exit: | 63 | .Lsev_exit: |
80 | pop %edi | ||
81 | pop %edx | 64 | pop %edx |
82 | pop %ecx | 65 | pop %ecx |
83 | pop %ebx | 66 | pop %ebx |
@@ -113,8 +96,6 @@ ENTRY(set_sev_encryption_mask) | |||
113 | ENDPROC(set_sev_encryption_mask) | 96 | ENDPROC(set_sev_encryption_mask) |
114 | 97 | ||
115 | .data | 98 | .data |
116 | enc_bit: | ||
117 | .int 0xffffffff | ||
118 | 99 | ||
119 | #ifdef CONFIG_AMD_MEM_ENCRYPT | 100 | #ifdef CONFIG_AMD_MEM_ENCRYPT |
120 | .balign 8 | 101 | .balign 8 |
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 94e1ed667b6e..41317c50a446 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c | |||
@@ -322,16 +322,11 @@ void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_iter_fn *fn, | |||
322 | 322 | ||
323 | /* | 323 | /* |
324 | * __blk_mq_update_nr_hw_queues will update the nr_hw_queues and | 324 | * __blk_mq_update_nr_hw_queues will update the nr_hw_queues and |
325 | * queue_hw_ctx after freeze the queue. So we could use q_usage_counter | 325 | * queue_hw_ctx after freeze the queue, so we use q_usage_counter |
326 | * to avoid race with it. __blk_mq_update_nr_hw_queues will users | 326 | * to avoid race with it. |
327 | * synchronize_rcu to ensure all of the users go out of the critical | ||
328 | * section below and see zeroed q_usage_counter. | ||
329 | */ | 327 | */ |
330 | rcu_read_lock(); | 328 | if (!percpu_ref_tryget(&q->q_usage_counter)) |
331 | if (percpu_ref_is_zero(&q->q_usage_counter)) { | ||
332 | rcu_read_unlock(); | ||
333 | return; | 329 | return; |
334 | } | ||
335 | 330 | ||
336 | queue_for_each_hw_ctx(q, hctx, i) { | 331 | queue_for_each_hw_ctx(q, hctx, i) { |
337 | struct blk_mq_tags *tags = hctx->tags; | 332 | struct blk_mq_tags *tags = hctx->tags; |
@@ -347,7 +342,7 @@ void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_iter_fn *fn, | |||
347 | bt_for_each(hctx, &tags->breserved_tags, fn, priv, true); | 342 | bt_for_each(hctx, &tags->breserved_tags, fn, priv, true); |
348 | bt_for_each(hctx, &tags->bitmap_tags, fn, priv, false); | 343 | bt_for_each(hctx, &tags->bitmap_tags, fn, priv, false); |
349 | } | 344 | } |
350 | rcu_read_unlock(); | 345 | blk_queue_exit(q); |
351 | } | 346 | } |
352 | 347 | ||
353 | static int bt_alloc(struct sbitmap_queue *bt, unsigned int depth, | 348 | static int bt_alloc(struct sbitmap_queue *bt, unsigned int depth, |
diff --git a/block/blk-mq.c b/block/blk-mq.c index 85a1c1a59c72..e3c39ea8e17b 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -1628,7 +1628,7 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule) | |||
1628 | BUG_ON(!rq->q); | 1628 | BUG_ON(!rq->q); |
1629 | if (rq->mq_ctx != this_ctx) { | 1629 | if (rq->mq_ctx != this_ctx) { |
1630 | if (this_ctx) { | 1630 | if (this_ctx) { |
1631 | trace_block_unplug(this_q, depth, from_schedule); | 1631 | trace_block_unplug(this_q, depth, !from_schedule); |
1632 | blk_mq_sched_insert_requests(this_q, this_ctx, | 1632 | blk_mq_sched_insert_requests(this_q, this_ctx, |
1633 | &ctx_list, | 1633 | &ctx_list, |
1634 | from_schedule); | 1634 | from_schedule); |
@@ -1648,7 +1648,7 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule) | |||
1648 | * on 'ctx_list'. Do those. | 1648 | * on 'ctx_list'. Do those. |
1649 | */ | 1649 | */ |
1650 | if (this_ctx) { | 1650 | if (this_ctx) { |
1651 | trace_block_unplug(this_q, depth, from_schedule); | 1651 | trace_block_unplug(this_q, depth, !from_schedule); |
1652 | blk_mq_sched_insert_requests(this_q, this_ctx, &ctx_list, | 1652 | blk_mq_sched_insert_requests(this_q, this_ctx, &ctx_list, |
1653 | from_schedule); | 1653 | from_schedule); |
1654 | } | 1654 | } |
diff --git a/block/elevator.c b/block/elevator.c index 6a06b5d040e5..fae58b2f906f 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -609,7 +609,7 @@ void elv_drain_elevator(struct request_queue *q) | |||
609 | 609 | ||
610 | while (e->type->ops.sq.elevator_dispatch_fn(q, 1)) | 610 | while (e->type->ops.sq.elevator_dispatch_fn(q, 1)) |
611 | ; | 611 | ; |
612 | if (q->nr_sorted && printed++ < 10) { | 612 | if (q->nr_sorted && !blk_queue_is_zoned(q) && printed++ < 10 ) { |
613 | printk(KERN_ERR "%s: forced dispatching is broken " | 613 | printk(KERN_ERR "%s: forced dispatching is broken " |
614 | "(nr_sorted=%u), please report this\n", | 614 | "(nr_sorted=%u), please report this\n", |
615 | q->elevator->type->elevator_name, q->nr_sorted); | 615 | q->elevator->type->elevator_name, q->nr_sorted); |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index a71d817e900d..429d20131c7e 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -2670,8 +2670,8 @@ static void purge_persistent_grants(struct blkfront_info *info) | |||
2670 | list_del(&gnt_list_entry->node); | 2670 | list_del(&gnt_list_entry->node); |
2671 | gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL); | 2671 | gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL); |
2672 | rinfo->persistent_gnts_c--; | 2672 | rinfo->persistent_gnts_c--; |
2673 | __free_page(gnt_list_entry->page); | 2673 | gnt_list_entry->gref = GRANT_INVALID_REF; |
2674 | kfree(gnt_list_entry); | 2674 | list_add_tail(&gnt_list_entry->node, &rinfo->grants); |
2675 | } | 2675 | } |
2676 | 2676 | ||
2677 | spin_unlock_irqrestore(&rinfo->ring_lock, flags); | 2677 | spin_unlock_irqrestore(&rinfo->ring_lock, flags); |
diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c index ec8a4376f74f..2fab18fae4fc 100644 --- a/drivers/clocksource/timer-atmel-pit.c +++ b/drivers/clocksource/timer-atmel-pit.c | |||
@@ -180,26 +180,29 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node) | |||
180 | data->base = of_iomap(node, 0); | 180 | data->base = of_iomap(node, 0); |
181 | if (!data->base) { | 181 | if (!data->base) { |
182 | pr_err("Could not map PIT address\n"); | 182 | pr_err("Could not map PIT address\n"); |
183 | return -ENXIO; | 183 | ret = -ENXIO; |
184 | goto exit; | ||
184 | } | 185 | } |
185 | 186 | ||
186 | data->mck = of_clk_get(node, 0); | 187 | data->mck = of_clk_get(node, 0); |
187 | if (IS_ERR(data->mck)) { | 188 | if (IS_ERR(data->mck)) { |
188 | pr_err("Unable to get mck clk\n"); | 189 | pr_err("Unable to get mck clk\n"); |
189 | return PTR_ERR(data->mck); | 190 | ret = PTR_ERR(data->mck); |
191 | goto exit; | ||
190 | } | 192 | } |
191 | 193 | ||
192 | ret = clk_prepare_enable(data->mck); | 194 | ret = clk_prepare_enable(data->mck); |
193 | if (ret) { | 195 | if (ret) { |
194 | pr_err("Unable to enable mck\n"); | 196 | pr_err("Unable to enable mck\n"); |
195 | return ret; | 197 | goto exit; |
196 | } | 198 | } |
197 | 199 | ||
198 | /* Get the interrupts property */ | 200 | /* Get the interrupts property */ |
199 | data->irq = irq_of_parse_and_map(node, 0); | 201 | data->irq = irq_of_parse_and_map(node, 0); |
200 | if (!data->irq) { | 202 | if (!data->irq) { |
201 | pr_err("Unable to get IRQ from DT\n"); | 203 | pr_err("Unable to get IRQ from DT\n"); |
202 | return -EINVAL; | 204 | ret = -EINVAL; |
205 | goto exit; | ||
203 | } | 206 | } |
204 | 207 | ||
205 | /* | 208 | /* |
@@ -227,7 +230,7 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node) | |||
227 | ret = clocksource_register_hz(&data->clksrc, pit_rate); | 230 | ret = clocksource_register_hz(&data->clksrc, pit_rate); |
228 | if (ret) { | 231 | if (ret) { |
229 | pr_err("Failed to register clocksource\n"); | 232 | pr_err("Failed to register clocksource\n"); |
230 | return ret; | 233 | goto exit; |
231 | } | 234 | } |
232 | 235 | ||
233 | /* Set up irq handler */ | 236 | /* Set up irq handler */ |
@@ -236,7 +239,8 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node) | |||
236 | "at91_tick", data); | 239 | "at91_tick", data); |
237 | if (ret) { | 240 | if (ret) { |
238 | pr_err("Unable to setup IRQ\n"); | 241 | pr_err("Unable to setup IRQ\n"); |
239 | return ret; | 242 | clocksource_unregister(&data->clksrc); |
243 | goto exit; | ||
240 | } | 244 | } |
241 | 245 | ||
242 | /* Set up and register clockevents */ | 246 | /* Set up and register clockevents */ |
@@ -254,6 +258,10 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node) | |||
254 | clockevents_register_device(&data->clkevt); | 258 | clockevents_register_device(&data->clkevt); |
255 | 259 | ||
256 | return 0; | 260 | return 0; |
261 | |||
262 | exit: | ||
263 | kfree(data); | ||
264 | return ret; | ||
257 | } | 265 | } |
258 | TIMER_OF_DECLARE(at91sam926x_pit, "atmel,at91sam9260-pit", | 266 | TIMER_OF_DECLARE(at91sam926x_pit, "atmel,at91sam9260-pit", |
259 | at91sam926x_pit_dt_init); | 267 | at91sam926x_pit_dt_init); |
diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index c020038ebfab..cf93f6419b51 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c | |||
@@ -130,13 +130,17 @@ static int fttmr010_timer_set_next_event(unsigned long cycles, | |||
130 | cr &= ~fttmr010->t1_enable_val; | 130 | cr &= ~fttmr010->t1_enable_val; |
131 | writel(cr, fttmr010->base + TIMER_CR); | 131 | writel(cr, fttmr010->base + TIMER_CR); |
132 | 132 | ||
133 | /* Setup the match register forward/backward in time */ | 133 | if (fttmr010->count_down) { |
134 | cr = readl(fttmr010->base + TIMER1_COUNT); | 134 | /* |
135 | if (fttmr010->count_down) | 135 | * ASPEED Timer Controller will load TIMER1_LOAD register |
136 | cr -= cycles; | 136 | * into TIMER1_COUNT register when the timer is re-enabled. |
137 | else | 137 | */ |
138 | cr += cycles; | 138 | writel(cycles, fttmr010->base + TIMER1_LOAD); |
139 | writel(cr, fttmr010->base + TIMER1_MATCH1); | 139 | } else { |
140 | /* Setup the match register forward in time */ | ||
141 | cr = readl(fttmr010->base + TIMER1_COUNT); | ||
142 | writel(cr + cycles, fttmr010->base + TIMER1_MATCH1); | ||
143 | } | ||
140 | 144 | ||
141 | /* Start */ | 145 | /* Start */ |
142 | cr = readl(fttmr010->base + TIMER_CR); | 146 | cr = readl(fttmr010->base + TIMER_CR); |
diff --git a/drivers/clocksource/timer-ti-32k.c b/drivers/clocksource/timer-ti-32k.c index 29e2e1a78a43..6949a9113dbb 100644 --- a/drivers/clocksource/timer-ti-32k.c +++ b/drivers/clocksource/timer-ti-32k.c | |||
@@ -97,6 +97,9 @@ static int __init ti_32k_timer_init(struct device_node *np) | |||
97 | return -ENXIO; | 97 | return -ENXIO; |
98 | } | 98 | } |
99 | 99 | ||
100 | if (!of_machine_is_compatible("ti,am43")) | ||
101 | ti_32k_timer.cs.flags |= CLOCK_SOURCE_SUSPEND_NONSTOP; | ||
102 | |||
100 | ti_32k_timer.counter = ti_32k_timer.base; | 103 | ti_32k_timer.counter = ti_32k_timer.base; |
101 | 104 | ||
102 | /* | 105 | /* |
diff --git a/drivers/cpufreq/qcom-cpufreq-kryo.c b/drivers/cpufreq/qcom-cpufreq-kryo.c index a1830fa25fc5..2a3675c24032 100644 --- a/drivers/cpufreq/qcom-cpufreq-kryo.c +++ b/drivers/cpufreq/qcom-cpufreq-kryo.c | |||
@@ -44,7 +44,7 @@ enum _msm8996_version { | |||
44 | 44 | ||
45 | struct platform_device *cpufreq_dt_pdev, *kryo_cpufreq_pdev; | 45 | struct platform_device *cpufreq_dt_pdev, *kryo_cpufreq_pdev; |
46 | 46 | ||
47 | static enum _msm8996_version __init qcom_cpufreq_kryo_get_msm_id(void) | 47 | static enum _msm8996_version qcom_cpufreq_kryo_get_msm_id(void) |
48 | { | 48 | { |
49 | size_t len; | 49 | size_t len; |
50 | u32 *msm_id; | 50 | u32 *msm_id; |
@@ -222,7 +222,7 @@ static int __init qcom_cpufreq_kryo_init(void) | |||
222 | } | 222 | } |
223 | module_init(qcom_cpufreq_kryo_init); | 223 | module_init(qcom_cpufreq_kryo_init); |
224 | 224 | ||
225 | static void __init qcom_cpufreq_kryo_exit(void) | 225 | static void __exit qcom_cpufreq_kryo_exit(void) |
226 | { | 226 | { |
227 | platform_device_unregister(kryo_cpufreq_pdev); | 227 | platform_device_unregister(kryo_cpufreq_pdev); |
228 | platform_driver_unregister(&qcom_cpufreq_kryo_driver); | 228 | platform_driver_unregister(&qcom_cpufreq_kryo_driver); |
diff --git a/drivers/dax/device.c b/drivers/dax/device.c index bbe4d72ca105..948806e57cee 100644 --- a/drivers/dax/device.c +++ b/drivers/dax/device.c | |||
@@ -535,6 +535,11 @@ static unsigned long dax_get_unmapped_area(struct file *filp, | |||
535 | return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags); | 535 | return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags); |
536 | } | 536 | } |
537 | 537 | ||
538 | static const struct address_space_operations dev_dax_aops = { | ||
539 | .set_page_dirty = noop_set_page_dirty, | ||
540 | .invalidatepage = noop_invalidatepage, | ||
541 | }; | ||
542 | |||
538 | static int dax_open(struct inode *inode, struct file *filp) | 543 | static int dax_open(struct inode *inode, struct file *filp) |
539 | { | 544 | { |
540 | struct dax_device *dax_dev = inode_dax(inode); | 545 | struct dax_device *dax_dev = inode_dax(inode); |
@@ -544,6 +549,7 @@ static int dax_open(struct inode *inode, struct file *filp) | |||
544 | dev_dbg(&dev_dax->dev, "trace\n"); | 549 | dev_dbg(&dev_dax->dev, "trace\n"); |
545 | inode->i_mapping = __dax_inode->i_mapping; | 550 | inode->i_mapping = __dax_inode->i_mapping; |
546 | inode->i_mapping->host = __dax_inode; | 551 | inode->i_mapping->host = __dax_inode; |
552 | inode->i_mapping->a_ops = &dev_dax_aops; | ||
547 | filp->f_mapping = inode->i_mapping; | 553 | filp->f_mapping = inode->i_mapping; |
548 | filp->f_wb_err = filemap_sample_wb_err(filp->f_mapping); | 554 | filp->f_wb_err = filemap_sample_wb_err(filp->f_mapping); |
549 | filp->private_data = dev_dax; | 555 | filp->private_data = dev_dax; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c index 0cc5190f4f36..5f3f54073818 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | |||
@@ -258,6 +258,8 @@ int amdgpu_vce_suspend(struct amdgpu_device *adev) | |||
258 | { | 258 | { |
259 | int i; | 259 | int i; |
260 | 260 | ||
261 | cancel_delayed_work_sync(&adev->vce.idle_work); | ||
262 | |||
261 | if (adev->vce.vcpu_bo == NULL) | 263 | if (adev->vce.vcpu_bo == NULL) |
262 | return 0; | 264 | return 0; |
263 | 265 | ||
@@ -268,7 +270,6 @@ int amdgpu_vce_suspend(struct amdgpu_device *adev) | |||
268 | if (i == AMDGPU_MAX_VCE_HANDLES) | 270 | if (i == AMDGPU_MAX_VCE_HANDLES) |
269 | return 0; | 271 | return 0; |
270 | 272 | ||
271 | cancel_delayed_work_sync(&adev->vce.idle_work); | ||
272 | /* TODO: suspending running encoding sessions isn't supported */ | 273 | /* TODO: suspending running encoding sessions isn't supported */ |
273 | return -EINVAL; | 274 | return -EINVAL; |
274 | } | 275 | } |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c index fd654a4406db..400fc74bbae2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | |||
@@ -153,11 +153,11 @@ int amdgpu_vcn_suspend(struct amdgpu_device *adev) | |||
153 | unsigned size; | 153 | unsigned size; |
154 | void *ptr; | 154 | void *ptr; |
155 | 155 | ||
156 | cancel_delayed_work_sync(&adev->vcn.idle_work); | ||
157 | |||
156 | if (adev->vcn.vcpu_bo == NULL) | 158 | if (adev->vcn.vcpu_bo == NULL) |
157 | return 0; | 159 | return 0; |
158 | 160 | ||
159 | cancel_delayed_work_sync(&adev->vcn.idle_work); | ||
160 | |||
161 | size = amdgpu_bo_size(adev->vcn.vcpu_bo); | 161 | size = amdgpu_bo_size(adev->vcn.vcpu_bo); |
162 | ptr = adev->vcn.cpu_addr; | 162 | ptr = adev->vcn.cpu_addr; |
163 | 163 | ||
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 800f481a6995..96875950845a 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |||
@@ -641,6 +641,87 @@ amdgpu_dm_find_first_crtc_matching_connector(struct drm_atomic_state *state, | |||
641 | return NULL; | 641 | return NULL; |
642 | } | 642 | } |
643 | 643 | ||
644 | static void emulated_link_detect(struct dc_link *link) | ||
645 | { | ||
646 | struct dc_sink_init_data sink_init_data = { 0 }; | ||
647 | struct display_sink_capability sink_caps = { 0 }; | ||
648 | enum dc_edid_status edid_status; | ||
649 | struct dc_context *dc_ctx = link->ctx; | ||
650 | struct dc_sink *sink = NULL; | ||
651 | struct dc_sink *prev_sink = NULL; | ||
652 | |||
653 | link->type = dc_connection_none; | ||
654 | prev_sink = link->local_sink; | ||
655 | |||
656 | if (prev_sink != NULL) | ||
657 | dc_sink_retain(prev_sink); | ||
658 | |||
659 | switch (link->connector_signal) { | ||
660 | case SIGNAL_TYPE_HDMI_TYPE_A: { | ||
661 | sink_caps.transaction_type = DDC_TRANSACTION_TYPE_I2C; | ||
662 | sink_caps.signal = SIGNAL_TYPE_HDMI_TYPE_A; | ||
663 | break; | ||
664 | } | ||
665 | |||
666 | case SIGNAL_TYPE_DVI_SINGLE_LINK: { | ||
667 | sink_caps.transaction_type = DDC_TRANSACTION_TYPE_I2C; | ||
668 | sink_caps.signal = SIGNAL_TYPE_DVI_SINGLE_LINK; | ||
669 | break; | ||
670 | } | ||
671 | |||
672 | case SIGNAL_TYPE_DVI_DUAL_LINK: { | ||
673 | sink_caps.transaction_type = DDC_TRANSACTION_TYPE_I2C; | ||
674 | sink_caps.signal = SIGNAL_TYPE_DVI_DUAL_LINK; | ||
675 | break; | ||
676 | } | ||
677 | |||
678 | case SIGNAL_TYPE_LVDS: { | ||
679 | sink_caps.transaction_type = DDC_TRANSACTION_TYPE_I2C; | ||
680 | sink_caps.signal = SIGNAL_TYPE_LVDS; | ||
681 | break; | ||
682 | } | ||
683 | |||
684 | case SIGNAL_TYPE_EDP: { | ||
685 | sink_caps.transaction_type = | ||
686 | DDC_TRANSACTION_TYPE_I2C_OVER_AUX; | ||
687 | sink_caps.signal = SIGNAL_TYPE_EDP; | ||
688 | break; | ||
689 | } | ||
690 | |||
691 | case SIGNAL_TYPE_DISPLAY_PORT: { | ||
692 | sink_caps.transaction_type = | ||
693 | DDC_TRANSACTION_TYPE_I2C_OVER_AUX; | ||
694 | sink_caps.signal = SIGNAL_TYPE_VIRTUAL; | ||
695 | break; | ||
696 | } | ||
697 | |||
698 | default: | ||
699 | DC_ERROR("Invalid connector type! signal:%d\n", | ||
700 | link->connector_signal); | ||
701 | return; | ||
702 | } | ||
703 | |||
704 | sink_init_data.link = link; | ||
705 | sink_init_data.sink_signal = sink_caps.signal; | ||
706 | |||
707 | sink = dc_sink_create(&sink_init_data); | ||
708 | if (!sink) { | ||
709 | DC_ERROR("Failed to create sink!\n"); | ||
710 | return; | ||
711 | } | ||
712 | |||
713 | link->local_sink = sink; | ||
714 | |||
715 | edid_status = dm_helpers_read_local_edid( | ||
716 | link->ctx, | ||
717 | link, | ||
718 | sink); | ||
719 | |||
720 | if (edid_status != EDID_OK) | ||
721 | DC_ERROR("Failed to read EDID"); | ||
722 | |||
723 | } | ||
724 | |||
644 | static int dm_resume(void *handle) | 725 | static int dm_resume(void *handle) |
645 | { | 726 | { |
646 | struct amdgpu_device *adev = handle; | 727 | struct amdgpu_device *adev = handle; |
@@ -654,6 +735,7 @@ static int dm_resume(void *handle) | |||
654 | struct drm_plane *plane; | 735 | struct drm_plane *plane; |
655 | struct drm_plane_state *new_plane_state; | 736 | struct drm_plane_state *new_plane_state; |
656 | struct dm_plane_state *dm_new_plane_state; | 737 | struct dm_plane_state *dm_new_plane_state; |
738 | enum dc_connection_type new_connection_type = dc_connection_none; | ||
657 | int ret; | 739 | int ret; |
658 | int i; | 740 | int i; |
659 | 741 | ||
@@ -684,7 +766,13 @@ static int dm_resume(void *handle) | |||
684 | continue; | 766 | continue; |
685 | 767 | ||
686 | mutex_lock(&aconnector->hpd_lock); | 768 | mutex_lock(&aconnector->hpd_lock); |
687 | dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD); | 769 | if (!dc_link_detect_sink(aconnector->dc_link, &new_connection_type)) |
770 | DRM_ERROR("KMS: Failed to detect connector\n"); | ||
771 | |||
772 | if (aconnector->base.force && new_connection_type == dc_connection_none) | ||
773 | emulated_link_detect(aconnector->dc_link); | ||
774 | else | ||
775 | dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD); | ||
688 | 776 | ||
689 | if (aconnector->fake_enable && aconnector->dc_link->local_sink) | 777 | if (aconnector->fake_enable && aconnector->dc_link->local_sink) |
690 | aconnector->fake_enable = false; | 778 | aconnector->fake_enable = false; |
@@ -922,6 +1010,7 @@ static void handle_hpd_irq(void *param) | |||
922 | struct amdgpu_dm_connector *aconnector = (struct amdgpu_dm_connector *)param; | 1010 | struct amdgpu_dm_connector *aconnector = (struct amdgpu_dm_connector *)param; |
923 | struct drm_connector *connector = &aconnector->base; | 1011 | struct drm_connector *connector = &aconnector->base; |
924 | struct drm_device *dev = connector->dev; | 1012 | struct drm_device *dev = connector->dev; |
1013 | enum dc_connection_type new_connection_type = dc_connection_none; | ||
925 | 1014 | ||
926 | /* In case of failure or MST no need to update connector status or notify the OS | 1015 | /* In case of failure or MST no need to update connector status or notify the OS |
927 | * since (for MST case) MST does this in it's own context. | 1016 | * since (for MST case) MST does this in it's own context. |
@@ -931,7 +1020,21 @@ static void handle_hpd_irq(void *param) | |||
931 | if (aconnector->fake_enable) | 1020 | if (aconnector->fake_enable) |
932 | aconnector->fake_enable = false; | 1021 | aconnector->fake_enable = false; |
933 | 1022 | ||
934 | if (dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD)) { | 1023 | if (!dc_link_detect_sink(aconnector->dc_link, &new_connection_type)) |
1024 | DRM_ERROR("KMS: Failed to detect connector\n"); | ||
1025 | |||
1026 | if (aconnector->base.force && new_connection_type == dc_connection_none) { | ||
1027 | emulated_link_detect(aconnector->dc_link); | ||
1028 | |||
1029 | |||
1030 | drm_modeset_lock_all(dev); | ||
1031 | dm_restore_drm_connector_state(dev, connector); | ||
1032 | drm_modeset_unlock_all(dev); | ||
1033 | |||
1034 | if (aconnector->base.force == DRM_FORCE_UNSPECIFIED) | ||
1035 | drm_kms_helper_hotplug_event(dev); | ||
1036 | |||
1037 | } else if (dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD)) { | ||
935 | amdgpu_dm_update_connector_after_detect(aconnector); | 1038 | amdgpu_dm_update_connector_after_detect(aconnector); |
936 | 1039 | ||
937 | 1040 | ||
@@ -1031,6 +1134,7 @@ static void handle_hpd_rx_irq(void *param) | |||
1031 | struct drm_device *dev = connector->dev; | 1134 | struct drm_device *dev = connector->dev; |
1032 | struct dc_link *dc_link = aconnector->dc_link; | 1135 | struct dc_link *dc_link = aconnector->dc_link; |
1033 | bool is_mst_root_connector = aconnector->mst_mgr.mst_state; | 1136 | bool is_mst_root_connector = aconnector->mst_mgr.mst_state; |
1137 | enum dc_connection_type new_connection_type = dc_connection_none; | ||
1034 | 1138 | ||
1035 | /* TODO:Temporary add mutex to protect hpd interrupt not have a gpio | 1139 | /* TODO:Temporary add mutex to protect hpd interrupt not have a gpio |
1036 | * conflict, after implement i2c helper, this mutex should be | 1140 | * conflict, after implement i2c helper, this mutex should be |
@@ -1042,7 +1146,24 @@ static void handle_hpd_rx_irq(void *param) | |||
1042 | if (dc_link_handle_hpd_rx_irq(dc_link, NULL, NULL) && | 1146 | if (dc_link_handle_hpd_rx_irq(dc_link, NULL, NULL) && |
1043 | !is_mst_root_connector) { | 1147 | !is_mst_root_connector) { |
1044 | /* Downstream Port status changed. */ | 1148 | /* Downstream Port status changed. */ |
1045 | if (dc_link_detect(dc_link, DETECT_REASON_HPDRX)) { | 1149 | if (!dc_link_detect_sink(dc_link, &new_connection_type)) |
1150 | DRM_ERROR("KMS: Failed to detect connector\n"); | ||
1151 | |||
1152 | if (aconnector->base.force && new_connection_type == dc_connection_none) { | ||
1153 | emulated_link_detect(dc_link); | ||
1154 | |||
1155 | if (aconnector->fake_enable) | ||
1156 | aconnector->fake_enable = false; | ||
1157 | |||
1158 | amdgpu_dm_update_connector_after_detect(aconnector); | ||
1159 | |||
1160 | |||
1161 | drm_modeset_lock_all(dev); | ||
1162 | dm_restore_drm_connector_state(dev, connector); | ||
1163 | drm_modeset_unlock_all(dev); | ||
1164 | |||
1165 | drm_kms_helper_hotplug_event(dev); | ||
1166 | } else if (dc_link_detect(dc_link, DETECT_REASON_HPDRX)) { | ||
1046 | 1167 | ||
1047 | if (aconnector->fake_enable) | 1168 | if (aconnector->fake_enable) |
1048 | aconnector->fake_enable = false; | 1169 | aconnector->fake_enable = false; |
@@ -1433,6 +1554,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) | |||
1433 | struct amdgpu_mode_info *mode_info = &adev->mode_info; | 1554 | struct amdgpu_mode_info *mode_info = &adev->mode_info; |
1434 | uint32_t link_cnt; | 1555 | uint32_t link_cnt; |
1435 | int32_t total_overlay_planes, total_primary_planes; | 1556 | int32_t total_overlay_planes, total_primary_planes; |
1557 | enum dc_connection_type new_connection_type = dc_connection_none; | ||
1436 | 1558 | ||
1437 | link_cnt = dm->dc->caps.max_links; | 1559 | link_cnt = dm->dc->caps.max_links; |
1438 | if (amdgpu_dm_mode_config_init(dm->adev)) { | 1560 | if (amdgpu_dm_mode_config_init(dm->adev)) { |
@@ -1499,7 +1621,14 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) | |||
1499 | 1621 | ||
1500 | link = dc_get_link_at_index(dm->dc, i); | 1622 | link = dc_get_link_at_index(dm->dc, i); |
1501 | 1623 | ||
1502 | if (dc_link_detect(link, DETECT_REASON_BOOT)) { | 1624 | if (!dc_link_detect_sink(link, &new_connection_type)) |
1625 | DRM_ERROR("KMS: Failed to detect connector\n"); | ||
1626 | |||
1627 | if (aconnector->base.force && new_connection_type == dc_connection_none) { | ||
1628 | emulated_link_detect(link); | ||
1629 | amdgpu_dm_update_connector_after_detect(aconnector); | ||
1630 | |||
1631 | } else if (dc_link_detect(link, DETECT_REASON_BOOT)) { | ||
1503 | amdgpu_dm_update_connector_after_detect(aconnector); | 1632 | amdgpu_dm_update_connector_after_detect(aconnector); |
1504 | register_backlight_device(dm, link); | 1633 | register_backlight_device(dm, link); |
1505 | } | 1634 | } |
@@ -2494,7 +2623,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector, | |||
2494 | if (dm_state && dm_state->freesync_capable) | 2623 | if (dm_state && dm_state->freesync_capable) |
2495 | stream->ignore_msa_timing_param = true; | 2624 | stream->ignore_msa_timing_param = true; |
2496 | finish: | 2625 | finish: |
2497 | if (sink && sink->sink_signal == SIGNAL_TYPE_VIRTUAL) | 2626 | if (sink && sink->sink_signal == SIGNAL_TYPE_VIRTUAL && aconnector->base.force != DRM_FORCE_ON) |
2498 | dc_sink_release(sink); | 2627 | dc_sink_release(sink); |
2499 | 2628 | ||
2500 | return stream; | 2629 | return stream; |
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index 37eaf72ace54..fced3c1c2ef5 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c | |||
@@ -195,7 +195,7 @@ static bool program_hpd_filter( | |||
195 | return result; | 195 | return result; |
196 | } | 196 | } |
197 | 197 | ||
198 | static bool detect_sink(struct dc_link *link, enum dc_connection_type *type) | 198 | bool dc_link_detect_sink(struct dc_link *link, enum dc_connection_type *type) |
199 | { | 199 | { |
200 | uint32_t is_hpd_high = 0; | 200 | uint32_t is_hpd_high = 0; |
201 | struct gpio *hpd_pin; | 201 | struct gpio *hpd_pin; |
@@ -604,7 +604,7 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) | |||
604 | if (link->connector_signal == SIGNAL_TYPE_VIRTUAL) | 604 | if (link->connector_signal == SIGNAL_TYPE_VIRTUAL) |
605 | return false; | 605 | return false; |
606 | 606 | ||
607 | if (false == detect_sink(link, &new_connection_type)) { | 607 | if (false == dc_link_detect_sink(link, &new_connection_type)) { |
608 | BREAK_TO_DEBUGGER(); | 608 | BREAK_TO_DEBUGGER(); |
609 | return false; | 609 | return false; |
610 | } | 610 | } |
diff --git a/drivers/gpu/drm/amd/display/dc/dc_link.h b/drivers/gpu/drm/amd/display/dc/dc_link.h index d43cefbc43d3..1b48ab9aea89 100644 --- a/drivers/gpu/drm/amd/display/dc/dc_link.h +++ b/drivers/gpu/drm/amd/display/dc/dc_link.h | |||
@@ -215,6 +215,7 @@ void dc_link_enable_hpd_filter(struct dc_link *link, bool enable); | |||
215 | 215 | ||
216 | bool dc_link_is_dp_sink_present(struct dc_link *link); | 216 | bool dc_link_is_dp_sink_present(struct dc_link *link); |
217 | 217 | ||
218 | bool dc_link_detect_sink(struct dc_link *link, enum dc_connection_type *type); | ||
218 | /* | 219 | /* |
219 | * DPCD access interfaces | 220 | * DPCD access interfaces |
220 | */ | 221 | */ |
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c index 14384d9675a8..b2f308766a9e 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | |||
@@ -2560,7 +2560,7 @@ static void pplib_apply_display_requirements( | |||
2560 | dc->prev_display_config = *pp_display_cfg; | 2560 | dc->prev_display_config = *pp_display_cfg; |
2561 | } | 2561 | } |
2562 | 2562 | ||
2563 | void dce110_set_bandwidth( | 2563 | static void dce110_set_bandwidth( |
2564 | struct dc *dc, | 2564 | struct dc *dc, |
2565 | struct dc_state *context, | 2565 | struct dc_state *context, |
2566 | bool decrease_allowed) | 2566 | bool decrease_allowed) |
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h index e4c5db75c4c6..d6db3dbd9015 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h | |||
@@ -68,11 +68,6 @@ void dce110_fill_display_configs( | |||
68 | const struct dc_state *context, | 68 | const struct dc_state *context, |
69 | struct dm_pp_display_configuration *pp_display_cfg); | 69 | struct dm_pp_display_configuration *pp_display_cfg); |
70 | 70 | ||
71 | void dce110_set_bandwidth( | ||
72 | struct dc *dc, | ||
73 | struct dc_state *context, | ||
74 | bool decrease_allowed); | ||
75 | |||
76 | uint32_t dce110_get_min_vblank_time_us(const struct dc_state *context); | 71 | uint32_t dce110_get_min_vblank_time_us(const struct dc_state *context); |
77 | 72 | ||
78 | void dp_receiver_power_ctrl(struct dc_link *link, bool on); | 73 | void dp_receiver_power_ctrl(struct dc_link *link, bool on); |
diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c index 5853522a6182..eb0f5f9a973b 100644 --- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c | |||
@@ -244,17 +244,6 @@ static void dce120_update_dchub( | |||
244 | dh_data->dchub_info_valid = false; | 244 | dh_data->dchub_info_valid = false; |
245 | } | 245 | } |
246 | 246 | ||
247 | static void dce120_set_bandwidth( | ||
248 | struct dc *dc, | ||
249 | struct dc_state *context, | ||
250 | bool decrease_allowed) | ||
251 | { | ||
252 | if (context->stream_count <= 0) | ||
253 | return; | ||
254 | |||
255 | dce110_set_bandwidth(dc, context, decrease_allowed); | ||
256 | } | ||
257 | |||
258 | void dce120_hw_sequencer_construct(struct dc *dc) | 247 | void dce120_hw_sequencer_construct(struct dc *dc) |
259 | { | 248 | { |
260 | /* All registers used by dce11.2 match those in dce11 in offset and | 249 | /* All registers used by dce11.2 match those in dce11 in offset and |
@@ -263,6 +252,5 @@ void dce120_hw_sequencer_construct(struct dc *dc) | |||
263 | dce110_hw_sequencer_construct(dc); | 252 | dce110_hw_sequencer_construct(dc); |
264 | dc->hwss.enable_display_power_gating = dce120_enable_display_power_gating; | 253 | dc->hwss.enable_display_power_gating = dce120_enable_display_power_gating; |
265 | dc->hwss.update_dchub = dce120_update_dchub; | 254 | dc->hwss.update_dchub = dce120_update_dchub; |
266 | dc->hwss.set_bandwidth = dce120_set_bandwidth; | ||
267 | } | 255 | } |
268 | 256 | ||
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 08b5bb219816..94d6dabec2dc 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c | |||
@@ -754,6 +754,7 @@ static int malidp_bind(struct device *dev) | |||
754 | drm->irq_enabled = true; | 754 | drm->irq_enabled = true; |
755 | 755 | ||
756 | ret = drm_vblank_init(drm, drm->mode_config.num_crtc); | 756 | ret = drm_vblank_init(drm, drm->mode_config.num_crtc); |
757 | drm_crtc_vblank_reset(&malidp->crtc); | ||
757 | if (ret < 0) { | 758 | if (ret < 0) { |
758 | DRM_ERROR("failed to initialise vblank\n"); | 759 | DRM_ERROR("failed to initialise vblank\n"); |
759 | goto vblank_fail; | 760 | goto vblank_fail; |
diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c index c94a4422e0e9..2781e462c1ed 100644 --- a/drivers/gpu/drm/arm/malidp_hw.c +++ b/drivers/gpu/drm/arm/malidp_hw.c | |||
@@ -384,7 +384,8 @@ static long malidp500_se_calc_mclk(struct malidp_hw_device *hwdev, | |||
384 | 384 | ||
385 | static int malidp500_enable_memwrite(struct malidp_hw_device *hwdev, | 385 | static int malidp500_enable_memwrite(struct malidp_hw_device *hwdev, |
386 | dma_addr_t *addrs, s32 *pitches, | 386 | dma_addr_t *addrs, s32 *pitches, |
387 | int num_planes, u16 w, u16 h, u32 fmt_id) | 387 | int num_planes, u16 w, u16 h, u32 fmt_id, |
388 | const s16 *rgb2yuv_coeffs) | ||
388 | { | 389 | { |
389 | u32 base = MALIDP500_SE_MEMWRITE_BASE; | 390 | u32 base = MALIDP500_SE_MEMWRITE_BASE; |
390 | u32 de_base = malidp_get_block_base(hwdev, MALIDP_DE_BLOCK); | 391 | u32 de_base = malidp_get_block_base(hwdev, MALIDP_DE_BLOCK); |
@@ -416,6 +417,16 @@ static int malidp500_enable_memwrite(struct malidp_hw_device *hwdev, | |||
416 | 417 | ||
417 | malidp_hw_write(hwdev, MALIDP_DE_H_ACTIVE(w) | MALIDP_DE_V_ACTIVE(h), | 418 | malidp_hw_write(hwdev, MALIDP_DE_H_ACTIVE(w) | MALIDP_DE_V_ACTIVE(h), |
418 | MALIDP500_SE_MEMWRITE_OUT_SIZE); | 419 | MALIDP500_SE_MEMWRITE_OUT_SIZE); |
420 | |||
421 | if (rgb2yuv_coeffs) { | ||
422 | int i; | ||
423 | |||
424 | for (i = 0; i < MALIDP_COLORADJ_NUM_COEFFS; i++) { | ||
425 | malidp_hw_write(hwdev, rgb2yuv_coeffs[i], | ||
426 | MALIDP500_SE_RGB_YUV_COEFFS + i * 4); | ||
427 | } | ||
428 | } | ||
429 | |||
419 | malidp_hw_setbits(hwdev, MALIDP_SE_MEMWRITE_EN, MALIDP500_SE_CONTROL); | 430 | malidp_hw_setbits(hwdev, MALIDP_SE_MEMWRITE_EN, MALIDP500_SE_CONTROL); |
420 | 431 | ||
421 | return 0; | 432 | return 0; |
@@ -658,7 +669,8 @@ static long malidp550_se_calc_mclk(struct malidp_hw_device *hwdev, | |||
658 | 669 | ||
659 | static int malidp550_enable_memwrite(struct malidp_hw_device *hwdev, | 670 | static int malidp550_enable_memwrite(struct malidp_hw_device *hwdev, |
660 | dma_addr_t *addrs, s32 *pitches, | 671 | dma_addr_t *addrs, s32 *pitches, |
661 | int num_planes, u16 w, u16 h, u32 fmt_id) | 672 | int num_planes, u16 w, u16 h, u32 fmt_id, |
673 | const s16 *rgb2yuv_coeffs) | ||
662 | { | 674 | { |
663 | u32 base = MALIDP550_SE_MEMWRITE_BASE; | 675 | u32 base = MALIDP550_SE_MEMWRITE_BASE; |
664 | u32 de_base = malidp_get_block_base(hwdev, MALIDP_DE_BLOCK); | 676 | u32 de_base = malidp_get_block_base(hwdev, MALIDP_DE_BLOCK); |
@@ -689,6 +701,15 @@ static int malidp550_enable_memwrite(struct malidp_hw_device *hwdev, | |||
689 | malidp_hw_setbits(hwdev, MALIDP550_SE_MEMWRITE_ONESHOT | MALIDP_SE_MEMWRITE_EN, | 701 | malidp_hw_setbits(hwdev, MALIDP550_SE_MEMWRITE_ONESHOT | MALIDP_SE_MEMWRITE_EN, |
690 | MALIDP550_SE_CONTROL); | 702 | MALIDP550_SE_CONTROL); |
691 | 703 | ||
704 | if (rgb2yuv_coeffs) { | ||
705 | int i; | ||
706 | |||
707 | for (i = 0; i < MALIDP_COLORADJ_NUM_COEFFS; i++) { | ||
708 | malidp_hw_write(hwdev, rgb2yuv_coeffs[i], | ||
709 | MALIDP550_SE_RGB_YUV_COEFFS + i * 4); | ||
710 | } | ||
711 | } | ||
712 | |||
692 | return 0; | 713 | return 0; |
693 | } | 714 | } |
694 | 715 | ||
diff --git a/drivers/gpu/drm/arm/malidp_hw.h b/drivers/gpu/drm/arm/malidp_hw.h index ad2e96915d44..9fc94c08190f 100644 --- a/drivers/gpu/drm/arm/malidp_hw.h +++ b/drivers/gpu/drm/arm/malidp_hw.h | |||
@@ -191,7 +191,8 @@ struct malidp_hw { | |||
191 | * @param fmt_id - internal format ID of output buffer | 191 | * @param fmt_id - internal format ID of output buffer |
192 | */ | 192 | */ |
193 | int (*enable_memwrite)(struct malidp_hw_device *hwdev, dma_addr_t *addrs, | 193 | int (*enable_memwrite)(struct malidp_hw_device *hwdev, dma_addr_t *addrs, |
194 | s32 *pitches, int num_planes, u16 w, u16 h, u32 fmt_id); | 194 | s32 *pitches, int num_planes, u16 w, u16 h, u32 fmt_id, |
195 | const s16 *rgb2yuv_coeffs); | ||
195 | 196 | ||
196 | /* | 197 | /* |
197 | * Disable the writing to memory of the next frame's content. | 198 | * Disable the writing to memory of the next frame's content. |
diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/arm/malidp_mw.c index ba6ae66387c9..91472e5e0c8b 100644 --- a/drivers/gpu/drm/arm/malidp_mw.c +++ b/drivers/gpu/drm/arm/malidp_mw.c | |||
@@ -26,6 +26,8 @@ struct malidp_mw_connector_state { | |||
26 | s32 pitches[2]; | 26 | s32 pitches[2]; |
27 | u8 format; | 27 | u8 format; |
28 | u8 n_planes; | 28 | u8 n_planes; |
29 | bool rgb2yuv_initialized; | ||
30 | const s16 *rgb2yuv_coeffs; | ||
29 | }; | 31 | }; |
30 | 32 | ||
31 | static int malidp_mw_connector_get_modes(struct drm_connector *connector) | 33 | static int malidp_mw_connector_get_modes(struct drm_connector *connector) |
@@ -84,7 +86,7 @@ static void malidp_mw_connector_destroy(struct drm_connector *connector) | |||
84 | static struct drm_connector_state * | 86 | static struct drm_connector_state * |
85 | malidp_mw_connector_duplicate_state(struct drm_connector *connector) | 87 | malidp_mw_connector_duplicate_state(struct drm_connector *connector) |
86 | { | 88 | { |
87 | struct malidp_mw_connector_state *mw_state; | 89 | struct malidp_mw_connector_state *mw_state, *mw_current_state; |
88 | 90 | ||
89 | if (WARN_ON(!connector->state)) | 91 | if (WARN_ON(!connector->state)) |
90 | return NULL; | 92 | return NULL; |
@@ -93,7 +95,10 @@ malidp_mw_connector_duplicate_state(struct drm_connector *connector) | |||
93 | if (!mw_state) | 95 | if (!mw_state) |
94 | return NULL; | 96 | return NULL; |
95 | 97 | ||
96 | /* No need to preserve any of our driver-local data */ | 98 | mw_current_state = to_mw_state(connector->state); |
99 | mw_state->rgb2yuv_coeffs = mw_current_state->rgb2yuv_coeffs; | ||
100 | mw_state->rgb2yuv_initialized = mw_current_state->rgb2yuv_initialized; | ||
101 | |||
97 | __drm_atomic_helper_connector_duplicate_state(connector, &mw_state->base); | 102 | __drm_atomic_helper_connector_duplicate_state(connector, &mw_state->base); |
98 | 103 | ||
99 | return &mw_state->base; | 104 | return &mw_state->base; |
@@ -108,6 +113,13 @@ static const struct drm_connector_funcs malidp_mw_connector_funcs = { | |||
108 | .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, | 113 | .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, |
109 | }; | 114 | }; |
110 | 115 | ||
116 | static const s16 rgb2yuv_coeffs_bt709_limited[MALIDP_COLORADJ_NUM_COEFFS] = { | ||
117 | 47, 157, 16, | ||
118 | -26, -87, 112, | ||
119 | 112, -102, -10, | ||
120 | 16, 128, 128 | ||
121 | }; | ||
122 | |||
111 | static int | 123 | static int |
112 | malidp_mw_encoder_atomic_check(struct drm_encoder *encoder, | 124 | malidp_mw_encoder_atomic_check(struct drm_encoder *encoder, |
113 | struct drm_crtc_state *crtc_state, | 125 | struct drm_crtc_state *crtc_state, |
@@ -157,6 +169,9 @@ malidp_mw_encoder_atomic_check(struct drm_encoder *encoder, | |||
157 | } | 169 | } |
158 | mw_state->n_planes = n_planes; | 170 | mw_state->n_planes = n_planes; |
159 | 171 | ||
172 | if (fb->format->is_yuv) | ||
173 | mw_state->rgb2yuv_coeffs = rgb2yuv_coeffs_bt709_limited; | ||
174 | |||
160 | return 0; | 175 | return 0; |
161 | } | 176 | } |
162 | 177 | ||
@@ -239,10 +254,12 @@ void malidp_mw_atomic_commit(struct drm_device *drm, | |||
239 | 254 | ||
240 | drm_writeback_queue_job(mw_conn, conn_state->writeback_job); | 255 | drm_writeback_queue_job(mw_conn, conn_state->writeback_job); |
241 | conn_state->writeback_job = NULL; | 256 | conn_state->writeback_job = NULL; |
242 | |||
243 | hwdev->hw->enable_memwrite(hwdev, mw_state->addrs, | 257 | hwdev->hw->enable_memwrite(hwdev, mw_state->addrs, |
244 | mw_state->pitches, mw_state->n_planes, | 258 | mw_state->pitches, mw_state->n_planes, |
245 | fb->width, fb->height, mw_state->format); | 259 | fb->width, fb->height, mw_state->format, |
260 | !mw_state->rgb2yuv_initialized ? | ||
261 | mw_state->rgb2yuv_coeffs : NULL); | ||
262 | mw_state->rgb2yuv_initialized = !!mw_state->rgb2yuv_coeffs; | ||
246 | } else { | 263 | } else { |
247 | DRM_DEV_DEBUG_DRIVER(drm->dev, "Disable memwrite\n"); | 264 | DRM_DEV_DEBUG_DRIVER(drm->dev, "Disable memwrite\n"); |
248 | hwdev->hw->disable_memwrite(hwdev); | 265 | hwdev->hw->disable_memwrite(hwdev); |
diff --git a/drivers/gpu/drm/arm/malidp_regs.h b/drivers/gpu/drm/arm/malidp_regs.h index 3579d36b2a71..6ffe849774f2 100644 --- a/drivers/gpu/drm/arm/malidp_regs.h +++ b/drivers/gpu/drm/arm/malidp_regs.h | |||
@@ -205,6 +205,7 @@ | |||
205 | #define MALIDP500_SE_BASE 0x00c00 | 205 | #define MALIDP500_SE_BASE 0x00c00 |
206 | #define MALIDP500_SE_CONTROL 0x00c0c | 206 | #define MALIDP500_SE_CONTROL 0x00c0c |
207 | #define MALIDP500_SE_MEMWRITE_OUT_SIZE 0x00c2c | 207 | #define MALIDP500_SE_MEMWRITE_OUT_SIZE 0x00c2c |
208 | #define MALIDP500_SE_RGB_YUV_COEFFS 0x00C74 | ||
208 | #define MALIDP500_SE_MEMWRITE_BASE 0x00e00 | 209 | #define MALIDP500_SE_MEMWRITE_BASE 0x00e00 |
209 | #define MALIDP500_DC_IRQ_BASE 0x00f00 | 210 | #define MALIDP500_DC_IRQ_BASE 0x00f00 |
210 | #define MALIDP500_CONFIG_VALID 0x00f00 | 211 | #define MALIDP500_CONFIG_VALID 0x00f00 |
@@ -238,6 +239,7 @@ | |||
238 | #define MALIDP550_SE_CONTROL 0x08010 | 239 | #define MALIDP550_SE_CONTROL 0x08010 |
239 | #define MALIDP550_SE_MEMWRITE_ONESHOT (1 << 7) | 240 | #define MALIDP550_SE_MEMWRITE_ONESHOT (1 << 7) |
240 | #define MALIDP550_SE_MEMWRITE_OUT_SIZE 0x08030 | 241 | #define MALIDP550_SE_MEMWRITE_OUT_SIZE 0x08030 |
242 | #define MALIDP550_SE_RGB_YUV_COEFFS 0x08078 | ||
241 | #define MALIDP550_SE_MEMWRITE_BASE 0x08100 | 243 | #define MALIDP550_SE_MEMWRITE_BASE 0x08100 |
242 | #define MALIDP550_DC_BASE 0x0c000 | 244 | #define MALIDP550_DC_BASE 0x0c000 |
243 | #define MALIDP550_DC_CONTROL 0x0c010 | 245 | #define MALIDP550_DC_CONTROL 0x0c010 |
diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index b902361dee6e..1d9a9d2fe0e0 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/err.h> | 24 | #include <linux/err.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | 26 | ||
27 | #include <drm/drm_device.h> | ||
28 | #include <drm/drm_crtc.h> | 27 | #include <drm/drm_crtc.h> |
29 | #include <drm/drm_panel.h> | 28 | #include <drm/drm_panel.h> |
30 | 29 | ||
@@ -105,13 +104,6 @@ int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector) | |||
105 | if (panel->connector) | 104 | if (panel->connector) |
106 | return -EBUSY; | 105 | return -EBUSY; |
107 | 106 | ||
108 | panel->link = device_link_add(connector->dev->dev, panel->dev, 0); | ||
109 | if (!panel->link) { | ||
110 | dev_err(panel->dev, "failed to link panel to %s\n", | ||
111 | dev_name(connector->dev->dev)); | ||
112 | return -EINVAL; | ||
113 | } | ||
114 | |||
115 | panel->connector = connector; | 107 | panel->connector = connector; |
116 | panel->drm = connector->dev; | 108 | panel->drm = connector->dev; |
117 | 109 | ||
@@ -133,8 +125,6 @@ EXPORT_SYMBOL(drm_panel_attach); | |||
133 | */ | 125 | */ |
134 | int drm_panel_detach(struct drm_panel *panel) | 126 | int drm_panel_detach(struct drm_panel *panel) |
135 | { | 127 | { |
136 | device_link_del(panel->link); | ||
137 | |||
138 | panel->connector = NULL; | 128 | panel->connector = NULL; |
139 | panel->drm = NULL; | 129 | panel->drm = NULL; |
140 | 130 | ||
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index adb3cb27d31e..759278fef35a 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c | |||
@@ -97,6 +97,8 @@ static int drm_syncobj_fence_get_or_add_callback(struct drm_syncobj *syncobj, | |||
97 | { | 97 | { |
98 | int ret; | 98 | int ret; |
99 | 99 | ||
100 | WARN_ON(*fence); | ||
101 | |||
100 | *fence = drm_syncobj_fence_get(syncobj); | 102 | *fence = drm_syncobj_fence_get(syncobj); |
101 | if (*fence) | 103 | if (*fence) |
102 | return 1; | 104 | return 1; |
@@ -743,6 +745,9 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs, | |||
743 | 745 | ||
744 | if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) { | 746 | if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) { |
745 | for (i = 0; i < count; ++i) { | 747 | for (i = 0; i < count; ++i) { |
748 | if (entries[i].fence) | ||
749 | continue; | ||
750 | |||
746 | drm_syncobj_fence_get_or_add_callback(syncobjs[i], | 751 | drm_syncobj_fence_get_or_add_callback(syncobjs[i], |
747 | &entries[i].fence, | 752 | &entries[i].fence, |
748 | &entries[i].syncobj_cb, | 753 | &entries[i].syncobj_cb, |
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 9b2720b41571..83c1f46670bf 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c | |||
@@ -592,8 +592,6 @@ static int etnaviv_pdev_probe(struct platform_device *pdev) | |||
592 | struct device *dev = &pdev->dev; | 592 | struct device *dev = &pdev->dev; |
593 | struct component_match *match = NULL; | 593 | struct component_match *match = NULL; |
594 | 594 | ||
595 | dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
596 | |||
597 | if (!dev->platform_data) { | 595 | if (!dev->platform_data) { |
598 | struct device_node *core_node; | 596 | struct device_node *core_node; |
599 | 597 | ||
@@ -655,13 +653,30 @@ static int __init etnaviv_init(void) | |||
655 | for_each_compatible_node(np, NULL, "vivante,gc") { | 653 | for_each_compatible_node(np, NULL, "vivante,gc") { |
656 | if (!of_device_is_available(np)) | 654 | if (!of_device_is_available(np)) |
657 | continue; | 655 | continue; |
658 | pdev = platform_device_register_simple("etnaviv", -1, | 656 | |
659 | NULL, 0); | 657 | pdev = platform_device_alloc("etnaviv", -1); |
660 | if (IS_ERR(pdev)) { | 658 | if (!pdev) { |
661 | ret = PTR_ERR(pdev); | 659 | ret = -ENOMEM; |
660 | of_node_put(np); | ||
661 | goto unregister_platform_driver; | ||
662 | } | ||
663 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(40); | ||
664 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
665 | |||
666 | /* | ||
667 | * Apply the same DMA configuration to the virtual etnaviv | ||
668 | * device as the GPU we found. This assumes that all Vivante | ||
669 | * GPUs in the system share the same DMA constraints. | ||
670 | */ | ||
671 | of_dma_configure(&pdev->dev, np, true); | ||
672 | |||
673 | ret = platform_device_add(pdev); | ||
674 | if (ret) { | ||
675 | platform_device_put(pdev); | ||
662 | of_node_put(np); | 676 | of_node_put(np); |
663 | goto unregister_platform_driver; | 677 | goto unregister_platform_driver; |
664 | } | 678 | } |
679 | |||
665 | etnaviv_drm = pdev; | 680 | etnaviv_drm = pdev; |
666 | of_node_put(np); | 681 | of_node_put(np); |
667 | break; | 682 | break; |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 5146ee029db4..bc49909aba8e 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -976,7 +976,6 @@ | |||
976 | #define USB_DEVICE_ID_SIS817_TOUCH 0x0817 | 976 | #define USB_DEVICE_ID_SIS817_TOUCH 0x0817 |
977 | #define USB_DEVICE_ID_SIS_TS 0x1013 | 977 | #define USB_DEVICE_ID_SIS_TS 0x1013 |
978 | #define USB_DEVICE_ID_SIS1030_TOUCH 0x1030 | 978 | #define USB_DEVICE_ID_SIS1030_TOUCH 0x1030 |
979 | #define USB_DEVICE_ID_SIS10FB_TOUCH 0x10fb | ||
980 | 979 | ||
981 | #define USB_VENDOR_ID_SKYCABLE 0x1223 | 980 | #define USB_VENDOR_ID_SKYCABLE 0x1223 |
982 | #define USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER 0x3F07 | 981 | #define USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER 0x3F07 |
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index f3076659361a..4e3592e7a3f7 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c | |||
@@ -47,7 +47,7 @@ | |||
47 | /* quirks to control the device */ | 47 | /* quirks to control the device */ |
48 | #define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0) | 48 | #define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0) |
49 | #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1) | 49 | #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1) |
50 | #define I2C_HID_QUIRK_RESEND_REPORT_DESCR BIT(2) | 50 | #define I2C_HID_QUIRK_NO_RUNTIME_PM BIT(2) |
51 | 51 | ||
52 | /* flags */ | 52 | /* flags */ |
53 | #define I2C_HID_STARTED 0 | 53 | #define I2C_HID_STARTED 0 |
@@ -169,9 +169,8 @@ static const struct i2c_hid_quirks { | |||
169 | { USB_VENDOR_ID_WEIDA, USB_DEVICE_ID_WEIDA_8755, | 169 | { USB_VENDOR_ID_WEIDA, USB_DEVICE_ID_WEIDA_8755, |
170 | I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV }, | 170 | I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV }, |
171 | { I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288, | 171 | { I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288, |
172 | I2C_HID_QUIRK_NO_IRQ_AFTER_RESET }, | 172 | I2C_HID_QUIRK_NO_IRQ_AFTER_RESET | |
173 | { USB_VENDOR_ID_SIS_TOUCH, USB_DEVICE_ID_SIS10FB_TOUCH, | 173 | I2C_HID_QUIRK_NO_RUNTIME_PM }, |
174 | I2C_HID_QUIRK_RESEND_REPORT_DESCR }, | ||
175 | { 0, 0 } | 174 | { 0, 0 } |
176 | }; | 175 | }; |
177 | 176 | ||
@@ -1105,7 +1104,9 @@ static int i2c_hid_probe(struct i2c_client *client, | |||
1105 | goto err_mem_free; | 1104 | goto err_mem_free; |
1106 | } | 1105 | } |
1107 | 1106 | ||
1108 | pm_runtime_put(&client->dev); | 1107 | if (!(ihid->quirks & I2C_HID_QUIRK_NO_RUNTIME_PM)) |
1108 | pm_runtime_put(&client->dev); | ||
1109 | |||
1109 | return 0; | 1110 | return 0; |
1110 | 1111 | ||
1111 | err_mem_free: | 1112 | err_mem_free: |
@@ -1130,7 +1131,8 @@ static int i2c_hid_remove(struct i2c_client *client) | |||
1130 | struct i2c_hid *ihid = i2c_get_clientdata(client); | 1131 | struct i2c_hid *ihid = i2c_get_clientdata(client); |
1131 | struct hid_device *hid; | 1132 | struct hid_device *hid; |
1132 | 1133 | ||
1133 | pm_runtime_get_sync(&client->dev); | 1134 | if (!(ihid->quirks & I2C_HID_QUIRK_NO_RUNTIME_PM)) |
1135 | pm_runtime_get_sync(&client->dev); | ||
1134 | pm_runtime_disable(&client->dev); | 1136 | pm_runtime_disable(&client->dev); |
1135 | pm_runtime_set_suspended(&client->dev); | 1137 | pm_runtime_set_suspended(&client->dev); |
1136 | pm_runtime_put_noidle(&client->dev); | 1138 | pm_runtime_put_noidle(&client->dev); |
@@ -1236,22 +1238,13 @@ static int i2c_hid_resume(struct device *dev) | |||
1236 | 1238 | ||
1237 | /* Instead of resetting device, simply powers the device on. This | 1239 | /* Instead of resetting device, simply powers the device on. This |
1238 | * solves "incomplete reports" on Raydium devices 2386:3118 and | 1240 | * solves "incomplete reports" on Raydium devices 2386:3118 and |
1239 | * 2386:4B33 | 1241 | * 2386:4B33 and fixes various SIS touchscreens no longer sending |
1242 | * data after a suspend/resume. | ||
1240 | */ | 1243 | */ |
1241 | ret = i2c_hid_set_power(client, I2C_HID_PWR_ON); | 1244 | ret = i2c_hid_set_power(client, I2C_HID_PWR_ON); |
1242 | if (ret) | 1245 | if (ret) |
1243 | return ret; | 1246 | return ret; |
1244 | 1247 | ||
1245 | /* Some devices need to re-send report descr cmd | ||
1246 | * after resume, after this it will be back normal. | ||
1247 | * otherwise it issues too many incomplete reports. | ||
1248 | */ | ||
1249 | if (ihid->quirks & I2C_HID_QUIRK_RESEND_REPORT_DESCR) { | ||
1250 | ret = i2c_hid_command(client, &hid_report_descr_cmd, NULL, 0); | ||
1251 | if (ret) | ||
1252 | return ret; | ||
1253 | } | ||
1254 | |||
1255 | if (hid->driver && hid->driver->reset_resume) { | 1248 | if (hid->driver && hid->driver->reset_resume) { |
1256 | ret = hid->driver->reset_resume(hid); | 1249 | ret = hid->driver->reset_resume(hid); |
1257 | return ret; | 1250 | return ret; |
diff --git a/drivers/hid/intel-ish-hid/ipc/hw-ish.h b/drivers/hid/intel-ish-hid/ipc/hw-ish.h index da133716bed0..08a8327dfd22 100644 --- a/drivers/hid/intel-ish-hid/ipc/hw-ish.h +++ b/drivers/hid/intel-ish-hid/ipc/hw-ish.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #define CNL_Ax_DEVICE_ID 0x9DFC | 29 | #define CNL_Ax_DEVICE_ID 0x9DFC |
30 | #define GLK_Ax_DEVICE_ID 0x31A2 | 30 | #define GLK_Ax_DEVICE_ID 0x31A2 |
31 | #define CNL_H_DEVICE_ID 0xA37C | 31 | #define CNL_H_DEVICE_ID 0xA37C |
32 | #define ICL_MOBILE_DEVICE_ID 0x34FC | ||
32 | #define SPT_H_DEVICE_ID 0xA135 | 33 | #define SPT_H_DEVICE_ID 0xA135 |
33 | 34 | ||
34 | #define REVISION_ID_CHT_A0 0x6 | 35 | #define REVISION_ID_CHT_A0 0x6 |
diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c index a1125a5c7965..256b3016116c 100644 --- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c +++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c | |||
@@ -38,6 +38,7 @@ static const struct pci_device_id ish_pci_tbl[] = { | |||
38 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, CNL_Ax_DEVICE_ID)}, | 38 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, CNL_Ax_DEVICE_ID)}, |
39 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, GLK_Ax_DEVICE_ID)}, | 39 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, GLK_Ax_DEVICE_ID)}, |
40 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, CNL_H_DEVICE_ID)}, | 40 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, CNL_H_DEVICE_ID)}, |
41 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, ICL_MOBILE_DEVICE_ID)}, | ||
41 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, SPT_H_DEVICE_ID)}, | 42 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, SPT_H_DEVICE_ID)}, |
42 | {0, } | 43 | {0, } |
43 | }; | 44 | }; |
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index 0bee1f4b914e..3208ad6ad540 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c | |||
@@ -338,6 +338,39 @@ static int add_roce_gid(struct ib_gid_table_entry *entry) | |||
338 | } | 338 | } |
339 | 339 | ||
340 | /** | 340 | /** |
341 | * del_gid - Delete GID table entry | ||
342 | * | ||
343 | * @ib_dev: IB device whose GID entry to be deleted | ||
344 | * @port: Port number of the IB device | ||
345 | * @table: GID table of the IB device for a port | ||
346 | * @ix: GID entry index to delete | ||
347 | * | ||
348 | */ | ||
349 | static void del_gid(struct ib_device *ib_dev, u8 port, | ||
350 | struct ib_gid_table *table, int ix) | ||
351 | { | ||
352 | struct ib_gid_table_entry *entry; | ||
353 | |||
354 | lockdep_assert_held(&table->lock); | ||
355 | |||
356 | pr_debug("%s device=%s port=%d index=%d gid %pI6\n", __func__, | ||
357 | ib_dev->name, port, ix, | ||
358 | table->data_vec[ix]->attr.gid.raw); | ||
359 | |||
360 | write_lock_irq(&table->rwlock); | ||
361 | entry = table->data_vec[ix]; | ||
362 | entry->state = GID_TABLE_ENTRY_PENDING_DEL; | ||
363 | /* | ||
364 | * For non RoCE protocol, GID entry slot is ready to use. | ||
365 | */ | ||
366 | if (!rdma_protocol_roce(ib_dev, port)) | ||
367 | table->data_vec[ix] = NULL; | ||
368 | write_unlock_irq(&table->rwlock); | ||
369 | |||
370 | put_gid_entry_locked(entry); | ||
371 | } | ||
372 | |||
373 | /** | ||
341 | * add_modify_gid - Add or modify GID table entry | 374 | * add_modify_gid - Add or modify GID table entry |
342 | * | 375 | * |
343 | * @table: GID table in which GID to be added or modified | 376 | * @table: GID table in which GID to be added or modified |
@@ -358,7 +391,7 @@ static int add_modify_gid(struct ib_gid_table *table, | |||
358 | * this index. | 391 | * this index. |
359 | */ | 392 | */ |
360 | if (is_gid_entry_valid(table->data_vec[attr->index])) | 393 | if (is_gid_entry_valid(table->data_vec[attr->index])) |
361 | put_gid_entry(table->data_vec[attr->index]); | 394 | del_gid(attr->device, attr->port_num, table, attr->index); |
362 | 395 | ||
363 | /* | 396 | /* |
364 | * Some HCA's report multiple GID entries with only one valid GID, and | 397 | * Some HCA's report multiple GID entries with only one valid GID, and |
@@ -386,39 +419,6 @@ done: | |||
386 | return ret; | 419 | return ret; |
387 | } | 420 | } |
388 | 421 | ||
389 | /** | ||
390 | * del_gid - Delete GID table entry | ||
391 | * | ||
392 | * @ib_dev: IB device whose GID entry to be deleted | ||
393 | * @port: Port number of the IB device | ||
394 | * @table: GID table of the IB device for a port | ||
395 | * @ix: GID entry index to delete | ||
396 | * | ||
397 | */ | ||
398 | static void del_gid(struct ib_device *ib_dev, u8 port, | ||
399 | struct ib_gid_table *table, int ix) | ||
400 | { | ||
401 | struct ib_gid_table_entry *entry; | ||
402 | |||
403 | lockdep_assert_held(&table->lock); | ||
404 | |||
405 | pr_debug("%s device=%s port=%d index=%d gid %pI6\n", __func__, | ||
406 | ib_dev->name, port, ix, | ||
407 | table->data_vec[ix]->attr.gid.raw); | ||
408 | |||
409 | write_lock_irq(&table->rwlock); | ||
410 | entry = table->data_vec[ix]; | ||
411 | entry->state = GID_TABLE_ENTRY_PENDING_DEL; | ||
412 | /* | ||
413 | * For non RoCE protocol, GID entry slot is ready to use. | ||
414 | */ | ||
415 | if (!rdma_protocol_roce(ib_dev, port)) | ||
416 | table->data_vec[ix] = NULL; | ||
417 | write_unlock_irq(&table->rwlock); | ||
418 | |||
419 | put_gid_entry_locked(entry); | ||
420 | } | ||
421 | |||
422 | /* rwlock should be read locked, or lock should be held */ | 422 | /* rwlock should be read locked, or lock should be held */ |
423 | static int find_gid(struct ib_gid_table *table, const union ib_gid *gid, | 423 | static int find_gid(struct ib_gid_table *table, const union ib_gid *gid, |
424 | const struct ib_gid_attr *val, bool default_gid, | 424 | const struct ib_gid_attr *val, bool default_gid, |
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 5f437d1570fb..21863ddde63e 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c | |||
@@ -1759,6 +1759,8 @@ static int ucma_close(struct inode *inode, struct file *filp) | |||
1759 | mutex_lock(&mut); | 1759 | mutex_lock(&mut); |
1760 | if (!ctx->closing) { | 1760 | if (!ctx->closing) { |
1761 | mutex_unlock(&mut); | 1761 | mutex_unlock(&mut); |
1762 | ucma_put_ctx(ctx); | ||
1763 | wait_for_completion(&ctx->comp); | ||
1762 | /* rdma_destroy_id ensures that no event handlers are | 1764 | /* rdma_destroy_id ensures that no event handlers are |
1763 | * inflight for that id before releasing it. | 1765 | * inflight for that id before releasing it. |
1764 | */ | 1766 | */ |
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index a21d5214afc3..e012ca80f9d1 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c | |||
@@ -2027,33 +2027,55 @@ static int modify_qp(struct ib_uverbs_file *file, | |||
2027 | 2027 | ||
2028 | if ((cmd->base.attr_mask & IB_QP_CUR_STATE && | 2028 | if ((cmd->base.attr_mask & IB_QP_CUR_STATE && |
2029 | cmd->base.cur_qp_state > IB_QPS_ERR) || | 2029 | cmd->base.cur_qp_state > IB_QPS_ERR) || |
2030 | cmd->base.qp_state > IB_QPS_ERR) { | 2030 | (cmd->base.attr_mask & IB_QP_STATE && |
2031 | cmd->base.qp_state > IB_QPS_ERR)) { | ||
2031 | ret = -EINVAL; | 2032 | ret = -EINVAL; |
2032 | goto release_qp; | 2033 | goto release_qp; |
2033 | } | 2034 | } |
2034 | 2035 | ||
2035 | attr->qp_state = cmd->base.qp_state; | 2036 | if (cmd->base.attr_mask & IB_QP_STATE) |
2036 | attr->cur_qp_state = cmd->base.cur_qp_state; | 2037 | attr->qp_state = cmd->base.qp_state; |
2037 | attr->path_mtu = cmd->base.path_mtu; | 2038 | if (cmd->base.attr_mask & IB_QP_CUR_STATE) |
2038 | attr->path_mig_state = cmd->base.path_mig_state; | 2039 | attr->cur_qp_state = cmd->base.cur_qp_state; |
2039 | attr->qkey = cmd->base.qkey; | 2040 | if (cmd->base.attr_mask & IB_QP_PATH_MTU) |
2040 | attr->rq_psn = cmd->base.rq_psn; | 2041 | attr->path_mtu = cmd->base.path_mtu; |
2041 | attr->sq_psn = cmd->base.sq_psn; | 2042 | if (cmd->base.attr_mask & IB_QP_PATH_MIG_STATE) |
2042 | attr->dest_qp_num = cmd->base.dest_qp_num; | 2043 | attr->path_mig_state = cmd->base.path_mig_state; |
2043 | attr->qp_access_flags = cmd->base.qp_access_flags; | 2044 | if (cmd->base.attr_mask & IB_QP_QKEY) |
2044 | attr->pkey_index = cmd->base.pkey_index; | 2045 | attr->qkey = cmd->base.qkey; |
2045 | attr->alt_pkey_index = cmd->base.alt_pkey_index; | 2046 | if (cmd->base.attr_mask & IB_QP_RQ_PSN) |
2046 | attr->en_sqd_async_notify = cmd->base.en_sqd_async_notify; | 2047 | attr->rq_psn = cmd->base.rq_psn; |
2047 | attr->max_rd_atomic = cmd->base.max_rd_atomic; | 2048 | if (cmd->base.attr_mask & IB_QP_SQ_PSN) |
2048 | attr->max_dest_rd_atomic = cmd->base.max_dest_rd_atomic; | 2049 | attr->sq_psn = cmd->base.sq_psn; |
2049 | attr->min_rnr_timer = cmd->base.min_rnr_timer; | 2050 | if (cmd->base.attr_mask & IB_QP_DEST_QPN) |
2050 | attr->port_num = cmd->base.port_num; | 2051 | attr->dest_qp_num = cmd->base.dest_qp_num; |
2051 | attr->timeout = cmd->base.timeout; | 2052 | if (cmd->base.attr_mask & IB_QP_ACCESS_FLAGS) |
2052 | attr->retry_cnt = cmd->base.retry_cnt; | 2053 | attr->qp_access_flags = cmd->base.qp_access_flags; |
2053 | attr->rnr_retry = cmd->base.rnr_retry; | 2054 | if (cmd->base.attr_mask & IB_QP_PKEY_INDEX) |
2054 | attr->alt_port_num = cmd->base.alt_port_num; | 2055 | attr->pkey_index = cmd->base.pkey_index; |
2055 | attr->alt_timeout = cmd->base.alt_timeout; | 2056 | if (cmd->base.attr_mask & IB_QP_EN_SQD_ASYNC_NOTIFY) |
2056 | attr->rate_limit = cmd->rate_limit; | 2057 | attr->en_sqd_async_notify = cmd->base.en_sqd_async_notify; |
2058 | if (cmd->base.attr_mask & IB_QP_MAX_QP_RD_ATOMIC) | ||
2059 | attr->max_rd_atomic = cmd->base.max_rd_atomic; | ||
2060 | if (cmd->base.attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) | ||
2061 | attr->max_dest_rd_atomic = cmd->base.max_dest_rd_atomic; | ||
2062 | if (cmd->base.attr_mask & IB_QP_MIN_RNR_TIMER) | ||
2063 | attr->min_rnr_timer = cmd->base.min_rnr_timer; | ||
2064 | if (cmd->base.attr_mask & IB_QP_PORT) | ||
2065 | attr->port_num = cmd->base.port_num; | ||
2066 | if (cmd->base.attr_mask & IB_QP_TIMEOUT) | ||
2067 | attr->timeout = cmd->base.timeout; | ||
2068 | if (cmd->base.attr_mask & IB_QP_RETRY_CNT) | ||
2069 | attr->retry_cnt = cmd->base.retry_cnt; | ||
2070 | if (cmd->base.attr_mask & IB_QP_RNR_RETRY) | ||
2071 | attr->rnr_retry = cmd->base.rnr_retry; | ||
2072 | if (cmd->base.attr_mask & IB_QP_ALT_PATH) { | ||
2073 | attr->alt_port_num = cmd->base.alt_port_num; | ||
2074 | attr->alt_timeout = cmd->base.alt_timeout; | ||
2075 | attr->alt_pkey_index = cmd->base.alt_pkey_index; | ||
2076 | } | ||
2077 | if (cmd->base.attr_mask & IB_QP_RATE_LIMIT) | ||
2078 | attr->rate_limit = cmd->rate_limit; | ||
2057 | 2079 | ||
2058 | if (cmd->base.attr_mask & IB_QP_AV) | 2080 | if (cmd->base.attr_mask & IB_QP_AV) |
2059 | copy_ah_attr_from_uverbs(qp->device, &attr->ah_attr, | 2081 | copy_ah_attr_from_uverbs(qp->device, &attr->ah_attr, |
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 6d974e2363df..50152c1b1004 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c | |||
@@ -440,6 +440,7 @@ static int ib_uverbs_comp_event_close(struct inode *inode, struct file *filp) | |||
440 | list_del(&entry->obj_list); | 440 | list_del(&entry->obj_list); |
441 | kfree(entry); | 441 | kfree(entry); |
442 | } | 442 | } |
443 | file->ev_queue.is_closed = 1; | ||
443 | spin_unlock_irq(&file->ev_queue.lock); | 444 | spin_unlock_irq(&file->ev_queue.lock); |
444 | 445 | ||
445 | uverbs_close_fd(filp); | 446 | uverbs_close_fd(filp); |
diff --git a/drivers/infiniband/core/uverbs_uapi.c b/drivers/infiniband/core/uverbs_uapi.c index 73ea6f0db88f..be854628a7c6 100644 --- a/drivers/infiniband/core/uverbs_uapi.c +++ b/drivers/infiniband/core/uverbs_uapi.c | |||
@@ -248,6 +248,7 @@ void uverbs_destroy_api(struct uverbs_api *uapi) | |||
248 | kfree(rcu_dereference_protected(*slot, true)); | 248 | kfree(rcu_dereference_protected(*slot, true)); |
249 | radix_tree_iter_delete(&uapi->radix, &iter, slot); | 249 | radix_tree_iter_delete(&uapi->radix, &iter, slot); |
250 | } | 250 | } |
251 | kfree(uapi); | ||
251 | } | 252 | } |
252 | 253 | ||
253 | struct uverbs_api *uverbs_alloc_api( | 254 | struct uverbs_api *uverbs_alloc_api( |
diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 20b9f31052bf..85cd1a3593d6 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c | |||
@@ -78,7 +78,7 @@ static struct list_head bnxt_re_dev_list = LIST_HEAD_INIT(bnxt_re_dev_list); | |||
78 | /* Mutex to protect the list of bnxt_re devices added */ | 78 | /* Mutex to protect the list of bnxt_re devices added */ |
79 | static DEFINE_MUTEX(bnxt_re_dev_lock); | 79 | static DEFINE_MUTEX(bnxt_re_dev_lock); |
80 | static struct workqueue_struct *bnxt_re_wq; | 80 | static struct workqueue_struct *bnxt_re_wq; |
81 | static void bnxt_re_ib_unreg(struct bnxt_re_dev *rdev, bool lock_wait); | 81 | static void bnxt_re_ib_unreg(struct bnxt_re_dev *rdev); |
82 | 82 | ||
83 | /* SR-IOV helper functions */ | 83 | /* SR-IOV helper functions */ |
84 | 84 | ||
@@ -182,7 +182,7 @@ static void bnxt_re_shutdown(void *p) | |||
182 | if (!rdev) | 182 | if (!rdev) |
183 | return; | 183 | return; |
184 | 184 | ||
185 | bnxt_re_ib_unreg(rdev, false); | 185 | bnxt_re_ib_unreg(rdev); |
186 | } | 186 | } |
187 | 187 | ||
188 | static void bnxt_re_stop_irq(void *handle) | 188 | static void bnxt_re_stop_irq(void *handle) |
@@ -251,7 +251,7 @@ static struct bnxt_ulp_ops bnxt_re_ulp_ops = { | |||
251 | /* Driver registration routines used to let the networking driver (bnxt_en) | 251 | /* Driver registration routines used to let the networking driver (bnxt_en) |
252 | * to know that the RoCE driver is now installed | 252 | * to know that the RoCE driver is now installed |
253 | */ | 253 | */ |
254 | static int bnxt_re_unregister_netdev(struct bnxt_re_dev *rdev, bool lock_wait) | 254 | static int bnxt_re_unregister_netdev(struct bnxt_re_dev *rdev) |
255 | { | 255 | { |
256 | struct bnxt_en_dev *en_dev; | 256 | struct bnxt_en_dev *en_dev; |
257 | int rc; | 257 | int rc; |
@@ -260,14 +260,9 @@ static int bnxt_re_unregister_netdev(struct bnxt_re_dev *rdev, bool lock_wait) | |||
260 | return -EINVAL; | 260 | return -EINVAL; |
261 | 261 | ||
262 | en_dev = rdev->en_dev; | 262 | en_dev = rdev->en_dev; |
263 | /* Acquire rtnl lock if it is not invokded from netdev event */ | ||
264 | if (lock_wait) | ||
265 | rtnl_lock(); | ||
266 | 263 | ||
267 | rc = en_dev->en_ops->bnxt_unregister_device(rdev->en_dev, | 264 | rc = en_dev->en_ops->bnxt_unregister_device(rdev->en_dev, |
268 | BNXT_ROCE_ULP); | 265 | BNXT_ROCE_ULP); |
269 | if (lock_wait) | ||
270 | rtnl_unlock(); | ||
271 | return rc; | 266 | return rc; |
272 | } | 267 | } |
273 | 268 | ||
@@ -281,14 +276,12 @@ static int bnxt_re_register_netdev(struct bnxt_re_dev *rdev) | |||
281 | 276 | ||
282 | en_dev = rdev->en_dev; | 277 | en_dev = rdev->en_dev; |
283 | 278 | ||
284 | rtnl_lock(); | ||
285 | rc = en_dev->en_ops->bnxt_register_device(en_dev, BNXT_ROCE_ULP, | 279 | rc = en_dev->en_ops->bnxt_register_device(en_dev, BNXT_ROCE_ULP, |
286 | &bnxt_re_ulp_ops, rdev); | 280 | &bnxt_re_ulp_ops, rdev); |
287 | rtnl_unlock(); | ||
288 | return rc; | 281 | return rc; |
289 | } | 282 | } |
290 | 283 | ||
291 | static int bnxt_re_free_msix(struct bnxt_re_dev *rdev, bool lock_wait) | 284 | static int bnxt_re_free_msix(struct bnxt_re_dev *rdev) |
292 | { | 285 | { |
293 | struct bnxt_en_dev *en_dev; | 286 | struct bnxt_en_dev *en_dev; |
294 | int rc; | 287 | int rc; |
@@ -298,13 +291,9 @@ static int bnxt_re_free_msix(struct bnxt_re_dev *rdev, bool lock_wait) | |||
298 | 291 | ||
299 | en_dev = rdev->en_dev; | 292 | en_dev = rdev->en_dev; |
300 | 293 | ||
301 | if (lock_wait) | ||
302 | rtnl_lock(); | ||
303 | 294 | ||
304 | rc = en_dev->en_ops->bnxt_free_msix(rdev->en_dev, BNXT_ROCE_ULP); | 295 | rc = en_dev->en_ops->bnxt_free_msix(rdev->en_dev, BNXT_ROCE_ULP); |
305 | 296 | ||
306 | if (lock_wait) | ||
307 | rtnl_unlock(); | ||
308 | return rc; | 297 | return rc; |
309 | } | 298 | } |
310 | 299 | ||
@@ -320,7 +309,6 @@ static int bnxt_re_request_msix(struct bnxt_re_dev *rdev) | |||
320 | 309 | ||
321 | num_msix_want = min_t(u32, BNXT_RE_MAX_MSIX, num_online_cpus()); | 310 | num_msix_want = min_t(u32, BNXT_RE_MAX_MSIX, num_online_cpus()); |
322 | 311 | ||
323 | rtnl_lock(); | ||
324 | num_msix_got = en_dev->en_ops->bnxt_request_msix(en_dev, BNXT_ROCE_ULP, | 312 | num_msix_got = en_dev->en_ops->bnxt_request_msix(en_dev, BNXT_ROCE_ULP, |
325 | rdev->msix_entries, | 313 | rdev->msix_entries, |
326 | num_msix_want); | 314 | num_msix_want); |
@@ -335,7 +323,6 @@ static int bnxt_re_request_msix(struct bnxt_re_dev *rdev) | |||
335 | } | 323 | } |
336 | rdev->num_msix = num_msix_got; | 324 | rdev->num_msix = num_msix_got; |
337 | done: | 325 | done: |
338 | rtnl_unlock(); | ||
339 | return rc; | 326 | return rc; |
340 | } | 327 | } |
341 | 328 | ||
@@ -358,24 +345,18 @@ static void bnxt_re_fill_fw_msg(struct bnxt_fw_msg *fw_msg, void *msg, | |||
358 | fw_msg->timeout = timeout; | 345 | fw_msg->timeout = timeout; |
359 | } | 346 | } |
360 | 347 | ||
361 | static int bnxt_re_net_ring_free(struct bnxt_re_dev *rdev, u16 fw_ring_id, | 348 | static int bnxt_re_net_ring_free(struct bnxt_re_dev *rdev, u16 fw_ring_id) |
362 | bool lock_wait) | ||
363 | { | 349 | { |
364 | struct bnxt_en_dev *en_dev = rdev->en_dev; | 350 | struct bnxt_en_dev *en_dev = rdev->en_dev; |
365 | struct hwrm_ring_free_input req = {0}; | 351 | struct hwrm_ring_free_input req = {0}; |
366 | struct hwrm_ring_free_output resp; | 352 | struct hwrm_ring_free_output resp; |
367 | struct bnxt_fw_msg fw_msg; | 353 | struct bnxt_fw_msg fw_msg; |
368 | bool do_unlock = false; | ||
369 | int rc = -EINVAL; | 354 | int rc = -EINVAL; |
370 | 355 | ||
371 | if (!en_dev) | 356 | if (!en_dev) |
372 | return rc; | 357 | return rc; |
373 | 358 | ||
374 | memset(&fw_msg, 0, sizeof(fw_msg)); | 359 | memset(&fw_msg, 0, sizeof(fw_msg)); |
375 | if (lock_wait) { | ||
376 | rtnl_lock(); | ||
377 | do_unlock = true; | ||
378 | } | ||
379 | 360 | ||
380 | bnxt_re_init_hwrm_hdr(rdev, (void *)&req, HWRM_RING_FREE, -1, -1); | 361 | bnxt_re_init_hwrm_hdr(rdev, (void *)&req, HWRM_RING_FREE, -1, -1); |
381 | req.ring_type = RING_ALLOC_REQ_RING_TYPE_L2_CMPL; | 362 | req.ring_type = RING_ALLOC_REQ_RING_TYPE_L2_CMPL; |
@@ -386,8 +367,6 @@ static int bnxt_re_net_ring_free(struct bnxt_re_dev *rdev, u16 fw_ring_id, | |||
386 | if (rc) | 367 | if (rc) |
387 | dev_err(rdev_to_dev(rdev), | 368 | dev_err(rdev_to_dev(rdev), |
388 | "Failed to free HW ring:%d :%#x", req.ring_id, rc); | 369 | "Failed to free HW ring:%d :%#x", req.ring_id, rc); |
389 | if (do_unlock) | ||
390 | rtnl_unlock(); | ||
391 | return rc; | 370 | return rc; |
392 | } | 371 | } |
393 | 372 | ||
@@ -405,7 +384,6 @@ static int bnxt_re_net_ring_alloc(struct bnxt_re_dev *rdev, dma_addr_t *dma_arr, | |||
405 | return rc; | 384 | return rc; |
406 | 385 | ||
407 | memset(&fw_msg, 0, sizeof(fw_msg)); | 386 | memset(&fw_msg, 0, sizeof(fw_msg)); |
408 | rtnl_lock(); | ||
409 | bnxt_re_init_hwrm_hdr(rdev, (void *)&req, HWRM_RING_ALLOC, -1, -1); | 387 | bnxt_re_init_hwrm_hdr(rdev, (void *)&req, HWRM_RING_ALLOC, -1, -1); |
410 | req.enables = 0; | 388 | req.enables = 0; |
411 | req.page_tbl_addr = cpu_to_le64(dma_arr[0]); | 389 | req.page_tbl_addr = cpu_to_le64(dma_arr[0]); |
@@ -426,27 +404,21 @@ static int bnxt_re_net_ring_alloc(struct bnxt_re_dev *rdev, dma_addr_t *dma_arr, | |||
426 | if (!rc) | 404 | if (!rc) |
427 | *fw_ring_id = le16_to_cpu(resp.ring_id); | 405 | *fw_ring_id = le16_to_cpu(resp.ring_id); |
428 | 406 | ||
429 | rtnl_unlock(); | ||
430 | return rc; | 407 | return rc; |
431 | } | 408 | } |
432 | 409 | ||
433 | static int bnxt_re_net_stats_ctx_free(struct bnxt_re_dev *rdev, | 410 | static int bnxt_re_net_stats_ctx_free(struct bnxt_re_dev *rdev, |
434 | u32 fw_stats_ctx_id, bool lock_wait) | 411 | u32 fw_stats_ctx_id) |
435 | { | 412 | { |
436 | struct bnxt_en_dev *en_dev = rdev->en_dev; | 413 | struct bnxt_en_dev *en_dev = rdev->en_dev; |
437 | struct hwrm_stat_ctx_free_input req = {0}; | 414 | struct hwrm_stat_ctx_free_input req = {0}; |
438 | struct bnxt_fw_msg fw_msg; | 415 | struct bnxt_fw_msg fw_msg; |
439 | bool do_unlock = false; | ||
440 | int rc = -EINVAL; | 416 | int rc = -EINVAL; |
441 | 417 | ||
442 | if (!en_dev) | 418 | if (!en_dev) |
443 | return rc; | 419 | return rc; |
444 | 420 | ||
445 | memset(&fw_msg, 0, sizeof(fw_msg)); | 421 | memset(&fw_msg, 0, sizeof(fw_msg)); |
446 | if (lock_wait) { | ||
447 | rtnl_lock(); | ||
448 | do_unlock = true; | ||
449 | } | ||
450 | 422 | ||
451 | bnxt_re_init_hwrm_hdr(rdev, (void *)&req, HWRM_STAT_CTX_FREE, -1, -1); | 423 | bnxt_re_init_hwrm_hdr(rdev, (void *)&req, HWRM_STAT_CTX_FREE, -1, -1); |
452 | req.stat_ctx_id = cpu_to_le32(fw_stats_ctx_id); | 424 | req.stat_ctx_id = cpu_to_le32(fw_stats_ctx_id); |
@@ -457,8 +429,6 @@ static int bnxt_re_net_stats_ctx_free(struct bnxt_re_dev *rdev, | |||
457 | dev_err(rdev_to_dev(rdev), | 429 | dev_err(rdev_to_dev(rdev), |
458 | "Failed to free HW stats context %#x", rc); | 430 | "Failed to free HW stats context %#x", rc); |
459 | 431 | ||
460 | if (do_unlock) | ||
461 | rtnl_unlock(); | ||
462 | return rc; | 432 | return rc; |
463 | } | 433 | } |
464 | 434 | ||
@@ -478,7 +448,6 @@ static int bnxt_re_net_stats_ctx_alloc(struct bnxt_re_dev *rdev, | |||
478 | return rc; | 448 | return rc; |
479 | 449 | ||
480 | memset(&fw_msg, 0, sizeof(fw_msg)); | 450 | memset(&fw_msg, 0, sizeof(fw_msg)); |
481 | rtnl_lock(); | ||
482 | 451 | ||
483 | bnxt_re_init_hwrm_hdr(rdev, (void *)&req, HWRM_STAT_CTX_ALLOC, -1, -1); | 452 | bnxt_re_init_hwrm_hdr(rdev, (void *)&req, HWRM_STAT_CTX_ALLOC, -1, -1); |
484 | req.update_period_ms = cpu_to_le32(1000); | 453 | req.update_period_ms = cpu_to_le32(1000); |
@@ -490,7 +459,6 @@ static int bnxt_re_net_stats_ctx_alloc(struct bnxt_re_dev *rdev, | |||
490 | if (!rc) | 459 | if (!rc) |
491 | *fw_stats_ctx_id = le32_to_cpu(resp.stat_ctx_id); | 460 | *fw_stats_ctx_id = le32_to_cpu(resp.stat_ctx_id); |
492 | 461 | ||
493 | rtnl_unlock(); | ||
494 | return rc; | 462 | return rc; |
495 | } | 463 | } |
496 | 464 | ||
@@ -929,19 +897,19 @@ fail: | |||
929 | return rc; | 897 | return rc; |
930 | } | 898 | } |
931 | 899 | ||
932 | static void bnxt_re_free_nq_res(struct bnxt_re_dev *rdev, bool lock_wait) | 900 | static void bnxt_re_free_nq_res(struct bnxt_re_dev *rdev) |
933 | { | 901 | { |
934 | int i; | 902 | int i; |
935 | 903 | ||
936 | for (i = 0; i < rdev->num_msix - 1; i++) { | 904 | for (i = 0; i < rdev->num_msix - 1; i++) { |
937 | bnxt_re_net_ring_free(rdev, rdev->nq[i].ring_id, lock_wait); | 905 | bnxt_re_net_ring_free(rdev, rdev->nq[i].ring_id); |
938 | bnxt_qplib_free_nq(&rdev->nq[i]); | 906 | bnxt_qplib_free_nq(&rdev->nq[i]); |
939 | } | 907 | } |
940 | } | 908 | } |
941 | 909 | ||
942 | static void bnxt_re_free_res(struct bnxt_re_dev *rdev, bool lock_wait) | 910 | static void bnxt_re_free_res(struct bnxt_re_dev *rdev) |
943 | { | 911 | { |
944 | bnxt_re_free_nq_res(rdev, lock_wait); | 912 | bnxt_re_free_nq_res(rdev); |
945 | 913 | ||
946 | if (rdev->qplib_res.dpi_tbl.max) { | 914 | if (rdev->qplib_res.dpi_tbl.max) { |
947 | bnxt_qplib_dealloc_dpi(&rdev->qplib_res, | 915 | bnxt_qplib_dealloc_dpi(&rdev->qplib_res, |
@@ -1219,7 +1187,7 @@ static int bnxt_re_setup_qos(struct bnxt_re_dev *rdev) | |||
1219 | return 0; | 1187 | return 0; |
1220 | } | 1188 | } |
1221 | 1189 | ||
1222 | static void bnxt_re_ib_unreg(struct bnxt_re_dev *rdev, bool lock_wait) | 1190 | static void bnxt_re_ib_unreg(struct bnxt_re_dev *rdev) |
1223 | { | 1191 | { |
1224 | int i, rc; | 1192 | int i, rc; |
1225 | 1193 | ||
@@ -1234,28 +1202,27 @@ static void bnxt_re_ib_unreg(struct bnxt_re_dev *rdev, bool lock_wait) | |||
1234 | cancel_delayed_work(&rdev->worker); | 1202 | cancel_delayed_work(&rdev->worker); |
1235 | 1203 | ||
1236 | bnxt_re_cleanup_res(rdev); | 1204 | bnxt_re_cleanup_res(rdev); |
1237 | bnxt_re_free_res(rdev, lock_wait); | 1205 | bnxt_re_free_res(rdev); |
1238 | 1206 | ||
1239 | if (test_and_clear_bit(BNXT_RE_FLAG_RCFW_CHANNEL_EN, &rdev->flags)) { | 1207 | if (test_and_clear_bit(BNXT_RE_FLAG_RCFW_CHANNEL_EN, &rdev->flags)) { |
1240 | rc = bnxt_qplib_deinit_rcfw(&rdev->rcfw); | 1208 | rc = bnxt_qplib_deinit_rcfw(&rdev->rcfw); |
1241 | if (rc) | 1209 | if (rc) |
1242 | dev_warn(rdev_to_dev(rdev), | 1210 | dev_warn(rdev_to_dev(rdev), |
1243 | "Failed to deinitialize RCFW: %#x", rc); | 1211 | "Failed to deinitialize RCFW: %#x", rc); |
1244 | bnxt_re_net_stats_ctx_free(rdev, rdev->qplib_ctx.stats.fw_id, | 1212 | bnxt_re_net_stats_ctx_free(rdev, rdev->qplib_ctx.stats.fw_id); |
1245 | lock_wait); | ||
1246 | bnxt_qplib_free_ctx(rdev->en_dev->pdev, &rdev->qplib_ctx); | 1213 | bnxt_qplib_free_ctx(rdev->en_dev->pdev, &rdev->qplib_ctx); |
1247 | bnxt_qplib_disable_rcfw_channel(&rdev->rcfw); | 1214 | bnxt_qplib_disable_rcfw_channel(&rdev->rcfw); |
1248 | bnxt_re_net_ring_free(rdev, rdev->rcfw.creq_ring_id, lock_wait); | 1215 | bnxt_re_net_ring_free(rdev, rdev->rcfw.creq_ring_id); |
1249 | bnxt_qplib_free_rcfw_channel(&rdev->rcfw); | 1216 | bnxt_qplib_free_rcfw_channel(&rdev->rcfw); |
1250 | } | 1217 | } |
1251 | if (test_and_clear_bit(BNXT_RE_FLAG_GOT_MSIX, &rdev->flags)) { | 1218 | if (test_and_clear_bit(BNXT_RE_FLAG_GOT_MSIX, &rdev->flags)) { |
1252 | rc = bnxt_re_free_msix(rdev, lock_wait); | 1219 | rc = bnxt_re_free_msix(rdev); |
1253 | if (rc) | 1220 | if (rc) |
1254 | dev_warn(rdev_to_dev(rdev), | 1221 | dev_warn(rdev_to_dev(rdev), |
1255 | "Failed to free MSI-X vectors: %#x", rc); | 1222 | "Failed to free MSI-X vectors: %#x", rc); |
1256 | } | 1223 | } |
1257 | if (test_and_clear_bit(BNXT_RE_FLAG_NETDEV_REGISTERED, &rdev->flags)) { | 1224 | if (test_and_clear_bit(BNXT_RE_FLAG_NETDEV_REGISTERED, &rdev->flags)) { |
1258 | rc = bnxt_re_unregister_netdev(rdev, lock_wait); | 1225 | rc = bnxt_re_unregister_netdev(rdev); |
1259 | if (rc) | 1226 | if (rc) |
1260 | dev_warn(rdev_to_dev(rdev), | 1227 | dev_warn(rdev_to_dev(rdev), |
1261 | "Failed to unregister with netdev: %#x", rc); | 1228 | "Failed to unregister with netdev: %#x", rc); |
@@ -1276,6 +1243,12 @@ static int bnxt_re_ib_reg(struct bnxt_re_dev *rdev) | |||
1276 | { | 1243 | { |
1277 | int i, j, rc; | 1244 | int i, j, rc; |
1278 | 1245 | ||
1246 | bool locked; | ||
1247 | |||
1248 | /* Acquire rtnl lock through out this function */ | ||
1249 | rtnl_lock(); | ||
1250 | locked = true; | ||
1251 | |||
1279 | /* Registered a new RoCE device instance to netdev */ | 1252 | /* Registered a new RoCE device instance to netdev */ |
1280 | rc = bnxt_re_register_netdev(rdev); | 1253 | rc = bnxt_re_register_netdev(rdev); |
1281 | if (rc) { | 1254 | if (rc) { |
@@ -1374,12 +1347,16 @@ static int bnxt_re_ib_reg(struct bnxt_re_dev *rdev) | |||
1374 | schedule_delayed_work(&rdev->worker, msecs_to_jiffies(30000)); | 1347 | schedule_delayed_work(&rdev->worker, msecs_to_jiffies(30000)); |
1375 | } | 1348 | } |
1376 | 1349 | ||
1350 | rtnl_unlock(); | ||
1351 | locked = false; | ||
1352 | |||
1377 | /* Register ib dev */ | 1353 | /* Register ib dev */ |
1378 | rc = bnxt_re_register_ib(rdev); | 1354 | rc = bnxt_re_register_ib(rdev); |
1379 | if (rc) { | 1355 | if (rc) { |
1380 | pr_err("Failed to register with IB: %#x\n", rc); | 1356 | pr_err("Failed to register with IB: %#x\n", rc); |
1381 | goto fail; | 1357 | goto fail; |
1382 | } | 1358 | } |
1359 | set_bit(BNXT_RE_FLAG_IBDEV_REGISTERED, &rdev->flags); | ||
1383 | dev_info(rdev_to_dev(rdev), "Device registered successfully"); | 1360 | dev_info(rdev_to_dev(rdev), "Device registered successfully"); |
1384 | for (i = 0; i < ARRAY_SIZE(bnxt_re_attributes); i++) { | 1361 | for (i = 0; i < ARRAY_SIZE(bnxt_re_attributes); i++) { |
1385 | rc = device_create_file(&rdev->ibdev.dev, | 1362 | rc = device_create_file(&rdev->ibdev.dev, |
@@ -1395,7 +1372,6 @@ static int bnxt_re_ib_reg(struct bnxt_re_dev *rdev) | |||
1395 | goto fail; | 1372 | goto fail; |
1396 | } | 1373 | } |
1397 | } | 1374 | } |
1398 | set_bit(BNXT_RE_FLAG_IBDEV_REGISTERED, &rdev->flags); | ||
1399 | ib_get_eth_speed(&rdev->ibdev, 1, &rdev->active_speed, | 1375 | ib_get_eth_speed(&rdev->ibdev, 1, &rdev->active_speed, |
1400 | &rdev->active_width); | 1376 | &rdev->active_width); |
1401 | set_bit(BNXT_RE_FLAG_ISSUE_ROCE_STATS, &rdev->flags); | 1377 | set_bit(BNXT_RE_FLAG_ISSUE_ROCE_STATS, &rdev->flags); |
@@ -1404,17 +1380,21 @@ static int bnxt_re_ib_reg(struct bnxt_re_dev *rdev) | |||
1404 | 1380 | ||
1405 | return 0; | 1381 | return 0; |
1406 | free_sctx: | 1382 | free_sctx: |
1407 | bnxt_re_net_stats_ctx_free(rdev, rdev->qplib_ctx.stats.fw_id, true); | 1383 | bnxt_re_net_stats_ctx_free(rdev, rdev->qplib_ctx.stats.fw_id); |
1408 | free_ctx: | 1384 | free_ctx: |
1409 | bnxt_qplib_free_ctx(rdev->en_dev->pdev, &rdev->qplib_ctx); | 1385 | bnxt_qplib_free_ctx(rdev->en_dev->pdev, &rdev->qplib_ctx); |
1410 | disable_rcfw: | 1386 | disable_rcfw: |
1411 | bnxt_qplib_disable_rcfw_channel(&rdev->rcfw); | 1387 | bnxt_qplib_disable_rcfw_channel(&rdev->rcfw); |
1412 | free_ring: | 1388 | free_ring: |
1413 | bnxt_re_net_ring_free(rdev, rdev->rcfw.creq_ring_id, true); | 1389 | bnxt_re_net_ring_free(rdev, rdev->rcfw.creq_ring_id); |
1414 | free_rcfw: | 1390 | free_rcfw: |
1415 | bnxt_qplib_free_rcfw_channel(&rdev->rcfw); | 1391 | bnxt_qplib_free_rcfw_channel(&rdev->rcfw); |
1416 | fail: | 1392 | fail: |
1417 | bnxt_re_ib_unreg(rdev, true); | 1393 | if (!locked) |
1394 | rtnl_lock(); | ||
1395 | bnxt_re_ib_unreg(rdev); | ||
1396 | rtnl_unlock(); | ||
1397 | |||
1418 | return rc; | 1398 | return rc; |
1419 | } | 1399 | } |
1420 | 1400 | ||
@@ -1567,7 +1547,7 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier, | |||
1567 | */ | 1547 | */ |
1568 | if (atomic_read(&rdev->sched_count) > 0) | 1548 | if (atomic_read(&rdev->sched_count) > 0) |
1569 | goto exit; | 1549 | goto exit; |
1570 | bnxt_re_ib_unreg(rdev, false); | 1550 | bnxt_re_ib_unreg(rdev); |
1571 | bnxt_re_remove_one(rdev); | 1551 | bnxt_re_remove_one(rdev); |
1572 | bnxt_re_dev_unreg(rdev); | 1552 | bnxt_re_dev_unreg(rdev); |
1573 | break; | 1553 | break; |
@@ -1646,7 +1626,10 @@ static void __exit bnxt_re_mod_exit(void) | |||
1646 | */ | 1626 | */ |
1647 | flush_workqueue(bnxt_re_wq); | 1627 | flush_workqueue(bnxt_re_wq); |
1648 | bnxt_re_dev_stop(rdev); | 1628 | bnxt_re_dev_stop(rdev); |
1649 | bnxt_re_ib_unreg(rdev, true); | 1629 | /* Acquire the rtnl_lock as the L2 resources are freed here */ |
1630 | rtnl_lock(); | ||
1631 | bnxt_re_ib_unreg(rdev); | ||
1632 | rtnl_unlock(); | ||
1650 | bnxt_re_remove_one(rdev); | 1633 | bnxt_re_remove_one(rdev); |
1651 | bnxt_re_dev_unreg(rdev); | 1634 | bnxt_re_dev_unreg(rdev); |
1652 | } | 1635 | } |
diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c index 2c19bf772451..e1668bcc2d13 100644 --- a/drivers/infiniband/hw/hfi1/chip.c +++ b/drivers/infiniband/hw/hfi1/chip.c | |||
@@ -6733,6 +6733,7 @@ void start_freeze_handling(struct hfi1_pportdata *ppd, int flags) | |||
6733 | struct hfi1_devdata *dd = ppd->dd; | 6733 | struct hfi1_devdata *dd = ppd->dd; |
6734 | struct send_context *sc; | 6734 | struct send_context *sc; |
6735 | int i; | 6735 | int i; |
6736 | int sc_flags; | ||
6736 | 6737 | ||
6737 | if (flags & FREEZE_SELF) | 6738 | if (flags & FREEZE_SELF) |
6738 | write_csr(dd, CCE_CTRL, CCE_CTRL_SPC_FREEZE_SMASK); | 6739 | write_csr(dd, CCE_CTRL, CCE_CTRL_SPC_FREEZE_SMASK); |
@@ -6743,11 +6744,13 @@ void start_freeze_handling(struct hfi1_pportdata *ppd, int flags) | |||
6743 | /* notify all SDMA engines that they are going into a freeze */ | 6744 | /* notify all SDMA engines that they are going into a freeze */ |
6744 | sdma_freeze_notify(dd, !!(flags & FREEZE_LINK_DOWN)); | 6745 | sdma_freeze_notify(dd, !!(flags & FREEZE_LINK_DOWN)); |
6745 | 6746 | ||
6747 | sc_flags = SCF_FROZEN | SCF_HALTED | (flags & FREEZE_LINK_DOWN ? | ||
6748 | SCF_LINK_DOWN : 0); | ||
6746 | /* do halt pre-handling on all enabled send contexts */ | 6749 | /* do halt pre-handling on all enabled send contexts */ |
6747 | for (i = 0; i < dd->num_send_contexts; i++) { | 6750 | for (i = 0; i < dd->num_send_contexts; i++) { |
6748 | sc = dd->send_contexts[i].sc; | 6751 | sc = dd->send_contexts[i].sc; |
6749 | if (sc && (sc->flags & SCF_ENABLED)) | 6752 | if (sc && (sc->flags & SCF_ENABLED)) |
6750 | sc_stop(sc, SCF_FROZEN | SCF_HALTED); | 6753 | sc_stop(sc, sc_flags); |
6751 | } | 6754 | } |
6752 | 6755 | ||
6753 | /* Send context are frozen. Notify user space */ | 6756 | /* Send context are frozen. Notify user space */ |
@@ -10674,6 +10677,7 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state) | |||
10674 | add_rcvctrl(dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK); | 10677 | add_rcvctrl(dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK); |
10675 | 10678 | ||
10676 | handle_linkup_change(dd, 1); | 10679 | handle_linkup_change(dd, 1); |
10680 | pio_kernel_linkup(dd); | ||
10677 | 10681 | ||
10678 | /* | 10682 | /* |
10679 | * After link up, a new link width will have been set. | 10683 | * After link up, a new link width will have been set. |
diff --git a/drivers/infiniband/hw/hfi1/pio.c b/drivers/infiniband/hw/hfi1/pio.c index c2c1cba5b23b..752057647f09 100644 --- a/drivers/infiniband/hw/hfi1/pio.c +++ b/drivers/infiniband/hw/hfi1/pio.c | |||
@@ -86,6 +86,7 @@ void pio_send_control(struct hfi1_devdata *dd, int op) | |||
86 | unsigned long flags; | 86 | unsigned long flags; |
87 | int write = 1; /* write sendctrl back */ | 87 | int write = 1; /* write sendctrl back */ |
88 | int flush = 0; /* re-read sendctrl to make sure it is flushed */ | 88 | int flush = 0; /* re-read sendctrl to make sure it is flushed */ |
89 | int i; | ||
89 | 90 | ||
90 | spin_lock_irqsave(&dd->sendctrl_lock, flags); | 91 | spin_lock_irqsave(&dd->sendctrl_lock, flags); |
91 | 92 | ||
@@ -95,9 +96,13 @@ void pio_send_control(struct hfi1_devdata *dd, int op) | |||
95 | reg |= SEND_CTRL_SEND_ENABLE_SMASK; | 96 | reg |= SEND_CTRL_SEND_ENABLE_SMASK; |
96 | /* Fall through */ | 97 | /* Fall through */ |
97 | case PSC_DATA_VL_ENABLE: | 98 | case PSC_DATA_VL_ENABLE: |
99 | mask = 0; | ||
100 | for (i = 0; i < ARRAY_SIZE(dd->vld); i++) | ||
101 | if (!dd->vld[i].mtu) | ||
102 | mask |= BIT_ULL(i); | ||
98 | /* Disallow sending on VLs not enabled */ | 103 | /* Disallow sending on VLs not enabled */ |
99 | mask = (((~0ull) << num_vls) & SEND_CTRL_UNSUPPORTED_VL_MASK) << | 104 | mask = (mask & SEND_CTRL_UNSUPPORTED_VL_MASK) << |
100 | SEND_CTRL_UNSUPPORTED_VL_SHIFT; | 105 | SEND_CTRL_UNSUPPORTED_VL_SHIFT; |
101 | reg = (reg & ~SEND_CTRL_UNSUPPORTED_VL_SMASK) | mask; | 106 | reg = (reg & ~SEND_CTRL_UNSUPPORTED_VL_SMASK) | mask; |
102 | break; | 107 | break; |
103 | case PSC_GLOBAL_DISABLE: | 108 | case PSC_GLOBAL_DISABLE: |
@@ -921,20 +926,18 @@ void sc_free(struct send_context *sc) | |||
921 | void sc_disable(struct send_context *sc) | 926 | void sc_disable(struct send_context *sc) |
922 | { | 927 | { |
923 | u64 reg; | 928 | u64 reg; |
924 | unsigned long flags; | ||
925 | struct pio_buf *pbuf; | 929 | struct pio_buf *pbuf; |
926 | 930 | ||
927 | if (!sc) | 931 | if (!sc) |
928 | return; | 932 | return; |
929 | 933 | ||
930 | /* do all steps, even if already disabled */ | 934 | /* do all steps, even if already disabled */ |
931 | spin_lock_irqsave(&sc->alloc_lock, flags); | 935 | spin_lock_irq(&sc->alloc_lock); |
932 | reg = read_kctxt_csr(sc->dd, sc->hw_context, SC(CTRL)); | 936 | reg = read_kctxt_csr(sc->dd, sc->hw_context, SC(CTRL)); |
933 | reg &= ~SC(CTRL_CTXT_ENABLE_SMASK); | 937 | reg &= ~SC(CTRL_CTXT_ENABLE_SMASK); |
934 | sc->flags &= ~SCF_ENABLED; | 938 | sc->flags &= ~SCF_ENABLED; |
935 | sc_wait_for_packet_egress(sc, 1); | 939 | sc_wait_for_packet_egress(sc, 1); |
936 | write_kctxt_csr(sc->dd, sc->hw_context, SC(CTRL), reg); | 940 | write_kctxt_csr(sc->dd, sc->hw_context, SC(CTRL), reg); |
937 | spin_unlock_irqrestore(&sc->alloc_lock, flags); | ||
938 | 941 | ||
939 | /* | 942 | /* |
940 | * Flush any waiters. Once the context is disabled, | 943 | * Flush any waiters. Once the context is disabled, |
@@ -944,7 +947,7 @@ void sc_disable(struct send_context *sc) | |||
944 | * proceed with the flush. | 947 | * proceed with the flush. |
945 | */ | 948 | */ |
946 | udelay(1); | 949 | udelay(1); |
947 | spin_lock_irqsave(&sc->release_lock, flags); | 950 | spin_lock(&sc->release_lock); |
948 | if (sc->sr) { /* this context has a shadow ring */ | 951 | if (sc->sr) { /* this context has a shadow ring */ |
949 | while (sc->sr_tail != sc->sr_head) { | 952 | while (sc->sr_tail != sc->sr_head) { |
950 | pbuf = &sc->sr[sc->sr_tail].pbuf; | 953 | pbuf = &sc->sr[sc->sr_tail].pbuf; |
@@ -955,7 +958,8 @@ void sc_disable(struct send_context *sc) | |||
955 | sc->sr_tail = 0; | 958 | sc->sr_tail = 0; |
956 | } | 959 | } |
957 | } | 960 | } |
958 | spin_unlock_irqrestore(&sc->release_lock, flags); | 961 | spin_unlock(&sc->release_lock); |
962 | spin_unlock_irq(&sc->alloc_lock); | ||
959 | } | 963 | } |
960 | 964 | ||
961 | /* return SendEgressCtxtStatus.PacketOccupancy */ | 965 | /* return SendEgressCtxtStatus.PacketOccupancy */ |
@@ -1178,11 +1182,39 @@ void pio_kernel_unfreeze(struct hfi1_devdata *dd) | |||
1178 | sc = dd->send_contexts[i].sc; | 1182 | sc = dd->send_contexts[i].sc; |
1179 | if (!sc || !(sc->flags & SCF_FROZEN) || sc->type == SC_USER) | 1183 | if (!sc || !(sc->flags & SCF_FROZEN) || sc->type == SC_USER) |
1180 | continue; | 1184 | continue; |
1185 | if (sc->flags & SCF_LINK_DOWN) | ||
1186 | continue; | ||
1181 | 1187 | ||
1182 | sc_enable(sc); /* will clear the sc frozen flag */ | 1188 | sc_enable(sc); /* will clear the sc frozen flag */ |
1183 | } | 1189 | } |
1184 | } | 1190 | } |
1185 | 1191 | ||
1192 | /** | ||
1193 | * pio_kernel_linkup() - Re-enable send contexts after linkup event | ||
1194 | * @dd: valid devive data | ||
1195 | * | ||
1196 | * When the link goes down, the freeze path is taken. However, a link down | ||
1197 | * event is different from a freeze because if the send context is re-enabled | ||
1198 | * whowever is sending data will start sending data again, which will hang | ||
1199 | * any QP that is sending data. | ||
1200 | * | ||
1201 | * The freeze path now looks at the type of event that occurs and takes this | ||
1202 | * path for link down event. | ||
1203 | */ | ||
1204 | void pio_kernel_linkup(struct hfi1_devdata *dd) | ||
1205 | { | ||
1206 | struct send_context *sc; | ||
1207 | int i; | ||
1208 | |||
1209 | for (i = 0; i < dd->num_send_contexts; i++) { | ||
1210 | sc = dd->send_contexts[i].sc; | ||
1211 | if (!sc || !(sc->flags & SCF_LINK_DOWN) || sc->type == SC_USER) | ||
1212 | continue; | ||
1213 | |||
1214 | sc_enable(sc); /* will clear the sc link down flag */ | ||
1215 | } | ||
1216 | } | ||
1217 | |||
1186 | /* | 1218 | /* |
1187 | * Wait for the SendPioInitCtxt.PioInitInProgress bit to clear. | 1219 | * Wait for the SendPioInitCtxt.PioInitInProgress bit to clear. |
1188 | * Returns: | 1220 | * Returns: |
@@ -1382,11 +1414,10 @@ void sc_stop(struct send_context *sc, int flag) | |||
1382 | { | 1414 | { |
1383 | unsigned long flags; | 1415 | unsigned long flags; |
1384 | 1416 | ||
1385 | /* mark the context */ | ||
1386 | sc->flags |= flag; | ||
1387 | |||
1388 | /* stop buffer allocations */ | 1417 | /* stop buffer allocations */ |
1389 | spin_lock_irqsave(&sc->alloc_lock, flags); | 1418 | spin_lock_irqsave(&sc->alloc_lock, flags); |
1419 | /* mark the context */ | ||
1420 | sc->flags |= flag; | ||
1390 | sc->flags &= ~SCF_ENABLED; | 1421 | sc->flags &= ~SCF_ENABLED; |
1391 | spin_unlock_irqrestore(&sc->alloc_lock, flags); | 1422 | spin_unlock_irqrestore(&sc->alloc_lock, flags); |
1392 | wake_up(&sc->halt_wait); | 1423 | wake_up(&sc->halt_wait); |
diff --git a/drivers/infiniband/hw/hfi1/pio.h b/drivers/infiniband/hw/hfi1/pio.h index 058b08f459ab..aaf372c3e5d6 100644 --- a/drivers/infiniband/hw/hfi1/pio.h +++ b/drivers/infiniband/hw/hfi1/pio.h | |||
@@ -139,6 +139,7 @@ struct send_context { | |||
139 | #define SCF_IN_FREE 0x02 | 139 | #define SCF_IN_FREE 0x02 |
140 | #define SCF_HALTED 0x04 | 140 | #define SCF_HALTED 0x04 |
141 | #define SCF_FROZEN 0x08 | 141 | #define SCF_FROZEN 0x08 |
142 | #define SCF_LINK_DOWN 0x10 | ||
142 | 143 | ||
143 | struct send_context_info { | 144 | struct send_context_info { |
144 | struct send_context *sc; /* allocated working context */ | 145 | struct send_context *sc; /* allocated working context */ |
@@ -306,6 +307,7 @@ void set_pio_integrity(struct send_context *sc); | |||
306 | void pio_reset_all(struct hfi1_devdata *dd); | 307 | void pio_reset_all(struct hfi1_devdata *dd); |
307 | void pio_freeze(struct hfi1_devdata *dd); | 308 | void pio_freeze(struct hfi1_devdata *dd); |
308 | void pio_kernel_unfreeze(struct hfi1_devdata *dd); | 309 | void pio_kernel_unfreeze(struct hfi1_devdata *dd); |
310 | void pio_kernel_linkup(struct hfi1_devdata *dd); | ||
309 | 311 | ||
310 | /* global PIO send control operations */ | 312 | /* global PIO send control operations */ |
311 | #define PSC_GLOBAL_ENABLE 0 | 313 | #define PSC_GLOBAL_ENABLE 0 |
diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c index a3a7b33196d6..5c88706121c1 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.c +++ b/drivers/infiniband/hw/hfi1/user_sdma.c | |||
@@ -828,7 +828,7 @@ static int user_sdma_send_pkts(struct user_sdma_request *req, unsigned maxpkts) | |||
828 | if (READ_ONCE(iovec->offset) == iovec->iov.iov_len) { | 828 | if (READ_ONCE(iovec->offset) == iovec->iov.iov_len) { |
829 | if (++req->iov_idx == req->data_iovs) { | 829 | if (++req->iov_idx == req->data_iovs) { |
830 | ret = -EFAULT; | 830 | ret = -EFAULT; |
831 | goto free_txreq; | 831 | goto free_tx; |
832 | } | 832 | } |
833 | iovec = &req->iovs[req->iov_idx]; | 833 | iovec = &req->iovs[req->iov_idx]; |
834 | WARN_ON(iovec->offset); | 834 | WARN_ON(iovec->offset); |
diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c index 13374c727b14..a7c586a5589d 100644 --- a/drivers/infiniband/hw/hfi1/verbs.c +++ b/drivers/infiniband/hw/hfi1/verbs.c | |||
@@ -1582,6 +1582,7 @@ static int hfi1_check_ah(struct ib_device *ibdev, struct rdma_ah_attr *ah_attr) | |||
1582 | struct hfi1_pportdata *ppd; | 1582 | struct hfi1_pportdata *ppd; |
1583 | struct hfi1_devdata *dd; | 1583 | struct hfi1_devdata *dd; |
1584 | u8 sc5; | 1584 | u8 sc5; |
1585 | u8 sl; | ||
1585 | 1586 | ||
1586 | if (hfi1_check_mcast(rdma_ah_get_dlid(ah_attr)) && | 1587 | if (hfi1_check_mcast(rdma_ah_get_dlid(ah_attr)) && |
1587 | !(rdma_ah_get_ah_flags(ah_attr) & IB_AH_GRH)) | 1588 | !(rdma_ah_get_ah_flags(ah_attr) & IB_AH_GRH)) |
@@ -1590,8 +1591,13 @@ static int hfi1_check_ah(struct ib_device *ibdev, struct rdma_ah_attr *ah_attr) | |||
1590 | /* test the mapping for validity */ | 1591 | /* test the mapping for validity */ |
1591 | ibp = to_iport(ibdev, rdma_ah_get_port_num(ah_attr)); | 1592 | ibp = to_iport(ibdev, rdma_ah_get_port_num(ah_attr)); |
1592 | ppd = ppd_from_ibp(ibp); | 1593 | ppd = ppd_from_ibp(ibp); |
1593 | sc5 = ibp->sl_to_sc[rdma_ah_get_sl(ah_attr)]; | ||
1594 | dd = dd_from_ppd(ppd); | 1594 | dd = dd_from_ppd(ppd); |
1595 | |||
1596 | sl = rdma_ah_get_sl(ah_attr); | ||
1597 | if (sl >= ARRAY_SIZE(ibp->sl_to_sc)) | ||
1598 | return -EINVAL; | ||
1599 | |||
1600 | sc5 = ibp->sl_to_sc[sl]; | ||
1595 | if (sc_to_vlt(dd, sc5) > num_vls && sc_to_vlt(dd, sc5) != 0xf) | 1601 | if (sc_to_vlt(dd, sc5) > num_vls && sc_to_vlt(dd, sc5) != 0xf) |
1596 | return -EINVAL; | 1602 | return -EINVAL; |
1597 | return 0; | 1603 | return 0; |
diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c index ac116d63e466..f2f11e652dcd 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c | |||
@@ -723,6 +723,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_CREATE)( | |||
723 | attrs, MLX5_IB_ATTR_DEVX_OBJ_CREATE_HANDLE); | 723 | attrs, MLX5_IB_ATTR_DEVX_OBJ_CREATE_HANDLE); |
724 | struct mlx5_ib_ucontext *c = to_mucontext(uobj->context); | 724 | struct mlx5_ib_ucontext *c = to_mucontext(uobj->context); |
725 | struct mlx5_ib_dev *dev = to_mdev(c->ibucontext.device); | 725 | struct mlx5_ib_dev *dev = to_mdev(c->ibucontext.device); |
726 | u32 out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)]; | ||
726 | struct devx_obj *obj; | 727 | struct devx_obj *obj; |
727 | int err; | 728 | int err; |
728 | 729 | ||
@@ -754,10 +755,12 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_CREATE)( | |||
754 | 755 | ||
755 | err = uverbs_copy_to(attrs, MLX5_IB_ATTR_DEVX_OBJ_CREATE_CMD_OUT, cmd_out, cmd_out_len); | 756 | err = uverbs_copy_to(attrs, MLX5_IB_ATTR_DEVX_OBJ_CREATE_CMD_OUT, cmd_out, cmd_out_len); |
756 | if (err) | 757 | if (err) |
757 | goto obj_free; | 758 | goto obj_destroy; |
758 | 759 | ||
759 | return 0; | 760 | return 0; |
760 | 761 | ||
762 | obj_destroy: | ||
763 | mlx5_cmd_exec(obj->mdev, obj->dinbox, obj->dinlen, out, sizeof(out)); | ||
761 | obj_free: | 764 | obj_free: |
762 | kfree(obj); | 765 | kfree(obj); |
763 | return err; | 766 | return err; |
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 444d16520506..0b34e909505f 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -2951,7 +2951,7 @@ static int srp_reset_device(struct scsi_cmnd *scmnd) | |||
2951 | { | 2951 | { |
2952 | struct srp_target_port *target = host_to_target(scmnd->device->host); | 2952 | struct srp_target_port *target = host_to_target(scmnd->device->host); |
2953 | struct srp_rdma_ch *ch; | 2953 | struct srp_rdma_ch *ch; |
2954 | int i; | 2954 | int i, j; |
2955 | u8 status; | 2955 | u8 status; |
2956 | 2956 | ||
2957 | shost_printk(KERN_ERR, target->scsi_host, "SRP reset_device called\n"); | 2957 | shost_printk(KERN_ERR, target->scsi_host, "SRP reset_device called\n"); |
@@ -2965,8 +2965,8 @@ static int srp_reset_device(struct scsi_cmnd *scmnd) | |||
2965 | 2965 | ||
2966 | for (i = 0; i < target->ch_count; i++) { | 2966 | for (i = 0; i < target->ch_count; i++) { |
2967 | ch = &target->ch[i]; | 2967 | ch = &target->ch[i]; |
2968 | for (i = 0; i < target->req_ring_size; ++i) { | 2968 | for (j = 0; j < target->req_ring_size; ++j) { |
2969 | struct srp_request *req = &ch->req_ring[i]; | 2969 | struct srp_request *req = &ch->req_ring[j]; |
2970 | 2970 | ||
2971 | srp_finish_req(ch, req, scmnd->device, DID_RESET << 16); | 2971 | srp_finish_req(ch, req, scmnd->device, DID_RESET << 16); |
2972 | } | 2972 | } |
diff --git a/drivers/input/keyboard/atakbd.c b/drivers/input/keyboard/atakbd.c index 6f62da2909ec..6caee807cafa 100644 --- a/drivers/input/keyboard/atakbd.c +++ b/drivers/input/keyboard/atakbd.c | |||
@@ -75,8 +75,7 @@ MODULE_LICENSE("GPL"); | |||
75 | */ | 75 | */ |
76 | 76 | ||
77 | 77 | ||
78 | static unsigned char atakbd_keycode[0x72] = { /* American layout */ | 78 | static unsigned char atakbd_keycode[0x73] = { /* American layout */ |
79 | [0] = KEY_GRAVE, | ||
80 | [1] = KEY_ESC, | 79 | [1] = KEY_ESC, |
81 | [2] = KEY_1, | 80 | [2] = KEY_1, |
82 | [3] = KEY_2, | 81 | [3] = KEY_2, |
@@ -117,9 +116,9 @@ static unsigned char atakbd_keycode[0x72] = { /* American layout */ | |||
117 | [38] = KEY_L, | 116 | [38] = KEY_L, |
118 | [39] = KEY_SEMICOLON, | 117 | [39] = KEY_SEMICOLON, |
119 | [40] = KEY_APOSTROPHE, | 118 | [40] = KEY_APOSTROPHE, |
120 | [41] = KEY_BACKSLASH, /* FIXME, '#' */ | 119 | [41] = KEY_GRAVE, |
121 | [42] = KEY_LEFTSHIFT, | 120 | [42] = KEY_LEFTSHIFT, |
122 | [43] = KEY_GRAVE, /* FIXME: '~' */ | 121 | [43] = KEY_BACKSLASH, |
123 | [44] = KEY_Z, | 122 | [44] = KEY_Z, |
124 | [45] = KEY_X, | 123 | [45] = KEY_X, |
125 | [46] = KEY_C, | 124 | [46] = KEY_C, |
@@ -145,45 +144,34 @@ static unsigned char atakbd_keycode[0x72] = { /* American layout */ | |||
145 | [66] = KEY_F8, | 144 | [66] = KEY_F8, |
146 | [67] = KEY_F9, | 145 | [67] = KEY_F9, |
147 | [68] = KEY_F10, | 146 | [68] = KEY_F10, |
148 | [69] = KEY_ESC, | 147 | [71] = KEY_HOME, |
149 | [70] = KEY_DELETE, | 148 | [72] = KEY_UP, |
150 | [71] = KEY_KP7, | ||
151 | [72] = KEY_KP8, | ||
152 | [73] = KEY_KP9, | ||
153 | [74] = KEY_KPMINUS, | 149 | [74] = KEY_KPMINUS, |
154 | [75] = KEY_KP4, | 150 | [75] = KEY_LEFT, |
155 | [76] = KEY_KP5, | 151 | [77] = KEY_RIGHT, |
156 | [77] = KEY_KP6, | ||
157 | [78] = KEY_KPPLUS, | 152 | [78] = KEY_KPPLUS, |
158 | [79] = KEY_KP1, | 153 | [80] = KEY_DOWN, |
159 | [80] = KEY_KP2, | 154 | [82] = KEY_INSERT, |
160 | [81] = KEY_KP3, | 155 | [83] = KEY_DELETE, |
161 | [82] = KEY_KP0, | ||
162 | [83] = KEY_KPDOT, | ||
163 | [90] = KEY_KPLEFTPAREN, | ||
164 | [91] = KEY_KPRIGHTPAREN, | ||
165 | [92] = KEY_KPASTERISK, /* FIXME */ | ||
166 | [93] = KEY_KPASTERISK, | ||
167 | [94] = KEY_KPPLUS, | ||
168 | [95] = KEY_HELP, | ||
169 | [96] = KEY_102ND, | 156 | [96] = KEY_102ND, |
170 | [97] = KEY_KPASTERISK, /* FIXME */ | 157 | [97] = KEY_UNDO, |
171 | [98] = KEY_KPSLASH, | 158 | [98] = KEY_HELP, |
172 | [99] = KEY_KPLEFTPAREN, | 159 | [99] = KEY_KPLEFTPAREN, |
173 | [100] = KEY_KPRIGHTPAREN, | 160 | [100] = KEY_KPRIGHTPAREN, |
174 | [101] = KEY_KPSLASH, | 161 | [101] = KEY_KPSLASH, |
175 | [102] = KEY_KPASTERISK, | 162 | [102] = KEY_KPASTERISK, |
176 | [103] = KEY_UP, | 163 | [103] = KEY_KP7, |
177 | [104] = KEY_KPASTERISK, /* FIXME */ | 164 | [104] = KEY_KP8, |
178 | [105] = KEY_LEFT, | 165 | [105] = KEY_KP9, |
179 | [106] = KEY_RIGHT, | 166 | [106] = KEY_KP4, |
180 | [107] = KEY_KPASTERISK, /* FIXME */ | 167 | [107] = KEY_KP5, |
181 | [108] = KEY_DOWN, | 168 | [108] = KEY_KP6, |
182 | [109] = KEY_KPASTERISK, /* FIXME */ | 169 | [109] = KEY_KP1, |
183 | [110] = KEY_KPASTERISK, /* FIXME */ | 170 | [110] = KEY_KP2, |
184 | [111] = KEY_KPASTERISK, /* FIXME */ | 171 | [111] = KEY_KP3, |
185 | [112] = KEY_KPASTERISK, /* FIXME */ | 172 | [112] = KEY_KP0, |
186 | [113] = KEY_KPASTERISK /* FIXME */ | 173 | [113] = KEY_KPDOT, |
174 | [114] = KEY_KPENTER, | ||
187 | }; | 175 | }; |
188 | 176 | ||
189 | static struct input_dev *atakbd_dev; | 177 | static struct input_dev *atakbd_dev; |
@@ -191,21 +179,15 @@ static struct input_dev *atakbd_dev; | |||
191 | static void atakbd_interrupt(unsigned char scancode, char down) | 179 | static void atakbd_interrupt(unsigned char scancode, char down) |
192 | { | 180 | { |
193 | 181 | ||
194 | if (scancode < 0x72) { /* scancodes < 0xf2 are keys */ | 182 | if (scancode < 0x73) { /* scancodes < 0xf3 are keys */ |
195 | 183 | ||
196 | // report raw events here? | 184 | // report raw events here? |
197 | 185 | ||
198 | scancode = atakbd_keycode[scancode]; | 186 | scancode = atakbd_keycode[scancode]; |
199 | 187 | ||
200 | if (scancode == KEY_CAPSLOCK) { /* CapsLock is a toggle switch key on Amiga */ | 188 | input_report_key(atakbd_dev, scancode, down); |
201 | input_report_key(atakbd_dev, scancode, 1); | 189 | input_sync(atakbd_dev); |
202 | input_report_key(atakbd_dev, scancode, 0); | 190 | } else /* scancodes >= 0xf3 are mouse data, most likely */ |
203 | input_sync(atakbd_dev); | ||
204 | } else { | ||
205 | input_report_key(atakbd_dev, scancode, down); | ||
206 | input_sync(atakbd_dev); | ||
207 | } | ||
208 | } else /* scancodes >= 0xf2 are mouse data, most likely */ | ||
209 | printk(KERN_INFO "atakbd: unhandled scancode %x\n", scancode); | 191 | printk(KERN_INFO "atakbd: unhandled scancode %x\n", scancode); |
210 | 192 | ||
211 | return; | 193 | return; |
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 96a887f33698..eb14ddf69346 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c | |||
@@ -410,7 +410,7 @@ static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code, | |||
410 | min = abs->minimum; | 410 | min = abs->minimum; |
411 | max = abs->maximum; | 411 | max = abs->maximum; |
412 | 412 | ||
413 | if ((min != 0 || max != 0) && max <= min) { | 413 | if ((min != 0 || max != 0) && max < min) { |
414 | printk(KERN_DEBUG | 414 | printk(KERN_DEBUG |
415 | "%s: invalid abs[%02x] min:%d max:%d\n", | 415 | "%s: invalid abs[%02x] min:%d max:%d\n", |
416 | UINPUT_NAME, code, min, max); | 416 | UINPUT_NAME, code, min, max); |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 44f57cf6675b..2d95e8d93cc7 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -1178,6 +1178,8 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = { | |||
1178 | static const char * const middle_button_pnp_ids[] = { | 1178 | static const char * const middle_button_pnp_ids[] = { |
1179 | "LEN2131", /* ThinkPad P52 w/ NFC */ | 1179 | "LEN2131", /* ThinkPad P52 w/ NFC */ |
1180 | "LEN2132", /* ThinkPad P52 */ | 1180 | "LEN2132", /* ThinkPad P52 */ |
1181 | "LEN2133", /* ThinkPad P72 w/ NFC */ | ||
1182 | "LEN2134", /* ThinkPad P72 */ | ||
1181 | NULL | 1183 | NULL |
1182 | }; | 1184 | }; |
1183 | 1185 | ||
diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c index 80e69bb8283e..83ac8c128192 100644 --- a/drivers/input/touchscreen/egalax_ts.c +++ b/drivers/input/touchscreen/egalax_ts.c | |||
@@ -241,6 +241,9 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev) | |||
241 | struct i2c_client *client = to_i2c_client(dev); | 241 | struct i2c_client *client = to_i2c_client(dev); |
242 | int ret; | 242 | int ret; |
243 | 243 | ||
244 | if (device_may_wakeup(dev)) | ||
245 | return enable_irq_wake(client->irq); | ||
246 | |||
244 | ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN); | 247 | ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN); |
245 | return ret > 0 ? 0 : ret; | 248 | return ret > 0 ? 0 : ret; |
246 | } | 249 | } |
@@ -249,6 +252,9 @@ static int __maybe_unused egalax_ts_resume(struct device *dev) | |||
249 | { | 252 | { |
250 | struct i2c_client *client = to_i2c_client(dev); | 253 | struct i2c_client *client = to_i2c_client(dev); |
251 | 254 | ||
255 | if (device_may_wakeup(dev)) | ||
256 | return disable_irq_wake(client->irq); | ||
257 | |||
252 | return egalax_wake_up_device(client); | 258 | return egalax_wake_up_device(client); |
253 | } | 259 | } |
254 | 260 | ||
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 4e04fff23977..73e47d93e7a0 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -246,7 +246,13 @@ static u16 get_alias(struct device *dev) | |||
246 | 246 | ||
247 | /* The callers make sure that get_device_id() does not fail here */ | 247 | /* The callers make sure that get_device_id() does not fail here */ |
248 | devid = get_device_id(dev); | 248 | devid = get_device_id(dev); |
249 | |||
250 | /* For ACPI HID devices, we simply return the devid as such */ | ||
251 | if (!dev_is_pci(dev)) | ||
252 | return devid; | ||
253 | |||
249 | ivrs_alias = amd_iommu_alias_table[devid]; | 254 | ivrs_alias = amd_iommu_alias_table[devid]; |
255 | |||
250 | pci_for_each_dma_alias(pdev, __last_alias, &pci_alias); | 256 | pci_for_each_dma_alias(pdev, __last_alias, &pci_alias); |
251 | 257 | ||
252 | if (ivrs_alias == pci_alias) | 258 | if (ivrs_alias == pci_alias) |
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 5f3f10cf9d9d..bedc801b06a0 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -2540,9 +2540,9 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu, | |||
2540 | if (dev && dev_is_pci(dev) && info->pasid_supported) { | 2540 | if (dev && dev_is_pci(dev) && info->pasid_supported) { |
2541 | ret = intel_pasid_alloc_table(dev); | 2541 | ret = intel_pasid_alloc_table(dev); |
2542 | if (ret) { | 2542 | if (ret) { |
2543 | __dmar_remove_one_dev_info(info); | 2543 | pr_warn("No pasid table for %s, pasid disabled\n", |
2544 | spin_unlock_irqrestore(&device_domain_lock, flags); | 2544 | dev_name(dev)); |
2545 | return NULL; | 2545 | info->pasid_supported = 0; |
2546 | } | 2546 | } |
2547 | } | 2547 | } |
2548 | spin_unlock_irqrestore(&device_domain_lock, flags); | 2548 | spin_unlock_irqrestore(&device_domain_lock, flags); |
diff --git a/drivers/iommu/intel-pasid.h b/drivers/iommu/intel-pasid.h index 1c05ed6fc5a5..1fb5e12b029a 100644 --- a/drivers/iommu/intel-pasid.h +++ b/drivers/iommu/intel-pasid.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #define __INTEL_PASID_H | 11 | #define __INTEL_PASID_H |
12 | 12 | ||
13 | #define PASID_MIN 0x1 | 13 | #define PASID_MIN 0x1 |
14 | #define PASID_MAX 0x100000 | 14 | #define PASID_MAX 0x20000 |
15 | 15 | ||
16 | struct pasid_entry { | 16 | struct pasid_entry { |
17 | u64 val; | 17 | u64 val; |
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 258115b10fa9..ad3e2b97469e 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c | |||
@@ -1241,6 +1241,12 @@ err_unprepare_clocks: | |||
1241 | 1241 | ||
1242 | static void rk_iommu_shutdown(struct platform_device *pdev) | 1242 | static void rk_iommu_shutdown(struct platform_device *pdev) |
1243 | { | 1243 | { |
1244 | struct rk_iommu *iommu = platform_get_drvdata(pdev); | ||
1245 | int i = 0, irq; | ||
1246 | |||
1247 | while ((irq = platform_get_irq(pdev, i++)) != -ENXIO) | ||
1248 | devm_free_irq(iommu->dev, irq, iommu); | ||
1249 | |||
1244 | pm_runtime_force_suspend(&pdev->dev); | 1250 | pm_runtime_force_suspend(&pdev->dev); |
1245 | } | 1251 | } |
1246 | 1252 | ||
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h index 83504dd8100a..954dad29e6e8 100644 --- a/drivers/md/bcache/bcache.h +++ b/drivers/md/bcache/bcache.h | |||
@@ -965,6 +965,7 @@ void bch_prio_write(struct cache *ca); | |||
965 | void bch_write_bdev_super(struct cached_dev *dc, struct closure *parent); | 965 | void bch_write_bdev_super(struct cached_dev *dc, struct closure *parent); |
966 | 966 | ||
967 | extern struct workqueue_struct *bcache_wq; | 967 | extern struct workqueue_struct *bcache_wq; |
968 | extern struct workqueue_struct *bch_journal_wq; | ||
968 | extern struct mutex bch_register_lock; | 969 | extern struct mutex bch_register_lock; |
969 | extern struct list_head bch_cache_sets; | 970 | extern struct list_head bch_cache_sets; |
970 | 971 | ||
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index 6116bbf870d8..522c7426f3a0 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c | |||
@@ -485,7 +485,7 @@ static void do_journal_discard(struct cache *ca) | |||
485 | 485 | ||
486 | closure_get(&ca->set->cl); | 486 | closure_get(&ca->set->cl); |
487 | INIT_WORK(&ja->discard_work, journal_discard_work); | 487 | INIT_WORK(&ja->discard_work, journal_discard_work); |
488 | schedule_work(&ja->discard_work); | 488 | queue_work(bch_journal_wq, &ja->discard_work); |
489 | } | 489 | } |
490 | } | 490 | } |
491 | 491 | ||
@@ -592,7 +592,7 @@ static void journal_write_done(struct closure *cl) | |||
592 | : &j->w[0]; | 592 | : &j->w[0]; |
593 | 593 | ||
594 | __closure_wake_up(&w->wait); | 594 | __closure_wake_up(&w->wait); |
595 | continue_at_nobarrier(cl, journal_write, system_wq); | 595 | continue_at_nobarrier(cl, journal_write, bch_journal_wq); |
596 | } | 596 | } |
597 | 597 | ||
598 | static void journal_write_unlock(struct closure *cl) | 598 | static void journal_write_unlock(struct closure *cl) |
@@ -627,7 +627,7 @@ static void journal_write_unlocked(struct closure *cl) | |||
627 | spin_unlock(&c->journal.lock); | 627 | spin_unlock(&c->journal.lock); |
628 | 628 | ||
629 | btree_flush_write(c); | 629 | btree_flush_write(c); |
630 | continue_at(cl, journal_write, system_wq); | 630 | continue_at(cl, journal_write, bch_journal_wq); |
631 | return; | 631 | return; |
632 | } | 632 | } |
633 | 633 | ||
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 94c756c66bd7..30ba9aeb5ee8 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c | |||
@@ -47,6 +47,7 @@ static int bcache_major; | |||
47 | static DEFINE_IDA(bcache_device_idx); | 47 | static DEFINE_IDA(bcache_device_idx); |
48 | static wait_queue_head_t unregister_wait; | 48 | static wait_queue_head_t unregister_wait; |
49 | struct workqueue_struct *bcache_wq; | 49 | struct workqueue_struct *bcache_wq; |
50 | struct workqueue_struct *bch_journal_wq; | ||
50 | 51 | ||
51 | #define BTREE_MAX_PAGES (256 * 1024 / PAGE_SIZE) | 52 | #define BTREE_MAX_PAGES (256 * 1024 / PAGE_SIZE) |
52 | /* limitation of partitions number on single bcache device */ | 53 | /* limitation of partitions number on single bcache device */ |
@@ -2341,6 +2342,9 @@ static void bcache_exit(void) | |||
2341 | kobject_put(bcache_kobj); | 2342 | kobject_put(bcache_kobj); |
2342 | if (bcache_wq) | 2343 | if (bcache_wq) |
2343 | destroy_workqueue(bcache_wq); | 2344 | destroy_workqueue(bcache_wq); |
2345 | if (bch_journal_wq) | ||
2346 | destroy_workqueue(bch_journal_wq); | ||
2347 | |||
2344 | if (bcache_major) | 2348 | if (bcache_major) |
2345 | unregister_blkdev(bcache_major, "bcache"); | 2349 | unregister_blkdev(bcache_major, "bcache"); |
2346 | unregister_reboot_notifier(&reboot); | 2350 | unregister_reboot_notifier(&reboot); |
@@ -2370,6 +2374,10 @@ static int __init bcache_init(void) | |||
2370 | if (!bcache_wq) | 2374 | if (!bcache_wq) |
2371 | goto err; | 2375 | goto err; |
2372 | 2376 | ||
2377 | bch_journal_wq = alloc_workqueue("bch_journal", WQ_MEM_RECLAIM, 0); | ||
2378 | if (!bch_journal_wq) | ||
2379 | goto err; | ||
2380 | |||
2373 | bcache_kobj = kobject_create_and_add("bcache", fs_kobj); | 2381 | bcache_kobj = kobject_create_and_add("bcache", fs_kobj); |
2374 | if (!bcache_kobj) | 2382 | if (!bcache_kobj) |
2375 | goto err; | 2383 | goto err; |
diff --git a/drivers/media/v4l2-core/v4l2-event.c b/drivers/media/v4l2-core/v4l2-event.c index 127fe6eb91d9..a3ef1f50a4b3 100644 --- a/drivers/media/v4l2-core/v4l2-event.c +++ b/drivers/media/v4l2-core/v4l2-event.c | |||
@@ -115,14 +115,6 @@ static void __v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *e | |||
115 | if (sev == NULL) | 115 | if (sev == NULL) |
116 | return; | 116 | return; |
117 | 117 | ||
118 | /* | ||
119 | * If the event has been added to the fh->subscribed list, but its | ||
120 | * add op has not completed yet elems will be 0, treat this as | ||
121 | * not being subscribed. | ||
122 | */ | ||
123 | if (!sev->elems) | ||
124 | return; | ||
125 | |||
126 | /* Increase event sequence number on fh. */ | 118 | /* Increase event sequence number on fh. */ |
127 | fh->sequence++; | 119 | fh->sequence++; |
128 | 120 | ||
@@ -208,6 +200,7 @@ int v4l2_event_subscribe(struct v4l2_fh *fh, | |||
208 | struct v4l2_subscribed_event *sev, *found_ev; | 200 | struct v4l2_subscribed_event *sev, *found_ev; |
209 | unsigned long flags; | 201 | unsigned long flags; |
210 | unsigned i; | 202 | unsigned i; |
203 | int ret = 0; | ||
211 | 204 | ||
212 | if (sub->type == V4L2_EVENT_ALL) | 205 | if (sub->type == V4L2_EVENT_ALL) |
213 | return -EINVAL; | 206 | return -EINVAL; |
@@ -225,31 +218,36 @@ int v4l2_event_subscribe(struct v4l2_fh *fh, | |||
225 | sev->flags = sub->flags; | 218 | sev->flags = sub->flags; |
226 | sev->fh = fh; | 219 | sev->fh = fh; |
227 | sev->ops = ops; | 220 | sev->ops = ops; |
221 | sev->elems = elems; | ||
222 | |||
223 | mutex_lock(&fh->subscribe_lock); | ||
228 | 224 | ||
229 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); | 225 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
230 | found_ev = v4l2_event_subscribed(fh, sub->type, sub->id); | 226 | found_ev = v4l2_event_subscribed(fh, sub->type, sub->id); |
231 | if (!found_ev) | ||
232 | list_add(&sev->list, &fh->subscribed); | ||
233 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); | 227 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
234 | 228 | ||
235 | if (found_ev) { | 229 | if (found_ev) { |
230 | /* Already listening */ | ||
236 | kvfree(sev); | 231 | kvfree(sev); |
237 | return 0; /* Already listening */ | 232 | goto out_unlock; |
238 | } | 233 | } |
239 | 234 | ||
240 | if (sev->ops && sev->ops->add) { | 235 | if (sev->ops && sev->ops->add) { |
241 | int ret = sev->ops->add(sev, elems); | 236 | ret = sev->ops->add(sev, elems); |
242 | if (ret) { | 237 | if (ret) { |
243 | sev->ops = NULL; | 238 | kvfree(sev); |
244 | v4l2_event_unsubscribe(fh, sub); | 239 | goto out_unlock; |
245 | return ret; | ||
246 | } | 240 | } |
247 | } | 241 | } |
248 | 242 | ||
249 | /* Mark as ready for use */ | 243 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
250 | sev->elems = elems; | 244 | list_add(&sev->list, &fh->subscribed); |
245 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); | ||
251 | 246 | ||
252 | return 0; | 247 | out_unlock: |
248 | mutex_unlock(&fh->subscribe_lock); | ||
249 | |||
250 | return ret; | ||
253 | } | 251 | } |
254 | EXPORT_SYMBOL_GPL(v4l2_event_subscribe); | 252 | EXPORT_SYMBOL_GPL(v4l2_event_subscribe); |
255 | 253 | ||
@@ -288,6 +286,8 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh, | |||
288 | return 0; | 286 | return 0; |
289 | } | 287 | } |
290 | 288 | ||
289 | mutex_lock(&fh->subscribe_lock); | ||
290 | |||
291 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); | 291 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
292 | 292 | ||
293 | sev = v4l2_event_subscribed(fh, sub->type, sub->id); | 293 | sev = v4l2_event_subscribed(fh, sub->type, sub->id); |
@@ -305,6 +305,8 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh, | |||
305 | if (sev && sev->ops && sev->ops->del) | 305 | if (sev && sev->ops && sev->ops->del) |
306 | sev->ops->del(sev); | 306 | sev->ops->del(sev); |
307 | 307 | ||
308 | mutex_unlock(&fh->subscribe_lock); | ||
309 | |||
308 | kvfree(sev); | 310 | kvfree(sev); |
309 | 311 | ||
310 | return 0; | 312 | return 0; |
diff --git a/drivers/media/v4l2-core/v4l2-fh.c b/drivers/media/v4l2-core/v4l2-fh.c index 3895999bf880..c91a7bd3ecfc 100644 --- a/drivers/media/v4l2-core/v4l2-fh.c +++ b/drivers/media/v4l2-core/v4l2-fh.c | |||
@@ -45,6 +45,7 @@ void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev) | |||
45 | INIT_LIST_HEAD(&fh->available); | 45 | INIT_LIST_HEAD(&fh->available); |
46 | INIT_LIST_HEAD(&fh->subscribed); | 46 | INIT_LIST_HEAD(&fh->subscribed); |
47 | fh->sequence = -1; | 47 | fh->sequence = -1; |
48 | mutex_init(&fh->subscribe_lock); | ||
48 | } | 49 | } |
49 | EXPORT_SYMBOL_GPL(v4l2_fh_init); | 50 | EXPORT_SYMBOL_GPL(v4l2_fh_init); |
50 | 51 | ||
@@ -90,6 +91,7 @@ void v4l2_fh_exit(struct v4l2_fh *fh) | |||
90 | return; | 91 | return; |
91 | v4l_disable_media_source(fh->vdev); | 92 | v4l_disable_media_source(fh->vdev); |
92 | v4l2_event_unsubscribe_all(fh); | 93 | v4l2_event_unsubscribe_all(fh); |
94 | mutex_destroy(&fh->subscribe_lock); | ||
93 | fh->vdev = NULL; | 95 | fh->vdev = NULL; |
94 | } | 96 | } |
95 | EXPORT_SYMBOL_GPL(v4l2_fh_exit); | 97 | EXPORT_SYMBOL_GPL(v4l2_fh_exit); |
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index abf9e884386c..f57f5de54206 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c | |||
@@ -235,7 +235,7 @@ int mmc_of_parse(struct mmc_host *host) | |||
235 | host->caps |= MMC_CAP_NEEDS_POLL; | 235 | host->caps |= MMC_CAP_NEEDS_POLL; |
236 | 236 | ||
237 | ret = mmc_gpiod_request_cd(host, "cd", 0, true, | 237 | ret = mmc_gpiod_request_cd(host, "cd", 0, true, |
238 | cd_debounce_delay_ms, | 238 | cd_debounce_delay_ms * 1000, |
239 | &cd_gpio_invert); | 239 | &cd_gpio_invert); |
240 | if (!ret) | 240 | if (!ret) |
241 | dev_info(host->parent, "Got CD GPIO\n"); | 241 | dev_info(host->parent, "Got CD GPIO\n"); |
diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index 2a833686784b..86803a3a04dc 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c | |||
@@ -271,7 +271,7 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, | |||
271 | if (debounce) { | 271 | if (debounce) { |
272 | ret = gpiod_set_debounce(desc, debounce); | 272 | ret = gpiod_set_debounce(desc, debounce); |
273 | if (ret < 0) | 273 | if (ret < 0) |
274 | ctx->cd_debounce_delay_ms = debounce; | 274 | ctx->cd_debounce_delay_ms = debounce / 1000; |
275 | } | 275 | } |
276 | 276 | ||
277 | if (gpio_invert) | 277 | if (gpio_invert) |
diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c index 890f192dedbd..5389c4821882 100644 --- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c | |||
@@ -498,7 +498,8 @@ static const struct soc_device_attribute gen3_soc_whitelist[] = { | |||
498 | 498 | ||
499 | static int renesas_sdhi_sys_dmac_probe(struct platform_device *pdev) | 499 | static int renesas_sdhi_sys_dmac_probe(struct platform_device *pdev) |
500 | { | 500 | { |
501 | if (of_device_get_match_data(&pdev->dev) == &of_rcar_gen3_compatible && | 501 | if ((of_device_get_match_data(&pdev->dev) == &of_rcar_gen3_compatible || |
502 | of_device_get_match_data(&pdev->dev) == &of_rcar_r8a7795_compatible) && | ||
502 | !soc_device_match(gen3_soc_whitelist)) | 503 | !soc_device_match(gen3_soc_whitelist)) |
503 | return -ENODEV; | 504 | return -ENODEV; |
504 | 505 | ||
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h index b8f75a22fb6c..f152da1ce046 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h | |||
@@ -753,7 +753,6 @@ struct cpl_abort_req_rss { | |||
753 | }; | 753 | }; |
754 | 754 | ||
755 | struct cpl_abort_req_rss6 { | 755 | struct cpl_abort_req_rss6 { |
756 | WR_HDR; | ||
757 | union opcode_tid ot; | 756 | union opcode_tid ot; |
758 | __be32 srqidx_status; | 757 | __be32 srqidx_status; |
759 | }; | 758 | }; |
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 5a9562881d4e..9fe3fff818b8 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c | |||
@@ -537,8 +537,10 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) | |||
537 | 537 | ||
538 | INIT_WORK(&ctrl->ana_work, nvme_ana_work); | 538 | INIT_WORK(&ctrl->ana_work, nvme_ana_work); |
539 | ctrl->ana_log_buf = kmalloc(ctrl->ana_log_size, GFP_KERNEL); | 539 | ctrl->ana_log_buf = kmalloc(ctrl->ana_log_size, GFP_KERNEL); |
540 | if (!ctrl->ana_log_buf) | 540 | if (!ctrl->ana_log_buf) { |
541 | error = -ENOMEM; | ||
541 | goto out; | 542 | goto out; |
543 | } | ||
542 | 544 | ||
543 | error = nvme_read_ana_log(ctrl, true); | 545 | error = nvme_read_ana_log(ctrl, true); |
544 | if (error) | 546 | if (error) |
@@ -547,7 +549,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) | |||
547 | out_free_ana_log_buf: | 549 | out_free_ana_log_buf: |
548 | kfree(ctrl->ana_log_buf); | 550 | kfree(ctrl->ana_log_buf); |
549 | out: | 551 | out: |
550 | return -ENOMEM; | 552 | return error; |
551 | } | 553 | } |
552 | 554 | ||
553 | void nvme_mpath_uninit(struct nvme_ctrl *ctrl) | 555 | void nvme_mpath_uninit(struct nvme_ctrl *ctrl) |
diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 778c4f76a884..2153956a0b20 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c | |||
@@ -135,7 +135,7 @@ static void dw_pcie_prog_outbound_atu_unroll(struct dw_pcie *pci, int index, | |||
135 | if (val & PCIE_ATU_ENABLE) | 135 | if (val & PCIE_ATU_ENABLE) |
136 | return; | 136 | return; |
137 | 137 | ||
138 | usleep_range(LINK_WAIT_IATU_MIN, LINK_WAIT_IATU_MAX); | 138 | mdelay(LINK_WAIT_IATU); |
139 | } | 139 | } |
140 | dev_err(pci->dev, "Outbound iATU is not being enabled\n"); | 140 | dev_err(pci->dev, "Outbound iATU is not being enabled\n"); |
141 | } | 141 | } |
@@ -178,7 +178,7 @@ void dw_pcie_prog_outbound_atu(struct dw_pcie *pci, int index, int type, | |||
178 | if (val & PCIE_ATU_ENABLE) | 178 | if (val & PCIE_ATU_ENABLE) |
179 | return; | 179 | return; |
180 | 180 | ||
181 | usleep_range(LINK_WAIT_IATU_MIN, LINK_WAIT_IATU_MAX); | 181 | mdelay(LINK_WAIT_IATU); |
182 | } | 182 | } |
183 | dev_err(pci->dev, "Outbound iATU is not being enabled\n"); | 183 | dev_err(pci->dev, "Outbound iATU is not being enabled\n"); |
184 | } | 184 | } |
@@ -236,7 +236,7 @@ static int dw_pcie_prog_inbound_atu_unroll(struct dw_pcie *pci, int index, | |||
236 | if (val & PCIE_ATU_ENABLE) | 236 | if (val & PCIE_ATU_ENABLE) |
237 | return 0; | 237 | return 0; |
238 | 238 | ||
239 | usleep_range(LINK_WAIT_IATU_MIN, LINK_WAIT_IATU_MAX); | 239 | mdelay(LINK_WAIT_IATU); |
240 | } | 240 | } |
241 | dev_err(pci->dev, "Inbound iATU is not being enabled\n"); | 241 | dev_err(pci->dev, "Inbound iATU is not being enabled\n"); |
242 | 242 | ||
@@ -282,7 +282,7 @@ int dw_pcie_prog_inbound_atu(struct dw_pcie *pci, int index, int bar, | |||
282 | if (val & PCIE_ATU_ENABLE) | 282 | if (val & PCIE_ATU_ENABLE) |
283 | return 0; | 283 | return 0; |
284 | 284 | ||
285 | usleep_range(LINK_WAIT_IATU_MIN, LINK_WAIT_IATU_MAX); | 285 | mdelay(LINK_WAIT_IATU); |
286 | } | 286 | } |
287 | dev_err(pci->dev, "Inbound iATU is not being enabled\n"); | 287 | dev_err(pci->dev, "Inbound iATU is not being enabled\n"); |
288 | 288 | ||
diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 96126fd8403c..9f1a5e399b70 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h | |||
@@ -26,8 +26,7 @@ | |||
26 | 26 | ||
27 | /* Parameters for the waiting for iATU enabled routine */ | 27 | /* Parameters for the waiting for iATU enabled routine */ |
28 | #define LINK_WAIT_MAX_IATU_RETRIES 5 | 28 | #define LINK_WAIT_MAX_IATU_RETRIES 5 |
29 | #define LINK_WAIT_IATU_MIN 9000 | 29 | #define LINK_WAIT_IATU 9 |
30 | #define LINK_WAIT_IATU_MAX 10000 | ||
31 | 30 | ||
32 | /* Synopsys-specific PCIe configuration registers */ | 31 | /* Synopsys-specific PCIe configuration registers */ |
33 | #define PCIE_PORT_LINK_CONTROL 0x710 | 32 | #define PCIE_PORT_LINK_CONTROL 0x710 |
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index ef0b1b6ba86f..12afa7fdf77e 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -457,17 +457,18 @@ static void acpiphp_native_scan_bridge(struct pci_dev *bridge) | |||
457 | /** | 457 | /** |
458 | * enable_slot - enable, configure a slot | 458 | * enable_slot - enable, configure a slot |
459 | * @slot: slot to be enabled | 459 | * @slot: slot to be enabled |
460 | * @bridge: true if enable is for the whole bridge (not a single slot) | ||
460 | * | 461 | * |
461 | * This function should be called per *physical slot*, | 462 | * This function should be called per *physical slot*, |
462 | * not per each slot object in ACPI namespace. | 463 | * not per each slot object in ACPI namespace. |
463 | */ | 464 | */ |
464 | static void enable_slot(struct acpiphp_slot *slot) | 465 | static void enable_slot(struct acpiphp_slot *slot, bool bridge) |
465 | { | 466 | { |
466 | struct pci_dev *dev; | 467 | struct pci_dev *dev; |
467 | struct pci_bus *bus = slot->bus; | 468 | struct pci_bus *bus = slot->bus; |
468 | struct acpiphp_func *func; | 469 | struct acpiphp_func *func; |
469 | 470 | ||
470 | if (bus->self && hotplug_is_native(bus->self)) { | 471 | if (bridge && bus->self && hotplug_is_native(bus->self)) { |
471 | /* | 472 | /* |
472 | * If native hotplug is used, it will take care of hotplug | 473 | * If native hotplug is used, it will take care of hotplug |
473 | * slot management and resource allocation for hotplug | 474 | * slot management and resource allocation for hotplug |
@@ -701,7 +702,7 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge) | |||
701 | trim_stale_devices(dev); | 702 | trim_stale_devices(dev); |
702 | 703 | ||
703 | /* configure all functions */ | 704 | /* configure all functions */ |
704 | enable_slot(slot); | 705 | enable_slot(slot, true); |
705 | } else { | 706 | } else { |
706 | disable_slot(slot); | 707 | disable_slot(slot); |
707 | } | 708 | } |
@@ -785,7 +786,7 @@ static void hotplug_event(u32 type, struct acpiphp_context *context) | |||
785 | if (bridge) | 786 | if (bridge) |
786 | acpiphp_check_bridge(bridge); | 787 | acpiphp_check_bridge(bridge); |
787 | else if (!(slot->flags & SLOT_IS_GOING_AWAY)) | 788 | else if (!(slot->flags & SLOT_IS_GOING_AWAY)) |
788 | enable_slot(slot); | 789 | enable_slot(slot, false); |
789 | 790 | ||
790 | break; | 791 | break; |
791 | 792 | ||
@@ -973,7 +974,7 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot) | |||
973 | 974 | ||
974 | /* configure all functions */ | 975 | /* configure all functions */ |
975 | if (!(slot->flags & SLOT_ENABLED)) | 976 | if (!(slot->flags & SLOT_ENABLED)) |
976 | enable_slot(slot); | 977 | enable_slot(slot, false); |
977 | 978 | ||
978 | pci_unlock_rescan_remove(); | 979 | pci_unlock_rescan_remove(); |
979 | return 0; | 980 | return 0; |
diff --git a/drivers/pinctrl/intel/pinctrl-cannonlake.c b/drivers/pinctrl/intel/pinctrl-cannonlake.c index 8d48371caaa2..e7f45d96b0cb 100644 --- a/drivers/pinctrl/intel/pinctrl-cannonlake.c +++ b/drivers/pinctrl/intel/pinctrl-cannonlake.c | |||
@@ -15,10 +15,11 @@ | |||
15 | 15 | ||
16 | #include "pinctrl-intel.h" | 16 | #include "pinctrl-intel.h" |
17 | 17 | ||
18 | #define CNL_PAD_OWN 0x020 | 18 | #define CNL_PAD_OWN 0x020 |
19 | #define CNL_PADCFGLOCK 0x080 | 19 | #define CNL_PADCFGLOCK 0x080 |
20 | #define CNL_HOSTSW_OWN 0x0b0 | 20 | #define CNL_LP_HOSTSW_OWN 0x0b0 |
21 | #define CNL_GPI_IE 0x120 | 21 | #define CNL_H_HOSTSW_OWN 0x0c0 |
22 | #define CNL_GPI_IE 0x120 | ||
22 | 23 | ||
23 | #define CNL_GPP(r, s, e, g) \ | 24 | #define CNL_GPP(r, s, e, g) \ |
24 | { \ | 25 | { \ |
@@ -30,12 +31,12 @@ | |||
30 | 31 | ||
31 | #define CNL_NO_GPIO -1 | 32 | #define CNL_NO_GPIO -1 |
32 | 33 | ||
33 | #define CNL_COMMUNITY(b, s, e, g) \ | 34 | #define CNL_COMMUNITY(b, s, e, o, g) \ |
34 | { \ | 35 | { \ |
35 | .barno = (b), \ | 36 | .barno = (b), \ |
36 | .padown_offset = CNL_PAD_OWN, \ | 37 | .padown_offset = CNL_PAD_OWN, \ |
37 | .padcfglock_offset = CNL_PADCFGLOCK, \ | 38 | .padcfglock_offset = CNL_PADCFGLOCK, \ |
38 | .hostown_offset = CNL_HOSTSW_OWN, \ | 39 | .hostown_offset = (o), \ |
39 | .ie_offset = CNL_GPI_IE, \ | 40 | .ie_offset = CNL_GPI_IE, \ |
40 | .pin_base = (s), \ | 41 | .pin_base = (s), \ |
41 | .npins = ((e) - (s) + 1), \ | 42 | .npins = ((e) - (s) + 1), \ |
@@ -43,6 +44,12 @@ | |||
43 | .ngpps = ARRAY_SIZE(g), \ | 44 | .ngpps = ARRAY_SIZE(g), \ |
44 | } | 45 | } |
45 | 46 | ||
47 | #define CNLLP_COMMUNITY(b, s, e, g) \ | ||
48 | CNL_COMMUNITY(b, s, e, CNL_LP_HOSTSW_OWN, g) | ||
49 | |||
50 | #define CNLH_COMMUNITY(b, s, e, g) \ | ||
51 | CNL_COMMUNITY(b, s, e, CNL_H_HOSTSW_OWN, g) | ||
52 | |||
46 | /* Cannon Lake-H */ | 53 | /* Cannon Lake-H */ |
47 | static const struct pinctrl_pin_desc cnlh_pins[] = { | 54 | static const struct pinctrl_pin_desc cnlh_pins[] = { |
48 | /* GPP_A */ | 55 | /* GPP_A */ |
@@ -442,10 +449,10 @@ static const struct intel_function cnlh_functions[] = { | |||
442 | }; | 449 | }; |
443 | 450 | ||
444 | static const struct intel_community cnlh_communities[] = { | 451 | static const struct intel_community cnlh_communities[] = { |
445 | CNL_COMMUNITY(0, 0, 50, cnlh_community0_gpps), | 452 | CNLH_COMMUNITY(0, 0, 50, cnlh_community0_gpps), |
446 | CNL_COMMUNITY(1, 51, 154, cnlh_community1_gpps), | 453 | CNLH_COMMUNITY(1, 51, 154, cnlh_community1_gpps), |
447 | CNL_COMMUNITY(2, 155, 248, cnlh_community3_gpps), | 454 | CNLH_COMMUNITY(2, 155, 248, cnlh_community3_gpps), |
448 | CNL_COMMUNITY(3, 249, 298, cnlh_community4_gpps), | 455 | CNLH_COMMUNITY(3, 249, 298, cnlh_community4_gpps), |
449 | }; | 456 | }; |
450 | 457 | ||
451 | static const struct intel_pinctrl_soc_data cnlh_soc_data = { | 458 | static const struct intel_pinctrl_soc_data cnlh_soc_data = { |
@@ -803,9 +810,9 @@ static const struct intel_padgroup cnllp_community4_gpps[] = { | |||
803 | }; | 810 | }; |
804 | 811 | ||
805 | static const struct intel_community cnllp_communities[] = { | 812 | static const struct intel_community cnllp_communities[] = { |
806 | CNL_COMMUNITY(0, 0, 67, cnllp_community0_gpps), | 813 | CNLLP_COMMUNITY(0, 0, 67, cnllp_community0_gpps), |
807 | CNL_COMMUNITY(1, 68, 180, cnllp_community1_gpps), | 814 | CNLLP_COMMUNITY(1, 68, 180, cnllp_community1_gpps), |
808 | CNL_COMMUNITY(2, 181, 243, cnllp_community4_gpps), | 815 | CNLLP_COMMUNITY(2, 181, 243, cnllp_community4_gpps), |
809 | }; | 816 | }; |
810 | 817 | ||
811 | static const struct intel_pinctrl_soc_data cnllp_soc_data = { | 818 | static const struct intel_pinctrl_soc_data cnllp_soc_data = { |
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index ec8dafc94694..1ea3438ea67e 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c | |||
@@ -887,36 +887,6 @@ static const struct gpio_chip intel_gpio_chip = { | |||
887 | .set_config = gpiochip_generic_config, | 887 | .set_config = gpiochip_generic_config, |
888 | }; | 888 | }; |
889 | 889 | ||
890 | static int intel_gpio_irq_reqres(struct irq_data *d) | ||
891 | { | ||
892 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | ||
893 | struct intel_pinctrl *pctrl = gpiochip_get_data(gc); | ||
894 | int pin; | ||
895 | int ret; | ||
896 | |||
897 | pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), NULL, NULL); | ||
898 | if (pin >= 0) { | ||
899 | ret = gpiochip_lock_as_irq(gc, pin); | ||
900 | if (ret) { | ||
901 | dev_err(pctrl->dev, "unable to lock HW IRQ %d for IRQ\n", | ||
902 | pin); | ||
903 | return ret; | ||
904 | } | ||
905 | } | ||
906 | return 0; | ||
907 | } | ||
908 | |||
909 | static void intel_gpio_irq_relres(struct irq_data *d) | ||
910 | { | ||
911 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | ||
912 | struct intel_pinctrl *pctrl = gpiochip_get_data(gc); | ||
913 | int pin; | ||
914 | |||
915 | pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), NULL, NULL); | ||
916 | if (pin >= 0) | ||
917 | gpiochip_unlock_as_irq(gc, pin); | ||
918 | } | ||
919 | |||
920 | static void intel_gpio_irq_ack(struct irq_data *d) | 890 | static void intel_gpio_irq_ack(struct irq_data *d) |
921 | { | 891 | { |
922 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 892 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
@@ -1132,8 +1102,6 @@ static irqreturn_t intel_gpio_irq(int irq, void *data) | |||
1132 | 1102 | ||
1133 | static struct irq_chip intel_gpio_irqchip = { | 1103 | static struct irq_chip intel_gpio_irqchip = { |
1134 | .name = "intel-gpio", | 1104 | .name = "intel-gpio", |
1135 | .irq_request_resources = intel_gpio_irq_reqres, | ||
1136 | .irq_release_resources = intel_gpio_irq_relres, | ||
1137 | .irq_enable = intel_gpio_irq_enable, | 1105 | .irq_enable = intel_gpio_irq_enable, |
1138 | .irq_ack = intel_gpio_irq_ack, | 1106 | .irq_ack = intel_gpio_irq_ack, |
1139 | .irq_mask = intel_gpio_irq_mask, | 1107 | .irq_mask = intel_gpio_irq_mask, |
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c index 41ccc759b8b8..1425c2874d40 100644 --- a/drivers/pinctrl/pinctrl-amd.c +++ b/drivers/pinctrl/pinctrl-amd.c | |||
@@ -348,21 +348,12 @@ static void amd_gpio_irq_enable(struct irq_data *d) | |||
348 | unsigned long flags; | 348 | unsigned long flags; |
349 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 349 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
350 | struct amd_gpio *gpio_dev = gpiochip_get_data(gc); | 350 | struct amd_gpio *gpio_dev = gpiochip_get_data(gc); |
351 | u32 mask = BIT(INTERRUPT_ENABLE_OFF) | BIT(INTERRUPT_MASK_OFF); | ||
352 | 351 | ||
353 | raw_spin_lock_irqsave(&gpio_dev->lock, flags); | 352 | raw_spin_lock_irqsave(&gpio_dev->lock, flags); |
354 | pin_reg = readl(gpio_dev->base + (d->hwirq)*4); | 353 | pin_reg = readl(gpio_dev->base + (d->hwirq)*4); |
355 | pin_reg |= BIT(INTERRUPT_ENABLE_OFF); | 354 | pin_reg |= BIT(INTERRUPT_ENABLE_OFF); |
356 | pin_reg |= BIT(INTERRUPT_MASK_OFF); | 355 | pin_reg |= BIT(INTERRUPT_MASK_OFF); |
357 | writel(pin_reg, gpio_dev->base + (d->hwirq)*4); | 356 | writel(pin_reg, gpio_dev->base + (d->hwirq)*4); |
358 | /* | ||
359 | * When debounce logic is enabled it takes ~900 us before interrupts | ||
360 | * can be enabled. During this "debounce warm up" period the | ||
361 | * "INTERRUPT_ENABLE" bit will read as 0. Poll the bit here until it | ||
362 | * reads back as 1, signaling that interrupts are now enabled. | ||
363 | */ | ||
364 | while ((readl(gpio_dev->base + (d->hwirq)*4) & mask) != mask) | ||
365 | continue; | ||
366 | raw_spin_unlock_irqrestore(&gpio_dev->lock, flags); | 357 | raw_spin_unlock_irqrestore(&gpio_dev->lock, flags); |
367 | } | 358 | } |
368 | 359 | ||
@@ -426,7 +417,7 @@ static void amd_gpio_irq_eoi(struct irq_data *d) | |||
426 | static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type) | 417 | static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type) |
427 | { | 418 | { |
428 | int ret = 0; | 419 | int ret = 0; |
429 | u32 pin_reg; | 420 | u32 pin_reg, pin_reg_irq_en, mask; |
430 | unsigned long flags, irq_flags; | 421 | unsigned long flags, irq_flags; |
431 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 422 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
432 | struct amd_gpio *gpio_dev = gpiochip_get_data(gc); | 423 | struct amd_gpio *gpio_dev = gpiochip_get_data(gc); |
@@ -495,6 +486,28 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type) | |||
495 | } | 486 | } |
496 | 487 | ||
497 | pin_reg |= CLR_INTR_STAT << INTERRUPT_STS_OFF; | 488 | pin_reg |= CLR_INTR_STAT << INTERRUPT_STS_OFF; |
489 | /* | ||
490 | * If WAKE_INT_MASTER_REG.MaskStsEn is set, a software write to the | ||
491 | * debounce registers of any GPIO will block wake/interrupt status | ||
492 | * generation for *all* GPIOs for a lenght of time that depends on | ||
493 | * WAKE_INT_MASTER_REG.MaskStsLength[11:0]. During this period the | ||
494 | * INTERRUPT_ENABLE bit will read as 0. | ||
495 | * | ||
496 | * We temporarily enable irq for the GPIO whose configuration is | ||
497 | * changing, and then wait for it to read back as 1 to know when | ||
498 | * debounce has settled and then disable the irq again. | ||
499 | * We do this polling with the spinlock held to ensure other GPIO | ||
500 | * access routines do not read an incorrect value for the irq enable | ||
501 | * bit of other GPIOs. We keep the GPIO masked while polling to avoid | ||
502 | * spurious irqs, and disable the irq again after polling. | ||
503 | */ | ||
504 | mask = BIT(INTERRUPT_ENABLE_OFF); | ||
505 | pin_reg_irq_en = pin_reg; | ||
506 | pin_reg_irq_en |= mask; | ||
507 | pin_reg_irq_en &= ~BIT(INTERRUPT_MASK_OFF); | ||
508 | writel(pin_reg_irq_en, gpio_dev->base + (d->hwirq)*4); | ||
509 | while ((readl(gpio_dev->base + (d->hwirq)*4) & mask) != mask) | ||
510 | continue; | ||
498 | writel(pin_reg, gpio_dev->base + (d->hwirq)*4); | 511 | writel(pin_reg, gpio_dev->base + (d->hwirq)*4); |
499 | raw_spin_unlock_irqrestore(&gpio_dev->lock, flags); | 512 | raw_spin_unlock_irqrestore(&gpio_dev->lock, flags); |
500 | 513 | ||
diff --git a/drivers/regulator/bd71837-regulator.c b/drivers/regulator/bd71837-regulator.c index 0f8ac8dec3e1..a1bd8aaf4d98 100644 --- a/drivers/regulator/bd71837-regulator.c +++ b/drivers/regulator/bd71837-regulator.c | |||
@@ -569,6 +569,25 @@ static int bd71837_probe(struct platform_device *pdev) | |||
569 | BD71837_REG_REGLOCK); | 569 | BD71837_REG_REGLOCK); |
570 | } | 570 | } |
571 | 571 | ||
572 | /* | ||
573 | * There is a HW quirk in BD71837. The shutdown sequence timings for | ||
574 | * bucks/LDOs which are controlled via register interface are changed. | ||
575 | * At PMIC poweroff the voltage for BUCK6/7 is cut immediately at the | ||
576 | * beginning of shut-down sequence. As bucks 6 and 7 are parent | ||
577 | * supplies for LDO5 and LDO6 - this causes LDO5/6 voltage | ||
578 | * monitoring to errorneously detect under voltage and force PMIC to | ||
579 | * emergency state instead of poweroff. In order to avoid this we | ||
580 | * disable voltage monitoring for LDO5 and LDO6 | ||
581 | */ | ||
582 | err = regmap_update_bits(pmic->mfd->regmap, BD718XX_REG_MVRFLTMASK2, | ||
583 | BD718XX_LDO5_VRMON80 | BD718XX_LDO6_VRMON80, | ||
584 | BD718XX_LDO5_VRMON80 | BD718XX_LDO6_VRMON80); | ||
585 | if (err) { | ||
586 | dev_err(&pmic->pdev->dev, | ||
587 | "Failed to disable voltage monitoring\n"); | ||
588 | goto err; | ||
589 | } | ||
590 | |||
572 | for (i = 0; i < ARRAY_SIZE(pmic_regulator_inits); i++) { | 591 | for (i = 0; i < ARRAY_SIZE(pmic_regulator_inits); i++) { |
573 | 592 | ||
574 | struct regulator_desc *desc; | 593 | struct regulator_desc *desc; |
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index bb1324f93143..9577d8941846 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -3161,7 +3161,7 @@ static inline int regulator_suspend_toggle(struct regulator_dev *rdev, | |||
3161 | if (!rstate->changeable) | 3161 | if (!rstate->changeable) |
3162 | return -EPERM; | 3162 | return -EPERM; |
3163 | 3163 | ||
3164 | rstate->enabled = en; | 3164 | rstate->enabled = (en) ? ENABLE_IN_SUSPEND : DISABLE_IN_SUSPEND; |
3165 | 3165 | ||
3166 | return 0; | 3166 | return 0; |
3167 | } | 3167 | } |
@@ -4395,13 +4395,13 @@ regulator_register(const struct regulator_desc *regulator_desc, | |||
4395 | !rdev->desc->fixed_uV) | 4395 | !rdev->desc->fixed_uV) |
4396 | rdev->is_switch = true; | 4396 | rdev->is_switch = true; |
4397 | 4397 | ||
4398 | dev_set_drvdata(&rdev->dev, rdev); | ||
4398 | ret = device_register(&rdev->dev); | 4399 | ret = device_register(&rdev->dev); |
4399 | if (ret != 0) { | 4400 | if (ret != 0) { |
4400 | put_device(&rdev->dev); | 4401 | put_device(&rdev->dev); |
4401 | goto unset_supplies; | 4402 | goto unset_supplies; |
4402 | } | 4403 | } |
4403 | 4404 | ||
4404 | dev_set_drvdata(&rdev->dev, rdev); | ||
4405 | rdev_init_debugfs(rdev); | 4405 | rdev_init_debugfs(rdev); |
4406 | 4406 | ||
4407 | /* try to resolve regulators supply since a new one was registered */ | 4407 | /* try to resolve regulators supply since a new one was registered */ |
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 638f17d4c848..210fc20f7de7 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c | |||
@@ -213,8 +213,6 @@ static void of_get_regulation_constraints(struct device_node *np, | |||
213 | else if (of_property_read_bool(suspend_np, | 213 | else if (of_property_read_bool(suspend_np, |
214 | "regulator-off-in-suspend")) | 214 | "regulator-off-in-suspend")) |
215 | suspend_state->enabled = DISABLE_IN_SUSPEND; | 215 | suspend_state->enabled = DISABLE_IN_SUSPEND; |
216 | else | ||
217 | suspend_state->enabled = DO_NOTHING_IN_SUSPEND; | ||
218 | 216 | ||
219 | if (!of_property_read_u32(np, "regulator-suspend-min-microvolt", | 217 | if (!of_property_read_u32(np, "regulator-suspend-min-microvolt", |
220 | &pval)) | 218 | &pval)) |
diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index ecb22749df0b..8cc015183043 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c | |||
@@ -2729,6 +2729,9 @@ static int qman_alloc_range(struct gen_pool *p, u32 *result, u32 cnt) | |||
2729 | { | 2729 | { |
2730 | unsigned long addr; | 2730 | unsigned long addr; |
2731 | 2731 | ||
2732 | if (!p) | ||
2733 | return -ENODEV; | ||
2734 | |||
2732 | addr = gen_pool_alloc(p, cnt); | 2735 | addr = gen_pool_alloc(p, cnt); |
2733 | if (!addr) | 2736 | if (!addr) |
2734 | return -ENOMEM; | 2737 | return -ENOMEM; |
diff --git a/drivers/soc/fsl/qe/ucc.c b/drivers/soc/fsl/qe/ucc.c index c646d8713861..681f7d4b7724 100644 --- a/drivers/soc/fsl/qe/ucc.c +++ b/drivers/soc/fsl/qe/ucc.c | |||
@@ -626,7 +626,7 @@ static u32 ucc_get_tdm_sync_shift(enum comm_dir mode, u32 tdm_num) | |||
626 | { | 626 | { |
627 | u32 shift; | 627 | u32 shift; |
628 | 628 | ||
629 | shift = (mode == COMM_DIR_RX) ? RX_SYNC_SHIFT_BASE : RX_SYNC_SHIFT_BASE; | 629 | shift = (mode == COMM_DIR_RX) ? RX_SYNC_SHIFT_BASE : TX_SYNC_SHIFT_BASE; |
630 | shift -= tdm_num * 2; | 630 | shift -= tdm_num * 2; |
631 | 631 | ||
632 | return shift; | 632 | return shift; |
diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 0626e6e3ea0c..421bfc7dda67 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c | |||
@@ -300,8 +300,8 @@ static int spi_gpio_request(struct device *dev, | |||
300 | *mflags |= SPI_MASTER_NO_RX; | 300 | *mflags |= SPI_MASTER_NO_RX; |
301 | 301 | ||
302 | spi_gpio->sck = devm_gpiod_get(dev, "sck", GPIOD_OUT_LOW); | 302 | spi_gpio->sck = devm_gpiod_get(dev, "sck", GPIOD_OUT_LOW); |
303 | if (IS_ERR(spi_gpio->mosi)) | 303 | if (IS_ERR(spi_gpio->sck)) |
304 | return PTR_ERR(spi_gpio->mosi); | 304 | return PTR_ERR(spi_gpio->sck); |
305 | 305 | ||
306 | for (i = 0; i < num_chipselects; i++) { | 306 | for (i = 0; i < num_chipselects; i++) { |
307 | spi_gpio->cs_gpios[i] = devm_gpiod_get_index(dev, "cs", | 307 | spi_gpio->cs_gpios[i] = devm_gpiod_get_index(dev, "cs", |
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 95dc4d78618d..b37de1d991d6 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c | |||
@@ -598,11 +598,13 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx, | |||
598 | 598 | ||
599 | ret = wait_event_interruptible_timeout(rspi->wait, | 599 | ret = wait_event_interruptible_timeout(rspi->wait, |
600 | rspi->dma_callbacked, HZ); | 600 | rspi->dma_callbacked, HZ); |
601 | if (ret > 0 && rspi->dma_callbacked) | 601 | if (ret > 0 && rspi->dma_callbacked) { |
602 | ret = 0; | 602 | ret = 0; |
603 | else if (!ret) { | 603 | } else { |
604 | dev_err(&rspi->master->dev, "DMA timeout\n"); | 604 | if (!ret) { |
605 | ret = -ETIMEDOUT; | 605 | dev_err(&rspi->master->dev, "DMA timeout\n"); |
606 | ret = -ETIMEDOUT; | ||
607 | } | ||
606 | if (tx) | 608 | if (tx) |
607 | dmaengine_terminate_all(rspi->master->dma_tx); | 609 | dmaengine_terminate_all(rspi->master->dma_tx); |
608 | if (rx) | 610 | if (rx) |
@@ -1350,12 +1352,36 @@ static const struct platform_device_id spi_driver_ids[] = { | |||
1350 | 1352 | ||
1351 | MODULE_DEVICE_TABLE(platform, spi_driver_ids); | 1353 | MODULE_DEVICE_TABLE(platform, spi_driver_ids); |
1352 | 1354 | ||
1355 | #ifdef CONFIG_PM_SLEEP | ||
1356 | static int rspi_suspend(struct device *dev) | ||
1357 | { | ||
1358 | struct platform_device *pdev = to_platform_device(dev); | ||
1359 | struct rspi_data *rspi = platform_get_drvdata(pdev); | ||
1360 | |||
1361 | return spi_master_suspend(rspi->master); | ||
1362 | } | ||
1363 | |||
1364 | static int rspi_resume(struct device *dev) | ||
1365 | { | ||
1366 | struct platform_device *pdev = to_platform_device(dev); | ||
1367 | struct rspi_data *rspi = platform_get_drvdata(pdev); | ||
1368 | |||
1369 | return spi_master_resume(rspi->master); | ||
1370 | } | ||
1371 | |||
1372 | static SIMPLE_DEV_PM_OPS(rspi_pm_ops, rspi_suspend, rspi_resume); | ||
1373 | #define DEV_PM_OPS &rspi_pm_ops | ||
1374 | #else | ||
1375 | #define DEV_PM_OPS NULL | ||
1376 | #endif /* CONFIG_PM_SLEEP */ | ||
1377 | |||
1353 | static struct platform_driver rspi_driver = { | 1378 | static struct platform_driver rspi_driver = { |
1354 | .probe = rspi_probe, | 1379 | .probe = rspi_probe, |
1355 | .remove = rspi_remove, | 1380 | .remove = rspi_remove, |
1356 | .id_table = spi_driver_ids, | 1381 | .id_table = spi_driver_ids, |
1357 | .driver = { | 1382 | .driver = { |
1358 | .name = "renesas_spi", | 1383 | .name = "renesas_spi", |
1384 | .pm = DEV_PM_OPS, | ||
1359 | .of_match_table = of_match_ptr(rspi_of_match), | 1385 | .of_match_table = of_match_ptr(rspi_of_match), |
1360 | }, | 1386 | }, |
1361 | }; | 1387 | }; |
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c index 539d6d1a277a..101cd6aae2ea 100644 --- a/drivers/spi/spi-sh-msiof.c +++ b/drivers/spi/spi-sh-msiof.c | |||
@@ -397,7 +397,8 @@ static void sh_msiof_spi_set_mode_regs(struct sh_msiof_spi_priv *p, | |||
397 | 397 | ||
398 | static void sh_msiof_reset_str(struct sh_msiof_spi_priv *p) | 398 | static void sh_msiof_reset_str(struct sh_msiof_spi_priv *p) |
399 | { | 399 | { |
400 | sh_msiof_write(p, STR, sh_msiof_read(p, STR)); | 400 | sh_msiof_write(p, STR, |
401 | sh_msiof_read(p, STR) & ~(STR_TDREQ | STR_RDREQ)); | ||
401 | } | 402 | } |
402 | 403 | ||
403 | static void sh_msiof_spi_write_fifo_8(struct sh_msiof_spi_priv *p, | 404 | static void sh_msiof_spi_write_fifo_8(struct sh_msiof_spi_priv *p, |
@@ -1426,12 +1427,37 @@ static const struct platform_device_id spi_driver_ids[] = { | |||
1426 | }; | 1427 | }; |
1427 | MODULE_DEVICE_TABLE(platform, spi_driver_ids); | 1428 | MODULE_DEVICE_TABLE(platform, spi_driver_ids); |
1428 | 1429 | ||
1430 | #ifdef CONFIG_PM_SLEEP | ||
1431 | static int sh_msiof_spi_suspend(struct device *dev) | ||
1432 | { | ||
1433 | struct platform_device *pdev = to_platform_device(dev); | ||
1434 | struct sh_msiof_spi_priv *p = platform_get_drvdata(pdev); | ||
1435 | |||
1436 | return spi_master_suspend(p->master); | ||
1437 | } | ||
1438 | |||
1439 | static int sh_msiof_spi_resume(struct device *dev) | ||
1440 | { | ||
1441 | struct platform_device *pdev = to_platform_device(dev); | ||
1442 | struct sh_msiof_spi_priv *p = platform_get_drvdata(pdev); | ||
1443 | |||
1444 | return spi_master_resume(p->master); | ||
1445 | } | ||
1446 | |||
1447 | static SIMPLE_DEV_PM_OPS(sh_msiof_spi_pm_ops, sh_msiof_spi_suspend, | ||
1448 | sh_msiof_spi_resume); | ||
1449 | #define DEV_PM_OPS &sh_msiof_spi_pm_ops | ||
1450 | #else | ||
1451 | #define DEV_PM_OPS NULL | ||
1452 | #endif /* CONFIG_PM_SLEEP */ | ||
1453 | |||
1429 | static struct platform_driver sh_msiof_spi_drv = { | 1454 | static struct platform_driver sh_msiof_spi_drv = { |
1430 | .probe = sh_msiof_spi_probe, | 1455 | .probe = sh_msiof_spi_probe, |
1431 | .remove = sh_msiof_spi_remove, | 1456 | .remove = sh_msiof_spi_remove, |
1432 | .id_table = spi_driver_ids, | 1457 | .id_table = spi_driver_ids, |
1433 | .driver = { | 1458 | .driver = { |
1434 | .name = "spi_sh_msiof", | 1459 | .name = "spi_sh_msiof", |
1460 | .pm = DEV_PM_OPS, | ||
1435 | .of_match_table = of_match_ptr(sh_msiof_match), | 1461 | .of_match_table = of_match_ptr(sh_msiof_match), |
1436 | }, | 1462 | }, |
1437 | }; | 1463 | }; |
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index 6f7b946b5ced..1427f343b39a 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c | |||
@@ -1063,6 +1063,24 @@ static int tegra_slink_probe(struct platform_device *pdev) | |||
1063 | goto exit_free_master; | 1063 | goto exit_free_master; |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | /* disabled clock may cause interrupt storm upon request */ | ||
1067 | tspi->clk = devm_clk_get(&pdev->dev, NULL); | ||
1068 | if (IS_ERR(tspi->clk)) { | ||
1069 | ret = PTR_ERR(tspi->clk); | ||
1070 | dev_err(&pdev->dev, "Can not get clock %d\n", ret); | ||
1071 | goto exit_free_master; | ||
1072 | } | ||
1073 | ret = clk_prepare(tspi->clk); | ||
1074 | if (ret < 0) { | ||
1075 | dev_err(&pdev->dev, "Clock prepare failed %d\n", ret); | ||
1076 | goto exit_free_master; | ||
1077 | } | ||
1078 | ret = clk_enable(tspi->clk); | ||
1079 | if (ret < 0) { | ||
1080 | dev_err(&pdev->dev, "Clock enable failed %d\n", ret); | ||
1081 | goto exit_free_master; | ||
1082 | } | ||
1083 | |||
1066 | spi_irq = platform_get_irq(pdev, 0); | 1084 | spi_irq = platform_get_irq(pdev, 0); |
1067 | tspi->irq = spi_irq; | 1085 | tspi->irq = spi_irq; |
1068 | ret = request_threaded_irq(tspi->irq, tegra_slink_isr, | 1086 | ret = request_threaded_irq(tspi->irq, tegra_slink_isr, |
@@ -1071,14 +1089,7 @@ static int tegra_slink_probe(struct platform_device *pdev) | |||
1071 | if (ret < 0) { | 1089 | if (ret < 0) { |
1072 | dev_err(&pdev->dev, "Failed to register ISR for IRQ %d\n", | 1090 | dev_err(&pdev->dev, "Failed to register ISR for IRQ %d\n", |
1073 | tspi->irq); | 1091 | tspi->irq); |
1074 | goto exit_free_master; | 1092 | goto exit_clk_disable; |
1075 | } | ||
1076 | |||
1077 | tspi->clk = devm_clk_get(&pdev->dev, NULL); | ||
1078 | if (IS_ERR(tspi->clk)) { | ||
1079 | dev_err(&pdev->dev, "can not get clock\n"); | ||
1080 | ret = PTR_ERR(tspi->clk); | ||
1081 | goto exit_free_irq; | ||
1082 | } | 1093 | } |
1083 | 1094 | ||
1084 | tspi->rst = devm_reset_control_get_exclusive(&pdev->dev, "spi"); | 1095 | tspi->rst = devm_reset_control_get_exclusive(&pdev->dev, "spi"); |
@@ -1138,6 +1149,8 @@ exit_rx_dma_free: | |||
1138 | tegra_slink_deinit_dma_param(tspi, true); | 1149 | tegra_slink_deinit_dma_param(tspi, true); |
1139 | exit_free_irq: | 1150 | exit_free_irq: |
1140 | free_irq(spi_irq, tspi); | 1151 | free_irq(spi_irq, tspi); |
1152 | exit_clk_disable: | ||
1153 | clk_disable(tspi->clk); | ||
1141 | exit_free_master: | 1154 | exit_free_master: |
1142 | spi_master_put(master); | 1155 | spi_master_put(master); |
1143 | return ret; | 1156 | return ret; |
@@ -1150,6 +1163,8 @@ static int tegra_slink_remove(struct platform_device *pdev) | |||
1150 | 1163 | ||
1151 | free_irq(tspi->irq, tspi); | 1164 | free_irq(tspi->irq, tspi); |
1152 | 1165 | ||
1166 | clk_disable(tspi->clk); | ||
1167 | |||
1153 | if (tspi->tx_dma_chan) | 1168 | if (tspi->tx_dma_chan) |
1154 | tegra_slink_deinit_dma_param(tspi, false); | 1169 | tegra_slink_deinit_dma_param(tspi, false); |
1155 | 1170 | ||
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 3946649b85c8..ba906876cc45 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c | |||
@@ -42,6 +42,7 @@ struct bmp_dib_header { | |||
42 | u32 colors_important; | 42 | u32 colors_important; |
43 | } __packed; | 43 | } __packed; |
44 | 44 | ||
45 | static bool use_bgrt = true; | ||
45 | static bool request_mem_succeeded = false; | 46 | static bool request_mem_succeeded = false; |
46 | static u64 mem_flags = EFI_MEMORY_WC | EFI_MEMORY_UC; | 47 | static u64 mem_flags = EFI_MEMORY_WC | EFI_MEMORY_UC; |
47 | 48 | ||
@@ -160,6 +161,9 @@ static void efifb_show_boot_graphics(struct fb_info *info) | |||
160 | void *bgrt_image = NULL; | 161 | void *bgrt_image = NULL; |
161 | u8 *dst = info->screen_base; | 162 | u8 *dst = info->screen_base; |
162 | 163 | ||
164 | if (!use_bgrt) | ||
165 | return; | ||
166 | |||
163 | if (!bgrt_tab.image_address) { | 167 | if (!bgrt_tab.image_address) { |
164 | pr_info("efifb: No BGRT, not showing boot graphics\n"); | 168 | pr_info("efifb: No BGRT, not showing boot graphics\n"); |
165 | return; | 169 | return; |
@@ -290,6 +294,8 @@ static int efifb_setup(char *options) | |||
290 | screen_info.lfb_width = simple_strtoul(this_opt+6, NULL, 0); | 294 | screen_info.lfb_width = simple_strtoul(this_opt+6, NULL, 0); |
291 | else if (!strcmp(this_opt, "nowc")) | 295 | else if (!strcmp(this_opt, "nowc")) |
292 | mem_flags &= ~EFI_MEMORY_WC; | 296 | mem_flags &= ~EFI_MEMORY_WC; |
297 | else if (!strcmp(this_opt, "nobgrt")) | ||
298 | use_bgrt = false; | ||
293 | } | 299 | } |
294 | } | 300 | } |
295 | 301 | ||
diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c index ef69273074ba..a3edb20ea4c3 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c | |||
@@ -496,6 +496,9 @@ static int omapfb_memory_read(struct fb_info *fbi, | |||
496 | if (!access_ok(VERIFY_WRITE, mr->buffer, mr->buffer_size)) | 496 | if (!access_ok(VERIFY_WRITE, mr->buffer, mr->buffer_size)) |
497 | return -EFAULT; | 497 | return -EFAULT; |
498 | 498 | ||
499 | if (mr->w > 4096 || mr->h > 4096) | ||
500 | return -EINVAL; | ||
501 | |||
499 | if (mr->w * mr->h * 3 > mr->buffer_size) | 502 | if (mr->w * mr->h * 3 > mr->buffer_size) |
500 | return -EINVAL; | 503 | return -EINVAL; |
501 | 504 | ||
@@ -509,7 +512,7 @@ static int omapfb_memory_read(struct fb_info *fbi, | |||
509 | mr->x, mr->y, mr->w, mr->h); | 512 | mr->x, mr->y, mr->w, mr->h); |
510 | 513 | ||
511 | if (r > 0) { | 514 | if (r > 0) { |
512 | if (copy_to_user(mr->buffer, buf, mr->buffer_size)) | 515 | if (copy_to_user(mr->buffer, buf, r)) |
513 | r = -EFAULT; | 516 | r = -EFAULT; |
514 | } | 517 | } |
515 | 518 | ||
diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c index def3a501acd6..d059d04c63ac 100644 --- a/drivers/video/fbdev/pxa168fb.c +++ b/drivers/video/fbdev/pxa168fb.c | |||
@@ -712,7 +712,7 @@ static int pxa168fb_probe(struct platform_device *pdev) | |||
712 | /* | 712 | /* |
713 | * enable controller clock | 713 | * enable controller clock |
714 | */ | 714 | */ |
715 | clk_enable(fbi->clk); | 715 | clk_prepare_enable(fbi->clk); |
716 | 716 | ||
717 | pxa168fb_set_par(info); | 717 | pxa168fb_set_par(info); |
718 | 718 | ||
@@ -767,7 +767,7 @@ static int pxa168fb_probe(struct platform_device *pdev) | |||
767 | failed_free_cmap: | 767 | failed_free_cmap: |
768 | fb_dealloc_cmap(&info->cmap); | 768 | fb_dealloc_cmap(&info->cmap); |
769 | failed_free_clk: | 769 | failed_free_clk: |
770 | clk_disable(fbi->clk); | 770 | clk_disable_unprepare(fbi->clk); |
771 | failed_free_fbmem: | 771 | failed_free_fbmem: |
772 | dma_free_coherent(fbi->dev, info->fix.smem_len, | 772 | dma_free_coherent(fbi->dev, info->fix.smem_len, |
773 | info->screen_base, fbi->fb_start_dma); | 773 | info->screen_base, fbi->fb_start_dma); |
@@ -807,7 +807,7 @@ static int pxa168fb_remove(struct platform_device *pdev) | |||
807 | dma_free_wc(fbi->dev, PAGE_ALIGN(info->fix.smem_len), | 807 | dma_free_wc(fbi->dev, PAGE_ALIGN(info->fix.smem_len), |
808 | info->screen_base, info->fix.smem_start); | 808 | info->screen_base, info->fix.smem_start); |
809 | 809 | ||
810 | clk_disable(fbi->clk); | 810 | clk_disable_unprepare(fbi->clk); |
811 | 811 | ||
812 | framebuffer_release(info); | 812 | framebuffer_release(info); |
813 | 813 | ||
diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c index 045e8afe398b..9e88e3f594c2 100644 --- a/drivers/video/fbdev/stifb.c +++ b/drivers/video/fbdev/stifb.c | |||
@@ -1157,7 +1157,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) | |||
1157 | dev_name); | 1157 | dev_name); |
1158 | goto out_err0; | 1158 | goto out_err0; |
1159 | } | 1159 | } |
1160 | /* fall though */ | 1160 | /* fall through */ |
1161 | case S9000_ID_ARTIST: | 1161 | case S9000_ID_ARTIST: |
1162 | case S9000_ID_HCRX: | 1162 | case S9000_ID_HCRX: |
1163 | case S9000_ID_TIMBER: | 1163 | case S9000_ID_TIMBER: |
@@ -447,6 +447,7 @@ bool dax_lock_mapping_entry(struct page *page) | |||
447 | xa_unlock_irq(&mapping->i_pages); | 447 | xa_unlock_irq(&mapping->i_pages); |
448 | break; | 448 | break; |
449 | } else if (IS_ERR(entry)) { | 449 | } else if (IS_ERR(entry)) { |
450 | xa_unlock_irq(&mapping->i_pages); | ||
450 | WARN_ON_ONCE(PTR_ERR(entry) != -EAGAIN); | 451 | WARN_ON_ONCE(PTR_ERR(entry) != -EAGAIN); |
451 | continue; | 452 | continue; |
452 | } | 453 | } |
@@ -1120,21 +1121,12 @@ static vm_fault_t dax_load_hole(struct address_space *mapping, void *entry, | |||
1120 | { | 1121 | { |
1121 | struct inode *inode = mapping->host; | 1122 | struct inode *inode = mapping->host; |
1122 | unsigned long vaddr = vmf->address; | 1123 | unsigned long vaddr = vmf->address; |
1123 | vm_fault_t ret = VM_FAULT_NOPAGE; | 1124 | pfn_t pfn = pfn_to_pfn_t(my_zero_pfn(vaddr)); |
1124 | struct page *zero_page; | 1125 | vm_fault_t ret; |
1125 | pfn_t pfn; | ||
1126 | |||
1127 | zero_page = ZERO_PAGE(0); | ||
1128 | if (unlikely(!zero_page)) { | ||
1129 | ret = VM_FAULT_OOM; | ||
1130 | goto out; | ||
1131 | } | ||
1132 | 1126 | ||
1133 | pfn = page_to_pfn_t(zero_page); | ||
1134 | dax_insert_mapping_entry(mapping, vmf, entry, pfn, RADIX_DAX_ZERO_PAGE, | 1127 | dax_insert_mapping_entry(mapping, vmf, entry, pfn, RADIX_DAX_ZERO_PAGE, |
1135 | false); | 1128 | false); |
1136 | ret = vmf_insert_mixed(vmf->vma, vaddr, pfn); | 1129 | ret = vmf_insert_mixed(vmf->vma, vaddr, pfn); |
1137 | out: | ||
1138 | trace_dax_load_hole(inode, vmf, ret); | 1130 | trace_dax_load_hole(inode, vmf, ret); |
1139 | return ret; | 1131 | return ret; |
1140 | } | 1132 | } |
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 7f7ee18fe179..e4bb9386c045 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c | |||
@@ -1448,6 +1448,7 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino) | |||
1448 | } | 1448 | } |
1449 | inode->i_blocks = le32_to_cpu(raw_inode->i_blocks); | 1449 | inode->i_blocks = le32_to_cpu(raw_inode->i_blocks); |
1450 | ei->i_flags = le32_to_cpu(raw_inode->i_flags); | 1450 | ei->i_flags = le32_to_cpu(raw_inode->i_flags); |
1451 | ext2_set_inode_flags(inode); | ||
1451 | ei->i_faddr = le32_to_cpu(raw_inode->i_faddr); | 1452 | ei->i_faddr = le32_to_cpu(raw_inode->i_faddr); |
1452 | ei->i_frag_no = raw_inode->i_frag; | 1453 | ei->i_frag_no = raw_inode->i_frag; |
1453 | ei->i_frag_size = raw_inode->i_fsize; | 1454 | ei->i_frag_size = raw_inode->i_fsize; |
@@ -1517,7 +1518,6 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino) | |||
1517 | new_decode_dev(le32_to_cpu(raw_inode->i_block[1]))); | 1518 | new_decode_dev(le32_to_cpu(raw_inode->i_block[1]))); |
1518 | } | 1519 | } |
1519 | brelse (bh); | 1520 | brelse (bh); |
1520 | ext2_set_inode_flags(inode); | ||
1521 | unlock_new_inode(inode); | 1521 | unlock_new_inode(inode); |
1522 | return inode; | 1522 | return inode; |
1523 | 1523 | ||
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index bbd1e357c23d..f4fd2e72add4 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c | |||
@@ -898,8 +898,22 @@ static struct platform_driver ramoops_driver = { | |||
898 | }, | 898 | }, |
899 | }; | 899 | }; |
900 | 900 | ||
901 | static void ramoops_register_dummy(void) | 901 | static inline void ramoops_unregister_dummy(void) |
902 | { | 902 | { |
903 | platform_device_unregister(dummy); | ||
904 | dummy = NULL; | ||
905 | |||
906 | kfree(dummy_data); | ||
907 | dummy_data = NULL; | ||
908 | } | ||
909 | |||
910 | static void __init ramoops_register_dummy(void) | ||
911 | { | ||
912 | /* | ||
913 | * Prepare a dummy platform data structure to carry the module | ||
914 | * parameters. If mem_size isn't set, then there are no module | ||
915 | * parameters, and we can skip this. | ||
916 | */ | ||
903 | if (!mem_size) | 917 | if (!mem_size) |
904 | return; | 918 | return; |
905 | 919 | ||
@@ -932,21 +946,28 @@ static void ramoops_register_dummy(void) | |||
932 | if (IS_ERR(dummy)) { | 946 | if (IS_ERR(dummy)) { |
933 | pr_info("could not create platform device: %ld\n", | 947 | pr_info("could not create platform device: %ld\n", |
934 | PTR_ERR(dummy)); | 948 | PTR_ERR(dummy)); |
949 | dummy = NULL; | ||
950 | ramoops_unregister_dummy(); | ||
935 | } | 951 | } |
936 | } | 952 | } |
937 | 953 | ||
938 | static int __init ramoops_init(void) | 954 | static int __init ramoops_init(void) |
939 | { | 955 | { |
956 | int ret; | ||
957 | |||
940 | ramoops_register_dummy(); | 958 | ramoops_register_dummy(); |
941 | return platform_driver_register(&ramoops_driver); | 959 | ret = platform_driver_register(&ramoops_driver); |
960 | if (ret != 0) | ||
961 | ramoops_unregister_dummy(); | ||
962 | |||
963 | return ret; | ||
942 | } | 964 | } |
943 | late_initcall(ramoops_init); | 965 | late_initcall(ramoops_init); |
944 | 966 | ||
945 | static void __exit ramoops_exit(void) | 967 | static void __exit ramoops_exit(void) |
946 | { | 968 | { |
947 | platform_driver_unregister(&ramoops_driver); | 969 | platform_driver_unregister(&ramoops_driver); |
948 | platform_device_unregister(dummy); | 970 | ramoops_unregister_dummy(); |
949 | kfree(dummy_data); | ||
950 | } | 971 | } |
951 | module_exit(ramoops_exit); | 972 | module_exit(ramoops_exit); |
952 | 973 | ||
diff --git a/fs/xattr.c b/fs/xattr.c index daa732550088..0d6a6a4af861 100644 --- a/fs/xattr.c +++ b/fs/xattr.c | |||
@@ -948,17 +948,19 @@ ssize_t simple_xattr_list(struct inode *inode, struct simple_xattrs *xattrs, | |||
948 | int err = 0; | 948 | int err = 0; |
949 | 949 | ||
950 | #ifdef CONFIG_FS_POSIX_ACL | 950 | #ifdef CONFIG_FS_POSIX_ACL |
951 | if (inode->i_acl) { | 951 | if (IS_POSIXACL(inode)) { |
952 | err = xattr_list_one(&buffer, &remaining_size, | 952 | if (inode->i_acl) { |
953 | XATTR_NAME_POSIX_ACL_ACCESS); | 953 | err = xattr_list_one(&buffer, &remaining_size, |
954 | if (err) | 954 | XATTR_NAME_POSIX_ACL_ACCESS); |
955 | return err; | 955 | if (err) |
956 | } | 956 | return err; |
957 | if (inode->i_default_acl) { | 957 | } |
958 | err = xattr_list_one(&buffer, &remaining_size, | 958 | if (inode->i_default_acl) { |
959 | XATTR_NAME_POSIX_ACL_DEFAULT); | 959 | err = xattr_list_one(&buffer, &remaining_size, |
960 | if (err) | 960 | XATTR_NAME_POSIX_ACL_DEFAULT); |
961 | return err; | 961 | if (err) |
962 | return err; | ||
963 | } | ||
962 | } | 964 | } |
963 | #endif | 965 | #endif |
964 | 966 | ||
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 582a0ec0aa70..777814755fa6 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h | |||
@@ -89,7 +89,6 @@ struct drm_panel { | |||
89 | struct drm_device *drm; | 89 | struct drm_device *drm; |
90 | struct drm_connector *connector; | 90 | struct drm_connector *connector; |
91 | struct device *dev; | 91 | struct device *dev; |
92 | struct device_link *link; | ||
93 | 92 | ||
94 | const struct drm_panel_funcs *funcs; | 93 | const struct drm_panel_funcs *funcs; |
95 | 94 | ||
diff --git a/include/linux/mfd/rohm-bd718x7.h b/include/linux/mfd/rohm-bd718x7.h index a528747f8aed..e8338e5dc10b 100644 --- a/include/linux/mfd/rohm-bd718x7.h +++ b/include/linux/mfd/rohm-bd718x7.h | |||
@@ -78,9 +78,9 @@ enum { | |||
78 | BD71837_REG_TRANS_COND0 = 0x1F, | 78 | BD71837_REG_TRANS_COND0 = 0x1F, |
79 | BD71837_REG_TRANS_COND1 = 0x20, | 79 | BD71837_REG_TRANS_COND1 = 0x20, |
80 | BD71837_REG_VRFAULTEN = 0x21, | 80 | BD71837_REG_VRFAULTEN = 0x21, |
81 | BD71837_REG_MVRFLTMASK0 = 0x22, | 81 | BD718XX_REG_MVRFLTMASK0 = 0x22, |
82 | BD71837_REG_MVRFLTMASK1 = 0x23, | 82 | BD718XX_REG_MVRFLTMASK1 = 0x23, |
83 | BD71837_REG_MVRFLTMASK2 = 0x24, | 83 | BD718XX_REG_MVRFLTMASK2 = 0x24, |
84 | BD71837_REG_RCVCFG = 0x25, | 84 | BD71837_REG_RCVCFG = 0x25, |
85 | BD71837_REG_RCVNUM = 0x26, | 85 | BD71837_REG_RCVNUM = 0x26, |
86 | BD71837_REG_PWRONCONFIG0 = 0x27, | 86 | BD71837_REG_PWRONCONFIG0 = 0x27, |
@@ -159,6 +159,33 @@ enum { | |||
159 | #define BUCK8_MASK 0x3F | 159 | #define BUCK8_MASK 0x3F |
160 | #define BUCK8_DEFAULT 0x1E | 160 | #define BUCK8_DEFAULT 0x1E |
161 | 161 | ||
162 | /* BD718XX Voltage monitoring masks */ | ||
163 | #define BD718XX_BUCK1_VRMON80 0x1 | ||
164 | #define BD718XX_BUCK1_VRMON130 0x2 | ||
165 | #define BD718XX_BUCK2_VRMON80 0x4 | ||
166 | #define BD718XX_BUCK2_VRMON130 0x8 | ||
167 | #define BD718XX_1ST_NODVS_BUCK_VRMON80 0x1 | ||
168 | #define BD718XX_1ST_NODVS_BUCK_VRMON130 0x2 | ||
169 | #define BD718XX_2ND_NODVS_BUCK_VRMON80 0x4 | ||
170 | #define BD718XX_2ND_NODVS_BUCK_VRMON130 0x8 | ||
171 | #define BD718XX_3RD_NODVS_BUCK_VRMON80 0x10 | ||
172 | #define BD718XX_3RD_NODVS_BUCK_VRMON130 0x20 | ||
173 | #define BD718XX_4TH_NODVS_BUCK_VRMON80 0x40 | ||
174 | #define BD718XX_4TH_NODVS_BUCK_VRMON130 0x80 | ||
175 | #define BD718XX_LDO1_VRMON80 0x1 | ||
176 | #define BD718XX_LDO2_VRMON80 0x2 | ||
177 | #define BD718XX_LDO3_VRMON80 0x4 | ||
178 | #define BD718XX_LDO4_VRMON80 0x8 | ||
179 | #define BD718XX_LDO5_VRMON80 0x10 | ||
180 | #define BD718XX_LDO6_VRMON80 0x20 | ||
181 | |||
182 | /* BD71837 specific voltage monitoring masks */ | ||
183 | #define BD71837_BUCK3_VRMON80 0x10 | ||
184 | #define BD71837_BUCK3_VRMON130 0x20 | ||
185 | #define BD71837_BUCK4_VRMON80 0x40 | ||
186 | #define BD71837_BUCK4_VRMON130 0x80 | ||
187 | #define BD71837_LDO7_VRMON80 0x40 | ||
188 | |||
162 | /* BD71837_REG_IRQ bits */ | 189 | /* BD71837_REG_IRQ bits */ |
163 | #define IRQ_SWRST 0x40 | 190 | #define IRQ_SWRST 0x40 |
164 | #define IRQ_PWRON_S 0x20 | 191 | #define IRQ_PWRON_S 0x20 |
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 3468703d663a..a459a5e973a7 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -48,9 +48,9 @@ struct regulator; | |||
48 | * DISABLE_IN_SUSPEND - turn off regulator in suspend states | 48 | * DISABLE_IN_SUSPEND - turn off regulator in suspend states |
49 | * ENABLE_IN_SUSPEND - keep regulator on in suspend states | 49 | * ENABLE_IN_SUSPEND - keep regulator on in suspend states |
50 | */ | 50 | */ |
51 | #define DO_NOTHING_IN_SUSPEND (-1) | 51 | #define DO_NOTHING_IN_SUSPEND 0 |
52 | #define DISABLE_IN_SUSPEND 0 | 52 | #define DISABLE_IN_SUSPEND 1 |
53 | #define ENABLE_IN_SUSPEND 1 | 53 | #define ENABLE_IN_SUSPEND 2 |
54 | 54 | ||
55 | /* Regulator active discharge flags */ | 55 | /* Regulator active discharge flags */ |
56 | enum regulator_active_discharge { | 56 | enum regulator_active_discharge { |
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h index b2bd4b4127c4..69ee30456864 100644 --- a/include/linux/spi/spi-mem.h +++ b/include/linux/spi/spi-mem.h | |||
@@ -81,8 +81,10 @@ enum spi_mem_data_dir { | |||
81 | * @dummy.buswidth: number of IO lanes used to transmit the dummy bytes | 81 | * @dummy.buswidth: number of IO lanes used to transmit the dummy bytes |
82 | * @data.buswidth: number of IO lanes used to send/receive the data | 82 | * @data.buswidth: number of IO lanes used to send/receive the data |
83 | * @data.dir: direction of the transfer | 83 | * @data.dir: direction of the transfer |
84 | * @data.buf.in: input buffer | 84 | * @data.nbytes: number of data bytes to send/receive. Can be zero if the |
85 | * @data.buf.out: output buffer | 85 | * operation does not involve transferring data |
86 | * @data.buf.in: input buffer (must be DMA-able) | ||
87 | * @data.buf.out: output buffer (must be DMA-able) | ||
86 | */ | 88 | */ |
87 | struct spi_mem_op { | 89 | struct spi_mem_op { |
88 | struct { | 90 | struct { |
@@ -105,7 +107,6 @@ struct spi_mem_op { | |||
105 | u8 buswidth; | 107 | u8 buswidth; |
106 | enum spi_mem_data_dir dir; | 108 | enum spi_mem_data_dir dir; |
107 | unsigned int nbytes; | 109 | unsigned int nbytes; |
108 | /* buf.{in,out} must be DMA-able. */ | ||
109 | union { | 110 | union { |
110 | void *in; | 111 | void *in; |
111 | const void *out; | 112 | const void *out; |
diff --git a/include/linux/uio.h b/include/linux/uio.h index 409c845d4cd3..422b1c01ee0d 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
@@ -172,7 +172,7 @@ size_t copy_from_iter_flushcache(void *addr, size_t bytes, struct iov_iter *i) | |||
172 | static __always_inline __must_check | 172 | static __always_inline __must_check |
173 | size_t copy_to_iter_mcsafe(void *addr, size_t bytes, struct iov_iter *i) | 173 | size_t copy_to_iter_mcsafe(void *addr, size_t bytes, struct iov_iter *i) |
174 | { | 174 | { |
175 | if (unlikely(!check_copy_size(addr, bytes, false))) | 175 | if (unlikely(!check_copy_size(addr, bytes, true))) |
176 | return 0; | 176 | return 0; |
177 | else | 177 | else |
178 | return _copy_to_iter_mcsafe(addr, bytes, i); | 178 | return _copy_to_iter_mcsafe(addr, bytes, i); |
diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index ea73fef8bdc0..8586cfb49828 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h | |||
@@ -38,10 +38,13 @@ struct v4l2_ctrl_handler; | |||
38 | * @prio: priority of the file handler, as defined by &enum v4l2_priority | 38 | * @prio: priority of the file handler, as defined by &enum v4l2_priority |
39 | * | 39 | * |
40 | * @wait: event' s wait queue | 40 | * @wait: event' s wait queue |
41 | * @subscribe_lock: serialise changes to the subscribed list; guarantee that | ||
42 | * the add and del event callbacks are orderly called | ||
41 | * @subscribed: list of subscribed events | 43 | * @subscribed: list of subscribed events |
42 | * @available: list of events waiting to be dequeued | 44 | * @available: list of events waiting to be dequeued |
43 | * @navailable: number of available events at @available list | 45 | * @navailable: number of available events at @available list |
44 | * @sequence: event sequence number | 46 | * @sequence: event sequence number |
47 | * | ||
45 | * @m2m_ctx: pointer to &struct v4l2_m2m_ctx | 48 | * @m2m_ctx: pointer to &struct v4l2_m2m_ctx |
46 | */ | 49 | */ |
47 | struct v4l2_fh { | 50 | struct v4l2_fh { |
@@ -52,6 +55,7 @@ struct v4l2_fh { | |||
52 | 55 | ||
53 | /* Events */ | 56 | /* Events */ |
54 | wait_queue_head_t wait; | 57 | wait_queue_head_t wait; |
58 | struct mutex subscribe_lock; | ||
55 | struct list_head subscribed; | 59 | struct list_head subscribed; |
56 | struct list_head available; | 60 | struct list_head available; |
57 | unsigned int navailable; | 61 | unsigned int navailable; |
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig index 9bd54304446f..1b1d63b3634b 100644 --- a/kernel/dma/Kconfig +++ b/kernel/dma/Kconfig | |||
@@ -23,6 +23,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU | |||
23 | bool | 23 | bool |
24 | select NEED_DMA_MAP_STATE | 24 | select NEED_DMA_MAP_STATE |
25 | 25 | ||
26 | config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL | ||
27 | bool | ||
28 | |||
26 | config DMA_DIRECT_OPS | 29 | config DMA_DIRECT_OPS |
27 | bool | 30 | bool |
28 | depends on HAS_DMA | 31 | depends on HAS_DMA |
diff --git a/kernel/events/core.c b/kernel/events/core.c index c80549bf82c6..dcb093e7b377 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -3935,6 +3935,12 @@ int perf_event_read_local(struct perf_event *event, u64 *value, | |||
3935 | goto out; | 3935 | goto out; |
3936 | } | 3936 | } |
3937 | 3937 | ||
3938 | /* If this is a pinned event it must be running on this CPU */ | ||
3939 | if (event->attr.pinned && event->oncpu != smp_processor_id()) { | ||
3940 | ret = -EBUSY; | ||
3941 | goto out; | ||
3942 | } | ||
3943 | |||
3938 | /* | 3944 | /* |
3939 | * If the event is currently on this CPU, its either a per-task event, | 3945 | * If the event is currently on this CPU, its either a per-task event, |
3940 | * or local to this CPU. Furthermore it means its ACTIVE (otherwise | 3946 | * or local to this CPU. Furthermore it means its ACTIVE (otherwise |
diff --git a/tools/testing/selftests/powerpc/alignment/Makefile b/tools/testing/selftests/powerpc/alignment/Makefile index 93baacab7693..d056486f49de 100644 --- a/tools/testing/selftests/powerpc/alignment/Makefile +++ b/tools/testing/selftests/powerpc/alignment/Makefile | |||
@@ -1,5 +1,6 @@ | |||
1 | TEST_GEN_PROGS := copy_first_unaligned alignment_handler | 1 | TEST_GEN_PROGS := copy_first_unaligned alignment_handler |
2 | 2 | ||
3 | top_srcdir = ../../../../.. | ||
3 | include ../../lib.mk | 4 | include ../../lib.mk |
4 | 5 | ||
5 | $(TEST_GEN_PROGS): ../harness.c ../utils.c | 6 | $(TEST_GEN_PROGS): ../harness.c ../utils.c |
diff --git a/tools/testing/selftests/powerpc/benchmarks/Makefile b/tools/testing/selftests/powerpc/benchmarks/Makefile index b4d7432a0ecd..d40300a65b42 100644 --- a/tools/testing/selftests/powerpc/benchmarks/Makefile +++ b/tools/testing/selftests/powerpc/benchmarks/Makefile | |||
@@ -4,6 +4,7 @@ TEST_GEN_FILES := exec_target | |||
4 | 4 | ||
5 | CFLAGS += -O2 | 5 | CFLAGS += -O2 |
6 | 6 | ||
7 | top_srcdir = ../../../../.. | ||
7 | include ../../lib.mk | 8 | include ../../lib.mk |
8 | 9 | ||
9 | $(TEST_GEN_PROGS): ../harness.c | 10 | $(TEST_GEN_PROGS): ../harness.c |
diff --git a/tools/testing/selftests/powerpc/cache_shape/Makefile b/tools/testing/selftests/powerpc/cache_shape/Makefile index 1be547434a49..ede4d3dae750 100644 --- a/tools/testing/selftests/powerpc/cache_shape/Makefile +++ b/tools/testing/selftests/powerpc/cache_shape/Makefile | |||
@@ -5,6 +5,7 @@ all: $(TEST_PROGS) | |||
5 | 5 | ||
6 | $(TEST_PROGS): ../harness.c ../utils.c | 6 | $(TEST_PROGS): ../harness.c ../utils.c |
7 | 7 | ||
8 | top_srcdir = ../../../../.. | ||
8 | include ../../lib.mk | 9 | include ../../lib.mk |
9 | 10 | ||
10 | clean: | 11 | clean: |
diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile b/tools/testing/selftests/powerpc/copyloops/Makefile index 1cf89a34d97c..44574f3818b3 100644 --- a/tools/testing/selftests/powerpc/copyloops/Makefile +++ b/tools/testing/selftests/powerpc/copyloops/Makefile | |||
@@ -17,6 +17,7 @@ TEST_GEN_PROGS := copyuser_64_t0 copyuser_64_t1 copyuser_64_t2 \ | |||
17 | 17 | ||
18 | EXTRA_SOURCES := validate.c ../harness.c stubs.S | 18 | EXTRA_SOURCES := validate.c ../harness.c stubs.S |
19 | 19 | ||
20 | top_srcdir = ../../../../.. | ||
20 | include ../../lib.mk | 21 | include ../../lib.mk |
21 | 22 | ||
22 | $(OUTPUT)/copyuser_64_t%: copyuser_64.S $(EXTRA_SOURCES) | 23 | $(OUTPUT)/copyuser_64_t%: copyuser_64.S $(EXTRA_SOURCES) |
diff --git a/tools/testing/selftests/powerpc/dscr/Makefile b/tools/testing/selftests/powerpc/dscr/Makefile index 55d7db7a616b..5df476364b4d 100644 --- a/tools/testing/selftests/powerpc/dscr/Makefile +++ b/tools/testing/selftests/powerpc/dscr/Makefile | |||
@@ -3,6 +3,7 @@ TEST_GEN_PROGS := dscr_default_test dscr_explicit_test dscr_user_test \ | |||
3 | dscr_inherit_test dscr_inherit_exec_test dscr_sysfs_test \ | 3 | dscr_inherit_test dscr_inherit_exec_test dscr_sysfs_test \ |
4 | dscr_sysfs_thread_test | 4 | dscr_sysfs_thread_test |
5 | 5 | ||
6 | top_srcdir = ../../../../.. | ||
6 | include ../../lib.mk | 7 | include ../../lib.mk |
7 | 8 | ||
8 | $(OUTPUT)/dscr_default_test: LDLIBS += -lpthread | 9 | $(OUTPUT)/dscr_default_test: LDLIBS += -lpthread |
diff --git a/tools/testing/selftests/powerpc/math/Makefile b/tools/testing/selftests/powerpc/math/Makefile index 0dd3a01fdab9..11a10d7a2bbd 100644 --- a/tools/testing/selftests/powerpc/math/Makefile +++ b/tools/testing/selftests/powerpc/math/Makefile | |||
@@ -1,6 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | TEST_GEN_PROGS := fpu_syscall fpu_preempt fpu_signal vmx_syscall vmx_preempt vmx_signal vsx_preempt | 2 | TEST_GEN_PROGS := fpu_syscall fpu_preempt fpu_signal vmx_syscall vmx_preempt vmx_signal vsx_preempt |
3 | 3 | ||
4 | top_srcdir = ../../../../.. | ||
4 | include ../../lib.mk | 5 | include ../../lib.mk |
5 | 6 | ||
6 | $(TEST_GEN_PROGS): ../harness.c | 7 | $(TEST_GEN_PROGS): ../harness.c |
diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile index 8ebbe96d80a8..33ced6e0ad25 100644 --- a/tools/testing/selftests/powerpc/mm/Makefile +++ b/tools/testing/selftests/powerpc/mm/Makefile | |||
@@ -5,6 +5,7 @@ noarg: | |||
5 | TEST_GEN_PROGS := hugetlb_vs_thp_test subpage_prot prot_sao segv_errors | 5 | TEST_GEN_PROGS := hugetlb_vs_thp_test subpage_prot prot_sao segv_errors |
6 | TEST_GEN_FILES := tempfile | 6 | TEST_GEN_FILES := tempfile |
7 | 7 | ||
8 | top_srcdir = ../../../../.. | ||
8 | include ../../lib.mk | 9 | include ../../lib.mk |
9 | 10 | ||
10 | $(TEST_GEN_PROGS): ../harness.c | 11 | $(TEST_GEN_PROGS): ../harness.c |
diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile index 6e1629bf5b09..19046db995fe 100644 --- a/tools/testing/selftests/powerpc/pmu/Makefile +++ b/tools/testing/selftests/powerpc/pmu/Makefile | |||
@@ -5,6 +5,7 @@ noarg: | |||
5 | TEST_GEN_PROGS := count_instructions l3_bank_test per_event_excludes | 5 | TEST_GEN_PROGS := count_instructions l3_bank_test per_event_excludes |
6 | EXTRA_SOURCES := ../harness.c event.c lib.c ../utils.c | 6 | EXTRA_SOURCES := ../harness.c event.c lib.c ../utils.c |
7 | 7 | ||
8 | top_srcdir = ../../../../.. | ||
8 | include ../../lib.mk | 9 | include ../../lib.mk |
9 | 10 | ||
10 | all: $(TEST_GEN_PROGS) ebb | 11 | all: $(TEST_GEN_PROGS) ebb |
diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile b/tools/testing/selftests/powerpc/pmu/ebb/Makefile index c4e64bc2e265..bd5dfa509272 100644 --- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile +++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile | |||
@@ -17,6 +17,7 @@ TEST_GEN_PROGS := reg_access_test event_attributes_test cycles_test \ | |||
17 | lost_exception_test no_handler_test \ | 17 | lost_exception_test no_handler_test \ |
18 | cycles_with_mmcr2_test | 18 | cycles_with_mmcr2_test |
19 | 19 | ||
20 | top_srcdir = ../../../../../.. | ||
20 | include ../../../lib.mk | 21 | include ../../../lib.mk |
21 | 22 | ||
22 | $(TEST_GEN_PROGS): ../../harness.c ../../utils.c ../event.c ../lib.c \ | 23 | $(TEST_GEN_PROGS): ../../harness.c ../../utils.c ../event.c ../lib.c \ |
diff --git a/tools/testing/selftests/powerpc/primitives/Makefile b/tools/testing/selftests/powerpc/primitives/Makefile index 175366db7be8..ea2b7bd09e36 100644 --- a/tools/testing/selftests/powerpc/primitives/Makefile +++ b/tools/testing/selftests/powerpc/primitives/Makefile | |||
@@ -2,6 +2,7 @@ CFLAGS += -I$(CURDIR) | |||
2 | 2 | ||
3 | TEST_GEN_PROGS := load_unaligned_zeropad | 3 | TEST_GEN_PROGS := load_unaligned_zeropad |
4 | 4 | ||
5 | top_srcdir = ../../../../.. | ||
5 | include ../../lib.mk | 6 | include ../../lib.mk |
6 | 7 | ||
7 | $(TEST_GEN_PROGS): ../harness.c | 8 | $(TEST_GEN_PROGS): ../harness.c |
diff --git a/tools/testing/selftests/powerpc/ptrace/Makefile b/tools/testing/selftests/powerpc/ptrace/Makefile index 28f5b781a553..923d531265f8 100644 --- a/tools/testing/selftests/powerpc/ptrace/Makefile +++ b/tools/testing/selftests/powerpc/ptrace/Makefile | |||
@@ -4,6 +4,7 @@ TEST_PROGS := ptrace-gpr ptrace-tm-gpr ptrace-tm-spd-gpr \ | |||
4 | ptrace-tm-spd-vsx ptrace-tm-spr ptrace-hwbreak ptrace-pkey core-pkey \ | 4 | ptrace-tm-spd-vsx ptrace-tm-spr ptrace-hwbreak ptrace-pkey core-pkey \ |
5 | perf-hwbreak | 5 | perf-hwbreak |
6 | 6 | ||
7 | top_srcdir = ../../../../.. | ||
7 | include ../../lib.mk | 8 | include ../../lib.mk |
8 | 9 | ||
9 | all: $(TEST_PROGS) | 10 | all: $(TEST_PROGS) |
diff --git a/tools/testing/selftests/powerpc/signal/Makefile b/tools/testing/selftests/powerpc/signal/Makefile index a7cbd5082e27..1fca25c6ace0 100644 --- a/tools/testing/selftests/powerpc/signal/Makefile +++ b/tools/testing/selftests/powerpc/signal/Makefile | |||
@@ -8,6 +8,7 @@ $(TEST_PROGS): ../harness.c ../utils.c signal.S | |||
8 | CFLAGS += -maltivec | 8 | CFLAGS += -maltivec |
9 | signal_tm: CFLAGS += -mhtm | 9 | signal_tm: CFLAGS += -mhtm |
10 | 10 | ||
11 | top_srcdir = ../../../../.. | ||
11 | include ../../lib.mk | 12 | include ../../lib.mk |
12 | 13 | ||
13 | clean: | 14 | clean: |
diff --git a/tools/testing/selftests/powerpc/stringloops/Makefile b/tools/testing/selftests/powerpc/stringloops/Makefile index 10b35c87a4f4..7fc0623d85c3 100644 --- a/tools/testing/selftests/powerpc/stringloops/Makefile +++ b/tools/testing/selftests/powerpc/stringloops/Makefile | |||
@@ -29,6 +29,7 @@ endif | |||
29 | 29 | ||
30 | ASFLAGS = $(CFLAGS) | 30 | ASFLAGS = $(CFLAGS) |
31 | 31 | ||
32 | top_srcdir = ../../../../.. | ||
32 | include ../../lib.mk | 33 | include ../../lib.mk |
33 | 34 | ||
34 | $(TEST_GEN_PROGS): $(EXTRA_SOURCES) | 35 | $(TEST_GEN_PROGS): $(EXTRA_SOURCES) |
diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile index 30b8ff8fb82e..fcd2dcb8972b 100644 --- a/tools/testing/selftests/powerpc/switch_endian/Makefile +++ b/tools/testing/selftests/powerpc/switch_endian/Makefile | |||
@@ -5,6 +5,7 @@ ASFLAGS += -O2 -Wall -g -nostdlib -m64 | |||
5 | 5 | ||
6 | EXTRA_CLEAN = $(OUTPUT)/*.o $(OUTPUT)/check-reversed.S | 6 | EXTRA_CLEAN = $(OUTPUT)/*.o $(OUTPUT)/check-reversed.S |
7 | 7 | ||
8 | top_srcdir = ../../../../.. | ||
8 | include ../../lib.mk | 9 | include ../../lib.mk |
9 | 10 | ||
10 | $(OUTPUT)/switch_endian_test: $(OUTPUT)/check-reversed.S | 11 | $(OUTPUT)/switch_endian_test: $(OUTPUT)/check-reversed.S |
diff --git a/tools/testing/selftests/powerpc/syscalls/Makefile b/tools/testing/selftests/powerpc/syscalls/Makefile index da22ca7c38c1..161b8846336f 100644 --- a/tools/testing/selftests/powerpc/syscalls/Makefile +++ b/tools/testing/selftests/powerpc/syscalls/Makefile | |||
@@ -2,6 +2,7 @@ TEST_GEN_PROGS := ipc_unmuxed | |||
2 | 2 | ||
3 | CFLAGS += -I../../../../../usr/include | 3 | CFLAGS += -I../../../../../usr/include |
4 | 4 | ||
5 | top_srcdir = ../../../../.. | ||
5 | include ../../lib.mk | 6 | include ../../lib.mk |
6 | 7 | ||
7 | $(TEST_GEN_PROGS): ../harness.c | 8 | $(TEST_GEN_PROGS): ../harness.c |
diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile index c0e45d2dde25..9fc2cf6fbc92 100644 --- a/tools/testing/selftests/powerpc/tm/Makefile +++ b/tools/testing/selftests/powerpc/tm/Makefile | |||
@@ -6,6 +6,7 @@ TEST_GEN_PROGS := tm-resched-dscr tm-syscall tm-signal-msr-resv tm-signal-stack | |||
6 | tm-vmxcopy tm-fork tm-tar tm-tmspr tm-vmx-unavail tm-unavailable tm-trap \ | 6 | tm-vmxcopy tm-fork tm-tar tm-tmspr tm-vmx-unavail tm-unavailable tm-trap \ |
7 | $(SIGNAL_CONTEXT_CHK_TESTS) tm-sigreturn | 7 | $(SIGNAL_CONTEXT_CHK_TESTS) tm-sigreturn |
8 | 8 | ||
9 | top_srcdir = ../../../../.. | ||
9 | include ../../lib.mk | 10 | include ../../lib.mk |
10 | 11 | ||
11 | $(TEST_GEN_PROGS): ../harness.c ../utils.c | 12 | $(TEST_GEN_PROGS): ../harness.c ../utils.c |
diff --git a/tools/testing/selftests/powerpc/vphn/Makefile b/tools/testing/selftests/powerpc/vphn/Makefile index f8ced26748f8..fb82068c9fda 100644 --- a/tools/testing/selftests/powerpc/vphn/Makefile +++ b/tools/testing/selftests/powerpc/vphn/Makefile | |||
@@ -2,6 +2,7 @@ TEST_GEN_PROGS := test-vphn | |||
2 | 2 | ||
3 | CFLAGS += -m64 | 3 | CFLAGS += -m64 |
4 | 4 | ||
5 | top_srcdir = ../../../../.. | ||
5 | include ../../lib.mk | 6 | include ../../lib.mk |
6 | 7 | ||
7 | $(TEST_GEN_PROGS): ../harness.c | 8 | $(TEST_GEN_PROGS): ../harness.c |
diff --git a/tools/testing/selftests/rseq/param_test.c b/tools/testing/selftests/rseq/param_test.c index 642d4e12abea..eec2663261f2 100644 --- a/tools/testing/selftests/rseq/param_test.c +++ b/tools/testing/selftests/rseq/param_test.c | |||
@@ -56,15 +56,13 @@ unsigned int yield_mod_cnt, nr_abort; | |||
56 | printf(fmt, ## __VA_ARGS__); \ | 56 | printf(fmt, ## __VA_ARGS__); \ |
57 | } while (0) | 57 | } while (0) |
58 | 58 | ||
59 | #if defined(__x86_64__) || defined(__i386__) | 59 | #ifdef __i386__ |
60 | 60 | ||
61 | #define INJECT_ASM_REG "eax" | 61 | #define INJECT_ASM_REG "eax" |
62 | 62 | ||
63 | #define RSEQ_INJECT_CLOBBER \ | 63 | #define RSEQ_INJECT_CLOBBER \ |
64 | , INJECT_ASM_REG | 64 | , INJECT_ASM_REG |
65 | 65 | ||
66 | #ifdef __i386__ | ||
67 | |||
68 | #define RSEQ_INJECT_ASM(n) \ | 66 | #define RSEQ_INJECT_ASM(n) \ |
69 | "mov asm_loop_cnt_" #n ", %%" INJECT_ASM_REG "\n\t" \ | 67 | "mov asm_loop_cnt_" #n ", %%" INJECT_ASM_REG "\n\t" \ |
70 | "test %%" INJECT_ASM_REG ",%%" INJECT_ASM_REG "\n\t" \ | 68 | "test %%" INJECT_ASM_REG ",%%" INJECT_ASM_REG "\n\t" \ |
@@ -76,9 +74,16 @@ unsigned int yield_mod_cnt, nr_abort; | |||
76 | 74 | ||
77 | #elif defined(__x86_64__) | 75 | #elif defined(__x86_64__) |
78 | 76 | ||
77 | #define INJECT_ASM_REG_P "rax" | ||
78 | #define INJECT_ASM_REG "eax" | ||
79 | |||
80 | #define RSEQ_INJECT_CLOBBER \ | ||
81 | , INJECT_ASM_REG_P \ | ||
82 | , INJECT_ASM_REG | ||
83 | |||
79 | #define RSEQ_INJECT_ASM(n) \ | 84 | #define RSEQ_INJECT_ASM(n) \ |
80 | "lea asm_loop_cnt_" #n "(%%rip), %%" INJECT_ASM_REG "\n\t" \ | 85 | "lea asm_loop_cnt_" #n "(%%rip), %%" INJECT_ASM_REG_P "\n\t" \ |
81 | "mov (%%" INJECT_ASM_REG "), %%" INJECT_ASM_REG "\n\t" \ | 86 | "mov (%%" INJECT_ASM_REG_P "), %%" INJECT_ASM_REG "\n\t" \ |
82 | "test %%" INJECT_ASM_REG ",%%" INJECT_ASM_REG "\n\t" \ | 87 | "test %%" INJECT_ASM_REG ",%%" INJECT_ASM_REG "\n\t" \ |
83 | "jz 333f\n\t" \ | 88 | "jz 333f\n\t" \ |
84 | "222:\n\t" \ | 89 | "222:\n\t" \ |
@@ -86,10 +91,6 @@ unsigned int yield_mod_cnt, nr_abort; | |||
86 | "jnz 222b\n\t" \ | 91 | "jnz 222b\n\t" \ |
87 | "333:\n\t" | 92 | "333:\n\t" |
88 | 93 | ||
89 | #else | ||
90 | #error "Unsupported architecture" | ||
91 | #endif | ||
92 | |||
93 | #elif defined(__s390__) | 94 | #elif defined(__s390__) |
94 | 95 | ||
95 | #define RSEQ_INJECT_INPUT \ | 96 | #define RSEQ_INJECT_INPUT \ |