<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/platform/x86/intel_pmc_core.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/platform/x86/intel_pmc_core.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/platform/x86/intel_pmc_core.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-08-20T18:00:21Z</updated>
<entry>
<title>platform/x86: intel_pmc_core: Move to intel sub-directory</title>
<updated>2021-08-20T18:00:21Z</updated>
<author>
<name>Kate Hsuan</name>
<email>hpa@redhat.com</email>
</author>
<published>2021-08-20T11:04:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=fa082a7cf5a66a42a06da048afd972e2cc1b67ea'/>
<id>urn:sha1:fa082a7cf5a66a42a06da048afd972e2cc1b67ea</id>
<content type='text'>
Move Intel PMC core driver to intel sub-directory to improve readability.

Signed-off-by: Kate Hsuan &lt;hpa@redhat.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Rajneesh Bhardwaj &lt;irenic.rajneesh@gmail.com&gt;
Link: https://lore.kernel.org/r/20210820110458.73018-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/x86: intel_pmc_core: Prevent possibile overflow</title>
<updated>2021-08-17T18:53:10Z</updated>
<author>
<name>David E. Box</name>
<email>david.e.box@linux.intel.com</email>
</author>
<published>2021-08-14T01:47:28Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=45b6f75eab6aabf9d88933830f41f532d39f38d2'/>
<id>urn:sha1:45b6f75eab6aabf9d88933830f41f532d39f38d2</id>
<content type='text'>
Substate priority levels are encoded in 4 bits in the LPM_PRI register.
This value was used as an index to an array whose element size was less
than 16, leading to the possibility of overflow should we read a larger
than expected priority.  In addition to the overflow, bad values could lead
to incorrect state reporting.  So rework the priority code to prevent the
overflow and perform some validation of the register. Use the priority
register values if they give an ordering of unique numbers between 0 and
the maximum number of states.  Otherwise, use a default ordering instead.

Reported-by: Evgeny Novikov &lt;novikov@ispras.ru&gt;
Signed-off-by: David E. Box &lt;david.e.box@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20210814014728.520856-1-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/x86: intel_pmc_core: Uninitialized data in pmc_core_lpm_latch_mode_write()</title>
<updated>2021-04-21T19:32:31Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2021-04-21T15:19:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=37bd59d3cef8e90055dc26e25d9aba00f06f5f9f'/>
<id>urn:sha1:37bd59d3cef8e90055dc26e25d9aba00f06f5f9f</id>
<content type='text'>
The simple_write_to_buffer() can return success if even a single byte
is copied from user space.  In this case it can result in using
uninitalized data if the buf[] array is not fully initialized.  Really
we should only succeed if the whole buffer is copied.

Just using copy_from_user() is simpler and more appropriate.

Fixes: 8074a79fad2e ("platform/x86: intel_pmc_core: Add option to set/clear LPM mode")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Link: https://lore.kernel.org/r/YIBCf+G9Ef8wrGJw@mwanda
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/x86: intel_pmc_core: Fix "unsigned 'ret' is never less than zero" smatch warning</title>
<updated>2021-04-20T15:01:48Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2021-04-19T14:31:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=dd5566d6d80c2d9936f8b8b36a7a9599cbfe47a7'/>
<id>urn:sha1:dd5566d6d80c2d9936f8b8b36a7a9599cbfe47a7</id>
<content type='text'>
Change the type of ret form a size_t to a ssize_t, matching the prototype
of simple_write_to_buffer(), fixing this warning reported by smatch:

drivers/platform/x86/intel_pmc_core.c:1369 pmc_core_lpm_latch_mode_write() warn: unsigned 'ret' is never less than zero.

Fixes: 8074a79fad2e ("platform/x86: intel_pmc_core: Add option to set/clear LPM mode")
Cc: David E. Box &lt;david.e.box@linux.intel.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Link: https://lore.kernel.org/r/20210419143109.30612-1-hdegoede@redhat.com
</content>
</entry>
<entry>
<title>platform/x86: intel_pmc_core: Add support for Alder Lake PCH-P</title>
<updated>2021-04-19T08:44:28Z</updated>
<author>
<name>David E. Box</name>
<email>david.e.box@linux.intel.com</email>
</author>
<published>2021-04-17T03:12:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0636cdc9456f7b1467207e496c9e847214663345'/>
<id>urn:sha1:0636cdc9456f7b1467207e496c9e847214663345</id>
<content type='text'>
Alder PCH-P is based on Tiger Lake PCH.

Signed-off-by: David E. Box &lt;david.e.box@linux.intel.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Acked-by: Rajneesh Bhardwaj &lt;irenic.rajneesh@gmail.com&gt;
Link: https://lore.kernel.org/r/20210417031252.3020837-10-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/x86: intel_pmc_core: Add LTR registers for Tiger Lake</title>
<updated>2021-04-19T08:44:28Z</updated>
<author>
<name>Gayatri Kammela</name>
<email>gayatri.kammela@intel.com</email>
</author>
<published>2021-04-17T03:12:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=43ef6c226a60b1c52890791af73f7015f68a315a'/>
<id>urn:sha1:43ef6c226a60b1c52890791af73f7015f68a315a</id>
<content type='text'>
Just like Ice Lake, Tiger Lake uses Cannon Lake's LTR information
and supports a few additional registers. Hence add the LTR registers
specific to Tiger Lake to the cnp_ltr_show_map[].

