Skip to content

Commit 07d3f27

Browse files
mchetankumarkuba-moo
authored andcommitted
net: wwan: iosm: fixes net interface nonfunctional after fw flash
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 <[email protected]> Reviewed-by: Sergey Ryazanov <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 373f121 commit 07d3f27

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

drivers/net/wwan/iosm/iosm_ipc_imem.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,9 @@ static void ipc_imem_run_state_worker(struct work_struct *instance)
531531
return;
532532
}
533533

534+
if (test_and_clear_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag))
535+
ipc_devlink_deinit(ipc_imem->ipc_devlink);
536+
534537
if (!ipc_imem_setup_cp_mux_cap_init(ipc_imem, &mux_cfg))
535538
ipc_imem->mux = ipc_mux_init(&mux_cfg, ipc_imem);
536539

@@ -1171,7 +1174,7 @@ void ipc_imem_cleanup(struct iosm_imem *ipc_imem)
11711174
ipc_port_deinit(ipc_imem->ipc_port);
11721175
}
11731176

1174-
if (ipc_imem->ipc_devlink)
1177+
if (test_and_clear_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag))
11751178
ipc_devlink_deinit(ipc_imem->ipc_devlink);
11761179

11771180
ipc_imem_device_ipc_uninit(ipc_imem);
@@ -1335,6 +1338,8 @@ struct iosm_imem *ipc_imem_init(struct iosm_pcie *pcie, unsigned int device_id,
13351338

13361339
if (ipc_flash_link_establish(ipc_imem))
13371340
goto devlink_channel_fail;
1341+
1342+
set_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag);
13381343
}
13391344
return ipc_imem;
13401345
devlink_channel_fail:

drivers/net/wwan/iosm/iosm_ipc_imem.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ struct ipc_chnl_cfg;
101101
#define IOSM_CHIP_INFO_SIZE_MAX 100
102102

103103
#define FULLY_FUNCTIONAL 0
104+
#define IOSM_DEVLINK_INIT 1
104105

105106
/* List of the supported UL/DL pipes. */
106107
enum ipc_mem_pipes {

drivers/net/wwan/iosm/iosm_ipc_imem_ops.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ void ipc_imem_sys_devlink_close(struct iosm_devlink *ipc_devlink)
450450
/* Release the pipe resources */
451451
ipc_imem_pipe_cleanup(ipc_imem, &channel->ul_pipe);
452452
ipc_imem_pipe_cleanup(ipc_imem, &channel->dl_pipe);
453+
ipc_imem->nr_of_channels--;
453454
}
454455

455456
void ipc_imem_sys_devlink_notify_rx(struct iosm_devlink *ipc_devlink,

0 commit comments

Comments
 (0)