aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2009-04-06 22:00:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 11:31:05 -0400
commitd24bd1d0dc850e7aa68c27ec288eb699d41a5916 (patch)
tree5360f0b6f43a5581ccc4dc7dbf5c36e93d734ba0
parent59bfcc664859029f60269ca2bf05b310d5a5760b (diff)
Blackfin SPI Driver: add a few more DMA debug messages
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> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/spi/spi_bfin5xx.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index 0bbe19eafc26..5acec9ff0175 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)
559 struct driver_data *drv_data = dev_id; 559 struct driver_data *drv_data = dev_id;
560 struct chip_data *chip = drv_data->cur_chip; 560 struct chip_data *chip = drv_data->cur_chip;
561 struct spi_message *msg = drv_data->cur_msg; 561 struct spi_message *msg = drv_data->cur_msg;
562 unsigned short dmastat = get_dma_curr_irqstat(drv_data->dma_channel);
562 u16 spistat = read_STAT(drv_data); 563 u16 spistat = read_STAT(drv_data);
563 564
564 dev_dbg(&drv_data->pdev->dev, "in dma_irq_handler\n"); 565 dev_dbg(&drv_data->pdev->dev,
566 "in dma_irq_handler dmastat:0x%x spistat:0x%x\n",
567 dmastat, spistat);
568
565 clear_dma_irqstat(drv_data->dma_channel); 569 clear_dma_irqstat(drv_data->dma_channel);
566 570
567 /* Wait for DMA to complete */ 571 /* Wait for DMA to complete */
@@ -631,6 +635,7 @@ static void pump_transfers(unsigned long data)
631 635
632 /* Handle for abort */ 636 /* Handle for abort */
633 if (message->state == ERROR_STATE) { 637 if (message->state == ERROR_STATE) {
638 dev_dbg(&drv_data->pdev->dev, "transfer: we've hit an error\n");
634 message->status = -EIO; 639 message->status = -EIO;
635 giveback(drv_data); 640 giveback(drv_data);
636 return; 641 return;
@@ -638,6 +643,7 @@ static void pump_transfers(unsigned long data)
638 643
639 /* Handle end of message */ 644 /* Handle end of message */
640 if (message->state == DONE_STATE) { 645 if (message->state == DONE_STATE) {
646 dev_dbg(&drv_data->pdev->dev, "transfer: all done!\n");
641 message->status = 0; 647 message->status = 0;
642 giveback(drv_data); 648 giveback(drv_data);
643 return; 649 return;
@@ -645,6 +651,7 @@ static void pump_transfers(unsigned long data)
645 651
646 /* Delay if requested at end of transfer */ 652 /* Delay if requested at end of transfer */
647 if (message->state == RUNNING_STATE) { 653 if (message->state == RUNNING_STATE) {
654 dev_dbg(&drv_data->pdev->dev, "transfer: still running ...\n");
648 previous = list_entry(transfer->transfer_list.prev, 655 previous = list_entry(transfer->transfer_list.prev,
649 struct spi_transfer, transfer_list); 656 struct spi_transfer, transfer_list);
650 if (previous->delay_usecs) 657 if (previous->delay_usecs)
@@ -806,7 +813,8 @@ static void pump_transfers(unsigned long data)
806 dma_config = (RESTART | dma_width | DI_EN); 813 dma_config = (RESTART | dma_width | DI_EN);
807 if (drv_data->rx != NULL) { 814 if (drv_data->rx != NULL) {
808 /* set transfer mode, and enable SPI */ 815 /* set transfer mode, and enable SPI */
809 dev_dbg(&drv_data->pdev->dev, "doing DMA in.\n"); 816 dev_dbg(&drv_data->pdev->dev, "doing DMA in to %p (size %zx)\n",
817 drv_data->rx, drv_data->len_in_bytes);
810 818
811 /* invalidate caches, if needed */ 819 /* invalidate caches, if needed */
812 if (bfin_addr_dcachable((unsigned long) drv_data->rx)) 820 if (bfin_addr_dcachable((unsigned long) drv_data->rx))