Author: gonzo Date: Sat Dec 10 17:59:34 2016 New Revision: 309822 URL: https://svnweb.freebsd.org/changeset/base/309822
Log: [iwn] Perform BUS_DMASYNC_PREREAD when initializing RX buffer BUS_DMASYNC_PREREAD is required when setting up RX buffer, otherwise data provided by card can be overwritten by data evicted from cache Also use proper tag when setting up RX descriptor Reviewed by: adrian, avos, ivadasz Differential Revision: https://reviews.freebsd.org/D8717 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sat Dec 10 17:06:55 2016 (r309821) +++ head/sys/dev/iwn/if_iwn.c Sat Dec 10 17:59:34 2016 (r309822) @@ -1910,6 +1910,9 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, goto fail; } + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_PREREAD); + /* Set physical address of RX buffer (256-byte aligned). */ ring->desc[i] = htole32(paddr >> 8); } @@ -3040,14 +3043,19 @@ iwn_rx_done(struct iwn_softc *sc, struct if (error != 0 && error != EFBIG) { panic("%s: could not load old RX mbuf", __func__); } + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_PREREAD); /* Physical address may have changed. */ ring->desc[ring->cur] = htole32(paddr >> 8); - bus_dmamap_sync(ring->data_dmat, ring->desc_dma.map, + bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); counter_u64_add(ic->ic_ierrors, 1); return; } + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_PREREAD); + m = data->m; data->m = m1; /* Update RX descriptor. */ _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"