netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Pull request: sfc 2013-09-21
@ 2013-09-21 17:45 Ben Hutchings
  2013-09-21 17:47 ` [PATCH net 1/2] sfc: Wait for MC reboot to complete before scheduling driver reset Ben Hutchings
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ben Hutchings @ 2013-09-21 17:45 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

The following changes since commit dcb30e659287a6b40dafed1362532da42ec27229:

  Merge tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64 (2013-09-20 08:18:51 -0500)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc.git sfc-3.12

for you to fetch changes up to b2d32f03e67cc9b0ad16fc1fff87edf90f059883:

  sfc: Increase MCDI status timeout to 250ms (2013-09-20 17:24:35 +0100)

Daniel Pieczko fixed two bugs in reset handling that particularly
affected the new SFC9120 controller.

Ben.

----------------------------------------------------------------
Daniel Pieczko (2):
      sfc: Wait for MC reboot to complete before scheduling driver reset
      sfc: Increase MCDI status timeout to 250ms

 drivers/net/ethernet/sfc/mcdi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] sfc: Wait for MC reboot to complete before scheduling driver reset
  2013-09-21 17:45 Pull request: sfc 2013-09-21 Ben Hutchings
@ 2013-09-21 17:47 ` Ben Hutchings
  2013-09-21 17:47 ` [PATCH net 2/2] sfc: Increase MCDI status timeout to 250ms Ben Hutchings
  2013-09-21 18:21 ` Pull request: sfc 2013-09-21 David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Hutchings @ 2013-09-21 17:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

From: Daniel Pieczko <dpieczko@solarflare.com>

Scheduling a reset following an MC reboot event before waiting for
reboot to complete results in a race that can lead to a state where
must_realloc_vis is false in efx_ef10_fini_dmaq() but the VIs have
been destroyed during the MC reboot.

To avoid MC errors when trying to remove VIs that do not exist, wait
for the MC reboot to complete before scheduling the reset.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/ethernet/sfc/mcdi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
index 128d7cd..73143ec 100644
--- a/drivers/net/ethernet/sfc/mcdi.c
+++ b/drivers/net/ethernet/sfc/mcdi.c
@@ -800,9 +800,6 @@ static void efx_mcdi_ev_death(struct efx_nic *efx, int rc)
 	} else {
 		int count;
 
-		/* Nobody was waiting for an MCDI request, so trigger a reset */
-		efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE);
-
 		/* Consume the status word since efx_mcdi_rpc_finish() won't */
 		for (count = 0; count < MCDI_STATUS_DELAY_COUNT; ++count) {
 			if (efx_mcdi_poll_reboot(efx))
@@ -810,6 +807,9 @@ static void efx_mcdi_ev_death(struct efx_nic *efx, int rc)
 			udelay(MCDI_STATUS_DELAY_US);
 		}
 		mcdi->new_epoch = true;
+
+		/* Nobody was waiting for an MCDI request, so trigger a reset */
+		efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE);
 	}
 
 	spin_unlock(&mcdi->iface_lock);


-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] sfc: Increase MCDI status timeout to 250ms
  2013-09-21 17:45 Pull request: sfc 2013-09-21 Ben Hutchings
  2013-09-21 17:47 ` [PATCH net 1/2] sfc: Wait for MC reboot to complete before scheduling driver reset Ben Hutchings
@ 2013-09-21 17:47 ` Ben Hutchings
  2013-09-21 18:21 ` Pull request: sfc 2013-09-21 David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Hutchings @ 2013-09-21 17:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

From: Daniel Pieczko <dpieczko@solarflare.com>

The SFC9120 MC firmware often takes longer than 20ms to reboot and
update the warm boot count in BIU_MC_SFT_STATUS_REG.  A timeout of
250ms is very generous for an MC reboot.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/ethernet/sfc/mcdi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
index 73143ec..c082562 100644
--- a/drivers/net/ethernet/sfc/mcdi.c
+++ b/drivers/net/ethernet/sfc/mcdi.c
@@ -27,10 +27,10 @@
 
 /* A reboot/assertion causes the MCDI status word to be set after the
  * command word is set or a REBOOT event is sent. If we notice a reboot
- * via these mechanisms then wait 20ms for the status word to be set.
+ * via these mechanisms then wait 250ms for the status word to be set.
  */
 #define MCDI_STATUS_DELAY_US		100
-#define MCDI_STATUS_DELAY_COUNT		200
+#define MCDI_STATUS_DELAY_COUNT		2500
 #define MCDI_STATUS_SLEEP_MS						\
 	(MCDI_STATUS_DELAY_US * MCDI_STATUS_DELAY_COUNT / 1000)
 

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Pull request: sfc 2013-09-21
  2013-09-21 17:45 Pull request: sfc 2013-09-21 Ben Hutchings
  2013-09-21 17:47 ` [PATCH net 1/2] sfc: Wait for MC reboot to complete before scheduling driver reset Ben Hutchings
  2013-09-21 17:47 ` [PATCH net 2/2] sfc: Increase MCDI status timeout to 250ms Ben Hutchings
@ 2013-09-21 18:21 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-09-21 18:21 UTC (permalink / raw)
  To: bhutchings; +Cc: netdev, linux-net-drivers

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Sat, 21 Sep 2013 18:45:04 +0100

>   git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc.git sfc-3.12
 ...
> Daniel Pieczko fixed two bugs in reset handling that particularly
> affected the new SFC9120 controller.

Pulled, thanks Ben.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-21 18:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-21 17:45 Pull request: sfc 2013-09-21 Ben Hutchings
2013-09-21 17:47 ` [PATCH net 1/2] sfc: Wait for MC reboot to complete before scheduling driver reset Ben Hutchings
2013-09-21 17:47 ` [PATCH net 2/2] sfc: Increase MCDI status timeout to 250ms Ben Hutchings
2013-09-21 18:21 ` Pull request: sfc 2013-09-21 David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).