From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Chung-Yi Chen <yeechen0207@gmail.com>, qemu-arm@nongnu.org
Cc: peter.maydell@linaro.org, marcandre.lureau@redhat.com,
pbonzini@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/char/bcm2835_aux: Fix incorrect interrupt ID when RX disabled
Date: Sun, 30 Mar 2025 10:55:22 +0200 [thread overview]
Message-ID: <e778d53b-7ff8-49cf-a23f-7255cc968672@linaro.org> (raw)
In-Reply-To: <20250328123725.94176-1-yeechen0207@gmail.com>
On 28/3/25 13:37, Chung-Yi Chen wrote:
> This patch fixes 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
>
> Signed-off-by: Chung-Yi Chen <yeechen0207@gmail.com>
> ---
> hw/char/bcm2835_aux.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Fixes: 97398d900ca ("bcm2835_aux: add emulation of BCM2835 AUX (aka
UART1) block")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
next prev parent reply other threads:[~2025-03-30 8:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-28 12:37 [PATCH] hw/char/bcm2835_aux: Fix incorrect interrupt ID when RX disabled Chung-Yi Chen
2025-03-30 8:55 ` Philippe Mathieu-Daudé [this message]
2025-03-31 11:20 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e778d53b-7ff8-49cf-a23f-7255cc968672@linaro.org \
--to=philmd@linaro.org \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=yeechen0207@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).