]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
patches for 4.9
authorSasha Levin <sashal@kernel.org>
Wed, 28 Nov 2018 16:13:05 +0000 (11:13 -0500)
committerSasha Levin <sashal@kernel.org>
Wed, 28 Nov 2018 16:13:05 +0000 (11:13 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
18 files changed:
queue-4.9/arm-make-lookup_processor_type-non-__init.patch [new file with mode: 0644]
queue-4.9/arm64-remove-no-op-p-linker-flag.patch [new file with mode: 0644]
queue-4.9/cpufreq-imx6q-add-return-value-check-for-voltage-sca.patch [new file with mode: 0644]
queue-4.9/efi-arm-revert-deferred-unmap-of-early-memmap-mappin.patch [new file with mode: 0644]
queue-4.9/floppy-fix-race-condition-in-__floppy_read_block_0.patch [new file with mode: 0644]
queue-4.9/kdb-use-strscpy-with-destination-buffer-size.patch [new file with mode: 0644]
queue-4.9/kvm-ppc-move-and-undef-trace_include_path-file.patch [new file with mode: 0644]
queue-4.9/net-bcmgenet-fix-of-child-node-lookup.patch [new file with mode: 0644]
queue-4.9/nfc-nfcmrvl_uart-fix-of-child-node-lookup.patch [new file with mode: 0644]
queue-4.9/of-add-helper-to-lookup-compatible-child-node.patch [new file with mode: 0644]
queue-4.9/perf-x86-intel-uncore-add-more-imc-pci-ids-for-kabyl.patch [new file with mode: 0644]
queue-4.9/pinctrl-meson-fix-pinconf-bias-disable.patch [new file with mode: 0644]
queue-4.9/powerpc-io-fix-the-io-workarounds-code-to-work-with-.patch [new file with mode: 0644]
queue-4.9/powerpc-numa-suppress-vphn-is-not-supported-messages.patch [new file with mode: 0644]
queue-4.9/rtc-pcf2127-fix-a-kmemleak-caused-in-pcf2127_i2c_gat.patch [new file with mode: 0644]
queue-4.9/series
queue-4.9/sunrpc-fix-a-bogus-get-put-in-generic_key_to_expire.patch [new file with mode: 0644]
queue-4.9/tmpfs-make-lseek-seek_data-sek_hole-return-enxio-wit.patch [new file with mode: 0644]

diff --git a/queue-4.9/arm-make-lookup_processor_type-non-__init.patch b/queue-4.9/arm-make-lookup_processor_type-non-__init.patch
new file mode 100644 (file)
index 0000000..fe89923
--- /dev/null
@@ -0,0 +1,44 @@
+From 7fa12a256d950bc6306cfffa57091b719ad73a2a Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel@armlinux.org.uk>
+Date: Thu, 19 Jul 2018 11:42:36 +0100
+Subject: ARM: make lookup_processor_type() non-__init
+
+[ Upstream commit 899a42f836678a595f7d2bc36a5a0c2b03d08cbc ]
+
+Move lookup_processor_type() out of the __init section so it is callable
+from (eg) the secondary startup code during hotplug.
+
+Reviewed-by: Julien Thierry <julien.thierry@arm.com>
+Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm/kernel/head-common.S | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
+index 8733012d231f..7e662bdd5cb3 100644
+--- a/arch/arm/kernel/head-common.S
++++ b/arch/arm/kernel/head-common.S
+@@ -122,6 +122,9 @@ __mmap_switched_data:
+       .long   init_thread_union + THREAD_START_SP @ sp
+       .size   __mmap_switched_data, . - __mmap_switched_data
++      __FINIT
++      .text
++
+ /*
+  * This provides a C-API version of __lookup_processor_type
+  */
+@@ -133,9 +136,6 @@ ENTRY(lookup_processor_type)
+       ldmfd   sp!, {r4 - r6, r9, pc}
+ ENDPROC(lookup_processor_type)
+-      __FINIT
+-      .text
+-
+ /*
+  * Read processor ID register (CP#15, CR0), and look up in the linker-built
+  * supported processor list.  Note that we can't use the absolute addresses
+-- 
+2.17.1
+
diff --git a/queue-4.9/arm64-remove-no-op-p-linker-flag.patch b/queue-4.9/arm64-remove-no-op-p-linker-flag.patch
new file mode 100644 (file)
index 0000000..13f9714
--- /dev/null
@@ -0,0 +1,50 @@
+From 34b8b0efb5cde04edd29a6f225b5af1b36063150 Mon Sep 17 00:00:00 2001
+From: Greg Hackmann <ghackmann@android.com>
+Date: Tue, 27 Nov 2018 11:15:20 -0800
+Subject: arm64: remove no-op -p linker flag
+
+(commit 1a381d4a0a9a0f999a13faaba22bf6b3fc80dcb9 upstream)
+
+Linking the ARM64 defconfig kernel with LLVM lld fails with the error:
+
+  ld.lld: error: unknown argument: -p
+  Makefile:1015: recipe for target 'vmlinux' failed
+
+Without this flag, the ARM64 defconfig kernel successfully links with
+lld and boots on Dragonboard 410c.
+
+After digging through binutils source and changelogs, it turns out that
+-p is only relevant to ancient binutils installations targeting 32-bit
+ARM.  binutils accepts -p for AArch64 too, but it's always been
+undocumented and silently ignored.  A comment in
+ld/emultempl/aarch64elf.em explains that it's "Only here for backwards
+compatibility".
+
+Since this flag is a no-op on ARM64, we can safely drop it.
+
+Acked-by: Will Deacon <will.deacon@arm.com>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Greg Hackmann <ghackmann@google.com>
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm64/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
+index 92110c2c6c59..ee94597773fa 100644
+--- a/arch/arm64/Makefile
++++ b/arch/arm64/Makefile
+@@ -10,7 +10,7 @@
+ #
+ # Copyright (C) 1995-2001 by Russell King
+-LDFLAGS_vmlinux       :=-p --no-undefined -X
++LDFLAGS_vmlinux       :=--no-undefined -X
+ CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)
+ GZFLAGS               :=-9
+-- 
+2.17.1
+
diff --git a/queue-4.9/cpufreq-imx6q-add-return-value-check-for-voltage-sca.patch b/queue-4.9/cpufreq-imx6q-add-return-value-check-for-voltage-sca.patch
new file mode 100644 (file)
index 0000000..c441d1b
--- /dev/null
@@ -0,0 +1,40 @@
+From 63b3f0e0b250f69eadb92e61226e3e47efa9e813 Mon Sep 17 00:00:00 2001
+From: Anson Huang <anson.huang@nxp.com>
+Date: Mon, 5 Nov 2018 00:59:28 +0000
+Subject: cpufreq: imx6q: add return value check for voltage scale
+
+[ Upstream commit 6ef28a04d1ccf718eee069b72132ce4aa1e52ab9 ]
+
+Add return value check for voltage scale when ARM clock
+rate change fail.
+
+Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
+Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/cpufreq/imx6q-cpufreq.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
+index ef1fa8145419..fa86946d12aa 100644
+--- a/drivers/cpufreq/imx6q-cpufreq.c
++++ b/drivers/cpufreq/imx6q-cpufreq.c
+@@ -130,8 +130,13 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index)
+       /* Ensure the arm clock divider is what we expect */
+       ret = clk_set_rate(arm_clk, new_freq * 1000);
+       if (ret) {
++              int ret1;
++
+               dev_err(cpu_dev, "failed to set clock rate: %d\n", ret);
+-              regulator_set_voltage_tol(arm_reg, volt_old, 0);
++              ret1 = regulator_set_voltage_tol(arm_reg, volt_old, 0);
++              if (ret1)
++                      dev_warn(cpu_dev,
++                               "failed to restore vddarm voltage: %d\n", ret1);
+               return ret;
+       }
+-- 
+2.17.1
+
diff --git a/queue-4.9/efi-arm-revert-deferred-unmap-of-early-memmap-mappin.patch b/queue-4.9/efi-arm-revert-deferred-unmap-of-early-memmap-mappin.patch
new file mode 100644 (file)
index 0000000..842cf93
--- /dev/null
@@ -0,0 +1,81 @@
+From 71fb22c36636f76d3b78dedd228f9d0f1c1206a7 Mon Sep 17 00:00:00 2001
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Date: Wed, 14 Nov 2018 09:55:41 -0800
+Subject: efi/arm: Revert deferred unmap of early memmap mapping
+
+[ Upstream commit 33412b8673135b18ea42beb7f5117ed0091798b6 ]
+
+Commit:
+
+  3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory map longer for BGRT")
+
+deferred the unmap of the early mapping of the UEFI memory map to
+accommodate the ACPI BGRT code, which looks up the memory type that
+backs the BGRT table to validate it against the requirements of the UEFI spec.
+
+Unfortunately, this causes problems on ARM, which does not permit
+early mappings to persist after paging_init() is called, resulting
+in a WARN() splat. Since we don't support the BGRT table on ARM anway,
+let's revert ARM to the old behaviour, which is to take down the
+early mapping at the end of efi_init().
+
+Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: linux-efi@vger.kernel.org
+Fixes: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory ...")
+Link: http://lkml.kernel.org/r/20181114175544.12860-3-ard.biesheuvel@linaro.org
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/firmware/efi/arm-init.c    | 4 ++++
+ drivers/firmware/efi/arm-runtime.c | 2 +-
+ drivers/firmware/efi/memmap.c      | 3 +++
+ 3 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
+index 1d1c9693ebfb..8ee91777abce 100644
+--- a/drivers/firmware/efi/arm-init.c
++++ b/drivers/firmware/efi/arm-init.c
+@@ -256,6 +256,10 @@ void __init efi_init(void)
+                                   (params.mmap & ~PAGE_MASK)));
+       init_screen_info();
++
++      /* ARM does not permit early mappings to persist across paging_init() */
++      if (IS_ENABLED(CONFIG_ARM))
++              efi_memmap_unmap();
+ }
+ static int __init register_gop_device(void)
+diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
+index 4d788e0debfe..069c5a4479e6 100644
+--- a/drivers/firmware/efi/arm-runtime.c
++++ b/drivers/firmware/efi/arm-runtime.c
+@@ -118,7 +118,7 @@ static int __init arm_enable_runtime_services(void)
+ {
+       u64 mapsize;
+-      if (!efi_enabled(EFI_BOOT) || !efi_enabled(EFI_MEMMAP)) {
++      if (!efi_enabled(EFI_BOOT)) {
+               pr_info("EFI services will not be available.\n");
+               return 0;
+       }
+diff --git a/drivers/firmware/efi/memmap.c b/drivers/firmware/efi/memmap.c
+index 78686443cb37..3fd2b450c649 100644
+--- a/drivers/firmware/efi/memmap.c
++++ b/drivers/firmware/efi/memmap.c
+@@ -117,6 +117,9 @@ int __init efi_memmap_init_early(struct efi_memory_map_data *data)
+ void __init efi_memmap_unmap(void)
+ {
++      if (!efi_enabled(EFI_MEMMAP))
++              return;
++
+       if (!efi.memmap.late) {
+               unsigned long size;
+-- 
+2.17.1
+
diff --git a/queue-4.9/floppy-fix-race-condition-in-__floppy_read_block_0.patch b/queue-4.9/floppy-fix-race-condition-in-__floppy_read_block_0.patch
new file mode 100644 (file)
index 0000000..737bbde
--- /dev/null
@@ -0,0 +1,79 @@
+From a5b7da23cb0e53a4b5593adf6a075b3092bce516 Mon Sep 17 00:00:00 2001
+From: Jens Axboe <axboe@kernel.dk>
+Date: Fri, 9 Nov 2018 15:58:40 -0700
+Subject: floppy: fix race condition in __floppy_read_block_0()
+
+[ Upstream commit de7b75d82f70c5469675b99ad632983c50b6f7e7 ]
+
+LKP recently reported a hang at bootup in the floppy code:
+
+[  245.678853] INFO: task mount:580 blocked for more than 120 seconds.
+[  245.679906]       Tainted: G                T 4.19.0-rc6-00172-ga9f38e1 #1
+[  245.680959] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
+[  245.682181] mount           D 6372   580      1 0x00000004
+[  245.683023] Call Trace:
+[  245.683425]  __schedule+0x2df/0x570
+[  245.683975]  schedule+0x2d/0x80
+[  245.684476]  schedule_timeout+0x19d/0x330
+[  245.685090]  ? wait_for_common+0xa5/0x170
+[  245.685735]  wait_for_common+0xac/0x170
+[  245.686339]  ? do_sched_yield+0x90/0x90
+[  245.686935]  wait_for_completion+0x12/0x20
+[  245.687571]  __floppy_read_block_0+0xfb/0x150
+[  245.688244]  ? floppy_resume+0x40/0x40
+[  245.688844]  floppy_revalidate+0x20f/0x240
+[  245.689486]  check_disk_change+0x43/0x60
+[  245.690087]  floppy_open+0x1ea/0x360
+[  245.690653]  __blkdev_get+0xb4/0x4d0
+[  245.691212]  ? blkdev_get+0x1db/0x370
+[  245.691777]  blkdev_get+0x1f3/0x370
+[  245.692351]  ? path_put+0x15/0x20
+[  245.692871]  ? lookup_bdev+0x4b/0x90
+[  245.693539]  blkdev_get_by_path+0x3d/0x80
+[  245.694165]  mount_bdev+0x2a/0x190
+[  245.694695]  squashfs_mount+0x10/0x20
+[  245.695271]  ? squashfs_alloc_inode+0x30/0x30
+[  245.695960]  mount_fs+0xf/0x90
+[  245.696451]  vfs_kern_mount+0x43/0x130
+[  245.697036]  do_mount+0x187/0xc40
+[  245.697563]  ? memdup_user+0x28/0x50
+[  245.698124]  ksys_mount+0x60/0xc0
+[  245.698639]  sys_mount+0x19/0x20
+[  245.699167]  do_int80_syscall_32+0x61/0x130
+[  245.699813]  entry_INT80_32+0xc7/0xc7
+
+showing that we never complete that read request. The reason is that
+the completion setup is racy - it initializes the completion event
+AFTER submitting the IO, which means that the IO could complete
+before/during the init. If it does, we are passing garbage to
+complete() and we may sleep forever waiting for the event to
+occur.
+
+Fixes: 7b7b68bba5ef ("floppy: bail out in open() if drive is not responding to block0 read")
+Reviewed-by: Omar Sandoval <osandov@fb.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/block/floppy.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
+index a321d7d849c6..326b9ba4518e 100644
+--- a/drivers/block/floppy.c
++++ b/drivers/block/floppy.c
+@@ -3823,10 +3823,11 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive)
+       bio.bi_end_io = floppy_rb0_cb;
+       bio_set_op_attrs(&bio, REQ_OP_READ, 0);
++      init_completion(&cbdata.complete);
++
+       submit_bio(&bio);
+       process_fd_request();
+-      init_completion(&cbdata.complete);
+       wait_for_completion(&cbdata.complete);
+       __free_page(page);
+-- 
+2.17.1
+
diff --git a/queue-4.9/kdb-use-strscpy-with-destination-buffer-size.patch b/queue-4.9/kdb-use-strscpy-with-destination-buffer-size.patch
new file mode 100644 (file)
index 0000000..01783b9
--- /dev/null
@@ -0,0 +1,126 @@
+From fee2801e7ccc140972ab7c28c693dd36c97444a3 Mon Sep 17 00:00:00 2001
+From: Prarit Bhargava <prarit@redhat.com>
+Date: Thu, 20 Sep 2018 08:59:14 -0400
+Subject: kdb: Use strscpy with destination buffer size
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[ Upstream commit c2b94c72d93d0929f48157eef128c4f9d2e603ce ]
+
+gcc 8.1.0 warns with:
+
+kernel/debug/kdb/kdb_support.c: In function ‘kallsyms_symbol_next’:
+kernel/debug/kdb/kdb_support.c:239:4: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
+     strncpy(prefix_name, name, strlen(name)+1);
+     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+kernel/debug/kdb/kdb_support.c:239:31: note: length computed here
+
+Use strscpy() with the destination buffer size, and use ellipses when
+displaying truncated symbols.
+
+v2: Use strscpy()
+
+Signed-off-by: Prarit Bhargava <prarit@redhat.com>
+Cc: Jonathan Toppins <jtoppins@redhat.com>
+Cc: Jason Wessel <jason.wessel@windriver.com>
+Cc: Daniel Thompson <daniel.thompson@linaro.org>
+Cc: kgdb-bugreport@lists.sourceforge.net
+Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
+Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/debug/kdb/kdb_io.c      | 15 +++++++++------
+ kernel/debug/kdb/kdb_private.h |  2 +-
+ kernel/debug/kdb/kdb_support.c | 10 +++++-----
+ 3 files changed, 15 insertions(+), 12 deletions(-)
+
+diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c
+index 77777d918676..cc892a9e109d 100644
+--- a/kernel/debug/kdb/kdb_io.c
++++ b/kernel/debug/kdb/kdb_io.c
+@@ -215,7 +215,7 @@ static char *kdb_read(char *buffer, size_t bufsize)
+       int count;
+       int i;
+       int diag, dtab_count;
+-      int key;
++      int key, buf_size, ret;
+       diag = kdbgetintenv("DTABCOUNT", &dtab_count);
+@@ -335,9 +335,8 @@ poll_again:
+               else
+                       p_tmp = tmpbuffer;
+               len = strlen(p_tmp);
+-              count = kallsyms_symbol_complete(p_tmp,
+-                                               sizeof(tmpbuffer) -
+-                                               (p_tmp - tmpbuffer));
++              buf_size = sizeof(tmpbuffer) - (p_tmp - tmpbuffer);
++              count = kallsyms_symbol_complete(p_tmp, buf_size);
+               if (tab == 2 && count > 0) {
+                       kdb_printf("\n%d symbols are found.", count);
+                       if (count > dtab_count) {
+@@ -349,9 +348,13 @@ poll_again:
+                       }
+                       kdb_printf("\n");
+                       for (i = 0; i < count; i++) {
+-                              if (WARN_ON(!kallsyms_symbol_next(p_tmp, i)))
++                              ret = kallsyms_symbol_next(p_tmp, i, buf_size);
++                              if (WARN_ON(!ret))
+                                       break;
+-                              kdb_printf("%s ", p_tmp);
++                              if (ret != -E2BIG)
++                                      kdb_printf("%s ", p_tmp);
++                              else
++                                      kdb_printf("%s... ", p_tmp);
+                               *(p_tmp + len) = '\0';
+                       }
+                       if (i >= dtab_count)
+diff --git a/kernel/debug/kdb/kdb_private.h b/kernel/debug/kdb/kdb_private.h
+index 75014d7f4568..533e04e75a9c 100644
+--- a/kernel/debug/kdb/kdb_private.h
++++ b/kernel/debug/kdb/kdb_private.h
+@@ -83,7 +83,7 @@ typedef struct __ksymtab {
+               unsigned long sym_start;
+               unsigned long sym_end;
+               } kdb_symtab_t;
+-extern int kallsyms_symbol_next(char *prefix_name, int flag);
++extern int kallsyms_symbol_next(char *prefix_name, int flag, int buf_size);
+ extern int kallsyms_symbol_complete(char *prefix_name, int max_len);
+ /* Exported Symbols for kernel loadable modules to use. */
+diff --git a/kernel/debug/kdb/kdb_support.c b/kernel/debug/kdb/kdb_support.c
+index d35cc2d3a4cc..2aed4a33521b 100644
+--- a/kernel/debug/kdb/kdb_support.c
++++ b/kernel/debug/kdb/kdb_support.c
+@@ -221,11 +221,13 @@ int kallsyms_symbol_complete(char *prefix_name, int max_len)
+  * Parameters:
+  *    prefix_name     prefix of a symbol name to lookup
+  *    flag    0 means search from the head, 1 means continue search.
++ *    buf_size        maximum length that can be written to prefix_name
++ *                    buffer
+  * Returns:
+  *    1 if a symbol matches the given prefix.
+  *    0 if no string found
+  */
+-int kallsyms_symbol_next(char *prefix_name, int flag)
++int kallsyms_symbol_next(char *prefix_name, int flag, int buf_size)
+ {
+       int prefix_len = strlen(prefix_name);
+       static loff_t pos;
+@@ -235,10 +237,8 @@ int kallsyms_symbol_next(char *prefix_name, int flag)
+               pos = 0;
+       while ((name = kdb_walk_kallsyms(&pos))) {
+-              if (strncmp(name, prefix_name, prefix_len) == 0) {
+-                      strncpy(prefix_name, name, strlen(name)+1);
+-                      return 1;
+-              }
++              if (!strncmp(name, prefix_name, prefix_len))
++                      return strscpy(prefix_name, name, buf_size);
+       }
+       return 0;
+ }
+-- 
+2.17.1
+
diff --git a/queue-4.9/kvm-ppc-move-and-undef-trace_include_path-file.patch b/queue-4.9/kvm-ppc-move-and-undef-trace_include_path-file.patch
new file mode 100644 (file)
index 0000000..e489120
--- /dev/null
@@ -0,0 +1,143 @@
+From 64f4697152250318dda2b4d154a401e13c10bc6c Mon Sep 17 00:00:00 2001
+From: Scott Wood <oss@buserror.net>
+Date: Tue, 6 Nov 2018 19:49:34 -0600
+Subject: KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE
+
+[ Upstream commit 28c5bcf74fa07c25d5bd118d1271920f51ce2a98 ]
+
+TRACE_INCLUDE_PATH and TRACE_INCLUDE_FILE are used by
+<trace/define_trace.h>, so like that #include, they should
+be outside #ifdef protection.
+
+They also need to be #undefed before defining, in case multiple trace
+headers are included by the same C file.  This became the case on
+book3e after commit cf4a6085151a ("powerpc/mm: Add missing tracepoint for
+tlbie"), leading to the following build error:
+
+   CC      arch/powerpc/kvm/powerpc.o
+In file included from arch/powerpc/kvm/powerpc.c:51:0:
+arch/powerpc/kvm/trace.h:9:0: error: "TRACE_INCLUDE_PATH" redefined
+[-Werror]
+  #define TRACE_INCLUDE_PATH .
+  ^
+In file included from arch/powerpc/kvm/../mm/mmu_decl.h:25:0,
+                  from arch/powerpc/kvm/powerpc.c:48:
+./arch/powerpc/include/asm/trace.h:224:0: note: this is the location of
+the previous definition
+  #define TRACE_INCLUDE_PATH asm
+  ^
+cc1: all warnings being treated as errors
+
+Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
+Signed-off-by: Scott Wood <oss@buserror.net>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/powerpc/kvm/trace.h       | 8 ++++++--
+ arch/powerpc/kvm/trace_booke.h | 9 +++++++--
+ arch/powerpc/kvm/trace_hv.h    | 9 +++++++--
+ arch/powerpc/kvm/trace_pr.h    | 9 +++++++--
+ 4 files changed, 27 insertions(+), 8 deletions(-)
+
+diff --git a/arch/powerpc/kvm/trace.h b/arch/powerpc/kvm/trace.h
+index 2e0e67ef3544..e8cedf32345a 100644
+--- a/arch/powerpc/kvm/trace.h
++++ b/arch/powerpc/kvm/trace.h
+@@ -5,8 +5,6 @@
+ #undef TRACE_SYSTEM
+ #define TRACE_SYSTEM kvm
+-#define TRACE_INCLUDE_PATH .
+-#define TRACE_INCLUDE_FILE trace
+ /*
+  * Tracepoint for guest mode entry.
+@@ -119,4 +117,10 @@ TRACE_EVENT(kvm_check_requests,
+ #endif /* _TRACE_KVM_H */
+ /* This part must be outside protection */
++#undef TRACE_INCLUDE_PATH
++#undef TRACE_INCLUDE_FILE
++
++#define TRACE_INCLUDE_PATH .
++#define TRACE_INCLUDE_FILE trace
++
+ #include <trace/define_trace.h>
+diff --git a/arch/powerpc/kvm/trace_booke.h b/arch/powerpc/kvm/trace_booke.h
+index 7ec534d1db9f..7eadbf449a1f 100644
+--- a/arch/powerpc/kvm/trace_booke.h
++++ b/arch/powerpc/kvm/trace_booke.h
+@@ -5,8 +5,6 @@
+ #undef TRACE_SYSTEM
+ #define TRACE_SYSTEM kvm_booke
+-#define TRACE_INCLUDE_PATH .
+-#define TRACE_INCLUDE_FILE trace_booke
+ #define kvm_trace_symbol_exit \
+       {0, "CRITICAL"}, \
+@@ -217,4 +215,11 @@ TRACE_EVENT(kvm_booke_queue_irqprio,
+ #endif
+ /* This part must be outside protection */
++
++#undef TRACE_INCLUDE_PATH
++#undef TRACE_INCLUDE_FILE
++
++#define TRACE_INCLUDE_PATH .
++#define TRACE_INCLUDE_FILE trace_booke
++
+ #include <trace/define_trace.h>
+diff --git a/arch/powerpc/kvm/trace_hv.h b/arch/powerpc/kvm/trace_hv.h
+index fb21990c0fb4..d9a21a7bd5c9 100644
+--- a/arch/powerpc/kvm/trace_hv.h
++++ b/arch/powerpc/kvm/trace_hv.h
+@@ -8,8 +8,6 @@
+ #undef TRACE_SYSTEM
+ #define TRACE_SYSTEM kvm_hv
+-#define TRACE_INCLUDE_PATH .
+-#define TRACE_INCLUDE_FILE trace_hv
+ #define kvm_trace_symbol_hcall \
+       {H_REMOVE,                      "H_REMOVE"}, \
+@@ -496,4 +494,11 @@ TRACE_EVENT(kvmppc_run_vcpu_exit,
+ #endif /* _TRACE_KVM_HV_H */
+ /* This part must be outside protection */
++
++#undef TRACE_INCLUDE_PATH
++#undef TRACE_INCLUDE_FILE
++
++#define TRACE_INCLUDE_PATH .
++#define TRACE_INCLUDE_FILE trace_hv
++
+ #include <trace/define_trace.h>
+diff --git a/arch/powerpc/kvm/trace_pr.h b/arch/powerpc/kvm/trace_pr.h
+index d44f324184fb..e8e2b9ad4ac6 100644
+--- a/arch/powerpc/kvm/trace_pr.h
++++ b/arch/powerpc/kvm/trace_pr.h
+@@ -7,8 +7,6 @@
+ #undef TRACE_SYSTEM
+ #define TRACE_SYSTEM kvm_pr
+-#define TRACE_INCLUDE_PATH .
+-#define TRACE_INCLUDE_FILE trace_pr
+ TRACE_EVENT(kvm_book3s_reenter,
+       TP_PROTO(int r, struct kvm_vcpu *vcpu),
+@@ -271,4 +269,11 @@ TRACE_EVENT(kvm_unmap_hva,
+ #endif /* _TRACE_KVM_H */
+ /* This part must be outside protection */
++
++#undef TRACE_INCLUDE_PATH
++#undef TRACE_INCLUDE_FILE
++
++#define TRACE_INCLUDE_PATH .
++#define TRACE_INCLUDE_FILE trace_pr
++
+ #include <trace/define_trace.h>
+-- 
+2.17.1
+
diff --git a/queue-4.9/net-bcmgenet-fix-of-child-node-lookup.patch b/queue-4.9/net-bcmgenet-fix-of-child-node-lookup.patch
new file mode 100644 (file)
index 0000000..51bd21a
--- /dev/null
@@ -0,0 +1,43 @@
+From 6a09d956ab224a3f7b235774a03277506ea708f5 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Mon, 27 Aug 2018 10:21:50 +0200
+Subject: net: bcmgenet: fix OF child-node lookup
+
+[ Upstream commit d397dbe606120a1ea1b11b0020c3f7a3852da5ac ]
+
+Use the new of_get_compatible_child() helper to lookup the mdio child
+node instead of using of_find_compatible_node(), which searches the
+entire tree from a given start node and thus can return an unrelated
+(i.e. non-child) node.
+
+This also addresses a potential use-after-free (e.g. after probe
+deferral) as the tree-wide helper drops a reference to its first
+argument (i.e. the node of the device being probed).
+
+Fixes: aa09677cba42 ("net: bcmgenet: add MDIO routines")
+Cc: stable <stable@vger.kernel.org>     # 3.15
+Cc: David S. Miller <davem@davemloft.net>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Rob Herring <robh@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/broadcom/genet/bcmmii.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
+index 3b9e1a5dce82..9bd90a7c4d40 100644
+--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
++++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
+@@ -483,7 +483,7 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv)
+       if (!compat)
+               return -ENOMEM;
+-      priv->mdio_dn = of_find_compatible_node(dn, NULL, compat);
++      priv->mdio_dn = of_get_compatible_child(dn, compat);
+       kfree(compat);
+       if (!priv->mdio_dn) {
+               dev_err(kdev, "unable to find MDIO bus node\n");
+-- 
+2.17.1
+
diff --git a/queue-4.9/nfc-nfcmrvl_uart-fix-of-child-node-lookup.patch b/queue-4.9/nfc-nfcmrvl_uart-fix-of-child-node-lookup.patch
new file mode 100644 (file)
index 0000000..30b6fb7
--- /dev/null
@@ -0,0 +1,48 @@
+From db00c764cdc452d9a1811218bfb6379c135dc8ee Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Mon, 27 Aug 2018 10:21:52 +0200
+Subject: NFC: nfcmrvl_uart: fix OF child-node lookup
+
+[ Upstream commit 5bf59773aaf36dd62117dc83d50e1bbf9ef432da ]
+
+Use the new of_get_compatible_child() helper to lookup the nfc child
+node instead of using of_find_compatible_node(), which searches the
+entire tree from a given start node and thus can return an unrelated
+(i.e. non-child) node.
+
+This also addresses a potential use-after-free (e.g. after probe
+deferral) as the tree-wide helper drops a reference to its first
+argument (i.e. the parent node).
+
+Fixes: e097dc624f78 ("NFC: nfcmrvl: add UART driver")
+Fixes: d8e018c0b321 ("NFC: nfcmrvl: update device tree bindings for Marvell NFC")
+Cc: stable <stable@vger.kernel.org>     # 4.2
+Cc: Vincent Cuissard <cuissard@marvell.com>
+Cc: Samuel Ortiz <sameo@linux.intel.com>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Rob Herring <robh@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nfc/nfcmrvl/uart.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/nfc/nfcmrvl/uart.c b/drivers/nfc/nfcmrvl/uart.c
+index 6c0c301611c4..1b11ded79c4f 100644
+--- a/drivers/nfc/nfcmrvl/uart.c
++++ b/drivers/nfc/nfcmrvl/uart.c
+@@ -73,10 +73,9 @@ static int nfcmrvl_uart_parse_dt(struct device_node *node,
+       struct device_node *matched_node;
+       int ret;
+-      matched_node = of_find_compatible_node(node, NULL, "marvell,nfc-uart");
++      matched_node = of_get_compatible_child(node, "marvell,nfc-uart");
+       if (!matched_node) {
+-              matched_node = of_find_compatible_node(node, NULL,
+-                                                     "mrvl,nfc-uart");
++              matched_node = of_get_compatible_child(node, "mrvl,nfc-uart");
+               if (!matched_node)
+                       return -ENODEV;
+       }
+-- 
+2.17.1
+
diff --git a/queue-4.9/of-add-helper-to-lookup-compatible-child-node.patch b/queue-4.9/of-add-helper-to-lookup-compatible-child-node.patch
new file mode 100644 (file)
index 0000000..8f3bbd6
--- /dev/null
@@ -0,0 +1,91 @@
+From 7f1f67d5166230256ec6ff5b3d9352c9d50ecf5f Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Mon, 27 Aug 2018 10:21:45 +0200
+Subject: of: add helper to lookup compatible child node
+
+[ Upstream commit 36156f9241cb0f9e37d998052873ca7501ad4b36 ]
+
+Add of_get_compatible_child() helper that can be used to lookup
+compatible child nodes.
+
+Several drivers currently use of_find_compatible_node() to lookup child
+nodes while failing to notice that the of_find_ functions search the
+entire tree depth-first (from a given start node) and therefore can
+match unrelated nodes. The fact that these functions also drop a
+reference to the node they start searching from (e.g. the parent node)
+is typically also overlooked, something which can lead to use-after-free
+bugs.
+
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Rob Herring <robh@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/of/base.c  | 25 +++++++++++++++++++++++++
+ include/linux/of.h |  8 ++++++++
+ 2 files changed, 33 insertions(+)
+
+diff --git a/drivers/of/base.c b/drivers/of/base.c
+index 466b285cef3e..f366af135d5b 100644
+--- a/drivers/of/base.c
++++ b/drivers/of/base.c
+@@ -738,6 +738,31 @@ struct device_node *of_get_next_available_child(const struct device_node *node,
+ }
+ EXPORT_SYMBOL(of_get_next_available_child);
++/**
++ * of_get_compatible_child - Find compatible child node
++ * @parent:   parent node
++ * @compatible:       compatible string
++ *
++ * Lookup child node whose compatible property contains the given compatible
++ * string.
++ *
++ * Returns a node pointer with refcount incremented, use of_node_put() on it
++ * when done; or NULL if not found.
++ */
++struct device_node *of_get_compatible_child(const struct device_node *parent,
++                              const char *compatible)
++{
++      struct device_node *child;
++
++      for_each_child_of_node(parent, child) {
++              if (of_device_is_compatible(child, compatible))
++                      break;
++      }
++
++      return child;
++}
++EXPORT_SYMBOL(of_get_compatible_child);
++
+ /**
+  *    of_get_child_by_name - Find the child node by name for a given parent
+  *    @node:  parent node
+diff --git a/include/linux/of.h b/include/linux/of.h
+index 299aeb192727..a19cc85b9373 100644
+--- a/include/linux/of.h
++++ b/include/linux/of.h
+@@ -275,6 +275,8 @@ extern struct device_node *of_get_next_child(const struct device_node *node,
+ extern struct device_node *of_get_next_available_child(
+       const struct device_node *node, struct device_node *prev);
++extern struct device_node *of_get_compatible_child(const struct device_node *parent,
++                                      const char *compatible);
+ extern struct device_node *of_get_child_by_name(const struct device_node *node,
+                                       const char *name);
+@@ -606,6 +608,12 @@ static inline bool of_have_populated_dt(void)
+       return false;
+ }
++static inline struct device_node *of_get_compatible_child(const struct device_node *parent,
++                                      const char *compatible)
++{
++      return NULL;
++}
++
+ static inline struct device_node *of_get_child_by_name(
+                                       const struct device_node *node,
+                                       const char *name)
+-- 
+2.17.1
+
diff --git a/queue-4.9/perf-x86-intel-uncore-add-more-imc-pci-ids-for-kabyl.patch b/queue-4.9/perf-x86-intel-uncore-add-more-imc-pci-ids-for-kabyl.patch
new file mode 100644 (file)
index 0000000..adc7ccc
--- /dev/null
@@ -0,0 +1,173 @@
+From cb4e2fa3e420fa370126072217731e8a5095ef15 Mon Sep 17 00:00:00 2001
+From: Kan Liang <kan.liang@linux.intel.com>
+Date: Fri, 19 Oct 2018 10:04:18 -0700
+Subject: perf/x86/intel/uncore: Add more IMC PCI IDs for KabyLake and
+ CoffeeLake CPUs
+
+[ Upstream commit c10a8de0d32e95b0b8c7c17b6dc09baea5a5a899 ]
+
+KabyLake and CoffeeLake CPUs have the same client uncore events as SkyLake.
+
+Add the PCI IDs for the KabyLake Y, U, S processor lines and CoffeeLake U,
+H, S processor lines.
+
+Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Jiri Olsa <jolsa@redhat.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Stephane Eranian <eranian@google.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Vince Weaver <vincent.weaver@maine.edu>
+Link: http://lkml.kernel.org/r/20181019170419.378-1-kan.liang@linux.intel.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/x86/events/intel/uncore_snb.c | 115 ++++++++++++++++++++++++++++-
+ 1 file changed, 114 insertions(+), 1 deletion(-)
+
+diff --git a/arch/x86/events/intel/uncore_snb.c b/arch/x86/events/intel/uncore_snb.c
+index a3dcc12bef4a..8c700069060b 100644
+--- a/arch/x86/events/intel/uncore_snb.c
++++ b/arch/x86/events/intel/uncore_snb.c
+@@ -14,6 +14,25 @@
+ #define PCI_DEVICE_ID_INTEL_SKL_HQ_IMC        0x1910
+ #define PCI_DEVICE_ID_INTEL_SKL_SD_IMC        0x190f
+ #define PCI_DEVICE_ID_INTEL_SKL_SQ_IMC        0x191f
++#define PCI_DEVICE_ID_INTEL_KBL_Y_IMC 0x590c
++#define PCI_DEVICE_ID_INTEL_KBL_U_IMC 0x5904
++#define PCI_DEVICE_ID_INTEL_KBL_UQ_IMC        0x5914
++#define PCI_DEVICE_ID_INTEL_KBL_SD_IMC        0x590f
++#define PCI_DEVICE_ID_INTEL_KBL_SQ_IMC        0x591f
++#define PCI_DEVICE_ID_INTEL_CFL_2U_IMC        0x3ecc
++#define PCI_DEVICE_ID_INTEL_CFL_4U_IMC        0x3ed0
++#define PCI_DEVICE_ID_INTEL_CFL_4H_IMC        0x3e10
++#define PCI_DEVICE_ID_INTEL_CFL_6H_IMC        0x3ec4
++#define PCI_DEVICE_ID_INTEL_CFL_2S_D_IMC      0x3e0f
++#define PCI_DEVICE_ID_INTEL_CFL_4S_D_IMC      0x3e1f
++#define PCI_DEVICE_ID_INTEL_CFL_6S_D_IMC      0x3ec2
++#define PCI_DEVICE_ID_INTEL_CFL_8S_D_IMC      0x3e30
++#define PCI_DEVICE_ID_INTEL_CFL_4S_W_IMC      0x3e18
++#define PCI_DEVICE_ID_INTEL_CFL_6S_W_IMC      0x3ec6
++#define PCI_DEVICE_ID_INTEL_CFL_8S_W_IMC      0x3e31
++#define PCI_DEVICE_ID_INTEL_CFL_4S_S_IMC      0x3e33
++#define PCI_DEVICE_ID_INTEL_CFL_6S_S_IMC      0x3eca
++#define PCI_DEVICE_ID_INTEL_CFL_8S_S_IMC      0x3e32
+ /* SNB event control */
+ #define SNB_UNC_CTL_EV_SEL_MASK                       0x000000ff
+@@ -631,7 +650,82 @@ static const struct pci_device_id skl_uncore_pci_ids[] = {
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_SQ_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+-
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_Y_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_U_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_UQ_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_SD_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_SQ_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_2U_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_4U_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_4H_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_6H_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_2S_D_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_4S_D_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_6S_D_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_8S_D_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_4S_W_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_6S_W_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_8S_W_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_4S_S_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_6S_S_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
++      { /* IMC */
++              PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_8S_S_IMC),
++              .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
++      },
+       { /* end: all zeroes */ },
+ };
+@@ -680,6 +774,25 @@ static const struct imc_uncore_pci_dev desktop_imc_pci_ids[] = {
+       IMC_DEV(SKL_HQ_IMC, &skl_uncore_pci_driver),  /* 6th Gen Core H Quad Core */
+       IMC_DEV(SKL_SD_IMC, &skl_uncore_pci_driver),  /* 6th Gen Core S Dual Core */
+       IMC_DEV(SKL_SQ_IMC, &skl_uncore_pci_driver),  /* 6th Gen Core S Quad Core */
++      IMC_DEV(KBL_Y_IMC, &skl_uncore_pci_driver),  /* 7th Gen Core Y */
++      IMC_DEV(KBL_U_IMC, &skl_uncore_pci_driver),  /* 7th Gen Core U */
++      IMC_DEV(KBL_UQ_IMC, &skl_uncore_pci_driver),  /* 7th Gen Core U Quad Core */
++      IMC_DEV(KBL_SD_IMC, &skl_uncore_pci_driver),  /* 7th Gen Core S Dual Core */
++      IMC_DEV(KBL_SQ_IMC, &skl_uncore_pci_driver),  /* 7th Gen Core S Quad Core */
++      IMC_DEV(CFL_2U_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core U 2 Cores */
++      IMC_DEV(CFL_4U_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core U 4 Cores */
++      IMC_DEV(CFL_4H_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core H 4 Cores */
++      IMC_DEV(CFL_6H_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core H 6 Cores */
++      IMC_DEV(CFL_2S_D_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core S 2 Cores Desktop */
++      IMC_DEV(CFL_4S_D_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core S 4 Cores Desktop */
++      IMC_DEV(CFL_6S_D_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core S 6 Cores Desktop */
++      IMC_DEV(CFL_8S_D_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core S 8 Cores Desktop */
++      IMC_DEV(CFL_4S_W_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core S 4 Cores Work Station */
++      IMC_DEV(CFL_6S_W_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core S 6 Cores Work Station */
++      IMC_DEV(CFL_8S_W_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core S 8 Cores Work Station */
++      IMC_DEV(CFL_4S_S_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core S 4 Cores Server */
++      IMC_DEV(CFL_6S_S_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core S 6 Cores Server */
++      IMC_DEV(CFL_8S_S_IMC, &skl_uncore_pci_driver),  /* 8th Gen Core S 8 Cores Server */
+       {  /* end marker */ }
+ };
+-- 
+2.17.1
+
diff --git a/queue-4.9/pinctrl-meson-fix-pinconf-bias-disable.patch b/queue-4.9/pinctrl-meson-fix-pinconf-bias-disable.patch
new file mode 100644 (file)
index 0000000..69e6a01
--- /dev/null
@@ -0,0 +1,39 @@
+From ce17d59b0d0977895e5487e6f3075ff18cb1e78a Mon Sep 17 00:00:00 2001
+From: Jerome Brunet <jbrunet@baylibre.com>
+Date: Tue, 23 Oct 2018 18:03:19 +0200
+Subject: pinctrl: meson: fix pinconf bias disable
+
+[ Upstream commit e39f9dd8206ad66992ac0e6218ef1ba746f2cce9 ]
+
+If a bias is enabled on a pin of an Amlogic SoC, calling .pin_config_set()
+with PIN_CONFIG_BIAS_DISABLE will not disable the bias. Instead it will
+force a pull-down bias on the pin.
+
+Instead of the pull type register bank, the driver should access the pull
+enable register bank.
+
+Fixes: 6ac730951104 ("pinctrl: add driver for Amlogic Meson SoCs")
+Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
+Acked-by: Neil Armstrong <narmstrong@baylibre.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/pinctrl/meson/pinctrl-meson.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
+index 9443c9d408c6..df61a71420b1 100644
+--- a/drivers/pinctrl/meson/pinctrl-meson.c
++++ b/drivers/pinctrl/meson/pinctrl-meson.c
+@@ -275,7 +275,7 @@ static int meson_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin,
+                       dev_dbg(pc->dev, "pin %u: disable bias\n", pin);
+                       meson_calc_reg_and_bit(bank, pin, REG_PULL, &reg, &bit);
+-                      ret = regmap_update_bits(pc->reg_pull, reg,
++                      ret = regmap_update_bits(pc->reg_pullen, reg,
+                                                BIT(bit), 0);
+                       if (ret)
+                               return ret;
+-- 
+2.17.1
+
diff --git a/queue-4.9/powerpc-io-fix-the-io-workarounds-code-to-work-with-.patch b/queue-4.9/powerpc-io-fix-the-io-workarounds-code-to-work-with-.patch
new file mode 100644 (file)
index 0000000..6c0be54
--- /dev/null
@@ -0,0 +1,120 @@
+From 277c3524a47151591ede176ddbed972ccb54025d Mon Sep 17 00:00:00 2001
+From: Michael Ellerman <mpe@ellerman.id.au>
+Date: Tue, 6 Nov 2018 23:37:58 +1100
+Subject: powerpc/io: Fix the IO workarounds code to work with Radix
+
+[ Upstream commit 43c6494fa1499912c8177e71450c0279041152a6 ]
+
+Back in 2006 Ben added some workarounds for a misbehaviour in the
+Spider IO bridge used on early Cell machines, see commit
+014da7ff47b5 ("[POWERPC] Cell "Spider" MMIO workarounds"). Later these
+were made to be generic, ie. not tied specifically to Spider.
+
+The code stashes a token in the high bits (59-48) of virtual addresses
+used for IO (eg. returned from ioremap()). This works fine when using
+the Hash MMU, but when we're using the Radix MMU the bits used for the
+token overlap with some of the bits of the virtual address.
+
+This is because the maximum virtual address is larger with Radix, up
+to c00fffffffffffff, and in fact we use that high part of the address
+range for ioremap(), see RADIX_KERN_IO_START.
+
+As it happens the bits that are used overlap with the bits that
+differentiate an IO address vs a linear map address. If the resulting
+address lies outside the linear mapping we will crash (see below), if
+not we just corrupt memory.
+
+  virtio-pci 0000:00:00.0: Using 64-bit direct DMA at offset 800000000000000
+  Unable to handle kernel paging request for data at address 0xc000000080000014
+  ...
+  CFAR: c000000000626b98 DAR: c000000080000014 DSISR: 42000000 IRQMASK: 0
+  GPR00: c0000000006c54fc c00000003e523378 c0000000016de600 0000000000000000
+  GPR04: c00c000080000014 0000000000000007 0fffffff000affff 0000000000000030
+         ^^^^
+  ...
+  NIP [c000000000626c5c] .iowrite8+0xec/0x100
+  LR [c0000000006c992c] .vp_reset+0x2c/0x90
+  Call Trace:
+    .pci_bus_read_config_dword+0xc4/0x120 (unreliable)
+    .register_virtio_device+0x13c/0x1c0
+    .virtio_pci_probe+0x148/0x1f0
+    .local_pci_probe+0x68/0x140
+    .pci_device_probe+0x164/0x220
+    .really_probe+0x274/0x3b0
+    .driver_probe_device+0x80/0x170
+    .__driver_attach+0x14c/0x150
+    .bus_for_each_dev+0xb8/0x130
+    .driver_attach+0x34/0x50
+    .bus_add_driver+0x178/0x2f0
+    .driver_register+0x90/0x1a0
+    .__pci_register_driver+0x6c/0x90
+    .virtio_pci_driver_init+0x2c/0x40
+    .do_one_initcall+0x64/0x280
+    .kernel_init_freeable+0x36c/0x474
+    .kernel_init+0x24/0x160
+    .ret_from_kernel_thread+0x58/0x7c
+
+This hasn't been a problem because CONFIG_PPC_IO_WORKAROUNDS which
+enables this code is usually not enabled. It is only enabled when it's
+selected by PPC_CELL_NATIVE which is only selected by
+PPC_IBM_CELL_BLADE and that in turn depends on BIG_ENDIAN. So in order
+to hit the bug you need to build a big endian kernel, with IBM Cell
+Blade support enabled, as well as Radix MMU support, and then boot
+that on Power9 using Radix MMU.
+
+Still we can fix the bug, so let's do that. We simply use fewer bits
+for the token, taking the union of the restrictions on the address
+from both Hash and Radix, we end up with 8 bits we can use for the
+token. The only user of the token is iowa_mem_find_bus() which only
+supports 8 token values, so 8 bits is plenty for that.
+
+Fixes: 566ca99af026 ("powerpc/mm/radix: Add dummy radix_enabled()")
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/powerpc/include/asm/io.h | 20 +++++++-------------
+ 1 file changed, 7 insertions(+), 13 deletions(-)
+
+diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
+index f6fda8482f60..3b10f532c28e 100644
+--- a/arch/powerpc/include/asm/io.h
++++ b/arch/powerpc/include/asm/io.h
+@@ -333,19 +333,13 @@ extern void _memcpy_toio(volatile void __iomem *dest, const void *src,
+  * their hooks, a bitfield is reserved for use by the platform near the
+  * top of MMIO addresses (not PIO, those have to cope the hard way).
+  *
+- * This bit field is 12 bits and is at the top of the IO virtual
+- * addresses PCI_IO_INDIRECT_TOKEN_MASK.
++ * The highest address in the kernel virtual space are:
+  *
+- * The kernel virtual space is thus:
++ *  d0003fffffffffff  # with Hash MMU
++ *  c00fffffffffffff  # with Radix MMU
+  *
+- *  0xD000000000000000                : vmalloc
+- *  0xD000080000000000                : PCI PHB IO space
+- *  0xD000080080000000                : ioremap
+- *  0xD0000fffffffffff                : end of ioremap region
+- *
+- * Since the top 4 bits are reserved as the region ID, we use thus
+- * the next 12 bits and keep 4 bits available for the future if the
+- * virtual address space is ever to be extended.
++ * The top 4 bits are reserved as the region ID on hash, leaving us 8 bits
++ * that can be used for the field.
+  *
+  * The direct IO mapping operations will then mask off those bits
+  * before doing the actual access, though that only happen when
+@@ -357,8 +351,8 @@ extern void _memcpy_toio(volatile void __iomem *dest, const void *src,
+  */
+ #ifdef CONFIG_PPC_INDIRECT_MMIO
+-#define PCI_IO_IND_TOKEN_MASK 0x0fff000000000000ul
+-#define PCI_IO_IND_TOKEN_SHIFT        48
++#define PCI_IO_IND_TOKEN_SHIFT        52
++#define PCI_IO_IND_TOKEN_MASK (0xfful << PCI_IO_IND_TOKEN_SHIFT)
+ #define PCI_FIX_ADDR(addr)                                            \
+       ((PCI_IO_ADDR)(((unsigned long)(addr)) & ~PCI_IO_IND_TOKEN_MASK))
+ #define PCI_GET_ADDR_TOKEN(addr)                                      \
+-- 
+2.17.1
+
diff --git a/queue-4.9/powerpc-numa-suppress-vphn-is-not-supported-messages.patch b/queue-4.9/powerpc-numa-suppress-vphn-is-not-supported-messages.patch
new file mode 100644 (file)
index 0000000..8b35b88
--- /dev/null
@@ -0,0 +1,36 @@
+From 358aa65ff7846d03f29ce0af624494d0cace3a4b Mon Sep 17 00:00:00 2001
+From: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
+Date: Thu, 8 Nov 2018 10:47:56 +0530
+Subject: powerpc/numa: Suppress "VPHN is not supported" messages
+
+[ Upstream commit 437ccdc8ce629470babdda1a7086e2f477048cbd ]
+
+When VPHN function is not supported and during cpu hotplug event,
+kernel prints message 'VPHN function not supported. Disabling
+polling...'. Currently it prints on every hotplug event, it floods
+dmesg when a KVM guest tries to hotplug huge number of vcpus, let's
+just print once and suppress further kernel prints.
+
+Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/powerpc/mm/numa.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
+index 6cff96e0d77b..0ef83c274019 100644
+--- a/arch/powerpc/mm/numa.c
++++ b/arch/powerpc/mm/numa.c
+@@ -1289,7 +1289,7 @@ static long vphn_get_associativity(unsigned long cpu,
+       switch (rc) {
+       case H_FUNCTION:
+-              printk(KERN_INFO
++              printk_once(KERN_INFO
+                       "VPHN is not supported. Disabling polling...\n");
+               stop_topology_update();
+               break;
+-- 
+2.17.1
+
diff --git a/queue-4.9/rtc-pcf2127-fix-a-kmemleak-caused-in-pcf2127_i2c_gat.patch b/queue-4.9/rtc-pcf2127-fix-a-kmemleak-caused-in-pcf2127_i2c_gat.patch
new file mode 100644 (file)
index 0000000..1afb51f
--- /dev/null
@@ -0,0 +1,55 @@
+From 751b12825491a43a2b427bd0d3919985358665b8 Mon Sep 17 00:00:00 2001
+From: Xulin Sun <xulin.sun@windriver.com>
+Date: Tue, 6 Nov 2018 16:42:19 +0800
+Subject: rtc: pcf2127: fix a kmemleak caused in pcf2127_i2c_gather_write
+
+[ Upstream commit 9bde0afb7a906f1dabdba37162551565740b862d ]
+
+pcf2127_i2c_gather_write() allocates memory as local variable
+for i2c_master_send(), after finishing the master transfer,
+the allocated memory should be freed. The kmemleak is reported:
+
+unreferenced object 0xffff80231e7dba80 (size 64):
+  comm "hwclock", pid 27762, jiffies 4296880075 (age 356.944s)
+  hex dump (first 32 bytes):
+    03 00 12 03 19 02 11 13 00 80 98 18 00 00 ff ff ................
+    00 50 00 00 00 00 00 00 02 00 00 00 00 00 00 00 .P..............
+  backtrace:
+    [<ffff000008221398>] create_object+0xf8/0x278
+    [<ffff000008a96264>] kmemleak_alloc+0x74/0xa0
+    [<ffff00000821070c>] __kmalloc+0x1ac/0x348
+    [<ffff0000087ed1dc>] pcf2127_i2c_gather_write+0x54/0xf8
+    [<ffff0000085fd9d4>] _regmap_raw_write+0x464/0x850
+    [<ffff0000085fe3f4>] regmap_bulk_write+0x1a4/0x348
+    [<ffff0000087ed32c>] pcf2127_rtc_set_time+0xac/0xe8
+    [<ffff0000087eaad8>] rtc_set_time+0x80/0x138
+    [<ffff0000087ebfb0>] rtc_dev_ioctl+0x398/0x610
+    [<ffff00000823f2c0>] do_vfs_ioctl+0xb0/0x848
+    [<ffff00000823fae4>] SyS_ioctl+0x8c/0xa8
+    [<ffff000008083ac0>] el0_svc_naked+0x34/0x38
+    [<ffffffffffffffff>] 0xffffffffffffffff
+
+Signed-off-by: Xulin Sun <xulin.sun@windriver.com>
+Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/rtc/rtc-pcf2127.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c
+index 2bfdf638b673..8a3667e761dd 100644
+--- a/drivers/rtc/rtc-pcf2127.c
++++ b/drivers/rtc/rtc-pcf2127.c
+@@ -237,6 +237,9 @@ static int pcf2127_i2c_gather_write(void *context,
+       memcpy(buf + 1, val, val_size);
+       ret = i2c_master_send(client, buf, val_size + 1);
++
++      kfree(buf);
++
+       if (ret != val_size + 1)
+               return ret < 0 ? ret : -EIO;
+-- 
+2.17.1
+
index 25a1062cc77555c3a007c3a9df63fb7254a17fa6..8283144acc1a9fdd81c0560fb18094bb8d670908 100644 (file)
@@ -25,3 +25,20 @@ acpica-aml-interpreter-add-region-addresses-in-global-list-during-initialization
 ib-core-fix-for-core-panic.patch
 ib-hfi1-eliminate-races-in-the-sdma-send-error-path.patch
 usb-xhci-prevent-bus-suspend-if-a-port-connect-change-or-polling-state-is-detected.patch
+pinctrl-meson-fix-pinconf-bias-disable.patch
+kvm-ppc-move-and-undef-trace_include_path-file.patch
+cpufreq-imx6q-add-return-value-check-for-voltage-sca.patch
+rtc-pcf2127-fix-a-kmemleak-caused-in-pcf2127_i2c_gat.patch
+floppy-fix-race-condition-in-__floppy_read_block_0.patch
+powerpc-io-fix-the-io-workarounds-code-to-work-with-.patch
+perf-x86-intel-uncore-add-more-imc-pci-ids-for-kabyl.patch
+arm-make-lookup_processor_type-non-__init.patch
+sunrpc-fix-a-bogus-get-put-in-generic_key_to_expire.patch
+kdb-use-strscpy-with-destination-buffer-size.patch
+powerpc-numa-suppress-vphn-is-not-supported-messages.patch
+efi-arm-revert-deferred-unmap-of-early-memmap-mappin.patch
+tmpfs-make-lseek-seek_data-sek_hole-return-enxio-wit.patch
+of-add-helper-to-lookup-compatible-child-node.patch
+nfc-nfcmrvl_uart-fix-of-child-node-lookup.patch
+net-bcmgenet-fix-of-child-node-lookup.patch
+arm64-remove-no-op-p-linker-flag.patch
diff --git a/queue-4.9/sunrpc-fix-a-bogus-get-put-in-generic_key_to_expire.patch b/queue-4.9/sunrpc-fix-a-bogus-get-put-in-generic_key_to_expire.patch
new file mode 100644 (file)
index 0000000..acfa0d2
--- /dev/null
@@ -0,0 +1,35 @@
+From f38bcfd3dedc487db117a06148bed3cec912a406 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Mon, 12 Nov 2018 16:06:51 -0500
+Subject: SUNRPC: Fix a bogus get/put in generic_key_to_expire()
+
+[ Upstream commit e3d5e573a54dabdc0f9f3cb039d799323372b251 ]
+
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/sunrpc/auth_generic.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c
+index f1df9837f1ac..1ac08dcbf85d 100644
+--- a/net/sunrpc/auth_generic.c
++++ b/net/sunrpc/auth_generic.c
+@@ -281,13 +281,7 @@ static bool generic_key_to_expire(struct rpc_cred *cred)
+ {
+       struct auth_cred *acred = &container_of(cred, struct generic_cred,
+                                               gc_base)->acred;
+-      bool ret;
+-
+-      get_rpccred(cred);
+-      ret = test_bit(RPC_CRED_KEY_EXPIRE_SOON, &acred->ac_flags);
+-      put_rpccred(cred);
+-
+-      return ret;
++      return test_bit(RPC_CRED_KEY_EXPIRE_SOON, &acred->ac_flags);
+ }
+ static const struct rpc_credops generic_credops = {
+-- 
+2.17.1
+
diff --git a/queue-4.9/tmpfs-make-lseek-seek_data-sek_hole-return-enxio-wit.patch b/queue-4.9/tmpfs-make-lseek-seek_data-sek_hole-return-enxio-wit.patch
new file mode 100644 (file)
index 0000000..900e035
--- /dev/null
@@ -0,0 +1,54 @@
+From bba71f37fbbf5030219146f3e3e4e6bbb56aecfb Mon Sep 17 00:00:00 2001
+From: Yufen Yu <yuyufen@huawei.com>
+Date: Fri, 16 Nov 2018 15:08:39 -0800
+Subject: tmpfs: make lseek(SEEK_DATA/SEK_HOLE) return ENXIO with a negative
+ offset
+
+[ Upstream commit 1a413646931cb14442065cfc17561e50f5b5bb44 ]
+
+Other filesystems such as ext4, f2fs and ubifs all return ENXIO when
+lseek (SEEK_DATA or SEEK_HOLE) requests a negative offset.
+
+man 2 lseek says
+
+:      EINVAL whence  is  not  valid.   Or: the resulting file offset would be
+:             negative, or beyond the end of a seekable device.
+:
+:      ENXIO  whence is SEEK_DATA or SEEK_HOLE, and the file offset is  beyond
+:             the end of the file.
+
+Make tmpfs return ENXIO under these circumstances as well.  After this,
+tmpfs also passes xfstests's generic/448.
+
+[akpm@linux-foundation.org: rewrite changelog]
+Link: http://lkml.kernel.org/r/1540434176-14349-1-git-send-email-yuyufen@huawei.com
+Signed-off-by: Yufen Yu <yuyufen@huawei.com>
+Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Hugh Dickins <hughd@google.com>
+Cc: William Kucharski <william.kucharski@oracle.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ mm/shmem.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/mm/shmem.c b/mm/shmem.c
+index 4b5cca167baf..358a92be43eb 100644
+--- a/mm/shmem.c
++++ b/mm/shmem.c
+@@ -2414,9 +2414,7 @@ static loff_t shmem_file_llseek(struct file *file, loff_t offset, int whence)
+       inode_lock(inode);
+       /* We're holding i_mutex so we can access i_size directly */
+-      if (offset < 0)
+-              offset = -EINVAL;
+-      else if (offset >= inode->i_size)
++      if (offset < 0 || offset >= inode->i_size)
+               offset = -ENXIO;
+       else {
+               start = offset >> PAGE_SHIFT;
+-- 
+2.17.1
+