2014-11-13 13:35:08

by Romain Perier

[permalink] [raw]
Subject: [PATCH v4 0/2] poweroff-source DT property renaming

The goal of this serie is to rename the property "poweroff-source" to
"system-power-controller". After discussions, it makes more sense to rename back
to the old established property name. This patches serie reverts
commit a4b4e0461ec5 ("of: Add standard property for poweroff capability").

Changes since v3:
- Move backward compatibility from of_is_system_power_controller to
tps65910, as it was only required for this driver.

Changes since v2:
- of_is_system_power_controller is inline in of.h and only supports
backward compatibility with device drivers which used this helper
(which is tps65910)
- Quashed all changes into a single patch (except documentation)
- Add a separated commit to fix typos and mispellings in documentation

Changes since v1:

- The first patch defines "of_is_system_power_controller" which is compatible
with both "vendor,system-power-controller" and "system-power-controller"
properties. Also, It keeps the old helper function of_system_has_poweroff_source
for source compatibility until everything is renamed (in this way, bisections
are not broken and change is made "atomically" between each commit)

Note: the property "poweroff-source" itself is not used in dts files yet.
Before this patch tps65910 was broken due to missing backward compatibility
with "vendor,system-power-controller". As the old helper uses the new one,
it works again.

- act8865 and tps65910 are ported to the new helper function
- The last commit removes the olf helper which was only used for source compatibility

Romain Perier (2):
of: Rename "poweroff-source" property to "system-power-controller"
dt-bindings: Update documentation for "system-power-controller" and
fix misspellings

.../devicetree/bindings/power/power-controller.txt | 18 ++++++++++++++++++
Documentation/devicetree/bindings/power/poweroff.txt | 18 ------------------
.../bindings/regulator/act8865-regulator.txt | 4 ++--
drivers/mfd/tps65910.c | 9 ++++++++-
drivers/regulator/act8865-regulator.c | 2 +-
include/linux/of.h | 6 +++---
6 files changed, 32 insertions(+), 25 deletions(-)
create mode 100644 Documentation/devicetree/bindings/power/power-controller.txt
delete mode 100644 Documentation/devicetree/bindings/power/poweroff.txt

--
1.9.1


2014-11-13 13:35:12

by Romain Perier

[permalink] [raw]
Subject: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

From: Romain Perier <[email protected]>

It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability").
As discussed on the mailing list, it makes more sense to rename back to the
old established property name, without the vendor prefix. Problem being that
the word "source" usually tends to be used for inputs and that is out of control
of the OS. The poweroff capability is an output which simply turns the
system-power off. Also, this property might be used by drivers which power-off
the system and power back on subsequent RTC alarms. This seems to suggest to
remove "poweroff" from the property name and to choose "system-power-controller"
as the more generic name. This patchs adds the required renaming changes and
defines an helper function which is compatible with both properties, the old one
which was only used by tps65910 and the new one without vendor-prefix.

Signed-off-by: Romain Perier <[email protected]>
---
.../bindings/power/{poweroff.txt => power-controller.txt} | 0
.../devicetree/bindings/regulator/act8865-regulator.txt | 4 ++--
drivers/mfd/tps65910.c | 9 ++++++++-
drivers/regulator/act8865-regulator.c | 2 +-
include/linux/of.h | 6 +++---
5 files changed, 14 insertions(+), 7 deletions(-)
rename Documentation/devicetree/bindings/power/{poweroff.txt => power-controller.txt} (100%)

diff --git a/Documentation/devicetree/bindings/power/poweroff.txt b/Documentation/devicetree/bindings/power/power-controller.txt
similarity index 100%
rename from Documentation/devicetree/bindings/power/poweroff.txt
rename to Documentation/devicetree/bindings/power/power-controller.txt
diff --git a/Documentation/devicetree/bindings/regulator/act8865-regulator.txt b/Documentation/devicetree/bindings/regulator/act8865-regulator.txt
index 01a5b07..dad6358 100644
--- a/Documentation/devicetree/bindings/regulator/act8865-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/act8865-regulator.txt
@@ -6,8 +6,8 @@ Required properties:
- reg: I2C slave address

