]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ALSA: hda: Fix regressions on clear and reconfig sysfs
authorTakashi Iwai <tiwai@suse.de>
Wed, 9 Dec 2020 15:01:19 +0000 (16:01 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 20 Jan 2021 13:26:17 +0000 (14:26 +0100)
BugLink: https://bugs.launchpad.net/bugs/1910822
commit 2506318e382c4c7daa77bdc48f80a0ee82804588 upstream.

It seems that the HD-audio clear and reconfig sysfs don't work any
longer after the recent driver core change.  There are multiple issues
around that: the linked list corruption and the dead device handling.
The former issue is fixed by another patch for the driver core itself,
while the latter patch needs to be addressed in HD-audio side.

This patch corresponds to the latter, it recovers those broken
functions by replacing the device detach and attach actions with the
standard core API functions, which are almost equivalent with unbind
and bind actions.

Fixes: 654888327e9f ("driver core: Avoid binding drivers to dead devices")
Cc: <stable@vger.kernel.org>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209207
Link: https://lore.kernel.org/r/20201209150119.7705-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_sysfs.c

index a39dbf4fa332a1b908524edffe8cec084ae0d9b9..60ddad98eff540c7fc36f97b626c9a188c177c15 100644 (file)
@@ -1798,7 +1798,7 @@ int snd_hda_codec_reset(struct hda_codec *codec)
                return -EBUSY;
 
        /* OK, let it free */
-       snd_hdac_device_unregister(&codec->core);
+       device_release_driver(hda_codec_dev(codec));
 
        /* allow device access again */
        snd_hda_unlock_devices(bus);
index eb8ec109d7adb5ce187567b2a5a8c10bdc3eec05..d5ffcba794e50f50a138e49ecfbdd9462afb2491 100644 (file)
@@ -139,7 +139,7 @@ static int reconfig_codec(struct hda_codec *codec)
                           "The codec is being used, can't reconfigure.\n");
                goto error;
        }
-       err = snd_hda_codec_configure(codec);
+       err = device_reprobe(hda_codec_dev(codec));
        if (err < 0)
                goto error;
        err = snd_card_register(codec->card);