From a4e234d278203e276ceb48dd4872aaa66bf777c9 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 24 Nov 2015 19:09:45 +0000 Subject: ath10k: fix memory allocation issues on platforms where DMA coherent memory is constrained Signed-off-by: Felix Fietkau SVN-Revision: 47625 --- .../patches/317-ath10k-stop-abusing-GFP_DMA.patch | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 package/kernel/mac80211/patches/317-ath10k-stop-abusing-GFP_DMA.patch (limited to 'package/kernel/mac80211/patches/317-ath10k-stop-abusing-GFP_DMA.patch') diff --git a/package/kernel/mac80211/patches/317-ath10k-stop-abusing-GFP_DMA.patch b/package/kernel/mac80211/patches/317-ath10k-stop-abusing-GFP_DMA.patch new file mode 100644 index 0000000000..a229a1306a --- /dev/null +++ b/package/kernel/mac80211/patches/317-ath10k-stop-abusing-GFP_DMA.patch @@ -0,0 +1,54 @@ +From: Felix Fietkau +Date: Tue, 24 Nov 2015 11:33:54 +0100 +Subject: [PATCH] ath10k: stop abusing GFP_DMA + +Allocations from the DMA zone were originally added for legacy ISA +stuff, or PCI devices that have specific limitations in their DMA +addressing capabilities. It has no place in ath10k, which can do +full 32-bit DMA. + +Fixes memory allocation errors on some platforms. + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/wireless/ath/ath10k/htt_rx.c ++++ b/drivers/net/wireless/ath/ath10k/htt_rx.c +@@ -536,7 +536,7 @@ int ath10k_htt_rx_alloc(struct ath10k_ht + + size = htt->rx_ring.size * sizeof(htt->rx_ring.paddrs_ring); + +- vaddr = dma_alloc_coherent(htt->ar->dev, size, &paddr, GFP_DMA); ++ vaddr = dma_alloc_coherent(htt->ar->dev, size, &paddr, GFP_KERNEL); + if (!vaddr) + goto err_dma_ring; + +@@ -545,7 +545,7 @@ int ath10k_htt_rx_alloc(struct ath10k_ht + + vaddr = dma_alloc_coherent(htt->ar->dev, + sizeof(*htt->rx_ring.alloc_idx.vaddr), +- &paddr, GFP_DMA); ++ &paddr, GFP_KERNEL); + if (!vaddr) + goto err_dma_idx; + +--- a/drivers/net/wireless/ath/ath10k/htt_tx.c ++++ b/drivers/net/wireless/ath/ath10k/htt_tx.c +@@ -111,7 +111,7 @@ int ath10k_htt_tx_alloc(struct ath10k_ht + size = htt->max_num_pending_tx * sizeof(struct ath10k_htt_txbuf); + htt->txbuf.vaddr = dma_alloc_coherent(ar->dev, size, + &htt->txbuf.paddr, +- GFP_DMA); ++ GFP_KERNEL); + if (!htt->txbuf.vaddr) { + ath10k_err(ar, "failed to alloc tx buffer\n"); + ret = -ENOMEM; +@@ -124,7 +124,7 @@ int ath10k_htt_tx_alloc(struct ath10k_ht + size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc); + htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size, + &htt->frag_desc.paddr, +- GFP_DMA); ++ GFP_KERNEL); + if (!htt->frag_desc.vaddr) { + ath10k_warn(ar, "failed to alloc fragment desc memory\n"); + ret = -ENOMEM; -- cgit v1.2.3