From: Pavel Machek <pavel@ucw.cz>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
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 22:10:38 +0100 [thread overview]
Message-ID: <20091207211038.GA1619@elf.ucw.cz> (raw)
In-Reply-To: <20091207120629.GE20076@khazad-dum.debian.net>
Hi!
> > > + 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)?
It should be ok. Reordering is not possible, KERN_CONT will not
introduce delays. Interleaved messages are possible on SMP, but very
very unlikely. I don't really expect problems.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
prev parent reply other threads:[~2009-12-07 21:11 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
2009-12-07 21:10 ` Pavel Machek [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=20091207211038.GA1619@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=hmh@hmh.eng.br \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=lenb@kernel.org \
--cc=linux-acpi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox