[PATCH v7 1/2] tty: hvc: pass DMA capable memory to put_chars()

kernel test robot lkp at intel.com
Wed Aug 18 04:24:37 AEST 2021


Hi Xianting,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on char-misc/char-misc-testing soc/for-next v5.14-rc6 next-20210817]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Xianting-Tian/make-hvc-pass-dma-capable-memory-to-its-backend/20210817-212556
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: i386-randconfig-r021-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2c6448cdc2f68f8c28fd0bd9404182b81306e6e6)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/f12c3bee9f2413ed7643d858b40ce2337329fdae
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Xianting-Tian/make-hvc-pass-dma-capable-memory-to-its-backend/20210817-212556
        git checkout f12c3bee9f2413ed7643d858b40ce2337329fdae
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   clang-14: warning: optimization flag '-falign-jumps=0' is not supported [-Wignored-optimization-argument]
   In file included from drivers/tty/hvc/hvc_console.c:15:
   In file included from include/linux/kbd_kern.h:5:
   In file included from include/linux/tty.h:5:
   In file included from include/linux/fs.h:6:
   In file included from include/linux/wait_bit.h:8:
   In file included from include/linux/wait.h:9:
   In file included from include/linux/spinlock.h:51:
   In file included from include/linux/preempt.h:78:
   In file included from arch/x86/include/asm/preempt.h:7:
   In file included from include/linux/thread_info.h:60:
   arch/x86/include/asm/thread_info.h:172:13: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address]
           oldframe = __builtin_frame_address(1);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/thread_info.h:174:11: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address]
                   frame = __builtin_frame_address(2);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/tty/hvc/hvc_console.c:160:18: warning: address of array 'hp->c' will always evaluate to 'true' [-Wpointer-bool-conversion]
           if (!hp || !hp->c)
                      ~~~~~^
   3 warnings generated.


vim +160 drivers/tty/hvc/hvc_console.c

   136	
   137	/*
   138	 * Console APIs, NOT TTY.  These APIs are available immediately when
   139	 * hvc_console_setup() finds adapters.
   140	 */
   141	
   142	static void hvc_console_print(struct console *co, const char *b,
   143				      unsigned count)
   144	{
   145		char *c;
   146		unsigned i = 0, n = 0;
   147		int r, donecr = 0, index = co->index;
   148		unsigned long flags;
   149		struct hvc_struct *hp;
   150	
   151		/* Console access attempt outside of acceptable console range. */
   152		if (index >= MAX_NR_HVC_CONSOLES)
   153			return;
   154	
   155		/* This console adapter was removed so it is not usable. */
   156		if (vtermnos[index] == -1)
   157			return;
   158	
   159		hp = cons_hvcs[index];
 > 160		if (!hp || !hp->c)
   161			return;
   162	
   163		c = hp->c;
   164	
   165		spin_lock_irqsave(&hp->c_lock, flags);
   166		while (count > 0 || i > 0) {
   167			if (count > 0 && i < sizeof(c)) {
   168				if (b[n] == '\n' && !donecr) {
   169					c[i++] = '\r';
   170					donecr = 1;
   171				} else {
   172					c[i++] = b[n++];
   173					donecr = 0;
   174					--count;
   175				}
   176			} else {
   177				r = cons_ops[index]->put_chars(vtermnos[index], c, i);
   178				if (r <= 0) {
   179					/* throw away characters on error
   180					 * but spin in case of -EAGAIN */
   181					if (r != -EAGAIN) {
   182						i = 0;
   183					} else {
   184						hvc_console_flush(cons_ops[index],
   185							      vtermnos[index]);
   186					}
   187				} else if (r > 0) {
   188					i -= r;
   189					if (i > 0)
   190						memmove(c, c+r, i);
   191				}
   192			}
   193		}
   194		spin_unlock_irqrestore(&hp->c_lock, flags);
   195		hvc_console_flush(cons_ops[index], vtermnos[index]);
   196	}
   197	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 36668 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20210818/2b0836cd/attachment-0001.gz>


More information about the Linuxppc-dev mailing list