Re: [PATCH 2/5] driver core: separate function to shutdown one device

From: Bart Van Assche

Date: Wed Mar 11 2026 - 17:42:34 EST


On 3/11/26 2:37 PM, Bjorn Helgaas wrote:
Maybe it's just the lock anti-pattern below?

Yes, that's my only concern.

I guess avoiding the "conditional acquisition and later conditional
release" pattern mentioned at [1] is what makes this compatible with
lock context analysis?

Correct.

I guess this is another way of expressing the "no conditionally held
locks" rule [2], which is more concise and fits better in my pea
brain.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/dev-tools/context-analysis.rst?id=v7.0-rc1#n42
[2] https://clang.llvm.org/docs/ThreadSafetyAnalysis.html#no-conditionally-held-locks

Is this perhaps intended as a suggestion for simplifying the language in
Documentation/dev-tools/context-analysis.rst?

s/such as conditional acquisition and later conditional release in the same function/no conditionally held locks/

Thanks,

Bart.