mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/2] e1000e: let the sleep codes run every time
@ 2024-05-03 10:18 Ricky Wu
  2024-05-03 18:17 ` Keller, Jacob E
  2024-05-06 15:53 ` [Intel-wired-lan] " Sasha Neftin
  0 siblings, 2 replies; 7+ messages in thread
From: Ricky Wu @ 2024-05-03 10:18 UTC (permalink / raw)
  To: jesse.brandeburg
  Cc: anthony.l.nguyen, intel-wired-lan, davem, edumazet, kuba, pabeni,
	netdev, linux-kernel, rickywu0421, en-wei.wu

Originally, the sleep codes being moved forward only
ran if we met some conditions (e.g. BMSR_LSTATUS bit
not set in phy_status). Moving these sleep codes forward
makes the usec_interval take effect every time.

Signed-off-by: Ricky Wu <en-wei.wu@canonical.com>
---

In v2:
* Split the sleep codes into this patch

 drivers/net/ethernet/intel/e1000e/phy.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
index 93544f1cc2a5..4a58d56679c9 100644
--- a/drivers/net/ethernet/intel/e1000e/phy.c
+++ b/drivers/net/ethernet/intel/e1000e/phy.c
@@ -1777,6 +1777,11 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
 
 	*success = false;
 	for (i = 0; i < iterations; i++) {
+		if (usec_interval >= 1000)
+			msleep(usec_interval / 1000);
+		else
+			udelay(usec_interval);
+
 		/* Some PHYs require the MII_BMSR register to be read
 		 * twice due to the link bit being sticky.  No harm doing
 		 * it across the board.
@@ -1799,10 +1804,6 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
 			*success = true;
 			break;
 		}
-		if (usec_interval >= 1000)
-			msleep(usec_interval / 1000);
-		else
-			udelay(usec_interval);
 	}
 
 	return ret_val;
-- 
2.40.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-07 12:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-03 10:18 [PATCH v2 1/2] e1000e: let the sleep codes run every time Ricky Wu
2024-05-03 18:17 ` Keller, Jacob E
2024-05-06 15:53 ` [Intel-wired-lan] " Sasha Neftin
2024-05-06 16:46   ` En-Wei WU
2024-05-07  6:21     ` Ruinskiy, Dima
2024-05-07  8:54       ` En-Wei WU
2024-05-07 12:29         ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®