Commit f073dde0 authored by Ben Hutchings's avatar Ben Hutchings

sfc: Make efx_mcdi_init() call efx_mcdi_handle_assertion()

This should probably be done during MCDI initialisation for any NIC.
Change efx_mcdi_init() to return an error code.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
parent 43f775b2
...@@ -50,13 +50,10 @@ static inline struct efx_mcdi_iface *efx_mcdi(struct efx_nic *efx) ...@@ -50,13 +50,10 @@ static inline struct efx_mcdi_iface *efx_mcdi(struct efx_nic *efx)
return &nic_data->mcdi; return &nic_data->mcdi;
} }
void efx_mcdi_init(struct efx_nic *efx) int efx_mcdi_init(struct efx_nic *efx)
{ {
struct efx_mcdi_iface *mcdi; struct efx_mcdi_iface *mcdi;
if (efx_nic_rev(efx) < EFX_REV_SIENA_A0)
return;
mcdi = efx_mcdi(efx); mcdi = efx_mcdi(efx);
init_waitqueue_head(&mcdi->wq); init_waitqueue_head(&mcdi->wq);
spin_lock_init(&mcdi->iface_lock); spin_lock_init(&mcdi->iface_lock);
...@@ -64,6 +61,9 @@ void efx_mcdi_init(struct efx_nic *efx) ...@@ -64,6 +61,9 @@ void efx_mcdi_init(struct efx_nic *efx)
mcdi->mode = MCDI_MODE_POLL; mcdi->mode = MCDI_MODE_POLL;
(void) efx_mcdi_poll_reboot(efx); (void) efx_mcdi_poll_reboot(efx);
/* Recover from a failed assertion before probing */
return efx_mcdi_handle_assertion(efx);
} }
static void efx_mcdi_copyin(struct efx_nic *efx, unsigned cmd, static void efx_mcdi_copyin(struct efx_nic *efx, unsigned cmd,
......
...@@ -65,7 +65,7 @@ struct efx_mcdi_mon { ...@@ -65,7 +65,7 @@ struct efx_mcdi_mon {
unsigned int n_attrs; unsigned int n_attrs;
}; };
extern void efx_mcdi_init(struct efx_nic *efx); extern int efx_mcdi_init(struct efx_nic *efx);
extern int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, extern int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd,
const efx_dword_t *inbuf, size_t inlen, const efx_dword_t *inbuf, size_t inlen,
......
...@@ -210,10 +210,7 @@ static int siena_probe_nic(struct efx_nic *efx) ...@@ -210,10 +210,7 @@ static int siena_probe_nic(struct efx_nic *efx)
efx_reado(efx, &reg, FR_AZ_CS_DEBUG); efx_reado(efx, &reg, FR_AZ_CS_DEBUG);
efx->port_num = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1; efx->port_num = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;
efx_mcdi_init(efx); rc = efx_mcdi_init(efx);
/* Recover from a failed assertion before probing */
rc = efx_mcdi_handle_assertion(efx);
if (rc) if (rc)
goto fail1; goto fail1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment