Module Name: src
Committed By: yamaguchi
Date: Wed Feb 12 06:20:13 UTC 2020
Modified Files:
src/sys/dev/pci: if_ixl.c
Log Message:
Change the command sequence and timing to prevent EIO
in "Get PHY Abilities" command
The error has been appeared on X722 attaching an SFP module
without link up.
To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/if_ixl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.37 src/sys/dev/pci/if_ixl.c:1.38
--- src/sys/dev/pci/if_ixl.c:1.37 Fri Feb 7 09:38:29 2020
+++ src/sys/dev/pci/if_ixl.c Wed Feb 12 06:20:13 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ixl.c,v 1.37 2020/02/07 09:38:29 yamaguchi Exp $ */
+/* $NetBSD: if_ixl.c,v 1.38 2020/02/12 06:20:13 yamaguchi Exp $ */
/*
* Copyright (c) 2013-2015, Intel Corporation
@@ -1280,11 +1280,6 @@ ixl_attach(device_t parent, device_t sel
goto free_hmc;
}
- if (ixl_get_phy_info(sc) != 0) {
- /* error printed by ixl_get_phy_info */
- goto free_hmc;
- }
-
rv = ixl_get_link_status_poll(sc, NULL);
if (rv != 0) {
aprint_error_dev(self, "GET LINK STATUS %s\n",
@@ -1292,6 +1287,16 @@ ixl_attach(device_t parent, device_t sel
goto free_hmc;
}
+ /*
+ * The FW often returns EIO in "Get PHY Abilities" command
+ * if there is no delay
+ */
+ DELAY(500);
+ if (ixl_get_phy_info(sc) != 0) {
+ /* error printed by ixl_get_phy_info */
+ goto free_hmc;
+ }
+
if (ixl_dmamem_alloc(sc, &sc->sc_scratch,
sizeof(struct ixl_aq_vsi_data), 8) != 0) {
aprint_error_dev(self, "unable to allocate scratch buffer\n");