[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] does a device model need to call qemu_chr_fe_accept_inp
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] does a device model need to call qemu_chr_fe_accept_input() in its reset method? |
Date: |
Thu, 3 May 2018 14:55:50 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
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