aboutsummaryrefslogtreecommitdiff
path: root/rust/qemu-api/src
diff options
context:
space:
mode:
authorChung-Yi Chen <yeechen0207@gmail.com>2025-03-28 20:37:25 +0800
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-31 21:32:43 +0200
commit70fe5ae121ce3013ac3a29809ed86c3837ad43ee (patch)
tree6e4bcc218fd9f2beae07abe64e10dbb7bb140e7d /rust/qemu-api/src
parent1c2d03bb0889b7a9a677d53126fb035190683af4 (diff)
downloadqemu-70fe5ae121ce3013ac3a29809ed86c3837ad43ee.zip
qemu-70fe5ae121ce3013ac3a29809ed86c3837ad43ee.tar.gz
qemu-70fe5ae121ce3013ac3a29809ed86c3837ad43ee.tar.bz2
hw/char/bcm2835_aux: Fix incorrect interrupt ID when RX disabled
Fix a misconfiguration issue in the read implementation of the AUX_MU_IIR_REG register. This issue can lead to a transmit interrupt being incorrectly interpreted as a receive interrupt when the receive interrupt is disabled and the receive FIFO holds valid bytes. The AUX_MU_IIR_REG register (interrupt ID bits [2:1]) indicates the status of mini UART interrupts: - 00: No interrupts - 01: Transmit FIFO is empty - 10: Receive FIFO is not empty - 11: <Not possible> When the transmit interrupt is enabled and the receive interrupt is disabled, the original code incorrectly sets the interrupt ID bits. Specifically: 1. Transmit FIFO empty, receive FIFO empty - Expected 0b01, returned 0b01 (correct) 2. Transmit FIFO empty, receive FIFO not empty - Expected 0b01, returned 0b10 (incorrect) In the second case, the code sets the interrupt ID to 0b10 (receive FIFO is not empty) even if the receive interrupt is disabled. To fix this, the patch adds additional condition for setting the interrupt ID bits to also check if the receive interrupt is enabled. Reference: BCM2835 ARM Peripherals, page 13. Available on https://datasheets.raspberrypi.com/bcm2835/bcm2835-peripherals.pdf Fixes: 97398d900ca ("bcm2835_aux: add emulation of BCM2835 AUX (aka UART1) block") Signed-off-by: Chung-Yi Chen <yeechen0207@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250328123725.94176-1-yeechen0207@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'rust/qemu-api/src')
0 files changed, 0 insertions, 0 deletions