Date: Sat, 24 Mar 2018 01:07:58 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331472 - head/sys/dev/cxgbe Message-ID: <201803240107.w2O17wqZ063873@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Sat Mar 24 01:07:58 2018 New Revision: 331472 URL: https://svnweb.freebsd.org/changeset/base/331472 Log: cxgbe(4): Always initialize requested_speed to a valid value. This fixes an avoidable EINVAL when the user tries to disable AN after the port is initialized but l1cfg doesn't have a valid speed to use. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Mar 24 00:26:42 2018 (r331471) +++ head/sys/dev/cxgbe/t4_main.c Sat Mar 24 01:07:58 2018 (r331472) @@ -3981,12 +3981,11 @@ init_l1cfg(struct port_info *pi) ASSERT_SYNCHRONIZED_OP(sc); + lc->requested_speed = port_top_speed(pi); /* in Gbps */ if (t4_autoneg != 0 && lc->supported & FW_PORT_CAP_ANEG) { lc->requested_aneg = AUTONEG_ENABLE; - lc->requested_speed = 0; } else { lc->requested_aneg = AUTONEG_DISABLE; - lc->requested_speed = port_top_speed(pi); /* in Gbps */ } lc->requested_fc = t4_pause_settings & (PAUSE_TX | PAUSE_RX);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803240107.w2O17wqZ063873>