Patch "ALSA: ump: Set default protocol when not given explicitly" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ALSA: ump: Set default protocol when not given explicitly

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     alsa-ump-set-default-protocol-when-not-given-explici.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1f13b8b39b3b6aab4d04d15717639019100af062
Author: Takashi Iwai <tiwai@xxxxxxx>
Date:   Wed May 29 18:47:17 2024 +0200

    ALSA: ump: Set default protocol when not given explicitly
    
    [ Upstream commit bc42ca002d5d211f9c57334b9b4c25ddb0b4ec35 ]
    
    When an inquiry of the current protocol via UMP Stream Configuration
    message fails by some reason, we may leave the current protocol
    undefined, which may lead to unexpected behavior.  Better to assume a
    valid protocol found in the protocol capability bits instead.
    
    For a device that doesn't support the UMP v1.2 feature, it won't reach
    to this code path, and USB MIDI GTB descriptor would be used for
    determining the protocol, instead.
    
    Link: https://lore.kernel.org/r/20240529164723.18309-2-tiwai@xxxxxxx
    Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/core/ump.c b/sound/core/ump.c
index 3cd07c103d9ea..d68d3bda97e42 100644
--- a/sound/core/ump.c
+++ b/sound/core/ump.c
@@ -967,6 +967,14 @@ int snd_ump_parse_endpoint(struct snd_ump_endpoint *ump)
 	if (err < 0)
 		ump_dbg(ump, "Unable to get UMP EP stream config\n");
 
+	/* If no protocol is set by some reason, assume the valid one */
+	if (!(ump->info.protocol & SNDRV_UMP_EP_INFO_PROTO_MIDI_MASK)) {
+		if (ump->info.protocol_caps & SNDRV_UMP_EP_INFO_PROTO_MIDI2)
+			ump->info.protocol |= SNDRV_UMP_EP_INFO_PROTO_MIDI2;
+		else if (ump->info.protocol_caps & SNDRV_UMP_EP_INFO_PROTO_MIDI1)
+			ump->info.protocol |= SNDRV_UMP_EP_INFO_PROTO_MIDI1;
+	}
+
 	/* Query and create blocks from Function Blocks */
 	for (blk = 0; blk < ump->info.num_blocks; blk++) {
 		err = create_block_from_fb_info(ump, blk);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux