summaryrefslogtreecommitdiff
path: root/drivers/net/wwan/iosm/iosm_ipc_imem.c
diff options
context:
space:
mode:
authorM Chetan Kumar <m.chetan.kumar@linux.intel.com>2021-11-20 19:21:55 +0300
committerDavid S. Miller <davem@davemloft.net>2021-11-22 16:23:08 +0300
commit00ef32565b9bd03c63ed944bc27878fbbc1c4e0a (patch)
tree8005f0dd0a7164b49ddb8d0c4618ca7f739a8abd /drivers/net/wwan/iosm/iosm_ipc_imem.c
parentc4804670026b93f4ebddda30af89fd737bf93931 (diff)
downloadlinux-00ef32565b9bd03c63ed944bc27878fbbc1c4e0a.tar.xz
net: wwan: iosm: device trace collection using relayfs
This patch brings in support for device trace collection. It implements relayfs interface for pushing device trace from kernel space to user space. Driver gets the debugfs base directory associated to WWAN Device and creates trace_control and trace debugfs for device tracing. Both trace_control & trace debugfs are created under /sys/kernel/debug/wwan/wwan0/. In order to collect device trace on trace0 interface, user need to write 1 to trace_ctl interface. Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wwan/iosm/iosm_ipc_imem.c')
-rw-r--r--drivers/net/wwan/iosm/iosm_ipc_imem.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wwan/iosm/iosm_ipc_imem.c b/drivers/net/wwan/iosm/iosm_ipc_imem.c
index cff3b43ca4d7..1be07114c85d 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_imem.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_imem.c
@@ -10,6 +10,7 @@
#include "iosm_ipc_flash.h"
#include "iosm_ipc_imem.h"
#include "iosm_ipc_port.h"
+#include "iosm_ipc_trace.h"
/* Check the wwan ips if it is valid with Channel as input. */
static int ipc_imem_check_wwan_ips(struct ipc_mem_channel *chnl)
@@ -265,9 +266,14 @@ static void ipc_imem_dl_skb_process(struct iosm_imem *ipc_imem,
switch (pipe->channel->ctype) {
case IPC_CTYPE_CTRL:
port_id = pipe->channel->channel_id;
+ ipc_pcie_addr_unmap(ipc_imem->pcie, IPC_CB(skb)->len,
+ IPC_CB(skb)->mapping,
+ IPC_CB(skb)->direction);
if (port_id == IPC_MEM_CTRL_CHL_ID_7)
ipc_imem_sys_devlink_notify_rx(ipc_imem->ipc_devlink,
skb);
+ else if (port_id == ipc_imem->trace->chl_id)
+ ipc_trace_port_rx(ipc_imem->trace, skb);
else
wwan_port_rx(ipc_imem->ipc_port[port_id]->iosm_port,
skb);
@@ -548,6 +554,12 @@ static void ipc_imem_run_state_worker(struct work_struct *instance)
ctrl_chl_idx++;
}
+ ipc_imem->trace = ipc_imem_trace_channel_init(ipc_imem);
+ if (!ipc_imem->trace) {
+ dev_err(ipc_imem->dev, "trace channel init failed");
+ return;
+ }
+
ipc_task_queue_send_task(ipc_imem, ipc_imem_send_mdm_rdy_cb, 0, NULL, 0,
false);
@@ -1163,6 +1175,7 @@ void ipc_imem_cleanup(struct iosm_imem *ipc_imem)
if (test_and_clear_bit(FULLY_FUNCTIONAL, &ipc_imem->flag)) {
ipc_mux_deinit(ipc_imem->mux);
+ ipc_trace_deinit(ipc_imem->trace);
ipc_wwan_deinit(ipc_imem->wwan);
ipc_port_deinit(ipc_imem->ipc_port);
}