Skip to content

Commit 2af5acb

Browse files
committed
Merge tag 'sound-6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A large collection of fixes around this time. All small and mostly trivial fixes. - Lots of fixes for the new -Wformat-truncation warnings - A fix in ALSA rawmidi core regression and UMP handling - Series of Cirrus codec fixes - ASoC Intel and Realtek codec fixes - Usual HD- and USB-audio quirks and AMD ASoC quirks" * tag 'sound-6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (64 commits) ALSA: hda/realtek - ALC287 Realtek I2S speaker platform support ALSA: hda: cs35l56: Use the new RUNTIME_PM_OPS() macro ALSA: usb-audio: scarlett_gen2: Fix another -Wformat-truncation warning ALSA: rawmidi: Fix NULL dereference at proc read ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful ASoC: SOF: Intel: MTL: Reduce the DSP init timeout ASoC: cs42l43: Add shared IRQ flag for shutters ASoC: imx-audmix: Fix return error with devm_clk_get() ASoC: hdaudio.c: Add missing check for devm_kstrdup ALSA: riptide: Fix -Wformat-truncation warning for longname string ALSA: cs4231: Fix -Wformat-truncation warning for longname string ALSA: ad1848: Fix -Wformat-truncation warning for longname string ALSA: hda: generic: Check potential mixer name string truncation ALSA: cmipci: Fix -Wformat-truncation warning ALSA: firewire: Fix -Wformat-truncation warning for MIDI stream names ALSA: firewire: Fix -Wformat-truncation warning for longname string ALSA: xen: Fix -Wformat-truncation warning ALSA: opti9x: Fix -Wformat-truncation warning ALSA: es1688: Fix -Wformat-truncation warning ALSA: cs4236: Fix -Wformat-truncation warning ...
2 parents b300c0f + 0eb0e27 commit 2af5acb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+352
-249
lines changed

Documentation/sound/designs/midi-2.0.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ topology based on those information. When the device is older and
7474
doesn't respond to the new UMP inquiries, the driver falls back and
7575
builds the topology based on Group Terminal Block (GTB) information
7676
from the USB descriptor. Some device might be screwed up by the
77-
unexpected UMP command; in such a case, pass `midi2_probe=0` option to
78-
snd-usb-audio driver for skipping the UMP v1.1 inquiries.
77+
unexpected UMP command; in such a case, pass `midi2_ump_probe=0`
78+
option to snd-usb-audio driver for skipping the UMP v1.1 inquiries.
7979

8080
When the MIDI 2.0 device is probed, the kernel creates a rawmidi
8181
device for each UMP Endpoint of the device. Its device name is

drivers/firmware/cirrus/cs_dsp.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,15 +1863,15 @@ static int cs_dsp_adsp2_setup_algs(struct cs_dsp *dsp)
18631863
return PTR_ERR(adsp2_alg);
18641864

