* [Qemu-devel] does a device model need to call qemu_chr_fe_accept_input() in its reset method?
@ 2018-05-03 12:49 Peter Maydell
2018-05-03 12:55 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2018-05-03 12:49 UTC (permalink / raw)
To: QEMU Developers; +Cc: Paolo Bonzini, Marc-André Lureau
Hi; I noticed that one of our UART models, hw/char/cadence_uart.c,
calls qemu_chr_fe_accept_input() in its reset method. This sort
of makes sense, since device reset is a state transition from
"I'm in a state where I've previously said I can't accept input"
to "I'm in a state where I can accept input". However, it looks
like none of the other UARTs do this.
Is this a bug in our other UARTs, or does the chardev framework
guarantee to forget about 'nope' responses from the fd_can_read
callback on system reset?
thanks
-- PMM
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] does a device model need to call qemu_chr_fe_accept_input() in its reset method?
2018-05-03 12:49 [Qemu-devel] does a device model need to call qemu_chr_fe_accept_input() in its reset method? Peter Maydell
@ 2018-05-03 12:55 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2018-05-03 12:55 UTC (permalink / raw)
To: Peter Maydell, QEMU Developers; +Cc: Marc-André Lureau
On 03/05/2018 14:49, Peter Maydell wrote:
> Hi; I noticed that one of our UART models, hw/char/cadence_uart.c,
> calls qemu_chr_fe_accept_input() in its reset method. This sort
> of makes sense, since device reset is a state transition from
> "I'm in a state where I've previously said I can't accept input"
> to "I'm in a state where I can accept input". However, it looks
> like none of the other UARTs do this.
>
> Is this a bug in our other UARTs, or does the chardev framework
> guarantee to forget about 'nope' responses from the fd_can_read
> callback on system reset?
No, system reset is not a particularly interesting event for most of the
backends.
So you have found a bug, and in fact it should be called on every rising
edge of can_read, so for example digic-uart.c is even more broken. I
vaguely remember looking at it years ago...
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-03 12:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 12:49 [Qemu-devel] does a device model need to call qemu_chr_fe_accept_input() in its reset method? Peter Maydell
2018-05-03 12:55 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.