lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 4/4] printk: Drop console_sem during panic
Date
On 2022-01-24, John Ogness <john.ogness@linutronix.de> wrote:
> Something like:
>
> @@ -2731,7 +2731,8 @@ void console_unlock(void)
> * there's a new owner and the console_unlock() from them will do the
> * flush, no worries.
> */
> - retry = prb_read_valid(prb, next_seq, NULL);
> + retry = (pcpu != raw_smp_processor_id()) &&
> + prb_read_valid(prb, next_seq, NULL);
> if (retry && console_trylock())
> goto again;
> }

Sorry, that hunk is obviously garbage. I meant something like:

@@ -2731,7 +2731,10 @@ void console_unlock(void)
* there's a new owner and the console_unlock() from them will do the
* flush, no worries.
*/
- retry = prb_read_valid(prb, next_seq, NULL);
+ if (panic_in_progress())
+ retry = (pcpu == raw_smp_processor_id()) && prb_read_valid(prb, next_seq, NULL);
+ else
+ retry = prb_read_valid(prb, next_seq, NULL);
if (retry && console_trylock())
goto again;
}

I'm sure there is a cleaner way to code that.

John

\
 
 \ /
  Last update: 2022-01-24 17:26    [W:0.097 / U:1.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site