msm: ipa3: Add specific logs to improve debugging capabilities

Add some debug logs to specific places at IPA driver
to improve debugging capabilities.

Change-Id: Ibc53bd27a58c90d309a38937d6de6eef62ddc99a
CRs-Fixed: 1073482
Signed-off-by: Ghanim Fodi <gfodi@codeaurora.org>
This commit is contained in:
Ghanim Fodi 2016-10-02 12:12:38 +03:00 committed by Gerrit - the friendly Code Review server
parent 7fcfd3ec06
commit d51f2f62e4
3 changed files with 25 additions and 14 deletions

View file

@ -326,7 +326,7 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx,
int needed_len;
int mem_size;
IPADBG_LOW("processing type %d hdr_hdl %d\n",
IPADBG_LOW("Add processing type %d hdr_hdl %d\n",
proc_ctx->type, proc_ctx->hdr_hdl);
if (!HDR_PROC_TYPE_IS_VALID(proc_ctx->type)) {
@ -335,10 +335,17 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx,
}
hdr_entry = ipa3_id_find(proc_ctx->hdr_hdl);
if (!hdr_entry || (hdr_entry->cookie != IPA_COOKIE)) {
if (!hdr_entry) {
IPAERR("hdr_hdl is invalid\n");
return -EINVAL;
}
if (hdr_entry->cookie != IPA_COOKIE) {
IPAERR("Invalid header cookie %u\n", hdr_entry->cookie);
WARN_ON(1);
return -EINVAL;
}
IPADBG("Associated header is name=%s is_hdr_proc_ctx=%d\n",
hdr_entry->name, hdr_entry->is_hdr_proc_ctx);
entry = kmem_cache_zalloc(ipa3_ctx->hdr_proc_ctx_cache, GFP_KERNEL);
if (!entry) {
@ -403,7 +410,7 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx,
entry->offset_entry = offset;
list_add(&entry->link, &htbl->head_proc_ctx_entry_list);
htbl->proc_ctx_cnt++;
IPADBG_LOW("add proc ctx of sz=%d cnt=%d ofst=%d\n", needed_len,
IPADBG("add proc ctx of sz=%d cnt=%d ofst=%d\n", needed_len,
htbl->proc_ctx_cnt, offset->offset);
id = ipa3_id_alloc(entry);
@ -520,12 +527,12 @@ static int __ipa_add_hdr(struct ipa_hdr_add *hdr)
list_add(&entry->link, &htbl->head_hdr_entry_list);
htbl->hdr_cnt++;
if (entry->is_hdr_proc_ctx)
IPADBG_LOW("add hdr of sz=%d hdr_cnt=%d phys_base=%pa\n",
IPADBG("add hdr of sz=%d hdr_cnt=%d phys_base=%pa\n",
hdr->hdr_len,
htbl->hdr_cnt,
&entry->phys_base);
else
IPADBG_LOW("add hdr of sz=%d hdr_cnt=%d ofst=%d\n",
IPADBG("add hdr of sz=%d hdr_cnt=%d ofst=%d\n",
hdr->hdr_len,
htbl->hdr_cnt,
entry->offset_entry->offset);
@ -580,7 +587,7 @@ static int __ipa3_del_hdr_proc_ctx(u32 proc_ctx_hdl, bool release_hdr)
return -EINVAL;
}
IPADBG("del ctx proc cnt=%d ofst=%d\n",
IPADBG("del proc ctx cnt=%d ofst=%d\n",
htbl->proc_ctx_cnt, entry->offset_entry->offset);
if (--entry->ref_cnt) {
@ -624,11 +631,12 @@ int __ipa3_del_hdr(u32 hdr_hdl)
}
if (entry->is_hdr_proc_ctx)
IPADBG("del hdr of sz=%d hdr_cnt=%d phys_base=%pa\n",
IPADBG("del hdr of len=%d hdr_cnt=%d phys_base=%pa\n",
entry->hdr_len, htbl->hdr_cnt, &entry->phys_base);
else
IPADBG("del hdr of sz=%d hdr_cnt=%d ofst=%d\n", entry->hdr_len,
htbl->hdr_cnt, entry->offset_entry->offset);
IPADBG("del hdr of len=%d hdr_cnt=%d ofst=%d\n",
entry->hdr_len, htbl->hdr_cnt,
entry->offset_entry->offset);
if (--entry->ref_cnt) {
IPADBG("hdr_hdl %x ref_cnt %d\n", hdr_hdl, entry->ref_cnt);

View file

@ -1210,8 +1210,9 @@ int __ipa3_del_rt_rule(u32 rule_hdl)
__ipa3_release_hdr_proc_ctx(entry->proc_ctx->id);
list_del(&entry->link);
entry->tbl->rule_cnt--;
IPADBG("del rt rule tbl_idx=%d rule_cnt=%d rule_id=%d\n",
entry->tbl->idx, entry->tbl->rule_cnt, entry->rule_id);
IPADBG("del rt rule tbl_idx=%d rule_cnt=%d rule_id=%d\n ref_cnt=%u",
entry->tbl->idx, entry->tbl->rule_cnt,
entry->rule_id, entry->tbl->ref_cnt);
idr_remove(&entry->tbl->rule_ids, entry->rule_id);
if (entry->tbl->rule_cnt == 0 && entry->tbl->ref_cnt == 0) {
if (__ipa_del_rt_tbl(entry->tbl))
@ -1488,6 +1489,8 @@ int ipa3_put_rt_tbl(u32 rt_tbl_hdl)
entry->ref_cnt--;
if (entry->ref_cnt == 0 && entry->rule_cnt == 0) {
IPADBG("zero ref_cnt, delete rt tbl (idx=%u)\n",
entry->idx);
if (__ipa_del_rt_tbl(entry))
IPAERR("fail to del RT tbl\n");
/* commit for put */

View file

@ -1222,9 +1222,9 @@ int ipahal_cp_proc_ctx_to_hw_buff(enum ipa_hdr_proc_type type,
if (!base ||
!hdr_len ||
(!phys_base && !hdr_base_addr) ||
!hdr_base_addr ||
((is_hdr_proc_ctx == false) && !offset_entry)) {
(is_hdr_proc_ctx && !phys_base) ||
(!is_hdr_proc_ctx && !offset_entry) ||
(!is_hdr_proc_ctx && !hdr_base_addr)) {
IPAHAL_ERR(
"invalid input: hdr_len:%u phys_base:%pad hdr_base_addr:%u is_hdr_proc_ctx:%d offset_entry:%pK\n"
, hdr_len, &phys_base, hdr_base_addr