[Skiboot] [PATCH] powercap: occ: Fix the powercapping range allowed for user

Stewart Smith stewart at linux.ibm.com
Thu Sep 27 21:18:54 AEST 2018


Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com> writes:
> OCC provides two levels of minimum powercap which are hard min
> powercap and soft min powercap. Soft min powercap is lower than the
> hard min powercap and users should be allowed to request till this
> limit.
>
> CC: stable # v5.8+
> Fixes: c6aabe3f2eb5("powercap: occ: Add a generic powercap framework")
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com>
> ---
>  hw/occ.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)

This seems related to https://github.com/open-power/skiboot/issues/195
and should possibly have a Fixes: associated with it.

I made some improvements to the op-test testcase (now upstream
https://github.com/open-power/op-test-framework/blob/adeaa20/testcases/OpalSysfsTests.py#L107
)

and stock upstream on a DD2.1 witherspoon gets:
======================================================================
FAIL [114.099s]: test_opal_powercap (testcases.OpalSysfsTests.Skiroot)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stewart/op-test-framework/testcases/OpalSysfsTests.py", line 120, in test_opal_powercap
    self.set_power_cap(min_powercap)
  File "/home/stewart/op-test-framework/testcases/OpalSysfsTests.py", line 98, in set_power_cap
    repr(valid_powercap_values)))
AssertionError: Retrieved powercap was not either the previous one (3050) or the one we're trying
 to set (1700). Got 1550, expected in [3050, 1700]

----------------------------------------------------------------------
Ran 1 test in 114.099s

and then, if you run it again without an IPL:

======================================================================
FAIL [58.049s]: test_opal_powercap (testcases.OpalSysfsTests.Skiroot)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stewart/op-test-framework/testcases/OpalSysfsTests.py", line 119, in test_opal_powercap
    self.set_power_cap(max_powercap)
  File "/home/stewart/op-test-framework/testcases/OpalSysfsTests.py", line 105, in set_power_cap
    cur_powercap, value))
AssertionError: OPAL failed to set power cap value. Got 1550 when trying to set 3050.

----------------------------------------------------------------------
Ran 1 test in 58.049s

Which all looks pretty suspicious, as in - something is fundamentally
broken here.

I'm not convinced that this patch is the correct way to go, as it
changes current semantics. As such, I don't think I want to take as-is,
especially as after it there's no way to work out what the hard minimum
is.

I think the correct solution here is going to be twofold:

  1. add a soft min powercap to the device tree bindings.
  2. add support for this to the kernel.

and I'd be happy to take that kind of patch.


-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list