linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix compile warning in pseries xics
@ 2007-05-29  5:50 Michael Neuling
  2007-05-29  5:52 ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Neuling @ 2007-05-29  5:50 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

In 616883df78bd4b3fcdb6ddc39bd3d4cb902bfa32 request_irq was marked as
__must_check so we must... er... check it.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
This is the only request_irq which is not checked in arch/powerpc

 arch/powerpc/platforms/pseries/xics.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Index: linux-2.6-ozlabs/arch/powerpc/platforms/pseries/xics.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/platforms/pseries/xics.c
+++ linux-2.6-ozlabs/arch/powerpc/platforms/pseries/xics.c
@@ -752,6 +752,7 @@ skip_gserver_check:
 void xics_request_IPIs(void)
 {
 	unsigned int ipi;
+	int t;
 
 	ipi = irq_create_mapping(xics_host, XICS_IPI);
 	BUG_ON(ipi == NO_IRQ);
@@ -762,11 +763,15 @@ void xics_request_IPIs(void)
 	 */
 	set_irq_handler(ipi, handle_percpu_irq);
 	if (firmware_has_feature(FW_FEATURE_LPAR))
-		request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
-			    "IPI", NULL);
+		t = request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
+				"IPI", NULL);
 	else
-		request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
-			    "IPI", NULL);
+		t = request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
+				"IPI", NULL);
+	if (t)
+		printk(KERN_ERR "Unable to request interrupt %d for IPI\n",
+		       ipi);
+
 }
 #endif /* CONFIG_SMP */
 

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

* Re: [PATCH] fix compile warning in pseries xics
  2007-05-29  5:50 [PATCH] fix compile warning in pseries xics Michael Neuling
@ 2007-05-29  5:52 ` Michael Ellerman
  2007-05-29  7:01   ` Michael Neuling
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2007-05-29  5:52 UTC (permalink / raw)
  To: Michael Neuling; +Cc: linuxppc-dev, paulus

[-- Attachment #1: Type: text/plain, Size: 1787 bytes --]

On Tue, 2007-05-29 at 15:50 +1000, Michael Neuling wrote:
> In 616883df78bd4b3fcdb6ddc39bd3d4cb902bfa32 request_irq was marked as
> __must_check so we must... er... check it.
> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
> This is the only request_irq which is not checked in arch/powerpc
> 
>  arch/powerpc/platforms/pseries/xics.c |   13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> Index: linux-2.6-ozlabs/arch/powerpc/platforms/pseries/xics.c
> ===================================================================
> --- linux-2.6-ozlabs.orig/arch/powerpc/platforms/pseries/xics.c
> +++ linux-2.6-ozlabs/arch/powerpc/platforms/pseries/xics.c
> @@ -752,6 +752,7 @@ skip_gserver_check:
>  void xics_request_IPIs(void)
>  {
>  	unsigned int ipi;
> +	int t;
>  
>  	ipi = irq_create_mapping(xics_host, XICS_IPI);
>  	BUG_ON(ipi == NO_IRQ);
> @@ -762,11 +763,15 @@ void xics_request_IPIs(void)
>  	 */
>  	set_irq_handler(ipi, handle_percpu_irq);
>  	if (firmware_has_feature(FW_FEATURE_LPAR))
> -		request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
> -			    "IPI", NULL);
> +		t = request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
> +				"IPI", NULL);
>  	else
> -		request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
> -			    "IPI", NULL);
> +		t = request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
> +				"IPI", NULL);
> +	if (t)
> +		printk(KERN_ERR "Unable to request interrupt %d for IPI\n",
> +		       ipi);

