diff mbox series

[2/3] dt-bindings: rtc: moxart: use proper names for gpio properties

Message ID 20230201054815.4112632-2-dmitry.torokhov@gmail.com
State Accepted
Headers show
Series [1/3] rtc: moxart: switch to using gpiod API | expand

Commit Message

Dmitry Torokhov Feb. 1, 2023, 5:48 a.m. UTC
MOXA ART RTC driver has been switched to gpiod API and is now using
properly named properties for its gpios (with gpiolib implementing a
quirk to recognize legacy names). Change binding document to use
proper names as well.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 .../devicetree/bindings/rtc/moxa,moxart-rtc.txt      | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Krzysztof Kozlowski Feb. 1, 2023, 7:38 a.m. UTC | #1
On 01/02/2023 06:48, Dmitry Torokhov wrote:
> MOXA ART RTC driver has been switched to gpiod API and is now using
> properly named properties for its gpios (with gpiolib implementing a
> quirk to recognize legacy names). Change binding document to use
> proper names as well.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>  .../devicetree/bindings/rtc/moxa,moxart-rtc.txt      | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> index c9d3ac1477fe..1374df7bf9d6 100644
> --- a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> +++ b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> @@ -3,15 +3,15 @@ MOXA ART real-time clock
>  Required properties:
>  
>  - compatible : Should be "moxa,moxart-rtc"
> -- gpio-rtc-sclk : RTC sclk gpio, with zero flags
> -- gpio-rtc-data : RTC data gpio, with zero flags
> -- gpio-rtc-reset : RTC reset gpio, with zero flags
> +- rtc-sclk-gpios : RTC sclk gpio, with zero flags
> +- rtc-data-gpios : RTC data gpio, with zero flags
> +- rtc-reset-gpios : RTC reset gpio, with zero flags

Your driver breaks the ABI, doesn't it? If not, how are the old
properties parsed?

Best regards,
Krzysztof
Dmitry Torokhov Feb. 1, 2023, 4:15 p.m. UTC | #2
On Wed, Feb 01, 2023 at 08:38:48AM +0100, Krzysztof Kozlowski wrote:
> On 01/02/2023 06:48, Dmitry Torokhov wrote:
> > MOXA ART RTC driver has been switched to gpiod API and is now using
> > properly named properties for its gpios (with gpiolib implementing a
> > quirk to recognize legacy names). Change binding document to use
> > proper names as well.
> > 
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
> >  .../devicetree/bindings/rtc/moxa,moxart-rtc.txt      | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > index c9d3ac1477fe..1374df7bf9d6 100644
> > --- a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > +++ b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > @@ -3,15 +3,15 @@ MOXA ART real-time clock
> >  Required properties:
> >  
> >  - compatible : Should be "moxa,moxart-rtc"
> > -- gpio-rtc-sclk : RTC sclk gpio, with zero flags
> > -- gpio-rtc-data : RTC data gpio, with zero flags
> > -- gpio-rtc-reset : RTC reset gpio, with zero flags
> > +- rtc-sclk-gpios : RTC sclk gpio, with zero flags
> > +- rtc-data-gpios : RTC data gpio, with zero flags
> > +- rtc-reset-gpios : RTC reset gpio, with zero flags
> 
> Your driver breaks the ABI, doesn't it? If not, how are the old
> properties parsed?

