Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3688213ybl; Mon, 12 Aug 2019 04:51:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNjFU3qXm4mpVkep02HaakRtrbSz8E0hvqzEIbrcRVvhr/jSmQsdU+SsC4SyjRg3i43DGT X-Received: by 2002:a17:902:a981:: with SMTP id bh1mr3409662plb.236.1565610711801; Mon, 12 Aug 2019 04:51:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565610711; cv=none; d=google.com; s=arc-20160816; b=QrTYVr3/9d6+tSJSJggzKCgGyfoSiUW3IZw8F9tHxpkLFXEeNWiChyJ3XLgmOpzpxR CMgA3q8cTFTVW1YildQq0pUBxv0FFM0fFT0Op6k91TIb6r+shNLLcs/NcsiHIUeXgEPf r1C5dC785uXltwmZn5QS2lyy8i8di63+AL/RugBeKwtkFN1enSCrLJDe7uuqbOmQYOtI xZSfL7GSwJSY4HB6EWYzkQ8D2LYGpMroDa8kfOTNtFEXT6kWp5VViYBxIZA5Zpb4X7N2 Ou7Atr5PuPebomlU1JNLQKeSp7s5zoE3RJ1+8AGh43Vj/e6RHldbkP2R7h5Bpvx96fuk sd6w== 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=a7/JbH8cydeMuCEKWrTQFPSRHcx+K2xsn1SrQLcHNP4=; b=Y7jKAdcVW4IqLT/viOUjtGD6OrBhUQnVaA7f2UwlxvqGYBuNa+V2y0tJPXELGhBzmF y/osGtFQQ1CkNMuLL+b3MLbQGoJ6CflEwvhUCf6AzveBg8pbFNI0g/akqdJm/dEOwdJi HjGY4vCLLw27C/taNsyNN3QGbABksH+Z+vESEX+fhsGkA8PGdFHjXrLvSAkp4Jzw+o+F UA3WFTyaNVCMO8D+SLq1f12NOnq5yie0KZlj+LxLx3AnidlvRSoXG7s0VbenbsNYGWbb BgirbJzqqSccoaCxRfwPhEE+9/SXQLq/xjeuRcNiRghYoXrpsdjPwrnlmyWCyjGi2TXP V4iQ== 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 o3si62588890pld.102.2019.08.12.04.51.30; Mon, 12 Aug 2019 04:51:51 -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 S1728196AbfHLLu5 (ORCPT + 99 others); Mon, 12 Aug 2019 07:50:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58696 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728180AbfHLLu5 (ORCPT ); Mon, 12 Aug 2019 07:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 215633C917; Mon, 12 Aug 2019 11:50:57 +0000 (UTC) Received: from localhost (unknown [10.43.2.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1F63600C4; Mon, 12 Aug 2019 11:50:54 +0000 (UTC) Date: Mon, 12 Aug 2019 13:50:52 +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: <20190812115051.GB6333@redhat.com> References: <20190729125351.GA3086@redhat.com> <20190729140241.GC4030@localhost.localdomain> <20190730135450.GA2361@redhat.com> <20190730145531.GA3813@localhost.localdomain> <20190731081957.GA4096@redhat.com> <20190731085147.GB4096@redhat.com> <20190731090927.GA3665@localhost.localdomain> <20190805100110.GA17889@redhat.com> <20190805112719.GA12280@localhost.localdomain> <20190805123916.GA24209@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190805123916.GA24209@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 12 Aug 2019 11:50:57 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, Aug 05, 2019 at 02:39:16PM +0200, Stanislaw Gruszka wrote: > On Mon, Aug 05, 2019 at 01:27:19PM +0200, Lorenzo Bianconi wrote: > > > ... 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. > > > > schedule a stopped queue seems not harmful at a first glance since we do not > > copy pending skbs if we have not enough room in the dma ring. > > mac80211 stop queues for various other reasons than > IEEE80211_QUEUE_STOP_REASON_DRIVER . After looking in more details, we check if queue is stopped in ieee80211_tx_dequeue(). But we do not check that for skb's queued in mtxq->retry_q . > > diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c > > index 5397827668b9..bd2d34c4f326 100644 > > --- a/drivers/net/wireless/mediatek/mt76/tx.c > > +++ b/drivers/net/wireless/mediatek/mt76/tx.c > > @@ -495,6 +495,9 @@ mt76_txq_schedule_list(struct mt76_dev *dev, enum mt76_txq_id qid) > > while (1) { > > bool empty = false; > > > > + if (hwq->stopped) > > + break; > > + > > if (sq->swq_queued >= 4) > > break; > > > > Does it fix the issue you are facing? > > I'll not be able to test this patch this week. Will have access to > the hardware next week. > > I checeked before, if > 'q->queued + (tx_info.nbuf + 1) / 2 >= q->ndesc - 1' is triggered > when MT7630E hangs and it is not. But maybe second part of the patch > will help. Patch did not help. I debugged problem a bit more and issue is related with HW encryption. Using full mac80211 SW encyption by retuning -EOPNOTSUPP mt76x02_set_key() make the problem gone as well. Looks there is some race between setting HW keys and transmitting. Stanislaw