Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomoya MORINAGA <tomoya.rohm@gmail.com>2011-12-09 13:13:29 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-21 10:46:24 -0700
commit6c9f63a43c30f496a37ade9fd4304c63df9b01bd (patch)
tree5b53ee7304ec626c4f47f89d3c9d6d53f4473104
parent06dd28fc316fa8a8627c0271d24e1d68b51ca6a3 (diff)
spi-topcliff-pch: add recovery processing in case wait-event timeout
commit 0f57e168aa109775430c76cc663fb64909813d84 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/spi/spi-topcliff-pch.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 9f1241dd569e..47815f7de631 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)
char *save_rx_buf = data->cur_trans->rx_buf;
for (i = 0; i < cnt; i ++) {
pch_spi_handle_dma(data, &bpw);
- if (!pch_spi_start_transfer(data))
+ if (!pch_spi_start_transfer(data)) {
+ data->transfer_complete = true;
+ data->current_msg->status = -EIO;
+ data->current_msg->complete
+ (data->current_msg->context);
+ data->bcurrent_msg_processing = false;
+ data->current_msg = NULL;
+ data->cur_trans = NULL;
goto out;
+ }
pch_spi_copy_rx_data_for_dma(data, bpw);
}
data->cur_trans->rx_buf = save_rx_buf;