All of lore.kernel.org
 help / color / mirror / Atom feed
* hwmon: question about the sysfs interface
@ 2014-07-14 16:47 ` Gianni Vialetto
  0 siblings, 0 replies; 10+ messages in thread
From: Gianni Vialetto @ 2014-07-14 16:47 UTC (permalink / raw)
  To: lm-sensors; +Cc: gianni, nouveau

Hello guys,

For a patch to this nouveau bug [1] I'm trying to implement the sysfs
interface for two properties (linear_min and linear_max) nouveau uses
internally to decide when to raise the fan speed. The initial idea was
to have them as custom sysfs attributes, but I was advised to try to
fit them into the hwmon sysfs interface.

And this is when I hit a little roadblock. If my understanding is
correct (and I'm not ashamed to admit it probably isn't) trip points
are used to tie together a specific fan speed to a specific
temperature. Unfortunately nouveau does not quite work that way: those
two properties above mark the temperature the driver uses to decide
when to start and stop the *scaling* of the fan speed (from a specific
minimum value all the way to 100%).

Now, could I strech the trip point definition above to mean that a
trip point specify a *minimum* value for the fan speed at a specific
temperature, and that the driver can decide to use an higher speed as
needed when the temperature goes above the one specified in the trip
point without fear of breaking some convention/userspace tool that
expect a constant fan speed? Is this an acceptable/correct usage for
the interface?

Thanks,
Gianni

[1] https://bugs.freedesktop.org/show_bug.cgi?id=80901

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [lm-sensors] hwmon: question about the sysfs interface
@ 2014-07-14 16:47 ` Gianni Vialetto
  0 siblings, 0 replies; 10+ messages in thread
From: Gianni Vialetto @ 2014-07-14 16:47 UTC (permalink / raw)
  To: lm-sensors; +Cc: gianni, nouveau

Hello guys,

For a patch to this nouveau bug [1] I'm trying to implement the sysfs
interface for two properties (linear_min and linear_max) nouveau uses
internally to decide when to raise the fan speed. The initial idea was
to have them as custom sysfs attributes, but I was advised to try to
fit them into the hwmon sysfs interface.

And this is when I hit a little roadblock. If my understanding is
correct (and I'm not ashamed to admit it probably isn't) trip points
are used to tie together a specific fan speed to a specific
temperature. Unfortunately nouveau does not quite work that way: those
two properties above mark the temperature the driver uses to decide
when to start and stop the *scaling* of the fan speed (from a specific
minimum value all the way to 100%).

Now, could I strech the trip point definition above to mean that a
trip point specify a *minimum* value for the fan speed at a specific
temperature, and that the driver can decide to use an higher speed as
needed when the temperature goes above the one specified in the trip
point without fear of breaking some convention/userspace tool that
expect a constant fan speed? Is this an acceptable/correct usage for
the interface?

Thanks,
Gianni

[1] https://bugs.freedesktop.org/show_bug.cgi?id€901

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: hwmon: question about the sysfs interface
  2014-07-14 16:47 ` [lm-sensors] " Gianni Vialetto
@ 2014-07-14 17:25   ` Guenter Roeck
  -1 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2014-07-14 17:25 UTC (permalink / raw)
  To: Gianni Vialetto; +Cc: nouveau, lm-sensors

