From: Dan Williams <dan.j.williams@intel.com>
To: "Steven J. Magnani" <steve@digidescorp.com>
Cc: Zhang Wei <zw@zh-kernel.org>,
"Ira W. Snyder" <iws@ovro.caltech.edu>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: Re: [async_tx-next PATCH v2 2/2] fsldma: Fix cookie issues
Date: Sun, 28 Feb 2010 22:14:27 -0700 [thread overview]
Message-ID: <e9c3a7c21002282114w3de2806eoe2ecc8e0f9207d00@mail.gmail.com> (raw)
In-Reply-To: <1267126777-21520-1-git-send-email-steve@digidescorp.com>
On Thu, Feb 25, 2010 at 12:39 PM, Steven J. Magnani
<steve@digidescorp.com> wrote:
> fsl_dma_update_completed_cookie() appears to calculate the last completed
> cookie incorrectly in the corner case where DMA on cookie 1 is in progres=
s
> just following a cookie wrap.
>
> Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
> ---
> diff -uprN a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
> --- a/drivers/dma/fsldma.c =A0 =A0 =A02010-02-22 11:16:36.000000000 -0600
> +++ b/drivers/dma/fsldma.c =A0 =A0 =A02010-02-22 11:08:41.000000000 -0600
> @@ -819,8 +819,11 @@ static void fsl_dma_update_completed_coo
> =A0 =A0 =A0 =A0desc =3D to_fsl_desc(chan->ld_running.prev);
> =A0 =A0 =A0 =A0if (dma_is_idle(chan))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cookie =3D desc->async_tx.cookie;
> - =A0 =A0 =A0 else
> + =A0 =A0 =A0 else {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cookie =3D desc->async_tx.cookie - 1;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (unlikely(cookie < DMA_MIN_COOKIE))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cookie =3D DMA_MAX_COOKIE;
> + =A0 =A0 =A0 }
>
> =A0 =A0 =A0 =A0chan->completed_cookie =3D cookie;
>
> diff -uprN a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> --- a/include/linux/dmaengine.h 2010-02-22 11:18:11.000000000 -0600
> +++ b/include/linux/dmaengine.h 2010-02-22 11:18:30.000000000 -0600
> @@ -31,6 +31,8 @@
> =A0* if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error co=
de
> =A0*/
> =A0typedef s32 dma_cookie_t;
> +#define DMA_MIN_COOKIE 1
> +#define DMA_MAX_COOKIE ((1 << 31) - 1)
>
This patch introduces a new warning::
drivers/dma/fsldma.c:825: warning: integer overflow in expression
I'll fix this up to use INT_MAX instead.
--
Dan
powerpc-linux-gnu-gcc --version
powerpc-linux-gnu-gcc (Sourcery G++ Lite 4.2-50) 4.2.1
prev parent reply other threads:[~2010-03-01 5:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-25 19:39 [async_tx-next PATCH v2 2/2] fsldma: Fix cookie issues Steven J. Magnani
2010-03-01 5:14 ` Dan Williams [this message]
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=e9c3a7c21002282114w3de2806eoe2ecc8e0f9207d00@mail.gmail.com \
--to=dan.j.williams@intel.com \
--cc=iws@ovro.caltech.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=steve@digidescorp.com \
--cc=zw@zh-kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).