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
This commit is contained in:
Andrew Rybchenko 2016-12-30 11:58:23 +00:00
parent 8a4fcbd44f
commit f92697a4dd
2 changed files with 11 additions and 8 deletions

View File

@ -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 */

View File

@ -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 @@ ef10_nvram_partn_write_segment_tlv(
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 @@ ef10_nvram_partn_write(
__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);