Skip to contentSkip to conversation

ARM: OMAP4+: PRM: fix of_irq_get() result checks

PATCH New Sergei Shtylyov 2 participants 5 messages Aug 6, 2017 – Aug 14, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 ARM: OMAP4+: PRM: fix of_irq_get() result checks

of_irq_get() may return 0 as well as a nagative error number on failure, (and never on success), however omap44xx_prm_late_init() regards 0 as a valid IRQ -- fix this.

Fixes a8f83aefcd5a ("ARM: OMAP4+: PRM: register interrupt information from DT")
Fixes c5b3955828ba ("ARM: OMAP4: Fix legacy code clean-up regression")

---
Changes ion version 2:
- added the "Fixes:" tag for the commit introducing of_irq_get() call;
- rebased to the 'omap-for-v4.13/fixes' branch;
- fixed Rajendra Nayak's email;
- added + to OMAP4 in the patch subject.

 arch/arm/mach-omap2/prm44xx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/prm44xx.c +2 -2
Index: linux-omap/arch/arm/mach-omap2/prm44xx.c
===================================================================
@@ -747,7 +747,7 @@ static int omap44xx_prm_late_init(void)
 	 * Already have OMAP4 IRQ num. For all other platforms, we need
 	 * IRQ numbers from DT
 	 */
-	if (irq_num < 0 && !(prm_init_data->flags & PRM_IRQ_DEFAULT)) {
+	if (irq_num <= 0 && !(prm_init_data->flags & PRM_IRQ_DEFAULT)) {
 		if (irq_num == -EPROBE_DEFER)
 			return irq_num;
 
@@ -756,7 +756,7 @@ static int omap44xx_prm_late_init(void)
 	}
 
 	/* Once OMAP4 DT is filled as well */
-	if (irq_num >= 0) {
+	if (irq_num > 0) {
 		omap4_prcm_irq_setup.irq = irq_num;
 		omap4_prcm_irq_setup.xlate_irq = NULL;
 	}
#1 lore raw

PATCH v2 2/2 ARM: OMAP4+: PRM: fix of_irq_get() result checks

Quoted 1 line · Sergei Shtylyov

of_irq_get() may return 0 as well as a nagative error number on failure,

Oops, forgot to kill comma...

Quoted 6 lines

(and never on success), however omap44xx_prm_late_init() regards 0 as a valid IRQ -- fix this.

Fixes a8f83aefcd5a ("ARM: OMAP4+: PRM: register interrupt information from DT")
Fixes c5b3955828ba ("ARM: OMAP4: Fix legacy code clean-up regression")

[...]

MBR, Sergei

maintainer
#2 lore raw

PATCH v2 2/2 ARM: OMAP4+: PRM: fix of_irq_get() result checks

Quoted 5 lines · Sergei Shtylyov
Quoted 1 line · Sergei Shtylyov

of_irq_get() may return 0 as well as a nagative error number on failure,

Oops, forgot to kill comma...

I can fix that while applying.

Quoted 7 lines
Quoted 6 lines

(and never on success), however omap44xx_prm_late_init() regards 0 as a valid IRQ -- fix this.

Fixes a8f83aefcd5a ("ARM: OMAP4+: PRM: register interrupt information from DT")
Fixes c5b3955828ba ("ARM: OMAP4: Fix legacy code clean-up regression")

[...]

Seems these both should be safe to apply into fixes-not-urgent for v4.14 merge window as we have not seen any issues with this? Or are there some known bugs related to this?

Regards,

Tony

#3 lore raw

PATCH v2 2/2 ARM: OMAP4+: PRM: fix of_irq_get() result checks

Quoted 5 lines · Tony Lindgren
Quoted 3 lines
Quoted 1 line

of_irq_get() may return 0 as well as a nagative error number on failure,

Oops, forgot to kill comma...

I can fix that while applying.

Thanks!

Quoted 10 lines
Quoted 7 lines
Quoted 6 lines

(and never on success), however omap44xx_prm_late_init() regards 0 as a valid IRQ -- fix this.

Fixes a8f83aefcd5a ("ARM: OMAP4+: PRM: register interrupt information from DT")
Fixes c5b3955828ba ("ARM: OMAP4: Fix legacy code clean-up regression")

[...]

Seems these both should be safe to apply into fixes-not-urgent for v4.14 merge window as we have not seen any issues with this? Or

Yes, probably.

Quoted 1 line

are there some known bugs related to this?

Dunno, I was just auditing the call sites of of_irq_get[_byname]()...

Quoted 3 lines

Regards,

Tony

MBR, Sergei

maintainer
#4 lore raw

PATCH v2 2/2 ARM: OMAP4+: PRM: fix of_irq_get() result checks

Quoted 18 lines · Sergei Shtylyov
Quoted 5 lines · Tony Lindgren
Quoted 3 lines
Quoted 1 line

of_irq_get() may return 0 as well as a nagative error number on failure,

Oops, forgot to kill comma...

I can fix that while applying.

Thanks!

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

(and never on success), however omap44xx_prm_late_init() regards 0 as a valid IRQ -- fix this.

Fixes a8f83aefcd5a ("ARM: OMAP4+: PRM: register interrupt information from DT")
Fixes c5b3955828ba ("ARM: OMAP4: Fix legacy code clean-up regression")

[...]

Quoted 8 lines
Quoted 2 lines

Seems these both should be safe to apply into fixes-not-urgent for v4.14 merge window as we have not seen any issues with this? Or

Yes, probably.

Quoted 1 line

are there some known bugs related to this?

Dunno, I was just auditing the call sites of of_irq_get[_byname]()...

OK thanks I'll apply both into omap-for-v4.14/fixes-not-urgent.

Tony