phosphor-hwmon refactoring proposal

Andrew Jeffery andrew at aj.id.au
Sat Oct 19 10:36:54 AEDT 2019



On Fri, 18 Oct 2019, at 22:44, Brad Bishop wrote:
> at 6:26 AM, Jeremy Kerr <jk at ozlabs.org> wrote:
> 
> > Hi Brad,
> >
> >> I have a quick phosphor-hwmon change proposal I’d like to get feedback
> >> on.
> >>
> >> One issue with phosphor-hwmon that has been brought up a couple times
> >> now  is that it gets its configuration settings from a file with a
> >> path in the  filesystem that mirrors the path to the hwmon device in
> >> the device tree.   This is problematic because the device tree path is
> >> not required to be  stable, so whenever things move around there, the
> >> config files all have to  be moved.
> >
> > Yep, sounds like we should find a better approach.
> >
> >> The proposal is simply to quit passing the configuration via the
> >> environment and instead look for a config file, the location specified
> >> via logic in the application, with a path like:
> >>
> >> /usr/share/phosphor-hwmon/i2c/2-004c.conf
> >>
> >> This is the path to the hwmon parent device relative to /sys/bus
> >
> > We want to ensure that any of those paths use persistent kernel
> > naming/numbering though. In your example, we would need that i2c bus to
> > be guaranteed to be probed as i2c bus id 2.
> >
> > There are facilities in place to ensure this happens, and as far as I
> > know we are currently using those, but we will need to ensure that stays
> > the case.
> 
> Can you elaborate a tiny bit on what the facilities are?  I just want to  
> convince myself we are in fact using those.

One is aliases in the devicetrees, e.g: 

https://github.com/openbmc/linux/blob/dev-5.3/arch/arm/boot/dts/aspeed-g5.dtsi#L11


More information about the openbmc mailing list