RE: Need help : Way to disable runtime PM with system suspend enabled
flat view
From: Sumit Singh <hidden>
Date: 2016-06-10 09:54:16
Thanks Rafael for the suggestion. I will try with that. Using pm_runtime_forbid() API, we can do that. Could you please suggest a proper location for using this API, so that it is applicable to all the devices? Thanks Sumit Singh -----Original Message----- From: rjwysocki@gmail.com [mailto:rjwysocki@gmail.com] On Behalf Of Rafael J. Wysocki Sent: Thursday, June 09, 2016 6:17 PM To: Sumit Singh Cc: rjw@rjwysocki.net; linux-pm@vger.kernel.org; Prashant Gaikwad; Bharat Nihalani Subject: Re: Need help : Way to disable runtime PM with system suspend enabled On Thu, Jun 9, 2016 at 9:23 AM, Sumit Singh [off-list ref] wrote:
Hi Rafael,
Hi,
I have a requirement related to runtime PM and system suspend, and need your help for it. Below is the requirement, and the approach I followed: I want to disable runtime-PM for all the devices, but want to keep system suspend enabled. More precisely, I don't want devices to runtime suspend or even clock-gated when device is idle. I want them always to be in full power state. Currently, devices are using runtime PM to get powered at boot time. I have a requirement where power supply is not a constraint, but system's responsiveness is of critical importance. With runtime-PM enabled, it will incur some delay for the device to come out of runtime suspend state whenever a request comes for it. I want to avoid that delay. This is the reason I want to disable runtime PM. System suspend should be working fine. As upstream has closely integrated runtime PM and system suspend, and also got rid of CONFIG_PM_RUNTIME, so now it is not possible to just disable CONFIG_PM_RUNTIME to disable runtime PM. I tried below two approaches to meet the requirement: 1.) The devices that use PM Domains, I set governor as always-on governor, so that devices won't runtime suspend. But, it does not prevent devices from clock-gating. This approach is applicable only for the devices which use PM Domains. 2.) The devices that don't use PM Domains, I tried making changes in individual drivers. For each device, in the probe function, once device is powered-on, I disable runtime PM using runtime PM APIs, so that device won't entertain any runtime requests. This way device will be always on. - With first approach, devices did not runtime suspend, but were clock-gated. This approach is not applicable to the devices, which don't use PM Domain. System suspend is working fine. - With second approach, devices were not runtime suspended, and were always powered-on. But I had to make changes in each of the driver files. As each of the devices are using runtime PM in different ways, so it was not possible to create a common API which will suit all the devices. Could you please help me with a cleaner way so that devices don't runtime-suspend (not even clock-gate), and system suspend should be working?
Well, each device has the "control" attribute in sysfs that can be used to make the device stay in the active metastate all the time. Why don't you use it? Thanks, Rafael ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------