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 8793745aac71..13c6e000fefc 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c @@ -2860,6 +2860,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 ce641ae82147..4abb6d1d91a8 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 @@ -1789,12 +1789,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. @@ -1806,14 +1811,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; @@ -1828,10 +1832,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;