--- /dev/null
+From b662fdd0a681eb56d0adc72545a9385309786b1e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 6 Feb 2020 22:02:21 +0200
+Subject: ALSA: hda: do not override bus codec_mask in link_get()
+
+From: Kai Vehmanen <kai.vehmanen@linux.intel.com>
+
+[ Upstream commit 43bcb1c0507858cdc95e425017dcc33f8105df39 ]
+
+snd_hdac_ext_bus_link_get() does not work correctly in case
+there are multiple codecs on the bus. It unconditionally
+resets the bus->codec_mask value. As per documentation in
+hdaudio.h and existing use in client code, this field should
+be used to store bit flag of detected codecs on the bus.
+
+By overwriting value of the codec_mask, information on all
+detected codecs is lost. No current user of hdac is impacted,
+but use of bus->codec_mask is planned in future patches
+for SOF.
+
+Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
+Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
+Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
+Reviewed-by: Takashi Iwai <tiwai@suse.de>
+Link: https://lore.kernel.org/r/20200206200223.7715-1-kai.vehmanen@linux.intel.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/hda/ext/hdac_ext_controller.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/sound/hda/ext/hdac_ext_controller.c b/sound/hda/ext/hdac_ext_controller.c
+index cfab60d88c921..09ff209df4a30 100644
+--- a/sound/hda/ext/hdac_ext_controller.c
++++ b/sound/hda/ext/hdac_ext_controller.c
+@@ -254,6 +254,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_down_all);
+ int snd_hdac_ext_bus_link_get(struct hdac_bus *bus,
+ struct hdac_ext_link *link)
+ {
++ unsigned long codec_mask;
+ int ret = 0;
+
+ mutex_lock(&bus->lock);
+@@ -280,9 +281,11 @@ int snd_hdac_ext_bus_link_get(struct hdac_bus *bus,
+ * HDA spec section 4.3 - Codec Discovery
+ */
+ udelay(521);
+- bus->codec_mask = snd_hdac_chip_readw(bus, STATESTS);
+- dev_dbg(bus->dev, "codec_mask = 0x%lx\n", bus->codec_mask);
+- snd_hdac_chip_writew(bus, STATESTS, bus->codec_mask);
++ codec_mask = snd_hdac_chip_readw(bus, STATESTS);
++ dev_dbg(bus->dev, "codec_mask = 0x%lx\n", codec_mask);
++ snd_hdac_chip_writew(bus, STATESTS, codec_mask);
++ if (!bus->codec_mask)
++ bus->codec_mask = codec_mask;
+ }
+
+ mutex_unlock(&bus->lock);
+--
+2.20.1
+
--- /dev/null
+From a4e594fbcb889c2ba25895bf29a02a6f2458872e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 31 Jan 2020 17:52:30 -0800
+Subject: arch/csky: fix some Kconfig typos
+
+From: Randy Dunlap <rdunlap@infradead.org>
+
+[ Upstream commit bebd26ab623616728d6e72b5c74a47bfff5287d8 ]
+
+Fix wording in help text for the CPU_HAS_LDSTEX symbol.
+
+Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
+Signed-off-by: Guo Ren <guoren@kernel.org>
+Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/csky/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig
+index da09c884cc305..2265227b7df8f 100644
+--- a/arch/csky/Kconfig
++++ b/arch/csky/Kconfig
+@@ -75,7 +75,7 @@ config CPU_HAS_TLBI
+ config CPU_HAS_LDSTEX
+ bool
+ help
+- For SMP, CPU needs "ldex&stex" instrcutions to atomic operations.
++ For SMP, CPU needs "ldex&stex" instructions for atomic operations.
+
+ config CPU_NEED_TLBSYNC
+ bool
+--
+2.20.1
+
--- /dev/null
+From 80cf3a32cb32b952d6d1925cb2491a7de344129a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 2 Feb 2020 14:11:11 +0800
+Subject: csky: Fixup compile warning for three unimplemented syscalls
+
+From: Guo Ren <guoren@linux.alibaba.com>
+
+[ Upstream commit 2305f60b76110cb3e8658a4ae85d1f7eb0c66a5b ]
+
+Implement fstat64, fstatat64, clone3 syscalls to fixup
+checksyscalls.sh compile warnings.
+
+Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/csky/include/uapi/asm/unistd.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/arch/csky/include/uapi/asm/unistd.h b/arch/csky/include/uapi/asm/unistd.h
+index 211c983c7282d..ba40189297338 100644
+--- a/arch/csky/include/uapi/asm/unistd.h
++++ b/arch/csky/include/uapi/asm/unistd.h
+@@ -1,7 +1,10 @@
+ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+ // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
+
++#define __ARCH_WANT_STAT64
++#define __ARCH_WANT_NEW_STAT
+ #define __ARCH_WANT_SYS_CLONE
++#define __ARCH_WANT_SYS_CLONE3
+ #define __ARCH_WANT_SET_GET_RLIMIT
+ #define __ARCH_WANT_TIME32_SYSCALLS
+ #include <asm-generic/unistd.h>
+--
+2.20.1
+
--- /dev/null
+From 165f08fdee9f4a0041dbf3e04daba98d6d46f8f7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 2 Feb 2020 09:58:42 +0800
+Subject: csky: Fixup ftrace modify panic
+
+From: Guo Ren <guoren@linux.alibaba.com>
+
+[ Upstream commit 359ae00d12589c31cf103894d0f32588d523ca83 ]
+
+During ftrace init, linux will replace all function prologues
+(call_mcout) with nops, but it need flush_dcache and
+invalidate_icache to make it work. So flush_cache functions
+couldn't be nested called by ftrace framework.
+
+Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/csky/mm/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/csky/mm/Makefile b/arch/csky/mm/Makefile
+index c94ef64810986..efb7ebab342b3 100644
+--- a/arch/csky/mm/Makefile
++++ b/arch/csky/mm/Makefile
+@@ -1,8 +1,10 @@
+ # SPDX-License-Identifier: GPL-2.0-only
+ ifeq ($(CONFIG_CPU_HAS_CACHEV2),y)
+ obj-y += cachev2.o
++CFLAGS_REMOVE_cachev2.o = $(CC_FLAGS_FTRACE)
+ else
+ obj-y += cachev1.o
++CFLAGS_REMOVE_cachev1.o = $(CC_FLAGS_FTRACE)
+ endif
+
+ obj-y += dma-mapping.o
+--
+2.20.1
+
--- /dev/null
+From 5c0e04b7a9880e944f5936cfe4a37bdae93c4c9c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 30 Dec 2019 15:53:37 +0800
+Subject: csky/mm: Fixup export invalid_pte_table symbol
+
+From: Guo Ren <guoren@linux.alibaba.com>
+
+[ Upstream commit 7f4a567332f035ab16b29010fbd04a0f10183c77 ]
+
+There is no present bit in csky pmd hardware, so we need to prepare invalid_pte_table
+for empty pmd entry and the functions (pmd_none & pmd_present) in pgtable.h need
+invalid_pte_talbe to get result. If a module use these functions, we need export the
+symbol for it.
+
+Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
+Cc: Mo Qihui <qihui.mo@verisilicon.com>
+Cc: Zhange Jian <zhang_jian5@dahuatech.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/csky/mm/init.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/csky/mm/init.c b/arch/csky/mm/init.c
+index d4c2292ea46bc..00e96278b3776 100644
+--- a/arch/csky/mm/init.c
++++ b/arch/csky/mm/init.c
+@@ -31,6 +31,7 @@
+
+ pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss;
+ pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned_bss;
++EXPORT_SYMBOL(invalid_pte_table);
+ unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]
+ __page_aligned_bss;
+ EXPORT_SYMBOL(empty_zero_page);
+--
+2.20.1
+
--- /dev/null
+From e502ef8c85ee78e0ccb7de8f96151233e3b8f24f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 17 Dec 2019 11:12:55 +0800
+Subject: csky: Set regs->usp to kernel sp, when the exception is from kernel
+
+From: Guo Ren <guoren@linux.alibaba.com>
+
+[ Upstream commit f8e17c17b81070f38062dce79ca7f4541851dadd ]
+
+In the past, we didn't care about kernel sp when saving pt_reg. But in some
+cases, we still need pt_reg->usp to represent the kernel stack before enter
+exception.
+
+For cmpxhg in atomic.S, we need save and restore usp for above.
+
+Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/csky/abiv1/inc/abi/entry.h | 19 ++++++++++++++-----
+ arch/csky/abiv2/inc/abi/entry.h | 11 +++++++++++
+ arch/csky/kernel/atomic.S | 8 ++++++--
+ 3 files changed, 31 insertions(+), 7 deletions(-)
+
+diff --git a/arch/csky/abiv1/inc/abi/entry.h b/arch/csky/abiv1/inc/abi/entry.h
+index 7ab78bd0f3b13..f35a9f3315ee6 100644
+--- a/arch/csky/abiv1/inc/abi/entry.h
++++ b/arch/csky/abiv1/inc/abi/entry.h
+@@ -16,14 +16,16 @@
+ #define LSAVE_A4 40
+ #define LSAVE_A5 44
+
++#define usp ss1
++
+ .macro USPTOKSP
+- mtcr sp, ss1
++ mtcr sp, usp
+ mfcr sp, ss0
+ .endm
+
+ .macro KSPTOUSP
+ mtcr sp, ss0
+- mfcr sp, ss1
++ mfcr sp, usp
+ .endm
+
+ .macro SAVE_ALL epc_inc
+@@ -45,7 +47,13 @@
+ add lr, r13
+ stw lr, (sp, 8)
+
++ mov lr, sp
++ addi lr, 32
++ addi lr, 32
++ addi lr, 16
++ bt 2f
+ mfcr lr, ss1
++2:
+ stw lr, (sp, 16)
+
+ stw a0, (sp, 20)
+@@ -79,9 +87,10 @@
+ ldw a0, (sp, 12)
+ mtcr a0, epsr
+ btsti a0, 31
++ bt 1f
+ ldw a0, (sp, 16)
+ mtcr a0, ss1
+-
++1:
+ ldw a0, (sp, 24)
+ ldw a1, (sp, 28)
+ ldw a2, (sp, 32)
+@@ -102,9 +111,9 @@
+ addi sp, 32
+ addi sp, 8
+
+- bt 1f
++ bt 2f
+ KSPTOUSP
+-1:
++2:
+ rte
+ .endm
+
+diff --git a/arch/csky/abiv2/inc/abi/entry.h b/arch/csky/abiv2/inc/abi/entry.h
+index 9897a16b45e5d..94a7a58765dff 100644
+--- a/arch/csky/abiv2/inc/abi/entry.h
++++ b/arch/csky/abiv2/inc/abi/entry.h
+@@ -31,7 +31,13 @@
+
+ mfcr lr, epsr
+ stw lr, (sp, 12)
++ btsti lr, 31
++ bf 1f
++ addi lr, sp, 152
++ br 2f
++1:
+ mfcr lr, usp
++2:
+ stw lr, (sp, 16)
+
+ stw a0, (sp, 20)
+@@ -64,8 +70,10 @@
+ mtcr a0, epc
+ ldw a0, (sp, 12)
+ mtcr a0, epsr
++ btsti a0, 31
+ ldw a0, (sp, 16)
+ mtcr a0, usp
++ mtcr a0, ss0
+
+ #ifdef CONFIG_CPU_HAS_HILO
+ ldw a0, (sp, 140)
+@@ -86,6 +94,9 @@
+ addi sp, 40
+ ldm r16-r30, (sp)
+ addi sp, 72
++ bf 1f
++ mfcr sp, ss0
++1:
+ rte
+ .endm
+
+diff --git a/arch/csky/kernel/atomic.S b/arch/csky/kernel/atomic.S
+index 5b84f11485aeb..3821ef9b75672 100644
+--- a/arch/csky/kernel/atomic.S
++++ b/arch/csky/kernel/atomic.S
+@@ -17,10 +17,12 @@ ENTRY(csky_cmpxchg)
+ mfcr a3, epc
+ addi a3, TRAP0_SIZE
+
+- subi sp, 8
++ subi sp, 16
+ stw a3, (sp, 0)
+ mfcr a3, epsr
+ stw a3, (sp, 4)
++ mfcr a3, usp
++ stw a3, (sp, 8)
+
+ psrset ee
+ #ifdef CONFIG_CPU_HAS_LDSTEX
+@@ -47,7 +49,9 @@ ENTRY(csky_cmpxchg)
+ mtcr a3, epc
+ ldw a3, (sp, 4)
+ mtcr a3, epsr
+- addi sp, 8
++ ldw a3, (sp, 8)
++ mtcr a3, usp
++ addi sp, 16
+ KSPTOUSP
+ rte
+ END(csky_cmpxchg)
+--
+2.20.1
+
--- /dev/null
+From 2bb99ebd9b6cc4e738ba52080e9d34794d1b6fc5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 7 Jan 2020 12:21:25 +0800
+Subject: csky/smp: Fixup boot failed when CONFIG_SMP
+
+From: Guo Ren <guoren@linux.alibaba.com>
+
+[ Upstream commit c9492737b25ca32679ba3163609d938c9abfd508 ]
+
+If we use a non-ipi-support interrupt controller, it will cause panic here.
+We should let cpu up and work with CONFIG_SMP, when we use a non-ipi intc.
+
+Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/csky/kernel/smp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c
+index b753d382e4cef..0bb0954d55709 100644
+--- a/arch/csky/kernel/smp.c
++++ b/arch/csky/kernel/smp.c
+@@ -120,7 +120,7 @@ void __init setup_smp_ipi(void)
+ int rc;
+
+ if (ipi_irq == 0)
+- panic("%s IRQ mapping failed\n", __func__);
++ return;
+
+ rc = request_percpu_irq(ipi_irq, handle_ipi, "IPI Interrupt",
+ &ipi_dummy_dev);
+--
+2.20.1
+
--- /dev/null
+From 0f36e202e50062bc03f34eb8e872a7ba59a3a6d3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 17 Jan 2020 16:34:29 +0100
+Subject: drm/modes: Allow DRM_MODE_ROTATE_0 when applying video mode
+ parameters
+
+From: Stephan Gerhold <stephan@gerhold.net>
+
+[ Upstream commit 5c320b6ce7510653bce68cecf80cf5b2d67e907f ]
+
+At the moment, only DRM_MODE_ROTATE_180 is allowed when we try to apply
+the rotation from the video mode parameters. It is also useful to allow
+DRM_MODE_ROTATE_0 in case there is only a reflect option in the video mode
+parameter (e.g. video=540x960,reflect_x).
+
+DRM_MODE_ROTATE_0 means "no rotation" and should therefore not require
+any special handling, so we can just add it to the if condition.
+
+Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+Link: https://patchwork.freedesktop.org/patch/msgid/20200117153429.54700-3-stephan@gerhold.net
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/drm_client_modeset.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
+index 6d4a29e99ae26..3035584f6dc72 100644
+--- a/drivers/gpu/drm/drm_client_modeset.c
++++ b/drivers/gpu/drm/drm_client_modeset.c
+@@ -951,7 +951,8 @@ bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation)
+ * depending on the hardware this may require the framebuffer
+ * to be in a specific tiling format.
+ */
+- if ((*rotation & DRM_MODE_ROTATE_MASK) != DRM_MODE_ROTATE_180 ||
++ if (((*rotation & DRM_MODE_ROTATE_MASK) != DRM_MODE_ROTATE_0 &&
++ (*rotation & DRM_MODE_ROTATE_MASK) != DRM_MODE_ROTATE_180) ||
+ !plane->rotation_property)
+ return false;
+
+--
+2.20.1
+
--- /dev/null
+From a3d241383f3d2ab0fe59d8ba11badd6c45fc4fb5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 17 Jan 2020 16:34:28 +0100
+Subject: drm/modes: Make sure to parse valid rotation value from cmdline
+
+From: Stephan Gerhold <stephan@gerhold.net>
+
+[ Upstream commit e6980a727154b793adb218fbc7b4d6af52a7e364 ]
+
+A rotation value should have exactly one rotation angle.
+At the moment there is no validation for this when parsing video=
+parameters from the command line. This causes problems later on
+when we try to combine the command line rotation with the panel
+orientation.
+
+To make sure that we generate a valid rotation value:
+ - Set DRM_MODE_ROTATE_0 by default (if no rotate= option is set)
+ - Validate that there is exactly one rotation angle set
+ (i.e. specifying the rotate= option multiple times is invalid)
+
+Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+Link: https://patchwork.freedesktop.org/patch/msgid/20200117153429.54700-2-stephan@gerhold.net
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/drm_modes.c | 7 +++++++
+ drivers/gpu/drm/selftests/drm_cmdline_selftests.h | 1 +
+ .../gpu/drm/selftests/test-drm_cmdline_parser.c | 15 +++++++++++++--
+ 3 files changed, 21 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
+index 88232698d7a00..3fd35e6b9d535 100644
+--- a/drivers/gpu/drm/drm_modes.c
++++ b/drivers/gpu/drm/drm_modes.c
+@@ -1672,6 +1672,13 @@ static int drm_mode_parse_cmdline_options(char *str, size_t len,
+ }
+ }
+
++ if (!(rotation & DRM_MODE_ROTATE_MASK))
++ rotation |= DRM_MODE_ROTATE_0;
++
++ /* Make sure there is exactly one rotation defined */
++ if (!is_power_of_2(rotation & DRM_MODE_ROTATE_MASK))
++ return -EINVAL;
++
+ mode->rotation_reflection = rotation;
+
+ return 0;
+diff --git a/drivers/gpu/drm/selftests/drm_cmdline_selftests.h b/drivers/gpu/drm/selftests/drm_cmdline_selftests.h
+index 6d61a0eb5d64f..84e6bc050bf2c 100644
+--- a/drivers/gpu/drm/selftests/drm_cmdline_selftests.h
++++ b/drivers/gpu/drm/selftests/drm_cmdline_selftests.h
+@@ -53,6 +53,7 @@ cmdline_test(drm_cmdline_test_rotate_0)
+ cmdline_test(drm_cmdline_test_rotate_90)
+ cmdline_test(drm_cmdline_test_rotate_180)
+ cmdline_test(drm_cmdline_test_rotate_270)
++cmdline_test(drm_cmdline_test_rotate_multiple)
+ cmdline_test(drm_cmdline_test_rotate_invalid_val)
+ cmdline_test(drm_cmdline_test_rotate_truncated)
+ cmdline_test(drm_cmdline_test_hmirror)
+diff --git a/drivers/gpu/drm/selftests/test-drm_cmdline_parser.c b/drivers/gpu/drm/selftests/test-drm_cmdline_parser.c
+index 013de9d27c35d..035f86c5d6482 100644
+--- a/drivers/gpu/drm/selftests/test-drm_cmdline_parser.c
++++ b/drivers/gpu/drm/selftests/test-drm_cmdline_parser.c
+@@ -856,6 +856,17 @@ static int drm_cmdline_test_rotate_270(void *ignored)
+ return 0;
+ }
+
++static int drm_cmdline_test_rotate_multiple(void *ignored)
++{
++ struct drm_cmdline_mode mode = { };
++
++ FAIL_ON(drm_mode_parse_command_line_for_connector("720x480,rotate=0,rotate=90",
++ &no_connector,
++ &mode));
++
++ return 0;
++}
++
+ static int drm_cmdline_test_rotate_invalid_val(void *ignored)
+ {
+ struct drm_cmdline_mode mode = { };
+@@ -888,7 +899,7 @@ static int drm_cmdline_test_hmirror(void *ignored)
+ FAIL_ON(!mode.specified);
+ FAIL_ON(mode.xres != 720);
+ FAIL_ON(mode.yres != 480);
+- FAIL_ON(mode.rotation_reflection != DRM_MODE_REFLECT_X);
++ FAIL_ON(mode.rotation_reflection != (DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_X));
+
+ FAIL_ON(mode.refresh_specified);
+
+@@ -913,7 +924,7 @@ static int drm_cmdline_test_vmirror(void *ignored)
+ FAIL_ON(!mode.specified);
+ FAIL_ON(mode.xres != 720);
+ FAIL_ON(mode.yres != 480);
+- FAIL_ON(mode.rotation_reflection != DRM_MODE_REFLECT_Y);
++ FAIL_ON(mode.rotation_reflection != (DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_Y));
+
+ FAIL_ON(mode.refresh_specified);
+
+--
+2.20.1
+
--- /dev/null
+From 931dce14c5e2c969ceb5c4cd8a1b512ef48eb4ca Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 6 Feb 2020 14:42:01 +0530
+Subject: drm/msm/dsi/pll: call vco set rate explicitly
+
+From: Harigovindan P <harigovi@codeaurora.org>
+
+[ Upstream commit c6659785dfb3f8d75f1fe637e4222ff8178f5280 ]
+
+For a given byte clock, if VCO recalc value is exactly same as
+vco set rate value, vco_set_rate does not get called assuming
+VCO is already set to required value. But Due to GDSC toggle,
+VCO values are erased in the HW. To make sure VCO is programmed
+correctly, we forcefully call set_rate from vco_prepare.
+
+Signed-off-by: Harigovindan P <harigovi@codeaurora.org>
+Reviewed-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
+Signed-off-by: Rob Clark <robdclark@chromium.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c
+index 8f6100db90ed4..aa9385d5bfff9 100644
+--- a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c
++++ b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c
+@@ -411,6 +411,12 @@ static int dsi_pll_10nm_vco_prepare(struct clk_hw *hw)
+ if (pll_10nm->slave)
+ dsi_pll_enable_pll_bias(pll_10nm->slave);
+
++ rc = dsi_pll_10nm_vco_set_rate(hw,pll_10nm->vco_current_rate, 0);
++ if (rc) {
++ pr_err("vco_set_rate failed, rc=%d\n", rc);
++ return rc;
++ }
++
+ /* Start PLL */
+ pll_write(pll_10nm->phy_cmn_mmio + REG_DSI_10nm_PHY_CMN_PLL_CNTRL,
+ 0x01);
+--
+2.20.1
+
--- /dev/null
+From 973b2b8107c019666ca1aa7ed96fc264e6e1eb2a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 6 Feb 2020 14:26:15 +0530
+Subject: drm/msm/dsi: save pll state before dsi host is powered off
+
+From: Harigovindan P <harigovi@codeaurora.org>
+
+[ Upstream commit a1028dcfd0dd97884072288d0c8ed7f30399b528 ]
+
+Save pll state before dsi host is powered off. Without this change
+some register values gets resetted.
+
+Signed-off-by: Harigovindan P <harigovi@codeaurora.org>
+Signed-off-by: Rob Clark <robdclark@chromium.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/msm/dsi/dsi_manager.c | 5 +++++
+ drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 4 ----
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
+index 355a60b4a536f..73127948f54d9 100644
+--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
++++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
+@@ -479,6 +479,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge)
+ struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1);
+ struct mipi_dsi_host *host = msm_dsi->host;
+ struct drm_panel *panel = msm_dsi->panel;
++ struct msm_dsi_pll *src_pll;
+ bool is_dual_dsi = IS_DUAL_DSI();
+ int ret;
+
+@@ -519,6 +520,10 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge)
+ id, ret);
+ }
+
++ /* Save PLL status if it is a clock source */
++ src_pll = msm_dsi_phy_get_pll(msm_dsi->phy);
++ msm_dsi_pll_save_state(src_pll);
++
+ ret = msm_dsi_host_power_off(host);
+ if (ret)
+ pr_err("%s: host %d power off failed,%d\n", __func__, id, ret);
+diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
+index b0cfa67d2a578..f509ebd77500f 100644
+--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
++++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
+@@ -724,10 +724,6 @@ void msm_dsi_phy_disable(struct msm_dsi_phy *phy)
+ if (!phy || !phy->cfg->ops.disable)
+ return;
+
+- /* Save PLL status if it is a clock source */
+- if (phy->usecase != MSM_DSI_PHY_SLAVE)
+- msm_dsi_pll_save_state(phy->pll);
+-
+ phy->cfg->ops.disable(phy);
+
+ dsi_phy_regulator_disable(phy);
+--
+2.20.1
+
--- /dev/null
+From 1f3e7dd401d4580b311fe4bb8343abe1b77a45a8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 29 Jan 2020 20:12:44 +0000
+Subject: drm: msm: Fix return type of dsi_mgr_connector_mode_valid for kCFI
+
+From: John Stultz <john.stultz@linaro.org>
+
+[ Upstream commit 7fd2dfc3694922eb7ace4801b7208cf9f62ebc7d ]
+
+I was hitting kCFI crashes when building with clang, and after
+some digging finally narrowed it down to the
+dsi_mgr_connector_mode_valid() function being implemented as
+returning an int, instead of an enum drm_mode_status.
+
+This patch fixes it, and appeases the opaque word of the kCFI
+gods (seriously, clang inlining everything makes the kCFI
+backtraces only really rough estimates of where things went
+wrong).
+
+Thanks as always to Sami for his help narrowing this down.
+
+Cc: Rob Clark <robdclark@gmail.com>
+Cc: Sean Paul <sean@poorly.run>
+Cc: Sami Tolvanen <samitolvanen@google.com>
+Cc: Todd Kjos <tkjos@google.com>
+Cc: Alistair Delva <adelva@google.com>
+Cc: Amit Pundir <amit.pundir@linaro.org>
+Cc: Sumit Semwal <sumit.semwal@linaro.org>
+Cc: freedreno@lists.freedesktop.org
+Cc: clang-built-linux@googlegroups.com
+Signed-off-by: John Stultz <john.stultz@linaro.org>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Tested-by: Amit Pundir <amit.pundir@linaro.org>
+Signed-off-by: Rob Clark <robdclark@chromium.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/msm/dsi/dsi_manager.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
+index 271aa7bbca925..355a60b4a536f 100644
+--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
++++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
+@@ -336,7 +336,7 @@ static int dsi_mgr_connector_get_modes(struct drm_connector *connector)
+ return num;
+ }
+
+-static int dsi_mgr_connector_mode_valid(struct drm_connector *connector,
++static enum drm_mode_status dsi_mgr_connector_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+ int id = dsi_mgr_connector_get_id(connector);
+--
+2.20.1
+
--- /dev/null
+From 2f2edf770ee435e1b922d1d0bb1957a25d268a8b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 18 Jan 2020 15:41:20 -0500
+Subject: drm/msm/mdp5: rate limit pp done timeout warnings
+
+From: Brian Masney <masneyb@onstation.org>
+
+[ Upstream commit ef8c9809acb0805c991bba8bdd4749fc46d44a98 ]
+
+Add rate limiting of the 'pp done time out' warnings since these
+warnings can quickly fill the dmesg buffer.
+
+Signed-off-by: Brian Masney <masneyb@onstation.org>
+Signed-off-by: Rob Clark <robdclark@chromium.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
+index 05cc04f729d63..e1cc541e0ef2e 100644
+--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
++++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
+@@ -1109,8 +1109,8 @@ static void mdp5_crtc_wait_for_pp_done(struct drm_crtc *crtc)
+ ret = wait_for_completion_timeout(&mdp5_crtc->pp_completion,
+ msecs_to_jiffies(50));
+ if (ret == 0)
+- dev_warn(dev->dev, "pp done time out, lm=%d\n",
+- mdp5_cstate->pipeline.mixer->lm);
++ dev_warn_ratelimited(dev->dev, "pp done time out, lm=%d\n",
++ mdp5_cstate->pipeline.mixer->lm);
+ }
+
+ static void mdp5_crtc_wait_for_flush_done(struct drm_crtc *crtc)
+--
+2.20.1
+
--- /dev/null
+From 78ae78e303b698bef6b6e265f9fc3ba4c59927ac Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 17 Feb 2020 12:39:47 +0100
+Subject: efi: Only print errors about failing to get certs if EFI vars are
+ found
+
+From: Javier Martinez Canillas <javierm@redhat.com>
+
+[ Upstream commit 3be54d558c75562e42bc83d665df024bd79d399b ]
+
+If CONFIG_LOAD_UEFI_KEYS is enabled, the kernel attempts to load the certs
+from the db, dbx and MokListRT EFI variables into the appropriate keyrings.
+
+But it just assumes that the variables will be present and prints an error
+if the certs can't be loaded, even when is possible that the variables may
+not exist. For example the MokListRT variable will only be present if shim
+is used.
+
+So only print an error message about failing to get the certs list from an
+EFI variable if this is found. Otherwise these printed errors just pollute
+the kernel log ring buffer with confusing messages like the following:
+
+[ 5.427251] Couldn't get size: 0x800000000000000e
+[ 5.427261] MODSIGN: Couldn't get UEFI db list
+[ 5.428012] Couldn't get size: 0x800000000000000e
+[ 5.428023] Couldn't get UEFI MokListRT
+
+Reported-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
+Tested-by: Hans de Goede <hdegoede@redhat.com>
+Acked-by: Ard Biesheuvel <ardb@kernel.org>
+Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ security/integrity/platform_certs/load_uefi.c | 40 ++++++++++++-------
+ 1 file changed, 26 insertions(+), 14 deletions(-)
+
+diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
+index 111898aad56e4..f0c908241966a 100644
+--- a/security/integrity/platform_certs/load_uefi.c
++++ b/security/integrity/platform_certs/load_uefi.c
+@@ -35,16 +35,18 @@ static __init bool uefi_check_ignore_db(void)
+ * Get a certificate list blob from the named EFI variable.
+ */
+ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
+- unsigned long *size)
++ unsigned long *size, efi_status_t *status)
+ {
+- efi_status_t status;
+ unsigned long lsize = 4;
+ unsigned long tmpdb[4];
+ void *db;
+
+- status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb);
+- if (status != EFI_BUFFER_TOO_SMALL) {
+- pr_err("Couldn't get size: 0x%lx\n", status);
++ *status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb);
++ if (*status == EFI_NOT_FOUND)
++ return NULL;
++
++ if (*status != EFI_BUFFER_TOO_SMALL) {
++ pr_err("Couldn't get size: 0x%lx\n", *status);
+ return NULL;
+ }
+
+@@ -52,10 +54,10 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
+ if (!db)
+ return NULL;
+
+- status = efi.get_variable(name, guid, NULL, &lsize, db);
+- if (status != EFI_SUCCESS) {
++ *status = efi.get_variable(name, guid, NULL, &lsize, db);
++ if (*status != EFI_SUCCESS) {
+ kfree(db);
+- pr_err("Error reading db var: 0x%lx\n", status);
++ pr_err("Error reading db var: 0x%lx\n", *status);
+ return NULL;
+ }
+
+@@ -74,6 +76,7 @@ static int __init load_uefi_certs(void)
+ efi_guid_t mok_var = EFI_SHIM_LOCK_GUID;
+ void *db = NULL, *dbx = NULL, *mok = NULL;
+ unsigned long dbsize = 0, dbxsize = 0, moksize = 0;
++ efi_status_t status;
+ int rc = 0;
+
+ if (!efi.get_variable)
+@@ -83,9 +86,12 @@ static int __init load_uefi_certs(void)
+ * an error if we can't get them.
+ */
+ if (!uefi_check_ignore_db()) {
+- db = get_cert_list(L"db", &secure_var, &dbsize);
++ db = get_cert_list(L"db", &secure_var, &dbsize, &status);
+ if (!db) {
+- pr_err("MODSIGN: Couldn't get UEFI db list\n");
++ if (status == EFI_NOT_FOUND)
++ pr_debug("MODSIGN: db variable wasn't found\n");
++ else
++ pr_err("MODSIGN: Couldn't get UEFI db list\n");
+ } else {
+ rc = parse_efi_signature_list("UEFI:db",
+ db, dbsize, get_handler_for_db);
+@@ -96,9 +102,12 @@ static int __init load_uefi_certs(void)
+ }
+ }
+
+- mok = get_cert_list(L"MokListRT", &mok_var, &moksize);
++ mok = get_cert_list(L"MokListRT", &mok_var, &moksize, &status);
+ if (!mok) {
+- pr_info("Couldn't get UEFI MokListRT\n");
++ if (status == EFI_NOT_FOUND)
++ pr_debug("MokListRT variable wasn't found\n");
++ else
++ pr_info("Couldn't get UEFI MokListRT\n");
+ } else {
+ rc = parse_efi_signature_list("UEFI:MokListRT",
+ mok, moksize, get_handler_for_db);
+@@ -107,9 +116,12 @@ static int __init load_uefi_certs(void)
+ kfree(mok);
+ }
+
+- dbx = get_cert_list(L"dbx", &secure_var, &dbxsize);
++ dbx = get_cert_list(L"dbx", &secure_var, &dbxsize, &status);
+ if (!dbx) {
+- pr_info("Couldn't get UEFI dbx list\n");
++ if (status == EFI_NOT_FOUND)
++ pr_debug("dbx variable wasn't found\n");
++ else
++ pr_info("Couldn't get UEFI dbx list\n");
+ } else {
+ rc = parse_efi_signature_list("UEFI:dbx",
+ dbx, dbxsize,
+--
+2.20.1
+
--- /dev/null
+From ab91e74a675444f1ed90d86da92c220e682bc577 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 5 Jan 2020 09:05:45 +0000
+Subject: habanalabs: do not halt CoreSight during hard reset
+
+From: Omer Shpigelman <oshpigelman@habana.ai>
+
+[ Upstream commit a37e47192dfa98f79a0cd5ab991c224b5980c982 ]
+
+During hard reset we must not write to the device.
+Hence avoid halting CoreSight during user context close if it is done
+during hard reset.
+In addition, we must not re-enable clock gating afterwards as it was
+deliberately disabled in the beginning of the hard reset flow.
+
+Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai>
+Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
+Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/misc/habanalabs/device.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c
+index 166883b647252..b680b0caa69be 100644
+--- a/drivers/misc/habanalabs/device.c
++++ b/drivers/misc/habanalabs/device.c
+@@ -598,7 +598,9 @@ int hl_device_set_debug_mode(struct hl_device *hdev, bool enable)
+ goto out;
+ }
+
+- hdev->asic_funcs->halt_coresight(hdev);
++ if (!hdev->hard_reset_pending)
++ hdev->asic_funcs->halt_coresight(hdev);
++
+ hdev->in_debug = 0;
+
+ goto out;
+--
+2.20.1
+
--- /dev/null
+From 957b95679a97a77fdbeb2dce045daf5d1d544cf8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 23 Dec 2019 17:51:48 +0200
+Subject: habanalabs: halt the engines before hard-reset
+
+From: Oded Gabbay <oded.gabbay@gmail.com>
+
+[ Upstream commit 908087ffbe896c100ed73d5f0ce11a5b7264af4a ]
+
+The driver must halt the engines before doing hard-reset, otherwise the
+device can go into undefined state. There is a place where the driver
+didn't do that and this patch fixes it.
+
+Reviewed-by: Tomer Tayar <ttayar@habana.ai>
+Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/misc/habanalabs/device.c | 1 +
+ drivers/misc/habanalabs/goya/goya.c | 42 +++++++++++++++++++++++++++++
+ 2 files changed, 43 insertions(+)
+
+diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c
+index b155e95490761..166883b647252 100644
+--- a/drivers/misc/habanalabs/device.c
++++ b/drivers/misc/habanalabs/device.c
+@@ -1189,6 +1189,7 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass)
+ if (hdev->asic_funcs->get_hw_state(hdev) == HL_DEVICE_HW_STATE_DIRTY) {
+ dev_info(hdev->dev,
+ "H/W state is dirty, must reset before initializing\n");
++ hdev->asic_funcs->halt_engines(hdev, true);
+ hdev->asic_funcs->hw_fini(hdev, true);
+ }
+
+diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
+index 7344e8a222ae5..f24fe909b88d8 100644
+--- a/drivers/misc/habanalabs/goya/goya.c
++++ b/drivers/misc/habanalabs/goya/goya.c
+@@ -895,6 +895,11 @@ void goya_init_dma_qmans(struct hl_device *hdev)
+ */
+ static void goya_disable_external_queues(struct hl_device *hdev)
+ {
++ struct goya_device *goya = hdev->asic_specific;
++
++ if (!(goya->hw_cap_initialized & HW_CAP_DMA))
++ return;
++
+ WREG32(mmDMA_QM_0_GLBL_CFG0, 0);
+ WREG32(mmDMA_QM_1_GLBL_CFG0, 0);
+ WREG32(mmDMA_QM_2_GLBL_CFG0, 0);
+@@ -956,6 +961,11 @@ static int goya_stop_external_queues(struct hl_device *hdev)
+ {
+ int rc, retval = 0;
+
++ struct goya_device *goya = hdev->asic_specific;
++
++ if (!(goya->hw_cap_initialized & HW_CAP_DMA))
++ return retval;
++
+ rc = goya_stop_queue(hdev,
+ mmDMA_QM_0_GLBL_CFG1,
+ mmDMA_QM_0_CP_STS,
+@@ -1744,9 +1754,18 @@ void goya_init_tpc_qmans(struct hl_device *hdev)
+ */
+ static void goya_disable_internal_queues(struct hl_device *hdev)
+ {
++ struct goya_device *goya = hdev->asic_specific;
++
++ if (!(goya->hw_cap_initialized & HW_CAP_MME))
++ goto disable_tpc;
++
+ WREG32(mmMME_QM_GLBL_CFG0, 0);
+ WREG32(mmMME_CMDQ_GLBL_CFG0, 0);
+
++disable_tpc:
++ if (!(goya->hw_cap_initialized & HW_CAP_TPC))
++ return;
++
+ WREG32(mmTPC0_QM_GLBL_CFG0, 0);
+ WREG32(mmTPC0_CMDQ_GLBL_CFG0, 0);
+
+@@ -1782,8 +1801,12 @@ static void goya_disable_internal_queues(struct hl_device *hdev)
+ */
+ static int goya_stop_internal_queues(struct hl_device *hdev)
+ {
++ struct goya_device *goya = hdev->asic_specific;
+ int rc, retval = 0;
+
++ if (!(goya->hw_cap_initialized & HW_CAP_MME))
++ goto stop_tpc;
++
+ /*
+ * Each queue (QMAN) is a separate H/W logic. That means that each
+ * QMAN can be stopped independently and failure to stop one does NOT
+@@ -1810,6 +1833,10 @@ static int goya_stop_internal_queues(struct hl_device *hdev)
+ retval = -EIO;
+ }
+
++stop_tpc:
++ if (!(goya->hw_cap_initialized & HW_CAP_TPC))
++ return retval;
++
+ rc = goya_stop_queue(hdev,
+ mmTPC0_QM_GLBL_CFG1,
+ mmTPC0_QM_CP_STS,
+@@ -1975,6 +2002,11 @@ static int goya_stop_internal_queues(struct hl_device *hdev)
+
+ static void goya_dma_stall(struct hl_device *hdev)
+ {
++ struct goya_device *goya = hdev->asic_specific;
++
++ if (!(goya->hw_cap_initialized & HW_CAP_DMA))
++ return;
++
+ WREG32(mmDMA_QM_0_GLBL_CFG1, 1 << DMA_QM_0_GLBL_CFG1_DMA_STOP_SHIFT);
+ WREG32(mmDMA_QM_1_GLBL_CFG1, 1 << DMA_QM_1_GLBL_CFG1_DMA_STOP_SHIFT);
+ WREG32(mmDMA_QM_2_GLBL_CFG1, 1 << DMA_QM_2_GLBL_CFG1_DMA_STOP_SHIFT);
+@@ -1984,6 +2016,11 @@ static void goya_dma_stall(struct hl_device *hdev)
+
+ static void goya_tpc_stall(struct hl_device *hdev)
+ {
++ struct goya_device *goya = hdev->asic_specific;
++
++ if (!(goya->hw_cap_initialized & HW_CAP_TPC))
++ return;
++
+ WREG32(mmTPC0_CFG_TPC_STALL, 1 << TPC0_CFG_TPC_STALL_V_SHIFT);
+ WREG32(mmTPC1_CFG_TPC_STALL, 1 << TPC1_CFG_TPC_STALL_V_SHIFT);
+ WREG32(mmTPC2_CFG_TPC_STALL, 1 << TPC2_CFG_TPC_STALL_V_SHIFT);
+@@ -1996,6 +2033,11 @@ static void goya_tpc_stall(struct hl_device *hdev)
+
+ static void goya_mme_stall(struct hl_device *hdev)
+ {
++ struct goya_device *goya = hdev->asic_specific;
++
++ if (!(goya->hw_cap_initialized & HW_CAP_MME))
++ return;
++
+ WREG32(mmMME_STALL, 0xFFFFFFFF);
+ }
+
+--
+2.20.1
+
--- /dev/null
+From 7216a1b71749df2da9aa124c430adff90fe936b3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 23 Jan 2020 00:43:06 +0200
+Subject: habanalabs: patched cb equals user cb in device memset
+
+From: Oded Gabbay <oded.gabbay@gmail.com>
+
+[ Upstream commit cf01514c5c6efa2d521d35e68dff2e0674d08e91 ]
+
+During device memory memset, the driver allocates and use a CB (command
+buffer). To reuse existing code, it keeps a pointer to the CB in two
+variables, user_cb and patched_cb. Therefore, there is no need to "put"
+both the user_cb and patched_cb, as it will cause an underflow of the
+refcnt of the CB.
+
+Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/misc/habanalabs/goya/goya.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
+index f24fe909b88d8..b8a8de24aaf72 100644
+--- a/drivers/misc/habanalabs/goya/goya.c
++++ b/drivers/misc/habanalabs/goya/goya.c
+@@ -4690,8 +4690,6 @@ static int goya_memset_device_memory(struct hl_device *hdev, u64 addr, u64 size,
+
+ rc = goya_send_job_on_qman0(hdev, job);
+
+- hl_cb_put(job->patched_cb);
+-
+ hl_debugfs_remove_job(hdev, job);
+ kfree(job);
+ cb->cs_cnt--;
+--
+2.20.1
+
--- /dev/null
+From 06436d8d1dd8bcd678aee4b48b0fb425cd9a48c1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 13 Feb 2020 13:31:24 -0800
+Subject: ice: Don't tell the OS that link is going down
+
+From: Michal Swiatkowski <michal.swiatkowski@intel.com>
+
+[ Upstream commit 8a55c08d3bbc9ffc9639f69f742e59ebd99f913b ]
+
+Remove code that tell the OS that link is going down when user
+change flow control via ethtool. When link is up it isn't certain
+that link goes down after 0x0605 aq command. If link doesn't go
+down, OS thinks that link is down, but physical link is up. To
+reset this state user have to take interface down and up.
+
+If link goes down after 0x0605 command, FW send information
+about that and after that driver tells the OS that the link goes
+down. So this code in ethtool is unnecessary.
+
+Signed-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>
+Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/intel/ice/ice_ethtool.c | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
+index 9bd166e3dff3d..594f6dbb21102 100644
+--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
++++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
+@@ -2977,13 +2977,6 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)
+ else
+ return -EINVAL;
+
+- /* Tell the OS link is going down, the link will go back up when fw
+- * says it is ready asynchronously
+- */
+- ice_print_link_msg(vsi, false);
+- netif_carrier_off(netdev);
+- netif_tx_stop_all_queues(netdev);
+-
+ /* Set the FC mode and only restart AN if link is up */
+ status = ice_set_fc(pi, &aq_failures, link_up);
+
+--
+2.20.1
+
--- /dev/null
+From 99ff49a87788e3a50c129e5cefc87384c810084b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 10 Feb 2020 15:51:15 +0800
+Subject: iommu/amd: Disable IOMMU on Stoney Ridge systems
+
+From: Kai-Heng Feng <kai.heng.feng@canonical.com>
+
+[ Upstream commit 3dfee47b215e49788cfc80e474820ea2e948c031 ]
+
+Serious screen flickering when Stoney Ridge outputs to a 4K monitor.
+
+Use identity-mapping and PCI ATS doesn't help this issue.
+
+According to Alex Deucher, IOMMU isn't enabled on Windows, so let's do
+the same here to avoid screen flickering on 4K monitor.
+
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Bug: https://gitlab.freedesktop.org/drm/amd/issues/961
+Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
+Acked-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Joerg Roedel <jroedel@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iommu/amd_iommu_init.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
+index d7cbca8bf2cd4..b5ae9f7c0510b 100644
+--- a/drivers/iommu/amd_iommu_init.c
++++ b/drivers/iommu/amd_iommu_init.c
+@@ -2533,6 +2533,7 @@ static int __init early_amd_iommu_init(void)
+ struct acpi_table_header *ivrs_base;
+ acpi_status status;
+ int i, remap_cache_sz, ret = 0;
++ u32 pci_id;
+
+ if (!amd_iommu_detected)
+ return -ENODEV;
+@@ -2620,6 +2621,16 @@ static int __init early_amd_iommu_init(void)
+ if (ret)
+ goto out;
+
++ /* Disable IOMMU if there's Stoney Ridge graphics */
++ for (i = 0; i < 32; i++) {
++ pci_id = read_pci_config(0, i, 0, 0);
++ if ((pci_id & 0xffff) == 0x1002 && (pci_id >> 16) == 0x98e4) {
++ pr_info("Disable IOMMU on Stoney Ridge\n");
++ amd_iommu_disabled = true;
++ break;
++ }
++ }
++
+ /* Disable any previously enabled IOMMUs */
+ if (!is_kdump_kernel() || amd_iommu_disabled)
+ disable_iommus();
+@@ -2728,7 +2739,7 @@ static int __init state_next(void)
+ ret = early_amd_iommu_init();
+ init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
+ if (init_state == IOMMU_ACPI_FINISHED && amd_iommu_disabled) {
+- pr_info("AMD IOMMU disabled on kernel command-line\n");
++ pr_info("AMD IOMMU disabled\n");
+ init_state = IOMMU_CMDLINE_DISABLED;
+ ret = -EINVAL;
+ }
+--
+2.20.1
+
--- /dev/null
+From a824f04240d09c516c4b022b8f69fa60710248d0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 31 Jan 2020 18:25:23 +0300
+Subject: Kernel selftests: tpm2: check for tpm support
+
+From: Nikita Sobolev <Nikita.Sobolev@synopsys.com>
+
+[ Upstream commit b32694cd0724d4ceca2c62cc7c3d3a8d1ffa11fc ]
+
+tpm2 tests set fails if there is no /dev/tpm0 and /dev/tpmrm0
+supported. Check if these files exist before run and mark test as
+skipped in case of absence.
+
+Signed-off-by: Nikita Sobolev <Nikita.Sobolev@synopsys.com>
+Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/testing/selftests/tpm2/test_smoke.sh | 13 +++++++++++--
+ tools/testing/selftests/tpm2/test_space.sh | 9 ++++++++-
+ 2 files changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/tools/testing/selftests/tpm2/test_smoke.sh b/tools/testing/selftests/tpm2/test_smoke.sh
+index 8155c2ea7ccbb..b630c7b5950a9 100755
+--- a/tools/testing/selftests/tpm2/test_smoke.sh
++++ b/tools/testing/selftests/tpm2/test_smoke.sh
+@@ -1,8 +1,17 @@
+ #!/bin/bash
+ # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
++self.flags = flags
+
+-python -m unittest -v tpm2_tests.SmokeTest
+-python -m unittest -v tpm2_tests.AsyncTest
++# Kselftest framework requirement - SKIP code is 4.
++ksft_skip=4
++
++
++if [ -f /dev/tpm0 ] ; then
++ python -m unittest -v tpm2_tests.SmokeTest
++ python -m unittest -v tpm2_tests.AsyncTest
++else
++ exit $ksft_skip
++fi
+
+ CLEAR_CMD=$(which tpm2_clear)
+ if [ -n $CLEAR_CMD ]; then
+diff --git a/tools/testing/selftests/tpm2/test_space.sh b/tools/testing/selftests/tpm2/test_space.sh
+index a6f5e346635e5..180b469c53b47 100755
+--- a/tools/testing/selftests/tpm2/test_space.sh
++++ b/tools/testing/selftests/tpm2/test_space.sh
+@@ -1,4 +1,11 @@
+ #!/bin/bash
+ # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
+
+-python -m unittest -v tpm2_tests.SpaceTest
++# Kselftest framework requirement - SKIP code is 4.
++ksft_skip=4
++
++if [ -f /dev/tpmrm0 ] ; then
++ python -m unittest -v tpm2_tests.SpaceTest
++else
++ exit $ksft_skip
++fi
+--
+2.20.1
+
--- /dev/null
+From c5b08694f165c3d11a8085323357eae7182d3140 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 14 Feb 2020 18:44:52 +0300
+Subject: net: atlantic: check rpc result and wait for rpc address
+
+From: Igor Russkikh <irusskikh@marvell.com>
+
+[ Upstream commit e7b5f97e6574dc4918e375d5f8d24ec31653cd6d ]
+
+Artificial HW reliability tests revealed a possible hangup in
+the driver. Normally, when device disappears from bus, all
+register reads returns 0xFFFFFFFF.
+
+At remote procedure invocation towards FW there is a logic
+where result is compared with -1 in a loop.
+That caused an infinite loop if hardware due to some issues
+disappears from bus.
+
+Add extra result checks to prevent this.
+
+Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com>
+Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../aquantia/atlantic/hw_atl/hw_atl_utils.c | 19 +++++++++++++++++--
+ 1 file changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
+index f547baa6c9549..354705f9bc493 100644
+--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
++++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
+@@ -22,6 +22,7 @@
+ #define HW_ATL_MIF_ADDR 0x0208U
+ #define HW_ATL_MIF_VAL 0x020CU
+
++#define HW_ATL_MPI_RPC_ADDR 0x0334U
+ #define HW_ATL_RPC_CONTROL_ADR 0x0338U
+ #define HW_ATL_RPC_STATE_ADR 0x033CU
+
+@@ -53,15 +54,14 @@ enum mcp_area {
+ };
+
+ static int hw_atl_utils_ver_match(u32 ver_expected, u32 ver_actual);
+-
+ static int hw_atl_utils_mpi_set_state(struct aq_hw_s *self,
+ enum hal_atl_utils_fw_state_e state);
+-
+ static u32 hw_atl_utils_get_mpi_mbox_tid(struct aq_hw_s *self);
+ static u32 hw_atl_utils_mpi_get_state(struct aq_hw_s *self);
+ static u32 hw_atl_utils_mif_cmd_get(struct aq_hw_s *self);
+ static u32 hw_atl_utils_mif_addr_get(struct aq_hw_s *self);
+ static u32 hw_atl_utils_rpc_state_get(struct aq_hw_s *self);
++static u32 aq_fw1x_rpc_get(struct aq_hw_s *self);
+
+ int hw_atl_utils_initfw(struct aq_hw_s *self, const struct aq_fw_ops **fw_ops)
+ {
+@@ -476,6 +476,10 @@ static int hw_atl_utils_init_ucp(struct aq_hw_s *self,
+ self, self->mbox_addr,
+ self->mbox_addr != 0U,
+ 1000U, 10000U);
++ err = readx_poll_timeout_atomic(aq_fw1x_rpc_get, self,
++ self->rpc_addr,
++ self->rpc_addr != 0U,
++ 1000U, 100000U);
+
+ return err;
+ }
+@@ -531,6 +535,12 @@ int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,
+ self, fw.val,
+ sw.tid == fw.tid,
+ 1000U, 100000U);
++ if (err < 0)
++ goto err_exit;
++
++ err = aq_hw_err_from_flags(self);
++ if (err < 0)
++ goto err_exit;
+
+ if (fw.len == 0xFFFFU) {
+ err = hw_atl_utils_fw_rpc_call(self, sw.len);
+@@ -1025,6 +1035,11 @@ static u32 hw_atl_utils_rpc_state_get(struct aq_hw_s *self)
+ return aq_hw_read_reg(self, HW_ATL_RPC_STATE_ADR);
+ }
+
++static u32 aq_fw1x_rpc_get(struct aq_hw_s *self)
++{
++ return aq_hw_read_reg(self, HW_ATL_MPI_RPC_ADDR);
++}
++
+ const struct aq_fw_ops aq_fw_1x_ops = {
+ .init = hw_atl_utils_mpi_create,
+ .deinit = hw_atl_fw1x_deinit,
+--
+2.20.1
+
--- /dev/null
+From 5f2e2d91c101bb825d1a6005322bbb636e40eda7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 14 Feb 2020 18:44:53 +0300
+Subject: net: atlantic: ptp gpio adjustments
+
+From: Egor Pomozov <epomozov@marvell.com>
+
+[ Upstream commit f08a464c27ca0a4050333baa271504b27ce834b7 ]
+
+Clock adjustment data should be passed to FW as well, otherwise in some
+cases a drift was observed when using GPIO features.
+
+Signed-off-by: Egor Pomozov <epomozov@marvell.com>
+Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
+Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/aquantia/atlantic/aq_hw.h | 2 ++
+ .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 4 +++-
+ .../aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c | 12 ++++++++++++
+ 3 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
+index cc70c606b6ef2..251767c31f7e5 100644
+--- a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
++++ b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
+@@ -337,6 +337,8 @@ struct aq_fw_ops {
+
+ void (*enable_ptp)(struct aq_hw_s *self, int enable);
+
++ void (*adjust_ptp)(struct aq_hw_s *self, uint64_t adj);
++
+ int (*set_eee_rate)(struct aq_hw_s *self, u32 speed);
+
+ int (*get_eee_rate)(struct aq_hw_s *self, u32 *rate,
+diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+index fce587aaba33d..d20d91cdece86 100644
+--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
++++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+@@ -1165,6 +1165,8 @@ static int hw_atl_b0_adj_sys_clock(struct aq_hw_s *self, s64 delta)
+ {
+ self->ptp_clk_offset += delta;
+
++ self->aq_fw_ops->adjust_ptp(self, self->ptp_clk_offset);
++
+ return 0;
+ }
+
+@@ -1215,7 +1217,7 @@ static int hw_atl_b0_gpio_pulse(struct aq_hw_s *self, u32 index,
+ fwreq.ptp_gpio_ctrl.index = index;
+ fwreq.ptp_gpio_ctrl.period = period;
+ /* Apply time offset */
+- fwreq.ptp_gpio_ctrl.start = start - self->ptp_clk_offset;
++ fwreq.ptp_gpio_ctrl.start = start;
+
+ size = sizeof(fwreq.msg_id) + sizeof(fwreq.ptp_gpio_ctrl);
+ return self->aq_fw_ops->send_fw_request(self, &fwreq, size);
+diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
+index 97ebf849695fd..77a4ed64830fd 100644
+--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
++++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
+@@ -30,6 +30,9 @@
+ #define HW_ATL_FW3X_EXT_CONTROL_ADDR 0x378
+ #define HW_ATL_FW3X_EXT_STATE_ADDR 0x37c
+
++#define HW_ATL_FW3X_PTP_ADJ_LSW_ADDR 0x50a0
++#define HW_ATL_FW3X_PTP_ADJ_MSW_ADDR 0x50a4
++
+ #define HW_ATL_FW2X_CAP_PAUSE BIT(CAPS_HI_PAUSE)
+ #define HW_ATL_FW2X_CAP_ASYM_PAUSE BIT(CAPS_HI_ASYMMETRIC_PAUSE)
+ #define HW_ATL_FW2X_CAP_SLEEP_PROXY BIT(CAPS_HI_SLEEP_PROXY)
+@@ -475,6 +478,14 @@ static void aq_fw3x_enable_ptp(struct aq_hw_s *self, int enable)
+ aq_hw_write_reg(self, HW_ATL_FW3X_EXT_CONTROL_ADDR, ptp_opts);
+ }
+
++static void aq_fw3x_adjust_ptp(struct aq_hw_s *self, uint64_t adj)
++{
++ aq_hw_write_reg(self, HW_ATL_FW3X_PTP_ADJ_LSW_ADDR,
++ (adj >> 0) & 0xffffffff);
++ aq_hw_write_reg(self, HW_ATL_FW3X_PTP_ADJ_MSW_ADDR,
++ (adj >> 32) & 0xffffffff);
++}
++
+ static int aq_fw2x_led_control(struct aq_hw_s *self, u32 mode)
+ {
+ if (self->fw_ver_actual < HW_ATL_FW_VER_LED)
+@@ -633,4 +644,5 @@ const struct aq_fw_ops aq_fw_2x_ops = {
+ .enable_ptp = aq_fw3x_enable_ptp,
+ .led_control = aq_fw2x_led_control,
+ .set_phyloopback = aq_fw2x_set_phyloopback,
++ .adjust_ptp = aq_fw3x_adjust_ptp,
+ };
+--
+2.20.1
+
--- /dev/null
+From e9c716b17b6d77080343cd58440d882ec0b880c2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 16 Feb 2020 16:39:43 -0300
+Subject: net: ethernet: dm9000: Handle -EPROBE_DEFER in dm9000_parse_dt()
+
+From: Paul Cercueil <paul@crapouillou.net>
+
+[ Upstream commit 9a6a0dea16177ccaecc116f560232e63bec115f1 ]
+
+The call to of_get_mac_address() can return -EPROBE_DEFER, for instance
+when the MAC address is read from a NVMEM driver that did not probe yet.
+
+Cc: H. Nikolaus Schaller <hns@goldelico.com>
+Cc: Mathieu Malaterre <malat@debian.org>
+Signed-off-by: Paul Cercueil <paul@crapouillou.net>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/davicom/dm9000.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
+index cce90b5925d93..70060c51854fd 100644
+--- a/drivers/net/ethernet/davicom/dm9000.c
++++ b/drivers/net/ethernet/davicom/dm9000.c
+@@ -1405,6 +1405,8 @@ static struct dm9000_plat_data *dm9000_parse_dt(struct device *dev)
+ mac_addr = of_get_mac_address(np);
+ if (!IS_ERR(mac_addr))
+ ether_addr_copy(pdata->dev_addr, mac_addr);
++ else if (PTR_ERR(mac_addr) == -EPROBE_DEFER)
++ return ERR_CAST(mac_addr);
+
+ return pdata;
+ }
+--
+2.20.1
+
--- /dev/null
+From 9c04f65e23a25bfc7fec4f600491a7169c6f28fc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 15 Feb 2020 17:54:18 +0100
+Subject: net: ks8851-ml: Fix 16-bit data access
+
+From: Marek Vasut <marex@denx.de>
+
+[ Upstream commit edacb098ea9c31589276152f09b4439052c0f2b1 ]
+
+The packet data written to and read from Micrel KSZ8851-16MLLI must be
+byte-swapped in 16-bit mode, add this byte-swapping.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Cc: David S. Miller <davem@davemloft.net>
+Cc: Lukas Wunner <lukas@wunner.de>
+Cc: Petr Stetiar <ynezz@true.cz>
+Cc: YueHaibing <yuehaibing@huawei.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/micrel/ks8851_mll.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
+index e2fb20154511e..5ae206ae5d2b3 100644
+--- a/drivers/net/ethernet/micrel/ks8851_mll.c
++++ b/drivers/net/ethernet/micrel/ks8851_mll.c
+@@ -197,7 +197,7 @@ static inline void ks_inblk(struct ks_net *ks, u16 *wptr, u32 len)
+ {
+ len >>= 1;
+ while (len--)
+- *wptr++ = (u16)ioread16(ks->hw_addr);
++ *wptr++ = be16_to_cpu(ioread16(ks->hw_addr));
+ }
+
+ /**
+@@ -211,7 +211,7 @@ static inline void ks_outblk(struct ks_net *ks, u16 *wptr, u32 len)
+ {
+ len >>= 1;
+ while (len--)
+- iowrite16(*wptr++, ks->hw_addr);
++ iowrite16(cpu_to_be16(*wptr++), ks->hw_addr);
+ }
+
+ static void ks_disable_int(struct ks_net *ks)
+--
+2.20.1
+
--- /dev/null
+From ef2cdd94f0f3c4299fa45e39fa765ce573ce0fa7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 15 Feb 2020 17:54:19 +0100
+Subject: net: ks8851-ml: Fix 16-bit IO operation
+
+From: Marek Vasut <marex@denx.de>
+
+[ Upstream commit 58292104832fef6cb4a89f736012c0e0724c3442 ]
+
+The Micrel KSZ8851-16MLLI datasheet DS00002357B page 12 states that
+BE[3:0] signals are active high. This contradicts the measurements
+of the behavior of the actual chip, where these signals behave as
+active low. For example, to read the CIDER register, the bus must
+expose 0xc0c0 during the address phase, which means BE[3:0]=4'b1100.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Cc: David S. Miller <davem@davemloft.net>
+Cc: Lukas Wunner <lukas@wunner.de>
+Cc: Petr Stetiar <ynezz@true.cz>
+Cc: YueHaibing <yuehaibing@huawei.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/micrel/ks8851_mll.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
+index 5ae206ae5d2b3..1c9e70c8cc30f 100644
+--- a/drivers/net/ethernet/micrel/ks8851_mll.c
++++ b/drivers/net/ethernet/micrel/ks8851_mll.c
+@@ -166,7 +166,7 @@ static int msg_enable;
+
+ static u16 ks_rdreg16(struct ks_net *ks, int offset)
+ {
+- ks->cmd_reg_cache = (u16)offset | ((BE1 | BE0) << (offset & 0x02));
++ ks->cmd_reg_cache = (u16)offset | ((BE3 | BE2) >> (offset & 0x02));
+ iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd);
+ return ioread16(ks->hw_addr);
+ }
+@@ -181,7 +181,7 @@ static u16 ks_rdreg16(struct ks_net *ks, int offset)
+
+ static void ks_wrreg16(struct ks_net *ks, int offset, u16 value)
+ {
+- ks->cmd_reg_cache = (u16)offset | ((BE1 | BE0) << (offset & 0x02));
++ ks->cmd_reg_cache = (u16)offset | ((BE3 | BE2) >> (offset & 0x02));
+ iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd);
+ iowrite16(value, ks->hw_addr);
+ }
+--
+2.20.1
+
--- /dev/null
+From 20218446f64ecaa1b962d0598999a6063a2fb739 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 15 Feb 2020 17:54:17 +0100
+Subject: net: ks8851-ml: Remove 8-bit bus accessors
+
+From: Marek Vasut <marex@denx.de>
+
+[ Upstream commit 69233bba6543a37755158ca3382765387b8078df ]
+
+This driver is mixing 8-bit and 16-bit bus accessors for reasons unknown,
+however the speculation is that this was some sort of attempt to support
+the 8-bit bus mode.
+
+As per the KS8851-16MLL documentation, all two registers accessed via the
+8-bit accessors are internally 16-bit registers, so reading them using
+16-bit accessors is fine. The KS_CCR read can be converted to 16-bit read
+outright, as it is already a concatenation of two 8-bit reads of that
+register. The KS_RXQCR accesses are 8-bit only, however writing the top
+8 bits of the register is OK as well, since the driver caches the entire
+16-bit register value anyway.
+
+Finally, the driver is not used by any hardware in the kernel right now.
+The only hardware available to me is one with 16-bit bus, so I have no
+way to test the 8-bit bus mode, however it is unlikely this ever really
+worked anyway. If the 8-bit bus mode is ever required, it can be easily
+added by adjusting the 16-bit accessors to do 2 consecutive accesses,
+which is how this should have been done from the beginning.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Cc: David S. Miller <davem@davemloft.net>
+Cc: Lukas Wunner <lukas@wunner.de>
+Cc: Petr Stetiar <ynezz@true.cz>
+Cc: YueHaibing <yuehaibing@huawei.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/micrel/ks8851_mll.c | 45 +++---------------------
+ 1 file changed, 5 insertions(+), 40 deletions(-)
+
+diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
+index a41a90c589db2..e2fb20154511e 100644
+--- a/drivers/net/ethernet/micrel/ks8851_mll.c
++++ b/drivers/net/ethernet/micrel/ks8851_mll.c
+@@ -156,24 +156,6 @@ static int msg_enable;
+ * chip is busy transferring packet data (RX/TX FIFO accesses).
+ */
+
+-/**
+- * ks_rdreg8 - read 8 bit register from device
+- * @ks : The chip information
+- * @offset: The register address
+- *
+- * Read a 8bit register from the chip, returning the result
+- */
+-static u8 ks_rdreg8(struct ks_net *ks, int offset)
+-{
+- u16 data;
+- u8 shift_bit = offset & 0x03;
+- u8 shift_data = (offset & 1) << 3;
+- ks->cmd_reg_cache = (u16) offset | (u16)(BE0 << shift_bit);
+- iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd);
+- data = ioread16(ks->hw_addr);
+- return (u8)(data >> shift_data);
+-}
+-
+ /**
+ * ks_rdreg16 - read 16 bit register from device
+ * @ks : The chip information
+@@ -189,22 +171,6 @@ static u16 ks_rdreg16(struct ks_net *ks, int offset)
+ return ioread16(ks->hw_addr);
+ }
+
+-/**
+- * ks_wrreg8 - write 8bit register value to chip
+- * @ks: The chip information
+- * @offset: The register address
+- * @value: The value to write
+- *
+- */
+-static void ks_wrreg8(struct ks_net *ks, int offset, u8 value)
+-{
+- u8 shift_bit = (offset & 0x03);
+- u16 value_write = (u16)(value << ((offset & 1) << 3));
+- ks->cmd_reg_cache = (u16)offset | (BE0 << shift_bit);
+- iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd);
+- iowrite16(value_write, ks->hw_addr);
+-}
+-
+ /**
+ * ks_wrreg16 - write 16bit register value to chip
+ * @ks: The chip information
+@@ -324,8 +290,7 @@ static void ks_read_config(struct ks_net *ks)
+ u16 reg_data = 0;
+
+ /* Regardless of bus width, 8 bit read should always work.*/
+- reg_data = ks_rdreg8(ks, KS_CCR) & 0x00FF;
+- reg_data |= ks_rdreg8(ks, KS_CCR+1) << 8;
++ reg_data = ks_rdreg16(ks, KS_CCR);
+
+ /* addr/data bus are multiplexed */
+ ks->sharedbus = (reg_data & CCR_SHARED) == CCR_SHARED;
+@@ -429,7 +394,7 @@ static inline void ks_read_qmu(struct ks_net *ks, u16 *buf, u32 len)
+
+ /* 1. set sudo DMA mode */
+ ks_wrreg16(ks, KS_RXFDPR, RXFDPR_RXFPAI);
+- ks_wrreg8(ks, KS_RXQCR, (ks->rc_rxqcr | RXQCR_SDA) & 0xff);
++ ks_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr | RXQCR_SDA);
+
+ /* 2. read prepend data */
+ /**
+@@ -446,7 +411,7 @@ static inline void ks_read_qmu(struct ks_net *ks, u16 *buf, u32 len)
+ ks_inblk(ks, buf, ALIGN(len, 4));
+
+ /* 4. reset sudo DMA Mode */
+- ks_wrreg8(ks, KS_RXQCR, ks->rc_rxqcr);
++ ks_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr);
+ }
+
+ /**
+@@ -679,13 +644,13 @@ static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len)
+ ks->txh.txw[1] = cpu_to_le16(len);
+
+ /* 1. set sudo-DMA mode */
+- ks_wrreg8(ks, KS_RXQCR, (ks->rc_rxqcr | RXQCR_SDA) & 0xff);
++ ks_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr | RXQCR_SDA);
+ /* 2. write status/lenth info */
+ ks_outblk(ks, ks->txh.txw, 4);
+ /* 3. write pkt data */
+ ks_outblk(ks, (u16 *)pdata, ALIGN(len, 4));
+ /* 4. reset sudo-DMA mode */
+- ks_wrreg8(ks, KS_RXQCR, ks->rc_rxqcr);
++ ks_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr);
+ /* 5. Enqueue Tx(move the pkt from TX buffer into TXQ) */
+ ks_wrreg16(ks, KS_TXQCR, TXQCR_METFE);
+ /* 6. wait until TXQCR_METFE is auto-cleared */
+--
+2.20.1
+
--- /dev/null
+From 69f709fd49155670d4c22d4fc28de079fe811685 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 5 Feb 2020 14:31:12 +0200
+Subject: net/mlx5: DR, Fix matching on vport gvmi
+
+From: Hamdan Igbaria <hamdani@mellanox.com>
+
+[ Upstream commit 52d214976d4f64504c1bbb52d47b46a5a3d5ee42 ]
+
+Set vport gvmi in the tag, only when source gvmi is set in the bit mask.
+
+Fixes: 26d688e3 ("net/mlx5: DR, Add Steering entry (STE) utilities")
+Signed-off-by: Hamdan Igbaria <hamdani@mellanox.com>
+Reviewed-by: Alex Vesker <valex@mellanox.com>
+Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c
+index c6c7d1defbd78..aade62a9ee5ce 100644
+--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c
+@@ -2307,7 +2307,9 @@ static int dr_ste_build_src_gvmi_qpn_tag(struct mlx5dr_match_param *value,
+ struct mlx5dr_cmd_vport_cap *vport_cap;
+ struct mlx5dr_domain *dmn = sb->dmn;
+ struct mlx5dr_cmd_caps *caps;
++ u8 *bit_mask = sb->bit_mask;
+ u8 *tag = hw_ste->tag;
++ bool source_gvmi_set;
+
+ DR_STE_SET_TAG(src_gvmi_qp, tag, source_qp, misc, source_sqn);
+
+@@ -2328,7 +2330,8 @@ static int dr_ste_build_src_gvmi_qpn_tag(struct mlx5dr_match_param *value,
+ if (!vport_cap)
+ return -EINVAL;
+
+- if (vport_cap->vport_gvmi)
++ source_gvmi_set = MLX5_GET(ste_src_gvmi_qp, bit_mask, source_gvmi);
++ if (vport_cap->vport_gvmi && source_gvmi_set)
+ MLX5_SET(ste_src_gvmi_qp, tag, source_gvmi, vport_cap->vport_gvmi);
+
+ misc->source_eswitch_owner_vhca_id = 0;
+--
+2.20.1
+
--- /dev/null
+From 3f59334b5088c115dcc8e65f82713960ded47830 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 19 Feb 2020 15:19:36 -0800
+Subject: net: thunderx: workaround BGX TX Underflow issue
+
+From: Tim Harvey <tharvey@gateworks.com>
+
+[ Upstream commit 971617c3b761c876d686a2188220a33898c90e99 ]
+
+While it is not yet understood why a TX underflow can easily occur
+for SGMII interfaces resulting in a TX wedge. It has been found that
+disabling/re-enabling the LMAC resolves the issue.
+
+Signed-off-by: Tim Harvey <tharvey@gateworks.com>
+Reviewed-by: Robert Jones <rjones@gateworks.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../net/ethernet/cavium/thunder/thunder_bgx.c | 62 ++++++++++++++++++-
+ .../net/ethernet/cavium/thunder/thunder_bgx.h | 9 +++
+ 2 files changed, 68 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+index c4f6ec0cd183e..00751771f6624 100644
+--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
++++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+@@ -410,10 +410,19 @@ void bgx_lmac_rx_tx_enable(int node, int bgx_idx, int lmacid, bool enable)
+ lmac = &bgx->lmac[lmacid];
+
+ cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_CFG);
+- if (enable)
++ if (enable) {
+ cfg |= CMR_PKT_RX_EN | CMR_PKT_TX_EN;
+- else
++
++ /* enable TX FIFO Underflow interrupt */
++ bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_TXX_INT_ENA_W1S,
++ GMI_TXX_INT_UNDFLW);
++ } else {
+ cfg &= ~(CMR_PKT_RX_EN | CMR_PKT_TX_EN);
++
++ /* Disable TX FIFO Underflow interrupt */
++ bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_TXX_INT_ENA_W1C,
++ GMI_TXX_INT_UNDFLW);
++ }
+ bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cfg);
+
+ if (bgx->is_rgx)
+@@ -1535,6 +1544,48 @@ static int bgx_init_phy(struct bgx *bgx)
+ return bgx_init_of_phy(bgx);
+ }
+
++static irqreturn_t bgx_intr_handler(int irq, void *data)
++{
++ struct bgx *bgx = (struct bgx *)data;
++ u64 status, val;
++ int lmac;
++
++ for (lmac = 0; lmac < bgx->lmac_count; lmac++) {
++ status = bgx_reg_read(bgx, lmac, BGX_GMP_GMI_TXX_INT);
++ if (status & GMI_TXX_INT_UNDFLW) {
++ pci_err(bgx->pdev, "BGX%d lmac%d UNDFLW\n",
++ bgx->bgx_id, lmac);
++ val = bgx_reg_read(bgx, lmac, BGX_CMRX_CFG);
++ val &= ~CMR_EN;
++ bgx_reg_write(bgx, lmac, BGX_CMRX_CFG, val);
++ val |= CMR_EN;
++ bgx_reg_write(bgx, lmac, BGX_CMRX_CFG, val);
++ }
++ /* clear interrupts */
++ bgx_reg_write(bgx, lmac, BGX_GMP_GMI_TXX_INT, status);
++ }
++
++ return IRQ_HANDLED;
++}
++
++static void bgx_register_intr(struct pci_dev *pdev)
++{
++ struct bgx *bgx = pci_get_drvdata(pdev);
++ int ret;
++
++ ret = pci_alloc_irq_vectors(pdev, BGX_LMAC_VEC_OFFSET,
++ BGX_LMAC_VEC_OFFSET, PCI_IRQ_ALL_TYPES);
++ if (ret < 0) {
++ pci_err(pdev, "Req for #%d msix vectors failed\n",
++ BGX_LMAC_VEC_OFFSET);
++ return;
++ }
++ ret = pci_request_irq(pdev, GMPX_GMI_TX_INT, bgx_intr_handler, NULL,
++ bgx, "BGX%d", bgx->bgx_id);
++ if (ret)
++ pci_free_irq(pdev, GMPX_GMI_TX_INT, bgx);
++}
++
+ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+ {
+ int err;
+@@ -1550,7 +1601,7 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+
+ pci_set_drvdata(pdev, bgx);
+
+- err = pci_enable_device(pdev);
++ err = pcim_enable_device(pdev);
+ if (err) {
+ dev_err(dev, "Failed to enable PCI device\n");
+ pci_set_drvdata(pdev, NULL);
+@@ -1604,6 +1655,8 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+
+ bgx_init_hw(bgx);
+
++ bgx_register_intr(pdev);
++
+ /* Enable all LMACs */
+ for (lmac = 0; lmac < bgx->lmac_count; lmac++) {
+ err = bgx_lmac_enable(bgx, lmac);
+@@ -1620,6 +1673,7 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+
+ err_enable:
+ bgx_vnic[bgx->bgx_id] = NULL;
++ pci_free_irq(pdev, GMPX_GMI_TX_INT, bgx);
+ err_release_regions:
+ pci_release_regions(pdev);
+ err_disable_device:
+@@ -1637,6 +1691,8 @@ static void bgx_remove(struct pci_dev *pdev)
+ for (lmac = 0; lmac < bgx->lmac_count; lmac++)
+ bgx_lmac_disable(bgx, lmac);
+
++ pci_free_irq(pdev, GMPX_GMI_TX_INT, bgx);
++
+ bgx_vnic[bgx->bgx_id] = NULL;
+ pci_release_regions(pdev);
+ pci_disable_device(pdev);
+diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
+index 25888706bdcd1..cdea493921857 100644
+--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
++++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
+@@ -180,6 +180,15 @@
+ #define BGX_GMP_GMI_TXX_BURST 0x38228
+ #define BGX_GMP_GMI_TXX_MIN_PKT 0x38240
+ #define BGX_GMP_GMI_TXX_SGMII_CTL 0x38300
++#define BGX_GMP_GMI_TXX_INT 0x38500
++#define BGX_GMP_GMI_TXX_INT_W1S 0x38508
++#define BGX_GMP_GMI_TXX_INT_ENA_W1C 0x38510
++#define BGX_GMP_GMI_TXX_INT_ENA_W1S 0x38518
++#define GMI_TXX_INT_PTP_LOST BIT_ULL(4)
++#define GMI_TXX_INT_LATE_COL BIT_ULL(3)
++#define GMI_TXX_INT_XSDEF BIT_ULL(2)
++#define GMI_TXX_INT_XSCOL BIT_ULL(1)
++#define GMI_TXX_INT_UNDFLW BIT_ULL(0)
+
+ #define BGX_MSIX_VEC_0_29_ADDR 0x400000 /* +(0..29) << 4 */
+ #define BGX_MSIX_VEC_0_29_CTL 0x400008
+--
+2.20.1
+
--- /dev/null
+From 5e0c1b3b7f26eab63471ab8c2591565b1063c6c3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 Feb 2020 00:59:36 +0900
+Subject: nvme: Fix uninitialized-variable warning
+
+From: Keith Busch <kbusch@kernel.org>
+
+[ Upstream commit 15755854d53b4bbb0bb37a0fce66f0156cfc8a17 ]
+
+gcc may detect a false positive on nvme using an unintialized variable
+if setting features fails. Since this is not a fast path, explicitly
+initialize this variable to suppress the warning.
+
+Reported-by: Arnd Bergmann <arnd@arndb.de>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Keith Busch <kbusch@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvme/host/core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
+index ada59df642d29..a4d8c90ee7cc4 100644
+--- a/drivers/nvme/host/core.c
++++ b/drivers/nvme/host/core.c
+@@ -1165,8 +1165,8 @@ static int nvme_identify_ns(struct nvme_ctrl *ctrl,
+ static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid,
+ unsigned int dword11, void *buffer, size_t buflen, u32 *result)
+ {
++ union nvme_result res = { 0 };
+ struct nvme_command c;
+- union nvme_result res;
+ int ret;
+
+ memset(&c, 0, sizeof(c));
+--
+2.20.1
+
--- /dev/null
+From 7dd92c94c2f6617da6f2d0a14fe9f4fde3106913 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 6 Feb 2020 13:17:25 -0700
+Subject: nvme/pci: Add sleep quirk for Samsung and Toshiba drives
+
+From: Shyjumon N <shyjumon.n@intel.com>
+
+[ Upstream commit 1fae37accfc5872af3905d4ba71dc6ab15829be7 ]
+
+The Samsung SSD SM981/PM981 and Toshiba SSD KBG40ZNT256G on the Lenovo
+C640 platform experience runtime resume issues when the SSDs are kept in
+sleep/suspend mode for long time.
+
+This patch applies the 'Simple Suspend' quirk to these configurations.
+With this patch, the issue had not been observed in a 1+ day test.
+
+Reviewed-by: Jon Derrick <jonathan.derrick@intel.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Shyjumon N <shyjumon.n@intel.com>
+Signed-off-by: Keith Busch <kbusch@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvme/host/pci.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
+index bb5e13ad1aff2..ec4165e879163 100644
+--- a/drivers/nvme/host/pci.c
++++ b/drivers/nvme/host/pci.c
+@@ -2747,6 +2747,18 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
+ (dmi_match(DMI_BOARD_NAME, "PRIME B350M-A") ||
+ dmi_match(DMI_BOARD_NAME, "PRIME Z370-A")))
+ return NVME_QUIRK_NO_APST;
++ } else if ((pdev->vendor == 0x144d && (pdev->device == 0xa801 ||
++ pdev->device == 0xa808 || pdev->device == 0xa809)) ||
++ (pdev->vendor == 0x1e0f && pdev->device == 0x0001)) {
++ /*
++ * Forcing to use host managed nvme power settings for
++ * lowest idle power with quick resume latency on
++ * Samsung and Toshiba SSDs based on suspend behavior
++ * on Coffee Lake board for LENOVO C640
++ */
++ if ((dmi_match(DMI_BOARD_VENDOR, "LENOVO")) &&
++ dmi_match(DMI_BOARD_NAME, "LNVNB161216"))
++ return NVME_QUIRK_SIMPLE_SUSPEND;
+ }
+
+ return 0;
+--
+2.20.1
+
--- /dev/null
+From c58003abb19d56bc0291228e1a887908d0e82dbd Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 12 Feb 2020 12:32:18 +0200
+Subject: nvme-pci: Use single IRQ vector for old Apple models
+
+From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+
+[ Upstream commit 98f7b86a0becc1154b1a6df6e75c9695dfd87e0d ]
+
+People reported that old Apple machines are not working properly
+if the non-first IRQ vector is in use.
+
+Set quirk for that models to limit IRQ to use first vector only.
+
+Based on original patch by GitHub user npx001.
+
+Link: https://github.com/Dunedan/mbp-2016-linux/issues/9
+Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Cc: Leif Liddy <leif.liddy@gmail.com>
+Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Keith Busch <kbusch@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvme/host/pci.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
+index ec4165e879163..d3f23d6254e47 100644
+--- a/drivers/nvme/host/pci.c
++++ b/drivers/nvme/host/pci.c
+@@ -3121,7 +3121,8 @@ static const struct pci_device_id nvme_id_table[] = {
+ .driver_data = NVME_QUIRK_NO_DEEPEST_PS |
+ NVME_QUIRK_IGNORE_DEV_SUBNQN, },
+ { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
+- { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) },
++ { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001),
++ .driver_data = NVME_QUIRK_SINGLE_VECTOR },
+ { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
+ { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2005),
+ .driver_data = NVME_QUIRK_SINGLE_VECTOR |
+--
+2.20.1
+
--- /dev/null
+From c173b055c3258d45aa31491bb7ba7eea9fb5c319 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 24 Jan 2020 08:48:55 +0300
+Subject: s390/cio: cio_ignore_proc_seq_next should increase position index
+
+From: Vasily Averin <vvs@virtuozzo.com>
+
+[ Upstream commit 8b101a5e14f2161869636ff9cb4907b7749dc0c2 ]
+
+if seq_file .next fuction does not change position index,
+read after some lseek can generate unexpected output.
+
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=206283
+Link: https://lore.kernel.org/r/d44c53a7-9bc1-15c7-6d4a-0c10cb9dffce@virtuozzo.com
+Reviewed-by: Cornelia Huck <cohuck@redhat.com>
+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
+Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
+Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/s390/cio/blacklist.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
+index 2a3f874a21d54..9cebff8e8d740 100644
+--- a/drivers/s390/cio/blacklist.c
++++ b/drivers/s390/cio/blacklist.c
+@@ -303,8 +303,10 @@ static void *
+ cio_ignore_proc_seq_next(struct seq_file *s, void *it, loff_t *offset)
+ {
+ struct ccwdev_iter *iter;
++ loff_t p = *offset;
+
+- if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1))
++ (*offset)++;
++ if (p >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1))
+ return NULL;
+ iter = it;
+ if (iter->devno == __MAX_SUBCHANNEL) {
+@@ -314,7 +316,6 @@ cio_ignore_proc_seq_next(struct seq_file *s, void *it, loff_t *offset)
+ return NULL;
+ } else
+ iter->devno++;
+- (*offset)++;
+ return iter;
+ }
+
+--
+2.20.1
+
--- /dev/null
+From cf6320c5147695a9f98b5885021ccf740796465d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 16 Feb 2020 23:48:29 +0900
+Subject: s390: make 'install' not depend on vmlinux
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+[ Upstream commit 94e90f727f7424d827256023cace829cad6896f4 ]
+
+For the same reason as commit 19514fc665ff ("arm, kbuild: make "make
+install" not depend on vmlinux"), the install targets should never
+trigger the rebuild of the kernel.
+
+The variable, CONFIGURE, is not set by anyone. Remove it as well.
+
+Link: https://lkml.kernel.org/r/20200216144829.27023-1-masahiroy@kernel.org
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/s390/Makefile | 2 +-
+ arch/s390/boot/Makefile | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/s390/Makefile b/arch/s390/Makefile
+index e0e3a465bbfd6..8dfa2cf1f05c7 100644
+--- a/arch/s390/Makefile
++++ b/arch/s390/Makefile
+@@ -146,7 +146,7 @@ all: bzImage
+ #KBUILD_IMAGE is necessary for packaging targets like rpm-pkg, deb-pkg...
+ KBUILD_IMAGE := $(boot)/bzImage
+
+-install: vmlinux
++install:
+ $(Q)$(MAKE) $(build)=$(boot) $@
+
+ bzImage: vmlinux
+diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile
+index e2c47d3a1c891..0ff9261c915e3 100644
+--- a/arch/s390/boot/Makefile
++++ b/arch/s390/boot/Makefile
+@@ -70,7 +70,7 @@ $(obj)/compressed/vmlinux: $(obj)/startup.a FORCE
+ $(obj)/startup.a: $(OBJECTS) FORCE
+ $(call if_changed,ar)
+
+-install: $(CONFIGURE) $(obj)/bzImage
++install:
+ sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
+ System.map "$(INSTALL_PATH)"
+
+--
+2.20.1
+
--- /dev/null
+From 2eedc75441ca95c9b9666e043e8e195a538b2913 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 10 Feb 2020 10:48:11 +0100
+Subject: s390/qdio: fill SL with absolute addresses
+
+From: Julian Wiedmann <jwi@linux.ibm.com>
+
+[ Upstream commit e9091ffd6a0aaced111b5d6ead5eaab5cd7101bc ]
+
+As the comment says, sl->sbal holds an absolute address. qeth currently
+solves this through wild casting, while zfcp doesn't care.
+
+Handle this properly in the code that actually builds the SL.
+
+Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
+Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
+Reviewed-by: Steffen Maier <maier@linux.ibm.com> [for qdio]
+Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
+Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/s390/include/asm/qdio.h | 2 +-
+ drivers/s390/cio/qdio_setup.c | 3 ++-
+ drivers/s390/net/qeth_core_main.c | 23 +++++++++++------------
+ 3 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/arch/s390/include/asm/qdio.h b/arch/s390/include/asm/qdio.h
+index 71e3f0146cda0..7870cf8345334 100644
+--- a/arch/s390/include/asm/qdio.h
++++ b/arch/s390/include/asm/qdio.h
+@@ -227,7 +227,7 @@ struct qdio_buffer {
+ * @sbal: absolute SBAL address
+ */
+ struct sl_element {
+- unsigned long sbal;
++ u64 sbal;
+ } __attribute__ ((packed));
+
+ /**
+diff --git a/drivers/s390/cio/qdio_setup.c b/drivers/s390/cio/qdio_setup.c
+index dc430bd86ade9..58eaac70dba7f 100644
+--- a/drivers/s390/cio/qdio_setup.c
++++ b/drivers/s390/cio/qdio_setup.c
+@@ -8,6 +8,7 @@
+ #include <linux/kernel.h>
+ #include <linux/slab.h>
+ #include <linux/export.h>
++#include <linux/io.h>
+ #include <asm/qdio.h>
+
+ #include "cio.h"
+@@ -205,7 +206,7 @@ static void setup_storage_lists(struct qdio_q *q, struct qdio_irq *irq_ptr,
+
+ /* fill in sl */
+ for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; j++)
+- q->sl->element[j].sbal = (unsigned long)q->sbal[j];
++ q->sl->element[j].sbal = virt_to_phys(q->sbal[j]);
+ }
+
+ static void setup_queues(struct qdio_irq *irq_ptr,
+diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
+index 10edfd6fc9302..4fd7b0ceb4ffd 100644
+--- a/drivers/s390/net/qeth_core_main.c
++++ b/drivers/s390/net/qeth_core_main.c
+@@ -4749,10 +4749,10 @@ static void qeth_qdio_establish_cq(struct qeth_card *card,
+ if (card->options.cq == QETH_CQ_ENABLED) {
+ int offset = QDIO_MAX_BUFFERS_PER_Q *
+ (card->qdio.no_in_queues - 1);
+- for (i = 0; i < QDIO_MAX_BUFFERS_PER_Q; ++i) {
+- in_sbal_ptrs[offset + i] = (struct qdio_buffer *)
+- virt_to_phys(card->qdio.c_q->bufs[i].buffer);
+- }
++
++ for (i = 0; i < QDIO_MAX_BUFFERS_PER_Q; i++)
++ in_sbal_ptrs[offset + i] =
++ card->qdio.c_q->bufs[i].buffer;
+
+ queue_start_poll[card->qdio.no_in_queues - 1] = NULL;
+ }
+@@ -4786,10 +4786,9 @@ static int qeth_qdio_establish(struct qeth_card *card)
+ rc = -ENOMEM;
+ goto out_free_qib_param;
+ }
+- for (i = 0; i < QDIO_MAX_BUFFERS_PER_Q; ++i) {
+- in_sbal_ptrs[i] = (struct qdio_buffer *)
+- virt_to_phys(card->qdio.in_q->bufs[i].buffer);
+- }
++
++ for (i = 0; i < QDIO_MAX_BUFFERS_PER_Q; i++)
++ in_sbal_ptrs[i] = card->qdio.in_q->bufs[i].buffer;
+
+ queue_start_poll = kcalloc(card->qdio.no_in_queues, sizeof(void *),
+ GFP_KERNEL);
+@@ -4810,11 +4809,11 @@ static int qeth_qdio_establish(struct qeth_card *card)
+ rc = -ENOMEM;
+ goto out_free_queue_start_poll;
+ }
++
+ for (i = 0, k = 0; i < card->qdio.no_out_queues; ++i)
+- for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j, ++k) {
+- out_sbal_ptrs[k] = (struct qdio_buffer *)virt_to_phys(
+- card->qdio.out_qs[i]->bufs[j]->buffer);
+- }
++ for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; j++, k++)
++ out_sbal_ptrs[k] =
++ card->qdio.out_qs[i]->bufs[j]->buffer;
+
+ memset(&init_data, 0, sizeof(struct qdio_initialize));
+ init_data.cdev = CARD_DDEV(card);
+--
+2.20.1
+
--- /dev/null
+From 192cf7116e6107ff7f7e842ef1aecf8916e6ff2d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 4 Feb 2020 16:24:13 +0100
+Subject: scsi: megaraid_sas: silence a warning
+
+From: Tomas Henzl <thenzl@redhat.com>
+
+[ Upstream commit 0e99b2c625da181aebf1a3d13493e3f7a5057a9c ]
+
+Add a flag to DMA memory allocation to silence a warning.
+
+This driver allocates DMA memory for IO frames. This allocation may exceed
+MAX_ORDER pages for few megaraid_sas controllers (controllers with very
+high queue depth). Consequently, the driver has logic to keep reducing the
+controller queue depth until the DMA memory allocation succeeds.
+
+On impacted megaraid_sas controllers there would be multiple DMA allocation
+failures until driver settled on an allocation that fit. These failed DMA
+allocation requests caused stack traces in system logs. These were not
+harmful and this patch silences those warnings/stack traces.
+
+[mkp: clarified commit desc]
+
+Link: https://lore.kernel.org/r/20200204152413.7107-1-thenzl@redhat.com
+Signed-off-by: Tomas Henzl <thenzl@redhat.com>
+Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
+Reviewed-by: Lee Duncan <lduncan@suse.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/scsi/megaraid/megaraid_sas_fusion.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
+index 46bc062d873ef..d868388018053 100644
+--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
++++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
+@@ -594,7 +594,8 @@ megasas_alloc_request_fusion(struct megasas_instance *instance)
+
+ fusion->io_request_frames =
+ dma_pool_alloc(fusion->io_request_frames_pool,
+- GFP_KERNEL, &fusion->io_request_frames_phys);
++ GFP_KERNEL | __GFP_NOWARN,
++ &fusion->io_request_frames_phys);
+ if (!fusion->io_request_frames) {
+ if (instance->max_fw_cmds >= (MEGASAS_REDUCE_QD_COUNT * 2)) {
+ instance->max_fw_cmds -= MEGASAS_REDUCE_QD_COUNT;
+@@ -632,7 +633,7 @@ megasas_alloc_request_fusion(struct megasas_instance *instance)
+
+ fusion->io_request_frames =
+ dma_pool_alloc(fusion->io_request_frames_pool,
+- GFP_KERNEL,
++ GFP_KERNEL | __GFP_NOWARN,
+ &fusion->io_request_frames_phys);
+
+ if (!fusion->io_request_frames) {
+--
+2.20.1
+
--- /dev/null
+From 1da938e7a39040132d2efc71e1c3b56c15f78457 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 6 Feb 2020 09:40:52 +0100
+Subject: selftests: fix too long argument
+
+From: Jiri Benc <jbenc@redhat.com>
+
+[ Upstream commit c363eb48ada5cf732b3f489fab799fc881097842 ]
+
+With some shells, the command construed for install of bpf selftests becomes
+too large due to long list of files:
+
+make[1]: execvp: /bin/sh: Argument list too long
+make[1]: *** [../lib.mk:73: install] Error 127
+
+Currently, each of the file lists is replicated three times in the command:
+in the shell 'if' condition, in the 'echo' and in the 'rsync'. Reduce that
+by one instance by using make conditionals and separate the echo and rsync
+into two shell commands. (One would be inclined to just remove the '@' at
+the beginning of the rsync command and let 'make' echo it by itself;
+unfortunately, it appears that the '@' in the front of mkdir silences output
+also for the following commands.)
+
+Also, separate handling of each of the lists to its own shell command.
+
+The semantics of the makefile is unchanged before and after the patch. The
+ability of individual test directories to override INSTALL_RULE is retained.
+
+Reported-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
+Tested-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
+Signed-off-by: Jiri Benc <jbenc@redhat.com>
+Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/testing/selftests/lib.mk | 23 +++++++++++++----------
+ 1 file changed, 13 insertions(+), 10 deletions(-)
+
+diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
+index 1c8a1963d03f8..3ed0134a764d4 100644
+--- a/tools/testing/selftests/lib.mk
++++ b/tools/testing/selftests/lib.mk
+@@ -83,17 +83,20 @@ else
+ $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS))
+ endif
+
++define INSTALL_SINGLE_RULE
++ $(if $(INSTALL_LIST),@mkdir -p $(INSTALL_PATH))
++ $(if $(INSTALL_LIST),@echo rsync -a $(INSTALL_LIST) $(INSTALL_PATH)/)
++ $(if $(INSTALL_LIST),@rsync -a $(INSTALL_LIST) $(INSTALL_PATH)/)
++endef
++
+ define INSTALL_RULE
+- @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \
+- mkdir -p ${INSTALL_PATH}; \
+- echo "rsync -a $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/"; \
+- rsync -a $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/; \
+- fi
+- @if [ "X$(TEST_GEN_PROGS)$(TEST_CUSTOM_PROGS)$(TEST_GEN_PROGS_EXTENDED)$(TEST_GEN_FILES)" != "X" ]; then \
+- mkdir -p ${INSTALL_PATH}; \
+- echo "rsync -a $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(INSTALL_PATH)/"; \
+- rsync -a $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(INSTALL_PATH)/; \
+- fi
++ $(eval INSTALL_LIST = $(TEST_PROGS)) $(INSTALL_SINGLE_RULE)
++ $(eval INSTALL_LIST = $(TEST_PROGS_EXTENDED)) $(INSTALL_SINGLE_RULE)
++ $(eval INSTALL_LIST = $(TEST_FILES)) $(INSTALL_SINGLE_RULE)
++ $(eval INSTALL_LIST = $(TEST_GEN_PROGS)) $(INSTALL_SINGLE_RULE)
++ $(eval INSTALL_LIST = $(TEST_CUSTOM_PROGS)) $(INSTALL_SINGLE_RULE)
++ $(eval INSTALL_LIST = $(TEST_GEN_PROGS_EXTENDED)) $(INSTALL_SINGLE_RULE)
++ $(eval INSTALL_LIST = $(TEST_GEN_FILES)) $(INSTALL_SINGLE_RULE)
+ endef
+
+ install: all
+--
+2.20.1
+
--- /dev/null
+From f1a044ae5f80f6049208fe0624752c87f1828ddf Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 11 Feb 2020 15:32:56 +0800
+Subject: selftests: forwarding: use proto icmp for {gretap, ip6gretap}_mac
+ testing
+
+From: Hangbin Liu <liuhangbin@gmail.com>
+
+[ Upstream commit e8023b030ce1748930e2dc76353a262fe47d4745 ]
+
+For tc ip_proto filter, when we extract the flow via __skb_flow_dissect()
+without flag FLOW_DISSECTOR_F_STOP_AT_ENCAP, we will continue extract to
+the inner proto.
+
+So for GRE + ICMP messages, we should not track GRE proto, but inner ICMP
+proto.
+
+For test mirror_gre.sh, it may make user confused if we capture ICMP
+message on $h3(since the flow is GRE message). So I move the capture
+dev to h3-gt{4,6}, and only capture ICMP message.
+
+Before the fix:
+]# ./mirror_gre.sh
+TEST: ingress mirror to gretap (skip_hw) [ OK ]
+TEST: egress mirror to gretap (skip_hw) [ OK ]
+TEST: ingress mirror to ip6gretap (skip_hw) [ OK ]
+TEST: egress mirror to ip6gretap (skip_hw) [ OK ]
+TEST: ingress mirror to gretap: envelope MAC (skip_hw) [FAIL]
+ Expected to capture 10 packets, got 0.
+TEST: egress mirror to gretap: envelope MAC (skip_hw) [FAIL]
+ Expected to capture 10 packets, got 0.
+TEST: ingress mirror to ip6gretap: envelope MAC (skip_hw) [FAIL]
+ Expected to capture 10 packets, got 0.
+TEST: egress mirror to ip6gretap: envelope MAC (skip_hw) [FAIL]
+ Expected to capture 10 packets, got 0.
+TEST: two simultaneously configured mirrors (skip_hw) [ OK ]
+WARN: Could not test offloaded functionality
+
+After fix:
+]# ./mirror_gre.sh
+TEST: ingress mirror to gretap (skip_hw) [ OK ]
+TEST: egress mirror to gretap (skip_hw) [ OK ]
+TEST: ingress mirror to ip6gretap (skip_hw) [ OK ]
+TEST: egress mirror to ip6gretap (skip_hw) [ OK ]
+TEST: ingress mirror to gretap: envelope MAC (skip_hw) [ OK ]
+TEST: egress mirror to gretap: envelope MAC (skip_hw) [ OK ]
+TEST: ingress mirror to ip6gretap: envelope MAC (skip_hw) [ OK ]
+TEST: egress mirror to ip6gretap: envelope MAC (skip_hw) [ OK ]
+TEST: two simultaneously configured mirrors (skip_hw) [ OK ]
+WARN: Could not test offloaded functionality
+
+Fixes: ba8d39871a10 ("selftests: forwarding: Add test for mirror to gretap")
+Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
+Reviewed-by: Petr Machata <pmachata@gmail.com>
+Tested-by: Petr Machata <pmachata@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../selftests/net/forwarding/mirror_gre.sh | 25 ++++++++++---------
+ 1 file changed, 13 insertions(+), 12 deletions(-)
+
+diff --git a/tools/testing/selftests/net/forwarding/mirror_gre.sh b/tools/testing/selftests/net/forwarding/mirror_gre.sh
+index e6fd7a18c655f..0266443601bc0 100755
+--- a/tools/testing/selftests/net/forwarding/mirror_gre.sh
++++ b/tools/testing/selftests/net/forwarding/mirror_gre.sh
+@@ -63,22 +63,23 @@ test_span_gre_mac()
+ {
+ local tundev=$1; shift
+ local direction=$1; shift
+- local prot=$1; shift
+ local what=$1; shift
+
+- local swp3mac=$(mac_get $swp3)
+- local h3mac=$(mac_get $h3)
++ case "$direction" in
++ ingress) local src_mac=$(mac_get $h1); local dst_mac=$(mac_get $h2)
++ ;;
++ egress) local src_mac=$(mac_get $h2); local dst_mac=$(mac_get $h1)
++ ;;
++ esac
+
+ RET=0
+
+ mirror_install $swp1 $direction $tundev "matchall $tcflags"
+- tc filter add dev $h3 ingress pref 77 prot $prot \
+- flower ip_proto 0x2f src_mac $swp3mac dst_mac $h3mac \
+- action pass
++ icmp_capture_install h3-${tundev} "src_mac $src_mac dst_mac $dst_mac"
+
+- mirror_test v$h1 192.0.2.1 192.0.2.2 $h3 77 10
++ mirror_test v$h1 192.0.2.1 192.0.2.2 h3-${tundev} 100 10
+
+- tc filter del dev $h3 ingress pref 77
++ icmp_capture_uninstall h3-${tundev}
+ mirror_uninstall $swp1 $direction
+
+ log_test "$direction $what: envelope MAC ($tcflags)"
+@@ -120,14 +121,14 @@ test_ip6gretap()
+
+ test_gretap_mac()
+ {
+- test_span_gre_mac gt4 ingress ip "mirror to gretap"
+- test_span_gre_mac gt4 egress ip "mirror to gretap"
++ test_span_gre_mac gt4 ingress "mirror to gretap"
++ test_span_gre_mac gt4 egress "mirror to gretap"
+ }
+
+ test_ip6gretap_mac()
+ {
+- test_span_gre_mac gt6 ingress ipv6 "mirror to ip6gretap"
+- test_span_gre_mac gt6 egress ipv6 "mirror to ip6gretap"
++ test_span_gre_mac gt6 ingress "mirror to ip6gretap"
++ test_span_gre_mac gt6 egress "mirror to ip6gretap"
+ }
+
+ test_all()
+--
+2.20.1
+
--- /dev/null
+From d4b9d5e126355f45e3bc7d079ea8cd74f036a3d0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 13 Feb 2020 17:40:54 +0800
+Subject: selftests: forwarding: vxlan_bridge_1d: fix tos value
+
+From: Hangbin Liu <liuhangbin@gmail.com>
+
+[ Upstream commit 4e867c9a50ff1a07ed0b86c3b1c8bc773933d728 ]
+
+After commit 71130f29979c ("vxlan: fix tos value before xmit") we start
+strict vxlan xmit tos value by RT_TOS(), which limits the tos value less
+than 0x1E. With current value 0x40 the test will failed with "v1: Expected
+to capture 10 packets, got 0". So let's choose a smaller tos value for
+testing.
+
+Fixes: d417ecf533fe ("selftests: forwarding: vxlan_bridge_1d: Add a TOS test")
+Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
+index bb10e33690b25..353613fc19475 100755
+--- a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
++++ b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
+@@ -516,9 +516,9 @@ test_tos()
+ RET=0
+
+ tc filter add dev v1 egress pref 77 prot ip \
+- flower ip_tos 0x40 action pass
+- vxlan_ping_test $h1 192.0.2.3 "-Q 0x40" v1 egress 77 10
+- vxlan_ping_test $h1 192.0.2.3 "-Q 0x30" v1 egress 77 0
++ flower ip_tos 0x11 action pass
++ vxlan_ping_test $h1 192.0.2.3 "-Q 0x11" v1 egress 77 10
++ vxlan_ping_test $h1 192.0.2.3 "-Q 0x12" v1 egress 77 0
+ tc filter del dev v1 egress pref 77 prot ip
+
+ log_test "VXLAN: envelope TOS inheritance"
+--
+2.20.1
+
--- /dev/null
+From a62dc5e4ab9d4db1ac983d20f02f67a14d5ebf4c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 17 Feb 2020 11:43:15 +0800
+Subject: selftests: forwarding: vxlan_bridge_1d: use more proper tos value
+
+From: Hangbin Liu <liuhangbin@gmail.com>
+
+[ Upstream commit 9b64208f74fbd0e920475ecfe9326f8443fdc3a5 ]
+
+0x11 and 0x12 set the ECN bits based on RFC2474, it would be better to avoid
+that. 0x14 and 0x18 would be better and works as well.
+
+Reported-by: Petr Machata <petrm@mellanox.com>
+Fixes: 4e867c9a50ff ("selftests: forwarding: vxlan_bridge_1d: fix tos value")
+Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
+index 353613fc19475..ce6bea9675c07 100755
+--- a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
++++ b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
+@@ -516,9 +516,9 @@ test_tos()
+ RET=0
+
+ tc filter add dev v1 egress pref 77 prot ip \
+- flower ip_tos 0x11 action pass
+- vxlan_ping_test $h1 192.0.2.3 "-Q 0x11" v1 egress 77 10
+- vxlan_ping_test $h1 192.0.2.3 "-Q 0x12" v1 egress 77 0
++ flower ip_tos 0x14 action pass
++ vxlan_ping_test $h1 192.0.2.3 "-Q 0x14" v1 egress 77 10
++ vxlan_ping_test $h1 192.0.2.3 "-Q 0x18" v1 egress 77 0
+ tc filter del dev v1 egress pref 77 prot ip
+
+ log_test "VXLAN: envelope TOS inheritance"
+--
+2.20.1
+
--- /dev/null
+From 2be8d8db169ee023e37fa0e06d82cd19fba5eca8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 7 Feb 2020 11:53:35 +0200
+Subject: serial: ar933x_uart: set UART_CS_{RX,TX}_READY_ORIDE
+
+From: Daniel Golle <daniel@makrotopia.org>
+
+[ Upstream commit 87c5cbf71ecbb9e289d60a2df22eb686c70bf196 ]
+
+On AR934x this UART is usually not initialized by the bootloader
+as it is only used as a secondary serial port while the primary
+UART is a newly introduced NS16550-compatible.
+In order to make use of the ar933x-uart on AR934x without RTS/CTS
+hardware flow control, one needs to set the
+UART_CS_{RX,TX}_READY_ORIDE bits as other than on AR933x where this
+UART is used as primary/console, the bootloader on AR934x typically
+doesn't set those bits.
+Setting them explicitely on AR933x should not do any harm, so just
+set them unconditionally.
+
+Tested-by: Chuanhong Guo <gch981213@gmail.com>
+Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+Link: https://lore.kernel.org/r/20200207095335.GA179836@makrotopia.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/tty/serial/ar933x_uart.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
+index 3bdd56a1021b2..ea12f10610b64 100644
+--- a/drivers/tty/serial/ar933x_uart.c
++++ b/drivers/tty/serial/ar933x_uart.c
+@@ -286,6 +286,10 @@ static void ar933x_uart_set_termios(struct uart_port *port,
+ ar933x_uart_rmw_set(up, AR933X_UART_CS_REG,
+ AR933X_UART_CS_HOST_INT_EN);
+
++ /* enable RX and TX ready overide */
++ ar933x_uart_rmw_set(up, AR933X_UART_CS_REG,
++ AR933X_UART_CS_TX_READY_ORIDE | AR933X_UART_CS_RX_READY_ORIDE);
++
+ /* reenable the UART */
+ ar933x_uart_rmw(up, AR933X_UART_CS_REG,
+ AR933X_UART_CS_IF_MODE_M << AR933X_UART_CS_IF_MODE_S,
+@@ -418,6 +422,10 @@ static int ar933x_uart_startup(struct uart_port *port)
+ ar933x_uart_rmw_set(up, AR933X_UART_CS_REG,
+ AR933X_UART_CS_HOST_INT_EN);
+
++ /* enable RX and TX ready overide */
++ ar933x_uart_rmw_set(up, AR933X_UART_CS_REG,
++ AR933X_UART_CS_TX_READY_ORIDE | AR933X_UART_CS_RX_READY_ORIDE);
++
+ /* Enable RX interrupts */
+ up->ier = AR933X_UART_INT_RX_VALID;
+ ar933x_uart_write(up, AR933X_UART_INT_EN_REG, up->ier);
+--
+2.20.1
+
blktrace-fix-dereference-after-null-check.patch
netfilter-hashlimit-do-not-use-indirect-calls-during.patch
netfilter-xt_hashlimit-unregister-proc-file-before-r.patch
+alsa-hda-do-not-override-bus-codec_mask-in-link_get.patch
+serial-ar933x_uart-set-uart_cs_-rx-tx-_ready_oride.patch
+kernel-selftests-tpm2-check-for-tpm-support.patch
+selftests-fix-too-long-argument.patch
+usb-gadget-composite-support-more-than-500ma-maxpowe.patch
+usb-gadget-ffs-ffs_aio_cancel-save-restore-irq-flags.patch
+usb-gadget-serial-fix-tx-stall-after-buffer-overflow.patch
+habanalabs-halt-the-engines-before-hard-reset.patch
+habanalabs-do-not-halt-coresight-during-hard-reset.patch
+habanalabs-patched-cb-equals-user-cb-in-device-memse.patch
+drm-msm-mdp5-rate-limit-pp-done-timeout-warnings.patch
+drm-msm-fix-return-type-of-dsi_mgr_connector_mode_va.patch
+drm-modes-make-sure-to-parse-valid-rotation-value-fr.patch
+drm-modes-allow-drm_mode_rotate_0-when-applying-vide.patch
+scsi-megaraid_sas-silence-a-warning.patch
+drm-msm-dsi-save-pll-state-before-dsi-host-is-powere.patch
+drm-msm-dsi-pll-call-vco-set-rate-explicitly.patch
+selftests-forwarding-use-proto-icmp-for-gretap-ip6gr.patch
+selftests-forwarding-vxlan_bridge_1d-fix-tos-value.patch
+net-atlantic-check-rpc-result-and-wait-for-rpc-addre.patch
+net-atlantic-ptp-gpio-adjustments.patch
+net-ks8851-ml-remove-8-bit-bus-accessors.patch
+net-ks8851-ml-fix-16-bit-data-access.patch
+net-ks8851-ml-fix-16-bit-io-operation.patch
+net-ethernet-dm9000-handle-eprobe_defer-in-dm9000_pa.patch
+watchdog-da9062-do-not-ping-the-hw-during-stop.patch
+s390-cio-cio_ignore_proc_seq_next-should-increase-po.patch
+s390-make-install-not-depend-on-vmlinux.patch
+efi-only-print-errors-about-failing-to-get-certs-if-.patch
+net-mlx5-dr-fix-matching-on-vport-gvmi.patch
+iommu-amd-disable-iommu-on-stoney-ridge-systems.patch
+nvme-pci-add-sleep-quirk-for-samsung-and-toshiba-dri.patch
+nvme-pci-use-single-irq-vector-for-old-apple-models.patch
+x86-boot-compressed-don-t-declare-__force_order-in-k.patch
+s390-qdio-fill-sl-with-absolute-addresses.patch
+nvme-fix-uninitialized-variable-warning.patch
+ice-don-t-tell-the-os-that-link-is-going-down.patch
+x86-xen-distribute-switch-variables-for-initializati.patch
+net-thunderx-workaround-bgx-tx-underflow-issue.patch
+csky-mm-fixup-export-invalid_pte_table-symbol.patch
+csky-set-regs-usp-to-kernel-sp-when-the-exception-is.patch
+csky-smp-fixup-boot-failed-when-config_smp.patch
+csky-fixup-ftrace-modify-panic.patch
+csky-fixup-compile-warning-for-three-unimplemented-s.patch
+arch-csky-fix-some-kconfig-typos.patch
+selftests-forwarding-vxlan_bridge_1d-use-more-proper.patch
--- /dev/null
+From f013f2facbbfaac10b5b792a3c28df009aa8388b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 30 Jan 2020 19:10:36 -0800
+Subject: usb: gadget: composite: Support more than 500mA MaxPower
+
+From: Jack Pham <jackp@codeaurora.org>
+
+[ Upstream commit a2035411fa1d1206cea7d5dfe833e78481844a76 ]
+
+USB 3.x SuperSpeed peripherals can draw up to 900mA of VBUS power
+when in configured state. However, if a configuration wanting to
+take advantage of this is added with MaxPower greater than 500
+(currently possible if using a ConfigFS gadget) the composite
+driver fails to accommodate this for a couple reasons:
+
+ - usb_gadget_vbus_draw() when called from set_config() and
+ composite_resume() will be passed the MaxPower value without
+ regard for the current connection speed, resulting in a
+ violation for USB 2.0 since the max is 500mA.
+
+ - the bMaxPower of the configuration descriptor would be
+ incorrectly encoded, again if the connection speed is only
+ at USB 2.0 or below, likely wrapping around U8_MAX since
+ the 2mA multiplier corresponds to a maximum of 510mA.
+
+Fix these by adding checks against the current gadget->speed
+when the c->MaxPower value is used (set_config() and
+composite_resume()) and appropriately limit based on whether
+it is currently at a low-/full-/high- or super-speed connection.
+
+Because 900 is not divisible by 8, with the round-up division
+currently used in encode_bMaxPower() a MaxPower of 900mA will
+result in an encoded value of 0x71. When a host stack (including
+Linux and Windows) enumerates this on a single port root hub, it
+reads this value back and decodes (multiplies by 8) to get 904mA
+which is strictly greater than 900mA that is typically budgeted
+for that port, causing it to reject the configuration. Instead,
+we should be using the round-down behavior of normal integral
+division so that 900 / 8 -> 0x70 or 896mA to stay within range.
+And we might as well change it for the high/full/low case as well
+for consistency.
+
+N.B. USB 3.2 Gen N x 2 allows for up to 1500mA but there doesn't
+seem to be any any peripheral controller supported by Linux that
+does two lane operation, so for now keeping the clamp at 900
+should be fine.
+
+Signed-off-by: Jack Pham <jackp@codeaurora.org>
+Signed-off-by: Felipe Balbi <balbi@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/usb/gadget/composite.c | 24 ++++++++++++++++++------
+ 1 file changed, 18 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
+index cd303a3ea6802..223f72d4d9edd 100644
+--- a/drivers/usb/gadget/composite.c
++++ b/drivers/usb/gadget/composite.c
+@@ -438,9 +438,13 @@ static u8 encode_bMaxPower(enum usb_device_speed speed,
+ if (!val)
+ return 0;
+ if (speed < USB_SPEED_SUPER)
+- return DIV_ROUND_UP(val, 2);
++ return min(val, 500U) / 2;
+ else
+- return DIV_ROUND_UP(val, 8);
++ /*
++ * USB 3.x supports up to 900mA, but since 900 isn't divisible
++ * by 8 the integral division will effectively cap to 896mA.
++ */
++ return min(val, 900U) / 8;
+ }
+
+ static int config_buf(struct usb_configuration *config,
+@@ -852,6 +856,10 @@ static int set_config(struct usb_composite_dev *cdev,
+
+ /* when we return, be sure our power usage is valid */
+ power = c->MaxPower ? c->MaxPower : CONFIG_USB_GADGET_VBUS_DRAW;
++ if (gadget->speed < USB_SPEED_SUPER)
++ power = min(power, 500U);
++ else
++ power = min(power, 900U);
+ done:
+ usb_gadget_vbus_draw(gadget, power);
+ if (result >= 0 && cdev->delayed_status)
+@@ -2278,7 +2286,7 @@ void composite_resume(struct usb_gadget *gadget)
+ {
+ struct usb_composite_dev *cdev = get_gadget_data(gadget);
+ struct usb_function *f;
+- u16 maxpower;
++ unsigned maxpower;
+
+ /* REVISIT: should we have config level
+ * suspend/resume callbacks?
+@@ -2292,10 +2300,14 @@ void composite_resume(struct usb_gadget *gadget)
+ f->resume(f);
+ }
+
+- maxpower = cdev->config->MaxPower;
++ maxpower = cdev->config->MaxPower ?
++ cdev->config->MaxPower : CONFIG_USB_GADGET_VBUS_DRAW;
++ if (gadget->speed < USB_SPEED_SUPER)
++ maxpower = min(maxpower, 500U);
++ else
++ maxpower = min(maxpower, 900U);
+
+- usb_gadget_vbus_draw(gadget, maxpower ?
+- maxpower : CONFIG_USB_GADGET_VBUS_DRAW);
++ usb_gadget_vbus_draw(gadget, maxpower);
+ }
+
+ cdev->suspended = 0;
+--
+2.20.1
+
--- /dev/null
+From 720dfb0f1319c058feb31f05cae3b3d15c1d489c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 16 Jan 2020 15:29:01 +0200
+Subject: usb: gadget: ffs: ffs_aio_cancel(): Save/restore IRQ flags
+
+From: Lars-Peter Clausen <lars@metafoo.de>
+
+[ Upstream commit 43d565727a3a6fd24e37c7c2116475106af71806 ]
+
+ffs_aio_cancel() can be called from both interrupt and thread context. Make
+sure that the current IRQ state is saved and restored by using
+spin_{un,}lock_irq{save,restore}().
+
+Otherwise undefined behavior might occur.
+
+Acked-by: Michal Nazarewicz <mina86@mina86.com>
+Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
+Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
+Signed-off-by: Felipe Balbi <balbi@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/usb/gadget/function/f_fs.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
+index 6f8b67e617716..bdac92d3a8d0c 100644
+--- a/drivers/usb/gadget/function/f_fs.c
++++ b/drivers/usb/gadget/function/f_fs.c
+@@ -1162,18 +1162,19 @@ static int ffs_aio_cancel(struct kiocb *kiocb)
+ {
+ struct ffs_io_data *io_data = kiocb->private;
+ struct ffs_epfile *epfile = kiocb->ki_filp->private_data;
++ unsigned long flags;
+ int value;
+
+ ENTER();
+
+- spin_lock_irq(&epfile->ffs->eps_lock);
++ spin_lock_irqsave(&epfile->ffs->eps_lock, flags);
+
+ if (likely(io_data && io_data->ep && io_data->req))
+ value = usb_ep_dequeue(io_data->ep, io_data->req);
+ else
+ value = -EINVAL;
+
+- spin_unlock_irq(&epfile->ffs->eps_lock);
++ spin_unlock_irqrestore(&epfile->ffs->eps_lock, flags);
+
+ return value;
+ }
+--
+2.20.1
+
--- /dev/null
+From c79a6cbc5666b936cdde44951d509959e4818048 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 29 Jan 2020 14:21:46 +0300
+Subject: usb: gadget: serial: fix Tx stall after buffer overflow
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Sergey Organov <sorganov@gmail.com>
+
+[ Upstream commit e4bfded56cf39b8d02733c1e6ef546b97961e18a ]
+
+Symptom: application opens /dev/ttyGS0 and starts sending (writing) to
+it while either USB cable is not connected, or nobody listens on the
+other side of the cable. If driver circular buffer overflows before
+connection is established, no data will be written to the USB layer
+until/unless /dev/ttyGS0 is closed and re-opened again by the
+application (the latter besides having no means of being notified about
+the event of establishing of the connection.)
+
+Fix: on open and/or connect, kick Tx to flush circular buffer data to
+USB layer.
+
+Signed-off-by: Sergey Organov <sorganov@gmail.com>
+Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
+Signed-off-by: Felipe Balbi <balbi@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/usb/gadget/function/u_serial.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c
+index f986e5c559748..8167d379e115b 100644
+--- a/drivers/usb/gadget/function/u_serial.c
++++ b/drivers/usb/gadget/function/u_serial.c
+@@ -561,8 +561,10 @@ static int gs_start_io(struct gs_port *port)
+ port->n_read = 0;
+ started = gs_start_rx(port);
+
+- /* unblock any pending writes into our circular buffer */
+ if (started) {
++ gs_start_tx(port);
++ /* Unblock any pending writes into our circular buffer, in case
++ * we didn't in gs_start_tx() */
+ tty_wakeup(port->port.tty);
+ } else {
+ gs_free_requests(ep, head, &port->read_allocated);
+--
+2.20.1
+
--- /dev/null
+From 9dacf964213ef04ee2497e639efe60b76c27f119 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 20 Jan 2020 10:17:29 +0100
+Subject: watchdog: da9062: do not ping the hw during stop()
+
+From: Marco Felsch <m.felsch@pengutronix.de>
+
+[ Upstream commit e9a0e65eda3f78d0b04ec6136c591c000cbc3b76 ]
+
+The da9062 hw has a minimum ping cool down phase of at least 200ms. The
+driver takes that into account by setting the min_hw_heartbeat_ms to
+300ms and the core guarantees that the hw limit is observed for the
+ping() calls. But the core can't guarantee the required minimum ping
+cool down phase if a stop() command is send immediately after the ping()
+command. So it is not allowed to ping the watchdog within the stop()
+command as the driver does. Remove the ping can be done without doubts
+because the watchdog gets disabled anyway and a (re)start resets the
+watchdog counter too.
+
+Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
+Reviewed-by: Guenter Roeck <linux@roeck-us.net>
+Link: https://lore.kernel.org/r/20200120091729.16256-1-m.felsch@pengutronix.de
+[groeck: Updated description]
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/watchdog/da9062_wdt.c | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/drivers/watchdog/da9062_wdt.c b/drivers/watchdog/da9062_wdt.c
+index e149e66a6ea9f..e92f38fcb7a4a 100644
+--- a/drivers/watchdog/da9062_wdt.c
++++ b/drivers/watchdog/da9062_wdt.c
+@@ -94,13 +94,6 @@ static int da9062_wdt_stop(struct watchdog_device *wdd)
+ struct da9062_watchdog *wdt = watchdog_get_drvdata(wdd);
+ int ret;
+
+- ret = da9062_reset_watchdog_timer(wdt);
+- if (ret) {
+- dev_err(wdt->hw->dev, "Failed to ping the watchdog (err = %d)\n",
+- ret);
+- return ret;
+- }
+-
+ ret = regmap_update_bits(wdt->hw->regmap,
+ DA9062AA_CONTROL_D,
+ DA9062AA_TWDSCALE_MASK,
+--
+2.20.1
+
--- /dev/null
+From ca20cadeb993a02b9052be603108d670e8a6013e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 16 Jan 2020 12:46:51 -0800
+Subject: x86/boot/compressed: Don't declare __force_order in kaslr_64.c
+
+From: H.J. Lu <hjl.tools@gmail.com>
+
+[ Upstream commit df6d4f9db79c1a5d6f48b59db35ccd1e9ff9adfc ]
+
+GCC 10 changed the default to -fno-common, which leads to
+
+ LD arch/x86/boot/compressed/vmlinux
+ ld: arch/x86/boot/compressed/pgtable_64.o:(.bss+0x0): multiple definition of `__force_order'; \
+ arch/x86/boot/compressed/kaslr_64.o:(.bss+0x0): first defined here
+ make[2]: *** [arch/x86/boot/compressed/Makefile:119: arch/x86/boot/compressed/vmlinux] Error 1
+
+Since __force_order is already provided in pgtable_64.c, there is no
+need to declare __force_order in kaslr_64.c.
+
+Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Link: https://lkml.kernel.org/r/20200124181811.4780-1-hjl.tools@gmail.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/x86/boot/compressed/kaslr_64.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/arch/x86/boot/compressed/kaslr_64.c b/arch/x86/boot/compressed/kaslr_64.c
+index 748456c365f46..9557c5a15b91e 100644
+--- a/arch/x86/boot/compressed/kaslr_64.c
++++ b/arch/x86/boot/compressed/kaslr_64.c
+@@ -29,9 +29,6 @@
+ #define __PAGE_OFFSET __PAGE_OFFSET_BASE
+ #include "../../mm/ident_map.c"
+
+-/* Used by pgtable.h asm code to force instruction serialization. */
+-unsigned long __force_order;
+-
+ /* Used to track our page table allocation area. */
+ struct alloc_pgt_data {
+ unsigned char *pgt_buf;
+--
+2.20.1
+
--- /dev/null
+From 51c943d23284d10da937addf742f0a1f0a12bb6d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 19 Feb 2020 22:23:18 -0800
+Subject: x86/xen: Distribute switch variables for initialization
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Kees Cook <keescook@chromium.org>
+
+[ Upstream commit 9038ec99ceb94fb8d93ade5e236b2928f0792c7c ]
+
+Variables declared in a switch statement before any case statements
+cannot be automatically initialized with compiler instrumentation (as
+they are not part of any execution flow). With GCC's proposed automatic
+stack variable initialization feature, this triggers a warning (and they
+don't get initialized). Clang's automatic stack variable initialization
+(via CONFIG_INIT_STACK_ALL=y) doesn't throw a warning, but it also
+doesn't initialize such variables[1]. Note that these warnings (or silent
+skipping) happen before the dead-store elimination optimization phase,
+so even when the automatic initializations are later elided in favor of
+direct initializations, the warnings remain.
+
+To avoid these problems, move such variables into the "case" where
+they're used or lift them up into the main function body.
+
+arch/x86/xen/enlighten_pv.c: In function ‘xen_write_msr_safe’:
+arch/x86/xen/enlighten_pv.c:904:12: warning: statement will never be executed [-Wswitch-unreachable]
+ 904 | unsigned which;
+ | ^~~~~
+
+[1] https://bugs.llvm.org/show_bug.cgi?id=44916
+
+Signed-off-by: Kees Cook <keescook@chromium.org>
+Link: https://lore.kernel.org/r/20200220062318.69299-1-keescook@chromium.org
+Reviewed-by: Juergen Gross <jgross@suse.com>
+[boris: made @which an 'unsigned int']
+Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/x86/xen/enlighten_pv.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
+index 1f756ffffe8b3..79409120a6036 100644
+--- a/arch/x86/xen/enlighten_pv.c
++++ b/arch/x86/xen/enlighten_pv.c
+@@ -896,14 +896,15 @@ static u64 xen_read_msr_safe(unsigned int msr, int *err)
+ static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)
+ {
+ int ret;
++#ifdef CONFIG_X86_64
++ unsigned int which;
++ u64 base;
++#endif
+
+ ret = 0;
+
+ switch (msr) {
+ #ifdef CONFIG_X86_64
+- unsigned which;
+- u64 base;
+-
+ case MSR_FS_BASE: which = SEGBASE_FS; goto set;
+ case MSR_KERNEL_GS_BASE: which = SEGBASE_GS_USER; goto set;
+ case MSR_GS_BASE: which = SEGBASE_GS_KERNEL; goto set;
+--
+2.20.1
+