LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/1] Make sure that any oops is flushed to the mtdoops console
@ 2008-10-22 15:16 Viktor Rosendahl
  2008-10-22 15:16 ` [PATCH 1/1] " Viktor Rosendahl
  0 siblings, 1 reply; 5+ messages in thread
From: Viktor Rosendahl @ 2008-10-22 15:16 UTC (permalink / raw)
  To: linux-kernel

Hello,

This is a patch that we have in the N810 kernel to flush the mtdoops console to
flash. I am not sure that this is a proper solution; better ideas are always
appreciated.

best regards,

Viktor

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

* [PATCH 1/1] Make sure that any oops is flushed to the mtdoops console
  2008-10-22 15:16 [PATCH 0/1] Make sure that any oops is flushed to the mtdoops console Viktor Rosendahl
@ 2008-10-22 15:16 ` Viktor Rosendahl
  2008-10-30 20:17   ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Viktor Rosendahl @ 2008-10-22 15:16 UTC (permalink / raw)
  To: linux-kernel

This used to work unpatched with older kernels, during the development phase
of mtdoops. Before commit e3e8a75d2acfc61ebf25524666a0a2c6abb0620c a space was
printed with console_loglevel set to 15, which probably flushed the oops
message as a side effect.

This is another patch from the Nokia N810 kernel.

Signed-off-by: Viktor Rosendahl <viktor.rosendahl@nokia.com>
---
 lib/bust_spinlocks.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/bust_spinlocks.c b/lib/bust_spinlocks.c
index 486da62..9681d54 100644
--- a/lib/bust_spinlocks.c
+++ b/lib/bust_spinlocks.c
@@ -12,6 +12,7 @@
 #include <linux/tty.h>
 #include <linux/wait.h>
 #include <linux/vt_kern.h>
+#include <linux/console.h>
 
 
 void __attribute__((weak)) bust_spinlocks(int yes)
@@ -22,6 +23,7 @@ void __attribute__((weak)) bust_spinlocks(int yes)
 #ifdef CONFIG_VT
 		unblank_screen();
 #endif
+		console_unblank();
 		if (--oops_in_progress == 0)
 			wake_up_klogd();
 	}
-- 
1.5.6.5


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

* Re: [PATCH 1/1] Make sure that any oops is flushed to the mtdoops console
  2008-10-22 15:16 ` [PATCH 1/1] " Viktor Rosendahl
@ 2008-10-30 20:17   ` Andrew Morton
  2008-10-31 13:05     ` Viktor Rosendahl
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2008-10-30 20:17 UTC (permalink / raw)
  To: Viktor Rosendahl; +Cc: linux-kernel, linux-mtd

On Wed, 22 Oct 2008 18:16:28 +0300
Viktor Rosendahl <viktor.rosendahl@nokia.com> wrote:

> This used to work unpatched with older kernels, during the development phase
> of mtdoops. Before commit e3e8a75d2acfc61ebf25524666a0a2c6abb0620c a space was
> printed with console_loglevel set to 15, which probably flushed the oops
> message as a side effect.
> 
> This is another patch from the Nokia N810 kernel.
> 
> Signed-off-by: Viktor Rosendahl <viktor.rosendahl@nokia.com>
> ---
>  lib/bust_spinlocks.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/lib/bust_spinlocks.c b/lib/bust_spinlocks.c
> index 486da62..9681d54 100644
> --- a/lib/bust_spinlocks.c
> +++ b/lib/bust_spinlocks.c
> @@ -12,6 +12,7 @@
>  #include <linux/tty.h>
>  #include <linux/wait.h>
>  #include <linux/vt_kern.h>
> +#include <linux/console.h>
>  
>  
>  void __attribute__((weak)) bust_spinlocks(int yes)
> @@ -22,6 +23,7 @@ void __attribute__((weak)) bust_spinlocks(int yes)
>  #ifdef CONFIG_VT
>  		unblank_screen();
>  #endif
> +		console_unblank();
>  		if (--oops_in_progress == 0)
>  			wake_up_klogd();
>  	}

That looks logical.  From my reading we can now remove that
unblank_screen(), because the console_unblank() will call
vt_console_driver.unblank() for us?

--- a/lib/bust_spinlocks.c~oops-handling-ensure-that-any-oops-is-flushed-to-the-mtdoops-console-fix
+++ a/lib/bust_spinlocks.c
@@ -11,7 +11,6 @@
 #include <linux/spinlock.h>
 #include <linux/tty.h>
 #include <linux/wait.h>
-#include <linux/vt_kern.h>
 #include <linux/console.h>
 
 
@@ -20,9 +19,6 @@ void __attribute__((weak)) bust_spinlock
 	if (yes) {
 		++oops_in_progress;
 	} else {
-#ifdef CONFIG_VT
-		unblank_screen();
-#endif
 		console_unblank();
 		if (--oops_in_progress == 0)
 			wake_up_klogd();
_


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

* Re: [PATCH 1/1] Make sure that any oops is flushed to the mtdoops console
  2008-10-30 20:17   ` Andrew Morton
