From: Aksh Garg <a-garg7@ti.com>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: <linux-pci@vger.kernel.org>, <vigneshr@ti.com>,
<s-vadapalli@ti.com>, <lpieralisi@kernel.org>,
<kwilczynski@kernel.org>, <robh@kernel.org>,
<bhelgaas@google.com>, <mpillai@cadence.com>,
<unicorn_wang@outlook.com>, <me@ziyao.cc>, <18255117159@163.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <danishanwar@ti.com>
Subject: Re: [PATCH] PCI: cadence: skip the link polling when endpoint not connected
Date: Tue, 23 Jun 2026 12:07:03 +0530 [thread overview]
Message-ID: <c7ff0976-ef28-4056-8fa0-a6a398fa21c1@ti.com> (raw)
In-Reply-To: <pocwd4v7iqlixcpaikjo6vqmnwsb7rfjt42qvlmxsn6xnvtrpf@zgch2iwu7itw>
On 23/06/26 11:15, Manivannan Sadhasivam wrote:
> On Tue, Jun 23, 2026 at 10:53:48AM +0530, Aksh Garg wrote:
>>
>>
>> On 22/06/26 20:22, Manivannan Sadhasivam wrote:
>>> On Fri, Jun 05, 2026 at 12:49:22PM +0530, Aksh Garg wrote:
>>>> cdns_pcie_host_wait_for_link() polls on link-up for 10 retries with a
>>>> delay of 90-100ms each (~1 second). A call to cdns_pcie_host_link_setup()
>>>> during the resume operation blocks the resume operation unnecessarily for
>>>> ~1s even when no endpoint device is connected.
>>>>
>>>> Add skip_link_polling flag to track link state across suspend/resume
>>>> cycles. If link was down before suspend, skip the expensive polling
>>>> in resume since no endpoint was present.
>>>>
>>>
>>> Won't you need the delay if a device gets plugged while the host was suspended?
>>> We had this same concern with the DWC drivers and we left the delay as-is as
>>> nothing prevents an user to connect a device when the host was suspended.
>>
>> Yes, that is true. However, the platforms that do not support hot-plug can
>> skip the delay during resume since no device could have been connected while
>> suspended (only those platform's driver would be expected to set
>> 'rc->skip_link_polling) just like what Tegra264 PCIe driver tries to do at
>> [1], where the driver sets "pcie->link_up = false" if the link is down
>> during the probe and if the controller doesn't support hot-plug.
>>
>
> If the platform doesn't support hotplug, then it is perfectly fine to skip the
> delay. But you need to name the flag as like 'no_hotplug' or something
> relevant, not 'skip_link_polling'.
Sure, I will rename the flag to 'link_down_no_hotplug' to clarify that
it tracks the link state when there's no hotplug support.
>
>> Even if a user connects a device (when the host was suspended) to a platform
>> which doesn't support hotplug, the user is expected to run a bus rescan,
>> which doesn't call cdns_pcie_host_link_setup() anyway, hence the flag
>> 'skip_link_polling' is not taken into account in that case.
>>
>
> This is not about running the rescan, but about initializing the device. The 1s
> delay in cdns_pcie_host_wait_for_link() is mandated by the PCIe spec after
> starting LTSSM and before issuing the config read to the device. If this delay
> is skipped and if a config read is issued to the device, then the device may not
> respond and the failure may lead to PCI stack assuming that the device is dead.
Understood, thanks for the explanation.
>
> - Mani
>
prev parent reply other threads:[~2026-06-23 6:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 7:19 [PATCH] PCI: cadence: skip the link polling when endpoint not connected Aksh Garg
2026-06-08 6:26 ` Chen Wang
2026-06-09 3:42 ` Siddharth Vadapalli
2026-06-09 4:28 ` Aksh Garg
2026-06-09 5:11 ` Siddharth Vadapalli
2026-06-09 5:36 ` Manikandan Karunakaran Pillai
2026-06-22 14:52 ` Manivannan Sadhasivam
2026-06-23 5:23 ` Aksh Garg
2026-06-23 5:45 ` Manivannan Sadhasivam
2026-06-23 6:37 ` Aksh Garg [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=c7ff0976-ef28-4056-8fa0-a6a398fa21c1@ti.com \
--to=a-garg7@ti.com \
--cc=18255117159@163.com \
--cc=bhelgaas@google.com \
--cc=danishanwar@ti.com \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=me@ziyao.cc \
--cc=mpillai@cadence.com \
--cc=robh@kernel.org \
--cc=s-vadapalli@ti.com \
--cc=unicorn_wang@outlook.com \
--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