From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Pavel Machek <pavel@ucw.cz>
Cc: Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net
Subject: Re: [PATCH 8/8] thinkpad-acpi: log temperatures on termal alarm
Date: Mon, 7 Dec 2009 10:06:29 -0200 [thread overview]
Message-ID: <20091207120629.GE20076@khazad-dum.debian.net> (raw)
In-Reply-To: <20091206210126.GD10184@elf.ucw.cz>
On Sun, 06 Dec 2009, Pavel Machek wrote:
> > Log temperatures on any of the EC thermal alarms. It could be
> > useful to help tracking down what is happening...
>
> Thanks, I applied it locally.
>
> > static bool hotkey_notify_thermal(const u32 hkey,
> > bool *send_acpi_ev,
> > bool *ignore_acpi_ev)
> > {
> > + int known = true;
> > +
>
> Oops?
Yeah, will fix and resend the entire stack, as it has grown a few more
patches during the weekend :)
> > + for (i = 0; i < n; i++)
> > + t.temp[i] = t.temp[i] / 1000;
> > +
> > + /* Fill missing sensors with N/A marker */
> > + for (i = n; i < TPACPI_MAX_THERMAL_SENSORS; i++)
> > + t.temp[i] = -128;
>
> -273 would be better "N/A" marker :-).
No can do. The firmware uses -128 (it is a signed 8-bit value), so there is
an internal driver ABI *and* an userspace ABI since 2.6.13 or thereabouts
that forces N/A sensors in thinkpad-acpi to return -128...
In sysfs, I return an error code instead, which is arguably a much better
way of doing that.
But I do agree -273 would be a cooler value to return for N/A :-)
> > + /* FIXME: it is ugly */
> > + printk(TPACPI_NOTICE
> > + "temperatures (Celsius): "
> > + "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n",
>
> But this indeed is ugly. Why not sometihng like
>
> printk(TPACPI_NOTICE "temperatures (Celsius): ");
> for (i = 0; i < n; i++)
> printk(KERN_CONT "%d ", t.temp[i]);
> printk(KERN_CONT "\n");
>
> ...you'd get rid of #ifdef above, ugly -128 markers, and nasty %d series...
Can't get rid of -128, unless I print N/A instead, which your for() loop
would allow.
However, while using KERN_CONT is nicer, that printk is important and needs
to get out to the logs with no reordering, no long delay, and preferably, no
other printks interleaved with it. Please excuse my lack of knowledge on
this, but wouldn't KERN_CONT make it far more likely that a problem happens
to the printk that will make it hard to read/useless (if reordering
happens)?
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
next prev parent reply other threads:[~2009-12-07 12:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-03 11:41 [GIT PATCH] thinkpad-acpi first set of changes for 2.6.33 Henrique de Moraes Holschuh
2009-12-03 11:41 ` [PATCH 1/8] thinkpad-acpi: fix default brightness_mode for R50e/R51 Henrique de Moraes Holschuh
2009-12-03 11:41 ` [PATCH 2/8] thinkpad-acpi: preserve rfkill state across suspend/resume Henrique de Moraes Holschuh
2009-12-03 11:41 ` [PATCH 3/8] thinkpad-acpi: fix some version quirks Henrique de Moraes Holschuh
2009-12-03 11:41 ` [PATCH 4/8] thinkpad-acpi: issue backlight class events Henrique de Moraes Holschuh
2009-12-03 11:49 ` Henrique de Moraes Holschuh
2009-12-03 11:41 ` [PATCH 5/8] thinkpad-acpi: silence bogus complain during rmmod Henrique de Moraes Holschuh
2009-12-03 11:41 ` [PATCH 6/8] thinkpad-acpi: adopt input device Henrique de Moraes Holschuh
2009-12-03 11:41 ` [PATCH 7/8] thinkpad-acpi: expose module parameters Henrique de Moraes Holschuh
2009-12-03 11:41 ` [PATCH 8/8] thinkpad-acpi: log temperatures on termal alarm Henrique de Moraes Holschuh
2009-12-06 21:01 ` Pavel Machek
2009-12-07 12:06 ` Henrique de Moraes Holschuh [this message]
2009-12-07 21:10 ` Pavel Machek
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=20091207120629.GE20076@khazad-dum.debian.net \
--to=hmh@hmh.eng.br \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=pavel@ucw.cz \
/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