Hi Alan,
 
Please see my following points:
 
 Suppose when device is idle, it says to run time power management framework i am idle
and run time power management asks the device's bus (if bus is being used), and
probably the case is if the device does not want to get suspended because of the starting
of the activities immediately , it will return the error to platform bus and platform bus returns this error
to run time power management framework and run time power management will make
the device status active. In the code of
 
int  __pm_runtime_suspend(arguments...)
{

 
  if (retval) {
                dev->power.runtime_status = RPM_ACTIVE;
                pm_runtime_cancel_pending(dev);
                if (retval == -EAGAIN || retval == -EBUSY) {
                        notify = true;
                        dev->power.runtime_error = 0;
                }
        } else {

 
}
 
So if the retval is -EAGAIN and -EBUSY,  so it means it will again try to make it idle but if the device is
already doing activities , since it is started doing activities then in that case is this error code
ECANCELED is appropriate?
 
Regards
Raj
 
 
 
 
 
 
> Date: Fri, 23 Jul 2010 10:26:07 -0400
> From: stern@rowland.harvard.edu
> To: rajkumar278@hotmail.com
> CC: linux-pm@lists.linux-foundation.org
> Subject: Re: [linux-pm] Questions about run time power management
>
> On Fri, 23 Jul 2010, Raj Kumar wrote:
>
> > Hi,
> >
> >
> > I am implementing the run time power management in my drivers. So i have the following
> > questions:
> >
> >
> > 1) I am using the work queue approach for run time power management, Now the thing is
> > when the device is idle and it notifies the run time power management via helper function
> > pm_request_idle, and at the same time if resume is done then in that case does the runtime power management
> > cancels the idle and does not invoke any callback like runtime_suspend of driver?
>
> How can a resume occur while the device is idle? Idle means that the
> device isn't suspended -- it's at full power but not doing anything.
> Hence a resume cannot occur at the same time.
>
> > 2) like as mentioned in run time power management document, when the usage_count of device
> > reaches zero, is there any run time power management thread in background that will immediately suspends
> > the device or it is again via helper functions. It seems from the code that usage_count is zero and suspended
> > via helper functions. Is it correct?
>
> All suspends occur via the helper functions, whether a background
> thread is involved or not.
>
> > 3) The third question is more specific about platform bus usage? can the char device driver use platform bus?
> > can char device register as platform device?
>
> Yes. Devices can be registered on any bus.
>
> Alan Stern
>