<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/drivers/hwmon/occ/common.c, branch dev-5.2</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-5.2</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-5.2'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2019-07-10T07:30:16+00:00</updated>
<entry>
<title>hwmon (occ): Fix division by zero issue</title>
<updated>2019-07-10T07:30:16+00:00</updated>
<author>
<name>Lei YU</name>
<email>mine260309@gmail.com</email>
</author>
<published>2019-07-08T08:32:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=3d6db36d93f83549f16c37ae2c9ccc8799ac2dac'/>
<id>urn:sha1:3d6db36d93f83549f16c37ae2c9ccc8799ac2dac</id>
<content type='text'>
The code in occ_get_powr_avg() invokes div64_u64() without checking the
divisor. In case the divisor is zero, kernel gets an "Division by zero
in kernel" error.

Check the divisor and make it return 0 if the divisor is 0.

OpenBMC-Staging-Count: 1
Signed-off-by: Lei YU &lt;mine260309@gmail.com&gt;
Reviewed-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>hwmon (occ): Add temp sensor value check</title>
<updated>2019-07-10T07:30:15+00:00</updated>
<author>
<name>Alexander Soldatov</name>
<email>a.soldatov@yadro.com</email>
</author>
<published>2019-04-17T18:03:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=48898772f3836a6238aaf9a07a451bca518197a6'/>
<id>urn:sha1:48898772f3836a6238aaf9a07a451bca518197a6</id>
<content type='text'>
The occ driver supports two formats for the temp sensor value.

The OCC firmware for P8 supports only the first format, for which
no range checking or error processing is performed in the driver.
Inspecting the OCC sources for P8 reveals that OCC may send
a special value 0xFFFF to indicate that a sensor read timeout
has occurred, see

https://github.com/open-power/occ/blob/master_p8/src/occ/cmdh/cmdh_fsp_cmds.c#L395

That situation wasn't handled in the driver. This patch adds invalid
temp value check for the sensor data format 1 and handles it the same
way as it is done for the format 2, where EREMOTEIO is reported for
this case.

OpenBMC-Staging-Count: 3
Signed-off-by: Alexander Soldatov &lt;a.soldatov@yadro.com&gt;
Signed-off-by: Alexander Amelkin &lt;a.amelkin@yadro.com&gt;
Reviewed-by: Alexander Amelkin &lt;a.amelkin@yadro.com&gt;
Cc: Edward A. James &lt;eajames@us.ibm.com&gt;
Cc: Joel Stanley &lt;joel@jms.id.au&gt;
Reviewed-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>OCC: FSI and hwmon: Add sequence numbering</title>
<updated>2019-07-10T07:09:12+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.ibm.com</email>
</author>
<published>2019-07-02T15:47:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=911b976de5d872ecddf16d4dcc0bcbde5fa1d385'/>
<id>urn:sha1:911b976de5d872ecddf16d4dcc0bcbde5fa1d385</id>
<content type='text'>
Sequence numbering of the commands submitted to the OCC is required by
the OCC interface specification. Add sequence numbering and check for
the correct sequence number on the response.

Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Acked-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Lei YU &lt;mine260309@gmail.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
(cherry picked from commit afd26118f0dcf29db031a213f6f95c46ff3bdcbe)
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) Store error condition for rate-limited polls</title>
<updated>2019-04-16T22:12:13+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.ibm.com</email>
</author>
<published>2019-04-16T15:43:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=b5c46a53ee6b1f97104883d93847b2b2fdddc289'/>
<id>urn:sha1:b5c46a53ee6b1f97104883d93847b2b2fdddc289</id>
<content type='text'>
The OCC driver limits the rate of sending poll commands to the OCC. If a
user reads a hwmon entry after a poll response resulted in an error and
is rate-limited, the error is invisible to the user. Fix this by storing
the last error and returning that in the rate-limited case.

Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) Move common code to a separate module</title>
<updated>2019-04-16T00:19:53+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2019-04-10T10:47:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=5679ed99065372bc62c57a895950914e1c0fb9e0'/>
<id>urn:sha1:5679ed99065372bc62c57a895950914e1c0fb9e0</id>
<content type='text'>
Instead of duplicating the common code into the 2 (binary) drivers,
move the common code to a separate module. This is cleaner.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: Eddie James &lt;eajames@linux.ibm.com&gt;
Cc: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Tested-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) Fix power sensor indexing</title>
<updated>2019-03-29T16:51:44+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.ibm.com</email>
</author>
<published>2019-03-19T21:01:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=8e6af454117a51dbf6c8a47c00180a0c235052fe'/>
<id>urn:sha1:8e6af454117a51dbf6c8a47c00180a0c235052fe</id>
<content type='text'>
In the case of power sensor version 0xA0, the sensor indexing overlapped
with the "caps" power sensors, resulting in probe failure and kernel
warnings. Fix this by specifying the next index for each power sensor
version.

