[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20081114221704.fe9ea599.akpm@linux-foundation.org>
Date: Fri, 14 Nov 2008 22:17:04 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Dan Williams <dan.j.williams@...el.com>
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
maciej.sosnowski@...el.com, hskinnemoen@...el.com,
g.liakhovetski@....de, nicolas.ferre@...el.com
Subject: Re: [PATCH 08/13] dmatest: convert to dma_request_channel
On Fri, 14 Nov 2008 14:34:58 -0700 Dan Williams <dan.j.williams@...el.com> wrote:
> static int __init dmatest_init(void)
> {
> - dma_cap_set(DMA_MEMCPY, dmatest_client.cap_mask);
> - dma_async_client_register(&dmatest_client);
> - dma_async_client_chan_request(&dmatest_client);
> + dma_cap_mask_t mask;
> + struct dma_chan *chan;
> +
> + dma_cap_zero(mask);
> + dma_cap_set(DMA_MEMCPY, mask);
> + for (;;) {
> + chan = dma_request_channel(mask, filter, NULL);
> + if (chan) {
> + if (dmatest_add_channel(chan) == 0)
> + continue;
hrm. I trust this loop can't lock up the box.
> + else
> + dma_release_channel(chan);
> + } else
> + break; /* no more channels available */
> + if (max_channels && nr_channels >= max_channels)
> + break; /* we have all we need */
> + }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists