From: Keith Busch <keith.busch@intel.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Logan Gunthorpe <logang@deltatee.com>,
Myron Stowe <myron.stowe@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Jonathan Corbet <corbet@lwn.net>,
"David S. Miller" <davem@davemloft.net>,
Andrew Morton <akpm@linux-foundation.org>,
Emil Velikov <emil.l.velikov@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Guenter Roeck <linux@roeck-us.net>,
Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>,
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>,
Stefan Berger <stefanb@linux.vnet.ibm.com>,
Wei Zhang <wzhang@fb.com>,
Kurt Schwemmer <kurt.schwemmer@microsemi.com>,
Stephen Bates <stephen.bates@microsemi.com>,
linux-pci@vger.kernel.org, linux-doc@vger.kernel.org,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver
Date: Wed, 1 Mar 2017 17:26:51 -0500 [thread overview]
Message-ID: <20170301222651.GA14852@localhost.localdomain> (raw)
In-Reply-To: <20170301214120.GA30451@bhelgaas-glaptop.roam.corp.google.com>
On Wed, Mar 01, 2017 at 03:41:20PM -0600, Bjorn Helgaas wrote:
> On Sat, Feb 25, 2017 at 11:53:13PM -0700, Logan Gunthorpe wrote:
> > Changes since v4:
> >
> > * Turns out pushing the pci release code into the device release
> > function didn't work as I would have liked. If you try to unbind the
> > device with an instance open, then you hit a kernel bug at
> > drivers/pci/msi.c:371. (This didn't occur in v3.)
>
> This is in free_msi_irqs():
>
> 368 for_each_pci_msi_entry(entry, dev)
> 369 if (entry->irq)
> 370 for (i = 0; i < entry->nvec_used; i++)
> 371 BUG_ON(irq_has_action(entry->irq + i));
>
> I don't think this is indicating a bug in the PCI core (although I do
> think a BUG_ON() here is an excessive response). I think it's an
> indication that the driver didn't disconnect its ISR. Without more
> details of the failure it's hard to tell if the BUG_ON is a symptom of
> a problem in the driver or what.
>
> An "alive" flag feels racy, and I can't tell if it's really the best
> way to deal with this, or if it's just avoiding the issue. There must
> be other drivers with the same cleanup issue -- do they handle it the
> same way?
I think this is from using the managed device resource API to request the
irq actions. The scope of the resource used to be tied to the pci_dev's
dev, but now it's the new switchec class dev, which has a different
lifetime while open references exist, so it's not releasing the irq's.
One thing about the BUG_ON that is confusing me is how it's getting
to free_msi_irq's BUG in v4 or v5. I don't see any part releasing the
allocated ones. Maybe the devres API is harder to use than having the
driver manage all the resources...
next prev parent reply other threads:[~2017-03-01 22:26 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-26 6:53 [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Logan Gunthorpe
2017-02-26 6:53 ` [PATCH v5 1/4] MicroSemi Switchtec management interface driver Logan Gunthorpe
2017-02-26 6:53 ` [PATCH v5 2/4] switchtec: Add user interface documentation Logan Gunthorpe
2017-02-26 6:53 ` [PATCH v5 3/4] switchtec: Add sysfs attributes to the Switchtec driver Logan Gunthorpe
2017-02-26 6:53 ` [PATCH v5 4/4] switchtec: Add IOCTLs " Logan Gunthorpe
2017-02-28 15:09 ` [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Bjorn Helgaas
2017-02-28 17:11 ` Logan Gunthorpe
2017-02-28 17:20 ` Greg Kroah-Hartman
2017-03-02 0:32 ` Bjorn Helgaas
2017-03-02 0:39 ` Logan Gunthorpe
2017-03-01 21:41 ` Bjorn Helgaas
2017-03-01 22:24 ` Logan Gunthorpe
2017-03-01 22:49 ` Logan Gunthorpe
2017-03-01 23:58 ` Jason Gunthorpe
2017-03-02 0:23 ` Logan Gunthorpe
2017-03-02 0:29 ` Logan Gunthorpe
2017-03-02 0:50 ` Jason Gunthorpe
2017-03-01 22:26 ` Keith Busch [this message]
2017-03-01 22:37 ` Logan Gunthorpe
2017-03-01 22:59 ` Keith Busch
2017-03-01 22:53 ` Logan Gunthorpe
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=20170301222651.GA14852@localhost.localdomain \
--to=keith.busch@intel.com \
--cc=akpm@linux-foundation.org \
--cc=bhelgaas@google.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=emil.l.velikov@gmail.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=helgaas@kernel.org \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=konishi.ryusuke@lab.ntt.co.jp \
--cc=kurt.schwemmer@microsemi.com \
--cc=linus.walleij@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=logang@deltatee.com \
--cc=mchehab@kernel.org \
--cc=myron.stowe@gmail.com \
--cc=stefanb@linux.vnet.ibm.com \
--cc=stephen.bates@microsemi.com \
--cc=wzhang@fb.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).