diff options
author | Hugues Fruchet <hugues.fruchet@st.com> | 2019-04-01 04:55:00 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-04-22 11:07:33 -0400 |
commit | 1be0a2b702308f16fc1c1a58ada5aba13afc123e (patch) | |
tree | 0fc5ac4f7ee2613d6e6a9801fb2d9ac471ca494d /drivers/media/platform/stm32/stm32-dcmi.c | |
parent | d8986600dcb6c55027f171334e4705233cdb8919 (diff) |
media: stm32-dcmi: do not emit error trace in case of few overrun
Report overrun error only when it exceeds a given threshold.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/stm32/stm32-dcmi.c')
-rw-r--r-- | drivers/media/platform/stm32/stm32-dcmi.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index 693415cf8518..b63d57cd89e5 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c | |||
@@ -97,6 +97,8 @@ enum state { | |||
97 | 97 | ||
98 | #define TIMEOUT_MS 1000 | 98 | #define TIMEOUT_MS 1000 |
99 | 99 | ||
100 | #define OVERRUN_ERROR_THRESHOLD 3 | ||
101 | |||
100 | struct dcmi_graph_entity { | 102 | struct dcmi_graph_entity { |
101 | struct device_node *node; | 103 | struct device_node *node; |
102 | 104 | ||
@@ -446,11 +448,13 @@ static irqreturn_t dcmi_irq_thread(int irq, void *arg) | |||
446 | 448 | ||
447 | spin_lock_irq(&dcmi->irqlock); | 449 | spin_lock_irq(&dcmi->irqlock); |
448 | 450 | ||
449 | if ((dcmi->misr & IT_OVR) || (dcmi->misr & IT_ERR)) { | 451 | if (dcmi->misr & IT_OVR) { |
450 | dcmi->errors_count++; | 452 | dcmi->overrun_count++; |
451 | if (dcmi->misr & IT_OVR) | 453 | if (dcmi->overrun_count > OVERRUN_ERROR_THRESHOLD) |
452 | dcmi->overrun_count++; | 454 | dcmi->errors_count++; |
453 | } | 455 | } |
456 | if (dcmi->misr & IT_ERR) | ||
457 | dcmi->errors_count++; | ||
454 | 458 | ||
455 | if (dcmi->sd_format->fourcc == V4L2_PIX_FMT_JPEG && | 459 | if (dcmi->sd_format->fourcc == V4L2_PIX_FMT_JPEG && |
456 | dcmi->misr & IT_FRAME) { | 460 | dcmi->misr & IT_FRAME) { |