Skip to content

Commit eb3bb14

Browse files
musamaanjumbroonie
authored andcommitted
ASoC: SOF: amd: acp-loader: Use GFP_KERNEL for DMA allocations in resume context
Replace GFP_ATOMIC with GFP_KERNEL for dma_alloc_coherent() calls. This change improves memory allocation reliability during firmware loading, particularly during system resume when memory pressure is high. Because of using GFP_KERNEL, reclaim can happen which can reduce the probability of failure. Fixes memory allocation failures observed during system resume with fragmented memory conditions. snd_sof_amd_vangogh 0000:04:00.5: error: failed to load DSP firmware after resume -12 Fixes: 145d7e5 ("ASoC: SOF: amd: add option to use sram for data bin loading") Fixes: 7e51a9e ("ASoC: SOF: amd: Add fw loader and renoir dsp ops to load firmware") Cc: [email protected] Signed-off-by: Muhammad Usama Anjum <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e95122a commit eb3bb14

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/soc/sof/amd/acp-loader.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ int acp_dsp_block_write(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_t
6565
dma_size = page_count * ACP_PAGE_SIZE;
6666
adata->bin_buf = dma_alloc_coherent(&pci->dev, dma_size,
6767
&adata->sha_dma_addr,
68-
GFP_ATOMIC);
68+
GFP_KERNEL);
6969
if (!adata->bin_buf)
7070
return -ENOMEM;
7171
}
@@ -77,7 +77,7 @@ int acp_dsp_block_write(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_t
7777
adata->data_buf = dma_alloc_coherent(&pci->dev,
7878
ACP_DEFAULT_DRAM_LENGTH,
7979
&adata->dma_addr,
80-
GFP_ATOMIC);
80+
GFP_KERNEL);
8181
if (!adata->data_buf)
8282
return -ENOMEM;
8383
}
@@ -90,7 +90,7 @@ int acp_dsp_block_write(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_t
9090
adata->sram_data_buf = dma_alloc_coherent(&pci->dev,
9191
ACP_DEFAULT_SRAM_LENGTH,
9292
&adata->sram_dma_addr,
93-
GFP_ATOMIC);
93+
GFP_KERNEL);
9494
if (!adata->sram_data_buf)
9595
return -ENOMEM;
9696
}

0 commit comments

Comments
 (0)