1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Tue, 24 Nov 2015 11:33:54 +0100
3 Subject: [PATCH] ath10k: stop abusing GFP_DMA
5 Allocations from the DMA zone were originally added for legacy ISA
6 stuff, or PCI devices that have specific limitations in their DMA
7 addressing capabilities. It has no place in ath10k, which can do
10 Fixes memory allocation errors on some platforms.
12 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
15 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c
16 +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
17 @@ -536,7 +536,7 @@ int ath10k_htt_rx_alloc(struct ath10k_ht
19 size = htt->rx_ring.size * sizeof(htt->rx_ring.paddrs_ring);
21 - vaddr = dma_alloc_coherent(htt->ar->dev, size, &paddr, GFP_DMA);
22 + vaddr = dma_alloc_coherent(htt->ar->dev, size, &paddr, GFP_KERNEL);
26 @@ -545,7 +545,7 @@ int ath10k_htt_rx_alloc(struct ath10k_ht
28 vaddr = dma_alloc_coherent(htt->ar->dev,
29 sizeof(*htt->rx_ring.alloc_idx.vaddr),
31 + &paddr, GFP_KERNEL);
35 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c
36 +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
37 @@ -111,7 +111,7 @@ int ath10k_htt_tx_alloc(struct ath10k_ht
38 size = htt->max_num_pending_tx * sizeof(struct ath10k_htt_txbuf);
39 htt->txbuf.vaddr = dma_alloc_coherent(ar->dev, size,
43 if (!htt->txbuf.vaddr) {
44 ath10k_err(ar, "failed to alloc tx buffer\n");
46 @@ -124,7 +124,7 @@ int ath10k_htt_tx_alloc(struct ath10k_ht
47 size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
48 htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size,
49 &htt->frag_desc.paddr,
52 if (!htt->frag_desc.vaddr) {
53 ath10k_warn(ar, "failed to alloc fragment desc memory\n");