drivers/tty/serial/8250/8250_omap.c:1044:12: sparse: sparse: context imbalance in 'omap_8250_dma_handle_irq' - different lock contexts for basic block
From: kernel test robot
Date: Sat Jun 27 2020 - 22:51:00 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 916a3b0fc1206f7e7ae8d00a21a3114b1dc67794
commit: 8e20fc3917117b42de316e87f073a1ca43d94c9f serial_core: Move sysrq functions from header file
date: 6 months ago
config: arm64-randconfig-s032-20200628 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-dirty
git checkout 8e20fc3917117b42de316e87f073a1ca43d94c9f
# save the attached .config to linux build tree
make W=1 C=1 ARCH=arm64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
>> drivers/tty/serial/8250/8250_omap.c:1044:12: sparse: sparse: context imbalance in 'omap_8250_dma_handle_irq' - different lock contexts for basic block
vim +/omap_8250_dma_handle_irq +1044 drivers/tty/serial/8250/8250_omap.c
33d9b8b23a73d5 Peter Hurley 2016-04-09 1038
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1039 /*
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1040 * This is mostly serial8250_handle_irq(). We have a slightly different DMA
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1041 * hoook for RX/TX and need different logic for them in the ISR. Therefore we
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1042 * use the default routine in the non-DMA case and this one for with DMA.
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1043 */
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 @1044 static int omap_8250_dma_handle_irq(struct uart_port *port)
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1045 {
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1046 struct uart_8250_port *up = up_to_u8250p(port);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1047 unsigned char status;
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1048 unsigned long flags;
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1049 u8 iir;
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1050
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1051 serial8250_rpm_get(up);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1052
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1053 iir = serial_port_in(port, UART_IIR);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1054 if (iir & UART_IIR_NO_INT) {
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1055 serial8250_rpm_put(up);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1056 return 0;
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1057 }
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1058
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1059 spin_lock_irqsave(&port->lock, flags);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1060
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1061 status = serial_port_in(port, UART_LSR);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1062
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1063 if (status & (UART_LSR_DR | UART_LSR_BI)) {
33d9b8b23a73d5 Peter Hurley 2016-04-09 1064 if (handle_rx_dma(up, iir)) {
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1065 status = serial8250_rx_chars(up, status);
33d9b8b23a73d5 Peter Hurley 2016-04-09 1066 omap_8250_rx_dma(up);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1067 }
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1068 }
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1069 serial8250_modem_status(up);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1070 if (status & UART_LSR_THRE && up->dma->tx_err) {
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1071 if (uart_tx_stopped(&up->port) ||
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1072 uart_circ_empty(&up->port.state->xmit)) {
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1073 up->dma->tx_err = 0;
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1074 serial8250_tx_chars(up);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1075 } else {
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1076 /*
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1077 * try again due to an earlier failer which
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1078 * might have been resolved by now.
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1079 */
a86f50ed35a885 Peter Hurley 2016-04-09 1080 if (omap_8250_tx_dma(up))
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1081 serial8250_tx_chars(up);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1082 }
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1083 }
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1084
596f63da42b928 Douglas Anderson 2018-10-30 1085 uart_unlock_and_check_sysrq(port, flags);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1086 serial8250_rpm_put(up);
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1087 return 1;
77285243a68fec Sebastian Andrzej Siewior 2014-09-29 1088 }
0a0661ddb8fc92 Sebastian Andrzej Siewior 2014-09-29 1089
:::::: The code at line 1044 was first introduced by commit
:::::: 77285243a68fec6852041d1db0d5587684b9dc48 tty: serial: 8250: omap: add custom irq handling
:::::: TO: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip