]> git.baikalelectronics.ru Git - kernel.git/commit
ath10k: allocate small size dma memory in ath10k_pci_diag_write_mem
authorCarl Huang <cjhuang@codeaurora.org>
Thu, 11 Oct 2018 07:55:26 +0000 (15:55 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 13 Oct 2018 17:25:49 +0000 (20:25 +0300)
commit38409fbeb91cc81fab27ea774baefa426d1057a7
treeb997f74e72a793f724d10561d379262212d7593b
parent71667c91d0a3fa08d3816fbbc6274920d4079e8a
ath10k: allocate small size dma memory in ath10k_pci_diag_write_mem

ath10k_pci_diag_write_mem may allocate big size of the dma memory
based on the parameter nbytes. Take firmware diag download as
example, the biggest size is about 500K. In some systems, the
allocation is likely to fail because it can't acquire such a large
contiguous dma memory.

The fix is to allocate a small size dma memory. In the loop,
driver copies the data to the allocated dma memory and writes to
the destination until all the data is written.

Tested with QCA6174 PCI with
firmware-6.bin_WLAN.RM.4.4.1-00119-QCARMSWP-1, this also affects
QCA9377 PCI.

Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
Reviewed-by: Brian Norris <briannorris@chomium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/pci.c