Optional properties:
-- poweroff-source: Telling whether or not this pmic is controlling
- the system power. See Documentation/devicetree/bindings/power/poweroff.txt .
+- system-power-controller: Telling whether or not this pmic is controlling
+ the system power. See Documentation/devicetree/bindings/power/power-controller.txt .

Any standard regulator properties can be used to configure the single regulator.

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index b8dca8a..3a796a5 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -386,6 +386,13 @@ static const struct of_device_id tps65910_of_match[] = {
};
MODULE_DEVICE_TABLE(of, tps65910_of_match);

+static inline bool tps65910_is_pm_off_found(struct device_node *np)
+{
+ if (of_property_read_bool(np, "ti,system-power-controller"))
+ return true;
+ return of_is_system_power_controller(np);
+}
+
static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
unsigned long *chip_id)
{
@@ -423,7 +430,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,

board_info->irq = client->irq;
board_info->irq_base = -1;
- board_info->pm_off = of_system_has_poweroff_source(np);
+ board_info->pm_off = tps65910_is_pm_off_found(np);

return board_info;
}
diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index 76301ed..435aba1 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -365,7 +365,7 @@ static int act8865_pmic_probe(struct i2c_client *client,
return ret;
}

- if (of_system_has_poweroff_source(dev->of_node)) {
+ if (of_is_system_power_controller(dev->of_node)) {
if (!pm_power_off) {
act8865_i2c_client = client;
act8865->off_reg = off_reg;
diff --git a/include/linux/of.h b/include/linux/of.h
index d933717..f9541bc 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -965,14 +965,14 @@ static inline int of_changeset_update_property(struct of_changeset *ocs,
extern int of_resolve_phandles(struct device_node *tree);

/**
- * of_system_has_poweroff_source - Tells if poweroff-source is found for device_node
+ * of_is_system_power_controller - Tells if system-power-controller is found for device_node
* @np: Pointer to the given device_node
*
* return true if present false otherwise
*/
-static inline bool of_system_has_poweroff_source(const struct device_node *np)
+static inline bool of_is_system_power_controller(const struct device_node *np)
{
- return of_property_read_bool(np, "poweroff-source");
+ return of_property_read_bool(np, "system-power-controller");
}

#endif /* _LINUX_OF_H */
--
1.9.1

2014-11-13 13:35:40

by Romain Perier

[permalink] [raw]
Subject: [PATCH v4 2/2] dt-bindings: Update documentation for "system-power-controller" and fix misspellings

From: Romain Perier <[email protected]>

Signed-off-by: Romain Perier <[email protected]>
---
.../devicetree/bindings/power/power-controller.txt | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/Documentation/devicetree/bindings/power/power-controller.txt b/Documentation/devicetree/bindings/power/power-controller.txt
index 845868b..9afa847 100644
--- a/Documentation/devicetree/bindings/power/power-controller.txt
+++ b/Documentation/devicetree/bindings/power/power-controller.txt
@@ -1,18 +1,18 @@
-* Generic Poweroff capability
+* Generic system power control capability

-Power-management integrated circuits or miscellaneous harware components are
-sometimes able to control the system power. The device driver associated to these
-components might needs to define poweroff capability, which tells to the kernel
-how to switch off the system. The corresponding driver must have the standard
-property "poweroff-source" in its device node. This property marks the device as
-able to shutdown the system. In order to test if this property is found
-programmatically, use the helper function "of_system_has_poweroff_source" from
-of.h .
+Power-management integrated circuits or miscellaneous hardware components are
+sometimes able to control the system power. The device driver associated with these
+components might need to define this capability, which tells the kernel that
+it can be used to switch off the system. The corresponding device must have the
+standard property "system-power-controller" in its device node. This property
+marks the device as able to control the system power. In order to test if this
+property is found programmatically, use the helper function
+"of_is_system_power_controller" from of.h .

Example:

act8846: act8846@5 {
compatible = "active-semi,act8846";
status = "okay";
- poweroff-source;
+ system-power-controller;
}
--
1.9.1

2014-11-13 20:55:35

by Grant Likely

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

On Thu, 13 Nov 2014 13:34:58 +0000
, Auto Configured <[email protected]>
wrote:
> From: Romain Perier <[email protected]>
>
> It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability").
> As discussed on the mailing list, it makes more sense to rename back to the
> old established property name, without the vendor prefix. Problem being that
> the word "source" usually tends to be used for inputs and that is out of control
> of the OS. The poweroff capability is an output which simply turns the
> system-power off. Also, this property might be used by drivers which power-off
> the system and power back on subsequent RTC alarms. This seems to suggest to
> remove "poweroff" from the property name and to choose "system-power-controller"
> as the more generic name. This patchs adds the required renaming changes and
> defines an helper function which is compatible with both properties, the old one
> which was only used by tps65910 and the new one without vendor-prefix.
>
> Signed-off-by: Romain Perier <[email protected]>

Acked-by: Grant Likely <[email protected]>

Please merge via whichever tree needs this change.

g.

> ---
> .../bindings/power/{poweroff.txt => power-controller.txt} | 0
> .../devicetree/bindings/regulator/act8865-regulator.txt | 4 ++--
> drivers/mfd/tps65910.c | 9 ++++++++-
> drivers/regulator/act8865-regulator.c | 2 +-
> include/linux/of.h | 6 +++---
> 5 files changed, 14 insertions(+), 7 deletions(-)
> rename Documentation/devicetree/bindings/power/{poweroff.txt => power-controller.txt} (100%)
>
> diff --git a/Documentation/devicetree/bindings/power/poweroff.txt b/Documentation/devicetree/bindings/power/power-controller.txt
> similarity index 100%
> rename from Documentation/devicetree/bindings/power/poweroff.txt
> rename to Documentation/devicetree/bindings/power/power-controller.txt
> diff --git a/Documentation/devicetree/bindings/regulator/act8865-regulator.txt b/Documentation/devicetree/bindings/regulator/act8865-regulator.txt
> index 01a5b07..dad6358 100644
> --- a/Documentation/devicetree/bindings/regulator/act8865-regulator.txt
> +++ b/Documentation/devicetree/bindings/regulator/act8865-regulator.txt
> @@ -6,8 +6,8 @@ Required properties:
> - reg: I2C slave address
>
> Optional properties:
> -- poweroff-source: Telling whether or not this pmic is controlling
> - the system power. See Documentation/devicetree/bindings/power/poweroff.txt .
> +- system-power-controller: Telling whether or not this pmic is controlling
> + the system power. See Documentation/devicetree/bindings/power/power-controller.txt .
>
> Any standard regulator properties can be used to configure the single regulator.
>
> diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
> index b8dca8a..3a796a5 100644
> --- a/drivers/mfd/tps65910.c
> +++ b/drivers/mfd/tps65910.c
> @@ -386,6 +386,13 @@ static const struct of_device_id tps65910_of_match[] = {
> };
> MODULE_DEVICE_TABLE(of, tps65910_of_match);
>
> +static inline bool tps65910_is_pm_off_found(struct device_node *np)
> +{
> + if (of_property_read_bool(np, "ti,system-power-controller"))
> + return true;
> + return of_is_system_power_controller(np);
> +}
> +
> static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
> unsigned long *chip_id)
> {
> @@ -423,7 +430,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
>
> board_info->irq = client->irq;
> board_info->irq_base = -1;
> - board_info->pm_off = of_system_has_poweroff_source(np);
> + board_info->pm_off = tps65910_is_pm_off_found(np);
>
> return board_info;
> }
> diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
> index 76301ed..435aba1 100644
> --- a/drivers/regulator/act8865-regulator.c
> +++ b/drivers/regulator/act8865-regulator.c
> @@ -365,7 +365,7 @@ static int act8865_pmic_probe(struct i2c_client *client,
> return ret;
> }
>
> - if (of_system_has_poweroff_source(dev->of_node)) {
> + if (of_is_system_power_controller(dev->of_node)) {
> if (!pm_power_off) {
> act8865_i2c_client = client;
> act8865->off_reg = off_reg;
> diff --git a/include/linux/of.h b/include/linux/of.h
> index d933717..f9541bc 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -965,14 +965,14 @@ static inline int of_changeset_update_property(struct of_changeset *ocs,
> extern int of_resolve_phandles(struct device_node *tree);
>
> /**
> - * of_system_has_poweroff_source - Tells if poweroff-source is found for device_node
> + * of_is_system_power_controller - Tells if system-power-controller is found for device_node
> * @np: Pointer to the given device_node
> *
> * return true if present false otherwise
> */
> -static inline bool of_system_has_poweroff_source(const struct device_node *np)
> +static inline bool of_is_system_power_controller(const struct device_node *np)
> {
> - return of_property_read_bool(np, "poweroff-source");
> + return of_property_read_bool(np, "system-power-controller");
> }
>
> #endif /* _LINUX_OF_H */
> --
> 1.9.1
>

2014-11-14 07:22:45

by Romain Perier

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

Hi,

Who should merge this serie ? as Mark merged the previous one it would
probably make sense to do the same here (at least, in my opinion)

Thanks for your feedbacks.

Have a nice day,
Romain

2014-11-13 21:55 GMT+01:00 Grant Likely <[email protected]>:
igned-off-by: Romain Perier <[email protected]>
>
> Acked-by: Grant Likely <[email protected]>
>
> Please merge via whichever tree needs this change.
>
> g.

2014-11-17 10:51:32

by Romain Perier

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

@Most of the people who were ranting about this serie: could you send
feedbacks please ?

2014-11-14 8:22 GMT+01:00 Romain Perier <[email protected]>:
> Hi,
>
> Who should merge this serie ? as Mark merged the previous one it would
> probably make sense to do the same here (at least, in my opinion)
>
> Thanks for your feedbacks.
>
> Have a nice day,
> Romain
>
> 2014-11-13 21:55 GMT+01:00 Grant Likely <[email protected]>:
> igned-off-by: Romain Perier <[email protected]>
>>
>> Acked-by: Grant Likely <[email protected]>
>>
>> Please merge via whichever tree needs this change.
>>
>> g.

2014-11-20 10:44:58

by Romain Perier

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

ping

2014-11-17 11:51 GMT+01:00 Romain Perier <[email protected]>:
> @Most of the people who were ranting about this serie: could you send
> feedbacks please ?
>
> 2014-11-14 8:22 GMT+01:00 Romain Perier <[email protected]>:
>> Hi,
>>
>> Who should merge this serie ? as Mark merged the previous one it would
>> probably make sense to do the same here (at least, in my opinion)
>>
>> Thanks for your feedbacks.
>>
>> Have a nice day,
>> Romain
>>
>> 2014-11-13 21:55 GMT+01:00 Grant Likely <[email protected]>:
>> igned-off-by: Romain Perier <[email protected]>
>>>
>>> Acked-by: Grant Likely <[email protected]>
>>>
>>> Please merge via whichever tree needs this change.
>>>
>>> g.

2014-11-21 10:59:55

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

On Thu, Nov 13, 2014 at 01:34:58PM +0000, Auto Configured wrote:
> From: Romain Perier <[email protected]>
>
> It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability").
> As discussed on the mailing list, it makes more sense to rename back to the
> old established property name, without the vendor prefix. Problem being that
> the word "source" usually tends to be used for inputs and that is out of control
> of the OS. The poweroff capability is an output which simply turns the
> system-power off. Also, this property might be used by drivers which power-off
> the system and power back on subsequent RTC alarms. This seems to suggest to
> remove "poweroff" from the property name and to choose "system-power-controller"
> as the more generic name. This patchs adds the required renaming changes and
> defines an helper function which is compatible with both properties, the old one
> which was only used by tps65910 and the new one without vendor-prefix.

Now this is a bit of a mess.

There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert
ti,system-power-controller DT property to poweroff-source"), which
breaks all dts using tps65910 since these are never updated to the now
retracted property name ("poweroff-source").

This one should simply be reverted ASAP.

> Signed-off-by: Romain Perier <[email protected]>
> ---
> .../bindings/power/{poweroff.txt => power-controller.txt} | 0
> .../devicetree/bindings/regulator/act8865-regulator.txt | 4 ++--
> drivers/mfd/tps65910.c | 9 ++++++++-
> drivers/regulator/act8865-regulator.c | 2 +-
> include/linux/of.h | 6 +++---
> 5 files changed, 14 insertions(+), 7 deletions(-)

Romain, what tree is this patch against? The changes to the tps65910
driver appears not to even be in the regulator tree, yet you asked Mark
to merge this. And the MFD maintainer is not even on CC.

Let's fix the breakage by reverting the offending commit in mfd. Then the
new standard name can be introduced in regulator alone (e.g. this patch
without the tps65910 bits) as nothing outside of regulator should be
using the new power-off feature (or binding) for act8865. Then other
drivers and dts can be converted to use the new property name (while
retaining backwards compatibility) for 3.20.

[ We should probably also consider adding an "of_device_is_" prefix to
the helper name for consistency. ]

Johan

2014-11-21 11:00:38

by Johan Hovold

[permalink] [raw]
Subject: [PATCH] Revert "mfd: tps65910: Convert ti,system-power-controller DT property to poweroff-source"

This reverts commit 25f833c1171d ("mfd: tps65910: Convert
ti,system-power-controller DT property to poweroff-source"), which
switched to a new device-tree property name for configuring the device
as a power-off controller, but failed to update the affected device-tree
sources and neither provided backward compatibility with the old
property name.

This fixes broken power-off functionality for all boards relying on
tps65910 to power off the system.

Signed-off-by: Johan Hovold <[email protected]>
---
drivers/mfd/tps65910.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index b8dca8a0db41..7612d89850dd 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -423,7 +423,8 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,

board_info->irq = client->irq;
board_info->irq_base = -1;
- board_info->pm_off = of_system_has_poweroff_source(np);
+ board_info->pm_off = of_property_read_bool(np,
+ "ti,system-power-controller");

return board_info;
}
--
2.0.4

2014-11-21 13:18:24

by Romain Perier

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

2014-11-21 11:59 GMT+01:00 Johan Hovold <[email protected]>:
> On Thu, Nov 13, 2014 at 01:34:58PM +0000, Auto Configured wrote:
>> From: Romain Perier <[email protected]>
>>
>> It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability").
>> As discussed on the mailing list, it makes more sense to rename back to the
>> old established property name, without the vendor prefix. Problem being that
>> the word "source" usually tends to be used for inputs and that is out of control
>> of the OS. The poweroff capability is an output which simply turns the
>> system-power off. Also, this property might be used by drivers which power-off
>> the system and power back on subsequent RTC alarms. This seems to suggest to
>> remove "poweroff" from the property name and to choose "system-power-controller"
>> as the more generic name. This patchs adds the required renaming changes and
>> defines an helper function which is compatible with both properties, the old one
>> which was only used by tps65910 and the new one without vendor-prefix.
>
> Now this is a bit of a mess.
>
> There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert
> ti,system-power-controller DT property to poweroff-source"), which
> breaks all dts using tps65910 since these are never updated to the now
> retracted property name ("poweroff-source").

No seriously ? yes, this is why I ask for feedbacks since 3 weeks... ^^

>
> This one should simply be reverted ASAP.
>
>> Signed-off-by: Romain Perier <[email protected]>
>> ---
>> .../bindings/power/{poweroff.txt => power-controller.txt} | 0
>> .../devicetree/bindings/regulator/act8865-regulator.txt | 4 ++--
>> drivers/mfd/tps65910.c | 9 ++++++++-
>> drivers/regulator/act8865-regulator.c | 2 +-
>> include/linux/of.h | 6 +++---
>> 5 files changed, 14 insertions(+), 7 deletions(-)
>
> Romain, what tree is this patch against? The changes to the tps65910
> driver appears not to even be in the regulator tree, yet you asked Mark
> to merge this. And the MFD maintainer is not even on CC.


I work with linux-next, this patch is present in that tree. If I
remember correctly, it was merged by Lee Jones (so it was merged onto
the mfd tree)

>
> Let's fix the breakage by reverting the offending commit in mfd. Then the
> new standard name can be introduced in regulator alone (e.g. this patch
> without the tps65910 bits) as nothing outside of regulator should be
> using the new power-off feature (or binding) for act8865. Then other
> drivers and dts can be converted to use the new property name (while
> retaining backwards compatibility) for 3.20.
>
> [ We should probably also consider adding an "of_device_is_" prefix to
> the helper name for consistency. ]
>
> Johan

Maintainers, Mark, Grant, Lee, what do you think ?

Thanks,
Romain

2014-11-21 13:22:48

by Romain Perier

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

2014-11-21 14:18 GMT+01:00 Romain Perier <[email protected]>:

> it was merged by Lee Jones (so it was merged onto
> the mfd tree)

It was done, for a previous serie, not this one . This is when I
proposed to update the dts too (for all boards using the custom
property) until the discussion turned into a troll.

Romain

2014-11-24 10:25:06

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

On Fri, 21 Nov 2014, Johan Hovold wrote:

> On Thu, Nov 13, 2014 at 01:34:58PM +0000, Auto Configured wrote:
> > From: Romain Perier <[email protected]>
> >
> > It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability").
> > As discussed on the mailing list, it makes more sense to rename back to the
> > old established property name, without the vendor prefix. Problem being that
> > the word "source" usually tends to be used for inputs and that is out of control
> > of the OS. The poweroff capability is an output which simply turns the
> > system-power off. Also, this property might be used by drivers which power-off
> > the system and power back on subsequent RTC alarms. This seems to suggest to
> > remove "poweroff" from the property name and to choose "system-power-controller"
> > as the more generic name. This patchs adds the required renaming changes and
> > defines an helper function which is compatible with both properties, the old one
> > which was only used by tps65910 and the new one without vendor-prefix.
>
> Now this is a bit of a mess.
>
> There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert
> ti,system-power-controller DT property to poweroff-source"), which
> breaks all dts using tps65910 since these are never updated to the now
> retracted property name ("poweroff-source").

My word!

Romain, what conversation on the MLs are you talking about?

> This one should simply be reverted ASAP.

No need to revert, I can just remove the patch from the MFD tree.

> > Signed-off-by: Romain Perier <[email protected]>
> > ---
> > .../bindings/power/{poweroff.txt => power-controller.txt} | 0
> > .../devicetree/bindings/regulator/act8865-regulator.txt | 4 ++--
> > drivers/mfd/tps65910.c | 9 ++++++++-
> > drivers/regulator/act8865-regulator.c | 2 +-
> > include/linux/of.h | 6 +++---
> > 5 files changed, 14 insertions(+), 7 deletions(-)
>
> Romain, what tree is this patch against? The changes to the tps65910
> driver appears not to even be in the regulator tree, yet you asked Mark
> to merge this. And the MFD maintainer is not even on CC.
>
> Let's fix the breakage by reverting the offending commit in mfd. Then the
> new standard name can be introduced in regulator alone (e.g. this patch
> without the tps65910 bits) as nothing outside of regulator should be
> using the new power-off feature (or binding) for act8865. Then other
> drivers and dts can be converted to use the new property name (while
> retaining backwards compatibility) for 3.20.
>
> [ We should probably also consider adding an "of_device_is_" prefix to
> the helper name for consistency. ]
>
> Johan

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2014-11-24 11:35:24

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

On Mon, Nov 24, 2014 at 10:24:56AM +0000, Lee Jones wrote:
> On Fri, 21 Nov 2014, Johan Hovold wrote:
> > On Thu, Nov 13, 2014 at 01:34:58PM +0000, Auto Configured wrote:
> > > From: Romain Perier <[email protected]>
> > >
> > > It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability").
> > > As discussed on the mailing list, it makes more sense to rename back to the
> > > old established property name, without the vendor prefix. Problem being that
> > > the word "source" usually tends to be used for inputs and that is out of control
> > > of the OS. The poweroff capability is an output which simply turns the
> > > system-power off. Also, this property might be used by drivers which power-off
> > > the system and power back on subsequent RTC alarms. This seems to suggest to
> > > remove "poweroff" from the property name and to choose "system-power-controller"
> > > as the more generic name. This patchs adds the required renaming changes and
> > > defines an helper function which is compatible with both properties, the old one
> > > which was only used by tps65910 and the new one without vendor-prefix.
> >
> > Now this is a bit of a mess.
> >
> > There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert
> > ti,system-power-controller DT property to poweroff-source"), which
> > breaks all dts using tps65910 since these are never updated to the now
> > retracted property name ("poweroff-source").
>
> My word!
>
> Romain, what conversation on the MLs are you talking about?

I think Romain is referring to this thread:

https://lkml.org/lkml/2014/10/23/161

> > This one should simply be reverted ASAP.
>
> No need to revert, I can just remove the patch from the MFD tree.

Ok, good. Then this is limited to the regulator tree, and we could
proceed as I outlined below.

> > > Signed-off-by: Romain Perier <[email protected]>
> > > ---
> > > .../bindings/power/{poweroff.txt => power-controller.txt} | 0
> > > .../devicetree/bindings/regulator/act8865-regulator.txt | 4 ++--
> > > drivers/mfd/tps65910.c | 9 ++++++++-
> > > drivers/regulator/act8865-regulator.c | 2 +-
> > > include/linux/of.h | 6 +++---
> > > 5 files changed, 14 insertions(+), 7 deletions(-)
> >
> > Romain, what tree is this patch against? The changes to the tps65910
> > driver appears not to even be in the regulator tree, yet you asked Mark
> > to merge this. And the MFD maintainer is not even on CC.
> >
> > Let's fix the breakage by reverting the offending commit in mfd. Then the
> > new standard name can be introduced in regulator alone (e.g. this patch
> > without the tps65910 bits) as nothing outside of regulator should be
> > using the new power-off feature (or binding) for act8865. Then other
> > drivers and dts can be converted to use the new property name (while
> > retaining backwards compatibility) for 3.20.
> >
> > [ We should probably also consider adding an "of_device_is_" prefix to
> > the helper name for consistency. ]

Romain, care to resend this patch without the tps65910 chunks?

You should also fix the commit message, which claims to define a "helper
function which is compatible with both properties", something which was
no longer the case.

Thanks,
Johan

2014-11-24 12:58:54

by Romain Perier

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

2014-11-24 12:35 GMT+01:00 Johan Hovold <[email protected]>:
> On Mon, Nov 24, 2014 at 10:24:56AM +0000, Lee Jones wrote:
>> On Fri, 21 Nov 2014, Johan Hovold wrote:
>> > On Thu, Nov 13, 2014 at 01:34:58PM +0000, Auto Configured wrote:
>> > > From: Romain Perier <[email protected]>
>> > >
>> > > It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability").
>> > > As discussed on the mailing list, it makes more sense to rename back to the
>> > > old established property name, without the vendor prefix. Problem being that
>> > > the word "source" usually tends to be used for inputs and that is out of control
>> > > of the OS. The poweroff capability is an output which simply turns the
>> > > system-power off. Also, this property might be used by drivers which power-off
>> > > the system and power back on subsequent RTC alarms. This seems to suggest to
>> > > remove "poweroff" from the property name and to choose "system-power-controller"
>> > > as the more generic name. This patchs adds the required renaming changes and
>> > > defines an helper function which is compatible with both properties, the old one
>> > > which was only used by tps65910 and the new one without vendor-prefix.
>> >
>> > Now this is a bit of a mess.
>> >
>> > There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert
>> > ti,system-power-controller DT property to poweroff-source"), which
>> > breaks all dts using tps65910 since these are never updated to the now
>> > retracted property name ("poweroff-source").
>>
>> My word!
>>
>> Romain, what conversation on the MLs are you talking about?
>
> I think Romain is referring to this thread:
>
> https://lkml.org/lkml/2014/10/23/161

Yes, this is this one.

>
>> > This one should simply be reverted ASAP.
>>
>> No need to revert, I can just remove the patch from the MFD tree.
>
> Ok, good. Then this is limited to the regulator tree, and we could
> proceed as I outlined below.
>
>
> Romain, care to resend this patch without the tps65910 chunks?

If you can just drop the patch from mfd tree Lee, please do.
Yes Johan, np, what I want is that we find a smart solution, nothing more.

>
> You should also fix the commit message, which claims to define a "helper
> function which is compatible with both properties", something which was
> no longer the case.
>
> Thanks,
> Johan

So I need to resend this patch which would only introduce an helper
function which checks for "system-power-controller" property (it would
also have a new commit message).
As you suggested, this helper might be named
"of_device_is_system_power_controller" ?

Everything is okay ?

Romain

2014-11-24 13:01:06

by Romain Perier

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

2014-11-24 13:58 GMT+01:00 Romain Perier <[email protected]>:
> 2014-11-24 12:35 GMT+01:00 Johan Hovold <[email protected]>:
>> On Mon, Nov 24, 2014 at 10:24:56AM +0000, Lee Jones wrote:
>>> On Fri, 21 Nov 2014, Johan Hovold wrote:
>>> > On Thu, Nov 13, 2014 at 01:34:58PM +0000, Auto Configured wrote:
>>> > > From: Romain Perier <[email protected]>
>>> > >
>>> > > It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability").
>>> > > As discussed on the mailing list, it makes more sense to rename back to the
>>> > > old established property name, without the vendor prefix. Problem being that
>>> > > the word "source" usually tends to be used for inputs and that is out of control
>>> > > of the OS. The poweroff capability is an output which simply turns the
>>> > > system-power off. Also, this property might be used by drivers which power-off
>>> > > the system and power back on subsequent RTC alarms. This seems to suggest to
>>> > > remove "poweroff" from the property name and to choose "system-power-controller"
>>> > > as the more generic name. This patchs adds the required renaming changes and
>>> > > defines an helper function which is compatible with both properties, the old one
>>> > > which was only used by tps65910 and the new one without vendor-prefix.
>>> >
>>> > Now this is a bit of a mess.
>>> >
>>> > There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert
>>> > ti,system-power-controller DT property to poweroff-source"), which
>>> > breaks all dts using tps65910 since these are never updated to the now
>>> > retracted property name ("poweroff-source").
>>>
>>> My word!
>>>
>>> Romain, what conversation on the MLs are you talking about?
>>
>> I think Romain is referring to this thread:
>>
>> https://lkml.org/lkml/2014/10/23/161
>
> Yes, this is this one.
>
>>
>>> > This one should simply be reverted ASAP.
>>>
>>> No need to revert, I can just remove the patch from the MFD tree.
>>
>> Ok, good. Then this is limited to the regulator tree, and we could
>> proceed as I outlined below.
>>
>>
>> Romain, care to resend this patch without the tps65910 chunks?
>
> If you can just drop the patch from mfd tree Lee, please do.
> Yes Johan, np, what I want is that we find a smart solution, nothing more.
>
>>
>> You should also fix the commit message, which claims to define a "helper
>> function which is compatible with both properties", something which was
>> no longer the case.
>>
>> Thanks,
>> Johan
>
> So I need to resend this patch which would only introduce an helper
> function which checks for "system-power-controller" property (it would
> also have a new commit message).
> As you suggested, this helper might be named
> "of_device_is_system_power_controller" ?

I mean, the backward compatibility can be handled directly from the
device driver which would use the new property, no ?

2014-11-24 13:08:39

by Heiko Stübner

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

Am Montag, 24. November 2014, 14:01:02 schrieb Romain Perier:
> 2014-11-24 13:58 GMT+01:00 Romain Perier <[email protected]>:
> > So I need to resend this patch which would only introduce an helper
> > function which checks for "system-power-controller" property (it would
> > also have a new commit message).
> > As you suggested, this helper might be named
> > "of_device_is_system_power_controller" ?
>
> I mean, the backward compatibility can be handled directly from the
> device driver which would use the new property, no ?

yep, that is what Grant asked for ... to have drivers that need backward-
compatibility (like with the "ti,"-prefix) to do this themselfs.


Heiko

2014-11-24 13:21:09

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

On Mon, Nov 24, 2014 at 01:58:50PM +0100, Romain Perier wrote:
> 2014-11-24 12:35 GMT+01:00 Johan Hovold <[email protected]>:

> > You should also fix the commit message, which claims to define a "helper
> > function which is compatible with both properties", something which was
> > no longer the case.
> >
> So I need to resend this patch which would only introduce an helper
> function which checks for "system-power-controller" property (it would
> also have a new commit message).
> As you suggested, this helper might be named
> "of_device_is_system_power_controller" ?

Correct. Rename the helper and property name you introduced to
"of_device_is_system_power_controller" and "system-power-controller" and
update the act8865 driver to use the new names (all in one patch).

Send the patch to Mark (and keep everyone else one CC) so he can apply
it to the regulator tree.

Other drivers that are currently using "ti,system-power-controller" can
continue to do so (for backward compatibility), while we later also add
a call to your helper function (and update binding documentation) and
also update the device trees for boards that use this functionality.

Thanks,
Johan