linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Ramon Fried <rfried.dev@gmail.com>
Cc: hkallweit1@gmail.com, Bjorn Helgaas <bhelgaas@google.com>,
	maz@kernel.org, lorenzo.pieralisi@arm.com,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: MSI irqchip configured as IRQCHIP_ONESHOT_SAFE causes spurious IRQs
Date: Tue, 14 Jan 2020 23:54:28 +0100	[thread overview]
Message-ID: <87imldbqe3.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <CAGi-RUJG=SB7az5FFVTzzgefn_VXUbyQX1dtBN+9gkR7MgyC6g@mail.gmail.com>

Ramon Fried <rfried.dev@gmail.com> writes:
> On Tue, Jan 14, 2020 at 11:38 PM Ramon Fried <rfried.dev@gmail.com> wrote:
>> On Tue, Jan 14, 2020 at 2:15 PM Thomas Gleixner <tglx@linutronix.de> wrote:
>> > Ramon Fried <rfried.dev@gmail.com> writes:
>> > > Besides the side effect of that, I don't really understand the logic
>> > > of not masking the MSI until the threaded handler is complete,
>> > > especially when there's no HW handler and only threaded handler.
>> >
>> > What's wrong with having another interrupt firing while the threaded
>> > handler is running? Nothing, really. It actually can be desired because
>> > the threaded handler is allowed to sleep.
>> >
>> What do you mean, isn't it the purpose IRQ masking ?  Interrupt
>> coalescing is done to mitigate these IRQ's, these HW interrupts just
>> consume CPU cycles and don't do anything useful (scheduling an
>> already scheduled thread).

Again, that depends on your POV. It's a perfectly valid scenario to have
another HW irq coming in preventing the thread to go to sleep and just
run for another cycle. So no, masking is not necessarily required and
the semantics of MSI is edge type, so the hardware should not fire
another interrupt _before_ the threaded handler actually took care of
the initial one.

> Additionally, in this case there isn't even an HW IRQ handler, it's
> passed as NULL in the request IRQ function in this scenario.

This is completely irrelevant. The primary hardware IRQ handler is
provided by the core code in this case.

Due to the semantics of MSI this is perfectly fine and aside of your
problem this has worked perfectly fine so far and it's an actual
performance win because it avoid fiddling with the MSI mask which is
slow.

You still have not told which driver/hardware is affected by this. Can
you please provide that information so we can finally look at the actual
hardware/driver combo?

Either the driver is broken or the hardware does not comply with the MSI
spec.

Thanks,

        tglx

  reply	other threads:[~2020-01-14 22:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09 10:27 MSI irqchip configured as IRQCHIP_ONESHOT_SAFE causes spurious IRQs Ramon Fried
2020-01-02  8:19 ` Ramon Fried
2020-01-13 14:59 ` Ramon Fried
2020-01-14 12:15 ` Thomas Gleixner
2020-01-14 21:38   ` Ramon Fried
2020-01-14 21:40     ` Ramon Fried
2020-01-14 22:54       ` Thomas Gleixner [this message]
2020-01-16  0:19         ` Ramon Fried
2020-01-16  1:39           ` Thomas Gleixner
2020-01-16  7:58             ` Ramon Fried
2020-01-16  9:32               ` Thomas Gleixner
2020-01-17 13:32                 ` Ramon Fried
2020-01-17 14:38                   ` Thomas Gleixner
2020-01-17 15:43                     ` Ramon Fried
2020-01-17 17:11                       ` Thomas Gleixner
2020-01-17 20:01                         ` Ramon Fried
2020-01-17 22:47                           ` Thomas Gleixner
2020-01-20  8:02                             ` Ramon Fried

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=87imldbqe3.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=bhelgaas@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=maz@kernel.org \
    --cc=rfried.dev@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).