mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Ajay.Kathat@microchip.com>
To: <davidm@egauge.net>
Cc: <Claudiu.Beznea@microchip.com>, <kvalo@codeaurora.org>,
	<davem@davemloft.net>, <kuba@kernel.org>,
	<linux-wireless@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] wilc1000: Allow setting power_save before driver is initialized
Date: Fri, 24 Dec 2021 16:20:50 +0000	[thread overview]
Message-ID: <9272b86e-61ab-1c25-0efb-3cdd2c590db8@microchip.com> (raw)
In-Reply-To: <be3c95c8310504222e88c602a937b7f05cc01286.camel@egauge.net>


On 23/12/21 22:38, David Mosberger-Tang wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On Thu, 2021-12-23 at 14:02 +0000, Ajay.Kathat@microchip.com wrote:
>> I verified with wpa_supplicant and it seems the power save mode is
>> working fine. Tested multiple times with wpa_supplicant running. I
>> didn't observe any issue in entering or exiting the power-save mode with
>> wpa_supplicant.
>>
>> Try to verify without wpa_supplicant in your setup to observe if we are
>> seeing this same results in that case.
> It doesn't help me if it works without wpa_supplicant.  I need a
> reliable way to have power-savings mode in effect when using
> wpa_supplicant.


Okay. In my setup, I observed that PS mode works with and without 
wpa_supplicant. Now tested by following your command sequence.


>> With wpa_supplicant, the current consumption is less when PS mode is
>> enabled but it would be more compared to without wpa_supplicant.
> That's not what I'm talking about though.  The problem is that it seems
> to be rather erratic whether issuing the iw power_save command makes a
> difference in power-consumption.
>
> I fixed my setup so I can directly measure power consumed rather than
> just current (power factor matters).  Again, this is for the entire
> device (not just WILC1000).
>
> What I find that when power-saving mode is working as expected, the
> device uses an average of 1.1W.  When power-saving mode is not working,
> power consumption is about 1.4W, or about 300mW higher.
>
> I tried again *without* the patch applied and, as expected, the patch
> doesn't really affect this behavior.
>
> After playing with this for a while, I think I found two sequences that
> reliably reproduce the difference.
>
> First, on a freshly booted system and with wilc1000-spi autoloaded by
> the kernel, try this sequence (copy & paste the commands):
>
>     /usr/sbin/wpa_supplicant -Bs -iwlan0 -c/etc/wpa_supplicant.conf
>     sleep 10
>     iw dev wlan0 set power_save on
>
> The above yields a power consumption of 1.4W reliably.  The "sleep 10"
> doesn't matter here; the behavior is the same with or without it.  I
> tried waiting up to 120 seconds with no difference.


I have tested by making the WILC as build-in module to insert driver 
automatically at boot-up. I hope it should be fine. Because I have 
already tested as loadable module earlier.

Below are the number observed
------------------------------ --------------------------
- before starting wpa_supplicant             : ~16.3 mA
- wpa_supplicant started                         : ~40 mA
- PSM on                                                  :  ~6 mA


The 'sleep 10' would have no impact in my setup because I have measured 
the current consumption for wilc1000 chip.

I have shared the screenshot at https://postimg.cc/67S41dkb


> Second, on a freshly booted system and with wilc1000-spi autoloaded by
> the kernel, try this sequence (copy & paste the commands):
>
>     /usr/sbin/wpa_supplicant -Bs -iwlan0 -c/etc/wpa_supplicant.conf
>     sleep 10
>     rmmod wilc1000-spi
>     modprobe wilc1000-spi
>     sleep 10
>     iw dev wlan0 set power_save on
>
> The above yields a power consumption of 1.1W reliably.
>
> Can you reproduce this, or, if not, share the power consumption you see
> for the two cases?


Second case was verified earlier and also tested by toggle power_save 
mode on/off many times and I observe the numbers are in same range for 
both cases.

Regards,
Ajay


  reply	other threads:[~2021-12-24 16:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-12  1:18 David Mosberger-Tang
2021-12-12 21:20 ` David Mosberger-Tang
2021-12-15 13:01   ` Ajay.Kathat
2021-12-16  5:37     ` David Mosberger-Tang
     [not found]       ` <49a5456d-6a63-652e-d356-9678f6a9b266@microchip.com>
2021-12-16 15:30         ` David Mosberger-Tang
2021-12-23 14:02           ` Ajay.Kathat
2021-12-23 17:08             ` David Mosberger-Tang
2021-12-24 16:20               ` Ajay.Kathat [this message]
2021-12-24 17:38                 ` David Mosberger-Tang
     [not found]                   ` <f961481a-3f4c-5fd2-c46a-037d923fea4c@microchip.com>
2022-01-04  6:07                     ` David Mosberger-Tang

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=9272b86e-61ab-1c25-0efb-3cdd2c590db8@microchip.com \
    --to=ajay.kathat@microchip.com \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=davem@davemloft.net \
    --cc=davidm@egauge.net \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®