All of lore.kernel.org
 help / color / mirror / Atom feed
* [bcain:bcain/glink 55/56] drivers/tty/serial/amba-pl011.c:2696:1: warning: 'pl011_console_device_unlock' defined but not used
@ 2026-05-02 13:14 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-05-02 13:14 UTC (permalink / raw)
  To: Brian Cain; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/bcain/linux.git bcain/glink
head:   5d897d0f6b0bbd170ef332eeae9a8329ec812a5e
commit: 4c95e8d4466c51c2d2d6de2790f3988413b21730 [55/56] hexagon: fix PL011 console support on QEMU virt machine
config: arm-randconfig-002 (https://download.01.org/0day-ci/archive/20260502/202605022158.egcBpISI-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260502/202605022158.egcBpISI-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605022158.egcBpISI-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/tty/serial/amba-pl011.c:2696:1: warning: 'pl011_console_device_unlock' defined but not used [-Wunused-function]
    2696 | pl011_console_device_unlock(struct console *co, unsigned long flags)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/tty/serial/amba-pl011.c:2690:1: warning: 'pl011_console_device_lock' defined but not used [-Wunused-function]
    2690 | pl011_console_device_lock(struct console *co, unsigned long *flags)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/tty/serial/amba-pl011.c:2646:1: warning: 'pl011_console_write_thread' defined but not used [-Wunused-function]
    2646 | pl011_console_write_thread(struct console *co, struct nbcon_write_context *wctxt)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/tty/serial/amba-pl011.c:2614:1: warning: 'pl011_console_write_atomic' defined but not used [-Wunused-function]
    2614 | pl011_console_write_atomic(struct console *co, struct nbcon_write_context *wctxt)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/pl011_console_device_unlock +2696 drivers/tty/serial/amba-pl011.c

4c95e8d4466c51 Brian Cain     2026-03-10  2612  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2613  static void
2eb2608618ce58 Toshiyuki Sato 2025-02-04 @2614  pl011_console_write_atomic(struct console *co, struct nbcon_write_context *wctxt)
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2615  {
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2616  	struct uart_amba_port *uap = amba_ports[co->index];
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2617  	unsigned int old_cr = 0;
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2618  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2619  	if (!nbcon_enter_unsafe(wctxt))
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2620  		return;
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2621  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2622  	clk_enable(uap->clk);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2623  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2624  	if (!uap->vendor->always_enabled) {
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2625  		old_cr = pl011_read(uap, REG_CR);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2626  		pl011_write((old_cr & ~UART011_CR_CTSEN) | (UART01x_CR_UARTEN | UART011_CR_TXE),
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2627  				uap, REG_CR);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2628  	}
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2629  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2630  	if (!uap->console_line_ended)
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2631  		uart_console_write(&uap->port, "\n", 1, pl011_console_putchar);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2632  	uart_console_write(&uap->port, wctxt->outbuf, wctxt->len, pl011_console_putchar);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2633  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2634  	while ((pl011_read(uap, REG_FR) ^ uap->vendor->inv_fr) & uap->vendor->fr_busy)
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2635  		cpu_relax();
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2636  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2637  	if (!uap->vendor->always_enabled)
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2638  		pl011_write(old_cr, uap, REG_CR);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2639  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2640  	clk_disable(uap->clk);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2641  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2642  	nbcon_exit_unsafe(wctxt);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2643  }
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2644  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2645  static void
2eb2608618ce58 Toshiyuki Sato 2025-02-04 @2646  pl011_console_write_thread(struct console *co, struct nbcon_write_context *wctxt)
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2647  {
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2648  	struct uart_amba_port *uap = amba_ports[co->index];
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2649  	unsigned int old_cr = 0;
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2650  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2651  	if (!nbcon_enter_unsafe(wctxt))
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2652  		return;
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2653  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2654  	clk_enable(uap->clk);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2655  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2656  	if (!uap->vendor->always_enabled) {
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2657  		old_cr = pl011_read(uap, REG_CR);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2658  		pl011_write((old_cr & ~UART011_CR_CTSEN) | (UART01x_CR_UARTEN | UART011_CR_TXE),
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2659  				uap, REG_CR);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2660  	}
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2661  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2662  	if (nbcon_exit_unsafe(wctxt)) {
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2663  		int i;
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2664  		unsigned int len = READ_ONCE(wctxt->len);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2665  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2666  		for (i = 0; i < len; i++) {
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2667  			if (!nbcon_enter_unsafe(wctxt))
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2668  				break;
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2669  			uart_console_write(&uap->port, wctxt->outbuf + i, 1, pl011_console_putchar);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2670  			if (!nbcon_exit_unsafe(wctxt))
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2671  				break;
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2672  		}
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2673  	}
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2674  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2675  	while (!nbcon_enter_unsafe(wctxt))
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2676  		nbcon_reacquire_nobuf(wctxt);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2677  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2678  	while ((pl011_read(uap, REG_FR) ^ uap->vendor->inv_fr) & uap->vendor->fr_busy)
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2679  		cpu_relax();
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2680  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2681  	if (!uap->vendor->always_enabled)
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2682  		pl011_write(old_cr, uap, REG_CR);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2683  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2684  	clk_disable(uap->clk);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2685  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2686  	nbcon_exit_unsafe(wctxt);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2687  }
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2688  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2689  static void
2eb2608618ce58 Toshiyuki Sato 2025-02-04 @2690  pl011_console_device_lock(struct console *co, unsigned long *flags)
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2691  {
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2692  	__uart_port_lock_irqsave(&amba_ports[co->index]->port, flags);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2693  }
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2694  
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2695  static void
2eb2608618ce58 Toshiyuki Sato 2025-02-04 @2696  pl011_console_device_unlock(struct console *co, unsigned long flags)
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2697  {
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2698  	__uart_port_unlock_irqrestore(&amba_ports[co->index]->port, flags);
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2699  }
2eb2608618ce58 Toshiyuki Sato 2025-02-04  2700  

:::::: The code at line 2696 was first introduced by commit
:::::: 2eb2608618ce5878e11bbe68cc8d2699c8f3a81a serial: amba-pl011: Implement nbcon console

:::::: TO: Toshiyuki Sato <fj6611ie@aa.jp.fujitsu.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-02 13:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-02 13:14 [bcain:bcain/glink 55/56] drivers/tty/serial/amba-pl011.c:2696:1: warning: 'pl011_console_device_unlock' defined but not used kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.