linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Enrico Mioso <mrkiko.rs@gmail.com>
Cc: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes.berg@intel.com>,
	Daniel Golle <daniel@makrotopia.org>,
	Arnd Bergmann <arnd@arndb.de>, John Crispin <john@phrozen.org>,
	nbd@nbd.name
Subject: Re: ieee80211 phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full tx queue...?
Date: Wed, 13 Dec 2017 16:20:18 +0100	[thread overview]
Message-ID: <20171213152017.GA3554@redhat.com> (raw)
In-Reply-To: <alpine.LNX.2.21.99.1712112132480.7817@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]

On Mon, Dec 11, 2017 at 09:51:29PM +0100, Enrico Mioso wrote:
> Hello guys, and sorry for the big CC list.
> I would like to point out about a bug who survived for years - at least from 2015 until now, regarding the Ralink driver getting stuck, and in some cases not being able to recover.
> The problem manifested with an MT7620A chip, and the wireless card inside the WL-330N3G device.
> The error message is in rt2x00/rt2x00queue.c .
> 
> This bug was discussed, and a patch proposed, in this thread:
> https://lists.openwrt.org/pipermail/openwrt-devel/2015-September/thread.html#35778
> 
> I would like to help if possible - I have the have both an Archer MR200, and the WL330n3G hardware.
> BTW, the Archer MR200 is a nice MT7610 device, and the problem manifests itself, see:
> https://forum.openwrt.org/viewtopic.php?id=64293&p=6
> 
> Any help, hint, anything would be apreciated.
> thank you to all.

First I would try to remove this patch:
http://git.lede-project.org/?p=source.git;a=blob;f=package/kernel/mac80211/patches/600-23-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch
and see if it makes things better. However I think for the stuck problem
we need tx status timeout mechanism similar like for rt2800usb.

Attached patch can mitigate "Dropping frame due to full tx queue" 
errors. I did not test it, so it can be totally broken.

Regards
Stanislaw

