android_kernel_sony_sdm845/drivers/tty/serial
Repository files (latest commit first)
Filename Latest commit message Latest commit date
John Stultz 95839ab526 serial: amba-pl011: Make sure we initialize the port.lock spinlock
[ Upstream commit 8508f4cba308f785b2fd4b8c38849c117b407297 ]

Valentine reported seeing:

[    3.626638] INFO: trying to register non-static key.
[    3.626639] the code is fine but needs lockdep annotation.
[    3.626640] turning off the locking correctness validator.
[    3.626644] CPU: 7 PID: 51 Comm: kworker/7:1 Not tainted 5.7.0-rc2-00115-g8c2e9790f196 #116
[    3.626646] Hardware name: HiKey960 (DT)
[    3.626656] Workqueue: events deferred_probe_work_func
[    3.632476] sd 0:0:0:0: [sda] Optimal transfer size 8192 bytes not a multiple of physical block size (16384 bytes)
[    3.640220] Call trace:
[    3.640225]  dump_backtrace+0x0/0x1b8
[    3.640227]  show_stack+0x20/0x30
[    3.640230]  dump_stack+0xec/0x158
[    3.640234]  register_lock_class+0x598/0x5c0
[    3.640235]  __lock_acquire+0x80/0x16c0
[    3.640236]  lock_acquire+0xf4/0x4a0
[    3.640241]  _raw_spin_lock_irqsave+0x70/0xa8
[    3.640245]  uart_add_one_port+0x388/0x4b8
[    3.640248]  pl011_register_port+0x70/0xf0
[    3.640250]  pl011_probe+0x184/0x1b8
[    3.640254]  amba_probe+0xdc/0x180
[    3.640256]  really_probe+0xe0/0x338
[    3.640257]  driver_probe_device+0x60/0xf8
[    3.640259]  __device_attach_driver+0x8c/0xd0
[    3.640260]  bus_for_each_drv+0x84/0xd8
[    3.640261]  __device_attach+0xe4/0x140
[    3.640263]  device_initial_probe+0x1c/0x28
[    3.640265]  bus_probe_device+0xa4/0xb0
[    3.640266]  deferred_probe_work_func+0x7c/0xb8
[    3.640269]  process_one_work+0x2c0/0x768
[    3.640271]  worker_thread+0x4c/0x498
[    3.640272]  kthread+0x14c/0x158
[    3.640275]  ret_from_fork+0x10/0x1c

Which seems to be due to the fact that after allocating the uap
structure, nothing initializes the spinlock.

Its a little confusing, as uart_port_spin_lock_init() is one
place where the lock is supposed to be initialized, but it has
an exception for the case where the port is a console.

This makes it seem like a deeper fix is needed to properly
register the console, but I'm not sure what that entails, and
Andy suggested that this approach is less invasive.

