public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix WARN() for PPC
@ 2008-10-20 21:50 Arjan van de Ven
  2008-10-20 23:13 ` Benjamin Herrenschmidt
  2008-10-22 20:23 ` Jeremy Fitzhardinge
  0 siblings, 2 replies; 5+ messages in thread
From: Arjan van de Ven @ 2008-10-20 21:50 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, johannes, davem, Benjamin Herrenschmidt


From: Arjan van de Ven <arjan@linux.intel.com>
Date: Mon, 20 Oct 2008 14:41:03 -0700
Subject: [PATCH] fix WARN() for PPC

powerpc doesn't use the generic WARN_ON infrastructure. The newly introduced WARN()
as a result didn't print the message, this patch adds the printk for this specific case.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 include/asm-generic/bug.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 0f6dabd..12c07c1 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -41,7 +41,7 @@ extern void warn_slowpath(const char *file, const int line,
 #define __WARN() warn_on_slowpath(__FILE__, __LINE__)
 #define __WARN_printf(arg...) warn_slowpath(__FILE__, __LINE__, arg)
 #else
-#define __WARN_printf(arg...) __WARN()
+#define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0)
 #endif
 
 #ifndef WARN_ON
-- 
1.5.5.1



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

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

* Re: [PATCH] fix WARN() for PPC
  2008-10-20 21:50 [PATCH] fix WARN() for PPC Arjan van de Ven
@ 2008-10-20 23:13 ` Benjamin Herrenschmidt
  2008-10-22 20:23 ` Jeremy Fitzhardinge
  1 sibling, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2008-10-20 23:13 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: torvalds, linux-kernel, johannes, davem

On Mon, 2008-10-20 at 14:50 -0700, Arjan van de Ven wrote:
> From: Arjan van de Ven <arjan@linux.intel.com>
> Date: Mon, 20 Oct 2008 14:41:03 -0700
> Subject: [PATCH] fix WARN() for PPC
> 
> powerpc doesn't use the generic WARN_ON infrastructure. The newly introduced WARN()
> as a result didn't print the message, this patch adds the printk for this specific case.
> 
> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>

Thanks, will apply.

Cheers,
Ben.



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

* Re: [PATCH] fix WARN() for PPC
  2008-10-20 21:50 [PATCH] fix WARN() for PPC Arjan van de Ven
  2008-10-20 23:13 ` Benjamin Herrenschmidt
@ 2008-10-22 20:23 ` Jeremy Fitzhardinge
  2008-10-22 20:31   ` Arjan van de Ven
  2008-10-23  6:26   ` Johannes Berg
  1 sibling, 2 replies; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2008-10-22 20:23 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: torvalds, linux-kernel, johannes, davem, Benjamin Herrenschmidt

Arjan van de Ven wrote:
> From: Arjan van de Ven <arjan@linux.intel.com>
> Date: Mon, 20 Oct 2008 14:41:03 -0700
> Subject: [PATCH] fix WARN() for PPC
>
> powerpc doesn't use the generic WARN_ON infrastructure.

Hm, why's that now?  The generic infrastructure was taken from powerpc, 
and I thought I'd converted it...

    J

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

* Re: [PATCH] fix WARN() for PPC
  2008-10-22 20:23 ` Jeremy Fitzhardinge
@ 2008-10-22 20:31   ` Arjan van de Ven
  2008-10-23  6:26   ` Johannes Berg
  1 sibling, 0 replies; 5+ messages in thread
From: Arjan van de Ven @ 2008-10-22 20:31 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: torvalds, linux-kernel, johannes, davem, Benjamin Herrenschmidt

On Wed, 22 Oct 2008 13:23:21 -0700
Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> Arjan van de Ven wrote:
> > From: Arjan van de Ven <arjan@linux.intel.com>
> > Date: Mon, 20 Oct 2008 14:41:03 -0700
> > Subject: [PATCH] fix WARN() for PPC
> >
> > powerpc doesn't use the generic WARN_ON infrastructure.
> 
> Hm, why's that now?  The generic infrastructure was taken from
> powerpc, and I thought I'd converted it...
> 

it uses a BUG like trap rather than the normal WARN_ON() being a
function call to lib/bug.c


-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

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

* Re: [PATCH] fix WARN() for PPC
  2008-10-22 20:23 ` Jeremy Fitzhardinge
  2008-10-22 20:31   ` Arjan van de Ven
@ 2008-10-23  6:26   ` Johannes Berg
  1 sibling, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2008-10-23  6:26 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: Arjan van de Ven, torvalds, linux-kernel, davem,
	Benjamin Herrenschmidt

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

On Wed, 2008-10-22 at 13:23 -0700, Jeremy Fitzhardinge wrote:
> Arjan van de Ven wrote:
> > From: Arjan van de Ven <arjan@linux.intel.com>
> > Date: Mon, 20 Oct 2008 14:41:03 -0700
> > Subject: [PATCH] fix WARN() for PPC
> >
> > powerpc doesn't use the generic WARN_ON infrastructure.
> 
> Hm, why's that now?  The generic infrastructure was taken from powerpc, 
> and I thought I'd converted it...

The definition of "generic" changed midway. When you did the "generic"
infrastructure, it was written to use traps for both WARN and BUG. But
then somebody didn't like that and added new "generic" infrastructure
(the one Arjan is talking about) which doesn't use traps for WARN but
rather an unlikely() and an actual function call etc. Then Arjan
improved the latter "generic" infrastructure without regard for the
original one.

johannes

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

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

end of thread, other threads:[~2008-10-23  6:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-20 21:50 [PATCH] fix WARN() for PPC Arjan van de Ven
2008-10-20 23:13 ` Benjamin Herrenschmidt
2008-10-22 20:23 ` Jeremy Fitzhardinge
2008-10-22 20:31   ` Arjan van de Ven
2008-10-23  6:26   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox