From patchwork Thu Jun 23 00:35:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 12891602 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 574BDC43334 for ; Thu, 23 Jun 2022 00:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=lNhZ63jDtTevREks2kzokbpFnX54UuKc20+nS9OEBBc=; b=MqXflzROxxOeVY4vst4K4ucW2d 75QlsUAgv6+N6sPUPKI65RT4D/+eie2SEJ+ooiE2jVC+yDAHmD1oU4C64fooGu4B9sgd0ksXLVsZO kxHyaMEXLI3QSaOJK0atoWqz0vTa3V3N/et1rUd/oJH2DOtjC93vb8K6qT5kGHFCSC0/MFNp9VIKs 9YdutesLU8/0Ec9eMwQlKjMbUumYpv9YSDpQRIgIFod0gjbRzgZDBhq98H/tzOGJULk5VxSA6esV5 eMIBFmlLp/yIUQ7D4HmahEDY7tzsL1+SkvekMQIwasbBPq1OCpNUa4yjEeXq7og7OpE/V3JeFsIbQ n6eBXRXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4Awx-00CcTB-87; Thu, 23 Jun 2022 00:43:59 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4Awu-00CcRq-Oz for linux-mediatek@lists.infradead.org; Thu, 23 Jun 2022 00:43:58 +0000 X-UUID: 3490345edea949e980ff5c0711e96a23-20220622 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.6,REQID:7d8892a2-0746-4337-96ee-9c0e8d14ea7c,OB:0,LO B:0,IP:0,URL:5,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACTI ON:release,TS:5 X-CID-META: VersionHash:b14ad71,CLOUDID:89b541ea-f7af-4e69-92ee-0fd74a0c286c,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:1,File:nil ,QS:nil,BEC:nil,COL:0 X-UUID: 3490345edea949e980ff5c0711e96a23-20220622 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 622847694; Wed, 22 Jun 2022 17:43:49 -0700 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Jun 2022 17:35:30 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 23 Jun 2022 08:35:28 +0800 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; Thu, 23 Jun 2022 08:35:28 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 1/2] mt76: mt7921: reduce log severity levels for informative messages Date: Thu, 23 Jun 2022 08:35:26 +0800 Message-ID: <753f19393f169ad4a5fc127f68e16074f1617306.1655944385.git.objelf@gmail.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220622_174356_897263_B79FF938 X-CRM114-Status: UNSURE ( 9.57 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Sean Wang Use dev_info instead for the informative messages. Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c index eb1bfb682e02..2ce3a833176e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c @@ -740,7 +740,7 @@ void mt7921_mac_reset_work(struct work_struct *work) struct mt76_connac_pm *pm = &dev->pm; int i; - dev_err(dev->mt76.dev, "chip reset\n"); + dev_info(dev->mt76.dev, "chip reset\n"); dev->hw_full_reset = true; ieee80211_stop_queues(hw); From patchwork Thu Jun 23 00:35:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 12891603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96140C43334 for ; Thu, 23 Jun 2022 00:44:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:CC:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PmzhEd3BVkVDlr97r/E6z7Pc+/24oy01OrmkFMcqy38=; b=3HwdBhXupTS4oLvzy7r+JlZCbI HvmlNBDfQxjTZg/TAlKk4/V8B/xAOF8QaU4SBrR7diO5AeqQDouF5+9CDY1WuA9HPZJksMjJC7XNe 0ooSNYjLdI2vt10jdz2aWY7pYcZpPtkaTF2wDvqvK0eBHePvZSVsSghqOmZkZu4Ft+USqFrFnMlCO ifS9cke1bqtvFDkb2loQTswBRtGsEhqi4ddepaT50yUf1B6ZXDk0aLQAbE/9pJOr0ZSBMS5ombRqM gJNaBAD4lxhrLbrv7RVFaJYgwBv8rybw+gx+Wft4L0Wxf7i2WSrJmRha62xzyr9rGqxjkoQmO7GVn RUYeR6aQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4Ax6-00CcV6-Q4; Thu, 23 Jun 2022 00:44:08 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4Awu-00CcRs-Oy for linux-mediatek@lists.infradead.org; Thu, 23 Jun 2022 00:43:59 +0000 X-UUID: 3bebf25bdc3a45779a9501ade6385d36-20220622 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.6,REQID:0246c1d5-8e02-4d07-9a71-1b539213cfb8,OB:0,LO B:0,IP:0,URL:5,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACTI ON:release,TS:5 X-CID-META: VersionHash:b14ad71,CLOUDID:30c53638-5e4b-44d7-80b2-bb618cb09d29,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:1,File:nil ,QS:nil,BEC:nil,COL:0 X-UUID: 3bebf25bdc3a45779a9501ade6385d36-20220622 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 1363060202; Wed, 22 Jun 2022 17:43:49 -0700 Received: from mtkmbs10n1.mediatek.inc (172.21.101.34) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Jun 2022 17:35:31 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) 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; Thu, 23 Jun 2022 08:35:30 +0800 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; Thu, 23 Jun 2022 08:35:29 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 2/2] mt76: mt7921: reduce the mutex lock scope during reset Date: Thu, 23 Jun 2022 08:35:27 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <753f19393f169ad4a5fc127f68e16074f1617306.1655944385.git.objelf@gmail.com> References: <753f19393f169ad4a5fc127f68e16074f1617306.1655944385.git.objelf@gmail.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220622_174356_901056_E5D66488 X-CRM114-Status: GOOD ( 12.19 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Sean Wang Reduce the mutex lock scope for reset to get rid of possible task hung e.g wpa_supplicant and to allow the user-space process to keep running during we need more retries to complete the reset. Suggested-by: YN Chen Signed-off-by: Sean Wang Reviewed-by: AngeloGioacchino Del Regno --- drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c index 2ce3a833176e..c7bca83e7686 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c @@ -738,7 +738,7 @@ void mt7921_mac_reset_work(struct work_struct *work) reset_work); struct ieee80211_hw *hw = mt76_hw(dev); struct mt76_connac_pm *pm = &dev->pm; - int i; + int i, ret; dev_info(dev->mt76.dev, "chip reset\n"); dev->hw_full_reset = true; @@ -748,11 +748,14 @@ void mt7921_mac_reset_work(struct work_struct *work) cancel_delayed_work_sync(&pm->ps_work); cancel_work_sync(&pm->wake_work); - mutex_lock(&dev->mt76.mutex); - for (i = 0; i < 10; i++) - if (!mt7921_dev_reset(dev)) + for (i = 0; i < 10; i++) { + mutex_lock(&dev->mt76.mutex); + ret = mt7921_dev_reset(dev); + mutex_unlock(&dev->mt76.mutex); + + if (!ret) break; - mutex_unlock(&dev->mt76.mutex); + } if (i == 10) dev_err(dev->mt76.dev, "chip reset failed\n");