]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sfc: Do not reinitialise XAUI serdes before it has completed reset
authorBen Hutchings <bhutchings@solarflare.com>
Wed, 26 Aug 2009 08:16:46 +0000 (08:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Aug 2009 00:38:51 +0000 (17:38 -0700)
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>
drivers/net/sfc/falcon_hwdefs.h
drivers/net/sfc/falcon_xmac.c

index 375e2a5961ec6c214bcc270389ef66da59a7be8d..2d2261117ace272c56179500c97493c432e7ac70 100644 (file)
 /* XGXS/XAUI powerdown/reset register */
 #define XX_PWR_RST_REG 0x1300
 
+#define XX_SD_RST_ACT_LBN 16
+#define XX_SD_RST_ACT_WIDTH 1
 #define XX_PWRDND_EN_LBN 15
 #define XX_PWRDND_EN_WIDTH 1
 #define XX_PWRDNC_EN_LBN 14
index 2b3269c03263e1b93231af89b97a52e818e94a06..bec52ca37eeee6562eab4184eca4f35b66d137e6 100644 (file)
@@ -64,13 +64,15 @@ int falcon_reset_xaui(struct efx_nic *efx)
        efx_oword_t reg;
        int count;
 
+       /* Start reset sequence */
        EFX_POPULATE_DWORD_1(reg, XX_RST_XX_EN, 1);
        falcon_write(efx, &reg, XX_PWR_RST_REG);
 
-       /* Give some time for the link to establish */
-       for (count = 0; count < 1000; count++) { /* wait upto 10ms */
+       /* Wait up to 10 ms for completion, then reinitialise */
+       for (count = 0; count < 1000; count++) {
                falcon_read(efx, &reg, XX_PWR_RST_REG);
-               if (EFX_OWORD_FIELD(reg, XX_RST_XX_EN) == 0) {
+               if (EFX_OWORD_FIELD(reg, XX_RST_XX_EN) == 0 &&
+                   EFX_OWORD_FIELD(reg, XX_SD_RST_ACT) == 0) {
                        falcon_setup_xaui(efx);
                        return 0;
                }