mbox series

[ath-next,v2,0/6] wifi: ath11k: bring hibernation support back

Message ID 20250326-ath11k-bring-hibernation-back-v2-0-87fdc2d6428f@quicinc.com (mailing list archive)
Headers show
Series wifi: ath11k: bring hibernation support back | expand

Message

Baochen Qiang March 26, 2025, 1:33 a.m. UTC
To handle the Lenovo unexpected wakeup issue [1], previously we revert
commit 166a490f59ac ("wifi: ath11k: support hibernation"). However we
need to bring it back, of course with additional changes such that Lenovo
machines would not break.

For suspend (S3), as those machines work well in WoWLAN mode, the thought
here is that we put WLAN target into WoWLAN mode on those machines while
into non-WoWLAN mode (which is done in the reverted commit) on other
machines. This requires us to identify Lenovo machines from others. For
that purpose, read machine info from DMI interface, match it against all
known affected machines. If there is a match, choose WoWLAN suspend mode,
else choose non-WoWLAN mode. This is done in patches [1 - 4/6]

For hibernation (S4), non-WoWLAN mode is chosen for all machines. The
unexpected wakeup issue should not happen in this mode, since WLAN target
power is cut off. To know if the system is going to suspend or to
hibernate, register a notifier such that kernel can notify us of such
infomation. This is done in patch [5/6]

The last patch bring the reverted "wifi: ath11k: restore country code
during resume" commit back.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=219196

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
---
Changes in v2:
- fix compile warnings
- support hibernation on Lenovo machines listed in quirk table
- Link to v1: https://lore.kernel.org/linux-wireless/20250320023003.65028-1-quic_bqiang@quicinc.com/

---
Baochen Qiang (6):
      wifi: ath11k: determine PM policy based on machine model
      wifi: ath11k: introduce ath11k_core_continue_suspend_resume()
      wifi: ath11k: refactor ath11k_core_suspend/_resume()
      wifi: ath11k: support non-WoWLAN mode suspend as well
      wifi: ath11l: choose default PM policy for hibernation
      Reapply "wifi: ath11k: restore country code during resume"

 drivers/net/wireless/ath/ath11k/ahb.c  |   4 +-
 drivers/net/wireless/ath/ath11k/core.c | 294 ++++++++++++++++++++++++++++++---
 drivers/net/wireless/ath/ath11k/core.h |  16 ++
 drivers/net/wireless/ath/ath11k/hif.h  |  14 +-
 drivers/net/wireless/ath/ath11k/mhi.c  |  14 +-
 drivers/net/wireless/ath/ath11k/mhi.h  |   5 +-
 drivers/net/wireless/ath/ath11k/pci.c  |  45 ++++-
 drivers/net/wireless/ath/ath11k/qmi.c  |   4 +-
 8 files changed, 350 insertions(+), 46 deletions(-)
---
base-commit: b6f473c96421b8b451a8df8ccb620bcd71d4b3f4
change-id: 20250324-ath11k-bring-hibernation-back-e11ad8e82adf

Best regards,

Comments

Julian Wollrath March 26, 2025, 5:48 p.m. UTC | #1
Hi,

Am Mi, 26 Mär 2025 09:33:04 +0800
schrieb Baochen Qiang <quic_bqiang@quicinc.com>:

> To handle the Lenovo unexpected wakeup issue [1], previously we revert
> commit 166a490f59ac ("wifi: ath11k: support hibernation"). However we
> need to bring it back, of course with additional changes such that
> Lenovo machines would not break.
> 
> For suspend (S3), as those machines work well in WoWLAN mode, the
> thought here is that we put WLAN target into WoWLAN mode on those
> machines while into non-WoWLAN mode (which is done in the reverted
> commit) on other machines. This requires us to identify Lenovo
> machines from others. For that purpose, read machine info from DMI
> interface, match it against all known affected machines. If there is
> a match, choose WoWLAN suspend mode, else choose non-WoWLAN mode.
> This is done in patches [1 - 4/6]
> 
> For hibernation (S4), non-WoWLAN mode is chosen for all machines. The
> unexpected wakeup issue should not happen in this mode, since WLAN
> target power is cut off. To know if the system is going to suspend or
> to hibernate, register a notifier such that kernel can notify us of
> such infomation. This is done in patch [5/6]

with this, I just want to confirm, everything now works as expected
after hibernation.


Best regards,
Julian

