mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bradley Morgan <include@grrlz.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: brauner@kernel.org, peterz@infradead.org, oleg@redhat.com,
	tglx@kernel.org, npiggin@gmail.com, ebiederm@xmission.com,
	pasha.tatashin@soleen.com, kees@kernel.org,
	stable@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzbot+8fdf0d8e10bdde1c2e88@syzkaller.appspotmail.com
Subject: Re: [PATCH] reboot: use make_task_dead for the halt and power off fallback
Date: Sun, 19 Jul 2026 13:49:53 +0100	[thread overview]
Message-ID: <7D5A48E0-F891-4497-B574-D9DA99256173@grrlz.net> (raw)
In-Reply-To: <0D454AB0-9690-4228-84DD-60AC3F02C9FC@grrlz.net>

On July 14, 2026 4:48:09 PM GMT+01:00, Bradley Morgan <include@grrlz.net>
wrote:
>On July 14, 2026 2:10:01 AM GMT+01:00, Andrew Morton
><akpm@linux-foundation.org> wrote:
>>On Mon, 13 Jul 2026 06:23:32 +0000 Bradley Morgan <include@grrlz.net>
>>wrote:
>>
>>> The reboot syscall calls do_exit(0) after kernel_halt() or
>>> kernel_power_off().  Those are expected to stop the machine and not
>>> return.  When they do return, the shutdown path has already disabled
>>> interrupts and torn down state, and do_exit() then hits its
>>> WARN_ON(irqs_disabled()).
>>
>>Well...  why are they returning?  Is it both kernel_halt() and
>>kernel_power_off()?  The report seems to indicate that
>>kernel_power_off() is returning.
>
>native_machine_power_off() has no __noreturn backstop.
>
>(Only for kernel_power_off, kernel_halt() is theoretically safe, ends in
>stop_this_cpu)
>
>>So is there a flaw in x86 machine_power_off() which we should be
>>addressing?
>
>Well, yes, but it's really not that simple Andrew...
>
>I did a quick dig at the other arches code and guess what? 
>
>x86, arm, arm64, (loongarch, riscv)           power_off can all return,
>(BUG!)
>
>
>So just doing a fix arch specific isn't really right (unless we want a
>3-5 patch series, which just adds more complication)
>
>>> That is an error path, not a clean exit.  Use make_task_dead() instead
>>> of do_exit(0): it is built for this, fixes up the irqs disabled and
>>> preempt state, and bounds repeated failure via oops_limit.  This
>>> matches the make_task_dead pattern that exit.c already uses for the
>>> oops path.
>>
>>And make_tsk_dead() is __noreturn.
>
>Nice catch! let's just remove break;, it's dead code
>
>>
>>
>
>Thanks!


Andrew? What do you think of this? (Sorry for the ping)

Thanks!

      reply	other threads:[~2026-07-19 12:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13  6:23 Bradley Morgan
2026-07-14  1:10 ` Andrew Morton
2026-07-14 15:48   ` Bradley Morgan
2026-07-19 12:49     ` Bradley Morgan [this message]

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=7D5A48E0-F891-4497-B574-D9DA99256173@grrlz.net \
    --to=include@grrlz.net \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@gmail.com \
    --cc=oleg@redhat.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+8fdf0d8e10bdde1c2e88@syzkaller.appspotmail.com \
    --cc=tglx@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®