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


Groups > linux.kernel > #1590767

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

From Logan Gunthorpe <logang@deltatee.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver
Date 2017-03-02 02:20 +0100
Message-ID <tgng6-2HO-7@gated-at.bofh.it> (permalink)
References <tf0Yi-34n-3@gated-at.bofh.it> <tgkrT-HO-3@gated-at.bofh.it> <tgkUW-1b6-13@gated-at.bofh.it> <tglnY-1pB-19@gated-at.bofh.it> <tgn6p-2E1-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 01/03/17 04:58 PM, Jason Gunthorpe wrote:
> On Wed, Mar 01, 2017 at 03:49:04PM -0700, Logan Gunthorpe wrote:
> 
>> Seems to me like an elegant solution would be to implement a 'cdev_kill'
>> function which could kill all the processes using a cdev. Thus, during
>> an unbind, a driver could call it and be sure that there are no users
>> left and it can safely allow the devres unwind to continue. Then no
>> difficult and racy 'alive' flags would be necessary and it would be much
>> easier on drivers.
> 
> That could help, but this would mean cdev would have to insert a shim
> to grab locks around the various file ops.

Hmm, I was hoping something more along the lines of actually killing the
processes instead of just shimming away fops.

> AFAIK TPM is correct and has been robustly tested now. We have a 'vtpm'
> driver that agressively uses hot-unplug.

Ah, thanks for the explanation of how that works. I didn't notice the
semaphore usage.

Switchtec is a bit more tricky because a) there's no upper level driver
to handle things and b) userspace may be inside a wait_for_completion
(via read or poll) that needs to be completed. If a so called
'cdev_kill' could actually just kill these processes it would be a bit
easier.

Currently, in the Switchtec code, there's a timeout if the interrupt
doesn't fire (which occurs if the pci device has been torn down) and the
code will check an alive bit (under mutex protection) and error out if
it's not alive.

Because of how poll works, I don't see how I can just hold a semaphore
inside every fops call like the tpm code does.

Logan

Back to linux.kernel | Previous | NextPrevious in thread | Next 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