Fixes: 54076cb3b5ff ("hwmon (occ): Add sensor attributes and register ...")
Cc: stable@vger.kernel.org
Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Tested-by: Joel Stanley &lt;joel@jms.id.au&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) Fix license headers</title>
<updated>2019-02-18T22:23:29+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.ibm.com</email>
</author>
<published>2019-01-28T16:23:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=e2f05d608653cb212edea136ad82107c6be56e1d'/>
<id>urn:sha1:e2f05d608653cb212edea136ad82107c6be56e1d</id>
<content type='text'>
Files have inconsistent license information.

Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) Fix potential integer overflow</title>
<updated>2019-01-08T05:03:59+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2019-01-07T18:34:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=b0407d820b65272fcaa77e0dd1347dc7678d23b8'/>
<id>urn:sha1:b0407d820b65272fcaa77e0dd1347dc7678d23b8</id>
<content type='text'>
Cast get_unaligned_be32(...) to u64 in order to give the compiler
complete information about the proper arithmetic to use and avoid
a potential integer overflow.

Notice that such function call is used in contexts that expect
expressions of type u64 (64 bits, unsigned); and the following
expressions are currently being evaluated using 32-bit
arithmetic:

val = get_unaligned_be32(&amp;power-&gt;update_tag) *
                        occ-&gt;powr_sample_time_us;

val = get_unaligned_be32(&amp;power-&gt;vdn.update_tag) *
                        occ-&gt;powr_sample_time_us;

Addresses-Coverity-ID: 1442357 ("Unintentional integer overflow")
Addresses-Coverity-ID: 1442476 ("Unintentional integer overflow")
Addresses-Coverity-ID: 1442508 ("Unintentional integer overflow")
Fixes: ff692d80b2e2 ("hwmon (occ): Add sensor types and versions")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Reviewed-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon (occ): Add sysfs attributes for additional OCC data</title>
<updated>2018-12-16T23:13:10+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.vnet.ibm.com</email>
</author>
<published>2018-11-08T21:05:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=df04ced684d48f6ec5729ccd034702952160c6b3'/>
<id>urn:sha1:df04ced684d48f6ec5729ccd034702952160c6b3</id>
<content type='text'>
The OCC provides a variety of additional information about the state of
the host processor, such as throttling, error conditions, and the number
of OCCs detected in the system. This information is essential to service
processor applications such as fan control and host management.
Therefore, export this data in the form of sysfs attributes attached to
the platform device (to which the hwmon device is also attached).

Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon (occ): Add sensor attributes and register hwmon device</title>
<updated>2018-12-16T23:13:09+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.vnet.ibm.com</email>
</author>
<published>2018-11-08T21:05:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=54076cb3b5ff21f6474f5fd254a0b018b24771df'/>
<id>urn:sha1:54076cb3b5ff21f6474f5fd254a0b018b24771df</id>
<content type='text'>
Setup the sensor attributes for every OCC sensor found by the first poll
response. Register the attributes with hwmon.

Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
</feed>
