Author: br
Date: Thu Jul  4 15:26:02 2019
New Revision: 349732
URL: https://svnweb.freebsd.org/changeset/base/349732

Log:
  Fix transfers that don't use busdma or bounce buffer (e.g. software dmas).
  Busdma data loaded by different function (the bug introduced in r349727).
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/dev/xdma/xdma_sg.c

Modified: head/sys/dev/xdma/xdma_sg.c
==============================================================================
--- head/sys/dev/xdma/xdma_sg.c Thu Jul  4 15:09:58 2019        (r349731)
+++ head/sys/dev/xdma/xdma_sg.c Thu Jul  4 15:26:02 2019        (r349732)
@@ -493,14 +493,13 @@ _xdma_load_data(xdma_channel_t *xchan, struct xdma_req
 
        switch (xr->req_type) {
        case XR_TYPE_MBUF:
-               if (xchan->caps & XCHAN_CAP_BUSDMA)
-                       seg[0].ds_addr = mtod(m, bus_addr_t);
-               else if (xchan->caps & XCHAN_CAP_BOUNCE) {
+               if (xchan->caps & XCHAN_CAP_BOUNCE) {
                        if (xr->direction == XDMA_MEM_TO_DEV)
                                m_copydata(m, 0, m->m_pkthdr.len,
                                    (void *)xr->buf.vaddr);
                        seg[0].ds_addr = (bus_addr_t)xr->buf.paddr;
-               }
+               } else
+                       seg[0].ds_addr = mtod(m, bus_addr_t);
                seg[0].ds_len = m->m_pkthdr.len;
                break;
        case XR_TYPE_BIO:
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to