public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/2] genirq/irqdesc: Balance locking to make sparse happy
Date: Wed, 16 Apr 2025 14:52:18 +0300	[thread overview]
Message-ID: <Z_-Z8kH0oNVRyA-c@smile.fi.intel.com> (raw)
In-Reply-To: <20250416114122.2191820-3-andriy.shevchenko@linux.intel.com>

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



  reply	other threads:[~2025-04-16 11:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16 11:40 [PATCH v1 0/2] genirq/irqdesc: Make sparse happy Andy Shevchenko
2025-04-16 11:40 ` [PATCH v1 1/2] genirq/irqdesc: Decrease indentation level in __irq_get_desc_lock() Andy Shevchenko
2025-05-05 13:36   ` [tip: irq/core] " tip-bot2 for Andy Shevchenko
2025-04-16 11:40 ` [PATCH v1 2/2] genirq/irqdesc: Balance locking to make sparse happy Andy Shevchenko
2025-04-16 11:52   ` Andy Shevchenko [this message]
2025-04-16 11:53     ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z_-Z8kH0oNVRyA-c@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox