Re: [PATCH 3/3] hwmon: (coretemp) Use a model-specific bitmask to read registers

From: Guenter Roeck
Date: Mon Apr 08 2024 - 07:40:28 EST


On Sun, Apr 07, 2024 at 08:39:51AM +0000, Zhang, Rui wrote:
> > I do not think it is appropriate to make a hardware monitoring driver
> > depend on the thermal subsystem.
> >
> > NAK in the current form.
> >
> Hi, Guenter,
>
> Thanks for reviewing.
>
> We've seen a couple of hwmon drivers depends on or imply THERMAL.
> That's why we think this is an applicable solution.

So far this was - unless someone sneaked something by - for drivers
which registered thermal zones, not for calling code which resides
inside thermal subsystem.

> Using the intel_tcc APIs can effectively reduce the future maintenance
> burden because we don't need to duplicate the model list in multiple
> places.
>
> or do you have any suggestions?

The exported code should reside outside the thermal subsystem.

Also, as implemented, if INTEL_TCC=n, the returned temperature mask value
is 0x7f, and the offset mask is 0. So the alternative would be to just use
those values unconditionally since apparently that is sufficient.

Thanks,
Guenter