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

Shilpasri G Bhat shilpa.bhat at linux.vnet.ibm.com
Fri Nov 24 17:58:51 AEDT 2017


Hi,

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 and Regards,
Shilpa

> 
>>
>> --
>> 1.8.3.1
>>
>> _______________________________________________
>> Skiboot mailing list
>> Skiboot at lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/skiboot
> 



More information about the Skiboot mailing list