-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPC error + kernel oops on WHL w/ HDA/DMIC and 1.3 signed firmware #1417
Comments
kernel regression, the sof-dev-rebase-20190821 tag works fine. More bisect... |
@plbossart sure I can try it |
@plbossart I think I know what the problem is : Could you please try reverting my patch? If we have this change in the kernel, it will run into the error seen above. |
@ranj063 it works with the latest kernel if I use an older topology... I took the latest topology since I didn't which one corresponds to the signed 1.3 firmware. and of course it breaks. |
hmm that makes sense. So we should take the 1.3 topology with the 1.3 firmware. |
here's what bisect tells me:
|
why would this change the hw_params information? |
Looks like a problematic integration. The pipeline definition moved to -dnl W_PIPELINE(stream, period, priority, frames, core, initiator, platform)
+dnl W_PIPELINE(stream, period, priority, core, initiator, platform)
define(`W_PIPELINE',
`SectionVendorTuples."'N_PIPELINE($1)`_tuples" {'
` tokens "sof_sched_tokens"'
` tuples."word" {'
` SOF_TKN_SCHED_PERIOD' STR($2)
` SOF_TKN_SCHED_PRIORITY' STR($3)
-` SOF_TKN_SCHED_CORE' STR($5)
-` SOF_TKN_SCHED_FRAMES' STR($4)
-` SOF_TKN_SCHED_TIME_DOMAIN' STR($6)
+` SOF_TKN_SCHED_CORE' STR($4)
+` SOF_TKN_SCHED_FRAMES' "0"
+` SOF_TKN_SCHED_TIME_DOMAIN' STR($5)
` }'
`}' so a value required by firmware is no longer set, but it was required by previous firmware. And we still have code in the kernel that uses this: diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 17fe6a1d5f3e..e165ff915294 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -1504,6 +1504,13 @@ static int sof_widget_load_pipeline(struct snd_soc_component *scomp,
goto err;
}
+ if (pipeline->frames_per_sched == 0) {
+ pipeline->frames_per_sched = 48;
+ dev_dbg(sdev->dev, "plb: pipeline %s: forcing frame per sched\n",
+ swidget->widget->name,
+ pipeline->frames_per_sched);
+ }
+
dev_dbg(sdev->dev, "pipeline %s: period %d pri %d mips %d core %d frames %d\n",
swidget->widget->name, pipeline->period, pipeline->priority,
pipeline->period_mips, pipeline->core, pipeline->frames_per_sched); This diff fixes the problem, but to me that's a botched ABI change. if frame_per_sched is no longer necessary, it needs to be removed from the IPC definitions. |
@ranj063 we could fix this by putting a default value back. If only I could figure out what the M4 syntax should be, it's just painful to figure out how to divide one parameter by another... diff --git a/tools/topology/m4/pipeline.m4 b/tools/topology/m4/pipeline.m4
index 37c5ca8d..82192fd2 100644
--- a/tools/topology/m4/pipeline.m4
+++ b/tools/topology/m4/pipeline.m4
@@ -20,7 +20,7 @@ define(`W_PIPELINE',
` SOF_TKN_SCHED_PERIOD' STR($2)
` SOF_TKN_SCHED_PRIORITY' STR($3)
` SOF_TKN_SCHED_CORE' STR($4)
-` SOF_TKN_SCHED_FRAMES' "0"
+` SOF_TKN_SCHED_FRAMES' STR(48)
` SOF_TKN_SCHED_TIME_DOMAIN' STR($5)
` }'
`}' works, but I'd need to do something like: ` SOF_TKN_SCHED_FRAMES' STR(`eval(`$5 / $2')') I just can't figure out how m4 is supposed to work. We should have done the topologies in lisp, at least it would have been self-explanatory. |
@plbossart what you need is :
But the problem is that $5 is empty in some cases, in which case the above expression will evaluate to "". |
well it's even worse than I thought: |
@ranj063 the commit you provided is actually quite big change, it changes sequence for all other drivers where using SND_SOC_DPCM_TRIGGER_PRE or SND_SOC_DPCM_TRIGGER_POST, we had another alternate solution when Zhigang and me worked on GPMRB which create a new type for this mirrored sequence. |
so are our topologies meant to be backwards compatible with old firmware? |
1.3 based topology should be here: |
I think it's a corner case. |
@plbossart I tried to rewind back to my commit f9ec396 and there I see TIME_DOMAIN getting value "" (empty) or "1".... so not sure where this samplerate is getting to this value, has to be some later commit. |
That why Linus invented "git blame" |
@plbossart yes I can only blame myself, so it really is my topology commit 77b6db8, that introduces this samplerate -> time_domain. An it is only in the intel generic dmic DAI_ADD, which is obviously erroneous, it should not have samplerates at all. I wonder is it used anywhere at all, because nothing has been reported about this, or we are just not then testing dmic paths at all. |
When the PCM_PARAM IPC fails, the kernel oopses in the HDaudio link DMA .free operation. The root cause is a NULL dma_data. This patches makes sure the dma_data is properly save in hw_params, even if there are additional errors and tested in hw_free. Opens: 1. the entire flow with hw_params used on system resume looks like a hack. 2. it's not clear why the problem actually happens on hw_free, maybe that's because of the -EBUSY call? GitHub issue: thesofproject#1417 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
When the PCM_PARAM IPC fails, the kernel oopses in the HDaudio link DMA .free operation. The root cause is a NULL dma_data. This patches makes sure the dma_data is properly save in hw_params, even if there are additional errors and tested in hw_free. Opens: 1. the entire flow with hw_params used on system resume looks like a hack. 2. it's not clear why the problem actually happens on hw_free, maybe that's because of the -EBUSY call? Trace with this patch: 14.509636] sof-audio-pci 0000:00:1f.3: pcm: open stream 0 dir 1 [ 14.509643] sof-audio-pci 0000:00:1f.3: period min 192 max 16384 bytes [ 14.509646] sof-audio-pci 0000:00:1f.3: period count 2 max 16 [ 14.509648] sof-audio-pci 0000:00:1f.3: buffer max 65536 bytes [ 14.510003] sof-audio-pci 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG [ 14.510114] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG [ 14.510135] sof-audio-pci 0000:00:1f.3: format_val=49, rate=48000, ch=2, format=10 [ 14.510144] sof-audio-pci 0000:00:1f.3: pcm: hw params stream 0 dir 1 [ 14.510149] sof-audio-pci 0000:00:1f.3: generating page table for 00000000ce69792e size 0x4b00 pages 5 [ 14.510157] sof-audio-pci 0000:00:1f.3: FW Poll Status: reg=0x40000 successful [ 14.510175] sof-audio-pci 0000:00:1f.3: FW Poll Status: reg=0x40000 successful [ 14.510179] sof-audio-pci 0000:00:1f.3: period_bytes:0x12c0 [ 14.510182] sof-audio-pci 0000:00:1f.3: periods:4 [ 14.510197] sof-audio-pci 0000:00:1f.3: stream_tag 2 [ 14.510209] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS [ 14.510513] sof-audio-pci 0000:00:1f.3: error: ipc error for 0x60010000 size 20 [ 14.510520] sof-audio-pci 0000:00:1f.3: error: hw params ipc failed for stream 2 [ 14.510525] sof-audio-pci 0000:00:1f.3: ASoC: 0000:00:1f.3 hw params failed: -22 [ 14.510530] HDA Analog: ASoC: hw_params FE failed -22 [ 14.510553] sof-audio-pci 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG [ 14.510668] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG [ 14.510677] sof-audio-pci 0000:00:1f.3: pcm: free stream 0 dir 1 [ 14.510690] sof-audio-pci 0000:00:1f.3: hda_link_hw_free: link_dev is not assigned [ 14.510821] sof-audio-pc GitHub issue: thesofproject#1417 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
PR #1541 removes the kernel oops (the flow is still quite questionable) but we'd still need to provide a means to restore compatibility |
When the PCM_PARAM IPC fails, the kernel oopses in the HDaudio link DMA .free operation. The root cause is a NULL dma_data. This patches makes sure the dma_data is properly save in hw_params, even if there are additional errors and tested in hw_free. Opens: 1. the entire flow with hw_params used on system resume looks like a hack. 2. it's not clear why the problem actually happens on hw_free, maybe that's because of the -EBUSY call? Trace with this patch: 14.509636] sof-audio-pci 0000:00:1f.3: pcm: open stream 0 dir 1 [ 14.509643] sof-audio-pci 0000:00:1f.3: period min 192 max 16384 bytes [ 14.509646] sof-audio-pci 0000:00:1f.3: period count 2 max 16 [ 14.509648] sof-audio-pci 0000:00:1f.3: buffer max 65536 bytes [ 14.510003] sof-audio-pci 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG [ 14.510114] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG [ 14.510135] sof-audio-pci 0000:00:1f.3: format_val=49, rate=48000, ch=2, format=10 [ 14.510144] sof-audio-pci 0000:00:1f.3: pcm: hw params stream 0 dir 1 [ 14.510149] sof-audio-pci 0000:00:1f.3: generating page table for 00000000ce69792e size 0x4b00 pages 5 [ 14.510157] sof-audio-pci 0000:00:1f.3: FW Poll Status: reg=0x40000 successful [ 14.510175] sof-audio-pci 0000:00:1f.3: FW Poll Status: reg=0x40000 successful [ 14.510179] sof-audio-pci 0000:00:1f.3: period_bytes:0x12c0 [ 14.510182] sof-audio-pci 0000:00:1f.3: periods:4 [ 14.510197] sof-audio-pci 0000:00:1f.3: stream_tag 2 [ 14.510209] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS [ 14.510513] sof-audio-pci 0000:00:1f.3: error: ipc error for 0x60010000 size 20 [ 14.510520] sof-audio-pci 0000:00:1f.3: error: hw params ipc failed for stream 2 [ 14.510525] sof-audio-pci 0000:00:1f.3: ASoC: 0000:00:1f.3 hw params failed: -22 [ 14.510530] HDA Analog: ASoC: hw_params FE failed -22 [ 14.510553] sof-audio-pci 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG [ 14.510668] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG [ 14.510677] sof-audio-pci 0000:00:1f.3: pcm: free stream 0 dir 1 [ 14.510690] sof-audio-pci 0000:00:1f.3: hda_link_hw_free: link_dev is not assigned [ 14.510821] sof-audio-pc GitHub issue: #1417 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
When the PCM_PARAM IPC fails while configuring the FE, the kernel oopses in the HDaudio link DMA .hw_free operation. The root cause is a NULL dma_data since the BE .hw_params was never called by the SOC core. This error can also happen if the HDaudio link DMA configuration IPC fails in the BE .hw_params. This patches makes sure the dma_data is properly saved in .hw_params, and tested before being use in hw_free. GitHub issue: thesofproject#1417 Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
When the PCM_PARAM IPC fails while configuring the FE, the kernel oopses in the HDaudio link DMA .hw_free operation. The root cause is a NULL dma_data since the BE .hw_params was never called by the SOC core. This error can also happen if the HDaudio link DMA configuration IPC fails in the BE .hw_params. This patches makes sure the dma_data is properly saved in .hw_params, and tested before being use in hw_free. GitHub issue: thesofproject#1417 Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191218000518.5830-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
When the PCM_PARAM IPC fails while configuring the FE, the kernel oopses in the HDaudio link DMA .hw_free operation. The root cause is a NULL dma_data since the BE .hw_params was never called by the SOC core. This error can also happen if the HDaudio link DMA configuration IPC fails in the BE .hw_params. This patches makes sure the dma_data is properly saved in .hw_params, and tested before being use in hw_free. GitHub issue: thesofproject#1417 Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191218000518.5830-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
closing, oops is not longer occurring and the ABI issue is 6+ months old now, need to move on |
[ Upstream commit 921162c ] When the PCM_PARAM IPC fails while configuring the FE, the kernel oopses in the HDaudio link DMA .hw_free operation. The root cause is a NULL dma_data since the BE .hw_params was never called by the SOC core. This error can also happen if the HDaudio link DMA configuration IPC fails in the BE .hw_params. This patches makes sure the dma_data is properly saved in .hw_params, and tested before being use in hw_free. GitHub issue: thesofproject/linux#1417 Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191218000518.5830-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
BugLink: https://bugs.launchpad.net/bugs/1866403 [ Upstream commit 921162c ] When the PCM_PARAM IPC fails while configuring the FE, the kernel oopses in the HDaudio link DMA .hw_free operation. The root cause is a NULL dma_data since the BE .hw_params was never called by the SOC core. This error can also happen if the HDaudio link DMA configuration IPC fails in the BE .hw_params. This patches makes sure the dma_data is properly saved in .hw_params, and tested before being use in hw_free. GitHub issue: thesofproject#1417 Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191218000518.5830-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
BugLink: https://bugs.launchpad.net/bugs/1866403 [ Upstream commit 921162c ] When the PCM_PARAM IPC fails while configuring the FE, the kernel oopses in the HDaudio link DMA .hw_free operation. The root cause is a NULL dma_data since the BE .hw_params was never called by the SOC core. This error can also happen if the HDaudio link DMA configuration IPC fails in the BE .hw_params. This patches makes sure the dma_data is properly saved in .hw_params, and tested before being use in hw_free. GitHub issue: thesofproject#1417 Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191218000518.5830-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
With this configuration, I get an IPC error followed by a kernel oops at the hw_params stage
kernel: c265f25
firmware: https://github.com/thesofproject/sof/releases/download/v1.3/sof-cnl-signed-intel.ri
topology: 2ca6a4a ( sof-hda-generic-4ch.tplg)
I don't have the sof-cnl.ldc for that firmware so can't provide traces
dmesg attached:
dmesg.log
errors
@ranj063 @kv2019i @juimonen does anyone have an HDaudio+DMIC platform who could try and reproduce this?
Wondering if this is a regression with the new kernel, or a compatibility issue with the 1.3 firmware?
@tlauda @jajanusz does anyone have the sof-cnl.ldc file for this signed firmware?
The text was updated successfully, but these errors were encountered: