From: Alexey Starikovskiy <aystarik@gmail.com>
To: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
cbou@mail.ru, dwmw2@infradead.org
Subject: Re: [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute even if battery is absent
Date: Sat, 27 Oct 2007 22:18:14 +0400 [thread overview]
Message-ID: <472380E6.10304@gmail.com> (raw)
In-Reply-To: <200710272150.29596.arvidjaar@mail.ru>
Andrey Borzenkov wrote:
> On Saturday 27 October 2007, Alexey Starikovskiy wrote:
>> Andrey Borzenkov wrote:
>>> I am not exactly sure about this one ... what other power_supply class
>>> drivers do? Should I fix HAL instead (but then, I do not know whether HAL
>>> is the only application that is using this interface).
>> Hm, do you need separate set of properties for that? You could register
>> either of existing two, and read function will not allow read of anything
>> but "present". IMHO, this is what other modules do (/drivers/power)
>
> Do they have different set of properties depending on underlying hardware that
> you can't query unless hardware is present? I'd rather avoid adding fake
> attributes; but I do not actually care so which one do you prefer? :)
I prefer less code :)
>
>> One remaining trick here, you need to call unregister/register for
>> power_supply if you change attributes -- so please check if your patched
>> driver survives insertion of the battery.
>>
>
>
> Neither does your code (nor kpowersave :) ) Remove battery and set of
> attributes is "stuck" instead of being reset to only fixed set of power
> device attributes (basically "info"). The only call to power_supply_register
> is in acpi_battery_add and as far as I can tell this is executed on adding
> *slot* not when content of this slot changes.
Point is -- it does not break :) If you start to play with shorter length of
attributes table and don't call unregister/register, power_supply may
go past the end of table.
next prev parent reply other threads:[~2007-10-27 18:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-27 16:54 [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute even if battery is absent Andrey Borzenkov
2007-10-27 17:16 ` Alexey Starikovskiy
2007-10-27 17:50 ` Andrey Borzenkov
2007-10-27 18:18 ` Alexey Starikovskiy [this message]
2007-10-27 18:42 ` Anton Vorontsov
2007-10-27 19:32 ` David Woodhouse
2007-10-27 19:50 ` Anton Vorontsov
2007-10-28 6:50 ` Andrey Borzenkov
2007-10-28 7:37 ` [PATCH] [2.6.24-rc] ACPI: register power_supply subdevice only when battery is present Andrey Borzenkov
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=472380E6.10304@gmail.com \
--to=aystarik@gmail.com \
--cc=arvidjaar@mail.ru \
--cc=cbou@mail.ru \
--cc=dwmw2@infradead.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@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