qemu/hw
Paolo Bonzini 0d931d7062 serial: clean up THRE/TEMT handling
- assert TEMT is cleared before sending a character; we'll get one from
TSR if tsr_retry > 0, from the FIFO or THR otherwise

- assert THRE cleared and FIFO not empty (if enabled) before fetching a
character to send.  This effectively reverts dffacd46, but the check
makes no sense and commit f702e62 (serial: change retry logic to avoid
concurrency, 2014-07-11) must have made it unnecessary.  The commit
message for f702e62 talks about multiple calls to qemu_chr_fe_add_watch
triggering s->tsr_retry >= MAX_XMIT_RETRY, but other failures were
possible.  For example, if you have multiple calls, the subsequent ones
will see s->tsr_retry == 0 and will find THRE and/or TEMT on entry.

- for clarity, raise THRI immediately after the code sets THRE

- check THRE to see if another character has to be sent.  This makes
the assertions more obvious and also means TEMT has to be set as soon as
the loop ends.  It makes the loop send both TSR and THR if flow-control
happens in non-FIFO mode.  Previously, THR would be lost.

- clear TEMT together with THRE even in the non-FIFO case

The last two items are bugfixes, but they were just found by inspection
and do not squash known bugs.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-12-15 17:33:37 +01:00
..
9pfs
acpi pc: piix4_pm: init legacy PCI hotplug when running on Xen 2014-11-14 11:11:44 +00:00
alpha
arm hw/arm/virt: set stdout-path instead of linux,stdout-path 2014-11-20 14:58:37 +00:00
audio
block A smattering of fixes for problems that Coverity reported. 2014-11-17 17:22:03 +00:00
bt
char serial: clean up THRE/TEMT handling 2014-12-15 17:33:37 +01:00
core acpi-build: mark RAM dirty on table update 2014-11-24 20:57:10 +02:00
cpu icc_bus: fix typo ICC_BRIGDE -> ICC_BRIDGE 2014-11-03 19:51:56 +03:00
cris
display
dma
gpio PPC: Add MPC8XXX gpio controller 2014-11-04 23:26:12 +01:00
i2c
i386 kvm/apic: fix 2.2->2.1 migration 2014-12-15 12:21:02 +01:00
ide hw/ide/core.c: Prevent SIGSEGV during migration 2014-11-18 17:36:14 +00:00
input
intc kvm/apic: fix 2.2->2.1 migration 2014-12-15 12:21:02 +01:00
ipack
isa
lm32
m68k
mem pc: pc-dimm: use backend alignment during address auto allocation 2014-11-23 12:12:46 +02:00
microblaze
mips mips_mipssim: fix use-after-free for filename 2014-11-17 11:41:03 +01:00
misc vfio: use kvm_resamplefds_enabled() 2014-12-15 12:21:01 +01:00
moxie
net rtl8139: fix Pointer to local outside scope 2014-11-21 10:50:54 +00:00
nvram spapr_nvram: Enable migration 2014-11-04 23:26:13 +01:00
openrisc
pci pcie: fix improper use of negative value 2014-11-24 20:57:11 +02:00
pci-bridge
pci-host
pcmcia
ppc spapr: Allow dynamic creation of PHB 2014-11-04 23:26:15 +01:00
s390x
scsi scsi-disk: provide maximum transfer length 2014-12-15 12:21:02 +01:00
sd
sh4
sparc
sparc64
ssi
timer
tpm
tricore
unicore32
usb hcd-musb: fix dereference null return value 2014-11-17 18:02:31 +01:00
virtio vhost-user: fix mmap offset calculation 2014-11-03 18:32:48 +02:00
watchdog
xen
xenpv
xtensa hw/xtensa/xtfpga: treat uImage load address as virtual 2014-11-03 01:00:37 +03:00
Makefile.objs