From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Cc: linux-wireless@vger.kernel.org,
Michal Kazior <michal.kazior@tieto.com>,
ath10k@lists.infradead.org
Subject: Re: [PATCH] ath10k: fix kernel panic while shutting down AP
Date: Wed, 8 Oct 2014 12:52:04 +0300 [thread overview]
Message-ID: <87a956hosb.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1412759786-10567-1-git-send-email-rmanohar@qti.qualcomm.com> (Rajkumar Manoharan's message of "Wed, 8 Oct 2014 14:46:26 +0530")
Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:
> The commit "ath10k: workaround fw beaconing bug" is freeing
> DMA-coherent memory in irq context which is hitting BUG ON
> in ARM platforms. Fix this by moving dma_free out of spin
> lock.
>
> kernel BUG at mm/vmalloc.c:1512!
> Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
> CPU: 0 PID: 722 Comm: hostapd Not tainted 3.14.0 #3
> task: dd58b840 ti: da6a6000 task.ti: da6a6000
> PC is at vunmap+0x24/0x34
> LR is at __arm_dma_free.isra.21+0x12c/0x190
> [<c02a97d0>] (vunmap) from [<c021f81c>] (__arm_dma_free.isra.21+0x12c/0x190)
> [<c021f81c>] (__arm_dma_free.isra.21) from [<bf3b2440>]
> (ath10k_mac_vif_beacon_free+0xf4/0x100 [ath10k_core])
> [<bf3b2440>] (ath10k_mac_vif_beacon_free [ath10k_core]) from [<bf3b2490>]
> (ath10k_remove_interface+0x44/0x1ec [ath10k_core])
> [<bf3b2490>] (ath10k_remove_interface [ath10k_core]) from [<bf3352e4>]
> (ieee80211_add_virtual_monitor+0x9d8/0x9f0 [mac80211])
> [<bf3352e4>] (ieee80211_add_virtual_monitor [mac80211]) from [<bf33530c>]
> (ieee80211_stop+0x10/0x18 [mac80211])
> [<bf33530c>] (ieee80211_stop [mac80211]) from [<c040d144>]
> (__dev_close_many+0x9c/0xcc)
>
> Cc: Michal Kazior <michal.kazior@tieto.com>
> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
[...]
> @@ -2404,8 +2389,15 @@ void ath10k_halt(struct ath10k *ar)
>
> spin_lock_bh(&ar->data_lock);
> list_for_each_entry(arvif, &ar->arvifs, list)
> - ath10k_mac_vif_beacon_cleanup(arvif);
> + ath10k_mac_vif_beacon_free(arvif);
> spin_unlock_bh(&ar->data_lock);
> + list_for_each_entry(arvif, &ar->arvifs, list) {
> + if (!arvif->beacon_buf)
> + continue;
> + dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN,
> + arvif->beacon_buf, arvif->beacon_paddr);
> + arvif->beacon_buf = NULL;
> + }
> }
Until now we have protected arvif->beacon_buf with data_lock. How do we
know that this is safe to do without taking data_lock?
--
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Cc: <ath10k@lists.infradead.org>, <linux-wireless@vger.kernel.org>,
"Michal Kazior" <michal.kazior@tieto.com>
Subject: Re: [PATCH] ath10k: fix kernel panic while shutting down AP
Date: Wed, 8 Oct 2014 12:52:04 +0300 [thread overview]
Message-ID: <87a956hosb.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1412759786-10567-1-git-send-email-rmanohar@qti.qualcomm.com> (Rajkumar Manoharan's message of "Wed, 8 Oct 2014 14:46:26 +0530")
Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:
> The commit "ath10k: workaround fw beaconing bug" is freeing
> DMA-coherent memory in irq context which is hitting BUG ON
> in ARM platforms. Fix this by moving dma_free out of spin
> lock.
>
> kernel BUG at mm/vmalloc.c:1512!
> Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
> CPU: 0 PID: 722 Comm: hostapd Not tainted 3.14.0 #3
> task: dd58b840 ti: da6a6000 task.ti: da6a6000
> PC is at vunmap+0x24/0x34
> LR is at __arm_dma_free.isra.21+0x12c/0x190
> [<c02a97d0>] (vunmap) from [<c021f81c>] (__arm_dma_free.isra.21+0x12c/0x190)
> [<c021f81c>] (__arm_dma_free.isra.21) from [<bf3b2440>]
> (ath10k_mac_vif_beacon_free+0xf4/0x100 [ath10k_core])
> [<bf3b2440>] (ath10k_mac_vif_beacon_free [ath10k_core]) from [<bf3b2490>]
> (ath10k_remove_interface+0x44/0x1ec [ath10k_core])
> [<bf3b2490>] (ath10k_remove_interface [ath10k_core]) from [<bf3352e4>]
> (ieee80211_add_virtual_monitor+0x9d8/0x9f0 [mac80211])
> [<bf3352e4>] (ieee80211_add_virtual_monitor [mac80211]) from [<bf33530c>]
> (ieee80211_stop+0x10/0x18 [mac80211])
> [<bf33530c>] (ieee80211_stop [mac80211]) from [<c040d144>]
> (__dev_close_many+0x9c/0xcc)
>
> Cc: Michal Kazior <michal.kazior@tieto.com>
> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
[...]
> @@ -2404,8 +2389,15 @@ void ath10k_halt(struct ath10k *ar)
>
> spin_lock_bh(&ar->data_lock);
> list_for_each_entry(arvif, &ar->arvifs, list)
> - ath10k_mac_vif_beacon_cleanup(arvif);
> + ath10k_mac_vif_beacon_free(arvif);
> spin_unlock_bh(&ar->data_lock);
> + list_for_each_entry(arvif, &ar->arvifs, list) {
> + if (!arvif->beacon_buf)
> + continue;
> + dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN,
> + arvif->beacon_buf, arvif->beacon_paddr);
> + arvif->beacon_buf = NULL;
> + }
> }
Until now we have protected arvif->beacon_buf with data_lock. How do we
know that this is safe to do without taking data_lock?
--
Kalle Valo
next prev parent reply other threads:[~2014-10-08 9:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 9:16 [PATCH] ath10k: fix kernel panic while shutting down AP Rajkumar Manoharan
2014-10-08 9:16 ` Rajkumar Manoharan
2014-10-08 9:45 ` Michal Kazior
2014-10-08 9:45 ` Michal Kazior
2014-10-08 10:33 ` Rajkumar Manoharan
2014-10-08 10:33 ` Rajkumar Manoharan
2014-10-08 10:50 ` Michal Kazior
2014-10-08 10:50 ` Michal Kazior
2014-10-08 11:08 ` Rajkumar Manoharan
2014-10-08 11:08 ` Rajkumar Manoharan
2014-10-08 11:13 ` Rajkumar Manoharan
2014-10-08 11:13 ` Rajkumar Manoharan
2014-10-08 12:17 ` Michal Kazior
2014-10-08 12:17 ` Michal Kazior
2014-10-08 12:16 ` Michal Kazior
2014-10-08 12:16 ` Michal Kazior
2014-10-10 9:36 ` Rajkumar Manoharan
2014-10-10 9:36 ` Rajkumar Manoharan
2014-10-08 9:52 ` Kalle Valo [this message]
2014-10-08 9:52 ` Kalle Valo
2014-10-08 10:48 ` Rajkumar Manoharan
2014-10-08 10:48 ` Rajkumar Manoharan
2014-10-08 12:24 ` Michal Kazior
2014-10-08 12:24 ` Michal Kazior
2014-10-08 12:37 ` Kalle Valo
2014-10-08 12:37 ` 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=87a956hosb.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=ath10k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.com \
--cc=rmanohar@qti.qualcomm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.