Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi_bfin5xx: use PIO for full duplex, not DMA

Use PIO for full-duplex transfers, instead of DMA.

Signed-off-by: Vitja Makarov <vitja.makarov@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Vitja Makarov and committed by
Linus Torvalds
8eeb12e5 ef3fb66c

+5 -2
+5 -2
drivers/spi/spi_bfin5xx.c
··· 608 608 u8 width; 609 609 u16 cr, dma_width, dma_config; 610 610 u32 tranf_success = 1; 611 + u8 full_duplex = 0; 611 612 612 613 /* Get current state information */ 613 614 message = drv_data->cur_msg; ··· 659 658 } 660 659 661 660 if (transfer->rx_buf != NULL) { 661 + full_duplex = transfer->tx_buf != NULL; 662 662 drv_data->rx = transfer->rx_buf; 663 663 drv_data->rx_end = drv_data->rx + transfer->len; 664 664 dev_dbg(&drv_data->pdev->dev, "rx_buf is %p, rx_end is %p\n", ··· 742 740 * successful use different way to r/w according to 743 741 * drv_data->cur_chip->enable_dma 744 742 */ 745 - if (drv_data->cur_chip->enable_dma && drv_data->len > 6) { 743 + if (!full_duplex && drv_data->cur_chip->enable_dma 744 + && drv_data->len > 6) { 746 745 747 746 disable_dma(drv_data->dma_channel); 748 747 clear_dma_irqstat(drv_data->dma_channel); ··· 831 828 /* IO mode write then read */ 832 829 dev_dbg(&drv_data->pdev->dev, "doing IO transfer\n"); 833 830 834 - if (drv_data->tx != NULL && drv_data->rx != NULL) { 831 + if (full_duplex) { 835 832 /* full duplex mode */ 836 833 BUG_ON((drv_data->tx_end - drv_data->tx) != 837 834 (drv_data->rx_end - drv_data->rx));