Skip to content

Commit 1996178

Browse files
committed
Merge branch 'net-wwan-iosm-bug-fixes'
M Chetan Kumar says: ==================== 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. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents e8b1d76 + 383451c commit 1996178

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

drivers/net/wwan/iosm/iosm_ipc_imem.c

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ void ipc_imem_hrtimer_stop(struct hrtimer *hr_timer)
181181
bool ipc_imem_ul_write_td(struct iosm_imem *ipc_imem)
182182
{
183183
struct ipc_mem_channel *channel;
184+
bool hpda_ctrl_pending = false;
184185
struct sk_buff_head *ul_list;
185186
bool hpda_pending = false;
186-
bool forced_hpdu = false;
187187
struct ipc_pipe *pipe;
188188
int i;
189189

@@ -200,15 +200,19 @@ bool ipc_imem_ul_write_td(struct iosm_imem *ipc_imem)
200200
ul_list = &channel->ul_list;
201201

202202
/* Fill the transfer descriptor with the uplink buffer info. */
203-
hpda_pending |= ipc_protocol_ul_td_send(ipc_imem->ipc_protocol,
203+
if (!ipc_imem_check_wwan_ips(channel)) {
204+
hpda_ctrl_pending |=
205+
ipc_protocol_ul_td_send(ipc_imem->ipc_protocol,
204206
pipe, ul_list);
205-
206-
/* forced HP update needed for non data channels */
207-
if (hpda_pending && !ipc_imem_check_wwan_ips(channel))
208-
forced_hpdu = true;
207+
} else {
208+
hpda_pending |=
209+
ipc_protocol_ul_td_send(ipc_imem->ipc_protocol,
210+
pipe, ul_list);
211+
}
209212
}
210213

211-
if (forced_hpdu) {
214+
/* forced HP update needed for non data channels */
215+
if (hpda_ctrl_pending) {
212216
hpda_pending = false;
213217
ipc_protocol_doorbell_trigger(ipc_imem->ipc_protocol,
214218
IPC_HP_UL_WRITE_TD);
@@ -527,6 +531,9 @@ static void ipc_imem_run_state_worker(struct work_struct *instance)
527531
return;
528532
}
529533

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

@@ -1167,7 +1174,7 @@ void ipc_imem_cleanup(struct iosm_imem *ipc_imem)
11671174
ipc_port_deinit(ipc_imem->ipc_port);
11681175
}
11691176

1170-
if (ipc_imem->ipc_devlink)
1177+
if (test_and_clear_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag))
11711178
ipc_devlink_deinit(ipc_imem->ipc_devlink);
11721179

11731180
ipc_imem_device_ipc_uninit(ipc_imem);
@@ -1263,7 +1270,6 @@ struct iosm_imem *ipc_imem_init(struct iosm_pcie *pcie, unsigned int device_id,
12631270

12641271
ipc_imem->pci_device_id = device_id;
12651272

1266-
ipc_imem->ev_cdev_write_pending = false;
12671273
ipc_imem->cp_version = 0;
12681274
ipc_imem->device_sleep = IPC_HOST_SLEEP_ENTER_SLEEP;
12691275

@@ -1331,6 +1337,8 @@ struct iosm_imem *ipc_imem_init(struct iosm_pcie *pcie, unsigned int device_id,
13311337

13321338
if (ipc_flash_link_establish(ipc_imem))
13331339
goto devlink_channel_fail;
1340+
1341+
set_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag);
13341342
}
13351343
return ipc_imem;
13361344
devlink_channel_fail:

drivers/net/wwan/iosm/iosm_ipc_imem.h

Lines changed: 1 addition & 3 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 {
@@ -335,8 +336,6 @@ enum ipc_phase {
335336
* process the irq actions.
336337
* @flag: Flag to monitor the state of driver
337338
* @td_update_timer_suspended: if true then td update timer suspend
338-
* @ev_cdev_write_pending: 0 means inform the IPC tasklet to pass
339-
* the accumulated uplink buffers to CP.
340339
* @ev_mux_net_transmit_pending:0 means inform the IPC tasklet to pass
341340
* @reset_det_n: Reset detect flag
342341
* @pcie_wake_n: Pcie wake flag
@@ -374,7 +373,6 @@ struct iosm_imem {
374373
u8 ev_irq_pending[IPC_IRQ_VECTORS];
375374
unsigned long flag;
376375
u8 td_update_timer_suspended:1,
377-
ev_cdev_write_pending:1,
378376
ev_mux_net_transmit_pending:1,
379377
reset_det_n:1,
380378
pcie_wake_n:1;

drivers/net/wwan/iosm/iosm_ipc_imem_ops.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ void ipc_imem_sys_wwan_close(struct iosm_imem *ipc_imem, int if_id,
4141
static int ipc_imem_tq_cdev_write(struct iosm_imem *ipc_imem, int arg,
4242
void *msg, size_t size)
4343
{
44-
ipc_imem->ev_cdev_write_pending = false;
4544
ipc_imem_ul_send(ipc_imem);
4645

4746
return 0;
@@ -50,11 +49,6 @@ static int ipc_imem_tq_cdev_write(struct iosm_imem *ipc_imem, int arg,
5049
/* Through tasklet to do sio write. */
5150
static int ipc_imem_call_cdev_write(struct iosm_imem *ipc_imem)
5251
{
53-
if (ipc_imem->ev_cdev_write_pending)
54-
return -1;
55-
56-
ipc_imem->ev_cdev_write_pending = true;
57-
5852
return ipc_task_queue_send_task(ipc_imem, ipc_imem_tq_cdev_write, 0,
5953
NULL, 0, false);
6054
}
@@ -450,6 +444,7 @@ void ipc_imem_sys_devlink_close(struct iosm_devlink *ipc_devlink)
450444
/* Release the pipe resources */
451445
ipc_imem_pipe_cleanup(ipc_imem, &channel->ul_pipe);
452446
ipc_imem_pipe_cleanup(ipc_imem, &channel->dl_pipe);
447+
ipc_imem->nr_of_channels--;
453448
}
454449

455450
void ipc_imem_sys_devlink_notify_rx(struct iosm_devlink *ipc_devlink,

0 commit comments

Comments
 (0)