Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp711257pxp; Sat, 19 Mar 2022 15:16:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsLcVUyQebaGDUaHL12UpPELZuoPEjqcqVit0/LX0q0Xgp6NBmMY/xg9BqxrYC3UGPyexH X-Received: by 2002:aa7:d543:0:b0:416:13eb:6fec with SMTP id u3-20020aa7d543000000b0041613eb6fecmr16381017edr.348.1647728164579; Sat, 19 Mar 2022 15:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647728164; cv=none; d=google.com; s=arc-20160816; b=Cf/tEU60Ah9oFPvy7psusgbLPiYTya/lw9HZ5Mct085Aq7+LZe4d5eql0x9Dz7ugtp dTiVB6Ry2JDsVjnR8wMuK3LQwghXeUjDNHXHQFsbwvwrzRKvHpwJv44Bx2f/ecxZJjwj z1Px1ypibrMivw6fQp9UnE9Pzi9AYFIetTYyA+1c8OH0jnaTmmA2Qx+IX+wzpJ9cKCmR QXXnH7xSIxwyq9Pl47uOry9HElCkXf3Xu3q0ucUXwR2r00k+TCZYHGVMTDFW3ZTRn0yQ TVCDZtHD5zfM6bYznzhOG3/+LQ3a8J9AsTdRWfShIpZ86OG1CPLzL2bJTr5UWbcMSODJ 4quw== 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=J03/PwOUKXa1fOxjm/Bm/iftdd0UgwIA6hIWoW8IXOc=; b=JrzjbJkj3ye6sdQX29iSBF+4iJ+/GIVA7JVHRPava2hKhYl2HxCma3VG5TDGPlLFbJ TdfWS6x9MrMzo38bSP88s7geyPKoIP4MlA+YIIay514/LHRkr3nDfbb3XZMNQao7rBnJ wnWrOoS4g+3qrgjaV9msXs4jBivM7g7zBBkJAJrbe3Lh72514BDvgTIgbw4tqQ/Tx0jn BH6s4iCxB7uoa58fOY5Cr0Oz5bj1UgCnjcb////xhXps7+he4mcKl0Y1TZ0pcDM1X8Ta CFZaeVqHaDlFCTtVTuS519+v4l8gQb+TdTdHw6K2PV5t/rmlA7wh5Z/w6NwPcwa6OrHd DY5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a170906c40100b006df76385dbasi4037426ejz.602.2022.03.19.15.15.31; Sat, 19 Mar 2022 15:16:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242156AbiCSEz3 (ORCPT + 70 others); Sat, 19 Mar 2022 00:55:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242147AbiCSEz1 (ORCPT ); Sat, 19 Mar 2022 00:55:27 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E62D4E8873 for ; Fri, 18 Mar 2022 21:54:00 -0700 (PDT) X-UUID: 2599395107394b3d8fc505f242832db9-20220319 X-UUID: 2599395107394b3d8fc505f242832db9-20220319 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1450832026; Sat, 19 Mar 2022 12:53:52 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Sat, 19 Mar 2022 12:53:51 +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; Sat, 19 Mar 2022 12:53:51 +0800 From: Ryder Lee To: Felix Fietkau CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , , "Ryder Lee" Subject: [PATCH] mt76: mt7915: always call mt7915_wfsys_reset() during init Date: Sat, 19 Mar 2022 12:53:50 +0800 Message-ID: <884cf46908e7f723f8b52ec5bb38ae17142a794c.1647665580.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,MAY_BE_FORGED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Soft reboot might not clear certain condition, so always call mt7915_wfsys_reset() during init. Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index fd16d777f2e4..666ea7b0d3e5 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -651,10 +651,7 @@ static int mt7915_init_hardware(struct mt7915_dev *dev) dev->dbdc_support = mt7915_band_config(dev); - /* If MCU was already running, it is likely in a bad state */ - if (mt76_get_field(dev, MT_TOP_MISC, MT_TOP_MISC_FW_STATE) > - FW_STATE_FW_DOWNLOAD) - mt7915_wfsys_reset(dev); + mt7915_wfsys_reset(dev); ret = mt7915_dma_init(dev); if (ret) @@ -663,14 +660,8 @@ static int mt7915_init_hardware(struct mt7915_dev *dev) set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state); ret = mt7915_mcu_init(dev); - if (ret) { - /* Reset and try again */ - mt7915_wfsys_reset(dev); - - ret = mt7915_mcu_init(dev); - if (ret) - return ret; - } + if (ret) + return ret; ret = mt7915_eeprom_init(dev); if (ret < 0) -- 2.29.2