qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
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	[thread overview]
Message-ID: <e77d927d-17fb-9543-adac-8281dd775f74@redhat.com> (raw)
In-Reply-To: <CAFEAcA87nQZLG493hSPb__zwKHVMsSNaS_qhY2EPghzTvJ9fwg@mail.gmail.com>

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

      reply	other threads:[~2018-05-03 12:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=e77d927d-17fb-9543-adac-8281dd775f74@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).