Skip to contentSkip to conversation

arm: mach-omap2: devices: fix omap3_l3_init() return value

PATCH New Aaro Koskinen 4 participants 7 messages Mar 16, 2011 – Mar 18, 2011

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

PATCH 1/2 arm: mach-omap2: devices: fix omap3_l3_init() return value

Fix the return value for the successful case.

---
 arch/arm/mach-omap2/devices.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/devices.c +1 -1
index 0d2d6a9..d478f53 100644
@@ -65,7 +65,7 @@ static int __init omap3_l3_init(void)
 
 	WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name);
 
-	return PTR_ERR(od);
+	return IS_ERR(od) ? PTR_ERR(od) : 0;
 }
 postcore_initcall(omap3_l3_init);
 
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 2/2 arm: mach-omap2: omap_l3_smx: fix irq handler setup

The handler function may be called from the point it is registered. Since the handler inspects IRQ numbers, we must set them up before registration.

---
 arch/arm/mach-omap2/omap_l3_smx.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/omap_l3_smx.c +4 -7
index 265bff3..5f2da75 100644
@@ -226,7 +226,6 @@ static int __init omap3_l3_probe(struct platform_device *pdev)
 	struct omap3_l3         *l3;
 	struct resource         *res;
 	int                     ret;
-	int                     irq;
 
 	l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
 	if (!l3) {
@@ -249,18 +248,17 @@ static int __init omap3_l3_probe(struct platform_device *pdev)
 		goto err2;
 	}
 
-	irq = platform_get_irq(pdev, 0);
-	ret = request_irq(irq, omap3_l3_app_irq,
+	l3->debug_irq = platform_get_irq(pdev, 0);
+	ret = request_irq(l3->debug_irq, omap3_l3_app_irq,
 		IRQF_DISABLED | IRQF_TRIGGER_RISING,
 		"l3-debug-irq", l3);
 	if (ret) {
 		dev_err(&pdev->dev, "couldn't request debug irq\n");
 		goto err3;
 	}
-	l3->debug_irq = irq;
 
-	irq = platform_get_irq(pdev, 1);
-	ret = request_irq(irq, omap3_l3_app_irq,
+	l3->app_irq = platform_get_irq(pdev, 1);
+	ret = request_irq(l3->app_irq, omap3_l3_app_irq,
 		IRQF_DISABLED | IRQF_TRIGGER_RISING,
 		"l3-app-irq", l3);
 
@@ -269,7 +267,6 @@ static int __init omap3_l3_probe(struct platform_device *pdev)
 		goto err4;
 	}
 
-	l3->app_irq = irq;
 	goto err0;
 
 err4:
Signature · 1 line
1.5.6.5
#2 lore raw

PATCH 2/2 arm: mach-omap2: omap_l3_smx: fix irq handler setup

Quoted 10 lines

-----Original Message-----
From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux- arm-kernel-bounces at lists.infradead.org] On Behalf Of Aaro Koskinen
Sent: Wednesday, March 16, 2011 10:46 PM
To: linux-omap at vger.kernel.org; linux-arm-
kernel at lists.infradead.org; tony at atomide.com
Cc: Aaro Koskinen
Subject: [PATCH 2/2] arm: mach-omap2: omap_l3_smx: fix irq handler setup

Quoted 4 lines

The handler function may be called from the point it is registered. Since the handler inspects IRQ numbers, we must set them up before registration.

Right. Thanks.

Quoted 2 lines

---

Quoted 58 lines
 arch/arm/mach-omap2/omap_l3_smx.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/omap_l3_smx.c +0 -0

omap2/omap_l3_smx.c
index 265bff3..5f2da75 100644

arch/arm/mach-omap2/omap_l3_smx.c +0 -1
@@ -226,7 +226,6 @@ static int __init omap3_l3_probe(struct
 platform_device *pdev)
 	struct omap3_l3         *l3;
 	struct resource         *res;
 	int                     ret;
-	int                     irq;
 
 	l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
arch/arm/mach-omap2/omap_l3_smx.c +4 -6
 	if (!l3) {
@@ -249,18 +248,17 @@ static int __init omap3_l3_probe(struct
 platform_device *pdev)
 		goto err2;
 	}
 
-	irq = platform_get_irq(pdev, 0);
-	ret = request_irq(irq, omap3_l3_app_irq,
+	l3->debug_irq = platform_get_irq(pdev, 0);
+	ret = request_irq(l3->debug_irq, omap3_l3_app_irq,
 		IRQF_DISABLED | IRQF_TRIGGER_RISING,
 		"l3-debug-irq", l3);
 	if (ret) {
 		dev_err(&pdev->dev, "couldn't request debug irq\n");
 		goto err3;
 	}
-	l3->debug_irq = irq;
 
-	irq = platform_get_irq(pdev, 1);
-	ret = request_irq(irq, omap3_l3_app_irq,
+	l3->app_irq = platform_get_irq(pdev, 1);
+	ret = request_irq(l3->app_irq, omap3_l3_app_irq,
 		IRQF_DISABLED | IRQF_TRIGGER_RISING,
 		"l3-app-irq", l3);
@@ -269,7 +267,6 @@ static int __init omap3_l3_probe(struct
 platform_device *pdev)
 		goto err4;
 	}
 
-	l3->app_irq = irq;
 	goto err0;
 

err4:
--
1.5.6.5

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw

PATCH 1/2 arm: mach-omap2: devices: fix omap3_l3_init() return value

In reply to Aaro Koskinen
Quoted 24 lines

-----Original Message-----
From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux- arm-kernel-bounces at lists.infradead.org] On Behalf Of Aaro Koskinen
Sent: Wednesday, March 16, 2011 10:46 PM
To: linux-omap at vger.kernel.org; linux-arm-
kernel at lists.infradead.org; tony at atomide.com
Cc: Aaro Koskinen
Subject: [PATCH 1/2] arm: mach-omap2: devices: fix omap3_l3_init() return value

