]> git.ipfire.org Git - thirdparty/linux.git/commit
PCI/ASPM: Add pcie_encode_t_power_on() helper to encode L1SS T_POWER_ON fields
authorKrishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Tue, 28 Apr 2026 08:37:15 +0000 (14:07 +0530)
committerManivannan Sadhasivam <mani@kernel.org>
Tue, 26 May 2026 14:44:46 +0000 (16:44 +0200)
commitc93db46192779ff82a85eec571b2d0324e18beec
tree0e8f95084798ffe27a40173a8e38c2367086bb3f
parent1a23bcb452d95f099e530414504c0d99ee076b3f
PCI/ASPM: Add pcie_encode_t_power_on() helper to encode L1SS T_POWER_ON fields

Add pcie_encode_t_power_on() to encode the PCIe L1 PM Substates T_POWER_ON
parameter into the T_POWER_ON Scale and T_POWER_ON Value fields.

This helper can be used by the controller drivers to change the
default/wrong value of T_POWER_ON in L1SS capability register to avoid
incorrect calculation of LTR_L1.2_THRESHOLD value.

The helper converts a T_POWER_ON time specified in microseconds into the
appropriate scale/value encoding defined by PCIe r7.0, sec 7.8.3.2. Values
that exceed the maximum encodable range are clamped to the largest
representable encoding.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
[mani: changed t_power_on_us to u32, added helper name to subject]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260428-t_power_on_fux-v5-1-f1ef926a91ff@oss.qualcomm.com
drivers/pci/pci.h
drivers/pci/pcie/aspm.c