Messages in this thread | | | Date | Wed, 23 Aug 2006 14:45:41 +0200 | From | Raphael Hertzog <> | Subject | Re: How to avoid serial port buffer overruns? |
| |
Hello,
I took the time to try some of your suggestions and I managed to get rid of the overruns.
On Fri, 18 Aug 2006, Lee Revell wrote: > Have you tried it with HZ=100? HZ=1000 might just be too much for that > board.
This indeed was a major problem and a bad choice of mine at the very beginning. It goes way better with HZ=100.
On Fri, 18 Aug 2006, Paul Fulghul wrote: > For fun, have you tried playing with the rx FIFO trigger > level in the 16550A entry in drivers/serial/8250.c ? > You could try replacing UART_FCR_R_TRIG_10 (8 char trigger) > with UART_FCR_R_TRIG_01 (4 char trigger) or even > UART_FCR_R_TRIG_00 (1 char trigger). > That creates more interrupts, but allows > more time to activate the ISR before overrun.
I changed the rx FIFO trigger level to 1 byte (UART_FCR_R_TRIG_00) and it helped a lot as well. With this combination I completely resolved the problem of overruns at full speed (115200 bauds).
For the sake of comparison, I made a similar change to the 2.4.31 kernel I was using (ie a kernel with low latency/preemptible kernel patches).
It helped a lot as well: most of the time I wouldn't have overruns (before they were very frequent, like at least one overrun in 10k chars received). However from time to time I would suffer from a single big overrun (like 30 chars lost). And using heavily the disk on module will increase the likelihood to have a buffer overrun.
With the 2.6.17.7 kernel (CONFIG_HZ=100 and patched to trigger IRQ at 1 byte received), I have been completely unable to reproduce the buffer overruns whatever read/write operation I've been triggering during the data exchange.
So all in all, the 2.6 kernel behaves better than the 2.4 in this case.
Cheers, -- Raphaël Hertzog
Premier livre français sur Debian GNU/Linux : http://www.ouaza.com/livre/admin-debian/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |