Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jun 2018 12:22:42 +0530
From:      Pratyush Yadav <pratyush@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        freebsd-arch@freebsd.org, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <royger@freebsd.org>,  Edward Napierala <trasz@freebsd.org>, Akshay Jaggi <jaggi@freebsd.org>
Subject:   Can bus_dmamap_unload() be called before the load completes?
Message-ID:  <CA%2BX=3TJHD3Xo-ZtoL=s5sKCAWrFXeF1ocrJttn6ypcYLZJDqMA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BX=3TJHD3Xo-ZtoL=s5sKCAWrFXeF1ocrJttn6ypcYLZJDqMA>