virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>,
	anton.yakovlev@opensynergy.com, mst@redhat.com
Cc: alsa-devel@alsa-project.org, mripard@redhat.com,
	linux-kernel@vger.kernel.org, tiwai@suse.com, perex@perex.cz,
	stefanha@redhat.com, oe-kbuild-all@lists.linux.dev,
	pbonzini@redhat.com, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v2] ALSA: virtio: use copy and fill_silence callbacks
Date: Wed, 18 Oct 2023 21:16:22 +0800	[thread overview]
Message-ID: <202310182118.4uWJrE2p-lkp@intel.com> (raw)
In-Reply-To: <ZS+392ZzVIoEyv8n@fedora>

Hi Matias,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 8a749fd1a8720d4619c91c8b6e7528c0a355c0aa]

url:    https://github.com/intel-lab-lkp/linux/commits/Matias-Ezequiel-Vara-Larsen/ALSA-virtio-use-copy-and-fill_silence-callbacks/20231018-185108
base:   8a749fd1a8720d4619c91c8b6e7528c0a355c0aa
patch link:    https://lore.kernel.org/r/ZS%2B392ZzVIoEyv8n%40fedora
patch subject: [PATCH v2] ALSA: virtio: use copy and fill_silence callbacks
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20231018/202310182118.4uWJrE2p-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231018/202310182118.4uWJrE2p-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310182118.4uWJrE2p-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> sound/virtio/virtio_pcm_msg.c:200: warning: Function parameter or member 'offset' not described in 'virtsnd_pcm_msg_send'
>> sound/virtio/virtio_pcm_msg.c:200: warning: Function parameter or member 'bytes' not described in 'virtsnd_pcm_msg_send'
   2 warnings as Errors


vim +200 sound/virtio/virtio_pcm_msg.c

