diff --git a/drivers/cam_core/cam_context_utils.c b/drivers/cam_core/cam_context_utils.c index dee6d1708fbd..10613a326590 100644 --- a/drivers/cam_core/cam_context_utils.c +++ b/drivers/cam_core/cam_context_utils.c @@ -535,8 +535,8 @@ int32_t cam_context_acquire_dev_to_hw(struct cam_context *ctx, cmd->resource_hdl); if (cmd->num_resources > CAM_CTX_RES_MAX) { - CAM_ERR(CAM_CTXT, "[%s][%d] resource limit exceeded", - ctx->dev_name, ctx->ctx_id); + CAM_ERR(CAM_CTXT, "[%s][%d] resource[%d] limit exceeded", + ctx->dev_name, ctx->ctx_id, cmd->num_resources); rc = -ENOMEM; goto end; } diff --git a/drivers/cam_core/cam_node.c b/drivers/cam_core/cam_node.c index 75ec613e7112..c3770f2df745 100644 --- a/drivers/cam_core/cam_node.c +++ b/drivers/cam_core/cam_node.c @@ -346,31 +346,36 @@ static int __cam_node_handle_flush_dev(struct cam_node *node, return -EINVAL; if (flush->dev_handle <= 0) { - CAM_ERR(CAM_CORE, "Invalid device handle for context"); + CAM_ERR_RATE_LIMIT(CAM_CORE, + "Invalid device handle for context"); return -EINVAL; } if (flush->session_handle <= 0) { - CAM_ERR(CAM_CORE, "Invalid session handle for context"); + CAM_ERR_RATE_LIMIT(CAM_CORE, + "Invalid session handle for context"); return -EINVAL; } ctx = (struct cam_context *)cam_get_device_priv(flush->dev_handle); if (!ctx) { - CAM_ERR(CAM_CORE, "Can not get context for handle %d", + CAM_ERR_RATE_LIMIT(CAM_CORE, + "Can not get context for handle %d", flush->dev_handle); return -EINVAL; } if (strcmp(node->name, ctx->dev_name)) { - CAM_ERR(CAM_CORE, "node name %s dev name:%s not matching", + CAM_ERR_RATE_LIMIT(CAM_CORE, + "node name %s dev name:%s not matching", node->name, ctx->dev_name); return -EINVAL; } rc = cam_context_handle_flush_dev(ctx, flush); if (rc) - CAM_ERR(CAM_CORE, "Flush failure for node %s", node->name); + CAM_ERR_RATE_LIMIT(CAM_CORE, + "Flush failure for node %s", node->name); return rc; } @@ -446,25 +451,29 @@ static int __cam_node_handle_dump_dev(struct cam_node *node, return -EINVAL; if (dump->dev_handle <= 0) { - CAM_ERR(CAM_CORE, "Invalid device handle for context"); + CAM_ERR_RATE_LIMIT(CAM_CORE, + "Invalid device handle for context"); return -EINVAL; } if (dump->session_handle <= 0) { - CAM_ERR(CAM_CORE, "Invalid session handle for context"); + CAM_ERR_RATE_LIMIT(CAM_CORE, + "Invalid session handle for context"); return -EINVAL; } ctx = (struct cam_context *)cam_get_device_priv(dump->dev_handle); if (!ctx) { - CAM_ERR(CAM_CORE, "Can not get context for handle %d", + CAM_ERR_RATE_LIMIT(CAM_CORE, + "Can not get context for handle %d", dump->dev_handle); return -EINVAL; } rc = cam_context_handle_dump_dev(ctx, dump); if (rc) - CAM_ERR(CAM_CORE, "Dump failure for node %s", node->name); + CAM_ERR_RATE_LIMIT(CAM_CORE, + "Dump failure for node %s", node->name); return rc; } diff --git a/drivers/cam_req_mgr/cam_req_mgr_util.c b/drivers/cam_req_mgr/cam_req_mgr_util.c index df180a615104..4b1f4d8e8622 100644 --- a/drivers/cam_req_mgr/cam_req_mgr_util.c +++ b/drivers/cam_req_mgr/cam_req_mgr_util.c @@ -223,23 +223,25 @@ void *cam_get_device_priv(int32_t dev_hdl) idx = CAM_REQ_MGR_GET_HDL_IDX(dev_hdl); if (idx >= CAM_REQ_MGR_MAX_HANDLES_V2) { - CAM_ERR_RATE_LIMIT(CAM_CRM, "Invalid idx"); + CAM_ERR_RATE_LIMIT(CAM_CRM, "Invalid idx:%d", idx); + goto device_priv_fail; + } + + if (hdl_tbl->hdl[idx].hdl_value != dev_hdl) { + CAM_ERR_RATE_LIMIT(CAM_CRM, "Invalid hdl [%d] [%d]", + dev_hdl, hdl_tbl->hdl[idx].hdl_value); goto device_priv_fail; } if (hdl_tbl->hdl[idx].state != HDL_ACTIVE) { - CAM_ERR_RATE_LIMIT(CAM_CRM, "Invalid state"); + CAM_ERR_RATE_LIMIT(CAM_CRM, "Invalid state:%d", + hdl_tbl->hdl[idx].state); goto device_priv_fail; } type = CAM_REQ_MGR_GET_HDL_TYPE(dev_hdl); if (HDL_TYPE_DEV != type && HDL_TYPE_SESSION != type) { - CAM_ERR_RATE_LIMIT(CAM_CRM, "Invalid type"); - goto device_priv_fail; - } - - if (hdl_tbl->hdl[idx].hdl_value != dev_hdl) { - CAM_ERR_RATE_LIMIT(CAM_CRM, "Invalid hdl"); + CAM_ERR_RATE_LIMIT(CAM_CRM, "Invalid type:%d", type); goto device_priv_fail; }