<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/base/power/qos.c, branch linux-4.16.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2017-11-08T11:14:51+00:00</updated>
<entry>
<title>PM / QoS: Fix device resume latency framework</title>
<updated>2017-11-08T11:14:51+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2017-11-07T10:33:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0759e80b84e34a84e7e46e2b1adb528c83d84a47'/>
<id>urn:sha1:0759e80b84e34a84e7e46e2b1adb528c83d84a47</id>
<content type='text'>
The special value of 0 for device resume latency PM QoS means
"no restriction", but there are two problems with that.

First, device resume latency PM QoS requests with 0 as the
value are always put in front of requests with positive
values in the priority lists used internally by the PM QoS
framework, causing 0 to be chosen as an effective constraint
value.  However, that 0 is then interpreted as "no restriction"
effectively overriding the other requests with specific
restrictions which is incorrect.

Second, the users of device resume latency PM QoS have no
way to specify that *any* resume latency at all should be
avoided, which is an artificial limitation in general.

To address these issues, modify device resume latency PM QoS to
use S32_MAX as the "no constraint" value and 0 as the "no
latency at all" one and rework its users (the cpuidle menu
governor, the genpd QoS governor and the runtime PM framework)
to follow these changes.

Also add a special "n/a" value to the corresponding user space I/F
to allow user space to indicate that it cannot accept any resume
latencies at all for the given device.

Fixes: 85dc0b8a4019 (PM / QoS: Make it possible to expose PM QoS latency constraints)
Link: https://bugzilla.kernel.org/show_bug.cgi?id=197323
Reported-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Tested-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Tested-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Tested-by: Tero Kristo &lt;t-kristo@ti.com&gt;
Reviewed-by: Ramesh Thomas &lt;ramesh.thomas@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / QoS: Use the correct variable to check the QoS request type</title>
<updated>2017-09-18T11:38:30+00:00</updated>
<author>
<name>Jan H. Schönherr</name>
<email>jschoenh@amazon.de</email>
</author>
<published>2017-09-05T21:14:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=41ba8bd0829f5c210715ece8b0f699bed0da8eb5'/>
<id>urn:sha1:41ba8bd0829f5c210715ece8b0f699bed0da8eb5</id>
<content type='text'>
Use the actual function argument for the validation of the request type,
instead of the type field in a fresh (supposedly zero-initialized)
request structure.

Signed-off-by: Jan H. Schönherr &lt;jschoenh@amazon.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branches 'pm-cpuidle', 'pm-cpufreq' and 'pm-sleep'</title>
<updated>2017-03-02T23:43:11+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2017-03-02T23:43:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9b5e9cb164ee93ae19c4c6593e8188a55481f78b'/>
<id>urn:sha1:9b5e9cb164ee93ae19c4c6593e8188a55481f78b</id>
<content type='text'>
* pm-cpuidle:
  intel_idle: stop exposing platform acronyms in sysfs
  cpuidle: menu: Avoid taking spinlock for accessing QoS values

* pm-cpufreq:
  cpufreq: intel_pstate: Fix limits issue with operation mode switching
  cpufreq: qoriq: clean up unused code

* pm-sleep:
  PM / hibernate: Define pr_fmt() and use pr_*() instead of printk()
  PM / hibernate: Untangle power_down()
</content>
</entry>
<entry>
<title>cpuidle: menu: Avoid taking spinlock for accessing QoS values</title>
<updated>2017-02-27T14:07:38+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2017-02-24T12:25:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6dbf5cea05a7098a69f294c96b6d76f08562cae5'/>
<id>urn:sha1:6dbf5cea05a7098a69f294c96b6d76f08562cae5</id>
<content type='text'>
After commit 9908859acaa9 (cpuidle/menu: add per CPU PM QoS resume
latency consideration) the cpuidle menu governor calls
dev_pm_qos_read_value() on CPU devices to read the current resume
latency QoS constraint values for them.  That function takes a spinlock
to prevent the device's power.qos pointer from becoming NULL during
the access which is a problem for the RT patchset where spinlocks are
converted into mutexes and the idle loop stops working.

However, it is not even necessary for the menu governor to take
that spinlock, because the power.qos pointer accessed under it
cannot be modified during the access anyway.

For this reason, introduce a "raw" routine for accessing device
QoS resume latency constraints without locking and use it in the
menu governor.

Fixes: 9908859acaa9 (cpuidle/menu: add per CPU PM QoS resume latency consideration)
Acked-by: Alex Shi &lt;alex.shi@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / QoS: Remove global notifiers</title>
<updated>2017-02-23T22:05:58+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2017-02-22T08:28:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d08d1b27fe2a7f6923952613f5fab56ae47a6f5b'/>
<id>urn:sha1:d08d1b27fe2a7f6923952613f5fab56ae47a6f5b</id>
<content type='text'>
They were never used in the kernel, so get rid of them.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / QoS: Fix memory leak on resume_latency.notifiers</title>
<updated>2017-02-18T01:20:53+00:00</updated>
<author>
<name>John Keeping</name>
<email>john@metanate.com</email>
</author>
<published>2017-02-16T17:21:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e84b4a84e52d4cd8770b4242cd09df0133333f63'/>
<id>urn:sha1:e84b4a84e52d4cd8770b4242cd09df0133333f63</id>
<content type='text'>
Since commit 2d984ad132a8 (PM / QoS: Introcuce latency tolerance device
PM QoS type) we reassign "c" to point at qos-&gt;latency_tolerance before
freeing c-&gt;notifiers, but the notifiers field of latency_tolerance is
never used.

