Re: [uclinux-dist-devel] [PATCH v2] spi:spi_bfin5xx: SPI SSELdeasserted too early in soft irq mode.

From: Barry Song
Date: Thu Sep 01 2011 - 08:53:22 EST


2011/8/12 Sonic Zhang <sonic.adi@xxxxxxxxx>:
> From: Sonic Zhang <sonic.zhang@xxxxxxxxxx>
>
> Poll the FIFO till it is empty before deassert SSEL in pump_transfers in
> soft irq mode. No polling is necessary in interrupt mode and error handling.
>
> Signed-off-by: Sonic Zhang <sonic.zhang@xxxxxxxxxx>

Acked-by: Barry Song <21cnbao@xxxxxxxxx>

it is actually making sure the last message is finished.

> ---
> Âdrivers/spi/spi-bfin5xx.c | Â Â5 ++++-
> Â1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/spi/spi-bfin5xx.c b/drivers/spi/spi-bfin5xx.c
> index b8d25f2..7e03e7d 100644
> --- a/drivers/spi/spi-bfin5xx.c
> +++ b/drivers/spi/spi-bfin5xx.c
> @@ -587,6 +587,7 @@ static void bfin_spi_pump_transfers(unsigned long data)
> Â Â Â Âif (message->state == DONE_STATE) {
> Â Â Â Â Â Â Â Âdev_dbg(&drv_data->pdev->dev, "transfer: all done!\n");
> Â Â Â Â Â Â Â Âmessage->status = 0;
> + Â Â Â Â Â Â Â bfin_spi_flush(drv_data);
> Â Â Â Â Â Â Â Âbfin_spi_giveback(drv_data);
> Â Â Â Â Â Â Â Âreturn;
> Â Â Â Â}
> @@ -870,8 +871,10 @@ static void bfin_spi_pump_transfers(unsigned long data)
> Â Â Â Â Â Â Â Âmessage->actual_length += drv_data->len_in_bytes;
> Â Â Â Â Â Â Â Â/* Move to next transfer of this msg */
> Â Â Â Â Â Â Â Âmessage->state = bfin_spi_next_transfer(drv_data);
> - Â Â Â Â Â Â Â if (drv_data->cs_change)
> + Â Â Â Â Â Â Â if (drv_data->cs_change) {
> + Â Â Â Â Â Â Â Â Â Â Â bfin_spi_flush(drv_data);
> Â Â Â Â Â Â Â Â Â Â Â Âbfin_spi_cs_deactive(drv_data, chip);
> + Â Â Â Â Â Â Â }
> Â Â Â Â}
>
> Â Â Â Â/* Schedule next transfer tasklet */
> --
> 1.7.0.4
>
>
> _______________________________________________
> Uclinux-dist-devel mailing list
> Uclinux-dist-devel@xxxxxxxxxxxxxxxxxxxx
> https://blackfin.uclinux.org/mailman/listinfo/uclinux-dist-devel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/