All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of: property: fw_devlink: Ignore interrupts property for some configs
@ 2021-02-15 22:42 Saravana Kannan
  2021-02-16  3:15 ` Guenter Roeck
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Saravana Kannan @ 2021-02-15 22:42 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand, Saravana Kannan, Linus Walleij,
	Greg Kroah-Hartman, Thierry Reding
  Cc: Guenter Roeck, kernel-team, Rob Herring, devicetree, linux-kernel

When CONFIG_OF_IRQ is not defined, it doesn't make sense to parse
interrupts property.

Also, parsing and tracking interrupts property breaks some PPC
devices[1].  But none of the IRQ drivers in PPC seem ready to be
converted to a proper platform (or any bus) driver. So, there's not much
of a point in tracking the interrupts property for CONFIG_PPC. So, let's
stop parsing interrupts for CONFIG_PPC.

[1] - https://lore.kernel.org/lkml/20210213185422.GA195733@roeck-us.net/
Fixes: 4104ca776ba3 ("of: property: Add fw_devlink support for interrupts")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Saravana Kannan <saravanak@google.com>
---
Greg/Rob,

I believe this needs to land on driver-core-next.

-Saravana

 drivers/of/property.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 79b68519fe30..5036a362f52e 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1300,6 +1300,9 @@ static struct device_node *parse_interrupts(struct device_node *np,
 {
 	struct of_phandle_args sup_args;
 
+	if (!IS_ENABLED(CONFIG_OF_IRQ) || IS_ENABLED(CONFIG_PPC))
+		return NULL;
+
 	if (strcmp(prop_name, "interrupts") &&
 	    strcmp(prop_name, "interrupts-extended"))
 		return NULL;
-- 
2.30.0.478.g8a0d178c01-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] of: property: fw_devlink: Ignore interrupts property for some configs
  2021-02-15 22:42 [PATCH] of: property: fw_devlink: Ignore interrupts property for some configs Saravana Kannan
@ 2021-02-16  3:15 ` Guenter Roeck
  2021-02-16 20:20 ` Enrico Weigelt, metux IT consult
  2021-02-17 19:42 ` Rob Herring
  2 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2021-02-16  3:15 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: Rob Herring, Frank Rowand, Linus Walleij, Greg Kroah-Hartman,
	Thierry Reding, kernel-team, Rob Herring, devicetree,
	linux-kernel

On Mon, Feb 15, 2021 at 02:42:58PM -0800, Saravana Kannan wrote:
> When CONFIG_OF_IRQ is not defined, it doesn't make sense to parse
> interrupts property.
> 
> Also, parsing and tracking interrupts property breaks some PPC
> devices[1].  But none of the IRQ drivers in PPC seem ready to be
> converted to a proper platform (or any bus) driver. So, there's not much
> of a point in tracking the interrupts property for CONFIG_PPC. So, let's
> stop parsing interrupts for CONFIG_PPC.
> 
> [1] - https://lore.kernel.org/lkml/20210213185422.GA195733@roeck-us.net/
> Fixes: 4104ca776ba3 ("of: property: Add fw_devlink support for interrupts")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Saravana Kannan <saravanak@google.com>

That does the trick, at least for my test cases.

Tested-by: Guenter Roeck <linux@roeck-us.net>

Guenter

