提交 72d8a0d2 编写于 作者: A Alexandre Bounine 提交者: Linus Torvalds

rapidio/tsi721: add filtered debug output

Replace "all-or-nothing" debug output with controlled debug output using
functional block masks.  This allows run time control of debug messages
through 'dbg_level' module parameter.
Signed-off-by: NAlexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1679e8da
...@@ -16,6 +16,15 @@ For inbound messages this driver uses destination ID matching to forward message ...@@ -16,6 +16,15 @@ For inbound messages this driver uses destination ID matching to forward message
into the corresponding message queue. Messaging callbacks are implemented to be into the corresponding message queue. Messaging callbacks are implemented to be
fully compatible with RIONET driver (Ethernet over RapidIO messaging services). fully compatible with RIONET driver (Ethernet over RapidIO messaging services).
1. Module parameters:
- 'dbg_level' - This parameter allows to control amount of debug information
generated by this device driver. This parameter is formed by set of
This parameter can be changed bit masks that correspond to the specific
functional block.
For mask definitions see 'drivers/rapidio/devices/tsi721.h'
This parameter can be changed dynamically.
Use CONFIG_RAPIDIO_DEBUG=y to enable debug output at the top level.
II. Known problems II. Known problems
None. None.
......
此差异已折叠。
...@@ -21,6 +21,46 @@ ...@@ -21,6 +21,46 @@
#ifndef __TSI721_H #ifndef __TSI721_H
#define __TSI721_H #define __TSI721_H
/* Debug output filtering masks */
enum {
DBG_NONE = 0,
DBG_INIT = BIT(0), /* driver init */
DBG_EXIT = BIT(1), /* driver exit */
DBG_MPORT = BIT(2), /* mport add/remove */
DBG_MAINT = BIT(3), /* maintenance ops messages */
DBG_DMA = BIT(4), /* DMA transfer messages */
DBG_DMAV = BIT(5), /* verbose DMA transfer messages */
DBG_IBW = BIT(6), /* inbound window */
DBG_EVENT = BIT(7), /* event handling messages */
DBG_OBW = BIT(8), /* outbound window messages */
DBG_DBELL = BIT(9), /* doorbell messages */
DBG_OMSG = BIT(10), /* doorbell messages */
DBG_IMSG = BIT(11), /* doorbell messages */
DBG_ALL = ~0,
};
#ifdef DEBUG
extern u32 dbg_level;
#define tsi_debug(level, dev, fmt, arg...) \
do { \
if (DBG_##level & dbg_level) \
dev_dbg(dev, "%s: " fmt "\n", __func__, ##arg); \
} while (0)
#else
#define tsi_debug(level, dev, fmt, arg...) \
no_printk(KERN_DEBUG "%s: " fmt "\n", __func__, ##arg)
#endif
#define tsi_info(dev, fmt, arg...) \
dev_info(dev, "%s: " fmt "\n", __func__, ##arg)
#define tsi_warn(dev, fmt, arg...) \
dev_warn(dev, "%s: WARNING " fmt "\n", __func__, ##arg)
#define tsi_err(dev, fmt, arg...) \
dev_err(dev, "%s: ERROR " fmt "\n", __func__, ##arg)
#define DRV_NAME "tsi721" #define DRV_NAME "tsi721"
#define DEFAULT_HOPCOUNT 0xff #define DEFAULT_HOPCOUNT 0xff
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/kfifo.h> #include <linux/kfifo.h>
#include <linux/sched.h>
#include <linux/delay.h> #include <linux/delay.h>
#include "../../dma/dmaengine.h" #include "../../dma/dmaengine.h"
...@@ -75,7 +76,7 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num) ...@@ -75,7 +76,7 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num)
struct tsi721_device *priv = to_tsi721(bdma_chan->dchan.device); struct tsi721_device *priv = to_tsi721(bdma_chan->dchan.device);
#endif #endif
dev_dbg(dev, "Init Block DMA Engine, CH%d\n", bdma_chan->id); tsi_debug(DMA, &bdma_chan->dchan.dev->device, "DMAC%d", bdma_chan->id);
/* /*
* Allocate space for DMA descriptors * Allocate space for DMA descriptors
...@@ -91,8 +92,9 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num) ...@@ -91,8 +92,9 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num)
bdma_chan->bd_phys = bd_phys; bdma_chan->bd_phys = bd_phys;
bdma_chan->bd_base = bd_ptr; bdma_chan->bd_base = bd_ptr;
dev_dbg(dev, "DMA descriptors @ %p (phys = %llx)\n", tsi_debug(DMA, &bdma_chan->dchan.dev->device,
bd_ptr, (unsigned long long)bd_phys); "DMAC%d descriptors @ %p (phys = %pad)",
bdma_chan->id, bd_ptr, &bd_phys);
/* Allocate space for descriptor status FIFO */ /* Allocate space for descriptor status FIFO */
sts_size = ((bd_num + 1) >= TSI721_DMA_MINSTSSZ) ? sts_size = ((bd_num + 1) >= TSI721_DMA_MINSTSSZ) ?
...@@ -114,9 +116,9 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num) ...@@ -114,9 +116,9 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num)
bdma_chan->sts_base = sts_ptr; bdma_chan->sts_base = sts_ptr;
bdma_chan->sts_size = sts_size; bdma_chan->sts_size = sts_size;
dev_dbg(dev, tsi_debug(DMA, &bdma_chan->dchan.dev->device,
"desc status FIFO @ %p (phys = %llx) size=0x%x\n", "DMAC%d desc status FIFO @ %p (phys = %pad) size=0x%x",
sts_ptr, (unsigned long long)sts_phys, sts_size); bdma_chan->id, sts_ptr, &sts_phys, sts_size);
/* Initialize DMA descriptors ring using added link descriptor */ /* Initialize DMA descriptors ring using added link descriptor */
bd_ptr[bd_num].type_id = cpu_to_le32(DTYPE3 << 29); bd_ptr[bd_num].type_id = cpu_to_le32(DTYPE3 << 29);
...@@ -155,8 +157,9 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num) ...@@ -155,8 +157,9 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num)
priv->msix[idx].irq_name, (void *)bdma_chan); priv->msix[idx].irq_name, (void *)bdma_chan);
if (rc) { if (rc) {
dev_dbg(dev, "Unable to get MSI-X for BDMA%d-DONE\n", tsi_debug(DMA, &bdma_chan->dchan.dev->device,
bdma_chan->id); "Unable to get MSI-X for DMAC%d-DONE",
bdma_chan->id);
goto err_out; goto err_out;
} }
...@@ -166,8 +169,9 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num) ...@@ -166,8 +169,9 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num)
priv->msix[idx].irq_name, (void *)bdma_chan); priv->msix[idx].irq_name, (void *)bdma_chan);
if (rc) { if (rc) {
dev_dbg(dev, "Unable to get MSI-X for BDMA%d-INT\n", tsi_debug(DMA, &bdma_chan->dchan.dev->device,
bdma_chan->id); "Unable to get MSI-X for DMAC%d-INT",
bdma_chan->id);
free_irq( free_irq(
priv->msix[TSI721_VECT_DMA0_DONE + priv->msix[TSI721_VECT_DMA0_DONE +
bdma_chan->id].vector, bdma_chan->id].vector,
...@@ -302,20 +306,22 @@ static irqreturn_t tsi721_bdma_msix(int irq, void *ptr) ...@@ -302,20 +306,22 @@ static irqreturn_t tsi721_bdma_msix(int irq, void *ptr)
static void tsi721_start_dma(struct tsi721_bdma_chan *bdma_chan) static void tsi721_start_dma(struct tsi721_bdma_chan *bdma_chan)
{ {
if (!tsi721_dma_is_idle(bdma_chan)) { if (!tsi721_dma_is_idle(bdma_chan)) {
dev_err(bdma_chan->dchan.device->dev, tsi_err(&bdma_chan->dchan.dev->device,
"BUG: Attempt to start non-idle channel\n"); "DMAC%d Attempt to start non-idle channel",
bdma_chan->id);
return; return;
} }
if (bdma_chan->wr_count == bdma_chan->wr_count_next) { if (bdma_chan->wr_count == bdma_chan->wr_count_next) {
dev_err(bdma_chan->dchan.device->dev, tsi_err(&bdma_chan->dchan.dev->device,
"BUG: Attempt to start DMA with no BDs ready\n"); "DMAC%d Attempt to start DMA with no BDs ready %d",
bdma_chan->id, task_pid_nr(current));
return; return;
} }
dev_dbg(bdma_chan->dchan.device->dev, tsi_debug(DMA, &bdma_chan->dchan.dev->device, "DMAC%d (wrc=%d) %d",
"%s: chan_%d (wrc=%d)\n", __func__, bdma_chan->id, bdma_chan->id, bdma_chan->wr_count_next,
bdma_chan->wr_count_next); task_pid_nr(current));
iowrite32(bdma_chan->wr_count_next, iowrite32(bdma_chan->wr_count_next,
bdma_chan->regs + TSI721_DMAC_DWRCNT); bdma_chan->regs + TSI721_DMAC_DWRCNT);
...@@ -417,10 +423,11 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc) ...@@ -417,10 +423,11 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc)
struct tsi721_dma_desc *bd_ptr = NULL; struct tsi721_dma_desc *bd_ptr = NULL;
u32 idx, rd_idx; u32 idx, rd_idx;
u32 add_count = 0; u32 add_count = 0;
struct device *ch_dev = &dchan->dev->device;
if (!tsi721_dma_is_idle(bdma_chan)) { if (!tsi721_dma_is_idle(bdma_chan)) {
dev_err(bdma_chan->dchan.device->dev, tsi_err(ch_dev, "DMAC%d ERR: Attempt to use non-idle channel",
"BUG: Attempt to use non-idle channel\n"); bdma_chan->id);
return -EIO; return -EIO;
} }
...@@ -431,7 +438,7 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc) ...@@ -431,7 +438,7 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc)
rio_addr = desc->rio_addr; rio_addr = desc->rio_addr;
next_addr = -1; next_addr = -1;
bcount = 0; bcount = 0;
sys_size = dma_to_mport(bdma_chan->dchan.device)->sys_size; sys_size = dma_to_mport(dchan->device)->sys_size;
rd_idx = ioread32(bdma_chan->regs + TSI721_DMAC_DRDCNT); rd_idx = ioread32(bdma_chan->regs + TSI721_DMAC_DRDCNT);
rd_idx %= (bdma_chan->bd_num + 1); rd_idx %= (bdma_chan->bd_num + 1);
...@@ -443,18 +450,18 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc) ...@@ -443,18 +450,18 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc)
add_count++; add_count++;
} }
dev_dbg(dchan->device->dev, "%s: BD ring status: rdi=%d wri=%d\n", tsi_debug(DMA, ch_dev, "DMAC%d BD ring status: rdi=%d wri=%d",
__func__, rd_idx, idx); bdma_chan->id, rd_idx, idx);
for_each_sg(desc->sg, sg, desc->sg_len, i) { for_each_sg(desc->sg, sg, desc->sg_len, i) {
dev_dbg(dchan->device->dev, "sg%d/%d addr: 0x%llx len: %d\n", tsi_debug(DMAV, ch_dev, "DMAC%d sg%d/%d addr: 0x%llx len: %d",
i, desc->sg_len, bdma_chan->id, i, desc->sg_len,
(unsigned long long)sg_dma_address(sg), sg_dma_len(sg)); (unsigned long long)sg_dma_address(sg), sg_dma_len(sg));
if (sg_dma_len(sg) > TSI721_BDMA_MAX_BCOUNT) { if (sg_dma_len(sg) > TSI721_BDMA_MAX_BCOUNT) {
dev_err(dchan->device->dev, tsi_err(ch_dev, "DMAC%d SG entry %d is too large",
"%s: SG entry %d is too large\n", __func__, i); bdma_chan->id, i);
err = -EINVAL; err = -EINVAL;
break; break;
} }
...@@ -471,17 +478,16 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc) ...@@ -471,17 +478,16 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc)
} else if (next_addr != -1) { } else if (next_addr != -1) {
/* Finalize descriptor using total byte count value */ /* Finalize descriptor using total byte count value */
tsi721_desc_fill_end(bd_ptr, bcount, 0); tsi721_desc_fill_end(bd_ptr, bcount, 0);
dev_dbg(dchan->device->dev, tsi_debug(DMAV, ch_dev, "DMAC%d prev desc final len: %d",
"%s: prev desc final len: %d\n", bdma_chan->id, bcount);
__func__, bcount);
} }
desc->rio_addr = rio_addr; desc->rio_addr = rio_addr;
if (i && idx == rd_idx) { if (i && idx == rd_idx) {
dev_dbg(dchan->device->dev, tsi_debug(DMAV, ch_dev,
"%s: HW descriptor ring is full @ %d\n", "DMAC%d HW descriptor ring is full @ %d",
__func__, i); bdma_chan->id, i);
desc->sg = sg; desc->sg = sg;
desc->sg_len -= i; desc->sg_len -= i;
break; break;
...@@ -490,13 +496,12 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc) ...@@ -490,13 +496,12 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc)
bd_ptr = &((struct tsi721_dma_desc *)bdma_chan->bd_base)[idx]; bd_ptr = &((struct tsi721_dma_desc *)bdma_chan->bd_base)[idx];
err = tsi721_desc_fill_init(desc, bd_ptr, sg, sys_size); err = tsi721_desc_fill_init(desc, bd_ptr, sg, sys_size);
if (err) { if (err) {
dev_err(dchan->device->dev, tsi_err(ch_dev, "Failed to build desc: err=%d", err);
"Failed to build desc: err=%d\n", err);
break; break;
} }
dev_dbg(dchan->device->dev, "bd_ptr = %p did=%d raddr=0x%llx\n", tsi_debug(DMAV, ch_dev, "DMAC%d bd_ptr = %p did=%d raddr=0x%llx",
bd_ptr, desc->destid, desc->rio_addr); bdma_chan->id, bd_ptr, desc->destid, desc->rio_addr);
next_addr = sg_dma_address(sg); next_addr = sg_dma_address(sg);
bcount = sg_dma_len(sg); bcount = sg_dma_len(sg);
...@@ -511,8 +516,9 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc) ...@@ -511,8 +516,9 @@ static int tsi721_submit_sg(struct tsi721_tx_desc *desc)
entry_done: entry_done:
if (sg_is_last(sg)) { if (sg_is_last(sg)) {
tsi721_desc_fill_end(bd_ptr, bcount, 0); tsi721_desc_fill_end(bd_ptr, bcount, 0);
dev_dbg(dchan->device->dev, "%s: last desc final len: %d\n", tsi_debug(DMAV, ch_dev,
__func__, bcount); "DMAC%d last desc final len: %d",
bdma_chan->id, bcount);
desc->sg_len = 0; desc->sg_len = 0;
} else { } else {
rio_addr += sg_dma_len(sg); rio_addr += sg_dma_len(sg);
...@@ -531,7 +537,7 @@ static void tsi721_advance_work(struct tsi721_bdma_chan *bdma_chan, ...@@ -531,7 +537,7 @@ static void tsi721_advance_work(struct tsi721_bdma_chan *bdma_chan,
{ {
int err; int err;
dev_dbg(bdma_chan->dchan.device->dev, "%s: Enter\n", __func__); tsi_debug(DMA, &bdma_chan->dchan.dev->device, "DMAC%d", bdma_chan->id);
if (!tsi721_dma_is_idle(bdma_chan)) if (!tsi721_dma_is_idle(bdma_chan))
return; return;
...@@ -555,13 +561,14 @@ static void tsi721_advance_work(struct tsi721_bdma_chan *bdma_chan, ...@@ -555,13 +561,14 @@ static void tsi721_advance_work(struct tsi721_bdma_chan *bdma_chan,
tsi721_start_dma(bdma_chan); tsi721_start_dma(bdma_chan);
else { else {
tsi721_dma_tx_err(bdma_chan, desc); tsi721_dma_tx_err(bdma_chan, desc);
dev_dbg(bdma_chan->dchan.device->dev, tsi_debug(DMA, &bdma_chan->dchan.dev->device,
"ERR: tsi721_submit_sg failed with err=%d\n", "DMAC%d ERR: tsi721_submit_sg failed with err=%d",
err); bdma_chan->id, err);
} }
} }
dev_dbg(bdma_chan->dchan.device->dev, "%s: Exit\n", __func__); tsi_debug(DMA, &bdma_chan->dchan.dev->device, "DMAC%d Exit",
bdma_chan->id);
} }
static void tsi721_dma_tasklet(unsigned long data) static void tsi721_dma_tasklet(unsigned long data)
...@@ -570,16 +577,16 @@ static void tsi721_dma_tasklet(unsigned long data) ...@@ -570,16 +577,16 @@ static void tsi721_dma_tasklet(unsigned long data)
u32 dmac_int, dmac_sts; u32 dmac_int, dmac_sts;
dmac_int = ioread32(bdma_chan->regs + TSI721_DMAC_INT); dmac_int = ioread32(bdma_chan->regs + TSI721_DMAC_INT);
dev_dbg(bdma_chan->dchan.device->dev, "%s: DMAC%d_INT = 0x%x\n", tsi_debug(DMA, &bdma_chan->dchan.dev->device, "DMAC%d_INT = 0x%x",
__func__, bdma_chan->id, dmac_int); bdma_chan->id, dmac_int);
/* Clear channel interrupts */ /* Clear channel interrupts */
iowrite32(dmac_int, bdma_chan->regs + TSI721_DMAC_INT); iowrite32(dmac_int, bdma_chan->regs + TSI721_DMAC_INT);
if (dmac_int & TSI721_DMAC_INT_ERR) { if (dmac_int & TSI721_DMAC_INT_ERR) {
dmac_sts = ioread32(bdma_chan->regs + TSI721_DMAC_STS); dmac_sts = ioread32(bdma_chan->regs + TSI721_DMAC_STS);
dev_err(bdma_chan->dchan.device->dev, tsi_err(&bdma_chan->dchan.dev->device,
"%s: DMA ERROR - DMAC%d_STS = 0x%x\n", "ERR - DMAC%d_STS = 0x%x",
__func__, bdma_chan->id, dmac_sts); bdma_chan->id, dmac_sts);
spin_lock(&bdma_chan->lock); spin_lock(&bdma_chan->lock);
bdma_chan->active_tx = NULL; bdma_chan->active_tx = NULL;
...@@ -587,9 +594,9 @@ static void tsi721_dma_tasklet(unsigned long data) ...@@ -587,9 +594,9 @@ static void tsi721_dma_tasklet(unsigned long data)
} }
if (dmac_int & TSI721_DMAC_INT_STFULL) { if (dmac_int & TSI721_DMAC_INT_STFULL) {
dev_err(bdma_chan->dchan.device->dev, tsi_err(&bdma_chan->dchan.dev->device,
"%s: DMAC%d descriptor status FIFO is full\n", "DMAC%d descriptor status FIFO is full",
__func__, bdma_chan->id); bdma_chan->id);
} }
if (dmac_int & (TSI721_DMAC_INT_DONE | TSI721_DMAC_INT_IOFDONE)) { if (dmac_int & (TSI721_DMAC_INT_DONE | TSI721_DMAC_INT_IOFDONE)) {
...@@ -633,8 +640,9 @@ static dma_cookie_t tsi721_tx_submit(struct dma_async_tx_descriptor *txd) ...@@ -633,8 +640,9 @@ static dma_cookie_t tsi721_tx_submit(struct dma_async_tx_descriptor *txd)
/* Check if the descriptor is detached from any lists */ /* Check if the descriptor is detached from any lists */
if (!list_empty(&desc->desc_node)) { if (!list_empty(&desc->desc_node)) {
dev_err(bdma_chan->dchan.device->dev, tsi_err(&bdma_chan->dchan.dev->device,
"%s: wrong state of descriptor %p\n", __func__, txd); "DMAC%d wrong state of descriptor %p",
bdma_chan->id, txd);
return -EIO; return -EIO;
} }
...@@ -659,16 +667,15 @@ static int tsi721_alloc_chan_resources(struct dma_chan *dchan) ...@@ -659,16 +667,15 @@ static int tsi721_alloc_chan_resources(struct dma_chan *dchan)
struct tsi721_tx_desc *desc = NULL; struct tsi721_tx_desc *desc = NULL;
int i; int i;
dev_dbg(dchan->device->dev, "%s: for channel %d\n", tsi_debug(DMA, &dchan->dev->device, "DMAC%d", bdma_chan->id);
__func__, bdma_chan->id);
if (bdma_chan->bd_base) if (bdma_chan->bd_base)
return TSI721_DMA_TX_QUEUE_SZ; return TSI721_DMA_TX_QUEUE_SZ;
/* Initialize BDMA channel */ /* Initialize BDMA channel */
if (tsi721_bdma_ch_init(bdma_chan, dma_desc_per_channel)) { if (tsi721_bdma_ch_init(bdma_chan, dma_desc_per_channel)) {
dev_err(dchan->device->dev, "Unable to initialize data DMA" tsi_err(&dchan->dev->device, "Unable to initialize DMAC%d",
" channel %d, aborting\n", bdma_chan->id); bdma_chan->id);
return -ENODEV; return -ENODEV;
} }
...@@ -676,8 +683,9 @@ static int tsi721_alloc_chan_resources(struct dma_chan *dchan) ...@@ -676,8 +683,9 @@ static int tsi721_alloc_chan_resources(struct dma_chan *dchan)
desc = kcalloc(TSI721_DMA_TX_QUEUE_SZ, sizeof(struct tsi721_tx_desc), desc = kcalloc(TSI721_DMA_TX_QUEUE_SZ, sizeof(struct tsi721_tx_desc),
GFP_KERNEL); GFP_KERNEL);
if (!desc) { if (!desc) {
dev_err(dchan->device->dev, tsi_err(&dchan->dev->device,
"Failed to allocate logical descriptors\n"); "DMAC%d Failed to allocate logical descriptors",
bdma_chan->id);
tsi721_bdma_ch_free(bdma_chan); tsi721_bdma_ch_free(bdma_chan);
return -ENOMEM; return -ENOMEM;
} }
...@@ -718,8 +726,7 @@ static void tsi721_free_chan_resources(struct dma_chan *dchan) ...@@ -718,8 +726,7 @@ static void tsi721_free_chan_resources(struct dma_chan *dchan)
{ {
struct tsi721_bdma_chan *bdma_chan = to_tsi721_chan(dchan); struct tsi721_bdma_chan *bdma_chan = to_tsi721_chan(dchan);
dev_dbg(dchan->device->dev, "%s: for channel %d\n", tsi_debug(DMA, &dchan->dev->device, "DMAC%d", bdma_chan->id);
__func__, bdma_chan->id);
if (bdma_chan->bd_base == NULL) if (bdma_chan->bd_base == NULL)
return; return;
...@@ -744,7 +751,7 @@ static void tsi721_issue_pending(struct dma_chan *dchan) ...@@ -744,7 +751,7 @@ static void tsi721_issue_pending(struct dma_chan *dchan)
{ {
struct tsi721_bdma_chan *bdma_chan = to_tsi721_chan(dchan); struct tsi721_bdma_chan *bdma_chan = to_tsi721_chan(dchan);
dev_dbg(dchan->device->dev, "%s: Enter\n", __func__); tsi_debug(DMA, &dchan->dev->device, "DMAC%d", bdma_chan->id);
spin_lock_bh(&bdma_chan->lock); spin_lock_bh(&bdma_chan->lock);
if (tsi721_dma_is_idle(bdma_chan) && bdma_chan->active) { if (tsi721_dma_is_idle(bdma_chan) && bdma_chan->active) {
...@@ -766,12 +773,13 @@ struct dma_async_tx_descriptor *tsi721_prep_rio_sg(struct dma_chan *dchan, ...@@ -766,12 +773,13 @@ struct dma_async_tx_descriptor *tsi721_prep_rio_sg(struct dma_chan *dchan,
struct dma_async_tx_descriptor *txd = NULL; struct dma_async_tx_descriptor *txd = NULL;
if (!sgl || !sg_len) { if (!sgl || !sg_len) {
dev_err(dchan->device->dev, "%s: No SG list\n", __func__); tsi_err(&dchan->dev->device, "DMAC%d No SG list",
bdma_chan->id);
return NULL; return NULL;
} }
dev_dbg(dchan->device->dev, "%s: %s\n", __func__, tsi_debug(DMA, &dchan->dev->device, "DMAC%d %s", bdma_chan->id,
(dir == DMA_DEV_TO_MEM)?"READ":"WRITE"); (dir == DMA_DEV_TO_MEM)?"READ":"WRITE");
if (dir == DMA_DEV_TO_MEM) if (dir == DMA_DEV_TO_MEM)
rtype = NREAD; rtype = NREAD;
...@@ -789,8 +797,9 @@ struct dma_async_tx_descriptor *tsi721_prep_rio_sg(struct dma_chan *dchan, ...@@ -789,8 +797,9 @@ struct dma_async_tx_descriptor *tsi721_prep_rio_sg(struct dma_chan *dchan,
break; break;
} }
} else { } else {
dev_err(dchan->device->dev, tsi_err(&dchan->dev->device,
"%s: Unsupported DMA direction option\n", __func__); "DMAC%d Unsupported DMA direction option",
bdma_chan->id);
return NULL; return NULL;
} }
...@@ -823,7 +832,7 @@ static int tsi721_terminate_all(struct dma_chan *dchan) ...@@ -823,7 +832,7 @@ static int tsi721_terminate_all(struct dma_chan *dchan)
u32 dmac_int; u32 dmac_int;
LIST_HEAD(list); LIST_HEAD(list);
dev_dbg(dchan->device->dev, "%s: Entry\n", __func__); tsi_debug(DMA, &dchan->dev->device, "DMAC%d", bdma_chan->id);
spin_lock_bh(&bdma_chan->lock); spin_lock_bh(&bdma_chan->lock);
...@@ -933,7 +942,7 @@ int tsi721_register_dma(struct tsi721_device *priv) ...@@ -933,7 +942,7 @@ int tsi721_register_dma(struct tsi721_device *priv)
err = dma_async_device_register(&mport->dma); err = dma_async_device_register(&mport->dma);
if (err) if (err)
dev_err(&priv->pdev->dev, "Failed to register DMA device\n"); tsi_err(&priv->pdev->dev, "Failed to register DMA device");
return err; return err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册