aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-09-04 16:57:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-09-08 16:31:08 -0400
commit69eddc8a37a33479205ac3a3d8575fad1466da90 (patch)
tree6e8f903b3d04d3a9ce85ab10e8f5a767224039c9 /drivers
parent77ca07ffe1797a0f2f41aa4997c9a5ae433a0be8 (diff)
b43: remove SHM spinlock
This removes the SHM spinlock. SHM is protected by wl->mutex. Signed-off-by: Michael Buesch <mb@bu3sch.de> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/b43.h2
-rw-r--r--drivers/net/wireless/b43/debugfs.c14
-rw-r--r--drivers/net/wireless/b43/main.c55
-rw-r--r--drivers/net/wireless/b43/main.h4
4 files changed, 8 insertions, 67 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index 1cd470d6e2da..09cfe68537b6 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -635,8 +635,6 @@ struct b43_wl {
635 rwlock_t tx_lock; 635 rwlock_t tx_lock;
636 /* Lock for LEDs access. */ 636 /* Lock for LEDs access. */
637 spinlock_t leds_lock; 637 spinlock_t leds_lock;
638 /* Lock for SHM access. */
639 spinlock_t shm_lock;
640 638
641 /* We can only have one operating interface (802.11 core) 639 /* We can only have one operating interface (802.11 core)
642 * at a time. General information about this interface follows. 640 * at a time. General information about this interface follows.
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c
index bf23a3a863fa..8f64943e3f60 100644
--- a/drivers/net/wireless/b43/debugfs.c
+++ b/drivers/net/wireless/b43/debugfs.c
@@ -125,7 +125,6 @@ static int shm16write__write_file(struct b43_wldev *dev,
125 unsigned int routing, addr, mask, set; 125 unsigned int routing, addr, mask, set;
126 u16 val; 126 u16 val;
127 int res; 127 int res;
128 unsigned long flags;
129 128
130 res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X", 129 res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X",
131 &routing, &addr, &mask, &set); 130 &routing, &addr, &mask, &set);
@@ -142,15 +141,13 @@ static int shm16write__write_file(struct b43_wldev *dev,
142 if ((mask > 0xFFFF) || (set > 0xFFFF)) 141 if ((mask > 0xFFFF) || (set > 0xFFFF))
143 return -E2BIG; 142 return -E2BIG;
144 143
145 spin_lock_irqsave(&dev->wl->shm_lock, flags);
146 if (mask == 0) 144 if (mask == 0)
147 val = 0; 145 val = 0;
148 else 146 else
149 val = __b43_shm_read16(dev, routing, addr); 147 val = b43_shm_read16(dev, routing, addr);
150 val &= mask; 148 val &= mask;
151 val |= set; 149 val |= set;
152 __b43_shm_write16(dev, routing, addr, val); 150 b43_shm_write16(dev, routing, addr, val);
153 spin_unlock_irqrestore(&dev->wl->shm_lock, flags);
154 151
155 return 0; 152 return 0;
156} 153}
@@ -204,7 +201,6 @@ static int shm32write__write_file(struct b43_wldev *dev,
204 unsigned int routing, addr, mask, set; 201 unsigned int routing, addr, mask, set;
205 u32 val; 202 u32 val;
206 int res; 203 int res;
207 unsigned long flags;
208 204
209 res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X", 205 res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X",
210 &routing, &addr, &mask, &set); 206 &routing, &addr, &mask, &set);
@@ -221,15 +217,13 @@ static int shm32write__write_file(struct b43_wldev *dev,
221 if ((mask > 0xFFFFFFFF) || (set > 0xFFFFFFFF)) 217 if ((mask > 0xFFFFFFFF) || (set > 0xFFFFFFFF))
222 return -E2BIG; 218 return -E2BIG;
223 219
224 spin_lock_irqsave(&dev->wl->shm_lock, flags);
225 if (mask == 0) 220 if (mask == 0)
226 val = 0; 221 val = 0;
227 else 222 else
228 val = __b43_shm_read32(dev, routing, addr); 223 val = b43_shm_read32(dev, routing, addr);
229 val &= mask; 224 val &= mask;
230 val |= set; 225 val |= set;
231 __b43_shm_write32(dev, routing, addr, val); 226 b43_shm_write32(dev, routing, addr, val);
232 spin_unlock_irqrestore(&dev->wl->shm_lock, flags);
233 227
234 return 0; 228 return 0;
235} 229}
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 23de3db4f6de..0a4d0b3eceb0 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -390,7 +390,7 @@ static inline void b43_shm_control_word(struct b43_wldev *dev,
390 b43_write32(dev, B43_MMIO_SHM_CONTROL, control); 390 b43_write32(dev, B43_MMIO_SHM_CONTROL, control);
391} 391}
392 392
393u32 __b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset) 393u32 b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset)
394{ 394{
395 u32 ret; 395 u32 ret;
396 396
@@ -413,20 +413,7 @@ out:
413 return ret; 413 return ret;
414} 414}
415 415
416u32 b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset) 416u16 b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset)
417{
418 struct b43_wl *wl = dev->wl;
419 unsigned long flags;
420 u32 ret;
421
422 spin_lock_irqsave(&wl->shm_lock, flags);
423 ret = __b43_shm_read32(dev, routing, offset);
424 spin_unlock_irqrestore(&wl->shm_lock, flags);
425
426 return ret;
427}
428
429u16 __b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset)
430{ 417{
431 u16 ret; 418 u16 ret;
432 419
@@ -447,20 +434,7 @@ out:
447 return ret; 434 return ret;
448} 435}
449 436
450u16 b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset) 437void b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value)
451{
452 struct b43_wl *wl = dev->wl;
453 unsigned long flags;
454 u16 ret;
455
456 spin_lock_irqsave(&wl->shm_lock, flags);
457 ret = __b43_shm_read16(dev, routing, offset);
458 spin_unlock_irqrestore(&wl->shm_lock, flags);
459
460 return ret;
461}
462
463void __b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value)
464{ 438{
465 if (routing == B43_SHM_SHARED) { 439 if (routing == B43_SHM_SHARED) {
466 B43_WARN_ON(offset & 0x0001); 440 B43_WARN_ON(offset & 0x0001);
@@ -480,17 +454,7 @@ void __b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value
480 b43_write32(dev, B43_MMIO_SHM_DATA, value); 454 b43_write32(dev, B43_MMIO_SHM_DATA, value);
481} 455}
482 456
483void b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value) 457void b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value)
484{
485 struct b43_wl *wl = dev->wl;
486 unsigned long flags;
487
488 spin_lock_irqsave(&wl->shm_lock, flags);
489 __b43_shm_write32(dev, routing, offset, value);
490 spin_unlock_irqrestore(&wl->shm_lock, flags);
491}
492
493void __b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value)
494{ 458{
495 if (routing == B43_SHM_SHARED) { 459 if (routing == B43_SHM_SHARED) {
496 B43_WARN_ON(offset & 0x0001); 460 B43_WARN_ON(offset & 0x0001);
@@ -506,16 +470,6 @@ void __b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value
506 b43_write16(dev, B43_MMIO_SHM_DATA, value); 470 b43_write16(dev, B43_MMIO_SHM_DATA, value);
507} 471}
508 472
509void b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value)
510{
511 struct b43_wl *wl = dev->wl;
512 unsigned long flags;
513
514 spin_lock_irqsave(&wl->shm_lock, flags);
515 __b43_shm_write16(dev, routing, offset, value);
516 spin_unlock_irqrestore(&wl->shm_lock, flags);
517}
518
519/* Read HostFlags */ 473/* Read HostFlags */
520u64 b43_hf_read(struct b43_wldev *dev) 474u64 b43_hf_read(struct b43_wldev *dev)
521{ 475{
@@ -4866,7 +4820,6 @@ static int b43_wireless_init(struct ssb_device *dev)
4866 /* Initialize struct b43_wl */ 4820 /* Initialize struct b43_wl */
4867 wl->hw = hw; 4821 wl->hw = hw;
4868 spin_lock_init(&wl->leds_lock); 4822 spin_lock_init(&wl->leds_lock);
4869 spin_lock_init(&wl->shm_lock);
4870 mutex_init(&wl->mutex); 4823 mutex_init(&wl->mutex);
4871 spin_lock_init(&wl->hardirq_lock); 4824 spin_lock_init(&wl->hardirq_lock);
4872 INIT_LIST_HEAD(&wl->devlist); 4825 INIT_LIST_HEAD(&wl->devlist);
diff --git a/drivers/net/wireless/b43/main.h b/drivers/net/wireless/b43/main.h
index 0406e06781d4..40db03678d9f 100644
--- a/drivers/net/wireless/b43/main.h
+++ b/drivers/net/wireless/b43/main.h
@@ -112,13 +112,9 @@ void b43_tsf_read(struct b43_wldev *dev, u64 * tsf);
112void b43_tsf_write(struct b43_wldev *dev, u64 tsf); 112void b43_tsf_write(struct b43_wldev *dev, u64 tsf);
113 113
114u32 b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset); 114u32 b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset);
115u32 __b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset);
116u16 b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset); 115u16 b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset);
117u16 __b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset);
118void b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value); 116void b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value);
119void __b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value);
120void b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value); 117void b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value);
121void __b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value);
122 118
123u64 b43_hf_read(struct b43_wldev *dev); 119u64 b43_hf_read(struct b43_wldev *dev);
124void b43_hf_write(struct b43_wldev *dev, u64 value); 120void b43_hf_write(struct b43_wldev *dev, u64 value);