Merge tag 'sound-5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"Two core fixes for long-standing bugs for the races at concurrent
device creation and deletion that were (unsurprisingly) spotted by
syzkaller with usb-fuzzer.

The rest are usual small HD-audio fixes"

* tag 'sound-5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/realtek - add two more pin configuration sets to quirk table
ALSA: core: Fix card races between register and disconnect
ALSA: info: Fix racy addition/deletion of nodes
ALSA: hda: Initialize power_state field properly

Changed files
+26 -11
sound
+10 -2
sound/core/info.c
··· 713 713 INIT_LIST_HEAD(&entry->list); 714 714 entry->parent = parent; 715 715 entry->module = module; 716 - if (parent) 716 + if (parent) { 717 + mutex_lock(&parent->access); 717 718 list_add_tail(&entry->list, &parent->children); 719 + mutex_unlock(&parent->access); 720 + } 718 721 return entry; 719 722 } 720 723 ··· 795 792 list_for_each_entry_safe(p, n, &entry->children, list) 796 793 snd_info_free_entry(p); 797 794 798 - list_del(&entry->list); 795 + p = entry->parent; 796 + if (p) { 797 + mutex_lock(&p->access); 798 + list_del(&entry->list); 799 + mutex_unlock(&p->access); 800 + } 799 801 kfree(entry->name); 800 802 if (entry->private_free) 801 803 entry->private_free(entry);
+9 -9
sound/core/init.c
··· 382 382 card->shutdown = 1; 383 383 spin_unlock(&card->files_lock); 384 384 385 - /* phase 1: disable fops (user space) operations for ALSA API */ 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 - 385 + /* replace file->f_op with special dummy operations */ 393 386 spin_lock(&card->files_lock); 394 387 list_for_each_entry(mfile, &card->files_list, list) { 395 388 /* it's critical part, use endless loop */ ··· 398 405 } 399 406 spin_unlock(&card->files_lock); 400 407 401 - /* phase 3: notify all connected devices about disconnection */ 408 + /* notify all connected devices about disconnection */ 402 409 /* at this point, they cannot respond to any calls except release() */ 403 410 404 411 #if IS_ENABLED(CONFIG_SND_MIXER_OSS) ··· 414 421 device_del(&card->card_dev); 415 422 card->registered = false; 416 423 } 424 + 425 + /* disable fops (user space) operations for ALSA API */ 426 + mutex_lock(&snd_card_mutex); 427 + snd_cards[card->number] = NULL; 428 + clear_bit(card->number, snd_cards_lock); 429 + mutex_unlock(&snd_card_mutex); 430 + 417 431 #ifdef CONFIG_PM 418 432 wake_up(&card->power_sleep); 419 433 #endif
+1
sound/pci/hda/hda_codec.c
··· 969 969 970 970 /* power-up all before initialization */ 971 971 hda_set_power_state(codec, AC_PWRST_D0); 972 + codec->core.dev.power.power_state = PMSG_ON; 972 973 973 974 snd_hda_codec_proc_new(codec); 974 975
+6
sound/pci/hda/patch_realtek.c
··· 7266 7266 {0x12, 0x90a60140}, 7267 7267 {0x14, 0x90170150}, 7268 7268 {0x21, 0x02211020}), 7269 + SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 7270 + {0x21, 0x02211020}), 7269 7271 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, 7270 7272 {0x14, 0x90170110}, 7271 7273 {0x21, 0x02211020}), ··· 7378 7376 {0x21, 0x0221101f}), 7379 7377 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 7380 7378 ALC256_STANDARD_PINS), 7379 + SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 7380 + {0x14, 0x90170110}, 7381 + {0x1b, 0x01011020}, 7382 + {0x21, 0x0221101f}), 7381 7383 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, 7382 7384 {0x14, 0x90170110}, 7383 7385 {0x1b, 0x90a70130},