From: Petr Mladek <pmladek@suse.com>
To: Calvin Owens <calvin@wbinvd.org>
Cc: John Ogness <john.ogness@linutronix.de>,
Breno Leitao <leitao@debian.org>, Mike Galbraith <efault@gmx.de>,
Simon Horman <horms@kernel.org>,
kuba@kernel.org, Pavel Begunkov <asml.silence@gmail.com>,
Johannes Berg <johannes@sipsolutions.net>,
paulmck@kernel.org, LKML <linux-kernel@vger.kernel.org>,
netdev@vger.kernel.org, boqun.feng@gmail.com
Subject: Re: netconsole: HARDIRQ-safe -> HARDIRQ-unsafe lock order warning
Date: Wed, 10 Sep 2025 17:51:56 +0200 [thread overview]
Message-ID: <aMGenGUNcBbRUUf9@pathway.suse.cz> (raw)
In-Reply-To: <aL88Gb6R5M3zhMTb@mozart.vkv.me>
On Mon 2025-09-08 13:27:05, Calvin Owens wrote:
> On Friday 09/05 at 14:54 +0206, John Ogness wrote:
> > <snip>
> >
> > NBCON is meant to deprecate @oops_in_progress. However, it is true that
> > consoles not implementing ->write_atomic() will never print panic
> > output.
>
> Below is a silly little testcase that makes it more convenient to test
> if crashes are getting out in a few canned cases, in case anyone else
> finds it useful.
>
> Testing this on 6.17-rc5 on a Pi 4b, I don't get any netconsole output
> at all for any crash case over wifi, so that already doesn't work. All
> the cases currently work over ethernet.
I like this test module. IMHO, it would make sense to get it upstream.
What do you think?
Some comments below.
> ----8<----
> From: Calvin Owens <calvin@wbinvd.org>
> Subject: [PATCH] Quick and dirty testcase for netconsole (and other consoles)
>
> Signed-off-by: Calvin Owens <calvin@wbinvd.org>
> ---
> drivers/tty/Kconfig | 9 ++
> drivers/tty/Makefile | 1 +
> drivers/tty/crashtest.c | 178 ++++++++++++++++++++++++++++++++++++++++
I would put it into lib/test_crash.c. It is similar to
the existing lib/test_lockup.c
> --- /dev/null
> +++ b/drivers/tty/crashtest.c
> @@ -0,0 +1,178 @@
[...]
> +
> +static ssize_t __crash(void)
> +{
> + pr_emerg("BANG!\n");
> + *(volatile unsigned char *)NULL = '!';
> + return -ENOSYS;
I would use similar trick as SysRq-c and call panic() directly,
see sysrq_handle_crash(). Something like:
static void __crash(const char *context)
{
panic(Triggered crash in context: %s\n");
}
> +}
> +
> +static void __crash_irq_work(struct irq_work *work)
> +{
> + __crash();
and call it like:
__crash("irq");
> +}
> +
> +static int __init setup_crashtest(void)
> +{
> + INIT_WORK(&bh_crash_work, __crash_bh_work);
> + init_irq_work(&irq_crash_work, __crash_irq_work);
> + crashtest_dentry = debugfs_create_file("crashtest", 0600, NULL, NULL,
> + &crashtest_fops);
Match it with the module name: test_crash.
Maybe, do "sed -e s/crashtest/test_crash/g".
> + if (IS_ERR(crashtest_dentry))
> + return PTR_ERR(crashtest_dentry);
> +
> + return 0;
> +}
Best Regards,
Petr
next prev parent reply other threads:[~2025-09-10 15:52 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 4:14 netconsole: HARDIRQ-safe -> HARDIRQ-unsafe lock order warning Mike Galbraith
2025-08-14 10:16 ` Breno Leitao
2025-08-14 15:45 ` Pavel Begunkov
2025-08-15 0:23 ` Jakub Kicinski
2025-08-15 10:44 ` Pavel Begunkov
2025-08-15 16:42 ` Jakub Kicinski
2025-08-15 17:29 ` Breno Leitao
2025-08-15 17:33 ` Jakub Kicinski
2025-08-18 12:23 ` Breno Leitao
2025-08-15 19:10 ` Calvin Owens
2025-08-16 9:19 ` Mike Galbraith
2025-08-15 20:02 ` Pavel Begunkov
2025-08-18 12:10 ` Breno Leitao
2025-08-19 17:27 ` Breno Leitao
2025-08-20 12:31 ` Mike Galbraith
2025-08-20 17:36 ` Breno Leitao
2025-08-21 3:37 ` Mike Galbraith
2025-08-21 3:51 ` Mike Galbraith
2025-08-21 17:35 ` Breno Leitao
2025-08-22 3:54 ` Mike Galbraith
2025-08-26 12:43 ` Breno Leitao
2025-08-26 13:56 ` Mike Galbraith
2025-09-05 12:48 ` John Ogness
2025-09-06 2:32 ` Mike Galbraith
2025-09-08 13:30 ` John Ogness
2025-09-08 15:18 ` Mike Galbraith
2025-09-08 20:27 ` Calvin Owens
2025-09-09 15:49 ` Mike Galbraith
2025-09-10 15:51 ` Petr Mladek [this message]
2025-09-09 12:50 ` Breno Leitao
2025-09-10 12:22 ` John Ogness
2025-09-10 15:12 ` Petr Mladek
2025-09-10 18:26 ` Breno Leitao
2025-09-30 13:57 ` Calvin Owens
2025-09-30 14:23 ` John Ogness
2025-09-30 14:30 ` Sebastian Siewior
2025-09-30 17:35 ` Mike Galbraith
2025-10-01 6:00 ` Mike Galbraith
2025-09-11 13:03 ` John Ogness
2025-09-10 18:23 ` Breno Leitao
2025-09-11 13:13 ` John Ogness
2025-08-21 10:06 ` Mike Galbraith
2025-08-21 13:12 ` Mike Galbraith
2025-08-15 17:37 ` Calvin Owens
2025-08-26 14:10 ` Johannes Berg
2025-08-15 12:45 ` Mike Galbraith
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=aMGenGUNcBbRUUf9@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=asml.silence@gmail.com \
--cc=boqun.feng@gmail.com \
--cc=calvin@wbinvd.org \
--cc=efault@gmx.de \
--cc=horms@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=john.ogness@linutronix.de \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paulmck@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 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.