_bus_dmamap_sync fires assertion

Emmanuel Dreyfus <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
Hello

I am still working on ucom console. boot -a works, DDB works, exitting DDB
crashes.

There is an assertion in _bus_dmamap_sync() that fires:
829                     KASSERTMSG(len <= map->dm_mapsize - offset,
830                         "bad length 0x%"PRIxBUSADDR" + 0x%"PRIxBUSSIZE
831                         " > 0x%"PRIxBUSSIZE,
832                         offset, len, map->dm_mapsize);

Values are len = 472, map->dm_mapsize = 4096, offset = 3712.
I get there this way:
#22 0xffffffff8059cf58 in _bus_dmamap_sync (t=<optimized out>, ops=4, len=472, 
    offset=3712, map=0xffff85c4fbc16348)
    at /usr/src/sys/arch/x86/x86/bus_dma.c:829
#23 bus_dmamap_sync (t=<optimized out>, p=0xffff85c4fbc16348, o=3712, l=472, 
    ops=4) at /usr/src/sys/arch/x86/x86/bus_dma.c:1394
#24 0xffffffff804b2301 in usb_syncmem (p=<optimized out>, 
    offset=<optimized out>, len=<optimized out>, ops=<optimized out>)
    at /usr/src/sys/dev/usb/usb_mem.c:420
#25 0xffffffff806ff3ed in xhci_device_bulk_start (xfer=0xffff85c518812a38)
    at /usr/src/sys/dev/usb/xhci.c:4753

Here dma->udma_offs = 3712, len = 472. 
4753                    usb_syncmem(dma, 0, len,
4754                        isread ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);

The 3712 comes from the USB xfer: ux_dmabuf.udma_offs = 3712
The error is cryptic. What am I doing wrong?

-- 
Emmanuel Dreyfus
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.