[alsa-devel] ASoC: pxa: remove pxa2xx-pcm driver, which caused regression
From: Petr Cvek petrcvekcz@gmail.com
The switch of PXA to dmaengine caused a regression for devices which are using SSP/I2S and probably AC97. The problem is in multiple allocation of DMA by function pxa2xx_soc_pcm_new() called by pxa-pcm-audio and (SSP/I2S/AC97). The regression was found on HTC Magician and after playback kernel generates an oops:
WARNING: CPU: 0 PID: 892 at drivers/dma/dmaengine.c:788 dma_release_channel+0x44/0xa0 chan reference count 0 != 1 Modules linked in: ... snd_soc_magician snd_soc_uda1380 snd_soc_pxa2xx_i2s spi_pxa2xx_platform snd_soc_pxa2xx snd_soc_pxa_ssp snd_pxa2xx_lib snd_pcm_dmaengine i2c_pxa snd_soc_core snd_pcm snd_timer i2c_core snd ssp soundcore [last unloaded: pwm_bl] CPU: 0 PID: 892 Comm: aplay Tainted: G C 4.18.0-rc6-next-20180726-magician+ #16 Hardware name: HTC Magician [<c0107d90>] (unwind_backtrace) from [<c010594c>] (show_stack+0x10/0x14) [<c010594c>] (show_stack) from [<c0111680>] (__warn+0xd4/0xec) [<c0111680>] (__warn) from [<c01112d0>] (warn_slowpath_fmt+0x44/0x6c) [<c01112d0>] (warn_slowpath_fmt) from [<c034908c>] (dma_release_channel+0x44/0xa0) [<c034908c>] (dma_release_channel) from [<bf330528>] (snd_dmaengine_pcm_close_release_chan+0x44/0xb1c [snd_pcm_dmaengine]) [<bf330528>] (snd_dmaengine_pcm_close_release_chan [snd_pcm_dmaengine]) from [<bf26c29c>] (soc_pcm_components_close+0x8c/0xac [snd_soc_core]) [<bf26c29c>] (soc_pcm_components_close [snd_soc_core]) from [<bf26c3a0>] (soc_pcm_close+0xe4/0xd44 [snd_soc_core]) [<bf26c3a0>] (soc_pcm_close [snd_soc_core]) from [<bf167254>] (snd_pcm_release_substream+0x88/0x108 [snd_pcm]) [<bf167254>] (snd_pcm_release_substream [snd_pcm]) from [<bf167330>] (snd_pcm_release+0x5c/0xd2c [snd_pcm]) [<bf167330>] (snd_pcm_release [snd_pcm]) from [<c01c39e4>] (__fput+0xdc/0x1e8) [<c01c39e4>] (__fput) from [<c0129e7c>] (task_work_run+0xc4/0xd4) [<c0129e7c>] (task_work_run) from [<c01053ac>] (do_work_pending+0xc0/0xc8) [<c01053ac>] (do_work_pending) from [<c0101068>] (slow_work_pending+0xc/0x20) Exception stack(0xc2fdffb0 to 0xc2fdfff8) ffa0: 00000000 0154d1a0 01542a3c 00000000 ffc0: 0154d150 00000000 0009283c 00000006 000003f0 0154d4c8 00000000 0154d4c8 ffe0: b6ee7d70 bef13960 b6e547b8 b6cfe018 60000010 00000004
Removing bindings for snd_soc_magician fixes the problem (tested). Other machines should have the same problem if they use at least one of pxa-ssp-dai or pxa2xx-i2s. Considering pxa2xx-ac97 uses the function pxa2xx_soc_pcm_new() too it should produce the same problem (untested).
After removal from I2S/SSP/AC97 machines there seems to be no user of pxa2xx-pcm, so remove the driver completely, change platform device in arch/arm/mach-pxa/devices.c to snd-soc-dummy and an example in the documentation.
Signed-off-by: Petr Cvek petrcvekcz@gmail.com --- Documentation/sound/soc/machine.rst | 2 +- arch/arm/mach-pxa/devices.c | 2 +- sound/soc/pxa/Kconfig | 43 ++++++++++---------------- sound/soc/pxa/Makefile | 2 -- sound/soc/pxa/corgi.c | 1 - sound/soc/pxa/e740_wm9705.c | 2 -- sound/soc/pxa/e750_wm9705.c | 2 -- sound/soc/pxa/e800_wm9712.c | 2 -- sound/soc/pxa/em-x270.c | 2 -- sound/soc/pxa/hx4700.c | 1 - sound/soc/pxa/imote2.c | 1 - sound/soc/pxa/magician.c | 2 -- sound/soc/pxa/mioa701_wm9713.c | 2 -- sound/soc/pxa/palm27x.c | 2 -- sound/soc/pxa/poodle.c | 1 - sound/soc/pxa/pxa2xx-pcm.c | 48 ----------------------------- sound/soc/pxa/raumfeld.c | 2 -- sound/soc/pxa/spitz.c | 1 - sound/soc/pxa/tosa.c | 2 -- sound/soc/pxa/z2.c | 1 - sound/soc/pxa/zylonite.c | 3 -- 21 files changed, 18 insertions(+), 106 deletions(-) delete mode 100644 sound/soc/pxa/pxa2xx-pcm.c
diff --git a/Documentation/sound/soc/machine.rst b/Documentation/sound/soc/machine.rst index 515c9444deaf..a65f41ade2ca 100644 --- a/Documentation/sound/soc/machine.rst +++ b/Documentation/sound/soc/machine.rst @@ -65,7 +65,7 @@ struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. .stream_name = "WM8731", .cpu_dai_name = "pxa-is2-dai", .codec_dai_name = "wm8731-hifi", - .platform_name = "pxa-pcm-audio", + .platform_name = "snd-soc-dummy", .codec_name = "wm8713-codec.0-001a", .init = corgi_wm8731_init, .ops = &corgi_ops, diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index a24783a03827..82ee7f6c1dcf 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c @@ -371,7 +371,7 @@ struct platform_device pxa_device_asoc_ssp4 = { };
struct platform_device pxa_device_asoc_platform = { - .name = "pxa-pcm-audio", + .name = "snd-soc-dummy", .id = -1, };
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 776e148b0aa2..d865c1041c6b 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig @@ -1,12 +1,3 @@ -config SND_PXA2XX_SOC - tristate "SoC Audio for the Intel PXA2xx chip" - depends on ARCH_PXA || COMPILE_TEST - select SND_PXA2XX_LIB - help - Say Y or M if you want to add support for codecs attached to - the PXA2xx AC97, I2S or SSP interface. You will also need - to select the audio interfaces to support below. - config SND_MMP_SOC bool "Soc Audio for Marvell MMP chips" depends on ARCH_MMP @@ -43,7 +34,7 @@ config SND_MMP_SOC_SSPA
config SND_PXA2XX_SOC_CORGI tristate "SoC Audio support for Sharp Zaurus SL-C7x0" - depends on SND_PXA2XX_SOC && PXA_SHARP_C7xx && I2C + depends on PXA_SHARP_C7xx && I2C select SND_PXA2XX_SOC_I2S select SND_SOC_WM8731 help @@ -52,7 +43,7 @@ config SND_PXA2XX_SOC_CORGI
config SND_PXA2XX_SOC_SPITZ tristate "SoC Audio support for Sharp Zaurus SL-Cxx00" - depends on SND_PXA2XX_SOC && PXA_SHARP_Cxx00 && I2C + depends on PXA_SHARP_Cxx00 && I2C select SND_PXA2XX_SOC_I2S select SND_SOC_WM8750 help @@ -61,7 +52,7 @@ config SND_PXA2XX_SOC_SPITZ
config SND_PXA2XX_SOC_Z2 tristate "SoC Audio support for Zipit Z2" - depends on SND_PXA2XX_SOC && MACH_ZIPIT2 && I2C + depends on MACH_ZIPIT2 && I2C select SND_PXA2XX_SOC_I2S select SND_SOC_WM8750 help @@ -69,7 +60,7 @@ config SND_PXA2XX_SOC_Z2
config SND_PXA2XX_SOC_POODLE tristate "SoC Audio support for Poodle" - depends on SND_PXA2XX_SOC && MACH_POODLE && I2C + depends on MACH_POODLE && I2C select SND_PXA2XX_SOC_I2S select SND_SOC_WM8731 help @@ -78,7 +69,7 @@ config SND_PXA2XX_SOC_POODLE
config SND_PXA2XX_SOC_TOSA tristate "SoC AC97 Audio support for Tosa" - depends on SND_PXA2XX_SOC && MACH_TOSA + depends on MACH_TOSA depends on MFD_TC6393XB select SND_PXA2XX_SOC_AC97 select SND_SOC_WM9712 @@ -88,7 +79,7 @@ config SND_PXA2XX_SOC_TOSA
config SND_PXA2XX_SOC_E740 tristate "SoC AC97 Audio support for e740" - depends on SND_PXA2XX_SOC && MACH_E740 + depends on MACH_E740 select SND_SOC_WM9705 select SND_PXA2XX_SOC_AC97 help @@ -97,7 +88,7 @@ config SND_PXA2XX_SOC_E740
config SND_PXA2XX_SOC_E750 tristate "SoC AC97 Audio support for e750" - depends on SND_PXA2XX_SOC && MACH_E750 + depends on MACH_E750 select SND_SOC_WM9705 select SND_PXA2XX_SOC_AC97 help @@ -106,7 +97,7 @@ config SND_PXA2XX_SOC_E750
config SND_PXA2XX_SOC_E800 tristate "SoC AC97 Audio support for e800" - depends on SND_PXA2XX_SOC && MACH_E800 + depends on MACH_E800 select SND_SOC_WM9712 select SND_PXA2XX_SOC_AC97 help @@ -115,8 +106,7 @@ config SND_PXA2XX_SOC_E800
config SND_PXA2XX_SOC_EM_X270 tristate "SoC Audio support for CompuLab EM-x270, eXeda and CM-X300" - depends on SND_PXA2XX_SOC && (MACH_EM_X270 || MACH_EXEDA || \ - MACH_CM_X300) + depends on MACH_EM_X270 || MACH_EXEDA || MACH_CM_X300 select SND_PXA2XX_SOC_AC97 select SND_SOC_WM9712 help @@ -125,8 +115,7 @@ config SND_PXA2XX_SOC_EM_X270
config SND_PXA2XX_SOC_PALM27X bool "SoC Audio support for Palm T|X, T5, E2 and LifeDrive" - depends on SND_PXA2XX_SOC && (MACH_PALMLD || MACH_PALMTX || \ - MACH_PALMT5 || MACH_PALMTE2) + depends on MACH_PALMLD || MACH_PALMTX || MACH_PALMT5 || MACH_PALMTE2 select SND_PXA2XX_SOC_AC97 select SND_SOC_WM9712 help @@ -155,7 +144,7 @@ config SND_SOC_TTC_DKB
config SND_SOC_ZYLONITE tristate "SoC Audio support for Marvell Zylonite" - depends on SND_PXA2XX_SOC && MACH_ZYLONITE + depends on MACH_ZYLONITE select SND_PXA2XX_SOC_AC97 select SND_PXA_SOC_SSP select SND_SOC_WM9713 @@ -165,7 +154,7 @@ config SND_SOC_ZYLONITE
config SND_SOC_RAUMFELD tristate "SoC Audio support Raumfeld audio adapter" - depends on SND_PXA2XX_SOC && (MACH_RAUMFELD_SPEAKER || MACH_RAUMFELD_CONNECTOR) + depends on MACH_RAUMFELD_SPEAKER || MACH_RAUMFELD_CONNECTOR depends on I2C && SPI_MASTER select SND_PXA_SOC_SSP select SND_SOC_CS4270 @@ -175,7 +164,7 @@ config SND_SOC_RAUMFELD
config SND_PXA2XX_SOC_HX4700 tristate "SoC Audio support for HP iPAQ hx4700" - depends on SND_PXA2XX_SOC && MACH_H4700 && I2C + depends on MACH_H4700 && I2C select SND_PXA2XX_SOC_I2S select SND_SOC_AK4641 help @@ -184,7 +173,7 @@ config SND_PXA2XX_SOC_HX4700
config SND_PXA2XX_SOC_MAGICIAN tristate "SoC Audio support for HTC Magician" - depends on SND_PXA2XX_SOC && MACH_MAGICIAN && I2C + depends on MACH_MAGICIAN && I2C select SND_PXA2XX_SOC_I2S select SND_PXA_SOC_SSP select SND_SOC_UDA1380 @@ -194,7 +183,7 @@ config SND_PXA2XX_SOC_MAGICIAN
config SND_PXA2XX_SOC_MIOA701 tristate "SoC Audio support for MIO A701" - depends on SND_PXA2XX_SOC && MACH_MIOA701 + depends on MACH_MIOA701 select SND_PXA2XX_SOC_AC97 select SND_SOC_WM9713 help @@ -203,7 +192,7 @@ config SND_PXA2XX_SOC_MIOA701
config SND_PXA2XX_SOC_IMOTE2 tristate "SoC Audio support for IMote 2" - depends on SND_PXA2XX_SOC && MACH_INTELMOTE2 && I2C + depends on MACH_INTELMOTE2 && I2C select SND_PXA2XX_SOC_I2S select SND_SOC_WM8940 help diff --git a/sound/soc/pxa/Makefile b/sound/soc/pxa/Makefile index 5b265662f04f..93c0fdd041ed 100644 --- a/sound/soc/pxa/Makefile +++ b/sound/soc/pxa/Makefile @@ -1,13 +1,11 @@ # SPDX-License-Identifier: GPL-2.0 # PXA Platform Support -snd-soc-pxa2xx-objs := pxa2xx-pcm.o snd-soc-pxa2xx-ac97-objs := pxa2xx-ac97.o snd-soc-pxa2xx-i2s-objs := pxa2xx-i2s.o snd-soc-pxa-ssp-objs := pxa-ssp.o snd-soc-mmp-objs := mmp-pcm.o snd-soc-mmp-sspa-objs := mmp-sspa.o
-obj-$(CONFIG_SND_PXA2XX_SOC) += snd-soc-pxa2xx.o obj-$(CONFIG_SND_PXA2XX_SOC_AC97) += snd-soc-pxa2xx-ac97.o obj-$(CONFIG_SND_PXA2XX_SOC_I2S) += snd-soc-pxa2xx-i2s.o obj-$(CONFIG_SND_PXA_SOC_SSP) += snd-soc-pxa-ssp.o diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c index 054e0d65db9d..d36193e45be9 100644 --- a/sound/soc/pxa/corgi.c +++ b/sound/soc/pxa/corgi.c @@ -265,7 +265,6 @@ static struct snd_soc_dai_link corgi_dai = { .stream_name = "WM8731", .cpu_dai_name = "pxa2xx-i2s", .codec_dai_name = "wm8731-hifi", - .platform_name = "pxa-pcm-audio", .codec_name = "wm8731.0-001b", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, diff --git a/sound/soc/pxa/e740_wm9705.c b/sound/soc/pxa/e740_wm9705.c index 8ab7032631b7..cfae28571ec7 100644 --- a/sound/soc/pxa/e740_wm9705.c +++ b/sound/soc/pxa/e740_wm9705.c @@ -90,7 +90,6 @@ static struct snd_soc_dai_link e740_dai[] = { .stream_name = "AC97 HiFi", .cpu_dai_name = "pxa2xx-ac97", .codec_dai_name = "wm9705-hifi", - .platform_name = "pxa-pcm-audio", .codec_name = "wm9705-codec", }, { @@ -98,7 +97,6 @@ static struct snd_soc_dai_link e740_dai[] = { .stream_name = "AC97 Aux", .cpu_dai_name = "pxa2xx-ac97-aux", .codec_dai_name = "wm9705-aux", - .platform_name = "pxa-pcm-audio", .codec_name = "wm9705-codec", }, }; diff --git a/sound/soc/pxa/e750_wm9705.c b/sound/soc/pxa/e750_wm9705.c index 82bcbbb1841b..21c1f504a141 100644 --- a/sound/soc/pxa/e750_wm9705.c +++ b/sound/soc/pxa/e750_wm9705.c @@ -73,7 +73,6 @@ static struct snd_soc_dai_link e750_dai[] = { .stream_name = "AC97 HiFi", .cpu_dai_name = "pxa2xx-ac97", .codec_dai_name = "wm9705-hifi", - .platform_name = "pxa-pcm-audio", .codec_name = "wm9705-codec", /* use ops to check startup state */ }, @@ -82,7 +81,6 @@ static struct snd_soc_dai_link e750_dai[] = { .stream_name = "AC97 Aux", .cpu_dai_name = "pxa2xx-ac97-aux", .codec_dai_name = "wm9705-aux", - .platform_name = "pxa-pcm-audio", .codec_name = "wm9705-codec", }, }; diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c index 1ed8aa2348f1..2475366f0e0b 100644 --- a/sound/soc/pxa/e800_wm9712.c +++ b/sound/soc/pxa/e800_wm9712.c @@ -74,7 +74,6 @@ static struct snd_soc_dai_link e800_dai[] = { .stream_name = "AC97 HiFi", .cpu_dai_name = "pxa2xx-ac97", .codec_dai_name = "wm9712-hifi", - .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", }, { @@ -82,7 +81,6 @@ static struct snd_soc_dai_link e800_dai[] = { .stream_name = "AC97 Aux", .cpu_dai_name = "pxa2xx-ac97-aux", .codec_dai_name = "wm9712-aux", - .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", }, }; diff --git a/sound/soc/pxa/em-x270.c b/sound/soc/pxa/em-x270.c index e046770ce70e..76b466b3eaee 100644 --- a/sound/soc/pxa/em-x270.c +++ b/sound/soc/pxa/em-x270.c @@ -36,7 +36,6 @@ static struct snd_soc_dai_link em_x270_dai[] = { .stream_name = "AC97 HiFi", .cpu_dai_name = "pxa2xx-ac97", .codec_dai_name = "wm9712-hifi", - .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", }, { @@ -44,7 +43,6 @@ static struct snd_soc_dai_link em_x270_dai[] = { .stream_name = "AC97 Aux", .cpu_dai_name = "pxa2xx-ac97-aux", .codec_dai_name = "wm9712-aux", - .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", }, }; diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c index 6cdef5d4954e..79ffeab616f7 100644 --- a/sound/soc/pxa/hx4700.c +++ b/sound/soc/pxa/hx4700.c @@ -144,7 +144,6 @@ static struct snd_soc_dai_link hx4700_dai = { .stream_name = "AK4641", .cpu_dai_name = "pxa2xx-i2s", .codec_dai_name = "ak4641-hifi", - .platform_name = "pxa-pcm-audio", .codec_name = "ak4641.0-0012", .init = hx4700_ak4641_init, .dai_fmt = SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF | diff --git a/sound/soc/pxa/imote2.c b/sound/soc/pxa/imote2.c index 78475376f971..84dff8d34472 100644 --- a/sound/soc/pxa/imote2.c +++ b/sound/soc/pxa/imote2.c @@ -51,7 +51,6 @@ static struct snd_soc_dai_link imote2_dai = { .stream_name = "WM8940", .cpu_dai_name = "pxa2xx-i2s", .codec_dai_name = "wm8940-hifi", - .platform_name = "pxa-pcm-audio", .codec_name = "wm8940-codec.0-0034", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c index 935a248e5bf6..a7e7fa08e0a4 100644 --- a/sound/soc/pxa/magician.c +++ b/sound/soc/pxa/magician.c @@ -296,7 +296,6 @@ static struct snd_soc_dai_link magician_dai[] = { .stream_name = "UDA1380 Playback", .cpu_dai_name = "pxa-ssp-dai.0", .codec_dai_name = "uda1380-hifi-playback", - .platform_name = "pxa-pcm-audio", .codec_name = "uda1380-codec.0-0018", .ops = &magician_playback_ops, }, @@ -305,7 +304,6 @@ static struct snd_soc_dai_link magician_dai[] = { .stream_name = "UDA1380 Capture", .cpu_dai_name = "pxa2xx-i2s", .codec_dai_name = "uda1380-hifi-capture", - .platform_name = "pxa-pcm-audio", .codec_name = "uda1380-codec.0-0018", .ops = &magician_capture_ops, } diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c index 47052fe3f5f4..121dcb1def3c 100644 --- a/sound/soc/pxa/mioa701_wm9713.c +++ b/sound/soc/pxa/mioa701_wm9713.c @@ -150,7 +150,6 @@ static struct snd_soc_dai_link mioa701_dai[] = { .codec_dai_name = "wm9713-hifi", .codec_name = "wm9713-codec", .init = mioa701_wm9713_init, - .platform_name = "pxa-pcm-audio", .ops = &mioa701_ops, }, { @@ -159,7 +158,6 @@ static struct snd_soc_dai_link mioa701_dai[] = { .cpu_dai_name = "pxa2xx-ac97-aux", .codec_dai_name = "wm9713-aux", .codec_name = "wm9713-codec", - .platform_name = "pxa-pcm-audio", .ops = &mioa701_ops, }, }; diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c index 97167048572d..490717c7a5ce 100644 --- a/sound/soc/pxa/palm27x.c +++ b/sound/soc/pxa/palm27x.c @@ -94,7 +94,6 @@ static struct snd_soc_dai_link palm27x_dai[] = { .cpu_dai_name = "pxa2xx-ac97", .codec_dai_name = "wm9712-hifi", .codec_name = "wm9712-codec", - .platform_name = "pxa-pcm-audio", .init = palm27x_ac97_init, }, { @@ -103,7 +102,6 @@ static struct snd_soc_dai_link palm27x_dai[] = { .cpu_dai_name = "pxa2xx-ac97-aux", .codec_dai_name = "wm9712-aux", .codec_name = "wm9712-codec", - .platform_name = "pxa-pcm-audio", }, };
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c index b6693f32fc02..728904266930 100644 --- a/sound/soc/pxa/poodle.c +++ b/sound/soc/pxa/poodle.c @@ -229,7 +229,6 @@ static struct snd_soc_dai_link poodle_dai = { .stream_name = "WM8731", .cpu_dai_name = "pxa2xx-i2s", .codec_dai_name = "wm8731-hifi", - .platform_name = "pxa-pcm-audio", .codec_name = "wm8731.0-001b", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c deleted file mode 100644 index 72eaaef1b426..000000000000 --- a/sound/soc/pxa/pxa2xx-pcm.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * linux/sound/arm/pxa2xx-pcm.c -- ALSA PCM interface for the Intel PXA2xx chip - * - * Author: Nicolas Pitre - * Created: Nov 30, 2004 - * Copyright: (C) 2004 MontaVista Software, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include <linux/dma-mapping.h> -#include <linux/module.h> -#include <linux/dmaengine.h> -#include <linux/of.h> - -#include <sound/core.h> -#include <sound/soc.h> -#include <sound/pxa2xx-lib.h> -#include <sound/dmaengine_pcm.h> - -static const struct snd_soc_component_driver pxa2xx_soc_platform = { - .ops = &pxa2xx_pcm_ops, - .pcm_new = pxa2xx_soc_pcm_new, - .pcm_free = pxa2xx_pcm_free_dma_buffers, -}; - -static int pxa2xx_soc_platform_probe(struct platform_device *pdev) -{ - return devm_snd_soc_register_component(&pdev->dev, &pxa2xx_soc_platform, - NULL, 0); -} - -static struct platform_driver pxa_pcm_driver = { - .driver = { - .name = "pxa-pcm-audio", - }, - - .probe = pxa2xx_soc_platform_probe, -}; - -module_platform_driver(pxa_pcm_driver); - -MODULE_AUTHOR("Nicolas Pitre"); -MODULE_DESCRIPTION("Intel PXA2xx PCM DMA module"); -MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:pxa-pcm-audio"); diff --git a/sound/soc/pxa/raumfeld.c b/sound/soc/pxa/raumfeld.c index 111a907c4eb9..b2ae5aec0b83 100644 --- a/sound/soc/pxa/raumfeld.c +++ b/sound/soc/pxa/raumfeld.c @@ -205,7 +205,6 @@ static struct snd_soc_ops raumfeld_ak4104_ops = { .name = "CS4270", \ .stream_name = "CS4270", \ .cpu_dai_name = "pxa-ssp-dai.0", \ - .platform_name = "pxa-pcm-audio", \ .codec_dai_name = "cs4270-hifi", \ .codec_name = "cs4270.0-0048", \ .dai_fmt = SND_SOC_DAIFMT_I2S | \ @@ -220,7 +219,6 @@ static struct snd_soc_ops raumfeld_ak4104_ops = { .stream_name = "Playback", \ .cpu_dai_name = "pxa-ssp-dai.1", \ .codec_dai_name = "ak4104-hifi", \ - .platform_name = "pxa-pcm-audio", \ .dai_fmt = SND_SOC_DAIFMT_I2S | \ SND_SOC_DAIFMT_NB_NF | \ SND_SOC_DAIFMT_CBS_CFS, \ diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index 1671da648e95..57e4ecb9cbe2 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c @@ -262,7 +262,6 @@ static struct snd_soc_dai_link spitz_dai = { .stream_name = "WM8750", .cpu_dai_name = "pxa2xx-i2s", .codec_dai_name = "wm8750-hifi", - .platform_name = "pxa-pcm-audio", .codec_name = "wm8750.0-001b", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c index ae9c12e1ea2a..b2ddfeea6b85 100644 --- a/sound/soc/pxa/tosa.c +++ b/sound/soc/pxa/tosa.c @@ -188,7 +188,6 @@ static struct snd_soc_dai_link tosa_dai[] = { .stream_name = "AC97 HiFi", .cpu_dai_name = "pxa2xx-ac97", .codec_dai_name = "wm9712-hifi", - .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", .ops = &tosa_ops, }, @@ -197,7 +196,6 @@ static struct snd_soc_dai_link tosa_dai[] = { .stream_name = "AC97 Aux", .cpu_dai_name = "pxa2xx-ac97-aux", .codec_dai_name = "wm9712-aux", - .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", .ops = &tosa_ops, }, diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index 5b0eccd2b4dd..5e2307959b7b 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c @@ -162,7 +162,6 @@ static struct snd_soc_dai_link z2_dai = { .stream_name = "WM8750", .cpu_dai_name = "pxa2xx-i2s", .codec_dai_name = "wm8750-hifi", - .platform_name = "pxa-pcm-audio", .codec_name = "wm8750.0-001b", .init = z2_wm8750_init, .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c index 230eee450f45..753c828ade37 100644 --- a/sound/soc/pxa/zylonite.c +++ b/sound/soc/pxa/zylonite.c @@ -132,7 +132,6 @@ static struct snd_soc_dai_link zylonite_dai[] = { .name = "AC97", .stream_name = "AC97 HiFi", .codec_name = "wm9713-codec", - .platform_name = "pxa-pcm-audio", .cpu_dai_name = "pxa2xx-ac97", .codec_dai_name = "wm9713-hifi", .init = zylonite_wm9713_init, @@ -141,7 +140,6 @@ static struct snd_soc_dai_link zylonite_dai[] = { .name = "AC97 Aux", .stream_name = "AC97 Aux", .codec_name = "wm9713-codec", - .platform_name = "pxa-pcm-audio", .cpu_dai_name = "pxa2xx-ac97-aux", .codec_dai_name = "wm9713-aux", }, @@ -149,7 +147,6 @@ static struct snd_soc_dai_link zylonite_dai[] = { .name = "WM9713 Voice", .stream_name = "WM9713 Voice", .codec_name = "wm9713-codec", - .platform_name = "pxa-pcm-audio", .cpu_dai_name = "pxa-ssp-dai.2", .codec_dai_name = "wm9713-voice", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
petrcvekcz@gmail.com writes:
From: Petr Cvek petrcvekcz@gmail.com
The switch of PXA to dmaengine caused a regression for devices which are using SSP/I2S and probably AC97. The problem is in multiple allocation of DMA by function pxa2xx_soc_pcm_new() called by pxa-pcm-audio and (SSP/I2S/AC97). The regression was found on HTC Magician and after playback kernel generates an oops:
With AC97, this is still continuously tested and works fine, and the pcm part is what makes aplay happy for playing music. This is used both in a devicetree and non devicetree build, which makes me thing the AC97 part is fine, and the SSP/I2S needs some love.
With your patch, a compilation of mioa701 fails with [1].
Therefore, I'll NAK this patch, as removing SND_PAX2XX_SOC config is a bad idea.
As a way forward, please submit a patch for magician only, which makes it work again (by work I mean you can play and hear a song with aplay or equivalent).
Then hopefully Daniel can interpolate to all the SSP/I2S platforms. And maybe Daniel can test on his platform too so that we're safe on both pxa2xx and pxa3xx side.
Cheers.
-- Robert
[1] Fail message sound/soc/pxa/pxa2xx-ac97.o: In function `pxa2xx_ac97_dev_resume': /home/rj/mio_linux/kernel/sound/soc/pxa/pxa2xx-ac97.c:275: undefined reference to `pxa2xx_ac97_hw_resume' sound/soc/pxa/pxa2xx-ac97.o: In function `pxa2xx_ac97_dev_suspend': /home/rj/mio_linux/kernel/sound/soc/pxa/pxa2xx-ac97.c:270: undefined reference to `pxa2xx_ac97_hw_suspend' sound/soc/pxa/pxa2xx-ac97.o: In function `pxa2xx_ac97_dev_remove': /home/rj/mio_linux/kernel/sound/soc/pxa/pxa2xx-ac97.c:263: undefined reference to `pxa2xx_ac97_hw_remove' sound/soc/pxa/pxa2xx-ac97.o: In function `pxa2xx_ac97_read_actrl': /home/rj/mio_linux/kernel/sound/soc/pxa/pxa2xx-ac97.c:48: undefined reference to `pxa2xx_ac97_read' sound/soc/pxa/pxa2xx-ac97.o: In function `pxa2xx_ac97_write_actrl': /home/rj/mio_linux/kernel/sound/soc/pxa/pxa2xx-ac97.c:54: undefined reference to `pxa2xx_ac97_write' sound/soc/pxa/pxa2xx-ac97.o: In function `pxa2xx_ac97_warm_reset': /home/rj/mio_linux/kernel/sound/soc/pxa/pxa2xx-ac97.c:33: undefined reference to `pxa2xx_ac97_try_warm_reset' /home/rj/mio_linux/kernel/sound/soc/pxa/pxa2xx-ac97.c:35: undefined reference to `pxa2xx_ac97_finish_reset' sound/soc/pxa/pxa2xx-ac97.o: In function `pxa2xx_ac97_cold_reset': /home/rj/mio_linux/kernel/sound/soc/pxa/pxa2xx-ac97.c:40: undefined reference to `pxa2xx_ac97_try_cold_reset' /home/rj/mio_linux/kernel/sound/soc/pxa/pxa2xx-ac97.c:42: undefined reference to `pxa2xx_ac97_finish_reset' sound/soc/pxa/pxa2xx-ac97.o: In function `pxa2xx_ac97_dev_probe': /home/rj/mio_linux/kernel/sound/soc/pxa/pxa2xx-ac97.c:235: undefined reference to `pxa2xx_ac97_hw_probe' Makefile:1015: recipe for target 'vmlinux' failed
Dne 18.8.2018 v 11:42 Robert Jarzmik napsal(a):
petrcvekcz@gmail.com writes:
From: Petr Cvek petrcvekcz@gmail.com
The switch of PXA to dmaengine caused a regression for devices which are using SSP/I2S and probably AC97. The problem is in multiple allocation of DMA by function pxa2xx_soc_pcm_new() called by pxa-pcm-audio and (SSP/I2S/AC97). The regression was found on HTC Magician and after playback kernel generates an oops:
With AC97, this is still continuously tested and works fine, and the pcm part is what makes aplay happy for playing music. This is used both in a devicetree and non devicetree build, which makes me thing the AC97 part is fine, and the SSP/I2S needs some love.
I was looking into the code and if there is no .platform_name present soc_bind_dai_link() will just use "snd-soc-dummy" as the name.
With your patch, a compilation of mioa701 fails with [1].
My bad I've forgot to add "select SND_PXA2XX_LIB" from removed SND_PXA2XX_SOC, now it should compile, can you test it if it works now? fixed patch in [1].
BTW can you try insmod-aplay-stop-rmmod with the current -next on your board?
Therefore, I'll NAK this patch, as removing SND_PAX2XX_SOC config is a bad idea.
As a way forward, please submit a patch for magician only, which makes it work again (by work I mean you can play and hear a song with aplay or equivalent).
Then hopefully Daniel can interpolate to all the SSP/I2S platforms. And maybe Daniel can test on his platform too so that we're safe on both pxa2xx and pxa3xx side.
OK I can do that, (I can speak only for I2S and SSP) but if fixed patch work it should be fine.
best regards Petr
Attached: [1] Fixed patch v2, forgotten "select SND_PXA2XX_LIB"
Petr Cvek petrcvekcz@gmail.com writes:
My bad I've forgot to add "select SND_PXA2XX_LIB" from removed SND_PXA2XX_SOC, now it should compile, can you test it if it works now? fixed patch in [1].
Still NAK.
You must realise that as long as you will delete sound/soc/pxa/pxa2xx-pcm.c, I'll block the patch, as it is being used for music playback on several pxa platforms, at least the AC97 based ones.
BTW can you try insmod-aplay-stop-rmmod with the current -next on your board?
Insmod/rmmod which module exactly ? regmap-ac97.ko ac97.ko snd-pcm-dmaengine.ko snd-pxa2xx-lib.ko snd-soc-wm9713.ko snd-soc-pxa2xx.ko snd-soc-pxa2xx-ac97.ko snd-soc-mioa701.ko
OK I can do that, (I can speak only for I2S and SSP) but if fixed patch work it should be fine.
Nope, it still impacts the AC97 based boards.
Cheers.
-- Robert
Dne 18.8.2018 v 21:10 Robert Jarzmik napsal(a):
Petr Cvek petrcvekcz@gmail.com writes:
My bad I've forgot to add "select SND_PXA2XX_LIB" from removed SND_PXA2XX_SOC, now it should compile, can you test it if it works now? fixed patch in [1].
Still NAK.
You must realise that as long as you will delete sound/soc/pxa/pxa2xx-pcm.c, I'll block the patch, as it is being used for music playback on several pxa platforms, at least the AC97 based ones.
I know I will send the magician only patch. I've just wanted to know how it is working with AC97 ;-) (+ it is still a good test for possible future changes).
BTW can you try insmod-aplay-stop-rmmod with the current -next on your board?
Insmod/rmmod which module exactly ? regmap-ac97.ko ac97.ko snd-pcm-dmaengine.ko snd-pxa2xx-lib.ko snd-soc-wm9713.ko snd-soc-pxa2xx.ko snd-soc-pxa2xx-ac97.ko snd-soc-mioa701.ko
This one: snd-soc-pxa2xx-ac97.ko, but the kernel makes oops right after you terminate aplay.
best regards, Petr
Petr Cvek petrcvekcz@gmail.com writes:
Dne 18.8.2018 v 21:10 Robert Jarzmik napsal(a):
Petr Cvek petrcvekcz@gmail.com writes:
My bad I've forgot to add "select SND_PXA2XX_LIB" from removed SND_PXA2XX_SOC, now it should compile, can you test it if it works now? fixed patch in [1].
Still NAK.
You must realise that as long as you will delete sound/soc/pxa/pxa2xx-pcm.c, I'll block the patch, as it is being used for music playback on several pxa platforms, at least the AC97 based ones.
I know I will send the magician only patch. I've just wanted to know how it is working with AC97 ;-) (+ it is still a good test for possible future changes).
BTW can you try insmod-aplay-stop-rmmod with the current -next on your board?
Ok, I just did that. I based my work on linux-next, plus one extra patch which was lost in my last submissions : https://groups.google.com/forum/#!topic/linux.kernel/0iw-VDxIyZk
I insmoded the modules, called aplay, heard the music, rmmoded all the modules, then insmoded again, called aplay, and rmmoded again. Everything worked smoothly.
Cheers.
Dne 25.8.2018 v 10:39 Robert Jarzmik napsal(a):
Petr Cvek petrcvekcz@gmail.com writes:
Dne 18.8.2018 v 21:10 Robert Jarzmik napsal(a):
Petr Cvek petrcvekcz@gmail.com writes:
My bad I've forgot to add "select SND_PXA2XX_LIB" from removed SND_PXA2XX_SOC, now it should compile, can you test it if it works now? fixed patch in [1].
Still NAK.
You must realise that as long as you will delete sound/soc/pxa/pxa2xx-pcm.c, I'll block the patch, as it is being used for music playback on several pxa platforms, at least the AC97 based ones.
I know I will send the magician only patch. I've just wanted to know how it is working with AC97 ;-) (+ it is still a good test for possible future changes).
BTW can you try insmod-aplay-stop-rmmod with the current -next on your board?
Ok, I just did that. I based my work on linux-next, plus one extra patch which was lost in my last submissions : https://groups.google.com/forum/#!topic/linux.kernel/0iw-VDxIyZk
I insmoded the modules, called aplay, heard the music, rmmoded all the modules, then insmoded again, called aplay, and rmmoded again. Everything worked smoothly.
Hi guys,
...the continuation of a sound fix for (not only) HTC magician
I think I got it now. It seems mioa701_wm9713 calls snd_pcm_new() twice (once in pxa2xx-ac97.c and once in mioa701_wm9713.c by devm_snd_soc_register_card() . This doesn't cause a double DMA allocation (as both will be for the different "card"). Still you should have allocated unused DMA resources somewhere on mioa by pxa2xx_soc_pcm_new() from pxa2xx-pcm.c (= dead code).
Problem on non AC97 boards is as follows:
As defined in machine's struct snd_soc_dai_link the individual components' .pcm_new() gets called. The first will be the component .cpu_dai_name="pxa-ssp-dai.0" and by definition in pxa-ssp.c this calls pxa2xx_soc_pcm_new() which allocates DMA.
The problem is when the second component's .pcm_new() is called by the definition .platform_name = "pxa-pcm-audio" which calls again pxa2xx_soc_pcm_new() which allocates the DMA for the second time.
This problem should be same for the most of the PXA boards, which are using SSP.
A trivial comment-out of .platform_name works sometimes works, as drivers without .platform_name record gets supplied by snd-soc-dummy. And this solution has yet another problem.
The PXA27x DMA controller doesn't support a full 8192 bytes per transmission (limited by .period_bytes_max), but only up to 8191 bytes (o_O), so any DMA buffer request must be in multiples of like 8160 bytes (or less, 8160 itself must be in the multiples of 32). This hw constraint gets set by calling pxa2xx_pcm_open(). The problem is snd-soc-dummy registers its own dummy_dma_open() and indeed it gets called after pxa2xx_pcm_open() and rewrites the values by its own dummy data. (Un)luckily the value gets overwritten to 8192 bytes and DMA allocation fails.
Can somebody give me suggestions how to fix this? Changing the .period_bytes_max value in snd-soc-dummy works, deleting dummy_dma_open() works, changing pxa2xx_soc_platform_probe() to just return works too (that's why I've decided pxa2xx-pcm.c could be removed). But all these changes are ugly and not usable.
Thanks for help.
best regards, Petr
Petr Cvek petrcvekcz@gmail.com writes:
Hi guys,
...the continuation of a sound fix for (not only) HTC magician
I think I got it now. It seems mioa701_wm9713 calls snd_pcm_new() twice (once in pxa2xx-ac97.c and once in mioa701_wm9713.c by devm_snd_soc_register_card() .
Mmh no, at least no if you're speaking of sound/soc/pxa/pxa2xx-ac97.c.
I placed a printk in snd_pcm_new(), and it is called 2 times from mioa701_wm9713.c, to register the wm9713-hifi and wm9713-aux devices.
Now if you speak of sound/arm/pxa2xx-ac97.c, it should never be selected in an "soc" variant, whenre sound/soc/pxa/pxa2xx-ac97.c should be used.
Problem on non AC97 boards is as follows:
As defined in machine's struct snd_soc_dai_link the individual components' .pcm_new() gets called. The first will be the component .cpu_dai_name="pxa-ssp-dai.0" and by definition in pxa-ssp.c this calls pxa2xx_soc_pcm_new() which allocates DMA.
The problem is when the second component's .pcm_new() is called by the definition .platform_name = "pxa-pcm-audio" which calls again pxa2xx_soc_pcm_new() which allocates the DMA for the second time.
This problem should be same for the most of the PXA boards, which are using SSP.
Ok, I suppose you have checked this with a printk, WARN_ON() be sure, right ? And could you send me you .config, just to be sure we're on the same page on the drivers you're using.
If that's the case, Daniel would you have a look into it please ?
The PXA27x DMA controller doesn't support a full 8192 bytes per transmission (limited by .period_bytes_max), but only up to 8191 bytes (o_O), so any DMA buffer request must be in multiples of like 8160 bytes (or less, 8160 itself must be in the multiples of 32). This hw constraint gets set by calling pxa2xx_pcm_open(). The problem is snd-soc-dummy registers its own dummy_dma_open() and indeed it gets called after pxa2xx_pcm_open() and rewrites the values by its own dummy data. (Un)luckily the value gets overwritten to 8192 bytes and DMA allocation fails.
Very true. I hope you're using CONFIG_PXA_DMA=1 and not CONFIG_MMP_PDMA, this will enable us to debug when things will get out of control.
Can somebody give me suggestions how to fix this? Changing the .period_bytes_max value in snd-soc-dummy works, deleting dummy_dma_open() works, changing pxa2xx_soc_platform_probe() to just return works too (that's why I've decided pxa2xx-pcm.c could be removed). But all these changes are ugly and not usable.
At least we must find a way to have : - pxa2xx_pcm_open() called only once - pxa-pcm-audio shoud be used for SSP based PXA boards
I'll wait for Daniel to comment on that, he's more advanced in the sound framework understanding than I am.
Cheers.
Dne 29.8.2018 v 16:11 Robert Jarzmik napsal(a):
Petr Cvek petrcvekcz@gmail.com writes:
Hi guys,
...the continuation of a sound fix for (not only) HTC magician
I think I got it now. It seems mioa701_wm9713 calls snd_pcm_new() twice (once in pxa2xx-ac97.c and once in mioa701_wm9713.c by devm_snd_soc_register_card() .
Mmh no, at least no if you're speaking of sound/soc/pxa/pxa2xx-ac97.c.
I placed a printk in snd_pcm_new(), and it is called 2 times from mioa701_wm9713.c, to register the wm9713-hifi and wm9713-aux devices.
Now if you speak of sound/arm/pxa2xx-ac97.c, it should never be selected in an "soc" variant, whenre sound/soc/pxa/pxa2xx-ac97.c should be used.
Mea culpa I _did_ read sound/arm/pxa2xx-ac97.c. That means I still don't know why pxa2xx_soc_pcm_new() is fine on the AC97.
Problem on non AC97 boards is as follows:
As defined in machine's struct snd_soc_dai_link the individual components' .pcm_new() gets called. The first will be the component .cpu_dai_name="pxa-ssp-dai.0" and by definition in pxa-ssp.c this calls pxa2xx_soc_pcm_new() which allocates DMA.
The problem is when the second component's .pcm_new() is called by the definition .platform_name = "pxa-pcm-audio" which calls again pxa2xx_soc_pcm_new() which allocates the DMA for the second time.
This problem should be same for the most of the PXA boards, which are using SSP.
Ok, I suppose you have checked this with a printk, WARN_ON() be sure, right ? And could you send me you .config, just to be sure we're on the same page on the drivers you're using.
If that's the case, Daniel would you have a look into it please ?
I've put printks in almost every sound function by now ;-). It gets called in soc_new_pcm() from for_each_rtdcom iterator. For SSP the the function is defined in pxa_ssp_component, for I2S it is defined in pxa_i2s_component and for sound/soc/pxa/pxa2xx-pcm.c there is the definition in pxa2xx_soc_platform.
BTW sound/soc/pxa/pxa2xx-ac97.c have the definition in pxa_ac97_component struct.
Could you place printks in soc_new_pcm() around code from link?
https://elixir.bootlin.com/linux/v4.19-rc1/source/sound/soc/soc-pcm.c#L3155
for_each_rtdcom(rtd, rtdcom) { component = rtdcom->component;
pr_info("TEST component: %p %s\n", component, component->name);
if (!component->driver->pcm_new) continue;
ret = component->driver->pcm_new(rtd);
pr_info("actually called=%i\n", ret);
if (ret < 0) { dev_err(component->dev, "ASoC: pcm constructor failed: %d\n", ret); return ret; } }
I got this log:
magician-audio magician-audio: ASoC: registered pcm #0 UDA1380 Playback uda1380-hifi-playback-0 TEST component: 95cf8217 pxa-ssp-dai.0 ... (pxa2xx_soc_pcm_new gets called for pxa-ssp-dai.0) actually called=0 TEST component: 47284e1d uda1380-codec.0-0018 TEST component: 1e982c1f pxa-pcm-audio ... (pxa2xx_soc_pcm_new gets called for pxa-pcm-audio) actually called=0 magician-audio magician-audio: uda1380-hifi-playback <-> pxa-ssp-dai.0 mapping ok magician-audio magician-audio: ASoC: probe Magician dai link 1 late 2 magician-audio magician-audio: ASoC: registered pcm #1 UDA1380 Capture uda1380-hifi-capture-1 TEST component: 30bbb218 pxa2xx-i2s ... (pxa2xx_soc_pcm_new gets called for pxa2xx-i2s) actually called=0 TEST component: 47284e1d uda1380-codec.0-0018 TEST component: 1e982c1f pxa-pcm-audio ... (pxa2xx_soc_pcm_new gets called for pxa-pcm-audio) actually called=0
Config attached, only differences from vanilla should be ov9640 camera and reverted IrDA removal.
The PXA27x DMA controller doesn't support a full 8192 bytes per transmission (limited by .period_bytes_max), but only up to 8191 bytes (o_O), so any DMA buffer request must be in multiples of like 8160 bytes (or less, 8160 itself must be in the multiples of 32). This hw constraint gets set by calling pxa2xx_pcm_open(). The problem is snd-soc-dummy registers its own dummy_dma_open() and indeed it gets called after pxa2xx_pcm_open() and rewrites the values by its own dummy data. (Un)luckily the value gets overwritten to 8192 bytes and DMA allocation fails.
Very true. I hope you're using CONFIG_PXA_DMA=1 and not CONFIG_MMP_PDMA, this will enable us to debug when things will get out of control.
I do from the beginning. Is it even possible to use CONFIG_MMP_PDMA on PXA27x?
Can somebody give me suggestions how to fix this? Changing the .period_bytes_max value in snd-soc-dummy works, deleting dummy_dma_open() works, changing pxa2xx_soc_platform_probe() to just return works too (that's why I've decided pxa2xx-pcm.c could be removed). But all these changes are ugly and not usable.
At least we must find a way to have :
- pxa2xx_pcm_open() called only once
- pxa-pcm-audio shoud be used for SSP based PXA boards
It may be possible to remove the block bellow from SSP and I2S drivers but it will change the situation for every platform which uses SSP or I2S:
.ops = &pxa2xx_pcm_ops, .pcm_new = pxa2xx_soc_pcm_new, .pcm_free = pxa2xx_pcm_free_dma_buffers,
The generic functions would be then called just from pxa-pcm-audio component.
Petr
Petr Cvek petrcvekcz@gmail.com writes:
Dne 29.8.2018 v 16:11 Robert Jarzmik napsal(a):
Petr Cvek petrcvekcz@gmail.com writes: If that's the case, Daniel would you have a look into it please ?
I've put printks in almost every sound function by now ;-). It gets I got this log:
...zip... I got this log : [14540.460575] ac97-0: adapter registered by pxa2xx-ac97 [14540.474726] ac97-0: snd_ac97_bus_scan_one(codec_num=0): vendor_id=0x574d4c13 [14541.003160] mioa701-wm9713 mioa701-wm9713: ASoC: CODEC DAI wm9713-hifi not registered [14541.978576] wm97xx-core pxa2xx-ac97:0: wm97xx core found, id=0x574d4c13 [14542.010897] wm9713-codec wm9713-codec: Control not supported for path Mic B Source -> [MPB] -> Mic B Pre Amp [14542.096874] wm9713-codec wm9713-codec: ASoC: no dapm match for Mic B Source --> MPB --> Mic B Pre Amp [14542.149488] wm9713-codec wm9713-codec: ASoC: Failed to add route Mic B Source -> MPB -> Mic B Pre Amp [14542.195525] TEST component: 5c700a04 pxa2xx-ac97 [14542.201547] actually called=0 [14542.205938] TEST component: 3b89ec70 wm9713-codec [14542.209549] TEST component: 58f79ee1 pxa-pcm-audio [14542.215826] actually called=0 [14542.219567] mioa701-wm9713 mioa701-wm9713: wm9713-hifi <-> pxa2xx-ac97 mapping ok [14542.227201] TEST component: 5c700a04 pxa2xx-ac97 [14542.232090] actually called=0 [14542.236140] TEST component: 3b89ec70 wm9713-codec [14542.239595] TEST component: 58f79ee1 pxa-pcm-audio [14542.244281] actually called=0 [14542.247944] mioa701-wm9713 mioa701-wm9713: wm9713-aux <-> pxa2xx-ac97-aux mapping ok [14542.255778] wm9713-codec wm9713-codec: ASoC: mux Sidetone Mux has no paths [14542.312582] mioa701-wm9713 mioa701-wm9713: Be warned that incorrect mixers/muxes setup will lead to overheating and possible destruction of your device. Do not use without a good knowledge of mio's board design!
Very true. I hope you're using CONFIG_PXA_DMA=1 and not CONFIG_MMP_PDMA, this will enable us to debug when things will get out of control.
I do from the beginning. Is it even possible to use CONFIG_MMP_PDMA on PXA27x?
It should be ... But I advice against it.
It may be possible to remove the block bellow from SSP and I2S drivers but it will change the situation for every platform which uses SSP or I2S:
.ops = &pxa2xx_pcm_ops, .pcm_new = pxa2xx_soc_pcm_new, .pcm_free = pxa2xx_pcm_free_dma_buffers,
The generic functions would be then called just from pxa-pcm-audio component.
That's up to Daniel and you.
Cheers.
Dne 2.9.2018 v 17:47 Robert Jarzmik napsal(a):
Petr Cvek petrcvekcz@gmail.com writes:
Dne 29.8.2018 v 16:11 Robert Jarzmik napsal(a):
Petr Cvek petrcvekcz@gmail.com writes: If that's the case, Daniel would you have a look into it please ?
I've put printks in almost every sound function by now ;-). It gets I got this log:
...zip... I got this log : [14540.460575] ac97-0: adapter registered by pxa2xx-ac97 [14540.474726] ac97-0: snd_ac97_bus_scan_one(codec_num=0): vendor_id=0x574d4c13 [14541.003160] mioa701-wm9713 mioa701-wm9713: ASoC: CODEC DAI wm9713-hifi not registered [14541.978576] wm97xx-core pxa2xx-ac97:0: wm97xx core found, id=0x574d4c13 [14542.010897] wm9713-codec wm9713-codec: Control not supported for path Mic B Source -> [MPB] -> Mic B Pre Amp [14542.096874] wm9713-codec wm9713-codec: ASoC: no dapm match for Mic B Source --> MPB --> Mic B Pre Amp [14542.149488] wm9713-codec wm9713-codec: ASoC: Failed to add route Mic B Source -> MPB -> Mic B Pre Amp [14542.195525] TEST component: 5c700a04 pxa2xx-ac97 [14542.201547] actually called=0 [14542.205938] TEST component: 3b89ec70 wm9713-codec [14542.209549] TEST component: 58f79ee1 pxa-pcm-audio [14542.215826] actually called=0 [14542.219567] mioa701-wm9713 mioa701-wm9713: wm9713-hifi <-> pxa2xx-ac97 mapping ok [14542.227201] TEST component: 5c700a04 pxa2xx-ac97 [14542.232090] actually called=0 [14542.236140] TEST component: 3b89ec70 wm9713-codec [14542.239595] TEST component: 58f79ee1 pxa-pcm-audio [14542.244281] actually called=0 [14542.247944] mioa701-wm9713 mioa701-wm9713: wm9713-aux <-> pxa2xx-ac97-aux mapping ok [14542.255778] wm9713-codec wm9713-codec: ASoC: mux Sidetone Mux has no paths [14542.312582] mioa701-wm9713 mioa701-wm9713: Be warned that incorrect mixers/muxes setup will lead to overheating and possible destruction of your device. Do not use without a good knowledge of mio's board design!
So it does call pxa2xx_pcm_preallocate_dma_buffer() twice on pxa2xx-ac97 too. The weird thing is it doesn't cause warning at rmmod or playback close.
It may be possible to remove the block bellow from SSP and I2S drivers but it will change the situation for every platform which uses SSP or I2S:
.ops = &pxa2xx_pcm_ops, .pcm_new = pxa2xx_soc_pcm_new, .pcm_free = pxa2xx_pcm_free_dma_buffers,
The generic functions would be then called just from pxa-pcm-audio component.
That's up to Daniel and you.
OK, I will send patches soon, with AC97 patched too... Thanks for helping.
Best regards, Petr
participants (3)
-
Petr Cvek
-
petrcvekcz@gmail.com
-
Robert Jarzmik