On Mon, Jul 14, 2014 at 06:47:28PM +0200, Gianni Vialetto wrote:
> Hello guys,
> 
> For a patch to this nouveau bug [1] I'm trying to implement the sysfs
> interface for two properties (linear_min and linear_max) nouveau uses
> internally to decide when to raise the fan speed. The initial idea was
> to have them as custom sysfs attributes, but I was advised to try to
> fit them into the hwmon sysfs interface.
> 
> And this is when I hit a little roadblock. If my understanding is
> correct (and I'm not ashamed to admit it probably isn't) trip points
> are used to tie together a specific fan speed to a specific
> temperature. Unfortunately nouveau does not quite work that way: those
> two properties above mark the temperature the driver uses to decide
> when to start and stop the *scaling* of the fan speed (from a specific
> minimum value all the way to 100%).
> 
> Now, could I strech the trip point definition above to mean that a
> trip point specify a *minimum* value for the fan speed at a specific
> temperature, and that the driver can decide to use an higher speed as
> needed when the temperature goes above the one specified in the trip
> point without fear of breaking some convention/userspace tool that
> expect a constant fan speed? Is this an acceptable/correct usage for
> the interface?
> 
For automatic fan control we don't really have a well defined ABI.
Part of the problem is that the mechanisms used by various chips are
quite different.

Please have a look into Documentation/hwmon/nct6775. It is by far
the driver with the most comprehensive fan control mechanisms and
attributes. Would any of the attributes or atribute groups in this
driver meet your needs ? I could imagine that pwm1_target_temp
for the upper temperature limit and pwm1_temp_tolerance for the difference
between upper and lower limit might do. Then there are other attributes
such as pxm1_start, pwm1_floor, pwm1_step, and pwm1_max which you
could use to control pwm values further is that is possible with the
driver.

An alternative would be to use two sets of pwm_auto_point attributes,
where the first set specifies the start pwm limit and the second
specifies the upper temperature and limit. So you would have something
like

	pwm1_auto_point1_pwm	pwm at low temperature
	pwm1_auto_point1_temp	low temperature

	pwm1_auto_point2_pwm	pwm at high temperature
	pwm1_auto_point2_temp	high temperature

After all, there is no requirement that pwm must exactly match the configured
value; the above only means that the chip uses those values to calculate
the necessary fan speed. In addition to that, you could still have some
of the other attributes as needed, such as pwm1_min, pwm1_max, and so on.

Hope this helps,
Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] hwmon: question about the sysfs interface
@ 2014-07-14 17:25   ` Guenter Roeck
  0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2014-07-14 17:25 UTC (permalink / raw)
  To: Gianni Vialetto; +Cc: nouveau, lm-sensors

On Mon, Jul 14, 2014 at 06:47:28PM +0200, Gianni Vialetto wrote:
> Hello guys,
> 
> For a patch to this nouveau bug [1] I'm trying to implement the sysfs
> interface for two properties (linear_min and linear_max) nouveau uses
> internally to decide when to raise the fan speed. The initial idea was
> to have them as custom sysfs attributes, but I was advised to try to
> fit them into the hwmon sysfs interface.
> 
> And this is when I hit a little roadblock. If my understanding is
> correct (and I'm not ashamed to admit it probably isn't) trip points
> are used to tie together a specific fan speed to a specific
> temperature. Unfortunately nouveau does not quite work that way: those
> two properties above mark the temperature the driver uses to decide
> when to start and stop the *scaling* of the fan speed (from a specific
> minimum value all the way to 100%).
> 
> Now, could I strech the trip point definition above to mean that a
> trip point specify a *minimum* value for the fan speed at a specific
> temperature, and that the driver can decide to use an higher speed as
> needed when the temperature goes above the one specified in the trip
> point without fear of breaking some convention/userspace tool that
> expect a constant fan speed? Is this an acceptable/correct usage for
> the interface?
> 
For automatic fan control we don't really have a well defined ABI.
Part of the problem is that the mechanisms used by various chips are
quite different.

Please have a look into Documentation/hwmon/nct6775. It is by far
the driver with the most comprehensive fan control mechanisms and
attributes. Would any of the attributes or atribute groups in this
driver meet your needs ? I could imagine that pwm1_target_temp
for the upper temperature limit and pwm1_temp_tolerance for the difference
between upper and lower limit might do. Then there are other attributes
such as pxm1_start, pwm1_floor, pwm1_step, and pwm1_max which you
could use to control pwm values further is that is possible with the
driver.

An alternative would be to use two sets of pwm_auto_point attributes,
where the first set specifies the start pwm limit and the second
specifies the upper temperature and limit. So you would have something
like

	pwm1_auto_point1_pwm	pwm at low temperature
	pwm1_auto_point1_temp	low temperature

	pwm1_auto_point2_pwm	pwm at high temperature
	pwm1_auto_point2_temp	high temperature

After all, there is no requirement that pwm must exactly match the configured
value; the above only means that the chip uses those values to calculate
the necessary fan speed. In addition to that, you could still have some
of the other attributes as needed, such as pwm1_min, pwm1_max, and so on.

Hope this helps,
Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] hwmon: question about the sysfs interface
       [not found]   ` <20140714172556.GA3753-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
