Re: WARNING: at drivers/dma/dmaengine.c:352dma_issue_pending_all+0x77/0x15d()

From: Dan Williams
Date: Mon Jan 19 2009 - 17:04:52 EST

On Mon, 2009-01-19 at 14:31 -0700, Ingo Molnar wrote:
> FYI, i'm getting this on a testbox, on v2.6.29-rc2:

Thanks for the report. I assume this is with CONFIG_DMA_ENGINE=n?
dma_issue_pending_all should be a nop in that case. I'll apply the
following with your confirmation.


diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 6df144a..9c53e5e 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -330,7 +330,7 @@ struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type)
int cpu;

WARN_ONCE(dmaengine_ref_count == 0,
- "client called %s without a reference", __func__);
+ "client called %s without a reference\n", __func__);

cpu = get_cpu();
chan = per_cpu_ptr(channel_table[tx_type], cpu)->chan;
@@ -349,7 +349,7 @@ void dma_issue_pending_all(void)
struct dma_chan *chan;

WARN_ONCE(dmaengine_ref_count == 0,
- "client called %s without a reference", __func__);
+ "client called %s without a reference\n", __func__);

list_for_each_entry_rcu(device, &dma_device_list, global_node) {
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 64dea2a..c4a560e 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -390,11 +390,16 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
+void dma_issue_pending_all(void);
static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
+static inline void dma_issue_pending_all(void)
+ do { } while (0);

/* --- DMA device --- */
@@ -403,7 +408,6 @@ int dma_async_device_register(struct dma_device *device);
void dma_async_device_unregister(struct dma_device *device);
void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
-void dma_issue_pending_all(void);
#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param);
void dma_release_channel(struct dma_chan *chan);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at