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

Commit 0fa3bac6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "rpm-smd: Optimize smd data read"

parents 1b9819fd 39ee258d
Loading
Loading
Loading
Loading
+13 −17
Original line number Diff line number Diff line
@@ -555,7 +555,7 @@ struct msm_rpm_ack_msg {

LIST_HEAD(msm_rpm_ack_list);

static DECLARE_COMPLETION(data_ready);
static struct tasklet_struct data_tasklet;

static void msm_rpm_notify_sleep_chain(struct rpm_message_header *hdr,
		struct msm_rpm_kvp_data *kvp)
@@ -749,7 +749,7 @@ static void msm_rpm_notify(void *data, unsigned event)

	switch (event) {
	case SMD_EVENT_DATA:
		complete(&data_ready);
		tasklet_schedule(&data_tasklet);
		break;
	case SMD_EVENT_OPEN:
		complete(&pdata->smd_open);
@@ -939,15 +939,12 @@ static int msm_rpm_read_smd_data(char *buf)
	return 0;
}

static void msm_rpm_smd_work(struct work_struct *work)
static void data_fn_tasklet(unsigned long data)
{
	uint32_t msg_id;
	int errno;
	char buf[MAX_ERR_BUFFER_SIZE] = {0};

	while (1) {
		wait_for_completion(&data_ready);

	spin_lock(&msm_rpm_data.smd_lock_read);
	while (smd_is_pkt_avail(msm_rpm_data.ch_info)) {
		if (msm_rpm_read_smd_data(buf))
@@ -958,7 +955,6 @@ static void msm_rpm_smd_work(struct work_struct *work)
	}
	spin_unlock(&msm_rpm_data.smd_lock_read);
}
}

static void msm_rpm_log_request(struct msm_rpm_request *cdata)
{
@@ -1401,7 +1397,7 @@ wait_ack_cleanup:

	if (!glink_enabled)
		if (smd_is_pkt_avail(msm_rpm_data.ch_info))
			complete(&data_ready);
			tasklet_schedule(&data_tasklet);
	return rc;
}
EXPORT_SYMBOL(msm_rpm_wait_for_ack_noirq);
@@ -1803,7 +1799,7 @@ static int msm_rpm_dev_probe(struct platform_device *pdev)

	spin_lock_init(&msm_rpm_data.smd_lock_write);
	spin_lock_init(&msm_rpm_data.smd_lock_read);
	INIT_WORK(&msm_rpm_data.work, msm_rpm_smd_work);
	tasklet_init(&data_tasklet, data_fn_tasklet, 0);

	wait_for_completion(&msm_rpm_data.smd_open);

+1 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012, 2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2014-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and