replace common qcom sources with samsung ones
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022-2025 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "smcinvoke: %s: " fmt, __func__
|
||||
@@ -2485,7 +2485,7 @@ static void add_mem_obj_info_to_async_side_channel_locked(void *buf, size_t buf_
|
||||
|
||||
msg->count = index;
|
||||
|
||||
pr_debug("Added %zu memory objects to the side channel, total size = %zu\n", index, used);
|
||||
pr_debug("Added %lu memory objects to the side channel, total size = %zu\n", index, used);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -2780,7 +2780,6 @@ static long process_invoke_req(struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
int ret = -1, nr_args = 0;
|
||||
int nr_args_cnt = 0;
|
||||
struct smcinvoke_cmd_req req = {0};
|
||||
void *in_msg = NULL, *out_msg = NULL;
|
||||
size_t inmsg_size = 0, outmsg_size = SMCINVOKE_TZ_MIN_BUF_SIZE;
|
||||
@@ -2847,16 +2846,11 @@ static long process_invoke_req(struct file *filp, unsigned int cmd,
|
||||
|
||||
nr_args = OBJECT_COUNTS_NUM_buffers(req.counts) +
|
||||
OBJECT_COUNTS_NUM_objects(req.counts);
|
||||
/*
|
||||
* In case nr_args is zero, allocate one buffer so that args_buf points to a valid
|
||||
* buffer. There is no need to copy anything to the buffer
|
||||
*/
|
||||
nr_args_cnt = ((nr_args > 0) ? nr_args : 1);
|
||||
|
||||
args_buf = kcalloc(nr_args_cnt, req.argsize, GFP_KERNEL);
|
||||
if (!args_buf)
|
||||
return -ENOMEM;
|
||||
if (nr_args) {
|
||||
args_buf = kcalloc(nr_args, req.argsize, GFP_KERNEL);
|
||||
if (!args_buf)
|
||||
return -ENOMEM;
|
||||
if (context_type == SMCINVOKE_OBJ_TYPE_TZ_OBJ) {
|
||||
ret = copy_from_user(args_buf,
|
||||
u64_to_user_ptr(req.args),
|
||||
@@ -3267,11 +3261,7 @@ exit_destroy_wkthread:
|
||||
return rc;
|
||||
}
|
||||
|
||||
#if KERNEL_VERSION(6, 10, 0) > LINUX_VERSION_CODE
|
||||
static int smcinvoke_remove(struct platform_device *pdev)
|
||||
#else
|
||||
static void smcinvoke_remove(struct platform_device *pdev)
|
||||
#endif
|
||||
{
|
||||
int count = 1;
|
||||
|
||||
@@ -3280,9 +3270,7 @@ static void smcinvoke_remove(struct platform_device *pdev)
|
||||
device_destroy(driver_class, smcinvoke_device_no);
|
||||
class_destroy(driver_class);
|
||||
unregister_chrdev_region(smcinvoke_device_no, count);
|
||||
#if KERNEL_VERSION(6, 10, 0) > LINUX_VERSION_CODE
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int __maybe_unused smcinvoke_suspend(struct platform_device *pdev,
|
||||
|
||||
@@ -900,7 +900,7 @@ static void dequeue_and_put_txn(struct cb_txn *cb_txn)
|
||||
static int wait_for_pending_txn(struct server_info *si, struct cb_txn **cb_txn)
|
||||
{
|
||||
int ret = 0;
|
||||
struct cb_txn *t = NULL;
|
||||
struct cb_txn *t;
|
||||
|
||||
DEFINE_WAIT_FUNC(wait, woken_wake_function);
|
||||
|
||||
@@ -1437,6 +1437,8 @@ static long process_invoke_req(struct file *filp, unsigned int cmd, unsigned lon
|
||||
|
||||
struct si_arg *u = NULL; /* Array of arguments passed to the QTEE. */
|
||||
|
||||
u32 op;
|
||||
|
||||
struct si_object_invoke_ctx *oic;
|
||||
|
||||
/* Do some sanity check! */
|
||||
@@ -1447,16 +1449,23 @@ static long process_invoke_req(struct file *filp, unsigned int cmd, unsigned lon
|
||||
if (copy_from_user(&u_req, (void __user *)arg, sizeof(u_req)))
|
||||
return -EFAULT;
|
||||
|
||||
op = SI_OBJECT_OP_METHOD_ID(u_req.op);
|
||||
if (op == SI_OBJECT_OP_RELEASE || op == SI_OBJECT_OP_RETAIN) {
|
||||
pr_err("OP (RELEASE || RETAIN) is not permitted.\n");
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (typeof_si_object(object) == SI_OT_ROOT) {
|
||||
if ((u_req.op == IClientEnv_OP_notifyDomainChange) ||
|
||||
(u_req.op == IClientEnv_OP_adciAccept) ||
|
||||
(u_req.op == IClientEnv_OP_adciShutdown)) {
|
||||
pr_err("invalid rootenv op\n");
|
||||
if ((op == IClientEnv_OP_notifyDomainChange) ||
|
||||
(op == IClientEnv_OP_adciAccept) ||
|
||||
(op == IClientEnv_OP_adciShutdown)) {
|
||||
pr_err("invalid rootenv OP %u\n", op);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (u_req.op == IClientEnv_OP_registerWithCredentials) {
|
||||
if (op == IClientEnv_OP_registerWithCredentials) {
|
||||
if (u_req.counts != OBJECT_COUNTS_PACK(0, 0, 1, 1)) {
|
||||
pr_err("IClientEnv_OP_registerWithCredentials: incorrect number of arguments.\n");
|
||||
|
||||
@@ -1498,7 +1507,7 @@ static long process_invoke_req(struct file *filp, unsigned int cmd, unsigned lon
|
||||
}
|
||||
|
||||
if (typeof_si_object(object) == SI_OT_ROOT) {
|
||||
if (u_req.op == IClientEnv_OP_registerWithCredentials) {
|
||||
if (op == IClientEnv_OP_registerWithCredentials) {
|
||||
if (U_HANDLE_IS_NULL(u_args[0].o.fd)) {
|
||||
pr_err("IClientEnv_OP_registerWithCredentials: privileged credential.\n");
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2023, 2025 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "smcinvoke_kernel: %s: " fmt, __func__
|
||||
@@ -124,7 +124,7 @@ static int32_t do_invoke(void *context, uint32_t op,
|
||||
goto out_failed;
|
||||
}
|
||||
|
||||
pr_info("%s object invocation with %zu arguments (%04x) and op %d.\n",
|
||||
pr_info("%s object invocation with %lu arguments (%04x) and op %d.\n",
|
||||
si_object_name(object), OBJECT_COUNTS_TOTAL(counts), counts, op);
|
||||
|
||||
/* + INITIATE an invocation. */
|
||||
|
||||
Reference in New Issue
Block a user