Re: [PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios"

2021-04-10 Thread Greg Kroah-Hartman
On Fri, Apr 09, 2021 at 12:36:36PM -0700, Saravana Kannan wrote:
> On Fri, Apr 9, 2021 at 12:26 PM Rob Herring  wrote:
> >
> > On Wed, Apr 7, 2021 at 3:45 PM Ilya Lipnitskiy
> >  wrote:
> > >
> > > On Tue, Apr 6, 2021 at 6:24 PM Saravana Kannan  
> > > wrote:
> > > >
> > > > On Tue, Apr 6, 2021 at 6:10 PM Rob Herring  wrote:
> > > > >
> > > > > On Tue, Apr 6, 2021 at 7:46 PM Saravana Kannan  
> > > > > wrote:
> > > > > >
> > > > > > On Tue, Apr 6, 2021 at 5:34 PM Rob Herring  wrote:
> > > > > > >
> > > > > > > On Tue, Apr 06, 2021 at 04:09:10PM -0700, Saravana Kannan wrote:
> > > > > > > > On Mon, Apr 5, 2021 at 3:26 PM Ilya Lipnitskiy
> > > > > > > >  wrote:
> > > > > > > > >
> > > > > > > > > [,]nr-gpios property is used by some GPIO drivers[0] 
> > > > > > > > > to indicate
> > > > > > > > > the number of GPIOs present on a system, not define a GPIO. 
> > > > > > > > > nr-gpios is
> > > > > > > > > not configured by #gpio-cells and can't be parsed along with 
> > > > > > > > > other
> > > > > > > > > "*-gpios" properties.
> > > > > > > > >
> > > > > > > > > nr-gpios without the "," prefix is not allowed by the 
> > > > > > > > > DT
> > > > > > > > > spec[1], so only add exception for the ",nr-gpios" suffix and 
> > > > > > > > > let the
> > > > > > > > > error message continue being printed for non-compliant 
> > > > > > > > > implementations.
> > > > > > > > >
> > > > > > > > > [0]: nr-gpios is referenced in 
> > > > > > > > > Documentation/devicetree/bindings/gpio:
> > > > > > > > >  - gpio-adnp.txt
> > > > > > > > >  - gpio-xgene-sb.txt
> > > > > > > > >  - gpio-xlp.txt
> > > > > > > > >  - snps,dw-apb-gpio.yaml
> > > > > > > > >
> > > > > > > > > [1]:
> > > > > > > > > Link: 
> > > > > > > > > https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20
> > > > > > > > >
> > > > > > > > > Fixes errors such as:
> > > > > > > > >   OF: /palmbus@30/gpio@600: could not find phandle
> > > > > > > > >
> > > > > > > > > Fixes: 7f00be96f125 ("of: property: Add device link support 
> > > > > > > > > for interrupt-parent, dmas and -gpio(s)")
> > > > > > > > > Signed-off-by: Ilya Lipnitskiy 
> > > > > > > > > Cc: Saravana Kannan 
> > > > > > > > > Cc:  # 5.5.x
> > > > > > > > > ---
> > > > > > > > >  drivers/of/property.c | 11 ++-
> > > > > > > > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > > > > > > > >
> > > > > > > > > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > > > > > > > > index 2046ae311322..1793303e84ac 100644
> > > > > > > > > --- a/drivers/of/property.c
> > > > > > > > > +++ b/drivers/of/property.c
> > > > > > > > > @@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, 
> > > > > > > > > "pinctrl-7", NULL)
> > > > > > > > >  DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
> > > > > > > > >  DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
> > > > > > > > >  DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
> > > > > > > > > -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
> > > > > > > > > +
> > > > > > > > > +static struct device_node *parse_gpios(struct device_node 
> > > > > > > > > *np,
> > > > > > > > > +  const char *prop_name, 
> > > > > > > > > int index)
> > > > > > > > > +{
> > > > > > > > > +   if (!strcmp_suffix(prop_name, ",nr-gpios"))
> > > > > > > > > +   return NULL;
> > > > > > > >
> > > > > > > > Ah I somehow missed this patch. This gives a blanked exception 
> > > > > > > > for
> > > > > > > > vendor,nr-gpios. I'd prefer explicit exceptions for all the 
> > > > > > > > instances
> > > > > > > > of ",nr-gpios" we are grandfathering in. Any future additions 
> > > > > > > > should
> > > > > > > > be rejected. Can we do that please?
> > > > > > > >
> > > > > > > > Rob, you okay with making this list more explicit?
> > > > > > >
> > > > > > > Not the kernel's job IMO. A schema is the right way to handle 
> > > > > > > that.
> > > > > >
> > > > > > Ok, that's fine by me. Btw, let's land this in driver-core? I've 
> > > > > > made
> > > > > > changes there and this might cause conflicts. Not sure.
> > > > >
> > > > > It merges with linux-next fine. You'll need to resend this to Greg if
> > > > > you want to do that.
> > > > >
> > > > > Reviewed-by: Rob Herring 
> > > >
> > > > Hi Greg,
> > > >
> > > > Can you pull this into driver-core please?
> > > Do you want me to re-spin on top of driver-core? The patch is
> > > currently based on dt/next in robh/linux.git
> >
> > I did say you need to resend the patch to Greg, but since there's no
> > movement on this and I have other things to send upstream, I've
> > applied it.
> 
> :'(
> 
> If it's not too late, can we please drop it? I'm sure Greg would be
> okay with picking this up.

It's in Linus's tree, why does it matter who sends it in?

{sigh}


Re: [PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios"

2021-04-10 Thread Greg Kroah-Hartman
On Tue, Apr 06, 2021 at 06:24:21PM -0700, Saravana Kannan wrote:
> On Tue, Apr 6, 2021 at 6:10 PM Rob Herring  wrote:
> >
> > On Tue, Apr 6, 2021 at 7:46 PM Saravana Kannan  wrote:
> > >
> > > On Tue, Apr 6, 2021 at 5:34 PM Rob Herring  wrote:
> > > >
> > > > On Tue, Apr 06, 2021 at 04:09:10PM -0700, Saravana Kannan wrote:
> > > > > On Mon, Apr 5, 2021 at 3:26 PM Ilya Lipnitskiy
> > > > >  wrote:
> > > > > >
> > > > > > [,]nr-gpios property is used by some GPIO drivers[0] to 
> > > > > > indicate
> > > > > > the number of GPIOs present on a system, not define a GPIO. 
> > > > > > nr-gpios is
> > > > > > not configured by #gpio-cells and can't be parsed along with other
> > > > > > "*-gpios" properties.
> > > > > >
> > > > > > nr-gpios without the "," prefix is not allowed by the DT
> > > > > > spec[1], so only add exception for the ",nr-gpios" suffix and let 
> > > > > > the
> > > > > > error message continue being printed for non-compliant 
> > > > > > implementations.
> > > > > >
> > > > > > [0]: nr-gpios is referenced in 
> > > > > > Documentation/devicetree/bindings/gpio:
> > > > > >  - gpio-adnp.txt
> > > > > >  - gpio-xgene-sb.txt
> > > > > >  - gpio-xlp.txt
> > > > > >  - snps,dw-apb-gpio.yaml
> > > > > >
> > > > > > [1]:
> > > > > > Link: 
> > > > > > https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20
> > > > > >
> > > > > > Fixes errors such as:
> > > > > >   OF: /palmbus@30/gpio@600: could not find phandle
> > > > > >
> > > > > > Fixes: 7f00be96f125 ("of: property: Add device link support for 
> > > > > > interrupt-parent, dmas and -gpio(s)")
> > > > > > Signed-off-by: Ilya Lipnitskiy 
> > > > > > Cc: Saravana Kannan 
> > > > > > Cc:  # 5.5.x
> > > > > > ---
> > > > > >  drivers/of/property.c | 11 ++-
> > > > > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > > > > > index 2046ae311322..1793303e84ac 100644
> > > > > > --- a/drivers/of/property.c
> > > > > > +++ b/drivers/of/property.c
> > > > > > @@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", 
> > > > > > NULL)
> > > > > >  DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
> > > > > >  DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
> > > > > >  DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
> > > > > > -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
> > > > > > +
> > > > > > +static struct device_node *parse_gpios(struct device_node *np,
> > > > > > +  const char *prop_name, int 
> > > > > > index)
> > > > > > +{
> > > > > > +   if (!strcmp_suffix(prop_name, ",nr-gpios"))
> > > > > > +   return NULL;
> > > > >
> > > > > Ah I somehow missed this patch. This gives a blanked exception for
> > > > > vendor,nr-gpios. I'd prefer explicit exceptions for all the instances
> > > > > of ",nr-gpios" we are grandfathering in. Any future additions should
> > > > > be rejected. Can we do that please?
> > > > >
> > > > > Rob, you okay with making this list more explicit?
> > > >
> > > > Not the kernel's job IMO. A schema is the right way to handle that.
> > >
> > > Ok, that's fine by me. Btw, let's land this in driver-core? I've made
> > > changes there and this might cause conflicts. Not sure.
> >
> > It merges with linux-next fine. You'll need to resend this to Greg if
> > you want to do that.
> >
> > Reviewed-by: Rob Herring 
> 
> Hi Greg,
> 
> Can you pull this into driver-core please? I touch this file a lot and
> might need to do so again if any fw_devlink=on issues come up. So
> trying to preemptively avoid conflicts.

Pull what?  I'm totally lost in this thread, sorry...

If you need me to apply something, you at least need to cc: me on it :)

thanks,

gre gk-h


Re: [PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios"

2021-04-09 Thread Saravana Kannan
On Fri, Apr 9, 2021 at 12:26 PM Rob Herring  wrote:
>
> On Wed, Apr 7, 2021 at 3:45 PM Ilya Lipnitskiy
>  wrote:
> >
> > On Tue, Apr 6, 2021 at 6:24 PM Saravana Kannan  wrote:
> > >
> > > On Tue, Apr 6, 2021 at 6:10 PM Rob Herring  wrote:
> > > >
> > > > On Tue, Apr 6, 2021 at 7:46 PM Saravana Kannan  
> > > > wrote:
> > > > >
> > > > > On Tue, Apr 6, 2021 at 5:34 PM Rob Herring  wrote:
> > > > > >
> > > > > > On Tue, Apr 06, 2021 at 04:09:10PM -0700, Saravana Kannan wrote:
> > > > > > > On Mon, Apr 5, 2021 at 3:26 PM Ilya Lipnitskiy
> > > > > > >  wrote:
> > > > > > > >
> > > > > > > > [,]nr-gpios property is used by some GPIO drivers[0] to 
> > > > > > > > indicate
> > > > > > > > the number of GPIOs present on a system, not define a GPIO. 
> > > > > > > > nr-gpios is
> > > > > > > > not configured by #gpio-cells and can't be parsed along with 
> > > > > > > > other
> > > > > > > > "*-gpios" properties.
> > > > > > > >
> > > > > > > > nr-gpios without the "," prefix is not allowed by the DT
> > > > > > > > spec[1], so only add exception for the ",nr-gpios" suffix and 
> > > > > > > > let the
> > > > > > > > error message continue being printed for non-compliant 
> > > > > > > > implementations.
> > > > > > > >
> > > > > > > > [0]: nr-gpios is referenced in 
> > > > > > > > Documentation/devicetree/bindings/gpio:
> > > > > > > >  - gpio-adnp.txt
> > > > > > > >  - gpio-xgene-sb.txt
> > > > > > > >  - gpio-xlp.txt
> > > > > > > >  - snps,dw-apb-gpio.yaml
> > > > > > > >
> > > > > > > > [1]:
> > > > > > > > Link: 
> > > > > > > > https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20
> > > > > > > >
> > > > > > > > Fixes errors such as:
> > > > > > > >   OF: /palmbus@30/gpio@600: could not find phandle
> > > > > > > >
> > > > > > > > Fixes: 7f00be96f125 ("of: property: Add device link support for 
> > > > > > > > interrupt-parent, dmas and -gpio(s)")
> > > > > > > > Signed-off-by: Ilya Lipnitskiy 
> > > > > > > > Cc: Saravana Kannan 
> > > > > > > > Cc:  # 5.5.x
> > > > > > > > ---
> > > > > > > >  drivers/of/property.c | 11 ++-
> > > > > > > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > > > > > > >
> > > > > > > > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > > > > > > > index 2046ae311322..1793303e84ac 100644
> > > > > > > > --- a/drivers/of/property.c
> > > > > > > > +++ b/drivers/of/property.c
> > > > > > > > @@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, 
> > > > > > > > "pinctrl-7", NULL)
> > > > > > > >  DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
> > > > > > > >  DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
> > > > > > > >  DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
> > > > > > > > -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
> > > > > > > > +
> > > > > > > > +static struct device_node *parse_gpios(struct device_node *np,
> > > > > > > > +  const char *prop_name, 
> > > > > > > > int index)
> > > > > > > > +{
> > > > > > > > +   if (!strcmp_suffix(prop_name, ",nr-gpios"))
> > > > > > > > +   return NULL;
> > > > > > >
> > > > > > > Ah I somehow missed this patch. This gives a blanked exception for
> > > > > > > vendor,nr-gpios. I'd prefer explicit exceptions for all the 
> > > > > > > instances
> > > > > > > of ",nr-gpios" we are grandfathering in. Any future additions 
> > > > > > > should
> > > > > > > be rejected. Can we do that please?
> > > > > > >
> > > > > > > Rob, you okay with making this list more explicit?
> > > > > >
> > > > > > Not the kernel's job IMO. A schema is the right way to handle that.
> > > > >
> > > > > Ok, that's fine by me. Btw, let's land this in driver-core? I've made
> > > > > changes there and this might cause conflicts. Not sure.
> > > >
> > > > It merges with linux-next fine. You'll need to resend this to Greg if
> > > > you want to do that.
> > > >
> > > > Reviewed-by: Rob Herring 
> > >
> > > Hi Greg,
> > >
> > > Can you pull this into driver-core please?
> > Do you want me to re-spin on top of driver-core? The patch is
> > currently based on dt/next in robh/linux.git
>
> I did say you need to resend the patch to Greg, but since there's no
> movement on this and I have other things to send upstream, I've
> applied it.

:'(

If it's not too late, can we please drop it? I'm sure Greg would be
okay with picking this up.

-Saravana


Re: [PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios"

2021-04-09 Thread Rob Herring
On Wed, Apr 7, 2021 at 3:45 PM Ilya Lipnitskiy
 wrote:
>
> On Tue, Apr 6, 2021 at 6:24 PM Saravana Kannan  wrote:
> >
> > On Tue, Apr 6, 2021 at 6:10 PM Rob Herring  wrote:
> > >
> > > On Tue, Apr 6, 2021 at 7:46 PM Saravana Kannan  
> > > wrote:
> > > >
> > > > On Tue, Apr 6, 2021 at 5:34 PM Rob Herring  wrote:
> > > > >
> > > > > On Tue, Apr 06, 2021 at 04:09:10PM -0700, Saravana Kannan wrote:
> > > > > > On Mon, Apr 5, 2021 at 3:26 PM Ilya Lipnitskiy
> > > > > >  wrote:
> > > > > > >
> > > > > > > [,]nr-gpios property is used by some GPIO drivers[0] to 
> > > > > > > indicate
> > > > > > > the number of GPIOs present on a system, not define a GPIO. 
> > > > > > > nr-gpios is
> > > > > > > not configured by #gpio-cells and can't be parsed along with other
> > > > > > > "*-gpios" properties.
> > > > > > >
> > > > > > > nr-gpios without the "," prefix is not allowed by the DT
> > > > > > > spec[1], so only add exception for the ",nr-gpios" suffix and let 
> > > > > > > the
> > > > > > > error message continue being printed for non-compliant 
> > > > > > > implementations.
> > > > > > >
> > > > > > > [0]: nr-gpios is referenced in 
> > > > > > > Documentation/devicetree/bindings/gpio:
> > > > > > >  - gpio-adnp.txt
> > > > > > >  - gpio-xgene-sb.txt
> > > > > > >  - gpio-xlp.txt
> > > > > > >  - snps,dw-apb-gpio.yaml
> > > > > > >
> > > > > > > [1]:
> > > > > > > Link: 
> > > > > > > https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20
> > > > > > >
> > > > > > > Fixes errors such as:
> > > > > > >   OF: /palmbus@30/gpio@600: could not find phandle
> > > > > > >
> > > > > > > Fixes: 7f00be96f125 ("of: property: Add device link support for 
> > > > > > > interrupt-parent, dmas and -gpio(s)")
> > > > > > > Signed-off-by: Ilya Lipnitskiy 
> > > > > > > Cc: Saravana Kannan 
> > > > > > > Cc:  # 5.5.x
> > > > > > > ---
> > > > > > >  drivers/of/property.c | 11 ++-
> > > > > > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > > > > > >
> > > > > > > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > > > > > > index 2046ae311322..1793303e84ac 100644
> > > > > > > --- a/drivers/of/property.c
> > > > > > > +++ b/drivers/of/property.c
> > > > > > > @@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", 
> > > > > > > NULL)
> > > > > > >  DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
> > > > > > >  DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
> > > > > > >  DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
> > > > > > > -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
> > > > > > > +
> > > > > > > +static struct device_node *parse_gpios(struct device_node *np,
> > > > > > > +  const char *prop_name, int 
> > > > > > > index)
> > > > > > > +{
> > > > > > > +   if (!strcmp_suffix(prop_name, ",nr-gpios"))
> > > > > > > +   return NULL;
> > > > > >
> > > > > > Ah I somehow missed this patch. This gives a blanked exception for
> > > > > > vendor,nr-gpios. I'd prefer explicit exceptions for all the 
> > > > > > instances
> > > > > > of ",nr-gpios" we are grandfathering in. Any future additions should
> > > > > > be rejected. Can we do that please?
> > > > > >
> > > > > > Rob, you okay with making this list more explicit?
> > > > >
> > > > > Not the kernel's job IMO. A schema is the right way to handle that.
> > > >
> > > > Ok, that's fine by me. Btw, let's land this in driver-core? I've made
> > > > changes there and this might cause conflicts. Not sure.
> > >
> > > It merges with linux-next fine. You'll need to resend this to Greg if
> > > you want to do that.
> > >
> > > Reviewed-by: Rob Herring 
> >
> > Hi Greg,
> >
> > Can you pull this into driver-core please?
> Do you want me to re-spin on top of driver-core? The patch is
> currently based on dt/next in robh/linux.git

I did say you need to resend the patch to Greg, but since there's no
movement on this and I have other things to send upstream, I've
applied it.

Rob


Re: [PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios"

2021-04-07 Thread Ilya Lipnitskiy
On Tue, Apr 6, 2021 at 6:24 PM Saravana Kannan  wrote:
>
> On Tue, Apr 6, 2021 at 6:10 PM Rob Herring  wrote:
> >
> > On Tue, Apr 6, 2021 at 7:46 PM Saravana Kannan  wrote:
> > >
> > > On Tue, Apr 6, 2021 at 5:34 PM Rob Herring  wrote:
> > > >
> > > > On Tue, Apr 06, 2021 at 04:09:10PM -0700, Saravana Kannan wrote:
> > > > > On Mon, Apr 5, 2021 at 3:26 PM Ilya Lipnitskiy
> > > > >  wrote:
> > > > > >
> > > > > > [,]nr-gpios property is used by some GPIO drivers[0] to 
> > > > > > indicate
> > > > > > the number of GPIOs present on a system, not define a GPIO. 
> > > > > > nr-gpios is
> > > > > > not configured by #gpio-cells and can't be parsed along with other
> > > > > > "*-gpios" properties.
> > > > > >
> > > > > > nr-gpios without the "," prefix is not allowed by the DT
> > > > > > spec[1], so only add exception for the ",nr-gpios" suffix and let 
> > > > > > the
> > > > > > error message continue being printed for non-compliant 
> > > > > > implementations.
> > > > > >
> > > > > > [0]: nr-gpios is referenced in 
> > > > > > Documentation/devicetree/bindings/gpio:
> > > > > >  - gpio-adnp.txt
> > > > > >  - gpio-xgene-sb.txt
> > > > > >  - gpio-xlp.txt
> > > > > >  - snps,dw-apb-gpio.yaml
> > > > > >
> > > > > > [1]:
> > > > > > Link: 
> > > > > > https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20
> > > > > >
> > > > > > Fixes errors such as:
> > > > > >   OF: /palmbus@30/gpio@600: could not find phandle
> > > > > >
> > > > > > Fixes: 7f00be96f125 ("of: property: Add device link support for 
> > > > > > interrupt-parent, dmas and -gpio(s)")
> > > > > > Signed-off-by: Ilya Lipnitskiy 
> > > > > > Cc: Saravana Kannan 
> > > > > > Cc:  # 5.5.x
> > > > > > ---
> > > > > >  drivers/of/property.c | 11 ++-
> > > > > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > > > > > index 2046ae311322..1793303e84ac 100644
> > > > > > --- a/drivers/of/property.c
> > > > > > +++ b/drivers/of/property.c
> > > > > > @@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", 
> > > > > > NULL)
> > > > > >  DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
> > > > > >  DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
> > > > > >  DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
> > > > > > -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
> > > > > > +
> > > > > > +static struct device_node *parse_gpios(struct device_node *np,
> > > > > > +  const char *prop_name, int 
> > > > > > index)
> > > > > > +{
> > > > > > +   if (!strcmp_suffix(prop_name, ",nr-gpios"))
> > > > > > +   return NULL;
> > > > >
> > > > > Ah I somehow missed this patch. This gives a blanked exception for
> > > > > vendor,nr-gpios. I'd prefer explicit exceptions for all the instances
> > > > > of ",nr-gpios" we are grandfathering in. Any future additions should
> > > > > be rejected. Can we do that please?
> > > > >
> > > > > Rob, you okay with making this list more explicit?
> > > >
> > > > Not the kernel's job IMO. A schema is the right way to handle that.
> > >
> > > Ok, that's fine by me. Btw, let's land this in driver-core? I've made
> > > changes there and this might cause conflicts. Not sure.
> >
> > It merges with linux-next fine. You'll need to resend this to Greg if
> > you want to do that.
> >
> > Reviewed-by: Rob Herring 
>
> Hi Greg,
>
> Can you pull this into driver-core please?
Do you want me to re-spin on top of driver-core? The patch is
currently based on dt/next in robh/linux.git

Ilya


Re: [PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios"

2021-04-06 Thread Saravana Kannan
On Tue, Apr 6, 2021 at 6:10 PM Rob Herring  wrote:
>
> On Tue, Apr 6, 2021 at 7:46 PM Saravana Kannan  wrote:
> >
> > On Tue, Apr 6, 2021 at 5:34 PM Rob Herring  wrote:
> > >
> > > On Tue, Apr 06, 2021 at 04:09:10PM -0700, Saravana Kannan wrote:
> > > > On Mon, Apr 5, 2021 at 3:26 PM Ilya Lipnitskiy
> > > >  wrote:
> > > > >
> > > > > [,]nr-gpios property is used by some GPIO drivers[0] to 
> > > > > indicate
> > > > > the number of GPIOs present on a system, not define a GPIO. nr-gpios 
> > > > > is
> > > > > not configured by #gpio-cells and can't be parsed along with other
> > > > > "*-gpios" properties.
> > > > >
> > > > > nr-gpios without the "," prefix is not allowed by the DT
> > > > > spec[1], so only add exception for the ",nr-gpios" suffix and let the
> > > > > error message continue being printed for non-compliant 
> > > > > implementations.
> > > > >
> > > > > [0]: nr-gpios is referenced in Documentation/devicetree/bindings/gpio:
> > > > >  - gpio-adnp.txt
> > > > >  - gpio-xgene-sb.txt
> > > > >  - gpio-xlp.txt
> > > > >  - snps,dw-apb-gpio.yaml
> > > > >
> > > > > [1]:
> > > > > Link: 
> > > > > https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20
> > > > >
> > > > > Fixes errors such as:
> > > > >   OF: /palmbus@30/gpio@600: could not find phandle
> > > > >
> > > > > Fixes: 7f00be96f125 ("of: property: Add device link support for 
> > > > > interrupt-parent, dmas and -gpio(s)")
> > > > > Signed-off-by: Ilya Lipnitskiy 
> > > > > Cc: Saravana Kannan 
> > > > > Cc:  # 5.5.x
> > > > > ---
> > > > >  drivers/of/property.c | 11 ++-
> > > > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > > > > index 2046ae311322..1793303e84ac 100644
> > > > > --- a/drivers/of/property.c
> > > > > +++ b/drivers/of/property.c
> > > > > @@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
> > > > >  DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
> > > > >  DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
> > > > >  DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
> > > > > -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
> > > > > +
> > > > > +static struct device_node *parse_gpios(struct device_node *np,
> > > > > +  const char *prop_name, int 
> > > > > index)
> > > > > +{
> > > > > +   if (!strcmp_suffix(prop_name, ",nr-gpios"))
> > > > > +   return NULL;
> > > >
> > > > Ah I somehow missed this patch. This gives a blanked exception for
> > > > vendor,nr-gpios. I'd prefer explicit exceptions for all the instances
> > > > of ",nr-gpios" we are grandfathering in. Any future additions should
> > > > be rejected. Can we do that please?
> > > >
> > > > Rob, you okay with making this list more explicit?
> > >
> > > Not the kernel's job IMO. A schema is the right way to handle that.
> >
> > Ok, that's fine by me. Btw, let's land this in driver-core? I've made
> > changes there and this might cause conflicts. Not sure.
>
> It merges with linux-next fine. You'll need to resend this to Greg if
> you want to do that.
>
> Reviewed-by: Rob Herring 

Hi Greg,

Can you pull this into driver-core please? I touch this file a lot and
might need to do so again if any fw_devlink=on issues come up. So
trying to preemptively avoid conflicts.

-Saravana


Re: [PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios"

2021-04-06 Thread Rob Herring
On Tue, Apr 6, 2021 at 7:46 PM Saravana Kannan  wrote:
>
> On Tue, Apr 6, 2021 at 5:34 PM Rob Herring  wrote:
> >
> > On Tue, Apr 06, 2021 at 04:09:10PM -0700, Saravana Kannan wrote:
> > > On Mon, Apr 5, 2021 at 3:26 PM Ilya Lipnitskiy
> > >  wrote:
> > > >
> > > > [,]nr-gpios property is used by some GPIO drivers[0] to indicate
> > > > the number of GPIOs present on a system, not define a GPIO. nr-gpios is
> > > > not configured by #gpio-cells and can't be parsed along with other
> > > > "*-gpios" properties.
> > > >
> > > > nr-gpios without the "," prefix is not allowed by the DT
> > > > spec[1], so only add exception for the ",nr-gpios" suffix and let the
> > > > error message continue being printed for non-compliant implementations.
> > > >
> > > > [0]: nr-gpios is referenced in Documentation/devicetree/bindings/gpio:
> > > >  - gpio-adnp.txt
> > > >  - gpio-xgene-sb.txt
> > > >  - gpio-xlp.txt
> > > >  - snps,dw-apb-gpio.yaml
> > > >
> > > > [1]:
> > > > Link: 
> > > > https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20
> > > >
> > > > Fixes errors such as:
> > > >   OF: /palmbus@30/gpio@600: could not find phandle
> > > >
> > > > Fixes: 7f00be96f125 ("of: property: Add device link support for 
> > > > interrupt-parent, dmas and -gpio(s)")
> > > > Signed-off-by: Ilya Lipnitskiy 
> > > > Cc: Saravana Kannan 
> > > > Cc:  # 5.5.x
> > > > ---
> > > >  drivers/of/property.c | 11 ++-
> > > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > > > index 2046ae311322..1793303e84ac 100644
> > > > --- a/drivers/of/property.c
> > > > +++ b/drivers/of/property.c
> > > > @@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
> > > >  DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
> > > >  DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
> > > >  DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
> > > > -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
> > > > +
> > > > +static struct device_node *parse_gpios(struct device_node *np,
> > > > +  const char *prop_name, int index)
> > > > +{
> > > > +   if (!strcmp_suffix(prop_name, ",nr-gpios"))
> > > > +   return NULL;
> > >
> > > Ah I somehow missed this patch. This gives a blanked exception for
> > > vendor,nr-gpios. I'd prefer explicit exceptions for all the instances
> > > of ",nr-gpios" we are grandfathering in. Any future additions should
> > > be rejected. Can we do that please?
> > >
> > > Rob, you okay with making this list more explicit?
> >
> > Not the kernel's job IMO. A schema is the right way to handle that.
>
> Ok, that's fine by me. Btw, let's land this in driver-core? I've made
> changes there and this might cause conflicts. Not sure.

It merges with linux-next fine. You'll need to resend this to Greg if
you want to do that.

Reviewed-by: Rob Herring 


Re: [PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios"

2021-04-06 Thread Saravana Kannan
On Tue, Apr 6, 2021 at 5:34 PM Rob Herring  wrote:
>
> On Tue, Apr 06, 2021 at 04:09:10PM -0700, Saravana Kannan wrote:
> > On Mon, Apr 5, 2021 at 3:26 PM Ilya Lipnitskiy
> >  wrote:
> > >
> > > [,]nr-gpios property is used by some GPIO drivers[0] to indicate
> > > the number of GPIOs present on a system, not define a GPIO. nr-gpios is
> > > not configured by #gpio-cells and can't be parsed along with other
> > > "*-gpios" properties.
> > >
> > > nr-gpios without the "," prefix is not allowed by the DT
> > > spec[1], so only add exception for the ",nr-gpios" suffix and let the
> > > error message continue being printed for non-compliant implementations.
> > >
> > > [0]: nr-gpios is referenced in Documentation/devicetree/bindings/gpio:
> > >  - gpio-adnp.txt
> > >  - gpio-xgene-sb.txt
> > >  - gpio-xlp.txt
> > >  - snps,dw-apb-gpio.yaml
> > >
> > > [1]:
> > > Link: 
> > > https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20
> > >
> > > Fixes errors such as:
> > >   OF: /palmbus@30/gpio@600: could not find phandle
> > >
> > > Fixes: 7f00be96f125 ("of: property: Add device link support for 
> > > interrupt-parent, dmas and -gpio(s)")
> > > Signed-off-by: Ilya Lipnitskiy 
> > > Cc: Saravana Kannan 
> > > Cc:  # 5.5.x
> > > ---
> > >  drivers/of/property.c | 11 ++-
> > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > > index 2046ae311322..1793303e84ac 100644
> > > --- a/drivers/of/property.c
> > > +++ b/drivers/of/property.c
> > > @@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
> > >  DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
> > >  DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
> > >  DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
> > > -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
> > > +
> > > +static struct device_node *parse_gpios(struct device_node *np,
> > > +  const char *prop_name, int index)
> > > +{
> > > +   if (!strcmp_suffix(prop_name, ",nr-gpios"))
> > > +   return NULL;
> >
> > Ah I somehow missed this patch. This gives a blanked exception for
> > vendor,nr-gpios. I'd prefer explicit exceptions for all the instances
> > of ",nr-gpios" we are grandfathering in. Any future additions should
> > be rejected. Can we do that please?
> >
> > Rob, you okay with making this list more explicit?
>
> Not the kernel's job IMO. A schema is the right way to handle that.

Ok, that's fine by me. Btw, let's land this in driver-core? I've made
changes there and this might cause conflicts. Not sure.

-Saravana


Re: [PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios"

2021-04-06 Thread Rob Herring
On Tue, Apr 06, 2021 at 04:09:10PM -0700, Saravana Kannan wrote:
> On Mon, Apr 5, 2021 at 3:26 PM Ilya Lipnitskiy
>  wrote:
> >
> > [,]nr-gpios property is used by some GPIO drivers[0] to indicate
> > the number of GPIOs present on a system, not define a GPIO. nr-gpios is
> > not configured by #gpio-cells and can't be parsed along with other
> > "*-gpios" properties.
> >
> > nr-gpios without the "," prefix is not allowed by the DT
> > spec[1], so only add exception for the ",nr-gpios" suffix and let the
> > error message continue being printed for non-compliant implementations.
> >
> > [0]: nr-gpios is referenced in Documentation/devicetree/bindings/gpio:
> >  - gpio-adnp.txt
> >  - gpio-xgene-sb.txt
> >  - gpio-xlp.txt
> >  - snps,dw-apb-gpio.yaml
> >
> > [1]:
> > Link: 
> > https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20
> >
> > Fixes errors such as:
> >   OF: /palmbus@30/gpio@600: could not find phandle
> >
> > Fixes: 7f00be96f125 ("of: property: Add device link support for 
> > interrupt-parent, dmas and -gpio(s)")
> > Signed-off-by: Ilya Lipnitskiy 
> > Cc: Saravana Kannan 
> > Cc:  # 5.5.x
> > ---
> >  drivers/of/property.c | 11 ++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > index 2046ae311322..1793303e84ac 100644
> > --- a/drivers/of/property.c
> > +++ b/drivers/of/property.c
> > @@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
> >  DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
> >  DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
> >  DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
> > -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
> > +
> > +static struct device_node *parse_gpios(struct device_node *np,
> > +  const char *prop_name, int index)
> > +{
> > +   if (!strcmp_suffix(prop_name, ",nr-gpios"))
> > +   return NULL;
> 
> Ah I somehow missed this patch. This gives a blanked exception for
> vendor,nr-gpios. I'd prefer explicit exceptions for all the instances
> of ",nr-gpios" we are grandfathering in. Any future additions should
> be rejected. Can we do that please?
> 
> Rob, you okay with making this list more explicit?

Not the kernel's job IMO. A schema is the right way to handle that.

Rob


Re: [PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios"

2021-04-06 Thread Saravana Kannan
On Mon, Apr 5, 2021 at 3:26 PM Ilya Lipnitskiy
 wrote:
>
> [,]nr-gpios property is used by some GPIO drivers[0] to indicate
> the number of GPIOs present on a system, not define a GPIO. nr-gpios is
> not configured by #gpio-cells and can't be parsed along with other
> "*-gpios" properties.
>
> nr-gpios without the "," prefix is not allowed by the DT
> spec[1], so only add exception for the ",nr-gpios" suffix and let the
> error message continue being printed for non-compliant implementations.
>
> [0]: nr-gpios is referenced in Documentation/devicetree/bindings/gpio:
>  - gpio-adnp.txt
>  - gpio-xgene-sb.txt
>  - gpio-xlp.txt
>  - snps,dw-apb-gpio.yaml
>
> [1]:
> Link: 
> https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20
>
> Fixes errors such as:
>   OF: /palmbus@30/gpio@600: could not find phandle
>
> Fixes: 7f00be96f125 ("of: property: Add device link support for 
> interrupt-parent, dmas and -gpio(s)")
> Signed-off-by: Ilya Lipnitskiy 
> Cc: Saravana Kannan 
> Cc:  # 5.5.x
> ---
>  drivers/of/property.c | 11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index 2046ae311322..1793303e84ac 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c
> @@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
>  DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
>  DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
>  DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
> -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
> +
> +static struct device_node *parse_gpios(struct device_node *np,
> +  const char *prop_name, int index)
> +{
> +   if (!strcmp_suffix(prop_name, ",nr-gpios"))
> +   return NULL;

Ah I somehow missed this patch. This gives a blanked exception for
vendor,nr-gpios. I'd prefer explicit exceptions for all the instances
of ",nr-gpios" we are grandfathering in. Any future additions should
be rejected. Can we do that please?

Rob, you okay with making this list more explicit?

-Saravana


[PATCH v2] of: property: fw_devlink: do not link ".*,nr-gpios"

2021-04-05 Thread Ilya Lipnitskiy
[,]nr-gpios property is used by some GPIO drivers[0] to indicate
the number of GPIOs present on a system, not define a GPIO. nr-gpios is
not configured by #gpio-cells and can't be parsed along with other
"*-gpios" properties.

nr-gpios without the "," prefix is not allowed by the DT
spec[1], so only add exception for the ",nr-gpios" suffix and let the
error message continue being printed for non-compliant implementations.

[0]: nr-gpios is referenced in Documentation/devicetree/bindings/gpio:
 - gpio-adnp.txt
 - gpio-xgene-sb.txt
 - gpio-xlp.txt
 - snps,dw-apb-gpio.yaml

[1]:
Link: 
https://github.com/devicetree-org/dt-schema/blob/cb53a16a1eb3e2169ce170c071e47940845ec26e/schemas/gpio/gpio-consumer.yaml#L20

Fixes errors such as:
  OF: /palmbus@30/gpio@600: could not find phandle

Fixes: 7f00be96f125 ("of: property: Add device link support for 
interrupt-parent, dmas and -gpio(s)")
Signed-off-by: Ilya Lipnitskiy 
Cc: Saravana Kannan 
Cc:  # 5.5.x
---
 drivers/of/property.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 2046ae311322..1793303e84ac 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1281,7 +1281,16 @@ DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
 DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
 DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
 DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
-DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
+
+static struct device_node *parse_gpios(struct device_node *np,
+  const char *prop_name, int index)
+{
+   if (!strcmp_suffix(prop_name, ",nr-gpios"))
+   return NULL;
+
+   return parse_suffix_prop_cells(np, prop_name, index, "-gpios",
+  "#gpio-cells");
+}
 
 static struct device_node *parse_iommu_maps(struct device_node *np,
const char *prop_name, int index)
-- 
2.31.1