drivers/tty/serial/mvebu-uart.c:605 mvebu_uart_putc() warn: this loop depends on readl() succeeding

From: kernel test robot
Date: Sat Aug 08 2020 - 04:51:00 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 449dc8c97089a6e09fb2dac4d92b1b7ac0eb7c1e
commit: 05933aac7b11911955de307a329dc2a7a14b7bd0 ia64: remove now unused machvec indirections
date: 12 months ago
config: ia64-randconfig-m031-20200808 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

New smatch warnings:
drivers/tty/serial/mvebu-uart.c:605 mvebu_uart_putc() warn: this loop depends on readl() succeeding

Old smatch warnings:
drivers/tty/serial/mvebu-uart.c:293 mvebu_uart_rx_chars() warn: this loop depends on readl() succeeding

vim +605 drivers/tty/serial/mvebu-uart.c

30530791a7a032 Wilson Ding 2016-02-16 595
30530791a7a032 Wilson Ding 2016-02-16 596 #ifdef CONFIG_SERIAL_MVEBU_CONSOLE
30530791a7a032 Wilson Ding 2016-02-16 597 /* Early Console */
30530791a7a032 Wilson Ding 2016-02-16 598 static void mvebu_uart_putc(struct uart_port *port, int c)
30530791a7a032 Wilson Ding 2016-02-16 599 {
30530791a7a032 Wilson Ding 2016-02-16 600 unsigned int st;
30530791a7a032 Wilson Ding 2016-02-16 601
30530791a7a032 Wilson Ding 2016-02-16 602 for (;;) {
30530791a7a032 Wilson Ding 2016-02-16 603 st = readl(port->membase + UART_STAT);
30530791a7a032 Wilson Ding 2016-02-16 604 if (!(st & STAT_TX_FIFO_FUL))
30530791a7a032 Wilson Ding 2016-02-16 @605 break;
30530791a7a032 Wilson Ding 2016-02-16 606 }
30530791a7a032 Wilson Ding 2016-02-16 607
5218d76958644a Miquel Raynal 2017-10-13 608 /* At early stage, DT is not parsed yet, only use UART0 */
5218d76958644a Miquel Raynal 2017-10-13 609 writel(c, port->membase + UART_STD_TSH);
30530791a7a032 Wilson Ding 2016-02-16 610
30530791a7a032 Wilson Ding 2016-02-16 611 for (;;) {
30530791a7a032 Wilson Ding 2016-02-16 612 st = readl(port->membase + UART_STAT);
30530791a7a032 Wilson Ding 2016-02-16 613 if (st & STAT_TX_FIFO_EMP)
30530791a7a032 Wilson Ding 2016-02-16 614 break;
30530791a7a032 Wilson Ding 2016-02-16 615 }
30530791a7a032 Wilson Ding 2016-02-16 616 }
30530791a7a032 Wilson Ding 2016-02-16 617

:::::: The code at line 605 was first introduced by commit
:::::: 30530791a7a032dc27dbbab56b8afabd5138074c serial: mvebu-uart: initial support for Armada-3700 serial port

:::::: TO: Wilson Ding <dingwei@xxxxxxxxxxx>
:::::: 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