New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
skeleton: fixed hard-coding of master OCC hwmon sysfs path for PowerCap object #50
Conversation
b1d281e
to
ba1c01e
Compare
I will submit a new PR today based on Brad's review. Please hold a minute. |
96dfd7c
to
53b7152
Compare
I've replied on-list with some comments - this was prior to reviewable.io being hooked up. Probably best to reply on-list? Reviewed 2 of 2 files at r1. Comments from the review on Reviewable.io |
Should we be searching for the power cap attribute or can we know where it is? Is the location of the Master OCC with the power cap fixed by the Should we be storing the user set value to apply on the next boot? If Review status: all files reviewed at latest revision, 4 unresolved discussions, all commit checks successful. bin/Sensors.py, line 165 [r1] (raw file): bin/Sensors.py, line 184 [r1] (raw file): bin/Sensors.py, line 191 [r1] (raw file): bin/Sensors.py, line 206 [r1] (raw file): This seems hard coded to assume the one instance of a power cap Can we express the expected location in the sensor config? Comments from the review on Reviewable.io |
Thanks for the comments. The reason for searching HWMON attribute path each time the "PowerCap::setValue()" is called is that, I just learned in an OCC training, that "set User Power cap" needs to handle the cases, when:
Review status: 1 of 2 files reviewed at latest revision, 4 unresolved discussions. bin/Sensors.py, line 165 [r1] (raw file): The rest server returns error code to rest caller, by catching exception from dbus method.
" bin/Sensors.py, line 206 [r1] (raw file): Comments from the review on Reviewable.io |
…ap object Currently master OCC hwmon sysfs path is hardcoded to '/sys/class/hwmon/hwmon3/'. This make the '/org/openbmc/sensors/host/PowerCap' interface cannot work when master OCC is initilized as hwmon device other than 'hwmon3'. 'usr_powercap' attribute should be searched when OCC is active. When skeleton creates 'PowerCap' objects, OCC may not be active. So do the search each time setting power cap. Raise an exception when there is no 'user_powercap' attribute. Fixes: openbmc#42 Also raise an exception when setting power cap fails. The exception will be returned to REST API caller. Need to specify the exception name to trigger a '400' return code. Fixes: openbmc#43 Add code to validate input user powercap value. Changed the logic of "reading powercap" using PowerCap.getValue(). Previously PowerCap.getValue() returns current user set powercap value. Now PowerCap.getValue() returns actual system powercap reading from OCC. Signed-off-by: Yi Li <adamliyi@msn.com>
I just updated the PR, removed the hard-coded "3-0050" i2c device address. It is not necessary, since only master occ has these power cap related sensors, and there is only one master occ in a system. |
Reviewed 1 of 1 files at r2. Comments from Reviewable |
The current search seems ok as long as we don't need to support multiple p8 machines from one bmc. |
Please submit through Gerrit if needed. |
Currently master OCC hwmon sysfs path is hardcoded to '/sys/class/hwmon/hwmon3/'.
This make the '/org/openbmc/sensors/host/PowerCap' interface cannot work when
master OCC is initilized as hwmon device other than 'hwmon3'.
'usr_powercap' attribute should be searched when OCC is active.
When skeleton creates 'PowerCap' objects, OCC may not be active.
So do the search each time setting power cap. Raise an exception when
there is no 'user_powercap' attribute.
This would fix the issue: #42
Also raise an exception when setting power cap fails. The exception
will be returned to REST API caller. This would fix the issue:
#43
Signed-off-by: Yi Li adamliyi@msn.com
This change is