<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/hwmon/occ/common.c, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2026-02-04T22:40:36Z</updated>
<entry>
<title>hwmon: (occ) Mark occ_init_attribute() as __printf</title>
<updated>2026-02-04T22:40:36Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2026-02-03T16:34:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=831a2b27914cc880130ffe8fb8d1e65a5324d07f'/>
<id>urn:sha1:831a2b27914cc880130ffe8fb8d1e65a5324d07f</id>
<content type='text'>
This is a printf-style function, which gcc -Werror=suggest-attribute=format
correctly points out:

drivers/hwmon/occ/common.c: In function 'occ_init_attribute':
drivers/hwmon/occ/common.c:761:9: error: function 'occ_init_attribute' might be a candidate for 'gnu_printf' format attribute [-Werror=suggest-attribute=format]

Add the attribute to avoid this warning and ensure any incorrect
format strings are detected here.

Fixes: 744c2fe950e9 ("hwmon: (occ) Rework attribute registration for stack usage")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://lore.kernel.org/r/20260203163440.2674340-1-arnd@kernel.org
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) fix unaligned accesses</title>
<updated>2025-06-16T13:30:57Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2025-06-10T09:25:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2c021b45c154958566aad0cae9f74ab26a2d5732'/>
<id>urn:sha1:2c021b45c154958566aad0cae9f74ab26a2d5732</id>
<content type='text'>
Passing a pointer to an unaligned integer as a function argument is
undefined behavior:

drivers/hwmon/occ/common.c:492:27: warning: taking address of packed member 'accumulator' of class or structure 'power_sensor_2' may result in an unaligned pointer value [-Waddress-of-packed-member]
  492 |   val = occ_get_powr_avg(&amp;power-&gt;accumulator,
      |                           ^~~~~~~~~~~~~~~~~~
drivers/hwmon/occ/common.c:493:13: warning: taking address of packed member 'update_tag' of class or structure 'power_sensor_2' may result in an unaligned pointer value [-Waddress-of-packed-member]
  493 |            &amp;power-&gt;update_tag);
      |             ^~~~~~~~~~~~~~~~~

Move the get_unaligned() calls out of the function and pass these
through argument registers instead.

Fixes: c10e753d43eb ("hwmon (occ): Add sensor types and versions")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://lore.kernel.org/r/20250610092553.2641094-1-arnd@kernel.org
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) Rework attribute registration for stack usage</title>
<updated>2025-06-16T13:30:57Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2025-06-10T09:23:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=744c2fe950e936c4d62430de899d6253424200ed'/>
<id>urn:sha1:744c2fe950e936c4d62430de899d6253424200ed</id>
<content type='text'>
clang produces an output with excessive stack usage when building the
occ_setup_sensor_attrs() function, apparently the result of having
a lot of struct literals and building with the -fno-strict-overflow
option that leads clang to skip some optimization in case the 'attr'
pointer overruns:

drivers/hwmon/occ/common.c:775:12: error: stack frame size (1392) exceeds limit (1280) in 'occ_setup_sensor_attrs' [-Werror,-Wframe-larger-than]

Replace the custom macros for initializing the attributes with a
simpler function call that does not run into this corner case.

Link: https://godbolt.org/z/Wf1Yx76a5
Fixes: 54076cb3b5ff ("hwmon (occ): Add sensor attributes and register hwmon device")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://lore.kernel.org/r/20250610092315.2640039-1-arnd@kernel.org
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>move asm/unaligned.h to linux/unaligned.h</title>
<updated>2024-10-02T21:23:23Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2024-10-01T19:35:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5f60d5f6bbc12e782fac78110b0ee62698f3b576'/>
<id>urn:sha1:5f60d5f6bbc12e782fac78110b0ee62698f3b576</id>
<content type='text'>
asm/unaligned.h is always an include of asm-generic/unaligned.h;
might as well move that thing to linux/unaligned.h and include
that - there's nothing arch-specific in that header.

auto-generated by the following:

for i in `git grep -l -w asm/unaligned.h`; do
	sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i
done
for i in `git grep -l -w asm-generic/unaligned.h`; do
	sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i
