From: Harald Judt <h.judt@gmx.at>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] w83627ehf: Wrong values reported after resuming from suspend/hibernation
Date: Tue, 23 Oct 2012 12:08:10 +0000 [thread overview]
Message-ID: <508688AA.2090607@gmx.at> (raw)
In-Reply-To: <50856051.5070803@gmx.at>
Am 23.10.2012 13:45, schrieb Jean Delvare:
> On Tue, 23 Oct 2012 11:57:41 +0200, Harald Judt wrote:
>> Am 23.10.2012 09:14, schrieb Jean Delvare:
>>> Reloading the module shouldn't help for limits, they are set by
>>> user-space. Reloading the lm_sensors service instead should help.
>>
>> Actually that's what I did. Why the need to reload the service after
>> suspend? Restarting the service causes some user applications to crash
>> (yes maybe they should be fixed so that doesn't happen).
>
> The key issue with service reloading is that it will reload (some of)
> the hwmon drivers, which it turn causes hwmon devices to disappear and
> reappear in sysfs. libsensors doesn't notice so it can't tell the
> applications. If we want to be able to handle that kind of cases
> properly we need to let libsensors monitor this and notify the
> applications.
>
> The fact that this isn't supported at the moment certainly speaks in
> favor of adding proper suspend/resume to the affected drivers rather
> than blindly reloading the lm_sensors service after resume.
I agree. Suspend/resume support is always a good idea.
>>> Vbat is indeed enabled by the driver at device bind time, as well as a
>>> few other things. In your case you report battery monitoring missing,
>>> but other settings may be broken, for example temperature monitoring
>>> could be stuck or overall monitoring could be disabled. Do all values
>>> (other than Vbat) change as before? The exact effects really depend on
>>> what the BIOS is doing to the chip at boot time and resume time.
>>
>> All values except the ones mentioned are being reported correctly after
>> resuming.
>
> OK. This might depend on the board though. But we can start with your
> particular case, and improve on top of that.
>
>>> I've been pondering this for a long time. Adding support for limit
>>> saving and restoring to all hwmon drivers would be a significant amount
>>> of code. An easier workaround would be to run "sensors -s" after
>>> resume. This is what I had suggested here:
>>> https://bugzilla.novell.com/show_bug.cgi?idX0988#c3
>>
>> I will try this and see if it helps. However, the min/max values or
>> alarms are not something I use on my desktop, so I don't care very much
>> if they don't work. In other environments, they will be much more
>> important I guess.
>
> Really depends on who is monitoring and for what reasons. Also depends
> if the wrong limits trigger alarms, which in turn may trigger all sort
> of (software or hardware) events.
Yes, if you rely on that then things can indeed get problematic.
> The workaround won't work completely for you anyway, as running
> "sensors -s" won't get your Vbat reading back. We will have to do it
> explicitly in the driver's resume function.
>
> More generally, my first tests suggest that saving and restoring the
> "Value RAM" is neither required (all values read from the sensors are
> useless) nor sufficient (there are other register values which get
> lost.) Some register values are reverted to their default values, which
> suggests these registers are as volatile as the "Value RAM". Other
> values change arbitrarily, suggesting that the BIOS is explicitly
> setting them to different values at resume time.
>
> If we want to be able to deal with all chips and all BIOS bugs, there's
> a lot of work ahead.
>
>> (...)
>> Maybe people don't notice or care too if _some_ values are missing.
>> Especially when those values are not vital. CPU temp, fan speeds etc ok,
>> but how many typical users monitor the VBAT voltage?
>
> Actually everyone should, a dead batter can have very bad consequences.
It is a very reliable way for CMOS clear.
>> The VBAT voltage is not shown in BIOS, while other values are. Maybe the
>> BIOS is at fault here, and the problem needs to be tackled there.
>
> It is very frequent that the BIOS doesn't display the values for all
> available sensors. This is a vendor decision, there's nothing we can or
> should do.
It's not about being displayed, I meant that there could be a
relationship between the values shown in the BIOS and the values set by
the BIOS. That is, VBAT is not displayed in the BIOS and is 0 after
resuming. The other values are reported in the BIOS (I'd have to check
that again now just to be sure) and get set at boot and after resume too
(at least that's the assumption). So maybe the BIOS engineers simply
didn't care about that value or forgot about it. But never mind, that's
just speculation and doesn't help either, as long as it can be dealt
with in the module.
> I'm working on my test system now. It has a different chip (W83627THF)
> supported by a different driver (w83627hf) but the logic should be very
> similar. When I'm done with my case, I'll post my results and do the
> same for the w83627ehf driver.
Thanks, I'd be very interested in your suspend/resume code (learn
something new). May I assume you have the same problem (at least with
min/max) values then?
Harald
--
`Experience is the best teacher.'
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2012-10-23 12:08 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-22 15:03 [lm-sensors] w83627ehf: Wrong values reported after resuming from suspend/hibernation Harald Judt
2012-10-22 21:40 ` Guenter Roeck
2012-10-23 7:14 ` Jean Delvare
2012-10-23 9:57 ` Harald Judt
2012-10-23 11:45 ` Jean Delvare
2012-10-23 12:08 ` Harald Judt [this message]
2012-10-23 12:34 ` Jean Delvare
2012-10-23 14:01 ` Guenter Roeck
2012-10-23 16:32 ` Jean Delvare
2012-10-23 19:02 ` Harald Judt
2012-10-24 3:45 ` Guenter Roeck
2012-10-24 8:39 ` Jean Delvare
2012-10-24 18:05 ` Harald Judt
2012-10-24 18:14 ` Harald Judt
2012-10-24 19:23 ` Jean Delvare
2012-10-25 9:53 ` Guenter Roeck
2012-10-25 17:26 ` Harald Judt
2012-10-25 19:07 ` Jean Delvare
2012-10-25 19:16 ` Harald Judt
2012-10-25 20:37 ` Guenter Roeck
2012-10-25 23:49 ` Guenter Roeck
2012-10-26 0:41 ` Guenter Roeck
2012-10-26 0:55 ` Harald Judt
2012-10-26 7:27 ` Jean Delvare
2012-10-26 14:06 ` Guenter Roeck
2012-10-26 14:15 ` Jean Delvare
2013-07-28 20:43 ` Harald Judt
2013-07-28 21:43 ` Guenter Roeck
2013-07-28 22:28 ` Guenter Roeck
2013-07-29 2:24 ` Harald Judt
2013-07-29 2:47 ` Harald Judt
2013-07-29 6:58 ` Guenter Roeck
2013-07-29 9:12 ` Harald Judt
2013-07-29 15:27 ` Harald Judt
2013-07-29 22:46 ` Guenter Roeck
2013-07-31 22:11 ` Guenter Roeck
2013-08-01 9:08 ` Harald Judt
2013-08-01 13:42 ` Guenter Roeck
2013-08-01 14:36 ` Harald Judt
2013-08-01 17:46 ` Guenter Roeck
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=508688AA.2090607@gmx.at \
--to=h.judt@gmx.at \
--cc=lm-sensors@vger.kernel.org \
/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 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.