Skip to contentSkip to conversation

brcm80211: fix endless A-MPDU retries

PATCH In review Arend van Spriel 4 participants 11 messages Feb 23, 2012 – Dec 2, 2012 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

cover brcm80211: fix endless A-MPDU retries

Hi John,

The first patch has already been taken in wireless-next repo. However, as people see the issue with 3.2 and 3.3 kernels it should go to wireless repository as well.

Fix endless retries that became more obvious upon implementing the mac80211 flush callback and more so after adding the WARN_ON_ONCE by Stanislaw Gruszka (https://bugzilla.kernel.org/show_bug.cgi?id=42576).

These second patch removes error print to limit the mess printed in the log when an A-MPDU transmission times out on the block-ack.

Arend van Spriel (2):
brcm80211: smac: fix endless retry of A-MPDU transmissions
brcm80211: smac: only print block-ack timeout message at trace level

 drivers/net/wireless/brcm80211/brcmsmac/ampdu.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/2 brcm80211: smac: fix endless retry of A-MPDU transmissions

The A-MPDU code checked against a retry limit, but it was using the wrong variable to do so. This patch fixes this to assure proper retry mechanism.

This problem had a side-effect causing the mac80211 flush callback to remain waiting forever as well. That side effect has been fixed by commit by Stanislaw Gruszka:

commit f96b08a7e6f69c0f0a576554df3df5b1b519c479
Date: Tue Jan 17 12:38:50 2012 +0100

brcmsmac: fix tx queue flush infinite loop

Reference:
https://bugzilla.kernel.org/show_bug.cgi?id=42576

---
 drivers/net/wireless/brcm80211/brcmsmac/ampdu.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
drivers/net/wireless/brcm80211/brcmsmac/ampdu.c +1 -5
index 90911ee..9265226 100644
@@ -1051,17 +1051,13 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
 		}
 		/* either retransmit or send bar if ack not recd */
 		if (!ack_recd) {
-			struct ieee80211_tx_rate *txrate =
-			    tx_info->status.rates;
-			if (retry && (txrate[0].count < (int)retry_limit)) {
+			if (retry && (ini->txretry[index] < (int)retry_limit)) {
 				ini->txretry[index]++;
 				ini->tx_in_transit--;
 				/*
 				 * Use high prededence for retransmit to
 				 * give some punch
 				 */
-				/* brcms_c_txq_enq(wlc, scb, p,
-				 * BRCMS_PRIO_TO_PREC(tid)); */
 				brcms_c_txq_enq(wlc, scb, p,
 						BRCMS_PRIO_TO_HI_PREC(tid));
 			} else {
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 1/1 brcm80211: smac: fix endless retry of A-MPDU transmissions

From: Arend van Spriel <[email protected]>
Date: Thu, 9 Feb 2012 21:08:58 +0100

commit 5e379203c7788b7af01150bfadbc74d2797a2ef4 upstream.

The A-MPDU code checked against a retry limit, but it was using the wrong variable to do so. This patch fixes this to assure proper retry mechanism.

This problem had a side-effect causing the mac80211 flush callback to remain waiting forever as well. That side effect has been fixed by commit by Stanislaw Gruszka:

commit f96b08a7e6f69c0f0a576554df3df5b1b519c479
Date: Tue Jan 17 12:38:50 2012 +0100

brcmsmac: fix tx queue flush infinite loop

Reference:
https://bugzilla.kernel.org/show_bug.cgi?id=42576

---
Hi Ben and Greg,

Please consider

5e379203c778 brcm80211: smac: fix endless retry of A-MPDU
transmissions

for application to the 3.2.y and 3.3.y stable trees. It is the real fix to the bug worked around by f96b08a7e6f6 (brcmsmac: fix tx queue flush infinite loop, 2012-01-17). The remaining symptom after that workaround was an assertion failure (WARNING at drivers/net/wireless/brcm80211/brcmsmac/main.c:8241).

Touko Korpela (cc-ed) tested the patch against 3.2.17 + "brcm80211:
smac: pass missing argument to 'brcms_b_mute'" and found it to work[1]:

Quoted 2 lines

Patch works, warning is gone after couple of hours of use. I let you know if situation changes.

Thanks,
Jonathan

[1] http://bugs.debian.org/672891

 drivers/net/wireless/brcm80211/brcmsmac/ampdu.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/wireless/brcm80211/brcmsmac/ampdu.c +1 -5
index 7f27dbdb6b60..051586275f14 100644
@@ -1053,17 +1053,13 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
 		}
 		/* either retransmit or send bar if ack not recd */
 		if (!ack_recd) {
-			struct ieee80211_tx_rate *txrate =
-			    tx_info->status.rates;
-			if (retry && (txrate[0].count < (int)retry_limit)) {
+			if (retry && (ini->txretry[index] < (int)retry_limit)) {
 				ini->txretry[index]++;
 				ini->tx_in_transit--;
 				/*
 				 * Use high prededence for retransmit to
 				 * give some punch
 				 */
-				/* brcms_c_txq_enq(wlc, scb, p,
-				 * BRCMS_PRIO_TO_PREC(tid)); */
 				brcms_c_txq_enq(wlc, scb, p,
 						BRCMS_PRIO_TO_HI_PREC(tid));
 			} else {
Signature · 1 line
1.7.10.2
#3 lore raw

Re: [PATCH 3.2.y, 3.3.y] brcm80211: smac: fix endless retry of A-MPDU transmissions

Quoted 4 lines · Jonathan Nieder

From: Arend van Spriel <[email protected]>
Date: Thu, 9 Feb 2012 21:08:58 +0100

commit 5e379203c7788b7af01150bfadbc74d2797a2ef4 upstream.

[...]

Added to the queue for 3.2.y.

Ben.

Signature · 2 lines
Ben Hutchings
Every program is either trivial or else contains at least one bug
#4 lore raw

Re: [PATCH 3.2.y, 3.3.y] brcm80211: smac: fix endless retry of A-MPDU transmissions

In reply to Jonathan Nieder
Quoted 41 lines · Jonathan Nieder

From: Arend van Spriel <[email protected]>
Date: Thu, 9 Feb 2012 21:08:58 +0100

commit 5e379203c7788b7af01150bfadbc74d2797a2ef4 upstream.

The A-MPDU code checked against a retry limit, but it was using the wrong variable to do so. This patch fixes this to assure proper retry mechanism.

This problem had a side-effect causing the mac80211 flush callback to remain waiting forever as well. That side effect has been fixed by commit by Stanislaw Gruszka:

commit f96b08a7e6f69c0f0a576554df3df5b1b519c479
Date: Tue Jan 17 12:38:50 2012 +0100

brcmsmac: fix tx queue flush infinite loop

Reference:
https://bugzilla.kernel.org/show_bug.cgi?id=42576

---
Hi Ben and Greg,

Please consider

5e379203c778 brcm80211: smac: fix endless retry of A-MPDU
transmissions

for application to the 3.2.y and 3.3.y stable trees. It is the real fix to the bug worked around by f96b08a7e6f6 (brcmsmac: fix tx queue flush infinite loop, 2012-01-17). The remaining symptom after that workaround was an assertion failure (WARNING at drivers/net/wireless/brcm80211/brcmsmac/main.c:8241).

Quoted 3 lines

Touko Korpela (cc-ed) tested the patch against 3.2.17 + "brcm80211:
smac: pass missing argument to 'brcms_b_mute'" and found it to work[1]:

It doesn't apply to the 3.3-stable tree, so it's a bit hard for me to apply it...

thanks,

greg k-h

#5 lore raw

Re: [PATCH 3.2.y, 3.3.y] brcm80211: smac: fix endless retry of A-MPDU transmissions

Hi Greg,

Quoted 3 lines · Greg KH
Quoted 1 line · Jonathan Nieder

commit 5e379203c7788b7af01150bfadbc74d2797a2ef4 upstream.

[...]

Quoted 2 lines

It doesn't apply to the 3.3-stable tree, so it's a bit hard for me to apply it...

My bad --- looks like it was already applied during the 3.3 cycle as v3.3~19^2^2~7 (commit 85091fc0a756). Sorry I missed that before.

Thanks,
Jonathan

#6 lore raw

Re: [PATCH 3.2.y, 3.3.y] brcm80211: smac: fix endless retry of A-MPDU transmissions

Quoted 7 lines · Jonathan Nieder

Hi Greg,

Quoted 3 lines · Greg KH
Quoted 1 line · Jonathan Nieder

commit 5e379203c7788b7af01150bfadbc74d2797a2ef4 upstream.

[...]

Quoted 9 lines
Quoted 2 lines

It doesn't apply to the 3.3-stable tree, so it's a bit hard for me to apply it...

My bad --- looks like it was already applied during the 3.3 cycle as v3.3~19^2^2~7 (commit 85091fc0a756). Sorry I missed that before.

Thanks,
Jonathan

Yes. The patch was posted upstream with Cc to stable. As it did not apply to earlier kernels it was marked for 3.3 stable only. Jonathan ported the original patch for the earlier kernels.

Gr. AvS

#7 lore raw

Re: [PATCH 3.2.y, 3.3.y] brcm80211: smac: fix endless retry of A-MPDU transmissions

Quoted 4 lines · Arend van Spriel
Quoted 2 lines · Jonathan Nieder

My bad --- looks like it was already applied during the 3.3 cycle as v3.3~19^2^2~7 (commit 85091fc0a756). Sorry I missed that before.

[...]

Quoted 2 lines

Yes. The patch was posted upstream with Cc to stable. As it did not apply to earlier kernels it was marked for 3.3 stable only.

Technically it wasn't cc-ed to stable; it went to wireless-next for 3.4 and then was fast-tracked through the plain wireless tree for 3.3[1]. But the effect is basically the same.

Thanks for writing it.

Jonathan

[1] http://thread.gmane.org/gmane.linux.kernel.wireless.general/85902
http://thread.gmane.org/gmane.linux.kernel.wireless.general/85249

#8 lore raw

PATCH 2/2 brcm80211: smac: only print block-ack timeout message at trace level

In reply to Arend van Spriel

In regular use block-ack timeouts can happen so it does not make sense to fill the log with these messages.

---
 drivers/net/wireless/brcm80211/brcmsmac/ampdu.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/brcm80211/brcmsmac/ampdu.c +3 -3
index 9265226..30b5887 100644
@@ -1070,9 +1070,9 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
 				    IEEE80211_TX_STAT_AMPDU_NO_BACK;
 				skb_pull(p, D11_PHY_HDR_LEN);
 				skb_pull(p, D11_TXH_LEN);
-				wiphy_err(wiphy, "%s: BA Timeout, seq %d, in_"
-					"transit %d\n", "AMPDU status", seq,
-					ini->tx_in_transit);
+				BCMMSG(wiphy,
+				       "BA Timeout, seq %d, in_transit %d\n",
+				       seq, ini->tx_in_transit);
 				ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw,
 							    p);
 			}
Signature · 1 line
1.7.5.4
#9 lore raw

[3.2.y] Re: [PATCH 2/2] brcm80211: smac: only print block-ack timeout message at trace level

Hi Ben,

Please consider

2b0a53d51b5f brcm80211: smac: only print block-ack timeout message
at trace level

for application to the 3.2.y tree.

It just lowers the priority of a distracting repeated message about a normal condition:

ieee80211 phy0: AMPDU status: BA Timeout, seq 152, in_transit 0

See <http://bugs.debian.org/674430> for context.

The patch was applied upstream during the 3.3-rc7 cycle. Applying it should make debugging other problems easier. Thoughts of all kinds welcome, as always.

Regards,
Jonathan

#10 lore raw

Re: [3.2.y] Re: [PATCH 2/2] brcm80211: smac: only print block-ack timeout message at trace level

Quoted 12 lines · Jonathan Nieder

Hi Ben,

Please consider

2b0a53d51b5f brcm80211: smac: only print block-ack timeout message
at trace level

for application to the 3.2.y tree.

It just lowers the priority of a distracting repeated message about a normal condition:

Quoted 7 lines

ieee80211 phy0: AMPDU status: BA Timeout, seq 152, in_transit 0

See <http://bugs.debian.org/674430> for context.

The patch was applied upstream during the 3.3-rc7 cycle. Applying it should make debugging other problems easier. Thoughts of all kinds welcome, as always.

Added to the queue, thanks.

Ben.

Signature · 2 lines
Ben Hutchings
It is easier to change the specification to fit the program than vice versa.