Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4838618pxb; Tue, 2 Nov 2021 17:09:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNMSmyrw27Lel8MgG6XNosAVPTIzLLeZgPybeeMOPpb+pM+AyORvrRCvOKnUdydKTSKfil X-Received: by 2002:a02:c761:: with SMTP id k1mr30734049jao.74.1635898176618; Tue, 02 Nov 2021 17:09:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635898176; cv=none; d=google.com; s=arc-20160816; b=vZG46p/kZP7JXLvBT5N4h0nHQ6sf3OgzK8Bjsva/MGarWJkg+6ArJK6GE94mUXHsFI Hzw7kqwVflWGq2kS2uW4hmmNFzUVQai87y9jCSS/g1ADA9COvg6U3B473xYieA7XqCOr opPfmsaxCqqhBNvSGooLjf9QtufOeDNhCQtW66dqKc8Z+LXr6H9SwCzHslH0ItGCsz88 hfe+W6lNqnTX+q5CYz5D4j2G710QxPNhYnichj5jvNuoIAFW1bbmzMR83Xphx6YmdS9q YBzg3egomIofv+rf4/Mu8i61S1CSUkM044uBAPMJK09epW0AZ7h23zDfIcvN4uPns12o waBw== 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=JnXbNSGj3C31B5KLjJl+aRQjPY7/Rfg6z7OJzS/JACs=; b=fnDeArTpwXIjB3JoF3F8iFbqv7T2kdl4+EFct4s32ELhVHLdfVb7st9dVewh8bnsAn K7+qIfSyLOV9iJO/4Lk6g5w0ux76SAbrSu4XpMZGym0XijCoeKf+N1Dt9L40o8J/sKYI cD48Q6qnEOxH1dk39YMRPUyN8O9iv7I6wZcZeoymVW4p9s88KDX9XF7lgZn+13Lt2emN Ry9HkwdFulzKCAE6Ujwpxc/8NrarvkZ+5vg2W5bB1sIUzqHY6GPRW6SfU4IGe/Kr+APK 0s0MJ8gMZBZI3mgCWJsSph6wJBbaglTg7S5kTL/YmB4Onkiu5DfGRNPKB5tup/7AAVOx q8BA== 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 y4si656442iln.38.2021.11.02.17.09.21; Tue, 02 Nov 2021 17:09:36 -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 S231325AbhKCALR (ORCPT + 66 others); Tue, 2 Nov 2021 20:11:17 -0400 Received: from mailgw01.mediatek.com ([216.200.240.184]:61152 "EHLO mailgw01.mediatek.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230462AbhKCALR (ORCPT ); Tue, 2 Nov 2021 20:11:17 -0400 X-UUID: 649f9799d1ed46c2b525eab5108a35b4-20211102 X-UUID: 649f9799d1ed46c2b525eab5108a35b4-20211102 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1489918811; Tue, 02 Nov 2021 17:08:40 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 2 Nov 2021 17:05:30 -0700 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 3 Nov 2021 08:05:16 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH] mt76: mt7921: fix MT7921E reset failure Date: Wed, 3 Nov 2021 08:05:16 +0800 Message-ID: <2932b5b4f3ab1604971ca93d2e3bc483ceb6a46a.1635897433.git.objelf@gmail.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 There is a missing mt7921e_driver_own in the MT7921E reset procedure since the mt7921 mcu.c has been refactored for MT7921S, that will result in MT7921E reset failure, so add it back now. Fixes: dfc7743de1eb ("mt76: mt7921: refactor mcu.c to be bus independent") Reported-by: YN Chen Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 1 + drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c | 4 ++++ drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h index e9c7c3a19507..d6b823713ba3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h @@ -446,6 +446,7 @@ int mt7921_mcu_restart(struct mt76_dev *dev); void mt7921e_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q, struct sk_buff *skb); +int mt7921e_driver_own(struct mt7921_dev *dev); int mt7921e_mac_reset(struct mt7921_dev *dev); int mt7921e_mcu_init(struct mt7921_dev *dev); int mt7921s_wfsys_reset(struct mt7921_dev *dev); diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c index f9547d27356e..85286cc9add1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c @@ -321,6 +321,10 @@ int mt7921e_mac_reset(struct mt7921_dev *dev) MT_INT_MCU_CMD); mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0xff); + err = mt7921e_driver_own(dev); + if (err) + return err; + err = mt7921_run_firmware(dev); if (err) goto out; diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c index 583a89a34734..7b34c7f2ab3a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c @@ -4,7 +4,7 @@ #include "mt7921.h" #include "mcu.h" -static int mt7921e_driver_own(struct mt7921_dev *dev) +int mt7921e_driver_own(struct mt7921_dev *dev) { u32 reg = mt7921_reg_map_l1(dev, MT_TOP_LPCR_HOST_BAND0); -- 2.25.1