erikarn / athp

freebsd ath10k port
48 stars 15 forks source link

athp_dma_mbuf_post_xmit(): inconsistent BUS_DMASYNC flags #39

Open bzfbd opened 4 years ago

bzfbd commented 4 years ago

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);
 }
erikarn commented 4 years ago

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

Geramy commented 4 years ago

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 notifications@github.com 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 .

erikarn commented 4 years ago

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