All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ruslan Bilovol <ruslan.bilovol@gmail.com>
To: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ruslan Bilovol <ruslan.bilovol@gmail.com>,
	<stable@vger.kernel.org>
Subject: [PATCH v2 2/5] usb: gadget: f_uac1: stop playback on function disable
Date: Mon,  1 Mar 2021 13:49:32 +0200	[thread overview]
Message-ID: <1614599375-8803-3-git-send-email-ruslan.bilovol@gmail.com> (raw)
In-Reply-To: <1614599375-8803-1-git-send-email-ruslan.bilovol@gmail.com>

There is missing playback stop/cleanup in case of
gadget's ->disable callback that happens on
events like USB host resetting or gadget disconnection

Fixes: 0591bc236015 ("usb: gadget: add f_uac1 variant based on a new u_audio api")

Cc: <stable@vger.kernel.org> # 4.13+
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
---
 drivers/usb/gadget/function/f_uac1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
index 00d3469..560382e 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -499,6 +499,7 @@ static void f_audio_disable(struct usb_function *f)
 	uac1->as_out_alt = 0;
 	uac1->as_in_alt = 0;
 
+	u_audio_stop_playback(&uac1->g_audio);
 	u_audio_stop_capture(&uac1->g_audio);
 }
 
-- 
1.9.1


  parent reply	other threads:[~2021-03-01 11:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 11:49 [PATCH v2 0/5] USB Audio Gadget part 1: misc fixes and improvements Ruslan Bilovol
2021-03-01 11:49 ` [PATCH v2 1/5] usb: gadget: f_uac2: always increase endpoint max_packet_size by one audio slot Ruslan Bilovol
2021-03-01 11:49 ` Ruslan Bilovol [this message]
2021-03-01 11:49 ` [PATCH v2 3/5] usb: gadget: f_uac2: validate input parameters Ruslan Bilovol
2021-03-01 11:49 ` [PATCH v2 4/5] usb: gadget: f_uac1: " Ruslan Bilovol
2021-03-01 11:49 ` [PATCH v2 5/5] usb: gadget: f_uac1: disable IN/OUT ep if unused Ruslan Bilovol

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=1614599375-8803-3-git-send-email-ruslan.bilovol@gmail.com \
    --to=ruslan.bilovol@gmail.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.