> ---
> Greg/Rob,
> 
> I believe this needs to land on driver-core-next.
> 
> -Saravana
> 
>  drivers/of/property.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index 79b68519fe30..5036a362f52e 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c
> @@ -1300,6 +1300,9 @@ static struct device_node *parse_interrupts(struct device_node *np,
>  {
>  	struct of_phandle_args sup_args;
>  
> +	if (!IS_ENABLED(CONFIG_OF_IRQ) || IS_ENABLED(CONFIG_PPC))
> +		return NULL;
> +
>  	if (strcmp(prop_name, "interrupts") &&
>  	    strcmp(prop_name, "interrupts-extended"))
>  		return NULL;
> -- 
> 2.30.0.478.g8a0d178c01-goog
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] of: property: fw_devlink: Ignore interrupts property for some configs
  2021-02-15 22:42 [PATCH] of: property: fw_devlink: Ignore interrupts property for some configs Saravana Kannan
  2021-02-16  3:15 ` Guenter Roeck
@ 2021-02-16 20:20 ` Enrico Weigelt, metux IT consult
  2021-02-16 20:22   ` Saravana Kannan
  2021-02-17 19:42 ` Rob Herring
  2 siblings, 1 reply; 5+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2021-02-16 20:20 UTC (permalink / raw)
  To: Saravana Kannan, Rob Herring, Frank Rowand, Linus Walleij,
	Greg Kroah-Hartman, Thierry Reding
  Cc: Guenter Roeck, kernel-team, Rob Herring, devicetree, linux-kernel

On 15.02.21 23:42, Saravana Kannan wrote:

Hi,

> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index 79b68519fe30..5036a362f52e 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c
> @@ -1300,6 +1300,9 @@ static struct device_node *parse_interrupts(struct device_node *np,
>   {
>   	struct of_phandle_args sup_args;
>   
> +	if (!IS_ENABLED(CONFIG_OF_IRQ) || IS_ENABLED(CONFIG_PPC))
> +		return NULL;
> +
>   	if (strcmp(prop_name, "interrupts") &&
>   	    strcmp(prop_name, "interrupts-extended"))
>   		return NULL;

wouldn't it be better to #ifdef-out the whole code in this case ?


--mtx


-- 
---
Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert
werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren
GPG/PGP-Schlüssel zu.
---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] of: property: fw_devlink: Ignore interrupts property for some configs
  2021-02-16 20:20 ` Enrico Weigelt, metux IT consult
@ 2021-02-16 20:22   ` Saravana Kannan
  0 siblings, 0 replies; 5+ messages in thread
From: Saravana Kannan @ 2021-02-16 20:22 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: Rob Herring, Frank Rowand, Linus Walleij, Greg Kroah-Hartman,
	Thierry Reding, Guenter Roeck, Android Kernel Team, Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, LKML

On Tue, Feb 16, 2021 at 12:20 PM Enrico Weigelt, metux IT consult
<lkml@metux.net> wrote:
>
> On 15.02.21 23:42, Saravana Kannan wrote:
>
> Hi,
>
> > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > index 79b68519fe30..5036a362f52e 100644
> > --- a/drivers/of/property.c
> > +++ b/drivers/of/property.c
> > @@ -1300,6 +1300,9 @@ static struct device_node *parse_interrupts(struct device_node *np,
> >   {
> >       struct of_phandle_args sup_args;
> >
> > +     if (!IS_ENABLED(CONFIG_OF_IRQ) || IS_ENABLED(CONFIG_PPC))
> > +             return NULL;
> > +
> >       if (strcmp(prop_name, "interrupts") &&
> >           strcmp(prop_name, "interrupts-extended"))
> >               return NULL;
>
> wouldn't it be better to #ifdef-out the whole code in this case ?

No, #ifdef is not preferred. That's why we even have the IS_ENABLED()
macros in the first place. The compiled will optimize out the code.

-Saravana

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] of: property: fw_devlink: Ignore interrupts property for some configs
  2021-02-15 22:42 [PATCH] of: property: fw_devlink: Ignore interrupts property for some configs Saravana Kannan
  2021-02-16  3:15 ` Guenter Roeck
  2021-02-16 20:20 ` Enrico Weigelt, metux IT consult
@ 2021-02-17 19:42 ` Rob Herring
  2 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2021-02-17 19:42 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: Frank Rowand, Linus Walleij, Greg Kroah-Hartman, Thierry Reding,
	Guenter Roeck, Android Kernel Team, devicetree, linux-kernel

On Mon, Feb 15, 2021 at 4:43 PM Saravana Kannan <saravanak@google.com> wrote:
>
> When CONFIG_OF_IRQ is not defined, it doesn't make sense to parse
> interrupts property.
>
> Also, parsing and tracking interrupts property breaks some PPC
> devices[1].  But none of the IRQ drivers in PPC seem ready to be
> converted to a proper platform (or any bus) driver. So, there's not much
> of a point in tracking the interrupts property for CONFIG_PPC. So, let's
> stop parsing interrupts for CONFIG_PPC.
>
> [1] - https://lore.kernel.org/lkml/20210213185422.GA195733@roeck-us.net/
> Fixes: 4104ca776ba3 ("of: property: Add fw_devlink support for interrupts")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> ---
> Greg/Rob,
>
> I believe this needs to land on driver-core-next.

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-17 19:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15 22:42 [PATCH] of: property: fw_devlink: Ignore interrupts property for some configs Saravana Kannan
2021-02-16  3:15 ` Guenter Roeck
2021-02-16 20:20 ` Enrico Weigelt, metux IT consult
2021-02-16 20:22   ` Saravana Kannan
2021-02-17 19:42 ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.