Skip to content

Commit fa4a9db

Browse files
tmlemankartben
authored andcommitted
dma: intel_adsp_hda: Fix invalid init sequence and register use
This patch addresses the issue of invalid initialization sequence and the use of registers in `dma_config` before the device is fully initialized in the Intel ADSP HDA DMA driver. Changes include: 1. Moving the `intel_adsp_hda_channels_init` call to the `intel_adsp_hda_dma_init` function to ensure that channels are initialized during device initialization. 2. Removing the redundant call to `intel_adsp_hda_channels_init` from the `PM_DEVICE_ACTION_RESUME` case in the `intel_adsp_hda_dma_pm_action` function. These changes ensure that the device and its channels are properly initialized before any DMA configuration is performed, preventing access to hardware registers before the device is ready. **Note:** This is a proposed solution, and a different approach should be considered. Currently, we are accessing registers before the device and power domain are fully powered up. This solution likely works because the DMA is used to load firmware during the boot process, and the necessary power domains are already powered up. Further investigation and a more robust solution are recommended to ensure proper initialization and power management. Signed-off-by: Tomasz Leman <[email protected]>
1 parent 329675a commit fa4a9db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/dma/dma_intel_adsp_hda.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,9 @@ static void intel_adsp_hda_channels_init(const struct device *dev)
385385

386386
int intel_adsp_hda_dma_pm_action(const struct device *dev, enum pm_device_action action)
387387
{
388+
ARG_UNUSED(dev);
388389
switch (action) {
389390
case PM_DEVICE_ACTION_RESUME:
390-
intel_adsp_hda_channels_init(dev);
391-
break;
392391
case PM_DEVICE_ACTION_SUSPEND:
393392
case PM_DEVICE_ACTION_TURN_ON:
394393
case PM_DEVICE_ACTION_TURN_OFF:
@@ -408,6 +407,7 @@ int intel_adsp_hda_dma_init(const struct device *dev)
408407
data->ctx.dma_channels = cfg->dma_channels;
409408
data->ctx.atomic = data->channels_atomic;
410409
data->ctx.magic = DMA_MAGIC;
410+
intel_adsp_hda_channels_init(dev);
411411
return pm_device_driver_init(dev, intel_adsp_hda_dma_pm_action);
412412
}
413413

0 commit comments

Comments
 (0)