From: Marc Zyngier <marc.zyngier@arm.com>
To: Bjorn Helgaas <helgaas@kernel.org>,
Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
Cc: "robh+dt@kernel.org" <robh+dt@kernel.org>,
"pawel.moll@arm.com" <pawel.moll@arm.com>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
"galak@codeaurora.org" <galak@codeaurora.org>,
Michal Simek <michals@xilinx.com>,
Soren Brinkmann <sorenb@xilinx.com>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"arnd@arndb.de" <arnd@arndb.de>,
"tinamdar@apm.com" <tinamdar@apm.com>,
"treding@nvidia.com" <treding@nvidia.com>,
"rjui@broadcom.com" <rjui@broadcom.com>,
"Minghuan.Lian@freescale.com" <Minghuan.Lian@freescale.com>,
"m-karicheri2@ti.com" <m-karicheri2@ti.com>,
"hauke@hauke-m.de" <hauke@hauke-m.de>,
"dhdang@apm.com" <dhdang@apm.com>,
"sbranden@broadcom.com" <sbranden@broadcom.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infrade>
Subject: Re: [PATCH v11] PCI: Xilinx-NWL-PCIe: Added support for Xilinx NWL PCIe Host Controller
Date: Fri, 11 Dec 2015 09:33:06 +0000 [thread overview]
Message-ID: <566A9852.7060109@arm.com> (raw)
In-Reply-To: <20151210201817.GB367@localhost>
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...
prev parent reply other threads:[~2015-12-11 9:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-29 12:03 [PATCH v11] PCI: Xilinx-NWL-PCIe: Added support for Xilinx NWL PCIe Host Controller Bharat Kumar Gogada
2015-12-07 17:11 ` Marc Zyngier
2015-12-09 23:19 ` Bjorn Helgaas
2015-12-10 7:02 ` Michal Simek
2015-12-10 17:25 ` Bjorn Helgaas
2015-12-11 7:34 ` Michal Simek
2015-12-10 14:10 ` Bharat Kumar Gogada
2015-12-10 20:18 ` Bjorn Helgaas
2015-12-11 5:58 ` Bharat Kumar Gogada
2015-12-21 5:23 ` Bharat Kumar Gogada
2016-01-10 22:08 ` Bjorn Helgaas
2016-01-12 14:02 ` Bharat Kumar Gogada
2016-01-28 15:47 ` Bharat Kumar Gogada
2016-02-12 14:45 ` Bharat Kumar Gogada
2016-01-04 12:42 ` Bharat Kumar Gogada
2015-12-11 9:33 ` Marc Zyngier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=566A9852.7060109@arm.com \
--to=marc.zyngier@arm.com \
--cc=Minghuan.Lian@freescale.com \
--cc=arnd@arndb.de \
--cc=bharat.kumar.gogada@xilinx.com \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=dhdang@apm.com \
--cc=galak@codeaurora.org \
--cc=hauke@hauke-m.de \
--cc=helgaas@kernel.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-kernel@lists.infrade \
--cc=m-karicheri2@ti.com \
--cc=mark.rutland@arm.com \
--cc=michals@xilinx.com \
--cc=pawel.moll@arm.com \
--cc=rjui@broadcom.com \
--cc=robh+dt@kernel.org \
--cc=sbranden@broadcom.com \
--cc=sorenb@xilinx.com \
--cc=tinamdar@apm.com \
--cc=treding@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).