Skip to content

Commit 5a184f1

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: Intel: catpt: Fix the device initialization
The DMA mask shall be coerced before any buffer allocations for the device are done. At the same time explain why DMA mask of 31 bits is used in the first place. Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Fixes: 7a10b66 ("ASoC: Intel: catpt: Device driver lifecycle") Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20260320101217.1243688-1-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2594196 commit 5a184f1

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

sound/soc/intel/catpt/device.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,15 @@ static int catpt_acpi_probe(struct platform_device *pdev)
281281
if (IS_ERR(cdev->pci_ba))
282282
return PTR_ERR(cdev->pci_ba);
283283

284-
/* alloc buffer for storing DRAM context during dx transitions */
284+
/*
285+
* As per design HOST is responsible for preserving firmware's runtime
286+
* context during D0 -> D3 -> D0 transitions. Addresses used for DMA
287+
* to/from HOST memory shall be outside the reserved range of 0xFFFxxxxx.
288+
*/
289+
ret = dma_coerce_mask_and_coherent(cdev->dev, DMA_BIT_MASK(31));
290+
if (ret)
291+
return ret;
292+
285293
cdev->dxbuf_vaddr = dmam_alloc_coherent(dev, catpt_dram_size(cdev),
286294
&cdev->dxbuf_paddr, GFP_KERNEL);
287295
if (!cdev->dxbuf_vaddr)

sound/soc/intel/catpt/dsp.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ int catpt_dmac_probe(struct catpt_dev *cdev)
125125
dmac->dev = cdev->dev;
126126
dmac->irq = cdev->irq;
127127

128-
ret = dma_coerce_mask_and_coherent(cdev->dev, DMA_BIT_MASK(31));
129-
if (ret)
130-
return ret;
131128
/*
132129
* Caller is responsible for putting device in D0 to allow
133130
* for I/O and memory access before probing DW.

0 commit comments

Comments
 (0)