linux/drivers/tty/serial
Nishanth Menon 7af0ea5dee tty: serial: omap: Increase max consoles and add check to prevent crash
Increase the maximum number of consoles possible to 10 since DRA7 now
has the maximum number of consoles possible. without doing this, for
example, enabling DRA7 UART10 results in internal data structures and
console cannot match up and we endup with a crash as follows:

[    1.903503] omap_uart 48424000.serial: [UART-1]: failure [serial_omap_probe]: -22
[    1.911437] omap_uart: probe of 48424000.serial failed with error -22
[    1.920379] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[    1.928894] pgd = c0004000
[    1.931732] [00000004] *pgd=00000000
[    1.935485] Internal error: Oops: 5 [#1] SMP ARM
[    1.940338] Modules linked in:
[    1.943542] CPU: 1 PID: 12 Comm: kworker/1:0 Tainted: G        W      3.18.0-rc1-00001-g8821bc4-dirty #6
[    1.953521] task: ed8a2d00 ti: ed8a4000 task.ti: ed8a4000
[    1.959197] PC is at process_one_work+0x38/0x4a4
[    1.964050] LR is at 0x0
[    1.966705] pc : [<c00548e0>]    lr : [<00000000>]    psr: 40000093
[    1.966705] sp : ed8a5ea8  ip : ed8a5ec8  fp : eeb9abc0
[    1.978759] r10: ed8a4000  r9 : 00000008  r8 : ed842458
[    1.984252] r7 : 00000000  r6 : eeb9abc0  r5 : ed842440  r4 : edbf26a8
[    1.991119] r3 : 00000000  r2 : 00000000  r1 : 00000000  r0 : 00000000
[    1.997985] Flags: nZcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[    2.005767] Control: 10c5387d  Table: 8000406a  DAC: 00000015
[    2.011810] Process kworker/1:0 (pid: 12, stack limit = 0xed8a4248)
[    2.018371] Stack: (0xed8a5ea8 to 0xed8a6000)
[    2.022949] 5ea0:                   00000001 00000000 60000093 c008346c 00000001 ed8a5ec8
[    2.031555] 5ec0: c0054de4 eeb9abc0 ed8a4000 ed842458 00000008 ed8a4000 eeb9abc0 ed842440
[    2.040161] 5ee0: eeb9abc0 eeb9abf0 ed8a4000 ed842458 00000008 ed8a4000 eeb9abc0 c0054ec4
[    2.048767] 5f00: ed8a4000 eeb9ac4c a0000053 00000000 ed845bc0 ed842440 c0054d80 00000000
[    2.057342] 5f20: 00000000 00000000 00000000 c005999c 00000001 00000000 c05eaa64 ed842440
[    2.065948] 5f40: 00000000 00000000 dead4ead ffffffff ffffffff c097c680 00000000 00000000
[    2.074554] 5f60: c078acd4 ed8a5f64 ed8a5f64 00000000 00000000 dead4ead ffffffff ffffffff
[    2.083160] 5f80: c097c680 00000000 00000000 c078acd4 ed8a5f90 ed8a5f90 600000d3 ed845bc0
[    2.091766] 5fa0: c00598d4 00000000 00000000 c000e668 00000000 00000000 00000000 00000000
[    2.100341] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.108947] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 90005148 11010482
[    2.117553] [<c00548e0>] (process_one_work) from [<c0054ec4>] (worker_thread+0x144/0x498)
[    2.126159] [<c0054ec4>] (worker_thread) from [<c005999c>] (kthread+0xc8/0xe4)
[    2.133758] [<c005999c>] (kthread) from [<c000e668>] (ret_from_fork+0x14/0x2c)
[    2.141357] Code: e1a04001 e1a05000 e893000f e31e0004 (e5978004)
[    2.147766] ---[ end trace 5798e2803311b69f ]---
<snip>

