Commit 69eddc8a authored by Michael Buesch's avatar Michael Buesch Committed by John W. Linville

b43: remove SHM spinlock

This removes the SHM spinlock.
SHM is protected by wl->mutex.
Signed-off-by: default avatarMichael Buesch <mb@bu3sch.de>
Tested-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 77ca07ff
...@@ -635,8 +635,6 @@ struct b43_wl { ...@@ -635,8 +635,6 @@ struct b43_wl {
rwlock_t tx_lock; rwlock_t tx_lock;
/* Lock for LEDs access. */ /* Lock for LEDs access. */
spinlock_t leds_lock; spinlock_t leds_lock;
/* Lock for SHM access. */
spinlock_t shm_lock;
/* We can only have one operating interface (802.11 core) /* We can only have one operating interface (802.11 core)
* at a time. General information about this interface follows. * at a time. General information about this interface follows.
......
...@@ -125,7 +125,6 @@ static int shm16write__write_file(struct b43_wldev *dev, ...@@ -125,7 +125,6 @@ static int shm16write__write_file(struct b43_wldev *dev,
unsigned int routing, addr, mask, set; unsigned int routing, addr, mask, set;
u16 val; u16 val;
int res; int res;
unsigned long flags;
res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X", res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X",
&routing, &addr, &mask, &set); &routing, &addr, &mask, &set);
...@@ -142,15 +141,13 @@ static int shm16write__write_file(struct b43_wldev *dev, ...@@ -142,15 +141,13 @@ static int shm16write__write_file(struct b43_wldev *dev,
if ((mask > 0xFFFF) || (set > 0xFFFF)) if ((mask > 0xFFFF) || (set > 0xFFFF))
return -E2BIG; return -E2BIG;
spin_lock_irqsave(&dev->wl->shm_lock, flags);
if (mask == 0) if (mask == 0)
val = 0; val = 0;
else else
val = __b43_shm_read16(dev, routing, addr); val = b43_shm_read16(dev, routing, addr);
val &= mask; val &= mask;
val |= set; val |= set;
__b43_shm_write16(dev, routing, addr, val); b43_shm_write16(dev, routing, addr, val);
spin_unlock_irqrestore(&dev->wl->shm_lock, flags);
return 0; return 0;
} }
...@@ -204,7 +201,6 @@ static int shm32write__write_file(struct b43_wldev *dev, ...@@ -204,7 +201,6 @@ static int shm32write__write_file(struct b43_wldev *dev,
unsigned int routing, addr, mask, set; unsigned int routing, addr, mask, set;
u32 val; u32 val;
int res; int res;
unsigned long flags;
res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X", res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X",
&routing, &addr, &mask, &set); &routing, &addr, &mask, &set);
...@@ -221,15 +217,13 @@ static int shm32write__write_file(struct b43_wldev *dev, ...@@ -221,15 +217,13 @@ static int shm32write__write_file(struct b43_wldev *dev,
if ((mask > 0xFFFFFFFF) || (set > 0xFFFFFFFF)) if ((mask > 0xFFFFFFFF) || (set > 0xFFFFFFFF))
return -E2BIG; return -E2BIG;
spin_lock_irqsave(&dev->wl->shm_lock, flags);
if (mask == 0) if (mask == 0)
val = 0; val = 0;
else else
val = __b43_shm_read32(dev, routing, addr); val = b43_shm_read32(dev, routing, addr);
val &= mask; val &= mask;
val |= set; val |= set;
__b43_shm_write32(dev, routing, addr, val); b43_shm_write32(dev, routing, addr, val);
spin_unlock_irqrestore(&dev->wl->shm_lock, flags);
return 0; return 0;
} }
......
...@@ -390,7 +390,7 @@ static inline void b43_shm_control_word(struct b43_wldev *dev, ...@@ -390,7 +390,7 @@ static inline void b43_shm_control_word(struct b43_wldev *dev,
b43_write32(dev, B43_MMIO_SHM_CONTROL, control); b43_write32(dev, B43_MMIO_SHM_CONTROL, control);
} }
u32 __b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset) u32 b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset)
{ {
u32 ret; u32 ret;
...@@ -413,20 +413,7 @@ out: ...@@ -413,20 +413,7 @@ out:
return ret; return ret;
} }
u32 b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset) u16 b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset)
{
struct b43_wl *wl = dev->wl;
unsigned long flags;
u32 ret;
spin_lock_irqsave(&wl->shm_lock, flags);
ret = __b43_shm_read32(dev, routing, offset);
spin_unlock_irqrestore(&wl->shm_lock, flags);
return ret;
}
u16 __b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset)
{ {
u16 ret; u16 ret;
...@@ -447,20 +434,7 @@ out: ...@@ -447,20 +434,7 @@ out:
return ret; return ret;
} }
u16 b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset) void b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value)
{
struct b43_wl *wl = dev->wl;
unsigned long flags;
u16 ret;
spin_lock_irqsave(&wl->shm_lock, flags);
ret = __b43_shm_read16(dev, routing, offset);
spin_unlock_irqrestore(&wl->shm_lock, flags);
return ret;
}
void __b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value)
{ {
if (routing == B43_SHM_SHARED) { if (routing == B43_SHM_SHARED) {
B43_WARN_ON(offset & 0x0001); B43_WARN_ON(offset & 0x0001);
...@@ -480,17 +454,7 @@ void __b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value ...@@ -480,17 +454,7 @@ void __b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value
b43_write32(dev, B43_MMIO_SHM_DATA, value); b43_write32(dev, B43_MMIO_SHM_DATA, value);
} }
void b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value) void b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value)
{
struct b43_wl *wl = dev->wl;
unsigned long flags;
spin_lock_irqsave(&wl->shm_lock, flags);
__b43_shm_write32(dev, routing, offset, value);
spin_unlock_irqrestore(&wl->shm_lock, flags);
}
void __b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value)
{ {
if (routing == B43_SHM_SHARED) { if (routing == B43_SHM_SHARED) {
B43_WARN_ON(offset & 0x0001); B43_WARN_ON(offset & 0x0001);
...@@ -506,16 +470,6 @@ void __b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value ...@@ -506,16 +470,6 @@ void __b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value
b43_write16(dev, B43_MMIO_SHM_DATA, value); b43_write16(dev, B43_MMIO_SHM_DATA, value);
} }
void b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value)
{
struct b43_wl *wl = dev->wl;
unsigned long flags;
spin_lock_irqsave(&wl->shm_lock, flags);
__b43_shm_write16(dev, routing, offset, value);
spin_unlock_irqrestore(&wl->shm_lock, flags);
}
/* Read HostFlags */ /* Read HostFlags */
u64 b43_hf_read(struct b43_wldev *dev) u64 b43_hf_read(struct b43_wldev *dev)
{ {
...@@ -4866,7 +4820,6 @@ static int b43_wireless_init(struct ssb_device *dev) ...@@ -4866,7 +4820,6 @@ static int b43_wireless_init(struct ssb_device *dev)
/* Initialize struct b43_wl */ /* Initialize struct b43_wl */
wl->hw = hw; wl->hw = hw;
spin_lock_init(&wl->leds_lock); spin_lock_init(&wl->leds_lock);
spin_lock_init(&wl->shm_lock);
mutex_init(&wl->mutex); mutex_init(&wl->mutex);
spin_lock_init(&wl->hardirq_lock); spin_lock_init(&wl->hardirq_lock);
INIT_LIST_HEAD(&wl->devlist); INIT_LIST_HEAD(&wl->devlist);
......
...@@ -112,13 +112,9 @@ void b43_tsf_read(struct b43_wldev *dev, u64 * tsf); ...@@ -112,13 +112,9 @@ void b43_tsf_read(struct b43_wldev *dev, u64 * tsf);
void b43_tsf_write(struct b43_wldev *dev, u64 tsf); void b43_tsf_write(struct b43_wldev *dev, u64 tsf);
u32 b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset); u32 b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset);
u32 __b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset);
u16 b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset); u16 b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset);
u16 __b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset);
void b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value); void b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value);
void __b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value);
void b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value); void b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value);
void __b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value);
u64 b43_hf_read(struct b43_wldev *dev); u64 b43_hf_read(struct b43_wldev *dev);
void b43_hf_write(struct b43_wldev *dev, u64 value); void b43_hf_write(struct b43_wldev *dev, u64 value);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment