aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorRobert Stonehouse <rstonehouse@solarflare.com>2013-10-09 06:52:48 -0400
committerBen Hutchings <bhutchings@solarflare.com>2013-12-06 17:27:55 -0500
commit6b294b8efedaa7cf7507154148e2c79766ad6f96 (patch)
tree23f9942889ba78024c3389808cfe0d1eea738619 /drivers/net/ethernet
parent5731d7b35e5b87157a9b9973cc2eff70c50aec58 (diff)
sfc: Poll for MCDI completion once before timeout occurs
There is an as-yet unexplained bug that sometimes prevents (or delays) the driver seeing the completion event for a completed MCDI request on the SFC9120. The requested configuration change will have happened but the driver assumes it to have failed, and this can result in further failures. We can mitigate this by polling for completion after unsuccessfully waiting for an event. Fixes: 8127d661e77f ('sfc: Add support for Solarflare SFC9100 family') Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/sfc/mcdi.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
index 9f26e46ee283..4b0bd8a1514d 100644
--- a/drivers/net/ethernet/sfc/mcdi.c
+++ b/drivers/net/ethernet/sfc/mcdi.c
@@ -630,6 +630,16 @@ int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
630 rc = efx_mcdi_await_completion(efx); 630 rc = efx_mcdi_await_completion(efx);
631 631
632 if (rc != 0) { 632 if (rc != 0) {
633 netif_err(efx, hw, efx->net_dev,
634 "MC command 0x%x inlen %d mode %d timed out\n",
635 cmd, (int)inlen, mcdi->mode);
636
637 if (mcdi->mode == MCDI_MODE_EVENTS && efx_mcdi_poll_once(efx)) {
638 netif_err(efx, hw, efx->net_dev,
639 "MCDI request was completed without an event\n");
640 rc = 0;
641 }
642
633 /* Close the race with efx_mcdi_ev_cpl() executing just too late 643 /* Close the race with efx_mcdi_ev_cpl() executing just too late
634 * and completing a request we've just cancelled, by ensuring 644 * and completing a request we've just cancelled, by ensuring
635 * that the seqno check therein fails. 645 * that the seqno check therein fails.
@@ -638,11 +648,9 @@ int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
638 ++mcdi->seqno; 648 ++mcdi->seqno;
639 ++mcdi->credits; 649 ++mcdi->credits;
640 spin_unlock_bh(&mcdi->iface_lock); 650 spin_unlock_bh(&mcdi->iface_lock);
651 }
641 652
642 netif_err(efx, hw, efx->net_dev, 653 if (rc == 0) {
643 "MC command 0x%x inlen %d mode %d timed out\n",
644 cmd, (int)inlen, mcdi->mode);
645 } else {
646 size_t hdr_len, data_len; 654 size_t hdr_len, data_len;
647 655
648 /* At the very least we need a memory barrier here to ensure 656 /* At the very least we need a memory barrier here to ensure