From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] uacce: Add uacce_ctrl misc device
Date: Fri, 22 Jan 2021 01:16:37 +0800 [thread overview]
Message-ID: <202101220145.prDb7SKU-lkp@intel.com> (raw)
In-Reply-To: <1611220154-90232-1-git-send-email-wangzhou1@hisilicon.com>
[-- Attachment #1: Type: text/plain, Size: 5174 bytes --]
Hi Zhou,
I love your patch! Yet something to improve:
[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on soc/for-next linux/master linus/master v5.11-rc4 next-20210121]
[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/Zhou-Wang/uacce-Add-uacce_ctrl-misc-device/20210121-172139
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git f6f1f8e6e3eea25f539105d48166e91f0ab46dd1
config: alpha-randconfig-p002-20210121 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
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/4dc40d891a7e60ed79e6b9460a38a142d3d1a965
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Zhou-Wang/uacce-Add-uacce_ctrl-misc-device/20210121-172139
git checkout 4dc40d891a7e60ed79e6b9460a38a142d3d1a965
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
drivers/misc/uacce/uacce.c:511:5: warning: no previous prototype for 'uacce_ctrl_open' [-Wmissing-prototypes]
511 | int uacce_ctrl_open(struct inode *inode, struct file *file)
| ^~~~~~~~~~~~~~~
drivers/misc/uacce/uacce.c:525:5: warning: no previous prototype for 'uacce_ctrl_release' [-Wmissing-prototypes]
525 | int uacce_ctrl_release(struct inode *inode, struct file *file)
| ^~~~~~~~~~~~~~~~~~
drivers/misc/uacce/uacce.c: In function 'uacce_ctrl_release':
>> drivers/misc/uacce/uacce.c:534:3: error: implicit declaration of function 'vfree'; did you mean 'kfree'? [-Werror=implicit-function-declaration]
534 | vfree(p->pages);
| ^~~~~
| kfree
drivers/misc/uacce/uacce.c: In function 'uacce_pin_page':
>> drivers/misc/uacce/uacce.c:557:10: error: implicit declaration of function 'vmalloc'; did you mean 'kmalloc'? [-Werror=implicit-function-declaration]
557 | pages = vmalloc(nr_pages * sizeof(struct page *));
| ^~~~~~~
| kmalloc
>> drivers/misc/uacce/uacce.c:557:8: warning: assignment to 'struct page **' from 'int' makes pointer from integer without a cast [-Wint-conversion]
557 | pages = vmalloc(nr_pages * sizeof(struct page *));
| ^
drivers/misc/uacce/uacce.c: In function 'uacce_ctrl_unl_ioctl':
drivers/misc/uacce/uacce.c:626:6: warning: unused variable 'ret' [-Wunused-variable]
626 | int ret;
| ^~~
cc1: some warnings being treated as errors
vim +534 drivers/misc/uacce/uacce.c
524
525 int uacce_ctrl_release(struct inode *inode, struct file *file)
526 {
527 struct uacce_pin_container *priv = file->private_data;
528 struct pin_pages *p;
529 unsigned long idx;
530
531 xa_for_each(&priv->array, idx, p) {
532 unpin_user_pages(p->pages, p->nr_pages);
533 xa_erase(&priv->array, p->first);
> 534 vfree(p->pages);
535 kfree(p);
536 }
537
538 xa_destroy(&priv->array);
539 kfree(priv);
540
541 return 0;
542 }
543
544 static int uacce_pin_page(struct uacce_pin_container *priv,
545 struct uacce_pin_address *addr)
546 {
547 unsigned int flags = FOLL_FORCE | FOLL_WRITE;
548 unsigned long first, last, nr_pages;
549 struct page **pages;
550 struct pin_pages *p;
551 int ret;
552
553 first = (addr->addr & PAGE_MASK) >> PAGE_SHIFT;
554 last = ((addr->addr + addr->size - 1) & PAGE_MASK) >> PAGE_SHIFT;
555 nr_pages = last - first + 1;
556
> 557 pages = vmalloc(nr_pages * sizeof(struct page *));
558 if (!pages)
559 return -ENOMEM;
560
561 p = kzalloc(sizeof(*p), GFP_KERNEL);
562 if (!p) {
563 ret = -ENOMEM;
564 goto free;
565 }
566
567 ret = pin_user_pages_fast(addr->addr & PAGE_MASK, nr_pages,
568 flags | FOLL_LONGTERM, pages);
569 if (ret != nr_pages) {
570 pr_err("uacce: Failed to pin page\n");
571 goto free_p;
572 }
573 p->first = first;
574 p->nr_pages = nr_pages;
575 p->pages = pages;
576
577 ret = xa_err(xa_store(&priv->array, p->first, p, GFP_KERNEL));
578 if (ret)
579 goto unpin_pages;
580
581 return 0;
582
583 unpin_pages:
584 unpin_user_pages(pages, nr_pages);
585 free_p:
586 kfree(p);
587 free:
588 vfree(pages);
589 return ret;
590 }
591
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 25277 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Zhou Wang <wangzhou1@hisilicon.com>,
Zhangfei Gao <zhangfei.gao@linaro.org>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: kbuild-all@lists.01.org, linux-accelerators@lists.ozlabs.org,
linux-kernel@vger.kernel.org, Zhou Wang <wangzhou1@hisilicon.com>,
Sihang Chen <chensihang1@hisilicon.com>
Subject: Re: [PATCH] uacce: Add uacce_ctrl misc device
Date: Fri, 22 Jan 2021 01:16:37 +0800 [thread overview]
Message-ID: <202101220145.prDb7SKU-lkp@intel.com> (raw)
In-Reply-To: <1611220154-90232-1-git-send-email-wangzhou1@hisilicon.com>
[-- Attachment #1: Type: text/plain, Size: 5043 bytes --]
Hi Zhou,
I love your patch! Yet something to improve:
[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on soc/for-next linux/master linus/master v5.11-rc4 next-20210121]
[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/Zhou-Wang/uacce-Add-uacce_ctrl-misc-device/20210121-172139
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git f6f1f8e6e3eea25f539105d48166e91f0ab46dd1
config: alpha-randconfig-p002-20210121 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
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/4dc40d891a7e60ed79e6b9460a38a142d3d1a965
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Zhou-Wang/uacce-Add-uacce_ctrl-misc-device/20210121-172139
git checkout 4dc40d891a7e60ed79e6b9460a38a142d3d1a965
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
drivers/misc/uacce/uacce.c:511:5: warning: no previous prototype for 'uacce_ctrl_open' [-Wmissing-prototypes]
511 | int uacce_ctrl_open(struct inode *inode, struct file *file)
| ^~~~~~~~~~~~~~~
drivers/misc/uacce/uacce.c:525:5: warning: no previous prototype for 'uacce_ctrl_release' [-Wmissing-prototypes]
525 | int uacce_ctrl_release(struct inode *inode, struct file *file)
| ^~~~~~~~~~~~~~~~~~
drivers/misc/uacce/uacce.c: In function 'uacce_ctrl_release':
>> drivers/misc/uacce/uacce.c:534:3: error: implicit declaration of function 'vfree'; did you mean 'kfree'? [-Werror=implicit-function-declaration]
534 | vfree(p->pages);
| ^~~~~
| kfree
drivers/misc/uacce/uacce.c: In function 'uacce_pin_page':
>> drivers/misc/uacce/uacce.c:557:10: error: implicit declaration of function 'vmalloc'; did you mean 'kmalloc'? [-Werror=implicit-function-declaration]
557 | pages = vmalloc(nr_pages * sizeof(struct page *));
| ^~~~~~~
| kmalloc
>> drivers/misc/uacce/uacce.c:557:8: warning: assignment to 'struct page **' from 'int' makes pointer from integer without a cast [-Wint-conversion]
557 | pages = vmalloc(nr_pages * sizeof(struct page *));
| ^
drivers/misc/uacce/uacce.c: In function 'uacce_ctrl_unl_ioctl':
drivers/misc/uacce/uacce.c:626:6: warning: unused variable 'ret' [-Wunused-variable]
626 | int ret;
| ^~~
cc1: some warnings being treated as errors
vim +534 drivers/misc/uacce/uacce.c
524
525 int uacce_ctrl_release(struct inode *inode, struct file *file)
526 {
527 struct uacce_pin_container *priv = file->private_data;
528 struct pin_pages *p;
529 unsigned long idx;
530
531 xa_for_each(&priv->array, idx, p) {
532 unpin_user_pages(p->pages, p->nr_pages);
533 xa_erase(&priv->array, p->first);
> 534 vfree(p->pages);
535 kfree(p);
536 }
537
538 xa_destroy(&priv->array);
539 kfree(priv);
540
541 return 0;
542 }
543
544 static int uacce_pin_page(struct uacce_pin_container *priv,
545 struct uacce_pin_address *addr)
546 {
547 unsigned int flags = FOLL_FORCE | FOLL_WRITE;
548 unsigned long first, last, nr_pages;
549 struct page **pages;
550 struct pin_pages *p;
551 int ret;
552
553 first = (addr->addr & PAGE_MASK) >> PAGE_SHIFT;
554 last = ((addr->addr + addr->size - 1) & PAGE_MASK) >> PAGE_SHIFT;
555 nr_pages = last - first + 1;
556
> 557 pages = vmalloc(nr_pages * sizeof(struct page *));
558 if (!pages)
559 return -ENOMEM;
560
561 p = kzalloc(sizeof(*p), GFP_KERNEL);
562 if (!p) {
563 ret = -ENOMEM;
564 goto free;
565 }
566
567 ret = pin_user_pages_fast(addr->addr & PAGE_MASK, nr_pages,
568 flags | FOLL_LONGTERM, pages);
569 if (ret != nr_pages) {
570 pr_err("uacce: Failed to pin page\n");
571 goto free_p;
572 }
573 p->first = first;
574 p->nr_pages = nr_pages;
575 p->pages = pages;
576
577 ret = xa_err(xa_store(&priv->array, p->first, p, GFP_KERNEL));
578 if (ret)
579 goto unpin_pages;
580
581 return 0;
582
583 unpin_pages:
584 unpin_user_pages(pages, nr_pages);
585 free_p:
586 kfree(p);
587 free:
588 vfree(pages);
589 return ret;
590 }
591
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25277 bytes --]
next prev parent reply other threads:[~2021-01-21 17:16 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-21 9:09 [PATCH] uacce: Add uacce_ctrl misc device Zhou Wang
2021-01-21 9:44 ` Greg Kroah-Hartman
2021-01-22 11:33 ` Zhou Wang
2021-01-22 11:38 ` Greg Kroah-Hartman
2021-01-21 9:45 ` Greg Kroah-Hartman
2021-01-21 10:18 ` Song Bao Hua (Barry Song)
2021-01-21 11:18 ` Greg Kroah-Hartman
2021-01-21 11:52 ` Song Bao Hua (Barry Song)
2021-01-21 12:12 ` Greg Kroah-Hartman
2021-01-21 10:44 ` kernel test robot
2021-01-21 10:44 ` kernel test robot
2021-01-21 11:43 ` kernel test robot
2021-01-21 11:43 ` kernel test robot
2021-01-21 11:43 ` [RFC PATCH] uacce: uacce_ctrl_open() can be static kernel test robot
2021-01-21 11:43 ` kernel test robot
2021-01-21 13:27 ` [PATCH] uacce: Add uacce_ctrl misc device kernel test robot
2021-01-21 13:27 ` kernel test robot
2021-01-21 17:16 ` kernel test robot [this message]
2021-01-21 17:16 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202101220145.prDb7SKU-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.