Re: [PATCH 07/13] dmaengine: introduce dma_request_channel andprivate channels

From: Atsushi Nemoto
Date: Fri Feb 06 2009 - 11:58:42 EST


On Fri, 14 Nov 2008 14:34:53 -0700, Dan Williams <dan.j.williams@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/