[alsa-devel] OMAP-McBSP driver not allowing suspend/resume
Hi,
I am trying to put OMAP3 in suspend state, while audio is playing, by issuing:
echo mem > /sys/power/state
root@omap3evm:~# echo mem > /sys/power/state PM: Syncing filesystems ... done. Freezing user space processes ... (elapsed 0.00 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done. Suspending console(s) (use no_console_suspend to debug) Powerdomain (core_pwrdm) didn't enter target state 1 Powerdomain (per_pwrdm) didn't enter target state 1 Could not enter target state in pm_suspend Restarting tasks ... Suspended. Trying resume. done. Done. root@omap3evm:~#
As can be seen from the log, both the CORE and PER power domains are not going to the suspend state.
On further debug, I found that McBSP 2 instance belongs to the PER domain whereas SDMA belongs to CORE domain. And at least McBSP driver (on l-o tip) doesn't allow disabling of the clocks unless McBSP instance itself is freed. Because of this, when McBSP is stopped after receiving the suspend request, the clocks are still ON and the PER domain is not allowed to enter to the desired low-power state.
The McBSP driver needs to be modified so that it can accommodate suspend/resume requests and turns off the clocks when not required. Has anyone modified the driver for this, on some other branch? I tried finding it but could not do so. (Just wanted to make sure before doing the changes)
Regards, Anuj Aggarwal
As can be seen from the log, both the CORE and PER power domains are not going to the suspend state.
On further debug, I found that McBSP 2 instance belongs to the PER domain whereas SDMA belongs to CORE domain. And at least McBSP driver (on l-o tip) doesn't allow disabling of the clocks unless McBSP instance itself is freed. Because of this, when McBSP is stopped after receiving the suspend request, the clocks are still ON and the PER domain is not allowed to enter to the desired low-power state.
Yes, the McBSP clocks are enabled when the PCM substream is opened and released only when the pcm substream is closed. There are no .suspend/.resume callbacks in the mcbsp driver today. You need to save context of McBSP and disable clocks on suspend and enable clocks and restore context on resume.
-----Original Message----- From: Dasgupta, Romit Sent: Friday, November 06, 2009 7:22 PM To: Aggarwal, Anuj; linux-omap@vger.kernel.org; alsa-devel@alsa- project.org Subject: RE: OMAP-McBSP driver not allowing suspend/resume
As can be seen from the log, both the CORE and PER power domains are not going to the suspend state.
On further debug, I found that McBSP 2 instance belongs to the PER domain whereas SDMA belongs to CORE domain. And at least McBSP driver (on l-o tip) doesn't allow disabling of the clocks unless McBSP instance itself is freed. Because of this, when McBSP is stopped after receiving the suspend request, the clocks are still ON and the PER domain is not allowed to enter to the desired low-power state.
Yes, the McBSP clocks are enabled when the PCM substream is opened and released only when the pcm substream is closed. There are no .suspend/.resume callbacks in the mcbsp driver today. You need to save context of McBSP and disable clocks on suspend and enable clocks and restore context on resume.
Ok, I got that. And I think the same needs to be done for sdma as well. I can see omap_dma_global_context_save/ omap_dma_global_context_restore being called from omap3_core_save_context/omap3_core_restore_context which is saving the global sdma configuration registers. But I think sdma channel specific registers need to be saved too for the active channels.
Hi Anuj,
I made some changes to fix the suspend/resume issue, and I am about to submit to alsa-devel mailing list.
Regards,
-Jane Wang
-----Original Message----- From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel-bounces@alsa-project.org] On Behalf Of Aggarwal, Anuj Sent: Friday, November 06, 2009 7:43 AM To: linux-omap@vger.kernel.org; alsa-devel@alsa-project.org Subject: [alsa-devel] OMAP-McBSP driver not allowing suspend/resume
Hi,
I am trying to put OMAP3 in suspend state, while audio is playing, by issuing:
echo mem > /sys/power/state
root@omap3evm:~# echo mem > /sys/power/state PM: Syncing filesystems ... done. Freezing user space processes ... (elapsed 0.00 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done. Suspending console(s) (use no_console_suspend to debug) Powerdomain (core_pwrdm) didn't enter target state 1 Powerdomain (per_pwrdm) didn't enter target state 1 Could not enter target state in pm_suspend Restarting tasks ... Suspended. Trying resume. done. Done. root@omap3evm:~#
As can be seen from the log, both the CORE and PER power domains are not going to the suspend state.
On further debug, I found that McBSP 2 instance belongs to the PER domain whereas SDMA belongs to CORE domain. And at least McBSP driver (on l-o tip) doesn't allow disabling of the clocks unless McBSP instance itself is freed. Because of this, when McBSP is stopped after receiving the suspend request, the clocks are still ON and the PER domain is not allowed to enter to the desired low-power state.
The McBSP driver needs to be modified so that it can accommodate suspend/resume requests and turns off the clocks when not required. Has anyone modified the driver for this, on some other branch? I tried finding it but could not do so. (Just wanted to make sure before doing the changes)
Regards, Anuj Aggarwal
_______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
participants (3)
-
Aggarwal, Anuj
-
Dasgupta, Romit
-
Wang, Jane