[-- Attachment #2: rt2x00_pause_queue_without_droping_lock.patch --]
[-- Type: text/plain, Size: 1543 bytes --]

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
index ecc96312a370..c8a6f163102f 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
@@ -152,16 +152,6 @@ void rt2x00mac_tx(struct ieee80211_hw *hw,
 	if (unlikely(rt2x00queue_write_tx_frame(queue, skb, control->sta, false)))
 		goto exit_fail;
 
-	/*
-	 * Pausing queue has to be serialized with rt2x00lib_txdone(). Note
-	 * we should not use spin_lock_bh variant as bottom halve was already
-	 * disabled before ieee80211_xmit() call.
-	 */
-	spin_lock(&queue->tx_lock);
-	if (rt2x00queue_threshold(queue))
-		rt2x00queue_pause_queue(queue);
-	spin_unlock(&queue->tx_lock);
-
 	return;
 
  exit_fail:
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
index a2c1ca5c76d1..39d523bbb661 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
@@ -714,6 +714,13 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
 	rt2x00queue_write_tx_descriptor(entry, &txdesc);
 	rt2x00queue_kick_tx_queue(queue, &txdesc);
 
+	/*
+	 * Pausing queue has to be serialized with rt2x00lib_txdone(), so we
+	 * do this under queue->tx_lock. Bottom halve was already disabled
+	 * before ieee80211_xmit() call.
+	 */
+	if (rt2x00queue_threshold(queue))
+		rt2x00queue_pause_queue(queue);
 out:
 	spin_unlock(&queue->tx_lock);
 	return ret;

  reply	other threads:[~2017-12-13 15:20 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 20:51 ieee80211 phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full tx queue...? Enrico Mioso
2017-12-13 15:20 ` Stanislaw Gruszka [this message]
2017-12-16 18:33   ` Enrico Mioso
2017-12-18 15:21     ` Stanislaw Gruszka
2017-12-19 12:27       ` Stanislaw Gruszka
2017-12-19 12:39         ` Enrico Mioso
2017-12-19 12:43         ` Enrico Mioso
2017-12-19 12:54           ` Stanislaw Gruszka
2017-12-19 13:25             ` Enrico Mioso
2017-12-20 17:49             ` Enrico Mioso
2017-12-21 14:25               ` Stanislaw Gruszka
2017-12-24 12:19                 ` Enrico Mioso
2018-01-03 11:35                   ` Stanislaw Gruszka
2018-01-03 14:04                     ` Enrico Mioso
     [not found]                       ` <CAKR_QVLRwAA0NJSarX46J4A8XSp8h5SuTEtSBQ4ydpEPh_-aUw@mail.gmail.com>
2018-01-22  5:45                         ` Enrico Mioso
2018-01-23 13:22                           ` Stanislaw Gruszka
2018-01-24  5:14                             ` Enrico Mioso
2018-01-24  8:18                             ` Enrico Mioso
2018-01-24 10:03                               ` Stanislaw Gruszka
2018-03-01 15:30                                 ` Daniel Golle
2018-03-02 19:13                                   ` Enrico Mioso
2018-03-07 12:27                                   ` Stanislaw Gruszka
2018-03-07 12:29                                     ` Stanislaw Gruszka
2018-03-23  7:51                                       ` Mathias Kresin
2018-03-26 10:35                                         ` Stanislaw Gruszka
2018-03-27  7:46                                           ` Mathias Kresin
2018-03-27 17:18                                             ` Stanislaw Gruszka
2018-03-27 17:43                                               ` Daniel Golle
2018-03-28  4:14                                                 ` Enrico Mioso
     [not found]                                                   ` <CAOt++SeSQ2j1KuVkbqt77LfznXN7JV0Lx5O8d7-m2VBrz8=85g@mail.gmail.com>
2018-03-29  5:13                                                     ` Enrico Mioso
2018-03-30 14:41                                                     ` Enrico Mioso
2018-03-30 14:44                                                     ` Enrico Mioso
     [not found]                                                       ` <MWHPR02MB3326233159B021143D7278F5D4A10@MWHPR02MB3326.namprd02.prod.outlook.com>
2018-03-30 17:33                                                         ` Enrico Mioso
     [not found]                                                           ` <CAOt++SeLh_NxcmM=YEMQSv4y9PabS_dT7k4yTxUiqXbac-=iUQ@mail.gmail.com>
2018-04-17 13:55                                                             ` Enrico Mioso
2018-04-17 13:56                                                               ` Jamie Stuart
2018-04-17 13:57                                                             ` Enrico Mioso
2018-04-17 19:42                                                             ` Stanislaw Gruszka
     [not found]                                                               ` <CAOt++SeNt=4RUTvAR1y_WjC=a-YyYa3YBSmoAmv+7uK71U+3+A@mail.gmail.com>
2018-05-28 12:50                                                                 ` Stanislaw Gruszka
2018-05-28 13:54                                                                   ` Daniel Golle
2018-08-15 11:40                                                                   ` Stanislaw Gruszka
2018-08-15 22:35                                                                     ` Daniel Golle
2018-08-16 11:01                                                                       ` Stanislaw Gruszka
     [not found]                                                                         ` <DM5PR02MB365669D5E9F2DE20DAE4CB7AD43E0@DM5PR02MB3656.namprd02.prod.outlook.com>
2018-08-18 16:08                                                                           ` Daniel Golle
2018-08-20 12:20                                                                             ` Stanislaw Gruszka
2018-08-24 13:02                                                                               ` Stanislaw Gruszka
2018-03-28 18:13                                                 ` Stanislaw Gruszka
2018-03-07 15:47                                     ` Jamie Stuart
2018-03-07 23:30                                       ` Enrico Mioso
2018-03-07 23:31                                       ` Enrico Mioso
2018-03-08  9:39                                       ` Stanislaw Gruszka
2018-03-08 14:28                                         ` Enrico Mioso
2018-01-23 13:20                         ` Stanislaw Gruszka
2017-12-26 17:20   ` Enrico Mioso
2018-01-03 11:45     ` Stanislaw Gruszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171213152017.GA3554@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=arnd@arndb.de \
    --cc=daniel@makrotopia.org \
    --cc=johannes.berg@intel.com \
    --cc=john@phrozen.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mrkiko.rs@gmail.com \
    --cc=nbd@nbd.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).