* Userspace matching of hwmon devices to hardware
@ 2019-03-25 8:21 ` Lei YU
0 siblings, 0 replies; 3+ messages in thread
From: Lei YU @ 2019-03-25 8:21 UTC (permalink / raw)
To: Hardware Monitoring, OpenBMC Maillist; +Cc: Guenter Roeck
This email is to ask/discuss if there is a stable path/name (or whatever) for
hwmon devices in the different versions of kernels.
In OpenBMC, the service phosphor-hwmon reads the sensors' value and expose to
DBus, depending on a configure file that matches the device tree path.
The service is started by udev rule, called with the DEVPATH and OF_FULLNAME,
so it knows where to find the configure file depending on DEVPATH or
OF_FULLNAME.
E.g. on Romulus BMC, the w83773 sensor has OF_FULLNAME at
/ahb/apb/i2c@1e78a000/i2c-bus@440/w83773g@4c,
and the service knows the config is matched from path
/etc/default/obmc/hwmon/ahb/apb/i2c@1e78a000/i2c-bus@440/w83773g@4c.conf
However, the DEVPATH or OF_FULLNAME is not stable in different kernels:
* In 4.1x kernel, the path is as above.
* In 5.0 kernel, "i2c@1e78a000" is changed to "bus@1e78a000" in the path.
This breaks the userspace's phosphor-hwmon.
If we fix the issue by updating the configure files' path in userspace, it
means the userspace only with the new 5.x kernel.
So the question here is, it there a stable way for userspace to match a hwmon
device?
Thanks!
--
BRs,
Lei YU
^ permalink raw reply [flat|nested] 3+ messages in thread
* Userspace matching of hwmon devices to hardware
@ 2019-03-25 8:21 ` Lei YU
0 siblings, 0 replies; 3+ messages in thread
From: Lei YU @ 2019-03-25 8:21 UTC (permalink / raw)
To: Hardware Monitoring, OpenBMC Maillist; +Cc: Guenter Roeck
This email is to ask/discuss if there is a stable path/name (or whatever) for
hwmon devices in the different versions of kernels.
In OpenBMC, the service phosphor-hwmon reads the sensors' value and expose to
DBus, depending on a configure file that matches the device tree path.
The service is started by udev rule, called with the DEVPATH and OF_FULLNAME,
so it knows where to find the configure file depending on DEVPATH or
OF_FULLNAME.
E.g. on Romulus BMC, the w83773 sensor has OF_FULLNAME at
/ahb/apb/i2c@1e78a000/i2c-bus@440/w83773g@4c,
and the service knows the config is matched from path
/etc/default/obmc/hwmon/ahb/apb/i2c@1e78a000/i2c-bus@440/w83773g@4c.conf
However, the DEVPATH or OF_FULLNAME is not stable in different kernels:
* In 4.1x kernel, the path is as above.
* In 5.0 kernel, "i2c@1e78a000" is changed to "bus@1e78a000" in the path.
This breaks the userspace's phosphor-hwmon.
If we fix the issue by updating the configure files' path in userspace, it
means the userspace only with the new 5.x kernel.
So the question here is, it there a stable way for userspace to match a hwmon
device?
Thanks!
--
BRs,
Lei YU
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Userspace matching of hwmon devices to hardware
2019-03-25 8:21 ` Lei YU
(?)
@ 2019-03-25 10:43 ` Guenter Roeck
-1 siblings, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2019-03-25 10:43 UTC (permalink / raw)
To: Lei YU, Hardware Monitoring, OpenBMC Maillist, Jean Delvare
On 3/25/19 1:21 AM, Lei YU wrote:
> This email is to ask/discuss if there is a stable path/name (or whatever) for
> hwmon devices in the different versions of kernels.
>
> In OpenBMC, the service phosphor-hwmon reads the sensors' value and expose to
> DBus, depending on a configure file that matches the device tree path.
>
> The service is started by udev rule, called with the DEVPATH and OF_FULLNAME,
> so it knows where to find the configure file depending on DEVPATH or
> OF_FULLNAME.
>
> E.g. on Romulus BMC, the w83773 sensor has OF_FULLNAME at
> /ahb/apb/i2c@1e78a000/i2c-bus@440/w83773g@4c,
> and the service knows the config is matched from path
> /etc/default/obmc/hwmon/ahb/apb/i2c@1e78a000/i2c-bus@440/w83773g@4c.conf
>
> However, the DEVPATH or OF_FULLNAME is not stable in different kernels:
> * In 4.1x kernel, the path is as above.
> * In 5.0 kernel, "i2c@1e78a000" is changed to "bus@1e78a000" in the path.
>
This is due to a devicetree source change with commit 1426d40e11f73 ("ARM: dts:
aspeed: Fix I2C bus warnings"). In general you can not assume that devicetree
files (or path names derived from devicetree source files) stay the same across
kernel releases.
> This breaks the userspace's phosphor-hwmon.
> If we fix the issue by updating the configure files' path in userspace, it
> means the userspace only with the new 5.x kernel.
>
> So the question here is, it there a stable way for userspace to match a hwmon
> device?
>
libsensors should handle it for you, but I don't immediately know how to map
that into udev rules. Jean, any idea ?
Guenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-25 10:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25 8:21 Userspace matching of hwmon devices to hardware Lei YU
2019-03-25 8:21 ` Lei YU
2019-03-25 10:43 ` Guenter Roeck
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.