Search Linux Wireless

Re: [PATCH] wifi: wilc1000: Keep slot powered on during suspend/resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 8/28/24 00:42, Alexis Lothoré wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 8/27/24 17:20, Marek Vasut wrote:
>> On 8/27/24 11:53 AM, Alexis Lothoré wrote:
> 
> [...]
> 
>>>> -    return 0;
>>>> +    return sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
>>>>   }
>>>
>>> This change breaks suspend/resume on my wilc1000 setup (sama5d2 wlsom evk +
>>> wilc1000 sd):
>>>
>>> # echo mem > /sys/power/state
>>> PM: suspend entry (deep)
>>> Filesystems sync: 0.055 seconds
>>> Freezing user space processes
>>> Freezing user space processes completed (elapsed 0.018 seconds)
>>> OOM killer disabled.
>>> Freezing remaining freezable tasks
>>> Freezing remaining freezable tasks completed (elapsed 0.006 seconds)
>>> wilc1000_sdio mmc0:0001:1: sdio suspend
>>> wilc1000_sdio mmc0:0001:1: PM: dpm_run_callback(): pm_generic_suspend returns -22
>>> wilc1000_sdio mmc0:0001:1: PM: failed to suspend async: error -22
>>> PM: Some devices failed to suspend, or early wake event detected
>>> OOM killer enabled.
>>> Restarting tasks ... done.
>>> random: crng reseeded on system resumption
>>> PM: suspend exit
>>> sh: write error: Invalid argument
>>>
>>> But I have to dig more to really understand the root cause.
>>
>> Does your MMC controller struct mmc_host set .pm_caps |= MMC_PM_KEEP_POWER ?
>> Maybe that's the problem, that the controller does not set these PM caps ?
> 
> It looks like you are right, my sdmmc controller was missing some
> keep-power-in-suspend flag in my device tree, preventing your change to work on
> my platform. So it behaves correctly for me with both wilc1000/wilc3000, thanks.
> 
> Looks ok for me, but others may have a more informed opinion than me about the
> impact of this change.
> 

When the host suspend is triggered, the WILC power consumption should be
reduced since it is controlled via chip_allow_sleep() sequence which is
irrespective of MMC_PM_KEEP_POWER flag state of the host. So I'm not sure why
there was no difference observed in Marek's setup. It may be that when the
power consumption was measured,the WILC suspend state is not enabled because
of MMC controller pm_caps in the test setup.

I think it is better to have a generic patch for any host which has
MMC_PM_KEEP_POWER capabilities defined or not. With proposed patch, driver
will not allow the host to go into the suspend state when MMC_PM_KEEP_POWER is
not set in PM caps. I think, sdio_set_host_pm_flags() should only be called if
MMC_PM_KEEP_POWER is defined in the host.

Actually, WILC can support suspend mode with or without this host
capabilities. For SDIO, the host can be wake-up using the external IRQ GPIO
(uses out-of-band, instead of in-band interrupt) on WILC.

To test wake-on-wlan(wowlan) in suspend mode, the IRQ pin from WILC should be
connected with the host that will help to interrupt/wake the host when any
WiFi packet arrives. Without 'wowlan' enabled in suspend mode, the host should
be allowed to go into suspend mode but it can't be wake-up by WiFi packets.
All the packets will be dropped in the firmware in suspend state.

WILC supports only ANY option for wowlan. So, after connecting the IRQ line
with host, the below commands can be used to test "wowlan" in suspend state.


#  iw phy <phyname> wowlan enable any
#  echo mem > /sys/power/state


Regards,
Ajay






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux