linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Tim Harvey <tharvey@gateworks.com>
Cc: Frank Li <Frank.li@nxp.com>, Hongxing Zhu <hongxing.zhu@nxp.com>,
	Lucas Stach <l.stach@pengutronix.de>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: legacy PCI device behind a bridge not getting a valid IRQ on imx host controller
Date: Fri, 6 Sep 2024 14:58:11 -0500	[thread overview]
Message-ID: <20240906195811.GA433355@bhelgaas> (raw)
In-Reply-To: <CAJ+vNU1=XqwpzREwo_aNoRwZrMMRpxw_9qvrUW=iU=5u5PjReg@mail.gmail.com>

On Fri, Sep 06, 2024 at 12:37:42PM -0700, Tim Harvey wrote:
> ...

> I have the hardware in hand now as well as the out-of-tree driver
> that's being used. I can say there is nothing wrong here with legacy
> PCI interrupt mapping, if I write a skeleton driver that uses
> pci_resister_driver(struct pci_driver) its probe is called with an
> interrupt and request_irq on that interrupt succeeds just fine.
> 
> The issue here is with the vendor's out-of-tree driver which instead
> is using pci_get_device() to scan the bus which returns a struct
> pci_dev * that doesn't have an irq assigned (like what is described
> in
> https://www.kernel.org/doc/html/v5.5/PCI/pci.html#how-to-find-pci-devices-manually).
> When using pci_get_device() when/how does pci_assign_irq() get
> called to assign the irq to the device?

Hmmm.  pci_get_device() is strongly discouraged because it subverts
the driver model (it skips the usual driver probe/claim model so it
allows multiple drivers to operate the device simultaneously which can
obviously cause conflicts), and it doesn't play well with hotplug
(hotplug events automatically cause driver .probe() methods to be
called, but users of pci_get_device() have to roll their own way of
doing this).

So I'm not aware of a documented/supported way to set up the INTx
interrupts in the pci_get_device() case.  

Bjorn

  reply	other threads:[~2024-09-06 19:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 21:40 legacy PCI device behind a bridge not getting a valid IRQ on imx host controller Tim Harvey
2024-08-29 21:22 ` Bjorn Helgaas
2024-08-29 21:43   ` Frank Li
2024-08-29 22:00     ` Bjorn Helgaas
2024-08-29 22:21       ` Tim Harvey
2024-08-30 15:52         ` Frank Li
2024-08-30 16:11           ` Tim Harvey
2024-08-30 15:49       ` Frank Li
2024-08-30 16:06         ` Manivannan Sadhasivam
2024-08-30 16:15         ` Bjorn Helgaas
2024-08-30  1:50   ` Hongxing Zhu
2024-08-30 16:03     ` Tim Harvey
2024-08-30 16:14       ` Frank Li
2024-09-06 19:37         ` Tim Harvey
2024-09-06 19:58           ` Bjorn Helgaas [this message]
2024-09-10 16:50             ` Tim Harvey
2024-09-10 23:04               ` Bjorn Helgaas
2024-09-12 23:28                 ` Tim Harvey
2024-09-23 17:56                   ` Tim Harvey
2024-09-26 22:30                     ` Bjorn Helgaas

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=20240906195811.GA433355@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=Frank.li@nxp.com \
    --cc=hongxing.zhu@nxp.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-pci@vger.kernel.org \
    --cc=tharvey@gateworks.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).