Hi Alistair,

I've an issue following this patch. When the system is reset (e.g
using HTIF syscalls), the fifo might not be empty and thus some
characters are lost.
I discovered it on a Windows host. But by extending
"TX_INTERRUPT_TRIGGER_DELAY_NS" to a huge value, I'm able to reproduce
on Linux as well.

I've tried to flush within an unrealized function but it didn't work.
Any suggestions ?

>  static void sifive_uart_reset_enter(Object *obj, ResetType type)
>  {
> ...
> +    fifo8_create(&s->tx_fifo, SIFIVE_UART_TX_FIFO_SIZE);

I'm also wondering if that part could not lead to memory leak.
`fifo8_destroy` is never called and AFAIK, there are ways to reset a
device dynamically (e.g snapshot, though not sure if it's supported
here).

Thanks, Clément

Reply via email to