diff mbox

[2/5] defxx: Discard DMA maps on buffer deallocation

Message ID alpine.LFD.2.11.1407020553450.15455@eddie.linux-mips.org
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Maciej W. Rozycki July 5, 2014, 2:14 p.m. UTC
Prearranged receive DMA bounce buffer mappings are not released in the
card reboot/shutdown path.  That does not affect frame reception, but
probably explains the random segmentation fault I observed the other day
on interface shutdown.  Card is rebooted as required by the spec in the
process of ring fault recovery when a PC Trace signal has been received.

This change fixes the problem in an obvious manner.

Reported-by: Robert Coerver <Robert.Coerver@ll.mit.edu>
Tested-by: Robert Coerver <Robert.Coerver@ll.mit.edu>
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
 Please apply,

  Maciej

linux-defxx-rcv-flush-unmap.patch
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: linux-20140623-swarm64-eb/drivers/net/fddi/defxx.c
===================================================================
--- linux-20140623-swarm64-eb.orig/drivers/net/fddi/defxx.c
+++ linux-20140623-swarm64-eb/drivers/net/fddi/defxx.c
@@ -3448,8 +3448,13 @@  static void dfx_rcv_flush( DFX_board_t *
 		{
 			struct sk_buff *skb;
 			skb = (struct sk_buff *)bp->p_rcv_buff_va[i+j];
-			if (skb)
+			if (skb) {
+				dma_unmap_single(bp->bus_dev,
+						 bp->descr_block_virt->rcv_data[i+j].long_1,
+						 PI_RCV_DATA_K_SIZE_MAX,
+						 DMA_FROM_DEVICE);
 				dev_kfree_skb(skb);
+			}
 			bp->p_rcv_buff_va[i+j] = NULL;
 		}