public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Sitsofe Wheeler <sitsofe@yahoo.com>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	Len Brown <lenb@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
	David Zeuthen <davidz@redhat.com>,
	Richard Hughes <richard@hughsie.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI / Battery: Return -ENODATA for unknown values in get_property()
Date: Thu, 21 Oct 2010 21:57:47 +0200	[thread overview]
Message-ID: <201010212157.47952.rjw@sisk.pl> (raw)
In-Reply-To: <20101021165420.GA8718@sucs.org>

On Thursday, October 21, 2010, Sitsofe Wheeler wrote:
> On Sun, Oct 17, 2010 at 08:32:42PM +0200, Rafael J. Wysocki wrote:
> > 
> > Still, if user space has problems with failing reads from the sysfs
> > attributes, it may be better to simply put -1 in there.  Patch is
> > appended, please test.
> 
> This patch does what it says on the tin (returns -1 in sysfs on my EeePC
> 900). So:
> 
> Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
> 
> It's a shame the previous changes didn't work as they stopped a buggy
> upower using the -1 value (and producing a nonsense rate like 8.4e-06)

Hmm.  So upower _doesn't_ handle -1?  What does it do with -1000, then?

> but it's not clear which part of the stack can't handle -ENODATA
> perhaps it is another part of the kernel?

I don't really think it's a part of the kernel.

> Richard, any chance of upower being changed to test for -1 before doing
> doing anything with current_now (
> http://cgit.freedesktop.org/DeviceKit/upower/tree/src/linux/up-device-supply.c?id=5387183d53c16a987a0737c1bdec1b62edf3daa6#n561)?
> I guess there are a whole bunch of other attributes that could
> theoretically be -1 and shouldn't be used if they return it...

If user space doesn't handle -1 correctly too, I think the right approach for
us should be to use the previous version of the patch and return error code
for unknown values.

Thanks,
Rafael

  reply	other threads:[~2010-10-21 19:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-16 14:13 Returning ACPI_BATTERY_VALUE_UNKNOWN to userspace Sitsofe Wheeler
2010-10-16 23:05 ` [PATCH] ACPI / Battery: Return -ENODATA for unknown values in get_property() (was: Re: Returning ACPI_BATTERY ...) Rafael J. Wysocki
2010-10-17  5:19   ` Henrique de Moraes Holschuh
2010-10-17  9:59     ` [PATCH] ACPI / Battery: Return -ENODATA for unknown values in get_property() Sitsofe Wheeler
2010-10-17 13:10       ` Henrique de Moraes Holschuh
2010-10-17 14:50         ` Sitsofe Wheeler
2010-10-17 18:32           ` Rafael J. Wysocki
2010-10-21 16:54             ` Sitsofe Wheeler
2010-10-21 19:57               ` Rafael J. Wysocki [this message]
2010-10-21 20:46                 ` Sitsofe Wheeler
2010-10-22 22:19                   ` Rafael J. Wysocki
2010-10-23 15:36                     ` Sitsofe Wheeler
2010-10-23 17:31                       ` Rafael J. Wysocki
2010-10-22 12:31               ` Richard Hughes
2010-10-23 15:43                 ` Sitsofe Wheeler
2010-10-25 13:17             ` Pavel Machek
2010-10-25 20:36               ` Rafael J. Wysocki

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=201010212157.47952.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=davidz@redhat.com \
    --cc=hmh@hmh.eng.br \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=richard@hughsie.com \
    --cc=rui.zhang@intel.com \
    --cc=sitsofe@yahoo.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