linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dov Levenglick" <dovl@codeaurora.org>
To: "Adrian Hunter" <adrian.hunter@intel.com>
Cc: "Dov Levenglick" <dovl@codeaurora.org>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"linux-mmc" <linux-mmc@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	"Len Brown" <len.brown@intel.com>, "Pavel Machek" <pavel@ucw.cz>,
	"Kevin Hilman" <khilman@linaro.org>,
	"Tomeu Vizoso" <tomeu.vizoso@collabora.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/4] PM / QoS: Add pm_qos_cancel_request_lazy() that doesn't sleep
Date: Tue, 21 Apr 2015 10:18:27 -0000	[thread overview]
Message-ID: <c4537efead55f0b072d33d4e36090039.squirrel@www.codeaurora.org> (raw)
In-Reply-To: <553609CA.8000806@intel.com>

> On 20/04/15 17:00, Dov Levenglick wrote:
>>> Add pm_qos_cancel_request_lazy() which is convenient for
>>> contexts that may not sleep.
>>>
>>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>>> ---
>>>  include/linux/pm_qos.h |  2 ++
>>>  kernel/power/qos.c     | 20 ++++++++++++++++++++
>>>  2 files changed, 22 insertions(+)
>>>
>>> diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
>>> index 7b3ae0c..f44d353 100644
>>> --- a/include/linux/pm_qos.h
>>> +++ b/include/linux/pm_qos.h
>>> @@ -126,6 +126,8 @@ void pm_qos_update_request(struct pm_qos_request
> *req,
>>>  			   s32 new_value);
>>>  void pm_qos_update_request_timeout(struct pm_qos_request *req,
>>>  				   s32 new_value, unsigned long
>>> timeout_us);
>>> +void pm_qos_cancel_request_lazy(struct pm_qos_request *req,
>>> +				unsigned int timeout_us);
>>>  void pm_qos_remove_request(struct pm_qos_request *req);
>>>
>>
>> I think that this could be acheived using existing API if
>> pm_qos_update_request_timeout() were to be called with the existing
>> timeout value.
>
> I don't follow what you mean. There is no existing timeout value.
> Did you mean existing request value? There is still the difference wrt
> cancel_delayed_work_sync.

I did mean the existing request value. Thanks.
There is also the cancel_delayed_work_sync, however I think that that
should be called in any case in order to cancel any other pending timeout
changes.

>
>> Since reading the existing timeout value is missing - and I think would
> be
>> a useful feature to have for other use-cases - do you agree with such an
>> approach?
>>
>>>  int pm_qos_request(int pm_qos_class);
>>> diff --git a/kernel/power/qos.c b/kernel/power/qos.c
>>> index 97b0df7..ac131cb 100644
>>> --- a/kernel/power/qos.c
>>> +++ b/kernel/power/qos.c
>>> @@ -517,6 +517,26 @@ void pm_qos_update_request_timeout(struct
>>> pm_qos_request *req, s32 new_value,
>>>  }
>>>
>>>  /**
>>> + * pm_qos_cancel_request_lazy - cancels an existing qos request
> lazily.
>>> + * @req : handle to list element holding a pm_qos request to use
>>> + * @timeout_us: the delay before cancelling this qos request in usecs.
>>> + *
>>> + * After timeout_us, this qos request is cancelled.
>>> + */
>>> +void pm_qos_cancel_request_lazy(struct pm_qos_request *req,
>>> +				unsigned int timeout_us)
>>> +{
>>> +	if (!req)
>>> +		return;
>>> +	if (WARN(!pm_qos_request_active(req),
>>> +		 "%s called for unknown object.", __func__))
>>> +		return;
>>> +
>>> +	schedule_delayed_work(&req->work, usecs_to_jiffies(timeout_us));
>>> +}
>>> +EXPORT_SYMBOL_GPL(pm_qos_cancel_request_lazy);
>>> +
>>> +/**
>>>   * pm_qos_remove_request - modifies an existing qos request
>>>   * @req: handle to request list element
>>>   *
>>> --
>>> 1.9.1
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>>
>>
>> QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc.
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
> Forum,
>> a Linux Foundation Collaborative Project
>>
>>
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


  reply	other threads:[~2015-04-21 10:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 13:40 [RFC PATCH 0/4] mmc: sdhci: Support maximum DMA latency request via PM QoS Adrian Hunter
2015-03-24 13:40 ` [RFC PATCH 1/4] PM / QoS: Add pm_qos_cancel_request_lazy() that doesn't sleep Adrian Hunter
2015-04-20 14:00   ` Dov Levenglick
2015-04-21  8:26     ` Adrian Hunter
2015-04-21 10:18       ` Dov Levenglick [this message]
2015-04-21 10:25         ` Adrian Hunter
2015-03-24 13:40 ` [RFC PATCH 2/4] mmc: sdhci: Support maximum DMA latency request via PM QOS Adrian Hunter
2015-03-24 13:40 ` [RFC PATCH 3/4] mmc: sdhci-acpi: Fix device hang on Intel BayTrail Adrian Hunter
2015-03-24 13:40 ` [RFC PATCH 4/4] mmc: sdhci-pci: " Adrian Hunter
2015-03-24 20:13 ` [RFC PATCH 0/4] mmc: sdhci: Support maximum DMA latency request via PM QoS Rafael J. Wysocki
2015-03-25 12:37   ` Adrian Hunter
2015-03-25 19:43 ` Pavel Machek
2015-03-26  8:29   ` Adrian Hunter
2015-03-26  9:51     ` Pavel Machek
2015-04-01 19:59 ` Len Brown
2015-04-02 19:35   ` Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4537efead55f0b072d33d4e36090039.squirrel@www.codeaurora.org \
    --to=dovl@codeaurora.org \
    --cc=adrian.hunter@intel.com \
    --cc=khilman@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tomeu.vizoso@collabora.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).