All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Manikanta Maddireddy" <mmaddireddy@nvidia.com>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH v2 3/3] PCI: tegra194: Notify Endpoint functions on PERST# assert
Date: Wed, 21 Oct 2026 07:00:21 +0000	[thread overview]
Message-ID: <sashiko-outbox-179851@kernel.org> (raw)
In-Reply-To: <20261021061903.1269605-4-mmaddireddy@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] PCI: tegra194: missing stub for pci_epc_linkdown() when !CONFIG_PCI_ENDPOINT
--

commit 670ef998037ee122764995c2ef40bfe453687d53
Author: Manikanta Maddireddy <mmaddireddy@nvidia.com>

PCI: tegra194: Notify Endpoint functions on PERST# assert

This commit notifies endpoint function drivers of link down when the host
asserts reset in pex_ep_event_pex_rst_assert() before disabling the
controller. It calls pci_epc_linkdown() directly instead of
dw_pcie_ep_linkdown() to avoid reinitializing registers when the reference
clock may be unavailable.

> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> index 8cb907dbf6356..8dede9531956d 100644
> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
> @@ -1704,6 +1704,9 @@ static void pex_ep_event_pex_rst_assert(struct tegra_pcie_dw *pcie)
>  	if (ret)
>  		dev_info(pcie->dev, "LTSSM state: 0x%x detect timeout: %d\n", val, ret);
>  
> +	/* Avoid the DBI register reinitialization in dw_pcie_ep_linkdown(). */
> +	pci_epc_linkdown(pcie->pci.ep.epc);

[Severity: Low]
Does calling pci_epc_linkdown() in pex_ep_event_pex_rst_assert() break the
build of drivers/pci/controller/dwc/pcie-tegra194.c when host mode is
enabled without endpoint support?

In drivers/pci/controller/dwc/Kconfig, host mode selects the common driver
without requiring endpoint support:

    config PCIE_TEGRA194_HOST
    	tristate "NVIDIA Tegra194 (and later) PCIe controller (host mode)"
    	depends on (ARCH_TEGRA && ARM64) || COMPILE_TEST
    	depends on PCI_MSI
    	select PCIE_DW_HOST
    	select PHY_TEGRA194_P2U
    	select PCIE_TEGRA194

In drivers/pci/controller/dwc/pcie-tegra194.c,
pex_ep_event_pex_rst_assert() is compiled unconditionally. However, in
include/linux/pci-epc.h, pci_epc_linkdown() is only declared inside the
endpoint guard and has no stub in the fallback block:

    #ifdef CONFIG_PCI_ENDPOINT
    ...
    void pci_epc_linkup(struct pci_epc *epc);
    void pci_epc_linkdown(struct pci_epc *epc);
    void pci_epc_init_notify(struct pci_epc *epc);
    void pci_epc_notify_pending_init(struct pci_epc *epc, struct pci_epf *epf);
    void pci_epc_deinit_notify(struct pci_epc *epc);
    ...
    #else
    static inline void pci_epc_init_notify(struct pci_epc *epc)
    {
    }

    static inline void pci_epc_deinit_notify(struct pci_epc *epc)
    {
    }
    #endif /* CONFIG_PCI_ENDPOINT */

Should a static inline stub for pci_epc_linkdown() be added to
include/linux/pci-epc.h so host-only configurations continue to build?

> +
>  	/*
>  	 * Deassert LTSSM state to stop the state toggling between
>  	 * Polling and Detect.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261021061903.1269605-1-mmaddireddy@nvidia.com?part=3

  reply	other threads:[~2026-10-21  7:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21  6:19 [PATCH v2 0/3] PCI: dwc: Avoid full EP cleanup on PERST# Manikanta Maddireddy
2026-10-21  6:19 ` [PATCH v2 1/3] PCI: dwc: Reuse Endpoint resources after fundamental reset Manikanta Maddireddy
2026-10-21  6:38   ` sashiko-bot
2026-10-21  6:19 ` [PATCH v2 2/3] PCI: tegra194: Avoid full Endpoint reinit on PERST# Manikanta Maddireddy
2026-10-21  6:48   ` sashiko-bot
2026-10-21  6:19 ` [PATCH v2 3/3] PCI: tegra194: Notify Endpoint functions on PERST# assert Manikanta Maddireddy
2026-10-21  7:00   ` sashiko-bot [this message]
2026-10-23  1:38   ` kernel test robot

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=sashiko-outbox-179851@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mmaddireddy@nvidia.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.