All of lore.kernel.org
 help / color / mirror / Atom feed
* FruDevice/Entity Manager vs hwmon
@ 2021-05-29 19:13 Mahesh Kurapati
  2021-05-29 21:16 ` Andrei Kartashev
  2021-06-02 15:26 ` Ed Tanous
  0 siblings, 2 replies; 5+ messages in thread
From: Mahesh Kurapati @ 2021-05-29 19:13 UTC (permalink / raw)
  To: openbmc

[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]

Hello,

I want to define temperature sensors, fans and PSUs for our new platform.  Going through the documentation and sources,  I understand that there are two approaches.  One is to define them with the same i2c path as mentioned in the device tree as part of the hwmon configuration, and the other approach is to define a json file with appropriate probe in the entity-manager/configurations folder so that the FruDevice and Entity Manager apps detect the devices as per the probe and create the matching dbus objects, while the dbus-sensors do the instrumentation.  With entity manager approach I understand that the i2c devices are created/probed when they are detected.  My questions is we don't need the device defined in the device tree file if I go by this approach? I understand that this helps the dynamic detection of the FRU.  Also we have LM73, and other temp sensor TMP431c that is not defined in the FruDevice record map.  Next question is do I need to add support for the LM73 tmp75MP431C and other one in the FruDevice so that it gets created properly? Can I use any existing strings/mapping for these sensors?  This is not needed if I define the entries in the device tree, and integrate with hwmon I have everything needed.  I see that hwmon and FruDevice/Entity Manager/dbus-sensors provide similar functionality.  Can I have both of these services running at the same time on the BMC? Will it cause any conflicts?  Please help me understand.

Thank you,
Mahesh

