summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_em_hw.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/dev/pci/if_em_hw.c b/sys/dev/pci/if_em_hw.c
index 3cd8b792fe0..3815ca528db 100644
--- a/sys/dev/pci/if_em_hw.c
+++ b/sys/dev/pci/if_em_hw.c
@@ -31,7 +31,7 @@
*******************************************************************************/
-/* $OpenBSD: if_em_hw.c,v 1.98 2018/04/07 11:53:53 sf Exp $ */
+/* $OpenBSD: if_em_hw.c,v 1.99 2018/04/07 11:55:14 sf Exp $ */
/*
* if_em_hw.c Shared functions for accessing and configuring the MAC
*/
@@ -9539,9 +9539,18 @@ em_check_phy_reset_block(struct em_hw *hw)
DEBUGFUNC("em_check_phy_reset_block\n");
if (IS_ICH8(hw->mac_type)) {
- fwsm = E1000_READ_REG(hw, FWSM);
- return (fwsm & E1000_FWSM_RSPCIPHY) ? E1000_SUCCESS :
- E1000_BLK_PHY_RESET;
+ int i = 0;
+ int blocked = 0;
+ do {
+ fwsm = E1000_READ_REG(hw, FWSM);
+ if (!(fwsm & E1000_FWSM_RSPCIPHY)) {
+ blocked = 1;
+ msec_delay(10);
+ continue;
+ }
+ blocked = 0;
+ } while (blocked && (i++ < 30));
+ return blocked ? E1000_BLK_PHY_RESET : E1000_SUCCESS;
}
if (hw->mac_type > em_82547_rev_2)
manc = E1000_READ_REG(hw, MANC);