Skip to content

Commit 8935f58

Browse files
committed
Merge remote-tracking branch 'takashi/for-next' into sound/upstream-20260528
2 parents 985ad41 + 72d8bf6 commit 8935f58

131 files changed

Lines changed: 2242 additions & 731 deletions

File tree

Some content is hidden

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

Documentation/sound/alsa-configuration.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,6 +2383,12 @@ quirk_flags
23832383
``V(x) = k * x``; ``dB(x) = 20 * log10(x)``. Overrides bit 24
23842384
* bit 28: ``mixer_capture_linear_vol``
23852385
Similar to bit 27 but for capture streams. Overrides bit 25
2386+
* bit 29: ``ifb_silence_on_empty``
2387+
In implicit feedback mode, when an entire capture URB returns with
2388+
all iso_frame_desc[i].status != 0 (bytes==0), do not silently return
2389+
from snd_usb_handle_sync_urb. Instead fall through and enqueue a
2390+
packet_info containing only size-0 packets, so the OUT ring keeps
2391+
moving (emits silence). Needed by Behringer Flow 8 (1397:050c).
23862392

23872393
This module supports multiple devices, autoprobe and hotplugging.
23882394

drivers/base/firmware_loader/main.c

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,7 @@ EXPORT_SYMBOL(release_firmware);
11321132
/* Async support */
11331133
struct firmware_work {
11341134
struct work_struct work;
1135+
struct list_head list;
11351136
struct module *module;
11361137
const char *name;
11371138
struct device *device;
@@ -1140,6 +1141,17 @@ struct firmware_work {
11401141
u32 opt_flags;
11411142
};
11421143

1144+
static LIST_HEAD(firmware_work_list);
1145+
static DEFINE_SPINLOCK(firmware_work_lock);
1146+
1147+
static void firmware_work_free(struct firmware_work *fw_work)
1148+
{
1149+
put_device(fw_work->device); /* taken in request_firmware_nowait() */
1150+
module_put(fw_work->module);
1151+
kfree_const(fw_work->name);
1152+
kfree(fw_work);
1153+
}
1154+
11431155
static void request_firmware_work_func(struct work_struct *work)
11441156
{
11451157
struct firmware_work *fw_work;
@@ -1150,11 +1162,15 @@ static void request_firmware_work_func(struct work_struct *work)
11501162
_request_firmware(&fw, fw_work->name, fw_work->device, NULL, 0, 0,
11511163
fw_work->opt_flags);
11521164
fw_work->cont(fw, fw_work->context);
1153-
put_device(fw_work->device); /* taken in request_firmware_nowait() */
11541165

1155-
module_put(fw_work->module);
1156-
kfree_const(fw_work->name);
1157-
kfree(fw_work);
1166+
spin_lock_irq(&firmware_work_lock);
1167+
if (!list_empty(&fw_work->list)) {
1168+
list_del_init(&fw_work->list);
1169+
spin_unlock_irq(&firmware_work_lock);
1170+
firmware_work_free(fw_work);
1171+
return;
1172+
}
1173+
spin_unlock_irq(&firmware_work_lock);
11581174
}
11591175

11601176

@@ -1164,6 +1180,7 @@ static int _request_firmware_nowait(
11641180
void (*cont)(const struct firmware *fw, void *context), bool nowarn)
11651181
{
11661182
struct firmware_work *fw_work;
1183+
unsigned long flags;
11671184

11681185
fw_work = kzalloc_obj(struct firmware_work, gfp);
11691186
if (!fw_work)
@@ -1196,7 +1213,12 @@ static int _request_firmware_nowait(
11961213

11971214
get_device(fw_work->device);
11981215
INIT_WORK(&fw_work->work, request_firmware_work_func);
1216+
1217+
spin_lock_irqsave(&firmware_work_lock, flags);
1218+
list_add_tail(&fw_work->list, &firmware_work_list);
11991219
schedule_work(&fw_work->work);
1220+
spin_unlock_irqrestore(&firmware_work_lock, flags);
1221+
12001222
return 0;
12011223
}
12021224

@@ -1259,6 +1281,44 @@ int firmware_request_nowait_nowarn(
12591281
}
12601282
EXPORT_SYMBOL_GPL(firmware_request_nowait_nowarn);
12611283

1284+
/**
1285+
* request_firmware_nowait_cancel() - cancel an async firmware request
1286+
* @device: device for which the firmware is being loaded
1287+
* @context: context passed to request_firmware_nowait()
1288+
* @cont: callback passed to request_firmware_nowait()
1289+
*
1290+
* Cancel a pending request_firmware_nowait() request for @device, @context
1291+
* and @cont. If the associated work has already started, this function waits
1292+
* until the callback has returned. If the callback has already completed, this
1293+
* function does nothing.
1294+
*
1295+
* This function may sleep.
1296+
*/
1297+
void request_firmware_nowait_cancel(struct device *device, void *context,
1298+
void (*cont)(const struct firmware *fw,
1299+
void *context))
1300+
{
1301+
struct firmware_work *fw_work = NULL;
1302+
struct firmware_work *tmp;
1303+
1304+
spin_lock_irq(&firmware_work_lock);
1305+
list_for_each_entry_reverse(tmp, &firmware_work_list, list) {
1306+
if (tmp->device == device && tmp->context == context &&
1307+
tmp->cont == cont) {
1308+
fw_work = tmp;
1309+
list_del_init(&fw_work->list);
1310+
break;
1311+
}
1312+
}
1313+
spin_unlock_irq(&firmware_work_lock);
1314+
1315+
if (!fw_work)
1316+
return;
1317+
cancel_work_sync(&fw_work->work);
1318+
firmware_work_free(fw_work);
1319+
}
1320+
EXPORT_SYMBOL_GPL(request_firmware_nowait_cancel);
1321+
12621322
#ifdef CONFIG_FW_CACHE
12631323
static ASYNC_DOMAIN_EXCLUSIVE(fw_cache_domain);
12641324

include/linux/firmware.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ int request_firmware_nowait(
110110
struct module *module, bool uevent,
111111
const char *name, struct device *device, gfp_t gfp, void *context,
112112
void (*cont)(const struct firmware *fw, void *context));
113+
void request_firmware_nowait_cancel(struct device *device, void *context,
114+
void (*cont)(const struct firmware *fw,
115+
void *context));
113116
int request_firmware_direct(const struct firmware **fw, const char *name,
114117
struct device *device);
115118
int request_firmware_into_buf(const struct firmware **firmware_p,
@@ -157,6 +160,13 @@ static inline int request_firmware_nowait(
157160
return -EINVAL;
158161
}
159162

163+
static inline void request_firmware_nowait_cancel(struct device *device,
164+
void *context,
165+
void (*cont)(const struct firmware *fw,
166+
void *context))
167+
{
168+
}
169+
160170
static inline void release_firmware(const struct firmware *fw)
161171
{
162172
}

include/sound/emux_synth.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ struct snd_emux {
125125
*/
126126
struct snd_emux_port {
127127

128-
struct snd_midi_channel_set chset;
129128
struct snd_emux *emu;
130129

131130
char port_mode; /* operation mode */
@@ -138,6 +137,7 @@ struct snd_emux_port {
138137
#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
139138
struct snd_seq_oss_arg *oss_arg;
140139
#endif
140+
struct snd_midi_channel_set chset;
141141
};
142142

143143
/* port_mode */

include/sound/seq_midi_emul.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ struct snd_midi_channel_set {
5555
int client; /* Client for this port */
5656
int port; /* The port number */
5757

58-
int max_channels; /* Size of the channels array */
59-
struct snd_midi_channel *channels;
60-
6158
unsigned char midi_mode; /* MIDI operating mode */
6259
unsigned char gs_master_volume; /* SYSEX master volume: 0-127 */
6360
unsigned char gs_chorus_mode;
6461
unsigned char gs_reverb_mode;
6562

63+
int max_channels; /* Size of the channels array */
64+
struct snd_midi_channel channels[] __counted_by(max_channels);
65+
6666
};
6767

6868
struct snd_midi_op {

include/sound/snd_wavefront.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
struct _snd_wavefront_midi;
1313
struct _snd_wavefront_card;
1414
struct _snd_wavefront;
15+
struct snd_wss;
1516

1617
typedef struct _snd_wavefront_midi snd_wavefront_midi_t;
1718
typedef struct _snd_wavefront_card snd_wavefront_card_t;
@@ -46,6 +47,8 @@ extern void snd_wavefront_midi_enable_virtual (snd_wavefront_card_t *);
4647
extern void snd_wavefront_midi_disable_virtual (snd_wavefront_card_t *);
4748
extern void snd_wavefront_midi_interrupt (snd_wavefront_card_t *);
4849
extern int snd_wavefront_midi_start (snd_wavefront_card_t *);
50+
void snd_wavefront_midi_suspend(snd_wavefront_card_t *card);
51+
void snd_wavefront_midi_resume(snd_wavefront_card_t *card);
4952

5053
struct _snd_wavefront {
5154
unsigned long irq; /* "you were one, one of the few ..." */
@@ -93,6 +96,7 @@ struct _snd_wavefront {
9396
int samples_used; /* how many */
9497
char interrupts_are_midi; /* h/w MPU interrupts enabled ? */
9598
char rom_samples_rdonly; /* can we write on ROM samples */
99+
char midi_in_to_synth; /* route external MIDI to synth */
96100
spinlock_t irq_lock;
97101
wait_queue_head_t interrupt_sleeper;
98102
snd_wavefront_midi_t midi; /* ICS2115 MIDI interface */
@@ -101,6 +105,7 @@ struct _snd_wavefront {
101105

102106
struct _snd_wavefront_card {
103107
snd_wavefront_t wavefront;
108+
struct snd_wss *chip;
104109
#ifdef CONFIG_PNP
105110
struct pnp_dev *wss;
106111
struct pnp_dev *ctrl;
@@ -110,8 +115,10 @@ struct _snd_wavefront_card {
110115
};
111116

112117
extern void snd_wavefront_internal_interrupt (snd_wavefront_card_t *card);
118+
void snd_wavefront_cache_firmware(snd_wavefront_t *dev);
113119
extern int snd_wavefront_start (snd_wavefront_t *dev);
114120
extern int snd_wavefront_detect (snd_wavefront_card_t *card);
121+
int snd_wavefront_resume_synth(snd_wavefront_card_t *card);
115122
extern int snd_wavefront_cmd (snd_wavefront_t *, int, unsigned char *,
116123
unsigned char *);
117124

sound/ac97_bus.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ int snd_ac97_reset(struct snd_ac97 *ac97, bool try_warm, unsigned int id,
7373

7474
if (snd_ac97_check_id(ac97, id, id_mask))
7575
return 0;
76-
7776
return -ENODEV;
7877
}
7978
EXPORT_SYMBOL_GPL(snd_ac97_reset);
8079

8180
const struct bus_type ac97_bus_type = {
8281
.name = "ac97",
8382
};
83+
EXPORT_SYMBOL(ac97_bus_type);
8484

8585
static int __init ac97_bus_init(void)
8686
{
@@ -96,7 +96,5 @@ static void __exit ac97_bus_exit(void)
9696

9797
module_exit(ac97_bus_exit);
9898

99-
EXPORT_SYMBOL(ac97_bus_type);
100-
10199
MODULE_DESCRIPTION("Legacy AC97 bus interface");
102100
MODULE_LICENSE("GPL");

sound/core/hrtimer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ MODULE_LICENSE("GPL");
2020
MODULE_ALIAS("snd-timer-" __stringify(SNDRV_TIMER_GLOBAL_HRTIMER));
2121

2222
#define NANO_SEC 1000000000UL /* 10^9 in sec */
23-
static unsigned int resolution;
23+
static unsigned int resolution __ro_after_init;
2424

2525
struct snd_hrtimer {
2626
struct snd_timer *timer;

sound/core/jack.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -250,18 +250,15 @@ static const char * const jack_events_name[] = {
250250
/* the recommended buffer size is 256 */
251251
static int parse_mask_bits(unsigned int mask_bits, char *buf, size_t buf_size)
252252
{
253+
int len = scnprintf(buf, buf_size, "0x%04x", mask_bits);
253254
int i;
254255

255-
scnprintf(buf, buf_size, "0x%04x", mask_bits);
256-
257256
for (i = 0; i < ARRAY_SIZE(jack_events_name); i++)
258-
if (mask_bits & (1 << i)) {
259-
strlcat(buf, " ", buf_size);
260-
strlcat(buf, jack_events_name[i], buf_size);
261-
}
262-
strlcat(buf, "\n", buf_size);
257+
if (mask_bits & (1 << i))
258+
len += scnprintf(buf + len, buf_size - len, " %s", jack_events_name[i]);
259+
len += scnprintf(buf + len, buf_size - len, "\n");
263260

264-
return strlen(buf);
261+
return len;
265262
}
266263

267264
static ssize_t jack_kctl_mask_bits_read(struct file *file,

sound/core/oss/pcm_oss.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232

3333
#define OSS_ALSAEMULVER _SIOR ('M', 249, int)
3434

35-
static int dsp_map[SNDRV_CARDS];
36-
static int adsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
35+
static int dsp_map[SNDRV_CARDS] __ro_after_init;
36+
static int adsp_map[SNDRV_CARDS] __ro_after_init = {[0 ... (SNDRV_CARDS-1)] = 1};
3737
static bool nonblock_open = 1;
3838

3939
MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Abramo Bagnara <abramo@alsa-project.org>");
@@ -2974,8 +2974,10 @@ static void snd_pcm_oss_proc_read(struct snd_info_entry *entry,
29742974
struct snd_info_buffer *buffer)
29752975
{
29762976
struct snd_pcm_str *pstr = entry->private_data;
2977-
struct snd_pcm_oss_setup *setup = pstr->oss.setup_list;
2977+
struct snd_pcm_oss_setup *setup;
2978+
29782979
guard(mutex)(&pstr->oss.setup_mutex);
2980+
setup = pstr->oss.setup_list;
29792981
while (setup) {
29802982
snd_iprintf(buffer, "%s %u %u%s%s%s%s%s%s\n",
29812983
setup->task_name,
@@ -3060,19 +3062,21 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry,
30603062
buffer->error = -ENOMEM;
30613063
return;
30623064
}
3065+
template.task_name = kstrdup(task_name, GFP_KERNEL);
3066+
if (!template.task_name) {
3067+
kfree(setup);
3068+
buffer->error = -ENOMEM;
3069+
return;
3070+
}
3071+
*setup = template;
30633072
if (pstr->oss.setup_list == NULL)
30643073
pstr->oss.setup_list = setup;
30653074
else {
30663075
for (setup1 = pstr->oss.setup_list;
30673076
setup1->next; setup1 = setup1->next);
30683077
setup1->next = setup;
30693078
}
3070-
template.task_name = kstrdup(task_name, GFP_KERNEL);
3071-
if (! template.task_name) {
3072-
kfree(setup);
3073-
buffer->error = -ENOMEM;
3074-
return;
3075-
}
3079+
continue;
30763080
}
30773081
*setup = template;
30783082
}

0 commit comments

Comments
 (0)