linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/4] crypto/talitos: fix premature done handling
@ 2008-06-16 16:10 Kim Phillips
  0 siblings, 0 replies; only message in thread
From: Kim Phillips @ 2008-06-16 16:10 UTC (permalink / raw)
  To: linux-crypto; +Cc: linuxppc-dev, herbert

Since the h/w doesn't support out-of-order processing within a channel,
abort channel flush processing in the no-done-bits-and-no-error case
so as to not allow premature passthrough to the callback (and thus
dropped packets).

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
 drivers/crypto/talitos.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index ce4787e..64ddad2 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -307,8 +307,13 @@ static void flush_channel(struct device *dev, int ch, int error, int reset_ch)
 
 		/* descriptors with their done bits set don't get the error */
 		rmb();
-		status = ((request->desc->hdr & DESC_HDR_DONE)
-			  == DESC_HDR_DONE) ? 0 : error;
+		if ((request->desc->hdr & DESC_HDR_DONE) == DESC_HDR_DONE)
+			status = 0;
+		else
+			if (!error)
+				break;
+			else
+				status = error;
 
 		dma_unmap_single(dev, request->dma_desc,
 			sizeof(struct talitos_desc), DMA_BIDIRECTIONAL);
-- 
1.5.6.rc2.26.g8c37

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-16 16:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-16 16:10 [PATCH 3/4] crypto/talitos: fix premature done handling Kim Phillips

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).