mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: cbou@mail.ru, dwmw2@infradead.org,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] /sys/class/power_supply/BAT0/ shouldn't disappear when battery is unplugged
Date: Mon, 27 Apr 2009 21:49:37 +0400	[thread overview]
Message-ID: <20090427174937.GA15970@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <1240753018.26851.6.camel@maxim-laptop>

On Sun, Apr 26, 2009 at 04:36:58PM +0300, Maxim Levitsky wrote:
> New sysfs battery interface has a flaw.
> 
> Suppose I removed battery from the system, and then booted it.
> then gnome power manager has no idea that my system has battery, and
> thus it hides battery settings.

If after insertion the battery is visible in /sys/class/power_supply/,
then it's not a kernel bug. That's purely gnome issue (or HAL), it
seem to not handle hot-plugged batteries.

> It also has a bug that prevents it from hiding battery icon, when I
> unplug the battery, in other words, it isn't prepared for battery to
> disappear.

Again, you should report that to HAL/Gnome maintainers, so that gnome
power manager would handle battery removal events generated by the
power supply class.

> I think it would be nice to keep /sys/class/power_supply/BAT0/ even if
> battery isn't present.

That isn't always possible. Imagine a battery inside some hot-pluggable
PCI device. Or an USB device, or a battery with a built-in controller
connected through W1 bus (i.e. batteries w/ ds2760 chip).

> btw, there is /sys/class/power_supply/BAT0/present, thus maybe this is
> just a bug?

Nope. And personally I think we should remove the "present"
property, and drivers should learn to remove stuff from power_supply/
if there is no battery inserted. But so far HAL/Gnome/whatever have
to handle both methods.

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

  reply	other threads:[~2009-04-27 17:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-26 13:36 Maxim Levitsky
2009-04-27 17:49 ` Anton Vorontsov [this message]
2009-04-28 21:00   ` Maxim Levitsky

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=20090427174937.GA15970@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=cbou@mail.ru \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maximlevitsky@gmail.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

all inboxes | Powered by JetHome®