mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tomoya MORINAGA <tomoya.rohm@gmail.com>
To: Grant Likely <grant.likely@secretlab.ca>,
	spi-devel-general@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Cc: qi.wang@intel.com, yong.y.wang@intel.com, joel.clark@intel.com,
	kok.howg.ewe@intel.com, Wolfram Sang <w.sang@pengutronix.de>,
	Tomoya MORINAGA <tomoya.rohm@gmail.com>
Subject: [PATCH 4/4] spi-topcliff-pch: add recovery processing in case wait-event timeout
Date: Fri,  9 Dec 2011 13:13:29 +0900	[thread overview]
Message-ID: <1323404009-3476-3-git-send-email-tomoya.rohm@gmail.com> (raw)
In-Reply-To: <1323404009-3476-1-git-send-email-tomoya.rohm@gmail.com>

Currently, pch_spi_start_transfer failure is not anticipated.
This patch adds the processing.

Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
---
 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 1864555..10b684c 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -1262,8 +1262,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;
-- 
1.7.4.4


  parent reply	other threads:[~2011-12-09  4:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09  4:13 [PATCH 2/4] spi-topcliff-pch: Fix issue for transmitting over 4KByte Tomoya MORINAGA
2011-12-09  4:13 ` [PATCH 3/4][RESEND] spi-topcliff-pch: supports a spi mode setup and bit order setup by IO control Tomoya MORINAGA
2012-03-10  3:57   ` Grant Likely
2011-12-09  4:13 ` Tomoya MORINAGA [this message]
2012-03-10  3:58   ` [PATCH 4/4] spi-topcliff-pch: add recovery processing in case wait-event timeout Grant Likely
2012-03-10  3:56 ` [PATCH 2/4] spi-topcliff-pch: Fix issue for transmitting over 4KByte Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323404009-3476-3-git-send-email-tomoya.rohm@gmail.com \
    --to=tomoya.rohm@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=joel.clark@intel.com \
    --cc=kok.howg.ewe@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qi.wang@intel.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=w.sang@pengutronix.de \
    --cc=yong.y.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome