* [PATCH 0/4] wifi: ath12k: Add new features to ACPI
@ 2024-07-17 11:10 Lingbo Kong
2024-07-17 11:10 ` [PATCH 1/4] wifi: ath12k: Add support for obtaining the buffer type ACPI function bitmap Lingbo Kong
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: Lingbo Kong @ 2024-07-17 11:10 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, quic_lingbok
By reading ACPI tables, implement a method to obtain the ACPI functions
Bitmap, enable or disable specific features based on ACPI Bitflags and
download board data files based on ACPI board data filename extensions.
Lingbo Kong (4):
wifi: ath12k: Add support for obtaining the buffer type ACPI function
bitmap
wifi: ath12k: Add Support for enabling or disabling specific features
based on ACPI bitflag
wifi: ath12k: Adjust the timing to access ACPI table
wifi: ath12k: Add support for reading variant from ACPI to download
board data file
drivers/net/wireless/ath/ath12k/acpi.c | 175 +++++++++++++++++++------
drivers/net/wireless/ath/ath12k/acpi.h | 20 +++
drivers/net/wireless/ath/ath12k/core.c | 29 +++-
drivers/net/wireless/ath/ath12k/core.h | 8 ++
drivers/net/wireless/ath/ath12k/mac.c | 3 +-
drivers/net/wireless/ath/ath12k/qmi.c | 5 +
6 files changed, 192 insertions(+), 48 deletions(-)
base-commit: db1ce56e6e1d395dd42a3cd6332a871d9be59c45
--
2.34.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/4] wifi: ath12k: Add support for obtaining the buffer type ACPI function bitmap
2024-07-17 11:10 [PATCH 0/4] wifi: ath12k: Add new features to ACPI Lingbo Kong
@ 2024-07-17 11:10 ` Lingbo Kong
2024-07-17 16:52 ` Jeff Johnson
2024-07-17 11:10 ` [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag Lingbo Kong
` (2 subsequent siblings)
3 siblings, 1 reply; 14+ messages in thread
From: Lingbo Kong @ 2024-07-17 11:10 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, quic_lingbok
Currently, ath12k does not support obtaining the buffer type ACPI function
bitmap.
To solve this issue, change the code to support obtaining the buffer type
ACPI function bitmap.
This patch will not affect QCN9274, because only WCN7850 supports ACPI.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
---
drivers/net/wireless/ath/ath12k/acpi.c | 16 +++++++++++++++-
drivers/net/wireless/ath/ath12k/acpi.h | 3 +++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath12k/acpi.c b/drivers/net/wireless/ath/ath12k/acpi.c
index 0555d35aab47..d83f7e58fb7a 100644
--- a/drivers/net/wireless/ath/ath12k/acpi.c
+++ b/drivers/net/wireless/ath/ath12k/acpi.c
@@ -12,7 +12,7 @@ static int ath12k_acpi_dsm_get_data(struct ath12k_base *ab, int func)
{
union acpi_object *obj;
acpi_handle root_handle;
- int ret;
+ int ret, i;
root_handle = ACPI_HANDLE(ab->dev);
if (!root_handle) {
@@ -32,6 +32,20 @@ static int ath12k_acpi_dsm_get_data(struct ath12k_base *ab, int func)
ab->acpi.func_bit = obj->integer.value;
} else if (obj->type == ACPI_TYPE_BUFFER) {
switch (func) {
+ case ATH12K_ACPI_DSM_FUNC_SUPPORT_FUNCS:
+ if (obj->buffer.length < ATH12K_ACPI_DSM_FUNC_MIN_BITMAP_SIZE ||
+ obj->buffer.length > ATH12K_ACPI_DSM_FUNC_MAX_BITMAP_SIZE) {
+ ath12k_warn(ab, "invalid ACPI DSM func size: %d\n",
+ obj->buffer.length);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ ab->acpi.func_bit = 0;
+ for (i = 0; i < obj->buffer.length; i++)
+ ab->acpi.func_bit += obj->buffer.pointer[i] << (i * 8);
+
+ break;
case ATH12K_ACPI_DSM_FUNC_TAS_CFG:
if (obj->buffer.length != ATH12K_ACPI_DSM_TAS_CFG_SIZE) {
ath12k_warn(ab, "invalid ACPI DSM TAS config size: %d\n",
diff --git a/drivers/net/wireless/ath/ath12k/acpi.h b/drivers/net/wireless/ath/ath12k/acpi.h
index 39e003d86a48..7ec7a2e72e40 100644
--- a/drivers/net/wireless/ath/ath12k/acpi.h
+++ b/drivers/net/wireless/ath/ath12k/acpi.h
@@ -48,6 +48,9 @@
#define ATH12K_ACPI_DSM_BAND_EDGE_DATA_SIZE 100
#define ATH12K_ACPI_DSM_TAS_CFG_SIZE 108
+#define ATH12K_ACPI_DSM_FUNC_MIN_BITMAP_SIZE 1
+#define ATH12K_ACPI_DSM_FUNC_MAX_BITMAP_SIZE 4
+
#define ATH12K_ACPI_DSM_GEO_OFFSET_DATA_SIZE (ATH12K_ACPI_GEO_OFFSET_DATA_OFFSET + \
ATH12K_ACPI_BIOS_SAR_GEO_OFFSET_LEN)
#define ATH12K_ACPI_DSM_BIOS_SAR_DATA_SIZE (ATH12K_ACPI_POWER_LIMIT_DATA_OFFSET + \
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
2024-07-17 11:10 [PATCH 0/4] wifi: ath12k: Add new features to ACPI Lingbo Kong
2024-07-17 11:10 ` [PATCH 1/4] wifi: ath12k: Add support for obtaining the buffer type ACPI function bitmap Lingbo Kong
@ 2024-07-17 11:10 ` Lingbo Kong
2024-07-17 16:52 ` Jeff Johnson
` (2 more replies)
2024-07-17 11:10 ` [PATCH 3/4] wifi: ath12k: Adjust the timing to access ACPI table Lingbo Kong
2024-07-17 11:10 ` [PATCH 4/4] wifi: ath12k: Add support for reading variant from ACPI to download board data file Lingbo Kong
3 siblings, 3 replies; 14+ messages in thread
From: Lingbo Kong @ 2024-07-17 11:10 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, quic_lingbok
Currently, ath12k does not support enable or disable specific features by
ACPI bitflag.
To address this issue, obtain the ACPI bitflag value and use it to
selectively enable or disable specific features.
This patch will not affect QCN9274, because only WCN7850 supports ACPI.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
---
drivers/net/wireless/ath/ath12k/acpi.c | 31 +++++++++++++++++++++++---
drivers/net/wireless/ath/ath12k/acpi.h | 6 +++++
drivers/net/wireless/ath/ath12k/core.c | 3 +++
drivers/net/wireless/ath/ath12k/core.h | 3 +++
drivers/net/wireless/ath/ath12k/mac.c | 3 ++-
5 files changed, 42 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/acpi.c b/drivers/net/wireless/ath/ath12k/acpi.c
index d83f7e58fb7a..53050f83bc76 100644
--- a/drivers/net/wireless/ath/ath12k/acpi.c
+++ b/drivers/net/wireless/ath/ath12k/acpi.c
@@ -29,7 +29,14 @@ static int ath12k_acpi_dsm_get_data(struct ath12k_base *ab, int func)
}
if (obj->type == ACPI_TYPE_INTEGER) {
- ab->acpi.func_bit = obj->integer.value;
+ switch (func) {
+ case ATH12K_ACPI_DSM_FUNC_SUPPORT_FUNCS:
+ ab->acpi.func_bit = obj->integer.value;
+ break;
+ case ATH12K_ACPI_DSM_FUNC_DISABLE_FLAG:
+ ab->acpi.bit_flag = obj->integer.value;
+ break;
+ }
} else if (obj->type == ACPI_TYPE_BUFFER) {
switch (func) {
case ATH12K_ACPI_DSM_FUNC_SUPPORT_FUNCS:
@@ -267,18 +274,36 @@ int ath12k_acpi_start(struct ath12k_base *ab)
u8 *buf;
int ret;
+ ab->acpi.acpi_tas_enable = false;
+ ab->acpi.acpi_disable_11be = false;
+ ab->acpi.acpi_disable_rfkill = false;
+
if (!ab->hw_params->acpi_guid)
/* not supported with this hardware */
return 0;
- ab->acpi.acpi_tas_enable = false;
-
ret = ath12k_acpi_dsm_get_data(ab, ATH12K_ACPI_DSM_FUNC_SUPPORT_FUNCS);
if (ret) {
ath12k_dbg(ab, ATH12K_DBG_BOOT, "failed to get ACPI DSM data: %d\n", ret);
return ret;
}
+ if (ATH12K_ACPI_FUNC_BIT_VALID(ab->acpi, ATH12K_ACPI_FUNC_BIT_DISABLE_FLAG)) {
+ ret = ath12k_acpi_dsm_get_data(ab, ATH12K_ACPI_DSM_FUNC_DISABLE_FLAG);
+ if (ret) {
+ ath12k_warn(ab, "failed to get ACPI DISABLE FLAG: %d\n", ret);
+ return ret;
+ }
+
+ if (ATH12K_ACPI_CHEK_BIT_VALID(ab->acpi,
+ ATH12K_ACPI_DSM_DISABLE_11BE_BIT))
+ ab->acpi.acpi_disable_11be = true;
+
+ if (!ATH12K_ACPI_CHEK_BIT_VALID(ab->acpi,
+ ATH12K_ACPI_DSM_DISABLE_RFKILL_BIT))
+ ab->acpi.acpi_disable_rfkill = true;
+ }
+
if (ATH12K_ACPI_FUNC_BIT_VALID(ab->acpi, ATH12K_ACPI_FUNC_BIT_TAS_CFG)) {
ret = ath12k_acpi_dsm_get_data(ab, ATH12K_ACPI_DSM_FUNC_TAS_CFG);
if (ret) {
diff --git a/drivers/net/wireless/ath/ath12k/acpi.h b/drivers/net/wireless/ath/ath12k/acpi.h
index 7ec7a2e72e40..cdfd63c60ffb 100644
--- a/drivers/net/wireless/ath/ath12k/acpi.h
+++ b/drivers/net/wireless/ath/ath12k/acpi.h
@@ -9,6 +9,7 @@
#include <linux/acpi.h>
#define ATH12K_ACPI_DSM_FUNC_SUPPORT_FUNCS 0
+#define ATH12K_ACPI_DSM_FUNC_DISABLE_FLAG 2
#define ATH12K_ACPI_DSM_FUNC_BIOS_SAR 4
#define ATH12K_ACPI_DSM_FUNC_GEO_OFFSET 5
#define ATH12K_ACPI_DSM_FUNC_INDEX_CCA 6
@@ -16,6 +17,7 @@
#define ATH12K_ACPI_DSM_FUNC_TAS_DATA 9
#define ATH12K_ACPI_DSM_FUNC_INDEX_BAND_EDGE 10
+#define ATH12K_ACPI_FUNC_BIT_DISABLE_FLAG BIT(1)
#define ATH12K_ACPI_FUNC_BIT_BIOS_SAR BIT(3)
#define ATH12K_ACPI_FUNC_BIT_GEO_OFFSET BIT(4)
#define ATH12K_ACPI_FUNC_BIT_CCA BIT(5)
@@ -25,6 +27,7 @@
#define ATH12K_ACPI_NOTIFY_EVENT 0x86
#define ATH12K_ACPI_FUNC_BIT_VALID(_acdata, _func) (((_acdata).func_bit) & (_func))
+#define ATH12K_ACPI_CHEK_BIT_VALID(_acdata, _func) (((_acdata).bit_flag) & (_func))
#define ATH12K_ACPI_TAS_DATA_VERSION 0x1
#define ATH12K_ACPI_TAS_DATA_ENABLE 0x1
@@ -51,6 +54,9 @@
#define ATH12K_ACPI_DSM_FUNC_MIN_BITMAP_SIZE 1
#define ATH12K_ACPI_DSM_FUNC_MAX_BITMAP_SIZE 4
+#define ATH12K_ACPI_DSM_DISABLE_11BE_BIT BIT(0)
+#define ATH12K_ACPI_DSM_DISABLE_RFKILL_BIT BIT(2)
+
#define ATH12K_ACPI_DSM_GEO_OFFSET_DATA_SIZE (ATH12K_ACPI_GEO_OFFSET_DATA_OFFSET + \
ATH12K_ACPI_BIOS_SAR_GEO_OFFSET_LEN)
#define ATH12K_ACPI_DSM_BIOS_SAR_DATA_SIZE (ATH12K_ACPI_POWER_LIMIT_DATA_OFFSET + \
diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index 51252e8bc1ae..75869e8b211f 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -30,6 +30,9 @@ static int ath12k_core_rfkill_config(struct ath12k_base *ab)
if (!(ab->target_caps.sys_cap_info & WMI_SYS_CAP_INFO_RFKILL))
return 0;
+ if (ab->acpi.acpi_disable_rfkill)
+ return 0;
+
for (i = 0; i < ab->num_radios; i++) {
ar = ab->pdevs[i].ar;
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index cdfd43a7321a..cac6647f2776 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -940,6 +940,9 @@ struct ath12k_base {
u32 func_bit;
bool acpi_tas_enable;
bool acpi_bios_sar_enable;
+ bool acpi_disable_11be;
+ bool acpi_disable_rfkill;
+ u32 bit_flag;
u8 tas_cfg[ATH12K_ACPI_DSM_TAS_CFG_SIZE];
u8 tas_sar_power_table[ATH12K_ACPI_DSM_TAS_DATA_SIZE];
u8 bios_sar_data[ATH12K_ACPI_DSM_BIOS_SAR_DATA_SIZE];
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 8106297f0bc1..a97ec2d821d7 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5484,7 +5484,8 @@ static void ath12k_mac_copy_eht_cap(struct ath12k *ar,
memset(eht_cap, 0, sizeof(struct ieee80211_sta_eht_cap));
- if (!(test_bit(WMI_TLV_SERVICE_11BE, ar->ab->wmi_ab.svc_map)))
+ if (!(test_bit(WMI_TLV_SERVICE_11BE, ar->ab->wmi_ab.svc_map)) ||
+ ar->ab->acpi.acpi_disable_11be)
return;
eht_cap->has_eht = true;
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/4] wifi: ath12k: Adjust the timing to access ACPI table
2024-07-17 11:10 [PATCH 0/4] wifi: ath12k: Add new features to ACPI Lingbo Kong
2024-07-17 11:10 ` [PATCH 1/4] wifi: ath12k: Add support for obtaining the buffer type ACPI function bitmap Lingbo Kong
2024-07-17 11:10 ` [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag Lingbo Kong
@ 2024-07-17 11:10 ` Lingbo Kong
2024-07-17 16:52 ` Jeff Johnson
2024-07-17 11:10 ` [PATCH 4/4] wifi: ath12k: Add support for reading variant from ACPI to download board data file Lingbo Kong
3 siblings, 1 reply; 14+ messages in thread
From: Lingbo Kong @ 2024-07-17 11:10 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, quic_lingbok
Currently, the timing for accessing the ACPI table is inappropriate.
Due to special ACPI requirements, the ACPI table must be obtained before
downloading the board data file. Therefore, adjust the timing for accessing
the ACPI table accordingly.
This patch will not affect QCN9274, because only WCN7850 supports ACPI.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
---
drivers/net/wireless/ath/ath12k/acpi.c | 98 ++++++++++++++++----------
drivers/net/wireless/ath/ath12k/acpi.h | 5 ++
drivers/net/wireless/ath/ath12k/core.c | 5 +-
drivers/net/wireless/ath/ath12k/core.h | 2 +
drivers/net/wireless/ath/ath12k/qmi.c | 5 ++
5 files changed, 72 insertions(+), 43 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/acpi.c b/drivers/net/wireless/ath/ath12k/acpi.c
index 53050f83bc76..33aa1427e6c0 100644
--- a/drivers/net/wireless/ath/ath12k/acpi.c
+++ b/drivers/net/wireless/ath/ath12k/acpi.c
@@ -268,15 +268,69 @@ static int ath12k_acpi_set_tas_params(struct ath12k_base *ab)
return 0;
}
+void ath12k_acpi_set_dsm_func(struct ath12k_base *ab)
+{
+ int ret;
+ u8 *buf;
+
+ if (!ab->hw_params->acpi_guid)
+ /* not supported with this hardware */
+ return;
+
+ if (ab->acpi.acpi_tas_enable) {
+ ret = ath12k_acpi_set_tas_params(ab);
+ if (ret) {
+ ath12k_warn(ab, "failed to send ACPI TAS parameters: %d\n", ret);
+ return;
+ }
+ }
+
+ if (ab->acpi.acpi_bios_sar_enable) {
+ ret = ath12k_acpi_set_bios_sar_params(ab);
+ if (ret) {
+ ath12k_warn(ab, "failed to send ACPI BIOS SAR: %d\n", ret);
+ return;
+ }
+ }
+
+ if (ab->acpi.acpi_cca_enable) {
+ buf = ab->acpi.cca_data + ATH12K_ACPI_CCA_THR_OFFSET_DATA_OFFSET;
+ ret = ath12k_wmi_set_bios_cmd(ab,
+ WMI_BIOS_PARAM_CCA_THRESHOLD_TYPE,
+ buf,
+ ATH12K_ACPI_CCA_THR_OFFSET_LEN);
+ if (ret) {
+ ath12k_warn(ab, "failed to set ACPI DSM CCA threshold: %d\n",
+ ret);
+ return;
+ }
+ }
+
+ if (ab->acpi.acpi_band_edge_enable) {
+ ret = ath12k_wmi_set_bios_cmd(ab,
+ WMI_BIOS_PARAM_TYPE_BANDEDGE,
+ ab->acpi.band_edge_power,
+ sizeof(ab->acpi.band_edge_power));
+ if (ret) {
+ ath12k_warn(ab,
+ "failed to set ACPI DSM band edge channel power: %d\n",
+ ret);
+ return;
+ }
+ }
+}
+
int ath12k_acpi_start(struct ath12k_base *ab)
{
acpi_status status;
- u8 *buf;
int ret;
ab->acpi.acpi_tas_enable = false;
ab->acpi.acpi_disable_11be = false;
ab->acpi.acpi_disable_rfkill = false;
+ ab->acpi.acpi_bios_sar_enable = false;
+ ab->acpi.acpi_cca_enable = false;
+ ab->acpi.acpi_band_edge_enable = false;
if (!ab->hw_params->acpi_guid)
/* not supported with this hardware */
@@ -347,20 +401,6 @@ int ath12k_acpi_start(struct ath12k_base *ab)
ab->acpi.acpi_bios_sar_enable = true;
}
- if (ab->acpi.acpi_tas_enable) {
- ret = ath12k_acpi_set_tas_params(ab);
- if (ret) {
- ath12k_warn(ab, "failed to send ACPI parameters: %d\n", ret);
- return ret;
- }
- }
-
- if (ab->acpi.acpi_bios_sar_enable) {
- ret = ath12k_acpi_set_bios_sar_params(ab);
- if (ret)
- return ret;
- }
-
if (ATH12K_ACPI_FUNC_BIT_VALID(ab->acpi, ATH12K_ACPI_FUNC_BIT_CCA)) {
ret = ath12k_acpi_dsm_get_data(ab, ATH12K_ACPI_DSM_FUNC_INDEX_CCA);
if (ret) {
@@ -371,18 +411,8 @@ int ath12k_acpi_start(struct ath12k_base *ab)
if (ab->acpi.cca_data[0] == ATH12K_ACPI_CCA_THR_VERSION &&
ab->acpi.cca_data[ATH12K_ACPI_CCA_THR_OFFSET_DATA_OFFSET] ==
- ATH12K_ACPI_CCA_THR_ENABLE_FLAG) {
- buf = ab->acpi.cca_data + ATH12K_ACPI_CCA_THR_OFFSET_DATA_OFFSET;
- ret = ath12k_wmi_set_bios_cmd(ab,
- WMI_BIOS_PARAM_CCA_THRESHOLD_TYPE,
- buf,
- ATH12K_ACPI_CCA_THR_OFFSET_LEN);
- if (ret) {
- ath12k_warn(ab, "failed to set ACPI DSM CCA threshold: %d\n",
- ret);
- return ret;
- }
- }
+ ATH12K_ACPI_CCA_THR_ENABLE_FLAG)
+ ab->acpi.acpi_cca_enable = true;
}
if (ATH12K_ACPI_FUNC_BIT_VALID(ab->acpi,
@@ -395,18 +425,8 @@ int ath12k_acpi_start(struct ath12k_base *ab)
}
if (ab->acpi.band_edge_power[0] == ATH12K_ACPI_BAND_EDGE_VERSION &&
- ab->acpi.band_edge_power[1] == ATH12K_ACPI_BAND_EDGE_ENABLE_FLAG) {
- ret = ath12k_wmi_set_bios_cmd(ab,
- WMI_BIOS_PARAM_TYPE_BANDEDGE,
- ab->acpi.band_edge_power,
- sizeof(ab->acpi.band_edge_power));
- if (ret) {
- ath12k_warn(ab,
- "failed to set ACPI DSM band edge channel power: %d\n",
- ret);
- return ret;
- }
- }
+ ab->acpi.band_edge_power[1] == ATH12K_ACPI_BAND_EDGE_ENABLE_FLAG)
+ ab->acpi.acpi_band_edge_enable = true;
}
status = acpi_install_notify_handler(ACPI_HANDLE(ab->dev),
diff --git a/drivers/net/wireless/ath/ath12k/acpi.h b/drivers/net/wireless/ath/ath12k/acpi.h
index cdfd63c60ffb..f3546b02aab7 100644
--- a/drivers/net/wireless/ath/ath12k/acpi.h
+++ b/drivers/net/wireless/ath/ath12k/acpi.h
@@ -68,6 +68,7 @@
int ath12k_acpi_start(struct ath12k_base *ab);
void ath12k_acpi_stop(struct ath12k_base *ab);
+void ath12k_acpi_set_dsm_func(struct ath12k_base *ab);
#else
@@ -80,6 +81,10 @@ static inline void ath12k_acpi_stop(struct ath12k_base *ab)
{
}
+static inline void ath12k_acpi_set_dsm_func(struct ath12k_base *ab)
+{
+}
+
#endif /* CONFIG_ACPI */
#endif /* ATH12K_ACPI_H */
diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index 75869e8b211f..3fd7ece7bcdd 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -842,10 +842,7 @@ static int ath12k_core_start(struct ath12k_base *ab,
goto err_reo_cleanup;
}
- ret = ath12k_acpi_start(ab);
- if (ret)
- /* ACPI is optional so continue in case of an error */
- ath12k_dbg(ab, ATH12K_DBG_BOOT, "acpi failed: %d\n", ret);
+ ath12k_acpi_set_dsm_func(ab);
return 0;
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index cac6647f2776..5177147e2b40 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -942,6 +942,8 @@ struct ath12k_base {
bool acpi_bios_sar_enable;
bool acpi_disable_11be;
bool acpi_disable_rfkill;
+ bool acpi_cca_enable;
+ bool acpi_band_edge_enable;
u32 bit_flag;
u8 tas_cfg[ATH12K_ACPI_DSM_TAS_CFG_SIZE];
u8 tas_sar_power_table[ATH12K_ACPI_DSM_TAS_DATA_SIZE];
diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index b93ce9f87f61..6e5ec4ed533f 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -2527,6 +2527,11 @@ static int ath12k_qmi_request_target_cap(struct ath12k_base *ab)
if (r)
ath12k_dbg(ab, ATH12K_DBG_QMI, "SMBIOS bdf variant name not set.\n");
+ r = ath12k_acpi_start(ab);
+ if (r)
+ /* ACPI is optional so continue in case of an error */
+ ath12k_dbg(ab, ATH12K_DBG_BOOT, "acpi failed: %d\n", r);
+
out:
return ret;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/4] wifi: ath12k: Add support for reading variant from ACPI to download board data file
2024-07-17 11:10 [PATCH 0/4] wifi: ath12k: Add new features to ACPI Lingbo Kong
` (2 preceding siblings ...)
2024-07-17 11:10 ` [PATCH 3/4] wifi: ath12k: Adjust the timing to access ACPI table Lingbo Kong
@ 2024-07-17 11:10 ` Lingbo Kong
2024-07-17 16:52 ` Jeff Johnson
3 siblings, 1 reply; 14+ messages in thread
From: Lingbo Kong @ 2024-07-17 11:10 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, quic_lingbok
Currently, ath12k does not support reading variant from ACPI board data
filename extension for downloading board data file.
To address this issue, obtain the string of the ACPI data filename
extension and use it as part of the string to search for the board data
file from board-2.bin.
This patch will not affect QCN9274, because only WCN7850 supports ACPI.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
---
drivers/net/wireless/ath/ath12k/acpi.c | 30 ++++++++++++++++++++++++++
drivers/net/wireless/ath/ath12k/acpi.h | 6 ++++++
drivers/net/wireless/ath/ath12k/core.c | 21 ++++++++++++++++++
drivers/net/wireless/ath/ath12k/core.h | 3 +++
drivers/net/wireless/ath/ath12k/qmi.c | 4 ++--
5 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/acpi.c b/drivers/net/wireless/ath/ath12k/acpi.c
index 33aa1427e6c0..1ef50fc14325 100644
--- a/drivers/net/wireless/ath/ath12k/acpi.c
+++ b/drivers/net/wireless/ath/ath12k/acpi.c
@@ -37,6 +37,24 @@ static int ath12k_acpi_dsm_get_data(struct ath12k_base *ab, int func)
ab->acpi.bit_flag = obj->integer.value;
break;
}
+ } else if (obj->type == ACPI_TYPE_STRING) {
+ switch (func) {
+ case ATH12K_ACPI_DSM_FUNC_BDF_EXT:
+ if (obj->string.length <= ATH12K_ACPI_BDF_ANCHOR_STRING_LEN ||
+ obj->string.length > ATH12K_ACPI_BDF_MAX_LEN ||
+ memcmp(obj->string.pointer, ATH12K_ACPI_BDF_ANCHOR_STRING,
+ ATH12K_ACPI_BDF_ANCHOR_STRING_LEN)) {
+ ath12k_warn(ab, "invalid ACPI DSM BDF size: %d\n",
+ obj->string.length);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ memcpy(ab->acpi.bdf_string, obj->string.pointer,
+ obj->buffer.length);
+
+ break;
+ }
} else if (obj->type == ACPI_TYPE_BUFFER) {
switch (func) {
case ATH12K_ACPI_DSM_FUNC_SUPPORT_FUNCS:
@@ -331,6 +349,8 @@ int ath12k_acpi_start(struct ath12k_base *ab)
ab->acpi.acpi_bios_sar_enable = false;
ab->acpi.acpi_cca_enable = false;
ab->acpi.acpi_band_edge_enable = false;
+ ab->acpi.acpi_enable_bdf = false;
+ ab->acpi.bdf_string[0] = '\0';
if (!ab->hw_params->acpi_guid)
/* not supported with this hardware */
@@ -358,6 +378,16 @@ int ath12k_acpi_start(struct ath12k_base *ab)
ab->acpi.acpi_disable_rfkill = true;
}
+ if (ATH12K_ACPI_FUNC_BIT_VALID(ab->acpi, ATH12K_ACPI_FUNC_BIT_BDF_EXT)) {
+ ret = ath12k_acpi_dsm_get_data(ab, ATH12K_ACPI_DSM_FUNC_BDF_EXT);
+ if (ret || ab->acpi.bdf_string[0] == '\0') {
+ ath12k_warn(ab, "failed to get ACPI BDF EXT: %d\n", ret);
+ return ret;
+ }
+
+ ab->acpi.acpi_enable_bdf = true;
+ }
+
if (ATH12K_ACPI_FUNC_BIT_VALID(ab->acpi, ATH12K_ACPI_FUNC_BIT_TAS_CFG)) {
ret = ath12k_acpi_dsm_get_data(ab, ATH12K_ACPI_DSM_FUNC_TAS_CFG);
if (ret) {
diff --git a/drivers/net/wireless/ath/ath12k/acpi.h b/drivers/net/wireless/ath/ath12k/acpi.h
index f3546b02aab7..38974a8f99ea 100644
--- a/drivers/net/wireless/ath/ath12k/acpi.h
+++ b/drivers/net/wireless/ath/ath12k/acpi.h
@@ -10,6 +10,7 @@
#define ATH12K_ACPI_DSM_FUNC_SUPPORT_FUNCS 0
#define ATH12K_ACPI_DSM_FUNC_DISABLE_FLAG 2
+#define ATH12K_ACPI_DSM_FUNC_BDF_EXT 3
#define ATH12K_ACPI_DSM_FUNC_BIOS_SAR 4
#define ATH12K_ACPI_DSM_FUNC_GEO_OFFSET 5
#define ATH12K_ACPI_DSM_FUNC_INDEX_CCA 6
@@ -18,6 +19,7 @@
#define ATH12K_ACPI_DSM_FUNC_INDEX_BAND_EDGE 10
#define ATH12K_ACPI_FUNC_BIT_DISABLE_FLAG BIT(1)
+#define ATH12K_ACPI_FUNC_BIT_BDF_EXT BIT(2)
#define ATH12K_ACPI_FUNC_BIT_BIOS_SAR BIT(3)
#define ATH12K_ACPI_FUNC_BIT_GEO_OFFSET BIT(4)
#define ATH12K_ACPI_FUNC_BIT_CCA BIT(5)
@@ -57,6 +59,10 @@
#define ATH12K_ACPI_DSM_DISABLE_11BE_BIT BIT(0)
#define ATH12K_ACPI_DSM_DISABLE_RFKILL_BIT BIT(2)
+#define ATH12K_ACPI_BDF_ANCHOR_STRING_LEN 3
+#define ATH12K_ACPI_BDF_ANCHOR_STRING "BDF"
+#define ATH12K_ACPI_BDF_MAX_LEN 100
+
#define ATH12K_ACPI_DSM_GEO_OFFSET_DATA_SIZE (ATH12K_ACPI_GEO_OFFSET_DATA_OFFSET + \
ATH12K_ACPI_BIOS_SAR_GEO_OFFSET_LEN)
#define ATH12K_ACPI_DSM_BIOS_SAR_DATA_SIZE (ATH12K_ACPI_POWER_LIMIT_DATA_OFFSET + \
diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index 3fd7ece7bcdd..db88ce3ee238 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -677,6 +677,27 @@ int ath12k_core_check_smbios(struct ath12k_base *ab)
return 0;
}
+int ath12k_core_check_acpi(struct ath12k_base *ab)
+{
+ int ret;
+ size_t max_len = sizeof(ab->qmi.target.bdf_ext);
+
+ ret = ath12k_acpi_start(ab);
+ if (ret)
+ /* ACPI is optional so continue in case of an error */
+ ath12k_dbg(ab, ATH12K_DBG_BOOT, "acpi failed: %d\n", ret);
+
+ if (!ab->acpi.acpi_enable_bdf)
+ return -ENODATA;
+
+ if (strscpy(ab->qmi.target.bdf_ext, ab->acpi.bdf_string + 4, max_len) < 0)
+ ath12k_dbg(ab, ATH12K_DBG_BOOT,
+ "acpi bdf variant longer than the buffer (variant: %s)\n",
+ ab->acpi.bdf_string);
+
+ return 0;
+}
+
static int ath12k_core_soc_create(struct ath12k_base *ab)
{
int ret;
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index 5177147e2b40..3fbfb3761d5f 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -944,7 +944,9 @@ struct ath12k_base {
bool acpi_disable_rfkill;
bool acpi_cca_enable;
bool acpi_band_edge_enable;
+ bool acpi_enable_bdf;
u32 bit_flag;
+ char bdf_string[ATH12K_ACPI_BDF_MAX_LEN];
u8 tas_cfg[ATH12K_ACPI_DSM_TAS_CFG_SIZE];
u8 tas_sar_power_table[ATH12K_ACPI_DSM_TAS_DATA_SIZE];
u8 bios_sar_data[ATH12K_ACPI_DSM_BIOS_SAR_DATA_SIZE];
@@ -987,6 +989,7 @@ int ath12k_core_resume_early(struct ath12k_base *ab);
int ath12k_core_resume(struct ath12k_base *ab);
int ath12k_core_suspend(struct ath12k_base *ab);
int ath12k_core_suspend_late(struct ath12k_base *ab);
+int ath12k_core_check_acpi(struct ath12k_base *ab);
const struct firmware *ath12k_core_firmware_request(struct ath12k_base *ab,
const char *filename);
diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index 6e5ec4ed533f..9bc2233080d1 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -2527,10 +2527,10 @@ static int ath12k_qmi_request_target_cap(struct ath12k_base *ab)
if (r)
ath12k_dbg(ab, ATH12K_DBG_QMI, "SMBIOS bdf variant name not set.\n");
- r = ath12k_acpi_start(ab);
+ r = ath12k_core_check_acpi(ab);
if (r)
/* ACPI is optional so continue in case of an error */
- ath12k_dbg(ab, ATH12K_DBG_BOOT, "acpi failed: %d\n", r);
+ ath12k_dbg(ab, ATH12K_DBG_BOOT, "ACPI bdf variant name not set.\n");
out:
return ret;
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 1/4] wifi: ath12k: Add support for obtaining the buffer type ACPI function bitmap
2024-07-17 11:10 ` [PATCH 1/4] wifi: ath12k: Add support for obtaining the buffer type ACPI function bitmap Lingbo Kong
@ 2024-07-17 16:52 ` Jeff Johnson
0 siblings, 0 replies; 14+ messages in thread
From: Jeff Johnson @ 2024-07-17 16:52 UTC (permalink / raw)
To: Lingbo Kong, ath12k; +Cc: linux-wireless
On 7/17/2024 4:10 AM, Lingbo Kong wrote:
> Currently, ath12k does not support obtaining the buffer type ACPI function
> bitmap.
>
> To solve this issue, change the code to support obtaining the buffer type
> ACPI function bitmap.
>
> This patch will not affect QCN9274, because only WCN7850 supports ACPI.
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
2024-07-17 11:10 ` [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag Lingbo Kong
@ 2024-07-17 16:52 ` Jeff Johnson
2024-07-17 20:36 ` kernel test robot
2024-07-17 22:23 ` kernel test robot
2 siblings, 0 replies; 14+ messages in thread
From: Jeff Johnson @ 2024-07-17 16:52 UTC (permalink / raw)
To: Lingbo Kong, ath12k; +Cc: linux-wireless
On 7/17/2024 4:10 AM, Lingbo Kong wrote:
> Currently, ath12k does not support enable or disable specific features by
> ACPI bitflag.
>
> To address this issue, obtain the ACPI bitflag value and use it to
> selectively enable or disable specific features.
>
> This patch will not affect QCN9274, because only WCN7850 supports ACPI.
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/4] wifi: ath12k: Adjust the timing to access ACPI table
2024-07-17 11:10 ` [PATCH 3/4] wifi: ath12k: Adjust the timing to access ACPI table Lingbo Kong
@ 2024-07-17 16:52 ` Jeff Johnson
0 siblings, 0 replies; 14+ messages in thread
From: Jeff Johnson @ 2024-07-17 16:52 UTC (permalink / raw)
To: Lingbo Kong, ath12k; +Cc: linux-wireless
On 7/17/2024 4:10 AM, Lingbo Kong wrote:
> Currently, the timing for accessing the ACPI table is inappropriate.
>
> Due to special ACPI requirements, the ACPI table must be obtained before
> downloading the board data file. Therefore, adjust the timing for accessing
> the ACPI table accordingly.
>
> This patch will not affect QCN9274, because only WCN7850 supports ACPI.
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 4/4] wifi: ath12k: Add support for reading variant from ACPI to download board data file
2024-07-17 11:10 ` [PATCH 4/4] wifi: ath12k: Add support for reading variant from ACPI to download board data file Lingbo Kong
@ 2024-07-17 16:52 ` Jeff Johnson
0 siblings, 0 replies; 14+ messages in thread
From: Jeff Johnson @ 2024-07-17 16:52 UTC (permalink / raw)
To: Lingbo Kong, ath12k; +Cc: linux-wireless
On 7/17/2024 4:10 AM, Lingbo Kong wrote:
> Currently, ath12k does not support reading variant from ACPI board data
> filename extension for downloading board data file.
>
> To address this issue, obtain the string of the ACPI data filename
> extension and use it as part of the string to search for the board data
> file from board-2.bin.
>
> This patch will not affect QCN9274, because only WCN7850 supports ACPI.
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
2024-07-17 11:10 ` [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag Lingbo Kong
2024-07-17 16:52 ` Jeff Johnson
@ 2024-07-17 20:36 ` kernel test robot
2024-07-17 21:44 ` Jeff Johnson
2024-07-17 22:23 ` kernel test robot
2 siblings, 1 reply; 14+ messages in thread
From: kernel test robot @ 2024-07-17 20:36 UTC (permalink / raw)
To: Lingbo Kong, ath12k; +Cc: oe-kbuild-all, linux-wireless, quic_lingbok
Hi Lingbo,
kernel test robot noticed the following build errors:
[auto build test ERROR on db1ce56e6e1d395dd42a3cd6332a871d9be59c45]
url: https://github.com/intel-lab-lkp/linux/commits/Lingbo-Kong/wifi-ath12k-Add-support-for-obtaining-the-buffer-type-ACPI-function-bitmap/20240717-211701
base: db1ce56e6e1d395dd42a3cd6332a871d9be59c45
patch link: https://lore.kernel.org/r/20240717111023.78798-3-quic_lingbok%40quicinc.com
patch subject: [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20240718/202407180403.SFqsPj0v-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240718/202407180403.SFqsPj0v-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407180403.SFqsPj0v-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/net/wireless/ath/ath12k/core.c: In function 'ath12k_core_rfkill_config':
>> drivers/net/wireless/ath/ath12k/core.c:33:15: error: 'struct ath12k_base' has no member named 'acpi'
33 | if (ab->acpi.acpi_disable_rfkill)
| ^~
--
drivers/net/wireless/ath/ath12k/mac.c: In function 'ath12k_mac_copy_eht_cap':
>> drivers/net/wireless/ath/ath12k/mac.c:5488:19: error: 'struct ath12k_base' has no member named 'acpi'
5488 | ar->ab->acpi.acpi_disable_11be)
| ^~
vim +33 drivers/net/wireless/ath/ath12k/core.c
24
25 static int ath12k_core_rfkill_config(struct ath12k_base *ab)
26 {
27 struct ath12k *ar;
28 int ret = 0, i;
29
30 if (!(ab->target_caps.sys_cap_info & WMI_SYS_CAP_INFO_RFKILL))
31 return 0;
32
> 33 if (ab->acpi.acpi_disable_rfkill)
34 return 0;
35
36 for (i = 0; i < ab->num_radios; i++) {
37 ar = ab->pdevs[i].ar;
38
39 ret = ath12k_mac_rfkill_config(ar);
40 if (ret && ret != -EOPNOTSUPP) {
41 ath12k_warn(ab, "failed to configure rfkill: %d", ret);
42 return ret;
43 }
44 }
45
46 return ret;
47 }
48
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
2024-07-17 20:36 ` kernel test robot
@ 2024-07-17 21:44 ` Jeff Johnson
2024-07-18 2:22 ` Lingbo Kong
0 siblings, 1 reply; 14+ messages in thread
From: Jeff Johnson @ 2024-07-17 21:44 UTC (permalink / raw)
To: kernel test robot, Lingbo Kong, ath12k; +Cc: oe-kbuild-all, linux-wireless
On 7/17/2024 1:36 PM, kernel test robot wrote:
> Hi Lingbo,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on db1ce56e6e1d395dd42a3cd6332a871d9be59c45]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Lingbo-Kong/wifi-ath12k-Add-support-for-obtaining-the-buffer-type-ACPI-function-bitmap/20240717-211701
> base: db1ce56e6e1d395dd42a3cd6332a871d9be59c45
> patch link: https://lore.kernel.org/r/20240717111023.78798-3-quic_lingbok%40quicinc.com
> patch subject: [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
> config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20240718/202407180403.SFqsPj0v-lkp@intel.com/config)
> compiler: alpha-linux-gcc (GCC) 13.3.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240718/202407180403.SFqsPj0v-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202407180403.SFqsPj0v-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> drivers/net/wireless/ath/ath12k/core.c: In function 'ath12k_core_rfkill_config':
>>> drivers/net/wireless/ath/ath12k/core.c:33:15: error: 'struct ath12k_base' has no member named 'acpi'
> 33 | if (ab->acpi.acpi_disable_rfkill)
> | ^~
> --
> drivers/net/wireless/ath/ath12k/mac.c: In function 'ath12k_mac_copy_eht_cap':
>>> drivers/net/wireless/ath/ath12k/mac.c:5488:19: error: 'struct ath12k_base' has no member named 'acpi'
> 5488 | ar->ab->acpi.acpi_disable_11be)
> | ^~
>
Lingbo,
looks like you need to have support functions in acpi.c with suitable stub
functions in acpi.h for cases where CONFIG_ACPI is disabled.
You cannot directly access ab->acpi outside acpi.c
Nice catch kernel test robot. Wish I had the resources to run every patch
through a large number of build configurations!
/jeff
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
2024-07-17 11:10 ` [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag Lingbo Kong
2024-07-17 16:52 ` Jeff Johnson
2024-07-17 20:36 ` kernel test robot
@ 2024-07-17 22:23 ` kernel test robot
2 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2024-07-17 22:23 UTC (permalink / raw)
To: Lingbo Kong, ath12k; +Cc: llvm, oe-kbuild-all, linux-wireless, quic_lingbok
Hi Lingbo,
kernel test robot noticed the following build errors:
[auto build test ERROR on db1ce56e6e1d395dd42a3cd6332a871d9be59c45]
url: https://github.com/intel-lab-lkp/linux/commits/Lingbo-Kong/wifi-ath12k-Add-support-for-obtaining-the-buffer-type-ACPI-function-bitmap/20240717-211701
base: db1ce56e6e1d395dd42a3cd6332a871d9be59c45
patch link: https://lore.kernel.org/r/20240717111023.78798-3-quic_lingbok%40quicinc.com
patch subject: [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
config: um-allmodconfig (https://download.01.org/0day-ci/archive/20240718/202407180617.CiqV9Bdm-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project a0c6b8aef853eedaa0980f07c0a502a5a8a9740e)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240718/202407180617.CiqV9Bdm-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407180617.CiqV9Bdm-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/net/wireless/ath/ath12k/core.c:9:
In file included from include/linux/remoteproc.h:40:
In file included from include/linux/virtio.h:7:
In file included from include/linux/scatterlist.h:8:
In file included from include/linux/mm.h:2258:
include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
In file included from drivers/net/wireless/ath/ath12k/core.c:9:
In file included from include/linux/remoteproc.h:40:
In file included from include/linux/virtio.h:7:
In file included from include/linux/scatterlist.h:9:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
548 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
561 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
| ^
In file included from drivers/net/wireless/ath/ath12k/core.c:9:
In file included from include/linux/remoteproc.h:40:
In file included from include/linux/virtio.h:7:
In file included from include/linux/scatterlist.h:9:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
574 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
In file included from drivers/net/wireless/ath/ath12k/core.c:9:
In file included from include/linux/remoteproc.h:40:
In file included from include/linux/virtio.h:7:
In file included from include/linux/scatterlist.h:9:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
585 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
595 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
605 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:693:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
693 | readsb(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:701:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
701 | readsw(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:709:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
709 | readsl(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:718:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
718 | writesb(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:727:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
727 | writesw(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:736:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
736 | writesl(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
>> drivers/net/wireless/ath/ath12k/core.c:33:10: error: no member named 'acpi' in 'struct ath12k_base'
33 | if (ab->acpi.acpi_disable_rfkill)
| ~~ ^
13 warnings and 1 error generated.
--
In file included from drivers/net/wireless/ath/ath12k/mac.c:7:
In file included from include/net/mac80211.h:18:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:8:
In file included from include/linux/cacheflush.h:5:
In file included from arch/um/include/asm/cacheflush.h:4:
In file included from arch/um/include/asm/tlbflush.h:9:
In file included from include/linux/mm.h:2258:
include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
In file included from drivers/net/wireless/ath/ath12k/mac.c:7:
In file included from include/net/mac80211.h:18:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:12:
In file included from include/linux/hardirq.h:11:
In file included from arch/um/include/asm/hardirq.h:5:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:14:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
548 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
561 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
| ^
In file included from drivers/net/wireless/ath/ath12k/mac.c:7:
In file included from include/net/mac80211.h:18:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:12:
In file included from include/linux/hardirq.h:11:
In file included from arch/um/include/asm/hardirq.h:5:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:14:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
574 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
In file included from drivers/net/wireless/ath/ath12k/mac.c:7:
In file included from include/net/mac80211.h:18:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:12:
In file included from include/linux/hardirq.h:11:
In file included from arch/um/include/asm/hardirq.h:5:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:14:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
585 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
595 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
605 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:693:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
693 | readsb(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:701:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
701 | readsw(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:709:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
709 | readsl(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:718:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
718 | writesb(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:727:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
727 | writesw(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:736:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
736 | writesl(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
>> drivers/net/wireless/ath/ath12k/mac.c:5488:14: error: no member named 'acpi' in 'struct ath12k_base'
5488 | ar->ab->acpi.acpi_disable_11be)
| ~~~~~~ ^
13 warnings and 1 error generated.
vim +33 drivers/net/wireless/ath/ath12k/core.c
24
25 static int ath12k_core_rfkill_config(struct ath12k_base *ab)
26 {
27 struct ath12k *ar;
28 int ret = 0, i;
29
30 if (!(ab->target_caps.sys_cap_info & WMI_SYS_CAP_INFO_RFKILL))
31 return 0;
32
> 33 if (ab->acpi.acpi_disable_rfkill)
34 return 0;
35
36 for (i = 0; i < ab->num_radios; i++) {
37 ar = ab->pdevs[i].ar;
38
39 ret = ath12k_mac_rfkill_config(ar);
40 if (ret && ret != -EOPNOTSUPP) {
41 ath12k_warn(ab, "failed to configure rfkill: %d", ret);
42 return ret;
43 }
44 }
45
46 return ret;
47 }
48
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
2024-07-17 21:44 ` Jeff Johnson
@ 2024-07-18 2:22 ` Lingbo Kong
2024-07-18 2:31 ` Jeff Johnson
0 siblings, 1 reply; 14+ messages in thread
From: Lingbo Kong @ 2024-07-18 2:22 UTC (permalink / raw)
To: Jeff Johnson, kernel test robot, ath12k; +Cc: oe-kbuild-all, linux-wireless
On 2024/7/18 5:44, Jeff Johnson wrote:
> On 7/17/2024 1:36 PM, kernel test robot wrote:
>> Hi Lingbo,
>>
>> kernel test robot noticed the following build errors:
>>
>> [auto build test ERROR on db1ce56e6e1d395dd42a3cd6332a871d9be59c45]
>>
>> url: https://github.com/intel-lab-lkp/linux/commits/Lingbo-Kong/wifi-ath12k-Add-support-for-obtaining-the-buffer-type-ACPI-function-bitmap/20240717-211701
>> base: db1ce56e6e1d395dd42a3cd6332a871d9be59c45
>> patch link: https://lore.kernel.org/r/20240717111023.78798-3-quic_lingbok%40quicinc.com
>> patch subject: [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
>> config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20240718/202407180403.SFqsPj0v-lkp@intel.com/config)
>> compiler: alpha-linux-gcc (GCC) 13.3.0
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240718/202407180403.SFqsPj0v-lkp@intel.com/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202407180403.SFqsPj0v-lkp@intel.com/
>>
>> All errors (new ones prefixed by >>):
>>
>> drivers/net/wireless/ath/ath12k/core.c: In function 'ath12k_core_rfkill_config':
>>>> drivers/net/wireless/ath/ath12k/core.c:33:15: error: 'struct ath12k_base' has no member named 'acpi'
>> 33 | if (ab->acpi.acpi_disable_rfkill)
>> | ^~
>> --
>> drivers/net/wireless/ath/ath12k/mac.c: In function 'ath12k_mac_copy_eht_cap':
>>>> drivers/net/wireless/ath/ath12k/mac.c:5488:19: error: 'struct ath12k_base' has no member named 'acpi'
>> 5488 | ar->ab->acpi.acpi_disable_11be)
>> | ^~
>>
>
> Lingbo,
> looks like you need to have support functions in acpi.c with suitable stub
> functions in acpi.h for cases where CONFIG_ACPI is disabled.
>
> You cannot directly access ab->acpi outside acpi.c
>
> Nice catch kernel test robot. Wish I had the resources to run every patch
> through a large number of build configurations!
>
> /jeff
thanks a lot! jeff,
i'll change it in next version.
When i checked these codes using ath12k-check and smatch, these issues
did not appear:(
Out of curiosity, how can i set up a similar kernel test boot locally?
i can avoid issues like this when sending public reviews.
/lingbo kong
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
2024-07-18 2:22 ` Lingbo Kong
@ 2024-07-18 2:31 ` Jeff Johnson
0 siblings, 0 replies; 14+ messages in thread
From: Jeff Johnson @ 2024-07-18 2:31 UTC (permalink / raw)
To: Lingbo Kong, kernel test robot, ath12k; +Cc: oe-kbuild-all, linux-wireless
On 7/17/2024 7:22 PM, Lingbo Kong wrote:
>
>
> On 2024/7/18 5:44, Jeff Johnson wrote:
>> On 7/17/2024 1:36 PM, kernel test robot wrote:
>>> Hi Lingbo,
>>>
>>> kernel test robot noticed the following build errors:
>>>
>>> [auto build test ERROR on db1ce56e6e1d395dd42a3cd6332a871d9be59c45]
>>>
>>> url: https://github.com/intel-lab-lkp/linux/commits/Lingbo-Kong/wifi-ath12k-Add-support-for-obtaining-the-buffer-type-ACPI-function-bitmap/20240717-211701
>>> base: db1ce56e6e1d395dd42a3cd6332a871d9be59c45
>>> patch link: https://lore.kernel.org/r/20240717111023.78798-3-quic_lingbok%40quicinc.com
>>> patch subject: [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag
>>> config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20240718/202407180403.SFqsPj0v-lkp@intel.com/config)
>>> compiler: alpha-linux-gcc (GCC) 13.3.0
>>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240718/202407180403.SFqsPj0v-lkp@intel.com/reproduce)
>>>
>>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>>> the same patch/commit), kindly add following tags
>>> | Reported-by: kernel test robot <lkp@intel.com>
>>> | Closes: https://lore.kernel.org/oe-kbuild-all/202407180403.SFqsPj0v-lkp@intel.com/
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>> drivers/net/wireless/ath/ath12k/core.c: In function 'ath12k_core_rfkill_config':
>>>>> drivers/net/wireless/ath/ath12k/core.c:33:15: error: 'struct ath12k_base' has no member named 'acpi'
>>> 33 | if (ab->acpi.acpi_disable_rfkill)
>>> | ^~
>>> --
>>> drivers/net/wireless/ath/ath12k/mac.c: In function 'ath12k_mac_copy_eht_cap':
>>>>> drivers/net/wireless/ath/ath12k/mac.c:5488:19: error: 'struct ath12k_base' has no member named 'acpi'
>>> 5488 | ar->ab->acpi.acpi_disable_11be)
>>> | ^~
>>>
>>
>> Lingbo,
>> looks like you need to have support functions in acpi.c with suitable stub
>> functions in acpi.h for cases where CONFIG_ACPI is disabled.
>>
>> You cannot directly access ab->acpi outside acpi.c
>>
>> Nice catch kernel test robot. Wish I had the resources to run every patch
>> through a large number of build configurations!
>>
>> /jeff
>
> thanks a lot! jeff,
>
> i'll change it in next version.
> When i checked these codes using ath12k-check and smatch, these issues
> did not appear:(
> Out of curiosity, how can i set up a similar kernel test boot locally?
> i can avoid issues like this when sending public reviews.
These aren't boot issues, they are build issues. The only way to recreate is
to build for all supported architectures. Note that this was found when
building config: alpha-allyesconfig, compiler: alpha-linux-gcc (GCC) 13.3.0,
so for ARCH=alpha. So you can recreated by downloading the alpha-linux-gcc
toolchain from crosstools and building the allyesconfig with ARCH=alpha.
/jeff
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2024-07-18 2:31 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-17 11:10 [PATCH 0/4] wifi: ath12k: Add new features to ACPI Lingbo Kong
2024-07-17 11:10 ` [PATCH 1/4] wifi: ath12k: Add support for obtaining the buffer type ACPI function bitmap Lingbo Kong
2024-07-17 16:52 ` Jeff Johnson
2024-07-17 11:10 ` [PATCH 2/4] wifi: ath12k: Add Support for enabling or disabling specific features based on ACPI bitflag Lingbo Kong
2024-07-17 16:52 ` Jeff Johnson
2024-07-17 20:36 ` kernel test robot
2024-07-17 21:44 ` Jeff Johnson
2024-07-18 2:22 ` Lingbo Kong
2024-07-18 2:31 ` Jeff Johnson
2024-07-17 22:23 ` kernel test robot
2024-07-17 11:10 ` [PATCH 3/4] wifi: ath12k: Adjust the timing to access ACPI table Lingbo Kong
2024-07-17 16:52 ` Jeff Johnson
2024-07-17 11:10 ` [PATCH 4/4] wifi: ath12k: Add support for reading variant from ACPI to download board data file Lingbo Kong
2024-07-17 16:52 ` Jeff Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).