[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z_-Z8kH0oNVRyA-c@smile.fi.intel.com>
Date: Wed, 16 Apr 2025 14:52:18 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/2] genirq/irqdesc: Balance locking to make sparse
happy
On Wed, Apr 16, 2025 at 02:40:34PM +0300, Andy Shevchenko wrote:
> Sparse is not happy right now about conditional locking and
> complains:
>
> irqdesc.c:899:17: warning: context imbalance in '__irq_get_desc_lock' - wrong count at exit
>
> Refactor the code and use __acquire() to make it happy.
> Annotate the function that it acquires the lock in the
> similar way how __irq_put_desc_unlock() is marked.
Oh, scratch this, it basically will diminish the idea for the users.
…
> __irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
> unsigned int check)
> + __acquires(&desc->lock)
This is correct annotation, but it doesn't help alone.
We need __cond_acquires() to be supported by sparse...
...
It can be still fixed by using macros, but this is not probably what we want.
For the reference: d795e38df4b7 ("iio: core: Rework claim and release of direct
mode to work with sparse.")
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists