diff options
author | Bjorn Helgaas | 2022-10-04 21:58:09 -0500 |
---|---|---|
committer | Bjorn Helgaas | 2022-10-05 12:12:02 -0500 |
commit | 7afeb84d14eaaebb71f5c558ed57ca858e4304e7 (patch) | |
tree | a07e7501865c1f402b567fe36419e05899e2d2cf /drivers/auxdisplay | |
parent | cfc0028627cadfa271fab0290f18731193d63d87 (diff) |
PCI/ASPM: Correct LTR_L1.2_THRESHOLD computation
80d7d7a904fa ("PCI/ASPM: Calculate LTR_L1.2_THRESHOLD from device
characteristics") replaced a fixed value (163840ns) with one computed from
T_POWER_OFF, Common_Mode_Restore_Time, etc., but it encoded the
LTR_L1.2_THRESHOLD value incorrectly.
This is especially a problem for small thresholds, e.g., 63ns fell into the
"threshold_ns < 1024" case and was encoded as 32ns:
LTR_L1.2_THRESHOLD_Scale = 1 (multiplier is 32ns)
LTR_L1.2_THRESHOLD_Value = 63 >> 5 = 1
LTR_L1.2_THRESHOLD = multiplier * value = 32ns * 1 = 32ns
Correct the algorithm to encode all times of 1023ns (0x3ff) or smaller
exactly and larger times conservatively (the encoded threshold is never
smaller than was requested). This reduces the chance of entering L1.2
when the device can't tolerate the exit latency.
Fixes: 80d7d7a904fa ("PCI/ASPM: Calculate LTR_L1.2_THRESHOLD from device characteristics")
Link: https://lore.kernel.org/r/20221005025809.2247547-4-helgaas@kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Diffstat (limited to 'drivers/auxdisplay')
0 files changed, 0 insertions, 0 deletions