> 
> The last patch bring the reverted "wifi: ath11k: restore country code
> during resume" commit back.
> 
> [1] https://bugzilla.kernel.org/show_bug.cgi?id=219196
> 
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
> ---
> Changes in v2:
> - fix compile warnings
> - support hibernation on Lenovo machines listed in quirk table
> - Link to v1:
> https://lore.kernel.org/linux-wireless/20250320023003.65028-1-quic_bqiang@quicinc.com/
> 
> ---
> Baochen Qiang (6):
>       wifi: ath11k: determine PM policy based on machine model
>       wifi: ath11k: introduce ath11k_core_continue_suspend_resume()
>       wifi: ath11k: refactor ath11k_core_suspend/_resume()
>       wifi: ath11k: support non-WoWLAN mode suspend as well
>       wifi: ath11l: choose default PM policy for hibernation
>       Reapply "wifi: ath11k: restore country code during resume"
> 
>  drivers/net/wireless/ath/ath11k/ahb.c  |   4 +-
>  drivers/net/wireless/ath/ath11k/core.c | 294
> ++++++++++++++++++++++++++++++---
> drivers/net/wireless/ath/ath11k/core.h |  16 ++
> drivers/net/wireless/ath/ath11k/hif.h  |  14 +-
> drivers/net/wireless/ath/ath11k/mhi.c  |  14 +-
> drivers/net/wireless/ath/ath11k/mhi.h  |   5 +-
> drivers/net/wireless/ath/ath11k/pci.c  |  45 ++++-
> drivers/net/wireless/ath/ath11k/qmi.c  |   4 +- 8 files changed, 350
> insertions(+), 46 deletions(-) ---
> base-commit: b6f473c96421b8b451a8df8ccb620bcd71d4b3f4
> change-id: 20250324-ath11k-bring-hibernation-back-e11ad8e82adf
> 
> Best regards,
Baochen Qiang March 27, 2025, 1:52 a.m. UTC | #2
On 3/27/2025 1:48 AM, Julian Wollrath wrote:
> Hi,
> 
> Am Mi, 26 Mär 2025 09:33:04 +0800
> schrieb Baochen Qiang <quic_bqiang@quicinc.com>:
> 
>> To handle the Lenovo unexpected wakeup issue [1], previously we revert
>> commit 166a490f59ac ("wifi: ath11k: support hibernation"). However we
>> need to bring it back, of course with additional changes such that
>> Lenovo machines would not break.
>>
>> For suspend (S3), as those machines work well in WoWLAN mode, the
>> thought here is that we put WLAN target into WoWLAN mode on those
>> machines while into non-WoWLAN mode (which is done in the reverted
>> commit) on other machines. This requires us to identify Lenovo
>> machines from others. For that purpose, read machine info from DMI
>> interface, match it against all known affected machines. If there is
>> a match, choose WoWLAN suspend mode, else choose non-WoWLAN mode.
>> This is done in patches [1 - 4/6]
>>
>> For hibernation (S4), non-WoWLAN mode is chosen for all machines. The
>> unexpected wakeup issue should not happen in this mode, since WLAN
>> target power is cut off. To know if the system is going to suspend or
>> to hibernate, register a notifier such that kernel can notify us of
>> such infomation. This is done in patch [5/6]
> 
> with this, I just want to confirm, everything now works as expected
> after hibernation.

Thank you for testing.

> 
> 
> Best regards,
> Julian
> 
>>
>> The last patch bring the reverted "wifi: ath11k: restore country code
>> during resume" commit back.
>>
>> [1] https://bugzilla.kernel.org/show_bug.cgi?id=219196
>>
>> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
>> ---
>> Changes in v2:
>> - fix compile warnings
>> - support hibernation on Lenovo machines listed in quirk table
>> - Link to v1:
>> https://lore.kernel.org/linux-wireless/20250320023003.65028-1-quic_bqiang@quicinc.com/
>>
>> ---
>> Baochen Qiang (6):
>>       wifi: ath11k: determine PM policy based on machine model
>>       wifi: ath11k: introduce ath11k_core_continue_suspend_resume()
>>       wifi: ath11k: refactor ath11k_core_suspend/_resume()
>>       wifi: ath11k: support non-WoWLAN mode suspend as well
>>       wifi: ath11l: choose default PM policy for hibernation
>>       Reapply "wifi: ath11k: restore country code during resume"
>>
>>  drivers/net/wireless/ath/ath11k/ahb.c  |   4 +-
>>  drivers/net/wireless/ath/ath11k/core.c | 294
>> ++++++++++++++++++++++++++++++---
>> drivers/net/wireless/ath/ath11k/core.h |  16 ++
>> drivers/net/wireless/ath/ath11k/hif.h  |  14 +-
>> drivers/net/wireless/ath/ath11k/mhi.c  |  14 +-
>> drivers/net/wireless/ath/ath11k/mhi.h  |   5 +-
>> drivers/net/wireless/ath/ath11k/pci.c  |  45 ++++-
>> drivers/net/wireless/ath/ath11k/qmi.c  |   4 +- 8 files changed, 350
>> insertions(+), 46 deletions(-) ---
>> base-commit: b6f473c96421b8b451a8df8ccb620bcd71d4b3f4
>> change-id: 20250324-ath11k-bring-hibernation-back-e11ad8e82adf
>>
>> Best regards,
> 
> 
>