replace common qcom sources with samsung ones
This commit is contained in:
@@ -34,7 +34,7 @@ ccflags-y += -DCONFIG_SYNX_PINEAPPLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_SUN), y)
|
||||
$(info within KBUILD file CONFIG_ARCH_SUN = $(CONFIG_ARCH_SUN))
|
||||
$(info within KBUILD file CONFIG_ARCH_PINEAPPLE = $(CONFIG_ARCH_SUN))
|
||||
# include $(SYNX_ROOT)/config/sun.mk
|
||||
KBUILD_CPPFLAGS += -DCONFIG_SYNX_SUN=1
|
||||
ccflags-y += -DCONFIG_SYNX_SUN=1
|
||||
@@ -44,5 +44,4 @@ obj-m += synx-driver.o
|
||||
obj-m += synx/ipclite.o
|
||||
synx-driver-objs := synx/synx.o synx/synx_global.o synx/synx_util.o synx/synx_debugfs.o \
|
||||
synx/synx_compat.o
|
||||
synx-driver-$(CONFIG_DEBUG_FS) += synx/synx_debugfs_util.o
|
||||
obj-m += synx/test/ipclite_test.o
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2021-2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2021-2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
#define pr_fmt(fmt) "%s:%s: " fmt, KBUILD_MODNAME, __func__
|
||||
|
||||
@@ -918,12 +918,6 @@ static int32_t ipcmem_init(struct ipclite_mem *ipcmem, struct device_node *pn)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipclite_device_release(struct device *dev)
|
||||
{
|
||||
IPCLITE_OS_LOG(IPCLITE_INFO, "Releasing ipclite device\n");
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
static int ipclite_channel_irq_init(struct device *parent, struct device_node *node,
|
||||
struct ipclite_channel *channel)
|
||||
{
|
||||
@@ -940,7 +934,6 @@ static int ipclite_channel_irq_init(struct device *parent, struct device_node *n
|
||||
|
||||
dev->parent = parent;
|
||||
dev->of_node = node;
|
||||
dev->release = ipclite_device_release;
|
||||
dev_set_name(dev, "%s:%pOFn", dev_name(parent->parent), node);
|
||||
IPCLITE_OS_LOG(IPCLITE_DBG, "Registering %s device\n", dev_name(parent->parent));
|
||||
ret = device_register(dev);
|
||||
@@ -967,8 +960,6 @@ static int ipclite_channel_irq_init(struct device *parent, struct device_node *n
|
||||
ret = PTR_ERR(irq_info->mbox_chan);
|
||||
if (ret != -EPROBE_DEFER)
|
||||
IPCLITE_OS_LOG(IPCLITE_ERR, "failed to acquire IPC channel\n");
|
||||
else
|
||||
IPCLITE_OS_LOG(IPCLITE_WARN, "IPCC Probe Deferred\n");
|
||||
goto err_dev;
|
||||
}
|
||||
|
||||
@@ -990,6 +981,7 @@ static int ipclite_channel_irq_init(struct device *parent, struct device_node *n
|
||||
|
||||
err_dev:
|
||||
device_unregister(dev);
|
||||
kfree(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1013,6 +1005,11 @@ static struct ipcmem_partition_header *get_ipcmem_partition_hdr(struct ipclite_m
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void ipclite_channel_release(struct device *dev)
|
||||
{
|
||||
IPCLITE_OS_LOG(IPCLITE_INFO, "Releasing ipclite channel\n");
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
/* Sets up following fields of IPCLite channel structure:
|
||||
* remote_pid,tx_fifo, rx_fifo
|
||||
@@ -1035,7 +1032,7 @@ static int ipclite_channel_init(struct device *parent,
|
||||
|
||||
dev->parent = parent;
|
||||
dev->of_node = node;
|
||||
dev->release = ipclite_device_release;
|
||||
dev->release = ipclite_channel_release;
|
||||
dev_set_name(dev, "%s:%pOFn", dev_name(parent->parent), node);
|
||||
IPCLITE_OS_LOG(IPCLITE_DBG, "Registering %s device\n", dev_name(parent->parent));
|
||||
ret = device_register(dev);
|
||||
@@ -1145,9 +1142,19 @@ static int ipclite_channel_init(struct device *parent,
|
||||
err_put_dev:
|
||||
ipclite->channel[remote_pid].status = INACTIVE;
|
||||
device_unregister(dev);
|
||||
kfree(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void probe_subsystem(struct device *dev, struct device_node *np)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
ret = ipclite_channel_init(dev, np);
|
||||
if (ret)
|
||||
IPCLITE_OS_LOG(IPCLITE_ERR, "IPCLite Channel init failed\n");
|
||||
}
|
||||
|
||||
/* IPCLite Debug related functions start */
|
||||
static ssize_t ipclite_dbg_lvl_write(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, const char *buf, size_t count)
|
||||
@@ -1398,7 +1405,8 @@ static int ipclite_init_v0(struct platform_device *pdev)
|
||||
ipclite = kzalloc(sizeof(*ipclite), GFP_KERNEL);
|
||||
if (!ipclite) {
|
||||
IPCLITE_OS_LOG(IPCLITE_ERR, "IPCLite Memory Allocation Failed\n");
|
||||
return -ENOMEM;
|
||||
ret = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
|
||||
ipclite->dev = &pdev->dev;
|
||||
@@ -1409,7 +1417,7 @@ static int ipclite_init_v0(struct platform_device *pdev)
|
||||
if (hwlock_id != -EPROBE_DEFER)
|
||||
dev_err(&pdev->dev, "failed to retrieve hwlock\n");
|
||||
ret = hwlock_id;
|
||||
goto free_ipclite;
|
||||
goto release;
|
||||
}
|
||||
IPCLITE_OS_LOG(IPCLITE_DBG, "Hwlock id retrieved, hwlock_id=%d\n", hwlock_id);
|
||||
|
||||
@@ -1418,7 +1426,7 @@ static int ipclite_init_v0(struct platform_device *pdev)
|
||||
if (!ipclite->hwlock) {
|
||||
IPCLITE_OS_LOG(IPCLITE_ERR, "Failed to assign hwlock_id\n");
|
||||
ret = -ENXIO;
|
||||
goto free_ipclite;
|
||||
goto release;
|
||||
}
|
||||
IPCLITE_OS_LOG(IPCLITE_DBG, "Hwlock id assigned successfully, hwlock=%p\n",
|
||||
ipclite->hwlock);
|
||||
@@ -1442,11 +1450,8 @@ static int ipclite_init_v0(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
/* Setup Channel for each Remote Subsystem */
|
||||
for_each_available_child_of_node(pn, cn) {
|
||||
ret = ipclite_channel_init(&pdev->dev, cn);
|
||||
if (ret == -EPROBE_DEFER)
|
||||
goto release;
|
||||
}
|
||||
for_each_available_child_of_node(pn, cn)
|
||||
probe_subsystem(&pdev->dev, cn);
|
||||
|
||||
/* Broadcast init_done signal to all subsystems once mbox channels are set up */
|
||||
if (ipclite->channel[IPCMEM_APPS].status == ACTIVE) {
|
||||
@@ -1494,10 +1499,9 @@ mem_release:
|
||||
* braodcast)
|
||||
*/
|
||||
release:
|
||||
hwspin_lock_free(ipclite->hwlock);
|
||||
free_ipclite:
|
||||
kfree(ipclite);
|
||||
ipclite = NULL;
|
||||
error:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -2310,9 +2310,10 @@ static int synx_handle_import_arr(
|
||||
{
|
||||
int rc = -SYNX_INVALID;
|
||||
u32 idx = 0;
|
||||
struct synx_client *client;
|
||||
struct synx_import_arr_info arr_info;
|
||||
struct synx_import_info *arr;
|
||||
struct synx_import_params params = {0};
|
||||
struct synx_import_indv_params params = {0};
|
||||
|
||||
if (k_ioctl->size != sizeof(arr_info))
|
||||
return -SYNX_INVALID;
|
||||
@@ -2327,6 +2328,12 @@ static int synx_handle_import_arr(
|
||||
if (IS_ERR_OR_NULL(arr))
|
||||
return -ENOMEM;
|
||||
|
||||
client = synx_get_client(session);
|
||||
if (IS_ERR_OR_NULL(client)) {
|
||||
rc = PTR_ERR(client);
|
||||
goto clean;
|
||||
}
|
||||
|
||||
if (copy_from_user(arr,
|
||||
u64_to_user_ptr(arr_info.list),
|
||||
sizeof(*arr) * arr_info.num_objs)) {
|
||||
@@ -2335,21 +2342,20 @@ static int synx_handle_import_arr(
|
||||
}
|
||||
|
||||
while (idx < arr_info.num_objs) {
|
||||
params.type = SYNX_IMPORT_INDV_PARAMS;
|
||||
params.indv.new_h_synx = &arr[idx].new_synx_obj;
|
||||
params.indv.flags = arr[idx].flags;
|
||||
params.new_h_synx = &arr[idx].new_synx_obj;
|
||||
params.flags = arr[idx].flags;
|
||||
|
||||
if (arr[idx].flags & SYNX_IMPORT_DMA_FENCE)
|
||||
params.indv.fence =
|
||||
params.fence =
|
||||
sync_file_get_fence(arr[idx].desc.id[0]);
|
||||
else if (arr[idx].flags & SYNX_IMPORT_SYNX_FENCE)
|
||||
params.indv.fence = &arr[idx].synx_obj;
|
||||
params.fence = &arr[idx].synx_obj;
|
||||
|
||||
rc = synx_import(session, ¶ms);
|
||||
rc = synx_native_import_indv(client, ¶ms);
|
||||
|
||||
// Fence needs to be put irresepctive of import status
|
||||
if (arr[idx].flags & SYNX_IMPORT_DMA_FENCE)
|
||||
dma_fence_put(params.indv.fence);
|
||||
dma_fence_put(params.fence);
|
||||
|
||||
if (rc != SYNX_SUCCESS)
|
||||
break;
|
||||
@@ -2359,7 +2365,7 @@ static int synx_handle_import_arr(
|
||||
/* release allocated handles in case of failure */
|
||||
if (rc != SYNX_SUCCESS) {
|
||||
while (idx > 0)
|
||||
synx_release(session,
|
||||
synx_native_release_core(client,
|
||||
arr[--idx].new_synx_obj);
|
||||
} else {
|
||||
if (copy_to_user(u64_to_user_ptr(arr_info.list),
|
||||
@@ -2371,6 +2377,8 @@ static int synx_handle_import_arr(
|
||||
}
|
||||
|
||||
fail:
|
||||
synx_put_client(client);
|
||||
clean:
|
||||
kfree(arr);
|
||||
return rc;
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2019-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.
|
||||
*/
|
||||
|
||||
#include <linux/slab.h>
|
||||
@@ -1464,10 +1464,9 @@ static void synx_client_cleanup(struct work_struct *dispatch)
|
||||
* un-released from this session and remove them.
|
||||
*/
|
||||
hash_for_each_safe(client->handle_map, i, tmp, curr, node) {
|
||||
if (__ratelimit(&synx_ratelimit_state))
|
||||
dprintk(SYNX_WARN,
|
||||
"[sess :%llu] un-released handle %u\n",
|
||||
client->id, curr->key);
|
||||
dprintk(SYNX_WARN,
|
||||
"[sess :%llu] un-released handle %u\n",
|
||||
client->id, curr->key);
|
||||
j = kref_read(&curr->refcount);
|
||||
/* release pending reference */
|
||||
while (j--)
|
||||
|
Reference in New Issue
Block a user