]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
ASoC: SOF: Intel: hda: Make hdac_device device-managed
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Wed, 26 Jun 2019 07:04:50 +0000 (00:04 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 18 Oct 2019 08:25:44 +0000 (04:25 -0400)
commitfb6ac32e74997192ab8f7bb924b32b219d7d57ee
treef4506ed0ecb390ac47d205142a8848c471cea902
parentb1fc405017e5fceb8d123d18b1b15bd84b2e2bbe
ASoC: SOF: Intel: hda: Make hdac_device device-managed

BugLink: https://bugs.launchpad.net/bugs/1848046
[ Upstream commit ef9bec27485fefb6b93168fea73fda0dc9638046 ]

snd_hdac_ext_bus_device_exit() has been recently modified
to no longer free the hdac device. SOF allocates memory for
hdac_device and hda_hda_priv with kzalloc. Make them
device-managed instead so that they will be freed when the
SOF driver is unloaded.

Because of the above change, hda_codec is device-managed and
it will be freed when the ASoC device is removed. Freeing
the codec in snd_hda_codec_dev_release() leads to kernel
panic while unloading and reloading the ASoC driver. So,
avoid freeing the hda_codec for ASoC driver. This is done in
the same patch to avoid bisect failure.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20190626070450.7229-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
sound/pci/hda/hda_codec.c
sound/soc/sof/intel/hda-codec.c