From 830c21a1c9babac0db0ce571d5d25fc48c396519 Mon Sep 17 00:00:00 2001 From: Fabian Date: Sun, 15 Sep 2013 14:07:50 +0000 Subject: [PATCH] patched 3.10 --- linux/0-timerlist.patch | 103 ++++++++++++++++++++++++++++++++++++++++ linux/1-mac80211.patch | 28 +++++++++++ linux/2-mac80211.patch | 91 +++++++++++++++++++++++++++++++++++ linux/PKGBUILD | 20 ++++++-- 4 files changed, 239 insertions(+), 3 deletions(-) create mode 100644 linux/0-timerlist.patch create mode 100644 linux/1-mac80211.patch create mode 100644 linux/2-mac80211.patch diff --git a/linux/0-timerlist.patch b/linux/0-timerlist.patch new file mode 100644 index 000000000..6b327ccfb --- /dev/null +++ b/linux/0-timerlist.patch @@ -0,0 +1,103 @@ +From b3772c81e3490f1ddc0547ee479598f3f4221699 Mon Sep 17 00:00:00 2001 +From: Nathan Zimmer +Date: Wed, 28 Aug 2013 23:35:14 +0000 +Subject: timer_list: correct the iterator for timer_list + +commit 84a78a6504f5c5394a8e558702e5b54131f01d14 upstream. + +Correct an issue with /proc/timer_list reported by Holger. + +When reading from the proc file with a sufficiently small buffer, 2k so +not really that small, there was one could get hung trying to read the +file a chunk at a time. + +The timer_list_start function failed to account for the possibility that +the offset was adjusted outside the timer_list_next. + +Signed-off-by: Nathan Zimmer +Reported-by: Holger Hans Peter Freyther +Cc: John Stultz +Cc: Thomas Gleixner +Cc: Berke Durak +Cc: Jeff Layton +Tested-by: Al Viro +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- +diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c +index 3bdf283..61ed862 100644 +--- a/kernel/time/timer_list.c ++++ b/kernel/time/timer_list.c +@@ -265,10 +265,9 @@ static inline void timer_list_header(struct seq_file *m, u64 now) + static int timer_list_show(struct seq_file *m, void *v) + { + struct timer_list_iter *iter = v; +- u64 now = ktime_to_ns(ktime_get()); + + if (iter->cpu == -1 && !iter->second_pass) +- timer_list_header(m, now); ++ timer_list_header(m, iter->now); + else if (!iter->second_pass) + print_cpu(m, iter->cpu, iter->now); + #ifdef CONFIG_GENERIC_CLOCKEVENTS +@@ -298,33 +297,41 @@ void sysrq_timer_list_show(void) + return; + } + +-static void *timer_list_start(struct seq_file *file, loff_t *offset) ++static void *move_iter(struct timer_list_iter *iter, loff_t offset) + { +- struct timer_list_iter *iter = file->private; +- +- if (!*offset) { +- iter->cpu = -1; +- iter->now = ktime_to_ns(ktime_get()); +- } else if (iter->cpu >= nr_cpu_ids) { ++ for (; offset; offset--) { ++ iter->cpu = cpumask_next(iter->cpu, cpu_online_mask); ++ if (iter->cpu >= nr_cpu_ids) { + #ifdef CONFIG_GENERIC_CLOCKEVENTS +- if (!iter->second_pass) { +- iter->cpu = -1; +- iter->second_pass = true; +- } else +- return NULL; ++ if (!iter->second_pass) { ++ iter->cpu = -1; ++ iter->second_pass = true; ++ } else ++ return NULL; + #else +- return NULL; ++ return NULL; + #endif ++ } + } + return iter; + } + ++static void *timer_list_start(struct seq_file *file, loff_t *offset) ++{ ++ struct timer_list_iter *iter = file->private; ++ ++ if (!*offset) ++ iter->now = ktime_to_ns(ktime_get()); ++ iter->cpu = -1; ++ iter->second_pass = false; ++ return move_iter(iter, *offset); ++} ++ + static void *timer_list_next(struct seq_file *file, void *v, loff_t *offset) + { + struct timer_list_iter *iter = file->private; +- iter->cpu = cpumask_next(iter->cpu, cpu_online_mask); + ++*offset; +- return timer_list_start(file, offset); ++ return move_iter(iter, 1); + } + + static void timer_list_stop(struct seq_file *seq, void *v) +-- +cgit v0.9.2 diff --git a/linux/1-mac80211.patch b/linux/1-mac80211.patch new file mode 100644 index 000000000..e1f9bb45a --- /dev/null +++ b/linux/1-mac80211.patch @@ -0,0 +1,28 @@ +From 543037a3023b41ce13e98f62e1f3c2c591e00c5c Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Tue, 20 Aug 2013 09:28:50 +0000 +Subject: mac80211: add missing channel context release + +commit 2a3ba63c235fdcd37f6451bdf4a0c7865a3930cf upstream. + +IBSS needs to release the channel context when leaving +but I evidently missed that. Fix it. + +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- +diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c +index 170f9a7..3052672 100644 +--- a/net/mac80211/ibss.c ++++ b/net/mac80211/ibss.c +@@ -1166,6 +1166,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata) + clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state); + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED | + BSS_CHANGED_IBSS); ++ ieee80211_vif_release_channel(sdata); + synchronize_rcu(); + kfree(presp); + +-- +cgit v0.9.2 diff --git a/linux/2-mac80211.patch b/linux/2-mac80211.patch new file mode 100644 index 000000000..dfe8817c7 --- /dev/null +++ b/linux/2-mac80211.patch @@ -0,0 +1,91 @@ +From 9ddc34b565615be1ffd267ffd8c826d9ef097179 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Tue, 20 Aug 2013 17:43:54 +0000 +Subject: mac80211: add a flag to indicate CCK support for HT clients + +commit 2dfca312a91631311c1cf7c090246cc8103de038 upstream. + +brcm80211 cannot handle sending frames with CCK rates as part of an +A-MPDU session. Other drivers may have issues too. Set the flag in all +drivers that have been tested with CCK rates. + +This fixes a reported brcmsmac regression introduced in +commit ef47a5e4f1aaf1d0e2e6875e34b2c9595897bef6 +"mac80211/minstrel_ht: fix cck rate sampling" + +Reported-by: Tom Gundersen +Signed-off-by: Felix Fietkau +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- +diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c +index 2ba4945..bd126c2 100644 +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -767,7 +767,8 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) + IEEE80211_HW_PS_NULLFUNC_STACK | + IEEE80211_HW_SPECTRUM_MGMT | + IEEE80211_HW_REPORTS_TX_ACK_STATUS | +- IEEE80211_HW_SUPPORTS_RC_TABLE; ++ IEEE80211_HW_SUPPORTS_RC_TABLE | ++ IEEE80211_HW_SUPPORTS_HT_CCK_RATES; + + if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) + hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION; +diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c +index e9010a4..0686375 100644 +--- a/drivers/net/wireless/ath/carl9170/main.c ++++ b/drivers/net/wireless/ath/carl9170/main.c +@@ -1857,7 +1857,8 @@ void *carl9170_alloc(size_t priv_size) + IEEE80211_HW_SUPPORTS_PS | + IEEE80211_HW_PS_NULLFUNC_STACK | + IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC | +- IEEE80211_HW_SIGNAL_DBM; ++ IEEE80211_HW_SIGNAL_DBM | ++ IEEE80211_HW_SUPPORTS_HT_CCK_RATES; + + if (!modparam_noht) { + /* +diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c +index 705aa33..7e66a90 100644 +--- a/drivers/net/wireless/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c +@@ -5912,7 +5912,8 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) + IEEE80211_HW_SUPPORTS_PS | + IEEE80211_HW_PS_NULLFUNC_STACK | + IEEE80211_HW_AMPDU_AGGREGATION | +- IEEE80211_HW_REPORTS_TX_ACK_STATUS; ++ IEEE80211_HW_REPORTS_TX_ACK_STATUS | ++ IEEE80211_HW_SUPPORTS_HT_CCK_RATES; + + /* + * Don't set IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING for USB devices +diff --git a/include/net/mac80211.h b/include/net/mac80211.h +index 885898a..4e50d36 100644 +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -1484,6 +1484,7 @@ enum ieee80211_hw_flags { + IEEE80211_HW_SUPPORTS_RC_TABLE = 1<<24, + IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, + IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, ++ IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 1<<27, + }; + + /** +diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c +index f5aed96..f3bbea1 100644 +--- a/net/mac80211/rc80211_minstrel_ht.c ++++ b/net/mac80211/rc80211_minstrel_ht.c +@@ -828,6 +828,9 @@ minstrel_ht_update_cck(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, + if (sband->band != IEEE80211_BAND_2GHZ) + return; + ++ if (!(mp->hw->flags & IEEE80211_HW_SUPPORTS_HT_CCK_RATES)) ++ return; ++ + mi->cck_supported = 0; + mi->cck_supported_short = 0; + for (i = 0; i < 4; i++) { +-- +cgit v0.9.2 diff --git a/linux/PKGBUILD b/linux/PKGBUILD index e0a6b02a7..bf4a88830 100644 --- a/linux/PKGBUILD +++ b/linux/PKGBUILD @@ -8,7 +8,7 @@ pkgname=('linux' 'linux-headers' 'linux-docs') _kernelname=${pkgname#linux} _basekernel=3.10 pkgver=3.10.10 -pkgrel=1 +pkgrel=2 arch=('x86_64') url="http://www.kernel.org/" license=('GPL2') @@ -26,6 +26,9 @@ source=("http://www.kernel.org/pub/linux/kernel/v3.x/linux-${_basekernel}.tar.xz 'aufs3-kbuild.patch' 'aufs3.patch' 'config.aufs' + '0-timerlist.patch' + '1-mac80211.patch' + '2-mac80211.patch' # standard config files for mkinitcpio ramdisk 'linux.preset' 'change-default-console-loglevel.patch') @@ -39,6 +42,9 @@ sha256sums=('df27fa92d27a9c410bfe6c4a89f141638500d7eadcca5cce578954efc2ad3544' '3ef474c102a1fcc596d92c5d370c60845c789012efd41b4961b557ec3d6a88b1' '8a659bb6ad5aaf1f009da585b91b1ecf83e6fb960326bef8cef8cf93cb8a4ca9' 'b1b1cf291bd68270b700eb21f19f7b052116d07dde492761227cd94bb775910c' + '792b25d4448a5161b86228ac581049611889158c283b21b5bf81e39938c0aaaf' + '279783758480f0f14348a12e60dd1c4b9913f132f9a0c5dc414e1ffb5ad9799e' + 'cbcf0018914a9f34efabf4ab3c8d9ad8ccd3836bcd6fc99c0080cee341972ffa' 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c' '2fc60ad91d7afe5b1e7c7a0cac7555a2dddf2b9fc1f7a044e211904991e10e83') @@ -67,6 +73,12 @@ build() { patch -p1 -i "${srcdir}/aufs3-loopback.patch" patch -p1 -i "${srcdir}/aufs3-proc_map.patch" patch -p1 -i "${srcdir}/aufs3-standalone.patch" + + # apply some further patches; only for 3.10.10 + # WARNING: remove when new kernel gets released + patch -p1 -i "${srcdir}/0-timerlist.patch" + patch -p1 -i "${srcdir}/1-mac80211.patch" + patch -p1 -i "${srcdir}/2-mac80211.patch" cat "${srcdir}/config.x86_64" > ./.config @@ -76,8 +88,10 @@ build() { sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config fi - # set extraversion to pkgrel - sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile + # set extraversion to pkgrel FIXME: let's try to break less stuff by NOT incrementing it this time + # sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile + _todo='1' + sed -ri "s|^(EXTRAVERSION =).*|\1 -${_todo}|" Makefile # get kernel version make prepare