[PATCH linux dev-4.10 v3 4/5] Documentation: ABI: Add IBM power supply sysfs documentation

Andrew Jeffery andrew at aj.id.au
Fri Aug 4 09:52:14 AEST 2017


On Thu, 2017-08-03 at 10:42 -0500, Matt Spinler wrote:
> 
> On 8/2/2017 3:25 PM, Eddie James wrote:
> > > > From: "Edward A. James" <eajames at us.ibm.com>
> > 
> > > > Signed-off-by: Edward A. James <eajames at us.ibm.com>
> > ---
> >   Documentation/ABI/testing/sysfs-driver-ibmps | 49 ++++++++++++++++++++++++++++
> >   1 file changed, 49 insertions(+)
> >   create mode 100644 Documentation/ABI/testing/sysfs-driver-ibmps
> > 
> > diff --git a/Documentation/ABI/testing/sysfs-driver-ibmps b/Documentation/ABI/testing/sysfs-driver-ibmps
> > new file mode 100644
> > index 0000000..1645685
> > --- /dev/null
> > +++ b/Documentation/ABI/testing/sysfs-driver-ibmps
> > @@ -0,0 +1,49 @@
> > > > +What:		/sys/bus/i2c/devices/<dev>/clear_faults
> > > > +KernelVersion:	4.13
> > +Contact:	eajames at us.ibm.com
> > > > +Description:	Clears pmbus faults for this power supply.
> > +
> > > > +What:		/sys/bus/i2c/devices/<dev>/status_word
> > > > +KernelVersion:	4.13
> > +Contact:	eajames at us.ibm.com
> > +Description:	Displays the STATUS_WORD register.
> 
> Hey Chris,  I think you did some research and found that upstream 
> wouldn't allow capturing full registers like this?  Was that the case?  
> Or does it not matter as long as it isn't in hwmon?

This is a PMBus device, so it should be implemented in terms of the
PMBus subsystem. I expect this approach will be shot down by the
hwmon/pmbus maintainer.

Given the STATUS_BYTE/STATUS_WORD registers are the root of a fault
tree, another approach is to ignore the tree and focus on the leaves,
which is the PMBus subsystem's approach:

https://github.com/openbmc/linux/blob/dev-4.10/drivers/hwmon/pmbus/pmbus_core.c#L1245

This continues down to line 1700.

Now, for several of the bits STATUS_WORD is the leaf node. Using
STATUS_WORD as a reference, as STATUS_BYTE is STATUS_WORD's lower byte,
STATUS_WORD is a leaf for the following bits:

* Bit 0: None of the above
* Bit 6: Unit is off
* Bit 7: Unit was busy
* Bit 8: Unknown fault or warning
* Bit 11: Power Good negated

Currently none of these bits are exposed by pmbus core, so that would
need to be rectified, but in-line with the approach used above. I
recommend getting in touch with Guenter on his preferred approach.

> 
> > +
> > > > +What:		/sys/bus/i2c/devices/<dev>/status_vout
> > > > +KernelVersion:	4.13
> > +Contact:	eajames at us.ibm.com
> > > > +Description:	Displays the STATUS_VOUT register.
> > +
> > > > +What:		/sys/bus/i2c/devices/<dev>/status_iout
> > > > +KernelVersion:	4.13
> > +Contact:	eajames at us.ibm.com
> > > > +Description:	Displays the STATUS_IOUT register.
> > +
> > > > +What:		/sys/bus/i2c/devices/<dev>/status_input
> > > > +KernelVersion:	4.13
> > +Contact:	eajames at us.ibm.com
> > > > +Description:	Displays the STATUS_INPUT register.
> > +
> > > > +What:		/sys/bus/i2c/devices/<dev>/status_temp
> > > > +KernelVersion:	4.13
> > +Contact:	eajames at us.ibm.com
> > > > +Description:	Displays the STATUS_TEMPERATURE register.
> > +
> > > > +What:		/sys/bus/i2c/devices/<dev>/status_cml
> > > > +KernelVersion:	4.13
> > +Contact:	eajames at us.ibm.com
> > > > +Description:	Displays the STATUS_CML register.
> > +
> > > > +What:		/sys/bus/i2c/devices/<dev>/status_other
> > > > +KernelVersion:	4.13
> > +Contact:	eajames at us.ibm.com
> > > > +Description:	Displays the STATUS_OTHER register.
> > +
> > > > +What:		/sys/bus/i2c/devices/<dev>/status_mfr
> > > > +KernelVersion:	4.13
> > +Contact:	eajames at us.ibm.com
> > > > +Description:	Displays the STATUS_MFR_SPECIFIC register.
> > +
> > > > +What:		/sys/bus/i2c/devices/<dev>/status_fan
> > > > +KernelVersion:	4.13
> > +Contact:	eajames at us.ibm.com
> > +Description:	Displays the STATUS_FAN register.

See my comment above. This will get a prickly response if sent
upstream.

Andrew

> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20170804/33af7100/attachment.sig>


More information about the openbmc mailing list