From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7DBEB1382C5 for ; Sun, 25 Feb 2018 13:40:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6846AE0830; Sun, 25 Feb 2018 13:40:19 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 24879E0830 for ; Sun, 25 Feb 2018 13:40:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F1019335C2F for ; Sun, 25 Feb 2018 13:40:15 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 713FA21C for ; Sun, 25 Feb 2018 13:40:14 +0000 (UTC) From: "Alice Ferrazzi" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alice Ferrazzi" Message-ID: <1519566006.b6564907ab32c1a8c890c671c1c1e8b83e4967bc.alicef@gentoo> Subject: [gentoo-commits] proj/linux-patches:4.14 commit in: / X-VCS-Repository: proj/linux-patches X-VCS-Files: 0000_README 1021_linux-4.14.22.patch X-VCS-Directories: / X-VCS-Committer: alicef X-VCS-Committer-Name: Alice Ferrazzi X-VCS-Revision: b6564907ab32c1a8c890c671c1c1e8b83e4967bc X-VCS-Branch: 4.14 Date: Sun, 25 Feb 2018 13:40:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 72e1d9df-5bee-49f6-a357-5e703ac9a913 X-Archives-Hash: a5aad56115d857fb0f8ef105564cf2cb commit: b6564907ab32c1a8c890c671c1c1e8b83e4967bc Author: Alice Ferrazzi gentoo org> AuthorDate: Sun Feb 25 13:40:06 2018 +0000 Commit: Alice Ferrazzi gentoo org> CommitDate: Sun Feb 25 13:40:06 2018 +0000 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=b6564907 linux kernel 4.14.21 0000_README | 4 + 1021_linux-4.14.22.patch | 5047 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 5051 insertions(+) diff --git a/0000_README b/0000_README index f9abc2d..d7b4bf6 100644 --- a/0000_README +++ b/0000_README @@ -127,6 +127,10 @@ Patch: 1020_linux-4.14.21.patch From: http://www.kernel.org Desc: Linux 4.14.21 +Patch: 1021_linux-4.14.22.patch +From: http://www.kernel.org +Desc: Linux 4.14.22 + Patch: 1500_XATTR_USER_PREFIX.patch From: https://bugs.gentoo.org/show_bug.cgi?id=470644 Desc: Support for namespace user.pax.* on tmpfs. diff --git a/1021_linux-4.14.22.patch b/1021_linux-4.14.22.patch new file mode 100644 index 0000000..e7dd4a5 --- /dev/null +++ b/1021_linux-4.14.22.patch @@ -0,0 +1,5047 @@ +diff --git a/Makefile b/Makefile +index 68d70485b088..03d41143900c 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,7 @@ + # SPDX-License-Identifier: GPL-2.0 + VERSION = 4 + PATCHLEVEL = 14 +-SUBLEVEL = 21 ++SUBLEVEL = 22 + EXTRAVERSION = + NAME = Petit Gorille + +diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi +index e5b061469bf8..4714a59fd86d 100644 +--- a/arch/arm/boot/dts/am4372.dtsi ++++ b/arch/arm/boot/dts/am4372.dtsi +@@ -927,7 +927,8 @@ + reg = <0x48038000 0x2000>, + <0x46000000 0x400000>; + reg-names = "mpu", "dat"; +- interrupts = <80>, <81>; ++ interrupts = , ++ ; + interrupt-names = "tx", "rx"; + status = "disabled"; + dmas = <&edma 8 2>, +@@ -941,7 +942,8 @@ + reg = <0x4803C000 0x2000>, + <0x46400000 0x400000>; + reg-names = "mpu", "dat"; +- interrupts = <82>, <83>; ++ interrupts = , ++ ; + interrupt-names = "tx", "rx"; + status = "disabled"; + dmas = <&edma 10 2>, +diff --git a/arch/arm/boot/dts/am437x-cm-t43.dts b/arch/arm/boot/dts/am437x-cm-t43.dts +index 9e92d480576b..3b9a94c274a7 100644 +--- a/arch/arm/boot/dts/am437x-cm-t43.dts ++++ b/arch/arm/boot/dts/am437x-cm-t43.dts +@@ -301,8 +301,8 @@ + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins>; +- dmas = <&edma 16 +- &edma 17>; ++ dmas = <&edma 16 0 ++ &edma 17 0>; + dma-names = "tx0", "rx0"; + + flash: w25q64cvzpig@0 { +diff --git a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts +index 38faa90007d7..2fa5eb4bd402 100644 +--- a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts ++++ b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts +@@ -72,7 +72,8 @@ + }; + + &gpmc { +- ranges = <1 0 0x08000000 0x1000000>; /* CS1: 16MB for LAN9221 */ ++ ranges = <0 0 0x30000000 0x1000000 /* CS0: 16MB for NAND */ ++ 1 0 0x2c000000 0x1000000>; /* CS1: 16MB for LAN9221 */ + + ethernet@gpmc { + pinctrl-names = "default"; +diff --git a/arch/arm/boot/dts/logicpd-som-lv.dtsi b/arch/arm/boot/dts/logicpd-som-lv.dtsi +index 26cce4d18405..4f2c5ec75714 100644 +--- a/arch/arm/boot/dts/logicpd-som-lv.dtsi ++++ b/arch/arm/boot/dts/logicpd-som-lv.dtsi +@@ -37,7 +37,7 @@ + }; + + &gpmc { +- ranges = <0 0 0x00000000 0x1000000>; /* CS0: 16MB for NAND */ ++ ranges = <0 0 0x30000000 0x1000000>; /* CS0: 16MB for NAND */ + + nand@0,0 { + compatible = "ti,omap2-nand"; +@@ -121,7 +121,7 @@ + + &mmc3 { + interrupts-extended = <&intc 94 &omap3_pmx_core2 0x46>; +- pinctrl-0 = <&mmc3_pins>; ++ pinctrl-0 = <&mmc3_pins &wl127x_gpio>; + pinctrl-names = "default"; + vmmc-supply = <&wl12xx_vmmc>; + non-removable; +@@ -132,8 +132,8 @@ + wlcore: wlcore@2 { + compatible = "ti,wl1273"; + reg = <2>; +- interrupt-parent = <&gpio5>; +- interrupts = <24 IRQ_TYPE_LEVEL_HIGH>; /* gpio 152 */ ++ interrupt-parent = <&gpio1>; ++ interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; /* gpio 2 */ + ref-clock-frequency = <26000000>; + }; + }; +@@ -157,8 +157,6 @@ + OMAP3_CORE1_IOPAD(0x2166, PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc2_dat5.sdmmc3_dat1 */ + OMAP3_CORE1_IOPAD(0x2168, PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc2_dat6.sdmmc3_dat2 */ + OMAP3_CORE1_IOPAD(0x216a, PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc2_dat6.sdmmc3_dat3 */ +- OMAP3_CORE1_IOPAD(0x2184, PIN_INPUT_PULLUP | MUX_MODE4) /* mcbsp4_clkx.gpio_152 */ +- OMAP3_CORE1_IOPAD(0x2a0c, PIN_OUTPUT | MUX_MODE4) /* sys_boot1.gpio_3 */ + OMAP3_CORE1_IOPAD(0x21d0, PIN_INPUT_PULLUP | MUX_MODE3) /* mcspi1_cs1.sdmmc3_cmd */ + OMAP3_CORE1_IOPAD(0x21d2, PIN_INPUT_PULLUP | MUX_MODE3) /* mcspi1_cs2.sdmmc_clk */ + >; +@@ -228,6 +226,12 @@ + OMAP3_WKUP_IOPAD(0x2a0e, PIN_OUTPUT | MUX_MODE4) /* sys_boot2.gpio_4 */ + >; + }; ++ wl127x_gpio: pinmux_wl127x_gpio_pin { ++ pinctrl-single,pins = < ++ OMAP3_WKUP_IOPAD(0x2a0c, PIN_INPUT | MUX_MODE4) /* sys_boot0.gpio_2 */ ++ OMAP3_WKUP_IOPAD(0x2a0c, PIN_OUTPUT | MUX_MODE4) /* sys_boot1.gpio_3 */ ++ >; ++ }; + }; + + &omap3_pmx_core2 { +diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi +index 64d00f5893a6..28d10abd8b04 100644 +--- a/arch/arm/boot/dts/omap4.dtsi ++++ b/arch/arm/boot/dts/omap4.dtsi +@@ -354,7 +354,7 @@ + elm: elm@48078000 { + compatible = "ti,am3352-elm"; + reg = <0x48078000 0x2000>; +- interrupts = <4>; ++ interrupts = ; + ti,hwmods = "elm"; + status = "disabled"; + }; +@@ -861,14 +861,12 @@ + usbhsohci: ohci@4a064800 { + compatible = "ti,ohci-omap3"; + reg = <0x4a064800 0x400>; +- interrupt-parent = <&gic>; + interrupts = ; + }; + + usbhsehci: ehci@4a064c00 { + compatible = "ti,ehci-omap"; + reg = <0x4a064c00 0x400>; +- interrupt-parent = <&gic>; + interrupts = ; + }; + }; +diff --git a/arch/arm/common/bL_switcher_dummy_if.c b/arch/arm/common/bL_switcher_dummy_if.c +index 4c10c6452678..f4dc1714a79e 100644 +--- a/arch/arm/common/bL_switcher_dummy_if.c ++++ b/arch/arm/common/bL_switcher_dummy_if.c +@@ -57,3 +57,7 @@ static struct miscdevice bL_switcher_device = { + &bL_switcher_fops + }; + module_misc_device(bL_switcher_device); ++ ++MODULE_AUTHOR("Nicolas Pitre "); ++MODULE_LICENSE("GPL v2"); ++MODULE_DESCRIPTION("big.LITTLE switcher dummy user interface"); +diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c +index 5ac122e88f67..9ff92050053c 100644 +--- a/arch/arm/mach-omap2/omap-secure.c ++++ b/arch/arm/mach-omap2/omap-secure.c +@@ -73,6 +73,25 @@ phys_addr_t omap_secure_ram_mempool_base(void) + return omap_secure_memblock_base; + } + ++u32 omap3_save_secure_ram(void __iomem *addr, int size) ++{ ++ u32 ret; ++ u32 param[5]; ++ ++ if (size != OMAP3_SAVE_SECURE_RAM_SZ) ++ return OMAP3_SAVE_SECURE_RAM_SZ; ++ ++ param[0] = 4; /* Number of arguments */ ++ param[1] = __pa(addr); /* Physical address for saving */ ++ param[2] = 0; ++ param[3] = 1; ++ param[4] = 1; ++ ++ ret = save_secure_ram_context(__pa(param)); ++ ++ return ret; ++} ++ + /** + * rx51_secure_dispatcher: Routine to dispatch secure PPA API calls + * @idx: The PPA API index +diff --git a/arch/arm/mach-omap2/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h +index bae263fba640..c509cde71f93 100644 +--- a/arch/arm/mach-omap2/omap-secure.h ++++ b/arch/arm/mach-omap2/omap-secure.h +@@ -31,6 +31,8 @@ + /* Maximum Secure memory storage size */ + #define OMAP_SECURE_RAM_STORAGE (88 * SZ_1K) + ++#define OMAP3_SAVE_SECURE_RAM_SZ 0x803F ++ + /* Secure low power HAL API index */ + #define OMAP4_HAL_SAVESECURERAM_INDEX 0x1a + #define OMAP4_HAL_SAVEHW_INDEX 0x1b +@@ -65,6 +67,8 @@ extern u32 omap_smc2(u32 id, u32 falg, u32 pargs); + extern u32 omap_smc3(u32 id, u32 process, u32 flag, u32 pargs); + extern phys_addr_t omap_secure_ram_mempool_base(void); + extern int omap_secure_ram_reserve_memblock(void); ++extern u32 save_secure_ram_context(u32 args_pa); ++extern u32 omap3_save_secure_ram(void __iomem *save_regs, int size); + + extern u32 rx51_secure_dispatcher(u32 idx, u32 process, u32 flag, u32 nargs, + u32 arg1, u32 arg2, u32 arg3, u32 arg4); +diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h +index b668719b9b25..8e30772cfe32 100644 +--- a/arch/arm/mach-omap2/pm.h ++++ b/arch/arm/mach-omap2/pm.h +@@ -81,10 +81,6 @@ extern unsigned int omap3_do_wfi_sz; + /* ... and its pointer from SRAM after copy */ + extern void (*omap3_do_wfi_sram)(void); + +-/* save_secure_ram_context function pointer and size, for copy to SRAM */ +-extern int save_secure_ram_context(u32 *addr); +-extern unsigned int save_secure_ram_context_sz; +- + extern void omap3_save_scratchpad_contents(void); + + #define PM_RTA_ERRATUM_i608 (1 << 0) +diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c +index 841ba19d64a6..36c55547137c 100644 +--- a/arch/arm/mach-omap2/pm34xx.c ++++ b/arch/arm/mach-omap2/pm34xx.c +@@ -48,6 +48,7 @@ + #include "prm3xxx.h" + #include "pm.h" + #include "sdrc.h" ++#include "omap-secure.h" + #include "sram.h" + #include "control.h" + #include "vc.h" +@@ -66,7 +67,6 @@ struct power_state { + + static LIST_HEAD(pwrst_list); + +-static int (*_omap_save_secure_sram)(u32 *addr); + void (*omap3_do_wfi_sram)(void); + + static struct powerdomain *mpu_pwrdm, *neon_pwrdm; +@@ -121,8 +121,8 @@ static void omap3_save_secure_ram_context(void) + * will hang the system. + */ + pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); +- ret = _omap_save_secure_sram((u32 *)(unsigned long) +- __pa(omap3_secure_ram_storage)); ++ ret = omap3_save_secure_ram(omap3_secure_ram_storage, ++ OMAP3_SAVE_SECURE_RAM_SZ); + pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state); + /* Following is for error tracking, it should not happen */ + if (ret) { +@@ -434,15 +434,10 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) + * + * The minimum set of functions is pushed to SRAM for execution: + * - omap3_do_wfi for erratum i581 WA, +- * - save_secure_ram_context for security extensions. + */ + void omap_push_sram_idle(void) + { + omap3_do_wfi_sram = omap_sram_push(omap3_do_wfi, omap3_do_wfi_sz); +- +- if (omap_type() != OMAP2_DEVICE_TYPE_GP) +- _omap_save_secure_sram = omap_sram_push(save_secure_ram_context, +- save_secure_ram_context_sz); + } + + static void __init pm_errata_configure(void) +@@ -553,7 +548,7 @@ int __init omap3_pm_init(void) + clkdm_add_wkdep(neon_clkdm, mpu_clkdm); + if (omap_type() != OMAP2_DEVICE_TYPE_GP) { + omap3_secure_ram_storage = +- kmalloc(0x803F, GFP_KERNEL); ++ kmalloc(OMAP3_SAVE_SECURE_RAM_SZ, GFP_KERNEL); + if (!omap3_secure_ram_storage) + pr_err("Memory allocation failed when allocating for secure sram context\n"); + +diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c +index d2c5bcabdbeb..ebaf80d72a10 100644 +--- a/arch/arm/mach-omap2/prm33xx.c ++++ b/arch/arm/mach-omap2/prm33xx.c +@@ -176,17 +176,6 @@ static int am33xx_pwrdm_read_pwrst(struct powerdomain *pwrdm) + return v; + } + +-static int am33xx_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm) +-{ +- u32 v; +- +- v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs); +- v &= AM33XX_LASTPOWERSTATEENTERED_MASK; +- v >>= AM33XX_LASTPOWERSTATEENTERED_SHIFT; +- +- return v; +-} +- + static int am33xx_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm) + { + am33xx_prm_rmw_reg_bits(AM33XX_LOWPOWERSTATECHANGE_MASK, +@@ -357,7 +346,6 @@ struct pwrdm_ops am33xx_pwrdm_operations = { + .pwrdm_set_next_pwrst = am33xx_pwrdm_set_next_pwrst, + .pwrdm_read_next_pwrst = am33xx_pwrdm_read_next_pwrst, + .pwrdm_read_pwrst = am33xx_pwrdm_read_pwrst, +- .pwrdm_read_prev_pwrst = am33xx_pwrdm_read_prev_pwrst, + .pwrdm_set_logic_retst = am33xx_pwrdm_set_logic_retst, + .pwrdm_read_logic_pwrst = am33xx_pwrdm_read_logic_pwrst, + .pwrdm_read_logic_retst = am33xx_pwrdm_read_logic_retst, +diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S +index fa5fd24f524c..22daf4efed68 100644 +--- a/arch/arm/mach-omap2/sleep34xx.S ++++ b/arch/arm/mach-omap2/sleep34xx.S +@@ -93,20 +93,13 @@ ENTRY(enable_omap3630_toggle_l2_on_restore) + ENDPROC(enable_omap3630_toggle_l2_on_restore) + + /* +- * Function to call rom code to save secure ram context. This gets +- * relocated to SRAM, so it can be all in .data section. Otherwise +- * we need to initialize api_params separately. ++ * Function to call rom code to save secure ram context. ++ * ++ * r0 = physical address of the parameters + */ +- .data +- .align 3 + ENTRY(save_secure_ram_context) + stmfd sp!, {r4 - r11, lr} @ save registers on stack +- adr r3, api_params @ r3 points to parameters +- str r0, [r3,#0x4] @ r0 has sdram address +- ldr r12, high_mask +- and r3, r3, r12 +- ldr r12, sram_phy_addr_mask +- orr r3, r3, r12 ++ mov r3, r0 @ physical address of parameters + mov r0, #25 @ set service ID for PPA + mov r12, r0 @ copy secure service ID in r12 + mov r1, #0 @ set task id for ROM code in r1 +@@ -120,18 +113,7 @@ ENTRY(save_secure_ram_context) + nop + nop + ldmfd sp!, {r4 - r11, pc} +- .align +-sram_phy_addr_mask: +- .word SRAM_BASE_P +-high_mask: +- .word 0xffff +-api_params: +- .word 0x4, 0x0, 0x0, 0x1, 0x1 + ENDPROC(save_secure_ram_context) +-ENTRY(save_secure_ram_context_sz) +- .word . - save_secure_ram_context +- +- .text + + /* + * ====================== +diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi +index b99a27372965..da64e1cab233 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi +@@ -81,6 +81,7 @@ + reg = <0x000>; + enable-method = "psci"; + cpu-idle-states = <&CPU_SLEEP_0>; ++ #cooling-cells = <2>; + }; + + cpu1: cpu@1 { +@@ -97,6 +98,7 @@ + reg = <0x100>; + enable-method = "psci"; + cpu-idle-states = <&CPU_SLEEP_0>; ++ #cooling-cells = <2>; + }; + + cpu3: cpu@101 { +diff --git a/arch/m68k/kernel/vmlinux-nommu.lds b/arch/m68k/kernel/vmlinux-nommu.lds +index 3aa571a513b5..cf6edda38971 100644 +--- a/arch/m68k/kernel/vmlinux-nommu.lds ++++ b/arch/m68k/kernel/vmlinux-nommu.lds +@@ -45,6 +45,8 @@ SECTIONS { + .text : { + HEAD_TEXT + TEXT_TEXT ++ IRQENTRY_TEXT ++ SOFTIRQENTRY_TEXT + SCHED_TEXT + CPUIDLE_TEXT + LOCK_TEXT +diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds +index 89172b8974b9..625a5785804f 100644 +--- a/arch/m68k/kernel/vmlinux-std.lds ++++ b/arch/m68k/kernel/vmlinux-std.lds +@@ -16,6 +16,8 @@ SECTIONS + .text : { + HEAD_TEXT + TEXT_TEXT ++ IRQENTRY_TEXT ++ SOFTIRQENTRY_TEXT + SCHED_TEXT + CPUIDLE_TEXT + LOCK_TEXT +diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds +index 293990efc917..9868270b0984 100644 +--- a/arch/m68k/kernel/vmlinux-sun3.lds ++++ b/arch/m68k/kernel/vmlinux-sun3.lds +@@ -16,6 +16,8 @@ SECTIONS + .text : { + HEAD_TEXT + TEXT_TEXT ++ IRQENTRY_TEXT ++ SOFTIRQENTRY_TEXT + SCHED_TEXT + CPUIDLE_TEXT + LOCK_TEXT +diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c +index b4209a68b85d..fce545774d50 100644 +--- a/arch/powerpc/perf/core-book3s.c ++++ b/arch/powerpc/perf/core-book3s.c +@@ -1419,7 +1419,7 @@ static int collect_events(struct perf_event *group, int max_count, + int n = 0; + struct perf_event *event; + +- if (!is_software_event(group)) { ++ if (group->pmu->task_ctx_nr == perf_hw_context) { + if (n >= max_count) + return -1; + ctrs[n] = group; +@@ -1427,7 +1427,7 @@ static int collect_events(struct perf_event *group, int max_count, + events[n++] = group->hw.config; + } + list_for_each_entry(event, &group->sibling_list, group_entry) { +- if (!is_software_event(event) && ++ if (event->pmu->task_ctx_nr == perf_hw_context && + event->state != PERF_EVENT_STATE_OFF) { + if (n >= max_count) + return -1; +diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c +index cf64e16f92c2..da6ba9ba73ed 100644 +--- a/arch/powerpc/perf/imc-pmu.c ++++ b/arch/powerpc/perf/imc-pmu.c +@@ -308,6 +308,19 @@ static int ppc_nest_imc_cpu_offline(unsigned int cpu) + if (!cpumask_test_and_clear_cpu(cpu, &nest_imc_cpumask)) + return 0; + ++ /* ++ * Check whether nest_imc is registered. We could end up here if the ++ * cpuhotplug callback registration fails. i.e, callback invokes the ++ * offline path for all successfully registered nodes. At this stage, ++ * nest_imc pmu will not be registered and we should return here. ++ * ++ * We return with a zero since this is not an offline failure. And ++ * cpuhp_setup_state() returns the actual failure reason to the caller, ++ * which in turn will call the cleanup routine. ++ */ ++ if (!nest_pmus) ++ return 0; ++ + /* + * Now that this cpu is one of the designated, + * find a next cpu a) which is online and b) in same chip. +diff --git a/arch/s390/include/uapi/asm/virtio-ccw.h b/arch/s390/include/uapi/asm/virtio-ccw.h +index 967aad390105..9e62587d9472 100644 +--- a/arch/s390/include/uapi/asm/virtio-ccw.h ++++ b/arch/s390/include/uapi/asm/virtio-ccw.h +@@ -1,4 +1,4 @@ +-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ ++/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ + /* + * Definitions for virtio-ccw devices. + * +diff --git a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S +index 1c3b7ceb36d2..e7273a606a07 100644 +--- a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S ++++ b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S +@@ -55,29 +55,31 @@ + #define RAB1bl %bl + #define RAB2bl %cl + ++#define CD0 0x0(%rsp) ++#define CD1 0x8(%rsp) ++#define CD2 0x10(%rsp) ++ ++# used only before/after all rounds + #define RCD0 %r8 + #define RCD1 %r9 + #define RCD2 %r10 + +-#define RCD0d %r8d +-#define RCD1d %r9d +-#define RCD2d %r10d +- +-#define RX0 %rbp +-#define RX1 %r11 +-#define RX2 %r12 ++# used only during rounds ++#define RX0 %r8 ++#define RX1 %r9 ++#define RX2 %r10 + +-#define RX0d %ebp +-#define RX1d %r11d +-#define RX2d %r12d ++#define RX0d %r8d ++#define RX1d %r9d ++#define RX2d %r10d + +-#define RY0 %r13 +-#define RY1 %r14 +-#define RY2 %r15 ++#define RY0 %r11 ++#define RY1 %r12 ++#define RY2 %r13 + +-#define RY0d %r13d +-#define RY1d %r14d +-#define RY2d %r15d ++#define RY0d %r11d ++#define RY1d %r12d ++#define RY2d %r13d + + #define RT0 %rdx + #define RT1 %rsi +@@ -85,6 +87,8 @@ + #define RT0d %edx + #define RT1d %esi + ++#define RT1bl %sil ++ + #define do16bit_ror(rot, op1, op2, T0, T1, tmp1, tmp2, ab, dst) \ + movzbl ab ## bl, tmp2 ## d; \ + movzbl ab ## bh, tmp1 ## d; \ +@@ -92,6 +96,11 @@ + op1##l T0(CTX, tmp2, 4), dst ## d; \ + op2##l T1(CTX, tmp1, 4), dst ## d; + ++#define swap_ab_with_cd(ab, cd, tmp) \ ++ movq cd, tmp; \ ++ movq ab, cd; \ ++ movq tmp, ab; ++ + /* + * Combined G1 & G2 function. Reordered with help of rotates to have moves + * at begining. +@@ -110,15 +119,15 @@ + /* G1,2 && G2,2 */ \ + do16bit_ror(32, xor, xor, Tx2, Tx3, RT0, RT1, ab ## 0, x ## 0); \ + do16bit_ror(16, xor, xor, Ty3, Ty0, RT0, RT1, ab ## 0, y ## 0); \ +- xchgq cd ## 0, ab ## 0; \ ++ swap_ab_with_cd(ab ## 0, cd ## 0, RT0); \ + \ + do16bit_ror(32, xor, xor, Tx2, Tx3, RT0, RT1, ab ## 1, x ## 1); \ + do16bit_ror(16, xor, xor, Ty3, Ty0, RT0, RT1, ab ## 1, y ## 1); \ +- xchgq cd ## 1, ab ## 1; \ ++ swap_ab_with_cd(ab ## 1, cd ## 1, RT0); \ + \ + do16bit_ror(32, xor, xor, Tx2, Tx3, RT0, RT1, ab ## 2, x ## 2); \ + do16bit_ror(16, xor, xor, Ty3, Ty0, RT0, RT1, ab ## 2, y ## 2); \ +- xchgq cd ## 2, ab ## 2; ++ swap_ab_with_cd(ab ## 2, cd ## 2, RT0); + + #define enc_round_end(ab, x, y, n) \ + addl y ## d, x ## d; \ +@@ -168,6 +177,16 @@ + decrypt_round3(ba, dc, (n*2)+1); \ + decrypt_round3(ba, dc, (n*2)); + ++#define push_cd() \ ++ pushq RCD2; \ ++ pushq RCD1; \ ++ pushq RCD0; ++ ++#define pop_cd() \ ++ popq RCD0; \ ++ popq RCD1; \ ++ popq RCD2; ++ + #define inpack3(in, n, xy, m) \ + movq 4*(n)(in), xy ## 0; \ + xorq w+4*m(CTX), xy ## 0; \ +@@ -223,11 +242,8 @@ ENTRY(__twofish_enc_blk_3way) + * %rdx: src, RIO + * %rcx: bool, if true: xor output + */ +- pushq %r15; +- pushq %r14; + pushq %r13; + pushq %r12; +- pushq %rbp; + pushq %rbx; + + pushq %rcx; /* bool xor */ +@@ -235,40 +251,36 @@ ENTRY(__twofish_enc_blk_3way) + + inpack_enc3(); + +- encrypt_cycle3(RAB, RCD, 0); +- encrypt_cycle3(RAB, RCD, 1); +- encrypt_cycle3(RAB, RCD, 2); +- encrypt_cycle3(RAB, RCD, 3); +- encrypt_cycle3(RAB, RCD, 4); +- encrypt_cycle3(RAB, RCD, 5); +- encrypt_cycle3(RAB, RCD, 6); +- encrypt_cycle3(RAB, RCD, 7); ++ push_cd(); ++ encrypt_cycle3(RAB, CD, 0); ++ encrypt_cycle3(RAB, CD, 1); ++ encrypt_cycle3(RAB, CD, 2); ++ encrypt_cycle3(RAB, CD, 3); ++ encrypt_cycle3(RAB, CD, 4); ++ encrypt_cycle3(RAB, CD, 5); ++ encrypt_cycle3(RAB, CD, 6); ++ encrypt_cycle3(RAB, CD, 7); ++ pop_cd(); + + popq RIO; /* dst */ +- popq %rbp; /* bool xor */ ++ popq RT1; /* bool xor */ + +- testb %bpl, %bpl; ++ testb RT1bl, RT1bl; + jnz .L__enc_xor3; + + outunpack_enc3(mov); + + popq %rbx; +- popq %rbp; + popq %r12; + popq %r13; +- popq %r14; +- popq %r15; + ret; + + .L__enc_xor3: + outunpack_enc3(xor); + + popq %rbx; +- popq %rbp; + popq %r12; + popq %r13; +- popq %r14; +- popq %r15; + ret; + ENDPROC(__twofish_enc_blk_3way) + +@@ -278,35 +290,31 @@ ENTRY(twofish_dec_blk_3way) + * %rsi: dst + * %rdx: src, RIO + */ +- pushq %r15; +- pushq %r14; + pushq %r13; + pushq %r12; +- pushq %rbp; + pushq %rbx; + + pushq %rsi; /* dst */ + + inpack_dec3(); + +- decrypt_cycle3(RAB, RCD, 7); +- decrypt_cycle3(RAB, RCD, 6); +- decrypt_cycle3(RAB, RCD, 5); +- decrypt_cycle3(RAB, RCD, 4); +- decrypt_cycle3(RAB, RCD, 3); +- decrypt_cycle3(RAB, RCD, 2); +- decrypt_cycle3(RAB, RCD, 1); +- decrypt_cycle3(RAB, RCD, 0); ++ push_cd(); ++ decrypt_cycle3(RAB, CD, 7); ++ decrypt_cycle3(RAB, CD, 6); ++ decrypt_cycle3(RAB, CD, 5); ++ decrypt_cycle3(RAB, CD, 4); ++ decrypt_cycle3(RAB, CD, 3); ++ decrypt_cycle3(RAB, CD, 2); ++ decrypt_cycle3(RAB, CD, 1); ++ decrypt_cycle3(RAB, CD, 0); ++ pop_cd(); + + popq RIO; /* dst */ + + outunpack_dec3(); + + popq %rbx; +- popq %rbp; + popq %r12; + popq %r13; +- popq %r14; +- popq %r15; + ret; + ENDPROC(twofish_dec_blk_3way) +diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c +index dd35c6c50516..5ffde16253cb 100644 +--- a/arch/x86/kvm/vmx.c ++++ b/arch/x86/kvm/vmx.c +@@ -6950,7 +6950,6 @@ static __init int hardware_setup(void) + goto out; + } + +- vmx_io_bitmap_b = (unsigned long *)__get_free_page(GFP_KERNEL); + memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE); + memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE); + +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c +index f97358423f9c..0dcd7bf45dc1 100644 +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -2926,6 +2926,12 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) + kvm_x86_ops->vcpu_put(vcpu); + kvm_put_guest_fpu(vcpu); + vcpu->arch.last_host_tsc = rdtsc(); ++ /* ++ * If userspace has set any breakpoints or watchpoints, dr6 is restored ++ * on every vmexit, but if not, we might have a stale dr6 from the ++ * guest. do_debug expects dr6 to be cleared after it runs, do the same. ++ */ ++ set_debugreg(0, 6); + } + + static int kvm_vcpu_ioctl_get_lapic(struct kvm_vcpu *vcpu, +@@ -7474,6 +7480,29 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int idt_index, + } + EXPORT_SYMBOL_GPL(kvm_task_switch); + ++int kvm_valid_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs) ++{ ++ if ((sregs->efer & EFER_LME) && (sregs->cr0 & X86_CR0_PG_BIT)) { ++ /* ++ * When EFER.LME and CR0.PG are set, the processor is in ++ * 64-bit mode (though maybe in a 32-bit code segment). ++ * CR4.PAE and EFER.LMA must be set. ++ */ ++ if (!(sregs->cr4 & X86_CR4_PAE_BIT) ++ || !(sregs->efer & EFER_LMA)) ++ return -EINVAL; ++ } else { ++ /* ++ * Not in 64-bit mode: EFER.LMA is clear and the code ++ * segment cannot be 64-bit. ++ */ ++ if (sregs->efer & EFER_LMA || sregs->cs.l) ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ + int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, + struct kvm_sregs *sregs) + { +@@ -7486,6 +7515,9 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, + (sregs->cr4 & X86_CR4_OSXSAVE)) + return -EINVAL; + ++ if (kvm_valid_sregs(vcpu, sregs)) ++ return -EINVAL; ++ + apic_base_msr.data = sregs->apic_base; + apic_base_msr.host_initiated = true; + if (kvm_set_apic_base(vcpu, &apic_base_msr)) +diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c +index bb120e59c597..7bebdd0273d3 100644 +--- a/arch/x86/mm/ioremap.c ++++ b/arch/x86/mm/ioremap.c +@@ -349,11 +349,11 @@ void iounmap(volatile void __iomem *addr) + return; + } + ++ mmiotrace_iounmap(addr); ++ + addr = (volatile void __iomem *) + (PAGE_MASK & (unsigned long __force)addr); + +- mmiotrace_iounmap(addr); +- + /* Use the vm area unlocked, assuming the caller + ensures there isn't another iounmap for the same address + in parallel. Reuse of the virtual address is prevented by +diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c +index aa44c3aa4cd5..7c8686709636 100644 +--- a/arch/x86/mm/kmmio.c ++++ b/arch/x86/mm/kmmio.c +@@ -435,17 +435,18 @@ int register_kmmio_probe(struct kmmio_probe *p) + unsigned long flags; + int ret = 0; + unsigned long size = 0; ++ unsigned long addr = p->addr & PAGE_MASK; + const unsigned long size_lim = p->len + (p->addr & ~PAGE_MASK); + unsigned int l; + pte_t *pte; + + spin_lock_irqsave(&kmmio_lock, flags); +- if (get_kmmio_probe(p->addr)) { ++ if (get_kmmio_probe(addr)) { + ret = -EEXIST; + goto out; + } + +- pte = lookup_address(p->addr, &l); ++ pte = lookup_address(addr, &l); + if (!pte) { + ret = -EINVAL; + goto out; +@@ -454,7 +455,7 @@ int register_kmmio_probe(struct kmmio_probe *p) + kmmio_count++; + list_add_rcu(&p->list, &kmmio_probes); + while (size < size_lim) { +- if (add_kmmio_fault_page(p->addr + size)) ++ if (add_kmmio_fault_page(addr + size)) + pr_err("Unable to set page fault.\n"); + size += page_level_size(l); + } +@@ -528,19 +529,20 @@ void unregister_kmmio_probe(struct kmmio_probe *p) + { + unsigned long flags; + unsigned long size = 0; ++ unsigned long addr = p->addr & PAGE_MASK; + const unsigned long size_lim = p->len + (p->addr & ~PAGE_MASK); + struct kmmio_fault_page *release_list = NULL; + struct kmmio_delayed_release *drelease; + unsigned int l; + pte_t *pte; + +- pte = lookup_address(p->addr, &l); ++ pte = lookup_address(addr, &l); + if (!pte) + return; + + spin_lock_irqsave(&kmmio_lock, flags); + while (size < size_lim) { +- release_kmmio_fault_page(p->addr + size, &release_list); ++ release_kmmio_fault_page(addr + size, &release_list); + size += page_level_size(l); + } + list_del_rcu(&p->list); +diff --git a/block/blk-map.c b/block/blk-map.c +index 368daa02714e..e31be14da8ea 100644 +--- a/block/blk-map.c ++++ b/block/blk-map.c +@@ -126,7 +126,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, + unsigned long align = q->dma_pad_mask | queue_dma_alignment(q); + struct bio *bio = NULL; + struct iov_iter i; +- int ret; ++ int ret = -EINVAL; + + if (!iter_is_iovec(iter)) + goto fail; +@@ -155,7 +155,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, + __blk_rq_unmap_user(bio); + fail: + rq->bio = NULL; +- return -EINVAL; ++ return ret; + } + EXPORT_SYMBOL(blk_rq_map_user_iov); + +diff --git a/drivers/Makefile b/drivers/Makefile +index d242d3514d30..5f5ccdbad21a 100644 +--- a/drivers/Makefile ++++ b/drivers/Makefile +@@ -105,6 +105,7 @@ obj-$(CONFIG_TC) += tc/ + obj-$(CONFIG_UWB) += uwb/ + obj-$(CONFIG_USB_PHY) += usb/ + obj-$(CONFIG_USB) += usb/ ++obj-$(CONFIG_USB_SUPPORT) += usb/ + obj-$(CONFIG_PCI) += usb/ + obj-$(CONFIG_USB_GADGET) += usb/ + obj-$(CONFIG_OF) += usb/ +diff --git a/drivers/android/binder.c b/drivers/android/binder.c +index 2ef8bd29e188..b7efdc8badee 100644 +--- a/drivers/android/binder.c ++++ b/drivers/android/binder.c +@@ -1933,8 +1933,14 @@ static void binder_send_failed_reply(struct binder_transaction *t, + &target_thread->todo); + wake_up_interruptible(&target_thread->wait); + } else { +- WARN(1, "Unexpected reply error: %u\n", +- target_thread->reply_error.cmd); ++ /* ++ * Cannot get here for normal operation, but ++ * we can if multiple synchronous transactions ++ * are sent without blocking for responses. ++ * Just ignore the 2nd error in this case. ++ */ ++ pr_warn("Unexpected reply error: %u\n", ++ target_thread->reply_error.cmd); + } + binder_inner_proc_unlock(target_thread->proc); + binder_thread_dec_tmpref(target_thread); +@@ -2135,7 +2141,7 @@ static void binder_transaction_buffer_release(struct binder_proc *proc, + int debug_id = buffer->debug_id; + + binder_debug(BINDER_DEBUG_TRANSACTION, +- "%d buffer release %d, size %zd-%zd, failed at %p\n", ++ "%d buffer release %d, size %zd-%zd, failed at %pK\n", + proc->pid, buffer->debug_id, + buffer->data_size, buffer->offsets_size, failed_at); + +@@ -3647,7 +3653,7 @@ static int binder_thread_write(struct binder_proc *proc, + } + } + binder_debug(BINDER_DEBUG_DEAD_BINDER, +- "%d:%d BC_DEAD_BINDER_DONE %016llx found %p\n", ++ "%d:%d BC_DEAD_BINDER_DONE %016llx found %pK\n", + proc->pid, thread->pid, (u64)cookie, + death); + if (death == NULL) { +@@ -4316,6 +4322,15 @@ static int binder_thread_release(struct binder_proc *proc, + + binder_inner_proc_unlock(thread->proc); + ++ /* ++ * This is needed to avoid races between wake_up_poll() above and ++ * and ep_remove_waitqueue() called for other reasons (eg the epoll file ++ * descriptor being closed); ep_remove_waitqueue() holds an RCU read ++ * lock, so we can be sure it's done after calling synchronize_rcu(). ++ */ ++ if (thread->looper & BINDER_LOOPER_STATE_POLL) ++ synchronize_rcu(); ++ + if (send_reply) + binder_send_failed_reply(send_reply, BR_DEAD_REPLY); + binder_release_work(proc, &thread->todo); +@@ -4331,6 +4346,8 @@ static unsigned int binder_poll(struct file *filp, + bool wait_for_proc_work; + + thread = binder_get_thread(proc); ++ if (!thread) ++ return POLLERR; + + binder_inner_proc_lock(thread->proc); + thread->looper |= BINDER_LOOPER_STATE_POLL; +@@ -4974,7 +4991,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m, + spin_lock(&t->lock); + to_proc = t->to_proc; + seq_printf(m, +- "%s %d: %p from %d:%d to %d:%d code %x flags %x pri %ld r%d", ++ "%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %ld r%d", + prefix, t->debug_id, t, + t->from ? t->from->proc->pid : 0, + t->from ? t->from->pid : 0, +@@ -4998,7 +5015,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m, + } + if (buffer->target_node) + seq_printf(m, " node %d", buffer->target_node->debug_id); +- seq_printf(m, " size %zd:%zd data %p\n", ++ seq_printf(m, " size %zd:%zd data %pK\n", + buffer->data_size, buffer->offsets_size, + buffer->data); + } +diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c +index 7bcf80fa9ada..b2b1eece0db1 100644 +--- a/drivers/base/power/runtime.c ++++ b/drivers/base/power/runtime.c +@@ -276,7 +276,8 @@ static int rpm_get_suppliers(struct device *dev) + continue; + + retval = pm_runtime_get_sync(link->supplier); +- if (retval < 0) { ++ /* Ignore suppliers with disabled runtime PM. */ ++ if (retval < 0 && retval != -EACCES) { + pm_runtime_put_noidle(link->supplier); + return retval; + } +diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c +index 7ac657f46d15..aec66159566d 100644 +--- a/drivers/crypto/s5p-sss.c ++++ b/drivers/crypto/s5p-sss.c +@@ -601,15 +601,21 @@ static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode) + uint32_t aes_control; + unsigned long flags; + int err; ++ u8 *iv; + + aes_control = SSS_AES_KEY_CHANGE_MODE; + if (mode & FLAGS_AES_DECRYPT) + aes_control |= SSS_AES_MODE_DECRYPT; + +- if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CBC) ++ if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CBC) { + aes_control |= SSS_AES_CHAIN_MODE_CBC; +- else if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CTR) ++ iv = req->info; ++ } else if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CTR) { + aes_control |= SSS_AES_CHAIN_MODE_CTR; ++ iv = req->info; ++ } else { ++ iv = NULL; /* AES_ECB */ ++ } + + if (dev->ctx->keylen == AES_KEYSIZE_192) + aes_control |= SSS_AES_KEY_SIZE_192; +@@ -640,7 +646,7 @@ static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode) + goto outdata_error; + + SSS_AES_WRITE(dev, AES_CONTROL, aes_control); +- s5p_set_aes(dev, dev->ctx->aes_key, req->info, dev->ctx->keylen); ++ s5p_set_aes(dev, dev->ctx->aes_key, iv, dev->ctx->keylen); + + s5p_set_dma_indata(dev, dev->sg_src); + s5p_set_dma_outdata(dev, dev->sg_dst); +diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c +index a19b5d0300a9..ceae25112acd 100644 +--- a/drivers/crypto/talitos.c ++++ b/drivers/crypto/talitos.c +@@ -1124,6 +1124,11 @@ int talitos_sg_map(struct device *dev, struct scatterlist *src, + struct talitos_private *priv = dev_get_drvdata(dev); + bool is_sec1 = has_ftr_sec1(priv); + ++ if (!src) { ++ *ptr = zero_entry; ++ return 1; ++ } ++ + to_talitos_ptr_len(ptr, len, is_sec1); + to_talitos_ptr_ext_set(ptr, 0, is_sec1); + +diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c +index fbab271b3bf9..a861b5b4d443 100644 +--- a/drivers/dma/at_hdmac.c ++++ b/drivers/dma/at_hdmac.c +@@ -708,7 +708,7 @@ atc_prep_dma_interleaved(struct dma_chan *chan, + unsigned long flags) + { + struct at_dma_chan *atchan = to_at_dma_chan(chan); +- struct data_chunk *first = xt->sgl; ++ struct data_chunk *first; + struct at_desc *desc = NULL; + size_t xfer_count; + unsigned int dwidth; +@@ -720,6 +720,8 @@ atc_prep_dma_interleaved(struct dma_chan *chan, + if (unlikely(!xt || xt->numf != 1 || !xt->frame_size)) + return NULL; + ++ first = xt->sgl; ++ + dev_info(chan2dev(chan), + "%s: src=%pad, dest=%pad, numf=%d, frame_size=%d, flags=0x%lx\n", + __func__, &xt->src_start, &xt->dst_start, xt->numf, +diff --git a/drivers/dma/dma-jz4740.c b/drivers/dma/dma-jz4740.c +index d50273fed715..afd5e10f8927 100644 +--- a/drivers/dma/dma-jz4740.c ++++ b/drivers/dma/dma-jz4740.c +@@ -555,7 +555,7 @@ static int jz4740_dma_probe(struct platform_device *pdev) + + ret = dma_async_device_register(dd); + if (ret) +- return ret; ++ goto err_clk; + + irq = platform_get_irq(pdev, 0); + ret = request_irq(irq, jz4740_dma_irq, 0, dev_name(&pdev->dev), dmadev); +@@ -568,6 +568,8 @@ static int jz4740_dma_probe(struct platform_device *pdev) + + err_unregister: + dma_async_device_unregister(dd); ++err_clk: ++ clk_disable_unprepare(dmadev->clk); + return ret; + } + +diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c +index 93e006c3441d..854deb0da07c 100644 +--- a/drivers/dma/ioat/init.c ++++ b/drivers/dma/ioat/init.c +@@ -390,7 +390,7 @@ static int ioat_dma_self_test(struct ioatdma_device *ioat_dma) + if (memcmp(src, dest, IOAT_TEST_SIZE)) { + dev_err(dev, "Self-test copy failed compare, disabling\n"); + err = -ENODEV; +- goto free_resources; ++ goto unmap_dma; + } + + unmap_dma: +diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c +index 6b535ec858cc..15a1f4b348c4 100644 +--- a/drivers/gpio/gpio-74x164.c ++++ b/drivers/gpio/gpio-74x164.c +@@ -23,6 +23,7 @@ + struct gen_74x164_chip { + struct gpio_chip gpio_chip; + struct mutex lock; ++ struct gpio_desc *gpiod_oe; + u32 registers; + /* + * Since the registers are chained, every byte sent will make +@@ -31,8 +32,7 @@ struct gen_74x164_chip { + * register at the end of the transfer. So, to have a logical + * numbering, store the bytes in reverse order. + */ +- u8 buffer[0]; +- struct gpio_desc *gpiod_oe; ++ u8 buffer[]; + }; + + static int __gen_74x164_write_config(struct gen_74x164_chip *chip) +diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c +index f75d8443ecaf..e4b3d7db68c9 100644 +--- a/drivers/gpio/gpio-davinci.c ++++ b/drivers/gpio/gpio-davinci.c +@@ -383,7 +383,7 @@ static int gpio_irq_type_unbanked(struct irq_data *data, unsigned trigger) + u32 mask; + + d = (struct davinci_gpio_controller *)irq_data_get_irq_handler_data(data); +- g = (struct davinci_gpio_regs __iomem *)d->regs; ++ g = (struct davinci_gpio_regs __iomem *)d->regs[0]; + mask = __gpio_mask(data->irq - d->base_irq); + + if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) +diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c +index 2a4d163ac76f..79ce877bf45f 100644 +--- a/drivers/gpu/drm/armada/armada_crtc.c ++++ b/drivers/gpu/drm/armada/armada_crtc.c +@@ -1225,17 +1225,13 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, + + ret = devm_request_irq(dev, irq, armada_drm_irq, 0, "armada_drm_crtc", + dcrtc); +- if (ret < 0) { +- kfree(dcrtc); +- return ret; +- } ++ if (ret < 0) ++ goto err_crtc; + + if (dcrtc->variant->init) { + ret = dcrtc->variant->init(dcrtc, dev); +- if (ret) { +- kfree(dcrtc); +- return ret; +- } ++ if (ret) ++ goto err_crtc; + } + + /* Ensure AXI pipeline is enabled */ +@@ -1246,13 +1242,15 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, + dcrtc->crtc.port = port; + + primary = kzalloc(sizeof(*primary), GFP_KERNEL); +- if (!primary) +- return -ENOMEM; ++ if (!primary) { ++ ret = -ENOMEM; ++ goto err_crtc; ++ } + + ret = armada_drm_plane_init(primary); + if (ret) { + kfree(primary); +- return ret; ++ goto err_crtc; + } + + ret = drm_universal_plane_init(drm, &primary->base, 0, +@@ -1263,7 +1261,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, + DRM_PLANE_TYPE_PRIMARY, NULL); + if (ret) { + kfree(primary); +- return ret; ++ goto err_crtc; + } + + ret = drm_crtc_init_with_planes(drm, &dcrtc->crtc, &primary->base, NULL, +@@ -1282,6 +1280,9 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, + + err_crtc_init: + primary->base.funcs->destroy(&primary->base); ++err_crtc: ++ kfree(dcrtc); ++ + return ret; + } + +diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c +index af4e906c630d..56b9f9b1c3ae 100644 +--- a/drivers/gpu/drm/drm_modeset_lock.c ++++ b/drivers/gpu/drm/drm_modeset_lock.c +@@ -88,7 +88,7 @@ void drm_modeset_lock_all(struct drm_device *dev) + struct drm_modeset_acquire_ctx *ctx; + int ret; + +- ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); ++ ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL); + if (WARN_ON(!ctx)) + return; + +diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h +index 10ae9681f02d..589905aab185 100644 +--- a/drivers/gpu/drm/i915/intel_drv.h ++++ b/drivers/gpu/drm/i915/intel_drv.h +@@ -1708,7 +1708,7 @@ extern struct drm_display_mode *intel_find_panel_downclock( + int intel_backlight_device_register(struct intel_connector *connector); + void intel_backlight_device_unregister(struct intel_connector *connector); + #else /* CONFIG_BACKLIGHT_CLASS_DEVICE */ +-static int intel_backlight_device_register(struct intel_connector *connector) ++static inline int intel_backlight_device_register(struct intel_connector *connector) + { + return 0; + } +diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c +index c50debb1986f..d31b3d0c9955 100644 +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -829,8 +829,10 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) + /* If we got force-completed because of GPU reset rather than + * through our IRQ handler, signal the fence now. + */ +- if (exec->fence) ++ if (exec->fence) { + dma_fence_signal(exec->fence); ++ dma_fence_put(exec->fence); ++ } + + if (exec->bo) { + for (i = 0; i < exec->bo_count; i++) +diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c +index 521addec831e..3dd62d75f531 100644 +--- a/drivers/gpu/drm/vc4/vc4_irq.c ++++ b/drivers/gpu/drm/vc4/vc4_irq.c +@@ -139,6 +139,7 @@ vc4_irq_finish_render_job(struct drm_device *dev) + list_move_tail(&exec->head, &vc4->job_done_list); + if (exec->fence) { + dma_fence_signal_locked(exec->fence); ++ dma_fence_put(exec->fence); + exec->fence = NULL; + } + vc4_submit_next_render_job(dev); +diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c +index a47428b4d31b..e565fd4fc414 100644 +--- a/drivers/iio/industrialio-core.c ++++ b/drivers/iio/industrialio-core.c +@@ -631,7 +631,7 @@ static ssize_t __iio_format_value(char *buf, size_t len, unsigned int type, + * iio_format_value() - Formats a IIO value into its string representation + * @buf: The buffer to which the formatted value gets written + * which is assumed to be big enough (i.e. PAGE_SIZE). +- * @type: One of the IIO_VAL_... constants. This decides how the val ++ * @type: One of the IIO_VAL_* constants. This decides how the val + * and val2 parameters are formatted. + * @size: Number of IIO value entries contained in vals + * @vals: Pointer to the values, exact meaning depends on the +@@ -639,7 +639,7 @@ static ssize_t __iio_format_value(char *buf, size_t len, unsigned int type, + * + * Return: 0 by default, a negative number on failure or the + * total number of characters written for a type that belongs +- * to the IIO_VAL_... constant. ++ * to the IIO_VAL_* constant. + */ + ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals) + { +diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c +index f42b3a1c75ff..dba796c06ba6 100644 +--- a/drivers/iio/proximity/sx9500.c ++++ b/drivers/iio/proximity/sx9500.c +@@ -871,6 +871,7 @@ static int sx9500_init_device(struct iio_dev *indio_dev) + static void sx9500_gpio_probe(struct i2c_client *client, + struct sx9500_data *data) + { ++ struct gpio_desc *gpiod_int; + struct device *dev; + + if (!client) +@@ -878,6 +879,14 @@ static void sx9500_gpio_probe(struct i2c_client *client, + + dev = &client->dev; + ++ if (client->irq <= 0) { ++ gpiod_int = devm_gpiod_get(dev, SX9500_GPIO_INT, GPIOD_IN); ++ if (IS_ERR(gpiod_int)) ++ dev_err(dev, "gpio get irq failed\n"); ++ else ++ client->irq = gpiod_to_irq(gpiod_int); ++ } ++ + data->gpiod_rst = devm_gpiod_get(dev, SX9500_GPIO_RESET, GPIOD_OUT_HIGH); + if (IS_ERR(data->gpiod_rst)) { + dev_warn(dev, "gpio get reset pin failed\n"); +diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c +index fa79c7076ccd..e457dface2d2 100644 +--- a/drivers/infiniband/core/cma.c ++++ b/drivers/infiniband/core/cma.c +@@ -801,6 +801,7 @@ struct rdma_cm_id *rdma_create_id(struct net *net, + INIT_LIST_HEAD(&id_priv->mc_list); + get_random_bytes(&id_priv->seq_num, sizeof id_priv->seq_num); + id_priv->id.route.addr.dev_addr.net = get_net(net); ++ id_priv->seq_num &= 0x00ffffff; + + return &id_priv->id; + } +@@ -4461,7 +4462,7 @@ static int cma_get_id_stats(struct sk_buff *skb, struct netlink_callback *cb) + return skb->len; + } + +-static const struct rdma_nl_cbs cma_cb_table[] = { ++static const struct rdma_nl_cbs cma_cb_table[RDMA_NL_RDMA_CM_NUM_OPS] = { + [RDMA_NL_RDMA_CM_ID_STATS] = { .dump = cma_get_id_stats}, + }; + +diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c +index ebfdb5503701..b4b28ff8b7dc 100644 +--- a/drivers/infiniband/core/device.c ++++ b/drivers/infiniband/core/device.c +@@ -1154,7 +1154,7 @@ struct net_device *ib_get_net_dev_by_params(struct ib_device *dev, + } + EXPORT_SYMBOL(ib_get_net_dev_by_params); + +-static const struct rdma_nl_cbs ibnl_ls_cb_table[] = { ++static const struct rdma_nl_cbs ibnl_ls_cb_table[RDMA_NL_LS_NUM_OPS] = { + [RDMA_NL_LS_OP_RESOLVE] = { + .doit = ib_nl_handle_resolve_resp, + .flags = RDMA_NL_ADMIN_PERM, +@@ -1261,5 +1261,5 @@ static void __exit ib_core_cleanup(void) + + MODULE_ALIAS_RDMA_NETLINK(RDMA_NL_LS, 4); + +-module_init(ib_core_init); ++subsys_initcall(ib_core_init); + module_exit(ib_core_cleanup); +diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c +index fcf42f6bb82a..30d7277249b8 100644 +--- a/drivers/infiniband/core/iwcm.c ++++ b/drivers/infiniband/core/iwcm.c +@@ -80,7 +80,7 @@ const char *__attribute_const__ iwcm_reject_msg(int reason) + } + EXPORT_SYMBOL(iwcm_reject_msg); + +-static struct rdma_nl_cbs iwcm_nl_cb_table[] = { ++static struct rdma_nl_cbs iwcm_nl_cb_table[RDMA_NL_IWPM_NUM_OPS] = { + [RDMA_NL_IWPM_REG_PID] = {.dump = iwpm_register_pid_cb}, + [RDMA_NL_IWPM_ADD_MAPPING] = {.dump = iwpm_add_mapping_cb}, + [RDMA_NL_IWPM_QUERY_MAPPING] = {.dump = iwpm_add_and_query_mapping_cb}, +diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c +index 2fae850a3eff..9a05245a1acf 100644 +--- a/drivers/infiniband/core/nldev.c ++++ b/drivers/infiniband/core/nldev.c +@@ -303,7 +303,7 @@ out: cb->args[0] = idx; + return skb->len; + } + +-static const struct rdma_nl_cbs nldev_cb_table[] = { ++static const struct rdma_nl_cbs nldev_cb_table[RDMA_NLDEV_NUM_OPS] = { + [RDMA_NLDEV_CMD_GET] = { + .doit = nldev_get_doit, + .dump = nldev_get_dumpit, +diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c +index e1cf0c08ca6f..84c6a6ff4a67 100644 +--- a/drivers/infiniband/hw/hfi1/rc.c ++++ b/drivers/infiniband/hw/hfi1/rc.c +@@ -815,7 +815,7 @@ static inline void hfi1_make_rc_ack_16B(struct rvt_qp *qp, + struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); + struct hfi1_16b_header *hdr = &opa_hdr->opah; + struct ib_other_headers *ohdr; +- u32 bth0, bth1; ++ u32 bth0, bth1 = 0; + u16 len, pkey; + u8 becn = !!is_fecn; + u8 l4 = OPA_16B_L4_IB_LOCAL; +diff --git a/drivers/infiniband/hw/i40iw/i40iw_cm.c b/drivers/infiniband/hw/i40iw/i40iw_cm.c +index 5230dd3c938c..d6a1a308c6a0 100644 +--- a/drivers/infiniband/hw/i40iw/i40iw_cm.c ++++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c +@@ -1043,7 +1043,7 @@ static int i40iw_parse_mpa(struct i40iw_cm_node *cm_node, u8 *buffer, u32 *type, + * i40iw_schedule_cm_timer + * @@cm_node: connection's node + * @sqbuf: buffer to send +- * @type: if it es send ot close ++ * @type: if it is send or close + * @send_retrans: if rexmits to be done + * @close_when_complete: is cm_node to be removed + * +@@ -1067,7 +1067,8 @@ int i40iw_schedule_cm_timer(struct i40iw_cm_node *cm_node, + + new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC); + if (!new_send) { +- i40iw_free_sqbuf(vsi, (void *)sqbuf); ++ if (type != I40IW_TIMER_TYPE_CLOSE) ++ i40iw_free_sqbuf(vsi, (void *)sqbuf); + return -ENOMEM; + } + new_send->retrycount = I40IW_DEFAULT_RETRYS; +@@ -1082,7 +1083,6 @@ int i40iw_schedule_cm_timer(struct i40iw_cm_node *cm_node, + new_send->timetosend += (HZ / 10); + if (cm_node->close_entry) { + kfree(new_send); +- i40iw_free_sqbuf(vsi, (void *)sqbuf); + i40iw_pr_err("already close entry\n"); + return -EINVAL; + } +diff --git a/drivers/infiniband/hw/i40iw/i40iw_ctrl.c b/drivers/infiniband/hw/i40iw/i40iw_ctrl.c +index 42ca5346777d..d86f3e670804 100644 +--- a/drivers/infiniband/hw/i40iw/i40iw_ctrl.c ++++ b/drivers/infiniband/hw/i40iw/i40iw_ctrl.c +@@ -506,7 +506,7 @@ static enum i40iw_status_code i40iw_sc_cqp_create(struct i40iw_sc_cqp *cqp, + + ret_code = i40iw_allocate_dma_mem(cqp->dev->hw, + &cqp->sdbuf, +- 128, ++ I40IW_UPDATE_SD_BUF_SIZE * cqp->sq_size, + I40IW_SD_BUF_ALIGNMENT); + + if (ret_code) +@@ -589,14 +589,15 @@ void i40iw_sc_cqp_post_sq(struct i40iw_sc_cqp *cqp) + } + + /** +- * i40iw_sc_cqp_get_next_send_wqe - get next wqe on cqp sq +- * @cqp: struct for cqp hw +- * @wqe_idx: we index of cqp ring ++ * i40iw_sc_cqp_get_next_send_wqe_idx - get next WQE on CQP SQ and pass back the index ++ * @cqp: pointer to CQP structure ++ * @scratch: private data for CQP WQE ++ * @wqe_idx: WQE index for next WQE on CQP SQ + */ +-u64 *i40iw_sc_cqp_get_next_send_wqe(struct i40iw_sc_cqp *cqp, u64 scratch) ++static u64 *i40iw_sc_cqp_get_next_send_wqe_idx(struct i40iw_sc_cqp *cqp, ++ u64 scratch, u32 *wqe_idx) + { + u64 *wqe = NULL; +- u32 wqe_idx; + enum i40iw_status_code ret_code; + + if (I40IW_RING_FULL_ERR(cqp->sq_ring)) { +@@ -609,20 +610,32 @@ u64 *i40iw_sc_cqp_get_next_send_wqe(struct i40iw_sc_cqp *cqp, u64 scratch) + cqp->sq_ring.size); + return NULL; + } +- I40IW_ATOMIC_RING_MOVE_HEAD(cqp->sq_ring, wqe_idx, ret_code); ++ I40IW_ATOMIC_RING_MOVE_HEAD(cqp->sq_ring, *wqe_idx, ret_code); + cqp->dev->cqp_cmd_stats[OP_REQUESTED_COMMANDS]++; + if (ret_code) + return NULL; +- if (!wqe_idx) ++ if (!*wqe_idx) + cqp->polarity = !cqp->polarity; + +- wqe = cqp->sq_base[wqe_idx].elem; +- cqp->scratch_array[wqe_idx] = scratch; ++ wqe = cqp->sq_base[*wqe_idx].elem; ++ cqp->scratch_array[*wqe_idx] = scratch; + I40IW_CQP_INIT_WQE(wqe); + + return wqe; + } + ++/** ++ * i40iw_sc_cqp_get_next_send_wqe - get next wqe on cqp sq ++ * @cqp: struct for cqp hw ++ * @scratch: private data for CQP WQE ++ */ ++u64 *i40iw_sc_cqp_get_next_send_wqe(struct i40iw_sc_cqp *cqp, u64 scratch) ++{ ++ u32 wqe_idx; ++ ++ return i40iw_sc_cqp_get_next_send_wqe_idx(cqp, scratch, &wqe_idx); ++} ++ + /** + * i40iw_sc_cqp_destroy - destroy cqp during close + * @cqp: struct for cqp hw +@@ -3534,8 +3547,10 @@ static enum i40iw_status_code cqp_sds_wqe_fill(struct i40iw_sc_cqp *cqp, + u64 *wqe; + int mem_entries, wqe_entries; + struct i40iw_dma_mem *sdbuf = &cqp->sdbuf; ++ u64 offset; ++ u32 wqe_idx; + +- wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch); ++ wqe = i40iw_sc_cqp_get_next_send_wqe_idx(cqp, scratch, &wqe_idx); + if (!wqe) + return I40IW_ERR_RING_FULL; + +@@ -3548,8 +3563,10 @@ static enum i40iw_status_code cqp_sds_wqe_fill(struct i40iw_sc_cqp *cqp, + LS_64(mem_entries, I40IW_CQPSQ_UPESD_ENTRY_COUNT); + + if (mem_entries) { +- memcpy(sdbuf->va, &info->entry[3], (mem_entries << 4)); +- data = sdbuf->pa; ++ offset = wqe_idx * I40IW_UPDATE_SD_BUF_SIZE; ++ memcpy((char *)sdbuf->va + offset, &info->entry[3], ++ mem_entries << 4); ++ data = (u64)sdbuf->pa + offset; + } else { + data = 0; + } +diff --git a/drivers/infiniband/hw/i40iw/i40iw_d.h b/drivers/infiniband/hw/i40iw/i40iw_d.h +index 2ebaadbed379..24eabcad5e40 100644 +--- a/drivers/infiniband/hw/i40iw/i40iw_d.h ++++ b/drivers/infiniband/hw/i40iw/i40iw_d.h +@@ -1109,7 +1109,7 @@ + #define I40IWQPC_VLANTAG_MASK (0xffffULL << I40IWQPC_VLANTAG_SHIFT) + + #define I40IWQPC_ARPIDX_SHIFT 48 +-#define I40IWQPC_ARPIDX_MASK (0xfffULL << I40IWQPC_ARPIDX_SHIFT) ++#define I40IWQPC_ARPIDX_MASK (0xffffULL << I40IWQPC_ARPIDX_SHIFT) + + #define I40IWQPC_FLOWLABEL_SHIFT 0 + #define I40IWQPC_FLOWLABEL_MASK (0xfffffUL << I40IWQPC_FLOWLABEL_SHIFT) +@@ -1516,7 +1516,7 @@ enum i40iw_alignment { + I40IW_AEQ_ALIGNMENT = 0x100, + I40IW_CEQ_ALIGNMENT = 0x100, + I40IW_CQ0_ALIGNMENT = 0x100, +- I40IW_SD_BUF_ALIGNMENT = 0x100 ++ I40IW_SD_BUF_ALIGNMENT = 0x80 + }; + + #define I40IW_WQE_SIZE_64 64 +@@ -1524,6 +1524,8 @@ enum i40iw_alignment { + #define I40IW_QP_WQE_MIN_SIZE 32 + #define I40IW_QP_WQE_MAX_SIZE 128 + ++#define I40IW_UPDATE_SD_BUF_SIZE 128 ++ + #define I40IW_CQE_QTYPE_RQ 0 + #define I40IW_CQE_QTYPE_SQ 1 + +diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c +index fcfa08747899..9354fec8efe7 100644 +--- a/drivers/infiniband/hw/mlx4/qp.c ++++ b/drivers/infiniband/hw/mlx4/qp.c +@@ -666,6 +666,19 @@ static int set_qp_rss(struct mlx4_ib_dev *dev, struct mlx4_ib_rss *rss_ctx, + return (-EOPNOTSUPP); + } + ++ if (ucmd->rx_hash_fields_mask & ~(MLX4_IB_RX_HASH_SRC_IPV4 | ++ MLX4_IB_RX_HASH_DST_IPV4 | ++ MLX4_IB_RX_HASH_SRC_IPV6 | ++ MLX4_IB_RX_HASH_DST_IPV6 | ++ MLX4_IB_RX_HASH_SRC_PORT_TCP | ++ MLX4_IB_RX_HASH_DST_PORT_TCP | ++ MLX4_IB_RX_HASH_SRC_PORT_UDP | ++ MLX4_IB_RX_HASH_DST_PORT_UDP)) { ++ pr_debug("RX Hash fields_mask has unsupported mask (0x%llx)\n", ++ ucmd->rx_hash_fields_mask); ++ return (-EOPNOTSUPP); ++ } ++ + if ((ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_SRC_IPV4) && + (ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_DST_IPV4)) { + rss_ctx->flags = MLX4_RSS_IPV4; +@@ -691,11 +704,11 @@ static int set_qp_rss(struct mlx4_ib_dev *dev, struct mlx4_ib_rss *rss_ctx, + return (-EOPNOTSUPP); + } + +- if (rss_ctx->flags & MLX4_RSS_IPV4) { ++ if (rss_ctx->flags & MLX4_RSS_IPV4) + rss_ctx->flags |= MLX4_RSS_UDP_IPV4; +- } else if (rss_ctx->flags & MLX4_RSS_IPV6) { ++ if (rss_ctx->flags & MLX4_RSS_IPV6) + rss_ctx->flags |= MLX4_RSS_UDP_IPV6; +- } else { ++ if (!(rss_ctx->flags & (MLX4_RSS_IPV6 | MLX4_RSS_IPV4))) { + pr_debug("RX Hash fields_mask is not supported - UDP must be set with IPv4 or IPv6\n"); + return (-EOPNOTSUPP); + } +@@ -707,15 +720,14 @@ static int set_qp_rss(struct mlx4_ib_dev *dev, struct mlx4_ib_rss *rss_ctx, + + if ((ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_SRC_PORT_TCP) && + (ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_DST_PORT_TCP)) { +- if (rss_ctx->flags & MLX4_RSS_IPV4) { ++ if (rss_ctx->flags & MLX4_RSS_IPV4) + rss_ctx->flags |= MLX4_RSS_TCP_IPV4; +- } else if (rss_ctx->flags & MLX4_RSS_IPV6) { ++ if (rss_ctx->flags & MLX4_RSS_IPV6) + rss_ctx->flags |= MLX4_RSS_TCP_IPV6; +- } else { ++ if (!(rss_ctx->flags & (MLX4_RSS_IPV6 | MLX4_RSS_IPV4))) { + pr_debug("RX Hash fields_mask is not supported - TCP must be set with IPv4 or IPv6\n"); + return (-EOPNOTSUPP); + } +- + } else if ((ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_SRC_PORT_TCP) || + (ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_DST_PORT_TCP)) { + pr_debug("RX Hash fields_mask is not supported - both TCP SRC and DST must be set\n"); +diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c +index 5a8216b50e38..788fc0800465 100644 +--- a/drivers/md/raid1.c ++++ b/drivers/md/raid1.c +@@ -810,11 +810,15 @@ static void flush_pending_writes(struct r1conf *conf) + spin_lock_irq(&conf->device_lock); + + if (conf->pending_bio_list.head) { ++ struct blk_plug plug; + struct bio *bio; ++ + bio = bio_list_get(&conf->pending_bio_list); + conf->pending_count = 0; + spin_unlock_irq(&conf->device_lock); ++ blk_start_plug(&plug); + flush_bio_list(conf, bio); ++ blk_finish_plug(&plug); + } else + spin_unlock_irq(&conf->device_lock); + } +diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c +index 374df5796649..0d18d3b95201 100644 +--- a/drivers/md/raid10.c ++++ b/drivers/md/raid10.c +@@ -890,10 +890,13 @@ static void flush_pending_writes(struct r10conf *conf) + spin_lock_irq(&conf->device_lock); + + if (conf->pending_bio_list.head) { ++ struct blk_plug plug; + struct bio *bio; ++ + bio = bio_list_get(&conf->pending_bio_list); + conf->pending_count = 0; + spin_unlock_irq(&conf->device_lock); ++ blk_start_plug(&plug); + /* flush any pending bitmap writes to disk + * before proceeding w/ I/O */ + bitmap_unplug(conf->mddev->bitmap); +@@ -914,6 +917,7 @@ static void flush_pending_writes(struct r10conf *conf) + generic_make_request(bio); + bio = next; + } ++ blk_finish_plug(&plug); + } else + spin_unlock_irq(&conf->device_lock); + } +diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c +index c406f16f5295..7ec822ced80b 100644 +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -2678,13 +2678,13 @@ static void raid5_error(struct mddev *mddev, struct md_rdev *rdev) + pr_debug("raid456: error called\n"); + + spin_lock_irqsave(&conf->device_lock, flags); ++ set_bit(Faulty, &rdev->flags); + clear_bit(In_sync, &rdev->flags); + mddev->degraded = raid5_calc_degraded(conf); + spin_unlock_irqrestore(&conf->device_lock, flags); + set_bit(MD_RECOVERY_INTR, &mddev->recovery); + + set_bit(Blocked, &rdev->flags); +- set_bit(Faulty, &rdev->flags); + set_mask_bits(&mddev->sb_flags, 0, + BIT(MD_SB_CHANGE_DEVS) | BIT(MD_SB_CHANGE_PENDING)); + pr_crit("md/raid:%s: Disk failure on %s, disabling device.\n" +diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig +index 94153895fcd4..3bdc34deae7b 100644 +--- a/drivers/media/i2c/Kconfig ++++ b/drivers/media/i2c/Kconfig +@@ -660,6 +660,7 @@ config VIDEO_OV13858 + tristate "OmniVision OV13858 sensor support" + depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API + depends on MEDIA_CAMERA_SUPPORT ++ select V4L2_FWNODE + ---help--- + This is a Video4Linux2 sensor-level driver for the OmniVision + OV13858 camera. +diff --git a/drivers/media/i2c/s5k6aa.c b/drivers/media/i2c/s5k6aa.c +index 9fd254a8e20d..13c10b5e2b45 100644 +--- a/drivers/media/i2c/s5k6aa.c ++++ b/drivers/media/i2c/s5k6aa.c +@@ -421,6 +421,7 @@ static int s5k6aa_set_ahb_address(struct i2c_client *client) + + /** + * s5k6aa_configure_pixel_clock - apply ISP main clock/PLL configuration ++ * @s5k6aa: pointer to &struct s5k6aa describing the device + * + * Configure the internal ISP PLL for the required output frequency. + * Locking: called with s5k6aa.lock mutex held. +@@ -669,6 +670,7 @@ static int s5k6aa_set_input_params(struct s5k6aa *s5k6aa) + + /** + * s5k6aa_configure_video_bus - configure the video output interface ++ * @s5k6aa: pointer to &struct s5k6aa describing the device + * @bus_type: video bus type: parallel or MIPI-CSI + * @nlanes: number of MIPI lanes to be used (MIPI-CSI only) + * +@@ -724,6 +726,8 @@ static int s5k6aa_new_config_sync(struct i2c_client *client, int timeout, + + /** + * s5k6aa_set_prev_config - write user preview register set ++ * @s5k6aa: pointer to &struct s5k6aa describing the device ++ * @preset: s5kaa preset to be applied + * + * Configure output resolution and color fromat, pixel clock + * frequency range, device frame rate type and frame period range. +@@ -777,6 +781,7 @@ static int s5k6aa_set_prev_config(struct s5k6aa *s5k6aa, + + /** + * s5k6aa_initialize_isp - basic ISP MCU initialization ++ * @sd: pointer to V4L2 sub-device descriptor + * + * Configure AHB addresses for registers read/write; configure PLLs for + * required output pixel clock. The ISP power supply needs to be already +diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +index ad5b25b89699..44975061b953 100644 +--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c ++++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +@@ -3642,6 +3642,12 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw, + hdw); + hdw->ctl_write_urb->actual_length = 0; + hdw->ctl_write_pend_flag = !0; ++ if (usb_urb_ep_type_check(hdw->ctl_write_urb)) { ++ pvr2_trace( ++ PVR2_TRACE_ERROR_LEGS, ++ "Invalid write control endpoint"); ++ return -EINVAL; ++ } + status = usb_submit_urb(hdw->ctl_write_urb,GFP_KERNEL); + if (status < 0) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, +@@ -3666,6 +3672,12 @@ status); + hdw); + hdw->ctl_read_urb->actual_length = 0; + hdw->ctl_read_pend_flag = !0; ++ if (usb_urb_ep_type_check(hdw->ctl_read_urb)) { ++ pvr2_trace( ++ PVR2_TRACE_ERROR_LEGS, ++ "Invalid read control endpoint"); ++ return -EINVAL; ++ } + status = usb_submit_urb(hdw->ctl_read_urb,GFP_KERNEL); + if (status < 0) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, +diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h +index 0ccccbaf530d..e4b10b2d1a08 100644 +--- a/drivers/misc/mei/hw-me-regs.h ++++ b/drivers/misc/mei/hw-me-regs.h +@@ -132,6 +132,11 @@ + #define MEI_DEV_ID_KBP 0xA2BA /* Kaby Point */ + #define MEI_DEV_ID_KBP_2 0xA2BB /* Kaby Point 2 */ + ++#define MEI_DEV_ID_CNP_LP 0x9DE0 /* Cannon Point LP */ ++#define MEI_DEV_ID_CNP_LP_4 0x9DE4 /* Cannon Point LP 4 (iTouch) */ ++#define MEI_DEV_ID_CNP_H 0xA360 /* Cannon Point H */ ++#define MEI_DEV_ID_CNP_H_4 0xA364 /* Cannon Point H 4 (iTouch) */ ++ + /* + * MEI HW Section + */ +diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c +index d46cb1f0868f..c77e08cbbfd1 100644 +--- a/drivers/misc/mei/pci-me.c ++++ b/drivers/misc/mei/pci-me.c +@@ -98,6 +98,11 @@ static const struct pci_device_id mei_me_pci_tbl[] = { + {MEI_PCI_DEVICE(MEI_DEV_ID_KBP, MEI_ME_PCH8_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_KBP_2, MEI_ME_PCH8_CFG)}, + ++ {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP, MEI_ME_PCH8_CFG)}, ++ {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP_4, MEI_ME_PCH8_CFG)}, ++ {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H, MEI_ME_PCH8_CFG)}, ++ {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H_4, MEI_ME_PCH8_CFG)}, ++ + /* required last entry */ + {0, } + }; +diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c +index d74c7335c512..eebda5ec9676 100644 +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -339,7 +339,7 @@ static void mv88e6xxx_g1_irq_free(struct mv88e6xxx_chip *chip) + u16 mask; + + mv88e6xxx_g1_read(chip, MV88E6XXX_G1_CTL1, &mask); +- mask |= GENMASK(chip->g1_irq.nirqs, 0); ++ mask &= ~GENMASK(chip->g1_irq.nirqs, 0); + mv88e6xxx_g1_write(chip, MV88E6XXX_G1_CTL1, mask); + + free_irq(chip->irq, chip); +@@ -395,7 +395,7 @@ static int mv88e6xxx_g1_irq_setup(struct mv88e6xxx_chip *chip) + return 0; + + out_disable: +- mask |= GENMASK(chip->g1_irq.nirqs, 0); ++ mask &= ~GENMASK(chip->g1_irq.nirqs, 0); + mv88e6xxx_g1_write(chip, MV88E6XXX_G1_CTL1, mask); + + out_mapping: +@@ -2153,6 +2153,19 @@ static const struct of_device_id mv88e6xxx_mdio_external_match[] = { + { }, + }; + ++static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip) ++ ++{ ++ struct mv88e6xxx_mdio_bus *mdio_bus; ++ struct mii_bus *bus; ++ ++ list_for_each_entry(mdio_bus, &chip->mdios, list) { ++ bus = mdio_bus->bus; ++ ++ mdiobus_unregister(bus); ++ } ++} ++ + static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip, + struct device_node *np) + { +@@ -2177,27 +2190,16 @@ static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip, + match = of_match_node(mv88e6xxx_mdio_external_match, child); + if (match) { + err = mv88e6xxx_mdio_register(chip, child, true); +- if (err) ++ if (err) { ++ mv88e6xxx_mdios_unregister(chip); + return err; ++ } + } + } + + return 0; + } + +-static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip) +- +-{ +- struct mv88e6xxx_mdio_bus *mdio_bus; +- struct mii_bus *bus; +- +- list_for_each_entry(mdio_bus, &chip->mdios, list) { +- bus = mdio_bus->bus; +- +- mdiobus_unregister(bus); +- } +-} +- + static int mv88e6xxx_get_eeprom_len(struct dsa_switch *ds) + { + struct mv88e6xxx_chip *chip = ds->priv; +diff --git a/drivers/net/ethernet/arc/emac_rockchip.c b/drivers/net/ethernet/arc/emac_rockchip.c +index e278e3d96ee0..c6163874e4e7 100644 +--- a/drivers/net/ethernet/arc/emac_rockchip.c ++++ b/drivers/net/ethernet/arc/emac_rockchip.c +@@ -220,9 +220,11 @@ static int emac_rockchip_probe(struct platform_device *pdev) + + /* RMII TX/RX needs always a rate of 25MHz */ + err = clk_set_rate(priv->macclk, 25000000); +- if (err) ++ if (err) { + dev_err(dev, + "failed to change mac clock rate (%d)\n", err); ++ goto out_clk_disable_macclk; ++ } + } + + err = arc_emac_probe(ndev, interface); +@@ -232,7 +234,8 @@ static int emac_rockchip_probe(struct platform_device *pdev) + } + + return 0; +- ++out_clk_disable_macclk: ++ clk_disable_unprepare(priv->macclk); + out_regulator_disable: + if (priv->regulator) + regulator_disable(priv->regulator); +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +index aa764c5e3c6b..b66689a6eac0 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -8218,8 +8218,9 @@ static void bnxt_shutdown(struct pci_dev *pdev) + if (netif_running(dev)) + dev_close(dev); + ++ bnxt_ulp_shutdown(bp); ++ + if (system_state == SYSTEM_POWER_OFF) { +- bnxt_ulp_shutdown(bp); + bnxt_clear_int_mode(bp); + pci_wake_from_d3(pdev, bp->wol); + pci_set_power_state(pdev, PCI_D3hot); +diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c +index 5be52d89b182..7f837006bb6a 100644 +--- a/drivers/net/ethernet/freescale/gianfar.c ++++ b/drivers/net/ethernet/freescale/gianfar.c +@@ -1378,9 +1378,11 @@ static int gfar_probe(struct platform_device *ofdev) + + gfar_init_addr_hash_table(priv); + +- /* Insert receive time stamps into padding alignment bytes */ ++ /* Insert receive time stamps into padding alignment bytes, and ++ * plus 2 bytes padding to ensure the cpu alignment. ++ */ + if (priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER) +- priv->padding = 8; ++ priv->padding = 8 + DEFAULT_PADDING; + + if (dev->features & NETIF_F_IP_CSUM || + priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER) +@@ -1790,6 +1792,7 @@ static int init_phy(struct net_device *dev) + GFAR_SUPPORTED_GBIT : 0; + phy_interface_t interface; + struct phy_device *phydev; ++ struct ethtool_eee edata; + + priv->oldlink = 0; + priv->oldspeed = 0; +@@ -1814,6 +1817,10 @@ static int init_phy(struct net_device *dev) + /* Add support for flow control, but don't advertise it by default */ + phydev->supported |= (SUPPORTED_Pause | SUPPORTED_Asym_Pause); + ++ /* disable EEE autoneg, EEE not supported by eTSEC */ ++ memset(&edata, 0, sizeof(struct ethtool_eee)); ++ phy_ethtool_set_eee(phydev, &edata); ++ + return 0; + } + +diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c +index 06f3fe429d82..529be74f609d 100644 +--- a/drivers/net/ethernet/marvell/mvpp2.c ++++ b/drivers/net/ethernet/marvell/mvpp2.c +@@ -5399,7 +5399,7 @@ static int mvpp2_aggr_txq_init(struct platform_device *pdev, + u32 txq_dma; + + /* Allocate memory for TX descriptors */ +- aggr_txq->descs = dma_alloc_coherent(&pdev->dev, ++ aggr_txq->descs = dma_zalloc_coherent(&pdev->dev, + MVPP2_AGGR_TXQ_SIZE * MVPP2_DESC_ALIGNED_SIZE, + &aggr_txq->descs_dma, GFP_KERNEL); + if (!aggr_txq->descs) +diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +index 1c43aca8162d..9a7655560629 100644 +--- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c ++++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +@@ -84,16 +84,13 @@ nfp_repr_phy_port_get_stats64(struct nfp_port *port, + { + u8 __iomem *mem = port->eth_stats; + +- /* TX and RX stats are flipped as we are returning the stats as seen +- * at the switch port corresponding to the phys port. +- */ +- stats->tx_packets = readq(mem + NFP_MAC_STATS_RX_FRAMES_RECEIVED_OK); +- stats->tx_bytes = readq(mem + NFP_MAC_STATS_RX_IN_OCTETS); +- stats->tx_dropped = readq(mem + NFP_MAC_STATS_RX_IN_ERRORS); ++ stats->tx_packets = readq(mem + NFP_MAC_STATS_TX_FRAMES_TRANSMITTED_OK); ++ stats->tx_bytes = readq(mem + NFP_MAC_STATS_TX_OUT_OCTETS); ++ stats->tx_dropped = readq(mem + NFP_MAC_STATS_TX_OUT_ERRORS); + +- stats->rx_packets = readq(mem + NFP_MAC_STATS_TX_FRAMES_TRANSMITTED_OK); +- stats->rx_bytes = readq(mem + NFP_MAC_STATS_TX_OUT_OCTETS); +- stats->rx_dropped = readq(mem + NFP_MAC_STATS_TX_OUT_ERRORS); ++ stats->rx_packets = readq(mem + NFP_MAC_STATS_RX_FRAMES_RECEIVED_OK); ++ stats->rx_bytes = readq(mem + NFP_MAC_STATS_RX_IN_OCTETS); ++ stats->rx_dropped = readq(mem + NFP_MAC_STATS_RX_IN_ERRORS); + } + + static void +diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c +index 540c7622dcb1..929fb8d96ec0 100644 +--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c ++++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c +@@ -166,12 +166,12 @@ static int rmnet_map_egress_handler(struct sk_buff *skb, + + if (skb_headroom(skb) < required_headroom) { + if (pskb_expand_head(skb, required_headroom, 0, GFP_KERNEL)) +- return RMNET_MAP_CONSUMED; ++ goto fail; + } + + map_header = rmnet_map_add_map_header(skb, additional_header_len, 0); + if (!map_header) +- return RMNET_MAP_CONSUMED; ++ goto fail; + + if (port->egress_data_format & RMNET_EGRESS_FORMAT_MUXING) { + if (ep->mux_id == 0xff) +@@ -183,6 +183,10 @@ static int rmnet_map_egress_handler(struct sk_buff *skb, + skb->protocol = htons(ETH_P_MAP); + + return RMNET_MAP_SUCCESS; ++ ++fail: ++ kfree_skb(skb); ++ return RMNET_MAP_CONSUMED; + } + + /* Ingress / Egress Entry Points */ +diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c +index 71ddadbf2368..d7ba2b813eff 100644 +--- a/drivers/net/hippi/rrunner.c ++++ b/drivers/net/hippi/rrunner.c +@@ -1381,8 +1381,8 @@ static int rr_close(struct net_device *dev) + rrpriv->info_dma); + rrpriv->info = NULL; + +- free_irq(pdev->irq, dev); + spin_unlock_irqrestore(&rrpriv->lock, flags); ++ free_irq(pdev->irq, dev); + + return 0; + } +diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c +index 8feb84fd4ca7..c23dea48ad0f 100644 +--- a/drivers/net/ipvlan/ipvlan_core.c ++++ b/drivers/net/ipvlan/ipvlan_core.c +@@ -375,6 +375,7 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb) + .flowi4_oif = dev->ifindex, + .flowi4_tos = RT_TOS(ip4h->tos), + .flowi4_flags = FLOWI_FLAG_ANYSRC, ++ .flowi4_mark = skb->mark, + .daddr = ip4h->daddr, + .saddr = ip4h->saddr, + }; +diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c +index cb85307f125b..1b2fe74a44ea 100644 +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -772,6 +772,7 @@ void phylink_stop(struct phylink *pl) + sfp_upstream_stop(pl->sfp_bus); + + set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); ++ queue_work(system_power_efficient_wq, &pl->resolve); + flush_work(&pl->resolve); + } + EXPORT_SYMBOL_GPL(phylink_stop); +diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c +index baee371bf767..8bf10aba7452 100644 +--- a/drivers/net/phy/sfp.c ++++ b/drivers/net/phy/sfp.c +@@ -358,7 +358,7 @@ static void sfp_sm_link_check_los(struct sfp *sfp) + * SFP_OPTIONS_LOS_NORMAL are set? For now, we assume + * the same as SFP_OPTIONS_LOS_NORMAL set. + */ +- if (sfp->id.ext.options & SFP_OPTIONS_LOS_INVERTED) ++ if (sfp->id.ext.options & cpu_to_be16(SFP_OPTIONS_LOS_INVERTED)) + los ^= SFP_F_LOS; + + if (los) +@@ -583,7 +583,8 @@ static void sfp_sm_event(struct sfp *sfp, unsigned int event) + if (event == SFP_E_TX_FAULT) + sfp_sm_fault(sfp, true); + else if (event == +- (sfp->id.ext.options & SFP_OPTIONS_LOS_INVERTED ? ++ (sfp->id.ext.options & ++ cpu_to_be16(SFP_OPTIONS_LOS_INVERTED) ? + SFP_E_LOS_HIGH : SFP_E_LOS_LOW)) + sfp_sm_link_up(sfp); + break; +@@ -593,7 +594,8 @@ static void sfp_sm_event(struct sfp *sfp, unsigned int event) + sfp_sm_link_down(sfp); + sfp_sm_fault(sfp, true); + } else if (event == +- (sfp->id.ext.options & SFP_OPTIONS_LOS_INVERTED ? ++ (sfp->id.ext.options & ++ cpu_to_be16(SFP_OPTIONS_LOS_INVERTED) ? + SFP_E_LOS_LOW : SFP_E_LOS_HIGH)) { + sfp_sm_link_down(sfp); + sfp_sm_next(sfp, SFP_S_WAIT_LOS, 0); +diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c +index 511f8339fa96..7927e28f5336 100644 +--- a/drivers/net/virtio_net.c ++++ b/drivers/net/virtio_net.c +@@ -714,7 +714,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, + int num_skb_frags; + + buf = virtqueue_get_buf_ctx(rq->vq, &len, &ctx); +- if (unlikely(!ctx)) { ++ if (unlikely(!buf)) { + pr_debug("%s: rx error: %d buffers out of %d missing\n", + dev->name, num_buf, + virtio16_to_cpu(vi->vdev, +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +index b3fa8ae80465..eccd25febfe6 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +@@ -2064,7 +2064,7 @@ static int brcmf_sdio_txpkt_hdalign(struct brcmf_sdio *bus, struct sk_buff *pkt) + return head_pad; + } + +-/** ++/* + * struct brcmf_skbuff_cb reserves first two bytes in sk_buff::cb for + * bus layer usage. + */ +diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c +index a59b54328c07..052e67bce6b3 100644 +--- a/drivers/net/wireless/mac80211_hwsim.c ++++ b/drivers/net/wireless/mac80211_hwsim.c +@@ -3119,6 +3119,11 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info) + if (info->attrs[HWSIM_ATTR_CHANNELS]) + param.channels = nla_get_u32(info->attrs[HWSIM_ATTR_CHANNELS]); + ++ if (param.channels > CFG80211_MAX_NUM_DIFFERENT_CHANNELS) { ++ GENL_SET_ERR_MSG(info, "too many channels specified"); ++ return -EINVAL; ++ } ++ + if (info->attrs[HWSIM_ATTR_NO_VIF]) + param.no_vif = true; + +diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c +index 4e0b25d09b0c..f09ff4789bb5 100644 +--- a/drivers/pci/host/pcie-rcar.c ++++ b/drivers/pci/host/pcie-rcar.c +@@ -1146,12 +1146,12 @@ static int rcar_pcie_probe(struct platform_device *pdev) + err = rcar_pcie_get_resources(pcie); + if (err < 0) { + dev_err(dev, "failed to request resources: %d\n", err); +- goto err_free_bridge; ++ goto err_free_resource_list; + } + + err = rcar_pcie_parse_map_dma_ranges(pcie, dev->of_node); + if (err) +- goto err_free_bridge; ++ goto err_free_resource_list; + + pm_runtime_enable(dev); + err = pm_runtime_get_sync(dev); +@@ -1194,9 +1194,9 @@ static int rcar_pcie_probe(struct platform_device *pdev) + err_pm_disable: + pm_runtime_disable(dev); + +-err_free_bridge: +- pci_free_host_bridge(bridge); ++err_free_resource_list: + pci_free_resource_list(&pcie->resources); ++ pci_free_host_bridge(bridge); + + return err; + } +diff --git a/drivers/pinctrl/intel/pinctrl-denverton.c b/drivers/pinctrl/intel/pinctrl-denverton.c +index 4500880240f2..6572550cfe78 100644 +--- a/drivers/pinctrl/intel/pinctrl-denverton.c ++++ b/drivers/pinctrl/intel/pinctrl-denverton.c +@@ -207,7 +207,7 @@ static const unsigned int dnv_uart0_pins[] = { 60, 61, 64, 65 }; + static const unsigned int dnv_uart0_modes[] = { 2, 3, 1, 1 }; + static const unsigned int dnv_uart1_pins[] = { 94, 95, 96, 97 }; + static const unsigned int dnv_uart2_pins[] = { 60, 61, 62, 63 }; +-static const unsigned int dnv_uart2_modes[] = { 1, 1, 2, 2 }; ++static const unsigned int dnv_uart2_modes[] = { 1, 2, 2, 2 }; + static const unsigned int dnv_emmc_pins[] = { + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + }; +diff --git a/drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c b/drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c +index 4f2a726bbaeb..f5f77432ce6f 100644 +--- a/drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c ++++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c +@@ -428,7 +428,7 @@ static const struct sunxi_desc_pin a64_pins[] = { + SUNXI_FUNCTION(0x0, "gpio_in"), + SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */ +- SUNXI_FUNCTION(0x4, "uart0")), /* RX */ ++ SUNXI_FUNCTION(0x3, "uart0")), /* RX */ + SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5), + SUNXI_FUNCTION(0x0, "gpio_in"), + SUNXI_FUNCTION(0x1, "gpio_out"), +diff --git a/drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c b/drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c +index bc14e954d7a2..b7ca9a40cc66 100644 +--- a/drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c ++++ b/drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c +@@ -145,19 +145,19 @@ static const struct sunxi_desc_pin sun9i_a80_pins[] = { + SUNXI_FUNCTION(0x0, "gpio_in"), + SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION(0x3, "mcsi"), /* MCLK */ +- SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), /* PB_EINT14 */ ++ SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 14)), /* PB_EINT14 */ + SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 15), + SUNXI_FUNCTION(0x0, "gpio_in"), + SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION(0x3, "mcsi"), /* SCK */ + SUNXI_FUNCTION(0x4, "i2c4"), /* SCK */ +- SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)), /* PB_EINT15 */ ++ SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 15)), /* PB_EINT15 */ + SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 16), + SUNXI_FUNCTION(0x0, "gpio_in"), + SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION(0x3, "mcsi"), /* SDA */ + SUNXI_FUNCTION(0x4, "i2c4"), /* SDA */ +- SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)), /* PB_EINT16 */ ++ SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 16)), /* PB_EINT16 */ + + /* Hole */ + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0), +diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c +index f42159fd2031..7424e53157b0 100644 +--- a/drivers/platform/x86/dell-laptop.c ++++ b/drivers/platform/x86/dell-laptop.c +@@ -49,6 +49,7 @@ + + struct quirk_entry { + u8 touchpad_led; ++ u8 kbd_led_levels_off_1; + + int needs_kbd_timeouts; + /* +@@ -79,6 +80,10 @@ static struct quirk_entry quirk_dell_xps13_9333 = { + .kbd_timeouts = { 0, 5, 15, 60, 5 * 60, 15 * 60, -1 }, + }; + ++static struct quirk_entry quirk_dell_latitude_e6410 = { ++ .kbd_led_levels_off_1 = 1, ++}; ++ + static struct platform_driver platform_driver = { + .driver = { + .name = "dell-laptop", +@@ -280,6 +285,15 @@ static const struct dmi_system_id dell_quirks[] __initconst = { + }, + .driver_data = &quirk_dell_xps13_9333, + }, ++ { ++ .callback = dmi_matched, ++ .ident = "Dell Latitude E6410", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6410"), ++ }, ++ .driver_data = &quirk_dell_latitude_e6410, ++ }, + { } + }; + +@@ -1200,6 +1214,9 @@ static int kbd_get_info(struct kbd_info *info) + units = (buffer->output[2] >> 8) & 0xFF; + info->levels = (buffer->output[2] >> 16) & 0xFF; + ++ if (quirks && quirks->kbd_led_levels_off_1 && info->levels) ++ info->levels--; ++ + if (units & BIT(0)) + info->seconds = (buffer->output[3] >> 0) & 0xFF; + if (units & BIT(1)) +diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c +index 8eafcd5fa004..5ede251c52ca 100644 +--- a/drivers/s390/block/dasd_eckd.c ++++ b/drivers/s390/block/dasd_eckd.c +@@ -530,10 +530,12 @@ static int prefix_LRE(struct ccw1 *ccw, struct PFX_eckd_data *pfxdata, + pfxdata->validity.define_extent = 1; + + /* private uid is kept up to date, conf_data may be outdated */ +- if (startpriv->uid.type != UA_BASE_DEVICE) { ++ if (startpriv->uid.type == UA_BASE_PAV_ALIAS) + pfxdata->validity.verify_base = 1; +- if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) +- pfxdata->validity.hyper_pav = 1; ++ ++ if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) { ++ pfxdata->validity.verify_base = 1; ++ pfxdata->validity.hyper_pav = 1; + } + + rc = define_extent(NULL, dedata, trk, totrk, cmd, basedev, blksize); +@@ -3414,10 +3416,12 @@ static int prepare_itcw(struct itcw *itcw, + pfxdata.validity.define_extent = 1; + + /* private uid is kept up to date, conf_data may be outdated */ +- if (startpriv->uid.type != UA_BASE_DEVICE) { ++ if (startpriv->uid.type == UA_BASE_PAV_ALIAS) ++ pfxdata.validity.verify_base = 1; ++ ++ if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) { + pfxdata.validity.verify_base = 1; +- if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) +- pfxdata.validity.hyper_pav = 1; ++ pfxdata.validity.hyper_pav = 1; + } + + switch (cmd) { +diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c +index b2e8c0dfc79c..1aa46d0763a0 100644 +--- a/drivers/scsi/bfa/bfad_bsg.c ++++ b/drivers/scsi/bfa/bfad_bsg.c +@@ -3135,7 +3135,8 @@ bfad_im_bsg_vendor_request(struct bsg_job *job) + struct fc_bsg_request *bsg_request = job->request; + struct fc_bsg_reply *bsg_reply = job->reply; + uint32_t vendor_cmd = bsg_request->rqst_data.h_vendor.vendor_cmd[0]; +- struct bfad_im_port_s *im_port = shost_priv(fc_bsg_to_shost(job)); ++ struct Scsi_Host *shost = fc_bsg_to_shost(job); ++ struct bfad_im_port_s *im_port = bfad_get_im_port(shost); + struct bfad_s *bfad = im_port->bfad; + struct request_queue *request_q = job->req->q; + void *payload_kbuf; +@@ -3357,7 +3358,8 @@ int + bfad_im_bsg_els_ct_request(struct bsg_job *job) + { + struct bfa_bsg_data *bsg_data; +- struct bfad_im_port_s *im_port = shost_priv(fc_bsg_to_shost(job)); ++ struct Scsi_Host *shost = fc_bsg_to_shost(job); ++ struct bfad_im_port_s *im_port = bfad_get_im_port(shost); + struct bfad_s *bfad = im_port->bfad; + bfa_bsg_fcpt_t *bsg_fcpt; + struct bfad_fcxp *drv_fcxp; +diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c +index 24e657a4ec80..c05d6e91e4bd 100644 +--- a/drivers/scsi/bfa/bfad_im.c ++++ b/drivers/scsi/bfa/bfad_im.c +@@ -546,6 +546,7 @@ int + bfad_im_scsi_host_alloc(struct bfad_s *bfad, struct bfad_im_port_s *im_port, + struct device *dev) + { ++ struct bfad_im_port_pointer *im_portp; + int error = 1; + + mutex_lock(&bfad_mutex); +@@ -564,7 +565,8 @@ bfad_im_scsi_host_alloc(struct bfad_s *bfad, struct bfad_im_port_s *im_port, + goto out_free_idr; + } + +- im_port->shost->hostdata[0] = (unsigned long)im_port; ++ im_portp = shost_priv(im_port->shost); ++ im_portp->p = im_port; + im_port->shost->unique_id = im_port->idr_id; + im_port->shost->this_id = -1; + im_port->shost->max_id = MAX_FCP_TARGET; +@@ -748,7 +750,7 @@ bfad_scsi_host_alloc(struct bfad_im_port_s *im_port, struct bfad_s *bfad) + + sht->sg_tablesize = bfad->cfg_data.io_max_sge; + +- return scsi_host_alloc(sht, sizeof(unsigned long)); ++ return scsi_host_alloc(sht, sizeof(struct bfad_im_port_pointer)); + } + + void +diff --git a/drivers/scsi/bfa/bfad_im.h b/drivers/scsi/bfa/bfad_im.h +index c81ec2a77ef5..06ce4ba2b7bc 100644 +--- a/drivers/scsi/bfa/bfad_im.h ++++ b/drivers/scsi/bfa/bfad_im.h +@@ -69,6 +69,16 @@ struct bfad_im_port_s { + struct fc_vport *fc_vport; + }; + ++struct bfad_im_port_pointer { ++ struct bfad_im_port_s *p; ++}; ++ ++static inline struct bfad_im_port_s *bfad_get_im_port(struct Scsi_Host *host) ++{ ++ struct bfad_im_port_pointer *im_portp = shost_priv(host); ++ return im_portp->p; ++} ++ + enum bfad_itnim_state { + ITNIM_STATE_NONE, + ITNIM_STATE_ONLINE, +diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c +index 56faeb049b4a..87c08ff37ddd 100644 +--- a/drivers/scsi/lpfc/lpfc_mem.c ++++ b/drivers/scsi/lpfc/lpfc_mem.c +@@ -753,12 +753,12 @@ lpfc_rq_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp) + drqe.address_hi = putPaddrHigh(rqb_entry->dbuf.phys); + rc = lpfc_sli4_rq_put(rqb_entry->hrq, rqb_entry->drq, &hrqe, &drqe); + if (rc < 0) { +- (rqbp->rqb_free_buffer)(phba, rqb_entry); + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, + "6409 Cannot post to RQ %d: %x %x\n", + rqb_entry->hrq->queue_id, + rqb_entry->hrq->host_index, + rqb_entry->hrq->hba_index); ++ (rqbp->rqb_free_buffer)(phba, rqb_entry); + } else { + list_add_tail(&rqb_entry->hbuf.list, &rqbp->rqb_buffer_list); + rqbp->buffer_count++; +diff --git a/drivers/soc/amlogic/meson-gx-socinfo.c b/drivers/soc/amlogic/meson-gx-socinfo.c +index 89f4cf507be6..f2d8c3c53ea4 100644 +--- a/drivers/soc/amlogic/meson-gx-socinfo.c ++++ b/drivers/soc/amlogic/meson-gx-socinfo.c +@@ -20,8 +20,8 @@ + #define AO_SEC_SOCINFO_OFFSET AO_SEC_SD_CFG8 + + #define SOCINFO_MAJOR GENMASK(31, 24) +-#define SOCINFO_MINOR GENMASK(23, 16) +-#define SOCINFO_PACK GENMASK(15, 8) ++#define SOCINFO_PACK GENMASK(23, 16) ++#define SOCINFO_MINOR GENMASK(15, 8) + #define SOCINFO_MISC GENMASK(7, 0) + + static const struct meson_gx_soc_id { +diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c +index c5cd635c28f3..41410031f8e9 100644 +--- a/drivers/spi/spi-sun4i.c ++++ b/drivers/spi/spi-sun4i.c +@@ -525,7 +525,7 @@ static int sun4i_spi_probe(struct platform_device *pdev) + + static int sun4i_spi_remove(struct platform_device *pdev) + { +- pm_runtime_disable(&pdev->dev); ++ pm_runtime_force_suspend(&pdev->dev); + + return 0; + } +diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c +index 372ce9913e6d..e7541dc90473 100644 +--- a/drivers/staging/android/ashmem.c ++++ b/drivers/staging/android/ashmem.c +@@ -710,30 +710,32 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd, + size_t pgstart, pgend; + int ret = -EINVAL; + ++ mutex_lock(&ashmem_mutex); ++ + if (unlikely(!asma->file)) +- return -EINVAL; ++ goto out_unlock; + +- if (unlikely(copy_from_user(&pin, p, sizeof(pin)))) +- return -EFAULT; ++ if (unlikely(copy_from_user(&pin, p, sizeof(pin)))) { ++ ret = -EFAULT; ++ goto out_unlock; ++ } + + /* per custom, you can pass zero for len to mean "everything onward" */ + if (!pin.len) + pin.len = PAGE_ALIGN(asma->size) - pin.offset; + + if (unlikely((pin.offset | pin.len) & ~PAGE_MASK)) +- return -EINVAL; ++ goto out_unlock; + + if (unlikely(((__u32)-1) - pin.offset < pin.len)) +- return -EINVAL; ++ goto out_unlock; + + if (unlikely(PAGE_ALIGN(asma->size) < pin.offset + pin.len)) +- return -EINVAL; ++ goto out_unlock; + + pgstart = pin.offset / PAGE_SIZE; + pgend = pgstart + (pin.len / PAGE_SIZE) - 1; + +- mutex_lock(&ashmem_mutex); +- + switch (cmd) { + case ASHMEM_PIN: + ret = ashmem_pin(asma, pgstart, pgend); +@@ -746,6 +748,7 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd, + break; + } + ++out_unlock: + mutex_unlock(&ashmem_mutex); + + return ret; +diff --git a/drivers/staging/android/ion/ion-ioctl.c b/drivers/staging/android/ion/ion-ioctl.c +index d9f8b1424da1..021a956db1a8 100644 +--- a/drivers/staging/android/ion/ion-ioctl.c ++++ b/drivers/staging/android/ion/ion-ioctl.c +@@ -71,8 +71,10 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) + return -EFAULT; + + ret = validate_ioctl_arg(cmd, &data); +- if (WARN_ON_ONCE(ret)) ++ if (ret) { ++ pr_warn_once("%s: ioctl validate failed\n", __func__); + return ret; ++ } + + if (!(dir & _IOC_WRITE)) + memset(&data, 0, sizeof(data)); +diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c +index 4dc5d7a589c2..b6ece18e6a88 100644 +--- a/drivers/staging/android/ion/ion_system_heap.c ++++ b/drivers/staging/android/ion/ion_system_heap.c +@@ -371,7 +371,7 @@ static int ion_system_contig_heap_allocate(struct ion_heap *heap, + unsigned long i; + int ret; + +- page = alloc_pages(low_order_gfp_flags, order); ++ page = alloc_pages(low_order_gfp_flags | __GFP_NOWARN, order); + if (!page) + return -ENOMEM; + +diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c +index f72ca485c86f..e266a70a1b32 100644 +--- a/drivers/staging/ccree/ssi_hash.c ++++ b/drivers/staging/ccree/ssi_hash.c +@@ -1781,7 +1781,7 @@ static int ssi_ahash_import(struct ahash_request *req, const void *in) + struct device *dev = &ctx->drvdata->plat_dev->dev; + struct ahash_req_ctx *state = ahash_request_ctx(req); + u32 tmp; +- int rc; ++ int rc = 0; + + memcpy(&tmp, in, sizeof(u32)); + if (tmp != CC_EXPORT_MAGIC) { +diff --git a/drivers/staging/fsl-mc/bus/Kconfig b/drivers/staging/fsl-mc/bus/Kconfig +index 504c987447f2..eee1c1b277fa 100644 +--- a/drivers/staging/fsl-mc/bus/Kconfig ++++ b/drivers/staging/fsl-mc/bus/Kconfig +@@ -8,7 +8,7 @@ + + config FSL_MC_BUS + bool "QorIQ DPAA2 fsl-mc bus driver" +- depends on OF && (ARCH_LAYERSCAPE || (COMPILE_TEST && (ARM || ARM64 || X86 || PPC))) ++ depends on OF && (ARCH_LAYERSCAPE || (COMPILE_TEST && (ARM || ARM64 || X86_LOCAL_APIC || PPC))) + select GENERIC_MSI_IRQ_DOMAIN + help + Driver to enable the bus infrastructure for the QorIQ DPAA2 +diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c +index 6150d2780e22..31a195d1bf05 100644 +--- a/drivers/staging/iio/adc/ad7192.c ++++ b/drivers/staging/iio/adc/ad7192.c +@@ -141,6 +141,8 @@ + #define AD7192_GPOCON_P1DAT BIT(1) /* P1 state */ + #define AD7192_GPOCON_P0DAT BIT(0) /* P0 state */ + ++#define AD7192_EXT_FREQ_MHZ_MIN 2457600 ++#define AD7192_EXT_FREQ_MHZ_MAX 5120000 + #define AD7192_INT_FREQ_MHZ 4915200 + + /* NOTE: +@@ -217,6 +219,12 @@ static int ad7192_calibrate_all(struct ad7192_state *st) + ARRAY_SIZE(ad7192_calib_arr)); + } + ++static inline bool ad7192_valid_external_frequency(u32 freq) ++{ ++ return (freq >= AD7192_EXT_FREQ_MHZ_MIN && ++ freq <= AD7192_EXT_FREQ_MHZ_MAX); ++} ++ + static int ad7192_setup(struct ad7192_state *st, + const struct ad7192_platform_data *pdata) + { +@@ -242,17 +250,20 @@ static int ad7192_setup(struct ad7192_state *st, + id); + + switch (pdata->clock_source_sel) { +- case AD7192_CLK_EXT_MCLK1_2: +- case AD7192_CLK_EXT_MCLK2: +- st->mclk = AD7192_INT_FREQ_MHZ; +- break; + case AD7192_CLK_INT: + case AD7192_CLK_INT_CO: +- if (pdata->ext_clk_hz) +- st->mclk = pdata->ext_clk_hz; +- else +- st->mclk = AD7192_INT_FREQ_MHZ; ++ st->mclk = AD7192_INT_FREQ_MHZ; + break; ++ case AD7192_CLK_EXT_MCLK1_2: ++ case AD7192_CLK_EXT_MCLK2: ++ if (ad7192_valid_external_frequency(pdata->ext_clk_hz)) { ++ st->mclk = pdata->ext_clk_hz; ++ break; ++ } ++ dev_err(&st->sd.spi->dev, "Invalid frequency setting %u\n", ++ pdata->ext_clk_hz); ++ ret = -EINVAL; ++ goto out; + default: + ret = -EINVAL; + goto out; +diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c +index 3d539eeb0e26..6d31001d1825 100644 +--- a/drivers/staging/iio/impedance-analyzer/ad5933.c ++++ b/drivers/staging/iio/impedance-analyzer/ad5933.c +@@ -649,8 +649,6 @@ static int ad5933_register_ring_funcs_and_init(struct iio_dev *indio_dev) + /* Ring buffer functions - here trigger setup related */ + indio_dev->setup_ops = &ad5933_ring_setup_ops; + +- indio_dev->modes |= INDIO_BUFFER_HARDWARE; +- + return 0; + } + +@@ -763,7 +761,7 @@ static int ad5933_probe(struct i2c_client *client, + indio_dev->dev.parent = &client->dev; + indio_dev->info = &ad5933_info; + indio_dev->name = id->name; +- indio_dev->modes = INDIO_DIRECT_MODE; ++ indio_dev->modes = (INDIO_BUFFER_SOFTWARE | INDIO_DIRECT_MODE); + indio_dev->channels = ad5933_channels; + indio_dev->num_channels = ARRAY_SIZE(ad5933_channels); + +diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c +index 47903d510955..8b800e34407b 100644 +--- a/drivers/usb/core/urb.c ++++ b/drivers/usb/core/urb.c +@@ -187,6 +187,31 @@ EXPORT_SYMBOL_GPL(usb_unanchor_urb); + + /*-------------------------------------------------------------------*/ + ++static const int pipetypes[4] = { ++ PIPE_CONTROL, PIPE_ISOCHRONOUS, PIPE_BULK, PIPE_INTERRUPT ++}; ++ ++/** ++ * usb_urb_ep_type_check - sanity check of endpoint in the given urb ++ * @urb: urb to be checked ++ * ++ * This performs a light-weight sanity check for the endpoint in the ++ * given urb. It returns 0 if the urb contains a valid endpoint, otherwise ++ * a negative error code. ++ */ ++int usb_urb_ep_type_check(const struct urb *urb) ++{ ++ const struct usb_host_endpoint *ep; ++ ++ ep = usb_pipe_endpoint(urb->dev, urb->pipe); ++ if (!ep) ++ return -EINVAL; ++ if (usb_pipetype(urb->pipe) != pipetypes[usb_endpoint_type(&ep->desc)]) ++ return -EINVAL; ++ return 0; ++} ++EXPORT_SYMBOL_GPL(usb_urb_ep_type_check); ++ + /** + * usb_submit_urb - issue an asynchronous transfer request for an endpoint + * @urb: pointer to the urb describing the request +@@ -326,9 +351,6 @@ EXPORT_SYMBOL_GPL(usb_unanchor_urb); + */ + int usb_submit_urb(struct urb *urb, gfp_t mem_flags) + { +- static int pipetypes[4] = { +- PIPE_CONTROL, PIPE_ISOCHRONOUS, PIPE_BULK, PIPE_INTERRUPT +- }; + int xfertype, max; + struct usb_device *dev; + struct usb_host_endpoint *ep; +@@ -444,7 +466,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) + */ + + /* Check that the pipe's type matches the endpoint's type */ +- if (usb_pipetype(urb->pipe) != pipetypes[xfertype]) ++ if (usb_urb_ep_type_check(urb)) + dev_WARN(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n", + usb_pipetype(urb->pipe), pipetypes[xfertype]); + +diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c +index a26d1fde0f5e..fbfc09ebd2ec 100644 +--- a/drivers/usb/dwc3/dwc3-of-simple.c ++++ b/drivers/usb/dwc3/dwc3-of-simple.c +@@ -57,8 +57,10 @@ static int dwc3_of_simple_clk_init(struct dwc3_of_simple *simple, int count) + + clk = of_clk_get(np, i); + if (IS_ERR(clk)) { +- while (--i >= 0) ++ while (--i >= 0) { ++ clk_disable_unprepare(simple->clks[i]); + clk_put(simple->clks[i]); ++ } + return PTR_ERR(clk); + } + +diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c +index f064f1549333..97e52c0d1a72 100644 +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -267,7 +267,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd, + { + const struct usb_endpoint_descriptor *desc = dep->endpoint.desc; + struct dwc3 *dwc = dep->dwc; +- u32 timeout = 500; ++ u32 timeout = 1000; + u32 reg; + + int cmd_status = 0; +diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c +index 720408d39f11..b8915513fc84 100644 +--- a/drivers/usb/usbip/stub_dev.c ++++ b/drivers/usb/usbip/stub_dev.c +@@ -87,6 +87,7 @@ static ssize_t store_sockfd(struct device *dev, struct device_attribute *attr, + goto err; + + sdev->ud.tcp_socket = socket; ++ sdev->ud.sockfd = sockfd; + + spin_unlock_irq(&sdev->ud.lock); + +@@ -186,6 +187,7 @@ static void stub_shutdown_connection(struct usbip_device *ud) + if (ud->tcp_socket) { + sockfd_put(ud->tcp_socket); + ud->tcp_socket = NULL; ++ ud->sockfd = -1; + } + + /* 3. free used data */ +@@ -280,6 +282,7 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev) + sdev->ud.status = SDEV_ST_AVAILABLE; + spin_lock_init(&sdev->ud.lock); + sdev->ud.tcp_socket = NULL; ++ sdev->ud.sockfd = -1; + + INIT_LIST_HEAD(&sdev->priv_init); + INIT_LIST_HEAD(&sdev->priv_tx); +diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c +index 692cfdef667e..89858aeed647 100644 +--- a/drivers/usb/usbip/vhci_hcd.c ++++ b/drivers/usb/usbip/vhci_hcd.c +@@ -998,6 +998,7 @@ static void vhci_shutdown_connection(struct usbip_device *ud) + if (vdev->ud.tcp_socket) { + sockfd_put(vdev->ud.tcp_socket); + vdev->ud.tcp_socket = NULL; ++ vdev->ud.sockfd = -1; + } + pr_info("release socket\n"); + +@@ -1044,6 +1045,7 @@ static void vhci_device_reset(struct usbip_device *ud) + if (ud->tcp_socket) { + sockfd_put(ud->tcp_socket); + ud->tcp_socket = NULL; ++ ud->sockfd = -1; + } + ud->status = VDEV_ST_NULL; + +diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c +index d6dbb28245e6..a827c1a684a9 100644 +--- a/drivers/vhost/vhost.c ++++ b/drivers/vhost/vhost.c +@@ -904,7 +904,7 @@ static void vhost_dev_lock_vqs(struct vhost_dev *d) + { + int i = 0; + for (i = 0; i < d->nvqs; ++i) +- mutex_lock(&d->vqs[i]->mutex); ++ mutex_lock_nested(&d->vqs[i]->mutex, i); + } + + static void vhost_dev_unlock_vqs(struct vhost_dev *d) +diff --git a/drivers/video/fbdev/mmp/core.c b/drivers/video/fbdev/mmp/core.c +index a0f496049db7..3a6bb6561ba0 100644 +--- a/drivers/video/fbdev/mmp/core.c ++++ b/drivers/video/fbdev/mmp/core.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include