Can bus_dmamap_unload() be called before the load completes?

Pratyush Yadav pratyush at freebsd.org
Wed Jun 27 06:53:26 UTC 2018


Hi everyone,

I am currently working on an alternate bus_dma(9) implementation for
use with the Xen drivers [0].

I have a question regarding how the bus_dma(9) interface is expected to be used:

If the load is deferred because of a shortage of resources, is it
"legal" to call unload before the load completes?

In my implementation, if unload is called while the load is waiting
for resources, it would result in a segmentation fault and leak
memory. Do I need to handle that possibility, or is it ok to assume
that unload won't be called before the load completes?

Regards,
Pratyush Yadav


[0] https://wiki.freebsd.org/SummerOfCode2018Projects/ImportXenbus_dmaFromOpenBSD


More information about the freebsd-arch mailing list