From: Greg Kroah-Hartman Date: Wed, 3 May 2017 22:42:21 +0000 (-0700) Subject: 4.4-stable patches X-Git-Tag: v3.18.52~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd2fe886c6342c9f1f02701c8f6be66e4115eff8;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch drbd-avoid-redefinition-of-bits_per_page.patch mtd-avoid-stack-overflow-in-mtd-cfi-code.patch net-tg3-avoid-uninitialized-variable-warning.patch --- diff --git a/queue-4.4/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch b/queue-4.4/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch new file mode 100644 index 00000000000..ff4f91b98bd --- /dev/null +++ b/queue-4.4/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch @@ -0,0 +1,37 @@ +From b268c34e5ee92a4cc3099b0caaf26e6bfbdf0f18 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 4 Jul 2016 17:07:45 +0200 +Subject: ALSA: ppc/awacs: shut up maybe-uninitialized warning + +From: Arnd Bergmann + +commit b268c34e5ee92a4cc3099b0caaf26e6bfbdf0f18 upstream. + +The awacs sound driver produces a false-positive warning in ppc64_defconfig: + +sound/ppc/awacs.c: In function 'snd_pmac_awacs_init': +include/sound/control.h:219:9: warning: 'master_vol' may be used uninitialized in this function [-Wmaybe-uninitialized] + +I haven't come up with a good way to rewrite the code to avoid the +warning, so here is a bad one: I initialize the variable before +the conditionall initialization so gcc no longer has to worry about +it. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/ppc/awacs.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/ppc/awacs.c ++++ b/sound/ppc/awacs.c +@@ -991,6 +991,7 @@ snd_pmac_awacs_init(struct snd_pmac *chi + if (err < 0) + return err; + } ++ master_vol = NULL; + if (pm7500) + err = build_mixers(chip, + ARRAY_SIZE(snd_pmac_awacs_mixers_pmac7500), diff --git a/queue-4.4/drbd-avoid-redefinition-of-bits_per_page.patch b/queue-4.4/drbd-avoid-redefinition-of-bits_per_page.patch new file mode 100644 index 00000000000..8ac17d92cbd --- /dev/null +++ b/queue-4.4/drbd-avoid-redefinition-of-bits_per_page.patch @@ -0,0 +1,42 @@ +From 2630628b2dbc3fc320aafaf84836119e4e3d62f1 Mon Sep 17 00:00:00 2001 +From: Lars Ellenberg +Date: Fri, 20 Mar 2015 15:47:22 +0100 +Subject: drbd: avoid redefinition of BITS_PER_PAGE + +From: Lars Ellenberg + +commit 2630628b2dbc3fc320aafaf84836119e4e3d62f1 upstream. + +Apparently we now implicitly get definitions for BITS_PER_PAGE and +BITS_PER_PAGE_MASK from the pid_namespace.h + +Instead of renaming our defines, I chose to define only if not yet +defined, but to double check the value if already defined. + +Signed-off-by: Philipp Reisner +Signed-off-by: Lars Ellenberg +Signed-off-by: Jens Axboe +Cc: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/drbd/drbd_bitmap.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/block/drbd/drbd_bitmap.c ++++ b/drivers/block/drbd/drbd_bitmap.c +@@ -479,8 +479,14 @@ void drbd_bm_cleanup(struct drbd_device + * this masks out the remaining bits. + * Returns the number of bits cleared. + */ ++#ifndef BITS_PER_PAGE + #define BITS_PER_PAGE (1UL << (PAGE_SHIFT + 3)) + #define BITS_PER_PAGE_MASK (BITS_PER_PAGE - 1) ++#else ++# if BITS_PER_PAGE != (1UL << (PAGE_SHIFT + 3)) ++# error "ambiguous BITS_PER_PAGE" ++# endif ++#endif + #define BITS_PER_LONG_MASK (BITS_PER_LONG - 1) + static int bm_clear_surplus(struct drbd_bitmap *b) + { diff --git a/queue-4.4/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch b/queue-4.4/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch new file mode 100644 index 00000000000..fc2445a725d --- /dev/null +++ b/queue-4.4/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch @@ -0,0 +1,81 @@ +From fddcca5107051adf9e4481d2a79ae0616577fd2c Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 29 Feb 2016 13:20:28 +0100 +Subject: mtd: avoid stack overflow in MTD CFI code + +From: Arnd Bergmann + +commit fddcca5107051adf9e4481d2a79ae0616577fd2c upstream. + +When map_word gets too large, we use a lot of kernel stack, and for +MTD_MAP_BANK_WIDTH_32, this means we use more than the recommended +1024 bytes in a number of functions: + +drivers/mtd/chips/cfi_cmdset_0020.c: In function 'cfi_staa_write_buffers': +drivers/mtd/chips/cfi_cmdset_0020.c:651:1: warning: the frame size of 1336 bytes is larger than 1024 bytes [-Wframe-larger-than=] +drivers/mtd/chips/cfi_cmdset_0020.c: In function 'cfi_staa_erase_varsize': +drivers/mtd/chips/cfi_cmdset_0020.c:972:1: warning: the frame size of 1208 bytes is larger than 1024 bytes [-Wframe-larger-than=] +drivers/mtd/chips/cfi_cmdset_0001.c: In function 'do_write_buffer': +drivers/mtd/chips/cfi_cmdset_0001.c:1835:1: warning: the frame size of 1240 bytes is larger than 1024 bytes [-Wframe-larger-than=] + +This can be avoided if all operations on the map word are done +indirectly and the stack gets reused between the calls. We can +mostly achieve this by selecting MTD_COMPLEX_MAPPINGS whenever +MTD_MAP_BANK_WIDTH_32 is set, but for the case that no other +bank width is enabled, we also need to use a non-constant +map_bankwidth() to convince the compiler to use less stack. + +Signed-off-by: Arnd Bergmann +[Brian: this patch mostly achieves its goal by forcing + MTD_COMPLEX_MAPPINGS (and the accompanying indirection) for 256-bit + mappings; the rest of the change is mostly a wash, though it helps + reduce stack size slightly. If we really care about supporting + 256-bit mappings though, we should consider rewriting some of this + code to avoid keeping and assigning so many 256-bit objects on the + stack.] +Signed-off-by: Brian Norris +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/chips/Kconfig | 1 + + include/linux/mtd/map.h | 19 +++++++------------ + 2 files changed, 8 insertions(+), 12 deletions(-) + +--- a/drivers/mtd/chips/Kconfig ++++ b/drivers/mtd/chips/Kconfig +@@ -111,6 +111,7 @@ config MTD_MAP_BANK_WIDTH_16 + + config MTD_MAP_BANK_WIDTH_32 + bool "Support 256-bit buswidth" if MTD_CFI_GEOMETRY ++ select MTD_COMPLEX_MAPPINGS if HAS_IOMEM + default n + help + If you wish to support CFI devices on a physical bus which is +--- a/include/linux/mtd/map.h ++++ b/include/linux/mtd/map.h +@@ -122,18 +122,13 @@ + #endif + + #ifdef CONFIG_MTD_MAP_BANK_WIDTH_32 +-# ifdef map_bankwidth +-# undef map_bankwidth +-# define map_bankwidth(map) ((map)->bankwidth) +-# undef map_bankwidth_is_large +-# define map_bankwidth_is_large(map) (map_bankwidth(map) > BITS_PER_LONG/8) +-# undef map_words +-# define map_words(map) map_calc_words(map) +-# else +-# define map_bankwidth(map) 32 +-# define map_bankwidth_is_large(map) (1) +-# define map_words(map) map_calc_words(map) +-# endif ++/* always use indirect access for 256-bit to preserve kernel stack */ ++# undef map_bankwidth ++# define map_bankwidth(map) ((map)->bankwidth) ++# undef map_bankwidth_is_large ++# define map_bankwidth_is_large(map) (map_bankwidth(map) > BITS_PER_LONG/8) ++# undef map_words ++# define map_words(map) map_calc_words(map) + #define map_bankwidth_is_32(map) (map_bankwidth(map) == 32) + #undef MAX_MAP_BANKWIDTH + #define MAX_MAP_BANKWIDTH 32 diff --git a/queue-4.4/net-tg3-avoid-uninitialized-variable-warning.patch b/queue-4.4/net-tg3-avoid-uninitialized-variable-warning.patch new file mode 100644 index 00000000000..de8d627a784 --- /dev/null +++ b/queue-4.4/net-tg3-avoid-uninitialized-variable-warning.patch @@ -0,0 +1,38 @@ +From e434e04110704eb91acfecbd0fb8ca8e2da9c29b Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 29 Jan 2016 12:39:15 +0100 +Subject: net: tg3: avoid uninitialized variable warning + +From: Arnd Bergmann + +commit e434e04110704eb91acfecbd0fb8ca8e2da9c29b upstream. + +The tg3_set_eeprom() function correctly initializes the 'start' variable, +but gcc generates a false warning: + +drivers/net/ethernet/broadcom/tg3.c: In function 'tg3_set_eeprom': +drivers/net/ethernet/broadcom/tg3.c:12057:4: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized] + +I have not come up with a way to restructure the code in a way that +avoids the warning without making it less readable, so this adds an +initialization for the declaration to shut up that warning. + +Signed-off-by: Arnd Bergmann +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/broadcom/tg3.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/tg3.c ++++ b/drivers/net/ethernet/broadcom/tg3.c +@@ -12031,7 +12031,7 @@ static int tg3_set_eeprom(struct net_dev + int ret; + u32 offset, len, b_offset, odd_len; + u8 *buf; +- __be32 start, end; ++ __be32 start = 0, end; + + if (tg3_flag(tp, NO_NVRAM) || + eeprom->magic != TG3_EEPROM_MAGIC) diff --git a/queue-4.4/series b/queue-4.4/series index e21d2514cd6..fa2c902c341 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -1,3 +1,7 @@ timerfd-protect-the-might-cancel-mechanism-proper.patch handle-mismatched-open-calls.patch asoc-intel-fix-pm-and-non-atomic-crash-in-bytcr-drivers.patch +alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch +drbd-avoid-redefinition-of-bits_per_page.patch +mtd-avoid-stack-overflow-in-mtd-cfi-code.patch +net-tg3-avoid-uninitialized-variable-warning.patch