All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Alex G <mr.nuke.me@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Bjorn Helgaas <helgaas@kernel.org>,
	linux-pci@vger.kernel.org,
	Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Subject: Re: [GIT PULL] PCI changes for v5.1
Date: Mon, 18 Mar 2019 05:33:14 +0100	[thread overview]
Message-ID: <20190318043314.noyj6t4sh26spuzt@wunner.de> (raw)
In-Reply-To: <b723cbf8-be2a-bbdb-8ad5-eac8eddf2bb3@gmail.com>

On Sun, Mar 17, 2019 at 07:22:17PM -0500, Alex G wrote:
> On 3/17/19 4:18 PM, Linus Torvalds wrote:
> > On Fri, Mar 8, 2019 at 9:31 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
> > > 
> > >    - Report PCIe links that become degraded at run-time (Alexandru Gagniuc)
> > 
> > Gaah. Only now as I'm about to do the rc1 release am I looking at new
> > runtime warnings, and noticing that this causes
> > 
> >    genirq: Threaded irq requested with handler=NULL and !ONESHOT for irq 16
> >    pcie_bw_notification: probe of 0000:00:1b.0:pcie010 failed with error -22
> > 
> > because you can't have a NULL handler for a level-triggered interrupt
> > (you need something to shut the interrupt off so that it doesn't keep
> > screaming!).
> 
> Thanks for the catch. I did not see the error on my test machines. I'll take
> a look tomorrow, and update through Bjorn. Seems like an easy fix.

My apologies for not spotting this during review.

This can't be fixed by setting the IRQF_ONESHOT flag because the IRQ is
always shared with pciehp, dpc and other port services, which do not set
the flag, so you'd get a flags mismatch error in __setup_irq().

The solution is thus to acknowledge the interrupt in
pcie_bw_notification_handler() and move the portion which may sleep
to a separate function which is used as IRQ thread.  In other words,
move the down_read() / up_read() portion to a separate function and
return IRQ_WAKE_THREAD instead of IRQ_HANDLED.

The reason why it didn't show up on your test machines is likely that
they're using MSI on all PCIe ports, whereas Linus' machines appear
to possess at least one PCIe port which uses legacy INTx interrupts.
(MSI sets IRQCHIP_ONESHOT_SAFE for the irq_chip.)

Thanks,

Lukas

  reply	other threads:[~2019-03-18  4:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 17:31 [GIT PULL] PCI changes for v5.1 Bjorn Helgaas
2019-03-09 23:15 ` pr-tracker-bot
2019-03-17 21:18 ` Linus Torvalds
2019-03-18  0:22   ` Alex G
2019-03-18  4:33     ` Lukas Wunner [this message]
2019-03-19  1:12   ` [PATCH] PCI/LINK: bw_notification: Do not leave interrupt handler NULL Alexandru Gagniuc
2019-03-19 19:25     ` Lukas Wunner
2019-03-19 20:00     ` Keith Busch
2019-03-20 13:46     ` Bjorn Helgaas
2019-03-20 13:48       ` Alex G.
2019-03-20 19:35         ` Bjorn Helgaas
2019-03-23  0:36           ` [PATCH v2] " Alexandru Gagniuc
2019-03-25 22:25             ` Bjorn Helgaas
2019-03-25 22:26               ` Alex G.
2019-03-25 22:59               ` Bjorn Helgaas
2019-04-19 21:08               ` Alex Williamson
2019-04-19 21:25                 ` Bjorn Helgaas
2019-04-22 21:11                 ` Alex Williamson

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=20190318043314.noyj6t4sh26spuzt@wunner.de \
    --to=lukas@wunner.de \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mr.nuke.me@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.