diff options
96 files changed, 879 insertions, 526 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 358eb0105e00..1de6afa8ee51 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -1186,7 +1186,7 @@ M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | |||
| 1186 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 1186 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 1187 | S: Maintained | 1187 | S: Maintained |
| 1188 | F: arch/arm/mach-mvebu/ | 1188 | F: arch/arm/mach-mvebu/ |
| 1189 | F: drivers/rtc/armada38x-rtc | 1189 | F: drivers/rtc/rtc-armada38x.c |
| 1190 | 1190 | ||
| 1191 | ARM/Marvell Berlin SoC support | 1191 | ARM/Marvell Berlin SoC support |
| 1192 | M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 1192 | M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> |
| @@ -1362,6 +1362,7 @@ F: drivers/i2c/busses/i2c-rk3x.c | |||
| 1362 | F: drivers/*/*rockchip* | 1362 | F: drivers/*/*rockchip* |
| 1363 | F: drivers/*/*/*rockchip* | 1363 | F: drivers/*/*/*rockchip* |
| 1364 | F: sound/soc/rockchip/ | 1364 | F: sound/soc/rockchip/ |
| 1365 | N: rockchip | ||
| 1365 | 1366 | ||
| 1366 | ARM/SAMSUNG EXYNOS ARM ARCHITECTURES | 1367 | ARM/SAMSUNG EXYNOS ARM ARCHITECTURES |
| 1367 | M: Kukjin Kim <kgene@kernel.org> | 1368 | M: Kukjin Kim <kgene@kernel.org> |
| @@ -1675,8 +1676,8 @@ F: drivers/misc/eeprom/at24.c | |||
| 1675 | F: include/linux/platform_data/at24.h | 1676 | F: include/linux/platform_data/at24.h |
| 1676 | 1677 | ||
| 1677 | ATA OVER ETHERNET (AOE) DRIVER | 1678 | ATA OVER ETHERNET (AOE) DRIVER |
| 1678 | M: "Ed L. Cashin" <ecashin@coraid.com> | 1679 | M: "Ed L. Cashin" <ed.cashin@acm.org> |
| 1679 | W: http://support.coraid.com/support/linux | 1680 | W: http://www.openaoe.org/ |
| 1680 | S: Supported | 1681 | S: Supported |
| 1681 | F: Documentation/aoe/ | 1682 | F: Documentation/aoe/ |
| 1682 | F: drivers/block/aoe/ | 1683 | F: drivers/block/aoe/ |
| @@ -3252,6 +3253,13 @@ S: Maintained | |||
| 3252 | F: Documentation/hwmon/dme1737 | 3253 | F: Documentation/hwmon/dme1737 |
| 3253 | F: drivers/hwmon/dme1737.c | 3254 | F: drivers/hwmon/dme1737.c |
| 3254 | 3255 | ||
| 3256 | DMI/SMBIOS SUPPORT | ||
| 3257 | M: Jean Delvare <jdelvare@suse.de> | ||
| 3258 | S: Maintained | ||
| 3259 | F: drivers/firmware/dmi-id.c | ||
| 3260 | F: drivers/firmware/dmi_scan.c | ||
| 3261 | F: include/linux/dmi.h | ||
| 3262 | |||
| 3255 | DOCKING STATION DRIVER | 3263 | DOCKING STATION DRIVER |
| 3256 | M: Shaohua Li <shaohua.li@intel.com> | 3264 | M: Shaohua Li <shaohua.li@intel.com> |
| 3257 | L: linux-acpi@vger.kernel.org | 3265 | L: linux-acpi@vger.kernel.org |
| @@ -1,7 +1,7 @@ | |||
| 1 | VERSION = 4 | 1 | VERSION = 4 |
| 2 | PATCHLEVEL = 0 | 2 | PATCHLEVEL = 0 |
| 3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
| 4 | EXTRAVERSION = -rc5 | 4 | EXTRAVERSION = -rc6 |
| 5 | NAME = Hurr durr I'ma sheep | 5 | NAME = Hurr durr I'ma sheep |
| 6 | 6 | ||
| 7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arc/kernel/signal.c b/arch/arc/kernel/signal.c index 114234e83caa..edda76fae83f 100644 --- a/arch/arc/kernel/signal.c +++ b/arch/arc/kernel/signal.c | |||
| @@ -67,7 +67,7 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs, | |||
| 67 | sigset_t *set) | 67 | sigset_t *set) |
| 68 | { | 68 | { |
| 69 | int err; | 69 | int err; |
| 70 | err = __copy_to_user(&(sf->uc.uc_mcontext.regs), regs, | 70 | err = __copy_to_user(&(sf->uc.uc_mcontext.regs.scratch), regs, |
| 71 | sizeof(sf->uc.uc_mcontext.regs.scratch)); | 71 | sizeof(sf->uc.uc_mcontext.regs.scratch)); |
| 72 | err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t)); | 72 | err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t)); |
| 73 | 73 | ||
| @@ -83,7 +83,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf) | |||
| 83 | if (!err) | 83 | if (!err) |
| 84 | set_current_blocked(&set); | 84 | set_current_blocked(&set); |
| 85 | 85 | ||
| 86 | err |= __copy_from_user(regs, &(sf->uc.uc_mcontext.regs), | 86 | err |= __copy_from_user(regs, &(sf->uc.uc_mcontext.regs.scratch), |
| 87 | sizeof(sf->uc.uc_mcontext.regs.scratch)); | 87 | sizeof(sf->uc.uc_mcontext.regs.scratch)); |
| 88 | 88 | ||
| 89 | return err; | 89 | return err; |
| @@ -131,6 +131,15 @@ SYSCALL_DEFINE0(rt_sigreturn) | |||
| 131 | /* Don't restart from sigreturn */ | 131 | /* Don't restart from sigreturn */ |
| 132 | syscall_wont_restart(regs); | 132 | syscall_wont_restart(regs); |
| 133 | 133 | ||
| 134 | /* | ||
| 135 | * Ensure that sigreturn always returns to user mode (in case the | ||
| 136 | * regs saved on user stack got fudged between save and sigreturn) | ||
| 137 | * Otherwise it is easy to panic the kernel with a custom | ||
| 138 | * signal handler and/or restorer which clobberes the status32/ret | ||
| 139 | * to return to a bogus location in kernel mode. | ||
| 140 | */ | ||
| 141 | regs->status32 |= STATUS_U_MASK; | ||
| 142 | |||
| 134 | return regs->r0; | 143 | return regs->r0; |
| 135 | 144 | ||
| 136 | badframe: | 145 | badframe: |
| @@ -229,8 +238,11 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) | |||
| 229 | 238 | ||
| 230 | /* | 239 | /* |
| 231 | * handler returns using sigreturn stub provided already by userpsace | 240 | * handler returns using sigreturn stub provided already by userpsace |
| 241 | * If not, nuke the process right away | ||
| 232 | */ | 242 | */ |
| 233 | BUG_ON(!(ksig->ka.sa.sa_flags & SA_RESTORER)); | 243 | if(!(ksig->ka.sa.sa_flags & SA_RESTORER)) |
| 244 | return 1; | ||
| 245 | |||
| 234 | regs->blink = (unsigned long)ksig->ka.sa.sa_restorer; | 246 | regs->blink = (unsigned long)ksig->ka.sa.sa_restorer; |
| 235 | 247 | ||
| 236 | /* User Stack for signal handler will be above the frame just carved */ | 248 | /* User Stack for signal handler will be above the frame just carved */ |
| @@ -296,12 +308,12 @@ static void | |||
| 296 | handle_signal(struct ksignal *ksig, struct pt_regs *regs) | 308 | handle_signal(struct ksignal *ksig, struct pt_regs *regs) |
| 297 | { | 309 | { |
| 298 | sigset_t *oldset = sigmask_to_save(); | 310 | sigset_t *oldset = sigmask_to_save(); |
| 299 | int ret; | 311 | int failed; |
| 300 | 312 | ||
| 301 | /* Set up the stack frame */ | 313 | /* Set up the stack frame */ |
| 302 | ret = setup_rt_frame(ksig, oldset, regs); | 314 | failed = setup_rt_frame(ksig, oldset, regs); |
| 303 | 315 | ||
| 304 | signal_setup_done(ret, ksig, 0); | 316 | signal_setup_done(failed, ksig, 0); |
| 305 | } | 317 | } |
| 306 | 318 | ||
| 307 | void do_signal(struct pt_regs *regs) | 319 | void do_signal(struct pt_regs *regs) |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9f1f09a2bc9b..cf4c0c99aa25 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -619,6 +619,7 @@ config ARCH_PXA | |||
| 619 | select GENERIC_CLOCKEVENTS | 619 | select GENERIC_CLOCKEVENTS |
| 620 | select GPIO_PXA | 620 | select GPIO_PXA |
| 621 | select HAVE_IDE | 621 | select HAVE_IDE |
| 622 | select IRQ_DOMAIN | ||
| 622 | select MULTI_IRQ_HANDLER | 623 | select MULTI_IRQ_HANDLER |
| 623 | select PLAT_PXA | 624 | select PLAT_PXA |
| 624 | select SPARSE_IRQ | 625 | select SPARSE_IRQ |
diff --git a/arch/arm/boot/dts/dm8168-evm.dts b/arch/arm/boot/dts/dm8168-evm.dts index d3a29c1b8417..afe678f6d2e9 100644 --- a/arch/arm/boot/dts/dm8168-evm.dts +++ b/arch/arm/boot/dts/dm8168-evm.dts | |||
| @@ -36,6 +36,20 @@ | |||
| 36 | >; | 36 | >; |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | mmc_pins: pinmux_mmc_pins { | ||
| 40 | pinctrl-single,pins = < | ||
| 41 | DM816X_IOPAD(0x0a70, MUX_MODE0) /* SD_POW */ | ||
| 42 | DM816X_IOPAD(0x0a74, MUX_MODE0) /* SD_CLK */ | ||
| 43 | DM816X_IOPAD(0x0a78, MUX_MODE0) /* SD_CMD */ | ||
| 44 | DM816X_IOPAD(0x0a7C, MUX_MODE0) /* SD_DAT0 */ | ||
| 45 | DM816X_IOPAD(0x0a80, MUX_MODE0) /* SD_DAT1 */ | ||
| 46 | DM816X_IOPAD(0x0a84, MUX_MODE0) /* SD_DAT2 */ | ||
| 47 | DM816X_IOPAD(0x0a88, MUX_MODE0) /* SD_DAT2 */ | ||
| 48 | DM816X_IOPAD(0x0a8c, MUX_MODE2) /* GP1[7] */ | ||
| 49 | DM816X_IOPAD(0x0a90, MUX_MODE2) /* GP1[8] */ | ||
| 50 | >; | ||
| 51 | }; | ||
| 52 | |||
| 39 | usb0_pins: pinmux_usb0_pins { | 53 | usb0_pins: pinmux_usb0_pins { |
| 40 | pinctrl-single,pins = < | 54 | pinctrl-single,pins = < |
| 41 | DM816X_IOPAD(0x0d00, MUX_MODE0) /* USB0_DRVVBUS */ | 55 | DM816X_IOPAD(0x0d00, MUX_MODE0) /* USB0_DRVVBUS */ |
| @@ -137,7 +151,12 @@ | |||
| 137 | }; | 151 | }; |
| 138 | 152 | ||
| 139 | &mmc1 { | 153 | &mmc1 { |
| 154 | pinctrl-names = "default"; | ||
| 155 | pinctrl-0 = <&mmc_pins>; | ||
| 140 | vmmc-supply = <&vmmcsd_fixed>; | 156 | vmmc-supply = <&vmmcsd_fixed>; |
| 157 | bus-width = <4>; | ||
| 158 | cd-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; | ||
| 159 | wp-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; | ||
| 141 | }; | 160 | }; |
| 142 | 161 | ||
| 143 | /* At least dm8168-evm rev c won't support multipoint, later may */ | 162 | /* At least dm8168-evm rev c won't support multipoint, later may */ |
diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi index 3c97b5f2addc..f35715bc6992 100644 --- a/arch/arm/boot/dts/dm816x.dtsi +++ b/arch/arm/boot/dts/dm816x.dtsi | |||
| @@ -150,17 +150,27 @@ | |||
| 150 | }; | 150 | }; |
| 151 | 151 | ||
| 152 | gpio1: gpio@48032000 { | 152 | gpio1: gpio@48032000 { |
| 153 | compatible = "ti,omap3-gpio"; | 153 | compatible = "ti,omap4-gpio"; |
| 154 | ti,hwmods = "gpio1"; | 154 | ti,hwmods = "gpio1"; |
| 155 | ti,gpio-always-on; | ||
| 155 | reg = <0x48032000 0x1000>; | 156 | reg = <0x48032000 0x1000>; |
| 156 | interrupts = <97>; | 157 | interrupts = <96>; |
| 158 | gpio-controller; | ||
| 159 | #gpio-cells = <2>; | ||
| 160 | interrupt-controller; | ||
| 161 | #interrupt-cells = <2>; | ||
| 157 | }; | 162 | }; |
| 158 | 163 | ||
| 159 | gpio2: gpio@4804c000 { | 164 | gpio2: gpio@4804c000 { |
| 160 | compatible = "ti,omap3-gpio"; | 165 | compatible = "ti,omap4-gpio"; |
| 161 | ti,hwmods = "gpio2"; | 166 | ti,hwmods = "gpio2"; |
| 167 | ti,gpio-always-on; | ||
| 162 | reg = <0x4804c000 0x1000>; | 168 | reg = <0x4804c000 0x1000>; |
| 163 | interrupts = <99>; | 169 | interrupts = <98>; |
| 170 | gpio-controller; | ||
| 171 | #gpio-cells = <2>; | ||
| 172 | interrupt-controller; | ||
| 173 | #interrupt-cells = <2>; | ||
| 164 | }; | 174 | }; |
| 165 | 175 | ||
| 166 | gpmc: gpmc@50000000 { | 176 | gpmc: gpmc@50000000 { |
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi index 127608d79033..c4659a979c41 100644 --- a/arch/arm/boot/dts/dra7.dtsi +++ b/arch/arm/boot/dts/dra7.dtsi | |||
| @@ -1111,7 +1111,6 @@ | |||
| 1111 | "wkupclk", "refclk", | 1111 | "wkupclk", "refclk", |
| 1112 | "div-clk", "phy-div"; | 1112 | "div-clk", "phy-div"; |
| 1113 | #phy-cells = <0>; | 1113 | #phy-cells = <0>; |
| 1114 | ti,hwmods = "pcie1-phy"; | ||
| 1115 | }; | 1114 | }; |
| 1116 | 1115 | ||
| 1117 | pcie2_phy: pciephy@4a095000 { | 1116 | pcie2_phy: pciephy@4a095000 { |
| @@ -1130,7 +1129,6 @@ | |||
| 1130 | "wkupclk", "refclk", | 1129 | "wkupclk", "refclk", |
| 1131 | "div-clk", "phy-div"; | 1130 | "div-clk", "phy-div"; |
| 1132 | #phy-cells = <0>; | 1131 | #phy-cells = <0>; |
| 1133 | ti,hwmods = "pcie2-phy"; | ||
| 1134 | status = "disabled"; | 1132 | status = "disabled"; |
| 1135 | }; | 1133 | }; |
| 1136 | }; | 1134 | }; |
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index f4f78c40b564..3fdc84fddb70 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi | |||
| @@ -92,6 +92,8 @@ | |||
| 92 | ti,hwmods = "aes"; | 92 | ti,hwmods = "aes"; |
| 93 | reg = <0x480c5000 0x50>; | 93 | reg = <0x480c5000 0x50>; |
| 94 | interrupts = <0>; | 94 | interrupts = <0>; |
| 95 | dmas = <&sdma 65 &sdma 66>; | ||
| 96 | dma-names = "tx", "rx"; | ||
| 95 | }; | 97 | }; |
| 96 | 98 | ||
| 97 | prm: prm@48306000 { | 99 | prm: prm@48306000 { |
| @@ -550,6 +552,8 @@ | |||
| 550 | ti,hwmods = "sham"; | 552 | ti,hwmods = "sham"; |
| 551 | reg = <0x480c3000 0x64>; | 553 | reg = <0x480c3000 0x64>; |
| 552 | interrupts = <49>; | 554 | interrupts = <49>; |
| 555 | dmas = <&sdma 69>; | ||
| 556 | dma-names = "rx"; | ||
| 553 | }; | 557 | }; |
| 554 | 558 | ||
| 555 | smartreflex_core: smartreflex@480cb000 { | 559 | smartreflex_core: smartreflex@480cb000 { |
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index d771f687a13b..eccc78d3220b 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi | |||
| @@ -411,6 +411,7 @@ | |||
| 411 | "mac_clk_rx", "mac_clk_tx", | 411 | "mac_clk_rx", "mac_clk_tx", |
| 412 | "clk_mac_ref", "clk_mac_refout", | 412 | "clk_mac_ref", "clk_mac_refout", |
| 413 | "aclk_mac", "pclk_mac"; | 413 | "aclk_mac", "pclk_mac"; |
| 414 | status = "disabled"; | ||
| 414 | }; | 415 | }; |
| 415 | 416 | ||
| 416 | usb_host0_ehci: usb@ff500000 { | 417 | usb_host0_ehci: usb@ff500000 { |
diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi index 9d8760956752..d9176e606173 100644 --- a/arch/arm/boot/dts/socfpga.dtsi +++ b/arch/arm/boot/dts/socfpga.dtsi | |||
| @@ -660,7 +660,7 @@ | |||
| 660 | #address-cells = <1>; | 660 | #address-cells = <1>; |
| 661 | #size-cells = <0>; | 661 | #size-cells = <0>; |
| 662 | reg = <0xfff01000 0x1000>; | 662 | reg = <0xfff01000 0x1000>; |
| 663 | interrupts = <0 156 4>; | 663 | interrupts = <0 155 4>; |
| 664 | num-cs = <4>; | 664 | num-cs = <4>; |
| 665 | clocks = <&spi_m_clk>; | 665 | clocks = <&spi_m_clk>; |
| 666 | status = "disabled"; | 666 | status = "disabled"; |
diff --git a/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts index ab7891c43231..75742f8f96f3 100644 --- a/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts +++ b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts | |||
| @@ -56,6 +56,22 @@ | |||
| 56 | model = "Olimex A10-OLinuXino-LIME"; | 56 | model = "Olimex A10-OLinuXino-LIME"; |
| 57 | compatible = "olimex,a10-olinuxino-lime", "allwinner,sun4i-a10"; | 57 | compatible = "olimex,a10-olinuxino-lime", "allwinner,sun4i-a10"; |
| 58 | 58 | ||
| 59 | cpus { | ||
| 60 | cpu0: cpu@0 { | ||
| 61 | /* | ||
| 62 | * The A10-Lime is known to be unstable | ||
| 63 | * when running at 1008 MHz | ||
| 64 | */ | ||
| 65 | operating-points = < | ||
| 66 | /* kHz uV */ | ||
| 67 | 912000 1350000 | ||
| 68 | 864000 1300000 | ||
| 69 | 624000 1250000 | ||
| 70 | >; | ||
| 71 | cooling-max-level = <2>; | ||
| 72 | }; | ||
| 73 | }; | ||
| 74 | |||
| 59 | soc@01c00000 { | 75 | soc@01c00000 { |
| 60 | emac: ethernet@01c0b000 { | 76 | emac: ethernet@01c0b000 { |
| 61 | pinctrl-names = "default"; | 77 | pinctrl-names = "default"; |
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi index 5c2925831f20..eebb7853e00b 100644 --- a/arch/arm/boot/dts/sun4i-a10.dtsi +++ b/arch/arm/boot/dts/sun4i-a10.dtsi | |||
| @@ -75,7 +75,6 @@ | |||
| 75 | clock-latency = <244144>; /* 8 32k periods */ | 75 | clock-latency = <244144>; /* 8 32k periods */ |
| 76 | operating-points = < | 76 | operating-points = < |
| 77 | /* kHz uV */ | 77 | /* kHz uV */ |
| 78 | 1056000 1500000 | ||
| 79 | 1008000 1400000 | 78 | 1008000 1400000 |
| 80 | 912000 1350000 | 79 | 912000 1350000 |
| 81 | 864000 1300000 | 80 | 864000 1300000 |
| @@ -83,7 +82,7 @@ | |||
| 83 | >; | 82 | >; |
| 84 | #cooling-cells = <2>; | 83 | #cooling-cells = <2>; |
| 85 | cooling-min-level = <0>; | 84 | cooling-min-level = <0>; |
| 86 | cooling-max-level = <4>; | 85 | cooling-max-level = <3>; |
| 87 | }; | 86 | }; |
| 88 | }; | 87 | }; |
| 89 | 88 | ||
diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi index f8818f1edbbe..883cb4873688 100644 --- a/arch/arm/boot/dts/sun5i-a13.dtsi +++ b/arch/arm/boot/dts/sun5i-a13.dtsi | |||
| @@ -47,7 +47,6 @@ | |||
| 47 | clock-latency = <244144>; /* 8 32k periods */ | 47 | clock-latency = <244144>; /* 8 32k periods */ |
| 48 | operating-points = < | 48 | operating-points = < |
| 49 | /* kHz uV */ | 49 | /* kHz uV */ |
| 50 | 1104000 1500000 | ||
| 51 | 1008000 1400000 | 50 | 1008000 1400000 |
| 52 | 912000 1350000 | 51 | 912000 1350000 |
| 53 | 864000 1300000 | 52 | 864000 1300000 |
| @@ -57,7 +56,7 @@ | |||
| 57 | >; | 56 | >; |
| 58 | #cooling-cells = <2>; | 57 | #cooling-cells = <2>; |
| 59 | cooling-min-level = <0>; | 58 | cooling-min-level = <0>; |
| 60 | cooling-max-level = <6>; | 59 | cooling-max-level = <5>; |
| 61 | }; | 60 | }; |
| 62 | }; | 61 | }; |
| 63 | 62 | ||
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi index 3a8530b79f1c..fdd181792b4b 100644 --- a/arch/arm/boot/dts/sun7i-a20.dtsi +++ b/arch/arm/boot/dts/sun7i-a20.dtsi | |||
| @@ -105,7 +105,6 @@ | |||
| 105 | clock-latency = <244144>; /* 8 32k periods */ | 105 | clock-latency = <244144>; /* 8 32k periods */ |
| 106 | operating-points = < | 106 | operating-points = < |
| 107 | /* kHz uV */ | 107 | /* kHz uV */ |
| 108 | 1008000 1450000 | ||
| 109 | 960000 1400000 | 108 | 960000 1400000 |
| 110 | 912000 1400000 | 109 | 912000 1400000 |
| 111 | 864000 1300000 | 110 | 864000 1300000 |
| @@ -116,7 +115,7 @@ | |||
| 116 | >; | 115 | >; |
| 117 | #cooling-cells = <2>; | 116 | #cooling-cells = <2>; |
| 118 | cooling-min-level = <0>; | 117 | cooling-min-level = <0>; |
| 119 | cooling-max-level = <7>; | 118 | cooling-max-level = <6>; |
| 120 | }; | 119 | }; |
| 121 | 120 | ||
| 122 | cpu@1 { | 121 | cpu@1 { |
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 2a2f4d56e4c8..25f1beea453e 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
| @@ -720,6 +720,8 @@ static const char * __init omap_get_family(void) | |||
| 720 | return kasprintf(GFP_KERNEL, "OMAP4"); | 720 | return kasprintf(GFP_KERNEL, "OMAP4"); |
| 721 | else if (soc_is_omap54xx()) | 721 | else if (soc_is_omap54xx()) |
| 722 | return kasprintf(GFP_KERNEL, "OMAP5"); | 722 | return kasprintf(GFP_KERNEL, "OMAP5"); |
| 723 | else if (soc_is_am33xx() || soc_is_am335x()) | ||
| 724 | return kasprintf(GFP_KERNEL, "AM33xx"); | ||
| 723 | else if (soc_is_am43xx()) | 725 | else if (soc_is_am43xx()) |
| 724 | return kasprintf(GFP_KERNEL, "AM43xx"); | 726 | return kasprintf(GFP_KERNEL, "AM43xx"); |
| 725 | else if (soc_is_dra7xx()) | 727 | else if (soc_is_dra7xx()) |
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index 0eecd83c624e..89a7c06570d3 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | * it under the terms of the GNU General Public License version 2 as | 11 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
| 13 | */ | 13 | */ |
| 14 | #include <linux/bitops.h> | ||
| 14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 15 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| 16 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
| @@ -40,7 +41,6 @@ | |||
| 40 | #define ICHP_VAL_IRQ (1 << 31) | 41 | #define ICHP_VAL_IRQ (1 << 31) |
| 41 | #define ICHP_IRQ(i) (((i) >> 16) & 0x7fff) | 42 | #define ICHP_IRQ(i) (((i) >> 16) & 0x7fff) |
| 42 | #define IPR_VALID (1 << 31) | 43 | #define IPR_VALID (1 << 31) |
| 43 | #define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f) | ||
| 44 | 44 | ||
| 45 | #define MAX_INTERNAL_IRQS 128 | 45 | #define MAX_INTERNAL_IRQS 128 |
| 46 | 46 | ||
| @@ -51,6 +51,7 @@ | |||
| 51 | static void __iomem *pxa_irq_base; | 51 | static void __iomem *pxa_irq_base; |
| 52 | static int pxa_internal_irq_nr; | 52 | static int pxa_internal_irq_nr; |
| 53 | static bool cpu_has_ipr; | 53 | static bool cpu_has_ipr; |
| 54 | static struct irq_domain *pxa_irq_domain; | ||
| 54 | 55 | ||
| 55 | static inline void __iomem *irq_base(int i) | 56 | static inline void __iomem *irq_base(int i) |
| 56 | { | 57 | { |
| @@ -66,18 +67,20 @@ static inline void __iomem *irq_base(int i) | |||
| 66 | void pxa_mask_irq(struct irq_data *d) | 67 | void pxa_mask_irq(struct irq_data *d) |
| 67 | { | 68 | { |
| 68 | void __iomem *base = irq_data_get_irq_chip_data(d); | 69 | void __iomem *base = irq_data_get_irq_chip_data(d); |
| 70 | irq_hw_number_t irq = irqd_to_hwirq(d); | ||
| 69 | uint32_t icmr = __raw_readl(base + ICMR); | 71 | uint32_t icmr = __raw_readl(base + ICMR); |
| 70 | 72 | ||
| 71 | icmr &= ~(1 << IRQ_BIT(d->irq)); | 73 | icmr &= ~BIT(irq & 0x1f); |
| 72 | __raw_writel(icmr, base + ICMR); | 74 | __raw_writel(icmr, base + ICMR); |
| 73 | } | 75 | } |
| 74 | 76 | ||
| 75 | void pxa_unmask_irq(struct irq_data *d) | 77 | void pxa_unmask_irq(struct irq_data *d) |
| 76 | { | 78 | { |
| 77 | void __iomem *base = irq_data_get_irq_chip_data(d); | 79 | void __iomem *base = irq_data_get_irq_chip_data(d); |
| 80 | irq_hw_number_t irq = irqd_to_hwirq(d); | ||
| 78 | uint32_t icmr = __raw_readl(base + ICMR); | 81 | uint32_t icmr = __raw_readl(base + ICMR); |
| 79 | 82 | ||
| 80 | icmr |= 1 << IRQ_BIT(d->irq); | 83 | icmr |= BIT(irq & 0x1f); |
| 81 | __raw_writel(icmr, base + ICMR); | 84 | __raw_writel(icmr, base + ICMR); |
| 82 | } | 85 | } |
| 83 | 86 | ||
| @@ -118,40 +121,63 @@ asmlinkage void __exception_irq_entry ichp_handle_irq(struct pt_regs *regs) | |||
| 118 | } while (1); | 121 | } while (1); |
| 119 | } | 122 | } |
| 120 | 123 | ||
| 121 | void __init pxa_init_irq(int irq_nr, int (*fn)(struct irq_data *, unsigned int)) | 124 | static int pxa_irq_map(struct irq_domain *h, unsigned int virq, |
| 125 | irq_hw_number_t hw) | ||
| 122 | { | 126 | { |
| 123 | int irq, i, n; | 127 | void __iomem *base = irq_base(hw / 32); |
| 124 | 128 | ||
| 125 | BUG_ON(irq_nr > MAX_INTERNAL_IRQS); | 129 | /* initialize interrupt priority */ |
| 130 | if (cpu_has_ipr) | ||
| 131 | __raw_writel(hw | IPR_VALID, pxa_irq_base + IPR(hw)); | ||
| 132 | |||
| 133 | irq_set_chip_and_handler(virq, &pxa_internal_irq_chip, | ||
| 134 | handle_level_irq); | ||
| 135 | irq_set_chip_data(virq, base); | ||
| 136 | set_irq_flags(virq, IRQF_VALID); | ||
| 137 | |||
| 138 | return 0; | ||
| 139 | } | ||
| 140 | |||
| 141 | static struct irq_domain_ops pxa_irq_ops = { | ||
| 142 | .map = pxa_irq_map, | ||
| 143 | .xlate = irq_domain_xlate_onecell, | ||
| 144 | }; | ||
| 145 | |||
| 146 | static __init void | ||
| 147 | pxa_init_irq_common(struct device_node *node, int irq_nr, | ||
| 148 | int (*fn)(struct irq_data *, unsigned int)) | ||
| 149 | { | ||
| 150 | int n; | ||
| 126 | 151 | ||
| 127 | pxa_internal_irq_nr = irq_nr; | 152 | pxa_internal_irq_nr = irq_nr; |
| 128 | cpu_has_ipr = !cpu_is_pxa25x(); | 153 | pxa_irq_domain = irq_domain_add_legacy(node, irq_nr, |
| 129 | pxa_irq_base = io_p2v(0x40d00000); | 154 | PXA_IRQ(0), 0, |
| 155 | &pxa_irq_ops, NULL); | ||
| 156 | if (!pxa_irq_domain) | ||
| 157 | panic("Unable to add PXA IRQ domain\n"); | ||
| 158 | irq_set_default_host(pxa_irq_domain); | ||
| 130 | 159 | ||
| 131 | for (n = 0; n < irq_nr; n += 32) { | 160 | for (n = 0; n < irq_nr; n += 32) { |
| 132 | void __iomem *base = irq_base(n >> 5); | 161 | void __iomem *base = irq_base(n >> 5); |
| 133 | 162 | ||
| 134 | __raw_writel(0, base + ICMR); /* disable all IRQs */ | 163 | __raw_writel(0, base + ICMR); /* disable all IRQs */ |
| 135 | __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */ | 164 | __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */ |
| 136 | for (i = n; (i < (n + 32)) && (i < irq_nr); i++) { | ||
| 137 | /* initialize interrupt priority */ | ||
| 138 | if (cpu_has_ipr) | ||
| 139 | __raw_writel(i | IPR_VALID, pxa_irq_base + IPR(i)); | ||
| 140 | |||
| 141 | irq = PXA_IRQ(i); | ||
| 142 | irq_set_chip_and_handler(irq, &pxa_internal_irq_chip, | ||
| 143 | handle_level_irq); | ||
| 144 | irq_set_chip_data(irq, base); | ||
| 145 | set_irq_flags(irq, IRQF_VALID); | ||
| 146 | } | ||
| 147 | } | 165 | } |
| 148 | |||
| 149 | /* only unmasked interrupts kick us out of idle */ | 166 | /* only unmasked interrupts kick us out of idle */ |
| 150 | __raw_writel(1, irq_base(0) + ICCR); | 167 | __raw_writel(1, irq_base(0) + ICCR); |
| 151 | 168 | ||
| 152 | pxa_internal_irq_chip.irq_set_wake = fn; | 169 | pxa_internal_irq_chip.irq_set_wake = fn; |
| 153 | } | 170 | } |
| 154 | 171 | ||
| 172 | void __init pxa_init_irq(int irq_nr, int (*fn)(struct irq_data *, unsigned int)) | ||
| 173 | { | ||
| 174 | BUG_ON(irq_nr > MAX_INTERNAL_IRQS); | ||
| 175 | |||
| 176 | pxa_irq_base = io_p2v(0x40d00000); | ||
| 177 | cpu_has_ipr = !cpu_is_pxa25x(); | ||
| 178 | pxa_init_irq_common(NULL, irq_nr, fn); | ||
| 179 | } | ||
| 180 | |||
| 155 | #ifdef CONFIG_PM | 181 | #ifdef CONFIG_PM |
| 156 | static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32]; | 182 | static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32]; |
| 157 | static unsigned long saved_ipr[MAX_INTERNAL_IRQS]; | 183 | static unsigned long saved_ipr[MAX_INTERNAL_IRQS]; |
| @@ -203,30 +229,6 @@ struct syscore_ops pxa_irq_syscore_ops = { | |||
| 203 | }; | 229 | }; |
| 204 | 230 | ||
| 205 | #ifdef CONFIG_OF | 231 | #ifdef CONFIG_OF |
| 206 | static struct irq_domain *pxa_irq_domain; | ||
| 207 | |||
| 208 | static int pxa_irq_map(struct irq_domain *h, unsigned int virq, | ||
| 209 | irq_hw_number_t hw) | ||
| 210 | { | ||
| 211 | void __iomem *base = irq_base(hw / 32); | ||
| 212 | |||
| 213 | /* initialize interrupt priority */ | ||
| 214 | if (cpu_has_ipr) | ||
| 215 | __raw_writel(hw | IPR_VALID, pxa_irq_base + IPR(hw)); | ||
| 216 | |||
| 217 | irq_set_chip_and_handler(hw, &pxa_internal_irq_chip, | ||
| 218 | handle_level_irq); | ||
| 219 | irq_set_chip_data(hw, base); | ||
| 220 | set_irq_flags(hw, IRQF_VALID); | ||
| 221 | |||
| 222 | return 0; | ||
| 223 | } | ||
| 224 | |||
| 225 | static struct irq_domain_ops pxa_irq_ops = { | ||
| 226 | .map = pxa_irq_map, | ||
| 227 | .xlate = irq_domain_xlate_onecell, | ||
| 228 | }; | ||
| 229 | |||
| 230 | static const struct of_device_id intc_ids[] __initconst = { | 232 | static const struct of_device_id intc_ids[] __initconst = { |
| 231 | { .compatible = "marvell,pxa-intc", }, | 233 | { .compatible = "marvell,pxa-intc", }, |
| 232 | {} | 234 | {} |
| @@ -236,7 +238,7 @@ void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int)) | |||
| 236 | { | 238 | { |
| 237 | struct device_node *node; | 239 | struct device_node *node; |
| 238 | struct resource res; | 240 | struct resource res; |
| 239 | int n, ret; | 241 | int ret; |
| 240 | 242 | ||
| 241 | node = of_find_matching_node(NULL, intc_ids); | 243 | node = of_find_matching_node(NULL, intc_ids); |
| 242 | if (!node) { | 244 | if (!node) { |
| @@ -267,23 +269,6 @@ void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int)) | |||
| 267 | return; | 269 | return; |
| 268 | } | 270 | } |
| 269 | 271 | ||
| 270 | pxa_irq_domain = irq_domain_add_legacy(node, pxa_internal_irq_nr, 0, 0, | 272 | pxa_init_irq_common(node, pxa_internal_irq_nr, fn); |
| 271 | &pxa_irq_ops, NULL); | ||
| 272 | if (!pxa_irq_domain) | ||
| 273 | panic("Unable to add PXA IRQ domain\n"); | ||
| 274 | |||
| 275 | irq_set_default_host(pxa_irq_domain); | ||
| 276 | |||
| 277 | for (n = 0; n < pxa_internal_irq_nr; n += 32) { | ||
| 278 | void __iomem *base = irq_base(n >> 5); | ||
| 279 | |||
| 280 | __raw_writel(0, base + ICMR); /* disable all IRQs */ | ||
| 281 | __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */ | ||
| 282 | } | ||
| 283 | |||
| 284 | /* only unmasked interrupts kick us out of idle */ | ||
| 285 | __raw_writel(1, irq_base(0) + ICCR); | ||
| 286 | |||
| 287 | pxa_internal_irq_chip.irq_set_wake = fn; | ||
| 288 | } | 273 | } |
| 289 | #endif /* CONFIG_OF */ | 274 | #endif /* CONFIG_OF */ |
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c index 205f9bf3821e..ac2ae5c71ab4 100644 --- a/arch/arm/mach-pxa/zeus.c +++ b/arch/arm/mach-pxa/zeus.c | |||
| @@ -412,7 +412,7 @@ static struct fixed_voltage_config can_regulator_pdata = { | |||
| 412 | }; | 412 | }; |
| 413 | 413 | ||
| 414 | static struct platform_device can_regulator_device = { | 414 | static struct platform_device can_regulator_device = { |
| 415 | .name = "reg-fixed-volage", | 415 | .name = "reg-fixed-voltage", |
| 416 | .id = 0, | 416 | .id = 0, |
| 417 | .dev = { | 417 | .dev = { |
| 418 | .platform_data = &can_regulator_pdata, | 418 | .platform_data = &can_regulator_pdata, |
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index a77604fbaf25..81502b90dd91 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig | |||
| @@ -1,10 +1,12 @@ | |||
| 1 | menuconfig ARCH_SUNXI | 1 | menuconfig ARCH_SUNXI |
| 2 | bool "Allwinner SoCs" if ARCH_MULTI_V7 | 2 | bool "Allwinner SoCs" if ARCH_MULTI_V7 |
| 3 | select ARCH_REQUIRE_GPIOLIB | 3 | select ARCH_REQUIRE_GPIOLIB |
| 4 | select ARCH_HAS_RESET_CONTROLLER | ||
| 4 | select CLKSRC_MMIO | 5 | select CLKSRC_MMIO |
| 5 | select GENERIC_IRQ_CHIP | 6 | select GENERIC_IRQ_CHIP |
| 6 | select PINCTRL | 7 | select PINCTRL |
| 7 | select SUN4I_TIMER | 8 | select SUN4I_TIMER |
| 9 | select RESET_CONTROLLER | ||
| 8 | 10 | ||
| 9 | if ARCH_SUNXI | 11 | if ARCH_SUNXI |
| 10 | 12 | ||
| @@ -20,10 +22,8 @@ config MACH_SUN5I | |||
| 20 | config MACH_SUN6I | 22 | config MACH_SUN6I |
| 21 | bool "Allwinner A31 (sun6i) SoCs support" | 23 | bool "Allwinner A31 (sun6i) SoCs support" |
| 22 | default ARCH_SUNXI | 24 | default ARCH_SUNXI |
| 23 | select ARCH_HAS_RESET_CONTROLLER | ||
| 24 | select ARM_GIC | 25 | select ARM_GIC |
| 25 | select MFD_SUN6I_PRCM | 26 | select MFD_SUN6I_PRCM |
| 26 | select RESET_CONTROLLER | ||
| 27 | select SUN5I_HSTIMER | 27 | select SUN5I_HSTIMER |
| 28 | 28 | ||
| 29 | config MACH_SUN7I | 29 | config MACH_SUN7I |
| @@ -37,16 +37,12 @@ config MACH_SUN7I | |||
| 37 | config MACH_SUN8I | 37 | config MACH_SUN8I |
| 38 | bool "Allwinner A23 (sun8i) SoCs support" | 38 | bool "Allwinner A23 (sun8i) SoCs support" |
| 39 | default ARCH_SUNXI | 39 | default ARCH_SUNXI |
| 40 | select ARCH_HAS_RESET_CONTROLLER | ||
| 41 | select ARM_GIC | 40 | select ARM_GIC |
| 42 | select MFD_SUN6I_PRCM | 41 | select MFD_SUN6I_PRCM |
| 43 | select RESET_CONTROLLER | ||
| 44 | 42 | ||
| 45 | config MACH_SUN9I | 43 | config MACH_SUN9I |
| 46 | bool "Allwinner (sun9i) SoCs support" | 44 | bool "Allwinner (sun9i) SoCs support" |
| 47 | default ARCH_SUNXI | 45 | default ARCH_SUNXI |
| 48 | select ARCH_HAS_RESET_CONTROLLER | ||
| 49 | select ARM_GIC | 46 | select ARM_GIC |
| 50 | select RESET_CONTROLLER | ||
| 51 | 47 | ||
| 52 | endif | 48 | endif |
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index db10169a08de..8ca94d379bc3 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c | |||
| @@ -799,6 +799,7 @@ static int omap_dm_timer_probe(struct platform_device *pdev) | |||
| 799 | struct device *dev = &pdev->dev; | 799 | struct device *dev = &pdev->dev; |
| 800 | const struct of_device_id *match; | 800 | const struct of_device_id *match; |
| 801 | const struct dmtimer_platform_data *pdata; | 801 | const struct dmtimer_platform_data *pdata; |
| 802 | int ret; | ||
| 802 | 803 | ||
| 803 | match = of_match_device(of_match_ptr(omap_timer_match), dev); | 804 | match = of_match_device(of_match_ptr(omap_timer_match), dev); |
| 804 | pdata = match ? match->data : dev->platform_data; | 805 | pdata = match ? match->data : dev->platform_data; |
| @@ -860,7 +861,12 @@ static int omap_dm_timer_probe(struct platform_device *pdev) | |||
| 860 | } | 861 | } |
| 861 | 862 | ||
| 862 | if (!timer->reserved) { | 863 | if (!timer->reserved) { |
| 863 | pm_runtime_get_sync(dev); | 864 | ret = pm_runtime_get_sync(dev); |
| 865 | if (ret < 0) { | ||
| 866 | dev_err(dev, "%s: pm_runtime_get_sync failed!\n", | ||
| 867 | __func__); | ||
| 868 | goto err_get_sync; | ||
| 869 | } | ||
| 864 | __omap_dm_timer_init_regs(timer); | 870 | __omap_dm_timer_init_regs(timer); |
| 865 | pm_runtime_put(dev); | 871 | pm_runtime_put(dev); |
| 866 | } | 872 | } |
| @@ -873,6 +879,11 @@ static int omap_dm_timer_probe(struct platform_device *pdev) | |||
| 873 | dev_dbg(dev, "Device Probed.\n"); | 879 | dev_dbg(dev, "Device Probed.\n"); |
| 874 | 880 | ||
| 875 | return 0; | 881 | return 0; |
| 882 | |||
| 883 | err_get_sync: | ||
| 884 | pm_runtime_put_noidle(dev); | ||
| 885 | pm_runtime_disable(dev); | ||
| 886 | return ret; | ||
| 876 | } | 887 | } |
| 877 | 888 | ||
| 878 | /** | 889 | /** |
| @@ -899,6 +910,8 @@ static int omap_dm_timer_remove(struct platform_device *pdev) | |||
| 899 | } | 910 | } |
| 900 | spin_unlock_irqrestore(&dm_timer_lock, flags); | 911 | spin_unlock_irqrestore(&dm_timer_lock, flags); |
| 901 | 912 | ||
| 913 | pm_runtime_disable(&pdev->dev); | ||
| 914 | |||
| 902 | return ret; | 915 | return ret; |
| 903 | } | 916 | } |
| 904 | 917 | ||
diff --git a/arch/arm64/boot/dts/arm/juno-clocks.dtsi b/arch/arm64/boot/dts/arm/juno-clocks.dtsi index ea2b5666a16f..c9b89efe0f56 100644 --- a/arch/arm64/boot/dts/arm/juno-clocks.dtsi +++ b/arch/arm64/boot/dts/arm/juno-clocks.dtsi | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | /* SoC fixed clocks */ | 10 | /* SoC fixed clocks */ |
| 11 | soc_uartclk: refclk72738khz { | 11 | soc_uartclk: refclk7273800hz { |
| 12 | compatible = "fixed-clock"; | 12 | compatible = "fixed-clock"; |
| 13 | #clock-cells = <0>; | 13 | #clock-cells = <0>; |
| 14 | clock-frequency = <7273800>; | 14 | clock-frequency = <7273800>; |
diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpxchg.h index cb9593079f29..d8c25b7b18fb 100644 --- a/arch/arm64/include/asm/cmpxchg.h +++ b/arch/arm64/include/asm/cmpxchg.h | |||
| @@ -246,14 +246,30 @@ static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old, | |||
| 246 | __ret; \ | 246 | __ret; \ |
| 247 | }) | 247 | }) |
| 248 | 248 | ||
| 249 | #define this_cpu_cmpxchg_1(ptr, o, n) cmpxchg_local(raw_cpu_ptr(&(ptr)), o, n) | 249 | #define _protect_cmpxchg_local(pcp, o, n) \ |
| 250 | #define this_cpu_cmpxchg_2(ptr, o, n) cmpxchg_local(raw_cpu_ptr(&(ptr)), o, n) | 250 | ({ \ |
| 251 | #define this_cpu_cmpxchg_4(ptr, o, n) cmpxchg_local(raw_cpu_ptr(&(ptr)), o, n) | 251 | typeof(*raw_cpu_ptr(&(pcp))) __ret; \ |
| 252 | #define this_cpu_cmpxchg_8(ptr, o, n) cmpxchg_local(raw_cpu_ptr(&(ptr)), o, n) | 252 | preempt_disable(); \ |
| 253 | 253 | __ret = cmpxchg_local(raw_cpu_ptr(&(pcp)), o, n); \ | |
| 254 | #define this_cpu_cmpxchg_double_8(ptr1, ptr2, o1, o2, n1, n2) \ | 254 | preempt_enable(); \ |
| 255 | cmpxchg_double_local(raw_cpu_ptr(&(ptr1)), raw_cpu_ptr(&(ptr2)), \ | 255 | __ret; \ |
| 256 | o1, o2, n1, n2) | 256 | }) |
| 257 | |||
| 258 | #define this_cpu_cmpxchg_1(ptr, o, n) _protect_cmpxchg_local(ptr, o, n) | ||
| 259 | #define this_cpu_cmpxchg_2(ptr, o, n) _protect_cmpxchg_local(ptr, o, n) | ||
| 260 | #define this_cpu_cmpxchg_4(ptr, o, n) _protect_cmpxchg_local(ptr, o, n) | ||
| 261 | #define this_cpu_cmpxchg_8(ptr, o, n) _protect_cmpxchg_local(ptr, o, n) | ||
| 262 | |||
| 263 | #define this_cpu_cmpxchg_double_8(ptr1, ptr2, o1, o2, n1, n2) \ | ||
| 264 | ({ \ | ||
| 265 | int __ret; \ | ||
| 266 | preempt_disable(); \ | ||
| 267 | __ret = cmpxchg_double_local( raw_cpu_ptr(&(ptr1)), \ | ||
| 268 | raw_cpu_ptr(&(ptr2)), \ | ||
| 269 | o1, o2, n1, n2); \ | ||
| 270 | preempt_enable(); \ | ||
| 271 | __ret; \ | ||
| 272 | }) | ||
| 257 | 273 | ||
| 258 | #define cmpxchg64(ptr,o,n) cmpxchg((ptr),(o),(n)) | 274 | #define cmpxchg64(ptr,o,n) cmpxchg((ptr),(o),(n)) |
| 259 | #define cmpxchg64_local(ptr,o,n) cmpxchg_local((ptr),(o),(n)) | 275 | #define cmpxchg64_local(ptr,o,n) cmpxchg_local((ptr),(o),(n)) |
diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h index a9eee33dfa62..101a42bde728 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h | |||
| @@ -151,6 +151,15 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
| 151 | { | 151 | { |
| 152 | unsigned int cpu = smp_processor_id(); | 152 | unsigned int cpu = smp_processor_id(); |
| 153 | 153 | ||
| 154 | /* | ||
| 155 | * init_mm.pgd does not contain any user mappings and it is always | ||
| 156 | * active for kernel addresses in TTBR1. Just set the reserved TTBR0. | ||
| 157 | */ | ||
| 158 | if (next == &init_mm) { | ||
| 159 | cpu_set_reserved_ttbr0(); | ||
| 160 | return; | ||
| 161 | } | ||
| 162 | |||
| 154 | if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next) | 163 | if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next) |
| 155 | check_and_switch_context(next, tsk); | 164 | check_and_switch_context(next, tsk); |
| 156 | } | 165 | } |
diff --git a/arch/arm64/include/asm/percpu.h b/arch/arm64/include/asm/percpu.h index 09da25bc596f..4fde8c1df97f 100644 --- a/arch/arm64/include/asm/percpu.h +++ b/arch/arm64/include/asm/percpu.h | |||
| @@ -204,25 +204,47 @@ static inline unsigned long __percpu_xchg(void *ptr, unsigned long val, | |||
| 204 | return ret; | 204 | return ret; |
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | #define _percpu_read(pcp) \ | ||
| 208 | ({ \ | ||
| 209 | typeof(pcp) __retval; \ | ||
| 210 | preempt_disable(); \ | ||
| 211 | __retval = (typeof(pcp))__percpu_read(raw_cpu_ptr(&(pcp)), \ | ||
| 212 | sizeof(pcp)); \ | ||
| 213 | preempt_enable(); \ | ||
| 214 | __retval; \ | ||
| 215 | }) | ||
| 216 | |||
| 217 | #define _percpu_write(pcp, val) \ | ||
| 218 | do { \ | ||
| 219 | preempt_disable(); \ | ||
| 220 | __percpu_write(raw_cpu_ptr(&(pcp)), (unsigned long)(val), \ | ||
| 221 | sizeof(pcp)); \ | ||
| 222 | preempt_enable(); \ | ||
| 223 | } while(0) \ | ||
| 224 | |||
| 225 | #define _pcp_protect(operation, pcp, val) \ | ||
| 226 | ({ \ | ||
| 227 | typeof(pcp) __retval; \ | ||
| 228 | preempt_disable(); \ | ||
| 229 | __retval = (typeof(pcp))operation(raw_cpu_ptr(&(pcp)), \ | ||
| 230 | (val), sizeof(pcp)); \ | ||
| 231 | preempt_enable(); \ | ||
| 232 | __retval; \ | ||
| 233 | }) | ||
| 234 | |||
| 207 | #define _percpu_add(pcp, val) \ | 235 | #define _percpu_add(pcp, val) \ |
| 208 | __percpu_add(raw_cpu_ptr(&(pcp)), val, sizeof(pcp)) | 236 | _pcp_protect(__percpu_add, pcp, val) |
| 209 | 237 | ||
| 210 | #define _percpu_add_return(pcp, val) (typeof(pcp)) (_percpu_add(pcp, val)) | 238 | #define _percpu_add_return(pcp, val) _percpu_add(pcp, val) |
| 211 | 239 | ||
| 212 | #define _percpu_and(pcp, val) \ | 240 | #define _percpu_and(pcp, val) \ |
| 213 | __percpu_and(raw_cpu_ptr(&(pcp)), val, sizeof(pcp)) | 241 | _pcp_protect(__percpu_and, pcp, val) |
| 214 | 242 | ||
| 215 | #define _percpu_or(pcp, val) \ | 243 | #define _percpu_or(pcp, val) \ |
| 216 | __percpu_or(raw_cpu_ptr(&(pcp)), val, sizeof(pcp)) | 244 | _pcp_protect(__percpu_or, pcp, val) |
| 217 | |||
| 218 | #define _percpu_read(pcp) (typeof(pcp)) \ | ||
| 219 | (__percpu_read(raw_cpu_ptr(&(pcp)), sizeof(pcp))) | ||
| 220 | |||
| 221 | #define _percpu_write(pcp, val) \ | ||
| 222 | __percpu_write(raw_cpu_ptr(&(pcp)), (unsigned long)(val), sizeof(pcp)) | ||
| 223 | 245 | ||
| 224 | #define _percpu_xchg(pcp, val) (typeof(pcp)) \ | 246 | #define _percpu_xchg(pcp, val) (typeof(pcp)) \ |
| 225 | (__percpu_xchg(raw_cpu_ptr(&(pcp)), (unsigned long)(val), sizeof(pcp))) | 247 | _pcp_protect(__percpu_xchg, pcp, (unsigned long)(val)) |
| 226 | 248 | ||
| 227 | #define this_cpu_add_1(pcp, val) _percpu_add(pcp, val) | 249 | #define this_cpu_add_1(pcp, val) _percpu_add(pcp, val) |
| 228 | #define this_cpu_add_2(pcp, val) _percpu_add(pcp, val) | 250 | #define this_cpu_add_2(pcp, val) _percpu_add(pcp, val) |
diff --git a/arch/metag/include/asm/io.h b/arch/metag/include/asm/io.h index 9359e5048442..d5779b0ec573 100644 --- a/arch/metag/include/asm/io.h +++ b/arch/metag/include/asm/io.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _ASM_METAG_IO_H | 2 | #define _ASM_METAG_IO_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <asm/pgtable-bits.h> | ||
| 5 | 6 | ||
| 6 | #define IO_SPACE_LIMIT 0 | 7 | #define IO_SPACE_LIMIT 0 |
| 7 | 8 | ||
diff --git a/arch/metag/include/asm/pgtable-bits.h b/arch/metag/include/asm/pgtable-bits.h new file mode 100644 index 000000000000..25ba6729f496 --- /dev/null +++ b/arch/metag/include/asm/pgtable-bits.h | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | /* | ||
| 2 | * Meta page table definitions. | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _METAG_PGTABLE_BITS_H | ||
| 6 | #define _METAG_PGTABLE_BITS_H | ||
| 7 | |||
| 8 | #include <asm/metag_mem.h> | ||
| 9 | |||
| 10 | /* | ||
| 11 | * Definitions for MMU descriptors | ||
| 12 | * | ||
| 13 | * These are the hardware bits in the MMCU pte entries. | ||
| 14 | * Derived from the Meta toolkit headers. | ||
| 15 | */ | ||
| 16 | #define _PAGE_PRESENT MMCU_ENTRY_VAL_BIT | ||
| 17 | #define _PAGE_WRITE MMCU_ENTRY_WR_BIT | ||
| 18 | #define _PAGE_PRIV MMCU_ENTRY_PRIV_BIT | ||
| 19 | /* Write combine bit - this can cause writes to occur out of order */ | ||
| 20 | #define _PAGE_WR_COMBINE MMCU_ENTRY_WRC_BIT | ||
| 21 | /* Sys coherent bit - this bit is never used by Linux */ | ||
| 22 | #define _PAGE_SYS_COHERENT MMCU_ENTRY_SYS_BIT | ||
| 23 | #define _PAGE_ALWAYS_ZERO_1 0x020 | ||
| 24 | #define _PAGE_CACHE_CTRL0 0x040 | ||
| 25 | #define _PAGE_CACHE_CTRL1 0x080 | ||
| 26 | #define _PAGE_ALWAYS_ZERO_2 0x100 | ||
| 27 | #define _PAGE_ALWAYS_ZERO_3 0x200 | ||
| 28 | #define _PAGE_ALWAYS_ZERO_4 0x400 | ||
| 29 | #define _PAGE_ALWAYS_ZERO_5 0x800 | ||
| 30 | |||
| 31 | /* These are software bits that we stuff into the gaps in the hardware | ||
| 32 | * pte entries that are not used. Note, these DO get stored in the actual | ||
| 33 | * hardware, but the hardware just does not use them. | ||
| 34 | */ | ||
| 35 | #define _PAGE_ACCESSED _PAGE_ALWAYS_ZERO_1 | ||
| 36 | #define _PAGE_DIRTY _PAGE_ALWAYS_ZERO_2 | ||
| 37 | |||
| 38 | /* Pages owned, and protected by, the kernel. */ | ||
| 39 | #define _PAGE_KERNEL _PAGE_PRIV | ||
| 40 | |||
| 41 | /* No cacheing of this page */ | ||
| 42 | #define _PAGE_CACHE_WIN0 (MMCU_CWIN_UNCACHED << MMCU_ENTRY_CWIN_S) | ||
| 43 | /* burst cacheing - good for data streaming */ | ||
| 44 | #define _PAGE_CACHE_WIN1 (MMCU_CWIN_BURST << MMCU_ENTRY_CWIN_S) | ||
| 45 | /* One cache way per thread */ | ||
| 46 | #define _PAGE_CACHE_WIN2 (MMCU_CWIN_C1SET << MMCU_ENTRY_CWIN_S) | ||
| 47 | /* Full on cacheing */ | ||
| 48 | #define _PAGE_CACHE_WIN3 (MMCU_CWIN_CACHED << MMCU_ENTRY_CWIN_S) | ||
| 49 | |||
| 50 | #define _PAGE_CACHEABLE (_PAGE_CACHE_WIN3 | _PAGE_WR_COMBINE) | ||
| 51 | |||
| 52 | /* which bits are used for cache control ... */ | ||
| 53 | #define _PAGE_CACHE_MASK (_PAGE_CACHE_CTRL0 | _PAGE_CACHE_CTRL1 | \ | ||
| 54 | _PAGE_WR_COMBINE) | ||
| 55 | |||
| 56 | /* This is a mask of the bits that pte_modify is allowed to change. */ | ||
| 57 | #define _PAGE_CHG_MASK (PAGE_MASK) | ||
| 58 | |||
| 59 | #define _PAGE_SZ_SHIFT 1 | ||
| 60 | #define _PAGE_SZ_4K (0x0) | ||
| 61 | #define _PAGE_SZ_8K (0x1 << _PAGE_SZ_SHIFT) | ||
| 62 | #define _PAGE_SZ_16K (0x2 << _PAGE_SZ_SHIFT) | ||
| 63 | #define _PAGE_SZ_32K (0x3 << _PAGE_SZ_SHIFT) | ||
| 64 | #define _PAGE_SZ_64K (0x4 << _PAGE_SZ_SHIFT) | ||
| 65 | #define _PAGE_SZ_128K (0x5 << _PAGE_SZ_SHIFT) | ||
| 66 | #define _PAGE_SZ_256K (0x6 << _PAGE_SZ_SHIFT) | ||
| 67 | #define _PAGE_SZ_512K (0x7 << _PAGE_SZ_SHIFT) | ||
| 68 | #define _PAGE_SZ_1M (0x8 << _PAGE_SZ_SHIFT) | ||
| 69 | #define _PAGE_SZ_2M (0x9 << _PAGE_SZ_SHIFT) | ||
| 70 | #define _PAGE_SZ_4M (0xa << _PAGE_SZ_SHIFT) | ||
| 71 | #define _PAGE_SZ_MASK (0xf << _PAGE_SZ_SHIFT) | ||
| 72 | |||
| 73 | #if defined(CONFIG_PAGE_SIZE_4K) | ||
| 74 | #define _PAGE_SZ (_PAGE_SZ_4K) | ||
| 75 | #elif defined(CONFIG_PAGE_SIZE_8K) | ||
| 76 | #define _PAGE_SZ (_PAGE_SZ_8K) | ||
| 77 | #elif defined(CONFIG_PAGE_SIZE_16K) | ||
| 78 | #define _PAGE_SZ (_PAGE_SZ_16K) | ||
| 79 | #endif | ||
| 80 | #define _PAGE_TABLE (_PAGE_SZ | _PAGE_PRESENT) | ||
| 81 | |||
| 82 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_8K) | ||
| 83 | # define _PAGE_SZHUGE (_PAGE_SZ_8K) | ||
| 84 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_16K) | ||
| 85 | # define _PAGE_SZHUGE (_PAGE_SZ_16K) | ||
| 86 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_32K) | ||
| 87 | # define _PAGE_SZHUGE (_PAGE_SZ_32K) | ||
| 88 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_64K) | ||
| 89 | # define _PAGE_SZHUGE (_PAGE_SZ_64K) | ||
| 90 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_128K) | ||
| 91 | # define _PAGE_SZHUGE (_PAGE_SZ_128K) | ||
| 92 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K) | ||
| 93 | # define _PAGE_SZHUGE (_PAGE_SZ_256K) | ||
| 94 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K) | ||
| 95 | # define _PAGE_SZHUGE (_PAGE_SZ_512K) | ||
| 96 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_1M) | ||
| 97 | # define _PAGE_SZHUGE (_PAGE_SZ_1M) | ||
| 98 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_2M) | ||
| 99 | # define _PAGE_SZHUGE (_PAGE_SZ_2M) | ||
| 100 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_4M) | ||
| 101 | # define _PAGE_SZHUGE (_PAGE_SZ_4M) | ||
| 102 | #endif | ||
| 103 | |||
| 104 | #endif /* _METAG_PGTABLE_BITS_H */ | ||
diff --git a/arch/metag/include/asm/pgtable.h b/arch/metag/include/asm/pgtable.h index d0604c0a8702..ffa3a3a2ecad 100644 --- a/arch/metag/include/asm/pgtable.h +++ b/arch/metag/include/asm/pgtable.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #ifndef _METAG_PGTABLE_H | 5 | #ifndef _METAG_PGTABLE_H |
| 6 | #define _METAG_PGTABLE_H | 6 | #define _METAG_PGTABLE_H |
| 7 | 7 | ||
| 8 | #include <asm/pgtable-bits.h> | ||
| 8 | #include <asm-generic/pgtable-nopmd.h> | 9 | #include <asm-generic/pgtable-nopmd.h> |
| 9 | 10 | ||
| 10 | /* Invalid regions on Meta: 0x00000000-0x001FFFFF and 0xFFFF0000-0xFFFFFFFF */ | 11 | /* Invalid regions on Meta: 0x00000000-0x001FFFFF and 0xFFFF0000-0xFFFFFFFF */ |
| @@ -21,100 +22,6 @@ | |||
| 21 | #endif | 22 | #endif |
| 22 | 23 | ||
| 23 | /* | 24 | /* |
| 24 | * Definitions for MMU descriptors | ||
| 25 | * | ||
| 26 | * These are the hardware bits in the MMCU pte entries. | ||
| 27 | * Derived from the Meta toolkit headers. | ||
| 28 | */ | ||
| 29 | #define _PAGE_PRESENT MMCU_ENTRY_VAL_BIT | ||
| 30 | #define _PAGE_WRITE MMCU_ENTRY_WR_BIT | ||
| 31 | #define _PAGE_PRIV MMCU_ENTRY_PRIV_BIT | ||
| 32 | /* Write combine bit - this can cause writes to occur out of order */ | ||
| 33 | #define _PAGE_WR_COMBINE MMCU_ENTRY_WRC_BIT | ||
| 34 | /* Sys coherent bit - this bit is never used by Linux */ | ||
| 35 | #define _PAGE_SYS_COHERENT MMCU_ENTRY_SYS_BIT | ||
| 36 | #define _PAGE_ALWAYS_ZERO_1 0x020 | ||
| 37 | #define _PAGE_CACHE_CTRL0 0x040 | ||
| 38 | #define _PAGE_CACHE_CTRL1 0x080 | ||
| 39 | #define _PAGE_ALWAYS_ZERO_2 0x100 | ||
| 40 | #define _PAGE_ALWAYS_ZERO_3 0x200 | ||
| 41 | #define _PAGE_ALWAYS_ZERO_4 0x400 | ||
| 42 | #define _PAGE_ALWAYS_ZERO_5 0x800 | ||
| 43 | |||
| 44 | /* These are software bits that we stuff into the gaps in the hardware | ||
| 45 | * pte entries that are not used. Note, these DO get stored in the actual | ||
| 46 | * hardware, but the hardware just does not use them. | ||
| 47 | */ | ||
| 48 | #define _PAGE_ACCESSED _PAGE_ALWAYS_ZERO_1 | ||
| 49 | #define _PAGE_DIRTY _PAGE_ALWAYS_ZERO_2 | ||
| 50 | |||
| 51 | /* Pages owned, and protected by, the kernel. */ | ||
| 52 | #define _PAGE_KERNEL _PAGE_PRIV | ||
| 53 | |||
| 54 | /* No cacheing of this page */ | ||
| 55 | #define _PAGE_CACHE_WIN0 (MMCU_CWIN_UNCACHED << MMCU_ENTRY_CWIN_S) | ||
| 56 | /* burst cacheing - good for data streaming */ | ||
| 57 | #define _PAGE_CACHE_WIN1 (MMCU_CWIN_BURST << MMCU_ENTRY_CWIN_S) | ||
| 58 | /* One cache way per thread */ | ||
| 59 | #define _PAGE_CACHE_WIN2 (MMCU_CWIN_C1SET << MMCU_ENTRY_CWIN_S) | ||
| 60 | /* Full on cacheing */ | ||
| 61 | #define _PAGE_CACHE_WIN3 (MMCU_CWIN_CACHED << MMCU_ENTRY_CWIN_S) | ||
| 62 | |||
| 63 | #define _PAGE_CACHEABLE (_PAGE_CACHE_WIN3 | _PAGE_WR_COMBINE) | ||
| 64 | |||
| 65 | /* which bits are used for cache control ... */ | ||
| 66 | #define _PAGE_CACHE_MASK (_PAGE_CACHE_CTRL0 | _PAGE_CACHE_CTRL1 | \ | ||
| 67 | _PAGE_WR_COMBINE) | ||
| 68 | |||
| 69 | /* This is a mask of the bits that pte_modify is allowed to change. */ | ||
| 70 | #define _PAGE_CHG_MASK (PAGE_MASK) | ||
| 71 | |||
| 72 | #define _PAGE_SZ_SHIFT 1 | ||
| 73 | #define _PAGE_SZ_4K (0x0) | ||
| 74 | #define _PAGE_SZ_8K (0x1 << _PAGE_SZ_SHIFT) | ||
| 75 | #define _PAGE_SZ_16K (0x2 << _PAGE_SZ_SHIFT) | ||
| 76 | #define _PAGE_SZ_32K (0x3 << _PAGE_SZ_SHIFT) | ||
| 77 | #define _PAGE_SZ_64K (0x4 << _PAGE_SZ_SHIFT) | ||
| 78 | #define _PAGE_SZ_128K (0x5 << _PAGE_SZ_SHIFT) | ||
| 79 | #define _PAGE_SZ_256K (0x6 << _PAGE_SZ_SHIFT) | ||
| 80 | #define _PAGE_SZ_512K (0x7 << _PAGE_SZ_SHIFT) | ||
| 81 | #define _PAGE_SZ_1M (0x8 << _PAGE_SZ_SHIFT) | ||
| 82 | #define _PAGE_SZ_2M (0x9 << _PAGE_SZ_SHIFT) | ||
| 83 | #define _PAGE_SZ_4M (0xa << _PAGE_SZ_SHIFT) | ||
| 84 | #define _PAGE_SZ_MASK (0xf << _PAGE_SZ_SHIFT) | ||
| 85 | |||
| 86 | #if defined(CONFIG_PAGE_SIZE_4K) | ||
| 87 | #define _PAGE_SZ (_PAGE_SZ_4K) | ||
| 88 | #elif defined(CONFIG_PAGE_SIZE_8K) | ||
| 89 | #define _PAGE_SZ (_PAGE_SZ_8K) | ||
| 90 | #elif defined(CONFIG_PAGE_SIZE_16K) | ||
| 91 | #define _PAGE_SZ (_PAGE_SZ_16K) | ||
| 92 | #endif | ||
| 93 | #define _PAGE_TABLE (_PAGE_SZ | _PAGE_PRESENT) | ||
| 94 | |||
| 95 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_8K) | ||
| 96 | # define _PAGE_SZHUGE (_PAGE_SZ_8K) | ||
| 97 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_16K) | ||
| 98 | # define _PAGE_SZHUGE (_PAGE_SZ_16K) | ||
| 99 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_32K) | ||
| 100 | # define _PAGE_SZHUGE (_PAGE_SZ_32K) | ||
| 101 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_64K) | ||
| 102 | # define _PAGE_SZHUGE (_PAGE_SZ_64K) | ||
| 103 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_128K) | ||
| 104 | # define _PAGE_SZHUGE (_PAGE_SZ_128K) | ||
| 105 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K) | ||
| 106 | # define _PAGE_SZHUGE (_PAGE_SZ_256K) | ||
| 107 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K) | ||
| 108 | # define _PAGE_SZHUGE (_PAGE_SZ_512K) | ||
| 109 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_1M) | ||
| 110 | # define _PAGE_SZHUGE (_PAGE_SZ_1M) | ||
| 111 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_2M) | ||
| 112 | # define _PAGE_SZHUGE (_PAGE_SZ_2M) | ||
| 113 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_4M) | ||
| 114 | # define _PAGE_SZHUGE (_PAGE_SZ_4M) | ||
| 115 | #endif | ||
| 116 | |||
| 117 | /* | ||
| 118 | * The Linux memory management assumes a three-level page table setup. On | 25 | * The Linux memory management assumes a three-level page table setup. On |
| 119 | * Meta, we use that, but "fold" the mid level into the top-level page | 26 | * Meta, we use that, but "fold" the mid level into the top-level page |
| 120 | * table. | 27 | * table. |
diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h index f213f5b4c423..d17437238a2c 100644 --- a/arch/parisc/include/asm/pgalloc.h +++ b/arch/parisc/include/asm/pgalloc.h | |||
| @@ -26,7 +26,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
| 26 | 26 | ||
| 27 | if (likely(pgd != NULL)) { | 27 | if (likely(pgd != NULL)) { |
| 28 | memset(pgd, 0, PAGE_SIZE<<PGD_ALLOC_ORDER); | 28 | memset(pgd, 0, PAGE_SIZE<<PGD_ALLOC_ORDER); |
| 29 | #ifdef CONFIG_64BIT | 29 | #if PT_NLEVELS == 3 |
| 30 | actual_pgd += PTRS_PER_PGD; | 30 | actual_pgd += PTRS_PER_PGD; |
| 31 | /* Populate first pmd with allocated memory. We mark it | 31 | /* Populate first pmd with allocated memory. We mark it |
| 32 | * with PxD_FLAG_ATTACHED as a signal to the system that this | 32 | * with PxD_FLAG_ATTACHED as a signal to the system that this |
| @@ -45,7 +45,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
| 45 | 45 | ||
| 46 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) | 46 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
| 47 | { | 47 | { |
| 48 | #ifdef CONFIG_64BIT | 48 | #if PT_NLEVELS == 3 |
| 49 | pgd -= PTRS_PER_PGD; | 49 | pgd -= PTRS_PER_PGD; |
| 50 | #endif | 50 | #endif |
| 51 | free_pages((unsigned long)pgd, PGD_ALLOC_ORDER); | 51 | free_pages((unsigned long)pgd, PGD_ALLOC_ORDER); |
| @@ -72,12 +72,15 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
| 72 | 72 | ||
| 73 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | 73 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
| 74 | { | 74 | { |
| 75 | #ifdef CONFIG_64BIT | ||
| 76 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) | 75 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) |
| 77 | /* This is the permanent pmd attached to the pgd; | 76 | /* |
| 78 | * cannot free it */ | 77 | * This is the permanent pmd attached to the pgd; |
| 78 | * cannot free it. | ||
| 79 | * Increment the counter to compensate for the decrement | ||
| 80 | * done by generic mm code. | ||
| 81 | */ | ||
| 82 | mm_inc_nr_pmds(mm); | ||
| 79 | return; | 83 | return; |
| 80 | #endif | ||
| 81 | free_pages((unsigned long)pmd, PMD_ORDER); | 84 | free_pages((unsigned long)pmd, PMD_ORDER); |
| 82 | } | 85 | } |
| 83 | 86 | ||
| @@ -99,7 +102,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | |||
| 99 | static inline void | 102 | static inline void |
| 100 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) | 103 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) |
| 101 | { | 104 | { |
| 102 | #ifdef CONFIG_64BIT | 105 | #if PT_NLEVELS == 3 |
| 103 | /* preserve the gateway marker if this is the beginning of | 106 | /* preserve the gateway marker if this is the beginning of |
| 104 | * the permanent pmd */ | 107 | * the permanent pmd */ |
| 105 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) | 108 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) |
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 5a8997d63899..8eefb12d1d33 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S | |||
| @@ -55,8 +55,8 @@ | |||
| 55 | #define ENTRY_COMP(_name_) .word sys_##_name_ | 55 | #define ENTRY_COMP(_name_) .word sys_##_name_ |
| 56 | #endif | 56 | #endif |
| 57 | 57 | ||
| 58 | ENTRY_SAME(restart_syscall) /* 0 */ | 58 | 90: ENTRY_SAME(restart_syscall) /* 0 */ |
| 59 | ENTRY_SAME(exit) | 59 | 91: ENTRY_SAME(exit) |
| 60 | ENTRY_SAME(fork_wrapper) | 60 | ENTRY_SAME(fork_wrapper) |
| 61 | ENTRY_SAME(read) | 61 | ENTRY_SAME(read) |
| 62 | ENTRY_SAME(write) | 62 | ENTRY_SAME(write) |
| @@ -439,7 +439,10 @@ | |||
| 439 | ENTRY_SAME(bpf) | 439 | ENTRY_SAME(bpf) |
| 440 | ENTRY_COMP(execveat) | 440 | ENTRY_COMP(execveat) |
| 441 | 441 | ||
| 442 | /* Nothing yet */ | 442 | |
| 443 | .ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b)) | ||
| 444 | .error "size of syscall table does not fit value of __NR_Linux_syscalls" | ||
| 445 | .endif | ||
| 443 | 446 | ||
| 444 | #undef ENTRY_SAME | 447 | #undef ENTRY_SAME |
| 445 | #undef ENTRY_DIFF | 448 | #undef ENTRY_DIFF |
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h index 03cd858a401c..4cbe23af400a 100644 --- a/arch/powerpc/include/asm/ppc-opcode.h +++ b/arch/powerpc/include/asm/ppc-opcode.h | |||
| @@ -153,6 +153,7 @@ | |||
| 153 | #define PPC_INST_MFSPR_PVR_MASK 0xfc1fffff | 153 | #define PPC_INST_MFSPR_PVR_MASK 0xfc1fffff |
| 154 | #define PPC_INST_MFTMR 0x7c0002dc | 154 | #define PPC_INST_MFTMR 0x7c0002dc |
| 155 | #define PPC_INST_MSGSND 0x7c00019c | 155 | #define PPC_INST_MSGSND 0x7c00019c |
| 156 | #define PPC_INST_MSGCLR 0x7c0001dc | ||
| 156 | #define PPC_INST_MSGSNDP 0x7c00011c | 157 | #define PPC_INST_MSGSNDP 0x7c00011c |
| 157 | #define PPC_INST_MTTMR 0x7c0003dc | 158 | #define PPC_INST_MTTMR 0x7c0003dc |
| 158 | #define PPC_INST_NOP 0x60000000 | 159 | #define PPC_INST_NOP 0x60000000 |
| @@ -309,6 +310,8 @@ | |||
| 309 | ___PPC_RB(b) | __PPC_EH(eh)) | 310 | ___PPC_RB(b) | __PPC_EH(eh)) |
| 310 | #define PPC_MSGSND(b) stringify_in_c(.long PPC_INST_MSGSND | \ | 311 | #define PPC_MSGSND(b) stringify_in_c(.long PPC_INST_MSGSND | \ |
| 311 | ___PPC_RB(b)) | 312 | ___PPC_RB(b)) |
| 313 | #define PPC_MSGCLR(b) stringify_in_c(.long PPC_INST_MSGCLR | \ | ||
| 314 | ___PPC_RB(b)) | ||
| 312 | #define PPC_MSGSNDP(b) stringify_in_c(.long PPC_INST_MSGSNDP | \ | 315 | #define PPC_MSGSNDP(b) stringify_in_c(.long PPC_INST_MSGSNDP | \ |
| 313 | ___PPC_RB(b)) | 316 | ___PPC_RB(b)) |
| 314 | #define PPC_POPCNTB(a, s) stringify_in_c(.long PPC_INST_POPCNTB | \ | 317 | #define PPC_POPCNTB(a, s) stringify_in_c(.long PPC_INST_POPCNTB | \ |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 1c874fb533bb..af56b5c6c81a 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
| @@ -608,13 +608,16 @@ | |||
| 608 | #define SRR1_ISI_N_OR_G 0x10000000 /* ISI: Access is no-exec or G */ | 608 | #define SRR1_ISI_N_OR_G 0x10000000 /* ISI: Access is no-exec or G */ |
| 609 | #define SRR1_ISI_PROT 0x08000000 /* ISI: Other protection fault */ | 609 | #define SRR1_ISI_PROT 0x08000000 /* ISI: Other protection fault */ |
| 610 | #define SRR1_WAKEMASK 0x00380000 /* reason for wakeup */ | 610 | #define SRR1_WAKEMASK 0x00380000 /* reason for wakeup */ |
| 611 | #define SRR1_WAKEMASK_P8 0x003c0000 /* reason for wakeup on POWER8 */ | ||
| 611 | #define SRR1_WAKESYSERR 0x00300000 /* System error */ | 612 | #define SRR1_WAKESYSERR 0x00300000 /* System error */ |
| 612 | #define SRR1_WAKEEE 0x00200000 /* External interrupt */ | 613 | #define SRR1_WAKEEE 0x00200000 /* External interrupt */ |
| 613 | #define SRR1_WAKEMT 0x00280000 /* mtctrl */ | 614 | #define SRR1_WAKEMT 0x00280000 /* mtctrl */ |
| 614 | #define SRR1_WAKEHMI 0x00280000 /* Hypervisor maintenance */ | 615 | #define SRR1_WAKEHMI 0x00280000 /* Hypervisor maintenance */ |
| 615 | #define SRR1_WAKEDEC 0x00180000 /* Decrementer interrupt */ | 616 | #define SRR1_WAKEDEC 0x00180000 /* Decrementer interrupt */ |
| 617 | #define SRR1_WAKEDBELL 0x00140000 /* Privileged doorbell on P8 */ | ||
| 616 | #define SRR1_WAKETHERM 0x00100000 /* Thermal management interrupt */ | 618 | #define SRR1_WAKETHERM 0x00100000 /* Thermal management interrupt */ |
| 617 | #define SRR1_WAKERESET 0x00100000 /* System reset */ | 619 | #define SRR1_WAKERESET 0x00100000 /* System reset */ |
| 620 | #define SRR1_WAKEHDBELL 0x000c0000 /* Hypervisor doorbell on P8 */ | ||
| 618 | #define SRR1_WAKESTATE 0x00030000 /* Powersave exit mask [46:47] */ | 621 | #define SRR1_WAKESTATE 0x00030000 /* Powersave exit mask [46:47] */ |
| 619 | #define SRR1_WS_DEEPEST 0x00030000 /* Some resources not maintained, | 622 | #define SRR1_WS_DEEPEST 0x00030000 /* Some resources not maintained, |
| 620 | * may not be recoverable */ | 623 | * may not be recoverable */ |
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index f337666768a7..f83046878336 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
| @@ -437,6 +437,26 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 437 | .machine_check_early = __machine_check_early_realmode_p8, | 437 | .machine_check_early = __machine_check_early_realmode_p8, |
| 438 | .platform = "power8", | 438 | .platform = "power8", |
| 439 | }, | 439 | }, |
| 440 | { /* Power8NVL */ | ||
| 441 | .pvr_mask = 0xffff0000, | ||
| 442 | .pvr_value = 0x004c0000, | ||
| 443 | .cpu_name = "POWER8NVL (raw)", | ||
| 444 | .cpu_features = CPU_FTRS_POWER8, | ||
| 445 | .cpu_user_features = COMMON_USER_POWER8, | ||
| 446 | .cpu_user_features2 = COMMON_USER2_POWER8, | ||
| 447 | .mmu_features = MMU_FTRS_POWER8, | ||
| 448 | .icache_bsize = 128, | ||
| 449 | .dcache_bsize = 128, | ||
| 450 | .num_pmcs = 6, | ||
| 451 | .pmc_type = PPC_PMC_IBM, | ||
| 452 | .oprofile_cpu_type = "ppc64/power8", | ||
| 453 | .oprofile_type = PPC_OPROFILE_INVALID, | ||
| 454 | .cpu_setup = __setup_cpu_power8, | ||
| 455 | .cpu_restore = __restore_cpu_power8, | ||
| 456 | .flush_tlb = __flush_tlb_power8, | ||
| 457 | .machine_check_early = __machine_check_early_realmode_p8, | ||
| 458 | .platform = "power8", | ||
| 459 | }, | ||
| 440 | { /* Power8 DD1: Does not support doorbell IPIs */ | 460 | { /* Power8 DD1: Does not support doorbell IPIs */ |
| 441 | .pvr_mask = 0xffffff00, | 461 | .pvr_mask = 0xffffff00, |
| 442 | .pvr_value = 0x004d0100, | 462 | .pvr_value = 0x004d0100, |
diff --git a/arch/powerpc/kernel/dbell.c b/arch/powerpc/kernel/dbell.c index f4217819cc31..2128f3a96c32 100644 --- a/arch/powerpc/kernel/dbell.c +++ b/arch/powerpc/kernel/dbell.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | #include <asm/dbell.h> | 18 | #include <asm/dbell.h> |
| 19 | #include <asm/irq_regs.h> | 19 | #include <asm/irq_regs.h> |
| 20 | #include <asm/kvm_ppc.h> | ||
| 20 | 21 | ||
| 21 | #ifdef CONFIG_SMP | 22 | #ifdef CONFIG_SMP |
| 22 | void doorbell_setup_this_cpu(void) | 23 | void doorbell_setup_this_cpu(void) |
| @@ -41,6 +42,7 @@ void doorbell_exception(struct pt_regs *regs) | |||
| 41 | 42 | ||
| 42 | may_hard_irq_enable(); | 43 | may_hard_irq_enable(); |
| 43 | 44 | ||
| 45 | kvmppc_set_host_ipi(smp_processor_id(), 0); | ||
| 44 | __this_cpu_inc(irq_stat.doorbell_irqs); | 46 | __this_cpu_inc(irq_stat.doorbell_irqs); |
| 45 | 47 | ||
| 46 | smp_ipi_demux(); | 48 | smp_ipi_demux(); |
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index c2df8150bd7a..9519e6bdc6d7 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
| @@ -1408,7 +1408,7 @@ machine_check_handle_early: | |||
| 1408 | bne 9f /* continue in V mode if we are. */ | 1408 | bne 9f /* continue in V mode if we are. */ |
| 1409 | 1409 | ||
| 1410 | 5: | 1410 | 5: |
| 1411 | #ifdef CONFIG_KVM_BOOK3S_64_HV | 1411 | #ifdef CONFIG_KVM_BOOK3S_64_HANDLER |
| 1412 | /* | 1412 | /* |
| 1413 | * We are coming from kernel context. Check if we are coming from | 1413 | * We are coming from kernel context. Check if we are coming from |
| 1414 | * guest. if yes, then we can continue. We will fall through | 1414 | * guest. if yes, then we can continue. We will fall through |
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index de4018a1bc4b..de747563d29d 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c | |||
| @@ -636,7 +636,7 @@ static int kvmppc_get_yield_count(struct kvm_vcpu *vcpu) | |||
| 636 | spin_lock(&vcpu->arch.vpa_update_lock); | 636 | spin_lock(&vcpu->arch.vpa_update_lock); |
| 637 | lppaca = (struct lppaca *)vcpu->arch.vpa.pinned_addr; | 637 | lppaca = (struct lppaca *)vcpu->arch.vpa.pinned_addr; |
| 638 | if (lppaca) | 638 | if (lppaca) |
| 639 | yield_count = lppaca->yield_count; | 639 | yield_count = be32_to_cpu(lppaca->yield_count); |
| 640 | spin_unlock(&vcpu->arch.vpa_update_lock); | 640 | spin_unlock(&vcpu->arch.vpa_update_lock); |
| 641 | return yield_count; | 641 | return yield_count; |
| 642 | } | 642 | } |
| @@ -942,20 +942,20 @@ static int kvm_arch_vcpu_ioctl_set_sregs_hv(struct kvm_vcpu *vcpu, | |||
| 942 | static void kvmppc_set_lpcr(struct kvm_vcpu *vcpu, u64 new_lpcr, | 942 | static void kvmppc_set_lpcr(struct kvm_vcpu *vcpu, u64 new_lpcr, |
| 943 | bool preserve_top32) | 943 | bool preserve_top32) |
| 944 | { | 944 | { |
| 945 | struct kvm *kvm = vcpu->kvm; | ||
| 945 | struct kvmppc_vcore *vc = vcpu->arch.vcore; | 946 | struct kvmppc_vcore *vc = vcpu->arch.vcore; |
| 946 | u64 mask; | 947 | u64 mask; |
| 947 | 948 | ||
| 949 | mutex_lock(&kvm->lock); | ||
| 948 | spin_lock(&vc->lock); | 950 | spin_lock(&vc->lock); |
| 949 | /* | 951 | /* |
| 950 | * If ILE (interrupt little-endian) has changed, update the | 952 | * If ILE (interrupt little-endian) has changed, update the |
| 951 | * MSR_LE bit in the intr_msr for each vcpu in this vcore. | 953 | * MSR_LE bit in the intr_msr for each vcpu in this vcore. |
| 952 | */ | 954 | */ |
| 953 | if ((new_lpcr & LPCR_ILE) != (vc->lpcr & LPCR_ILE)) { | 955 | if ((new_lpcr & LPCR_ILE) != (vc->lpcr & LPCR_ILE)) { |
| 954 | struct kvm *kvm = vcpu->kvm; | ||
| 955 | struct kvm_vcpu *vcpu; | 956 | struct kvm_vcpu *vcpu; |
| 956 | int i; | 957 | int i; |
| 957 | 958 | ||
| 958 | mutex_lock(&kvm->lock); | ||
| 959 | kvm_for_each_vcpu(i, vcpu, kvm) { | 959 | kvm_for_each_vcpu(i, vcpu, kvm) { |
| 960 | if (vcpu->arch.vcore != vc) | 960 | if (vcpu->arch.vcore != vc) |
| 961 | continue; | 961 | continue; |
| @@ -964,7 +964,6 @@ static void kvmppc_set_lpcr(struct kvm_vcpu *vcpu, u64 new_lpcr, | |||
| 964 | else | 964 | else |
| 965 | vcpu->arch.intr_msr &= ~MSR_LE; | 965 | vcpu->arch.intr_msr &= ~MSR_LE; |
| 966 | } | 966 | } |
| 967 | mutex_unlock(&kvm->lock); | ||
| 968 | } | 967 | } |
| 969 | 968 | ||
| 970 | /* | 969 | /* |
| @@ -981,6 +980,7 @@ static void kvmppc_set_lpcr(struct kvm_vcpu *vcpu, u64 new_lpcr, | |||
| 981 | mask &= 0xFFFFFFFF; | 980 | mask &= 0xFFFFFFFF; |
| 982 | vc->lpcr = (vc->lpcr & ~mask) | (new_lpcr & mask); | 981 | vc->lpcr = (vc->lpcr & ~mask) | (new_lpcr & mask); |
| 983 | spin_unlock(&vc->lock); | 982 | spin_unlock(&vc->lock); |
| 983 | mutex_unlock(&kvm->lock); | ||
| 984 | } | 984 | } |
| 985 | 985 | ||
| 986 | static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id, | 986 | static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id, |
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index bb94e6f20c81..6cbf1630cb70 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S | |||
| @@ -1005,6 +1005,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) | |||
| 1005 | /* Save HEIR (HV emulation assist reg) in emul_inst | 1005 | /* Save HEIR (HV emulation assist reg) in emul_inst |
| 1006 | if this is an HEI (HV emulation interrupt, e40) */ | 1006 | if this is an HEI (HV emulation interrupt, e40) */ |
| 1007 | li r3,KVM_INST_FETCH_FAILED | 1007 | li r3,KVM_INST_FETCH_FAILED |
| 1008 | stw r3,VCPU_LAST_INST(r9) | ||
| 1008 | cmpwi r12,BOOK3S_INTERRUPT_H_EMUL_ASSIST | 1009 | cmpwi r12,BOOK3S_INTERRUPT_H_EMUL_ASSIST |
| 1009 | bne 11f | 1010 | bne 11f |
| 1010 | mfspr r3,SPRN_HEIR | 1011 | mfspr r3,SPRN_HEIR |
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c index fc34025ef822..38a45088f633 100644 --- a/arch/powerpc/platforms/powernv/smp.c +++ b/arch/powerpc/platforms/powernv/smp.c | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #include <asm/runlatch.h> | 33 | #include <asm/runlatch.h> |
| 34 | #include <asm/code-patching.h> | 34 | #include <asm/code-patching.h> |
| 35 | #include <asm/dbell.h> | 35 | #include <asm/dbell.h> |
| 36 | #include <asm/kvm_ppc.h> | ||
| 37 | #include <asm/ppc-opcode.h> | ||
| 36 | 38 | ||
| 37 | #include "powernv.h" | 39 | #include "powernv.h" |
| 38 | 40 | ||
| @@ -149,7 +151,7 @@ static int pnv_smp_cpu_disable(void) | |||
| 149 | static void pnv_smp_cpu_kill_self(void) | 151 | static void pnv_smp_cpu_kill_self(void) |
| 150 | { | 152 | { |
| 151 | unsigned int cpu; | 153 | unsigned int cpu; |
| 152 | unsigned long srr1; | 154 | unsigned long srr1, wmask; |
| 153 | u32 idle_states; | 155 | u32 idle_states; |
| 154 | 156 | ||
| 155 | /* Standard hot unplug procedure */ | 157 | /* Standard hot unplug procedure */ |
| @@ -161,6 +163,10 @@ static void pnv_smp_cpu_kill_self(void) | |||
| 161 | generic_set_cpu_dead(cpu); | 163 | generic_set_cpu_dead(cpu); |
| 162 | smp_wmb(); | 164 | smp_wmb(); |
| 163 | 165 | ||
| 166 | wmask = SRR1_WAKEMASK; | ||
| 167 | if (cpu_has_feature(CPU_FTR_ARCH_207S)) | ||
| 168 | wmask = SRR1_WAKEMASK_P8; | ||
| 169 | |||
| 164 | idle_states = pnv_get_supported_cpuidle_states(); | 170 | idle_states = pnv_get_supported_cpuidle_states(); |
| 165 | /* We don't want to take decrementer interrupts while we are offline, | 171 | /* We don't want to take decrementer interrupts while we are offline, |
| 166 | * so clear LPCR:PECE1. We keep PECE2 enabled. | 172 | * so clear LPCR:PECE1. We keep PECE2 enabled. |
| @@ -191,10 +197,14 @@ static void pnv_smp_cpu_kill_self(void) | |||
| 191 | * having finished executing in a KVM guest, then srr1 | 197 | * having finished executing in a KVM guest, then srr1 |
| 192 | * contains 0. | 198 | * contains 0. |
| 193 | */ | 199 | */ |
| 194 | if ((srr1 & SRR1_WAKEMASK) == SRR1_WAKEEE) { | 200 | if ((srr1 & wmask) == SRR1_WAKEEE) { |
| 195 | icp_native_flush_interrupt(); | 201 | icp_native_flush_interrupt(); |
| 196 | local_paca->irq_happened &= PACA_IRQ_HARD_DIS; | 202 | local_paca->irq_happened &= PACA_IRQ_HARD_DIS; |
| 197 | smp_mb(); | 203 | smp_mb(); |
| 204 | } else if ((srr1 & wmask) == SRR1_WAKEHDBELL) { | ||
| 205 | unsigned long msg = PPC_DBELL_TYPE(PPC_DBELL_SERVER); | ||
| 206 | asm volatile(PPC_MSGCLR(%0) : : "r" (msg)); | ||
| 207 | kvmppc_set_host_ipi(cpu, 0); | ||
| 198 | } | 208 | } |
| 199 | 209 | ||
| 200 | if (cpu_core_split_required()) | 210 | if (cpu_core_split_required()) |
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index 90cf3dcbd9f2..8f35d525cede 100644 --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c | |||
| @@ -25,10 +25,10 @@ | |||
| 25 | static struct kobject *mobility_kobj; | 25 | static struct kobject *mobility_kobj; |
| 26 | 26 | ||
| 27 | struct update_props_workarea { | 27 | struct update_props_workarea { |
| 28 | u32 phandle; | 28 | __be32 phandle; |
| 29 | u32 state; | 29 | __be32 state; |
| 30 | u64 reserved; | 30 | __be64 reserved; |
| 31 | u32 nprops; | 31 | __be32 nprops; |
| 32 | } __packed; | 32 | } __packed; |
| 33 | 33 | ||
| 34 | #define NODE_ACTION_MASK 0xff000000 | 34 | #define NODE_ACTION_MASK 0xff000000 |
| @@ -54,11 +54,11 @@ static int mobility_rtas_call(int token, char *buf, s32 scope) | |||
| 54 | return rc; | 54 | return rc; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | static int delete_dt_node(u32 phandle) | 57 | static int delete_dt_node(__be32 phandle) |
| 58 | { | 58 | { |
| 59 | struct device_node *dn; | 59 | struct device_node *dn; |
| 60 | 60 | ||
| 61 | dn = of_find_node_by_phandle(phandle); | 61 | dn = of_find_node_by_phandle(be32_to_cpu(phandle)); |
| 62 | if (!dn) | 62 | if (!dn) |
| 63 | return -ENOENT; | 63 | return -ENOENT; |
| 64 | 64 | ||
| @@ -127,7 +127,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop, | |||
| 127 | return 0; | 127 | return 0; |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | static int update_dt_node(u32 phandle, s32 scope) | 130 | static int update_dt_node(__be32 phandle, s32 scope) |
| 131 | { | 131 | { |
| 132 | struct update_props_workarea *upwa; | 132 | struct update_props_workarea *upwa; |
| 133 | struct device_node *dn; | 133 | struct device_node *dn; |
| @@ -136,6 +136,7 @@ static int update_dt_node(u32 phandle, s32 scope) | |||
| 136 | char *prop_data; | 136 | char *prop_data; |
| 137 | char *rtas_buf; | 137 | char *rtas_buf; |
| 138 | int update_properties_token; | 138 | int update_properties_token; |
| 139 | u32 nprops; | ||
| 139 | u32 vd; | 140 | u32 vd; |
| 140 | 141 | ||
| 141 | update_properties_token = rtas_token("ibm,update-properties"); | 142 | update_properties_token = rtas_token("ibm,update-properties"); |
| @@ -146,7 +147,7 @@ static int update_dt_node(u32 phandle, s32 scope) | |||
| 146 | if (!rtas_buf) | 147 | if (!rtas_buf) |
| 147 | return -ENOMEM; | 148 | return -ENOMEM; |
| 148 | 149 | ||
| 149 | dn = of_find_node_by_phandle(phandle); | 150 | dn = of_find_node_by_phandle(be32_to_cpu(phandle)); |
| 150 | if (!dn) { | 151 | if (!dn) { |
| 151 | kfree(rtas_buf); | 152 | kfree(rtas_buf); |
| 152 | return -ENOENT; | 153 | return -ENOENT; |
| @@ -162,6 +163,7 @@ static int update_dt_node(u32 phandle, s32 scope) | |||
| 162 | break; | 163 | break; |
| 163 | 164 | ||
| 164 | prop_data = rtas_buf + sizeof(*upwa); | 165 | prop_data = rtas_buf + sizeof(*upwa); |
| 166 | nprops = be32_to_cpu(upwa->nprops); | ||
| 165 | 167 | ||
| 166 | /* On the first call to ibm,update-properties for a node the | 168 | /* On the first call to ibm,update-properties for a node the |
| 167 | * the first property value descriptor contains an empty | 169 | * the first property value descriptor contains an empty |
| @@ -170,17 +172,17 @@ static int update_dt_node(u32 phandle, s32 scope) | |||
| 170 | */ | 172 | */ |
| 171 | if (*prop_data == 0) { | 173 | if (*prop_data == 0) { |
| 172 | prop_data++; | 174 | prop_data++; |
| 173 | vd = *(u32 *)prop_data; | 175 | vd = be32_to_cpu(*(__be32 *)prop_data); |
| 174 | prop_data += vd + sizeof(vd); | 176 | prop_data += vd + sizeof(vd); |
| 175 | upwa->nprops--; | 177 | nprops--; |
| 176 | } | 178 | } |
| 177 | 179 | ||
| 178 | for (i = 0; i < upwa->nprops; i++) { | 180 | for (i = 0; i < nprops; i++) { |
| 179 | char *prop_name; | 181 | char *prop_name; |
| 180 | 182 | ||
| 181 | prop_name = prop_data; | 183 | prop_name = prop_data; |
| 182 | prop_data += strlen(prop_name) + 1; | 184 | prop_data += strlen(prop_name) + 1; |
| 183 | vd = *(u32 *)prop_data; | 185 | vd = be32_to_cpu(*(__be32 *)prop_data); |
| 184 | prop_data += sizeof(vd); | 186 | prop_data += sizeof(vd); |
| 185 | 187 | ||
| 186 | switch (vd) { | 188 | switch (vd) { |
| @@ -212,13 +214,13 @@ static int update_dt_node(u32 phandle, s32 scope) | |||
| 212 | return 0; | 214 | return 0; |
| 213 | } | 215 | } |
| 214 | 216 | ||
| 215 | static int add_dt_node(u32 parent_phandle, u32 drc_index) | 217 | static int add_dt_node(__be32 parent_phandle, __be32 drc_index) |
| 216 | { | 218 | { |
| 217 | struct device_node *dn; | 219 | struct device_node *dn; |
| 218 | struct device_node *parent_dn; | 220 | struct device_node *parent_dn; |
| 219 | int rc; | 221 | int rc; |
| 220 | 222 | ||
| 221 | parent_dn = of_find_node_by_phandle(parent_phandle); | 223 | parent_dn = of_find_node_by_phandle(be32_to_cpu(parent_phandle)); |
| 222 | if (!parent_dn) | 224 | if (!parent_dn) |
| 223 | return -ENOENT; | 225 | return -ENOENT; |
| 224 | 226 | ||
| @@ -237,7 +239,7 @@ static int add_dt_node(u32 parent_phandle, u32 drc_index) | |||
| 237 | int pseries_devicetree_update(s32 scope) | 239 | int pseries_devicetree_update(s32 scope) |
| 238 | { | 240 | { |
| 239 | char *rtas_buf; | 241 | char *rtas_buf; |
| 240 | u32 *data; | 242 | __be32 *data; |
| 241 | int update_nodes_token; | 243 | int update_nodes_token; |
| 242 | int rc; | 244 | int rc; |
| 243 | 245 | ||
| @@ -254,17 +256,17 @@ int pseries_devicetree_update(s32 scope) | |||
| 254 | if (rc && rc != 1) | 256 | if (rc && rc != 1) |
| 255 | break; | 257 | break; |
| 256 | 258 | ||
| 257 | data = (u32 *)rtas_buf + 4; | 259 | data = (__be32 *)rtas_buf + 4; |
| 258 | while (*data & NODE_ACTION_MASK) { | 260 | while (be32_to_cpu(*data) & NODE_ACTION_MASK) { |
| 259 | int i; | 261 | int i; |
| 260 | u32 action = *data & NODE_ACTION_MASK; | 262 | u32 action = be32_to_cpu(*data) & NODE_ACTION_MASK; |
| 261 | int node_count = *data & NODE_COUNT_MASK; | 263 | u32 node_count = be32_to_cpu(*data) & NODE_COUNT_MASK; |
| 262 | 264 | ||
| 263 | data++; | 265 | data++; |
| 264 | 266 | ||
| 265 | for (i = 0; i < node_count; i++) { | 267 | for (i = 0; i < node_count; i++) { |
| 266 | u32 phandle = *data++; | 268 | __be32 phandle = *data++; |
| 267 | u32 drc_index; | 269 | __be32 drc_index; |
| 268 | 270 | ||
| 269 | switch (action) { | 271 | switch (action) { |
| 270 | case DELETE_DT_NODE: | 272 | case DELETE_DT_NODE: |
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h index c9df40b5c0ac..c9c875d9ed31 100644 --- a/arch/s390/include/asm/elf.h +++ b/arch/s390/include/asm/elf.h | |||
| @@ -211,7 +211,7 @@ do { \ | |||
| 211 | 211 | ||
| 212 | extern unsigned long mmap_rnd_mask; | 212 | extern unsigned long mmap_rnd_mask; |
| 213 | 213 | ||
| 214 | #define STACK_RND_MASK (mmap_rnd_mask) | 214 | #define STACK_RND_MASK (test_thread_flag(TIF_31BIT) ? 0x7ff : mmap_rnd_mask) |
| 215 | 215 | ||
| 216 | #define ARCH_DLINFO \ | 216 | #define ARCH_DLINFO \ |
| 217 | do { \ | 217 | do { \ |
diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c index 82c19899574f..6c79f1b44fe7 100644 --- a/arch/s390/kernel/ftrace.c +++ b/arch/s390/kernel/ftrace.c | |||
| @@ -57,6 +57,44 @@ | |||
| 57 | 57 | ||
| 58 | unsigned long ftrace_plt; | 58 | unsigned long ftrace_plt; |
| 59 | 59 | ||
| 60 | static inline void ftrace_generate_orig_insn(struct ftrace_insn *insn) | ||
| 61 | { | ||
| 62 | #ifdef CC_USING_HOTPATCH | ||
| 63 | /* brcl 0,0 */ | ||
| 64 | insn->opc = 0xc004; | ||
| 65 | insn->disp = 0; | ||
| 66 | #else | ||
| 67 | /* stg r14,8(r15) */ | ||
| 68 | insn->opc = 0xe3e0; | ||
| 69 | insn->disp = 0xf0080024; | ||
| 70 | #endif | ||
| 71 | } | ||
| 72 | |||
| 73 | static inline int is_kprobe_on_ftrace(struct ftrace_insn *insn) | ||
| 74 | { | ||
| 75 | #ifdef CONFIG_KPROBES | ||
| 76 | if (insn->opc == BREAKPOINT_INSTRUCTION) | ||
| 77 | return 1; | ||
| 78 | #endif | ||
| 79 | return 0; | ||
| 80 | } | ||
| 81 | |||
| 82 | static inline void ftrace_generate_kprobe_nop_insn(struct ftrace_insn *insn) | ||
| 83 | { | ||
| 84 | #ifdef CONFIG_KPROBES | ||
| 85 | insn->opc = BREAKPOINT_INSTRUCTION; | ||
| 86 | insn->disp = KPROBE_ON_FTRACE_NOP; | ||
| 87 | #endif | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline void ftrace_generate_kprobe_call_insn(struct ftrace_insn *insn) | ||
| 91 | { | ||
| 92 | #ifdef CONFIG_KPROBES | ||
| 93 | insn->opc = BREAKPOINT_INSTRUCTION; | ||
| 94 | insn->disp = KPROBE_ON_FTRACE_CALL; | ||
| 95 | #endif | ||
| 96 | } | ||
| 97 | |||
| 60 | int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr, | 98 | int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr, |
| 61 | unsigned long addr) | 99 | unsigned long addr) |
| 62 | { | 100 | { |
| @@ -72,16 +110,9 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, | |||
| 72 | return -EFAULT; | 110 | return -EFAULT; |
| 73 | if (addr == MCOUNT_ADDR) { | 111 | if (addr == MCOUNT_ADDR) { |
| 74 | /* Initial code replacement */ | 112 | /* Initial code replacement */ |
| 75 | #ifdef CC_USING_HOTPATCH | 113 | ftrace_generate_orig_insn(&orig); |
| 76 | /* We expect to see brcl 0,0 */ | ||
| 77 | ftrace_generate_nop_insn(&orig); | ||
| 78 | #else | ||
| 79 | /* We expect to see stg r14,8(r15) */ | ||
| 80 | orig.opc = 0xe3e0; | ||
| 81 | orig.disp = 0xf0080024; | ||
| 82 | #endif | ||
| 83 | ftrace_generate_nop_insn(&new); | 114 | ftrace_generate_nop_insn(&new); |
| 84 | } else if (old.opc == BREAKPOINT_INSTRUCTION) { | 115 | } else if (is_kprobe_on_ftrace(&old)) { |
| 85 | /* | 116 | /* |
| 86 | * If we find a breakpoint instruction, a kprobe has been | 117 | * If we find a breakpoint instruction, a kprobe has been |
| 87 | * placed at the beginning of the function. We write the | 118 | * placed at the beginning of the function. We write the |
| @@ -89,9 +120,8 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, | |||
| 89 | * bytes of the original instruction so that the kprobes | 120 | * bytes of the original instruction so that the kprobes |
| 90 | * handler can execute a nop, if it reaches this breakpoint. | 121 | * handler can execute a nop, if it reaches this breakpoint. |
| 91 | */ | 122 | */ |
| 92 | new.opc = orig.opc = BREAKPOINT_INSTRUCTION; | 123 | ftrace_generate_kprobe_call_insn(&orig); |
| 93 | orig.disp = KPROBE_ON_FTRACE_CALL; | 124 | ftrace_generate_kprobe_nop_insn(&new); |
| 94 | new.disp = KPROBE_ON_FTRACE_NOP; | ||
| 95 | } else { | 125 | } else { |
| 96 | /* Replace ftrace call with a nop. */ | 126 | /* Replace ftrace call with a nop. */ |
| 97 | ftrace_generate_call_insn(&orig, rec->ip); | 127 | ftrace_generate_call_insn(&orig, rec->ip); |
| @@ -111,7 +141,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) | |||
| 111 | 141 | ||
| 112 | if (probe_kernel_read(&old, (void *) rec->ip, sizeof(old))) | 142 | if (probe_kernel_read(&old, (void *) rec->ip, sizeof(old))) |
| 113 | return -EFAULT; | 143 | return -EFAULT; |
| 114 | if (old.opc == BREAKPOINT_INSTRUCTION) { | 144 | if (is_kprobe_on_ftrace(&old)) { |
| 115 | /* | 145 | /* |
| 116 | * If we find a breakpoint instruction, a kprobe has been | 146 | * If we find a breakpoint instruction, a kprobe has been |
| 117 | * placed at the beginning of the function. We write the | 147 | * placed at the beginning of the function. We write the |
| @@ -119,9 +149,8 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) | |||
| 119 | * bytes of the original instruction so that the kprobes | 149 | * bytes of the original instruction so that the kprobes |
| 120 | * handler can execute a brasl if it reaches this breakpoint. | 150 | * handler can execute a brasl if it reaches this breakpoint. |
| 121 | */ | 151 | */ |
| 122 | new.opc = orig.opc = BREAKPOINT_INSTRUCTION; | 152 | ftrace_generate_kprobe_nop_insn(&orig); |
| 123 | orig.disp = KPROBE_ON_FTRACE_NOP; | 153 | ftrace_generate_kprobe_call_insn(&new); |
| 124 | new.disp = KPROBE_ON_FTRACE_CALL; | ||
| 125 | } else { | 154 | } else { |
| 126 | /* Replace nop with an ftrace call. */ | 155 | /* Replace nop with an ftrace call. */ |
| 127 | ftrace_generate_nop_insn(&orig); | 156 | ftrace_generate_nop_insn(&orig); |
diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c index c3f8d157cb0d..e6a1578fc000 100644 --- a/arch/s390/kernel/perf_cpum_sf.c +++ b/arch/s390/kernel/perf_cpum_sf.c | |||
| @@ -1415,7 +1415,7 @@ CPUMF_EVENT_ATTR(SF, SF_CYCLES_BASIC_DIAG, PERF_EVENT_CPUM_SF_DIAG); | |||
| 1415 | 1415 | ||
| 1416 | static struct attribute *cpumsf_pmu_events_attr[] = { | 1416 | static struct attribute *cpumsf_pmu_events_attr[] = { |
| 1417 | CPUMF_EVENT_PTR(SF, SF_CYCLES_BASIC), | 1417 | CPUMF_EVENT_PTR(SF, SF_CYCLES_BASIC), |
| 1418 | CPUMF_EVENT_PTR(SF, SF_CYCLES_BASIC_DIAG), | 1418 | NULL, |
| 1419 | NULL, | 1419 | NULL, |
| 1420 | }; | 1420 | }; |
| 1421 | 1421 | ||
| @@ -1606,8 +1606,11 @@ static int __init init_cpum_sampling_pmu(void) | |||
| 1606 | return -EINVAL; | 1606 | return -EINVAL; |
| 1607 | } | 1607 | } |
| 1608 | 1608 | ||
| 1609 | if (si.ad) | 1609 | if (si.ad) { |
| 1610 | sfb_set_limits(CPUM_SF_MIN_SDB, CPUM_SF_MAX_SDB); | 1610 | sfb_set_limits(CPUM_SF_MIN_SDB, CPUM_SF_MAX_SDB); |
| 1611 | cpumsf_pmu_events_attr[1] = | ||
| 1612 | CPUMF_EVENT_PTR(SF, SF_CYCLES_BASIC_DIAG); | ||
| 1613 | } | ||
| 1611 | 1614 | ||
| 1612 | sfdbg = debug_register(KMSG_COMPONENT, 2, 1, 80); | 1615 | sfdbg = debug_register(KMSG_COMPONENT, 2, 1, 80); |
| 1613 | if (!sfdbg) | 1616 | if (!sfdbg) |
diff --git a/arch/s390/kernel/swsusp_asm64.S b/arch/s390/kernel/swsusp_asm64.S index 6b09fdffbd2f..ca6294645dd3 100644 --- a/arch/s390/kernel/swsusp_asm64.S +++ b/arch/s390/kernel/swsusp_asm64.S | |||
| @@ -177,6 +177,17 @@ restart_entry: | |||
| 177 | lhi %r1,1 | 177 | lhi %r1,1 |
| 178 | sigp %r1,%r0,SIGP_SET_ARCHITECTURE | 178 | sigp %r1,%r0,SIGP_SET_ARCHITECTURE |
| 179 | sam64 | 179 | sam64 |
| 180 | #ifdef CONFIG_SMP | ||
| 181 | larl %r1,smp_cpu_mt_shift | ||
| 182 | icm %r1,15,0(%r1) | ||
| 183 | jz smt_done | ||
| 184 | llgfr %r1,%r1 | ||
| 185 | smt_loop: | ||
| 186 | sigp %r1,%r0,SIGP_SET_MULTI_THREADING | ||
| 187 | brc 8,smt_done /* accepted */ | ||
| 188 | brc 2,smt_loop /* busy, try again */ | ||
| 189 | smt_done: | ||
| 190 | #endif | ||
| 180 | larl %r1,.Lnew_pgm_check_psw | 191 | larl %r1,.Lnew_pgm_check_psw |
| 181 | lpswe 0(%r1) | 192 | lpswe 0(%r1) |
| 182 | pgm_check_entry: | 193 | pgm_check_entry: |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 1d74d161687c..2babb393915e 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
| @@ -364,12 +364,21 @@ system_call_fastpath: | |||
| 364 | * Has incomplete stack frame and undefined top of stack. | 364 | * Has incomplete stack frame and undefined top of stack. |
| 365 | */ | 365 | */ |
| 366 | ret_from_sys_call: | 366 | ret_from_sys_call: |
| 367 | testl $_TIF_ALLWORK_MASK,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) | ||
| 368 | jnz int_ret_from_sys_call_fixup /* Go the the slow path */ | ||
| 369 | |||
| 370 | LOCKDEP_SYS_EXIT | 367 | LOCKDEP_SYS_EXIT |
| 371 | DISABLE_INTERRUPTS(CLBR_NONE) | 368 | DISABLE_INTERRUPTS(CLBR_NONE) |
| 372 | TRACE_IRQS_OFF | 369 | TRACE_IRQS_OFF |
| 370 | |||
| 371 | /* | ||
| 372 | * We must check ti flags with interrupts (or at least preemption) | ||
| 373 | * off because we must *never* return to userspace without | ||
| 374 | * processing exit work that is enqueued if we're preempted here. | ||
| 375 | * In particular, returning to userspace with any of the one-shot | ||
| 376 | * flags (TIF_NOTIFY_RESUME, TIF_USER_RETURN_NOTIFY, etc) set is | ||
| 377 | * very bad. | ||
| 378 | */ | ||
| 379 | testl $_TIF_ALLWORK_MASK,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) | ||
| 380 | jnz int_ret_from_sys_call_fixup /* Go the the slow path */ | ||
| 381 | |||
| 373 | CFI_REMEMBER_STATE | 382 | CFI_REMEMBER_STATE |
| 374 | /* | 383 | /* |
| 375 | * sysretq will re-enable interrupts: | 384 | * sysretq will re-enable interrupts: |
| @@ -386,7 +395,7 @@ ret_from_sys_call: | |||
| 386 | 395 | ||
| 387 | int_ret_from_sys_call_fixup: | 396 | int_ret_from_sys_call_fixup: |
| 388 | FIXUP_TOP_OF_STACK %r11, -ARGOFFSET | 397 | FIXUP_TOP_OF_STACK %r11, -ARGOFFSET |
| 389 | jmp int_ret_from_sys_call | 398 | jmp int_ret_from_sys_call_irqs_off |
| 390 | 399 | ||
| 391 | /* Do syscall tracing */ | 400 | /* Do syscall tracing */ |
| 392 | tracesys: | 401 | tracesys: |
| @@ -432,6 +441,7 @@ tracesys_phase2: | |||
| 432 | GLOBAL(int_ret_from_sys_call) | 441 | GLOBAL(int_ret_from_sys_call) |
| 433 | DISABLE_INTERRUPTS(CLBR_NONE) | 442 | DISABLE_INTERRUPTS(CLBR_NONE) |
| 434 | TRACE_IRQS_OFF | 443 | TRACE_IRQS_OFF |
| 444 | int_ret_from_sys_call_irqs_off: | ||
| 435 | movl $_TIF_ALLWORK_MASK,%edi | 445 | movl $_TIF_ALLWORK_MASK,%edi |
| 436 | /* edi: mask to check */ | 446 | /* edi: mask to check */ |
| 437 | GLOBAL(int_with_check) | 447 | GLOBAL(int_with_check) |
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c index b1947e0f3e10..46d4449772bc 100644 --- a/arch/x86/kvm/ioapic.c +++ b/arch/x86/kvm/ioapic.c | |||
| @@ -422,6 +422,7 @@ static void __kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu, | |||
| 422 | struct kvm_ioapic *ioapic, int vector, int trigger_mode) | 422 | struct kvm_ioapic *ioapic, int vector, int trigger_mode) |
| 423 | { | 423 | { |
| 424 | int i; | 424 | int i; |
| 425 | struct kvm_lapic *apic = vcpu->arch.apic; | ||
| 425 | 426 | ||
| 426 | for (i = 0; i < IOAPIC_NUM_PINS; i++) { | 427 | for (i = 0; i < IOAPIC_NUM_PINS; i++) { |
| 427 | union kvm_ioapic_redirect_entry *ent = &ioapic->redirtbl[i]; | 428 | union kvm_ioapic_redirect_entry *ent = &ioapic->redirtbl[i]; |
| @@ -443,7 +444,8 @@ static void __kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu, | |||
| 443 | kvm_notify_acked_irq(ioapic->kvm, KVM_IRQCHIP_IOAPIC, i); | 444 | kvm_notify_acked_irq(ioapic->kvm, KVM_IRQCHIP_IOAPIC, i); |
| 444 | spin_lock(&ioapic->lock); | 445 | spin_lock(&ioapic->lock); |
| 445 | 446 | ||
| 446 | if (trigger_mode != IOAPIC_LEVEL_TRIG) | 447 | if (trigger_mode != IOAPIC_LEVEL_TRIG || |
| 448 | kvm_apic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI) | ||
| 447 | continue; | 449 | continue; |
| 448 | 450 | ||
| 449 | ASSERT(ent->fields.trig_mode == IOAPIC_LEVEL_TRIG); | 451 | ASSERT(ent->fields.trig_mode == IOAPIC_LEVEL_TRIG); |
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index bd4e34de24c7..4ee827d7bf36 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c | |||
| @@ -833,8 +833,7 @@ int kvm_apic_compare_prio(struct kvm_vcpu *vcpu1, struct kvm_vcpu *vcpu2) | |||
| 833 | 833 | ||
| 834 | static void kvm_ioapic_send_eoi(struct kvm_lapic *apic, int vector) | 834 | static void kvm_ioapic_send_eoi(struct kvm_lapic *apic, int vector) |
| 835 | { | 835 | { |
| 836 | if (!(kvm_apic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI) && | 836 | if (kvm_ioapic_handles_vector(apic->vcpu->kvm, vector)) { |
| 837 | kvm_ioapic_handles_vector(apic->vcpu->kvm, vector)) { | ||
| 838 | int trigger_mode; | 837 | int trigger_mode; |
| 839 | if (apic_test_vector(vector, apic->regs + APIC_TMR)) | 838 | if (apic_test_vector(vector, apic->regs + APIC_TMR)) |
| 840 | trigger_mode = IOAPIC_LEVEL_TRIG; | 839 | trigger_mode = IOAPIC_LEVEL_TRIG; |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 10a481b7674d..ae4f6d35d19c 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
| @@ -2479,8 +2479,7 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx) | |||
| 2479 | if (enable_ept) { | 2479 | if (enable_ept) { |
| 2480 | /* nested EPT: emulate EPT also to L1 */ | 2480 | /* nested EPT: emulate EPT also to L1 */ |
| 2481 | vmx->nested.nested_vmx_secondary_ctls_high |= | 2481 | vmx->nested.nested_vmx_secondary_ctls_high |= |
| 2482 | SECONDARY_EXEC_ENABLE_EPT | | 2482 | SECONDARY_EXEC_ENABLE_EPT; |
| 2483 | SECONDARY_EXEC_UNRESTRICTED_GUEST; | ||
| 2484 | vmx->nested.nested_vmx_ept_caps = VMX_EPT_PAGE_WALK_4_BIT | | 2483 | vmx->nested.nested_vmx_ept_caps = VMX_EPT_PAGE_WALK_4_BIT | |
| 2485 | VMX_EPTP_WB_BIT | VMX_EPT_2MB_PAGE_BIT | | 2484 | VMX_EPTP_WB_BIT | VMX_EPT_2MB_PAGE_BIT | |
| 2486 | VMX_EPT_INVEPT_BIT; | 2485 | VMX_EPT_INVEPT_BIT; |
| @@ -2494,6 +2493,10 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx) | |||
| 2494 | } else | 2493 | } else |
| 2495 | vmx->nested.nested_vmx_ept_caps = 0; | 2494 | vmx->nested.nested_vmx_ept_caps = 0; |
| 2496 | 2495 | ||
| 2496 | if (enable_unrestricted_guest) | ||
| 2497 | vmx->nested.nested_vmx_secondary_ctls_high |= | ||
| 2498 | SECONDARY_EXEC_UNRESTRICTED_GUEST; | ||
| 2499 | |||
| 2497 | /* miscellaneous data */ | 2500 | /* miscellaneous data */ |
| 2498 | rdmsr(MSR_IA32_VMX_MISC, | 2501 | rdmsr(MSR_IA32_VMX_MISC, |
| 2499 | vmx->nested.nested_vmx_misc_low, | 2502 | vmx->nested.nested_vmx_misc_low, |
diff --git a/block/blk-merge.c b/block/blk-merge.c index fc1ff3b1ea1f..fd3fee81c23c 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c | |||
| @@ -592,7 +592,7 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio) | |||
| 592 | if (q->queue_flags & (1 << QUEUE_FLAG_SG_GAPS)) { | 592 | if (q->queue_flags & (1 << QUEUE_FLAG_SG_GAPS)) { |
| 593 | struct bio_vec *bprev; | 593 | struct bio_vec *bprev; |
| 594 | 594 | ||
| 595 | bprev = &rq->biotail->bi_io_vec[bio->bi_vcnt - 1]; | 595 | bprev = &rq->biotail->bi_io_vec[rq->biotail->bi_vcnt - 1]; |
| 596 | if (bvec_gap_to_prev(bprev, bio->bi_io_vec[0].bv_offset)) | 596 | if (bvec_gap_to_prev(bprev, bio->bi_io_vec[0].bv_offset)) |
| 597 | return false; | 597 | return false; |
| 598 | } | 598 | } |
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index d53a764b05ea..be3290cc0644 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c | |||
| @@ -278,9 +278,11 @@ static int bt_get(struct blk_mq_alloc_data *data, | |||
| 278 | /* | 278 | /* |
| 279 | * We're out of tags on this hardware queue, kick any | 279 | * We're out of tags on this hardware queue, kick any |
| 280 | * pending IO submits before going to sleep waiting for | 280 | * pending IO submits before going to sleep waiting for |
| 281 | * some to complete. | 281 | * some to complete. Note that hctx can be NULL here for |
| 282 | * reserved tag allocation. | ||
| 282 | */ | 283 | */ |
| 283 | blk_mq_run_hw_queue(hctx, false); | 284 | if (hctx) |
| 285 | blk_mq_run_hw_queue(hctx, false); | ||
| 284 | 286 | ||
| 285 | /* | 287 | /* |
| 286 | * Retry tag allocation after running the hardware queue, | 288 | * Retry tag allocation after running the hardware queue, |
diff --git a/block/blk-mq.c b/block/blk-mq.c index 4f4bea21052e..b7b8933ec241 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
| @@ -1938,7 +1938,7 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) | |||
| 1938 | */ | 1938 | */ |
| 1939 | if (percpu_ref_init(&q->mq_usage_counter, blk_mq_usage_counter_release, | 1939 | if (percpu_ref_init(&q->mq_usage_counter, blk_mq_usage_counter_release, |
| 1940 | PERCPU_REF_INIT_ATOMIC, GFP_KERNEL)) | 1940 | PERCPU_REF_INIT_ATOMIC, GFP_KERNEL)) |
| 1941 | goto err_map; | 1941 | goto err_mq_usage; |
| 1942 | 1942 | ||
| 1943 | setup_timer(&q->timeout, blk_mq_rq_timer, (unsigned long) q); | 1943 | setup_timer(&q->timeout, blk_mq_rq_timer, (unsigned long) q); |
| 1944 | blk_queue_rq_timeout(q, 30000); | 1944 | blk_queue_rq_timeout(q, 30000); |
| @@ -1981,7 +1981,7 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) | |||
| 1981 | blk_mq_init_cpu_queues(q, set->nr_hw_queues); | 1981 | blk_mq_init_cpu_queues(q, set->nr_hw_queues); |
| 1982 | 1982 | ||
| 1983 | if (blk_mq_init_hw_queues(q, set)) | 1983 | if (blk_mq_init_hw_queues(q, set)) |
| 1984 | goto err_hw; | 1984 | goto err_mq_usage; |
| 1985 | 1985 | ||
| 1986 | mutex_lock(&all_q_mutex); | 1986 | mutex_lock(&all_q_mutex); |
| 1987 | list_add_tail(&q->all_q_node, &all_q_list); | 1987 | list_add_tail(&q->all_q_node, &all_q_list); |
| @@ -1993,7 +1993,7 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) | |||
| 1993 | 1993 | ||
| 1994 | return q; | 1994 | return q; |
| 1995 | 1995 | ||
| 1996 | err_hw: | 1996 | err_mq_usage: |
| 1997 | blk_cleanup_queue(q); | 1997 | blk_cleanup_queue(q); |
| 1998 | err_hctxs: | 1998 | err_hctxs: |
| 1999 | kfree(map); | 1999 | kfree(map); |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 4c35f0822d06..ef150ebb4c30 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
| @@ -4737,7 +4737,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev, int tag) | |||
| 4737 | return NULL; | 4737 | return NULL; |
| 4738 | 4738 | ||
| 4739 | /* libsas case */ | 4739 | /* libsas case */ |
| 4740 | if (!ap->scsi_host) { | 4740 | if (ap->flags & ATA_FLAG_SAS_HOST) { |
| 4741 | tag = ata_sas_allocate_tag(ap); | 4741 | tag = ata_sas_allocate_tag(ap); |
| 4742 | if (tag < 0) | 4742 | if (tag < 0) |
| 4743 | return NULL; | 4743 | return NULL; |
| @@ -4776,7 +4776,7 @@ void ata_qc_free(struct ata_queued_cmd *qc) | |||
| 4776 | tag = qc->tag; | 4776 | tag = qc->tag; |
| 4777 | if (likely(ata_tag_valid(tag))) { | 4777 | if (likely(ata_tag_valid(tag))) { |
| 4778 | qc->tag = ATA_TAG_POISON; | 4778 | qc->tag = ATA_TAG_POISON; |
| 4779 | if (!ap->scsi_host) | 4779 | if (ap->flags & ATA_FLAG_SAS_HOST) |
| 4780 | ata_sas_free_tag(tag, ap); | 4780 | ata_sas_free_tag(tag, ap); |
| 4781 | } | 4781 | } |
| 4782 | } | 4782 | } |
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h index beb8b27d4621..a13587b5c2be 100644 --- a/drivers/base/regmap/internal.h +++ b/drivers/base/regmap/internal.h | |||
| @@ -243,4 +243,12 @@ extern struct regcache_ops regcache_rbtree_ops; | |||
| 243 | extern struct regcache_ops regcache_lzo_ops; | 243 | extern struct regcache_ops regcache_lzo_ops; |
| 244 | extern struct regcache_ops regcache_flat_ops; | 244 | extern struct regcache_ops regcache_flat_ops; |
| 245 | 245 | ||
| 246 | static inline const char *regmap_name(const struct regmap *map) | ||
| 247 | { | ||
| 248 | if (map->dev) | ||
| 249 | return dev_name(map->dev); | ||
| 250 | |||
| 251 | return map->name; | ||
| 252 | } | ||
| 253 | |||
| 246 | #endif | 254 | #endif |
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index da84f544c544..87db9893b463 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c | |||
| @@ -218,7 +218,7 @@ int regcache_read(struct regmap *map, | |||
| 218 | ret = map->cache_ops->read(map, reg, value); | 218 | ret = map->cache_ops->read(map, reg, value); |
| 219 | 219 | ||
| 220 | if (ret == 0) | 220 | if (ret == 0) |
| 221 | trace_regmap_reg_read_cache(map->dev, reg, *value); | 221 | trace_regmap_reg_read_cache(map, reg, *value); |
| 222 | 222 | ||
| 223 | return ret; | 223 | return ret; |
| 224 | } | 224 | } |
| @@ -311,7 +311,7 @@ int regcache_sync(struct regmap *map) | |||
| 311 | dev_dbg(map->dev, "Syncing %s cache\n", | 311 | dev_dbg(map->dev, "Syncing %s cache\n", |
| 312 | map->cache_ops->name); | 312 | map->cache_ops->name); |
| 313 | name = map->cache_ops->name; | 313 | name = map->cache_ops->name; |
| 314 | trace_regcache_sync(map->dev, name, "start"); | 314 | trace_regcache_sync(map, name, "start"); |
| 315 | 315 | ||
| 316 | if (!map->cache_dirty) | 316 | if (!map->cache_dirty) |
| 317 | goto out; | 317 | goto out; |
| @@ -346,7 +346,7 @@ out: | |||
| 346 | 346 | ||
| 347 | regmap_async_complete(map); | 347 | regmap_async_complete(map); |
| 348 | 348 | ||
| 349 | trace_regcache_sync(map->dev, name, "stop"); | 349 | trace_regcache_sync(map, name, "stop"); |
| 350 | 350 | ||
| 351 | return ret; | 351 | return ret; |
| 352 | } | 352 | } |
| @@ -381,7 +381,7 @@ int regcache_sync_region(struct regmap *map, unsigned int min, | |||
| 381 | name = map->cache_ops->name; | 381 | name = map->cache_ops->name; |
| 382 | dev_dbg(map->dev, "Syncing %s cache from %d-%d\n", name, min, max); | 382 | dev_dbg(map->dev, "Syncing %s cache from %d-%d\n", name, min, max); |
| 383 | 383 | ||
| 384 | trace_regcache_sync(map->dev, name, "start region"); | 384 | trace_regcache_sync(map, name, "start region"); |
| 385 | 385 | ||
| 386 | if (!map->cache_dirty) | 386 | if (!map->cache_dirty) |
| 387 | goto out; | 387 | goto out; |
| @@ -401,7 +401,7 @@ out: | |||
| 401 | 401 | ||
| 402 | regmap_async_complete(map); | 402 | regmap_async_complete(map); |
| 403 | 403 | ||
| 404 | trace_regcache_sync(map->dev, name, "stop region"); | 404 | trace_regcache_sync(map, name, "stop region"); |
| 405 | 405 | ||
| 406 | return ret; | 406 | return ret; |
| 407 | } | 407 | } |
| @@ -428,7 +428,7 @@ int regcache_drop_region(struct regmap *map, unsigned int min, | |||
| 428 | 428 | ||
| 429 | map->lock(map->lock_arg); | 429 | map->lock(map->lock_arg); |
| 430 | 430 | ||
| 431 | trace_regcache_drop_region(map->dev, min, max); | 431 | trace_regcache_drop_region(map, min, max); |
| 432 | 432 | ||
| 433 | ret = map->cache_ops->drop(map, min, max); | 433 | ret = map->cache_ops->drop(map, min, max); |
| 434 | 434 | ||
| @@ -455,7 +455,7 @@ void regcache_cache_only(struct regmap *map, bool enable) | |||
| 455 | map->lock(map->lock_arg); | 455 | map->lock(map->lock_arg); |
| 456 | WARN_ON(map->cache_bypass && enable); | 456 | WARN_ON(map->cache_bypass && enable); |
| 457 | map->cache_only = enable; | 457 | map->cache_only = enable; |
| 458 | trace_regmap_cache_only(map->dev, enable); | 458 | trace_regmap_cache_only(map, enable); |
| 459 | map->unlock(map->lock_arg); | 459 | map->unlock(map->lock_arg); |
| 460 | } | 460 | } |
| 461 | EXPORT_SYMBOL_GPL(regcache_cache_only); | 461 | EXPORT_SYMBOL_GPL(regcache_cache_only); |
| @@ -493,7 +493,7 @@ void regcache_cache_bypass(struct regmap *map, bool enable) | |||
| 493 | map->lock(map->lock_arg); | 493 | map->lock(map->lock_arg); |
| 494 | WARN_ON(map->cache_only && enable); | 494 | WARN_ON(map->cache_only && enable); |
| 495 | map->cache_bypass = enable; | 495 | map->cache_bypass = enable; |
| 496 | trace_regmap_cache_bypass(map->dev, enable); | 496 | trace_regmap_cache_bypass(map, enable); |
| 497 | map->unlock(map->lock_arg); | 497 | map->unlock(map->lock_arg); |
| 498 | } | 498 | } |
| 499 | EXPORT_SYMBOL_GPL(regcache_cache_bypass); | 499 | EXPORT_SYMBOL_GPL(regcache_cache_bypass); |
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index f99b098ddabf..dbfe6a69c3da 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c | |||
| @@ -1281,7 +1281,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg, | |||
| 1281 | if (map->async && map->bus->async_write) { | 1281 | if (map->async && map->bus->async_write) { |
| 1282 | struct regmap_async *async; | 1282 | struct regmap_async *async; |
| 1283 | 1283 | ||
| 1284 | trace_regmap_async_write_start(map->dev, reg, val_len); | 1284 | trace_regmap_async_write_start(map, reg, val_len); |
| 1285 | 1285 | ||
| 1286 | spin_lock_irqsave(&map->async_lock, flags); | 1286 | spin_lock_irqsave(&map->async_lock, flags); |
| 1287 | async = list_first_entry_or_null(&map->async_free, | 1287 | async = list_first_entry_or_null(&map->async_free, |
| @@ -1339,8 +1339,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg, | |||
| 1339 | return ret; | 1339 | return ret; |
| 1340 | } | 1340 | } |
| 1341 | 1341 | ||
| 1342 | trace_regmap_hw_write_start(map->dev, reg, | 1342 | trace_regmap_hw_write_start(map, reg, val_len / map->format.val_bytes); |
| 1343 | val_len / map->format.val_bytes); | ||
| 1344 | 1343 | ||
| 1345 | /* If we're doing a single register write we can probably just | 1344 | /* If we're doing a single register write we can probably just |
| 1346 | * send the work_buf directly, otherwise try to do a gather | 1345 | * send the work_buf directly, otherwise try to do a gather |
| @@ -1372,8 +1371,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg, | |||
| 1372 | kfree(buf); | 1371 | kfree(buf); |
| 1373 | } | 1372 | } |
| 1374 | 1373 | ||
| 1375 | trace_regmap_hw_write_done(map->dev, reg, | 1374 | trace_regmap_hw_write_done(map, reg, val_len / map->format.val_bytes); |
| 1376 | val_len / map->format.val_bytes); | ||
| 1377 | 1375 | ||
| 1378 | return ret; | 1376 | return ret; |
| 1379 | } | 1377 | } |
| @@ -1407,12 +1405,12 @@ static int _regmap_bus_formatted_write(void *context, unsigned int reg, | |||
| 1407 | 1405 | ||
| 1408 | map->format.format_write(map, reg, val); | 1406 | map->format.format_write(map, reg, val); |
| 1409 | 1407 | ||
| 1410 | trace_regmap_hw_write_start(map->dev, reg, 1); | 1408 | trace_regmap_hw_write_start(map, reg, 1); |
| 1411 | 1409 | ||
| 1412 | ret = map->bus->write(map->bus_context, map->work_buf, | 1410 | ret = map->bus->write(map->bus_context, map->work_buf, |
| 1413 | map->format.buf_size); | 1411 | map->format.buf_size); |
| 1414 | 1412 | ||
| 1415 | trace_regmap_hw_write_done(map->dev, reg, 1); | 1413 | trace_regmap_hw_write_done(map, reg, 1); |
| 1416 | 1414 | ||
| 1417 | return ret; | 1415 | return ret; |
| 1418 | } | 1416 | } |
| @@ -1470,7 +1468,7 @@ int _regmap_write(struct regmap *map, unsigned int reg, | |||
| 1470 | dev_info(map->dev, "%x <= %x\n", reg, val); | 1468 | dev_info(map->dev, "%x <= %x\n", reg, val); |
| 1471 | #endif | 1469 | #endif |
| 1472 | 1470 | ||
| 1473 | trace_regmap_reg_write(map->dev, reg, val); | 1471 | trace_regmap_reg_write(map, reg, val); |
| 1474 | 1472 | ||
| 1475 | return map->reg_write(context, reg, val); | 1473 | return map->reg_write(context, reg, val); |
| 1476 | } | 1474 | } |
| @@ -1773,7 +1771,7 @@ static int _regmap_raw_multi_reg_write(struct regmap *map, | |||
| 1773 | for (i = 0; i < num_regs; i++) { | 1771 | for (i = 0; i < num_regs; i++) { |
| 1774 | int reg = regs[i].reg; | 1772 | int reg = regs[i].reg; |
| 1775 | int val = regs[i].def; | 1773 | int val = regs[i].def; |
| 1776 | trace_regmap_hw_write_start(map->dev, reg, 1); | 1774 | trace_regmap_hw_write_start(map, reg, 1); |
| 1777 | map->format.format_reg(u8, reg, map->reg_shift); | 1775 | map->format.format_reg(u8, reg, map->reg_shift); |
| 1778 | u8 += reg_bytes + pad_bytes; | 1776 | u8 += reg_bytes + pad_bytes; |
| 1779 | map->format.format_val(u8, val, 0); | 1777 | map->format.format_val(u8, val, 0); |
| @@ -1788,7 +1786,7 @@ static int _regmap_raw_multi_reg_write(struct regmap *map, | |||
| 1788 | 1786 | ||
| 1789 | for (i = 0; i < num_regs; i++) { | 1787 | for (i = 0; i < num_regs; i++) { |
| 1790 | int reg = regs[i].reg; | 1788 | int reg = regs[i].reg; |
| 1791 | trace_regmap_hw_write_done(map->dev, reg, 1); | 1789 | trace_regmap_hw_write_done(map, reg, 1); |
| 1792 | } | 1790 | } |
| 1793 | return ret; | 1791 | return ret; |
| 1794 | } | 1792 | } |
| @@ -2059,15 +2057,13 @@ static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val, | |||
| 2059 | */ | 2057 | */ |
| 2060 | u8[0] |= map->read_flag_mask; | 2058 | u8[0] |= map->read_flag_mask; |
| 2061 | 2059 | ||
| 2062 | trace_regmap_hw_read_start(map->dev, reg, | 2060 | trace_regmap_hw_read_start(map, reg, val_len / map->format.val_bytes); |
| 2063 | val_len / map->format.val_bytes); | ||
| 2064 | 2061 | ||
| 2065 | ret = map->bus->read(map->bus_context, map->work_buf, | 2062 | ret = map->bus->read(map->bus_context, map->work_buf, |
| 2066 | map->format.reg_bytes + map->format.pad_bytes, | 2063 | map->format.reg_bytes + map->format.pad_bytes, |
| 2067 | val, val_len); | 2064 | val, val_len); |
| 2068 | 2065 | ||
| 2069 | trace_regmap_hw_read_done(map->dev, reg, | 2066 | trace_regmap_hw_read_done(map, reg, val_len / map->format.val_bytes); |
| 2070 | val_len / map->format.val_bytes); | ||
| 2071 | 2067 | ||
| 2072 | return ret; | 2068 | return ret; |
| 2073 | } | 2069 | } |
| @@ -2123,7 +2119,7 @@ static int _regmap_read(struct regmap *map, unsigned int reg, | |||
| 2123 | dev_info(map->dev, "%x => %x\n", reg, *val); | 2119 | dev_info(map->dev, "%x => %x\n", reg, *val); |
| 2124 | #endif | 2120 | #endif |
| 2125 | 2121 | ||
| 2126 | trace_regmap_reg_read(map->dev, reg, *val); | 2122 | trace_regmap_reg_read(map, reg, *val); |
| 2127 | 2123 | ||
| 2128 | if (!map->cache_bypass) | 2124 | if (!map->cache_bypass) |
| 2129 | regcache_write(map, reg, *val); | 2125 | regcache_write(map, reg, *val); |
| @@ -2480,7 +2476,7 @@ void regmap_async_complete_cb(struct regmap_async *async, int ret) | |||
| 2480 | struct regmap *map = async->map; | 2476 | struct regmap *map = async->map; |
| 2481 | bool wake; | 2477 | bool wake; |
| 2482 | 2478 | ||
| 2483 | trace_regmap_async_io_complete(map->dev); | 2479 | trace_regmap_async_io_complete(map); |
| 2484 | 2480 | ||
| 2485 | spin_lock(&map->async_lock); | 2481 | spin_lock(&map->async_lock); |
| 2486 | list_move(&async->list, &map->async_free); | 2482 | list_move(&async->list, &map->async_free); |
| @@ -2525,7 +2521,7 @@ int regmap_async_complete(struct regmap *map) | |||
| 2525 | if (!map->bus || !map->bus->async_write) | 2521 | if (!map->bus || !map->bus->async_write) |
| 2526 | return 0; | 2522 | return 0; |
| 2527 | 2523 | ||
| 2528 | trace_regmap_async_complete_start(map->dev); | 2524 | trace_regmap_async_complete_start(map); |
| 2529 | 2525 | ||
| 2530 | wait_event(map->async_waitq, regmap_async_is_done(map)); | 2526 | wait_event(map->async_waitq, regmap_async_is_done(map)); |
| 2531 | 2527 | ||
| @@ -2534,7 +2530,7 @@ int regmap_async_complete(struct regmap *map) | |||
| 2534 | map->async_ret = 0; | 2530 | map->async_ret = 0; |
| 2535 | spin_unlock_irqrestore(&map->async_lock, flags); | 2531 | spin_unlock_irqrestore(&map->async_lock, flags); |
| 2536 | 2532 | ||
| 2537 | trace_regmap_async_complete_done(map->dev); | 2533 | trace_regmap_async_complete_done(map); |
| 2538 | 2534 | ||
| 2539 | return ret; | 2535 | return ret; |
| 2540 | } | 2536 | } |
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 4bc2a5cb9935..a98c41f72c63 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
| @@ -803,10 +803,6 @@ static int __init nbd_init(void) | |||
| 803 | return -EINVAL; | 803 | return -EINVAL; |
| 804 | } | 804 | } |
| 805 | 805 | ||
| 806 | nbd_dev = kcalloc(nbds_max, sizeof(*nbd_dev), GFP_KERNEL); | ||
| 807 | if (!nbd_dev) | ||
| 808 | return -ENOMEM; | ||
| 809 | |||
| 810 | part_shift = 0; | 806 | part_shift = 0; |
| 811 | if (max_part > 0) { | 807 | if (max_part > 0) { |
| 812 | part_shift = fls(max_part); | 808 | part_shift = fls(max_part); |
| @@ -828,6 +824,10 @@ static int __init nbd_init(void) | |||
| 828 | if (nbds_max > 1UL << (MINORBITS - part_shift)) | 824 | if (nbds_max > 1UL << (MINORBITS - part_shift)) |
| 829 | return -EINVAL; | 825 | return -EINVAL; |
| 830 | 826 | ||
| 827 | nbd_dev = kcalloc(nbds_max, sizeof(*nbd_dev), GFP_KERNEL); | ||
| 828 | if (!nbd_dev) | ||
| 829 | return -ENOMEM; | ||
| 830 | |||
| 831 | for (i = 0; i < nbds_max; i++) { | 831 | for (i = 0; i < nbds_max; i++) { |
| 832 | struct gendisk *disk = alloc_disk(1 << part_shift); | 832 | struct gendisk *disk = alloc_disk(1 << part_shift); |
| 833 | if (!disk) | 833 | if (!disk) |
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index ceb32dd52a6c..e23be20a3417 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c | |||
| @@ -3003,6 +3003,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 3003 | } | 3003 | } |
| 3004 | get_device(dev->device); | 3004 | get_device(dev->device); |
| 3005 | 3005 | ||
| 3006 | INIT_LIST_HEAD(&dev->node); | ||
| 3006 | INIT_WORK(&dev->probe_work, nvme_async_probe); | 3007 | INIT_WORK(&dev->probe_work, nvme_async_probe); |
| 3007 | schedule_work(&dev->probe_work); | 3008 | schedule_work(&dev->probe_work); |
| 3008 | return 0; | 3009 | return 0; |
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 68161f7a07d6..a0b036ccb118 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig | |||
| @@ -192,6 +192,7 @@ config SYS_SUPPORTS_EM_STI | |||
| 192 | config SH_TIMER_CMT | 192 | config SH_TIMER_CMT |
| 193 | bool "Renesas CMT timer driver" if COMPILE_TEST | 193 | bool "Renesas CMT timer driver" if COMPILE_TEST |
| 194 | depends on GENERIC_CLOCKEVENTS | 194 | depends on GENERIC_CLOCKEVENTS |
| 195 | depends on HAS_IOMEM | ||
| 195 | default SYS_SUPPORTS_SH_CMT | 196 | default SYS_SUPPORTS_SH_CMT |
| 196 | help | 197 | help |
| 197 | This enables build of a clocksource and clockevent driver for | 198 | This enables build of a clocksource and clockevent driver for |
| @@ -201,6 +202,7 @@ config SH_TIMER_CMT | |||
| 201 | config SH_TIMER_MTU2 | 202 | config SH_TIMER_MTU2 |
| 202 | bool "Renesas MTU2 timer driver" if COMPILE_TEST | 203 | bool "Renesas MTU2 timer driver" if COMPILE_TEST |
| 203 | depends on GENERIC_CLOCKEVENTS | 204 | depends on GENERIC_CLOCKEVENTS |
| 205 | depends on HAS_IOMEM | ||
| 204 | default SYS_SUPPORTS_SH_MTU2 | 206 | default SYS_SUPPORTS_SH_MTU2 |
| 205 | help | 207 | help |
| 206 | This enables build of a clockevent driver for the Multi-Function | 208 | This enables build of a clockevent driver for the Multi-Function |
| @@ -210,6 +212,7 @@ config SH_TIMER_MTU2 | |||
| 210 | config SH_TIMER_TMU | 212 | config SH_TIMER_TMU |
| 211 | bool "Renesas TMU timer driver" if COMPILE_TEST | 213 | bool "Renesas TMU timer driver" if COMPILE_TEST |
| 212 | depends on GENERIC_CLOCKEVENTS | 214 | depends on GENERIC_CLOCKEVENTS |
| 215 | depends on HAS_IOMEM | ||
| 213 | default SYS_SUPPORTS_SH_TMU | 216 | default SYS_SUPPORTS_SH_TMU |
| 214 | help | 217 | help |
| 215 | This enables build of a clocksource and clockevent driver for | 218 | This enables build of a clocksource and clockevent driver for |
diff --git a/drivers/clocksource/timer-sun5i.c b/drivers/clocksource/timer-sun5i.c index 5dcbf90b8015..58597fbcc046 100644 --- a/drivers/clocksource/timer-sun5i.c +++ b/drivers/clocksource/timer-sun5i.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/irq.h> | 17 | #include <linux/irq.h> |
| 18 | #include <linux/irqreturn.h> | 18 | #include <linux/irqreturn.h> |
| 19 | #include <linux/reset.h> | 19 | #include <linux/reset.h> |
| 20 | #include <linux/sched_clock.h> | ||
| 21 | #include <linux/of.h> | 20 | #include <linux/of.h> |
| 22 | #include <linux/of_address.h> | 21 | #include <linux/of_address.h> |
| 23 | #include <linux/of_irq.h> | 22 | #include <linux/of_irq.h> |
| @@ -137,11 +136,6 @@ static struct irqaction sun5i_timer_irq = { | |||
| 137 | .dev_id = &sun5i_clockevent, | 136 | .dev_id = &sun5i_clockevent, |
| 138 | }; | 137 | }; |
| 139 | 138 | ||
| 140 | static u64 sun5i_timer_sched_read(void) | ||
| 141 | { | ||
| 142 | return ~readl(timer_base + TIMER_CNTVAL_LO_REG(1)); | ||
| 143 | } | ||
| 144 | |||
| 145 | static void __init sun5i_timer_init(struct device_node *node) | 139 | static void __init sun5i_timer_init(struct device_node *node) |
| 146 | { | 140 | { |
| 147 | struct reset_control *rstc; | 141 | struct reset_control *rstc; |
| @@ -172,7 +166,6 @@ static void __init sun5i_timer_init(struct device_node *node) | |||
| 172 | writel(TIMER_CTL_ENABLE | TIMER_CTL_RELOAD, | 166 | writel(TIMER_CTL_ENABLE | TIMER_CTL_RELOAD, |
| 173 | timer_base + TIMER_CTL_REG(1)); | 167 | timer_base + TIMER_CTL_REG(1)); |
| 174 | 168 | ||
| 175 | sched_clock_register(sun5i_timer_sched_read, 32, rate); | ||
| 176 | clocksource_mmio_init(timer_base + TIMER_CNTVAL_LO_REG(1), node->name, | 169 | clocksource_mmio_init(timer_base + TIMER_CNTVAL_LO_REG(1), node->name, |
| 177 | rate, 340, 32, clocksource_mmio_readl_down); | 170 | rate, 340, 32, clocksource_mmio_readl_down); |
| 178 | 171 | ||
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 9b641b38b857..8001fe9e3434 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
| @@ -433,7 +433,6 @@ static int dm_blk_open(struct block_device *bdev, fmode_t mode) | |||
| 433 | 433 | ||
| 434 | dm_get(md); | 434 | dm_get(md); |
| 435 | atomic_inc(&md->open_count); | 435 | atomic_inc(&md->open_count); |
| 436 | |||
| 437 | out: | 436 | out: |
| 438 | spin_unlock(&_minor_lock); | 437 | spin_unlock(&_minor_lock); |
| 439 | 438 | ||
| @@ -442,16 +441,20 @@ out: | |||
| 442 | 441 | ||
| 443 | static void dm_blk_close(struct gendisk *disk, fmode_t mode) | 442 | static void dm_blk_close(struct gendisk *disk, fmode_t mode) |
| 444 | { | 443 | { |
| 445 | struct mapped_device *md = disk->private_data; | 444 | struct mapped_device *md; |
| 446 | 445 | ||
| 447 | spin_lock(&_minor_lock); | 446 | spin_lock(&_minor_lock); |
| 448 | 447 | ||
| 448 | md = disk->private_data; | ||
| 449 | if (WARN_ON(!md)) | ||
| 450 | goto out; | ||
| 451 | |||
| 449 | if (atomic_dec_and_test(&md->open_count) && | 452 | if (atomic_dec_and_test(&md->open_count) && |
| 450 | (test_bit(DMF_DEFERRED_REMOVE, &md->flags))) | 453 | (test_bit(DMF_DEFERRED_REMOVE, &md->flags))) |
| 451 | queue_work(deferred_remove_workqueue, &deferred_remove_work); | 454 | queue_work(deferred_remove_workqueue, &deferred_remove_work); |
| 452 | 455 | ||
| 453 | dm_put(md); | 456 | dm_put(md); |
| 454 | 457 | out: | |
| 455 | spin_unlock(&_minor_lock); | 458 | spin_unlock(&_minor_lock); |
| 456 | } | 459 | } |
| 457 | 460 | ||
| @@ -2241,7 +2244,6 @@ static void free_dev(struct mapped_device *md) | |||
| 2241 | int minor = MINOR(disk_devt(md->disk)); | 2244 | int minor = MINOR(disk_devt(md->disk)); |
| 2242 | 2245 | ||
| 2243 | unlock_fs(md); | 2246 | unlock_fs(md); |
| 2244 | bdput(md->bdev); | ||
| 2245 | destroy_workqueue(md->wq); | 2247 | destroy_workqueue(md->wq); |
| 2246 | 2248 | ||
| 2247 | if (md->kworker_task) | 2249 | if (md->kworker_task) |
| @@ -2252,19 +2254,22 @@ static void free_dev(struct mapped_device *md) | |||
| 2252 | mempool_destroy(md->rq_pool); | 2254 | mempool_destroy(md->rq_pool); |
| 2253 | if (md->bs) | 2255 | if (md->bs) |
| 2254 | bioset_free(md->bs); | 2256 | bioset_free(md->bs); |
| 2255 | blk_integrity_unregister(md->disk); | 2257 | |
| 2256 | del_gendisk(md->disk); | ||
| 2257 | cleanup_srcu_struct(&md->io_barrier); | 2258 | cleanup_srcu_struct(&md->io_barrier); |
| 2258 | free_table_devices(&md->table_devices); | 2259 | free_table_devices(&md->table_devices); |
| 2259 | free_minor(minor); | 2260 | dm_stats_cleanup(&md->stats); |
| 2260 | 2261 | ||
| 2261 | spin_lock(&_minor_lock); | 2262 | spin_lock(&_minor_lock); |
| 2262 | md->disk->private_data = NULL; | 2263 | md->disk->private_data = NULL; |
| 2263 | spin_unlock(&_minor_lock); | 2264 | spin_unlock(&_minor_lock); |
| 2264 | 2265 | if (blk_get_integrity(md->disk)) | |
| 2266 | blk_integrity_unregister(md->disk); | ||
| 2267 | del_gendisk(md->disk); | ||
| 2265 | put_disk(md->disk); | 2268 | put_disk(md->disk); |
| 2266 | blk_cleanup_queue(md->queue); | 2269 | blk_cleanup_queue(md->queue); |
| 2267 | dm_stats_cleanup(&md->stats); | 2270 | bdput(md->bdev); |
| 2271 | free_minor(minor); | ||
| 2272 | |||
| 2268 | module_put(THIS_MODULE); | 2273 | module_put(THIS_MODULE); |
| 2269 | kfree(md); | 2274 | kfree(md); |
| 2270 | } | 2275 | } |
| @@ -2642,8 +2647,9 @@ static void __dm_destroy(struct mapped_device *md, bool wait) | |||
| 2642 | 2647 | ||
| 2643 | might_sleep(); | 2648 | might_sleep(); |
| 2644 | 2649 | ||
| 2645 | spin_lock(&_minor_lock); | ||
| 2646 | map = dm_get_live_table(md, &srcu_idx); | 2650 | map = dm_get_live_table(md, &srcu_idx); |
| 2651 | |||
| 2652 | spin_lock(&_minor_lock); | ||
| 2647 | idr_replace(&_minor_idr, MINOR_ALLOCED, MINOR(disk_devt(dm_disk(md)))); | 2653 | idr_replace(&_minor_idr, MINOR_ALLOCED, MINOR(disk_devt(dm_disk(md)))); |
| 2648 | set_bit(DMF_FREEING, &md->flags); | 2654 | set_bit(DMF_FREEING, &md->flags); |
| 2649 | spin_unlock(&_minor_lock); | 2655 | spin_unlock(&_minor_lock); |
diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c index f38ec424872e..5615522f8d62 100644 --- a/drivers/mfd/kempld-core.c +++ b/drivers/mfd/kempld-core.c | |||
| @@ -739,7 +739,7 @@ static int __init kempld_init(void) | |||
| 739 | for (id = kempld_dmi_table; | 739 | for (id = kempld_dmi_table; |
| 740 | id->matches[0].slot != DMI_NONE; id++) | 740 | id->matches[0].slot != DMI_NONE; id++) |
| 741 | if (strstr(id->ident, force_device_id)) | 741 | if (strstr(id->ident, force_device_id)) |
| 742 | if (id->callback && id->callback(id)) | 742 | if (id->callback && !id->callback(id)) |
| 743 | break; | 743 | break; |
| 744 | if (id->matches[0].slot == DMI_NONE) | 744 | if (id->matches[0].slot == DMI_NONE) |
| 745 | return -ENODEV; | 745 | return -ENODEV; |
diff --git a/drivers/mfd/rtsx_usb.c b/drivers/mfd/rtsx_usb.c index ede50244f265..dbd907d7170e 100644 --- a/drivers/mfd/rtsx_usb.c +++ b/drivers/mfd/rtsx_usb.c | |||
| @@ -196,18 +196,27 @@ EXPORT_SYMBOL_GPL(rtsx_usb_ep0_write_register); | |||
| 196 | int rtsx_usb_ep0_read_register(struct rtsx_ucr *ucr, u16 addr, u8 *data) | 196 | int rtsx_usb_ep0_read_register(struct rtsx_ucr *ucr, u16 addr, u8 *data) |
| 197 | { | 197 | { |
| 198 | u16 value; | 198 | u16 value; |
| 199 | u8 *buf; | ||
| 200 | int ret; | ||
| 199 | 201 | ||
| 200 | if (!data) | 202 | if (!data) |
| 201 | return -EINVAL; | 203 | return -EINVAL; |
| 202 | *data = 0; | 204 | |
| 205 | buf = kzalloc(sizeof(u8), GFP_KERNEL); | ||
| 206 | if (!buf) | ||
| 207 | return -ENOMEM; | ||
| 203 | 208 | ||
| 204 | addr |= EP0_READ_REG_CMD << EP0_OP_SHIFT; | 209 | addr |= EP0_READ_REG_CMD << EP0_OP_SHIFT; |
| 205 | value = swab16(addr); | 210 | value = swab16(addr); |
| 206 | 211 | ||
| 207 | return usb_control_msg(ucr->pusb_dev, | 212 | ret = usb_control_msg(ucr->pusb_dev, |
| 208 | usb_rcvctrlpipe(ucr->pusb_dev, 0), RTSX_USB_REQ_REG_OP, | 213 | usb_rcvctrlpipe(ucr->pusb_dev, 0), RTSX_USB_REQ_REG_OP, |
| 209 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 214 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
| 210 | value, 0, data, 1, 100); | 215 | value, 0, buf, 1, 100); |
| 216 | *data = *buf; | ||
| 217 | |||
| 218 | kfree(buf); | ||
| 219 | return ret; | ||
| 211 | } | 220 | } |
| 212 | EXPORT_SYMBOL_GPL(rtsx_usb_ep0_read_register); | 221 | EXPORT_SYMBOL_GPL(rtsx_usb_ep0_read_register); |
| 213 | 222 | ||
| @@ -288,18 +297,27 @@ static int rtsx_usb_get_status_with_bulk(struct rtsx_ucr *ucr, u16 *status) | |||
| 288 | int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status) | 297 | int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status) |
| 289 | { | 298 | { |
| 290 | int ret; | 299 | int ret; |
| 300 | u16 *buf; | ||
| 291 | 301 | ||
| 292 | if (!status) | 302 | if (!status) |
| 293 | return -EINVAL; | 303 | return -EINVAL; |
| 294 | 304 | ||
| 295 | if (polling_pipe == 0) | 305 | if (polling_pipe == 0) { |
| 306 | buf = kzalloc(sizeof(u16), GFP_KERNEL); | ||
| 307 | if (!buf) | ||
| 308 | return -ENOMEM; | ||
| 309 | |||
| 296 | ret = usb_control_msg(ucr->pusb_dev, | 310 | ret = usb_control_msg(ucr->pusb_dev, |
| 297 | usb_rcvctrlpipe(ucr->pusb_dev, 0), | 311 | usb_rcvctrlpipe(ucr->pusb_dev, 0), |
| 298 | RTSX_USB_REQ_POLL, | 312 | RTSX_USB_REQ_POLL, |
| 299 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 313 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
| 300 | 0, 0, status, 2, 100); | 314 | 0, 0, buf, 2, 100); |
| 301 | else | 315 | *status = *buf; |
| 316 | |||
| 317 | kfree(buf); | ||
| 318 | } else { | ||
| 302 | ret = rtsx_usb_get_status_with_bulk(ucr, status); | 319 | ret = rtsx_usb_get_status_with_bulk(ucr, status); |
| 320 | } | ||
| 303 | 321 | ||
| 304 | /* usb_control_msg may return positive when success */ | 322 | /* usb_control_msg may return positive when success */ |
| 305 | if (ret < 0) | 323 | if (ret < 0) |
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 9205f433573c..18198316b6cf 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c | |||
| @@ -1572,6 +1572,10 @@ static int palmas_regulators_probe(struct platform_device *pdev) | |||
| 1572 | if (!pmic) | 1572 | if (!pmic) |
| 1573 | return -ENOMEM; | 1573 | return -ENOMEM; |
| 1574 | 1574 | ||
| 1575 | if (of_device_is_compatible(node, "ti,tps659038-pmic")) | ||
| 1576 | palmas_generic_regs_info[PALMAS_REG_REGEN2].ctrl_addr = | ||
| 1577 | TPS659038_REGEN2_CTRL; | ||
| 1578 | |||
| 1575 | pmic->dev = &pdev->dev; | 1579 | pmic->dev = &pdev->dev; |
| 1576 | pmic->palmas = palmas; | 1580 | pmic->palmas = palmas; |
| 1577 | palmas->pmic = pmic; | 1581 | palmas->pmic = pmic; |
diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c index e2436d140175..3a6fd3a8a2ec 100644 --- a/drivers/rtc/rtc-mrst.c +++ b/drivers/rtc/rtc-mrst.c | |||
| @@ -413,8 +413,8 @@ static void rtc_mrst_do_remove(struct device *dev) | |||
| 413 | mrst->dev = NULL; | 413 | mrst->dev = NULL; |
| 414 | } | 414 | } |
| 415 | 415 | ||
| 416 | #ifdef CONFIG_PM | 416 | #ifdef CONFIG_PM_SLEEP |
| 417 | static int mrst_suspend(struct device *dev, pm_message_t mesg) | 417 | static int mrst_suspend(struct device *dev) |
| 418 | { | 418 | { |
| 419 | struct mrst_rtc *mrst = dev_get_drvdata(dev); | 419 | struct mrst_rtc *mrst = dev_get_drvdata(dev); |
| 420 | unsigned char tmp; | 420 | unsigned char tmp; |
| @@ -453,7 +453,7 @@ static int mrst_suspend(struct device *dev, pm_message_t mesg) | |||
| 453 | */ | 453 | */ |
| 454 | static inline int mrst_poweroff(struct device *dev) | 454 | static inline int mrst_poweroff(struct device *dev) |
| 455 | { | 455 | { |
| 456 | return mrst_suspend(dev, PMSG_HIBERNATE); | 456 | return mrst_suspend(dev); |
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | static int mrst_resume(struct device *dev) | 459 | static int mrst_resume(struct device *dev) |
| @@ -490,9 +490,11 @@ static int mrst_resume(struct device *dev) | |||
| 490 | return 0; | 490 | return 0; |
| 491 | } | 491 | } |
| 492 | 492 | ||
| 493 | static SIMPLE_DEV_PM_OPS(mrst_pm_ops, mrst_suspend, mrst_resume); | ||
| 494 | #define MRST_PM_OPS (&mrst_pm_ops) | ||
| 495 | |||
| 493 | #else | 496 | #else |
| 494 | #define mrst_suspend NULL | 497 | #define MRST_PM_OPS NULL |
| 495 | #define mrst_resume NULL | ||
| 496 | 498 | ||
| 497 | static inline int mrst_poweroff(struct device *dev) | 499 | static inline int mrst_poweroff(struct device *dev) |
| 498 | { | 500 | { |
| @@ -529,9 +531,8 @@ static struct platform_driver vrtc_mrst_platform_driver = { | |||
| 529 | .remove = vrtc_mrst_platform_remove, | 531 | .remove = vrtc_mrst_platform_remove, |
| 530 | .shutdown = vrtc_mrst_platform_shutdown, | 532 | .shutdown = vrtc_mrst_platform_shutdown, |
| 531 | .driver = { | 533 | .driver = { |
| 532 | .name = (char *) driver_name, | 534 | .name = driver_name, |
| 533 | .suspend = mrst_suspend, | 535 | .pm = MRST_PM_OPS, |
| 534 | .resume = mrst_resume, | ||
| 535 | } | 536 | } |
| 536 | }; | 537 | }; |
| 537 | 538 | ||
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 9219953ee949..d9afc51af7d3 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
| @@ -6815,7 +6815,8 @@ static struct ata_port_operations ipr_sata_ops = { | |||
| 6815 | }; | 6815 | }; |
| 6816 | 6816 | ||
| 6817 | static struct ata_port_info sata_port_info = { | 6817 | static struct ata_port_info sata_port_info = { |
| 6818 | .flags = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA, | 6818 | .flags = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA | |
| 6819 | ATA_FLAG_SAS_HOST, | ||
| 6819 | .pio_mask = ATA_PIO4_ONLY, | 6820 | .pio_mask = ATA_PIO4_ONLY, |
| 6820 | .mwdma_mask = ATA_MWDMA2, | 6821 | .mwdma_mask = ATA_MWDMA2, |
| 6821 | .udma_mask = ATA_UDMA6, | 6822 | .udma_mask = ATA_UDMA6, |
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 932d9cc98d2f..9c706d8c1441 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
| @@ -547,7 +547,8 @@ static struct ata_port_operations sas_sata_ops = { | |||
| 547 | }; | 547 | }; |
| 548 | 548 | ||
| 549 | static struct ata_port_info sata_port_info = { | 549 | static struct ata_port_info sata_port_info = { |
| 550 | .flags = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA | ATA_FLAG_NCQ, | 550 | .flags = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA | ATA_FLAG_NCQ | |
| 551 | ATA_FLAG_SAS_HOST, | ||
| 551 | .pio_mask = ATA_PIO4, | 552 | .pio_mask = ATA_PIO4, |
| 552 | .mwdma_mask = ATA_MWDMA2, | 553 | .mwdma_mask = ATA_MWDMA2, |
| 553 | .udma_mask = ATA_UDMA6, | 554 | .udma_mask = ATA_UDMA6, |
diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c index 3ce39d10fafb..4f8c798e0633 100644 --- a/drivers/spi/spi-dw-mid.c +++ b/drivers/spi/spi-dw-mid.c | |||
| @@ -108,7 +108,8 @@ static void dw_spi_dma_tx_done(void *arg) | |||
| 108 | { | 108 | { |
| 109 | struct dw_spi *dws = arg; | 109 | struct dw_spi *dws = arg; |
| 110 | 110 | ||
| 111 | if (test_and_clear_bit(TX_BUSY, &dws->dma_chan_busy) & BIT(RX_BUSY)) | 111 | clear_bit(TX_BUSY, &dws->dma_chan_busy); |
| 112 | if (test_bit(RX_BUSY, &dws->dma_chan_busy)) | ||
| 112 | return; | 113 | return; |
| 113 | dw_spi_xfer_done(dws); | 114 | dw_spi_xfer_done(dws); |
| 114 | } | 115 | } |
| @@ -156,7 +157,8 @@ static void dw_spi_dma_rx_done(void *arg) | |||
| 156 | { | 157 | { |
| 157 | struct dw_spi *dws = arg; | 158 | struct dw_spi *dws = arg; |
| 158 | 159 | ||
| 159 | if (test_and_clear_bit(RX_BUSY, &dws->dma_chan_busy) & BIT(TX_BUSY)) | 160 | clear_bit(RX_BUSY, &dws->dma_chan_busy); |
| 161 | if (test_bit(TX_BUSY, &dws->dma_chan_busy)) | ||
| 160 | return; | 162 | return; |
| 161 | dw_spi_xfer_done(dws); | 163 | dw_spi_xfer_done(dws); |
| 162 | } | 164 | } |
diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c index ff9cdbdb6672..2b2c359f5a50 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c | |||
| @@ -498,7 +498,7 @@ static int spi_qup_probe(struct platform_device *pdev) | |||
| 498 | struct resource *res; | 498 | struct resource *res; |
| 499 | struct device *dev; | 499 | struct device *dev; |
| 500 | void __iomem *base; | 500 | void __iomem *base; |
| 501 | u32 max_freq, iomode; | 501 | u32 max_freq, iomode, num_cs; |
| 502 | int ret, irq, size; | 502 | int ret, irq, size; |
| 503 | 503 | ||
| 504 | dev = &pdev->dev; | 504 | dev = &pdev->dev; |
| @@ -550,10 +550,11 @@ static int spi_qup_probe(struct platform_device *pdev) | |||
| 550 | } | 550 | } |
| 551 | 551 | ||
| 552 | /* use num-cs unless not present or out of range */ | 552 | /* use num-cs unless not present or out of range */ |
| 553 | if (of_property_read_u16(dev->of_node, "num-cs", | 553 | if (of_property_read_u32(dev->of_node, "num-cs", &num_cs) || |
| 554 | &master->num_chipselect) || | 554 | num_cs > SPI_NUM_CHIPSELECTS) |
| 555 | (master->num_chipselect > SPI_NUM_CHIPSELECTS)) | ||
| 556 | master->num_chipselect = SPI_NUM_CHIPSELECTS; | 555 | master->num_chipselect = SPI_NUM_CHIPSELECTS; |
| 556 | else | ||
| 557 | master->num_chipselect = num_cs; | ||
| 557 | 558 | ||
| 558 | master->bus_num = pdev->id; | 559 | master->bus_num = pdev->id; |
| 559 | master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP; | 560 | master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP; |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index c64a3e59fce3..57a195041dc7 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
| @@ -1105,13 +1105,14 @@ void spi_finalize_current_message(struct spi_master *master) | |||
| 1105 | "failed to unprepare message: %d\n", ret); | 1105 | "failed to unprepare message: %d\n", ret); |
| 1106 | } | 1106 | } |
| 1107 | } | 1107 | } |
| 1108 | |||
| 1109 | trace_spi_message_done(mesg); | ||
| 1110 | |||
| 1108 | master->cur_msg_prepared = false; | 1111 | master->cur_msg_prepared = false; |
| 1109 | 1112 | ||
| 1110 | mesg->state = NULL; | 1113 | mesg->state = NULL; |
| 1111 | if (mesg->complete) | 1114 | if (mesg->complete) |
| 1112 | mesg->complete(mesg->context); | 1115 | mesg->complete(mesg->context); |
| 1113 | |||
| 1114 | trace_spi_message_done(mesg); | ||
| 1115 | } | 1116 | } |
| 1116 | EXPORT_SYMBOL_GPL(spi_finalize_current_message); | 1117 | EXPORT_SYMBOL_GPL(spi_finalize_current_message); |
| 1117 | 1118 | ||
diff --git a/drivers/watchdog/imgpdc_wdt.c b/drivers/watchdog/imgpdc_wdt.c index c8def68d9e4c..0deaa4f971f5 100644 --- a/drivers/watchdog/imgpdc_wdt.c +++ b/drivers/watchdog/imgpdc_wdt.c | |||
| @@ -42,10 +42,10 @@ | |||
| 42 | #define PDC_WDT_MIN_TIMEOUT 1 | 42 | #define PDC_WDT_MIN_TIMEOUT 1 |
| 43 | #define PDC_WDT_DEF_TIMEOUT 64 | 43 | #define PDC_WDT_DEF_TIMEOUT 64 |
| 44 | 44 | ||
| 45 | static int heartbeat; | 45 | static int heartbeat = PDC_WDT_DEF_TIMEOUT; |
| 46 | module_param(heartbeat, int, 0); | 46 | module_param(heartbeat, int, 0); |
| 47 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds. " | 47 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds " |
| 48 | "(default = " __MODULE_STRING(PDC_WDT_DEF_TIMEOUT) ")"); | 48 | "(default=" __MODULE_STRING(PDC_WDT_DEF_TIMEOUT) ")"); |
| 49 | 49 | ||
| 50 | static bool nowayout = WATCHDOG_NOWAYOUT; | 50 | static bool nowayout = WATCHDOG_NOWAYOUT; |
| 51 | module_param(nowayout, bool, 0); | 51 | module_param(nowayout, bool, 0); |
| @@ -191,6 +191,7 @@ static int pdc_wdt_probe(struct platform_device *pdev) | |||
| 191 | pdc_wdt->wdt_dev.ops = &pdc_wdt_ops; | 191 | pdc_wdt->wdt_dev.ops = &pdc_wdt_ops; |
| 192 | pdc_wdt->wdt_dev.max_timeout = 1 << PDC_WDT_CONFIG_DELAY_MASK; | 192 | pdc_wdt->wdt_dev.max_timeout = 1 << PDC_WDT_CONFIG_DELAY_MASK; |
| 193 | pdc_wdt->wdt_dev.parent = &pdev->dev; | 193 | pdc_wdt->wdt_dev.parent = &pdev->dev; |
| 194 | watchdog_set_drvdata(&pdc_wdt->wdt_dev, pdc_wdt); | ||
| 194 | 195 | ||
| 195 | ret = watchdog_init_timeout(&pdc_wdt->wdt_dev, heartbeat, &pdev->dev); | 196 | ret = watchdog_init_timeout(&pdc_wdt->wdt_dev, heartbeat, &pdev->dev); |
| 196 | if (ret < 0) { | 197 | if (ret < 0) { |
| @@ -232,7 +233,6 @@ static int pdc_wdt_probe(struct platform_device *pdev) | |||
| 232 | watchdog_set_nowayout(&pdc_wdt->wdt_dev, nowayout); | 233 | watchdog_set_nowayout(&pdc_wdt->wdt_dev, nowayout); |
| 233 | 234 | ||
| 234 | platform_set_drvdata(pdev, pdc_wdt); | 235 | platform_set_drvdata(pdev, pdc_wdt); |
| 235 | watchdog_set_drvdata(&pdc_wdt->wdt_dev, pdc_wdt); | ||
| 236 | 236 | ||
| 237 | ret = watchdog_register_device(&pdc_wdt->wdt_dev); | 237 | ret = watchdog_register_device(&pdc_wdt->wdt_dev); |
| 238 | if (ret) | 238 | if (ret) |
diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c index a87f6df6e85f..938b987de551 100644 --- a/drivers/watchdog/mtk_wdt.c +++ b/drivers/watchdog/mtk_wdt.c | |||
| @@ -133,7 +133,7 @@ static int mtk_wdt_start(struct watchdog_device *wdt_dev) | |||
| 133 | u32 reg; | 133 | u32 reg; |
| 134 | struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(wdt_dev); | 134 | struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(wdt_dev); |
| 135 | void __iomem *wdt_base = mtk_wdt->wdt_base; | 135 | void __iomem *wdt_base = mtk_wdt->wdt_base; |
| 136 | u32 ret; | 136 | int ret; |
| 137 | 137 | ||
| 138 | ret = mtk_wdt_set_timeout(wdt_dev, wdt_dev->timeout); | 138 | ret = mtk_wdt_set_timeout(wdt_dev, wdt_dev->timeout); |
| 139 | if (ret < 0) | 139 | if (ret < 0) |
diff --git a/fs/affs/file.c b/fs/affs/file.c index d2468bf95669..a91795e01a7f 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c | |||
| @@ -699,8 +699,10 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping, | |||
| 699 | boff = tmp % bsize; | 699 | boff = tmp % bsize; |
| 700 | if (boff) { | 700 | if (boff) { |
| 701 | bh = affs_bread_ino(inode, bidx, 0); | 701 | bh = affs_bread_ino(inode, bidx, 0); |
| 702 | if (IS_ERR(bh)) | 702 | if (IS_ERR(bh)) { |
| 703 | return PTR_ERR(bh); | 703 | written = PTR_ERR(bh); |
| 704 | goto err_first_bh; | ||
| 705 | } | ||
| 704 | tmp = min(bsize - boff, to - from); | 706 | tmp = min(bsize - boff, to - from); |
| 705 | BUG_ON(boff + tmp > bsize || tmp > bsize); | 707 | BUG_ON(boff + tmp > bsize || tmp > bsize); |
| 706 | memcpy(AFFS_DATA(bh) + boff, data + from, tmp); | 708 | memcpy(AFFS_DATA(bh) + boff, data + from, tmp); |
| @@ -712,14 +714,16 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping, | |||
| 712 | bidx++; | 714 | bidx++; |
| 713 | } else if (bidx) { | 715 | } else if (bidx) { |
| 714 | bh = affs_bread_ino(inode, bidx - 1, 0); | 716 | bh = affs_bread_ino(inode, bidx - 1, 0); |
| 715 | if (IS_ERR(bh)) | 717 | if (IS_ERR(bh)) { |
| 716 | return PTR_ERR(bh); | 718 | written = PTR_ERR(bh); |
| 719 | goto err_first_bh; | ||
| 720 | } | ||
| 717 | } | 721 | } |
| 718 | while (from + bsize <= to) { | 722 | while (from + bsize <= to) { |
| 719 | prev_bh = bh; | 723 | prev_bh = bh; |
| 720 | bh = affs_getemptyblk_ino(inode, bidx); | 724 | bh = affs_getemptyblk_ino(inode, bidx); |
| 721 | if (IS_ERR(bh)) | 725 | if (IS_ERR(bh)) |
| 722 | goto out; | 726 | goto err_bh; |
| 723 | memcpy(AFFS_DATA(bh), data + from, bsize); | 727 | memcpy(AFFS_DATA(bh), data + from, bsize); |
| 724 | if (buffer_new(bh)) { | 728 | if (buffer_new(bh)) { |
| 725 | AFFS_DATA_HEAD(bh)->ptype = cpu_to_be32(T_DATA); | 729 | AFFS_DATA_HEAD(bh)->ptype = cpu_to_be32(T_DATA); |
| @@ -751,7 +755,7 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping, | |||
| 751 | prev_bh = bh; | 755 | prev_bh = bh; |
| 752 | bh = affs_bread_ino(inode, bidx, 1); | 756 | bh = affs_bread_ino(inode, bidx, 1); |
| 753 | if (IS_ERR(bh)) | 757 | if (IS_ERR(bh)) |
| 754 | goto out; | 758 | goto err_bh; |
| 755 | tmp = min(bsize, to - from); | 759 | tmp = min(bsize, to - from); |
| 756 | BUG_ON(tmp > bsize); | 760 | BUG_ON(tmp > bsize); |
| 757 | memcpy(AFFS_DATA(bh), data + from, tmp); | 761 | memcpy(AFFS_DATA(bh), data + from, tmp); |
| @@ -790,12 +794,13 @@ done: | |||
| 790 | if (tmp > inode->i_size) | 794 | if (tmp > inode->i_size) |
| 791 | inode->i_size = AFFS_I(inode)->mmu_private = tmp; | 795 | inode->i_size = AFFS_I(inode)->mmu_private = tmp; |
| 792 | 796 | ||
| 797 | err_first_bh: | ||
| 793 | unlock_page(page); | 798 | unlock_page(page); |
| 794 | page_cache_release(page); | 799 | page_cache_release(page); |
| 795 | 800 | ||
| 796 | return written; | 801 | return written; |
| 797 | 802 | ||
| 798 | out: | 803 | err_bh: |
| 799 | bh = prev_bh; | 804 | bh = prev_bh; |
| 800 | if (!written) | 805 | if (!written) |
| 801 | written = PTR_ERR(bh); | 806 | written = PTR_ERR(bh); |
diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c index 6e560d56094b..754fdf8c6356 100644 --- a/fs/hfsplus/brec.c +++ b/fs/hfsplus/brec.c | |||
| @@ -131,13 +131,16 @@ skip: | |||
| 131 | hfs_bnode_write(node, entry, data_off + key_len, entry_len); | 131 | hfs_bnode_write(node, entry, data_off + key_len, entry_len); |
| 132 | hfs_bnode_dump(node); | 132 | hfs_bnode_dump(node); |
| 133 | 133 | ||
| 134 | if (new_node) { | 134 | /* |
| 135 | /* update parent key if we inserted a key | 135 | * update parent key if we inserted a key |
| 136 | * at the start of the first node | 136 | * at the start of the node and it is not the new node |
| 137 | */ | 137 | */ |
| 138 | if (!rec && new_node != node) | 138 | if (!rec && new_node != node) { |
| 139 | hfs_brec_update_parent(fd); | 139 | hfs_bnode_read_key(node, fd->search_key, data_off + size); |
| 140 | hfs_brec_update_parent(fd); | ||
| 141 | } | ||
| 140 | 142 | ||
| 143 | if (new_node) { | ||
| 141 | hfs_bnode_put(fd->bnode); | 144 | hfs_bnode_put(fd->bnode); |
| 142 | if (!new_node->parent) { | 145 | if (!new_node->parent) { |
| 143 | hfs_btree_inc_height(tree); | 146 | hfs_btree_inc_height(tree); |
| @@ -168,9 +171,6 @@ skip: | |||
| 168 | goto again; | 171 | goto again; |
| 169 | } | 172 | } |
| 170 | 173 | ||
| 171 | if (!rec) | ||
| 172 | hfs_brec_update_parent(fd); | ||
| 173 | |||
| 174 | return 0; | 174 | return 0; |
| 175 | } | 175 | } |
| 176 | 176 | ||
| @@ -370,6 +370,8 @@ again: | |||
| 370 | if (IS_ERR(parent)) | 370 | if (IS_ERR(parent)) |
| 371 | return PTR_ERR(parent); | 371 | return PTR_ERR(parent); |
| 372 | __hfs_brec_find(parent, fd, hfs_find_rec_by_key); | 372 | __hfs_brec_find(parent, fd, hfs_find_rec_by_key); |
| 373 | if (fd->record < 0) | ||
| 374 | return -ENOENT; | ||
| 373 | hfs_bnode_dump(parent); | 375 | hfs_bnode_dump(parent); |
| 374 | rec = fd->record; | 376 | rec = fd->record; |
| 375 | 377 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index fc03efa64ffe..6b08cc106c21 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -232,6 +232,7 @@ enum { | |||
| 232 | * led */ | 232 | * led */ |
| 233 | ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */ | 233 | ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */ |
| 234 | ATA_FLAG_LOWTAG = (1 << 24), /* host wants lowest available tag */ | 234 | ATA_FLAG_LOWTAG = (1 << 24), /* host wants lowest available tag */ |
| 235 | ATA_FLAG_SAS_HOST = (1 << 25), /* SAS host */ | ||
| 235 | 236 | ||
| 236 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ | 237 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ |
| 237 | 238 | ||
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index fb0390a1a498..ee7b1ce7a6f8 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h | |||
| @@ -2999,6 +2999,9 @@ enum usb_irq_events { | |||
| 2999 | #define PALMAS_GPADC_TRIM15 0x0E | 2999 | #define PALMAS_GPADC_TRIM15 0x0E |
| 3000 | #define PALMAS_GPADC_TRIM16 0x0F | 3000 | #define PALMAS_GPADC_TRIM16 0x0F |
| 3001 | 3001 | ||
| 3002 | /* TPS659038 regen2_ctrl offset iss different from palmas */ | ||
| 3003 | #define TPS659038_REGEN2_CTRL 0x12 | ||
| 3004 | |||
| 3002 | /* TPS65917 Interrupt registers */ | 3005 | /* TPS65917 Interrupt registers */ |
| 3003 | 3006 | ||
| 3004 | /* Registers for function INTERRUPT */ | 3007 | /* Registers for function INTERRUPT */ |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index d4ad5b5a02bb..045f709cb89b 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -316,7 +316,7 @@ struct regulator_desc { | |||
| 316 | * @driver_data: private regulator data | 316 | * @driver_data: private regulator data |
| 317 | * @of_node: OpenFirmware node to parse for device tree bindings (may be | 317 | * @of_node: OpenFirmware node to parse for device tree bindings (may be |
| 318 | * NULL). | 318 | * NULL). |
| 319 | * @regmap: regmap to use for core regmap helpers if dev_get_regulator() is | 319 | * @regmap: regmap to use for core regmap helpers if dev_get_regmap() is |
| 320 | * insufficient. | 320 | * insufficient. |
| 321 | * @ena_gpio_initialized: GPIO controlling regulator enable was properly | 321 | * @ena_gpio_initialized: GPIO controlling regulator enable was properly |
| 322 | * initialized, meaning that >= 0 is a valid gpio | 322 | * initialized, meaning that >= 0 is a valid gpio |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 6d77432e14ff..a419b65770d6 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1625,11 +1625,11 @@ struct task_struct { | |||
| 1625 | 1625 | ||
| 1626 | /* | 1626 | /* |
| 1627 | * numa_faults_locality tracks if faults recorded during the last | 1627 | * numa_faults_locality tracks if faults recorded during the last |
| 1628 | * scan window were remote/local. The task scan period is adapted | 1628 | * scan window were remote/local or failed to migrate. The task scan |
| 1629 | * based on the locality of the faults with different weights | 1629 | * period is adapted based on the locality of the faults with different |
| 1630 | * depending on whether they were shared or private faults | 1630 | * weights depending on whether they were shared or private faults |
| 1631 | */ | 1631 | */ |
| 1632 | unsigned long numa_faults_locality[2]; | 1632 | unsigned long numa_faults_locality[3]; |
| 1633 | 1633 | ||
| 1634 | unsigned long numa_pages_migrated; | 1634 | unsigned long numa_pages_migrated; |
| 1635 | #endif /* CONFIG_NUMA_BALANCING */ | 1635 | #endif /* CONFIG_NUMA_BALANCING */ |
| @@ -1719,6 +1719,7 @@ struct task_struct { | |||
| 1719 | #define TNF_NO_GROUP 0x02 | 1719 | #define TNF_NO_GROUP 0x02 |
| 1720 | #define TNF_SHARED 0x04 | 1720 | #define TNF_SHARED 0x04 |
| 1721 | #define TNF_FAULT_LOCAL 0x08 | 1721 | #define TNF_FAULT_LOCAL 0x08 |
| 1722 | #define TNF_MIGRATE_FAIL 0x10 | ||
| 1722 | 1723 | ||
| 1723 | #ifdef CONFIG_NUMA_BALANCING | 1724 | #ifdef CONFIG_NUMA_BALANCING |
| 1724 | extern void task_numa_fault(int last_node, int node, int pages, int flags); | 1725 | extern void task_numa_fault(int last_node, int node, int pages, int flags); |
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h index 23d561512f64..22317d2b52ab 100644 --- a/include/trace/events/regmap.h +++ b/include/trace/events/regmap.h | |||
| @@ -7,27 +7,26 @@ | |||
| 7 | #include <linux/ktime.h> | 7 | #include <linux/ktime.h> |
| 8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
| 9 | 9 | ||
| 10 | struct device; | 10 | #include "../../../drivers/base/regmap/internal.h" |
| 11 | struct regmap; | ||
| 12 | 11 | ||
| 13 | /* | 12 | /* |
| 14 | * Log register events | 13 | * Log register events |
| 15 | */ | 14 | */ |
| 16 | DECLARE_EVENT_CLASS(regmap_reg, | 15 | DECLARE_EVENT_CLASS(regmap_reg, |
| 17 | 16 | ||
| 18 | TP_PROTO(struct device *dev, unsigned int reg, | 17 | TP_PROTO(struct regmap *map, unsigned int reg, |
| 19 | unsigned int val), | 18 | unsigned int val), |
| 20 | 19 | ||
| 21 | TP_ARGS(dev, reg, val), | 20 | TP_ARGS(map, reg, val), |
| 22 | 21 | ||
| 23 | TP_STRUCT__entry( | 22 | TP_STRUCT__entry( |
| 24 | __string( name, dev_name(dev) ) | 23 | __string( name, regmap_name(map) ) |
| 25 | __field( unsigned int, reg ) | 24 | __field( unsigned int, reg ) |
| 26 | __field( unsigned int, val ) | 25 | __field( unsigned int, val ) |
| 27 | ), | 26 | ), |
| 28 | 27 | ||
| 29 | TP_fast_assign( | 28 | TP_fast_assign( |
| 30 | __assign_str(name, dev_name(dev)); | 29 | __assign_str(name, regmap_name(map)); |
| 31 | __entry->reg = reg; | 30 | __entry->reg = reg; |
| 32 | __entry->val = val; | 31 | __entry->val = val; |
| 33 | ), | 32 | ), |
| @@ -39,45 +38,45 @@ DECLARE_EVENT_CLASS(regmap_reg, | |||
| 39 | 38 | ||
| 40 | DEFINE_EVENT(regmap_reg, regmap_reg_write, | 39 | DEFINE_EVENT(regmap_reg, regmap_reg_write, |
| 41 | 40 | ||
| 42 | TP_PROTO(struct device *dev, unsigned int reg, | 41 | TP_PROTO(struct regmap *map, unsigned int reg, |
| 43 | unsigned int val), | 42 | unsigned int val), |
| 44 | 43 | ||
| 45 | TP_ARGS(dev, reg, val) | 44 | TP_ARGS(map, reg, val) |
| 46 | 45 | ||
| 47 | ); | 46 | ); |
| 48 | 47 | ||
| 49 | DEFINE_EVENT(regmap_reg, regmap_reg_read, | 48 | DEFINE_EVENT(regmap_reg, regmap_reg_read, |
| 50 | 49 | ||
| 51 | TP_PROTO(struct device *dev, unsigned int reg, | 50 | TP_PROTO(struct regmap *map, unsigned int reg, |
| 52 | unsigned int val), | 51 | unsigned int val), |
| 53 | 52 | ||
| 54 | TP_ARGS(dev, reg, val) | 53 | TP_ARGS(map, reg, val) |
| 55 | 54 | ||
| 56 | ); | 55 | ); |
| 57 | 56 | ||
| 58 | DEFINE_EVENT(regmap_reg, regmap_reg_read_cache, | 57 | DEFINE_EVENT(regmap_reg, regmap_reg_read_cache, |
| 59 | 58 | ||
| 60 | TP_PROTO(struct device *dev, unsigned int reg, | 59 | TP_PROTO(struct regmap *map, unsigned int reg, |
| 61 | unsigned int val), | 60 | unsigned int val), |
| 62 | 61 | ||
| 63 | TP_ARGS(dev, reg, val) | 62 | TP_ARGS(map, reg, val) |
| 64 | 63 | ||
| 65 | ); | 64 | ); |
| 66 | 65 | ||
| 67 | DECLARE_EVENT_CLASS(regmap_block, | 66 | DECLARE_EVENT_CLASS(regmap_block, |
| 68 | 67 | ||
| 69 | TP_PROTO(struct device *dev, unsigned int reg, int count), | 68 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
| 70 | 69 | ||
| 71 | TP_ARGS(dev, reg, count), | 70 | TP_ARGS(map, reg, count), |
| 72 | 71 | ||
| 73 | TP_STRUCT__entry( | 72 | TP_STRUCT__entry( |
| 74 | __string( name, dev_name(dev) ) | 73 | __string( name, regmap_name(map) ) |
| 75 | __field( unsigned int, reg ) | 74 | __field( unsigned int, reg ) |
| 76 | __field( int, count ) | 75 | __field( int, count ) |
| 77 | ), | 76 | ), |
| 78 | 77 | ||
| 79 | TP_fast_assign( | 78 | TP_fast_assign( |
| 80 | __assign_str(name, dev_name(dev)); | 79 | __assign_str(name, regmap_name(map)); |
| 81 | __entry->reg = reg; | 80 | __entry->reg = reg; |
| 82 | __entry->count = count; | 81 | __entry->count = count; |
| 83 | ), | 82 | ), |
| @@ -89,48 +88,48 @@ DECLARE_EVENT_CLASS(regmap_block, | |||
| 89 | 88 | ||
| 90 | DEFINE_EVENT(regmap_block, regmap_hw_read_start, | 89 | DEFINE_EVENT(regmap_block, regmap_hw_read_start, |
| 91 | 90 | ||
| 92 | TP_PROTO(struct device *dev, unsigned int reg, int count), | 91 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
| 93 | 92 | ||
| 94 | TP_ARGS(dev, reg, count) | 93 | TP_ARGS(map, reg, count) |
| 95 | ); | 94 | ); |
| 96 | 95 | ||
| 97 | DEFINE_EVENT(regmap_block, regmap_hw_read_done, | 96 | DEFINE_EVENT(regmap_block, regmap_hw_read_done, |
| 98 | 97 | ||
| 99 | TP_PROTO(struct device *dev, unsigned int reg, int count), | 98 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
| 100 | 99 | ||
| 101 | TP_ARGS(dev, reg, count) | 100 | TP_ARGS(map, reg, count) |
| 102 | ); | 101 | ); |
| 103 | 102 | ||
| 104 | DEFINE_EVENT(regmap_block, regmap_hw_write_start, | 103 | DEFINE_EVENT(regmap_block, regmap_hw_write_start, |
| 105 | 104 | ||
| 106 | TP_PROTO(struct device *dev, unsigned int reg, int count), | 105 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
| 107 | 106 | ||
| 108 | TP_ARGS(dev, reg, count) | 107 | TP_ARGS(map, reg, count) |
| 109 | ); | 108 | ); |
| 110 | 109 | ||
| 111 | DEFINE_EVENT(regmap_block, regmap_hw_write_done, | 110 | DEFINE_EVENT(regmap_block, regmap_hw_write_done, |
| 112 | 111 | ||
| 113 | TP_PROTO(struct device *dev, unsigned int reg, int count), | 112 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
| 114 | 113 | ||
| 115 | TP_ARGS(dev, reg, count) | 114 | TP_ARGS(map, reg, count) |
| 116 | ); | 115 | ); |
| 117 | 116 | ||
| 118 | TRACE_EVENT(regcache_sync, | 117 | TRACE_EVENT(regcache_sync, |
| 119 | 118 | ||
| 120 | TP_PROTO(struct device *dev, const char *type, | 119 | TP_PROTO(struct regmap *map, const char *type, |
| 121 | const char *status), | 120 | const char *status), |
| 122 | 121 | ||
| 123 | TP_ARGS(dev, type, status), | 122 | TP_ARGS(map, type, status), |
| 124 | 123 | ||
| 125 | TP_STRUCT__entry( | 124 | TP_STRUCT__entry( |
| 126 | __string( name, dev_name(dev) ) | 125 | __string( name, regmap_name(map) ) |
| 127 | __string( status, status ) | 126 | __string( status, status ) |
| 128 | __string( type, type ) | 127 | __string( type, type ) |
| 129 | __field( int, type ) | 128 | __field( int, type ) |
| 130 | ), | 129 | ), |
| 131 | 130 | ||
| 132 | TP_fast_assign( | 131 | TP_fast_assign( |
| 133 | __assign_str(name, dev_name(dev)); | 132 | __assign_str(name, regmap_name(map)); |
| 134 | __assign_str(status, status); | 133 | __assign_str(status, status); |
| 135 | __assign_str(type, type); | 134 | __assign_str(type, type); |
| 136 | ), | 135 | ), |
| @@ -141,17 +140,17 @@ TRACE_EVENT(regcache_sync, | |||
| 141 | 140 | ||
| 142 | DECLARE_EVENT_CLASS(regmap_bool, | 141 | DECLARE_EVENT_CLASS(regmap_bool, |
| 143 | 142 | ||
| 144 | TP_PROTO(struct device *dev, bool flag), | 143 | TP_PROTO(struct regmap *map, bool flag), |
| 145 | 144 | ||
| 146 | TP_ARGS(dev, flag), | 145 | TP_ARGS(map, flag), |
| 147 | 146 | ||
| 148 | TP_STRUCT__entry( | 147 | TP_STRUCT__entry( |
| 149 | __string( name, dev_name(dev) ) | 148 | __string( name, regmap_name(map) ) |
| 150 | __field( int, flag ) | 149 | __field( int, flag ) |
| 151 | ), | 150 | ), |
| 152 | 151 | ||
| 153 | TP_fast_assign( | 152 | TP_fast_assign( |
| 154 | __assign_str(name, dev_name(dev)); | 153 | __assign_str(name, regmap_name(map)); |
| 155 | __entry->flag = flag; | 154 | __entry->flag = flag; |
| 156 | ), | 155 | ), |
| 157 | 156 | ||
| @@ -161,32 +160,32 @@ DECLARE_EVENT_CLASS(regmap_bool, | |||
| 161 | 160 | ||
| 162 | DEFINE_EVENT(regmap_bool, regmap_cache_only, | 161 | DEFINE_EVENT(regmap_bool, regmap_cache_only, |
| 163 | 162 | ||
| 164 | TP_PROTO(struct device *dev, bool flag), | 163 | TP_PROTO(struct regmap *map, bool flag), |
| 165 | 164 | ||
| 166 | TP_ARGS(dev, flag) | 165 | TP_ARGS(map, flag) |
| 167 | 166 | ||
| 168 | ); | 167 | ); |
| 169 | 168 | ||
| 170 | DEFINE_EVENT(regmap_bool, regmap_cache_bypass, | 169 | DEFINE_EVENT(regmap_bool, regmap_cache_bypass, |
| 171 | 170 | ||
| 172 | TP_PROTO(struct device *dev, bool flag), | 171 | TP_PROTO(struct regmap *map, bool flag), |
| 173 | 172 | ||
| 174 | TP_ARGS(dev, flag) | 173 | TP_ARGS(map, flag) |
| 175 | 174 | ||
| 176 | ); | 175 | ); |
| 177 | 176 | ||
| 178 | DECLARE_EVENT_CLASS(regmap_async, | 177 | DECLARE_EVENT_CLASS(regmap_async, |
| 179 | 178 | ||
| 180 | TP_PROTO(struct device *dev), | 179 | TP_PROTO(struct regmap *map), |
| 181 | 180 | ||
| 182 | TP_ARGS(dev), | 181 | TP_ARGS(map), |
| 183 | 182 | ||
| 184 | TP_STRUCT__entry( | 183 | TP_STRUCT__entry( |
| 185 | __string( name, dev_name(dev) ) | 184 | __string( name, regmap_name(map) ) |
| 186 | ), | 185 | ), |
| 187 | 186 | ||
| 188 | TP_fast_assign( | 187 | TP_fast_assign( |
| 189 | __assign_str(name, dev_name(dev)); | 188 | __assign_str(name, regmap_name(map)); |
| 190 | ), | 189 | ), |
| 191 | 190 | ||
| 192 | TP_printk("%s", __get_str(name)) | 191 | TP_printk("%s", __get_str(name)) |
| @@ -194,50 +193,50 @@ DECLARE_EVENT_CLASS(regmap_async, | |||
| 194 | 193 | ||
| 195 | DEFINE_EVENT(regmap_block, regmap_async_write_start, | 194 | DEFINE_EVENT(regmap_block, regmap_async_write_start, |
| 196 | 195 | ||
| 197 | TP_PROTO(struct device *dev, unsigned int reg, int count), | 196 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
| 198 | 197 | ||
| 199 | TP_ARGS(dev, reg, count) | 198 | TP_ARGS(map, reg, count) |
| 200 | ); | 199 | ); |
| 201 | 200 | ||
| 202 | DEFINE_EVENT(regmap_async, regmap_async_io_complete, | 201 | DEFINE_EVENT(regmap_async, regmap_async_io_complete, |
| 203 | 202 | ||
| 204 | TP_PROTO(struct device *dev), | 203 | TP_PROTO(struct regmap *map), |
| 205 | 204 | ||
| 206 | TP_ARGS(dev) | 205 | TP_ARGS(map) |
| 207 | 206 | ||
| 208 | ); | 207 | ); |
| 209 | 208 | ||
| 210 | DEFINE_EVENT(regmap_async, regmap_async_complete_start, | 209 | DEFINE_EVENT(regmap_async, regmap_async_complete_start, |
| 211 | 210 | ||
| 212 | TP_PROTO(struct device *dev), | 211 | TP_PROTO(struct regmap *map), |
| 213 | 212 | ||
| 214 | TP_ARGS(dev) | 213 | TP_ARGS(map) |
| 215 | 214 | ||
| 216 | ); | 215 | ); |
| 217 | 216 | ||
| 218 | DEFINE_EVENT(regmap_async, regmap_async_complete_done, | 217 | DEFINE_EVENT(regmap_async, regmap_async_complete_done, |
| 219 | 218 | ||
| 220 | TP_PROTO(struct device *dev), | 219 | TP_PROTO(struct regmap *map), |
| 221 | 220 | ||
| 222 | TP_ARGS(dev) | 221 | TP_ARGS(map) |
| 223 | 222 | ||
| 224 | ); | 223 | ); |
| 225 | 224 | ||
| 226 | TRACE_EVENT(regcache_drop_region, | 225 | TRACE_EVENT(regcache_drop_region, |
| 227 | 226 | ||
| 228 | TP_PROTO(struct device *dev, unsigned int from, | 227 | TP_PROTO(struct regmap *map, unsigned int from, |
| 229 | unsigned int to), | 228 | unsigned int to), |
| 230 | 229 | ||
| 231 | TP_ARGS(dev, from, to), | 230 | TP_ARGS(map, from, to), |
| 232 | 231 | ||
| 233 | TP_STRUCT__entry( | 232 | TP_STRUCT__entry( |
| 234 | __string( name, dev_name(dev) ) | 233 | __string( name, regmap_name(map) ) |
| 235 | __field( unsigned int, from ) | 234 | __field( unsigned int, from ) |
| 236 | __field( unsigned int, to ) | 235 | __field( unsigned int, to ) |
| 237 | ), | 236 | ), |
| 238 | 237 | ||
| 239 | TP_fast_assign( | 238 | TP_fast_assign( |
| 240 | __assign_str(name, dev_name(dev)); | 239 | __assign_str(name, regmap_name(map)); |
| 241 | __entry->from = from; | 240 | __entry->from = from; |
| 242 | __entry->to = to; | 241 | __entry->to = to; |
| 243 | ), | 242 | ), |
diff --git a/kernel/events/core.c b/kernel/events/core.c index 453ef61311d4..2fabc0627165 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
| @@ -4574,6 +4574,13 @@ static void perf_pending_event(struct irq_work *entry) | |||
| 4574 | { | 4574 | { |
| 4575 | struct perf_event *event = container_of(entry, | 4575 | struct perf_event *event = container_of(entry, |
| 4576 | struct perf_event, pending); | 4576 | struct perf_event, pending); |
| 4577 | int rctx; | ||
| 4578 | |||
| 4579 | rctx = perf_swevent_get_recursion_context(); | ||
| 4580 | /* | ||
| 4581 | * If we 'fail' here, that's OK, it means recursion is already disabled | ||
| 4582 | * and we won't recurse 'further'. | ||
| 4583 | */ | ||
| 4577 | 4584 | ||
| 4578 | if (event->pending_disable) { | 4585 | if (event->pending_disable) { |
| 4579 | event->pending_disable = 0; | 4586 | event->pending_disable = 0; |
| @@ -4584,6 +4591,9 @@ static void perf_pending_event(struct irq_work *entry) | |||
| 4584 | event->pending_wakeup = 0; | 4591 | event->pending_wakeup = 0; |
| 4585 | perf_event_wakeup(event); | 4592 | perf_event_wakeup(event); |
| 4586 | } | 4593 | } |
| 4594 | |||
| 4595 | if (rctx >= 0) | ||
| 4596 | perf_swevent_put_recursion_context(rctx); | ||
| 4587 | } | 4597 | } |
| 4588 | 4598 | ||
| 4589 | /* | 4599 | /* |
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 88d0d4420ad2..ba77ab5f64dd 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c | |||
| @@ -633,7 +633,7 @@ static int count_matching_names(struct lock_class *new_class) | |||
| 633 | if (!new_class->name) | 633 | if (!new_class->name) |
| 634 | return 0; | 634 | return 0; |
| 635 | 635 | ||
| 636 | list_for_each_entry(class, &all_lock_classes, lock_entry) { | 636 | list_for_each_entry_rcu(class, &all_lock_classes, lock_entry) { |
| 637 | if (new_class->key - new_class->subclass == class->key) | 637 | if (new_class->key - new_class->subclass == class->key) |
| 638 | return class->name_version; | 638 | return class->name_version; |
| 639 | if (class->name && !strcmp(class->name, new_class->name)) | 639 | if (class->name && !strcmp(class->name, new_class->name)) |
| @@ -700,10 +700,12 @@ look_up_lock_class(struct lockdep_map *lock, unsigned int subclass) | |||
| 700 | hash_head = classhashentry(key); | 700 | hash_head = classhashentry(key); |
| 701 | 701 | ||
| 702 | /* | 702 | /* |
| 703 | * We can walk the hash lockfree, because the hash only | 703 | * We do an RCU walk of the hash, see lockdep_free_key_range(). |
| 704 | * grows, and we are careful when adding entries to the end: | ||
| 705 | */ | 704 | */ |
| 706 | list_for_each_entry(class, hash_head, hash_entry) { | 705 | if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) |
| 706 | return NULL; | ||
| 707 | |||
| 708 | list_for_each_entry_rcu(class, hash_head, hash_entry) { | ||
| 707 | if (class->key == key) { | 709 | if (class->key == key) { |
| 708 | /* | 710 | /* |
| 709 | * Huh! same key, different name? Did someone trample | 711 | * Huh! same key, different name? Did someone trample |
| @@ -728,7 +730,8 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force) | |||
| 728 | struct lockdep_subclass_key *key; | 730 | struct lockdep_subclass_key *key; |
| 729 | struct list_head *hash_head; | 731 | struct list_head *hash_head; |
| 730 | struct lock_class *class; | 732 | struct lock_class *class; |
| 731 | unsigned long flags; | 733 | |
| 734 | DEBUG_LOCKS_WARN_ON(!irqs_disabled()); | ||
| 732 | 735 | ||
| 733 | class = look_up_lock_class(lock, subclass); | 736 | class = look_up_lock_class(lock, subclass); |
| 734 | if (likely(class)) | 737 | if (likely(class)) |
| @@ -750,28 +753,26 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force) | |||
| 750 | key = lock->key->subkeys + subclass; | 753 | key = lock->key->subkeys + subclass; |
| 751 | hash_head = classhashentry(key); | 754 | hash_head = classhashentry(key); |
| 752 | 755 | ||
| 753 | raw_local_irq_save(flags); | ||
| 754 | if (!graph_lock()) { | 756 | if (!graph_lock()) { |
| 755 | raw_local_irq_restore(flags); | ||
| 756 | return NULL; | 757 | return NULL; |
| 757 | } | 758 | } |
| 758 | /* | 759 | /* |
| 759 | * We have to do the hash-walk again, to avoid races | 760 | * We have to do the hash-walk again, to avoid races |
| 760 | * with another CPU: | 761 | * with another CPU: |
| 761 | */ | 762 | */ |
| 762 | list_for_each_entry(class, hash_head, hash_entry) | 763 | list_for_each_entry_rcu(class, hash_head, hash_entry) { |
| 763 | if (class->key == key) | 764 | if (class->key == key) |
| 764 | goto out_unlock_set; | 765 | goto out_unlock_set; |
| 766 | } | ||
| 767 | |||
| 765 | /* | 768 | /* |
| 766 | * Allocate a new key from the static array, and add it to | 769 | * Allocate a new key from the static array, and add it to |
| 767 | * the hash: | 770 | * the hash: |
| 768 | */ | 771 | */ |
| 769 | if (nr_lock_classes >= MAX_LOCKDEP_KEYS) { | 772 | if (nr_lock_classes >= MAX_LOCKDEP_KEYS) { |
| 770 | if (!debug_locks_off_graph_unlock()) { | 773 | if (!debug_locks_off_graph_unlock()) { |
| 771 | raw_local_irq_restore(flags); | ||
| 772 | return NULL; | 774 | return NULL; |
| 773 | } | 775 | } |
| 774 | raw_local_irq_restore(flags); | ||
| 775 | 776 | ||
| 776 | print_lockdep_off("BUG: MAX_LOCKDEP_KEYS too low!"); | 777 | print_lockdep_off("BUG: MAX_LOCKDEP_KEYS too low!"); |
| 777 | dump_stack(); | 778 | dump_stack(); |
| @@ -798,7 +799,6 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force) | |||
| 798 | 799 | ||
| 799 | if (verbose(class)) { | 800 | if (verbose(class)) { |
| 800 | graph_unlock(); | 801 | graph_unlock(); |
| 801 | raw_local_irq_restore(flags); | ||
| 802 | 802 | ||
| 803 | printk("\nnew class %p: %s", class->key, class->name); | 803 | printk("\nnew class %p: %s", class->key, class->name); |
| 804 | if (class->name_version > 1) | 804 | if (class->name_version > 1) |
| @@ -806,15 +806,12 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force) | |||
| 806 | printk("\n"); | 806 | printk("\n"); |
| 807 | dump_stack(); | 807 | dump_stack(); |
| 808 | 808 | ||
| 809 | raw_local_irq_save(flags); | ||
| 810 | if (!graph_lock()) { | 809 | if (!graph_lock()) { |
| 811 | raw_local_irq_restore(flags); | ||
| 812 | return NULL; | 810 | return NULL; |
| 813 | } | 811 | } |
| 814 | } | 812 | } |
| 815 | out_unlock_set: | 813 | out_unlock_set: |
| 816 | graph_unlock(); | 814 | graph_unlock(); |
| 817 | raw_local_irq_restore(flags); | ||
| 818 | 815 | ||
| 819 | out_set_class_cache: | 816 | out_set_class_cache: |
| 820 | if (!subclass || force) | 817 | if (!subclass || force) |
| @@ -870,11 +867,9 @@ static int add_lock_to_list(struct lock_class *class, struct lock_class *this, | |||
| 870 | entry->distance = distance; | 867 | entry->distance = distance; |
| 871 | entry->trace = *trace; | 868 | entry->trace = *trace; |
| 872 | /* | 869 | /* |
| 873 | * Since we never remove from the dependency list, the list can | 870 | * Both allocation and removal are done under the graph lock; but |
| 874 | * be walked lockless by other CPUs, it's only allocation | 871 | * iteration is under RCU-sched; see look_up_lock_class() and |
| 875 | * that must be protected by the spinlock. But this also means | 872 | * lockdep_free_key_range(). |
| 876 | * we must make new entries visible only once writes to the | ||
| 877 | * entry become visible - hence the RCU op: | ||
| 878 | */ | 873 | */ |
| 879 | list_add_tail_rcu(&entry->entry, head); | 874 | list_add_tail_rcu(&entry->entry, head); |
| 880 | 875 | ||
| @@ -1025,7 +1020,9 @@ static int __bfs(struct lock_list *source_entry, | |||
| 1025 | else | 1020 | else |
| 1026 | head = &lock->class->locks_before; | 1021 | head = &lock->class->locks_before; |
| 1027 | 1022 | ||
| 1028 | list_for_each_entry(entry, head, entry) { | 1023 | DEBUG_LOCKS_WARN_ON(!irqs_disabled()); |
| 1024 | |||
| 1025 | list_for_each_entry_rcu(entry, head, entry) { | ||
| 1029 | if (!lock_accessed(entry)) { | 1026 | if (!lock_accessed(entry)) { |
| 1030 | unsigned int cq_depth; | 1027 | unsigned int cq_depth; |
| 1031 | mark_lock_accessed(entry, lock); | 1028 | mark_lock_accessed(entry, lock); |
| @@ -2022,7 +2019,7 @@ static inline int lookup_chain_cache(struct task_struct *curr, | |||
| 2022 | * We can walk it lock-free, because entries only get added | 2019 | * We can walk it lock-free, because entries only get added |
| 2023 | * to the hash: | 2020 | * to the hash: |
| 2024 | */ | 2021 | */ |
| 2025 | list_for_each_entry(chain, hash_head, entry) { | 2022 | list_for_each_entry_rcu(chain, hash_head, entry) { |
| 2026 | if (chain->chain_key == chain_key) { | 2023 | if (chain->chain_key == chain_key) { |
| 2027 | cache_hit: | 2024 | cache_hit: |
| 2028 | debug_atomic_inc(chain_lookup_hits); | 2025 | debug_atomic_inc(chain_lookup_hits); |
| @@ -2996,8 +2993,18 @@ void lockdep_init_map(struct lockdep_map *lock, const char *name, | |||
| 2996 | if (unlikely(!debug_locks)) | 2993 | if (unlikely(!debug_locks)) |
| 2997 | return; | 2994 | return; |
| 2998 | 2995 | ||
| 2999 | if (subclass) | 2996 | if (subclass) { |
| 2997 | unsigned long flags; | ||
| 2998 | |||
| 2999 | if (DEBUG_LOCKS_WARN_ON(current->lockdep_recursion)) | ||
| 3000 | return; | ||
| 3001 | |||
| 3002 | raw_local_irq_save(flags); | ||
| 3003 | current->lockdep_recursion = 1; | ||
| 3000 | register_lock_class(lock, subclass, 1); | 3004 | register_lock_class(lock, subclass, 1); |
| 3005 | current->lockdep_recursion = 0; | ||
| 3006 | raw_local_irq_restore(flags); | ||
| 3007 | } | ||
| 3001 | } | 3008 | } |
| 3002 | EXPORT_SYMBOL_GPL(lockdep_init_map); | 3009 | EXPORT_SYMBOL_GPL(lockdep_init_map); |
| 3003 | 3010 | ||
| @@ -3887,9 +3894,17 @@ static inline int within(const void *addr, void *start, unsigned long size) | |||
| 3887 | return addr >= start && addr < start + size; | 3894 | return addr >= start && addr < start + size; |
| 3888 | } | 3895 | } |
| 3889 | 3896 | ||
| 3897 | /* | ||
| 3898 | * Used in module.c to remove lock classes from memory that is going to be | ||
| 3899 | * freed; and possibly re-used by other modules. | ||
| 3900 | * | ||
| 3901 | * We will have had one sync_sched() before getting here, so we're guaranteed | ||
| 3902 | * nobody will look up these exact classes -- they're properly dead but still | ||
| 3903 | * allocated. | ||
| 3904 | */ | ||
| 3890 | void lockdep_free_key_range(void *start, unsigned long size) | 3905 | void lockdep_free_key_range(void *start, unsigned long size) |
| 3891 | { | 3906 | { |
| 3892 | struct lock_class *class, *next; | 3907 | struct lock_class *class; |
| 3893 | struct list_head *head; | 3908 | struct list_head *head; |
| 3894 | unsigned long flags; | 3909 | unsigned long flags; |
| 3895 | int i; | 3910 | int i; |
| @@ -3905,7 +3920,7 @@ void lockdep_free_key_range(void *start, unsigned long size) | |||
| 3905 | head = classhash_table + i; | 3920 | head = classhash_table + i; |
| 3906 | if (list_empty(head)) | 3921 | if (list_empty(head)) |
| 3907 | continue; | 3922 | continue; |
| 3908 | list_for_each_entry_safe(class, next, head, hash_entry) { | 3923 | list_for_each_entry_rcu(class, head, hash_entry) { |
| 3909 | if (within(class->key, start, size)) | 3924 | if (within(class->key, start, size)) |
| 3910 | zap_class(class); | 3925 | zap_class(class); |
| 3911 | else if (within(class->name, start, size)) | 3926 | else if (within(class->name, start, size)) |
| @@ -3916,11 +3931,25 @@ void lockdep_free_key_range(void *start, unsigned long size) | |||
| 3916 | if (locked) | 3931 | if (locked) |
| 3917 | graph_unlock(); | 3932 | graph_unlock(); |
| 3918 | raw_local_irq_restore(flags); | 3933 | raw_local_irq_restore(flags); |
| 3934 | |||
| 3935 | /* | ||
| 3936 | * Wait for any possible iterators from look_up_lock_class() to pass | ||
| 3937 | * before continuing to free the memory they refer to. | ||
| 3938 | * | ||
| 3939 | * sync_sched() is sufficient because the read-side is IRQ disable. | ||
| 3940 | */ | ||
| 3941 | synchronize_sched(); | ||
| 3942 | |||
| 3943 | /* | ||
| 3944 | * XXX at this point we could return the resources to the pool; | ||
| 3945 | * instead we leak them. We would need to change to bitmap allocators | ||
| 3946 | * instead of the linear allocators we have now. | ||
| 3947 | */ | ||
| 3919 | } | 3948 | } |
| 3920 | 3949 | ||
| 3921 | void lockdep_reset_lock(struct lockdep_map *lock) | 3950 | void lockdep_reset_lock(struct lockdep_map *lock) |
| 3922 | { | 3951 | { |
| 3923 | struct lock_class *class, *next; | 3952 | struct lock_class *class; |
| 3924 | struct list_head *head; | 3953 | struct list_head *head; |
| 3925 | unsigned long flags; | 3954 | unsigned long flags; |
| 3926 | int i, j; | 3955 | int i, j; |
| @@ -3948,7 +3977,7 @@ void lockdep_reset_lock(struct lockdep_map *lock) | |||
| 3948 | head = classhash_table + i; | 3977 | head = classhash_table + i; |
| 3949 | if (list_empty(head)) | 3978 | if (list_empty(head)) |
| 3950 | continue; | 3979 | continue; |
| 3951 | list_for_each_entry_safe(class, next, head, hash_entry) { | 3980 | list_for_each_entry_rcu(class, head, hash_entry) { |
| 3952 | int match = 0; | 3981 | int match = 0; |
| 3953 | 3982 | ||
| 3954 | for (j = 0; j < NR_LOCKDEP_CACHING_CLASSES; j++) | 3983 | for (j = 0; j < NR_LOCKDEP_CACHING_CLASSES; j++) |
diff --git a/kernel/module.c b/kernel/module.c index b3d634ed06c9..99fdf94efce8 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -1865,7 +1865,7 @@ static void free_module(struct module *mod) | |||
| 1865 | kfree(mod->args); | 1865 | kfree(mod->args); |
| 1866 | percpu_modfree(mod); | 1866 | percpu_modfree(mod); |
| 1867 | 1867 | ||
| 1868 | /* Free lock-classes: */ | 1868 | /* Free lock-classes; relies on the preceding sync_rcu(). */ |
| 1869 | lockdep_free_key_range(mod->module_core, mod->core_size); | 1869 | lockdep_free_key_range(mod->module_core, mod->core_size); |
| 1870 | 1870 | ||
| 1871 | /* Finally, free the core (containing the module structure) */ | 1871 | /* Finally, free the core (containing the module structure) */ |
| @@ -3349,9 +3349,6 @@ static int load_module(struct load_info *info, const char __user *uargs, | |||
| 3349 | module_bug_cleanup(mod); | 3349 | module_bug_cleanup(mod); |
| 3350 | mutex_unlock(&module_mutex); | 3350 | mutex_unlock(&module_mutex); |
| 3351 | 3351 | ||
| 3352 | /* Free lock-classes: */ | ||
| 3353 | lockdep_free_key_range(mod->module_core, mod->core_size); | ||
| 3354 | |||
| 3355 | /* we can't deallocate the module until we clear memory protection */ | 3352 | /* we can't deallocate the module until we clear memory protection */ |
| 3356 | unset_module_init_ro_nx(mod); | 3353 | unset_module_init_ro_nx(mod); |
| 3357 | unset_module_core_ro_nx(mod); | 3354 | unset_module_core_ro_nx(mod); |
| @@ -3375,6 +3372,9 @@ static int load_module(struct load_info *info, const char __user *uargs, | |||
| 3375 | synchronize_rcu(); | 3372 | synchronize_rcu(); |
| 3376 | mutex_unlock(&module_mutex); | 3373 | mutex_unlock(&module_mutex); |
| 3377 | free_module: | 3374 | free_module: |
| 3375 | /* Free lock-classes; relies on the preceding sync_rcu() */ | ||
| 3376 | lockdep_free_key_range(mod->module_core, mod->core_size); | ||
| 3377 | |||
| 3378 | module_deallocate(mod, info); | 3378 | module_deallocate(mod, info); |
| 3379 | free_copy: | 3379 | free_copy: |
| 3380 | free_copy(info); | 3380 | free_copy(info); |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f0f831e8a345..62671f53202a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -3034,6 +3034,8 @@ void rt_mutex_setprio(struct task_struct *p, int prio) | |||
| 3034 | } else { | 3034 | } else { |
| 3035 | if (dl_prio(oldprio)) | 3035 | if (dl_prio(oldprio)) |
| 3036 | p->dl.dl_boosted = 0; | 3036 | p->dl.dl_boosted = 0; |
| 3037 | if (rt_prio(oldprio)) | ||
| 3038 | p->rt.timeout = 0; | ||
| 3037 | p->sched_class = &fair_sched_class; | 3039 | p->sched_class = &fair_sched_class; |
| 3038 | } | 3040 | } |
| 3039 | 3041 | ||
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7ce18f3c097a..bcfe32088b37 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
| @@ -1609,9 +1609,11 @@ static void update_task_scan_period(struct task_struct *p, | |||
| 1609 | /* | 1609 | /* |
| 1610 | * If there were no record hinting faults then either the task is | 1610 | * If there were no record hinting faults then either the task is |
| 1611 | * completely idle or all activity is areas that are not of interest | 1611 | * completely idle or all activity is areas that are not of interest |
| 1612 | * to automatic numa balancing. Scan slower | 1612 | * to automatic numa balancing. Related to that, if there were failed |
| 1613 | * migration then it implies we are migrating too quickly or the local | ||
| 1614 | * node is overloaded. In either case, scan slower | ||
| 1613 | */ | 1615 | */ |
| 1614 | if (local + shared == 0) { | 1616 | if (local + shared == 0 || p->numa_faults_locality[2]) { |
| 1615 | p->numa_scan_period = min(p->numa_scan_period_max, | 1617 | p->numa_scan_period = min(p->numa_scan_period_max, |
| 1616 | p->numa_scan_period << 1); | 1618 | p->numa_scan_period << 1); |
| 1617 | 1619 | ||
| @@ -2080,6 +2082,8 @@ void task_numa_fault(int last_cpupid, int mem_node, int pages, int flags) | |||
| 2080 | 2082 | ||
| 2081 | if (migrated) | 2083 | if (migrated) |
| 2082 | p->numa_pages_migrated += pages; | 2084 | p->numa_pages_migrated += pages; |
| 2085 | if (flags & TNF_MIGRATE_FAIL) | ||
| 2086 | p->numa_faults_locality[2] += pages; | ||
| 2083 | 2087 | ||
| 2084 | p->numa_faults[task_faults_idx(NUMA_MEMBUF, mem_node, priv)] += pages; | 2088 | p->numa_faults[task_faults_idx(NUMA_MEMBUF, mem_node, priv)] += pages; |
| 2085 | p->numa_faults[task_faults_idx(NUMA_CPUBUF, cpu_node, priv)] += pages; | 2089 | p->numa_faults[task_faults_idx(NUMA_CPUBUF, cpu_node, priv)] += pages; |
diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c index eb682d5c697c..6aac4beedbbe 100644 --- a/kernel/time/tick-broadcast-hrtimer.c +++ b/kernel/time/tick-broadcast-hrtimer.c | |||
| @@ -49,6 +49,7 @@ static void bc_set_mode(enum clock_event_mode mode, | |||
| 49 | */ | 49 | */ |
| 50 | static int bc_set_next(ktime_t expires, struct clock_event_device *bc) | 50 | static int bc_set_next(ktime_t expires, struct clock_event_device *bc) |
| 51 | { | 51 | { |
| 52 | int bc_moved; | ||
| 52 | /* | 53 | /* |
| 53 | * We try to cancel the timer first. If the callback is on | 54 | * We try to cancel the timer first. If the callback is on |
| 54 | * flight on some other cpu then we let it handle it. If we | 55 | * flight on some other cpu then we let it handle it. If we |
| @@ -60,9 +61,15 @@ static int bc_set_next(ktime_t expires, struct clock_event_device *bc) | |||
| 60 | * restart the timer because we are in the callback, but we | 61 | * restart the timer because we are in the callback, but we |
| 61 | * can set the expiry time and let the callback return | 62 | * can set the expiry time and let the callback return |
| 62 | * HRTIMER_RESTART. | 63 | * HRTIMER_RESTART. |
| 64 | * | ||
| 65 | * Since we are in the idle loop at this point and because | ||
| 66 | * hrtimer_{start/cancel} functions call into tracing, | ||
| 67 | * calls to these functions must be bound within RCU_NONIDLE. | ||
| 63 | */ | 68 | */ |
| 64 | if (hrtimer_try_to_cancel(&bctimer) >= 0) { | 69 | RCU_NONIDLE(bc_moved = (hrtimer_try_to_cancel(&bctimer) >= 0) ? |
| 65 | hrtimer_start(&bctimer, expires, HRTIMER_MODE_ABS_PINNED); | 70 | !hrtimer_start(&bctimer, expires, HRTIMER_MODE_ABS_PINNED) : |
| 71 | 0); | ||
| 72 | if (bc_moved) { | ||
| 66 | /* Bind the "device" to the cpu */ | 73 | /* Bind the "device" to the cpu */ |
| 67 | bc->bound_on = smp_processor_id(); | 74 | bc->bound_on = smp_processor_id(); |
| 68 | } else if (bc->bound_on == smp_processor_id()) { | 75 | } else if (bc->bound_on == smp_processor_id()) { |
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 626e93db28ba..6817b0350c71 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
| @@ -1260,6 +1260,7 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 1260 | int target_nid, last_cpupid = -1; | 1260 | int target_nid, last_cpupid = -1; |
| 1261 | bool page_locked; | 1261 | bool page_locked; |
| 1262 | bool migrated = false; | 1262 | bool migrated = false; |
| 1263 | bool was_writable; | ||
| 1263 | int flags = 0; | 1264 | int flags = 0; |
| 1264 | 1265 | ||
| 1265 | /* A PROT_NONE fault should not end up here */ | 1266 | /* A PROT_NONE fault should not end up here */ |
| @@ -1291,17 +1292,8 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 1291 | flags |= TNF_FAULT_LOCAL; | 1292 | flags |= TNF_FAULT_LOCAL; |
| 1292 | } | 1293 | } |
| 1293 | 1294 | ||
| 1294 | /* | 1295 | /* See similar comment in do_numa_page for explanation */ |
| 1295 | * Avoid grouping on DSO/COW pages in specific and RO pages | 1296 | if (!(vma->vm_flags & VM_WRITE)) |
| 1296 | * in general, RO pages shouldn't hurt as much anyway since | ||
| 1297 | * they can be in shared cache state. | ||
| 1298 | * | ||
| 1299 | * FIXME! This checks "pmd_dirty()" as an approximation of | ||
| 1300 | * "is this a read-only page", since checking "pmd_write()" | ||
| 1301 | * is even more broken. We haven't actually turned this into | ||
| 1302 | * a writable page, so pmd_write() will always be false. | ||
| 1303 | */ | ||
| 1304 | if (!pmd_dirty(pmd)) | ||
| 1305 | flags |= TNF_NO_GROUP; | 1297 | flags |= TNF_NO_GROUP; |
| 1306 | 1298 | ||
| 1307 | /* | 1299 | /* |
| @@ -1358,12 +1350,17 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 1358 | if (migrated) { | 1350 | if (migrated) { |
| 1359 | flags |= TNF_MIGRATED; | 1351 | flags |= TNF_MIGRATED; |
| 1360 | page_nid = target_nid; | 1352 | page_nid = target_nid; |
| 1361 | } | 1353 | } else |
| 1354 | flags |= TNF_MIGRATE_FAIL; | ||
| 1362 | 1355 | ||
| 1363 | goto out; | 1356 | goto out; |
| 1364 | clear_pmdnuma: | 1357 | clear_pmdnuma: |
| 1365 | BUG_ON(!PageLocked(page)); | 1358 | BUG_ON(!PageLocked(page)); |
| 1359 | was_writable = pmd_write(pmd); | ||
| 1366 | pmd = pmd_modify(pmd, vma->vm_page_prot); | 1360 | pmd = pmd_modify(pmd, vma->vm_page_prot); |
| 1361 | pmd = pmd_mkyoung(pmd); | ||
| 1362 | if (was_writable) | ||
| 1363 | pmd = pmd_mkwrite(pmd); | ||
| 1367 | set_pmd_at(mm, haddr, pmdp, pmd); | 1364 | set_pmd_at(mm, haddr, pmdp, pmd); |
| 1368 | update_mmu_cache_pmd(vma, addr, pmdp); | 1365 | update_mmu_cache_pmd(vma, addr, pmdp); |
| 1369 | unlock_page(page); | 1366 | unlock_page(page); |
| @@ -1487,6 +1484,7 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | |||
| 1487 | 1484 | ||
| 1488 | if (__pmd_trans_huge_lock(pmd, vma, &ptl) == 1) { | 1485 | if (__pmd_trans_huge_lock(pmd, vma, &ptl) == 1) { |
| 1489 | pmd_t entry; | 1486 | pmd_t entry; |
| 1487 | bool preserve_write = prot_numa && pmd_write(*pmd); | ||
| 1490 | ret = 1; | 1488 | ret = 1; |
| 1491 | 1489 | ||
| 1492 | /* | 1490 | /* |
| @@ -1502,9 +1500,11 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | |||
| 1502 | if (!prot_numa || !pmd_protnone(*pmd)) { | 1500 | if (!prot_numa || !pmd_protnone(*pmd)) { |
| 1503 | entry = pmdp_get_and_clear_notify(mm, addr, pmd); | 1501 | entry = pmdp_get_and_clear_notify(mm, addr, pmd); |
| 1504 | entry = pmd_modify(entry, newprot); | 1502 | entry = pmd_modify(entry, newprot); |
| 1503 | if (preserve_write) | ||
| 1504 | entry = pmd_mkwrite(entry); | ||
| 1505 | ret = HPAGE_PMD_NR; | 1505 | ret = HPAGE_PMD_NR; |
| 1506 | set_pmd_at(mm, addr, pmd, entry); | 1506 | set_pmd_at(mm, addr, pmd, entry); |
| 1507 | BUG_ON(pmd_write(entry)); | 1507 | BUG_ON(!preserve_write && pmd_write(entry)); |
| 1508 | } | 1508 | } |
| 1509 | spin_unlock(ptl); | 1509 | spin_unlock(ptl); |
| 1510 | } | 1510 | } |
diff --git a/mm/memory.c b/mm/memory.c index 411144f977b1..97839f5c8c30 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
| @@ -3035,6 +3035,7 @@ static int do_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 3035 | int last_cpupid; | 3035 | int last_cpupid; |
| 3036 | int target_nid; | 3036 | int target_nid; |
| 3037 | bool migrated = false; | 3037 | bool migrated = false; |
| 3038 | bool was_writable = pte_write(pte); | ||
| 3038 | int flags = 0; | 3039 | int flags = 0; |
| 3039 | 3040 | ||
| 3040 | /* A PROT_NONE fault should not end up here */ | 3041 | /* A PROT_NONE fault should not end up here */ |
| @@ -3059,6 +3060,8 @@ static int do_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 3059 | /* Make it present again */ | 3060 | /* Make it present again */ |
| 3060 | pte = pte_modify(pte, vma->vm_page_prot); | 3061 | pte = pte_modify(pte, vma->vm_page_prot); |
| 3061 | pte = pte_mkyoung(pte); | 3062 | pte = pte_mkyoung(pte); |
| 3063 | if (was_writable) | ||
| 3064 | pte = pte_mkwrite(pte); | ||
| 3062 | set_pte_at(mm, addr, ptep, pte); | 3065 | set_pte_at(mm, addr, ptep, pte); |
| 3063 | update_mmu_cache(vma, addr, ptep); | 3066 | update_mmu_cache(vma, addr, ptep); |
| 3064 | 3067 | ||
| @@ -3069,16 +3072,14 @@ static int do_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 3069 | } | 3072 | } |
| 3070 | 3073 | ||
| 3071 | /* | 3074 | /* |
| 3072 | * Avoid grouping on DSO/COW pages in specific and RO pages | 3075 | * Avoid grouping on RO pages in general. RO pages shouldn't hurt as |
| 3073 | * in general, RO pages shouldn't hurt as much anyway since | 3076 | * much anyway since they can be in shared cache state. This misses |
| 3074 | * they can be in shared cache state. | 3077 | * the case where a mapping is writable but the process never writes |
| 3075 | * | 3078 | * to it but pte_write gets cleared during protection updates and |
| 3076 | * FIXME! This checks "pmd_dirty()" as an approximation of | 3079 | * pte_dirty has unpredictable behaviour between PTE scan updates, |
| 3077 | * "is this a read-only page", since checking "pmd_write()" | 3080 | * background writeback, dirty balancing and application behaviour. |
| 3078 | * is even more broken. We haven't actually turned this into | ||
| 3079 | * a writable page, so pmd_write() will always be false. | ||
| 3080 | */ | 3081 | */ |
| 3081 | if (!pte_dirty(pte)) | 3082 | if (!(vma->vm_flags & VM_WRITE)) |
| 3082 | flags |= TNF_NO_GROUP; | 3083 | flags |= TNF_NO_GROUP; |
| 3083 | 3084 | ||
| 3084 | /* | 3085 | /* |
| @@ -3102,7 +3103,8 @@ static int do_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 3102 | if (migrated) { | 3103 | if (migrated) { |
| 3103 | page_nid = target_nid; | 3104 | page_nid = target_nid; |
| 3104 | flags |= TNF_MIGRATED; | 3105 | flags |= TNF_MIGRATED; |
| 3105 | } | 3106 | } else |
| 3107 | flags |= TNF_MIGRATE_FAIL; | ||
| 3106 | 3108 | ||
| 3107 | out: | 3109 | out: |
| 3108 | if (page_nid != -1) | 3110 | if (page_nid != -1) |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 9fab10795bea..65842d688b7c 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
| @@ -1092,6 +1092,10 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start) | |||
| 1092 | return NULL; | 1092 | return NULL; |
| 1093 | 1093 | ||
| 1094 | arch_refresh_nodedata(nid, pgdat); | 1094 | arch_refresh_nodedata(nid, pgdat); |
| 1095 | } else { | ||
| 1096 | /* Reset the nr_zones and classzone_idx to 0 before reuse */ | ||
| 1097 | pgdat->nr_zones = 0; | ||
| 1098 | pgdat->classzone_idx = 0; | ||
| 1095 | } | 1099 | } |
| 1096 | 1100 | ||
| 1097 | /* we can use NODE_DATA(nid) from here */ | 1101 | /* we can use NODE_DATA(nid) from here */ |
| @@ -1977,15 +1981,6 @@ void try_offline_node(int nid) | |||
| 1977 | if (is_vmalloc_addr(zone->wait_table)) | 1981 | if (is_vmalloc_addr(zone->wait_table)) |
| 1978 | vfree(zone->wait_table); | 1982 | vfree(zone->wait_table); |
| 1979 | } | 1983 | } |
| 1980 | |||
| 1981 | /* | ||
| 1982 | * Since there is no way to guarentee the address of pgdat/zone is not | ||
| 1983 | * on stack of any kernel threads or used by other kernel objects | ||
| 1984 | * without reference counting or other symchronizing method, do not | ||
| 1985 | * reset node_data and free pgdat here. Just reset it to 0 and reuse | ||
| 1986 | * the memory when the node is online again. | ||
| 1987 | */ | ||
| 1988 | memset(pgdat, 0, sizeof(*pgdat)); | ||
| 1989 | } | 1984 | } |
| 1990 | EXPORT_SYMBOL(try_offline_node); | 1985 | EXPORT_SYMBOL(try_offline_node); |
| 1991 | 1986 | ||
| @@ -774,10 +774,8 @@ again: remove_next = 1 + (end > next->vm_end); | |||
| 774 | 774 | ||
| 775 | importer->anon_vma = exporter->anon_vma; | 775 | importer->anon_vma = exporter->anon_vma; |
| 776 | error = anon_vma_clone(importer, exporter); | 776 | error = anon_vma_clone(importer, exporter); |
| 777 | if (error) { | 777 | if (error) |
| 778 | importer->anon_vma = NULL; | ||
| 779 | return error; | 778 | return error; |
| 780 | } | ||
| 781 | } | 779 | } |
| 782 | } | 780 | } |
| 783 | 781 | ||
diff --git a/mm/mprotect.c b/mm/mprotect.c index 44727811bf4c..88584838e704 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c | |||
| @@ -75,6 +75,7 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd, | |||
| 75 | oldpte = *pte; | 75 | oldpte = *pte; |
| 76 | if (pte_present(oldpte)) { | 76 | if (pte_present(oldpte)) { |
| 77 | pte_t ptent; | 77 | pte_t ptent; |
| 78 | bool preserve_write = prot_numa && pte_write(oldpte); | ||
| 78 | 79 | ||
| 79 | /* | 80 | /* |
| 80 | * Avoid trapping faults against the zero or KSM | 81 | * Avoid trapping faults against the zero or KSM |
| @@ -94,6 +95,8 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd, | |||
| 94 | 95 | ||
| 95 | ptent = ptep_modify_prot_start(mm, addr, pte); | 96 | ptent = ptep_modify_prot_start(mm, addr, pte); |
| 96 | ptent = pte_modify(ptent, newprot); | 97 | ptent = pte_modify(ptent, newprot); |
| 98 | if (preserve_write) | ||
| 99 | ptent = pte_mkwrite(ptent); | ||
| 97 | 100 | ||
| 98 | /* Avoid taking write faults for known dirty pages */ | 101 | /* Avoid taking write faults for known dirty pages */ |
| 99 | if (dirty_accountable && pte_dirty(ptent) && | 102 | if (dirty_accountable && pte_dirty(ptent) && |
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 45e187b2d971..644bcb665773 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
| @@ -857,8 +857,11 @@ static void bdi_update_write_bandwidth(struct backing_dev_info *bdi, | |||
| 857 | * bw * elapsed + write_bandwidth * (period - elapsed) | 857 | * bw * elapsed + write_bandwidth * (period - elapsed) |
| 858 | * write_bandwidth = --------------------------------------------------- | 858 | * write_bandwidth = --------------------------------------------------- |
| 859 | * period | 859 | * period |
| 860 | * | ||
| 861 | * @written may have decreased due to account_page_redirty(). | ||
| 862 | * Avoid underflowing @bw calculation. | ||
| 860 | */ | 863 | */ |
| 861 | bw = written - bdi->written_stamp; | 864 | bw = written - min(written, bdi->written_stamp); |
| 862 | bw *= HZ; | 865 | bw *= HZ; |
| 863 | if (unlikely(elapsed > period)) { | 866 | if (unlikely(elapsed > period)) { |
| 864 | do_div(bw, elapsed); | 867 | do_div(bw, elapsed); |
| @@ -922,7 +925,7 @@ static void global_update_bandwidth(unsigned long thresh, | |||
| 922 | unsigned long now) | 925 | unsigned long now) |
| 923 | { | 926 | { |
| 924 | static DEFINE_SPINLOCK(dirty_lock); | 927 | static DEFINE_SPINLOCK(dirty_lock); |
| 925 | static unsigned long update_time; | 928 | static unsigned long update_time = INITIAL_JIFFIES; |
| 926 | 929 | ||
| 927 | /* | 930 | /* |
| 928 | * check locklessly first to optimize away locking for the most time | 931 | * check locklessly first to optimize away locking for the most time |
diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 72f5ac381ab3..755a42c76eb4 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c | |||
| @@ -103,6 +103,7 @@ void unset_migratetype_isolate(struct page *page, unsigned migratetype) | |||
| 103 | 103 | ||
| 104 | if (!is_migrate_isolate_page(buddy)) { | 104 | if (!is_migrate_isolate_page(buddy)) { |
| 105 | __isolate_free_page(page, order); | 105 | __isolate_free_page(page, order); |
| 106 | kernel_map_pages(page, (1 << order), 1); | ||
| 106 | set_page_refcounted(page); | 107 | set_page_refcounted(page); |
| 107 | isolated_page = page; | 108 | isolated_page = page; |
| 108 | } | 109 | } |
diff --git a/mm/pagewalk.c b/mm/pagewalk.c index 75c1f2878519..29f2f8b853ae 100644 --- a/mm/pagewalk.c +++ b/mm/pagewalk.c | |||
| @@ -265,8 +265,15 @@ int walk_page_range(unsigned long start, unsigned long end, | |||
| 265 | vma = vma->vm_next; | 265 | vma = vma->vm_next; |
| 266 | 266 | ||
| 267 | err = walk_page_test(start, next, walk); | 267 | err = walk_page_test(start, next, walk); |
| 268 | if (err > 0) | 268 | if (err > 0) { |
| 269 | /* | ||
| 270 | * positive return values are purely for | ||
| 271 | * controlling the pagewalk, so should never | ||
| 272 | * be passed to the callers. | ||
| 273 | */ | ||
| 274 | err = 0; | ||
| 269 | continue; | 275 | continue; |
| 276 | } | ||
| 270 | if (err < 0) | 277 | if (err < 0) |
| 271 | break; | 278 | break; |
| 272 | } | 279 | } |
| @@ -287,6 +287,13 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src) | |||
| 287 | return 0; | 287 | return 0; |
| 288 | 288 | ||
| 289 | enomem_failure: | 289 | enomem_failure: |
| 290 | /* | ||
| 291 | * dst->anon_vma is dropped here otherwise its degree can be incorrectly | ||
| 292 | * decremented in unlink_anon_vmas(). | ||
| 293 | * We can safely do this because callers of anon_vma_clone() don't care | ||
| 294 | * about dst->anon_vma if anon_vma_clone() failed. | ||
| 295 | */ | ||
| 296 | dst->anon_vma = NULL; | ||
| 290 | unlink_anon_vmas(dst); | 297 | unlink_anon_vmas(dst); |
| 291 | return -ENOMEM; | 298 | return -ENOMEM; |
| 292 | } | 299 | } |
| @@ -2449,7 +2449,8 @@ redo: | |||
| 2449 | do { | 2449 | do { |
| 2450 | tid = this_cpu_read(s->cpu_slab->tid); | 2450 | tid = this_cpu_read(s->cpu_slab->tid); |
| 2451 | c = raw_cpu_ptr(s->cpu_slab); | 2451 | c = raw_cpu_ptr(s->cpu_slab); |
| 2452 | } while (IS_ENABLED(CONFIG_PREEMPT) && unlikely(tid != c->tid)); | 2452 | } while (IS_ENABLED(CONFIG_PREEMPT) && |
| 2453 | unlikely(tid != READ_ONCE(c->tid))); | ||
| 2453 | 2454 | ||
| 2454 | /* | 2455 | /* |
| 2455 | * Irqless object alloc/free algorithm used here depends on sequence | 2456 | * Irqless object alloc/free algorithm used here depends on sequence |
| @@ -2718,7 +2719,8 @@ redo: | |||
| 2718 | do { | 2719 | do { |
| 2719 | tid = this_cpu_read(s->cpu_slab->tid); | 2720 | tid = this_cpu_read(s->cpu_slab->tid); |
| 2720 | c = raw_cpu_ptr(s->cpu_slab); | 2721 | c = raw_cpu_ptr(s->cpu_slab); |
| 2721 | } while (IS_ENABLED(CONFIG_PREEMPT) && unlikely(tid != c->tid)); | 2722 | } while (IS_ENABLED(CONFIG_PREEMPT) && |
| 2723 | unlikely(tid != READ_ONCE(c->tid))); | ||
| 2722 | 2724 | ||
| 2723 | /* Same with comment on barrier() in slab_alloc_node() */ | 2725 | /* Same with comment on barrier() in slab_alloc_node() */ |
| 2724 | barrier(); | 2726 | barrier(); |
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 1684bcc78b34..5fde34326dcf 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
| @@ -152,7 +152,7 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf, | |||
| 152 | goto out; | 152 | goto out; |
| 153 | 153 | ||
| 154 | /* No partial writes. */ | 154 | /* No partial writes. */ |
| 155 | length = EINVAL; | 155 | length = -EINVAL; |
| 156 | if (*ppos != 0) | 156 | if (*ppos != 0) |
| 157 | goto out; | 157 | goto out; |
| 158 | 158 | ||
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 4ca3d5d02436..a8a1e14272a1 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
| @@ -1989,7 +1989,7 @@ static const struct pci_device_id azx_ids[] = { | |||
| 1989 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, | 1989 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, |
| 1990 | /* Sunrise Point */ | 1990 | /* Sunrise Point */ |
| 1991 | { PCI_DEVICE(0x8086, 0xa170), | 1991 | { PCI_DEVICE(0x8086, 0xa170), |
| 1992 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, | 1992 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE }, |
| 1993 | /* Sunrise Point-LP */ | 1993 | /* Sunrise Point-LP */ |
| 1994 | { PCI_DEVICE(0x8086, 0x9d70), | 1994 | { PCI_DEVICE(0x8086, 0x9d70), |
| 1995 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE }, | 1995 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE }, |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 526398a4a442..74382137b9f5 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -396,7 +396,7 @@ static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) | |||
| 396 | { | 396 | { |
| 397 | /* We currently only handle front, HP */ | 397 | /* We currently only handle front, HP */ |
| 398 | static hda_nid_t pins[] = { | 398 | static hda_nid_t pins[] = { |
| 399 | 0x0f, 0x10, 0x14, 0x15, 0 | 399 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
| 400 | }; | 400 | }; |
| 401 | hda_nid_t *p; | 401 | hda_nid_t *p; |
| 402 | for (p = pins; *p; p++) | 402 | for (p = pins; *p; p++) |
| @@ -5036,6 +5036,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
| 5036 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), | 5036 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
| 5037 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), | 5037 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
| 5038 | SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 5038 | SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| 5039 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), | ||
| 5039 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 5040 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| 5040 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), | 5041 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
| 5041 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), | 5042 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 4e511221a0c1..0db571340edb 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile | |||
| @@ -22,6 +22,14 @@ TARGETS += vm | |||
| 22 | TARGETS_HOTPLUG = cpu-hotplug | 22 | TARGETS_HOTPLUG = cpu-hotplug |
| 23 | TARGETS_HOTPLUG += memory-hotplug | 23 | TARGETS_HOTPLUG += memory-hotplug |
| 24 | 24 | ||
| 25 | # Clear LDFLAGS and MAKEFLAGS if called from main | ||
| 26 | # Makefile to avoid test build failures when test | ||
| 27 | # Makefile doesn't have explicit build rules. | ||
| 28 | ifeq (1,$(MAKELEVEL)) | ||
| 29 | undefine LDFLAGS | ||
| 30 | override MAKEFLAGS = | ||
| 31 | endif | ||
| 32 | |||
| 25 | all: | 33 | all: |
| 26 | for TARGET in $(TARGETS); do \ | 34 | for TARGET in $(TARGETS); do \ |
| 27 | make -C $$TARGET; \ | 35 | make -C $$TARGET; \ |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index a2214d9609bd..cc6a25d95fbf 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
| @@ -471,7 +471,7 @@ static struct kvm *kvm_create_vm(unsigned long type) | |||
| 471 | BUILD_BUG_ON(KVM_MEM_SLOTS_NUM > SHRT_MAX); | 471 | BUILD_BUG_ON(KVM_MEM_SLOTS_NUM > SHRT_MAX); |
| 472 | 472 | ||
| 473 | r = -ENOMEM; | 473 | r = -ENOMEM; |
| 474 | kvm->memslots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL); | 474 | kvm->memslots = kvm_kvzalloc(sizeof(struct kvm_memslots)); |
| 475 | if (!kvm->memslots) | 475 | if (!kvm->memslots) |
| 476 | goto out_err_no_srcu; | 476 | goto out_err_no_srcu; |
| 477 | 477 | ||
| @@ -522,7 +522,7 @@ out_err_no_srcu: | |||
| 522 | out_err_no_disable: | 522 | out_err_no_disable: |
| 523 | for (i = 0; i < KVM_NR_BUSES; i++) | 523 | for (i = 0; i < KVM_NR_BUSES; i++) |
| 524 | kfree(kvm->buses[i]); | 524 | kfree(kvm->buses[i]); |
| 525 | kfree(kvm->memslots); | 525 | kvfree(kvm->memslots); |
| 526 | kvm_arch_free_vm(kvm); | 526 | kvm_arch_free_vm(kvm); |
| 527 | return ERR_PTR(r); | 527 | return ERR_PTR(r); |
| 528 | } | 528 | } |
| @@ -578,7 +578,7 @@ static void kvm_free_physmem(struct kvm *kvm) | |||
| 578 | kvm_for_each_memslot(memslot, slots) | 578 | kvm_for_each_memslot(memslot, slots) |
| 579 | kvm_free_physmem_slot(kvm, memslot, NULL); | 579 | kvm_free_physmem_slot(kvm, memslot, NULL); |
| 580 | 580 | ||
| 581 | kfree(kvm->memslots); | 581 | kvfree(kvm->memslots); |
| 582 | } | 582 | } |
| 583 | 583 | ||
| 584 | static void kvm_destroy_devices(struct kvm *kvm) | 584 | static void kvm_destroy_devices(struct kvm *kvm) |
| @@ -871,10 +871,10 @@ int __kvm_set_memory_region(struct kvm *kvm, | |||
| 871 | goto out_free; | 871 | goto out_free; |
| 872 | } | 872 | } |
| 873 | 873 | ||
| 874 | slots = kmemdup(kvm->memslots, sizeof(struct kvm_memslots), | 874 | slots = kvm_kvzalloc(sizeof(struct kvm_memslots)); |
| 875 | GFP_KERNEL); | ||
| 876 | if (!slots) | 875 | if (!slots) |
| 877 | goto out_free; | 876 | goto out_free; |
| 877 | memcpy(slots, kvm->memslots, sizeof(struct kvm_memslots)); | ||
| 878 | 878 | ||
| 879 | if ((change == KVM_MR_DELETE) || (change == KVM_MR_MOVE)) { | 879 | if ((change == KVM_MR_DELETE) || (change == KVM_MR_MOVE)) { |
| 880 | slot = id_to_memslot(slots, mem->slot); | 880 | slot = id_to_memslot(slots, mem->slot); |
| @@ -917,7 +917,7 @@ int __kvm_set_memory_region(struct kvm *kvm, | |||
| 917 | kvm_arch_commit_memory_region(kvm, mem, &old, change); | 917 | kvm_arch_commit_memory_region(kvm, mem, &old, change); |
| 918 | 918 | ||
| 919 | kvm_free_physmem_slot(kvm, &old, &new); | 919 | kvm_free_physmem_slot(kvm, &old, &new); |
| 920 | kfree(old_memslots); | 920 | kvfree(old_memslots); |
| 921 | 921 | ||
| 922 | /* | 922 | /* |
| 923 | * IOMMU mapping: New slots need to be mapped. Old slots need to be | 923 | * IOMMU mapping: New slots need to be mapped. Old slots need to be |
| @@ -936,7 +936,7 @@ int __kvm_set_memory_region(struct kvm *kvm, | |||
| 936 | return 0; | 936 | return 0; |
| 937 | 937 | ||
| 938 | out_slots: | 938 | out_slots: |
| 939 | kfree(slots); | 939 | kvfree(slots); |
| 940 | out_free: | 940 | out_free: |
| 941 | kvm_free_physmem_slot(kvm, &new, &old); | 941 | kvm_free_physmem_slot(kvm, &new, &old); |
| 942 | out: | 942 | out: |
