From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: "Sebastian Reichel" <sre@kernel.org>,
"Pali Rohár" <pali.rohar@gmail.com>, "Milo Kim" <milo.kim@ti.com>,
"Andreas Dannenberg" <dannenberg@ti.com>,
"Krzysztof Kozlowski" <k.kozlowski@samsung.com>,
"Hans de Goede" <hdegoede@redhat.com>,
"Liam Breck" <kernel@networkimprov.net>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCHv1 00/14] power: supply: Fix custom sysfs attribute registration
Date: Tue, 2 Oct 2018 16:00:38 -0700 [thread overview]
Message-ID: <20181002230038.GA11102@kroah.com> (raw)
In-Reply-To: <20180930220349.10515-1-sebastian.reichel@collabora.com>
On Mon, Oct 01, 2018 at 12:03:35AM +0200, Sebastian Reichel wrote:
> Hi,
>
> Udev may not detect sysfs attributes, that have been added
> after the device has been created. Code doing that is racy [0].
> The power-supply class properly registers its attributes
> when the device is created, but some drivers add additional
> custom attributes in a racy way.
>
> The first patch from this series adds native support for custom
> sysfs attributes to the power-supply subsystem. This feature
> allows cleaner code and avoids a race condition preventing udev
> from noticing the custom properties.
>
> The following patches replace all instances of sysfs_create_*
> in drivers/power/supply to use the new feature and a couple
> of small cleanups.
>
> TL;DR: This patchsets replaces all sysfs_create_* in power-supply.
>
> [0] http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/
>
> -- Sebastian
>
> Sebastian Reichel (14):
> power: supply: core: add support for custom sysfs attributes
> power: supply: bq2415x: fix race-condition in sysfs registration
> power: supply: ds2780: fix race-condition in sysfs registration
> power: supply: ds2781: fix race-condition in sysfs registration
> power: supply: lp8788: fix race-condition in sysfs registration
> power: supply: bq24190_charger: fix race-condition in sysfs
> registration
> power: supply: bq24257: fix race-condition in sysfs registration
> power: supply: charger-manager: simplify generation of sysfs attribute
> group name
> power: supply: charger-manager: fix race-condition in sysfs
> registration
> power: supply: pcf50633: fix race-condition in sysfs registration
> power: supply: ds2780: fix race-condition in bin attribute
> registration
> power: supply: ds2781: fix race-condition in bin attribute
> registration
> power: supply: ds2780: switch to devm_power_supply_register
> power: supply: ds2781: switch to devm_power_supply_register
>
> drivers/power/supply/bq2415x_charger.c | 119 ++++++++++-------------
> drivers/power/supply/bq24190_charger.c | 43 ++------
> drivers/power/supply/bq24257_charger.c | 15 +--
> drivers/power/supply/charger-manager.c | 62 +++++-------
> drivers/power/supply/ds2780_battery.c | 87 +++++------------
> drivers/power/supply/ds2781_battery.c | 82 +++++-----------
> drivers/power/supply/lp8788-charger.c | 62 +++++-------
> drivers/power/supply/pcf50633-charger.c | 17 ++--
> drivers/power/supply/power_supply_core.c | 1 +
> include/linux/power/charger-manager.h | 3 +-
> include/linux/power_supply.h | 3 +
> 11 files changed, 172 insertions(+), 322 deletions(-)
Nice work, and it removes more code than it adds, always a win.
greg k-h
prev parent reply other threads:[~2018-10-02 23:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-30 22:03 Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 01/14] power: supply: core: add support for custom sysfs attributes Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 02/14] power: supply: bq2415x: fix race-condition in sysfs registration Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 03/14] power: supply: ds2780: " Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 04/14] power: supply: ds2781: " Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 05/14] power: supply: lp8788: " Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 06/14] power: supply: bq24190_charger: " Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 07/14] power: supply: bq24257: " Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 08/14] power: supply: charger-manager: simplify generation of sysfs attribute group name Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 09/14] power: supply: charger-manager: fix race-condition in sysfs registration Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 10/14] power: supply: pcf50633: " Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 11/14] power: supply: ds2780: fix race-condition in bin attribute registration Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 12/14] power: supply: ds2781: " Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 13/14] power: supply: ds2780: switch to devm_power_supply_register Sebastian Reichel
2018-09-30 22:03 ` [PATCHv1 14/14] power: supply: ds2781: " Sebastian Reichel
2018-10-02 23:00 ` Greg Kroah-Hartman [this message]
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=20181002230038.GA11102@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=dannenberg@ti.com \
--cc=hdegoede@redhat.com \
--cc=k.kozlowski@samsung.com \
--cc=kernel@networkimprov.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=milo.kim@ti.com \
--cc=pali.rohar@gmail.com \
--cc=sebastian.reichel@collabora.com \
--cc=sre@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
Powered by JetHome