Loading drivers/cam_ope/ope_hw_mgr/cam_ope_hw_mgr.c +16 −1 Original line number Original line Diff line number Diff line Loading @@ -239,6 +239,8 @@ static int32_t cam_ope_process_request_timer(void *priv, void *data) int i = 0; int i = 0; int device_share_ratio = 1; int device_share_ratio = 1; int path_index; int path_index; struct timespec64 ts; uint64_t ts_ns; if (!ctx_data) { if (!ctx_data) { CAM_ERR(CAM_OPE, "ctx_data is NULL, failed to update clk"); CAM_ERR(CAM_OPE, "ctx_data is NULL, failed to update clk"); Loading @@ -254,6 +256,15 @@ static int32_t cam_ope_process_request_timer(void *priv, void *data) return 0; return 0; } } get_monotonic_boottime64(&ts); ts_ns = (uint64_t)((ts.tv_sec * 1000000000) + ts.tv_nsec); if (ts_ns - ctx_data->last_req_time < OPE_REQUEST_TIMEOUT * 1000000) { mutex_unlock(&ctx_data->ctx_mutex); return 0; } if (cam_ope_is_pending_request(ctx_data)) { if (cam_ope_is_pending_request(ctx_data)) { CAM_DBG(CAM_OPE, "pending requests means, issue is with HW"); CAM_DBG(CAM_OPE, "pending requests means, issue is with HW"); cam_cdm_handle_error(ctx_data->ope_cdm.cdm_handle); cam_cdm_handle_error(ctx_data->ope_cdm.cdm_handle); Loading Loading @@ -386,7 +397,7 @@ static int cam_ope_start_req_timer(struct cam_ope_ctx *ctx_data) int rc = 0; int rc = 0; rc = crm_timer_init(&ctx_data->req_watch_dog, rc = crm_timer_init(&ctx_data->req_watch_dog, 200, ctx_data, &cam_ope_req_timer_cb); OPE_REQUEST_TIMEOUT, ctx_data, &cam_ope_req_timer_cb); if (rc) if (rc) CAM_ERR(CAM_OPE, "Failed to start timer"); CAM_ERR(CAM_OPE, "Failed to start timer"); Loading Loading @@ -2617,6 +2628,7 @@ static int cam_ope_mgr_prepare_hw_update(void *hw_priv, uintptr_t ope_cmd_buf_addr; uintptr_t ope_cmd_buf_addr; uint32_t request_idx = 0; uint32_t request_idx = 0; struct cam_ope_request *ope_req; struct cam_ope_request *ope_req; struct timespec64 ts; if ((!prepare_args) || (!hw_mgr) || (!prepare_args->packet)) { if ((!prepare_args) || (!hw_mgr) || (!prepare_args->packet)) { CAM_ERR(CAM_OPE, "Invalid args: %x %x", CAM_ERR(CAM_OPE, "Invalid args: %x %x", Loading Loading @@ -2667,6 +2679,9 @@ static int cam_ope_mgr_prepare_hw_update(void *hw_priv, CAM_ERR(CAM_OPE, "Invalid ctx req slot = %d", request_idx); CAM_ERR(CAM_OPE, "Invalid ctx req slot = %d", request_idx); return -EINVAL; return -EINVAL; } } get_monotonic_boottime64(&ts); ctx_data->last_req_time = (uint64_t)((ts.tv_sec * 1000000000) + ts.tv_nsec); cam_ope_req_timer_reset(ctx_data); cam_ope_req_timer_reset(ctx_data); set_bit(request_idx, ctx_data->bitmap); set_bit(request_idx, ctx_data->bitmap); ctx_data->req_list[request_idx] = ctx_data->req_list[request_idx] = Loading drivers/cam_ope/ope_hw_mgr/cam_ope_hw_mgr.h +5 −1 Original line number Original line Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */ /* /* * Copyright (c) 2019, The Linux Foundation. All rights reserved. * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. */ */ #ifndef CAM_OPE_HW_MGR_H #ifndef CAM_OPE_HW_MGR_H Loading Loading @@ -60,6 +60,8 @@ #define CLK_HW_MAX 0x1 #define CLK_HW_MAX 0x1 #define OPE_DEVICE_IDLE_TIMEOUT 400 #define OPE_DEVICE_IDLE_TIMEOUT 400 #define OPE_REQUEST_TIMEOUT 200 /** /** Loading Loading @@ -431,6 +433,7 @@ struct cam_ope_cdm { * @ctxt_event_cb: Callback of a context * @ctxt_event_cb: Callback of a context * @req_list: Request List * @req_list: Request List * @ope_cdm: OPE CDM info * @ope_cdm: OPE CDM info * @last_req_time: Timestamp of last request * @req_watch_dog: Watchdog for requests * @req_watch_dog: Watchdog for requests * @req_watch_dog_reset_counter: Request reset counter * @req_watch_dog_reset_counter: Request reset counter * @clk_info: OPE Ctx clock info * @clk_info: OPE Ctx clock info Loading @@ -451,6 +454,7 @@ struct cam_ope_ctx { cam_hw_event_cb_func ctxt_event_cb; cam_hw_event_cb_func ctxt_event_cb; struct cam_ope_request *req_list[CAM_CTX_REQ_MAX]; struct cam_ope_request *req_list[CAM_CTX_REQ_MAX]; struct cam_ope_cdm ope_cdm; struct cam_ope_cdm ope_cdm; uint64_t last_req_time; struct cam_req_mgr_timer *req_watch_dog; struct cam_req_mgr_timer *req_watch_dog; uint32_t req_watch_dog_reset_counter; uint32_t req_watch_dog_reset_counter; struct cam_ctx_clk_info clk_info; struct cam_ctx_clk_info clk_info; Loading Loading
drivers/cam_ope/ope_hw_mgr/cam_ope_hw_mgr.c +16 −1 Original line number Original line Diff line number Diff line Loading @@ -239,6 +239,8 @@ static int32_t cam_ope_process_request_timer(void *priv, void *data) int i = 0; int i = 0; int device_share_ratio = 1; int device_share_ratio = 1; int path_index; int path_index; struct timespec64 ts; uint64_t ts_ns; if (!ctx_data) { if (!ctx_data) { CAM_ERR(CAM_OPE, "ctx_data is NULL, failed to update clk"); CAM_ERR(CAM_OPE, "ctx_data is NULL, failed to update clk"); Loading @@ -254,6 +256,15 @@ static int32_t cam_ope_process_request_timer(void *priv, void *data) return 0; return 0; } } get_monotonic_boottime64(&ts); ts_ns = (uint64_t)((ts.tv_sec * 1000000000) + ts.tv_nsec); if (ts_ns - ctx_data->last_req_time < OPE_REQUEST_TIMEOUT * 1000000) { mutex_unlock(&ctx_data->ctx_mutex); return 0; } if (cam_ope_is_pending_request(ctx_data)) { if (cam_ope_is_pending_request(ctx_data)) { CAM_DBG(CAM_OPE, "pending requests means, issue is with HW"); CAM_DBG(CAM_OPE, "pending requests means, issue is with HW"); cam_cdm_handle_error(ctx_data->ope_cdm.cdm_handle); cam_cdm_handle_error(ctx_data->ope_cdm.cdm_handle); Loading Loading @@ -386,7 +397,7 @@ static int cam_ope_start_req_timer(struct cam_ope_ctx *ctx_data) int rc = 0; int rc = 0; rc = crm_timer_init(&ctx_data->req_watch_dog, rc = crm_timer_init(&ctx_data->req_watch_dog, 200, ctx_data, &cam_ope_req_timer_cb); OPE_REQUEST_TIMEOUT, ctx_data, &cam_ope_req_timer_cb); if (rc) if (rc) CAM_ERR(CAM_OPE, "Failed to start timer"); CAM_ERR(CAM_OPE, "Failed to start timer"); Loading Loading @@ -2617,6 +2628,7 @@ static int cam_ope_mgr_prepare_hw_update(void *hw_priv, uintptr_t ope_cmd_buf_addr; uintptr_t ope_cmd_buf_addr; uint32_t request_idx = 0; uint32_t request_idx = 0; struct cam_ope_request *ope_req; struct cam_ope_request *ope_req; struct timespec64 ts; if ((!prepare_args) || (!hw_mgr) || (!prepare_args->packet)) { if ((!prepare_args) || (!hw_mgr) || (!prepare_args->packet)) { CAM_ERR(CAM_OPE, "Invalid args: %x %x", CAM_ERR(CAM_OPE, "Invalid args: %x %x", Loading Loading @@ -2667,6 +2679,9 @@ static int cam_ope_mgr_prepare_hw_update(void *hw_priv, CAM_ERR(CAM_OPE, "Invalid ctx req slot = %d", request_idx); CAM_ERR(CAM_OPE, "Invalid ctx req slot = %d", request_idx); return -EINVAL; return -EINVAL; } } get_monotonic_boottime64(&ts); ctx_data->last_req_time = (uint64_t)((ts.tv_sec * 1000000000) + ts.tv_nsec); cam_ope_req_timer_reset(ctx_data); cam_ope_req_timer_reset(ctx_data); set_bit(request_idx, ctx_data->bitmap); set_bit(request_idx, ctx_data->bitmap); ctx_data->req_list[request_idx] = ctx_data->req_list[request_idx] = Loading
drivers/cam_ope/ope_hw_mgr/cam_ope_hw_mgr.h +5 −1 Original line number Original line Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */ /* /* * Copyright (c) 2019, The Linux Foundation. All rights reserved. * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. */ */ #ifndef CAM_OPE_HW_MGR_H #ifndef CAM_OPE_HW_MGR_H Loading Loading @@ -60,6 +60,8 @@ #define CLK_HW_MAX 0x1 #define CLK_HW_MAX 0x1 #define OPE_DEVICE_IDLE_TIMEOUT 400 #define OPE_DEVICE_IDLE_TIMEOUT 400 #define OPE_REQUEST_TIMEOUT 200 /** /** Loading Loading @@ -431,6 +433,7 @@ struct cam_ope_cdm { * @ctxt_event_cb: Callback of a context * @ctxt_event_cb: Callback of a context * @req_list: Request List * @req_list: Request List * @ope_cdm: OPE CDM info * @ope_cdm: OPE CDM info * @last_req_time: Timestamp of last request * @req_watch_dog: Watchdog for requests * @req_watch_dog: Watchdog for requests * @req_watch_dog_reset_counter: Request reset counter * @req_watch_dog_reset_counter: Request reset counter * @clk_info: OPE Ctx clock info * @clk_info: OPE Ctx clock info Loading @@ -451,6 +454,7 @@ struct cam_ope_ctx { cam_hw_event_cb_func ctxt_event_cb; cam_hw_event_cb_func ctxt_event_cb; struct cam_ope_request *req_list[CAM_CTX_REQ_MAX]; struct cam_ope_request *req_list[CAM_CTX_REQ_MAX]; struct cam_ope_cdm ope_cdm; struct cam_ope_cdm ope_cdm; uint64_t last_req_time; struct cam_req_mgr_timer *req_watch_dog; struct cam_req_mgr_timer *req_watch_dog; uint32_t req_watch_dog_reset_counter; uint32_t req_watch_dog_reset_counter; struct cam_ctx_clk_info clk_info; struct cam_ctx_clk_info clk_info; Loading