Re: [PATCH 07/13] dmaengine: introduce dma_request_channel and private channels
From: Atsushi Nemoto <hidden>
Date: 2009-02-06 16:58:41
Also in:
lkml
From: Atsushi Nemoto <hidden>
Date: 2009-02-06 16:58:41
Also in:
lkml
On Fri, 14 Nov 2008 14:34:53 -0700, Dan Williams [off-list ref] wrote:
To ensure that all channels are not consumed by the general-purpose allocator the DMA_PRIVATE capability is provided to exclude a dma_device from general-purpose (memory-to-memory) consideration.
...
+ /* Found a suitable channel, try to grab, prep, and + * return it. We first set DMA_PRIVATE to disable + * balance_ref_count as this channel will not be + * published in the general-purpose allocator + */ + dma_cap_set(DMA_PRIVATE, device->cap_mask); + err = dma_chan_get(chan);
The dma_request_channel() set DMA_PRIVATE but dma_release_channel() does not clear it. If a client (such as dmatest) grabbed a public channel by dma_request_channel(), the channel will stay private forever. While a dma driver might set DMA_PRIVATE initially for private-only channels, dma_release_channel() cannot clear it unconditionally. How can this solved? DMA_ALWAYS_PRIVATE or device->is_private or something will needed? --- Atsushi Nemoto