Skip to content

Conversation

jmichalski-ant
Copy link
Contributor

This PR fixes a deadlock occurring in some cases due to the infinite wait time in virtq_add_buffer_chain called from the isr callback. Its fixed by changing the timeout to K_NO_WAIT and delaying adding buffers to the virtqueue if no free descriptors are available

Jakub Klimczak added 3 commits October 8, 2025 13:08
…sages

There was a bug in the VIRTIO Console driver which could cause a deadlock
by attempting to add buffers to the control-tx virtqueue too fast and
with an infinite timeout.
This commit fixes it by placing messages that couldn't be sent in a FIFO
queue and taking care of them later in a callback function.

Signed-off-by: Jakub Klimczak <[email protected]>
Add descriptions to the Kconfig file and restructure it slightly.

Signed-off-by: Jakub Klimczak <[email protected]>
Spinlocks in functions virtconsole_control_recv_cb and
virtconsole_send_control_msg were unnecessary since those were called
from virtio_pci_isr or virtio_mmio_isr, which already use spinlocks.

Signed-off-by: Jakub Klimczak <[email protected]>
@jmichalski-ant jmichalski-ant force-pushed the 84287-fix_virtconsole_deadlock branch from 426e691 to b88d624 Compare October 10, 2025 09:28
Copy link

@jmichalski-ant jmichalski-ant marked this pull request as ready for review October 10, 2025 11:29
@zephyrbot zephyrbot added the area: UART Universal Asynchronous Receiver-Transmitter label Oct 10, 2025
@zephyrbot zephyrbot requested a review from dcpleung October 10, 2025 11:31
@dcpleung dcpleung requested a review from tgorochowik October 13, 2025 17:25
@cfriedt cfriedt merged commit e783292 into zephyrproject-rtos:main Oct 14, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: UART Universal Asynchronous Receiver-Transmitter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants