From: Thierry Reding <thierry.reding@kernel.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: "Thierry Reding" <thierry.reding@gmail.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczy??ski" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
"Karthikeyan Mitran" <m.karthikeyan@mobiveil.co.in>,
"Hou Zhiqiang" <Zhiqiang.Hou@nxp.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Pali Rohár" <pali@kernel.org>,
"Michal Simek" <michal.simek@amd.com>,
"Kevin Xie" <kevin.xie@starfivetech.com>,
"Aksh Garg" <a-garg7@ti.com>,
linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
"Thierry Reding" <treding@nvidia.com>
Subject: Re: [PATCH v5 2/4] PCI: Use standard wait times for PCIe link monitoring
Date: Thu, 28 May 2026 08:44:07 +0200 [thread overview]
Message-ID: <ahfj-uhNTlk-byvU@orome> (raw)
In-Reply-To: <ahcob7HMbyGvFgxc@wunner.de>
[-- Attachment #1: Type: text/plain, Size: 2133 bytes --]
On Wed, May 27, 2026 at 07:22:55PM +0200, Lukas Wunner wrote:
> On Wed, May 27, 2026 at 10:28:51AM +0200, Thierry Reding wrote:
> > On Tue, May 26, 2026 at 01:10:39PM +0200, Lukas Wunner wrote:
> > > On Tue, May 26, 2026 at 10:53:11AM +0200, Thierry Reding wrote:
> > > > Instead of defining the wait values for each driver, use common values
> > > > defined in the core pci.h header file. Note that most drivers don't use
> > > > the millisecond waits, but rather usleep_range(), so add these commonly
> > > > used values to the header so that all drivers can use them.
> > >
> > > Hm, why not just replace usleep_range() with msleep() and use the existing
> > > macro instead of defining new ones?
> >
> > I'm trying to somewhat unify the implementations across drivers without
> > changing behaviour. I don't have a way of testing any of these drivers,
> > so keeping the existing implementation and just switching out the symbol
> > seemed like a good compromise.
>
> It looks like the code was copy-pasted from one driver to the next
> and I applaud every effort to deduplicate, unify and simplify things.
>
> I don't quite see how using msleep() instead of usleep_range()
> should result in breakage. The drivers are just polling for
> link up for an amount of time and as long as you're not decreasing
> that amount, everything ought to be fine. Moving to msleep()
> should never decrease the amount.
>
> > Then again, I count 2 drivers (in linux-next) that use the existing
> > PCIE_LINK_WAIT_SLEEP_MS, one of which multiplies by MILLI to get at the
> > US version (so it could easily be converted to the US_MIN version). Only
> > pcie-designware.c uses msleep() with PCIE_LINK_WAIT_SLEEP_MS, so it is
> > clearly the outlier.
>
> Konrad Dybcio went ahead and replaced usleep_range() with msleep()
> in that driver, kudos to him. Cf. b262518262f5 ("PCI: dwc: Use msleep()
> in dw_pcie_wait_for_link()"). If you could just carry over that change
> to the other drivers that would be great.
Alright, I see you really don't like usleep_range(), so msleep() it'll
be.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-05-28 6:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 8:53 [PATCH v5 0/4] PCI: tegra: Add Tegra264 support Thierry Reding
2026-05-26 8:53 ` [PATCH v5 1/4] dt-bindings: pci: Strictly distinguish C0 from C1-C5 Thierry Reding
2026-05-26 8:53 ` [PATCH v5 2/4] PCI: Use standard wait times for PCIe link monitoring Thierry Reding
2026-05-26 11:10 ` Lukas Wunner
2026-05-27 8:28 ` Thierry Reding
2026-05-27 17:22 ` Lukas Wunner
2026-05-28 6:44 ` Thierry Reding [this message]
2026-05-28 8:34 ` Manivannan Sadhasivam
2026-05-26 8:53 ` [PATCH v5 3/4] PCI: tegra: Add Tegra264 support Thierry Reding
2026-05-27 8:12 ` Thierry Reding
2026-05-26 8:53 ` [PATCH v5 4/4] arm64: tegra: Reorder reg and reg-names to match bindings Thierry Reding
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=ahfj-uhNTlk-byvU@orome \
--to=thierry.reding@kernel.org \
--cc=Zhiqiang.Hou@nxp.com \
--cc=a-garg7@ti.com \
--cc=bhelgaas@google.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jonathanh@nvidia.com \
--cc=kevin.xie@starfivetech.com \
--cc=krzk+dt@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=lukas@wunner.de \
--cc=m.karthikeyan@mobiveil.co.in \
--cc=mani@kernel.org \
--cc=michal.simek@amd.com \
--cc=pali@kernel.org \
--cc=robh@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=treding@nvidia.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