public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan+linaro@kernel.org>
To: Marc Zyngier <maz@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh@kernel.org>,
	linux-kernel@vger.kernel.org,
	Johan Hovold <johan+linaro@kernel.org>
Subject: [PATCH v2 0/4] irqdomain: Fix mapping-creation race
Date: Thu,  1 Sep 2022 16:28:12 +0200	[thread overview]
Message-ID: <20220901142816.13731-1-johan+linaro@kernel.org> (raw)

Parallel probing (e.g. due to asynchronous probing) of devices that
share interrupts can currently result in two mappings for the same
hardware interrupt to be created.
    
This series adds a serialising mapping mutex so that looking for an
existing mapping before creating a new one is done atomically.

Included are also some related clean ups that remove a redundant lookup
for existing mappings and make the domain-association locking more fine
grained.

Johan


Changes in v2
 - split out redundant lookup cleanup (1/4)
 - use a per-domain mutex to address mapping race (2/4)
 - move kernel-doc to exported function (2/4)
 - fix association race (3/4, new)
 - use per-domain mutex for associations (4/4, new)


Johan Hovold (4):
  irqdomain: Look for existing mapping only once
  irqdomain: Fix mapping-creation race
  irqdomain: Fix domain-association race
  irqdomain: use per-domain mutex for associations

 include/linux/irqdomain.h |   2 +
 kernel/irq/irqdomain.c    | 104 ++++++++++++++++++++++++--------------
 2 files changed, 69 insertions(+), 37 deletions(-)

-- 
2.35.1


             reply	other threads:[~2022-09-01 14:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01 14:28 Johan Hovold [this message]
2022-09-01 14:28 ` [PATCH v2 1/4] irqdomain: Look for existing mapping only once Johan Hovold
2022-09-01 14:28 ` [PATCH v2 2/4] irqdomain: Fix mapping-creation race Johan Hovold
2022-09-15  8:54   ` Marc Zyngier
2022-12-09 14:18     ` Johan Hovold
2022-09-01 14:28 ` [PATCH v2 3/4] irqdomain: Fix domain-association race Johan Hovold
2022-09-01 14:28 ` [PATCH v2 4/4] irqdomain: use per-domain mutex for associations Johan Hovold

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=20220901142816.13731-1-johan+linaro@kernel.org \
    --to=johan+linaro@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=robh@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