aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/dmaengine.c4
-rw-r--r--drivers/dma/dmatest.c22
-rw-r--r--drivers/dma/iop-adma.c11
3 files changed, 19 insertions, 18 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index dc003a3a787d..5317e08221ec 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -399,8 +399,8 @@ int dma_async_device_register(struct dma_device *device)
399 chan->chan_id = chancnt++; 399 chan->chan_id = chancnt++;
400 chan->dev.class = &dma_devclass; 400 chan->dev.class = &dma_devclass;
401 chan->dev.parent = device->dev; 401 chan->dev.parent = device->dev;
402 snprintf(chan->dev.bus_id, BUS_ID_SIZE, "dma%dchan%d", 402 dev_set_name(&chan->dev, "dma%dchan%d",
403 device->dev_id, chan->chan_id); 403 device->dev_id, chan->chan_id);
404 404
405 rc = device_register(&chan->dev); 405 rc = device_register(&chan->dev);
406 if (rc) { 406 if (rc) {
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index d1e381e35a9e..ed9636bfb54a 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -20,11 +20,11 @@ static unsigned int test_buf_size = 16384;
20module_param(test_buf_size, uint, S_IRUGO); 20module_param(test_buf_size, uint, S_IRUGO);
21MODULE_PARM_DESC(test_buf_size, "Size of the memcpy test buffer"); 21MODULE_PARM_DESC(test_buf_size, "Size of the memcpy test buffer");
22 22
23static char test_channel[BUS_ID_SIZE]; 23static char test_channel[20];
24module_param_string(channel, test_channel, sizeof(test_channel), S_IRUGO); 24module_param_string(channel, test_channel, sizeof(test_channel), S_IRUGO);
25MODULE_PARM_DESC(channel, "Bus ID of the channel to test (default: any)"); 25MODULE_PARM_DESC(channel, "Bus ID of the channel to test (default: any)");
26 26
27static char test_device[BUS_ID_SIZE]; 27static char test_device[20];
28module_param_string(device, test_device, sizeof(test_device), S_IRUGO); 28module_param_string(device, test_device, sizeof(test_device), S_IRUGO);
29MODULE_PARM_DESC(device, "Bus ID of the DMA Engine to test (default: any)"); 29MODULE_PARM_DESC(device, "Bus ID of the DMA Engine to test (default: any)");
30 30
@@ -80,14 +80,14 @@ static bool dmatest_match_channel(struct dma_chan *chan)
80{ 80{
81 if (test_channel[0] == '\0') 81 if (test_channel[0] == '\0')
82 return true; 82 return true;
83 return strcmp(chan->dev.bus_id, test_channel) == 0; 83 return strcmp(dev_name(&chan->dev), test_channel) == 0;
84} 84}
85 85
86static bool dmatest_match_device(struct dma_device *device) 86static bool dmatest_match_device(struct dma_device *device)
87{ 87{
88 if (test_device[0] == '\0') 88 if (test_device[0] == '\0')
89 return true; 89 return true;
90 return strcmp(device->dev->bus_id, test_device) == 0; 90 return strcmp(dev_name(device->dev), test_device) == 0;
91} 91}
92 92
93static unsigned long dmatest_random(void) 93static unsigned long dmatest_random(void)
@@ -332,7 +332,7 @@ static enum dma_state_client dmatest_add_channel(struct dma_chan *chan)
332 332
333 dtc = kmalloc(sizeof(struct dmatest_chan), GFP_KERNEL); 333 dtc = kmalloc(sizeof(struct dmatest_chan), GFP_KERNEL);
334 if (!dtc) { 334 if (!dtc) {
335 pr_warning("dmatest: No memory for %s\n", chan->dev.bus_id); 335 pr_warning("dmatest: No memory for %s\n", dev_name(&chan->dev));
336 return DMA_NAK; 336 return DMA_NAK;
337 } 337 }
338 338
@@ -343,16 +343,16 @@ static enum dma_state_client dmatest_add_channel(struct dma_chan *chan)
343 thread = kzalloc(sizeof(struct dmatest_thread), GFP_KERNEL); 343 thread = kzalloc(sizeof(struct dmatest_thread), GFP_KERNEL);
344 if (!thread) { 344 if (!thread) {
345 pr_warning("dmatest: No memory for %s-test%u\n", 345 pr_warning("dmatest: No memory for %s-test%u\n",
346 chan->dev.bus_id, i); 346 dev_name(&chan->dev), i);
347 break; 347 break;
348 } 348 }
349 thread->chan = dtc->chan; 349 thread->chan = dtc->chan;
350 smp_wmb(); 350 smp_wmb();
351 thread->task = kthread_run(dmatest_func, thread, "%s-test%u", 351 thread->task = kthread_run(dmatest_func, thread, "%s-test%u",
352 chan->dev.bus_id, i); 352 dev_name(&chan->dev), i);
353 if (IS_ERR(thread->task)) { 353 if (IS_ERR(thread->task)) {
354 pr_warning("dmatest: Failed to run thread %s-test%u\n", 354 pr_warning("dmatest: Failed to run thread %s-test%u\n",
355 chan->dev.bus_id, i); 355 dev_name(&chan->dev), i);
356 kfree(thread); 356 kfree(thread);
357 break; 357 break;
358 } 358 }
@@ -362,7 +362,7 @@ static enum dma_state_client dmatest_add_channel(struct dma_chan *chan)
362 list_add_tail(&thread->node, &dtc->threads); 362 list_add_tail(&thread->node, &dtc->threads);
363 } 363 }
364 364
365 pr_info("dmatest: Started %u threads using %s\n", i, chan->dev.bus_id); 365 pr_info("dmatest: Started %u threads using %s\n", i, dev_name(&chan->dev));
366 366
367 list_add_tail(&dtc->node, &dmatest_channels); 367 list_add_tail(&dtc->node, &dmatest_channels);
368 nr_channels++; 368 nr_channels++;
@@ -379,7 +379,7 @@ static enum dma_state_client dmatest_remove_channel(struct dma_chan *chan)
379 list_del(&dtc->node); 379 list_del(&dtc->node);
380 dmatest_cleanup_channel(dtc); 380 dmatest_cleanup_channel(dtc);
381 pr_debug("dmatest: lost channel %s\n", 381 pr_debug("dmatest: lost channel %s\n",
382 chan->dev.bus_id); 382 dev_name(&chan->dev));
383 return DMA_ACK; 383 return DMA_ACK;
384 } 384 }
385 } 385 }
@@ -418,7 +418,7 @@ dmatest_event(struct dma_client *client, struct dma_chan *chan,
418 418
419 default: 419 default:
420 pr_info("dmatest: Unhandled event %u (%s)\n", 420 pr_info("dmatest: Unhandled event %u (%s)\n",
421 state, chan->dev.bus_id); 421 state, dev_name(&chan->dev));
422 break; 422 break;
423 } 423 }
424 424
diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index 71fba82462cb..c7a9306d951d 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -411,6 +411,7 @@ iop_adma_tx_submit(struct dma_async_tx_descriptor *tx)
411 int slot_cnt; 411 int slot_cnt;
412 int slots_per_op; 412 int slots_per_op;
413 dma_cookie_t cookie; 413 dma_cookie_t cookie;
414 dma_addr_t next_dma;
414 415
415 grp_start = sw_desc->group_head; 416 grp_start = sw_desc->group_head;
416 slot_cnt = grp_start->slot_cnt; 417 slot_cnt = grp_start->slot_cnt;
@@ -425,12 +426,12 @@ iop_adma_tx_submit(struct dma_async_tx_descriptor *tx)
425 &old_chain_tail->chain_node); 426 &old_chain_tail->chain_node);
426 427
427 /* fix up the hardware chain */ 428 /* fix up the hardware chain */
428 iop_desc_set_next_desc(old_chain_tail, grp_start->async_tx.phys); 429 next_dma = grp_start->async_tx.phys;
430 iop_desc_set_next_desc(old_chain_tail, next_dma);
431 BUG_ON(iop_desc_get_next_desc(old_chain_tail) != next_dma); /* flush */
429 432
430 /* 1/ don't add pre-chained descriptors 433 /* check for pre-chained descriptors */
431 * 2/ dummy read to flush next_desc write 434 iop_paranoia(iop_desc_get_next_desc(sw_desc));
432 */
433 BUG_ON(iop_desc_get_next_desc(sw_desc));
434 435
435 /* increment the pending count by the number of slots 436 /* increment the pending count by the number of slots
436 * memcpy operations have a 1:1 (slot:operation) relation 437 * memcpy operations have a 1:1 (slot:operation) relation