Skip to content

Commit

Permalink
ALSA: hda: Fix regressions on clear and reconfig sysfs
Browse files Browse the repository at this point in the history
commit 2506318 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: 6548883 ("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>
  • Loading branch information
tiwai authored and gregkh committed Dec 30, 2020
1 parent 66afcbc commit 66d7c29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sound/pci/hda/hda_codec.c
Expand Up @@ -1803,7 +1803,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);
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/hda/hda_sysfs.c
Expand Up @@ -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);
Expand Down

0 comments on commit 66d7c29

Please sign in to comment.