18651865
for (i = 0; i < n_algs; i++) {
1866-
cs_dsp_info(dsp,
1867-
"%d: ID %x v%d.%d.%d XM@%x YM@%x ZM@%x\n",
1868-
i, be32_to_cpu(adsp2_alg[i].alg.id),
1869-
(be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff0000) >> 16,
1870-
(be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff00) >> 8,
1871-
be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff,
1872-
be32_to_cpu(adsp2_alg[i].xm),
1873-
be32_to_cpu(adsp2_alg[i].ym),
1874-
be32_to_cpu(adsp2_alg[i].zm));
1866+
cs_dsp_dbg(dsp,
1867+
"%d: ID %x v%d.%d.%d XM@%x YM@%x ZM@%x\n",
1868+
i, be32_to_cpu(adsp2_alg[i].alg.id),
1869+
(be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff0000) >> 16,
1870+
(be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff00) >> 8,
1871+
be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff,
1872+
be32_to_cpu(adsp2_alg[i].xm),
1873+
be32_to_cpu(adsp2_alg[i].ym),
1874+
be32_to_cpu(adsp2_alg[i].zm));
18751875

18761876
alg_region = cs_dsp_create_region(dsp, WMFW_ADSP2_XM,
18771877
adsp2_alg[i].alg.id,
@@ -1996,14 +1996,14 @@ static int cs_dsp_halo_setup_algs(struct cs_dsp *dsp)
19961996
return PTR_ERR(halo_alg);
19971997

19981998
for (i = 0; i < n_algs; i++) {
1999-
cs_dsp_info(dsp,
2000-
"%d: ID %x v%d.%d.%d XM@%x YM@%x\n",
2001-
i, be32_to_cpu(halo_alg[i].alg.id),
2002-
(be32_to_cpu(halo_alg[i].alg.ver) & 0xff0000) >> 16,
2003-
(be32_to_cpu(halo_alg[i].alg.ver) & 0xff00) >> 8,
2004-
be32_to_cpu(halo_alg[i].alg.ver) & 0xff,
2005-
be32_to_cpu(halo_alg[i].xm_base),
2006-
be32_to_cpu(halo_alg[i].ym_base));
1999+
cs_dsp_dbg(dsp,
2000+
"%d: ID %x v%d.%d.%d XM@%x YM@%x\n",
2001+
i, be32_to_cpu(halo_alg[i].alg.id),
2002+
(be32_to_cpu(halo_alg[i].alg.ver) & 0xff0000) >> 16,
2003+
(be32_to_cpu(halo_alg[i].alg.ver) & 0xff00) >> 8,
2004+
be32_to_cpu(halo_alg[i].alg.ver) & 0xff,
2005+
be32_to_cpu(halo_alg[i].xm_base),
2006+
be32_to_cpu(halo_alg[i].ym_base));
20072007

20082008
ret = cs_dsp_halo_create_regions(dsp, halo_alg[i].alg.id,
20092009
halo_alg[i].alg.ver,

sound/core/init.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,6 @@ static int snd_card_init(struct snd_card *card, struct device *parent,
278278
size_t extra_size)
279279
{
280280
int err;
281-
#ifdef CONFIG_SND_DEBUG
282-
char name[8];
283-
#endif
284281

285282
if (extra_size > 0)
286283
card->private_data = (char *)card + sizeof(struct snd_card);
@@ -364,8 +361,8 @@ static int snd_card_init(struct snd_card *card, struct device *parent,
364361
}
365362

366363
#ifdef CONFIG_SND_DEBUG
367-
sprintf(name, "card%d", idx);
368-
card->debugfs_root = debugfs_create_dir(name, sound_debugfs_root);
364+
card->debugfs_root = debugfs_create_dir(dev_name(&card->card_dev),
365+
sound_debugfs_root);
369366
#endif
370367
return 0;
371368

sound/core/rawmidi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ static void snd_rawmidi_proc_info_read(struct snd_info_entry *entry,
17701770
if (IS_ENABLED(CONFIG_SND_UMP))
17711771
snd_iprintf(buffer, "Type: %s\n",
17721772
rawmidi_is_ump(rmidi) ? "UMP" : "Legacy");
1773-
if (rmidi->ops->proc_read)
1773+
if (rmidi->ops && rmidi->ops->proc_read)
17741774
rmidi->ops->proc_read(entry, buffer);
17751775
mutex_lock(&rmidi->open_mutex);
17761776
if (rmidi->info_flags & SNDRV_RAWMIDI_INFO_OUTPUT) {

sound/core/seq/seq_midi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ snd_seq_midisynth_probe(struct device *_dev)
349349
if (! port->name[0]) {
350350
if (info->name[0]) {
351351
if (ports > 1)
352-
snprintf(port->name, sizeof(port->name), "%s-%u", info->name, p);
352+
scnprintf(port->name, sizeof(port->name), "%s-%u", info->name, p);
353353
else
354-
snprintf(port->name, sizeof(port->name), "%s", info->name);
354+
scnprintf(port->name, sizeof(port->name), "%s", info->name);
355355
} else {
356356
/* last resort */
357357
if (ports > 1)

sound/core/seq/seq_ump_client.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static void fill_port_info(struct snd_seq_port_info *port,
207207
SNDRV_SEQ_PORT_TYPE_PORT;
208208
port->midi_channels = 16;
209209
if (*group->name)
210-
snprintf(port->name, sizeof(port->name), "Group %d (%s)",
210+
snprintf(port->name, sizeof(port->name), "Group %d (%.53s)",
211211
group->group + 1, group->name);
212212
else
213213
sprintf(port->name, "Group %d", group->group + 1);
@@ -416,6 +416,25 @@ static void setup_client_midi_version(struct seq_ump_client *client)
416416
snd_seq_kernel_client_put(cptr);
417417
}
418418

419+
/* set up client's group_filter bitmap */
420+
static void setup_client_group_filter(struct seq_ump_client *client)
421+
{
422+
struct snd_seq_client *cptr;
423+
unsigned int filter;
424+
int p;
425+
426+
cptr = snd_seq_kernel_client_get(client->seq_client);
427+
if (!cptr)
428+
return;
429+
filter = ~(1U << 0); /* always allow groupless messages */
430+
for (p = 0; p < SNDRV_UMP_MAX_GROUPS; p++) {
431+
if (client->groups[p].active)
432+
filter &= ~(1U << (p + 1));
433+
}
434+
cptr->group_filter = filter;
435+
snd_seq_kernel_client_put(cptr);
436+
}
437+
419438
/* UMP group change notification */
420439
static void handle_group_notify(struct work_struct *work)
421440
{
@@ -424,6 +443,7 @@ static void handle_group_notify(struct work_struct *work)
424443

425444
update_group_attrs(client);
426445
update_port_infos(client);
446+
setup_client_group_filter(client);
427447
}
428448

429449
/* UMP FB change notification */
@@ -492,6 +512,8 @@ static int snd_seq_ump_probe(struct device *_dev)
492512
goto error;
493513
}
494514

515+
setup_client_group_filter(client);
516+
495517
err = create_ump_endpoint_port(client);
496518
if (err < 0)
497519
goto error;

sound/core/seq/seq_ump_convert.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,8 @@ int snd_seq_deliver_to_ump(struct snd_seq_client *source,
11971197
struct snd_seq_event *event,
11981198
int atomic, int hop)
11991199
{
1200+
if (dest->group_filter & (1U << dest_port->ump_group))
1201+
return 0; /* group filtered - skip the event */
12001202
if (event->type == SNDRV_SEQ_EVENT_SYSEX)
12011203
return cvt_sysex_to_ump(dest, dest_port, event, atomic, hop);
12021204
else if (snd_seq_client_is_midi2(dest))

sound/firewire/bebob/bebob_midi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ static void set_midi_substream_names(struct snd_bebob *bebob,
8484
struct snd_rawmidi_substream *subs;
8585

8686
list_for_each_entry(subs, &str->substreams, list) {
87-
snprintf(subs->name, sizeof(subs->name),
88-
"%s MIDI %d",
89-
bebob->card->shortname, subs->number + 1);
87+
scnprintf(subs->name, sizeof(subs->name),
88+
"%s MIDI %d",
89+
bebob->card->shortname, subs->number + 1);
9090
}
9191
}
9292

sound/firewire/dice/dice-midi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ static void set_midi_substream_names(struct snd_dice *dice,
8888
struct snd_rawmidi_substream *subs;
8989

9090
list_for_each_entry(subs, &str->substreams, list) {
91-
snprintf(subs->name, sizeof(subs->name),
92-
"%s MIDI %d", dice->card->shortname, subs->number + 1);
91+
scnprintf(subs->name, sizeof(subs->name),
92+
"%s MIDI %d", dice->card->shortname, subs->number + 1);
9393
}
9494
}
9595

sound/firewire/digi00x/digi00x-midi.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ static void set_substream_names(struct snd_dg00x *dg00x,
100100

101101
list_for_each_entry(subs, &str->substreams, list) {
102102
if (!is_console) {
103-
snprintf(subs->name, sizeof(subs->name),
104-
"%s MIDI %d",
105-
dg00x->card->shortname,
106-
subs->number + 1);
103+
scnprintf(subs->name, sizeof(subs->name),
104+
"%s MIDI %d",
105+
dg00x->card->shortname,
106+
subs->number + 1);
107107
} else {
108-
snprintf(subs->name, sizeof(subs->name),
109-
"%s control",
110-
dg00x->card->shortname);
108+
scnprintf(subs->name, sizeof(subs->name),
109+
"%s control",
110+
dg00x->card->shortname);
111111
}
112112
}
113113
}

0 commit comments

Comments
 (0)