diff options
author | Tomoya MORINAGA <tomoya.rohm@gmail.com> | 2011-12-08 23:13:29 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-03-09 22:58:36 -0500 |
commit | 0f57e168aa109775430c76cc663fb64909813d84 (patch) | |
tree | beeb8ae94e79bce0fba840bcb1216c9d642c2376 /drivers/spi/spi-topcliff-pch.c | |
parent | f258b44e22e07f5e98ac2260c70acff5784791b6 (diff) |
spi-topcliff-pch: add recovery processing in case wait-event timeout
Currently, pch_spi_start_transfer failure is not anticipated.
This patch adds the processing.
Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi/spi-topcliff-pch.c')
-rw-r--r-- | drivers/spi/spi-topcliff-pch.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index 5a477e91426f..c9e1fcc923bc 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c | |||
@@ -1266,8 +1266,16 @@ static void pch_spi_process_messages(struct work_struct *pwork) | |||
1266 | char *save_rx_buf = data->cur_trans->rx_buf; | 1266 | char *save_rx_buf = data->cur_trans->rx_buf; |
1267 | for (i = 0; i < cnt; i ++) { | 1267 | for (i = 0; i < cnt; i ++) { |
1268 | pch_spi_handle_dma(data, &bpw); | 1268 | pch_spi_handle_dma(data, &bpw); |
1269 | if (!pch_spi_start_transfer(data)) | 1269 | if (!pch_spi_start_transfer(data)) { |
1270 | data->transfer_complete = true; | ||
1271 | data->current_msg->status = -EIO; | ||
1272 | data->current_msg->complete | ||
1273 | (data->current_msg->context); | ||
1274 | data->bcurrent_msg_processing = false; | ||
1275 | data->current_msg = NULL; | ||
1276 | data->cur_trans = NULL; | ||
1270 | goto out; | 1277 | goto out; |
1278 | } | ||
1271 | pch_spi_copy_rx_data_for_dma(data, bpw); | 1279 | pch_spi_copy_rx_data_for_dma(data, bpw); |
1272 | } | 1280 | } |
1273 | data->cur_trans->rx_buf = save_rx_buf; | 1281 | data->cur_trans->rx_buf = save_rx_buf; |