[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMZdPi9KAoDsgoDWk02ofcoeBEGSZhrO1qSgF3fgLKFSXnS7og@mail.gmail.com>
Date: Sun, 2 Oct 2022 15:38:47 +0200
From: Loic Poulain <loic.poulain@...aro.org>
To: m.chetan.kumar@...ux.intel.com
Cc: netdev@...r.kernel.org, kuba@...nel.org, davem@...emloft.net,
johannes@...solutions.net, ryazanov.s.a@...il.com,
krishna.c.sudi@...el.com, linuxwwan@...el.com,
Moises Veleta <moises.veleta@...ux.intel.com>,
Devegowda Chandrashekar <chandrashekar.devegowda@...el.com>,
Ricardo Martinez <ricardo.martinez@...ux.intel.com>
Subject: Re: [PATCH V2 net-next] net: wwan: t7xx: Add port for modem logging
On Fri, 30 Sept 2022 at 15:55, <m.chetan.kumar@...ux.intel.com> wrote:
>
> From: Moises Veleta <moises.veleta@...ux.intel.com>
>
> The Modem Logging (MDL) port provides an interface to collect modem
> logs for debugging purposes. MDL is supported by the relay interface,
> and the mtk_t7xx port infrastructure. MDL allows user-space apps to
> control logging via mbim command and to collect logs via the relay
> interface, while port infrastructure facilitates communication between
> the driver and the modem.
>
> Signed-off-by: Moises Veleta <moises.veleta@...ux.intel.com>
> Signed-off-by: M Chetan Kumar <m.chetan.kumar@...ux.intel.com>
> Signed-off-by: Devegowda Chandrashekar <chandrashekar.devegowda@...el.com>
> Acked-by: Ricardo Martinez <ricardo.martinez@...ux.intel.com>
> --
> v2
> * Removed debugfs control port.
> * Initialize in Notify function upon handshake completion.
> * Remove trace write function, MBIM will send commands.
> ---
> drivers/net/wwan/Kconfig | 1 +
> drivers/net/wwan/t7xx/Makefile | 3 +
> drivers/net/wwan/t7xx/t7xx_hif_cldma.c | 2 +
> drivers/net/wwan/t7xx/t7xx_port.h | 5 ++
> drivers/net/wwan/t7xx/t7xx_port_proxy.c | 12 +++
> drivers/net/wwan/t7xx/t7xx_port_proxy.h | 4 +
> drivers/net/wwan/t7xx/t7xx_port_trace.c | 112 ++++++++++++++++++++++++
> 7 files changed, 139 insertions(+)
> create mode 100644 drivers/net/wwan/t7xx/t7xx_port_trace.c
>
[...]
> +
> +static void t7xx_port_trace_md_state_notify(struct t7xx_port *port, unsigned int state)
> +{
> + struct rchan *relaych;
> +
> + if (state != MD_STATE_READY || port->relaych)
> + return;
> +
> + port->debugfs_wwan_dir = wwan_get_debugfs_dir(port->dev);
> + if (IS_ERR(port->debugfs_wwan_dir))
> + port->debugfs_wwan_dir = NULL;
Why continuing here despite the error? Is it a possible valid scenario?
> +
> + port->debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, port->debugfs_wwan_dir);
> + if (IS_ERR_OR_NULL(port->debugfs_dir)) {
> + wwan_put_debugfs_dir(port->debugfs_wwan_dir);
port->debugfs_wwan_dir can be NULL here...
> + dev_err(port->dev, "Unable to create debugfs for trace");
> + return;
> + }
> +
> + relaych = relay_open("relay_ch", port->debugfs_dir, T7XX_TRC_SUB_BUFF_SIZE,
> + T7XX_TRC_N_SUB_BUFF, &relay_callbacks, NULL);
> + if (!relaych)
> + goto err_rm_debugfs_dir;
> +
> + port->relaych = relaych;
> + return;
> +
> +err_rm_debugfs_dir:
> + debugfs_remove_recursive(port->debugfs_dir);
> + wwan_put_debugfs_dir(port->debugfs_wwan_dir);
same here.
> + dev_err(port->dev, "Unable to create trace port %s", port->port_conf->name);
> +}
> +
> +struct port_ops t7xx_trace_port_ops = {
> + .recv_skb = t7xx_trace_port_recv_skb,
> + .uninit = t7xx_trace_port_uninit,
> + .md_state_notify = t7xx_port_trace_md_state_notify,
> +};
> --
> 2.34.1
>
Powered by blists - more mailing lists