From: Stephen Hemminger <shemminger@vyatta.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Mike McCormack <mikem@ring3k.org>
Subject: [PATCH 6/8] sky2: Lock tx queue when calling sky2_down locally
Date: Thu, 06 Aug 2009 09:12:19 -0700 [thread overview]
Message-ID: <20090806161232.922207774@vyatta.com> (raw)
In-Reply-To: 20090806161213.148382653@vyatta.com
[-- Attachment #1: sky2-tx5.patch --]
[-- Type: text/plain, Size: 1331 bytes --]
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/sky2.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index dbedee4..972c716 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3078,10 +3078,13 @@ static void sky2_restart(struct work_struct *work)
int i, err;
rtnl_lock();
+
for (i = 0; i < hw->ports; i++) {
dev = hw->dev[i];
- if (netif_running(dev))
+ if (netif_running(dev)) {
+ netif_tx_lock(dev);
sky2_down(dev);
+ }
}
napi_disable(&hw->napi);
@@ -3099,6 +3102,8 @@ static void sky2_restart(struct work_struct *work)
dev->name, err);
dev_close(dev);
}
+ else
+ netif_tx_unlock(dev);
}
}
@@ -3697,8 +3702,10 @@ static int sky2_set_ringparam(struct net_device *dev,
ering->tx_pending > TX_RING_SIZE - 1)
return -EINVAL;
- if (netif_running(dev))
+ if (netif_running(dev)) {
+ netif_tx_lock(dev);
sky2_down(dev);
+ }
sky2->rx_pending = ering->rx_pending;
sky2->tx_pending = ering->tx_pending;
@@ -3707,6 +3714,8 @@ static int sky2_set_ringparam(struct net_device *dev,
err = sky2_up(dev);
if (err)
dev_close(dev);
+ else
+ netif_tx_unlock(dev);
}
return err;
--
1.5.6.5
--
next prev parent reply other threads:[~2009-08-06 16:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-06 16:12 [PATCH 0/8] sky2: driver update Stephen Hemminger
2009-08-06 16:12 ` [PATCH 1/8] Revert "sky2: Avoid transmits during sky2_down()" Stephen Hemminger
2009-08-06 16:12 ` [PATCH 2/8] sky2: Avoid rewinding sky2->tx_prod Stephen Hemminger
2009-08-06 16:12 ` [PATCH 3/8] sky2: Move tx reset functionality to sky2_tx_reset() Stephen Hemminger
2009-08-06 16:12 ` [PATCH 4/8] sky2: Reset tx train after interrupts disabled Stephen Hemminger
2009-08-06 16:12 ` [PATCH 5/8] sky2: Remove tx locks Stephen Hemminger
2009-08-06 16:12 ` Stephen Hemminger [this message]
2009-08-06 16:12 ` [PATCH 7/8] sky2: hold RTNL when doing suspend/shutdown operations Stephen Hemminger
2009-08-06 16:12 ` [PATCH 8/8] sky2: hold spinlock around phy_power_down Stephen Hemminger
2009-08-10 4:09 ` [PATCH 0/8] sky2: driver update David Miller
2009-08-10 15:48 ` Stephen Hemminger
2009-08-11 0:52 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090806161232.922207774@vyatta.com \
--to=shemminger@vyatta.com \
--cc=davem@davemloft.net \
--cc=mikem@ring3k.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).