Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hugues.fruchet@st.com (Hugues Fruchet)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] media: stm32-dcmi: do not fall into error on buffer starvation
Date: Mon, 11 Jun 2018 11:50:24 +0200	[thread overview]
Message-ID: <1528710627-8566-2-git-send-email-hugues.fruchet@st.com> (raw)
In-Reply-To: <1528710627-8566-1-git-send-email-hugues.fruchet@st.com>

Return silently instead of falling into error when running
out of available buffers when restarting capture.
Capture will be restarted when new buffers will be
provided by V4L2 client.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
---
 drivers/media/platform/stm32/stm32-dcmi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index b796334..a3fbfac 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -228,13 +228,10 @@ static int dcmi_restart_capture(struct stm32_dcmi *dcmi)
 
 	/* Restart a new DMA transfer with next buffer */
 	if (list_empty(&dcmi->buffers)) {
-		dev_err(dcmi->dev, "%s: No more buffer queued, cannot capture buffer\n",
-			__func__);
-		dcmi->errors_count++;
+		dev_dbg(dcmi->dev, "Capture restart is deferred to next buffer queueing\n");
 		dcmi->active = NULL;
-
 		spin_unlock_irq(&dcmi->irqlock);
-		return -EINVAL;
+		return 0;
 	}
 
 	dcmi->active = list_entry(dcmi->buffers.next,
-- 
1.9.1

  reply	other threads:[~2018-06-11  9:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11  9:50 [PATCH 0/4] Revisit and fix DCMI buffers handling Hugues Fruchet
2018-06-11  9:50 ` Hugues Fruchet [this message]
2018-06-11  9:50 ` [PATCH 2/4] media: stm32-dcmi: return buffer in error state on dma error Hugues Fruchet
2018-06-11  9:50 ` [PATCH 3/4] media: stm32-dcmi: clarify state logic on buffer starvation Hugues Fruchet
2018-06-11  9:50 ` [PATCH 4/4] media: stm32-dcmi: revisit buffer list management Hugues Fruchet

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=1528710627-8566-2-git-send-email-hugues.fruchet@st.com \
    --to=hugues.fruchet@st.com \
    --cc=linux-arm-kernel@lists.infradead.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