* [PATCH v1] dmaengine: pl330: Fix lockdep warning about non-static key
@ 2022-05-20 18:14 Dmitry Osipenko
2022-07-06 5:19 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Osipenko @ 2022-05-20 18:14 UTC (permalink / raw)
To: Vinod Koul; +Cc: dmaengine, linux-kernel
The DEFINE_SPINLOCK() macro shouldn't be used for dynamically allocated
spinlocks. The lockdep warns about this and disables locking validator.
Fix the warning by making lock static.
INFO: trying to register non-static key.
The code is fine but needs lockdep annotation, or maybe
you didn't initialize this object before use?
turning off the locking correctness validator.
Hardware name: Radxa ROCK Pi 4C (DT)
Call trace:
dump_backtrace.part.0+0xcc/0xe0
show_stack+0x18/0x6c
dump_stack_lvl+0x8c/0xb8
dump_stack+0x18/0x34
register_lock_class+0x4a8/0x4cc
__lock_acquire+0x78/0x20cc
lock_acquire.part.0+0xe0/0x230
lock_acquire+0x68/0x84
_raw_spin_lock_irqsave+0x84/0xc4
add_desc+0x44/0xc0
pl330_get_desc+0x15c/0x1d0
pl330_prep_dma_cyclic+0x100/0x270
snd_dmaengine_pcm_trigger+0xec/0x1c0
dmaengine_pcm_trigger+0x18/0x24
...
Fixes: e588710311ee ("dmaengine: pl330: fix descriptor allocation fail")
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
---
drivers/dma/pl330.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 858400e42ec0..09915a5cba3e 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2589,7 +2589,7 @@ static struct dma_pl330_desc *pl330_get_desc(struct dma_pl330_chan *pch)
/* If the DMAC pool is empty, alloc new */
if (!desc) {
- DEFINE_SPINLOCK(lock);
+ static DEFINE_SPINLOCK(lock);
LIST_HEAD(pool);
if (!add_desc(&pool, &lock, GFP_ATOMIC, 1))
--
2.35.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] dmaengine: pl330: Fix lockdep warning about non-static key
2022-05-20 18:14 [PATCH v1] dmaengine: pl330: Fix lockdep warning about non-static key Dmitry Osipenko
@ 2022-07-06 5:19 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2022-07-06 5:19 UTC (permalink / raw)
To: Dmitry Osipenko; +Cc: dmaengine, linux-kernel
On 20-05-22, 21:14, Dmitry Osipenko wrote:
> The DEFINE_SPINLOCK() macro shouldn't be used for dynamically allocated
> spinlocks. The lockdep warns about this and disables locking validator.
> Fix the warning by making lock static.
>
> INFO: trying to register non-static key.
> The code is fine but needs lockdep annotation, or maybe
> you didn't initialize this object before use?
> turning off the locking correctness validator.
> Hardware name: Radxa ROCK Pi 4C (DT)
> Call trace:
> dump_backtrace.part.0+0xcc/0xe0
> show_stack+0x18/0x6c
> dump_stack_lvl+0x8c/0xb8
> dump_stack+0x18/0x34
> register_lock_class+0x4a8/0x4cc
> __lock_acquire+0x78/0x20cc
> lock_acquire.part.0+0xe0/0x230
> lock_acquire+0x68/0x84
> _raw_spin_lock_irqsave+0x84/0xc4
> add_desc+0x44/0xc0
> pl330_get_desc+0x15c/0x1d0
> pl330_prep_dma_cyclic+0x100/0x270
> snd_dmaengine_pcm_trigger+0xec/0x1c0
> dmaengine_pcm_trigger+0x18/0x24
> ...
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-06 5:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-20 18:14 [PATCH v1] dmaengine: pl330: Fix lockdep warning about non-static key Dmitry Osipenko
2022-07-06 5:19 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox