From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>, Sebastian Reichel <sre@kernel.org>,
Chen-Yu Tsai <wens@csie.org>
Cc: linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/4] acpi: battery: Add acpi_battery_unregister() function
Date: Mon, 20 Mar 2017 14:03:16 +0100 [thread overview]
Message-ID: <84d31794-d5c5-6f09-bbdb-9f5612ddbbbe@redhat.com> (raw)
In-Reply-To: <1489681793.19767.21.camel@linux.intel.com>
Hi,
Thank you for the reviews!
On 16-03-17 17:29, Andy Shevchenko wrote:
> On Thu, 2017-03-16 at 17:15 +0100, Hans de Goede wrote:
>> On some systems we have a native pmic driver which provides battery
>> monitoring, while the acpi battery driver is broken on these systems
>> due to bad dstds or because of missing vendor specific acpi opregion
>> (e.g. BMOP opregion) support, which the acpi battery device in the
>> dsdt relies on.
>>
>> This leads to there being 2 battery power_supply-s registed like this:
>>
>> ~$ acpi
>> Battery 0: Charging, 84%, 00:49:39 until charged
>> Battery 1: Unknown, 0%, rate information unavailable
>>
>> Even if the acpi battery where to function fine (which on systems
>> where we have a native pmic driver it often doesn't) we still do not
>> want to export the same battery to userspace twice.
>>
>> This commit adds an acpi_battery_unregister() function which native
>> pmic drivers can call to tell the acpi-battery driver to unregister
>> itself so that we do not end up with 2 power_supply-s for the same
>> battery device.
>
> acpi -> ACPI
> pmic -> PMIC
> dsdt -> DSDT (perhaps not here, but just in case)
Will fix for v2, note for the rest of the series, to avoid
spamming everyone with a lot of comments I will just fix
everything and send a v2 unless I've a specific remark.
>> @@ -31,6 +31,7 @@
>> #include <linux/delay.h>
>> #include <linux/slab.h>
>> #include <linux/suspend.h>
>> +#include <linux/mutex.h>
>
> Keep in alphabetical order ?
I'm a fan of having headers in alphabetical order myself,
but if you look at the actual file, rather then the diff
context, you will see that this file uses random order.
>> #include <linux/acpi.h>
>> #include <linux/power_supply.h>
>> +#include <linux/power/acpi.h>
>
> Ditto. (though I don't remember which is first _ or /)
>
>> + /* Check if acpi_battery_unregister got called before _init()
>> */
>
> acpi_battery_unregister -> acpi_battery_unregister() ?
>
>> + mutex_lock(&init_state_mutex);
>> + if (init_state != BAT_NONE)
>> + goto out_unlock;
>> +
>> async_cookie = async_schedule(acpi_battery_init_async, NULL);
>> + init_state = BAT_INITIALIZED;
>
> + empty line here...
Both fixed for v2.
>
>> +out_unlock:
>> + mutex_unlock(&init_state_mutex);
>
>> +
>
> ...instead of this ?
>
>> +++ b/include/linux/power/acpi.h
>
> E.g. for GPIO we keep such things directly in linux/acpi.h. Does it make
> sense to have separate one in this case?
I've taken include/acpi/video.h as example here. TBH I do not think
shoving everything acpi related into linux/acpi.h is a good idea.
Regards,
Hans
next prev parent reply other threads:[~2017-03-20 13:05 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-16 16:15 [PATCH 0/4] Avoid duplicate registering of ACPI and native power-supplies Hans de Goede
2017-03-16 16:15 ` [PATCH 1/4] acpi: battery: Add acpi_battery_unregister() function Hans de Goede
2017-03-16 16:29 ` Andy Shevchenko
2017-03-20 13:03 ` Hans de Goede [this message]
2017-03-20 13:10 ` Andy Shevchenko
2017-03-20 13:11 ` Hans de Goede
2017-03-27 1:16 ` Zheng, Lv
2017-03-31 8:53 ` Hans de Goede
2017-03-31 9:00 ` Hans de Goede
2017-03-16 16:15 ` [PATCH 2/4] acpi: ac: Add acpi_ac_unregister() function Hans de Goede
2017-03-16 16:31 ` Andy Shevchenko
2017-03-16 16:16 ` [PATCH 3/4] power: supply: axp288_fuel_gauge: Unregister duplicate ACPI battery supply Hans de Goede
2017-03-16 16:33 ` Andy Shevchenko
2017-03-20 13:07 ` Hans de Goede
2017-03-29 20:31 ` Rafael J. Wysocki
2017-03-31 9:01 ` Hans de Goede
2017-03-31 9:05 ` Rafael J. Wysocki
2017-03-31 9:08 ` Hans de Goede
2017-03-31 9:11 ` Rafael J. Wysocki
2017-03-31 9:57 ` Hans de Goede
2017-03-31 22:30 ` Rafael J. Wysocki
2017-04-01 13:22 ` Hans de Goede
2017-04-07 7:18 ` Hans de Goede
2017-04-10 7:31 ` Hans de Goede
2017-04-10 18:13 ` Hans de Goede
2017-04-10 20:01 ` Rafael J. Wysocki
2017-04-11 9:18 ` Hans de Goede
2017-04-11 13:51 ` Rafael J. Wysocki
2017-03-16 16:16 ` [PATCH 4/4] power: supply: axp288_charger: Unregister duplicate ACPI ac supply Hans de Goede
2017-03-16 16:34 ` Andy Shevchenko
2017-03-20 1:33 ` [PATCH 0/4] Avoid duplicate registering of ACPI and native power-supplies Sebastian Reichel
2017-03-20 13:11 ` Hans de Goede
2017-03-20 13:18 ` Andy Shevchenko
2017-03-20 13:19 ` Hans de Goede
2017-03-20 21:55 ` Rafael J. Wysocki
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=84d31794-d5c5-6f09-bbdb-9f5612ddbbbe@redhat.com \
--to=hdegoede@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=sre@kernel.org \
--cc=wens@csie.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;
as well as URLs for NNTP newsgroup(s).