linux/sound/soc
Yu Zhao 542cedec53
Revert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation"
This reverts commit 12eeeb4f47.

The patch doesn't fix accessing memory with null pointer in
skl_interrupt().

There are two problems: 1) skl_init_chip() is called twice, before
and after dma buffer is allocate. The first call sets bus->chip_init
which prevents the second from initializing bus->corb.buf and
rirb.buf from bus->rb.area. 2) snd_hdac_bus_init_chip() enables
interrupt before snd_hdac_bus_init_cmd_io() initializing dma buffers.
There is a small window which skl_interrupt() can be called if irq
has been acquired. If so, it crashes when using null dma buffer
pointers.

Will fix the problems in the following patches. Also attaching the
crash for future reference.

[   16.949148] general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI
<snipped>
[   16.950903] Call Trace:
[   16.950906]  <IRQ>
[   16.950918]  skl_interrupt+0x19e/0x2d6 [snd_soc_skl]
[   16.950926]  ? dma_supported+0xb5/0xb5 [snd_soc_skl]
[   16.950933]  __handle_irq_event_percpu+0x27a/0x6c8
[   16.950937]  ? __irq_wake_thread+0x1d1/0x1d1
[   16.950942]  ? __do_softirq+0x57a/0x69e
[   16.950944]  handle_irq_event_percpu+0x95/0x1ba
[   16.950948]  ? _raw_spin_unlock+0x65/0xdc
[   16.950951]  ? __handle_irq_event_percpu+0x6c8/0x6c8
[   16.950953]  ? _raw_spin_unlock+0x65/0xdc
[   16.950957]  ? time_cpufreq_notifier+0x483/0x483
[   16.950959]  handle_irq_event+0x89/0x123
[   16.950962]  handle_fasteoi_irq+0x16f/0x425
[   16.950965]  handle_irq+0x1fe/0x28e
[   16.950969]  do_IRQ+0x6e/0x12e
[   16.950972]  common_interrupt+0x7a/0x7a
[   16.950974]  </IRQ>
<snipped>
[   16.951031] RIP: snd_hdac_bus_update_rirb+0x19b/0x4cf [snd_hda_core] RSP: ffff88015c807c08
[   16.951036] ---[ end trace 58bf9ece1775bc92 ]---

