]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 May 2016 18:12:42 +0000 (14:12 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 May 2016 18:12:42 +0000 (14:12 -0400)
added patches:
ath9k-ar5008_hw_cmn_spur_mitigate-add-missing-mask_m-mask_p-initialisation.patch
mac80211-fix-statistics-leak-if-dev_alloc_name-fails.patch
md-make-bio-mergeable.patch
minimal-fix-up-of-bad-hashing-behavior-of-hash_64.patch
tracing-don-t-display-trigger-file-for-events-that-can-t-be-enabled.patch

queue-4.4/ath9k-ar5008_hw_cmn_spur_mitigate-add-missing-mask_m-mask_p-initialisation.patch [new file with mode: 0644]
queue-4.4/mac80211-fix-statistics-leak-if-dev_alloc_name-fails.patch [new file with mode: 0644]
queue-4.4/md-make-bio-mergeable.patch [new file with mode: 0644]
queue-4.4/minimal-fix-up-of-bad-hashing-behavior-of-hash_64.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/tracing-don-t-display-trigger-file-for-events-that-can-t-be-enabled.patch [new file with mode: 0644]

diff --git a/queue-4.4/ath9k-ar5008_hw_cmn_spur_mitigate-add-missing-mask_m-mask_p-initialisation.patch b/queue-4.4/ath9k-ar5008_hw_cmn_spur_mitigate-add-missing-mask_m-mask_p-initialisation.patch
new file mode 100644 (file)
index 0000000..36356b6
--- /dev/null
@@ -0,0 +1,69 @@
+From de478a61389cacafe94dc8b035081b681b878f9d Mon Sep 17 00:00:00 2001
+From: Oleksij Rempel <linux@rempel-privat.de>
+Date: Tue, 12 Apr 2016 19:37:44 +0200
+Subject: ath9k: ar5008_hw_cmn_spur_mitigate: add missing mask_m & mask_p initialisation
+
+From: Oleksij Rempel <linux@rempel-privat.de>
+
+commit de478a61389cacafe94dc8b035081b681b878f9d upstream.
+
+by moving common code to ar5008_hw_cmn_spur_mitigate i forgot to move
+mask_m & mask_p initialisation. This coused a performance regression
+on ar9281.
+
+Fixes: f911085ffa88 ("ath9k: split ar5008_hw_spur_mitigate and reuse common code in ar9002_hw_spur_mitigate.")
+Reported-by: Gustav Frederiksen <lkml2017@openmailbox.org>
+Tested-by: Gustav Frederiksen <lkml2017@openmailbox.org>
+Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/ath/ath9k/ar5008_phy.c |    8 +++-----
+ drivers/net/wireless/ath/ath9k/ar9002_phy.c |    5 -----
+ 2 files changed, 3 insertions(+), 10 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
++++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+@@ -274,6 +274,9 @@ void ar5008_hw_cmn_spur_mitigate(struct
+       };
+       static const int inc[4] = { 0, 100, 0, 0 };
++      memset(&mask_m, 0, sizeof(int8_t) * 123);
++      memset(&mask_p, 0, sizeof(int8_t) * 123);
++
+       cur_bin = -6000;
+       upper = bin + 100;
+       lower = bin - 100;
+@@ -424,14 +427,9 @@ static void ar5008_hw_spur_mitigate(stru
+       int tmp, new;
+       int i;
+-      int8_t mask_m[123];
+-      int8_t mask_p[123];
+       int cur_bb_spur;
+       bool is2GHz = IS_CHAN_2GHZ(chan);
+-      memset(&mask_m, 0, sizeof(int8_t) * 123);
+-      memset(&mask_p, 0, sizeof(int8_t) * 123);
+-
+       for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
+               cur_bb_spur = ah->eep_ops->get_spur_channel(ah, i, is2GHz);
+               if (AR_NO_SPUR == cur_bb_spur)
+--- a/drivers/net/wireless/ath/ath9k/ar9002_phy.c
++++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.c
+@@ -178,14 +178,9 @@ static void ar9002_hw_spur_mitigate(stru
+       int i;
+       struct chan_centers centers;
+-      int8_t mask_m[123];
+-      int8_t mask_p[123];
+       int cur_bb_spur;
+       bool is2GHz = IS_CHAN_2GHZ(chan);
+-      memset(&mask_m, 0, sizeof(int8_t) * 123);
+-      memset(&mask_p, 0, sizeof(int8_t) * 123);
+-
+       ath9k_hw_get_channel_centers(ah, chan, &centers);
+       freq = centers.synth_center;
diff --git a/queue-4.4/mac80211-fix-statistics-leak-if-dev_alloc_name-fails.patch b/queue-4.4/mac80211-fix-statistics-leak-if-dev_alloc_name-fails.patch
new file mode 100644 (file)
index 0000000..52c2512
--- /dev/null
@@ -0,0 +1,41 @@
+From e6436be21e77e3659b4ff7e357ab5a8342d132d2 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Tue, 26 Apr 2016 13:47:08 +0200
+Subject: mac80211: fix statistics leak if dev_alloc_name() fails
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+commit e6436be21e77e3659b4ff7e357ab5a8342d132d2 upstream.
+
+In the case that dev_alloc_name() fails, e.g. because the name was
+given by the user and already exists, we need to clean up properly
+and free the per-CPU statistics. Fix that.
+
+Fixes: 5a490510ba5f ("mac80211: use per-CPU TX/RX statistics")
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/mac80211/iface.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/mac80211/iface.c
++++ b/net/mac80211/iface.c
+@@ -1750,7 +1750,7 @@ int ieee80211_if_add(struct ieee80211_lo
+               ret = dev_alloc_name(ndev, ndev->name);
+               if (ret < 0) {
+-                      free_netdev(ndev);
++                      ieee80211_if_free(ndev);
+                       return ret;
+               }
+@@ -1836,7 +1836,7 @@ int ieee80211_if_add(struct ieee80211_lo
+               ret = register_netdevice(ndev);
+               if (ret) {
+-                      free_netdev(ndev);
++                      ieee80211_if_free(ndev);
+                       return ret;
+               }
+       }
diff --git a/queue-4.4/md-make-bio-mergeable.patch b/queue-4.4/md-make-bio-mergeable.patch
new file mode 100644 (file)
index 0000000..de7677f
--- /dev/null
@@ -0,0 +1,39 @@
+From 9c573de3283af007ea11c17bde1e4568d9417328 Mon Sep 17 00:00:00 2001
+From: Shaohua Li <shli@fb.com>
+Date: Mon, 25 Apr 2016 16:52:38 -0700
+Subject: MD: make bio mergeable
+
+From: Shaohua Li <shli@fb.com>
+
+commit 9c573de3283af007ea11c17bde1e4568d9417328 upstream.
+
+blk_queue_split marks bio unmergeable, which makes sense for normal bio.
+But if dispatching the bio to underlayer disk, the blk_queue_split
+checks are invalid, hence it's possible the bio becomes mergeable.
+
+In the reported bug, this bug causes trim against raid0 performance slash
+https://bugzilla.kernel.org/show_bug.cgi?id=117051
+
+Reported-and-tested-by: Park Ju Hyung <qkrwngud825@gmail.com>
+Fixes: 6ac45aeb6bca(block: avoid to merge splitted bio)
+Cc: Ming Lei <ming.lei@canonical.com>
+Cc: Neil Brown <neilb@suse.de>
+Reviewed-by: Jens Axboe <axboe@fb.com>
+Signed-off-by: Shaohua Li <shli@fb.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/md/md.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/md/md.c
++++ b/drivers/md/md.c
+@@ -293,6 +293,8 @@ static blk_qc_t md_make_request(struct r
+        * go away inside make_request
+        */
+       sectors = bio_sectors(bio);
++      /* bio could be mergeable after passing to underlayer */
++      bio->bi_rw &= ~REQ_NOMERGE;
+       mddev->pers->make_request(mddev, bio);
+       cpu = part_stat_lock();
diff --git a/queue-4.4/minimal-fix-up-of-bad-hashing-behavior-of-hash_64.patch b/queue-4.4/minimal-fix-up-of-bad-hashing-behavior-of-hash_64.patch
new file mode 100644 (file)
index 0000000..50c1b7b
--- /dev/null
@@ -0,0 +1,76 @@
+From 689de1d6ca95b3b5bd8ee446863bf81a4883ea25 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Mon, 2 May 2016 12:46:42 -0700
+Subject: Minimal fix-up of bad hashing behavior of hash_64()
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit 689de1d6ca95b3b5bd8ee446863bf81a4883ea25 upstream.
+
+This is a fairly minimal fixup to the horribly bad behavior of hash_64()
+with certain input patterns.
+
+In particular, because the multiplicative value used for the 64-bit hash
+was intentionally bit-sparse (so that the multiply could be done with
+shifts and adds on architectures without hardware multipliers), some
+bits did not get spread out very much.  In particular, certain fairly
+common bit ranges in the input (roughly bits 12-20: commonly with the
+most information in them when you hash things like byte offsets in files
+or memory that have block factors that mean that the low bits are often
+zero) would not necessarily show up much in the result.
+
+There's a bigger patch-series brewing to fix up things more completely,
+but this is the fairly minimal fix for the 64-bit hashing problem.  It
+simply picks a much better constant multiplier, spreading the bits out a
+lot better.
+
+NOTE! For 32-bit architectures, the bad old hash_64() remains the same
+for now, since 64-bit multiplies are expensive.  The bigger hashing
+cleanup will replace the 32-bit case with something better.
+
+The new constants were picked by George Spelvin who wrote that bigger
+cleanup series.  I just picked out the constants and part of the comment
+from that series.
+
+Cc: George Spelvin <linux@horizon.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/hash.h |   20 ++++++++++++++++++--
+ 1 file changed, 18 insertions(+), 2 deletions(-)
+
+--- a/include/linux/hash.h
++++ b/include/linux/hash.h
+@@ -32,12 +32,28 @@
+ #error Wordsize not 32 or 64
+ #endif
++/*
++ * The above primes are actively bad for hashing, since they are
++ * too sparse. The 32-bit one is mostly ok, the 64-bit one causes
++ * real problems. Besides, the "prime" part is pointless for the
++ * multiplicative hash.
++ *
++ * Although a random odd number will do, it turns out that the golden
++ * ratio phi = (sqrt(5)-1)/2, or its negative, has particularly nice
++ * properties.
++ *
++ * These are the negative, (1 - phi) = (phi^2) = (3 - sqrt(5))/2.
++ * (See Knuth vol 3, section 6.4, exercise 9.)
++ */
++#define GOLDEN_RATIO_32 0x61C88647
++#define GOLDEN_RATIO_64 0x61C8864680B583EBull
++
+ static __always_inline u64 hash_64(u64 val, unsigned int bits)
+ {
+       u64 hash = val;
+-#if defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 64
+-      hash = hash * GOLDEN_RATIO_PRIME_64;
++#if BITS_PER_LONG == 64
++      hash = hash * GOLDEN_RATIO_64;
+ #else
+       /*  Sigh, gcc can't optimise this alone like it does for 32 bits. */
+       u64 n = hash;
index abc2cd40070e1c65f45fb4b80b01f3f706c2133f..1a6df08d3b7eafc16839f8596d587061be6101a8 100644 (file)
@@ -16,3 +16,8 @@ clk-qcom-msm8960-fix-ce3_core-clk-enable-register.patch
 clk-versatile-sp810-support-reentrance.patch
 clk-qcom-msm8960-fix-ce3_src-register-offset.patch
 lpfc-fix-misleading-indentation.patch
+ath9k-ar5008_hw_cmn_spur_mitigate-add-missing-mask_m-mask_p-initialisation.patch
+mac80211-fix-statistics-leak-if-dev_alloc_name-fails.patch
+tracing-don-t-display-trigger-file-for-events-that-can-t-be-enabled.patch
+md-make-bio-mergeable.patch
+minimal-fix-up-of-bad-hashing-behavior-of-hash_64.patch
diff --git a/queue-4.4/tracing-don-t-display-trigger-file-for-events-that-can-t-be-enabled.patch b/queue-4.4/tracing-don-t-display-trigger-file-for-events-that-can-t-be-enabled.patch
new file mode 100644 (file)
index 0000000..69b472f
--- /dev/null
@@ -0,0 +1,50 @@
+From 854145e0a8e9a05f7366d240e2f99d9c1ca6d6dd Mon Sep 17 00:00:00 2001
+From: Chunyu Hu <chuhu@redhat.com>
+Date: Tue, 3 May 2016 19:34:34 +0800
+Subject: tracing: Don't display trigger file for events that can't be enabled
+
+From: Chunyu Hu <chuhu@redhat.com>
+
+commit 854145e0a8e9a05f7366d240e2f99d9c1ca6d6dd upstream.
+
+Currently register functions for events will be called
+through the 'reg' field of event class directly without
+any check when seting up triggers.
+
+Triggers for events that don't support register through
+debug fs (events under events/ftrace are for trace-cmd to
+read event format, and most of them don't have a register
+function except events/ftrace/functionx) can't be enabled
+at all, and an oops will be hit when setting up trigger
+for those events, so just not creating them is an easy way
+to avoid the oops.
+
+Link: http://lkml.kernel.org/r/1462275274-3911-1-git-send-email-chuhu@redhat.com
+
+Fixes: 85f2b08268c01 ("tracing: Add basic event trigger framework")
+Signed-off-by: Chunyu Hu <chuhu@redhat.com>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/trace/trace_events.c |    9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/kernel/trace/trace_events.c
++++ b/kernel/trace/trace_events.c
+@@ -2107,8 +2107,13 @@ event_create_dir(struct dentry *parent,
+       trace_create_file("filter", 0644, file->dir, file,
+                         &ftrace_event_filter_fops);
+-      trace_create_file("trigger", 0644, file->dir, file,
+-                        &event_trigger_fops);
++      /*
++       * Only event directories that can be enabled should have
++       * triggers.
++       */
++      if (!(call->flags & TRACE_EVENT_FL_IGNORE_ENABLE))
++              trace_create_file("trigger", 0644, file->dir, file,
++                                &event_trigger_fops);
+       trace_create_file("format", 0444, file->dir, call,
+                         &ftrace_event_format_fops);