linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Cc: linux-wireless@vger.kernel.org, Felix Fietkau <nbd@nbd.name>,
	Ryder Lee <ryder.lee@mediatek.com>, Roy Luo <royluo@google.com>
Subject: Re: [RFC] mt76: fix tx hung regression on MT7630E
Date: Mon, 5 Aug 2019 12:01:11 +0200	[thread overview]
Message-ID: <20190805100110.GA17889@redhat.com> (raw)
In-Reply-To: <20190731090927.GA3665@localhost.localdomain>

On Wed, Jul 31, 2019 at 11:09:27AM +0200, Lorenzo Bianconi wrote:
> > On Wed, Jul 31, 2019 at 10:19:58AM +0200, Stanislaw Gruszka wrote:
> > > On Tue, Jul 30, 2019 at 04:55:31PM +0200, Lorenzo Bianconi wrote:
> > > > > > > diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
> > > > > > > index 467b28379870..622251faa415 100644
> > > > > > > --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
> > > > > > > +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
> > > > > > > @@ -170,7 +170,7 @@ static int mt76x02_poll_tx(struct napi_struct *napi, int budget)
> > > > > > >  					       mt76.tx_napi);
> > > > > > >  	int i;
> > > > > > >  
> > > > > > > -	mt76x02_mac_poll_tx_status(dev, false);
> > > > > > > +	mt76x02_mac_poll_tx_status(dev, true);
> > > > > > 
> > > > > > I am not sure if we really need mt76x02_mac_poll_tx_status() here since we run
> > > > > > it in mt76x02_tx_complete_skb() and in mt76x02_tx_tasklet(). Anyway the only
> > > > > > difference doing so is we do not run mt76x02_send_tx_status().
> > > > > 
> > > > > I thought this is the problem, but it was my mistake during testing.
> > > > > I tested the above change together with mt76_txq_schedule(dev, txq->ac)
> > > > > change and get wrong impression it fixes the issue. But above change
> > > > > alone does not help.
> > > > > 
> > > > > I tried to add some locking to avoid parallel execution of mt76x02_poll_tx()
> > > > > and mt76x02_tx_tasklet(), but it didn't help either. So far only patch
> > > > > originally posted here make the problem gone.
> > > > 
> > > > so, in order to be on the same page, if you comment out mt76x02_mac_poll_tx_status()
> > > > in mt76x02_poll_tx() the issue will still occur. The only to 'fix' it is to run
> > > > mt76_txq_schedule_all() in mt76x02_poll_tx(), right?
> > > 
> > > Yes.
> > 
> > Err, no, I should read more cerfully. It is partiall revert of 
> > 41634aa8d6db ("mt76: only schedule txqs from the tx tasklet") : 
> > 
> > diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
> > index 5397827668b9..fefe0ee52584 100644
> > --- a/drivers/net/wireless/mediatek/mt76/tx.c
> > +++ b/drivers/net/wireless/mediatek/mt76/tx.c
> > @@ -598,7 +598,7 @@ void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
> >         if (!test_bit(MT76_STATE_RUNNING, &dev->state))
> >                 return;
> >  
> > -       tasklet_schedule(&dev->tx_tasklet);
> > +       mt76_txq_schedule(dev, txq->ac);
> >  }
> >  EXPORT_SYMBOL_GPL(mt76_wake_tx_queue);
> 
> reviewing the code I think:
> 
> - we should not run mt76u_tx_tasklet() from mt76_wake_tx_queue() since we do
>   not have tx_napi for usb and it will unnecessary go through tx queue checks.
>   We should probably do in mt76_wake_tx_queue() something like:
> 
>   if (is_mmio())

Adding '&& !is_mt7630()' will solve the problem for MT7630E as well ...

> 	  tasklet_schedule(&dev->tx_tasklet);
>   else
> 	  mt76_txq_schedule(dev, txq->ac);
> 
>   Another solution would be add a status_tasklet that just goes through the tx
>   queues receiving the usb tx completion and it schedules the tx_tasklet
>   What do you think?
> 
> - I guess it does not fix the 76x0e issue but we should just schedule tx queues in
>   mt76x02_tx_tasklet() (like it is done for mt7603 and mt7615) and move status
>   processing in mt76x02_poll_tx()

... but I think we have bug when do mt76_txq_schedule_all() in
tx_tasklet, because we can schedule on queues that are stoped.
So reverting 41634aa8d6db and then optimize by removing tx_tasklet
for mmio and remove not needed mt76_txq_schedule_all() calls looks
more reasoneble to me.
 
Stanislaw 

  reply	other threads:[~2019-08-05 10:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26 12:10 [RFC] mt76: fix tx hung regression on MT7630E Stanislaw Gruszka
2019-07-29 12:53 ` Stanislaw Gruszka
2019-07-29 14:02   ` Lorenzo Bianconi
2019-07-30 13:54     ` Stanislaw Gruszka
2019-07-30 14:55       ` Lorenzo Bianconi
2019-07-31  8:19         ` Stanislaw Gruszka
2019-07-31  8:51           ` Stanislaw Gruszka
2019-07-31  9:09             ` Lorenzo Bianconi
2019-08-05 10:01               ` Stanislaw Gruszka [this message]
2019-08-05 11:27                 ` Lorenzo Bianconi
2019-08-05 12:39                   ` Stanislaw Gruszka
2019-08-12 11:50                     ` 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=20190805100110.GA17889@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=royluo@google.com \
    --cc=ryder.lee@mediatek.com \
    /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).