From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH v3 2/3] acpi: dptf_power: Add DPTF power participant
Date: Thu, 23 Jun 2016 16:19:30 -0700 [thread overview]
Message-ID: <1466723970.8970.69.camel@linux.intel.com> (raw)
In-Reply-To: <CAJZ5v0hRVDMgsBzEMufwHurA8aRBmd7p_MvnMg1cdNYgDrPDaA@mail.gmail.com>
On Fri, 2016-06-24 at 00:31 +0200, Rafael J. Wysocki wrote:
> On Thu, Jun 23, 2016 at 11:42 PM, Srinivas Pandruvada
> <srinivas.pandruvada@linux.intel.com> wrote:
> >
> > This driver adds support for Dynamic Platform and Thermal Framework
> > (DPTF) Platform Power Participant device support.
> > This participant is responsible for exposing platform telemetry
> > such as
> > platform Power, battery Information such as state of Charge,
> > estimated
> > maximum sustainable power (PMax), SMART battery spec information.
> >
> > This driver is implemented as a platform driver for INT3407 and
> > presented
> > as power_supply device. Since this has common features with the
> > ACPI
> > battery, existing interface provide by battery_common driver are
> > reused
> > to present as a battery power supply device.
> >
> > When both CONFIG_ACPI_BATTERY and CONFIG_DPTF_POWER are defined and
> > platform has support for INT3407, then dptf power registration is
> > delayed for 100ms. In 100 ms, if there is no ACPI battery is
> > registered
> > then dptf power will be registered. Since both can be modules and
> > battery driver loads in async thread, there can be race even if we
> > specify loading order for initialization.
> First, does the waiting actually help, though?
Yes, if the acpi_battery registered then
if (!battery_registered) will be false.
>
> Second, to my eyes, even if acpi_battery load first, the dptf_power
> thing will still bind to the same device, but via the platform bus
> instead of the ACPI bus type. I don't see anything preventing that
> from happening in the patch, but maybe I missed something?
>
The INT3407 object also has battery _BST and _BIX, so driver will bind
to this device not with PNP0C0A battery device. Either of them should
be able to register and provide battery information. But the names are
different (BAT vs TPWR on my platform)
The check if (!battery_registered) will fail, so dptf_power will not
register. So we will not see two batteries registered with power supply
class (and hence no two batteries in desktop UI).
Thanks,
Srinivas
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-06-23 23:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-23 21:42 [PATCH v3 0/3] DPTF Platform power participant driver Srinivas Pandruvada
2016-06-23 21:42 ` [PATCH v3 1/3] acpi: battery: Split battery driver for reuse by DPTF power participant Srinivas Pandruvada
2016-06-23 21:42 ` [PATCH v3 2/3] acpi: dptf_power: Add " Srinivas Pandruvada
2016-06-23 22:31 ` Rafael J. Wysocki
2016-06-23 23:19 ` Srinivas Pandruvada [this message]
2016-06-24 0:26 ` Rafael J. Wysocki
2016-06-27 1:31 ` Srinivas Pandruvada
2016-06-27 1:45 ` Rafael J. Wysocki
2016-06-27 8:42 ` Zheng, Lv
2016-06-27 18:09 ` Srinivas Pandruvada
2016-06-23 21:42 ` [PATCH v3 3/3] acpi: battery_common: battery present status for INT3407 Srinivas Pandruvada
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=1466723970.8970.69.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
/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;
as well as URLs for NNTP newsgroup(s).