From 87f854059aa3c703a87e08649801b15c93b845e7 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 13 Apr 2015 20:08:30 +0000 Subject: kernel: fix more bgmac dma init/cleanup issues Signed-off-by: Felix Fietkau SVN-Revision: 45422 --- ...7-07-bgmac-simplify-rx-DMA-error-handling.patch | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'target/linux/generic/patches-3.18/077-07-bgmac-simplify-rx-DMA-error-handling.patch') diff --git a/target/linux/generic/patches-3.18/077-07-bgmac-simplify-rx-DMA-error-handling.patch b/target/linux/generic/patches-3.18/077-07-bgmac-simplify-rx-DMA-error-handling.patch index e1e8c8f656..d6feed05b2 100644 --- a/target/linux/generic/patches-3.18/077-07-bgmac-simplify-rx-DMA-error-handling.patch +++ b/target/linux/generic/patches-3.18/077-07-bgmac-simplify-rx-DMA-error-handling.patch @@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau - slot->dma_addr, - BGMAC_RX_BUF_SIZE, - DMA_FROM_DEVICE); -+ kfree(buf); ++ put_page(virt_to_head_page(buf)); break; } @@ -99,3 +99,23 @@ Signed-off-by: Felix Fietkau } return handled; +@@ -528,14 +512,14 @@ static void bgmac_dma_rx_ring_free(struc + + for (i = 0; i < ring->num_slots; i++) { + slot = &ring->slots[i]; +- if (!slot->buf) ++ if (!slot->dma_addr) + continue; + +- if (slot->dma_addr) +- dma_unmap_single(dma_dev, slot->dma_addr, +- BGMAC_RX_BUF_SIZE, +- DMA_FROM_DEVICE); ++ dma_unmap_single(dma_dev, slot->dma_addr, ++ BGMAC_RX_BUF_SIZE, ++ DMA_FROM_DEVICE); + put_page(virt_to_head_page(slot->buf)); ++ slot->dma_addr = 0; + } + } + -- cgit v1.2.3