hid: intel-ish-hid: move msg sending function out of tx spinlock

tx_list_spinlock is to protect tx link list instead of message
sending function, lock should be released after cl msg is picked
up and deleted.

This change fixes one schedule while atomic issue.

Fixes: e1fa076706 ("hid: intel-ish-hid: ishtp: Fix ishtp client sending disordered message")
Signed-off-by: Junxiao Chang <junxiao.chang@intel.com>
Signed-off-by: Even Xu <even.xu@intel.com>
This commit is contained in:
Junxiao Chang 2023-05-23 15:41:41 +08:00
parent 346d7a29b8
commit 167a70e208
1 changed files with 3 additions and 3 deletions

View File

@ -678,6 +678,9 @@ static void ipc_tx_send(void *prm)
list);
rem = cl_msg->send_buf.size - cl->tx_offs;
list_del_init(&cl_msg->list);
spin_unlock_irqrestore(&cl->tx_list_spinlock, tx_flags);
while (rem > 0) {
ishtp_hdr.host_addr = cl->host_client_id;
ishtp_hdr.fw_addr = cl->fw_client_id;
@ -705,9 +708,6 @@ static void ipc_tx_send(void *prm)
}
}
list_del_init(&cl_msg->list);
spin_unlock_irqrestore(&cl->tx_list_spinlock, tx_flags);
spin_lock_irqsave(&cl->tx_free_list_spinlock, tx_free_flags);
list_add_tail(&cl_msg->list, &cl->tx_free_list.list);
++cl->tx_ring_free_size;