Re: [PATCH] apds9802als: add runtime PM support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 27 Oct 2010, Hong Liu wrote:

> In apds9802als_resume, I just want to power up the device, do some
> configuration, and then runtime_suspend the device.

Then you should change the function the way I suggested.  The PM core
will automatically do a runtime suspend after the system has fully
woken up.

> We don't have runtime_idle() implemented, the driver exported sysfs
> entries to user space for data reading, and we do runtime_resume,
> measaure data, runtime_suspend in the read/write funciton of those sysfs
> entries. This is why I want to put the device into runtime suspend
> manually whenever possible.

Your approach will not work.  You _must_ define runtime_idle() if you 
want your driver to suspend correctly.  It doesn't have to be 
complicated; just make it call pm_runtime_suspend().

...

> We don't have runtime_idle() implemented, so I have to manually put the
> device into runtime suspend.

The problem is that the device can be runtime-resumed by code other 
than your own, and that other code will not always do a runtime-suspend 
afterward -- it will do a runtime-idle.  That's why you need to define 
a runtime_idle() callback.

Alan Stern

_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux