public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bryan Wu <cooloney@kernel.org>
To: dbrownell@users.sourceforge.net, akpm@linux-foundation.org
Cc: spi-devel-general@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	Mike Frysinger <vapier.adi@gmail.com>,
	Bryan Wu <cooloney@kernel.org>
Subject: [PATCH 08/20] Blackfin SPI Driver: add a few more DMA debug messages
Date: Fri,  6 Feb 2009 15:12:56 +0800	[thread overview]
Message-ID: <1233904388-5765-9-git-send-email-cooloney@kernel.org> (raw)
In-Reply-To: <1233904388-5765-1-git-send-email-cooloney@kernel.org>

From: Mike Frysinger <vapier.adi@gmail.com>

Because of DMA hardware issue, we were trying to use software workaround.
This patch add some useful debug messages to help us debugging the DMA
code.

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 drivers/spi/spi_bfin5xx.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index 459ec36..7652da8 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -559,9 +559,13 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id)
 	struct driver_data *drv_data = dev_id;
 	struct chip_data *chip = drv_data->cur_chip;
 	struct spi_message *msg = drv_data->cur_msg;
+	unsigned short dmastat = get_dma_curr_irqstat(drv_data->dma_channel);
 	u16 spistat = read_STAT(drv_data);
 
-	dev_dbg(&drv_data->pdev->dev, "in dma_irq_handler\n");
+	dev_dbg(&drv_data->pdev->dev,
+		"in dma_irq_handler dmastat:0x%x spistat:0x%x\n",
+		dmastat, spistat);
+
 	clear_dma_irqstat(drv_data->dma_channel);
 
 	/* Wait for DMA to complete */
@@ -631,6 +635,7 @@ static void pump_transfers(unsigned long data)
 
 	 /* Handle for abort */
 	if (message->state == ERROR_STATE) {
+		dev_dbg(&drv_data->pdev->dev, "transfer: we've hit an error\n");
 		message->status = -EIO;
 		giveback(drv_data);
 		return;
@@ -638,6 +643,7 @@ static void pump_transfers(unsigned long data)
 
 	/* Handle end of message */
 	if (message->state == DONE_STATE) {
+		dev_dbg(&drv_data->pdev->dev, "transfer: all done!\n");
 		message->status = 0;
 		giveback(drv_data);
 		return;
@@ -645,6 +651,7 @@ static void pump_transfers(unsigned long data)
 
 	/* Delay if requested at end of transfer */
 	if (message->state == RUNNING_STATE) {
+		dev_dbg(&drv_data->pdev->dev, "transfer: still running ...\n");
 		previous = list_entry(transfer->transfer_list.prev,
 				      struct spi_transfer, transfer_list);
 		if (previous->delay_usecs)
@@ -806,7 +813,8 @@ static void pump_transfers(unsigned long data)
 		dma_config = (RESTART | dma_width | DI_EN);
 		if (drv_data->rx != NULL) {
 			/* set transfer mode, and enable SPI */
-			dev_dbg(&drv_data->pdev->dev, "doing DMA in.\n");
+			dev_dbg(&drv_data->pdev->dev, "doing DMA in to %p (size %zx)\n",
+				drv_data->rx, drv_data->len_in_bytes);
 
 			/* invalidate caches, if needed */
 			if (bfin_addr_dcachable((unsigned long) drv_data->rx))
-- 
1.5.6.3

  parent reply	other threads:[~2009-02-06  7:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06  7:12 [PATCH 00/20] Blackfin SPI Driver fixing and updates Bryan Wu
2009-02-06  7:12 ` [PATCH 01/20] Blackfin SPI Driver: ensure cache coherency before doing DMA Bryan Wu
2009-02-06  7:12 ` [PATCH 02/20] Blackfin SPI Driver: Fix erroneous SPI Clock divisor calculation Bryan Wu
2009-02-06  7:12 ` [PATCH 03/20] Blackfin SPI Driver: remove useless <asm/cplbinit.h> Bryan Wu
2009-02-06  7:12 ` [PATCH 04/20] Blackfin SPI Driver: use len_in_bytes when we care about the number of bytes transferred Bryan Wu
2009-02-06  7:12 ` [PATCH 05/20] Blackfin SPI Driver: pass DMA overflow error to the higher level Bryan Wu
2009-02-06  7:12 ` [PATCH 06/20] Blackfin SPI Driver: unify duplicated code in dma read/write paths Bryan Wu
2009-02-06  7:12 ` [PATCH 07/20] Blackfin SPI Driver: drop bogus cast and touchup dma label Bryan Wu
2009-02-06  7:12 ` Bryan Wu [this message]
2009-02-06  7:12 ` [PATCH 09/20] Blackfin SPI Driver: do not check for SPI errors if DMA itself did not flag any Bryan Wu
2009-02-06  7:12 ` [PATCH 10/20] Blackfin SPI Driver: use the properl BIT_CTL_xxx defines Bryan Wu
2009-02-06  7:12 ` [PATCH 11/20] Blackfin SPI Driver: SPI slave select code cleanup Bryan Wu
2009-02-06  7:13 ` [PATCH 12/20] Blackfin SPI Driver: get dma working for SPI flashes Bryan Wu
2009-02-06  7:13 ` [PATCH 13/20] Blackfin SPI Driver: add timeout while waiting for SPIF in dma irq handler Bryan Wu
2009-02-06  7:13 ` [PATCH 14/20] Blackfin SPI Driver: tweak magic spi dma sequence to get it working on BF54x Bryan Wu
2009-02-06  7:13 ` [PATCH 15/20] Blackfin SPI Driver: fix bug - spi controller driver does not assert/deassert CS correctly Bryan Wu
2009-02-06  7:13 ` [PATCH 16/20] Blackfin SPI Driver: fix bug - correct usage of struct spi_transfer.cs_change Bryan Wu
2009-02-06  7:13 ` [PATCH 17/20] Blackfin SPI Driver: use bfin_spi_ prefix on all functions Bryan Wu
2009-02-06  7:13 ` [PATCH 18/20] Blackfin SPI Driver: fix NULL pointer crash Bryan Wu
2009-02-06  7:13 ` [PATCH 19/20] Blackfin SPI Driver: Add GPIO controlled SPI Slave Select support Bryan Wu
2009-02-06  7:13 ` [PATCH 20/20] Blackfin SPI Driver: Make mmc_spi driver work on Blackfin Bryan Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1233904388-5765-9-git-send-email-cooloney@kernel.org \
    --to=cooloney@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=vapier.adi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox