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


Groups > linux.kernel > #1450532

Re: [PATCH v11 09/10] genirq/msi: map/unmap the MSI doorbells on msi_domain_alloc/free_irqs

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH v11 09/10] genirq/msi: map/unmap the MSI doorbells on msi_domain_alloc/free_irqs
Date 2016-07-26 13:10 +0200
Message-ID <rZ8pk-1d9-13@gated-at.bofh.it> (permalink)
References (1 earlier) <rWCWC-4qE-35@gated-at.bofh.it> <rWVFT-7RJ-15@gated-at.bofh.it> <rYQVs-6No-51@gated-at.bofh.it> <rZ6xb-5m-11@gated-at.bofh.it> <rZ7jA-lC-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 26 Jul 2016, Auger Eric wrote:
> On 26/07/2016 11:00, Thomas Gleixner wrote:
> > In your case you don't want to have a partial allocation, so instead of
> > playing silly games with desc->irq you should add a flag which tells the PCI
> > code that you are not interested in a partial allocation and that it should
> > return an error code instead.
> 

> In that case can we consider we even succeeded in allocating 1 MSI? In case
> the IOMMU mapping fails, the MSI transaction will never reach the target MSI
> frame so it is not usable. So when you mean "partial" I understand we did
> not succeed in allocating maxvec IRQs, correct? Here we succeeded in
> allocating 0 IRQ and still msi_capability_init returns 1.
>
> msi_capability_init doc-comment says "a positive return value indicates the
> number of interrupts which could have been allocated."
> 
> I understand allocation success currently only depends on the fact virq was
> allocated and set to desc->irq. But with that IOMMU stuff doesn't the
> criteria changes?

Right. But then you need to express it differently in a consistent way. Not by
hacking around it by setting desc->irq to 0.

Something like a flag field in msi_desc which denotes various properties would
be a possible solution. MSI_IRQ_ALLOCATED and MSI_IRQ_REMAPPED would be
sufficient for now. And the deallocation/cleanup would rely on those flags
rather than checking desc->irq.

Thanks,

	tglx

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


Thread

Re: [PATCH v11 09/10] genirq/msi: map/unmap the MSI doorbells on  msi_domain_alloc/free_irqs Thomas Gleixner <tglx@linutronix.de> - 2016-07-26 11:10 +0200
  Re: [PATCH v11 09/10] genirq/msi: map/unmap the MSI doorbells on  msi_domain_alloc/free_irqs Auger Eric <eric.auger@redhat.com> - 2016-07-26 12:00 +0200
    Re: [PATCH v11 09/10] genirq/msi: map/unmap the MSI doorbells on  msi_domain_alloc/free_irqs Thomas Gleixner <tglx@linutronix.de> - 2016-07-26 13:10 +0200

csiph-web