hw/char/stm32l4x5_usart: Accept character input upon RDR read
PATCH 1/1 hw/char/stm32l4x5_usart: Accept character input upon RDR read
Looking through existing serial devices this seems to be a common pattern so it makes sense to me this is the right fix and matches the API description.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/4389
AI-used-for: fetch issue, apply proposed patch, verify build and qtests
---
NOTE
- testing with the AGENTS.md patches - I asked the agent to:
"grab the details for 4389 and apply the fix to the local tree" which it did. However it did remind me at the end:
*(Reminder per QEMU policy: this is a draft for you to review, adjust, and commit. Remember to check whether Resolves: and Reported-by: headers match your preferred attribution.)*
```text hw/char/stm32l4x5_usart: Accept character input upon RDR read When the guest reads from the USART Receive Data Register (RDR), the RXNE flag is cleared to allow receiving subsequent characters. However, without notifying the chardev backend via qemu_chr_fe_accept_input(), backends such as socket-based chardevs in polling mode may stall and only deliver characters once per second upon poll timeouts. Call qemu_chr_fe_accept_input() after clearing RXNE in stm32l4x5_usart_base_read(). Resolves: https://gitlab.com/qemu-project/qemu/-/issues/4389 Reported-by: bson Suggested-by: bson AI-used-for: fetch issue, apply proposed patch, verify build and qtests Signed-off-by: Your Name <[email protected]> ``` --- hw/char/stm32l4x5_usart.c | 1 + 1 file changed, 1 insertion(+)
hw/char/stm32l4x5_usart.c +1 -0
@@ -441,6 +441,7 @@ static uint64_t stm32l4x5_usart_base_read(void *opaque, hwaddr addr,/* Reset RXNE flag */ s->isr &= ~R_ISR_RXNE_MASK ;stm32l4x5_update_irq (s); +qemu_chr_fe_accept_input (&s->chr);break ;case A_TDR : retvalue =FIELD_EX32 (s->tdr,TDR ,TDR );
Signature · 1 line
2.47.3
Quoted 9 lines · Alex Bennée
Looking through existing serial devices this seems to be a common pattern so it makes sense to me this is the right fix and matches the API description.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/4389
Reported-by Jan Brittenson (@bson)Suggested-by Jan Brittenson (@bson)AI-used-for: fetch issue, apply proposed patch, verify build and qtests
I think the fix is fine, but given this tag I'm not sure what you want me to do with this.
Quoted 1 line
Signed-off-by Alex Bennée <[email protected]>
-- PMM
Quoted 6 lines · Peter Maydell
Quoted 5 lines · Alex Bennée
Looking through existing serial devices this seems to be a common pattern so it makes sense to me this is the right fix and matches the API description.
Quoted 7 lines
Quoted 4 lines
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/4389
Reported-by Jan Brittenson (@bson)Suggested-by Jan Brittenson (@bson)AI-used-for: fetch issue, apply proposed patch, verify build and qtests
I think the fix is fine, but given this tag I'm not sure what you want me to do with this.
well in this case the AI never wrote any code, it just applied the fix from the issue and tested it which I think is within the current policy.
Quoted 4 lines
Quoted 2 lines
Signed-off-by Alex Bennée <[email protected]>-- PMM
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro
Peter Maydell
AppliedQuoted 10 lines · Alex Bennée
Looking through existing serial devices this seems to be a common pattern so it makes sense to me this is the right fix and matches the API description.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/4389
Reported-by Jan Brittenson (@bson)Suggested-by Jan Brittenson (@bson)AI-used-for: fetch issue, apply proposed patch, verify build and qtests
Signed-off-by Alex Bennée <[email protected]>
Applied to target-arm.next, thanks.
-- PMM