linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	Felix Fietkau <nbd@nbd.name>, Ryder Lee <ryder.lee@mediatek.com>,
	Roy Luo <royluo@google.com>
Subject: Re: [PATCH 5.3] mt76: mt76x0e: don't use hw encryption for MT7630E
Date: Wed, 14 Aug 2019 11:50:12 +0200	[thread overview]
Message-ID: <CAJ0CqmXM4NRMYU6Lt_a4f+DXE2bVmhYrjQbgxHG0g=N+o3TeQw@mail.gmail.com> (raw)
In-Reply-To: <1565703400-10623-1-git-send-email-sgruszka@redhat.com>

>
> Since 41634aa8d6db ("mt76: only schedule txqs from the tx tasklet")
> I can observe firmware hangs on MT7630E on station mode: tx stop
> functioning after minor activity (rx keep working) and on module
> unload device fail to stop with messages:
>
> [ 5446.141413] mt76x0e 0000:06:00.0: TX DMA did not stop
> [ 5449.176764] mt76x0e 0000:06:00.0: TX DMA did not stop
>
> Loading module again results in failure to associate with AP.
> Only machine power off / power on cycle can make device work again.
>
> It's unclear why commit 41634aa8d6db causes the problem, but it is
> related to HW encryption. Since issue is a firmware hang, that is super
> hard to debug, just disable HW encryption as fix for the issue.
>
> Fixes: 41634aa8d6db ("mt76: only schedule txqs from the tx tasklet")
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt76x0/pci.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
> index 4585e1b756c2..6117e6ca08cb 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
> @@ -62,6 +62,19 @@ static void mt76x0e_stop(struct ieee80211_hw *hw)
>         mt76x0e_stop_hw(dev);
>  }
>
> +static int
> +mt76x0e_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
> +               struct ieee80211_vif *vif, struct ieee80211_sta *sta,
> +               struct ieee80211_key_conf *key)
> +{
> +       struct mt76x02_dev *dev = hw->priv;
> +
> +       if (is_mt7630(dev))
> +               return -EOPNOTSUPP;

Hi Stanislaw,

Can you please try if disabling/enabling the tx tasklet during hw key
configuration fixes the issue?
Doing something like:

tasklet_disable(tx_tasklet)
mt76x02_set_key()
tasklet_enable(tx_tasklet)

Moreover, have you double checked if there is any performance impact
of not using hw encryption?
If so, I guess it is better to just redefine mt76_wake_tx_queue for
mt76x0e and run mt76_txq_schedule for 7630e:

void mt76x0e_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
{
        if (is_mt7630(dev)) {
            mt76_txq_schedule(dev, txq->ac);
        } else {
            tasklet_schedule(&dev->tx_tasklet);
        }
}

Regards,
Lorenzo

> +
> +       return mt76x02_set_key(hw, cmd, vif, sta, key);
> +}
> +
>  static void
>  mt76x0e_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
>               u32 queues, bool drop)
> @@ -78,7 +91,7 @@ static void mt76x0e_stop(struct ieee80211_hw *hw)
>         .configure_filter = mt76x02_configure_filter,
>         .bss_info_changed = mt76x02_bss_info_changed,
>         .sta_state = mt76_sta_state,
> -       .set_key = mt76x02_set_key,
> +       .set_key = mt76x0e_set_key,
>         .conf_tx = mt76x02_conf_tx,
>         .sw_scan_start = mt76x02_sw_scan,
>         .sw_scan_complete = mt76x02_sw_scan_complete,
> --
> 1.9.3
>

  reply	other threads:[~2019-08-14  9:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 13:36 [PATCH 5.3] mt76: mt76x0e: don't use hw encryption for MT7630E Stanislaw Gruszka
2019-08-14  9:50 ` Lorenzo Bianconi [this message]
2019-08-15 10:09   ` Stanislaw Gruszka
2019-08-15 10:20     ` Felix Fietkau
2019-08-19 11:06       ` Stanislaw Gruszka
2019-08-20 10:31         ` Felix Fietkau
2019-08-20 11:24           ` Stanislaw Gruszka
2019-08-21  8:47             ` Stanislaw Gruszka
2019-08-21  9:03               ` Felix Fietkau
2019-08-21 10:40                 ` Felix Fietkau
2019-08-21 11:22                   ` Stanislaw Gruszka
2019-08-22  7:23                     ` Felix Fietkau
2019-09-03 13:49 ` Kalle Valo

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='CAJ0CqmXM4NRMYU6Lt_a4f+DXE2bVmhYrjQbgxHG0g=N+o3TeQw@mail.gmail.com' \
    --to=lorenzo.bianconi@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=royluo@google.com \
    --cc=ryder.lee@mediatek.com \
    --cc=sgruszka@redhat.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).