Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4ba079a authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "uio: msm_sharedmem: improve the debug/error logs"

parents 17b78200 9916159f
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 */

#define DRIVER_NAME "msm_sharedmem"
@@ -68,14 +68,16 @@ static int sharedmem_mmap(struct uio_info *info, struct vm_area_struct *vma)
/* Setup the shared ram permissions.
 * This function currently supports the mpss and nav clients only.
 */
static void setup_shared_ram_perms(u32 client_id, phys_addr_t addr, u32 size,
static int setup_shared_ram_perms(u32 client_id, phys_addr_t addr, u32 size,
				   bool vm_nav_path)
{
	int ret;
	int ret = -EINVAL;
	u32 source_vmlist[1] = {VMID_HLOS};

	if (client_id != MPSS_RMTS_CLIENT_ID)
		return;
	if (client_id != MPSS_RMTS_CLIENT_ID) {
		pr_err("invalid client id %u\n", client_id);
		return ret;
	}

	if (vm_nav_path) {
		int dest_vmids[3] = {VMID_HLOS, VMID_MSS_MSA, VMID_NAV};
@@ -100,6 +102,7 @@ static void setup_shared_ram_perms(u32 client_id, phys_addr_t addr, u32 size,
			pr_err("hyp_assign_phys failed IPA=0x016%pa size=%u err=%d\n",
				&addr, size, ret);
	}
	return ret;
}

static int msm_sharedmem_probe(struct platform_device *pdev)
@@ -183,8 +186,10 @@ static int msm_sharedmem_probe(struct platform_device *pdev)
			"qcom,vm-nav-path");

	/* Set up the permissions for the shared ram that was allocated. */
	setup_shared_ram_perms(client_id, shared_mem_pyhsical, shared_mem_size,
				vm_nav_path);
	ret = setup_shared_ram_perms(client_id, shared_mem_pyhsical,
					shared_mem_size, vm_nav_path);
	if (ret)
		goto out;

	/* Setup device */
	info->mmap = sharedmem_mmap; /* Custom mmap function. */