Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Change the command sequence and timing to preven...



details:   https://anonhg.NetBSD.org/src/rev/29b10453c06c
branches:  trunk
changeset: 744752:29b10453c06c
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Wed Feb 12 06:20:13 2020 +0000

description:
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.

diffstat:

 sys/dev/pci/if_ixl.c |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 5eb18ba51b93 -r 29b10453c06c sys/dev/pci/if_ixl.c
--- a/sys/dev/pci/if_ixl.c      Wed Feb 12 06:05:46 2020 +0000
+++ b/sys/dev/pci/if_ixl.c      Wed Feb 12 06:20:13 2020 +0000
@@ -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 @@
                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 @@
                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");



Home | Main Index | Thread Index | Old Index