From: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
To: netdev@vger.kernel.org
Cc: kuba@kernel.org, davem@davemloft.net, johannes@sipsolutions.net,
ryazanov.s.a@gmail.com, loic.poulain@linaro.org,
krishna.c.sudi@intel.com, m.chetan.kumar@intel.com,
m.chetan.kumar@linux.intel.com, linuxwwan@intel.com
Subject: [PATCH V2 net-next 3/7] net: wwan: iosm: wwan0 net interface nonfunctional after fw flash
Date: Sun, 5 Dec 2021 20:34:51 +0530 [thread overview]
Message-ID: <20211205150455.1829929-4-m.chetan.kumar@linux.intel.com> (raw)
In-Reply-To: <20211205150455.1829929-1-m.chetan.kumar@linux.intel.com>
Devlink initialization flow was overwriting the IP traffic
channel configuration. This was causing wwan0 network interface
to be unusable after fw flash.
When device boots to fully functional mode restore the IP channel
configuration.
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
---
v2: No Change.
---
drivers/net/wwan/iosm/iosm_ipc_imem.c | 7 ++++++-
drivers/net/wwan/iosm/iosm_ipc_imem.h | 1 +
drivers/net/wwan/iosm/iosm_ipc_imem_ops.c | 1 +
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wwan/iosm/iosm_ipc_imem.c b/drivers/net/wwan/iosm/iosm_ipc_imem.c
index 644a871585ea..ac36f9846731 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_imem.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_imem.c
@@ -537,6 +537,9 @@ static void ipc_imem_run_state_worker(struct work_struct *instance)
return;
}
+ if (test_and_clear_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag))
+ ipc_devlink_deinit(ipc_imem->ipc_devlink);
+
if (!ipc_imem_setup_cp_mux_cap_init(ipc_imem, &mux_cfg))
ipc_imem->mux = ipc_mux_init(&mux_cfg, ipc_imem);
@@ -1184,7 +1187,7 @@ void ipc_imem_cleanup(struct iosm_imem *ipc_imem)
ipc_port_deinit(ipc_imem->ipc_port);
}
- if (ipc_imem->ipc_devlink)
+ if (test_and_clear_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag))
ipc_devlink_deinit(ipc_imem->ipc_devlink);
ipc_imem_device_ipc_uninit(ipc_imem);
@@ -1348,6 +1351,8 @@ struct iosm_imem *ipc_imem_init(struct iosm_pcie *pcie, unsigned int device_id,
if (ipc_flash_link_establish(ipc_imem))
goto devlink_channel_fail;
+
+ set_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag);
}
return ipc_imem;
devlink_channel_fail:
diff --git a/drivers/net/wwan/iosm/iosm_ipc_imem.h b/drivers/net/wwan/iosm/iosm_ipc_imem.h
index cec38009c44a..d220f2611621 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_imem.h
+++ b/drivers/net/wwan/iosm/iosm_ipc_imem.h
@@ -101,6 +101,7 @@ struct ipc_chnl_cfg;
#define IOSM_CHIP_INFO_SIZE_MAX 100
#define FULLY_FUNCTIONAL 0
+#define IOSM_DEVLINK_INIT 1
/* List of the supported UL/DL pipes. */
enum ipc_mem_pipes {
diff --git a/drivers/net/wwan/iosm/iosm_ipc_imem_ops.c b/drivers/net/wwan/iosm/iosm_ipc_imem_ops.c
index 43f1796a8984..0757fd915437 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_imem_ops.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_imem_ops.c
@@ -471,6 +471,7 @@ void ipc_imem_sys_devlink_close(struct iosm_devlink *ipc_devlink)
/* Release the pipe resources */
ipc_imem_pipe_cleanup(ipc_imem, &channel->ul_pipe);
ipc_imem_pipe_cleanup(ipc_imem, &channel->dl_pipe);
+ ipc_imem->nr_of_channels--;
}
void ipc_imem_sys_devlink_notify_rx(struct iosm_devlink *ipc_devlink,
--
2.25.1
next prev parent reply other threads:[~2021-12-05 14:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-05 15:04 [PATCH V2 net-next 0/7] net: wwan: iosm: Bug fixes M Chetan Kumar
2021-12-05 15:04 ` [PATCH V2 net-next 1/7] net: wwan: iosm: stop sending unnecessary doorbell M Chetan Kumar
2021-12-05 15:04 ` [PATCH V2 net-next 2/7] net: wwan: iosm: set tx queue len M Chetan Kumar
2021-12-05 15:04 ` M Chetan Kumar [this message]
2021-12-05 15:04 ` [PATCH V2 net-next 4/7] net: wwan: iosm: release data channel in case no active IP session M Chetan Kumar
2021-12-05 15:04 ` [PATCH V2 net-next 5/7] net: wwan: iosm: removed unused function decl M Chetan Kumar
2021-12-05 15:04 ` [PATCH V2 net-next 6/7] net: wwan: iosm: AT port is not working while MBIM TX is ongoing M Chetan Kumar
2021-12-05 15:04 ` [PATCH V2 net-next 7/7] net: wwan: iosm: correct open parenthesis alignment M Chetan Kumar
2021-12-08 5:22 ` [PATCH V2 net-next 0/7] net: wwan: iosm: Bug fixes Jakub Kicinski
2021-12-08 10:36 ` Kumar, M Chetan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211205150455.1829929-4-m.chetan.kumar@linux.intel.com \
--to=m.chetan.kumar@linux.intel.com \
--cc=davem@davemloft.net \
--cc=johannes@sipsolutions.net \
--cc=krishna.c.sudi@intel.com \
--cc=kuba@kernel.org \
--cc=linuxwwan@intel.com \
--cc=loic.poulain@linaro.org \
--cc=m.chetan.kumar@intel.com \
--cc=netdev@vger.kernel.org \
--cc=ryazanov.s.a@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).