From fe24fd782ecfb5f542d0e299b949d7a736a9f35d Mon Sep 17 00:00:00 2001 From: Karthik Anantha Ram Date: Fri, 22 Oct 2021 12:58:33 -0700 Subject: [PATCH] msm: camera: isp: Handle error event notification to HW manager In certain files error type is not propagated correctly, change updates error type when notifying error to IFE hw mgr. CRs-Fixed: 3045706 Change-Id: Id0dd2f43335bad0c237982b810c9e37bb8d0c8af Signed-off-by: Karthik Anantha Ram --- .../isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver2.c | 4 ++++ .../isp_hw/vfe_hw/vfe_top/cam_vfe_camif_lite_ver2.c | 3 +++ .../isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_ver2.c | 5 +++++ .../isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c | 3 +++ 4 files changed, 15 insertions(+) diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver2.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver2.c index 4c3011aab8..10cf4570d5 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver2.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver2.c @@ -1447,6 +1447,7 @@ static int cam_vfe_bus_err_bottom_half(void *handler_priv, struct cam_vfe_bus_ver2_priv *bus_priv = handler_priv; struct cam_vfe_bus_ver2_common_data *common_data; struct cam_isp_hw_event_info evt_info; + struct cam_isp_hw_error_event_info err_evt_info; uint32_t val = 0; if (!handler_priv || !evt_payload_priv) @@ -1537,6 +1538,9 @@ static int cam_vfe_bus_err_bottom_half(void *handler_priv, evt_info.res_type = CAM_ISP_RESOURCE_VFE_OUT; evt_info.res_id = CAM_VFE_BUS_VER2_VFE_OUT_MAX; + err_evt_info.err_type = CAM_VFE_IRQ_STATUS_VIOLATION; + evt_info.event_data = (void *)&err_evt_info; + if (common_data->event_cb) common_data->event_cb(NULL, CAM_ISP_HW_EVENT_ERROR, (void *)&evt_info); diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_lite_ver2.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_lite_ver2.c index 0761d0a4da..b6585a72fe 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_lite_ver2.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_lite_ver2.c @@ -496,6 +496,7 @@ static int cam_vfe_camif_lite_handle_irq_bottom_half( uint32_t irq_status1; struct cam_hw_soc_info *soc_info = NULL; struct cam_vfe_soc_private *soc_private = NULL; + struct cam_isp_hw_error_event_info err_evt_info; struct timespec64 ts; if (!handler_priv || !evt_payload_priv) { @@ -549,6 +550,8 @@ static int cam_vfe_camif_lite_handle_irq_bottom_half( CAM_DBG(CAM_ISP, "VFE:%d CAMIF LITE Received ERROR", evt_info.hw_idx); + err_evt_info.err_type = CAM_VFE_IRQ_STATUS_OVERFLOW; + evt_info.event_data = (void *)&err_evt_info; cam_vfe_camif_lite_cpas_fifo_levels_reg_dump(camif_lite_priv); ktime_get_boottime_ts64(&ts); diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_ver2.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_ver2.c index 0248f4e8cf..0aec3cce48 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_ver2.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_ver2.c @@ -790,6 +790,7 @@ static int cam_vfe_camif_handle_irq_bottom_half(void *handler_priv, uint32_t irq_status0; uint32_t irq_status1; uint32_t val; + struct cam_isp_hw_error_event_info err_evt_info; struct timespec64 ts; if (!handler_priv || !evt_payload_priv) { @@ -883,6 +884,8 @@ static int cam_vfe_camif_handle_irq_bottom_half(void *handler_priv, if (irq_status0 & camif_priv->reg_data->error_irq_mask0) { CAM_DBG(CAM_ISP, "Received ERROR"); + err_evt_info.err_type = CAM_VFE_IRQ_STATUS_OVERFLOW; + evt_info.event_data = (void *)&err_evt_info; ktime_get_boottime_ts64(&ts); CAM_INFO(CAM_ISP, "current monotonic time stamp seconds %lld:%lld", @@ -909,6 +912,8 @@ static int cam_vfe_camif_handle_irq_bottom_half(void *handler_priv, if (irq_status1 & camif_priv->reg_data->error_irq_mask1) { CAM_DBG(CAM_ISP, "Received ERROR"); + err_evt_info.err_type = CAM_VFE_IRQ_STATUS_OVERFLOW; + evt_info.event_data = (void *)&err_evt_info; ktime_get_boottime_ts64(&ts); CAM_INFO(CAM_ISP, "current monotonic time stamp seconds %lld:%lld", diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c index a3e2c0ec45..1f936cd967 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c @@ -1009,6 +1009,7 @@ static int cam_vfe_handle_irq_bottom_half(void *handler_priv, struct cam_vfe_mux_ver4_data *vfe_priv; struct cam_vfe_top_irq_evt_payload *payload; struct cam_isp_hw_event_info evt_info; + struct cam_isp_hw_error_event_info err_evt_info; uint32_t irq_status[CAM_IFE_IRQ_REGISTERS_MAX] = {0}; struct timespec64 ts; int i = 0; @@ -1112,6 +1113,8 @@ static int cam_vfe_handle_irq_bottom_half(void *handler_priv, & vfe_priv->reg_data->error_irq_mask) { CAM_ERR(CAM_ISP, "VFE:%d Error", evt_info.hw_idx); + err_evt_info.err_type = CAM_VFE_IRQ_STATUS_VIOLATION; + evt_info.event_data = (void *)&err_evt_info; ktime_get_boottime_ts64(&ts); CAM_INFO(CAM_ISP, "current monotonic time stamp seconds %lld:%lld",