[alsa-devel] [PATCH] ASoC: core - Fix dai usage in pcm_new() platform handlers
Commit 552d1ef ("ASoC: core - Optimise and refactor pcm_new() to pass only rtd") refactored the ASoC internal core to only pass a pointer to a runtime as argument to individual pcm_new() functions. However, the new code that was added to the handlers to get access to the dai now uses rtd->cpu_dai, while before this patch, rtd->codec_dai was used.
This patch fixes all the pcm_new() handlers that were affected. Tested on a PXA platform.
Signed-off-by: Daniel Mack zonque@gmail.com Cc: Liam Girdwood lrg@ti.com --- sound/soc/atmel/atmel-pcm.c | 2 +- sound/soc/blackfin/bf5xx-ac97-pcm.c | 2 +- sound/soc/blackfin/bf5xx-i2s-pcm.c | 2 +- sound/soc/blackfin/bf5xx-tdm-pcm.c | 2 +- sound/soc/davinci/davinci-pcm.c | 2 +- sound/soc/fsl/fsl_dma.c | 2 +- sound/soc/fsl/mpc5200_dma.c | 2 +- sound/soc/imx/imx-pcm-fiq.c | 2 +- sound/soc/imx/imx-ssi.c | 2 +- sound/soc/jz4740/jz4740-pcm.c | 2 +- sound/soc/kirkwood/kirkwood-dma.c | 2 +- sound/soc/mid-x86/sst_platform.c | 2 +- sound/soc/nuc900/nuc900-pcm.c | 2 +- sound/soc/omap/omap-pcm.c | 2 +- sound/soc/pxa/pxa2xx-pcm.c | 2 +- sound/soc/s6000/s6000-pcm.c | 2 +- sound/soc/samsung/dma.c | 2 +- sound/soc/tegra/tegra_pcm.c | 2 +- sound/soc/txx9/txx9aclc.c | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c index f81d4c3..d1140c1 100644 --- a/sound/soc/atmel/atmel-pcm.c +++ b/sound/soc/atmel/atmel-pcm.c @@ -367,7 +367,7 @@ static u64 atmel_pcm_dmamask = 0xffffffff; static int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret = 0;
diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c index 9e59f68..fdaed48 100644 --- a/sound/soc/blackfin/bf5xx-ac97-pcm.c +++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c @@ -421,7 +421,7 @@ static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret = 0;
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c index 96d0d90..9bdf1ea 100644 --- a/sound/soc/blackfin/bf5xx-i2s-pcm.c +++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c @@ -251,7 +251,7 @@ static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); int bf5xx_pcm_i2s_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret = 0;
diff --git a/sound/soc/blackfin/bf5xx-tdm-pcm.c b/sound/soc/blackfin/bf5xx-tdm-pcm.c index c95cc03..2d7e176 100644 --- a/sound/soc/blackfin/bf5xx-tdm-pcm.c +++ b/sound/soc/blackfin/bf5xx-tdm-pcm.c @@ -286,7 +286,7 @@ static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); static int bf5xx_pcm_tdm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret = 0;
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index a49e667..35b60f9 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c @@ -836,7 +836,7 @@ static u64 davinci_pcm_dmamask = 0xffffffff; static int davinci_pcm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret;
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index 732208c..932da5f 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c @@ -297,7 +297,7 @@ static irqreturn_t fsl_dma_isr(int irq, void *dev_id) static int fsl_dma_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; static u64 fsl_dma_dmamask = DMA_BIT_MASK(36); int ret; diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index 19ad0c1..729b0f8 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c @@ -302,7 +302,7 @@ static u64 psc_dma_dmamask = 0xffffffff; static int psc_dma_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(rtd->cpu_dai); size_t size = psc_dma_hardware.buffer_bytes_max; diff --git a/sound/soc/imx/imx-pcm-fiq.c b/sound/soc/imx/imx-pcm-fiq.c index 309c59e..dc8296a 100644 --- a/sound/soc/imx/imx-pcm-fiq.c +++ b/sound/soc/imx/imx-pcm-fiq.c @@ -241,7 +241,7 @@ static int ssi_irq = 0; static int imx_pcm_fiq_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret;
diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c index 158a91c..5b0972b 100644 --- a/sound/soc/imx/imx-ssi.c +++ b/sound/soc/imx/imx-ssi.c @@ -391,7 +391,7 @@ static u64 imx_pcm_dmamask = DMA_BIT_MASK(32); int imx_pcm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret = 0;
diff --git a/sound/soc/jz4740/jz4740-pcm.c b/sound/soc/jz4740/jz4740-pcm.c index a7c9578..5a34dee 100644 --- a/sound/soc/jz4740/jz4740-pcm.c +++ b/sound/soc/jz4740/jz4740-pcm.c @@ -302,7 +302,7 @@ static u64 jz4740_pcm_dmamask = DMA_BIT_MASK(32); int jz4740_pcm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret = 0;
diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c index cd33de1..75255e4 100644 --- a/sound/soc/kirkwood/kirkwood-dma.c +++ b/sound/soc/kirkwood/kirkwood-dma.c @@ -315,7 +315,7 @@ static int kirkwood_dma_preallocate_dma_buffer(struct snd_pcm *pcm, static int kirkwood_dma_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret;
diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c index 3e78260..92de19c 100644 --- a/sound/soc/mid-x86/sst_platform.c +++ b/sound/soc/mid-x86/sst_platform.c @@ -404,7 +404,7 @@ static void sst_pcm_free(struct snd_pcm *pcm)
int sst_pcm_new(struct snd_soc_pcm_runtime *rtd) { - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int retval = 0;
diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c index d589ef1..1964801 100644 --- a/sound/soc/nuc900/nuc900-pcm.c +++ b/sound/soc/nuc900/nuc900-pcm.c @@ -318,7 +318,7 @@ static u64 nuc900_pcm_dmamask = DMA_BIT_MASK(32); static int nuc900_dma_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm;
if (!card->dev->dma_mask) diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index b2f5751..0787a54 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -369,7 +369,7 @@ static void omap_pcm_free_dma_buffers(struct snd_pcm *pcm) static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret = 0;
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c index d73d6f6..5438a67 100644 --- a/sound/soc/pxa/pxa2xx-pcm.c +++ b/sound/soc/pxa/pxa2xx-pcm.c @@ -88,7 +88,7 @@ static u64 pxa2xx_pcm_dmamask = DMA_BIT_MASK(32); static int pxa2xx_soc_pcm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret = 0;
diff --git a/sound/soc/s6000/s6000-pcm.c b/sound/soc/s6000/s6000-pcm.c index 80c85fd..925192d 100644 --- a/sound/soc/s6000/s6000-pcm.c +++ b/sound/soc/s6000/s6000-pcm.c @@ -446,7 +446,7 @@ static u64 s6000_pcm_dmamask = DMA_BIT_MASK(32); static int s6000_pcm_new(struct snd_soc_pcm_runtime *runtime) { struct snd_card *card = runtime->card->snd_card; - struct snd_soc_dai *dai = runtime->cpu_dai; + struct snd_soc_dai *dai = runtime->codec_dai; struct snd_pcm *pcm = runtime->pcm; struct s6000_pcm_dma_params *params; int res; diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c index 9465588..a2475b2 100644 --- a/sound/soc/samsung/dma.c +++ b/sound/soc/samsung/dma.c @@ -428,7 +428,7 @@ static u64 dma_mask = DMA_BIT_MASK(32); static int dma_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret = 0;
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index ff86e5e..efd00a3 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c @@ -325,7 +325,7 @@ static u64 tegra_dma_mask = DMA_BIT_MASK(32); static int tegra_pcm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret = 0;
diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c index 34aa972..5be6191 100644 --- a/sound/soc/txx9/txx9aclc.c +++ b/sound/soc/txx9/txx9aclc.c @@ -290,7 +290,7 @@ static void txx9aclc_pcm_free_dma_buffers(struct snd_pcm *pcm)
static int txx9aclc_pcm_new(struct snd_soc_pcm_runtime *rtd) { - struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; struct platform_device *pdev = to_platform_device(dai->platform->dev); struct txx9aclc_soc_device *dev;
On Wed, Jun 22, 2011 at 08:05:29PM +0200, Daniel Mack wrote:
Commit 552d1ef ("ASoC: core - Optimise and refactor pcm_new() to pass only rtd") refactored the ASoC internal core to only pass a pointer to a runtime as argument to individual pcm_new() functions. However, the new code that was added to the handlers to get access to the dai now uses rtd->cpu_dai, while before this patch, rtd->codec_dai was used.
Which is a problem because...
diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c index f81d4c3..d1140c1 100644 --- a/sound/soc/atmel/atmel-pcm.c +++ b/sound/soc/atmel/atmel-pcm.c @@ -367,7 +367,7 @@ static u64 atmel_pcm_dmamask = 0xffffffff; static int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card;
- struct snd_soc_dai *dai = rtd->cpu_dai;
- struct snd_soc_dai *dai = rtd->codec_dai; struct snd_pcm *pcm = rtd->pcm; int ret = 0;
The original code doesn't look obviously wrong while if the CPU driver is peering at the CODEC driver that smells very bad. What's the actual problem here?
On Wed, Jun 22, 2011 at 8:10 PM, Mark Brown broonie@opensource.wolfsonmicro.com wrote:
On Wed, Jun 22, 2011 at 08:05:29PM +0200, Daniel Mack wrote:
Commit 552d1ef ("ASoC: core - Optimise and refactor pcm_new() to pass only rtd") refactored the ASoC internal core to only pass a pointer to a runtime as argument to individual pcm_new() functions. However, the new code that was added to the handlers to get access to the dai now uses rtd->cpu_dai, while before this patch, rtd->codec_dai was used.
Which is a problem because...
diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c index f81d4c3..d1140c1 100644 --- a/sound/soc/atmel/atmel-pcm.c +++ b/sound/soc/atmel/atmel-pcm.c @@ -367,7 +367,7 @@ static u64 atmel_pcm_dmamask = 0xffffffff; static int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card;
- struct snd_soc_dai *dai = rtd->cpu_dai;
- struct snd_soc_dai *dai = rtd->codec_dai;
struct snd_pcm *pcm = rtd->pcm; int ret = 0;
The original code doesn't look obviously wrong while if the CPU driver is peering at the CODEC driver that smells very bad. What's the actual problem here?
I thought so too, but I'm facing an Ooops on 3.0.0-rc4, while the same platform code was running fine on 2.6.39. And while searching for potential reasons for this regression, this commit was quite obvious. But maybe that's indeed fixing the wrong side. What happens is that pxa2xx_pcm_preallocate_dma_buffer() is called for SNDRV_PCM_STREAM_CAPTURE, but pcm->streams[1].substream is NULL.
[ 2.959735] Unable to handle kernel NULL pointer dereference at virtual address 00000050 [ 2.967792] pgd = c0004000 [ 2.970481] [00000050] *pgd=00000000 [ 2.974064] Internal error: Oops: 805 [#1] [ 2.978133] Modules linked in: [ 2.981171] CPU: 0 Not tainted (3.0.0-rc4+ #207) [ 2.986124] PC is at pxa2xx_pcm_preallocate_dma_buffer+0x38/0x8c [ 2.992093] LR is at pxa2xx_pcm_preallocate_dma_buffer+0x34/0x8c [ 2.998067] pc : [<c0296110>] lr : [<c029610c>] psr: 60000013 [ 2.998078] sp : c6033df0 ip : 000033db fp : c61f6e40 [ 3.009467] r10: 00000000 r9 : c6175a00 r8 : 00000001 [ 3.014655] r7 : c61dd340 r6 : c61e7000 r5 : 00000000 r4 : c6175e00 [ 3.021134] r3 : 00000002 r2 : 60000013 r1 : 00000000 r0 : 0000004b [ 3.027615] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel [ 3.034875] Control: 0000397f Table: a0004018 DAC: 00000035 [ 3.040578] Process swapper (pid: 1, stack limit = 0xc6032278) [ 3.046369] Stack: (0xc6033df0 to 0xc6034000) [ 3.050699] 3de0: 00000001 c02a0dcc 00000000 00000000 [ 3.058827] 3e00: c61e7000 c029f188 00000000 c6033e5c c6033e48 c61cfba0 00000000 79616c50 [ 3.066961] 3e20: 6b636162 41545320 2d583233 c61e0030 c6033e68 c00fca2c 00000000 c00fcc8c [ 3.075094] 3e40: c61cfba0 c61e9ea0 c6033e68 c00fcb68 c61cfba0 c61e9ea0 00000000 c6175e00 [ 3.083226] 3e60: c61f6e40 c61cfba0 c0555328 00000000 c61dd340 c61f6e40 00000002 c61e7000 [ 3.091360] 3e80: 00000000 c02990a8 c0555338 c501e480 c0555400 c0555348 c6175a00 c0555700 [ 3.099492] 3ea0: c05553d8 c05553e0 00000000 00000000 c6175d08 c0555340 00000000 c0555328 [ 3.107625] 3ec0: c0554450 00000000 00000000 c6175d10 00000000 c0299ad0 c6175d08 c6175d08 [ 3.115758] 3ee0: c6175d08 c0299b34 c6175d10 00000000 c6175d08 c01e4e28 c6175d08 c01e3b0c [ 3.123891] 3f00: c6175d08 00000000 c01e3c74 c6175d08 c6033f18 c01e304c c602a108 c61f6334 [ 3.132024] 3f20: c04ceff2 c6175d08 c6175d08 c6175d3c 00000013 c01e3d50 c6175d00 c6175d08 [ 3.140156] 3f40: 00000000 c01e2e74 00000000 c01e1dfc 00000000 c0548978 00000000 00000021 [ 3.148289] 3f60: c001bd54 c019c5e0 00000000 c6175d00 00000000 00000000 00000013 c001bd54 [ 3.156423] 3f80: 00000000 00000000 00000000 c01e5428 c6175d08 c00228d0 c0022954 c004985c [ 3.164555] 3fa0: 00000013 c001be6c c004985c 00000013 c001bd48 c00483e0 00000033 00000000 [ 3.172688] 3fc0: 00000013 00000120 c05401c8 c00228d0 c0022954 c004985c 00000013 00000000 [ 3.180821] 3fe0: 00000000 c00083e4 00000000 00000000 c0008370 c004985c ffffffff ffffffff [ 3.189000] [<c0296110>] (pxa2xx_pcm_preallocate_dma_buffer+0x38/0x8c) from [<c029f188>] (soc_new_pcm+0x190/0x1f0) [ 3.199302] [<c029f188>] (soc_new_pcm+0x190/0x1f0) from [<c02990a8>] (snd_soc_instantiate_cards+0x644/0x9b4) [ 3.209076] [<c02990a8>] (snd_soc_instantiate_cards+0x644/0x9b4) from [<c0299ad0>] (snd_soc_register_card+0x180/0x1bc) [ 3.219715] [<c0299ad0>] (snd_soc_register_card+0x180/0x1bc) from [<c0299b34>] (soc_probe+0x28/0x4c) [ 3.228805] [<c0299b34>] (soc_probe+0x28/0x4c) from [<c01e4e28>] (platform_drv_probe+0x1c/0x24) [ 3.237465] [<c01e4e28>] (platform_drv_probe+0x1c/0x24) from [<c01e3b0c>] (driver_probe_device+0xb4/0x198) [ 3.247069] [<c01e3b0c>] (driver_probe_device+0xb4/0x198) from [<c01e304c>] (bus_for_each_drv+0x4c/0x8c) [ 3.256501] [<c01e304c>] (bus_for_each_drv+0x4c/0x8c) from [<c01e3d50>] (device_attach+0x60/0x80) [ 3.265323] [<c01e3d50>] (device_attach+0x60/0x80) from [<c01e2e74>] (bus_probe_device+0x28/0x54) [ 3.274167] [<c01e2e74>] (bus_probe_device+0x28/0x54) from [<c01e1dfc>] (device_add+0x408/0x58c) [ 3.282914] [<c01e1dfc>] (device_add+0x408/0x58c) from [<c01e5428>] (platform_device_add+0x108/0x168) [ 3.292099] [<c01e5428>] (platform_device_add+0x108/0x168) from [<c001be6c>] (raumfeld_audio_init+0x118/0x170) [ 3.302069] [<c001be6c>] (raumfeld_audio_init+0x118/0x170) from [<c00483e0>] (do_one_initcall+0x94/0x164) [ 3.311592] [<c00483e0>] (do_one_initcall+0x94/0x164) from [<c00083e4>] (kernel_init+0x74/0x11c) [ 3.320335] [<c00083e4>] (kernel_init+0x74/0x11c) from [<c004985c>] (kernel_thread_exit+0x0/0x8) [ 3.329074] Code: e1a02005 e59f0054 eb040ce2 e3a03002 (e5853050) [ 3.335251] ---[ end trace b4ec1505aa8093ea ]--- [ 3.339870] Kernel panic - not syncing: Attempted to kill init! [ 3.345830] [<c004d438>] (unwind_backtrace+0x0/0xec) from [<c039935c>] (panic+0x4c/0x188) [ 3.354011] [<c039935c>] (panic+0x4c/0x188) from [<c005ef5c>] (do_exit+0xac/0x630) [ 3.361544] [<c005ef5c>] (do_exit+0xac/0x630) from [<c004bfb4>] (die+0x1b0/0x1e0) [ 3.369022] [<c004bfb4>] (die+0x1b0/0x1e0) from [<c004e5a0>] (__do_kernel_fault+0x64/0x88) [ 3.377282] [<c004e5a0>] (__do_kernel_fault+0x64/0x88) from [<c004e77c>] (do_page_fault+0x1b8/0x1d0) [ 3.386406] [<c004e77c>] (do_page_fault+0x1b8/0x1d0) from [<c00482c0>] (do_DataAbort+0x34/0x94) [ 3.395100] [<c00482c0>] (do_DataAbort+0x34/0x94) from [<c0048b4c>] (__dabt_svc+0x4c/0x60) [ 3.403313] Exception stack(0xc6033da8 to 0xc6033df0) [ 3.408360] 3da0: 0000004b 00000000 60000013 00000002 c6175e00 00000000 [ 3.416518] 3dc0: c61e7000 c61dd340 00000001 c6175a00 00000000 c61f6e40 000033db c6033df0 [ 3.424671] 3de0: c029610c c0296110 60000013 ffffffff [ 3.429708] [<c0048b4c>] (__dabt_svc+0x4c/0x60) from [<c0296110>] (pxa2xx_pcm_preallocate_dma_buffer+0x38/0x8c) [ 3.439791] [<c0296110>] (pxa2xx_pcm_preallocate_dma_buffer+0x38/0x8c) from [<c029f188>] (soc_new_pcm+0x190/0x1f0) [ 3.450114] [<c029f188>] (soc_new_pcm+0x190/0x1f0) from [<c02990a8>] (snd_soc_instantiate_cards+0x644/0x9b4) [ 3.459924] [<c02990a8>] (snd_soc_instantiate_cards+0x644/0x9b4) from [<c0299ad0>] (snd_soc_register_card+0x180/0x1bc) [ 3.470590] [<c0299ad0>] (snd_soc_register_card+0x180/0x1bc) from [<c0299b34>] (soc_probe+0x28/0x4c) [ 3.479711] [<c0299b34>] (soc_probe+0x28/0x4c) from [<c01e4e28>] (platform_drv_probe+0x1c/0x24) [ 3.488401] [<c01e4e28>] (platform_drv_probe+0x1c/0x24) from [<c01e3b0c>] (driver_probe_device+0xb4/0x198) [ 3.498040] [<c01e3b0c>] (driver_probe_device+0xb4/0x198) from [<c01e304c>] (bus_for_each_drv+0x4c/0x8c) [ 3.507496] [<c01e304c>] (bus_for_each_drv+0x4c/0x8c) from [<c01e3d50>] (device_attach+0x60/0x80) [ 3.516353] [<c01e3d50>] (device_attach+0x60/0x80) from [<c01e2e74>] (bus_probe_device+0x28/0x54) [ 3.525223] [<c01e2e74>] (bus_probe_device+0x28/0x54) from [<c01e1dfc>] (device_add+0x408/0x58c) [ 3.534005] [<c01e1dfc>] (device_add+0x408/0x58c) from [<c01e5428>] (platform_device_add+0x108/0x168) [ 3.543189] [<c01e5428>] (platform_device_add+0x108/0x168) from [<c001be6c>] (raumfeld_audio_init+0x118/0x170) [ 3.553192] [<c001be6c>] (raumfeld_audio_init+0x118/0x170) from [<c00483e0>] (do_one_initcall+0x94/0x164) [ 3.562747] [<c00483e0>] (do_one_initcall+0x94/0x164) from [<c00083e4>] (kernel_init+0x74/0x11c) [ 3.571519] [<c00083e4>] (kernel_init+0x74/0x11c) from [<c004985c>] (kernel_thread_exit+0x0/0x8) [ 3.793639] pxa27x-ohci pxa27x-ohci: auto-stop root hub
On Wed, Jun 22, 2011 at 8:21 PM, Daniel Mack zonque@gmail.com wrote:
I thought so too, but I'm facing an Ooops on 3.0.0-rc4, while the same platform code was running fine on 2.6.39. And while searching for potential reasons for this regression, this commit was quite obvious. But maybe that's indeed fixing the wrong side. What happens is that pxa2xx_pcm_preallocate_dma_buffer() is called for SNDRV_PCM_STREAM_CAPTURE, but pcm->streams[1].substream is NULL.
Note that I have local changes which aren't submitted for mainline yet - see the patch attached. Is there anything substantionally wrong with these changes?
Daniel
On Wed, Jun 22, 2011 at 08:21:06PM +0200, Daniel Mack wrote:
I thought so too, but I'm facing an Ooops on 3.0.0-rc4, while the same platform code was running fine on 2.6.39. And while searching for potential reasons for this regression, this commit was quite obvious. But maybe that's indeed fixing the wrong side. What happens is that pxa2xx_pcm_preallocate_dma_buffer() is called for SNDRV_PCM_STREAM_CAPTURE, but pcm->streams[1].substream is NULL.
Is this the same issue that Timur was having where he was relying on the channel count of one of the DAI drivers to tell him if the substream was allocated instead of looking to see if the substream was allocated which is the more direct and reliable thing to do? Looking at the code it appears that's the case for PXA.
On Wed, Jun 22, 2011 at 8:36 PM, Mark Brown broonie@opensource.wolfsonmicro.com wrote:
On Wed, Jun 22, 2011 at 08:21:06PM +0200, Daniel Mack wrote:
I thought so too, but I'm facing an Ooops on 3.0.0-rc4, while the same platform code was running fine on 2.6.39. And while searching for potential reasons for this regression, this commit was quite obvious. But maybe that's indeed fixing the wrong side. What happens is that pxa2xx_pcm_preallocate_dma_buffer() is called for SNDRV_PCM_STREAM_CAPTURE, but pcm->streams[1].substream is NULL.
Is this the same issue that Timur was having where he was relying on the channel count of one of the DAI drivers to tell him if the substream was allocated instead of looking to see if the substream was allocated which is the more direct and reliable thing to do? Looking at the code it appears that's the case for PXA.
And so the bug was always there, it was just hidden by another bug. Thanks for the pointer :)
Daniel
participants (2)
-
Daniel Mack
-
Mark Brown