From: Bjorn Helgaas <helgaas@kernel.org>
To: Sai Krishna Musham <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, michal.simek@amd.com,
bharat.kumar.gogada@amd.com, thippeswamy.havalige@amd.com
Subject: Re: [PATCH RESEND] PCI: amd-mdb: Assert PERST# on shutdown
Date: Wed, 13 May 2026 16:43:31 -0500 [thread overview]
Message-ID: <20260513214331.GA339797@bhelgaas> (raw)
In-Reply-To: <20260427121227.290604-1-sai.krishna.musham@amd.com>
On Mon, Apr 27, 2026 at 05:42:27PM +0530, Sai Krishna Musham wrote:
> Add a shutdown handler for the AMD MDB PCIe host controller that
> asserts the PERST# signal via GPIO before the system powers off or
> reboots. This ensures the connected PCIe endpoint is held in reset
> during shutdown.
I see a few other drivers (dwc/pci-imx6.c, dwc/pcie-fu740.c,
pcie-iproc-platform.c) that do something similar, but it doesn't look
consistent. *Should* this be consistent across all drivers?
> Signed-off-by: Sai Krishna Musham <sai.krishna.musham@amd.com>
> ---
> drivers/pci/controller/dwc/pcie-amd-mdb.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-amd-mdb.c b/drivers/pci/controller/dwc/pcie-amd-mdb.c
> index 7e50e11fbffd..69d21b4727e4 100644
> --- a/drivers/pci/controller/dwc/pcie-amd-mdb.c
> +++ b/drivers/pci/controller/dwc/pcie-amd-mdb.c
> @@ -507,6 +507,14 @@ static int amd_mdb_pcie_probe(struct platform_device *pdev)
> return amd_mdb_add_pcie_port(pcie, pdev);
> }
>
> +static void amd_mdb_pcie_shutdown(struct platform_device *pdev)
> +{
> + struct amd_mdb_pcie *pcie = platform_get_drvdata(pdev);
> +
> + if (pcie->perst_gpio)
> + gpiod_set_value_cansleep(pcie->perst_gpio, 1);
> +}
> +
> static const struct of_device_id amd_mdb_pcie_of_match[] = {
> {
> .compatible = "amd,versal2-mdb-host",
> @@ -521,6 +529,7 @@ static struct platform_driver amd_mdb_pcie_driver = {
> .suppress_bind_attrs = true,
> },
> .probe = amd_mdb_pcie_probe,
> + .shutdown = amd_mdb_pcie_shutdown,
> };
>
> builtin_platform_driver(amd_mdb_pcie_driver);
> --
> 2.43.0
>
prev parent reply other threads:[~2026-05-13 21:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 12:12 [PATCH RESEND] PCI: amd-mdb: Assert PERST# on shutdown Sai Krishna Musham
2026-05-12 13:14 ` Manivannan Sadhasivam
2026-05-13 21:43 ` Bjorn Helgaas [this message]
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=20260513214331.GA339797@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