Skip to contentSkip to conversation

of: property: fw_devlink: Ignore interrupts property for some configs

PATCH In review Saravana Kannan 4 participants 5 messages Feb 15, 2021 – Feb 17, 2021 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of: property: fw_devlink: Ignore interrupts property for some configs

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/[email protected]/

Fixes 4104ca776ba3 ("of: property: Add fw_devlink support for interrupts")

---
Greg/Rob,

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

-Saravana

 drivers/of/property.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/of/property.c +3 -0
index 79b68519fe30..5036a362f52e 100644
@@ -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;
Signature · 1 line
2.30.0.478.g8a0d178c01-goog
Tested-by on v1 1/1
#1 lore raw
Quoted 9 lines · Saravana Kannan

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.

Quoted 4 lines

[1] - https://lore.kernel.org/lkml/[email protected]/

Fixes 4104ca776ba3 ("of: property: Add fw_devlink support for interrupts")

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

Guenter

Quoted 27 lines

---
Greg/Rob,

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

(quoted diff) +0 -1
-Saravana
 
 drivers/of/property.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/of/property.c +3 -0
index 79b68519fe30..5036a362f52e 100644
@@ -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;
Signature · 1 line
2.30.0.478.g8a0d178c01-goog
#2 lore raw
In reply to Saravana Kannan

On 15.02.21 23:42, Saravana Kannan wrote:

Hi,

Quoted 5 lines
drivers/of/property.c +0 -0
index 79b68519fe30..5036a362f52e 100644

drivers/of/property.c static struct device_node *parse_interrupts(struct device_node *np, · line 1308

Quoted 9 lines
drivers/of/property.c +3 -0
@@ -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

Signature · 8 lines
---
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
[email protected] -- +49-151-27565287
#3 lore raw
Quoted 13 lines · metux IT consult

On 15.02.21 23:42, Saravana Kannan wrote:

Hi,

Quoted 8 lines
drivers/of/property.c +0 -0
index 79b68519fe30..5036a362f52e 100644
@@ -1300,6 +1300,9 @@ static struct device_node *parse_interrupts(struct device_node *np,
  {
      struct of_phandle_args sup_args;
 
Quoted 8 lines

drivers/of/property.c static struct device_node *parse_interrupts(struct device_node *np, · line 1308

Quoted 6 lines
drivers/of/property.c +3 -0
+     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

Acked-by on v1 1/1
#4 lore raw
In reply to Saravana Kannan
Quoted 10 lines · Saravana Kannan

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.

Quoted 8 lines

[1] - https://lore.kernel.org/lkml/[email protected]/

Fixes 4104ca776ba3 ("of: property: Add fw_devlink support for interrupts")

---
Greg/Rob,

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