Thus, this patch resolves the issue by initializing the spinlock
in the driver, and resolves the resulting warning.

Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: linux-serial@vger.kernel.org
Reported-by: Valentin Schneider <valentin.schneider@arm.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Reviewed-and-tested-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lore.kernel.org/r/20200428184050.6501-1-john.stultz@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-30 15:38:24 -04:00
..
8250 serial: 8250: Check UPF_IRQ_SHARED in advance 2020-03-11 07:53:07 +01:00
cpm_uart tty: serial: cpm_uart - fix init when SMC is relocated 2019-08-04 09:33:37 +02:00
jsm tty: serial: jsm_tty: constify uart_ops structures 2016-09-02 15:01:16 +02:00
21285.c
altera_jtaguart.c serial: altera: constify uart_ops structures 2016-09-02 15:01:16 +02:00
altera_uart.c serial: altera: constify uart_ops structures 2016-09-02 15:01:16 +02:00
amba-pl010.c
amba-pl011.c serial: amba-pl011: Make sure we initialize the port.lock spinlock 2020-06-30 15:38:24 -04:00
amba-pl011.h
apbuart.c
apbuart.h
ar933x_uart.c serial: ar933x_uart: set UART_CS_{RX,TX}_READY_ORIDE 2020-03-11 07:53:08 +01:00
arc_uart.c serial: arc_uart: Fix out-of-bounds access through DT alias 2018-05-25 16:13:14 +02:00
atmel_serial.c tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode 2020-02-28 15:42:48 +01:00
bcm63xx_uart.c serial/bcm63xx_uart: constify uart_ops structures 2016-09-02 15:01:16 +02:00
bfin_sport_uart.c
bfin_sport_uart.h
bfin_uart.c
clps711x.c serial: clps711x: Changing the compatibility string to match with the smallest supported chip 2016-07-06 17:38:16 +02:00
crisv10.c tty: Replace ASYNC_INITIALIZED bit and update atomically 2016-04-30 09:26:55 -07:00
crisv10.h
digicolor-usart.c tty/serial: digicolor: Fix digicolor-usart already registered warning 2019-08-04 09:33:37 +02:00
dz.c
dz.h
earlycon-arm-semihost.c tty/serial: mark __init early_smh_setup() static 2016-09-02 15:03:35 +02:00
earlycon.c earlycon: Use a pointer table to fix __earlycon_table stride 2018-05-01 15:13:09 -07:00
efm32-uart.c serial: efm32: Fix parity management in 'efm32_uart_console_get_options()' 2017-06-24 07:11:14 +02:00
etraxfs-uart.c
fsl_lpuart.c tty: serial: fsl_lpuart: use the sg count from dma_map_sg 2019-12-21 10:40:44 +01:00
icom.c
icom.h
ifx6x60.c serial: ifx6x60: add missed pm_runtime_disable 2019-12-21 10:40:46 +01:00
ifx6x60.h
imx.c tty: serial: imx: setup the correct sg entry for tx dma 2020-02-28 15:42:48 +01:00
ioc3_serial.c
ioc4_serial.c
ip22zilog.c
ip22zilog.h
Kconfig serial: SERIAL_STM32 should depend on HAS_DMA 2016-10-27 16:00:31 +02:00
kgdb_nmi.c
kgdboc.c Disable kgdboc failed by echo space to /sys/module/kgdboc/parameters/kgdboc 2019-04-03 06:24:19 +02:00
lantiq.c
lpc32xx_hs.c
m32r_sio.c serial: m32r_sio: make it explicitly non-modular 2016-06-25 14:00:06 -07:00
m32r_sio_reg.h
Makefile TTY and Serial driver update for 4.7-rc1 2016-05-20 20:57:27 -07:00
max310x.c serial: max310x: Fix tx_empty() callback 2019-12-05 15:34:41 +01:00
max3100.c tty: serial: constify uart_ops structures 2016-09-02 15:01:16 +02:00
mcf.c
men_z135_uart.c tty: serial: constify uart_ops structures 2016-09-02 15:01:16 +02:00
meson_uart.c tty: serial: meson: Implement earlycon support 2016-04-30 09:26:55 -07:00
mpc52xx_uart.c tty: serial: constify psc_ops structs 2016-02-06 22:31:47 -08:00
mps2-uart.c serial: mps2-uart: make driver explicitly non-modular 2016-06-25 14:01:57 -07:00
mpsc.c TTY: serial/mpsc, remove unused fields 2016-02-06 22:16:21 -08:00
msm_serial.c tty: serial: msm_serial: Fix lockup for sysrq and oops 2020-01-12 11:24:17 +01:00
mux.c
mvebu-uart.c tty:serial:mvebu-uart:fix a wrong return 2020-03-11 07:53:11 +01:00
mxs-auart.c serial: mxs-auart: Fix potential infinite loop 2019-11-25 09:52:27 +01:00
netx-serial.c
omap-serial.c serial: omap: Fix EFR write on RTS deassertion 2017-11-24 08:33:42 +01:00
pch_uart.c tty: serial: pch_uart: correct usage of dma_unmap_sg 2020-01-23 08:19:36 +01:00
pic32_uart.c serial: set suppress_bind_attrs flag only if builtin 2019-01-26 09:38:32 +01:00
pic32_uart.h serial: pic32_uart: Add PIC32 UART driver 2016-05-13 14:01:56 +02:00
pmac_zilog.c TTY: serial, handle platform_get_irq retval properly 2016-06-25 09:01:52 -07:00
pmac_zilog.h
pnx8xxx_uart.c
pxa.c serial: pxa: make it explicitly non-modular 2016-06-25 14:00:06 -07:00
rp2.c
sa1100.c
samsung.c tty: serial: samsung: Properly set flags in autoCTS mode 2019-02-12 19:44:55 +01:00
samsung.h serial: samsung: Register cpufreq notifier only on S3C24xx 2016-08-31 15:39:58 +02:00
sb1250-duart.c
sc16is7xx.c sc16is7xx: move label 'err_spi' to correct section 2020-06-03 08:16:47 +02:00
sccnxp.c serial: sccnxp: Fix error handling in sccnxp_probe() 2018-05-19 10:27:00 +02:00
serial-tegra.c TTY: serial, handle platform_get_irq retval properly 2016-06-25 09:01:52 -07:00
serial_core.c tty: link tty and port before configuring it as console 2020-01-14 20:04:30 +01:00
serial_ks8695.c serial: Fix ASYNC_* => UPF_* flags misuse 2016-01-28 14:17:42 -08:00
serial_mctrl_gpio.c serial: mctrl_gpio: Check for NULL pointer 2019-11-06 12:18:08 +01:00
serial_mctrl_gpio.h serial: mctrl_gpio: add modem control read routine 2016-06-25 14:30:42 -07:00
serial_txx9.c
sh-sci.c serial: sh-sci: Fix TX DMA buffer flushing and workqueue races 2019-08-04 09:33:40 +02:00
sh-sci.h serial: sh-sci: Clear (H)SCIF timeout and overrun during reset 2016-06-25 09:09:53 -07:00
sirfsoc_uart.c serial: sirf: Use generic uart-has-rtscts DT property 2016-04-30 09:26:55 -07:00
sirfsoc_uart.h serial: sirf: make fifo functions static 2016-06-25 14:01:57 -07:00
sn_console.c
sprd_serial.c serial: sprd: correct the wrong sequence of arguments 2019-09-21 07:14:10 +02:00
st-asc.c serial: st-asc: constify uart_ops structures 2016-09-02 15:01:16 +02:00
stm32-usart.c serial: stm32: fix transmit_chars when tx is stopped 2020-01-29 10:24:25 +01:00
stm32-usart.h serial: stm32: Fix comparisons with undefined register 2016-10-27 16:00:31 +02:00
suncore.c drivers/tty: add missing of_node_put() 2018-12-21 14:11:36 +01:00
sunhv.c sunhv: Fix device naming inconsistency between sunhv_console and sunhv_reg 2019-06-22 08:17:22 +02:00
sunsab.c
sunsab.h
sunsu.c serial/sunsu: fix refcount leak 2019-01-13 10:03:50 +01:00
sunzilog.c
sunzilog.h
tilegx.c
timbuart.c tty: serial: constify uart_ops structures 2016-09-02 15:01:16 +02:00
timbuart.h
uartlite.c serial: uartlite: fix exit path null pointer 2019-10-17 13:42:37 -07:00
ucc_uart.c QE-UART: add "fsl,t1040-ucc-uart" to of_device_id 2016-05-01 13:55:12 -07:00
vr41xx_siu.c
vt8500_serial.c serial: vt8500_serial: Fix a parameter of find_first_zero_bit. 2016-08-31 15:42:28 +02:00
xilinx_uartps.c serial: uartps: console_setup() can't be placed to init section 2019-04-20 09:07:52 +02:00
zs.c serial: zs: Fix a transmit lockup in console output 2016-02-06 23:13:30 -08:00
zs.h