linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: function: fix missing spinlock in f_uac1_legacy
@ 2020-07-05  1:59 qiang.zhang
  2020-07-06  5:16 ` 回复: " Zhang, Qiang
  2020-07-06  7:40 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: qiang.zhang @ 2020-07-05  1:59 UTC (permalink / raw)
  To: balbi; +Cc: gregkh, colin.king, linux-usb, linux-kernel

From: Zhang Qiang <qiang.zhang@windriver.com>

Signed-off-by: Zhang Qiang <qiang.zhang@windriver.com>
---
 drivers/usb/gadget/function/f_uac1_legacy.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/function/f_uac1_legacy.c b/drivers/usb/gadget/function/f_uac1_legacy.c
index 349deae7cabd..e2d7f69128a0 100644
--- a/drivers/usb/gadget/function/f_uac1_legacy.c
+++ b/drivers/usb/gadget/function/f_uac1_legacy.c
@@ -336,7 +336,9 @@ static int f_audio_out_ep_complete(struct usb_ep *ep, struct usb_request *req)
 
 	/* Copy buffer is full, add it to the play_queue */
 	if (audio_buf_size - copy_buf->actual < req->actual) {
+		spin_lock_irq(&audio->lock);
 		list_add_tail(&copy_buf->list, &audio->play_queue);
+		spin_unlock_irq(&audio->lock);
 		schedule_work(&audio->playback_work);
 		copy_buf = f_audio_buffer_alloc(audio_buf_size);
 		if (IS_ERR(copy_buf))
-- 
2.24.1


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

* 回复: [PATCH] usb: gadget: function: fix missing spinlock in f_uac1_legacy
  2020-07-05  1:59 [PATCH] usb: gadget: function: fix missing spinlock in f_uac1_legacy qiang.zhang
@ 2020-07-06  5:16 ` Zhang, Qiang
  2020-07-06  7:40 ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Qiang @ 2020-07-06  5:16 UTC (permalink / raw)
  To: balbi
  Cc: gregkh, colin.king, linux-usb, linux-kernel, ruslan.bilovol, cooloney


________________________________________
发件人: linux-kernel-owner@vger.kernel.org <linux-kernel-owner@vger.kernel.org> 代表 qiang.zhang@windriver.com <qiang.zhang@windriver.com>
发送时间: 2020年7月5日 9:59
收件人: balbi@kernel.org
抄送: gregkh@linuxfoundation.org; colin.king@canonical.com; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
主题: [PATCH] usb: gadget: function: fix missing spinlock in f_uac1_legacy

From: Zhang Qiang <qiang.zhang@windriver.com>

Signed-off-by: Zhang Qiang <qiang.zhang@windriver.com>
---
 drivers/usb/gadget/function/f_uac1_legacy.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/function/f_uac1_legacy.c b/drivers/usb/gadget/function/f_uac1_legacy.c
index 349deae7cabd..e2d7f69128a0 100644
--- a/drivers/usb/gadget/function/f_uac1_legacy.c
+++ b/drivers/usb/gadget/function/f_uac1_legacy.c
@@ -336,7 +336,9 @@ static int f_audio_out_ep_complete(struct usb_ep *ep, struct usb_request *req)

        /* Copy buffer is full, add it to the play_queue */
        if (audio_buf_size - copy_buf->actual < req->actual) {
+               spin_lock_irq(&audio->lock);
                list_add_tail(&copy_buf->list, &audio->play_queue);
+               spin_unlock_irq(&audio->lock);
                schedule_work(&audio->playback_work);
                copy_buf = f_audio_buffer_alloc(audio_buf_size);
                if (IS_ERR(copy_buf))
--
2.24.1


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

* Re: [PATCH] usb: gadget: function: fix missing spinlock in f_uac1_legacy
  2020-07-05  1:59 [PATCH] usb: gadget: function: fix missing spinlock in f_uac1_legacy qiang.zhang
  2020-07-06  5:16 ` 回复: " Zhang, Qiang
@ 2020-07-06  7:40 ` Greg KH
  2020-07-06  8:01   ` 回复: " Zhang, Qiang
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2020-07-06  7:40 UTC (permalink / raw)
  To: qiang.zhang; +Cc: balbi, colin.king, linux-usb, linux-kernel

On Sun, Jul 05, 2020 at 09:59:41AM +0800, qiang.zhang@windriver.com wrote:
> From: Zhang Qiang <qiang.zhang@windriver.com>
> 
> Signed-off-by: Zhang Qiang <qiang.zhang@windriver.com>

No changelog text?  I can't take patches like that, sorry.

greg k-h

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

* 回复: [PATCH] usb: gadget: function: fix missing spinlock in f_uac1_legacy
  2020-07-06  7:40 ` Greg KH
@ 2020-07-06  8:01   ` Zhang, Qiang
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qiang @ 2020-07-06  8:01 UTC (permalink / raw)
  To: Greg KH; +Cc: balbi, colin.king, linux-usb, linux-kernel

Sorry, I will add changelog and resend.

Zhang Qiang

________________________________________
发件人: Greg KH <gregkh@linuxfoundation.org>
发送时间: 2020年7月6日 15:40
收件人: Zhang, Qiang
抄送: balbi@kernel.org; colin.king@canonical.com; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
主题: Re: [PATCH] usb: gadget: function: fix missing spinlock in f_uac1_legacy

On Sun, Jul 05, 2020 at 09:59:41AM +0800, qiang.zhang@windriver.com wrote:
> From: Zhang Qiang <qiang.zhang@windriver.com>
>
> Signed-off-by: Zhang Qiang <qiang.zhang@windriver.com>

No changelog text?  I can't take patches like that, sorry.

greg k-h

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

end of thread, other threads:[~2020-07-06  8:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05  1:59 [PATCH] usb: gadget: function: fix missing spinlock in f_uac1_legacy qiang.zhang
2020-07-06  5:16 ` 回复: " Zhang, Qiang
2020-07-06  7:40 ` Greg KH
2020-07-06  8:01   ` 回复: " Zhang, Qiang

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