From: Siddharth Vadapalli <s-vadapalli@ti.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Siddharth Vadapalli <s-vadapalli@ti.com>, <bhelgaas@google.com>,
<lpieralisi@kernel.org>, <kw@linux.com>, <robh@kernel.org>,
<vigneshr@ti.com>, <kishon@kernel.org>,
<linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <stable@vger.kernel.org>,
<ahalaney@redhat.com>, <srk@ti.com>
Subject: Re: [PATCH] PCI: j721e: Set .map_irq and .swizzle_irq to NULL
Date: Thu, 25 Jul 2024 11:23:43 +0530 [thread overview]
Message-ID: <be3e3c5f-0d48-41b0-87f4-2210f13b9460@ti.com> (raw)
In-Reply-To: <20240724162304.GA802428@bhelgaas>
On Wed, Jul 24, 2024 at 11:23:04AM -0500, Bjorn Helgaas wrote:
> Subject should say something about why this change is needed, not just
> translate the C code to English.
My intent was to summarize the change to make it easy for anyone to find
out what's being done. The commit message below explains in detail as to
why they are set to NULL. As an alternative, I could change the $subject
to:
PCI: j721e: Disable INTx mapping and swizzling
where the "Disable" is equivalent to NULL. Kindly let me know if this is
acceptable or needs to be improved further.
>
> On Wed, Jul 24, 2024 at 12:20:48PM +0530, Siddharth Vadapalli wrote:
> > Since the configuration of Legacy Interrupts (INTx) is not supported, set
>
> I assume you mean J721E doesn't support INTx?
Yes, the driver support doesn't exist and the device-tree also doesn't
have the required nodes. Kishon had posted a series to enable it for
J721E, J7200 and AM64 on the 4th of August 2021:
https://lore.kernel.org/r/20210804132912.30685-1-kishon@ti.com/
and based on the discussion on the series, an Errata was discovered for
J721E:
https://www.ti.com/lit/er/sprz455d/sprz455d.pdf
i2094: PCIe: End of Interrupt (EOI) Not Enabled for PCIe Legacy Interrupts
Thus, there is no support for Legacy Interrupts (INTx) in the pci-j721e.c
driver and as a consequence, no device-tree nodes either.
>
> > the .map_irq and .swizzle_irq callbacks to NULL. This fixes the error:
> > of_irq_parse_pci: failed with rc=-22
>
> I guess this happens because devm_of_pci_bridge_init() initializes
> .map_irq and .swizzle_irq unconditionally?
Yes. The PCIe Controller on J721E and other SoCs is the Cadence PCIe
Controller. In the commit which added driver support for the Cadence
PCIe Controller's Host functionality:
https://github.com/torvalds/linux/commit/1b79c5284439
'map_irq' and 'swizzle_irq' were set to the same functions:
'of_irq_parse_and_map_pci()' and 'pci_common_swizzle()'
respectively. Commit:
https://github.com/torvalds/linux/commit/b64aa11eb2dd
extracted out the shared defaults from multiple Host Controller drivers
and moved them into the common 'devm_of_pci_bridge_init()' function.
While 'map_irq' and 'swizzle_irq' are unconditionally set to the
defaults in 'devm_of_pci_bridge_init()', those Host Controller driver
which haven't been using the shared defaults do have the choice of
overriding them in the driver (which is already being done).
Similarly, for pci-j721e.c, since the shared defaults inherited from the
Cadence PCIe Controller are not applicable (due to the Errata), the
pci-j721e.c driver should override them to NULL as done in this patch.
>
> I'm not sure the default assumption should be that a host bridge
> supports INTx.
>
> Maybe .map_irq and .swizzle_irq should only be set when we discover
> some information about INTx routing, e.g., an ACPI _PRT or the
> corresponding DT properties.
I believe that the defaults were set since most of the Host drivers were
using them in their respective drivers as indicated in the commit:
https://github.com/torvalds/linux/commit/b64aa11eb2dd
[...]
> >
> > drivers/pci/controller/cadence/pci-j721e.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c
> > index 85718246016b..5372218849a8 100644
> > --- a/drivers/pci/controller/cadence/pci-j721e.c
> > +++ b/drivers/pci/controller/cadence/pci-j721e.c
> > @@ -417,6 +417,10 @@ static int j721e_pcie_probe(struct platform_device *pdev)
> > if (!bridge)
> > return -ENOMEM;
> >
> > + /* Legacy interrupts are not supported */
>
> Say "INTx" explicitly here instead of assuming "legacy" == "INTx".
Sure. I will update it in the v2 patch.
Thank you for reviewing this patch and sharing your feedback.
Regards,
Siddharth.
next prev parent reply other threads:[~2024-07-25 5:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 6:50 [PATCH] PCI: j721e: Set .map_irq and .swizzle_irq to NULL Siddharth Vadapalli
2024-07-24 16:19 ` Manivannan Sadhasivam
2024-07-25 4:20 ` Manivannan Sadhasivam
2024-07-25 8:20 ` Siddharth Vadapalli
2024-07-26 11:56 ` Manivannan Sadhasivam
2024-08-05 16:01 ` Rob Herring
2024-08-05 16:45 ` Manivannan Sadhasivam
2024-08-05 19:05 ` Rob Herring
2024-08-05 20:40 ` Rob Herring
2024-08-08 20:56 ` Andrew Halaney
2024-08-09 5:33 ` Manivannan Sadhasivam
2024-07-25 5:20 ` Siddharth Vadapalli
2024-07-25 7:47 ` Manivannan Sadhasivam
2024-07-25 8:31 ` Siddharth Vadapalli
2024-07-26 10:24 ` Siddharth Vadapalli
2024-07-26 11:30 ` Manivannan Sadhasivam
2024-07-26 12:06 ` Siddharth Vadapalli
2024-07-24 16:23 ` Bjorn Helgaas
2024-07-25 5:53 ` Siddharth Vadapalli [this message]
2024-07-25 21:19 ` Bjorn Helgaas
2024-07-25 22:21 ` Andrew Halaney
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=be3e3c5f-0d48-41b0-87f4-2210f13b9460@ti.com \
--to=s-vadapalli@ti.com \
--cc=ahalaney@redhat.com \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=robh@kernel.org \
--cc=srk@ti.com \
--cc=stable@vger.kernel.org \
--cc=vigneshr@ti.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