621995b6 | 25-Jul-2023 |
Patrick Rudolph <patrick.rudolph@9elements.com> |
hwmon: (peci/dimmtemp) Add Sapphire Rapids support
Extend the functionality of hwmon (peci/dimmtemp) for Sapphire Rapids platform.
Add the corresponding Sapphire Rapids ID and threshold code.
The
hwmon: (peci/dimmtemp) Add Sapphire Rapids support
Extend the functionality of hwmon (peci/dimmtemp) for Sapphire Rapids platform.
Add the corresponding Sapphire Rapids ID and threshold code.
The patch has been tested on a 4S system with 64 DIMMs installed. Verified read of DIMM temperature thresholds & temperature.
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com> Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> Link: https://lore.kernel.org/r/20230725104354.33920-3-Naresh.Solanki@9elements.com
show more ...
|
9baabde0 | 17-May-2022 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (dimmtemp) Fix bitmap handling
Building arm:allmodconfig may fail with the following error.
In function 'fortify_memcpy_chk', inlined from 'bitmap_copy' at include/linux/bitmap.h:261:2,
hwmon: (dimmtemp) Fix bitmap handling
Building arm:allmodconfig may fail with the following error.
In function 'fortify_memcpy_chk', inlined from 'bitmap_copy' at include/linux/bitmap.h:261:2, inlined from 'bitmap_copy_clear_tail' at include/linux/bitmap.h:270:2, inlined from 'bitmap_from_u64' at include/linux/bitmap.h:622:2, inlined from 'check_populated_dimms' at drivers/hwmon/peci/dimmtemp.c:284:2: include/linux/fortify-string.h:344:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter)
The problematic code is bitmap_from_u64(priv->dimm_mask, dimm_mask);
dimm_mask is declared as u64, but the bitmap in priv->dimm_mask is only 24 bit wide. On 32-bit systems, this results in writes over the end of the bitmap.
Fix the problem by using u32 instead of u64 for dimm_mask. This is currently sufficient, and a compile time check to ensure that the number of dimms does not exceed the bit map size is already in place.
Fixes: 73bc1b885dae ("hwmon: peci: Add dimmtemp driver") Cc: Iwona Winiarska <iwona.winiarska@intel.com> Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
7c399d6a | 12-May-2022 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (peci/dimmtemp) Use HWMON_CHANNEL_INFO macro
The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read.
The conversion was done au
hwmon: (peci/dimmtemp) Use HWMON_CHANNEL_INFO macro
The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read.
The conversion was done automatically with coccinelle. The semantic patch used to make this change is as follows.
@s@ identifier i,j,ty; @@
-struct hwmon_channel_info j = { - .type = ty, - .config = i, -};
@r@ initializer list elements; identifier s.i; @@
-u32 i[] = { - elements, - 0 -};
@script:ocaml t@ ty << s.ty; elements << r.elements; shorter; elems; @@
shorter := make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty))); elems := make_ident (String.concat "," (List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x) (Str.split (Str.regexp " , ") elements)))
@@ identifier s.j,t.shorter; identifier t.elems; @@
- &j + HWMON_CHANNEL_INFO(shorter,elems)
This patch does not introduce functional changes. Many thanks to Julia Lawall for providing the coccinelle script.
Cc: Iwona Winiarska <iwona.winiarska@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
09e02c8e | 12-May-2022 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (peci/cputemp) Use HWMON_CHANNEL_INFO macro
The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read.
The conversion was done aut
hwmon: (peci/cputemp) Use HWMON_CHANNEL_INFO macro
The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read.
The conversion was done automatically with coccinelle. The semantic patch used to make this change is as follows.
@s@ identifier i,j,ty; @@
-struct hwmon_channel_info j = { - .type = ty, - .config = i, -};
@r@ initializer list elements; identifier s.i; @@
-u32 i[] = { - elements, - 0 -};
@script:ocaml t@ ty << s.ty; elements << r.elements; shorter; elems; @@
shorter := make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty))); elems := make_ident (String.concat "," (List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x) (Str.split (Str.regexp " , ") elements)))
@@ identifier s.j,t.shorter; identifier t.elems; @@
- &j + HWMON_CHANNEL_INFO(shorter,elems)
This patch does not introduce functional changes. Many thanks to Julia Lawall for providing the coccinelle script.
Cc: Iwona Winiarska <iwona.winiarska@intel.com> Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
73bc1b88 | 08-Feb-2022 |
Iwona Winiarska <iwona.winiarska@intel.com> |
hwmon: peci: Add dimmtemp driver
Add peci-dimmtemp driver for Temperature Sensor on DIMM readings that are accessible via the processor PECI interface.
The main use case for the driver (and PECI in
hwmon: peci: Add dimmtemp driver
Add peci-dimmtemp driver for Temperature Sensor on DIMM readings that are accessible via the processor PECI interface.
The main use case for the driver (and PECI interface) is out-of-band management, where we're able to obtain thermal readings from an external entity connected with PECI, e.g. BMC on server platforms.
Co-developed-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> Link: https://lore.kernel.org/r/20220208153639.255278-12-iwona.winiarska@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|