[PATCH] hw/char/exynos4210_uart: Fix missing call to report ready for input

Iris Johnson posted 1 patch 4 years, 9 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210130184016.1787097-1-iris@modwiz.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Igor Mitsyanko <i.mitsyanko@gmail.com>
hw/char/exynos4210_uart.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] hw/char/exynos4210_uart: Fix missing call to report ready for input
Posted by Iris Johnson 4 years, 9 months ago
When the frontend device has no space for a read the fd is removed
from polling to allow time for the guest to read and clear the buffer.
Without the call to qemu_chr_fe_accept_input(), the poll will not be
broken out of when the guest has cleared the buffer causing significant
IO delays that get worse with smaller buffers.

Buglink: https://bugs.launchpad.net/qemu/+bug/1913341
Signed-off-by: Iris Johnson <iris@modwiz.com>
---
 hw/char/exynos4210_uart.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
index 6361df2ad3..51ba862d0b 100644
--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -519,6 +519,7 @@ static uint64_t exynos4210_uart_read(void *opaque, hwaddr offset,
             s->reg[I_(UTRSTAT)] &= ~UTRSTAT_Rx_BUFFER_DATA_READY;
             res = s->reg[I_(URXH)];
         }
+        qemu_chr_fe_accept_input(&s->chr);
         exynos4210_uart_update_dmabusy(s);
         trace_exynos_uart_read(s->channel, offset,
                                exynos4210_uart_regname(offset), res);
-- 
2.25.1


Re: [PATCH] hw/char/exynos4210_uart: Fix missing call to report ready for input
Posted by Peter Maydell 4 years, 9 months ago
On Sat, 30 Jan 2021 at 18:42, Iris Johnson <iris@modwiz.com> wrote:
>
> When the frontend device has no space for a read the fd is removed
> from polling to allow time for the guest to read and clear the buffer.
> Without the call to qemu_chr_fe_accept_input(), the poll will not be
> broken out of when the guest has cleared the buffer causing significant
> IO delays that get worse with smaller buffers.
>
> Buglink: https://bugs.launchpad.net/qemu/+bug/1913341
> Signed-off-by: Iris Johnson <iris@modwiz.com>
> ---
>  hw/char/exynos4210_uart.c | 1 +



Applied to target-arm.next, thanks.

-- PMM