Skip to content

Commit

Permalink
Merge "msm: ipa: schedule nop only once"
Browse files Browse the repository at this point in the history
  • Loading branch information
lnxbuild authored and Gerrit - the friendly Code Review server committed Jan 26, 2018
2 parents 19a2863 + 6540e99 commit 0043153
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 13 additions & 2 deletions drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 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
Expand Down Expand Up @@ -222,7 +222,13 @@ static void ipa3_send_nop_desc(struct work_struct *work)
tx_pkt->no_unmap_dma = true;
tx_pkt->sys = sys;
spin_lock_bh(&sys->spinlock);
if (unlikely(!sys->nop_pending)) {
spin_unlock_bh(&sys->spinlock);
kmem_cache_free(ipa3_ctx->tx_pkt_wrapper_cache, tx_pkt);
return;
}
list_add_tail(&tx_pkt->link, &sys->head_desc_list);
sys->nop_pending = false;
spin_unlock_bh(&sys->spinlock);

memset(&nop_xfer, 0, sizeof(nop_xfer));
Expand Down Expand Up @@ -271,6 +277,7 @@ int ipa3_send(struct ipa3_sys_context *sys,
int result;
u32 mem_flag = GFP_ATOMIC;
const struct ipa_gsi_ep_config *gsi_ep_cfg;
bool send_nop = false;

if (unlikely(!in_atomic))
mem_flag = GFP_KERNEL;
Expand Down Expand Up @@ -408,10 +415,14 @@ int ipa3_send(struct ipa3_sys_context *sys,
}
kfree(gsi_xfer_elem_array);

if (sys->use_comm_evt_ring && !sys->nop_pending) {
sys->nop_pending = true;
send_nop = true;
}
spin_unlock_bh(&sys->spinlock);

/* set the timer for sending the NOP descriptor */
if (sys->use_comm_evt_ring && !hrtimer_active(&sys->db_timer)) {
if (send_nop) {
ktime_t time = ktime_set(0, IPA_TX_SEND_COMPL_NOP_DELAY_NS);

IPADBG_LOW("scheduling timer for ch %lu\n",
Expand Down
3 changes: 2 additions & 1 deletion drivers/platform/msm/ipa/ipa_v3/ipa_i.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 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
Expand Down Expand Up @@ -626,6 +626,7 @@ struct ipa3_sys_context {
struct delayed_work switch_to_intr_work;
enum ipa3_sys_pipe_policy policy;
bool use_comm_evt_ring;
bool nop_pending;
int (*pyld_hdlr)(struct sk_buff *skb, struct ipa3_sys_context *sys);
struct sk_buff * (*get_skb)(unsigned int len, gfp_t flags);
void (*free_skb)(struct sk_buff *skb);
Expand Down

0 comments on commit 0043153

Please sign in to comment.