Merge "net: ipc_router: Remove wakeup-source for Sensor ports"
This commit is contained in:
commit
aa6d4b9770
1 changed files with 49 additions and 15 deletions
|
@ -224,6 +224,25 @@ void msm_ipc_router_set_ws_allowed(bool flag)
|
||||||
is_wakeup_source_allowed = flag;
|
is_wakeup_source_allowed = flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* is_sensor_port() - Check if the remote port is sensor service or not
|
||||||
|
* @rport: Pointer to the remote port.
|
||||||
|
*
|
||||||
|
* Return: true if the remote port is sensor service else false.
|
||||||
|
*/
|
||||||
|
static int is_sensor_port(struct msm_ipc_router_remote_port *rport)
|
||||||
|
{
|
||||||
|
u32 svcid = 0;
|
||||||
|
|
||||||
|
if (rport && rport->server) {
|
||||||
|
svcid = rport->server->name.service;
|
||||||
|
if (svcid == 400 || (svcid >= 256 && svcid <= 320))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static void init_routing_table(void)
|
static void init_routing_table(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -2731,7 +2750,6 @@ static void do_read_data(struct work_struct *work)
|
||||||
struct rr_packet *pkt = NULL;
|
struct rr_packet *pkt = NULL;
|
||||||
struct msm_ipc_port *port_ptr;
|
struct msm_ipc_port *port_ptr;
|
||||||
struct msm_ipc_router_remote_port *rport_ptr;
|
struct msm_ipc_router_remote_port *rport_ptr;
|
||||||
int ret;
|
|
||||||
|
|
||||||
struct msm_ipc_router_xprt_info *xprt_info =
|
struct msm_ipc_router_xprt_info *xprt_info =
|
||||||
container_of(work,
|
container_of(work,
|
||||||
|
@ -2739,16 +2757,7 @@ static void do_read_data(struct work_struct *work)
|
||||||
read_data);
|
read_data);
|
||||||
|
|
||||||
while ((pkt = rr_read(xprt_info)) != NULL) {
|
while ((pkt = rr_read(xprt_info)) != NULL) {
|
||||||
if (pkt->length < calc_rx_header_size(xprt_info) ||
|
|
||||||
pkt->length > MAX_IPC_PKT_SIZE) {
|
|
||||||
IPC_RTR_ERR("%s: Invalid pkt length %d\n",
|
|
||||||
__func__, pkt->length);
|
|
||||||
goto read_next_pkt1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = extract_header(pkt);
|
|
||||||
if (ret < 0)
|
|
||||||
goto read_next_pkt1;
|
|
||||||
hdr = &(pkt->hdr);
|
hdr = &(pkt->hdr);
|
||||||
|
|
||||||
if ((hdr->dst_node_id != IPC_ROUTER_NID_LOCAL) &&
|
if ((hdr->dst_node_id != IPC_ROUTER_NID_LOCAL) &&
|
||||||
|
@ -4195,6 +4204,7 @@ void msm_ipc_router_xprt_notify(struct msm_ipc_router_xprt *xprt,
|
||||||
{
|
{
|
||||||
struct msm_ipc_router_xprt_info *xprt_info = xprt->priv;
|
struct msm_ipc_router_xprt_info *xprt_info = xprt->priv;
|
||||||
struct msm_ipc_router_xprt_work *xprt_work;
|
struct msm_ipc_router_xprt_work *xprt_work;
|
||||||
|
struct msm_ipc_router_remote_port *rport_ptr = NULL;
|
||||||
struct rr_packet *pkt;
|
struct rr_packet *pkt;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -4247,9 +4257,32 @@ void msm_ipc_router_xprt_notify(struct msm_ipc_router_xprt *xprt,
|
||||||
if (!pkt)
|
if (!pkt)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (pkt->length < calc_rx_header_size(xprt_info) ||
|
||||||
|
pkt->length > MAX_IPC_PKT_SIZE) {
|
||||||
|
IPC_RTR_ERR("%s: Invalid pkt length %d\n",
|
||||||
|
__func__, pkt->length);
|
||||||
|
release_pkt(pkt);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = extract_header(pkt);
|
||||||
|
if (ret < 0) {
|
||||||
|
release_pkt(pkt);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pkt->ws_need = false;
|
pkt->ws_need = false;
|
||||||
|
|
||||||
|
if (pkt->hdr.type == IPC_ROUTER_CTRL_CMD_DATA)
|
||||||
|
rport_ptr = ipc_router_get_rport_ref(pkt->hdr.src_node_id,
|
||||||
|
pkt->hdr.src_port_id);
|
||||||
|
|
||||||
mutex_lock(&xprt_info->rx_lock_lhb2);
|
mutex_lock(&xprt_info->rx_lock_lhb2);
|
||||||
list_add_tail(&pkt->list, &xprt_info->pkt_list);
|
list_add_tail(&pkt->list, &xprt_info->pkt_list);
|
||||||
|
/* check every pkt is from SENSOR services or not and
|
||||||
|
* avoid holding both edge and port specific wake-up sources
|
||||||
|
*/
|
||||||
|
if (!is_sensor_port(rport_ptr)) {
|
||||||
if (!xprt_info->dynamic_ws) {
|
if (!xprt_info->dynamic_ws) {
|
||||||
__pm_stay_awake(&xprt_info->ws);
|
__pm_stay_awake(&xprt_info->ws);
|
||||||
pkt->ws_need = true;
|
pkt->ws_need = true;
|
||||||
|
@ -4259,6 +4292,7 @@ void msm_ipc_router_xprt_notify(struct msm_ipc_router_xprt *xprt,
|
||||||
pkt->ws_need = true;
|
pkt->ws_need = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
mutex_unlock(&xprt_info->rx_lock_lhb2);
|
mutex_unlock(&xprt_info->rx_lock_lhb2);
|
||||||
queue_work(xprt_info->workqueue, &xprt_info->read_data);
|
queue_work(xprt_info->workqueue, &xprt_info->read_data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue