Commit 8b8b990f authored by Manish Dharanenthiran's avatar Manish Dharanenthiran Committed by Kalle Valo

wifi: ath12k: fix WARN_ON during ath12k_mac_update_vif_chan

Fix WARN_ON() from ath12k_mac_update_vif_chan() if vdev is not up.
Since change_chanctx can be called even before vdev_up.

Do vdev stop followed by a vdev start in case of vdev is down.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-02903-QCAHKSWPL_SILICONZ-1
Signed-off-by: default avatarManish Dharanenthiran <quic_mdharane@quicinc.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230802085852.19821-2-quic_mdharane@quicinc.com
parent 7791487c
...@@ -6039,15 +6039,30 @@ ath12k_mac_update_vif_chan(struct ath12k *ar, ...@@ -6039,15 +6039,30 @@ ath12k_mac_update_vif_chan(struct ath12k *ar,
if (WARN_ON(!arvif->is_started)) if (WARN_ON(!arvif->is_started))
continue; continue;
if (WARN_ON(!arvif->is_up)) /* Firmware expect vdev_restart only if vdev is up.
continue; * If vdev is down then it expect vdev_stop->vdev_start.
*/
if (arvif->is_up) {
ret = ath12k_mac_vdev_restart(arvif, &vifs[i].new_ctx->def); ret = ath12k_mac_vdev_restart(arvif, &vifs[i].new_ctx->def);
if (ret) { if (ret) {
ath12k_warn(ab, "failed to restart vdev %d: %d\n", ath12k_warn(ab, "failed to restart vdev %d: %d\n",
arvif->vdev_id, ret); arvif->vdev_id, ret);
continue; continue;
} }
} else {
ret = ath12k_mac_vdev_stop(arvif);
if (ret) {
ath12k_warn(ab, "failed to stop vdev %d: %d\n",
arvif->vdev_id, ret);
continue;
}
ret = ath12k_mac_vdev_start(arvif, &vifs[i].new_ctx->def);
if (ret)
ath12k_warn(ab, "failed to start vdev %d: %d\n",
arvif->vdev_id, ret);
continue;
}
ret = ath12k_mac_setup_bcn_tmpl(arvif); ret = ath12k_mac_setup_bcn_tmpl(arvif);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment