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

Commit d371440a authored by Ravi Aravamudhan's avatar Ravi Aravamudhan Committed by Matt Wagantall
Browse files

diag: Add flow control counts to diag-socket layer



If the peripherals are slow in reading diag data from socket
channels, the channel will be flow controlled. Add counters to
track how many times a peripheral has flow controlled Apps Diag
driver.

Change-Id: I6907cc618d50f7343efe964eeb07668cdb6e4249
Signed-off-by: default avatarRavi Aravamudhan <aravamud@codeaurora.org>
parent b8629d9a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -617,6 +617,7 @@ static ssize_t diag_dbgfs_read_socketinfo(struct file *file, char __user *ubuf,
				"opened\t\t:\t%d\n"
				"buf_1 busy\t:\t%d\n"
				"buf_2 busy\t:\t%d\n"
				"flow ctrl count\t:\t%d\n"
				"data_ready\t:\t%d\n"
				"init pending\t:\t%d\n"
				"read pending\t:\t%d\n"
@@ -633,6 +634,7 @@ static ssize_t diag_dbgfs_read_socketinfo(struct file *file, char __user *ubuf,
				atomic_read(&fwd_ctxt->buf_1->in_busy) : -1,
				(fwd_ctxt && fwd_ctxt->buf_2) ?
				atomic_read(&fwd_ctxt->buf_2->in_busy) : -1,
				atomic_read(&info->flow_cnt),
				info->data_ready,
				work_pending(&info->init_work),
				work_pending(&info->read_work),
+2 −0
Original line number Diff line number Diff line
@@ -232,6 +232,7 @@ static void socket_flow_cntl(struct sock *sk_ptr)
		return;
	}

	atomic_inc(&info->flow_cnt);
	DIAG_LOG(DIAG_DEBUG_PERIPHERALS, "%s flow controlled\n", info->name);
	pr_debug("diag: In %s, channel %s flow controlled\n",
		 __func__, info->name);
@@ -625,6 +626,7 @@ static void __diag_socket_init(struct diag_socket_info *info)
	info->hdl = NULL;
	info->fwd_ctxt = NULL;
	info->data_ready = 0;
	atomic_set(&info->flow_cnt, 0);
	spin_lock_init(&info->lock);
	strlcpy(wq_name, "DIAG_SOCKET_", 10);
	strlcat(wq_name, info->name, sizeof(info->name));
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ struct diag_socket_info {
	uint32_t svc_id;
	uint32_t ins_id;
	uint32_t data_ready;
	atomic_t flow_cnt;
	char name[DIAG_SOCKET_NAME_SZ];
	spinlock_t lock;
	wait_queue_head_t wait_q;