]> git.baikalelectronics.ru Git - kernel.git/commit
ath10k: fix memory alloc failure in qca99x0 during wmi svc rdy event
authorRaja Mani <rmani@qti.qualcomm.com>
Wed, 29 Jul 2015 08:40:38 +0000 (11:40 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 30 Jul 2015 13:54:28 +0000 (16:54 +0300)
commit0c6e1d5a047ae5ee2981dae33f40c7a5635721e9
treee4fee8b7352f2cfc21c82c51672f055ce82e37cc
parent0f5a6d6fa145a05811eac2e2e6a778be53a049da
ath10k: fix memory alloc failure in qca99x0 during wmi svc rdy event

Host memory required for firmware is allocated while handling
wmi service ready event. Right now, wmi service ready is handled
in tasklet context and it calls dma_alloc_coherent() with atomic
flag (GFP_ATOMIC) to allocate memory in host needed for firmware.
The problem is, dma_alloc_coherent() with GFP_ATOMIC fails in
the platform (at least in AP platform) where it has less atomic
pool memory (< 2mb). QCA99X0 requires around 2 MB of host memory
for one card, having additional QCA99X0 card in the same platform
will require similarly amount of memory. So, it's not guaranteed that
all the platform will have enough atomic memory pool.

Fix this issue, by handling wmi service ready event in workqueue
context and calling dma_alloc_coherent() with GFP_KERNEL. mac80211 work
queue will not be ready at the time of handling wmi service ready.
So, it can't be used to handle wmi service ready. Also, register work
gets scheduled during insmod in existing ath10k_wq and waits for
wmi service ready to completed. Both workqueue can't be used for
this purpose. New auxiliary workqueue is added to handle wmi service
ready.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/wmi-tlv.c
drivers/net/wireless/ath/ath10k/wmi.c