linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: Vasilis LIaskovitis <vliaskovitis@suse.com>,
	linux-pm@vger.kernel.org, rjw@rjwysocki.net
Subject: Re: [RFC] docs: thermal/drivers/intel: Reading trip point previously set to 0
Date: Sat, 30 Sep 2023 05:56:29 -0700	[thread overview]
Message-ID: <af63ea6bbd769730a84bf91c6161cd2afd9955d6.camel@linux.intel.com> (raw)
In-Reply-To: <d9b13ed7-e173-43f7-73c0-840014a6c4d4@suse.com>

Hi Vasilis,

On Thu, 2023-09-28 at 20:05 +0200, Vasilis LIaskovitis wrote:
> Hi,
> 
> ping, any thoughts on this?
> 
> > Since commit:
> > eb8500b8 "thermal/drivers/intel: Initialize RW trip to 
> > THERMAL_TEMP_INVALID"
> > 
> > writing 0 into thermal trip point temp sysfs files cannot be read
> > back:
> > ~ # echo 0  > 
> > /sys/devices/virtual/thermal/thermal_zone1/trip_point_0_temp
> > ~ # cat
> > /sys/devices/virtual/thermal/thermal_zone1/trip_point_0_temp
> > -274000
> > 
> > Prior to this change, the value 0 could be "read". Afaict only
> > because 
> > 0 was always returned for uninitialized trip points, and not only
> > when 
> > 0 was actually written into the trip_point_*_temp by userspace.
> > 
> > A customer uses scripts to set the trip_point_*_temp value to 0,
> > and 
> > then checks that the value is indeed 0. Their userspace test suite 
> > breaks because of this change.
> > 
> > Should userspace still be able to read the set value of 0 (meaning
> > the 
> > thermal subsystem confirms no notifications will be sent)? I 
> > understand this is a corner case (maybe it's even non-sensical to 
> > check a value of 0 is returned, after setting it), but I wanted to
> > ask 
> > since the sysfs value read by userspace is now
> > THERMAL_TEMP_INVALID.
> > 
> > Or should we instead update documentation to reflect the fact that 
> > uninitialized trip points and trip points set to 0 return an
> > invalid 
> > value THERMAL_TEMP_INVALID? E.g.:
> > 

I think better to update documentation, Please submit a change, if you
can.

Thanks,
Srinivas

> > 
> > diff --git 
> > a/Documentation/driver-api/thermal/x86_pkg_temperature_thermal.rst 
> > b/Documentation/driver-api/thermal/x86_pkg_temperature_thermal.rst
> > index 2ac42ccd236f6..2e6f2728b5b94 100644
> > --- a/Documentation/driver-
> > api/thermal/x86_pkg_temperature_thermal.rst
> > +++ b/Documentation/driver-
> > api/thermal/x86_pkg_temperature_thermal.rst
> > @@ -43,8 +43,10 @@ User can set any temperature between 0 to TJ-Max
> > temperature. Temperature units
> >  are in milli-degree Celsius. Refer to 
> > "Documentation/driver-api/thermal/sysfs-api.rst" for
> >  thermal sys-fs details.
> > 
> > +An uninitialized trip_point_*_temp returns an invalid value 
> > (THERMAL_TEMP_INVALID).
> >  Any value other than 0 in these trip points, can trigger thermal 
> > notifications.
> > -Setting 0, stops sending thermal notifications.
> > +Setting 0, stops sending thermal notifications. Having set 0, the 
> > value returned by the
> > +trip point remains invalid (THERMAL_TEMP_INVALID).
> > 
> >  Thermal notifications:
> >  To get kobject-uevent notifications, set the thermal zone
> > 


      reply	other threads:[~2023-09-30 12:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 11:15 [RFC] docs: thermal/drivers/intel: Reading trip point previously set to 0 Vasilis Liaskovitis
2023-09-28 18:05 ` Vasilis LIaskovitis
2023-09-30 12:56   ` srinivas pandruvada [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=af63ea6bbd769730a84bf91c6161cd2afd9955d6.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=vliaskovitis@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).