diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/spi_bfin5xx.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index 6d3f6064871e..2e0c024bbde7 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c | |||
@@ -559,6 +559,7 @@ 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 | u16 spistat = read_STAT(drv_data); | ||
562 | 563 | ||
563 | dev_dbg(&drv_data->pdev->dev, "in dma_irq_handler\n"); | 564 | dev_dbg(&drv_data->pdev->dev, "in dma_irq_handler\n"); |
564 | clear_dma_irqstat(drv_data->dma_channel); | 565 | clear_dma_irqstat(drv_data->dma_channel); |
@@ -582,13 +583,18 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id) | |||
582 | while (!(read_STAT(drv_data) & SPIF)) | 583 | while (!(read_STAT(drv_data) & SPIF)) |
583 | cpu_relax(); | 584 | cpu_relax(); |
584 | 585 | ||
585 | msg->actual_length += drv_data->len_in_bytes; | 586 | if (spistat & RBSY) { |
587 | msg->state = ERROR_STATE; | ||
588 | dev_err(&drv_data->pdev->dev, "dma receive: fifo/buffer overflow\n"); | ||
589 | } else { | ||
590 | msg->actual_length += drv_data->len_in_bytes; | ||
586 | 591 | ||
587 | if (drv_data->cs_change) | 592 | if (drv_data->cs_change) |
588 | cs_deactive(drv_data, chip); | 593 | cs_deactive(drv_data, chip); |
589 | 594 | ||
590 | /* Move to next transfer */ | 595 | /* Move to next transfer */ |
591 | msg->state = next_transfer(drv_data); | 596 | msg->state = next_transfer(drv_data); |
597 | } | ||
592 | 598 | ||
593 | /* Schedule transfer tasklet */ | 599 | /* Schedule transfer tasklet */ |
594 | tasklet_schedule(&drv_data->pump_transfers); | 600 | tasklet_schedule(&drv_data->pump_transfers); |