linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mt76: fix fix ampdu locking
@ 2019-11-20 20:05 Markus Theil
  2019-11-20 20:14 ` Felix Fietkau
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Markus Theil @ 2019-11-20 20:05 UTC (permalink / raw)
  To: nbd; +Cc: linux-wireless, Markus Theil

The current ampdu locking code does not unlock its mutex in the early
return case. This patch fixes it.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 drivers/net/wireless/mediatek/mt76/mt7603/main.c  | 6 ++++--
 drivers/net/wireless/mediatek/mt76/mt7615/main.c  | 6 ++++--
 drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 6 ++++--
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
index 281387c3f4f4..962e2822d19f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
@@ -569,6 +569,7 @@ mt7603_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	u16 ssn = params->ssn;
 	u8 ba_size = params->buf_size;
 	struct mt76_txq *mtxq;
+	int ret = 0;
 
 	if (!txq)
 		return -EINVAL;
@@ -597,7 +598,8 @@ mt7603_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		break;
 	case IEEE80211_AMPDU_TX_START:
 		mtxq->agg_ssn = IEEE80211_SN_TO_SEQ(ssn);
-		return IEEE80211_AMPDU_TX_START_IMMEDIATE;
+		ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
+		break;
 	case IEEE80211_AMPDU_TX_STOP_CONT:
 		mtxq->aggr = false;
 		mt7603_mac_tx_ba_reset(dev, msta->wcid.idx, tid, -1);
@@ -606,7 +608,7 @@ mt7603_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	}
 	mutex_unlock(&dev->mt76.mutex);
 
-	return 0;
+	return ret;
 }
 
 static void
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index 240dab919327..070b03403894 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -484,6 +484,7 @@ mt7615_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	u16 tid = params->tid;
 	u16 ssn = params->ssn;
 	struct mt76_txq *mtxq;
+	int ret = 0;
 
 	if (!txq)
 		return -EINVAL;
@@ -513,7 +514,8 @@ mt7615_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		break;
 	case IEEE80211_AMPDU_TX_START:
 		mtxq->agg_ssn = IEEE80211_SN_TO_SEQ(ssn);
-		return IEEE80211_AMPDU_TX_START_IMMEDIATE;
+		ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
+		break;
 	case IEEE80211_AMPDU_TX_STOP_CONT:
 		mtxq->aggr = false;
 		mt7615_mcu_set_tx_ba(dev, params, 0);
@@ -522,7 +524,7 @@ mt7615_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	}
 	mutex_unlock(&dev->mt76.mutex);
 
-	return 0;
+	return ret;
 }
 
 const struct ieee80211_ops mt7615_ops = {
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
index f58a3ebfa9d2..dac383ee8f4f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
@@ -356,6 +356,7 @@ int mt76x02_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	u16 tid = params->tid;
 	u16 ssn = params->ssn;
 	struct mt76_txq *mtxq;
+	int ret = 0;
 
 	if (!txq)
 		return -EINVAL;
@@ -385,7 +386,8 @@ int mt76x02_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		break;
 	case IEEE80211_AMPDU_TX_START:
 		mtxq->agg_ssn = IEEE80211_SN_TO_SEQ(ssn);
-		return IEEE80211_AMPDU_TX_START_IMMEDIATE;
+		ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
+		break;
 	case IEEE80211_AMPDU_TX_STOP_CONT:
 		mtxq->aggr = false;
 		ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
@@ -393,7 +395,7 @@ int mt76x02_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	}
 	mutex_unlock(&dev->mt76.mutex);
 
-	return 0;
+	return ret;
 }
 EXPORT_SYMBOL_GPL(mt76x02_ampdu_action);
 
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] mt76: fix fix ampdu locking
  2019-11-20 20:05 [PATCH] mt76: fix fix ampdu locking Markus Theil
@ 2019-11-20 20:14 ` Felix Fietkau
  2019-11-20 20:32   ` Markus Theil
  2019-11-21  6:53   ` Kalle Valo
  2019-11-21 18:34 ` [PATCH] mt76: " Kalle Valo
  2019-11-21 18:43 ` [PATCH] mt76: fix " Kalle Valo
  2 siblings, 2 replies; 7+ messages in thread
From: Felix Fietkau @ 2019-11-20 20:14 UTC (permalink / raw)
  To: Markus Theil; +Cc: linux-wireless, Kalle Valo

On 2019-11-20 21:05, Markus Theil wrote:
> The current ampdu locking code does not unlock its mutex in the early
> return case. This patch fixes it.
> 
> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Acked-by: Felix Fietkau <nbd@nbd.name>

Kalle, I think this should go on top of my pull request quickly, since
it fixes a regression in a commit from that pull request (introduced via
rebase on top of Johannes' last change of that code).
Do you want me to send another pull request with just this patch, or can
you take it directly? In the latter case, feel free to also remove one
of the two "fix" words in the subject :)

Thanks,

