Re: [PATCH v6 0/6] PM QoS: implement the OMAP low level constraints management code

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

 



Hi Paul,

On Mon, Jan 16, 2012 at 9:04 PM, Paul Walmsley <paul@xxxxxxxxx> wrote:
> Hi
>
> On Mon, 16 Jan 2012, Jean Pihet wrote:
>
>> Speaking of the locking, currently a spinlock is used and it could be
>> replaced by a more efficient mutex. This is ok at the condition that
>> this code is not called from interrupt context?
>>
>> Kevin,
>> Do you know if the per-device constraint code can be called from
>> interrupt context?
>
> It can't be.  It uses a mutex itself.  So a mutex is what we want.  Take a
> look at drivers/base/power/qos.c:dev_pm_qos_update_request() (included
> below)
Ok thanks for checking, I should have done it before asking ;-|

Jean

>
>
> - Paul
>
>
> /**
>  * dev_pm_qos_update_request - modifies an existing qos request
>  * @req : handle to list element holding a dev_pm_qos request to use
>  * @new_value: defines the qos request
>  *
>  * Updates an existing dev PM qos request along with updating the
>  * target value.
>  *
>  * Attempts are made to make this code callable on hot code paths.
>  *
>  * Returns 1 if the aggregated constraint value has changed,
>  * 0 if the aggregated constraint value has not changed,
>  * -EINVAL in case of wrong parameters, -ENODEV if the device has been
>  * removed from the system
>  */
> int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
>                              s32 new_value)
> {
>        int ret = 0;
>
>        if (!req) /*guard against callers passing in null */
>                return -EINVAL;
>
>        if (WARN(!dev_pm_qos_request_active(req),
>                 "%s() called for unknown object\n", __func__))
>                return -EINVAL;
>
>        mutex_lock(&dev_pm_qos_mtx);
>
>        if (req->dev->power.constraints) {
>                if (new_value != req->node.prio)
>                        ret = apply_constraint(req, PM_QOS_UPDATE_REQ,
>                                               new_value);
>        } else {
>                /* Return if the device has been removed */
>                ret = -ENODEV;
>        }
>
>        mutex_unlock(&dev_pm_qos_mtx);
>        return ret;
> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux