virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: virtio: remove duplicate check if queue is broken
@ 2024-01-24 12:08 Li RongQing
  2024-01-24 12:40 ` Stefan Hajnoczi
  2024-01-24 13:42 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Li RongQing @ 2024-01-24 12:08 UTC (permalink / raw)
  To: anton.yakovlev, mst, perex, tiwai, virtualization, alsa-devel,
	linux-sound
  Cc: Li RongQing

virtqueue_enable_cb() will call virtqueue_poll() which will check if
queue is broken at beginning, so remove the virtqueue_is_broken() call

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 sound/virtio/virtio_card.c    | 2 --
 sound/virtio/virtio_ctl_msg.c | 2 --
 sound/virtio/virtio_pcm_msg.c | 2 --
 3 files changed, 6 deletions(-)

diff --git a/sound/virtio/virtio_card.c b/sound/virtio/virtio_card.c
index e2847c0..b158c3c 100644
--- a/sound/virtio/virtio_card.c
+++ b/sound/virtio/virtio_card.c
@@ -91,8 +91,6 @@ static void virtsnd_event_notify_cb(struct virtqueue *vqueue)
 			virtsnd_event_dispatch(snd, event);
 			virtsnd_event_send(vqueue, event, true, GFP_ATOMIC);
 		}
-		if (unlikely(virtqueue_is_broken(vqueue)))
-			break;
 	} while (!virtqueue_enable_cb(vqueue));
 	spin_unlock_irqrestore(&queue->lock, flags);
 }
diff --git a/sound/virtio/virtio_ctl_msg.c b/sound/virtio/virtio_ctl_msg.c
index 18dc5ac..9dabea0 100644
--- a/sound/virtio/virtio_ctl_msg.c
+++ b/sound/virtio/virtio_ctl_msg.c
@@ -303,8 +303,6 @@ void virtsnd_ctl_notify_cb(struct virtqueue *vqueue)
 		virtqueue_disable_cb(vqueue);
 		while ((msg = virtqueue_get_buf(vqueue, &length)))
 			virtsnd_ctl_msg_complete(msg);
-		if (unlikely(virtqueue_is_broken(vqueue)))
-			break;
 	} while (!virtqueue_enable_cb(vqueue));
 	spin_unlock_irqrestore(&queue->lock, flags);
 }
diff --git a/sound/virtio/virtio_pcm_msg.c b/sound/virtio/virtio_pcm_msg.c
index 542446c..8c32efa 100644
--- a/sound/virtio/virtio_pcm_msg.c
+++ b/sound/virtio/virtio_pcm_msg.c
@@ -358,8 +358,6 @@ static inline void virtsnd_pcm_notify_cb(struct virtio_snd_queue *queue)
 		virtqueue_disable_cb(queue->vqueue);
 		while ((msg = virtqueue_get_buf(queue->vqueue, &written_bytes)))
 			virtsnd_pcm_msg_complete(msg, written_bytes);
-		if (unlikely(virtqueue_is_broken(queue->vqueue)))
-			break;
 	} while (!virtqueue_enable_cb(queue->vqueue));
 	spin_unlock_irqrestore(&queue->lock, flags);
 }
-- 
2.9.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: virtio: remove duplicate check if queue is broken
  2024-01-24 12:08 [PATCH] ALSA: virtio: remove duplicate check if queue is broken Li RongQing
@ 2024-01-24 12:40 ` Stefan Hajnoczi
  2024-01-24 13:42 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2024-01-24 12:40 UTC (permalink / raw)
  To: Li RongQing
  Cc: anton.yakovlev, mst, perex, tiwai, virtualization, alsa-devel,
	linux-sound

On Wed, 24 Jan 2024 at 07:17, Li RongQing <lirongqing@baidu.com> wrote:
>
> virtqueue_enable_cb() will call virtqueue_poll() which will check if
> queue is broken at beginning, so remove the virtqueue_is_broken() call
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
>  sound/virtio/virtio_card.c    | 2 --
>  sound/virtio/virtio_ctl_msg.c | 2 --
>  sound/virtio/virtio_pcm_msg.c | 2 --
>  3 files changed, 6 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

>
> diff --git a/sound/virtio/virtio_card.c b/sound/virtio/virtio_card.c
> index e2847c0..b158c3c 100644
> --- a/sound/virtio/virtio_card.c
> +++ b/sound/virtio/virtio_card.c
> @@ -91,8 +91,6 @@ static void virtsnd_event_notify_cb(struct virtqueue *vqueue)
>                         virtsnd_event_dispatch(snd, event);
>                         virtsnd_event_send(vqueue, event, true, GFP_ATOMIC);
>                 }
> -               if (unlikely(virtqueue_is_broken(vqueue)))
> -                       break;
>         } while (!virtqueue_enable_cb(vqueue));
>         spin_unlock_irqrestore(&queue->lock, flags);
>  }
> diff --git a/sound/virtio/virtio_ctl_msg.c b/sound/virtio/virtio_ctl_msg.c
> index 18dc5ac..9dabea0 100644
> --- a/sound/virtio/virtio_ctl_msg.c
> +++ b/sound/virtio/virtio_ctl_msg.c
> @@ -303,8 +303,6 @@ void virtsnd_ctl_notify_cb(struct virtqueue *vqueue)
>                 virtqueue_disable_cb(vqueue);
>                 while ((msg = virtqueue_get_buf(vqueue, &length)))
>                         virtsnd_ctl_msg_complete(msg);
> -               if (unlikely(virtqueue_is_broken(vqueue)))
> -                       break;
>         } while (!virtqueue_enable_cb(vqueue));
>         spin_unlock_irqrestore(&queue->lock, flags);
>  }
> diff --git a/sound/virtio/virtio_pcm_msg.c b/sound/virtio/virtio_pcm_msg.c
> index 542446c..8c32efa 100644
> --- a/sound/virtio/virtio_pcm_msg.c
> +++ b/sound/virtio/virtio_pcm_msg.c
> @@ -358,8 +358,6 @@ static inline void virtsnd_pcm_notify_cb(struct virtio_snd_queue *queue)
>                 virtqueue_disable_cb(queue->vqueue);
>                 while ((msg = virtqueue_get_buf(queue->vqueue, &written_bytes)))
>                         virtsnd_pcm_msg_complete(msg, written_bytes);
> -               if (unlikely(virtqueue_is_broken(queue->vqueue)))
> -                       break;
>         } while (!virtqueue_enable_cb(queue->vqueue));
>         spin_unlock_irqrestore(&queue->lock, flags);
>  }
> --
> 2.9.4
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: virtio: remove duplicate check if queue is broken
  2024-01-24 12:08 [PATCH] ALSA: virtio: remove duplicate check if queue is broken Li RongQing
  2024-01-24 12:40 ` Stefan Hajnoczi
@ 2024-01-24 13:42 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2024-01-24 13:42 UTC (permalink / raw)
  To: Li RongQing
  Cc: anton.yakovlev, mst, perex, tiwai, virtualization, alsa-devel,
	linux-sound

On Wed, 24 Jan 2024 13:08:34 +0100,
Li RongQing wrote:
> 
> virtqueue_enable_cb() will call virtqueue_poll() which will check if
> queue is broken at beginning, so remove the virtqueue_is_broken() call
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

Applied now.  Thanks.


Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-24 13:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 12:08 [PATCH] ALSA: virtio: remove duplicate check if queue is broken Li RongQing
2024-01-24 12:40 ` Stefan Hajnoczi
2024-01-24 13:42 ` Takashi Iwai

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).