@ 2014-07-17  6:29       ` Gianni Vialetto
  0 siblings, 0 replies; 10+ messages in thread
From: Gianni Vialetto @ 2014-07-17  6:29 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

Hi Guenter,

> For automatic fan control we don't really have a well defined ABI.
> Part of the problem is that the mechanisms used by various chips are
> quite different.
> 
> Please have a look into Documentation/hwmon/nct6775. It is by far
> the driver with the most comprehensive fan control mechanisms and
> attributes. Would any of the attributes or atribute groups in this
> driver meet your needs ? I could imagine that pwm1_target_temp
> for the upper temperature limit and pwm1_temp_tolerance for the difference
> between upper and lower limit might do. Then there are other attributes
> such as pxm1_start, pwm1_floor, pwm1_step, and pwm1_max which you
> could use to control pwm values further is that is possible with the
> driver.

Using pwm1_target_temp and pwm1_temp_tolerance seems a like nice idea,
yes. Some of the other attributes are already used and I'm not certain
how much I should change at this point.

> An alternative would be to use two sets of pwm_auto_point attributes,
> where the first set specifies the start pwm limit and the second
> specifies the upper temperature and limit. So you would have something
> like
> 
> 	pwm1_auto_point1_pwm	pwm at low temperature
> 	pwm1_auto_point1_temp	low temperature
> 
> 	pwm1_auto_point2_pwm	pwm at high temperature
> 	pwm1_auto_point2_temp	high temperature
> 
> After all, there is no requirement that pwm must exactly match the configured
> value; the above only means that the chip uses those values to calculate
> the necessary fan speed. In addition to that, you could still have some
> of the other attributes as needed, such as pwm1_min, pwm1_max, and so on.

This was my initial plan, roughly, but I like the first solution more at
this point.

> Hope this helps,
> Guenter

Definitely. Thank you.

Regards,
Gianni

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] hwmon: question about the sysfs interface
@ 2014-07-17  6:29       ` Gianni Vialetto
  0 siblings, 0 replies; 10+ messages in thread
From: Gianni Vialetto @ 2014-07-17  6:29 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

Hi Guenter,

> For automatic fan control we don't really have a well defined ABI.
> Part of the problem is that the mechanisms used by various chips are
> quite different.
> 
> Please have a look into Documentation/hwmon/nct6775. It is by far
> the driver with the most comprehensive fan control mechanisms and
> attributes. Would any of the attributes or atribute groups in this
> driver meet your needs ? I could imagine that pwm1_target_temp
> for the upper temperature limit and pwm1_temp_tolerance for the difference
> between upper and lower limit might do. Then there are other attributes
> such as pxm1_start, pwm1_floor, pwm1_step, and pwm1_max which you
> could use to control pwm values further is that is possible with the
> driver.

Using pwm1_target_temp and pwm1_temp_tolerance seems a like nice idea,
yes. Some of the other attributes are already used and I'm not certain
how much I should change at this point.

