Skip to content

Commit dca45ef

Browse files
committed
Merge tag 'sound-fix-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Here are a few remaining patches for 6.1-rc1. The major changes are the hibernation fixes for HD-audio CS35L41 codec and the USB-audio small fixes against the last change. In addition, a couple of HD-audio regression fixes and a couple of potential mutex-deadlock fixes with OSS emulation in ALSA core side are seen" * tag 'sound-fix-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda: cs35l41: Support System Suspend ALSA: hda: cs35l41: Remove suspend/resume hda hooks ALSA: hda/cs_dsp_ctl: Fix mutex inversion when creating controls ALSA: hda: hda_cs_dsp_ctl: Ensure pwr_lock is held before reading/writing controls ALSA: hda: hda_cs_dsp_ctl: Minor clean and redundant code removal ALSA: oss: Fix potential deadlock at unregistration ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free() ALSA: hda/realtek: Add Intel Reference SSID to support headset keys ALSA: hda/realtek: Add quirk for ASUS GV601R laptop ALSA: hda/realtek: Correct pin configs for ASUS G533Z ALSA: usb-audio: Avoid superfluous endpoint setup ALSA: usb-audio: Correct the return code from snd_usb_endpoint_set_params() ALSA: usb-audio: Apply mutex around snd_usb_endpoint_set_params() ALSA: usb-audio: Avoid unnecessary interface change at EP close ALSA: hda: Update register polling macros ALSA: hda/realtek: remove ALC289_FIXUP_DUAL_SPK for Dell 5530
2 parents 5964c92 + 8867282 commit dca45ef

File tree

10 files changed

+245
-123
lines changed

10 files changed

+245
-123
lines changed

include/sound/hdaudio.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,11 @@ int snd_hdac_get_stream_stripe_ctl(struct hdac_bus *bus,
592592
#define snd_hdac_stream_readb(dev, reg) \
593593
snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
594594
#define snd_hdac_stream_readb_poll(dev, reg, val, cond, delay_us, timeout_us) \
595-
readb_poll_timeout((dev)->sd_addr + AZX_REG_ ## reg, val, cond, \
596-
delay_us, timeout_us)
595+
read_poll_timeout_atomic(snd_hdac_reg_readb, val, cond, delay_us, timeout_us, \
596+
false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
597597
#define snd_hdac_stream_readl_poll(dev, reg, val, cond, delay_us, timeout_us) \
598-
readl_poll_timeout((dev)->sd_addr + AZX_REG_ ## reg, val, cond, \
599-
delay_us, timeout_us)
598+
read_poll_timeout_atomic(snd_hdac_reg_readl, val, cond, delay_us, timeout_us, \
599+
false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
600600

601601
/* update a register, pass without AZX_REG_ prefix */
602602
#define snd_hdac_stream_updatel(dev, reg, mask, val) \

sound/core/rawmidi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,10 +1899,8 @@ static int snd_rawmidi_free(struct snd_rawmidi *rmidi)
18991899

19001900
snd_info_free_entry(rmidi->proc_entry);
19011901
rmidi->proc_entry = NULL;
1902-
mutex_lock(&register_mutex);
19031902
if (rmidi->ops && rmidi->ops->dev_unregister)
19041903
rmidi->ops->dev_unregister(rmidi);
1905-
mutex_unlock(&register_mutex);
19061904

19071905
snd_rawmidi_free_substreams(&rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT]);
19081906
snd_rawmidi_free_substreams(&rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT]);

sound/core/sound_oss.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ int snd_unregister_oss_device(int type, struct snd_card *card, int dev)
162162
mutex_unlock(&sound_oss_mutex);
163163
return -ENOENT;
164164
}
165-
unregister_sound_special(minor);
166165
switch (SNDRV_MINOR_OSS_DEVICE(minor)) {
167166
case SNDRV_MINOR_OSS_PCM:
168167
track2 = SNDRV_MINOR_OSS(cidx, SNDRV_MINOR_OSS_AUDIO);
@@ -174,12 +173,18 @@ int snd_unregister_oss_device(int type, struct snd_card *card, int dev)
174173
track2 = SNDRV_MINOR_OSS(cidx, SNDRV_MINOR_OSS_DMMIDI1);
175174
break;
176175
}
177-
if (track2 >= 0) {
178-
unregister_sound_special(track2);
176+
if (track2 >= 0)
179177
snd_oss_minors[track2] = NULL;
180-
}
181178
snd_oss_minors[minor] = NULL;
182179
mutex_unlock(&sound_oss_mutex);
180+
181+
/* call unregister_sound_special() outside sound_oss_mutex;
182+
* otherwise may deadlock, as it can trigger the release of a card
183+
*/
184+
unregister_sound_special(minor);
185+
if (track2 >= 0)
186+
unregister_sound_special(track2);
187+
183188
kfree(mptr);
184189
return 0;
185190
}

0 commit comments

Comments
 (0)