From: Greg Kroah-Hartman Date: Thu, 6 Dec 2018 11:31:36 +0000 (+0100) Subject: 3.18-stable patches X-Git-Tag: v4.19.8~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0cef785d154ec96eaa680dd664df196f810bdd4;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: input-xpad-quirk-all-pdp-xbox-one-gamepads.patch kgdboc-fix-warning-with-module-build.patch mm-cleancache-fix-corruption-on-missed-inode-invalidation.patch --- diff --git a/queue-3.18/input-xpad-quirk-all-pdp-xbox-one-gamepads.patch b/queue-3.18/input-xpad-quirk-all-pdp-xbox-one-gamepads.patch new file mode 100644 index 00000000000..d4b1b10a663 --- /dev/null +++ b/queue-3.18/input-xpad-quirk-all-pdp-xbox-one-gamepads.patch @@ -0,0 +1,70 @@ +From a6754fae1e66e9a40fed406290d7ca3f2b4d227c Mon Sep 17 00:00:00 2001 +From: Cameron Gutman +Date: Thu, 29 Nov 2018 10:09:33 -0800 +Subject: Input: xpad - quirk all PDP Xbox One gamepads + +From: Cameron Gutman + +commit a6754fae1e66e9a40fed406290d7ca3f2b4d227c upstream. + +Since we continue to find tons of new variants [0,1,2,3,4,5,6] that +need the PDP quirk, let's just quirk all devices from PDP. + +[0]: https://github.com/paroj/xpad/pull/104 +[1]: https://github.com/paroj/xpad/pull/105 +[2]: https://github.com/paroj/xpad/pull/108 +[3]: https://github.com/paroj/xpad/pull/109 +[4]: https://github.com/paroj/xpad/pull/112 +[5]: https://github.com/paroj/xpad/pull/115 +[6]: https://github.com/paroj/xpad/pull/116 + +Fixes: e5c9c6a885fa ("Input: xpad - add support for PDP Xbox One controllers") +Cc: stable@vger.kernel.org +Signed-off-by: Cameron Gutman +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/joystick/xpad.c | 16 ++++++---------- + 1 file changed, 6 insertions(+), 10 deletions(-) + +--- a/drivers/input/joystick/xpad.c ++++ b/drivers/input/joystick/xpad.c +@@ -483,18 +483,18 @@ static const u8 xboxone_hori_init[] = { + }; + + /* +- * This packet is required for some of the PDP pads to start ++ * This packet is required for most (all?) of the PDP pads to start + * sending input reports. These pads include: (0x0e6f:0x02ab), +- * (0x0e6f:0x02a4). ++ * (0x0e6f:0x02a4), (0x0e6f:0x02a6). + */ + static const u8 xboxone_pdp_init1[] = { + 0x0a, 0x20, 0x00, 0x03, 0x00, 0x01, 0x14 + }; + + /* +- * This packet is required for some of the PDP pads to start ++ * This packet is required for most (all?) of the PDP pads to start + * sending input reports. These pads include: (0x0e6f:0x02ab), +- * (0x0e6f:0x02a4). ++ * (0x0e6f:0x02a4), (0x0e6f:0x02a6). + */ + static const u8 xboxone_pdp_init2[] = { + 0x06, 0x20, 0x00, 0x02, 0x01, 0x00 +@@ -530,12 +530,8 @@ static const struct xboxone_init_packet + XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init), + XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init), + XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init), +- XBOXONE_INIT_PKT(0x0e6f, 0x02ab, xboxone_pdp_init1), +- XBOXONE_INIT_PKT(0x0e6f, 0x02ab, xboxone_pdp_init2), +- XBOXONE_INIT_PKT(0x0e6f, 0x02a4, xboxone_pdp_init1), +- XBOXONE_INIT_PKT(0x0e6f, 0x02a4, xboxone_pdp_init2), +- XBOXONE_INIT_PKT(0x0e6f, 0x02a6, xboxone_pdp_init1), +- XBOXONE_INIT_PKT(0x0e6f, 0x02a6, xboxone_pdp_init2), ++ XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1), ++ XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2), + XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init), + XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumblebegin_init), + XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init), diff --git a/queue-3.18/kgdboc-fix-warning-with-module-build.patch b/queue-3.18/kgdboc-fix-warning-with-module-build.patch new file mode 100644 index 00000000000..79568851348 --- /dev/null +++ b/queue-3.18/kgdboc-fix-warning-with-module-build.patch @@ -0,0 +1,81 @@ +From 1cd25cbb2fedbc777f3a8c3cb1ba69b645aeaa64 Mon Sep 17 00:00:00 2001 +From: Laura Abbott +Date: Wed, 19 Sep 2018 18:59:01 -0700 +Subject: kgdboc: Fix warning with module build + +From: Laura Abbott + +commit 1cd25cbb2fedbc777f3a8c3cb1ba69b645aeaa64 upstream. + +After 2dd453168643 ("kgdboc: Fix restrict error"), kgdboc_option_setup is +now only used when built in, resulting in a warning when compiled as a +module: + +drivers/tty/serial/kgdboc.c:134:12: warning: 'kgdboc_option_setup' defined but not used [-Wunused-function] + static int kgdboc_option_setup(char *opt) + ^~~~~~~~~~~~~~~~~~~ + +Move the function under the appropriate ifdef for builtin only. + +Fixes: 2dd453168643 ("kgdboc: Fix restrict error") +Reported-by: Stephen Rothwell +Signed-off-by: Laura Abbott +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/kgdboc.c | 37 +++++++++++++++++++------------------ + 1 file changed, 19 insertions(+), 18 deletions(-) + +--- a/drivers/tty/serial/kgdboc.c ++++ b/drivers/tty/serial/kgdboc.c +@@ -131,24 +131,6 @@ static void kgdboc_unregister_kbd(void) + #define kgdboc_restore_input() + #endif /* ! CONFIG_KDB_KEYBOARD */ + +-static int kgdboc_option_setup(char *opt) +-{ +- if (!opt) { +- pr_err("kgdboc: config string not provided\n"); +- return -EINVAL; +- } +- +- if (strlen(opt) >= MAX_CONFIG_LEN) { +- printk(KERN_ERR "kgdboc: config string too long\n"); +- return -ENOSPC; +- } +- strcpy(config, opt); +- +- return 0; +-} +- +-__setup("kgdboc=", kgdboc_option_setup); +- + static void cleanup_kgdboc(void) + { + if (kgdb_unregister_nmi_console()) +@@ -316,6 +298,25 @@ static struct kgdb_io kgdboc_io_ops = { + }; + + #ifdef CONFIG_KGDB_SERIAL_CONSOLE ++static int kgdboc_option_setup(char *opt) ++{ ++ if (!opt) { ++ pr_err("config string not provided\n"); ++ return -EINVAL; ++ } ++ ++ if (strlen(opt) >= MAX_CONFIG_LEN) { ++ pr_err("config string too long\n"); ++ return -ENOSPC; ++ } ++ strcpy(config, opt); ++ ++ return 0; ++} ++ ++__setup("kgdboc=", kgdboc_option_setup); ++ ++ + /* This is only available if kgdboc is a built in for early debugging */ + static int __init kgdboc_early_init(char *opt) + { diff --git a/queue-3.18/mm-cleancache-fix-corruption-on-missed-inode-invalidation.patch b/queue-3.18/mm-cleancache-fix-corruption-on-missed-inode-invalidation.patch new file mode 100644 index 00000000000..35479ab054f --- /dev/null +++ b/queue-3.18/mm-cleancache-fix-corruption-on-missed-inode-invalidation.patch @@ -0,0 +1,74 @@ +From 6ff38bd40230af35e446239396e5fc8ebd6a5248 Mon Sep 17 00:00:00 2001 +From: Pavel Tikhomirov +Date: Fri, 30 Nov 2018 14:09:00 -0800 +Subject: mm: cleancache: fix corruption on missed inode invalidation + +From: Pavel Tikhomirov + +commit 6ff38bd40230af35e446239396e5fc8ebd6a5248 upstream. + +If all pages are deleted from the mapping by memory reclaim and also +moved to the cleancache: + +__delete_from_page_cache + (no shadow case) + unaccount_page_cache_page + cleancache_put_page + page_cache_delete + mapping->nrpages -= nr + (nrpages becomes 0) + +We don't clean the cleancache for an inode after final file truncation +(removal). + +truncate_inode_pages_final + check (nrpages || nrexceptional) is false + no truncate_inode_pages + no cleancache_invalidate_inode(mapping) + +These way when reading the new file created with same inode we may get +these trash leftover pages from cleancache and see wrong data instead of +the contents of the new file. + +Fix it by always doing truncate_inode_pages which is already ready for +nrpages == 0 && nrexceptional == 0 case and just invalidates inode. + +[akpm@linux-foundation.org: add comment, per Jan] +Link: http://lkml.kernel.org/r/20181112095734.17979-1-ptikhomirov@virtuozzo.com +Fixes: commit 91b0abe36a7b ("mm + fs: store shadow entries in page cache") +Signed-off-by: Pavel Tikhomirov +Reviewed-by: Vasily Averin +Reviewed-by: Andrey Ryabinin +Reviewed-by: Jan Kara +Cc: Johannes Weiner +Cc: Mel Gorman +Cc: Matthew Wilcox +Cc: Andi Kleen +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Vasily Averin +Signed-off-by: Greg Kroah-Hartman + +--- + mm/truncate.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/mm/truncate.c ++++ b/mm/truncate.c +@@ -457,9 +457,13 @@ void truncate_inode_pages_final(struct a + */ + spin_lock_irq(&mapping->tree_lock); + spin_unlock_irq(&mapping->tree_lock); +- +- truncate_inode_pages(mapping, 0); + } ++ ++ /* ++ * Cleancache needs notification even if there are no pages or shadow ++ * entries. ++ */ ++ truncate_inode_pages(mapping, 0); + } + EXPORT_SYMBOL(truncate_inode_pages_final); + diff --git a/queue-3.18/series b/queue-3.18/series index ca0bed605e1..3a4fb3230d3 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -27,3 +27,6 @@ scsi-scsi_devinfo-cleanly-zero-pad-devinfo-strings.patch alsa-trident-suppress-gcc-string-warning.patch scsi-csiostor-avoid-content-leaks-and-casts.patch kgdboc-fix-restrict-error.patch +kgdboc-fix-warning-with-module-build.patch +input-xpad-quirk-all-pdp-xbox-one-gamepads.patch +mm-cleancache-fix-corruption-on-missed-inode-invalidation.patch