linux/drivers/tty/serial/8250
Alexey Brodkin b15d5380e4 serial/8250/8250_early: Prevent rounding error in uartclk
Modify divisor to select the nearest baud rate divider rather than the
lowest. It minimizes baud rate errors especially on low UART clock
frequencies.

For example, if uartclk is 33000000 and baud is 115200 the ratio is
about 17.9 The current code selects 17 (5% error) but should select 18
(0.5% error).

This 5% error in baud rate leads to garbage on receiving end, while 0.5%
doesn't.

The issue showed up when using the stock 8250 driver for
Synopsys DW UART. This was on a FPGA with ~12MHz UART clock.
When we enabled early serial, we saw garbage which was narrowed down
to the rounding error.

So the bug had been latent and it only showed up with such low clock rates.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 11:29:30 -07:00
..
8250_accent.c
8250_acorn.c 8250: use the 8250 register interface not the legacy one 2012-07-12 14:46:22 -07:00
8250_boca.c
8250_dw.c 8250: three way resolve of the 8250 diffs 2012-07-17 09:11:50 -07:00
8250_early.c serial/8250/8250_early: Prevent rounding error in uartclk 2012-10-24 11:29:30 -07:00
8250_em.c serial8250-em: Add DT support 2012-05-09 15:11:31 -07:00
8250_exar_st16c554.c
8250_fourport.c
8250_fsl.c
8250_gsc.c 8250: use the 8250 register interface not the legacy one 2012-07-12 14:46:22 -07:00
8250_hp300.c serial/8250_hp300: Missing 8250 register interface conversion bits 2012-10-15 13:26:14 -07:00
8250_hub6.c
8250_pci.c TTY merge for 3.7-rc1 2012-10-01 12:26:52 -07:00
8250_pnp.c 8250: blacklist Winbond CIR port 2012-09-26 13:25:41 -07:00
8250.c 8250: blacklist Winbond CIR port 2012-09-26 13:25:41 -07:00
8250.h 8250_pnp: do pnp probe before legacy probe 2012-09-26 13:25:41 -07:00
Kconfig 8250_pnp: do pnp probe before legacy probe 2012-09-26 13:25:41 -07:00
Makefile 8250_pnp: do pnp probe before legacy probe 2012-09-26 13:25:41 -07:00
serial_cs.c 8250: use the 8250 register interface not the legacy one 2012-07-12 14:46:22 -07:00