diff options
| -rw-r--r-- | sound/core/info.c | 12 | ||||
| -rw-r--r-- | sound/core/init.c | 18 | ||||
| -rw-r--r-- | sound/pci/hda/hda_codec.c | 1 | ||||
| -rw-r--r-- | sound/pci/hda/patch_realtek.c | 6 |
4 files changed, 26 insertions, 11 deletions
diff --git a/sound/core/info.c b/sound/core/info.c index 96a074019c33..0eb169acc850 100644 --- a/sound/core/info.c +++ b/sound/core/info.c | |||
| @@ -713,8 +713,11 @@ snd_info_create_entry(const char *name, struct snd_info_entry *parent, | |||
| 713 | INIT_LIST_HEAD(&entry->list); | 713 | INIT_LIST_HEAD(&entry->list); |
| 714 | entry->parent = parent; | 714 | entry->parent = parent; |
| 715 | entry->module = module; | 715 | entry->module = module; |
| 716 | if (parent) | 716 | if (parent) { |
| 717 | mutex_lock(&parent->access); | ||
| 717 | list_add_tail(&entry->list, &parent->children); | 718 | list_add_tail(&entry->list, &parent->children); |
| 719 | mutex_unlock(&parent->access); | ||
| 720 | } | ||
| 718 | return entry; | 721 | return entry; |
| 719 | } | 722 | } |
| 720 | 723 | ||
| @@ -792,7 +795,12 @@ void snd_info_free_entry(struct snd_info_entry * entry) | |||
| 792 | list_for_each_entry_safe(p, n, &entry->children, list) | 795 | list_for_each_entry_safe(p, n, &entry->children, list) |
| 793 | snd_info_free_entry(p); | 796 | snd_info_free_entry(p); |
| 794 | 797 | ||
| 795 | list_del(&entry->list); | 798 | p = entry->parent; |
| 799 | if (p) { | ||
| 800 | mutex_lock(&p->access); | ||
| 801 | list_del(&entry->list); | ||
| 802 | mutex_unlock(&p->access); | ||
| 803 | } | ||
| 796 | kfree(entry->name); | 804 | kfree(entry->name); |
| 797 | if (entry->private_free) | 805 | if (entry->private_free) |
| 798 | entry->private_free(entry); | 806 | entry->private_free(entry); |
diff --git a/sound/core/init.c b/sound/core/init.c index 0c4dc40376a7..079c12d64b0e 100644 --- a/sound/core/init.c +++ b/sound/core/init.c | |||
| @@ -382,14 +382,7 @@ int snd_card_disconnect(struct snd_card *card) | |||
| 382 | card->shutdown = 1; | 382 | card->shutdown = 1; |
| 383 | spin_unlock(&card->files_lock); | 383 | spin_unlock(&card->files_lock); |
| 384 | 384 | ||
| 385 | /* phase 1: disable fops (user space) operations for ALSA API */ | 385 | /* replace file->f_op with special dummy operations */ |
| 386 | mutex_lock(&snd_card_mutex); | ||
| 387 | snd_cards[card->number] = NULL; | ||
| 388 | clear_bit(card->number, snd_cards_lock); | ||
| 389 | mutex_unlock(&snd_card_mutex); | ||
| 390 | |||
| 391 | /* phase 2: replace file->f_op with special dummy operations */ | ||
| 392 | |||
| 393 | spin_lock(&card->files_lock); | 386 | spin_lock(&card->files_lock); |
| 394 | list_for_each_entry(mfile, &card->files_list, list) { | 387 | list_for_each_entry(mfile, &card->files_list, list) { |
| 395 | /* it's critical part, use endless loop */ | 388 | /* it's critical part, use endless loop */ |
| @@ -405,7 +398,7 @@ int snd_card_disconnect(struct snd_card *card) | |||
| 405 | } | 398 | } |
| 406 | spin_unlock(&card->files_lock); | 399 | spin_unlock(&card->files_lock); |
| 407 | 400 | ||
| 408 | /* phase 3: notify all connected devices about disconnection */ | 401 | /* notify all connected devices about disconnection */ |
| 409 | /* at this point, they cannot respond to any calls except release() */ | 402 | /* at this point, they cannot respond to any calls except release() */ |
| 410 | 403 | ||
| 411 | #if IS_ENABLED(CONFIG_SND_MIXER_OSS) | 404 | #if IS_ENABLED(CONFIG_SND_MIXER_OSS) |
| @@ -421,6 +414,13 @@ int snd_card_disconnect(struct snd_card *card) | |||
| 421 | device_del(&card->card_dev); | 414 | device_del(&card->card_dev); |
| 422 | card->registered = false; | 415 | card->registered = false; |
| 423 | } | 416 | } |
| 417 | |||
| 418 | /* disable fops (user space) operations for ALSA API */ | ||
| 419 | mutex_lock(&snd_card_mutex); | ||
| 420 | snd_cards[card->number] = NULL; | ||
| 421 | clear_bit(card->number, snd_cards_lock); | ||
| 422 | mutex_unlock(&snd_card_mutex); | ||
| 423 | |||
| 424 | #ifdef CONFIG_PM | 424 | #ifdef CONFIG_PM |
| 425 | wake_up(&card->power_sleep); | 425 | wake_up(&card->power_sleep); |
| 426 | #endif | 426 | #endif |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index ec0b8595eb4d..701a69d856f5 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
| @@ -969,6 +969,7 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card, | |||
| 969 | 969 | ||
| 970 | /* power-up all before initialization */ | 970 | /* power-up all before initialization */ |
| 971 | hda_set_power_state(codec, AC_PWRST_D0); | 971 | hda_set_power_state(codec, AC_PWRST_D0); |
| 972 | codec->core.dev.power.power_state = PMSG_ON; | ||
| 972 | 973 | ||
| 973 | snd_hda_codec_proc_new(codec); | 974 | snd_hda_codec_proc_new(codec); |
| 974 | 975 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 810479766090..f5b510f119ed 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -7266,6 +7266,8 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { | |||
| 7266 | {0x12, 0x90a60140}, | 7266 | {0x12, 0x90a60140}, |
| 7267 | {0x14, 0x90170150}, | 7267 | {0x14, 0x90170150}, |
| 7268 | {0x21, 0x02211020}), | 7268 | {0x21, 0x02211020}), |
| 7269 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | ||
| 7270 | {0x21, 0x02211020}), | ||
| 7269 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, | 7271 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
| 7270 | {0x14, 0x90170110}, | 7272 | {0x14, 0x90170110}, |
| 7271 | {0x21, 0x02211020}), | 7273 | {0x21, 0x02211020}), |
| @@ -7376,6 +7378,10 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { | |||
| 7376 | {0x21, 0x0221101f}), | 7378 | {0x21, 0x0221101f}), |
| 7377 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | 7379 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7378 | ALC256_STANDARD_PINS), | 7380 | ALC256_STANDARD_PINS), |
| 7381 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | ||
| 7382 | {0x14, 0x90170110}, | ||
| 7383 | {0x1b, 0x01011020}, | ||
| 7384 | {0x21, 0x0221101f}), | ||
| 7379 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, | 7385 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 7380 | {0x14, 0x90170110}, | 7386 | {0x14, 0x90170110}, |
| 7381 | {0x1b, 0x90a70130}, | 7387 | {0x1b, 0x90a70130}, |
