linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: Keith Busch <keith.busch@intel.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 15:41:20 -0600	[thread overview]
Message-ID: <20170301214120.GA30451@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <1488091997-12843-1-git-send-email-logang@deltatee.com>

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?

>   To solve this, we've moved the pci release code back into the
>   unregister function and reintroduced an alive flag. This time,
>   however, the alive flag is protected by mrpc_mutex and we're very
>   careful about what happens to devices still in use (they should
>   all be released through the timeout path and an ENODEV error
>   returned to userspace; while new commands are blocked with the
>   same error).

  parent reply	other threads:[~2017-03-01 21:52 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 [this message]
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
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=20170301214120.GA30451@bhelgaas-glaptop.roam.corp.google.com \
    --to=helgaas@kernel.org \
    --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=jarkko.sakkinen@linux.intel.com \
    --cc=keith.busch@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).