All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "ath10k: fix peer limit enforcement" has been added to the 4.2-stable tree
@ 2015-10-17 22:04 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-10-17 22:04 UTC (permalink / raw)
  To: michal.kazior, gregkh, kvalo; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    ath10k: fix peer limit enforcement

to the 4.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ath10k-fix-peer-limit-enforcement.patch
and it can be found in the queue-4.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From e04cafbc38c70af2aad3810ce24ab0eba8114779 Mon Sep 17 00:00:00 2001
From: Michal Kazior <michal.kazior@tieto.com>
Date: Wed, 5 Aug 2015 12:15:24 +0200
Subject: ath10k: fix peer limit enforcement

From: Michal Kazior <michal.kazior@tieto.com>

commit e04cafbc38c70af2aad3810ce24ab0eba8114779 upstream.

Firmware peer entries are involved in internal
firmware vdev structures. This was not accounted
for and could lead firmware to crash due to asking
it to do more than it could.

Fixes: 039a0051ec1a ("ath10k: allocate fw resources for iface combinations")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/ath10k/mac.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -591,11 +591,19 @@ ath10k_mac_get_any_chandef_iter(struct i
 static int ath10k_peer_create(struct ath10k *ar, u32 vdev_id, const u8 *addr,
 			      enum wmi_peer_type peer_type)
 {
+	struct ath10k_vif *arvif;
+	int num_peers = 0;
 	int ret;
 
 	lockdep_assert_held(&ar->conf_mutex);
 
-	if (ar->num_peers >= ar->max_num_peers)
+	num_peers = ar->num_peers;
+
+	/* Each vdev consumes a peer entry as well */
+	list_for_each_entry(arvif, &ar->arvifs, list)
+		num_peers++;
+
+	if (num_peers >= ar->max_num_peers)
 		return -ENOBUFS;
 
 	ret = ath10k_wmi_peer_create(ar, vdev_id, addr, peer_type);
@@ -4061,6 +4069,11 @@ static int ath10k_add_interface(struct i
 		       sizeof(arvif->bitrate_mask.control[i].vht_mcs));
 	}
 
+	if (ar->num_peers >= ar->max_num_peers) {
+		ath10k_warn(ar, "refusing vdev creation due to insufficient peer entry resources in firmware\n");
+		return -ENOBUFS;
+	}
+
 	if (ar->free_vdev_map == 0) {
 		ath10k_warn(ar, "Free vdev map is empty, no more interfaces allowed.\n");
 		ret = -EBUSY;


Patches currently in stable-queue which might be from michal.kazior@tieto.com are

queue-4.2/ath10k-fix-dma_mapping_error-handling.patch
queue-4.2/ath10k-wake-up-queue-upon-vif-creation.patch
queue-4.2/ath10k-fix-peer-limit-enforcement.patch
queue-4.2/ath10k-reject-11b-tx-fragmentation-configuration.patch
queue-4.2/ath10k-fix-per-vif-queue-locking.patch
queue-4.2/ath10k-wake-up-offchannel-queue-properly.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-17 22:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-17 22:04 Patch "ath10k: fix peer limit enforcement" has been added to the 4.2-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.