Fixes: 2eeeb4f4733b ("ASoC: Intel: Skylake: Acquire irq after RIRB allocation")
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12 11:19:43 +01:00
..
adi
amd ASoC: AMD: Ensure reset bit is cleared before configuring 2018-09-10 12:20:52 +01:00
atmel ASoC: atmel-i2s: Remove unnecessary audio PLL clock (aclk) 2018-07-03 16:33:38 +01:00
au1x treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
bcm ASoC: Remove depends on HAS_DMA in case of platform dependency 2018-04-18 11:17:09 +01:00
cirrus ASoC: cirrus: i2s: IRQ-based stream watchdog 2018-05-11 11:27:33 +09:00
codecs ASoC: cs4265: fix MMTLR Data switch control 2018-09-10 15:49:02 +01:00
davinci ASoC: davinci-i2s: mark expected switch fall-through 2018-08-03 17:42:28 +01:00
dwc Merge remote-tracking branches 'asoc/topic/dwc', 'asoc/topic/es7134', 'asoc/topic/es8316', 'asoc/topic/es8328' and 'asoc/topic/fsl' into asoc-next 2018-03-28 10:29:36 +08:00
fsl ASoC: fsl_esai: Mark expected switch fall-through 2018-08-03 17:59:21 +01:00
generic ASoC: audio-graph-scu-card.c: convert to SPDX identifiers 2018-07-02 10:53:33 +01:00
hisilicon ASoC: hisilicon: fix spelling mistake: "uknown" -> "unknown" 2018-05-13 10:08:11 +09:00
img treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
intel Revert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation" 2018-09-12 11:19:43 +01:00
jz4740
kirkwood ASoC: Remove depends on HAS_DMA in case of platform dependency 2018-04-18 11:17:09 +01:00
mediatek ASoC: mt6797: sub dai use list_head 2018-06-29 13:31:53 +01:00
meson ASoC: meson: align axg card driver with DT bindings documentation 2018-07-26 15:45:44 +01:00
mxs
nuc900
omap ASoC: omap-dmic: Mark expected switch fall-throughs 2018-08-03 17:59:25 +01:00
pxa ASoC: pxa: remove clock divider and pll setup from zylonite and magician 2018-07-20 17:41:26 +01:00
qcom ASoC: q6routing: initialize data correctly 2018-09-03 12:17:32 +01:00
rockchip ASoC: rockchip: add config for rockchip dmaengine pcm register 2018-06-18 12:54:38 +01:00
samsung ASoC: samsung: i2s: Mark expected switch fall-through 2018-08-03 17:59:29 +01:00
sh ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER 2018-09-06 11:13:24 +01:00
sirf ASoC: sirf: Fix potential NULL pointer dereference 2018-07-30 12:02:30 +01:00
spear
sti ASoC: sti: Use snd_pcm_stop_xrun() helper 2018-07-04 15:41:35 +01:00
stm ASoC: stm32: remove redundant pointers 'priv' and 'rtd' 2018-08-01 12:16:26 +01:00
sunxi Merge remote-tracking branches 'asoc/topic/sta529', 'asoc/topic/sti-sas', 'asoc/topic/stm32', 'asoc/topic/sun4i' and 'asoc/topic/sun8i' into asoc-next 2018-03-28 10:30:49 +08:00
tegra Merge branch 'asoc-4.18' into asoc-4.19 wmadsp dep 2018-08-08 17:32:10 +01:00
txx9
uniphier ASoC: uniphier: change functions to static 2018-07-30 12:02:32 +01:00
ux500
xtensa
zte ASoC: zte: Fix incorrect PCM format bit usages 2018-07-26 15:48:19 +01:00
Kconfig ASoC: meson: add axg fifo base driver 2018-07-18 13:08:36 +01:00
Makefile ASoC: meson: add axg fifo base driver 2018-07-18 13:08:36 +01:00
soc-ac97.c ASoC: ac97: convert to SPDX identifiers 2018-07-02 10:56:09 +01:00
soc-acpi.c ASoC: soc-acpi: convert to SPDX identifiers 2018-07-02 10:55:27 +01:00
soc-compress.c ASoC: compress: make BE and FE order inline with dpcm 2018-08-07 14:42:29 +01:00
soc-core.c ASoC: dapm: Fix NULL pointer deference on CODEC to CODEC DAIs 2018-08-15 15:52:20 +01:00
soc-dapm.c ASoC: dapm: Fix NULL pointer deference on CODEC to CODEC DAIs 2018-08-15 15:52:20 +01:00
soc-devres.c ASoC: soc-devres.c: convert to SPDX identifiers 2018-07-02 10:55:22 +01:00
soc-generic-dmaengine-pcm.c ASoC: dmaengine: Use standard pcm_format_to_bits() macro 2018-07-26 17:09:09 +01:00
soc-io.c ASoC: soc-io.c: convert to SPDX identifiers 2018-07-02 10:53:55 +01:00
soc-jack.c ASoC: soc-jack.c: convert to SPDX identifiers 2018-07-02 10:55:12 +01:00
soc-ops.c ASoC: soc-ops.c: convert to SPDX identifiers 2018-07-02 10:54:40 +01:00
soc-pcm.c Merge branch 'asoc-4.18' into asoc-4.19 wmadsp dep 2018-08-08 17:32:10 +01:00
soc-topology.c ASoC: soc-topology: convert to SPDX identifiers 2018-07-02 10:55:42 +01:00
soc-utils.c Merge branch 'asoc-4.18' into asoc-4.19 wmadsp dep 2018-08-08 17:32:10 +01:00