mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
e1000e: Fix the max snoop/no-snoop latency for 10M
[ Upstream commit44a13a5d99
] We should decode the latency and the max_latency before directly compare. The latency should be presented as lat_enc = scale x value: lat_enc_d = (lat_enc & 0x0x3ff) x (1U << (5*((max_ltr_enc & 0x1c00) >> 10))) Fixes:cf8fb73c23
("e1000e: add support for LTR on I217/I218") Suggested-by: Yee Li <seven.yi.lee@gmail.com> Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ba86c6a693
commit
82657502ef
2 changed files with 16 additions and 1 deletions
|
@ -1013,6 +1013,8 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
|
|||
{
|
||||
u32 reg = link << (E1000_LTRV_REQ_SHIFT + E1000_LTRV_NOSNOOP_SHIFT) |
|
||||
link << E1000_LTRV_REQ_SHIFT | E1000_LTRV_SEND;
|
||||
u16 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */
|
||||
u16 lat_enc_d = 0; /* latency decoded */
|
||||
u16 lat_enc = 0; /* latency encoded */
|
||||
|
||||
if (link) {
|
||||
|
@ -1066,7 +1068,17 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
|
|||
E1000_PCI_LTR_CAP_LPT + 2, &max_nosnoop);
|
||||
max_ltr_enc = max_t(u16, max_snoop, max_nosnoop);
|
||||
|
||||
if (lat_enc > max_ltr_enc)
|
||||
lat_enc_d = (lat_enc & E1000_LTRV_VALUE_MASK) *
|
||||
(1U << (E1000_LTRV_SCALE_FACTOR *
|
||||
((lat_enc & E1000_LTRV_SCALE_MASK)
|
||||
>> E1000_LTRV_SCALE_SHIFT)));
|
||||
|
||||
max_ltr_enc_d = (max_ltr_enc & E1000_LTRV_VALUE_MASK) *
|
||||
(1U << (E1000_LTRV_SCALE_FACTOR *
|
||||
((max_ltr_enc & E1000_LTRV_SCALE_MASK)
|
||||
>> E1000_LTRV_SCALE_SHIFT)));
|
||||
|
||||
if (lat_enc_d > max_ltr_enc_d)
|
||||
lat_enc = max_ltr_enc;
|
||||
}
|
||||
|
||||
|
|
|
@ -292,8 +292,11 @@
|
|||
|
||||
/* Latency Tolerance Reporting */
|
||||
#define E1000_LTRV 0x000F8
|
||||
#define E1000_LTRV_VALUE_MASK 0x000003FF
|
||||
#define E1000_LTRV_SCALE_MAX 5
|
||||
#define E1000_LTRV_SCALE_FACTOR 5
|
||||
#define E1000_LTRV_SCALE_SHIFT 10
|
||||
#define E1000_LTRV_SCALE_MASK 0x00001C00
|
||||
#define E1000_LTRV_REQ_SHIFT 15
|
||||
#define E1000_LTRV_NOSNOOP_SHIFT 16
|
||||
#define E1000_LTRV_SEND (1 << 30)
|
||||
|
|
Loading…
Reference in a new issue