From: Thierry Reding <treding@nvidia.com>
To: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Wolfram Sang <wsa@the-dreams.de>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Simon Horman <horms@verge.net.au>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Ley Foon Tan <lftan@altera.com>, Jingoo Han <jg1.han@samsung.com>
Subject: Re: [PATCH] PCI: pcie-rcar: Fix OF node passed to MSI irq domain
Date: Mon, 09 Nov 2015 16:11:16 +0000 [thread overview]
Message-ID: <20151109161115.GA13870@ulmo.nvidia.com> (raw)
In-Reply-To: <PS1PR06MB11804ED428472FC1FD776F6EF5150@PS1PR06MB1180.apcprd06.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 1814 bytes --]
On Mon, Nov 09, 2015 at 03:20:24PM +0000, Phil Edworthy wrote:
> cc'ing others (Tegra, Altera, Designware) who may have the same bug
>
> On 03 November 2015 09:28, Phil Edworthy wrote:
> > The OF node passed to irq_domain_add_linear() should be a
> > pointer to interrupt controller's device tree node, or NULL,
> > but not the PCI controller's node.
> >
> > This fixes an oops in msi_domain_alloc_irqs() when it tries
> > to call msi_check().
> >
> > Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> > ---
> > drivers/pci/host/pcie-rcar.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> > index 2377bf0..c6fa562 100644
> > --- a/drivers/pci/host/pcie-rcar.c
> > +++ b/drivers/pci/host/pcie-rcar.c
> > @@ -709,7 +709,7 @@ static int rcar_pcie_enable_msi(struct rcar_pcie *pcie)
> > msi->chip.setup_irq = rcar_msi_setup_irq;
> > msi->chip.teardown_irq = rcar_msi_teardown_irq;
> >
> > - msi->domain = irq_domain_add_linear(pcie->dev->of_node,
> > INT_PCI_MSI_NR,
> > + msi->domain = irq_domain_add_linear(NULL, INT_PCI_MSI_NR,
> > &msi_domain_ops, &msi->chip);
> > if (!msi->domain) {
> > dev_err(&pdev->dev, "failed to create IRQ domain\n");
On Tegra the PCI controller is in fact the interrupt controller for
MSIs. And looking at the code here it seems like the same would apply to
RCAR.
I'm also slightly confused as to why this would cause ->msi_check() to
fail. The default implementation (msi_domain_ops_check()) doesn't do
anything.
Also, how is passing in NULL instead of a valid struct device_node *
going to prevent an oops? Perhaps this is one of those reference count
imbalance bugs that have recently been showing up?
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <treding@nvidia.com>
To: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Wolfram Sang <wsa@the-dreams.de>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Simon Horman <horms@verge.net.au>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Ley Foon Tan <lftan@altera.com>, Jingoo Han <jg1.han@samsung.com>
Subject: Re: [PATCH] PCI: pcie-rcar: Fix OF node passed to MSI irq domain
Date: Mon, 9 Nov 2015 17:11:16 +0100 [thread overview]
Message-ID: <20151109161115.GA13870@ulmo.nvidia.com> (raw)
In-Reply-To: <PS1PR06MB11804ED428472FC1FD776F6EF5150@PS1PR06MB1180.apcprd06.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 1814 bytes --]
On Mon, Nov 09, 2015 at 03:20:24PM +0000, Phil Edworthy wrote:
> cc'ing others (Tegra, Altera, Designware) who may have the same bug
>
> On 03 November 2015 09:28, Phil Edworthy wrote:
> > The OF node passed to irq_domain_add_linear() should be a
> > pointer to interrupt controller's device tree node, or NULL,
> > but not the PCI controller's node.
> >
> > This fixes an oops in msi_domain_alloc_irqs() when it tries
> > to call msi_check().
> >
> > Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> > ---
> > drivers/pci/host/pcie-rcar.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> > index 2377bf0..c6fa562 100644
> > --- a/drivers/pci/host/pcie-rcar.c
> > +++ b/drivers/pci/host/pcie-rcar.c
> > @@ -709,7 +709,7 @@ static int rcar_pcie_enable_msi(struct rcar_pcie *pcie)
> > msi->chip.setup_irq = rcar_msi_setup_irq;
> > msi->chip.teardown_irq = rcar_msi_teardown_irq;
> >
> > - msi->domain = irq_domain_add_linear(pcie->dev->of_node,
> > INT_PCI_MSI_NR,
> > + msi->domain = irq_domain_add_linear(NULL, INT_PCI_MSI_NR,
> > &msi_domain_ops, &msi->chip);
> > if (!msi->domain) {
> > dev_err(&pdev->dev, "failed to create IRQ domain\n");
On Tegra the PCI controller is in fact the interrupt controller for
MSIs. And looking at the code here it seems like the same would apply to
RCAR.
I'm also slightly confused as to why this would cause ->msi_check() to
fail. The default implementation (msi_domain_ops_check()) doesn't do
anything.
Also, how is passing in NULL instead of a valid struct device_node *
going to prevent an oops? Perhaps this is one of those reference count
imbalance bugs that have recently been showing up?
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-11-09 16:11 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 9:28 [PATCH] PCI: pcie-rcar: Fix OF node passed to MSI irq domain Phil Edworthy
2015-11-03 9:28 ` Phil Edworthy
2015-11-07 13:59 ` Wolfram Sang
2015-11-07 13:59 ` Wolfram Sang
2015-11-09 9:00 ` Phil Edworthy
2015-11-09 9:00 ` Phil Edworthy
2015-11-10 1:21 ` Simon Horman
2015-11-10 1:21 ` Simon Horman
2015-11-09 15:20 ` Phil Edworthy
2015-11-09 15:20 ` Phil Edworthy
2015-11-09 16:11 ` Thierry Reding [this message]
2015-11-09 16:11 ` Thierry Reding
2015-11-09 17:24 ` Phil Edworthy
2015-11-09 17:24 ` Phil Edworthy
2015-11-09 18:01 ` Phil Edworthy
2015-11-09 18:01 ` Phil Edworthy
2015-11-10 15:52 ` Thierry Reding
2015-11-10 15:52 ` Thierry Reding
2015-11-11 16:38 ` Marc Zyngier
2015-11-12 8:57 ` Phil Edworthy
2015-11-12 8:57 ` Phil Edworthy
2015-11-12 20:31 ` Marc Zyngier
2015-11-12 20:31 ` Marc Zyngier
2015-11-13 9:36 ` Phil Edworthy
2015-11-13 9:36 ` Phil Edworthy
2015-11-16 18:31 ` Marc Zyngier
2015-11-16 18:31 ` Marc Zyngier
2015-11-18 18:01 ` Phil Edworthy
2015-11-18 18:01 ` Phil Edworthy
2015-11-20 9:38 ` Marc Zyngier
2015-11-20 9:38 ` Marc Zyngier
2015-11-20 9:49 ` Marc Zyngier
2015-11-20 9:49 ` Marc Zyngier
2015-11-23 9:44 ` Phil Edworthy
2015-11-23 9:44 ` Phil Edworthy
2015-11-23 10:15 ` Marc Zyngier
2015-11-23 10:15 ` Marc Zyngier
2015-11-23 10:29 ` Wolfram Sang
2015-11-23 10:29 ` Wolfram Sang
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=20151109161115.GA13870@ulmo.nvidia.com \
--to=treding@nvidia.com \
--cc=bhelgaas@google.com \
--cc=geert@linux-m68k.org \
--cc=horms@verge.net.au \
--cc=jg1.han@samsung.com \
--cc=lftan@altera.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=phil.edworthy@renesas.com \
--cc=wsa@the-dreams.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.