]> git.karo-electronics.de Git - karo-tx-linux.git/commit
crypto: talitos - fix locating offending descriptor in error path
authorHoria Geanta <horia.geanta@freescale.com>
Wed, 13 Nov 2013 10:20:37 +0000 (12:20 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 5 Dec 2013 13:28:41 +0000 (21:28 +0800)
commitb62ffd8c72c2f04ac737ef3ff0f7ba37d2013633
treec84520c93e902b7bc95617e42b79b320d01bde68
parentf13ab86a6123cc85c072253769fcaac72949ae93
crypto: talitos - fix locating offending descriptor in error path

Commit 3e721aeb3df3816e283ab18e327cd4652972e213
("crypto: talitos - handle descriptor not found in error path")
tried to address the fact that CDPR (Current Descriptor Pointer Register)
is unreliable.

As it turns out, there are still issues in the function detecting the
offending descriptor:
-only 32 bits of the descriptor address are read, however the address is
36-bit - since reset_channel() initializes channels with EAE (extended
address) bit set
-reading CDPR can return zero in cur_desc; when searching the channel
fifo for this address, cur_desc == dma_desc (= 0) case might happen,
leading to an oops when trying to return desc->hdr (desc is zero)
-read channel's .tail only once; the tail is a moving target; use a
local variable for the end of search condition

Signed-off-by: Lei Xu <Lei.Xu@freescale.com>
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Tested-by: Kalyani Chowdhury <Kalyani.Chowdhury@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/talitos.c