Skip to content

Commit d4ec09a

Browse files
Ben Hutchingsdavem330
authored andcommitted
sfc: Do not reinitialise XAUI serdes before it has completed reset
falcon_reset_xaui() waits for XGXS reset to complete, but the XAUI serdes reset may take longer. It needs to check both reset active bits. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent aed0628 commit d4ec09a

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎drivers/net/sfc/falcon_hwdefs.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,8 @@
700700
/* XGXS/XAUI powerdown/reset register */
701701
#define XX_PWR_RST_REG 0x1300
702702

703+
#define XX_SD_RST_ACT_LBN 16
704+
#define XX_SD_RST_ACT_WIDTH 1
703705
#define XX_PWRDND_EN_LBN 15
704706
#define XX_PWRDND_EN_WIDTH 1
705707
#define XX_PWRDNC_EN_LBN 14

‎drivers/net/sfc/falcon_xmac.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,15 @@ int falcon_reset_xaui(struct efx_nic *efx)
6464
efx_oword_t reg;
6565
int count;
6666

67+
/* Start reset sequence */
6768
EFX_POPULATE_DWORD_1(reg, XX_RST_XX_EN, 1);
6869
falcon_write(efx, &reg, XX_PWR_RST_REG);
6970

70-
/* Give some time for the link to establish */
71-
for (count = 0; count < 1000; count++) { /* wait upto 10ms */
71+
/* Wait up to 10 ms for completion, then reinitialise */
72+
for (count = 0; count < 1000; count++) {
7273
falcon_read(efx, &reg, XX_PWR_RST_REG);
73-
if (EFX_OWORD_FIELD(reg, XX_RST_XX_EN) == 0) {
74+
if (EFX_OWORD_FIELD(reg, XX_RST_XX_EN) == 0 &&
75+
EFX_OWORD_FIELD(reg, XX_SD_RST_ACT) == 0) {
7476
falcon_setup_xaui(efx);
7577
return 0;
7678
}

0 commit comments

Comments
 (0)