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


Groups > linux.kernel > #1441317

Re: [PATCH 07/13] pci: Provide sensible irq vector alloc/free routines

From Alexander Gordeev <agordeev@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 07/13] pci: Provide sensible irq vector alloc/free routines
Date 2016-07-12 14:50 +0200
Message-ID <rU5ip-4W1-1@gated-at.bofh.it> (permalink)
References (1 earlier) <rR7JN-3ot-49@gated-at.bofh.it> <rRQ49-6FO-17@gated-at.bofh.it> <rTdUK-3GE-5@gated-at.bofh.it> <rTGN4-5On-33@gated-at.bofh.it> <rU21c-2W2-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jul 12, 2016 at 11:13:00AM +0200, Christoph Hellwig wrote:
> On Mon, Jul 11, 2016 at 12:43:41PM +0200, Alexander Gordeev wrote:
> > > I diagreed - if we deprecated functions the only thing that should
> > > be mentioned is a "don't use these". 
> > 
> > I will try to paraphrase myself. The new API deprecates pci_enable_msi*_range
> > functions, but I am not that sure about others. Certainly, pci_msi*_vec__ount
> > and pci_enable_msi*_exact could have (and AFAIR do have) uses that can not be
> > covered by automatic initialization of pci_alloc_irq_vectors().
> 
> pci_enable_msi*_exact is the equivalent of pci_enable_msi*_range
> with minvecs == maxvecs and treating any return value >= 0 as 0.

Right. And people asked explicitly to introduce these helpers when
range functions were introduced in the first place. Since there is
handful of drivers that do use pci_enable_msi*_exact() I suppose a
need for them persists.

> I've updated the documentation so that the old usage examples are kept
> around, but now use pci_alloc_irq_vectors.  I've also added a more detaild
> blurb on pci_msi*_vec_count - I think there is no need for them, but
> if I'm proven wrong we'll have to add a pci_irq_vector_count that handles
> all interrupt types later.

I guess, it is up to Bjorn. But.

Your proposed pci_nr_irq_vectors() function (a) is not a replacement for
pci_msi*_vec_count() and (b) would be useless if I read its description
properly:

(a) Functions pci_msi*_vec_count() return number of vectors reported by
a PCI device. It is a constant for the device and a driver may make an
assumption based on this number;

(b) A number returned by pci_nr_irq_vectors() is not guaranteed what a
following call to pci_alloc_irq_vectors() can return (since the number
of actually allocated vectors might change between the two calls).
Therefore, a value returned by pci_nr_irq_vectors() can not be used for
anything.

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


Thread

Re: [PATCH 07/13] pci: Provide sensible irq vector alloc/free  routines Christoph Hellwig <hch@lst.de> - 2016-07-10 05:50 +0200
  Re: [PATCH 07/13] pci: Provide sensible irq vector alloc/free  routines Alexander Gordeev <agordeev@redhat.com> - 2016-07-11 12:40 +0200
    Re: [PATCH 07/13] pci: Provide sensible irq vector alloc/free  routines Christoph Hellwig <hch@lst.de> - 2016-07-12 11:20 +0200
      Re: [PATCH 07/13] pci: Provide sensible irq vector alloc/free  routines Alexander Gordeev <agordeev@redhat.com> - 2016-07-12 14:50 +0200

csiph-web