Fix the return value for the successful case.

---
 arch/arm/mach-omap2/devices.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/devices.c +0 -0

omap2/devices.c
index 0d2d6a9..d478f53 100644

arch/arm/mach-omap2/devices.c static int __init omap3_l3_init(void) · line 71

Quoted 8 lines
arch/arm/mach-omap2/devices.c +1 -1
@@ -65,7 +65,7 @@ static int __init omap3_l3_init(void)
 
 	WARN(IS_ERR(od), "could not build omap_device for %s\n",
 oh_name);
 
-	return PTR_ERR(od);
+	return IS_ERR(od) ? PTR_ERR(od) : 0;
 }
 postcore_initcall(omap3_l3_init);

Looks good.

#4 lore raw

PATCH 1/2 arm: mach-omap2: devices: fix omap3_l3_init() return value

Hi Santosh,

Quoted 24 lines · Santosh
Quoted 24 lines

-----Original Message-----
From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux- arm-kernel-bounces at lists.infradead.org] On Behalf Of Aaro Koskinen
Sent: Wednesday, March 16, 2011 10:46 PM
To: linux-omap at vger.kernel.org; linux-arm-
kernel at lists.infradead.org; tony at atomide.com
Cc: Aaro Koskinen
Subject: [PATCH 1/2] arm: mach-omap2: devices: fix omap3_l3_init() return value

Fix the return value for the successful case.

---
  arch/arm/mach-omap2/devices.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/devices.c +0 -0

omap2/devices.c
index 0d2d6a9..d478f53 100644

arch/arm/mach-omap2/devices.c +0 -0
@@ -65,7 +65,7 @@ static int __init omap3_l3_init(void)
 
Quoted 7 lines

arch/arm/mach-omap2/devices.c static int __init omap3_l3_init(void) · line 70

Quoted 7 lines
arch/arm/mach-omap2/devices.c +1 -1
  	WARN(IS_ERR(od), "could not build omap_device for %s\n",
 oh_name);
 
-	return PTR_ERR(od);
+	return IS_ERR(od) ? PTR_ERR(od) : 0;
  }
  postcore_initcall(omap3_l3_init);

Maybe we should initialize that before, because in theory the timer12 secure violation should have been captured easily with this code?

Regards,
Benoit

#5 lore raw

PATCH 1/2 arm: mach-omap2: devices: fix omap3_l3_init() return value

Quoted 41 lines

-----Original Message-----
From: Cousson, Benoit [mailto:b-cousson at ti.com]
Sent: Thursday, March 17, 2011 1:50 PM
To: Shilimkar, Santosh
Cc: Aaro Koskinen; linux-omap at vger.kernel.org; linux-arm- kernel at lists.infradead.org; tony at atomide.com
Subject: Re: [PATCH 1/2] arm: mach-omap2: devices: fix omap3_l3_init() return value

Hi Santosh,

Quoted 3 lines · Santosh
Quoted 3 lines

-----Original Message-----
From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux- arm-kernel-bounces at lists.infradead.org] On Behalf Of Aaro

Koskinen

Quoted 5 lines
Quoted 5 lines

Sent: Wednesday, March 16, 2011 10:46 PM
To: linux-omap at vger.kernel.org; linux-arm- kernel at lists.infradead.org; tony at atomide.com
Cc: Aaro Koskinen
Subject: [PATCH 1/2] arm: mach-omap2: devices: fix

omap3_l3_init()

Quoted 19 lines
Quoted 19 lines

return value

Fix the return value for the successful case.

---
  arch/arm/mach-omap2/devices.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/devices.c +0 -0

omap2/devices.c
index 0d2d6a9..d478f53 100644

arch/arm/mach-omap2/devices.c +0 -0
@@ -65,7 +65,7 @@ static int __init omap3_l3_init(void)
 
  	WARN(IS_ERR(od), "could not build omap_device for %s\n",
 oh_name);
 
Quoted 9 lines
Quoted 4 lines

arch/arm/mach-omap2/devices.c static int __init omap3_l3_init(void) · line 70

Quoted 4 lines
arch/arm/mach-omap2/devices.c +1 -1
-	return PTR_ERR(od);
+	return IS_ERR(od) ? PTR_ERR(od) : 0;
  }
  postcore_initcall(omap3_l3_init);

Maybe we should initialize that before, because in theory the timer12 secure violation should have been captured easily with this code?

The firewall exceptions handling is removed from L3 handler because PPA has the trap implemented. We faced issues when the trap was enabled in both places.

Regards
Santosh

maintainer
#6 lore raw

PATCH 1/2 arm: mach-omap2: devices: fix omap3_l3_init() return value

Quoted 9 lines · Santosh Shilimkar
Quoted 6 lines

From: Cousson, Benoit [mailto:b-cousson at ti.com]

Maybe we should initialize that before, because in theory the timer12 secure violation should have been captured easily with this code?

The firewall exceptions handling is removed from L3 handler because PPA has the trap implemented. We faced issues when the trap was enabled in both places.

Applying these into fixes.

Tony