Also adjust the number of LTR IPs for Tiger Lake to the correct amount.

Signed-off-by: Gayatri Kammela &lt;gayatri.kammela@intel.com&gt;
Signed-off-by: David E. Box &lt;david.e.box@linux.intel.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Acked-by: Rajneesh Bhardwaj &lt;irenic.rajneesh@gmail.com&gt;
Link: https://lore.kernel.org/r/20210417031252.3020837-9-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/x86: intel_pmc_core: Add option to set/clear LPM mode</title>
<updated>2021-04-19T08:44:28Z</updated>
<author>
<name>David E. Box</name>
<email>david.e.box@linux.intel.com</email>
</author>
<published>2021-04-17T03:12:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=8074a79fad2e34fce11ea2b2c515b984fc6b2a08'/>
<id>urn:sha1:8074a79fad2e34fce11ea2b2c515b984fc6b2a08</id>
<content type='text'>
By default the Low Power Mode (LPM or sub-state) status registers will
latch condition status on every entry into Package C10. This is
configurable in the PMC to allow latching on any achievable sub-state. Add
a debugfs file to support this.

Also add the option to clear the status registers to 0. Clearing the status
registers before testing removes ambiguity around when the current values
were set.

The new file, latch_lpm_mode, looks like this:

	[c10] S0i2.0 S0i3.0 S0i2.1 S0i3.1 S0i3.2 clear

Signed-off-by: David E. Box &lt;david.e.box@linux.intel.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Link: https://lore.kernel.org/r/20210417031252.3020837-8-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/x86: intel_pmc_core: Add requirements file to debugfs</title>
<updated>2021-04-19T08:44:28Z</updated>
<author>
<name>Gayatri Kammela</name>
<email>gayatri.kammela@intel.com</email>
</author>
<published>2021-04-17T03:12:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=952c15538e5346fcb0548370f25380b7bc62ed40'/>
<id>urn:sha1:952c15538e5346fcb0548370f25380b7bc62ed40</id>
<content type='text'>
Add the debugfs file, substate_requirements, to view the low power mode
(LPM) requirements for each enabled mode alongside the last latched status
of the condition.

After this patch, the new file will look like this:

                    Element |    S0i2.0 |    S0i3.0 |    S0i2.1 |    S0i3.1 |    S0i3.2 |    Status |
            USB2PLL_OFF_STS |  Required |  Required |  Required |  Required |  Required |           |
PCIe/USB3.1_Gen2PLL_OFF_STS |  Required |  Required |  Required |  Required |  Required |           |
       PCIe_Gen3PLL_OFF_STS |  Required |  Required |  Required |  Required |  Required |       Yes |
            OPIOPLL_OFF_STS |  Required |  Required |  Required |  Required |  Required |       Yes |
              OCPLL_OFF_STS |  Required |  Required |  Required |  Required |  Required |       Yes |
            MainPLL_OFF_STS |           |  Required |           |  Required |  Required |           |

Signed-off-by: Gayatri Kammela &lt;gayatri.kammela@intel.com&gt;
Co-developed-by: David E. Box &lt;david.e.box@linux.intel.com&gt;
Signed-off-by: David E. Box &lt;david.e.box@linux.intel.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Link: https://lore.kernel.org/r/20210417031252.3020837-7-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/x86: intel_pmc_core: Get LPM requirements for Tiger Lake</title>
<updated>2021-04-19T08:44:28Z</updated>
<author>
<name>Gayatri Kammela</name>
<email>gayatri.kammela@intel.com</email>
</author>
<published>2021-04-17T03:12:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=428131364f0073a18682a5d3ee9cf13d8042cfce'/>
<id>urn:sha1:428131364f0073a18682a5d3ee9cf13d8042cfce</id>
<content type='text'>
Platforms that support low power modes (LPM) such as Tiger Lake maintain
requirements for each sub-state that a readable in the PMC. However, unlike
LPM status registers, requirement registers are not memory mapped but are
available from an ACPI _DSM. Collect the requirements for Tiger Lake using
the _DSM method and store in a buffer.

Signed-off-by: Gayatri Kammela &lt;gayatri.kammela@intel.com&gt;
Co-developed-by: David E. Box &lt;david.e.box@linux.intel.com&gt;
Signed-off-by: David E. Box &lt;david.e.box@linux.intel.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Link: https://lore.kernel.org/r/20210417031252.3020837-6-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/x86: intel_pmc_core: Show LPM residency in microseconds</title>
<updated>2021-04-19T08:41:24Z</updated>
<author>
<name>Gayatri Kammela</name>
<email>gayatri.kammela@intel.com</email>
</author>
<published>2021-04-17T03:12:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=29c2dd88ac9ed5780a762e49585e65e99c90d5a8'/>
<id>urn:sha1:29c2dd88ac9ed5780a762e49585e65e99c90d5a8</id>
<content type='text'>
Modify the low power mode (LPM or sub-state) residency counters to display
in microseconds just like the slp_s0_residency counter. The granularity of
the counter is approximately 30.5us per tick. Double this value then divide
by two to maintain accuracy.

Signed-off-by: Gayatri Kammela &lt;gayatri.kammela@intel.com&gt;
Signed-off-by: David E. Box &lt;david.e.box@linux.intel.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Reviewed-by: Rajneesh Bhardwaj &lt;irenic.rajneesh@gmail.com&gt;
Link: https://lore.kernel.org/r/20210417031252.3020837-5-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
</feed>