[-- Attachment #2: Type: text/html, Size: 3199 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FruDevice/Entity Manager vs hwmon
  2021-05-29 19:13 FruDevice/Entity Manager vs hwmon Mahesh Kurapati
@ 2021-05-29 21:16 ` Andrei Kartashev
  2021-06-03 14:47   ` Mahesh Kurapati
  2021-06-02 15:26 ` Ed Tanous
  1 sibling, 1 reply; 5+ messages in thread
From: Andrei Kartashev @ 2021-05-29 21:16 UTC (permalink / raw)
  To: Mahesh Kurapati, openbmc

Hi Mahesh,

You right that using EM+dbus-sensors you can dynamically add sensors
when they are detected. But it seems you have kind of misunderstanding
about FruDevice. Let me explain a bit: 

EM is kind of "configuration manager". Main function of EM is to listen
dbus and match appearing of some resources. In reaction of this matches
EM exposes to dbus some other resources with configuration which used
by other daemons. Additionally to this, EM can instantiate devices
(send new_device command to kernel driver).
EM itself can only detect dbus entities and there are "detection 
daemons" to tell EM that there is some hardware available. FruDevice is
one of this "detection  daemons" which scans I2C bus looking for
EEPROMs with IPMI FRU data. That is how you detect baseboard, PSUs and
units, but is you sensors don't have FRU, you need to implement other
detection mechanism.
Typically you have y sensors mounted on baseboard, so you need to
describe them in EM config, not in FruDevice.
Note that using EM doesn't exclude defining sensors in device tree -
you still can do this if you want.
For list of supported devices, that can be instantiated by EM, see
https://github.com/openbmc/entity-manager/blob/master/include/devices.hpp#L48


On Sat, 2021-05-29 at 19:13 +0000, Mahesh Kurapati wrote:
> Hello, 
>  
> I want to define temperature sensors, fans and PSUs for our new
> platform.  Going through the documentation and sources,  I understand
> that there are two approaches.  One is to define them with the same i2c
> path as mentioned in the device tree as part of the hwmon
> configuration, and the other approach is to define a json file with
> appropriate probe in the entity-manager/configurations folder so that
> the FruDevice and Entity Manager apps detect the devices as per the
> probe and create the matching dbus objects, while the dbus-sensors do
> the instrumentation.  With entity manager approach I understand that
> the i2c devices are created/probed when they are detected.  My
> questions is we don’t need the device defined in the device tree file
> if I go by this approach? I understand that this helps the dynamic
> detection of the FRU.  Also we have LM73, and other temp sensor TMP431c
> that is not defined in the FruDevice record map.  Next question is do I
> need to add support for the LM73 tmp75MP431C and other one in the
> FruDevice so that it gets created properly? Can I use any existing
> strings/mapping for these sensors?  This is not needed if I define the
> entries in the device tree, and integrate with hwmon I have everything
> needed.  I see that hwmon and FruDevice/Entity Manager/dbus-sensors
> provide similar functionality.  Can I have both of these services
> running at the same time on the BMC? Will it cause any conflicts?
>  Please help me understand.
>  
> Thank you, 
> Mahesh

-- 
Best regards,
Andrei Kartashev



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FruDevice/Entity Manager vs hwmon
  2021-05-29 19:13 FruDevice/Entity Manager vs hwmon Mahesh Kurapati
  2021-05-29 21:16 ` Andrei Kartashev
@ 2021-06-02 15:26 ` Ed Tanous
  2021-06-03 14:44   ` Mahesh Kurapati
  1 sibling, 1 reply; 5+ messages in thread
From: Ed Tanous @ 2021-06-02 15:26 UTC (permalink / raw)
  To: Mahesh Kurapati; +Cc: openbmc

On Sat, May 29, 2021 at 12:42 PM Mahesh Kurapati
<mahesh.kurapati@keysight.com> wrote:
>
> Hello,
>
>
>
> I want to define temperature sensors, fans and PSUs for our new platform.  Going through the documentation and sources,  I understand that there are two approaches.  One is to define them with the same i2c path as mentioned in the device tree as part of the hwmon configuration, and the other approach is to define a json file with appropriate probe in the entity-manager/configurations folder so that the FruDevice and Entity Manager apps detect the devices as per the probe and create the matching dbus objects, while the dbus-sensors do the instrumentation.  With entity manager approach I understand that the i2c devices are created/probed when they are detected.  My questions is we don’t need the device defined in the device tree file if I go by this approach?

Correct, although you can still include them if you like.
Entity-manager relies on the new_device sysfs interface to create
devices as they're found.  In the past we've used runtime-generated
device tree overlays to accomplish the same thing (something I'd like
to see us get back to, but that's a different story).

> I understand that this helps the dynamic detection of the FRU.  Also we have LM73, and other temp sensor TMP431c that is not defined in the FruDevice record map.

What record map are you referring to?  So far as I'm aware, those
devices would exist in hwmontempsensor, not fru device.  TMP73 and
TMP431c could be added if they have linux driver implementations.

>  Next question is do I need to add support for the LM73 tmp75MP431C and other one in the FruDevice so that it gets created properly? Can I use any existing strings/mapping for these sensors?

I'm not following.  What "mappings" are you referring to?

>  This is not needed if I define the entries in the device tree, and integrate with hwmon I have everything needed.  I see that hwmon and FruDevice/Entity Manager/dbus-sensors provide similar functionality.  Can I have both of these services running at the same time on the BMC?

Hypothetically you can, but it's a bit messy, and I would recommend against it.

> Will it cause any conflicts?  Please help me understand.
>
>
>
> Thank you,
>
> Mahesh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: FruDevice/Entity Manager vs hwmon
  2021-06-02 15:26 ` Ed Tanous
@ 2021-06-03 14:44   ` Mahesh Kurapati
  0 siblings, 0 replies; 5+ messages in thread
From: Mahesh Kurapati @ 2021-06-03 14:44 UTC (permalink / raw)
  To: Ed Tanous; +Cc: openbmc

Thank you Ed, and 

Please see inline. 

Mahesh

-----Original Message-----
From: Ed Tanous <edtanous@google.com> 
Sent: Wednesday, June 2, 2021 10:27 AM
To: Mahesh Kurapati <mahesh.kurapati@keysight.com>
Cc: openbmc@lists.ozlabs.org
Subject: Re: FruDevice/Entity Manager vs hwmon

On Sat, May 29, 2021 at 12:42 PM Mahesh Kurapati <mahesh.kurapati@keysight.com> wrote:
>
> Hello,
>
>
>
> I want to define temperature sensors, fans and PSUs for our new platform.  Going through the documentation and sources,  I understand that there are two approaches.  One is to define them with the same i2c path as mentioned in the device tree as part of the hwmon configuration, and the other approach is to define a json file with appropriate probe in the entity-manager/configurations folder so that the FruDevice and Entity Manager apps detect the devices as per the probe and create the matching dbus objects, while the dbus-sensors do the instrumentation.  With entity manager approach I understand that the i2c devices are created/probed when they are detected.  My questions is we don’t need the device defined in the device tree file if I go by this approach?

Correct, although you can still include them if you like.
Entity-manager relies on the new_device sysfs interface to create devices as they're found.  In the past we've used runtime-generated device tree overlays to accomplish the same thing (something I'd like to see us get back to, but that's a different story).
[Mahesh]: Got it. Thank you. 

> I understand that this helps the dynamic detection of the FRU.  Also we have LM73, and other temp sensor TMP431c that is not defined in the FruDevice record map.

What record map are you referring to?  So far as I'm aware, those devices would exist in hwmontempsensor, not fru device.  TMP73 and TMP431c could be added if they have linux driver implementations.
[Mahesh]: I am referring to the new_device mapping described in the following link that Andrew had pointed out. 

>  Next question is do I need to add support for the LM73 tmp75MP431C and other one in the FruDevice so that it gets created properly? Can I use any existing strings/mapping for these sensors?

I'm not following.  What "mappings" are you referring to?
[Mahesh]: I am referring to the string mentioned in the "Exposes" section of the configurations/*.json file to the new_device string to be used to instantiate/bind the device with Linux kernel. 

>  This is not needed if I define the entries in the device tree, and integrate with hwmon I have everything needed.  I see that hwmon and FruDevice/Entity Manager/dbus-sensors provide similar functionality.  Can I have both of these services running at the same time on the BMC?

Hypothetically you can, but it's a bit messy, and I would recommend against it.
[Mahesh]: OK.  Thank you for the input.  I will have either the phosphor-hwmon/Entity Manager.  On our system we only have the PSUs and the fan rotors  are the FRUs.  Nothing else.  If there are no lot of FRUs, I think it is better go with the phosphor-hwmon approach to integrate the sensors.  This way I don’t have to write any new code to support the new temp sensors. 

> Will it cause any conflicts?  Please help me understand.
>
>
>
> Thank you,
>
> Mahesh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: FruDevice/Entity Manager vs hwmon
  2021-05-29 21:16 ` Andrei Kartashev
@ 2021-06-03 14:47   ` Mahesh Kurapati
  0 siblings, 0 replies; 5+ messages in thread
From: Mahesh Kurapati @ 2021-06-03 14:47 UTC (permalink / raw)
  To: Andrei Kartashev, openbmc

Hello Andrei, 

Thank you for the explanation. I understood that I need to describe sensors in the json EM configuration file of the FRU, not in the FruDevice.  

Mahesh

-----Original Message-----
From: Andrei Kartashev <a.kartashev@yadro.com> 
Sent: Saturday, May 29, 2021 4:17 PM
To: Mahesh Kurapati <mahesh.kurapati@keysight.com>; openbmc@lists.ozlabs.org
Subject: Re: FruDevice/Entity Manager vs hwmon

CAUTION: This message originates from an external sender.

Hi Mahesh,

You right that using EM+dbus-sensors you can dynamically add sensors when they are detected. But it seems you have kind of misunderstanding about FruDevice. Let me explain a bit:

EM is kind of "configuration manager". Main function of EM is to listen dbus and match appearing of some resources. In reaction of this matches EM exposes to dbus some other resources with configuration which used by other daemons. Additionally to this, EM can instantiate devices (send new_device command to kernel driver).
EM itself can only detect dbus entities and there are "detection daemons" to tell EM that there is some hardware available. FruDevice is one of this "detection  daemons" which scans I2C bus looking for EEPROMs with IPMI FRU data. That is how you detect baseboard, PSUs and units, but is you sensors don't have FRU, you need to implement other detection mechanism.
Typically you have y sensors mounted on baseboard, so you need to describe them in EM config, not in FruDevice.
Note that using EM doesn't exclude defining sensors in device tree - you still can do this if you want.
For list of supported devices, that can be instantiated by EM, see https://urldefense.com/v3/__https://github.com/openbmc/entity-manager/blob/master/include/devices.hpp*L48__;Iw!!I5pVk4LIGAfnvw!0W9qs8gwqwRyjBfcUeIC-Vg_gsK6dtPqW0Wpcwi7cQS4MKayMzu9oliojaXhTsVvJdbROw$


On Sat, 2021-05-29 at 19:13 +0000, Mahesh Kurapati wrote:
> Hello,
>
> I want to define temperature sensors, fans and PSUs for our new 
> platform.  Going through the documentation and sources,  I understand 
> that there are two approaches.  One is to define them with the same 
> i2c path as mentioned in the device tree as part of the hwmon 
> configuration, and the other approach is to define a json file with 
> appropriate probe in the entity-manager/configurations folder so that 
> the FruDevice and Entity Manager apps detect the devices as per the 
> probe and create the matching dbus objects, while the dbus-sensors do 
> the instrumentation.  With entity manager approach I understand that 
> the i2c devices are created/probed when they are detected.  My 
> questions is we don’t need the device defined in the device tree file 
> if I go by this approach? I understand that this helps the dynamic 
> detection of the FRU.  Also we have LM73, and other temp sensor 
> TMP431c that is not defined in the FruDevice record map.  Next 
> question is do I need to add support for the LM73 tmp75MP431C and 
> other one in the FruDevice so that it gets created properly? Can I use 
> any existing strings/mapping for these sensors?  This is not needed if 
> I define the entries in the device tree, and integrate with hwmon I 
> have everything needed.  I see that hwmon and FruDevice/Entity 
> Manager/dbus-sensors provide similar functionality.  Can I have both 
> of these services running at the same time on the BMC? Will it cause any conflicts?
>  Please help me understand.
>
> Thank you,
> Mahesh

--
Best regards,
Andrei Kartashev



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-03 14:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-29 19:13 FruDevice/Entity Manager vs hwmon Mahesh Kurapati
2021-05-29 21:16 ` Andrei Kartashev
2021-06-03 14:47   ` Mahesh Kurapati
2021-06-02 15:26 ` Ed Tanous
2021-06-03 14:44   ` Mahesh Kurapati

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.