From: Guenter Roeck <linux@roeck-us.net>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
sparclinux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Boqun Feng <boqun.feng@gmail.com>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Waiman Long <longman@redhat.com>, Will Deacon <will@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Andreas Larsson <andreas@gaisler.com>
Subject: Re: [PATCH] sparc/pci: Make pci_poke_lock a raw_spinlock_t.
Date: Mon, 25 Nov 2024 09:01:33 -0800 [thread overview]
Message-ID: <b776ca37-d51c-47e2-b3bb-aee8e7910630@roeck-us.net> (raw)
In-Reply-To: <20241125085314.1iSDFulg@linutronix.de>
On 11/25/24 00:53, Sebastian Andrzej Siewior wrote:
> The pci_poke_lock is used underneath of the pci_lock. The pci_lock is a
> low level lock used by the core code in sections with disabled
> insterrupts. Therefore the pci_poke_lock must be a raw_spinlock_t.
>
> Make pci_poke_lock a raw_spinlock_t.
>
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Closes: https://lore.kernel.org/7656395b-58fc-4874-a9f3-6d934e2ef7ee@roeck-us.net
> Fixes: 560af5dc839ee ("lockdep: Enable PROVE_RAW_LOCK_NESTING with PROVE_LOCKING.")
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> On 2024-11-23 08:27:08 [-0800], Guenter Roeck wrote:
>>
>> Is this a problem with the test or with the platform ?
>
> platform. The patch below should fix it. It makes no difference unless
> used on PREEMPT_RT. Since sparc does not support it I made the fixes
> where the default option changed.
>
> Could you test it, please? I don't have a even a compiler for sparc
> right now.
>
Unfortunately it doesn't make a difference.
[ 1.050499] =============================
[ 1.050801] [ BUG: Invalid wait context ]
[ 1.051200] 6.12.0+ #1 Not tainted
[ 1.051571] -----------------------------
[ 1.051875] swapper/0/1 is trying to lock:
[ 1.052201] 0000000001b694c8 (pci_poke_lock){....}-{3:3}, at: pci_config_read16+0x8/0x80
[ 1.052994] other info that might help us debug this:
[ 1.053331] context-{5:5}
[ 1.053641] 2 locks held by swapper/0/1:
[ 1.053959] #0: fffff800042b50f8 (&dev->mutex){....}-{4:4}, at: __driver_attach+0x80/0x160
[ 1.054388] #1: 0000000001d29078 (pci_lock){....}-{2:2}, at: pci_bus_read_config_word+0x18/0x80
[ 1.054793] stack backtrace:
[ 1.055171] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.0+ #1
[ 1.055632] Call Trace:
[ 1.055985] [<00000000004e31d0>] __lock_acquire+0xa50/0x3160
[ 1.056329] [<00000000004e63e8>] lock_acquire+0xe8/0x340
[ 1.056645] [<00000000010f0dfc>] _raw_spin_lock_irqsave+0x3c/0x80
[ 1.056966] [<0000000000443828>] pci_config_read16+0x8/0x80
[ 1.057278] [<000000000044442c>] sun4u_read_pci_cfg+0x12c/0x1a0
[ 1.057593] [<0000000000b7657c>] pci_bus_read_config_word+0x3c/0x80
[ 1.057913] [<0000000000b7fa78>] pci_find_capability+0x18/0xa0
[ 1.058228] [<0000000000b794b0>] set_pcie_port_type+0x10/0x160
[ 1.058543] [<0000000000442a98>] pci_of_scan_bus+0x158/0xb00
[ 1.058854] [<00000000010c74a0>] pci_scan_one_pbm+0xd0/0xf8
[ 1.059167] [<0000000000446174>] sabre_probe+0x1f4/0x5c0
[ 1.059476] [<0000000000c13a48>] platform_probe+0x28/0x80
[ 1.059785] [<0000000000c11158>] really_probe+0xb8/0x340
[ 1.060098] [<0000000000c11584>] driver_probe_device+0x24/0xe0
[ 1.060413] [<0000000000c117ac>] __driver_attach+0x8c/0x160
[ 1.060728] [<0000000000c0ef54>] bus_for_each_dev+0x54/0xc0
The original call trace also included _raw_spin_lock_irqsave(), and
I don't have CONFIG_PREEMPT_RT enabled in my sparc64 builds to start with.
FWIW, I don't understand the value of
pr_warn("context-{%d:%d}\n", curr_inner, curr_inner);
Why print curr_inner twice ?
Thanks,
Guenter
next prev parent reply other threads:[~2024-11-25 17:01 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 15:45 [PATCH 0/1] lockdep: Enable PROVE_RAW_LOCK_NESTING with PROVE_LOCKING Sebastian Andrzej Siewior
2024-10-09 15:45 ` [PATCH 1/1] " Sebastian Andrzej Siewior
2024-10-09 16:50 ` Waiman Long
2024-10-09 22:47 ` Boqun Feng
2024-10-22 21:53 ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
2024-11-23 16:27 ` [PATCH 1/1] " Guenter Roeck
2024-11-25 8:53 ` [PATCH] sparc/pci: Make pci_poke_lock a raw_spinlock_t Sebastian Andrzej Siewior
2024-11-25 17:01 ` Guenter Roeck [this message]
2024-11-25 17:43 ` Sebastian Andrzej Siewior
2024-11-25 17:59 ` Guenter Roeck
2024-11-25 18:12 ` Sebastian Andrzej Siewior
2024-11-25 19:23 ` Guenter Roeck
2024-11-25 19:33 ` Waiman Long
2024-11-25 20:06 ` Guenter Roeck
2024-11-25 20:23 ` Guenter Roeck
2024-11-25 20:54 ` Waiman Long
2024-11-25 21:25 ` Guenter Roeck
2024-11-25 21:29 ` Waiman Long
2024-11-25 21:54 ` Guenter Roeck
2024-11-25 22:33 ` Waiman Long
2024-11-26 11:20 ` Sebastian Andrzej Siewior
2024-11-26 16:59 ` Waiman Long
2024-11-27 15:39 ` Andreas Larsson
2024-11-27 16:02 ` Guenter Roeck
2024-11-27 16:53 ` Sebastian Andrzej Siewior
2024-11-27 17:44 ` Guenter Roeck
2024-11-27 23:47 ` Waiman Long
2024-11-28 0:08 ` Guenter Roeck
2024-11-28 0:31 ` Waiman Long
2024-11-28 1:17 ` Guenter Roeck
2024-11-28 1:55 ` Waiman Long
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=b776ca37-d51c-47e2-b3bb-aee8e7910630@roeck-us.net \
--to=linux@roeck-us.net \
--cc=andreas@gaisler.com \
--cc=bigeasy@linutronix.de \
--cc=boqun.feng@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sparclinux@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=will@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.