From owner-svn-src-head@FreeBSD.ORG Wed Jun 5 20:57:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC777775; Wed, 5 Jun 2013 20:57:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B55CD10CD; Wed, 5 Jun 2013 20:57:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r55KvqNa040388; Wed, 5 Jun 2013 20:57:52 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r55KvqXl040387; Wed, 5 Jun 2013 20:57:52 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201306052057.r55KvqXl040387@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 5 Jun 2013 20:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251434 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2013 20:57:52 -0000 Author: np Date: Wed Jun 5 20:57:52 2013 New Revision: 251434 URL: http://svnweb.freebsd.org/changeset/base/251434 Log: cxgbe(4): Never install a firmware if hw.cxgbe.fw_install is 0. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Jun 5 20:15:18 2013 (r251433) +++ head/sys/dev/cxgbe/t4_main.c Wed Jun 5 20:57:52 2013 (r251434) @@ -1912,18 +1912,15 @@ fw_compatible(const struct fw_hdr *hdr1, } /* - * The firmware in the KLD is usable and can be installed. But should it be? - * This routine explains itself in detail if it indicates the KLD firmware - * should be installed. + * The firmware in the KLD is usable, but should it be installed? This routine + * explains itself in detail if it indicates the KLD firmware should be + * installed. */ static int should_install_kld_fw(struct adapter *sc, int card_fw_usable, int k, int c) { const char *reason; - KASSERT(t4_fw_install != 0, ("%s: Can't install; shouldn't be asked " - "to evaluate if install is a good idea.", __func__)); - if (!card_fw_usable) { reason = "incompatible or unusable"; goto install; @@ -1942,6 +1939,16 @@ should_install_kld_fw(struct adapter *sc return (0); install: + if (t4_fw_install == 0) { + device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " + "but the driver is prohibited from installing a different " + "firmware on the card.\n", + G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), + G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason); + + return (0); + } + device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " "installing firmware %u.%u.%u.%u on card.\n", G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), @@ -2028,15 +2035,13 @@ prep_firmware(struct adapter *sc) } if (card_fw_usable && card_fw->fw_ver == drv_fw->fw_ver && - (!kld_fw_usable || kld_fw->fw_ver == drv_fw->fw_ver || - t4_fw_install == 0)) { + (!kld_fw_usable || kld_fw->fw_ver == drv_fw->fw_ver)) { /* * Common case: the firmware on the card is an exact match and * the KLD is an exact match too, or the KLD is - * absent/incompatible, or we're prohibited from using it. Note - * that t4_fw_install = 2 is ignored here -- use cxgbetool - * loadfw if you want to reinstall the same firmware as the one - * on the card. + * absent/incompatible. Note that t4_fw_install = 2 is ignored + * here -- use cxgbetool loadfw if you want to reinstall the + * same firmware as the one on the card. */ } else if (kld_fw_usable && state == DEV_STATE_UNINIT && should_install_kld_fw(sc, card_fw_usable, be32toh(kld_fw->fw_ver),