aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomoya MORINAGA <tomoya-linux@dsn.okisemi.com>2011-09-06 04:16:36 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-10-04 12:10:50 -0400
commit373b0eb64b9c97a14720896dcfdebfa3268b1991 (patch)
tree60fd32435a154920e9c5f3d3630e5ec1e496b88f
parent8b7aa961a815dad389525dcd1c36a44c249b1760 (diff)
spi-topcliff-pch: Fix CPU read complete condition issue
We found Rx data sometimes drops.(with non-DMA transfer mode) The cause is read complete condition is not true. This patch fixes the issue. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-rw-r--r--drivers/spi/spi-topcliff-pch.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index c36d51657066..6cb2fdbe5dba 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -317,16 +317,19 @@ static void pch_spi_handler_sub(struct pch_spi_data *data, u32 reg_spsr_val,
317 317
318 /* if transfer complete interrupt */ 318 /* if transfer complete interrupt */
319 if (reg_spsr_val & SPSR_FI_BIT) { 319 if (reg_spsr_val & SPSR_FI_BIT) {
320 if (tx_index < bpw_len) 320 if ((tx_index == bpw_len) && (rx_index == tx_index)) {
321 /* disable interrupts */
322 pch_spi_setclr_reg(data->master, PCH_SPCR, 0, PCH_ALL);
323
324 /* transfer is completed;
325 inform pch_spi_process_messages */
326 data->transfer_complete = true;
327 data->transfer_active = false;
328 wake_up(&data->wait);
329 } else {
321 dev_err(&data->master->dev, 330 dev_err(&data->master->dev,
322 "%s : Transfer is not completed", __func__); 331 "%s : Transfer is not completed", __func__);
323 /* disable interrupts */ 332 }
324 pch_spi_setclr_reg(data->master, PCH_SPCR, 0, PCH_ALL);
325
326 /* transfer is completed;inform pch_spi_process_messages */
327 data->transfer_complete = true;
328 data->transfer_active = false;
329 wake_up(&data->wait);
330 } 333 }
331} 334}
332 335