Subject: Re: [PATCH] virtio: only reset device and restore status if needed in device resume

From: kernel test robot <[email-masked]>
Date: Thu, 31 Oct 2024 22:01:56 +0800

Hi,

kernel test robot noticed the following build errors:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on char-misc/char-misc-next char-misc/char-misc-linus mst-vhost/linux-next axboe-block/for-next herbert-cryptodev-2.6/master andi-shyti/i2c/i2c-host mkp-scsi/for-next jejb-scsi/for-next tiwai-sound/for-next tiwai-sound/for-linus linus/master v6.12-rc5 next-20241031]
[cannot apply to herbert-crypto-2.6/master]
[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/qiang4-zhang-linux-intel-com/virtio-only-reset-device-and-restore-status-if-needed-in-device-resume/20241031-111315
base:   char-misc/char-misc-testing
patch link:    https://lore.kernel.org/r/20241031030847.3253873-1-qiang4.zhang%40linux.intel.com
patch subject: [PATCH] virtio: only reset device and restore status if needed in device resume
config: arc-randconfig-002-20241031 (https://download.01.org/0day-ci/archive/20241031/[email-masked]/config)
compiler: arc-elf-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241031/[email-masked]/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 <[email-masked]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email-masked]/

All errors (new ones prefixed by >>):

   drivers/char/hw_random/virtio-rng.c: In function 'virtrng_restore':
>> drivers/char/hw_random/virtio-rng.c:221:15: error: implicit declaration of function 'virtio_device_reset_and_restore_status' [-Werror=implicit-function-declaration]
     221 |         err = virtio_device_reset_and_restore_status(vdev);
         |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   drivers/i2c/busses/i2c-virtio.c: In function 'virtio_i2c_restore':
>> drivers/i2c/busses/i2c-virtio.c:256:15: error: implicit declaration of function 'virtio_device_reset_and_restore_status' [-Werror=implicit-function-declaration]
     256 |         ret = virtio_device_reset_and_restore_status(vdev);
         |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for GET_FREE_REGION
   Depends on [n]: SPARSEMEM [=n]
   Selected by [y]:
   - RESOURCE_KUNIT_TEST [=y] && RUNTIME_TESTING_MENU [=y] && KUNIT [=y]

vim +/virtio_device_reset_and_restore_status +221 drivers/char/hw_random/virtio-rng.c

   216	
   217	static int virtrng_restore(struct virtio_device *vdev)
   218	{
   219		int err;
   220	
 > 221		err = virtio_device_reset_and_restore_status(vdev);
   222		if (err)
   223			return err;
   224	
   225		err = probe_common(vdev);
   226		if (!err) {
   227			struct virtrng_info *vi = vdev->priv;
   228	
   229			/*
   230			 * Set hwrng_removed to ensure that virtio_read()
   231			 * does not block waiting for data before the
   232			 * registration is complete.
   233			 */
   234			vi->hwrng_removed = true;
   235			err = hwrng_register(&vi->hwrng);
   236			if (!err) {
   237				vi->hwrng_register_done = true;
   238				vi->hwrng_removed = false;
   239			}
   240		}
   241	
   242		return err;
   243	}
   244	

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