spi/bfin_spi: sync hardware state before reprogramming everything
authorBarry Song <barry.song@analog.com>
Mon, 30 Nov 2009 03:49:41 +0000 (03:49 +0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 18 Oct 2010 06:49:37 +0000 (02:49 -0400)
Sometimes under load, the Blackfin core is able to send SPI register
updates out before the controller is actually disabled.  So when we
go to reprogram the entire state (to switch to a different slave),
make sure we sync after disabling the controller.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
drivers/spi/spi_bfin5xx.c

index c23ac3b..54f9dbb 100644 (file)
@@ -247,6 +247,8 @@ static void bfin_spi_restore_state(struct master_data *drv_data)
        bfin_spi_disable(drv_data);
        dev_dbg(&drv_data->pdev->dev, "restoring spi ctl state\n");
 
+       SSYNC();
+
        /* Load the registers */
        write_CTRL(drv_data, chip->ctl_reg);
        write_BAUD(drv_data, chip->baud);