> An alternative would be to use two sets of pwm_auto_point attributes,
> where the first set specifies the start pwm limit and the second
> specifies the upper temperature and limit. So you would have something
> like
> 
> 	pwm1_auto_point1_pwm	pwm at low temperature
> 	pwm1_auto_point1_temp	low temperature
> 
> 	pwm1_auto_point2_pwm	pwm at high temperature
> 	pwm1_auto_point2_temp	high temperature
> 
> After all, there is no requirement that pwm must exactly match the configured
> value; the above only means that the chip uses those values to calculate
> the necessary fan speed. In addition to that, you could still have some
> of the other attributes as needed, such as pwm1_min, pwm1_max, and so on.

This was my initial plan, roughly, but I like the first solution more at
this point.

> Hope this helps,
> Guenter

Definitely. Thank you.

Regards,
Gianni

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] hwmon: question about the sysfs interface
       [not found]       ` <20140717062929.GA1487-kWTPUKa9AM/hXIiyNabO3w@public.gmane.org>
@ 2014-07-17  6:42           ` Guenter Roeck
  0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2014-07-17  6:42 UTC (permalink / raw)
  To: Gianni Vialetto
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

On 07/16/2014 11:29 PM, Gianni Vialetto wrote:
> Hi Guenter,
>
>> For automatic fan control we don't really have a well defined ABI.
>> Part of the problem is that the mechanisms used by various chips are
>> quite different.
>>
>> Please have a look into Documentation/hwmon/nct6775. It is by far
>> the driver with the most comprehensive fan control mechanisms and
>> attributes. Would any of the attributes or atribute groups in this
>> driver meet your needs ? I could imagine that pwm1_target_temp
>> for the upper temperature limit and pwm1_temp_tolerance for the difference
>> between upper and lower limit might do. Then there are other attributes
>> such as pxm1_start, pwm1_floor, pwm1_step, and pwm1_max which you
>> could use to control pwm values further is that is possible with the
>> driver.
>
> Using pwm1_target_temp and pwm1_temp_tolerance seems a like nice idea,
> yes. Some of the other attributes are already used and I'm not certain
> how much I should change at this point.
>
I can not really comment on this. We prefer to retain at least some level
of attribute name consistency, but the Nouveau hwmon driver pretty much
bypasses hwmon review anyway, so from a practical perspective you can
invent as many new attribute names as you like.

Guenter

>> An alternative would be to use two sets of pwm_auto_point attributes,
>> where the first set specifies the start pwm limit and the second
>> specifies the upper temperature and limit. So you would have something
>> like
>>
>> 	pwm1_auto_point1_pwm	pwm at low temperature
>> 	pwm1_auto_point1_temp	low temperature
>>
>> 	pwm1_auto_point2_pwm	pwm at high temperature
>> 	pwm1_auto_point2_temp	high temperature
>>
>> After all, there is no requirement that pwm must exactly match the configured
>> value; the above only means that the chip uses those values to calculate
>> the necessary fan speed. In addition to that, you could still have some
>> of the other attributes as needed, such as pwm1_min, pwm1_max, and so on.
>
> This was my initial plan, roughly, but I like the first solution more at
> this point.
>
>> Hope this helps,
>> Guenter
>
> Definitely. Thank you.
>
> Regards,
> Gianni
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] hwmon: question about the sysfs interface
@ 2014-07-17  6:42           ` Guenter Roeck
  0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2014-07-17  6:42 UTC (permalink / raw)
  To: Gianni Vialetto
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

On 07/16/2014 11:29 PM, Gianni Vialetto wrote:
> Hi Guenter,
>
>> For automatic fan control we don't really have a well defined ABI.
>> Part of the problem is that the mechanisms used by various chips are
>> quite different.
>>
>> Please have a look into Documentation/hwmon/nct6775. It is by far
>> the driver with the most comprehensive fan control mechanisms and
>> attributes. Would any of the attributes or atribute groups in this
>> driver meet your needs ? I could imagine that pwm1_target_temp
>> for the upper temperature limit and pwm1_temp_tolerance for the difference
>> between upper and lower limit might do. Then there are other attributes
>> such as pxm1_start, pwm1_floor, pwm1_step, and pwm1_max which you
>> could use to control pwm values further is that is possible with the
>> driver.
>
> Using pwm1_target_temp and pwm1_temp_tolerance seems a like nice idea,
> yes. Some of the other attributes are already used and I'm not certain
> how much I should change at this point.
>
I can not really comment on this. We prefer to retain at least some level
of attribute name consistency, but the Nouveau hwmon driver pretty much
bypasses hwmon review anyway, so from a practical perspective you can
invent as many new attribute names as you like.

Guenter

>> An alternative would be to use two sets of pwm_auto_point attributes,
>> where the first set specifies the start pwm limit and the second
>> specifies the upper temperature and limit. So you would have something
>> like
>>
>> 	pwm1_auto_point1_pwm	pwm at low temperature
>> 	pwm1_auto_point1_temp	low temperature
>>
>> 	pwm1_auto_point2_pwm	pwm at high temperature
>> 	pwm1_auto_point2_temp	high temperature
>>
>> After all, there is no requirement that pwm must exactly match the configured
>> value; the above only means that the chip uses those values to calculate
>> the necessary fan speed. In addition to that, you could still have some
>> of the other attributes as needed, such as pwm1_min, pwm1_max, and so on.
>
> This was my initial plan, roughly, but I like the first solution more at
> this point.
>
>> Hope this helps,
>> Guenter
>
> Definitely. Thank you.
>
> Regards,
> Gianni
>
>


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] hwmon: question about the sysfs interface
       [not found]           ` <53C7704E.4060705-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