f40a28679e0b7c Anton Yakovlev              2021-03-02  184  
f40a28679e0b7c Anton Yakovlev              2021-03-02  185  /**
f40a28679e0b7c Anton Yakovlev              2021-03-02  186   * virtsnd_pcm_msg_send() - Send asynchronous I/O messages.
f40a28679e0b7c Anton Yakovlev              2021-03-02  187   * @vss: VirtIO PCM substream.
f40a28679e0b7c Anton Yakovlev              2021-03-02  188   *
f40a28679e0b7c Anton Yakovlev              2021-03-02  189   * All messages are organized in an ordered circular list. Each time the
f40a28679e0b7c Anton Yakovlev              2021-03-02  190   * function is called, all currently non-enqueued messages are added to the
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  191   * virtqueue. For this, the function uses offset and bytes to calculate the
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  192   * messages that need to be added.
f40a28679e0b7c Anton Yakovlev              2021-03-02  193   *
f40a28679e0b7c Anton Yakovlev              2021-03-02  194   * Context: Any context. Expects the tx/rx queue and the VirtIO substream
f40a28679e0b7c Anton Yakovlev              2021-03-02  195   *          spinlocks to be held by caller.
f40a28679e0b7c Anton Yakovlev              2021-03-02  196   * Return: 0 on success, -errno on failure.
f40a28679e0b7c Anton Yakovlev              2021-03-02  197   */
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  198  int virtsnd_pcm_msg_send(struct virtio_pcm_substream *vss, unsigned long offset,
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  199  			 unsigned long bytes)
f40a28679e0b7c Anton Yakovlev              2021-03-02 @200  {
f40a28679e0b7c Anton Yakovlev              2021-03-02  201  	struct virtio_snd *snd = vss->snd;
f40a28679e0b7c Anton Yakovlev              2021-03-02  202  	struct virtio_device *vdev = snd->vdev;
f40a28679e0b7c Anton Yakovlev              2021-03-02  203  	struct virtqueue *vqueue = virtsnd_pcm_queue(vss)->vqueue;
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  204  	unsigned long period_bytes = snd_pcm_lib_period_bytes(vss->substream);
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  205  	unsigned long start, end, i;
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  206  	unsigned int msg_count = vss->msg_count;
f40a28679e0b7c Anton Yakovlev              2021-03-02  207  	bool notify = false;
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  208  	int rc;
f40a28679e0b7c Anton Yakovlev              2021-03-02  209  
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  210  	start = offset / period_bytes;
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  211  	end = (offset + bytes - 1) / period_bytes;
f40a28679e0b7c Anton Yakovlev              2021-03-02  212  
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  213  	for (i = start; i <= end; i++) {
f40a28679e0b7c Anton Yakovlev              2021-03-02  214  		struct virtio_pcm_msg *msg = vss->msgs[i];
f40a28679e0b7c Anton Yakovlev              2021-03-02  215  		struct scatterlist *psgs[] = {
f40a28679e0b7c Anton Yakovlev              2021-03-02  216  			&msg->sgs[PCM_MSG_SG_XFER],
f40a28679e0b7c Anton Yakovlev              2021-03-02  217  			&msg->sgs[PCM_MSG_SG_DATA],
f40a28679e0b7c Anton Yakovlev              2021-03-02  218  			&msg->sgs[PCM_MSG_SG_STATUS]
f40a28679e0b7c Anton Yakovlev              2021-03-02  219  		};
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  220  		unsigned long n;
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  221  
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  222  		n = period_bytes - (offset % period_bytes);
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  223  		if (n > bytes)
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  224  			n = bytes;
f40a28679e0b7c Anton Yakovlev              2021-03-02  225  
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  226  		msg->length += n;
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  227  		if (msg->length == period_bytes) {
f40a28679e0b7c Anton Yakovlev              2021-03-02  228  			msg->xfer.stream_id = cpu_to_le32(vss->sid);
f40a28679e0b7c Anton Yakovlev              2021-03-02  229  			memset(&msg->status, 0, sizeof(msg->status));
f40a28679e0b7c Anton Yakovlev              2021-03-02  230  
f40a28679e0b7c Anton Yakovlev              2021-03-02  231  			if (vss->direction == SNDRV_PCM_STREAM_PLAYBACK)
f40a28679e0b7c Anton Yakovlev              2021-03-02  232  				rc = virtqueue_add_sgs(vqueue, psgs, 2, 1, msg,
f40a28679e0b7c Anton Yakovlev              2021-03-02  233  						       GFP_ATOMIC);
f40a28679e0b7c Anton Yakovlev              2021-03-02  234  			else
f40a28679e0b7c Anton Yakovlev              2021-03-02  235  				rc = virtqueue_add_sgs(vqueue, psgs, 1, 2, msg,
f40a28679e0b7c Anton Yakovlev              2021-03-02  236  						       GFP_ATOMIC);
f40a28679e0b7c Anton Yakovlev              2021-03-02  237  
f40a28679e0b7c Anton Yakovlev              2021-03-02  238  			if (rc) {
f40a28679e0b7c Anton Yakovlev              2021-03-02  239  				dev_err(&vdev->dev,
f40a28679e0b7c Anton Yakovlev              2021-03-02  240  					"SID %u: failed to send I/O message\n",
f40a28679e0b7c Anton Yakovlev              2021-03-02  241  					vss->sid);
f40a28679e0b7c Anton Yakovlev              2021-03-02  242  				return rc;
f40a28679e0b7c Anton Yakovlev              2021-03-02  243  			}
f40a28679e0b7c Anton Yakovlev              2021-03-02  244  
f40a28679e0b7c Anton Yakovlev              2021-03-02  245  			vss->msg_count++;
f40a28679e0b7c Anton Yakovlev              2021-03-02  246  		}
f40a28679e0b7c Anton Yakovlev              2021-03-02  247  
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  248  		offset = 0;
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  249  		bytes -= n;
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  250  	}
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  251  
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  252  	if (msg_count == vss->msg_count)
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  253  		return 0;
10ad52116c3a46 Matias Ezequiel Vara Larsen 2023-10-18  254  
f40a28679e0b7c Anton Yakovlev              2021-03-02  255  	if (!(vss->features & (1U << VIRTIO_SND_PCM_F_MSG_POLLING)))
f40a28679e0b7c Anton Yakovlev              2021-03-02  256  		notify = virtqueue_kick_prepare(vqueue);
f40a28679e0b7c Anton Yakovlev              2021-03-02  257  
f40a28679e0b7c Anton Yakovlev              2021-03-02  258  	if (notify)
f40a28679e0b7c Anton Yakovlev              2021-03-02  259  		virtqueue_notify(vqueue);
f40a28679e0b7c Anton Yakovlev              2021-03-02  260  
f40a28679e0b7c Anton Yakovlev              2021-03-02  261  	return 0;
f40a28679e0b7c Anton Yakovlev              2021-03-02  262  }
f40a28679e0b7c Anton Yakovlev              2021-03-02  263  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2023-10-18 13:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 10:48 [PATCH v2] ALSA: virtio: use copy and fill_silence callbacks Matias Ezequiel Vara Larsen
2023-10-18 13:16 ` kernel test robot [this message]
     [not found] ` <871qdrn6sg.wl-tiwai@suse.de>
2023-10-19  1:20   ` Anton Yakovlev via Virtualization
     [not found]     ` <87y1fzkq8c.wl-tiwai@suse.de>
2023-10-20  9:45       ` Matias Ezequiel Vara Larsen
2023-10-24  0:17       ` Anton Yakovlev via Virtualization

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=202310182118.4uWJrE2p-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=anton.yakovlev@opensynergy.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mripard@redhat.com \
    --cc=mst@redhat.com \
    --cc=mvaralar@redhat.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=perex@perex.cz \
    --cc=stefanha@redhat.com \
    --cc=tiwai@suse.com \
    --cc=virtualization@lists.linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).