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

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

Merge "net: ipc_router: Use optimized wakeup_source APIs"

parents a23d14a1 560c0890
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-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
@@ -119,7 +119,7 @@ struct msm_ipc_port {
	struct list_head port_rx_q;
	struct mutex port_rx_q_lock_lhc3;
	char rx_ws_name[MAX_WS_NAME_SZ];
	struct wakeup_source port_rx_ws;
	struct wakeup_source *port_rx_ws;
	wait_queue_head_t port_rx_wait_q;
	wait_queue_head_t port_tx_wait_q;

+8 −4
Original line number Diff line number Diff line
@@ -1120,7 +1120,7 @@ static int post_pkt_to_port(struct msm_ipc_port *port_ptr,
	}

	mutex_lock(&port_ptr->port_rx_q_lock_lhc3);
	__pm_stay_awake(&port_ptr->port_rx_ws);
	__pm_stay_awake(port_ptr->port_rx_ws);
	list_add_tail(&temp_pkt->list, &port_ptr->port_rx_q);
	wake_up(&port_ptr->port_rx_wait_q);
	notify = port_ptr->notify;
@@ -1277,7 +1277,11 @@ struct msm_ipc_port *msm_ipc_router_create_raw_port(void *endpoint,
		 "ipc%08x_%s",
		 port_ptr->this_port.port_id,
		 current->comm);
	wakeup_source_init(&port_ptr->port_rx_ws, port_ptr->rx_ws_name);
	port_ptr->port_rx_ws = wakeup_source_register(port_ptr->rx_ws_name);
	if (!port_ptr->port_rx_ws) {
		kfree(port_ptr);
		return NULL;
	}
	init_waitqueue_head(&port_ptr->port_tx_wait_q);
	kref_init(&port_ptr->ref);

@@ -1333,7 +1337,7 @@ void ipc_router_release_port(struct kref *ref)
		release_pkt(pkt);
	}
	mutex_unlock(&port_ptr->port_rx_q_lock_lhc3);
	wakeup_source_trash(&port_ptr->port_rx_ws);
	wakeup_source_unregister(port_ptr->port_rx_ws);
	if (port_ptr->endpoint)
		sock_put(ipc_port_sk(port_ptr->endpoint));
	kfree(port_ptr);
@@ -3184,7 +3188,7 @@ int msm_ipc_router_read(struct msm_ipc_port *port_ptr,
	}
	list_del(&pkt->list);
	if (list_empty(&port_ptr->port_rx_q))
		__pm_relax(&port_ptr->port_rx_ws);
		__pm_relax(port_ptr->port_rx_ws);
	*read_pkt = pkt;
	mutex_unlock(&port_ptr->port_rx_q_lock_lhc3);
	if (pkt->hdr.control_flag & CONTROL_FLAG_CONFIRM_RX)