[Skiboot] [PATCH] sensors: occ: Skip counter type of sensors

Stewart Smith stewart at linux.vnet.ibm.com
Thu Dec 14 15:47:52 AEDT 2017


Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com> writes:
> On 11/24/2017 10:42 AM, Oliver wrote:
>> On Thu, Oct 19, 2017 at 6:08 PM, Shilpasri G Bhat
>> <shilpa.bhat at linux.vnet.ibm.com> wrote:
>>> Don't add counter type of sensors to device-tree as they don't
>>> fit into hwmon sensor interface.
>>>
>>> Signed-off-by: Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com>
>>> ---
>>>  hw/occ-sensor.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/hw/occ-sensor.c b/hw/occ-sensor.c
>>> index 1042c11..3de91a0 100644
>>> --- a/hw/occ-sensor.c
>>> +++ b/hw/occ-sensor.c
>>> @@ -591,6 +591,9 @@ void occ_sensors_init(void)
>>>                         struct cpu_thread *c = NULL;
>>>                         u32 handler;
>>>
>>> +                       if (md[i].structure_type != OCC_SENSOR_READING_FULL)
>>> +                               continue;
>>> +
>>>                         if (!(md[i].type & HWMON_SENSORS_MASK))
>>>                                 continue;
>> 
>> You might be better off filtering these based on the unit in the name
>> block rather than the type.
>
>
> The unit of a sensor is of type string. OCC does not guarantee backward
> compatibility with name, unit and number of sensors. The unit of counter sensors
> is "#" today. So I am suggesting it would be better to use the type of the
> sensor record itself to filter out counter type of sensors.
>
> OCC_SENSOR_READING_FULL         = 0x01,
> OCC_SENSOR_READING_COUNTER      = 0x02,


Thanks for the discussion, makes sense now.

Merged to master as of 275efcc44fdad3572e6180f625d356c8b7cca68d
and 5.9.x as of 87043c358b7b53693c89113b483cd702616ee994

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list