From: Steven Rostedt <rostedt@goodmis.org>
To: <kkabe@vega.pgw.jp>
Cc: dave.hansen@linux.intel.com, regressions@lists.linux.dev,
Xinhui.Pan@amd.com, linux-kernel@vger.kernel.org,
amd-gfx@lists.freedesktop.org, mingo@redhat.com, bp@alien8.de,
bagasdotme@gmail.com, hpa@zytor.com, alexander.deucher@amd.com,
tglx@linutronix.de, christian.koenig@amd.com
Subject: Re: radeon.ko/i586: BUG: kernel NULL pointer dereference,address:00000004
Date: Sun, 23 Jul 2023 10:32:10 -0400 [thread overview]
Message-ID: <20230723103210.4b1b032e@rorschach.local.home> (raw)
In-Reply-To: <230723205506.M0106064@vega.pgw.jp>
On Sun, 23 Jul 2023 20:55:06 +0900
<kkabe@vega.pgw.jp> wrote:
> So I tried to trap NULL and return:
>
> ================ patch-drm_vblank_cancel_pending_works-printk-NULL-ret.patch
> diff -up ./drivers/gpu/drm/drm_vblank_work.c.pk2 ./drivers/gpu/drm/drm_vblank_work.c
> --- ./drivers/gpu/drm/drm_vblank_work.c.pk2 2023-06-06 20:50:40.000000000 +0900
> +++ ./drivers/gpu/drm/drm_vblank_work.c 2023-07-23 14:29:56.383093673 +0900
> @@ -71,6 +71,10 @@ void drm_vblank_cancel_pending_works(str
> {
> struct drm_vblank_work *work, *next;
>
> + if (!vblank->dev) {
> + printk(KERN_WARNING "%s: vblank->dev == NULL? returning\n", __func__);
> + return;
> + }
> assert_spin_locked(&vblank->dev->event_lock);
>
> list_for_each_entry_safe(work, next, &vblank->pending_work, node) {
> ================
>
> This time, the printk trap does not happen!! and radeon.ko works.
> (NULL check for vblank->worker is still fireing though)
>
> Now this is puzzling.
> Is this a timing issue?
It could very well be. And the ftrace patch could possibly not be the
cause at all. But the thread that is created to do the work is causing
the race window to be opened up, which is why you see it with the patch
and don't without it. It may not be the problem, it may just tickle the
timings enough to trigger the bug, and is causing you to go on a wild
goose chase in the wrong direction.
-- Steve
> Is systemd-udevd doing something not favaorble to kernel?
> Is drm vblank code running without enough initialization?
>
> Puzzling is, that purely useland activity
> (logging in on tty1 before radeon.ko load)
> is affecting kernel panic/no-panic.
WARNING: multiple messages have this Message-ID (diff)
From: Steven Rostedt <rostedt@goodmis.org>
To: <kkabe@vega.pgw.jp>
Cc: regressions@lists.linux.dev, bagasdotme@gmail.com,
alexander.deucher@amd.com, christian.koenig@amd.com,
Xinhui.Pan@amd.com, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org
Subject: Re: radeon.ko/i586: BUG: kernel NULL pointer dereference,address:00000004
Date: Sun, 23 Jul 2023 10:32:10 -0400 [thread overview]
Message-ID: <20230723103210.4b1b032e@rorschach.local.home> (raw)
In-Reply-To: <230723205506.M0106064@vega.pgw.jp>
On Sun, 23 Jul 2023 20:55:06 +0900
<kkabe@vega.pgw.jp> wrote:
> So I tried to trap NULL and return:
>
> ================ patch-drm_vblank_cancel_pending_works-printk-NULL-ret.patch
> diff -up ./drivers/gpu/drm/drm_vblank_work.c.pk2 ./drivers/gpu/drm/drm_vblank_work.c
> --- ./drivers/gpu/drm/drm_vblank_work.c.pk2 2023-06-06 20:50:40.000000000 +0900
> +++ ./drivers/gpu/drm/drm_vblank_work.c 2023-07-23 14:29:56.383093673 +0900
> @@ -71,6 +71,10 @@ void drm_vblank_cancel_pending_works(str
> {
> struct drm_vblank_work *work, *next;
>
> + if (!vblank->dev) {
> + printk(KERN_WARNING "%s: vblank->dev == NULL? returning\n", __func__);
> + return;
> + }
> assert_spin_locked(&vblank->dev->event_lock);
>
> list_for_each_entry_safe(work, next, &vblank->pending_work, node) {
> ================
>
> This time, the printk trap does not happen!! and radeon.ko works.
> (NULL check for vblank->worker is still fireing though)
>
> Now this is puzzling.
> Is this a timing issue?
It could very well be. And the ftrace patch could possibly not be the
cause at all. But the thread that is created to do the work is causing
the race window to be opened up, which is why you see it with the patch
and don't without it. It may not be the problem, it may just tickle the
timings enough to trigger the bug, and is causing you to go on a wild
goose chase in the wrong direction.
-- Steve
> Is systemd-udevd doing something not favaorble to kernel?
> Is drm vblank code running without enough initialization?
>
> Puzzling is, that purely useland activity
> (logging in on tty1 before radeon.ko load)
> is affecting kernel panic/no-panic.
next prev parent reply other threads:[~2023-07-24 12:58 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-14 2:50 Fwd: radeon.ko/i586: BUG: kernel NULL pointer dereference, address: 00000004 Bagas Sanjaya
2023-07-14 2:50 ` Bagas Sanjaya
2023-07-14 3:12 ` Steven Rostedt
2023-07-14 3:12 ` Steven Rostedt
2023-07-14 3:44 ` Linux regression tracking (Thorsten Leemhuis)
2023-07-14 3:44 ` Linux regression tracking (Thorsten Leemhuis)
2023-07-14 5:32 ` radeon.ko/i586: BUG: kernel NULL pointer dereference, address:00000004 kkabe
2023-07-14 5:32 ` kkabe
2023-07-14 5:34 ` kkabe
2023-07-14 5:34 ` kkabe
2023-07-14 14:00 ` Steven Rostedt
2023-07-14 14:00 ` Steven Rostedt
2023-07-15 2:39 ` kkabe
2023-07-15 2:39 ` radeon.ko/i586: BUG: kernel NULL pointer dereference,address:00000004 kkabe
2023-07-17 15:21 ` Steven Rostedt
2023-07-17 15:21 ` Steven Rostedt
2023-07-22 1:57 ` radeon.ko/i586: BUG: kernel NULL pointerdereference, address:00000004 kkabe
2023-07-22 1:57 ` radeon.ko/i586: BUG: kernel NULL pointerdereference,address:00000004 kkabe
2023-07-17 15:36 ` radeon.ko/i586: BUG: kernel NULL pointer dereference, address:00000004 Steven Rostedt
2023-07-17 15:36 ` Steven Rostedt
2023-07-20 23:39 ` kkabe
2023-07-20 23:39 ` radeon.ko/i586: BUG: kernel NULL pointer dereference,address:00000004 kkabe
2023-07-22 2:30 ` radeon.ko/i586: BUG: kernel NULL pointer dereference, address:00000004 kabe
2023-07-22 2:30 ` radeon.ko/i586: BUG: kernel NULL pointer dereference,address:00000004 kabe
2023-07-23 11:55 ` radeon.ko/i586: BUG: kernel NULL pointer dereference, address:00000004 kkabe
2023-07-23 11:55 ` radeon.ko/i586: BUG: kernel NULL pointer dereference,address:00000004 kkabe
2023-07-23 14:32 ` Steven Rostedt [this message]
2023-07-23 14:32 ` Steven Rostedt
2023-08-29 12:08 ` Linux regression tracking (Thorsten Leemhuis)
2023-08-29 12:08 ` Linux regression tracking (Thorsten Leemhuis)
2023-07-23 14:27 ` Steven Rostedt
2023-07-23 14:27 ` Steven Rostedt
2023-10-02 10:03 ` Fwd: radeon.ko/i586: BUG: kernel NULL pointer dereference, address: 00000004 Linux regression tracking #update (Thorsten Leemhuis)
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=20230723103210.4b1b032e@rorschach.local.home \
--to=rostedt@goodmis.org \
--cc=Xinhui.Pan@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=bagasdotme@gmail.com \
--cc=bp@alien8.de \
--cc=christian.koenig@amd.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kkabe@vega.pgw.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=regressions@lists.linux.dev \
--cc=tglx@linutronix.de \
/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.