sound: enable interrupt after dma buffer initialization
authorYu Zhao <yuzhao@google.com>
Tue, 11 Sep 2018 21:14:04 +0000 (15:14 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Oct 2018 07:16:22 +0000 (09:16 +0200)
commit2af2b70c107b8a2e75e3c3351f3777e8cf26229c
tree37e16ef8a5869199ccc88c49a9bdf0cf06812b9f
parenta5733703e38c9a1b79ae6f086d3b427ae8b49e93
sound: enable interrupt after dma buffer initialization

[ Upstream commit b61749a89f826eb61fc59794d9e4697bd246eb61 ]

In snd_hdac_bus_init_chip(), we enable interrupt before
snd_hdac_bus_init_cmd_io() initializing dma buffers. If irq has
been acquired and irq handler uses the dma buffer, kernel may crash
when interrupt comes in.

Fix the problem by postponing enabling irq after dma buffer
initialization. And warn once on null dma buffer pointer during the
initialization.

Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/hda/hdac_controller.c