aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/pci/hda/hda_intel.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-04-13 10:20:31 +0200
committerTakashi Iwai <tiwai@suse.de>2020-04-13 18:02:36 +0200
commit2393e7555b531a534152ffe7bfd1862cacedaacb (patch)
treebf9b6eda8123d8c6516b9d47203dfa5633627ee2 /sound/pci/hda/hda_intel.h
parentALSA: hda: Honor PM disablement in PM freeze and thaw_noirq ops (diff)
downloadwireguard-linux-2393e7555b531a534152ffe7bfd1862cacedaacb.tar.xz
wireguard-linux-2393e7555b531a534152ffe7bfd1862cacedaacb.zip
ALSA: hda: Release resources at error in delayed probe
snd-hda-intel driver handles the most of its probe task in the delayed work (either via workqueue or via firmware loader). When an error happens in the later delayed probe, we can't deregister the device itself because the probe callback already returned success and the device was bound. So, for now, we set hda->init_failed flag and make the rest untouched until the device gets really unbound. However, this leaves the device up running, keeping the resources without any use that prevents other operations. In this patch, we release the resources at first when a probe error happens in the delayed probe stage, but keeps the top-level object, so that the PM and other ops can still refer to the object itself. Also for simplicity, snd_hda_intel object is allocated via devm, so that we can get rid of the explicit kfree calls. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207043 Link: https://lore.kernel.org/r/20200413082034.25166-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to '')
-rw-r--r--sound/pci/hda/hda_intel.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_intel.h b/sound/pci/hda/hda_intel.h
index 2acfff3da1a0..3fb119f09040 100644
--- a/sound/pci/hda/hda_intel.h
+++ b/sound/pci/hda/hda_intel.h
@@ -27,6 +27,7 @@ struct hda_intel {
unsigned int use_vga_switcheroo:1;
unsigned int vga_switcheroo_registered:1;
unsigned int init_failed:1; /* delayed init failed */
+ unsigned int freed:1; /* resources already released */
bool need_i915_power:1; /* the hda controller needs i915 power */
};