Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1590648

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver

From Bjorn Helgaas <helgaas@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver
Date 2017-03-01 23:00 +0100
Message-ID <tgkrT-HO-3@gated-at.bofh.it> (permalink)
References <tf0Yi-34n-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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).

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Bjorn Helgaas <helgaas@kernel.org> - 2017-03-01 23:00 +0100
  Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Logan Gunthorpe <logang@deltatee.com> - 2017-03-01 23:30 +0100
    Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Logan Gunthorpe <logang@deltatee.com> - 2017-03-02 00:00 +0100
      Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2017-03-02 01:50 +0100
        Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2017-03-02 02:00 +0100
        Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Logan Gunthorpe <logang@deltatee.com> - 2017-03-02 02:20 +0100
          Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Logan Gunthorpe <logang@deltatee.com> - 2017-03-02 02:20 +0100
  Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Keith Busch <keith.busch@intel.com> - 2017-03-01 23:40 +0100
    Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Keith Busch <keith.busch@intel.com> - 2017-03-02 00:00 +0100
      Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Logan Gunthorpe <logang@deltatee.com> - 2017-03-02 00:20 +0100
    Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver Logan Gunthorpe <logang@deltatee.com> - 2017-03-02 00:20 +0100

csiph-web