@ 2014-07-17  8:07               ` Martin Peres
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Peres @ 2014-07-17  8:07 UTC (permalink / raw)
  To: Guenter Roeck, Gianni Vialetto
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

On 17/07/2014 08:42, Guenter Roeck wrote:
> I can not really comment on this. We prefer to retain at least some level
> of attribute name consistency, but the Nouveau hwmon driver pretty much
> bypasses hwmon review anyway, so from a practical perspective you can
> invent as many new attribute names as you like.
>
> Guenter 

Please do comment on this. I may never have asked for a review but I 
still tried to stick
to the hwmon sysfs interface documentation.

Martin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] [Nouveau] hwmon: question about the sysfs interface
@ 2014-07-17  8:07               ` Martin Peres
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Peres @ 2014-07-17  8:07 UTC (permalink / raw)
  To: Guenter Roeck, Gianni Vialetto
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

On 17/07/2014 08:42, Guenter Roeck wrote:
> I can not really comment on this. We prefer to retain at least some level
> of attribute name consistency, but the Nouveau hwmon driver pretty much
> bypasses hwmon review anyway, so from a practical perspective you can
> invent as many new attribute names as you like.
>
> Guenter 

Please do comment on this. I may never have asked for a review but I 
still tried to stick
to the hwmon sysfs interface documentation.

Martin

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-07-17  8:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-14 16:47 hwmon: question about the sysfs interface Gianni Vialetto
2014-07-14 16:47 ` [lm-sensors] " Gianni Vialetto
2014-07-14 17:25 ` Guenter Roeck
2014-07-14 17:25   ` [lm-sensors] " Guenter Roeck
     [not found]   ` <20140714172556.GA3753-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2014-07-17  6:29     ` Gianni Vialetto
2014-07-17  6:29       ` Gianni Vialetto
     [not found]       ` <20140717062929.GA1487-kWTPUKa9AM/hXIiyNabO3w@public.gmane.org>
2014-07-17  6:42         ` Guenter Roeck
2014-07-17  6:42           ` Guenter Roeck
     [not found]           ` <53C7704E.4060705-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2014-07-17  8:07             ` Martin Peres
2014-07-17  8:07               ` [lm-sensors] [Nouveau] " Martin Peres

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.