Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3701048pxb; Mon, 24 Jan 2022 15:46:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvXzI8oaugFJYUX3MUIH/nVZdMPhxeB5+YpTDtaoIed7ngQGQT5JNesYlsdqX/Je1hI6/V X-Received: by 2002:a17:90a:9908:: with SMTP id b8mr613580pjp.125.1643067965349; Mon, 24 Jan 2022 15:46:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067965; cv=none; d=google.com; s=arc-20160816; b=A/5VR4qSfxJzm+YcMPKjEaQQRcCucG6ZOSFSIrV0NXl1mhgteNZuQAnxK059Ba72FY ghooiG6FBqULZ0vF+7qDJU0w6o3B4SEXfJ9L94Jo3loCSfsig/C4TY2kiNdnWL3/sciz QQ0HG0oORVKc2+hi+VB6d9DJyZSbLNz/KqvZh6FXBDUofFuNrQBNHINL1iVdc5Q5kKGA eiZPOdUhF12OgWlucMlvIzMETpJWW/X2PrY2d8MkvKrmEckcOWMTjAsiasShhNQQUuGu aM1+tOTp2O4UgsmJdFbsPs9X+CnfaCuxStahQWGgmGygnrpu+4DsXS3ufZVXpKiREwY6 9mfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Em9kxVD24XPNZADEyxpnz11ZSRchOaXBtkj1aI2G0tQ=; b=ZDLS2Bih/OiB4e5L/nr/K/cY+pq5GP+s34atQrxSOuO/s9t2GJu9ZByUcVK0gbU0tT JG+Tm4l6gcm6Vrtzo3/6Z5BbLTWGPKnWoQjR4EGXIFXUYV367fqAahZcDBxDQGIaCJP1 2mZvc6989t6TYP4ZTkq2AzEH2JHyAeaSWTwlJ8mDPrMTdDfeQFUyoZLt3B5isSpPzeJH bpiE5MJt/gSmPq1tUKbrgyENA9v+yUxeCyq9JfG9ILG22wq2tyuznzsNTk8wiP888150 98pQViZSOMbA5hMGpxnCun0t+QTT61Vs9SKusNCtLwi5eXGdnvj+nsf3/6OstDYKTmNX PXsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VGxOI0XD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h24si6151631plr.265.2022.01.24.15.45.52; Mon, 24 Jan 2022 15:46:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VGxOI0XD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2360349AbiAXXgf (ORCPT + 99 others); Mon, 24 Jan 2022 18:36:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1839865AbiAXWwC (ORCPT ); Mon, 24 Jan 2022 17:52:02 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CF3FC0EE120; Mon, 24 Jan 2022 13:08:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 330BB611C8; Mon, 24 Jan 2022 21:08:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3904C340E5; Mon, 24 Jan 2022 21:08:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058497; bh=Zgw5tDOkd3pkJSgwNk1Z+umTFmDwlMzDGAgBtsl77Hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VGxOI0XDtp/vwkS5QmdjjNQ1T4IDd7nkLVjhCSroSXhoIiZr+qGnHqe/Dgrb7k7RS jmKsL/qYml4vyF8egNsLCrrxprTLcRnuALst218XczChf29DsQtxdrTBik/3bvwgZV qRtqmZZEl4c0Za+IgnzsF+Dz+FOvAcyfQQJUytH4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, YN Chen , Sean Wang , Felix Fietkau , Sasha Levin Subject: [PATCH 5.16 0309/1039] mt76: mt7921: fix MT7921E reset failure Date: Mon, 24 Jan 2022 19:34:58 +0100 Message-Id: <20220124184135.695052739@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang [ Upstream commit 0efaf31dec572d3aac4316c6d952e06d1c33adc4 ] 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 Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- 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 e9c7c3a195076..d6b823713ba33 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 f9547d27356e1..85286cc9add14 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 583a89a34734a..7b34c7f2ab3a6 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.34.1