From: Kevin Hilman <khilman@ti.com>
To: Jean Pihet <jean.pihet@newoldbits.com>
Cc: Linux PM mailing list <linux-pm@lists.linux-foundation.org>,
linux-omap@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
Paul Walmsley <paul@pwsan.com>,
magnus.damm@gmail.com, Todd Poynor <toddpoynor@google.com>,
Jean Pihet <j-pihet@ti.com>
Subject: Re: [PATCH 3/6] OMAP: PM: register to the per-device PM QoS framework
Date: Wed, 23 Nov 2011 11:42:50 -0800 [thread overview]
Message-ID: <87hb1ubp6t.fsf@ti.com> (raw)
In-Reply-To: <CAORVsuURENRLO-FAhau-eS2VmfZrG=BOgih_SPHUSD3Nv3j96w@mail.gmail.com> (Jean Pihet's message of "Tue, 22 Nov 2011 20:52:51 +0100")
Jean Pihet <jean.pihet@newoldbits.com> writes:
> On Thu, Nov 17, 2011 at 10:24 PM, Kevin Hilman <khilman@ti.com> wrote:
>> jean.pihet@newoldbits.com writes:
>>
>>> From: Jean Pihet <j-pihet@ti.com>
>>>
>>> Implement the devices wake-up latency constraints using the global
>>> device PM QoS notification handler which applies the constraints to the
>>> underlying layer by calling the corresponding function at hwmod level.
>>>
>>> Tested on OMAP3 Beagleboard and OMAP4 Pandaboard in RET/OFF using wake-up
>>> latency constraints on MPU, CORE and PER.
>>>
>>> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> ...
>
>>> +/* Interface to the per-device PM QoS framework */
>>> +static int omap2_dev_pm_qos_handler(struct notifier_block *nb,
>>> + unsigned long new_value,
>>> + void *req)
>>> +{
>>> + struct omap_device *od;
>>> + struct omap_hwmod *oh;
>>> + struct platform_device *pdev;
>>> + struct dev_pm_qos_request *dev_pm_qos_req = req;
>>> +
>>> + pr_debug("OMAP PM CONSTRAINTS: req@0x%p, new_value=%lu\n",
>>
>> s/CONSTRAINTS/constraints/
>> another one below.
> Ok
>
>>
>>> + req, new_value);
>>> +
>>> + /* Look for the platform device for the constraint target device */
>>> + pdev = to_platform_device(dev_pm_qos_req->dev);
>>> +
>>> + /* Try to catch non platform devices */
>>
>> why?
> The constraints targets are the power domains, which you find by
> walking through the chain of structs dev, pdev, omap_device, hwmod and
> finally pwrdm.
OK
>>
>>> + if (pdev->name == NULL) {
>>> + pr_err("%s: Error: platform device for device %s not valid\n",
>>> + __func__, dev_name(dev_pm_qos_req->dev));
>>> + return -EINVAL;
>>> + }
>>> +
>>> + /* Find the associated omap_device for dev */
>>> + od = container_of(pdev, struct omap_device, pdev);
>>
>> What about devices that are valid platform_devices, but not omap_devices?
> Do you mean that od should be tested for NULL value?
First, it should be using the to_omap_device() helper function from
omap_device.h.
Until v3.2, it was based on container_of() so checking for NULL will not
help. However, as of v3.2, because I decoupled platform_device and
omap_device, checking for a NULL return from to_omap_device() will be a
good enough check.
Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-11-23 19:42 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-19 13:50 [PATCH v4 0/6] PM QoS: implement the OMAP low level constraints management code jean.pihet
2011-10-19 13:50 ` [PATCH 1/6] OMAP2+: powerdomain: control power domains next state jean.pihet
2011-11-17 21:16 ` Kevin Hilman
2011-11-17 21:16 ` Kevin Hilman
2011-11-22 19:44 ` Jean Pihet
2011-11-22 19:44 ` Jean Pihet
2011-10-19 13:50 ` [PATCH 2/6] OMAP2+: omap_hwmod: manage the wake-up latency constraints jean.pihet
2011-10-19 13:51 ` [PATCH 3/6] OMAP: PM: register to the per-device PM QoS framework jean.pihet
2011-11-17 21:24 ` Kevin Hilman
2011-11-17 21:24 ` Kevin Hilman
2011-11-22 19:52 ` Jean Pihet
2011-11-22 19:52 ` Jean Pihet
2011-11-23 19:42 ` Kevin Hilman [this message]
2011-11-23 19:42 ` Kevin Hilman
2011-10-19 13:51 ` [PATCH 4/6] OMAP3: cpuidle: next C-state decision depends on the PM QoS MPU and CORE constraints jean.pihet
2011-11-17 21:29 ` Kevin Hilman
2011-11-22 19:54 ` Jean Pihet
2011-11-23 19:43 ` Kevin Hilman
2011-11-23 19:43 ` [linux-pm] " Kevin Hilman
2011-12-12 16:26 ` Jean Pihet
2011-12-12 16:26 ` Jean Pihet
2011-11-17 21:29 ` Kevin Hilman
2011-10-19 13:51 ` [PATCH 5/6] OMAP3: update cpuidle latency and threshold figures jean.pihet
2011-10-19 13:51 ` [PATCH 6/6] OMAP3: powerdomain data: add wake-up latency figures jean.pihet
-- strict thread matches above, loose matches on Subject: below --
2011-12-12 16:18 [PATCH v5 0/6] PM QoS: implement the OMAP low level constraints management code jean.pihet
2011-12-12 16:18 ` [PATCH 3/6] OMAP: PM: register to the per-device PM QoS framework jean.pihet
2011-12-12 16:18 ` jean.pihet at newoldbits.com
2011-12-12 16:18 ` jean.pihet
2011-12-14 14:51 [PATCH v6 0/6] PM QoS: implement the OMAP low level constraints management code jean.pihet
2011-12-14 14:51 ` [PATCH 3/6] OMAP: PM: register to the per-device PM QoS framework jean.pihet
2011-12-14 14:51 ` jean.pihet at newoldbits.com
2011-12-19 21:12 ` Paul Walmsley
2011-12-19 21:12 ` Paul Walmsley
2011-12-14 14:51 ` jean.pihet
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=87hb1ubp6t.fsf@ti.com \
--to=khilman@ti.com \
--cc=j-pihet@ti.com \
--cc=jean.pihet@newoldbits.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=magnus.damm@gmail.com \
--cc=paul@pwsan.com \
--cc=rjw@sisk.pl \
--cc=toddpoynor@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.