From patchwork Wed Dec 15 21:25:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 12679511 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 BF398C433EF for ; Wed, 15 Dec 2021 21:26:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=foX2cXFsAeuEB4d4rjbA1+Omv/BYxMhpwo7dnruSoeE=; b=jAFsQ9sk6A1zlQ NhoKVLQMyvyrSDyXQLYsC6nkPTSwiDg2TztuRT7+Y+cair67whA4fOFGIvRNUspZnUq4Z93cL2Z2O lHlweB0nOFB13m8vcI17QtBqbwrElD7Xwya0ZeQ7BNivkjPQBRGJb2xMqfFV5sSCr8af82A/KQNsN rrk90yIZ9JSxcTMl2+/fCOos2AnByBG4GJMvKsn0V8Har5+GXcOMKaW/AzyHJHZHxFxDrJ7LRBONw g0F7/JLwnb8BffQ0uKkGFYzt+po6KmAf7yKbOKcHvktYOk5BsYfujdk3Ky3VRdDZLXvMFw2YZ/xJL uFmmTHD2mUGmDR3y+SyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxbmi-002nnY-1F; Wed, 15 Dec 2021 21:26:00 +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 1mxbmf-002nmS-B5 for linux-mediatek@lists.infradead.org; Wed, 15 Dec 2021 21:25:58 +0000 X-UUID: 9a9900bac74c460c98231c55a96c3b9e-20211215 X-UUID: 9a9900bac74c460c98231c55a96c3b9e-20211215 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 590796871; Wed, 15 Dec 2021 14:25:54 -0700 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 15 Dec 2021 13:25:52 -0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 16 Dec 2021 05:25:38 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 16 Dec 2021 05:25:38 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v2 1/4] mt76: mt7921: clear pm->suspended in mt7921_mac_reset_work Date: Thu, 16 Dec 2021 05:25:34 +0800 Message-ID: <9813aaab7c86fbbdd160a8c421696a09deb559d3.1639602937.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-20211215_132557_410381_BBA83D78 X-CRM114-Status: UNSURE ( 8.69 ) 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 clear pm->suspended in mt7921_mac_reset_work to allow pm runtime can be enabled after wifi reset in any circumstance. Signed-off-by: Sean Wang --- v2: create a new patch for the following ones --- drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c index edf54b192f37..a0f23047f13c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c @@ -1399,6 +1399,7 @@ void mt7921_mac_reset_work(struct work_struct *work) } dev->hw_full_reset = false; + pm->suspended = false; ieee80211_wake_queues(hw); ieee80211_iterate_active_interfaces(hw, IEEE80211_IFACE_ITER_RESUME_ALL, From patchwork Wed Dec 15 21:25:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 12679505 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 F379BC433F5 for ; Wed, 15 Dec 2021 21:26:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gacn3geDOXtRTWn0JP82P4hc9KlS0+YVKlDls3d+W64=; b=eKd3LlcIWyEk1r Fc/wgQaunKsRgwcsor3TgKOxomf9Pv1beOrpzL7MDIlx6fHw0Co9ljLv9XSH7/TPO5CEONRo+A5ET rn7JgTB6KphS+MjTggzNwYKgJzq/a/xNFTsjQGDU6X+WMi9Oi2Drsvn1ZAzKnGzvB2/vN5EbGoX8I Xj88PWpNttMBuPbrKBCno5xG9hvnkt5zozO2LBXnNDxTFG29FL9iKrJxrJrV0pRdIQVU9qDBFuvM1 honHsorb6KkBbxFSdeFA+QTEGuzM7mL860T9UpVSPvucNQqkLFMjy3gE3FccbavseNh05nf08awsj CPM8zg59cUQgfvBWk3EQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxbmZ-002nlI-Bk; Wed, 15 Dec 2021 21:25:51 +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 1mxbmV-002nkM-An for linux-mediatek@lists.infradead.org; Wed, 15 Dec 2021 21:25:50 +0000 X-UUID: 96552e0112e5484d88ea00b39cb50012-20211215 X-UUID: 96552e0112e5484d88ea00b39cb50012-20211215 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 1032508238; Wed, 15 Dec 2021 14:25:43 -0700 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 15 Dec 2021 13:25:41 -0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 16 Dec 2021 05:25:40 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 16 Dec 2021 05:25:40 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v2 2/4] mt76: mt7921: fix possible resume failure Date: Thu, 16 Dec 2021 05:25:35 +0800 Message-ID: <0c6a784deb679d9eb113ea3d5a36716ad9166312.1639602937.git.objelf@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <9813aaab7c86fbbdd160a8c421696a09deb559d3.1639602937.git.objelf@gmail.com> References: <9813aaab7c86fbbdd160a8c421696a09deb559d3.1639602937.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-20211215_132547_404010_F8222DFA X-CRM114-Status: GOOD ( 12.60 ) 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 Fix the possible resume failure due to mt76_connac_mcu_set_hif_suspend timeout. That is because clearing the flag pm->suspended too early opened up a race window, where mt7921_poll_tx/rx scheduled a ps_work to put the device in doze mode, that is unexpected for the device is being resumed from the suspend state and would make the remaining MCU comamnds in resume handler failed to execute. Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support") Co-developed-by: YN Chen Signed-off-by: YN Chen Signed-off-by: Sean Wang --- v2: refine the error handling path --- drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c index 5635de3c80b1..1212b803b1c8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c @@ -315,7 +315,6 @@ static int mt7921_pci_resume(struct pci_dev *pdev) struct mt76_connac_pm *pm = &dev->pm; int i, err; - pm->suspended = false; err = pci_set_power_state(pdev, PCI_D0); if (err) return err; @@ -353,7 +352,13 @@ static int mt7921_pci_resume(struct pci_dev *pdev) if (!pm->ds_enable) mt76_connac_mcu_set_deep_sleep(&dev->mt76, false); - return mt76_connac_mcu_set_hif_suspend(mdev, false); + err = mt76_connac_mcu_set_hif_suspend(mdev, false); + if (err) + return err; + + pm->suspended = false; + + return err; } #endif /* CONFIG_PM */ From patchwork Wed Dec 15 21:25:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 12679507 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 35F6AC433EF for ; Wed, 15 Dec 2021 21:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pVN6XR8g94EHqhxBifQgywc2Irx4HOY0zvYySGK97zY=; b=LhglkBk9FJPa6e Q8Los13VNK6Kc7EFEVXL24sYXRTYeR0ffq210l1NQn+/4MTaxivjOJVEynFFYGMruJ7ZnWwqo3CjZ 9GabkI795SBF0Kbzh5iQjJsDRP1idhyWYc0lIkO/DUdABkXkdVt3770+wqcdEsQ47XbSRzCVkn72L dpIx4pcbpTEgUHHQB9vhI2l0r/9wQMXGNDUiZG8o42EXVKHEaY//a1RAv75qILf8u85tiIuKJWvif GjHFxkoX9zcQ6UCkFizP2BXwoqnm4E3jpSyWf3qxmHYz6LFNp/3TVqpMPLSr3Etih8xKs1mYVs/uI AHcqGsTt8DSZzgAWlX0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxbmd-002nln-6O; Wed, 15 Dec 2021 21:25:55 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxbmZ-002nkf-4o for linux-mediatek@lists.infradead.org; Wed, 15 Dec 2021 21:25:54 +0000 X-UUID: 2dc52d01338a43d3a1110528e9ed9f98-20211215 X-UUID: 2dc52d01338a43d3a1110528e9ed9f98-20211215 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 150495091; Wed, 15 Dec 2021 14:25:45 -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, 15 Dec 2021 13:25:42 -0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 16 Dec 2021 05:25:41 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 16 Dec 2021 05:25:41 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v2 3/4] mt76: mt7921s: make pm->suspended usage consistent Date: Thu, 16 Dec 2021 05:25:36 +0800 Message-ID: <57d752fc7ee5af393e2856d25ed701ce8fd01aed.1639602937.git.objelf@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <9813aaab7c86fbbdd160a8c421696a09deb559d3.1639602937.git.objelf@gmail.com> References: <9813aaab7c86fbbdd160a8c421696a09deb559d3.1639602937.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-20211215_132551_231219_04547BA4 X-CRM114-Status: GOOD ( 10.37 ) 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 Update pm->suspended usage to be consistent with mt7921e driver. Signed-off-by: Sean Wang --- v2: refine the error handling path --- drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c b/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c index 84be229a899d..65d693902c22 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c @@ -278,7 +278,6 @@ static int mt7921s_resume(struct device *__dev) struct mt76_dev *mdev = &dev->mt76; int err; - pm->suspended = false; clear_bit(MT76_STATE_SUSPEND, &mdev->phy.state); err = mt7921_mcu_drv_pmctrl(dev); @@ -294,7 +293,13 @@ static int mt7921s_resume(struct device *__dev) if (!pm->ds_enable) mt76_connac_mcu_set_deep_sleep(mdev, false); - return mt76_connac_mcu_set_hif_suspend(mdev, false); + err = mt76_connac_mcu_set_hif_suspend(mdev, false); + if (err) + return err; + + pm->suspended = false; + + return err; } static const struct dev_pm_ops mt7921s_pm_ops = { From patchwork Wed Dec 15 21:25:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 12679509 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 1E07EC433FE for ; Wed, 15 Dec 2021 21:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=usGFdKSPVjeOvynEf2vCwOB/BaiIhFXwGLokMtWlP8M=; b=LI7iBo4wPVSIc9 w7vohBZpiQAYiyun5as6GIuwakbnuOYYnjropLNUbgenagkUKk5dzt9JkmyioJTQb021g2YQOXJGy LJ7P3C/dj6P09eSfHW1QuJqDyoLS4mIxmXec3d+OwgzAxvOXtun2cAACSR4m6vAVZy4x8td3gQmTY j5EBbWna0DL4bWmx9aRxVmFZdEaErNXSqyv0Q2tzNGcR1tJJdtbkHWPlc1bNKwqfxOfxiRinD/u9N S3kWAx+r5JAD8OLeAad9Dpj83j0tXsABZwoJf8BcOrOaVqTwRT9Am3NXjN+xd62EkTxv78R0vKss6 5Hd0oKchGTxXc0nV2hOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxbme-002nm3-4i; Wed, 15 Dec 2021 21:25:56 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxbmZ-002nki-4o for linux-mediatek@lists.infradead.org; Wed, 15 Dec 2021 21:25:54 +0000 X-UUID: 0008a6a640f540c9850c9cfb6c467f14-20211215 X-UUID: 0008a6a640f540c9850c9cfb6c467f14-20211215 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2019813871; Wed, 15 Dec 2021 14:25:46 -0700 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 15 Dec 2021 13:25:44 -0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 16 Dec 2021 05:25:43 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 16 Dec 2021 05:25:43 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v2 4/4] mt76: mt7921s: fix suspend error with enlarging mcu timeout value Date: Thu, 16 Dec 2021 05:25:37 +0800 Message-ID: <4588a7770984fa6bc3cbf0a3fdcae0150ce63c22.1639602937.git.objelf@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <9813aaab7c86fbbdd160a8c421696a09deb559d3.1639602937.git.objelf@gmail.com> References: <9813aaab7c86fbbdd160a8c421696a09deb559d3.1639602937.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-20211215_132551_228206_B4492336 X-CRM114-Status: GOOD ( 11.11 ) 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 Fix the false positive suspend error that may occur on mt7921s with enlarging mcu timeout value. The reason why we have to enlarge mcu timeout from HZ / 3 to HZ is we should consider the additional overhead caused by running concurrently with btmtksdio (a MT7921 bluetooth SDIO driver) that would compete for the same SDIO bus in process context to complete the suspend procedure. Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support") Signed-off-by: Sean Wang --- v2: the same, just rebase the patchset --- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c index 1227d626e9d3..be87e134216b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c @@ -239,7 +239,7 @@ int mt7921_mcu_fill_message(struct mt76_dev *mdev, struct sk_buff *skb, case MCU_UNI_CMD_HIF_CTRL: case MCU_UNI_CMD_SUSPEND: case MCU_UNI_CMD_OFFLOAD: - mdev->mcu.timeout = HZ / 3; + mdev->mcu.timeout = HZ; break; default: mdev->mcu.timeout = 3 * HZ;