@ 2008-10-31 13:05     ` Viktor Rosendahl
  2008-11-05  0:00       ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Viktor Rosendahl @ 2008-10-31 13:05 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-mtd

On Thu, 2008-10-30 at 13:17 -0700, ext Andrew Morton wrote: 
> On Wed, 22 Oct 2008 18:16:28 +0300
> Viktor Rosendahl <viktor.rosendahl@nokia.com> wrote:
<clip> 
> >  void __attribute__((weak)) bust_spinlocks(int yes)
> > @@ -22,6 +23,7 @@ void __attribute__((weak)) bust_spinlocks(int yes)
> >  #ifdef CONFIG_VT
> >  		unblank_screen();
> >  #endif
> > +		console_unblank();
> >  		if (--oops_in_progress == 0)
> >  			wake_up_klogd();
> >  	}
> 
> That looks logical.  From my reading we can now remove that
> unblank_screen(), because the console_unblank() will call
> vt_console_driver.unblank() for us?

For some reason, we did not think about it here when the N810 kernel was
fixed. It looks good to me but if you do it, then there will be a slight
difference in behavior, since console_unblank() will call
vt_console_driver.unblank() only if the console_sem can be acquired,
otherwise it just returns without doing anything.

Maybe console_unblank() should be changed to not care too much about the
console_sem if an oops is in progress? 

best regards,

Viktor



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

* Re: [PATCH 1/1] Make sure that any oops is flushed to the mtdoops console
  2008-10-31 13:05     ` Viktor Rosendahl
@ 2008-11-05  0:00       ` Andrew Morton
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2008-11-05  0:00 UTC (permalink / raw)
  To: Viktor Rosendahl; +Cc: linux-kernel, linux-mtd

On Fri, 31 Oct 2008 15:05:28 +0200
Viktor Rosendahl <Viktor.Rosendahl@nokia.com> wrote:

> On Thu, 2008-10-30 at 13:17 -0700, ext Andrew Morton wrote: 
> > On Wed, 22 Oct 2008 18:16:28 +0300
> > Viktor Rosendahl <viktor.rosendahl@nokia.com> wrote:
> <clip> 
> > >  void __attribute__((weak)) bust_spinlocks(int yes)
> > > @@ -22,6 +23,7 @@ void __attribute__((weak)) bust_spinlocks(int yes)
> > >  #ifdef CONFIG_VT
> > >  		unblank_screen();
> > >  #endif
> > > +		console_unblank();
> > >  		if (--oops_in_progress == 0)
> > >  			wake_up_klogd();
> > >  	}
> > 
> > That looks logical.  From my reading we can now remove that
> > unblank_screen(), because the console_unblank() will call
> > vt_console_driver.unblank() for us?
> 
> For some reason, we did not think about it here when the N810 kernel was
> fixed. It looks good to me but if you do it, then there will be a slight
> difference in behavior, since console_unblank() will call
> vt_console_driver.unblank() only if the console_sem can be acquired,
> otherwise it just returns without doing anything.
> 
> Maybe console_unblank() should be changed to not care too much about the
> console_sem if an oops is in progress? 
> 

hm, yeah.  Things get messy if we take an oops with console_sem held.

I'll drop the cleanup patch - I don't have time to think about and test
anything useful like that :(



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

end of thread, other threads:[~2008-11-05  0:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-22 15:16 [PATCH 0/1] Make sure that any oops is flushed to the mtdoops console Viktor Rosendahl
2008-10-22 15:16 ` [PATCH 1/1] " Viktor Rosendahl
2008-10-30 20:17   ` Andrew Morton
2008-10-31 13:05     ` Viktor Rosendahl
2008-11-05  0:00       ` Andrew Morton

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).