athp icon indicating copy to clipboard operation
athp copied to clipboard

athp_dma_mbuf_post_xmit(): inconsistent BUS_DMASYNC flags

Open bzfbd opened this issue 4 years ago • 3 comments

Hi Adrian,

I noticed this while trying to figure out things on an arm64. A PREREAD and a POSTWRITE flag at the same time make very little sense.

Submitted by: bz Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")

diff --git a/sys/dev/athp/if_athp_desc.c b/sys/dev/athp/if_athp_desc.c
index f40afbcc2cf8..b8712dad892a 100644
--- a/sys/dev/athp/if_athp_desc.c
+++ b/sys/dev/athp/if_athp_desc.c
@@ -378,7 +378,7 @@ athp_dma_mbuf_post_xmit(struct ath10k *ar, struct athp_dma_head *dh,
 {

        ATHP_DMA_LOCK(ar);
-       bus_dmamap_sync(dh->tag, dm->map, BUS_DMASYNC_PREREAD |
+       bus_dmamap_sync(dh->tag, dm->map, BUS_DMASYNC_POSTREAD |
            BUS_DMASYNC_POSTWRITE);
        ATHP_DMA_UNLOCK(ar);
 }

bzfbd avatar Jul 27 '20 16:07 bzfbd

Hi!

This is something from the deeeeeeeeeeeep past (circa 2010/2011/2012) dealing with MIPS platforms and the non-coherent DMA sync stuff. I remember having a lot of discussions figuring out what these actually mean and do versus what everyone (back then mostly on x86 or coherent dma mips stuff) did.

Lemme see if I can find the discussions archived somewhere.

-adrian

erikarn avatar Jul 27 '20 18:07 erikarn

Can we add #DEFINE for mips and x86 based on when its needed and why? If its not needed in AMD64 and it is in MIPS we could just add DEFINEs correct?

Geramy L. Loveless

On Mon, Jul 27, 2020 at 12:15 PM Adrian Chadd [email protected] wrote:

Hi!

This is something from the deeeeeeeeeeeep past (circa 2010/2011/2012) dealing with MIPS platforms and the non-coherent DMA sync stuff. I remember having a lot of discussions figuring out what these actually mean and do versus what everyone (back then mostly on x86 or coherent dma mips stuff) did.

Lemme see if I can find the discussions archived somewhere.

-adrian

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/erikarn/athp/issues/39#issuecomment-664557180, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACAWBCZJZMDJEUOXLLNEBTR5W75RANCNFSM4PI66ARQ .

Geramy avatar Jul 27 '20 19:07 Geramy

Well, no, having #define's around busdma usage based on the platform defeats the purpose of the busdma API. :-)

I'm still working; when I'm not working I'll go yank the reasons out of long term storage.

-adrian

erikarn avatar Jul 27 '20 21:07 erikarn