Received: by 2002:a05:7412:a9a8:b0:f9:92ae:e617 with SMTP id o40csp9692rdh; Wed, 20 Dec 2023 14:11:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPHLsdpQzPzMwOe1hpQtC0BWZLP4P+ZNYh4AjnGvees4lFKXYUAzW1IP1BN9movVfv8Tc/ X-Received: by 2002:a50:a412:0:b0:550:e014:5254 with SMTP id u18-20020a50a412000000b00550e0145254mr12025999edb.27.1703110278622; Wed, 20 Dec 2023 14:11:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703110278; cv=none; d=google.com; s=arc-20160816; b=ZVbUTB5DqCcuh6stYor7/vrXqs+yCyrwWl2c17NyB2jOemZRaWGj94FavB0MEZ0GJ/ 5RQhkeVmvO2J1y4yRRJnW+DvFX4CEG/hKh4V28V0MXHWl51E6T06FpeASF1ipcjDf+Jz rCszvo0OqGYuiNzInQQtE4jwLjButmUurX3W+29P9gwUhJyhwNI3JkwAh1FjCUze6/tw 9w0BNpV0aWmVtSydd504SEpAs03N0w/XgDfWNoKuuW/atK/qcADLn+aglTLrOwWCY9Zd F9SO6c28F3XQmxEqcm7ikR+TkZdqwezaddptOr8MEc6s8W+FOqvYRuIMkXLSekiVl2lI /izg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=xbBBqHh5fKcUfXzPQSFe7Mc3xQp0cVkOSlT5xsu4+tM=; fh=emkr3resJcdISB+/I3qM8CyI/c+dLsgMZ3gAs1xEzlE=; b=frsScmQU0AVKOmijPUEYi+Yme994ZeSGSrgHmxVZz9wZMn/u/bC5ZO6eQ+5w0a/oXD aZPgma9bHrk5R126zUOniBj40VK2YPvw1qftz0RldXJdHtKAVmYfIb7+zsMCieXHa73V P/2RXhwyHMrnSn14OgG/NV6d6i7cfGBVigmWoPkcaVHeQ+2mtEuLnuctCIpiqlr3c95X uyORYstZ0TrugmijXfb+MECudQh+dlj3z6rLahzsga+iRJLcsRYNKPBOjGbs3pIp6P1e Ns7azrSQdEU7LHVyT4vhyE67Na9A+Z1B3IG6+MkrlnVgH5wmFM47pk7JM8gzmhwb6jVp 1wQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q6g4PBNU; spf=pass (google.com: domain of linux-wireless+bounces-1121-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1121-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v30-20020a50d59e000000b00553dc96be61si215723edi.285.2023.12.20.14.11.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 14:11:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1121-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q6g4PBNU; spf=pass (google.com: domain of linux-wireless+bounces-1121-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1121-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 54E591F2374D for ; Wed, 20 Dec 2023 22:11:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93233495D1; Wed, 20 Dec 2023 22:11:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="q6g4PBNU" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76D8B495C4 for ; Wed, 20 Dec 2023 22:11:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECA3DC433CB for ; Wed, 20 Dec 2023 22:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703110274; bh=rxDWW9QQfeURQ6v06XkkImaEoG89S2ehL9UgQ+cUoeA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=q6g4PBNUcBFw0+BF1CkIsjmz93gG9KLASGiU0cx3T9UwJD885VcTl+H2CEIhgFS03 gTLnmGrTAPu8MHyyTzPRfeFD5sIWlljFrz3ChXvmu3zimzpva4dfOrBbO2Ooj2Zz+6 nf+Zi24VF4aRzu5dMsLWEBvsFzZFZE39vvfyEHRZ9/pdYZOGEiy1AZttA6VpixtLVF 3a14n/LpDnnZSJRmaWT+xER1ZIOwZ3a9GVbUWgKXTxQhFFR7W3eKH/3eKE1pTA4Leb wIHSS8uR/cWLGyxIKxThtqIrVZ7lV/Nv5qN+LuEk0e08XmfXzDNCyHOEtGXHhx6p0y hxWrsNv8XL8iQ== Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-50e4e36c09cso53624e87.1 for ; Wed, 20 Dec 2023 14:11:13 -0800 (PST) X-Gm-Message-State: AOJu0YwAXopoDhBrpGSZx+CtOxDnXtltk3iaer5nEgK1omGz3kGU8Qb8 zD6RuallBbfpSEYbn9UAziP2T9p5ppGdacxl3WY= X-Received: by 2002:a05:6512:15a2:b0:50e:3216:ca49 with SMTP id bp34-20020a05651215a200b0050e3216ca49mr8560824lfb.3.1703110272104; Wed, 20 Dec 2023 14:11:12 -0800 (PST) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231220092138.12830-1-mingyen.hsieh@mediatek.com> <20231220092138.12830-3-mingyen.hsieh@mediatek.com> In-Reply-To: <20231220092138.12830-3-mingyen.hsieh@mediatek.com> From: Sean Wang Date: Wed, 20 Dec 2023 16:11:00 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/4] wifi: mt76: mt7921: fix potential command timeout issues when suspend To: Mingyen Hsieh Cc: nbd@nbd.name, lorenzo@kernel.org, deren.wu@mediatek.com, Sean.Wang@mediatek.com, Soul.Huang@mediatek.com, Leon.Yen@mediatek.com, Eric-SY.Chang@mediatek.com, km.lin@mediatek.com, robin.chiu@mediatek.com, ch.yeh@mediatek.com, posh.sun@mediatek.com, Quan.Zhou@mediatek.com, Ryder.Lee@mediatek.com, Shayne.Chen@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Mingyen, On Wed, Dec 20, 2023 at 3:22=E2=80=AFAM Mingyen Hsieh wrote: > > From: Ming Yen Hsieh > > An ongoing command may be interrupted if suspended, leading to a > command timeout. Add a lock to the suspend function in order to > protect the ongoing command from being interrupted. > > Signed-off-by: Leon Yen > Signed-off-by: Ming Yen Hsieh > --- > drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/ne= t/wireless/mediatek/mt76/mt7921/pci.c > index 57903c6e4f11..e1c53f18abdc 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c > @@ -409,7 +409,9 @@ static int mt7921_pci_suspend(struct device *device) > if (err < 0) > goto restore_suspend; > > + mt792x_mutex_acquire(dev); > err =3D mt76_connac_mcu_set_hif_suspend(mdev, true); > + mt792x_mutex_release(dev); I had assumed that all commands would finish up before the suspend handler is called, given that processes are frozen before the suspension can progress. Could you provide more details on the specific conflict between these two commands and how it results in the command timeout? Moreover, while I understand you've identified some potential issues, I suggest we work towards a comprehensive solution to address timeouts caused by potential command conflicts, not just for the specific command. For instance, we should take into account other MCU commands during suspension and extend this consideration to similar scenarios in SDIO suspension. > if (err) > goto restore_suspend; > > -- > 2.18.0 > >