From: Evgeny Iakovlev <eiakovlev@linux.microsoft.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
marcandre.lureau@redhat.com, pbonzini@redhat.com
Subject: Re: [PATCH 1/2] hw/char/pl011: better handling of FIFO flags on LCR reset
Date: Tue, 17 Jan 2023 16:54:06 +0100 [thread overview]
Message-ID: <f5af2eee-e04e-fadd-8bad-b9ec4a2a1998@linux.microsoft.com> (raw)
In-Reply-To: <CAFEAcA-VkWjSO84dCmoeKaO0PEFydi7Bj2gXhBYDatGpuCuc_w@mail.gmail.com>
On 1/17/2023 16:24, Peter Maydell wrote:
> On Fri, 6 Jan 2023 at 17:28, Evgeny Iakovlev
> <eiakovlev@linux.microsoft.com> wrote:
>> Current FIFO handling code does not reset RXFE/RXFF flags when guest
>> resets FIFO by writing to UARTLCR register, although internal FIFO state
>> is reset to 0 read count. Actual flag update will happen only on next
>> read or write to UART. As a result of that any guest that expects RXFE
>> flag to be set (and RXFF to be cleared) after resetting FIFO will just
>> hang.
>>
>> Correctly reset FIFO flags on FIFO reset. Also, clean up some FIFO
>> depth handling code based on current FIFO mode.
> This patch is doing multiple things at once ("also" in a
> commit message is often a sign of that) and I think it
> would be helpful to split it. There are three things here:
> * refactorings which aren't making any real code change
> (eg calling pl011_get_fifo_depth() instead of doing the
> "if LCR bit set then 16 else 1" inline)
Yeah, tbh i also though i should do it..
> * the fix to the actual bug
> * changes to the handling of the FIFO which should in theory
> not be visible to the guest (I think it now when the FIFO
> is disabled always puts the incoming character in read_fifo[0],
> whereas previously it would allow read_pos to increment all
> the way around the FIFO even though we only keep one character
> at a time).
That last part i don't understand. If by changes to the FIFO you are
referring to the flags handling, then it will be visible to the guest by
design, since that's what I'm fixing. Could you maybe explain that one
again? :)
>
> Type 3 in particular is tricky and could use a commit message
> explaining what it's doing.
>
> I think the actual code changes are OK, but the FIFO handling
> change is a bit complicated and at first I thought it had
> introduced a bug.
>
> thanks
> -- PMM
next prev parent reply other threads:[~2023-01-17 15:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-06 17:28 [PATCH 0/2] Series of fixes for PL011 char device Evgeny Iakovlev
2023-01-06 17:28 ` [PATCH 1/2] hw/char/pl011: better handling of FIFO flags on LCR reset Evgeny Iakovlev
2023-01-17 15:24 ` Peter Maydell
2023-01-17 15:54 ` Evgeny Iakovlev [this message]
2023-01-17 16:02 ` Peter Maydell
2023-01-17 22:06 ` eiakovlev
2023-01-06 17:28 ` [PATCH 2/2] hw/char/pl011: check if UART is enabled before RX or TX operation Evgeny Iakovlev
2023-01-17 15:38 ` Peter Maydell
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=f5af2eee-e04e-fadd-8bad-b9ec4a2a1998@linux.microsoft.com \
--to=eiakovlev@linux.microsoft.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.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).