The final solution is to transition off to use 8250 driver and no
dependency on console structures and move away from omap-serial
driver, hence no major cleanups are done for this driver, so add a
simple check to prevent future crashes in a similar manner in case of
platform with additional ports.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-06 14:57:18 -08:00
..
8250 serial: 8250_em: Remove out-of-memory message 2014-11-05 20:18:30 -08:00
cpm_uart serial: cpm_uart: use container_of to resolve uart_cpm_port from uart_port 2014-11-05 19:20:52 -08:00
jsm TTY: jsm: use container_of to resolve jsm_channel from uart_port 2014-11-05 19:20:52 -08:00
21285.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
68328serial.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2013-05-10 07:22:35 -07:00
altera_jtaguart.c serial: altera: Make of_device_id arrays const 2014-09-08 15:28:28 -07:00
altera_uart.c serial: altera: Make of_device_id arrays const 2014-09-08 15:28:28 -07:00
amba-pl010.c serial: amba-pl010: use container_of to resolve uart_amba_port from uart_port 2014-11-05 19:20:52 -08:00
amba-pl011.c serial: pl011: Fix build breakage with !CONFIG_DMA_ENGINE 2014-11-06 09:35:54 -08:00
apbuart.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
apbuart.h
ar933x_uart.c tty: ar933x_uart: use container_of to resolve ar933x_uart_port from uart_port 2014-11-05 19:20:53 -08:00
arc_uart.c Merge 3.16-rc5 into tty-next. 2014-07-13 15:52:12 -07:00
atmel_serial.c serial: Refactor uart_flush_buffer() from uart_close() 2014-11-05 18:53:54 -08:00
bcm63xx_uart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
bfin_sport_uart.c serial: blackfin: Fix missing gpio.h 2014-09-08 16:22:42 -07:00
bfin_sport_uart.h
bfin_uart.c serial: bfin-uart: Fix auto CTS 2014-09-23 21:19:35 -07:00
clps711x.c serial: clps711x: Use mctrl_gpio helpers for handling modem signals 2014-09-08 15:35:03 -07:00
crisv10.c cris: Remove obsolete ASYNC_SPLIT_TERMIOS behavior 2014-11-05 20:18:30 -08:00
crisv10.h cris: Remove obsolete ASYNC_SPLIT_TERMIOS behavior 2014-11-05 20:18:30 -08:00
dz.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
dz.h
earlycon-arm-semihost.c tty/serial: add arm/arm64 semihosting earlycon 2014-04-24 16:32:27 -07:00
earlycon.c tty/serial: earlycon: Fix print for implied MMIO case 2014-11-05 19:45:52 -08:00
efm32-uart.c serial: efm32: correct namespacing of location property 2014-07-11 17:49:46 -07:00
fsl_lpuart.c tty: serial: fsl_lpuart: add 32-bit register interface support 2014-07-17 18:15:38 -07:00
icom.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
icom.h
ifx6x60.c serial: ifx6x60: Remove casting the return value which is a void pointer 2013-09-26 14:29:58 -07:00
ifx6x60.h
imx.c serial: imx: Remove unneeded registration message 2014-11-05 20:03:20 -08:00
ioc3_serial.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
ioc4_serial.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
ip22zilog.c serial: use container_of to resolve uart_ip22zilog_port from uart_port 2014-11-05 19:20:52 -08:00
ip22zilog.h
Kconfig tty: serial: msm: Add earlycon support 2014-09-28 21:49:48 -04:00
kgdb_nmi.c serial: kgdb_nmi: No CON_ENABLED by default 2014-09-08 16:26:07 -07:00
kgdboc.c treewide: Convert retrun typos to return 2013-09-04 12:26:36 +02:00
lantiq.c serial: Use UPF_* constants with struct uart_port flags 2014-07-10 16:06:49 -07:00
lpc32xx_hs.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
m32r_sio_reg.h
m32r_sio.c serial: use container_of to resolve uart_sio_port from uart_port 2014-11-05 19:20:52 -08:00
m32r_sio.h
Makefile ARM: meson: serial: add MesonX SoC on-chip uart driver 2014-09-08 16:12:40 -07:00
max310x.c serial/max310x: Remove obsolete #ifset TIOC[SG]RS485 2014-11-05 19:29:05 -08:00
max3100.c serial: use dev_get_platdata() 2013-07-31 17:56:15 -07:00
mcf.c serial: Use UPF_* constants with struct uart_port flags 2014-07-10 16:06:49 -07:00
men_z135_uart.c tty: serial: men_z135_uart: Wakeup UART after transmitting 2014-07-09 17:35:42 -07:00
meson_uart.c ARM: meson: serial: add MesonX SoC on-chip uart driver 2014-09-08 16:12:40 -07:00
mfd.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
mpc52xx_uart.c serial: mpc52xx: Use default serial core x_char handler 2014-09-08 16:22:42 -07:00
mpsc.c serial: mpsc: use container_of to resolve mpsc_port_info from uart_port 2014-11-05 19:20:52 -08:00
mrst_max3110.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
mrst_max3110.h
msm_serial_hs.c serial: use dev_get_platdata() 2013-07-31 17:56:15 -07:00
msm_serial.c tty: serial: msm: Add earlycon support 2014-09-28 21:49:48 -04:00
msm_serial.h tty: serial: msm: Support big-endian CPUs 2014-07-10 16:10:42 -07:00
msm_smd_tty.c
mux.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
mxs-auart.c serial: mxs-auart: add sysrq support 2014-11-05 18:56:47 -08:00
netx-serial.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
nwpserial.c serial: Fix build failure caused by missing header file 2014-09-08 16:17:45 -07:00
of_serial.c serial: of-serial: fix up PM ops on no_console_suspend and port type 2014-11-05 16:23:34 -08:00
omap-serial.c tty: serial: omap: Increase max consoles and add check to prevent crash 2014-11-06 14:57:18 -08:00
pch_uart.c pch_uart: don't hardcode PCI slot to get DMA device 2014-08-01 16:04:21 -07:00
pmac_zilog.c tty: use container_of to resolve uart_pmac_port from uart_port 2014-11-05 19:20:52 -08:00
pmac_zilog.h
pnx8xxx_uart.c serial: pnx8xxx: use container_of to resolve pnx8xxx_port from uart_port 2014-11-05 19:20:53 -08:00
pxa.c serial: pxa: fix build with !SERIAL_PXA_CONSOLE 2014-07-10 15:48:41 -07:00
rp2.c tty: remove DEFINE_PCI_DEVICE_TABLE macro 2013-12-08 17:09:07 -08:00
sa1100.c serial: sa1100: use container_of to resolve sa1100_port from uart_port 2014-11-05 19:20:52 -08:00
samsung.c serial: samsung: Remove checks for CONFIG_SAMSUNG_CLOCK 2014-11-05 19:22:09 -08:00
samsung.h serial: samsung: Neaten dbg uses 2014-05-28 12:27:22 -07:00
sb1250-duart.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
sc16is7xx.c serial/sc16is7xx: Remove obsolete #ifset TIOC[SG]RS485 2014-11-05 19:29:05 -08:00
sccnxp.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
serial_core.c Merge branch 'tty-linus' into 'tty-testing' 2014-11-05 19:43:23 -08:00
serial_ks8695.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
serial_mctrl_gpio.c tty: serial_mctrl_gpio: Fix COMPILE_TEST build for architectures with custom termios.h 2014-09-20 06:56:55 -07:00
serial_mctrl_gpio.h tty/serial: Add GPIOLIB helpers for controlling modem lines 2014-05-28 12:49:14 -07:00
serial_txx9.c serial: txx9: remove duplicate TXX9_SIFCR_TDIL_MASK define 2014-07-10 16:10:42 -07:00
serial-tegra.c serial: Refactor uart_flush_buffer() from uart_close() 2014-11-05 18:53:54 -08:00
sh-sci.c serial: sh-sci: use dmaengine_terminate_all() API 2014-10-15 21:31:00 +05:30
sh-sci.h serial: sh-sci: Move overrun_bit and error_mask fields out of pdata 2013-12-24 11:17:48 +09:00
sirfsoc_uart.c serial: sirf: transfer more bytes once to decrease interrupts 2014-07-09 17:37:00 -07:00
sirfsoc_uart.h serial: sirf: transfer more bytes once to decrease interrupts 2014-07-09 17:37:00 -07:00
sn_console.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
st-asc.c serial: asc: Conditionally use readl_relaxed (COMPILE_TEST) 2014-09-28 21:49:48 -04:00
suncore.c
sunhv.c serial: Fix send_xchar() handlers 2014-09-08 16:22:42 -07:00
sunsab.c serial: sunsab: use container_of to resolve uart_sunsu_port from uart_port 2014-11-05 19:20:52 -08:00
sunsab.h
sunsu.c serial: sunsu: use container_of to resolve uart_sunsu_port from uart_port 2014-11-05 19:20:52 -08:00
sunzilog.c serial: use container_of to resolve uart_sunzilog_port from uart_port 2014-11-05 19:20:53 -08:00
sunzilog.h
tilegx.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
timbuart.c serial: Refactor uart_flush_buffer() from uart_close() 2014-11-05 18:53:54 -08:00
timbuart.h
uartlite.c tty: serial: uartlite: Remove .owner field for driver 2014-09-08 16:09:13 -07:00
ucc_uart.c serial: treewide: Remove empty implementations of enable_ms() 2014-07-09 17:29:38 -07:00
vr41xx_siu.c serial: vr41xx_siu: delete double assignment 2014-09-08 16:17:45 -07:00
vt8500_serial.c tty: vt8500_serial: explicitly calculate base baud rate 2014-09-08 16:29:36 -07:00
xilinx_uartps.c serial: cadence: Add generic earlycon support 2014-09-28 21:32:37 -04:00
zs.c serial: Fix IGNBRK handling 2014-06-19 13:04:52 -07:00
zs.h