Re: Do we need asynchronous pm_runtime_get()? (was: Re: bisected regression ...)

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

 



On Mon, 6 Aug 2012, Ming Lei wrote:

> Maybe the return value should be passed to caller. Also the race between
> 'func' and its .runtime_resume callback should be stated in comment.
> 
> In fact, maybe it is better to call 'func' always first, then call
> ' rpm_resume(dev, RPM_ASYNC);', otherwise the driver may
> be confused about the order between 'func' and its .runtime_resume
> callback.

> Another way is to define 'func' as 'runtime_pre_resume'
> in 'struct dev_pm_ops', and there are some advantages about this way:
> 
>         - save one pointer in 'struct devices, since most of devices
> don't need the 'func'
>         - well documents on 'runtime_pre_resume'
>         - caller of pm_runtime_get_and_call may be happier, maybe just
>         pm_runtime_get or *_aync is enough.

No, no, you have completely misunderstood the whole point of this 
change.

The idea is for "func" to be called at a time when it is known that the 
device is at full power.  That means it _has_ to be called after the 
runtime_resume callback returns.

Also, "func" should not be stored in dev_pm_ops because it won't be a 
read-only value.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux