From: Ramon Fried <rfried@codeaurora.org>
To: Daniel Mack <daniel@zonque.org>, linux-wireless@vger.kernel.org
Cc: loic.poulain@linaro.org, bjorn.andersson@linaro.org,
kvalo@codeaurora.org, wcn36xx@lists.infradead.org
Subject: Re: [PATCH 3/3] wcn36xx: don't delete invalid bss indices
Date: Wed, 4 Apr 2018 08:40:26 +0300 [thread overview]
Message-ID: <8ee8943c-ff58-60a1-75da-eaf795ff3234@codeaurora.org> (raw)
In-Reply-To: <20180403165154.18775-3-daniel@zonque.org>
On 4/3/2018 7:51 PM, Daniel Mack wrote:
> The firmware code cannot cope with requests to remove BSS indices that have
> not previously been added. This primarily happens when the device is
> suspended and then resumed. ieee80211_reconfig() then calls into
> wcn36xx_bss_info_changed() with an empty bssid and BSS_CHANGED_BSSID set,
> which subsequently leads to a firmware crash:
>
> [ 43.647928] qcom-wcnss-pil a204000.wcnss: fatal error received: halMsg.c:4964:halMsg_DelBss: Invalid BSSIndex 0
> [ 43.647959] remoteproc remoteproc0: crash detected in a204000.wcnss: type fatal error
>
> To fix this, set bss_index to WCN36XX_HAL_BSS_INVALID_IDX for all bss
> that have not been configured in the firmware, and don't call into the
> firmware with invalid indices.
>
> Signed-off-by: Daniel Mack <daniel@zonque.org>
> ---
> drivers/net/wireless/ath/wcn36xx/main.c | 1 +
> drivers/net/wireless/ath/wcn36xx/smd.c | 6 ++++++
> 2 files changed, 7 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
> index 69d6be59d97f..32bbd6e2fd09 100644
> --- a/drivers/net/wireless/ath/wcn36xx/main.c
> +++ b/drivers/net/wireless/ath/wcn36xx/main.c
> @@ -953,6 +953,7 @@ static int wcn36xx_add_interface(struct ieee80211_hw *hw,
>
> mutex_lock(&wcn->conf_mutex);
>
> + vif_priv->bss_index = WCN36XX_HAL_BSS_INVALID_IDX;
> list_add(&vif_priv->list, &wcn->vif_list);
> wcn36xx_smd_add_sta_self(wcn, vif);
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
> index 8932af5e4d8d..5be07e40a86d 100644
> --- a/drivers/net/wireless/ath/wcn36xx/smd.c
> +++ b/drivers/net/wireless/ath/wcn36xx/smd.c
> @@ -1446,6 +1446,10 @@ int wcn36xx_smd_delete_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif)
> int ret = 0;
>
> mutex_lock(&wcn->hal_mutex);
> +
> + if (vif_priv->bss_index == WCN36XX_HAL_BSS_INVALID_IDX)
> + goto out;
> +
> INIT_HAL_MSG(msg_body, WCN36XX_HAL_DELETE_BSS_REQ);
>
> msg_body.bss_index = vif_priv->bss_index;
> @@ -1464,6 +1468,8 @@ int wcn36xx_smd_delete_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif)
> wcn36xx_err("hal_delete_bss response failed err=%d\n", ret);
> goto out;
> }
> +
> + vif_priv->bss_index = WCN36XX_HAL_BSS_INVALID_IDX;
> out:
> mutex_unlock(&wcn->hal_mutex);
> return ret;
Interesting. I have never seen this bug before.
Do you have a way of recreating it so I can test it on my side ?
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2018-04-04 5:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-03 16:51 [PATCH 1/3] wcn36xx: check for DMA mapping errors in wcn36xx_dxe_tx_frame() Daniel Mack
2018-04-03 16:51 ` [PATCH 2/3] wcn36xx: don't keep reference to skb if transmission failed Daniel Mack
2018-04-03 16:51 ` [PATCH 3/3] wcn36xx: don't delete invalid bss indices Daniel Mack
2018-04-04 5:40 ` Ramon Fried [this message]
2018-04-04 6:39 ` Daniel Mack
2018-04-04 5:37 ` [PATCH 1/3] wcn36xx: check for DMA mapping errors in wcn36xx_dxe_tx_frame() Ramon Fried
2018-04-10 14:38 ` [1/3] " Kalle Valo
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=8ee8943c-ff58-60a1-75da-eaf795ff3234@codeaurora.org \
--to=rfried@codeaurora.org \
--cc=bjorn.andersson@linaro.org \
--cc=daniel@zonque.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=wcn36xx@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).