ALSA: hda: Ignore unsol events for cards being shut down
PATCH 1/1 ALSA: hda: Ignore unsol events for cards being shut down
For the classic snd_hda_intel driver, codec->card and bus->card point to the exact same thing. When snd_card_diconnect() fires, bus->shutdown is set thanks to azx_dev_disconnect(). card->shutdown is already set when that happens but both provide basically the same functionality.
For the DSP snd_soc_avs driver where multiple codecs are located on multiple cards, bus->shutdown 'shortcut' is not sufficient. One codec card may be unregistered while other codecs are still operational. Proper check in form of card->shutdown must be used to verify whether the codec's card is being shut down.
--- sound/pci/hda/hda_bind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_bind.c +1 -1
@@ -44,7 +44,7 @@ static void hda_codec_unsol_event(struct hdac_device *dev, unsigned int ev) struct hda_codec *codec = container_of(dev, struct hda_codec, core);/* ignore unsol events during shutdown */ -if (codec->bus->shutdown) +if (codec->card->shutdown || codec->bus->shutdown)return ;/* ignore unsol events during system suspend/resume */
Signature · 1 line
2.25.1
Takashi Iwai
AppliedQuoted 6 lines · Cezary Rojewski
For the classic
snd_hda_inteldriver,codec->cardandbus->cardpoint to the exact same thing. Whensnd_card_diconnect()fires,bus->shutdownis set thanks toazx_dev_disconnect().card->shutdownis already set when that happens but both provide basically the same functionality.
Quoted 8 lines
For the DSP
snd_soc_avsdriver where multiple codecs are located on multiple cards,bus->shutdown'shortcut' is not sufficient. One codec card may be unregistered while other codecs are still operational. Proper check in form ofcard->shutdownmust be used to verify whether the codec's card is being shut down.Reviewed-by Amadeusz Sławiński <[email protected]>Signed-off-by Cezary Rojewski <[email protected]>
Thanks, applied now.
Takashi