From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: sean.wang@mediatek.com
Cc: nbd@nbd.name, Soul.Huang@mediatek.com, YN.Chen@mediatek.com,
Leon.Yen@mediatek.com, Eric-SY.Chang@mediatek.com,
Mark-YW.Chen@mediatek.com, Deren.Wu@mediatek.com,
km.lin@mediatek.com, robin.chiu@mediatek.com,
Eddie.Chen@mediatek.com, ch.yeh@mediatek.com,
posh.sun@mediatek.com, ted.huang@mediatek.com,
Eric.Liang@mediatek.com, Stella.Chang@mediatek.com,
Tom.Chou@mediatek.com, steve.lee@mediatek.com, jsiuda@google.com,
frankgor@google.com, jemele@google.com,
abhishekpandit@google.com, shawnku@google.com,
linux-wireless@vger.kernel.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] mt76: mt7921: fix possible resume failure
Date: Tue, 7 Dec 2021 11:08:49 +0100 [thread overview]
Message-ID: <Ya8ysehFjoEGGEf+@lore-desk> (raw)
In-Reply-To: <ff1e35dcaa0a56c04339bba2ebd2c68bf815919c.1638844068.git.objelf@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1771 bytes --]
> From: Sean Wang <sean.wang@mediatek.com>
>
> 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.
do we have a similar issue in mt7921s_resume()?
>
> Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support")
> Co-developed-by: YN Chen <YN.Chen@mediatek.com>
> Signed-off-by: YN Chen <YN.Chen@mediatek.com>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 7 +++++--
> 1 file changed, 5 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..21a48f02ab60 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,11 @@ 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);
> +
> + pm->suspended = false;
> +
> + return err;
> }
> #endif /* CONFIG_PM */
>
> --
> 2.25.1
>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
WARNING: multiple messages have this Message-ID (diff)
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: sean.wang@mediatek.com
Cc: nbd@nbd.name, Soul.Huang@mediatek.com, YN.Chen@mediatek.com,
Leon.Yen@mediatek.com, Eric-SY.Chang@mediatek.com,
Mark-YW.Chen@mediatek.com, Deren.Wu@mediatek.com,
km.lin@mediatek.com, robin.chiu@mediatek.com,
Eddie.Chen@mediatek.com, ch.yeh@mediatek.com,
posh.sun@mediatek.com, ted.huang@mediatek.com,
Eric.Liang@mediatek.com, Stella.Chang@mediatek.com,
Tom.Chou@mediatek.com, steve.lee@mediatek.com, jsiuda@google.com,
frankgor@google.com, jemele@google.com,
abhishekpandit@google.com, shawnku@google.com,
linux-wireless@vger.kernel.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] mt76: mt7921: fix possible resume failure
Date: Tue, 7 Dec 2021 11:08:49 +0100 [thread overview]
Message-ID: <Ya8ysehFjoEGGEf+@lore-desk> (raw)
In-Reply-To: <ff1e35dcaa0a56c04339bba2ebd2c68bf815919c.1638844068.git.objelf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1771 bytes --]
> From: Sean Wang <sean.wang@mediatek.com>
>
> 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.
do we have a similar issue in mt7921s_resume()?
>
> Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support")
> Co-developed-by: YN Chen <YN.Chen@mediatek.com>
> Signed-off-by: YN Chen <YN.Chen@mediatek.com>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 7 +++++--
> 1 file changed, 5 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..21a48f02ab60 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,11 @@ 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);
> +
> + pm->suspended = false;
> +
> + return err;
> }
> #endif /* CONFIG_PM */
>
> --
> 2.25.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2021-12-07 10:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 2:35 [PATCH] mt76: mt7921: fix possible resume failure sean.wang
2021-12-07 2:35 ` sean.wang
2021-12-07 10:08 ` Lorenzo Bianconi [this message]
2021-12-07 10:08 ` Lorenzo Bianconi
[not found] <Ya8ysehFjoEGGEf+@lore-desk--annotate>
2021-12-07 17:21 ` sean.wang
2021-12-07 17:21 ` sean.wang
2021-12-07 20:08 ` Lorenzo Bianconi
2021-12-07 20:08 ` Lorenzo Bianconi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ya8ysehFjoEGGEf+@lore-desk \
--to=lorenzo.bianconi@redhat.com \
--cc=Deren.Wu@mediatek.com \
--cc=Eddie.Chen@mediatek.com \
--cc=Eric-SY.Chang@mediatek.com \
--cc=Eric.Liang@mediatek.com \
--cc=Leon.Yen@mediatek.com \
--cc=Mark-YW.Chen@mediatek.com \
--cc=Soul.Huang@mediatek.com \
--cc=Stella.Chang@mediatek.com \
--cc=Tom.Chou@mediatek.com \
--cc=YN.Chen@mediatek.com \
--cc=abhishekpandit@google.com \
--cc=ch.yeh@mediatek.com \
--cc=frankgor@google.com \
--cc=jemele@google.com \
--cc=jsiuda@google.com \
--cc=km.lin@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=posh.sun@mediatek.com \
--cc=robin.chiu@mediatek.com \
--cc=sean.wang@mediatek.com \
--cc=shawnku@google.com \
--cc=steve.lee@mediatek.com \
--cc=ted.huang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.