- Felix

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mt76: fix fix ampdu locking
  2019-11-20 20:14 ` Felix Fietkau
@ 2019-11-20 20:32   ` Markus Theil
  2019-11-21  6:53   ` Kalle Valo
  1 sibling, 0 replies; 7+ messages in thread
From: Markus Theil @ 2019-11-20 20:32 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, Kalle Valo


On 11/20/19 9:14 PM, Felix Fietkau wrote:
> On 2019-11-20 21:05, Markus Theil wrote:
>> The current ampdu locking code does not unlock its mutex in the early
>> return case. This patch fixes it.
>>
>> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
> Acked-by: Felix Fietkau <nbd@nbd.name>
>
> Kalle, I think this should go on top of my pull request quickly, since
> it fixes a regression in a commit from that pull request (introduced via
> rebase on top of Johannes' last change of that code).
> Do you want me to send another pull request with just this patch, or can
> you take it directly? In the latter case, feel free to also remove one
> of the two "fix" words in the subject :)
Sry, ;)
>
> Thanks,
>
> - Felix

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mt76: fix fix ampdu locking
  2019-11-20 20:14 ` Felix Fietkau
  2019-11-20 20:32   ` Markus Theil
@ 2019-11-21  6:53   ` Kalle Valo
  1 sibling, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2019-11-21  6:53 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: Markus Theil, linux-wireless

Felix Fietkau <nbd@nbd.name> writes:

> On 2019-11-20 21:05, Markus Theil wrote:
>> The current ampdu locking code does not unlock its mutex in the early
>> return case. This patch fixes it.
>> 
>> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
>
> Acked-by: Felix Fietkau <nbd@nbd.name>
>
> Kalle, I think this should go on top of my pull request quickly, since
> it fixes a regression in a commit from that pull request (introduced via
> rebase on top of Johannes' last change of that code).
> Do you want me to send another pull request with just this patch, or can
> you take it directly?

A lot easier to take it directly, so let's do that. I now assigned this
patch to me on patchwork and I'll try to remember apply it later today.

> In the latter case, feel free to also remove one of the two "fix"
> words in the subject :)

Ok, will fix (no pun intended ;)

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mt76: fix ampdu locking
  2019-11-20 20:05 [PATCH] mt76: fix fix ampdu locking Markus Theil
  2019-11-20 20:14 ` Felix Fietkau
@ 2019-11-21 18:34 ` Kalle Valo
  2019-11-21 18:36   ` Kalle Valo
  2019-11-21 18:43 ` [PATCH] mt76: fix " Kalle Valo
  2 siblings, 1 reply; 7+ messages in thread
From: Kalle Valo @ 2019-11-21 18:34 UTC (permalink / raw)
  To: Markus Theil; +Cc: nbd, linux-wireless, Markus Theil

Markus Theil <markus.theil@tu-ilmenau.de> wrote:

> The current ampdu locking code does not unlock its mutex in the early
> return case. This patch fixes it.
> 
> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
> Acked-by: Felix Fietkau <nbd@nbd.name>

Patch applied to wireless-drivers-next.git, thanks.

3e870c205d66 mt76: fix ampdu locking

-- 
https://patchwork.kernel.org/patch/11254757/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mt76: fix ampdu locking
  2019-11-21 18:34 ` [PATCH] mt76: " Kalle Valo
@ 2019-11-21 18:36   ` Kalle Valo
  0 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2019-11-21 18:36 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Markus Theil, nbd, linux-wireless

Kalle Valo <kvalo@codeaurora.org> writes:

> Markus Theil <markus.theil@tu-ilmenau.de> wrote:
>
>> The current ampdu locking code does not unlock its mutex in the early
>> return case. This patch fixes it.
>> 
>> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
>> Acked-by: Felix Fietkau <nbd@nbd.name>
>
> Patch applied to wireless-drivers-next.git, thanks.
>
> 3e870c205d66 mt76: fix ampdu locking

I made a mistake, please ignore that commit id. There will be a new id soon.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mt76: fix fix ampdu locking
  2019-11-20 20:05 [PATCH] mt76: fix fix ampdu locking Markus Theil
  2019-11-20 20:14 ` Felix Fietkau
  2019-11-21 18:34 ` [PATCH] mt76: " Kalle Valo
@ 2019-11-21 18:43 ` Kalle Valo
  2 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2019-11-21 18:43 UTC (permalink / raw)
  To: Markus Theil; +Cc: nbd, linux-wireless, Markus Theil

Markus Theil <markus.theil@tu-ilmenau.de> wrote:

> The current ampdu locking code does not unlock its mutex in the early
> return case. This patch fixes it.
> 
> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
> Acked-by: Felix Fietkau <nbd@nbd.name>

Patch applied to wireless-drivers-next.git, thanks.

05d6c8cfdbd6 mt76: fix fix ampdu locking

-- 
https://patchwork.kernel.org/patch/11254757/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-21 18:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 20:05 [PATCH] mt76: fix fix ampdu locking Markus Theil
2019-11-20 20:14 ` Felix Fietkau
2019-11-20 20:32   ` Markus Theil
2019-11-21  6:53   ` Kalle Valo
2019-11-21 18:34 ` [PATCH] mt76: " Kalle Valo
2019-11-21 18:36   ` Kalle Valo
2019-11-21 18:43 ` [PATCH] mt76: fix " Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).