Hello,
Is suspend routine called automatically when the kernel moves to IDLE or is it only triggered by userspace explicit call ?
Thanks,
Ran
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Ran,
In power management perspective, we have 2 types of suspend mode, one is "suspend" and second on is "run time suspend" mode.
"run time suspend" mode function will call automatically when the device doesn't received any interrupts or simple it is IDLE.
"suspend" mode would initiated by the "/sys/power/state" SYSFS entry.
Hi Titus,
Thanks for the quick response.
I now see that the run time suspend is what described in Documentation\omap\runtime_pm.txt as:
int pm_generic_runtime_suspend(struct device *dev);
As to the use of /sys/devices/.../power/autosuspend_delay_ms attribute , is there alternative for sysfs ? We disabled sysfs in our kernel.
Thanks,
Ran
Hi Ran,
I don't think that it won't be any problem since it have default 'ms' delay, you need SYSFS support if you want to change from default.
Hi Titus,
Where can I find example or documentation to runtime suspend ?
The documentation in power\runtime_pm.txt is not relevant for OMAP PM, right ?
Can you point me to more information on runtime suspend/resume ?
Thanks!
Ran
Hi Ran,
The documentation in power\runtime_pm.txt is not relevant for OMAP PM, right ?
No, It is generic linux power management.
You can implement "runtime power management" for your linux driver through ".runtime_suspend" and ".runtime_resume" APIs.
You have to use ".pm" member in driver's fops to use runtime power management.
Refer any driver from linux.
drivers/usb/core/usb.c
Ex: USB
static const struct dev_pm_ops usb_device_pm_ops = { .prepare = usb_dev_prepare, .complete = usb_dev_complete, .suspend = usb_dev_suspend, .resume = usb_dev_resume, .freeze = usb_dev_freeze, .thaw = usb_dev_thaw, .poweroff = usb_dev_poweroff, .restore = usb_dev_restore, #ifdef CONFIG_USB_SUSPEND .runtime_suspend = usb_runtime_suspend, .runtime_resume = usb_runtime_resume, .runtime_idle = usb_runtime_idle, #endif }; struct device_type usb_device_type = { .name = "usb_device", .release = usb_release_dev, .uevent = usb_dev_uevent, .devnode = usb_devnode, #ifdef CONFIG_PM .pm = &usb_device_pm_ops, #endif };
Hi Ran,
Actually, what is your requirement ?
So that, I can suggest you to proceed with good method.
Hi Titus,
Thank you very much for the suggestion, It is most helpful.
My requirements are as following:
1. wakeup at any interrupt whatsoever such as: SW timers, gpio etc.
2. all suspend/resume are at runtime (automatic) as part of the standby mode. It also requires run time suspend of some character drivers such as dsp (using external dsp through character device)
3. there is no sysfs,debugfs in system so the initialization of the PM drivers should be done in other method. (There is probably no need for change afterwards anything, because the inetntion is that everything is automatic)
If there is also some code example of this issue for OMAP PM, such as more exact example of suspend runtime used in OMAP PM, it will be helpful.
Thank a lot,
Ran
Hi Ran,
if you want to proceed with runtime suspend/resume method then you must to use platform driver which supports runtime PM but not character device.
You must to put your PM code stuffs in runtime platform fops function, ie platform driver would hook the runtime power management code at runtime (device_put and device_get).
If any driver which supports ".pm" member on their fops structure (any platform driver : say ex MMC/USB etc.,) then that driver can be used '.suspend' and '.runtime_suspend' fns.
Please refer to the linux doc.
Documentation/power/runtime_pm.txt
Hi Titus,
Isn't Documentation/power/runtime_pm.txt relevant only for the generic PM and not for OMAP PM ?
Another thing, do you think It is a good method to create dummy platform driver for the suspend/resume, which communicates with another character device (for example external dsp) ?
Thanks,
Ran