From: Lorenzo Bianconi <lorenzo@kernel.org>
To: sean.wang@mediatek.com
Cc: lorenzo.bianconi@redhat.com, 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, jenhao.yang@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 1/2] mt76: mt7921s: make pm->suspended usage consistent
Date: Mon, 13 Dec 2021 10:53:43 +0100 [thread overview]
Message-ID: <YbcYJ47OKfh0A5Vt@lore-desk> (raw)
In-Reply-To: <1639242882-15796-1-git-send-email-sean.wang@mediatek.com>
[-- Attachment #1.1: Type: text/plain, Size: 1998 bytes --]
> From: Sean Wang <sean.wang@mediatek.com>
>
> >> From: Sean Wang <sean.wang@mediatek.com>
> >>
> >> Update pm->suspended usage to be consistent with mt7921e driver.
> >>
> >> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> >> ---
> >> drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 7 +++++--
> >> 1 file changed, 5 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..44ee9369f6bf 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,11 @@ 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);
> >
> >should we check return value here? Something like:
> >
> > if (err)
> > return err;
> >
> > pm->suspended = false;
> > return 0;
> >
> >Or, is the chip up even if mt76_connac_mcu_set_hif_suspend() fails?
>
> yes, chip is eventually up again by recovered with the following wifi reset
>
> with current logic, if do so (not mark pm->suspended back as false to show suspend/resume is over),
>
> the pm runtime would not be enabled again after the wifi reset
maybe we should just set pm->suspended = false; in mt7921_mac_reset_work() as
we do for hw_full_reset, wdyt?
Regards,
Lorenzo
>
> >> +
> >> + pm->suspended = false;
> >> +
> >> + return err;
> >> }
> >>
> >> static const struct dev_pm_ops mt7921s_pm_ops = {
> >> --
> >> 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@kernel.org>
To: sean.wang@mediatek.com
Cc: lorenzo.bianconi@redhat.com, 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, jenhao.yang@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 1/2] mt76: mt7921s: make pm->suspended usage consistent
Date: Mon, 13 Dec 2021 10:53:43 +0100 [thread overview]
Message-ID: <YbcYJ47OKfh0A5Vt@lore-desk> (raw)
In-Reply-To: <1639242882-15796-1-git-send-email-sean.wang@mediatek.com>
[-- Attachment #1: Type: text/plain, Size: 1998 bytes --]
> From: Sean Wang <sean.wang@mediatek.com>
>
> >> From: Sean Wang <sean.wang@mediatek.com>
> >>
> >> Update pm->suspended usage to be consistent with mt7921e driver.
> >>
> >> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> >> ---
> >> drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 7 +++++--
> >> 1 file changed, 5 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..44ee9369f6bf 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,11 @@ 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);
> >
> >should we check return value here? Something like:
> >
> > if (err)
> > return err;
> >
> > pm->suspended = false;
> > return 0;
> >
> >Or, is the chip up even if mt76_connac_mcu_set_hif_suspend() fails?
>
> yes, chip is eventually up again by recovered with the following wifi reset
>
> with current logic, if do so (not mark pm->suspended back as false to show suspend/resume is over),
>
> the pm runtime would not be enabled again after the wifi reset
maybe we should just set pm->suspended = false; in mt7921_mac_reset_work() as
we do for hw_full_reset, wdyt?
Regards,
Lorenzo
>
> >> +
> >> + pm->suspended = false;
> >> +
> >> + return err;
> >> }
> >>
> >> static const struct dev_pm_ops mt7921s_pm_ops = {
> >> --
> >> 2.25.1
> >>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2021-12-13 10:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <YbTU08hzeTSJPIsp@lore-desk--annotate>
2021-12-11 17:14 ` [PATCH 1/2] mt76: mt7921s: make pm->suspended usage consistent sean.wang
2021-12-11 17:14 ` sean.wang
2021-12-13 9:53 ` Lorenzo Bianconi [this message]
2021-12-13 9:53 ` Lorenzo Bianconi
[not found] <YbcYJ47OKfh0A5Vt@lore-desk--annotate>
2021-12-13 18:58 ` sean.wang
2021-12-13 18:58 ` sean.wang
2021-12-11 16:31 sean.wang
2021-12-11 16:31 ` sean.wang
2021-12-11 16:41 ` Lorenzo Bianconi
2021-12-11 16:41 ` 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=YbcYJ47OKfh0A5Vt@lore-desk \
--to=lorenzo@kernel.org \
--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=jenhao.yang@mediatek.com \
--cc=jsiuda@google.com \
--cc=km.lin@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--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.