Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142556
b: refs/heads/master
c: 11d6f59
h: refs/heads/master
v: v3
  • Loading branch information
Mike Frysinger authored and Linus Torvalds committed Apr 7, 2009
1 parent d29941a commit 6786554
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4160bde2d83d1c66e9c774c48015a13733fe9aba
refs/heads/master: 11d6f5995137ba4dc49e9337185ac0a8753f8f69
26 changes: 16 additions & 10 deletions trunk/drivers/spi/spi_bfin5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,11 +761,10 @@ static void pump_transfers(unsigned long data)
if (!full_duplex && drv_data->cur_chip->enable_dma
&& drv_data->len > 6) {

unsigned long dma_start_addr;
unsigned long dma_start_addr, flags;

disable_dma(drv_data->dma_channel);
clear_dma_irqstat(drv_data->dma_channel);
bfin_spi_disable(drv_data);

/* config dma channel */
dev_dbg(&drv_data->pdev->dev, "doing dma transfer\n");
Expand Down Expand Up @@ -796,8 +795,7 @@ static void pump_transfers(unsigned long data)
enable_dma(drv_data->dma_channel);

/* start SPI transfer */
write_CTRL(drv_data,
(cr | BIT_CTL_TIMOD_DMA_TX | BIT_CTL_ENABLE));
write_CTRL(drv_data, cr | BIT_CTL_TIMOD_DMA_TX);

/* just return here, there can only be one transfer
* in this mode
Expand Down Expand Up @@ -842,14 +840,22 @@ static void pump_transfers(unsigned long data)
} else
BUG();

/* start dma */
dma_enable_irq(drv_data->dma_channel);
set_dma_config(drv_data->dma_channel, dma_config);
/* oh man, here there be monsters ... and i dont mean the
* fluffy cute ones from pixar, i mean the kind that'll eat
* your data, kick your dog, and love it all. do *not* try
* and change these lines unless you (1) heavily test DMA
* with SPI flashes on a loaded system (e.g. ping floods),
* (2) know just how broken the DMA engine interaction with
* the SPI peripheral is, and (3) have someone else to blame
* when you screw it all up anyways.
*/
set_dma_start_addr(drv_data->dma_channel, dma_start_addr);
set_dma_config(drv_data->dma_channel, dma_config);
local_irq_save(flags);
enable_dma(drv_data->dma_channel);

/* start SPI transfer */
write_CTRL(drv_data, (cr | BIT_CTL_ENABLE));
write_CTRL(drv_data, cr);
dma_enable_irq(drv_data->dma_channel);
local_irq_restore(flags);

} else {
/* IO mode write then read */
Expand Down

0 comments on commit 6786554

Please sign in to comment.