Restore the original behaviour of freeing the notifiers pointer on
qos-&gt;resume_latency, which is used, and fix the following kmemleak
warning.

unreferenced object 0xed9dba00 (size 64):
  comm "kworker/0:1", pid 36, jiffies 4294670128 (age 15202.983s)
  hex dump (first 32 bytes):
    00 00 00 00 04 ba 9d ed 04 ba 9d ed 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;c06f6084&gt;] kmemleak_alloc+0x74/0xb8
    [&lt;c011c964&gt;] kmem_cache_alloc_trace+0x170/0x25c
    [&lt;c035f448&gt;] dev_pm_qos_constraints_allocate+0x3c/0xe4
    [&lt;c035f574&gt;] __dev_pm_qos_add_request+0x84/0x1a0
    [&lt;c035f6cc&gt;] dev_pm_qos_add_request+0x3c/0x54
    [&lt;c03c3fc4&gt;] usb_hub_create_port_device+0x110/0x2b8
    [&lt;c03b2a60&gt;] hub_probe+0xadc/0xc80
    [&lt;c03bb050&gt;] usb_probe_interface+0x1b4/0x260
    [&lt;c035773c&gt;] driver_probe_device+0x198/0x40c
    [&lt;c0357b14&gt;] __device_attach_driver+0x8c/0x98
    [&lt;c0355bbc&gt;] bus_for_each_drv+0x8c/0x9c
    [&lt;c0357494&gt;] __device_attach+0x98/0x138
    [&lt;c0357c64&gt;] device_initial_probe+0x14/0x18
    [&lt;c03569dc&gt;] bus_probe_device+0x30/0x88
    [&lt;c0354c54&gt;] device_add+0x430/0x554
    [&lt;c03b92d8&gt;] usb_set_configuration+0x660/0x6fc

Fixes: 2d984ad132a8 (PM / QoS: Introcuce latency tolerance device PM QoS type)
Signed-off-by: John Keeping &lt;john@metanate.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / QoS: Export dev_pm_qos_update_user_latency_tolerance</title>
<updated>2016-11-30T21:34:24+00:00</updated>
<author>
<name>Andrew Lutomirski</name>
<email>luto@kernel.org</email>
</author>
<published>2016-11-30T01:11:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=034e7906211c18c230ef4da43a1c44796dd5b95e'/>
<id>urn:sha1:034e7906211c18c230ef4da43a1c44796dd5b95e</id>
<content type='text'>
nvme wants a module parameter that overrides the default latency
tolerance.  This makes it easy for nvme to reflect that default in
sysfs.

Signed-off-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / QoS: Fix writing 'auto' to pm_qos_latency_tolerance_us</title>
<updated>2016-11-30T21:34:23+00:00</updated>
<author>
<name>Andrew Lutomirski</name>
<email>luto@kernel.org</email>
</author>
<published>2016-11-30T01:11:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=80a6f7c79b7822726a096ce9e01cc00a1eacc2c4'/>
<id>urn:sha1:80a6f7c79b7822726a096ce9e01cc00a1eacc2c4</id>
<content type='text'>
If it was already 'auto', then writing 'auto' again would
incorrectly fail.

Signed-off-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / QoS: Make it possible to expose device latency tolerance to userspace</title>
<updated>2015-07-28T07:50:41+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2015-07-27T15:03:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=13b2c4a0c3b1cd37ee6bcfbb5b6e2b94e9a75364'/>
<id>urn:sha1:13b2c4a0c3b1cd37ee6bcfbb5b6e2b94e9a75364</id>
<content type='text'>
Typically when a device is created the bus core it belongs to (for example
PCI) does not know if the device supports things like latency tolerance.
This is left to the driver that binds to the device in question. However,
at that time the device has already been created and there is no way to set
its dev-&gt;power.set_latency_tolerance anymore.

So follow what has been done for other PM QoS attributes as well and allow
drivers to expose and hide latency tolerance from userspace, if the device
supports it.

Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>PM / QoS: Use lockdep asserts to find missing hold of power.lock</title>
<updated>2015-01-23T21:31:08+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2015-01-09T08:27:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f90b8ad83a6ae984edb6b489ed02e45dadfd263e'/>
<id>urn:sha1:f90b8ad83a6ae984edb6b489ed02e45dadfd263e</id>
<content type='text'>
Add lockdep asserts for holding the dev-&gt;power.lock to non-static
functions which require this. They could be used outside of the file so
asserts may help in detecting locking misuse.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
