From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Nicholas Piggin <npiggin@gmail.com>, linuxppc-dev@lists.ozlabs.org
Cc: Nicholas Piggin <npiggin@gmail.com>
Subject: Re: [1/2] powerpc/powernv: Fix opal_event_shutdown() called with interrupts disabled
Date: Mon, 21 May 2018 20:01:25 +1000 (AEST) [thread overview]
Message-ID: <40qDnd65QKz9s3M@ozlabs.org> (raw)
In-Reply-To: <20180514155947.22753-2-npiggin@gmail.com>
On Mon, 2018-05-14 at 15:59:46 UTC, Nicholas Piggin wrote:
> A kernel crash in process context that calls emergency_restart from
> panic will end up calling opal_event_shutdown with interrupts disabled
> but not in interrupt. This causes a sleeping function to be called
> which gives the following warning with sysrq+c:
>
> Rebooting in 10 seconds..
> BUG: sleeping function called from invalid context at kernel/locking/mutex.c:238
> in_atomic(): 0, irqs_disabled(): 1, pid: 7669, name: bash
> CPU: 20 PID: 7669 Comm: bash Tainted: G D W 4.17.0-rc5+ #3
> Call Trace:
> dump_stack+0xb0/0xf4 (unreliable)
> ___might_sleep+0x174/0x1a0
> mutex_lock+0x38/0xb0
> __free_irq+0x68/0x460
> free_irq+0x70/0xc0
> opal_event_shutdown+0xb4/0xf0
> opal_shutdown+0x24/0xa0
> pnv_shutdown+0x28/0x40
> machine_shutdown+0x44/0x60
> machine_restart+0x28/0x80
> emergency_restart+0x30/0x50
> panic+0x2a0/0x328
> oops_end+0x1ec/0x1f0
> bad_page_fault+0xe8/0x154
> handle_page_fault+0x34/0x38
> --- interrupt: 300 at sysrq_handle_crash+0x44/0x60
> LR = __handle_sysrq+0xfc/0x260
> flag_spec.62335+0x12b844/0x1e8db4 (unreliable)
> __handle_sysrq+0xfc/0x260
> write_sysrq_trigger+0xa8/0xb0
> proc_reg_write+0xac/0x110
> __vfs_write+0x6c/0x240
> vfs_write+0xd0/0x240
> ksys_write+0x6c/0x110
>
> Fixes: 9f0fd0499d30 ("powerpc/powernv: Add a virtual irqchip for opal events")
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/c0beffc4f4c658fde86d52c837e784
cheers
next prev parent reply other threads:[~2018-05-21 10:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-14 15:59 [PATCH 0/2] sleeping functions in invalid context on panic fixes Nicholas Piggin
2018-05-14 15:59 ` [PATCH 1/2] powerpc/powernv: Fix opal_event_shutdown() called with interrupts disabled Nicholas Piggin
2018-05-21 10:01 ` Michael Ellerman [this message]
2018-05-14 15:59 ` [PATCH 2/2] powerpc/powernv: Fix NVRAM sleep in invalid context when crashing Nicholas Piggin
2018-05-17 14:55 ` [2/2] " Michael Ellerman
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=40qDnd65QKz9s3M@ozlabs.org \
--to=patch-notifications@ellerman.id.au \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).