All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hugues Fruchet <hugues.fruchet@st.com>
To: Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	"Hans Verkuil" <hverkuil@xs4all.nl>
Cc: <linux-media@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	Yannick Fertre <yannick.fertre@st.com>,
	Hugues Fruchet <hugues.fruchet@st.com>
Subject: [PATCH 2/4] media: stm32-dcmi: return buffer in error state on dma error
Date: Mon, 11 Jun 2018 11:50:25 +0200	[thread overview]
Message-ID: <1528710627-8566-3-git-send-email-hugues.fruchet@st.com> (raw)
In-Reply-To: <1528710627-8566-1-git-send-email-hugues.fruchet@st.com>

Return buffer to V4L2 in error state if DMA error occurs.

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

diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index a3fbfac..6ccf195 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -262,6 +262,9 @@ static void dcmi_dma_callback(void *param)
 		break;
 	case DMA_ERROR:
 		dev_err(dcmi->dev, "%s: Received DMA_ERROR\n", __func__);
+
+		/* Return buffer to V4L2 in error state */
+		dcmi_buffer_done(dcmi, buf, 0, -EIO);
 		break;
 	case DMA_COMPLETE:
 		dev_dbg(dcmi->dev, "%s: Received DMA_COMPLETE\n", __func__);
-- 
1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: hugues.fruchet@st.com (Hugues Fruchet)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] media: stm32-dcmi: return buffer in error state on dma error
Date: Mon, 11 Jun 2018 11:50:25 +0200	[thread overview]
Message-ID: <1528710627-8566-3-git-send-email-hugues.fruchet@st.com> (raw)
In-Reply-To: <1528710627-8566-1-git-send-email-hugues.fruchet@st.com>

Return buffer to V4L2 in error state if DMA error occurs.

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

diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index a3fbfac..6ccf195 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -262,6 +262,9 @@ static void dcmi_dma_callback(void *param)
 		break;
 	case DMA_ERROR:
 		dev_err(dcmi->dev, "%s: Received DMA_ERROR\n", __func__);
+
+		/* Return buffer to V4L2 in error state */
+		dcmi_buffer_done(dcmi, buf, 0, -EIO);
 		break;
 	case DMA_COMPLETE:
 		dev_dbg(dcmi->dev, "%s: Received DMA_COMPLETE\n", __func__);
-- 
1.9.1

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

Thread overview: 10+ 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
2018-06-11  9:50 ` [PATCH 1/4] media: stm32-dcmi: do not fall into error on buffer starvation Hugues Fruchet
2018-06-11  9:50   ` 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   ` Hugues Fruchet
2018-06-11  9:50 ` [PATCH 4/4] media: stm32-dcmi: revisit buffer list management Hugues Fruchet
2018-06-11  9:50   ` 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-3-git-send-email-hugues.fruchet@st.com \
    --to=hugues.fruchet@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=yannick.fertre@st.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.