It does not. As I mentioned in the driver code patch, commit
eaf1a29665cd ("gpiolib: of: add a quirk for legacy names in MOXA ART
RTC") makes sure gpiolib falls back to trying old variants if it can't
locate properly formatted names.

Thanks.
Rob Herring (Arm) Feb. 1, 2023, 5:55 p.m. UTC | #3
On Wed, Feb 01, 2023 at 08:15:26AM -0800, Dmitry Torokhov wrote:
> On Wed, Feb 01, 2023 at 08:38:48AM +0100, Krzysztof Kozlowski wrote:
> > On 01/02/2023 06:48, Dmitry Torokhov wrote:
> > > MOXA ART RTC driver has been switched to gpiod API and is now using
> > > properly named properties for its gpios (with gpiolib implementing a
> > > quirk to recognize legacy names). Change binding document to use
> > > proper names as well.
> > > 
> > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > ---
> > >  .../devicetree/bindings/rtc/moxa,moxart-rtc.txt      | 12 ++++++------
> > >  1 file changed, 6 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > index c9d3ac1477fe..1374df7bf9d6 100644
> > > --- a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > +++ b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > @@ -3,15 +3,15 @@ MOXA ART real-time clock
> > >  Required properties:
> > >  
> > >  - compatible : Should be "moxa,moxart-rtc"
> > > -- gpio-rtc-sclk : RTC sclk gpio, with zero flags
> > > -- gpio-rtc-data : RTC data gpio, with zero flags
> > > -- gpio-rtc-reset : RTC reset gpio, with zero flags
> > > +- rtc-sclk-gpios : RTC sclk gpio, with zero flags
> > > +- rtc-data-gpios : RTC data gpio, with zero flags
> > > +- rtc-reset-gpios : RTC reset gpio, with zero flags
> > 
> > Your driver breaks the ABI, doesn't it? If not, how are the old
> > properties parsed?
> 
> It does not. As I mentioned in the driver code patch, commit
> eaf1a29665cd ("gpiolib: of: add a quirk for legacy names in MOXA ART
> RTC") makes sure gpiolib falls back to trying old variants if it can't
> locate properly formatted names.

A dtb with the new names and a kernel without the gpiod conversion would 
be broken. Up to the platform whether they care really.

Rob
Dmitry Torokhov Feb. 1, 2023, 7:02 p.m. UTC | #4
On Wed, Feb 01, 2023 at 11:55:04AM -0600, Rob Herring wrote:
> On Wed, Feb 01, 2023 at 08:15:26AM -0800, Dmitry Torokhov wrote:
> > On Wed, Feb 01, 2023 at 08:38:48AM +0100, Krzysztof Kozlowski wrote:
> > > On 01/02/2023 06:48, Dmitry Torokhov wrote:
> > > > MOXA ART RTC driver has been switched to gpiod API and is now using
> > > > properly named properties for its gpios (with gpiolib implementing a
> > > > quirk to recognize legacy names). Change binding document to use
> > > > proper names as well.
> > > > 
> > > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > > ---
> > > >  .../devicetree/bindings/rtc/moxa,moxart-rtc.txt      | 12 ++++++------
> > > >  1 file changed, 6 insertions(+), 6 deletions(-)
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > > index c9d3ac1477fe..1374df7bf9d6 100644
> > > > --- a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > > +++ b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > > @@ -3,15 +3,15 @@ MOXA ART real-time clock
> > > >  Required properties:
> > > >  
> > > >  - compatible : Should be "moxa,moxart-rtc"
> > > > -- gpio-rtc-sclk : RTC sclk gpio, with zero flags
> > > > -- gpio-rtc-data : RTC data gpio, with zero flags
> > > > -- gpio-rtc-reset : RTC reset gpio, with zero flags
> > > > +- rtc-sclk-gpios : RTC sclk gpio, with zero flags
> > > > +- rtc-data-gpios : RTC data gpio, with zero flags
> > > > +- rtc-reset-gpios : RTC reset gpio, with zero flags
> > > 
> > > Your driver breaks the ABI, doesn't it? If not, how are the old
> > > properties parsed?
> > 
> > It does not. As I mentioned in the driver code patch, commit
> > eaf1a29665cd ("gpiolib: of: add a quirk for legacy names in MOXA ART
> > RTC") makes sure gpiolib falls back to trying old variants if it can't
> > locate properly formatted names.
> 
> A dtb with the new names and a kernel without the gpiod conversion would 
> be broken. Up to the platform whether they care really.

Seriously? And I guess devices with DTS do not work with kernels v2.0 so
we should never have introduced it...

I understand wanting backward compatibility, but asking for both
backward and forward is a bit too much IMO.

Thanks.
Rob Herring (Arm) Feb. 2, 2023, 11:27 p.m. UTC | #5
On Wed, Feb 01, 2023 at 11:02:39AM -0800, Dmitry Torokhov wrote:
> On Wed, Feb 01, 2023 at 11:55:04AM -0600, Rob Herring wrote:
> > On Wed, Feb 01, 2023 at 08:15:26AM -0800, Dmitry Torokhov wrote:
> > > On Wed, Feb 01, 2023 at 08:38:48AM +0100, Krzysztof Kozlowski wrote:
> > > > On 01/02/2023 06:48, Dmitry Torokhov wrote:
> > > > > MOXA ART RTC driver has been switched to gpiod API and is now using
> > > > > properly named properties for its gpios (with gpiolib implementing a
> > > > > quirk to recognize legacy names). Change binding document to use
> > > > > proper names as well.
> > > > > 
> > > > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > > > ---
> > > > >  .../devicetree/bindings/rtc/moxa,moxart-rtc.txt      | 12 ++++++------
> > > > >  1 file changed, 6 insertions(+), 6 deletions(-)
> > > > > 
> > > > > diff --git a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > > > index c9d3ac1477fe..1374df7bf9d6 100644
> > > > > --- a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > > > +++ b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > > > @@ -3,15 +3,15 @@ MOXA ART real-time clock
> > > > >  Required properties:
> > > > >  
> > > > >  - compatible : Should be "moxa,moxart-rtc"
> > > > > -- gpio-rtc-sclk : RTC sclk gpio, with zero flags
> > > > > -- gpio-rtc-data : RTC data gpio, with zero flags
> > > > > -- gpio-rtc-reset : RTC reset gpio, with zero flags
> > > > > +- rtc-sclk-gpios : RTC sclk gpio, with zero flags
> > > > > +- rtc-data-gpios : RTC data gpio, with zero flags
> > > > > +- rtc-reset-gpios : RTC reset gpio, with zero flags
> > > > 
> > > > Your driver breaks the ABI, doesn't it? If not, how are the old
> > > > properties parsed?
> > > 
> > > It does not. As I mentioned in the driver code patch, commit
> > > eaf1a29665cd ("gpiolib: of: add a quirk for legacy names in MOXA ART
> > > RTC") makes sure gpiolib falls back to trying old variants if it can't
> > > locate properly formatted names.
> > 
> > A dtb with the new names and a kernel without the gpiod conversion would 
> > be broken. Up to the platform whether they care really.
> 
> Seriously? And I guess devices with DTS do not work with kernels v2.0 so
> we should never have introduced it...

They would be fine because they would ignore the dtb. ;)

> I understand wanting backward compatibility, but asking for both
> backward and forward is a bit too much IMO.

Like I said, up to the platform to decide. I'm just defining what's an 
ABI break or not.

If the dtb ships with firmware, do you want new firmware with a newer 
dtb to break your OS? We can sometimes mitigate that with stable kernel 
updates. There are obvious cases that don't work such as adding 
providers such as clocks (instead of dummy fixed clocks) or pinctrl, 
where old kernels will never have the driver (but doesn't know that).

Rob
Dmitry Torokhov Feb. 3, 2023, 10:22 p.m. UTC | #6
On Thu, Feb 02, 2023 at 05:27:34PM -0600, Rob Herring wrote:
> On Wed, Feb 01, 2023 at 11:02:39AM -0800, Dmitry Torokhov wrote:
> > On Wed, Feb 01, 2023 at 11:55:04AM -0600, Rob Herring wrote:
> > > On Wed, Feb 01, 2023 at 08:15:26AM -0800, Dmitry Torokhov wrote:
> > > > On Wed, Feb 01, 2023 at 08:38:48AM +0100, Krzysztof Kozlowski wrote:
> > > > > On 01/02/2023 06:48, Dmitry Torokhov wrote:
> > > > > > MOXA ART RTC driver has been switched to gpiod API and is now using
> > > > > > properly named properties for its gpios (with gpiolib implementing a
> > > > > > quirk to recognize legacy names). Change binding document to use
> > > > > > proper names as well.
> > > > > > 
> > > > > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > > > > ---
> > > > > >  .../devicetree/bindings/rtc/moxa,moxart-rtc.txt      | 12 ++++++------
> > > > > >  1 file changed, 6 insertions(+), 6 deletions(-)
> > > > > > 
> > > > > > diff --git a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > > > > index c9d3ac1477fe..1374df7bf9d6 100644
> > > > > > --- a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > > > > +++ b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
> > > > > > @@ -3,15 +3,15 @@ MOXA ART real-time clock
> > > > > >  Required properties:
> > > > > >  
> > > > > >  - compatible : Should be "moxa,moxart-rtc"
> > > > > > -- gpio-rtc-sclk : RTC sclk gpio, with zero flags
> > > > > > -- gpio-rtc-data : RTC data gpio, with zero flags
> > > > > > -- gpio-rtc-reset : RTC reset gpio, with zero flags
> > > > > > +- rtc-sclk-gpios : RTC sclk gpio, with zero flags
> > > > > > +- rtc-data-gpios : RTC data gpio, with zero flags
> > > > > > +- rtc-reset-gpios : RTC reset gpio, with zero flags
> > > > > 
> > > > > Your driver breaks the ABI, doesn't it? If not, how are the old
> > > > > properties parsed?
> > > > 
> > > > It does not. As I mentioned in the driver code patch, commit
> > > > eaf1a29665cd ("gpiolib: of: add a quirk for legacy names in MOXA ART
> > > > RTC") makes sure gpiolib falls back to trying old variants if it can't
> > > > locate properly formatted names.
> > > 
> > > A dtb with the new names and a kernel without the gpiod conversion would 
> > > be broken. Up to the platform whether they care really.
> > 
> > Seriously? And I guess devices with DTS do not work with kernels v2.0 so
> > we should never have introduced it...
> 
> They would be fine because they would ignore the dtb. ;)
> 
> > I understand wanting backward compatibility, but asking for both
> > backward and forward is a bit too much IMO.
> 
> Like I said, up to the platform to decide. I'm just defining what's an 
> ABI break or not.
> 
> If the dtb ships with firmware, do you want new firmware with a newer 
> dtb to break your OS? We can sometimes mitigate that with stable kernel 
> updates. There are obvious cases that don't work such as adding 
> providers such as clocks (instead of dummy fixed clocks) or pinctrl, 
> where old kernels will never have the driver (but doesn't know that).

When vendors ship firmware they target particular set of software that
runs on it, so they would not mindlessly jump to the very latest version
of binding. Doing that would be similar to a vendor that originally
shipped a system with Windows 7 out of sudden changing its firmware to
use latest and greatest mechanisms defined in ACPI 6.5 and removing
older ones.

Thanks.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
index c9d3ac1477fe..1374df7bf9d6 100644
--- a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
+++ b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
@@ -3,15 +3,15 @@  MOXA ART real-time clock
 Required properties:
 
 - compatible : Should be "moxa,moxart-rtc"
-- gpio-rtc-sclk : RTC sclk gpio, with zero flags
-- gpio-rtc-data : RTC data gpio, with zero flags
-- gpio-rtc-reset : RTC reset gpio, with zero flags
+- rtc-sclk-gpios : RTC sclk gpio, with zero flags
+- rtc-data-gpios : RTC data gpio, with zero flags
+- rtc-reset-gpios : RTC reset gpio, with zero flags
 
 Example:
 
 	rtc: rtc {
 		compatible = "moxa,moxart-rtc";
-		gpio-rtc-sclk = <&gpio 5 0>;
-		gpio-rtc-data = <&gpio 6 0>;
-		gpio-rtc-reset = <&gpio 7 0>;
+		rtc-sclk-gpios = <&gpio 5 0>;
+		rtc-data-gpios = <&gpio 6 0>;
+		rtc-reset-gpios = <&gpio 7 0>;
 	};