Re: [PATCH v2] Drivers: hv: vm_bus: Handle vmbus rescind calls after vmbus is suspended

From: kernel test robot
Date: Sun Jul 10 2022 - 21:32:30 EST


Hi Shradha,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.19-rc5 next-20220708]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Shradha-Gupta/Drivers-hv-vm_bus-Handle-vmbus-rescind-calls-after-vmbus-is-suspended/20220711-021702
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5867f3b88bb54016c42cdde510c184255488a12b
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220711/202207110545.MC79d9J7-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/7fbe63d321d3e0c099e90e8d8c36921c58c8868f
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Shradha-Gupta/Drivers-hv-vm_bus-Handle-vmbus-rescind-calls-after-vmbus-is-suspended/20220711-021702
git checkout 7fbe63d321d3e0c099e90e8d8c36921c58c8868f
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/hv/

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

All warnings (new ones prefixed by >>):

drivers/hv/vmbus_drv.c: In function 'vmbus_bus_resume':
>> drivers/hv/vmbus_drv.c:2539:36: warning: unused variable 'hv_cpu' [-Wunused-variable]
2539 | struct hv_per_cpu_context *hv_cpu = per_cpu_ptr(
| ^~~~~~


vim +/hv_cpu +2539 drivers/hv/vmbus_drv.c

2536
2537 static int vmbus_bus_resume(struct device *dev)
2538 {
> 2539 struct hv_per_cpu_context *hv_cpu = per_cpu_ptr(
2540 hv_context.cpu_context, VMBUS_CONNECT_CPU);
2541 struct vmbus_channel_msginfo *msginfo;
2542 size_t msgsize;
2543 int ret;
2544
2545 vmbus_connection.ignore_any_offer_msg = false;
2546
2547 /*
2548 * We only use the 'vmbus_proto_version', which was in use before
2549 * hibernation, to re-negotiate with the host.
2550 */
2551 if (!vmbus_proto_version) {
2552 pr_err("Invalid proto version = 0x%x\n", vmbus_proto_version);
2553 return -EINVAL;
2554 }
2555
2556 msgsize = sizeof(*msginfo) +
2557 sizeof(struct vmbus_channel_initiate_contact);
2558
2559 msginfo = kzalloc(msgsize, GFP_KERNEL);
2560
2561 if (msginfo == NULL)
2562 return -ENOMEM;
2563
2564 ret = vmbus_negotiate_version(msginfo, vmbus_proto_version);
2565
2566 kfree(msginfo);
2567
2568 if (ret != 0)
2569 return ret;
2570
2571 WARN_ON(atomic_read(&vmbus_connection.nr_chan_fixup_on_resume) == 0);
2572
2573 vmbus_request_offers();
2574
2575 if (wait_for_completion_timeout(
2576 &vmbus_connection.ready_for_resume_event, 10 * HZ) == 0)
2577 pr_err("Some vmbus device is missing after suspending?\n");
2578
2579 /* Reset the event for the next suspend. */
2580 reinit_completion(&vmbus_connection.ready_for_suspend_event);
2581
2582 return 0;
2583 }
2584 #else
2585 #define vmbus_bus_suspend NULL
2586 #define vmbus_bus_resume NULL
2587 #endif /* CONFIG_PM_SLEEP */
2588

--
0-DAY CI Kernel Test Service
https://01.org/lkp