Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp683625pxf; Thu, 25 Mar 2021 11:30:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwLpapkPqZ7L4OFUMg60OGh4z/x2GcMu2BR1VL4wh1hvXryJEPzzzp8EXxCkzzzYddm28w X-Received: by 2002:a17:907:216a:: with SMTP id rl10mr11164629ejb.365.1616697047916; Thu, 25 Mar 2021 11:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616697047; cv=none; d=google.com; s=arc-20160816; b=DLFWULxnPb1q/Sw8+X2HsrrWRp80Fz9ol6qenwo/eHHN9er0fg2TtRt1U52x0h9bxK PuUwdn/Xi3t45H418TbosyKCv5ba8TzIml4xd4Qw3rG7rsO8vfTD4AscbUQiX3BOAJND gVmN5a8VWWKspFTuXGp80intCNjfjUBqtR9Byy0nuJlvUD0gfxtodmKcZmP+W9BvpLg3 tdL5WzTdNGE6jioVgdeFrs+ftCO7vLsVkAmd4Jlrud91R77D2NyZUvN4hFpntQPZ6vnK NGu0Hykd3JI3tAaMqnanic1ISgEWubi/tW8gWGL3aPQ5MBotcNtvUOFrC4x73vs7shCR 8neg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=nouDAuguJg59XJlD8eXWutC74XXYGyCoAZy9lmxTK94=; b=rEqe9d/rtv4kKdFx6+ujSpgyJOp+v4sPftSIKKdDCd4j4RnvC864mTkR+Gnvs6paLv J8Gyemx5YzC9nmuNFPduinHtRcsUCSCjvCzrGZTL4QIbAAECrmW3seBI6VclzaYcmZFh CJx4B+0aT4+eUR8SsEzkDL/9fuEVXt6pUiqF1HnDUylvr3BuUsoHsXUk82vf61W+2xr2 gIHCAGxMPMZl/Fs/sar9j7M2o7Oo48UuaMXJrRX0OL2deVj1GKGTxCiZAhgzJE+U1mhK szF4r2mmR1x1CWBmaVL9W6uDfxUifXwjUobEvfBuE6Zi9hf/Y1vX866wgVifSxdbJitq Yk3g== 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 c8si4955225edq.326.2021.03.25.11.30.24; Thu, 25 Mar 2021 11:30:47 -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 S230081AbhCYS3S (ORCPT + 99 others); Thu, 25 Mar 2021 14:29:18 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:51007 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230104AbhCYS3E (ORCPT ); Thu, 25 Mar 2021 14:29:04 -0400 X-UUID: 60b574c62f86417b947cc65e10f7d4f2-20210326 X-UUID: 60b574c62f86417b947cc65e10f7d4f2-20210326 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 797608230; Fri, 26 Mar 2021 02:28:59 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 26 Mar 2021 02:28:57 +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; Fri, 26 Mar 2021 02:28:57 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Shayne Chen , , , Ryder Lee Subject: [PATCH v2 1/2] mt76: mt7615: cleanup mcu tx queue in mt7615_dma_reset() Date: Fri, 26 Mar 2021 02:28:55 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 0275B13957BD8B2445E5A3E786A6A4A23CB3D92B8D2A1C5DF1F09CFD9856E9692000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Cleanup ext_phy and mcu tx queue so that mt7615_mac_reset_work() can recover mt7615 normally. Fixes: mt76: e637763b606 ("move mcu queues to mt76_dev q_mcu array") Signed-off-by: Ryder Lee --- change since v2 - cleanup mphy_ext->q_tx --- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index bb3f93d90f4e..4e41c12d08eb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -2013,20 +2013,26 @@ mt7615_update_beacons(struct mt7615_dev *dev) void mt7615_dma_reset(struct mt7615_dev *dev) { + struct mt76_phy *mphy_ext = dev->mt76.phy2; int i; 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++) + for (i = 0; i < __MT_TXQ_MAX; i++) { mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[i], true); + if (mphy_ext) + mt76_queue_tx_cleanup(dev, mphy_ext->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