net: wwan: iosm: bug fixes
Subsystems (4)
cover net: wwan: iosm: bug fixes
This patch series brings in IOSM driver bug fixes. Patch details are explained below.
PATCH1:
* stop sending unnecessary doorbell in IP tx flow.
PATCH2:
* Restore the IP channel configuration after fw flash.
PATCH3:
* Removed the unnecessary check around control port TX transfer.
M Chetan Kumar (3):
net: wwan: iosm: fixes unnecessary doorbell send
net: wwan: iosm: fixes net interface nonfunctional after fw flash
net: wwan: iosm: fixes unable to send AT command during mbim tx
drivers/net/wwan/iosm/iosm_ipc_imem.c | 26 +++++++++++++++-------- drivers/net/wwan/iosm/iosm_ipc_imem.h | 4 +--- drivers/net/wwan/iosm/iosm_ipc_imem_ops.c | 7 +----- 3 files changed, 19 insertions(+), 18 deletions(-)
--
2.25.1
PATCH 1/3 net: wwan: iosm: fixes unnecessary doorbell send
In TX packet accumulation flow transport layer is giving a doorbell to device even though there is no pending control TX transfer that needs immediate attention.
Introduced a new hpda_ctrl_pending variable to keep track of pending control TX transfer. If there is a pending control TX transfer which needs an immediate attention only then give a doorbell to device.
--- drivers/net/wwan/iosm/iosm_ipc_imem.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/net/wwan/iosm/iosm_ipc_imem.c +11 -7
@@ -181,9 +181,9 @@ void ipc_imem_hrtimer_stop(struct hrtimer *hr_timer)bool ipc_imem_ul_write_td (struct iosm_imem *ipc_imem) {struct ipc_mem_channel *channel; +bool hpda_ctrl_pending = false;struct sk_buff_head *ul_list;bool hpda_pending = false; -bool forced_hpdu = false;struct ipc_pipe *pipe;int i;
@@ -200,15 +200,19 @@ bool ipc_imem_ul_write_td(struct iosm_imem *ipc_imem) ul_list = &channel->ul_list;/* Fill the transfer descriptor with the uplink buffer info. */ - hpda_pending |=ipc_protocol_ul_td_send (ipc_imem->ipc_protocol, +if (!ipc_imem_check_wwan_ips (channel)) { + hpda_ctrl_pending |= +ipc_protocol_ul_td_send (ipc_imem->ipc_protocol, pipe, ul_list); - -/* forced HP update needed for non data channels */ -if (hpda_pending && !ipc_imem_check_wwan_ips (channel)) - forced_hpdu = true; + }else { + hpda_pending |= +ipc_protocol_ul_td_send (ipc_imem->ipc_protocol, + pipe, ul_list); + } } -if (forced_hpdu) { +/* forced HP update needed for non data channels */ +if (hpda_ctrl_pending) { hpda_pending = false;ipc_protocol_doorbell_trigger (ipc_imem->ipc_protocol,IPC_HP_UL_WRITE_TD );
Signature · 1 line
2.25.1
PATCH 2/3 net: wwan: iosm: fixes net interface nonfunctional after fw flash
In reply to M Chetan KumarDevlink 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.
--- 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(-)
drivers/net/wwan/iosm/iosm_ipc_imem.c +6 -1
@@ -531,6 +531,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);
@@ -1171,7 +1174,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);
@@ -1335,6 +1338,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:
drivers/net/wwan/iosm/iosm_ipc_imem.h +1 -0
@@ -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 {
drivers/net/wwan/iosm/iosm_ipc_imem_ops.c +1 -0
@@ -450,6 +450,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,
Signature · 1 line
2.25.1
PATCH 3/3 net: wwan: iosm: fixes unable to send AT command during mbim tx
In reply to M Chetan Kumarev_cdev_write_pending flag is preventing a TX message post for AT port while MBIM transfer is ongoing.
Removed the unnecessary check around control port TX transfer.
--- drivers/net/wwan/iosm/iosm_ipc_imem.c | 1 - drivers/net/wwan/iosm/iosm_ipc_imem.h | 3 --- drivers/net/wwan/iosm/iosm_ipc_imem_ops.c | 6 ------ 3 files changed, 10 deletions(-)
drivers/net/wwan/iosm/iosm_ipc_imem.c +0 -1
@@ -1270,7 +1270,6 @@ struct iosm_imem *ipc_imem_init(struct iosm_pcie *pcie, unsigned int device_id, ipc_imem->pci_device_id = device_id; - ipc_imem->ev_cdev_write_pending = false; ipc_imem->cp_version =0 ; ipc_imem->device_sleep =IPC_HOST_SLEEP_ENTER_SLEEP ;
drivers/net/wwan/iosm/iosm_ipc_imem.h +0 -3
@@ -336,8 +336,6 @@ enum ipc_phase {* process the irq actions. * @flag: Flag to monitor the state of driver * @td_update_timer_suspended: if true then td update timer suspend -* @ev_cdev_write_pending: 0 means inform the IPC tasklet to pass -* the accumulated uplink buffers to CP. * @ev_mux_net_transmit_pending:0 means inform the IPC tasklet to pass * @reset_det_n: Reset detect flag * @pcie_wake_n: Pcie wake flag
@@ -375,7 +373,6 @@ struct iosm_imem {u8 ev_irq_pending[IPC_IRQ_VECTORS ];unsigned long flag; u8 td_update_timer_suspended:1, - ev_cdev_write_pending:1, ev_mux_net_transmit_pending:1, reset_det_n:1, pcie_wake_n:1;
drivers/net/wwan/iosm/iosm_ipc_imem_ops.c +0 -6
@@ -41,7 +41,6 @@ void ipc_imem_sys_wwan_close(struct iosm_imem *ipc_imem, int if_id,static int ipc_imem_tq_cdev_write (struct iosm_imem *ipc_imem,int arg,void *msg,size_t size) { - ipc_imem->ev_cdev_write_pending = false;ipc_imem_ul_send (ipc_imem);return 0 ;
@@ -50,11 +49,6 @@ static int ipc_imem_tq_cdev_write(struct iosm_imem *ipc_imem, int arg,/* Through tasklet to do sio write. */ static int ipc_imem_call_cdev_write (struct iosm_imem *ipc_imem) { -if (ipc_imem->ev_cdev_write_pending) -return -1 ; - - ipc_imem->ev_cdev_write_pending = true; -return ipc_task_queue_send_task (ipc_imem, ipc_imem_tq_cdev_write,0 ,NULL ,0 , false); }
Signature · 1 line
2.25.1
This series was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Thu, 9 Dec 2021 15:46:26 +0530 you wrote:
This patch series brings in IOSM driver bug fixes. Patch details are explained below.
PATCH1:
* stop sending unnecessary doorbell in IP tx flow.
PATCH2:
* Restore the IP channel configuration after fw flash.
PATCH3:
* Removed the unnecessary check around control port TX transfer.[...]
Here is the summary with links:
- [net,1/3] net: wwan: iosm: fixes unnecessary doorbell send
https://git.kernel.org/netdev/net/c/373f121a3c3a - [net,2/3] net: wwan: iosm: fixes net interface nonfunctional after fw flash https://git.kernel.org/netdev/net/c/07d3f2743dec - [net,3/3] net: wwan: iosm: fixes unable to send AT command during mbim tx https://git.kernel.org/netdev/net/c/383451ceb078
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html