Re: [PATCH v11 5/5] iio: pressure: dps310: assert the lock at runtime too

From: Jonathan Cameron

Date: Sun Oct 11 2026 - 12:33:34 EST


On Sat, 3 Oct 2026 22:30:10 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:

> On Sat, Oct 03, 2026 at 10:09:26PM +0300, Rupesh Majhi wrote:
> > On Fri, Oct 02, 2026 at 10:57:04AM +0300, Andy Shevchenko wrote:
> > > On Fri, Oct 02, 2026 at 10:25:26AM +0300, Rupesh Majhi wrote:
> > > > __must_hold() is clang only and does nothing in GCC builds. Add
> > > > lockdep_assert_held() next to each, so lockdep catches a missing lock
> > > > too.
> > >
> > > Suggested-by?
> >
> > On v10 you said it wasn't really your suggestion, so I dropped it.
> > Happy to add it back if you prefer.
>
> Ah, yeah, I assumed that this will be folded in the original patch that adds
> __must_hold(). In such a case the Suggested-by would be confusing. Since it's
> a separate change (and we have no response from Jonathan on this) the Suggested-by
> is fine. Hope that this clarifies why opposite signals were given. But this is
> not really anyhow critical. Feel free not to add it at all.

Generally I'm in favour of annotations rather than just replying on comments
or similar for when a driver is expected to be holding a lock.
However, here things are simple enough that there were no such comments
- it was just assumed that the lock was going to be held at this 'layer'
and it does end up rather noisy..

So this one, to me, is more doubtful.

Jonathan

>
> > > But we need to hear from Jonathan and others if they like these annotations in
> > > a mere IIO driver.
> >
> > Agreed. It stays the last patch in v12, so it can be dropped on its own.
>
> Yep.
>