From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [ogabbay:habanalabs-next 32/33] drivers/misc/habanalabs/common/irq.c:178:5: warning: no previous prototype for 'handle_registration_node'
Date: Sat, 29 Jan 2022 07:47:50 +0800 [thread overview]
Message-ID: <202201290701.fKs5pg0E-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5814 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git habanalabs-next
head: c720ae02be190b7639446bba872752a68cb4ba17
commit: 402f801a3488a90a5481524ea87c3da17867e635 [32/33] habanalabs: Timestamps buffers registration
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20220129/202201290701.fKs5pg0E-lkp(a)intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git/commit/?id=402f801a3488a90a5481524ea87c3da17867e635
git remote add ogabbay https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git
git fetch --no-tags ogabbay habanalabs-next
git checkout 402f801a3488a90a5481524ea87c3da17867e635
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash drivers/misc/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/misc/habanalabs/common/irq.c:178:5: warning: no previous prototype for 'handle_registration_node' [-Wmissing-prototypes]
178 | int handle_registration_node(struct hl_device *hdev, struct hl_user_pending_interrupt *pend,
| ^~~~~~~~~~~~~~~~~~~~~~~~
--
drivers/misc/habanalabs/common/memory.c: In function 'ts_buff_release':
drivers/misc/habanalabs/common/memory.c:2046:9: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
2046 | vfree(buff->kernel_buff_address);
| ^~~~~
| kvfree
drivers/misc/habanalabs/common/memory.c: In function 'hl_ts_mmap':
drivers/misc/habanalabs/common/memory.c:2150:14: error: implicit declaration of function 'remap_vmalloc_range'; did you mean 'ida_alloc_range'? [-Werror=implicit-function-declaration]
2150 | rc = remap_vmalloc_range(vma, buff->user_buff_address, 0);
| ^~~~~~~~~~~~~~~~~~~
| ida_alloc_range
drivers/misc/habanalabs/common/memory.c: In function 'hl_ts_alloc_buff':
drivers/misc/habanalabs/common/memory.c:2201:13: error: implicit declaration of function 'vmalloc_user'; did you mean 'kmalloc_order'? [-Werror=implicit-function-declaration]
2201 | p = vmalloc_user(size);
| ^~~~~~~~~~~~
| kmalloc_order
>> drivers/misc/habanalabs/common/memory.c:2201:11: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2201 | p = vmalloc_user(size);
| ^
drivers/misc/habanalabs/common/memory.c:2210:13: error: implicit declaration of function 'vmalloc'; did you mean 'kvmalloc'? [-Werror=implicit-function-declaration]
2210 | p = vmalloc(size);
| ^~~~~~~
| kvmalloc
drivers/misc/habanalabs/common/memory.c:2210:11: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2210 | p = vmalloc(size);
| ^
cc1: some warnings being treated as errors
vim +/handle_registration_node +178 drivers/misc/habanalabs/common/irq.c
167
168 /*
169 * This function called with spin_lock of wait_list_lock taken
170 * This function will set timestamp and delete the registration node from the
171 * wait_list_lock.
172 * and since we're protected with spin_lock here, so we cannot just put the refcount
173 * for the objects here, since the release function may be called and it's also a long
174 * logic (which might sleep also) that cannot be handled in irq context.
175 * so here we'll be filling a list with nodes of "put" jobs and then will send this
176 * list to a dedicated workqueue to do the actual put.
177 */
> 178 int handle_registration_node(struct hl_device *hdev, struct hl_user_pending_interrupt *pend,
179 struct list_head **free_list)
180 {
181 struct timestamp_reg_free_node *free_node;
182 u64 timestamp;
183
184 if (!(*free_list)) {
185 /* Alloc/Init the timestamp registration free objects list */
186 *free_list = kmalloc(sizeof(struct list_head), GFP_ATOMIC);
187 if (!(*free_list))
188 return -ENOMEM;
189
190 INIT_LIST_HEAD(*free_list);
191 }
192
193 free_node = kmalloc(sizeof(*free_node), GFP_ATOMIC);
194 if (!free_node)
195 return -ENOMEM;
196
197 timestamp = ktime_get_ns();
198
199 *pend->ts_reg_info.timestamp_kernel_addr = timestamp;
200
201 dev_dbg(hdev->dev, "Timestamp is set to ts cb address (%p), ts: 0x%llx\n",
202 pend->ts_reg_info.timestamp_kernel_addr,
203 *(u64 *)pend->ts_reg_info.timestamp_kernel_addr);
204
205 list_del(&pend->wait_list_node);
206
207 /* Mark kernel CB node as free */
208 pend->ts_reg_info.in_use = 0;
209
210 /* Putting the refcount for ts_buff and cq_cb objects will be handled
211 * in workqueue context, just add job to free_list.
212 */
213 free_node->ts_buff = pend->ts_reg_info.ts_buff;
214 free_node->cq_cb = pend->ts_reg_info.cq_cb;
215 list_add(&free_node->free_objects_node, *free_list);
216
217 return 0;
218 }
219
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: farah kassabri <fkassabri@habana.ai>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Oded Gabbay <ogabbay@kernel.org>
Subject: [ogabbay:habanalabs-next 32/33] drivers/misc/habanalabs/common/irq.c:178:5: warning: no previous prototype for 'handle_registration_node'
Date: Sat, 29 Jan 2022 07:47:50 +0800 [thread overview]
Message-ID: <202201290701.fKs5pg0E-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git habanalabs-next
head: c720ae02be190b7639446bba872752a68cb4ba17
commit: 402f801a3488a90a5481524ea87c3da17867e635 [32/33] habanalabs: Timestamps buffers registration
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20220129/202201290701.fKs5pg0E-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git/commit/?id=402f801a3488a90a5481524ea87c3da17867e635
git remote add ogabbay https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git
git fetch --no-tags ogabbay habanalabs-next
git checkout 402f801a3488a90a5481524ea87c3da17867e635
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash drivers/misc/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/misc/habanalabs/common/irq.c:178:5: warning: no previous prototype for 'handle_registration_node' [-Wmissing-prototypes]
178 | int handle_registration_node(struct hl_device *hdev, struct hl_user_pending_interrupt *pend,
| ^~~~~~~~~~~~~~~~~~~~~~~~
--
drivers/misc/habanalabs/common/memory.c: In function 'ts_buff_release':
drivers/misc/habanalabs/common/memory.c:2046:9: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
2046 | vfree(buff->kernel_buff_address);
| ^~~~~
| kvfree
drivers/misc/habanalabs/common/memory.c: In function 'hl_ts_mmap':
drivers/misc/habanalabs/common/memory.c:2150:14: error: implicit declaration of function 'remap_vmalloc_range'; did you mean 'ida_alloc_range'? [-Werror=implicit-function-declaration]
2150 | rc = remap_vmalloc_range(vma, buff->user_buff_address, 0);
| ^~~~~~~~~~~~~~~~~~~
| ida_alloc_range
drivers/misc/habanalabs/common/memory.c: In function 'hl_ts_alloc_buff':
drivers/misc/habanalabs/common/memory.c:2201:13: error: implicit declaration of function 'vmalloc_user'; did you mean 'kmalloc_order'? [-Werror=implicit-function-declaration]
2201 | p = vmalloc_user(size);
| ^~~~~~~~~~~~
| kmalloc_order
>> drivers/misc/habanalabs/common/memory.c:2201:11: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2201 | p = vmalloc_user(size);
| ^
drivers/misc/habanalabs/common/memory.c:2210:13: error: implicit declaration of function 'vmalloc'; did you mean 'kvmalloc'? [-Werror=implicit-function-declaration]
2210 | p = vmalloc(size);
| ^~~~~~~
| kvmalloc
drivers/misc/habanalabs/common/memory.c:2210:11: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2210 | p = vmalloc(size);
| ^
cc1: some warnings being treated as errors
vim +/handle_registration_node +178 drivers/misc/habanalabs/common/irq.c
167
168 /*
169 * This function called with spin_lock of wait_list_lock taken
170 * This function will set timestamp and delete the registration node from the
171 * wait_list_lock.
172 * and since we're protected with spin_lock here, so we cannot just put the refcount
173 * for the objects here, since the release function may be called and it's also a long
174 * logic (which might sleep also) that cannot be handled in irq context.
175 * so here we'll be filling a list with nodes of "put" jobs and then will send this
176 * list to a dedicated workqueue to do the actual put.
177 */
> 178 int handle_registration_node(struct hl_device *hdev, struct hl_user_pending_interrupt *pend,
179 struct list_head **free_list)
180 {
181 struct timestamp_reg_free_node *free_node;
182 u64 timestamp;
183
184 if (!(*free_list)) {
185 /* Alloc/Init the timestamp registration free objects list */
186 *free_list = kmalloc(sizeof(struct list_head), GFP_ATOMIC);
187 if (!(*free_list))
188 return -ENOMEM;
189
190 INIT_LIST_HEAD(*free_list);
191 }
192
193 free_node = kmalloc(sizeof(*free_node), GFP_ATOMIC);
194 if (!free_node)
195 return -ENOMEM;
196
197 timestamp = ktime_get_ns();
198
199 *pend->ts_reg_info.timestamp_kernel_addr = timestamp;
200
201 dev_dbg(hdev->dev, "Timestamp is set to ts cb address (%p), ts: 0x%llx\n",
202 pend->ts_reg_info.timestamp_kernel_addr,
203 *(u64 *)pend->ts_reg_info.timestamp_kernel_addr);
204
205 list_del(&pend->wait_list_node);
206
207 /* Mark kernel CB node as free */
208 pend->ts_reg_info.in_use = 0;
209
210 /* Putting the refcount for ts_buff and cq_cb objects will be handled
211 * in workqueue context, just add job to free_list.
212 */
213 free_node->ts_buff = pend->ts_reg_info.ts_buff;
214 free_node->cq_cb = pend->ts_reg_info.cq_cb;
215 list_add(&free_node->free_objects_node, *free_list);
216
217 return 0;
218 }
219
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next reply other threads:[~2022-01-28 23:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 23:47 kernel test robot [this message]
2022-01-28 23:47 ` [ogabbay:habanalabs-next 32/33] drivers/misc/habanalabs/common/irq.c:178:5: warning: no previous prototype for 'handle_registration_node' 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=202201290701.fKs5pg0E-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.