Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757378AbZD1VBX (ORCPT ); Tue, 28 Apr 2009 17:01:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756829AbZD1VAv (ORCPT ); Tue, 28 Apr 2009 17:00:51 -0400 Received: from mail-fx0-f158.google.com ([209.85.220.158]:48630 "EHLO mail-fx0-f158.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754471AbZD1VAt (ORCPT ); Tue, 28 Apr 2009 17:00:49 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=e83r5lZyc8vSFUhpKOcgX7c8Du6WRWRVP1zgunAiq4bm7gd/nJcuTBiubqFuGkB8k/ tlPf4QZlnIbdunEEi04cBezIP9coTM0wfVKyOU+9V5FRrNMm0iunBVN+5XdCkT8k5/H9 HWFuGWrgoD6pJKAejHL4AqC11jxChtTgCCXX8= Subject: Re: [BUG] /sys/class/power_supply/BAT0/ shouldn't disappear when battery is unplugged From: Maxim Levitsky To: avorontsov@ru.mvista.com Cc: cbou@mail.ru, dwmw2@infradead.org, linux-kernel In-Reply-To: <20090427174937.GA15970@oksana.dev.rtsoft.ru> References: <1240753018.26851.6.camel@maxim-laptop> <20090427174937.GA15970@oksana.dev.rtsoft.ru> Content-Type: text/plain Date: Wed, 29 Apr 2009 00:00:44 +0300 Message-Id: <1240952444.3781.34.camel@maxim-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2093 Lines: 64 On Mon, 2009-04-27 at 21:49 +0400, Anton Vorontsov wrote: > 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. No, I am talking about the following situation: Suppose: I keep battery in the closet. I turn my system on Gpm has no idea my system has a battery, thus it hides battery tab. I want to set change battery settings. > > > 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 did, no reaction so far... > > > 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). Ok, why not to do so for acpi devices? > > > 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, > Best regards, Maxim Levitsky -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/