Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1360462
| From | Nicholas Mc Guire <hofrat@osadl.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] net: consolidate lock/unlock into unlock_wait |
| Date | 2016-03-18 10:30 +0100 |
| Message-ID | <rdYTg-3Ff-13@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
The spin_lock()/spin_unlock() is synchronizing on the adapter->work_lock
as the comment also suggests, which is equivalent to spin_unlock_wait()
but the later should be more efficient.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
Problem located by coccinelle spatch
Patch was compile tested with: x86_64_defconfig + CONFIG_CHELSIO_T1=m
Patch is against linux-next (localversion-next is next-20160318)
drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
index f5f1b0b..c5a38dc 100644
--- a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
+++ b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
@@ -282,8 +282,8 @@ static int cxgb_close(struct net_device *dev)
!(adapter->open_device_map & PORT_MASK)) {
/* Stop statistics accumulation. */
smp_mb__after_atomic();
- spin_lock(&adapter->work_lock); /* sync with update task */
- spin_unlock(&adapter->work_lock);
+ /* sync with update task */
+ spin_unlock_wait(&adapter->work_lock);
cancel_mac_stats_update(adapter);
}
--
2.1.4
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] net: consolidate lock/unlock into unlock_wait Nicholas Mc Guire <hofrat@osadl.org> - 2016-03-18 10:30 +0100
Re: [PATCH] net: consolidate lock/unlock into unlock_wait David Miller <davem@davemloft.net> - 2016-03-18 22:40 +0100
Re: [PATCH] net: consolidate lock/unlock into unlock_wait Joe Perches <joe@perches.com> - 2016-03-18 23:40 +0100
[RFC net-next 2/2] chelsio: Move original cxgb driver into ancient subdirectory Joe Perches <joe@perches.com> - 2016-03-19 01:40 +0100
[RFC net-next 1/2] drivers/net: Create an ANCIENT_NETDEVICES symbol Joe Perches <joe@perches.com> - 2016-03-19 01:40 +0100
[RFC net-next 0/2] Create ancient subdirectories for old hardware Joe Perches <joe@perches.com> - 2016-03-19 01:40 +0100
Re: [RFC net-next 0/2] Create ancient subdirectories for old hardware David Miller <davem@davemloft.net> - 2016-03-19 03:20 +0100
Re: [RFC net-next 0/2] Create ancient subdirectories for old hardware Joe Perches <joe@perches.com> - 2016-03-19 03:30 +0100
Re: [RFC net-next 0/2] Create ancient subdirectories for old hardware David Miller <davem@davemloft.net> - 2016-03-19 04:20 +0100
Re: [RFC net-next 0/2] Create ancient subdirectories for old hardware Joe Perches <joe@perches.com> - 2016-03-19 16:40 +0100
Re: [PATCH] net: consolidate lock/unlock into unlock_wait Nicholas Mc Guire <der.herr@hofr.at> - 2016-03-19 09:30 +0100
csiph-web