Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp175516pxf; Thu, 25 Mar 2021 01:07:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7DQ9Wzj8tk6EbEOnbH8c9+3pCABupbIxRXTIvEgL1ws/5dpW3x2P+4GCqMIw2o4BYlOdd X-Received: by 2002:a17:906:7e12:: with SMTP id e18mr8298208ejr.316.1616659653761; Thu, 25 Mar 2021 01:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616659653; cv=none; d=google.com; s=arc-20160816; b=Y9aB/gPdUI8hYVdgHIwExnhEH1xSfAYSox3XsdzIClplWIBxOWicdbwCRqsLQhqJvN b5nSVHayXMp/JiKogefynD4INaIA2bkfOL6ed4IppvNX5wfLGNEeE/r65ymAMqzcjsSj t8lsutKP1qBNkUW79eQZvA2lVEKplSLhaoqVDoH9tc7bKo0DXTAIStkzo+WN/lOpLtAT 65UhFPlP2a5tnZ31xh/zc7DBU0Eq6vl5ZZby8x4k8+sE2fmsctHXpidq3pGI8nr+8AP4 XYjmZIQPnkhGfULgK103Ia6Bv+7UEw8Zi/zYdkCLzEpIt5NMTGYZ+TXjMg56pSDiVtXD 1GYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=UG0g+rLAEXA1pcpqUvSzFa86via+BPA6j9pVbQ8TC+g=; b=h0s8ftLb/vKesigDD8AzU0DdWX7BZT5DoBt2A2r3XreeLsAvFiwsC9hnqz0AQWw1A6 vbB0QUByeyyRV3tNQTjPgDy40ZvCC4JJceZircNeAX38VMgqZCaNL4eMz9U9G0fEM0ym fPmux9t7P+irtjuEdfsy140o/bF9d4nt9lNrF66Sp4AkcTI1son/6GMLl/Z9S2hn7wab U89+/NEOQJ0MWFCJ1DKS7WV4qrUm22U2UEPnlG1dzncyN9G4+Dq1JPa0Up94e1/Q2SVV LavLxEC2ICaVk8VoPSAc8DNUXhpoiBaPuhhk6QQ2BEKTlcxYlBTOm9Pv37pcjEL8RdWW Bg4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si3700207ejh.597.2021.03.25.01.07.11; Thu, 25 Mar 2021 01:07:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbhCYIG3 (ORCPT + 99 others); Thu, 25 Mar 2021 04:06:29 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:42742 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229461AbhCYIGO (ORCPT ); Thu, 25 Mar 2021 04:06:14 -0400 X-UUID: 0fa67104660246debf39ee85eda7a1ac-20210325 X-UUID: 0fa67104660246debf39ee85eda7a1ac-20210325 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1817080498; Thu, 25 Mar 2021 16:06:09 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 25 Mar 2021 16:06:08 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 25 Mar 2021 16:06:08 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Shayne Chen , , , Ryder Lee Subject: [PATCH 2/5] mt76: mt7615: cleanup mcu tx queue in mt7615_dma_reset() Date: Thu, 25 Mar 2021 16:06:02 +0800 Message-ID: <8157df1026bb9ea20fd39ce58b8abef9a1cedd37.1616657048.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20744fae1cbe0dcc098b3112b0a5ccb0b6254587.1616657048.git.ryder.lee@mediatek.com> References: <20744fae1cbe0dcc098b3112b0a5ccb0b6254587.1616657048.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org With this patch, mt7615_mac_reset_work() can recover system back. Fixes: e637763b606b ("mt76: move mcu queues to mt76_dev q_mcu array") Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index 59aa8f84645b..17aa3e4d67ca 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -2018,15 +2018,17 @@ void mt7615_dma_reset(struct mt7615_dev *dev) mt76_clear(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_RX_DMA_EN | MT_WPDMA_GLO_CFG_TX_DMA_EN | MT_WPDMA_GLO_CFG_TX_WRITEBACK_DONE); + usleep_range(1000, 2000); - mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_WM], true); for (i = 0; i < __MT_TXQ_MAX; i++) mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[i], true); - mt76_for_each_q_rx(&dev->mt76, i) { + for (i = 0; i < __MT_MCUQ_MAX; i++) + mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[i], true); + + mt76_for_each_q_rx(&dev->mt76, i) mt76_queue_rx_reset(dev, i); - } mt76_set(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_RX_DMA_EN | MT_WPDMA_GLO_CFG_TX_DMA_EN | -- 2.18.0