Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp3128993lkv; Mon, 10 May 2021 08:18:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCorSJtv1NJ+kbTKMXM+XxDSORBRgVZ6z5xyOC3HtTFQNlAmR5w/h+cZ2qC66bGiXacfat X-Received: by 2002:a02:380d:: with SMTP id b13mr21623163jaa.77.1620659908537; Mon, 10 May 2021 08:18:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620659908; cv=none; d=google.com; s=arc-20160816; b=PUBvMJm+K0SVJQAgYsIKJ47tOhz2olofQ0z8z7cn/6i6y+UASRMMxQ75m3eXa75Yw0 aI+WWdV7v4qXtZT0gml87UrMh5BMA8oBaz7IbWp15kKAyW4giS2JY1zvvjBtd+1Be02V qg1e9rgbYAAfys6/ifYjKFolgssG7zrgyg/8ySTqLa0PZxTgCPehNgil2ID+j9WXVBlU jLWdtRtb5lUm4SQ61V9BUOQ1YKO+skTdPTQUa9yBs04Z9ayRdF8iFdxLSD+w5e8BjQlt RF/Z5bqzMB98DDH6i2LyCBiKFYgod5mv+ls03KVvNH6wHBOHTCsNj80lIPvXE7+P88Wy Inkw== 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=YSBSgvUCR2ziSNNawe/FB1kXEYJP+kIK5hcLpihiKJ0=; b=w393/0NNy9p71tc4TrSVNcgwB8EGn94Bdzh4zwqWEW/+6cBhH3FNSfiM8eUifSR8cB 5Bw2bNJx3Q5tdkRikQQNax2ZE7xDNOFwU9j4eABfZIcZB0yucEO6OUCT5gqgwqJjgjHh 7voNv2IwTFZnCu/rS7xylBsQGF4zrwe5cgswIGjco5cTUTIBxrs2vQT2TtnqHKP0TMRh kZSf4wfIcs1Q1g7NfS3kIq+7zMjv1Nel4qTS3o6eQA1qXgqdGqoXH5jVil6Jrht4dwOn ODctsVyD2McUvXv35ycUJuBf3I679j6AOM0mKf+GimsDC4O0nvJJkOtFW3H0GwI/tseA mGGg== 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 q145si16535801iod.36.2021.05.10.08.18.15; Mon, 10 May 2021 08:18:28 -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 S237657AbhEJPRJ (ORCPT + 99 others); Mon, 10 May 2021 11:17:09 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:56330 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S233876AbhEJPQJ (ORCPT ); Mon, 10 May 2021 11:16:09 -0400 X-UUID: f26825eed5384c7f9c2de49528c790da-20210510 X-UUID: f26825eed5384c7f9c2de49528c790da-20210510 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1665037848; Mon, 10 May 2021 23:14:59 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 23:14:58 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 10 May 2021 23:14:58 +0800 From: To: , CC: , , , , , , , , , , , , , , , Subject: [PATCH 1/9] mt76: mt7921: fix mt7921_wfsys_reset sequence Date: Mon, 10 May 2021 23:14:49 +0800 Message-ID: <1620659697-12048-1-git-send-email-sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Sean Wang WiFi subsytem reset should control MT_WFSYS_SW_RST_B and then poll the same register until the bit WFSYS_SW_INIT_DONE bit is set. Fixes: 0c1ce9884607 ("mt76: mt7921: add wifi reset support") Reviewed-by: Lorenzo Bianconi Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7921/dma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/dma.c b/drivers/net/wireless/mediatek/mt76/mt7921/dma.c index 71e664ee7652..bd9143dc865f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/dma.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/dma.c @@ -313,9 +313,9 @@ static int mt7921_dma_reset(struct mt7921_dev *dev, bool force) int mt7921_wfsys_reset(struct mt7921_dev *dev) { - mt76_set(dev, 0x70002600, BIT(0)); - msleep(200); - mt76_clear(dev, 0x70002600, BIT(0)); + mt76_clear(dev, MT_WFSYS_SW_RST_B, WFSYS_SW_RST_B); + msleep(50); + mt76_set(dev, MT_WFSYS_SW_RST_B, WFSYS_SW_RST_B); if (!__mt76_poll_msec(&dev->mt76, MT_WFSYS_SW_RST_B, WFSYS_SW_INIT_DONE, WFSYS_SW_INIT_DONE, 500)) -- 2.25.1