public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Deren.Wu@mediatek.com
Cc: nbd@nbd.name, lorenzo.bianconi@redhat.com,
	sean.wang@mediatek.com, Soul.Huang@mediatek.com,
	YN.Chen@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, Eric.Liang@mediatek.com,
	Stella.Chang@mediatek.com, jemele@google.com,
	yenlinlai@google.com, linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] mt76: mt7921: update statistic in active mode only
Date: Fri, 28 May 2021 12:00:05 +0200	[thread overview]
Message-ID: <YLC/JQhJliH1FM0B@lore-desk> (raw)
In-Reply-To: <9337f7947e1f0921ffb6b4af541d29af9a0a9394.1622112237.git.deren.wu@mediatek.com>


[-- Attachment #1.1: Type: text/plain, Size: 1844 bytes --]

> From: Deren Wu <deren.wu@mediatek.com>
> 
> wakeup chip every 250ms may cause huge power consumption
> 
> try to update statistic counter only if in active status only,
> and it would lead fewer power cost
> 
> Signed-off-by: Deren Wu <deren.wu@mediatek.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 

Hi Deren,

in order to be acceptable we need even patch 2/2. I guess it would be better to
squash them in oreder to not break it.

Regards,
Lorenzo

> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> index e29d4fdab572..212832b34674 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> @@ -1459,13 +1459,15 @@ void mt7921_pm_power_save_work(struct work_struct *work)
>  {
>  	struct mt7921_dev *dev;
>  	unsigned long delta;
> +	struct mt76_phy *mphy;
>  
>  	dev = (struct mt7921_dev *)container_of(work, struct mt7921_dev,
>  						pm.ps_work.work);
> +	mphy = dev->phy.mt76;
>  
>  	delta = dev->pm.idle_timeout;
> -	if (test_bit(MT76_HW_SCANNING, &dev->mphy.state) ||
> -	    test_bit(MT76_HW_SCHED_SCANNING, &dev->mphy.state))
> +	if (test_bit(MT76_HW_SCANNING, &mphy->state) ||
> +	    test_bit(MT76_HW_SCHED_SCANNING, &mphy->state))
>  		goto out;
>  
>  	if (time_is_after_jiffies(dev->pm.last_activity + delta)) {
> @@ -1473,8 +1475,10 @@ void mt7921_pm_power_save_work(struct work_struct *work)
>  		goto out;
>  	}
>  
> -	if (!mt7921_mcu_fw_pmctrl(dev))
> +	if (!mt7921_mcu_fw_pmctrl(dev)) {
> +		cancel_delayed_work_sync(&mphy->mac_work);
>  		return;
> +	}
>  out:
>  	queue_delayed_work(dev->mt76.wq, &dev->pm.ps_work, delta);
>  }
> -- 
> 2.18.0
> 

[-- 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

      reply	other threads:[~2021-05-28 10:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 17:05 [PATCH] mt76: mt7921: update statistic in active mode only Deren.Wu
2021-05-28 10:00 ` Lorenzo Bianconi [this message]

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=YLC/JQhJliH1FM0B@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=Deren.Wu@mediatek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Eric.Liang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Soul.Huang@mediatek.com \
    --cc=Stella.Chang@mediatek.com \
    --cc=YN.Chen@mediatek.com \
    --cc=ch.yeh@mediatek.com \
    --cc=jemele@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=yenlinlai@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox