LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Cc: Marc Zyngier <maz@kernel.org>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: pcie-uniphier: race condition in masking/unmasking interrupts
Date: Wed, 18 Aug 2021 13:38:20 +0200	[thread overview]
Message-ID: <20210818113820.fzjeouy6tohbzuad@pali> (raw)

Hello!

Marc pointed during review of pci-aardvark patches one issue which I see
that is available also in the current pcie-uniphier.c driver.

When masking or unmasking interrupts there is read-modify-write sequence
for PCL_RCV_INTX_MASK_SHIFT register without any locking:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/controller/dwc/pcie-uniphier.c?h=v5.13#n171

So when trying to mask/unmask two interrupts at the same time there is
race condition as updating that PCL_RCV_INTX_MASK_SHIFT register is not
atomic.

Could you look at it?

             reply	other threads:[~2021-08-18 11:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 11:38 Pali Rohár [this message]
2021-08-19 10:01 ` Kunihiko Hayashi

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=20210818113820.fzjeouy6tohbzuad@pali \
    --to=pali@kernel.org \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=maz@kernel.org \
    --subject='Re: pcie-uniphier: race condition in masking/unmasking interrupts' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).