* [PATCH] ARM: OMAP: omap_uwire: wait for tx complete before starting the next one
@ 2006-06-09 15:17 Imre Deak
2006-06-12 17:12 ` Juha Yrjölä
0 siblings, 1 reply; 2+ messages in thread
From: Imre Deak @ 2006-06-09 15:17 UTC (permalink / raw)
To: Tony Lindgren; +Cc: omap-linux
The TDR register shouldn't be written when the CSRB flag is set. The fix
solves the problem where one SPI transfer includes multiple 8 or 16 bit
tx elements and the current transfer can be corrupted by accessing the
TDR too early.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
diff --git a/drivers/spi/omap_uwire.c b/drivers/spi/omap_uwire.c
index ce4b992..6375256 100644
--- a/drivers/spi/omap_uwire.c
+++ b/drivers/spi/omap_uwire.c
@@ -240,12 +240,13 @@ static int uwire_txrx(struct spi_device
pr_debug("%s: write-%d =%04x\n",
spi->dev.bus_id, bits, val);
#endif
+ if (wait_uwire_csr_flag(CSRB, 0, 0))
+ goto eio;
+
uwire_write_reg(UWIRE_TDR, val);
/* start write */
val = START | w | (bits << 5);
- if (wait_uwire_csr_flag(CSRB, 0, 0))
- goto eio;
uwire_write_reg(UWIRE_CSR, val);
len -= bytes;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: OMAP: omap_uwire: wait for tx complete before starting the next one
2006-06-09 15:17 [PATCH] ARM: OMAP: omap_uwire: wait for tx complete before starting the next one Imre Deak
@ 2006-06-12 17:12 ` Juha Yrjölä
0 siblings, 0 replies; 2+ messages in thread
From: Juha Yrjölä @ 2006-06-12 17:12 UTC (permalink / raw)
To: Imre Deak; +Cc: omap-linux
Imre Deak wrote:
> The TDR register shouldn't be written when the CSRB flag is set. The fix
> solves the problem where one SPI transfer includes multiple 8 or 16 bit
> tx elements and the current transfer can be corrupted by accessing the
> TDR too early.
Applied.
Cheers,
Juha
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-12 17:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-09 15:17 [PATCH] ARM: OMAP: omap_uwire: wait for tx complete before starting the next one Imre Deak
2006-06-12 17:12 ` Juha Yrjölä
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox