Skip to content

Conversation

fimohame
Copy link
Contributor

This commit enables the pm device driver support for the dma_silabs_siwx91x driver.

@fimohame fimohame force-pushed the device_pm_silabs_siwx91x_dma branch 5 times, most recently from c73b89c to 620f008 Compare August 12, 2025 09:28
@fimohame fimohame marked this pull request as ready for review August 12, 2025 09:33
@zephyrbot zephyrbot added platform: Silabs Silicon Labs area: DMA Direct Memory Access labels Aug 12, 2025
@fimohame fimohame force-pushed the device_pm_silabs_siwx91x_dma branch from 620f008 to e603e6d Compare August 12, 2025 10:31
@fimohame fimohame force-pushed the device_pm_silabs_siwx91x_dma branch 3 times, most recently from 0a0e6e1 to 0ac614f Compare August 19, 2025 06:34
Copy link

@Martinhoff-maker
Copy link
Contributor

Martinhoff-maker commented Sep 5, 2025

As discussed, since we agree to use CONFIG_PM_DEVICE=y and having in mind that going to sleep will completely turn off the device without any register retention on siwx917 board.

return -EBUSY;
}
} else if (IS_ENABLED(CONFIG_PM_DEVICE) && (action == PM_DEVICE_ACTION_SUSPEND)) {
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained here: #94695 (comment)
You also need to turn off clocks as I understand for the future with pm device runtime mode. (Because you can suspend the device without sleeping)

Copy link
Contributor Author

@fimohame fimohame Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

}
if (action == PM_DEVICE_ACTION_RESUME) {
ret = clock_control_on(cfg->clock_dev, cfg->clock_subsys);
if (ret) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clock_control_on() may return -EALREADY which is not really an error (I know... this API is annoying).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

return -EINVAL;
}
udma_handle = UDMAx_Initialize(&udma_resources, udma_resources.desc, NULL,
(uint32_t *)&data->udma_handle);
Copy link
Contributor

@jerome-pouiller jerome-pouiller Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think UDMAx_Initialize() should be called on PM_DEVICE_ACTION_RESUME or on PM_DEVICE_ACTION_TURN_ON?

I believe Device runtime PM will only play with PM_DEVICE_ACTION_SUSPEND. PM_DEVICE_ACTION_SUSPEND may stop the clocks and the regulator but I believe it will retains the registers.

I assume System Managed PM (or power domains) won't retains the registers but it will call PM_DEVICE_ACTION_TURN_OFF and PM_DEVICE_ACTION_TURN_ON. So, UDMAx_Initialize() should be only done in PM_DEVICE_ACTION_TURN_ON.

@Martinhoff-maker, @asmellby, can you confirm my understanding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

@fimohame fimohame marked this pull request as draft September 24, 2025 06:50
@fimohame fimohame force-pushed the device_pm_silabs_siwx91x_dma branch from 0ac614f to cc83786 Compare September 24, 2025 20:29
@fimohame fimohame force-pushed the device_pm_silabs_siwx91x_dma branch 2 times, most recently from 2701c32 to 569979a Compare September 24, 2025 20:42
@fimohame fimohame marked this pull request as ready for review September 25, 2025 07:23
This commit enables the pm device driver support
for the dma_silabs_siwx91x driver.

Signed-off-by: S Mohamed Fiaz <[email protected]>
@fimohame fimohame force-pushed the device_pm_silabs_siwx91x_dma branch from 569979a to 845009c Compare September 25, 2025 09:22
Copy link

case PM_DEVICE_ACTION_SUSPEND:
break;
case PM_DEVICE_ACTION_TURN_ON:
ret = clock_control_on(cfg->clock_dev, cfg->clock_subsys);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to turn this clock in PM_DEVICE_ACTION_TURN_ON, or this can be done later in PM_DEVICE_ACTION_RESUME?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was discussed to place it here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DMA Direct Memory Access platform: Silabs Silicon Labs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants