The reason I'm keeping my own count is because I don't see a driver interface 
to the PM subsystem that allows me to ascertain my own usage_count. I see that 
the get/put routines use the atomic_t dev->power.usage_count but I can't access 
that directly.



I'm trying to use the activity count to return -EBUSY from pm_runtime_suspend 
to catch the case where activity comes in between pm_runtime_idle(no activity) 
and pm_runtime_suspend(). If I could access dev->power.usage_count I wouldn't 
use my own counter.



The other reason for abstracting to a function is that I was planning on adding 
some additional pm_qos_ calls when we cross the 0/non-zero usage count barrier, 
but that code is not fully baked yet.



>-----Original Message-----

>From: Arjan van de Ven [mailto:[email protected]]

>Sent: Friday, July 30, 2010 12:50 PM

>To: Development for the MeeGo Project (discussion list)

>Cc: Gorby, RichardX R; Bastian, Waldo

>Subject: Re: [MeeGo-dev] [PATCH 1/1] PM support for SSP-SPI master

>controller driver v.01

>

>

>> +

>> +static inline void active_dec(struct driver_data *drv_data)

>> +{

>> +       int i;

>> +       i = atomic_sub_return(1,&drv_data->active);

>> +       pm_runtime_put(&drv_data->pdev->dev);

>> +}

>>

>

>this does not make sense to me. the pm_runtome_get and such are ALREADY

>refcounts

>

>why are you adding your own? and then abstract it into some function?

>


_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev

Reply via email to