or BUG() ?

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* [PATCH] fix compile warning in pseries xics
  2007-05-29  5:52 ` Michael Ellerman
@ 2007-05-29  7:01   ` Michael Neuling
  2007-05-29 14:27     ` Olof Johansson
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Neuling @ 2007-05-29  7:01 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

In 616883df78bd4b3fcdb6ddc39bd3d4cb902bfa32 request_irq was marked as
__must_check so we must... er... check it.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
Updated based on comments from mpe and benh.

 arch/powerpc/platforms/pseries/xics.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: linux-2.6-ozlabs/arch/powerpc/platforms/pseries/xics.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/platforms/pseries/xics.c
+++ linux-2.6-ozlabs/arch/powerpc/platforms/pseries/xics.c
@@ -752,6 +752,7 @@ skip_gserver_check:
 void xics_request_IPIs(void)
 {
 	unsigned int ipi;
+	int rc;
 
 	ipi = irq_create_mapping(xics_host, XICS_IPI);
 	BUG_ON(ipi == NO_IRQ);
@@ -762,11 +763,12 @@ void xics_request_IPIs(void)
 	 */
 	set_irq_handler(ipi, handle_percpu_irq);
 	if (firmware_has_feature(FW_FEATURE_LPAR))
-		request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
-			    "IPI", NULL);
+		rc = request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
+				"IPI", NULL);
 	else
-		request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
-			    "IPI", NULL);
+		rc = request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
+				"IPI", NULL);
+	BUG_ON(rc);
 }
 #endif /* CONFIG_SMP */
 

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

* Re: [PATCH] fix compile warning in pseries xics
  2007-05-29  7:01   ` Michael Neuling
@ 2007-05-29 14:27     ` Olof Johansson
  2007-05-30  0:28       ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Olof Johansson @ 2007-05-29 14:27 UTC (permalink / raw)
  To: Michael Neuling; +Cc: linuxppc-dev, paulus

On Tue, May 29, 2007 at 05:01:52PM +1000, Michael Neuling wrote:
> @@ -762,11 +763,12 @@ void xics_request_IPIs(void)
>  	 */
>  	set_irq_handler(ipi, handle_percpu_irq);
>  	if (firmware_has_feature(FW_FEATURE_LPAR))
> -		request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
> -			    "IPI", NULL);
> +		rc = request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
> +				"IPI", NULL);
>  	else
> -		request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
> -			    "IPI", NULL);
> +		rc = request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
> +				"IPI", NULL);
> +	BUG_ON(rc);

Is this late enough during boot that you actually get useful information
out of a BUG()?  It might be better to spit out an error and keep on
going if that's the case (I'm afraid I don't have hardware at hand to
test with right now).


-Olof

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

* Re: [PATCH] fix compile warning in pseries xics
  2007-05-29 14:27     ` Olof Johansson
@ 2007-05-30  0:28       ` Michael Ellerman
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2007-05-30  0:28 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, Michael Neuling, paulus

[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]

On Tue, 2007-05-29 at 09:27 -0500, Olof Johansson wrote:
> On Tue, May 29, 2007 at 05:01:52PM +1000, Michael Neuling wrote:
> > @@ -762,11 +763,12 @@ void xics_request_IPIs(void)
> >  	 */
> >  	set_irq_handler(ipi, handle_percpu_irq);
> >  	if (firmware_has_feature(FW_FEATURE_LPAR))
> > -		request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
> > -			    "IPI", NULL);
> > +		rc = request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
> > +				"IPI", NULL);
> >  	else
> > -		request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
> > -			    "IPI", NULL);
> > +		rc = request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
> > +				"IPI", NULL);
> > +	BUG_ON(rc);
> 
> Is this late enough during boot that you actually get useful information
> out of a BUG()?  It might be better to spit out an error and keep on
> going if that's the case (I'm afraid I don't have hardware at hand to
> test with right now).

It's way late:

start_kernel()
  rest_init()
    kernel_init()
      smp_prepare_cpus()
        smp_ops->probe()
          smp_xics_probe()
            xics_request_IPIs()

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2007-05-30  0:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-29  5:50 [PATCH] fix compile warning in pseries xics Michael Neuling
2007-05-29  5:52 ` Michael Ellerman
2007-05-29  7:01   ` Michael Neuling
2007-05-29 14:27     ` Olof Johansson
2007-05-30  0:28       ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).