summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-17 17:18:16 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-17 17:18:15 -0800
commitcaa1907eb3f489ce584a917ba424cf19779035c2 (patch)
treea2bb3c7261999b7be584541f145280735ec73213
parent181f9f34cb6babfaf19014d5419fffa6f040d195 (diff)
parente189653cfc1814442c0348203759b24060c280c2 (diff)
Merge "msm: isp: Fix duplicate overflow requests"
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
index e238f54a9100..09de276e8418 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1794,6 +1794,7 @@ int msm_isp_process_overflow_irq(
{
uint32_t overflow_mask;
uint32_t bus_err = 0;
+ unsigned long flags;
/* if there are no active streams - do not start recovery */
if (!vfe_dev->axi_data.num_active_stream)
@@ -1825,23 +1826,33 @@ int msm_isp_process_overflow_irq(
int i;
struct msm_vfe_axi_shared_data *axi_data = &vfe_dev->axi_data;
+ spin_lock_irqsave(
+ &vfe_dev->common_data->common_dev_data_lock, flags);
+
if (atomic_cmpxchg(&vfe_dev->error_info.overflow_state,
- NO_OVERFLOW, OVERFLOW_DETECTED != NO_OVERFLOW))
+ NO_OVERFLOW, OVERFLOW_DETECTED)) {
+ spin_unlock_irqrestore(
+ &vfe_dev->common_data->common_dev_data_lock,
+ flags);
return 0;
+ }
if (vfe_dev->reset_pending == 1) {
- pr_err("%s:%d failed: overflow %x during reset\n",
+ pr_err_ratelimited("%s:%d overflow %x during reset\n",
__func__, __LINE__, overflow_mask);
/* Clear overflow bits since reset is pending */
*irq_status1 &= ~overflow_mask;
+ spin_unlock_irqrestore(
+ &vfe_dev->common_data->common_dev_data_lock,
+ flags);
return 0;
}
- pr_err("%s: vfe %d overflow mask %x, bus_error %x\n",
+ pr_err_ratelimited("%s: vfe %d overflowmask %x,bus_error %x\n",
__func__, vfe_dev->pdev->id, overflow_mask, bus_err);
for (i = 0; i < axi_data->hw_info->num_wm; i++) {
if (!axi_data->free_wm[i])
continue;
- pr_err("%s: wm %d assigned to stream handle %x\n",
+ ISP_DBG("%s:wm %d assigned to stream handle %x\n",
__func__, i, axi_data->free_wm[i]);
}
vfe_dev->recovery_irq0_mask = vfe_dev->irq0_mask;
@@ -1880,6 +1891,9 @@ int msm_isp_process_overflow_irq(
msm_isp_send_event(vfe_dev,
ISP_EVENT_ERROR, &error_event);
}
+ spin_unlock_irqrestore(
+ &vfe_dev->common_data->common_dev_data_lock,
+ flags);
return 1;
}
return 0;