From: Bjorn Helgaas <helgaas@kernel.org>
To: "Musham, Sai Krishna" <sai.krishna.musham@amd.com>
Cc: "bhelgaas@google.com" <bhelgaas@google.com>,
"lpieralisi@kernel.org" <lpieralisi@kernel.org>,
"kw@linux.com" <kw@linux.com>,
"mani@kernel.org" <mani@kernel.org>,
"robh@kernel.org" <robh@kernel.org>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"cassel@kernel.org" <cassel@kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Simek, Michal" <michal.simek@amd.com>,
"Gogada, Bharat Kumar" <bharat.kumar.gogada@amd.com>,
"Havalige, Thippeswamy" <thippeswamy.havalige@amd.com>
Subject: Re: [PATCH v5 2/2] PCI: amd-mdb: Add support for PCIe RP PERST# signal handling
Date: Fri, 18 Jul 2025 11:31:50 -0500 [thread overview]
Message-ID: <20250718163150.GA2700763@bhelgaas> (raw)
In-Reply-To: <DM4PR12MB6158DFAD4351A17E3523CA58CD50A@DM4PR12MB6158.namprd12.prod.outlook.com>
On Fri, Jul 18, 2025 at 04:30:32AM +0000, Musham, Sai Krishna wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> Hi Bjorn,
>
> > -----Original Message-----
> > From: Bjorn Helgaas <helgaas@kernel.org>
> > Sent: Saturday, July 12, 2025 4:49 AM
> > To: Musham, Sai Krishna <sai.krishna.musham@amd.com>
> > Cc: bhelgaas@google.com; lpieralisi@kernel.org; kw@linux.com; mani@kernel.org;
> > robh@kernel.org; krzk+dt@kernel.org; conor+dt@kernel.org; cassel@kernel.org;
> > linux-pci@vger.kernel.org; devicetree@vger.kernel.org; linux-
> > kernel@vger.kernel.org; Simek, Michal <michal.simek@amd.com>; Gogada, Bharat
> > Kumar <bharat.kumar.gogada@amd.com>; Havalige, Thippeswamy
> > <thippeswamy.havalige@amd.com>
> > Subject: Re: [PATCH v5 2/2] PCI: amd-mdb: Add support for PCIe RP PERST#
> > signal handling
> >
> > Caution: This message originated from an External Source. Use proper caution
> > when opening attachments, clicking links, or responding.
> >
> >
> > On Fri, Jul 11, 2025 at 10:53:57AM +0530, Sai Krishna Musham wrote:
> > > Add support for handling the AMD Versal Gen 2 MDB PCIe Root Port PERST#
> > > signal via a GPIO by parsing the new PCIe bridge node to acquire the
> > > reset GPIO. If the bridge node is not found, fall back to acquiring it
> > > from the PCIe node.
> > >
> > > As part of this, update the interrupt controller node parsing to use
> > > of_get_child_by_name() instead of of_get_next_child(), since the PCIe
> > > node now has multiple children. This ensures the correct node is
> > > selected during initialization.
> > > + * If amd_mdb_parse_pcie_port returns -ENODEV, it indicates that the
> > > + * PCIe Bridge node was not found in the device tree. This is not
> > > + * considered a fatal error and will trigger a fallback where the
> > > + * reset GPIO is acquired directly from the PCIe node.
> > > + */
> > > + if (ret && ret != -ENODEV) {
> > > + return ret;
> > > + } else if (ret == -ENODEV) {
> >
> > The "ret" checking seems unnecessarily complicated.
> >
> > > + dev_info(dev, "Falling back to acquire reset GPIO from PCIe node\n");
> >
> > I don't think this is worthy of a message. If there are DTs in the
> > field that were valid once, they continue to be valid forever, and
> > there's no point in complaining about them.
> >
> > https://lore.kernel.org/all/20250702-perst-v5-2-920b3d1f6ee1@qti.qualcomm.com/
> > has a good example of how to this fallback nicely.
> >
> > Otherwise looks good to me.
>
> Thanks for the feedback. I've removed the fallback message and simplified the "ret"
> checking. Could you please confirm if this looks good for v6?
>
> if (ret == -ENODEV) {
>
> /* Request the GPIO for PCIe reset signal and assert */
> pcie->perst_gpio = devm_gpiod_get_optional(dev, "reset",
> GPIOD_OUT_HIGH);
> if (IS_ERR(pcie->perst_gpio))
> return dev_err_probe(dev, PTR_ERR(pcie->perst_gpio),
> "Failed to request reset GPIO\n");
> } else if (ret) {
> return ret;
> }
Looks good to me. It's important to note that this -ENODEV fallback
uses the PERST# GPIO described in the host bridge, not in a Root Port,
but I think your comment above includes this.
Bjorn
next prev parent reply other threads:[~2025-07-18 16:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 5:23 [PATCH v5 0/2] Add support for AMD Versal Gen 2 MDB PCIe RP PERST# Sai Krishna Musham
2025-07-11 5:23 ` [PATCH v5 1/2] dt-bindings: PCI: amd-mdb: Add example usage of reset-gpios for " Sai Krishna Musham
2025-07-11 5:23 ` [PATCH v5 2/2] PCI: amd-mdb: Add support for PCIe RP PERST# signal handling Sai Krishna Musham
2025-07-11 23:18 ` Bjorn Helgaas
2025-07-18 4:30 ` Musham, Sai Krishna
2025-07-18 16:31 ` Bjorn Helgaas [this message]
2025-07-19 2:59 ` Musham, Sai Krishna
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=20250718163150.GA2700763@bhelgaas \
--to=helgaas@kernel.org \
--cc=bharat.kumar.gogada@amd.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=michal.simek@amd.com \
--cc=robh@kernel.org \
--cc=sai.krishna.musham@amd.com \
--cc=thippeswamy.havalige@amd.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