Skip to content

Commit b4af682

Browse files
committed
Merge tag 'sound-6.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Just a few small fixes. The only change to the core code is for a minor race in ALSA OSS sequencer, and the rest are all device-specific fixes (regression fixes and a usual quirk)" * tag 'sound-6.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: usb-audio: Add quirk flag for HEM devices to enable native DSD playback ALSA: usb-audio: Fix broken resume due to UAC3 power state ALSA: seq: oss: Fix racy open/close of MIDI devices ASoC: tegra: Fix Master Volume Control ALSA: hda/realtek: Add a quirk for Compaq N14JP6 firmware: cs_dsp: Log correct region name in bin error messages
2 parents b73056e + 227d2c3 commit b4af682

File tree

6 files changed

+35
-15
lines changed

6 files changed

+35
-15
lines changed

drivers/firmware/cirrus/cs_dsp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,6 +2124,7 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware
21242124
file, blocks, le32_to_cpu(blk->len),
21252125
type, le32_to_cpu(blk->id));
21262126

2127+
region_name = cs_dsp_mem_region_name(type);
21272128
mem = cs_dsp_find_region(dsp, type);
21282129
if (!mem) {
21292130
cs_dsp_err(dsp, "No base for region %x\n", type);
@@ -2147,8 +2148,8 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware
21472148
reg = dsp->ops->region_to_reg(mem, reg);
21482149
reg += offset;
21492150
} else {
2150-
cs_dsp_err(dsp, "No %x for algorithm %x\n",
2151-
type, le32_to_cpu(blk->id));
2151+
cs_dsp_err(dsp, "No %s for algorithm %x\n",
2152+
region_name, le32_to_cpu(blk->id));
21522153
}
21532154
break;
21542155

sound/core/seq/oss/seq_oss_midi.c

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ struct seq_oss_midi {
3737
struct snd_midi_event *coder; /* MIDI event coder */
3838
struct seq_oss_devinfo *devinfo; /* assigned OSSseq device */
3939
snd_use_lock_t use_lock;
40+
struct mutex open_mutex;
4041
};
4142

4243

@@ -172,6 +173,7 @@ snd_seq_oss_midi_check_new_port(struct snd_seq_port_info *pinfo)
172173
mdev->flags = pinfo->capability;
173174
mdev->opened = 0;
174175
snd_use_lock_init(&mdev->use_lock);
176+
mutex_init(&mdev->open_mutex);
175177

176178
/* copy and truncate the name of synth device */
177179
strscpy(mdev->name, pinfo->name, sizeof(mdev->name));
@@ -322,15 +324,17 @@ snd_seq_oss_midi_open(struct seq_oss_devinfo *dp, int dev, int fmode)
322324
int perm;
323325
struct seq_oss_midi *mdev;
324326
struct snd_seq_port_subscribe subs;
327+
int err;
325328

326329
mdev = get_mididev(dp, dev);
327330
if (!mdev)
328331
return -ENODEV;
329332

333+
mutex_lock(&mdev->open_mutex);
330334
/* already used? */
331335
if (mdev->opened && mdev->devinfo != dp) {
332-
snd_use_lock_free(&mdev->use_lock);
333-
return -EBUSY;
336+
err = -EBUSY;
337+
goto unlock;
334338
}
335339

336340
perm = 0;
@@ -340,14 +344,14 @@ snd_seq_oss_midi_open(struct seq_oss_devinfo *dp, int dev, int fmode)
340344
perm |= PERM_READ;
341345
perm &= mdev->flags;
342346
if (perm == 0) {
343-
snd_use_lock_free(&mdev->use_lock);
344-
return -ENXIO;
347+
err = -ENXIO;
348+
goto unlock;
345349
}
346350

347351
/* already opened? */
348352
if ((mdev->opened & perm) == perm) {
349-
snd_use_lock_free(&mdev->use_lock);
350-
return 0;
353+
err = 0;
354+
goto unlock;
351355
}
352356

353357
perm &= ~mdev->opened;
@@ -372,13 +376,17 @@ snd_seq_oss_midi_open(struct seq_oss_devinfo *dp, int dev, int fmode)
372376
}
373377

374378
if (! mdev->opened) {
375-
snd_use_lock_free(&mdev->use_lock);
376-
return -ENXIO;
379+
err = -ENXIO;
380+
goto unlock;
377381
}
378382

379383
mdev->devinfo = dp;
384+
err = 0;
385+
386+
unlock:
387+
mutex_unlock(&mdev->open_mutex);
380388
snd_use_lock_free(&mdev->use_lock);
381-
return 0;
389+
return err;
382390
}
383391

384392
/*
@@ -393,10 +401,9 @@ snd_seq_oss_midi_close(struct seq_oss_devinfo *dp, int dev)
393401
mdev = get_mididev(dp, dev);
394402
if (!mdev)
395403
return -ENODEV;
396-
if (! mdev->opened || mdev->devinfo != dp) {
397-
snd_use_lock_free(&mdev->use_lock);
398-
return 0;
399-
}
404+
mutex_lock(&mdev->open_mutex);
405+
if (!mdev->opened || mdev->devinfo != dp)
406+
goto unlock;
400407

401408
memset(&subs, 0, sizeof(subs));
402409
if (mdev->opened & PERM_WRITE) {
@@ -415,6 +422,8 @@ snd_seq_oss_midi_close(struct seq_oss_devinfo *dp, int dev)
415422
mdev->opened = 0;
416423
mdev->devinfo = NULL;
417424

425+
unlock:
426+
mutex_unlock(&mdev->open_mutex);
418427
snd_use_lock_free(&mdev->use_lock);
419428
return 0;
420429
}

sound/pci/hda/patch_realtek.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11740,6 +11740,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
1174011740
SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
1174111741
SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
1174211742
SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
11743+
SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
1174311744

1174411745
#if 0
1174511746
/* Below is a quirk table taken from the old code.

sound/soc/tegra/tegra_pcm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ int tegra_pcm_open(struct snd_soc_component *component,
117117
return ret;
118118
}
119119

120+
/* Set wait time to 500ms by default */
121+
substream->wait_time = 500;
122+
120123
return 0;
121124
}
122125
EXPORT_SYMBOL_GPL(tegra_pcm_open);

sound/usb/pcm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,10 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream)
650650
goto unlock;
651651
}
652652

653+
ret = snd_usb_pcm_change_state(subs, UAC3_PD_STATE_D0);
654+
if (ret < 0)
655+
goto unlock;
656+
653657
again:
654658
if (subs->sync_endpoint) {
655659
ret = snd_usb_endpoint_prepare(chip, subs->sync_endpoint);

sound/usb/quirks.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,6 +2191,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
21912191
QUIRK_FLAG_DSD_RAW),
21922192
VENDOR_FLG(0x2ab6, /* T+A devices */
21932193
QUIRK_FLAG_DSD_RAW),
2194+
VENDOR_FLG(0x3336, /* HEM devices */
2195+
QUIRK_FLAG_DSD_RAW),
21942196
VENDOR_FLG(0x3353, /* Khadas devices */
21952197
QUIRK_FLAG_DSD_RAW),
21962198
VENDOR_FLG(0x3842, /* EVGA */

0 commit comments

Comments
 (0)