Skip to content

Commit 43ed15e

Browse files
Carl HuangKalle Valo
authored andcommitted
ath11k: put hw to DBS using WMI_PDEV_SET_HW_MODE_CMDID
It's recommended to use wmi command WMI_PDEV_SET_HW_MODE_CMDID to put hardware to dbs mode instead of wmi_init command. This fixes a few strange stability issues. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent fc46e1b commit 43ed15e

File tree

4 files changed

+46
-13
lines changed

4 files changed

+46
-13
lines changed

drivers/net/wireless/ath/ath11k/core.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
5151
.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq8074,
5252
.svc_to_ce_map_len = 21,
5353
.single_pdev_only = false,
54-
.needs_band_to_mac = true,
5554
.rxdma1_enable = true,
5655
.num_rxmda_per_pdev = 1,
5756
.rx_mac_buf_ring = false,
@@ -89,7 +88,6 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
8988
.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq6018,
9089
.svc_to_ce_map_len = 19,
9190
.single_pdev_only = false,
92-
.needs_band_to_mac = true,
9391
.rxdma1_enable = true,
9492
.num_rxmda_per_pdev = 1,
9593
.rx_mac_buf_ring = false,
@@ -127,7 +125,6 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
127125
.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390,
128126
.svc_to_ce_map_len = 14,
129127
.single_pdev_only = true,
130-
.needs_band_to_mac = false,
131128
.rxdma1_enable = false,
132129
.num_rxmda_per_pdev = 2,
133130
.rx_mac_buf_ring = true,
@@ -646,6 +643,15 @@ static int ath11k_core_start(struct ath11k_base *ab,
646643
goto err_reo_cleanup;
647644
}
648645

646+
/* put hardware to DBS mode */
647+
if (ab->hw_params.single_pdev_only) {
648+
ret = ath11k_wmi_set_hw_mode(ab, WMI_HOST_HW_MODE_DBS);
649+
if (ret) {
650+
ath11k_err(ab, "failed to send dbs mode: %d\n", ret);
651+
goto err_hif_stop;
652+
}
653+
}
654+
649655
ret = ath11k_dp_tx_htt_h2t_ver_req_msg(ab);
650656
if (ret) {
651657
ath11k_err(ab, "failed to send htt version request message: %d\n",

drivers/net/wireless/ath/ath11k/hw.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,6 @@ struct ath11k_hw_params {
143143

144144
bool single_pdev_only;
145145

146-
/* For example on QCA6390 struct
147-
* wmi_init_cmd_param::band_to_mac_config needs to be false as the
148-
* firmware creates the mapping.
149-
*/
150-
bool needs_band_to_mac;
151-
152146
bool rxdma1_enable;
153147
int num_rxmda_per_pdev;
154148
bool rx_mac_buf_ring;

drivers/net/wireless/ath/ath11k/wmi.c

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3479,6 +3479,35 @@ int ath11k_wmi_wait_for_unified_ready(struct ath11k_base *ab)
34793479
return 0;
34803480
}
34813481

3482+
int ath11k_wmi_set_hw_mode(struct ath11k_base *ab,
3483+
enum wmi_host_hw_mode_config_type mode)
3484+
{
3485+
struct wmi_pdev_set_hw_mode_cmd_param *cmd;
3486+
struct sk_buff *skb;
3487+
struct ath11k_wmi_base *wmi_ab = &ab->wmi_ab;
3488+
int len;
3489+
int ret;
3490+
3491+
len = sizeof(*cmd);
3492+
3493+
skb = ath11k_wmi_alloc_skb(wmi_ab, len);
3494+
cmd = (struct wmi_pdev_set_hw_mode_cmd_param *)skb->data;
3495+
3496+
cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SET_HW_MODE_CMD) |
3497+
FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE);
3498+
3499+
cmd->pdev_id = WMI_PDEV_ID_SOC;
3500+
cmd->hw_mode_index = mode;
3501+
3502+
ret = ath11k_wmi_cmd_send(&wmi_ab->wmi[0], skb, WMI_PDEV_SET_HW_MODE_CMDID);
3503+
if (ret) {
3504+
ath11k_warn(ab, "failed to send WMI_PDEV_SET_HW_MODE_CMDID\n");
3505+
dev_kfree_skb(skb);
3506+
}
3507+
3508+
return ret;
3509+
}
3510+
34823511
int ath11k_wmi_cmd_init(struct ath11k_base *ab)
34833512
{
34843513
struct ath11k_wmi_base *wmi_sc = &ab->wmi_ab;
@@ -3497,10 +3526,11 @@ int ath11k_wmi_cmd_init(struct ath11k_base *ab)
34973526
init_param.hw_mode_id = wmi_sc->preferred_hw_mode;
34983527
init_param.mem_chunks = wmi_sc->mem_chunks;
34993528

3500-
if (ab->hw_params.needs_band_to_mac) {
3501-
init_param.num_band_to_mac = ab->num_radios;
3502-
ath11k_fill_band_to_mac_param(ab, init_param.band_to_mac);
3503-
}
3529+
if (ab->hw_params.single_pdev_only)
3530+
init_param.hw_mode_id = WMI_HOST_HW_MODE_MAX;
3531+
3532+
init_param.num_band_to_mac = ab->num_radios;
3533+
ath11k_fill_band_to_mac_param(ab, init_param.band_to_mac);
35043534

35053535
return ath11k_init_cmd_send(&wmi_sc->wmi[0], &init_param);
35063536
}

drivers/net/wireless/ath/ath11k/wmi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5171,4 +5171,7 @@ int ath11k_wmi_fils_discovery(struct ath11k *ar, u32 vdev_id, u32 interval,
51715171
bool unsol_bcast_probe_resp_enabled);
51725172
int ath11k_wmi_probe_resp_tmpl(struct ath11k *ar, u32 vdev_id,
51735173
struct sk_buff *tmpl);
5174+
int ath11k_wmi_set_hw_mode(struct ath11k_base *ab,
5175+
enum wmi_host_hw_mode_config_type mode);
5176+
51745177
#endif

0 commit comments

Comments
 (0)