public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: mark gross <640e9920@gmail.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-pm@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [patch] complain when users abuse the pm_qos API
Date: Fri, 28 May 2010 21:50:27 -0700	[thread overview]
Message-ID: <20100529045027.GE11600@gvim.org> (raw)

The following patch is to help clean up API abusers of pm_qos where
they call update_request before registering a request.

--mgross

--Signed-off-by: markgross <markgross@thegnar.org>


>From a0813007ddc7b72cb3da7a533fefba9889aab1d8 Mon Sep 17 00:00:00 2001
From: mgross <mgross@mgross-desktop.(none)>
Date: Fri, 28 May 2010 21:36:06 -0700
Subject: [PATCH] complain when users abuse the pm_qos API by updating a request that
 isn't registered yet.

---
 kernel/pm_qos_params.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index f42d3f7..8e55bf1 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -266,6 +266,10 @@ void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
 		spin_unlock_irqrestore(&pm_qos_lock, flags);
 		if (pending_update)
 			update_target(pm_qos_req->pm_qos_class);
+	} else {
+		WARN(true, "pm_qos: updating an unregistered request "
+				"does nothing");
+		dump_stack();
 	}
 }
 EXPORT_SYMBOL_GPL(pm_qos_update_request);
-- 
1.7.0.4


             reply	other threads:[~2010-05-29  4:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-29  4:50 mark gross [this message]
2010-05-29 20:08 ` [patch] complain when users abuse the pm_qos API Rafael J. Wysocki
2010-05-29 23:03   ` [linux-pm] " Nigel Cunningham
2010-05-30 19:50     ` Rafael J. Wysocki
2010-05-30 20:11       ` mark gross
2010-05-30 20:55         ` Rafael J. Wysocki
2010-05-30 20:07     ` mark gross
2010-05-30 20:08   ` mark gross

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=20100529045027.GE11600@gvim.org \
    --to=640e9920@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=markgross@thegnar.org \
    --cc=rjw@sisk.pl \
    /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