Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Dec 2016 11:58:23 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r310814 - head/sys/dev/sfxge/common
Message-ID:  <201612301158.uBUBwNB3064008@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <tmillington at solarflare.com>
  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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612301158.uBUBwNB3064008>