aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/mei/debugfs.c')
-rw-r--r--drivers/misc/mei/debugfs.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
index b60b4263cf0f..b125380ee871 100644
--- a/drivers/misc/mei/debugfs.c
+++ b/drivers/misc/mei/debugfs.c
@@ -21,20 +21,22 @@
21#include <linux/mei.h> 21#include <linux/mei.h>
22 22
23#include "mei_dev.h" 23#include "mei_dev.h"
24#include "client.h"
24#include "hw.h" 25#include "hw.h"
25 26
26static ssize_t mei_dbgfs_read_meclients(struct file *fp, char __user *ubuf, 27static ssize_t mei_dbgfs_read_meclients(struct file *fp, char __user *ubuf,
27 size_t cnt, loff_t *ppos) 28 size_t cnt, loff_t *ppos)
28{ 29{
29 struct mei_device *dev = fp->private_data; 30 struct mei_device *dev = fp->private_data;
30 struct mei_me_client *me_cl; 31 struct mei_me_client *me_cl, *n;
31 size_t bufsz = 1; 32 size_t bufsz = 1;
32 char *buf; 33 char *buf;
33 int i = 0; 34 int i = 0;
34 int pos = 0; 35 int pos = 0;
35 int ret; 36 int ret;
36 37
37#define HDR " |id|fix| UUID |con|msg len|sb|\n" 38#define HDR \
39" |id|fix| UUID |con|msg len|sb|refc|\n"
38 40
39 mutex_lock(&dev->device_lock); 41 mutex_lock(&dev->device_lock);
40 42
@@ -54,16 +56,22 @@ static ssize_t mei_dbgfs_read_meclients(struct file *fp, char __user *ubuf,
54 if (dev->dev_state != MEI_DEV_ENABLED) 56 if (dev->dev_state != MEI_DEV_ENABLED)
55 goto out; 57 goto out;
56 58
57 list_for_each_entry(me_cl, &dev->me_clients, list) { 59 list_for_each_entry_safe(me_cl, n, &dev->me_clients, list) {
58 60
59 pos += scnprintf(buf + pos, bufsz - pos, 61 me_cl = mei_me_cl_get(me_cl);
60 "%2d|%2d|%3d|%pUl|%3d|%7d|%2d|\n", 62 if (me_cl) {
61 i++, me_cl->client_id, 63 pos += scnprintf(buf + pos, bufsz - pos,
62 me_cl->props.fixed_address, 64 "%2d|%2d|%3d|%pUl|%3d|%7d|%2d|%4d|\n",
63 &me_cl->props.protocol_name, 65 i++, me_cl->client_id,
64 me_cl->props.max_number_of_connections, 66 me_cl->props.fixed_address,
65 me_cl->props.max_msg_length, 67 &me_cl->props.protocol_name,
66 me_cl->props.single_recv_buf); 68 me_cl->props.max_number_of_connections,
69 me_cl->props.max_msg_length,
70 me_cl->props.single_recv_buf,
71 atomic_read(&me_cl->refcnt.refcount));
72 }
73
74 mei_me_cl_put(me_cl);
67 } 75 }
68out: 76out:
69 mutex_unlock(&dev->device_lock); 77 mutex_unlock(&dev->device_lock);