linux/sound/soc/intel/skylake
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
..
bxt-sst.c ASoC: Intel: Skylake: Request IRQ late only after all context are initialized 2017-12-20 10:48:06 +00:00
cnl-sst-dsp.c
cnl-sst-dsp.h
cnl-sst.c ASoC: Intel: Skylake: Request IRQ late only after all context are initialized 2017-12-20 10:48:06 +00:00
Makefile ASoC: Intel: Skylake: Add ssp clock driver 2018-01-26 12:51:21 +00:00
skl-debug.c ASoC: topology: Move skl-tplg-interface.h to uapi 2018-06-01 18:09:17 +01:00
skl-i2s.h ASoC: Intel: Skylake: Add extended I2S config blob support in Clock driver 2018-01-26 12:51:22 +00:00
skl-messages.c ALSA: hdac: Remove usage of struct hdac_ext_bus and use hdac_bus instead 2018-06-28 07:33:29 +02:00
skl-nhlt.c ALSA: hdac: Remove usage of struct hdac_ext_bus and use hdac_bus instead 2018-06-28 07:33:29 +02:00
skl-nhlt.h
skl-pcm.c Merge branch 'topic/drm_audio_component' of https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into asoc-4.19 2018-08-01 10:32:05 +01:00
skl-ssp-clk.c ASoC: Intel: Skylake: make function skl_clk_round_rate static 2018-02-12 09:32:32 +00:00
skl-ssp-clk.h ASoC: Intel: Skylake: Add ssp clock driver 2018-01-26 12:51:21 +00:00
skl-sst-cldma.c ASoC: Intel: Skylake: BDL definitions should be __le32 2018-07-25 17:21:11 +01:00
skl-sst-cldma.h ASoC: Intel: Skylake: BDL definitions should be __le32 2018-07-25 17:21:11 +01:00
skl-sst-dsp.c ASoC: Intel: Skylake: Request IRQ late only after all context are initialized 2017-12-20 10:48:06 +00:00
skl-sst-dsp.h ASoC: Intel: Skylake: Unify the fw ops for SKL and KBL 2018-04-17 11:35:10 +01:00
skl-sst-ipc.c
skl-sst-ipc.h ASoC: Intel: Skylake: Disable clock and power gating during FW/LIB download 2018-03-13 09:29:14 -07:00
skl-sst-utils.c Merge branch 'fix/intel' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel 2018-01-08 15:54:50 +00:00
skl-sst.c ASoC: Intel: Skylake: Unify the fw ops for SKL and KBL 2018-04-17 11:35:10 +01:00
skl-topology.c Merge branch 'topic/drm_audio_component' of https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into asoc-4.19 2018-08-01 10:32:05 +01:00
skl-topology.h Merge branch 'topic/drm_audio_component' of https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into asoc-4.19 2018-08-01 10:32:05 +01:00
skl.c Revert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation" 2018-09-12 11:19:43 +01:00
skl.h ALSA: hdac: Remove usage of struct hdac_ext_bus and use hdac_bus instead 2018-06-28 07:33:29 +02:00