done
git mv include/asm-generic/unaligned.h include/linux/unaligned.h
git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h
sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild
sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
</content>
</entry>
<entry>
<title>hwmon: (occ) Check for device property for setting OCC active during probe</title>
<updated>2022-09-28T11:40:57Z</updated>
<author>
<name>Eddie James</name>
</author>
<published>2022-08-09T20:07:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89a286fb153643b9b0f6e78160857f86eef16ba5'/>
<id>urn:sha1:89a286fb153643b9b0f6e78160857f86eef16ba5</id>
<content type='text'>
A previous commit changed the existing behavior of the driver to skip
attempting to communicate with the OCC during probe. Return to the
previous default behavior of automatically communicating with the OCC
and make it optional with a new device-tree property.

Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Acked-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20220809200701.218059-4-eajames@linux.ibm.com
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) Replace open-coded variant of %*phN specifier</title>
<updated>2022-07-26T15:02:51Z</updated>
<author>
<name>Andy Shevchenko</name>
</author>
<published>2022-07-26T14:31:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=03009a605f2ae18c0cb77a78b329f79821a4c545'/>
<id>urn:sha1:03009a605f2ae18c0cb77a78b329f79821a4c545</id>
<content type='text'>
printf()-like functions in the kernel have extensions, such as
%*phN to dump small pieces of memory as hex bytes.

Replace custom approach with the direct use of %*phN.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220726143110.4809-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) Prevent power cap command overwriting poll response</title>
<updated>2022-06-29T20:59:23Z</updated>
<author>
<name>Eddie James</name>
</author>
<published>2022-06-28T20:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1bbb2809040a1f9c7c53c9f06c21aa83275ed27b'/>
<id>urn:sha1:1bbb2809040a1f9c7c53c9f06c21aa83275ed27b</id>
<content type='text'>
Currently, the response to the power cap command overwrites the
first eight bytes of the poll response, since the commands use
the same buffer. This means that user's get the wrong data between
the time of sending the power cap and the next poll response update.
Fix this by specifying a different buffer for the power cap command
response.

Fixes: 5b5513b88002 ("hwmon: Add On-Chip Controller (OCC) hwmon driver")
Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20220628203029.51747-1-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) Lock mutex in shutdown to prevent race with occ_active</title>
<updated>2022-06-07T12:45:42Z</updated>
<author>
<name>Eddie James</name>
</author>
<published>2022-06-06T18:54:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac6888ac5a11c0a47d1f1da4b7809c0c595fdc5d'/>
<id>urn:sha1:ac6888ac5a11c0a47d1f1da4b7809c0c595fdc5d</id>
<content type='text'>
Unbinding the driver or removing the parent device at the same time
as using the OCC active sysfs file can cause the driver to unregister
the hwmon device twice. Prevent this by locking the occ mutex in the
shutdown function.

Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20220606185455.21126-1-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) Delay hwmon registration until user request</title>
<updated>2022-05-20T17:57:06Z</updated>
<author>
<name>Eddie James</name>
</author>
<published>2022-04-27T14:04:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=849b0156d9960da628a06756bb920d9571c15e66'/>
<id>urn:sha1:849b0156d9960da628a06756bb920d9571c15e66</id>
<content type='text'>
Instead of registering the hwmon device at probe time, use the
existing "occ_active" sysfs file to control when the driver polls
the OCC for sensor data and registers with hwmon. The reason for
this change is that the SBE, which is the device by which the
driver communicates with the OCC, cannot handle communications
during certain system state transitions, resulting in
unrecoverable system errors.

Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20220427140443.11428-1-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (occ) Add soft minimum power cap attribute</title>
<updated>2022-02-28T01:03:19Z</updated>
<author>
<name>Eddie James</name>
</author>
<published>2022-02-15T15:10:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84dc9e8a7eec2cdff00728baedf0fb35fc7c11e8'/>
<id>urn:sha1:84dc9e8a7eec2cdff00728baedf0fb35fc7c11e8</id>
<content type='text'>
Export the power caps data for the soft minimum power cap through hwmon.

Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Reviewed-by: Joel Stanley &lt;joel@jms.id.au&gt;
Link: https://lore.kernel.org/r/20220215151022.7498-5-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
</feed>
