Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4865463ybi; Tue, 30 Jul 2019 09:27:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdYwWBlnOIFiJuzSX4DNOLMBP2tmcLG29NsirkL34i25Ih8fBEf/b1iQm3SSCrDbZxINDm X-Received: by 2002:a63:67c6:: with SMTP id b189mr18502371pgc.163.1564504079747; Tue, 30 Jul 2019 09:27:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564504079; cv=none; d=google.com; s=arc-20160816; b=RH5jzdUYpq026aeNN8h91K5IQTG4voxo2WLncBHNkICf0uXIwVPndzPrM4obH6cf7w qE3Frm+o4yAD+vrd5NGSkMl8xk9wTsRjmj25b/69+ABYE/XzWD6Qx6ZRoguoNbHZL+Ru Hk5vmrbh08g46iGiJ50oy6slJnkRVOeWhqqUYbrtxQJCCww6i1fWiFJRJlluMkG9PEPe O7wo3kj0xuUxnD2rSMb36xUPlH7pZJacVkYxY3jxqmEyn0smIUy23cnIZPti99640p2q SqYWmVLyGcJABMwpeFTBZAT3UYldTlz6wkgYz3mBkMnB1sHb+5Fzn3jDmak7Q4CEAXpH fEYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=aVmsflENq5GiANC5+12FLLpBdSupqdMwAmZJV9KFm/M=; b=dxtnFYe3U7sQtdSdEE54eRmGNYJb7l7PrVjJiLkDXOh0hNNYQYk7aMVRO4uwVoiQM0 oWnouXYBHvwCWMVgxaugMnF1PcXLCGDS7ngbMKPYf85U2316zL5dOG+2cQPEsh5Nk/fs 7UweW4q/r844tPa0wK9hSiEdUIszbBJOX9jIAE9RdaSvY607gjFhq6IpIgeKSKlsdbDh W9Rcxv4iuXeIlBaULQlanGdFm/FDHVc5uoE+iNOw5k3h3qY2G7jcMxSShq6WyD8MQVQd qbCuVSJ65jk2T4cqaCVrkEU7w+DnjaQ5SDq5AbLj4xg00WnbTu4iNQrhL2f6+/2sMnkn DC2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k186si29000920pgd.229.2019.07.30.09.27.33; Tue, 30 Jul 2019 09:27:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727492AbfG3Ny4 (ORCPT + 99 others); Tue, 30 Jul 2019 09:54:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57252 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbfG3Ny4 (ORCPT ); Tue, 30 Jul 2019 09:54:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA3388553F; Tue, 30 Jul 2019 13:54:55 +0000 (UTC) Received: from localhost (unknown [10.43.2.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BC5860856; Tue, 30 Jul 2019 13:54:52 +0000 (UTC) Date: Tue, 30 Jul 2019 15:54:51 +0200 From: Stanislaw Gruszka To: Lorenzo Bianconi Cc: linux-wireless@vger.kernel.org, Felix Fietkau , Ryder Lee , Roy Luo Subject: Re: [RFC] mt76: fix tx hung regression on MT7630E Message-ID: <20190730135450.GA2361@redhat.com> References: <1564143056-14610-1-git-send-email-sgruszka@redhat.com> <20190729125351.GA3086@redhat.com> <20190729140241.GC4030@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190729140241.GC4030@localhost.localdomain> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 30 Jul 2019 13:54:56 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, Jul 29, 2019 at 04:02:41PM +0200, Lorenzo Bianconi wrote: > > On Fri, Jul 26, 2019 at 02:10:56PM +0200, Stanislaw Gruszka wrote: > > > 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. > > > > > > I have no idea why the commit caused F/W hangs. Most likely some proper > > > fix is needed of changing registers programming (or assuring proper order > > > of actions), but so far I can not came up with any better fix than > > > a partial revert of 41634aa8d6db. > > > > The difference is that with 41634aa8d6db we can run mt76x02_poll_tx() > > and mt76x02_tx_tasklet() in parallel on 2 different CPUs. Without > > the commit, since tasklet is not scheduled from mt76_wake_tx_queue(), > > it does not happen. > > > > I'm not quite sure why, but MT7630E does not like when we poll tx status > > on 2 cpus at once. Change like below: > > Hi Stanislaw, Hi > have you tried to look at the commit: 6fe533378795f87 > ("mt76: mt76x02: remove irqsave/restore in locking for tx status fifo")? > Could it be a race between a registermap update and a stats load? (we are using a > different lock now) This commit seems to be fine, reverting it did not solve the issue. > > 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. Stanislaw