From: Manikanta Maddireddy <mmaddireddy@nvidia.com>
To: <bhelgaas@google.com>, <lpieralisi@kernel.org>,
<kwilczynski@kernel.org>, <mani@kernel.org>, <robh@kernel.org>,
<krzk+dt@kernel.org>, <conor+dt@kernel.org>,
<thierry.reding@gmail.com>, <jonathanh@nvidia.com>,
<kishon@kernel.org>, <arnd@arndb.de>,
<gregkh@linuxfoundation.org>, <Frank.Li@nxp.com>,
<den@valinux.co.jp>, <hongxing.zhu@nxp.com>,
<jingoohan1@gmail.com>, <vidyas@nvidia.com>, <cassel@kernel.org>,
<18255117159@163.com>
Cc: <linux-pci@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Manikanta Maddireddy <mmaddireddy@nvidia.com>
Subject: [PATCH v3 0/2] PCI: tegra194: ASPM L1 entrance latency from device tree
Date: Fri, 15 May 2026 12:37:51 +0530 [thread overview]
Message-ID: <20260515070753.3852840-1-mmaddireddy@nvidia.com> (raw)
This series programs Synopsys DesignWare ASPM L1 entrance latency on NVIDIA
Tegra194/234 PCIe controllers from an optional device tree property and
corrects the default nanosecond cells so the PORT_AFR field advertises the
intended latency buckets.
Background
----------
The controller exposes L1 entrance latency in PCI Express PORT_AFR (DW DBI),
bits 27:29. Software must select a 3-bit code for the maximum L1 entry delay
the platform can tolerate. Patch 1 reads aspm-l1-entry-delay-ns (nanoseconds),
converts to whole microseconds with ceiling division (DIV_ROUND_UP), and
programs min(order_base_2(us), 7) into PORT_AFR during ASPM init. If the
property is absent, the driver keeps the existing default (code 7).
PORT_AFR L1 entrance latency encoding (bits 27:29)
--------------------------------------------------
+--------------------------+----------+
| Advertised maximum | Code |
+--------------------------+----------+
| Maximum of 1 us | 000b |
+--------------------------+----------+
| Maximum of 2 us | 001b |
+--------------------------+----------+
| Maximum of 4 us | 010b |
+--------------------------+----------+
| Maximum of 8 us | 011b |
+--------------------------+----------+
| Maximum of 16 us | 100b |
+--------------------------+----------+
| Maximum of 32 us | 101b |
+--------------------------+----------+
| Maximum of 64 us | 110b |
+--------------------------+----------+
| Rest | 111b |
+--------------------------+----------+
Patch summary
-------------
1/2 PCI: tegra194: Use aspm-l1-entry-delay-ns DT property for L1 entrance
latency
Add driver support described above. v1 and v2 could not program
encoding 0 (000b, 1 us bucket); v3 uses order_base_2(us) so values map
to the table.
2/2 arm64: tegra: fix aspm-l1-entry-delay-ns L1 latency cells
Commit d60ed99f1c9e ("arm64: tegra: Add aspm-l1-entry-delay-ns to PCIe
nodes") added 4000 / 8000 / 16000 ns cells. After ceiling conversion
those are 4 / 8 / 16 us, yielding PORT_AFR codes 2 / 3 / 4. The
intended advertisement is codes 3 / 4 / 5 (8 / 16 / 32 us buckets).
Double each nanosecond cell:
tegra194.dtsi: 4000 -> 8000 ns (all Root Port and Endpoint nodes)
tegra234.dtsi: 8000 -> 16000 ns (Root Port), 16000 -> 32000 ns (Endpoint)
With the v3 driver mapping in place, the original nanosecond cells no
longer yield the intended PORT_AFR codes; doubling them restores codes
3 / 4 / 5 as described above.
Fixes: d60ed99f1c9e ("arm64: tegra: Add aspm-l1-entry-delay-ns to PCIe nodes")
Testing
-------
- Verified device tree parsing and PORT_AFR encoding on target hardware.
- Exercised boundary nanosecond values with a temporary debug patch.
- Built on x86_64 (previous revision exposed a tree build failure).
Manikanta Maddireddy (2):
PCI: tegra194: Use aspm-l1-entry-delay-ns DT property for L1 entrance
latency
arm64: tegra: fix aspm-l1-entry-delay-ns L1 latency cells
arch/arm64/boot/dts/nvidia/tegra194.dtsi | 18 ++++++------
arch/arm64/boot/dts/nvidia/tegra234.dtsi | 32 +++++++++++-----------
drivers/pci/controller/dwc/pcie-tegra194.c | 13 +++++++++
3 files changed, 38 insertions(+), 25 deletions(-)
--
2.34.1
next reply other threads:[~2026-05-15 7:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 7:07 Manikanta Maddireddy [this message]
2026-05-15 7:07 ` [PATCH v3 1/2] PCI: tegra194: Use aspm-l1-entry-delay-ns DT property for L1 entrance latency Manikanta Maddireddy
2026-05-15 7:07 ` [PATCH v3 2/2] arm64: tegra: fix aspm-l1-entry-delay-ns L1 latency cells Manikanta Maddireddy
2026-05-15 7:45 ` sashiko-bot
2026-05-15 8:38 ` Manikanta Maddireddy
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=20260515070753.3852840-1-mmaddireddy@nvidia.com \
--to=mmaddireddy@nvidia.com \
--cc=18255117159@163.com \
--cc=Frank.Li@nxp.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=conor+dt@kernel.org \
--cc=den@valinux.co.jp \
--cc=gregkh@linuxfoundation.org \
--cc=hongxing.zhu@nxp.com \
--cc=jingoohan1@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=kishon@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=robh@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=vidyas@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