From: Julian Wollrath <jwollrath@web.de>
To: Baochen Qiang <quic_bqiang@quicinc.com>
Cc: <ath11k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH ath-next 1/5] wifi: ath11k: determine PM policy based on machine model
Date: Tue, 25 Mar 2025 11:40:04 +0100 [thread overview]
Message-ID: <20250325114004.101a7c10@schienar> (raw)
In-Reply-To: <20250320023003.65028-2-quic_bqiang@quicinc.com>
Hi,
Am Do, 20 Mär 2025 10:29:59 +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"). So
> currently WLAN target is put into WoWLAN mode during suspend. This is
> a temporary solution as it does not work on machines where WLAN power
> is cut off.
>
> The thought here is that we do WoWLAN suspend on Lenovo machines while
> do non-WoWLAN suspend (which is done in the reverted commit) on other
> machines. This requires us to identify Lenovo machines from others.
> For that purpose, read board vendor and product name from DMI
> interface, match it against all known affected machines. If there is
> a match, choose WoWLAN suspend mode, else choose non-WoWLAN mode.
> Save the mode in ab for later reference.
>
> [1] https://bugzilla.kernel.org/show_bug.cgi?id=219196
>
> Tested-on: WCN6855 hw2.0 PCI
> WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30
>
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
> ---
> drivers/net/wireless/ath/ath11k/core.c | 55
> ++++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/core.h |
> 7 ++++ 2 files changed, 62 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath11k/core.c
> b/drivers/net/wireless/ath/ath11k/core.c index
> 3d39ff85ba94..8657e735bf16 100644 ---
> a/drivers/net/wireless/ath/ath11k/core.c +++
> b/drivers/net/wireless/ath/ath11k/core.c @@ -907,6 +907,52 @@ static
> const struct ath11k_hw_params ath11k_hw_params[] = { },
> };
>
> +static const struct dmi_system_id ath11k_pm_quirk_table[] = {
> + {
> + .driver_data = (void *)ATH11K_PM_WOW,
> + .matches = {
> + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "21J4"),
> + },
> + },
> + {
> + .driver_data = (void *)ATH11K_PM_WOW,
> + .matches = {
> + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "21K4"),
> + },
> + },
including the quirk for 21K4 is not needed (at least for my machine)
but causes the interface to not come up again after putting the system
into hibernation.
Cheers,
Julian
> + {
> + .driver_data = (void *)ATH11K_PM_WOW,
> + .matches = {
> + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "21K6"),
> + },
> + },
> + {
> + .driver_data = (void *)ATH11K_PM_WOW,
> + .matches = {
> + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "21K8"),
> + },
> + },
> + {
> + .driver_data = (void *)ATH11K_PM_WOW,
> + .matches = {
> + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "21KA"),
> + },
> + },
> + {
> + .driver_data = (void *)ATH11K_PM_WOW,
> + .matches = {
> + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "21F9"),
> + },
> + },
> + {}
> +};
> +
> static inline struct ath11k_pdev *ath11k_core_get_single_pdev(struct
> ath11k_base *ab) {
> WARN_ON(!ab->hw_params.single_pdev_only);
> @@ -2327,8 +2373,17 @@ EXPORT_SYMBOL(ath11k_core_pre_init);
>
> int ath11k_core_init(struct ath11k_base *ab)
> {
> + const struct dmi_system_id *dmi_id;
> int ret;
>
> + dmi_id = dmi_first_match(ath11k_pm_quirk_table);
> + if (dmi_id)
> + ab->pm_policy = (enum
> ath11k_pm_policy)dmi_id->driver_data;
> + else
> + ab->pm_policy = ATH11K_PM_DEFAULT;
> +
> + ath11k_dbg(ab, ATH11K_DBG_BOOT, "pm policy %u\n",
> ab->pm_policy); +
> ret = ath11k_core_soc_create(ab);
> if (ret) {
> ath11k_err(ab, "failed to create soc core: %d\n",
> ret); diff --git a/drivers/net/wireless/ath/ath11k/core.h
> b/drivers/net/wireless/ath/ath11k/core.h index
> 1a3d0de4afde..df2b0cb2f0b5 100644 ---
> a/drivers/net/wireless/ath/ath11k/core.h +++
> b/drivers/net/wireless/ath/ath11k/core.h @@ -892,6 +892,11 @@ struct
> ath11k_msi_config { u16 hw_rev;
> };
>
> +enum ath11k_pm_policy {
> + ATH11K_PM_DEFAULT,
> + ATH11K_PM_WOW,
> +};
> +
> /* Master structure to hold the hw data which may be used in core
> module */ struct ath11k_base {
> enum ath11k_hw_rev hw_rev;
> @@ -1058,6 +1063,8 @@ struct ath11k_base {
> } testmode;
> #endif
>
> + enum ath11k_pm_policy pm_policy;
> +
> /* must be last */
> u8 drv_priv[] __aligned(sizeof(void *));
> };
--
() ascii ribbon campaign - against html e-mail
/\ - against proprietary attachments
next prev parent reply other threads:[~2025-03-25 10:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 2:29 [PATCH ath-next 0/5] wifi: ath11k: bring hibernation support back Baochen Qiang
2025-03-20 2:29 ` [PATCH ath-next 1/5] wifi: ath11k: determine PM policy based on machine model Baochen Qiang
2025-03-20 22:43 ` kernel test robot
2025-03-21 16:24 ` Jeff Johnson
2025-03-25 10:40 ` Julian Wollrath [this message]
2025-03-25 10:45 ` Baochen Qiang
2025-03-20 2:30 ` [PATCH ath-next 2/5] wifi: ath11k: introduce ath11k_core_continue_suspend_resume() Baochen Qiang
2025-03-20 2:30 ` [PATCH ath-next 3/5] wifi: ath11k: refactor ath11k_core_suspend/_resume() Baochen Qiang
2025-03-20 2:30 ` [PATCH ath-next 4/5] wifi: ath11k: support non-WoWLAN mode suspend as well Baochen Qiang
2025-03-20 2:30 ` [PATCH ath-next 5/5] Reapply "wifi: ath11k: restore country code during resume" Baochen Qiang
2025-03-23 20:12 ` [PATCH ath-next 0/5] wifi: ath11k: bring hibernation support back Muhammad Usama Anjum
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=20250325114004.101a7c10@schienar \
--to=jwollrath@web.de \
--cc=ath11k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_bqiang@quicinc.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