* [PATCH net-2.6 1/9] sfc: Wait at most 10ms for the MC to finish reading out MAC statistics
@ 2010-04-23 22:23 Ben Hutchings
2010-04-23 22:33 ` Ben Hutchings
0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2010-04-23 22:23 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
From: Steve Hodgson <shodgson@solarflare.com>
The original code would wait indefinitely if MAC stats DMA failed.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/sfc/siena.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c
index 38dcc42..e0c46f5 100644
--- a/drivers/net/sfc/siena.c
+++ b/drivers/net/sfc/siena.c
@@ -456,8 +456,17 @@ static int siena_try_update_nic_stats(struct efx_nic *efx)
static void siena_update_nic_stats(struct efx_nic *efx)
{
- while (siena_try_update_nic_stats(efx) == -EAGAIN)
- cpu_relax();
+ int retry;
+
+ /* If we're unlucky enough to read statistics wduring the DMA, wait
+ * up to 10ms for it to finish (typically takes <500us) */
+ for (retry = 0; retry < 100; ++retry) {
+ if (siena_try_update_nic_stats(efx) == 0)
+ return;
+ udelay(100);
+ }
+
+ /* Use the old values instead */
}
static void siena_start_nic_stats(struct efx_nic *efx)
--
1.6.2.5
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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] 5+ messages in thread
* Re: [PATCH net-2.6 1/9] sfc: Wait at most 10ms for the MC to finish reading out MAC statistics
2010-04-23 22:23 [PATCH net-2.6 1/9] sfc: Wait at most 10ms for the MC to finish reading out MAC statistics Ben Hutchings
@ 2010-04-23 22:33 ` Ben Hutchings
2010-04-23 22:36 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2010-04-23 22:33 UTC (permalink / raw)
To: David Miller; +Cc: netdev, sf-linux-drivers
All of these 9 patches should also be applicable to 2.6.33.y, except
that one hunk of "sfc: Consistently report short MCDI responses as EIO"
is not applicable and should be dropped.
Some of the bug fixes are applicable to 2.6.32.y and maybe to 2.6.27.y,
but the patches will need some adjustment. I intend to send backported
patches to stable@kernel.org separately.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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] 5+ messages in thread
* Re: [PATCH net-2.6 1/9] sfc: Wait at most 10ms for the MC to finish reading out MAC statistics
2010-04-23 22:33 ` Ben Hutchings
@ 2010-04-23 22:36 ` David Miller
2010-04-23 22:54 ` Ben Hutchings
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2010-04-23 22:36 UTC (permalink / raw)
To: bhutchings; +Cc: netdev, linux-net-drivers
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 23 Apr 2010 23:33:28 +0100
> All of these 9 patches should also be applicable to 2.6.33.y, except
> that one hunk of "sfc: Consistently report short MCDI responses as EIO"
> is not applicable and should be dropped.
>
> Some of the bug fixes are applicable to 2.6.32.y and maybe to 2.6.27.y,
> but the patches will need some adjustment. I intend to send backported
> patches to stable@kernel.org separately.
There is zero way I'm applying 9 patches this late in the RC
series.
If you want this stuff to go into net-2.6 and get backported
to -stable, pick a very small (2 or 3) set of the most important
fixes.
Consistent -EIO error code returns and junk like that are
not appropriate this late in the RC, and definitely not -stable
material.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-2.6 1/9] sfc: Wait at most 10ms for the MC to finish reading out MAC statistics
2010-04-23 22:36 ` David Miller
@ 2010-04-23 22:54 ` Ben Hutchings
2010-04-23 22:58 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2010-04-23 22:54 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
On Fri, 2010-04-23 at 15:36 -0700, David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Fri, 23 Apr 2010 23:33:28 +0100
>
> > All of these 9 patches should also be applicable to 2.6.33.y, except
> > that one hunk of "sfc: Consistently report short MCDI responses as EIO"
> > is not applicable and should be dropped.
> >
> > Some of the bug fixes are applicable to 2.6.32.y and maybe to 2.6.27.y,
> > but the patches will need some adjustment. I intend to send backported
> > patches to stable@kernel.org separately.
>
> There is zero way I'm applying 9 patches this late in the RC
> series.
>
> If you want this stuff to go into net-2.6 and get backported
> to -stable, pick a very small (2 or 3) set of the most important
> fixes.
This makes no sense. You want to put a quota on bug fixes? I could
arbitrarily pick some but I'm still going to want to get the other fixes
into distributions.
> Consistent -EIO error code returns and junk like that are
> not appropriate this late in the RC, and definitely not -stable
> material.
The important part of that change is that functions were returning 0 in
a failure case. I should have made that the first sentence in the
commit message. I didn't see the point in making a separate commit to
fix the wrong error codes, but I can split this up if you prefer.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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] 5+ messages in thread
* Re: [PATCH net-2.6 1/9] sfc: Wait at most 10ms for the MC to finish reading out MAC statistics
2010-04-23 22:54 ` Ben Hutchings
@ 2010-04-23 22:58 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-04-23 22:58 UTC (permalink / raw)
To: bhutchings; +Cc: netdev, linux-net-drivers
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 23 Apr 2010 23:54:30 +0100
> This makes no sense. You want to put a quota on bug fixes? I could
> arbitrarily pick some but I'm still going to want to get the other fixes
> into distributions.
It's not a quota. It's a request that only the most catastropic
bugs get fixed this late in the RC.
You don't have 9 catastropic bugs to fix in your driver.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-04-23 22:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-23 22:23 [PATCH net-2.6 1/9] sfc: Wait at most 10ms for the MC to finish reading out MAC statistics Ben Hutchings
2010-04-23 22:33 ` Ben Hutchings
2010-04-23 22:36 ` David Miller
2010-04-23 22:54 ` Ben Hutchings
2010-04-23 22:58 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox