From 070a9c01d94e5efbdf0afae9ad2ddab380a2513e Mon Sep 17 00:00:00 2001
From: Petr Cvek <petr.cvek@tul.cz>
Date: Thu, 23 Feb 2017 01:07:51 +0100
Subject: [PATCH] DMA/MMC debugs
---
drivers/dma/virt-dma.c | 6 +++++-
drivers/mmc/host/pxamci.c | 18 ++++++++++++++++--
2 files changed, 21 insertions(+), 3 deletions(-)
@@ -101,15 +101,19 @@ static void vchan_complete(unsigned long arg)
}
spin_unlock_irq(&vc->lock);
+pr_info("###pre\n");
dmaengine_desc_callback_invoke(&cb, NULL);
while (!list_empty(&head)) {
vd = list_first_entry(&head, struct virt_dma_desc, node);
dmaengine_desc_get_callback(&vd->tx, &cb);
+pr_info("###post\n");
list_del(&vd->node);
- if (dmaengine_desc_test_reuse(&vd->tx))
+ if (dmaengine_desc_test_reuse(&vd->tx)) {
+ pr_info("###reuse\n");
list_add(&vd->node, &vc->desc_allocated);
+ }
else
vc->desc_free(vd);
@@ -191,6 +191,8 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
host->data = data;
+pr_info("##pxamci_setup_data\n");
+
writel(nob, host->base + MMC_NOB);
writel(data->blksz, host->base + MMC_BLKLEN);
@@ -300,8 +302,10 @@ static int pxamci_cmd_done(struct pxamci_host *host, unsigned int stat)
int i;
u32 v;
- if (!cmd)
+ if (!cmd) {
+pr_info("###pxamci_cmd_done NONE\n");
return 0;
+ }
host->cmd = NULL;
@@ -354,8 +358,10 @@ static int pxamci_data_done(struct pxamci_host *host, unsigned int stat)
struct mmc_data *data = host->data;
struct dma_chan *chan;
- if (!data)
+ if (!data) {
+pr_info("###pxamci_data_done NONE\n");
return 0;
+ }
if (data->flags & MMC_DATA_READ)
chan = host->dma_chan_rx;
@@ -385,6 +391,7 @@ static int pxamci_data_done(struct pxamci_host *host, unsigned int stat)
host->data = NULL;
if (host->mrq->stop) {
pxamci_stop_clock(host);
+pr_info("##pxamci_start_cmd DD\n");
pxamci_start_cmd(host, host->mrq->stop, host->cmdat);
} else {
pxamci_finish_request(host, host->mrq);
@@ -441,6 +448,7 @@ static void pxamci_request(struct mmc_host *mmc, struct mmc_request *mrq)
if (mrq->data->flags & MMC_DATA_WRITE)
cmdat |= CMDAT_WRITE;
}
+pr_info("##pxamci_start_cmd RQ\n");
pxamci_start_cmd(host, mrq->cmd, cmdat);
}
@@ -568,13 +576,19 @@ static void pxamci_dma_irq(void *param)
status = dmaengine_tx_status(chan, host->dma_cookie, &state);
+pr_info("!!!cookie=%x complete=%x used=%x ... status=%i\n",
+ host->dma_cookie,chan->completed_cookie,chan->cookie,
+ status);
+
if (likely(status == DMA_COMPLETE)) {
writel(BUF_PART_FULL, host->base + MMC_PRTBUF);
+/*
} else {
pr_err("%s: DMA error on %s channel\n", mmc_hostname(host->mmc),
host->data->flags & MMC_DATA_READ ? "rx" : "tx");
host->data->error = -EIO;
pxamci_data_done(host, 0);
+*/
}
out_unlock:
--
2.11.0