From: sashiko-bot@kernel.org
To: "Manikanta Maddireddy" <mmaddireddy@nvidia.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v2] PCI: tegra194: Use aspm-l1-entry-delay-ns DT property for L1 entrance latency
Date: Wed, 13 May 2026 03:58:53 +0000 [thread overview]
Message-ID: <20260513035854.21C09C2BCC9@smtp.kernel.org> (raw)
In-Reply-To: <20260512034821.1320714-1-mmaddireddy@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] L1 entrance latency calculation prevents programming a hardware value of 0.
--
commit 63300af08363595c90cc1e642b1cf857792eae94
Author: Manikanta Maddireddy <mmaddireddy@nvidia.com>
PCI: tegra194: Use aspm-l1-entry-delay-ns DT property for L1 entrance latency
This commit parses the aspm-l1-entry-delay-ns device tree property to
configure the ASPM L1 entrance latency. It converts the delay from
nanoseconds to a 3-bit hardware encoding.
> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> index 9dcfa194050e7..c9716d6144517 100644
> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
[ ... ]
> @@ -1141,6 +1146,15 @@ static int tegra_pcie_dw_parse_dt(struct tegra_pcie_dw *pcie)
> dev_info(pcie->dev,
> "Failed to read ASPM L0s Entrance latency: %d\n", ret);
>
> + /* Default to max latency of 7. */
> + pcie->aspm_l1_enter_lat = 7;
> + ret = of_property_read_u32(np, "aspm-l1-entry-delay-ns", &val);
> + if (!ret) {
> + u32 us = max(val / 1000, 1U);
> +
> + pcie->aspm_l1_enter_lat = min(ilog2(us) + 1, 7);
The commit message states the value is converted to a hardware encoded 3-bit
value that is equal to log2(ns/1000) + 1. Does this calculation prevent
programming a hardware value of 0?
By using max(val / 1000, 1U), the minimum value for us is 1. Since
ilog2(1) + 1 is 1, pcie->aspm_l1_enter_lat can never evaluate to 0.
If the hardware supports an encoded value of 0 to represent delays less than
1us, this logic prevents configuring it.
> + }
> +
> ret = of_property_read_u32(np, "num-lanes", &pcie->num_lanes);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260512034821.1320714-1-mmaddireddy@nvidia.com?part=1
prev parent reply other threads:[~2026-05-13 3:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 3:48 [PATCH v2] PCI: tegra194: Use aspm-l1-entry-delay-ns DT property for L1 entrance latency Manikanta Maddireddy
2026-05-12 8:50 ` Jon Hunter
2026-05-13 3:58 ` sashiko-bot [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=20260513035854.21C09C2BCC9@smtp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox