From b9a96eb2e5208651ddb94c457dcdb64b7e2d02f0 Mon Sep 17 00:00:00 2001 From: Shubhraprakash Das Date: Fri, 2 Dec 2016 17:53:31 -0800 Subject: [PATCH] msm: camera: isp: Ignore bus error from RDI write master Bus error can be generated on RDI write master even if there is no data sent on it. This is not actually an error hence ignore it. CRs-Fixed: 1098568 Change-Id: I8dc24f3c4926f008d114778c890ad2c2902f84b9 Signed-off-by: Shubhraprakash Das --- .../platform/msm/camera_v2/isp/msm_isp.h | 6 ++++++ .../platform/msm/camera_v2/isp/msm_isp32.c | 2 ++ .../platform/msm/camera_v2/isp/msm_isp40.c | 2 ++ .../platform/msm/camera_v2/isp/msm_isp44.c | 2 ++ .../platform/msm/camera_v2/isp/msm_isp46.c | 2 ++ .../platform/msm/camera_v2/isp/msm_isp47.c | 2 ++ .../platform/msm/camera_v2/isp/msm_isp48.c | 21 +++++++++++++++++++ .../msm/camera_v2/isp/msm_isp_axi_util.c | 14 +++++++++++++ .../platform/msm/camera_v2/isp/msm_isp_util.c | 14 +++++++------ 9 files changed, 59 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp.h b/drivers/media/platform/msm/camera_v2/isp/msm_isp.h index 1f860f2c5b12..9c7eba21fde1 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp.h +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp.h @@ -243,6 +243,10 @@ struct msm_vfe_core_ops { int (*start_fetch_eng_multi_pass)(struct vfe_device *vfe_dev, void *arg); void (*set_halt_restart_mask)(struct vfe_device *vfe_dev); + void (*set_bus_err_ign_mask)(struct vfe_device *vfe_dev, + int wm, int enable); + void (*get_bus_err_mask)(struct vfe_device *vfe_dev, + uint32_t *bus_err, uint32_t *irq_status1); }; struct msm_vfe_stats_ops { @@ -786,6 +790,8 @@ struct vfe_device { /* irq info */ uint32_t irq0_mask; uint32_t irq1_mask; + + uint32_t bus_err_ign_mask; }; struct vfe_parent_device { diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp32.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp32.c index 8275f8cedf2e..43f562b18209 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp32.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp32.c @@ -1474,6 +1474,8 @@ struct msm_vfe_hardware_info vfe32_hw_info = { .is_module_cfg_lock_needed = msm_vfe32_is_module_cfg_lock_needed, .ahb_clk_cfg = NULL, + .set_bus_err_ign_mask = NULL, + .get_bus_err_mask = NULL, }, .stats_ops = { .get_stats_idx = msm_vfe32_get_stats_idx, diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c index 2d937fc3ed05..a1fb307b09c1 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c @@ -2263,6 +2263,8 @@ struct msm_vfe_hardware_info vfe40_hw_info = { msm_vfe40_start_fetch_engine_multi_pass, .set_halt_restart_mask = msm_vfe40_set_halt_restart_mask, + .set_bus_err_ign_mask = NULL, + .get_bus_err_mask = NULL, }, .stats_ops = { .get_stats_idx = msm_vfe40_get_stats_idx, diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp44.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp44.c index 15820b5f398b..0a72a041de28 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp44.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp44.c @@ -1869,6 +1869,8 @@ struct msm_vfe_hardware_info vfe44_hw_info = { .ahb_clk_cfg = NULL, .set_halt_restart_mask = msm_vfe44_set_halt_restart_mask, + .set_bus_err_ign_mask = NULL, + .get_bus_err_mask = NULL, }, .stats_ops = { .get_stats_idx = msm_vfe44_get_stats_idx, diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp46.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp46.c index 23fbc4f5e33a..f2d53c956fdc 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp46.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp46.c @@ -1945,6 +1945,8 @@ struct msm_vfe_hardware_info vfe46_hw_info = { .ahb_clk_cfg = NULL, .set_halt_restart_mask = msm_vfe46_set_halt_restart_mask, + .set_bus_err_ign_mask = NULL, + .get_bus_err_mask = NULL, }, .stats_ops = { .get_stats_idx = msm_vfe46_get_stats_idx, diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c index 56056849e140..efea930a36a7 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c @@ -2858,6 +2858,8 @@ struct msm_vfe_hardware_info vfe47_hw_info = { msm_vfe47_start_fetch_engine_multi_pass, .set_halt_restart_mask = msm_vfe47_set_halt_restart_mask, + .set_bus_err_ign_mask = NULL, + .get_bus_err_mask = NULL, }, .stats_ops = { .get_stats_idx = msm_vfe47_get_stats_idx, diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp48.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp48.c index c533f23c1163..f346ceb6c9e5 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp48.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp48.c @@ -241,6 +241,25 @@ static void msm_vfe48_put_regulators(struct vfe_device *vfe_dev) vfe_dev->vfe_num_regulators = 0; } +static void msm_vfe48_get_bus_err_mask(struct vfe_device *vfe_dev, + uint32_t *bus_err, uint32_t *irq_status1) +{ + *bus_err = msm_camera_io_r(vfe_dev->vfe_base + 0xC94); + + *bus_err &= ~vfe_dev->bus_err_ign_mask; + if (*bus_err == 0) + *irq_status1 &= ~(1 << 4); +} + +static void msm_vfe48_set_bus_err_ign_mask(struct vfe_device *vfe_dev, + int wm, int enable) +{ + if (enable) + vfe_dev->bus_err_ign_mask |= (1 << wm); + else + vfe_dev->bus_err_ign_mask &= ~(1 << wm); +} + struct msm_vfe_hardware_info vfe48_hw_info = { .num_iommu_ctx = 1, .num_iommu_secure_ctx = 0, @@ -315,6 +334,8 @@ struct msm_vfe_hardware_info vfe48_hw_info = { msm_vfe47_start_fetch_engine_multi_pass, .set_halt_restart_mask = msm_vfe47_set_halt_restart_mask, + .set_bus_err_ign_mask = msm_vfe48_set_bus_err_ign_mask, + .get_bus_err_mask = msm_vfe48_get_bus_err_mask, }, .stats_ops = { .get_stats_idx = msm_vfe47_get_stats_idx, diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c index ae032c588888..f6e0d9083b22 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c @@ -430,6 +430,13 @@ static void msm_isp_axi_reserve_wm(struct vfe_device *vfe_dev, vfe_dev->pdev->id, stream_info->stream_handle[vfe_idx], j); stream_info->wm[vfe_idx][i] = j; + /* setup var to ignore bus error from RDI wm */ + if (stream_info->stream_src >= RDI_INTF_0) { + if (vfe_dev->hw_info->vfe_ops.core_ops. + set_bus_err_ign_mask) + vfe_dev->hw_info->vfe_ops.core_ops. + set_bus_err_ign_mask(vfe_dev, j, 1); + } } } @@ -443,6 +450,13 @@ void msm_isp_axi_free_wm(struct vfe_device *vfe_dev, for (i = 0; i < stream_info->num_planes; i++) { axi_data->free_wm[stream_info->wm[vfe_idx][i]] = 0; axi_data->num_used_wm--; + if (stream_info->stream_src >= RDI_INTF_0) { + if (vfe_dev->hw_info->vfe_ops.core_ops. + set_bus_err_ign_mask) + vfe_dev->hw_info->vfe_ops.core_ops. + set_bus_err_ign_mask(vfe_dev, + stream_info->wm[vfe_idx][i], 0); + } } if (stream_info->stream_src <= IDEAL_RAW) axi_data->num_pix_stream++; 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 1baba9658523..a8825dacd8ab 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 @@ -1791,12 +1791,17 @@ static int msm_isp_process_overflow_irq( uint32_t *irq_status0, uint32_t *irq_status1) { uint32_t overflow_mask; + uint32_t bus_err = 0; /* if there are no active streams - do not start recovery */ if (!vfe_dev->axi_data.num_active_stream) return 0; - /*Mask out all other irqs if recovery is started*/ + if (vfe_dev->hw_info->vfe_ops.core_ops. + get_bus_err_mask) + vfe_dev->hw_info->vfe_ops.core_ops.get_bus_err_mask( + vfe_dev, &bus_err, irq_status1); + /* Mask out all other irqs if recovery is started */ if (atomic_read(&vfe_dev->error_info.overflow_state) != NO_OVERFLOW) { uint32_t halt_restart_mask0, halt_restart_mask1; vfe_dev->hw_info->vfe_ops.core_ops. @@ -1808,14 +1813,13 @@ static int msm_isp_process_overflow_irq( return 0; } - /*Check if any overflow bit is set*/ + /* Check if any overflow bit is set */ vfe_dev->hw_info->vfe_ops.core_ops. get_overflow_mask(&overflow_mask); overflow_mask &= *irq_status1; if (overflow_mask) { struct msm_isp_event_data error_event; - uint32_t val = 0; int i; struct msm_vfe_axi_shared_data *axi_data = &vfe_dev->axi_data; @@ -1830,10 +1834,8 @@ static int msm_isp_process_overflow_irq( *irq_status1 &= ~overflow_mask; return 0; } - if (msm_vfe_is_vfe48(vfe_dev)) - val = msm_camera_io_r(vfe_dev->vfe_base + 0xC94); pr_err("%s: vfe %d overflow mask %x, bus_error %x\n", - __func__, vfe_dev->pdev->id, overflow_mask, val); + __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;