git: 6f80968093ec - stable/15 - snd_uaudio: Fix the MIDI TX round-robin

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Fri, 20 Nov 2026 09:49:03 UTC
The branch stable/15 has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=6f80968093eccb5f9de1cfffd5a45c2163b605b4

commit 6f80968093eccb5f9de1cfffd5a45c2163b605b4
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-11-17 08:12:28 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-11-20 09:46:04 +0000

    snd_uaudio: Fix the MIDI TX round-robin
    
    Nothing advances curr_cable, so umidi_bulk_write_callback() only
    services cable 0, which is a problem on MIDI devices with more than one
    jack.
    
    Fixes:          039477d3e7e7 ("snd_uaudio: Simplify chan->curr_cable calculation in uaudio_bulk_write_callback()")
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 day
    
    (cherry picked from commit f58613868b50dfd6c2adc7128ea60d7b276fdbf1)
---
 sys/dev/sound/usb/uaudio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index 1c364ce44232..854f007a21fb 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -5945,7 +5945,8 @@ tr_setup:
 				}
 			}
 
-			chan->curr_cable %= chan->max_emb_jack;
+			chan->curr_cable = (chan->curr_cable + 1) %
+			    chan->max_emb_jack;
 
 			if (chan->curr_cable == start_cable) {
 				if (tr_any == 0)