All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: PCI <linux-pci@vger.kernel.org>, Marc Zyngier <maz@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Subject: Re: [PATCH] PCI: of: Fix MSI domain lookup with child bus nodes
Date: Sat, 14 Aug 2021 12:32:56 -0500	[thread overview]
Message-ID: <CAL_JsqL+aPRh9CJ0iKbzGCyE3wDR6QMEKAEC8p=1ZVRDSb6JDA@mail.gmail.com> (raw)
In-Reply-To: <20210813191938.6a8a4ee4@coco.lan>

On Fri, Aug 13, 2021 at 12:19 PM Mauro Carvalho Chehab
<mchehab+huawei@kernel.org> wrote:
>
> Em Fri, 13 Aug 2021 11:02:57 -0500
> Rob Herring <robh@kernel.org> escreveu:
>
> > When a DT contains PCI child bus nodes, lookup of the MSI domain on PCI
> > buses fails resulting in the following warnings:
> >
> > WARNING: CPU: 4 PID: 7 at include/linux/msi.h:256 __pci_enable_msi_range+0x398/0x59c
> >
> > The issue is that pci_host_bridge_of_msi_domain() will check the DT node of
> > the passed in bus even if it's not the host bridge's bus. Based on the
> > name of the function, that's clearly not what we want. Fix this by
> > walking the bus parents to the root bus.
> >
> > Reported-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> > Cc: Marc Zyngier <maz@kernel.org>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> > Compile tested only. Mauro, Can you see if this fixes your issue.
> >
> >  drivers/pci/of.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/pci/of.c b/drivers/pci/of.c
> > index a143b02b2dcd..ea70aede054c 100644
> > --- a/drivers/pci/of.c
> > +++ b/drivers/pci/of.c
> > @@ -84,6 +84,10 @@ struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus)
> >       if (!bus->dev.of_node)
> >               return NULL;
> >
> > +     /* Find the host bridge bus */
> > +     while (!pci_is_root_bus(bus))
> > +             bus = bus->parent;
> > +
> >       /* Start looking for a phandle to an MSI controller. */
> >       d = of_msi_get_domain(&bus->dev, bus->dev.of_node, DOMAIN_BUS_PCI_MSI);
> >       if (d)
>
> Nope, it didn't solve the issue.

Can you try adding some prints of the domain, pci dev, and DT node to
pci_set_bus_msi_domain(). Comparing those when having child nodes or
not would be helpful.

Rob

  reply	other threads:[~2021-08-14 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13 16:02 [PATCH] PCI: of: Fix MSI domain lookup with child bus nodes Rob Herring
2021-08-13 17:19 ` Mauro Carvalho Chehab
2021-08-14 17:32   ` Rob Herring [this message]
2021-08-16  8:42     ` Mauro Carvalho Chehab
2021-08-16 13:36       ` Mauro Carvalho Chehab
2021-08-16 19:01         ` Rob Herring
2021-08-16 19:47           ` Mauro Carvalho Chehab

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='CAL_JsqL+aPRh9CJ0iKbzGCyE3wDR6QMEKAEC8p=1ZVRDSb6JDA@mail.gmail.com' \
    --to=robh@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=maz@kernel.org \
    --cc=mchehab+huawei@kernel.org \
    /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.