diff options
author | Mordechay Goodstein <mordechay.goodstein@intel.com> | 2017-09-26 07:31:55 -0400 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2017-12-20 11:28:24 -0500 |
commit | 93b167c13a3afa389eaa1af277e94add976ea43f (patch) | |
tree | c875febae2e629d2dbd58085d2a8e69725a26ce3 | |
parent | 22b2104193da5edab4189d0357418d8e151082eb (diff) |
iwlwifi: runtime: sync FW and host clocks for logs
For sync we send a marker cmd every <defined throughout debugfs> seconds.
The trigger for getting gp2 clock values from the FW is set by
writing to debugfs a periodic time in seconds,
if value zero is written, only one request would be sent
and the timer would be canceled.
Also added a small infrastructure for debugfs runtime code.
Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/Makefile | 1 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/api/debug.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/debugfs.c | 195 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/debugfs.h | 87 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/init.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/runtime.h | 14 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 6 |
7 files changed, 313 insertions, 7 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/Makefile b/drivers/net/wireless/intel/iwlwifi/Makefile index e2c151ae8649..e6205eae51fd 100644 --- a/drivers/net/wireless/intel/iwlwifi/Makefile +++ b/drivers/net/wireless/intel/iwlwifi/Makefile | |||
@@ -15,6 +15,7 @@ iwlwifi-objs += fw/notif-wait.o | |||
15 | iwlwifi-$(CONFIG_IWLMVM) += fw/paging.o fw/smem.o fw/init.o fw/dbg.o | 15 | iwlwifi-$(CONFIG_IWLMVM) += fw/paging.o fw/smem.o fw/init.o fw/dbg.o |
16 | iwlwifi-$(CONFIG_IWLMVM) += fw/common_rx.o fw/nvm.o | 16 | iwlwifi-$(CONFIG_IWLMVM) += fw/common_rx.o fw/nvm.o |
17 | iwlwifi-$(CONFIG_ACPI) += fw/acpi.o | 17 | iwlwifi-$(CONFIG_ACPI) += fw/acpi.o |
18 | iwlwifi-$(CONFIG_IWLWIFI_DEBUGFS) += fw/debugfs.o | ||
18 | 19 | ||
19 | iwlwifi-objs += $(iwlwifi-m) | 20 | iwlwifi-objs += $(iwlwifi-m) |
20 | 21 | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h b/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h index 0a81fb1b6ed4..106782341544 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h | |||
@@ -250,10 +250,12 @@ struct iwl_mfu_assert_dump_notif { | |||
250 | * The ids for different type of markers to insert into the usniffer logs | 250 | * The ids for different type of markers to insert into the usniffer logs |
251 | * | 251 | * |
252 | * @MARKER_ID_TX_FRAME_LATENCY: TX latency marker | 252 | * @MARKER_ID_TX_FRAME_LATENCY: TX latency marker |
253 | * @MARKER_ID_SYNC_CLOCK: sync FW time and systime | ||
253 | */ | 254 | */ |
254 | enum iwl_mvm_marker_id { | 255 | enum iwl_mvm_marker_id { |
255 | MARKER_ID_TX_FRAME_LATENCY = 1, | 256 | MARKER_ID_TX_FRAME_LATENCY = 1, |
256 | }; /* MARKER_ID_API_E_VER_1 */ | 257 | MARKER_ID_SYNC_CLOCK = 2, |
258 | }; /* MARKER_ID_API_E_VER_2 */ | ||
257 | 259 | ||
258 | /** | 260 | /** |
259 | * struct iwl_mvm_marker - mark info into the usniffer logs | 261 | * struct iwl_mvm_marker - mark info into the usniffer logs |
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c new file mode 100644 index 000000000000..e2ded29a145d --- /dev/null +++ b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c | |||
@@ -0,0 +1,195 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
4 | * redistributing this file, you may do so under either license. | ||
5 | * | ||
6 | * GPL LICENSE SUMMARY | ||
7 | * | ||
8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | ||
9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | ||
10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of version 2 of the GNU General Public License as | ||
14 | * published by the Free Software Foundation. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, but | ||
17 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
19 | * General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program. | ||
23 | * | ||
24 | * The full GNU General Public License is included in this distribution | ||
25 | * in the file called COPYING. | ||
26 | * | ||
27 | * Contact Information: | ||
28 | * Intel Linux Wireless <linuxwifi@intel.com> | ||
29 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
30 | * | ||
31 | * BSD LICENSE | ||
32 | * | ||
33 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | ||
34 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | ||
35 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | ||
36 | * All rights reserved. | ||
37 | * | ||
38 | * Redistribution and use in source and binary forms, with or without | ||
39 | * modification, are permitted provided that the following conditions | ||
40 | * are met: | ||
41 | * | ||
42 | * * Redistributions of source code must retain the above copyright | ||
43 | * notice, this list of conditions and the following disclaimer. | ||
44 | * * Redistributions in binary form must reproduce the above copyright | ||
45 | * notice, this list of conditions and the following disclaimer in | ||
46 | * the documentation and/or other materials provided with the | ||
47 | * distribution. | ||
48 | * * Neither the name Intel Corporation nor the names of its | ||
49 | * contributors may be used to endorse or promote products derived | ||
50 | * from this software without specific prior written permission. | ||
51 | * | ||
52 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
53 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
54 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
55 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
56 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
57 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
58 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
59 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
60 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
61 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
62 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
63 | * | ||
64 | *****************************************************************************/ | ||
65 | #include "api/commands.h" | ||
66 | #include "debugfs.h" | ||
67 | |||
68 | #define FWRT_DEBUGFS_READ_FILE_OPS(name) \ | ||
69 | static ssize_t iwl_dbgfs_##name##_read(struct iwl_fw_runtime *fwrt, \ | ||
70 | char *buf, size_t count, \ | ||
71 | loff_t *ppos); \ | ||
72 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ | ||
73 | .read = iwl_dbgfs_##name##_read, \ | ||
74 | .open = simple_open, \ | ||
75 | .llseek = generic_file_llseek, \ | ||
76 | } | ||
77 | |||
78 | #define FWRT_DEBUGFS_WRITE_WRAPPER(name, buflen) \ | ||
79 | static ssize_t iwl_dbgfs_##name##_write(struct iwl_fw_runtime *fwrt, \ | ||
80 | char *buf, size_t count, \ | ||
81 | loff_t *ppos); \ | ||
82 | static ssize_t _iwl_dbgfs_##name##_write(struct file *file, \ | ||
83 | const char __user *user_buf, \ | ||
84 | size_t count, loff_t *ppos) \ | ||
85 | { \ | ||
86 | struct iwl_fw_runtime *fwrt = file->private_data; \ | ||
87 | char buf[buflen] = {}; \ | ||
88 | size_t buf_size = min(count, sizeof(buf) - 1); \ | ||
89 | \ | ||
90 | if (copy_from_user(buf, user_buf, buf_size)) \ | ||
91 | return -EFAULT; \ | ||
92 | \ | ||
93 | return iwl_dbgfs_##name##_write(fwrt, buf, buf_size, ppos); \ | ||
94 | } | ||
95 | |||
96 | #define FWRT_DEBUGFS_READ_WRITE_FILE_OPS(name, buflen) \ | ||
97 | FWRT_DEBUGFS_WRITE_WRAPPER(name, buflen) \ | ||
98 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ | ||
99 | .write = _iwl_dbgfs_##name##_write, \ | ||
100 | .read = iwl_dbgfs_##name##_read, \ | ||
101 | .open = simple_open, \ | ||
102 | .llseek = generic_file_llseek, \ | ||
103 | } | ||
104 | |||
105 | #define FWRT_DEBUGFS_WRITE_FILE_OPS(name, buflen) \ | ||
106 | FWRT_DEBUGFS_WRITE_WRAPPER(name, buflen) \ | ||
107 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ | ||
108 | .write = _iwl_dbgfs_##name##_write, \ | ||
109 | .open = simple_open, \ | ||
110 | .llseek = generic_file_llseek, \ | ||
111 | } | ||
112 | |||
113 | #define FWRT_DEBUGFS_ADD_FILE_ALIAS(alias, name, parent, mode) do { \ | ||
114 | if (!debugfs_create_file(alias, mode, parent, fwrt, \ | ||
115 | &iwl_dbgfs_##name##_ops)) \ | ||
116 | goto err; \ | ||
117 | } while (0) | ||
118 | #define FWRT_DEBUGFS_ADD_FILE(name, parent, mode) \ | ||
119 | FWRT_DEBUGFS_ADD_FILE_ALIAS(#name, name, parent, mode) | ||
120 | |||
121 | static int iwl_fw_send_timestamp_marker_cmd(struct iwl_fw_runtime *fwrt) | ||
122 | { | ||
123 | struct iwl_mvm_marker marker = { | ||
124 | .dw_len = sizeof(struct iwl_mvm_marker) / 4, | ||
125 | .marker_id = MARKER_ID_SYNC_CLOCK, | ||
126 | |||
127 | /* the real timestamp is taken from the ftrace clock | ||
128 | * this is for finding the match between fw and kernel logs | ||
129 | */ | ||
130 | .timestamp = cpu_to_le64(fwrt->timestamp.seq++), | ||
131 | }; | ||
132 | |||
133 | struct iwl_host_cmd hcmd = { | ||
134 | .id = MARKER_CMD, | ||
135 | .flags = CMD_ASYNC, | ||
136 | .data[0] = &marker, | ||
137 | .len[0] = sizeof(marker), | ||
138 | }; | ||
139 | |||
140 | return iwl_trans_send_cmd(fwrt->trans, &hcmd); | ||
141 | } | ||
142 | |||
143 | static void iwl_fw_timestamp_marker_wk(struct work_struct *work) | ||
144 | { | ||
145 | int ret; | ||
146 | struct iwl_fw_runtime *fwrt = | ||
147 | container_of(work, struct iwl_fw_runtime, timestamp.wk.work); | ||
148 | unsigned long delay = fwrt->timestamp.delay; | ||
149 | |||
150 | ret = iwl_fw_send_timestamp_marker_cmd(fwrt); | ||
151 | if (!ret && delay) | ||
152 | schedule_delayed_work(&fwrt->timestamp.wk, | ||
153 | round_jiffies_relative(delay)); | ||
154 | else | ||
155 | IWL_INFO(fwrt, | ||
156 | "stopping timestamp_marker, ret: %d, delay: %u\n", | ||
157 | ret, jiffies_to_msecs(delay) / 1000); | ||
158 | } | ||
159 | |||
160 | static ssize_t iwl_dbgfs_timestamp_marker_write(struct iwl_fw_runtime *fwrt, | ||
161 | char *buf, size_t count, | ||
162 | loff_t *ppos) | ||
163 | { | ||
164 | int ret; | ||
165 | u32 delay; | ||
166 | |||
167 | ret = kstrtou32(buf, 10, &delay); | ||
168 | if (ret < 0) | ||
169 | return ret; | ||
170 | |||
171 | IWL_INFO(fwrt, | ||
172 | "starting timestamp_marker trigger with delay: %us\n", | ||
173 | delay); | ||
174 | |||
175 | iwl_fw_cancel_timestamp(fwrt); | ||
176 | |||
177 | fwrt->timestamp.delay = msecs_to_jiffies(delay * 1000); | ||
178 | |||
179 | schedule_delayed_work(&fwrt->timestamp.wk, | ||
180 | round_jiffies_relative(fwrt->timestamp.delay)); | ||
181 | return count; | ||
182 | } | ||
183 | |||
184 | FWRT_DEBUGFS_WRITE_FILE_OPS(timestamp_marker, 10); | ||
185 | |||
186 | int iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt, | ||
187 | struct dentry *dbgfs_dir) | ||
188 | { | ||
189 | INIT_DELAYED_WORK(&fwrt->timestamp.wk, iwl_fw_timestamp_marker_wk); | ||
190 | FWRT_DEBUGFS_ADD_FILE(timestamp_marker, dbgfs_dir, S_IWUSR); | ||
191 | return 0; | ||
192 | err: | ||
193 | IWL_ERR(fwrt, "Can't create the fwrt debugfs directory\n"); | ||
194 | return -ENOMEM; | ||
195 | } | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/debugfs.h b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.h new file mode 100644 index 000000000000..e57ff92a68ae --- /dev/null +++ b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.h | |||
@@ -0,0 +1,87 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
4 | * redistributing this file, you may do so under either license. | ||
5 | * | ||
6 | * GPL LICENSE SUMMARY | ||
7 | * | ||
8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | ||
9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | ||
10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of version 2 of the GNU General Public License as | ||
14 | * published by the Free Software Foundation. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, but | ||
17 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
19 | * General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program. | ||
23 | * | ||
24 | * The full GNU General Public License is included in this distribution | ||
25 | * in the file called COPYING. | ||
26 | * | ||
27 | * Contact Information: | ||
28 | * Intel Linux Wireless <linuxwifi@intel.com> | ||
29 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
30 | * | ||
31 | * BSD LICENSE | ||
32 | * | ||
33 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | ||
34 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | ||
35 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | ||
36 | * All rights reserved. | ||
37 | * | ||
38 | * Redistribution and use in source and binary forms, with or without | ||
39 | * modification, are permitted provided that the following conditions | ||
40 | * are met: | ||
41 | * | ||
42 | * * Redistributions of source code must retain the above copyright | ||
43 | * notice, this list of conditions and the following disclaimer. | ||
44 | * * Redistributions in binary form must reproduce the above copyright | ||
45 | * notice, this list of conditions and the following disclaimer in | ||
46 | * the documentation and/or other materials provided with the | ||
47 | * distribution. | ||
48 | * * Neither the name Intel Corporation nor the names of its | ||
49 | * contributors may be used to endorse or promote products derived | ||
50 | * from this software without specific prior written permission. | ||
51 | * | ||
52 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
53 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
54 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
55 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
56 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
57 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
58 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
59 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
60 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
61 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
62 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
63 | * | ||
64 | *****************************************************************************/ | ||
65 | |||
66 | #include "runtime.h" | ||
67 | |||
68 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
69 | int iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt, | ||
70 | struct dentry *dbgfs_dir); | ||
71 | |||
72 | static inline void iwl_fw_cancel_timestamp(struct iwl_fw_runtime *fwrt) | ||
73 | { | ||
74 | fwrt->timestamp.delay = 0; | ||
75 | cancel_delayed_work_sync(&fwrt->timestamp.wk); | ||
76 | } | ||
77 | |||
78 | #else | ||
79 | static inline int iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt, | ||
80 | struct dentry *dbgfs_dir) | ||
81 | { | ||
82 | return 0; | ||
83 | } | ||
84 | |||
85 | static inline void iwl_fw_cancel_timestamp(struct iwl_fw_runtime *fwrt) {} | ||
86 | |||
87 | #endif /* CONFIG_IWLWIFI_DEBUGFS */ | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/init.c b/drivers/net/wireless/intel/iwlwifi/fw/init.c index bfe5316bbb6a..c39fe84bb4c4 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/init.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/init.c | |||
@@ -58,10 +58,12 @@ | |||
58 | #include "iwl-drv.h" | 58 | #include "iwl-drv.h" |
59 | #include "runtime.h" | 59 | #include "runtime.h" |
60 | #include "dbg.h" | 60 | #include "dbg.h" |
61 | #include "debugfs.h" | ||
61 | 62 | ||
62 | void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, | 63 | void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, |
63 | const struct iwl_fw *fw, | 64 | const struct iwl_fw *fw, |
64 | const struct iwl_fw_runtime_ops *ops, void *ops_ctx) | 65 | const struct iwl_fw_runtime_ops *ops, void *ops_ctx, |
66 | struct dentry *dbgfs_dir) | ||
65 | { | 67 | { |
66 | memset(fwrt, 0, sizeof(*fwrt)); | 68 | memset(fwrt, 0, sizeof(*fwrt)); |
67 | fwrt->trans = trans; | 69 | fwrt->trans = trans; |
@@ -71,5 +73,12 @@ void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, | |||
71 | fwrt->ops = ops; | 73 | fwrt->ops = ops; |
72 | fwrt->ops_ctx = ops_ctx; | 74 | fwrt->ops_ctx = ops_ctx; |
73 | INIT_DELAYED_WORK(&fwrt->dump.wk, iwl_fw_error_dump_wk); | 75 | INIT_DELAYED_WORK(&fwrt->dump.wk, iwl_fw_error_dump_wk); |
76 | iwl_fwrt_dbgfs_register(fwrt, dbgfs_dir); | ||
74 | } | 77 | } |
75 | IWL_EXPORT_SYMBOL(iwl_fw_runtime_init); | 78 | IWL_EXPORT_SYMBOL(iwl_fw_runtime_init); |
79 | |||
80 | void iwl_fw_runtime_exit(struct iwl_fw_runtime *fwrt) | ||
81 | { | ||
82 | iwl_fw_cancel_timestamp(fwrt); | ||
83 | } | ||
84 | IWL_EXPORT_SYMBOL(iwl_fw_runtime_exit); | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h index 50cfb6d795a5..e25c049f980f 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h | |||
@@ -134,11 +134,21 @@ struct iwl_fw_runtime { | |||
134 | /* ts of the beginning of a non-collect fw dbg data period */ | 134 | /* ts of the beginning of a non-collect fw dbg data period */ |
135 | unsigned long non_collect_ts_start[FW_DBG_TRIGGER_MAX - 1]; | 135 | unsigned long non_collect_ts_start[FW_DBG_TRIGGER_MAX - 1]; |
136 | } dump; | 136 | } dump; |
137 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
138 | struct { | ||
139 | struct delayed_work wk; | ||
140 | u32 delay; | ||
141 | u64 seq; | ||
142 | } timestamp; | ||
143 | #endif /* CONFIG_IWLWIFI_DEBUGFS */ | ||
137 | }; | 144 | }; |
138 | 145 | ||
139 | void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, | 146 | void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, |
140 | const struct iwl_fw *fw, | 147 | const struct iwl_fw *fw, |
141 | const struct iwl_fw_runtime_ops *ops, void *ops_ctx); | 148 | const struct iwl_fw_runtime_ops *ops, void *ops_ctx, |
149 | struct dentry *dbgfs_dir); | ||
150 | |||
151 | void iwl_fw_runtime_exit(struct iwl_fw_runtime *fwrt); | ||
142 | 152 | ||
143 | static inline void iwl_fw_set_current_image(struct iwl_fw_runtime *fwrt, | 153 | static inline void iwl_fw_set_current_image(struct iwl_fw_runtime *fwrt, |
144 | enum iwl_ucode_type cur_fw_img) | 154 | enum iwl_ucode_type cur_fw_img) |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index aab4aeaee58c..5d525a0023dc 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c | |||
@@ -602,7 +602,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, | |||
602 | mvm->fw = fw; | 602 | mvm->fw = fw; |
603 | mvm->hw = hw; | 603 | mvm->hw = hw; |
604 | 604 | ||
605 | iwl_fw_runtime_init(&mvm->fwrt, trans, fw, &iwl_mvm_fwrt_ops, mvm); | 605 | iwl_fw_runtime_init(&mvm->fwrt, trans, fw, &iwl_mvm_fwrt_ops, mvm, |
606 | dbgfs_dir); | ||
606 | 607 | ||
607 | mvm->init_status = 0; | 608 | mvm->init_status = 0; |
608 | 609 | ||
@@ -801,6 +802,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, | |||
801 | iwl_mvm_leds_exit(mvm); | 802 | iwl_mvm_leds_exit(mvm); |
802 | iwl_mvm_thermal_exit(mvm); | 803 | iwl_mvm_thermal_exit(mvm); |
803 | out_free: | 804 | out_free: |
805 | iwl_fw_runtime_exit(&mvm->fwrt); | ||
804 | iwl_fw_flush_dump(&mvm->fwrt); | 806 | iwl_fw_flush_dump(&mvm->fwrt); |
805 | 807 | ||
806 | if (iwlmvm_mod_params.init_dbg) | 808 | if (iwlmvm_mod_params.init_dbg) |
@@ -841,7 +843,7 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode) | |||
841 | #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_IWLWIFI_DEBUGFS) | 843 | #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_IWLWIFI_DEBUGFS) |
842 | kfree(mvm->d3_resume_sram); | 844 | kfree(mvm->d3_resume_sram); |
843 | #endif | 845 | #endif |
844 | 846 | iwl_fw_runtime_exit(&mvm->fwrt); | |
845 | iwl_trans_op_mode_leave(mvm->trans); | 847 | iwl_trans_op_mode_leave(mvm->trans); |
846 | 848 | ||
847 | iwl_phy_db_free(mvm->phy_db); | 849 | iwl_phy_db_free(mvm->phy_db); |