Re: [CFT 01/11] dmaengine: add OMAP DMA engine driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 07, 2012 at 12:06:32PM +0100, Russell King wrote:
> Tested-by: Tony Lindgren <tony@xxxxxxxxxxx>
> Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
> ---
>  drivers/dma/Kconfig      |    6 +
>  drivers/dma/Makefile     |    1 +
>  drivers/dma/omap-dma.c   |  522 ++++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/omap-dma.h |   24 ++
>  4 files changed, 553 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/dma/omap-dma.c
>  create mode 100644 include/linux/omap-dma.h

There is a bug in here which no one has spotted... I just noticed it.

diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 500bc71..02eb2fd 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -130,14 +130,13 @@ static void omap_dma_callback(int ch, u16 status, void *data)
 
 	spin_lock_irqsave(&c->vc.lock, flags);
 	d = c->desc;
-	if (!d)
-		return;
-
-	if (++c->sgidx < d->sglen) {
-		omap_dma_start_sg(c, d, c->sgidx);
-	} else {
-		omap_dma_start_desc(c);
-		vchan_cookie_complete(&d->vd);
+	if (d) {
+		if (++c->sgidx < d->sglen) {
+			omap_dma_start_sg(c, d, c->sgidx);
+		} else {
+			omap_dma_start_desc(c);
+			vchan_cookie_complete(&d->vd);
+		}
 	}
 	spin_unlock_irqrestore(&c->vc.lock, flags);
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux