Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Dec 2014 11:10:55 +0100
From:      Dan Lukes <dan@obluda.cz>
To:        Colin Percival <cperciva@freebsd.org>
Cc:        freebsd-acpi@freebsd.org
Subject:   Re: ENXIOing non-present battery
Message-ID:  <548427AF.3060309@obluda.cz>
In-Reply-To: <54841804.5050700@freebsd.org>
References:  <54840781.70603@freebsd.org> <54840FBA.5050409@obluda.cz> <54841804.5050700@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Colin Percival wrote:
>>> The attached patch adds a acpi.cmbat.hide_not_present loader tunable which,
>>> as the name suggests, hides non-present batteries; this is done in the probe
>>> code by returning ENXIO

>> No, but it may be more useful to create more generalized interface.

> I agree in theory, but do you have any idea how to do this?

Well, may be I'm not the best expert on the matter, but I assume there
is an device enumerator which invoke "probe" function of device drivers.
Such enumerator should skip the devices listen in "don't probe" list.

I'm aware there is no single enumerator in the kernel. All those
enumerators needs to be patched to honor such list.

Other solutions:

No enumerator needs to be patched. There needs to be device driver
module which will claim high priority ownership of all devices on the
"disabled device" list. So particular device will be attached to such
special driver, not to the standard one.

> In the case of my laptop, the only way I can see to distinguish between the
> real battery and the "ghost" battery is that the latter returns zero from
> acpi_BatteryIsPresent;

In case of your particular laptop you can claim second battery to be
ghost battery as you know there is no second battery now and will not be
even in the future.

So no "battery" device driver needs to be attached to such device. It
will hide such battery from applications.

By the way, as long as your ACPI claim non-existent battery as non
existent, it seems not to be broken.

If KDE read remaining capacity of battery claimed to be non-present,
then it seems to be KDE who have broken logic ...

> There is, of course, the option of using debug.apci.disabled to disable
> complete subsystems, but I only want to hide the ghost battery, not the
> real one.

I asked for more generic mechanism, but not as generic as you described.

It would eb nice if we can disable enumeration of broken devices only
(despite they are enumerated trough ACPI, PNP, PCI, USB or so
enumerator), not the just ACPI at all.


Dan





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?548427AF.3060309>