<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>> On Mon, Dec 14, 2009 at 6:33 AM, Vishnu Suresh <Vishnu@freescale.com> wrote:<BR>> > The async_tx descriptors contains dangling pointers.<BR>> > Hence, re-initialize them to NULL before use.<BR>> ><BR>> > Signed-off-by: Vishnu Suresh <Vishnu@freescale.com><BR>> > ---<BR>> > o. Rebased to linux-next as of 20091214<BR>> ><BR>> > drivers/crypto/talitos.c | 3 +++<BR>> > 1 files changed, 3 insertions(+), 0 deletions(-)<BR>> ><BR>> > diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c<BR>> > index 87f06be..9e261c6 100644<BR>> > --- a/drivers/crypto/talitos.c<BR>> > +++ b/drivers/crypto/talitos.c<BR>> > @@ -952,6 +952,9 @@ static struct dma_async_tx_descriptor * talitos_prep_dma_xor(<BR>> > return NULL;<BR>> > }<BR>> > dma_async_tx_descriptor_init(&new->async_tx, &xor_chan->common);<BR>> > + new->async_tx.parent = NULL;<BR>> > + new->async_tx.next = NULL;<BR>> > +<BR>> ><BR>> > desc = &new->hwdesc;<BR>> > /* Set destination: Last pointer pair */<BR><BR>> These two values are owned by the async_tx api, drivers are not<BR>> supposed to touch them.</FONT></DIV>
<DIV dir=ltr><FONT size=2>I have sent this patch and the similar one for fsldma seperately, <BR>so that if the changes are needed and can be done in dma_async_tx_descriptor_init(), <BR>these patches can be ignored. </FONT></DIV>
<DIV dir=ltr><FONT size=2>> Both iop_adma and the new ppx4xx driver<BR>> (which use the async_tx channel switching capability) get away without<BR>> touching these fields which makes me suspect there is a<BR>> misunderstanding/bug somewhere else in the talitos implementation.</FONT></DIV></DIV>
<DIV>
<P><FONT size=2>This bug does not occur on all the platforms. The occurrance 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. <BR>In case of fsldma/talitosXOR, there are two 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>> > Also that dma_async_tx_descriptor_init() is unexpected in the hot<BR>> > path, it's only needed at initial descriptor allocation. End result I<BR>> > think this driver needs some more time to brew.</FONT></P>
<P><FONT size=2><BR><BR>> --<BR>> Dan<BR><BR></P></FONT></DIV></BODY></HTML>