mirror of https://lore.kernel.org/lkml/
 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: Peter Chen <peter.chen@freescale.com>,
	Daniel Mack <zonque@gmail.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ruslan Bilovol <ruslan.bilovol@gmail.com>,
	<stable@vger.kernel.org>
Subject: [PATCH 2/5] usb: gadget: f_uac1: stop playback on function disable
Date: Wed, 17 Feb 2021 00:24:56 +0200	[thread overview]
Message-ID: <1613514299-20668-3-git-send-email-ruslan.bilovol@gmail.com> (raw)
In-Reply-To: <1613514299-20668-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-02-16 22:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 22:24 [PATCH 0/5] USB Audio Gadget part 1: misc fixes and improvements Ruslan Bilovol
2021-02-16 22:24 ` [PATCH 1/5] usb: gadget: f_uac2: always increase endpoint max_packet_size by one audio slot Ruslan Bilovol
2021-02-16 22:24 ` Ruslan Bilovol [this message]
2021-02-16 22:24 ` [PATCH 3/5] usb: gadget: f_uac2: validate input parameters Ruslan Bilovol
2021-02-16 22:24 ` [PATCH 4/5] usb: gadget: f_uac1: " Ruslan Bilovol
2021-02-16 22:24 ` [PATCH 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=1613514299-20668-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=peter.chen@freescale.com \
    --cc=stable@vger.kernel.org \
    --cc=zonque@gmail.com \
    /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

all inboxes | Powered by JetHome®