Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1289362
| From | Marc Zyngier <marc.zyngier@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v11] PCI: Xilinx-NWL-PCIe: Added support for Xilinx NWL PCIe Host Controller |
| Date | 2015-12-11 10:40 +0100 |
| Message-ID | <qEslc-2l8-15@gated-at.bofh.it> (permalink) |
| References | <qA8XL-5Zy-3@gated-at.bofh.it> <qDWbE-6rH-25@gated-at.bofh.it> <qEaeC-7jl-35@gated-at.bofh.it> <qEfR0-2uZ-13@gated-at.bofh.it> |
| Organization | ARM Ltd |
On 10/12/15 20:18, Bjorn Helgaas wrote:
> [+cc Marc for irq_dispose_mapping() question]
>>>> + }
>>>> + } while (status);
>>>> +
>>>> + return retval;
>>>>
>>>> + for (i = 0; i < 4; i++) {
>>>> + irq = irq_find_mapping(pcie->legacy_irq_domain, i + 1);
>>>> + if (irq > 0)
>>>> + irq_dispose_mapping(irq);
>>>> + }
>>>> + if (pcie->legacy_irq_domain)
>>>> + irq_domain_remove(pcie->legacy_irq_domain);
>>>
>>> Something seems wrong here. I don't know when irq_dispose_mapping() is
>>> required, but it's not used consistently in drivers/pci, and it should be.
>>> Currently, only pci-tegra.c, pcie-xilinx.c, and this new driver use it. Tegra uses
>>> it only for MSIs, and Xilinx seems to use it for both MSIs and INTx. What's
>>> right?
>> Its not related to MSI or INTx, its related to domain, for freeing irq descriptor associated with irq.
>
> So are you saying that other drivers in drivers/pci/host should be
> using irq_dispose_mapping(), but they aren't?
>
> Marc, can you chime in here?
This indeed looks like be a bug in most drivers. Having a mapping left
when freeing the domain has a couple of side effects:
- We leak virtual interrupt numbers
- If the domain is backed by a radix tree, we leak the tree as well (but
irq_domain_remove will shout if that's the case).
So I think using irq_dispose_mapping is the right thing to do, and that
we should fix the other drivers (and maybe provide a convenient helper
to that effect).
I'll try to come up with something.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
RE: [PATCH v11] PCI: Xilinx-NWL-PCIe: Added support for Xilinx NWL PCIe Host Controller Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com> - 2015-12-10 15:20 +0100
Re: [PATCH v11] PCI: Xilinx-NWL-PCIe: Added support for Xilinx NWL PCIe Host Controller Bjorn Helgaas <helgaas@kernel.org> - 2015-12-10 21:20 +0100
RE: [PATCH v11] PCI: Xilinx-NWL-PCIe: Added support for Xilinx NWL PCIe Host Controller Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com> - 2015-12-11 07:00 +0100
Re: [PATCH v11] PCI: Xilinx-NWL-PCIe: Added support for Xilinx NWL PCIe Host Controller Marc Zyngier <marc.zyngier@arm.com> - 2015-12-11 10:40 +0100
csiph-web