misc: nvsciipc: add error log to OOT driver

Add log for DB update.
Add log for endpoint entry lookup failure and DB access failure.

Bug 4052130
Bug 4074668
Bug 4074515

Change-Id: I8c8fb29fd7a4c4abd14b0c5d6d65f9a36d7a3d85
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890654
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Kurt Yi <kyi@nvidia.com>
Reviewed-by: Priyanshu Sharma <priyanshus@nvidia.com>
Tested-by: Priyanshu Sharma <priyanshus@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
(cherry picked from commit b3dde6d13dd2ae774ab6227a88b6539f39dbb010)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890779
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Joshua Cha
2023-04-19 20:50:38 +09:00
committed by mobile promotions
parent ec7162fc4d
commit 45992044df

View File

@@ -226,7 +226,8 @@ static int nvsciipc_ioctl_validate_auth_token(struct nvsciipc *ctx,
int32_t ret = 0;
if ((ctx->num_eps == 0) || (ctx->set_db_f != true)) {
ERR("need to set endpoint database first\n");
ERR("%s[%d] need to set endpoint database first\n", __func__,
get_current()->pid);
ret = -EPERM;
goto exit;
}
@@ -263,7 +264,8 @@ static int nvsciipc_ioctl_map_vuid(struct nvsciipc *ctx, unsigned int cmd,
int32_t ret = 0;
if ((ctx->num_eps == 0) || (ctx->set_db_f != true)) {
ERR("need to set endpoint database first\n");
ERR("%s[%d] need to set endpoint database first\n", __func__,
get_current()->pid);
ret = -EPERM;
goto exit;
}
@@ -300,7 +302,8 @@ static int nvsciipc_ioctl_get_db_by_name(struct nvsciipc *ctx, unsigned int cmd,
int i;
if ((ctx->num_eps == 0) || (ctx->set_db_f != true)) {
ERR("need to set endpoint database first\n");
ERR("%s[%d] need to set endpoint database first\n", __func__,
get_current()->pid);
return -EPERM;
}
@@ -320,6 +323,7 @@ static int nvsciipc_ioctl_get_db_by_name(struct nvsciipc *ctx, unsigned int cmd,
}
if (i == ctx->num_eps) {
INFO("%s: no entry (%s)\n", __func__, get_db.ep_name);
return -ENOENT;
} else if (copy_to_user((void __user *)arg, &get_db,
_IOC_SIZE(cmd))) {
@@ -337,7 +341,8 @@ static int nvsciipc_ioctl_get_db_by_vuid(struct nvsciipc *ctx, unsigned int cmd,
int i;
if ((ctx->num_eps == 0) || (ctx->set_db_f != true)) {
ERR("need to set endpoint database first\n");
ERR("%s[%d] need to set endpoint database first\n", __func__,
get_current()->pid);
return -EPERM;
}
@@ -356,6 +361,7 @@ static int nvsciipc_ioctl_get_db_by_vuid(struct nvsciipc *ctx, unsigned int cmd,
}
if (i == ctx->num_eps) {
INFO("%s: no entry (0x%llx)\n", __func__, get_db.vuid);
return -ENOENT;
} else if (copy_to_user((void __user *)arg, &get_db,
_IOC_SIZE(cmd))) {
@@ -373,7 +379,8 @@ static int nvsciipc_ioctl_get_vuid(struct nvsciipc *ctx, unsigned int cmd,
int i;
if ((ctx->num_eps == 0) || (ctx->set_db_f != true)) {
ERR("need to set endpoint database first\n");
ERR("%s[%d] need to set endpoint database first\n", __func__,
get_current()->pid);
return -EPERM;
}
@@ -392,6 +399,7 @@ static int nvsciipc_ioctl_get_vuid(struct nvsciipc *ctx, unsigned int cmd,
}
if (i == ctx->num_eps) {
INFO("%s: no entry (%s)\n", __func__, get_vuid.ep_name);
return -ENOENT;
} else if (copy_to_user((void __user *)arg, &get_vuid,
_IOC_SIZE(cmd))) {
@@ -410,6 +418,8 @@ static int nvsciipc_ioctl_set_db(struct nvsciipc *ctx, unsigned int cmd,
int ret = 0;
int i;
INFO("set_db start\n");
#if defined(CONFIG_ANDROID)
if ((current_cred()->uid.val != SYSTEM_GID) &&
(current_cred()->uid.val != 0)) {
@@ -511,6 +521,8 @@ static int nvsciipc_ioctl_set_db(struct nvsciipc *ctx, unsigned int cmd,
ctx->set_db_f = true;
INFO("set_db done\n");
return ret;
ptr_error:
@@ -540,7 +552,8 @@ static int nvsciipc_ioctl_get_dbsize(struct nvsciipc *ctx, unsigned int cmd,
int32_t ret = 0;
if (ctx->set_db_f != true) {
ERR("need to set endpoint database first\n");
ERR("%s[%d] need to set endpoint database first\n", __func__,
get_current()->pid);
ret = -EPERM;
goto exit;
}
@@ -635,7 +648,8 @@ static ssize_t nvsciipc_dbg_read(struct file *filp, char __user *buf,
}
if (ctx->set_db_f != true) {
ERR("need to set endpoint database first\n");
ERR("%s[%d] need to set endpoint database first\n", __func__,
get_current()->pid);
return -EPERM;
}