[alsa-devel] [PATCH 1/2] ASoC: Intel: Fix Baytrail SST DSP firmware loading
Commit 10df350977b1 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") caused following regression in Baytrail SST:
baytrail-pcm-audio baytrail-pcm-audio: error: DMA alloc failed baytrail-pcm-audio baytrail-pcm-audio: error: failed to load firmware
Fix this by calling dma_coerce_mask_and_coherent() in sst_byt_init() with the same dma_dev device what is now used in sst_fw_new() when allocating the DMA buffer.
Signed-off-by: Jarkko Nikula jarkko.nikula@linux.intel.com --- sound/soc/intel/sst-baytrail-dsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/sst-baytrail-dsp.c b/sound/soc/intel/sst-baytrail-dsp.c index 4a5d489e520b..fc588764ffa3 100644 --- a/sound/soc/intel/sst-baytrail-dsp.c +++ b/sound/soc/intel/sst-baytrail-dsp.c @@ -324,7 +324,7 @@ static int sst_byt_init(struct sst_dsp *sst, struct sst_pdata *pdata) return ret; }
- ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); + ret = dma_coerce_mask_and_coherent(sst->dma_dev, DMA_BIT_MASK(32)); if (ret) return ret;
This follows the same idea than commit 10df350977b1 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") by using only ACPI device for all DMA allocations. Since DMA masking is already done in firmware loading it can be removed from here.
Signed-off-by: Jarkko Nikula jarkko.nikula@linux.intel.com --- sound/soc/intel/sst-baytrail-pcm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/sound/soc/intel/sst-baytrail-pcm.c b/sound/soc/intel/sst-baytrail-pcm.c index 00a2118d20f5..0afb3491f5f0 100644 --- a/sound/soc/intel/sst-baytrail-pcm.c +++ b/sound/soc/intel/sst-baytrail-pcm.c @@ -319,18 +319,16 @@ static int sst_byt_pcm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_pcm *pcm = rtd->pcm; size_t size; + struct snd_soc_platform *platform = rtd->platform; + struct sst_pdata *pdata = dev_get_platdata(platform->dev); int ret = 0;
- ret = dma_coerce_mask_and_coherent(rtd->card->dev, DMA_BIT_MASK(32)); - if (ret) - return ret; - if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream || pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { size = sst_byt_pcm_hardware.buffer_bytes_max; ret = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, - rtd->card->dev, + pdata->dma_dev, size, size); if (ret) { dev_err(rtd->dev, "dma buffer allocation failed %d\n",
On Fri, May 09, 2014 at 04:47:44PM +0300, Jarkko Nikula wrote:
This follows the same idea than commit 10df350977b1 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") by using only ACPI device for all DMA allocations. Since DMA masking is already done in firmware loading it can be removed from here.
Is this needed as a bug fix?
On 05/13/2014 01:10 AM, Mark Brown wrote:
On Fri, May 09, 2014 at 04:47:44PM +0300, Jarkko Nikula wrote:
This follows the same idea than commit 10df350977b1 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") by using only ACPI device for all DMA allocations. Since DMA masking is already done in firmware loading it can be removed from here.
Is this needed as a bug fix?
Not really. AFAIK this IOMMU issues doesn't hit on Baytrail so this 2/2 is more like keeping code in sync.
On Fri, May 09, 2014 at 04:47:44PM +0300, Jarkko Nikula wrote:
This follows the same idea than commit 10df350977b1 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") by using only ACPI device for all DMA allocations. Since DMA masking is already done in firmware loading it can be removed from here.
Applied, thanks.
On Fri, May 09, 2014 at 04:47:43PM +0300, Jarkko Nikula wrote:
Commit 10df350977b1 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") caused following regression in Baytrail SST:
baytrail-pcm-audio baytrail-pcm-audio: error: DMA alloc failed baytrail-pcm-audio baytrail-pcm-audio: error: failed to load firmware
Is this needed on fix/intel? If so it doesn't apply there...
On 05/13/2014 01:09 AM, Mark Brown wrote:
On Fri, May 09, 2014 at 04:47:43PM +0300, Jarkko Nikula wrote:
Commit 10df350977b1 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") caused following regression in Baytrail SST:
baytrail-pcm-audio baytrail-pcm-audio: error: DMA alloc failed baytrail-pcm-audio baytrail-pcm-audio: error: failed to load firmware
Is this needed on fix/intel? If so it doesn't apply there...
Indeed it doesn't. I accidentally made it on top of my suspend/resume set and it appears to conflict without [PATCH 4/7] ASoC: Intel: Move Baytrail extended fw address saving to sst_byt_boot()".
In case you are thinking to queue Liam's 10df350977b1 as a fix Is it ok if I resend this on top of it and handle conflict when merging origin/topic/intel?
On Tue, May 13, 2014 at 10:22:08AM +0300, Jarkko Nikula wrote:
In case you are thinking to queue Liam's 10df350977b1 as a fix Is it ok if I resend this on top of it and handle conflict when merging origin/topic/intel?
Yes, it's on my fix/intel branch - please send a fix based off that.
Commit 10df350977b1 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") caused following regression in Baytrail SST:
baytrail-pcm-audio baytrail-pcm-audio: error: DMA alloc failed baytrail-pcm-audio baytrail-pcm-audio: error: failed to load firmware
Fix this by calling dma_coerce_mask_and_coherent() in sst_byt_init() with the same dma_dev device what is now used in sst_fw_new() when allocating the DMA buffer.
Signed-off-by: Jarkko Nikula jarkko.nikula@linux.intel.com --- For fix/intel branch. --- sound/soc/intel/sst-baytrail-dsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/sst-baytrail-dsp.c b/sound/soc/intel/sst-baytrail-dsp.c index a50bf7fc0e3a..adf0aca5aca6 100644 --- a/sound/soc/intel/sst-baytrail-dsp.c +++ b/sound/soc/intel/sst-baytrail-dsp.c @@ -324,7 +324,7 @@ static int sst_byt_init(struct sst_dsp *sst, struct sst_pdata *pdata) memcpy_toio(sst->addr.lpe + SST_BYT_MAILBOX_OFFSET, &pdata->fw_base, sizeof(u32));
- ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); + ret = dma_coerce_mask_and_coherent(sst->dma_dev, DMA_BIT_MASK(32)); if (ret) return ret;
On Tue, May 13, 2014 at 03:46:06PM +0300, Jarkko Nikula wrote:
Commit 10df350977b1 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") caused following regression in Baytrail SST:
Applied, thanks.
On Fri, May 09, 2014 at 04:47:43PM +0300, Jarkko Nikula wrote:
- ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
- ret = dma_coerce_mask_and_coherent(sst->dma_dev, DMA_BIT_MASK(32)); if (ret) return ret;
My resolution of the merge of your revised version and topic/intel looks like this so I *think* it's OK but please check that I did the right thing.
On 05/13/2014 08:26 PM, Mark Brown wrote:
On Fri, May 09, 2014 at 04:47:43PM +0300, Jarkko Nikula wrote:
- ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
- ret = dma_coerce_mask_and_coherent(sst->dma_dev, DMA_BIT_MASK(32)); if (ret) return ret;
My resolution of the merge of your revised version and topic/intel looks like this so I *think* it's OK but please check that I did the right thing.
Thanks, it's ok! And sorry the mess, I was somehow blind to see Liam's patch being 3.15 material. Hurry to weekend I guess.
participants (2)
-
Jarkko Nikula
-
Mark Brown