From owner-svn-src-head@freebsd.org Fri Dec 30 11:58:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE53DC96268; Fri, 30 Dec 2016 11:58:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F870105C; Fri, 30 Dec 2016 11:58:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUBwNAR064010; Fri, 30 Dec 2016 11:58:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUBwNB3064008; Fri, 30 Dec 2016 11:58:23 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301158.uBUBwNB3064008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 11:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310814 - head/sys/dev/sfxge/common 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.23 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: Fri, 30 Dec 2016 11:58:24 -0000 Author: arybchik Date: Fri Dec 30 11:58:23 2016 New Revision: 310814 URL: https://svnweb.freebsd.org/changeset/base/310814 Log: sfxge(4): make verified update result available from ef10_nvram_partn_unlock() Manftest needs to know exactly what went wrong with the verified update so that failing boards can be correctly diagnosed. Submitted by: Tom Millington Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8969 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nvram.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Dec 30 11:56:12 2016 (r310813) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Dec 30 11:58:23 2016 (r310814) @@ -393,7 +393,8 @@ ef10_nvram_partn_lock( extern __checkReturn efx_rc_t ef10_nvram_partn_unlock( __in efx_nic_t *enp, - __in uint32_t partn); + __in uint32_t partn, + __out_opt uint32_t *resultp); #endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */ Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Dec 30 11:56:12 2016 (r310813) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Dec 30 11:58:23 2016 (r310814) @@ -1828,7 +1828,7 @@ ef10_nvram_partn_write_segment_tlv( goto fail7; /* Unlock the partition */ - ef10_nvram_partn_unlock(enp, partn); + ef10_nvram_partn_unlock(enp, partn, NULL); EFSYS_KMEM_FREE(enp->en_esip, partn_size, partn_data); @@ -1843,7 +1843,7 @@ fail5: fail4: EFSYS_PROBE(fail4); - ef10_nvram_partn_unlock(enp, partn); + ef10_nvram_partn_unlock(enp, partn, NULL); fail3: EFSYS_PROBE(fail3); @@ -2049,13 +2049,16 @@ fail1: __checkReturn efx_rc_t ef10_nvram_partn_unlock( __in efx_nic_t *enp, - __in uint32_t partn) + __in uint32_t partn, + __out_opt uint32_t *resultp) { boolean_t reboot = B_FALSE; - uint32_t result = 0; /* FIXME: MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */ efx_rc_t rc; - rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, &result); + if (resultp != NULL) + *resultp = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; + + rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, resultp); if (rc != 0) goto fail1; @@ -2064,7 +2067,6 @@ ef10_nvram_partn_unlock( fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); - /* FIXME: log result if verified firmware update fails */ return (rc); } @@ -2370,7 +2372,7 @@ ef10_nvram_partn_rw_finish( { efx_rc_t rc; - if ((rc = ef10_nvram_partn_unlock(enp, partn)) != 0) + if ((rc = ef10_nvram_partn_unlock(enp, partn, NULL)) != 0) goto fail1; return (0);