Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753891AbbH3Tj0 (ORCPT ); Sun, 30 Aug 2015 15:39:26 -0400 Received: from smtp08.smtpout.orange.fr ([80.12.242.130]:47423 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753735AbbH3TjY (ORCPT ); Sun, 30 Aug 2015 15:39:24 -0400 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Sun, 30 Aug 2015 21:39:23 +0200 X-ME-IP: 109.222.68.49 From: Robert Jarzmik To: Guennadi Liakhovetski Cc: Mauro Carvalho Chehab , Jiri Kosina , Linux Media Mailing List , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/4] media: pxa_camera: conversion to dmaengine References: <1438198744-6150-1-git-send-email-robert.jarzmik@free.fr> <1438198744-6150-5-git-send-email-robert.jarzmik@free.fr> X-URL: http://belgarath.falguerolles.org/ Date: Sun, 30 Aug 2015 21:34:54 +0200 In-Reply-To: (Guennadi Liakhovetski's message of "Sun, 30 Aug 2015 14:55:04 +0200 (CEST)") Message-ID: <87613w1sf5.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1318 Lines: 37 Guennadi Liakhovetski writes: >> + last_buf = list_entry(pcdev->capture.prev, >> + struct pxa_buffer, vb.queue); > > You can use list_last_entry() Ok. >> + last_status = dma_async_is_tx_complete(pcdev->dma_chans[chan], >> + last_buf->cookie[chan], >> + NULL, &last_issued); >> + if (camera_status & overrun && >> + last_status != DMA_COMPLETE) { >> + dev_dbg(dev, "FIFO overrun! CISR: %x\n", >> + camera_status); >> + pxa_camera_stop_capture(pcdev); >> + list_for_each_entry(buf, &pcdev->capture, vb.queue) >> + pxa_dma_add_tail_buf(pcdev, buf); > > Why have you added this loop? Is it a bug in the current implementation or > is it only needed with the switch to dmaengine? It's a consequence of the switch. With dmaengine, a dmaengine_terminate_all() removes all queued txs. It is therefore necessary to requeue them. In the previous implementation, the chaining was still good, and it was "enough" to just queue the first videobuffer : the other buffers would follow by chaining. Cheers. -- Robert -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/