Discussion:
Can bus_dmamap_unload() be called before the load completes?
Pratyush Yadav
2018-06-27 06:52:42 UTC
Permalink
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
Loading...