<HTML dir=ltr><HEAD><TITLE>Re: [PATCH v0] Crypto: Talitos: re-initialize async_tx descriptors</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.3627" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText95776 dir=ltr>
<DIV dir=ltr><FONT size=2>&gt; On Mon, Dec 14, 2009 at 6:33 AM, Vishnu Suresh &lt;Vishnu@freescale.com&gt; wrote:<BR>&gt; &gt; The async_tx descriptors contains dangling pointers.<BR>&gt; &gt; Hence, re-initialize them to NULL before use.<BR>&gt; &gt;<BR>&gt; &gt; Signed-off-by: Vishnu Suresh &lt;Vishnu@freescale.com&gt;<BR>&gt; &gt; ---<BR>&gt; &gt; o. Rebased to linux-next as of 20091214<BR>&gt; &gt;<BR>&gt; &gt; &nbsp;drivers/crypto/talitos.c | &nbsp; &nbsp;3 +++<BR>&gt; &gt; &nbsp;1 files changed, 3 insertions(+), 0 deletions(-)<BR>&gt; &gt;<BR>&gt; &gt; diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c<BR>&gt; &gt; index 87f06be..9e261c6 100644<BR>&gt; &gt; --- a/drivers/crypto/talitos.c<BR>&gt; &gt; +++ b/drivers/crypto/talitos.c<BR>&gt; &gt; @@ -952,6 +952,9 @@ static struct dma_async_tx_descriptor * talitos_prep_dma_xor(<BR>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return NULL;<BR>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;dma_async_tx_descriptor_init(&amp;new-&gt;async_tx, &amp;xor_chan-&gt;common);<BR>&gt; &gt; + &nbsp; &nbsp; &nbsp; new-&gt;async_tx.parent = NULL;<BR>&gt; &gt; + &nbsp; &nbsp; &nbsp; new-&gt;async_tx.next = NULL;<BR>&gt; &gt; +<BR>&gt; &gt;<BR>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;desc = &amp;new-&gt;hwdesc;<BR>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;/* Set destination: Last pointer pair */<BR><BR>&gt; These two values are owned by the async_tx api, drivers are not<BR>&gt; supposed to touch them.</FONT></DIV>
<DIV dir=ltr><FONT size=2>I have sent this patch and the&nbsp;similar one for fsldma seperately, <BR>so that if the changes&nbsp;are needed and can be done in dma_async_tx_descriptor_init(), <BR>these patches can be ignored.&nbsp; </FONT></DIV>
<DIV dir=ltr><FONT size=2>&gt; Both iop_adma and the new ppx4xx driver<BR>&gt; (which use the async_tx channel switching capability) get away without<BR>&gt; touching these fields which makes me suspect there is a<BR>&gt; misunderstanding/bug somewhere else in the talitos implementation.</FONT></DIV></DIV>
<DIV>
<P><FONT size=2>This bug&nbsp;does&nbsp;not&nbsp;occur on all the platforms. The occurrance&nbsp;is random. <BR>This occurs when a channel switch between two different devices are present. <BR></FONT><FONT size=2>This same initialization is required in case of fsldma as well.&nbsp;<BR>In case of fsldma/talitosXOR, there are two&nbsp;DMA channels (on same device) and single XOR channel (on another device). </FONT></P>
<P><FONT size=2>When used without fsldma, this driver works fine.<BR>Does iop_adma and ppx4xx work in similar enviroment?</FONT></P>
<P><FONT size=2>&gt; &gt; Also that dma_async_tx_descriptor_init() is unexpected in the hot<BR>&gt; &gt; path, it's only needed at initial descriptor allocation.&nbsp; End result I<BR>&gt; &gt; think this driver needs some more time to brew.</FONT></P>
<P><FONT size=2><BR><BR>&gt; --<BR>&gt; Dan<BR><BR></P></FONT></DIV></BODY></HTML>