Skip to content

Commit

Permalink
sfc: Make efx_mcdi_init() call efx_mcdi_handle_assertion()
Browse files Browse the repository at this point in the history
This should probably be done during MCDI initialisation for any NIC.
Change efx_mcdi_init() to return an error code.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
  • Loading branch information
Ben Hutchings committed Aug 21, 2013
1 parent 43f775b commit f073dde
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/sfc/mcdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ static inline struct efx_mcdi_iface *efx_mcdi(struct efx_nic *efx)
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;

if (efx_nic_rev(efx) < EFX_REV_SIENA_A0)
return;

mcdi = efx_mcdi(efx);
init_waitqueue_head(&mcdi->wq);
spin_lock_init(&mcdi->iface_lock);
atomic_set(&mcdi->state, MCDI_STATE_QUIESCENT);
mcdi->mode = MCDI_MODE_POLL;

(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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/sfc/mcdi.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct efx_mcdi_mon {
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,
const efx_dword_t *inbuf, size_t inlen,
Expand Down
5 changes: 1 addition & 4 deletions drivers/net/ethernet/sfc/siena.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,7 @@ static int siena_probe_nic(struct efx_nic *efx)
efx_reado(efx, &reg, FR_AZ_CS_DEBUG);
efx->port_num = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;

efx_mcdi_init(efx);

/* Recover from a failed assertion before probing */
rc = efx_mcdi_handle_assertion(efx);
rc = efx_mcdi_init(efx);
if (rc)
goto fail1;

Expand Down

0 comments on commit f073dde

Please sign in to comment.