From nobody Sun Mar 31 14:17:07 2024 X-Original-To: usb@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V6x6W6frSz5G7ZX for ; Sun, 31 Mar 2024 14:17:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V6x6W4gd1z4b71 for ; Sun, 31 Mar 2024 14:17:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711894627; a=rsa-sha256; cv=none; b=ZmJMigMmORhw9i2QoT7jO4EHXyIy/AfXGEN1a/j861PxFQpu6oe7hmHXqow6bzet0zX/1K FuZdrfzPo8oOHqZPzmVd0jziVrOwwzaSUQwqI/a2+YhblR5xlQjqRhh1KgFuNSszuhNujO kco50Wa7KnE88kB5jtUsthHgd3MDCfBkVSfUIksvxNx9EBlQSFh9j7GPjewf8mUgkys9AM q1LxoIzngAwkpeqGCYHoUosQE5EBSLHrJJDzTSdAGJUyVQwLmWSCGcrEhxcc0vqBIra3xO 71ndJ+RyEEFQjBAvQSVmL2X0+bb52hjaJW1YLa8i8Dj3REuZQJaES8tM9nWdGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711894627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LIXuUeW/suVc2ppqLr5s/tYxMR5jK9r9HTSqmMQyPKw=; b=crNVrULkn6LHm7G55y6Ce91+cyCaAHsUzaK6EZcm5mGC9zJgVKZic1YspDZ4Y+wgyEWEwm QtFJi43yIIawNABoYFAe0ysY5hzKoQ2kvqkeUKDhCKI+XiQYtsCnn4HXHrw8lPv0WYUhfL 5cEXZLiQqMqAfdhBfL2OdPDcopoRmf1UX1QpgcreApQUkOeS6ptGQiBrFoSSfs/7Ox+vwm E4x/X3bd1AAhgWM5MpfAJZGGJXF3Rh9JI7fsVOdGc1YOobsreML/R6RQy+K76nPAco1tCl VVAm6dc4PIZex1W1qiQTIjeOHyFXPxhXd+FM2n+iomP7aE+kX+q7E7CvPmQVKg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V6x6W4GPHzhVm for ; Sun, 31 Mar 2024 14:17:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 42VEH7AV039913 for ; Sun, 31 Mar 2024 14:17:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 42VEH7BQ039912 for usb@FreeBSD.org; Sun, 31 Mar 2024 14:17:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 278055] USB devices connected to hub not accessible after audio device inactive Date: Sun, 31 Mar 2024 14:17:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 14.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-usb List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278055 --- Comment #2 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D9eff58c6d52b66eb8abe7f724dabcd804= a566df4 commit 9eff58c6d52b66eb8abe7f724dabcd804a566df4 Author: Christos Margiolis AuthorDate: 2024-03-31 14:13:43 +0000 Commit: Christos Margiolis CommitDate: 2024-03-31 14:13:43 +0000 sound: Implement asynchronous device detach Hot-unplugging a sound device, such as a USB sound card, whilst being consumed by an application, results in an infinite loop until either the application closes the device's file descriptor, or the channel automatically times out after hw.snd.timeout seconds. In the case of a detach however, the timeout approach is still not ideal, since we want all resources to be released immediatelly, without waiting for N seconds until we can use the bus again. The timeout mechanism works by calling chn_sleep() in chn_read() and chn_write() (see pcm/channel.c) in order to send the thread to sleep, using cv_timedwait_sig(). Since chn_sleep() sets the CHN_F_SLEEPING flag while waiting for cv_timedwait_sig() to return, we can test this flag in pcm_unregister() (called during detach) and wakeup the sleeping thread(s) to immediately kill the channel(s) being consumed. Sponsored by: The FreeBSD Foundation MFC after: 2 months PR: 194727, 278055, 202275, 220949, 272286 Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D43545 share/man/man4/snd_uaudio.4 | 11 +---------- sys/dev/sound/pcm/dsp.c | 2 +- sys/dev/sound/pcm/mixer.c | 11 ----------- sys/dev/sound/pcm/sound.c | 24 ++++++++++-------------- sys/dev/sound/usb/uaudio.c | 13 +++---------- 5 files changed, 15 insertions(+), 46 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=