Merge "msm: camera: utils: Rate limit error log in case of invalid handles" into camera-kernel.lnx.4.0

此提交包含在:
Haritha Chintalapati
2020-11-17 14:09:34 -08:00
提交者 Gerrit - the friendly Code Review server
當前提交 dd1071a4c6
共有 3 個檔案被更改,包括 30 行新增19 行删除

查看文件

@@ -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;
}

查看文件

@@ -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;
}

查看文件

@@ -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;
}