Thread (15 messages) 15 messages, 2 authors, 2011-03-11

[net-next-2.6 07/11] e1000e: extend EEE LPI timer to prevent dropped link

flat view
STALE5700d SUPERSEDED

From: Jeff Kirsher <hidden>
Date: 2011-03-11 11:06:51
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Revision v1 of 166 in this series.

Revisions (166)
  1. v1
  2. v2 [diff vs current]
  3. v1
  4. v1
  5. v2 [diff vs current]
  6. v1
  7. v1
  8. v1
  9. v1 current
  10. v1
  11. v1
  12. v1
  13. v1
  14. v2 [diff vs current]
  15. v1
  16. v3 [diff vs current]
  17. v1
  18. v1
  19. v1
  20. v2 [diff vs current]
  21. v2 [diff vs current]
  22. v1
  23. v1
  24. v1
  25. v1
  26. v2 [diff vs current]
  27. v1
  28. v1
  29. v1
  30. v1
  31. v1
  32. v2 [diff vs current]
  33. v1
  34. v2 [diff vs current]
  35. v1
  36. v1
  37. v1
  38. v1
  39. v1
  40. v1
  41. v1
  42. v1
  43. v1
  44. v1
  45. v1
  46. v2 [diff vs current]
  47. v1
  48. v1
  49. v1
  50. v1
  51. v1
  52. v1
  53. v1
  54. v1
  55. v1
  56. v1
  57. v1
  58. v1
  59. v1
  60. v1
  61. v1
  62. v1
  63. v1
  64. v1
  65. v2 [diff vs current]
  66. v1
  67. v1
  68. v1
  69. v1
  70. v2 [diff vs current]
  71. v1
  72. v1
  73. v1
  74. v2 [diff vs current]
  75. v1
  76. v2 [diff vs current]
  77. v1
  78. v1
  79. v1
  80. v1
  81. v1
  82. v1
  83. v1
  84. v1
  85. v2 [diff vs current]
  86. v1
  87. v1
  88. v2 [diff vs current]
  89. v1
  90. v1
  91. v1
  92. v1
  93. v1
  94. v1
  95. v2 [diff vs current]
  96. v1
  97. v2 [diff vs current]
  98. v2 [diff vs current]
  99. v1
  100. v2 [diff vs current]
  101. v3 [diff vs current]
  102. v1
  103. v4 [diff vs current]
  104. v1
  105. v5 [diff vs current]
  106. v6 [diff vs current]
  107. v7 [diff vs current]
  108. v1
  109. v1
  110. v1
  111. v2 [diff vs current]
  112. v1
  113. v1
  114. v1
  115. v2 [diff vs current]
  116. v1
  117. v1
  118. v1
  119. v1
  120. v2 [diff vs current]
  121. v1
  122. v1
  123. v2 [diff vs current]
  124. v3 [diff vs current]
  125. v4 [diff vs current]
  126. v1
  127. v1
  128. v2 [diff vs current]
  129. v5 [diff vs current]
  130. v1
  131. v1
  132. v1
  133. v2 [diff vs current]
  134. v1
  135. v1
  136. v2 [diff vs current]
  137. v3 [diff vs current]
  138. v1
  139. v2 [diff vs current]
  140. v1
  141. v1
  142. v2 [diff vs current]
  143. v1
  144. v2 [diff vs current]
  145. v1
  146. v2 [diff vs current]
  147. v3 [diff vs current]
  148. v1
  149. v1
  150. v1
  151. v2 [diff vs current]
  152. v1
  153. v1
  154. v1
  155. v1
  156. v1
  157. v1
  158. v2 [diff vs current]
  159. v1
  160. v1
  161. v1
  162. v2 [diff vs current]
  163. v1
  164. v1
  165. v1
  166. v2 [diff vs current]
From: Bruce Allan <redacted>

The link can be unexpectedly dropped when the timer for entering EEE low-
power-idle quiet state expires too soon.  The timer needs to be extended
from 196usec to 200usec after every LCD (PHY) reset to prevent this from
happening.

Signed-off-by: Bruce Allan <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
 drivers/net/e1000e/ich8lan.c |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index 232b42b..cf18d65 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -140,6 +140,11 @@
 #define I82579_LPI_CTRL			PHY_REG(772, 20)
 #define I82579_LPI_CTRL_ENABLE_MASK	0x6000
 
+/* EMI Registers */
+#define I82579_EMI_ADDR         0x10
+#define I82579_EMI_DATA         0x11
+#define I82579_LPI_UPDATE_TIMER 0x4805	/* in 40ns units + 40 ns base value */
+
 /* Strapping Option Register - RO */
 #define E1000_STRAP                     0x0000C
 #define E1000_STRAP_SMBUS_ADDRESS_MASK  0x00FE0000
@@ -1723,11 +1728,25 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw)
 	/* Configure the LCD with the OEM bits in NVM */
 	ret_val = e1000_oem_bits_config_ich8lan(hw, true);
 
-	/* Ungate automatic PHY configuration on non-managed 82579 */
-	if ((hw->mac.type == e1000_pch2lan) &&
-	    !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {
-		msleep(10);
-		e1000_gate_hw_phy_config_ich8lan(hw, false);
+	if (hw->mac.type == e1000_pch2lan) {
+		/* Ungate automatic PHY configuration on non-managed 82579 */
+		if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {
+			msleep(10);
+			e1000_gate_hw_phy_config_ich8lan(hw, false);
+		}
+
+		/* Set EEE LPI Update Timer to 200usec */
+		ret_val = hw->phy.ops.acquire(hw);
+		if (ret_val)
+			goto out;
+		ret_val = hw->phy.ops.write_reg_locked(hw, I82579_EMI_ADDR,
+						       I82579_LPI_UPDATE_TIMER);
+		if (ret_val)
+			goto release;
+		ret_val = hw->phy.ops.write_reg_locked(hw, I82579_EMI_DATA,
+						       0x1387);
+release:
+		hw->phy.ops.release(hw);
 	}
 
 out:
-- 
1.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help