From 6cdcc3b5abd871d6e487c5b90391c0c4dcd729c8 Mon Sep 17 00:00:00 2001 From: Ilia Lin Date: Thu, 6 Aug 2020 15:25:30 +0300 Subject: [PATCH] ipa: Fix debugfs tethering stats print Currently the ipa_debugfs_print_tethering_stats() prints values from zeroed buffer. The ipa_get_teth_stats() has to be called only once, and ipa_query_teth_stats() to fill the buffer. Change-Id: I72e6db3c9f2c342e8b635341eee06795b2be9d67 Signed-off-by: Ilia Lin --- drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c b/drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c index f3a629d6240a..572ef8c9c376 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c @@ -1971,6 +1971,14 @@ static ssize_t ipa_debugfs_print_tethering_stats(struct file *file, return -ENOMEM; mutex_lock(&ipa3_ctx->lock); + + res = ipa_get_teth_stats(); + if (res) { + mutex_unlock(&ipa3_ctx->lock); + kfree(out); + return res; + } + for (i = 0; i < IPA_CLIENT_MAX; i++) { int ep_idx = ipa3_get_ep_mapping(i); @@ -1987,7 +1995,7 @@ static ssize_t ipa_debugfs_print_tethering_stats(struct file *file, (1 << ep_idx))) continue; - res = ipa_get_teth_stats(); + res = ipa_query_teth_stats(i, out, false); if (res) { mutex_unlock(&ipa3_ctx->lock); kfree(out);