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

Reply via email to