Re: [PATCH v2] dmaengine: plx_dma: Fix potential deadlock on &plxdev->ring_lock

From: Eric Schwarz
Date: Mon Aug 28 2023 - 12:19:18 EST


Hello,

Am 29.07.2023 um 19:59 schrieb Chengfeng Ye:
This flaw was found by an experimental static analysis tool I am developing
for irq-related deadlock.

Just out of curiosity, did/could
- Linux kernel config checks like CONFIG_DEBUG_SPINLOCK option or
- Smatch [1]
find that issue too?

I have also found an article from Dan Carpenter on the net about lock checking capability of Smatch which relates IMHO to what you are doing [2].

The question is, whether the checks/algorithm what you have developed already exists in form of other tools or they might be added to an already existing one, which is already spread across the community and used accordingly.

Many thanks for your reply in advance.

[1] https://github.com/error27/smatch
[2] https://blogs.oracle.com/linux/post/writing-the-ultimate-locking-check

Cheers
Eric