Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bus_dma issue with wm(4) on arm


Due to rx performance issues with onboard awge(4) I tried to plug a PCI
express wm(4) card into an aarch64 host.

It hits a KASSERT in bus_dmamap_sync:

panic: kernel diagnostic assertion
"(va & PAGE_MASK) == (pa & PAGE_MASK)" failed:
file "/work/src/sys/arch/arm/arm32/bus_dma.c", line 811
va 0xffff0000ee2d2802 pa 0xee2d2800

the 2 in the lower bits of the va comes from wm's sc_align_tweak:

wm_init_rxdesc() {
	m->m_data = m->m_ext.ext_buf + sc->sc_align_tweak;

Setting sc_align_tweak to 0 does seem to make the problem go away.

Now the question is if this is a bug in wm(4) or in the MD bus_dma
implementation? I guess what happens is:

1) bus_dmamap_load_mbuf() sets up DMA segment
2) wm adjusts m_data
3) wm calls bus_dmamap_sync() but mbuf previously loaded and DMA
   segment now point to slightly different locations

Kind regards,

Home | Main Index | Thread Index | Old Index