瀏覽代碼

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 <[email protected]>
Ilia Lin 4 年之前
父節點
當前提交
6cdcc3b5ab
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c

+ 9 - 1
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);