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

Commit b974ce64 authored by Nikhilesh Reddy's avatar Nikhilesh Reddy
Browse files

uio: msm_sharedmem: Add addtional information to debugfs



Add an addtional line to the debugfs info printed to indicate
if the address in that entry was allocated dynamically or
is a static entry in the device tree.

Change-Id: Idd41acac9f15bec68d5692fe85175b42a1e90431
Signed-off-by: default avatarNikhilesh Reddy <reddyn@codeaurora.org>
parent d81481d4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ static int msm_sharedmem_probe(struct platform_device *pdev)
	u32 shared_mem_size = 0;
	void *shared_mem = NULL;
	phys_addr_t shared_mem_pyhsical = 0;
	bool is_addr_dynamic = false;
	struct sharemem_qmi_entry qmi_entry;

	/* Get the addresses from platform-data */
@@ -66,6 +67,7 @@ static int msm_sharedmem_probe(struct platform_device *pdev)
	}

	if (shared_mem_pyhsical == 0) {
		is_addr_dynamic = true;
		shared_mem = dma_alloc_coherent(&pdev->dev, shared_mem_size,
					&shared_mem_pyhsical, GFP_KERNEL);
		if (shared_mem == NULL) {
@@ -93,6 +95,7 @@ static int msm_sharedmem_probe(struct platform_device *pdev)
	qmi_entry.client_name = info->name;
	qmi_entry.address = info->mem[0].addr;
	qmi_entry.size = info->mem[0].size;
	qmi_entry.is_addr_dynamic = is_addr_dynamic;

	sharedmem_qmi_add_entry(&qmi_entry);
	pr_info("Device created for client '%s'\n", clnt_res->name);
+6 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ struct shared_addr_entry {
	u64 address;
	u32 size;
	u64 request_count;
	bool is_addr_dynamic;
	char name[SHARED_ADDR_ENTRY_NAME_MAX_LEN + 1];
};

@@ -85,6 +86,7 @@ void sharedmem_qmi_add_entry(struct sharemem_qmi_entry *qmi_entry)
	list_entry->entry.id = qmi_entry->client_id;
	list_entry->entry.address = qmi_entry->address;
	list_entry->entry.size = qmi_entry->size;
	list_entry->entry.is_addr_dynamic = qmi_entry->is_addr_dynamic;
	list_entry->entry.request_count = 0;

	down_write(&sharedmem_list_lock);
@@ -245,6 +247,10 @@ static u32 fill_debug_info(char *buffer, u32 buffer_size)
		size += scnprintf(buffer + size, buffer_size - size,
				"Address: 0x%016llX\n",
				list_entry->entry.address);
		size += scnprintf(buffer + size, buffer_size - size,
				"Address Allocation: %s\n",
				(list_entry->entry.is_addr_dynamic ?
				"Dynamic" : "Static"));
		size += scnprintf(buffer + size, buffer_size - size,
				"Request count: %llu\n",
				list_entry->entry.request_count);
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ struct sharemem_qmi_entry {
	u32 client_id;
	u64 address;
	u32 size;
	bool is_addr_dynamic;
};

int sharedmem_qmi_init(void);