[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: hw/serial.c: Xmit fifo never used
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] Re: hw/serial.c: Xmit fifo never used |
Date: |
Wed, 26 May 2010 12:32:15 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
Frank Mehnert wrote:
> Hi,
>
> the xmit fifo of the serial device is never used. If qemu_chr_write()
> fails (interface currently not able to send characters) then the
> transmit_timer should be engaged to try to send the current character
> from the fifo again after some time. The code is
>
> } else if (qemu_chr_write(s->chr, &s->tsr, 1) != 1) {
> if ((s->tsr_retry > 0) && (s->tsr_retry <= MAX_XMIT_RETRY)) {
> s->tsr_retry++;
> qemu_mod_timer(s->transmit_timer,
> new_xmit_ts + s->char_transmit_time);
> return;
> }
> ...
> }
>
> The problem is that this path is never used as tsr_retry is never > 0
> initially. So if qemu_chr_write() fails, we never try again but drop
> the character.
>
> I assume the correct condition would be '>= 0', that is
>
> ...
> if ((s->tsr_retry >= 0) && (s->tsr_retry <= MAX_XMIT_RETRY)) {
> s->tsr_retry++;
> ...
Makes sense, patch welcome.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
Re: [Qemu-devel] hw/serial.c: Xmit fifo never used, Paul Brook, 2010/05/28