linux/drivers/tty/serial
Matt Redfearn 0ff3ab7019 serial: 8250_early: Only set divisor if valid clk & baud
If either uartclk or baud are 0, avoid calculating and setting a divisor
based on them since the output will almost certainly be garbage.

This also allows platforms such as the MIPS generic kernel, which has no
way to know a valid BASE_BASE for the board it is actually booted on at
compile time, to set BASE_BAUD to 0 and avoid early_8250 setting a bad
divisor.

This fixes a regression caused by commit 31cb9a8575 ("earlycon:
initialise baud field of earlycon device structure"), which changed the
behavior of of_setup_earlycon such that it sets a baud rate in the
earlycon structure where previously it was left as 0. All boards
supported by the MIPS generic kernel started outputting garbage from the
boot console due to an incorrect divisor being set.

Fixes: 31cb9a8575 ("earlycon: initialise baud field of earlycon device structure")
Cc: stable <stable@vger.kernel.org> # 4.14
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28 15:55:15 +01:00
..
8250 serial: 8250_early: Only set divisor if valid clk & baud 2017-11-28 15:55:15 +01:00
cpm_uart TTY/Serial patches for 4.15-rc1 2017-11-13 21:05:31 -08:00
jsm tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
21285.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
Kconfig tty: serial: owl: Implement console driver 2017-07-18 09:28:29 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
altera_jtaguart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
altera_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
amba-pl010.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
amba-pl011.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
amba-pl011.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
apbuart.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
apbuart.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ar933x_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
arc_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
atmel_serial.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
atmel_serial.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
bcm63xx_uart.c MIPS changes for 4.15 2017-11-15 11:36:08 -08:00
bfin_sport_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
bfin_sport_uart.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
bfin_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
clps711x.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
crisv10.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
crisv10.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
digicolor-usart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
dz.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
dz.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
earlycon-arm-semihost.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
earlycon.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
efm32-uart.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
etraxfs-uart.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fsl_lpuart.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
icom.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
icom.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
ifx6x60.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
ifx6x60.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
imx.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
ioc3_serial.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
ioc4_serial.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
ip22zilog.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
ip22zilog.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kgdb_nmi.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
kgdboc.c Modules updates for v4.15 2017-11-15 13:46:33 -08:00
lantiq.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
lpc32xx_hs.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
m32r_sio.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
m32r_sio_reg.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
max310x.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
max3100.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
mcf.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
men_z135_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
meson_uart.c tty: serial: meson: allow baud-rates lower than 9600 2017-11-08 13:23:51 +01:00
mpc52xx_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
mps2-uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
mpsc.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
msm_serial.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
mux.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
mvebu-uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
mxs-auart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
netx-serial.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
omap-serial.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
owl-uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
pch_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
pic32_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
pic32_uart.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
pmac_zilog.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
pmac_zilog.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pnx8xxx_uart.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
pxa.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
rp2.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
sa1100.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
samsung.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
samsung.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
sb1250-duart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
sc16is7xx.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
sccnxp.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
serial-tegra.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
serial_core.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
serial_ks8695.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
serial_mctrl_gpio.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
serial_mctrl_gpio.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
serial_txx9.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
sh-sci.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
sh-sci.h TTY/Serial patches for 4.15-rc1 2017-11-13 21:05:31 -08:00
sirfsoc_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
sirfsoc_uart.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
sn_console.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
sprd_serial.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
st-asc.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
stm32-usart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
stm32-usart.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
suncore.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
sunhv.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
sunsab.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
sunsab.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sunsu.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
sunzilog.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
sunzilog.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tilegx.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
timbuart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
timbuart.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
uartlite.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
ucc_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
vr41xx_siu.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
vt8500_serial.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
xilinx_uartps.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
zs.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
zs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00