b43: remove SHM spinlock
authorMichael Buesch <mb@bu3sch.de>
Fri, 4 Sep 2009 20:57:26 +0000 (22:57 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 8 Sep 2009 20:31:08 +0000 (16:31 -0400)
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>
drivers/net/wireless/b43/b43.h
drivers/net/wireless/b43/debugfs.c
drivers/net/wireless/b43/main.c
drivers/net/wireless/b43/main.h

index 1cd470d6e2da6a950bf04b45b9d47971bcd21baf..09cfe68537b6e2a2057a08fc7a6db2b9a9e9b11b 100644 (file)
@@ -635,8 +635,6 @@ struct b43_wl {
        rwlock_t tx_lock;
        /* Lock for LEDs access. */
        spinlock_t leds_lock;
-       /* Lock for SHM access. */
-       spinlock_t shm_lock;
 
        /* We can only have one operating interface (802.11 core)
         * at a time. General information about this interface follows.
index bf23a3a863fa8660c77304ffb0cee9095fa7f04e..8f64943e3f608ae30e7fa1504bd152fd84fadb6b 100644 (file)
@@ -125,7 +125,6 @@ static int shm16write__write_file(struct b43_wldev *dev,
        unsigned int routing, addr, mask, set;
        u16 val;
        int res;
-       unsigned long flags;
 
        res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X",
                     &routing, &addr, &mask, &set);
@@ -142,15 +141,13 @@ static int shm16write__write_file(struct b43_wldev *dev,
        if ((mask > 0xFFFF) || (set > 0xFFFF))
                return -E2BIG;
 
-       spin_lock_irqsave(&dev->wl->shm_lock, flags);
        if (mask == 0)
                val = 0;
        else
-               val = __b43_shm_read16(dev, routing, addr);
+               val = b43_shm_read16(dev, routing, addr);
        val &= mask;
        val |= set;
-       __b43_shm_write16(dev, routing, addr, val);
-       spin_unlock_irqrestore(&dev->wl->shm_lock, flags);
+       b43_shm_write16(dev, routing, addr, val);
 
        return 0;
 }
@@ -204,7 +201,6 @@ static int shm32write__write_file(struct b43_wldev *dev,
        unsigned int routing, addr, mask, set;
        u32 val;
        int res;
-       unsigned long flags;
 
        res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X",
                     &routing, &addr, &mask, &set);
@@ -221,15 +217,13 @@ static int shm32write__write_file(struct b43_wldev *dev,
        if ((mask > 0xFFFFFFFF) || (set > 0xFFFFFFFF))
                return -E2BIG;
 
-       spin_lock_irqsave(&dev->wl->shm_lock, flags);
        if (mask == 0)
                val = 0;
        else
-               val = __b43_shm_read32(dev, routing, addr);
+               val = b43_shm_read32(dev, routing, addr);
        val &= mask;
        val |= set;
-       __b43_shm_write32(dev, routing, addr, val);
-       spin_unlock_irqrestore(&dev->wl->shm_lock, flags);
+       b43_shm_write32(dev, routing, addr, val);
 
        return 0;
 }
index 23de3db4f6de9c45f7f95fd16363eea388491049..0a4d0b3eceb0783c1c882cd4105e58cf07bad104 100644 (file)
@@ -390,7 +390,7 @@ static inline void b43_shm_control_word(struct b43_wldev *dev,
        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;
 
@@ -413,20 +413,7 @@ out:
        return ret;
 }
 
-u32 b43_shm_read32(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 b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset)
 {
        u16 ret;
 
@@ -447,20 +434,7 @@ out:
        return ret;
 }
 
-u16 b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset)
-{
-       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)
+void b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value)
 {
        if (routing == B43_SHM_SHARED) {
                B43_WARN_ON(offset & 0x0001);
@@ -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);
 }
 
-void b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 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)
+void b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value)
 {
        if (routing == B43_SHM_SHARED) {
                B43_WARN_ON(offset & 0x0001);
@@ -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);
 }
 
-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 */
 u64 b43_hf_read(struct b43_wldev *dev)
 {
@@ -4866,7 +4820,6 @@ static int b43_wireless_init(struct ssb_device *dev)
        /* Initialize struct b43_wl */
        wl->hw = hw;
        spin_lock_init(&wl->leds_lock);
-       spin_lock_init(&wl->shm_lock);
        mutex_init(&wl->mutex);
        spin_lock_init(&wl->hardirq_lock);
        INIT_LIST_HEAD(&wl->devlist);
index 0406e06781d4f537460b971313743721533d0892..40db03678d9f68e65ba55ccf6f07fcaf21db5c6f 100644 (file)
@@ -112,13 +112,9 @@ void b43_tsf_read(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);
 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_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);
 void b43_hf_write(struct b43_wldev *dev, u64 value);