All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: John Ogness <john.ogness@linutronix.de>
Cc: Petr Mladek <pmladek@suse.com>,
	 Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	 Ryan Roberts <ryan.roberts@arm.com>,
	printk@lists.linux.dev, linux-kernel@vger.kernel.org,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH printk 3/6] printk: Evaluate flush policy in nbcon_allow_unsafe_takeover()
Date: Mon, 9 Nov 2026 06:08:40 -0800	[thread overview]
Message-ID: <avHTDeox8nDGLC6Q@gmail.com> (raw)
In-Reply-To: <20261109123127.489676-4-john.ogness@linutronix.de>

On Mon, Nov 09, 2026 at 01:37:20PM +0106, John Ogness wrote:
> @@ -1572,7 +1608,12 @@ static int __nbcon_atomic_flush_pending_con(struct console *con, enum pr_flush_r
>  	ctxt->console			= con;
>  	ctxt->spinwait_max_us		= 2000;
>  	ctxt->prio			= nbcon_get_default_prio();
> -	ctxt->allow_unsafe_takeover	= nbcon_allow_unsafe_takeover();
> +	ctxt->allow_unsafe_takeover	= nbcon_allow_unsafe_takeover(con, reason);


Thanks for the series, I've tried it here, and I got:

  sysrq: Resetting
    ------------[ cut here ]------------
    WARNING: kernel/printk/nbcon.c:561 at nbcon_context_try_acquire+0x72c/0x790, CPU#0: sh/212
    Modules linked in: nbcon_hold(OE+)
    CPU: 0 UID: 0 PID: 212 Comm: sh Tainted: G           OE       7.4.0-rc1-next-20261105upstream-00006-g4170adac69fb #1 PREEMPT(full)
    Hardware name: linux,dummy-virt (DT)
    pc : nbcon_context_try_acquire+0x72c/0x790
    lr : nbcon_context_try_acquire+0x508/0x790
    ...
    Call trace:
     nbcon_context_try_acquire+0x72c/0x790 (P)
     __nbcon_atomic_flush_pending_con+0x1c0/0x358
     nbcon_atomic_flush_pending+0x224/0x390
     printk_trigger_flush+0x50/0x1c8
     emergency_restart+0x54/0x98
     sysrq_handle_reboot+0x5c/0x88
     __handle_sysrq+0x298/0x3c0
     write_sysrq_trigger+0x178/0x1d0
     proc_reg_write+0x148/0x270
     vfs_write+0x1d4/0x7c8
     ksys_write+0xbc/0x168
     __arm64_sys_write+0x88/0xa8
     invoke_syscall+0x74/0x188
     do_el0_svc+0x108/0x190
     el0_svc+0x60/0x1d8
     el0t_64_sync_handler+0x68/0xe0
     el0t_64_sync+0x198/0x1a0

That is coming from:

   550 static int nbcon_context_try_acquire_hostile(struct nbcon_context *ctxt,
   551                                              struct nbcon_state *cur)
   552 {
   553         unsigned int cpu = smp_processor_id();
   554         struct console *con = ctxt->console;
   555         struct nbcon_state new;
   556
   557         if (!ctxt->allow_unsafe_takeover)
   558                 return -EPERM;
   559
   560         /* Ensure caller is allowed to perform unsafe hostile takeovers. */
   561         if (WARN_ON_ONCE(ctxt->prio != NBCON_PRIO_PANIC))
   562                 return -EPERM;

Thanks,
--breno

  reply	other threads:[~2026-11-09 14:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 12:31 [PATCH printk 0/6] Introduce policies for unsafe flushing John Ogness
2026-11-09 12:31 ` [PATCH printk 1/6] printk: Introduce and specify flush reasons John Ogness
2026-11-09 16:37   ` kernel test robot
2026-11-09 12:31 ` [PATCH printk 2/6] console: Introduce unsafe flush policy flags John Ogness
2026-11-09 22:05   ` Andy Shevchenko
2026-11-10  8:49     ` John Ogness
2026-11-09 12:31 ` [PATCH printk 3/6] printk: Evaluate flush policy in nbcon_allow_unsafe_takeover() John Ogness
2026-11-09 14:08   ` Breno Leitao [this message]
2026-11-09 14:28     ` John Ogness
2026-11-09 16:47       ` Breno Leitao
2026-11-09 12:31 ` [PATCH printk 4/6] printk: Remove nbcon_atomic_flush_unsafe() John Ogness
2026-11-09 12:31 ` [PATCH printk 5/6] printk: Add panic+kexec flush point John Ogness
2026-11-10 12:31   ` sashiko-bot
2026-11-09 12:31 ` [PATCH printk 6/6] netconsole: Always perform unsafe flushing on panic/kdb/restart John Ogness

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=avHTDeox8nDGLC6Q@gmail.com \
    --to=leitao@debian.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=printk@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=ryan.roberts@arm.com \
    --cc=senozhatsky@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.